tdem-web-sdk 1.0.14 → 1.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * ===========================================================================
3
- * tdem-web-sdk@1.0.14 (c) 2026 TencentCloud Real User Monitoring.
3
+ * tdem-web-sdk@1.0.16 (c) 2026 TencentCloud Real User Monitoring.
4
4
  * Author pumpkincai.
5
- * Last Release Time Thu Nov 19 2026 16:45:19 GMT+0800 (China Standard Time).
5
+ * Last Release Time Wed Nov 25 2026 10:54:09 GMT+0800 (China Standard Time).
6
6
  * Released under the MIT License.
7
7
  * Thanks for supporting TDEM!
8
8
  * ===========================================================================
9
9
  **/
10
- var TDEM=(w=>{var S,E;function C(e){this.name="__st"+(1e9*Math.random()>>>0)+S+"__",null!=e&&e.forEach(this.add,this),S+=1}Array.prototype.find||Object.defineProperty(Array.prototype,"find",{configurable:!0,writable:!0,value:function(e){if(null===this)throw new TypeError('"this" is null or not defined');var t=Object(this),n=t.length>>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var r=arguments[1],i=0;i<n;){var o=t[i];if(e.call(r,o,i,t))return o;i+=1}}}),window.WeakSet||(S=Date.now()%1e9,C.prototype.add=function(e){var t=this.name;return e[t]||Object.defineProperty(e,t,{value:!0,writable:!0}),this},C.prototype.delete=function(e){return!!e[this.name]&&!(e[this.name]=void 0)},C.prototype.has=function(e){return!!e[this.name]},E=C,Object.defineProperty(window,"WeakSet",{value:function(e){return new E(e)}})),Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(null==e)throw new TypeError("Cannot convert first argument to object");for(var t=Object(e),n=1;n<arguments.length;n++)if(null!=(r=arguments[n]))for(var r=Object(r),i=Object.keys(Object(r)),o=0,s=i.length;o<s;o++){var a=i[o],l=Object.getOwnPropertyDescriptor(r,a);null!=l&&l.enumerable&&(t[a]=r[a])}return t}});var R=function(e,t){return(R=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(e,t)};function T(e,t){function n(){this.constructor=e}R(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var x=function(){return(x=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function D(e,s,a,l){return new(a=a||Promise)(function(n,t){function r(e){try{o(l.next(e))}catch(e){t(e)}}function i(e){try{o(l.throw(e))}catch(e){t(e)}}function o(e){var t;e.done?n(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(r,i)}o((l=l.apply(e,s||[])).next())})}function L(r,i){var o,s,a,l={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(n){return function(e){var t=[n,e];if(o)throw new TypeError("Generator is already executing.");for(;l;)try{if(o=1,s&&(a=2&t[0]?s.return:t[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,t[1])).done)return a;switch(s=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,s=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!((a=0<(a=l.trys).length&&a[a.length-1])||6!==t[0]&&2!==t[0])){l=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3]))l.label=t[1];else if(6===t[0]&&l.label<a[1])l.label=a[1],a=t;else{if(!(a&&l.label<a[2])){a[2]&&l.ops.pop(),l.trys.pop();continue}l.label=a[2],l.ops.push(t)}}t=i.call(r,l)}catch(e){t=[6,e],s=0}finally{o=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}}function g(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),i=0,t=0;t<n;t++)for(var o=arguments[t],s=0,a=o.length;s<a;s++,i++)r[i]=o[s];return r}function O(e,t){return void 0===t&&(t="https://dem.rumt-zh.com"),t=(e.url||"").replace(/\/+$/,"")||("string"==typeof t?t:"https://dem.rumt-zh.com"),e.url=t,e.hostUrl=t,e.offlineUrl=t+"/offline",e.whiteListUrl=t+"/collect/whitelist",e.pvUrl=t+"/collect/pv",e.eventUrl=t+"/collect/events",e.speedUrl=t+"/speed",e.customTimeUrl=t+"/speed/custom",e.performanceUrl=t+"/speed/performance",e.performanceUrlForHippy=t+"/speed/hippyPerformance",e.webVitalsUrl=t+"/speed/webvitals",e.setDataReportUrl=t+"/speed/miniProgramData",e}function F(e){try{return localStorage.getItem(e)}catch(e){return null}}function U(e,t){try{localStorage.setItem(e,t)}catch(e){}}function z(e,t){try{return e?JSON.parse(e):t}catch(e){return t}}var B,j=/_?t(\d)?(imestamp)?=\d+&?/g,W=["aegis.qq.com","tamaegis.com","/aegis-sdk","rumt-","/flog.core.min.js","pingfore.qq.com","pingfore.tencent.com","zhiyan.tencent-cloud.net","h.trace.qq.com","btrace.qq.com","beacon.qq.com","dmplog.qq.com","qq.com/report","svibeacon.onezapp.com","cube.weixinbridge.com","doubleclick.net","pcmgrmonitor.3g.qq.com","tdm.qq.com","report.qqweb.qq.com","tpstelemetry.tencent.com","galileotelemetry.tencent.com","insight.cloud.tencent.com","facebook.com","facebook.net","google","yahoo.com","twitter.com","ga-audiences","report.idqqimg.com","arms-retcode.aliyuncs.com","px.effirst.com","sentry","baidu.com","hot-update.json","u.c.b.r.o.w.s.e.r","report.url.cn","sockjs-node","m3u8","flv"],H=["ResizeObserver loop limit exceeded","ResizeObserver loop completed","Failed to execute 'transaction'","window.indexedDB.deleteDatabase is not a function"],q=["ext1","ext2","ext3","ext4","ext5","ext6","ext7","ext8","ext9","ext10","level","trace","tag","seq","code"],V=["static","fetch"],G="unknown",Z=(J.prototype.indexOf=function(e,t){for(var n=0;n<e.length;n++)if(e[n].callback===t)return n;return-1},J.prototype.on=function(e,t,n){var r;if(void 0===n&&(n=0),this)return(r=this.eventsList[e])||(this.eventsList[e]=[],r=this.eventsList[e]),-1===this.indexOf(r,t)&&r.push({name:e,type:n||0,callback:t}),this},J.prototype.one=function(e,t){this.on(e,t,1)},J.prototype.remove=function(e,t){if(this){var n=this.eventsList[e];if(n){if(t)return n.length&&(t=this.indexOf(n,t),n.splice(t,1)),this;try{delete this.eventsList[e]}catch(e){}}return null}},J.prototype.clear=function(){this.eventsList={}},J);function J(){var s=this;this.emit=function(e,t){if(s){var n;if(null!=(r=s.eventsList[e])&&r.length)for(var r=r.slice(),i=0;i<r.length;i++){n=r[i];try{var o=n.callback.apply(s,[t]);if(1===n.type&&s.remove(e,n.callback),!1===o)break}catch(e){throw e}}return s}},this.eventsList={}}function K(e){if(null!=e){e=String(e).trim();if(e){var t=e.toLowerCase();if(t!==G&&"undefined"!==t&&"null"!==t&&"未知"!==e)return e}}}function $(e){return e&&"string"==typeof e?e.replace(/evaluate_script/g,"\0tdem_script_metric\0").replace(/eval/gi,"evaI").replace(/\u0000tdem_script_metric\u0000/g,"evaluate_script"):e}function X(e,t){return"number"==typeof e||"string"==typeof e?e:t?B.string:B.number}function ee(e,t){return"string"==typeof e?e.split("?")[t?1:0]||"":e}function te(e,t){return void 0===t&&(t=2048),String(e).replace(j,"").slice(0,t)}function ne(e){return"string"==typeof e&&/^\//.test(e)?"https:"===(null==location?void 0:location.protocol):/^https/.test(e)}function re(e,t,n){var r,i,o;try{if("function"==typeof(null==t?void 0:t.retCodeHandler))return{code:void 0===(o=(i=t.retCodeHandler(e,null==n?void 0:n.url,null==n?void 0:n.ctx,null==n?void 0:n.payload)||{}).code)?G:o,isErr:i.isErr};if(!(e="string"==typeof e?JSON.parse(e):e))return{code:G,isErr:!1};"function"==typeof(null==(r=null==t?void 0:t.ret)?void 0:r.join)&&(fe=[].concat(t.ret.map(function(e){return e.toLowerCase()})));var s=Object.getOwnPropertyNames(e).filter(function(e){return-1!==fe.indexOf(e.toLowerCase())});return s.length?{code:""+(o="未知"!==(o=e[s[0]])&&""!==o?o:G),isErr:0!==o&&"0"!==o&&o!==G}:{code:G,isErr:!1}}catch(e){return{code:G,isErr:!1}}}function oe(e,t,n){try{var r="function"==typeof t?t(e,null==n?void 0:n.url,null==n?void 0:n.ctx)||"":e;return me(r).slice(0,10240)}catch(e){return""}}function se(e){if("string"==typeof e)return e;try{return e instanceof Error?(JSON.stringify(e,he(),2)||"undefined").replace(/"/gim,""):JSON.stringify(e,he(),2)||"undefined"}catch(e){return"error happen when tdem stringify: \n "+e.message+" \n "+e.stack}}function ae(e,t){var n,r={fetch:[],static:[],bridge:[]},i=new FormData;return Array.isArray(e)?e.forEach(function(e){var t=ye(e);r[e.type].push(t)}):(n=ye(e),r[e.type].push(n)),i.append("payload",pe(x({duration:r},t))),i}function le(t,e){return"string"!=typeof t||!t||e&&-1<t.indexOf(e)||we.test(t)||W.some(function(e){return-1<t.indexOf(e)})}(e=B=B||{})[e.number=-1]="number",e.string="";var ue,ce=["application/xhtml+xml","application/xml","application/pdf","application/pkcs12","application/javascript","application/x-javascript","application/ecmascript","application/vnd.mspowerpoint","application/vnd.apple.mpegurl","application/ogg","text/css","text/javascript","image","audio","video","video/mp2t"],de=/\.(json|js|css|jpg|jpeg|png|svg|apng|webp|gif|bmp|mp4|mp3|ts|mpeg|wav|webm|ogg|flv|m3u8|ttf|woff2|otf|eot|woff|html|htm|shtml|shtm|)$/i,fe=["ret","retcode","code","errcode"],he=function(){var n=new WeakSet;return function(e,t){if(t instanceof Error)return"Error.message: "+t.message+" \n Error.stack: "+t.stack;if("object"==typeof t&&null!==t){if(n.has(t))return"[Circular "+(e||"root")+"]";n.add(t)}return t}},pe=function(e){if("string"==typeof e)return e;try{return JSON.stringify(e,he())||"undefined"}catch(e){return"error happen when tdem stringify: \n "+e.message+" \n "+e.stack}},me=function(n,r){void 0===r&&(r=3);var i,o,s,a="";return Array.isArray(n)?(a+="[",i=n.length,n.forEach(function(e,t){a=(a+="object"==typeof e&&1<r?me(e,r-1):ge(e))+(t===i-1?"":",")}),a+="]"):n instanceof Object||"object"==typeof n?(a="{",o=Object.keys(n),s=o.length,o.forEach(function(e,t){"object"==typeof n[e]&&1<r?a+='"'+e+'":'+me(n[e],r-1):a+=ve(e,n[e]),a+=t===s-1||t<s-1&&void 0===n[o[t+1]]?"":","}),a+="}"):a+=n,a},ve=function(e,t){var n=typeof t,r="";return"string"==n||"object"==n?r+='"'+e+'":"'+t+'"':"function"==typeof t?r+='"'+e+'":"function '+t.name+'"':"symbol"==typeof t?r+='"'+e+'":"symbol"':"number"!=typeof t&&"boolean"!=n||(r+='"'+e+'": '+t),r},ge=function(e){var t=typeof e;return""+("undefined"==t||"symbol"==t||"function"==t?"null":"string"==t||"object"==t?'"'+e+'"':e)},ye=function(t){var n;return t.payload?(n={},Object.keys(t).forEach(function(e){"payload"!==e&&(n[e]=t[e])}),n):t},we=/data:(image|text|application|font)\/.*;base64/;(e=ue=ue||{}).LOG="log",e.SPEED="speed",e.PERFORMANCE="performance",e.OFFLINE="offline",e.WHITE_LIST="whiteList",e.VITALS="vitals",e.PV="pv",e.CUSTOM_PV="customPV",e.EVENT="event",e.CUSTOM="custom",e.SDK_ERROR="sdkError",e.SET_DATA="setData",e.LOAD_PACKAGE="loadPackage",e.MEMORY="memory";var be,M,I,ke={maxAttempts:3,delays:[0,1e3,3e3]};function _e(e){return null==e?be.production:(e=>{switch(e){case be.production:case be.development:case be.gray:case be.pre:case be.daily:case be.local:case be.test:case be.others:return!0;default:return!1}})(e)?e:be.others}function A(){return"evt_"+Date.now()+"_"+Math.random().toString(36).substring(2,8)}function Se(e){var t=[];if(e.stack)for(var n=0,r=0,i=e.stack.split("\n");r<i.length;r++){var o,s,a,l,u,c=i[r],d=c.match(/at\s+(.+?)\s+\((.+?):(\d+):(\d+)\)/);d?(s=d[1],o=d[2],a=d[3],l=d[4],u=o.split("/").pop()||o,t.push({abs_path:o,colno:parseInt(l,10),filename:u,function:s||"(anonymous)",lineno:parseInt(a,10),in_app:o.includes("node_modules")||o.includes("cdn")?0:1,stack_level:n++})):(d=c.match(/at\s+(.+?):(\d+):(\d+)/))&&(s=d[1],a=d[2],l=d[3],u=s.split("/").pop()||s,t.push({abs_path:s,colno:parseInt(l,10),filename:u,function:"(anonymous)",lineno:parseInt(a,10),in_app:s.includes("node_modules")||s.includes("cdn")?0:1,stack_level:n++}))}return t}function Ee(d,l){return function(i,o){var s,a,e,t,n;null!=i&&i.log&&null!=i&&i.type?(s=function(e,t,n,r){switch(t){case ue.LOG:o=e;var i=(Array.isArray(o)?o:[o]).map(function(n){return Object.getOwnPropertyNames(n).reduce(function(e,t){return"ctx"!==t&&(e[t]=n[t]),e},{level:"2",msg:""})});if(!i||0===i.length)return"{}";i=Array.isArray(i)?i:[i];var o=Array.from(new Set(i.flatMap(function(e){return Object.keys(e)}))),s={};return o.forEach(function(t){s[t]=i.map(function(e){return e[t]||""})}),s.count=i.length,pe(s);case ue.SPEED:return o=e,a=n,a=x(x({},d.bean),{from:a}),c=x({},d.bean),(()=>{try{return"undefined"!=typeof FormData&&"function"==typeof FormData.prototype.append}catch(e){}})()?ae(o,a):(a=o,o=c,u={fetch:[],static:[],bridge:[]},c={},Array.isArray(a)?a.forEach(function(e){var t;null!=(t=u[e.type])&&t.push(e)}):null!=(l=u[a.type])&&l.push(a),c.payload=JSON.stringify(x({duration:u},o)),c);case ue.EVENT:return r;default:return r||{}}var a,l,u,c,o},1!==(e=Array.isArray(i.log)?i.log:[i.log]).length?(a={},e.forEach(function(e){var t=e.from||"undefined";delete e.from,a[t]||(a[t]=[]),a[t].push(e)}),Object.keys(a).forEach(function(e){var t,n=a[e],r=null!=(r=i.url)&&r.includes("?")?"&":"?";"undefined"===e?(t=""+i.url,o(x(x({},i),{url:t,log:1===n.length?n[0]:n,data:s(n,l,e,i.data)}))):(t=i.url+r+"from="+e,o(x(x({},i),{url:t,log:1===n.length?n[0]:n,beanFilter:g(i.beanFilter||[],["from"]),data:s(n,l,e,i.data)})))})):(t=(e=e[0]).from,delete e.from,n=null!=(n=i.url)&&n.includes("?")?"&":"?",t?(n=i.url+n+"from="+t,o(x(x({},i),{url:n,log:e,beanFilter:g(i.beanFilter||[],["from"]),data:s(e,l,t,i.data)}))):(n=""+i.url,o(x(x({},i),{url:n,log:e,data:s(e,l,t,i.data)}))))):o(i)}}function Ce(l,u){return function(e,t){var n,r,i,o=Array.isArray(e),s=o?e:[e],a=(l.lifeCycle.emit("beforeRequest",e),l.config.beforeRequest);(s="function"==typeof a?s.map(function(t){try{var e=a({logs:t,logType:u});return(null==e?void 0:e.logType)===u&&null!=e&&e.logs?e.logs:!1!==e&&t}catch(e){return t}}).filter(function(e){return!1!==e}):s).length&&(n=s,e=q,!Array.isArray(n)||n.length<=1||(r=[],i=[],!(i="string"==typeof e?[e]:e))||i.length<=0||(i.forEach(function(t){n.forEach(function(e){null!=e&&e[t]&&r.push(t)})}),0<r.length&&(n=n.map(function(e){var t={};return r.forEach(function(e){t[e]=""}),x(x({},t),e)}))),s=n,t(o?s:s[0]))}}function Re(i){return function(e,t){i.lifeCycle.emit("modifyRequest",e);var n=i.config.modifyRequest;if("function"==typeof n)try{var r=n(e);"object"==typeof r&&"url"in r&&(e=r)}catch(e){console.error(e)}t(e)}}function Te(r){return function(e,t){null!=(n=r.lifeCycle)&&n.emit("afterRequest",e);var n=(r.config||{}).afterRequest;"function"==typeof n&&!1===n(e)||t(e)}}(e=be=be||{}).production="production",e.development="development",e.gray="gray",e.pre="pre",e.daily="daily",e.local="local",e.test="test",e.others="others",(e=M=M||{}).JS_ERROR="js_error",e.PROMISE_ERROR="promise_error",e.RESOURCE_ERROR="resource_error",e.API_ERROR="api_error",e.BLANK_SCREEN="blank_screen",e.PAGE_LOAD="page_load",e.RESOURCE_LOAD="resource_load",e.API_CALL="api_call",e.SSE_CALL="sse_call",e.true="web_vitals",e.LAG_DETECTED="lag_detected",e.NO_RESPONSE="no_response",e.MEMORY_USAGE="memory_usage",e.APP_METRICS="app_metrics",e.PROCESS_SIGNAL="process_signal",e.MEMORY_OOM="memory_oom",e.FILE_IO="file_io",e.CLICK="click",e.SCROLL="scroll",e.LONG_PRESS="long_press",e.PAGE_VIEW="page_view",e.TAB_HIDDEN="tab_hidden",e.TAB_VISIBLE="tab_visible",e.WINDOW_BLUR="window_blur",e.WINDOW_FOCUS="window_focus",e.FORM_FOCUS="form_focus",e.FORM_BLUR="form_blur",e.FORM_CHANGE="form_change",e.FORM_SUBMIT="form_submit",e.FORM_SUBMIT_RESULT="form_submit_result",e.STRUGGLE="struggle",e.CUSTOM="custom",e.LOG="log",e.DIAL_PROBE="dial_probe",e.DIAL_MTR="dial_mtr",(e=I=I||{}).ERROR="error",e.PERFORMANCE="performance",e.BEHAVIOR="behavior",e.NETWORK="network",e.LOG="log",e.CUSTOM="custom";var Oe=function(e){return e.filter(function(n,r){return"static"!==n.type||!e.find(function(e,t){return n.url===e.url&&200===n.status&&r<t})})},xe={},Me={},Ne=function(e){return xe[e]||(xe[e]=setTimeout(function(){Me[e]={},xe[e]=null},6e4)),xe[e]},Fe={generateTraceId:ze(16),generateSpanId:ze(8)},Ue=Array(32);function ze(t){return function(){for(var e=0;e<2*t;e++)Ue[e]=Math.floor(16*Math.random())+48,58<=Ue[e]&&(Ue[e]+=39);return String.fromCharCode.apply(null,Ue.slice(0,2*t))}}function Be(){return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,function(e){return(e^(16*Math.random()&15)>>e/4).toString(16)})}function je(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}function We(e){for(var t,n,r,i="",o=0,s=(e=String(e)).length%3;o<e.length;){if(255<(t=e.charCodeAt(o++))||255<(n=e.charCodeAt(o++))||255<(r=e.charCodeAt(o++)))throw new TypeError("Failed to execute 'btoa': The string to be encoded contains characters outside of the Latin1 range.");i+=Ve.charAt((t=t<<16|n<<8|r)>>18&63)+Ve.charAt(t>>12&63)+Ve.charAt(t>>6&63)+Ve.charAt(63&t)}return s?i.slice(0,s-3)+"===".substring(s):i}function He(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!Ge.test(e))throw new TypeError("Failed to execute 'atob': The string to be decoded is not correctly encoded.");var t;e+="==".slice(2-(3&e.length));for(var n,r,i="",o=0;o<e.length;)t=Ve.indexOf(e.charAt(o++))<<18|Ve.indexOf(e.charAt(o++))<<12|(n=Ve.indexOf(e.charAt(o++)))<<6|(r=Ve.indexOf(e.charAt(o++))),i+=64===n?String.fromCharCode(t>>16&255):64===r?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return i}function qe(e){var t,n="";return n="object"==typeof e&&(t=(e=((e,t)=>{for(var n=0;n<t.length;n++){var r=t[n],i=e[r]||"function"==typeof e.get&&e.get(r);if(i)return[r,i]}return["",""]})(e,Object.keys(Je)))[0])?Je[t](e[1]):n}var Ve="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Ge=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,Ze=($e.prototype.generate=function(e,t,n){if(void 0===t&&(t={}),this.url=e,!this.isUrlIgnored()&&this.isUrlInTraceUrls()&&this.traceType){switch(this.traceType){case"traceparent":this.traceId=this.createTraceparent();break;case"b3":this.traceId=this.createB3();break;case"sw8":this.traceId=this.createSw8(n);break;case"sentry-trace":this.traceId=this.createSentryTrace();break;default:return console.warn("this trace key "+this.traceType+" is not supported"),void(this.traceId="")}return t[this.traceType]&&(this.traceId=t[this.traceType]),{name:this.traceType,value:this.traceId}}},$e.prototype.createTraceparent=function(){var e=Fe.generateSpanId();return"00-"+Fe.generateTraceId()+"-"+e+"-0"+this.traceFlag.toString(16)},$e.prototype.createB3=function(){var e=Fe.generateSpanId();return Fe.generateTraceId()+"-"+e+"-"+this.traceFlag},$e.prototype.createSw8=function(e){var t="function"==typeof btoa?btoa:We,e=e||{},n=e.host,n=void 0===n?"":n,e=e.pathname,e=void 0===e?"":e,r=je(),i=je();return"1-"+String(t(i))+"-"+String(t(r))+"-1-"+String(t("tdem"))+"-"+String(t("1.0.14"))+"-"+String(t(encodeURI(e)))+"-"+String(t(n))},$e.prototype.createSentryTrace=function(){var e=Be().substring(16);return Be()+"-"+e+"-"+this.traceFlag},$e.prototype.isUrlIgnored=function(){if(Array.isArray(this.ignoreUrls)&&0!==this.ignoreUrls.length)for(var e=0,t=this.ignoreUrls;e<t.length;e++){var n=t[e];if(this.urlMatches(this.url,n))return!0}return!1},$e.prototype.isUrlInTraceUrls=function(){if(!this.urls)return!0;if(Array.isArray(this.urls)){if(0===this.urls.length)return!1;for(var e=0,t=this.urls;e<t.length;e++){var n=t[e];if(this.urlMatches(this.url,n))return!0}}return!1},$e.prototype.urlMatches=function(e,t){return"string"==typeof t?e===t:!!e.match(t)},$e),Je={sw8:function(e){var t="function"==typeof atob?atob:He,e=e.split("-")[1];return e?t(e):""},traceparent:function(e){return e.split("-")[1]},b3:function(e){return e.split("-")[0]},"sentry-trace":function(e){return e.split("-")[0]}},Ke=new WeakMap;function $e(e,t,n,r){void 0===n&&(n=null),this.traceType=e,this.ignoreUrls=t,this.urls=n,this.traceFlag=null==r?1:Number(!!r)}function Xe(e){var t,n;return String((null==(t=null==(t=null==(n=e.sessionManager)?void 0:n.getSession)?void 0:t.call(n))?void 0:t.id)||(null==(n=e.bean)?void 0:n.sessionId)||"")}function Ye(e,t){Ke.set(e,t)}function Qe(e){return Ke.get(e)}function et(o){return function(e){e&&0!==e.length&&o.sendPipeline([function(e,r){var i=new Map;e.forEach(function(e){var t=null!=(t=Qe(e))?t:Xe(o),n=i.get(t)||[];n.push(e),i.set(t,n)}),i.forEach(function(t,e){var e={protocol_version:2,project_key:String(o.config.id||""),sdk:{name:o.sdkName,version:o.sdkVersion},app:{version:String(o.config.version||"1.0.0")},context:x(x({},(e=>{var t=Xe(e),n=String(e.config.userId||e.config.uin||""),t={session_id:t,platform:(t=String(e.runtimePlatform||e.config.platform||"web").trim().toLowerCase(),["web","wx-miniprogram","uniapp","android","ios","electron","unknown"].includes(t)?t:"wx"===t?"wx-miniprogram":"my"!==t&&"qq"!==t&&"tt"!==t&&"undefined"!=typeof window?"web":"unknown")},n=(n&&(t.user_id=n),(n=String(e.bean.aid||"").trim())&&"true"!==n&&(t.device_id=n),e.bean.runtime?String(e.bean.runtime):""),r=e.bean.processType?String(e.bean.processType):"",i=void 0!==e.bean.windowId?String(e.bean.windowId):"",o=void 0!==e.bean.webContentsId?String(e.bean.webContentsId):"",e=e.bean.appVersion?String(e.bean.appVersion):"";return n&&(t.runtime=n),r&&(t.process_type=r),i&&(t.window_id=i),o&&(t.web_contents_id=o),e&&(t.app_version=e),"undefined"!=typeof navigator&&(t.user_agent=navigator.userAgent,t.language=navigator.language),"undefined"!=typeof screen&&(t.screen_resolution=screen.width+"x"+screen.height),t})(o)),{session_id:e}),events:t},n=String(o.config.url||"").replace(/\/+$/,"");n&&r({url:n+"/api/v1/collect/events",data:JSON.stringify(e),method:"POST",contentType:"application/json",addBean:!1,type:ue.EVENT,log:t,success:function(){o.lifeCycle.emit("afterReport",{success:!0,events:t})},fail:function(e){o.lifeCycle.emit("afterReport",{success:!1,error:e,events:t})}})})}],ue.EVENT)(e)}}var tt=new Set(Object.values({error:["js_error","promise_error","resource_error","api_error","blank_screen","no_response"],performance:["page_load","web_vitals","lag_detected","memory_usage","memory_oom"],network:["resource_load","api_call","sse_call"],custom:["custom"]}).flat());function nt(e){new Set(Object.values(e).flat())}nt({error:["js_error","promise_error","resource_error","api_error"],performance:["page_load"],network:["resource_load","api_call"],custom:["custom"]}),nt({error:["crash","api_error"],performance:["app_launch","lag_detected"],network:["api_call","sse_call"],custom:["custom"]}),nt({error:["crash","api_error","no_response"],performance:["app_launch","lag_detected"],network:["api_call","sse_call"],custom:["custom"]}),nt({error:["js_error","promise_error","resource_error","api_error","blank_screen","crash"],performance:["page_load","web_vitals","lag_detected","no_response","app_metrics","process_signal","file_io"],network:["resource_load","api_call","sse_call"],custom:["custom"]});var rt={event:{enabled:!0,types:{}},replay:{enabled:!1,experience_sample_rate:0,error_traceback:!1,error_sample_rate:100}};function it(e){return null==e?"":String(e)}function ot(r,e,i){return e.enabled&&e.conditions&&0!==e.conditions.length&&e.conditions.every(function(e){var t=e,e=((e,t,n)=>{if(t.startsWith("tags."))return i=t.slice("tags.".length),e.tags&&i in e.tags?e.tags[i]:void 0;if(t.startsWith("event_properties."))return i=t.slice("event_properties.".length),e.event_properties&&i in e.event_properties?e.event_properties[i]:void 0;if("page_path"===t){if(!n)return t in(i=e)&&null!=i[t]?i[t]:void 0;if(!e.page_url)return;try{return new URL(e.page_url).pathname}catch(e){return}}if("page_url"!==t)return t in(n=e)&&null!=n[t]?n[t]:void 0;var r=e.page_url;if(null!=r){var i=String(r);if(i)try{return decodeURIComponent(i)}catch(r){return i}}})(r,t.field,i);if(void 0===e)return!1;var n=it(e);switch(t.operator){case"equals":return n===it(t.value);case"not_equals":return n!==it(t.value);case"contains":return n.includes(it(t.value));case"not_contains":return!n.includes(it(t.value));case"starts_with":return n.startsWith(it(t.value));case"ends_with":return n.endsWith(it(t.value));case"in":return(Array.isArray(t.value)?t.value.map(it):[]).includes(n);case"not_in":return!(Array.isArray(t.value)?t.value.map(it):[]).includes(n);default:return!1}})}function st(e,t,n,r){var i,o,s,a;void 0===t&&(t=rt),void 0===n&&(n=Math.random),void 0===r&&(r={});try{if(null==(i=null==t?void 0:t.event)||!i.enabled)return!1;for(var l=null!=(o=r.closedSet)?o:tt,u=!1!==r.derivePagePath,c=(s=t,a=e.event_type,l.has(a)&&(null==(s=null==(s=s.event)?void 0:s.types)?void 0:s[a])||{sample_rate:100,rules:[]}),d=c.sample_rate,f=0,h=c.rules||[];f<h.length;f++){var p=h[f];if(p.enabled&&ot(e,p,u)){d=p.sample_rate;break}}return 100<=d||!(d<=0)&&100*n()<d}catch(e){return!0}}function at(e){e=null==(e=e)?void 0:e._tdemSampleGate;return!!e&&e.isDecided&&e.isSampled}function lt(e,t){var n=e.data||{},r=t.bean||{};return{event_type:String(e.event_type||""),event_category:e.event_category,event_name:e.event_name||n.event_name,page_url:e.page_url,user_id:r.user_id||t.config.userId,device_id:r.device_id||t.config.aid,env:t.config.env,version:String(null!=(t=null!=(t=t.config.version)?t:r.app_version)?t:""),tags:n.tags||e.tags,event_properties:n.event_properties||n.properties||n}}function ut(e){return e._tdemSampleConfig||null}function ct(e){return e._tdemSampleEvaluateOptions||{}}function dt(n){if(n&&n.reduce&&n.length)return 1===n.length?function(e,t){n[0](e,t||vt)}:n.reduce(function(n,r){return function(e,t){return void 0===t&&(t=vt),n(e,function(e){return null==r?void 0:r(e,t)})}});throw new TypeError("createPipeline need at least one function param")}function ft(t,n){Object.getOwnPropertyNames(t).forEach(function(e){"function"==typeof t[e]&&"constructor"!==e&&(n?n[e]="sendPipeline"===e?function(){return function(){}}:function(){}:t[e]=function(){})})}function ht(n){var r={};return n&&"object"==typeof n&&_t.forEach(function(e){var t=n[e];"string"==typeof t&&""!==t&&(r[e]=t)}),r}function pt(){return void 0!==window.performance&&"function"==typeof performance.getEntriesByType&&"function"==typeof performance.now}function mt(e){var t;return-1<(null==(t=null==(t=window.PerformanceObserver)?void 0:t.supportedEntryTypes)?void 0:t.indexOf(e))}var vt=function(){},gt={low:1,medium:3,high:5},yt=new Set(["custom_struggle_name","form_id","field_id","trigger_event_id","struggle_status","struggle_owner_type","struggle_owner_key","detection_source","rule_version"]),wt={rage_click:3,dead_click:4,error_click:4,form_validation_error:3,slow_page:3,back_forward:2,long_focus_time:2,form_zigzag:2,uncompleted_form:3,custom_struggle:3},bt={rage_click:4,dead_click:5,error_click:5,form_validation_error:4,slow_page:4,back_forward:3,long_focus_time:3,form_zigzag:3,uncompleted_form:3,custom_struggle:3},kt=(v.use=function(e){-1===v.installedPlugins.indexOf(e)&&e.tdemPlugin&&v.installedPlugins.push(e)},v.unuse=function(e){e=v.installedPlugins.indexOf(e);-1!==e&&v.installedPlugins.splice(e,1)},v.prototype.getInternalTransport=function(){return this.internalTransport},v.prototype.setInternalTransport=function(e){this.internalTransport=e},v.prototype.getInternalRetrySchedule=function(){return this.internalRetrySchedule},v.prototype.transportRequest=function(t,n){return D(this,void 0,void 0,function(){return L(this,function(e){switch(e.label){case 0:if(this.internalTransport)return[4,this.internalTransport.request(t,n)];throw new Error("Internal Transport is not configured");case 1:return[2,e.sent()||{ok:!0,request:t}]}})})},v.prototype.transportHandoff=function(t,n){return D(this,void 0,void 0,function(){return L(this,function(e){switch(e.label){case 0:if(this.internalTransport)return[4,(this.internalTransport.handoff||this.internalTransport.request).call(this.internalTransport,x(x({},t),{handoff:!0}),n)];throw new Error("Internal Transport is not configured");case 1:return[2,e.sent()||{ok:!0,request:t,handoffAccepted:!0}]}})})},v.prototype.init=function(e){this.setConfig(e),this.config=O(this.config,e.hostUrl);for(var t=0;t<v.installedPlugins.length;t++)try{v.installedPlugins[t].patch(this)}catch(e){this.sendSDKError(e)}this.lifeCycle.emit("onInited")},v.prototype.destroy=function(e){void 0===e&&(e=!1);var t,n,r=v.instances.indexOf(this);-1!==r&&v.instances.splice(r,1);for(var i=v.installedPlugins.length-1;0<=i;i--)try{v.installedPlugins[i].unpatch(this)}catch(e){this.sendSDKError(e)}if(this.lifeCycle.emit("destroy"),this.lifeCycle.clear(),e)t=this,n=Object.getOwnPropertyDescriptors(t),Object.keys(n).forEach(function(e){n[e].writable&&(t[e]=null)}),Object.setPrototypeOf(this,null);else{for(var o=this;o.constructor!==Object&&ft(o,this),o=Object.getPrototypeOf(o););0===v.instances.length&&(r=Object.getPrototypeOf(this).constructor,ft(r),ft(v))}},v.prototype.setConfig=function(e){Object.assign(this.config,e);var e=this.config,t=e.id,n=e.uin,r=e.version,i=e.aid,o=e.env,s=e.pageUrl,e=e.userId||(null!=n?String(n):""),n=this.bean.id!==t||this.bean.uin!==e||this.bean.aid!==i;return this.bean.id=t||"",this.bean.uin=e,this.bean.version=r||"1.0.14",this.bean.aid=i||"",this.bean.env=_e(o),s&&this.extendBean("from",encodeURIComponent(s.slice(0,2048))),n&&this.lifeCycle.emit("onConfigChange",this.config),this.config},v.prototype.extendBean=function(e,t){this.bean[e]=t},v.prototype.send=function(e,i,o){var t=this;return dt([Re(this),Ee(this,null==e?void 0:e.type),function(n,r){t.request(n,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];r({isErr:!1,result:e,logType:n.type,logs:n.log}),null!=i&&i.apply(void 0,e)},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];r({isErr:!0,result:e,logType:n.type,logs:n.log}),null!=o&&o.apply(void 0,e)})},Te(this)])(e)},v.prototype.sendSDKError=function(e){var n=this;this.sendPipeline([function(e,t){t({url:n.config.url+"?id=1085&msg[0]="+encodeURIComponent(se(e))+"&level[0]=2&from="+n.config.id+"&count=1&version="+n.config.id+"(1.0.14)",addBean:!1,method:"get",type:ue.SDK_ERROR,log:e})}],ue.SDK_ERROR)(e)},v.prototype.sendPipeline=function(e,t){var n,o=this;return dt(g([function(e,t){if(e&&e.type===ue.EVENT)return t(e);if("number"!=typeof n.config.random&&(console.warn("random must in [0, 1], default is 1."),n.config.random=1),!n.isHidden||!n.isGetSample)if(n.isGetSample)n.isHidden||t(e);else{if(n.isGetSample=!0,Math.random()<n.config.random)return n.isHidden=!1,t(e);n.isHidden=!0}},Ce(n=this,t)],e,[Ee(this,t),Re(this),function(r,i){o.request(r,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=!1;-1<(""+e[o.failRequestCount=0]).indexOf("403 forbidden")&&(n=!0,o.destroy()),i({isErr:n,result:e,logType:null==r?void 0:r.type,logs:null==r?void 0:r.log}),null!=(n=null==r?void 0:r.success)&&n.call.apply(n,g([r],e))},function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];60<=++o.failRequestCount&&o.destroy(),-1<(""+t[0]).indexOf("403 forbidden")&&o.destroy(),i({isErr:!0,result:t,logType:null==r?void 0:r.type,logs:null==r?void 0:r.log}),null!=(e=null==r?void 0:r.fail)&&e.call.apply(e,g([r],t))})},Te(this)]))},v.prototype.track=function(e,t){void 0===t&&(t={}),e&&"string"==typeof e?(e={event_id:A(),event_type:M.CUSTOM,event_category:I.CUSTOM,timestamp:Date.now(),page_url:this.getCurrentEventPageUrl(),data:{event_name:e,replay_id:this.getEventReplayId(),tags:this.sanitizeEventTags(t.tags),event_properties:this.sanitizeEventProperties(t.properties)}},this.reportTDEMEvent(e)):console.warn("track: name must be a non-empty string")},v.prototype.trackStruggle=function(e,t){void 0===t&&(t={});var n,e="string"==typeof e?e.trim():"";!e||128<e.length?console.warn("trackStruggle: name must be a non-empty string limited to 128 characters"):(n=t.severity||"medium",(n=gt[n])?this.reportStruggle({type:"custom_struggle",ownerType:"business",ownerKey:e,severity:n,detectionSource:"custom",ruleVersion:"custom-v1",tags:t.tags,properties:x(x({},t.properties||{}),{custom_struggle_name:e})}):console.warn("trackStruggle: severity must be low, medium, or high"))},v.prototype.reportTDEMEvent=function(e){var r,t,n,i=this,e=Array.isArray(e)?e:[e];e.length&&(r="string"==typeof(n=(t=this).viewId)&&n.trim()?n.trim():"string"==typeof(t=null==(n=t.bean)?void 0:n.viewId)&&t.trim()?t.trim():"",n=e.map(function(e){var t,n="string"!=typeof e.view_id&&r?x(x({},e),{view_id:r}):e,n=x(x({},n),{page_url:n.page_url||i.getCurrentEventPageUrl(),data:x(x(x({},n.data),void 0!==Qe(e)||null!=(t=n.data)&&t.replay_id||!i.getCurrentReplayId()?{}:{replay_id:i.getCurrentReplayId()}),i.mergeEventTags(null==(t=n.data)?void 0:t.tags)?{tags:i.mergeEventTags(null==(t=n.data)?void 0:t.tags)}:{})});return Ye(n,null!=(t=Qe(e))?t:Xe(i)),n}),this.lifeCycle.emit("tdemEventCreated",n),this.tdemEventPipeline(n))},v.prototype.measure=function(e,t,n){void 0===n&&(n={}),e&&"string"==typeof e?"number"==typeof t?t<0||2147483646<t?console.warn("measure: duration must between 0 and 2147483646"):this.submitMeasure(e,t,n):console.warn("measure: duration must be a number"):console.warn("measure: name must be a non-empty string")},v.prototype.startMeasure=function(e){"string"==typeof e&&e?this.timeMap[e]?console.warn("Measure "+e+" already exists"):this.timeMap[e]=Date.now():console.warn("startMeasure: name must be a non-empty string")},v.prototype.endMeasure=function(e,t){var n;void 0===t&&(t={}),"string"==typeof e&&e?void 0!==(n=this.getTimeEventDuration(e))?(this.submitMeasure(e,n,t),delete this.timeMap[e]):console.warn("Measure "+e+" does not exist"):console.warn("endMeasure: name must be a non-empty string")},v.prototype.captureMessage=function(e,t){var n;void 0===t&&(t={}),"string"==typeof e&&e?(n="error"===t.level?"error":"warn"===t.level?"warn":"info",n={event_id:A(),event_type:M.LOG,event_category:I.LOG,timestamp:Date.now(),page_url:this.getCurrentEventPageUrl(t.pageUrl),data:{log_level:n,replay_id:this.getEventReplayId(t.replayId),tags:this.sanitizeEventTags(t.tags),event_properties:this.sanitizeEventProperties(x({message:e},t.properties||{}))}},this.reportTDEMEvent(n)):console.warn("captureMessage: message must be a non-empty string")},v.prototype.captureException=function(e,t){void 0===t&&(t={});var e="string"==typeof e?new Error(e):e;e instanceof Error?(e={event_id:A(),event_type:M.JS_ERROR,event_category:I.ERROR,timestamp:Date.now(),page_url:this.getCurrentEventPageUrl(t.pageUrl),data:{exception_stacks:[{type:e.name||"Error",value:e.message,mechanism_type:"manual",mechanism_handled:1}],exception_frames:Se(e),replay_id:this.getEventReplayId(t.replayId),tags:this.sanitizeEventTags(t.tags),event_properties:this.sanitizeEventProperties(x(x({},t.properties||{}),t.level?{capture_level:t.level}:{}))}},this.reportTDEMEvent(e)):console.warn("captureException: error must be an Error or string")},v.prototype.setTags=function(e){e=this.sanitizeEventTags(e);this.setConfig({defaultTags:x(x({},this.config.defaultTags||{}),e||{})})},v.prototype.removeTags=function(e){var t,e=Array.isArray(e)?e:[e];e.length&&(t=x({},this.config.defaultTags||{}),e.forEach(function(e){delete t[e]}),this.setConfig({defaultTags:t}))},v.prototype.clearTags=function(){this.setConfig({defaultTags:{}})},v.prototype.setUser=function(e){"string"==typeof e&&e?this.setConfig({userId:e}):console.warn("setUser: userId must be a non-empty string")},v.prototype.clearUser=function(){this.setConfig({userId:"",uin:""})},v.prototype.reportStruggle=function(e){var t,n,r,i;e&&e.type&&e.ownerType&&e.ownerKey?(t=e.type,n="number"==typeof e.severity?e.severity:wt[t],r="number"==typeof e.weight?e.weight:bt[t],i=x(x({event_id:A(),event_type:M.STRUGGLE,event_category:I.BEHAVIOR,timestamp:null!=(i=null==(i=e.sourceContext)?void 0:i.timestamp)?i:Date.now(),page_url:this.getCurrentEventPageUrl(e.pageUrl)},e.sourceContext?{view_id:e.sourceContext.viewId}:{}),{data:{event_name:t,replay_id:null!=(t=null==(i=e.sourceContext)?void 0:i.replayId)?t:this.getEventReplayId(),tags:this.sanitizeEventTags(e.tags),is_effective_action:!1,related_event_ids:this.normalizeRelatedEventIds(e.relatedEventIds),payload:this.sanitizeEventPayload(e.payload,e.payloadAllowlist),struggle_weight:r,struggle_severity:n,struggle_value:"number"==typeof e.value?e.value:r*n,event_properties:x(x({},this.sanitizeStruggleProperties(e.properties)),{form_id:e.formId||"",field_id:e.fieldId||"",trigger_event_id:e.triggerEventId||"",struggle_status:e.status||"detected",struggle_owner_type:e.ownerType,struggle_owner_key:e.ownerKey,detection_source:e.detectionSource||"sdk_auto",rule_version:e.ruleVersion||this.getDefaultRuleVersion()})}}),e.sourceContext&&Ye(i,e.sourceContext.sessionId),this.reportTDEMEvent(i)):console.warn("reportStruggle params error")},v.prototype.reportFormSubmitResult=function(e){e&&e.status?(e={event_id:A(),event_type:M.FORM_SUBMIT_RESULT,event_category:I.BEHAVIOR,timestamp:Date.now(),page_url:this.getCurrentEventPageUrl(e.pageUrl),data:{event_name:e.eventName||"form_submit_"+e.status,replay_id:this.getEventReplayId(),tags:this.sanitizeEventTags(e.tags),is_effective_action:"boolean"!=typeof e.isEffectiveAction||e.isEffectiveAction,trigger_event_id:e.triggerEventId,related_event_ids:this.normalizeRelatedEventIds(e.relatedEventIds),payload:this.sanitizeEventPayload(e.payload,e.payloadAllowlist),validation_message:e.validationMessage?e.validationMessage.slice(0,256):void 0,event_properties:{status:e.status,validation_code:e.validationCode||"",form_id:e.formId||"",field_id:e.fieldId||""}}},this.reportTDEMEvent(e)):console.warn("reportFormSubmitResult params error")},v.prototype.reportPageView=function(e,t){void 0===t&&(t={});e=this.getCurrentEventPageUrl(e||t.pageUrl),e={event_id:A(),event_type:M.PAGE_VIEW,event_category:I.BEHAVIOR,timestamp:Date.now(),page_url:e,data:{page_title:t.pageTitle||"",referrer:t.referrer,replay_id:this.getEventReplayId(t.replayId),tags:this.sanitizeEventTags(t.tags),event_properties:this.sanitizeEventProperties(x(x(x(x(x(x(x({},t.properties||{}),t.navigationType?{navigation_type:t.navigationType}:{}),t.fromPage?{from_page:t.fromPage}:{}),t.toPage?{to_page:t.toPage}:{}),"boolean"==typeof t.isFirstVisit?{is_first_visit:t.isFirstVisit?"1":"0"}:{}),"boolean"==typeof t.isFirstLoad?{is_first_load:t.isFirstLoad?"1":"0"}:{}),t.deviceType?{device_type:t.deviceType}:{}))}};this.reportTDEMEvent(e)},v.prototype.setPage=function(e,t){var n;e&&"string"==typeof e?(n=this._customPageUrl||this.getCurrentEventPageUrl(),this._customPageUrl=e,this.reportPageView(e,{pageTitle:null==t?void 0:t.pageTitle,navigationType:"push",fromPage:(n||"").slice(0,512),toPage:e.slice(0,512),isFirstVisit:!1,tags:x({source:"manual",environment:this.config.env||"production",version:String(this.config.version||"")},null!=t&&t.pageGroup?{page_group:t.pageGroup}:{})}),this.lifeCycle.emit("pageChanged",{pageUrl:e,previousUrl:n,source:"manual"})):console.warn("setPage: pageUrl must be a non-empty string")},v.prototype.leavePage=function(){var e;this._customPageUrl&&(e=this._customPageUrl,this._customPageUrl=null,this.lifeCycle.emit("pageChanged",{pageUrl:this.getCurrentEventPageUrl(),previousUrl:e,source:"auto"}))},v.prototype.getCurrentEventPageUrl=function(e){var t;if(e)return e;if(this._customPageUrl)return this._customPageUrl;try{return this.getOriginFrom()}catch(e){return this.config.pageUrl||"undefined"!=typeof window&&(null==(t=window.location)?void 0:t.href)||""}},v.prototype.getCurrentReplayId=function(){var e,t;return String((null==(t=null==(t=null==(e=this.sessionManager)?void 0:e.getSession)?void 0:t.call(e))?void 0:t.replayId)||"")},v.prototype.getDefaultRuleVersion=function(){var e;return(null==(e=null==(e=this.config)?void 0:e.struggleMonitor)?void 0:e.ruleVersion)||"1.0.0"},v.prototype.getEventReplayId=function(e){return e||this.getCurrentReplayId()||void 0},v.prototype.mergeEventTags=function(e){return this.sanitizeEventTags(x(x(x({},this.config.defaultTags||{}),e||{}),{environment:_e(this.config.env)}))},v.prototype.sanitizeStringMap=function(n,r){var i;if(void 0===r&&(r=1024),n&&"object"==typeof n)return i={},Object.keys(n).forEach(function(e){var t=n[e];e&&null!=t&&(i[String(e)]=String(t).slice(0,r))}),Object.keys(i).length?i:void 0},v.prototype.sanitizeEventTags=function(e){return this.sanitizeStringMap(e,1024)},v.prototype.sanitizeEventProperties=function(e){return this.sanitizeStringMap(e,1024)},v.prototype.sanitizeStruggleProperties=function(e){var n=this.sanitizeEventProperties(e);if(n)return Object.keys(n).reduce(function(e,t){return yt.has(t)&&"custom_struggle_name"!==t||(e[t]=n[t]),e},{})},v.prototype.sanitizeEventPayload=function(n,e){var r,i=this;if(n&&"object"==typeof n)return e=(e=this.getPayloadAllowlist(e)).length?e:Object.keys(n),r={},e.forEach(function(e){var t;Object.prototype.hasOwnProperty.call(n,e)&&void 0!==(t=i.sanitizePayloadValue(n[e]))&&(r[e]=t)}),Object.keys(r).length?r:void 0},v.prototype.sanitizePayloadValue=function(n,r){var i=this;if(void 0===r&&(r=0),null!=n){if("string"==typeof n)return n.slice(0,256);if("number"==typeof n||"boolean"==typeof n)return n;if(Array.isArray(n))return n.slice(0,10).map(function(e){e=i.sanitizePayloadValue(e,r+1);return void 0===e?null:e});if("object"!=typeof n)return String(n).slice(0,256);if(2<=r)try{return JSON.stringify(n).slice(0,256)}catch(n){return}var o={};return Object.keys(n).slice(0,20).forEach(function(e){var t=i.sanitizePayloadValue(n[e],r+1);void 0!==t&&(o[e]=t)}),Object.keys(o).length?o:void 0}},v.prototype.getPayloadAllowlist=function(e){var t=null==(t=null==(t=this.config)?void 0:t.struggleMonitor)?void 0:t.payloadAllowlist;return Array.from(new Set(g(Array.isArray(t)?t:[],Array.isArray(e)?e:[]).filter(function(e){return!!e})))},v.prototype.normalizeRelatedEventIds=function(e){return Array.isArray(e)&&e.length&&(e=Array.from(new Set(e.filter(function(e){return"string"==typeof e&&e})))).length?e:void 0},v.prototype.ready=function(e,t,n){throw new Error('You need to override "ready" method')},v.prototype.request=function(e,t,n){throw new Error('You need to override "request" method')},v.prototype.speedLogPipeline=function(e){throw new Error('You need to override "speedLogPipeline" method')},v.prototype.getOriginFrom=function(){throw new Error('You need to override "getOriginFrom" method')},Object.defineProperty(v.prototype,"__version__",{get:function(){return"1.0.14"},enumerable:!1,configurable:!0}),v.prototype.submitMeasure=function(e,t,n){void 0===n&&(n={});e={event_id:A(),event_type:M.CUSTOM,event_category:I.CUSTOM,timestamp:Date.now(),page_url:this.getCurrentEventPageUrl(n.pageUrl),data:{event_name:e,measurements:{duration:t},replay_id:this.getEventReplayId(n.replayId),tags:this.sanitizeEventTags(n.tags),payload:this.sanitizeEventPayload(n.payload),event_properties:this.sanitizeEventProperties(n.properties)}};this.reportTDEMEvent(e)},v.prototype.getTimeEventDuration=function(e){if(void 0!==e&&this.timeMap[e])return Date.now()-this.timeMap[e]},v.version="1.0.14",v.instances=[],v.environment=be,v.installedPlugins=[],v),e=(Et.prototype.patch=function(e){this.canUse(e)&&this.exist(e)&&(this.instances.push(e),this.triggerInit(e),this.triggerOnNewTdem(e))},Et.prototype.unpatch=function(e){var t=this.instances.indexOf(e);-1!==t&&(this.instances.splice(t,1),0===this.instances.length)&&this.uninstall(e)},Et.prototype.countInstance=function(){return this.instances.length},Et.prototype.uninstall=function(e){var t;null!=(t=null==(t=this.option)?void 0:t.destroy)&&t.apply(this,[e])},Et.prototype.walk=function(n){var r=this;this.instances.forEach(function(e){var t=r.canUse(e);t&&n(e,t)})},Et.prototype.canUse=function(e){e=this.getConfig(e);return!(!e||"object"!=typeof e)||!!e},Et.prototype.getConfig=function(e){return null==(e=e.config)?void 0:e[this.name]},Et.prototype.exist=function(e){return-1===this.instances.indexOf(e)},Et.prototype.triggerInit=function(e){var t;this.inited||(this.inited=!0,null==(t=null==(t=this.option)?void 0:t.init))||t.call(this.option,this.getConfig(e))},Et.prototype.triggerOnNewTdem=function(e){var t;null!=(t=null==(t=this.option)?void 0:t.onNewTdem)&&t.call(this.option,e,this.getConfig(e))},Et),_t=["req_dial_links","req_dial_links_truncated","dns_dial_links","dns_dial_links_truncated"],St=new e({name:"aid",aid:"",init:function(e){try{var t=!0!==e&&e||window.localStorage.getItem("TDEM_ID");t||(t=je(),window.localStorage.setItem("TDEM_ID",t)),this.aid=t}catch(e){}},onNewTdem:function(e){e.bean.aid=this.aid,e.config.aid=this.aid}});function Et(e){this.tdemPlugin=!0,this.name="",this.instances=[],this.inited=!1,e.$walk=this.walk.bind(this),e.$getConfig=this.getConfig.bind(this),this.option=e,this.name=e.name}function v(e,t){var i,o,s,a,n,l,r,u,c,d,f,h,p,m;void 0===t&&(t={}),this.sdkName="tdem-web-sdk",this.sdkVersion=v.version,this.isGetSample=!1,this.isHidden=!1,this.config={version:0,delay:1e3,onError:!0,repeat:60,random:1,aid:!0,device:!0,pagePerformance:!0,webVitals:!0,lagMonitor:!0,blankScreen:!0,memoryMonitor:!0,speedSample:!0,onClose:!0,reportLoadPackageSpeed:!0,env:"production",url:"",reportImmediately:!0,tdemConfig:!0,hostUrl:"https://dem.rumt-zh.com",offlineUrl:"",whiteListUrl:"",pvUrl:"",speedUrl:"",customTimeUrl:"",performanceUrl:"",performanceUrlForHippy:"",webVitalsUrl:"",eventUrl:"",setDataReportUrl:""},this.isWhiteList=!1,this.lifeCycle=new Z,this.bean={},this.internalRetrySchedule=ke,this._customPageUrl=null,this.tdemEventPipeline=dt([(s=o=!1,a=[],n=function(e,t){var n,r;Array.isArray(e)&&0===e.length?t(e):(n=ut(i))?Array.isArray(e)?(r=e.filter(function(e){return st(lt(e,i),n,Math.random,ct(i))})).length&&t(r):st(lt(e,i),n,Math.random,ct(i))&&t(e):o?s&&t(e):a.length<1e3&&a.push({event:e,resolve:t})},(i=this)._tdemSampleGate={decide:function(e){o=!0,s=e;e=a;a=[],ut(i)?e.forEach(function(e){var t=e.event;return n(t,e.resolve)}):s&&e.forEach(function(e){var t=e.event;return(0,e.resolve)(t)})},reDecide:function(e){return!!ut(i)||(e<=0?s=!1:100<=e?s=!0:s=100*Math.random()<e)},get isDecided(){return o||!!ut(i)},get isSampled(){return s}},function(e,t){n(e,t)}),(r=this,u=20,f=Math.max(Number(u)||1,1),h=[],m=!(p=function(){}),function(e,t){function n(){for(clearTimeout(c),clearTimeout(d),d=c=void 0;0<h.length;)t(h.splice(0,f))}e=Array.isArray(e)?e:[e];h.push.apply(h,e);p=n,!m&&e.some(function(e){return e.event_type===M.PAGE_VIEW})?(m=!0,n()):r.sendNow&&0<h.length?n():0!==e.length?f<=h.length?n():0!==h.length&&(clearTimeout(c),c=setTimeout(function(){0<h.length&&p()},5e3),d=d||setTimeout(function(){0<h.length&&p()},3e4)):0<h.length&&n()}),function(t,n){try{var e,r=JSON.parse(JSON.stringify(t)),i=(l.lifeCycle.emit("beforeReport",r),l.config.beforeReport);"function"==typeof i?0<(e=t.filter(function(e){return!1!==i(e)})).length&&n(e):n(t)}catch(e){n(t)}},et(l=this)]),this.timeMap={},this.failRequestCount=0,this.internalTransport=t.transport,this.internalRetrySchedule=t.retrySchedule||ke,v.instances.push(this)}function P(e){return e=e.sessionManager,[(null==(t=null==(t=null==e?void 0:e.getSession)?void 0:t.call(e))?void 0:t.replayId)||"",null==t||t.id,!t||t.sampled,null==t||t.sampled][0];var t}function t(e){return-1!==Tt.indexOf(e)}var Ct=new e({name:"assets"}),Rt=Ct=new e({name:"assets",collectCur:0,collectEntryType:"resource",ASSETS_INITIATOR_TYPE:["img","css","script","link","audio","video"],getFromParam:function(e){var t;return(null==(t=e.getOriginFrom)?void 0:t.call(e))||window.location.href},onNewTdem:function(e){var t=this;pt()&&(setTimeout(function(){t.collectSuccessLog(e),t.collectFailLog(e)},5e3),performance.onresourcetimingbufferfull=function(){"function"==typeof performance.clearResourceTimings&&(t.collectCur=0,performance.clearResourceTimings())})},processLog:function(e,t){var n=t.duration||0,r=t.transferSize||0,n={event_id:A(),event_type:M.RESOURCE_LOAD,event_category:I.NETWORK,timestamp:Date.now(),page_url:t.from||window.location.href,data:{url:t.url,resource_type:t.type||"static",measurements:{duration:n,dns_time:t.domainLookup,tcp_time:t.connectTime,transfer_size:0<r?r:void 0},replay_id:P(e),tags:{environment:e.config.env||"production",is_https:t.isHttps?"true":"false"},event_properties:{is_cached:String(0===r),protocol:t.nextHopProtocol||"",http_status:String(t.status||0)}}};null!=(r=e.reportTDEMEvent)&&r.call(e,n)},publish:function(t,n){var r=this;this.$walk(function(e){e===n&&(Array.isArray(t)?t.forEach(r.processLog):r.processLog(n,t))})},publishMany:function(e,t){for(var n=t.config,r=this.getFromParam(t),i=0,o=e.length;i<o;i++){var s=e[i];-1===this.ASSETS_INITIATOR_TYPE.indexOf(s.initiatorType)||le(s.name,n.hostUrl)||this.publish(this.generateLog(s,n,r),t)}},collectSuccessLog:function(n){var e,t,r=this;"function"==typeof window.PerformanceObserver?(this.publishMany(performance.getEntriesByType(this.collectEntryType),n),(e=new window.PerformanceObserver(function(e){r.publishMany(e.getEntries(),n)})).observe({entryTypes:[this.collectEntryType]}),n.lifeCycle.on("destroy",function(){0===Ct.countInstance()&&e.disconnect()})):(t=setInterval(function(){var e=performance.getEntriesByType(r.collectEntryType),t=e.slice(r.collectCur);r.collectCur=e.length,r.publishMany(t,n)},3e3),n.lifeCycle.on("destroy",function(){0===Ct.countInstance()&&clearInterval(t)}))},collectFailLog:function(i){function e(e){var t,n,r;e&&(e=e.target||e.srcElement,!(t=(null==e?void 0:e.src)||(null==e?void 0:e.href))||"string"!=typeof t||-1<window.location.href.indexOf(t)||(e="function"==typeof(null==(e=s.api)?void 0:e.resourceTypeHandler)?null==e?void 0:e.resourceTypeHandler(t):"",r=performance.getEntriesByType(o.collectEntryType).find(function(e){return e.name===t}),le(t,s.hostUrl))||(n=o.getFromParam(i),r={url:te(t),status:400,duration:Number(((null==r?void 0:r.duration)||0).toFixed(2)),method:"get",type:e||"static",isHttps:ne(t),urlQuery:ee(t,!0),nextHopProtocol:"",domainLookup:0,connectTime:0,from:n},o.publish(r,i)))}var o=this,s=i.config;window.document.addEventListener("error",e,!0),i.lifeCycle.on("destroy",function(){0===Ct.countInstance()&&window.document.removeEventListener("error",e,!0)})},generateLog:function(e,t,n){var t="function"==typeof(null==(r=t.api)?void 0:r.resourceTypeHandler)?null==(r=t.api)?void 0:r.resourceTypeHandler(e.name):"",r=e.transferSize;return{url:te(e.name),method:"get",duration:Number(e.duration.toFixed(2)),status:200,type:t||"static",isHttps:ne(e.name),nextHopProtocol:e.nextHopProtocol||"",urlQuery:ee(e.name,!0),domainLookup:X(e.domainLookupEnd-e.domainLookupStart),connectTime:X(e.connectEnd-e.connectStart),transferSize:0<r?r:-1,from:n}},collectNotReportedLog:function(e){var t,n;pt()&&(t=(n=performance.getEntriesByType(this.collectEntryType)).length,"function"!=typeof window.PerformanceObserver)&&this.collectCur!==t&&(n=n.slice(this.collectCur),this.collectCur=t,this.publishMany(n,e))},destroy:function(){this.option.publish=function(){}}}),Tt=window.navigator.userAgent.toLowerCase(),l={};function Ot(){return{host:new URL(location.href).host,pathname:location.pathname}}l.macos=function(){return t("mac")},l.ios=function(){return l.iphone()||l.ipod()||l.ipad()},l.iphone=function(){return!l.windows()&&t("iphone")},l.ipod=function(){return t("ipod")},l.ipad=function(){var e="MacIntel"===navigator.platform&&1<navigator.maxTouchPoints;return t("ipad")||e},l.android=function(){return!l.windows()&&t("android")},l.androidPhone=function(){return l.android()&&t("mobile")},l.androidTablet=function(){return l.android()&&!t("mobile")},l.blackberry=function(){return t("blackberry")||t("bb10")},l.blackberryPhone=function(){return l.blackberry()&&!t("tablet")},l.blackberryTablet=function(){return l.blackberry()&&t("tablet")},l.windows=function(){return t("windows")},l.windowsPhone=function(){return l.windows()&&t("phone")},l.windowsTablet=function(){return l.windows()&&t("touch")&&!l.windowsPhone()},l.fxos=function(){return(t("(mobile")||t("(tablet"))&&t(" rv:")},l.fxosPhone=function(){return l.fxos()&&t("mobile")},l.fxosTablet=function(){return l.fxos()&&t("tablet")},l.meego=function(){return t("meego")},l.cordova=function(){return window.cordova&&"file:"===location.protocol},l.nodeWebkit=function(){return"object"==typeof window.process},l.mobile=function(){return l.androidPhone()||l.iphone()||l.ipod()||l.windowsPhone()||l.blackberryPhone()||l.fxosPhone()||l.meego()},l.tablet=function(){return l.ipad()||l.androidTablet()||l.blackberryTablet()||l.windowsTablet()||l.fxosTablet()},l.desktop=function(){return!l.tablet()&&!l.mobile()};var xt,Mt,It,At,Pt=!(l.isIE=function(){return"ActiveXObject"in window}),Dt=[],Lt=/^\/[^/]/;function Nt(e,t){return At(e,t)}var Ft=!1,Ut=[];function zt(e){var n;return e?"undefined"!=typeof Headers&&e instanceof Headers?(n={},e.forEach(function(e,t){n[t]=e,n[t.toLowerCase()]=e}),n):Array.isArray(e)?e.reduce(function(e,t){return t&&t[0]&&(e[String(t[0])]=String(t[1])),e},{}):x({},e):{}}function Bt(r,e,i){return null!=e&&e.length&&"object"==typeof r?e.reduce(function(e,t){var n=window.Headers&&r instanceof Headers?r.get(t):r[t];return n?e+(""===e?"":"\n\n")+i+" header "+t+": "+n:e},""):""}function jt(t,e){var n=rn.capture(),r=Date.now();en.forEach(function(e,t){12e4<r-e.created&&en.delete(t)}),1e3<=en.size&&en.delete(en.keys().next().value);var i,o="cgi-"+r.toString(16)+"-"+Math.random().toString(16).slice(2)+"-"+(++tn).toString(16),s="undefined"!=typeof globalThis?globalThis.performance:void 0,a=new Set;try{s.getEntriesByType("resource").forEach(function(e){e.name===t&&a.add(nn(e))})}catch(t){}try{"function"==typeof s.now&&(i=s.now())}catch(t){}var l=!1;return en.forEach(function(e){e.finished||e.url!==t||(e.ambiguous=!0,l=!0)}),en.set(o,{id:o,owner:n,url:t,lower:i,existing:a,ambiguous:l,created:r,initiatorType:e}),o}function Wt(t,e){var n;void 0===e?(n=Array.from(en.values()).find(function(e){return e.url===t}))&&en.delete(n.id):en.delete(e)}function Ht(e,t,n){return an(e,t,n).dnsTimeMs}function qt(s,a){var l,u,c,t,e,n=en.get(s.requestId),d=n?n.owner:null;n&&(s.willReport||rn.isCurrent(d))?(t=function(e){void 0===e&&(e=!1);function t(e){Wt(s.url,s.requestId),a(rn.isCurrent(d)?e:{},i)}var n,r=x(x({},s),{timingUnavailable:e}),i=e?void 0:Ht(s.url,s.startedAtMs,s.requestId),o=(e=r,r={ms:i},(o=void 0===(o=d)?rn.capture():o)&&rn.isCurrent(o)?(n=Number(e.statusCode)||0,r=r.ms,rn.invoke(o,x(x({requestId:e.requestId,source:"renderer_fetch_xhr",host:sn(e.url),url:e.url,statusCode:n,errorCode:"",durationMs:e.durationMs},void 0!==r?{dnsTimeMs:r}:{}),{willReport:e.willReport,process:"renderer",startedAtMs:e.startedAtMs}),200)):{});o&&"function"==typeof o.then?o.then(t,function(){return t({})}):t(o)},s.transportFailure?t(!0):(l=s.url,u=s.startedAtMs,c=s.requestId,e=(n="undefined"!=typeof globalThis?globalThis:{}).document,n=n.performance,"settled"===(e=null!=e&&null!=n&&"function"==typeof n.getEntriesByType&&an(l,u,c).pendingEntry?new Promise(function(t){var n,e=Date.now()+200,r=0,i=!1,o=function(e){i||(i=!0,void 0!==n&&clearTimeout(n),t(e))},s=function(){200<=r||Date.now()>=e?o("timeout"):an(l,u,c).pendingEntry?(r+=50,n=setTimeout(s,50)):o("settled")};i||(n=setTimeout(s,0))}):"settled")?t():e.then(function(e){return t("timeout"===e)},function(){return t()}))):(Wt(s.url,s.requestId),a({},void 0))}function Vt(e,t){return e&&-1===["null","undefined"].indexOf(e)?t+": "+e:""}function Gt(e,t,n){void 0===t&&(t="");var r,i,e="function"==typeof(null==(i=e.api)?void 0:i.resourceTypeHandler)?null==(i=e.api)?void 0:i.resourceTypeHandler(n):"";return-1===V.indexOf(e)&&(r=void 0===t?"":t,i=(void 0===n?"":n).split("?")[0],e=de.test(i)||ce.some(function(e){return-1!==String(r).indexOf(e)})?"static":"fetch"),e}function Zt(e,t){return e?un.AJAX_ERROR:t?un.RET_ERROR:un.API_RESPONSE}function Jt(e,t,n){if(!e)return!1;if(null!=(t=null==t?void 0:t.api)&&t.isSlowApi&&"function"==typeof(null==t?void 0:t.isSlowApi))try{return t.isSlowApi(n||{duration:e})}catch(e){return console.warn("[TDEM] isSlowApi function happen error:",e,", this data will not be reported."),!1}return(n=null!=(n=null==t?void 0:t.slowThreshold)?n:null==t?void 0:t.apiSlowThreshold)&&"number"==typeof n?n<e:1e3<e}function Kt(e,t){if(null!=(e=e.api)&&e.usePerformanceTiming&&"string"==typeof t.url){e=null==(e=performance.getEntriesByName(t.url))?void 0:e.pop();if(e)return{url:t.url,isHttps:ne(t.url),method:t.method,type:t.type,status:t.status,duration:Number(e.duration.toFixed(2)),nextHopProtocol:e.nextHopProtocol||"",domainLookup:X(e.domainLookupEnd-e.domainLookupStart),connectTime:X(e.connectEnd-e.connectStart)}}return{url:t.url,isHttps:ne(t.url),method:t.method,type:t.type,status:t.status,duration:Number(t.duration.toFixed(2)),nextHopProtocol:"",domainLookup:B.number,connectTime:B.number}}var $t,Xt,Yt,Qt,en=new Map,tn=0,nn=function(e){return e.startTime+":"+e.responseEnd},rn=($t=null,{register:function(e,t){if(void 0===t&&(t={}),"function"!=typeof e)throw new TypeError("A request finalizer must be a function");if($t&&!0!==t.replace)throw new Error("A request finalizer is already registered");var n={handler:e,pending:new Set};return Yt(n),function(){$t===n&&Yt(null)}},capture:function(){return $t},isCurrent:Xt=function(e){return null!==e&&$t===e},onInvalidated:Qt=function(e,t){var n;return Xt(e)?((n=$t).pending.add(t),function(){n.pending.delete(t)}):(t(),function(){})},invokeSync:function(e,t){if(!e||!Xt(e))return{};try{var n=e.handler(t);return n&&"function"==typeof n.then?(Promise.resolve(n).catch(function(){}),{}):Xt(e)?ht(n):{}}catch(e){return{}}},invoke:function(s,e,t){if(!s||!Xt(s))return{};try{var a=s.handler(e);return a&&"function"==typeof a.then?new Promise(function(n){function e(e){if(!r){r=!0,clearTimeout(o),i();var t={};try{Xt(s)&&(t=ht(e))}catch(e){}n(t)}}var r=!1,i=function(){},o=setTimeout(function(){return e()},t),i=Qt(s,function(){return e()});Promise.resolve(a).then(e,function(){return e()})}):Xt(s)?ht(a):{}}catch(s){return{}}}}),on=rn.register,sn=function(e){try{return new URL(e).hostname||""}catch(e){return""}},an=function(n,r,e){if((t=sn(n))&&(0<=t.indexOf(":")||4===(t=t.split(".")).length&&t.every(function(e){return/^\d{1,3}$/.test(e)&&Number(e)<=255})))return{pendingEntry:!1};var t=Array.from(en.values()).filter(function(e){return!e.finished&&e.url===n}),i=e?en.get(e):1===t.length?t[0]:void 0;if(i&&i.ambiguous||1<t.length)return{pendingEntry:!1};e="undefined"!=typeof globalThis&&globalThis.performance?globalThis.performance:"undefined"!=typeof performance?performance:void 0;if(!e||"function"!=typeof e.getEntriesByType)return{pendingEntry:!1};var o,t=[];try{var s=Number(e.timeOrigin),a=Number.isFinite(s)&&0<s,t=e.getEntriesByType("resource").filter(function(e){var t;return!(!e||e.name!==n||i&&i.initiatorType&&e.initiatorType!==i.initiatorType||i&&i.existing.has(nn(e))||(e=Number(e.startTime||0),t=a?s+e:e,!(i&&void 0!==i.lower?e>=i.lower:r<=t&&t<r+1)))})}catch(n){return{pendingEntry:!1}}return 1<t.length?{pendingEntry:!1}:0===t.length?{pendingEntry:!0}:(e=t[0],0<Number(e.redirectStart)||0<Number(e.redirectEnd)||(t=Number(e.domainLookupStart),o=Number(e.domainLookupEnd),!Number.isFinite(t))||!Number.isFinite(o)||o<t?{pendingEntry:!1}:(e=0<Number(e.requestStart)||0<Number(e.connectEnd),o===t?e?{dnsTimeMs:0,pendingEntry:!1}:{pendingEntry:!1}:{dnsTimeMs:o-t,pendingEntry:!1}))},ln={maxRetryCount:10,retryInterval:function(e){return 1e3*(2<<e)},whenRetryEndStillFail:"discard"},un={API_RESPONSE:"api_response",AJAX_ERROR:"ajax_error",RET_ERROR:"ret_error",SLOW_NET_REQUEST:"slow_net_request"};function cn(e){return!e||"boolean"==typeof e||"number"!=typeof(e=e.sseStallThresholdMs)||!Number.isFinite(e)||e<=0?6e4:e}function dn(e){return e&&"text/event-stream"===e.split(";")[0].trim().toLowerCase()}function fn(e){return"string"==typeof e&&""!==e.trim()}function hn(e){var t=String(e.requestUrl||""),n=String(e.finalUrl||""),r=t&&ee(t)||t,i=n&&ee(n)||n||r,n=!0===e.redirected||!!n&&!!t&&n!==t;return{url:i,originalUrl:r&&i&&r!==i?r:void 0,httpMethod:String(e.httpMethod||"GET").toUpperCase(),redirectCount:n?1:0}}function pn(n){function r(){b();var e=n.stallThresholdMs;0<e&&(u=setTimeout(function(){t("stalled")},e))}function i(){var e,t,n=f();void 0===o?o=n:void 0!==s&&(e=n-s,(void 0===a||a<e)&&(a=e),t=p,(e=e)<500?t.gap_lt_500_count+=1:e<1e3?t.gap_500_999_count+=1:e<3e3?t.gap_1000_2999_count+=1:e<1e4?t.gap_3000_9999_count+=1:e<6e4?t.gap_10000_59999_count+=1:t.gap_ge_60000_count+=1),s=n,g+=1,r()}function t(e){if(!y){y=!0,b(),w.splice(0).forEach(function(e){try{e()}catch(e){}});var t=Math.max(0,f()-h),t=x({duration:t,redirect_count:Math.max(0,n.redirectCount||0),message_count:g,stall_threshold_ms:n.stallThresholdMs},p),e=(void 0!==o&&(t.time_to_first_message=Math.max(0,o-h)),void 0!==s&&(t.last_message_offset=Math.max(0,s-h)),void 0!==a&&(t.max_message_gap=a),{http_method:n.httpMethod||"GET",outcome:e,model_version:d}),t=(void 0!==l&&0<l&&(e.http_status=String(l)),n.originalUrl&&n.originalUrl!==n.url&&(e.original_url=n.originalUrl),{event_id:A(),event_type:M.SSE_CALL,event_category:I.NETWORK,timestamp:f(),page_url:n.pageUrl||"",data:{url:n.url,resource_type:"sse",measurements:t,replay_id:n.replayId||void 0,event_properties:e}});try{n.report(t)}catch(e){}}}e=n.llmVersion;var o,s,a,l,u,e,c,d=(e=String(null==e?"":e).trim())?(c=Array.from(e)).length<=128?e:c.slice(0,128).join(""):"unknown",f=n.now||Date.now,h=f(),p={gap_lt_500_count:0,gap_500_999_count:0,gap_1000_2999_count:0,gap_3000_9999_count:0,gap_10000_59999_count:0,gap_ge_60000_count:0},m="",v=!1,g=0,y=!1,w=[],b=function(){void 0!==u&&(clearTimeout(u),u=void 0)};return r(),{ingestText:function(e){if(!y){e=e.replace(/\r\n/g,"\n");if(v){var t=e.indexOf("\n\n");if(-1===t)return;v=!1,e=e.slice(t+2)}for(var n=(m=(m+=e).replace(/\r\n/g,"\n")).indexOf("\n\n");-1!==n;){var r=m.slice(0,n);m=m.slice(n+2),r.replace(/\r\n/g,"\n").split("\n").some(function(e){return e.startsWith("data:")||"data"===e})&&i(),n=m.indexOf("\n\n")}1048576<m.length&&(v=!(m=""))}},ingestCompleteMessage:function(){y||i()},noteHttpStatus:function(e){0<e&&(l=e)},succeed:function(){return t("success")},failTransport:function(){return t("transport_error")},httpError:function(){return t("http_error")},cancel:function(){return t("cancelled")},pauseStall:function(){y||b()},resumeStall:function(){y||r()},onSeal:function(t){if(y){try{t()}catch(t){}return function(){}}return w.push(t),function(){var e=w.indexOf(t);-1!==e&&w.splice(e,1)}},seal:t,get sealed(){return y},get messageCount(){return g},get httpStatus(){return l}}}function mn(f,h){var p;return D(this,void 0,void 0,function(){var i,o,s,a,l,u,c,d;return L(this,function(e){switch(e.label){case 0:if(!f||"function"!=typeof f.getReader)return h.succeed(),[2];i=f.getReader(),s=o=!1,a=function(){if(!o&&!s&&"function"==typeof i.cancel){s=!0;try{var e=i.cancel();e&&"function"==typeof e.catch&&e.catch(function(){})}catch(e){}}},l=h.onSeal(a),u="undefined"!=typeof TextDecoder?new TextDecoder:{decode:function(e){return"undefined"!=typeof Buffer?Buffer.from(e).toString("utf8"):Array.from(e).map(function(e){return String.fromCharCode(e)}).join("")}},e.label=1;case 1:e.trys.push([1,5,6,7]),e.label=2;case 2:return h.sealed?[3,4]:[4,i.read()];case 3:return c=e.sent(),d=c.done,c=c.value,d?(o=!0,h.succeed(),[2]):(c&&h.ingestText(u.decode(c,{stream:!0})),[3,2]);case 4:return[3,7];case 5:return d=e.sent(),h.sealed||h[n=h.messageCount,r=h.httpStatus,!(t=d)||"object"!=typeof t||"AbortError"!==t.name&&"ABORT_ERR"!==t.code&&"ECONNABORTED"!==t.code&&!0!==t.aborted?(0<n||"number"==typeof r&&200<=r&&r<400)&&((e=>{if(fn(e)&&-1!==e.toLowerCase().indexOf("terminated"))return 1;for(var t=e,n=new Set;t&&"object"==typeof t&&!n.has(t);){n.add(t);var r=String(t.name||""),i=String(t.code||""),o=String(t.message||"").toLowerCase();if("TypeError"===r&&-1!==o.indexOf("terminated"))return 1;if("ERR_INVALID_STATE"===i)return 1;t=t.cause}})(t)||fn(t))?"succeed":"failTransport":"cancel"](),[3,7];case 6:l(),a();try{null!=(p=i.releaseLock)&&p.call(i)}catch(t){}return[7];case 7:return[2]}var t,n,r})})}var vn,gn,yn=!(Yt=function(e){var t=$t;$t=e,t&&(Array.from(t.pending).forEach(function(e){return e()}),t.pending.clear())});function wn(e){var t=e.__tdemXhrHooks;t&&(e.removeEventListener("readystatechange",t.onReadyStateChange),e.removeEventListener("progress",t.onProgress),e.removeEventListener("loadend",t.onLoadEnd),e.removeEventListener("abort",t.onAbort),e.removeEventListener("error",t.onError),e.removeEventListener("timeout",t.onTimeout),e.__tdemXhrHooks=void 0)}function bn(e){var t=String(e.responseType||"").toLowerCase();if(!t||"text"===t)try{return"string"==typeof e.responseText?e.responseText:""}catch(e){}}new e({name:"api"});var kn,_n,Sn,En=new e({name:"api",override:!1,onNewTdem:function(e){var t,n;this.override||(this.override=!0,null!=(n=e.config.api)&&n.injectTraceHeader&&(this.traceRequestHeader=new Ze(n.injectTraceHeader,null!=(t=null==n?void 0:n.injectTraceIgnoreUrls)?t:[],null==n?void 0:n.injectTraceUrls,null==n?void 0:n.traceFlag)),this.overrideFetch(e.config,e),this.overrideXhr(e.config,e),!1!==n&&this.overrideEventSource(e.config,e))},getFromParam:function(e){var t;return(null==(t=e.getOriginFrom)?void 0:t.call(e))||window.location.href},currentViewId:function(e){var t=null!=(e=null!=(t=e.viewId)?t:null==(t=e.bean)?void 0:t.viewId)?e:"";return String(t||"")},rememberViewId:function(e,t){e&&(e.__tdemViewId=this.currentViewId(t))},reportWithStartedView:function(e,t,n){var n=String((null==n?void 0:n.__tdemViewId)||(null==t?void 0:t.view_id)||""),t=!n||null!=t&&t.view_id?t:x(x({},t),{view_id:n});null!=(n=e.reportTDEMEvent)&&n.call(e,t)},overrideFetch:function(E,C){var R=this,a=E.api,e={name:this.name,traceRequestHeader:null!=a&&a.injectTraceHeader?this.traceRequestHeader:null,shouldInjectTrace:function(){return at(C)},getCurrentFrom:function(){return R.getFromParam(C)},beforeFetch:function(e,t){le(e,E.hostUrl)||(t.__tdemRequestId=jt(e,"fetch")),R.rememberViewId(t,C)},cloneError:function(e,t,n,r,i,o){var s;le(n,E.hostUrl)||(s=e.headers?e.headers.get("content-type"):"",!1!==a&&dn(s)?(Wt(n,null==(s=r)?void 0:s.__tdemRequestId),(s=pn({url:(s=hn({requestUrl:n,finalUrl:e&&e.url,httpMethod:null==r?void 0:r.method,redirected:!!e.redirected})).url,originalUrl:s.originalUrl,httpMethod:s.httpMethod,redirectCount:s.redirectCount,stallThresholdMs:cn(a),report:function(e){return R.reportWithStartedView(C,e,r)},pageUrl:o||R.getFromParam(C),replayId:P(C),llmVersion:E.llmVersion})).noteHttpStatus(e.status),400<=e.status?s.httpError():s.succeed()):qt({requestId:(null==(o=r)?void 0:o.__tdemRequestId)||"",url:n,statusCode:e.status||0,durationMs:t,startedAtMs:Number(i)||0,willReport:!1},function(){}))},then:function(m,v,g,y,w,b,k){if(!le(g,E.hostUrl)){var e,t,_=(null==(n=y)?void 0:n.__tdemRequestId)||"",n=(y&&(y.__tdemRequestId=_),m.headers?m.headers.get("content-type"):"");if(!1!==a&&dn(n))return Wt(g,_),e=hn({requestUrl:g,finalUrl:m&&m.url,httpMethod:null==y?void 0:y.method,redirected:!!m.redirected}),(t=pn({url:e.url,originalUrl:e.originalUrl,httpMethod:e.httpMethod,redirectCount:e.redirectCount,stallThresholdMs:cn(a),report:function(e){return R.reportWithStartedView(C,e,y)},pageUrl:b||R.getFromParam(C),replayId:P(C),llmVersion:E.llmVersion})).noteHttpStatus(m.status),m.__tdemSseObserver=t,400<=m.status?(t.httpError(),void mn(m.body,t).catch(function(){})):void mn(m.body,t).catch(function(){t.sealed||t.failTransport()});var S=Gt(E,n||"",g);"fetch"===S?Promise.resolve().then(function(){return m.clone().text()}).then(function(s){var e,a=m.status<=0||400<=m.status,t=(null==(t=E.api)?void 0:t.reqHeaders)||[],l=Bt(null==y?void 0:y.headers,t,"req"),t=(null==(t=E.api)?void 0:t.resHeaders)||[],u=Bt(m.headers,t,"res"),c=qe(null==y?void 0:y.headers),t=re(s,E.api,{url:g,ctx:m,payload:null==y?void 0:y.body}),d=t.code,f=t.isErr,t=null==(t=E.api)?void 0:t.apiDetail,h=t?oe(null==y?void 0:y.body,null==(e=E.api)?void 0:e.reqParamHandler,{url:g}):"",p=t?oe(s,null==(e=E.api)?void 0:e.resBodyHandler,{url:g,ctx:m}):"";setTimeout(function(){var n=Kt(E,{url:g,duration:v,type:S,status:m.status||0,method:(null==y?void 0:y.method)||"get"}),e=[a?"FETCH_ERROR: "+s:"","fetch req url: "+g,"res status: "+(n.status||0),"res duration: "+n.duration+"ms","res startTime: "+w,l,u,"req method: "+(n.method||"GET"),"res retcode: "+d,Vt(h,"req param"),Vt(p,"res data")].filter(function(e){return e}).join("\n\n"),r=(n.payload=null==y?void 0:y.body,n.ret=d,n.isErr=+f,n.from=b||R.getFromParam(C),{msg:e,code:d,trace:c,errorMsg:"",from:b||R.getFromParam(C),originFrom:k,viewId:null==(e=y)?void 0:e.__tdemViewId,level:un.API_RESPONSE}),e=Jt(null==n?void 0:n.duration,E,n),t=Zt(a,f);r.level=t===un.API_RESPONSE&&e?un.SLOW_NET_REQUEST:t,r.isErr=f;var i=e||r.level!==un.API_RESPONSE,o=null==(t=C.config)?void 0:t.api;qt({requestId:_,url:g,statusCode:n.status||0,durationMs:Number(n.duration)||0,startedAtMs:Number(w)||0,willReport:!!(i||C.isWhiteList||null!=o&&o.reportRequest||null!=o&&o.injectTraceHeader),transportFailure:!(0<m.status)},function(e,t){e&&Object.keys(e).length&&(r.dialFields=e),null!=t&&(r.dnsTime=t),(i||C.isWhiteList||null!=o&&o.reportRequest||null!=o&&o.injectTraceHeader)&&R.publishNormalLog(r,C),R.publishSpeed(n,C)})},0)}).catch(function(){qt({requestId:_,url:g,statusCode:m.status||0,durationMs:v,startedAtMs:Number(w)||0,willReport:!1},function(){})}):(Wt(g,_),setTimeout(function(){var e=Kt(E,{url:g,duration:v,type:S,status:m.status||0,method:(null==y?void 0:y.method)||"get"});e.type="static",e.urlQuery=ee(g,!0),e.from=b||R.getFromParam(C),R.publishSpeed(e,C)},0))}},catch:function(e,t,i,o,s,a,l){if(le(i,E.hostUrl))throw e;var u,n,c,d,f,h=(null==(n=o)?void 0:n.__tdemRequestId)||"";if((n=en.get(h))&&(n.finished=!0),"AbortError"!==(e&&e.name))throw u=Gt(E,"",i),n=(null==(n=E.api)?void 0:n.reqHeaders)||[],c=Bt(null==o?void 0:o.headers,n,"req"),d=qe(null==o?void 0:o.headers),f=null!=(n=E.api)&&n.apiDetail?oe(null==o?void 0:o.body,null==(n=E.api)?void 0:n.reqParamHandler,{url:i}):"",setTimeout(function(){var n=Kt(E,{url:i,duration:t,type:u,status:0,method:(null==o?void 0:o.method)||"get"}),r=(n.from=a||R.getFromParam(C),"AJAX_ERROR: "+e+"\n \nreq url: "+i+"\n \nres status: 0\n \nres duration: "+n.duration+"ms\n \nreq method: "+((null==o?void 0:o.method)||"get")+"\n \nreq param: "+f+"\n \nres startTime: "+s+"\n \n"+c);qt({requestId:h,url:i,statusCode:0,durationMs:Number(n.duration)||0,startedAtMs:Number(s)||0,willReport:!0,transportFailure:!0},function(e){var t;R.publishSpeed(n,C),R.publishNormalLog({msg:r,level:un.AJAX_ERROR,code:-400,trace:d,errorMsg:"",from:a||R.getFromParam(C),originFrom:l,viewId:null==(t=o)?void 0:t.__tdemViewId,dialFields:e},C)})},0),e;Wt(i,h)}},T=(this.hackFetchOptions=e,this.hackFetchOptions),O=null==(e=E.api)?void 0:e.ignoreHackReg;if(void 0===O&&(O=/\.flv(\?|$)/i),Ut.find(function(e){return e.name===T.name}))throw new Error("name '"+T.name+"' is already in hackFetch option list");Ut.push(T),!Ft&&window.fetch&&(Ft=!0,At=window.fetch,window.fetch=function(e,t){void 0===t&&(t={});var n,i="string"==typeof e?e:e&&"object"==typeof e?"string"==typeof(n=e.url)&&n?n:"string"==typeof(n=e.href)&&n?n:"":"";if(i&&null!=(n=null==O?void 0:O.test)&&n.call(O,i))return Nt(e,t);Lt.test(i)&&(i=""+location.origin+i);var r,o,s,a,l,u,c,d,f=T||{},h=f.traceRequestHeader,f=f.shouldInjectTrace;if(h&&(!f||f()))try{var p=((e,t)=>(e="undefined"!=typeof Request&&"string"!=typeof e&&e instanceof Request?zt(e.headers):{},x(x({},e),zt(t.headers))))(e,t),m=Ot(),v=m.host,g=m.pathname,y=h.generate(i,p,{host:v,pathname:g})||{},w=y.name,b=y.value;w&&b&&(r=e,o=t,s=w,a=b,u="undefined"!=typeof Headers?Headers:null,c="undefined"!=typeof Request&&"string"!=typeof r&&r instanceof Request,d=o.headers,u&&(c||d&&d instanceof u)?(l=new u(c?r.headers:void 0),d instanceof u?d.forEach(function(e,t){return l.set(t,e)}):Array.isArray(d)?d.forEach(function(e){e&&e[0]&&l.set(String(e[0]),String(e[1]))}):d&&"object"==typeof d&&Object.keys(d).forEach(function(e){l.set(e,String(d[e]))}),l.has(s)||l.set(s,a),o.headers=l):(c=zt(d))[s]||c[s.toLowerCase()]||(o.headers=Object.assign({},c,((r={})[s]=a,r))))}catch(e){}for(var k=new Map,_=window.location.href,S=0;S<Ut.length;S++){var E=Ut[S];try{"function"==typeof E.beforeFetch&&E.beforeFetch(i,t),"function"==typeof E.getCurrentFrom&&k.set(E.name,E.getCurrentFrom())}catch(e){}}var C=Date.now(),R=Object.assign({},t,{method:(f=e,(m=t)&&m.method?String(m.method).toUpperCase():"string"!=typeof f&&f&&f.method?String(f.method).toUpperCase():"GET")});return Nt(e,t).then(function(e){var t;try{t=e.clone()}catch(t){for(var n=0;n<Ut.length;n++){var r=Ut[n];try{"function"==typeof r.cloneError&&r.cloneError(e,Date.now()-C,i,R,C,k.get(r.name),_)}catch(e){}}return e}for(n=0;n<Ut.length;n++){r=Ut[n];try{"function"==typeof r.then&&r.then(t,Date.now()-C,i,R,C,k.get(r.name),_)}catch(e){}}return e}).catch(function(e){for(var t=0;t<Ut.length;t++){var n=Ut[t];try{"function"==typeof n.catch&&n.catch(e,Date.now()-C,i,R,C,k.get(n.name),_)}catch(e){}}throw e})})},overrideXhr:function(C,R){var i,T=this,e={name:this.name,ignoreHackReg:null==(e=C.api)?void 0:e.ignoreHackReg,traceRequestHeader:null!=(e=C.api)&&e.injectTraceHeader?this.traceRequestHeader:null,getCurrentFrom:function(){return T.getFromParam(R)},open:function(e){var t;(t=(e=e).__tdemSseObserver)&&!t.sealed&&t.cancel(),wn(e),e.__tdemSseClaimed=!1,e.__tdemSseObserver=void 0,e.failType=void 0},send:function(b,k,_,S){T.rememberViewId(b,R);function e(){b.failType="abort"}function t(){b.failType="error"}function n(){b.failType="timeout"}function r(){var e;!1===C.api||b.__tdemSseClaimed||(e=b.tdemUrl||"",!le(e,C.hostUrl)&&dn(("function"==typeof b.getResponseHeader?b.getResponseHeader("content-type"):"")||"")&&(b.__tdemSseClaimed=!0,(e=pn({url:(e=hn({requestUrl:b.tdemUrl||"",finalUrl:("string"==typeof b.responseURL?b.responseURL:"")||void 0,httpMethod:b.tdemMethod})).url,originalUrl:e.originalUrl,httpMethod:e.httpMethod,redirectCount:e.redirectCount,stallThresholdMs:cn(C.api),report:function(e){return T.reportWithStartedView(R,e,b)},pageUrl:_||T.getFromParam(R),replayId:P(R),llmVersion:C.llmVersion})).noteHttpStatus(b.status),b.__tdemSseObserver=e))}function i(){r()}function o(){r();var e,t=b.__tdemSseObserver;t&&void 0!==(e=bn(b))&&e.length>u&&(t.ingestText(e.slice(u)),u=e.length)}function s(){var e,v,g,t,y,w=b.tdemUrl||"";b.__tdemSseClaimed?(Wt(w,b.__tdemRequestId),(e=b.__tdemSseObserver)&&!e.sealed&&(void 0!==(t=bn(b))&&t.length>u&&e.ingestText(t.slice(u)),e.noteHttpStatus(b.status),"abort"===b.failType?e.cancel():400<=b.status?e.httpError():b.failType?e.failTransport():e.succeed()),wn(b)):(wn(b),le(w,C.hostUrl)||"abort"===b.failType?Wt(w,b.__tdemRequestId):(v="",(b.failType||!b.status||400<=b.status)&&(v=b.failType||"failed"),g=Date.now()-E,t=b.getResponseHeader("content-type")||"",y=Gt(C,t,w),setTimeout(function(){var u=Kt(C,{url:w,duration:g,type:y,status:b.status,method:b.tdemMethod||"get"});if(u.from=_||T.getFromParam(R),"fetch"===y){var e=(null==(e=C.api)?void 0:e.reqHeaders)||[],c=Bt(b.tdemXhrReqHeader,e,"req"),e=(null==(e=C.api)?void 0:e.resHeaders)||[],t=b.getAllResponseHeaders().split("\r\n").reduce(function(e,t){t=t.split(": ");return t[0]&&t[1]&&(e[t[0]]=t[1]),e},{}),d=Bt(t,e,"res"),f=qe(b.tdemXhrReqHeader),e=null==(t=C.api)?void 0:t.apiDetail,h=e?oe(k,null==(t=C.api)?void 0:t.reqParamHandler,{url:w}):"",p=e?oe(b.response,null==(t=C.api)?void 0:t.resBodyHandler,{url:w}):"";try{var n,r,i,o=b.response,s=C.api,a={url:w,ctx:b,payload:k},l=function(e){var n=e.code,r=e.isErr,i=[v?"AJAX_ERROR: request "+v:"","fetch req url: "+w,"res status: "+(u.status||0),"res duration: "+u.duration+"ms","res startTime: "+E,c,d,"req method: "+(u.method||"GET"),"res retcode: "+n,Vt(h,"req param"),Vt(p,"res data")].filter(function(e){return e}).join("\n\n"),o=(u.ret=n,u.isErr=+r,u.payload=k,Zt(!!v,r)),s=Jt(null==u?void 0:u.duration,C,u),a=o===un.API_RESPONSE&&s?un.SLOW_NET_REQUEST:o,e=b.__tdemRequestId||"",l=(b.__tdemRequestId=e,null==(t=R.config)?void 0:t.api),t=o!==un.API_RESPONSE||s||R.isWhiteList||(null==l?void 0:l.reportRequest)||(null==l?void 0:l.injectTraceHeader);qt({requestId:e,url:w,statusCode:u.status||0,durationMs:Number(u.duration)||0,startedAtMs:Number(E)||0,willReport:!!t,transportFailure:!(0<b.status)},function(e,t){(o!==un.API_RESPONSE||s||R.isWhiteList||null!=l&&l.reportRequest||null!=l&&l.injectTraceHeader)&&T.publishNormalLog({msg:i,level:a,code:n,isErr:r,trace:f,errorMsg:"",from:_||T.getFromParam(R),originFrom:S,viewId:b.__tdemViewId,dialFields:e,dnsTime:t},R),T.publishSpeed(u,R)})};try{if("function"==typeof(null==s?void 0:s.retCodeHandlerAsync))return void s.retCodeHandlerAsync(o,null==a?void 0:a.url,null==a?void 0:a.ctx,function(e){var t=e.code;null!=l&&l({code:void 0===t?G:t,isErr:e.isErr})});if("function"==typeof(null==s?void 0:s.retCodeHandler))return void(i=(r=s.retCodeHandler(o,null==a?void 0:a.url,null==a?void 0:a.ctx,null==a?void 0:a.payload)||{}).code,null!=l&&l({code:void 0===i?G:i,isErr:r.isErr}));if(!(o="string"==typeof o?JSON.parse(o):o))return void(null!=l&&l({code:G,isErr:!1}));"function"==typeof(null==(n=null==s?void 0:s.ret)?void 0:n.join)&&(fe=[].concat(s.ret.map(function(e){return e.toLowerCase()})));var m=Object.getOwnPropertyNames(o).filter(function(e){return-1!==fe.indexOf(e.toLowerCase())});if(m.length)return void("未知"!==(i=o[m[0]])&&""!==i||(i=G),null!=l&&l({code:""+i,isErr:0!==i&&"0"!==i&&i!==G}));null!=l&&l({code:G,isErr:!1})}catch(o){null!=l&&l({code:G,isErr:!1})}}catch(e){Wt(w,b.__tdemRequestId),u.ret=G,T.publishSpeed(u,R)}}else Wt(w,b.__tdemRequestId),u.type="static",u.urlQuery=ee(w,!0),T.publishSpeed(u,R)},0)))}var a,l,E=Date.now(),u=(le(b.tdemUrl||"",C.hostUrl)||(b.__tdemRequestId=jt(b.tdemUrl||"","xmlhttprequest")),((null==C?void 0:C.api)||{}).injectTraceHeader&&at(R)&&(l=(a=Ot()).host,a=(l=T.traceRequestHeader.generate(b.tdemUrl,{},{host:l,pathname:a.pathname})||{}).name,l=l.value,a)&&l&&b.setRequestHeader(a,l),0);b.__tdemXhrHooks={onReadyStateChange:i,onProgress:o,onLoadEnd:s,onAbort:e,onError:t,onTimeout:n},b.addEventListener("readystatechange",i),b.addEventListener("progress",o),b.addEventListener("loadend",s),b.addEventListener("abort",e),b.addEventListener("error",t),b.addEventListener("timeout",n)}};this.hackXHROptions=e,i=this.hackXHROptions,Dt.find(function(e){return e.name===i.name})||(Dt.push(i),!Pt&&window.XMLHttpRequest&&(xt=window.XMLHttpRequest.prototype.send,Mt=window.XMLHttpRequest.prototype.open,It=window.XMLHttpRequest.prototype.setRequestHeader,Pt=!0,window.XMLHttpRequest.prototype.open=function(){this.tdemMethod=arguments[0];var e,t=arguments[1];if(Lt.test(t)&&(t=""+location.origin+t),this.tdemUrl=t,null==(t=null==(e=i.ignoreHackReg)?void 0:e.test)||!t.call(e,this.tdemUrl))if(this.tdemXhrStartTime=Date.now(),this.sendByTdem)l.isIE()||(this.timeout=5e3);else for(var n=0;n<Dt.length;n++){var r=Dt[n];try{"function"==typeof r.open&&r.open(this)}catch(e){}}return Mt.apply(this,arguments)},window.XMLHttpRequest.prototype.setRequestHeader=function(){var e,t,n;return null!=(t=null==(n=i.ignoreHackReg)?void 0:n.test)&&t.call(n,this.tdemUrl)?It.apply(this,arguments):(t=arguments[0],n=arguments[1],this.tdemXhrReqHeader=null!=(e=this.tdemXhrReqHeader)?e:{},null!=i&&i.traceRequestHeader&&-1<["traceparent","b3","sw8","sentry-trace"].indexOf(t)&&(this.tdemXhrReqHeader[t]||(arguments[1]=n),this.tdemXhrReqHeader[t])?void 0:(this.tdemXhrReqHeader[t]=arguments[1],It.apply(this,arguments)))},window.XMLHttpRequest.prototype.send=function(){var e,t;if(!(null!=(t=null==(e=i.ignoreHackReg)?void 0:e.test)&&t.call(e,this.tdemUrl)||this.sendByTdem))for(var n=0;n<Dt.length;n++){var r=Dt[n];try{"function"==typeof r.send&&r.send(this,arguments[0],"function"==typeof r.getCurrentFrom?r.getCurrentFrom():void 0,window.location.href)}catch(e){}}return xt.apply(this,arguments)}))},overrideEventSource:function(o,s){var n,a=this;function e(e,t){t=new n(e,t);try{null!=gn&&gn(t,String(e))}catch(e){}return t}gn={onCreate:function(t,e){var n={__tdemViewId:a.currentViewId(s)};if(!le(e,o.hostUrl)){var r=pn({url:ee(e)||e,httpMethod:"GET",stallThresholdMs:cn(o.api),report:function(e){return a.reportWithStartedView(s,e,n)},pageUrl:a.getFromParam(s),replayId:P(s),llmVersion:o.llmVersion});r.pauseStall(),t.addEventListener("open",function(){return r.resumeStall()}),t.addEventListener("message",function(){return r.ingestCompleteMessage()}),t.addEventListener("error",function(){if(!r.sealed){var e=t.readyState;0!==e?2===e&&r.failTransport():r.pauseStall()}});var i=t.close.bind(t);t.close=function(){try{r.sealed||r.cancel()}finally{i()}}}}}.onCreate,"undefined"!=typeof window&&window.EventSource&&!yn&&(yn=!0,n=vn=window.EventSource,e.prototype=n.prototype,e.CONNECTING=n.CONNECTING,e.OPEN=n.OPEN,e.CLOSED=n.CLOSED,window.EventSource=e)},publishSpeed:function(e){},publishNormalLog:function(n,e){var t,r,i,o,s,a,l,u,c;[un.API_RESPONSE,un.AJAX_ERROR,un.RET_ERROR,un.SLOW_NET_REQUEST].includes(n.level)&&(t=(t=null==(t=n.msg)?void 0:t.match(/(?:fetch req url|req url):\s*(.+?)(?:\n|$)/))?t[1].trim():"",r=(r=null==(r=n.msg)?void 0:r.match(/req method:\s*(.+?)(?:\n|$)/i))?r[1].trim().toUpperCase():"GET",a=(a=null==(a=n.msg)?void 0:a.match(/res status:\s*(\d+)/))?parseInt(a[1],10):0,i=(i=null==(i=n.msg)?void 0:i.match(/res duration:\s*([\d.]+)ms/))?parseFloat(i[1]):0,l=(l=null==(l=n.msg)?void 0:l.match(/=+\s*res data\s*=+\s*\n([\s\S]*?)(?:\n=+|$)/))?l[1].trim().slice(0,1e3):void 0,o={},n.trace&&(o.trace_id=n.trace),(c=(u={httpStatus:a,isTransportFailure:a<=0,isBusinessError:n.level===un.RET_ERROR||!!n.isErr,businessCode:n.code}).aborted?{report:!1,eventType:null}:(c=Number(u.httpStatus),u.isTransportFailure||!Number.isFinite(c)||c<=0?{report:!0,eventType:"api_error",outcome:"transport_error"}:400<=c?{report:!0,eventType:"api_error",outcome:"http_error"}:u.isBusinessError?{report:!0,eventType:"api_error",outcome:"business_error",businessCode:K(u.businessCode)||G}:{report:!0,eventType:"api_call",businessCode:K(u.businessCode)})).report)&&c.eventType&&(s={http_method:r,http_status:String(a)},c.outcome&&(s.outcome=c.outcome),c.businessCode&&(s.business_code=c.businessCode),n.dialFields&&"object"==typeof n.dialFields&&Object.keys(n.dialFields).forEach(function(e){var t=n.dialFields[e];null!=t&&""!==t&&(s[e]=String(t))}),u={duration:i},null!=n.dnsTime&&Number.isFinite(Number(n.dnsTime))&&(u.dns_time=Math.max(0,Number(n.dnsTime))),"api_error"===c.eventType?(a=x(x({event_id:A(),event_type:M.API_ERROR,event_category:I.ERROR,timestamp:Date.now(),page_url:n.from||(null==(r=e.getOriginFrom)?void 0:r.call(e))||window.location.href},n.viewId?{view_id:String(n.viewId)}:{}),{data:{url:t,measurements:u,response_body:l,replay_id:P(e),tags:0<Object.keys(o).length?o:void 0,event_properties:s}}),null!=(i=e.reportTDEMEvent)&&i.call(e,a)):(l=x(x({event_id:A(),event_type:M.API_CALL,event_category:I.NETWORK,timestamp:Date.now(),page_url:n.from||(null==(r=e.getOriginFrom)?void 0:r.call(e))||window.location.href},n.viewId?{view_id:String(n.viewId)}:{}),{data:{url:t,measurements:u,replay_id:P(e),tags:0<Object.keys(o).length?o:void 0,event_properties:s}}),null!=(i=e.reportTDEMEvent)&&i.call(e,l)))},destroy:function(){var t,n,e;this.option.publishSpeed=function(){},this.option.publishNormalLog=function(){},this.option.hackXHROptions&&(t=this.option.hackXHROptions,-1!==(e=Dt.findIndex(function(e){return e.name===t.name})))&&Dt.splice(e,1),this.option.hackFetchOptions&&(n=this.option.hackFetchOptions,-1!==(e=Ut.findIndex(function(e){return e.name===n.name})))&&Ut.splice(e,1),vn&&(window.EventSource=vn),yn=!1,gn=vn=void 0,this.option.override=!1}}),Cn={},Rn=new e({name:"bridge",override:!1,onNewTdem:function(e){this.override||(this.override=!0,this.overrideBridge(e))},getFromParam:function(e){var t;return(null==(t=e.getOriginFrom)?void 0:t.call(e))||window.location.href},publishSpeed:function(t,n){this.$walk(function(e){e===n&&e.speedLogPipeline(t)})},overrideBridge:function(u){var c=this,d=u.config,e="object"==typeof d.bridge?d.bridge:void 0,t=null==e?void 0:e.target,e=null==e?void 0:e.methods;t&&null!=e&&e.length&&e.forEach(function(e){var l=t[e];Cn[e]=l,t[e]=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e[0],i=e[1],n=e[2],o=e[3],s=Date.now(),a=c.getFromParam(u);l(r,i,n,function(e){var t=re(e,d.api),n=t.code,t=t.isErr,n={url:r+"-"+i,name:r+"-"+i,duration:Date.now()-s,type:"bridge",ret:n,isErr:+t,from:a};c.publishSpeed(n,u),o(e)})}})},unHackBridge:function(e){var e="object"==typeof e.config.bridge?e.config.bridge:void 0,t=null==e?void 0:e.target;Cn=(t&&Object.keys(Cn).forEach(function(e){Cn[e]&&(t[e]=Cn[e])}),{})},destroy:function(e){this.option.publishSpeed=function(){},this.option.unHackBridge(e),this.option.override=!1}}),n=((n=kn=kn||{})[n.unknown=100]="unknown",n[n.wifi=1]="wifi",n[n.net2g=2]="net2g",n[n.net3g=3]="net3g",n[n.net4g=4]="net4g",n[n.net5g=5]="net5g",n[n.net6g=6]="net6g",(n=_n=_n||{})[n.android=1]="android",n[n.ios=2]="ios",n[n.windows=3]="windows",n[n.macos=4]="macos",n[n.linux=5]="linux",n[n.other=100]="other",(n=Sn=Sn||{})[n.unknown=100]="unknown",n[n.normal=0]="normal",n[n.weak=1]="weak",n[n.disconnected=2]="disconnected",new e({name:"device",onNewTdem:function(e){e.extendBean("platform",this.getPlatform()),e.extendBean("netType",kn.unknown),this.getDpi(e),this.refreshNetworkTypeToBean(e),this.refreshNetworkStatusToBean(e)},getDpi:function(e){e.extendBean("vp",Math.round(window.innerWidth)+" * "+Math.round(window.innerHeight)),window.screen&&e.extendBean("sr",Math.round(window.screen.width)+" * "+Math.round(window.screen.height))},getPlatform:function(){var t={android:/\bAndroid\s*([^;]+)/,ios:/\b(iPad|iPhone|iPod)\b.*? OS ([\d_]+)/,windows:/\b(Windows NT)/,macos:/\b(Mac OS)/,linux:/\b(Linux)/i},e=Object.keys(t).find(function(e){return t[e].test(navigator.userAgent)});return e?_n[e]:_n.other},refreshNetworkTypeToBean:function(t){var n=this,e=t.config;e&&("function"==typeof e.getNetworkType?e.getNetworkType:Tn)(function(e){kn[e]||(e=kn.unknown),t.extendBean("netType",e),n.NetworkRefreshTimer=setTimeout(function(){n.refreshNetworkTypeToBean(t),clearTimeout(n.NetworkRefreshTimer)},1e4)})},refreshNetworkStatusToBean:function(t){var e,n=this,r=t.config;r&&null!=(e="function"==typeof r.getNetworkStatus?r.getNetworkStatus:e)&&e(function(e){void 0===Sn[e]&&(e=Sn.unknown),t.extendBean("netStatus",e),n.NetworkStatusRefreshTimer=setTimeout(function(){n.refreshNetworkStatusToBean(t),clearTimeout(n.NetworkStatusRefreshTimer)},1e4)})}})),Tn=function(e){var t="",n=navigator.userAgent.match(/NetType\/(\w+)/);n?t=n[1]:navigator.connection&&(t=navigator.connection.effectiveType||navigator.connection.type),e((n=t=t||G,0<=(n=String(n).toLowerCase()).indexOf("4g")?kn.net4g:0<=n.indexOf("wifi")?kn.wifi:0<=n.indexOf("5g")?kn.net5g:0<=n.indexOf("6g")?kn.net6g:0<=n.indexOf("3g")?kn.net3g:0<=n.indexOf("2g")?kn.net2g:kn.unknown))},On=window.WebSocket,xn=[],Mn={construct:function(e,t){var r=new e(t[0],t[1]);return r.originSend=r.send,r.addEventListener("error",function(e){var e=(null==e?void 0:e.currentTarget)||{},t=e.url,n=e.readyState;null!=xn&&xn.forEach(function(e){e=e.onErr;null!=e&&e({msg:"无法获知具体错误信息,需在浏览器控制台查看!",readyState:n,connectUrl:t})})}),Object.defineProperty(r,"send",{get:function(){return function(e){null!=(t=r.originSend)&&t.call(r,e);var t=r.readyState;if(t!==WebSocket.OPEN){var n={readyState:t,connectUrl:r.url};switch(t){case WebSocket.CLOSED:xn.forEach(function(e){e=e.sendErr;null!=e&&e(x({msg:"消息发送失败,连接已关闭!"},n))});break;case WebSocket.CONNECTING:xn.forEach(function(e){(0,e.sendErr)(x({msg:"消息发送失败,正在连接中!"},n))});break;case WebSocket.CLOSING:xn.forEach(function(e){(0,e.sendErr)(x({msg:"消息发送失败,连接正在关闭!"},n))})}}}}}),r}},In=new e({name:"onError"}),An=In=new e({name:"onError",onNewTdem:function(e){this.startListen(e)},getFromParam:function(e){var t;return(null==(t=e.getOriginFrom)?void 0:t.call(e))||window.location.href},startListen:function(l){function e(e){var t,n=e&&se(e.reason);n&&(t=[{type:(null==(t=e.reason)?void 0:t.name)||"PromiseRejection",value:(null==(t=e.reason)?void 0:t.message)||String(n),mechanism_type:"unhandledrejection",mechanism_handled:0}],n=e.reason instanceof Error?Se(e.reason):[],e={event_id:A(),event_type:M.PROMISE_ERROR,event_category:I.ERROR,timestamp:Date.now(),page_url:u.getFromParam(l),data:{exception_stacks:t,exception_frames:n,replay_id:P(l),tags:{environment:l.config.env||"production"}}},null!=(t=l.reportTDEMEvent))&&t.call(l,e)}function t(e){if(e=(null==e?void 0:e.target)||(null==e?void 0:e.srcElement)){var t=e.src||e.href||"",n=e.tagName,n=(void 0===n?"script":n).toLowerCase(),r=["audio","video"].includes(n);if((!r||null!=e&&e.error)&&!(le(i=t,l.config.hostUrl)||-1<window.location.href.indexOf(i))){var i="other";if(/\.js$/.test(t)||"script"===n)i="script";else if(/\.css$/.test(t)||"link"===n)i="stylesheet";else if("img"===n)i="image";else{if(!r)return;i="media"}t={event_id:A(),event_type:M.RESOURCE_ERROR,event_category:I.ERROR,timestamp:Date.now(),page_url:u.getFromParam(l),data:{url:t,resource_type:i,replay_id:P(l),tags:x({environment:l.config.env||"production"},r&&null!=e&&e.error?{error_code:String(e.error.code),error_message:e.error.message||""}:{}),event_properties:{element_tag:n}}};null!=(i=l.reportTDEMEvent)&&i.call(l,t)}}}var n,r,i,u=this,c=window.onerror,o=(window.onerror=function(e,t,n,r,i){var o,s,a=se(e);"string"!=typeof(o=a)||!o||H.some(function(e){return-1<o.indexOf(e)})||W.some(function(e){return-1<o.indexOf(e)})||(a=[{type:(null==i?void 0:i.name)||"Error",value:String(e),mechanism_type:"onerror",mechanism_handled:0}],s=i?Se(i):[{abs_path:t||"",colno:r||0,filename:(null==t?void 0:t.split("/").pop())||"",function:"(anonymous)",lineno:n||0,in_app:1,stack_level:0}],a={event_id:A(),event_type:M.JS_ERROR,event_category:I.ERROR,timestamp:Date.now(),page_url:u.getFromParam(l),data:{exception_stacks:a,exception_frames:s,replay_id:P(l),tags:{environment:l.config.env||"production",version:String(l.config.version||"")}}},null!=(s=l.reportTDEMEvent)&&s.call(l,a)),null!=c&&c.call(window,e,t,n,r,i)},window.addEventListener("unhandledrejection",e),window.document.addEventListener("error",t,!0),l.lifeCycle.on("destroy",function(){0===In.countInstance()&&(window.removeEventListener("unhandledrejection",e),window.document.removeEventListener("error",t,!0))}),l.config.websocket);(("object"==typeof o?!1!==o.enabled:o)||l.config.websocketHack)&&(o={key:l.config.id+"-"+this.name,onErr:function(e){var t;null!=(t=u.publishWsErrorLog)&&t.call(u,e,l)},sendErr:function(e){var t;null!=(t=u.publishWsErrorLog)&&t.call(u,e,l)}},this.hackWebsocketConfig=o,o=this.hackWebsocketConfig,window.Proxy)&&window.WebSocket&&(n=window.WebSocket,window&&!n.isHack&&(r=new Proxy(WebSocket,Mn),n.isHack=!0,window.WebSocket=r),i=o,xn.find(function(e){return e.key===i.key})||i&&xn.push(i))},publishWsErrorLog:function(e,n){var t=e.connectUrl,r=e.msg,e=e.readyState,i={event_id:A(),event_type:M.JS_ERROR,event_category:I.ERROR,timestamp:Date.now(),page_url:this.getFromParam(n),data:{exception_stacks:[{type:"WebSocketError",value:"WEBSOCKET_ERROR: connect: "+t+" readyState: "+e+" msg: "+r,mechanism_type:"websocket",mechanism_handled:0}],exception_frames:[],replay_id:P(n),tags:{environment:n.config.env||"production",websocket_url:t||"",websocket_ready_state:String(null!=e?e:"")}}};this.$walk(function(e){var t;e===n&&null!=(t=e.reportTDEMEvent)&&t.call(e,i)})},destroy:function(){var t,e;this.option.hackWebsocketConfig&&(t=this.option.hackWebsocketConfig,window.WebSocket=On,-1!==(e=xn.findIndex(function(e){return e.key===t.key})))&&xn.splice(e,1)}}),Pn='a,button,input[type="button"],input[type="submit"],input[type="reset"],input[type="image"],[role="button"],[onclick],[ng-click],[v-on\\:click]',Dn=new WeakMap;function Ln(e){return e.closest(Pn)||e}function Nn(e,t){return null==(e=Dn.get(e))?void 0:e.get(t)}function Fn(e){return e instanceof Array?new Map(e.map(function(e){return[e,!0]})):new Map}function Un(e,t){return"string"==typeof e?e.split(t):[]}new e({name:"click"});var zn,Bn,jn,Wn,Hn,qn,Vn,Gn,Zn,Jn,Kn,$n=function(e){if(""!==e.id&&e.id)return'id("'+e.id+'")';if(e===document.body)return e.tagName;if(e instanceof Document)return"document";var t=0;if(e.parentNode)for(var n=e.parentNode.childNodes,r=0;r<n.length;r+=1){var i=n[r];if(i===e)return $n(e.parentNode)+"/"+e.tagName+"["+(t+1)+"]";1===i.nodeType&&i.tagName===e.tagName&&(t+=1)}return 0},Xn=function(e){if(3===e.nodeType||4===e.nodeType)return e.nodeValue||"";if(1!==e.nodeType)return"";if("string"==typeof e.textContent)return e.textContent;for(var t="",n=e.firstChild;n;n=n.nextSibling)t+=Xn(n);return t},Yn=new e({name:"click",listeners:[],onNewTdem:function(e){this.startListen(e)},startListen:function(a){for(var e=this,t=0,n=Object.entries({click:1,longpress:2});t<n.length;t++)(s=>{e.listeners.push(((e,t,n,r)=>{function i(e){var t=document.documentElement;t&&n.call(t,e,e.target)}return void 0===r&&(r=!0),e.addEventListener(t,i,r),{destroy:function(){e.removeEventListener(t,i,r)}}})(document,s,function(e,t){var n,r,i,o;t&&!((e,t)=>{e="object"==typeof e.click?e.click:void 0,n=Fn((null==e?void 0:e.ignoreClasses)||[])||new Map;for(var n,r=(e={ignoreIds:Fn((null==e?void 0:e.ignoreIds)||[])||new Map,ignoreClasses:n}).ignoreClasses,i=e.ignoreIds,o=!(0===i.size&&0===r.size),s=t,a=(Un(t.getAttribute("id")||""," "),Un(t.getAttribute("class")||"",""),0),l=!1;s&&o&&s.getAttribute;){if(l)return 1;if(10<=a)break;for(var u=Un(s.getAttribute("id")||""," "),c=Un(s.getAttribute("class")||"",""),d=0,f=u;d<f.length;d++){var h=f[d];if(i.has(h)){l=!0;break}}for(var p=0,m=c;p<m.length;p++){var v=m[p];if(r.has(v)){l=!0;break}}a+=1,s=s.parentNode||s.parentElement}})(a.config,t)&&(n=$n(t),r=(r=(e=>{var t="",n=e.nodeType;if(1===n||9===n||11===n){if("string"==typeof e.textContent)return e.textContent;for(var r=e.firstChild;r;r=r.nextSibling)t+=Xn(e)}else if(3===n||4===n)return e.nodeValue;return t})(t))?r.replace(/^\s+|\s+$/g,""):"",i=t.getBoundingClientRect&&t.getBoundingClientRect(),n={event_id:A(),event_type:M.CLICK,event_category:I.BEHAVIOR,timestamp:Date.now(),page_url:a._customPageUrl||window.location.href,data:{target_element:String(n),target_text:r.slice(0,127),click_position:i?{x:parseInt(String(i.left+window.scrollX),10)||0,y:parseInt(String(i.top+window.scrollY),10)||0}:void 0,replay_id:P(a),tags:{environment:a.config.env||"production",event_op:s,node_name:(null==t?void 0:t.nodeName)||""},event_properties:{target_id:t.id||"",target_class:"string"==typeof t.className?t.className.slice(0,128):""}}},r=e,i=a,t=n,(o=Dn.get(r)||new Map).set(i,t),Dn.set(r,o),a.lifeCycle.emit("clickCaptured",{event:e,source:n}),null!=(i=a.reportTDEMEvent))&&i.call(a,n)},!0))})(n[t][0])},destroy:function(){var e=this.option||this;e.listeners.forEach(function(e){return e.destroy()}),e.listeners=[]}}),Qn=(new e({name:"console"}),["log","error","warn","info","debug","trace"]),er={log:console.log,error:console.error,warn:console.warn,info:console.info,debug:console.debug,trace:console.trace||console.log},tr=new e({name:"console",onNewTdem:function(e){this.startListen(e)},startListen:function(e){var f,h;h="object"==typeof(f=e).config.console?f.config.console:void 0,Qn.forEach(function(c){var d=er[c];console[c]=function(){for(var e,t,n,r,i,o,s,a,l=[],u=0;u<arguments.length;u++)l[u]=arguments[u];try{d.apply(console,l),o=c,s=f.isWhiteList,("all"===(a=(null==(a=h)?void 0:a.level)||"error")||s||("error"===a?"error"===o:"warn"===a?"error"===o||"warn"===o:"info"===a?["error","warn","info"].includes(o):"log"===a?["error","warn","info","log"].includes(o):"error"===o))&&(r=l.map(function(e){if("object"==typeof e&&null!==e)try{return JSON.stringify(e)}catch(e){}return String(e)}).join(" "),i={event_id:A(),event_type:M.LOG,event_category:I.LOG,timestamp:Date.now(),page_url:(null==(e=f.getOriginFrom)?void 0:e.call(f))||("undefined"!=typeof window?null==(t=window.location)?void 0:t.href:""),data:{log_level:"error"===c?"error":"warn"===c?"warn":"info",replay_id:P(f),tags:{console_method:c},event_properties:{message:("console."+c+": "+r).slice(0,2048)}}},null!=(n=f.reportTDEMEvent)&&n.call(f,i))}catch(e){er.error("Console hook error:",e)}}})},destroy:function(){Object.keys(er).forEach(function(e){console[e]=er[e]})}});function nr(){Wn=[],Bn=-1,zn=null,Jn(addEventListener)}function rr(e,t){var n=Er(),r="navigate";return 0<=_r?r="back-forward-cache":n&&(document.prerendering||0<Cr()?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v3-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}}function ir(e,t,n){try{var r;if(PerformanceObserver.supportedEntryTypes.includes(e))return(r=new PerformanceObserver(function(e){Promise.resolve().then(function(){t(e.getEntries())})})).observe(Object.assign({type:e,buffered:!0},n||{})),r}catch(e){}}function or(t,n,r,i){var o,s;return function(e){0<=n.value&&(e||i)&&((s=n.value-(o||0))||void 0===o)&&(o=n.value,n.delta=s,n.rating=(e=n.value)>r[1]?"poor":e>r[0]?"needs-improvement":"good",t(n))}}function sr(e){requestAnimationFrame(function(){return requestAnimationFrame(function(){return e()})})}function ar(t){function e(e){"pagehide"!==e.type&&"hidden"!==document.visibilityState||t(e)}addEventListener("visibilitychange",e,!0),addEventListener("pagehide",e,!0)}function lr(t){var n=!1;return function(e){n||(t(e),n=!0)}}function ur(){return Rr<0&&(Rr=Tr(),xr(),Sr(function(){setTimeout(function(){Rr=Tr(),xr()},0)})),{get firstHiddenTime(){return Rr}}}function cr(e){document.prerendering?addEventListener("prerenderingchange",function(){return e()},!0):e()}function dr(o,s){s=s||{},cr(function(){var t,n=ur(),r=rr("FCP"),i=ir("paint",function(e){e.forEach(function(e){"first-contentful-paint"===e.name&&(i.disconnect(),e.startTime<n.firstHiddenTime)&&(r.value=Math.max(e.startTime-Cr(),0),r.entries.push(e),t(!0))})});i&&(t=or(o,r,Ir,s.reportAllChanges),Sr(function(e){r=rr("FCP"),t=or(o,r,Ir,s.reportAllChanges),sr(function(){r.value=performance.now()-e.timeStamp,t(!0)})}))})}function fr(e){var t,n,r,i,o,s;e.cancelable&&(t=(1e12<e.timeStamp?new Date:performance.now())-e.timeStamp,"pointerdown"==e.type?(n=t,r=e,i=function(){Lr(n,r),s()},o=function(){s()},s=function(){removeEventListener("pointerup",i,Pr),removeEventListener("pointercancel",o,Pr)},addEventListener("pointerup",i,Pr),addEventListener("pointercancel",o,Pr)):Lr(t,e))}function hr(e){e.forEach(function(e){e.interactionId&&(Br=Math.min(Br,e.interactionId),jr=Math.max(jr,e.interactionId),zr=jr?(jr-Br)/7+1:0)})}function pr(){return Wr()-qr}function mr(e){var t=Vr[Vr.length-1],n=Gr[e.interactionId];(n||Vr.length<10||e.duration>t.latency)&&(n?(n.entries.push(e),n.latency=Math.max(n.latency,e.duration)):(t={id:e.interactionId,latency:e.duration,entries:[e]},Gr[t.id]=t,Vr.push(t)),Vr.sort(function(e,t){return t.latency-e.latency}),Vr.splice(10).forEach(function(e){delete Gr[e.id]}))}function vr(e,t){function n(t,n,r,i){function o(e){"visibilitychange"===t&&"hidden"!==document.visibilityState||(i?setTimeout(function(){return n(e)},i):n(e),r&&removeEventListener(t,o,!0))}addEventListener(t,o,!0)}var r;n("visibilitychange",e,null==t?void 0:t.once,null==(r=null==t?void 0:t.delay)?void 0:r.visibilitychange),n("pagehide",e,null==t?void 0:t.once,null==(r=null==t?void 0:t.delay)?void 0:r.pagehide),n("beforeunload",e,null==t?void 0:t.once,null==(r=null==t?void 0:t.delay)?void 0:r.beforeunload)}Hn={passive:!0,capture:!0},qn=new Date,Vn=function(e,t){zn||(zn=t,Bn=e,jn=new Date,Jn(removeEventListener),Gn())},Gn=function(){var t;0<=Bn&&Bn<jn-qn&&(t={entryType:"first-input",name:zn.type,target:zn.target,cancelable:zn.cancelable,startTime:zn.timeStamp,processingStart:zn.timeStamp+Bn},Wn.forEach(function(e){e(t)}),Wn=[])},Zn=function(e){var t,n,r,i,o,s;e.cancelable&&(t=(1e12<e.timeStamp?new Date:performance.now())-e.timeStamp,"pointerdown"==e.type?(n=t,r=e,i=function(){Vn(n,r),s()},o=function(){s()},s=function(){removeEventListener("pointerup",i,Hn),removeEventListener("pointercancel",o,Hn)},addEventListener("pointerup",i,Hn),addEventListener("pointercancel",o,Hn)):Vn(t,e))},Jn=function(t){["mousedown","keydown","touchstart","pointerdown"].forEach(function(e){return t(e,Zn,Hn)})},Kn="hidden"===document.visibilityState?0:1/0,addEventListener("visibilitychange",function e(t){"hidden"===document.visibilityState&&(Kn=t.timeStamp,removeEventListener("visibilitychange",e,!0))},!0),nr(),self.webVitals={firstInputPolyfill:function(e){Wn.push(e),Gn()},resetFirstInputPolyfill:nr,get firstHiddenTime(){return Kn}};var gr,yr,wr,br,kr,_r=-1,Sr=function(t){addEventListener("pageshow",function(e){e.persisted&&(_r=e.timeStamp,t(e))},!0)},Er=function(){return window.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},Cr=function(){var e=Er();return e&&e.activationStart||0},Rr=-1,Tr=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},Or=function(e){"hidden"===document.visibilityState&&-1<Rr&&(Rr="visibilitychange"===e.type?e.timeStamp:0,Mr())},xr=function(){addEventListener("visibilitychange",Or,!0),addEventListener("prerenderingchange",Or,!0)},Mr=function(){removeEventListener("visibilitychange",Or,!0),removeEventListener("prerenderingchange",Or,!0)},Ir=[1800,3e3],Ar=[.1,.25],Pr={passive:!0,capture:!0},Dr=new Date,Lr=function(e,t){gr||(gr=t,yr=e,wr=new Date,Fr(removeEventListener),Nr())},Nr=function(){var t;0<=yr&&yr<wr-Dr&&(t={entryType:"first-input",name:gr.type,target:gr.target,cancelable:gr.cancelable,startTime:gr.timeStamp,processingStart:gr.timeStamp+yr},br.forEach(function(e){e(t)}),br=[])},Fr=function(t){["mousedown","keydown","touchstart","pointerdown"].forEach(function(e){return t(e,fr,Pr)})},Ur=[100,300],zr=0,Br=1/0,jr=0,Wr=function(){return kr?zr:performance.interactionCount||0},Hr=[200,500],qr=0,Vr=[],Gr={},Zr=[2500,4e3],Jr={},Kr=($r.prototype.start=function(){var t=this,n=new PerformanceObserver(function(e){e=e.getEntriesByName("first-contentful-paint");0<e.length&&(t.fcp=e[0].startTime,t.slientWindowStartTime=t.fcp,n.disconnect(),setTimeout(function(){t.checkTTI()},Math.max(t.slienceTimeInterval-(performance.now()-t.fcp)+20,1)))});n.observe({entryTypes:["paint"]}),this.longtaskObserver=new PerformanceObserver(function(e){e=e.getEntries();t.longTaskEntries=t.longTaskEntries.concat(e)}),this.longtaskObserver.observe({entryTypes:["longtask"]}),this.resourceObserver=new PerformanceObserver(function(e){e=e.getEntries();t.resourceEntries=t.resourceEntries.concat(e)}),this.resourceObserver.observe({entryTypes:["resource"]})},$r.prototype.checkTTI=function(){var e=this;this.hasSlientWindow()?(this.calculateTTI(),this.longtaskObserver.disconnect(),this.resourceObserver.disconnect()):setTimeout(function(){e.checkTTI()},this.checkInterval)},$r.prototype.hasSlientWindow=function(){var e,t=performance.now();return!(t-this.slientWindowStartTime<5e3||((e=this.getLastLongTaskEndTime())>this.slientWindowStartTime?(this.slientWindowStartTime=e,this.resourceEntries=[]):this.getRequestCount(this.slientWindowStartTime,t)<=2?(this.lastLongtaskEndTime=e,0):(t=this.resourceEntries.sort(function(e,t){return e.startTime-t.startTime}),this.slientWindowStartTime=t[this.resourceEntries.length-2].startTime,1)))},$r.prototype.getLastLongTaskEndTime=function(){var t;return 0===this.longTaskEntries.length?-1:(t=0,this.longTaskEntries.forEach(function(e){e.startTime+e.duration>t&&(t=e.startTime+e.duration)}),t)},$r.prototype.getRequestCount=function(t,n){var r=0;return this.resourceEntries.forEach(function(e){e.startTime>=t&&e.startTime+e.duration<=n&&(r+=1)}),r},$r.prototype.calculateTTI=function(){var e=-1===this.lastLongtaskEndTime?this.slientWindowStartTime:this.lastLongtaskEndTime,t=performance.timing.domContentLoadedEventEnd-performance.timing.navigationStart,e=Math.max(t,e);this.onTTICallback(e)},$r);function $r(e){this.slienceTimeInterval=5e3,this.checkInterval=100,this.fcp=0,this.longTaskEntries=[],this.resourceEntries=[],this.slientWindowStartTime=performance.now(),this.onTTICallback=e}function Xr(e){var t=e.name;0<(e=e.value)&&(ei[t]=e)}function Yr(e,t,n,r){return void 0===n&&(n=15e3),void 0===r&&(r=0),(t=void 0===t?0:t)<=e&&e<=n?e:r}new e({name:"webVitals"});var Qr,ei={FCP:-1,LCP:-1,FID:-1,CLS:-1,INP:-1,TTI:-1,from:void 0},ti=new Map,ni=new e({name:"webVitals",onNewTdem:function(e){var t,n,r,o,s,a,l,u,c,d,f,i,h,p,m=this;if(pt()&&"function"==typeof window.PerformanceObserver&&"function"==typeof performance.getEntriesByName)try{"function"!=typeof(p=(i=void 0===i?"undefined"==typeof window?{}:window:i).PerformanceObserver)||p.__tdemStartTimeGuard||(h=p,Object.setPrototypeOf(v,h),v.prototype=h.prototype,v.__tdemStartTimeGuard=!0,i.PerformanceObserver=v),ti.set(e,{isWebVitalsReported:!1,hasFirstEntry:!1,custom:null}),dr(Xr),d=Xr,f={},cr(function(){function e(e){(e=e[e.length-1])&&e.startTime<r.firstHiddenTime&&(i.value=Math.max(e.startTime-Cr(),0),i.entries=[e],t())}var t,n,r=ur(),i=rr("LCP"),o=ir("largest-contentful-paint",e);o&&(t=or(d,i,Zr,f.reportAllChanges),n=lr(function(){Jr[i.id]||(e(o.takeRecords()),o.disconnect(),Jr[i.id]=!0,t(!0))}),["keydown","click"].forEach(function(e){addEventListener(e,function(){return setTimeout(n,0)},!0)}),ar(n),Sr(function(e){i=rr("LCP"),t=or(d,i,Zr,f.reportAllChanges),sr(function(){i.value=performance.now()-e.timeStamp,Jr[i.id]=!0,t(!0)})}))}),u=Xr,c={},cr(function(){function t(e){e.startTime<n.firstHiddenTime&&(r.value=e.processingStart-e.startTime,r.entries.push(e),o(!0))}function e(e){e.forEach(t)}var n=ur(),r=rr("FID"),i=ir("first-input",e),o=or(u,r,Ur,c.reportAllChanges);i&&ar(lr(function(){e(i.takeRecords()),i.disconnect()})),i&&Sr(function(){r=rr("FID"),o=or(u,r,Ur,c.reportAllChanges),br=[],yr=-1,gr=null,Fr(addEventListener),br.push(t),Nr()})}),a=Xr,l={},dr(lr(function(){function e(e){e.forEach(function(e){var t,n;e.hadRecentInput||(t=i[0],n=i[i.length-1],r&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(r+=e.value,i.push(e)):(r=e.value,i=[e]))}),r>n.value&&(n.value=r,n.entries=i,t())}var t,n=rr("CLS",0),r=0,i=[],o=ir("layout-shift",e);o&&(t=or(a,n,Ar,l.reportAllChanges),ar(function(){e(o.takeRecords()),t(!0)}),Sr(function(){n=rr("CLS",r=0),t=or(a,n,Ar,l.reportAllChanges),sr(function(){return t()})}),setTimeout(t,0))})),o=Xr,s={},cr(function(){var e;"interactionCount"in performance||(kr=kr||ir("event",hr,{type:"event",buffered:!0,durationThreshold:0}));function t(e){e.forEach(function(t){t.interactionId&&mr(t),"first-input"!==t.entryType||Vr.some(function(e){return e.entries.some(function(e){return t.duration===e.duration&&t.startTime===e.startTime})})||mr(t)}),e=Math.min(Vr.length-1,Math.floor(pr()/50)),(e=Vr[e])&&e.latency!==n.value&&(n.value=e.latency,n.entries=e.entries,i())}var n=rr("INP"),r=ir("event",t,{durationThreshold:null!=(e=s.durationThreshold)?e:40}),i=or(o,n,Hr,s.reportAllChanges);r&&("PerformanceEventTiming"in window&&"interactionId"in PerformanceEventTiming.prototype&&r.observe({type:"first-input",buffered:!0}),ar(function(){t(r.takeRecords()),n.value<0&&0<pr()&&(n.value=0,n.entries=[]),i(!0)}),Sr(function(){Vr=[],qr=Wr(),n=rr("INP"),i=or(o,n,Hr,s.reportAllChanges)}))}),r=function(e){Xr({name:"TTI",value:e})},pt()&&new Kr(r).start(),vr(function(){m.tryReport(e,null,"onHidden")},{once:!0,delay:{visibilitychange:10}}),ei.from=(null==(n=null==(t=e)?void 0:t.getOriginFrom)?void 0:n.call(t))||window.location.href}catch(e){}function v(n){return new h(function(e,t){try{n(e,t)}catch(e){if(!(0<=(e instanceof Error?e.message:String(e||"")).indexOf("startTime")))throw e}})}},tryReport:function(t,n,r){var i=this;void 0===r&&(r="manual"),this.$walk(function(e){e===t&&("object"==typeof(e=i.$getConfig(t))&&!0===e.manualReport||"onHidden"!==r?(e=ti.get(t))&&!e.hasFirstEntry?(e.hasFirstEntry=!0,"manual"===r&&n&&(e.custom=n)):i.doReport(t,(null==e?void 0:e.custom)||n):i.doReport(t,null))})},doReport:function(o,s){var e=ti.get(o);if(e){if(null!=e&&e.isWebVitalsReported)return;e.isWebVitalsReported=!0}this.$walk(function(e){var t,n,r,i;e===o&&(t=x({},ei),s&&Object.keys(s).forEach(function(e){null!=s[e]&&(t[e]=s[e])}),n={environment:e.config.env||"production",version:String(e.config.version||"")},r={},0<t.LCP&&(r.lcp=t.LCP),0<t.FCP&&(r.fcp=t.FCP),0<t.FID&&(r.fid=t.FID),0<=t.CLS&&(r.cls=t.CLS),0<t.TTFB&&(r.ttfb=t.TTFB),0<t.TTI&&(r.tti=t.TTI),0<t.INP&&(r.inp=t.INP),i={event_id:A(),event_type:M.true,event_category:I.PERFORMANCE,timestamp:Date.now(),page_url:t.from||(null==(i=e.getOriginFrom)?void 0:i.call(e))||window.location.href,data:{measurements:r,replay_id:P(e),tags:n}},null!=(r=e.reportTDEMEvent))&&r.call(e,i)})},publish:function(e,t){this.tryReport(e,t,"manual")},destroy:function(){this.option.publish=function(){}}}),ri=(new e({name:"pagePerformance"}),3),ii=new Map,oi=new e({name:"pagePerformance",performanceMap:{},onNewTdem:function(t){var e;pt()&&(ii.set(t,{isPagePerformanceReported:!1}),Qr?this.publish(Qr,t):this.startCalcPerformance(t),e=this.publishWhenObHidden.bind(this,t),vr(e,{once:!0}),t.lifeCycle.on("destroy",function(){var e=ii.get(t);e&&(e.isPagePerformanceReported=!1)}))},publishWhenObHidden:function(e){var t,n=ii.get(e);if(null==n||!n.isPagePerformanceReported){n=0;if(null!=(t=e.firstScreenInfo)&&t.timing)n=e.firstScreenInfo.timing;else if(mt("paint"))try{var r,i=performance.getEntriesByName("first-contentful-paint");i&&0<i.length&&(r=i[0])&&0<r.startTime&&(n=r.startTime)}catch(e){}(Qr=this.buildPerformanceLog(e,n,this.getPageUrl(e),window.location.href))&&this.publish(Qr,e,!0)}},buildPerformanceLog:function(e,t,n,r){var i=performance.timing;if(i)return n={from:n,originFrom:r,dnsLookup:Yr(i.domainLookupEnd-i.domainLookupStart),tcp:Yr(i.connectEnd-i.connectStart),ssl:Yr(0===i.secureConnectionStart?0:i.requestStart-i.secureConnectionStart),ttfb:Yr(i.responseStart-i.requestStart),contentDownload:Yr(i.responseEnd-i.responseStart),domParse:Yr(i.domInteractive-i.domLoading,0,15e3,1070),resourceDownload:Yr(i.loadEventStart-i.domInteractive,0,15e3,1070),firstScreenTiming:Yr(Math.floor(t),0,15e3,15e3)},(r=e.config).extraPerformanceData&&"{}"!==JSON.stringify(r.extraPerformanceData)&&(t=(i=r.extraPerformanceData).engineInit,e=i.bundleLoad,n=x(x({},n),{engineInit:Yr(t,0,1e4),bundleLoad:Yr(e,0,1e4)})),n},publish:function(r,i){this.$walk(function(e){var t,n;e===i&&(n=(t=performance.timing).navigationStart,t={event_id:A(),event_type:M.PAGE_LOAD,event_category:I.PERFORMANCE,timestamp:Date.now(),page_url:r.originFrom||window.location.href,data:{measurements:{lcp:ei.lcp,fcp:ei.fcp,fid:ei.fid,cls:ei.cls,ttfb:ei.ttfb||r.ttfb,dns_time:r.dnsLookup,tcp_time:r.tcp,ssl_time:r.ssl,request_time:r.ttfb,response_time:r.contentDownload,dom_parse_time:r.domParse,dom_ready:t.domContentLoadedEventEnd-n,load_complete:t.loadEventEnd-n,first_screen_time:r.firstScreenTiming},replay_id:P(e),tags:{environment:e.config.env||"production",version:String(e.config.version||"")}}},null!=(n=e.reportTDEMEvent)&&n.call(e,t),n=ii.get(e))&&(n.isPagePerformanceReported=!0)})},getPageUrl:function(e){var t=this.$getConfig(e);if(null!=t&&t.urlHandler&&"function"==typeof(null==t?void 0:t.urlHandler)){t=null==t?void 0:t.urlHandler();if(t)return encodeURIComponent(t)}return e.getCurrentPageUrl()},startCalcPerformance:function(t){var n=this;try{var r=this.getPageUrl(t),i=t.getOriginFrom();this.getFirstScreenTiming(t,function(e){Qr=n.buildPerformanceLog(t,e,r,i);e=ii.get(t);!Qr||null!=e&&e.isPagePerformanceReported||n.publish(Qr,t)})}catch(t){}},getFirstScreenTiming:function(a,l){var u=this;a.lifeCycle.on("destroy",function(){v&&clearTimeout(v)});var c,d=this,n=["script","style","link","br"],f=[],h={},p=(mt("paint")&&(c=new PerformanceObserver(function(e){e.getEntries().forEach(function(e){var t;"paint"===e.entryType&&"first-contentful-paint"===e.name&&0<(t=document.querySelectorAll("[TDEM-FIRST-SCREEN-TIMING],[AEGIS-FIRST-SCREEN-TIMING]")).length&&a.config.id&&!u.performanceMap[a.config.id]&&(u.setFirstScreenInfo(a,e.startTime,t[0],t),null!=l&&l(e.startTime),p.disconnect(),c.disconnect(),v)&&clearTimeout(v)})})).observe({entryTypes:["paint"]}),new MutationObserver(function(e){var t={roots:[],ignores:[],rootsDomNum:[],time:performance.now()};e.forEach(function(e){e&&e.addedNodes&&Array.prototype.slice.call(e.addedNodes).forEach(function(e){d.isEleInArray(e,t.ignores)?t.ignores.push(e):1===e.nodeType&&(e.hasAttribute("TDEM-FIRST-SCREEN-TIMING")||e.hasAttribute("AEGIS-FIRST-SCREEN-TIMING"))?(Object.prototype.hasOwnProperty.apply(h,[t.time])||(h[t.time]=[]),h[t.time].push(e)):1===e.nodeType&&(d.hasAncestorOrSelfWithAttribute(e,"TDEM-IGNORE-FIRST-SCREEN-TIMING")?t.ignores.push(e):-1!==n.indexOf(e.nodeName.toLocaleLowerCase())||d.isEleInArray(e,t.roots)||(t.roots.push(e),t.rootsDomNum.push(d.walkAndCount(e)||0)))})}),t.roots.length&&f.push(t)})),m=(p.observe(document,{childList:!0,subtree:!0}),function(n){(n=void 0===n?0:n)||(r=0,(e=Object.keys(h)).length?(n=Math.max.apply(null,e),u.setFirstScreenInfo(a,n,null==(e=h[n])?void 0:e[0],h)):f.forEach(function(e){for(var t=0;t<e.roots.length;t++)e.rootsDomNum[t]>r&&d.isInFirstScreen(e.roots[t])&&(r=e.rootsDomNum[t],n=e.time,u.setFirstScreenInfo(a,n,e.roots[t]))}),f.length=0,Object.keys(h).forEach(function(e){h[e]=h[e].map(function(e){var t={tagName:e.tagName},n=e.attributes;if(!n)return e;for(var r=0;r<n.length;r++){var i=n[r];i.name&&(t[i.name]=e.getAttribute(i.name))}return t})}));var r,e=performance.timing,t=e.domInteractive-e.domLoading,i=n;v=null;for(var o=0,s=[t,e.loadEventStart-e.domInteractive,i];o<s.length;o++)if(s[o]<=0&&0<ri){v=setTimeout(function(){return m(i)},3e3);break}v?--ri:(p.disconnect(),null!=c&&c.disconnect(),null!=l&&l(n))}),v=setTimeout(function(){return m()},3e3)},setFirstScreenInfo:function(e,t,n,r){var i;e.config.id&&this.performanceMap[e.config.id]||(e.config.id&&(this.performanceMap[e.config.id]=!0),("object"!=typeof(null==(i=e.config)?void 0:i.pagePerformance)||null!=(i=e.config.pagePerformance)&&i.firstScreenInfo)&&(e.firstScreenInfo={element:n,timing:t,markDoms:r}))},isEleInArray:function(e,t){return!(!e||e===document.documentElement)&&(-1!==t.indexOf(e)||this.isEleInArray(e.parentElement,t))},isInFirstScreen:function(e){var t;return!(!e||"function"!=typeof e.getBoundingClientRect)&&(e=e.getBoundingClientRect(),t=window.innerHeight,0<=e.left)&&e.left<window.innerWidth&&0<=e.top&&e.top<t&&0<e.width&&0<e.height},walkAndCount:function(e){var t=0;if(e&&1===e.nodeType){t+=1;var n=e.children;if(null!=n&&n.length)for(var r=0;r<n.length;r++)1===n[r].nodeType&&(n[r].hasAttribute("TDEM-IGNORE-FIRST-SCREEN-TIMING")||n[r].hasAttribute("AEGIS-IGNORE-FIRST-SCREEN-TIMING"))||(t+=this.walkAndCount(n[r]))}return t},hasAncestorOrSelfWithAttribute:function(e,t){for(var n=t.replace(/^TDEM-/,"AEGIS-"),r=e;r&&r!==document.body;){if(r.hasAttribute(t)||n!==t&&r.hasAttribute(n))return!0;r=r.parentElement}return!1}}),si=(new e({name:"spa"}),["replaceState","pushState","popstate","hashchange"]),ai=new e({name:"spa",visitStates:new WeakMap,navigationStack:[],navigationIndex:-1,onNewTdem:function(n){var r=this,e=(history.pushState=this.wr("pushState")||history.pushState,history.replaceState=this.wr("replaceState")||history.replaceState,this.sendPv=this.sendPv.bind(this),location.href);this.navigationStack.length||(this.navigationStack=[e],this.navigationIndex=0),n.config.spa&&this.sendPv(n,"reload"),si.forEach(function(e){var t=e;window.addEventListener(e,function(){return r.sendPv.call(r,n,t)})})},wr:function(n){var r=history[n],e="__"+n+"__hasWrittenByTamSpa";return"function"==typeof r&&!history[e]&&(Object.defineProperty(history,e,{value:!0,enumerable:!1}),function(){var e=r.apply(this,arguments),t=null;return"function"==typeof Event?t=new Event(n):(t=document.createEvent("HTMLEvents")).initEvent(n,!1,!0),window.dispatchEvent(t),e})},resolveNavigationType:function(e,t){var n;return"pushState"===e?(this.navigationIndex<this.navigationStack.length-1&&(this.navigationStack=this.navigationStack.slice(0,this.navigationIndex+1)),this.navigationStack.push(t),this.navigationIndex=this.navigationStack.length-1,"push"):"replaceState"===e?(this.navigationIndex<0?(this.navigationStack=[t],this.navigationIndex=0):this.navigationStack[this.navigationIndex]=t,"replace"):"hashchange"===e?"hashchange":"popstate"===e?0<=(e=this.navigationStack.lastIndexOf(t))?(n=e<this.navigationIndex?"back":"forward",this.navigationIndex=e,n):(this.navigationStack.push(t),this.navigationIndex=this.navigationStack.length-1,"forward"):"reload"},sendPv:function(s,e){var a=this,l=(void 0===e&&(e="reload"),s._customPageUrl),u=(s._customPageUrl=null,location.pathname+location.hash+s.config.id),c=s.getOriginFrom(),d=this.visitStates.get(s),f=this.resolveNavigationType(e,location.href);u&&(u!==(null==d?void 0:d.firedUrl)||l)&&this.$walk(function(n){var r,i,e,t,o;n===s&&("function"==typeof n.beginPageVisit?n.beginPageVisit(c,!!l):d&&(t=n,o=Be(),t.viewId=o,"function"==typeof t.extendBean)&&t.extendBean("viewId",o),r="string"==typeof(e=n.viewId||(null==(e=n.bean)?void 0:e.viewId)||"")?e:"",i=Date.now(),a.visitStates.set(s,{firedUrl:u,pageUrl:c}),setTimeout(function(){var e,t=x(x({event_id:A(),event_type:M.PAGE_VIEW,event_category:I.BEHAVIOR,timestamp:i,page_url:c},r?{view_id:r}:{}),{data:{page_title:document.title||"",referrer:document.referrer||void 0,is_effective_action:!0,replay_id:P(n),tags:{environment:n.config.env||"production",version:String(n.config.version||""),is_spa:"true"},event_properties:{navigation_type:f,from_page:(l||(null==d?void 0:d.pageUrl)||"").slice(0,512),to_page:(c||"").slice(0,512)}}});null!=(e=n.reportTDEMEvent)&&e.call(n,t)},0))})},destroy:function(){this.option.sendPv=function(){}}}),li="__MONITOR_SESSION_V1__";function ui(e,t){"undefined"!=typeof document&&(e=[e+"="+encodeURIComponent(t),"path=/","SameSite=Lax"],"undefined"!=typeof location&&"https:"===location.protocol&&e.push("Secure"),document.cookie=e.join("; "))}function ci(e,t,n){void 0===n&&(n=1);var r=Date.now();return{sessionId:e,createdAt:r,lastActivity:r,source:t,version:n}}function di(e,t){var n,r,i;return"undefined"==typeof window?ci(t(),e):(r="undefined"!=typeof document&&(r="_tdem_s".replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=document.cookie.match(new RegExp("(?:^|; )"+r+"=([^;]*)")))?decodeURIComponent(r[1]):null,n=window[li],r?(null==n?void 0:n.sessionId)===r?(n.lastActivity=Date.now(),n):(i=ci(r,(null==n?void 0:n.source)||e,(null==n?void 0:n.version)||1),window[li]=i):null!=n&&n.sessionId?(n.lastActivity=Date.now(),ui("_tdem_s",n.sessionId),n):(i=ci(t(),e),ui("_tdem_s",(window[li]=i).sessionId),i))}function fi(){var e="undefined"==typeof globalThis?{}:globalThis;return e[pi]||(e[pi]=Object.create(null))}function hi(e){return null==e?"":String(e)}var pi="__TDEM_ENTRY_REGISTRY__",mi=(vi.prototype.request=function(o,s){var a=this;return void 0===s&&(s={}),o.sendBeacon||o.handoff?Promise.resolve(this.handoff(o,s)):new Promise(function(n){var e,r,t,i=new XMLHttpRequest;i.sendByTdem=!0,i.addEventListener("readystatechange",function(){var e,t;4===i.readyState&&((e={ok:0<i.status&&i.status<400,status:i.status,statusText:i.statusText,body:i.response,request:o}).ok?(null!=(t=s.success)&&t.call(s,i.response),null!=(t=s.final)&&t.call(s,e),n(e)):(t=x(x({},e),{error:i.response}),null!=(e=s.fail)&&e.call(s,i.response),null!=(e=s.final)&&e.call(s,t),n(t)))}),"get"===(o.method||"GET").toLowerCase()?(i.open("get",(e=o.url,r=o.data,"string"!=typeof e?"":"object"==typeof r&&r?(t=Object.getOwnPropertyNames(r).map(function(e){var t=r[e];return e+"="+("string"==typeof t?encodeURIComponent(t):encodeURIComponent(JSON.stringify(t)))}).join("&"),e+(-1===e.indexOf("?")?"?":"&")+$(t)):e)),a.applyHeaders(i,o.headers),i.send()):(i.open("post",o.url),a.applyHeaders(i,o.headers),o.contentType&&i.setRequestHeader("Content-Type",o.contentType),t=void 0!==o.body?o.body:o.data,a.shouldSanitizeEvalKeyword(o,t)&&(t=$(t)),i.send(t))})},vi.prototype.shouldSanitizeEvalKeyword=function(e,t){return"string"==typeof t&&!("replay"===e.kind||(e=null!=(t=null==(t=e.headers)?void 0:t["Content-Encoding"])?t:null==(t=e.headers)?void 0:t["content-encoding"])&&/gzip/i.test(e))},vi.prototype.handoff=function(e,t){void 0===t&&(t={});var n,r="undefined"!=typeof navigator?navigator:void 0;return r&&"function"==typeof r.sendBeacon?(n=void 0!==e.body?e.body:e.data,n={ok:r=r.sendBeacon(e.url,n),request:e,handoffAccepted:r,error:r?void 0:new Error("navigator.sendBeacon rejected the payload")},r?null!=(r=t.success)&&r.call(t,{accepted:!0}):null!=(r=t.fail)&&r.call(t,n.error),null!=(r=t.final)&&r.call(t,n),n):(r={ok:!1,request:e,error:new Error("navigator.sendBeacon is unavailable")},null!=(n=t.fail)&&n.call(t,r.error),null!=(e=t.final)&&e.call(t,r),r)},vi.prototype.applyHeaders=function(t,n){n&&Object.keys(n).forEach(function(e){t.setRequestHeader(e,n[e])})},vi);function vi(){}function gi(e){try{var t="undefined"!=typeof window?window.location.href:"https://tdem.invalid/",n=new URL(e,t);return n.origin+n.pathname+n.hash}catch(t){return e.split("?")[0]}}var yi,wi=new Map,r=(T(y,yi=kt),y.prototype.beginPageVisit=function(e,t){void 0===t&&(t=!1);var n=gi(e);return!t&&n===this.viewPageIdentity||(this.viewId=Be(),this.extendBean("viewId",this.viewId),this.lifeCycle.emit("pageVisitChanged",{pageUrl:e,viewId:this.viewId})),this.viewPageIdentity=n,this.viewId},y.prototype.reportPageView=function(e,t){void 0===t&&(t={}),this.beginPageVisit(e||t.pageUrl||this.getOriginFrom(),!!t.navigationType),yi.prototype.reportPageView.call(this,e,t)},y.prototype.leavePage=function(){this._customPageUrl&&(this.beginPageVisit("undefined"!=typeof window?window.location.href:"",!0),yi.prototype.leavePage.call(this))},y.prototype._bootstrapInit=function(e){this.setConfig(e),this.config=O(this.config,e.hostUrl),this._prefetchConfigAndInit(e)},y.prototype._initImmediately=function(e){this.init(e),this._afterInit(e)},y.prototype._prefetchConfigAndInit=function(o){return D(this,void 0,void 0,function(){var t,n,r,i;return L(this,function(e){switch(e.label){case 0:if(t=this.config.id,n=this._buildPrefetchConfigUrl(),r=null,!t||!n)return[3,4];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.transportRequest({kind:"config",url:n,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project_key:t})})];case 2:return(i=e.sent()).ok&&0===(i="string"==typeof i.body?JSON.parse(i.body):i.body).code&&i.data&&(r=i.data),[3,4];case 3:return e.sent(),(i=this._loadPrefetchDataFromCache(t))&&(r=i),[3,4];case 4:r&&(this._prefetchedConfigData=r);try{this._initAfterPreparedConfig(o)}catch(e){console.warn(e),console.log("%cThe above error occurred in the process of initializing TDEM, which will affect your normal use of TDEM.\nIt is recommended that you contact us for feedback and thank you for your support.","color: red"),this.sendSDKError(e)}return[2]}})})},y.prototype._buildPrefetchConfigUrl=function(){var e=(this.config.url||"").replace(/\/+$/,"");return e?e+"/api/v1/sample-config":""},y.prototype._loadPrefetchDataFromCache=function(e){var t;try{var n,r=localStorage.getItem("TDEM_SAMPLE_CONFIG");return r?!((n=JSON.parse(r)).projectKey!==e||6048e5<=Date.now()-n.timestamp)&&null!=(t=n.document)&&t.event?n.document:null:null}catch(e){return null}},y.prototype._initAfterPreparedConfig=function(e){for(var t=0;t<kt.installedPlugins.length;t++)try{kt.installedPlugins[t].patch(this)}catch(e){this.sendSDKError(e)}this.lifeCycle.emit("onInited"),this._afterInit(e)},y.prototype._afterInit=function(e){var t,o,n=this,r=(this._sdkInitialized=!0,this.config.id),i=y.entryName;(r=(r=hi(r))?fi()[r]:null)&&r.owner===i&&(r.state=1),this.extendBean("sessionId",y.sessionID),this.extendBean("from",this.getCurrentPageUrl()),"undefined"!=typeof document&&this.extendBean("referer",encodeURIComponent(document.referrer||"")),t=z(F("tdem-web-retry-report-requests"),[]),(o=function(){var i;t.length&&(i=t.splice(0,1)[0],U("tdem-web-retry-report-requests",JSON.stringify(t)),n.$request(i,function(){for(var e,t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];try{return null==(t=wi.get(null==(e=i.extraRetryOptions)?void 0:e.success))?void 0:t.apply(i,n)}finally{o()}},function(){for(var e,t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];try{return null==(t=wi.get(null==(e=i.extraRetryOptions)?void 0:e.fail))?void 0:t.apply(i,n)}finally{o()}}))})()},y.prototype.getBean=function(t){var n=this;return void 0===t&&(t=[]),""+Object.getOwnPropertyNames(this.bean).filter(function(e){return-1===t.indexOf(e)}).map(function(e){return"from"===e?"from="+n.getCurrentPageUrl():e+"="+n.bean[e]}).join("&")},y.prototype.getCurrentPageUrl=function(){var e;return this._customPageUrl?encodeURIComponent(this._customPageUrl.slice(0,2048)):(e=this.config.pageUrl||location.href,e=(e="function"==typeof this.config.urlHandler?this.config.urlHandler()||location.href:e).slice(0,2048),encodeURIComponent(e))},y.prototype.getOriginFrom=function(){if(this._customPageUrl)return this._customPageUrl.slice(0,2048);try{return("undefined"!=typeof window&&window.location?window.location.href:"").slice(0,2048)}catch(e){return""}},y.prototype.ready=function(){function o(){var e,n,r,i;t.reportRequestQueue.length&&(e=t.reportRequestQueue.splice(0,1)[0],n=e.options,r=e.success,i=e.fail,t.$request(n,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return null==r?void 0:r.apply(n,e)}finally{o()}},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return null==i?void 0:i.apply(n,e)}finally{o()}}))}var t=this;o(),this.isReportReady=!0},y.prototype.request=function(l,n,u){var c,d,f=this;this.config.reportImmediately||this.isReportReady?this.$request(l,c=function(e){var t=z(F("tdem-web-retry-report-requests"),[]);null!=t&&t.length&&l.extraRetryOptions&&(t.splice(t.findIndex(function(e){return e.extraRetryOptions.requestId===l.extraRetryOptions.requestId}),1),U("tdem-web-retry-report-requests",JSON.stringify(t)),wi.delete(l.extraRetryOptions.success),wi.delete(l.extraRetryOptions.fail)),null!=n&&n(e)},d=function(e){if(!f.config.reportRetry)return null==u?void 0:u(e);var t,n="boolean"==typeof f.config.reportRetry?ln:x(x({},ln),f.config.reportRetry),r=n.maxRetryCount,i=void 0===r?ln.maxRetryCount:r,r=n.retryInterval,r=void 0===r?ln.retryInterval:r,n=n.whenRetryEndStillFail,o=void 0===n?ln.whenRetryEndStillFail:n,s=(l.extraRetryOptions||(l.extraRetryOptions={requestId:"",retriedCount:0,success:"",fail:""}),l.extraRetryOptions),a=(s.requestId=s.requestId||l.url+"-"+Date.now()+"-"+Math.random(),s.requestId),n=(s.retriedCount=s.retriedCount||0,s.success=s.success||a+"_successCallback",s.fail=s.fail||a+"_failCallback",z(F("tdem-web-retry-report-requests"),[]));n.find(function(e){return e.extraRetryOptions.requestId===a})?(t=n.findIndex(function(e){return e.extraRetryOptions.requestId===a}),n[t]=l):n.push(l),U("tdem-web-retry-report-requests",JSON.stringify(n)),setTimeout(function(){if(s.retriedCount<i)l.extraRetryOptions.retriedCount+=1,f.$request(l,c,d);else{if("discard"===o){var e=z(F("tdem-web-retry-report-requests"),[]).filter(function(e){return(null==(e=e.extraRetryOptions)?void 0:e.requestId)!==a});if(e.length)U("tdem-web-retry-report-requests",JSON.stringify(e));else try{localStorage.removeItem("tdem-web-retry-report-requests")}catch(e){}}wi.delete(s.success),wi.delete(s.fail)}},"function"==typeof r?r(l.extraRetryOptions.retriedCount):r),null!=u&&u(e),wi.has(s.success)||wi.set(s.success,c),wi.has(s.fail)||wi.set(s.fail,d)}):this.reportRequestQueue.push({options:l,success:n,fail:u})},y.prototype.$request=function(a,e,t){var n,r;if(a&&"string"==typeof a.url&&""!==a.url&&this.bean.id)return n=a.url,!1!==a.addBean&&(n=((e,t)=>{var n,r,i,o=e,s=a.beanFilter||[];for(n in t)-1===s.indexOf(n)&&((i=(r=new RegExp("([?&])"+n+"(=([^&]*))?(?=&|$)")).exec(o))?i[2]&&""!==i[3]&&"undefined"!==i[3]||(o=o.replace(r,"$1"+n+"="+t[n])):(i=-1<o.indexOf("?")?"&":"?",o+=i+n+"="+t[n]));return o})(n,x(x({},this.bean),{from:this.getCurrentPageUrl()}))),a.url=n,n=a.method||"get",r=this.config.onBeforeRequest,(a=r?r(a,this):a)?a.url?(r={success:e,fail:t},void((e={kind:a.type===ue.WHITE_LIST?"config":"events",url:a.url,method:n.toUpperCase(),contentType:a.contentType,data:a.data,body:a.data,sendBeacon:!!(null!=a&&a.sendBeacon||this.sendNow),source:a}).sendBeacon?this.transportHandoff(e,r):this.transportRequest(e,r))):console.warn("Please handle the parameters reasonably, options.url is necessary"):console.warn("Sending request blocked")},y.prototype.publishPluginsLogs=function(){var e=y.installedPlugins.find(function(e){return"assets"===e.name});null!=e&&e.option.collectNotReportedLog(this)},y.prototype.uploadLogs=function(e,t){var n;void 0===e&&(e={}),void 0===t&&(t={}),null!=(n=this.lifeCycle)&&n.emit("uploadLogs",e,t)},y.prototype.reportWebVitals=function(e){try{var t=y.installedPlugins.find(function(e){return"webVitals"===e.name});t&&this.config.webVitals&&this.config.webVitals.manualReport&&t.option.publish(this,e)}catch(e){}},y.prototype.destroy=function(e){var t,n,r;void 0===e&&(e=!1),n=this.config.id,t=y.entryName,(r=(n=hi(n))?fi():null)&&r[n]&&r[n].owner===t&&delete r[n],yi.prototype.destroy.call(this,e)},y.entryName="tdem-web-sdk",y.sessionID=di("tdem",Be).sessionId,y);function y(e,t){var n,r,i,s,o,a,l,u,c,d,f,h,p=yi.call(this,e,t=void 0===t?{}:t)||this,m=(p._entrySkipped=!1,p.sendNow=!1,p.isReportReady=!1,p.reportRequestQueue=[],p._sdkInitialized=!1,p.viewId="",p.viewPageIdentity="",p.speedLogPipeline=dt([(u=[],c=(o=p).config,o.lifeCycle.on("destroy",function(){u.length=0}),function(e,t){Array.isArray(e)?u=u.concat(e):u.push(e),a&&u.length>=a||o.sendNow&&0<u.length?(u=Oe(u),0<(u=Array.isArray(u)?u:[]).length&&t(u.splice(0,u.length)),l&&clearTimeout(l)):(l&&clearTimeout(l),l=setTimeout(function(){l=null,u=Oe(u),0<(u=Array.isArray(u)?u:[]).length&&t(u.splice(0,u.length))},c.delay))}),(s=p.config,function(e,t){var n,r,i,o="number"==typeof s.repeat?s.repeat:60;!s.speedSample||o<=0?t(e):(n=(null==s?void 0:s.id)||"0",r=Me[n]||{},Array.isArray(e)?(i=e.filter(function(e){var t=!r[e.url]||r[e.url]<o;return t?(r[e.url]=1+~~r[e.url],Me[n]=r):xe[n]||Ne(n),t})).length&&t(i):!r[e.url]||r[e.url]<o?(r[e.url]=1+~~r[e.url],Me[n]=r,t(e)):xe[n]||Ne(n))}),(i=p,function(t,n){Tn(function(e){i.extendBean("netType",e),n(t)})}),function(e,t){null!=(n=p.lifeCycle)&&n.emit("beforeReportSpeed",e);var n,r=p.config.beforeReportSpeed;if((e="function"==typeof r?e.filter(function(e){return!1!==r(e)}):e).length)return t(e)},function(e,t){t(e.map(function(e){return void 0!==e.payload&&delete e.payload,e}))},function(e){return p.sendPipeline([function(e,t){t({type:ue.SPEED,url:""+p.config.speedUrl,method:"post",data:ae(e,x(x({},p.bean),{from:p.getCurrentPageUrl()})),log:e})}],ue.SPEED)(e)}]),t=e&&e.id,d=y.entryName,(t=hi(t))?(m=(f=fi())[t])&&m.owner!==d?{status:"skipped_duplicate",owner:m.owner}:(m||(f[t]={owner:d,state:0}),{status:"owned",owner:d}):{status:"owned",owner:d});if("skipped_duplicate"===m.status)p._entrySkipped=!0,-1!==(f=kt.instances.indexOf(p))&&kt.instances.splice(f,1),console.warn("[TDEM] skip "+y.entryName+": "+(e&&e.id)+" owned by "+m.owner);else{p.viewId=Be(),p.extendBean("viewId",p.viewId),p.viewPageIdentity=gi(p.getOriginFrom()),p.getInternalTransport()||p.setInternalTransport(new mi),e.asyncPlugin=!0;try{"undefined"!=typeof document&&(h=String(e.userId||e.uin||(null!=(n=document.cookie.match(/\buin=\D+(\d*)/))?n:[])[1]||(null!=(r=document.cookie.match(/\bilive_uin=\D*(\d+)/))?r:[])[1]||""),e.userId=h,e.uin=e.uin||h),p._bootstrapInit(e)}catch(e){console.warn(e),console.log("%cThe above error occurred in the process of initializing TDEM, which will affect your normal use of TDEM.\nIt is recommended that you contact us for feedback and thank you for your support.","color: red"),p.sendSDKError(e)}}return p}new e({name:"ie"}),new e({name:"onClose"});var bi=new e({name:"onClose",onNewTdem:function(e){function t(){return r.publishNotReportedLog(e)}function n(){"undefined"!=typeof document&&"hidden"!==document.visibilityState||t()}var r=this;document.addEventListener("visibilitychange",n,!0),window.addEventListener("pagehide",t,!0),e.lifeCycle.on("destroy",function(){document.removeEventListener("visibilitychange",n,!0),window.removeEventListener("pagehide",t,!0)})},publishNotReportedLog:function(n){var r=this;this.$walk(function(e){if(e===n){var t=e.sendNow;try{e.sendNow=!0,e.lifeCycle.emit("beforeCloseFlush"),e.publishPluginsLogs(),r.publishThrottlePipeLogs(e)}finally{e.sendNow=t}}})},publishThrottlePipeLogs:function(e){null!=e&&e.speedLogPipeline([]),null!=e&&e.tdemEventPipeline([])}});function ki(){return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,function(e){return(e^(16*Math.random()&15)>>e/4).toString(16)})}new e({name:"aid"}),Ci.generate=function(){return"rep_"+this.uuid32()},Ci.uuid32=function(){return"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx".replace(/x/g,function(){return Math.floor(16*Math.random()).toString(16)})};var _i=Ci,Si="[SessionReplay]",Ei=!1;function Ci(){}function u(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Ei&&console.log.apply(console,g([Si+"["+e+"]"],t))}function Ri(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Ei&&console.debug.apply(console,g([Si+"["+e+"]"],t))}function Ti(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Ei&&console.log.apply(console,g([Si+"["+e+"] WARN:"],t))}function Oi(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Ei&&console.log.apply(console,g([Si+"["+e+"] ERROR:"],t))}Pi.prototype.setTdemInstance=function(e){this.tdemInstance=e},Pi.prototype.createSession=function(e){void 0===e&&(e="session");var t=null==(t=this.session)?void 0:t.replayId,n=di("tdem",ki),n=x({id:n.sessionId,replayId:_i.generate(),started:Date.now(),lastActivity:Date.now(),segmentId:0,sampled:e},t?{previousReplayId:t}:{});return this.session=n,this.syncSharedSession(n.id),u("SessionManager","Document replay session created:",n.id,n.replayId),n},Pi.prototype.restoreSession=function(){return this.session},Pi.prototype.saveSession=function(){},Pi.prototype.refreshSession=function(){var e=null!=(e=null==(e=this.session)?void 0:e.sampled)?e:"session";return this.createSession(e)},Pi.prototype.updateActivity=function(){this.session&&(this.session.lastActivity=Date.now())},Pi.prototype.incrementSegmentId=function(){var e;return this.session?(e=this.session.segmentId,this.session.segmentId+=1,e):0},Pi.prototype.shouldRefreshSession=function(){return!1},Pi.prototype.getSession=function(){return this.session},Pi.prototype.getSessionId=function(){var e;return null!=(e=null==(e=this.session)?void 0:e.id)?e:""},Pi.prototype.getReplayId=function(){var e;return null!=(e=null==(e=this.session)?void 0:e.replayId)?e:""},Pi.prototype.clearSession=function(){var e;this.session=null;try{null!=(e=window.sessionStorage)&&e.removeItem("tdem_session")}catch(e){}},Pi.prototype.syncSharedSession=function(e){var t,n,r;this.tdemInstance&&this.tdemInstance.extendBean("sessionId",e),e=e,"undefined"!=typeof window&&(t=Date.now(),(n=window[li])?(r=n.sessionId!==e,n.sessionId=e,n.version=r?n.version+1:n.version,n.source="tdem",r&&(n.createdAt=t),n.lastActivity=t):window[li]=ci(e,"tdem"),ui("_tdem_s",e),window.dispatchEvent(new CustomEvent("monitor-session-update",{detail:{sessionId:e,source:"tdem"}})))};var xi=Pi,Mi=((i={})[i.DomContentLoaded=0]="DomContentLoaded",i[i.Load=1]="Load",i[i.FullSnapshot=2]="FullSnapshot",i[i.IncrementalSnapshot=3]="IncrementalSnapshot",i[i.Meta=4]="Meta",i[i.Custom=5]="Custom",i[i.Plugin=6]="Plugin",i[i.Asset=7]="Asset",i),Ii=(Ai.prototype.ensureReady=function(){return D(this,void 0,void 0,function(){return L(this,function(e){return[2,this.ready]})})},Ai.prototype.postMessage=function(n,r){var i=this,o=this.nextId++;return new Promise(function(e,t){i.pendingRequests.set(o,{resolve:e,reject:t}),i.worker.postMessage({id:o,method:n,arg:r})})},Ai.prototype.destroy=function(){this.pendingRequests.forEach(function(e){return(0,e.reject)(new Error("Worker destroyed"))}),this.pendingRequests.clear(),this.worker.terminate()},Ai);function Ai(e){var o=this;this.nextId=0,this.pendingRequests=new Map,this.worker=e,this.worker.addEventListener("message",function(e){var e=e.data,t=e.id,n=e.success,r=e.response;"init"!==e.method&&(e=o.pendingRequests.get(t))&&(o.pendingRequests.delete(t),n?e.resolve(r):e.reject(new Error(r||"Worker request failed")))}),this.ready=new Promise(function(t,n){var r=function(e){e=e.data;"init"===e.method&&e.success&&(o.worker.removeEventListener("message",r),clearTimeout(i),t())},i=(o.worker.addEventListener("message",r),o.worker.addEventListener("error",function(e){o.worker.removeEventListener("message",r),clearTimeout(i),n(new Error("Worker error: "+(e.message||"unknown")))}),setTimeout(function(){o.worker.removeEventListener("message",r),n(new Error("Worker init timeout (5s)"))},5e3))})}function Pi(e){this.session=null,this.tdemInstance=null}function Di(e){if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e).length;for(var t=0,n=0;n<e.length;n++){var r=e.charCodeAt(n);r<128?t+=1:r<2048?t+=2:55296<=r&&r<=56319&&n+1<e.length&&56320<=e.charCodeAt(n+1)&&e.charCodeAt(n+1)<=57343?(t+=4,n+=1):t+=3}return t}Ni.prototype.initWorker=function(){var t=this,e=(()=>{try{var e,t,n;return"undefined"==typeof Worker||"undefined"==typeof Blob||"undefined"==typeof URL?null:(e=new Blob(["\n(function() {\n var events = [];\n var totalSize = 0;\n\n function handleMessage(data) {\n var method = data.method;\n var id = data.id;\n\n switch (method) {\n case 'addEvent':\n events.push(data.arg);\n totalSize += data.arg.length;\n return { id: id, method: method, success: true, response: totalSize };\n\n case 'finish':\n var json = '[' + events.join(',') + ']';\n events = [];\n totalSize = 0;\n // 返回原始 JSON 字符串,压缩在主线程做(pako 不好内联到 worker)\n return { id: id, method: method, success: true, response: json };\n\n case 'clear':\n events = [];\n totalSize = 0;\n return { id: id, method: method, success: true, response: void 0 };\n\n default:\n return { id: id, method: method, success: false, response: 'Unknown method' };\n }\n }\n\n self.addEventListener('message', function(e) {\n try {\n var result = handleMessage(e.data);\n self.postMessage(result);\n } catch (err) {\n self.postMessage({\n id: e.data.id,\n method: e.data.method,\n success: false,\n response: err.message || 'Worker error'\n });\n }\n });\n\n // 就绪信号\n self.postMessage({ method: 'init', success: true });\n})();\n"],{type:"application/javascript"}),t=URL.createObjectURL(e),n=new Worker(t,{name:"tdem-replay-compressor"}),URL.revokeObjectURL(t),u("CompressionWorker","Worker created successfully"),new Ii(n))}catch(e){return Ti("CompressionWorker","Failed to create worker, will fallback to sync buffer:",e),null}})();e?(this.workerHandler=e,this.useWorker=!0,e.ensureReady().then(function(){t.workerReady=!0,u("EventBuffer","Worker ready, migrating buffered events"),t.migrateEventsToWorker()}).catch(function(e){Ti("EventBuffer","Worker init failed, falling back to sync buffer:",e),t.useWorker=!1,t.workerHandler=null})):u("EventBuffer","Worker not available, using sync buffer")},Ni.prototype.migrateEventsToWorker=function(){if(this.workerHandler&&this.workerReady)for(var e=0,t=this.events;e<t.length;e++){var n=t[e];this.addEventToWorker(n)}},Ni.prototype.addEventToWorker=function(e){if(this.workerHandler)try{var t=JSON.stringify(e);this.workerHandler.postMessage("addEvent",t),this.workerEventCount++,this.workerSize+=t.length}catch(e){Ti("EventBuffer","Failed to send event to worker:",e)}},Ni.prototype.addEvent=function(e){var t=this.estimateEventSize(e);this.currentSize+t>this.config.maxSize&&(Ti("EventBuffer","Size limit exceeded, removing old events"),this.trimOldEvents(t)),this.events.push(e),this.currentSize+=t,this.useWorker&&this.workerReady&&this.workerHandler&&(0<this.workerEventCount&&this.workerSize+t>this.config.maxSize&&(this.workerHandler.postMessage("clear"),this.workerEventCount=0,this.workerSize=0),this.addEventToWorker(e))},Ni.prototype.getEvents=function(){return g(this.events)},Ni.prototype.getEventCount=function(){return this.events.length},Ni.prototype.getSize=function(){return this.currentSize},Ni.prototype.isEmpty=function(){return 0===this.events.length},Ni.prototype.detachEvents=function(){var e=this.events;return this.events=[],this.currentSize=0,this.useWorker&&this.workerHandler&&(this.workerHandler.postMessage("clear"),this.workerEventCount=0,this.workerSize=0),e},Ni.prototype.hasBaselinePair=function(){for(var e=!1,t=!1,n=0;n<this.events.length;n++){var r=this.events[n].type;if(r===Mi.Meta?e=!0:r===Mi.FullSnapshot&&(t=!0),e&&t)return!0}return!1},Ni.prototype.finishAsync=function(){return D(this,void 0,void 0,function(){var t;return L(this,function(e){return[2,{events:t=this.getEvents(),eventCount:t.length,uncompressedSize:this.currentSize}]})})},Ni.prototype.finish=function(){var e=this.getEvents();return{events:e,eventCount:e.length,uncompressedSize:this.currentSize}},Ni.prototype.clear=function(){this.events=[],this.currentSize=0,this.useWorker&&this.workerHandler&&(this.workerHandler.postMessage("clear"),this.workerEventCount=0,this.workerSize=0)},Ni.prototype.destroy=function(){this.clear(),this.workerHandler&&(this.workerHandler.destroy(),this.workerHandler=null),this.useWorker=!1,this.workerReady=!1},Ni.prototype.estimateEventSize=function(e){try{return Di(JSON.stringify(e))+1}catch(e){return 1024}},Ni.prototype.trimOldEvents=function(e){for(var t=-1,n=this.events.length-1;0<=n;n--)if(this.events[n].type===Mi.FullSnapshot){t=n;break}var r=t;if(0<r)for(n=r-1;0<=n;n--)if(this.events[n].type===Mi.Meta){r=n;break}for(var i,o=0,s=Math.max(e,.2*this.config.maxSize),a=0;a<r&&o<s;)a++,(i=this.events.shift())&&(o+=this.estimateEventSize(i));if(r<0)for(;0<this.events.length&&o<s;)(i=this.events.shift())&&(o+=this.estimateEventSize(i));this.currentSize=Math.max(0,this.currentSize-o)},Ni.prototype.hasCheckout=function(){return this.events.some(function(e){return e.type===Mi.Meta||e.type===Mi.FullSnapshot})},Ni.prototype.getLastCheckoutTime=function(){for(var e=this.events.length-1;0<=e;e--){var t=this.events[e];if(t.type===Mi.FullSnapshot)return t.timestamp}return null},Ni.prototype.isUsingWorker=function(){return this.useWorker&&this.workerReady};var Li=Ni;function Ni(e,t){void 0===e&&(e={}),void 0===t&&(t=!1),this.events=[],this.currentSize=0,this.workerHandler=null,this.useWorker=!1,this.workerReady=!1,this.workerEventCount=0,this.workerSize=0,this.config={maxSize:null!=(e=e.maxSize)?e:5242880},t&&this.initWorker()}function Fi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ui(e,t,n,r,i,o,s){try{var a=e[o](s),l=a.value}catch(e){return n(e)}a.done?t(l):Promise.resolve(l).then(r,i)}function zi(a){return function(){var e=this,s=arguments;return new Promise(function(t,n){var r=a.apply(e,s);function i(e){Ui(r,t,n,i,o,"next",e)}function o(e){Ui(r,t,n,i,o,"throw",e)}i(void 0)})}}function Bi(e,t,n){t=Hi(t);var r=e,t=Vi()?Reflect.construct(t,n||[],Hi(e).constructor):t.apply(e,n);if(!t||"object"!=typeof t&&"function"!=typeof t){if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");if(void 0===(t=r))throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t}function b(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ji(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,eo(r.key),r)}}function k(e,t,n){return t&&ji(e.prototype,t),n&&ji(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ie(e,t){var n,r,i,o,s="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(s)return i=!(r=!0),{s:function(){s=s.call(e)},n:function(){var e=s.next();return r=e.done,e},e:function(e){i=!0,n=e},f:function(){try{r||null==s.return||s.return()}finally{if(i)throw n}}};if(Array.isArray(e)||(s=to(e))||t&&e&&"number"==typeof e.length)return s&&(e=s),o=0,{s:t=function(){},n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Wi(){return(Wi="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=((e,t)=>{for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Hi(e)););return e})(e,t);if(r)return(r=Object.getOwnPropertyDescriptor(r,t)).get?r.get.call(arguments.length<3?e:n):r.value}).apply(null,arguments)}function Hi(e){return(Hi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function qi(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Xi(e,t)}function Vi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Vi=function(){return!!e})()}function Gi(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function Ae(r){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Gi(Object(i),!0).forEach(function(e){var t,n;t=r,n=i[e=e],(e=eo(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):Gi(Object(i)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(i,e))})}return r}function Zi(e,t){if(null==e)return{};var n,r=((e,t)=>{if(null==e)return{};var n,r={};for(n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r})(e,t);if(Object.getOwnPropertySymbols)for(var i=Object.getOwnPropertySymbols(e),o=0;o<i.length;o++)n=i[o],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n]);return r}function Ji(){var p,e="function"==typeof Symbol?Symbol:{},t=e.iterator||"@@iterator",n=e.toStringTag||"@@toStringTag";function r(e,t,n,r){var i,o,s,a,l,u,c,d,f,t=t&&t.prototype instanceof v?t:v,t=Object.create(t.prototype);return Ki(t,"_invoke",(i=e,o=n,c=r||[],d=!1,f={p:u=0,n:0,v:p,a:h,f:h.bind(p,4),d:function(e,t){return s=e,a=0,l=p,f.n=t,m}},function(e,t,n){if(1<u)throw TypeError("Generator is already running");for(d&&1===t&&h(t,n),a=t,l=n;(g=a<2?p:l)||!d;){s||(a?(1<a&&(f.n=a<3?-1:l),h(a,l)):f.v=l);try{if(u=2,s){if(g=s[e=a?e:"next"]){if(!(g=g.call(s,l)))throw TypeError("iterator result is not an object");if(!g.done)return g;l=g.value,a<2&&(a=0)}else 1===a&&(g=s.return)&&g.call(s),a<2&&(l=TypeError("The iterator does not provide a '"+e+"' method"),a=1);s=p}else if((g=(d=f.n<0)?l:i.call(o,f))!==m)break}catch(e){s=p,a=1,l=e}finally{u=1}}return{value:g,done:d}}),!0),t;function h(e,t){for(a=e,l=t,g=0;!d&&u&&!n&&g<c.length;g++){var n,r=c[g],i=f.p,o=r[2];3<e?(n=o===t)&&(l=r[(a=r[4])?5:a=3],r[4]=r[5]=p):r[0]<=i&&((n=e<2&&i<r[1])?(a=0,f.v=t,f.n=r[1]):i<o&&(n=e<3||r[0]>t||o<t)&&(r[4]=e,r[5]=t,f.n=o,a=0))}if(n||1<e)return m;throw d=!0,t}}var m={};function v(){}function i(){}function o(){}var g=Object.getPrototypeOf,e=[][t]?g(g([][t]())):(Ki(g={},t,function(){return this}),g),s=o.prototype=v.prototype=Object.create(e);function a(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,o):(e.__proto__=o,Ki(e,n,"GeneratorFunction")),e.prototype=Object.create(s),e}return Ki(s,"constructor",i.prototype=o),Ki(o,"constructor",i),Ki(o,n,i.displayName="GeneratorFunction"),Ki(s),Ki(s,n,"Generator"),Ki(s,t,function(){return this}),Ki(s,"toString",function(){return"[object Generator]"}),(Ji=function(){return{w:r,m:a}})()}function Ki(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}(Ki=function(e,t,n,r){function i(t,n){Ki(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))})(e,t,n,r)}function $i(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}}}throw new TypeError(typeof e+" is not iterable")}function Xi(e,t){return(Xi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function Pe(e,t){return(e=>{if(Array.isArray(e))return e})(e)||((e,t)=>{var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,s,a=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return a}})(e,t)||to(e,t)||(()=>{throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function Yi(e,t,n,r){var i=Wi(Hi(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function Qi(e){return(e=>{if(Array.isArray(e))return Fi(e)})(e)||(()=>{if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)})()||to(e)||(()=>{throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function eo(e){e=(e=>{if("object"!=typeof e||!e)return e;if("undefined"==typeof Symbol||void 0===(t=e[Symbol.toPrimitive]))return String(e);var t=t.call(e,"string");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")})(e);return"symbol"==typeof e?e:e+""}function _(e){return(_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function to(e,t){var n;if(e)return"string"==typeof e?Fi(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Fi(e,t):void 0}function no(e){var n="function"==typeof Map?new Map:void 0;return(no=function(e){if(null===e||!(t=>{try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}})(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return function(e,t,n){var r;return Vi()?Reflect.construct.apply(null,arguments):((r=[null]).push.apply(r,t),t=new(e.bind.apply(e,r)),n&&Xi(t,n.prototype),t)}(e,arguments,Hi(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),Xi(t,e)})(e)}function c(e,t,n){e=e,t="symbol"!==_(t)?t+"":t,n=n,t in e?uo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}function ro(e,t,n){e=e,t="symbol"!==_(t)?t+"":t,n=n,t in e?co(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}var io=["inputs"],oo=["inputId"],so=["inputs"],ao=["inputId"],lo=["type"],uo=Object.defineProperty,co=Object.defineProperty,fo=((i=fo||{})[i.Document=0]="Document",i[i.DocumentType=1]="DocumentType",i[i.Element=2]="Element",i[i.Text=3]="Text",i[i.CDATA=4]="CDATA",i[i.Comment=5]="Comment",i),ho={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},po={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},mo={},vo={},go={};function yo(e,t,n){var r="".concat(e,".").concat(String(n));return go[r]?go[r].call(t):(e=(e=>{if(mo[e])return mo[e];var t=globalThis[e],n=t.prototype,r=e in ho?ho[e]:void 0,r=Boolean(r&&r.every(function(e){return Boolean(null==(e=null==(e=Object.getOwnPropertyDescriptor(n,e))?void 0:e.get)?void 0:e.toString().includes("[native code]"))})),i=e in po?po[e]:void 0,i=Boolean(i&&i.every(function(e){return"function"==typeof n[e]&&(null==(e=n[e])?void 0:e.toString().includes("[native code]"))}));if(r&&i&&!globalThis.Zone)return mo[e]=t.prototype,t.prototype;try{var o,s,a=document.createElement("iframe"),l=(a.style.display="none",document.body.appendChild(a),a.contentWindow);return l?(o=l[e].prototype)?((s=navigator.userAgent).includes("Safari")&&!s.includes("Chrome")?(a.classList.add("rr-block"),a.setAttribute("__rrwebUntaintedMutationObserver",""),vo[e]=function(){return a.remove()}):a.remove(),mo[e]=o):(a.remove(),n):t.prototype}catch(e){return n}})(e),(e=null==(e=Object.getOwnPropertyDescriptor(e,n))?void 0:e.get)?(go[r]=e).call(t):t[n])}Date.now,Date.now().toString();var wo=function(e){return yo("Node",e,"childNodes")},bo=function(e){return yo("Node",e,"parentNode")},ko=function(e){return yo("Node",e,"parentElement")},_o=function(e){return yo("Node",e,"textContent")},So=function(e){return e&&"shadowRoot"in e?yo("Element",e,"shadowRoot"):null};function Eo(e){return e.nodeType===e.ELEMENT_NODE}function Co(e){var t=e&&"host"in e&&"mode"in e&&((t=e)&&"host"in t?yo("ShadowRoot",t,"host"):null)||null;return Boolean(t&&"shadowRoot"in t&&So(t)===e)}function Ro(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function To(e){try{var t,n=e.rules||e.cssRules;return n?(!(t=e.href)&&e.ownerNode&&(t=e.ownerNode.baseURI),r=(r=Array.from(n,function(e){return Oo(e,t)}).join("")).includes(" background-clip: text;")&&!r.includes(" -webkit-background-clip: text;")?r.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;"):r):null}catch(e){return null}var r}function Oo(e,t){if("styleSheet"in e){var n;try{n=To(e.styleSheet)||((r=(i=e).cssText).split('"').length<3?r:(r=["@import","url(".concat(JSON.stringify(i.href),")")],""===i.layerName?r.push("layer"):i.layerName&&r.push("layer(".concat(i.layerName,")")),i.supportsText&&r.push("supports(".concat(i.supportsText,")")),i.media.length&&r.push(i.media.mediaText),r.join(" ")+";"))}catch(t){n=e.cssText}return e.styleSheet.href?Uo(n,e.styleSheet.href):n}var r,i=e.cssText;return"selectorText"in e&&e.selectorText.includes(":")&&(i=i.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")),t?Uo(i,t):i}var xo=k(function e(){b(this,e),ro(this,"idNodeMap",new Map),ro(this,"nodeMetaMap",new WeakMap)},[{key:"getId",value:function(e){return e&&null!=(e=null==(e=this.getMeta(e))?void 0:e.id)?e:-1}},{key:"getNode",value:function(e){return this.idNodeMap.get(e)||null}},{key:"getIds",value:function(){return Array.from(this.idNodeMap.keys())}},{key:"getMeta",value:function(e){return this.nodeMetaMap.get(e)||null}},{key:"removeNodeFromMap",value:function(e){var t=this,n=this.getId(e);this.idNodeMap.delete(n),e.childNodes&&e.childNodes.forEach(function(e){return t.removeNodeFromMap(e)})}},{key:"has",value:function(e){return this.idNodeMap.has(e)}},{key:"hasNode",value:function(e){return this.nodeMetaMap.has(e)}},{key:"add",value:function(e,t){var n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}},{key:"replace",value:function(e,t){var n=this.getNode(e);n&&(n=this.nodeMetaMap.get(n))&&this.nodeMetaMap.set(t,n),this.idNodeMap.set(e,t)}},{key:"reset",value:function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}]);function Mo(e){var t=e.element,n=e.maskInputOptions,r=e.tagName,i=e.type,o=e.maskInputFn,e=e.value||"",i=i&&Io(i);return e=n[r.toLowerCase()]||i&&n[i]?o?o(e,t):"*".repeat(e.length):e}function Io(e){return e.toLowerCase()}function Ao(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Io(t):null}function Po(e,t){var n;try{n=new URL(e,null!=t?t:window.location.href)}catch(e){return null}t=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!=(n=null==t?void 0:t[1])?n:null}var Do=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Lo=/^(?:[a-z+]+:)?\/\//i,No=/^www\..*/i,Fo=/^(data:)([^,]*),(.*)/i;function Uo(e,c){return(e||"").replace(Do,function(e,t,n,r,i,o){n=n||i||o,i=t||r||"";if(!n)return e;if(Lo.test(n)||No.test(n))return"url(".concat(i).concat(n).concat(i,")");if(Fo.test(n))return"url(".concat(i).concat(n).concat(i,")");if("/"===n[0])return"url(".concat(i).concat((-1<(o=c).indexOf("//")?o.split("/").slice(0,3).join("/"):o.split("/")[0]).split("?")[0]+n).concat(i,")");var t=n.split("#")[0],r=n.substring(t.length),s=c.split("#")[0].split("/"),o=t.split("/");s.pop();var a,l=Ie(o);try{for(l.s();!(a=l.n()).done;){var u=a.value;"."!==u&&(".."===u?s.pop():s.push(u))}}catch(e){l.e(e)}finally{l.f()}return"url(".concat(i).concat(s.join("/")).concat(r).concat(i,")")})}function zo(e,t){return 1<arguments.length&&void 0!==t&&t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}var Bo,jo,Wo=1,Ho=new RegExp("[^a-z0-9-_:]");function qo(){return Wo++}var Vo=/^[^ \t\n\r\u000c]+/,Go=/^[, \t\n\r\u000c]+/,Zo=new WeakMap;function Jo(e,t){return t&&""!==t.trim()?Ko(e,t):t}function Ko(e,t){var n=Zo.get(e);if(n||(n=e.createElement("a"),Zo.set(e,n)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return n.setAttribute("href",t),n.href}function $o(e,t,n,r){return r&&("src"===n||"href"===n&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&"#"!==r[0]||"background"===n&&["table","td","th"].includes(t)?Jo(e,r):"srcset"===n?((e,t)=>{if(""===t.trim())return t;var n=0;function r(e){var e=e.exec(t.substring(n));return e?(e=e[0],n+=e.length,e):""}for(var i=[];r(Go),!(n>=t.length);)if(","===(s=r(Vo)).slice(-1))s=Jo(e,s.substring(0,s.length-1)),i.push(s);else for(var o="",s=Jo(e,s),a=!1;;){var l=t.charAt(n);if(""===l){i.push((s+o).trim());break}if(a)")"===l&&(a=!1);else{if(","===l){n+=1,i.push((s+o).trim());break}"("===l&&(a=!0)}o+=l,n+=1}return i.join(", ")})(e,r):"style"===n?Uo(r,Ko(e)):"object"===t&&"data"===n?Jo(e,r):r)}function Xo(e,t){return["video","audio"].includes(e)&&"autoplay"===t}function Yo(e,t,n){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE)for(var r=e.classList.length;r--;){var i=e.classList[r];if(t.test(i))return!0}return!!n&&Yo(bo(e),t,n)}function Qo(e,t,n,r){var i;if(Eo(e)){if(!wo(i=e).length)return!1}else{if(null===ko(e))return!1;i=ko(e)}try{if("string"==typeof t){if(r){if(i.closest(".".concat(t)))return!0}else if(i.classList.contains(t))return!0}else if(Yo(i,t,r))return!0;if(n)if(r){if(i.closest(n))return!0}else if(i.matches(n))return!0}catch(e){}return!1}function N(e){return null==e?"":e.toLowerCase()}function es(e){return!0===e||"all"===e?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===e,headMetaDescKeywords:"all"===e,headTitleMutations:"all"===e}:e||{}}function ts(t,e){var n=e.doc,r=e.mirror,i=e.blockClass,o=e.blockSelector,s=e.maskTextClass,a=e.maskTextSelector,l=e.skipChild,l=void 0!==l&&l,u=e.inlineStylesheet,c=void 0===u||u,u=e.maskInputOptions,d=void 0===u?{}:u,f=e.maskTextFn,h=e.maskInputFn,p=e.slimDOMOptions,u=e.dataURLOptions,m=void 0===u?{}:u,u=e.inlineImages,v=void 0!==u&&u,u=e.recordCanvas,g=void 0!==u&&u,y=e.onSerialize,w=e.onIframeLoad,u=e.iframeLoadTimeout,b=void 0===u?5e3:u,k=e.onStylesheetLoad,u=e.stylesheetLoadTimeout,_=void 0===u?5e3:u,u=e.keepIframeSrcFn,S=void 0===u?function(){return!1}:u,u=e.newlyAddedElement,u=void 0!==u&&u,E=e.cssCaptured,E=void 0!==E&&E,C=e.needsMask,e=e.preserveWhiteSpace,R=void 0===e||e,C=C||Qo(t,s,a,void 0===C),e=((e,t)=>{var n=t.doc,r=t.blockClass,i=t.blockSelector,o=t.needsMask,s=t.inlineStylesheet,a=t.maskInputOptions,l=void 0===a?{}:a,u=t.maskTextFn,c=t.maskInputFn,d=void 0===(a=t.dataURLOptions)?{}:a,f=t.inlineImages,h=t.recordCanvas,N=t.keepIframeSrcFn,F=void 0!==(a=t.newlyAddedElement)&&a,U=void 0!==(a=t.cssCaptured)&&a,p=(a=n,!(t=t.mirror).hasNode(a)||1===(t=t.getId(a))?void 0:t);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:fo.Document,childNodes:[],compatMode:e.compatMode}:{type:fo.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:fo.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:p};case e.ELEMENT_NODE:for(var m,v,g,y,w,b,k=e,_=(I={doc:n,blockClass:r,blockSelector:i,inlineStylesheet:s,maskInputOptions:l,maskInputFn:c,dataURLOptions:d,inlineImages:f,recordCanvas:h,keepIframeSrcFn:N,newlyAddedElement:F,rootId:p}).doc,S=I.inlineStylesheet,E=void 0===(E=I.maskInputOptions)?{}:E,C=I.maskInputFn,R=void 0===(T=I.dataURLOptions)?{}:T,T=I.inlineImages,O=I.recordCanvas,x=I.keepIframeSrcFn,M=void 0!==(M=I.newlyAddedElement)&&M,z=I.rootId,I=((e,t,n)=>{try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=e.classList.length;r--;){var i=e.classList[r];if(t.test(i))return!0}if(n)return e.matches(n)}catch(e){}return!1})(k,I.blockClass,I.blockSelector),A=(v=k)instanceof HTMLFormElement?"form":(v=Io(v.tagName),Ho.test(v)?"div":v),P={},B=k.attributes.length,D=0;D<B;D++){var L=k.attributes[D];Xo(A,L.name)||(P[L.name]=$o(_,A,Io(L.name),L.value))}"link"===A&&S&&(v=null,v=(S=Array.from(_.styleSheets).find(function(e){return e.href===k.href}))?To(S):v)&&(delete P.rel,delete P.href,P._cssText=v),"style"===A&&k.sheet&&(S=To(k.sheet))&&(1<k.childNodes.length&&(S=function(e,t,n){var r=2<arguments.length&&void 0!==n&&n,i=Array.from(t.childNodes),o=[],s=0;if(1<i.length&&e&&"string"==typeof e)for(var a=zo(e,r),l=a.length/e.length,u=1;u<i.length;u++)if(i[u].textContent&&"string"==typeof i[u].textContent){for(var c=zo(i[u].textContent,r),d=3;d<c.length&&(c[d].match(/[a-zA-Z0-9]/)||-1!==c.indexOf(c.substring(0,d),1));d++);for(;d<c.length;d++){var f,h=c.substring(0,d),p=a.split(h),m=-1;if(2===p.length)m=p[0].length;else if(2<p.length&&""===p[0]&&""!==i[u-1].textContent)m=a.indexOf(h,1);else if(1===p.length){if(h=h.substring(0,h.length-1),(p=a.split(h)).length<=1)return o.push(e),o;d=101}else d===c.length-1&&(m=a.indexOf(h));if(-1!==(m=2<=p.length&&100<d&&((f=i[u-1].textContent)&&"string"==typeof f&&(f=zo(f).length,m=a.indexOf(h,f)),-1===m)?p[0].length:m)){for(var v=Math.floor(m/l);0<v&&v<e.length;){if((s+=1)>50*i.length)return o.push(e),o;var g=zo(e.substring(0,v),r);if(g.length===m){o.push(e.substring(0,v)),e=e.substring(v),a=a.substring(m);break}g.length<m?v+=Math.max(1,Math.floor((m-g.length)/l)):v-=Math.max(1,Math.floor((g.length-m)*l))}break}}}return o.push(e),o}(S,k).join("/* rr_split */")),P._cssText=S),["input","textarea","select"].includes(A)&&(v=k.value,S=k.checked,"radio"!==P.type&&"checkbox"!==P.type&&"submit"!==P.type&&"button"!==P.type&&v?P.value=Mo({element:k,type:Ao(k),tagName:A,value:v,maskInputOptions:E,maskInputFn:C}):S&&(P.checked=S)),"option"===A&&(k.selected&&!E.select?P.selected=!0:delete P.selected),"dialog"===A&&k.open&&(P.rr_open_mode=k.matches("dialog:modal")?"modal":"non-modal"),"canvas"===A&&O&&("2d"===k.__context?(e=>{var t=e.getContext("2d");if(t)for(var n=0;n<e.width;n+=50)for(var r=0;r<e.height;r+=50){var i=t.getImageData,i="__rrweb_original__"in i?i.__rrweb_original__:i;if(new Uint32Array(i.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some(function(e){return 0!==e}))return}return 1})(k)||(P.rr_dataURL=k.toDataURL(R.type,R.quality)):"__context"in k||(v=k.toDataURL(R.type,R.quality),(C=_.createElement("canvas")).width=k.width,C.height=k.height,v!==C.toDataURL(R.type,R.quality)&&(P.rr_dataURL=v))),"img"===A&&T&&(Bo||(Bo=_.createElement("canvas"),jo=Bo.getContext("2d")),y=(g=k).currentSrc||g.getAttribute("src")||"<unknown-src>",w=g.crossOrigin,b=function(){g.removeEventListener("load",b);try{Bo.width=g.naturalWidth,Bo.height=g.naturalHeight,jo.drawImage(g,0,0),P.rr_dataURL=Bo.toDataURL(R.type,R.quality)}catch(e){if("anonymous"!==g.crossOrigin)return g.crossOrigin="anonymous",void(g.complete&&0!==g.naturalWidth?b():g.addEventListener("load",b));console.warn("Cannot inline img src=".concat(y,"! Error: ").concat(e))}"anonymous"===g.crossOrigin&&(w?P.crossOrigin=w:g.removeAttribute("crossorigin"))},g.complete&&0!==g.naturalWidth?b():g.addEventListener("load",b)),["audio","video"].includes(A)&&((S=P).rr_mediaState=k.paused?"paused":"played",S.rr_mediaCurrentTime=k.currentTime,S.rr_mediaPlaybackRate=k.playbackRate,S.rr_mediaMuted=k.muted,S.rr_mediaLoop=k.loop,S.rr_mediaVolume=k.volume),M||(k.scrollLeft&&(P.rr_scrollLeft=k.scrollLeft),k.scrollTop&&(P.rr_scrollTop=k.scrollTop)),I&&(O=(E=k.getBoundingClientRect()).width,C=E.height,P={class:P.class,rr_width:"".concat(O,"px"),rr_height:"".concat(C,"px")}),"iframe"!==A||x(P.src)||(k.contentDocument||(P.rr_src=P.src),delete P.src);try{customElements.get(A)&&(m=!0)}catch(k){}return{type:fo.Element,tagName:A,attributes:P,childNodes:[],isSVG:Boolean("svg"===k.tagName||k.ownerSVGElement)||void 0,needBlock:I,rootId:z,isCustom:m};case e.TEXT_NODE:return T=(v={doc:n,needsMask:o,maskTextFn:u,rootId:p,cssCaptured:U}).needsMask,S=v.maskTextFn,M=v.rootId,E=v.cssCaptured,C=(C=bo(O=e))&&C.tagName,x="",I="STYLE"===C||void 0,(C="SCRIPT"===C||void 0)?x="SCRIPT_PLACEHOLDER":E||(x=_o(O),I&&(x=x&&Uo(x,Ko(v.doc)))),!I&&!C&&x&&T&&(x=S?S(x,ko(O)):x.replace(/[\S]/g,"*")),{type:fo.Text,textContent:x||"",rootId:M};case e.CDATA_SECTION_NODE:return{type:fo.CDATA,textContent:"",rootId:p};case e.COMMENT_NODE:return{type:fo.Comment,textContent:_o(e)||"",rootId:p};default:return!1}})(t,{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:C,inlineStylesheet:c,maskInputOptions:d,maskTextFn:f,maskInputFn:h,dataURLOptions:m,inlineImages:v,recordCanvas:g,keepIframeSrcFn:S,newlyAddedElement:u,cssCaptured:E});if(!e)return console.warn(t,"not serialized"),null;var u=r.hasNode(t)?r.getId(t):((e,t)=>{if(t.comment&&e.type===fo.Comment)return 1;if(e.type===fo.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel&&"script"===e.attributes.as||"modulepreload"===e.attributes.rel)||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===Po(e.attributes.href)))return 1;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(N(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===N(e.attributes.name)||"icon"===N(e.attributes.rel)||"apple-touch-icon"===N(e.attributes.rel)||"shortcut icon"===N(e.attributes.rel))))return 1;if("meta"===e.tagName){if(t.headMetaDescKeywords&&N(e.attributes.name).match(/^description|keywords$/))return 1;if(t.headMetaSocial&&(N(e.attributes.property).match(/^(og|twitter|fb):/)||N(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===N(e.attributes.name)))return 1;if(t.headMetaRobots&&("robots"===N(e.attributes.name)||"googlebot"===N(e.attributes.name)||"bingbot"===N(e.attributes.name)))return 1;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return 1;if(t.headMetaAuthorship&&("author"===N(e.attributes.name)||"generator"===N(e.attributes.name)||"framework"===N(e.attributes.name)||"publisher"===N(e.attributes.name)||"progid"===N(e.attributes.name)||N(e.attributes.property).match(/^article:/)||N(e.attributes.property).match(/^product:/)))return 1;if(t.headMetaVerification&&("google-site-verification"===N(e.attributes.name)||"yandex-verification"===N(e.attributes.name)||"csrf-token"===N(e.attributes.name)||"p:domain_verify"===N(e.attributes.name)||"verify-v1"===N(e.attributes.name)||"verification"===N(e.attributes.name)||"shopify-checkout-api-token"===N(e.attributes.name)))return 1}}})(e,p)||!R&&e.type===fo.Text&&!e.textContent.replace(/^\s+|\s+$/gm,"").length?-2:Wo++,T=Object.assign(e,{id:u});if(r.add(t,T),-2===u)return null;y&&y(t);E=!l;if(T.type===fo.Element&&(E=E&&!T.needBlock,delete T.needBlock,e=So(t))&&Ro(e)&&(T.isShadowHost=!0),(T.type===fo.Document||T.type===fo.Element)&&E){p.headWhitespace&&T.type===fo.Element&&"head"===T.tagName&&(R=!1);var O={doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:C,maskTextClass:s,maskTextSelector:a,skipChild:l,inlineStylesheet:c,maskInputOptions:d,maskTextFn:f,maskInputFn:h,slimDOMOptions:p,dataURLOptions:m,inlineImages:v,recordCanvas:g,preserveWhiteSpace:R,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:b,onStylesheetLoad:k,stylesheetLoadTimeout:_,keepIframeSrcFn:S,cssCaptured:!1};if(T.type!==fo.Element||"textarea"!==T.tagName||void 0===T.attributes.value){T.type===fo.Element&&void 0!==T.attributes._cssText&&"string"==typeof T.attributes._cssText&&(O.cssCaptured=!0);for(var x=0,M=Array.from(wo(t));x<M.length;x++){var I=ts(M[x],O);I&&T.childNodes.push(I)}}var A=null;if(Eo(t)&&(A=So(t)))for(var P=0,D=Array.from(wo(A));P<D.length;P++){var L=ts(D[P],O);L&&(Ro(A)&&(L.isShadow=!0),T.childNodes.push(L))}}u=bo(t);return u&&Co(u)&&Ro(u)&&(T.isShadow=!0),T.type===fo.Element&&"iframe"===T.tagName&&((e,t,n)=>{var r=e.contentWindow;if(r){var i,o=!1;try{i=r.document.readyState}catch(e){return}if("complete"===i){if("about:blank"!==r.location.href||"about:blank"===e.src||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var s=setTimeout(function(){o||(t(),o=!0)},n);e.addEventListener("load",function(){clearTimeout(s),o=!0,t()})}}})(t,function(){var e=t.contentDocument;e&&w&&(e=ts(e,{doc:e,mirror:r,blockClass:i,blockSelector:o,needsMask:C,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:d,maskTextFn:f,maskInputFn:h,slimDOMOptions:p,dataURLOptions:m,inlineImages:v,recordCanvas:g,preserveWhiteSpace:R,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:b,onStylesheetLoad:k,stylesheetLoadTimeout:_,keepIframeSrcFn:S}))&&w(t,e)},b),T.type===fo.Element&&"link"===T.tagName&&"string"==typeof T.attributes.rel&&("stylesheet"===T.attributes.rel||"preload"===T.attributes.rel&&"string"==typeof T.attributes.href&&"css"===Po(T.attributes.href))&&((e,t,n)=>{var r,i,o=!1;try{r=e.sheet}catch(e){return}r||(i=setTimeout(function(){o||(t(),o=!0)},n),e.addEventListener("load",function(){clearTimeout(i),o=!0,t()}))})(t,function(){var e;k&&(e=ts(t,{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:C,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:d,maskTextFn:f,maskInputFn:h,slimDOMOptions:p,dataURLOptions:m,inlineImages:v,recordCanvas:g,preserveWhiteSpace:R,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:b,onStylesheetLoad:k,stylesheetLoadTimeout:_,keepIframeSrcFn:S}))&&k(t,e)},_),T}var ns,rs,is,os,ss,as,ls={exports:{}},h=(os=Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"}))).__esModule?os:("function"==typeof(ss=os.default)?(as=function e(){return this instanceof e?Reflect.construct(ss,arguments,this.constructor):ss.apply(this,arguments)}).prototype=ss.prototype:as={},Object.defineProperty(as,"__esModule",{value:!0}),Object.keys(os).forEach(function(e){var t=Object.getOwnPropertyDescriptor(os,e);Object.defineProperty(as,e,t.get?t:{enumerable:!0,get:function(){return os[e]}})}),as);function us(){var d,f,e,t;return is||(is=1,ns||(ns=1,e=String,ls.exports=(t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}})(),ls.exports.createColors=t),d=ls.exports,f=h,qi(a,no(Error)),t=k(a,[{key:"setMessage",value:function(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file||"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}},{key:"showSourceCode",value:function(e){var r=this;if(!this.source)return"";var t=this.source;null==e&&(e=d.isColorSupported);var n,i,o,s,a,t=(t=f&&e?f(t):t).split(/\r?\n/),l=Math.max(this.line-3,0),u=Math.min(this.line+2,t.length),c=String(u).length;return e?(e=d.createColors(!0),n=e.bold,i=e.gray,o=e.red,s=function(e){return n(o(e))},a=function(e){return i(e)}):s=a=function(e){return e},t.slice(l,u).map(function(e,t){var t=l+1+t,n=" "+(" "+t).slice(-c)+" | ";return t===r.line?(t=a(n.replace(/\d/g," "))+e.slice(0,r.column-1).replace(/[^\t]/g," "),s(">")+a(n)+e+"\n "+t+s("^")):" "+a(n)+e}).join("\n")}},{key:"toString",value:function(){var e=(e=this.showSourceCode())&&"\n\n"+e+"\n";return this.name+": "+this.message+e}}]),(rs=t).default=t),rs;function a(e,t,n,r,i,o){var s;return b(this,a),(s=Bi(this,a,[e])).name="CssSyntaxError",s.reason=e,i&&(s.file=i),r&&(s.source=r),o&&(s.plugin=o),void 0!==t&&void 0!==n&&("number"==typeof t?(s.line=t,s.column=n):(s.line=t.line,s.column=t.column,s.endLine=n.line,s.endColumn=n.column)),s.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(s,a),s}}var cs,ds,fs,hs,ps,ms,vs,gs,ys,ws,bs,ks,_s,Ss,Es,Cs,Rs,Ts,Os,xs,Ms,Is,As,Ps,Ds,Ls,Ns,Fs,Us,zs,Bs,js,Ws,Hs,qs,Vs,Gs,Zs,Js,Ks,$s,Xs,Ys,Qs,ea,ta,na,ra,ia,oa,sa,aa,la,ua,ca,da,fa,ha,pa,ma,va,ga,ya,wa,ba,ka,_a,Sa,Ea,Ca,Ra,Ta,Oa,xa,Ma={};function Ia(){return cs||(cs=1,Ma.isClean=Symbol("isClean"),Ma.my=Symbol("my")),Ma}function Aa(){var s,e;return fs||(s={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!(fs=1)},e=k(function e(t){b(this,e),this.builder=t},[{key:"atrule",value:function(e,t){var n="@"+e.name,r=e.params?this.rawValue(e,"params"):"";void 0!==e.raws.afterName?n+=e.raws.afterName:r&&(n+=" "),e.nodes?this.block(e,n+r):(t=(e.raws.between||"")+(t?";":""),this.builder(n+r+t,e))}},{key:"beforeAfter",value:function(e,t){for(var n="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"),r=e.parent,i=0;r&&"root"!==r.type;)i+=1,r=r.parent;if(n.includes("\n")){var o=this.raw(e,null,"indent");if(o.length)for(var s=0;s<i;s++)n+=o}return n}},{key:"block",value:function(e,t){var n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),(t=e.nodes&&e.nodes.length?(this.body(e),this.raw(e,"after")):this.raw(e,"after","emptyBody"))&&this.builder(t),this.builder("}",e,"end")}},{key:"body",value:function(e){for(var t=e.nodes.length-1;0<t&&"comment"===e.nodes[t].type;)--t;for(var n=this.raw(e,"semicolon"),r=0;r<e.nodes.length;r++){var i=e.nodes[r],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,t!==r||n)}}},{key:"comment",value:function(e){var t=this.raw(e,"left","commentLeft"),n=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+n+"*/",e)}},{key:"decl",value:function(e,t){var n=this.raw(e,"between","colon"),n=e.prop+n+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}},{key:"document",value:function(e){this.body(e)}},{key:"raw",value:function(e,t,n){var r;if(t&&void 0!==(r=e.raws[t]))return r;var i,o=e.parent;if("before"===(n=n||t)){if(!o||"root"===o.type&&o.first===e)return"";if(o&&"document"===o.type)return""}return o?((o=e.root()).rawCache||(o.rawCache={}),void 0!==o.rawCache[n]?o.rawCache[n]:"before"===n||"after"===n?this.beforeAfter(e,n):(this[i="raw"+((i=n)[0].toUpperCase()+i.slice(1))]?r=this[i](o,e):o.walk(function(e){if(void 0!==(r=e.raws[t]))return!1}),void 0===r&&(r=s[n]),o.rawCache[n]=r)):s[n]}},{key:"rawBeforeClose",value:function(e){var t;return e.walk(function(e){if(e.nodes&&0<e.nodes.length&&void 0!==e.raws.after)return(t=e.raws.after).includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t=t&&t.replace(/\S/g,"")}},{key:"rawBeforeComment",value:function(e,t){var n;return e.walkComments(function(e){if(void 0!==e.raws.before)return(n=e.raws.before).includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),n=void 0===n?this.raw(t,null,"beforeDecl"):n&&n.replace(/\S/g,"")}},{key:"rawBeforeDecl",value:function(e,t){var n;return e.walkDecls(function(e){if(void 0!==e.raws.before)return(n=e.raws.before).includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),n=void 0===n?this.raw(t,null,"beforeRule"):n&&n.replace(/\S/g,"")}},{key:"rawBeforeOpen",value:function(e){var t;return e.walk(function(e){if("decl"!==e.type&&void 0!==(t=e.raws.between))return!1}),t}},{key:"rawBeforeRule",value:function(t){var n;return t.walk(function(e){if(e.nodes&&(e.parent!==t||t.first!==e)&&void 0!==e.raws.before)return(n=e.raws.before).includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),n=n&&n.replace(/\S/g,"")}},{key:"rawColon",value:function(e){var t;return e.walkDecls(function(e){if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}},{key:"rawEmptyBody",value:function(e){var t;return e.walk(function(e){if(e.nodes&&0===e.nodes.length&&void 0!==(t=e.raws.after))return!1}),t}},{key:"rawIndent",value:function(n){return n.raws.indent||(n.walk(function(e){var t=e.parent;if(t&&t!==n&&t.parent&&t.parent===n&&void 0!==e.raws.before)return t=e.raws.before.split("\n"),r=(r=t[t.length-1]).replace(/\S/g,""),!1}),r);var r}},{key:"rawSemicolon",value:function(e){var t;return e.walk(function(e){if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&void 0!==(t=e.raws.semicolon))return!1}),t}},{key:"rawValue",value:function(e,t){var n=e[t],e=e.raws[t];return e&&e.value===n?e.raw:n}},{key:"root",value:function(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}},{key:"rule",value:function(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}},{key:"stringify",value:function(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)}}]),(ds=e).default=e),ds}function Pa(){var n;return ps||(ps=1,n=Aa(),(hs=e).default=e),hs;function e(e,t){new n(t).stringify(e)}}function Da(){var s,a,i,n,r,e;return vs||(vs=1,e=Ia(),s=e.isClean,a=e.my,i=us(),n=Aa(),r=Pa(),e=k(function e(){var t,n=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};for(t in b(this,e),this.raws={},this[s]=!1,this[a]=!0,n)if("nodes"===t){this.nodes=[];var r,i=Ie(n[t]);try{for(i.s();!(r=i.n()).done;){var o=r.value;"function"==typeof o.clone?this.append(o.clone()):this.append(o)}}catch(e){i.e(e)}finally{i.f()}}else this[t]=n[t]},[{key:"addToError",value:function(e){var t;return e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)&&(t=this.source,e.stack=e.stack.replace(/\n\s{4}at /,"$&".concat(t.input.from,":").concat(t.start.line,":").concat(t.start.column,"$&"))),e}},{key:"after",value:function(e){return this.parent.insertAfter(this,e),this}},{key:"assign",value:function(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};for(e in t)this[e]=t[e];return this}},{key:"before",value:function(e){return this.parent.insertBefore(this,e),this}},{key:"cleanRaws",value:function(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}},{key:"clone",value:function(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},n=function t(e,n){var r,i,o,s=new e.constructor;for(r in e)Object.prototype.hasOwnProperty.call(e,r)&&"proxyCache"!==r&&(o=_(i=e[r]),"parent"===r&&"object"===o?n&&(s[r]=n):"source"===r?s[r]=i:Array.isArray(i)?s[r]=i.map(function(e){return t(e,s)}):("object"===o&&null!==i&&(i=t(i)),s[r]=i));return s}(this);for(e in t)n[e]=t[e];return n}},{key:"cloneAfter",value:function(){var e=this.clone(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{});return this.parent.insertAfter(this,e),e}},{key:"cloneBefore",value:function(){var e=this.clone(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{});return this.parent.insertBefore(this,e),e}},{key:"error",value:function(e){var t,n,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return this.source?(t=(n=this.rangeBy(r)).end,this.source.input.error(e,{column:(n=n.start).column,line:n.line},{column:t.column,line:t.line},r)):new i(e)}},{key:"getProxyProcessor",value:function(){return{get:function(e,t){return"proxyOf"===t?e:"root"===t?function(){return e.root().toProxy()}:e[t]},set:function(e,t,n){return e[t]!==n&&(e[t]=n,"prop"===t||"value"===t||"name"===t||"params"===t||"important"===t||"text"===t)&&e.markDirty(),!0}}}},{key:"markDirty",value:function(){if(this[s]){this[s]=!1;for(var e=this;e=e.parent;)e[s]=!1}}},{key:"next",value:function(){var e;if(this.parent)return e=this.parent.index(this),this.parent.nodes[e+1]}},{key:"positionBy",value:function(e,t){var n=this.source.start;return e.index?n=this.positionInside(e.index,t):e.word&&-1!==(e=(t=this.toString()).indexOf(e.word))&&(n=this.positionInside(e,t)),n}},{key:"positionInside",value:function(e,t){for(var n=t||this.toString(),r=this.source.start.column,i=this.source.start.line,o=0;o<e;o++)"\n"===n[o]?i+=r=1:r+=1;return{column:r,line:i}}},{key:"prev",value:function(){var e;if(this.parent)return e=this.parent.index(this),this.parent.nodes[e-1]}},{key:"rangeBy",value:function(e){var t,n,r={column:this.source.start.column,line:this.source.start.line},i=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:r.column+1,line:r.line};return e.word?-1!==(n=(t=this.toString()).indexOf(e.word))&&(r=this.positionInside(n,t),i=this.positionInside(n+e.word.length,t)):(e.start?r={column:e.start.column,line:e.start.line}:e.index&&(r=this.positionInside(e.index)),e.end?i={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?i=this.positionInside(e.endIndex):e.index&&(i=this.positionInside(e.index+1))),{end:i=i.line<r.line||i.line===r.line&&i.column<=r.column?{column:r.column+1,line:r.line}:i,start:r}}},{key:"raw",value:function(e,t){return(new n).raw(this,e,t)}},{key:"remove",value:function(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}},{key:"replaceWith",value:function(){if(this.parent){for(var e=this,t=!1,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];for(var o=0,s=r;o<s.length;o++){var a=s[o];a===this?t=!0:t?(this.parent.insertAfter(e,a),e=a):this.parent.insertBefore(e,a)}t||this.remove()}return this}},{key:"root",value:function(){for(var e=this;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}},{key:"toJSON",value:function(e,t){var n,r,i,o={},s=null==t,a=(t=t||new Map,0);for(n in this)Object.prototype.hasOwnProperty.call(this,n)&&"parent"!==n&&"proxyCache"!==n&&(r=this[n],Array.isArray(r)?o[n]=r.map(function(e){return"object"===_(e)&&e.toJSON?e.toJSON(null,t):e}):"object"===_(r)&&r.toJSON?o[n]=r.toJSON(null,t):"source"===n?(null==(i=t.get(r.input))&&(i=a,t.set(r.input,a),a++),o[n]={end:r.end,inputId:i,start:r.start}):o[n]=r);return s&&(o.inputs=Qi(t.keys()).map(function(e){return e.toJSON()})),o}},{key:"toProxy",value:function(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}},{key:"toString",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:r,t=(e.stringify&&(e=e.stringify),"");return e(this,function(e){t+=e}),t}},{key:"warn",value:function(e,t,n){var r,i={node:this};for(r in n)i[r]=n[r];return e.warn(t,i)}},{key:"proxyOf",get:function(){return this}}]),(ms=e).default=e),ms}function La(){var e;return ys||(ys=1,qi(t,Da()),e=k(t,[{key:"variable",get:function(){return this.prop.startsWith("--")||"$"===this.prop[0]}}]),(gs=e).default=e),gs;function t(e){return b(this,t),(e=Bi(this,t,[e=e&&void 0!==e.value&&"string"!=typeof e.value?Ae(Ae({},e),{},{value:String(e.value)}):e])).type="decl",e}}function Na(){var r,i,t,n,o,s,e;return _s||(_s=1,r=h.SourceMapConsumer,i=h.SourceMapGenerator,t=h.existsSync,n=h.readFileSync,o=h.dirname,s=h.join,e=k(function e(t,n){b(this,e),!1!==n.map&&(this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:"),t=n.map?n.map.prev:void 0,t=this.loadMap(n.from,t),!this.mapFile&&n.from&&(this.mapFile=n.from),this.mapFile&&(this.root=o(this.mapFile)),t)&&(this.text=t)},[{key:"consumer",value:function(){return this.consumerCache||(this.consumerCache=new r(this.text)),this.consumerCache}},{key:"decodeInline",value:function(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=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+t)}},{key:"getAnnotationURL",value:function(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}},{key:"isMap",value:function(e){return"object"===_(e)&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}},{key:"loadAnnotation",value:function(e){var t,n=e.match(/\/\*\s*# sourceMappingURL=/gm);n&&(n=e.lastIndexOf(n.pop()),t=e.indexOf("*/",n),-1<n)&&-1<t&&(this.annotation=this.getAnnotationURL(e.substring(n,t)))}},{key:"loadFile",value:function(e){if(this.root=o(e),t(e))return this.mapFile=e,n(e,"utf-8").toString().trim()}},{key:"loadMap",value:function(e,t){if(!1===t)return!1;if(!t)return this.inline?this.decodeInline(this.annotation):this.annotation?(n=this.annotation,e&&(n=s(o(e),n)),this.loadFile(n)):void 0;if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof r)return i.fromSourceMap(t).toString();if(t instanceof i)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}var n=t(e);if(n){t=this.loadFile(n);if(t)return t;throw new Error("Unable to load previous source map: "+n.toString())}}},{key:"startWith",value:function(e,t){return!!e&&e.substr(0,t.length)===t}},{key:"withContent",value:function(){return!!(this.consumer().sourcesContent&&0<this.consumer().sourcesContent.length)}}]),(ks=e).default=e),ks}function Fa(){var e,s,l,a,r,i,t,u,o,c,d,f,n;return Es||(Es=1,n=h.SourceMapConsumer,e=h.SourceMapGenerator,s=h.fileURLToPath,l=h.pathToFileURL,a=h.isAbsolute,r=h.resolve,i=(bs?ws:(bs=1,ws={nanoid:function(){for(var e="",t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:21;t--;)e+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return e},customAlphabet:function(n){var r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:21;return function(){for(var e="",t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:r;t--;)e+=n[Math.random()*n.length|0];return e}}})).nanoid,t=h,u=us(),o=Na(),c=Symbol("fromOffsetCache"),d=Boolean(n&&e),f=Boolean(r&&a),n=k(function e(t){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(b(this,e),null==t||"object"===_(t)&&!t.toString)throw new Error("PostCSS received ".concat(t," instead of CSS string"));this.css=t.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,n.from&&(!f||/^\w+:\/\//.test(n.from)||a(n.from)?this.file=n.from:this.file=r(n.from)),f&&d&&(t=new o(this.css,n)).text&&(n=(this.map=t).consumer().file,!this.file)&&n&&(this.file=this.mapResolve(n)),this.file||(this.id="<input css "+i(6)+">"),this.map&&(this.map.file=this.from)},[{key:"error",value:function(e,t,n){var r,i,o,s=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{},a=(t&&"object"===_(t)?(a=n,n="number"==typeof(i=t).offset?(t=(o=this.fromOffset(i.offset)).line,o.col):(t=i.line,i.column),i="number"==typeof a.offset?(r=(o=this.fromOffset(a.offset)).line,o.col):(r=a.line,a.column)):n||(t=(o=this.fromOffset(t)).line,n=o.col),this.origin(t,n,r,i));return(o=a?new u(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,s.plugin):new u(e,void 0===r?t:{column:n,line:t},void 0===r?n:{column:i,line:r},this.css,this.file,s.plugin)).input={column:n,endColumn:i,endLine:r,line:t,source:this.css},this.file&&(l&&(o.input.url=l(this.file).toString()),o.input.file=this.file),o}},{key:"fromOffset",value:function(e){if(this[c])n=this[c];else{for(var t=this.css.split("\n"),n=new Array(t.length),r=0,i=0,o=t.length;i<o;i++)n[i]=r,r+=t[i].length+1;this[c]=n}var s=0;if(e>=n[n.length-1])s=n.length-1;else for(var a,l=n.length-2;s<l;)if(e<n[a=s+(l-s>>1)])l=a-1;else{if(!(e>=n[a+1])){s=a;break}s=a+1}return{col:e-n[s]+1,line:s+1}}},{key:"mapResolve",value:function(e){return/^\w+:\/\//.test(e)?e:r(this.map.consumer().sourceRoot||this.map.root||".",e)}},{key:"origin",value:function(e,t,n,r){if(!this.map)return!1;var i,o=this.map.consumer(),t=o.originalPositionFor({column:t,line:e});if(!t.source)return!1;"number"==typeof n&&(i=o.originalPositionFor({column:r,line:n}));e=a(t.source)?l(t.source):new URL(t.source,this.map.consumer().sourceRoot||l(this.map.mapFile)),r={column:t.column,endColumn:i&&i.column,endLine:i&&i.line,line:t.line,url:e.toString()};if("file:"===e.protocol){if(!s)throw new Error("file: protocol is not available in this PostCSS build");r.file=s(e)}n=o.sourceContentFor(t.source);return n&&(r.source=n),r}},{key:"toJSON",value:function(){for(var e={},t=0,n=["hasBOM","css","file","id"];t<n.length;t++){var r=n[t];null!=this[r]&&(e[r]=this[r])}return this.map&&(e.map=Ae({},this.map),e.map.consumerCache)&&(e.map.consumerCache=void 0),e}},{key:"from",get:function(){return this.file||this.id}}]),(Ss=n).default=n,t&&t.registerInput&&t.registerInput(n)),Ss}function Ua(){if(Rs)return Cs;Rs=1;var s=h.SourceMapConsumer,t=h.SourceMapGenerator,a=h.dirname,n=h.relative,r=h.resolve,i=h.sep,o=h.pathToFileURL,l=Fa(),e=Boolean(s&&t),u=Boolean(a&&r&&n&&i);return Cs=k(function e(t,n,r,i){b(this,e),this.stringify=t,this.mapOpts=r.map||{},this.root=n,this.opts=r,this.css=i,this.originalCSS=i,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map},[{key:"addAnnotation",value:function(){var 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",t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}},{key:"applyPrevMaps",value:function(){var e,t=Ie(this.previous());try{for(t.s();!(e=t.n()).done;){var n=e.value,r=this.toUrl(this.path(n.file)),i=n.root||a(n.file),o=void 0;!1===this.mapOpts.sourcesContent?(o=new s(n.text)).sourcesContent&&(o.sourcesContent=null):o=n.consumer(),this.map.applySourceMap(o,r,this.toUrl(this.path(i)))}}catch(e){t.e(e)}finally{t.f()}}},{key:"clearAnnotation",value:function(){if(!1!==this.mapOpts.annotation)if(this.root)for(var e,t=this.root.nodes.length-1;0<=t;t--)"comment"===(e=this.root.nodes[t]).type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t);else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}},{key:"generate",value:function(){var t;return this.clearAnnotation(),u&&e&&this.isMap()?this.generateMap():(t="",this.stringify(this.root,function(e){t+=e}),[t])}},{key:"generateMap",value:function(){var e;return this.root?this.generateString():1===this.previous().length?((e=this.previous()[0].consumer()).file=this.outputFile(),this.map=t.fromSourceMap(e,{ignoreInvalidMapping:!0})):(this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"})),this.isSourcesContent()&&this.setSourcesContent(),this.root&&0<this.previous().length&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}},{key:"generateString",value:function(){var r=this;this.css="",this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0});var i,o=1,s=1,a={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,function(e,t,n){r.css+=e,t&&"end"!==n&&(a.generated.line=o,a.generated.column=s-1,t.source&&t.source.start?(a.source=r.sourcePath(t),a.original.line=t.source.start.line,a.original.column=t.source.start.column-1):(a.source="<no source>",a.original.line=1,a.original.column=0),r.map.addMapping(a)),(i=e.match(/\n/g))?(o+=i.length,i=e.lastIndexOf("\n"),s=e.length-i):s+=e.length,t&&"start"!==n&&(e=t.parent||{raws:{}},"decl"!==t.type&&("atrule"!==t.type||t.nodes)||t!==e.last||e.raws.semicolon)&&(t.source&&t.source.end?(a.source=r.sourcePath(t),a.original.line=t.source.end.line,a.original.column=t.source.end.column-1,a.generated.line=o,a.generated.column=s-2):(a.source="<no source>",a.original.line=1,a.original.column=0,a.generated.line=o,a.generated.column=s-1),r.map.addMapping(a))})}},{key:"isAnnotation",value:function(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(function(e){return e.annotation}))}},{key:"isInline",value:function(){var e;return void 0!==this.mapOpts.inline?this.mapOpts.inline:(void 0===(e=this.mapOpts.annotation)||!0===e)&&(!this.previous().length||this.previous().some(function(e){return e.inline}))}},{key:"isMap",value:function(){return void 0!==this.opts.map?!!this.opts.map:0<this.previous().length}},{key:"isSourcesContent",value:function(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(function(e){return e.withContent()})}},{key:"outputFile",value:function(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}},{key:"path",value:function(e){var t;return this.mapOpts.absolute||60===e.charCodeAt(0)||/^\w+:\/\//.test(e)?e:this.memoizedPaths.get(e)||(t=this.opts.to?a(this.opts.to):".","string"==typeof this.mapOpts.annotation&&(t=a(r(t,this.mapOpts.annotation))),t=n(t,e),this.memoizedPaths.set(e,t),t)}},{key:"previous",value:function(){var e,t=this;return this.previousMaps||(this.previousMaps=[],this.root?this.root.walk(function(e){e.source&&e.source.input.map&&(e=e.source.input.map,t.previousMaps.includes(e)||t.previousMaps.push(e))}):(e=new l(this.originalCSS,this.opts)).map&&this.previousMaps.push(e.map)),this.previousMaps}},{key:"setSourcesContent",value:function(){var e,n=this,r={};this.root?this.root.walk(function(e){var t;e.source&&(t=e.source.input.from)&&!r[t]&&(r[t]=!0,t=n.usesFileUrls?n.toFileUrl(t):n.toUrl(n.path(t)),n.map.setSourceContent(t,e.source.input.css))}):this.css&&(e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>",this.map.setSourceContent(e,this.css))}},{key:"sourcePath",value:function(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))}},{key:"toBase64",value:function(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}},{key:"toFileUrl",value:function(e){var t=this.memoizedFileURLs.get(e);if(t)return t;if(o)return t=o(e).toString(),this.memoizedFileURLs.set(e,t),t;throw new Error("`map.absolute` option is not available in this PostCSS build")}},{key:"toUrl",value:function(e){var t=this.memoizedURLs.get(e);if(t)return t;"\\"===i&&(e=e.replace(/\\/g,"/"));t=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,t),t}}])}function za(){var e;return Os||(Os=1,qi(t,Da()),e=k(t),(Ts=e).default=e),Ts;function t(e){return b(this,t),(e=Bi(this,t,[e])).type="comment",e}}function Ba(){var u,c,d,t,e,f,h,p,m,n;return Ms||(Ms=1,e=Ia(),f=e.isClean,h=e.my,p=La(),m=za(),qi(v,Da()),(n=k(v,[{key:"append",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r=0,i=t;r<i.length;r++){var o,s=i[r],a=Ie(this.normalize(s,this.last));try{for(a.s();!(o=a.n()).done;){var l=o.value;this.proxyOf.nodes.push(l)}}catch(e){a.e(e)}finally{a.f()}}return this.markDirty(),this}},{key:"cleanRaws",value:function(e){if(Yi(v,"cleanRaws",this,3)([e]),this.nodes){var t,n=Ie(this.nodes);try{for(n.s();!(t=n.n()).done;)t.value.cleanRaws(e)}catch(e){n.e(e)}finally{n.f()}}}},{key:"each",value:function(e){if(this.proxyOf.nodes){for(var t,n,r=this.getIterator();this.indexes[r]<this.proxyOf.nodes.length&&(t=this.indexes[r],!1!==(n=e(this.proxyOf.nodes[t],t)));)this.indexes[r]+=1;return delete this.indexes[r],n}}},{key:"every",value:function(e){return this.nodes.every(e)}},{key:"getIterator",value:function(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;var e=this.lastEach;return this.indexes[e]=0,e}},{key:"getProxyProcessor",value:function(){return{get:function(r,o){return"proxyOf"===o?r:r[o]&&("each"===o||"string"==typeof o&&o.startsWith("walk")?function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r[o].apply(r,Qi(t.map(function(n){return"function"==typeof n?function(e,t){return n(e.toProxy(),t)}:n})))}:"every"===o||"some"===o?function(i){return r[o](function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return i.apply(void 0,[e.toProxy()].concat(n))})}:"root"===o?function(){return r.root().toProxy()}:"nodes"===o?r.nodes.map(function(e){return e.toProxy()}):"first"===o||"last"===o?r[o].toProxy():r[o])},set:function(e,t,n){return e[t]!==n&&(e[t]=n,"name"===t||"params"===t||"selector"===t)&&e.markDirty(),!0}}}},{key:"index",value:function(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}},{key:"insertAfter",value:function(e,t){var n,r,i,o=this.index(e),s=this.normalize(t,this.proxyOf.nodes[o]).reverse(),o=this.index(e),a=Ie(s);try{for(a.s();!(n=a.n()).done;){var l=n.value;this.proxyOf.nodes.splice(o+1,0,l)}}catch(e){a.e(e)}finally{a.f()}for(i in this.indexes)o<(r=this.indexes[i])&&(this.indexes[i]=r+s.length);return this.markDirty(),this}},{key:"insertBefore",value:function(e,t){var n,r,i,o=this.index(e),s=this.normalize(t,this.proxyOf.nodes[o],0===o&&"prepend").reverse(),o=this.index(e),a=Ie(s);try{for(a.s();!(n=a.n()).done;){var l=n.value;this.proxyOf.nodes.splice(o,0,l)}}catch(e){a.e(e)}finally{a.f()}for(i in this.indexes)o<=(r=this.indexes[i])&&(this.indexes[i]=r+s.length);return this.markDirty(),this}},{key:"normalize",value:function(e,t){var n=this;if("string"==typeof e)e=function t(e){return e.map(function(e){return e.nodes&&(e.nodes=t(e.nodes)),delete e.source,e})}(u(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e)){var r,i=Ie(e=e.slice(0));try{for(i.s();!(r=i.n()).done;){var o=r.value;o.parent&&o.parent.removeChild(o,"ignore")}}catch(e){i.e(e)}finally{i.f()}}else if("root"===e.type&&"document"!==this.type){var s,a=Ie(e=e.nodes.slice(0));try{for(a.s();!(s=a.n()).done;){var l=s.value;l.parent&&l.parent.removeChild(l,"ignore")}}catch(e){a.e(e)}finally{a.f()}}else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new p(e)]}else if(e.selector)e=[new c(e)];else if(e.name)e=[new d(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new m(e)]}return e.map(function(e){return e[h]||v.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[f]&&function e(t){if(t[f]=!1,t.proxyOf.nodes){var n,r=Ie(t.proxyOf.nodes);try{for(r.s();!(n=r.n()).done;)e(n.value)}catch(e){r.e(e)}finally{r.f()}}}(e),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/\S/g,"")),e.parent=n.proxyOf,e})}},{key:"prepend",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,i=Ie(t=t.reverse());try{for(i.s();!(r=i.n()).done;){var o,s,a=r.value,l=this.normalize(a,this.first,"prepend").reverse(),u=Ie(l);try{for(u.s();!(o=u.n()).done;){var c=o.value;this.proxyOf.nodes.unshift(c)}}catch(e){u.e(e)}finally{u.f()}for(s in this.indexes)this.indexes[s]=this.indexes[s]+l.length}}catch(e){i.e(e)}finally{i.f()}return this.markDirty(),this}},{key:"push",value:function(e){return(e.parent=this).proxyOf.nodes.push(e),this}},{key:"removeAll",value:function(){var e,t=Ie(this.proxyOf.nodes);try{for(t.s();!(e=t.n()).done;)e.value.parent=void 0}catch(e){t.e(e)}finally{t.f()}return this.proxyOf.nodes=[],this.markDirty(),this}},{key:"removeChild",value:function(e){var t,n;for(n in e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1),this.indexes)(t=this.indexes[n])>=e&&(this.indexes[n]=t-1);return this.markDirty(),this}},{key:"replaceValues",value:function(t,n,r){return r||(r=n,n={}),this.walkDecls(function(e){n.props&&!n.props.includes(e.prop)||n.fast&&!e.value.includes(n.fast)||(e.value=e.value.replace(t,r))}),this.markDirty(),this}},{key:"some",value:function(e){return this.nodes.some(e)}},{key:"walk",value:function(r){return this.each(function(t,e){var n;try{n=r(t,e)}catch(e){throw t.addToError(e)}return n=!1!==n&&t.walk?t.walk(r):n})}},{key:"walkAtRules",value:function(n,r){return r?n instanceof RegExp?this.walk(function(e,t){if("atrule"===e.type&&n.test(e.name))return r(e,t)}):this.walk(function(e,t){if("atrule"===e.type&&e.name===n)return r(e,t)}):(r=n,this.walk(function(e,t){if("atrule"===e.type)return r(e,t)}))}},{key:"walkComments",value:function(n){return this.walk(function(e,t){if("comment"===e.type)return n(e,t)})}},{key:"walkDecls",value:function(n,r){return r?n instanceof RegExp?this.walk(function(e,t){if("decl"===e.type&&n.test(e.prop))return r(e,t)}):this.walk(function(e,t){if("decl"===e.type&&e.prop===n)return r(e,t)}):(r=n,this.walk(function(e,t){if("decl"===e.type)return r(e,t)}))}},{key:"walkRules",value:function(n,r){return r?n instanceof RegExp?this.walk(function(e,t){if("rule"===e.type&&n.test(e.selector))return r(e,t)}):this.walk(function(e,t){if("rule"===e.type&&e.selector===n)return r(e,t)}):(r=n,this.walk(function(e,t){if("rule"===e.type)return r(e,t)}))}},{key:"first",get:function(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}},{key:"last",get:function(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}])).registerParse=function(e){u=e},n.registerRule=function(e){c=e},n.registerAtRule=function(e){d=e},n.registerRoot=function(e){t=e},((xs=n).default=n).rebuild=function(e){"atrule"===e.type?Object.setPrototypeOf(e,d.prototype):"rule"===e.type?Object.setPrototypeOf(e,c.prototype):"decl"===e.type?Object.setPrototypeOf(e,p.prototype):"comment"===e.type?Object.setPrototypeOf(e,m.prototype):"root"===e.type&&Object.setPrototypeOf(e,t.prototype),e[h]=!0,e.nodes&&e.nodes.forEach(function(e){n.rebuild(e)})}),xs;function v(){return b(this,v),Bi(this,v,arguments)}}function ja(){var t,n,e;return As||(As=1,qi(r,Ba()),(e=k(r,[{key:"toResult",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new t(new n,this,e).stringify()}}])).registerLazyResult=function(e){t=e},e.registerProcessor=function(e){n=e},(Is=e).default=e),Is;function r(e){return b(this,r),(e=Bi(this,r,[Ae({type:"document"},e)])).nodes||(e.nodes=[]),e}}function Wa(){if(Ds)return Ps;Ds=1;var t={};return Ps=function(e){t[e]||(t[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))}}function Ha(){var e;return Ns||(Ns=1,e=k(function e(t){var n,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};for(n in b(this,e),this.type="warning",this.text=t,r.node&&r.node.source&&(t=r.node.rangeBy(r),this.line=t.start.line,this.column=t.start.column,this.endLine=t.end.line,this.endColumn=t.end.column),r)this[n]=r[n]},[{key:"toString",value:function(){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}}]),(Ls=e).default=e),Ls}function qa(){var n,e;return Us||(Us=1,n=Ha(),e=k(function e(t,n,r){b(this,e),this.processor=t,this.messages=[],this.root=n,this.opts=r,this.css=void 0,this.map=void 0},[{key:"toString",value:function(){return this.css}},{key:"warn",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},e=(t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin),new n(e,t));return this.messages.push(e),e}},{key:"warnings",value:function(){return this.messages.filter(function(e){return"warning"===e.type})}},{key:"content",get:function(){return this.css}}]),(Fs=e).default=e),Fs}function Va(){var e,t;return Ws||(Ws=1,qi(r,e=Ba()),t=k(r,[{key:"append",value:function(){this.proxyOf.nodes||(this.nodes=[]);for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Yi(r,"append",this,3)(t)}},{key:"prepend",value:function(){this.proxyOf.nodes||(this.nodes=[]);for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Yi(r,"prepend",this,3)(t)}}]),(js=t).default=t,e.registerAtRule(t)),js;function r(e){return b(this,r),(e=Bi(this,r,[e])).type="atrule",e}}function Ga(){var t,n,e,r;return qs||(qs=1,qi(s,e=Ba()),(r=k(s,[{key:"normalize",value:function(e,t,n){var r=Yi(s,"normalize",this,3)([e]);if(t)if("prepend"===n)1<this.nodes.length?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t){var i,o=Ie(r);try{for(o.s();!(i=o.n()).done;)i.value.raws.before=t.raws.before}catch(e){o.e(e)}finally{o.f()}}return r}},{key:"removeChild",value:function(e,t){var n=this.index(e);return!t&&0===n&&1<this.nodes.length&&(this.nodes[1].raws.before=this.nodes[n].raws.before),Yi(s,"removeChild",this,3)([e])}},{key:"toResult",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new t(new n,this,e).stringify()}}])).registerLazyResult=function(e){t=e},r.registerProcessor=function(e){n=e},Hs=r,e.registerRoot(r.default=r)),Hs;function s(e){return b(this,s),(e=Bi(this,s,[e])).type="root",e.nodes||(e.nodes=[]),e}}function Za(){var t;return Gs||(Gs=1,(Vs=t={comma:function(e){return t.split(e,[","],!0)},space:function(e){return t.split(e,[" ","\n","\t"])},split:function(e,t,n){var r,i=[],o="",s=!1,a=0,l=!1,u="",c=!1,d=Ie(e);try{for(d.s();!(r=d.n()).done;){var f=r.value;c?c=!1:"\\"===f?c=!0:l?f===u&&(l=!1):'"'===f||"'"===f?(l=!0,u=f):"("===f?a+=1:")"===f?0<a&&--a:0===a&&t.includes(f)&&(s=!0),s?(""!==o&&i.push(o.trim()),o="",s=!1):o+=f}}catch(e){d.e(e)}finally{d.f()}return!n&&""===o||i.push(o.trim()),i}}).default=t),Vs}function Ja(){var e,t,n;return Js||(Js=1,e=Ba(),t=Za(),qi(r,e),n=k(r,[{key:"selectors",get:function(){return t.comma(this.selector)},set:function(e){var t=this.selector?this.selector.match(/,\s*/):null,t=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(t)}}]),(Zs=n).default=n,e.registerRule(n)),Zs;function r(e){return b(this,r),(e=Bi(this,r,[e])).type="rule",e.nodes||(e.nodes=[]),e}}function Ka(){var e,r,i;return Ys||(Ys=1,e=Ba(),r=(()=>{if($s)return Ks;$s=1;var p=La(),e=(()=>{if(Bs)return zs;Bs=1;var w="'".charCodeAt(0),b='"'.charCodeAt(0),k="\\".charCodeAt(0),_="/".charCodeAt(0),S="\n".charCodeAt(0),E=" ".charCodeAt(0),C="\f".charCodeAt(0),R="\t".charCodeAt(0),T="\r".charCodeAt(0),O="[".charCodeAt(0),x="]".charCodeAt(0),M="(".charCodeAt(0),I=")".charCodeAt(0),A="{".charCodeAt(0),P="}".charCodeAt(0),D=";".charCodeAt(0),L="*".charCodeAt(0),N=":".charCodeAt(0),F="@".charCodeAt(0),U=/[\t\n\f\r "#'()/;[\\\]{}]/g,z=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,B=/.[\r\n"'(/\\]/,j=/[\da-f]/i;return zs=function(t){var r,i,o,s,a,l,u,c,d,e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},f=t.css.valueOf(),h=e.ignoreErrors,p=f.length,m=0,v=[],g=[];function y(e){throw t.error("Unclosed "+e,m)}return{back:function(e){g.push(e)},endOfFile:function(){return 0===g.length&&p<=m},nextToken:function(e){if(g.length)return g.pop();if(!(p<=m)){var t=!!e&&e.ignoreUnclosed;switch(r=f.charCodeAt(m)){case S:case E:case R:case T:case C:for(i=m;i+=1,(r=f.charCodeAt(i))===E||r===S||r===R||r===T||r===C;);d=["space",f.slice(m,i)],m=i-1;break;case O:case x:case A:case P:case N:case D:case I:var n=String.fromCharCode(r);d=[n,n,m];break;case M:if(u=v.length?v.pop()[1]:"",c=f.charCodeAt(m+1),"url"===u&&c!==w&&c!==b&&c!==E&&c!==S&&c!==R&&c!==C&&c!==T){i=m;do{if(a=!1,-1===(i=f.indexOf(")",i+1))){if(h||t){i=m;break}y("bracket")}for(l=i;f.charCodeAt(l-1)===k;)--l,a=!a}while(a);d=["brackets",f.slice(m,i+1),m,i],m=i}else i=f.indexOf(")",m+1),u=f.slice(m,i+1),-1===i||B.test(u)?d=["(","(",m]:(d=["brackets",u,m,i],m=i);break;case w:case b:o=r===w?"'":'"',i=m;do{if(a=!1,-1===(i=f.indexOf(o,i+1))){if(h||t){i=m+1;break}y("string")}for(l=i;f.charCodeAt(l-1)===k;)--l,a=!a}while(a);d=["string",f.slice(m,i+1),m,i],m=i;break;case F:U.lastIndex=m+1,U.test(f),i=0===U.lastIndex?f.length-1:U.lastIndex-2,d=["at-word",f.slice(m,i+1),m,i],m=i;break;case k:for(i=m,s=!0;f.charCodeAt(i+1)===k;)i+=1,s=!s;if(r=f.charCodeAt(i+1),s&&r!==_&&r!==E&&r!==S&&r!==R&&r!==T&&r!==C&&(i+=1,j.test(f.charAt(i)))){for(;j.test(f.charAt(i+1));)i+=1;f.charCodeAt(i+1)===E&&(i+=1)}d=["word",f.slice(m,i+1),m,i],m=i;break;default:m=(r===_&&f.charCodeAt(m+1)===L?(0===(i=f.indexOf("*/",m+2)+1)&&(h||t?i=f.length:y("comment")),d=["comment",f.slice(m,i+1),m,i]):(z.lastIndex=m+1,z.test(f),i=0===z.lastIndex?f.length-1:z.lastIndex-2,d=["word",f.slice(m,i+1),m,i],v.push(d)),i)}return m++,d}},position:function(){return m}}}})(),n=za(),u=Va(),r=Ga(),i=Ja(),f={empty:!0,space:!0};return Ks=k(function e(t){b(this,e),this.input=t,this.root=new r,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{column:1,line:1,offset:0}}},[{key:"atrule",value:function(e){var t,n,r,i=new u;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);for(var o=!1,s=!1,a=[],l=[];!this.tokenizer.endOfFile();){if("("===(t=(e=this.tokenizer.nextToken())[0])||"["===t?l.push("("===t?")":"]"):"{"===t&&0<l.length?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(0<a.length){for(n=a[r=a.length-1];n&&"space"===n[0];)n=a[--r];n&&(i.source.end=this.getPosition(n[3]||n[2]),i.source.end.offset++)}this.end(e);break}}if(a.push(e),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)}},{key:"checkMissedSemicolon",value:function(e){var t=this.colon(e);if(!1!==t){for(var n,r=0,i=t-1;0<=i&&("space"===(n=e[i])[0]||2!==(r+=1));i--);throw this.input.error("Missed semicolon","word"===n[0]?n[3]+1:n[2])}}},{key:"colon",value:function(e){var t,n,r,i,o=0,s=Ie(e.entries());try{for(s.s();!(i=s.n()).done;){var a=Pe(i.value,2),l=a[0];if("("===(n=(t=a[1])[0])&&(o+=1),")"===n&&--o,0===o&&":"===n){if(r){if("word"===r[0]&&"progid"===r[1])continue;return l}this.doubleColon(t)}r=t}}catch(e){s.e(e)}finally{s.f()}return!1}},{key:"comment",value:function(e){var t=new n,e=(this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,e[1].slice(2,-2));/^\s*$/.test(e)?(t.text="",t.raws.left=e,t.raws.right=""):(e=e.match(/^(\s*)([^]*\S)(\s*)$/),t.text=e[2],t.raws.left=e[1],t.raws.right=e[3])}},{key:"createTokenizer",value:function(){this.tokenizer=e(this.input)}},{key:"decl",value:function(e,t){var n=new p;this.init(n,e[0][2]);var r,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(i[3]||i[2]||(e=>{for(var t=e.length-1;0<=t;t--){var n=e[t],n=n[3]||n[2];if(n)return n}})(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){var o=e[0][0];if(":"===o||"space"===o||"comment"===o)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(":"===(r=e.shift())[0]){n.raws.between+=r[1];break}"word"===r[0]&&/\w/.test(r[1])&&this.unknownWord([r]),n.raws.between+=r[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));for(var s,a=[];e.length&&("space"===(s=e[0][0])||"comment"===s);)a.push(e.shift());this.precheckMissedSemicolon(e);for(var l=e.length-1;0<=l;l--){if("!important"===(r=e[l])[1].toLowerCase()){n.important=!0;var u=this.stringFrom(e,l);" !important"!==(u=this.spacesFromEnd(e)+u)&&(n.raws.important=u);break}if("important"===r[1].toLowerCase()){for(var c=e.slice(0),d="",f=l;0<f;f--){var h=c[f][0];if(0===d.trim().indexOf("!")&&"space"!==h)break;d=c.pop()[1]+d}0===d.trim().indexOf("!")&&(n.important=!0,n.raws.important=d,e=c)}if("space"!==r[0]&&"comment"!==r[0])break}e.some(function(e){return"space"!==e[0]&&"comment"!==e[0]})&&(n.raws.between+=a.map(function(e){return e[1]}).join(""),a=[]),this.raw(n,"value",a.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}},{key:"doubleColon",value:function(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}},{key:"emptyRule",value:function(e){var t=new i;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}},{key:"end",value:function(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)}},{key:"endFile",value:function(){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())}},{key:"freeSemicolon",value:function(e){this.spaces+=e[1],this.current.nodes&&(e=this.current.nodes[this.current.nodes.length-1])&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}},{key:"getPosition",value:function(e){var t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}},{key:"init",value:function(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)}},{key:"other",value:function(e){for(var t,n=!1,r=!1,i=null,o=[],s=e[1].startsWith("--"),a=[],l=e;l;){if(t=l[0],a.push(l),"("===t||"["===t)i=i||l,o.push("("===t?")":"]");else if(s&&r&&"{"===t)i=i||l,o.push("}");else if(0===o.length){if(";"===t){if(r)return void this.decl(a,s);break}if("{"===t)return void this.rule(a);if("}"===t){this.tokenizer.back(a.pop()),n=!0;break}":"===t&&(r=!0)}else t===o[o.length-1]&&(o.pop(),0===o.length)&&(i=null);l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(n=!0),0<o.length&&this.unclosedBracket(i),n&&r){if(!s)for(;a.length&&("space"===(l=a[a.length-1][0])||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,s)}else this.unknownWord(a)}},{key:"parse",value:function(){for(var e;!this.tokenizer.endOfFile();)switch((e=this.tokenizer.nextToken())[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()}},{key:"precheckMissedSemicolon",value:function(){}},{key:"raw",value:function(e,t,n,r){for(var i,o,s,a,l=n.length,u="",c=!0,d=0;d<l;d+=1)"space"===(s=(i=n[d])[0])&&d===l-1&&!r||"comment"===s&&(s=n[d-1]?n[d-1][0]:"empty",o=n[d+1]?n[d+1][0]:"empty",f[s]||f[o]||","===u.slice(-1))?c=!1:u+=i[1];c||(a=n.reduce(function(e,t){return e+t[1]},""),e.raws[t]={raw:a,value:u}),e[t]=u}},{key:"rule",value:function(e){e.pop();var t=new i;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}},{key:"spacesAndCommentsFromEnd",value:function(e){for(var t,n="";e.length&&("space"===(t=e[e.length-1][0])||"comment"===t);)n=e.pop()[1]+n;return n}},{key:"spacesAndCommentsFromStart",value:function(e){for(var t,n="";e.length&&("space"===(t=e[0][0])||"comment"===t);)n+=e.shift()[1];return n}},{key:"spacesFromEnd",value:function(e){for(var t="";e.length&&"space"===e[e.length-1][0];)t=e.pop()[1]+t;return t}},{key:"stringFrom",value:function(e,t){for(var n="",r=t;r<e.length;r++)n+=e[r][1];return e.splice(t,e.length-t),n}},{key:"unclosedBlock",value:function(){var e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}},{key:"unclosedBracket",value:function(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}},{key:"unexpectedClose",value:function(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}},{key:"unknownWord",value:function(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}},{key:"unnamedAtrule",value:function(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}}])})(),i=Fa(),Xs=t,e.registerParse(t.default=t)),Xs;function t(e,t){var n=new i(e,t),n=new r(n);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}}function $a(){var d,a,n,r,l,e,i,u,c,t,o,f,h,p,s,m;return ea||(ea=1,e=Ia(),d=e.isClean,a=e.my,n=Ua(),r=Pa(),l=Ba(),e=ja(),i=Wa(),u=qa(),c=Ka(),t=Ga(),o={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},f={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},h={Once:!0,postcssPlugin:!0,prepare:!0},p={},(s=k(function e(t,n,r){var i,o=this;if(b(this,e),this.stringified=!1,this.processed=!1,"object"!==_(n)||null===n||"root"!==n.type&&"document"!==n.type)if(n instanceof e||n instanceof u)i=w(n.root),n.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{var s=c;r.syntax&&(s=r.syntax.parse),(s=r.parser?r.parser:s).parse&&(s=s.parse);try{i=s(n,r)}catch(e){this.processed=!0,this.error=e}i&&!i[a]&&l.rebuild(i)}else i=w(n);this.result=new u(t,i,r),this.helpers=Ae(Ae({},p),{},{postcss:p,result:this.result}),this.plugins=this.processor.plugins.map(function(e){return"object"===_(e)&&e.prepare?Ae(Ae({},e),e.prepare(o.result)):e})},[{key:"async",value:function(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}},{key:"catch",value:function(e){return this.async().catch(e)}},{key:"finally",value:function(e){return this.async().then(e,e)}},{key:"getAsyncError",value:function(){throw new Error("Use process(css).then(cb) to work with async plugins")}},{key:"handleError",value:function(e,t){var n,r,i,o,s,a=this.result.lastPlugin;try{t&&t.addToError(e),"CssSyntaxError"!==(this.error=e).name||e.plugin?a.postcssVersion&&"production"!==process.env.NODE_ENV&&(n=a.postcssPlugin,r=a.postcssVersion,i=this.result.processor.version,o=r.split("."),s=i.split("."),o[0]!==s[0]||parseInt(o[1])>parseInt(s[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+i+", but "+n+" uses "+r+". Perhaps this is the source of the error below."):(e.plugin=a.postcssPlugin,e.setMessage())}catch(e){console&&console.error&&console.error(e)}return e}},{key:"prepareVisitors",value:function(){var r=this;this.listeners={};function e(e,t,n){r.listeners[t]||(r.listeners[t]=[]),r.listeners[t].push([e,n])}var t,n=Ie(this.plugins);try{for(n.s();!(t=n.n()).done;){var i=t.value;if("object"===_(i))for(var o in i){if(!f[o]&&/^[A-Z]/.test(o))throw new Error("Unknown event ".concat(o," in ").concat(i.postcssPlugin,". Try to update PostCSS (").concat(this.processor.version," now)."));if(!h[o])if("object"===_(i[o]))for(var s in i[o])e(i,"*"===s?o:o+"-"+s.toLowerCase(),i[o][s]);else"function"==typeof i[o]&&e(i,o,i[o])}}}catch(r){n.e(r)}finally{n.f()}this.hasListener=0<Object.keys(this.listeners).length}},{key:"runAsync",value:(m=zi(Ji().m(function e(){var t,i,n,r,o,s,a,l,u,c=this;return Ji().w(function(e){for(;;)switch(e.p=e.n){case 0:this.plugin=0,t=0;case 1:if(t<this.plugins.length){if(a=this.plugins[t],v(a=this.runOnRoot(a)))return e.p=2,e.n=3,a;e.n=5}else e.n=6;break;case 3:e.n=5;break;case 4:throw e.p=4,a=e.v,this.handleError(a);case 5:t++,e.n=1;break;case 6:if(this.prepareVisitors(),!this.hasListener){e.n=21;break}i=this.result.root;case 7:if(i[d]){e.n=14;break}i[d]=!0,n=[y(i)];case 8:if(0<n.length){if(v(l=this.visitTick(n)))return e.p=9,e.n=10,l;e.n=12}else e.n=13;break;case 10:e.n=12;break;case 11:throw e.p=11,l=e.v,u=n[n.length-1].node,this.handleError(l,u);case 12:e.n=8;break;case 13:e.n=7;break;case 14:if(!this.listeners.OnceExit){e.n=21;break}r=Ie(this.listeners.OnceExit),e.p=15,s=Ji().m(function e(){var t,n,r;return Ji().w(function(e){for(;;)switch(e.p=e.n){case 0:if(n=Pe(o.value,2),r=n[0],t=n[1],c.result.lastPlugin=r,e.p=1,"document"===i.type)return n=i.nodes.map(function(e){return t(e,c.helpers)}),e.n=2,Promise.all(n);e.n=3;break;case 2:e.n=4;break;case 3:return e.n=4,t(i,c.helpers);case 4:e.n=6;break;case 5:throw e.p=5,r=e.v,c.handleError(r);case 6:return e.a(2)}},e,null,[[1,5]])}),r.s();case 16:if((o=r.n()).done){e.n=18;break}return e.d($i(s()),17);case 17:e.n=16;break;case 18:e.n=20;break;case 19:e.p=19,u=e.v,r.e(u);case 20:return e.p=20,r.f(),e.f(20);case 21:return this.processed=!0,e.a(2,this.stringify())}},e,this,[[15,19,20,21],[9,11],[2,4]])})),function(){return m.apply(this,arguments)})},{key:"runOnRoot",value:function(t){var e,n=this;this.result.lastPlugin=t;try{return"object"===_(t)&&t.Once?"document"===this.result.root.type?v((e=this.result.root.nodes.map(function(e){return t.Once(e,n.helpers)}))[0])?Promise.all(e):e:t.Once(this.result.root,this.helpers):"function"==typeof t?t(this.result.root,this.result):void 0}catch(t){throw this.handleError(t)}}},{key:"stringify",value:function(){if(this.error)throw this.error;var e,t;return this.stringified||(this.stringified=!0,this.sync(),t=this.result.opts,e=r,t.syntax&&(e=t.syntax.stringify),(e=t.stringifier?t.stringifier:e).stringify&&(e=e.stringify),t=new n(e,this.result.root,this.result.opts).generate(),this.result.css=t[0],this.result.map=t[1]),this.result}},{key:"sync",value:function(){if(this.error)throw this.error;if(!this.processed){if(this.processed=!0,this.processing)throw this.getAsyncError();var e,t=Ie(this.plugins);try{for(t.s();!(e=t.n()).done;){var n=e.value;if(v(this.runOnRoot(n)))throw this.getAsyncError()}}catch(e){t.e(e)}finally{t.f()}if(this.prepareVisitors(),this.hasListener){for(var r=this.result.root;!r[d];)r[d]=!0,this.walkSync(r);if(this.listeners.OnceExit)if("document"===r.type){var i,o=Ie(r.nodes);try{for(o.s();!(i=o.n()).done;){var s=i.value;this.visitSync(this.listeners.OnceExit,s)}}catch(e){o.e(e)}finally{o.f()}}else this.visitSync(this.listeners.OnceExit,r)}}return this.result}},{key:"then",value:function(e,t){return"production"===process.env.NODE_ENV||"from"in this.opts||i("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)}},{key:"toString",value:function(){return this.css}},{key:"visitSync",value:function(e,t){var n,r=Ie(e);try{for(r.s();!(n=r.n()).done;){var i=Pe(n.value,2),o=i[0],s=i[1],a=(this.result.lastPlugin=o,void 0);try{a=s(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(v(a))throw this.getAsyncError()}}catch(e){r.e(e)}finally{r.f()}}},{key:"visitTick",value:function(e){var t=e[e.length-1],n=t.node,r=t.visitors;if("root"===n.type||"document"===n.type||n.parent){if(0<r.length&&t.visitorIndex<r.length){var i=Pe(r[t.visitorIndex],2),o=i[0],i=i[1];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=o;try{return i(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==t.iterator){for(var s,a=t.iterator;s=n.nodes[n.indexes[a]];)if(n.indexes[a]+=1,!s[d])return s[d]=!0,void e.push(y(s));t.iterator=0,delete n.indexes[a]}for(var l=t.events;t.eventIndex<l.length;){var u=l[t.eventIndex];if(t.eventIndex+=1,0===u)return void(n.nodes&&n.nodes.length&&(n[d]=!0,t.iterator=n.getIterator()));if(this.listeners[u])return void(t.visitors=this.listeners[u])}}e.pop()}},{key:"walkSync",value:function(e){var t=this;e[d]=!0;var n,r=Ie(g(e));try{for(r.s();!(n=r.n()).done;){var i=n.value;if(0===i)e.nodes&&e.each(function(e){e[d]||t.walkSync(e)});else{var o=this.listeners[i];if(o&&this.visitSync(o,e.toProxy()))return}}}catch(e){r.e(e)}finally{r.f()}}},{key:"warnings",value:function(){return this.sync().warnings()}},{key:"content",get:function(){return this.stringify().content}},{key:"css",get:function(){return this.stringify().css}},{key:"map",get:function(){return this.stringify().map}},{key:"messages",get:function(){return this.sync().messages}},{key:"opts",get:function(){return this.result.opts}},{key:"processor",get:function(){return this.result.processor}},{key:"root",get:function(){return this.sync().root}},{key:Symbol.toStringTag,get:function(){return"LazyResult"}}])).registerPostcss=function(e){p=e},Qs=s,t.registerLazyResult(s.default=s),e.registerLazyResult(s)),Qs;function v(e){return"object"===_(e)&&"function"==typeof e.then}function g(e){var t=!1,n=o[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,0,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,0,n+"Exit"]:[n,n+"Exit"]}function y(e){return{eventIndex:0,events:"document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:g(e),iterator:0,node:e,visitorIndex:0,visitors:[]}}function w(e){return e[d]=!1,e.nodes&&e.nodes.forEach(w),e}}function Xa(e,t){if(Array.isArray(e))return e.map(function(e){return Xa(e)});var n,r=e.inputs,i=Zi(e,io);if(r){t=[];var o,s=Ie(r);try{for(s.s();!(o=s.n()).done;){var a=Ae(Ae({},o.value),{},{__proto__:ga.prototype});a.map&&(a.map=Ae(Ae({},a.map),{},{__proto__:pa.prototype})),t.push(a)}}catch(e){s.e(e)}finally{s.f()}}if(i.nodes&&(i.nodes=e.nodes.map(function(e){return Xa(e,t)})),i.source&&(n=(r=i.source).inputId,r=Zi(r,oo),i.source=r,null!=n)&&(i.source.input=t[n]),"root"===i.type)return new ya(i);if("decl"===i.type)return new ha(i);if("rule"===i.type)return new wa(i);if("comment"===i.type)return new ma(i);if("atrule"===i.type)return new va(i);throw new Error("Unknown node type: "+e.type)}function o(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 1===t.length&&Array.isArray(t[0])&&(t=t[0]),new oa(t)}function Ya(e,t,n){e=e,t="symbol"!==_(t)?t+"":t,n=n,t in e?Qa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}em||(em=1,i=us(),ia=La(),em=$a(),ru=Ba(),am||(am=1,a||(a=1,Ea=Ua(),Ca=Pa(),Ra=Wa(),Ta=Ka(),Oa=qa(),xa=k(function e(t,n,r){b(this,e),n=n.toString(),this.stringified=!1,this._processor=t,this._css=n,this._opts=r,this._map=void 0;var t=Ca,i=(this.result=new Oa(this._processor,void 0,this._opts),this.result.css=n,this),r=(Object.defineProperty(this.result,"root",{get:function(){return i.root}}),new Ea(t,void 0,this._opts,n));r.isMap()?(n=(t=Pe(r.generate(),2))[0],t=t[1],n&&(this.result.css=n),t&&(this.result.map=t)):(r.clearAnnotation(),this.result.css=r.css)},[{key:"async",value:function(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}},{key:"catch",value:function(e){return this.async().catch(e)}},{key:"finally",value:function(e){return this.async().then(e,e)}},{key:"sync",value:function(){if(this.error)throw this.error;return this.result}},{key:"then",value:function(e,t){return"production"===process.env.NODE_ENV||"from"in this._opts||Ra("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)}},{key:"toString",value:function(){return this._css}},{key:"warnings",value:function(){return[]}},{key:"content",get:function(){return this.result.css}},{key:"css",get:function(){return this.result.css}},{key:"map",get:function(){return this.result.map}},{key:"messages",get:function(){return[]}},{key:"opts",get:function(){return this.result.opts}},{key:"processor",get:function(){return this.result.processor}},{key:"root",get:function(){if(this._root)return this._root;var e,t=Ta;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e}},{key:Symbol.toStringTag,get:function(){return"NoWorkResult"}}]),(ta=xa).default=xa),ba=ta,ka=$a(),xa=ja(),_a=Ga(),Sa=k(function e(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[];b(this,e),this.version="8.4.38",this.plugins=this.normalize(t)},[{key:"normalize",value:function(e){var t,n=[],r=Ie(e);try{for(r.s();!(t=r.n()).done;){var i=t.value;if(!0===i.postcss?i=i():i.postcss&&(i=i.postcss),"object"===_(i)&&Array.isArray(i.plugins))n=n.concat(i.plugins);else if("object"===_(i)&&i.postcssPlugin)n.push(i);else if("function"==typeof i)n.push(i);else{if("object"!==_(i)||!i.parse&&!i.stringify)throw new Error(i+" 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.")}}}catch(e){r.e(e)}finally{r.f()}return n}},{key:"process",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return new(this.plugins.length||t.parser||t.stringifier||t.syntax?ka:ba)(this,e,t)}},{key:"use",value:function(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}]),(na=Sa).default=Sa,_a.registerProcessor(Sa),xa.registerProcessor(Sa)),oa=na,_a=Pa(),f||(f=1,ha=La(),pa=Na(),ma=za(),va=Va(),ga=Fa(),ya=Ga(),wa=Ja(),(ra=Xa).default=Xa),Sa=ra,sa=ja(),am=Ha(),aa=za(),la=Va(),a=qa(),f=Fa(),ua=Ka(),ca=Za(),da=Ja(),fa=Ga(),uu=Da(),o.plugin=function(t,n){var e,r=!1;function i(){console&&console.warn&&!r&&(r=!0,console.warn(t+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG)&&process.env.LANG.startsWith("cn")&&console.warn(t+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226");var e=n.apply(void 0,arguments);return e.postcssPlugin=t,e.postcssVersion=(new oa).version,e}return Object.defineProperty(i,"postcss",{get:function(){return e=e||i()}}),i.process=function(e,t,n){return o([i(n)]).process(e,t)},i},o.stringify=_a,o.parse=ua,o.fromJSON=Sa,o.list=ca,o.comment=function(e){return new aa(e)},o.atRule=function(e){return new la(e)},o.decl=function(e){return new ia(e)},o.rule=function(e){return new da(e)},o.root=function(e){return new fa(e)},o.document=function(e){return new sa(e)},o.CssSyntaxError=i,o.Declaration=ia,o.Container=ru,o.Processor=oa,o.Document=sa,o.Comment=aa,o.Warning=am,o.AtRule=la,o.Result=a,o.Input=f,o.Rule=da,o.Root=fa,o.Node=uu,em.registerPostcss(o),(ua=o).default=o),(i=(ca=ua)&&ca.__esModule&&Object.prototype.hasOwnProperty.call(ca,"default")?ca.default:ca).stringify;var Qa=Object.defineProperty;Date.now().toString();var el,tl,nl,rl,il,ol,sl={exports:{}},p=(rl=Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"}))).__esModule?rl:("function"==typeof(il=rl.default)?(ol=function e(){return this instanceof e?Reflect.construct(il,arguments,this.constructor):il.apply(this,arguments)}).prototype=il.prototype:ol={},Object.defineProperty(ol,"__esModule",{value:!0}),Object.keys(rl).forEach(function(e){var t=Object.getOwnPropertyDescriptor(rl,e);Object.defineProperty(ol,e,t.get?t:{enumerable:!0,get:function(){return rl[e]}})}),ol);function al(){var d,f,e,t;return nl||(nl=1,el||(el=1,e=String,sl.exports=(t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}})(),sl.exports.createColors=t),d=sl.exports,f=p,qi(a,no(Error)),t=k(a,[{key:"setMessage",value:function(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file||"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}},{key:"showSourceCode",value:function(e){var r=this;if(!this.source)return"";var t=this.source;null==e&&(e=d.isColorSupported);var n,i,o,s,a,t=(t=f&&e?f(t):t).split(/\r?\n/),l=Math.max(this.line-3,0),u=Math.min(this.line+2,t.length),c=String(u).length;return e?(e=d.createColors(!0),n=e.bold,i=e.gray,o=e.red,s=function(e){return n(o(e))},a=function(e){return i(e)}):s=a=function(e){return e},t.slice(l,u).map(function(e,t){var t=l+1+t,n=" "+(" "+t).slice(-c)+" | ";return t===r.line?(t=a(n.replace(/\d/g," "))+e.slice(0,r.column-1).replace(/[^\t]/g," "),s(">")+a(n)+e+"\n "+t+s("^")):" "+a(n)+e}).join("\n")}},{key:"toString",value:function(){var e=(e=this.showSourceCode())&&"\n\n"+e+"\n";return this.name+": "+this.message+e}}]),(tl=t).default=t),tl;function a(e,t,n,r,i,o){var s;return b(this,a),(s=Bi(this,a,[e])).name="CssSyntaxError",s.reason=e,i&&(s.file=i),r&&(s.source=r),o&&(s.plugin=o),void 0!==t&&void 0!==n&&("number"==typeof t?(s.line=t,s.column=n):(s.line=t.line,s.column=t.column,s.endLine=n.line,s.endColumn=n.column)),s.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(s,a),s}}var ll,ul,cl,dl,fl,hl,pl,ml,vl,gl,yl,wl,bl,kl,_l,Sl,El,Cl,Rl,Tl,Ol,xl,Ml,Il,Al,Pl,Dl,Ll,Nl,Fl,Ul,zl,Bl,jl,Wl,Hl,ql,Vl,Gl,Zl,Jl,Kl,$l,Xl,Yl,Ql,eu,tu,nu,ru,iu,ou,su,au,lu,uu,cu,du,fu,hu,pu,mu,vu,gu,yu,wu,bu,ku,_u,Su,Eu,Cu,Ru,Tu,Ou,xu={};function Mu(){return ll||(ll=1,xu.isClean=Symbol("isClean"),xu.my=Symbol("my")),xu}function Iu(){var s,e;return cl||(s={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!(cl=1)},e=k(function e(t){b(this,e),this.builder=t},[{key:"atrule",value:function(e,t){var n="@"+e.name,r=e.params?this.rawValue(e,"params"):"";void 0!==e.raws.afterName?n+=e.raws.afterName:r&&(n+=" "),e.nodes?this.block(e,n+r):(t=(e.raws.between||"")+(t?";":""),this.builder(n+r+t,e))}},{key:"beforeAfter",value:function(e,t){for(var n="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"),r=e.parent,i=0;r&&"root"!==r.type;)i+=1,r=r.parent;if(n.includes("\n")){var o=this.raw(e,null,"indent");if(o.length)for(var s=0;s<i;s++)n+=o}return n}},{key:"block",value:function(e,t){var n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),(t=e.nodes&&e.nodes.length?(this.body(e),this.raw(e,"after")):this.raw(e,"after","emptyBody"))&&this.builder(t),this.builder("}",e,"end")}},{key:"body",value:function(e){for(var t=e.nodes.length-1;0<t&&"comment"===e.nodes[t].type;)--t;for(var n=this.raw(e,"semicolon"),r=0;r<e.nodes.length;r++){var i=e.nodes[r],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,t!==r||n)}}},{key:"comment",value:function(e){var t=this.raw(e,"left","commentLeft"),n=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+n+"*/",e)}},{key:"decl",value:function(e,t){var n=this.raw(e,"between","colon"),n=e.prop+n+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}},{key:"document",value:function(e){this.body(e)}},{key:"raw",value:function(e,t,n){var r;if(t&&void 0!==(r=e.raws[t]))return r;var i,o=e.parent;if("before"===(n=n||t)){if(!o||"root"===o.type&&o.first===e)return"";if(o&&"document"===o.type)return""}return o?((o=e.root()).rawCache||(o.rawCache={}),void 0!==o.rawCache[n]?o.rawCache[n]:"before"===n||"after"===n?this.beforeAfter(e,n):(this[i="raw"+((i=n)[0].toUpperCase()+i.slice(1))]?r=this[i](o,e):o.walk(function(e){if(void 0!==(r=e.raws[t]))return!1}),void 0===r&&(r=s[n]),o.rawCache[n]=r)):s[n]}},{key:"rawBeforeClose",value:function(e){var t;return e.walk(function(e){if(e.nodes&&0<e.nodes.length&&void 0!==e.raws.after)return(t=e.raws.after).includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t=t&&t.replace(/\S/g,"")}},{key:"rawBeforeComment",value:function(e,t){var n;return e.walkComments(function(e){if(void 0!==e.raws.before)return(n=e.raws.before).includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),n=void 0===n?this.raw(t,null,"beforeDecl"):n&&n.replace(/\S/g,"")}},{key:"rawBeforeDecl",value:function(e,t){var n;return e.walkDecls(function(e){if(void 0!==e.raws.before)return(n=e.raws.before).includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),n=void 0===n?this.raw(t,null,"beforeRule"):n&&n.replace(/\S/g,"")}},{key:"rawBeforeOpen",value:function(e){var t;return e.walk(function(e){if("decl"!==e.type&&void 0!==(t=e.raws.between))return!1}),t}},{key:"rawBeforeRule",value:function(t){var n;return t.walk(function(e){if(e.nodes&&(e.parent!==t||t.first!==e)&&void 0!==e.raws.before)return(n=e.raws.before).includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),n=n&&n.replace(/\S/g,"")}},{key:"rawColon",value:function(e){var t;return e.walkDecls(function(e){if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}},{key:"rawEmptyBody",value:function(e){var t;return e.walk(function(e){if(e.nodes&&0===e.nodes.length&&void 0!==(t=e.raws.after))return!1}),t}},{key:"rawIndent",value:function(n){return n.raws.indent||(n.walk(function(e){var t=e.parent;if(t&&t!==n&&t.parent&&t.parent===n&&void 0!==e.raws.before)return t=e.raws.before.split("\n"),r=(r=t[t.length-1]).replace(/\S/g,""),!1}),r);var r}},{key:"rawSemicolon",value:function(e){var t;return e.walk(function(e){if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&void 0!==(t=e.raws.semicolon))return!1}),t}},{key:"rawValue",value:function(e,t){var n=e[t],e=e.raws[t];return e&&e.value===n?e.raw:n}},{key:"root",value:function(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}},{key:"rule",value:function(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}},{key:"stringify",value:function(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)}}]),(ul=e).default=e),ul}function Au(){var n;return fl||(fl=1,n=Iu(),(dl=e).default=e),dl;function e(e,t){new n(t).stringify(e)}}function Pu(){var s,a,i,n,r,e;return pl||(pl=1,e=Mu(),s=e.isClean,a=e.my,i=al(),n=Iu(),r=Au(),e=k(function e(){var t,n=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};for(t in b(this,e),this.raws={},this[s]=!1,this[a]=!0,n)if("nodes"===t){this.nodes=[];var r,i=Ie(n[t]);try{for(i.s();!(r=i.n()).done;){var o=r.value;"function"==typeof o.clone?this.append(o.clone()):this.append(o)}}catch(e){i.e(e)}finally{i.f()}}else this[t]=n[t]},[{key:"addToError",value:function(e){var t;return e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)&&(t=this.source,e.stack=e.stack.replace(/\n\s{4}at /,"$&".concat(t.input.from,":").concat(t.start.line,":").concat(t.start.column,"$&"))),e}},{key:"after",value:function(e){return this.parent.insertAfter(this,e),this}},{key:"assign",value:function(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};for(e in t)this[e]=t[e];return this}},{key:"before",value:function(e){return this.parent.insertBefore(this,e),this}},{key:"cleanRaws",value:function(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}},{key:"clone",value:function(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},n=function t(e,n){var r,i,o,s=new e.constructor;for(r in e)Object.prototype.hasOwnProperty.call(e,r)&&"proxyCache"!==r&&(o=_(i=e[r]),"parent"===r&&"object"===o?n&&(s[r]=n):"source"===r?s[r]=i:Array.isArray(i)?s[r]=i.map(function(e){return t(e,s)}):("object"===o&&null!==i&&(i=t(i)),s[r]=i));return s}(this);for(e in t)n[e]=t[e];return n}},{key:"cloneAfter",value:function(){var e=this.clone(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{});return this.parent.insertAfter(this,e),e}},{key:"cloneBefore",value:function(){var e=this.clone(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{});return this.parent.insertBefore(this,e),e}},{key:"error",value:function(e){var t,n,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return this.source?(t=(n=this.rangeBy(r)).end,this.source.input.error(e,{column:(n=n.start).column,line:n.line},{column:t.column,line:t.line},r)):new i(e)}},{key:"getProxyProcessor",value:function(){return{get:function(e,t){return"proxyOf"===t?e:"root"===t?function(){return e.root().toProxy()}:e[t]},set:function(e,t,n){return e[t]!==n&&(e[t]=n,"prop"===t||"value"===t||"name"===t||"params"===t||"important"===t||"text"===t)&&e.markDirty(),!0}}}},{key:"markDirty",value:function(){if(this[s]){this[s]=!1;for(var e=this;e=e.parent;)e[s]=!1}}},{key:"next",value:function(){var e;if(this.parent)return e=this.parent.index(this),this.parent.nodes[e+1]}},{key:"positionBy",value:function(e,t){var n=this.source.start;return e.index?n=this.positionInside(e.index,t):e.word&&-1!==(e=(t=this.toString()).indexOf(e.word))&&(n=this.positionInside(e,t)),n}},{key:"positionInside",value:function(e,t){for(var n=t||this.toString(),r=this.source.start.column,i=this.source.start.line,o=0;o<e;o++)"\n"===n[o]?i+=r=1:r+=1;return{column:r,line:i}}},{key:"prev",value:function(){var e;if(this.parent)return e=this.parent.index(this),this.parent.nodes[e-1]}},{key:"rangeBy",value:function(e){var t,n,r={column:this.source.start.column,line:this.source.start.line},i=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:r.column+1,line:r.line};return e.word?-1!==(n=(t=this.toString()).indexOf(e.word))&&(r=this.positionInside(n,t),i=this.positionInside(n+e.word.length,t)):(e.start?r={column:e.start.column,line:e.start.line}:e.index&&(r=this.positionInside(e.index)),e.end?i={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?i=this.positionInside(e.endIndex):e.index&&(i=this.positionInside(e.index+1))),{end:i=i.line<r.line||i.line===r.line&&i.column<=r.column?{column:r.column+1,line:r.line}:i,start:r}}},{key:"raw",value:function(e,t){return(new n).raw(this,e,t)}},{key:"remove",value:function(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}},{key:"replaceWith",value:function(){if(this.parent){for(var e=this,t=!1,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];for(var o=0,s=r;o<s.length;o++){var a=s[o];a===this?t=!0:t?(this.parent.insertAfter(e,a),e=a):this.parent.insertBefore(e,a)}t||this.remove()}return this}},{key:"root",value:function(){for(var e=this;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}},{key:"toJSON",value:function(e,t){var n,r,i,o={},s=null==t,a=(t=t||new Map,0);for(n in this)Object.prototype.hasOwnProperty.call(this,n)&&"parent"!==n&&"proxyCache"!==n&&(r=this[n],Array.isArray(r)?o[n]=r.map(function(e){return"object"===_(e)&&e.toJSON?e.toJSON(null,t):e}):"object"===_(r)&&r.toJSON?o[n]=r.toJSON(null,t):"source"===n?(null==(i=t.get(r.input))&&(i=a,t.set(r.input,a),a++),o[n]={end:r.end,inputId:i,start:r.start}):o[n]=r);return s&&(o.inputs=Qi(t.keys()).map(function(e){return e.toJSON()})),o}},{key:"toProxy",value:function(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}},{key:"toString",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:r,t=(e.stringify&&(e=e.stringify),"");return e(this,function(e){t+=e}),t}},{key:"warn",value:function(e,t,n){var r,i={node:this};for(r in n)i[r]=n[r];return e.warn(t,i)}},{key:"proxyOf",get:function(){return this}}]),(hl=e).default=e),hl}function Du(){var e;return vl||(vl=1,qi(t,Pu()),e=k(t,[{key:"variable",get:function(){return this.prop.startsWith("--")||"$"===this.prop[0]}}]),(ml=e).default=e),ml;function t(e){return b(this,t),(e=Bi(this,t,[e=e&&void 0!==e.value&&"string"!=typeof e.value?Ae(Ae({},e),{},{value:String(e.value)}):e])).type="decl",e}}function Lu(){var r,i,t,n,o,s,e;return bl||(bl=1,r=p.SourceMapConsumer,i=p.SourceMapGenerator,t=p.existsSync,n=p.readFileSync,o=p.dirname,s=p.join,e=k(function e(t,n){b(this,e),!1!==n.map&&(this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:"),t=n.map?n.map.prev:void 0,t=this.loadMap(n.from,t),!this.mapFile&&n.from&&(this.mapFile=n.from),this.mapFile&&(this.root=o(this.mapFile)),t)&&(this.text=t)},[{key:"consumer",value:function(){return this.consumerCache||(this.consumerCache=new r(this.text)),this.consumerCache}},{key:"decodeInline",value:function(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=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+t)}},{key:"getAnnotationURL",value:function(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}},{key:"isMap",value:function(e){return"object"===_(e)&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}},{key:"loadAnnotation",value:function(e){var t,n=e.match(/\/\*\s*# sourceMappingURL=/gm);n&&(n=e.lastIndexOf(n.pop()),t=e.indexOf("*/",n),-1<n)&&-1<t&&(this.annotation=this.getAnnotationURL(e.substring(n,t)))}},{key:"loadFile",value:function(e){if(this.root=o(e),t(e))return this.mapFile=e,n(e,"utf-8").toString().trim()}},{key:"loadMap",value:function(e,t){if(!1===t)return!1;if(!t)return this.inline?this.decodeInline(this.annotation):this.annotation?(n=this.annotation,e&&(n=s(o(e),n)),this.loadFile(n)):void 0;if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof r)return i.fromSourceMap(t).toString();if(t instanceof i)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}var n=t(e);if(n){t=this.loadFile(n);if(t)return t;throw new Error("Unable to load previous source map: "+n.toString())}}},{key:"startWith",value:function(e,t){return!!e&&e.substr(0,t.length)===t}},{key:"withContent",value:function(){return!!(this.consumer().sourcesContent&&0<this.consumer().sourcesContent.length)}}]),(wl=e).default=e),wl}function Nu(){var e,s,l,a,r,i,t,u,o,c,d,f,n;return _l||(_l=1,n=p.SourceMapConsumer,e=p.SourceMapGenerator,s=p.fileURLToPath,l=p.pathToFileURL,a=p.isAbsolute,r=p.resolve,i=(yl?gl:(yl=1,gl={nanoid:function(){for(var e="",t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:21;t--;)e+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return e},customAlphabet:function(n){var r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:21;return function(){for(var e="",t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:r;t--;)e+=n[Math.random()*n.length|0];return e}}})).nanoid,t=p,u=al(),o=Lu(),c=Symbol("fromOffsetCache"),d=Boolean(n&&e),f=Boolean(r&&a),n=k(function e(t){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(b(this,e),null==t||"object"===_(t)&&!t.toString)throw new Error("PostCSS received ".concat(t," instead of CSS string"));this.css=t.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,n.from&&(!f||/^\w+:\/\//.test(n.from)||a(n.from)?this.file=n.from:this.file=r(n.from)),f&&d&&(t=new o(this.css,n)).text&&(n=(this.map=t).consumer().file,!this.file)&&n&&(this.file=this.mapResolve(n)),this.file||(this.id="<input css "+i(6)+">"),this.map&&(this.map.file=this.from)},[{key:"error",value:function(e,t,n){var r,i,o,s=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{},a=(t&&"object"===_(t)?(a=n,n="number"==typeof(i=t).offset?(t=(o=this.fromOffset(i.offset)).line,o.col):(t=i.line,i.column),i="number"==typeof a.offset?(r=(o=this.fromOffset(a.offset)).line,o.col):(r=a.line,a.column)):n||(t=(o=this.fromOffset(t)).line,n=o.col),this.origin(t,n,r,i));return(o=a?new u(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,s.plugin):new u(e,void 0===r?t:{column:n,line:t},void 0===r?n:{column:i,line:r},this.css,this.file,s.plugin)).input={column:n,endColumn:i,endLine:r,line:t,source:this.css},this.file&&(l&&(o.input.url=l(this.file).toString()),o.input.file=this.file),o}},{key:"fromOffset",value:function(e){if(this[c])n=this[c];else{for(var t=this.css.split("\n"),n=new Array(t.length),r=0,i=0,o=t.length;i<o;i++)n[i]=r,r+=t[i].length+1;this[c]=n}var s=0;if(e>=n[n.length-1])s=n.length-1;else for(var a,l=n.length-2;s<l;)if(e<n[a=s+(l-s>>1)])l=a-1;else{if(!(e>=n[a+1])){s=a;break}s=a+1}return{col:e-n[s]+1,line:s+1}}},{key:"mapResolve",value:function(e){return/^\w+:\/\//.test(e)?e:r(this.map.consumer().sourceRoot||this.map.root||".",e)}},{key:"origin",value:function(e,t,n,r){if(!this.map)return!1;var i,o=this.map.consumer(),t=o.originalPositionFor({column:t,line:e});if(!t.source)return!1;"number"==typeof n&&(i=o.originalPositionFor({column:r,line:n}));e=a(t.source)?l(t.source):new URL(t.source,this.map.consumer().sourceRoot||l(this.map.mapFile)),r={column:t.column,endColumn:i&&i.column,endLine:i&&i.line,line:t.line,url:e.toString()};if("file:"===e.protocol){if(!s)throw new Error("file: protocol is not available in this PostCSS build");r.file=s(e)}n=o.sourceContentFor(t.source);return n&&(r.source=n),r}},{key:"toJSON",value:function(){for(var e={},t=0,n=["hasBOM","css","file","id"];t<n.length;t++){var r=n[t];null!=this[r]&&(e[r]=this[r])}return this.map&&(e.map=Ae({},this.map),e.map.consumerCache)&&(e.map.consumerCache=void 0),e}},{key:"from",get:function(){return this.file||this.id}}]),(kl=n).default=n,t&&t.registerInput&&t.registerInput(n)),kl}function Fu(){if(El)return Sl;El=1;var s=p.SourceMapConsumer,t=p.SourceMapGenerator,a=p.dirname,n=p.relative,r=p.resolve,i=p.sep,o=p.pathToFileURL,l=Nu(),e=Boolean(s&&t),u=Boolean(a&&r&&n&&i);return Sl=k(function e(t,n,r,i){b(this,e),this.stringify=t,this.mapOpts=r.map||{},this.root=n,this.opts=r,this.css=i,this.originalCSS=i,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map},[{key:"addAnnotation",value:function(){var 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",t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}},{key:"applyPrevMaps",value:function(){var e,t=Ie(this.previous());try{for(t.s();!(e=t.n()).done;){var n=e.value,r=this.toUrl(this.path(n.file)),i=n.root||a(n.file),o=void 0;!1===this.mapOpts.sourcesContent?(o=new s(n.text)).sourcesContent&&(o.sourcesContent=null):o=n.consumer(),this.map.applySourceMap(o,r,this.toUrl(this.path(i)))}}catch(e){t.e(e)}finally{t.f()}}},{key:"clearAnnotation",value:function(){if(!1!==this.mapOpts.annotation)if(this.root)for(var e,t=this.root.nodes.length-1;0<=t;t--)"comment"===(e=this.root.nodes[t]).type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t);else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}},{key:"generate",value:function(){var t;return this.clearAnnotation(),u&&e&&this.isMap()?this.generateMap():(t="",this.stringify(this.root,function(e){t+=e}),[t])}},{key:"generateMap",value:function(){var e;return this.root?this.generateString():1===this.previous().length?((e=this.previous()[0].consumer()).file=this.outputFile(),this.map=t.fromSourceMap(e,{ignoreInvalidMapping:!0})):(this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"})),this.isSourcesContent()&&this.setSourcesContent(),this.root&&0<this.previous().length&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}},{key:"generateString",value:function(){var r=this;this.css="",this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0});var i,o=1,s=1,a={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,function(e,t,n){r.css+=e,t&&"end"!==n&&(a.generated.line=o,a.generated.column=s-1,t.source&&t.source.start?(a.source=r.sourcePath(t),a.original.line=t.source.start.line,a.original.column=t.source.start.column-1):(a.source="<no source>",a.original.line=1,a.original.column=0),r.map.addMapping(a)),(i=e.match(/\n/g))?(o+=i.length,i=e.lastIndexOf("\n"),s=e.length-i):s+=e.length,t&&"start"!==n&&(e=t.parent||{raws:{}},"decl"!==t.type&&("atrule"!==t.type||t.nodes)||t!==e.last||e.raws.semicolon)&&(t.source&&t.source.end?(a.source=r.sourcePath(t),a.original.line=t.source.end.line,a.original.column=t.source.end.column-1,a.generated.line=o,a.generated.column=s-2):(a.source="<no source>",a.original.line=1,a.original.column=0,a.generated.line=o,a.generated.column=s-1),r.map.addMapping(a))})}},{key:"isAnnotation",value:function(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(function(e){return e.annotation}))}},{key:"isInline",value:function(){var e;return void 0!==this.mapOpts.inline?this.mapOpts.inline:(void 0===(e=this.mapOpts.annotation)||!0===e)&&(!this.previous().length||this.previous().some(function(e){return e.inline}))}},{key:"isMap",value:function(){return void 0!==this.opts.map?!!this.opts.map:0<this.previous().length}},{key:"isSourcesContent",value:function(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(function(e){return e.withContent()})}},{key:"outputFile",value:function(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}},{key:"path",value:function(e){var t;return this.mapOpts.absolute||60===e.charCodeAt(0)||/^\w+:\/\//.test(e)?e:this.memoizedPaths.get(e)||(t=this.opts.to?a(this.opts.to):".","string"==typeof this.mapOpts.annotation&&(t=a(r(t,this.mapOpts.annotation))),t=n(t,e),this.memoizedPaths.set(e,t),t)}},{key:"previous",value:function(){var e,t=this;return this.previousMaps||(this.previousMaps=[],this.root?this.root.walk(function(e){e.source&&e.source.input.map&&(e=e.source.input.map,t.previousMaps.includes(e)||t.previousMaps.push(e))}):(e=new l(this.originalCSS,this.opts)).map&&this.previousMaps.push(e.map)),this.previousMaps}},{key:"setSourcesContent",value:function(){var e,n=this,r={};this.root?this.root.walk(function(e){var t;e.source&&(t=e.source.input.from)&&!r[t]&&(r[t]=!0,t=n.usesFileUrls?n.toFileUrl(t):n.toUrl(n.path(t)),n.map.setSourceContent(t,e.source.input.css))}):this.css&&(e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>",this.map.setSourceContent(e,this.css))}},{key:"sourcePath",value:function(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))}},{key:"toBase64",value:function(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}},{key:"toFileUrl",value:function(e){var t=this.memoizedFileURLs.get(e);if(t)return t;if(o)return t=o(e).toString(),this.memoizedFileURLs.set(e,t),t;throw new Error("`map.absolute` option is not available in this PostCSS build")}},{key:"toUrl",value:function(e){var t=this.memoizedURLs.get(e);if(t)return t;"\\"===i&&(e=e.replace(/\\/g,"/"));t=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,t),t}}])}function Uu(){var e;return Rl||(Rl=1,qi(t,Pu()),e=k(t),(Cl=e).default=e),Cl;function t(e){return b(this,t),(e=Bi(this,t,[e])).type="comment",e}}function zu(){var u,c,d,t,e,f,h,p,m,n;return Ol||(Ol=1,e=Mu(),f=e.isClean,h=e.my,p=Du(),m=Uu(),qi(v,Pu()),(n=k(v,[{key:"append",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r=0,i=t;r<i.length;r++){var o,s=i[r],a=Ie(this.normalize(s,this.last));try{for(a.s();!(o=a.n()).done;){var l=o.value;this.proxyOf.nodes.push(l)}}catch(e){a.e(e)}finally{a.f()}}return this.markDirty(),this}},{key:"cleanRaws",value:function(e){if(Yi(v,"cleanRaws",this,3)([e]),this.nodes){var t,n=Ie(this.nodes);try{for(n.s();!(t=n.n()).done;)t.value.cleanRaws(e)}catch(e){n.e(e)}finally{n.f()}}}},{key:"each",value:function(e){if(this.proxyOf.nodes){for(var t,n,r=this.getIterator();this.indexes[r]<this.proxyOf.nodes.length&&(t=this.indexes[r],!1!==(n=e(this.proxyOf.nodes[t],t)));)this.indexes[r]+=1;return delete this.indexes[r],n}}},{key:"every",value:function(e){return this.nodes.every(e)}},{key:"getIterator",value:function(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;var e=this.lastEach;return this.indexes[e]=0,e}},{key:"getProxyProcessor",value:function(){return{get:function(r,o){return"proxyOf"===o?r:r[o]&&("each"===o||"string"==typeof o&&o.startsWith("walk")?function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return r[o].apply(r,Qi(t.map(function(n){return"function"==typeof n?function(e,t){return n(e.toProxy(),t)}:n})))}:"every"===o||"some"===o?function(i){return r[o](function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return i.apply(void 0,[e.toProxy()].concat(n))})}:"root"===o?function(){return r.root().toProxy()}:"nodes"===o?r.nodes.map(function(e){return e.toProxy()}):"first"===o||"last"===o?r[o].toProxy():r[o])},set:function(e,t,n){return e[t]!==n&&(e[t]=n,"name"===t||"params"===t||"selector"===t)&&e.markDirty(),!0}}}},{key:"index",value:function(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}},{key:"insertAfter",value:function(e,t){var n,r,i,o=this.index(e),s=this.normalize(t,this.proxyOf.nodes[o]).reverse(),o=this.index(e),a=Ie(s);try{for(a.s();!(n=a.n()).done;){var l=n.value;this.proxyOf.nodes.splice(o+1,0,l)}}catch(e){a.e(e)}finally{a.f()}for(i in this.indexes)o<(r=this.indexes[i])&&(this.indexes[i]=r+s.length);return this.markDirty(),this}},{key:"insertBefore",value:function(e,t){var n,r,i,o=this.index(e),s=this.normalize(t,this.proxyOf.nodes[o],0===o&&"prepend").reverse(),o=this.index(e),a=Ie(s);try{for(a.s();!(n=a.n()).done;){var l=n.value;this.proxyOf.nodes.splice(o,0,l)}}catch(e){a.e(e)}finally{a.f()}for(i in this.indexes)o<=(r=this.indexes[i])&&(this.indexes[i]=r+s.length);return this.markDirty(),this}},{key:"normalize",value:function(e,t){var n=this;if("string"==typeof e)e=function t(e){return e.map(function(e){return e.nodes&&(e.nodes=t(e.nodes)),delete e.source,e})}(u(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e)){var r,i=Ie(e=e.slice(0));try{for(i.s();!(r=i.n()).done;){var o=r.value;o.parent&&o.parent.removeChild(o,"ignore")}}catch(e){i.e(e)}finally{i.f()}}else if("root"===e.type&&"document"!==this.type){var s,a=Ie(e=e.nodes.slice(0));try{for(a.s();!(s=a.n()).done;){var l=s.value;l.parent&&l.parent.removeChild(l,"ignore")}}catch(e){a.e(e)}finally{a.f()}}else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new p(e)]}else if(e.selector)e=[new c(e)];else if(e.name)e=[new d(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new m(e)]}return e.map(function(e){return e[h]||v.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[f]&&function e(t){if(t[f]=!1,t.proxyOf.nodes){var n,r=Ie(t.proxyOf.nodes);try{for(r.s();!(n=r.n()).done;)e(n.value)}catch(e){r.e(e)}finally{r.f()}}}(e),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/\S/g,"")),e.parent=n.proxyOf,e})}},{key:"prepend",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,i=Ie(t=t.reverse());try{for(i.s();!(r=i.n()).done;){var o,s,a=r.value,l=this.normalize(a,this.first,"prepend").reverse(),u=Ie(l);try{for(u.s();!(o=u.n()).done;){var c=o.value;this.proxyOf.nodes.unshift(c)}}catch(e){u.e(e)}finally{u.f()}for(s in this.indexes)this.indexes[s]=this.indexes[s]+l.length}}catch(e){i.e(e)}finally{i.f()}return this.markDirty(),this}},{key:"push",value:function(e){return(e.parent=this).proxyOf.nodes.push(e),this}},{key:"removeAll",value:function(){var e,t=Ie(this.proxyOf.nodes);try{for(t.s();!(e=t.n()).done;)e.value.parent=void 0}catch(e){t.e(e)}finally{t.f()}return this.proxyOf.nodes=[],this.markDirty(),this}},{key:"removeChild",value:function(e){var t,n;for(n in e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1),this.indexes)(t=this.indexes[n])>=e&&(this.indexes[n]=t-1);return this.markDirty(),this}},{key:"replaceValues",value:function(t,n,r){return r||(r=n,n={}),this.walkDecls(function(e){n.props&&!n.props.includes(e.prop)||n.fast&&!e.value.includes(n.fast)||(e.value=e.value.replace(t,r))}),this.markDirty(),this}},{key:"some",value:function(e){return this.nodes.some(e)}},{key:"walk",value:function(r){return this.each(function(t,e){var n;try{n=r(t,e)}catch(e){throw t.addToError(e)}return n=!1!==n&&t.walk?t.walk(r):n})}},{key:"walkAtRules",value:function(n,r){return r?n instanceof RegExp?this.walk(function(e,t){if("atrule"===e.type&&n.test(e.name))return r(e,t)}):this.walk(function(e,t){if("atrule"===e.type&&e.name===n)return r(e,t)}):(r=n,this.walk(function(e,t){if("atrule"===e.type)return r(e,t)}))}},{key:"walkComments",value:function(n){return this.walk(function(e,t){if("comment"===e.type)return n(e,t)})}},{key:"walkDecls",value:function(n,r){return r?n instanceof RegExp?this.walk(function(e,t){if("decl"===e.type&&n.test(e.prop))return r(e,t)}):this.walk(function(e,t){if("decl"===e.type&&e.prop===n)return r(e,t)}):(r=n,this.walk(function(e,t){if("decl"===e.type)return r(e,t)}))}},{key:"walkRules",value:function(n,r){return r?n instanceof RegExp?this.walk(function(e,t){if("rule"===e.type&&n.test(e.selector))return r(e,t)}):this.walk(function(e,t){if("rule"===e.type&&e.selector===n)return r(e,t)}):(r=n,this.walk(function(e,t){if("rule"===e.type)return r(e,t)}))}},{key:"first",get:function(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}},{key:"last",get:function(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}])).registerParse=function(e){u=e},n.registerRule=function(e){c=e},n.registerAtRule=function(e){d=e},n.registerRoot=function(e){t=e},((Tl=n).default=n).rebuild=function(e){"atrule"===e.type?Object.setPrototypeOf(e,d.prototype):"rule"===e.type?Object.setPrototypeOf(e,c.prototype):"decl"===e.type?Object.setPrototypeOf(e,p.prototype):"comment"===e.type?Object.setPrototypeOf(e,m.prototype):"root"===e.type&&Object.setPrototypeOf(e,t.prototype),e[h]=!0,e.nodes&&e.nodes.forEach(function(e){n.rebuild(e)})}),Tl;function v(){return b(this,v),Bi(this,v,arguments)}}function Bu(){var t,n,e;return Ml||(Ml=1,qi(r,zu()),(e=k(r,[{key:"toResult",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new t(new n,this,e).stringify()}}])).registerLazyResult=function(e){t=e},e.registerProcessor=function(e){n=e},(xl=e).default=e),xl;function r(e){return b(this,r),(e=Bi(this,r,[Ae({type:"document"},e)])).nodes||(e.nodes=[]),e}}function ju(){if(Al)return Il;Al=1;var t={};return Il=function(e){t[e]||(t[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))}}function Wu(){var e;return Dl||(Dl=1,e=k(function e(t){var n,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};for(n in b(this,e),this.type="warning",this.text=t,r.node&&r.node.source&&(t=r.node.rangeBy(r),this.line=t.start.line,this.column=t.start.column,this.endLine=t.end.line,this.endColumn=t.end.column),r)this[n]=r[n]},[{key:"toString",value:function(){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}}]),(Pl=e).default=e),Pl}function Hu(){var n,e;return Nl||(Nl=1,n=Wu(),e=k(function e(t,n,r){b(this,e),this.processor=t,this.messages=[],this.root=n,this.opts=r,this.css=void 0,this.map=void 0},[{key:"toString",value:function(){return this.css}},{key:"warn",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},e=(t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin),new n(e,t));return this.messages.push(e),e}},{key:"warnings",value:function(){return this.messages.filter(function(e){return"warning"===e.type})}},{key:"content",get:function(){return this.css}}]),(Ll=e).default=e),Ll}function qu(){var e,t;return Bl||(Bl=1,qi(r,e=zu()),t=k(r,[{key:"append",value:function(){this.proxyOf.nodes||(this.nodes=[]);for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Yi(r,"append",this,3)(t)}},{key:"prepend",value:function(){this.proxyOf.nodes||(this.nodes=[]);for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Yi(r,"prepend",this,3)(t)}}]),(zl=t).default=t,e.registerAtRule(t)),zl;function r(e){return b(this,r),(e=Bi(this,r,[e])).type="atrule",e}}function Vu(){var t,n,e,r;return Wl||(Wl=1,qi(s,e=zu()),(r=k(s,[{key:"normalize",value:function(e,t,n){var r=Yi(s,"normalize",this,3)([e]);if(t)if("prepend"===n)1<this.nodes.length?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t){var i,o=Ie(r);try{for(o.s();!(i=o.n()).done;)i.value.raws.before=t.raws.before}catch(e){o.e(e)}finally{o.f()}}return r}},{key:"removeChild",value:function(e,t){var n=this.index(e);return!t&&0===n&&1<this.nodes.length&&(this.nodes[1].raws.before=this.nodes[n].raws.before),Yi(s,"removeChild",this,3)([e])}},{key:"toResult",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new t(new n,this,e).stringify()}}])).registerLazyResult=function(e){t=e},r.registerProcessor=function(e){n=e},jl=r,e.registerRoot(r.default=r)),jl;function s(e){return b(this,s),(e=Bi(this,s,[e])).type="root",e.nodes||(e.nodes=[]),e}}function Gu(){var t;return ql||(ql=1,(Hl=t={comma:function(e){return t.split(e,[","],!0)},space:function(e){return t.split(e,[" ","\n","\t"])},split:function(e,t,n){var r,i=[],o="",s=!1,a=0,l=!1,u="",c=!1,d=Ie(e);try{for(d.s();!(r=d.n()).done;){var f=r.value;c?c=!1:"\\"===f?c=!0:l?f===u&&(l=!1):'"'===f||"'"===f?(l=!0,u=f):"("===f?a+=1:")"===f?0<a&&--a:0===a&&t.includes(f)&&(s=!0),s?(""!==o&&i.push(o.trim()),o="",s=!1):o+=f}}catch(e){d.e(e)}finally{d.f()}return!n&&""===o||i.push(o.trim()),i}}).default=t),Hl}function Zu(){var e,t,n;return Gl||(Gl=1,e=zu(),t=Gu(),qi(r,e),n=k(r,[{key:"selectors",get:function(){return t.comma(this.selector)},set:function(e){var t=this.selector?this.selector.match(/,\s*/):null,t=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(t)}}]),(Vl=n).default=n,e.registerRule(n)),Vl;function r(e){return b(this,r),(e=Bi(this,r,[e])).type="rule",e.nodes||(e.nodes=[]),e}}function Ju(){var e,r,i;return $l||($l=1,e=zu(),r=(()=>{if(Jl)return Zl;Jl=1;var p=Du(),e=(()=>{if(Ul)return Fl;Ul=1;var w="'".charCodeAt(0),b='"'.charCodeAt(0),k="\\".charCodeAt(0),_="/".charCodeAt(0),S="\n".charCodeAt(0),E=" ".charCodeAt(0),C="\f".charCodeAt(0),R="\t".charCodeAt(0),T="\r".charCodeAt(0),O="[".charCodeAt(0),x="]".charCodeAt(0),M="(".charCodeAt(0),I=")".charCodeAt(0),A="{".charCodeAt(0),P="}".charCodeAt(0),D=";".charCodeAt(0),L="*".charCodeAt(0),N=":".charCodeAt(0),F="@".charCodeAt(0),U=/[\t\n\f\r "#'()/;[\\\]{}]/g,z=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,B=/.[\r\n"'(/\\]/,j=/[\da-f]/i;return Fl=function(t){var r,i,o,s,a,l,u,c,d,e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},f=t.css.valueOf(),h=e.ignoreErrors,p=f.length,m=0,v=[],g=[];function y(e){throw t.error("Unclosed "+e,m)}return{back:function(e){g.push(e)},endOfFile:function(){return 0===g.length&&p<=m},nextToken:function(e){if(g.length)return g.pop();if(!(p<=m)){var t=!!e&&e.ignoreUnclosed;switch(r=f.charCodeAt(m)){case S:case E:case R:case T:case C:for(i=m;i+=1,(r=f.charCodeAt(i))===E||r===S||r===R||r===T||r===C;);d=["space",f.slice(m,i)],m=i-1;break;case O:case x:case A:case P:case N:case D:case I:var n=String.fromCharCode(r);d=[n,n,m];break;case M:if(u=v.length?v.pop()[1]:"",c=f.charCodeAt(m+1),"url"===u&&c!==w&&c!==b&&c!==E&&c!==S&&c!==R&&c!==C&&c!==T){i=m;do{if(a=!1,-1===(i=f.indexOf(")",i+1))){if(h||t){i=m;break}y("bracket")}for(l=i;f.charCodeAt(l-1)===k;)--l,a=!a}while(a);d=["brackets",f.slice(m,i+1),m,i],m=i}else i=f.indexOf(")",m+1),u=f.slice(m,i+1),-1===i||B.test(u)?d=["(","(",m]:(d=["brackets",u,m,i],m=i);break;case w:case b:o=r===w?"'":'"',i=m;do{if(a=!1,-1===(i=f.indexOf(o,i+1))){if(h||t){i=m+1;break}y("string")}for(l=i;f.charCodeAt(l-1)===k;)--l,a=!a}while(a);d=["string",f.slice(m,i+1),m,i],m=i;break;case F:U.lastIndex=m+1,U.test(f),i=0===U.lastIndex?f.length-1:U.lastIndex-2,d=["at-word",f.slice(m,i+1),m,i],m=i;break;case k:for(i=m,s=!0;f.charCodeAt(i+1)===k;)i+=1,s=!s;if(r=f.charCodeAt(i+1),s&&r!==_&&r!==E&&r!==S&&r!==R&&r!==T&&r!==C&&(i+=1,j.test(f.charAt(i)))){for(;j.test(f.charAt(i+1));)i+=1;f.charCodeAt(i+1)===E&&(i+=1)}d=["word",f.slice(m,i+1),m,i],m=i;break;default:m=(r===_&&f.charCodeAt(m+1)===L?(0===(i=f.indexOf("*/",m+2)+1)&&(h||t?i=f.length:y("comment")),d=["comment",f.slice(m,i+1),m,i]):(z.lastIndex=m+1,z.test(f),i=0===z.lastIndex?f.length-1:z.lastIndex-2,d=["word",f.slice(m,i+1),m,i],v.push(d)),i)}return m++,d}},position:function(){return m}}}})(),n=Uu(),u=qu(),r=Vu(),i=Zu(),f={empty:!0,space:!0};return Zl=k(function e(t){b(this,e),this.input=t,this.root=new r,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{column:1,line:1,offset:0}}},[{key:"atrule",value:function(e){var t,n,r,i=new u;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);for(var o=!1,s=!1,a=[],l=[];!this.tokenizer.endOfFile();){if("("===(t=(e=this.tokenizer.nextToken())[0])||"["===t?l.push("("===t?")":"]"):"{"===t&&0<l.length?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(0<a.length){for(n=a[r=a.length-1];n&&"space"===n[0];)n=a[--r];n&&(i.source.end=this.getPosition(n[3]||n[2]),i.source.end.offset++)}this.end(e);break}}if(a.push(e),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)}},{key:"checkMissedSemicolon",value:function(e){var t=this.colon(e);if(!1!==t){for(var n,r=0,i=t-1;0<=i&&("space"===(n=e[i])[0]||2!==(r+=1));i--);throw this.input.error("Missed semicolon","word"===n[0]?n[3]+1:n[2])}}},{key:"colon",value:function(e){var t,n,r,i,o=0,s=Ie(e.entries());try{for(s.s();!(i=s.n()).done;){var a=Pe(i.value,2),l=a[0];if("("===(n=(t=a[1])[0])&&(o+=1),")"===n&&--o,0===o&&":"===n){if(r){if("word"===r[0]&&"progid"===r[1])continue;return l}this.doubleColon(t)}r=t}}catch(e){s.e(e)}finally{s.f()}return!1}},{key:"comment",value:function(e){var t=new n,e=(this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,e[1].slice(2,-2));/^\s*$/.test(e)?(t.text="",t.raws.left=e,t.raws.right=""):(e=e.match(/^(\s*)([^]*\S)(\s*)$/),t.text=e[2],t.raws.left=e[1],t.raws.right=e[3])}},{key:"createTokenizer",value:function(){this.tokenizer=e(this.input)}},{key:"decl",value:function(e,t){var n=new p;this.init(n,e[0][2]);var r,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(i[3]||i[2]||(e=>{for(var t=e.length-1;0<=t;t--){var n=e[t],n=n[3]||n[2];if(n)return n}})(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){var o=e[0][0];if(":"===o||"space"===o||"comment"===o)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(":"===(r=e.shift())[0]){n.raws.between+=r[1];break}"word"===r[0]&&/\w/.test(r[1])&&this.unknownWord([r]),n.raws.between+=r[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));for(var s,a=[];e.length&&("space"===(s=e[0][0])||"comment"===s);)a.push(e.shift());this.precheckMissedSemicolon(e);for(var l=e.length-1;0<=l;l--){if("!important"===(r=e[l])[1].toLowerCase()){n.important=!0;var u=this.stringFrom(e,l);" !important"!==(u=this.spacesFromEnd(e)+u)&&(n.raws.important=u);break}if("important"===r[1].toLowerCase()){for(var c=e.slice(0),d="",f=l;0<f;f--){var h=c[f][0];if(0===d.trim().indexOf("!")&&"space"!==h)break;d=c.pop()[1]+d}0===d.trim().indexOf("!")&&(n.important=!0,n.raws.important=d,e=c)}if("space"!==r[0]&&"comment"!==r[0])break}e.some(function(e){return"space"!==e[0]&&"comment"!==e[0]})&&(n.raws.between+=a.map(function(e){return e[1]}).join(""),a=[]),this.raw(n,"value",a.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}},{key:"doubleColon",value:function(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}},{key:"emptyRule",value:function(e){var t=new i;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}},{key:"end",value:function(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)}},{key:"endFile",value:function(){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())}},{key:"freeSemicolon",value:function(e){this.spaces+=e[1],this.current.nodes&&(e=this.current.nodes[this.current.nodes.length-1])&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}},{key:"getPosition",value:function(e){var t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}},{key:"init",value:function(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)}},{key:"other",value:function(e){for(var t,n=!1,r=!1,i=null,o=[],s=e[1].startsWith("--"),a=[],l=e;l;){if(t=l[0],a.push(l),"("===t||"["===t)i=i||l,o.push("("===t?")":"]");else if(s&&r&&"{"===t)i=i||l,o.push("}");else if(0===o.length){if(";"===t){if(r)return void this.decl(a,s);break}if("{"===t)return void this.rule(a);if("}"===t){this.tokenizer.back(a.pop()),n=!0;break}":"===t&&(r=!0)}else t===o[o.length-1]&&(o.pop(),0===o.length)&&(i=null);l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(n=!0),0<o.length&&this.unclosedBracket(i),n&&r){if(!s)for(;a.length&&("space"===(l=a[a.length-1][0])||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,s)}else this.unknownWord(a)}},{key:"parse",value:function(){for(var e;!this.tokenizer.endOfFile();)switch((e=this.tokenizer.nextToken())[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()}},{key:"precheckMissedSemicolon",value:function(){}},{key:"raw",value:function(e,t,n,r){for(var i,o,s,a,l=n.length,u="",c=!0,d=0;d<l;d+=1)"space"===(s=(i=n[d])[0])&&d===l-1&&!r||"comment"===s&&(s=n[d-1]?n[d-1][0]:"empty",o=n[d+1]?n[d+1][0]:"empty",f[s]||f[o]||","===u.slice(-1))?c=!1:u+=i[1];c||(a=n.reduce(function(e,t){return e+t[1]},""),e.raws[t]={raw:a,value:u}),e[t]=u}},{key:"rule",value:function(e){e.pop();var t=new i;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}},{key:"spacesAndCommentsFromEnd",value:function(e){for(var t,n="";e.length&&("space"===(t=e[e.length-1][0])||"comment"===t);)n=e.pop()[1]+n;return n}},{key:"spacesAndCommentsFromStart",value:function(e){for(var t,n="";e.length&&("space"===(t=e[0][0])||"comment"===t);)n+=e.shift()[1];return n}},{key:"spacesFromEnd",value:function(e){for(var t="";e.length&&"space"===e[e.length-1][0];)t=e.pop()[1]+t;return t}},{key:"stringFrom",value:function(e,t){for(var n="",r=t;r<e.length;r++)n+=e[r][1];return e.splice(t,e.length-t),n}},{key:"unclosedBlock",value:function(){var e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}},{key:"unclosedBracket",value:function(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}},{key:"unexpectedClose",value:function(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}},{key:"unknownWord",value:function(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}},{key:"unnamedAtrule",value:function(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}}])})(),i=Nu(),Kl=t,e.registerParse(t.default=t)),Kl;function t(e,t){var n=new i(e,t),n=new r(n);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}}function Ku(){var d,a,n,r,l,e,i,u,c,t,o,f,h,p,s,m;return Yl||(Yl=1,e=Mu(),d=e.isClean,a=e.my,n=Fu(),r=Au(),l=zu(),e=Bu(),i=ju(),u=Hu(),c=Ju(),t=Vu(),o={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},f={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},h={Once:!0,postcssPlugin:!0,prepare:!0},p={},(s=k(function e(t,n,r){var i,o=this;if(b(this,e),this.stringified=!1,this.processed=!1,"object"!==_(n)||null===n||"root"!==n.type&&"document"!==n.type)if(n instanceof e||n instanceof u)i=w(n.root),n.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{var s=c;r.syntax&&(s=r.syntax.parse),(s=r.parser?r.parser:s).parse&&(s=s.parse);try{i=s(n,r)}catch(e){this.processed=!0,this.error=e}i&&!i[a]&&l.rebuild(i)}else i=w(n);this.result=new u(t,i,r),this.helpers=Ae(Ae({},p),{},{postcss:p,result:this.result}),this.plugins=this.processor.plugins.map(function(e){return"object"===_(e)&&e.prepare?Ae(Ae({},e),e.prepare(o.result)):e})},[{key:"async",value:function(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}},{key:"catch",value:function(e){return this.async().catch(e)}},{key:"finally",value:function(e){return this.async().then(e,e)}},{key:"getAsyncError",value:function(){throw new Error("Use process(css).then(cb) to work with async plugins")}},{key:"handleError",value:function(e,t){var n,r,i,o,s,a=this.result.lastPlugin;try{t&&t.addToError(e),"CssSyntaxError"!==(this.error=e).name||e.plugin?a.postcssVersion&&"production"!==process.env.NODE_ENV&&(n=a.postcssPlugin,r=a.postcssVersion,i=this.result.processor.version,o=r.split("."),s=i.split("."),o[0]!==s[0]||parseInt(o[1])>parseInt(s[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+i+", but "+n+" uses "+r+". Perhaps this is the source of the error below."):(e.plugin=a.postcssPlugin,e.setMessage())}catch(e){console&&console.error&&console.error(e)}return e}},{key:"prepareVisitors",value:function(){var r=this;this.listeners={};function e(e,t,n){r.listeners[t]||(r.listeners[t]=[]),r.listeners[t].push([e,n])}var t,n=Ie(this.plugins);try{for(n.s();!(t=n.n()).done;){var i=t.value;if("object"===_(i))for(var o in i){if(!f[o]&&/^[A-Z]/.test(o))throw new Error("Unknown event ".concat(o," in ").concat(i.postcssPlugin,". Try to update PostCSS (").concat(this.processor.version," now)."));if(!h[o])if("object"===_(i[o]))for(var s in i[o])e(i,"*"===s?o:o+"-"+s.toLowerCase(),i[o][s]);else"function"==typeof i[o]&&e(i,o,i[o])}}}catch(r){n.e(r)}finally{n.f()}this.hasListener=0<Object.keys(this.listeners).length}},{key:"runAsync",value:(m=zi(Ji().m(function e(){var t,i,n,r,o,s,a,l,u,c=this;return Ji().w(function(e){for(;;)switch(e.p=e.n){case 0:this.plugin=0,t=0;case 1:if(t<this.plugins.length){if(a=this.plugins[t],v(a=this.runOnRoot(a)))return e.p=2,e.n=3,a;e.n=5}else e.n=6;break;case 3:e.n=5;break;case 4:throw e.p=4,a=e.v,this.handleError(a);case 5:t++,e.n=1;break;case 6:if(this.prepareVisitors(),!this.hasListener){e.n=21;break}i=this.result.root;case 7:if(i[d]){e.n=14;break}i[d]=!0,n=[y(i)];case 8:if(0<n.length){if(v(l=this.visitTick(n)))return e.p=9,e.n=10,l;e.n=12}else e.n=13;break;case 10:e.n=12;break;case 11:throw e.p=11,l=e.v,u=n[n.length-1].node,this.handleError(l,u);case 12:e.n=8;break;case 13:e.n=7;break;case 14:if(!this.listeners.OnceExit){e.n=21;break}r=Ie(this.listeners.OnceExit),e.p=15,s=Ji().m(function e(){var t,n,r;return Ji().w(function(e){for(;;)switch(e.p=e.n){case 0:if(n=Pe(o.value,2),r=n[0],t=n[1],c.result.lastPlugin=r,e.p=1,"document"===i.type)return n=i.nodes.map(function(e){return t(e,c.helpers)}),e.n=2,Promise.all(n);e.n=3;break;case 2:e.n=4;break;case 3:return e.n=4,t(i,c.helpers);case 4:e.n=6;break;case 5:throw e.p=5,r=e.v,c.handleError(r);case 6:return e.a(2)}},e,null,[[1,5]])}),r.s();case 16:if((o=r.n()).done){e.n=18;break}return e.d($i(s()),17);case 17:e.n=16;break;case 18:e.n=20;break;case 19:e.p=19,u=e.v,r.e(u);case 20:return e.p=20,r.f(),e.f(20);case 21:return this.processed=!0,e.a(2,this.stringify())}},e,this,[[15,19,20,21],[9,11],[2,4]])})),function(){return m.apply(this,arguments)})},{key:"runOnRoot",value:function(t){var e,n=this;this.result.lastPlugin=t;try{return"object"===_(t)&&t.Once?"document"===this.result.root.type?v((e=this.result.root.nodes.map(function(e){return t.Once(e,n.helpers)}))[0])?Promise.all(e):e:t.Once(this.result.root,this.helpers):"function"==typeof t?t(this.result.root,this.result):void 0}catch(t){throw this.handleError(t)}}},{key:"stringify",value:function(){if(this.error)throw this.error;var e,t;return this.stringified||(this.stringified=!0,this.sync(),t=this.result.opts,e=r,t.syntax&&(e=t.syntax.stringify),(e=t.stringifier?t.stringifier:e).stringify&&(e=e.stringify),t=new n(e,this.result.root,this.result.opts).generate(),this.result.css=t[0],this.result.map=t[1]),this.result}},{key:"sync",value:function(){if(this.error)throw this.error;if(!this.processed){if(this.processed=!0,this.processing)throw this.getAsyncError();var e,t=Ie(this.plugins);try{for(t.s();!(e=t.n()).done;){var n=e.value;if(v(this.runOnRoot(n)))throw this.getAsyncError()}}catch(e){t.e(e)}finally{t.f()}if(this.prepareVisitors(),this.hasListener){for(var r=this.result.root;!r[d];)r[d]=!0,this.walkSync(r);if(this.listeners.OnceExit)if("document"===r.type){var i,o=Ie(r.nodes);try{for(o.s();!(i=o.n()).done;){var s=i.value;this.visitSync(this.listeners.OnceExit,s)}}catch(e){o.e(e)}finally{o.f()}}else this.visitSync(this.listeners.OnceExit,r)}}return this.result}},{key:"then",value:function(e,t){return"production"===process.env.NODE_ENV||"from"in this.opts||i("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)}},{key:"toString",value:function(){return this.css}},{key:"visitSync",value:function(e,t){var n,r=Ie(e);try{for(r.s();!(n=r.n()).done;){var i=Pe(n.value,2),o=i[0],s=i[1],a=(this.result.lastPlugin=o,void 0);try{a=s(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(v(a))throw this.getAsyncError()}}catch(e){r.e(e)}finally{r.f()}}},{key:"visitTick",value:function(e){var t=e[e.length-1],n=t.node,r=t.visitors;if("root"===n.type||"document"===n.type||n.parent){if(0<r.length&&t.visitorIndex<r.length){var i=Pe(r[t.visitorIndex],2),o=i[0],i=i[1];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=o;try{return i(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==t.iterator){for(var s,a=t.iterator;s=n.nodes[n.indexes[a]];)if(n.indexes[a]+=1,!s[d])return s[d]=!0,void e.push(y(s));t.iterator=0,delete n.indexes[a]}for(var l=t.events;t.eventIndex<l.length;){var u=l[t.eventIndex];if(t.eventIndex+=1,0===u)return void(n.nodes&&n.nodes.length&&(n[d]=!0,t.iterator=n.getIterator()));if(this.listeners[u])return void(t.visitors=this.listeners[u])}}e.pop()}},{key:"walkSync",value:function(e){var t=this;e[d]=!0;var n,r=Ie(g(e));try{for(r.s();!(n=r.n()).done;){var i=n.value;if(0===i)e.nodes&&e.each(function(e){e[d]||t.walkSync(e)});else{var o=this.listeners[i];if(o&&this.visitSync(o,e.toProxy()))return}}}catch(e){r.e(e)}finally{r.f()}}},{key:"warnings",value:function(){return this.sync().warnings()}},{key:"content",get:function(){return this.stringify().content}},{key:"css",get:function(){return this.stringify().css}},{key:"map",get:function(){return this.stringify().map}},{key:"messages",get:function(){return this.sync().messages}},{key:"opts",get:function(){return this.result.opts}},{key:"processor",get:function(){return this.result.processor}},{key:"root",get:function(){return this.sync().root}},{key:Symbol.toStringTag,get:function(){return"LazyResult"}}])).registerPostcss=function(e){p=e},Xl=s,t.registerLazyResult(s.default=s),e.registerLazyResult(s)),Xl;function v(e){return"object"===_(e)&&"function"==typeof e.then}function g(e){var t=!1,n=o[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,0,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,0,n+"Exit"]:[n,n+"Exit"]}function y(e){return{eventIndex:0,events:"document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:g(e),iterator:0,node:e,visitorIndex:0,visitors:[]}}function w(e){return e[d]=!1,e.nodes&&e.nodes.forEach(w),e}}function $u(e,t){if(Array.isArray(e))return e.map(function(e){return $u(e)});var n,r=e.inputs,i=Zi(e,so);if(r){t=[];var o,s=Ie(r);try{for(s.s();!(o=s.n()).done;){var a=Ae(Ae({},o.value),{},{__proto__:vu.prototype});a.map&&(a.map=Ae(Ae({},a.map),{},{__proto__:hu.prototype})),t.push(a)}}catch(e){s.e(e)}finally{s.f()}}if(i.nodes&&(i.nodes=e.nodes.map(function(e){return $u(e,t)})),i.source&&(n=(r=i.source).inputId,r=Zi(r,ao),i.source=r,null!=n)&&(i.source.input=t[n]),"root"===i.type)return new gu(i);if("decl"===i.type)return new fu(i);if("rule"===i.type)return new yu(i);if("comment"===i.type)return new pu(i);if("atrule"===i.type)return new mu(i);throw new Error("Unknown node type: "+e.type)}function s(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 1===t.length&&Array.isArray(t[0])&&(t=t[0]),new ou(t)}Lh||(Lh=1,ru=al(),iu=Du(),am=Ku(),a=zu(),rm||(rm=1,m||(m=1,Su=Fu(),Eu=Au(),Cu=ju(),Ru=Ju(),Tu=Hu(),Ou=k(function e(t,n,r){b(this,e),n=n.toString(),this.stringified=!1,this._processor=t,this._css=n,this._opts=r,this._map=void 0;var t=Eu,i=(this.result=new Tu(this._processor,void 0,this._opts),this.result.css=n,this),r=(Object.defineProperty(this.result,"root",{get:function(){return i.root}}),new Su(t,void 0,this._opts,n));r.isMap()?(n=(t=Pe(r.generate(),2))[0],t=t[1],n&&(this.result.css=n),t&&(this.result.map=t)):(r.clearAnnotation(),this.result.css=r.css)},[{key:"async",value:function(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}},{key:"catch",value:function(e){return this.async().catch(e)}},{key:"finally",value:function(e){return this.async().then(e,e)}},{key:"sync",value:function(){if(this.error)throw this.error;return this.result}},{key:"then",value:function(e,t){return"production"===process.env.NODE_ENV||"from"in this._opts||Cu("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)}},{key:"toString",value:function(){return this._css}},{key:"warnings",value:function(){return[]}},{key:"content",get:function(){return this.result.css}},{key:"css",get:function(){return this.result.css}},{key:"map",get:function(){return this.result.map}},{key:"messages",get:function(){return[]}},{key:"opts",get:function(){return this.result.opts}},{key:"processor",get:function(){return this.result.processor}},{key:"root",get:function(){if(this._root)return this._root;var e,t=Ru;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e}},{key:Symbol.toStringTag,get:function(){return"NoWorkResult"}}]),(Ql=Ou).default=Ou),wu=Ql,bu=Ku(),Ou=Bu(),ku=Vu(),_u=k(function e(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[];b(this,e),this.version="8.4.38",this.plugins=this.normalize(t)},[{key:"normalize",value:function(e){var t,n=[],r=Ie(e);try{for(r.s();!(t=r.n()).done;){var i=t.value;if(!0===i.postcss?i=i():i.postcss&&(i=i.postcss),"object"===_(i)&&Array.isArray(i.plugins))n=n.concat(i.plugins);else if("object"===_(i)&&i.postcssPlugin)n.push(i);else if("function"==typeof i)n.push(i);else{if("object"!==_(i)||!i.parse&&!i.stringify)throw new Error(i+" 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.")}}}catch(e){r.e(e)}finally{r.f()}return n}},{key:"process",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return new(this.plugins.length||t.parser||t.stringifier||t.syntax?bu:wu)(this,e,t)}},{key:"use",value:function(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}]),(eu=_u).default=_u,ku.registerProcessor(_u),Ou.registerProcessor(_u)),ou=eu,ku=Au(),Af||(Af=1,fu=Du(),hu=Lu(),pu=Uu(),mu=qu(),vu=Nu(),gu=Vu(),yu=Zu(),(tu=$u).default=$u),_u=tu,su=Bu(),f=Wu(),au=Uu(),lu=qu(),uu=Hu(),em=Nu(),i=Ju(),Lh=Gu(),cu=Zu(),du=Vu(),rm=Pu(),s.plugin=function(t,n){var e,r=!1;function i(){console&&console.warn&&!r&&(r=!0,console.warn(t+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG)&&process.env.LANG.startsWith("cn")&&console.warn(t+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226");var e=n.apply(void 0,arguments);return e.postcssPlugin=t,e.postcssVersion=(new ou).version,e}return Object.defineProperty(i,"postcss",{get:function(){return e=e||i()}}),i.process=function(e,t,n){return s([i(n)]).process(e,t)},i},s.stringify=ku,s.parse=i,s.fromJSON=_u,s.list=Lh,s.comment=function(e){return new au(e)},s.atRule=function(e){return new lu(e)},s.decl=function(e){return new iu(e)},s.rule=function(e){return new cu(e)},s.root=function(e){return new du(e)},s.document=function(e){return new su(e)},s.CssSyntaxError=ru,s.Declaration=iu,s.Container=a,s.Processor=ou,s.Document=su,s.Comment=au,s.Warning=f,s.AtRule=lu,s.Result=uu,s.Input=em,s.Rule=cu,s.Root=du,s.Node=rm,am.registerPostcss(s),(nu=s).default=s),(Af=(m=nu)&&m.__esModule&&Object.prototype.hasOwnProperty.call(m,"default")?m.default:m).stringify;var Xu=k(nc,[{key:"childNodes",get:function(){for(var e=[],t=this.firstChild;t;)e.push(t),t=t.nextSibling;return e}},{key:"contains",value:function(e){if(e instanceof nc&&e.ownerDocument===this.ownerDocument){if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}}return!1}},{key:"appendChild",value:function(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}},{key:"insertBefore",value:function(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}},{key:"removeChild",value:function(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}},{key:"toString",value:function(){return"RRNode"}}]),Yu={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Qu={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ec={},tc={};function nc(){b(this,nc),Ya(this,"parentElement",null),Ya(this,"parentNode",null),Ya(this,"ownerDocument"),Ya(this,"firstChild",null),Ya(this,"lastChild",null),Ya(this,"previousSibling",null),Ya(this,"nextSibling",null),Ya(this,"ELEMENT_NODE",1),Ya(this,"TEXT_NODE",3),Ya(this,"nodeType"),Ya(this,"nodeName"),Ya(this,"RRNodeType")}function rc(e){if(ec[e])return ec[e];var t=globalThis[e],n=t.prototype,r=e in Yu?Yu[e]:void 0,r=Boolean(r&&r.every(function(e){return Boolean(null==(e=null==(e=Object.getOwnPropertyDescriptor(n,e))?void 0:e.get)?void 0:e.toString().includes("[native code]"))})),i=e in Qu?Qu[e]:void 0,i=Boolean(i&&i.every(function(e){return"function"==typeof n[e]&&(null==(e=n[e])?void 0:e.toString().includes("[native code]"))}));if(r&&i&&!globalThis.Zone)return ec[e]=t.prototype,t.prototype;try{var o,s,a=document.createElement("iframe"),l=(a.style.display="none",document.body.appendChild(a),a.contentWindow);return l?(o=l[e].prototype)?((s=navigator.userAgent).includes("Safari")&&!s.includes("Chrome")?(a.classList.add("rr-block"),a.setAttribute("__rrwebUntaintedMutationObserver",""),tc[e]=function(){return a.remove()}):a.remove(),ec[e]=o):(a.remove(),n):t.prototype}catch(e){return n}}var ic={};function oc(e,t,n){var r="".concat(e,".").concat(String(n));return ic[r]?ic[r].call(t):(e=rc(e),(e=null==(e=Object.getOwnPropertyDescriptor(e,n))?void 0:e.get)?(ic[r]=e).call(t):t[n])}var sc={};function ac(e,t,n){var r="".concat(e,".").concat(String(n));return sc[r]?sc[r].bind(t):"function"!=typeof(e=rc(e)[n])?t[n]:(sc[r]=e).bind(t)}var lc=Date.now;function uc(e,t,n){try{var r,i;return t in e?("function"==typeof(i=n(r=e[t]))&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,function(){e[t]=r}):function(){}}catch(e){return function(){}}}function cc(e){return oc("Node",e,"childNodes")}function dc(e){return oc("Node",e,"parentNode")}function fc(e){return oc("Node",e,"textContent")}/[1-9][0-9]{12}/.test(Date.now().toString())||(lc=function(){return(new Date).getTime()});var hc=function(e){return oc("Node",e,"ownerDocument")},pc=function(e){return oc("Node",e,"parentElement")},mc=function(e,t){return ac("Node",e,"contains")(t)},vc=function(e){return ac("Node",e,"getRootNode")()},gc=function(e){return e&&"host"in e?oc("ShadowRoot",e,"host"):null},yc=function(e){return e&&"shadowRoot"in e?oc("Element",e,"shadowRoot"):null};function wc(e,t,n){var r=2<arguments.length&&void 0!==n?n:document,i={capture:!0,passive:!0};return r.addEventListener(e,t,i),function(){return r.removeEventListener(e,t,i)}}var bc="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.",i={map:{},getId:function(){return console.error(bc),-1},getNode:function(){return console.error(bc),null},removeNodeFromMap:function(){console.error(bc)},has:function(){return console.error(bc),!1},reset:function(){console.error(bc)}};function kc(s,a,e){var l=2<arguments.length&&void 0!==e?e:{},u=null,c=0;return function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=Date.now(),i=(c||!1!==l.leading||(c=r),a-(r-c)),o=this;i<=0||a<i?(u&&(clearTimeout(u),u=null),c=r,s.apply(o,t)):u||!1===l.trailing||(u=setTimeout(function(){c=!1===l.leading?0:Date.now(),u=null,s.apply(o,t)},i))}}function _c(e,t,n,r,i){var i=4<arguments.length&&void 0!==i?i:window,o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set:function(e){var t=this;setTimeout(function(){n.set.call(t,e)},0),o&&o.set&&o.set.call(this,e)}}),function(){return _c(e,t,o||{},!0)}}function Sc(e){var t,n=e.document;return{left:n.scrollingElement?n.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:n.documentElement.scrollLeft||(null==n?void 0:n.body)&&(null==(t=pc(n.body))?void 0:t.scrollLeft)||(null==(t=null==n?void 0:n.body)?void 0:t.scrollLeft)||0,top:n.scrollingElement?n.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==n?void 0:n.documentElement.scrollTop)||(null==n?void 0:n.body)&&(null==(t=pc(n.body))?void 0:t.scrollTop)||(null==(e=null==n?void 0:n.body)?void 0:e.scrollTop)||0}}function Ec(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Cc(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Rc(e){return e?e.nodeType===e.ELEMENT_NODE?e:pc(e):null}function Tc(e,t,n,r){if(e){var i=Rc(e);if(i){try{if("string"==typeof t){if(i.classList.contains(t))return 1;if(r&&null!==i.closest("."+t))return 1}else if(Yo(i,t,r))return 1}catch(e){}if(n){if(i.matches(n))return 1;if(r&&null!==i.closest(n))return 1}}}}function Oc(e,t,n){return"TITLE"===e.tagName&&n.headTitleMutations||-2===t.getId(e)}function xc(e){return Boolean(e.changedTouches)}function Mc(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Ic(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Ac(e){return e&&(e instanceof Xu&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(yc(e)))}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&new Proxy(i,{get:function(e,t,n){return"map"===t&&console.error(bc),Reflect.get(e,t,n)}});var Pc=k(function e(){b(this,e),c(this,"id",1),c(this,"styleIDMap",new WeakMap),c(this,"idStyleMap",new Map)},[{key:"getId",value:function(e){return null!=(e=this.styleIDMap.get(e))?e:-1}},{key:"has",value:function(e){return this.styleIDMap.has(e)}},{key:"add",value:function(e,t){return this.has(e)?this.getId(e):(t=void 0===t?this.id++:t,this.styleIDMap.set(e,t),this.idStyleMap.set(t,e),t)}},{key:"getStyle",value:function(e){return this.idStyleMap.get(e)||null}},{key:"reset",value:function(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}},{key:"generateId",value:function(){return this.id++}}]);function Dc(e){var t,n=null;return n="getRootNode"in e&&(null==(t=vc(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&gc(vc(e))?gc(vc(e)):n}function Lc(e){var t=hc(e);return t&&(mc(t,e)||(n=>{var e,t=hc(n);if(t)return e=(()=>{for(var e,t=n;e=Dc(t);)t=e;return t})(),mc(t,e)})(e))}var Y=Lh={DomContentLoaded:0,0:"DomContentLoaded",Load:1,1:"Load",FullSnapshot:2,2:"FullSnapshot",IncrementalSnapshot:3,3:"IncrementalSnapshot",Meta:4,4:"Meta",Custom:5,5:"Custom",Plugin:6,6:"Plugin",Asset:7,7:"Asset"},De=((a=De||{})[a.Mutation=0]="Mutation",a[a.MouseMove=1]="MouseMove",a[a.MouseInteraction=2]="MouseInteraction",a[a.Scroll=3]="Scroll",a[a.ViewportResize=4]="ViewportResize",a[a.Input=5]="Input",a[a.TouchMove=6]="TouchMove",a[a.MediaInteraction=7]="MediaInteraction",a[a.StyleSheetRule=8]="StyleSheetRule",a[a.CanvasMutation=9]="CanvasMutation",a[a.Font=10]="Font",a[a.Log=11]="Log",a[a.Drag=12]="Drag",a[a.StyleDeclaration=13]="StyleDeclaration",a[a.Selection=14]="Selection",a[a.AdoptedStyleSheet=15]="AdoptedStyleSheet",a[a.CustomElement=16]="CustomElement",a),Nc=((f=Nc||{})[f.MouseUp=0]="MouseUp",f[f.MouseDown=1]="MouseDown",f[f.Click=2]="Click",f[f.ContextMenu=3]="ContextMenu",f[f.DblClick=4]="DblClick",f[f.Focus=5]="Focus",f[f.Blur=6]="Blur",f[f.TouchStart=7]="TouchStart",f[f.TouchMove_Departed=8]="TouchMove_Departed",f[f.TouchEnd=9]="TouchEnd",f[f.TouchCancel=10]="TouchCancel",f),Fc=((em=Fc||{})[em.Mouse=0]="Mouse",em[em.Pen=1]="Pen",em[em.Touch=2]="Touch",em),Uc=((rm={})[rm["2D"]=0]="2D",rm[rm.WebGL=1]="WebGL",rm[rm.WebGL2=2]="WebGL2",rm),zc=((am=zc||{})[am.Play=0]="Play",am[am.Pause=1]="Pause",am[am.Seeked=2]="Seeked",am[am.VolumeChange=3]="VolumeChange",am[am.RateChange=4]="RateChange",am),Bc=((m={})[m.Document=0]="Document",m[m.DocumentType=1]="DocumentType",m[m.Element=2]="Element",m[m.Text=3]="Text",m[m.CDATA=4]="CDATA",m[m.Comment=5]="Comment",m);function jc(e){return"__ln"in e}function Wc(e,t){return"".concat(e,"@").concat(t)}var Hc,qc=k(function e(){b(this,e),c(this,"length",0),c(this,"head",null),c(this,"tail",null)},[{key:"get",value:function(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t}},{key:"addNode",value:function(e){var t,n={value:e,previous:null,next:null};e.__ln=n,e.previousSibling&&jc(e.previousSibling)?(t=e.previousSibling.__ln.next,n.next=t,n.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=n,t&&(t.previous=n)):e.nextSibling&&jc(e.nextSibling)&&e.nextSibling.__ln.previous?(t=e.nextSibling.__ln.previous,n.previous=t,n.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=n,t&&(t.next=n)):(this.head&&(this.head.previous=n),n.next=this.head,this.head=n),null===n.next&&(this.tail=n),this.length++}},{key:"removeNode",value:function(e){var 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--)}}]),Vc=k(function e(){var w=this;b(this,e),c(this,"frozen",!1),c(this,"locked",!1),c(this,"texts",[]),c(this,"attributes",[]),c(this,"attributeMap",new WeakMap),c(this,"removes",[]),c(this,"mapRemoves",[]),c(this,"movedMap",{}),c(this,"addedSet",new Set),c(this,"movedSet",new Set),c(this,"droppedSet",new Set),c(this,"removesSubTreeCache",new Set),c(this,"mutationCb"),c(this,"blockClass"),c(this,"blockSelector"),c(this,"maskTextClass"),c(this,"maskTextSelector"),c(this,"inlineStylesheet"),c(this,"maskInputOptions"),c(this,"maskTextFn"),c(this,"maskInputFn"),c(this,"keepIframeSrcFn"),c(this,"recordCanvas"),c(this,"inlineImages"),c(this,"slimDOMOptions"),c(this,"dataURLOptions"),c(this,"doc"),c(this,"mirror"),c(this,"iframeManager"),c(this,"stylesheetManager"),c(this,"shadowDomManager"),c(this,"canvasManager"),c(this,"processedNodeManager"),c(this,"unattachedDoc"),c(this,"processMutations",function(e){e.forEach(w.processMutation),w.emit()}),c(this,"emit",function(){if(!w.frozen&&!w.locked){for(var i=[],o=new Set,s=new qc,a=function(e){for(var t=e,n=-2;-2===n;)n=(t=t&&t.nextSibling)&&w.mirror.getId(t);return n},e=function(t){var e=dc(t);if(e&&Lc(t)){var n=!1;if(t.nodeType===Node.TEXT_NODE){var r=e.tagName;if("TEXTAREA"===r)return;"STYLE"===r&&w.addedSet.has(e)&&(n=!0)}r=Co(e)?w.mirror.getId(Dc(t)):w.mirror.getId(e),e=a(t);if(-1===r||-1===e)return s.addNode(t);n=ts(t,{doc:w.doc,mirror:w.mirror,blockClass:w.blockClass,blockSelector:w.blockSelector,maskTextClass:w.maskTextClass,maskTextSelector:w.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:w.inlineStylesheet,maskInputOptions:w.maskInputOptions,maskTextFn:w.maskTextFn,maskInputFn:w.maskInputFn,slimDOMOptions:w.slimDOMOptions,dataURLOptions:w.dataURLOptions,recordCanvas:w.recordCanvas,inlineImages:w.inlineImages,onSerialize:function(e){Mc(e,w.mirror)&&w.iframeManager.addIframe(e),Ic(e,w.mirror)&&w.stylesheetManager.trackLinkElement(e),Ac(t)&&w.shadowDomManager.addShadowRoot(yc(t),w.doc)},onIframeLoad:function(e,t){w.iframeManager.attachIframe(e,t),w.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:function(e,t){w.stylesheetManager.attachLinkElement(e,t)},cssCaptured:n});n&&(i.push({parentId:r,nextId:e,node:n}),o.add(n.id))}};w.mapRemoves.length;)w.mirror.removeNodeFromMap(w.mapRemoves.shift());var t,n=Ie(w.movedSet);try{for(n.s();!(t=n.n()).done;){var r=t.value;Zc(w.removesSubTreeCache,r,w.mirror)&&!w.movedSet.has(dc(r))||e(r)}}catch(i){n.e(i)}finally{n.f()}var l,u=Ie(w.addedSet);try{for(u.s();!(l=u.n()).done;){var c=l.value;!Jc(w.droppedSet,c)&&!Zc(w.removesSubTreeCache,c,w.mirror)||Jc(w.movedSet,c)?e(c):w.droppedSet.add(c)}}catch(i){u.e(i)}finally{u.f()}for(var d=null;s.length;){var f,h,p=null;if(!(p=d&&(f=w.mirror.getId(dc(d.value)),h=a(d.value),-1!==f)&&-1!==h?d:p))for(var m=s.tail;m;){var v=m,m=m.previous;if(v){var g=w.mirror.getId(dc(v.value));if(-1!==a(v.value)){if(-1!==g){p=v;break}g=v.value,g=dc(g);if(g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE){g=gc(g);if(-1!==w.mirror.getId(g)){p=v;break}}}}}if(!p){for(;s.head;)s.removeNode(s.head.value);break}d=p.previous,s.removeNode(p.value),e(p.value)}var y={texts:w.texts.map(function(e){var t=e.node,n=dc(t);return n&&"TEXTAREA"===n.tagName&&w.genTextAreaValueMutation(n),{id:w.mirror.getId(t),value:e.value}}).filter(function(e){return!o.has(e.id)}).filter(function(e){return w.mirror.has(e.id)}),attributes:w.attributes.map(function(e){var t,n,r=e.attributes;return"string"==typeof r.style&&(t=JSON.stringify(e.styleDiff),n=JSON.stringify(e._unchangedStyles),t.length<r.style.length)&&(t+n).split("var(").length===r.style.split("var(").length&&(r.style=e.styleDiff),{id:w.mirror.getId(e.node),attributes:r}}).filter(function(e){return!o.has(e.id)}).filter(function(e){return w.mirror.has(e.id)}),removes:w.removes,adds:i};(y.texts.length||y.attributes.length||y.removes.length||y.adds.length)&&(w.texts=[],w.attributes=[],w.attributeMap=new WeakMap,w.removes=[],w.addedSet=new Set,w.movedSet=new Set,w.droppedSet=new Set,w.removesSubTreeCache=new Set,w.movedMap={},w.mutationCb(y))}}),c(this,"genTextAreaValueMutation",function(e){var t=w.attributeMap.get(e),n=(t||(w.attributes.push(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}}),w.attributeMap.set(e,t)),Array.from(cc(e),function(e){return fc(e)||""}).join(""));t.attributes.value=Mo({element:e,maskInputOptions:w.maskInputOptions,tagName:e.tagName,type:Ao(e),value:n,maskInputFn:w.maskInputFn})}),c(this,"processMutation",function(s){if(!Oc(s.target,w.mirror,w.slimDOMOptions))switch(s.type){case"characterData":var e=fc(s.target);Tc(s.target,w.blockClass,w.blockSelector,!1)||e===s.oldValue||w.texts.push({value:Qo(s.target,w.maskTextClass,w.maskTextSelector,!0)&&e?w.maskTextFn?w.maskTextFn(e,Rc(s.target)):e.replace(/[\S]/g,"*"):e,node:s.target});break;case"attributes":var t,n=s.target,e=s.attributeName,r=s.target.getAttribute(e);if("value"===e&&(t=Ao(n),r=Mo({element:n,maskInputOptions:w.maskInputOptions,tagName:n.tagName,type:t,value:r,maskInputFn:w.maskInputFn})),!Tc(s.target,w.blockClass,w.blockSelector,!1)&&r!==s.oldValue){var i=w.attributeMap.get(s.target);if("IFRAME"===n.tagName&&"src"===e&&!w.keepIframeSrcFn(r)){if(n.contentDocument)return;e="rr_src"}if(i||(i={node:s.target,attributes:{},styleDiff:{},_unchangedStyles:{}},w.attributes.push(i),w.attributeMap.set(s.target,i)),"type"===e&&"INPUT"===n.tagName&&"password"===(s.oldValue||"").toLowerCase()&&n.setAttribute("data-rr-is-password","true"),!Xo(n.tagName,e))if(i.attributes[e]=$o(w.doc,Io(n.tagName),Io(e),r),"style"===e){if(!w.unattachedDoc)try{w.unattachedDoc=document.implementation.createHTMLDocument()}catch(s){w.unattachedDoc=w.doc}var o=w.unattachedDoc.createElement("span");s.oldValue&&o.setAttribute("style",s.oldValue);for(var a=0,l=Array.from(n.style);a<l.length;a++){var u=l[a],c=n.style.getPropertyValue(u),d=n.style.getPropertyPriority(u);c!==o.style.getPropertyValue(u)||d!==o.style.getPropertyPriority(u)?i.styleDiff[u]=""===d?c:[c,d]:i._unchangedStyles[u]=[c,d]}for(var f=0,h=Array.from(o.style);f<h.length;f++){var p=h[f];""===n.style.getPropertyValue(p)&&(i.styleDiff[p]=!1)}}else"open"===e&&"DIALOG"===n.tagName&&(n.matches("dialog:modal")?i.attributes.rr_open_mode="modal":i.attributes.rr_open_mode="non-modal")}break;case"childList":return Tc(s.target,w.blockClass,w.blockSelector,!0)?void 0:"TEXTAREA"===s.target.tagName?void w.genTextAreaValueMutation(s.target):(s.addedNodes.forEach(function(e){return w.genAdds(e,s.target)}),void s.removedNodes.forEach(function(e){var t=w.mirror.getId(e),n=Co(s.target)?w.mirror.getId(gc(s.target)):w.mirror.getId(s.target);if(!Tc(s.target,w.blockClass,w.blockSelector,!1)&&!Oc(e,w.mirror,w.slimDOMOptions)&&-1!==w.mirror.getId(e)){if(w.addedSet.has(e))Gc(w.addedSet,e),w.droppedSet.add(e);else if(!(w.addedSet.has(s.target)&&-1===t||function e(t,n){var r;return!Co(t)&&(r=n.getId(t),!n.has(r)||(!(r=dc(t))||r.nodeType!==t.DOCUMENT_NODE)&&(!r||e(r,n)))}(s.target,w.mirror)))if(w.movedSet.has(e)&&w.movedMap[Wc(t,n)])Gc(w.movedSet,e);else{w.removes.push({parentId:n,id:t,isShadow:!(!Co(s.target)||!Ro(s.target))||void 0});for(var r=w.removesSubTreeCache,i=[e];i.length;){var o=i.pop();r.has(o)||(r.add(o),cc(o).forEach(function(e){return i.push(e)}))}}w.mapRemoves.push(e)}}))}}),c(this,"genAdds",function(t,e){if(!w.processedNodeManager.inOtherBuffer(t,w)&&!w.addedSet.has(t)&&!w.movedSet.has(t)){if(w.mirror.hasNode(t)){if(Oc(t,w.mirror,w.slimDOMOptions))return;w.movedSet.add(t);var n=null;(n=e&&w.mirror.hasNode(e)?w.mirror.getId(e):n)&&-1!==n&&(w.movedMap[Wc(w.mirror.getId(t),n)]=!0)}else w.addedSet.add(t),w.droppedSet.delete(t);Tc(t,w.blockClass,w.blockSelector,!1)||(cc(t).forEach(function(e){return w.genAdds(e)}),Ac(t)&&cc(yc(t)).forEach(function(e){w.processedNodeManager.add(e,w),w.genAdds(e,t)}))}})},[{key:"init",value:function(t){var n=this;["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(function(e){n[e]=t[e]})}},{key:"freeze",value:function(){this.frozen=!0,this.canvasManager.freeze()}},{key:"unfreeze",value:function(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}},{key:"isFrozen",value:function(){return this.frozen}},{key:"lock",value:function(){this.locked=!0,this.canvasManager.lock()}},{key:"unlock",value:function(){this.locked=!1,this.canvasManager.unlock(),this.emit()}},{key:"reset",value:function(){this.shadowDomManager.reset(),this.canvasManager.reset()}}]);function Gc(t,e){t.delete(e),cc(e).forEach(function(e){return Gc(t,e)})}function Zc(e,t){return 0!==e.size&&(e=e,t=dc(t))&&e.has(t)}function Jc(e,t){return 0!==e.size&&function e(t,n){n=dc(n);return!!n&&(!!t.has(n)||e(t,n))}(e,t)}var Le=function(e){return Hc?function(){try{return e.apply(void 0,arguments)}catch(e){if(!Hc||!0!==Hc(e))throw e}}:e},Kc=[];function $c(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(e){}return e&&e.target}function Xc(e,t){var n=new Vc;Kc.push(n),n.init(e);var e=Pe([rc("MutationObserver").constructor,null!=(e=tc.MutationObserver)?e:function(){}],2),r=e[0],e=e[1],r=new r(Le(n.processMutations.bind(n)));return r.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),[r,e]}function Yc(e){var t,r,s,a=e.mouseInteractionCb,i=e.doc,l=e.mirror,u=e.blockClass,c=e.blockSelector,e=e.sampling;return!1===e.mouseInteraction?function(){}:(t=!0===e.mouseInteraction||void 0===e.mouseInteraction?{}:e.mouseInteraction,r=[],s=null,Object.keys(Nc).filter(function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==t[e]}).forEach(function(e){function t(e){var t=$c(e);if(!Tc(t,u,c,!0)){var n=null,r=o;if("pointerType"in e){switch(e.pointerType){case"mouse":n=Fc.Mouse;break;case"touch":n=Fc.Touch;break;case"pen":n=Fc.Pen}n===Fc.Touch?Nc[o]===Nc.MouseDown?r="TouchStart":Nc[o]===Nc.MouseUp&&(r="TouchEnd"):Fc.Pen}else xc(e)&&(n=Fc.Touch);null!==n?(s=n,(r.startsWith("Touch")&&n===Fc.Touch||r.startsWith("Mouse")&&n===Fc.Mouse)&&(n=null)):Nc[o]===Nc.Click&&(n=s,s=null);var i,e=xc(e)?e.changedTouches[0]:e;e&&(t=l.getId(t),i=e.clientX,e=e.clientY,Le(a)(Ae({type:Nc[r],id:t,x:i,y:e},null!==n&&{pointerType:n})))}}var o,n=Io(e);o=e;if(window.PointerEvent)switch(Nc[e]){case Nc.MouseDown:case Nc.MouseUp:n=n.replace("mouse","pointer");break;case Nc.TouchStart:case Nc.TouchEnd:return}r.push(wc(n,t,i))}),Le(function(){r.forEach(function(e){return e()})}))}function Qc(e){var r=e.scrollCb,i=e.doc,o=e.mirror,s=e.blockClass,a=e.blockSelector,e=e.sampling;return wc("scroll",Le(kc(Le(function(e){var t,n,e=$c(e);e&&!Tc(e,s,a,!0)&&(t=o.getId(e),e===i&&i.defaultView?(n=Sc(i.defaultView),r({id:t,x:n.left,y:n.top})):r({id:t,x:e.scrollLeft,y:e.scrollTop}))}),e.scroll||100)),i)}var ed=["INPUT","TEXTAREA","SELECT"],td=new WeakMap;function nd(e){return function e(t,n){var r;return sd("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||sd("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||sd("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||sd("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule?(r=Array.from(t.parentRule.cssRules).indexOf(t),n.unshift(r),e(t.parentRule,n)):(t.parentStyleSheet&&(r=Array.from(t.parentStyleSheet.cssRules).indexOf(t),n.unshift(r)),n)}(e,[])}function rd(e,t,n){var r,i;return e?(e.ownerNode?r=t.getId(e.ownerNode):i=n.getId(e),{styleId:i,id:r}):{}}function id(e,t){var n=e.mirror,r=e.stylesheetManager,i="#document"===t.nodeName?n.getId(t):n.getId(gc(t)),n="#document"===t.nodeName?null==(e=t.defaultView)?void 0:e.Document:null==(e=null==(n=t.ownerDocument)?void 0:n.defaultView)?void 0:e.ShadowRoot,o=null!=n&&n.prototype?Object.getOwnPropertyDescriptor(null==n?void 0:n.prototype,"adoptedStyleSheets"):void 0;return null!==i&&-1!==i&&n&&o?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:o.configurable,enumerable:o.enumerable,get:function(){var e;return null==(e=o.get)?void 0:e.call(this)},set:function(e){var t=null==(t=o.set)?void 0:t.call(this,e);if(null!==i&&-1!==i)try{r.adoptStyleSheets(e,i)}catch(e){}return t}}),Le(function(){Object.defineProperty(t,"adoptedStyleSheets",{configurable:o.configurable,enumerable:o.enumerable,get:o.get,set:o.set})})):function(){}}function od(e){var t,n,L,N,F,U,z,B,j,W,H,q,V,G,r=e.doc.defaultView;if(!r)return function(){};t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=(R=e).mutationCb,L=R.mousemoveCb,N=R.mouseInteractionCb,F=R.scrollCb,U=R.viewportResizeCb,z=R.inputCb,B=R.mediaInteractionCb,j=R.styleSheetRuleCb,W=R.styleDeclarationCb,H=R.canvasMutationCb,q=R.fontCb,V=R.selectionCb,G=R.customElementCb,R.mutationCb=function(){t.mutation&&t.mutation.apply(t,arguments),n.apply(void 0,arguments)},R.mousemoveCb=function(){t.mousemove&&t.mousemove.apply(t,arguments),L.apply(void 0,arguments)},R.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction.apply(t,arguments),N.apply(void 0,arguments)},R.scrollCb=function(){t.scroll&&t.scroll.apply(t,arguments),F.apply(void 0,arguments)},R.viewportResizeCb=function(){t.viewportResize&&t.viewportResize.apply(t,arguments),U.apply(void 0,arguments)},R.inputCb=function(){t.input&&t.input.apply(t,arguments),z.apply(void 0,arguments)},R.mediaInteractionCb=function(){t.mediaInteaction&&t.mediaInteaction.apply(t,arguments),B.apply(void 0,arguments)},R.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule.apply(t,arguments),j.apply(void 0,arguments)},R.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration.apply(t,arguments),W.apply(void 0,arguments)},R.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation.apply(t,arguments),H.apply(void 0,arguments)},R.fontCb=function(){t.font&&t.font.apply(t,arguments),q.apply(void 0,arguments)},R.selectionCb=function(){t.selection&&t.selection.apply(t,arguments),V.apply(void 0,arguments)},R.customElementCb=function(){t.customElement&&t.customElement.apply(t,arguments),G.apply(void 0,arguments)};var i,Z,J,K,$,X,Y,Q,s,ee,te,ne,re,a,l,ie,u,o,c,oe,d,f,h,p,se,ae,le,ue,m,v,g,ce,y,w,b,k,_,S,E,C,de=function(){},fe=(e.recordDOM&&(R=Pe(Xc(e,e.doc),2),i=R[0],de=R[1]),le=(R=e).mousemoveCb,O=R.doc,ue=R.mirror,!1===(T=R.sampling).mousemove?function(){}:(R="number"==typeof T.mousemove?T.mousemove:50,T="number"==typeof T.mousemoveCallback?T.mousemoveCallback:500,p=[],se=kc(Le(function(e){var t=Date.now()-h;le(p.map(function(e){return e.timeOffset-=t,e}),e),p=[],h=null}),T),T=Le(kc(Le(function(e){var t=$c(e),n=xc(e)?e.changedTouches[0]:e,r=n.clientX,n=n.clientY;h=h||lc(),p.push({x:r,y:n,id:ue.getId(t),timeOffset:lc()-h}),se("undefined"!=typeof DragEvent&&e instanceof DragEvent?De.Drag:e instanceof MouseEvent?De.MouseMove:De.TouchMove)}),R,{trailing:!1})),ae=[wc("mousemove",T,O),wc("touchmove",T,O),wc("drag",T,O)],Le(function(){ae.forEach(function(e){return e()})}))),he=Yc(e),pe=Qc(e),me=(R={win:r},oe=(T=e).viewportResizeCb,T=R.win,f=d=-1,wc("resize",Le(kc(Le(function(){var e=Ec(),t=Cc();d===e&&f===t||(oe({width:Number(t),height:Number(e)}),d=e,f=t)}),200)),T)),ve=(Q=(O=e).inputCb,s=O.doc,ee=O.mirror,te=O.blockClass,ne=O.blockSelector,re=O.ignoreClass,a=O.ignoreSelector,l=O.maskInputOptions,ie=O.maskInputFn,u=O.userTriggeredOnInput,o=("last"===O.sampling.input?["change"]:["input","change"]).map(function(e){return wc(e,Le(_e),s)}),(c=s.defaultView)?(O=c.Object.getOwnPropertyDescriptor(c.HTMLInputElement.prototype,"value"),R=[[c.HTMLInputElement.prototype,"value"],[c.HTMLInputElement.prototype,"checked"],[c.HTMLSelectElement.prototype,"value"],[c.HTMLTextAreaElement.prototype,"value"],[c.HTMLSelectElement.prototype,"selectedIndex"],[c.HTMLOptionElement.prototype,"selected"]],O&&O.set&&o.push.apply(o,Qi(R.map(function(e){return _c(e[0],e[1],{set:function(){Le(_e)({target:this,isTrusted:!1})}},!1,c)}))),Le(function(){o.forEach(function(e){return e()})})):function(){o.forEach(function(e){return e()})}),ge=(Z=(T=e).mediaInteractionCb,J=T.blockClass,K=T.blockSelector,$=T.mirror,X=T.sampling,T=T.doc,O=Le(function(s){return kc(Le(function(e){var t,n,r,i,o,e=$c(e);e&&!Tc(e,J,K,!0)&&(t=e.currentTime,n=e.volume,r=e.muted,i=e.playbackRate,o=e.loop,Z({type:s,id:$.getId(e),currentTime:t,volume:n,muted:r,playbackRate:i,loop:o}))}),X.media||500)}),Y=[wc("play",O(zc.Play),T),wc("pause",O(zc.Pause),T),wc("seeked",O(zc.Seeked),T),wc("volumechange",O(zc.VolumeChange),T),wc("ratechange",O(zc.RateChange),T)],Le(function(){Y.forEach(function(e){return e()})})),ye=function(){},we=function(){},be=function(){},ke=function(){};function _e(e){var t,n,r,i=$c(e),e=e.isTrusted,o=i&&i.tagName;!(i=i&&"OPTION"===o?pc(i):i)||!o||ed.indexOf(o)<0||Tc(i,te,ne,!0)||i.classList.contains(re)||a&&i.matches(a)||(t=i.value,n=!1,"radio"===(r=Ao(i)||"")||"checkbox"===r?n=i.checked:(l[o.toLowerCase()]||l[r])&&(t=Mo({element:i,maskInputOptions:l,tagName:o,type:r,value:t,maskInputFn:ie})),Se(i,u?{text:t,isChecked:n,userTriggered:e}:{text:t,isChecked:n}),o=i.name,"radio"===r&&o&&n&&s.querySelectorAll('input[type="radio"][name="'.concat(o,'"]')).forEach(function(e){var t;e!==i&&(t=e.value,Se(e,u?{text:t,isChecked:!n,userTriggered:!1}:{text:t,isChecked:!n}))}))}function Se(e,t){var n=td.get(e);n&&n.text===t.text&&n.isChecked===t.isChecked||(td.set(e,t),n=ee.getId(e),Le(Q)(Ae(Ae({},t),{},{id:n})))}e.recordDOM&&(ye=((e,t)=>{var a=e.styleSheetRuleCb,l=e.mirror,u=e.stylesheetManager,r=t.win;if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return function(){};var n=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(n,{apply:Le(function(e,t,n){var r=Pe(n,2),i=r[0],r=r[1],o=rd(t,l,u.styleMirror),s=o.id,o=o.styleId;return(s&&-1!==s||o&&-1!==o)&&a({id:s,styleId:o,adds:[{rule:i,index:r}]}),e.apply(t,n)})}),r.CSSStyleSheet.prototype.addRule=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:this.cssRules.length,e="".concat(e," { ").concat(t," }");return r.CSSStyleSheet.prototype.insertRule.apply(this,[e,n])};var i,o,s=r.CSSStyleSheet.prototype.deleteRule,c=(r.CSSStyleSheet.prototype.deleteRule=new Proxy(s,{apply:Le(function(e,t,n){var r=Pe(n,1)[0],i=rd(t,l,u.styleMirror),o=i.id,i=i.styleId;return(o&&-1!==o||i&&-1!==i)&&a({id:o,styleId:i,removes:[{index:r}]}),e.apply(t,n)})}),r.CSSStyleSheet.prototype.removeRule=function(e){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},r.CSSStyleSheet.prototype.replace&&(i=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(i,{apply:Le(function(e,t,n){var r=Pe(n,1)[0],i=rd(t,l,u.styleMirror),o=i.id,i=i.styleId;return(o&&-1!==o||i&&-1!==i)&&a({id:o,styleId:i,replace:r}),e.apply(t,n)})})),r.CSSStyleSheet.prototype.replaceSync&&(o=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(o,{apply:Le(function(e,t,n){var r=Pe(n,1)[0],i=rd(t,l,u.styleMirror),o=i.id,i=i.styleId;return(o&&-1!==o||i&&-1!==i)&&a({id:o,styleId:i,replaceSync:r}),e.apply(t,n)})})),{}),d=(ad("CSSGroupingRule")?c.CSSGroupingRule=r.CSSGroupingRule:(ad("CSSMediaRule")&&(c.CSSMediaRule=r.CSSMediaRule),ad("CSSConditionRule")&&(c.CSSConditionRule=r.CSSConditionRule),ad("CSSSupportsRule")&&(c.CSSSupportsRule=r.CSSSupportsRule)),{});return Object.entries(c).forEach(function(e){var e=Pe(e,2),t=e[0],e=e[1];d[t]={insertRule:e.prototype.insertRule,deleteRule:e.prototype.deleteRule},e.prototype.insertRule=new Proxy(d[t].insertRule,{apply:Le(function(e,t,n){var r=Pe(n,2),i=r[0],r=r[1],o=rd(t.parentStyleSheet,l,u.styleMirror),s=o.id,o=o.styleId;return(s&&-1!==s||o&&-1!==o)&&a({id:s,styleId:o,adds:[{rule:i,index:[].concat(Qi(nd(t)),[r||0])}]}),e.apply(t,n)})}),e.prototype.deleteRule=new Proxy(d[t].deleteRule,{apply:Le(function(e,t,n){var r=Pe(n,1)[0],i=rd(t.parentStyleSheet,l,u.styleMirror),o=i.id,i=i.styleId;return(o&&-1!==o||i&&-1!==i)&&a({id:o,styleId:i,removes:[{index:[].concat(Qi(nd(t)),[r])}]}),e.apply(t,n)})})}),Le(function(){r.CSSStyleSheet.prototype.insertRule=n,r.CSSStyleSheet.prototype.deleteRule=s,i&&(r.CSSStyleSheet.prototype.replace=i),o&&(r.CSSStyleSheet.prototype.replaceSync=o),Object.entries(c).forEach(function(e){var e=Pe(e,2),t=e[0],e=e[1];e.prototype.insertRule=d[t].insertRule,e.prototype.deleteRule=d[t].deleteRule})})})(e,{win:r}),we=id(e,e.doc),R={win:r},w=(O=e).styleDeclarationCb,b=O.mirror,k=O.ignoreCSSAttributes,_=O.stylesheetManager,S=R.win,E=S.CSSStyleDeclaration.prototype.setProperty,S.CSSStyleDeclaration.prototype.setProperty=new Proxy(E,{apply:Le(function(e,t,n){var r,i,o=Pe(n,3),s=o[0],a=o[1],o=o[2];return k.has(s)?E.apply(t,[s,a,o]):(r=(i=rd(null==(i=t.parentRule)?void 0:i.parentStyleSheet,b,_.styleMirror)).id,i=i.styleId,(r&&-1!==r||i&&-1!==i)&&w({id:r,styleId:i,set:{property:s,value:a,priority:o},index:nd(t.parentRule)}),e.apply(t,n))})}),C=S.CSSStyleDeclaration.prototype.removeProperty,S.CSSStyleDeclaration.prototype.removeProperty=new Proxy(C,{apply:Le(function(e,t,n){var r,i,o=Pe(n,1)[0];return k.has(o)?C.apply(t,[o]):(r=(i=rd(null==(i=t.parentRule)?void 0:i.parentStyleSheet,b,_.styleMirror)).id,i=i.styleId,(r&&-1!==r||i&&-1!==i)&&w({id:r,styleId:i,remove:{property:o},index:nd(t.parentRule)}),e.apply(t,n))})}),be=Le(function(){S.CSSStyleDeclaration.prototype.setProperty=E,S.CSSStyleDeclaration.prototype.removeProperty=C}),e.collectFonts)&&(ce=(T=e).fontCb,y=(T=T.doc).defaultView,ke=y?(m=[],v=new WeakMap,g=y.FontFace,y.FontFace=function(e,t,n){var r=new g(e,t,n);return v.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r},T=uc(T.fonts,"add",function(e){return function(t){return setTimeout(Le(function(){var e=v.get(t);e&&(ce(e),v.delete(t))}),0),e.apply(this,[t])}}),m.push(function(){y.FontFace=g}),m.push(T),Le(function(){m.forEach(function(e){return e()})})):function(){});Re=(O=e).doc,x=O.mirror,M=O.blockClass,I=O.blockSelector,Te=O.selectionCb,A=!0,(O=Le(function(){var e=Re.getSelection();if(!(!e||A&&null!=e&&e.isCollapsed)){A=e.isCollapsed||!1;for(var t=[],n=e.rangeCount||0,r=0;r<n;r++){var i=e.getRangeAt(r),o=i.startContainer,s=i.startOffset,a=i.endContainer,i=i.endOffset;Tc(o,M,I,!0)||Tc(a,M,I,!0)||t.push({start:x.getId(o),startOffset:s,end:x.getId(a),endOffset:i})}Te({ranges:t})}}))();var Ee,R,T,Ce,O,Re,x,M,I,Te,A,Oe=wc("selectionchange",O),xe=(T=(R=e).doc,Ce=R.customElementCb,(R=T.defaultView)&&R.customElements?uc(R.customElements,"define",function(r){return function(t,e,n){try{Ce({define:{name:t}})}catch(e){console.warn("Custom element callback failed for ".concat(t))}return r.apply(this,[t,e,n])}}):function(){}),Me=[],P=Ie(e.plugins);try{for(P.s();!(Ee=P.n()).done;){var D=Ee.value;Me.push(D.observer(D.callback,r,D.options))}}catch(e){P.e(e)}finally{P.f()}return Le(function(){Kc.forEach(function(e){return e.reset()}),null!=i&&i.disconnect(),de(),fe(),he(),pe(),me(),ve(),ge(),ye(),we(),be(),ke(),Oe(),xe(),Me.forEach(function(e){return e()})})}function sd(e){return void 0!==window[e]}function ad(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}for(var ld=k(function e(t){b(this,e),c(this,"iframeIdToRemoteIdMap",new WeakMap),c(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t},[{key:"getId",value:function(e,t,n,r){n=n||this.getIdToRemoteIdMap(e),r=r||this.getRemoteIdToIdMap(e),e=n.get(t);return e||(e=this.generateIdFn(),n.set(t,e),r.set(e,t)),e}},{key:"getIds",value:function(t,e){var n=this,r=this.getIdToRemoteIdMap(t),i=this.getRemoteIdToIdMap(t);return e.map(function(e){return n.getId(t,e,r,i)})}},{key:"getRemoteId",value:function(e,t,n){n=n||this.getRemoteIdToIdMap(e);return"number"!=typeof t?t:n.get(t)||-1}},{key:"getRemoteIds",value:function(t,e){var n=this,r=this.getRemoteIdToIdMap(t);return e.map(function(e){return n.getRemoteId(t,e,r)})}},{key:"reset",value:function(e){e?(this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)):(this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap)}},{key:"getIdToRemoteIdMap",value:function(e){var t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}},{key:"getRemoteIdToIdMap",value:function(e){var t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}]),ud=k(function e(t){b(this,e),c(this,"iframes",new WeakMap),c(this,"crossOriginIframeMap",new WeakMap),c(this,"crossOriginIframeMirror",new ld(qo)),c(this,"crossOriginIframeStyleMirror"),c(this,"crossOriginIframeRootIdMap",new WeakMap),c(this,"mirror"),c(this,"mutationCb"),c(this,"wrappedEmit"),c(this,"loadListener"),c(this,"stylesheetManager"),c(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ld(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))},[{key:"addIframe",value:function(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}},{key:"addLoadListener",value:function(e){this.loadListener=e}},{key:"attachIframe",value:function(e,t){this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&null!=(t=e.contentWindow)&&t.addEventListener("message",this.handleMessage.bind(this)),null!=(t=this.loadListener)&&t.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&0<e.contentDocument.adoptedStyleSheets.length&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}},{key:"handleMessage",value:function(e){var t=e;"rrweb"===t.data.type&&t.origin===t.data.origin&&e.source&&(e=this.crossOriginIframeMap.get(e.source))&&(e=this.transformCrossOriginEvent(e,t.data.event))&&this.wrappedEmit(e,t.data.isCheckout)}},{key:"transformCrossOriginEvent",value:function(n,e){var t,r=this;switch(e.type){case Y.FullSnapshot:this.crossOriginIframeMirror.reset(n),this.crossOriginIframeStyleMirror.reset(n),this.replaceIdOnNode(e.data.node,n);var i=e.data.node.id;return this.crossOriginIframeRootIdMap.set(n,i),this.patchRootIdOnNode(e.data.node,i),{timestamp:e.timestamp,type:Y.IncrementalSnapshot,data:{source:De.Mutation,adds:[{parentId:this.mirror.getId(n),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Y.Meta:case Y.Load:case Y.DomContentLoaded:return!1;case Y.Plugin:return e;case Y.Custom:return this.replaceIds(e.data.payload,n,["id","parentId","previousId","nextId"]),e;case Y.IncrementalSnapshot:switch(e.data.source){case De.Mutation:return e.data.adds.forEach(function(e){r.replaceIds(e,n,["parentId","nextId","previousId"]),r.replaceIdOnNode(e.node,n);var t=r.crossOriginIframeRootIdMap.get(n);t&&r.patchRootIdOnNode(e.node,t)}),e.data.removes.forEach(function(e){r.replaceIds(e,n,["parentId","id"])}),e.data.attributes.forEach(function(e){r.replaceIds(e,n,["id"])}),e.data.texts.forEach(function(e){r.replaceIds(e,n,["id"])}),e;case De.Drag:case De.TouchMove:case De.MouseMove:return e.data.positions.forEach(function(e){r.replaceIds(e,n,["id"])}),e;case De.ViewportResize:return!1;case De.MediaInteraction:case De.MouseInteraction:case De.Scroll:case De.CanvasMutation:case De.Input:return this.replaceIds(e.data,n,["id"]),e;case De.StyleSheetRule:case De.StyleDeclaration:return this.replaceIds(e.data,n,["id"]),this.replaceStyleIds(e.data,n,["styleId"]),e;case De.Font:return e;case De.Selection:return e.data.ranges.forEach(function(e){r.replaceIds(e,n,["start","end"])}),e;case De.AdoptedStyleSheet:return this.replaceIds(e.data,n,["id"]),this.replaceStyleIds(e.data,n,["styleIds"]),null!=(t=e.data.styles)&&t.forEach(function(e){r.replaceStyleIds(e,n,["styleId"])}),e}}return!1}},{key:"replace",value:function(e,t,n,r){var i,o=Ie(r);try{for(o.s();!(i=o.n()).done;){var s=i.value;!Array.isArray(t[s])&&"number"!=typeof t[s]||(Array.isArray(t[s])?t[s]=e.getIds(n,t[s]):t[s]=e.getId(n,t[s]))}}catch(e){o.e(e)}finally{o.f()}return t}},{key:"replaceIds",value:function(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}},{key:"replaceStyleIds",value:function(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}},{key:"replaceIdOnNode",value:function(e,t){var n=this;this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(function(e){n.replaceIdOnNode(e,t)})}},{key:"patchRootIdOnNode",value:function(e,t){var n=this;e.type===Bc.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(function(e){n.patchRootIdOnNode(e,t)})}}]),cd=k(function e(t){b(this,e),c(this,"shadowDoms",new WeakSet),c(this,"mutationCb"),c(this,"scrollCb"),c(this,"bypassOptions"),c(this,"mirror"),c(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()},[{key:"init",value:function(){this.reset(),this.patchAttachShadow(Element,document)}},{key:"addShadowRoot",value:function(e,t){var n,r=this;Ro(e)&&!this.shadowDoms.has(e)&&(this.shadowDoms.add(e),n=Pe(Xc(Ae(Ae({},this.bypassOptions),{},{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),1)[0],this.restoreHandlers.push(function(){return n.disconnect()}),this.restoreHandlers.push(Qc(Ae(Ae({},this.bypassOptions),{},{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout(function(){e.adoptedStyleSheets&&0<e.adoptedStyleSheets.length&&r.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,r.mirror.getId(gc(e))),r.restoreHandlers.push(id({mirror:r.mirror,stylesheetManager:r.bypassOptions.stylesheetManager},e))},0))}},{key:"observeAttachShadow",value:function(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}},{key:"patchAttachShadow",value:function(e,r){var i=this;this.restoreHandlers.push(uc(e.prototype,"attachShadow",function(n){return function(e){var e=n.call(this,e),t=yc(this);return t&&Lc(this)&&i.addShadowRoot(t,r),e}}))}},{key:"reset",value:function(){this.restoreHandlers.forEach(function(e){try{e()}catch(e){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}]),dd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",fd="undefined"==typeof Uint8Array?[]:new Uint8Array(256),hd=0;hd<dd.length;hd++)fd[dd.charCodeAt(hd)]=hd;function pd(e,t,n){return e.map(function(e){return function t(i,n,r){return i instanceof Array?i.map(function(e){return t(e,n,r)}):null===i?i:i instanceof Float32Array||i instanceof Float64Array||i instanceof Int32Array||i instanceof Uint32Array||i instanceof Uint8Array||i instanceof Uint16Array||i instanceof Int16Array||i instanceof Int8Array||i instanceof Uint8ClampedArray?{rr_type:i.constructor.name,args:[Object.values(i)]}:i instanceof ArrayBuffer?{rr_type:i.constructor.name,base64:(()=>{for(var e=new Uint8Array(i),t=e.length,n="",r=0;r<t;r+=3)n=(n=(n=(n+=dd[e[r]>>2])+dd[(3&e[r])<<4|e[r+1]>>4])+dd[(15&e[r+1])<<2|e[r+2]>>6])+dd[63&e[r+2]];return t%3==2?n=n.substring(0,n.length-1)+"=":t%3==1&&(n=n.substring(0,n.length-2)+"=="),n})()}:i instanceof DataView?{rr_type:i.constructor.name,args:[t(i.buffer,n,r),i.byteOffset,i.byteLength]}:i instanceof HTMLImageElement?{rr_type:i.constructor.name,src:i.src}:i instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:i.toDataURL()}:i instanceof ImageData?{rr_type:i.constructor.name,args:[t(i.data,n,r),i.width,i.height]}:gd(i,n)||"object"===_(i)?{rr_type:i.constructor.name,index:vd(i,n,r)}:i}(e,t,n)})}var md=new Map,vd=function(e,t,n){var r;if(e&&(gd(e,t)||"object"===_(e)))return t=n,n=e.constructor.name,(r=md.get(t))||(r=new Map,md.set(t,r)),r.has(n)||r.set(n,[]),-1===(r=(t=r.get(n)).indexOf(e))&&(r=t.length,t.push(e)),r},gd=function(t,n){var e=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(function(e){return"function"==typeof n[e]});return Boolean(e.find(function(e){return t instanceof n[e]}))};function yd(e,s,a,l){var t=[];try{var n=uc(e.HTMLCanvasElement.prototype,"getContext",function(o){return function(e){for(var t,n=arguments.length,r=new Array(1<n?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return Tc(this,s,a,!0)||(t="experimental-webgl"===(t=e)?"webgl":t,"__context"in this||(this.__context=t),l&&["webgl","webgl2"].includes(t)&&(r[0]&&"object"===_(r[0])?(t=r[0]).preserveDrawingBuffer||(t.preserveDrawingBuffer=!0):r.splice(0,1,{preserveDrawingBuffer:!0}))),o.apply(this,[e].concat(r))}});t.push(n)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return function(){t.forEach(function(e){return e()})}}function wd(n,a,l,u,c,d){var e,r=[],t=Ie(Object.getOwnPropertyNames(n));try{for(t.s();!(e=t.n()).done;)(()=>{var s=e.value;if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(s))return;try{if("function"!=typeof n[s])return;var t=uc(n,s,function(o){return function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,i=o.apply(this,t);return vd(i,d,this),"tagName"in this.canvas&&!Tc(this.canvas,u,c,!0)&&(r=pd(t,d,this),l(this.canvas,{type:a,property:s,args:r})),i}});r.push(t)}catch(e){t=_c(n,s,{set:function(e){l(this.canvas,{type:a,property:s,args:[e],setter:!0})}});r.push(t)}})()}catch(n){t.e(n)}finally{t.f()}return r}var bd='(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastBlobMap = /* @__PURE__ */ new Map();\n const transparentBlobMap = /* @__PURE__ */ new Map();\n async function getTransparentBlobFor(width, height, dataURLOptions) {\n const id = `${width}-${height}`;\n if ("OffscreenCanvas" in globalThis) {\n if (transparentBlobMap.has(id)) return transparentBlobMap.get(id);\n const offscreen = new OffscreenCanvas(width, height);\n offscreen.getContext("2d");\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n transparentBlobMap.set(id, base64);\n return base64;\n } else {\n return "";\n }\n }\n const worker = self;\n worker.onmessage = async function(e) {\n if ("OffscreenCanvas" in globalThis) {\n const { id, bitmap, width, height, dataURLOptions } = e.data;\n const transparentBase64 = getTransparentBlobFor(\n width,\n height,\n dataURLOptions\n );\n const offscreen = new OffscreenCanvas(width, height);\n const ctx = offscreen.getContext("2d");\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const type = blob.type;\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n if (!lastBlobMap.has(id) && await transparentBase64 === base64) {\n lastBlobMap.set(id, base64);\n return worker.postMessage({ id });\n }\n if (lastBlobMap.get(id) === base64) return worker.postMessage({ id });\n worker.postMessage({\n id,\n type,\n base64,\n width,\n height\n });\n lastBlobMap.set(id, base64);\n } else {\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n//# sourceMappingURL=image-bitmap-data-url-worker-IJpC7g_b.js.map\n',kd="undefined"!=typeof self&&self.Blob&&new Blob([bd],{type:"text/javascript;charset=utf-8"});function _d(e){var t,n;try{if(t=kd&&(self.URL||self.webkitURL).createObjectURL(kd))return(n=new Worker(t,{name:null==e?void 0:e.name})).addEventListener("error",function(){(self.URL||self.webkitURL).revokeObjectURL(t)}),n;throw""}catch(t){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(bd),{name:null==e?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var Q,Sd,Ed,Cd,Rd=k(function e(t){var n=this,r=(b(this,e),c(this,"pendingCanvasMutations",new Map),c(this,"rafStamps",{latestId:0,invokeId:null}),c(this,"mirror"),c(this,"mutationCb"),c(this,"resetObservers"),c(this,"frozen",!1),c(this,"locked",!1),c(this,"processMutation",function(e,t){(n.rafStamps.invokeId&&n.rafStamps.latestId!==n.rafStamps.invokeId||!n.rafStamps.invokeId)&&(n.rafStamps.invokeId=n.rafStamps.latestId),n.pendingCanvasMutations.has(e)||n.pendingCanvasMutations.set(e,[]),n.pendingCanvasMutations.get(e).push(t)}),t.sampling),r=void 0===r?"all":r,i=t.win,o=t.blockClass,s=t.blockSelector,a=t.recordCanvas,l=t.dataURLOptions;this.mutationCb=t.mutationCb,this.mirror=t.mirror,a&&"all"===r&&this.initCanvasMutationObserver(i,o,s),a&&"number"==typeof r&&this.initCanvasFPSObserver(r,i,o,s,{dataURLOptions:l})},[{key:"reset",value:function(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}},{key:"freeze",value:function(){this.frozen=!0}},{key:"unfreeze",value:function(){this.frozen=!1}},{key:"lock",value:function(){this.locked=!0}},{key:"unlock",value:function(){this.locked=!1}},{key:"initCanvasFPSObserver",value:function(e,r,i,o,s){var a=this,t=yd(r,i,o,!0),l=new Map,u=new _d;u.onmessage=function(e){var t,n=e.data.id;l.set(n,!1),"base64"in e.data&&(t=(e=e.data).base64,a.mutationCb({id:n,type:Uc["2D"],commands:[{property:"clearRect",args:[0,0,e.width,e.height]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:t}],type:e.type}]},0,0]}]}))};var c=1e3/e,d=0,f=function(e){var t,n;d&&e-d<c||(d=e,t=[],r.document.querySelectorAll("canvas").forEach(function(e){Tc(e,i,o,!0)||t.push(e)}),t.forEach((n=zi(Ji().m(function e(t){var n,r,i;return Ji().w(function(e){for(;;)switch(e.n){case 0:if(n=a.mirror.getId(t),l.get(n))return e.a(2);e.n=1;break;case 1:if(0===t.width||0===t.height)return e.a(2);e.n=2;break;case 2:return l.set(n,!0),["webgl","webgl2"].includes(t.__context)&&(r=t.getContext(t.__context),!1===(null==(i=null==r?void 0:r.getContextAttributes())?void 0:i.preserveDrawingBuffer))&&r.clear(r.COLOR_BUFFER_BIT),e.n=3,createImageBitmap(t);case 3:i=e.v,u.postMessage({id:n,bitmap:i,width:t.width,height:t.height,dataURLOptions:s.dataURLOptions},[i]);case 4:return e.a(2)}},e)})),function(e){return n.apply(this,arguments)}))),h=requestAnimationFrame(f)},h=requestAnimationFrame(f);this.resetObservers=function(){t(),cancelAnimationFrame(h)}}},{key:"initCanvasMutationObserver",value:function(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var r,i,o=yd(e,t,n,!1),s=((s,a,l,u)=>{var e,n=[],t=Ie(Object.getOwnPropertyNames(a.CanvasRenderingContext2D.prototype));try{for(t.s();!(e=t.n()).done;)(()=>{var o=e.value;try{if("function"!=typeof a.CanvasRenderingContext2D.prototype[o])return;var t=uc(a.CanvasRenderingContext2D.prototype,o,function(i){return function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return Tc(this.canvas,l,u,!0)||setTimeout(function(){var e=pd(n,a,t);s(t.canvas,{type:Uc["2D"],property:o,args:e})},0),i.apply(this,n)}});n.push(t)}catch(e){t=_c(a.CanvasRenderingContext2D.prototype,o,{set:function(e){s(this.canvas,{type:Uc["2D"],property:o,args:[e],setter:!0})}});n.push(t)}})()}catch(s){t.e(s)}finally{t.f()}return function(){n.forEach(function(e){return e()})}})(this.processMutation.bind(this),e,t,n),a=(r=this.processMutation.bind(this),t=t,n=n,i=[],void 0!==(e=e).WebGLRenderingContext&&i.push.apply(i,Qi(wd(e.WebGLRenderingContext.prototype,Uc.WebGL,r,t,n,e))),void 0!==e.WebGL2RenderingContext&&i.push.apply(i,Qi(wd(e.WebGL2RenderingContext.prototype,Uc.WebGL2,r,t,n,e))),function(){i.forEach(function(e){return e()})});this.resetObservers=function(){o(),s(),a()}}},{key:"startPendingCanvasMutationFlusher",value:function(){var e=this;requestAnimationFrame(function(){return e.flushPendingCanvasMutations()})}},{key:"startRAFTimestamping",value:function(){function t(e){n.rafStamps.latestId=e,requestAnimationFrame(t)}var n=this;requestAnimationFrame(t)}},{key:"flushPendingCanvasMutations",value:function(){var r=this;this.pendingCanvasMutations.forEach(function(e,t){var n=r.mirror.getId(t);r.flushPendingCanvasMutationFor(t,n)}),requestAnimationFrame(function(){return r.flushPendingCanvasMutations()})}},{key:"flushPendingCanvasMutationFor",value:function(e,t){var n,r;this.frozen||this.locked||(r=this.pendingCanvasMutations.get(e))&&-1!==t&&(n=r.map(function(e){return e.type,Zi(e,lo)}),r=r[0].type,this.mutationCb({id:t,type:r,commands:n}),this.pendingCanvasMutations.delete(e))}}]),Td=k(function e(t){b(this,e),c(this,"trackedLinkElements",new WeakSet),c(this,"mutationCb"),c(this,"adoptedStyleSheetCb"),c(this,"styleMirror",new Pc),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb},[{key:"attachLinkElement",value:function(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}},{key:"trackLinkElement",value:function(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}},{key:"adoptStyleSheets",value:function(e,t){var r=this;if(0!==e.length){var i,o={id:t,styleIds:[]},s=[],n=Ie(e);try{for(n.s();!(i=n.n()).done;)(()=>{var e,n=i.value;r.styleMirror.has(n)?e=r.styleMirror.getId(n):(e=r.styleMirror.add(n),s.push({styleId:e,rules:Array.from(n.rules||CSSRule,function(e,t){return{rule:Oo(e,n.href),index:t}})})),o.styleIds.push(e)})()}catch(e){n.e(e)}finally{n.f()}0<s.length&&(o.styles=s),this.adoptedStyleSheetCb(o)}}},{key:"reset",value:function(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}},{key:"trackStylesheetInLinkElement",value:function(e){}}]),Od=k(function e(){b(this,e),c(this,"nodeMap",new WeakMap),c(this,"active",!1)},[{key:"inOtherBuffer",value:function(e,t){e=this.nodeMap.get(e);return e&&Array.from(e).some(function(e){return e!==t})}},{key:"add",value:function(e,t){var n=this;this.active||(this.active=!0,requestAnimationFrame(function(){n.nodeMap=new WeakMap,n.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}},{key:"destroy",value:function(){}}]),xd=!1;try{2!==Array.from([1],function(e){return 2*e})[0]&&(Cd=document.createElement("iframe"),document.body.appendChild(Cd),Array.from=(null==(mm=Cd.contentWindow)?void 0:mm.Array.from)||Array.from,document.body.removeChild(Cd))}catch(rh){console.debug("Unable to override Array.from",rh)}var Md=new xo;function Id(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},r=e.emit,i=e.checkoutEveryNms,o=e.checkoutEveryNth,t=e.blockClass,l=void 0===t?"rr-block":t,t=e.blockSelector,u=void 0===t?null:t,t=e.ignoreClass,L=void 0===t?"rr-ignore":t,t=e.ignoreSelector,N=void 0===t?null:t,t=e.maskTextClass,c=void 0===t?"rr-mask":t,t=e.maskTextSelector,d=void 0===t?null:t,t=e.inlineStylesheet,f=void 0===t||t,t=e.maskAllInputs,n=e.maskInputOptions,F=e.slimDOMOptions,h=e.maskInputFn,p=e.maskTextFn,U=e.hooks,z=e.packFn,s=e.sampling,a=void 0===s?{}:s,s=e.dataURLOptions,m=void 0===s?{}:s,s=e.mousemoveWait,v=e.recordDOM,B=void 0===v||v,v=e.recordCanvas,g=void 0!==v&&v,v=e.recordCrossOriginIframes,v=void 0!==v&&v,y=e.recordAfter,j=void 0===y?"DOMContentLoaded"===e.recordAfter?e.recordAfter:"load":y,y=e.userTriggeredOnInput,W=void 0!==y&&y,y=e.collectFonts,H=void 0!==y&&y,y=e.inlineImages,w=void 0!==y&&y,b=e.plugins,y=e.keepIframeSrcFn,k=void 0===y?function(){return!1}:y,y=e.ignoreCSSAttributes,q=void 0===y?new Set([]):y,_=(Hc=e.errorHandler,!v||window.parent===window),S=!1;if(!_)try{window.parent.document&&(S=!1)}catch(e){S=!0}if(_&&!r)throw new Error("emit function is required");if(!_&&!S)return function(){};void 0!==s&&void 0===a.mousemove&&(a.mousemove=s),Md.reset();var V,E=!0===t?{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!==n?n:{password:!0},C=es(F),R=(!function(e){"NodeList"in(e=0<arguments.length&&void 0!==e?e:window)&&!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)}(),0),G=function(e){var t,n=Ie(b||[]);try{for(n.s();!(t=n.n()).done;){var r=t.value;r.eventProcessor&&(e=r.eventProcessor(e))}}catch(e){n.e(e)}finally{n.f()}return e=z&&!S?z(e):e};Q=function(e,t){var n;e.timestamp=lc(),null==(n=Kc[0])||!n.isFrozen()||e.type===Y.FullSnapshot||e.type===Y.IncrementalSnapshot&&e.data.source===De.Mutation||Kc.forEach(function(e){return e.unfreeze()}),_?null!=r&&r(G(e),t):S&&(n={type:"rrweb",event:G(e),origin:window.location.origin,isCheckout:t},window.parent.postMessage(n,"*")),e.type===Y.FullSnapshot?(V=e,R=0):e.type!==Y.IncrementalSnapshot||e.data.source===De.Mutation&&e.data.isAttachIframe||(R++,t=o&&o<=R,n=i&&e.timestamp-V.timestamp>i,(t||n)&&Sd(!0))};function T(e){Q({type:Y.IncrementalSnapshot,data:Ae({source:De.Mutation},e)})}function Z(e){return Q({type:Y.IncrementalSnapshot,data:Ae({source:De.Scroll},e)})}function J(e){return Q({type:Y.IncrementalSnapshot,data:Ae({source:De.CanvasMutation},e)})}var K,O=new Td({mutationCb:T,adoptedStyleSheetCb:function(e){return Q({type:Y.IncrementalSnapshot,data:Ae({source:De.AdoptedStyleSheet},e)})}}),x=new ud({mirror:Md,mutationCb:T,stylesheetManager:O,recordCrossOriginIframes:v,wrappedEmit:Q}),M=Ie(b||[]);try{for(M.s();!(K=M.n()).done;){var $=K.value;$.getMirror&&$.getMirror({nodeMirror:Md,crossOriginIframeMirror:x.crossOriginIframeMirror,crossOriginIframeStyleMirror:x.crossOriginIframeStyleMirror})}}catch(e){M.e(e)}finally{M.f()}var I=new Od,A=(Ed=new Rd({recordCanvas:g,mutationCb:J,win:window,blockClass:l,blockSelector:u,mirror:Md,sampling:a.canvas,dataURLOptions:m}),new cd({mutationCb:T,scrollCb:Z,bypassOptions:{blockClass:l,blockSelector:u,maskTextClass:c,maskTextSelector:d,inlineStylesheet:f,maskInputOptions:E,dataURLOptions:m,maskTextFn:p,maskInputFn:h,recordCanvas:g,inlineImages:w,sampling:a,slimDOMOptions:C,iframeManager:x,stylesheetManager:O,canvasManager:Ed,keepIframeSrcFn:k,processedNodeManager:I},mirror:Md}));Sd=function(){var e,t,n,r,i,o,s=0<arguments.length&&void 0!==arguments[0]&&arguments[0];if(B){Q({type:Y.Meta,data:{href:window.location.href,width:Cc(),height:Ec()}},s),O.reset(),A.init(),Kc.forEach(function(e){return e.lock()});a=document,r=void 0===(r=(e={mirror:Md,blockClass:l,blockSelector:u,maskTextClass:c,maskTextSelector:d,inlineStylesheet:f,maskAllInputs:E,maskTextFn:p,maskInputFn:h,slimDOM:C,dataURLOptions:m,recordCanvas:g,inlineImages:w,onSerialize:function(e){Mc(e,Md)&&x.addIframe(e),Ic(e,Md)&&O.trackLinkElement(e),Ac(e)&&A.addShadowRoot(yc(e),document)},onIframeLoad:function(e,t){x.attachIframe(e,t),A.observeAttachShadow(e)},onStylesheetLoad:function(e,t){O.attachLinkElement(e,t)},keepIframeSrcFn:k}).mirror)?new xo:r,t=e.inlineImages,n=e.recordCanvas,i=e.slimDOM,o=e.keepIframeSrcFn;var a=ts(a,{doc:a,mirror:r,blockClass:void 0===(a=e.blockClass)?"rr-block":a,blockSelector:void 0===(r=e.blockSelector)?null:r,maskTextClass:void 0===(a=e.maskTextClass)?"rr-mask":a,maskTextSelector:void 0===(r=e.maskTextSelector)?null:r,skipChild:!1,inlineStylesheet:void 0===(a=e.inlineStylesheet)||a,maskInputOptions:!0===(r=void 0!==(r=e.maskAllInputs)&&r)?{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===r?{password:!0}:r,maskTextFn:e.maskTextFn,maskInputFn:e.maskInputFn,slimDOMOptions:es(void 0!==i&&i),dataURLOptions:e.dataURLOptions,inlineImages:void 0!==t&&t,recordCanvas:void 0!==n&&n,preserveWhiteSpace:e.preserveWhiteSpace,onSerialize:e.onSerialize,onIframeLoad:e.onIframeLoad,iframeLoadTimeout:e.iframeLoadTimeout,onStylesheetLoad:e.onStylesheetLoad,stylesheetLoadTimeout:e.stylesheetLoadTimeout,keepIframeSrcFn:void 0===o?function(){return!1}:o,newlyAddedElement:!1});if(!a)return console.warn("Failed to snapshot the document");Q({type:Y.FullSnapshot,data:{node:a,initialOffset:Sc(window)}},s),Kc.forEach(function(e){return e.unlock()}),document.adoptedStyleSheets&&0<document.adoptedStyleSheets.length&&O.adoptStyleSheets(document.adoptedStyleSheets,Md.getId(document))}};try{var P=[],X=function(e){return Le(od)({mutationCb:T,mousemoveCb:function(e,t){return Q({type:Y.IncrementalSnapshot,data:{source:t,positions:e}})},mouseInteractionCb:function(e){return Q({type:Y.IncrementalSnapshot,data:Ae({source:De.MouseInteraction},e)})},scrollCb:Z,viewportResizeCb:function(e){return Q({type:Y.IncrementalSnapshot,data:Ae({source:De.ViewportResize},e)})},inputCb:function(e){return Q({type:Y.IncrementalSnapshot,data:Ae({source:De.Input},e)})},mediaInteractionCb:function(e){return Q({type:Y.IncrementalSnapshot,data:Ae({source:De.MediaInteraction},e)})},styleSheetRuleCb:function(e){return Q({type:Y.IncrementalSnapshot,data:Ae({source:De.StyleSheetRule},e)})},styleDeclarationCb:function(e){return Q({type:Y.IncrementalSnapshot,data:Ae({source:De.StyleDeclaration},e)})},canvasMutationCb:J,fontCb:function(e){return Q({type:Y.IncrementalSnapshot,data:Ae({source:De.Font},e)})},selectionCb:function(e){Q({type:Y.IncrementalSnapshot,data:Ae({source:De.Selection},e)})},customElementCb:function(e){Q({type:Y.IncrementalSnapshot,data:Ae({source:De.CustomElement},e)})},blockClass:l,ignoreClass:L,ignoreSelector:N,maskTextClass:c,maskTextSelector:d,maskInputOptions:E,inlineStylesheet:f,sampling:a,recordDOM:B,recordCanvas:g,inlineImages:w,userTriggeredOnInput:W,collectFonts:H,doc:e,maskInputFn:h,maskTextFn:p,keepIframeSrcFn:k,blockSelector:u,slimDOMOptions:C,dataURLOptions:m,mirror:Md,iframeManager:x,stylesheetManager:O,shadowDomManager:A,processedNodeManager:I,canvasManager:Ed,ignoreCSSAttributes:q,plugins:(null==(e=null==b?void 0:b.filter(function(e){return e.observer}))?void 0:e.map(function(t){return{observer:t.observer,options:t.options,callback:function(e){return Q({type:Y.Plugin,data:{plugin:t.name,payload:e}})}}}))||[]},U)},D=(x.addLoadListener(function(e){try{P.push(X(e.contentDocument))}catch(e){console.warn(e)}}),function(){Sd(),P.push(X(document)),xd=!0});return["interactive","complete"].includes(document.readyState)?D():(P.push(wc("DOMContentLoaded",function(){Q({type:Y.DomContentLoaded,data:{}}),"DOMContentLoaded"===j&&D()})),P.push(wc("load",function(){Q({type:Y.Load,data:{}}),"load"===j&&D()},window))),function(){P.forEach(function(e){try{e()}catch(e){String(e).toLowerCase().includes("cross-origin")||console.warn(e)}}),I.destroy(),xd=!1,Hc=void 0}}catch(e){console.warn(e)}}Id.addCustomEvent=function(e,t){if(!xd)throw new Error("please add custom event after start recording");Q({type:Y.Custom,data:{tag:e,payload:t}})},Id.freezePage=function(){Kc.forEach(function(e){return e.freeze()})},Id.takeFullSnapshot=function(e){if(!xd)throw new Error("please take full snapshot after start recording");Sd(e)},Id.mirror=Md;var Ad='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',Pd={maskAllText:!0,maskAllInputs:!0,blockAllMedia:!0,autoDetectSensitiveData:!0,mask:[".tdem-mask","[data-tdem-mask]","[data-sensitive]",".sensitive",".private"],block:[".tdem-block","[data-tdem-block]",".secret","[data-secret]","iframe[srcdoc]:not([src])",".replayer-wrapper"],ignore:[".tdem-ignore","[data-tdem-ignore]",'input[type="file"]','input[type="password"]'],maskInputOptions:{password:!0,email:!0,tel:!0,text:!1}},Dd=(Ld.maskPhone=function(e){return e.replace(this.phoneRegex,function(e){var t=e.replace(/[^\d]/g,"");return 11===t.length?e.substring(0,3)+"****"+e.substring(7):13===t.length?e.substring(0,6)+"****"+e.substring(10):e.substring(0,3)+"****"+e.substring(e.length-4)})},Ld.maskIdCard=function(e){return e.replace(this.idCardRegex,function(e){return 18===e.length?e.substring(0,6)+"********"+e.substring(14):15===e.length?e.substring(0,6)+"******"+e.substring(12):e})},Ld.maskEmail=function(e){return e.replace(this.emailRegex,function(e){var t,n=e.indexOf("@");return n<=1?"*"+e.substring(1):(t=e.substring(0,n),e=e.substring(n),t.charAt(0)+"***"+t.charAt(t.length-1)+e)})},Ld.maskBankCard=function(e){return e.replace(this.bankCardRegex,function(e){var t=e.replace(/[^\d]/g,"");return t.length<13?e:t.substring(0,4)+" **** **** "+t.substring(t.length-4)})},Ld.maskIP=function(e){return e.replace(this.ipv4Regex,function(e){e=e.split(".");return e[0]+".*.*."+e[3]})},Ld.autoMask=function(e){var t;return e&&"string"==typeof e?(t=this.maskPhone(t=e),t=this.maskIdCard(t),t=this.maskEmail(t),this.maskBankCard(t)):e},Ld.hasSensitiveData=function(e){return!(!e||"string"!=typeof e)&&(this.phoneRegex.test(e)||this.idCardRegex.test(e)||this.emailRegex.test(e)||this.bankCardRegex.test(e))},Ld.phoneRegex=/1[3-9]\d{9}|(?:\+?86)?1[3-9]\d{9}/g,Ld.idCardRegex=/[1-9]\d{5}(?:19|20)\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])\d{3}[\dXx]|[1-9]\d{7}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])\d{3}/g,Ld.emailRegex=/[\w.-]+@[\w.-]+\.\w{2,}/g,Ld.bankCardRegex=/\b\d{4}[\s-]?\d{4}[\s-]?\d{4}[\s-]?\d{1,7}\b/g,Ld.ipv4Regex=/\b(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\b/g,Ld);function Ld(){}function Nd(e,t){return void 0===e&&(e={}),x(x(x({},t=void 0===t?Pd:t),e),{mask:Fd(t.mask,e.mask),block:Fd(t.block,e.block),ignore:Fd(t.ignore,e.ignore),maskInputOptions:x(x({},t.maskInputOptions),e.maskInputOptions)})}function Fd(e,t){e=new Set(g(e||[],t||[]));return Array.from(e)}Hd.prototype.push=function(e,t){if(this.emitFn=t,3===e.type&&this.isMutationEvent(e)){var n=e.data;if(this.buffer){if(this.enableRepeatDetection&&this.isRepeatPattern(n)){if(this.repeatCount++,3<this.repeatCount)return this.buffer=this.cloneEvent(e),void this.droppedByRepeat++}else this.repeatCount=0;this.mergeInto(n,e.timestamp),this.mergedCount++,(null!=(n=null==(n=this.buffer.data.adds)?void 0:n.length)?n:0)>=this.maxAddsPerMerge&&this.flush()}else this.buffer=this.cloneEvent(e),this.scheduleFlush()}else this.flush(),t(e)},Hd.prototype.flush=function(){this.clearTimer(),this.buffer&&this.emitFn&&(this.emitFn(this.buffer),this.buffer=null,this.repeatCount=0)},Hd.prototype.destroy=function(){this.flush(),this.clearTimer(),this.emitFn=null},Hd.prototype.getStats=function(){return{mergedCount:this.mergedCount,droppedByRepeat:this.droppedByRepeat,cancelledByOffset:this.cancelledByOffset}},Hd.prototype.isMutationEvent=function(e){return 0===(null==(e=e.data)?void 0:e.source)},Hd.prototype.isRepeatPattern=function(e){var t;return!!this.buffer&&(t=null!=(t=this.buffer.data.adds)?t:[],e=null!=(e=e.adds)?e:[],0!==t.length)&&0!==e.length&&t.length===e.length&&(null==(t=t[0])?void 0:t.parentId)===(null==(t=e[0])?void 0:t.parentId)},Hd.prototype.mergeInto=function(e,t){var n,r,i,o;if(this.buffer){var s=this.buffer.data;this.buffer.timestamp=Math.max(this.buffer.timestamp,t);for(var a=this,l=0,u=null!=(t=e.removes)?t:[];l<u.length;l++)(t=>{var e=(null!=(n=s.adds)?n:[]).findIndex(function(e){return(null==(e=e.node)?void 0:e.id)===t.id});0<=e?(s.adds.splice(e,1),a.cancelledByOffset++):(s.removes=null!=(n=s.removes)?n:[],s.removes.push(t))})(u[l]);for(var c=0,d=null!=(t=e.adds)?t:[];c<d.length;c++){var f=d[c];s.adds=null!=(r=s.adds)?r:[],s.adds.push(f)}for(var h=0,p=null!=(t=e.attributes)?t:[];h<p.length;h++)(t=>{s.attributes=null!=(i=s.attributes)?i:[];var e=s.attributes.findIndex(function(e){return e.id===t.id});0<=e?s.attributes[e]=t:s.attributes.push(t)})(p[h]);for(var m=0,v=null!=(t=e.texts)?t:[];m<v.length;m++)(t=>{s.texts=null!=(o=s.texts)?o:[];var e=s.texts.findIndex(function(e){return e.id===t.id});0<=e?s.texts[e]=t:s.texts.push(t)})(v[m])}},Hd.prototype.cloneEvent=function(e){var t=e.data;return{type:e.type,timestamp:e.timestamp,data:{source:0,adds:g(null!=(e=t.adds)?e:[]),removes:g(null!=(e=t.removes)?e:[]),attributes:g(null!=(e=t.attributes)?e:[]),texts:g(null!=(e=t.texts)?e:[])}}},Hd.prototype.scheduleFlush=function(){var e=this;this.clearTimer(),this.flushTimer=setTimeout(function(){e.flushTimer=null,e.flush()},this.windowMs)},Hd.prototype.clearTimer=function(){null!==this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=null)};var Ud=Hd,zd=(Wd.prototype.startRecording=function(e){var r,i,n=this;if(void 0===e&&(e={}),"recording"!==this.state){this.mutationLimitReached=!1,this.throttleCount=0,this.throttleWindowStart=Date.now(),this.throttleNotified=!1,this.mutationAddsInWindow=0;var t="buffer"===this.options.mode?12e4:3e5,t="number"==typeof e.checkoutEveryNms&&0<e.checkoutEveryNms?e.checkoutEveryNms:t,o="number"==typeof e.checkoutEveryNth&&0<e.checkoutEveryNth?e.checkoutEveryNth:void 0,s=Nd(e.privacy||{},Pd),a=x(x(x(x({emit:function(e,t){n.handleEvent(e,t)},checkoutEveryNms:t},o?{checkoutEveryNth:o}:{}),{sampling:{scroll:150,mousemove:!l.ios()&&50,mouseInteraction:!0,input:"last"},slimDOMOptions:{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:!0}}),(t={},void 0!==(o=s).maskAllInputs&&(t.maskAllInputs=o.maskAllInputs),o.maskInputOptions&&(t.maskInputOptions=o.maskInputOptions),null!=(a=o.mask)&&a.length&&(t.maskTextSelector=o.mask.join(",")),null!=(a=o.block)&&a.length&&(t.blockSelector=o.block.join(",")),o.blockAllMedia&&(t.blockSelector=t.blockSelector?t.blockSelector+","+Ad:Ad,t.ignoreCSSAttributes=new Set(["background-image"])),null!=(a=o.ignore)&&a.length&&(t.ignoreSelector=o.ignore.join(",")),!o.maskTextFn&&!1===o.autoDetectSensitiveData||(t.maskTextFn=(r=o.maskTextFn,i=!1!==o.autoDetectSensitiveData,function(e,t){var n;return e&&(n=e,i&&(n=Dd.autoMask(n)),r?r(n,t):n)})),t)),e.rrwebConfig);try{this.hookMutationObserver(),this.stopRecordingFn=Id(a),this.state="recording",this.lastCheckoutTime=Date.now(),this.startCheckpointTimer(),u("RecorderManager","Recording started with config:",{maskAllText:s.maskAllText,maskAllInputs:s.maskAllInputs,autoDetectSensitiveData:s.autoDetectSensitiveData,mutationLimit:this.mutationLimit,checkpointIntervalMs:12e4})}catch(e){Oi("RecorderManager","Failed to start recording:",e),this.state="stopped"}}else Ti("RecorderManager","Already recording")},Wd.prototype.stopRecording=function(){var e;this.stopCheckpointTimer(),null!=(e=this.mutationMerger)&&e.destroy(),this.unhookMutationObserver(),this.stopRecordingFn&&(this.stopRecordingFn(),this.stopRecordingFn=void 0),this.state="stopped",u("RecorderManager","Recording stopped")},Wd.prototype.pauseRecording=function(){"recording"===this.state&&(this.stopRecording(),this.state="paused",u("RecorderManager","Recording paused"))},Wd.prototype.resumeRecording=function(e){void 0===e&&(e={}),"paused"===this.state&&(this.startRecording(e),u("RecorderManager","Recording resumed"))},Wd.prototype.hookMutationObserver=function(){try{var r,e,t=window.MutationObserver;t&&(r=this,(e=function(n){return new t(function(e,t){r.unhookMutationObserver(),r.onMutationHandler(e)&&n(e,t)})}).prototype=t.prototype,window.MutationObserver=e,this.restoreMutationObserver=function(){window.MutationObserver=t},Ri("RecorderManager","MutationObserver hooked"))}catch(t){Ti("RecorderManager","Failed to hook MutationObserver:",t)}},Wd.prototype.unhookMutationObserver=function(){this.restoreMutationObserver&&(this.restoreMutationObserver(),this.restoreMutationObserver=null,Ri("RecorderManager","MutationObserver restored"))},Wd.prototype.onMutationHandler=function(e){var t,n=this;return!this.mutationLimitReached&&(t=(e=e.length)>this.mutationLimit,(e>this.mutationBreadcrumbLimit||t)&&this.emitMutationBreadcrumb(e,t),!t||(this.mutationLimitReached=!0,Oi("RecorderManager","Mutation limit reached: "+e+" > "+this.mutationLimit+". Stopping."),setTimeout(function(){var e,t;null!=(t=(e=n.options).onMutationLimitReached)&&t.call(e),n.stopRecording()},0),!1))},Wd.prototype.checkMutationLimit=function(e){var n=this;if(this.mutationLimitReached)return!1;if(3!==e.type)return!0;e=e.data;if(0!==(null==e?void 0:e.source))return!0;e=Array.isArray(e.adds)?e.adds.length:0;if(0===e)return!0;this.mutationAddsInWindow+=e;var t=e>this.mutationLimit||this.mutationAddsInWindow>2*this.mutationLimit;return(e>this.mutationBreadcrumbLimit||t)&&this.emitMutationBreadcrumb(e,t),!t||(Oi("RecorderManager","Mutation limit: "+e+" adds (window: "+this.mutationAddsInWindow+"). Stopping."),this.mutationLimitReached=!0,setTimeout(function(){var e,t;null!=(t=(e=n.options).onMutationLimitReached)&&t.call(e),n.stopRecording()},0),!1)},Wd.prototype.emitMutationBreadcrumb=function(e,t){var n;try{null!=(n=Id.addCustomEvent)&&n.call(Id,"replay.mutations",{count:e,limit:t,timestamp:Date.now()})}catch(e){}},Wd.prototype.handleEvent=function(e,t){var n=this,r=(t&&(null!=(i=(r=this.options).onCheckout)&&i.call(r),this.lastCheckoutTime=Date.now(),null!=(i=this.mutationMerger))&&i.flush(),e.type);if(t||2===r||4===r||r<=1||this.checkEventThrottle()){if(3===r&&!this.mutationLimitReached){var i=Date.now();if(12e4<=i-this.lastCheckoutTime){this.lastCheckoutTime=i;try{var o=Id.takeFullSnapshot;"function"==typeof o&&(o(!0),Ri("RecorderManager","Inline checkpoint: forced FullSnapshot"))}catch(e){Ti("RecorderManager","Inline checkpoint failed:",e)}}}this.checkMutationLimit(e)&&(this.mutationMerger?this.mutationMerger.push(e,function(e){n.options.onRecordingEvent(e)}):this.options.onRecordingEvent(e))}},Wd.prototype.checkEventThrottle=function(){var e,t=Date.now();if(5e3<t-this.throttleWindowStart&&(this.throttleCount=0,this.throttleWindowStart=t,this.throttleNotified=!1,this.mutationAddsInWindow=0),this.throttleCount++,300<this.throttleCount){if(!this.throttleNotified){this.throttleNotified=!0,Ti("RecorderManager","Event throttled: "+this.throttleCount+" events in 5000ms window");try{null!=(e=Id.addCustomEvent)&&e.call(Id,"replay.throttled",{count:this.throttleCount,window:5e3})}catch(e){}}return!1}return!0},Wd.prototype.startCheckpointTimer=function(){var t=this;this.stopCheckpointTimer(),this.checkpointTimer=setInterval(function(){if("recording"===t.state&&!t.mutationLimitReached)try{var e=Id.takeFullSnapshot;"function"==typeof e&&(e(!0),t.lastCheckoutTime=Date.now(),Ri("RecorderManager","Checkpoint: forced FullSnapshot"))}catch(e){Ti("RecorderManager","Checkpoint FullSnapshot failed:",e)}},12e4)},Wd.prototype.stopCheckpointTimer=function(){null!==this.checkpointTimer&&(clearInterval(this.checkpointTimer),this.checkpointTimer=null)},Wd.prototype.getState=function(){return this.state},Wd.prototype.isRecording=function(){return"recording"===this.state},Wd.prototype.getLastCheckoutTime=function(){return this.lastCheckoutTime},Wd.prototype.takeFullSnapshot=function(){var e,t;"recording"===this.state&&this.stopRecordingFn&&(null!=(t=null==(e=this.stopRecordingFn)?void 0:e.takeFullSnapshot)&&t.call(e),this.lastCheckoutTime=Date.now())},Wd.prototype.isMutationLimitReached=function(){return this.mutationLimitReached},Wd),Bd=(jd.prototype.initializeSampling=function(){return null!==this.samplingDecision?{mode:this.currentMode,shouldRecord:!1!==this.currentMode}:Math.random()<this.config.sessionSampleRate?(this.currentMode="session",this.samplingDecision=!0,u("SamplerManager","Sampled: session mode"),{mode:"session",shouldRecord:!0}):0<this.config.errorSampleRate?(this.currentMode="buffer",this.samplingDecision=!0,u("SamplerManager","Sampled: buffer mode"),{mode:"buffer",shouldRecord:!0}):(this.currentMode=!1,this.samplingDecision=!1,u("SamplerManager","Not sampled"),{mode:!1,shouldRecord:!1})},jd.prototype.decideSamplingMode=function(){return this.initializeSampling().mode},jd.prototype.onErrorOccurred=function(e){return"buffer"===this.currentMode&&!this.hasUpgraded&&!!(Math.random()<this.config.errorSampleRate)&&(this.switchMode("session"),this.hasUpgraded=!0)},jd.prototype.switchMode=function(e){var t=this.currentMode;this.currentMode=e,this.samplingDecision=!1!==e,u("SamplerManager","Mode switched: "+t+" -> "+e)},jd.prototype.getCurrentMode=function(){return this.currentMode},jd.prototype.isSampled=function(){return!0===this.samplingDecision},jd.prototype.isSessionMode=function(){return"session"===this.currentMode},jd.prototype.isBufferMode=function(){return"buffer"===this.currentMode},jd.prototype.upgradeToSessionMode=function(){return"buffer"===this.currentMode&&Math.random()<this.config.errorSampleRate&&(this.currentMode="session",u("SamplerManager","Upgraded to session mode due to error"),!0)},jd.prototype.updateRates=function(e,t){"number"==typeof e&&(this.config.sessionSampleRate=e),"number"==typeof t&&(this.config.errorSampleRate=t)},jd.prototype.forceMode=function(e){this.currentMode=e,this.samplingDecision=!1!==e},jd.prototype.reset=function(){this.currentMode=!1,this.samplingDecision=null},jd.prototype.getConfig=function(){return x({},this.config)},jd);function jd(e){var t;void 0===e&&(e={}),this.currentMode=!1,this.samplingDecision=null,this.hasUpgraded=!1,this.config={sessionSampleRate:null!=(t=e.sessionSampleRate)?t:.1,errorSampleRate:null!=(t=e.errorSampleRate)?t:1}}function Wd(e,t){this.state="stopped",this.lastCheckoutTime=0,this.checkpointTimer=null,this.mutationLimitReached=!1,this.mutationMerger=null,this.mutationBreadcrumbLimit=750,this.mutationLimit=1e4,this.restoreMutationObserver=null,this.throttleCount=0,this.throttleWindowStart=0,this.throttleNotified=!1,this.mutationAddsInWindow=0,this.options=e,this.mutationBreadcrumbLimit=null!=(e=null==t?void 0:t.mutationBreadcrumbLimit)?e:750,this.mutationLimit=null!=(e=null==t?void 0:t.mutationLimit)?e:1e4,null!=t&&t.enableMutationMerge&&(this.mutationMerger=new Ud({windowMs:null!=(e=null==t?void 0:t.mutationMergeWindowMs)?e:200,maxAddsPerMerge:500,enableRepeatDetection:!0}))}function Hd(e){var t;this.buffer=null,this.flushTimer=null,this.repeatCount=0,this.emitFn=null,this.mergedCount=0,this.droppedByRepeat=0,this.cancelledByOffset=0,this.windowMs=null!=(t=null==e?void 0:e.windowMs)?t:200,this.maxAddsPerMerge=null!=(t=null==e?void 0:e.maxAddsPerMerge)?t:500,this.enableRepeatDetection=null==(t=null==e?void 0:e.enableRepeatDetection)||t}function qd(e){for(var t=e.length;0<=--t;)e[t]=0}var Vd=new Uint8Array([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]),Gd=new Uint8Array([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]),Zd=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Jd=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Kd=new Array(576),$d=(qd(Kd),new Array(60)),Xd=(qd($d),new Array(512)),Yd=(qd(Xd),new Array(256)),Qd=(qd(Yd),new Array(29));qd(Qd);var ef,tf,nf,rf=new Array(30);function of(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}function sf(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function af(e,t,n){return e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=n,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(Yd[n]+256+1)]++,e.dyn_dtree[2*vf(t)]++),e.sym_next===e.sym_end}function lf(e){return 2*e-(4<e?9:0)}function uf(e,t){zf(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,lh(e.strm)}function d(e,t){e.pending_buf[e.pending++]=t}function cf(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function df(e,t){var n,r,i=e.max_chain_length,o=e.strstart,s=e.prev_length,a=e.nice_match,l=e.w_size-262<e.strstart?e.strstart-(e.w_size-262):0,u=e.window,c=e.w_mask,d=e.prev,f=e.strstart+258,h=u[o+s-1],p=u[o+s];e.good_match<=e.prev_length&&(i>>=2),e.lookahead<a&&(a=e.lookahead);do{if(u[(n=t)+s]===p&&u[n+s-1]===h&&u[n]===u[o]&&u[++n]===u[o+1]){for(o+=2,n++;u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&o<f;);if(r=258-(f-o),o=f-258,s<r){if(e.match_start=t,a<=(s=r))break;h=u[o+s-1],p=u[o+s]}}}while((t=d[t&c])>l&&0!=--i);return s<=e.lookahead?s:e.lookahead}function ff(e){var t,n,r=e.w_size;do{if(t=e.window_size-e.lookahead-e.strstart,r+(r-262)<=e.strstart&&(e.window.set(e.window.subarray(r,r+r-t),0),e.match_start-=r,e.strstart-=r,e.block_start-=r,e.strstart<e.insert&&(e.insert=e.strstart),oh(e),t+=r),0===e.strm.avail_in)break;if(t=uh(e.strm,e.window,e.strstart+e.lookahead,t),e.lookahead+=t,e.legacy_hash){if(3<=e.lookahead+e.insert)for(n=e.strstart-e.insert,e.ins_h=e.window[n],e.ins_h=sh(e,e.ins_h,e.window[n+1]);e.insert&&(ah(e,n),n++,e.insert--,!(e.lookahead+e.insert<3)););}else if(3<e.lookahead+e.insert)for(n=e.strstart-e.insert;e.insert&&(ah(e,n),n++,e.insert--,!(e.lookahead+e.insert<=3)););}while(e.lookahead<262&&0!==e.strm.avail_in)}function hf(e,t){for(var n,r,i,o=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,s=0,a=e.strm.avail_in;n=65535,i=e.bi_valid+42>>3,!(e.strm.avail_out<i||(n=(i=e.strm.avail_out-i)<(n=n>(r=e.strstart-e.block_start)+e.strm.avail_in?r+e.strm.avail_in:n)?i:n)<o&&(0===n&&t!==Hf||t===Bf||n!==r+e.strm.avail_in)||(s=t===Hf&&n===r+e.strm.avail_in?1:0,Uf(e,0,0,s),e.pending_buf[e.pending-4]=n,e.pending_buf[e.pending-3]=n>>8,e.pending_buf[e.pending-2]=~n,e.pending_buf[e.pending-1]=~n>>8,lh(e.strm),r&&(n<r&&(r=n),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+r),e.strm.next_out),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r,e.block_start+=r,n-=r),n&&(uh(e.strm,e.strm.output,e.strm.next_out,n),e.strm.next_out+=n,e.strm.avail_out-=n,e.strm.total_out+=n),0!==s)););return(a-=e.strm.avail_in)&&(a>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=a&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.strstart<e.insert)&&(e.insert=e.strstart),e.window.set(e.strm.input.subarray(e.strm.next_in-a,e.strm.next_in),e.strstart),e.strstart+=a,e.insert+=e.w_size-e.insert<a?e.w_size-e.insert:a),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),s?4:t!==Bf&&t!==Hf&&0===e.strm.avail_in&&e.strstart===e.block_start?2:(i=e.window_size-e.strstart,e.strm.avail_in>i&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,i+=e.w_size,e.strstart<e.insert)&&(e.insert=e.strstart),(i=i>e.strm.avail_in?e.strm.avail_in:i)&&(uh(e.strm,e.window,e.strstart,i),e.strstart+=i,e.insert+=e.w_size-e.insert<i?e.w_size-e.insert:i),e.high_water<e.strstart&&(e.high_water=e.strstart),o=(i=65535<e.pending_buf_size-(i=e.bi_valid+42>>3)?65535:e.pending_buf_size-i)>e.w_size?e.w_size:i,((r=e.strstart-e.block_start)>=o||(r||t===Hf)&&t!==Bf&&0===e.strm.avail_in&&r<=i)&&(n=i<r?i:r,s=t===Hf&&0===e.strm.avail_in&&n===r?1:0,Uf(e,e.block_start,n,s),e.block_start+=n,lh(e.strm)),s?3:1)}function pf(e,t){for(var n,r;;){if(e.lookahead<262){if(ff(e),e.lookahead<262&&t===Bf)return 1;if(0===e.lookahead)break}if((n=0)!==(n=3<=e.lookahead?ah(e,e.strstart):n)&&e.strstart-n<=e.w_size-262&&(e.match_length=df(e,n)),3<=e.match_length)if(r=af(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&3<=e.lookahead){for(e.match_length--;e.strstart++,n=ah(e,e.strstart),0!=--e.match_length;);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.legacy_hash&&(e.ins_h=e.window[e.strstart],e.ins_h=sh(e,e.ins_h,e.window[e.strstart+1]));else r=af(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(uf(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===Hf?(uf(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(uf(e,!1),0===e.strm.avail_out)?1:2}function mf(e,t){for(var n,r,i;;){if(e.lookahead<262){if(ff(e),e.lookahead<262&&t===Bf)return 1;if(0===e.lookahead)break}if(n=0,3<=e.lookahead&&(n=ah(e,e.strstart)),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==n&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-262&&(e.match_length=df(e,n),e.match_length<=5)&&(e.strategy===Xf||3===e.match_length&&4096<e.strstart-e.match_start)&&(e.match_length=2),3<=e.prev_length&&e.match_length<=e.prev_length){for(i=e.strstart+e.lookahead-3,r=af(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=i&&(n=ah(e,e.strstart)),0!=--e.prev_length;);if(e.match_available=0,e.match_length=2,e.strstart++,r&&(uf(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if((r=af(e,0,e.window[e.strstart-1]))&&uf(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=af(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===Hf?(uf(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(uf(e,!1),0===e.strm.avail_out)?1:2}qd(rf);var vf=function(e){return e<256?Xd[e]:Xd[256+(e>>>7)]},gf=function(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},yf=function(e,t,n){e.bi_valid>16-n?(e.bi_buf|=t<<e.bi_valid&65535,gf(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=n-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},wf=function(e,t,n){yf(e,n[2*t],n[2*t+1])},bf=function(e,t){for(var n=0;n|=1&e,e>>>=1,n<<=1,0<--t;);return n>>>1},kf=function(e,t,n){for(var r,i=new Array(16),o=0,s=1;s<=15;s++)o=o+n[s-1]<<1,i[s]=o;for(r=0;r<=t;r++){var a=e[2*r+1];0!==a&&(e[2*r]=bf(i[a]++,a))}},_f=function(e){for(var t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},Sf=function(e){8<e.bi_valid?gf(e,e.bi_buf):0<e.bi_valid&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},Ef=function(e,t,n,r){var i=2*t,o=2*n;return e[i]<e[o]||e[i]===e[o]&&r[t]<=r[n]},Cf=function(e,t,n){for(var r=e.heap[n],i=n<<1;i<=e.heap_len&&(i<e.heap_len&&Ef(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!Ef(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r},Rf=function(e,t,n){var r,i,o,s,a=0;if(0!==e.sym_next)for(;r=255&e.pending_buf[e.sym_buf+a++],r+=(255&e.pending_buf[e.sym_buf+a++])<<8,i=e.pending_buf[e.sym_buf+a++],0==r?wf(e,i,t):(o=Yd[i],wf(e,o+256+1,t),0!==(s=Vd[o])&&(i-=Qd[o],yf(e,i,s)),o=vf(--r),wf(e,o,n),0!==(s=Gd[o])&&(r-=rf[o],yf(e,r,s))),a<e.sym_next;);wf(e,256,t)},Tf=function(e,t){var n,r,i,o=t.dyn_tree,s=t.stat_desc.static_tree,a=t.stat_desc.has_stree,l=t.stat_desc.elems,u=-1;for(e.heap_len=0,e.heap_max=573,n=0;n<l;n++)0!==o[2*n]?(e.heap[++e.heap_len]=u=n,e.depth[n]=0):o[2*n+1]=0;for(;e.heap_len<2;)o[2*(i=e.heap[++e.heap_len]=u<2?++u:0)]=1,e.depth[i]=0,e.opt_len--,a&&(e.static_len-=s[2*i+1]);for(t.max_code=u,n=e.heap_len>>1;1<=n;n--)Cf(e,o,n);for(i=l;n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Cf(e,o,1),r=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=r,o[2*i]=o[2*n]+o[2*r],e.depth[i]=(e.depth[n]>=e.depth[r]?e.depth[n]:e.depth[r])+1,o[2*n+1]=o[2*r+1]=i,e.heap[1]=i++,Cf(e,o,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1];for(var c,d,f,h,p,m=e,v=t.dyn_tree,g=t.max_code,y=t.stat_desc.static_tree,w=t.stat_desc.has_stree,b=t.stat_desc.extra_bits,k=t.stat_desc.extra_base,_=t.stat_desc.max_length,S=0,E=0;E<=15;E++)m.bl_count[E]=0;for(v[2*m.heap[m.heap_max]+1]=0,c=m.heap_max+1;c<573;c++)(E=v[2*v[2*(d=m.heap[c])+1]+1]+1)>_&&(E=_,S++),v[2*d+1]=E,g<d||(m.bl_count[E]++,h=0,k<=d&&(h=b[d-k]),p=v[2*d],m.opt_len+=p*(E+h),w&&(m.static_len+=p*(y[2*d+1]+h)));if(0!==S){do{for(E=_-1;0===m.bl_count[E];)E--}while(m.bl_count[E]--,m.bl_count[E+1]+=2,m.bl_count[_]--,0<(S-=2));for(E=_;0!==E;E--)for(d=m.bl_count[E];0!==d;)(f=m.heap[--c])>g||(v[2*f+1]!==E&&(m.opt_len+=(E-v[2*f+1])*v[2*f],v[2*f+1]=E),d--)}kf(o,u,e.bl_count)},Of=function(e,t,n){var r,i,o=-1,s=t[1],a=0,l=7,u=4;for(0===s&&(l=138,u=3),t[2*(n+1)+1]=65535,r=0;r<=n;r++)i=s,s=t[2*(r+1)+1],++a<l&&i===s||(a<u?e.bl_tree[2*i]+=a:0!==i?(i!==o&&e.bl_tree[2*i]++,e.bl_tree[32]++):a<=10?e.bl_tree[34]++:e.bl_tree[36]++,o=i,u=(a=0)===s?(l=138,3):i===s?(l=6,3):(l=7,4))},xf=function(e,t,n){var r,i,o=-1,s=t[1],a=0,l=7,u=4;for(0===s&&(l=138,u=3),r=0;r<=n;r++)if(i=s,s=t[2*(r+1)+1],!(++a<l&&i===s)){if(a<u)for(;wf(e,i,e.bl_tree),0!=--a;);else 0!==i?(i!==o&&(wf(e,i,e.bl_tree),a--),wf(e,16,e.bl_tree),yf(e,a-3,2)):a<=10?(wf(e,17,e.bl_tree),yf(e,a-3,3)):(wf(e,18,e.bl_tree),yf(e,a-11,7));o=i,u=(a=0)===s?(l=138,3):i===s?(l=6,3):(l=7,4)}},Mf=!1,If=function(e,t,n,r){yf(e,0+(r?1:0),3),Sf(e),gf(e,n),gf(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n},Af=If,Pf=function(e,t,n,r){for(var i=65535&e|0,o=e>>>16&65535|0,s=0;0!==n;){for(n-=s=2e3<n?2e3:n;o=o+(i=i+t[r++]|0)|0,--s;);i%=65521,o%=65521}return i|o<<16|0},Df=new Uint32Array((()=>{for(var e=[],t=0;t<256;t++){for(var n=t,r=0;r<8;r++)n=1&n?3988292384^n>>>1:n>>>1;e[t]=n}return e})()),Lf=function(e,t,n,r){var i=Df,o=r+n;e^=-1;for(var s=r;s<o;s++)e=e>>>8^i[255&(e^t[s])];return-1^e},Nf={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Ff=function(e){if(!Mf){for(var t,n,r,i=new Array(16),o=0,s=0;s<28;s++)for(Qd[s]=o,t=0;t<1<<Vd[s];t++)Yd[o++]=s;for(Yd[o-1]=s,s=r=0;s<16;s++)for(rf[s]=r,t=0;t<1<<Gd[s];t++)Xd[r++]=s;for(r>>=7;s<30;s++)for(rf[s]=r<<7,t=0;t<1<<Gd[s]-7;t++)Xd[256+r++]=s;for(n=0;n<=15;n++)i[n]=0;for(t=0;t<=143;)Kd[2*t+1]=8,t++,i[8]++;for(;t<=255;)Kd[2*t+1]=9,t++,i[9]++;for(;t<=279;)Kd[2*t+1]=7,t++,i[7]++;for(;t<=287;)Kd[2*t+1]=8,t++,i[8]++;for(kf(Kd,287,i),t=0;t<30;t++)$d[2*t+1]=5,$d[2*t]=bf(t,5);ef=new of(Kd,Vd,257,286,15),tf=new of($d,Gd,0,30,15),nf=new of(new Array(0),Zd,0,19,7),Mf=!0}e.l_desc=new sf(e.dyn_ltree,ef),e.d_desc=new sf(e.dyn_dtree,tf),e.bl_desc=new sf(e.bl_tree,nf),e.bi_buf=0,e.bi_valid=0,_f(e)},Uf=Af,zf=function(e,t,n,r){var i,o,s,a=0;if(0<e.level?(2===e.strm.data_type&&(e.strm.data_type=(e=>{for(var t=4093624447,n=0;n<=31;n++,t>>>=1)if(1&t&&0!==e.dyn_ltree[2*n])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(n=32;n<256;n++)if(0!==e.dyn_ltree[2*n])return 1;return 0})(e)),Tf(e,e.l_desc),Tf(e,e.d_desc),a=(e=>{var t;for(Of(e,e.dyn_ltree,e.l_desc.max_code),Of(e,e.dyn_dtree,e.d_desc.max_code),Tf(e,e.bl_desc),t=18;3<=t&&0===e.bl_tree[2*Jd[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),i=e.opt_len+3+7>>>3,(o=e.static_len+3+7>>>3)<=i&&(i=o)):i=o=n+5,n+4<=i&&-1!==t)If(e,t,n,r);else if(4===e.strategy||o===i)yf(e,2+(r?1:0),3),Rf(e,Kd,$d);else{yf(e,4+(r?1:0),3);var l=e,u=(t=e.l_desc.max_code+1,n=e.d_desc.max_code+1,a+1);for(yf(l,t-257,5),yf(l,n-1,5),yf(l,u-4,4),s=0;s<u;s++)yf(l,l.bl_tree[2*Jd[s]+1],3);xf(l,l.dyn_ltree,t-1),xf(l,l.dyn_dtree,n-1),Rf(e,e.dyn_ltree,e.dyn_dtree)}_f(e),r&&Sf(e)},Bf=(i={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}).Z_NO_FLUSH,jf=i.Z_PARTIAL_FLUSH,Wf=i.Z_FULL_FLUSH,Hf=i.Z_FINISH,qf=i.Z_BLOCK,Vf=i.Z_OK,Gf=i.Z_STREAM_END,Zf=i.Z_STREAM_ERROR,Jf=i.Z_DATA_ERROR,Kf=i.Z_BUF_ERROR,$f=i.Z_DEFAULT_COMPRESSION,Xf=i.Z_FILTERED,Yf=i.Z_HUFFMAN_ONLY,Qf=i.Z_RLE,eh=i.Z_FIXED,th=i.Z_UNKNOWN,nh=i.Z_DEFLATED,rh=function(e,t){return e.msg=Nf[t],t},ih=function(e){for(var t=e.length;0<=--t;)e[t]=0},oh=function(e){for(var t,n,r=e.w_size,i=t=e.hash_size;n=e.head[--i],e.head[i]=r<=n?n-r:0,--t;);for(i=t=r;n=e.prev[--i],e.prev[i]=r<=n?n-r:0,--t;);},sh=function(e,t,n){return(t<<e.hash_shift^n)&e.hash_mask},ah=function(e,t){n=e.legacy_hash?e.ins_h=sh(e,e.ins_h,e.window[t+3-1]):(n=(n=e.window)[t]|n[t+1]<<8|n[t+2]<<16|n[t+3]<<24,e.ins_h=Math.imul(n,66521)+66521>>>16&e.hash_mask);var n,r=e.prev[t&e.w_mask]=e.head[n];return e.head[n]=t,r},lh=function(e){var t=e.state,n=t.pending;0!==(n=e.avail_out<n?e.avail_out:n)&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,0===t.pending)&&(t.pending_out=0)},uh=function(e,t,n,r){var i=e.avail_in;return 0===(i=r<i?r:i)?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),n),1===e.state.wrap?e.adler=Pf(e.adler,t,i,n):2===e.state.wrap&&(e.adler=Lf(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)};function ch(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}var dh=[new ch(0,0,0,0,hf),new ch(4,4,8,4,pf),new ch(4,5,16,8,pf),new ch(4,6,32,32,pf),new ch(4,4,16,16,mf),new ch(8,16,32,32,mf),new ch(8,16,128,128,mf),new ch(8,32,128,256,mf),new ch(32,128,258,1024,mf),new ch(32,258,258,4096,mf)];function fh(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=nh,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.legacy_hash=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),ih(this.dyn_ltree),ih(this.dyn_dtree),ih(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),ih(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),ih(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function hh(e,t){if(vh(e)||qf<t||t<0)return e?rh(e,Zf):Zf;var n=e.state;if(!e.output||0!==e.avail_in&&!e.input||666===n.status&&t!==Hf)return rh(e,0===e.avail_out?Kf:Zf);var r=n.last_flush;if(n.last_flush=t,0!==n.pending){if(lh(e),0===e.avail_out)return n.last_flush=-1,Vf}else if(0===e.avail_in&&lf(t)<=lf(r)&&t!==Hf)return rh(e,Kf);if(666===n.status&&0!==e.avail_in)return rh(e,Kf);if(42===n.status&&0===n.wrap&&(n.status=113),42===n.status){var r=nh+(n.w_bits-8<<4)<<8;if(r|=(n.strategy>=Yf||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(r|=32),cf(n,r+=31-r%31),0!==n.strstart&&(cf(n,e.adler>>>16),cf(n,65535&e.adler)),e.adler=1,n.status=113,lh(e),0!==n.pending)return n.last_flush=-1,Vf}if(57===n.status)if(e.adler=0,d(n,31),d(n,139),d(n,8),n.gzhead)d(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),d(n,255&n.gzhead.time),d(n,n.gzhead.time>>8&255),d(n,n.gzhead.time>>16&255),d(n,n.gzhead.time>>24&255),d(n,9===n.level?2:n.strategy>=Yf||n.level<2?4:0),d(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(d(n,255&n.gzhead.extra.length),d(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=Lf(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69;else if(d(n,0),d(n,0),d(n,0),d(n,0),d(n,0),d(n,9===n.level?2:n.strategy>=Yf||n.level<2?4:0),d(n,3),n.status=113,lh(e),0!==n.pending)return n.last_flush=-1,Vf;if(69===n.status){if(n.gzhead.extra){for(var i=n.pending,o=(65535&n.gzhead.extra.length)-n.gzindex;n.pending+o>n.pending_buf_size;){var s=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+s),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>i&&(e.adler=Lf(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex+=s,lh(e),0!==n.pending)return n.last_flush=-1,Vf;i=0,o-=s}r=new Uint8Array(n.gzhead.extra);n.pending_buf.set(r.subarray(n.gzindex,n.gzindex+o),n.pending),n.pending+=o,n.gzhead.hcrc&&n.pending>i&&(e.adler=Lf(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=73}if(73===n.status){if(n.gzhead.name){var a,l=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>l&&(e.adler=Lf(e.adler,n.pending_buf,n.pending-l,l)),lh(e),0!==n.pending)return n.last_flush=-1,Vf;l=0}}while(a=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,d(n,a),0!=a);n.gzhead.hcrc&&n.pending>l&&(e.adler=Lf(e.adler,n.pending_buf,n.pending-l,l)),n.gzindex=0}n.status=91}if(91===n.status){if(n.gzhead.comment){var u,c=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>c&&(e.adler=Lf(e.adler,n.pending_buf,n.pending-c,c)),lh(e),0!==n.pending)return n.last_flush=-1,Vf;c=0}}while(u=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,d(n,u),0!=u);n.gzhead.hcrc&&n.pending>c&&(e.adler=Lf(e.adler,n.pending_buf,n.pending-c,c))}n.status=103}if(103===n.status){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(lh(e),0!==n.pending))return n.last_flush=-1,Vf;d(n,255&e.adler),d(n,e.adler>>8&255),e.adler=0}if(n.status=113,lh(e),0!==n.pending)return n.last_flush=-1,Vf}if(0!==e.avail_in||0!==n.lookahead||t!==Bf&&666!==n.status){r=0===n.level?hf(n,t):n.strategy===Yf?((e,t)=>{for(var n;;){if(0===e.lookahead&&(ff(e),0===e.lookahead)){if(t===Bf)return 1;break}if(e.match_length=0,n=af(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(uf(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===Hf?(uf(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(uf(e,!1),0===e.strm.avail_out)?1:2})(n,t):n.strategy===Qf?((e,t)=>{for(var n,r,i,o,s=e.window;;){if(e.lookahead<=258){if(ff(e),e.lookahead<=258&&t===Bf)return 1;if(0===e.lookahead)break}if(e.match_length=0,3<=e.lookahead&&0<e.strstart&&(r=s[i=e.strstart-1])===s[++i]&&r===s[++i]&&r===s[++i]){for(o=e.strstart+258;r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&i<o;);e.match_length=258-(o-i),e.lookahead<e.match_length&&(e.match_length=e.lookahead)}if(3<=e.match_length?(n=af(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=af(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(uf(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===Hf?(uf(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(uf(e,!1),0===e.strm.avail_out)?1:2})(n,t):dh[n.level].func(n,t);if(3!==r&&4!==r||(n.status=666),1===r||3===r)return 0===e.avail_out&&(n.last_flush=-1),Vf;if(2===r&&(t===jf?(yf(r=n,2,3),wf(r,256,Kd),16===(r=r).bi_valid?(gf(r,r.bi_buf),r.bi_buf=0,r.bi_valid=0):8<=r.bi_valid&&(r.pending_buf[r.pending++]=255&r.bi_buf,r.bi_buf>>=8,r.bi_valid-=8)):t!==qf&&(Uf(n,0,0,!1),t===Wf)&&(ih(n.head),0===n.lookahead)&&(n.strstart=0,n.block_start=0,n.insert=0),lh(e),0===e.avail_out))return n.last_flush=-1,Vf}return t!==Hf||!(n.wrap<=0)&&(2===n.wrap?(d(n,255&e.adler),d(n,e.adler>>8&255),d(n,e.adler>>16&255),d(n,e.adler>>24&255),d(n,255&e.total_in),d(n,e.total_in>>8&255),d(n,e.total_in>>16&255),d(n,e.total_in>>24&255)):(cf(n,e.adler>>>16),cf(n,65535&e.adler)),lh(e),0<n.wrap&&(n.wrap=-n.wrap),0!==n.pending)?Vf:Gf}function ph(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var n=t.shift();if(n){if("object"!==_(n))throw new TypeError(n+"must be non-object");for(var r in n)yh(n,r)&&(e[r]=n[r])}}return e}function mh(e){for(var t=0,n=0,r=e.length;n<r;n++)t+=e[n].length;for(var i=new Uint8Array(t),o=0,s=0,a=e.length;o<a;o++){var l=e[o];i.set(l,s),s+=l.length}return i}var vh=function(e){var t;return!e||!(t=e.state)||t.strm!==e||42!==t.status&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&113!==t.status&&666!==t.status?1:0},gh=function(e){var t=(e=>{if(vh(e))return rh(e,Zf);e.total_in=e.total_out=0,e.data_type=th;var t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=2===t.wrap?57:t.wrap?42:113,e.adler=2===t.wrap?0:1,t.last_flush=-2,Ff(t),Vf})(e);return t===Vf&&((e=e.state).window_size=2*e.w_size,ih(e.head),e.max_lazy_match=dh[e.level].max_lazy,e.good_match=dh[e.level].good_length,e.nice_match=dh[e.level].nice_length,e.max_chain_length=dh[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),t},yh=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},wh=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(w){wh=!1}for(var bh=new Uint8Array(256),kh=0;kh<256;kh++)bh[kh]=252<=kh?6:248<=kh?5:240<=kh?4:224<=kh?3:192<=kh?2:1;function _h(e){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);for(var t,n,r,i,o=e.length,s=0,a=0;a<o;a++)55296==(64512&(n=e.charCodeAt(a)))&&a+1<o&&56320==(64512&(r=e.charCodeAt(a+1)))&&(n=65536+(n-55296<<10)+(r-56320),a++),s+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(s),a=i=0;i<s;a++)55296==(64512&(n=e.charCodeAt(a)))&&a+1<o&&56320==(64512&(r=e.charCodeAt(a+1)))&&(n=65536+(n-55296<<10)+(r-56320),a++),n<128?t[i++]=n:(n<2048?t[i++]=192|n>>>6:(n<65536?t[i++]=224|n>>>12:(t[i++]=240|n>>>18,t[i++]=128|n>>>12&63),t[i++]=128|n>>>6&63),t[i++]=128|63&n);return t}function Sh(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}bh[254]=bh[255]=1;var Eh=Object.prototype.toString,Ch=i.Z_NO_FLUSH,Rh=i.Z_SYNC_FLUSH,Th=i.Z_FULL_FLUSH,Oh=i.Z_FINISH,xh=i.Z_OK,Mh=i.Z_STREAM_END,Ih={level:i.Z_DEFAULT_COMPRESSION,method:i.Z_DEFLATED,chunkSize:16384,windowBits:15,memLevel:8,strategy:i.Z_DEFAULT_STRATEGY,legacyHash:!0};function Ah(e){this.options=ph({},Ih,e||{});e=this.options;e.raw&&0<e.windowBits?e.windowBits=-e.windowBits:e.gzip&&0<e.windowBits&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Sh,this.strm.avail_out=0;var t,n=((e,t,n,r,i,o,s)=>{if(!e)return Zf;var a=1;if(t===$f&&(t=6),r<0?(a=0,r=-r):15<r&&(a=2,r-=16),i<1||9<i||n!==nh||r<8||15<r||t<0||9<t||o<0||eh<o||8===r&&1!==a)return rh(e,Zf);8===r&&(r=9);var l=new fh;return(e.state=l).strm=e,l.status=42,l.wrap=a,l.gzhead=null,l.w_bits=r,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.legacy_hash=s?1:0,l.hash_bits=i+7,!l.legacy_hash&&l.hash_bits<15&&(l.hash_bits=15),l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+3-1)/3),l.window=new Uint8Array(2*l.w_size),l.head=new Uint16Array(l.hash_size),l.prev=new Uint16Array(l.w_size),l.lit_bufsize=1<<i+6,l.pending_buf_size=4*l.lit_bufsize,l.pending_buf=new Uint8Array(l.pending_buf_size),l.sym_buf=l.lit_bufsize,l.sym_end=3*(l.lit_bufsize-1),l.level=t,l.strategy=o,l.method=n,gh(e)})(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy,e.legacyHash);if(n!==xh)throw new Error(Nf[n]);if(e.header&&(r=this.strm,t=e.header,vh(r)||2!==r.state.wrap||(r.state.gzhead=t)),e.dictionary){var r="string"==typeof e.dictionary?_h(e.dictionary):"[object ArrayBuffer]"===Eh.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary;if((n=((e,t)=>{var n=t.length;if(vh(e))return Zf;var r=e.state,i=r.wrap;if(2===i||1===i&&42!==r.status||r.lookahead)return Zf;1===i&&(e.adler=Pf(e.adler,t,n,0)),r.wrap=0,r.w_size<=n&&(0===i&&(ih(r.head),r.strstart=0,r.block_start=0,r.insert=0),(o=new Uint8Array(r.w_size)).set(t.subarray(n-r.w_size,n),0),t=o,n=r.w_size);var o=e.avail_in,s=e.next_in,a=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,ff(r);3<=r.lookahead;){for(var l=r.strstart,u=r.lookahead-2;ah(r,l),l++,--u;);r.strstart=l,r.lookahead=2,ff(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=s,e.input=a,e.avail_in=o,r.wrap=i,Vf})(this.strm,r))!==xh)throw new Error(Nf[n]);this._dict_set=!0}}function Ph(e,t){t=new Ah(t);if(t.push(e,!0),t.err)throw t.msg||Nf[t.err];return t.result}function Dh(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}Ah.prototype.push=function(e,t){var n,r,i,o,s=this.strm,a=this.options.chunkSize;if(this.ended)return!1;for(r=t===~~t?t:!0===t?Oh:Ch,"string"==typeof e?s.input=_h(e):"[object ArrayBuffer]"===Eh.call(e)?s.input=new Uint8Array(e):s.input=e,s.next_in=0,s.avail_in=s.input.length;;)if(0===s.avail_out&&(s.output=new Uint8Array(a),s.next_out=0,s.avail_out=a),(r===Rh||r===Th)&&s.avail_out<=6)this.onData(s.output.subarray(0,s.next_out)),s.avail_out=0;else{if((n=hh(s,r))===Mh)return 0<s.next_out&&this.onData(s.output.subarray(0,s.next_out)),i=this.strm,o=void 0,n=vh(i)?Zf:(o=i.state.status,i.state=null,113===o?rh(i,Jf):Vf),this.onEnd(n),this.ended=!0,n===xh;if(0!==s.avail_out){if(0<r&&0<s.next_out)this.onData(s.output.subarray(0,s.next_out)),s.avail_out=0;else if(0===s.avail_in)break}else this.onData(s.output)}return!0},Ah.prototype.onData=function(e){this.chunks.push(e)},Ah.prototype.onEnd=function(e){e===xh&&(this.result=mh(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var Lh={Deflate:Ah,deflate:Ph,deflateRaw:function(e,t){return(t=t||{}).raw=!0,Ph(e,t)},gzip:function(e,t){return(t=t||{}).gzip=!0,Ph(e,t)},constants:i},Nh=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Fh=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,199,75]),Uh=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),zh=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),Bh=function(e,t,n,r,i,o,s,a){for(var l,u,c,d,f,h,p,m,v,g=a.bits,y=0,w=0,b=0,k=0,_=0,S=0,E=0,C=0,R=0,T=0,O=null,x=new Uint16Array(16),M=new Uint16Array(16),I=null,y=0;y<=15;y++)x[y]=0;for(w=0;w<r;w++)x[t[n+w]]++;for(_=g,k=15;1<=k&&0===x[k];k--);if(k<_&&(_=k),0===k)i[o++]=20971520,i[o++]=20971520,a.bits=1;else{for(b=1;b<k&&0===x[b];b++);for(_<b&&(_=b),y=C=1;y<=15;y++)if((C=(C<<1)-x[y])<0)return-1;if(0<C&&(0===e||1!==k))return-1;for(M[1]=0,y=1;y<15;y++)M[y+1]=M[y]+x[y];for(w=0;w<r;w++)0!==t[n+w]&&(s[M[t[n+w]]++]=w);if(h=0===e?(O=I=s,20):1===e?(O=Nh,I=Fh,257):(O=Uh,I=zh,0),y=b,f=o,E=w=T=0,c=-1,d=(R=1<<(S=_))-1,1===e&&852<R||2===e&&592<R)return 1;for(;;){for(v=s[w]+1<h?(m=0,s[w]):s[w]>=h?(m=I[s[w]-h],O[s[w]-h]):(m=96,0),l=1<<(p=y-E),b=u=1<<S;i[f+(T>>E)+(u-=l)]=p<<24|m<<16|v|0,0!==u;);for(l=1<<y-1;T&l;)l>>=1;if(0!==l?T=(T&l-1)+l:T=0,w++,0==--x[y]){if(y===k)break;y=t[n+s[w]]}if(_<y&&(T&d)!==c){for(f+=b,C=1<<(S=y-(E=0===E?_:E));S+E<k&&!((C-=x[S+E])<=0);)S++,C<<=1;if(R+=1<<S,1===e&&852<R||2===e&&592<R)return 1;i[c=T&d]=_<<24|S<<16|f-o|0}}0!==T&&(i[f+T]=y-E<<24|64<<16|0),a.bits=_}return 0},jh=i.Z_FINISH,Wh=i.Z_BLOCK,Hh=i.Z_TREES,qh=i.Z_OK,Vh=i.Z_STREAM_END,Gh=i.Z_NEED_DICT,Zh=i.Z_STREAM_ERROR,Jh=i.Z_DATA_ERROR,Kh=i.Z_MEM_ERROR,$h=i.Z_BUF_ERROR,Xh=i.Z_DEFLATED,ie=16209;function Yh(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Qh(e,N){var t,n,F,r,i,o,s,a,l,U,u,c,z,B,d,f,h,p,j,W,m,v,g,y,w=0,b=new Uint8Array(4),H=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(op(e)||!e.output||!e.input&&0!==e.avail_in)return Zh;16191===(t=e.state).mode&&(t.mode=16192),i=e.next_out,F=e.output,r=e.next_in,n=e.input,a=t.hold,l=t.bits,U=o=e.avail_in,u=s=e.avail_out,v=qh;e:for(;;)switch(t.mode){case 16180:if(0===t.wrap)t.mode=16192;else{for(;l<16;){if(0===o)break e;o--,a+=n[r++]<<l,l+=8}2&t.wrap&&35615===a?(0===t.wbits&&(t.wbits=15),b[t.check=0]=255&a,b[1]=a>>>8&255,t.check=Lf(t.check,b,2,0),l=a=0,t.mode=16181):(t.head&&(t.head.done=!1),!(1&t.wrap)||(((255&a)<<8)+(a>>8))%31?(e.msg="incorrect header check",t.mode=ie):(15&a)!==Xh?(e.msg="unknown compression method",t.mode=ie):(l-=4,m=8+(15&(a>>>=4)),0===t.wbits&&(t.wbits=m),15<m||m>t.wbits?(e.msg="invalid window size",t.mode=ie):(t.dmax=1<<t.wbits,t.flags=0,e.adler=t.check=1,t.mode=512&a?16189:16191,l=a=0)))}break;case 16181:for(;l<16;){if(0===o)break e;o--,a+=n[r++]<<l,l+=8}if(t.flags=a,(255&t.flags)!==Xh){e.msg="unknown compression method",t.mode=ie;break}if(57344&t.flags){e.msg="unknown header flags set",t.mode=ie;break}t.head&&(t.head.text=a>>8&1),512&t.flags&&4&t.wrap&&(b[0]=255&a,b[1]=a>>>8&255,t.check=Lf(t.check,b,2,0)),l=a=0,t.mode=16182;case 16182:for(;l<32;){if(0===o)break e;o--,a+=n[r++]<<l,l+=8}t.head&&(t.head.time=a),512&t.flags&&4&t.wrap&&(b[0]=255&a,b[1]=a>>>8&255,b[2]=a>>>16&255,b[3]=a>>>24&255,t.check=Lf(t.check,b,4,0)),l=a=0,t.mode=16183;case 16183:for(;l<16;){if(0===o)break e;o--,a+=n[r++]<<l,l+=8}t.head&&(t.head.xflags=255&a,t.head.os=a>>8),512&t.flags&&4&t.wrap&&(b[0]=255&a,b[1]=a>>>8&255,t.check=Lf(t.check,b,2,0)),l=a=0,t.mode=16184;case 16184:if(1024&t.flags){for(;l<16;){if(0===o)break e;o--,a+=n[r++]<<l,l+=8}t.length=a,t.head&&(t.head.extra_len=a),512&t.flags&&4&t.wrap&&(b[0]=255&a,b[1]=a>>>8&255,t.check=Lf(t.check,b,2,0)),l=a=0}else t.head&&(t.head.extra=null);t.mode=16185;case 16185:if(1024&t.flags&&((c=(c=t.length)>o?o:c)&&(t.head&&(m=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(n.subarray(r,r+c),m)),512&t.flags&&4&t.wrap&&(t.check=Lf(t.check,n,c,r)),o-=c,r+=c,t.length-=c),t.length))break e;t.length=0,t.mode=16186;case 16186:if(2048&t.flags){if(0===o)break e;for(c=0;m=n[r+c++],t.head&&m&&t.length<65536&&(t.head.name+=String.fromCharCode(m)),m&&c<o;);if(512&t.flags&&4&t.wrap&&(t.check=Lf(t.check,n,c,r)),o-=c,r+=c,m)break e}else t.head&&(t.head.name=null);t.length=0,t.mode=16187;case 16187:if(4096&t.flags){if(0===o)break e;for(c=0;m=n[r+c++],t.head&&m&&t.length<65536&&(t.head.comment+=String.fromCharCode(m)),m&&c<o;);if(512&t.flags&&4&t.wrap&&(t.check=Lf(t.check,n,c,r)),o-=c,r+=c,m)break e}else t.head&&(t.head.comment=null);t.mode=16188;case 16188:if(512&t.flags){for(;l<16;){if(0===o)break e;o--,a+=n[r++]<<l,l+=8}if(4&t.wrap&&a!==(65535&t.check)){e.msg="header crc mismatch",t.mode=ie;break}l=a=0}t.head&&(t.head.hcrc=t.flags>>9&1,t.head.done=!0),e.adler=t.check=0,t.mode=16191;break;case 16189:for(;l<32;){if(0===o)break e;o--,a+=n[r++]<<l,l+=8}e.adler=t.check=Dh(a),l=a=0,t.mode=16190;case 16190:if(0===t.havedict)return e.next_out=i,e.avail_out=s,e.next_in=r,e.avail_in=o,t.hold=a,t.bits=l,Gh;e.adler=t.check=1,t.mode=16191;case 16191:if(N===Wh||N===Hh)break e;case 16192:if(t.last)a>>>=7&l,l-=7&l,t.mode=16206;else{for(;l<3;){if(0===o)break e;o--,a+=n[r++]<<l,l+=8}switch(t.last=1&a,--l,3&(a>>>=1)){case 0:t.mode=16193;break;case 1:_=k=void 0;var k=t;if(ap){rp=new Int32Array(512),ip=new Int32Array(32);for(var _=0;_<144;)k.lens[_++]=8;for(;_<256;)k.lens[_++]=9;for(;_<280;)k.lens[_++]=7;for(;_<288;)k.lens[_++]=8;for(Bh(1,k.lens,0,288,rp,0,k.work,{bits:9}),_=0;_<32;)k.lens[_++]=5;Bh(2,k.lens,0,32,ip,0,k.work,{bits:5}),ap=!1}if(k.lencode=rp,k.lenbits=9,k.distcode=ip,k.distbits=5,t.mode=16199,N!==Hh)break;a>>>=2,l-=2;break e;case 2:t.mode=16196;break;case 3:e.msg="invalid block type",t.mode=ie}a>>>=2,l-=2}break;case 16193:for(a>>>=7&l,l-=7&l;l<32;){if(0===o)break e;o--,a+=n[r++]<<l,l+=8}if((65535&a)!=(a>>>16^65535)){e.msg="invalid stored block lengths",t.mode=ie;break}if(t.length=65535&a,l=a=0,t.mode=16194,N===Hh)break e;case 16194:t.mode=16195;case 16195:if(c=t.length){if(0===(c=s<(c=o<c?o:c)?s:c))break e;F.set(n.subarray(r,r+c),i),o-=c,r+=c,s-=c,i+=c,t.length-=c}else t.mode=16191;break;case 16196:for(;l<14;){if(0===o)break e;o--,a+=n[r++]<<l,l+=8}if(t.nlen=257+(31&a),a>>>=5,l-=5,t.ndist=1+(31&a),a>>>=5,l-=5,t.ncode=4+(15&a),a>>>=4,l-=4,286<t.nlen||30<t.ndist){e.msg="too many length or distance symbols",t.mode=ie;break}t.have=0,t.mode=16197;case 16197:for(;t.have<t.ncode;){for(;l<3;){if(0===o)break e;o--,a+=n[r++]<<l,l+=8}t.lens[H[t.have++]]=7&a,a>>>=3,l-=3}for(;t.have<19;)t.lens[H[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,g={bits:t.lenbits},v=Bh(0,t.lens,0,19,t.lencode,0,t.work,g),t.lenbits=g.bits,v){e.msg="invalid code lengths set",t.mode=ie;break}t.have=0,t.mode=16198;case 16198:for(;t.have<t.nlen+t.ndist;){for(;f=(w=t.lencode[a&(1<<t.lenbits)-1])>>>16&255,h=65535&w,!((d=w>>>24)<=l);){if(0===o)break e;o--,a+=n[r++]<<l,l+=8}if(h<16)a>>>=d,l-=d,t.lens[t.have++]=h;else{if(16===h){for(y=d+2;l<y;){if(0===o)break e;o--,a+=n[r++]<<l,l+=8}if(a>>>=d,l-=d,0===t.have){e.msg="invalid bit length repeat",t.mode=ie;break}m=t.lens[t.have-1],c=3+(3&a),a>>>=2,l-=2}else if(17===h){for(y=d+3;l<y;){if(0===o)break e;o--,a+=n[r++]<<l,l+=8}m=0,c=3+(7&(a>>>=d)),a>>>=3,l=l-d-3}else{for(y=d+7;l<y;){if(0===o)break e;o--,a+=n[r++]<<l,l+=8}m=0,c=11+(127&(a>>>=d)),a>>>=7,l=l-d-7}if(t.have+c>t.nlen+t.ndist){e.msg="invalid bit length repeat",t.mode=ie;break}for(;c--;)t.lens[t.have++]=m}}if(t.mode===ie)break;if(0===t.lens[256]){e.msg="invalid code -- missing end-of-block",t.mode=ie;break}if(t.lenbits=9,g={bits:t.lenbits},v=Bh(1,t.lens,0,t.nlen,t.lencode,0,t.work,g),t.lenbits=g.bits,v){e.msg="invalid literal/lengths set",t.mode=ie;break}if(t.distbits=6,t.distcode=t.distdyn,g={bits:t.distbits},v=Bh(2,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,g),t.distbits=g.bits,v){e.msg="invalid distances set",t.mode=ie;break}if(t.mode=16199,N===Hh)break e;case 16199:t.mode=16200;case 16200:if(6<=o&&258<=s){e.next_out=i,e.avail_out=s,e.next_in=r,e.avail_in=o,t.hold=a,t.bits=l,M=P=V=O=T=R=C=E=S=re=ne=te=ee=L=D=Q=Y=X=$=K=J=Z=A=G=I=q=x=void 0;var S,E,C,R,T,O,x=e,q=u,M=x.state,I=x.next_in,V=x.input,G=I+(x.avail_in-5),A=x.next_out,P=x.output,Z=A-(q-x.avail_out),J=A+(x.avail_out-257),K=M.dmax,$=M.wsize,X=M.whave,Y=M.wnext,Q=M.window,D=M.hold,L=M.bits,ee=M.lencode,te=M.distcode,ne=(1<<M.lenbits)-1,re=(1<<M.distbits)-1;t:do{for(L<15&&(D+=V[I++]<<L,L+=8,D+=V[I++]<<L,L+=8),S=ee[D&ne];;){if(D>>>=E=S>>>24,L-=E,0==(E=S>>>16&255))P[A++]=65535&S;else{if(!(16&E)){if(0==(64&E)){S=ee[(65535&S)+(D&(1<<E)-1)];continue}if(32&E){M.mode=16191;break t}x.msg="invalid literal/length code",M.mode=16209;break t}for(C=65535&S,(E&=15)&&(L<E&&(D+=V[I++]<<L,L+=8),C+=D&(1<<E)-1,D>>>=E,L-=E),L<15&&(D+=V[I++]<<L,L+=8,D+=V[I++]<<L,L+=8),S=te[D&re];;){if(D>>>=E=S>>>24,L-=E,!(16&(E=S>>>16&255))){if(0==(64&E)){S=te[(65535&S)+(D&(1<<E)-1)];continue}x.msg="invalid distance code",M.mode=16209;break t}if(R=65535&S,L<(E&=15)&&(D+=V[I++]<<L,(L+=8)<E)&&(D+=V[I++]<<L,L+=8),(R+=D&(1<<E)-1)>K){x.msg="invalid distance too far back",M.mode=16209;break t}if(D>>>=E,L-=E,R>(E=A-Z)){if((E=R-E)>X&&M.sane){x.msg="invalid distance too far back",M.mode=16209;break t}if(O=Q,(T=0)===Y){if(T+=$-E,E<C){for(C-=E;P[A++]=Q[T++],--E;);T=A-R,O=P}}else if(Y<E){if(T+=$+Y-E,(E-=Y)<C){for(C-=E;P[A++]=Q[T++],--E;);if(T=0,Y<C){for(C-=E=Y;P[A++]=Q[T++],--E;);T=A-R,O=P}}}else if(T+=Y-E,E<C){for(C-=E;P[A++]=Q[T++],--E;);T=A-R,O=P}for(;2<C;)P[A++]=O[T++],P[A++]=O[T++],P[A++]=O[T++],C-=3;C&&(P[A++]=O[T++],1<C)&&(P[A++]=O[T++])}else{for(T=A-R;P[A++]=P[T++],P[A++]=P[T++],P[A++]=P[T++],2<(C-=3););C&&(P[A++]=P[T++],1<C)&&(P[A++]=P[T++])}break}}break}}while(I<G&&A<J);I-=C=L>>3,D&=(1<<(L-=C<<3))-1,x.next_in=I,x.next_out=A,x.avail_in=I<G?G-I+5:5-(I-G),x.avail_out=A<J?J-A+257:257-(A-J),M.hold=D,M.bits=L,i=e.next_out,F=e.output,s=e.avail_out,r=e.next_in,n=e.input,o=e.avail_in,a=t.hold,l=t.bits,16191===t.mode&&(t.back=-1);break}for(t.back=0;f=(w=t.lencode[a&(1<<t.lenbits)-1])>>>16&255,h=65535&w,!((d=w>>>24)<=l);){if(0===o)break e;o--,a+=n[r++]<<l,l+=8}if(f&&0==(240&f)){for(p=d,j=f,W=h;f=(w=t.lencode[W+((a&(1<<p+j)-1)>>p)])>>>16&255,h=65535&w,!(p+(d=w>>>24)<=l);){if(0===o)break e;o--,a+=n[r++]<<l,l+=8}a>>>=p,l-=p,t.back+=p}if(a>>>=d,l-=d,t.back+=d,t.length=h,0===f){t.mode=16205;break}if(32&f){t.back=-1,t.mode=16191;break}if(64&f){e.msg="invalid literal/length code",t.mode=ie;break}t.extra=15&f,t.mode=16201;case 16201:if(t.extra){for(y=t.extra;l<y;){if(0===o)break e;o--,a+=n[r++]<<l,l+=8}t.length+=a&(1<<t.extra)-1,a>>>=t.extra,l-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=16202;case 16202:for(;f=(w=t.distcode[a&(1<<t.distbits)-1])>>>16&255,h=65535&w,!((d=w>>>24)<=l);){if(0===o)break e;o--,a+=n[r++]<<l,l+=8}if(0==(240&f)){for(p=d,j=f,W=h;f=(w=t.distcode[W+((a&(1<<p+j)-1)>>p)])>>>16&255,h=65535&w,!(p+(d=w>>>24)<=l);){if(0===o)break e;o--,a+=n[r++]<<l,l+=8}a>>>=p,l-=p,t.back+=p}if(a>>>=d,l-=d,t.back+=d,64&f){e.msg="invalid distance code",t.mode=ie;break}t.offset=h,t.extra=15&f,t.mode=16203;case 16203:if(t.extra){for(y=t.extra;l<y;){if(0===o)break e;o--,a+=n[r++]<<l,l+=8}t.offset+=a&(1<<t.extra)-1,a>>>=t.extra,l-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){e.msg="invalid distance too far back",t.mode=ie;break}t.mode=16204;case 16204:if(0===s)break e;if(t.offset>(c=u-s)){if((c=t.offset-c)>t.whave&&t.sane){e.msg="invalid distance too far back",t.mode=ie;break}z=c>t.wnext?(c-=t.wnext,t.wsize-c):t.wnext-c,c>t.length&&(c=t.length),B=t.window}else B=F,z=i-t.offset,c=t.length;for(s-=c=s<c?s:c,t.length-=c;F[i++]=B[z++],--c;);0===t.length&&(t.mode=16200);break;case 16205:if(0===s)break e;F[i++]=t.length,s--,t.mode=16200;break;case 16206:if(t.wrap){for(;l<32;){if(0===o)break e;o--,a|=n[r++]<<l,l+=8}if(u-=s,e.total_out+=u,t.total+=u,4&t.wrap&&u&&(e.adler=t.check=(t.flags?Lf:Pf)(t.check,F,u,i-u)),u=s,4&t.wrap&&(t.flags?a:Dh(a))!==t.check){e.msg="incorrect data check",t.mode=ie;break}l=a=0}t.mode=16207;case 16207:if(t.wrap&&t.flags){for(;l<32;){if(0===o)break e;o--,a+=n[r++]<<l,l+=8}if(4&t.wrap&&a!==(4294967295&t.total)){e.msg="incorrect length check",t.mode=ie;break}l=a=0}t.mode=16208;case 16208:v=Vh;break e;case ie:v=Jh;break e;case 16210:return Kh;default:return Zh}return e.next_out=i,e.avail_out=s,e.next_in=r,e.avail_in=o,t.hold=a,t.bits=l,(t.wsize||u!==e.avail_out&&t.mode<ie&&(t.mode<16206||N!==jh))&&lp(e,e.output,e.next_out,u-e.avail_out),u-=e.avail_out,e.total_in+=U-=e.avail_in,e.total_out+=u,t.total+=u,4&t.wrap&&u&&(e.adler=t.check=(t.flags?Lf:Pf)(t.check,F,u,e.next_out-u)),e.data_type=t.bits+(t.last?64:0)+(16191===t.mode?128:0)+(16199===t.mode||16194===t.mode?256:0),v=(0==U&&0===u||N===jh)&&v===qh?$h:v}function ep(e){var t;return op(e)?Zh:((t=e.state).window&&(t.window=null),e.state=null,qh)}function tp(e,t){var n,r=t.length;return op(e)||0!==(n=e.state).wrap&&16190!==n.mode?Zh:16190===n.mode&&Pf(1,t,r,0)!==n.check?Jh:lp(e,t,r,r)?(n.mode=16210,Kh):(n.havedict=1,qh)}function np(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var rp,ip,op=function(e){var t;return!e||!(t=e.state)||t.strm!==e||t.mode<16180||16211<t.mode?1:0},sp=function(e){var t;return op(e)||((t=e.state).wsize=0,t.whave=0,t.wnext=0,op(t=e))?Zh:(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=16180,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,qh)},ap=!0,lp=function(e,t,n,r){var i,e=e.state;return null===e.window&&(e.window=new Uint8Array(1<<e.wbits)),0===e.wsize&&(e.wsize=1<<e.wbits,e.wnext=0,e.whave=0),e.wsize<=r?(e.window.set(t.subarray(n-e.wsize,n),0),e.wnext=0,e.whave=e.wsize):((i=e.wsize-e.wnext)>r&&(i=r),e.window.set(t.subarray(n-r,n-r+i),e.wnext),(r-=i)?(e.window.set(t.subarray(n-r,n),0),e.wnext=r,e.whave=e.wsize):(e.wnext+=i,e.wnext===e.wsize&&(e.wnext=0),e.whave<e.wsize&&(e.whave+=i))),0},up=sp,cp=Object.prototype.toString,dp=i.Z_NO_FLUSH,fp=i.Z_FINISH,hp=i.Z_OK,pp=i.Z_STREAM_END,mp=i.Z_NEED_DICT,vp=i.Z_STREAM_ERROR,gp=i.Z_DATA_ERROR,yp=i.Z_MEM_ERROR,wp=i.Z_BUF_ERROR,bp={chunkSize:65536,windowBits:15,to:""};function kp(e){this.options=ph({},bp,e||{});var t,n,r,i=this.options,o=(i.raw&&0<=i.windowBits&&i.windowBits<16&&(i.windowBits=-i.windowBits,0===i.windowBits)&&(i.windowBits=-15),!(0<=i.windowBits&&i.windowBits<16)||e&&e.windowBits||(i.windowBits+=32),15<i.windowBits&&i.windowBits<48&&0==(15&i.windowBits)&&(i.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Sh,this.strm.avail_out=0,e=this.strm,r=i.windowBits,e?(o=new Yh,(e.state=o).strm=e,o.window=null,o.mode=16180,o=r,(n=op(r=e)||(n=r.state,o<0?(t=0,o=-o):(t=5+(o>>4),o<48&&(o&=15)),o&&(o<8||15<o))?Zh:(null!==n.window&&n.wbits!==o&&(n.window=null),n.wrap=t,n.wbits=o,sp(r)))!==qh&&(e.state=null),n):Zh);if(o!==hp)throw new Error(Nf[o]);if(this.header=new np,r=this.strm,e=this.header,op(r)||0!=(2&(r=r.state).wrap)&&((r.head=e).done=!1),i.dictionary&&("string"==typeof i.dictionary?i.dictionary=_h(i.dictionary):"[object ArrayBuffer]"===cp.call(i.dictionary)&&(i.dictionary=new Uint8Array(i.dictionary)),i.raw)&&(o=tp(this.strm,i.dictionary))!==hp)throw new Error(Nf[o])}function _p(e,t){t=new kp(t);if(t.push(e,!0),t.err)throw t.msg||Nf[t.err];return t.result}kp.prototype.push=function(e,t){var n,r,i=this.strm,o=this.options.chunkSize,s=this.options.dictionary;if(this.ended)return!1;for(r=t===~~t?t:!0===t?fp:dp,"[object ArrayBuffer]"===cp.call(e)?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;;){for(0===i.avail_out&&(i.output=new Uint8Array(o),i.next_out=0,i.avail_out=o),(n=Qh(i,r))===mp&&s&&((n=tp(i,s))===hp?n=Qh(i,r):n===gp&&(n=mp));0<i.avail_in&&n===pp&&2&i.state.wrap&&0!==i.state.flags&&0!==i.input[i.next_in];)up(i),n=Qh(i,r);switch(n){case vp:case gp:case mp:case yp:return this.onEnd(n),!(this.ended=!0)}var a,l,u,c=i.avail_out;if(i.next_out&&(0===i.avail_out||n===pp||0<r)&&("string"===this.options.to?(a=((e,t)=>{for(var n=(t=(t=t||e.length)>e.length?e.length:t)-1;0<=n&&128==(192&e[n]);)n--;return!(n<0||0===n)&&n+bh[e[n]]>t?n:t})(i.output,i.next_out),l=i.next_out-a,u=((e,t)=>{var n=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));for(var r=new Array(2*n),i=0,o=0;o<n;){var s=e[o++];if(s<128)r[i++]=s;else{var a=bh[s];if(4<a)r[i++]=65533,o+=a-1;else{for(s&=2===a?31:3===a?15:7;1<a&&o<n;)s=s<<6|63&e[o++],a--;1<a?r[i++]=65533:s<65536?r[i++]=s:(s-=65536,r[i++]=55296|s>>10&1023,r[i++]=56320|1023&s)}}}var l=r,u=i;if(u<65534&&l.subarray&&wh)return String.fromCharCode.apply(null,l.length===u?l:l.subarray(0,u));for(var c="",d=0;d<u;d++)c+=String.fromCharCode(l[d]);return c})(i.output,a),i.next_out=l,i.avail_out=o-l,l&&i.output.set(i.output.subarray(a,a+l),0),this.onData(u)):(this.onData(i.output.length===i.next_out?i.output:i.output.subarray(0,i.next_out)),i.avail_out=0,i.next_out=0)),n!==hp&&n!==wp||0!==c){if(n===pp)return n=ep(this.strm),this.onEnd(n),this.ended=!0;if(0===i.avail_in){if(r===fp)return n=ep(this.strm),this.onEnd(n===hp?wp:n),!(this.ended=!0);break}}}return!0},kp.prototype.onData=function(e){this.chunks.push(e)},kp.prototype.onEnd=function(e){e===hp&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=mh(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var Sp,a={Inflate:kp,inflate:_p,inflateRaw:function(e,t){return(t=t||{}).raw=!0,_p(e,t)},ungzip:_p,constants:i},Ep={Deflate:Lh.Deflate,deflate:Lh.deflate,deflateRaw:Lh.deflateRaw,gzip:Lh.gzip,Inflate:a.Inflate,inflate:a.inflate,inflateRaw:a.inflateRaw,ungzip:a.ungzip,constants:i},Cp=(T(Mp,Sp=Error),Mp),Rp=(xp.prototype.uploadReplay=function(t){return D(this,void 0,void 0,function(){return L(this,function(e){switch(e.label){case 0:return[4,this.uploadReplayResult(t)];case 1:return[2,"success"===e.sent().status]}})})},xp.prototype.uploadReplayResult=function(i){return D(this,void 0,void 0,function(){var t,n,r;return L(this,function(e){switch(e.label){case 0:if(this.isUploading)return[2,{status:"busy",attempts:0}];this.isUploading=!0,t=0,e.label=1;case 1:if(e.trys.push([1,9,10,11]),!(n=this.config.beforeSend(i)))return[2,{status:"cancelled",attempts:t}];if((!n.replay_format||"rrweb"===n.replay_format)&&"gzip_base64"!==n.events_encoding&&5242880<Di(n.events))throw new Cp("Segment exceeds decoded events limit");e.label=2;case 2:e.label=3;case 3:return e.trys.push([3,5,,7]),t++,[4,this.doUpload(n)];case 4:return e.sent(),[2,{status:"success",attempts:t}];case 5:if((r=e.sent()).permanent||t>this.config.maxRetries)throw r;return r=1e3*Math.pow(2,t-1),u("Uploader","Retrying segment "+i.segment_id+" in "+r+"ms"),[4,this.sleep(r)];case 6:return e.sent(),[3,7];case 7:return[3,2];case 8:return[3,11];case 9:Oi("Uploader","Upload failed:",r=e.sent());try{this.config.onError(r)}catch(e){Ti("Uploader","onError callback failed:",e)}return[2,{status:r.permanent?"rejected":"exhausted",attempts:t}];case 10:return this.isUploading=!1,[7];case 11:return[2]}})})},xp.prototype.prepareUploadPayload=function(e){var t=e.replay_format||"rrweb",n=e.events_encoding||"plain_json";if("rrweb"!==t)return e;if(!this.config.eventsCompression||"gzip_base64"===n)return x(x({},e),{replay_format:t,platform:e.platform||"web",events_encoding:n});try{var r=Ep.gzip(e.events),i=this.uint8ArrayToBase64(r),o=e.events.length,s=r.length,a=i.length;return u("Uploader","Events compressed: "+Math.round(o/1024)+"KB -> gzip "+Math.round(s/1024)+"KB -> base64 "+Math.round(a/1024)+"KB"),x(x({},e),{replay_format:t,platform:e.platform||"web",events_encoding:"gzip_base64",events:i})}catch(n){return Ti("Uploader","Events compression failed, fallback to plain_json:",n),x(x({},e),{replay_format:t,platform:e.platform||"web",events_encoding:"plain_json"})}},xp.prototype.uint8ArrayToBase64=function(e){for(var t="",n=0;n<e.length;n+=32768){for(var r=e.subarray(n,n+32768),i="",o=0;o<r.length;o++)i+=String.fromCharCode(r[o]);t+=i}if("function"==typeof btoa)return btoa(t);if("undefined"!=typeof Buffer)return Buffer.from(e).toString("base64");throw new Error("base64 encode is not supported")},xp.prototype.doUpload=function(s){return D(this,void 0,void 0,function(){var t,n,r,i,o;return L(this,function(e){switch(e.label){case 0:if(t=this.prepareUploadPayload(s),o=JSON.stringify(t),n={"Content-Type":"application/json","X-App-ID":this.config.appId},u("Uploader","Sending replay payload: "+Math.round(o.length/1024)+"KB, events_encoding="+(t.events_encoding||"plain_json")),o.length<65536||u("Uploader","Data size "+Math.round(o.length/1024)+"KB exceeds keepalive limit, using normal fetch"),this.config.transport)return[4,this.config.transport.request({kind:"replay",url:this.config.uploadUrl,method:"POST",headers:n,body:o,retry:!1})];throw new Error("Replay Transport is not configured");case 1:t=e.sent(),n=t||{ok:!1,status:0,statusText:"Transport failed"};try{i="string"==typeof n.body?JSON.parse(n.body):n.body,r=null==i?void 0:i.code}catch(e){}if(413===n.status||1007===r||1001===r||1006===r)throw new Cp("Replay rejected: HTTP "+(n.status||0)+", code "+(r||0));if(!n.ok)throw new Error("HTTP "+(n.status||0)+": "+(n.statusText||"Transport failed"));if(0!==(o="string"==typeof n.body?JSON.parse(n.body):n.body).code)throw new Error("Server error (code "+o.code+"): "+o.message);return[2]}})})},xp.prototype.measurePayload=function(e){return Di(this.serializePayload(e))},xp.prototype.sendBeacon=function(e){var t,n;try{var r,i=this.serializePayload(e);return null!=(t=this.config.transport)&&t.handoff?(r=this.config.transport.handoff({kind:"replay",url:this.config.uploadUrl,method:"POST",contentType:"application/json",body:i,sendBeacon:!0}))&&"function"==typeof r.then?(Ti("Uploader","sendBeacon handoff is async, acceptance is unknown"),!1):!0===(null==(n=r)?void 0:n.handoffAccepted):!1}catch(e){return Oi("Uploader","sendBeacon failed:",e),!1}},xp.prototype.serializePayload=function(e){return JSON.stringify(this.prepareUploadPayload(e))},xp.prototype.isUploadInProgress=function(){return this.isUploading},xp.prototype.sleep=function(t){return new Promise(function(e){return setTimeout(e,t)})},xp),Tp=(Op.prototype.start=function(){this.isRunning||(document.addEventListener("pointerdown",this.handlePointerDown,!0),document.addEventListener("click",this.handleClick,!0),document.addEventListener("visibilitychange",this.onVisibility),window.addEventListener("pagehide",this.closeRage),window.addEventListener("beforeunload",this.closeRage),this.isRunning=!0,u("ClickDetector","Started"))},Op.prototype.stop=function(){this.isRunning&&(document.removeEventListener("pointerdown",this.handlePointerDown,!0),document.removeEventListener("click",this.handleClick,!0),document.removeEventListener("visibilitychange",this.onVisibility),window.removeEventListener("pagehide",this.closeRage),window.removeEventListener("beforeunload",this.closeRage),this.cleanupSlowClick(),this.finishRage(),this.isRunning=!1,u("ClickDetector","Stopped"))},Op.prototype.handlePointerDown=function(e){var t=this,n=e.target;n&&n instanceof Element&&(n=Ln(n),this.cleanupSlowClick(),this.clickStartTime=Date.now(),this.clickNode=n,(e=this.getExternalNavigationReason(e,n))?"custom"!==e?this.markEffectiveAction(e):this.cleanupSlowClick():(this.slowClickTimeoutId=setTimeout(function(){t.handleSlowClick("timeout")},this.options.slowClickTimeout),this.startMutationObserver()))},Op.prototype.handleClick=function(e){var t,n,r,i=this;e.target instanceof Element&&(r=Ln(e.target),t=Date.now(),e={node:this.getNodeInfo(r),target:r,event:e,timestamp:t,effectiveActionReason:this.getExternalNavigationReason(e,r)||void 0},this.cleanupSlowClick(),this.clickNode=r,this.clickStartTime=t,this.slowClickTimeoutId=setTimeout(function(){return i.handleSlowClick("timeout")},this.options.slowClickTimeout),this.startMutationObserver(),this.options.onClickStart(e),e.effectiveActionReason&&"custom"!==e.effectiveActionReason&&this.markEffectiveAction(e.effectiveActionReason),n=this.options.getClickContext(),this.rage&&(this.rage.target!==r||this.rage.context!==n||t-this.rage.lastAt>=this.options.rageClickWindow)&&this.finishRage(),r=this.rage||{target:r,context:n,candidates:[],related:[],count:0,lastAt:t},(this.rage=r).lastAt=t,r.anchor?(r.count++,r.related=g(r.related,[e]).slice(-10)):(r.candidates=g(r.candidates,[e]).filter(function(e){return t-e.timestamp<=i.options.rageClickWindow}).slice(-this.options.rageClickCount),r.candidates.length>=this.options.rageClickCount&&(r.anchor=r.candidates[0],r.count=r.candidates.length,r.related=r.candidates,r.candidates=[])),null!==this.rageTimer&&clearTimeout(this.rageTimer),this.rageTimer=setTimeout(function(){return i.finishRage()},this.options.rageClickWindow))},Op.prototype.finishRage=function(){null!==this.rageTimer&&clearTimeout(this.rageTimer),this.rageTimer=null;var e,t=this.rage;(this.rage=null)!=t&&t.anchor&&(e=t.related.includes(t.anchor)?t.related:g([t.anchor],t.related.slice(-9)),this.options.onRageClick({node:t.anchor.node,clickCount:t.count,timeWindowMs:this.options.rageClickWindow,timestamp:t.anchor.timestamp,lastTimestamp:t.lastAt,clicks:e}))},Op.prototype.startMutationObserver=function(){var t=this;this.clickNode&&document.body&&"undefined"!=typeof MutationObserver&&(this.mutationObserver=new MutationObserver(function(e){t.hasSignificantMutation(e)&&(t.emitEffectiveAction("dom_mutation"),t.handleSlowClick("mutation"))}),this.mutationObserver.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class","style","hidden","disabled","aria-hidden","aria-disabled","aria-busy"],characterData:!0}))},Op.prototype.hasSignificantMutation=function(e){for(var t=0,n=e;t<n.length;t++){var r=n[t];if("characterData"===r.type)return!0;if("childList"===r.type&&(0<r.addedNodes.length||0<r.removedNodes.length)&&Array.from(r.addedNodes).concat(Array.from(r.removedNodes)).some(function(e){var t;return e.nodeType===Node.TEXT_NODE&&!(null==(t=e.textContent)||!t.trim())||e.nodeType===Node.ELEMENT_NODE&&!["SCRIPT","STYLE","LINK"].includes(e.tagName)}))return!0;if("attributes"===r.type){r=r.attributeName;if(["class","style","hidden","disabled","aria-hidden","aria-disabled","aria-busy"].includes(r||""))return!0}}return!1},Op.prototype.handleSlowClick=function(e){var t;this.clickNode&&this.clickStartTime&&((t=Date.now()-this.clickStartTime)>=this.options.slowClickThreshold&&this.options.onSlowClick({node:this.getNodeInfo(this.clickNode),timeAfterClickMs:t,endReason:e,timestamp:this.clickStartTime}),this.cleanupSlowClick())},Op.prototype.cleanupSlowClick=function(){this.slowClickTimeoutId&&(clearTimeout(this.slowClickTimeoutId),this.slowClickTimeoutId=null),this.mutationObserver&&(this.mutationObserver.disconnect(),this.mutationObserver=null),this.clickStartTime=0,this.clickNode=null},Op.prototype.markEffectiveAction=function(e){this.clickNode&&this.clickStartTime&&(this.emitEffectiveAction(e),this.cleanupSlowClick())},Op.prototype.emitEffectiveAction=function(e){this.clickNode&&this.options.onEffectiveAction({reason:e,timestamp:Date.now(),node:this.getNodeInfo(this.clickNode)})},Op.prototype.getExternalNavigationReason=function(e,t){var n=t.closest("a");if(n){if(n.download)return"download";var r=(n.getAttribute("target")||"").toLowerCase();if(r&&"_self"!==r)return"external_navigation";if(n.href&&(1===e.button||e.metaKey||e.ctrlKey||e.shiftKey))return"external_navigation"}r=t.closest("form"),n=((null==r?void 0:r.getAttribute("target"))||"").toLowerCase();return n&&"_self"!==n?"external_navigation":t.hasAttribute("data-tdem-ignore-dead-click")||t.closest("[data-tdem-ignore-dead-click]")||t.hasAttribute("data-tdem-effective-action")||t.closest("[data-tdem-effective-action]")?"custom":null},Op.prototype.getNodeInfo=function(e){var t;return{id:(null==(t=e.__sn)?void 0:t.id)||0,tagName:e.tagName.toLowerCase(),textContent:(e.textContent||"").trim().substring(0,100),selector:this.getSelector(e)}},Op.prototype.getSelector=function(e){for(var t=[],n=e;n&&n!==document.body&&t.length<5;){var r,i=n.tagName.toLowerCase();if(n.id){i+="#"+n.id,t.unshift(i);break}n.className&&"string"==typeof n.className&&0<(r=n.className.trim().split(/\s+/).slice(0,2)).length&&(i+="."+r.join(".")),t.unshift(i),n=n.parentElement}return t.join(" > ")},Op.prototype.isActive=function(){return this.isRunning},Op);function Op(e){var t,n=this;void 0===e&&(e={}),this.isRunning=!1,this.clickStartTime=0,this.clickNode=null,this.slowClickTimeoutId=null,this.mutationObserver=null,this.rage=null,this.rageTimer=null,this.closeRage=function(){return n.finishRage()},this.onVisibility=function(){"hidden"===document.visibilityState&&n.finishRage()},this.options={slowClickTimeout:null!=(t=e.slowClickTimeout)?t:7e3,slowClickThreshold:null!=(t=e.slowClickThreshold)?t:3e3,rageClickCount:null!=(t=e.rageClickCount)?t:5,rageClickWindow:null!=(t=e.rageClickWindow)?t:3e3,onSlowClick:e.onSlowClick||function(){},onRageClick:e.onRageClick||function(){},onClickStart:e.onClickStart||function(){},onEffectiveAction:e.onEffectiveAction||function(){},onDeadClick:e.onDeadClick||function(){},getClickContext:e.getClickContext||function(){return window.location.href}},this.handleClick=this.handleClick.bind(this),this.handlePointerDown=this.handlePointerDown.bind(this)}function xp(e){var t;this.isUploading=!1,this.useCompression=!1,this.config={uploadUrl:e.uploadUrl||"/api/v1/collect/replay",appId:e.appId,maxRetries:null!=(t=e.maxRetries)?t:3,beforeSend:e.beforeSend||function(e){return e},onError:e.onError||function(){},eventsCompression:null==(t=e.eventsCompression)||t,transport:e.transport}}function Mp(){var e=null!==Sp&&Sp.apply(this,arguments)||this;return e.permanent=!0,e}function Ip(e){return Number.isNaN(e)?0:Math.max(0,Math.min(1,e))}function Ap(e){return Ip((e=e,(Number.isNaN(e)?0:Math.max(0,Math.min(100,e)))/100))}function Pp(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Dp(e,t){var e=!1===(e=e)||void 0===e?{enabled:!1,sessionSampleRate:.1,errorSampleRate:1,errorTraceback:!0}:!0===e?{enabled:!0,sessionSampleRate:.1,errorSampleRate:1,errorTraceback:!0}:{enabled:!1!==e.enabled,sessionSampleRate:"number"==typeof e.sessionSampleRate?Ip(e.sessionSampleRate):.1,errorSampleRate:"number"==typeof e.errorSampleRate?Ip(e.errorSampleRate):1,errorTraceback:void 0===e.errorTraceback||!!e.errorTraceback},t=t&&"object"==typeof t?t:null,n=e.enabled,r=(t&&Pp(t,"enabled")&&(n=e.enabled&&!!t.enabled),e.sessionSampleRate),i=e.errorSampleRate,e=e.errorTraceback;return n&&t&&(Pp(t,"experience_sample_rate")&&null!=t.experience_sample_rate?r=Ap(Number(t.experience_sample_rate)):Pp(t,"replay_sample_rate")&&null!=t.replay_sample_rate&&(r=Ap(Number(t.replay_sample_rate))),Pp(t,"error_traceback")&&null!=t.error_traceback&&(e=!!t.error_traceback),Pp(t,"error_sample_rate"))&&null!=t.error_sample_rate&&(i=Ap(Number(t.error_sample_rate))),{enabled:n,sessionSampleRate:r,errorSampleRate:e?i:0,errorTraceback:e}}function Lp(e,t){return x(x({},e),{enabled:t.enabled,sessionSampleRate:t.sessionSampleRate,errorSampleRate:t.errorSampleRate,errorTraceback:t.errorTraceback})}function Np(e){if(!1!==(null==(t=e.config)?void 0:t.sessionReplay)){var t=e._effectiveReplayPolicy;if(!t||t.enabled)if(!1!==e._replaySampled)return!(e=null==(t=e)?void 0:t._tdemSampleGate)||e.isDecided}}function Fp(e,t){return void 0===t&&(t=2),"number"==typeof e&&Number.isFinite(e)?(t=Math.pow(10,Math.max(0,Math.min(12,Math.floor(t)))),Math.round(e*t)/t):0}function Up(e,t){return void 0===t&&(t=2048),"string"==typeof e&&e.trim()?e.trim().slice(0,Math.max(1,Math.floor(t))):"unknown"}function zp(e){var t,n=nm.get(e);if(n){n.destroyed=!0;try{null!=(t=n.observer)&&t.disconnect()}catch(e){}n.observer=null,n.lagRecords.length=0,e.lifeCycle.remove("destroy",n.onDestroy),nm.delete(e)}}function Bp(e){var t=e.nodeName.toLowerCase(),n=e.id||"",r=(e="string"==typeof(e=e).className?e.className:e.getAttribute("class")||"").split(" ").filter(Boolean).map(function(e){return"."+e}).join("");return{tagName:t,id:n,className:e,selector:t+(n?"#"+n:"")+r}}function jp(t,e){var n;if(null!=(n=null==e?void 0:e.tagName)&&n.some(function(e){return t.tagName===e.toLowerCase().trim()}))return!0;if(t.id&&null!=(n=null==e?void 0:e.id)&&n.some(function(e){return t.id===e.trim()}))return!0;if(t.className&&null!=(n=null==e?void 0:e.className)&&n.length){var r=t.className.split(" ").map(function(e){return e.trim()}).filter(Boolean);if(e.className.some(function(e){return r.includes(e.trim())}))return!0}return!1}function Wp(t,e){return e.some(function(e){return t.selector.includes(e)})}function Hp(e){return{tagName:g(e.tagName||[]),id:g(e.id||[]),className:g(e.className||[])}}function qp(){return x(x({},im),{containers:g(im.containers),ignoreContainers:g(im.ignoreContainers),containerMatchers:Hp(im.containerMatchers),ignoreMatchers:Hp(im.ignoreMatchers),detectStartPosition:x({},im.detectStartPosition),ignoreElesWhenDomChange:g(im.ignoreElesWhenDomChange)})}function Vp(e,t){return void 0===t&&(t=2),t=Math.pow(10,t),Math.round(e*t)/t}function Gp(e){var t,n=sm.get(e);n&&(n.destroyed=!0,n.detectTimer&&clearTimeout(n.detectTimer),n.bodyWaitTimer&&clearTimeout(n.bodyWaitTimer),null!==n.idleCallbackId&&"function"==typeof window.cancelIdleCallback&&(window.cancelIdleCallback(n.idleCallbackId),n.idleCallbackId=null),null!==n.bodyWaitFrame&&(window.cancelAnimationFrame||clearTimeout)(n.bodyWaitFrame),null!=(t=n.observer)&&t.disconnect(),e.lifeCycle.remove("errorOccurred",n.onErrorOccurred),e.lifeCycle.remove("destroy",n.onDestroy),window.removeEventListener("pagehide",n.handlePageHide),window.removeEventListener("beforeunload",n.handleBeforeUnload),document.removeEventListener("visibilitychange",n.handleVisibilityChange),sm.delete(e))}function Zp(e,t,n){null!=(e=null==e?void 0:e.config)&&e.debug&&"undefined"!=typeof console&&console.warn("[TDEM] "+t+": "+n+", fallback applied")}function Jp(){var e;try{var t=null==(e=window.performance)?void 0:e.memory;return!t||!cm(t.usedJSHeapSize)||!cm(t.totalJSHeapSize)||!cm(t.jsHeapSizeLimit)||t.usedJSHeapSize<0||t.totalJSHeapSize<0||t.jsHeapSizeLimit<0?null:{used:t.usedJSHeapSize,total:t.totalJSHeapSize,limit:t.jsHeapSizeLimit,ratio:0<t.jsHeapSizeLimit?Math.min(1,t.usedJSHeapSize/t.jsHeapSizeLimit):0}}catch(e){return null}}function Kp(e){var t=um.get(e);t&&(t.destroyed=!0,t.reportTimer&&clearInterval(t.reportTimer),t.oomCheckTimer&&clearInterval(t.oomCheckTimer),t.records.length=0,e.lifeCycle.remove("destroy",t.onDestroy),"undefined"!=typeof window&&(window.removeEventListener("pagehide",t.onPageExit),window.removeEventListener("beforeunload",t.onPageExit)),um.delete(e))}function $p(e,t,n){var r,i,o;t.destroyed||(i=Jp())&&(t.records.push(i),50<t.records.length&&t.records.shift(),o=P(e),n={event_id:A(),event_type:n,event_category:I.PERFORMANCE,timestamp:Date.now(),page_url:(null==(r=e.getOriginFrom)?void 0:r.call(e))||window.location.href,data:x(x({measurements:x({used_js_heap_size_bytes:i.used,total_js_heap_size_bytes:i.total,js_heap_size_limit_bytes:i.limit,usage_ratio:i.ratio},n===M.MEMORY_OOM?{oom_threshold_mb:t.config.oomThreshold}:{}),event_properties:{detection_source:"performance_memory"}},o?{replay_id:o}:{}),{tags:{environment:(null==(r=e.config)?void 0:r.env)||"production",version:String((null==(i=e.config)?void 0:i.version)||"")}})},e.reportTDEMEvent(n))}new e({name:"sessionReplay"});var f=new e({name:"sessionReplay",sessionManager:null,eventBuffer:null,recorderManager:null,samplerManager:null,uploader:null,clickDetector:null,removeClickVisitListener:null,flushTimer:null,replayConfig:null,isInitialized:!1,errorTraceback:!0,_tdemRef:null,_isCheckoutFlushing:!1,_lastLifecycleSnapshotAt:0,_pendingSegments:[],_baselineDelivered:!1,_baselineFlushScheduled:!1,_flushTail:Promise.resolve(),_drainPromise:null,_drainRequested:!1,_awaitingBaseline:!1,_recoveryMeta:null,init:function(e){},applyEffectivePolicy:function(e){var t,n;if(this.errorTraceback=e.errorTraceback,this.replayConfig&&(this.replayConfig=Lp(this.replayConfig,e)),this.samplerManager&&this.samplerManager.updateRates(e.sessionSampleRate,e.errorSampleRate),this.isInitialized){if(e.enabled)return(n=this.samplerManager)?0<e.sessionSampleRate||e.errorTraceback&&0<e.errorSampleRate?!e.errorTraceback&&n.isBufferMode()?(u("Plugin","Error traceback off while in buffer, stopping replay"),this.stopReplay(),null!=(t=this.eventBuffer)&&t.clear(),this._pendingSegments=[],this._recoveryMeta=null,this._awaitingBaseline=!1,void n.forceMode(!1)):void(e.errorTraceback&&e.sessionSampleRate<=0&&0<e.errorSampleRate&&n.isSessionMode()&&(u("Plugin","Remote SSR=0 with traceback on: demote session→buffer"),n.forceMode("buffer"),this.flushTimer)&&(clearInterval(this.flushTimer),this.flushTimer=null)):(u("Plugin","Effective policy no longer allows recording, stopping"),this.stopReplay(),null!=(t=this.eventBuffer)&&t.clear(),this._pendingSegments=[],this._recoveryMeta=null,this._awaitingBaseline=!1,void n.forceMode(!1)):void 0;u("Plugin","Effective policy disabled, stopping replay"),this.stopReplay(),null!=(e=this.eventBuffer)&&e.clear(),this._pendingSegments=[],this._recoveryMeta=null,this._awaitingBaseline=!1}},shouldSkipBufferFlush:function(){var e;return!0===(null==(e=this.samplerManager)?void 0:e.isBufferMode())},onNewTdem:function(e,t){var n,r,t=this.parseConfig(t),i=null!=(i=t.debug)&&i,i=(Ei=i,e._effectiveReplayPolicy);i||(i=Dp(t,(n=e._prefetchedConfigData)&&"object"==typeof n&&("replay_sample_rate"in n||"error_traceback"in n||"error_sample_rate"in n||"tdem_sample_rate"in n||"enabled"in n)?(r={},Object.prototype.hasOwnProperty.call(n,"enabled")&&(r.enabled=!!n.enabled),Object.prototype.hasOwnProperty.call(n,"replay_sample_rate")&&(r.replay_sample_rate=Number(n.replay_sample_rate)),Object.prototype.hasOwnProperty.call(n,"error_traceback")&&(r.error_traceback=!!n.error_traceback),Object.prototype.hasOwnProperty.call(n,"error_sample_rate")&&(r.error_sample_rate=Number(n.error_sample_rate)),r):null),e._effectiveReplayPolicy=i,e._replaySampled=i.enabled),i.enabled?(n=Lp(x(x({},t),{enabled:!0}),i),this.replayConfig=n,this.errorTraceback=i.errorTraceback,this._tdemRef=e,this.initializeModules(e,n),(r=this.samplerManager.initializeSampling()).shouldRecord?(this.startReplay(e,n,r.mode),this.registerReplaySamplingCheck(e,n),this.listenForErrors(e,n),this.listenForPerformance(e),this.listenForLifecycle(e,n),this.listenForUnload(e),this.isInitialized=!0):u("Plugin","Not sampled by sampler, skipping")):u("Plugin","disabled by effective policy")},registerReplaySamplingCheck:function(t,e){function n(e){clearInterval(i),e?(u("Plugin","Session/policy rejected, stopping replay and clearing buffer"),r.stopReplay(),r.eventBuffer&&r.eventBuffer.clear()):u("Plugin","Session sampled, replay continues")}var r=this,i=setInterval(function(){var e=t._effectiveReplayPolicy;e&&!e.enabled||!1===(null==(e=t.config)?void 0:e.sessionReplay)?n(!0):Np(t)&&(null!=(e=r.maybeScheduleBaselineFlush)&&e.call(r),n(!1))},50);t.lifeCycle.on("destroy",function(){clearInterval(i)})},parseConfig:function(e){return!0===e?{enabled:!0}:"object"==typeof e?x(x({},e),{enabled:!1!==e.enabled}):{enabled:!1}},initializeModules:function(r,e){function t(){var e;return null==(e=n.clickDetector)?void 0:e.finishRage()}var n=this,i=(this.sessionManager=new xi({stickySession:null==(i=e.stickySession)||i}),this.sessionManager.setTdemInstance(r),r.sessionManager=this.sessionManager,this.eventBuffer=new Li({},null!=(i=e.useCompression)&&i),this.samplerManager=new Bd({sessionSampleRate:e.sessionSampleRate,errorSampleRate:e.errorSampleRate}),this.recorderManager=new zd({onRecordingEvent:function(e){n.handleRecordingEvent(e,r)},onCheckout:function(){if(!n._isCheckoutFlushing){n._isCheckoutFlushing=!0;try{var e,t;n.shouldSkipBufferFlush()?u("SessionReplay","Checkout in buffer mode (error traceback), skip flush"):(e=n._tdemRef,t=n.replayConfig,e&&t&&n.eventBuffer&&!n.eventBuffer.isEmpty()&&(u("SessionReplay","Checkout triggered, flushing current buffer"),n.flushReplayData(e,t,!0)))}finally{n._isCheckoutFlushing=!1}}},mode:"session"},e),(r.config.url||r.config.hostUrl||"").replace(/\/+$/,""));this.uploader=new Rp({uploadUrl:e.uploadUrl||i+"/api/v1/collect/replay",appId:String(r.config.id||""),beforeSend:e.beforeSend,onError:e.onError,eventsCompression:null==(i=e.eventsCompression)||i,transport:null==(i=r.getInternalTransport)?void 0:i.call(r)}),this.clickDetector=new Tp({getClickContext:function(){var e,t,n;return[(n=(e=r).sessionManager,(null==(t=null==(t=null==n?void 0:n.getSession)?void 0:t.call(n))?void 0:t.id)||(null==(n=e.bean)?void 0:n.sessionId)||""),r._customPageUrl||window.location.href,null!=(n=null!=(t=r.viewId)?t:null==(e=r.bean)?void 0:e.viewId)?n:""].join("\n")},slowClickTimeout:e.slowClickTimeout,slowClickThreshold:e.slowClickThreshold,rageClickCount:e.rageClickCount,rageClickWindow:e.rageClickWindow,onSlowClick:function(e){n.handleSlowClick(e,r)},onRageClick:function(e){n.handleRageClick(e,r)}}),null!=(i=this.removeClickVisitListener)&&i.call(this);r.lifeCycle.on("pageVisitChanged",t),r.lifeCycle.on("pageChanged",t),r.lifeCycle.on("beforeCloseFlush",t),this.removeClickVisitListener=function(){r.lifeCycle.remove("pageVisitChanged",t),r.lifeCycle.remove("pageChanged",t),r.lifeCycle.remove("beforeCloseFlush",t)},u("Plugin","Modules initialized")},startReplay:function(e,t,n){var r;this.sessionManager&&this.recorderManager&&this.eventBuffer?(r=(r=this.sessionManager.restoreSession())||this.sessionManager.createSession(n),this._baselineDelivered=!1,this._baselineFlushScheduled=!1,this._awaitingBaseline=!1,this._recoveryMeta=null,u("Plugin","Session started:",r.id,"mode:",n),this.recorderManager.options.mode=n,r=Nd(x({maskAllText:!1!==t.maskAllInputs,maskAllInputs:t.maskAllInputs,maskTextSelector:t.maskTextSelector,blockSelector:t.blockSelector,ignoreSelector:t.ignoreSelector},t.privacy)),this.recorderManager.startRecording({privacy:r}),this.clickDetector&&this.clickDetector.start(),"session"===n?this.startFlushTimer(e,t):u("Plugin","Buffer mode - flush on error only")):Oi("Plugin","Modules not initialized")},handleRecordingEvent:function(e,t){if(this.eventBuffer&&this.sessionManager){this.sanitizeDataURLs(e);var n=Di(JSON.stringify(e))+1;if(5242880<n+1)this._awaitingBaseline=!0,this._recoveryMeta=null,this._baselineDelivered=!1,Oi("Replay","Event exceeds decoded events limit ("+n+" bytes), waiting for next baseline");else{if(this._awaitingBaseline){if(4===e.type)return this._recoveryMeta=e,void this.enforceReplayBudget();if(2!==e.type||!this._recoveryMeta)return;n=[this._recoveryMeta,e];if(5242880<Di(JSON.stringify(n)))return;this._recoveryMeta=null,this._awaitingBaseline=!1,this._baselineDelivered=!1,this.appendReplayEvents(n)}else this.appendReplayEvents([e]);this.sessionManager.updateActivity(),this.maybeScheduleBaselineFlush()}}},sanitizeDataURLs:function(e){var t=e.type;if(2===t){var n=null==(n=e.data)?void 0:n.node;n&&this.sanitizeNodeTree(n,1024)}else if(3===t){n=e.data;if(0===(null==n?void 0:n.source)&&Array.isArray(n.adds)){for(var r=0,i=n.adds;r<i.length;r++){var o=i[r];null!=o&&o.node&&this.sanitizeNodeTree(o.node,1024)}if(Array.isArray(n.attributes))for(var s=0,a=n.attributes;s<a.length;s++){var l=a[s];if(null!=l&&l.attributes)for(var u=0,c=Object.entries(l.attributes);u<c.length;u++){var d=c[u],f=d[0],d=d[1];"string"==typeof d&&1024<d.length&&d.startsWith("data:")&&(l.attributes[f]='data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg"%3E%3C/svg%3E')}}}}},sanitizeNodeTree:function(e,t){if(e){if(e.attributes)for(var n=e.attributes,r=0,i=Object.keys(n);r<i.length;r++){var o=i[r],s=n[o];"string"==typeof s&&s.length>t&&s.startsWith("data:")&&(n[o]='data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg"%3E%3C/svg%3E')}if(Array.isArray(e.childNodes))for(var a=0,l=e.childNodes;a<l.length;a++){var u=l[a];this.sanitizeNodeTree(u,t)}}},handleSlowClick:function(e,t){u("ClickDetector","Slow click detected:",e.timeAfterClickMs,"ms"),this.addCustomEvent({category:"ui.slowClickDetected",message:"Slow click: "+e.timeAfterClickMs+"ms on "+e.node.tagName,data:{node:e.node,timeAfterClickMs:e.timeAfterClickMs,endReason:e.endReason}},t)},handleRageClick:function(e,t){u("ClickDetector","Rage click detected:",e.clickCount,"clicks"),this.addCustomEvent({category:"ui.multiClick",message:"Rage click: "+e.clickCount+" clicks on "+e.node.tagName,data:{node:e.node,clickCount:e.clickCount,timeWindowMs:e.timeWindowMs}},t)},addCustomEvent:function(e,t){this.eventBuffer&&(e={type:5,data:{tag:e.category,payload:x({message:e.message},e.data)},timestamp:Date.now()},this.eventBuffer.addEvent(e))},startFlushTimer:function(e,t){var n=this;this.flushTimer&&clearInterval(this.flushTimer),this.flushTimer=setInterval(function(){n.flushReplayData(e,t)},2e4)},maybeScheduleBaselineFlush:function(){var e,t,n,r=this;this._baselineDelivered||this._baselineFlushScheduled||this._awaitingBaseline||this.shouldSkipBufferFlush()||null==(e=this.eventBuffer)||!e.hasBaselinePair()||(t=this._tdemRef,n=this.replayConfig,t&&n&&Np(t)&&(this._baselineFlushScheduled=!0,Promise.resolve().then(function(){r._baselineFlushScheduled=!1,r._baselineDelivered||r.shouldSkipBufferFlush()||Np(t)&&(r._baselineDelivered=!0,r.flushReplayData(t,n,!0))})))},canReportReplay:function(e){return!(!(this.sessionManager&&this.eventBuffer&&this.uploader)||!Np(e)||this.shouldSkipBufferFlush()||!this.sessionManager.getSession())},getRetainedReplayBytes:function(){var e;return((null==(e=this.eventBuffer)?void 0:e.getSize())||0)+2+this._pendingSegments.reduce(function(e,t){return e+t.byteLength},0)+(this._recoveryMeta?Di(JSON.stringify(this._recoveryMeta))+1:0)},appendReplayEvents:function(e){var t,n=this;this.eventBuffer&&(t=e.reduce(function(e,t){return e+Di(JSON.stringify(t))+1},0),5242880<this.eventBuffer.getSize()+t+2||10485760<this.getRetainedReplayBytes()+t?this.compactReplayQueue(e):e.forEach(function(e){return n.eventBuffer.addEvent(e)}))},enforceReplayBudget:function(){(10485760<this.getRetainedReplayBytes()||64<this._pendingSegments.length)&&this.compactReplayQueue()},compactReplayQueue:function(e,t){var n=this;if(void 0===e&&(e=[]),this.eventBuffer){var r=this._awaitingBaseline,i=this._recoveryMeta,o=[],s=[],a=null;this._pendingSegments.forEach(function(e){e===t||"sending"===e.status?(e.events.forEach(function(e){4===e.type&&(a=e)}),e!==t&&s.push(e)):e.events.forEach(function(e){return o.push(e)})}),this.eventBuffer.detachEvents().forEach(function(e){return o.push(e)}),e.forEach(function(e){return o.push(e)});for(var l=-1,u=null,c=0;c<o.length;c++){var d=o[c];4===d.type&&(a=d),2===d.type&&a&&Di(JSON.stringify([a,d]))<=5242880&&(l=c,u=a)}var e=0<=l&&u?g([u],o.slice(l)):[],f=(this._pendingSegments=s,this._recoveryMeta=null,Di(JSON.stringify(e))),f=(e.length&&f<=5242880&&this.getRetainedReplayBytes()+f<=10485760?(e.forEach(function(e){return n.eventBuffer.addEvent(e)}),this._awaitingBaseline=r):this._awaitingBaseline=!0,i||a);this._awaitingBaseline&&f&&this.getRetainedReplayBytes()+Di(JSON.stringify(f))+1<=10485760&&(this._recoveryMeta=f),this._baselineDelivered=!1,Ti("Replay","Discarded replay dependency chain; retained latest complete checkpoint if it fits")}},freezeActiveBuffer:function(e){var t,n,r,i,o=this;this.sessionManager&&this.eventBuffer&&(t=this.sessionManager.getSession())&&!this.eventBuffer.isEmpty()&&(!e&&this.eventBuffer.getEventCount()<10?u("Flush","Skipping flush, only "+this.eventBuffer.getEventCount()+" events (min: 10)"):(0!==t.segmentId||this.eventBuffer.hasCheckout()||(Ti("Flush","First segment missing FullSnapshot, triggering manual checkout"),null==(e=this.recorderManager))||e.takeFullSnapshot(),0!==(e=this.eventBuffer.detachEvents()).length&&(r=!(n=[]),i=null,e.forEach(function(e){if(5242880<Di(JSON.stringify([e])))r=!0,i=null,Oi("Replay","Oversized event discarded before freezing");else{if(r){if(4===e.type&&(i=e),2!==e.type||!i||5242880<Di(JSON.stringify([i,e])))return;n.push(i),r=!1}n.push(e)}}),r&&(this._awaitingBaseline=!0,this._recoveryMeta=i,this._baselineDelivered=!1),(e=this.splitEventsIntoChunks(n,3145728,5242880)).forEach(function(e){0!==e.length&&o._pendingSegments.push({segmentId:o.sessionManager.incrementSegmentId(),sessionId:t.id,replayId:t.replayId,replayStarted:t.started,events:e,byteLength:Di(JSON.stringify(e)),status:"pending"})}),!this._awaitingBaseline&&n.some(function(e){e=e.type;return 2===e||4===e})&&(this._baselineDelivered=!0),this.enforceReplayBudget(),u("Flush","Frozen "+n.length+" events into "+e.length+" segment(s)"))))},buildSegmentPayload:function(e,t){return{project_key:String(e.config.id||""),session_id:t.sessionId,replay_id:t.replayId,segment_id:t.segmentId,timestamp:Date.now(),replay_start_timestamp:t.replayStarted,replay_format:"rrweb",platform:"web",events_encoding:"plain_json",events:JSON.stringify(t.events)}},measureSegment:function(e){return this.uploader&&"function"==typeof this.uploader.measurePayload?this.uploader.measurePayload(e):Di(JSON.stringify(e))},enqueueDrain:function(t){var e,n=this;return this._drainRequested=!0,this._drainPromise||(e=Promise.resolve().then(function(){return D(n,void 0,void 0,function(){return L(this,function(e){switch(e.label){case 0:return this._drainRequested=!1,[4,this.drainPendingUploads(t)];case 1:e.sent(),e.label=2;case 2:if(this._drainRequested&&this.canReportReplay(t))return[3,0];e.label=3;case 3:return[2]}})})}).finally(function(){n._drainPromise===e&&(n._drainPromise=null)}),this._drainPromise=e,this._flushTail=e)},drainPendingUploads:function(i){return D(this,void 0,void 0,function(){var t,r,n;return L(this,function(e){switch(e.label){case 0:t=function(){var t,n;return L(this,function(e){switch(e.label){case 0:return(t=r._pendingSegments.find(function(e){return"pending"===e.status}))?(t.status="sending",[4,r.uploader.uploadReplayResult(r.buildSegmentPayload(i,t))]):[2,{value:void 0}];case 1:if(n=e.sent(),!r._pendingSegments.includes(t))return[2,"continue"];if("success"===n.status)r._pendingSegments=r._pendingSegments.filter(function(e){return e!==t}),null!=(e=r.sessionManager)&&e.saveSession();else{if("busy"===n.status)return t.status="pending",[2,{value:void 0}];Ti("Flush","Segment "+t.segmentId+" terminated ("+n.status+", attempts="+n.attempts+")"),r.compactReplayQueue([],t),r.freezeActiveBuffer(!0)}return[2]}})},r=this,e.label=1;case 1:return this.canReportReplay(i)?[5,t()]:[3,3];case 2:return"object"==typeof(n=e.sent())?[2,n.value]:[3,1];case 3:return[2]}})})},flushReplayData:function(e,t,n){var r,i;return void 0===n&&(n=!1),this.canReportReplay(e)?this.sessionManager.shouldRefreshSession()?(u("Plugin","Session expired, refreshing"),this.stopReplay(),r=this.sessionManager.refreshSession(),e.lifeCycle.emit("sessionRefreshed"),i=e._replaySampled,r.sampled&&!1!==i&&this.startReplay(e,t,r.sampled),Promise.resolve()):(this.freezeActiveBuffer(n),this.enqueueDrain(e)):Promise.resolve()},handoffReplay:function(r,e){var i,o,s,a,l=this;this.canReportReplay(r)&&(this.freezeActiveBuffer(!0),s=o=i=0,a=[],this._pendingSegments.forEach(function(e){var t=l.buildSegmentPayload(r,e),n=l.measureSegment(t);!(n<=0||61440<n)&&i+n<=65536?!0===l.uploader.sendBeacon(t)?(i+=n,o+=1):(s+=1,Ti("Unload","sendBeacon rejected chunk (segment_id="+e.segmentId+"), kept for retry"),a.push(e)):a.push(e)}),this._pendingSegments=a,u("SessionReplay","sendBeacon on hide: "+o+" queued, "+s+" rejected, "+a.length+" pending"),e)&&0<a.length&&this.enqueueDrain(r)},splitEventsIntoChunks:function(e,t,n){if(void 0===t&&(t=3145728),void 0===n&&(n=5242880),0===e.length)return[];var r=Di(JSON.stringify(e));if(r<=Math.min(t,n))return[e];Ti("Split","Events size "+Math.round(r/1024)+"KB exceeds limit "+Math.round(t/1024)+"KB, splitting");for(var i=[],o=[],s=2,a=0,l=e;a<l.length;a++){var u,c,d=l[a],f=Di(JSON.stringify(d))+1;0<o.length&&t<s+f&&(i.push(o),o=[],s=2),n<f+1?((c=2===(u=d.type)||4===u)?Oi:Ti)("Split","Single event too large ("+Math.round(f/1024)+"KB), type="+u+(c?" (baseline snapshot, replay may become unplayable)":"")+", skipping"):(o.push(d),s+=f)}return 0<o.length&&i.push(o),i},stopReplay:function(){this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=null),this.recorderManager&&this.recorderManager.stopRecording(),this.clickDetector&&this.clickDetector.stop(),u("Plugin","Recording stopped")},listenForErrors:function(t,n){var r=this;t.lifeCycle.on("errorOccurred",function(e){(Array.isArray(e)?e:[e]).forEach(function(e){e&&r.handleError(e,t,n)})}),t.lifeCycle.on("tdemEventCreated",function(e){(Array.isArray(e)?e:[e]).forEach(function(e){r.isErrorTDEMEvent(e)&&r.handleError(e,t,n)})})},isErrorTDEMEvent:function(e){return!!e&&("error"===String(e.event_category||"").toLowerCase()||(e=String(e.event_type||"").toLowerCase(),["js_error","promise_error","resource_error","api_error"].includes(e)))},handleError:function(e,t,n){this.samplerManager&&(this.samplerManager.isBufferMode()&&this.samplerManager.onErrorOccurred(e)&&(u("Plugin","Converting to session mode due to error"),this.flushReplayData(t,n,!0),this.startFlushTimer(t,n)),this.addCustomEvent({category:"error",message:(null==e?void 0:e.msg)||(null==e?void 0:e.message)||"Unknown error",data:{type:(null==e?void 0:e.type)||"error",stack:null==e?void 0:e.stack}},t))},listenForPerformance:function(n){var r=this;if(n.lifeCycle.on("afterReportWebVitals",function(e){r.handlePerformanceEvent("webVitals",e,n)}),n.lifeCycle.on("afterReportPagePerformance",function(e){r.handlePerformanceEvent("pageLoad",e,n)}),"undefined"!=typeof PerformanceObserver)try{var e=new PerformanceObserver(function(e){var t,e=e.getEntries(),e=e[e.length-1];e&&r.addCustomEvent({category:"performance.lcp",message:"LCP: "+Math.round(e.startTime)+"ms",data:{value:e.startTime,element:(null==(t=e.element)?void 0:t.tagName)||"unknown",size:e.size}},n)}),t=(e.observe({type:"largest-contentful-paint",buffered:!0}),new PerformanceObserver(function(e){e.getEntries().forEach(function(e){"first-contentful-paint"===e.name&&r.addCustomEvent({category:"performance.fcp",message:"FCP: "+Math.round(e.startTime)+"ms",data:{value:e.startTime}},n)})})),i=(t.observe({type:"paint",buffered:!0}),new PerformanceObserver(function(e){e.getEntries().forEach(function(e){100<e.duration&&r.addCustomEvent({category:"performance.longTask",message:"Long Task: "+Math.round(e.duration)+"ms",data:{duration:e.duration,startTime:e.startTime}},n)})}));i.observe({type:"longtask",buffered:!0}),n.lifeCycle.on("destroy",function(){e.disconnect(),t.disconnect(),i.disconnect()})}catch(n){}},handlePerformanceEvent:function(e,n,r){var i=this;n&&("webVitals"===e?["LCP","FCP","FID","CLS","TTFB","TTI","INP"].forEach(function(e){var t=n[e];void 0!==t&&-1!==t&&0<t&&i.addCustomEvent({category:"performance."+e.toLowerCase(),message:e+": "+("number"==typeof t?Math.round(t):t)+("CLS"===e?"":"ms"),data:{metric:e,value:t}},r)}):"pageLoad"===e&&this.addCustomEvent({category:"performance.pageLoad",message:"Page Load: "+(n.firstScreenTiming?Math.round(n.firstScreenTiming):"N/A")+"ms",data:{dnsLookup:n.dnsLookup,tcp:n.tcp,ssl:n.ssl,ttfb:n.ttfb,contentDownload:n.contentDownload,domParse:n.domParse,resourceDownload:n.resourceDownload,firstScreenTiming:n.firstScreenTiming}},r))},listenForLifecycle:function(o,t){var n,e,s=this;"undefined"!=typeof document&&(n=function(e){var t,n=null==(n=s.sessionManager)?void 0:n.getSession(),n=(null==n?void 0:n.replayId)||"",r=(null==(r=null==(i=o)?void 0:i.getOriginFrom)?void 0:r.call(i))||("undefined"!=typeof location?location.href:""),i="undefined"!=typeof document&&document.title||"";null!=(t=o.reportTDEMEvent)&&t.call(o,{event_id:A(),event_type:e,event_category:I.BEHAVIOR,timestamp:Date.now(),page_url:r,data:{page_title:i,replay_id:n,is_effective_action:!1,tags:{environment:o.config.env||"production",version:String(o.config.version||"")},event_properties:{visibility_state:"undefined"!=typeof document?document.visibilityState:"",lifecycle_type:e}}})},document.addEventListener("visibilitychange",e=function(){var e;if("undefined"!=typeof document){if("hidden"===document.visibilityState)return n(M.TAB_HIDDEN),s.shouldSkipBufferFlush()?void u("Lifecycle","Buffer mode (error traceback), skip flush on hidden"):void s.handoffReplay(o,!0);"visible"===document.visibilityState&&(n(M.TAB_VISIBLE),(e=Date.now())-s._lastLifecycleSnapshotAt<5e3||(s._lastLifecycleSnapshotAt=e,null!=(e=s.recorderManager)&&e.takeFullSnapshot(),s.shouldSkipBufferFlush()?u("Lifecycle","Buffer mode (error traceback), skip flush on visible"):s.flushReplayData(o,t,!0)))}}),o.lifeCycle.on("destroy",function(){document.removeEventListener("visibilitychange",e)}))},listenForUnload:function(t){function e(e){r.flushOnUnload(t,e)}function n(e){r.resumeAfterRestore(e)}var r=this;window.addEventListener("pagehide",e),window.addEventListener("pageshow",n),t.lifeCycle.on("destroy",function(){window.removeEventListener("pagehide",e),window.removeEventListener("pageshow",n)})},resumeAfterRestore:function(e){null!=e&&e.persisted&&!this.shouldSkipBufferFlush()&&(this.recorderManager&&!this.recorderManager.isRecording()&&this.recorderManager.startRecording(),null!=(e=this.clickDetector))&&e.start()},flushOnUnload:function(e,t){this.canReportReplay(e)?(null!=t&&t.persisted||(null!=(t=this.recorderManager)&&t.stopRecording(),null==(t=this.clickDetector))||t.stop(),this.handoffReplay(e,!1)):this.shouldSkipBufferFlush()&&u("Unload","Buffer mode (error traceback), skip flush on unload")},destroy:function(){var e;if(this.option)return this.option.destroy.call(this.option);this.stopReplay(),null!=(e=this.removeClickVisitListener)&&e.call(this),this.removeClickVisitListener=null,this.sessionManager&&this.sessionManager.saveSession(),this.sessionManager=null,this.eventBuffer&&this.eventBuffer.destroy(),this.eventBuffer=null,this.recorderManager=null,this.samplerManager=null,this.uploader=null,this.clickDetector=null,this.replayConfig=null,this._tdemRef=null,this._isCheckoutFlushing=!1,this._lastLifecycleSnapshotAt=0,this._pendingSegments=[],this._baselineDelivered=!1,this._baselineFlushScheduled=!1,this._flushTail=Promise.resolve(),this._drainPromise=null,this._drainRequested=!1,this._awaitingBaseline=!1,this._recoveryMeta=null,this.isInitialized=!1,u("Plugin","destroyed")}}),Xp={enabled:!0,ruleVersion:"1.0.0",payloadAllowlist:[],click:{enabled:!0,deadClickWindowMs:3e3,deadClickDebounceIntervalMs:1e3,rageClickWindowMs:3e3,rageClickCount:5,errorClickWindowMs:3e3,resolveOnDomMutation:!0,resolveOnSpaNavigation:!0,resolveOnExternalNavigation:!0,resolveOnWindowOpen:!0,resolveOnPageUnload:!0,resolveOnFormAction:!0,resolveOnApiSuccess:!0,ignoreDeadClickSelectors:[],effectiveActionSelectors:[],clickableSelectors:[]},performance:{enabled:!0,slowPageLcpThreshold:4e3,slowPageInpThreshold:500},form:{enabled:!0,fieldIdAttr:"data-field-id",formIdAttr:"data-form-id",longFocusThresholdMs:2e4,incompleteMinFieldRatio:.3,zigzagMinCount:2},navigation:{enabled:!0,backForwardAsStruggle:!0},custom:{enabled:!0,detector:void 0}},Yp=new Set([M.JS_ERROR,M.PROMISE_ERROR,M.RESOURCE_ERROR,M.API_ERROR]),Qp=new Set([M.FORM_CHANGE,M.FORM_SUBMIT,M.FORM_SUBMIT_RESULT]),em=(new e({name:"struggleMonitor"}),new e({name:"struggleMonitor",instanceStates:new Map,originalWindowOpen:null,windowOpenHooked:!1,onNewTdem:function(n){var e,t,r,i,o,s,a=this,l=!0===(e=this.$getConfig(n))?x({},Xp):e&&"object"==typeof e?(t=(void 0===(l=null==(l=e.click)?void 0:l.deadClickDebounceIntervalMs)||Number.isInteger(l)&&1<=l&&l<=6e4)&&null!=l?l:1e3,void 0!==l&&l!==t&&console.warn("struggleMonitor: invalid deadClickDebounceIntervalMs; using 1000ms"),x(x(x({},Xp),e),{click:x(x(x({},Xp.click),e.click||{}),{deadClickDebounceIntervalMs:t}),performance:x(x({},Xp.performance),e.performance||{}),form:x(x({},Xp.form),e.form||{}),navigation:x(x({},Xp.navigation),e.navigation||{}),custom:x(x({},Xp.custom),e.custom||{}),payloadAllowlist:(Array.isArray(e.payloadAllowlist)?e:Xp).payloadAllowlist,enabled:!1!==e.enabled})):x(x({},Xp),{enabled:!1});l.enabled&&(r={config:l,clickDetector:null,recentClicks:[],pendingDeadClicks:new Map,latestDead:new Map,clickContexts:new WeakMap,contextKey:this.getClickContextKey(n),closing:!1,focusStartMap:new Map,formStateMap:new Map,removeDomListeners:[],onEventCreated:null,onDestroy:null},this.instanceStates.set(n,r),this.initClickDetector(n,r),this.initFormListeners(n,r),r.onEventCreated=function(e){a.handleEventCreated(n,r,e||[])},n.lifeCycle.on("tdemEventCreated",r.onEventCreated),r.onDestroy=function(){return a.cleanupInstance(n)},n.lifeCycle.on("destroy",r.onDestroy),n.lifeCycle.on("clickCaptured",i=function(e){var t=e.event,n=e.source,e=r.clickContexts.get(t);e&&(e.sourceContext.replayId=String(n.data.replay_id||"")),r.pendingDeadClicks.forEach(function(e){e.event===t&&(e.clickEventId=n.event_id,e.ownerKey=n.data.target_element||e.ownerKey)})}),r.removeDomListeners.push(function(){return n.lifeCycle.remove("clickCaptured",i)}),n.lifeCycle.on("pageChanged",o=function(){return a.closeClickGroups(r)}),r.removeDomListeners.push(function(){return n.lifeCycle.remove("pageChanged",o)}),n.lifeCycle.on("pageVisitChanged",o),r.removeDomListeners.push(function(){return n.lifeCycle.remove("pageVisitChanged",o)}),n.lifeCycle.on("beforeCloseFlush",o),r.removeDomListeners.push(function(){return n.lifeCycle.remove("beforeCloseFlush",o)}),r.removeDomListeners.push("undefined"==typeof window?function(){}:(window.addEventListener("monitor-session-update",s=function(e){var t=e.detail.sessionId;e.detail.source,t!==r.contextKey.split("\n")[0]&&(r.contextKey=a.getClickContextKey(n),a.closeClickGroups(r,!0))}),function(){return window.removeEventListener("monitor-session-update",s)})))},initClickDetector:function(t,n){var e,r=this;"undefined"!=typeof window&&"undefined"!=typeof document&&(n.clickDetector=new Tp({getClickContext:function(){return r.getClickContextKey(t)},slowClickTimeout:null!=(e=null==(e=n.config.click)?void 0:e.deadClickWindowMs)?e:3e3,slowClickThreshold:null!=(e=null==(e=n.config.click)?void 0:e.deadClickWindowMs)?e:3e3,rageClickCount:null!=(e=null==(e=n.config.click)?void 0:e.rageClickCount)?e:5,rageClickWindow:null!=(e=null==(e=n.config.click)?void 0:e.rageClickWindowMs)?e:3e3,onRageClick:function(e){r.onRageClick(t,n,e)},onClickStart:function(e){r.onClickStart(t,n,e)},onEffectiveAction:function(e){r.onEffectiveAction(t,n,e)},onSlowClick:function(e){r.onSlowClick(t,n,e)}}),n.clickDetector.start(),this.initClickEffectiveActionListeners(n),this.initWindowOpenHook())},initClickEffectiveActionListeners:function(n){var e,t,r=this;"undefined"!=typeof window&&((e=function(e,t){window.addEventListener(e,t),n.removeDomListeners.push(function(){window.removeEventListener(e,t)})})("pagehide",function(){var e;r.closeClickGroups(n),!1!==(null==(e=n.config.click)?void 0:e.resolveOnPageUnload)&&(r.resolvePendingDeadClicks(n,"page_unload"),null!=(e=n.clickDetector))&&e.markEffectiveAction("page_unload")}),e("beforeunload",function(){var e;r.closeClickGroups(n),!1!==(null==(e=n.config.click)?void 0:e.resolveOnPageUnload)&&(r.resolvePendingDeadClicks(n,"page_unload"),null!=(e=n.clickDetector))&&e.markEffectiveAction("page_unload")}),t=function(){"hidden"===document.visibilityState&&r.closeClickGroups(n)},document.addEventListener("visibilitychange",t),n.removeDomListeners.push(function(){return document.removeEventListener("visibilitychange",t)}))},initWindowOpenHook:function(){var r,i;"undefined"==typeof window||this.windowOpenHooked||(r=window.open,this.originalWindowOpen=r,this.windowOpenHooked=!0,i=this,window.open=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=r.apply(window,e);return i.resolveWindowOpenActions(),n})},resolveWindowOpenActions:function(){var r=this,i=Date.now();this.instanceStates.forEach(function(e,t){var n;!1!==(null==(n=e.config.click)?void 0:n.resolveOnWindowOpen)&&(null!=(n=e.clickDetector)&&n.markEffectiveAction("window_open"),r.resolvePendingDeadClicks(e,"window_open",i,t._customPageUrl||r.getCurrentPageUrl()))})},restoreWindowOpenHook:function(){"undefined"!=typeof window&&this.windowOpenHooked&&this.originalWindowOpen&&(window.open=this.originalWindowOpen,this.originalWindowOpen=null,this.windowOpenHooked=!1)},initFormListeners:function(r,i){var e,t,o=this;null!=(t=i.config.form)&&t.enabled&&"undefined"!=typeof document&&((t=function(e,t,n){void 0===n&&(n=!0),document.addEventListener(e,t,n),i.removeDomListeners.push(function(){document.removeEventListener(e,t,n)})})("focusin",function(e){e=o.getTrackableField(e.target);e&&o.reportFormEvent(r,i,M.FORM_FOCUS,e,e.form||void 0)}),t("focusout",function(e){e=o.getTrackableField(e.target);e&&o.reportFormEvent(r,i,M.FORM_BLUR,e,e.form||void 0)}),t("change",function(e){e=o.getTrackableField(e.target);e&&o.reportFormEvent(r,i,M.FORM_CHANGE,e,e.form||void 0)}),t("submit",function(e){e=e.target;e instanceof HTMLFormElement&&o.reportFormEvent(r,i,M.FORM_SUBMIT,null,e)}),t("invalid",function(e){var t,n,e=o.getTrackableField(e.target);e&&(n=e.form||void 0,n=o.buildFormBaseData(r,i,e,n),n={event_id:A(),event_type:M.FORM_SUBMIT_RESULT,event_category:I.BEHAVIOR,timestamp:Date.now(),page_url:"undefined"!=typeof window?window.location.href:(null==(t=r.getOriginFrom)?void 0:t.call(r))||"",data:x(x({},n),{event_name:"form_submit_fail",is_effective_action:!0,validation_message:e.validationMessage||void 0,event_properties:x(x({},n.event_properties||{}),{status:"fail",validation_code:!1===(null==(t=e.validity)?void 0:t.valid)?"invalid":"validation_error"})})},null!=(e=r.reportTDEMEvent))&&e.call(r,n)}),e=function(){o.reportPendingUncompletedForms(r,i,"pagehide")},"undefined"!=typeof window)&&(window.addEventListener("pagehide",e),i.removeDomListeners.push(function(){window.removeEventListener("pagehide",e)}))},getTrackableField:function(e){return!(e&&e instanceof Element)||!(e=e.closest("input, textarea, select"))||e instanceof HTMLInputElement&&["button","submit","reset","image","hidden"].includes(e.type)?null:e},buildFormBaseData:function(e,t,n,r){var n=n||null,r=r||(null==n?void 0:n.form)||void 0,i=(null==(i=t.config.form)?void 0:i.fieldIdAttr)||"data-field-id",t=(null==(t=t.config.form)?void 0:t.formIdAttr)||"data-form-id",i=n?n.getAttribute(i)||n.id||n.name||n.tagName.toLowerCase()+"_"+(n.type||"field"):void 0,t=r&&(r.getAttribute(t)||r.id||r.getAttribute("name")||r.getAttribute("action"))||void 0,o="string"==typeof(null==(o=n)?void 0:o.value)?n.value.length:0,o=0===o?"0":o<=10?"1_10":o<=50?"11_50":"51_plus";return{replay_id:P(e),is_effective_action:!0,form_id:t,field_id:i,tags:{},event_properties:{field_name:(null==n?void 0:n.name)||"",field_type:(null==n?void 0:n.type)||(null==(e=null==n?void 0:n.tagName)?void 0:e.toLowerCase())||"",form_name:(null==r?void 0:r.getAttribute("name"))||"",is_required:String(!(null==n||!n.required)),value_length_bucket:String(o)}}},reportFormEvent:function(e,t,n,r,i){var t=this.buildFormBaseData(e,t,r,i),i="undefined"!=typeof window?window.location.href:(null==(r=e.getOriginFrom)?void 0:r.call(e))||"",r={event_id:A(),timestamp:Date.now(),page_url:i};n!==M.FORM_FOCUS?n!==M.FORM_BLUR?n!==M.FORM_CHANGE?(i=x(x({},r),{event_type:M.FORM_SUBMIT,event_category:I.BEHAVIOR,data:x(x({},t),{submit_method:"native_submit"})}),null!=(n=e.reportTDEMEvent)&&n.call(e,i)):(n=x(x({},r),{event_type:M.FORM_CHANGE,event_category:I.BEHAVIOR,data:t}),null!=(i=e.reportTDEMEvent)&&i.call(e,n)):(i=x(x({},r),{event_type:M.FORM_BLUR,event_category:I.BEHAVIOR,data:t}),null!=(n=e.reportTDEMEvent)&&n.call(e,i)):(n=x(x({},r),{event_type:M.FORM_FOCUS,event_category:I.BEHAVIOR,data:t}),null!=(i=e.reportTDEMEvent)&&i.call(e,n))},onClickStart:function(e,t,n){var r,i,o,s,a=t.config.click||Xp.click;!1!==a.enabled&&(this.checkClickContext(e,t),r=Nn(n.event,e),i={timestamp:n.timestamp,sessionId:Xe(e),viewId:String(null!=(i=null!=(i=null!=(i=null==r?void 0:r.view_id)?i:e.viewId)?i:null==(i=e.bean)?void 0:i.viewId)?i:""),replayId:String(null!=(i=null==(i=null==r?void 0:r.data)?void 0:i.replay_id)?i:P(e))},o=e._customPageUrl||(null==r?void 0:r.page_url)||this.getCurrentPageUrl(),t.clickContexts.set(n.event,{pageUrl:o,sourceContext:i}),s=(null==(s=null==r?void 0:r.data)?void 0:s.target_element)||n.node.selector||n.node.tagName||"unknown",this.isDeadClickExempt(n,a)||this.shouldIgnoreDeadClick(n.target,a)||"custom"!==n.effectiveActionReason&&(n.effectiveActionReason&&this.shouldResolveByReason(t,n.effectiveActionReason)?this.resolvePendingDeadClicks(t,n.effectiveActionReason,n.timestamp,o):this.scheduleDeadClick(e,t,{pendingId:"pending_"+n.timestamp+"_"+Math.random().toString(16).slice(2),timestamp:n.timestamp,pageUrl:o,ownerKey:s,node:n.node,target:n.target,event:n.event,groupKey:t.contextKey,debounceIntervalMs:null!=(e=a.deadClickDebounceIntervalMs)?e:1e3,sourceContext:i,clickEventId:null==r?void 0:r.event_id})))},onEffectiveAction:function(e,t,n){this.checkClickContext(e,t),this.shouldResolveByReason(t,n.reason)&&(e=e._customPageUrl||this.getCurrentPageUrl(),this.resolvePendingDeadClicks(t,n.reason,n.timestamp,e))},scheduleDeadClick:function(t,n,r){var i=this,o=null!=(e=null==(e=n.config.click)?void 0:e.deadClickWindowMs)?e:3e3,e=n.latestDead.get(r.target),e=(e&&e.groupKey===r.groupKey&&r.timestamp>=e.timestamp&&r.timestamp-e.timestamp<e.debounceIntervalMs&&(r.debounceIntervalMs=e.debounceIntervalMs,this.removeDeadClick(n,e)),setTimeout(function(){i.checkClickContext(t,n);var e=n.pendingDeadClicks.get(r.pendingId);e&&(i.removeDeadClick(n,e),i.emitDeadClick(t,n,e,o))},Math.max(o,r.debounceIntervalMs))),e=x(x({},r),{timeout:e});n.pendingDeadClicks.set(r.pendingId,e),n.latestDead.set(r.target,e),200<n.pendingDeadClicks.size&&(e=n.pendingDeadClicks.values().next().value)&&this.removeDeadClick(n,e)},removeDeadClick:function(e,t){clearTimeout(t.timeout),e.pendingDeadClicks.delete(t.pendingId),e.latestDead.get(t.target)===t&&e.latestDead.delete(t.target)},getClickContextKey:function(e){var t;return[Xe(e),e._customPageUrl||this.getCurrentPageUrl(),null!=(e=null!=(t=e.viewId)?t:null==(t=e.bean)?void 0:t.viewId)?e:""].join("\n")},checkClickContext:function(e,t){var n,e=this.getClickContextKey(e);e!==t.contextKey&&(n=e.split("\n")[0]!==t.contextKey.split("\n")[0],t.contextKey=e,this.closeClickGroups(t,n))},closeClickGroups:function(t,e){var n,r=this;void 0===e&&(e=!1),null!=(n=t.clickDetector)&&n.finishRage(),t.latestDead.clear(),e&&(t.pendingDeadClicks.forEach(function(e){return r.removeDeadClick(t,e)}),t.recentClicks=[])},emitDeadClick:function(e,t,n,r){var i,o=n.clickEventId?[n.clickEventId]:void 0;null!=(i=e.reportStruggle)&&i.call(e,{type:"dead_click",ownerType:"element",ownerKey:n.ownerKey,pageUrl:n.pageUrl,sourceContext:x(x({},n.sourceContext),{timestamp:n.timestamp+r}),triggerEventId:n.clickEventId,relatedEventIds:o,detectionSource:"rule_engine",ruleVersion:t.config.ruleVersion,payloadAllowlist:t.config.payloadAllowlist,payload:{timeout_ms:r,selector:n.node.selector||""}})},resolvePendingDeadClicks:function(n,r,i,o){var e,s=this,a=(void 0===i&&(i=Date.now()),null!=(e=null==(e=n.config.click)?void 0:e.deadClickWindowMs)?e:3e3);n.pendingDeadClicks.forEach(function(e){var t=i-e.timestamp;t<0||a<t||"spa_navigation"!==r&&"page_unload"!==r&&o&&e.pageUrl&&o!==e.pageUrl||s.removeDeadClick(n,e)})},shouldResolveByReason:function(e,t){e=e.config.click||Xp.click;return!1!==e.enabled&&("dom_mutation"===t?!1!==e.resolveOnDomMutation:"spa_navigation"===t?!1!==e.resolveOnSpaNavigation:"external_navigation"===t||"download"===t?!1!==e.resolveOnExternalNavigation:"window_open"===t?!1!==e.resolveOnWindowOpen:"page_unload"===t?!1!==e.resolveOnPageUnload:"form_change"===t||"form_submit"===t?!1!==e.resolveOnFormAction:"api_success"!==t||!1!==e.resolveOnApiSuccess)},isDeadClickExempt:function(e,t){var e=e.event.target,t=Array.isArray(t.clickableSelectors)?t.clickableSelectors:[];return!(e instanceof Element&&((e,t)=>{if(void 0===t&&(t=[]),e.closest(Pn))return 1;for(var n=0;n<t.length;n++)try{if(t[n]&&e.closest(t[n]))return 1}catch(e){}try{return"pointer"===window.getComputedStyle(e).cursor}catch(e){}})(e,t)&&(!(t=e.closest("[contenteditable]"))||"false"===t.getAttribute("contenteditable"))&&!e.closest('input:not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]),textarea,select,option,label'))},shouldIgnoreDeadClick:function(t,e){return g(e.ignoreDeadClickSelectors||[],e.effectiveActionSelectors||[]).some(function(e){try{return!!e&&!!t.closest(e)}catch(e){return!1}})},getCurrentPageUrl:function(){return"undefined"==typeof window?"":window.location.href},getEventPageUrl:function(e){return(null==e?void 0:e.page_url)||(null==(e=null==e?void 0:e.data)?void 0:e.page_url)||""},onRageClick:function(t,e,n){var r,i,o,s;!1!==e.config.click.enabled&&(r=n.node.selector||n.node.tagName||"unknown",i=e.clickContexts.get(n.clicks[0].event))&&(o=(s=n.clicks.map(function(e){return Nn(e.event,t)})).map(function(e){return null==e?void 0:e.event_id}).filter(Boolean).slice(-10),s={type:"rage_click",ownerType:"element",ownerKey:(null==(s=null==(s=s[0])?void 0:s.data)?void 0:s.target_element)||r,pageUrl:i.pageUrl,sourceContext:x(x({},i.sourceContext),{timestamp:n.lastTimestamp}),triggerEventId:o[0],relatedEventIds:o.length?o:void 0,detectionSource:"rule_engine",ruleVersion:e.config.ruleVersion,payloadAllowlist:e.config.payloadAllowlist,payload:{clickCount:n.clickCount,timeWindowMs:n.timeWindowMs,click_count:n.clickCount,time_window_ms:n.timeWindowMs,selector:n.node.selector||""}},null!=(r=t.reportStruggle))&&r.call(t,s)},onSlowClick:function(e,t,n){},handleEventCreated:function(i,o,e){var t,s=this,a=(this.checkClickContext(i,o),Date.now()),n=o.config.click||Xp.click,r=Math.max(null!=(t=n.errorClickWindowMs)?t:3e3,null!=(t=n.rageClickWindowMs)?t:3e3,null!=(t=n.deadClickWindowMs)?t:3e3);o.recentClicks=o.recentClicks.filter(function(e){return a-e.timestamp<=r}),e.forEach(function(e){var t,n,r;e&&e.event_type!==M.STRUGGLE&&(t=e.timestamp||a,n=s.getEventPageUrl(e),e.event_type===M.CLICK?(r=(null==(r=e.data)?void 0:r.target_element)||(null==(r=e.data)?void 0:r.target_id)||(null==(r=e.data)?void 0:r.target_class)||"unknown",o.recentClicks.push({eventId:e.event_id,timestamp:t,pageUrl:n,ownerKey:r}),o.recentClicks=o.recentClicks.slice(-200)):(e.event_type===M.PAGE_VIEW&&s.closeClickGroups(o),s.isEffectiveActionEvent(o,e)&&(s.resolvePendingDeadClicks(o,s.getEffectiveActionReason(e),t,n),null!=(r=o.clickDetector)&&r.markEffectiveAction(s.getEffectiveActionReason(e))),Yp.has(e.event_type)?s.tryReportErrorClick(i,o,e):e.event_type===M.PAGE_LOAD||e.event_type===M.true?s.tryReportSlowPage(i,o,e):e.event_type===M.FORM_FOCUS?(s.trackFormFocus(o,e),s.trackFormChangeAndZigzag(i,o,e)):e.event_type===M.FORM_CHANGE?s.trackFormChangeAndZigzag(i,o,e):e.event_type===M.FORM_BLUR?s.tryReportLongFocusTime(i,o,e):e.event_type===M.FORM_SUBMIT?s.trackFormSubmitResult(o,e):e.event_type===M.FORM_SUBMIT_RESULT?(s.trackFormSubmitResult(o,e),s.tryReportFormValidationError(i,o,e)):e.event_type===M.PAGE_VIEW&&null!=(n=null==(t=e.data)?void 0:t.event_properties)&&n.navigation_type&&s.tryReportBackForward(i,o,e)),s.tryReportCustomStruggle(i,o,e))})},isEffectiveActionEvent:function(e,t){var n;return!1!==(null==(n=e.config.click)?void 0:n.enabled)&&(t.event_type===M.API_CALL?!1!==(null==(n=e.config.click)?void 0:n.resolveOnApiSuccess):t.event_type===M.PAGE_VIEW&&null!=(n=null==(n=t.data)?void 0:n.event_properties)&&n.navigation_type?!1!==(null==(n=e.config.click)?void 0:n.resolveOnSpaNavigation):Qp.has(t.event_type)?!1!==(null==(n=e.config.click)?void 0:n.resolveOnFormAction):!0===(null==(e=t.data)?void 0:e.is_effective_action))},getEffectiveActionReason:function(e){return e.event_type===M.API_CALL?"api_success":e.event_type===M.PAGE_VIEW?"spa_navigation":e.event_type===M.FORM_CHANGE?"form_change":e.event_type===M.FORM_SUBMIT||e.event_type===M.FORM_SUBMIT_RESULT?"form_submit":"custom"},getFormStateKey:function(e,t){return e||t||"unknown_form"},ensureFormState:function(e,t,n){var r=this.getFormStateKey(t,n);return e.formStateMap.has(r)||e.formStateMap.set(r,{formId:t||r,pageUrl:n||"",touchedFieldIds:new Set,requiredFieldIds:new Set,changedFieldIds:new Set,focusPath:[],zigzagHits:0,hasSuccessSubmit:!1,reportedZigzag:!1,reportedUncompleted:!1}),e.formStateMap.get(r)},recordFormTouch:function(e,t){var n,e=this.ensureFormState(e,null==(e=null==t?void 0:t.data)?void 0:e.form_id,null==t?void 0:t.page_url),r=String((null==(r=null==t?void 0:t.data)?void 0:r.field_id)||"");return r&&(e.touchedFieldIds.add(r),!0===(null==(n=t.data)?void 0:n.is_required)&&e.requiredFieldIds.add(r),t.event_type===M.FORM_CHANGE)&&e.changedFieldIds.add(r),null!=t&&t.page_url&&(e.pageUrl=t.page_url),e},trackFormFocus:function(e,t){var n,r=t,i=String((null==(i=null==r?void 0:r.data)?void 0:i.field_id)||"");i&&((n=this.recordFormTouch(e,r)).focusPath.push(i),12<n.focusPath.length&&n.focusPath.shift(),e.focusStartMap.set(i,{timestamp:t.timestamp||Date.now(),eventId:t.event_id,formId:null==(n=null==r?void 0:r.data)?void 0:n.form_id,pageUrl:null==r?void 0:r.page_url}))},trackFormChangeAndZigzag:function(e,t,n){var r,i,o,s,a;n.event_type!==M.FORM_CHANGE?n.event_type!==M.FORM_FOCUS||(a=(i=this.recordFormTouch(t,r=n)).focusPath).length<4||i.reportedZigzag||(o=(a=a.slice(-4))[0],s=a[1],!o)||!s||o===s||o!==a[2]||s!==a[3]||i.changedFieldIds.size<2||(i.zigzagHits+=1,a=null!=(s=null==(o=t.config.form)?void 0:o.zigzagMinCount)?s:2,i.zigzagHits<a)||(i.reportedZigzag=!0,null==(o=e.reportStruggle))||o.call(e,{type:"form_zigzag",ownerType:"form",ownerKey:i.formId,pageUrl:i.pageUrl,formId:i.formId,fieldId:String((null==(s=null==r?void 0:r.data)?void 0:s.field_id)||""),triggerEventId:r.event_id,relatedEventIds:[r.event_id],detectionSource:"rule_engine",ruleVersion:t.config.ruleVersion,payloadAllowlist:t.config.payloadAllowlist,payload:{zigzag_hits:i.zigzagHits,changed_field_count:i.changedFieldIds.size}}):this.recordFormTouch(t,n)},trackFormSubmitResult:function(e,t){t.event_type!==M.FORM_SUBMIT&&t.event_type!==M.FORM_SUBMIT_RESULT||((e=this.recordFormTouch(e,t)).lastSubmitEventId=t.event_id,t.event_type===M.FORM_SUBMIT_RESULT&&"success"===(null==(t=null==(t=t.data)?void 0:t.event_properties)?void 0:t.status)&&(e.hasSuccessSubmit=!0))},reportPendingUncompletedForms:function(t,n,r){var i=this;n.formStateMap.forEach(function(e){i.tryReportUncompletedForm(t,n,e,r)})},tryReportUncompletedForm:function(e,t,n,r){var i,o,s,a;n.reportedUncompleted||n.hasSuccessSubmit||0===n.touchedFieldIds.size||(s=0<(o=n.requiredFieldIds.size)?o:n.touchedFieldIds.size)<=0||(s=n.changedFieldIds.size/s)<(a=null!=(a=null==(a=t.config.form)?void 0:a.incompleteMinFieldRatio)?a:.3)||(n.reportedUncompleted=!0,null==(i=e.reportStruggle))||i.call(e,{type:"uncompleted_form",ownerType:"form",ownerKey:n.formId,pageUrl:n.pageUrl,formId:n.formId,triggerEventId:n.lastSubmitEventId,relatedEventIds:n.lastSubmitEventId?[n.lastSubmitEventId]:void 0,detectionSource:"rule_engine",ruleVersion:t.config.ruleVersion,payloadAllowlist:t.config.payloadAllowlist,payload:{touched_field_count:n.touchedFieldIds.size,changed_field_count:n.changedFieldIds.size,required_field_count:o,changed_ratio:Number(s.toFixed(4)),threshold_ratio:a}})},tryReportLongFocusTime:function(e,t,n){var r,i,o,s,a=String((null==(a=null==n?void 0:n.data)?void 0:a.field_id)||"");a&&(i=t.focusStartMap.get(a))&&(t.focusStartMap.delete(a),o=null!=(o=null==(o=t.config.form)?void 0:o.longFocusThresholdMs)?o:2e4,(s=Math.max((n.timestamp||Date.now())-i.timestamp,0))<o||null==(r=e.reportStruggle)||r.call(e,{type:"long_focus_time",ownerType:"field",ownerKey:a,pageUrl:(null==n?void 0:n.page_url)||i.pageUrl,formId:(null==(r=null==n?void 0:n.data)?void 0:r.form_id)||i.formId,fieldId:a,triggerEventId:n.event_id,relatedEventIds:[i.eventId||"",n.event_id].filter(Boolean),detectionSource:"rule_engine",ruleVersion:t.config.ruleVersion,payloadAllowlist:t.config.payloadAllowlist,payload:{focus_duration_ms:s,threshold_ms:o}}))},tryReportErrorClick:function(e,t,n){var r,i,o;t.recentClicks.length&&(i=null!=(o=(t.config.click||Xp.click).errorClickWindowMs)?o:3e3,o=g(t.recentClicks).reverse().find(function(e){return 0<=n.timestamp-e.timestamp&&n.timestamp-e.timestamp<=i}))&&null!=(r=e.reportStruggle)&&r.call(e,{type:"error_click",ownerType:"element",ownerKey:o.ownerKey,pageUrl:o.pageUrl||n.page_url,triggerEventId:o.eventId,relatedEventIds:[n.event_id],detectionSource:"rule_engine",ruleVersion:t.config.ruleVersion,payloadAllowlist:t.config.payloadAllowlist,payload:{errorEventType:n.event_type}})},tryReportSlowPage:function(e,t,n){var r,i,o,s=t.config.performance||Xp.performance;s.enabled&&(i=(null==(i=n.data)?void 0:i.measurements)||{},r=Number(i.lcp||0),i=Number(i.inp||0),o=null!=(o=s.slowPageLcpThreshold)?o:4e3,s=null!=(s=s.slowPageInpThreshold)?s:500,o<=r||s<=i)&&null!=(o=e.reportStruggle)&&o.call(e,{type:"slow_page",ownerType:"page",ownerKey:n.page_url||("undefined"!=typeof window?window.location.href:""),pageUrl:n.page_url,triggerEventId:n.event_id,detectionSource:"rule_engine",ruleVersion:t.config.ruleVersion,payloadAllowlist:t.config.payloadAllowlist,payload:{lcp:r,inp:i,sourceEventType:n.event_type}})},tryReportFormValidationError:function(e,t,n){var r,i,o,s,a=(null==(a=null==n?void 0:n.data)?void 0:a.event_properties)||{},l=(null==n?void 0:n.data)||{};"fail"===String((null==a?void 0:a.status)||(null===(i=l)?void 0:i.status)||"")&&(i=String((null==a?void 0:a.field_id)||(null===(i=l)?void 0:i.field_id)||""),o=String((null==a?void 0:a.form_id)||(null===(o=l)?void 0:o.form_id)||""),s=i||o||(null==n?void 0:n.page_url)||"unknown",null!=(r=e.reportStruggle))&&r.call(e,{type:"form_validation_error",ownerType:i?"field":"form",ownerKey:s,pageUrl:null==n?void 0:n.page_url,formId:o,fieldId:i,triggerEventId:n.event_id,relatedEventIds:[n.event_id],detectionSource:"rule_engine",ruleVersion:t.config.ruleVersion,payloadAllowlist:t.config.payloadAllowlist,payload:{validation_code:(null==a?void 0:a.validation_code)||(null===(r=l)?void 0:r.validation_code),validation_message:null==(e=null==n?void 0:n.data)?void 0:e.validation_message,sourceEventType:n.event_type}})},tryReportBackForward:function(e,t,n){var r,i,o=t.config.navigation||Xp.navigation;o.enabled&&o.backForwardAsStruggle&&(n=null==(n=null==(o=n)?void 0:o.data)?void 0:n.event_properties,"back"!==(i=String((null==n?void 0:n.navigation_type)||""))&&"forward"!==i||null==(r=e.reportStruggle)||r.call(e,{type:"back_forward",ownerType:"page",ownerKey:String((null==n?void 0:n.to_page)||"")||(null==o?void 0:o.page_url)||"unknown",pageUrl:null==o?void 0:o.page_url,triggerEventId:o.event_id,relatedEventIds:[o.event_id],detectionSource:"rule_engine",ruleVersion:t.config.ruleVersion,payloadAllowlist:t.config.payloadAllowlist,payload:{navigation_type:i,from_page:null==n?void 0:n.from_page,to_page:null==n?void 0:n.to_page}}))},tryReportCustomStruggle:function(n,r,i){var e=r.config.custom||Xp.custom;e.enabled&&"function"==typeof e.detector&&(e=e.detector({event:i,tdem:n}),(Array.isArray(e)?e:e?[e]:[]).forEach(function(e){var t,e=x(x({},e),{type:(null==e?void 0:e.type)||"custom_struggle",ownerType:(null==e?void 0:e.ownerType)||"app",ownerKey:(null==e?void 0:e.ownerKey)||i.page_url||"custom",ruleVersion:(null==e?void 0:e.ruleVersion)||r.config.ruleVersion,payloadAllowlist:(null==e?void 0:e.payloadAllowlist)||r.config.payloadAllowlist,detectionSource:(null==e?void 0:e.detectionSource)||"custom"});null!=(t=n.reportStruggle)&&t.call(n,e)}))},cleanupInstance:function(e){var t=this.instanceStates.get(e);t&&!t.closing&&(t.closing=!0,this.closeClickGroups(t,!0),t.onEventCreated&&e.lifeCycle.remove("tdemEventCreated",t.onEventCreated),t.onDestroy&&e.lifeCycle.remove("destroy",t.onDestroy),t.clickDetector&&t.clickDetector.stop(),t.pendingDeadClicks.forEach(function(e){clearTimeout(e.timeout)}),t.pendingDeadClicks.clear(),this.reportPendingUncompletedForms(e,t,"destroy"),t.focusStartMap.clear(),t.formStateMap.clear(),t.removeDomListeners.forEach(function(e){return e()}),t.removeDomListeners=[],this.instanceStates.delete(e),0===this.instanceStates.size)&&this.restoreWindowOpenHook()},destroy:function(){var n=this.option||this;n.instanceStates.forEach(function(e,t){n.cleanupInstance(t)}),n.instanceStates.clear(),n.restoreWindowOpenHook()}})),tm={enabled:!0,threshold:2e3,noResponseThreshold:5e3,sampleRate:1},nm=new Map,rm=new e({name:"lagMonitor",onNewTdem:function(o,e){t=e,void 0===(r=null!=(n=o.config)&&n.debug?function(e,t){"undefined"!=typeof console&&console.warn&&console.warn("[TDEM] "+e+": "+t+", fallback applied")}:function(){})&&(r=function(){});var t,r,n,s=!1===t?x(x({},tm),{enabled:!1}):!0===t||void 0===t?x({},tm):!t||"object"!=typeof t||Array.isArray(t)?(r("lagMonitor","invalid_type"),x({},tm)):(n=x({},tm),void 0!==t.enabled&&("boolean"==typeof t.enabled?n.enabled=t.enabled:r("lagMonitor.enabled","invalid_type")),n.threshold=(i=function(e,t,n){return void 0===e?n:"number"!=typeof e?(r(t,"invalid_type"),n):Number.isFinite(e)?e<=0?(r(t,"out_of_range"),n):e:(r(t,"invalid_number"),n)})(t.threshold,"lagMonitor.threshold",tm.threshold),n.noResponseThreshold=i(t.noResponseThreshold,"lagMonitor.noResponseThreshold",tm.noResponseThreshold),void 0!==t.sampleRate&&("number"!=typeof t.sampleRate?r("lagMonitor.sampleRate","invalid_type"):Number.isFinite(t.sampleRate)?t.sampleRate<0||1<t.sampleRate?r("lagMonitor.sampleRate","out_of_range"):n.sampleRate=t.sampleRate:r("lagMonitor.sampleRate","invalid_number")),n.noResponseThreshold<=n.threshold&&(n.noResponseThreshold=Math.max(5e3,n.threshold+1),r("lagMonitor.noResponseThreshold","relation_conflict")),n);if(s.enabled&&"undefined"!=typeof PerformanceObserver&&PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("long-animation-frame")&&(i=s.sampleRate,Math.random()<i)){var i,a=[],l={observer:null,lagRecords:a,sampled:!0,destroyed:!1,onDestroy:function(){return zp(o)}};nm.set(o,l),o.lifeCycle.on("destroy",l.onDestroy);try{l.observer=new PerformanceObserver(function(e){if(!l.destroyed)try{e.getEntries().forEach(function(e){var t,n,r,i;l.destroyed||e.duration<=s.threshold||(t=null==(t=e.scripts)?void 0:t[0],e={name:e.name,timestamp:Date.now(),entryType:e.entryType,startTime:e.startTime,duration:e.duration,invoker:null==t?void 0:t.invoker,sourceURL:null==t?void 0:t.sourceURL},a.push(e),100<a.length&&a.shift(),t=o,r=(e=e).duration>=(n=s).noResponseThreshold,i=P(t),e={event_id:A(),event_type:r?M.NO_RESPONSE:M.LAG_DETECTED,event_category:r?I.ERROR:I.PERFORMANCE,timestamp:Date.now(),page_url:(null==(r=t.getOriginFrom)?void 0:r.call(t))||window.location.href,data:x(x({measurements:{duration:Fp(e.duration),start_time_ms:Fp(e.startTime),lag_threshold_ms:n.threshold,no_response_threshold_ms:n.noResponseThreshold},event_properties:{entry_type:e.entryType||"long-animation-frame",source_url:Up(e.sourceURL,2048),invoker:Up(e.invoker,256)}},i?{replay_id:i}:{}),{tags:{environment:(null==(r=t.config)?void 0:r.env)||"production",version:String((null==(n=t.config)?void 0:n.version)||"")}})},t.reportTDEMEvent(e))})}catch(e){}}),l.observer.observe({type:"long-animation-frame",buffered:!1})}catch(e){zp(o)}}},getLagRecords:function(e){return g((null==(e=nm.get(e))?void 0:e.lagRecords)||[])},destroy:function(){Array.from(nm.keys()).forEach(zp)}}),im={enabled:!0,containers:["body","html","#app","#root"],ignoreContainers:[],containerMatchers:{tagName:["body","html"],id:["app","root"],className:[]},ignoreMatchers:{tagName:[],id:[],className:[]},detectStartPosition:{x:0,y:0},emptyElementsPercent:70,sameElementsPercent:70,debounceDuration:2e3,everySideSampleNumber:9,disableSameElementsCheck:!0,ignoreElesWhenDomChange:[],reDetectInterval:2e3,samePointDepth:5,customBlankScreenDector:null},om=["canvas","img","svg","iframe"],sm=(0,new Map),am=new e({name:"blankScreen",onNewTdem:function(_,e){var S,E,C,R,T,t,O,n,r,i,o,s,a,l,u,c,d,f,h,p,m,v=this;"undefined"!=typeof document&&document.elementsFromPoint&&(e=e,void 0===(a=null!=(m=_.config)&&m.debug?function(e,t){"undefined"!=typeof console&&console.warn&&console.warn("[TDEM] "+e+": "+t+", fallback applied")}:function(){})&&(a=function(){}),m=qp(),(S=!1===e?x(x({},m),{enabled:!1}):!0===e||void 0===e?m:!e||"object"!=typeof e||Array.isArray(e)?(a("blankScreen","invalid_type"),m):(l="containerMatchers"in(e=e)||"ignoreMatchers"in e,p="containers"in e||"ignoreContainers"in e,u=function(e,t,n,r){return void 0===e?g(t):Array.isArray(e)&&e.length<=100&&e.every(function(e){return"string"==typeof e&&0<e.trim().length&&e.trim().length<=r})?e.map(function(e){return e.trim()}):(a(n,"invalid_array"),g(t))},h=function(e,t,n){return void 0===e?Hp(t):!e||"object"!=typeof e||Array.isArray(e)?(a(n,"invalid_type"),Hp(t)):{tagName:u((e=e).tagName,t.tagName||[],n+".tagName",128),id:u(e.id,t.id||[],n+".id",128),className:u(e.className,t.className||[],n+".className",128)}},c=function(e,t,n,r){return void 0===e?t:"number"!=typeof e?(a(n,"invalid_type"),t):Number.isFinite(e)?r(e)?e:(a(n,"out_of_range"),t):(a(n,"invalid_number"),t)},d=function(e,t,n,r,i){return c(e,t,n,function(e){return Number.isInteger(e)&&r<=e&&e<=i})},f=qp(),void 0!==e.enabled&&("boolean"==typeof e.enabled?f.enabled=e.enabled:a("blankScreen.enabled","invalid_type")),f.containers=u(e.containers,m.containers,"blankScreen.containers",256),f.ignoreContainers=u(e.ignoreContainers,m.ignoreContainers,"blankScreen.ignoreContainers",256),f.containerMatchers=h(e.containerMatchers,m.containerMatchers,"blankScreen.containerMatchers"),f.ignoreMatchers=h(e.ignoreMatchers,m.ignoreMatchers,"blankScreen.ignoreMatchers"),p&&!l&&(f.containerMatchers={tagName:[],id:[],className:[]},f.ignoreMatchers={tagName:[],id:[],className:[]}),void 0===(h=e.detectStartPosition)||h&&"object"==typeof h&&!Array.isArray(h)?f.detectStartPosition={x:c((p=h||{}).x,m.detectStartPosition.x,"blankScreen.detectStartPosition.x",function(e){return 0<=e}),y:c(p.y,m.detectStartPosition.y,"blankScreen.detectStartPosition.y",function(e){return 0<=e})}:a("blankScreen.detectStartPosition","invalid_type"),f.emptyElementsPercent=c(e.emptyElementsPercent,m.emptyElementsPercent,"blankScreen.emptyElementsPercent",function(e){return 0<e&&e<=100}),f.sameElementsPercent=c(e.sameElementsPercent,m.sameElementsPercent,"blankScreen.sameElementsPercent",function(e){return 0<e&&e<=100}),f.debounceDuration=c(e.debounceDuration,m.debounceDuration,"blankScreen.debounceDuration",function(e){return 0<=e}),f.reDetectInterval=c(e.reDetectInterval,m.reDetectInterval,"blankScreen.reDetectInterval",function(e){return 0<e}),f.everySideSampleNumber=d(e.everySideSampleNumber,m.everySideSampleNumber,"blankScreen.everySideSampleNumber",2,50),f.samePointDepth=d(e.samePointDepth,m.samePointDepth,"blankScreen.samePointDepth",1,20),void 0!==e.disableSameElementsCheck&&("boolean"==typeof e.disableSameElementsCheck?f.disableSameElementsCheck=e.disableSameElementsCheck:a("blankScreen.disableSameElementsCheck","invalid_type")),f.ignoreElesWhenDomChange=u(e.ignoreElesWhenDomChange,m.ignoreElesWhenDomChange,"blankScreen.ignoreElesWhenDomChange",256),void 0!==e.customBlankScreenDector&&(null===e.customBlankScreenDector||"function"==typeof e.customBlankScreenDector?f.customBlankScreenDector=e.customBlankScreenDector:a("blankScreen.customBlankScreenDector","invalid_type")),f)).enabled)&&(l=((e,t,n)=>({totalSamplePoints:e=4*e-3,whitePointThreshold:Math.floor(e*t/100),samePointThreshold:Math.floor(e*n/100)}))(S.everySideSampleNumber,S.emptyElementsPercent,S.sameElementsPercent),E=l.totalSamplePoints,C=l.whitePointThreshold,R=l.samePointThreshold,T={observer:null,detectTimer:null,bodyWaitTimer:null,bodyWaitFrame:null,idleCallbackId:null,destroyed:!1,initialDetectionPending:!0,incidentStatus:"healthy",preDetectResult:null,triggerType:"dom_change",onErrorOccurred:function(){},onDestroy:function(){return Gp(_)},handlePageHide:function(){},handleBeforeUnload:function(){},handleVisibilityChange:function(){}},sm.set(_,T),t=function(){return D(v,void 0,void 0,function(){var u,c,d,f,h,p,m,v,g,y,w,b,k;return L(this,function(e){var t,n,r,i,o,s,a,l;if(!T.destroyed)try{if("initial_load"===T.triggerType&&(T.initialDetectionPending=!1),u=window.innerHeight,c=window.innerWidth,d=S.detectStartPosition,f=d.x,h=d.y,c<=f||u<=h)return[2];if(p=[],v=m=0,((e,t,n,r)=>{for(var i=r.x,o=r.y,s=i+(e-i)/2,a=o+(t-o)/2,l=n+1,u=[],c=1;c<l;c+=1){var d=i+(e-i)*c/l,f=o+(t-o)*c/l;u.push({x:d,y:a}),c!==l/2&&u.push({x:s,y:f},{x:d,y:f},{x:d,y:t-f})}return u})(c,u,S.everySideSampleNumber,S.detectStartPosition).forEach(function(e){s=e.x,a=e.y,e=document.elementsFromPoint(s,a),e=(l=function(e){var t=e[0];if(t&&null!==t.shadowRoot){t=(null==(t=t.shadowRoot)?void 0:t.elementsFromPoint(s,a))||[];if(t.length>e.length)return l(t)}return e})(e),t=S.containers,n=S.ignoreContainers,r=S.containerMatchers,u=S.ignoreMatchers,e=e.map(Bp),o=e.map(function(e){return e.selector});var t,n,r,i,o,s,a,l,u=(e=e[0])?(r=(i=!(!r||!(null!=(i=r.tagName)&&i.length||null!=(i=r.id)&&i.length||null!=(i=r.className)&&i.length)))?jp(e,r):Wp(e,t),t=i?jp(e,u):Wp(e,n),{isWhitePoint:r&&!t,selectorPointers:o}):{isWhitePoint:!1,selectorPointers:o};u.isWhitePoint&&(m+=1),p.push(u.selectorPointers)}),g=C<=m,y=!1,S.disableSameElementsCheck||(w=p.map(function(e){return e.slice(0,S.samePointDepth)}),o={},w.map(function(e){return e.join(" < ")}).forEach(function(e){o[e]=o[e]?o[e]+1:1}),s=Object.keys(o).map(function(e){return[e,o[e]]}).sort(function(e,t){return t[1]-e[1]})[0]||["",0],a=s[0],b={samePointerMap:o,maximumSamePointerClass:a,maximumSamePointerCounter:s[1]},y=R<=(v=b.maximumSamePointerCounter)&&(l=b.maximumSamePointerClass,!om.some(function(e){return l.startsWith(e)}))),k=!1,S.customBlankScreenDector)try{k=!0===S.customBlankScreenDector()}catch(e){k=!1}if(!(g||y||k))return T.incidentStatus="healthy",T.preDetectResult=null,[2];if("reported"===T.incidentStatus)return[2];if("suspect"===T.incidentStatus&&T.preDetectResult)return t=T.preDetectResult,r=t.customTriggered?"custom":t.whitePointTriggered&&t.sameElementTriggered?"both":t.whitePointTriggered?"white_point":"same_element",i=P(_),t={event_id:A(),event_type:M.BLANK_SCREEN,event_category:I.ERROR,timestamp:Date.now(),page_url:(null==(n=_.getOriginFrom)?void 0:n.call(_))||window.location.href,data:x(x({measurements:{white_point_count:t.whitePointCount,same_point_count:t.samePointCount,total_sample_points:E,white_point_threshold:C,same_point_threshold:R,white_point_ratio:Vp(t.whitePointCount/E,6),same_point_ratio:Vp(t.samePointCount/E,6),viewport_width_px:Math.max(0,Math.round(window.innerWidth)),viewport_height_px:Math.max(0,Math.round(window.innerHeight))},event_properties:{trigger_reason:r,trigger_type:t.triggerType,detection_method:t.customTriggered?"custom_detector":"viewport_sampling",same_elements_check_enabled:String(!S.disableSameElementsCheck)}},i?{replay_id:i}:{}),{tags:{environment:(null==(n=_.config)?void 0:n.env)||"production",version:String((null==(r=_.config)?void 0:r.version)||"")}})},_.reportTDEMEvent(t),T.incidentStatus="reported",T.preDetectResult=null,[2];T.preDetectResult={whitePointCount:m,samePointCount:v,whitePointTriggered:g,sameElementTriggered:y,customTriggered:k,triggerType:T.triggerType},T.incidentStatus="suspect",T.detectTimer=setTimeout(function(){T.detectTimer=null,O()},S.reDetectInterval)}catch(e){}return[2]})})},O=function(){return D(v,void 0,void 0,function(){return L(this,function(e){switch(e.label){case 0:if(T.destroyed)return[2];if("function"!=typeof window.requestIdleCallback)return[3,5];e.label=1;case 1:return e.trys.push([1,2,,4]),T.idleCallbackId=window.requestIdleCallback(function(e){T.idleCallbackId=null,T.destroyed||(0<e.timeRemaining()?t():T.detectTimer=setTimeout(function(){T.detectTimer=null,t()},0))}),[3,4];case 2:return e.sent(),[4,t()];case 3:return e.sent(),[3,4];case 4:return[3,7];case 5:return[4,t()];case 6:e.sent(),e.label=7;case 7:return[2]}})})},n=function(e){void 0===e&&(e="dom_change"),T.destroyed||"suspect"===T.incidentStatus||"initial_load"!==e&&T.initialDetectionPending||(T.triggerType=e,T.detectTimer&&clearTimeout(T.detectTimer),T.detectTimer=setTimeout(function(){T.detectTimer=null,O()},S.debounceDuration))},T.onErrorOccurred=function(){return n("error")},_.lifeCycle.on("errorOccurred",T.onErrorOccurred),_.lifeCycle.on("destroy",T.onDestroy),r=function(){!T.destroyed&&document.body&&(T.observer=new MutationObserver(function(e){var t=null==(t=e[0])?void 0:t.target;if(1===e.length&&t instanceof Element){e=Bp(t).selector;if(S.ignoreElesWhenDomChange.includes(e))return}n("dom_change")}),T.observer.observe(document.body,{childList:!0,subtree:!0}))},document.body?r():(i=window.requestAnimationFrame||function(e){return setTimeout(e,1e3/60)},o=function(){document.body?(T.bodyWaitTimer&&clearTimeout(T.bodyWaitTimer),r()):T.bodyWaitFrame=i(o)},T.bodyWaitFrame=i(o),T.bodyWaitTimer=setTimeout(function(){null!==T.bodyWaitFrame&&((window.cancelAnimationFrame||clearTimeout)(T.bodyWaitFrame),T.bodyWaitFrame=null)},1e4)),T.handlePageHide=s=function(){T.destroyed||(T.detectTimer&&clearTimeout(T.detectTimer),T.triggerType="page_state",T.preDetectResult&&(T.preDetectResult.triggerType="page_state"),t())},T.handleBeforeUnload=s,T.handleVisibilityChange=function(){"hidden"===document.visibilityState&&s()},window.addEventListener("pagehide",T.handlePageHide),window.addEventListener("beforeunload",T.handleBeforeUnload),document.addEventListener("visibilitychange",T.handleVisibilityChange),n("initial_load"))},destroy:function(){Array.from(sm.keys()).forEach(Gp)}}),lm={enabled:!0,enableMemoryReport:!0,enableOOMReport:!0,oomThreshold:100,memoryReportInterval:6e4,oomCheckInterval:1e4,monitorPages:[],sampleRate:1},um=new Map,cm=function(e){return"number"==typeof e&&Number.isFinite(e)},m=new e({name:"memoryMonitor",onNewTdem:function(n,e){r=n;var r,i,o,s,t,a=!1===(e=e)?x(x({},lm),{enabled:!1}):(i=e&&"object"==typeof e?e:{},void 0===e||!0===e||e&&"object"==typeof e&&!Array.isArray(e)||Zp(r,"memoryMonitor","invalid_type"),o=x(x({},lm),{oomThreshold:0<(e=(null==(e=Jp())?void 0:e.limit)||0)?Math.round(e/1024/1024*.9):100}),["enabled","enableMemoryReport","enableOOMReport"].forEach(function(e){void 0!==i[e]&&("boolean"==typeof i[e]?o[e]=i[e]:Zp(r,"memoryMonitor."+e,"invalid_type"))}),["oomThreshold","memoryReportInterval","oomCheckInterval"].forEach(function(e){var t=i[e];void 0!==t&&(cm(t)&&0<t?o[e]=t:Zp(r,"memoryMonitor."+e,cm(t)?"out_of_range":"invalid_number"))}),void 0!==i.sampleRate&&(cm(i.sampleRate)&&0<=i.sampleRate&&i.sampleRate<=1?o.sampleRate=i.sampleRate:Zp(r,"memoryMonitor.sampleRate","out_of_range")),void 0!==i.monitorPages&&(Array.isArray(i.monitorPages)&&i.monitorPages.length<=100&&i.monitorPages.every(function(e){return"string"==typeof e&&!!e||e instanceof RegExp})?o.monitorPages=g(i.monitorPages):Zp(r,"memoryMonitor.monitorPages","invalid_value")),o);!a.enabled||!(()=>{var e;try{return"undefined"!=typeof window&&null!=(e=window.performance)&&e.memory}catch(e){}})()||Math.random()>=a.sampleRate||(e=a.monitorPages).length&&(t="undefined"==typeof window?"":window.location.href,!e.some(function(e){return"string"==typeof e?t.includes(e):(e.lastIndex=0,e.test(t))}))||(s={config:a,reportTimer:null,oomCheckTimer:null,lastOOMTime:0,records:[],destroyed:!1,onDestroy:function(){return Kp(n)},onPageExit:function(){return Kp(n)}},um.set(n,s),n.lifeCycle.on("destroy",s.onDestroy),"undefined"!=typeof window&&(window.addEventListener("pagehide",s.onPageExit),window.addEventListener("beforeunload",s.onPageExit)),a.enableMemoryReport&&(s.reportTimer=setInterval(function(){return $p(n,s,M.MEMORY_USAGE)},a.memoryReportInterval)),a.enableOOMReport&&(s.oomCheckTimer=setInterval(function(){var e=Jp(),t=Date.now();e&&e.used/1024/1024>a.oomThreshold&&3e5<t-s.lastOOMTime&&(s.lastOOMTime=t,$p(n,s,M.MEMORY_OOM))},a.oomCheckInterval)))},destroy:function(){Array.from(um.keys()).forEach(Kp)}});function dm(e,t){try{var n={projectKey:e,document:t,timestamp:Date.now()};localStorage.setItem("TDEM_SAMPLE_CONFIG",JSON.stringify(n))}catch(e){}}function fm(e){var t;try{var n,r=localStorage.getItem("TDEM_SAMPLE_CONFIG");return r?!((n=JSON.parse(r)).projectKey!==e||6048e5<=Date.now()-n.timestamp)&&null!=(t=n.document)&&t.event?n.document:null:null}catch(e){return null}}function hm(e,t){try{var n=e.config.sessionReplay,r=t,i=(!1===n&&(r=x(x({},t),{replay:x(x({},t.replay),{enabled:!1})})),e._tdemSampleConfig=r,e._tdemSampleGate||null);null!=i&&i.decide(!0),o=e,l=(null==r?void 0:r.replay)||{},u={},"boolean"==typeof l.enabled&&(u.enabled=l.enabled),void 0!==l.experience_sample_rate&&(u.experience_sample_rate=Number(l.experience_sample_rate)),"boolean"==typeof l.error_traceback&&(u.error_traceback=l.error_traceback),void 0!==l.error_sample_rate&&(u.error_sample_rate=Number(l.error_sample_rate)),s=u,s=Dp(o.config.sessionReplay,s),o._effectiveReplayPolicy=s,o._replaySampled=s.enabled,"function"==typeof(o=null==(o=null==(a=null==(a=null==(o=o.constructor.installedPlugins)?void 0:o.find)?void 0:a.call(o,function(e){return e&&"sessionReplay"===e.name}))?void 0:a.option)?void 0:o.applyEffectivePolicy)&&o.call(a.option,s)}catch(t){console.warn("[TDEM] sample config apply failed",t),e._tdemSampleConfig=rt}var o,s,a,l,u}function pm(e,t){var n=e.config.sampleConfigPreference||"remote-first",e=e.config.sampleConfig,r=n||"remote-first";try{return"local-first"===r?e||t||rt:t||e||rt}catch(n){return e||rt}}var mm=new e({name:"tdemConfig",onNewTdem:function(e){try{var t=e._prefetchedConfigData;null!=t&&t.event?hm(e,pm(e,t)):hm(e,pm(e,null)),function(s){var a;D(this,void 0,void 0,function(){var n,r,i,o;return L(this,function(e){switch(e.label){case 0:if(n=s.config.id,null!=(r=s._prefetchedConfigData)&&r.event)return delete s._prefetchedConfigData,i=pm(s,r),n&&dm(n,i),hm(s,i),[2];if(!n)return hm(s,pm(s,null)),[2];if(t=(s.config.url||"").replace(/\/+$/,""),!(r=t?t+"/api/v1/sample-config":""))return hm(s,pm(s,fm(n))),[2];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,s.transportRequest({kind:"config",url:r,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project_key:n})})];case 2:if(!(o=e.sent()).ok)throw new Error("HTTP "+o.status);if(0===(o="string"==typeof o.body?JSON.parse(o.body):o.body).code&&null!=(a=o.data)&&a.event)return i=pm(s,o.data),dm(n,i),hm(s,i),[2];throw new Error("API error: code="+o.code);case 3:return o=e.sent(),console.warn("[TDEM] Failed to fetch sample-config:",o),hm(s,pm(s,fm(n))),[3,4];case 4:return[2]}var t})})}(e)}catch(t){console.warn("[TDEM] tdemConfig init failed",t),hm(e,rt)}}});return r.entryName="tdem-web-sdk",r.use(An),r.use(En),r.use(Rt),r.use(oi),r.use(ni),r.use(St),r.use(n),r.use(ai),r.use(bi),r.use(Yn),r.use(tr),r.use(Rn),r.use(mm),r.use(f),r.use(em),r.use(rm),r.use(am),r.use(m),w.default=r,w.registerCgiRequestFinalizer=on,Object.defineProperty(w,"__esModule",{value:!0}),w})({});
10
+ var TDEM=(w=>{var S,E;function C(e){this.name="__st"+(1e9*Math.random()>>>0)+S+"__",null!=e&&e.forEach(this.add,this),S+=1}Array.prototype.find||Object.defineProperty(Array.prototype,"find",{configurable:!0,writable:!0,value:function(e){if(null===this)throw new TypeError('"this" is null or not defined');var t=Object(this),n=t.length>>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var r=arguments[1],i=0;i<n;){var o=t[i];if(e.call(r,o,i,t))return o;i+=1}}}),window.WeakSet||(S=Date.now()%1e9,C.prototype.add=function(e){var t=this.name;return e[t]||Object.defineProperty(e,t,{value:!0,writable:!0}),this},C.prototype.delete=function(e){return!!e[this.name]&&!(e[this.name]=void 0)},C.prototype.has=function(e){return!!e[this.name]},E=C,Object.defineProperty(window,"WeakSet",{value:function(e){return new E(e)}})),Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(null==e)throw new TypeError("Cannot convert first argument to object");for(var t=Object(e),n=1;n<arguments.length;n++)if(null!=(r=arguments[n]))for(var r=Object(r),i=Object.keys(Object(r)),o=0,s=i.length;o<s;o++){var a=i[o],l=Object.getOwnPropertyDescriptor(r,a);null!=l&&l.enumerable&&(t[a]=r[a])}return t}});var R=function(e,t){return(R=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(e,t)};function T(e,t){function n(){this.constructor=e}R(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var I=function(){return(I=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function D(e,s,a,l){return new(a=a||Promise)(function(n,t){function r(e){try{o(l.next(e))}catch(e){t(e)}}function i(e){try{o(l.throw(e))}catch(e){t(e)}}function o(e){var t;e.done?n(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(r,i)}o((l=l.apply(e,s||[])).next())})}function L(r,i){var o,s,a,l={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(n){return function(e){var t=[n,e];if(o)throw new TypeError("Generator is already executing.");for(;l;)try{if(o=1,s&&(a=2&t[0]?s.return:t[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,t[1])).done)return a;switch(s=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,s=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!((a=0<(a=l.trys).length&&a[a.length-1])||6!==t[0]&&2!==t[0])){l=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3]))l.label=t[1];else if(6===t[0]&&l.label<a[1])l.label=a[1],a=t;else{if(!(a&&l.label<a[2])){a[2]&&l.ops.pop(),l.trys.pop();continue}l.label=a[2],l.ops.push(t)}}t=i.call(r,l)}catch(e){t=[6,e],s=0}finally{o=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}}function g(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),i=0,t=0;t<n;t++)for(var o=arguments[t],s=0,a=o.length;s<a;s++,i++)r[i]=o[s];return r}function O(e,t){return void 0===t&&(t="https://dem.rumt-zh.com"),t=(e.url||"").replace(/\/+$/,"")||("string"==typeof t?t:"https://dem.rumt-zh.com"),e.url=t,e.hostUrl=t,e.offlineUrl=t+"/offline",e.whiteListUrl=t+"/collect/whitelist",e.pvUrl=t+"/collect/pv",e.eventUrl=t+"/collect/events",e.speedUrl=t+"/speed",e.customTimeUrl=t+"/speed/custom",e.performanceUrl=t+"/speed/performance",e.performanceUrlForHippy=t+"/speed/hippyPerformance",e.webVitalsUrl=t+"/speed/webvitals",e.setDataReportUrl=t+"/speed/miniProgramData",e}function F(e){try{return localStorage.getItem(e)}catch(e){return null}}function U(e,t){try{localStorage.setItem(e,t)}catch(e){}}function z(e,t){try{return e?JSON.parse(e):t}catch(e){return t}}var B,j=/_?t(\d)?(imestamp)?=\d+&?/g,W=["aegis.qq.com","tamaegis.com","/aegis-sdk","rumt-","/flog.core.min.js","pingfore.qq.com","pingfore.tencent.com","zhiyan.tencent-cloud.net","h.trace.qq.com","btrace.qq.com","beacon.qq.com","dmplog.qq.com","qq.com/report","svibeacon.onezapp.com","cube.weixinbridge.com","doubleclick.net","pcmgrmonitor.3g.qq.com","tdm.qq.com","report.qqweb.qq.com","tpstelemetry.tencent.com","galileotelemetry.tencent.com","insight.cloud.tencent.com","facebook.com","facebook.net","google","yahoo.com","twitter.com","ga-audiences","report.idqqimg.com","arms-retcode.aliyuncs.com","px.effirst.com","sentry","baidu.com","hot-update.json","u.c.b.r.o.w.s.e.r","report.url.cn","sockjs-node","m3u8","flv"],H=["ResizeObserver loop limit exceeded","ResizeObserver loop completed","Failed to execute 'transaction'","window.indexedDB.deleteDatabase is not a function"],q=["ext1","ext2","ext3","ext4","ext5","ext6","ext7","ext8","ext9","ext10","level","trace","spanId","tag","seq","code"],V=["static","fetch"],G="unknown",Z=(J.prototype.indexOf=function(e,t){for(var n=0;n<e.length;n++)if(e[n].callback===t)return n;return-1},J.prototype.on=function(e,t,n){var r;if(void 0===n&&(n=0),this)return(r=this.eventsList[e])||(this.eventsList[e]=[],r=this.eventsList[e]),-1===this.indexOf(r,t)&&r.push({name:e,type:n||0,callback:t}),this},J.prototype.one=function(e,t){this.on(e,t,1)},J.prototype.remove=function(e,t){if(this){var n=this.eventsList[e];if(n){if(t)return n.length&&(t=this.indexOf(n,t),n.splice(t,1)),this;try{delete this.eventsList[e]}catch(e){}}return null}},J.prototype.clear=function(){this.eventsList={}},J);function J(){var s=this;this.emit=function(e,t){if(s){var n;if(null!=(r=s.eventsList[e])&&r.length)for(var r=r.slice(),i=0;i<r.length;i++){n=r[i];try{var o=n.callback.apply(s,[t]);if(1===n.type&&s.remove(e,n.callback),!1===o)break}catch(e){throw e}}return s}},this.eventsList={}}function K(e){if(null!=e){e=String(e).trim();if(e){var t=e.toLowerCase();if(t!==G&&"undefined"!==t&&"null"!==t&&"未知"!==e)return e}}}function $(e){return e&&"string"==typeof e?e.replace(/eval\(/gi,"evaI("):e}function X(e,t){return"number"==typeof e||"string"==typeof e?e:t?B.string:B.number}function ee(e,t){return"string"==typeof e?e.split("?")[t?1:0]||"":e}function te(e,t){return void 0===t&&(t=2048),String(e).replace(j,"").slice(0,t)}function ne(e){return"string"==typeof e&&/^\//.test(e)?"https:"===(null==location?void 0:location.protocol):/^https/.test(e)}function re(e,t,n){var r,i,o;try{if("function"==typeof(null==t?void 0:t.retCodeHandler))return{code:void 0===(o=(i=t.retCodeHandler(e,null==n?void 0:n.url,null==n?void 0:n.ctx,null==n?void 0:n.payload)||{}).code)?G:o,isErr:i.isErr};if(!(e="string"==typeof e?JSON.parse(e):e))return{code:G,isErr:!1};"function"==typeof(null==(r=null==t?void 0:t.ret)?void 0:r.join)&&(fe=[].concat(t.ret.map(function(e){return e.toLowerCase()})));var s=Object.getOwnPropertyNames(e).filter(function(e){return-1!==fe.indexOf(e.toLowerCase())});return s.length?{code:""+(o="未知"!==(o=e[s[0]])&&""!==o?o:G),isErr:0!==o&&"0"!==o&&o!==G}:{code:G,isErr:!1}}catch(e){return{code:G,isErr:!1}}}function oe(e,t,n){try{var r="function"==typeof t?t(e,null==n?void 0:n.url,null==n?void 0:n.ctx)||"":e;return me(r).slice(0,10240)}catch(e){return""}}function se(e){if("string"==typeof e)return e;try{return e instanceof Error?(JSON.stringify(e,he(),2)||"undefined").replace(/"/gim,""):JSON.stringify(e,he(),2)||"undefined"}catch(e){return"error happen when tdem stringify: \n "+e.message+" \n "+e.stack}}function ae(e,t){var n,r={fetch:[],static:[],bridge:[]},i=new FormData;return Array.isArray(e)?e.forEach(function(e){var t=ye(e);r[e.type].push(t)}):(n=ye(e),r[e.type].push(n)),i.append("payload",pe(I({duration:r},t))),i}function le(t,e){return"string"!=typeof t||!t||e&&-1<t.indexOf(e)||we.test(t)||W.some(function(e){return-1<t.indexOf(e)})}(e=B=B||{})[e.number=-1]="number",e.string="";var ue,ce=["application/xhtml+xml","application/xml","application/pdf","application/pkcs12","application/javascript","application/x-javascript","application/ecmascript","application/vnd.mspowerpoint","application/vnd.apple.mpegurl","application/ogg","text/css","text/javascript","image","audio","video","video/mp2t"],de=/\.(json|js|css|jpg|jpeg|png|svg|apng|webp|gif|bmp|mp4|mp3|ts|mpeg|wav|webm|ogg|flv|m3u8|ttf|woff2|otf|eot|woff|html|htm|shtml|shtm|)$/i,fe=["ret","retcode","code","errcode"],he=function(){var n=new WeakSet;return function(e,t){if(t instanceof Error)return"Error.message: "+t.message+" \n Error.stack: "+t.stack;if("object"==typeof t&&null!==t){if(n.has(t))return"[Circular "+(e||"root")+"]";n.add(t)}return t}},pe=function(e){if("string"==typeof e)return e;try{return JSON.stringify(e,he())||"undefined"}catch(e){return"error happen when tdem stringify: \n "+e.message+" \n "+e.stack}},me=function(n,r){void 0===r&&(r=3);var i,o,s,a="";return Array.isArray(n)?(a+="[",i=n.length,n.forEach(function(e,t){a=(a+="object"==typeof e&&1<r?me(e,r-1):ge(e))+(t===i-1?"":",")}),a+="]"):n instanceof Object||"object"==typeof n?(a="{",o=Object.keys(n),s=o.length,o.forEach(function(e,t){"object"==typeof n[e]&&1<r?a+='"'+e+'":'+me(n[e],r-1):a+=ve(e,n[e]),a+=t===s-1||t<s-1&&void 0===n[o[t+1]]?"":","}),a+="}"):a+=n,a},ve=function(e,t){var n=typeof t,r="";return"string"==n||"object"==n?r+='"'+e+'":"'+t+'"':"function"==typeof t?r+='"'+e+'":"function '+t.name+'"':"symbol"==typeof t?r+='"'+e+'":"symbol"':"number"!=typeof t&&"boolean"!=n||(r+='"'+e+'": '+t),r},ge=function(e){var t=typeof e;return""+("undefined"==t||"symbol"==t||"function"==t?"null":"string"==t||"object"==t?'"'+e+'"':e)},ye=function(t){var n;return t.payload?(n={},Object.keys(t).forEach(function(e){"payload"!==e&&(n[e]=t[e])}),n):t},we=/data:(image|text|application|font)\/.*;base64/;(e=ue=ue||{}).LOG="log",e.SPEED="speed",e.PERFORMANCE="performance",e.OFFLINE="offline",e.WHITE_LIST="whiteList",e.VITALS="vitals",e.PV="pv",e.CUSTOM_PV="customPV",e.EVENT="event",e.CUSTOM="custom",e.SDK_ERROR="sdkError",e.SET_DATA="setData",e.LOAD_PACKAGE="loadPackage",e.MEMORY="memory";var be,x,M,ke={maxAttempts:3,delays:[0,1e3,3e3]};function _e(e){return null==e?be.production:(e=>{switch(e){case be.production:case be.development:case be.gray:case be.pre:case be.daily:case be.local:case be.test:case be.others:return!0;default:return!1}})(e)?e:be.others}function A(){return"evt_"+Date.now()+"_"+Math.random().toString(36).substring(2,8)}function Se(e){var t=[];if(e.stack)for(var n=0,r=0,i=e.stack.split("\n");r<i.length;r++){var o,s,a,l,u,c=i[r],d=c.match(/at\s+(.+?)\s+\((.+?):(\d+):(\d+)\)/);d?(s=d[1],o=d[2],a=d[3],l=d[4],u=o.split("/").pop()||o,t.push({abs_path:o,colno:parseInt(l,10),filename:u,function:s||"(anonymous)",lineno:parseInt(a,10),in_app:o.includes("node_modules")||o.includes("cdn")?0:1,stack_level:n++})):(d=c.match(/at\s+(.+?):(\d+):(\d+)/))&&(s=d[1],a=d[2],l=d[3],u=s.split("/").pop()||s,t.push({abs_path:s,colno:parseInt(l,10),filename:u,function:"(anonymous)",lineno:parseInt(a,10),in_app:s.includes("node_modules")||s.includes("cdn")?0:1,stack_level:n++}))}return t}function Ee(d,l){return function(i,o){var s,a,e,t,n;null!=i&&i.log&&null!=i&&i.type?(s=function(e,t,n,r){switch(t){case ue.LOG:o=e;var i=(Array.isArray(o)?o:[o]).map(function(n){return Object.getOwnPropertyNames(n).reduce(function(e,t){return"ctx"!==t&&(e[t]=n[t]),e},{level:"2",msg:""})});if(!i||0===i.length)return"{}";i=Array.isArray(i)?i:[i];var o=Array.from(new Set(i.flatMap(function(e){return Object.keys(e)}))),s={};return o.forEach(function(t){s[t]=i.map(function(e){return e[t]||""})}),s.count=i.length,pe(s);case ue.SPEED:return o=e,a=n,a=I(I({},d.bean),{from:a}),c=I({},d.bean),(()=>{try{return"undefined"!=typeof FormData&&"function"==typeof FormData.prototype.append}catch(e){}})()?ae(o,a):(a=o,o=c,u={fetch:[],static:[],bridge:[]},c={},Array.isArray(a)?a.forEach(function(e){var t;null!=(t=u[e.type])&&t.push(e)}):null!=(l=u[a.type])&&l.push(a),c.payload=JSON.stringify(I({duration:u},o)),c);case ue.EVENT:return r;default:return r||{}}var a,l,u,c,o},1!==(e=Array.isArray(i.log)?i.log:[i.log]).length?(a={},e.forEach(function(e){var t=e.from||"undefined";delete e.from,a[t]||(a[t]=[]),a[t].push(e)}),Object.keys(a).forEach(function(e){var t,n=a[e],r=null!=(r=i.url)&&r.includes("?")?"&":"?";"undefined"===e?(t=""+i.url,o(I(I({},i),{url:t,log:1===n.length?n[0]:n,data:s(n,l,e,i.data)}))):(t=i.url+r+"from="+e,o(I(I({},i),{url:t,log:1===n.length?n[0]:n,beanFilter:g(i.beanFilter||[],["from"]),data:s(n,l,e,i.data)})))})):(t=(e=e[0]).from,delete e.from,n=null!=(n=i.url)&&n.includes("?")?"&":"?",t?(n=i.url+n+"from="+t,o(I(I({},i),{url:n,log:e,beanFilter:g(i.beanFilter||[],["from"]),data:s(e,l,t,i.data)}))):(n=""+i.url,o(I(I({},i),{url:n,log:e,data:s(e,l,t,i.data)}))))):o(i)}}function Ce(l,u){return function(e,t){var n,r,i,o=Array.isArray(e),s=o?e:[e],a=(l.lifeCycle.emit("beforeRequest",e),l.config.beforeRequest);(s="function"==typeof a?s.map(function(t){try{var e=a({logs:t,logType:u});return(null==e?void 0:e.logType)===u&&null!=e&&e.logs?e.logs:!1!==e&&t}catch(e){return t}}).filter(function(e){return!1!==e}):s).length&&(n=s,e=q,!Array.isArray(n)||n.length<=1||(r=[],i=[],!(i="string"==typeof e?[e]:e))||i.length<=0||(i.forEach(function(t){n.forEach(function(e){null!=e&&e[t]&&r.push(t)})}),0<r.length&&(n=n.map(function(e){var t={};return r.forEach(function(e){t[e]=""}),I(I({},t),e)}))),s=n,t(o?s:s[0]))}}function Re(i){return function(e,t){i.lifeCycle.emit("modifyRequest",e);var n=i.config.modifyRequest;if("function"==typeof n)try{var r=n(e);"object"==typeof r&&"url"in r&&(e=r)}catch(e){console.error(e)}t(e)}}function Te(r){return function(e,t){null!=(n=r.lifeCycle)&&n.emit("afterRequest",e);var n=(r.config||{}).afterRequest;"function"==typeof n&&!1===n(e)||t(e)}}(e=be=be||{}).production="production",e.development="development",e.gray="gray",e.pre="pre",e.daily="daily",e.local="local",e.test="test",e.others="others",(e=x=x||{}).JS_ERROR="js_error",e.PROMISE_ERROR="promise_error",e.RESOURCE_ERROR="resource_error",e.API_ERROR="api_error",e.BLANK_SCREEN="blank_screen",e.PAGE_LOAD="page_load",e.RESOURCE_LOAD="resource_load",e.API_CALL="api_call",e.SSE_CALL="sse_call",e.true="web_vitals",e.LAG_DETECTED="lag_detected",e.NO_RESPONSE="no_response",e.MEMORY_USAGE="memory_usage",e.APP_METRICS="app_metrics",e.PROCESS_SIGNAL="process_signal",e.MEMORY_OOM="memory_oom",e.FILE_IO="file_io",e.CLICK="click",e.SCROLL="scroll",e.LONG_PRESS="long_press",e.PAGE_VIEW="page_view",e.TAB_HIDDEN="tab_hidden",e.TAB_VISIBLE="tab_visible",e.WINDOW_BLUR="window_blur",e.WINDOW_FOCUS="window_focus",e.FORM_FOCUS="form_focus",e.FORM_BLUR="form_blur",e.FORM_CHANGE="form_change",e.FORM_SUBMIT="form_submit",e.FORM_SUBMIT_RESULT="form_submit_result",e.STRUGGLE="struggle",e.CUSTOM="custom",e.LOG="log",e.DIAL_PROBE="dial_probe",e.DIAL_MTR="dial_mtr",(e=M=M||{}).ERROR="error",e.PERFORMANCE="performance",e.BEHAVIOR="behavior",e.NETWORK="network",e.LOG="log",e.CUSTOM="custom";var Oe=function(e){return e.filter(function(n,r){return"static"!==n.type||!e.find(function(e,t){return n.url===e.url&&200===n.status&&r<t})})},xe={},Ie={},Ne=function(e){return xe[e]||(xe[e]=setTimeout(function(){Ie[e]={},xe[e]=null},6e4)),xe[e]},Fe={generateTraceId:ze(16),generateSpanId:ze(8)},Ue=Array(32);function ze(t){return function(){for(var e=0;e<2*t;e++)Ue[e]=Math.floor(16*Math.random())+48,58<=Ue[e]&&(Ue[e]+=39);return String.fromCharCode.apply(null,Ue.slice(0,2*t))}}function Be(){return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,function(e){return(e^(16*Math.random()&15)>>e/4).toString(16)})}function je(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}function We(e){for(var t,n,r,i="",o=0,s=(e=String(e)).length%3;o<e.length;){if(255<(t=e.charCodeAt(o++))||255<(n=e.charCodeAt(o++))||255<(r=e.charCodeAt(o++)))throw new TypeError("Failed to execute 'btoa': The string to be encoded contains characters outside of the Latin1 range.");i+=Ve.charAt((t=t<<16|n<<8|r)>>18&63)+Ve.charAt(t>>12&63)+Ve.charAt(t>>6&63)+Ve.charAt(63&t)}return s?i.slice(0,s-3)+"===".substring(s):i}function He(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!Ge.test(e))throw new TypeError("Failed to execute 'atob': The string to be decoded is not correctly encoded.");var t;e+="==".slice(2-(3&e.length));for(var n,r,i="",o=0;o<e.length;)t=Ve.indexOf(e.charAt(o++))<<18|Ve.indexOf(e.charAt(o++))<<12|(n=Ve.indexOf(e.charAt(o++)))<<6|(r=Ve.indexOf(e.charAt(o++))),i+=64===n?String.fromCharCode(t>>16&255):64===r?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return i}function qe(e){var t,n={traceId:"",spanId:""};return e&&"object"==typeof e&&(t=(e=((e,t)=>{for(var n=0;n<t.length;n++){var r=t[n],i=e[r]||"function"==typeof e.get&&e.get(r);if(i)return[r,i]}return["",""]})(e,Object.keys(Je)))[0])?{traceId:(t=Je[t](e[1])).traceId||"",spanId:t.spanId||""}:n}var Ve="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Ge=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,Ze=($e.prototype.generate=function(e,t,n){if(void 0===t&&(t={}),this.url=e,!this.isUrlIgnored()&&this.isUrlInTraceUrls()&&this.traceType){switch(this.traceType){case"traceparent":this.traceId=this.createTraceparent();break;case"b3":this.traceId=this.createB3();break;case"sw8":this.traceId=this.createSw8(n);break;case"sentry-trace":this.traceId=this.createSentryTrace();break;default:return console.warn("this trace key "+this.traceType+" is not supported"),void(this.traceId="")}return t[this.traceType]&&(this.traceId=t[this.traceType]),{name:this.traceType,value:this.traceId}}},$e.prototype.createTraceparent=function(){var e=Fe.generateSpanId();return"00-"+Fe.generateTraceId()+"-"+e+"-0"+this.traceFlag.toString(16)},$e.prototype.createB3=function(){var e=Fe.generateSpanId();return Fe.generateTraceId()+"-"+e+"-"+this.traceFlag},$e.prototype.createSw8=function(e){var t="function"==typeof btoa?btoa:We,e=e||{},n=e.host,n=void 0===n?"":n,e=e.pathname,e=void 0===e?"":e,r=je(),i=je();return"1-"+String(t(i))+"-"+String(t(r))+"-1-"+String(t("tdem"))+"-"+String(t("1.0.16"))+"-"+String(t(encodeURI(e)))+"-"+String(t(n))},$e.prototype.createSentryTrace=function(){var e=Be().substring(16);return Be()+"-"+e+"-"+this.traceFlag},$e.prototype.isUrlIgnored=function(){if(Array.isArray(this.ignoreUrls)&&0!==this.ignoreUrls.length)for(var e=0,t=this.ignoreUrls;e<t.length;e++){var n=t[e];if(this.urlMatches(this.url,n))return!0}return!1},$e.prototype.isUrlInTraceUrls=function(){if(!this.urls)return!0;if(Array.isArray(this.urls)){if(0===this.urls.length)return!1;for(var e=0,t=this.urls;e<t.length;e++){var n=t[e];if(this.urlMatches(this.url,n))return!0}}return!1},$e.prototype.urlMatches=function(e,t){return"string"==typeof t?e===t:!!e.match(t)},$e),Je={sw8:function(e){var t="function"==typeof atob?atob:He,e=e.split("-"),n=e[1],e=e[2];return{traceId:n?t(n):"",spanId:e?t(e):""}},traceparent:function(e){e=e.split("-");return{traceId:e[1]||"",spanId:e[2]||""}},b3:function(e){e=e.split("-");return{traceId:e[0]||"",spanId:e[1]||""}},"sentry-trace":function(e){e=e.split("-");return{traceId:e[0]||"",spanId:e[1]||""}}},Ke=new WeakMap;function $e(e,t,n,r){void 0===n&&(n=null),this.traceType=e,this.ignoreUrls=t,this.urls=n,this.traceFlag=null==r?1:Number(!!r)}function Xe(e){var t,n;return String((null==(t=null==(t=null==(n=e.sessionManager)?void 0:n.getSession)?void 0:t.call(n))?void 0:t.id)||(null==(n=e.bean)?void 0:n.sessionId)||"")}function Ye(e,t){Ke.set(e,t)}function Qe(e){return Ke.get(e)}function et(o){return function(e){e&&0!==e.length&&o.sendPipeline([function(e,r){var i=new Map;e.forEach(function(e){var t=null!=(t=Qe(e))?t:Xe(o),n=i.get(t)||[];n.push(e),i.set(t,n)}),i.forEach(function(t,e){var e={protocol_version:2,project_key:String(o.config.id||""),sdk:{name:o.sdkName,version:o.sdkVersion},app:{version:String(o.config.version||"1.0.0")},context:I(I({},(e=>{var t=Xe(e),n=String(e.config.userId||e.config.uin||""),t={session_id:t,platform:(t=String(e.runtimePlatform||e.config.platform||"web").trim().toLowerCase(),["web","wx-miniprogram","uniapp","android","ios","electron","unknown"].includes(t)?t:"wx"===t?"wx-miniprogram":"my"!==t&&"qq"!==t&&"tt"!==t&&"undefined"!=typeof window?"web":"unknown")},n=(n&&(t.user_id=n),(n=String(e.bean.aid||"").trim())&&"true"!==n&&(t.device_id=n),e.bean.runtime?String(e.bean.runtime):""),r=e.bean.processType?String(e.bean.processType):"",i=void 0!==e.bean.windowId?String(e.bean.windowId):"",o=void 0!==e.bean.webContentsId?String(e.bean.webContentsId):"",e=e.bean.appVersion?String(e.bean.appVersion):"";return n&&(t.runtime=n),r&&(t.process_type=r),i&&(t.window_id=i),o&&(t.web_contents_id=o),e&&(t.app_version=e),"undefined"!=typeof navigator&&(t.user_agent=navigator.userAgent,t.language=navigator.language),"undefined"!=typeof screen&&(t.screen_resolution=screen.width+"x"+screen.height),t})(o)),{session_id:e}),events:t},n=String(o.config.url||"").replace(/\/+$/,"");n&&r({url:n+"/api/v1/collect/events",data:JSON.stringify(e),method:"POST",contentType:"application/json",addBean:!1,type:ue.EVENT,log:t,success:function(){o.lifeCycle.emit("afterReport",{success:!0,events:t})},fail:function(e){o.lifeCycle.emit("afterReport",{success:!1,error:e,events:t})}})})}],ue.EVENT)(e)}}var tt=new Set(Object.values({error:["js_error","promise_error","resource_error","api_error","blank_screen","no_response"],performance:["page_load","web_vitals","lag_detected","memory_usage","memory_oom"],network:["resource_load","api_call","sse_call"],custom:["custom"]}).flat());function nt(e){new Set(Object.values(e).flat())}nt({error:["js_error","promise_error","resource_error","api_error"],performance:["page_load"],network:["resource_load","api_call"],custom:["custom"]}),nt({error:["crash","api_error"],performance:["app_launch","lag_detected"],network:["api_call","sse_call"],custom:["custom"]}),nt({error:["crash","api_error","no_response"],performance:["app_launch","lag_detected"],network:["api_call","sse_call"],custom:["custom"]}),nt({error:["js_error","promise_error","resource_error","api_error","blank_screen","crash"],performance:["page_load","web_vitals","lag_detected","no_response","app_metrics","process_signal","file_io"],network:["resource_load","api_call","sse_call"],custom:["custom"]});var rt={event:{enabled:!0,types:{}},replay:{enabled:!1,experience_sample_rate:0,error_traceback:!1,error_sample_rate:100}};function it(e){return null==e?"":String(e)}function ot(r,e,i){return e.enabled&&e.conditions&&0!==e.conditions.length&&e.conditions.every(function(e){var t=e,e=((e,t,n)=>{if(t.startsWith("tags."))return i=t.slice("tags.".length),e.tags&&i in e.tags?e.tags[i]:void 0;if(t.startsWith("event_properties."))return i=t.slice("event_properties.".length),e.event_properties&&i in e.event_properties?e.event_properties[i]:void 0;if("page_path"===t){if(!n)return t in(i=e)&&null!=i[t]?i[t]:void 0;if(!e.page_url)return;try{return new URL(e.page_url).pathname}catch(e){return}}if("page_url"!==t)return t in(n=e)&&null!=n[t]?n[t]:void 0;var r=e.page_url;if(null!=r){var i=String(r);if(i)try{return decodeURIComponent(i)}catch(r){return i}}})(r,t.field,i);if(void 0===e)return!1;var n=it(e);switch(t.operator){case"equals":return n===it(t.value);case"not_equals":return n!==it(t.value);case"contains":return n.includes(it(t.value));case"not_contains":return!n.includes(it(t.value));case"starts_with":return n.startsWith(it(t.value));case"ends_with":return n.endsWith(it(t.value));case"in":return(Array.isArray(t.value)?t.value.map(it):[]).includes(n);case"not_in":return!(Array.isArray(t.value)?t.value.map(it):[]).includes(n);default:return!1}})}function st(e,t,n,r){var i,o,s,a;void 0===t&&(t=rt),void 0===n&&(n=Math.random),void 0===r&&(r={});try{if(null==(i=null==t?void 0:t.event)||!i.enabled)return!1;for(var l=null!=(o=r.closedSet)?o:tt,u=!1!==r.derivePagePath,c=(s=t,a=e.event_type,l.has(a)&&(null==(s=null==(s=s.event)?void 0:s.types)?void 0:s[a])||{sample_rate:100,rules:[]}),d=c.sample_rate,f=0,h=c.rules||[];f<h.length;f++){var p=h[f];if(p.enabled&&ot(e,p,u)){d=p.sample_rate;break}}return 100<=d||!(d<=0)&&100*n()<d}catch(e){return!0}}function at(e){e=null==(e=e)?void 0:e._tdemSampleGate;return!!e&&e.isDecided&&e.isSampled}function lt(e,t){var n=e.data||{},r=t.bean||{};return{event_type:String(e.event_type||""),event_category:e.event_category,event_name:e.event_name||n.event_name,page_url:e.page_url,user_id:r.user_id||t.config.userId,device_id:r.device_id||t.config.aid,env:t.config.env,version:String(null!=(t=null!=(t=t.config.version)?t:r.app_version)?t:""),tags:n.tags||e.tags,event_properties:n.event_properties||n.properties||n}}function ut(e){return e._tdemSampleConfig||null}function ct(e){return e._tdemSampleEvaluateOptions||{}}function dt(n){if(n&&n.reduce&&n.length)return 1===n.length?function(e,t){n[0](e,t||vt)}:n.reduce(function(n,r){return function(e,t){return void 0===t&&(t=vt),n(e,function(e){return null==r?void 0:r(e,t)})}});throw new TypeError("createPipeline need at least one function param")}function ft(t,n){Object.getOwnPropertyNames(t).forEach(function(e){"function"==typeof t[e]&&"constructor"!==e&&(n?n[e]="sendPipeline"===e?function(){return function(){}}:function(){}:t[e]=function(){})})}function ht(n){var r={};return n&&"object"==typeof n&&_t.forEach(function(e){var t=n[e];"string"==typeof t&&""!==t&&(r[e]=t)}),r}function pt(){return void 0!==window.performance&&"function"==typeof performance.getEntriesByType&&"function"==typeof performance.now}function mt(e){var t;return-1<(null==(t=null==(t=window.PerformanceObserver)?void 0:t.supportedEntryTypes)?void 0:t.indexOf(e))}var vt=function(){},gt={low:1,medium:3,high:5},yt=new Set(["custom_struggle_name","form_id","field_id","trigger_event_id","struggle_status","struggle_owner_type","struggle_owner_key","detection_source","rule_version"]),wt={rage_click:3,dead_click:4,error_click:4,form_validation_error:3,slow_page:3,back_forward:2,long_focus_time:2,form_zigzag:2,uncompleted_form:3,custom_struggle:3},bt={rage_click:4,dead_click:5,error_click:5,form_validation_error:4,slow_page:4,back_forward:3,long_focus_time:3,form_zigzag:3,uncompleted_form:3,custom_struggle:3},kt=(v.use=function(e){-1===v.installedPlugins.indexOf(e)&&e.tdemPlugin&&v.installedPlugins.push(e)},v.unuse=function(e){e=v.installedPlugins.indexOf(e);-1!==e&&v.installedPlugins.splice(e,1)},v.prototype.getInternalTransport=function(){return this.internalTransport},v.prototype.setInternalTransport=function(e){this.internalTransport=e},v.prototype.getInternalRetrySchedule=function(){return this.internalRetrySchedule},v.prototype.transportRequest=function(t,n){return D(this,void 0,void 0,function(){return L(this,function(e){switch(e.label){case 0:if(this.internalTransport)return[4,this.internalTransport.request(t,n)];throw new Error("Internal Transport is not configured");case 1:return[2,e.sent()||{ok:!0,request:t}]}})})},v.prototype.transportHandoff=function(t,n){return D(this,void 0,void 0,function(){return L(this,function(e){switch(e.label){case 0:if(this.internalTransport)return[4,(this.internalTransport.handoff||this.internalTransport.request).call(this.internalTransport,I(I({},t),{handoff:!0}),n)];throw new Error("Internal Transport is not configured");case 1:return[2,e.sent()||{ok:!0,request:t,handoffAccepted:!0}]}})})},v.prototype.init=function(e){this.setConfig(e),this.config=O(this.config,e.hostUrl);for(var t=0;t<v.installedPlugins.length;t++)try{v.installedPlugins[t].patch(this)}catch(e){this.sendSDKError(e)}this.lifeCycle.emit("onInited")},v.prototype.destroy=function(e){void 0===e&&(e=!1);var t,n,r=v.instances.indexOf(this);-1!==r&&v.instances.splice(r,1);for(var i=v.installedPlugins.length-1;0<=i;i--)try{v.installedPlugins[i].unpatch(this)}catch(e){this.sendSDKError(e)}if(this.lifeCycle.emit("destroy"),this.lifeCycle.clear(),e)t=this,n=Object.getOwnPropertyDescriptors(t),Object.keys(n).forEach(function(e){n[e].writable&&(t[e]=null)}),Object.setPrototypeOf(this,null);else{for(var o=this;o.constructor!==Object&&ft(o,this),o=Object.getPrototypeOf(o););0===v.instances.length&&(r=Object.getPrototypeOf(this).constructor,ft(r),ft(v))}},v.prototype.setConfig=function(e){Object.assign(this.config,e);var e=this.config,t=e.id,n=e.uin,r=e.version,i=e.aid,o=e.env,s=e.pageUrl,e=e.userId||(null!=n?String(n):""),n=this.bean.id!==t||this.bean.uin!==e||this.bean.aid!==i;return this.bean.id=t||"",this.bean.uin=e,this.bean.version=r||"1.0.16",this.bean.aid=i||"",this.bean.env=_e(o),s&&this.extendBean("from",encodeURIComponent(s.slice(0,2048))),n&&this.lifeCycle.emit("onConfigChange",this.config),this.config},v.prototype.extendBean=function(e,t){this.bean[e]=t},v.prototype.send=function(e,i,o){var t=this;return dt([Re(this),Ee(this,null==e?void 0:e.type),function(n,r){t.request(n,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];r({isErr:!1,result:e,logType:n.type,logs:n.log}),null!=i&&i.apply(void 0,e)},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];r({isErr:!0,result:e,logType:n.type,logs:n.log}),null!=o&&o.apply(void 0,e)})},Te(this)])(e)},v.prototype.sendSDKError=function(e){var n=this;this.sendPipeline([function(e,t){t({url:n.config.url+"?id=1085&msg[0]="+encodeURIComponent(se(e))+"&level[0]=2&from="+n.config.id+"&count=1&version="+n.config.id+"(1.0.16)",addBean:!1,method:"get",type:ue.SDK_ERROR,log:e})}],ue.SDK_ERROR)(e)},v.prototype.sendPipeline=function(e,t){var n,o=this;return dt(g([function(e,t){if(e&&e.type===ue.EVENT)return t(e);if("number"!=typeof n.config.random&&(console.warn("random must in [0, 1], default is 1."),n.config.random=1),!n.isHidden||!n.isGetSample)if(n.isGetSample)n.isHidden||t(e);else{if(n.isGetSample=!0,Math.random()<n.config.random)return n.isHidden=!1,t(e);n.isHidden=!0}},Ce(n=this,t)],e,[Ee(this,t),Re(this),function(r,i){o.request(r,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=!1;-1<(""+e[o.failRequestCount=0]).indexOf("403 forbidden")&&(n=!0,o.destroy()),i({isErr:n,result:e,logType:null==r?void 0:r.type,logs:null==r?void 0:r.log}),null!=(n=null==r?void 0:r.success)&&n.call.apply(n,g([r],e))},function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];60<=++o.failRequestCount&&o.destroy(),-1<(""+t[0]).indexOf("403 forbidden")&&o.destroy(),i({isErr:!0,result:t,logType:null==r?void 0:r.type,logs:null==r?void 0:r.log}),null!=(e=null==r?void 0:r.fail)&&e.call.apply(e,g([r],t))})},Te(this)]))},v.prototype.track=function(e,t){void 0===t&&(t={}),e&&"string"==typeof e?(e={event_id:A(),event_type:x.CUSTOM,event_category:M.CUSTOM,timestamp:Date.now(),page_url:this.getCurrentEventPageUrl(),data:{event_name:e,replay_id:this.getEventReplayId(),tags:this.sanitizeEventTags(t.tags),event_properties:this.sanitizeEventProperties(t.properties)}},this.reportTDEMEvent(e)):console.warn("track: name must be a non-empty string")},v.prototype.trackStruggle=function(e,t){void 0===t&&(t={});var n,e="string"==typeof e?e.trim():"";!e||128<e.length?console.warn("trackStruggle: name must be a non-empty string limited to 128 characters"):(n=t.severity||"medium",(n=gt[n])?this.reportStruggle({type:"custom_struggle",ownerType:"business",ownerKey:e,severity:n,detectionSource:"custom",ruleVersion:"custom-v1",tags:t.tags,properties:I(I({},t.properties||{}),{custom_struggle_name:e})}):console.warn("trackStruggle: severity must be low, medium, or high"))},v.prototype.reportTDEMEvent=function(e){var r,t,n,i=this,e=Array.isArray(e)?e:[e];e.length&&(r="string"==typeof(n=(t=this).viewId)&&n.trim()?n.trim():"string"==typeof(t=null==(n=t.bean)?void 0:n.viewId)&&t.trim()?t.trim():"",n=e.map(function(e){var t,n="string"!=typeof e.view_id&&r?I(I({},e),{view_id:r}):e,n=I(I({},n),{page_url:n.page_url||i.getCurrentEventPageUrl(),data:I(I(I({},n.data),void 0!==Qe(e)||null!=(t=n.data)&&t.replay_id||!i.getCurrentReplayId()?{}:{replay_id:i.getCurrentReplayId()}),i.mergeEventTags(null==(t=n.data)?void 0:t.tags)?{tags:i.mergeEventTags(null==(t=n.data)?void 0:t.tags)}:{})});return Ye(n,null!=(t=Qe(e))?t:Xe(i)),n}),this.lifeCycle.emit("tdemEventCreated",n),this.tdemEventPipeline(n))},v.prototype.measure=function(e,t,n){void 0===n&&(n={}),e&&"string"==typeof e?"number"==typeof t?t<0||2147483646<t?console.warn("measure: duration must between 0 and 2147483646"):this.submitMeasure(e,t,n):console.warn("measure: duration must be a number"):console.warn("measure: name must be a non-empty string")},v.prototype.startMeasure=function(e){"string"==typeof e&&e?this.timeMap[e]?console.warn("Measure "+e+" already exists"):this.timeMap[e]=Date.now():console.warn("startMeasure: name must be a non-empty string")},v.prototype.endMeasure=function(e,t){var n;void 0===t&&(t={}),"string"==typeof e&&e?void 0!==(n=this.getTimeEventDuration(e))?(this.submitMeasure(e,n,t),delete this.timeMap[e]):console.warn("Measure "+e+" does not exist"):console.warn("endMeasure: name must be a non-empty string")},v.prototype.captureMessage=function(e,t){var n;void 0===t&&(t={}),"string"==typeof e&&e?(n="error"===t.level?"error":"warn"===t.level?"warn":"info",n={event_id:A(),event_type:x.LOG,event_category:M.LOG,timestamp:Date.now(),page_url:this.getCurrentEventPageUrl(t.pageUrl),data:{log_level:n,replay_id:this.getEventReplayId(t.replayId),tags:this.sanitizeEventTags(t.tags),event_properties:this.sanitizeEventProperties(I({message:e},t.properties||{}))}},this.reportTDEMEvent(n)):console.warn("captureMessage: message must be a non-empty string")},v.prototype.captureException=function(e,t){void 0===t&&(t={});var e="string"==typeof e?new Error(e):e;e instanceof Error?(e={event_id:A(),event_type:x.JS_ERROR,event_category:M.ERROR,timestamp:Date.now(),page_url:this.getCurrentEventPageUrl(t.pageUrl),data:{exception_stacks:[{type:e.name||"Error",value:e.message,mechanism_type:"manual",mechanism_handled:1}],exception_frames:Se(e),replay_id:this.getEventReplayId(t.replayId),tags:this.sanitizeEventTags(t.tags),event_properties:this.sanitizeEventProperties(I(I({},t.properties||{}),t.level?{capture_level:t.level}:{}))}},this.reportTDEMEvent(e)):console.warn("captureException: error must be an Error or string")},v.prototype.setTags=function(e){e=this.sanitizeEventTags(e);this.setConfig({defaultTags:I(I({},this.config.defaultTags||{}),e||{})})},v.prototype.removeTags=function(e){var t,e=Array.isArray(e)?e:[e];e.length&&(t=I({},this.config.defaultTags||{}),e.forEach(function(e){delete t[e]}),this.setConfig({defaultTags:t}))},v.prototype.clearTags=function(){this.setConfig({defaultTags:{}})},v.prototype.setUser=function(e){"string"==typeof e&&e?this.setConfig({userId:e}):console.warn("setUser: userId must be a non-empty string")},v.prototype.clearUser=function(){this.setConfig({userId:"",uin:""})},v.prototype.reportStruggle=function(e){var t,n,r,i;e&&e.type&&e.ownerType&&e.ownerKey?(t=e.type,n="number"==typeof e.severity?e.severity:wt[t],r="number"==typeof e.weight?e.weight:bt[t],i=I(I({event_id:A(),event_type:x.STRUGGLE,event_category:M.BEHAVIOR,timestamp:null!=(i=null==(i=e.sourceContext)?void 0:i.timestamp)?i:Date.now(),page_url:this.getCurrentEventPageUrl(e.pageUrl)},e.sourceContext?{view_id:e.sourceContext.viewId}:{}),{data:{event_name:t,replay_id:null!=(t=null==(i=e.sourceContext)?void 0:i.replayId)?t:this.getEventReplayId(),tags:this.sanitizeEventTags(e.tags),is_effective_action:!1,related_event_ids:this.normalizeRelatedEventIds(e.relatedEventIds),payload:this.sanitizeEventPayload(e.payload,e.payloadAllowlist),struggle_weight:r,struggle_severity:n,struggle_value:"number"==typeof e.value?e.value:r*n,event_properties:I(I({},this.sanitizeStruggleProperties(e.properties)),{form_id:e.formId||"",field_id:e.fieldId||"",trigger_event_id:e.triggerEventId||"",struggle_status:e.status||"detected",struggle_owner_type:e.ownerType,struggle_owner_key:e.ownerKey,detection_source:e.detectionSource||"sdk_auto",rule_version:e.ruleVersion||this.getDefaultRuleVersion()})}}),e.sourceContext&&Ye(i,e.sourceContext.sessionId),this.reportTDEMEvent(i)):console.warn("reportStruggle params error")},v.prototype.reportFormSubmitResult=function(e){e&&e.status?(e={event_id:A(),event_type:x.FORM_SUBMIT_RESULT,event_category:M.BEHAVIOR,timestamp:Date.now(),page_url:this.getCurrentEventPageUrl(e.pageUrl),data:{event_name:e.eventName||"form_submit_"+e.status,replay_id:this.getEventReplayId(),tags:this.sanitizeEventTags(e.tags),is_effective_action:"boolean"!=typeof e.isEffectiveAction||e.isEffectiveAction,trigger_event_id:e.triggerEventId,related_event_ids:this.normalizeRelatedEventIds(e.relatedEventIds),payload:this.sanitizeEventPayload(e.payload,e.payloadAllowlist),validation_message:e.validationMessage?e.validationMessage.slice(0,256):void 0,event_properties:{status:e.status,validation_code:e.validationCode||"",form_id:e.formId||"",field_id:e.fieldId||""}}},this.reportTDEMEvent(e)):console.warn("reportFormSubmitResult params error")},v.prototype.reportPageView=function(e,t){void 0===t&&(t={});e=this.getCurrentEventPageUrl(e||t.pageUrl),e={event_id:A(),event_type:x.PAGE_VIEW,event_category:M.BEHAVIOR,timestamp:Date.now(),page_url:e,data:{page_title:t.pageTitle||"",referrer:t.referrer,replay_id:this.getEventReplayId(t.replayId),tags:this.sanitizeEventTags(t.tags),event_properties:this.sanitizeEventProperties(I(I(I(I(I(I(I({},t.properties||{}),t.navigationType?{navigation_type:t.navigationType}:{}),t.fromPage?{from_page:t.fromPage}:{}),t.toPage?{to_page:t.toPage}:{}),"boolean"==typeof t.isFirstVisit?{is_first_visit:t.isFirstVisit?"1":"0"}:{}),"boolean"==typeof t.isFirstLoad?{is_first_load:t.isFirstLoad?"1":"0"}:{}),t.deviceType?{device_type:t.deviceType}:{}))}};this.reportTDEMEvent(e)},v.prototype.setPage=function(e,t){var n;e&&"string"==typeof e?(n=this._customPageUrl||this.getCurrentEventPageUrl(),this._customPageUrl=e,this.reportPageView(e,{pageTitle:null==t?void 0:t.pageTitle,navigationType:"push",fromPage:(n||"").slice(0,512),toPage:e.slice(0,512),isFirstVisit:!1,tags:I({source:"manual",environment:this.config.env||"production",version:String(this.config.version||"")},null!=t&&t.pageGroup?{page_group:t.pageGroup}:{})}),this.lifeCycle.emit("pageChanged",{pageUrl:e,previousUrl:n,source:"manual"})):console.warn("setPage: pageUrl must be a non-empty string")},v.prototype.leavePage=function(){var e;this._customPageUrl&&(e=this._customPageUrl,this._customPageUrl=null,this.lifeCycle.emit("pageChanged",{pageUrl:this.getCurrentEventPageUrl(),previousUrl:e,source:"auto"}))},v.prototype.getCurrentEventPageUrl=function(e){var t;if(e)return e;if(this._customPageUrl)return this._customPageUrl;try{return this.getOriginFrom()}catch(e){return this.config.pageUrl||"undefined"!=typeof window&&(null==(t=window.location)?void 0:t.href)||""}},v.prototype.getCurrentReplayId=function(){var e,t;return String((null==(t=null==(t=null==(e=this.sessionManager)?void 0:e.getSession)?void 0:t.call(e))?void 0:t.replayId)||"")},v.prototype.getDefaultRuleVersion=function(){var e;return(null==(e=null==(e=this.config)?void 0:e.struggleMonitor)?void 0:e.ruleVersion)||"1.0.0"},v.prototype.getEventReplayId=function(e){return e||this.getCurrentReplayId()||void 0},v.prototype.mergeEventTags=function(e){return this.sanitizeEventTags(I(I(I({},this.config.defaultTags||{}),e||{}),{environment:_e(this.config.env)}))},v.prototype.sanitizeStringMap=function(n,r){var i;if(void 0===r&&(r=1024),n&&"object"==typeof n)return i={},Object.keys(n).forEach(function(e){var t=n[e];e&&null!=t&&(i[String(e)]=String(t).slice(0,r))}),Object.keys(i).length?i:void 0},v.prototype.sanitizeEventTags=function(e){return this.sanitizeStringMap(e,1024)},v.prototype.sanitizeEventProperties=function(e){return this.sanitizeStringMap(e,1024)},v.prototype.sanitizeStruggleProperties=function(e){var n=this.sanitizeEventProperties(e);if(n)return Object.keys(n).reduce(function(e,t){return yt.has(t)&&"custom_struggle_name"!==t||(e[t]=n[t]),e},{})},v.prototype.sanitizeEventPayload=function(n,e){var r,i=this;if(n&&"object"==typeof n)return e=(e=this.getPayloadAllowlist(e)).length?e:Object.keys(n),r={},e.forEach(function(e){var t;Object.prototype.hasOwnProperty.call(n,e)&&void 0!==(t=i.sanitizePayloadValue(n[e]))&&(r[e]=t)}),Object.keys(r).length?r:void 0},v.prototype.sanitizePayloadValue=function(n,r){var i=this;if(void 0===r&&(r=0),null!=n){if("string"==typeof n)return n.slice(0,256);if("number"==typeof n||"boolean"==typeof n)return n;if(Array.isArray(n))return n.slice(0,10).map(function(e){e=i.sanitizePayloadValue(e,r+1);return void 0===e?null:e});if("object"!=typeof n)return String(n).slice(0,256);if(2<=r)try{return JSON.stringify(n).slice(0,256)}catch(n){return}var o={};return Object.keys(n).slice(0,20).forEach(function(e){var t=i.sanitizePayloadValue(n[e],r+1);void 0!==t&&(o[e]=t)}),Object.keys(o).length?o:void 0}},v.prototype.getPayloadAllowlist=function(e){var t=null==(t=null==(t=this.config)?void 0:t.struggleMonitor)?void 0:t.payloadAllowlist;return Array.from(new Set(g(Array.isArray(t)?t:[],Array.isArray(e)?e:[]).filter(function(e){return!!e})))},v.prototype.normalizeRelatedEventIds=function(e){return Array.isArray(e)&&e.length&&(e=Array.from(new Set(e.filter(function(e){return"string"==typeof e&&e})))).length?e:void 0},v.prototype.ready=function(e,t,n){throw new Error('You need to override "ready" method')},v.prototype.request=function(e,t,n){throw new Error('You need to override "request" method')},v.prototype.speedLogPipeline=function(e){throw new Error('You need to override "speedLogPipeline" method')},v.prototype.getOriginFrom=function(){throw new Error('You need to override "getOriginFrom" method')},Object.defineProperty(v.prototype,"__version__",{get:function(){return"1.0.16"},enumerable:!1,configurable:!0}),v.prototype.submitMeasure=function(e,t,n){void 0===n&&(n={});e={event_id:A(),event_type:x.CUSTOM,event_category:M.CUSTOM,timestamp:Date.now(),page_url:this.getCurrentEventPageUrl(n.pageUrl),data:{event_name:e,measurements:{duration:t},replay_id:this.getEventReplayId(n.replayId),tags:this.sanitizeEventTags(n.tags),payload:this.sanitizeEventPayload(n.payload),event_properties:this.sanitizeEventProperties(n.properties)}};this.reportTDEMEvent(e)},v.prototype.getTimeEventDuration=function(e){if(void 0!==e&&this.timeMap[e])return Date.now()-this.timeMap[e]},v.version="1.0.16",v.instances=[],v.environment=be,v.installedPlugins=[],v),e=(Et.prototype.patch=function(e){this.canUse(e)&&this.exist(e)&&(this.instances.push(e),this.triggerInit(e),this.triggerOnNewTdem(e))},Et.prototype.unpatch=function(e){var t=this.instances.indexOf(e);-1!==t&&(this.instances.splice(t,1),0===this.instances.length)&&this.uninstall(e)},Et.prototype.countInstance=function(){return this.instances.length},Et.prototype.uninstall=function(e){var t;null!=(t=null==(t=this.option)?void 0:t.destroy)&&t.apply(this,[e])},Et.prototype.walk=function(n){var r=this;this.instances.forEach(function(e){var t=r.canUse(e);t&&n(e,t)})},Et.prototype.canUse=function(e){e=this.getConfig(e);return!(!e||"object"!=typeof e)||!!e},Et.prototype.getConfig=function(e){return null==(e=e.config)?void 0:e[this.name]},Et.prototype.exist=function(e){return-1===this.instances.indexOf(e)},Et.prototype.triggerInit=function(e){var t;this.inited||(this.inited=!0,null==(t=null==(t=this.option)?void 0:t.init))||t.call(this.option,this.getConfig(e))},Et.prototype.triggerOnNewTdem=function(e){var t;null!=(t=null==(t=this.option)?void 0:t.onNewTdem)&&t.call(this.option,e,this.getConfig(e))},Et),_t=["req_dial_links","req_dial_links_truncated","dns_dial_links","dns_dial_links_truncated"],St=new e({name:"aid",aid:"",init:function(e){try{var t=!0!==e&&e||window.localStorage.getItem("TDEM_ID");t||(t=je(),window.localStorage.setItem("TDEM_ID",t)),this.aid=t}catch(e){}},onNewTdem:function(e){e.bean.aid=this.aid,e.config.aid=this.aid}});function Et(e){this.tdemPlugin=!0,this.name="",this.instances=[],this.inited=!1,e.$walk=this.walk.bind(this),e.$getConfig=this.getConfig.bind(this),this.option=e,this.name=e.name}function v(e,t){var i,o,s,a,n,l,r,u,c,d,f,h,p,m;void 0===t&&(t={}),this.sdkName="tdem-web-sdk",this.sdkVersion=v.version,this.isGetSample=!1,this.isHidden=!1,this.config={version:0,delay:1e3,onError:!0,repeat:60,random:1,aid:!0,device:!0,pagePerformance:!0,webVitals:!0,lagMonitor:!0,blankScreen:!0,memoryMonitor:!0,speedSample:!0,onClose:!0,reportLoadPackageSpeed:!0,env:"production",url:"",reportImmediately:!0,tdemConfig:!0,hostUrl:"https://dem.rumt-zh.com",offlineUrl:"",whiteListUrl:"",pvUrl:"",speedUrl:"",customTimeUrl:"",performanceUrl:"",performanceUrlForHippy:"",webVitalsUrl:"",eventUrl:"",setDataReportUrl:""},this.isWhiteList=!1,this.lifeCycle=new Z,this.bean={},this.internalRetrySchedule=ke,this._customPageUrl=null,this.tdemEventPipeline=dt([(s=o=!1,a=[],n=function(e,t){var n,r;Array.isArray(e)&&0===e.length?t(e):(n=ut(i))?Array.isArray(e)?(r=e.filter(function(e){return st(lt(e,i),n,Math.random,ct(i))})).length&&t(r):st(lt(e,i),n,Math.random,ct(i))&&t(e):o?s&&t(e):a.length<1e3&&a.push({event:e,resolve:t})},(i=this)._tdemSampleGate={decide:function(e){o=!0,s=e;e=a;a=[],ut(i)?e.forEach(function(e){var t=e.event;return n(t,e.resolve)}):s&&e.forEach(function(e){var t=e.event;return(0,e.resolve)(t)})},reDecide:function(e){return!!ut(i)||(e<=0?s=!1:100<=e?s=!0:s=100*Math.random()<e)},get isDecided(){return o||!!ut(i)},get isSampled(){return s}},function(e,t){n(e,t)}),(r=this,u=20,f=Math.max(Number(u)||1,1),h=[],m=!(p=function(){}),function(e,t){function n(){for(clearTimeout(c),clearTimeout(d),d=c=void 0;0<h.length;)t(h.splice(0,f))}e=Array.isArray(e)?e:[e];h.push.apply(h,e);p=n,!m&&e.some(function(e){return e.event_type===x.PAGE_VIEW})?(m=!0,n()):r.sendNow&&0<h.length?n():0!==e.length?f<=h.length?n():0!==h.length&&(clearTimeout(c),c=setTimeout(function(){0<h.length&&p()},5e3),d=d||setTimeout(function(){0<h.length&&p()},3e4)):0<h.length&&n()}),function(t,n){try{var e,r=JSON.parse(JSON.stringify(t)),i=(l.lifeCycle.emit("beforeReport",r),l.config.beforeReport);"function"==typeof i?0<(e=t.filter(function(e){return!1!==i(e)})).length&&n(e):n(t)}catch(e){n(t)}},et(l=this)]),this.timeMap={},this.failRequestCount=0,this.internalTransport=t.transport,this.internalRetrySchedule=t.retrySchedule||ke,v.instances.push(this)}function P(e){return e=e.sessionManager,[(null==(t=null==(t=null==e?void 0:e.getSession)?void 0:t.call(e))?void 0:t.replayId)||"",null==t||t.id,!t||t.sampled,null==t||t.sampled][0];var t}function t(e){return-1!==Tt.indexOf(e)}var Ct=new e({name:"assets"}),Rt=Ct=new e({name:"assets",collectCur:0,collectEntryType:"resource",ASSETS_INITIATOR_TYPE:["img","css","script","link","audio","video"],getFromParam:function(e){var t;return(null==(t=e.getOriginFrom)?void 0:t.call(e))||window.location.href},onNewTdem:function(e){var t=this;pt()&&(setTimeout(function(){t.collectSuccessLog(e),t.collectFailLog(e)},5e3),performance.onresourcetimingbufferfull=function(){"function"==typeof performance.clearResourceTimings&&(t.collectCur=0,performance.clearResourceTimings())})},processLog:function(e,t){var n=t.duration||0,r=t.transferSize||0,n={event_id:A(),event_type:x.RESOURCE_LOAD,event_category:M.NETWORK,timestamp:Date.now(),page_url:t.from||window.location.href,data:{url:t.url,resource_type:t.type||"static",measurements:{duration:n,dns_time:t.domainLookup,tcp_time:t.connectTime,transfer_size:0<r?r:void 0},replay_id:P(e),tags:{environment:e.config.env||"production",is_https:t.isHttps?"true":"false"},event_properties:{is_cached:String(0===r),protocol:t.nextHopProtocol||"",http_status:String(t.status||0)}}};null!=(r=e.reportTDEMEvent)&&r.call(e,n)},publish:function(t,n){var r=this;this.$walk(function(e){e===n&&(Array.isArray(t)?t.forEach(r.processLog):r.processLog(n,t))})},publishMany:function(e,t){for(var n=t.config,r=this.getFromParam(t),i=0,o=e.length;i<o;i++){var s=e[i];-1===this.ASSETS_INITIATOR_TYPE.indexOf(s.initiatorType)||le(s.name,n.hostUrl)||this.publish(this.generateLog(s,n,r),t)}},collectSuccessLog:function(n){var e,t,r=this;"function"==typeof window.PerformanceObserver?(this.publishMany(performance.getEntriesByType(this.collectEntryType),n),(e=new window.PerformanceObserver(function(e){r.publishMany(e.getEntries(),n)})).observe({entryTypes:[this.collectEntryType]}),n.lifeCycle.on("destroy",function(){0===Ct.countInstance()&&e.disconnect()})):(t=setInterval(function(){var e=performance.getEntriesByType(r.collectEntryType),t=e.slice(r.collectCur);r.collectCur=e.length,r.publishMany(t,n)},3e3),n.lifeCycle.on("destroy",function(){0===Ct.countInstance()&&clearInterval(t)}))},collectFailLog:function(i){function e(e){var t,n,r;e&&(e=e.target||e.srcElement,!(t=(null==e?void 0:e.src)||(null==e?void 0:e.href))||"string"!=typeof t||-1<window.location.href.indexOf(t)||(e="function"==typeof(null==(e=s.api)?void 0:e.resourceTypeHandler)?null==e?void 0:e.resourceTypeHandler(t):"",r=performance.getEntriesByType(o.collectEntryType).find(function(e){return e.name===t}),le(t,s.hostUrl))||(n=o.getFromParam(i),r={url:te(t),status:400,duration:Number(((null==r?void 0:r.duration)||0).toFixed(2)),method:"get",type:e||"static",isHttps:ne(t),urlQuery:ee(t,!0),nextHopProtocol:"",domainLookup:0,connectTime:0,from:n},o.publish(r,i)))}var o=this,s=i.config;window.document.addEventListener("error",e,!0),i.lifeCycle.on("destroy",function(){0===Ct.countInstance()&&window.document.removeEventListener("error",e,!0)})},generateLog:function(e,t,n){var t="function"==typeof(null==(r=t.api)?void 0:r.resourceTypeHandler)?null==(r=t.api)?void 0:r.resourceTypeHandler(e.name):"",r=e.transferSize;return{url:te(e.name),method:"get",duration:Number(e.duration.toFixed(2)),status:200,type:t||"static",isHttps:ne(e.name),nextHopProtocol:e.nextHopProtocol||"",urlQuery:ee(e.name,!0),domainLookup:X(e.domainLookupEnd-e.domainLookupStart),connectTime:X(e.connectEnd-e.connectStart),transferSize:0<r?r:-1,from:n}},collectNotReportedLog:function(e){var t,n;pt()&&(t=(n=performance.getEntriesByType(this.collectEntryType)).length,"function"!=typeof window.PerformanceObserver)&&this.collectCur!==t&&(n=n.slice(this.collectCur),this.collectCur=t,this.publishMany(n,e))},destroy:function(){this.option.publish=function(){}}}),Tt=window.navigator.userAgent.toLowerCase(),l={};function Ot(){return{host:new URL(location.href).host,pathname:location.pathname}}l.macos=function(){return t("mac")},l.ios=function(){return l.iphone()||l.ipod()||l.ipad()},l.iphone=function(){return!l.windows()&&t("iphone")},l.ipod=function(){return t("ipod")},l.ipad=function(){var e="MacIntel"===navigator.platform&&1<navigator.maxTouchPoints;return t("ipad")||e},l.android=function(){return!l.windows()&&t("android")},l.androidPhone=function(){return l.android()&&t("mobile")},l.androidTablet=function(){return l.android()&&!t("mobile")},l.blackberry=function(){return t("blackberry")||t("bb10")},l.blackberryPhone=function(){return l.blackberry()&&!t("tablet")},l.blackberryTablet=function(){return l.blackberry()&&t("tablet")},l.windows=function(){return t("windows")},l.windowsPhone=function(){return l.windows()&&t("phone")},l.windowsTablet=function(){return l.windows()&&t("touch")&&!l.windowsPhone()},l.fxos=function(){return(t("(mobile")||t("(tablet"))&&t(" rv:")},l.fxosPhone=function(){return l.fxos()&&t("mobile")},l.fxosTablet=function(){return l.fxos()&&t("tablet")},l.meego=function(){return t("meego")},l.cordova=function(){return window.cordova&&"file:"===location.protocol},l.nodeWebkit=function(){return"object"==typeof window.process},l.mobile=function(){return l.androidPhone()||l.iphone()||l.ipod()||l.windowsPhone()||l.blackberryPhone()||l.fxosPhone()||l.meego()},l.tablet=function(){return l.ipad()||l.androidTablet()||l.blackberryTablet()||l.windowsTablet()||l.fxosTablet()},l.desktop=function(){return!l.tablet()&&!l.mobile()};var xt,It,Mt,At,Pt=!(l.isIE=function(){return"ActiveXObject"in window}),Dt=[],Lt=/^\/[^/]/;function Nt(e,t){return At(e,t)}var Ft=!1,Ut=[];function zt(e){var n;return e?"undefined"!=typeof Headers&&e instanceof Headers?(n={},e.forEach(function(e,t){n[t]=e,n[t.toLowerCase()]=e}),n):Array.isArray(e)?e.reduce(function(e,t){return t&&t[0]&&(e[String(t[0])]=String(t[1])),e},{}):I({},e):{}}function Bt(r,e,i){return null!=e&&e.length&&"object"==typeof r?e.reduce(function(e,t){var n=window.Headers&&r instanceof Headers?r.get(t):r[t];return n?e+(""===e?"":"\n\n")+i+" header "+t+": "+n:e},""):""}function jt(t,e){var n=rn.capture(),r=Date.now();en.forEach(function(e,t){12e4<r-e.created&&en.delete(t)}),1e3<=en.size&&en.delete(en.keys().next().value);var i,o="cgi-"+r.toString(16)+"-"+Math.random().toString(16).slice(2)+"-"+(++tn).toString(16),s="undefined"!=typeof globalThis?globalThis.performance:void 0,a=new Set;try{s.getEntriesByType("resource").forEach(function(e){e.name===t&&a.add(nn(e))})}catch(t){}try{"function"==typeof s.now&&(i=s.now())}catch(t){}var l=!1;return en.forEach(function(e){e.finished||e.url!==t||(e.ambiguous=!0,l=!0)}),en.set(o,{id:o,owner:n,url:t,lower:i,existing:a,ambiguous:l,created:r,initiatorType:e}),o}function Wt(t,e){var n;void 0===e?(n=Array.from(en.values()).find(function(e){return e.url===t}))&&en.delete(n.id):en.delete(e)}function Ht(e,t,n){return an(e,t,n).dnsTimeMs}function qt(s,a){var l,u,c,t,e,n=en.get(s.requestId),d=n?n.owner:null;n&&(s.willReport||rn.isCurrent(d))?(t=function(e){void 0===e&&(e=!1);function t(e){Wt(s.url,s.requestId),a(rn.isCurrent(d)?e:{},i)}var n,r=I(I({},s),{timingUnavailable:e}),i=e?void 0:Ht(s.url,s.startedAtMs,s.requestId),o=(e=r,r={ms:i},(o=void 0===(o=d)?rn.capture():o)&&rn.isCurrent(o)?(n=Number(e.statusCode)||0,r=r.ms,rn.invoke(o,I(I({requestId:e.requestId,source:"renderer_fetch_xhr",host:sn(e.url),url:e.url,statusCode:n,errorCode:"",durationMs:e.durationMs},void 0!==r?{dnsTimeMs:r}:{}),{willReport:e.willReport,process:"renderer",startedAtMs:e.startedAtMs}),200)):{});o&&"function"==typeof o.then?o.then(t,function(){return t({})}):t(o)},s.transportFailure?t(!0):(l=s.url,u=s.startedAtMs,c=s.requestId,e=(n="undefined"!=typeof globalThis?globalThis:{}).document,n=n.performance,"settled"===(e=null!=e&&null!=n&&"function"==typeof n.getEntriesByType&&an(l,u,c).pendingEntry?new Promise(function(t){var n,e=Date.now()+200,r=0,i=!1,o=function(e){i||(i=!0,void 0!==n&&clearTimeout(n),t(e))},s=function(){200<=r||Date.now()>=e?o("timeout"):an(l,u,c).pendingEntry?(r+=50,n=setTimeout(s,50)):o("settled")};i||(n=setTimeout(s,0))}):"settled")?t():e.then(function(e){return t("timeout"===e)},function(){return t()}))):(Wt(s.url,s.requestId),a({},void 0))}function Vt(e,t){return e&&-1===["null","undefined"].indexOf(e)?t+": "+e:""}function Gt(e,t,n){void 0===t&&(t="");var r,i,e="function"==typeof(null==(i=e.api)?void 0:i.resourceTypeHandler)?null==(i=e.api)?void 0:i.resourceTypeHandler(n):"";return-1===V.indexOf(e)&&(r=void 0===t?"":t,i=(void 0===n?"":n).split("?")[0],e=de.test(i)||ce.some(function(e){return-1!==String(r).indexOf(e)})?"static":"fetch"),e}function Zt(e,t){return e?un.AJAX_ERROR:t?un.RET_ERROR:un.API_RESPONSE}function Jt(e,t,n){if(!e)return!1;if(null!=(t=null==t?void 0:t.api)&&t.isSlowApi&&"function"==typeof(null==t?void 0:t.isSlowApi))try{return t.isSlowApi(n||{duration:e})}catch(e){return console.warn("[TDEM] isSlowApi function happen error:",e,", this data will not be reported."),!1}return(n=null!=(n=null==t?void 0:t.slowThreshold)?n:null==t?void 0:t.apiSlowThreshold)&&"number"==typeof n?n<e:1e3<e}function Kt(e,t){if(null!=(e=e.api)&&e.usePerformanceTiming&&"string"==typeof t.url){e=null==(e=performance.getEntriesByName(t.url))?void 0:e.pop();if(e)return{url:t.url,isHttps:ne(t.url),method:t.method,type:t.type,status:t.status,duration:Number(e.duration.toFixed(2)),nextHopProtocol:e.nextHopProtocol||"",domainLookup:X(e.domainLookupEnd-e.domainLookupStart),connectTime:X(e.connectEnd-e.connectStart)}}return{url:t.url,isHttps:ne(t.url),method:t.method,type:t.type,status:t.status,duration:Number(t.duration.toFixed(2)),nextHopProtocol:"",domainLookup:B.number,connectTime:B.number}}var $t,Xt,Yt,Qt,en=new Map,tn=0,nn=function(e){return e.startTime+":"+e.responseEnd},rn=($t=null,{register:function(e,t){if(void 0===t&&(t={}),"function"!=typeof e)throw new TypeError("A request finalizer must be a function");if($t&&!0!==t.replace)throw new Error("A request finalizer is already registered");var n={handler:e,pending:new Set};return Yt(n),function(){$t===n&&Yt(null)}},capture:function(){return $t},isCurrent:Xt=function(e){return null!==e&&$t===e},onInvalidated:Qt=function(e,t){var n;return Xt(e)?((n=$t).pending.add(t),function(){n.pending.delete(t)}):(t(),function(){})},invokeSync:function(e,t){if(!e||!Xt(e))return{};try{var n=e.handler(t);return n&&"function"==typeof n.then?(Promise.resolve(n).catch(function(){}),{}):Xt(e)?ht(n):{}}catch(e){return{}}},invoke:function(s,e,t){if(!s||!Xt(s))return{};try{var a=s.handler(e);return a&&"function"==typeof a.then?new Promise(function(n){function e(e){if(!r){r=!0,clearTimeout(o),i();var t={};try{Xt(s)&&(t=ht(e))}catch(e){}n(t)}}var r=!1,i=function(){},o=setTimeout(function(){return e()},t),i=Qt(s,function(){return e()});Promise.resolve(a).then(e,function(){return e()})}):Xt(s)?ht(a):{}}catch(s){return{}}}}),on=rn.register,sn=function(e){try{return new URL(e).hostname||""}catch(e){return""}},an=function(n,r,e){if((t=sn(n))&&(0<=t.indexOf(":")||4===(t=t.split(".")).length&&t.every(function(e){return/^\d{1,3}$/.test(e)&&Number(e)<=255})))return{pendingEntry:!1};var t=Array.from(en.values()).filter(function(e){return!e.finished&&e.url===n}),i=e?en.get(e):1===t.length?t[0]:void 0;if(i&&i.ambiguous||1<t.length)return{pendingEntry:!1};e="undefined"!=typeof globalThis&&globalThis.performance?globalThis.performance:"undefined"!=typeof performance?performance:void 0;if(!e||"function"!=typeof e.getEntriesByType)return{pendingEntry:!1};var o,t=[];try{var s=Number(e.timeOrigin),a=Number.isFinite(s)&&0<s,t=e.getEntriesByType("resource").filter(function(e){var t;return!(!e||e.name!==n||i&&i.initiatorType&&e.initiatorType!==i.initiatorType||i&&i.existing.has(nn(e))||(e=Number(e.startTime||0),t=a?s+e:e,!(i&&void 0!==i.lower?e>=i.lower:r<=t&&t<r+1)))})}catch(n){return{pendingEntry:!1}}return 1<t.length?{pendingEntry:!1}:0===t.length?{pendingEntry:!0}:(e=t[0],0<Number(e.redirectStart)||0<Number(e.redirectEnd)||(t=Number(e.domainLookupStart),o=Number(e.domainLookupEnd),!Number.isFinite(t))||!Number.isFinite(o)||o<t?{pendingEntry:!1}:(e=0<Number(e.requestStart)||0<Number(e.connectEnd),o===t?e?{dnsTimeMs:0,pendingEntry:!1}:{pendingEntry:!1}:{dnsTimeMs:o-t,pendingEntry:!1}))},ln={maxRetryCount:10,retryInterval:function(e){return 1e3*(2<<e)},whenRetryEndStillFail:"discard"},un={API_RESPONSE:"api_response",AJAX_ERROR:"ajax_error",RET_ERROR:"ret_error",SLOW_NET_REQUEST:"slow_net_request"};function cn(e){return!e||"boolean"==typeof e||"number"!=typeof(e=e.sseStallThresholdMs)||!Number.isFinite(e)||e<=0?6e4:e}function dn(e){return e&&"text/event-stream"===e.split(";")[0].trim().toLowerCase()}function fn(e){return"string"==typeof e&&""!==e.trim()}function hn(e){var t=String(e.requestUrl||""),n=String(e.finalUrl||""),r=t&&ee(t)||t,i=n&&ee(n)||n||r,n=!0===e.redirected||!!n&&!!t&&n!==t;return{url:i,originalUrl:r&&i&&r!==i?r:void 0,httpMethod:String(e.httpMethod||"GET").toUpperCase(),redirectCount:n?1:0}}function pn(n){function r(){b();var e=n.stallThresholdMs;0<e&&(u=setTimeout(function(){t("stalled")},e))}function i(){var e,t,n=f();void 0===o?o=n:void 0!==s&&(e=n-s,(void 0===a||a<e)&&(a=e),t=p,(e=e)<500?t.gap_lt_500_count+=1:e<1e3?t.gap_500_999_count+=1:e<3e3?t.gap_1000_2999_count+=1:e<1e4?t.gap_3000_9999_count+=1:e<6e4?t.gap_10000_59999_count+=1:t.gap_ge_60000_count+=1),s=n,g+=1,r()}function t(e){if(!y){y=!0,b(),w.splice(0).forEach(function(e){try{e()}catch(e){}});var t=Math.max(0,f()-h),t=I({duration:t,redirect_count:Math.max(0,n.redirectCount||0),message_count:g,stall_threshold_ms:n.stallThresholdMs},p),e=(void 0!==o&&(t.time_to_first_message=Math.max(0,o-h)),void 0!==s&&(t.last_message_offset=Math.max(0,s-h)),void 0!==a&&(t.max_message_gap=a),{http_method:n.httpMethod||"GET",outcome:e,model_version:d}),t=(void 0!==l&&0<l&&(e.http_status=String(l)),n.originalUrl&&n.originalUrl!==n.url&&(e.original_url=n.originalUrl),{event_id:A(),event_type:x.SSE_CALL,event_category:M.NETWORK,timestamp:f(),page_url:n.pageUrl||"",data:{url:n.url,resource_type:"sse",measurements:t,replay_id:n.replayId||void 0,event_properties:e}});try{n.report(t)}catch(e){}}}e=n.llmVersion;var o,s,a,l,u,e,c,d=(e=String(null==e?"":e).trim())?(c=Array.from(e)).length<=128?e:c.slice(0,128).join(""):"unknown",f=n.now||Date.now,h=f(),p={gap_lt_500_count:0,gap_500_999_count:0,gap_1000_2999_count:0,gap_3000_9999_count:0,gap_10000_59999_count:0,gap_ge_60000_count:0},m="",v=!1,g=0,y=!1,w=[],b=function(){void 0!==u&&(clearTimeout(u),u=void 0)};return r(),{ingestText:function(e){if(!y){e=e.replace(/\r\n/g,"\n");if(v){var t=e.indexOf("\n\n");if(-1===t)return;v=!1,e=e.slice(t+2)}for(var n=(m=(m+=e).replace(/\r\n/g,"\n")).indexOf("\n\n");-1!==n;){var r=m.slice(0,n);m=m.slice(n+2),r.replace(/\r\n/g,"\n").split("\n").some(function(e){return e.startsWith("data:")||"data"===e})&&i(),n=m.indexOf("\n\n")}1048576<m.length&&(v=!(m=""))}},ingestCompleteMessage:function(){y||i()},noteHttpStatus:function(e){0<e&&(l=e)},succeed:function(){return t("success")},failTransport:function(){return t("transport_error")},httpError:function(){return t("http_error")},cancel:function(){return t("cancelled")},pauseStall:function(){y||b()},resumeStall:function(){y||r()},onSeal:function(t){if(y){try{t()}catch(t){}return function(){}}return w.push(t),function(){var e=w.indexOf(t);-1!==e&&w.splice(e,1)}},seal:t,get sealed(){return y},get messageCount(){return g},get httpStatus(){return l}}}function mn(f,h){var p;return D(this,void 0,void 0,function(){var i,o,s,a,l,u,c,d;return L(this,function(e){switch(e.label){case 0:if(!f||"function"!=typeof f.getReader)return h.succeed(),[2];i=f.getReader(),s=o=!1,a=function(){if(!o&&!s&&"function"==typeof i.cancel){s=!0;try{var e=i.cancel();e&&"function"==typeof e.catch&&e.catch(function(){})}catch(e){}}},l=h.onSeal(a),u="undefined"!=typeof TextDecoder?new TextDecoder:{decode:function(e){return"undefined"!=typeof Buffer?Buffer.from(e).toString("utf8"):Array.from(e).map(function(e){return String.fromCharCode(e)}).join("")}},e.label=1;case 1:e.trys.push([1,5,6,7]),e.label=2;case 2:return h.sealed?[3,4]:[4,i.read()];case 3:return c=e.sent(),d=c.done,c=c.value,d?(o=!0,h.succeed(),[2]):(c&&h.ingestText(u.decode(c,{stream:!0})),[3,2]);case 4:return[3,7];case 5:return d=e.sent(),h.sealed||h[n=h.messageCount,r=h.httpStatus,!(t=d)||"object"!=typeof t||"AbortError"!==t.name&&"ABORT_ERR"!==t.code&&"ECONNABORTED"!==t.code&&!0!==t.aborted?(0<n||"number"==typeof r&&200<=r&&r<400)&&((e=>{if(fn(e)&&-1!==e.toLowerCase().indexOf("terminated"))return 1;for(var t=e,n=new Set;t&&"object"==typeof t&&!n.has(t);){n.add(t);var r=String(t.name||""),i=String(t.code||""),o=String(t.message||"").toLowerCase();if("TypeError"===r&&-1!==o.indexOf("terminated"))return 1;if("ERR_INVALID_STATE"===i)return 1;t=t.cause}})(t)||fn(t))?"succeed":"failTransport":"cancel"](),[3,7];case 6:l(),a();try{null!=(p=i.releaseLock)&&p.call(i)}catch(t){}return[7];case 7:return[2]}var t,n,r})})}var vn,gn,yn=!(Yt=function(e){var t=$t;$t=e,t&&(Array.from(t.pending).forEach(function(e){return e()}),t.pending.clear())});function wn(e){var t=e.__tdemXhrHooks;t&&(e.removeEventListener("readystatechange",t.onReadyStateChange),e.removeEventListener("progress",t.onProgress),e.removeEventListener("loadend",t.onLoadEnd),e.removeEventListener("abort",t.onAbort),e.removeEventListener("error",t.onError),e.removeEventListener("timeout",t.onTimeout),e.__tdemXhrHooks=void 0)}function bn(e){var t=String(e.responseType||"").toLowerCase();if(!t||"text"===t)try{return"string"==typeof e.responseText?e.responseText:""}catch(e){}}new e({name:"api"});var kn,_n,Sn,En=new e({name:"api",override:!1,onNewTdem:function(e){var t,n;this.override||(this.override=!0,null!=(n=e.config.api)&&n.injectTraceHeader&&(this.traceRequestHeader=new Ze(n.injectTraceHeader,null!=(t=null==n?void 0:n.injectTraceIgnoreUrls)?t:[],null==n?void 0:n.injectTraceUrls,null==n?void 0:n.traceFlag)),this.overrideFetch(e.config,e),this.overrideXhr(e.config,e),!1!==n&&this.overrideEventSource(e.config,e))},getFromParam:function(e){var t;return(null==(t=e.getOriginFrom)?void 0:t.call(e))||window.location.href},currentViewId:function(e){var t=null!=(e=null!=(t=e.viewId)?t:null==(t=e.bean)?void 0:t.viewId)?e:"";return String(t||"")},rememberViewId:function(e,t){e&&(e.__tdemViewId=this.currentViewId(t))},reportWithStartedView:function(e,t,n){var n=String((null==n?void 0:n.__tdemViewId)||(null==t?void 0:t.view_id)||""),t=!n||null!=t&&t.view_id?t:I(I({},t),{view_id:n});null!=(n=e.reportTDEMEvent)&&n.call(e,t)},overrideFetch:function(C,R){var T=this,a=C.api,e={name:this.name,traceRequestHeader:null!=a&&a.injectTraceHeader?this.traceRequestHeader:null,shouldInjectTrace:function(){return at(R)},getCurrentFrom:function(){return T.getFromParam(R)},beforeFetch:function(e,t){le(e,C.hostUrl)||(t.__tdemRequestId=jt(e,"fetch")),T.rememberViewId(t,R)},cloneError:function(e,t,n,r,i,o){var s;le(n,C.hostUrl)||(s=e.headers?e.headers.get("content-type"):"",!1!==a&&dn(s)?(Wt(n,null==(s=r)?void 0:s.__tdemRequestId),(s=pn({url:(s=hn({requestUrl:n,finalUrl:e&&e.url,httpMethod:null==r?void 0:r.method,redirected:!!e.redirected})).url,originalUrl:s.originalUrl,httpMethod:s.httpMethod,redirectCount:s.redirectCount,stallThresholdMs:cn(a),report:function(e){return T.reportWithStartedView(R,e,r)},pageUrl:o||T.getFromParam(R),replayId:P(R),llmVersion:C.llmVersion})).noteHttpStatus(e.status),400<=e.status?s.httpError():s.succeed()):qt({requestId:(null==(o=r)?void 0:o.__tdemRequestId)||"",url:n,statusCode:e.status||0,durationMs:t,startedAtMs:Number(i)||0,willReport:!1},function(){}))},then:function(v,g,y,w,b,k,_){if(!le(y,C.hostUrl)){var e,t,S=(null==(n=w)?void 0:n.__tdemRequestId)||"",n=(w&&(w.__tdemRequestId=S),v.headers?v.headers.get("content-type"):"");if(!1!==a&&dn(n))return Wt(y,S),e=hn({requestUrl:y,finalUrl:v&&v.url,httpMethod:null==w?void 0:w.method,redirected:!!v.redirected}),(t=pn({url:e.url,originalUrl:e.originalUrl,httpMethod:e.httpMethod,redirectCount:e.redirectCount,stallThresholdMs:cn(a),report:function(e){return T.reportWithStartedView(R,e,w)},pageUrl:k||T.getFromParam(R),replayId:P(R),llmVersion:C.llmVersion})).noteHttpStatus(v.status),v.__tdemSseObserver=t,400<=v.status?(t.httpError(),void mn(v.body,t).catch(function(){})):void mn(v.body,t).catch(function(){t.sealed||t.failTransport()});var E=Gt(C,n||"",y);"fetch"===E?Promise.resolve().then(function(){return v.clone().text()}).then(function(s){var e,a=v.status<=0||400<=v.status,t=(null==(t=C.api)?void 0:t.reqHeaders)||[],l=Bt(null==w?void 0:w.headers,t,"req"),t=(null==(t=C.api)?void 0:t.resHeaders)||[],u=Bt(v.headers,t,"res"),t=qe(null==w?void 0:w.headers),c=t.traceId,d=t.spanId,t=re(s,C.api,{url:y,ctx:v,payload:null==w?void 0:w.body}),f=t.code,h=t.isErr,t=null==(t=C.api)?void 0:t.apiDetail,p=t?oe(null==w?void 0:w.body,null==(e=C.api)?void 0:e.reqParamHandler,{url:y}):"",m=t?oe(s,null==(e=C.api)?void 0:e.resBodyHandler,{url:y,ctx:v}):"";setTimeout(function(){var n=Kt(C,{url:y,duration:g,type:E,status:v.status||0,method:(null==w?void 0:w.method)||"get"}),e=[a?"FETCH_ERROR: "+s:"","fetch req url: "+y,"res status: "+(n.status||0),"res duration: "+n.duration+"ms","res startTime: "+b,l,u,"req method: "+(n.method||"GET"),"res retcode: "+f,Vt(p,"req param"),Vt(m,"res data")].filter(function(e){return e}).join("\n\n"),r=(n.payload=null==w?void 0:w.body,n.ret=f,n.isErr=+h,n.from=k||T.getFromParam(R),{msg:e,code:f,trace:c,spanId:d,errorMsg:"",from:k||T.getFromParam(R),originFrom:_,viewId:null==(e=w)?void 0:e.__tdemViewId,level:un.API_RESPONSE}),e=Jt(null==n?void 0:n.duration,C,n),t=Zt(a,h);r.level=t===un.API_RESPONSE&&e?un.SLOW_NET_REQUEST:t,r.isErr=h;var i=e||r.level!==un.API_RESPONSE,o=null==(t=R.config)?void 0:t.api;qt({requestId:S,url:y,statusCode:n.status||0,durationMs:Number(n.duration)||0,startedAtMs:Number(b)||0,willReport:!!(i||R.isWhiteList||null!=o&&o.reportRequest||null!=o&&o.injectTraceHeader),transportFailure:!(0<v.status)},function(e,t){e&&Object.keys(e).length&&(r.dialFields=e),null!=t&&(r.dnsTime=t),(i||R.isWhiteList||null!=o&&o.reportRequest||null!=o&&o.injectTraceHeader)&&T.publishNormalLog(r,R),T.publishSpeed(n,R)})},0)}).catch(function(){qt({requestId:S,url:y,statusCode:v.status||0,durationMs:g,startedAtMs:Number(b)||0,willReport:!1},function(){})}):(Wt(y,S),setTimeout(function(){var e=Kt(C,{url:y,duration:g,type:E,status:v.status||0,method:(null==w?void 0:w.method)||"get"});e.type="static",e.urlQuery=ee(y,!0),e.from=k||T.getFromParam(R),T.publishSpeed(e,R)},0))}},catch:function(e,t,i,o,s,a,l){if(le(i,C.hostUrl))throw e;var u,c,n,d,f,h,p=(null==(n=o)?void 0:n.__tdemRequestId)||"";if((n=en.get(p))&&(n.finished=!0),"AbortError"!==(e&&e.name))throw u=Gt(C,"",i),n=(null==(n=C.api)?void 0:n.reqHeaders)||[],c=Bt(null==o?void 0:o.headers,n,"req"),n=qe(null==o?void 0:o.headers),d=n.traceId,f=n.spanId,h=null!=(n=C.api)&&n.apiDetail?oe(null==o?void 0:o.body,null==(n=C.api)?void 0:n.reqParamHandler,{url:i}):"",setTimeout(function(){var n=Kt(C,{url:i,duration:t,type:u,status:0,method:(null==o?void 0:o.method)||"get"}),r=(n.from=a||T.getFromParam(R),"AJAX_ERROR: "+e+"\n \nreq url: "+i+"\n \nres status: 0\n \nres duration: "+n.duration+"ms\n \nreq method: "+((null==o?void 0:o.method)||"get")+"\n \nreq param: "+h+"\n \nres startTime: "+s+"\n \n"+c);qt({requestId:p,url:i,statusCode:0,durationMs:Number(n.duration)||0,startedAtMs:Number(s)||0,willReport:!0,transportFailure:!0},function(e){var t;T.publishSpeed(n,R),T.publishNormalLog({msg:r,level:un.AJAX_ERROR,code:-400,trace:d,spanId:f,errorMsg:"",from:a||T.getFromParam(R),originFrom:l,viewId:null==(t=o)?void 0:t.__tdemViewId,dialFields:e},R)})},0),e;Wt(i,p)}},O=(this.hackFetchOptions=e,this.hackFetchOptions),x=null==(e=C.api)?void 0:e.ignoreHackReg;if(void 0===x&&(x=/\.flv(\?|$)/i),Ut.find(function(e){return e.name===O.name}))throw new Error("name '"+O.name+"' is already in hackFetch option list");Ut.push(O),!Ft&&window.fetch&&(Ft=!0,At=window.fetch,window.fetch=function(e,t){void 0===t&&(t={});var n,i="string"==typeof e?e:e&&"object"==typeof e?"string"==typeof(n=e.url)&&n?n:"string"==typeof(n=e.href)&&n?n:"":"";if(i&&null!=(n=null==x?void 0:x.test)&&n.call(x,i))return Nt(e,t);Lt.test(i)&&(i=""+location.origin+i);var r,o,s,a,l,u,c,d,f=O||{},h=f.traceRequestHeader,f=f.shouldInjectTrace;if(h&&(!f||f()))try{var p=((e,t)=>(e="undefined"!=typeof Request&&"string"!=typeof e&&e instanceof Request?zt(e.headers):{},I(I({},e),zt(t.headers))))(e,t),m=Ot(),v=m.host,g=m.pathname,y=h.generate(i,p,{host:v,pathname:g})||{},w=y.name,b=y.value;w&&b&&(r=e,o=t,s=w,a=b,u="undefined"!=typeof Headers?Headers:null,c="undefined"!=typeof Request&&"string"!=typeof r&&r instanceof Request,d=o.headers,u&&(c||d&&d instanceof u)?(l=new u(c?r.headers:void 0),d instanceof u?d.forEach(function(e,t){return l.set(t,e)}):Array.isArray(d)?d.forEach(function(e){e&&e[0]&&l.set(String(e[0]),String(e[1]))}):d&&"object"==typeof d&&Object.keys(d).forEach(function(e){l.set(e,String(d[e]))}),l.has(s)||l.set(s,a),o.headers=l):(c=zt(d))[s]||c[s.toLowerCase()]||(o.headers=Object.assign({},c,((r={})[s]=a,r))))}catch(e){}for(var k=new Map,_=window.location.href,S=0;S<Ut.length;S++){var E=Ut[S];try{"function"==typeof E.beforeFetch&&E.beforeFetch(i,t),"function"==typeof E.getCurrentFrom&&k.set(E.name,E.getCurrentFrom())}catch(e){}}var C=Date.now(),R=Object.assign({},t,{method:(f=e,(m=t)&&m.method?String(m.method).toUpperCase():"string"!=typeof f&&f&&f.method?String(f.method).toUpperCase():"GET")});return Nt(e,t).then(function(e){var t;try{t=e.clone()}catch(t){for(var n=0;n<Ut.length;n++){var r=Ut[n];try{"function"==typeof r.cloneError&&r.cloneError(e,Date.now()-C,i,R,C,k.get(r.name),_)}catch(e){}}return e}for(n=0;n<Ut.length;n++){r=Ut[n];try{"function"==typeof r.then&&r.then(t,Date.now()-C,i,R,C,k.get(r.name),_)}catch(e){}}return e}).catch(function(e){for(var t=0;t<Ut.length;t++){var n=Ut[t];try{"function"==typeof n.catch&&n.catch(e,Date.now()-C,i,R,C,k.get(n.name),_)}catch(e){}}throw e})})},overrideXhr:function(R,T){var i,O=this,e={name:this.name,ignoreHackReg:null==(e=R.api)?void 0:e.ignoreHackReg,traceRequestHeader:null!=(e=R.api)&&e.injectTraceHeader?this.traceRequestHeader:null,getCurrentFrom:function(){return O.getFromParam(T)},open:function(e){var t;(t=(e=e).__tdemSseObserver)&&!t.sealed&&t.cancel(),wn(e),e.__tdemSseClaimed=!1,e.__tdemSseObserver=void 0,e.failType=void 0},send:function(k,_,S,E){O.rememberViewId(k,T);function e(){k.failType="abort"}function t(){k.failType="error"}function n(){k.failType="timeout"}function r(){var e;!1===R.api||k.__tdemSseClaimed||(e=k.tdemUrl||"",!le(e,R.hostUrl)&&dn(("function"==typeof k.getResponseHeader?k.getResponseHeader("content-type"):"")||"")&&(k.__tdemSseClaimed=!0,(e=pn({url:(e=hn({requestUrl:k.tdemUrl||"",finalUrl:("string"==typeof k.responseURL?k.responseURL:"")||void 0,httpMethod:k.tdemMethod})).url,originalUrl:e.originalUrl,httpMethod:e.httpMethod,redirectCount:e.redirectCount,stallThresholdMs:cn(R.api),report:function(e){return O.reportWithStartedView(T,e,k)},pageUrl:S||O.getFromParam(T),replayId:P(T),llmVersion:R.llmVersion})).noteHttpStatus(k.status),k.__tdemSseObserver=e))}function i(){r()}function o(){r();var e,t=k.__tdemSseObserver;t&&void 0!==(e=bn(k))&&e.length>u&&(t.ingestText(e.slice(u)),u=e.length)}function s(){var e,g,y,t,w,b=k.tdemUrl||"";k.__tdemSseClaimed?(Wt(b,k.__tdemRequestId),(e=k.__tdemSseObserver)&&!e.sealed&&(void 0!==(t=bn(k))&&t.length>u&&e.ingestText(t.slice(u)),e.noteHttpStatus(k.status),"abort"===k.failType?e.cancel():400<=k.status?e.httpError():k.failType?e.failTransport():e.succeed()),wn(k)):(wn(k),le(b,R.hostUrl)||"abort"===k.failType?Wt(b,k.__tdemRequestId):(g="",(k.failType||!k.status||400<=k.status)&&(g=k.failType||"failed"),y=Date.now()-C,t=k.getResponseHeader("content-type")||"",w=Gt(R,t,b),setTimeout(function(){var u=Kt(R,{url:b,duration:y,type:w,status:k.status,method:k.tdemMethod||"get"});if(u.from=S||O.getFromParam(T),"fetch"===w){var e=(null==(e=R.api)?void 0:e.reqHeaders)||[],c=Bt(k.tdemXhrReqHeader,e,"req"),e=(null==(e=R.api)?void 0:e.resHeaders)||[],t=k.getAllResponseHeaders().split("\r\n").reduce(function(e,t){t=t.split(": ");return t[0]&&t[1]&&(e[t[0]]=t[1]),e},{}),d=Bt(t,e,"res"),t=qe(k.tdemXhrReqHeader),f=t.traceId,h=t.spanId,t=null==(e=R.api)?void 0:e.apiDetail,p=t?oe(_,null==(e=R.api)?void 0:e.reqParamHandler,{url:b}):"",m=t?oe(k.response,null==(e=R.api)?void 0:e.resBodyHandler,{url:b}):"";try{var n,r,i,o=k.response,s=R.api,a={url:b,ctx:k,payload:_},l=function(e){var n=e.code,r=e.isErr,i=[g?"AJAX_ERROR: request "+g:"","fetch req url: "+b,"res status: "+(u.status||0),"res duration: "+u.duration+"ms","res startTime: "+C,c,d,"req method: "+(u.method||"GET"),"res retcode: "+n,Vt(p,"req param"),Vt(m,"res data")].filter(function(e){return e}).join("\n\n"),o=(u.ret=n,u.isErr=+r,u.payload=_,Zt(!!g,r)),s=Jt(null==u?void 0:u.duration,R,u),a=o===un.API_RESPONSE&&s?un.SLOW_NET_REQUEST:o,e=k.__tdemRequestId||"",l=(k.__tdemRequestId=e,null==(t=T.config)?void 0:t.api),t=o!==un.API_RESPONSE||s||T.isWhiteList||(null==l?void 0:l.reportRequest)||(null==l?void 0:l.injectTraceHeader);qt({requestId:e,url:b,statusCode:u.status||0,durationMs:Number(u.duration)||0,startedAtMs:Number(C)||0,willReport:!!t,transportFailure:!(0<k.status)},function(e,t){(o!==un.API_RESPONSE||s||T.isWhiteList||null!=l&&l.reportRequest||null!=l&&l.injectTraceHeader)&&O.publishNormalLog({msg:i,level:a,code:n,isErr:r,trace:f,spanId:h,errorMsg:"",from:S||O.getFromParam(T),originFrom:E,viewId:k.__tdemViewId,dialFields:e,dnsTime:t},T),O.publishSpeed(u,T)})};try{if("function"==typeof(null==s?void 0:s.retCodeHandlerAsync))return void s.retCodeHandlerAsync(o,null==a?void 0:a.url,null==a?void 0:a.ctx,function(e){var t=e.code;null!=l&&l({code:void 0===t?G:t,isErr:e.isErr})});if("function"==typeof(null==s?void 0:s.retCodeHandler))return void(i=(r=s.retCodeHandler(o,null==a?void 0:a.url,null==a?void 0:a.ctx,null==a?void 0:a.payload)||{}).code,null!=l&&l({code:void 0===i?G:i,isErr:r.isErr}));if(!(o="string"==typeof o?JSON.parse(o):o))return void(null!=l&&l({code:G,isErr:!1}));"function"==typeof(null==(n=null==s?void 0:s.ret)?void 0:n.join)&&(fe=[].concat(s.ret.map(function(e){return e.toLowerCase()})));var v=Object.getOwnPropertyNames(o).filter(function(e){return-1!==fe.indexOf(e.toLowerCase())});if(v.length)return void("未知"!==(i=o[v[0]])&&""!==i||(i=G),null!=l&&l({code:""+i,isErr:0!==i&&"0"!==i&&i!==G}));null!=l&&l({code:G,isErr:!1})}catch(o){null!=l&&l({code:G,isErr:!1})}}catch(e){Wt(b,k.__tdemRequestId),u.ret=G,O.publishSpeed(u,T)}}else Wt(b,k.__tdemRequestId),u.type="static",u.urlQuery=ee(b,!0),O.publishSpeed(u,T)},0)))}var a,l,C=Date.now(),u=(le(k.tdemUrl||"",R.hostUrl)||(k.__tdemRequestId=jt(k.tdemUrl||"","xmlhttprequest")),((null==R?void 0:R.api)||{}).injectTraceHeader&&at(T)&&(l=(a=Ot()).host,a=(l=O.traceRequestHeader.generate(k.tdemUrl,{},{host:l,pathname:a.pathname})||{}).name,l=l.value,a)&&l&&k.setRequestHeader(a,l),0);k.__tdemXhrHooks={onReadyStateChange:i,onProgress:o,onLoadEnd:s,onAbort:e,onError:t,onTimeout:n},k.addEventListener("readystatechange",i),k.addEventListener("progress",o),k.addEventListener("loadend",s),k.addEventListener("abort",e),k.addEventListener("error",t),k.addEventListener("timeout",n)}};this.hackXHROptions=e,i=this.hackXHROptions,Dt.find(function(e){return e.name===i.name})||(Dt.push(i),!Pt&&window.XMLHttpRequest&&(xt=window.XMLHttpRequest.prototype.send,It=window.XMLHttpRequest.prototype.open,Mt=window.XMLHttpRequest.prototype.setRequestHeader,Pt=!0,window.XMLHttpRequest.prototype.open=function(){this.tdemMethod=arguments[0];var e,t=arguments[1];if(Lt.test(t)&&(t=""+location.origin+t),this.tdemUrl=t,null==(t=null==(e=i.ignoreHackReg)?void 0:e.test)||!t.call(e,this.tdemUrl))if(this.tdemXhrStartTime=Date.now(),this.sendByTdem)l.isIE()||(this.timeout=5e3);else for(var n=0;n<Dt.length;n++){var r=Dt[n];try{"function"==typeof r.open&&r.open(this)}catch(e){}}return It.apply(this,arguments)},window.XMLHttpRequest.prototype.setRequestHeader=function(){var e,t,n;return null!=(t=null==(n=i.ignoreHackReg)?void 0:n.test)&&t.call(n,this.tdemUrl)?Mt.apply(this,arguments):(t=arguments[0],n=arguments[1],this.tdemXhrReqHeader=null!=(e=this.tdemXhrReqHeader)?e:{},null!=i&&i.traceRequestHeader&&-1<["traceparent","b3","sw8","sentry-trace"].indexOf(t)&&(this.tdemXhrReqHeader[t]||(arguments[1]=n),this.tdemXhrReqHeader[t])?void 0:(this.tdemXhrReqHeader[t]=arguments[1],Mt.apply(this,arguments)))},window.XMLHttpRequest.prototype.send=function(){var e,t;if(!(null!=(t=null==(e=i.ignoreHackReg)?void 0:e.test)&&t.call(e,this.tdemUrl)||this.sendByTdem))for(var n=0;n<Dt.length;n++){var r=Dt[n];try{"function"==typeof r.send&&r.send(this,arguments[0],"function"==typeof r.getCurrentFrom?r.getCurrentFrom():void 0,window.location.href)}catch(e){}}return xt.apply(this,arguments)}))},overrideEventSource:function(o,s){var n,a=this;function e(e,t){t=new n(e,t);try{null!=gn&&gn(t,String(e))}catch(e){}return t}gn={onCreate:function(t,e){var n={__tdemViewId:a.currentViewId(s)};if(!le(e,o.hostUrl)){var r=pn({url:ee(e)||e,httpMethod:"GET",stallThresholdMs:cn(o.api),report:function(e){return a.reportWithStartedView(s,e,n)},pageUrl:a.getFromParam(s),replayId:P(s),llmVersion:o.llmVersion});r.pauseStall(),t.addEventListener("open",function(){return r.resumeStall()}),t.addEventListener("message",function(){return r.ingestCompleteMessage()}),t.addEventListener("error",function(){if(!r.sealed){var e=t.readyState;0!==e?2===e&&r.failTransport():r.pauseStall()}});var i=t.close.bind(t);t.close=function(){try{r.sealed||r.cancel()}finally{i()}}}}}.onCreate,"undefined"!=typeof window&&window.EventSource&&!yn&&(yn=!0,n=vn=window.EventSource,e.prototype=n.prototype,e.CONNECTING=n.CONNECTING,e.OPEN=n.OPEN,e.CLOSED=n.CLOSED,window.EventSource=e)},publishSpeed:function(e){},publishNormalLog:function(n,e){var t,r,i,o,s,a,l,u,c;[un.API_RESPONSE,un.AJAX_ERROR,un.RET_ERROR,un.SLOW_NET_REQUEST].includes(n.level)&&(t=(t=null==(t=n.msg)?void 0:t.match(/(?:fetch req url|req url):\s*(.+?)(?:\n|$)/))?t[1].trim():"",r=(r=null==(r=n.msg)?void 0:r.match(/req method:\s*(.+?)(?:\n|$)/i))?r[1].trim().toUpperCase():"GET",a=(a=null==(a=n.msg)?void 0:a.match(/res status:\s*(\d+)/))?parseInt(a[1],10):0,i=(i=null==(i=n.msg)?void 0:i.match(/res duration:\s*([\d.]+)ms/))?parseFloat(i[1]):0,l=(l=null==(l=n.msg)?void 0:l.match(/=+\s*res data\s*=+\s*\n([\s\S]*?)(?:\n=+|$)/))?l[1].trim().slice(0,1e3):void 0,o={},n.trace&&(o.trace_id=n.trace),n.spanId&&(o.span_id=n.spanId),(c=(u={httpStatus:a,isTransportFailure:a<=0,isBusinessError:n.level===un.RET_ERROR||!!n.isErr,businessCode:n.code}).aborted?{report:!1,eventType:null}:(c=Number(u.httpStatus),u.isTransportFailure||!Number.isFinite(c)||c<=0?{report:!0,eventType:"api_error",outcome:"transport_error"}:400<=c?{report:!0,eventType:"api_error",outcome:"http_error"}:u.isBusinessError?{report:!0,eventType:"api_error",outcome:"business_error",businessCode:K(u.businessCode)||G}:{report:!0,eventType:"api_call",businessCode:K(u.businessCode)})).report)&&c.eventType&&(s={http_method:r,http_status:String(a)},c.outcome&&(s.outcome=c.outcome),c.businessCode&&(s.business_code=c.businessCode),n.dialFields&&"object"==typeof n.dialFields&&Object.keys(n.dialFields).forEach(function(e){var t=n.dialFields[e];null!=t&&""!==t&&(s[e]=String(t))}),u={duration:i},null!=n.dnsTime&&Number.isFinite(Number(n.dnsTime))&&(u.dns_time=Math.max(0,Number(n.dnsTime))),"api_error"===c.eventType?(a=I(I({event_id:A(),event_type:x.API_ERROR,event_category:M.ERROR,timestamp:Date.now(),page_url:n.from||(null==(r=e.getOriginFrom)?void 0:r.call(e))||window.location.href},n.viewId?{view_id:String(n.viewId)}:{}),{data:{url:t,measurements:u,response_body:l,replay_id:P(e),tags:0<Object.keys(o).length?o:void 0,event_properties:s}}),null!=(i=e.reportTDEMEvent)&&i.call(e,a)):(l=I(I({event_id:A(),event_type:x.API_CALL,event_category:M.NETWORK,timestamp:Date.now(),page_url:n.from||(null==(r=e.getOriginFrom)?void 0:r.call(e))||window.location.href},n.viewId?{view_id:String(n.viewId)}:{}),{data:{url:t,measurements:u,replay_id:P(e),tags:0<Object.keys(o).length?o:void 0,event_properties:s}}),null!=(i=e.reportTDEMEvent)&&i.call(e,l)))},destroy:function(){var t,n,e;this.option.publishSpeed=function(){},this.option.publishNormalLog=function(){},this.option.hackXHROptions&&(t=this.option.hackXHROptions,-1!==(e=Dt.findIndex(function(e){return e.name===t.name})))&&Dt.splice(e,1),this.option.hackFetchOptions&&(n=this.option.hackFetchOptions,-1!==(e=Ut.findIndex(function(e){return e.name===n.name})))&&Ut.splice(e,1),vn&&(window.EventSource=vn),yn=!1,gn=vn=void 0,this.option.override=!1}}),Cn={},Rn=new e({name:"bridge",override:!1,onNewTdem:function(e){this.override||(this.override=!0,this.overrideBridge(e))},getFromParam:function(e){var t;return(null==(t=e.getOriginFrom)?void 0:t.call(e))||window.location.href},publishSpeed:function(t,n){this.$walk(function(e){e===n&&e.speedLogPipeline(t)})},overrideBridge:function(u){var c=this,d=u.config,e="object"==typeof d.bridge?d.bridge:void 0,t=null==e?void 0:e.target,e=null==e?void 0:e.methods;t&&null!=e&&e.length&&e.forEach(function(e){var l=t[e];Cn[e]=l,t[e]=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e[0],i=e[1],n=e[2],o=e[3],s=Date.now(),a=c.getFromParam(u);l(r,i,n,function(e){var t=re(e,d.api),n=t.code,t=t.isErr,n={url:r+"-"+i,name:r+"-"+i,duration:Date.now()-s,type:"bridge",ret:n,isErr:+t,from:a};c.publishSpeed(n,u),o(e)})}})},unHackBridge:function(e){var e="object"==typeof e.config.bridge?e.config.bridge:void 0,t=null==e?void 0:e.target;Cn=(t&&Object.keys(Cn).forEach(function(e){Cn[e]&&(t[e]=Cn[e])}),{})},destroy:function(e){this.option.publishSpeed=function(){},this.option.unHackBridge(e),this.option.override=!1}}),n=((n=kn=kn||{})[n.unknown=100]="unknown",n[n.wifi=1]="wifi",n[n.net2g=2]="net2g",n[n.net3g=3]="net3g",n[n.net4g=4]="net4g",n[n.net5g=5]="net5g",n[n.net6g=6]="net6g",(n=_n=_n||{})[n.android=1]="android",n[n.ios=2]="ios",n[n.windows=3]="windows",n[n.macos=4]="macos",n[n.linux=5]="linux",n[n.other=100]="other",(n=Sn=Sn||{})[n.unknown=100]="unknown",n[n.normal=0]="normal",n[n.weak=1]="weak",n[n.disconnected=2]="disconnected",new e({name:"device",onNewTdem:function(e){e.extendBean("platform",this.getPlatform()),e.extendBean("netType",kn.unknown),this.getDpi(e),this.refreshNetworkTypeToBean(e),this.refreshNetworkStatusToBean(e)},getDpi:function(e){e.extendBean("vp",Math.round(window.innerWidth)+" * "+Math.round(window.innerHeight)),window.screen&&e.extendBean("sr",Math.round(window.screen.width)+" * "+Math.round(window.screen.height))},getPlatform:function(){var t={android:/\bAndroid\s*([^;]+)/,ios:/\b(iPad|iPhone|iPod)\b.*? OS ([\d_]+)/,windows:/\b(Windows NT)/,macos:/\b(Mac OS)/,linux:/\b(Linux)/i},e=Object.keys(t).find(function(e){return t[e].test(navigator.userAgent)});return e?_n[e]:_n.other},refreshNetworkTypeToBean:function(t){var n=this,e=t.config;e&&("function"==typeof e.getNetworkType?e.getNetworkType:Tn)(function(e){kn[e]||(e=kn.unknown),t.extendBean("netType",e),n.NetworkRefreshTimer=setTimeout(function(){n.refreshNetworkTypeToBean(t),clearTimeout(n.NetworkRefreshTimer)},1e4)})},refreshNetworkStatusToBean:function(t){var e,n=this,r=t.config;r&&null!=(e="function"==typeof r.getNetworkStatus?r.getNetworkStatus:e)&&e(function(e){void 0===Sn[e]&&(e=Sn.unknown),t.extendBean("netStatus",e),n.NetworkStatusRefreshTimer=setTimeout(function(){n.refreshNetworkStatusToBean(t),clearTimeout(n.NetworkStatusRefreshTimer)},1e4)})}})),Tn=function(e){var t="",n=navigator.userAgent.match(/NetType\/(\w+)/);n?t=n[1]:navigator.connection&&(t=navigator.connection.effectiveType||navigator.connection.type),e((n=t=t||G,0<=(n=String(n).toLowerCase()).indexOf("4g")?kn.net4g:0<=n.indexOf("wifi")?kn.wifi:0<=n.indexOf("5g")?kn.net5g:0<=n.indexOf("6g")?kn.net6g:0<=n.indexOf("3g")?kn.net3g:0<=n.indexOf("2g")?kn.net2g:kn.unknown))},On=window.WebSocket,xn=[],In={construct:function(e,t){var r=new e(t[0],t[1]);return r.originSend=r.send,r.addEventListener("error",function(e){var e=(null==e?void 0:e.currentTarget)||{},t=e.url,n=e.readyState;null!=xn&&xn.forEach(function(e){e=e.onErr;null!=e&&e({msg:"无法获知具体错误信息,需在浏览器控制台查看!",readyState:n,connectUrl:t})})}),Object.defineProperty(r,"send",{get:function(){return function(e){null!=(t=r.originSend)&&t.call(r,e);var t=r.readyState;if(t!==WebSocket.OPEN){var n={readyState:t,connectUrl:r.url};switch(t){case WebSocket.CLOSED:xn.forEach(function(e){e=e.sendErr;null!=e&&e(I({msg:"消息发送失败,连接已关闭!"},n))});break;case WebSocket.CONNECTING:xn.forEach(function(e){(0,e.sendErr)(I({msg:"消息发送失败,正在连接中!"},n))});break;case WebSocket.CLOSING:xn.forEach(function(e){(0,e.sendErr)(I({msg:"消息发送失败,连接正在关闭!"},n))})}}}}}),r}},Mn=new e({name:"onError"}),An=Mn=new e({name:"onError",onNewTdem:function(e){this.startListen(e)},getFromParam:function(e){var t;return(null==(t=e.getOriginFrom)?void 0:t.call(e))||window.location.href},startListen:function(l){function e(e){var t,n=e&&se(e.reason);n&&(t=[{type:(null==(t=e.reason)?void 0:t.name)||"PromiseRejection",value:(null==(t=e.reason)?void 0:t.message)||String(n),mechanism_type:"unhandledrejection",mechanism_handled:0}],n=e.reason instanceof Error?Se(e.reason):[],e={event_id:A(),event_type:x.PROMISE_ERROR,event_category:M.ERROR,timestamp:Date.now(),page_url:u.getFromParam(l),data:{exception_stacks:t,exception_frames:n,replay_id:P(l),tags:{environment:l.config.env||"production"}}},null!=(t=l.reportTDEMEvent))&&t.call(l,e)}function t(e){if(e=(null==e?void 0:e.target)||(null==e?void 0:e.srcElement)){var t=e.src||e.href||"",n=e.tagName,n=(void 0===n?"script":n).toLowerCase(),r=["audio","video"].includes(n);if((!r||null!=e&&e.error)&&!(le(i=t,l.config.hostUrl)||-1<window.location.href.indexOf(i))){var i="other";if(/\.js$/.test(t)||"script"===n)i="script";else if(/\.css$/.test(t)||"link"===n)i="stylesheet";else if("img"===n)i="image";else{if(!r)return;i="media"}t={event_id:A(),event_type:x.RESOURCE_ERROR,event_category:M.ERROR,timestamp:Date.now(),page_url:u.getFromParam(l),data:{url:t,resource_type:i,replay_id:P(l),tags:I({environment:l.config.env||"production"},r&&null!=e&&e.error?{error_code:String(e.error.code),error_message:e.error.message||""}:{}),event_properties:{element_tag:n}}};null!=(i=l.reportTDEMEvent)&&i.call(l,t)}}}var n,r,i,u=this,c=window.onerror,o=(window.onerror=function(e,t,n,r,i){var o,s,a=se(e);"string"!=typeof(o=a)||!o||H.some(function(e){return-1<o.indexOf(e)})||W.some(function(e){return-1<o.indexOf(e)})||(a=[{type:(null==i?void 0:i.name)||"Error",value:String(e),mechanism_type:"onerror",mechanism_handled:0}],s=i?Se(i):[{abs_path:t||"",colno:r||0,filename:(null==t?void 0:t.split("/").pop())||"",function:"(anonymous)",lineno:n||0,in_app:1,stack_level:0}],a={event_id:A(),event_type:x.JS_ERROR,event_category:M.ERROR,timestamp:Date.now(),page_url:u.getFromParam(l),data:{exception_stacks:a,exception_frames:s,replay_id:P(l),tags:{environment:l.config.env||"production",version:String(l.config.version||"")}}},null!=(s=l.reportTDEMEvent)&&s.call(l,a)),null!=c&&c.call(window,e,t,n,r,i)},window.addEventListener("unhandledrejection",e),window.document.addEventListener("error",t,!0),l.lifeCycle.on("destroy",function(){0===Mn.countInstance()&&(window.removeEventListener("unhandledrejection",e),window.document.removeEventListener("error",t,!0))}),l.config.websocket);(("object"==typeof o?!1!==o.enabled:o)||l.config.websocketHack)&&(o={key:l.config.id+"-"+this.name,onErr:function(e){var t;null!=(t=u.publishWsErrorLog)&&t.call(u,e,l)},sendErr:function(e){var t;null!=(t=u.publishWsErrorLog)&&t.call(u,e,l)}},this.hackWebsocketConfig=o,o=this.hackWebsocketConfig,window.Proxy)&&window.WebSocket&&(n=window.WebSocket,window&&!n.isHack&&(r=new Proxy(WebSocket,In),n.isHack=!0,window.WebSocket=r),i=o,xn.find(function(e){return e.key===i.key})||i&&xn.push(i))},publishWsErrorLog:function(e,n){var t=e.connectUrl,r=e.msg,e=e.readyState,i={event_id:A(),event_type:x.JS_ERROR,event_category:M.ERROR,timestamp:Date.now(),page_url:this.getFromParam(n),data:{exception_stacks:[{type:"WebSocketError",value:"WEBSOCKET_ERROR: connect: "+t+" readyState: "+e+" msg: "+r,mechanism_type:"websocket",mechanism_handled:0}],exception_frames:[],replay_id:P(n),tags:{environment:n.config.env||"production",websocket_url:t||"",websocket_ready_state:String(null!=e?e:"")}}};this.$walk(function(e){var t;e===n&&null!=(t=e.reportTDEMEvent)&&t.call(e,i)})},destroy:function(){var t,e;this.option.hackWebsocketConfig&&(t=this.option.hackWebsocketConfig,window.WebSocket=On,-1!==(e=xn.findIndex(function(e){return e.key===t.key})))&&xn.splice(e,1)}}),Pn='a,button,input[type="button"],input[type="submit"],input[type="reset"],input[type="image"],[role="button"],[onclick],[ng-click],[v-on\\:click]',Dn=new WeakMap;function Ln(e){return e.closest(Pn)||e}function Nn(e,t){return null==(e=Dn.get(e))?void 0:e.get(t)}function Fn(e){return e instanceof Array?new Map(e.map(function(e){return[e,!0]})):new Map}function Un(e,t){return"string"==typeof e?e.split(t):[]}new e({name:"click"});var zn,Bn,jn,Wn,Hn,qn,Vn,Gn,Zn,Jn,Kn,$n=function(e){if(""!==e.id&&e.id)return'id("'+e.id+'")';if(e===document.body)return e.tagName;if(e instanceof Document)return"document";var t=0;if(e.parentNode)for(var n=e.parentNode.childNodes,r=0;r<n.length;r+=1){var i=n[r];if(i===e)return $n(e.parentNode)+"/"+e.tagName+"["+(t+1)+"]";1===i.nodeType&&i.tagName===e.tagName&&(t+=1)}return 0},Xn=function(e){if(3===e.nodeType||4===e.nodeType)return e.nodeValue||"";if(1!==e.nodeType)return"";if("string"==typeof e.textContent)return e.textContent;for(var t="",n=e.firstChild;n;n=n.nextSibling)t+=Xn(n);return t},Yn=new e({name:"click",listeners:[],onNewTdem:function(e){this.startListen(e)},startListen:function(a){for(var e=this,t=0,n=Object.entries({click:1,longpress:2});t<n.length;t++)(s=>{e.listeners.push(((e,t,n,r)=>{function i(e){var t=document.documentElement;t&&n.call(t,e,e.target)}return void 0===r&&(r=!0),e.addEventListener(t,i,r),{destroy:function(){e.removeEventListener(t,i,r)}}})(document,s,function(e,t){var n,r,i,o;t&&!((e,t)=>{e="object"==typeof e.click?e.click:void 0,n=Fn((null==e?void 0:e.ignoreClasses)||[])||new Map;for(var n,r=(e={ignoreIds:Fn((null==e?void 0:e.ignoreIds)||[])||new Map,ignoreClasses:n}).ignoreClasses,i=e.ignoreIds,o=!(0===i.size&&0===r.size),s=t,a=(Un(t.getAttribute("id")||""," "),Un(t.getAttribute("class")||"",""),0),l=!1;s&&o&&s.getAttribute;){if(l)return 1;if(10<=a)break;for(var u=Un(s.getAttribute("id")||""," "),c=Un(s.getAttribute("class")||"",""),d=0,f=u;d<f.length;d++){var h=f[d];if(i.has(h)){l=!0;break}}for(var p=0,m=c;p<m.length;p++){var v=m[p];if(r.has(v)){l=!0;break}}a+=1,s=s.parentNode||s.parentElement}})(a.config,t)&&(n=$n(t),r=(r=(e=>{var t="",n=e.nodeType;if(1===n||9===n||11===n){if("string"==typeof e.textContent)return e.textContent;for(var r=e.firstChild;r;r=r.nextSibling)t+=Xn(e)}else if(3===n||4===n)return e.nodeValue;return t})(t))?r.replace(/^\s+|\s+$/g,""):"",i=t.getBoundingClientRect&&t.getBoundingClientRect(),n={event_id:A(),event_type:x.CLICK,event_category:M.BEHAVIOR,timestamp:Date.now(),page_url:a._customPageUrl||window.location.href,data:{target_element:String(n),target_text:r.slice(0,127),click_position:i?{x:parseInt(String(i.left+window.scrollX),10)||0,y:parseInt(String(i.top+window.scrollY),10)||0}:void 0,replay_id:P(a),tags:{environment:a.config.env||"production",event_op:s,node_name:(null==t?void 0:t.nodeName)||""},event_properties:{target_id:t.id||"",target_class:"string"==typeof t.className?t.className.slice(0,128):""}}},r=e,i=a,t=n,(o=Dn.get(r)||new Map).set(i,t),Dn.set(r,o),a.lifeCycle.emit("clickCaptured",{event:e,source:n}),null!=(i=a.reportTDEMEvent))&&i.call(a,n)},!0))})(n[t][0])},destroy:function(){var e=this.option||this;e.listeners.forEach(function(e){return e.destroy()}),e.listeners=[]}}),Qn=(new e({name:"console"}),["log","error","warn","info","debug","trace"]),er={log:console.log,error:console.error,warn:console.warn,info:console.info,debug:console.debug,trace:console.trace||console.log},tr=new e({name:"console",onNewTdem:function(e){this.startListen(e)},startListen:function(e){var f,h;h="object"==typeof(f=e).config.console?f.config.console:void 0,Qn.forEach(function(c){var d=er[c];console[c]=function(){for(var e,t,n,r,i,o,s,a,l=[],u=0;u<arguments.length;u++)l[u]=arguments[u];try{d.apply(console,l),o=c,s=f.isWhiteList,("all"===(a=(null==(a=h)?void 0:a.level)||"error")||s||("error"===a?"error"===o:"warn"===a?"error"===o||"warn"===o:"info"===a?["error","warn","info"].includes(o):"log"===a?["error","warn","info","log"].includes(o):"error"===o))&&(r=l.map(function(e){if("object"==typeof e&&null!==e)try{return JSON.stringify(e)}catch(e){}return String(e)}).join(" "),i={event_id:A(),event_type:x.LOG,event_category:M.LOG,timestamp:Date.now(),page_url:(null==(e=f.getOriginFrom)?void 0:e.call(f))||("undefined"!=typeof window?null==(t=window.location)?void 0:t.href:""),data:{log_level:"error"===c?"error":"warn"===c?"warn":"info",replay_id:P(f),tags:{console_method:c},event_properties:{message:("console."+c+": "+r).slice(0,2048)}}},null!=(n=f.reportTDEMEvent)&&n.call(f,i))}catch(e){er.error("Console hook error:",e)}}})},destroy:function(){Object.keys(er).forEach(function(e){console[e]=er[e]})}});function nr(){Wn=[],Bn=-1,zn=null,Jn(addEventListener)}function rr(e,t){var n=Er(),r="navigate";return 0<=_r?r="back-forward-cache":n&&(document.prerendering||0<Cr()?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v3-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}}function ir(e,t,n){try{var r;if(PerformanceObserver.supportedEntryTypes.includes(e))return(r=new PerformanceObserver(function(e){Promise.resolve().then(function(){t(e.getEntries())})})).observe(Object.assign({type:e,buffered:!0},n||{})),r}catch(e){}}function or(t,n,r,i){var o,s;return function(e){0<=n.value&&(e||i)&&((s=n.value-(o||0))||void 0===o)&&(o=n.value,n.delta=s,n.rating=(e=n.value)>r[1]?"poor":e>r[0]?"needs-improvement":"good",t(n))}}function sr(e){requestAnimationFrame(function(){return requestAnimationFrame(function(){return e()})})}function ar(t){function e(e){"pagehide"!==e.type&&"hidden"!==document.visibilityState||t(e)}addEventListener("visibilitychange",e,!0),addEventListener("pagehide",e,!0)}function lr(t){var n=!1;return function(e){n||(t(e),n=!0)}}function ur(){return Rr<0&&(Rr=Tr(),xr(),Sr(function(){setTimeout(function(){Rr=Tr(),xr()},0)})),{get firstHiddenTime(){return Rr}}}function cr(e){document.prerendering?addEventListener("prerenderingchange",function(){return e()},!0):e()}function dr(o,s){s=s||{},cr(function(){var t,n=ur(),r=rr("FCP"),i=ir("paint",function(e){e.forEach(function(e){"first-contentful-paint"===e.name&&(i.disconnect(),e.startTime<n.firstHiddenTime)&&(r.value=Math.max(e.startTime-Cr(),0),r.entries.push(e),t(!0))})});i&&(t=or(o,r,Mr,s.reportAllChanges),Sr(function(e){r=rr("FCP"),t=or(o,r,Mr,s.reportAllChanges),sr(function(){r.value=performance.now()-e.timeStamp,t(!0)})}))})}function fr(e){var t,n,r,i,o,s;e.cancelable&&(t=(1e12<e.timeStamp?new Date:performance.now())-e.timeStamp,"pointerdown"==e.type?(n=t,r=e,i=function(){Lr(n,r),s()},o=function(){s()},s=function(){removeEventListener("pointerup",i,Pr),removeEventListener("pointercancel",o,Pr)},addEventListener("pointerup",i,Pr),addEventListener("pointercancel",o,Pr)):Lr(t,e))}function hr(e){e.forEach(function(e){e.interactionId&&(Br=Math.min(Br,e.interactionId),jr=Math.max(jr,e.interactionId),zr=jr?(jr-Br)/7+1:0)})}function pr(){return Wr()-qr}function mr(e){var t=Vr[Vr.length-1],n=Gr[e.interactionId];(n||Vr.length<10||e.duration>t.latency)&&(n?(n.entries.push(e),n.latency=Math.max(n.latency,e.duration)):(t={id:e.interactionId,latency:e.duration,entries:[e]},Gr[t.id]=t,Vr.push(t)),Vr.sort(function(e,t){return t.latency-e.latency}),Vr.splice(10).forEach(function(e){delete Gr[e.id]}))}function vr(e,t){function n(t,n,r,i){function o(e){"visibilitychange"===t&&"hidden"!==document.visibilityState||(i?setTimeout(function(){return n(e)},i):n(e),r&&removeEventListener(t,o,!0))}addEventListener(t,o,!0)}var r;n("visibilitychange",e,null==t?void 0:t.once,null==(r=null==t?void 0:t.delay)?void 0:r.visibilitychange),n("pagehide",e,null==t?void 0:t.once,null==(r=null==t?void 0:t.delay)?void 0:r.pagehide),n("beforeunload",e,null==t?void 0:t.once,null==(r=null==t?void 0:t.delay)?void 0:r.beforeunload)}Hn={passive:!0,capture:!0},qn=new Date,Vn=function(e,t){zn||(zn=t,Bn=e,jn=new Date,Jn(removeEventListener),Gn())},Gn=function(){var t;0<=Bn&&Bn<jn-qn&&(t={entryType:"first-input",name:zn.type,target:zn.target,cancelable:zn.cancelable,startTime:zn.timeStamp,processingStart:zn.timeStamp+Bn},Wn.forEach(function(e){e(t)}),Wn=[])},Zn=function(e){var t,n,r,i,o,s;e.cancelable&&(t=(1e12<e.timeStamp?new Date:performance.now())-e.timeStamp,"pointerdown"==e.type?(n=t,r=e,i=function(){Vn(n,r),s()},o=function(){s()},s=function(){removeEventListener("pointerup",i,Hn),removeEventListener("pointercancel",o,Hn)},addEventListener("pointerup",i,Hn),addEventListener("pointercancel",o,Hn)):Vn(t,e))},Jn=function(t){["mousedown","keydown","touchstart","pointerdown"].forEach(function(e){return t(e,Zn,Hn)})},Kn="hidden"===document.visibilityState?0:1/0,addEventListener("visibilitychange",function e(t){"hidden"===document.visibilityState&&(Kn=t.timeStamp,removeEventListener("visibilitychange",e,!0))},!0),nr(),self.webVitals={firstInputPolyfill:function(e){Wn.push(e),Gn()},resetFirstInputPolyfill:nr,get firstHiddenTime(){return Kn}};var gr,yr,wr,br,kr,_r=-1,Sr=function(t){addEventListener("pageshow",function(e){e.persisted&&(_r=e.timeStamp,t(e))},!0)},Er=function(){return window.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},Cr=function(){var e=Er();return e&&e.activationStart||0},Rr=-1,Tr=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},Or=function(e){"hidden"===document.visibilityState&&-1<Rr&&(Rr="visibilitychange"===e.type?e.timeStamp:0,Ir())},xr=function(){addEventListener("visibilitychange",Or,!0),addEventListener("prerenderingchange",Or,!0)},Ir=function(){removeEventListener("visibilitychange",Or,!0),removeEventListener("prerenderingchange",Or,!0)},Mr=[1800,3e3],Ar=[.1,.25],Pr={passive:!0,capture:!0},Dr=new Date,Lr=function(e,t){gr||(gr=t,yr=e,wr=new Date,Fr(removeEventListener),Nr())},Nr=function(){var t;0<=yr&&yr<wr-Dr&&(t={entryType:"first-input",name:gr.type,target:gr.target,cancelable:gr.cancelable,startTime:gr.timeStamp,processingStart:gr.timeStamp+yr},br.forEach(function(e){e(t)}),br=[])},Fr=function(t){["mousedown","keydown","touchstart","pointerdown"].forEach(function(e){return t(e,fr,Pr)})},Ur=[100,300],zr=0,Br=1/0,jr=0,Wr=function(){return kr?zr:performance.interactionCount||0},Hr=[200,500],qr=0,Vr=[],Gr={},Zr=[2500,4e3],Jr={},Kr=($r.prototype.start=function(){var t=this,n=new PerformanceObserver(function(e){e=e.getEntriesByName("first-contentful-paint");0<e.length&&(t.fcp=e[0].startTime,t.slientWindowStartTime=t.fcp,n.disconnect(),setTimeout(function(){t.checkTTI()},Math.max(t.slienceTimeInterval-(performance.now()-t.fcp)+20,1)))});n.observe({entryTypes:["paint"]}),this.longtaskObserver=new PerformanceObserver(function(e){e=e.getEntries();t.longTaskEntries=t.longTaskEntries.concat(e)}),this.longtaskObserver.observe({entryTypes:["longtask"]}),this.resourceObserver=new PerformanceObserver(function(e){e=e.getEntries();t.resourceEntries=t.resourceEntries.concat(e)}),this.resourceObserver.observe({entryTypes:["resource"]})},$r.prototype.checkTTI=function(){var e=this;this.hasSlientWindow()?(this.calculateTTI(),this.longtaskObserver.disconnect(),this.resourceObserver.disconnect()):setTimeout(function(){e.checkTTI()},this.checkInterval)},$r.prototype.hasSlientWindow=function(){var e,t=performance.now();return!(t-this.slientWindowStartTime<5e3||((e=this.getLastLongTaskEndTime())>this.slientWindowStartTime?(this.slientWindowStartTime=e,this.resourceEntries=[]):this.getRequestCount(this.slientWindowStartTime,t)<=2?(this.lastLongtaskEndTime=e,0):(t=this.resourceEntries.sort(function(e,t){return e.startTime-t.startTime}),this.slientWindowStartTime=t[this.resourceEntries.length-2].startTime,1)))},$r.prototype.getLastLongTaskEndTime=function(){var t;return 0===this.longTaskEntries.length?-1:(t=0,this.longTaskEntries.forEach(function(e){e.startTime+e.duration>t&&(t=e.startTime+e.duration)}),t)},$r.prototype.getRequestCount=function(t,n){var r=0;return this.resourceEntries.forEach(function(e){e.startTime>=t&&e.startTime+e.duration<=n&&(r+=1)}),r},$r.prototype.calculateTTI=function(){var e=-1===this.lastLongtaskEndTime?this.slientWindowStartTime:this.lastLongtaskEndTime,t=performance.timing.domContentLoadedEventEnd-performance.timing.navigationStart,e=Math.max(t,e);this.onTTICallback(e)},$r);function $r(e){this.slienceTimeInterval=5e3,this.checkInterval=100,this.fcp=0,this.longTaskEntries=[],this.resourceEntries=[],this.slientWindowStartTime=performance.now(),this.onTTICallback=e}function Xr(e){var t=e.name;0<(e=e.value)&&(ei[t]=e)}function Yr(e,t,n,r){return void 0===n&&(n=15e3),void 0===r&&(r=0),(t=void 0===t?0:t)<=e&&e<=n?e:r}new e({name:"webVitals"});var Qr,ei={FCP:-1,LCP:-1,FID:-1,CLS:-1,INP:-1,TTI:-1,from:void 0},ti=new Map,ni=new e({name:"webVitals",onNewTdem:function(e){var t,n,r,o,s,a,l,u,c,d,f,i,h,p,m=this;if(pt()&&"function"==typeof window.PerformanceObserver&&"function"==typeof performance.getEntriesByName)try{"function"!=typeof(p=(i=void 0===i?"undefined"==typeof window?{}:window:i).PerformanceObserver)||p.__tdemStartTimeGuard||(h=p,Object.setPrototypeOf(v,h),v.prototype=h.prototype,v.__tdemStartTimeGuard=!0,i.PerformanceObserver=v),ti.set(e,{isWebVitalsReported:!1,hasFirstEntry:!1,custom:null}),dr(Xr),d=Xr,f={},cr(function(){function e(e){(e=e[e.length-1])&&e.startTime<r.firstHiddenTime&&(i.value=Math.max(e.startTime-Cr(),0),i.entries=[e],t())}var t,n,r=ur(),i=rr("LCP"),o=ir("largest-contentful-paint",e);o&&(t=or(d,i,Zr,f.reportAllChanges),n=lr(function(){Jr[i.id]||(e(o.takeRecords()),o.disconnect(),Jr[i.id]=!0,t(!0))}),["keydown","click"].forEach(function(e){addEventListener(e,function(){return setTimeout(n,0)},!0)}),ar(n),Sr(function(e){i=rr("LCP"),t=or(d,i,Zr,f.reportAllChanges),sr(function(){i.value=performance.now()-e.timeStamp,Jr[i.id]=!0,t(!0)})}))}),u=Xr,c={},cr(function(){function t(e){e.startTime<n.firstHiddenTime&&(r.value=e.processingStart-e.startTime,r.entries.push(e),o(!0))}function e(e){e.forEach(t)}var n=ur(),r=rr("FID"),i=ir("first-input",e),o=or(u,r,Ur,c.reportAllChanges);i&&ar(lr(function(){e(i.takeRecords()),i.disconnect()})),i&&Sr(function(){r=rr("FID"),o=or(u,r,Ur,c.reportAllChanges),br=[],yr=-1,gr=null,Fr(addEventListener),br.push(t),Nr()})}),a=Xr,l={},dr(lr(function(){function e(e){e.forEach(function(e){var t,n;e.hadRecentInput||(t=i[0],n=i[i.length-1],r&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(r+=e.value,i.push(e)):(r=e.value,i=[e]))}),r>n.value&&(n.value=r,n.entries=i,t())}var t,n=rr("CLS",0),r=0,i=[],o=ir("layout-shift",e);o&&(t=or(a,n,Ar,l.reportAllChanges),ar(function(){e(o.takeRecords()),t(!0)}),Sr(function(){n=rr("CLS",r=0),t=or(a,n,Ar,l.reportAllChanges),sr(function(){return t()})}),setTimeout(t,0))})),o=Xr,s={},cr(function(){var e;"interactionCount"in performance||(kr=kr||ir("event",hr,{type:"event",buffered:!0,durationThreshold:0}));function t(e){e.forEach(function(t){t.interactionId&&mr(t),"first-input"!==t.entryType||Vr.some(function(e){return e.entries.some(function(e){return t.duration===e.duration&&t.startTime===e.startTime})})||mr(t)}),e=Math.min(Vr.length-1,Math.floor(pr()/50)),(e=Vr[e])&&e.latency!==n.value&&(n.value=e.latency,n.entries=e.entries,i())}var n=rr("INP"),r=ir("event",t,{durationThreshold:null!=(e=s.durationThreshold)?e:40}),i=or(o,n,Hr,s.reportAllChanges);r&&("PerformanceEventTiming"in window&&"interactionId"in PerformanceEventTiming.prototype&&r.observe({type:"first-input",buffered:!0}),ar(function(){t(r.takeRecords()),n.value<0&&0<pr()&&(n.value=0,n.entries=[]),i(!0)}),Sr(function(){Vr=[],qr=Wr(),n=rr("INP"),i=or(o,n,Hr,s.reportAllChanges)}))}),r=function(e){Xr({name:"TTI",value:e})},pt()&&new Kr(r).start(),vr(function(){m.tryReport(e,null,"onHidden")},{once:!0,delay:{visibilitychange:10}}),ei.from=(null==(n=null==(t=e)?void 0:t.getOriginFrom)?void 0:n.call(t))||window.location.href}catch(e){}function v(n){return new h(function(e,t){try{n(e,t)}catch(e){if(!(0<=(e instanceof Error?e.message:String(e||"")).indexOf("startTime")))throw e}})}},tryReport:function(t,n,r){var i=this;void 0===r&&(r="manual"),this.$walk(function(e){e===t&&("object"==typeof(e=i.$getConfig(t))&&!0===e.manualReport||"onHidden"!==r?(e=ti.get(t))&&!e.hasFirstEntry?(e.hasFirstEntry=!0,"manual"===r&&n&&(e.custom=n)):i.doReport(t,(null==e?void 0:e.custom)||n):i.doReport(t,null))})},doReport:function(o,s){var e=ti.get(o);if(e){if(null!=e&&e.isWebVitalsReported)return;e.isWebVitalsReported=!0}this.$walk(function(e){var t,n,r,i;e===o&&(t=I({},ei),s&&Object.keys(s).forEach(function(e){null!=s[e]&&(t[e]=s[e])}),n={environment:e.config.env||"production",version:String(e.config.version||"")},r={},0<t.LCP&&(r.lcp=t.LCP),0<t.FCP&&(r.fcp=t.FCP),0<t.FID&&(r.fid=t.FID),0<=t.CLS&&(r.cls=t.CLS),0<t.TTFB&&(r.ttfb=t.TTFB),0<t.TTI&&(r.tti=t.TTI),0<t.INP&&(r.inp=t.INP),i={event_id:A(),event_type:x.true,event_category:M.PERFORMANCE,timestamp:Date.now(),page_url:t.from||(null==(i=e.getOriginFrom)?void 0:i.call(e))||window.location.href,data:{measurements:r,replay_id:P(e),tags:n}},null!=(r=e.reportTDEMEvent))&&r.call(e,i)})},publish:function(e,t){this.tryReport(e,t,"manual")},destroy:function(){this.option.publish=function(){}}}),ri=(new e({name:"pagePerformance"}),3),ii=new Map,oi=new e({name:"pagePerformance",performanceMap:{},onNewTdem:function(t){var e;pt()&&(ii.set(t,{isPagePerformanceReported:!1}),Qr?this.publish(Qr,t):this.startCalcPerformance(t),e=this.publishWhenObHidden.bind(this,t),vr(e,{once:!0}),t.lifeCycle.on("destroy",function(){var e=ii.get(t);e&&(e.isPagePerformanceReported=!1)}))},publishWhenObHidden:function(e){var t,n=ii.get(e);if(null==n||!n.isPagePerformanceReported){n=0;if(null!=(t=e.firstScreenInfo)&&t.timing)n=e.firstScreenInfo.timing;else if(mt("paint"))try{var r,i=performance.getEntriesByName("first-contentful-paint");i&&0<i.length&&(r=i[0])&&0<r.startTime&&(n=r.startTime)}catch(e){}(Qr=this.buildPerformanceLog(e,n,this.getPageUrl(e),window.location.href))&&this.publish(Qr,e,!0)}},buildPerformanceLog:function(e,t,n,r){var i=performance.timing;if(i)return n={from:n,originFrom:r,dnsLookup:Yr(i.domainLookupEnd-i.domainLookupStart),tcp:Yr(i.connectEnd-i.connectStart),ssl:Yr(0===i.secureConnectionStart?0:i.requestStart-i.secureConnectionStart),ttfb:Yr(i.responseStart-i.requestStart),contentDownload:Yr(i.responseEnd-i.responseStart),domParse:Yr(i.domInteractive-i.domLoading,0,15e3,1070),resourceDownload:Yr(i.loadEventStart-i.domInteractive,0,15e3,1070),firstScreenTiming:Yr(Math.floor(t),0,15e3,15e3)},(r=e.config).extraPerformanceData&&"{}"!==JSON.stringify(r.extraPerformanceData)&&(t=(i=r.extraPerformanceData).engineInit,e=i.bundleLoad,n=I(I({},n),{engineInit:Yr(t,0,1e4),bundleLoad:Yr(e,0,1e4)})),n},publish:function(r,i){this.$walk(function(e){var t,n;e===i&&(n=(t=performance.timing).navigationStart,t={event_id:A(),event_type:x.PAGE_LOAD,event_category:M.PERFORMANCE,timestamp:Date.now(),page_url:r.originFrom||window.location.href,data:{measurements:{lcp:ei.lcp,fcp:ei.fcp,fid:ei.fid,cls:ei.cls,ttfb:ei.ttfb||r.ttfb,dns_time:r.dnsLookup,tcp_time:r.tcp,ssl_time:r.ssl,request_time:r.ttfb,response_time:r.contentDownload,dom_parse_time:r.domParse,dom_ready:t.domContentLoadedEventEnd-n,load_complete:t.loadEventEnd-n,first_screen_time:r.firstScreenTiming},replay_id:P(e),tags:{environment:e.config.env||"production",version:String(e.config.version||"")}}},null!=(n=e.reportTDEMEvent)&&n.call(e,t),n=ii.get(e))&&(n.isPagePerformanceReported=!0)})},getPageUrl:function(e){var t=this.$getConfig(e);if(null!=t&&t.urlHandler&&"function"==typeof(null==t?void 0:t.urlHandler)){t=null==t?void 0:t.urlHandler();if(t)return encodeURIComponent(t)}return e.getCurrentPageUrl()},startCalcPerformance:function(t){var n=this;try{var r=this.getPageUrl(t),i=t.getOriginFrom();this.getFirstScreenTiming(t,function(e){Qr=n.buildPerformanceLog(t,e,r,i);e=ii.get(t);!Qr||null!=e&&e.isPagePerformanceReported||n.publish(Qr,t)})}catch(t){}},getFirstScreenTiming:function(a,l){var u=this;a.lifeCycle.on("destroy",function(){v&&clearTimeout(v)});var c,d=this,n=["script","style","link","br"],f=[],h={},p=(mt("paint")&&(c=new PerformanceObserver(function(e){e.getEntries().forEach(function(e){var t;"paint"===e.entryType&&"first-contentful-paint"===e.name&&0<(t=document.querySelectorAll("[TDEM-FIRST-SCREEN-TIMING],[AEGIS-FIRST-SCREEN-TIMING]")).length&&a.config.id&&!u.performanceMap[a.config.id]&&(u.setFirstScreenInfo(a,e.startTime,t[0],t),null!=l&&l(e.startTime),p.disconnect(),c.disconnect(),v)&&clearTimeout(v)})})).observe({entryTypes:["paint"]}),new MutationObserver(function(e){var t={roots:[],ignores:[],rootsDomNum:[],time:performance.now()};e.forEach(function(e){e&&e.addedNodes&&Array.prototype.slice.call(e.addedNodes).forEach(function(e){d.isEleInArray(e,t.ignores)?t.ignores.push(e):1===e.nodeType&&(e.hasAttribute("TDEM-FIRST-SCREEN-TIMING")||e.hasAttribute("AEGIS-FIRST-SCREEN-TIMING"))?(Object.prototype.hasOwnProperty.apply(h,[t.time])||(h[t.time]=[]),h[t.time].push(e)):1===e.nodeType&&(d.hasAncestorOrSelfWithAttribute(e,"TDEM-IGNORE-FIRST-SCREEN-TIMING")?t.ignores.push(e):-1!==n.indexOf(e.nodeName.toLocaleLowerCase())||d.isEleInArray(e,t.roots)||(t.roots.push(e),t.rootsDomNum.push(d.walkAndCount(e)||0)))})}),t.roots.length&&f.push(t)})),m=(p.observe(document,{childList:!0,subtree:!0}),function(n){(n=void 0===n?0:n)||(r=0,(e=Object.keys(h)).length?(n=Math.max.apply(null,e),u.setFirstScreenInfo(a,n,null==(e=h[n])?void 0:e[0],h)):f.forEach(function(e){for(var t=0;t<e.roots.length;t++)e.rootsDomNum[t]>r&&d.isInFirstScreen(e.roots[t])&&(r=e.rootsDomNum[t],n=e.time,u.setFirstScreenInfo(a,n,e.roots[t]))}),f.length=0,Object.keys(h).forEach(function(e){h[e]=h[e].map(function(e){var t={tagName:e.tagName},n=e.attributes;if(!n)return e;for(var r=0;r<n.length;r++){var i=n[r];i.name&&(t[i.name]=e.getAttribute(i.name))}return t})}));var r,e=performance.timing,t=e.domInteractive-e.domLoading,i=n;v=null;for(var o=0,s=[t,e.loadEventStart-e.domInteractive,i];o<s.length;o++)if(s[o]<=0&&0<ri){v=setTimeout(function(){return m(i)},3e3);break}v?--ri:(p.disconnect(),null!=c&&c.disconnect(),null!=l&&l(n))}),v=setTimeout(function(){return m()},3e3)},setFirstScreenInfo:function(e,t,n,r){var i;e.config.id&&this.performanceMap[e.config.id]||(e.config.id&&(this.performanceMap[e.config.id]=!0),("object"!=typeof(null==(i=e.config)?void 0:i.pagePerformance)||null!=(i=e.config.pagePerformance)&&i.firstScreenInfo)&&(e.firstScreenInfo={element:n,timing:t,markDoms:r}))},isEleInArray:function(e,t){return!(!e||e===document.documentElement)&&(-1!==t.indexOf(e)||this.isEleInArray(e.parentElement,t))},isInFirstScreen:function(e){var t;return!(!e||"function"!=typeof e.getBoundingClientRect)&&(e=e.getBoundingClientRect(),t=window.innerHeight,0<=e.left)&&e.left<window.innerWidth&&0<=e.top&&e.top<t&&0<e.width&&0<e.height},walkAndCount:function(e){var t=0;if(e&&1===e.nodeType){t+=1;var n=e.children;if(null!=n&&n.length)for(var r=0;r<n.length;r++)1===n[r].nodeType&&(n[r].hasAttribute("TDEM-IGNORE-FIRST-SCREEN-TIMING")||n[r].hasAttribute("AEGIS-IGNORE-FIRST-SCREEN-TIMING"))||(t+=this.walkAndCount(n[r]))}return t},hasAncestorOrSelfWithAttribute:function(e,t){for(var n=t.replace(/^TDEM-/,"AEGIS-"),r=e;r&&r!==document.body;){if(r.hasAttribute(t)||n!==t&&r.hasAttribute(n))return!0;r=r.parentElement}return!1}}),si=(new e({name:"spa"}),["replaceState","pushState","popstate","hashchange"]),ai=new e({name:"spa",visitStates:new WeakMap,navigationStack:[],navigationIndex:-1,onNewTdem:function(n){var r=this,e=(history.pushState=this.wr("pushState")||history.pushState,history.replaceState=this.wr("replaceState")||history.replaceState,this.sendPv=this.sendPv.bind(this),location.href);this.navigationStack.length||(this.navigationStack=[e],this.navigationIndex=0),n.config.spa&&this.sendPv(n,"reload"),si.forEach(function(e){var t=e;window.addEventListener(e,function(){return r.sendPv.call(r,n,t)})})},wr:function(n){var r=history[n],e="__"+n+"__hasWrittenByTamSpa";return"function"==typeof r&&!history[e]&&(Object.defineProperty(history,e,{value:!0,enumerable:!1}),function(){var e=r.apply(this,arguments),t=null;return"function"==typeof Event?t=new Event(n):(t=document.createEvent("HTMLEvents")).initEvent(n,!1,!0),window.dispatchEvent(t),e})},resolveNavigationType:function(e,t){var n;return"pushState"===e?(this.navigationIndex<this.navigationStack.length-1&&(this.navigationStack=this.navigationStack.slice(0,this.navigationIndex+1)),this.navigationStack.push(t),this.navigationIndex=this.navigationStack.length-1,"push"):"replaceState"===e?(this.navigationIndex<0?(this.navigationStack=[t],this.navigationIndex=0):this.navigationStack[this.navigationIndex]=t,"replace"):"hashchange"===e?"hashchange":"popstate"===e?0<=(e=this.navigationStack.lastIndexOf(t))?(n=e<this.navigationIndex?"back":"forward",this.navigationIndex=e,n):(this.navigationStack.push(t),this.navigationIndex=this.navigationStack.length-1,"forward"):"reload"},sendPv:function(s,e){var a=this,l=(void 0===e&&(e="reload"),s._customPageUrl),u=(s._customPageUrl=null,location.pathname+location.hash+s.config.id),c=s.getOriginFrom(),d=this.visitStates.get(s),f=this.resolveNavigationType(e,location.href);u&&(u!==(null==d?void 0:d.firedUrl)||l)&&this.$walk(function(n){var r,i,e,t,o;n===s&&("function"==typeof n.beginPageVisit?n.beginPageVisit(c,!!l):d&&(t=n,o=Be(),t.viewId=o,"function"==typeof t.extendBean)&&t.extendBean("viewId",o),r="string"==typeof(e=n.viewId||(null==(e=n.bean)?void 0:e.viewId)||"")?e:"",i=Date.now(),a.visitStates.set(s,{firedUrl:u,pageUrl:c}),setTimeout(function(){var e,t=I(I({event_id:A(),event_type:x.PAGE_VIEW,event_category:M.BEHAVIOR,timestamp:i,page_url:c},r?{view_id:r}:{}),{data:{page_title:document.title||"",referrer:document.referrer||void 0,is_effective_action:!0,replay_id:P(n),tags:{environment:n.config.env||"production",version:String(n.config.version||""),is_spa:"true"},event_properties:{navigation_type:f,from_page:(l||(null==d?void 0:d.pageUrl)||"").slice(0,512),to_page:(c||"").slice(0,512)}}});null!=(e=n.reportTDEMEvent)&&e.call(n,t)},0))})},destroy:function(){this.option.sendPv=function(){}}}),li="__MONITOR_SESSION_V1__";function ui(e,t){"undefined"!=typeof document&&(e=[e+"="+encodeURIComponent(t),"path=/","SameSite=Lax"],"undefined"!=typeof location&&"https:"===location.protocol&&e.push("Secure"),document.cookie=e.join("; "))}function ci(e,t,n){void 0===n&&(n=1);var r=Date.now();return{sessionId:e,createdAt:r,lastActivity:r,source:t,version:n}}function di(e,t){var n,r,i;return"undefined"==typeof window?ci(t(),e):(r="undefined"!=typeof document&&(r="_tdem_s".replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=document.cookie.match(new RegExp("(?:^|; )"+r+"=([^;]*)")))?decodeURIComponent(r[1]):null,n=window[li],r?(null==n?void 0:n.sessionId)===r?(n.lastActivity=Date.now(),n):(i=ci(r,(null==n?void 0:n.source)||e,(null==n?void 0:n.version)||1),window[li]=i):null!=n&&n.sessionId?(n.lastActivity=Date.now(),ui("_tdem_s",n.sessionId),n):(i=ci(t(),e),ui("_tdem_s",(window[li]=i).sessionId),i))}function fi(){var e="undefined"==typeof globalThis?{}:globalThis;return e[pi]||(e[pi]=Object.create(null))}function hi(e){return null==e?"":String(e)}var pi="__TDEM_ENTRY_REGISTRY__",mi=(vi.prototype.request=function(o,s){var a=this;return void 0===s&&(s={}),o.sendBeacon||o.handoff?Promise.resolve(this.handoff(o,s)):new Promise(function(n){var e,r,t,i=new XMLHttpRequest;i.sendByTdem=!0,i.addEventListener("readystatechange",function(){var e,t;4===i.readyState&&((e={ok:0<i.status&&i.status<400,status:i.status,statusText:i.statusText,body:i.response,request:o}).ok?(null!=(t=s.success)&&t.call(s,i.response),null!=(t=s.final)&&t.call(s,e),n(e)):(t=I(I({},e),{error:i.response}),null!=(e=s.fail)&&e.call(s,i.response),null!=(e=s.final)&&e.call(s,t),n(t)))}),"get"===(o.method||"GET").toLowerCase()?(i.open("get",(e=o.url,r=o.data,"string"!=typeof e?"":"object"==typeof r&&r?(t=Object.getOwnPropertyNames(r).map(function(e){var t=r[e];return e+"="+("string"==typeof t?encodeURIComponent(t):encodeURIComponent(JSON.stringify(t)))}).join("&"),e+(-1===e.indexOf("?")?"?":"&")+$(t)):e)),a.applyHeaders(i,o.headers),i.send()):(i.open("post",o.url),a.applyHeaders(i,o.headers),o.contentType&&i.setRequestHeader("Content-Type",o.contentType),t=void 0!==o.body?o.body:o.data,a.shouldSanitizeEvalKeyword(o,t)&&(t=$(t)),i.send(t))})},vi.prototype.shouldSanitizeEvalKeyword=function(e,t){return"string"==typeof t&&!("replay"===e.kind||(e=null!=(t=null==(t=e.headers)?void 0:t["Content-Encoding"])?t:null==(t=e.headers)?void 0:t["content-encoding"])&&/gzip/i.test(e))},vi.prototype.handoff=function(e,t){void 0===t&&(t={});var n,r="undefined"!=typeof navigator?navigator:void 0;return r&&"function"==typeof r.sendBeacon?(n=void 0!==e.body?e.body:e.data,n={ok:r=r.sendBeacon(e.url,n),request:e,handoffAccepted:r,error:r?void 0:new Error("navigator.sendBeacon rejected the payload")},r?null!=(r=t.success)&&r.call(t,{accepted:!0}):null!=(r=t.fail)&&r.call(t,n.error),null!=(r=t.final)&&r.call(t,n),n):(r={ok:!1,request:e,error:new Error("navigator.sendBeacon is unavailable")},null!=(n=t.fail)&&n.call(t,r.error),null!=(e=t.final)&&e.call(t,r),r)},vi.prototype.applyHeaders=function(t,n){n&&Object.keys(n).forEach(function(e){t.setRequestHeader(e,n[e])})},vi);function vi(){}function gi(e){try{var t="undefined"!=typeof window?window.location.href:"https://tdem.invalid/",n=new URL(e,t);return n.origin+n.pathname+n.hash}catch(t){return e.split("?")[0]}}var yi,wi=new Map,r=(T(y,yi=kt),y.prototype.beginPageVisit=function(e,t){void 0===t&&(t=!1);var n=gi(e);return!t&&n===this.viewPageIdentity||(this.viewId=Be(),this.extendBean("viewId",this.viewId),this.lifeCycle.emit("pageVisitChanged",{pageUrl:e,viewId:this.viewId})),this.viewPageIdentity=n,this.viewId},y.prototype.reportPageView=function(e,t){void 0===t&&(t={}),this.beginPageVisit(e||t.pageUrl||this.getOriginFrom(),!!t.navigationType),yi.prototype.reportPageView.call(this,e,t)},y.prototype.leavePage=function(){this._customPageUrl&&(this.beginPageVisit("undefined"!=typeof window?window.location.href:"",!0),yi.prototype.leavePage.call(this))},y.prototype._bootstrapInit=function(e){this.setConfig(e),this.config=O(this.config,e.hostUrl),this._prefetchConfigAndInit(e)},y.prototype._initImmediately=function(e){this.init(e),this._afterInit(e)},y.prototype._prefetchConfigAndInit=function(o){return D(this,void 0,void 0,function(){var t,n,r,i;return L(this,function(e){switch(e.label){case 0:if(t=this.config.id,n=this._buildPrefetchConfigUrl(),r=null,!t||!n)return[3,4];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.transportRequest({kind:"config",url:n,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project_key:t})})];case 2:return(i=e.sent()).ok&&0===(i="string"==typeof i.body?JSON.parse(i.body):i.body).code&&i.data&&(r=i.data),[3,4];case 3:return e.sent(),(i=this._loadPrefetchDataFromCache(t))&&(r=i),[3,4];case 4:r&&(this._prefetchedConfigData=r);try{this._initAfterPreparedConfig(o)}catch(e){console.warn(e),console.log("%cThe above error occurred in the process of initializing TDEM, which will affect your normal use of TDEM.\nIt is recommended that you contact us for feedback and thank you for your support.","color: red"),this.sendSDKError(e)}return[2]}})})},y.prototype._buildPrefetchConfigUrl=function(){var e=(this.config.url||"").replace(/\/+$/,"");return e?e+"/api/v1/sample-config":""},y.prototype._loadPrefetchDataFromCache=function(e){var t;try{var n,r=localStorage.getItem("TDEM_SAMPLE_CONFIG");return r?!((n=JSON.parse(r)).projectKey!==e||6048e5<=Date.now()-n.timestamp)&&null!=(t=n.document)&&t.event?n.document:null:null}catch(e){return null}},y.prototype._initAfterPreparedConfig=function(e){for(var t=0;t<kt.installedPlugins.length;t++)try{kt.installedPlugins[t].patch(this)}catch(e){this.sendSDKError(e)}this.lifeCycle.emit("onInited"),this._afterInit(e)},y.prototype._afterInit=function(e){var t,o,n=this,r=(this._sdkInitialized=!0,this.config.id),i=y.entryName;(r=(r=hi(r))?fi()[r]:null)&&r.owner===i&&(r.state=1),this.extendBean("sessionId",y.sessionID),this.extendBean("from",this.getCurrentPageUrl()),"undefined"!=typeof document&&this.extendBean("referer",encodeURIComponent(document.referrer||"")),t=z(F("tdem-web-retry-report-requests"),[]),(o=function(){var i;t.length&&(i=t.splice(0,1)[0],U("tdem-web-retry-report-requests",JSON.stringify(t)),n.$request(i,function(){for(var e,t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];try{return null==(t=wi.get(null==(e=i.extraRetryOptions)?void 0:e.success))?void 0:t.apply(i,n)}finally{o()}},function(){for(var e,t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];try{return null==(t=wi.get(null==(e=i.extraRetryOptions)?void 0:e.fail))?void 0:t.apply(i,n)}finally{o()}}))})()},y.prototype.getBean=function(t){var n=this;return void 0===t&&(t=[]),""+Object.getOwnPropertyNames(this.bean).filter(function(e){return-1===t.indexOf(e)}).map(function(e){return"from"===e?"from="+n.getCurrentPageUrl():e+"="+n.bean[e]}).join("&")},y.prototype.getCurrentPageUrl=function(){var e;return this._customPageUrl?encodeURIComponent(this._customPageUrl.slice(0,2048)):(e=this.config.pageUrl||location.href,e=(e="function"==typeof this.config.urlHandler?this.config.urlHandler()||location.href:e).slice(0,2048),encodeURIComponent(e))},y.prototype.getOriginFrom=function(){if(this._customPageUrl)return this._customPageUrl.slice(0,2048);try{return("undefined"!=typeof window&&window.location?window.location.href:"").slice(0,2048)}catch(e){return""}},y.prototype.ready=function(){function o(){var e,n,r,i;t.reportRequestQueue.length&&(e=t.reportRequestQueue.splice(0,1)[0],n=e.options,r=e.success,i=e.fail,t.$request(n,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return null==r?void 0:r.apply(n,e)}finally{o()}},function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{return null==i?void 0:i.apply(n,e)}finally{o()}}))}var t=this;o(),this.isReportReady=!0},y.prototype.request=function(l,n,u){var c,d,f=this;this.config.reportImmediately||this.isReportReady?this.$request(l,c=function(e){var t=z(F("tdem-web-retry-report-requests"),[]);null!=t&&t.length&&l.extraRetryOptions&&(t.splice(t.findIndex(function(e){return e.extraRetryOptions.requestId===l.extraRetryOptions.requestId}),1),U("tdem-web-retry-report-requests",JSON.stringify(t)),wi.delete(l.extraRetryOptions.success),wi.delete(l.extraRetryOptions.fail)),null!=n&&n(e)},d=function(e){if(!f.config.reportRetry)return null==u?void 0:u(e);var t,n="boolean"==typeof f.config.reportRetry?ln:I(I({},ln),f.config.reportRetry),r=n.maxRetryCount,i=void 0===r?ln.maxRetryCount:r,r=n.retryInterval,r=void 0===r?ln.retryInterval:r,n=n.whenRetryEndStillFail,o=void 0===n?ln.whenRetryEndStillFail:n,s=(l.extraRetryOptions||(l.extraRetryOptions={requestId:"",retriedCount:0,success:"",fail:""}),l.extraRetryOptions),a=(s.requestId=s.requestId||l.url+"-"+Date.now()+"-"+Math.random(),s.requestId),n=(s.retriedCount=s.retriedCount||0,s.success=s.success||a+"_successCallback",s.fail=s.fail||a+"_failCallback",z(F("tdem-web-retry-report-requests"),[]));n.find(function(e){return e.extraRetryOptions.requestId===a})?(t=n.findIndex(function(e){return e.extraRetryOptions.requestId===a}),n[t]=l):n.push(l),U("tdem-web-retry-report-requests",JSON.stringify(n)),setTimeout(function(){if(s.retriedCount<i)l.extraRetryOptions.retriedCount+=1,f.$request(l,c,d);else{if("discard"===o){var e=z(F("tdem-web-retry-report-requests"),[]).filter(function(e){return(null==(e=e.extraRetryOptions)?void 0:e.requestId)!==a});if(e.length)U("tdem-web-retry-report-requests",JSON.stringify(e));else try{localStorage.removeItem("tdem-web-retry-report-requests")}catch(e){}}wi.delete(s.success),wi.delete(s.fail)}},"function"==typeof r?r(l.extraRetryOptions.retriedCount):r),null!=u&&u(e),wi.has(s.success)||wi.set(s.success,c),wi.has(s.fail)||wi.set(s.fail,d)}):this.reportRequestQueue.push({options:l,success:n,fail:u})},y.prototype.$request=function(a,e,t){var n,r;if(a&&"string"==typeof a.url&&""!==a.url&&this.bean.id)return n=a.url,!1!==a.addBean&&(n=((e,t)=>{var n,r,i,o=e,s=a.beanFilter||[];for(n in t)-1===s.indexOf(n)&&((i=(r=new RegExp("([?&])"+n+"(=([^&]*))?(?=&|$)")).exec(o))?i[2]&&""!==i[3]&&"undefined"!==i[3]||(o=o.replace(r,"$1"+n+"="+t[n])):(i=-1<o.indexOf("?")?"&":"?",o+=i+n+"="+t[n]));return o})(n,I(I({},this.bean),{from:this.getCurrentPageUrl()}))),a.url=n,n=a.method||"get",r=this.config.onBeforeRequest,(a=r?r(a,this):a)?a.url?(r={success:e,fail:t},void((e={kind:a.type===ue.WHITE_LIST?"config":"events",url:a.url,method:n.toUpperCase(),contentType:a.contentType,data:a.data,body:a.data,sendBeacon:!!(null!=a&&a.sendBeacon||this.sendNow),source:a}).sendBeacon?this.transportHandoff(e,r):this.transportRequest(e,r))):console.warn("Please handle the parameters reasonably, options.url is necessary"):console.warn("Sending request blocked")},y.prototype.publishPluginsLogs=function(){var e=y.installedPlugins.find(function(e){return"assets"===e.name});null!=e&&e.option.collectNotReportedLog(this)},y.prototype.uploadLogs=function(e,t){var n;void 0===e&&(e={}),void 0===t&&(t={}),null!=(n=this.lifeCycle)&&n.emit("uploadLogs",e,t)},y.prototype.reportWebVitals=function(e){try{var t=y.installedPlugins.find(function(e){return"webVitals"===e.name});t&&this.config.webVitals&&this.config.webVitals.manualReport&&t.option.publish(this,e)}catch(e){}},y.prototype.destroy=function(e){var t,n,r;void 0===e&&(e=!1),n=this.config.id,t=y.entryName,(r=(n=hi(n))?fi():null)&&r[n]&&r[n].owner===t&&delete r[n],yi.prototype.destroy.call(this,e)},y.entryName="tdem-web-sdk",y.sessionID=di("tdem",Be).sessionId,y);function y(e,t){var n,r,i,s,o,a,l,u,c,d,f,h,p=yi.call(this,e,t=void 0===t?{}:t)||this,m=(p._entrySkipped=!1,p.sendNow=!1,p.isReportReady=!1,p.reportRequestQueue=[],p._sdkInitialized=!1,p.viewId="",p.viewPageIdentity="",p.speedLogPipeline=dt([(u=[],c=(o=p).config,o.lifeCycle.on("destroy",function(){u.length=0}),function(e,t){Array.isArray(e)?u=u.concat(e):u.push(e),a&&u.length>=a||o.sendNow&&0<u.length?(u=Oe(u),0<(u=Array.isArray(u)?u:[]).length&&t(u.splice(0,u.length)),l&&clearTimeout(l)):(l&&clearTimeout(l),l=setTimeout(function(){l=null,u=Oe(u),0<(u=Array.isArray(u)?u:[]).length&&t(u.splice(0,u.length))},c.delay))}),(s=p.config,function(e,t){var n,r,i,o="number"==typeof s.repeat?s.repeat:60;!s.speedSample||o<=0?t(e):(n=(null==s?void 0:s.id)||"0",r=Ie[n]||{},Array.isArray(e)?(i=e.filter(function(e){var t=!r[e.url]||r[e.url]<o;return t?(r[e.url]=1+~~r[e.url],Ie[n]=r):xe[n]||Ne(n),t})).length&&t(i):!r[e.url]||r[e.url]<o?(r[e.url]=1+~~r[e.url],Ie[n]=r,t(e)):xe[n]||Ne(n))}),(i=p,function(t,n){Tn(function(e){i.extendBean("netType",e),n(t)})}),function(e,t){null!=(n=p.lifeCycle)&&n.emit("beforeReportSpeed",e);var n,r=p.config.beforeReportSpeed;if((e="function"==typeof r?e.filter(function(e){return!1!==r(e)}):e).length)return t(e)},function(e,t){t(e.map(function(e){return void 0!==e.payload&&delete e.payload,e}))},function(e){return p.sendPipeline([function(e,t){t({type:ue.SPEED,url:""+p.config.speedUrl,method:"post",data:ae(e,I(I({},p.bean),{from:p.getCurrentPageUrl()})),log:e})}],ue.SPEED)(e)}]),t=e&&e.id,d=y.entryName,(t=hi(t))?(m=(f=fi())[t])&&m.owner!==d?{status:"skipped_duplicate",owner:m.owner}:(m||(f[t]={owner:d,state:0}),{status:"owned",owner:d}):{status:"owned",owner:d});if("skipped_duplicate"===m.status)p._entrySkipped=!0,-1!==(f=kt.instances.indexOf(p))&&kt.instances.splice(f,1),console.warn("[TDEM] skip "+y.entryName+": "+(e&&e.id)+" owned by "+m.owner);else{p.viewId=Be(),p.extendBean("viewId",p.viewId),p.viewPageIdentity=gi(p.getOriginFrom()),p.getInternalTransport()||p.setInternalTransport(new mi),e.asyncPlugin=!0;try{"undefined"!=typeof document&&(h=String(e.userId||e.uin||(null!=(n=document.cookie.match(/\buin=\D+(\d*)/))?n:[])[1]||(null!=(r=document.cookie.match(/\bilive_uin=\D*(\d+)/))?r:[])[1]||""),e.userId=h,e.uin=e.uin||h),p._bootstrapInit(e)}catch(e){console.warn(e),console.log("%cThe above error occurred in the process of initializing TDEM, which will affect your normal use of TDEM.\nIt is recommended that you contact us for feedback and thank you for your support.","color: red"),p.sendSDKError(e)}}return p}new e({name:"ie"}),new e({name:"onClose"});var bi=new e({name:"onClose",onNewTdem:function(e){function t(){return r.publishNotReportedLog(e)}function n(){"undefined"!=typeof document&&"hidden"!==document.visibilityState||t()}var r=this;document.addEventListener("visibilitychange",n,!0),window.addEventListener("pagehide",t,!0),e.lifeCycle.on("destroy",function(){document.removeEventListener("visibilitychange",n,!0),window.removeEventListener("pagehide",t,!0)})},publishNotReportedLog:function(n){var r=this;this.$walk(function(e){if(e===n){var t=e.sendNow;try{e.sendNow=!0,e.lifeCycle.emit("beforeCloseFlush"),e.publishPluginsLogs(),r.publishThrottlePipeLogs(e)}finally{e.sendNow=t}}})},publishThrottlePipeLogs:function(e){null!=e&&e.speedLogPipeline([]),null!=e&&e.tdemEventPipeline([])}});function ki(){return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,function(e){return(e^(16*Math.random()&15)>>e/4).toString(16)})}new e({name:"aid"}),Ci.generate=function(){return"rep_"+this.uuid32()},Ci.uuid32=function(){return"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx".replace(/x/g,function(){return Math.floor(16*Math.random()).toString(16)})};var _i=Ci,Si="[SessionReplay]",Ei=!1;function Ci(){}function u(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Ei&&console.log.apply(console,g([Si+"["+e+"]"],t))}function Ri(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Ei&&console.debug.apply(console,g([Si+"["+e+"]"],t))}function Ti(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Ei&&console.log.apply(console,g([Si+"["+e+"] WARN:"],t))}function Oi(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];Ei&&console.log.apply(console,g([Si+"["+e+"] ERROR:"],t))}Pi.prototype.setTdemInstance=function(e){this.tdemInstance=e},Pi.prototype.createSession=function(e){void 0===e&&(e="session");var t=null==(t=this.session)?void 0:t.replayId,n=di("tdem",ki),n=I({id:n.sessionId,replayId:_i.generate(),started:Date.now(),lastActivity:Date.now(),segmentId:0,sampled:e},t?{previousReplayId:t}:{});return this.session=n,this.syncSharedSession(n.id),u("SessionManager","Document replay session created:",n.id,n.replayId),n},Pi.prototype.restoreSession=function(){return this.session},Pi.prototype.saveSession=function(){},Pi.prototype.refreshSession=function(){var e=null!=(e=null==(e=this.session)?void 0:e.sampled)?e:"session";return this.createSession(e)},Pi.prototype.updateActivity=function(){this.session&&(this.session.lastActivity=Date.now())},Pi.prototype.incrementSegmentId=function(){var e;return this.session?(e=this.session.segmentId,this.session.segmentId+=1,e):0},Pi.prototype.shouldRefreshSession=function(){return!1},Pi.prototype.getSession=function(){return this.session},Pi.prototype.getSessionId=function(){var e;return null!=(e=null==(e=this.session)?void 0:e.id)?e:""},Pi.prototype.getReplayId=function(){var e;return null!=(e=null==(e=this.session)?void 0:e.replayId)?e:""},Pi.prototype.clearSession=function(){var e;this.session=null;try{null!=(e=window.sessionStorage)&&e.removeItem("tdem_session")}catch(e){}},Pi.prototype.syncSharedSession=function(e){var t,n,r;this.tdemInstance&&this.tdemInstance.extendBean("sessionId",e),e=e,"undefined"!=typeof window&&(t=Date.now(),(n=window[li])?(r=n.sessionId!==e,n.sessionId=e,n.version=r?n.version+1:n.version,n.source="tdem",r&&(n.createdAt=t),n.lastActivity=t):window[li]=ci(e,"tdem"),ui("_tdem_s",e),window.dispatchEvent(new CustomEvent("monitor-session-update",{detail:{sessionId:e,source:"tdem"}})))};var xi=Pi,Ii=((i={})[i.DomContentLoaded=0]="DomContentLoaded",i[i.Load=1]="Load",i[i.FullSnapshot=2]="FullSnapshot",i[i.IncrementalSnapshot=3]="IncrementalSnapshot",i[i.Meta=4]="Meta",i[i.Custom=5]="Custom",i[i.Plugin=6]="Plugin",i[i.Asset=7]="Asset",i),Mi=(Ai.prototype.ensureReady=function(){return D(this,void 0,void 0,function(){return L(this,function(e){return[2,this.ready]})})},Ai.prototype.postMessage=function(n,r){var i=this,o=this.nextId++;return new Promise(function(e,t){i.pendingRequests.set(o,{resolve:e,reject:t}),i.worker.postMessage({id:o,method:n,arg:r})})},Ai.prototype.destroy=function(){this.pendingRequests.forEach(function(e){return(0,e.reject)(new Error("Worker destroyed"))}),this.pendingRequests.clear(),this.worker.terminate()},Ai);function Ai(e){var o=this;this.nextId=0,this.pendingRequests=new Map,this.worker=e,this.worker.addEventListener("message",function(e){var e=e.data,t=e.id,n=e.success,r=e.response;"init"!==e.method&&(e=o.pendingRequests.get(t))&&(o.pendingRequests.delete(t),n?e.resolve(r):e.reject(new Error(r||"Worker request failed")))}),this.ready=new Promise(function(t,n){var r=function(e){e=e.data;"init"===e.method&&e.success&&(o.worker.removeEventListener("message",r),clearTimeout(i),t())},i=(o.worker.addEventListener("message",r),o.worker.addEventListener("error",function(e){o.worker.removeEventListener("message",r),clearTimeout(i),n(new Error("Worker error: "+(e.message||"unknown")))}),setTimeout(function(){o.worker.removeEventListener("message",r),n(new Error("Worker init timeout (5s)"))},5e3))})}function Pi(e){this.session=null,this.tdemInstance=null}function Di(e){if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e).length;for(var t=0,n=0;n<e.length;n++){var r=e.charCodeAt(n);r<128?t+=1:r<2048?t+=2:55296<=r&&r<=56319&&n+1<e.length&&56320<=e.charCodeAt(n+1)&&e.charCodeAt(n+1)<=57343?(t+=4,n+=1):t+=3}return t}Ni.prototype.initWorker=function(){var t=this,e=(()=>{try{var e,t,n;return"undefined"==typeof Worker||"undefined"==typeof Blob||"undefined"==typeof URL?null:(e=new Blob(["\n(function() {\n var events = [];\n var totalSize = 0;\n\n function handleMessage(data) {\n var method = data.method;\n var id = data.id;\n\n switch (method) {\n case 'addEvent':\n events.push(data.arg);\n totalSize += data.arg.length;\n return { id: id, method: method, success: true, response: totalSize };\n\n case 'finish':\n var json = '[' + events.join(',') + ']';\n events = [];\n totalSize = 0;\n // 返回原始 JSON 字符串,压缩在主线程做(pako 不好内联到 worker)\n return { id: id, method: method, success: true, response: json };\n\n case 'clear':\n events = [];\n totalSize = 0;\n return { id: id, method: method, success: true, response: void 0 };\n\n default:\n return { id: id, method: method, success: false, response: 'Unknown method' };\n }\n }\n\n self.addEventListener('message', function(e) {\n try {\n var result = handleMessage(e.data);\n self.postMessage(result);\n } catch (err) {\n self.postMessage({\n id: e.data.id,\n method: e.data.method,\n success: false,\n response: err.message || 'Worker error'\n });\n }\n });\n\n // 就绪信号\n self.postMessage({ method: 'init', success: true });\n})();\n"],{type:"application/javascript"}),t=URL.createObjectURL(e),n=new Worker(t,{name:"tdem-replay-compressor"}),URL.revokeObjectURL(t),u("CompressionWorker","Worker created successfully"),new Mi(n))}catch(e){return Ti("CompressionWorker","Failed to create worker, will fallback to sync buffer:",e),null}})();e?(this.workerHandler=e,this.useWorker=!0,e.ensureReady().then(function(){t.workerReady=!0,u("EventBuffer","Worker ready, migrating buffered events"),t.migrateEventsToWorker()}).catch(function(e){Ti("EventBuffer","Worker init failed, falling back to sync buffer:",e),t.useWorker=!1,t.workerHandler=null})):u("EventBuffer","Worker not available, using sync buffer")},Ni.prototype.migrateEventsToWorker=function(){if(this.workerHandler&&this.workerReady)for(var e=0,t=this.events;e<t.length;e++){var n=t[e];this.addEventToWorker(n)}},Ni.prototype.addEventToWorker=function(e){if(this.workerHandler)try{var t=JSON.stringify(e);this.workerHandler.postMessage("addEvent",t),this.workerEventCount++,this.workerSize+=t.length}catch(e){Ti("EventBuffer","Failed to send event to worker:",e)}},Ni.prototype.addEvent=function(e){var t=this.estimateEventSize(e);this.currentSize+t>this.config.maxSize&&(Ti("EventBuffer","Size limit exceeded, removing old events"),this.trimOldEvents(t)),this.events.push(e),this.currentSize+=t,this.useWorker&&this.workerReady&&this.workerHandler&&(0<this.workerEventCount&&this.workerSize+t>this.config.maxSize&&(this.workerHandler.postMessage("clear"),this.workerEventCount=0,this.workerSize=0),this.addEventToWorker(e))},Ni.prototype.getEvents=function(){return g(this.events)},Ni.prototype.getEventCount=function(){return this.events.length},Ni.prototype.getSize=function(){return this.currentSize},Ni.prototype.isEmpty=function(){return 0===this.events.length},Ni.prototype.detachEvents=function(){var e=this.events;return this.events=[],this.currentSize=0,this.useWorker&&this.workerHandler&&(this.workerHandler.postMessage("clear"),this.workerEventCount=0,this.workerSize=0),e},Ni.prototype.hasBaselinePair=function(){for(var e=!1,t=!1,n=0;n<this.events.length;n++){var r=this.events[n].type;if(r===Ii.Meta?e=!0:r===Ii.FullSnapshot&&(t=!0),e&&t)return!0}return!1},Ni.prototype.finishAsync=function(){return D(this,void 0,void 0,function(){var t;return L(this,function(e){return[2,{events:t=this.getEvents(),eventCount:t.length,uncompressedSize:this.currentSize}]})})},Ni.prototype.finish=function(){var e=this.getEvents();return{events:e,eventCount:e.length,uncompressedSize:this.currentSize}},Ni.prototype.clear=function(){this.events=[],this.currentSize=0,this.useWorker&&this.workerHandler&&(this.workerHandler.postMessage("clear"),this.workerEventCount=0,this.workerSize=0)},Ni.prototype.destroy=function(){this.clear(),this.workerHandler&&(this.workerHandler.destroy(),this.workerHandler=null),this.useWorker=!1,this.workerReady=!1},Ni.prototype.estimateEventSize=function(e){try{return Di(JSON.stringify(e))+1}catch(e){return 1024}},Ni.prototype.trimOldEvents=function(e){for(var t=-1,n=this.events.length-1;0<=n;n--)if(this.events[n].type===Ii.FullSnapshot){t=n;break}var r=t;if(0<r)for(n=r-1;0<=n;n--)if(this.events[n].type===Ii.Meta){r=n;break}for(var i,o=0,s=Math.max(e,.2*this.config.maxSize),a=0;a<r&&o<s;)a++,(i=this.events.shift())&&(o+=this.estimateEventSize(i));if(r<0)for(;0<this.events.length&&o<s;)(i=this.events.shift())&&(o+=this.estimateEventSize(i));this.currentSize=Math.max(0,this.currentSize-o)},Ni.prototype.hasCheckout=function(){return this.events.some(function(e){return e.type===Ii.Meta||e.type===Ii.FullSnapshot})},Ni.prototype.getLastCheckoutTime=function(){for(var e=this.events.length-1;0<=e;e--){var t=this.events[e];if(t.type===Ii.FullSnapshot)return t.timestamp}return null},Ni.prototype.isUsingWorker=function(){return this.useWorker&&this.workerReady};var Li=Ni;function Ni(e,t){void 0===e&&(e={}),void 0===t&&(t=!1),this.events=[],this.currentSize=0,this.workerHandler=null,this.useWorker=!1,this.workerReady=!1,this.workerEventCount=0,this.workerSize=0,this.config={maxSize:null!=(e=e.maxSize)?e:5242880},t&&this.initWorker()}function Fi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ui(e,t,n,r,i,o,s){try{var a=e[o](s),l=a.value}catch(e){return n(e)}a.done?t(l):Promise.resolve(l).then(r,i)}function zi(a){return function(){var e=this,s=arguments;return new Promise(function(t,n){var r=a.apply(e,s);function i(e){Ui(r,t,n,i,o,"next",e)}function o(e){Ui(r,t,n,i,o,"throw",e)}i(void 0)})}}function Bi(e,t,n){return e.apply(t,n)}function ji(e,t,n){t=qi(t);var r=e,t=Gi()?Reflect.construct(t,n||[],qi(e).constructor):t.apply(e,n);if(!t||"object"!=typeof t&&"function"!=typeof t){if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");if(void 0===(t=r))throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t}function b(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Wi(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,to(r.key),r)}}function k(e,t,n){return t&&Wi(e.prototype,t),n&&Wi(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Me(e,t){var n,r,i,o,s="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(s)return i=!(r=!0),{s:function(){s=s.call(e)},n:function(){var e=s.next();return r=e.done,e},e:function(e){i=!0,n=e},f:function(){try{r||null==s.return||s.return()}finally{if(i)throw n}}};if(Array.isArray(e)||(s=no(e))||t&&e&&"number"==typeof e.length)return s&&(e=s),o=0,{s:t=function(){},n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Hi(){return(Hi="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=((e,t)=>{for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=qi(e)););return e})(e,t);if(r)return(r=Object.getOwnPropertyDescriptor(r,t)).get?r.get.call(arguments.length<3?e:n):r.value}).apply(null,arguments)}function qi(e){return(qi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Vi(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Yi(e,t)}function Gi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Gi=function(){return!!e})()}function Zi(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function Ae(r){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Zi(Object(i),!0).forEach(function(e){var t,n;t=r,n=i[e=e],(e=to(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):Zi(Object(i)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(i,e))})}return r}function Ji(e,t){if(null==e)return{};var n,r=((e,t)=>{if(null==e)return{};var n,r={};for(n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r})(e,t);if(Object.getOwnPropertySymbols)for(var i=Object.getOwnPropertySymbols(e),o=0;o<i.length;o++)n=i[o],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n]);return r}function Ki(){var p,e="function"==typeof Symbol?Symbol:{},t=e.iterator||"@@iterator",n=e.toStringTag||"@@toStringTag";function r(e,t,n,r){var i,o,s,a,l,u,c,d,f,t=t&&t.prototype instanceof v?t:v,t=Object.create(t.prototype);return $i(t,"_invoke",(i=e,o=n,c=r||[],d=!1,f={p:u=0,n:0,v:p,a:h,f:h.bind(p,4),d:function(e,t){return s=e,a=0,l=p,f.n=t,m}},function(e,t,n){if(1<u)throw TypeError("Generator is already running");for(d&&1===t&&h(t,n),a=t,l=n;(g=a<2?p:l)||!d;){s||(a?(1<a&&(f.n=a<3?-1:l),h(a,l)):f.v=l);try{if(u=2,s){if(g=s[e=a?e:"next"]){if(!(g=g.call(s,l)))throw TypeError("iterator result is not an object");if(!g.done)return g;l=g.value,a<2&&(a=0)}else 1===a&&(g=s.return)&&g.call(s),a<2&&(l=TypeError("The iterator does not provide a '"+e+"' method"),a=1);s=p}else if((g=(d=f.n<0)?l:i.call(o,f))!==m)break}catch(e){s=p,a=1,l=e}finally{u=1}}return{value:g,done:d}}),!0),t;function h(e,t){for(a=e,l=t,g=0;!d&&u&&!n&&g<c.length;g++){var n,r=c[g],i=f.p,o=r[2];3<e?(n=o===t)&&(l=r[(a=r[4])?5:a=3],r[4]=r[5]=p):r[0]<=i&&((n=e<2&&i<r[1])?(a=0,f.v=t,f.n=r[1]):i<o&&(n=e<3||r[0]>t||o<t)&&(r[4]=e,r[5]=t,f.n=o,a=0))}if(n||1<e)return m;throw d=!0,t}}var m={};function v(){}function i(){}function o(){}var g=Object.getPrototypeOf,e=[][t]?g(g([][t]())):($i(g={},t,function(){return this}),g),s=o.prototype=v.prototype=Object.create(e);function a(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,o):(e.__proto__=o,$i(e,n,"GeneratorFunction")),e.prototype=Object.create(s),e}return $i(s,"constructor",i.prototype=o),$i(o,"constructor",i),$i(o,n,i.displayName="GeneratorFunction"),$i(s),$i(s,n,"Generator"),$i(s,t,function(){return this}),$i(s,"toString",function(){return"[object Generator]"}),(Ki=function(){return{w:r,m:a}})()}function $i(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}($i=function(e,t,n,r){function i(t,n){$i(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))})(e,t,n,r)}function Xi(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}}}throw new TypeError(typeof e+" is not iterable")}function Yi(e,t){return(Yi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function Pe(e,t){return(e=>{if(Array.isArray(e))return e})(e)||((e,t)=>{var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,s,a=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw i}}return a}})(e,t)||no(e,t)||(()=>{throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function Qi(e,t,n,r){var i=Hi(qi(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof i?function(e){return i.apply(n,e)}:i}function eo(e){return(e=>{if(Array.isArray(e))return Fi(e)})(e)||(()=>{if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)})()||no(e)||(()=>{throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")})()}function to(e){e=(e=>{if("object"!=typeof e||!e)return e;if("undefined"==typeof Symbol||void 0===(t=e[Symbol.toPrimitive]))return String(e);var t=t.call(e,"string");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")})(e);return"symbol"==typeof e?e:e+""}function _(e){return(_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function no(e,t){var n;if(e)return"string"==typeof e?Fi(e,t):"Map"===(n="Object"===(n={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Fi(e,t):void 0}function ro(e){var n="function"==typeof Map?new Map:void 0;return(ro=function(e){if(null===e||!(t=>{try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}})(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(e))return n.get(e);n.set(e,t)}function t(){return function(e,t,n){var r;return Gi()?Reflect.construct.apply(null,arguments):((r=[null]).push.apply(r,t),t=new(e.bind.apply(e,r)),n&&Yi(t,n.prototype),t)}(e,arguments,qi(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),Yi(t,e)})(e)}function c(e,t,n){e=e,t="symbol"!==_(t)?t+"":t,n=n,t in e?co(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}function io(e,t,n){e=e,t="symbol"!==_(t)?t+"":t,n=n,t in e?fo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}var oo=["inputs"],so=["inputId"],ao=["inputs"],lo=["inputId"],uo=["type"],co=Object.defineProperty,fo=Object.defineProperty,ho=((i=ho||{})[i.Document=0]="Document",i[i.DocumentType=1]="DocumentType",i[i.Element=2]="Element",i[i.Text=3]="Text",i[i.CDATA=4]="CDATA",i[i.Comment=5]="Comment",i),po={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},mo={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},vo={},go={},yo={};function wo(e,t,n){var r="".concat(e,".").concat(String(n));return yo[r]?yo[r].call(t):(e=(e=>{if(vo[e])return vo[e];var t=globalThis[e],n=t.prototype,r=e in po?po[e]:void 0,r=Boolean(r&&r.every(function(e){return Boolean(null==(e=null==(e=Object.getOwnPropertyDescriptor(n,e))?void 0:e.get)?void 0:e.toString().includes("[native code]"))})),i=e in mo?mo[e]:void 0,i=Boolean(i&&i.every(function(e){return"function"==typeof n[e]&&(null==(e=n[e])?void 0:e.toString().includes("[native code]"))}));if(r&&i&&!globalThis.Zone)return vo[e]=t.prototype,t.prototype;try{var o,s,a=document.createElement("iframe"),l=(a.style.display="none",document.body.appendChild(a),a.contentWindow);return l?(o=l[e].prototype)?((s=navigator.userAgent).includes("Safari")&&!s.includes("Chrome")?(a.classList.add("rr-block"),a.setAttribute("__rrwebUntaintedMutationObserver",""),go[e]=function(){return a.remove()}):a.remove(),vo[e]=o):(a.remove(),n):t.prototype}catch(e){return n}})(e),(e=null==(e=Object.getOwnPropertyDescriptor(e,n))?void 0:e.get)?(yo[r]=e).call(t):t[n])}Date.now,Date.now().toString();var bo=function(e){return wo("Node",e,"childNodes")},ko=function(e){return wo("Node",e,"parentNode")},_o=function(e){return wo("Node",e,"parentElement")},So=function(e){return wo("Node",e,"textContent")},Eo=function(e){return e&&"shadowRoot"in e?wo("Element",e,"shadowRoot"):null};function Co(e){return e.nodeType===e.ELEMENT_NODE}function Ro(e){var t=e&&"host"in e&&"mode"in e&&((t=e)&&"host"in t?wo("ShadowRoot",t,"host"):null)||null;return Boolean(t&&"shadowRoot"in t&&Eo(t)===e)}function To(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function Oo(e){try{var t,n=e.rules||e.cssRules;return n?(!(t=e.href)&&e.ownerNode&&(t=e.ownerNode.baseURI),r=(r=Array.from(n,function(e){return xo(e,t)}).join("")).includes(" background-clip: text;")&&!r.includes(" -webkit-background-clip: text;")?r.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;"):r):null}catch(e){return null}var r}function xo(e,t){if("styleSheet"in e){var n;try{n=Oo(e.styleSheet)||((r=(i=e).cssText).split('"').length<3?r:(r=["@import","url(".concat(JSON.stringify(i.href),")")],""===i.layerName?r.push("layer"):i.layerName&&r.push("layer(".concat(i.layerName,")")),i.supportsText&&r.push("supports(".concat(i.supportsText,")")),i.media.length&&r.push(i.media.mediaText),r.join(" ")+";"))}catch(t){n=e.cssText}return e.styleSheet.href?zo(n,e.styleSheet.href):n}var r,i=e.cssText;return"selectorText"in e&&e.selectorText.includes(":")&&(i=i.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")),t?zo(i,t):i}var Io=k(function e(){b(this,e),io(this,"idNodeMap",new Map),io(this,"nodeMetaMap",new WeakMap)},[{key:"getId",value:function(e){return e&&null!=(e=null==(e=this.getMeta(e))?void 0:e.id)?e:-1}},{key:"getNode",value:function(e){return this.idNodeMap.get(e)||null}},{key:"getIds",value:function(){return Array.from(this.idNodeMap.keys())}},{key:"getMeta",value:function(e){return this.nodeMetaMap.get(e)||null}},{key:"removeNodeFromMap",value:function(e){var t=this,n=this.getId(e);this.idNodeMap.delete(n),e.childNodes&&e.childNodes.forEach(function(e){return t.removeNodeFromMap(e)})}},{key:"has",value:function(e){return this.idNodeMap.has(e)}},{key:"hasNode",value:function(e){return this.nodeMetaMap.has(e)}},{key:"add",value:function(e,t){var n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}},{key:"replace",value:function(e,t){var n=this.getNode(e);n&&(n=this.nodeMetaMap.get(n))&&this.nodeMetaMap.set(t,n),this.idNodeMap.set(e,t)}},{key:"reset",value:function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}]);function Mo(e){var t=e.element,n=e.maskInputOptions,r=e.tagName,i=e.type,o=e.maskInputFn,e=e.value||"",i=i&&Ao(i);return e=n[r.toLowerCase()]||i&&n[i]?o?o(e,t):"*".repeat(e.length):e}function Ao(e){return e.toLowerCase()}function Po(e){var t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Ao(t):null}function Do(e,t){var n;try{n=new URL(e,null!=t?t:window.location.href)}catch(e){return null}t=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return null!=(n=null==t?void 0:t[1])?n:null}var Lo=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,No=/^(?:[a-z+]+:)?\/\//i,Fo=/^www\..*/i,Uo=/^(data:)([^,]*),(.*)/i;function zo(e,c){return(e||"").replace(Lo,function(e,t,n,r,i,o){n=n||i||o,i=t||r||"";if(!n)return e;if(No.test(n)||Fo.test(n))return"url(".concat(i).concat(n).concat(i,")");if(Uo.test(n))return"url(".concat(i).concat(n).concat(i,")");if("/"===n[0])return"url(".concat(i).concat((-1<(o=c).indexOf("//")?o.split("/").slice(0,3).join("/"):o.split("/")[0]).split("?")[0]+n).concat(i,")");var t=n.split("#")[0],r=n.substring(t.length),s=c.split("#")[0].split("/"),o=t.split("/");s.pop();var a,l=Me(o);try{for(l.s();!(a=l.n()).done;){var u=a.value;"."!==u&&(".."===u?s.pop():s.push(u))}}catch(e){l.e(e)}finally{l.f()}return"url(".concat(i).concat(s.join("/")).concat(r).concat(i,")")})}function Bo(e,t){return 1<arguments.length&&void 0!==t&&t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}var jo,Wo,Ho=1,qo=new RegExp("[^a-z0-9-_:]");function Vo(){return Ho++}var Go=/^[^ \t\n\r\u000c]+/,Zo=/^[, \t\n\r\u000c]+/,Jo=new WeakMap;function Ko(e,t){return t&&""!==t.trim()?$o(e,t):t}function $o(e,t){var n=Jo.get(e);if(n||(n=e.createElement("a"),Jo.set(e,n)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return n.setAttribute("href",t),n.href}function Xo(e,t,n,r){return r&&("src"===n||"href"===n&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&"#"!==r[0]||"background"===n&&["table","td","th"].includes(t)?Ko(e,r):"srcset"===n?((e,t)=>{if(""===t.trim())return t;var n=0;function r(e){var e=e.exec(t.substring(n));return e?(e=e[0],n+=e.length,e):""}for(var i=[];r(Zo),!(n>=t.length);)if(","===(s=r(Go)).slice(-1))s=Ko(e,s.substring(0,s.length-1)),i.push(s);else for(var o="",s=Ko(e,s),a=!1;;){var l=t.charAt(n);if(""===l){i.push((s+o).trim());break}if(a)")"===l&&(a=!1);else{if(","===l){n+=1,i.push((s+o).trim());break}"("===l&&(a=!0)}o+=l,n+=1}return i.join(", ")})(e,r):"style"===n?zo(r,$o(e)):"object"===t&&"data"===n?Ko(e,r):r)}function Yo(e,t){return["video","audio"].includes(e)&&"autoplay"===t}function Qo(e,t,n){if(!e)return!1;if(e.nodeType===e.ELEMENT_NODE)for(var r=e.classList.length;r--;){var i=e.classList[r];if(t.test(i))return!0}return!!n&&Qo(ko(e),t,n)}function es(e,t,n,r){var i;if(Co(e)){if(!bo(i=e).length)return!1}else{if(null===_o(e))return!1;i=_o(e)}try{if("string"==typeof t){if(r){if(i.closest(".".concat(t)))return!0}else if(i.classList.contains(t))return!0}else if(Qo(i,t,r))return!0;if(n)if(r){if(i.closest(n))return!0}else if(i.matches(n))return!0}catch(e){}return!1}function N(e){return null==e?"":e.toLowerCase()}function ts(e){return!0===e||"all"===e?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===e,headMetaDescKeywords:"all"===e,headTitleMutations:"all"===e}:e||{}}function ns(t,e){var n=e.doc,r=e.mirror,i=e.blockClass,o=e.blockSelector,s=e.maskTextClass,a=e.maskTextSelector,l=e.skipChild,l=void 0!==l&&l,u=e.inlineStylesheet,c=void 0===u||u,u=e.maskInputOptions,d=void 0===u?{}:u,f=e.maskTextFn,h=e.maskInputFn,p=e.slimDOMOptions,u=e.dataURLOptions,m=void 0===u?{}:u,u=e.inlineImages,v=void 0!==u&&u,u=e.recordCanvas,g=void 0!==u&&u,y=e.onSerialize,w=e.onIframeLoad,u=e.iframeLoadTimeout,b=void 0===u?5e3:u,k=e.onStylesheetLoad,u=e.stylesheetLoadTimeout,_=void 0===u?5e3:u,u=e.keepIframeSrcFn,S=void 0===u?function(){return!1}:u,u=e.newlyAddedElement,u=void 0!==u&&u,E=e.cssCaptured,E=void 0!==E&&E,C=e.needsMask,e=e.preserveWhiteSpace,R=void 0===e||e,C=C||es(t,s,a,void 0===C),e=((e,t)=>{var n=t.doc,r=t.blockClass,i=t.blockSelector,o=t.needsMask,s=t.inlineStylesheet,a=t.maskInputOptions,l=void 0===a?{}:a,u=t.maskTextFn,c=t.maskInputFn,d=void 0===(a=t.dataURLOptions)?{}:a,f=t.inlineImages,h=t.recordCanvas,N=t.keepIframeSrcFn,F=void 0!==(a=t.newlyAddedElement)&&a,U=void 0!==(a=t.cssCaptured)&&a,p=(a=n,!(t=t.mirror).hasNode(a)||1===(t=t.getId(a))?void 0:t);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:ho.Document,childNodes:[],compatMode:e.compatMode}:{type:ho.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:ho.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:p};case e.ELEMENT_NODE:for(var m,v,g,y,w,b,k=e,_=(M={doc:n,blockClass:r,blockSelector:i,inlineStylesheet:s,maskInputOptions:l,maskInputFn:c,dataURLOptions:d,inlineImages:f,recordCanvas:h,keepIframeSrcFn:N,newlyAddedElement:F,rootId:p}).doc,S=M.inlineStylesheet,E=void 0===(E=M.maskInputOptions)?{}:E,C=M.maskInputFn,R=void 0===(T=M.dataURLOptions)?{}:T,T=M.inlineImages,O=M.recordCanvas,x=M.keepIframeSrcFn,I=void 0!==(I=M.newlyAddedElement)&&I,z=M.rootId,M=((e,t,n)=>{try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var r=e.classList.length;r--;){var i=e.classList[r];if(t.test(i))return!0}if(n)return e.matches(n)}catch(e){}return!1})(k,M.blockClass,M.blockSelector),A=(v=k)instanceof HTMLFormElement?"form":(v=Ao(v.tagName),qo.test(v)?"div":v),P={},B=k.attributes.length,D=0;D<B;D++){var L=k.attributes[D];Yo(A,L.name)||(P[L.name]=Xo(_,A,Ao(L.name),L.value))}"link"===A&&S&&(v=null,v=(S=Array.from(_.styleSheets).find(function(e){return e.href===k.href}))?Oo(S):v)&&(delete P.rel,delete P.href,P._cssText=v),"style"===A&&k.sheet&&(S=Oo(k.sheet))&&(1<k.childNodes.length&&(S=function(e,t,n){var r=2<arguments.length&&void 0!==n&&n,i=Array.from(t.childNodes),o=[],s=0;if(1<i.length&&e&&"string"==typeof e)for(var a=Bo(e,r),l=a.length/e.length,u=1;u<i.length;u++)if(i[u].textContent&&"string"==typeof i[u].textContent){for(var c=Bo(i[u].textContent,r),d=3;d<c.length&&(c[d].match(/[a-zA-Z0-9]/)||-1!==c.indexOf(c.substring(0,d),1));d++);for(;d<c.length;d++){var f,h=c.substring(0,d),p=a.split(h),m=-1;if(2===p.length)m=p[0].length;else if(2<p.length&&""===p[0]&&""!==i[u-1].textContent)m=a.indexOf(h,1);else if(1===p.length){if(h=h.substring(0,h.length-1),(p=a.split(h)).length<=1)return o.push(e),o;d=101}else d===c.length-1&&(m=a.indexOf(h));if(-1!==(m=2<=p.length&&100<d&&((f=i[u-1].textContent)&&"string"==typeof f&&(f=Bo(f).length,m=a.indexOf(h,f)),-1===m)?p[0].length:m)){for(var v=Math.floor(m/l);0<v&&v<e.length;){if((s+=1)>50*i.length)return o.push(e),o;var g=Bo(e.substring(0,v),r);if(g.length===m){o.push(e.substring(0,v)),e=e.substring(v),a=a.substring(m);break}g.length<m?v+=Math.max(1,Math.floor((m-g.length)/l)):v-=Math.max(1,Math.floor((g.length-m)*l))}break}}}return o.push(e),o}(S,k).join("/* rr_split */")),P._cssText=S),["input","textarea","select"].includes(A)&&(v=k.value,S=k.checked,"radio"!==P.type&&"checkbox"!==P.type&&"submit"!==P.type&&"button"!==P.type&&v?P.value=Mo({element:k,type:Po(k),tagName:A,value:v,maskInputOptions:E,maskInputFn:C}):S&&(P.checked=S)),"option"===A&&(k.selected&&!E.select?P.selected=!0:delete P.selected),"dialog"===A&&k.open&&(P.rr_open_mode=k.matches("dialog:modal")?"modal":"non-modal"),"canvas"===A&&O&&("2d"===k.__context?(e=>{var t=e.getContext("2d");if(t)for(var n=0;n<e.width;n+=50)for(var r=0;r<e.height;r+=50){var i=t.getImageData,i="__rrweb_original__"in i?i.__rrweb_original__:i;if(new Uint32Array(i.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some(function(e){return 0!==e}))return}return 1})(k)||(P.rr_dataURL=k.toDataURL(R.type,R.quality)):"__context"in k||(v=k.toDataURL(R.type,R.quality),(C=_.createElement("canvas")).width=k.width,C.height=k.height,v!==C.toDataURL(R.type,R.quality)&&(P.rr_dataURL=v))),"img"===A&&T&&(jo||(jo=_.createElement("canvas"),Wo=jo.getContext("2d")),y=(g=k).currentSrc||g.getAttribute("src")||"<unknown-src>",w=g.crossOrigin,b=function(){g.removeEventListener("load",b);try{jo.width=g.naturalWidth,jo.height=g.naturalHeight,Wo.drawImage(g,0,0),P.rr_dataURL=jo.toDataURL(R.type,R.quality)}catch(e){if("anonymous"!==g.crossOrigin)return g.crossOrigin="anonymous",void(g.complete&&0!==g.naturalWidth?b():g.addEventListener("load",b));console.warn("Cannot inline img src=".concat(y,"! Error: ").concat(e))}"anonymous"===g.crossOrigin&&(w?P.crossOrigin=w:g.removeAttribute("crossorigin"))},g.complete&&0!==g.naturalWidth?b():g.addEventListener("load",b)),["audio","video"].includes(A)&&((S=P).rr_mediaState=k.paused?"paused":"played",S.rr_mediaCurrentTime=k.currentTime,S.rr_mediaPlaybackRate=k.playbackRate,S.rr_mediaMuted=k.muted,S.rr_mediaLoop=k.loop,S.rr_mediaVolume=k.volume),I||(k.scrollLeft&&(P.rr_scrollLeft=k.scrollLeft),k.scrollTop&&(P.rr_scrollTop=k.scrollTop)),M&&(O=(E=k.getBoundingClientRect()).width,C=E.height,P={class:P.class,rr_width:"".concat(O,"px"),rr_height:"".concat(C,"px")}),"iframe"!==A||x(P.src)||(k.contentDocument||(P.rr_src=P.src),delete P.src);try{customElements.get(A)&&(m=!0)}catch(k){}return{type:ho.Element,tagName:A,attributes:P,childNodes:[],isSVG:Boolean("svg"===k.tagName||k.ownerSVGElement)||void 0,needBlock:M,rootId:z,isCustom:m};case e.TEXT_NODE:return T=(v={doc:n,needsMask:o,maskTextFn:u,rootId:p,cssCaptured:U}).needsMask,S=v.maskTextFn,I=v.rootId,E=v.cssCaptured,C=(C=ko(O=e))&&C.tagName,x="",M="STYLE"===C||void 0,(C="SCRIPT"===C||void 0)?x="SCRIPT_PLACEHOLDER":E||(x=So(O),M&&(x=x&&zo(x,$o(v.doc)))),!M&&!C&&x&&T&&(x=S?S(x,_o(O)):x.replace(/[\S]/g,"*")),{type:ho.Text,textContent:x||"",rootId:I};case e.CDATA_SECTION_NODE:return{type:ho.CDATA,textContent:"",rootId:p};case e.COMMENT_NODE:return{type:ho.Comment,textContent:So(e)||"",rootId:p};default:return!1}})(t,{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:C,inlineStylesheet:c,maskInputOptions:d,maskTextFn:f,maskInputFn:h,dataURLOptions:m,inlineImages:v,recordCanvas:g,keepIframeSrcFn:S,newlyAddedElement:u,cssCaptured:E});if(!e)return console.warn(t,"not serialized"),null;var u=r.hasNode(t)?r.getId(t):((e,t)=>{if(t.comment&&e.type===ho.Comment)return 1;if(e.type===ho.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel&&"script"===e.attributes.as||"modulepreload"===e.attributes.rel)||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===Do(e.attributes.href)))return 1;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(N(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===N(e.attributes.name)||"icon"===N(e.attributes.rel)||"apple-touch-icon"===N(e.attributes.rel)||"shortcut icon"===N(e.attributes.rel))))return 1;if("meta"===e.tagName){if(t.headMetaDescKeywords&&N(e.attributes.name).match(/^description|keywords$/))return 1;if(t.headMetaSocial&&(N(e.attributes.property).match(/^(og|twitter|fb):/)||N(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===N(e.attributes.name)))return 1;if(t.headMetaRobots&&("robots"===N(e.attributes.name)||"googlebot"===N(e.attributes.name)||"bingbot"===N(e.attributes.name)))return 1;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return 1;if(t.headMetaAuthorship&&("author"===N(e.attributes.name)||"generator"===N(e.attributes.name)||"framework"===N(e.attributes.name)||"publisher"===N(e.attributes.name)||"progid"===N(e.attributes.name)||N(e.attributes.property).match(/^article:/)||N(e.attributes.property).match(/^product:/)))return 1;if(t.headMetaVerification&&("google-site-verification"===N(e.attributes.name)||"yandex-verification"===N(e.attributes.name)||"csrf-token"===N(e.attributes.name)||"p:domain_verify"===N(e.attributes.name)||"verify-v1"===N(e.attributes.name)||"verification"===N(e.attributes.name)||"shopify-checkout-api-token"===N(e.attributes.name)))return 1}}})(e,p)||!R&&e.type===ho.Text&&!e.textContent.replace(/^\s+|\s+$/gm,"").length?-2:Ho++,T=Object.assign(e,{id:u});if(r.add(t,T),-2===u)return null;y&&y(t);E=!l;if(T.type===ho.Element&&(E=E&&!T.needBlock,delete T.needBlock,e=Eo(t))&&To(e)&&(T.isShadowHost=!0),(T.type===ho.Document||T.type===ho.Element)&&E){p.headWhitespace&&T.type===ho.Element&&"head"===T.tagName&&(R=!1);var O={doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:C,maskTextClass:s,maskTextSelector:a,skipChild:l,inlineStylesheet:c,maskInputOptions:d,maskTextFn:f,maskInputFn:h,slimDOMOptions:p,dataURLOptions:m,inlineImages:v,recordCanvas:g,preserveWhiteSpace:R,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:b,onStylesheetLoad:k,stylesheetLoadTimeout:_,keepIframeSrcFn:S,cssCaptured:!1};if(T.type!==ho.Element||"textarea"!==T.tagName||void 0===T.attributes.value){T.type===ho.Element&&void 0!==T.attributes._cssText&&"string"==typeof T.attributes._cssText&&(O.cssCaptured=!0);for(var x=0,I=Array.from(bo(t));x<I.length;x++){var M=ns(I[x],O);M&&T.childNodes.push(M)}}var A=null;if(Co(t)&&(A=Eo(t)))for(var P=0,D=Array.from(bo(A));P<D.length;P++){var L=ns(D[P],O);L&&(To(A)&&(L.isShadow=!0),T.childNodes.push(L))}}u=ko(t);return u&&Ro(u)&&To(u)&&(T.isShadow=!0),T.type===ho.Element&&"iframe"===T.tagName&&((e,t,n)=>{var r=e.contentWindow;if(r){var i,o=!1;try{i=r.document.readyState}catch(e){return}if("complete"===i){if("about:blank"!==r.location.href||"about:blank"===e.src||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var s=setTimeout(function(){o||(t(),o=!0)},n);e.addEventListener("load",function(){clearTimeout(s),o=!0,t()})}}})(t,function(){var e=t.contentDocument;e&&w&&(e=ns(e,{doc:e,mirror:r,blockClass:i,blockSelector:o,needsMask:C,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:d,maskTextFn:f,maskInputFn:h,slimDOMOptions:p,dataURLOptions:m,inlineImages:v,recordCanvas:g,preserveWhiteSpace:R,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:b,onStylesheetLoad:k,stylesheetLoadTimeout:_,keepIframeSrcFn:S}))&&w(t,e)},b),T.type===ho.Element&&"link"===T.tagName&&"string"==typeof T.attributes.rel&&("stylesheet"===T.attributes.rel||"preload"===T.attributes.rel&&"string"==typeof T.attributes.href&&"css"===Do(T.attributes.href))&&((e,t,n)=>{var r,i,o=!1;try{r=e.sheet}catch(e){return}r||(i=setTimeout(function(){o||(t(),o=!0)},n),e.addEventListener("load",function(){clearTimeout(i),o=!0,t()}))})(t,function(){var e;k&&(e=ns(t,{doc:n,mirror:r,blockClass:i,blockSelector:o,needsMask:C,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:d,maskTextFn:f,maskInputFn:h,slimDOMOptions:p,dataURLOptions:m,inlineImages:v,recordCanvas:g,preserveWhiteSpace:R,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:b,onStylesheetLoad:k,stylesheetLoadTimeout:_,keepIframeSrcFn:S}))&&k(t,e)},_),T}var rs,is,os,ss,as,ls,us={exports:{}},h=(ss=Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"}))).__esModule?ss:("function"==typeof(as=ss.default)?(ls=function e(){return this instanceof e?Reflect.construct(as,arguments,this.constructor):as.apply(this,arguments)}).prototype=as.prototype:ls={},Object.defineProperty(ls,"__esModule",{value:!0}),Object.keys(ss).forEach(function(e){var t=Object.getOwnPropertyDescriptor(ss,e);Object.defineProperty(ls,e,t.get?t:{enumerable:!0,get:function(){return ss[e]}})}),ls);function cs(){var d,f,e,t;return os||(os=1,rs||(rs=1,e=String,us.exports=(t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}})(),us.exports.createColors=t),d=us.exports,f=h,Vi(a,ro(Error)),t=k(a,[{key:"setMessage",value:function(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file||"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}},{key:"showSourceCode",value:function(e){var r=this;if(!this.source)return"";var t=this.source;null==e&&(e=d.isColorSupported);var n,i,o,s,a,t=(t=f&&e?f(t):t).split(/\r?\n/),l=Math.max(this.line-3,0),u=Math.min(this.line+2,t.length),c=String(u).length;return e?(e=d.createColors(!0),n=e.bold,i=e.gray,o=e.red,s=function(e){return n(o(e))},a=function(e){return i(e)}):s=a=function(e){return e},t.slice(l,u).map(function(e,t){var t=l+1+t,n=" "+(" "+t).slice(-c)+" | ";return t===r.line?(t=a(n.replace(/\d/g," "))+e.slice(0,r.column-1).replace(/[^\t]/g," "),s(">")+a(n)+e+"\n "+t+s("^")):" "+a(n)+e}).join("\n")}},{key:"toString",value:function(){var e=(e=this.showSourceCode())&&"\n\n"+e+"\n";return this.name+": "+this.message+e}}]),(is=t).default=t),is;function a(e,t,n,r,i,o){var s;return b(this,a),(s=ji(this,a,[e])).name="CssSyntaxError",s.reason=e,i&&(s.file=i),r&&(s.source=r),o&&(s.plugin=o),void 0!==t&&void 0!==n&&("number"==typeof t?(s.line=t,s.column=n):(s.line=t.line,s.column=t.column,s.endLine=n.line,s.endColumn=n.column)),s.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(s,a),s}}var ds,fs,hs,ps,ms,vs,gs,ys,ws,bs,ks,_s,Ss,Es,Cs,Rs,Ts,Os,xs,Is,Ms,As,Ps,Ds,Ls,Ns,Fs,Us,zs,Bs,js,Ws,Hs,qs,Vs,Gs,Zs,Js,Ks,$s,Xs,Ys,Qs,ea,ta,na,ra,ia,oa,sa,aa,la,ua,ca,da,fa,ha,pa,ma,va,ga,ya,wa,ba,ka,_a,Sa,Ea,Ca,Ra,Ta,Oa,xa,Ia,Ma={};function Aa(){return ds||(ds=1,Ma.isClean=Symbol("isClean"),Ma.my=Symbol("my")),Ma}function Pa(){var s,e;return hs||(s={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!(hs=1)},e=k(function e(t){b(this,e),this.builder=t},[{key:"atrule",value:function(e,t){var n="@"+e.name,r=e.params?this.rawValue(e,"params"):"";void 0!==e.raws.afterName?n+=e.raws.afterName:r&&(n+=" "),e.nodes?this.block(e,n+r):(t=(e.raws.between||"")+(t?";":""),this.builder(n+r+t,e))}},{key:"beforeAfter",value:function(e,t){for(var n="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"),r=e.parent,i=0;r&&"root"!==r.type;)i+=1,r=r.parent;if(n.includes("\n")){var o=this.raw(e,null,"indent");if(o.length)for(var s=0;s<i;s++)n+=o}return n}},{key:"block",value:function(e,t){var n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),(t=e.nodes&&e.nodes.length?(this.body(e),this.raw(e,"after")):this.raw(e,"after","emptyBody"))&&this.builder(t),this.builder("}",e,"end")}},{key:"body",value:function(e){for(var t=e.nodes.length-1;0<t&&"comment"===e.nodes[t].type;)--t;for(var n=this.raw(e,"semicolon"),r=0;r<e.nodes.length;r++){var i=e.nodes[r],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,t!==r||n)}}},{key:"comment",value:function(e){var t=this.raw(e,"left","commentLeft"),n=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+n+"*/",e)}},{key:"decl",value:function(e,t){var n=this.raw(e,"between","colon"),n=e.prop+n+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}},{key:"document",value:function(e){this.body(e)}},{key:"raw",value:function(e,t,n){var r;if(t&&void 0!==(r=e.raws[t]))return r;var i,o=e.parent;if("before"===(n=n||t)){if(!o||"root"===o.type&&o.first===e)return"";if(o&&"document"===o.type)return""}return o?((o=e.root()).rawCache||(o.rawCache={}),void 0!==o.rawCache[n]?o.rawCache[n]:"before"===n||"after"===n?this.beforeAfter(e,n):(this[i="raw"+((i=n)[0].toUpperCase()+i.slice(1))]?r=this[i](o,e):o.walk(function(e){if(void 0!==(r=e.raws[t]))return!1}),void 0===r&&(r=s[n]),o.rawCache[n]=r)):s[n]}},{key:"rawBeforeClose",value:function(e){var t;return e.walk(function(e){if(e.nodes&&0<e.nodes.length&&void 0!==e.raws.after)return(t=e.raws.after).includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t=t&&t.replace(/\S/g,"")}},{key:"rawBeforeComment",value:function(e,t){var n;return e.walkComments(function(e){if(void 0!==e.raws.before)return(n=e.raws.before).includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),n=void 0===n?this.raw(t,null,"beforeDecl"):n&&n.replace(/\S/g,"")}},{key:"rawBeforeDecl",value:function(e,t){var n;return e.walkDecls(function(e){if(void 0!==e.raws.before)return(n=e.raws.before).includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),n=void 0===n?this.raw(t,null,"beforeRule"):n&&n.replace(/\S/g,"")}},{key:"rawBeforeOpen",value:function(e){var t;return e.walk(function(e){if("decl"!==e.type&&void 0!==(t=e.raws.between))return!1}),t}},{key:"rawBeforeRule",value:function(t){var n;return t.walk(function(e){if(e.nodes&&(e.parent!==t||t.first!==e)&&void 0!==e.raws.before)return(n=e.raws.before).includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),n=n&&n.replace(/\S/g,"")}},{key:"rawColon",value:function(e){var t;return e.walkDecls(function(e){if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}},{key:"rawEmptyBody",value:function(e){var t;return e.walk(function(e){if(e.nodes&&0===e.nodes.length&&void 0!==(t=e.raws.after))return!1}),t}},{key:"rawIndent",value:function(n){return n.raws.indent||(n.walk(function(e){var t=e.parent;if(t&&t!==n&&t.parent&&t.parent===n&&void 0!==e.raws.before)return t=e.raws.before.split("\n"),r=(r=t[t.length-1]).replace(/\S/g,""),!1}),r);var r}},{key:"rawSemicolon",value:function(e){var t;return e.walk(function(e){if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&void 0!==(t=e.raws.semicolon))return!1}),t}},{key:"rawValue",value:function(e,t){var n=e[t],e=e.raws[t];return e&&e.value===n?e.raw:n}},{key:"root",value:function(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}},{key:"rule",value:function(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}},{key:"stringify",value:function(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)}}]),(fs=e).default=e),fs}function Da(){var n;return ms||(ms=1,n=Pa(),(ps=e).default=e),ps;function e(e,t){new n(t).stringify(e)}}function La(){var s,a,i,n,r,e;return gs||(gs=1,e=Aa(),s=e.isClean,a=e.my,i=cs(),n=Pa(),r=Da(),e=k(function e(){var t,n=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};for(t in b(this,e),this.raws={},this[s]=!1,this[a]=!0,n)if("nodes"===t){this.nodes=[];var r,i=Me(n[t]);try{for(i.s();!(r=i.n()).done;){var o=r.value;"function"==typeof o.clone?this.append(o.clone()):this.append(o)}}catch(e){i.e(e)}finally{i.f()}}else this[t]=n[t]},[{key:"addToError",value:function(e){var t;return e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)&&(t=this.source,e.stack=e.stack.replace(/\n\s{4}at /,"$&".concat(t.input.from,":").concat(t.start.line,":").concat(t.start.column,"$&"))),e}},{key:"after",value:function(e){return this.parent.insertAfter(this,e),this}},{key:"assign",value:function(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};for(e in t)this[e]=t[e];return this}},{key:"before",value:function(e){return this.parent.insertBefore(this,e),this}},{key:"cleanRaws",value:function(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}},{key:"clone",value:function(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},n=function t(e,n){var r,i,o,s=new e.constructor;for(r in e)Object.prototype.hasOwnProperty.call(e,r)&&"proxyCache"!==r&&(o=_(i=e[r]),"parent"===r&&"object"===o?n&&(s[r]=n):"source"===r?s[r]=i:Array.isArray(i)?s[r]=i.map(function(e){return t(e,s)}):("object"===o&&null!==i&&(i=t(i)),s[r]=i));return s}(this);for(e in t)n[e]=t[e];return n}},{key:"cloneAfter",value:function(){var e=this.clone(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{});return this.parent.insertAfter(this,e),e}},{key:"cloneBefore",value:function(){var e=this.clone(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{});return this.parent.insertBefore(this,e),e}},{key:"error",value:function(e){var t,n,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return this.source?(t=(n=this.rangeBy(r)).end,this.source.input.error(e,{column:(n=n.start).column,line:n.line},{column:t.column,line:t.line},r)):new i(e)}},{key:"getProxyProcessor",value:function(){return{get:function(e,t){return"proxyOf"===t?e:"root"===t?function(){return e.root().toProxy()}:e[t]},set:function(e,t,n){return e[t]!==n&&(e[t]=n,"prop"===t||"value"===t||"name"===t||"params"===t||"important"===t||"text"===t)&&e.markDirty(),!0}}}},{key:"markDirty",value:function(){if(this[s]){this[s]=!1;for(var e=this;e=e.parent;)e[s]=!1}}},{key:"next",value:function(){var e;if(this.parent)return e=this.parent.index(this),this.parent.nodes[e+1]}},{key:"positionBy",value:function(e,t){var n=this.source.start;return e.index?n=this.positionInside(e.index,t):e.word&&-1!==(e=(t=this.toString()).indexOf(e.word))&&(n=this.positionInside(e,t)),n}},{key:"positionInside",value:function(e,t){for(var n=t||this.toString(),r=this.source.start.column,i=this.source.start.line,o=0;o<e;o++)"\n"===n[o]?i+=r=1:r+=1;return{column:r,line:i}}},{key:"prev",value:function(){var e;if(this.parent)return e=this.parent.index(this),this.parent.nodes[e-1]}},{key:"rangeBy",value:function(e){var t,n,r={column:this.source.start.column,line:this.source.start.line},i=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:r.column+1,line:r.line};return e.word?-1!==(n=(t=this.toString()).indexOf(e.word))&&(r=this.positionInside(n,t),i=this.positionInside(n+e.word.length,t)):(e.start?r={column:e.start.column,line:e.start.line}:e.index&&(r=this.positionInside(e.index)),e.end?i={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?i=this.positionInside(e.endIndex):e.index&&(i=this.positionInside(e.index+1))),{end:i=i.line<r.line||i.line===r.line&&i.column<=r.column?{column:r.column+1,line:r.line}:i,start:r}}},{key:"raw",value:function(e,t){return(new n).raw(this,e,t)}},{key:"remove",value:function(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}},{key:"replaceWith",value:function(){if(this.parent){for(var e=this,t=!1,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];for(var o=0,s=r;o<s.length;o++){var a=s[o];a===this?t=!0:t?(this.parent.insertAfter(e,a),e=a):this.parent.insertBefore(e,a)}t||this.remove()}return this}},{key:"root",value:function(){for(var e=this;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}},{key:"toJSON",value:function(e,t){var n,r,i,o={},s=null==t,a=(t=t||new Map,0);for(n in this)Object.prototype.hasOwnProperty.call(this,n)&&"parent"!==n&&"proxyCache"!==n&&(r=this[n],Array.isArray(r)?o[n]=r.map(function(e){return"object"===_(e)&&e.toJSON?e.toJSON(null,t):e}):"object"===_(r)&&r.toJSON?o[n]=r.toJSON(null,t):"source"===n?(null==(i=t.get(r.input))&&(i=a,t.set(r.input,a),a++),o[n]={end:r.end,inputId:i,start:r.start}):o[n]=r);return s&&(o.inputs=eo(t.keys()).map(function(e){return e.toJSON()})),o}},{key:"toProxy",value:function(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}},{key:"toString",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:r,t=(e.stringify&&(e=e.stringify),"");return e(this,function(e){t+=e}),t}},{key:"warn",value:function(e,t,n){var r,i={node:this};for(r in n)i[r]=n[r];return e.warn(t,i)}},{key:"proxyOf",get:function(){return this}}]),(vs=e).default=e),vs}function Na(){var e;return ws||(ws=1,Vi(t,La()),e=k(t,[{key:"variable",get:function(){return this.prop.startsWith("--")||"$"===this.prop[0]}}]),(ys=e).default=e),ys;function t(e){return b(this,t),(e=ji(this,t,[e=e&&void 0!==e.value&&"string"!=typeof e.value?Ae(Ae({},e),{},{value:String(e.value)}):e])).type="decl",e}}function Fa(){var r,i,t,n,o,s,e;return Ss||(Ss=1,r=h.SourceMapConsumer,i=h.SourceMapGenerator,t=h.existsSync,n=h.readFileSync,o=h.dirname,s=h.join,e=k(function e(t,n){b(this,e),!1!==n.map&&(this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:"),t=n.map?n.map.prev:void 0,t=this.loadMap(n.from,t),!this.mapFile&&n.from&&(this.mapFile=n.from),this.mapFile&&(this.root=o(this.mapFile)),t)&&(this.text=t)},[{key:"consumer",value:function(){return this.consumerCache||(this.consumerCache=new r(this.text)),this.consumerCache}},{key:"decodeInline",value:function(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=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+t)}},{key:"getAnnotationURL",value:function(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}},{key:"isMap",value:function(e){return"object"===_(e)&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}},{key:"loadAnnotation",value:function(e){var t,n=e.match(/\/\*\s*# sourceMappingURL=/gm);n&&(n=e.lastIndexOf(n.pop()),t=e.indexOf("*/",n),-1<n)&&-1<t&&(this.annotation=this.getAnnotationURL(e.substring(n,t)))}},{key:"loadFile",value:function(e){if(this.root=o(e),t(e))return this.mapFile=e,n(e,"utf-8").toString().trim()}},{key:"loadMap",value:function(e,t){if(!1===t)return!1;if(!t)return this.inline?this.decodeInline(this.annotation):this.annotation?(n=this.annotation,e&&(n=s(o(e),n)),this.loadFile(n)):void 0;if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof r)return i.fromSourceMap(t).toString();if(t instanceof i)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}var n=t(e);if(n){t=this.loadFile(n);if(t)return t;throw new Error("Unable to load previous source map: "+n.toString())}}},{key:"startWith",value:function(e,t){return!!e&&e.substr(0,t.length)===t}},{key:"withContent",value:function(){return!!(this.consumer().sourcesContent&&0<this.consumer().sourcesContent.length)}}]),(_s=e).default=e),_s}function Ua(){var e,s,l,a,r,i,t,u,o,c,d,f,n;return Cs||(Cs=1,n=h.SourceMapConsumer,e=h.SourceMapGenerator,s=h.fileURLToPath,l=h.pathToFileURL,a=h.isAbsolute,r=h.resolve,i=(ks?bs:(ks=1,bs={nanoid:function(){for(var e="",t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:21;t--;)e+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return e},customAlphabet:function(n){var r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:21;return function(){for(var e="",t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:r;t--;)e+=n[Math.random()*n.length|0];return e}}})).nanoid,t=h,u=cs(),o=Fa(),c=Symbol("fromOffsetCache"),d=Boolean(n&&e),f=Boolean(r&&a),n=k(function e(t){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(b(this,e),null==t||"object"===_(t)&&!t.toString)throw new Error("PostCSS received ".concat(t," instead of CSS string"));this.css=t.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,n.from&&(!f||/^\w+:\/\//.test(n.from)||a(n.from)?this.file=n.from:this.file=r(n.from)),f&&d&&(t=new o(this.css,n)).text&&(n=(this.map=t).consumer().file,!this.file)&&n&&(this.file=this.mapResolve(n)),this.file||(this.id="<input css "+i(6)+">"),this.map&&(this.map.file=this.from)},[{key:"error",value:function(e,t,n){var r,i,o,s=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{},a=(t&&"object"===_(t)?(a=n,n="number"==typeof(i=t).offset?(t=(o=this.fromOffset(i.offset)).line,o.col):(t=i.line,i.column),i="number"==typeof a.offset?(r=(o=this.fromOffset(a.offset)).line,o.col):(r=a.line,a.column)):n||(t=(o=this.fromOffset(t)).line,n=o.col),this.origin(t,n,r,i));return(o=a?new u(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,s.plugin):new u(e,void 0===r?t:{column:n,line:t},void 0===r?n:{column:i,line:r},this.css,this.file,s.plugin)).input={column:n,endColumn:i,endLine:r,line:t,source:this.css},this.file&&(l&&(o.input.url=l(this.file).toString()),o.input.file=this.file),o}},{key:"fromOffset",value:function(e){if(this[c])n=this[c];else{for(var t=this.css.split("\n"),n=new Array(t.length),r=0,i=0,o=t.length;i<o;i++)n[i]=r,r+=t[i].length+1;this[c]=n}var s=0;if(e>=n[n.length-1])s=n.length-1;else for(var a,l=n.length-2;s<l;)if(e<n[a=s+(l-s>>1)])l=a-1;else{if(!(e>=n[a+1])){s=a;break}s=a+1}return{col:e-n[s]+1,line:s+1}}},{key:"mapResolve",value:function(e){return/^\w+:\/\//.test(e)?e:r(this.map.consumer().sourceRoot||this.map.root||".",e)}},{key:"origin",value:function(e,t,n,r){if(!this.map)return!1;var i,o=this.map.consumer(),t=o.originalPositionFor({column:t,line:e});if(!t.source)return!1;"number"==typeof n&&(i=o.originalPositionFor({column:r,line:n}));e=a(t.source)?l(t.source):new URL(t.source,this.map.consumer().sourceRoot||l(this.map.mapFile)),r={column:t.column,endColumn:i&&i.column,endLine:i&&i.line,line:t.line,url:e.toString()};if("file:"===e.protocol){if(!s)throw new Error("file: protocol is not available in this PostCSS build");r.file=s(e)}n=o.sourceContentFor(t.source);return n&&(r.source=n),r}},{key:"toJSON",value:function(){for(var e={},t=0,n=["hasBOM","css","file","id"];t<n.length;t++){var r=n[t];null!=this[r]&&(e[r]=this[r])}return this.map&&(e.map=Ae({},this.map),e.map.consumerCache)&&(e.map.consumerCache=void 0),e}},{key:"from",get:function(){return this.file||this.id}}]),(Es=n).default=n,t&&t.registerInput&&t.registerInput(n)),Es}function za(){if(Ts)return Rs;Ts=1;var s=h.SourceMapConsumer,t=h.SourceMapGenerator,a=h.dirname,n=h.relative,r=h.resolve,i=h.sep,o=h.pathToFileURL,l=Ua(),e=Boolean(s&&t),u=Boolean(a&&r&&n&&i);return Rs=k(function e(t,n,r,i){b(this,e),this.stringify=t,this.mapOpts=r.map||{},this.root=n,this.opts=r,this.css=i,this.originalCSS=i,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map},[{key:"addAnnotation",value:function(){var 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",t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}},{key:"applyPrevMaps",value:function(){var e,t=Me(this.previous());try{for(t.s();!(e=t.n()).done;){var n=e.value,r=this.toUrl(this.path(n.file)),i=n.root||a(n.file),o=void 0;!1===this.mapOpts.sourcesContent?(o=new s(n.text)).sourcesContent&&(o.sourcesContent=null):o=n.consumer(),this.map.applySourceMap(o,r,this.toUrl(this.path(i)))}}catch(e){t.e(e)}finally{t.f()}}},{key:"clearAnnotation",value:function(){if(!1!==this.mapOpts.annotation)if(this.root)for(var e,t=this.root.nodes.length-1;0<=t;t--)"comment"===(e=this.root.nodes[t]).type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t);else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}},{key:"generate",value:function(){var t;return this.clearAnnotation(),u&&e&&this.isMap()?this.generateMap():(t="",this.stringify(this.root,function(e){t+=e}),[t])}},{key:"generateMap",value:function(){var e;return this.root?this.generateString():1===this.previous().length?((e=this.previous()[0].consumer()).file=this.outputFile(),this.map=t.fromSourceMap(e,{ignoreInvalidMapping:!0})):(this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"})),this.isSourcesContent()&&this.setSourcesContent(),this.root&&0<this.previous().length&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}},{key:"generateString",value:function(){var r=this;this.css="",this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0});var i,o=1,s=1,a={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,function(e,t,n){r.css+=e,t&&"end"!==n&&(a.generated.line=o,a.generated.column=s-1,t.source&&t.source.start?(a.source=r.sourcePath(t),a.original.line=t.source.start.line,a.original.column=t.source.start.column-1):(a.source="<no source>",a.original.line=1,a.original.column=0),r.map.addMapping(a)),(i=e.match(/\n/g))?(o+=i.length,i=e.lastIndexOf("\n"),s=e.length-i):s+=e.length,t&&"start"!==n&&(e=t.parent||{raws:{}},"decl"!==t.type&&("atrule"!==t.type||t.nodes)||t!==e.last||e.raws.semicolon)&&(t.source&&t.source.end?(a.source=r.sourcePath(t),a.original.line=t.source.end.line,a.original.column=t.source.end.column-1,a.generated.line=o,a.generated.column=s-2):(a.source="<no source>",a.original.line=1,a.original.column=0,a.generated.line=o,a.generated.column=s-1),r.map.addMapping(a))})}},{key:"isAnnotation",value:function(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(function(e){return e.annotation}))}},{key:"isInline",value:function(){var e;return void 0!==this.mapOpts.inline?this.mapOpts.inline:(void 0===(e=this.mapOpts.annotation)||!0===e)&&(!this.previous().length||this.previous().some(function(e){return e.inline}))}},{key:"isMap",value:function(){return void 0!==this.opts.map?!!this.opts.map:0<this.previous().length}},{key:"isSourcesContent",value:function(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(function(e){return e.withContent()})}},{key:"outputFile",value:function(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}},{key:"path",value:function(e){var t;return this.mapOpts.absolute||60===e.charCodeAt(0)||/^\w+:\/\//.test(e)?e:this.memoizedPaths.get(e)||(t=this.opts.to?a(this.opts.to):".","string"==typeof this.mapOpts.annotation&&(t=a(r(t,this.mapOpts.annotation))),t=n(t,e),this.memoizedPaths.set(e,t),t)}},{key:"previous",value:function(){var e,t=this;return this.previousMaps||(this.previousMaps=[],this.root?this.root.walk(function(e){e.source&&e.source.input.map&&(e=e.source.input.map,t.previousMaps.includes(e)||t.previousMaps.push(e))}):(e=new l(this.originalCSS,this.opts)).map&&this.previousMaps.push(e.map)),this.previousMaps}},{key:"setSourcesContent",value:function(){var e,n=this,r={};this.root?this.root.walk(function(e){var t;e.source&&(t=e.source.input.from)&&!r[t]&&(r[t]=!0,t=n.usesFileUrls?n.toFileUrl(t):n.toUrl(n.path(t)),n.map.setSourceContent(t,e.source.input.css))}):this.css&&(e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>",this.map.setSourceContent(e,this.css))}},{key:"sourcePath",value:function(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))}},{key:"toBase64",value:function(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}},{key:"toFileUrl",value:function(e){var t=this.memoizedFileURLs.get(e);if(t)return t;if(o)return t=o(e).toString(),this.memoizedFileURLs.set(e,t),t;throw new Error("`map.absolute` option is not available in this PostCSS build")}},{key:"toUrl",value:function(e){var t=this.memoizedURLs.get(e);if(t)return t;"\\"===i&&(e=e.replace(/\\/g,"/"));t=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,t),t}}])}function Ba(){var e;return xs||(xs=1,Vi(t,La()),e=k(t),(Os=e).default=e),Os;function t(e){return b(this,t),(e=ji(this,t,[e])).type="comment",e}}function ja(){var u,c,d,t,e,f,h,p,m,n;return Ms||(Ms=1,e=Aa(),f=e.isClean,h=e.my,p=Na(),m=Ba(),Vi(v,La()),(n=k(v,[{key:"append",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r=0,i=t;r<i.length;r++){var o,s=i[r],a=Me(this.normalize(s,this.last));try{for(a.s();!(o=a.n()).done;){var l=o.value;this.proxyOf.nodes.push(l)}}catch(e){a.e(e)}finally{a.f()}}return this.markDirty(),this}},{key:"cleanRaws",value:function(e){if(Qi(v,"cleanRaws",this,3)([e]),this.nodes){var t,n=Me(this.nodes);try{for(n.s();!(t=n.n()).done;)t.value.cleanRaws(e)}catch(e){n.e(e)}finally{n.f()}}}},{key:"each",value:function(e){if(this.proxyOf.nodes){for(var t,n,r=this.getIterator();this.indexes[r]<this.proxyOf.nodes.length&&(t=this.indexes[r],!1!==(n=e(this.proxyOf.nodes[t],t)));)this.indexes[r]+=1;return delete this.indexes[r],n}}},{key:"every",value:function(e){return this.nodes.every(e)}},{key:"getIterator",value:function(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;var e=this.lastEach;return this.indexes[e]=0,e}},{key:"getProxyProcessor",value:function(){return{get:function(r,o){return"proxyOf"===o?r:r[o]&&("each"===o||"string"==typeof o&&o.startsWith("walk")?function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Bi(r[o],r,eo(t.map(function(n){return"function"==typeof n?function(e,t){return n(e.toProxy(),t)}:n})))}:"every"===o||"some"===o?function(i){return r[o](function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Bi(i,void 0,[e.toProxy()].concat(n))})}:"root"===o?function(){return r.root().toProxy()}:"nodes"===o?r.nodes.map(function(e){return e.toProxy()}):"first"===o||"last"===o?r[o].toProxy():r[o])},set:function(e,t,n){return e[t]!==n&&(e[t]=n,"name"===t||"params"===t||"selector"===t)&&e.markDirty(),!0}}}},{key:"index",value:function(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}},{key:"insertAfter",value:function(e,t){var n,r,i,o=this.index(e),s=this.normalize(t,this.proxyOf.nodes[o]).reverse(),o=this.index(e),a=Me(s);try{for(a.s();!(n=a.n()).done;){var l=n.value;this.proxyOf.nodes.splice(o+1,0,l)}}catch(e){a.e(e)}finally{a.f()}for(i in this.indexes)o<(r=this.indexes[i])&&(this.indexes[i]=r+s.length);return this.markDirty(),this}},{key:"insertBefore",value:function(e,t){var n,r,i,o=this.index(e),s=this.normalize(t,this.proxyOf.nodes[o],0===o&&"prepend").reverse(),o=this.index(e),a=Me(s);try{for(a.s();!(n=a.n()).done;){var l=n.value;this.proxyOf.nodes.splice(o,0,l)}}catch(e){a.e(e)}finally{a.f()}for(i in this.indexes)o<=(r=this.indexes[i])&&(this.indexes[i]=r+s.length);return this.markDirty(),this}},{key:"normalize",value:function(e,t){var n=this;if("string"==typeof e)e=function t(e){return e.map(function(e){return e.nodes&&(e.nodes=t(e.nodes)),delete e.source,e})}(u(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e)){var r,i=Me(e=e.slice(0));try{for(i.s();!(r=i.n()).done;){var o=r.value;o.parent&&o.parent.removeChild(o,"ignore")}}catch(e){i.e(e)}finally{i.f()}}else if("root"===e.type&&"document"!==this.type){var s,a=Me(e=e.nodes.slice(0));try{for(a.s();!(s=a.n()).done;){var l=s.value;l.parent&&l.parent.removeChild(l,"ignore")}}catch(e){a.e(e)}finally{a.f()}}else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new p(e)]}else if(e.selector)e=[new c(e)];else if(e.name)e=[new d(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new m(e)]}return e.map(function(e){return e[h]||v.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[f]&&function e(t){if(t[f]=!1,t.proxyOf.nodes){var n,r=Me(t.proxyOf.nodes);try{for(r.s();!(n=r.n()).done;)e(n.value)}catch(e){r.e(e)}finally{r.f()}}}(e),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/\S/g,"")),e.parent=n.proxyOf,e})}},{key:"prepend",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,i=Me(t=t.reverse());try{for(i.s();!(r=i.n()).done;){var o,s,a=r.value,l=this.normalize(a,this.first,"prepend").reverse(),u=Me(l);try{for(u.s();!(o=u.n()).done;){var c=o.value;this.proxyOf.nodes.unshift(c)}}catch(e){u.e(e)}finally{u.f()}for(s in this.indexes)this.indexes[s]=this.indexes[s]+l.length}}catch(e){i.e(e)}finally{i.f()}return this.markDirty(),this}},{key:"push",value:function(e){return(e.parent=this).proxyOf.nodes.push(e),this}},{key:"removeAll",value:function(){var e,t=Me(this.proxyOf.nodes);try{for(t.s();!(e=t.n()).done;)e.value.parent=void 0}catch(e){t.e(e)}finally{t.f()}return this.proxyOf.nodes=[],this.markDirty(),this}},{key:"removeChild",value:function(e){var t,n;for(n in e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1),this.indexes)(t=this.indexes[n])>=e&&(this.indexes[n]=t-1);return this.markDirty(),this}},{key:"replaceValues",value:function(t,n,r){return r||(r=n,n={}),this.walkDecls(function(e){n.props&&!n.props.includes(e.prop)||n.fast&&!e.value.includes(n.fast)||(e.value=e.value.replace(t,r))}),this.markDirty(),this}},{key:"some",value:function(e){return this.nodes.some(e)}},{key:"walk",value:function(r){return this.each(function(t,e){var n;try{n=r(t,e)}catch(e){throw t.addToError(e)}return n=!1!==n&&t.walk?t.walk(r):n})}},{key:"walkAtRules",value:function(n,r){return r?n instanceof RegExp?this.walk(function(e,t){if("atrule"===e.type&&n.test(e.name))return r(e,t)}):this.walk(function(e,t){if("atrule"===e.type&&e.name===n)return r(e,t)}):(r=n,this.walk(function(e,t){if("atrule"===e.type)return r(e,t)}))}},{key:"walkComments",value:function(n){return this.walk(function(e,t){if("comment"===e.type)return n(e,t)})}},{key:"walkDecls",value:function(n,r){return r?n instanceof RegExp?this.walk(function(e,t){if("decl"===e.type&&n.test(e.prop))return r(e,t)}):this.walk(function(e,t){if("decl"===e.type&&e.prop===n)return r(e,t)}):(r=n,this.walk(function(e,t){if("decl"===e.type)return r(e,t)}))}},{key:"walkRules",value:function(n,r){return r?n instanceof RegExp?this.walk(function(e,t){if("rule"===e.type&&n.test(e.selector))return r(e,t)}):this.walk(function(e,t){if("rule"===e.type&&e.selector===n)return r(e,t)}):(r=n,this.walk(function(e,t){if("rule"===e.type)return r(e,t)}))}},{key:"first",get:function(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}},{key:"last",get:function(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}])).registerParse=function(e){u=e},n.registerRule=function(e){c=e},n.registerAtRule=function(e){d=e},n.registerRoot=function(e){t=e},((Is=n).default=n).rebuild=function(e){"atrule"===e.type?Object.setPrototypeOf(e,d.prototype):"rule"===e.type?Object.setPrototypeOf(e,c.prototype):"decl"===e.type?Object.setPrototypeOf(e,p.prototype):"comment"===e.type?Object.setPrototypeOf(e,m.prototype):"root"===e.type&&Object.setPrototypeOf(e,t.prototype),e[h]=!0,e.nodes&&e.nodes.forEach(function(e){n.rebuild(e)})}),Is;function v(){return b(this,v),ji(this,v,arguments)}}function Wa(){var t,n,e;return Ps||(Ps=1,Vi(r,ja()),(e=k(r,[{key:"toResult",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new t(new n,this,e).stringify()}}])).registerLazyResult=function(e){t=e},e.registerProcessor=function(e){n=e},(As=e).default=e),As;function r(e){return b(this,r),(e=ji(this,r,[Ae({type:"document"},e)])).nodes||(e.nodes=[]),e}}function Ha(){if(Ls)return Ds;Ls=1;var t={};return Ds=function(e){t[e]||(t[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))}}function qa(){var e;return Fs||(Fs=1,e=k(function e(t){var n,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};for(n in b(this,e),this.type="warning",this.text=t,r.node&&r.node.source&&(t=r.node.rangeBy(r),this.line=t.start.line,this.column=t.start.column,this.endLine=t.end.line,this.endColumn=t.end.column),r)this[n]=r[n]},[{key:"toString",value:function(){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}}]),(Ns=e).default=e),Ns}function Va(){var n,e;return zs||(zs=1,n=qa(),e=k(function e(t,n,r){b(this,e),this.processor=t,this.messages=[],this.root=n,this.opts=r,this.css=void 0,this.map=void 0},[{key:"toString",value:function(){return this.css}},{key:"warn",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},e=(t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin),new n(e,t));return this.messages.push(e),e}},{key:"warnings",value:function(){return this.messages.filter(function(e){return"warning"===e.type})}},{key:"content",get:function(){return this.css}}]),(Us=e).default=e),Us}function Ga(){var e,t;return Hs||(Hs=1,Vi(r,e=ja()),t=k(r,[{key:"append",value:function(){this.proxyOf.nodes||(this.nodes=[]);for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Qi(r,"append",this,3)(t)}},{key:"prepend",value:function(){this.proxyOf.nodes||(this.nodes=[]);for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Qi(r,"prepend",this,3)(t)}}]),(Ws=t).default=t,e.registerAtRule(t)),Ws;function r(e){return b(this,r),(e=ji(this,r,[e])).type="atrule",e}}function Za(){var t,n,e,r;return Vs||(Vs=1,Vi(s,e=ja()),(r=k(s,[{key:"normalize",value:function(e,t,n){var r=Qi(s,"normalize",this,3)([e]);if(t)if("prepend"===n)1<this.nodes.length?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t){var i,o=Me(r);try{for(o.s();!(i=o.n()).done;)i.value.raws.before=t.raws.before}catch(e){o.e(e)}finally{o.f()}}return r}},{key:"removeChild",value:function(e,t){var n=this.index(e);return!t&&0===n&&1<this.nodes.length&&(this.nodes[1].raws.before=this.nodes[n].raws.before),Qi(s,"removeChild",this,3)([e])}},{key:"toResult",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new t(new n,this,e).stringify()}}])).registerLazyResult=function(e){t=e},r.registerProcessor=function(e){n=e},qs=r,e.registerRoot(r.default=r)),qs;function s(e){return b(this,s),(e=ji(this,s,[e])).type="root",e.nodes||(e.nodes=[]),e}}function Ja(){var t;return Zs||(Zs=1,(Gs=t={comma:function(e){return t.split(e,[","],!0)},space:function(e){return t.split(e,[" ","\n","\t"])},split:function(e,t,n){var r,i=[],o="",s=!1,a=0,l=!1,u="",c=!1,d=Me(e);try{for(d.s();!(r=d.n()).done;){var f=r.value;c?c=!1:"\\"===f?c=!0:l?f===u&&(l=!1):'"'===f||"'"===f?(l=!0,u=f):"("===f?a+=1:")"===f?0<a&&--a:0===a&&t.includes(f)&&(s=!0),s?(""!==o&&i.push(o.trim()),o="",s=!1):o+=f}}catch(e){d.e(e)}finally{d.f()}return!n&&""===o||i.push(o.trim()),i}}).default=t),Gs}function Ka(){var e,t,n;return Ks||(Ks=1,e=ja(),t=Ja(),Vi(r,e),n=k(r,[{key:"selectors",get:function(){return t.comma(this.selector)},set:function(e){var t=this.selector?this.selector.match(/,\s*/):null,t=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(t)}}]),(Js=n).default=n,e.registerRule(n)),Js;function r(e){return b(this,r),(e=ji(this,r,[e])).type="rule",e.nodes||(e.nodes=[]),e}}function $a(){var e,r,i;return Qs||(Qs=1,e=ja(),r=(()=>{if(Xs)return $s;Xs=1;var p=Na(),e=(()=>{if(js)return Bs;js=1;var w="'".charCodeAt(0),b='"'.charCodeAt(0),k="\\".charCodeAt(0),_="/".charCodeAt(0),S="\n".charCodeAt(0),E=" ".charCodeAt(0),C="\f".charCodeAt(0),R="\t".charCodeAt(0),T="\r".charCodeAt(0),O="[".charCodeAt(0),x="]".charCodeAt(0),I="(".charCodeAt(0),M=")".charCodeAt(0),A="{".charCodeAt(0),P="}".charCodeAt(0),D=";".charCodeAt(0),L="*".charCodeAt(0),N=":".charCodeAt(0),F="@".charCodeAt(0),U=/[\t\n\f\r "#'()/;[\\\]{}]/g,z=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,B=/.[\r\n"'(/\\]/,j=/[\da-f]/i;return Bs=function(t){var r,i,o,s,a,l,u,c,d,e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},f=t.css.valueOf(),h=e.ignoreErrors,p=f.length,m=0,v=[],g=[];function y(e){throw t.error("Unclosed "+e,m)}return{back:function(e){g.push(e)},endOfFile:function(){return 0===g.length&&p<=m},nextToken:function(e){if(g.length)return g.pop();if(!(p<=m)){var t=!!e&&e.ignoreUnclosed;switch(r=f.charCodeAt(m)){case S:case E:case R:case T:case C:for(i=m;i+=1,(r=f.charCodeAt(i))===E||r===S||r===R||r===T||r===C;);d=["space",f.slice(m,i)],m=i-1;break;case O:case x:case A:case P:case N:case D:case M:var n=String.fromCharCode(r);d=[n,n,m];break;case I:if(u=v.length?v.pop()[1]:"",c=f.charCodeAt(m+1),"url"===u&&c!==w&&c!==b&&c!==E&&c!==S&&c!==R&&c!==C&&c!==T){i=m;do{if(a=!1,-1===(i=f.indexOf(")",i+1))){if(h||t){i=m;break}y("bracket")}for(l=i;f.charCodeAt(l-1)===k;)--l,a=!a}while(a);d=["brackets",f.slice(m,i+1),m,i],m=i}else i=f.indexOf(")",m+1),u=f.slice(m,i+1),-1===i||B.test(u)?d=["(","(",m]:(d=["brackets",u,m,i],m=i);break;case w:case b:o=r===w?"'":'"',i=m;do{if(a=!1,-1===(i=f.indexOf(o,i+1))){if(h||t){i=m+1;break}y("string")}for(l=i;f.charCodeAt(l-1)===k;)--l,a=!a}while(a);d=["string",f.slice(m,i+1),m,i],m=i;break;case F:U.lastIndex=m+1,U.test(f),i=0===U.lastIndex?f.length-1:U.lastIndex-2,d=["at-word",f.slice(m,i+1),m,i],m=i;break;case k:for(i=m,s=!0;f.charCodeAt(i+1)===k;)i+=1,s=!s;if(r=f.charCodeAt(i+1),s&&r!==_&&r!==E&&r!==S&&r!==R&&r!==T&&r!==C&&(i+=1,j.test(f.charAt(i)))){for(;j.test(f.charAt(i+1));)i+=1;f.charCodeAt(i+1)===E&&(i+=1)}d=["word",f.slice(m,i+1),m,i],m=i;break;default:m=(r===_&&f.charCodeAt(m+1)===L?(0===(i=f.indexOf("*/",m+2)+1)&&(h||t?i=f.length:y("comment")),d=["comment",f.slice(m,i+1),m,i]):(z.lastIndex=m+1,z.test(f),i=0===z.lastIndex?f.length-1:z.lastIndex-2,d=["word",f.slice(m,i+1),m,i],v.push(d)),i)}return m++,d}},position:function(){return m}}}})(),n=Ba(),u=Ga(),r=Za(),i=Ka(),f={empty:!0,space:!0};return $s=k(function e(t){b(this,e),this.input=t,this.root=new r,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{column:1,line:1,offset:0}}},[{key:"atrule",value:function(e){var t,n,r,i=new u;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);for(var o=!1,s=!1,a=[],l=[];!this.tokenizer.endOfFile();){if("("===(t=(e=this.tokenizer.nextToken())[0])||"["===t?l.push("("===t?")":"]"):"{"===t&&0<l.length?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(0<a.length){for(n=a[r=a.length-1];n&&"space"===n[0];)n=a[--r];n&&(i.source.end=this.getPosition(n[3]||n[2]),i.source.end.offset++)}this.end(e);break}}if(a.push(e),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)}},{key:"checkMissedSemicolon",value:function(e){var t=this.colon(e);if(!1!==t){for(var n,r=0,i=t-1;0<=i&&("space"===(n=e[i])[0]||2!==(r+=1));i--);throw this.input.error("Missed semicolon","word"===n[0]?n[3]+1:n[2])}}},{key:"colon",value:function(e){var t,n,r,i,o=0,s=Me(e.entries());try{for(s.s();!(i=s.n()).done;){var a=Pe(i.value,2),l=a[0];if("("===(n=(t=a[1])[0])&&(o+=1),")"===n&&--o,0===o&&":"===n){if(r){if("word"===r[0]&&"progid"===r[1])continue;return l}this.doubleColon(t)}r=t}}catch(e){s.e(e)}finally{s.f()}return!1}},{key:"comment",value:function(e){var t=new n,e=(this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,e[1].slice(2,-2));/^\s*$/.test(e)?(t.text="",t.raws.left=e,t.raws.right=""):(e=e.match(/^(\s*)([^]*\S)(\s*)$/),t.text=e[2],t.raws.left=e[1],t.raws.right=e[3])}},{key:"createTokenizer",value:function(){this.tokenizer=e(this.input)}},{key:"decl",value:function(e,t){var n=new p;this.init(n,e[0][2]);var r,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(i[3]||i[2]||(e=>{for(var t=e.length-1;0<=t;t--){var n=e[t],n=n[3]||n[2];if(n)return n}})(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){var o=e[0][0];if(":"===o||"space"===o||"comment"===o)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(":"===(r=e.shift())[0]){n.raws.between+=r[1];break}"word"===r[0]&&/\w/.test(r[1])&&this.unknownWord([r]),n.raws.between+=r[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));for(var s,a=[];e.length&&("space"===(s=e[0][0])||"comment"===s);)a.push(e.shift());this.precheckMissedSemicolon(e);for(var l=e.length-1;0<=l;l--){if("!important"===(r=e[l])[1].toLowerCase()){n.important=!0;var u=this.stringFrom(e,l);" !important"!==(u=this.spacesFromEnd(e)+u)&&(n.raws.important=u);break}if("important"===r[1].toLowerCase()){for(var c=e.slice(0),d="",f=l;0<f;f--){var h=c[f][0];if(0===d.trim().indexOf("!")&&"space"!==h)break;d=c.pop()[1]+d}0===d.trim().indexOf("!")&&(n.important=!0,n.raws.important=d,e=c)}if("space"!==r[0]&&"comment"!==r[0])break}e.some(function(e){return"space"!==e[0]&&"comment"!==e[0]})&&(n.raws.between+=a.map(function(e){return e[1]}).join(""),a=[]),this.raw(n,"value",a.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}},{key:"doubleColon",value:function(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}},{key:"emptyRule",value:function(e){var t=new i;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}},{key:"end",value:function(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)}},{key:"endFile",value:function(){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())}},{key:"freeSemicolon",value:function(e){this.spaces+=e[1],this.current.nodes&&(e=this.current.nodes[this.current.nodes.length-1])&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}},{key:"getPosition",value:function(e){var t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}},{key:"init",value:function(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)}},{key:"other",value:function(e){for(var t,n=!1,r=!1,i=null,o=[],s=e[1].startsWith("--"),a=[],l=e;l;){if(t=l[0],a.push(l),"("===t||"["===t)i=i||l,o.push("("===t?")":"]");else if(s&&r&&"{"===t)i=i||l,o.push("}");else if(0===o.length){if(";"===t){if(r)return void this.decl(a,s);break}if("{"===t)return void this.rule(a);if("}"===t){this.tokenizer.back(a.pop()),n=!0;break}":"===t&&(r=!0)}else t===o[o.length-1]&&(o.pop(),0===o.length)&&(i=null);l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(n=!0),0<o.length&&this.unclosedBracket(i),n&&r){if(!s)for(;a.length&&("space"===(l=a[a.length-1][0])||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,s)}else this.unknownWord(a)}},{key:"parse",value:function(){for(var e;!this.tokenizer.endOfFile();)switch((e=this.tokenizer.nextToken())[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()}},{key:"precheckMissedSemicolon",value:function(){}},{key:"raw",value:function(e,t,n,r){for(var i,o,s,a,l=n.length,u="",c=!0,d=0;d<l;d+=1)"space"===(s=(i=n[d])[0])&&d===l-1&&!r||"comment"===s&&(s=n[d-1]?n[d-1][0]:"empty",o=n[d+1]?n[d+1][0]:"empty",f[s]||f[o]||","===u.slice(-1))?c=!1:u+=i[1];c||(a=n.reduce(function(e,t){return e+t[1]},""),e.raws[t]={raw:a,value:u}),e[t]=u}},{key:"rule",value:function(e){e.pop();var t=new i;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}},{key:"spacesAndCommentsFromEnd",value:function(e){for(var t,n="";e.length&&("space"===(t=e[e.length-1][0])||"comment"===t);)n=e.pop()[1]+n;return n}},{key:"spacesAndCommentsFromStart",value:function(e){for(var t,n="";e.length&&("space"===(t=e[0][0])||"comment"===t);)n+=e.shift()[1];return n}},{key:"spacesFromEnd",value:function(e){for(var t="";e.length&&"space"===e[e.length-1][0];)t=e.pop()[1]+t;return t}},{key:"stringFrom",value:function(e,t){for(var n="",r=t;r<e.length;r++)n+=e[r][1];return e.splice(t,e.length-t),n}},{key:"unclosedBlock",value:function(){var e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}},{key:"unclosedBracket",value:function(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}},{key:"unexpectedClose",value:function(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}},{key:"unknownWord",value:function(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}},{key:"unnamedAtrule",value:function(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}}])})(),i=Ua(),Ys=t,e.registerParse(t.default=t)),Ys;function t(e,t){var n=new i(e,t),n=new r(n);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}}function Xa(){var d,a,n,r,l,e,i,u,c,t,o,f,h,p,s,m;return ta||(ta=1,e=Aa(),d=e.isClean,a=e.my,n=za(),r=Da(),l=ja(),e=Wa(),i=Ha(),u=Va(),c=$a(),t=Za(),o={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},f={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},h={Once:!0,postcssPlugin:!0,prepare:!0},p={},(s=k(function e(t,n,r){var i,o=this;if(b(this,e),this.stringified=!1,this.processed=!1,"object"!==_(n)||null===n||"root"!==n.type&&"document"!==n.type)if(n instanceof e||n instanceof u)i=w(n.root),n.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{var s=c;r.syntax&&(s=r.syntax.parse),(s=r.parser?r.parser:s).parse&&(s=s.parse);try{i=s(n,r)}catch(e){this.processed=!0,this.error=e}i&&!i[a]&&l.rebuild(i)}else i=w(n);this.result=new u(t,i,r),this.helpers=Ae(Ae({},p),{},{postcss:p,result:this.result}),this.plugins=this.processor.plugins.map(function(e){return"object"===_(e)&&e.prepare?Ae(Ae({},e),e.prepare(o.result)):e})},[{key:"async",value:function(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}},{key:"catch",value:function(e){return this.async().catch(e)}},{key:"finally",value:function(e){return this.async().then(e,e)}},{key:"getAsyncError",value:function(){throw new Error("Use process(css).then(cb) to work with async plugins")}},{key:"handleError",value:function(e,t){var n,r,i,o,s,a=this.result.lastPlugin;try{t&&t.addToError(e),"CssSyntaxError"!==(this.error=e).name||e.plugin?a.postcssVersion&&"production"!==process.env.NODE_ENV&&(n=a.postcssPlugin,r=a.postcssVersion,i=this.result.processor.version,o=r.split("."),s=i.split("."),o[0]!==s[0]||parseInt(o[1])>parseInt(s[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+i+", but "+n+" uses "+r+". Perhaps this is the source of the error below."):(e.plugin=a.postcssPlugin,e.setMessage())}catch(e){console&&console.error&&console.error(e)}return e}},{key:"prepareVisitors",value:function(){var r=this;this.listeners={};function e(e,t,n){r.listeners[t]||(r.listeners[t]=[]),r.listeners[t].push([e,n])}var t,n=Me(this.plugins);try{for(n.s();!(t=n.n()).done;){var i=t.value;if("object"===_(i))for(var o in i){if(!f[o]&&/^[A-Z]/.test(o))throw new Error("Unknown event ".concat(o," in ").concat(i.postcssPlugin,". Try to update PostCSS (").concat(this.processor.version," now)."));if(!h[o])if("object"===_(i[o]))for(var s in i[o])e(i,"*"===s?o:o+"-"+s.toLowerCase(),i[o][s]);else"function"==typeof i[o]&&e(i,o,i[o])}}}catch(r){n.e(r)}finally{n.f()}this.hasListener=0<Object.keys(this.listeners).length}},{key:"runAsync",value:(m=zi(Ki().m(function e(){var t,i,n,r,o,s,a,l,u,c=this;return Ki().w(function(e){for(;;)switch(e.p=e.n){case 0:this.plugin=0,t=0;case 1:if(t<this.plugins.length){if(a=this.plugins[t],v(a=this.runOnRoot(a)))return e.p=2,e.n=3,a;e.n=5}else e.n=6;break;case 3:e.n=5;break;case 4:throw e.p=4,a=e.v,this.handleError(a);case 5:t++,e.n=1;break;case 6:if(this.prepareVisitors(),!this.hasListener){e.n=21;break}i=this.result.root;case 7:if(i[d]){e.n=14;break}i[d]=!0,n=[y(i)];case 8:if(0<n.length){if(v(l=this.visitTick(n)))return e.p=9,e.n=10,l;e.n=12}else e.n=13;break;case 10:e.n=12;break;case 11:throw e.p=11,l=e.v,u=n[n.length-1].node,this.handleError(l,u);case 12:e.n=8;break;case 13:e.n=7;break;case 14:if(!this.listeners.OnceExit){e.n=21;break}r=Me(this.listeners.OnceExit),e.p=15,s=Ki().m(function e(){var t,n,r;return Ki().w(function(e){for(;;)switch(e.p=e.n){case 0:if(n=Pe(o.value,2),r=n[0],t=n[1],c.result.lastPlugin=r,e.p=1,"document"===i.type)return n=i.nodes.map(function(e){return t(e,c.helpers)}),e.n=2,Promise.all(n);e.n=3;break;case 2:e.n=4;break;case 3:return e.n=4,t(i,c.helpers);case 4:e.n=6;break;case 5:throw e.p=5,r=e.v,c.handleError(r);case 6:return e.a(2)}},e,null,[[1,5]])}),r.s();case 16:if((o=r.n()).done){e.n=18;break}return e.d(Xi(s()),17);case 17:e.n=16;break;case 18:e.n=20;break;case 19:e.p=19,u=e.v,r.e(u);case 20:return e.p=20,r.f(),e.f(20);case 21:return this.processed=!0,e.a(2,this.stringify())}},e,this,[[15,19,20,21],[9,11],[2,4]])})),function(){return m.apply(this,arguments)})},{key:"runOnRoot",value:function(t){var e,n=this;this.result.lastPlugin=t;try{return"object"===_(t)&&t.Once?"document"===this.result.root.type?v((e=this.result.root.nodes.map(function(e){return t.Once(e,n.helpers)}))[0])?Promise.all(e):e:t.Once(this.result.root,this.helpers):"function"==typeof t?t(this.result.root,this.result):void 0}catch(t){throw this.handleError(t)}}},{key:"stringify",value:function(){if(this.error)throw this.error;var e,t;return this.stringified||(this.stringified=!0,this.sync(),t=this.result.opts,e=r,t.syntax&&(e=t.syntax.stringify),(e=t.stringifier?t.stringifier:e).stringify&&(e=e.stringify),t=new n(e,this.result.root,this.result.opts).generate(),this.result.css=t[0],this.result.map=t[1]),this.result}},{key:"sync",value:function(){if(this.error)throw this.error;if(!this.processed){if(this.processed=!0,this.processing)throw this.getAsyncError();var e,t=Me(this.plugins);try{for(t.s();!(e=t.n()).done;){var n=e.value;if(v(this.runOnRoot(n)))throw this.getAsyncError()}}catch(e){t.e(e)}finally{t.f()}if(this.prepareVisitors(),this.hasListener){for(var r=this.result.root;!r[d];)r[d]=!0,this.walkSync(r);if(this.listeners.OnceExit)if("document"===r.type){var i,o=Me(r.nodes);try{for(o.s();!(i=o.n()).done;){var s=i.value;this.visitSync(this.listeners.OnceExit,s)}}catch(e){o.e(e)}finally{o.f()}}else this.visitSync(this.listeners.OnceExit,r)}}return this.result}},{key:"then",value:function(e,t){return"production"===process.env.NODE_ENV||"from"in this.opts||i("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)}},{key:"toString",value:function(){return this.css}},{key:"visitSync",value:function(e,t){var n,r=Me(e);try{for(r.s();!(n=r.n()).done;){var i=Pe(n.value,2),o=i[0],s=i[1],a=(this.result.lastPlugin=o,void 0);try{a=s(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(v(a))throw this.getAsyncError()}}catch(e){r.e(e)}finally{r.f()}}},{key:"visitTick",value:function(e){var t=e[e.length-1],n=t.node,r=t.visitors;if("root"===n.type||"document"===n.type||n.parent){if(0<r.length&&t.visitorIndex<r.length){var i=Pe(r[t.visitorIndex],2),o=i[0],i=i[1];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=o;try{return i(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==t.iterator){for(var s,a=t.iterator;s=n.nodes[n.indexes[a]];)if(n.indexes[a]+=1,!s[d])return s[d]=!0,void e.push(y(s));t.iterator=0,delete n.indexes[a]}for(var l=t.events;t.eventIndex<l.length;){var u=l[t.eventIndex];if(t.eventIndex+=1,0===u)return void(n.nodes&&n.nodes.length&&(n[d]=!0,t.iterator=n.getIterator()));if(this.listeners[u])return void(t.visitors=this.listeners[u])}}e.pop()}},{key:"walkSync",value:function(e){var t=this;e[d]=!0;var n,r=Me(g(e));try{for(r.s();!(n=r.n()).done;){var i=n.value;if(0===i)e.nodes&&e.each(function(e){e[d]||t.walkSync(e)});else{var o=this.listeners[i];if(o&&this.visitSync(o,e.toProxy()))return}}}catch(e){r.e(e)}finally{r.f()}}},{key:"warnings",value:function(){return this.sync().warnings()}},{key:"content",get:function(){return this.stringify().content}},{key:"css",get:function(){return this.stringify().css}},{key:"map",get:function(){return this.stringify().map}},{key:"messages",get:function(){return this.sync().messages}},{key:"opts",get:function(){return this.result.opts}},{key:"processor",get:function(){return this.result.processor}},{key:"root",get:function(){return this.sync().root}},{key:Symbol.toStringTag,get:function(){return"LazyResult"}}])).registerPostcss=function(e){p=e},ea=s,t.registerLazyResult(s.default=s),e.registerLazyResult(s)),ea;function v(e){return"object"===_(e)&&"function"==typeof e.then}function g(e){var t=!1,n=o[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,0,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,0,n+"Exit"]:[n,n+"Exit"]}function y(e){return{eventIndex:0,events:"document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:g(e),iterator:0,node:e,visitorIndex:0,visitors:[]}}function w(e){return e[d]=!1,e.nodes&&e.nodes.forEach(w),e}}function Ya(e,t){if(Array.isArray(e))return e.map(function(e){return Ya(e)});var n,r=e.inputs,i=Ji(e,oo);if(r){t=[];var o,s=Me(r);try{for(s.s();!(o=s.n()).done;){var a=Ae(Ae({},o.value),{},{__proto__:ya.prototype});a.map&&(a.map=Ae(Ae({},a.map),{},{__proto__:ma.prototype})),t.push(a)}}catch(e){s.e(e)}finally{s.f()}}if(i.nodes&&(i.nodes=e.nodes.map(function(e){return Ya(e,t)})),i.source&&(n=(r=i.source).inputId,r=Ji(r,so),i.source=r,null!=n)&&(i.source.input=t[n]),"root"===i.type)return new wa(i);if("decl"===i.type)return new pa(i);if("rule"===i.type)return new ba(i);if("comment"===i.type)return new va(i);if("atrule"===i.type)return new ga(i);throw new Error("Unknown node type: "+e.type)}function o(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 1===t.length&&Array.isArray(t[0])&&(t=t[0]),new sa(t)}function Qa(e,t,n){e=e,t="symbol"!==_(t)?t+"":t,n=n,t in e?el(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n}tm||(tm=1,i=cs(),oa=Na(),tm=Xa(),iu=ja(),lm||(lm=1,a||(a=1,Ca=za(),Ra=Da(),Ta=Ha(),Oa=$a(),xa=Va(),Ia=k(function e(t,n,r){b(this,e),n=n.toString(),this.stringified=!1,this._processor=t,this._css=n,this._opts=r,this._map=void 0;var t=Ra,i=(this.result=new xa(this._processor,void 0,this._opts),this.result.css=n,this),r=(Object.defineProperty(this.result,"root",{get:function(){return i.root}}),new Ca(t,void 0,this._opts,n));r.isMap()?(n=(t=Pe(r.generate(),2))[0],t=t[1],n&&(this.result.css=n),t&&(this.result.map=t)):(r.clearAnnotation(),this.result.css=r.css)},[{key:"async",value:function(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}},{key:"catch",value:function(e){return this.async().catch(e)}},{key:"finally",value:function(e){return this.async().then(e,e)}},{key:"sync",value:function(){if(this.error)throw this.error;return this.result}},{key:"then",value:function(e,t){return"production"===process.env.NODE_ENV||"from"in this._opts||Ta("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)}},{key:"toString",value:function(){return this._css}},{key:"warnings",value:function(){return[]}},{key:"content",get:function(){return this.result.css}},{key:"css",get:function(){return this.result.css}},{key:"map",get:function(){return this.result.map}},{key:"messages",get:function(){return[]}},{key:"opts",get:function(){return this.result.opts}},{key:"processor",get:function(){return this.result.processor}},{key:"root",get:function(){if(this._root)return this._root;var e,t=Oa;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e}},{key:Symbol.toStringTag,get:function(){return"NoWorkResult"}}]),(na=Ia).default=Ia),ka=na,_a=Xa(),Ia=Wa(),Sa=Za(),Ea=k(function e(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[];b(this,e),this.version="8.4.38",this.plugins=this.normalize(t)},[{key:"normalize",value:function(e){var t,n=[],r=Me(e);try{for(r.s();!(t=r.n()).done;){var i=t.value;if(!0===i.postcss?i=i():i.postcss&&(i=i.postcss),"object"===_(i)&&Array.isArray(i.plugins))n=n.concat(i.plugins);else if("object"===_(i)&&i.postcssPlugin)n.push(i);else if("function"==typeof i)n.push(i);else{if("object"!==_(i)||!i.parse&&!i.stringify)throw new Error(i+" 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.")}}}catch(e){r.e(e)}finally{r.f()}return n}},{key:"process",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return new(this.plugins.length||t.parser||t.stringifier||t.syntax?_a:ka)(this,e,t)}},{key:"use",value:function(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}]),(ra=Ea).default=Ea,Sa.registerProcessor(Ea),Ia.registerProcessor(Ea)),sa=ra,Sa=Da(),f||(f=1,pa=Na(),ma=Fa(),va=Ba(),ga=Ga(),ya=Ua(),wa=Za(),ba=Ka(),(ia=Ya).default=Ya),Ea=ia,aa=Wa(),lm=qa(),la=Ba(),ua=Ga(),a=Va(),f=Ua(),ca=$a(),da=Ja(),fa=Ka(),ha=Za(),cu=La(),o.plugin=function(t,n){var e,r=!1;function i(){console&&console.warn&&!r&&(r=!0,console.warn(t+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG)&&process.env.LANG.startsWith("cn")&&console.warn(t+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226");var e=n.apply(void 0,arguments);return e.postcssPlugin=t,e.postcssVersion=(new sa).version,e}return Object.defineProperty(i,"postcss",{get:function(){return e=e||i()}}),i.process=function(e,t,n){return o([i(n)]).process(e,t)},i},o.stringify=Sa,o.parse=ca,o.fromJSON=Ea,o.list=da,o.comment=function(e){return new la(e)},o.atRule=function(e){return new ua(e)},o.decl=function(e){return new oa(e)},o.rule=function(e){return new fa(e)},o.root=function(e){return new ha(e)},o.document=function(e){return new aa(e)},o.CssSyntaxError=i,o.Declaration=oa,o.Container=iu,o.Processor=sa,o.Document=aa,o.Comment=la,o.Warning=lm,o.AtRule=ua,o.Result=a,o.Input=f,o.Rule=fa,o.Root=ha,o.Node=cu,tm.registerPostcss(o),(ca=o).default=o),(i=(da=ca)&&da.__esModule&&Object.prototype.hasOwnProperty.call(da,"default")?da.default:da).stringify;var el=Object.defineProperty;Date.now().toString();var tl,nl,rl,il,ol,sl,al={exports:{}},p=(il=Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"}))).__esModule?il:("function"==typeof(ol=il.default)?(sl=function e(){return this instanceof e?Reflect.construct(ol,arguments,this.constructor):ol.apply(this,arguments)}).prototype=ol.prototype:sl={},Object.defineProperty(sl,"__esModule",{value:!0}),Object.keys(il).forEach(function(e){var t=Object.getOwnPropertyDescriptor(il,e);Object.defineProperty(sl,e,t.get?t:{enumerable:!0,get:function(){return il[e]}})}),sl);function ll(){var d,f,e,t;return rl||(rl=1,tl||(tl=1,e=String,al.exports=(t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}})(),al.exports.createColors=t),d=al.exports,f=p,Vi(a,ro(Error)),t=k(a,[{key:"setMessage",value:function(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file||"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}},{key:"showSourceCode",value:function(e){var r=this;if(!this.source)return"";var t=this.source;null==e&&(e=d.isColorSupported);var n,i,o,s,a,t=(t=f&&e?f(t):t).split(/\r?\n/),l=Math.max(this.line-3,0),u=Math.min(this.line+2,t.length),c=String(u).length;return e?(e=d.createColors(!0),n=e.bold,i=e.gray,o=e.red,s=function(e){return n(o(e))},a=function(e){return i(e)}):s=a=function(e){return e},t.slice(l,u).map(function(e,t){var t=l+1+t,n=" "+(" "+t).slice(-c)+" | ";return t===r.line?(t=a(n.replace(/\d/g," "))+e.slice(0,r.column-1).replace(/[^\t]/g," "),s(">")+a(n)+e+"\n "+t+s("^")):" "+a(n)+e}).join("\n")}},{key:"toString",value:function(){var e=(e=this.showSourceCode())&&"\n\n"+e+"\n";return this.name+": "+this.message+e}}]),(nl=t).default=t),nl;function a(e,t,n,r,i,o){var s;return b(this,a),(s=ji(this,a,[e])).name="CssSyntaxError",s.reason=e,i&&(s.file=i),r&&(s.source=r),o&&(s.plugin=o),void 0!==t&&void 0!==n&&("number"==typeof t?(s.line=t,s.column=n):(s.line=t.line,s.column=t.column,s.endLine=n.line,s.endColumn=n.column)),s.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(s,a),s}}var ul,cl,dl,fl,hl,pl,ml,vl,gl,yl,wl,bl,kl,_l,Sl,El,Cl,Rl,Tl,Ol,xl,Il,Ml,Al,Pl,Dl,Ll,Nl,Fl,Ul,zl,Bl,jl,Wl,Hl,ql,Vl,Gl,Zl,Jl,Kl,$l,Xl,Yl,Ql,eu,tu,nu,ru,iu,ou,su,au,lu,uu,cu,du,fu,hu,pu,mu,vu,gu,yu,wu,bu,ku,_u,Su,Eu,Cu,Ru,Tu,Ou,xu,Iu={};function Mu(){return ul||(ul=1,Iu.isClean=Symbol("isClean"),Iu.my=Symbol("my")),Iu}function Au(){var s,e;return dl||(s={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!(dl=1)},e=k(function e(t){b(this,e),this.builder=t},[{key:"atrule",value:function(e,t){var n="@"+e.name,r=e.params?this.rawValue(e,"params"):"";void 0!==e.raws.afterName?n+=e.raws.afterName:r&&(n+=" "),e.nodes?this.block(e,n+r):(t=(e.raws.between||"")+(t?";":""),this.builder(n+r+t,e))}},{key:"beforeAfter",value:function(e,t){for(var n="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"),r=e.parent,i=0;r&&"root"!==r.type;)i+=1,r=r.parent;if(n.includes("\n")){var o=this.raw(e,null,"indent");if(o.length)for(var s=0;s<i;s++)n+=o}return n}},{key:"block",value:function(e,t){var n=this.raw(e,"between","beforeOpen");this.builder(t+n+"{",e,"start"),(t=e.nodes&&e.nodes.length?(this.body(e),this.raw(e,"after")):this.raw(e,"after","emptyBody"))&&this.builder(t),this.builder("}",e,"end")}},{key:"body",value:function(e){for(var t=e.nodes.length-1;0<t&&"comment"===e.nodes[t].type;)--t;for(var n=this.raw(e,"semicolon"),r=0;r<e.nodes.length;r++){var i=e.nodes[r],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,t!==r||n)}}},{key:"comment",value:function(e){var t=this.raw(e,"left","commentLeft"),n=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+n+"*/",e)}},{key:"decl",value:function(e,t){var n=this.raw(e,"between","colon"),n=e.prop+n+this.rawValue(e,"value");e.important&&(n+=e.raws.important||" !important"),t&&(n+=";"),this.builder(n,e)}},{key:"document",value:function(e){this.body(e)}},{key:"raw",value:function(e,t,n){var r;if(t&&void 0!==(r=e.raws[t]))return r;var i,o=e.parent;if("before"===(n=n||t)){if(!o||"root"===o.type&&o.first===e)return"";if(o&&"document"===o.type)return""}return o?((o=e.root()).rawCache||(o.rawCache={}),void 0!==o.rawCache[n]?o.rawCache[n]:"before"===n||"after"===n?this.beforeAfter(e,n):(this[i="raw"+((i=n)[0].toUpperCase()+i.slice(1))]?r=this[i](o,e):o.walk(function(e){if(void 0!==(r=e.raws[t]))return!1}),void 0===r&&(r=s[n]),o.rawCache[n]=r)):s[n]}},{key:"rawBeforeClose",value:function(e){var t;return e.walk(function(e){if(e.nodes&&0<e.nodes.length&&void 0!==e.raws.after)return(t=e.raws.after).includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t=t&&t.replace(/\S/g,"")}},{key:"rawBeforeComment",value:function(e,t){var n;return e.walkComments(function(e){if(void 0!==e.raws.before)return(n=e.raws.before).includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),n=void 0===n?this.raw(t,null,"beforeDecl"):n&&n.replace(/\S/g,"")}},{key:"rawBeforeDecl",value:function(e,t){var n;return e.walkDecls(function(e){if(void 0!==e.raws.before)return(n=e.raws.before).includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),n=void 0===n?this.raw(t,null,"beforeRule"):n&&n.replace(/\S/g,"")}},{key:"rawBeforeOpen",value:function(e){var t;return e.walk(function(e){if("decl"!==e.type&&void 0!==(t=e.raws.between))return!1}),t}},{key:"rawBeforeRule",value:function(t){var n;return t.walk(function(e){if(e.nodes&&(e.parent!==t||t.first!==e)&&void 0!==e.raws.before)return(n=e.raws.before).includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),n=n&&n.replace(/\S/g,"")}},{key:"rawColon",value:function(e){var t;return e.walkDecls(function(e){if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}},{key:"rawEmptyBody",value:function(e){var t;return e.walk(function(e){if(e.nodes&&0===e.nodes.length&&void 0!==(t=e.raws.after))return!1}),t}},{key:"rawIndent",value:function(n){return n.raws.indent||(n.walk(function(e){var t=e.parent;if(t&&t!==n&&t.parent&&t.parent===n&&void 0!==e.raws.before)return t=e.raws.before.split("\n"),r=(r=t[t.length-1]).replace(/\S/g,""),!1}),r);var r}},{key:"rawSemicolon",value:function(e){var t;return e.walk(function(e){if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&void 0!==(t=e.raws.semicolon))return!1}),t}},{key:"rawValue",value:function(e,t){var n=e[t],e=e.raws[t];return e&&e.value===n?e.raw:n}},{key:"root",value:function(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}},{key:"rule",value:function(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}},{key:"stringify",value:function(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)}}]),(cl=e).default=e),cl}function Pu(){var n;return hl||(hl=1,n=Au(),(fl=e).default=e),fl;function e(e,t){new n(t).stringify(e)}}function Du(){var s,a,i,n,r,e;return ml||(ml=1,e=Mu(),s=e.isClean,a=e.my,i=ll(),n=Au(),r=Pu(),e=k(function e(){var t,n=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};for(t in b(this,e),this.raws={},this[s]=!1,this[a]=!0,n)if("nodes"===t){this.nodes=[];var r,i=Me(n[t]);try{for(i.s();!(r=i.n()).done;){var o=r.value;"function"==typeof o.clone?this.append(o.clone()):this.append(o)}}catch(e){i.e(e)}finally{i.f()}}else this[t]=n[t]},[{key:"addToError",value:function(e){var t;return e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)&&(t=this.source,e.stack=e.stack.replace(/\n\s{4}at /,"$&".concat(t.input.from,":").concat(t.start.line,":").concat(t.start.column,"$&"))),e}},{key:"after",value:function(e){return this.parent.insertAfter(this,e),this}},{key:"assign",value:function(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};for(e in t)this[e]=t[e];return this}},{key:"before",value:function(e){return this.parent.insertBefore(this,e),this}},{key:"cleanRaws",value:function(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}},{key:"clone",value:function(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},n=function t(e,n){var r,i,o,s=new e.constructor;for(r in e)Object.prototype.hasOwnProperty.call(e,r)&&"proxyCache"!==r&&(o=_(i=e[r]),"parent"===r&&"object"===o?n&&(s[r]=n):"source"===r?s[r]=i:Array.isArray(i)?s[r]=i.map(function(e){return t(e,s)}):("object"===o&&null!==i&&(i=t(i)),s[r]=i));return s}(this);for(e in t)n[e]=t[e];return n}},{key:"cloneAfter",value:function(){var e=this.clone(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{});return this.parent.insertAfter(this,e),e}},{key:"cloneBefore",value:function(){var e=this.clone(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{});return this.parent.insertBefore(this,e),e}},{key:"error",value:function(e){var t,n,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return this.source?(t=(n=this.rangeBy(r)).end,this.source.input.error(e,{column:(n=n.start).column,line:n.line},{column:t.column,line:t.line},r)):new i(e)}},{key:"getProxyProcessor",value:function(){return{get:function(e,t){return"proxyOf"===t?e:"root"===t?function(){return e.root().toProxy()}:e[t]},set:function(e,t,n){return e[t]!==n&&(e[t]=n,"prop"===t||"value"===t||"name"===t||"params"===t||"important"===t||"text"===t)&&e.markDirty(),!0}}}},{key:"markDirty",value:function(){if(this[s]){this[s]=!1;for(var e=this;e=e.parent;)e[s]=!1}}},{key:"next",value:function(){var e;if(this.parent)return e=this.parent.index(this),this.parent.nodes[e+1]}},{key:"positionBy",value:function(e,t){var n=this.source.start;return e.index?n=this.positionInside(e.index,t):e.word&&-1!==(e=(t=this.toString()).indexOf(e.word))&&(n=this.positionInside(e,t)),n}},{key:"positionInside",value:function(e,t){for(var n=t||this.toString(),r=this.source.start.column,i=this.source.start.line,o=0;o<e;o++)"\n"===n[o]?i+=r=1:r+=1;return{column:r,line:i}}},{key:"prev",value:function(){var e;if(this.parent)return e=this.parent.index(this),this.parent.nodes[e-1]}},{key:"rangeBy",value:function(e){var t,n,r={column:this.source.start.column,line:this.source.start.line},i=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:r.column+1,line:r.line};return e.word?-1!==(n=(t=this.toString()).indexOf(e.word))&&(r=this.positionInside(n,t),i=this.positionInside(n+e.word.length,t)):(e.start?r={column:e.start.column,line:e.start.line}:e.index&&(r=this.positionInside(e.index)),e.end?i={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?i=this.positionInside(e.endIndex):e.index&&(i=this.positionInside(e.index+1))),{end:i=i.line<r.line||i.line===r.line&&i.column<=r.column?{column:r.column+1,line:r.line}:i,start:r}}},{key:"raw",value:function(e,t){return(new n).raw(this,e,t)}},{key:"remove",value:function(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}},{key:"replaceWith",value:function(){if(this.parent){for(var e=this,t=!1,n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];for(var o=0,s=r;o<s.length;o++){var a=s[o];a===this?t=!0:t?(this.parent.insertAfter(e,a),e=a):this.parent.insertBefore(e,a)}t||this.remove()}return this}},{key:"root",value:function(){for(var e=this;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}},{key:"toJSON",value:function(e,t){var n,r,i,o={},s=null==t,a=(t=t||new Map,0);for(n in this)Object.prototype.hasOwnProperty.call(this,n)&&"parent"!==n&&"proxyCache"!==n&&(r=this[n],Array.isArray(r)?o[n]=r.map(function(e){return"object"===_(e)&&e.toJSON?e.toJSON(null,t):e}):"object"===_(r)&&r.toJSON?o[n]=r.toJSON(null,t):"source"===n?(null==(i=t.get(r.input))&&(i=a,t.set(r.input,a),a++),o[n]={end:r.end,inputId:i,start:r.start}):o[n]=r);return s&&(o.inputs=eo(t.keys()).map(function(e){return e.toJSON()})),o}},{key:"toProxy",value:function(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}},{key:"toString",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:r,t=(e.stringify&&(e=e.stringify),"");return e(this,function(e){t+=e}),t}},{key:"warn",value:function(e,t,n){var r,i={node:this};for(r in n)i[r]=n[r];return e.warn(t,i)}},{key:"proxyOf",get:function(){return this}}]),(pl=e).default=e),pl}function Lu(){var e;return gl||(gl=1,Vi(t,Du()),e=k(t,[{key:"variable",get:function(){return this.prop.startsWith("--")||"$"===this.prop[0]}}]),(vl=e).default=e),vl;function t(e){return b(this,t),(e=ji(this,t,[e=e&&void 0!==e.value&&"string"!=typeof e.value?Ae(Ae({},e),{},{value:String(e.value)}):e])).type="decl",e}}function Nu(){var r,i,t,n,o,s,e;return kl||(kl=1,r=p.SourceMapConsumer,i=p.SourceMapGenerator,t=p.existsSync,n=p.readFileSync,o=p.dirname,s=p.join,e=k(function e(t,n){b(this,e),!1!==n.map&&(this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:"),t=n.map?n.map.prev:void 0,t=this.loadMap(n.from,t),!this.mapFile&&n.from&&(this.mapFile=n.from),this.mapFile&&(this.root=o(this.mapFile)),t)&&(this.text=t)},[{key:"consumer",value:function(){return this.consumerCache||(this.consumerCache=new r(this.text)),this.consumerCache}},{key:"decodeInline",value:function(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=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+t)}},{key:"getAnnotationURL",value:function(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}},{key:"isMap",value:function(e){return"object"===_(e)&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}},{key:"loadAnnotation",value:function(e){var t,n=e.match(/\/\*\s*# sourceMappingURL=/gm);n&&(n=e.lastIndexOf(n.pop()),t=e.indexOf("*/",n),-1<n)&&-1<t&&(this.annotation=this.getAnnotationURL(e.substring(n,t)))}},{key:"loadFile",value:function(e){if(this.root=o(e),t(e))return this.mapFile=e,n(e,"utf-8").toString().trim()}},{key:"loadMap",value:function(e,t){if(!1===t)return!1;if(!t)return this.inline?this.decodeInline(this.annotation):this.annotation?(n=this.annotation,e&&(n=s(o(e),n)),this.loadFile(n)):void 0;if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof r)return i.fromSourceMap(t).toString();if(t instanceof i)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}var n=t(e);if(n){t=this.loadFile(n);if(t)return t;throw new Error("Unable to load previous source map: "+n.toString())}}},{key:"startWith",value:function(e,t){return!!e&&e.substr(0,t.length)===t}},{key:"withContent",value:function(){return!!(this.consumer().sourcesContent&&0<this.consumer().sourcesContent.length)}}]),(bl=e).default=e),bl}function Fu(){var e,s,l,a,r,i,t,u,o,c,d,f,n;return Sl||(Sl=1,n=p.SourceMapConsumer,e=p.SourceMapGenerator,s=p.fileURLToPath,l=p.pathToFileURL,a=p.isAbsolute,r=p.resolve,i=(wl?yl:(wl=1,yl={nanoid:function(){for(var e="",t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:21;t--;)e+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return e},customAlphabet:function(n){var r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:21;return function(){for(var e="",t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:r;t--;)e+=n[Math.random()*n.length|0];return e}}})).nanoid,t=p,u=ll(),o=Nu(),c=Symbol("fromOffsetCache"),d=Boolean(n&&e),f=Boolean(r&&a),n=k(function e(t){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(b(this,e),null==t||"object"===_(t)&&!t.toString)throw new Error("PostCSS received ".concat(t," instead of CSS string"));this.css=t.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,n.from&&(!f||/^\w+:\/\//.test(n.from)||a(n.from)?this.file=n.from:this.file=r(n.from)),f&&d&&(t=new o(this.css,n)).text&&(n=(this.map=t).consumer().file,!this.file)&&n&&(this.file=this.mapResolve(n)),this.file||(this.id="<input css "+i(6)+">"),this.map&&(this.map.file=this.from)},[{key:"error",value:function(e,t,n){var r,i,o,s=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{},a=(t&&"object"===_(t)?(a=n,n="number"==typeof(i=t).offset?(t=(o=this.fromOffset(i.offset)).line,o.col):(t=i.line,i.column),i="number"==typeof a.offset?(r=(o=this.fromOffset(a.offset)).line,o.col):(r=a.line,a.column)):n||(t=(o=this.fromOffset(t)).line,n=o.col),this.origin(t,n,r,i));return(o=a?new u(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,s.plugin):new u(e,void 0===r?t:{column:n,line:t},void 0===r?n:{column:i,line:r},this.css,this.file,s.plugin)).input={column:n,endColumn:i,endLine:r,line:t,source:this.css},this.file&&(l&&(o.input.url=l(this.file).toString()),o.input.file=this.file),o}},{key:"fromOffset",value:function(e){if(this[c])n=this[c];else{for(var t=this.css.split("\n"),n=new Array(t.length),r=0,i=0,o=t.length;i<o;i++)n[i]=r,r+=t[i].length+1;this[c]=n}var s=0;if(e>=n[n.length-1])s=n.length-1;else for(var a,l=n.length-2;s<l;)if(e<n[a=s+(l-s>>1)])l=a-1;else{if(!(e>=n[a+1])){s=a;break}s=a+1}return{col:e-n[s]+1,line:s+1}}},{key:"mapResolve",value:function(e){return/^\w+:\/\//.test(e)?e:r(this.map.consumer().sourceRoot||this.map.root||".",e)}},{key:"origin",value:function(e,t,n,r){if(!this.map)return!1;var i,o=this.map.consumer(),t=o.originalPositionFor({column:t,line:e});if(!t.source)return!1;"number"==typeof n&&(i=o.originalPositionFor({column:r,line:n}));e=a(t.source)?l(t.source):new URL(t.source,this.map.consumer().sourceRoot||l(this.map.mapFile)),r={column:t.column,endColumn:i&&i.column,endLine:i&&i.line,line:t.line,url:e.toString()};if("file:"===e.protocol){if(!s)throw new Error("file: protocol is not available in this PostCSS build");r.file=s(e)}n=o.sourceContentFor(t.source);return n&&(r.source=n),r}},{key:"toJSON",value:function(){for(var e={},t=0,n=["hasBOM","css","file","id"];t<n.length;t++){var r=n[t];null!=this[r]&&(e[r]=this[r])}return this.map&&(e.map=Ae({},this.map),e.map.consumerCache)&&(e.map.consumerCache=void 0),e}},{key:"from",get:function(){return this.file||this.id}}]),(_l=n).default=n,t&&t.registerInput&&t.registerInput(n)),_l}function Uu(){if(Cl)return El;Cl=1;var s=p.SourceMapConsumer,t=p.SourceMapGenerator,a=p.dirname,n=p.relative,r=p.resolve,i=p.sep,o=p.pathToFileURL,l=Fu(),e=Boolean(s&&t),u=Boolean(a&&r&&n&&i);return El=k(function e(t,n,r,i){b(this,e),this.stringify=t,this.mapOpts=r.map||{},this.root=n,this.opts=r,this.css=i,this.originalCSS=i,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map},[{key:"addAnnotation",value:function(){var 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",t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}},{key:"applyPrevMaps",value:function(){var e,t=Me(this.previous());try{for(t.s();!(e=t.n()).done;){var n=e.value,r=this.toUrl(this.path(n.file)),i=n.root||a(n.file),o=void 0;!1===this.mapOpts.sourcesContent?(o=new s(n.text)).sourcesContent&&(o.sourcesContent=null):o=n.consumer(),this.map.applySourceMap(o,r,this.toUrl(this.path(i)))}}catch(e){t.e(e)}finally{t.f()}}},{key:"clearAnnotation",value:function(){if(!1!==this.mapOpts.annotation)if(this.root)for(var e,t=this.root.nodes.length-1;0<=t;t--)"comment"===(e=this.root.nodes[t]).type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t);else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}},{key:"generate",value:function(){var t;return this.clearAnnotation(),u&&e&&this.isMap()?this.generateMap():(t="",this.stringify(this.root,function(e){t+=e}),[t])}},{key:"generateMap",value:function(){var e;return this.root?this.generateString():1===this.previous().length?((e=this.previous()[0].consumer()).file=this.outputFile(),this.map=t.fromSourceMap(e,{ignoreInvalidMapping:!0})):(this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"})),this.isSourcesContent()&&this.setSourcesContent(),this.root&&0<this.previous().length&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}},{key:"generateString",value:function(){var r=this;this.css="",this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0});var i,o=1,s=1,a={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,function(e,t,n){r.css+=e,t&&"end"!==n&&(a.generated.line=o,a.generated.column=s-1,t.source&&t.source.start?(a.source=r.sourcePath(t),a.original.line=t.source.start.line,a.original.column=t.source.start.column-1):(a.source="<no source>",a.original.line=1,a.original.column=0),r.map.addMapping(a)),(i=e.match(/\n/g))?(o+=i.length,i=e.lastIndexOf("\n"),s=e.length-i):s+=e.length,t&&"start"!==n&&(e=t.parent||{raws:{}},"decl"!==t.type&&("atrule"!==t.type||t.nodes)||t!==e.last||e.raws.semicolon)&&(t.source&&t.source.end?(a.source=r.sourcePath(t),a.original.line=t.source.end.line,a.original.column=t.source.end.column-1,a.generated.line=o,a.generated.column=s-2):(a.source="<no source>",a.original.line=1,a.original.column=0,a.generated.line=o,a.generated.column=s-1),r.map.addMapping(a))})}},{key:"isAnnotation",value:function(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(function(e){return e.annotation}))}},{key:"isInline",value:function(){var e;return void 0!==this.mapOpts.inline?this.mapOpts.inline:(void 0===(e=this.mapOpts.annotation)||!0===e)&&(!this.previous().length||this.previous().some(function(e){return e.inline}))}},{key:"isMap",value:function(){return void 0!==this.opts.map?!!this.opts.map:0<this.previous().length}},{key:"isSourcesContent",value:function(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(function(e){return e.withContent()})}},{key:"outputFile",value:function(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}},{key:"path",value:function(e){var t;return this.mapOpts.absolute||60===e.charCodeAt(0)||/^\w+:\/\//.test(e)?e:this.memoizedPaths.get(e)||(t=this.opts.to?a(this.opts.to):".","string"==typeof this.mapOpts.annotation&&(t=a(r(t,this.mapOpts.annotation))),t=n(t,e),this.memoizedPaths.set(e,t),t)}},{key:"previous",value:function(){var e,t=this;return this.previousMaps||(this.previousMaps=[],this.root?this.root.walk(function(e){e.source&&e.source.input.map&&(e=e.source.input.map,t.previousMaps.includes(e)||t.previousMaps.push(e))}):(e=new l(this.originalCSS,this.opts)).map&&this.previousMaps.push(e.map)),this.previousMaps}},{key:"setSourcesContent",value:function(){var e,n=this,r={};this.root?this.root.walk(function(e){var t;e.source&&(t=e.source.input.from)&&!r[t]&&(r[t]=!0,t=n.usesFileUrls?n.toFileUrl(t):n.toUrl(n.path(t)),n.map.setSourceContent(t,e.source.input.css))}):this.css&&(e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>",this.map.setSourceContent(e,this.css))}},{key:"sourcePath",value:function(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))}},{key:"toBase64",value:function(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}},{key:"toFileUrl",value:function(e){var t=this.memoizedFileURLs.get(e);if(t)return t;if(o)return t=o(e).toString(),this.memoizedFileURLs.set(e,t),t;throw new Error("`map.absolute` option is not available in this PostCSS build")}},{key:"toUrl",value:function(e){var t=this.memoizedURLs.get(e);if(t)return t;"\\"===i&&(e=e.replace(/\\/g,"/"));t=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,t),t}}])}function zu(){var e;return Tl||(Tl=1,Vi(t,Du()),e=k(t),(Rl=e).default=e),Rl;function t(e){return b(this,t),(e=ji(this,t,[e])).type="comment",e}}function Bu(){var u,c,d,t,e,f,h,p,m,n;return xl||(xl=1,e=Mu(),f=e.isClean,h=e.my,p=Lu(),m=zu(),Vi(v,Du()),(n=k(v,[{key:"append",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r=0,i=t;r<i.length;r++){var o,s=i[r],a=Me(this.normalize(s,this.last));try{for(a.s();!(o=a.n()).done;){var l=o.value;this.proxyOf.nodes.push(l)}}catch(e){a.e(e)}finally{a.f()}}return this.markDirty(),this}},{key:"cleanRaws",value:function(e){if(Qi(v,"cleanRaws",this,3)([e]),this.nodes){var t,n=Me(this.nodes);try{for(n.s();!(t=n.n()).done;)t.value.cleanRaws(e)}catch(e){n.e(e)}finally{n.f()}}}},{key:"each",value:function(e){if(this.proxyOf.nodes){for(var t,n,r=this.getIterator();this.indexes[r]<this.proxyOf.nodes.length&&(t=this.indexes[r],!1!==(n=e(this.proxyOf.nodes[t],t)));)this.indexes[r]+=1;return delete this.indexes[r],n}}},{key:"every",value:function(e){return this.nodes.every(e)}},{key:"getIterator",value:function(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;var e=this.lastEach;return this.indexes[e]=0,e}},{key:"getProxyProcessor",value:function(){return{get:function(r,o){return"proxyOf"===o?r:r[o]&&("each"===o||"string"==typeof o&&o.startsWith("walk")?function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Bi(r[o],r,eo(t.map(function(n){return"function"==typeof n?function(e,t){return n(e.toProxy(),t)}:n})))}:"every"===o||"some"===o?function(i){return r[o](function(e){for(var t=arguments.length,n=new Array(1<t?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Bi(i,void 0,[e.toProxy()].concat(n))})}:"root"===o?function(){return r.root().toProxy()}:"nodes"===o?r.nodes.map(function(e){return e.toProxy()}):"first"===o||"last"===o?r[o].toProxy():r[o])},set:function(e,t,n){return e[t]!==n&&(e[t]=n,"name"===t||"params"===t||"selector"===t)&&e.markDirty(),!0}}}},{key:"index",value:function(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}},{key:"insertAfter",value:function(e,t){var n,r,i,o=this.index(e),s=this.normalize(t,this.proxyOf.nodes[o]).reverse(),o=this.index(e),a=Me(s);try{for(a.s();!(n=a.n()).done;){var l=n.value;this.proxyOf.nodes.splice(o+1,0,l)}}catch(e){a.e(e)}finally{a.f()}for(i in this.indexes)o<(r=this.indexes[i])&&(this.indexes[i]=r+s.length);return this.markDirty(),this}},{key:"insertBefore",value:function(e,t){var n,r,i,o=this.index(e),s=this.normalize(t,this.proxyOf.nodes[o],0===o&&"prepend").reverse(),o=this.index(e),a=Me(s);try{for(a.s();!(n=a.n()).done;){var l=n.value;this.proxyOf.nodes.splice(o,0,l)}}catch(e){a.e(e)}finally{a.f()}for(i in this.indexes)o<=(r=this.indexes[i])&&(this.indexes[i]=r+s.length);return this.markDirty(),this}},{key:"normalize",value:function(e,t){var n=this;if("string"==typeof e)e=function t(e){return e.map(function(e){return e.nodes&&(e.nodes=t(e.nodes)),delete e.source,e})}(u(e).nodes);else if(void 0===e)e=[];else if(Array.isArray(e)){var r,i=Me(e=e.slice(0));try{for(i.s();!(r=i.n()).done;){var o=r.value;o.parent&&o.parent.removeChild(o,"ignore")}}catch(e){i.e(e)}finally{i.f()}}else if("root"===e.type&&"document"!==this.type){var s,a=Me(e=e.nodes.slice(0));try{for(a.s();!(s=a.n()).done;){var l=s.value;l.parent&&l.parent.removeChild(l,"ignore")}}catch(e){a.e(e)}finally{a.f()}}else if(e.type)e=[e];else if(e.prop){if(void 0===e.value)throw new Error("Value field is missed in node creation");"string"!=typeof e.value&&(e.value=String(e.value)),e=[new p(e)]}else if(e.selector)e=[new c(e)];else if(e.name)e=[new d(e)];else{if(!e.text)throw new Error("Unknown node type in node creation");e=[new m(e)]}return e.map(function(e){return e[h]||v.rebuild(e),(e=e.proxyOf).parent&&e.parent.removeChild(e),e[f]&&function e(t){if(t[f]=!1,t.proxyOf.nodes){var n,r=Me(t.proxyOf.nodes);try{for(r.s();!(n=r.n()).done;)e(n.value)}catch(e){r.e(e)}finally{r.f()}}}(e),void 0===e.raws.before&&t&&void 0!==t.raws.before&&(e.raws.before=t.raws.before.replace(/\S/g,"")),e.parent=n.proxyOf,e})}},{key:"prepend",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,i=Me(t=t.reverse());try{for(i.s();!(r=i.n()).done;){var o,s,a=r.value,l=this.normalize(a,this.first,"prepend").reverse(),u=Me(l);try{for(u.s();!(o=u.n()).done;){var c=o.value;this.proxyOf.nodes.unshift(c)}}catch(e){u.e(e)}finally{u.f()}for(s in this.indexes)this.indexes[s]=this.indexes[s]+l.length}}catch(e){i.e(e)}finally{i.f()}return this.markDirty(),this}},{key:"push",value:function(e){return(e.parent=this).proxyOf.nodes.push(e),this}},{key:"removeAll",value:function(){var e,t=Me(this.proxyOf.nodes);try{for(t.s();!(e=t.n()).done;)e.value.parent=void 0}catch(e){t.e(e)}finally{t.f()}return this.proxyOf.nodes=[],this.markDirty(),this}},{key:"removeChild",value:function(e){var t,n;for(n in e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1),this.indexes)(t=this.indexes[n])>=e&&(this.indexes[n]=t-1);return this.markDirty(),this}},{key:"replaceValues",value:function(t,n,r){return r||(r=n,n={}),this.walkDecls(function(e){n.props&&!n.props.includes(e.prop)||n.fast&&!e.value.includes(n.fast)||(e.value=e.value.replace(t,r))}),this.markDirty(),this}},{key:"some",value:function(e){return this.nodes.some(e)}},{key:"walk",value:function(r){return this.each(function(t,e){var n;try{n=r(t,e)}catch(e){throw t.addToError(e)}return n=!1!==n&&t.walk?t.walk(r):n})}},{key:"walkAtRules",value:function(n,r){return r?n instanceof RegExp?this.walk(function(e,t){if("atrule"===e.type&&n.test(e.name))return r(e,t)}):this.walk(function(e,t){if("atrule"===e.type&&e.name===n)return r(e,t)}):(r=n,this.walk(function(e,t){if("atrule"===e.type)return r(e,t)}))}},{key:"walkComments",value:function(n){return this.walk(function(e,t){if("comment"===e.type)return n(e,t)})}},{key:"walkDecls",value:function(n,r){return r?n instanceof RegExp?this.walk(function(e,t){if("decl"===e.type&&n.test(e.prop))return r(e,t)}):this.walk(function(e,t){if("decl"===e.type&&e.prop===n)return r(e,t)}):(r=n,this.walk(function(e,t){if("decl"===e.type)return r(e,t)}))}},{key:"walkRules",value:function(n,r){return r?n instanceof RegExp?this.walk(function(e,t){if("rule"===e.type&&n.test(e.selector))return r(e,t)}):this.walk(function(e,t){if("rule"===e.type&&e.selector===n)return r(e,t)}):(r=n,this.walk(function(e,t){if("rule"===e.type)return r(e,t)}))}},{key:"first",get:function(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}},{key:"last",get:function(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}])).registerParse=function(e){u=e},n.registerRule=function(e){c=e},n.registerAtRule=function(e){d=e},n.registerRoot=function(e){t=e},((Ol=n).default=n).rebuild=function(e){"atrule"===e.type?Object.setPrototypeOf(e,d.prototype):"rule"===e.type?Object.setPrototypeOf(e,c.prototype):"decl"===e.type?Object.setPrototypeOf(e,p.prototype):"comment"===e.type?Object.setPrototypeOf(e,m.prototype):"root"===e.type&&Object.setPrototypeOf(e,t.prototype),e[h]=!0,e.nodes&&e.nodes.forEach(function(e){n.rebuild(e)})}),Ol;function v(){return b(this,v),ji(this,v,arguments)}}function ju(){var t,n,e;return Ml||(Ml=1,Vi(r,Bu()),(e=k(r,[{key:"toResult",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new t(new n,this,e).stringify()}}])).registerLazyResult=function(e){t=e},e.registerProcessor=function(e){n=e},(Il=e).default=e),Il;function r(e){return b(this,r),(e=ji(this,r,[Ae({type:"document"},e)])).nodes||(e.nodes=[]),e}}function Wu(){if(Pl)return Al;Pl=1;var t={};return Al=function(e){t[e]||(t[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))}}function Hu(){var e;return Ll||(Ll=1,e=k(function e(t){var n,r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};for(n in b(this,e),this.type="warning",this.text=t,r.node&&r.node.source&&(t=r.node.rangeBy(r),this.line=t.start.line,this.column=t.start.column,this.endLine=t.end.line,this.endColumn=t.end.column),r)this[n]=r[n]},[{key:"toString",value:function(){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}}]),(Dl=e).default=e),Dl}function qu(){var n,e;return Fl||(Fl=1,n=Hu(),e=k(function e(t,n,r){b(this,e),this.processor=t,this.messages=[],this.root=n,this.opts=r,this.css=void 0,this.map=void 0},[{key:"toString",value:function(){return this.css}},{key:"warn",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},e=(t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin),new n(e,t));return this.messages.push(e),e}},{key:"warnings",value:function(){return this.messages.filter(function(e){return"warning"===e.type})}},{key:"content",get:function(){return this.css}}]),(Nl=e).default=e),Nl}function Vu(){var e,t;return jl||(jl=1,Vi(r,e=Bu()),t=k(r,[{key:"append",value:function(){this.proxyOf.nodes||(this.nodes=[]);for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Qi(r,"append",this,3)(t)}},{key:"prepend",value:function(){this.proxyOf.nodes||(this.nodes=[]);for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Qi(r,"prepend",this,3)(t)}}]),(Bl=t).default=t,e.registerAtRule(t)),Bl;function r(e){return b(this,r),(e=ji(this,r,[e])).type="atrule",e}}function Gu(){var t,n,e,r;return Hl||(Hl=1,Vi(s,e=Bu()),(r=k(s,[{key:"normalize",value:function(e,t,n){var r=Qi(s,"normalize",this,3)([e]);if(t)if("prepend"===n)1<this.nodes.length?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t){var i,o=Me(r);try{for(o.s();!(i=o.n()).done;)i.value.raws.before=t.raws.before}catch(e){o.e(e)}finally{o.f()}}return r}},{key:"removeChild",value:function(e,t){var n=this.index(e);return!t&&0===n&&1<this.nodes.length&&(this.nodes[1].raws.before=this.nodes[n].raws.before),Qi(s,"removeChild",this,3)([e])}},{key:"toResult",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new t(new n,this,e).stringify()}}])).registerLazyResult=function(e){t=e},r.registerProcessor=function(e){n=e},Wl=r,e.registerRoot(r.default=r)),Wl;function s(e){return b(this,s),(e=ji(this,s,[e])).type="root",e.nodes||(e.nodes=[]),e}}function Zu(){var t;return Vl||(Vl=1,(ql=t={comma:function(e){return t.split(e,[","],!0)},space:function(e){return t.split(e,[" ","\n","\t"])},split:function(e,t,n){var r,i=[],o="",s=!1,a=0,l=!1,u="",c=!1,d=Me(e);try{for(d.s();!(r=d.n()).done;){var f=r.value;c?c=!1:"\\"===f?c=!0:l?f===u&&(l=!1):'"'===f||"'"===f?(l=!0,u=f):"("===f?a+=1:")"===f?0<a&&--a:0===a&&t.includes(f)&&(s=!0),s?(""!==o&&i.push(o.trim()),o="",s=!1):o+=f}}catch(e){d.e(e)}finally{d.f()}return!n&&""===o||i.push(o.trim()),i}}).default=t),ql}function Ju(){var e,t,n;return Zl||(Zl=1,e=Bu(),t=Zu(),Vi(r,e),n=k(r,[{key:"selectors",get:function(){return t.comma(this.selector)},set:function(e){var t=this.selector?this.selector.match(/,\s*/):null,t=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(t)}}]),(Gl=n).default=n,e.registerRule(n)),Gl;function r(e){return b(this,r),(e=ji(this,r,[e])).type="rule",e.nodes||(e.nodes=[]),e}}function Ku(){var e,r,i;return Xl||(Xl=1,e=Bu(),r=(()=>{if(Kl)return Jl;Kl=1;var p=Lu(),e=(()=>{if(zl)return Ul;zl=1;var w="'".charCodeAt(0),b='"'.charCodeAt(0),k="\\".charCodeAt(0),_="/".charCodeAt(0),S="\n".charCodeAt(0),E=" ".charCodeAt(0),C="\f".charCodeAt(0),R="\t".charCodeAt(0),T="\r".charCodeAt(0),O="[".charCodeAt(0),x="]".charCodeAt(0),I="(".charCodeAt(0),M=")".charCodeAt(0),A="{".charCodeAt(0),P="}".charCodeAt(0),D=";".charCodeAt(0),L="*".charCodeAt(0),N=":".charCodeAt(0),F="@".charCodeAt(0),U=/[\t\n\f\r "#'()/;[\\\]{}]/g,z=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,B=/.[\r\n"'(/\\]/,j=/[\da-f]/i;return Ul=function(t){var r,i,o,s,a,l,u,c,d,e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},f=t.css.valueOf(),h=e.ignoreErrors,p=f.length,m=0,v=[],g=[];function y(e){throw t.error("Unclosed "+e,m)}return{back:function(e){g.push(e)},endOfFile:function(){return 0===g.length&&p<=m},nextToken:function(e){if(g.length)return g.pop();if(!(p<=m)){var t=!!e&&e.ignoreUnclosed;switch(r=f.charCodeAt(m)){case S:case E:case R:case T:case C:for(i=m;i+=1,(r=f.charCodeAt(i))===E||r===S||r===R||r===T||r===C;);d=["space",f.slice(m,i)],m=i-1;break;case O:case x:case A:case P:case N:case D:case M:var n=String.fromCharCode(r);d=[n,n,m];break;case I:if(u=v.length?v.pop()[1]:"",c=f.charCodeAt(m+1),"url"===u&&c!==w&&c!==b&&c!==E&&c!==S&&c!==R&&c!==C&&c!==T){i=m;do{if(a=!1,-1===(i=f.indexOf(")",i+1))){if(h||t){i=m;break}y("bracket")}for(l=i;f.charCodeAt(l-1)===k;)--l,a=!a}while(a);d=["brackets",f.slice(m,i+1),m,i],m=i}else i=f.indexOf(")",m+1),u=f.slice(m,i+1),-1===i||B.test(u)?d=["(","(",m]:(d=["brackets",u,m,i],m=i);break;case w:case b:o=r===w?"'":'"',i=m;do{if(a=!1,-1===(i=f.indexOf(o,i+1))){if(h||t){i=m+1;break}y("string")}for(l=i;f.charCodeAt(l-1)===k;)--l,a=!a}while(a);d=["string",f.slice(m,i+1),m,i],m=i;break;case F:U.lastIndex=m+1,U.test(f),i=0===U.lastIndex?f.length-1:U.lastIndex-2,d=["at-word",f.slice(m,i+1),m,i],m=i;break;case k:for(i=m,s=!0;f.charCodeAt(i+1)===k;)i+=1,s=!s;if(r=f.charCodeAt(i+1),s&&r!==_&&r!==E&&r!==S&&r!==R&&r!==T&&r!==C&&(i+=1,j.test(f.charAt(i)))){for(;j.test(f.charAt(i+1));)i+=1;f.charCodeAt(i+1)===E&&(i+=1)}d=["word",f.slice(m,i+1),m,i],m=i;break;default:m=(r===_&&f.charCodeAt(m+1)===L?(0===(i=f.indexOf("*/",m+2)+1)&&(h||t?i=f.length:y("comment")),d=["comment",f.slice(m,i+1),m,i]):(z.lastIndex=m+1,z.test(f),i=0===z.lastIndex?f.length-1:z.lastIndex-2,d=["word",f.slice(m,i+1),m,i],v.push(d)),i)}return m++,d}},position:function(){return m}}}})(),n=zu(),u=Vu(),r=Gu(),i=Ju(),f={empty:!0,space:!0};return Jl=k(function e(t){b(this,e),this.input=t,this.root=new r,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{column:1,line:1,offset:0}}},[{key:"atrule",value:function(e){var t,n,r,i=new u;i.name=e[1].slice(1),""===i.name&&this.unnamedAtrule(i,e),this.init(i,e[2]);for(var o=!1,s=!1,a=[],l=[];!this.tokenizer.endOfFile();){if("("===(t=(e=this.tokenizer.nextToken())[0])||"["===t?l.push("("===t?")":"]"):"{"===t&&0<l.length?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(0<a.length){for(n=a[r=a.length-1];n&&"space"===n[0];)n=a[--r];n&&(i.source.end=this.getPosition(n[3]||n[2]),i.source.end.offset++)}this.end(e);break}}if(a.push(e),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)}},{key:"checkMissedSemicolon",value:function(e){var t=this.colon(e);if(!1!==t){for(var n,r=0,i=t-1;0<=i&&("space"===(n=e[i])[0]||2!==(r+=1));i--);throw this.input.error("Missed semicolon","word"===n[0]?n[3]+1:n[2])}}},{key:"colon",value:function(e){var t,n,r,i,o=0,s=Me(e.entries());try{for(s.s();!(i=s.n()).done;){var a=Pe(i.value,2),l=a[0];if("("===(n=(t=a[1])[0])&&(o+=1),")"===n&&--o,0===o&&":"===n){if(r){if("word"===r[0]&&"progid"===r[1])continue;return l}this.doubleColon(t)}r=t}}catch(e){s.e(e)}finally{s.f()}return!1}},{key:"comment",value:function(e){var t=new n,e=(this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,e[1].slice(2,-2));/^\s*$/.test(e)?(t.text="",t.raws.left=e,t.raws.right=""):(e=e.match(/^(\s*)([^]*\S)(\s*)$/),t.text=e[2],t.raws.left=e[1],t.raws.right=e[3])}},{key:"createTokenizer",value:function(){this.tokenizer=e(this.input)}},{key:"decl",value:function(e,t){var n=new p;this.init(n,e[0][2]);var r,i=e[e.length-1];for(";"===i[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(i[3]||i[2]||(e=>{for(var t=e.length-1;0<=t;t--){var n=e[t],n=n[3]||n[2];if(n)return n}})(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){var o=e[0][0];if(":"===o||"space"===o||"comment"===o)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(":"===(r=e.shift())[0]){n.raws.between+=r[1];break}"word"===r[0]&&/\w/.test(r[1])&&this.unknownWord([r]),n.raws.between+=r[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));for(var s,a=[];e.length&&("space"===(s=e[0][0])||"comment"===s);)a.push(e.shift());this.precheckMissedSemicolon(e);for(var l=e.length-1;0<=l;l--){if("!important"===(r=e[l])[1].toLowerCase()){n.important=!0;var u=this.stringFrom(e,l);" !important"!==(u=this.spacesFromEnd(e)+u)&&(n.raws.important=u);break}if("important"===r[1].toLowerCase()){for(var c=e.slice(0),d="",f=l;0<f;f--){var h=c[f][0];if(0===d.trim().indexOf("!")&&"space"!==h)break;d=c.pop()[1]+d}0===d.trim().indexOf("!")&&(n.important=!0,n.raws.important=d,e=c)}if("space"!==r[0]&&"comment"!==r[0])break}e.some(function(e){return"space"!==e[0]&&"comment"!==e[0]})&&(n.raws.between+=a.map(function(e){return e[1]}).join(""),a=[]),this.raw(n,"value",a.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}},{key:"doubleColon",value:function(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}},{key:"emptyRule",value:function(e){var t=new i;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}},{key:"end",value:function(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)}},{key:"endFile",value:function(){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())}},{key:"freeSemicolon",value:function(e){this.spaces+=e[1],this.current.nodes&&(e=this.current.nodes[this.current.nodes.length-1])&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}},{key:"getPosition",value:function(e){var t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}},{key:"init",value:function(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)}},{key:"other",value:function(e){for(var t,n=!1,r=!1,i=null,o=[],s=e[1].startsWith("--"),a=[],l=e;l;){if(t=l[0],a.push(l),"("===t||"["===t)i=i||l,o.push("("===t?")":"]");else if(s&&r&&"{"===t)i=i||l,o.push("}");else if(0===o.length){if(";"===t){if(r)return void this.decl(a,s);break}if("{"===t)return void this.rule(a);if("}"===t){this.tokenizer.back(a.pop()),n=!0;break}":"===t&&(r=!0)}else t===o[o.length-1]&&(o.pop(),0===o.length)&&(i=null);l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(n=!0),0<o.length&&this.unclosedBracket(i),n&&r){if(!s)for(;a.length&&("space"===(l=a[a.length-1][0])||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,s)}else this.unknownWord(a)}},{key:"parse",value:function(){for(var e;!this.tokenizer.endOfFile();)switch((e=this.tokenizer.nextToken())[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()}},{key:"precheckMissedSemicolon",value:function(){}},{key:"raw",value:function(e,t,n,r){for(var i,o,s,a,l=n.length,u="",c=!0,d=0;d<l;d+=1)"space"===(s=(i=n[d])[0])&&d===l-1&&!r||"comment"===s&&(s=n[d-1]?n[d-1][0]:"empty",o=n[d+1]?n[d+1][0]:"empty",f[s]||f[o]||","===u.slice(-1))?c=!1:u+=i[1];c||(a=n.reduce(function(e,t){return e+t[1]},""),e.raws[t]={raw:a,value:u}),e[t]=u}},{key:"rule",value:function(e){e.pop();var t=new i;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}},{key:"spacesAndCommentsFromEnd",value:function(e){for(var t,n="";e.length&&("space"===(t=e[e.length-1][0])||"comment"===t);)n=e.pop()[1]+n;return n}},{key:"spacesAndCommentsFromStart",value:function(e){for(var t,n="";e.length&&("space"===(t=e[0][0])||"comment"===t);)n+=e.shift()[1];return n}},{key:"spacesFromEnd",value:function(e){for(var t="";e.length&&"space"===e[e.length-1][0];)t=e.pop()[1]+t;return t}},{key:"stringFrom",value:function(e,t){for(var n="",r=t;r<e.length;r++)n+=e[r][1];return e.splice(t,e.length-t),n}},{key:"unclosedBlock",value:function(){var e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}},{key:"unclosedBracket",value:function(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}},{key:"unexpectedClose",value:function(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}},{key:"unknownWord",value:function(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}},{key:"unnamedAtrule",value:function(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}}])})(),i=Fu(),$l=t,e.registerParse(t.default=t)),$l;function t(e,t){var n=new i(e,t),n=new r(n);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}}function $u(){var d,a,n,r,l,e,i,u,c,t,o,f,h,p,s,m;return Ql||(Ql=1,e=Mu(),d=e.isClean,a=e.my,n=Uu(),r=Pu(),l=Bu(),e=ju(),i=Wu(),u=qu(),c=Ku(),t=Gu(),o={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},f={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},h={Once:!0,postcssPlugin:!0,prepare:!0},p={},(s=k(function e(t,n,r){var i,o=this;if(b(this,e),this.stringified=!1,this.processed=!1,"object"!==_(n)||null===n||"root"!==n.type&&"document"!==n.type)if(n instanceof e||n instanceof u)i=w(n.root),n.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{var s=c;r.syntax&&(s=r.syntax.parse),(s=r.parser?r.parser:s).parse&&(s=s.parse);try{i=s(n,r)}catch(e){this.processed=!0,this.error=e}i&&!i[a]&&l.rebuild(i)}else i=w(n);this.result=new u(t,i,r),this.helpers=Ae(Ae({},p),{},{postcss:p,result:this.result}),this.plugins=this.processor.plugins.map(function(e){return"object"===_(e)&&e.prepare?Ae(Ae({},e),e.prepare(o.result)):e})},[{key:"async",value:function(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}},{key:"catch",value:function(e){return this.async().catch(e)}},{key:"finally",value:function(e){return this.async().then(e,e)}},{key:"getAsyncError",value:function(){throw new Error("Use process(css).then(cb) to work with async plugins")}},{key:"handleError",value:function(e,t){var n,r,i,o,s,a=this.result.lastPlugin;try{t&&t.addToError(e),"CssSyntaxError"!==(this.error=e).name||e.plugin?a.postcssVersion&&"production"!==process.env.NODE_ENV&&(n=a.postcssPlugin,r=a.postcssVersion,i=this.result.processor.version,o=r.split("."),s=i.split("."),o[0]!==s[0]||parseInt(o[1])>parseInt(s[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+i+", but "+n+" uses "+r+". Perhaps this is the source of the error below."):(e.plugin=a.postcssPlugin,e.setMessage())}catch(e){console&&console.error&&console.error(e)}return e}},{key:"prepareVisitors",value:function(){var r=this;this.listeners={};function e(e,t,n){r.listeners[t]||(r.listeners[t]=[]),r.listeners[t].push([e,n])}var t,n=Me(this.plugins);try{for(n.s();!(t=n.n()).done;){var i=t.value;if("object"===_(i))for(var o in i){if(!f[o]&&/^[A-Z]/.test(o))throw new Error("Unknown event ".concat(o," in ").concat(i.postcssPlugin,". Try to update PostCSS (").concat(this.processor.version," now)."));if(!h[o])if("object"===_(i[o]))for(var s in i[o])e(i,"*"===s?o:o+"-"+s.toLowerCase(),i[o][s]);else"function"==typeof i[o]&&e(i,o,i[o])}}}catch(r){n.e(r)}finally{n.f()}this.hasListener=0<Object.keys(this.listeners).length}},{key:"runAsync",value:(m=zi(Ki().m(function e(){var t,i,n,r,o,s,a,l,u,c=this;return Ki().w(function(e){for(;;)switch(e.p=e.n){case 0:this.plugin=0,t=0;case 1:if(t<this.plugins.length){if(a=this.plugins[t],v(a=this.runOnRoot(a)))return e.p=2,e.n=3,a;e.n=5}else e.n=6;break;case 3:e.n=5;break;case 4:throw e.p=4,a=e.v,this.handleError(a);case 5:t++,e.n=1;break;case 6:if(this.prepareVisitors(),!this.hasListener){e.n=21;break}i=this.result.root;case 7:if(i[d]){e.n=14;break}i[d]=!0,n=[y(i)];case 8:if(0<n.length){if(v(l=this.visitTick(n)))return e.p=9,e.n=10,l;e.n=12}else e.n=13;break;case 10:e.n=12;break;case 11:throw e.p=11,l=e.v,u=n[n.length-1].node,this.handleError(l,u);case 12:e.n=8;break;case 13:e.n=7;break;case 14:if(!this.listeners.OnceExit){e.n=21;break}r=Me(this.listeners.OnceExit),e.p=15,s=Ki().m(function e(){var t,n,r;return Ki().w(function(e){for(;;)switch(e.p=e.n){case 0:if(n=Pe(o.value,2),r=n[0],t=n[1],c.result.lastPlugin=r,e.p=1,"document"===i.type)return n=i.nodes.map(function(e){return t(e,c.helpers)}),e.n=2,Promise.all(n);e.n=3;break;case 2:e.n=4;break;case 3:return e.n=4,t(i,c.helpers);case 4:e.n=6;break;case 5:throw e.p=5,r=e.v,c.handleError(r);case 6:return e.a(2)}},e,null,[[1,5]])}),r.s();case 16:if((o=r.n()).done){e.n=18;break}return e.d(Xi(s()),17);case 17:e.n=16;break;case 18:e.n=20;break;case 19:e.p=19,u=e.v,r.e(u);case 20:return e.p=20,r.f(),e.f(20);case 21:return this.processed=!0,e.a(2,this.stringify())}},e,this,[[15,19,20,21],[9,11],[2,4]])})),function(){return m.apply(this,arguments)})},{key:"runOnRoot",value:function(t){var e,n=this;this.result.lastPlugin=t;try{return"object"===_(t)&&t.Once?"document"===this.result.root.type?v((e=this.result.root.nodes.map(function(e){return t.Once(e,n.helpers)}))[0])?Promise.all(e):e:t.Once(this.result.root,this.helpers):"function"==typeof t?t(this.result.root,this.result):void 0}catch(t){throw this.handleError(t)}}},{key:"stringify",value:function(){if(this.error)throw this.error;var e,t;return this.stringified||(this.stringified=!0,this.sync(),t=this.result.opts,e=r,t.syntax&&(e=t.syntax.stringify),(e=t.stringifier?t.stringifier:e).stringify&&(e=e.stringify),t=new n(e,this.result.root,this.result.opts).generate(),this.result.css=t[0],this.result.map=t[1]),this.result}},{key:"sync",value:function(){if(this.error)throw this.error;if(!this.processed){if(this.processed=!0,this.processing)throw this.getAsyncError();var e,t=Me(this.plugins);try{for(t.s();!(e=t.n()).done;){var n=e.value;if(v(this.runOnRoot(n)))throw this.getAsyncError()}}catch(e){t.e(e)}finally{t.f()}if(this.prepareVisitors(),this.hasListener){for(var r=this.result.root;!r[d];)r[d]=!0,this.walkSync(r);if(this.listeners.OnceExit)if("document"===r.type){var i,o=Me(r.nodes);try{for(o.s();!(i=o.n()).done;){var s=i.value;this.visitSync(this.listeners.OnceExit,s)}}catch(e){o.e(e)}finally{o.f()}}else this.visitSync(this.listeners.OnceExit,r)}}return this.result}},{key:"then",value:function(e,t){return"production"===process.env.NODE_ENV||"from"in this.opts||i("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)}},{key:"toString",value:function(){return this.css}},{key:"visitSync",value:function(e,t){var n,r=Me(e);try{for(r.s();!(n=r.n()).done;){var i=Pe(n.value,2),o=i[0],s=i[1],a=(this.result.lastPlugin=o,void 0);try{a=s(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(v(a))throw this.getAsyncError()}}catch(e){r.e(e)}finally{r.f()}}},{key:"visitTick",value:function(e){var t=e[e.length-1],n=t.node,r=t.visitors;if("root"===n.type||"document"===n.type||n.parent){if(0<r.length&&t.visitorIndex<r.length){var i=Pe(r[t.visitorIndex],2),o=i[0],i=i[1];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=o;try{return i(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==t.iterator){for(var s,a=t.iterator;s=n.nodes[n.indexes[a]];)if(n.indexes[a]+=1,!s[d])return s[d]=!0,void e.push(y(s));t.iterator=0,delete n.indexes[a]}for(var l=t.events;t.eventIndex<l.length;){var u=l[t.eventIndex];if(t.eventIndex+=1,0===u)return void(n.nodes&&n.nodes.length&&(n[d]=!0,t.iterator=n.getIterator()));if(this.listeners[u])return void(t.visitors=this.listeners[u])}}e.pop()}},{key:"walkSync",value:function(e){var t=this;e[d]=!0;var n,r=Me(g(e));try{for(r.s();!(n=r.n()).done;){var i=n.value;if(0===i)e.nodes&&e.each(function(e){e[d]||t.walkSync(e)});else{var o=this.listeners[i];if(o&&this.visitSync(o,e.toProxy()))return}}}catch(e){r.e(e)}finally{r.f()}}},{key:"warnings",value:function(){return this.sync().warnings()}},{key:"content",get:function(){return this.stringify().content}},{key:"css",get:function(){return this.stringify().css}},{key:"map",get:function(){return this.stringify().map}},{key:"messages",get:function(){return this.sync().messages}},{key:"opts",get:function(){return this.result.opts}},{key:"processor",get:function(){return this.result.processor}},{key:"root",get:function(){return this.sync().root}},{key:Symbol.toStringTag,get:function(){return"LazyResult"}}])).registerPostcss=function(e){p=e},Yl=s,t.registerLazyResult(s.default=s),e.registerLazyResult(s)),Yl;function v(e){return"object"===_(e)&&"function"==typeof e.then}function g(e){var t=!1,n=o[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,0,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,0,n+"Exit"]:[n,n+"Exit"]}function y(e){return{eventIndex:0,events:"document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:g(e),iterator:0,node:e,visitorIndex:0,visitors:[]}}function w(e){return e[d]=!1,e.nodes&&e.nodes.forEach(w),e}}function Xu(e,t){if(Array.isArray(e))return e.map(function(e){return Xu(e)});var n,r=e.inputs,i=Ji(e,ao);if(r){t=[];var o,s=Me(r);try{for(s.s();!(o=s.n()).done;){var a=Ae(Ae({},o.value),{},{__proto__:gu.prototype});a.map&&(a.map=Ae(Ae({},a.map),{},{__proto__:pu.prototype})),t.push(a)}}catch(e){s.e(e)}finally{s.f()}}if(i.nodes&&(i.nodes=e.nodes.map(function(e){return Xu(e,t)})),i.source&&(n=(r=i.source).inputId,r=Ji(r,lo),i.source=r,null!=n)&&(i.source.input=t[n]),"root"===i.type)return new yu(i);if("decl"===i.type)return new hu(i);if("rule"===i.type)return new wu(i);if("comment"===i.type)return new mu(i);if("atrule"===i.type)return new vu(i);throw new Error("Unknown node type: "+e.type)}function s(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 1===t.length&&Array.isArray(t[0])&&(t=t[0]),new su(t)}Nh||(Nh=1,iu=ll(),ou=Lu(),lm=$u(),a=Bu(),im||(im=1,m||(m=1,Eu=Uu(),Cu=Pu(),Ru=Wu(),Tu=Ku(),Ou=qu(),xu=k(function e(t,n,r){b(this,e),n=n.toString(),this.stringified=!1,this._processor=t,this._css=n,this._opts=r,this._map=void 0;var t=Cu,i=(this.result=new Ou(this._processor,void 0,this._opts),this.result.css=n,this),r=(Object.defineProperty(this.result,"root",{get:function(){return i.root}}),new Eu(t,void 0,this._opts,n));r.isMap()?(n=(t=Pe(r.generate(),2))[0],t=t[1],n&&(this.result.css=n),t&&(this.result.map=t)):(r.clearAnnotation(),this.result.css=r.css)},[{key:"async",value:function(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}},{key:"catch",value:function(e){return this.async().catch(e)}},{key:"finally",value:function(e){return this.async().then(e,e)}},{key:"sync",value:function(){if(this.error)throw this.error;return this.result}},{key:"then",value:function(e,t){return"production"===process.env.NODE_ENV||"from"in this._opts||Ru("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)}},{key:"toString",value:function(){return this._css}},{key:"warnings",value:function(){return[]}},{key:"content",get:function(){return this.result.css}},{key:"css",get:function(){return this.result.css}},{key:"map",get:function(){return this.result.map}},{key:"messages",get:function(){return[]}},{key:"opts",get:function(){return this.result.opts}},{key:"processor",get:function(){return this.result.processor}},{key:"root",get:function(){if(this._root)return this._root;var e,t=Tu;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e}},{key:Symbol.toStringTag,get:function(){return"NoWorkResult"}}]),(eu=xu).default=xu),bu=eu,ku=$u(),xu=ju(),_u=Gu(),Su=k(function e(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[];b(this,e),this.version="8.4.38",this.plugins=this.normalize(t)},[{key:"normalize",value:function(e){var t,n=[],r=Me(e);try{for(r.s();!(t=r.n()).done;){var i=t.value;if(!0===i.postcss?i=i():i.postcss&&(i=i.postcss),"object"===_(i)&&Array.isArray(i.plugins))n=n.concat(i.plugins);else if("object"===_(i)&&i.postcssPlugin)n.push(i);else if("function"==typeof i)n.push(i);else{if("object"!==_(i)||!i.parse&&!i.stringify)throw new Error(i+" 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.")}}}catch(e){r.e(e)}finally{r.f()}return n}},{key:"process",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return new(this.plugins.length||t.parser||t.stringifier||t.syntax?ku:bu)(this,e,t)}},{key:"use",value:function(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}]),(tu=Su).default=Su,_u.registerProcessor(Su),xu.registerProcessor(Su)),su=tu,_u=Pu(),Pf||(Pf=1,hu=Lu(),pu=Nu(),mu=zu(),vu=Vu(),gu=Fu(),yu=Gu(),wu=Ju(),(nu=Xu).default=Xu),Su=nu,au=ju(),f=Hu(),lu=zu(),uu=Vu(),cu=qu(),tm=Fu(),i=Ku(),Nh=Zu(),du=Ju(),fu=Gu(),im=Du(),s.plugin=function(t,n){var e,r=!1;function i(){console&&console.warn&&!r&&(r=!0,console.warn(t+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG)&&process.env.LANG.startsWith("cn")&&console.warn(t+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226");var e=n.apply(void 0,arguments);return e.postcssPlugin=t,e.postcssVersion=(new su).version,e}return Object.defineProperty(i,"postcss",{get:function(){return e=e||i()}}),i.process=function(e,t,n){return s([i(n)]).process(e,t)},i},s.stringify=_u,s.parse=i,s.fromJSON=Su,s.list=Nh,s.comment=function(e){return new lu(e)},s.atRule=function(e){return new uu(e)},s.decl=function(e){return new ou(e)},s.rule=function(e){return new du(e)},s.root=function(e){return new fu(e)},s.document=function(e){return new au(e)},s.CssSyntaxError=iu,s.Declaration=ou,s.Container=a,s.Processor=su,s.Document=au,s.Comment=lu,s.Warning=f,s.AtRule=uu,s.Result=cu,s.Input=tm,s.Rule=du,s.Root=fu,s.Node=im,lm.registerPostcss(s),(ru=s).default=s),(Pf=(m=ru)&&m.__esModule&&Object.prototype.hasOwnProperty.call(m,"default")?m.default:m).stringify;var Yu=k(rc,[{key:"childNodes",get:function(){for(var e=[],t=this.firstChild;t;)e.push(t),t=t.nextSibling;return e}},{key:"contains",value:function(e){if(e instanceof rc&&e.ownerDocument===this.ownerDocument){if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}}return!1}},{key:"appendChild",value:function(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}},{key:"insertBefore",value:function(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}},{key:"removeChild",value:function(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}},{key:"toString",value:function(){return"RRNode"}}]),Qu={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ec={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},tc={},nc={};function rc(){b(this,rc),Qa(this,"parentElement",null),Qa(this,"parentNode",null),Qa(this,"ownerDocument"),Qa(this,"firstChild",null),Qa(this,"lastChild",null),Qa(this,"previousSibling",null),Qa(this,"nextSibling",null),Qa(this,"ELEMENT_NODE",1),Qa(this,"TEXT_NODE",3),Qa(this,"nodeType"),Qa(this,"nodeName"),Qa(this,"RRNodeType")}function ic(e){if(tc[e])return tc[e];var t=globalThis[e],n=t.prototype,r=e in Qu?Qu[e]:void 0,r=Boolean(r&&r.every(function(e){return Boolean(null==(e=null==(e=Object.getOwnPropertyDescriptor(n,e))?void 0:e.get)?void 0:e.toString().includes("[native code]"))})),i=e in ec?ec[e]:void 0,i=Boolean(i&&i.every(function(e){return"function"==typeof n[e]&&(null==(e=n[e])?void 0:e.toString().includes("[native code]"))}));if(r&&i&&!globalThis.Zone)return tc[e]=t.prototype,t.prototype;try{var o,s,a=document.createElement("iframe"),l=(a.style.display="none",document.body.appendChild(a),a.contentWindow);return l?(o=l[e].prototype)?((s=navigator.userAgent).includes("Safari")&&!s.includes("Chrome")?(a.classList.add("rr-block"),a.setAttribute("__rrwebUntaintedMutationObserver",""),nc[e]=function(){return a.remove()}):a.remove(),tc[e]=o):(a.remove(),n):t.prototype}catch(e){return n}}var oc={};function sc(e,t,n){var r="".concat(e,".").concat(String(n));return oc[r]?oc[r].call(t):(e=ic(e),(e=null==(e=Object.getOwnPropertyDescriptor(e,n))?void 0:e.get)?(oc[r]=e).call(t):t[n])}var ac={};function lc(e,t,n){var r="".concat(e,".").concat(String(n));return ac[r]?ac[r].bind(t):"function"!=typeof(e=ic(e)[n])?t[n]:(ac[r]=e).bind(t)}var uc=Date.now;function cc(e,t,n){try{var r,i;return t in e?("function"==typeof(i=n(r=e[t]))&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,function(){e[t]=r}):function(){}}catch(e){return function(){}}}function dc(e){return sc("Node",e,"childNodes")}function fc(e){return sc("Node",e,"parentNode")}function hc(e){return sc("Node",e,"textContent")}/[1-9][0-9]{12}/.test(Date.now().toString())||(uc=function(){return(new Date).getTime()});var pc=function(e){return sc("Node",e,"ownerDocument")},mc=function(e){return sc("Node",e,"parentElement")},vc=function(e,t){return lc("Node",e,"contains")(t)},gc=function(e){return lc("Node",e,"getRootNode")()},yc=function(e){return e&&"host"in e?sc("ShadowRoot",e,"host"):null},wc=function(e){return e&&"shadowRoot"in e?sc("Element",e,"shadowRoot"):null};function bc(e,t,n){var r=2<arguments.length&&void 0!==n?n:document,i={capture:!0,passive:!0};return r.addEventListener(e,t,i),function(){return r.removeEventListener(e,t,i)}}var kc="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.",i={map:{},getId:function(){return console.error(kc),-1},getNode:function(){return console.error(kc),null},removeNodeFromMap:function(){console.error(kc)},has:function(){return console.error(kc),!1},reset:function(){console.error(kc)}};function _c(s,a,e){var l=2<arguments.length&&void 0!==e?e:{},u=null,c=0;return function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=Date.now(),i=(c||!1!==l.leading||(c=r),a-(r-c)),o=this;i<=0||a<i?(u&&(clearTimeout(u),u=null),c=r,s.apply(o,t)):u||!1===l.trailing||(u=setTimeout(function(){c=!1===l.leading?0:Date.now(),u=null,s.apply(o,t)},i))}}function Sc(e,t,n,r,i){var i=4<arguments.length&&void 0!==i?i:window,o=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set:function(e){var t=this;setTimeout(function(){n.set.call(t,e)},0),o&&o.set&&o.set.call(this,e)}}),function(){return Sc(e,t,o||{},!0)}}function Ec(e){var t,n=e.document;return{left:n.scrollingElement?n.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:n.documentElement.scrollLeft||(null==n?void 0:n.body)&&(null==(t=mc(n.body))?void 0:t.scrollLeft)||(null==(t=null==n?void 0:n.body)?void 0:t.scrollLeft)||0,top:n.scrollingElement?n.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==n?void 0:n.documentElement.scrollTop)||(null==n?void 0:n.body)&&(null==(t=mc(n.body))?void 0:t.scrollTop)||(null==(e=null==n?void 0:n.body)?void 0:e.scrollTop)||0}}function Cc(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Rc(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Tc(e){return e?e.nodeType===e.ELEMENT_NODE?e:mc(e):null}function Oc(e,t,n,r){if(e){var i=Tc(e);if(i){try{if("string"==typeof t){if(i.classList.contains(t))return 1;if(r&&null!==i.closest("."+t))return 1}else if(Qo(i,t,r))return 1}catch(e){}if(n){if(i.matches(n))return 1;if(r&&null!==i.closest(n))return 1}}}}function xc(e,t,n){return"TITLE"===e.tagName&&n.headTitleMutations||-2===t.getId(e)}function Ic(e){return Boolean(e.changedTouches)}function Mc(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Ac(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Pc(e){return e&&(e instanceof Yu&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(wc(e)))}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&new Proxy(i,{get:function(e,t,n){return"map"===t&&console.error(kc),Reflect.get(e,t,n)}});var Dc=k(function e(){b(this,e),c(this,"id",1),c(this,"styleIDMap",new WeakMap),c(this,"idStyleMap",new Map)},[{key:"getId",value:function(e){return null!=(e=this.styleIDMap.get(e))?e:-1}},{key:"has",value:function(e){return this.styleIDMap.has(e)}},{key:"add",value:function(e,t){return this.has(e)?this.getId(e):(t=void 0===t?this.id++:t,this.styleIDMap.set(e,t),this.idStyleMap.set(t,e),t)}},{key:"getStyle",value:function(e){return this.idStyleMap.get(e)||null}},{key:"reset",value:function(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}},{key:"generateId",value:function(){return this.id++}}]);function Lc(e){var t,n=null;return n="getRootNode"in e&&(null==(t=gc(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&yc(gc(e))?yc(gc(e)):n}function Nc(e){var t=pc(e);return t&&(vc(t,e)||(n=>{var e,t=pc(n);if(t)return e=(()=>{for(var e,t=n;e=Lc(t);)t=e;return t})(),vc(t,e)})(e))}var Y=Nh={DomContentLoaded:0,0:"DomContentLoaded",Load:1,1:"Load",FullSnapshot:2,2:"FullSnapshot",IncrementalSnapshot:3,3:"IncrementalSnapshot",Meta:4,4:"Meta",Custom:5,5:"Custom",Plugin:6,6:"Plugin",Asset:7,7:"Asset"},De=((a=De||{})[a.Mutation=0]="Mutation",a[a.MouseMove=1]="MouseMove",a[a.MouseInteraction=2]="MouseInteraction",a[a.Scroll=3]="Scroll",a[a.ViewportResize=4]="ViewportResize",a[a.Input=5]="Input",a[a.TouchMove=6]="TouchMove",a[a.MediaInteraction=7]="MediaInteraction",a[a.StyleSheetRule=8]="StyleSheetRule",a[a.CanvasMutation=9]="CanvasMutation",a[a.Font=10]="Font",a[a.Log=11]="Log",a[a.Drag=12]="Drag",a[a.StyleDeclaration=13]="StyleDeclaration",a[a.Selection=14]="Selection",a[a.AdoptedStyleSheet=15]="AdoptedStyleSheet",a[a.CustomElement=16]="CustomElement",a),Fc=((f=Fc||{})[f.MouseUp=0]="MouseUp",f[f.MouseDown=1]="MouseDown",f[f.Click=2]="Click",f[f.ContextMenu=3]="ContextMenu",f[f.DblClick=4]="DblClick",f[f.Focus=5]="Focus",f[f.Blur=6]="Blur",f[f.TouchStart=7]="TouchStart",f[f.TouchMove_Departed=8]="TouchMove_Departed",f[f.TouchEnd=9]="TouchEnd",f[f.TouchCancel=10]="TouchCancel",f),Uc=((tm=Uc||{})[tm.Mouse=0]="Mouse",tm[tm.Pen=1]="Pen",tm[tm.Touch=2]="Touch",tm),zc=((im={})[im["2D"]=0]="2D",im[im.WebGL=1]="WebGL",im[im.WebGL2=2]="WebGL2",im),Bc=((lm=Bc||{})[lm.Play=0]="Play",lm[lm.Pause=1]="Pause",lm[lm.Seeked=2]="Seeked",lm[lm.VolumeChange=3]="VolumeChange",lm[lm.RateChange=4]="RateChange",lm),jc=((m={})[m.Document=0]="Document",m[m.DocumentType=1]="DocumentType",m[m.Element=2]="Element",m[m.Text=3]="Text",m[m.CDATA=4]="CDATA",m[m.Comment=5]="Comment",m);function Wc(e){return"__ln"in e}function Hc(e,t){return"".concat(e,"@").concat(t)}var qc,Vc=k(function e(){b(this,e),c(this,"length",0),c(this,"head",null),c(this,"tail",null)},[{key:"get",value:function(e){if(e>=this.length)throw new Error("Position outside of list range");for(var t=this.head,n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t}},{key:"addNode",value:function(e){var t,n={value:e,previous:null,next:null};e.__ln=n,e.previousSibling&&Wc(e.previousSibling)?(t=e.previousSibling.__ln.next,n.next=t,n.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=n,t&&(t.previous=n)):e.nextSibling&&Wc(e.nextSibling)&&e.nextSibling.__ln.previous?(t=e.nextSibling.__ln.previous,n.previous=t,n.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=n,t&&(t.next=n)):(this.head&&(this.head.previous=n),n.next=this.head,this.head=n),null===n.next&&(this.tail=n),this.length++}},{key:"removeNode",value:function(e){var 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--)}}]),Gc=k(function e(){var w=this;b(this,e),c(this,"frozen",!1),c(this,"locked",!1),c(this,"texts",[]),c(this,"attributes",[]),c(this,"attributeMap",new WeakMap),c(this,"removes",[]),c(this,"mapRemoves",[]),c(this,"movedMap",{}),c(this,"addedSet",new Set),c(this,"movedSet",new Set),c(this,"droppedSet",new Set),c(this,"removesSubTreeCache",new Set),c(this,"mutationCb"),c(this,"blockClass"),c(this,"blockSelector"),c(this,"maskTextClass"),c(this,"maskTextSelector"),c(this,"inlineStylesheet"),c(this,"maskInputOptions"),c(this,"maskTextFn"),c(this,"maskInputFn"),c(this,"keepIframeSrcFn"),c(this,"recordCanvas"),c(this,"inlineImages"),c(this,"slimDOMOptions"),c(this,"dataURLOptions"),c(this,"doc"),c(this,"mirror"),c(this,"iframeManager"),c(this,"stylesheetManager"),c(this,"shadowDomManager"),c(this,"canvasManager"),c(this,"processedNodeManager"),c(this,"unattachedDoc"),c(this,"processMutations",function(e){e.forEach(w.processMutation),w.emit()}),c(this,"emit",function(){if(!w.frozen&&!w.locked){for(var i=[],o=new Set,s=new Vc,a=function(e){for(var t=e,n=-2;-2===n;)n=(t=t&&t.nextSibling)&&w.mirror.getId(t);return n},e=function(t){var e=fc(t);if(e&&Nc(t)){var n=!1;if(t.nodeType===Node.TEXT_NODE){var r=e.tagName;if("TEXTAREA"===r)return;"STYLE"===r&&w.addedSet.has(e)&&(n=!0)}r=Ro(e)?w.mirror.getId(Lc(t)):w.mirror.getId(e),e=a(t);if(-1===r||-1===e)return s.addNode(t);n=ns(t,{doc:w.doc,mirror:w.mirror,blockClass:w.blockClass,blockSelector:w.blockSelector,maskTextClass:w.maskTextClass,maskTextSelector:w.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:w.inlineStylesheet,maskInputOptions:w.maskInputOptions,maskTextFn:w.maskTextFn,maskInputFn:w.maskInputFn,slimDOMOptions:w.slimDOMOptions,dataURLOptions:w.dataURLOptions,recordCanvas:w.recordCanvas,inlineImages:w.inlineImages,onSerialize:function(e){Mc(e,w.mirror)&&w.iframeManager.addIframe(e),Ac(e,w.mirror)&&w.stylesheetManager.trackLinkElement(e),Pc(t)&&w.shadowDomManager.addShadowRoot(wc(t),w.doc)},onIframeLoad:function(e,t){w.iframeManager.attachIframe(e,t),w.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:function(e,t){w.stylesheetManager.attachLinkElement(e,t)},cssCaptured:n});n&&(i.push({parentId:r,nextId:e,node:n}),o.add(n.id))}};w.mapRemoves.length;)w.mirror.removeNodeFromMap(w.mapRemoves.shift());var t,n=Me(w.movedSet);try{for(n.s();!(t=n.n()).done;){var r=t.value;Jc(w.removesSubTreeCache,r,w.mirror)&&!w.movedSet.has(fc(r))||e(r)}}catch(i){n.e(i)}finally{n.f()}var l,u=Me(w.addedSet);try{for(u.s();!(l=u.n()).done;){var c=l.value;!Kc(w.droppedSet,c)&&!Jc(w.removesSubTreeCache,c,w.mirror)||Kc(w.movedSet,c)?e(c):w.droppedSet.add(c)}}catch(i){u.e(i)}finally{u.f()}for(var d=null;s.length;){var f,h,p=null;if(!(p=d&&(f=w.mirror.getId(fc(d.value)),h=a(d.value),-1!==f)&&-1!==h?d:p))for(var m=s.tail;m;){var v=m,m=m.previous;if(v){var g=w.mirror.getId(fc(v.value));if(-1!==a(v.value)){if(-1!==g){p=v;break}g=v.value,g=fc(g);if(g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE){g=yc(g);if(-1!==w.mirror.getId(g)){p=v;break}}}}}if(!p){for(;s.head;)s.removeNode(s.head.value);break}d=p.previous,s.removeNode(p.value),e(p.value)}var y={texts:w.texts.map(function(e){var t=e.node,n=fc(t);return n&&"TEXTAREA"===n.tagName&&w.genTextAreaValueMutation(n),{id:w.mirror.getId(t),value:e.value}}).filter(function(e){return!o.has(e.id)}).filter(function(e){return w.mirror.has(e.id)}),attributes:w.attributes.map(function(e){var t,n,r=e.attributes;return"string"==typeof r.style&&(t=JSON.stringify(e.styleDiff),n=JSON.stringify(e._unchangedStyles),t.length<r.style.length)&&(t+n).split("var(").length===r.style.split("var(").length&&(r.style=e.styleDiff),{id:w.mirror.getId(e.node),attributes:r}}).filter(function(e){return!o.has(e.id)}).filter(function(e){return w.mirror.has(e.id)}),removes:w.removes,adds:i};(y.texts.length||y.attributes.length||y.removes.length||y.adds.length)&&(w.texts=[],w.attributes=[],w.attributeMap=new WeakMap,w.removes=[],w.addedSet=new Set,w.movedSet=new Set,w.droppedSet=new Set,w.removesSubTreeCache=new Set,w.movedMap={},w.mutationCb(y))}}),c(this,"genTextAreaValueMutation",function(e){var t=w.attributeMap.get(e),n=(t||(w.attributes.push(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}}),w.attributeMap.set(e,t)),Array.from(dc(e),function(e){return hc(e)||""}).join(""));t.attributes.value=Mo({element:e,maskInputOptions:w.maskInputOptions,tagName:e.tagName,type:Po(e),value:n,maskInputFn:w.maskInputFn})}),c(this,"processMutation",function(s){if(!xc(s.target,w.mirror,w.slimDOMOptions))switch(s.type){case"characterData":var e=hc(s.target);Oc(s.target,w.blockClass,w.blockSelector,!1)||e===s.oldValue||w.texts.push({value:es(s.target,w.maskTextClass,w.maskTextSelector,!0)&&e?w.maskTextFn?w.maskTextFn(e,Tc(s.target)):e.replace(/[\S]/g,"*"):e,node:s.target});break;case"attributes":var t,n=s.target,e=s.attributeName,r=s.target.getAttribute(e);if("value"===e&&(t=Po(n),r=Mo({element:n,maskInputOptions:w.maskInputOptions,tagName:n.tagName,type:t,value:r,maskInputFn:w.maskInputFn})),!Oc(s.target,w.blockClass,w.blockSelector,!1)&&r!==s.oldValue){var i=w.attributeMap.get(s.target);if("IFRAME"===n.tagName&&"src"===e&&!w.keepIframeSrcFn(r)){if(n.contentDocument)return;e="rr_src"}if(i||(i={node:s.target,attributes:{},styleDiff:{},_unchangedStyles:{}},w.attributes.push(i),w.attributeMap.set(s.target,i)),"type"===e&&"INPUT"===n.tagName&&"password"===(s.oldValue||"").toLowerCase()&&n.setAttribute("data-rr-is-password","true"),!Yo(n.tagName,e))if(i.attributes[e]=Xo(w.doc,Ao(n.tagName),Ao(e),r),"style"===e){if(!w.unattachedDoc)try{w.unattachedDoc=document.implementation.createHTMLDocument()}catch(s){w.unattachedDoc=w.doc}var o=w.unattachedDoc.createElement("span");s.oldValue&&o.setAttribute("style",s.oldValue);for(var a=0,l=Array.from(n.style);a<l.length;a++){var u=l[a],c=n.style.getPropertyValue(u),d=n.style.getPropertyPriority(u);c!==o.style.getPropertyValue(u)||d!==o.style.getPropertyPriority(u)?i.styleDiff[u]=""===d?c:[c,d]:i._unchangedStyles[u]=[c,d]}for(var f=0,h=Array.from(o.style);f<h.length;f++){var p=h[f];""===n.style.getPropertyValue(p)&&(i.styleDiff[p]=!1)}}else"open"===e&&"DIALOG"===n.tagName&&(n.matches("dialog:modal")?i.attributes.rr_open_mode="modal":i.attributes.rr_open_mode="non-modal")}break;case"childList":return Oc(s.target,w.blockClass,w.blockSelector,!0)?void 0:"TEXTAREA"===s.target.tagName?void w.genTextAreaValueMutation(s.target):(s.addedNodes.forEach(function(e){return w.genAdds(e,s.target)}),void s.removedNodes.forEach(function(e){var t=w.mirror.getId(e),n=Ro(s.target)?w.mirror.getId(yc(s.target)):w.mirror.getId(s.target);if(!Oc(s.target,w.blockClass,w.blockSelector,!1)&&!xc(e,w.mirror,w.slimDOMOptions)&&-1!==w.mirror.getId(e)){if(w.addedSet.has(e))Zc(w.addedSet,e),w.droppedSet.add(e);else if(!(w.addedSet.has(s.target)&&-1===t||function e(t,n){var r;return!Ro(t)&&(r=n.getId(t),!n.has(r)||(!(r=fc(t))||r.nodeType!==t.DOCUMENT_NODE)&&(!r||e(r,n)))}(s.target,w.mirror)))if(w.movedSet.has(e)&&w.movedMap[Hc(t,n)])Zc(w.movedSet,e);else{w.removes.push({parentId:n,id:t,isShadow:!(!Ro(s.target)||!To(s.target))||void 0});for(var r=w.removesSubTreeCache,i=[e];i.length;){var o=i.pop();r.has(o)||(r.add(o),dc(o).forEach(function(e){return i.push(e)}))}}w.mapRemoves.push(e)}}))}}),c(this,"genAdds",function(t,e){if(!w.processedNodeManager.inOtherBuffer(t,w)&&!w.addedSet.has(t)&&!w.movedSet.has(t)){if(w.mirror.hasNode(t)){if(xc(t,w.mirror,w.slimDOMOptions))return;w.movedSet.add(t);var n=null;(n=e&&w.mirror.hasNode(e)?w.mirror.getId(e):n)&&-1!==n&&(w.movedMap[Hc(w.mirror.getId(t),n)]=!0)}else w.addedSet.add(t),w.droppedSet.delete(t);Oc(t,w.blockClass,w.blockSelector,!1)||(dc(t).forEach(function(e){return w.genAdds(e)}),Pc(t)&&dc(wc(t)).forEach(function(e){w.processedNodeManager.add(e,w),w.genAdds(e,t)}))}})},[{key:"init",value:function(t){var n=this;["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(function(e){n[e]=t[e]})}},{key:"freeze",value:function(){this.frozen=!0,this.canvasManager.freeze()}},{key:"unfreeze",value:function(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}},{key:"isFrozen",value:function(){return this.frozen}},{key:"lock",value:function(){this.locked=!0,this.canvasManager.lock()}},{key:"unlock",value:function(){this.locked=!1,this.canvasManager.unlock(),this.emit()}},{key:"reset",value:function(){this.shadowDomManager.reset(),this.canvasManager.reset()}}]);function Zc(t,e){t.delete(e),dc(e).forEach(function(e){return Zc(t,e)})}function Jc(e,t){return 0!==e.size&&(e=e,t=fc(t))&&e.has(t)}function Kc(e,t){return 0!==e.size&&function e(t,n){n=fc(n);return!!n&&(!!t.has(n)||e(t,n))}(e,t)}var Le=function(e){return qc?function(){try{return e.apply(void 0,arguments)}catch(e){if(!qc||!0!==qc(e))throw e}}:e},$c=[];function Xc(e){try{if("composedPath"in e){var t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch(e){}return e&&e.target}function Yc(e,t){var n=new Gc;$c.push(n),n.init(e);var e=Pe([ic("MutationObserver").constructor,null!=(e=nc.MutationObserver)?e:function(){}],2),r=e[0],e=e[1],r=new r(Le(n.processMutations.bind(n)));return r.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),[r,e]}function Qc(e){var t,r,s,a=e.mouseInteractionCb,i=e.doc,l=e.mirror,u=e.blockClass,c=e.blockSelector,e=e.sampling;return!1===e.mouseInteraction?function(){}:(t=!0===e.mouseInteraction||void 0===e.mouseInteraction?{}:e.mouseInteraction,r=[],s=null,Object.keys(Fc).filter(function(e){return Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==t[e]}).forEach(function(e){function t(e){var t=Xc(e);if(!Oc(t,u,c,!0)){var n=null,r=o;if("pointerType"in e){switch(e.pointerType){case"mouse":n=Uc.Mouse;break;case"touch":n=Uc.Touch;break;case"pen":n=Uc.Pen}n===Uc.Touch?Fc[o]===Fc.MouseDown?r="TouchStart":Fc[o]===Fc.MouseUp&&(r="TouchEnd"):Uc.Pen}else Ic(e)&&(n=Uc.Touch);null!==n?(s=n,(r.startsWith("Touch")&&n===Uc.Touch||r.startsWith("Mouse")&&n===Uc.Mouse)&&(n=null)):Fc[o]===Fc.Click&&(n=s,s=null);var i,e=Ic(e)?e.changedTouches[0]:e;e&&(t=l.getId(t),i=e.clientX,e=e.clientY,Le(a)(Ae({type:Fc[r],id:t,x:i,y:e},null!==n&&{pointerType:n})))}}var o,n=Ao(e);o=e;if(window.PointerEvent)switch(Fc[e]){case Fc.MouseDown:case Fc.MouseUp:n=n.replace("mouse","pointer");break;case Fc.TouchStart:case Fc.TouchEnd:return}r.push(bc(n,t,i))}),Le(function(){r.forEach(function(e){return e()})}))}function ed(e){var r=e.scrollCb,i=e.doc,o=e.mirror,s=e.blockClass,a=e.blockSelector,e=e.sampling;return bc("scroll",Le(_c(Le(function(e){var t,n,e=Xc(e);e&&!Oc(e,s,a,!0)&&(t=o.getId(e),e===i&&i.defaultView?(n=Ec(i.defaultView),r({id:t,x:n.left,y:n.top})):r({id:t,x:e.scrollLeft,y:e.scrollTop}))}),e.scroll||100)),i)}var td=["INPUT","TEXTAREA","SELECT"],nd=new WeakMap;function rd(e){return function e(t,n){var r;return ad("CSSGroupingRule")&&t.parentRule instanceof CSSGroupingRule||ad("CSSMediaRule")&&t.parentRule instanceof CSSMediaRule||ad("CSSSupportsRule")&&t.parentRule instanceof CSSSupportsRule||ad("CSSConditionRule")&&t.parentRule instanceof CSSConditionRule?(r=Array.from(t.parentRule.cssRules).indexOf(t),n.unshift(r),e(t.parentRule,n)):(t.parentStyleSheet&&(r=Array.from(t.parentStyleSheet.cssRules).indexOf(t),n.unshift(r)),n)}(e,[])}function id(e,t,n){var r,i;return e?(e.ownerNode?r=t.getId(e.ownerNode):i=n.getId(e),{styleId:i,id:r}):{}}function od(e,t){var n=e.mirror,r=e.stylesheetManager,i="#document"===t.nodeName?n.getId(t):n.getId(yc(t)),n="#document"===t.nodeName?null==(e=t.defaultView)?void 0:e.Document:null==(e=null==(n=t.ownerDocument)?void 0:n.defaultView)?void 0:e.ShadowRoot,o=null!=n&&n.prototype?Object.getOwnPropertyDescriptor(null==n?void 0:n.prototype,"adoptedStyleSheets"):void 0;return null!==i&&-1!==i&&n&&o?(Object.defineProperty(t,"adoptedStyleSheets",{configurable:o.configurable,enumerable:o.enumerable,get:function(){var e;return null==(e=o.get)?void 0:e.call(this)},set:function(e){var t=null==(t=o.set)?void 0:t.call(this,e);if(null!==i&&-1!==i)try{r.adoptStyleSheets(e,i)}catch(e){}return t}}),Le(function(){Object.defineProperty(t,"adoptedStyleSheets",{configurable:o.configurable,enumerable:o.enumerable,get:o.get,set:o.set})})):function(){}}function sd(e){var t,n,L,N,F,U,z,B,j,W,H,q,V,G,r=e.doc.defaultView;if(!r)return function(){};t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=(R=e).mutationCb,L=R.mousemoveCb,N=R.mouseInteractionCb,F=R.scrollCb,U=R.viewportResizeCb,z=R.inputCb,B=R.mediaInteractionCb,j=R.styleSheetRuleCb,W=R.styleDeclarationCb,H=R.canvasMutationCb,q=R.fontCb,V=R.selectionCb,G=R.customElementCb,R.mutationCb=function(){t.mutation&&t.mutation.apply(t,arguments),n.apply(void 0,arguments)},R.mousemoveCb=function(){t.mousemove&&t.mousemove.apply(t,arguments),L.apply(void 0,arguments)},R.mouseInteractionCb=function(){t.mouseInteraction&&t.mouseInteraction.apply(t,arguments),N.apply(void 0,arguments)},R.scrollCb=function(){t.scroll&&t.scroll.apply(t,arguments),F.apply(void 0,arguments)},R.viewportResizeCb=function(){t.viewportResize&&t.viewportResize.apply(t,arguments),U.apply(void 0,arguments)},R.inputCb=function(){t.input&&t.input.apply(t,arguments),z.apply(void 0,arguments)},R.mediaInteractionCb=function(){t.mediaInteaction&&t.mediaInteaction.apply(t,arguments),B.apply(void 0,arguments)},R.styleSheetRuleCb=function(){t.styleSheetRule&&t.styleSheetRule.apply(t,arguments),j.apply(void 0,arguments)},R.styleDeclarationCb=function(){t.styleDeclaration&&t.styleDeclaration.apply(t,arguments),W.apply(void 0,arguments)},R.canvasMutationCb=function(){t.canvasMutation&&t.canvasMutation.apply(t,arguments),H.apply(void 0,arguments)},R.fontCb=function(){t.font&&t.font.apply(t,arguments),q.apply(void 0,arguments)},R.selectionCb=function(){t.selection&&t.selection.apply(t,arguments),V.apply(void 0,arguments)},R.customElementCb=function(){t.customElement&&t.customElement.apply(t,arguments),G.apply(void 0,arguments)};var i,Z,J,K,$,X,Y,Q,s,ee,te,ne,re,a,l,ie,u,o,c,oe,d,f,h,p,se,ae,le,ue,m,v,g,ce,y,w,b,k,_,S,E,C,de=function(){},fe=(e.recordDOM&&(R=Pe(Yc(e,e.doc),2),i=R[0],de=R[1]),le=(R=e).mousemoveCb,O=R.doc,ue=R.mirror,!1===(T=R.sampling).mousemove?function(){}:(R="number"==typeof T.mousemove?T.mousemove:50,T="number"==typeof T.mousemoveCallback?T.mousemoveCallback:500,p=[],se=_c(Le(function(e){var t=Date.now()-h;le(p.map(function(e){return e.timeOffset-=t,e}),e),p=[],h=null}),T),T=Le(_c(Le(function(e){var t=Xc(e),n=Ic(e)?e.changedTouches[0]:e,r=n.clientX,n=n.clientY;h=h||uc(),p.push({x:r,y:n,id:ue.getId(t),timeOffset:uc()-h}),se("undefined"!=typeof DragEvent&&e instanceof DragEvent?De.Drag:e instanceof MouseEvent?De.MouseMove:De.TouchMove)}),R,{trailing:!1})),ae=[bc("mousemove",T,O),bc("touchmove",T,O),bc("drag",T,O)],Le(function(){ae.forEach(function(e){return e()})}))),he=Qc(e),pe=ed(e),me=(R={win:r},oe=(T=e).viewportResizeCb,T=R.win,f=d=-1,bc("resize",Le(_c(Le(function(){var e=Cc(),t=Rc();d===e&&f===t||(oe({width:Number(t),height:Number(e)}),d=e,f=t)}),200)),T)),ve=(Q=(O=e).inputCb,s=O.doc,ee=O.mirror,te=O.blockClass,ne=O.blockSelector,re=O.ignoreClass,a=O.ignoreSelector,l=O.maskInputOptions,ie=O.maskInputFn,u=O.userTriggeredOnInput,o=("last"===O.sampling.input?["change"]:["input","change"]).map(function(e){return bc(e,Le(_e),s)}),(c=s.defaultView)?(O=c.Object.getOwnPropertyDescriptor(c.HTMLInputElement.prototype,"value"),R=[[c.HTMLInputElement.prototype,"value"],[c.HTMLInputElement.prototype,"checked"],[c.HTMLSelectElement.prototype,"value"],[c.HTMLTextAreaElement.prototype,"value"],[c.HTMLSelectElement.prototype,"selectedIndex"],[c.HTMLOptionElement.prototype,"selected"]],O&&O.set&&Bi(o.push,o,eo(R.map(function(e){return Sc(e[0],e[1],{set:function(){Le(_e)({target:this,isTrusted:!1})}},!1,c)}))),Le(function(){o.forEach(function(e){return e()})})):function(){o.forEach(function(e){return e()})}),ge=(Z=(T=e).mediaInteractionCb,J=T.blockClass,K=T.blockSelector,$=T.mirror,X=T.sampling,T=T.doc,O=Le(function(s){return _c(Le(function(e){var t,n,r,i,o,e=Xc(e);e&&!Oc(e,J,K,!0)&&(t=e.currentTime,n=e.volume,r=e.muted,i=e.playbackRate,o=e.loop,Z({type:s,id:$.getId(e),currentTime:t,volume:n,muted:r,playbackRate:i,loop:o}))}),X.media||500)}),Y=[bc("play",O(Bc.Play),T),bc("pause",O(Bc.Pause),T),bc("seeked",O(Bc.Seeked),T),bc("volumechange",O(Bc.VolumeChange),T),bc("ratechange",O(Bc.RateChange),T)],Le(function(){Y.forEach(function(e){return e()})})),ye=function(){},we=function(){},be=function(){},ke=function(){};function _e(e){var t,n,r,i=Xc(e),e=e.isTrusted,o=i&&i.tagName;!(i=i&&"OPTION"===o?mc(i):i)||!o||td.indexOf(o)<0||Oc(i,te,ne,!0)||i.classList.contains(re)||a&&i.matches(a)||(t=i.value,n=!1,"radio"===(r=Po(i)||"")||"checkbox"===r?n=i.checked:(l[o.toLowerCase()]||l[r])&&(t=Mo({element:i,maskInputOptions:l,tagName:o,type:r,value:t,maskInputFn:ie})),Se(i,u?{text:t,isChecked:n,userTriggered:e}:{text:t,isChecked:n}),o=i.name,"radio"===r&&o&&n&&s.querySelectorAll('input[type="radio"][name="'.concat(o,'"]')).forEach(function(e){var t;e!==i&&(t=e.value,Se(e,u?{text:t,isChecked:!n,userTriggered:!1}:{text:t,isChecked:!n}))}))}function Se(e,t){var n=nd.get(e);n&&n.text===t.text&&n.isChecked===t.isChecked||(nd.set(e,t),n=ee.getId(e),Le(Q)(Ae(Ae({},t),{},{id:n})))}e.recordDOM&&(ye=((e,t)=>{var a=e.styleSheetRuleCb,l=e.mirror,u=e.stylesheetManager,r=t.win;if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return function(){};var n=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(n,{apply:Le(function(e,t,n){var r=Pe(n,2),i=r[0],r=r[1],o=id(t,l,u.styleMirror),s=o.id,o=o.styleId;return(s&&-1!==s||o&&-1!==o)&&a({id:s,styleId:o,adds:[{rule:i,index:r}]}),e.apply(t,n)})}),r.CSSStyleSheet.prototype.addRule=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:this.cssRules.length,e="".concat(e," { ").concat(t," }");return r.CSSStyleSheet.prototype.insertRule.apply(this,[e,n])};var i,o,s=r.CSSStyleSheet.prototype.deleteRule,c=(r.CSSStyleSheet.prototype.deleteRule=new Proxy(s,{apply:Le(function(e,t,n){var r=Pe(n,1)[0],i=id(t,l,u.styleMirror),o=i.id,i=i.styleId;return(o&&-1!==o||i&&-1!==i)&&a({id:o,styleId:i,removes:[{index:r}]}),e.apply(t,n)})}),r.CSSStyleSheet.prototype.removeRule=function(e){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},r.CSSStyleSheet.prototype.replace&&(i=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(i,{apply:Le(function(e,t,n){var r=Pe(n,1)[0],i=id(t,l,u.styleMirror),o=i.id,i=i.styleId;return(o&&-1!==o||i&&-1!==i)&&a({id:o,styleId:i,replace:r}),e.apply(t,n)})})),r.CSSStyleSheet.prototype.replaceSync&&(o=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(o,{apply:Le(function(e,t,n){var r=Pe(n,1)[0],i=id(t,l,u.styleMirror),o=i.id,i=i.styleId;return(o&&-1!==o||i&&-1!==i)&&a({id:o,styleId:i,replaceSync:r}),e.apply(t,n)})})),{}),d=(ld("CSSGroupingRule")?c.CSSGroupingRule=r.CSSGroupingRule:(ld("CSSMediaRule")&&(c.CSSMediaRule=r.CSSMediaRule),ld("CSSConditionRule")&&(c.CSSConditionRule=r.CSSConditionRule),ld("CSSSupportsRule")&&(c.CSSSupportsRule=r.CSSSupportsRule)),{});return Object.entries(c).forEach(function(e){var e=Pe(e,2),t=e[0],e=e[1];d[t]={insertRule:e.prototype.insertRule,deleteRule:e.prototype.deleteRule},e.prototype.insertRule=new Proxy(d[t].insertRule,{apply:Le(function(e,t,n){var r=Pe(n,2),i=r[0],r=r[1],o=id(t.parentStyleSheet,l,u.styleMirror),s=o.id,o=o.styleId;return(s&&-1!==s||o&&-1!==o)&&a({id:s,styleId:o,adds:[{rule:i,index:[].concat(eo(rd(t)),[r||0])}]}),e.apply(t,n)})}),e.prototype.deleteRule=new Proxy(d[t].deleteRule,{apply:Le(function(e,t,n){var r=Pe(n,1)[0],i=id(t.parentStyleSheet,l,u.styleMirror),o=i.id,i=i.styleId;return(o&&-1!==o||i&&-1!==i)&&a({id:o,styleId:i,removes:[{index:[].concat(eo(rd(t)),[r])}]}),e.apply(t,n)})})}),Le(function(){r.CSSStyleSheet.prototype.insertRule=n,r.CSSStyleSheet.prototype.deleteRule=s,i&&(r.CSSStyleSheet.prototype.replace=i),o&&(r.CSSStyleSheet.prototype.replaceSync=o),Object.entries(c).forEach(function(e){var e=Pe(e,2),t=e[0],e=e[1];e.prototype.insertRule=d[t].insertRule,e.prototype.deleteRule=d[t].deleteRule})})})(e,{win:r}),we=od(e,e.doc),R={win:r},w=(O=e).styleDeclarationCb,b=O.mirror,k=O.ignoreCSSAttributes,_=O.stylesheetManager,S=R.win,E=S.CSSStyleDeclaration.prototype.setProperty,S.CSSStyleDeclaration.prototype.setProperty=new Proxy(E,{apply:Le(function(e,t,n){var r,i,o=Pe(n,3),s=o[0],a=o[1],o=o[2];return k.has(s)?E.apply(t,[s,a,o]):(r=(i=id(null==(i=t.parentRule)?void 0:i.parentStyleSheet,b,_.styleMirror)).id,i=i.styleId,(r&&-1!==r||i&&-1!==i)&&w({id:r,styleId:i,set:{property:s,value:a,priority:o},index:rd(t.parentRule)}),e.apply(t,n))})}),C=S.CSSStyleDeclaration.prototype.removeProperty,S.CSSStyleDeclaration.prototype.removeProperty=new Proxy(C,{apply:Le(function(e,t,n){var r,i,o=Pe(n,1)[0];return k.has(o)?C.apply(t,[o]):(r=(i=id(null==(i=t.parentRule)?void 0:i.parentStyleSheet,b,_.styleMirror)).id,i=i.styleId,(r&&-1!==r||i&&-1!==i)&&w({id:r,styleId:i,remove:{property:o},index:rd(t.parentRule)}),e.apply(t,n))})}),be=Le(function(){S.CSSStyleDeclaration.prototype.setProperty=E,S.CSSStyleDeclaration.prototype.removeProperty=C}),e.collectFonts)&&(ce=(T=e).fontCb,y=(T=T.doc).defaultView,ke=y?(m=[],v=new WeakMap,g=y.FontFace,y.FontFace=function(e,t,n){var r=new g(e,t,n);return v.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r},T=cc(T.fonts,"add",function(e){return function(t){return setTimeout(Le(function(){var e=v.get(t);e&&(ce(e),v.delete(t))}),0),e.apply(this,[t])}}),m.push(function(){y.FontFace=g}),m.push(T),Le(function(){m.forEach(function(e){return e()})})):function(){});Re=(O=e).doc,x=O.mirror,I=O.blockClass,M=O.blockSelector,Te=O.selectionCb,A=!0,(O=Le(function(){var e=Re.getSelection();if(!(!e||A&&null!=e&&e.isCollapsed)){A=e.isCollapsed||!1;for(var t=[],n=e.rangeCount||0,r=0;r<n;r++){var i=e.getRangeAt(r),o=i.startContainer,s=i.startOffset,a=i.endContainer,i=i.endOffset;Oc(o,I,M,!0)||Oc(a,I,M,!0)||t.push({start:x.getId(o),startOffset:s,end:x.getId(a),endOffset:i})}Te({ranges:t})}}))();var Ee,R,T,Ce,O,Re,x,I,M,Te,A,Oe=bc("selectionchange",O),xe=(T=(R=e).doc,Ce=R.customElementCb,(R=T.defaultView)&&R.customElements?cc(R.customElements,"define",function(r){return function(t,e,n){try{Ce({define:{name:t}})}catch(e){console.warn("Custom element callback failed for ".concat(t))}return r.apply(this,[t,e,n])}}):function(){}),Ie=[],P=Me(e.plugins);try{for(P.s();!(Ee=P.n()).done;){var D=Ee.value;Ie.push(D.observer(D.callback,r,D.options))}}catch(e){P.e(e)}finally{P.f()}return Le(function(){$c.forEach(function(e){return e.reset()}),null!=i&&i.disconnect(),de(),fe(),he(),pe(),me(),ve(),ge(),ye(),we(),be(),ke(),Oe(),xe(),Ie.forEach(function(e){return e()})})}function ad(e){return void 0!==window[e]}function ld(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}for(var ud=k(function e(t){b(this,e),c(this,"iframeIdToRemoteIdMap",new WeakMap),c(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t},[{key:"getId",value:function(e,t,n,r){n=n||this.getIdToRemoteIdMap(e),r=r||this.getRemoteIdToIdMap(e),e=n.get(t);return e||(e=this.generateIdFn(),n.set(t,e),r.set(e,t)),e}},{key:"getIds",value:function(t,e){var n=this,r=this.getIdToRemoteIdMap(t),i=this.getRemoteIdToIdMap(t);return e.map(function(e){return n.getId(t,e,r,i)})}},{key:"getRemoteId",value:function(e,t,n){n=n||this.getRemoteIdToIdMap(e);return"number"!=typeof t?t:n.get(t)||-1}},{key:"getRemoteIds",value:function(t,e){var n=this,r=this.getRemoteIdToIdMap(t);return e.map(function(e){return n.getRemoteId(t,e,r)})}},{key:"reset",value:function(e){e?(this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)):(this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap)}},{key:"getIdToRemoteIdMap",value:function(e){var t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}},{key:"getRemoteIdToIdMap",value:function(e){var t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}]),cd=k(function e(t){b(this,e),c(this,"iframes",new WeakMap),c(this,"crossOriginIframeMap",new WeakMap),c(this,"crossOriginIframeMirror",new ud(Vo)),c(this,"crossOriginIframeStyleMirror"),c(this,"crossOriginIframeRootIdMap",new WeakMap),c(this,"mirror"),c(this,"mutationCb"),c(this,"wrappedEmit"),c(this,"loadListener"),c(this,"stylesheetManager"),c(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ud(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))},[{key:"addIframe",value:function(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}},{key:"addLoadListener",value:function(e){this.loadListener=e}},{key:"attachIframe",value:function(e,t){this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&null!=(t=e.contentWindow)&&t.addEventListener("message",this.handleMessage.bind(this)),null!=(t=this.loadListener)&&t.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&0<e.contentDocument.adoptedStyleSheets.length&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}},{key:"handleMessage",value:function(e){var t=e;"rrweb"===t.data.type&&t.origin===t.data.origin&&e.source&&(e=this.crossOriginIframeMap.get(e.source))&&(e=this.transformCrossOriginEvent(e,t.data.event))&&this.wrappedEmit(e,t.data.isCheckout)}},{key:"transformCrossOriginEvent",value:function(n,e){var t,r=this;switch(e.type){case Y.FullSnapshot:this.crossOriginIframeMirror.reset(n),this.crossOriginIframeStyleMirror.reset(n),this.replaceIdOnNode(e.data.node,n);var i=e.data.node.id;return this.crossOriginIframeRootIdMap.set(n,i),this.patchRootIdOnNode(e.data.node,i),{timestamp:e.timestamp,type:Y.IncrementalSnapshot,data:{source:De.Mutation,adds:[{parentId:this.mirror.getId(n),nextId:null,node:e.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Y.Meta:case Y.Load:case Y.DomContentLoaded:return!1;case Y.Plugin:return e;case Y.Custom:return this.replaceIds(e.data.payload,n,["id","parentId","previousId","nextId"]),e;case Y.IncrementalSnapshot:switch(e.data.source){case De.Mutation:return e.data.adds.forEach(function(e){r.replaceIds(e,n,["parentId","nextId","previousId"]),r.replaceIdOnNode(e.node,n);var t=r.crossOriginIframeRootIdMap.get(n);t&&r.patchRootIdOnNode(e.node,t)}),e.data.removes.forEach(function(e){r.replaceIds(e,n,["parentId","id"])}),e.data.attributes.forEach(function(e){r.replaceIds(e,n,["id"])}),e.data.texts.forEach(function(e){r.replaceIds(e,n,["id"])}),e;case De.Drag:case De.TouchMove:case De.MouseMove:return e.data.positions.forEach(function(e){r.replaceIds(e,n,["id"])}),e;case De.ViewportResize:return!1;case De.MediaInteraction:case De.MouseInteraction:case De.Scroll:case De.CanvasMutation:case De.Input:return this.replaceIds(e.data,n,["id"]),e;case De.StyleSheetRule:case De.StyleDeclaration:return this.replaceIds(e.data,n,["id"]),this.replaceStyleIds(e.data,n,["styleId"]),e;case De.Font:return e;case De.Selection:return e.data.ranges.forEach(function(e){r.replaceIds(e,n,["start","end"])}),e;case De.AdoptedStyleSheet:return this.replaceIds(e.data,n,["id"]),this.replaceStyleIds(e.data,n,["styleIds"]),null!=(t=e.data.styles)&&t.forEach(function(e){r.replaceStyleIds(e,n,["styleId"])}),e}}return!1}},{key:"replace",value:function(e,t,n,r){var i,o=Me(r);try{for(o.s();!(i=o.n()).done;){var s=i.value;!Array.isArray(t[s])&&"number"!=typeof t[s]||(Array.isArray(t[s])?t[s]=e.getIds(n,t[s]):t[s]=e.getId(n,t[s]))}}catch(e){o.e(e)}finally{o.f()}return t}},{key:"replaceIds",value:function(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}},{key:"replaceStyleIds",value:function(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}},{key:"replaceIdOnNode",value:function(e,t){var n=this;this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(function(e){n.replaceIdOnNode(e,t)})}},{key:"patchRootIdOnNode",value:function(e,t){var n=this;e.type===jc.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(function(e){n.patchRootIdOnNode(e,t)})}}]),dd=k(function e(t){b(this,e),c(this,"shadowDoms",new WeakSet),c(this,"mutationCb"),c(this,"scrollCb"),c(this,"bypassOptions"),c(this,"mirror"),c(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()},[{key:"init",value:function(){this.reset(),this.patchAttachShadow(Element,document)}},{key:"addShadowRoot",value:function(e,t){var n,r=this;To(e)&&!this.shadowDoms.has(e)&&(this.shadowDoms.add(e),n=Pe(Yc(Ae(Ae({},this.bypassOptions),{},{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),1)[0],this.restoreHandlers.push(function(){return n.disconnect()}),this.restoreHandlers.push(ed(Ae(Ae({},this.bypassOptions),{},{scrollCb:this.scrollCb,doc:e,mirror:this.mirror}))),setTimeout(function(){e.adoptedStyleSheets&&0<e.adoptedStyleSheets.length&&r.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,r.mirror.getId(yc(e))),r.restoreHandlers.push(od({mirror:r.mirror,stylesheetManager:r.bypassOptions.stylesheetManager},e))},0))}},{key:"observeAttachShadow",value:function(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}},{key:"patchAttachShadow",value:function(e,r){var i=this;this.restoreHandlers.push(cc(e.prototype,"attachShadow",function(n){return function(e){var e=n.call(this,e),t=wc(this);return t&&Nc(this)&&i.addShadowRoot(t,r),e}}))}},{key:"reset",value:function(){this.restoreHandlers.forEach(function(e){try{e()}catch(e){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}]),fd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",hd="undefined"==typeof Uint8Array?[]:new Uint8Array(256),pd=0;pd<fd.length;pd++)hd[fd.charCodeAt(pd)]=pd;function md(e,t,n){return e.map(function(e){return function t(i,n,r){return i instanceof Array?i.map(function(e){return t(e,n,r)}):null===i?i:i instanceof Float32Array||i instanceof Float64Array||i instanceof Int32Array||i instanceof Uint32Array||i instanceof Uint8Array||i instanceof Uint16Array||i instanceof Int16Array||i instanceof Int8Array||i instanceof Uint8ClampedArray?{rr_type:i.constructor.name,args:[Object.values(i)]}:i instanceof ArrayBuffer?{rr_type:i.constructor.name,base64:(()=>{for(var e=new Uint8Array(i),t=e.length,n="",r=0;r<t;r+=3)n=(n=(n=(n+=fd[e[r]>>2])+fd[(3&e[r])<<4|e[r+1]>>4])+fd[(15&e[r+1])<<2|e[r+2]>>6])+fd[63&e[r+2]];return t%3==2?n=n.substring(0,n.length-1)+"=":t%3==1&&(n=n.substring(0,n.length-2)+"=="),n})()}:i instanceof DataView?{rr_type:i.constructor.name,args:[t(i.buffer,n,r),i.byteOffset,i.byteLength]}:i instanceof HTMLImageElement?{rr_type:i.constructor.name,src:i.src}:i instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:i.toDataURL()}:i instanceof ImageData?{rr_type:i.constructor.name,args:[t(i.data,n,r),i.width,i.height]}:yd(i,n)||"object"===_(i)?{rr_type:i.constructor.name,index:gd(i,n,r)}:i}(e,t,n)})}var vd=new Map,gd=function(e,t,n){var r;if(e&&(yd(e,t)||"object"===_(e)))return t=n,n=e.constructor.name,(r=vd.get(t))||(r=new Map,vd.set(t,r)),r.has(n)||r.set(n,[]),-1===(r=(t=r.get(n)).indexOf(e))&&(r=t.length,t.push(e)),r},yd=function(t,n){var e=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(function(e){return"function"==typeof n[e]});return Boolean(e.find(function(e){return t instanceof n[e]}))};function wd(e,s,a,l){var t=[];try{var n=cc(e.HTMLCanvasElement.prototype,"getContext",function(o){return function(e){for(var t,n=arguments.length,r=new Array(1<n?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return Oc(this,s,a,!0)||(t="experimental-webgl"===(t=e)?"webgl":t,"__context"in this||(this.__context=t),l&&["webgl","webgl2"].includes(t)&&(r[0]&&"object"===_(r[0])?(t=r[0]).preserveDrawingBuffer||(t.preserveDrawingBuffer=!0):r.splice(0,1,{preserveDrawingBuffer:!0}))),o.apply(this,[e].concat(r))}});t.push(n)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return function(){t.forEach(function(e){return e()})}}function bd(n,a,l,u,c,d){var e,r=[],t=Me(Object.getOwnPropertyNames(n));try{for(t.s();!(e=t.n()).done;)(()=>{var s=e.value;if(["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(s))return;try{if("function"!=typeof n[s])return;var t=cc(n,s,function(o){return function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,i=o.apply(this,t);return gd(i,d,this),"tagName"in this.canvas&&!Oc(this.canvas,u,c,!0)&&(r=md(t,d,this),l(this.canvas,{type:a,property:s,args:r})),i}});r.push(t)}catch(e){t=Sc(n,s,{set:function(e){l(this.canvas,{type:a,property:s,args:[e],setter:!0})}});r.push(t)}})()}catch(n){t.e(n)}finally{t.f()}return r}var kd='(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastBlobMap = /* @__PURE__ */ new Map();\n const transparentBlobMap = /* @__PURE__ */ new Map();\n async function getTransparentBlobFor(width, height, dataURLOptions) {\n const id = `${width}-${height}`;\n if ("OffscreenCanvas" in globalThis) {\n if (transparentBlobMap.has(id)) return transparentBlobMap.get(id);\n const offscreen = new OffscreenCanvas(width, height);\n offscreen.getContext("2d");\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n transparentBlobMap.set(id, base64);\n return base64;\n } else {\n return "";\n }\n }\n const worker = self;\n worker.onmessage = async function(e) {\n if ("OffscreenCanvas" in globalThis) {\n const { id, bitmap, width, height, dataURLOptions } = e.data;\n const transparentBase64 = getTransparentBlobFor(\n width,\n height,\n dataURLOptions\n );\n const offscreen = new OffscreenCanvas(width, height);\n const ctx = offscreen.getContext("2d");\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const type = blob.type;\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n if (!lastBlobMap.has(id) && await transparentBase64 === base64) {\n lastBlobMap.set(id, base64);\n return worker.postMessage({ id });\n }\n if (lastBlobMap.get(id) === base64) return worker.postMessage({ id });\n worker.postMessage({\n id,\n type,\n base64,\n width,\n height\n });\n lastBlobMap.set(id, base64);\n } else {\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n//# sourceMappingURL=image-bitmap-data-url-worker-IJpC7g_b.js.map\n',_d="undefined"!=typeof self&&self.Blob&&new Blob([kd],{type:"text/javascript;charset=utf-8"});function Sd(e){var t,n;try{if(t=_d&&(self.URL||self.webkitURL).createObjectURL(_d))return(n=new Worker(t,{name:null==e?void 0:e.name})).addEventListener("error",function(){(self.URL||self.webkitURL).revokeObjectURL(t)}),n;throw""}catch(t){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(kd),{name:null==e?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var Q,Ed,Cd,Rd,Td=k(function e(t){var n=this,r=(b(this,e),c(this,"pendingCanvasMutations",new Map),c(this,"rafStamps",{latestId:0,invokeId:null}),c(this,"mirror"),c(this,"mutationCb"),c(this,"resetObservers"),c(this,"frozen",!1),c(this,"locked",!1),c(this,"processMutation",function(e,t){(n.rafStamps.invokeId&&n.rafStamps.latestId!==n.rafStamps.invokeId||!n.rafStamps.invokeId)&&(n.rafStamps.invokeId=n.rafStamps.latestId),n.pendingCanvasMutations.has(e)||n.pendingCanvasMutations.set(e,[]),n.pendingCanvasMutations.get(e).push(t)}),t.sampling),r=void 0===r?"all":r,i=t.win,o=t.blockClass,s=t.blockSelector,a=t.recordCanvas,l=t.dataURLOptions;this.mutationCb=t.mutationCb,this.mirror=t.mirror,a&&"all"===r&&this.initCanvasMutationObserver(i,o,s),a&&"number"==typeof r&&this.initCanvasFPSObserver(r,i,o,s,{dataURLOptions:l})},[{key:"reset",value:function(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}},{key:"freeze",value:function(){this.frozen=!0}},{key:"unfreeze",value:function(){this.frozen=!1}},{key:"lock",value:function(){this.locked=!0}},{key:"unlock",value:function(){this.locked=!1}},{key:"initCanvasFPSObserver",value:function(e,r,i,o,s){var a=this,t=wd(r,i,o,!0),l=new Map,u=new Sd;u.onmessage=function(e){var t,n=e.data.id;l.set(n,!1),"base64"in e.data&&(t=(e=e.data).base64,a.mutationCb({id:n,type:zc["2D"],commands:[{property:"clearRect",args:[0,0,e.width,e.height]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:t}],type:e.type}]},0,0]}]}))};var c=1e3/e,d=0,f=function(e){var t,n;d&&e-d<c||(d=e,t=[],r.document.querySelectorAll("canvas").forEach(function(e){Oc(e,i,o,!0)||t.push(e)}),t.forEach((n=zi(Ki().m(function e(t){var n,r,i;return Ki().w(function(e){for(;;)switch(e.n){case 0:if(n=a.mirror.getId(t),l.get(n))return e.a(2);e.n=1;break;case 1:if(0===t.width||0===t.height)return e.a(2);e.n=2;break;case 2:return l.set(n,!0),["webgl","webgl2"].includes(t.__context)&&(r=t.getContext(t.__context),!1===(null==(i=null==r?void 0:r.getContextAttributes())?void 0:i.preserveDrawingBuffer))&&r.clear(r.COLOR_BUFFER_BIT),e.n=3,createImageBitmap(t);case 3:i=e.v,u.postMessage({id:n,bitmap:i,width:t.width,height:t.height,dataURLOptions:s.dataURLOptions},[i]);case 4:return e.a(2)}},e)})),function(e){return n.apply(this,arguments)}))),h=requestAnimationFrame(f)},h=requestAnimationFrame(f);this.resetObservers=function(){t(),cancelAnimationFrame(h)}}},{key:"initCanvasMutationObserver",value:function(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();var r,i,o=wd(e,t,n,!1),s=((s,a,l,u)=>{var e,n=[],t=Me(Object.getOwnPropertyNames(a.CanvasRenderingContext2D.prototype));try{for(t.s();!(e=t.n()).done;)(()=>{var o=e.value;try{if("function"!=typeof a.CanvasRenderingContext2D.prototype[o])return;var t=cc(a.CanvasRenderingContext2D.prototype,o,function(i){return function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return Oc(this.canvas,l,u,!0)||setTimeout(function(){var e=md(n,a,t);s(t.canvas,{type:zc["2D"],property:o,args:e})},0),i.apply(this,n)}});n.push(t)}catch(e){t=Sc(a.CanvasRenderingContext2D.prototype,o,{set:function(e){s(this.canvas,{type:zc["2D"],property:o,args:[e],setter:!0})}});n.push(t)}})()}catch(s){t.e(s)}finally{t.f()}return function(){n.forEach(function(e){return e()})}})(this.processMutation.bind(this),e,t,n),a=(r=this.processMutation.bind(this),t=t,n=n,i=[],void 0!==(e=e).WebGLRenderingContext&&Bi(i.push,i,eo(bd(e.WebGLRenderingContext.prototype,zc.WebGL,r,t,n,e))),void 0!==e.WebGL2RenderingContext&&Bi(i.push,i,eo(bd(e.WebGL2RenderingContext.prototype,zc.WebGL2,r,t,n,e))),function(){i.forEach(function(e){return e()})});this.resetObservers=function(){o(),s(),a()}}},{key:"startPendingCanvasMutationFlusher",value:function(){var e=this;requestAnimationFrame(function(){return e.flushPendingCanvasMutations()})}},{key:"startRAFTimestamping",value:function(){function t(e){n.rafStamps.latestId=e,requestAnimationFrame(t)}var n=this;requestAnimationFrame(t)}},{key:"flushPendingCanvasMutations",value:function(){var r=this;this.pendingCanvasMutations.forEach(function(e,t){var n=r.mirror.getId(t);r.flushPendingCanvasMutationFor(t,n)}),requestAnimationFrame(function(){return r.flushPendingCanvasMutations()})}},{key:"flushPendingCanvasMutationFor",value:function(e,t){var n,r;this.frozen||this.locked||(r=this.pendingCanvasMutations.get(e))&&-1!==t&&(n=r.map(function(e){return e.type,Ji(e,uo)}),r=r[0].type,this.mutationCb({id:t,type:r,commands:n}),this.pendingCanvasMutations.delete(e))}}]),Od=k(function e(t){b(this,e),c(this,"trackedLinkElements",new WeakSet),c(this,"mutationCb"),c(this,"adoptedStyleSheetCb"),c(this,"styleMirror",new Dc),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb},[{key:"attachLinkElement",value:function(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}},{key:"trackLinkElement",value:function(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}},{key:"adoptStyleSheets",value:function(e,t){var r=this;if(0!==e.length){var i,o={id:t,styleIds:[]},s=[],n=Me(e);try{for(n.s();!(i=n.n()).done;)(()=>{var e,n=i.value;r.styleMirror.has(n)?e=r.styleMirror.getId(n):(e=r.styleMirror.add(n),s.push({styleId:e,rules:Array.from(n.rules||CSSRule,function(e,t){return{rule:xo(e,n.href),index:t}})})),o.styleIds.push(e)})()}catch(e){n.e(e)}finally{n.f()}0<s.length&&(o.styles=s),this.adoptedStyleSheetCb(o)}}},{key:"reset",value:function(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}},{key:"trackStylesheetInLinkElement",value:function(e){}}]),xd=k(function e(){b(this,e),c(this,"nodeMap",new WeakMap),c(this,"active",!1)},[{key:"inOtherBuffer",value:function(e,t){e=this.nodeMap.get(e);return e&&Array.from(e).some(function(e){return e!==t})}},{key:"add",value:function(e,t){var n=this;this.active||(this.active=!0,requestAnimationFrame(function(){n.nodeMap=new WeakMap,n.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}},{key:"destroy",value:function(){}}]),Id=!1;try{2!==Array.from([1],function(e){return 2*e})[0]&&(Rd=document.createElement("iframe"),document.body.appendChild(Rd),Array.from=(null==(vm=Rd.contentWindow)?void 0:vm.Array.from)||Array.from,document.body.removeChild(Rd))}catch(ih){console.debug("Unable to override Array.from",ih)}var Md=new Io;function Ad(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},r=e.emit,i=e.checkoutEveryNms,o=e.checkoutEveryNth,t=e.blockClass,l=void 0===t?"rr-block":t,t=e.blockSelector,u=void 0===t?null:t,t=e.ignoreClass,L=void 0===t?"rr-ignore":t,t=e.ignoreSelector,N=void 0===t?null:t,t=e.maskTextClass,c=void 0===t?"rr-mask":t,t=e.maskTextSelector,d=void 0===t?null:t,t=e.inlineStylesheet,f=void 0===t||t,t=e.maskAllInputs,n=e.maskInputOptions,F=e.slimDOMOptions,h=e.maskInputFn,p=e.maskTextFn,U=e.hooks,z=e.packFn,s=e.sampling,a=void 0===s?{}:s,s=e.dataURLOptions,m=void 0===s?{}:s,s=e.mousemoveWait,v=e.recordDOM,B=void 0===v||v,v=e.recordCanvas,g=void 0!==v&&v,v=e.recordCrossOriginIframes,v=void 0!==v&&v,y=e.recordAfter,j=void 0===y?"DOMContentLoaded"===e.recordAfter?e.recordAfter:"load":y,y=e.userTriggeredOnInput,W=void 0!==y&&y,y=e.collectFonts,H=void 0!==y&&y,y=e.inlineImages,w=void 0!==y&&y,b=e.plugins,y=e.keepIframeSrcFn,k=void 0===y?function(){return!1}:y,y=e.ignoreCSSAttributes,q=void 0===y?new Set([]):y,_=(qc=e.errorHandler,!v||window.parent===window),S=!1;if(!_)try{window.parent.document&&(S=!1)}catch(e){S=!0}if(_&&!r)throw new Error("emit function is required");if(!_&&!S)return function(){};void 0!==s&&void 0===a.mousemove&&(a.mousemove=s),Md.reset();var V,E=!0===t?{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!==n?n:{password:!0},C=ts(F),R=(!function(e){"NodeList"in(e=0<arguments.length&&void 0!==e?e:window)&&!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)}(),0),G=function(e){var t,n=Me(b||[]);try{for(n.s();!(t=n.n()).done;){var r=t.value;r.eventProcessor&&(e=r.eventProcessor(e))}}catch(e){n.e(e)}finally{n.f()}return e=z&&!S?z(e):e};Q=function(e,t){var n;e.timestamp=uc(),null==(n=$c[0])||!n.isFrozen()||e.type===Y.FullSnapshot||e.type===Y.IncrementalSnapshot&&e.data.source===De.Mutation||$c.forEach(function(e){return e.unfreeze()}),_?null!=r&&r(G(e),t):S&&(n={type:"rrweb",event:G(e),origin:window.location.origin,isCheckout:t},window.parent.postMessage(n,"*")),e.type===Y.FullSnapshot?(V=e,R=0):e.type!==Y.IncrementalSnapshot||e.data.source===De.Mutation&&e.data.isAttachIframe||(R++,t=o&&o<=R,n=i&&e.timestamp-V.timestamp>i,(t||n)&&Ed(!0))};function T(e){Q({type:Y.IncrementalSnapshot,data:Ae({source:De.Mutation},e)})}function Z(e){return Q({type:Y.IncrementalSnapshot,data:Ae({source:De.Scroll},e)})}function J(e){return Q({type:Y.IncrementalSnapshot,data:Ae({source:De.CanvasMutation},e)})}var K,O=new Od({mutationCb:T,adoptedStyleSheetCb:function(e){return Q({type:Y.IncrementalSnapshot,data:Ae({source:De.AdoptedStyleSheet},e)})}}),x=new cd({mirror:Md,mutationCb:T,stylesheetManager:O,recordCrossOriginIframes:v,wrappedEmit:Q}),I=Me(b||[]);try{for(I.s();!(K=I.n()).done;){var $=K.value;$.getMirror&&$.getMirror({nodeMirror:Md,crossOriginIframeMirror:x.crossOriginIframeMirror,crossOriginIframeStyleMirror:x.crossOriginIframeStyleMirror})}}catch(e){I.e(e)}finally{I.f()}var M=new xd,A=(Cd=new Td({recordCanvas:g,mutationCb:J,win:window,blockClass:l,blockSelector:u,mirror:Md,sampling:a.canvas,dataURLOptions:m}),new dd({mutationCb:T,scrollCb:Z,bypassOptions:{blockClass:l,blockSelector:u,maskTextClass:c,maskTextSelector:d,inlineStylesheet:f,maskInputOptions:E,dataURLOptions:m,maskTextFn:p,maskInputFn:h,recordCanvas:g,inlineImages:w,sampling:a,slimDOMOptions:C,iframeManager:x,stylesheetManager:O,canvasManager:Cd,keepIframeSrcFn:k,processedNodeManager:M},mirror:Md}));Ed=function(){var e,t,n,r,i,o,s=0<arguments.length&&void 0!==arguments[0]&&arguments[0];if(B){Q({type:Y.Meta,data:{href:window.location.href,width:Rc(),height:Cc()}},s),O.reset(),A.init(),$c.forEach(function(e){return e.lock()});a=document,r=void 0===(r=(e={mirror:Md,blockClass:l,blockSelector:u,maskTextClass:c,maskTextSelector:d,inlineStylesheet:f,maskAllInputs:E,maskTextFn:p,maskInputFn:h,slimDOM:C,dataURLOptions:m,recordCanvas:g,inlineImages:w,onSerialize:function(e){Mc(e,Md)&&x.addIframe(e),Ac(e,Md)&&O.trackLinkElement(e),Pc(e)&&A.addShadowRoot(wc(e),document)},onIframeLoad:function(e,t){x.attachIframe(e,t),A.observeAttachShadow(e)},onStylesheetLoad:function(e,t){O.attachLinkElement(e,t)},keepIframeSrcFn:k}).mirror)?new Io:r,t=e.inlineImages,n=e.recordCanvas,i=e.slimDOM,o=e.keepIframeSrcFn;var a=ns(a,{doc:a,mirror:r,blockClass:void 0===(a=e.blockClass)?"rr-block":a,blockSelector:void 0===(r=e.blockSelector)?null:r,maskTextClass:void 0===(a=e.maskTextClass)?"rr-mask":a,maskTextSelector:void 0===(r=e.maskTextSelector)?null:r,skipChild:!1,inlineStylesheet:void 0===(a=e.inlineStylesheet)||a,maskInputOptions:!0===(r=void 0!==(r=e.maskAllInputs)&&r)?{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===r?{password:!0}:r,maskTextFn:e.maskTextFn,maskInputFn:e.maskInputFn,slimDOMOptions:ts(void 0!==i&&i),dataURLOptions:e.dataURLOptions,inlineImages:void 0!==t&&t,recordCanvas:void 0!==n&&n,preserveWhiteSpace:e.preserveWhiteSpace,onSerialize:e.onSerialize,onIframeLoad:e.onIframeLoad,iframeLoadTimeout:e.iframeLoadTimeout,onStylesheetLoad:e.onStylesheetLoad,stylesheetLoadTimeout:e.stylesheetLoadTimeout,keepIframeSrcFn:void 0===o?function(){return!1}:o,newlyAddedElement:!1});if(!a)return console.warn("Failed to snapshot the document");Q({type:Y.FullSnapshot,data:{node:a,initialOffset:Ec(window)}},s),$c.forEach(function(e){return e.unlock()}),document.adoptedStyleSheets&&0<document.adoptedStyleSheets.length&&O.adoptStyleSheets(document.adoptedStyleSheets,Md.getId(document))}};try{var P=[],X=function(e){return Le(sd)({mutationCb:T,mousemoveCb:function(e,t){return Q({type:Y.IncrementalSnapshot,data:{source:t,positions:e}})},mouseInteractionCb:function(e){return Q({type:Y.IncrementalSnapshot,data:Ae({source:De.MouseInteraction},e)})},scrollCb:Z,viewportResizeCb:function(e){return Q({type:Y.IncrementalSnapshot,data:Ae({source:De.ViewportResize},e)})},inputCb:function(e){return Q({type:Y.IncrementalSnapshot,data:Ae({source:De.Input},e)})},mediaInteractionCb:function(e){return Q({type:Y.IncrementalSnapshot,data:Ae({source:De.MediaInteraction},e)})},styleSheetRuleCb:function(e){return Q({type:Y.IncrementalSnapshot,data:Ae({source:De.StyleSheetRule},e)})},styleDeclarationCb:function(e){return Q({type:Y.IncrementalSnapshot,data:Ae({source:De.StyleDeclaration},e)})},canvasMutationCb:J,fontCb:function(e){return Q({type:Y.IncrementalSnapshot,data:Ae({source:De.Font},e)})},selectionCb:function(e){Q({type:Y.IncrementalSnapshot,data:Ae({source:De.Selection},e)})},customElementCb:function(e){Q({type:Y.IncrementalSnapshot,data:Ae({source:De.CustomElement},e)})},blockClass:l,ignoreClass:L,ignoreSelector:N,maskTextClass:c,maskTextSelector:d,maskInputOptions:E,inlineStylesheet:f,sampling:a,recordDOM:B,recordCanvas:g,inlineImages:w,userTriggeredOnInput:W,collectFonts:H,doc:e,maskInputFn:h,maskTextFn:p,keepIframeSrcFn:k,blockSelector:u,slimDOMOptions:C,dataURLOptions:m,mirror:Md,iframeManager:x,stylesheetManager:O,shadowDomManager:A,processedNodeManager:M,canvasManager:Cd,ignoreCSSAttributes:q,plugins:(null==(e=null==b?void 0:b.filter(function(e){return e.observer}))?void 0:e.map(function(t){return{observer:t.observer,options:t.options,callback:function(e){return Q({type:Y.Plugin,data:{plugin:t.name,payload:e}})}}}))||[]},U)},D=(x.addLoadListener(function(e){try{P.push(X(e.contentDocument))}catch(e){console.warn(e)}}),function(){Ed(),P.push(X(document)),Id=!0});return["interactive","complete"].includes(document.readyState)?D():(P.push(bc("DOMContentLoaded",function(){Q({type:Y.DomContentLoaded,data:{}}),"DOMContentLoaded"===j&&D()})),P.push(bc("load",function(){Q({type:Y.Load,data:{}}),"load"===j&&D()},window))),function(){P.forEach(function(e){try{e()}catch(e){String(e).toLowerCase().includes("cross-origin")||console.warn(e)}}),M.destroy(),Id=!1,qc=void 0}}catch(e){console.warn(e)}}Ad.addCustomEvent=function(e,t){if(!Id)throw new Error("please add custom event after start recording");Q({type:Y.Custom,data:{tag:e,payload:t}})},Ad.freezePage=function(){$c.forEach(function(e){return e.freeze()})},Ad.takeFullSnapshot=function(e){if(!Id)throw new Error("please take full snapshot after start recording");Ed(e)},Ad.mirror=Md;var Pd='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',Dd={maskAllText:!0,maskAllInputs:!0,blockAllMedia:!0,autoDetectSensitiveData:!0,mask:[".tdem-mask","[data-tdem-mask]","[data-sensitive]",".sensitive",".private"],block:[".tdem-block","[data-tdem-block]",".secret","[data-secret]","iframe[srcdoc]:not([src])",".replayer-wrapper"],ignore:[".tdem-ignore","[data-tdem-ignore]",'input[type="file"]','input[type="password"]'],maskInputOptions:{password:!0,email:!0,tel:!0,text:!1}},Ld=(Nd.maskPhone=function(e){return e.replace(this.phoneRegex,function(e){var t=e.replace(/[^\d]/g,"");return 11===t.length?e.substring(0,3)+"****"+e.substring(7):13===t.length?e.substring(0,6)+"****"+e.substring(10):e.substring(0,3)+"****"+e.substring(e.length-4)})},Nd.maskIdCard=function(e){return e.replace(this.idCardRegex,function(e){return 18===e.length?e.substring(0,6)+"********"+e.substring(14):15===e.length?e.substring(0,6)+"******"+e.substring(12):e})},Nd.maskEmail=function(e){return e.replace(this.emailRegex,function(e){var t,n=e.indexOf("@");return n<=1?"*"+e.substring(1):(t=e.substring(0,n),e=e.substring(n),t.charAt(0)+"***"+t.charAt(t.length-1)+e)})},Nd.maskBankCard=function(e){return e.replace(this.bankCardRegex,function(e){var t=e.replace(/[^\d]/g,"");return t.length<13?e:t.substring(0,4)+" **** **** "+t.substring(t.length-4)})},Nd.maskIP=function(e){return e.replace(this.ipv4Regex,function(e){e=e.split(".");return e[0]+".*.*."+e[3]})},Nd.autoMask=function(e){var t;return e&&"string"==typeof e?(t=this.maskPhone(t=e),t=this.maskIdCard(t),t=this.maskEmail(t),this.maskBankCard(t)):e},Nd.hasSensitiveData=function(e){return!(!e||"string"!=typeof e)&&(this.phoneRegex.test(e)||this.idCardRegex.test(e)||this.emailRegex.test(e)||this.bankCardRegex.test(e))},Nd.phoneRegex=/1[3-9]\d{9}|(?:\+?86)?1[3-9]\d{9}/g,Nd.idCardRegex=/[1-9]\d{5}(?:19|20)\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])\d{3}[\dXx]|[1-9]\d{7}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])\d{3}/g,Nd.emailRegex=/[\w.-]+@[\w.-]+\.\w{2,}/g,Nd.bankCardRegex=/\b\d{4}[\s-]?\d{4}[\s-]?\d{4}[\s-]?\d{1,7}\b/g,Nd.ipv4Regex=/\b(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\b/g,Nd);function Nd(){}function Fd(e,t){return void 0===e&&(e={}),I(I(I({},t=void 0===t?Dd:t),e),{mask:Ud(t.mask,e.mask),block:Ud(t.block,e.block),ignore:Ud(t.ignore,e.ignore),maskInputOptions:I(I({},t.maskInputOptions),e.maskInputOptions)})}function Ud(e,t){e=new Set(g(e||[],t||[]));return Array.from(e)}qd.prototype.push=function(e,t){if(this.emitFn=t,3===e.type&&this.isMutationEvent(e)){var n=e.data;if(this.buffer){if(this.enableRepeatDetection&&this.isRepeatPattern(n)){if(this.repeatCount++,3<this.repeatCount)return this.buffer=this.cloneEvent(e),void this.droppedByRepeat++}else this.repeatCount=0;this.mergeInto(n,e.timestamp),this.mergedCount++,(null!=(n=null==(n=this.buffer.data.adds)?void 0:n.length)?n:0)>=this.maxAddsPerMerge&&this.flush()}else this.buffer=this.cloneEvent(e),this.scheduleFlush()}else this.flush(),t(e)},qd.prototype.flush=function(){this.clearTimer(),this.buffer&&this.emitFn&&(this.emitFn(this.buffer),this.buffer=null,this.repeatCount=0)},qd.prototype.destroy=function(){this.flush(),this.clearTimer(),this.emitFn=null},qd.prototype.getStats=function(){return{mergedCount:this.mergedCount,droppedByRepeat:this.droppedByRepeat,cancelledByOffset:this.cancelledByOffset}},qd.prototype.isMutationEvent=function(e){return 0===(null==(e=e.data)?void 0:e.source)},qd.prototype.isRepeatPattern=function(e){var t;return!!this.buffer&&(t=null!=(t=this.buffer.data.adds)?t:[],e=null!=(e=e.adds)?e:[],0!==t.length)&&0!==e.length&&t.length===e.length&&(null==(t=t[0])?void 0:t.parentId)===(null==(t=e[0])?void 0:t.parentId)},qd.prototype.mergeInto=function(e,t){var n,r,i,o;if(this.buffer){var s=this.buffer.data;this.buffer.timestamp=Math.max(this.buffer.timestamp,t);for(var a=this,l=0,u=null!=(t=e.removes)?t:[];l<u.length;l++)(t=>{var e=(null!=(n=s.adds)?n:[]).findIndex(function(e){return(null==(e=e.node)?void 0:e.id)===t.id});0<=e?(s.adds.splice(e,1),a.cancelledByOffset++):(s.removes=null!=(n=s.removes)?n:[],s.removes.push(t))})(u[l]);for(var c=0,d=null!=(t=e.adds)?t:[];c<d.length;c++){var f=d[c];s.adds=null!=(r=s.adds)?r:[],s.adds.push(f)}for(var h=0,p=null!=(t=e.attributes)?t:[];h<p.length;h++)(t=>{s.attributes=null!=(i=s.attributes)?i:[];var e=s.attributes.findIndex(function(e){return e.id===t.id});0<=e?s.attributes[e]=t:s.attributes.push(t)})(p[h]);for(var m=0,v=null!=(t=e.texts)?t:[];m<v.length;m++)(t=>{s.texts=null!=(o=s.texts)?o:[];var e=s.texts.findIndex(function(e){return e.id===t.id});0<=e?s.texts[e]=t:s.texts.push(t)})(v[m])}},qd.prototype.cloneEvent=function(e){var t=e.data;return{type:e.type,timestamp:e.timestamp,data:{source:0,adds:g(null!=(e=t.adds)?e:[]),removes:g(null!=(e=t.removes)?e:[]),attributes:g(null!=(e=t.attributes)?e:[]),texts:g(null!=(e=t.texts)?e:[])}}},qd.prototype.scheduleFlush=function(){var e=this;this.clearTimer(),this.flushTimer=setTimeout(function(){e.flushTimer=null,e.flush()},this.windowMs)},qd.prototype.clearTimer=function(){null!==this.flushTimer&&(clearTimeout(this.flushTimer),this.flushTimer=null)};var zd=qd,Bd=(Hd.prototype.startRecording=function(e){var r,i,n=this;if(void 0===e&&(e={}),"recording"!==this.state){this.mutationLimitReached=!1,this.throttleCount=0,this.throttleWindowStart=Date.now(),this.throttleNotified=!1,this.mutationAddsInWindow=0;var t="buffer"===this.options.mode?12e4:3e5,t="number"==typeof e.checkoutEveryNms&&0<e.checkoutEveryNms?e.checkoutEveryNms:t,o="number"==typeof e.checkoutEveryNth&&0<e.checkoutEveryNth?e.checkoutEveryNth:void 0,s=Fd(e.privacy||{},Dd),a=I(I(I(I({emit:function(e,t){n.handleEvent(e,t)},checkoutEveryNms:t},o?{checkoutEveryNth:o}:{}),{sampling:{scroll:150,mousemove:!l.ios()&&50,mouseInteraction:!0,input:"last"},slimDOMOptions:{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:!0}}),(t={},void 0!==(o=s).maskAllInputs&&(t.maskAllInputs=o.maskAllInputs),o.maskInputOptions&&(t.maskInputOptions=o.maskInputOptions),null!=(a=o.mask)&&a.length&&(t.maskTextSelector=o.mask.join(",")),null!=(a=o.block)&&a.length&&(t.blockSelector=o.block.join(",")),o.blockAllMedia&&(t.blockSelector=t.blockSelector?t.blockSelector+","+Pd:Pd,t.ignoreCSSAttributes=new Set(["background-image"])),null!=(a=o.ignore)&&a.length&&(t.ignoreSelector=o.ignore.join(",")),!o.maskTextFn&&!1===o.autoDetectSensitiveData||(t.maskTextFn=(r=o.maskTextFn,i=!1!==o.autoDetectSensitiveData,function(e,t){var n;return e&&(n=e,i&&(n=Ld.autoMask(n)),r?r(n,t):n)})),t)),e.rrwebConfig);try{this.hookMutationObserver(),this.stopRecordingFn=Ad(a),this.state="recording",this.lastCheckoutTime=Date.now(),this.startCheckpointTimer(),u("RecorderManager","Recording started with config:",{maskAllText:s.maskAllText,maskAllInputs:s.maskAllInputs,autoDetectSensitiveData:s.autoDetectSensitiveData,mutationLimit:this.mutationLimit,checkpointIntervalMs:12e4})}catch(e){Oi("RecorderManager","Failed to start recording:",e),this.state="stopped"}}else Ti("RecorderManager","Already recording")},Hd.prototype.stopRecording=function(){var e;this.stopCheckpointTimer(),null!=(e=this.mutationMerger)&&e.destroy(),this.unhookMutationObserver(),this.stopRecordingFn&&(this.stopRecordingFn(),this.stopRecordingFn=void 0),this.state="stopped",u("RecorderManager","Recording stopped")},Hd.prototype.pauseRecording=function(){"recording"===this.state&&(this.stopRecording(),this.state="paused",u("RecorderManager","Recording paused"))},Hd.prototype.resumeRecording=function(e){void 0===e&&(e={}),"paused"===this.state&&(this.startRecording(e),u("RecorderManager","Recording resumed"))},Hd.prototype.hookMutationObserver=function(){try{var r,e,t=window.MutationObserver;t&&(r=this,(e=function(n){return new t(function(e,t){r.unhookMutationObserver(),r.onMutationHandler(e)&&n(e,t)})}).prototype=t.prototype,window.MutationObserver=e,this.restoreMutationObserver=function(){window.MutationObserver=t},Ri("RecorderManager","MutationObserver hooked"))}catch(t){Ti("RecorderManager","Failed to hook MutationObserver:",t)}},Hd.prototype.unhookMutationObserver=function(){this.restoreMutationObserver&&(this.restoreMutationObserver(),this.restoreMutationObserver=null,Ri("RecorderManager","MutationObserver restored"))},Hd.prototype.onMutationHandler=function(e){var t,n=this;return!this.mutationLimitReached&&(t=(e=e.length)>this.mutationLimit,(e>this.mutationBreadcrumbLimit||t)&&this.emitMutationBreadcrumb(e,t),!t||(this.mutationLimitReached=!0,Oi("RecorderManager","Mutation limit reached: "+e+" > "+this.mutationLimit+". Stopping."),setTimeout(function(){var e,t;null!=(t=(e=n.options).onMutationLimitReached)&&t.call(e),n.stopRecording()},0),!1))},Hd.prototype.checkMutationLimit=function(e){var n=this;if(this.mutationLimitReached)return!1;if(3!==e.type)return!0;e=e.data;if(0!==(null==e?void 0:e.source))return!0;e=Array.isArray(e.adds)?e.adds.length:0;if(0===e)return!0;this.mutationAddsInWindow+=e;var t=e>this.mutationLimit||this.mutationAddsInWindow>2*this.mutationLimit;return(e>this.mutationBreadcrumbLimit||t)&&this.emitMutationBreadcrumb(e,t),!t||(Oi("RecorderManager","Mutation limit: "+e+" adds (window: "+this.mutationAddsInWindow+"). Stopping."),this.mutationLimitReached=!0,setTimeout(function(){var e,t;null!=(t=(e=n.options).onMutationLimitReached)&&t.call(e),n.stopRecording()},0),!1)},Hd.prototype.emitMutationBreadcrumb=function(e,t){var n;try{null!=(n=Ad.addCustomEvent)&&n.call(Ad,"replay.mutations",{count:e,limit:t,timestamp:Date.now()})}catch(e){}},Hd.prototype.handleEvent=function(e,t){var n=this,r=(t&&(null!=(i=(r=this.options).onCheckout)&&i.call(r),this.lastCheckoutTime=Date.now(),null!=(i=this.mutationMerger))&&i.flush(),e.type);if(t||2===r||4===r||r<=1||this.checkEventThrottle()){if(3===r&&!this.mutationLimitReached){var i=Date.now();if(12e4<=i-this.lastCheckoutTime){this.lastCheckoutTime=i;try{var o=Ad.takeFullSnapshot;"function"==typeof o&&(o(!0),Ri("RecorderManager","Inline checkpoint: forced FullSnapshot"))}catch(e){Ti("RecorderManager","Inline checkpoint failed:",e)}}}this.checkMutationLimit(e)&&(this.mutationMerger?this.mutationMerger.push(e,function(e){n.options.onRecordingEvent(e)}):this.options.onRecordingEvent(e))}},Hd.prototype.checkEventThrottle=function(){var e,t=Date.now();if(5e3<t-this.throttleWindowStart&&(this.throttleCount=0,this.throttleWindowStart=t,this.throttleNotified=!1,this.mutationAddsInWindow=0),this.throttleCount++,300<this.throttleCount){if(!this.throttleNotified){this.throttleNotified=!0,Ti("RecorderManager","Event throttled: "+this.throttleCount+" events in 5000ms window");try{null!=(e=Ad.addCustomEvent)&&e.call(Ad,"replay.throttled",{count:this.throttleCount,window:5e3})}catch(e){}}return!1}return!0},Hd.prototype.startCheckpointTimer=function(){var t=this;this.stopCheckpointTimer(),this.checkpointTimer=setInterval(function(){if("recording"===t.state&&!t.mutationLimitReached)try{var e=Ad.takeFullSnapshot;"function"==typeof e&&(e(!0),t.lastCheckoutTime=Date.now(),Ri("RecorderManager","Checkpoint: forced FullSnapshot"))}catch(e){Ti("RecorderManager","Checkpoint FullSnapshot failed:",e)}},12e4)},Hd.prototype.stopCheckpointTimer=function(){null!==this.checkpointTimer&&(clearInterval(this.checkpointTimer),this.checkpointTimer=null)},Hd.prototype.getState=function(){return this.state},Hd.prototype.isRecording=function(){return"recording"===this.state},Hd.prototype.getLastCheckoutTime=function(){return this.lastCheckoutTime},Hd.prototype.takeFullSnapshot=function(){var e,t;"recording"===this.state&&this.stopRecordingFn&&(null!=(t=null==(e=this.stopRecordingFn)?void 0:e.takeFullSnapshot)&&t.call(e),this.lastCheckoutTime=Date.now())},Hd.prototype.isMutationLimitReached=function(){return this.mutationLimitReached},Hd),jd=(Wd.prototype.initializeSampling=function(){return null!==this.samplingDecision?{mode:this.currentMode,shouldRecord:!1!==this.currentMode}:Math.random()<this.config.sessionSampleRate?(this.currentMode="session",this.samplingDecision=!0,u("SamplerManager","Sampled: session mode"),{mode:"session",shouldRecord:!0}):0<this.config.errorSampleRate?(this.currentMode="buffer",this.samplingDecision=!0,u("SamplerManager","Sampled: buffer mode"),{mode:"buffer",shouldRecord:!0}):(this.currentMode=!1,this.samplingDecision=!1,u("SamplerManager","Not sampled"),{mode:!1,shouldRecord:!1})},Wd.prototype.decideSamplingMode=function(){return this.initializeSampling().mode},Wd.prototype.onErrorOccurred=function(e){return"buffer"===this.currentMode&&!this.hasUpgraded&&!!(Math.random()<this.config.errorSampleRate)&&(this.switchMode("session"),this.hasUpgraded=!0)},Wd.prototype.switchMode=function(e){var t=this.currentMode;this.currentMode=e,this.samplingDecision=!1!==e,u("SamplerManager","Mode switched: "+t+" -> "+e)},Wd.prototype.getCurrentMode=function(){return this.currentMode},Wd.prototype.isSampled=function(){return!0===this.samplingDecision},Wd.prototype.isSessionMode=function(){return"session"===this.currentMode},Wd.prototype.isBufferMode=function(){return"buffer"===this.currentMode},Wd.prototype.upgradeToSessionMode=function(){return"buffer"===this.currentMode&&Math.random()<this.config.errorSampleRate&&(this.currentMode="session",u("SamplerManager","Upgraded to session mode due to error"),!0)},Wd.prototype.updateRates=function(e,t){"number"==typeof e&&(this.config.sessionSampleRate=e),"number"==typeof t&&(this.config.errorSampleRate=t)},Wd.prototype.forceMode=function(e){this.currentMode=e,this.samplingDecision=!1!==e},Wd.prototype.reset=function(){this.currentMode=!1,this.samplingDecision=null},Wd.prototype.getConfig=function(){return I({},this.config)},Wd);function Wd(e){var t;void 0===e&&(e={}),this.currentMode=!1,this.samplingDecision=null,this.hasUpgraded=!1,this.config={sessionSampleRate:null!=(t=e.sessionSampleRate)?t:.1,errorSampleRate:null!=(t=e.errorSampleRate)?t:1}}function Hd(e,t){this.state="stopped",this.lastCheckoutTime=0,this.checkpointTimer=null,this.mutationLimitReached=!1,this.mutationMerger=null,this.mutationBreadcrumbLimit=750,this.mutationLimit=1e4,this.restoreMutationObserver=null,this.throttleCount=0,this.throttleWindowStart=0,this.throttleNotified=!1,this.mutationAddsInWindow=0,this.options=e,this.mutationBreadcrumbLimit=null!=(e=null==t?void 0:t.mutationBreadcrumbLimit)?e:750,this.mutationLimit=null!=(e=null==t?void 0:t.mutationLimit)?e:1e4,null!=t&&t.enableMutationMerge&&(this.mutationMerger=new zd({windowMs:null!=(e=null==t?void 0:t.mutationMergeWindowMs)?e:200,maxAddsPerMerge:500,enableRepeatDetection:!0}))}function qd(e){var t;this.buffer=null,this.flushTimer=null,this.repeatCount=0,this.emitFn=null,this.mergedCount=0,this.droppedByRepeat=0,this.cancelledByOffset=0,this.windowMs=null!=(t=null==e?void 0:e.windowMs)?t:200,this.maxAddsPerMerge=null!=(t=null==e?void 0:e.maxAddsPerMerge)?t:500,this.enableRepeatDetection=null==(t=null==e?void 0:e.enableRepeatDetection)||t}function Vd(e){for(var t=e.length;0<=--t;)e[t]=0}var Gd=new Uint8Array([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]),Zd=new Uint8Array([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]),Jd=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Kd=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),$d=new Array(576),Xd=(Vd($d),new Array(60)),Yd=(Vd(Xd),new Array(512)),Qd=(Vd(Yd),new Array(256)),ef=(Vd(Qd),new Array(29));Vd(ef);var tf,nf,rf,of=new Array(30);function sf(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}function af(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function lf(e,t,n){return e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=n,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(Qd[n]+256+1)]++,e.dyn_dtree[2*gf(t)]++),e.sym_next===e.sym_end}function uf(e){return 2*e-(4<e?9:0)}function cf(e,t){Bf(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,uh(e.strm)}function d(e,t){e.pending_buf[e.pending++]=t}function df(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function ff(e,t){var n,r,i=e.max_chain_length,o=e.strstart,s=e.prev_length,a=e.nice_match,l=e.w_size-262<e.strstart?e.strstart-(e.w_size-262):0,u=e.window,c=e.w_mask,d=e.prev,f=e.strstart+258,h=u[o+s-1],p=u[o+s];e.good_match<=e.prev_length&&(i>>=2),e.lookahead<a&&(a=e.lookahead);do{if(u[(n=t)+s]===p&&u[n+s-1]===h&&u[n]===u[o]&&u[++n]===u[o+1]){for(o+=2,n++;u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&o<f;);if(r=258-(f-o),o=f-258,s<r){if(e.match_start=t,a<=(s=r))break;h=u[o+s-1],p=u[o+s]}}}while((t=d[t&c])>l&&0!=--i);return s<=e.lookahead?s:e.lookahead}function hf(e){var t,n,r=e.w_size;do{if(t=e.window_size-e.lookahead-e.strstart,r+(r-262)<=e.strstart&&(e.window.set(e.window.subarray(r,r+r-t),0),e.match_start-=r,e.strstart-=r,e.block_start-=r,e.strstart<e.insert&&(e.insert=e.strstart),sh(e),t+=r),0===e.strm.avail_in)break;if(t=ch(e.strm,e.window,e.strstart+e.lookahead,t),e.lookahead+=t,e.legacy_hash){if(3<=e.lookahead+e.insert)for(n=e.strstart-e.insert,e.ins_h=e.window[n],e.ins_h=ah(e,e.ins_h,e.window[n+1]);e.insert&&(lh(e,n),n++,e.insert--,!(e.lookahead+e.insert<3)););}else if(3<e.lookahead+e.insert)for(n=e.strstart-e.insert;e.insert&&(lh(e,n),n++,e.insert--,!(e.lookahead+e.insert<=3)););}while(e.lookahead<262&&0!==e.strm.avail_in)}function pf(e,t){for(var n,r,i,o=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,s=0,a=e.strm.avail_in;n=65535,i=e.bi_valid+42>>3,!(e.strm.avail_out<i||(n=(i=e.strm.avail_out-i)<(n=n>(r=e.strstart-e.block_start)+e.strm.avail_in?r+e.strm.avail_in:n)?i:n)<o&&(0===n&&t!==qf||t===jf||n!==r+e.strm.avail_in)||(s=t===qf&&n===r+e.strm.avail_in?1:0,zf(e,0,0,s),e.pending_buf[e.pending-4]=n,e.pending_buf[e.pending-3]=n>>8,e.pending_buf[e.pending-2]=~n,e.pending_buf[e.pending-1]=~n>>8,uh(e.strm),r&&(n<r&&(r=n),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+r),e.strm.next_out),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r,e.block_start+=r,n-=r),n&&(ch(e.strm,e.strm.output,e.strm.next_out,n),e.strm.next_out+=n,e.strm.avail_out-=n,e.strm.total_out+=n),0!==s)););return(a-=e.strm.avail_in)&&(a>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=a&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.strstart<e.insert)&&(e.insert=e.strstart),e.window.set(e.strm.input.subarray(e.strm.next_in-a,e.strm.next_in),e.strstart),e.strstart+=a,e.insert+=e.w_size-e.insert<a?e.w_size-e.insert:a),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),s?4:t!==jf&&t!==qf&&0===e.strm.avail_in&&e.strstart===e.block_start?2:(i=e.window_size-e.strstart,e.strm.avail_in>i&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,i+=e.w_size,e.strstart<e.insert)&&(e.insert=e.strstart),(i=i>e.strm.avail_in?e.strm.avail_in:i)&&(ch(e.strm,e.window,e.strstart,i),e.strstart+=i,e.insert+=e.w_size-e.insert<i?e.w_size-e.insert:i),e.high_water<e.strstart&&(e.high_water=e.strstart),o=(i=65535<e.pending_buf_size-(i=e.bi_valid+42>>3)?65535:e.pending_buf_size-i)>e.w_size?e.w_size:i,((r=e.strstart-e.block_start)>=o||(r||t===qf)&&t!==jf&&0===e.strm.avail_in&&r<=i)&&(n=i<r?i:r,s=t===qf&&0===e.strm.avail_in&&n===r?1:0,zf(e,e.block_start,n,s),e.block_start+=n,uh(e.strm)),s?3:1)}function mf(e,t){for(var n,r;;){if(e.lookahead<262){if(hf(e),e.lookahead<262&&t===jf)return 1;if(0===e.lookahead)break}if((n=0)!==(n=3<=e.lookahead?lh(e,e.strstart):n)&&e.strstart-n<=e.w_size-262&&(e.match_length=ff(e,n)),3<=e.match_length)if(r=lf(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&3<=e.lookahead){for(e.match_length--;e.strstart++,n=lh(e,e.strstart),0!=--e.match_length;);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.legacy_hash&&(e.ins_h=e.window[e.strstart],e.ins_h=ah(e,e.ins_h,e.window[e.strstart+1]));else r=lf(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(cf(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===qf?(cf(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(cf(e,!1),0===e.strm.avail_out)?1:2}function vf(e,t){for(var n,r,i;;){if(e.lookahead<262){if(hf(e),e.lookahead<262&&t===jf)return 1;if(0===e.lookahead)break}if(n=0,3<=e.lookahead&&(n=lh(e,e.strstart)),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==n&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-262&&(e.match_length=ff(e,n),e.match_length<=5)&&(e.strategy===Yf||3===e.match_length&&4096<e.strstart-e.match_start)&&(e.match_length=2),3<=e.prev_length&&e.match_length<=e.prev_length){for(i=e.strstart+e.lookahead-3,r=lf(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=i&&(n=lh(e,e.strstart)),0!=--e.prev_length;);if(e.match_available=0,e.match_length=2,e.strstart++,r&&(cf(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if((r=lf(e,0,e.window[e.strstart-1]))&&cf(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=lf(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===qf?(cf(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(cf(e,!1),0===e.strm.avail_out)?1:2}Vd(of);var gf=function(e){return e<256?Yd[e]:Yd[256+(e>>>7)]},yf=function(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},wf=function(e,t,n){e.bi_valid>16-n?(e.bi_buf|=t<<e.bi_valid&65535,yf(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=n-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)},bf=function(e,t,n){wf(e,n[2*t],n[2*t+1])},kf=function(e,t){for(var n=0;n|=1&e,e>>>=1,n<<=1,0<--t;);return n>>>1},_f=function(e,t,n){for(var r,i=new Array(16),o=0,s=1;s<=15;s++)o=o+n[s-1]<<1,i[s]=o;for(r=0;r<=t;r++){var a=e[2*r+1];0!==a&&(e[2*r]=kf(i[a]++,a))}},Sf=function(e){for(var t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},Ef=function(e){8<e.bi_valid?yf(e,e.bi_buf):0<e.bi_valid&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},Cf=function(e,t,n,r){var i=2*t,o=2*n;return e[i]<e[o]||e[i]===e[o]&&r[t]<=r[n]},Rf=function(e,t,n){for(var r=e.heap[n],i=n<<1;i<=e.heap_len&&(i<e.heap_len&&Cf(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!Cf(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r},Tf=function(e,t,n){var r,i,o,s,a=0;if(0!==e.sym_next)for(;r=255&e.pending_buf[e.sym_buf+a++],r+=(255&e.pending_buf[e.sym_buf+a++])<<8,i=e.pending_buf[e.sym_buf+a++],0==r?bf(e,i,t):(o=Qd[i],bf(e,o+256+1,t),0!==(s=Gd[o])&&(i-=ef[o],wf(e,i,s)),o=gf(--r),bf(e,o,n),0!==(s=Zd[o])&&(r-=of[o],wf(e,r,s))),a<e.sym_next;);bf(e,256,t)},Of=function(e,t){var n,r,i,o=t.dyn_tree,s=t.stat_desc.static_tree,a=t.stat_desc.has_stree,l=t.stat_desc.elems,u=-1;for(e.heap_len=0,e.heap_max=573,n=0;n<l;n++)0!==o[2*n]?(e.heap[++e.heap_len]=u=n,e.depth[n]=0):o[2*n+1]=0;for(;e.heap_len<2;)o[2*(i=e.heap[++e.heap_len]=u<2?++u:0)]=1,e.depth[i]=0,e.opt_len--,a&&(e.static_len-=s[2*i+1]);for(t.max_code=u,n=e.heap_len>>1;1<=n;n--)Rf(e,o,n);for(i=l;n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Rf(e,o,1),r=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=r,o[2*i]=o[2*n]+o[2*r],e.depth[i]=(e.depth[n]>=e.depth[r]?e.depth[n]:e.depth[r])+1,o[2*n+1]=o[2*r+1]=i,e.heap[1]=i++,Rf(e,o,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1];for(var c,d,f,h,p,m=e,v=t.dyn_tree,g=t.max_code,y=t.stat_desc.static_tree,w=t.stat_desc.has_stree,b=t.stat_desc.extra_bits,k=t.stat_desc.extra_base,_=t.stat_desc.max_length,S=0,E=0;E<=15;E++)m.bl_count[E]=0;for(v[2*m.heap[m.heap_max]+1]=0,c=m.heap_max+1;c<573;c++)(E=v[2*v[2*(d=m.heap[c])+1]+1]+1)>_&&(E=_,S++),v[2*d+1]=E,g<d||(m.bl_count[E]++,h=0,k<=d&&(h=b[d-k]),p=v[2*d],m.opt_len+=p*(E+h),w&&(m.static_len+=p*(y[2*d+1]+h)));if(0!==S){do{for(E=_-1;0===m.bl_count[E];)E--}while(m.bl_count[E]--,m.bl_count[E+1]+=2,m.bl_count[_]--,0<(S-=2));for(E=_;0!==E;E--)for(d=m.bl_count[E];0!==d;)(f=m.heap[--c])>g||(v[2*f+1]!==E&&(m.opt_len+=(E-v[2*f+1])*v[2*f],v[2*f+1]=E),d--)}_f(o,u,e.bl_count)},xf=function(e,t,n){var r,i,o=-1,s=t[1],a=0,l=7,u=4;for(0===s&&(l=138,u=3),t[2*(n+1)+1]=65535,r=0;r<=n;r++)i=s,s=t[2*(r+1)+1],++a<l&&i===s||(a<u?e.bl_tree[2*i]+=a:0!==i?(i!==o&&e.bl_tree[2*i]++,e.bl_tree[32]++):a<=10?e.bl_tree[34]++:e.bl_tree[36]++,o=i,u=(a=0)===s?(l=138,3):i===s?(l=6,3):(l=7,4))},If=function(e,t,n){var r,i,o=-1,s=t[1],a=0,l=7,u=4;for(0===s&&(l=138,u=3),r=0;r<=n;r++)if(i=s,s=t[2*(r+1)+1],!(++a<l&&i===s)){if(a<u)for(;bf(e,i,e.bl_tree),0!=--a;);else 0!==i?(i!==o&&(bf(e,i,e.bl_tree),a--),bf(e,16,e.bl_tree),wf(e,a-3,2)):a<=10?(bf(e,17,e.bl_tree),wf(e,a-3,3)):(bf(e,18,e.bl_tree),wf(e,a-11,7));o=i,u=(a=0)===s?(l=138,3):i===s?(l=6,3):(l=7,4)}},Mf=!1,Af=function(e,t,n,r){wf(e,0+(r?1:0),3),Ef(e),yf(e,n),yf(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n},Pf=Af,Df=function(e,t,n,r){for(var i=65535&e|0,o=e>>>16&65535|0,s=0;0!==n;){for(n-=s=2e3<n?2e3:n;o=o+(i=i+t[r++]|0)|0,--s;);i%=65521,o%=65521}return i|o<<16|0},Lf=new Uint32Array((()=>{for(var e=[],t=0;t<256;t++){for(var n=t,r=0;r<8;r++)n=1&n?3988292384^n>>>1:n>>>1;e[t]=n}return e})()),Nf=function(e,t,n,r){var i=Lf,o=r+n;e^=-1;for(var s=r;s<o;s++)e=e>>>8^i[255&(e^t[s])];return-1^e},Ff={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Uf=function(e){if(!Mf){for(var t,n,r,i=new Array(16),o=0,s=0;s<28;s++)for(ef[s]=o,t=0;t<1<<Gd[s];t++)Qd[o++]=s;for(Qd[o-1]=s,s=r=0;s<16;s++)for(of[s]=r,t=0;t<1<<Zd[s];t++)Yd[r++]=s;for(r>>=7;s<30;s++)for(of[s]=r<<7,t=0;t<1<<Zd[s]-7;t++)Yd[256+r++]=s;for(n=0;n<=15;n++)i[n]=0;for(t=0;t<=143;)$d[2*t+1]=8,t++,i[8]++;for(;t<=255;)$d[2*t+1]=9,t++,i[9]++;for(;t<=279;)$d[2*t+1]=7,t++,i[7]++;for(;t<=287;)$d[2*t+1]=8,t++,i[8]++;for(_f($d,287,i),t=0;t<30;t++)Xd[2*t+1]=5,Xd[2*t]=kf(t,5);tf=new sf($d,Gd,257,286,15),nf=new sf(Xd,Zd,0,30,15),rf=new sf(new Array(0),Jd,0,19,7),Mf=!0}e.l_desc=new af(e.dyn_ltree,tf),e.d_desc=new af(e.dyn_dtree,nf),e.bl_desc=new af(e.bl_tree,rf),e.bi_buf=0,e.bi_valid=0,Sf(e)},zf=Pf,Bf=function(e,t,n,r){var i,o,s,a=0;if(0<e.level?(2===e.strm.data_type&&(e.strm.data_type=(e=>{for(var t=4093624447,n=0;n<=31;n++,t>>>=1)if(1&t&&0!==e.dyn_ltree[2*n])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(n=32;n<256;n++)if(0!==e.dyn_ltree[2*n])return 1;return 0})(e)),Of(e,e.l_desc),Of(e,e.d_desc),a=(e=>{var t;for(xf(e,e.dyn_ltree,e.l_desc.max_code),xf(e,e.dyn_dtree,e.d_desc.max_code),Of(e,e.bl_desc),t=18;3<=t&&0===e.bl_tree[2*Kd[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),i=e.opt_len+3+7>>>3,(o=e.static_len+3+7>>>3)<=i&&(i=o)):i=o=n+5,n+4<=i&&-1!==t)Af(e,t,n,r);else if(4===e.strategy||o===i)wf(e,2+(r?1:0),3),Tf(e,$d,Xd);else{wf(e,4+(r?1:0),3);var l=e,u=(t=e.l_desc.max_code+1,n=e.d_desc.max_code+1,a+1);for(wf(l,t-257,5),wf(l,n-1,5),wf(l,u-4,4),s=0;s<u;s++)wf(l,l.bl_tree[2*Kd[s]+1],3);If(l,l.dyn_ltree,t-1),If(l,l.dyn_dtree,n-1),Tf(e,e.dyn_ltree,e.dyn_dtree)}Sf(e),r&&Ef(e)},jf=(i={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}).Z_NO_FLUSH,Wf=i.Z_PARTIAL_FLUSH,Hf=i.Z_FULL_FLUSH,qf=i.Z_FINISH,Vf=i.Z_BLOCK,Gf=i.Z_OK,Zf=i.Z_STREAM_END,Jf=i.Z_STREAM_ERROR,Kf=i.Z_DATA_ERROR,$f=i.Z_BUF_ERROR,Xf=i.Z_DEFAULT_COMPRESSION,Yf=i.Z_FILTERED,Qf=i.Z_HUFFMAN_ONLY,eh=i.Z_RLE,th=i.Z_FIXED,nh=i.Z_UNKNOWN,rh=i.Z_DEFLATED,ih=function(e,t){return e.msg=Ff[t],t},oh=function(e){for(var t=e.length;0<=--t;)e[t]=0},sh=function(e){for(var t,n,r=e.w_size,i=t=e.hash_size;n=e.head[--i],e.head[i]=r<=n?n-r:0,--t;);for(i=t=r;n=e.prev[--i],e.prev[i]=r<=n?n-r:0,--t;);},ah=function(e,t,n){return(t<<e.hash_shift^n)&e.hash_mask},lh=function(e,t){n=e.legacy_hash?e.ins_h=ah(e,e.ins_h,e.window[t+3-1]):(n=(n=e.window)[t]|n[t+1]<<8|n[t+2]<<16|n[t+3]<<24,e.ins_h=Math.imul(n,66521)+66521>>>16&e.hash_mask);var n,r=e.prev[t&e.w_mask]=e.head[n];return e.head[n]=t,r},uh=function(e){var t=e.state,n=t.pending;0!==(n=e.avail_out<n?e.avail_out:n)&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,0===t.pending)&&(t.pending_out=0)},ch=function(e,t,n,r){var i=e.avail_in;return 0===(i=r<i?r:i)?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),n),1===e.state.wrap?e.adler=Df(e.adler,t,i,n):2===e.state.wrap&&(e.adler=Nf(e.adler,t,i,n)),e.next_in+=i,e.total_in+=i,i)};function dh(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}var fh=[new dh(0,0,0,0,pf),new dh(4,4,8,4,mf),new dh(4,5,16,8,mf),new dh(4,6,32,32,mf),new dh(4,4,16,16,vf),new dh(8,16,32,32,vf),new dh(8,16,128,128,vf),new dh(8,32,128,256,vf),new dh(32,128,258,1024,vf),new dh(32,258,258,4096,vf)];function hh(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=rh,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.legacy_hash=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),oh(this.dyn_ltree),oh(this.dyn_dtree),oh(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),oh(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),oh(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function ph(e,t){if(gh(e)||Vf<t||t<0)return e?ih(e,Jf):Jf;var n=e.state;if(!e.output||0!==e.avail_in&&!e.input||666===n.status&&t!==qf)return ih(e,0===e.avail_out?$f:Jf);var r=n.last_flush;if(n.last_flush=t,0!==n.pending){if(uh(e),0===e.avail_out)return n.last_flush=-1,Gf}else if(0===e.avail_in&&uf(t)<=uf(r)&&t!==qf)return ih(e,$f);if(666===n.status&&0!==e.avail_in)return ih(e,$f);if(42===n.status&&0===n.wrap&&(n.status=113),42===n.status){var r=rh+(n.w_bits-8<<4)<<8;if(r|=(n.strategy>=Qf||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(r|=32),df(n,r+=31-r%31),0!==n.strstart&&(df(n,e.adler>>>16),df(n,65535&e.adler)),e.adler=1,n.status=113,uh(e),0!==n.pending)return n.last_flush=-1,Gf}if(57===n.status)if(e.adler=0,d(n,31),d(n,139),d(n,8),n.gzhead)d(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),d(n,255&n.gzhead.time),d(n,n.gzhead.time>>8&255),d(n,n.gzhead.time>>16&255),d(n,n.gzhead.time>>24&255),d(n,9===n.level?2:n.strategy>=Qf||n.level<2?4:0),d(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(d(n,255&n.gzhead.extra.length),d(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=Nf(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69;else if(d(n,0),d(n,0),d(n,0),d(n,0),d(n,0),d(n,9===n.level?2:n.strategy>=Qf||n.level<2?4:0),d(n,3),n.status=113,uh(e),0!==n.pending)return n.last_flush=-1,Gf;if(69===n.status){if(n.gzhead.extra){for(var i=n.pending,o=(65535&n.gzhead.extra.length)-n.gzindex;n.pending+o>n.pending_buf_size;){var s=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+s),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>i&&(e.adler=Nf(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex+=s,uh(e),0!==n.pending)return n.last_flush=-1,Gf;i=0,o-=s}r=new Uint8Array(n.gzhead.extra);n.pending_buf.set(r.subarray(n.gzindex,n.gzindex+o),n.pending),n.pending+=o,n.gzhead.hcrc&&n.pending>i&&(e.adler=Nf(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex=0}n.status=73}if(73===n.status){if(n.gzhead.name){var a,l=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>l&&(e.adler=Nf(e.adler,n.pending_buf,n.pending-l,l)),uh(e),0!==n.pending)return n.last_flush=-1,Gf;l=0}}while(a=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,d(n,a),0!=a);n.gzhead.hcrc&&n.pending>l&&(e.adler=Nf(e.adler,n.pending_buf,n.pending-l,l)),n.gzindex=0}n.status=91}if(91===n.status){if(n.gzhead.comment){var u,c=n.pending;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>c&&(e.adler=Nf(e.adler,n.pending_buf,n.pending-c,c)),uh(e),0!==n.pending)return n.last_flush=-1,Gf;c=0}}while(u=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,d(n,u),0!=u);n.gzhead.hcrc&&n.pending>c&&(e.adler=Nf(e.adler,n.pending_buf,n.pending-c,c))}n.status=103}if(103===n.status){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(uh(e),0!==n.pending))return n.last_flush=-1,Gf;d(n,255&e.adler),d(n,e.adler>>8&255),e.adler=0}if(n.status=113,uh(e),0!==n.pending)return n.last_flush=-1,Gf}if(0!==e.avail_in||0!==n.lookahead||t!==jf&&666!==n.status){r=0===n.level?pf(n,t):n.strategy===Qf?((e,t)=>{for(var n;;){if(0===e.lookahead&&(hf(e),0===e.lookahead)){if(t===jf)return 1;break}if(e.match_length=0,n=lf(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(cf(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===qf?(cf(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(cf(e,!1),0===e.strm.avail_out)?1:2})(n,t):n.strategy===eh?((e,t)=>{for(var n,r,i,o,s=e.window;;){if(e.lookahead<=258){if(hf(e),e.lookahead<=258&&t===jf)return 1;if(0===e.lookahead)break}if(e.match_length=0,3<=e.lookahead&&0<e.strstart&&(r=s[i=e.strstart-1])===s[++i]&&r===s[++i]&&r===s[++i]){for(o=e.strstart+258;r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&i<o;);e.match_length=258-(o-i),e.lookahead<e.match_length&&(e.match_length=e.lookahead)}if(3<=e.match_length?(n=lf(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=lf(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(cf(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===qf?(cf(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(cf(e,!1),0===e.strm.avail_out)?1:2})(n,t):fh[n.level].func(n,t);if(3!==r&&4!==r||(n.status=666),1===r||3===r)return 0===e.avail_out&&(n.last_flush=-1),Gf;if(2===r&&(t===Wf?(wf(r=n,2,3),bf(r,256,$d),16===(r=r).bi_valid?(yf(r,r.bi_buf),r.bi_buf=0,r.bi_valid=0):8<=r.bi_valid&&(r.pending_buf[r.pending++]=255&r.bi_buf,r.bi_buf>>=8,r.bi_valid-=8)):t!==Vf&&(zf(n,0,0,!1),t===Hf)&&(oh(n.head),0===n.lookahead)&&(n.strstart=0,n.block_start=0,n.insert=0),uh(e),0===e.avail_out))return n.last_flush=-1,Gf}return t!==qf||!(n.wrap<=0)&&(2===n.wrap?(d(n,255&e.adler),d(n,e.adler>>8&255),d(n,e.adler>>16&255),d(n,e.adler>>24&255),d(n,255&e.total_in),d(n,e.total_in>>8&255),d(n,e.total_in>>16&255),d(n,e.total_in>>24&255)):(df(n,e.adler>>>16),df(n,65535&e.adler)),uh(e),0<n.wrap&&(n.wrap=-n.wrap),0!==n.pending)?Gf:Zf}function mh(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var n=t.shift();if(n){if("object"!==_(n))throw new TypeError(n+"must be non-object");for(var r in n)wh(n,r)&&(e[r]=n[r])}}return e}function vh(e){for(var t=0,n=0,r=e.length;n<r;n++)t+=e[n].length;for(var i=new Uint8Array(t),o=0,s=0,a=e.length;o<a;o++){var l=e[o];i.set(l,s),s+=l.length}return i}var gh=function(e){var t;return!e||!(t=e.state)||t.strm!==e||42!==t.status&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&113!==t.status&&666!==t.status?1:0},yh=function(e){var t=(e=>{if(gh(e))return ih(e,Jf);e.total_in=e.total_out=0,e.data_type=nh;var t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=2===t.wrap?57:t.wrap?42:113,e.adler=2===t.wrap?0:1,t.last_flush=-2,Uf(t),Gf})(e);return t===Gf&&((e=e.state).window_size=2*e.w_size,oh(e.head),e.max_lazy_match=fh[e.level].max_lazy,e.good_match=fh[e.level].good_length,e.nice_match=fh[e.level].nice_length,e.max_chain_length=fh[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),t},wh=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},bh=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(w){bh=!1}for(var kh=new Uint8Array(256),_h=0;_h<256;_h++)kh[_h]=252<=_h?6:248<=_h?5:240<=_h?4:224<=_h?3:192<=_h?2:1;function Sh(e){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);for(var t,n,r,i,o=e.length,s=0,a=0;a<o;a++)55296==(64512&(n=e.charCodeAt(a)))&&a+1<o&&56320==(64512&(r=e.charCodeAt(a+1)))&&(n=65536+(n-55296<<10)+(r-56320),a++),s+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Uint8Array(s),a=i=0;i<s;a++)55296==(64512&(n=e.charCodeAt(a)))&&a+1<o&&56320==(64512&(r=e.charCodeAt(a+1)))&&(n=65536+(n-55296<<10)+(r-56320),a++),n<128?t[i++]=n:(n<2048?t[i++]=192|n>>>6:(n<65536?t[i++]=224|n>>>12:(t[i++]=240|n>>>18,t[i++]=128|n>>>12&63),t[i++]=128|n>>>6&63),t[i++]=128|63&n);return t}function Eh(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}kh[254]=kh[255]=1;var Ch=Object.prototype.toString,Rh=i.Z_NO_FLUSH,Th=i.Z_SYNC_FLUSH,Oh=i.Z_FULL_FLUSH,xh=i.Z_FINISH,Ih=i.Z_OK,Mh=i.Z_STREAM_END,Ah={level:i.Z_DEFAULT_COMPRESSION,method:i.Z_DEFLATED,chunkSize:16384,windowBits:15,memLevel:8,strategy:i.Z_DEFAULT_STRATEGY,legacyHash:!0};function Ph(e){this.options=mh({},Ah,e||{});e=this.options;e.raw&&0<e.windowBits?e.windowBits=-e.windowBits:e.gzip&&0<e.windowBits&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Eh,this.strm.avail_out=0;var t,n=((e,t,n,r,i,o,s)=>{if(!e)return Jf;var a=1;if(t===Xf&&(t=6),r<0?(a=0,r=-r):15<r&&(a=2,r-=16),i<1||9<i||n!==rh||r<8||15<r||t<0||9<t||o<0||th<o||8===r&&1!==a)return ih(e,Jf);8===r&&(r=9);var l=new hh;return(e.state=l).strm=e,l.status=42,l.wrap=a,l.gzhead=null,l.w_bits=r,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.legacy_hash=s?1:0,l.hash_bits=i+7,!l.legacy_hash&&l.hash_bits<15&&(l.hash_bits=15),l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+3-1)/3),l.window=new Uint8Array(2*l.w_size),l.head=new Uint16Array(l.hash_size),l.prev=new Uint16Array(l.w_size),l.lit_bufsize=1<<i+6,l.pending_buf_size=4*l.lit_bufsize,l.pending_buf=new Uint8Array(l.pending_buf_size),l.sym_buf=l.lit_bufsize,l.sym_end=3*(l.lit_bufsize-1),l.level=t,l.strategy=o,l.method=n,yh(e)})(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy,e.legacyHash);if(n!==Ih)throw new Error(Ff[n]);if(e.header&&(r=this.strm,t=e.header,gh(r)||2!==r.state.wrap||(r.state.gzhead=t)),e.dictionary){var r="string"==typeof e.dictionary?Sh(e.dictionary):"[object ArrayBuffer]"===Ch.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary;if((n=((e,t)=>{var n=t.length;if(gh(e))return Jf;var r=e.state,i=r.wrap;if(2===i||1===i&&42!==r.status||r.lookahead)return Jf;1===i&&(e.adler=Df(e.adler,t,n,0)),r.wrap=0,r.w_size<=n&&(0===i&&(oh(r.head),r.strstart=0,r.block_start=0,r.insert=0),(o=new Uint8Array(r.w_size)).set(t.subarray(n-r.w_size,n),0),t=o,n=r.w_size);var o=e.avail_in,s=e.next_in,a=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,hf(r);3<=r.lookahead;){for(var l=r.strstart,u=r.lookahead-2;lh(r,l),l++,--u;);r.strstart=l,r.lookahead=2,hf(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=s,e.input=a,e.avail_in=o,r.wrap=i,Gf})(this.strm,r))!==Ih)throw new Error(Ff[n]);this._dict_set=!0}}function Dh(e,t){t=new Ph(t);if(t.push(e,!0),t.err)throw t.msg||Ff[t.err];return t.result}function Lh(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}Ph.prototype.push=function(e,t){var n,r,i,o,s=this.strm,a=this.options.chunkSize;if(this.ended)return!1;for(r=t===~~t?t:!0===t?xh:Rh,"string"==typeof e?s.input=Sh(e):"[object ArrayBuffer]"===Ch.call(e)?s.input=new Uint8Array(e):s.input=e,s.next_in=0,s.avail_in=s.input.length;;)if(0===s.avail_out&&(s.output=new Uint8Array(a),s.next_out=0,s.avail_out=a),(r===Th||r===Oh)&&s.avail_out<=6)this.onData(s.output.subarray(0,s.next_out)),s.avail_out=0;else{if((n=ph(s,r))===Mh)return 0<s.next_out&&this.onData(s.output.subarray(0,s.next_out)),i=this.strm,o=void 0,n=gh(i)?Jf:(o=i.state.status,i.state=null,113===o?ih(i,Kf):Gf),this.onEnd(n),this.ended=!0,n===Ih;if(0!==s.avail_out){if(0<r&&0<s.next_out)this.onData(s.output.subarray(0,s.next_out)),s.avail_out=0;else if(0===s.avail_in)break}else this.onData(s.output)}return!0},Ph.prototype.onData=function(e){this.chunks.push(e)},Ph.prototype.onEnd=function(e){e===Ih&&(this.result=vh(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var Nh={Deflate:Ph,deflate:Dh,deflateRaw:function(e,t){return(t=t||{}).raw=!0,Dh(e,t)},gzip:function(e,t){return(t=t||{}).gzip=!0,Dh(e,t)},constants:i},Fh=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Uh=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,199,75]),zh=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),Bh=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),jh=function(e,t,n,r,i,o,s,a){for(var l,u,c,d,f,h,p,m,v,g=a.bits,y=0,w=0,b=0,k=0,_=0,S=0,E=0,C=0,R=0,T=0,O=null,x=new Uint16Array(16),I=new Uint16Array(16),M=null,y=0;y<=15;y++)x[y]=0;for(w=0;w<r;w++)x[t[n+w]]++;for(_=g,k=15;1<=k&&0===x[k];k--);if(k<_&&(_=k),0===k)i[o++]=20971520,i[o++]=20971520,a.bits=1;else{for(b=1;b<k&&0===x[b];b++);for(_<b&&(_=b),y=C=1;y<=15;y++)if((C=(C<<1)-x[y])<0)return-1;if(0<C&&(0===e||1!==k))return-1;for(I[1]=0,y=1;y<15;y++)I[y+1]=I[y]+x[y];for(w=0;w<r;w++)0!==t[n+w]&&(s[I[t[n+w]]++]=w);if(h=0===e?(O=M=s,20):1===e?(O=Fh,M=Uh,257):(O=zh,M=Bh,0),y=b,f=o,E=w=T=0,c=-1,d=(R=1<<(S=_))-1,1===e&&852<R||2===e&&592<R)return 1;for(;;){for(v=s[w]+1<h?(m=0,s[w]):s[w]>=h?(m=M[s[w]-h],O[s[w]-h]):(m=96,0),l=1<<(p=y-E),b=u=1<<S;i[f+(T>>E)+(u-=l)]=p<<24|m<<16|v|0,0!==u;);for(l=1<<y-1;T&l;)l>>=1;if(0!==l?T=(T&l-1)+l:T=0,w++,0==--x[y]){if(y===k)break;y=t[n+s[w]]}if(_<y&&(T&d)!==c){for(f+=b,C=1<<(S=y-(E=0===E?_:E));S+E<k&&!((C-=x[S+E])<=0);)S++,C<<=1;if(R+=1<<S,1===e&&852<R||2===e&&592<R)return 1;i[c=T&d]=_<<24|S<<16|f-o|0}}0!==T&&(i[f+T]=y-E<<24|64<<16|0),a.bits=_}return 0},Wh=i.Z_FINISH,Hh=i.Z_BLOCK,qh=i.Z_TREES,Vh=i.Z_OK,Gh=i.Z_STREAM_END,Zh=i.Z_NEED_DICT,Jh=i.Z_STREAM_ERROR,Kh=i.Z_DATA_ERROR,$h=i.Z_MEM_ERROR,Xh=i.Z_BUF_ERROR,Yh=i.Z_DEFLATED,ie=16209;function Qh(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function ep(e,N){var t,n,F,r,i,o,s,a,l,U,u,c,z,B,d,f,h,p,j,W,m,v,g,y,w=0,b=new Uint8Array(4),H=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(sp(e)||!e.output||!e.input&&0!==e.avail_in)return Jh;16191===(t=e.state).mode&&(t.mode=16192),i=e.next_out,F=e.output,r=e.next_in,n=e.input,a=t.hold,l=t.bits,U=o=e.avail_in,u=s=e.avail_out,v=Vh;e:for(;;)switch(t.mode){case 16180:if(0===t.wrap)t.mode=16192;else{for(;l<16;){if(0===o)break e;o--,a+=n[r++]<<l,l+=8}2&t.wrap&&35615===a?(0===t.wbits&&(t.wbits=15),b[t.check=0]=255&a,b[1]=a>>>8&255,t.check=Nf(t.check,b,2,0),l=a=0,t.mode=16181):(t.head&&(t.head.done=!1),!(1&t.wrap)||(((255&a)<<8)+(a>>8))%31?(e.msg="incorrect header check",t.mode=ie):(15&a)!==Yh?(e.msg="unknown compression method",t.mode=ie):(l-=4,m=8+(15&(a>>>=4)),0===t.wbits&&(t.wbits=m),15<m||m>t.wbits?(e.msg="invalid window size",t.mode=ie):(t.dmax=1<<t.wbits,t.flags=0,e.adler=t.check=1,t.mode=512&a?16189:16191,l=a=0)))}break;case 16181:for(;l<16;){if(0===o)break e;o--,a+=n[r++]<<l,l+=8}if(t.flags=a,(255&t.flags)!==Yh){e.msg="unknown compression method",t.mode=ie;break}if(57344&t.flags){e.msg="unknown header flags set",t.mode=ie;break}t.head&&(t.head.text=a>>8&1),512&t.flags&&4&t.wrap&&(b[0]=255&a,b[1]=a>>>8&255,t.check=Nf(t.check,b,2,0)),l=a=0,t.mode=16182;case 16182:for(;l<32;){if(0===o)break e;o--,a+=n[r++]<<l,l+=8}t.head&&(t.head.time=a),512&t.flags&&4&t.wrap&&(b[0]=255&a,b[1]=a>>>8&255,b[2]=a>>>16&255,b[3]=a>>>24&255,t.check=Nf(t.check,b,4,0)),l=a=0,t.mode=16183;case 16183:for(;l<16;){if(0===o)break e;o--,a+=n[r++]<<l,l+=8}t.head&&(t.head.xflags=255&a,t.head.os=a>>8),512&t.flags&&4&t.wrap&&(b[0]=255&a,b[1]=a>>>8&255,t.check=Nf(t.check,b,2,0)),l=a=0,t.mode=16184;case 16184:if(1024&t.flags){for(;l<16;){if(0===o)break e;o--,a+=n[r++]<<l,l+=8}t.length=a,t.head&&(t.head.extra_len=a),512&t.flags&&4&t.wrap&&(b[0]=255&a,b[1]=a>>>8&255,t.check=Nf(t.check,b,2,0)),l=a=0}else t.head&&(t.head.extra=null);t.mode=16185;case 16185:if(1024&t.flags&&((c=(c=t.length)>o?o:c)&&(t.head&&(m=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(n.subarray(r,r+c),m)),512&t.flags&&4&t.wrap&&(t.check=Nf(t.check,n,c,r)),o-=c,r+=c,t.length-=c),t.length))break e;t.length=0,t.mode=16186;case 16186:if(2048&t.flags){if(0===o)break e;for(c=0;m=n[r+c++],t.head&&m&&t.length<65536&&(t.head.name+=String.fromCharCode(m)),m&&c<o;);if(512&t.flags&&4&t.wrap&&(t.check=Nf(t.check,n,c,r)),o-=c,r+=c,m)break e}else t.head&&(t.head.name=null);t.length=0,t.mode=16187;case 16187:if(4096&t.flags){if(0===o)break e;for(c=0;m=n[r+c++],t.head&&m&&t.length<65536&&(t.head.comment+=String.fromCharCode(m)),m&&c<o;);if(512&t.flags&&4&t.wrap&&(t.check=Nf(t.check,n,c,r)),o-=c,r+=c,m)break e}else t.head&&(t.head.comment=null);t.mode=16188;case 16188:if(512&t.flags){for(;l<16;){if(0===o)break e;o--,a+=n[r++]<<l,l+=8}if(4&t.wrap&&a!==(65535&t.check)){e.msg="header crc mismatch",t.mode=ie;break}l=a=0}t.head&&(t.head.hcrc=t.flags>>9&1,t.head.done=!0),e.adler=t.check=0,t.mode=16191;break;case 16189:for(;l<32;){if(0===o)break e;o--,a+=n[r++]<<l,l+=8}e.adler=t.check=Lh(a),l=a=0,t.mode=16190;case 16190:if(0===t.havedict)return e.next_out=i,e.avail_out=s,e.next_in=r,e.avail_in=o,t.hold=a,t.bits=l,Zh;e.adler=t.check=1,t.mode=16191;case 16191:if(N===Hh||N===qh)break e;case 16192:if(t.last)a>>>=7&l,l-=7&l,t.mode=16206;else{for(;l<3;){if(0===o)break e;o--,a+=n[r++]<<l,l+=8}switch(t.last=1&a,--l,3&(a>>>=1)){case 0:t.mode=16193;break;case 1:_=k=void 0;var k=t;if(lp){ip=new Int32Array(512),op=new Int32Array(32);for(var _=0;_<144;)k.lens[_++]=8;for(;_<256;)k.lens[_++]=9;for(;_<280;)k.lens[_++]=7;for(;_<288;)k.lens[_++]=8;for(jh(1,k.lens,0,288,ip,0,k.work,{bits:9}),_=0;_<32;)k.lens[_++]=5;jh(2,k.lens,0,32,op,0,k.work,{bits:5}),lp=!1}if(k.lencode=ip,k.lenbits=9,k.distcode=op,k.distbits=5,t.mode=16199,N!==qh)break;a>>>=2,l-=2;break e;case 2:t.mode=16196;break;case 3:e.msg="invalid block type",t.mode=ie}a>>>=2,l-=2}break;case 16193:for(a>>>=7&l,l-=7&l;l<32;){if(0===o)break e;o--,a+=n[r++]<<l,l+=8}if((65535&a)!=(a>>>16^65535)){e.msg="invalid stored block lengths",t.mode=ie;break}if(t.length=65535&a,l=a=0,t.mode=16194,N===qh)break e;case 16194:t.mode=16195;case 16195:if(c=t.length){if(0===(c=s<(c=o<c?o:c)?s:c))break e;F.set(n.subarray(r,r+c),i),o-=c,r+=c,s-=c,i+=c,t.length-=c}else t.mode=16191;break;case 16196:for(;l<14;){if(0===o)break e;o--,a+=n[r++]<<l,l+=8}if(t.nlen=257+(31&a),a>>>=5,l-=5,t.ndist=1+(31&a),a>>>=5,l-=5,t.ncode=4+(15&a),a>>>=4,l-=4,286<t.nlen||30<t.ndist){e.msg="too many length or distance symbols",t.mode=ie;break}t.have=0,t.mode=16197;case 16197:for(;t.have<t.ncode;){for(;l<3;){if(0===o)break e;o--,a+=n[r++]<<l,l+=8}t.lens[H[t.have++]]=7&a,a>>>=3,l-=3}for(;t.have<19;)t.lens[H[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,g={bits:t.lenbits},v=jh(0,t.lens,0,19,t.lencode,0,t.work,g),t.lenbits=g.bits,v){e.msg="invalid code lengths set",t.mode=ie;break}t.have=0,t.mode=16198;case 16198:for(;t.have<t.nlen+t.ndist;){for(;f=(w=t.lencode[a&(1<<t.lenbits)-1])>>>16&255,h=65535&w,!((d=w>>>24)<=l);){if(0===o)break e;o--,a+=n[r++]<<l,l+=8}if(h<16)a>>>=d,l-=d,t.lens[t.have++]=h;else{if(16===h){for(y=d+2;l<y;){if(0===o)break e;o--,a+=n[r++]<<l,l+=8}if(a>>>=d,l-=d,0===t.have){e.msg="invalid bit length repeat",t.mode=ie;break}m=t.lens[t.have-1],c=3+(3&a),a>>>=2,l-=2}else if(17===h){for(y=d+3;l<y;){if(0===o)break e;o--,a+=n[r++]<<l,l+=8}m=0,c=3+(7&(a>>>=d)),a>>>=3,l=l-d-3}else{for(y=d+7;l<y;){if(0===o)break e;o--,a+=n[r++]<<l,l+=8}m=0,c=11+(127&(a>>>=d)),a>>>=7,l=l-d-7}if(t.have+c>t.nlen+t.ndist){e.msg="invalid bit length repeat",t.mode=ie;break}for(;c--;)t.lens[t.have++]=m}}if(t.mode===ie)break;if(0===t.lens[256]){e.msg="invalid code -- missing end-of-block",t.mode=ie;break}if(t.lenbits=9,g={bits:t.lenbits},v=jh(1,t.lens,0,t.nlen,t.lencode,0,t.work,g),t.lenbits=g.bits,v){e.msg="invalid literal/lengths set",t.mode=ie;break}if(t.distbits=6,t.distcode=t.distdyn,g={bits:t.distbits},v=jh(2,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,g),t.distbits=g.bits,v){e.msg="invalid distances set",t.mode=ie;break}if(t.mode=16199,N===qh)break e;case 16199:t.mode=16200;case 16200:if(6<=o&&258<=s){e.next_out=i,e.avail_out=s,e.next_in=r,e.avail_in=o,t.hold=a,t.bits=l,I=P=V=O=T=R=C=E=S=re=ne=te=ee=L=D=Q=Y=X=$=K=J=Z=A=G=M=q=x=void 0;var S,E,C,R,T,O,x=e,q=u,I=x.state,M=x.next_in,V=x.input,G=M+(x.avail_in-5),A=x.next_out,P=x.output,Z=A-(q-x.avail_out),J=A+(x.avail_out-257),K=I.dmax,$=I.wsize,X=I.whave,Y=I.wnext,Q=I.window,D=I.hold,L=I.bits,ee=I.lencode,te=I.distcode,ne=(1<<I.lenbits)-1,re=(1<<I.distbits)-1;t:do{for(L<15&&(D+=V[M++]<<L,L+=8,D+=V[M++]<<L,L+=8),S=ee[D&ne];;){if(D>>>=E=S>>>24,L-=E,0==(E=S>>>16&255))P[A++]=65535&S;else{if(!(16&E)){if(0==(64&E)){S=ee[(65535&S)+(D&(1<<E)-1)];continue}if(32&E){I.mode=16191;break t}x.msg="invalid literal/length code",I.mode=16209;break t}for(C=65535&S,(E&=15)&&(L<E&&(D+=V[M++]<<L,L+=8),C+=D&(1<<E)-1,D>>>=E,L-=E),L<15&&(D+=V[M++]<<L,L+=8,D+=V[M++]<<L,L+=8),S=te[D&re];;){if(D>>>=E=S>>>24,L-=E,!(16&(E=S>>>16&255))){if(0==(64&E)){S=te[(65535&S)+(D&(1<<E)-1)];continue}x.msg="invalid distance code",I.mode=16209;break t}if(R=65535&S,L<(E&=15)&&(D+=V[M++]<<L,(L+=8)<E)&&(D+=V[M++]<<L,L+=8),(R+=D&(1<<E)-1)>K){x.msg="invalid distance too far back",I.mode=16209;break t}if(D>>>=E,L-=E,R>(E=A-Z)){if((E=R-E)>X&&I.sane){x.msg="invalid distance too far back",I.mode=16209;break t}if(O=Q,(T=0)===Y){if(T+=$-E,E<C){for(C-=E;P[A++]=Q[T++],--E;);T=A-R,O=P}}else if(Y<E){if(T+=$+Y-E,(E-=Y)<C){for(C-=E;P[A++]=Q[T++],--E;);if(T=0,Y<C){for(C-=E=Y;P[A++]=Q[T++],--E;);T=A-R,O=P}}}else if(T+=Y-E,E<C){for(C-=E;P[A++]=Q[T++],--E;);T=A-R,O=P}for(;2<C;)P[A++]=O[T++],P[A++]=O[T++],P[A++]=O[T++],C-=3;C&&(P[A++]=O[T++],1<C)&&(P[A++]=O[T++])}else{for(T=A-R;P[A++]=P[T++],P[A++]=P[T++],P[A++]=P[T++],2<(C-=3););C&&(P[A++]=P[T++],1<C)&&(P[A++]=P[T++])}break}}break}}while(M<G&&A<J);M-=C=L>>3,D&=(1<<(L-=C<<3))-1,x.next_in=M,x.next_out=A,x.avail_in=M<G?G-M+5:5-(M-G),x.avail_out=A<J?J-A+257:257-(A-J),I.hold=D,I.bits=L,i=e.next_out,F=e.output,s=e.avail_out,r=e.next_in,n=e.input,o=e.avail_in,a=t.hold,l=t.bits,16191===t.mode&&(t.back=-1);break}for(t.back=0;f=(w=t.lencode[a&(1<<t.lenbits)-1])>>>16&255,h=65535&w,!((d=w>>>24)<=l);){if(0===o)break e;o--,a+=n[r++]<<l,l+=8}if(f&&0==(240&f)){for(p=d,j=f,W=h;f=(w=t.lencode[W+((a&(1<<p+j)-1)>>p)])>>>16&255,h=65535&w,!(p+(d=w>>>24)<=l);){if(0===o)break e;o--,a+=n[r++]<<l,l+=8}a>>>=p,l-=p,t.back+=p}if(a>>>=d,l-=d,t.back+=d,t.length=h,0===f){t.mode=16205;break}if(32&f){t.back=-1,t.mode=16191;break}if(64&f){e.msg="invalid literal/length code",t.mode=ie;break}t.extra=15&f,t.mode=16201;case 16201:if(t.extra){for(y=t.extra;l<y;){if(0===o)break e;o--,a+=n[r++]<<l,l+=8}t.length+=a&(1<<t.extra)-1,a>>>=t.extra,l-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=16202;case 16202:for(;f=(w=t.distcode[a&(1<<t.distbits)-1])>>>16&255,h=65535&w,!((d=w>>>24)<=l);){if(0===o)break e;o--,a+=n[r++]<<l,l+=8}if(0==(240&f)){for(p=d,j=f,W=h;f=(w=t.distcode[W+((a&(1<<p+j)-1)>>p)])>>>16&255,h=65535&w,!(p+(d=w>>>24)<=l);){if(0===o)break e;o--,a+=n[r++]<<l,l+=8}a>>>=p,l-=p,t.back+=p}if(a>>>=d,l-=d,t.back+=d,64&f){e.msg="invalid distance code",t.mode=ie;break}t.offset=h,t.extra=15&f,t.mode=16203;case 16203:if(t.extra){for(y=t.extra;l<y;){if(0===o)break e;o--,a+=n[r++]<<l,l+=8}t.offset+=a&(1<<t.extra)-1,a>>>=t.extra,l-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){e.msg="invalid distance too far back",t.mode=ie;break}t.mode=16204;case 16204:if(0===s)break e;if(t.offset>(c=u-s)){if((c=t.offset-c)>t.whave&&t.sane){e.msg="invalid distance too far back",t.mode=ie;break}z=c>t.wnext?(c-=t.wnext,t.wsize-c):t.wnext-c,c>t.length&&(c=t.length),B=t.window}else B=F,z=i-t.offset,c=t.length;for(s-=c=s<c?s:c,t.length-=c;F[i++]=B[z++],--c;);0===t.length&&(t.mode=16200);break;case 16205:if(0===s)break e;F[i++]=t.length,s--,t.mode=16200;break;case 16206:if(t.wrap){for(;l<32;){if(0===o)break e;o--,a|=n[r++]<<l,l+=8}if(u-=s,e.total_out+=u,t.total+=u,4&t.wrap&&u&&(e.adler=t.check=(t.flags?Nf:Df)(t.check,F,u,i-u)),u=s,4&t.wrap&&(t.flags?a:Lh(a))!==t.check){e.msg="incorrect data check",t.mode=ie;break}l=a=0}t.mode=16207;case 16207:if(t.wrap&&t.flags){for(;l<32;){if(0===o)break e;o--,a+=n[r++]<<l,l+=8}if(4&t.wrap&&a!==(4294967295&t.total)){e.msg="incorrect length check",t.mode=ie;break}l=a=0}t.mode=16208;case 16208:v=Gh;break e;case ie:v=Kh;break e;case 16210:return $h;default:return Jh}return e.next_out=i,e.avail_out=s,e.next_in=r,e.avail_in=o,t.hold=a,t.bits=l,(t.wsize||u!==e.avail_out&&t.mode<ie&&(t.mode<16206||N!==Wh))&&up(e,e.output,e.next_out,u-e.avail_out),u-=e.avail_out,e.total_in+=U-=e.avail_in,e.total_out+=u,t.total+=u,4&t.wrap&&u&&(e.adler=t.check=(t.flags?Nf:Df)(t.check,F,u,e.next_out-u)),e.data_type=t.bits+(t.last?64:0)+(16191===t.mode?128:0)+(16199===t.mode||16194===t.mode?256:0),v=(0==U&&0===u||N===Wh)&&v===Vh?Xh:v}function tp(e){var t;return sp(e)?Jh:((t=e.state).window&&(t.window=null),e.state=null,Vh)}function np(e,t){var n,r=t.length;return sp(e)||0!==(n=e.state).wrap&&16190!==n.mode?Jh:16190===n.mode&&Df(1,t,r,0)!==n.check?Kh:up(e,t,r,r)?(n.mode=16210,$h):(n.havedict=1,Vh)}function rp(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var ip,op,sp=function(e){var t;return!e||!(t=e.state)||t.strm!==e||t.mode<16180||16211<t.mode?1:0},ap=function(e){var t;return sp(e)||((t=e.state).wsize=0,t.whave=0,t.wnext=0,sp(t=e))?Jh:(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=16180,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,Vh)},lp=!0,up=function(e,t,n,r){var i,e=e.state;return null===e.window&&(e.window=new Uint8Array(1<<e.wbits)),0===e.wsize&&(e.wsize=1<<e.wbits,e.wnext=0,e.whave=0),e.wsize<=r?(e.window.set(t.subarray(n-e.wsize,n),0),e.wnext=0,e.whave=e.wsize):((i=e.wsize-e.wnext)>r&&(i=r),e.window.set(t.subarray(n-r,n-r+i),e.wnext),(r-=i)?(e.window.set(t.subarray(n-r,n),0),e.wnext=r,e.whave=e.wsize):(e.wnext+=i,e.wnext===e.wsize&&(e.wnext=0),e.whave<e.wsize&&(e.whave+=i))),0},cp=ap,dp=Object.prototype.toString,fp=i.Z_NO_FLUSH,hp=i.Z_FINISH,pp=i.Z_OK,mp=i.Z_STREAM_END,vp=i.Z_NEED_DICT,gp=i.Z_STREAM_ERROR,yp=i.Z_DATA_ERROR,wp=i.Z_MEM_ERROR,bp=i.Z_BUF_ERROR,kp={chunkSize:65536,windowBits:15,to:""};function _p(e){this.options=mh({},kp,e||{});var t,n,r,i=this.options,o=(i.raw&&0<=i.windowBits&&i.windowBits<16&&(i.windowBits=-i.windowBits,0===i.windowBits)&&(i.windowBits=-15),!(0<=i.windowBits&&i.windowBits<16)||e&&e.windowBits||(i.windowBits+=32),15<i.windowBits&&i.windowBits<48&&0==(15&i.windowBits)&&(i.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Eh,this.strm.avail_out=0,e=this.strm,r=i.windowBits,e?(o=new Qh,(e.state=o).strm=e,o.window=null,o.mode=16180,o=r,(n=sp(r=e)||(n=r.state,o<0?(t=0,o=-o):(t=5+(o>>4),o<48&&(o&=15)),o&&(o<8||15<o))?Jh:(null!==n.window&&n.wbits!==o&&(n.window=null),n.wrap=t,n.wbits=o,ap(r)))!==Vh&&(e.state=null),n):Jh);if(o!==pp)throw new Error(Ff[o]);if(this.header=new rp,r=this.strm,e=this.header,sp(r)||0!=(2&(r=r.state).wrap)&&((r.head=e).done=!1),i.dictionary&&("string"==typeof i.dictionary?i.dictionary=Sh(i.dictionary):"[object ArrayBuffer]"===dp.call(i.dictionary)&&(i.dictionary=new Uint8Array(i.dictionary)),i.raw)&&(o=np(this.strm,i.dictionary))!==pp)throw new Error(Ff[o])}function Sp(e,t){t=new _p(t);if(t.push(e,!0),t.err)throw t.msg||Ff[t.err];return t.result}_p.prototype.push=function(e,t){var n,r,i=this.strm,o=this.options.chunkSize,s=this.options.dictionary;if(this.ended)return!1;for(r=t===~~t?t:!0===t?hp:fp,"[object ArrayBuffer]"===dp.call(e)?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;;){for(0===i.avail_out&&(i.output=new Uint8Array(o),i.next_out=0,i.avail_out=o),(n=ep(i,r))===vp&&s&&((n=np(i,s))===pp?n=ep(i,r):n===yp&&(n=vp));0<i.avail_in&&n===mp&&2&i.state.wrap&&0!==i.state.flags&&0!==i.input[i.next_in];)cp(i),n=ep(i,r);switch(n){case gp:case yp:case vp:case wp:return this.onEnd(n),!(this.ended=!0)}var a,l,u,c=i.avail_out;if(i.next_out&&(0===i.avail_out||n===mp||0<r)&&("string"===this.options.to?(a=((e,t)=>{for(var n=(t=(t=t||e.length)>e.length?e.length:t)-1;0<=n&&128==(192&e[n]);)n--;return!(n<0||0===n)&&n+kh[e[n]]>t?n:t})(i.output,i.next_out),l=i.next_out-a,u=((e,t)=>{var n=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));for(var r=new Array(2*n),i=0,o=0;o<n;){var s=e[o++];if(s<128)r[i++]=s;else{var a=kh[s];if(4<a)r[i++]=65533,o+=a-1;else{for(s&=2===a?31:3===a?15:7;1<a&&o<n;)s=s<<6|63&e[o++],a--;1<a?r[i++]=65533:s<65536?r[i++]=s:(s-=65536,r[i++]=55296|s>>10&1023,r[i++]=56320|1023&s)}}}var l=r,u=i;if(u<65534&&l.subarray&&bh)return String.fromCharCode.apply(null,l.length===u?l:l.subarray(0,u));for(var c="",d=0;d<u;d++)c+=String.fromCharCode(l[d]);return c})(i.output,a),i.next_out=l,i.avail_out=o-l,l&&i.output.set(i.output.subarray(a,a+l),0),this.onData(u)):(this.onData(i.output.length===i.next_out?i.output:i.output.subarray(0,i.next_out)),i.avail_out=0,i.next_out=0)),n!==pp&&n!==bp||0!==c){if(n===mp)return n=tp(this.strm),this.onEnd(n),this.ended=!0;if(0===i.avail_in){if(r===hp)return n=tp(this.strm),this.onEnd(n===pp?bp:n),!(this.ended=!0);break}}}return!0},_p.prototype.onData=function(e){this.chunks.push(e)},_p.prototype.onEnd=function(e){e===pp&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=vh(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var Ep,a={Inflate:_p,inflate:Sp,inflateRaw:function(e,t){return(t=t||{}).raw=!0,Sp(e,t)},ungzip:Sp,constants:i},Cp={Deflate:Nh.Deflate,deflate:Nh.deflate,deflateRaw:Nh.deflateRaw,gzip:Nh.gzip,Inflate:a.Inflate,inflate:a.inflate,inflateRaw:a.inflateRaw,ungzip:a.ungzip,constants:i},Rp=(T(Mp,Ep=Error),Mp),Tp=(Ip.prototype.uploadReplay=function(t){return D(this,void 0,void 0,function(){return L(this,function(e){switch(e.label){case 0:return[4,this.uploadReplayResult(t)];case 1:return[2,"success"===e.sent().status]}})})},Ip.prototype.uploadReplayResult=function(i){return D(this,void 0,void 0,function(){var t,n,r;return L(this,function(e){switch(e.label){case 0:if(this.isUploading)return[2,{status:"busy",attempts:0}];this.isUploading=!0,t=0,e.label=1;case 1:if(e.trys.push([1,9,10,11]),!(n=this.config.beforeSend(i)))return[2,{status:"cancelled",attempts:t}];if((!n.replay_format||"rrweb"===n.replay_format)&&"gzip_base64"!==n.events_encoding&&5242880<Di(n.events))throw new Rp("Segment exceeds decoded events limit");e.label=2;case 2:e.label=3;case 3:return e.trys.push([3,5,,7]),t++,[4,this.doUpload(n)];case 4:return e.sent(),[2,{status:"success",attempts:t}];case 5:if((r=e.sent()).permanent||t>this.config.maxRetries)throw r;return r=1e3*Math.pow(2,t-1),u("Uploader","Retrying segment "+i.segment_id+" in "+r+"ms"),[4,this.sleep(r)];case 6:return e.sent(),[3,7];case 7:return[3,2];case 8:return[3,11];case 9:Oi("Uploader","Upload failed:",r=e.sent());try{this.config.onError(r)}catch(e){Ti("Uploader","onError callback failed:",e)}return[2,{status:r.permanent?"rejected":"exhausted",attempts:t}];case 10:return this.isUploading=!1,[7];case 11:return[2]}})})},Ip.prototype.prepareUploadPayload=function(e){var t=e.replay_format||"rrweb",n=e.events_encoding||"plain_json";if("rrweb"!==t)return e;if(!this.config.eventsCompression||"gzip_base64"===n)return I(I({},e),{replay_format:t,platform:e.platform||"web",events_encoding:n});try{var r=Cp.gzip(e.events),i=this.uint8ArrayToBase64(r),o=e.events.length,s=r.length,a=i.length;return u("Uploader","Events compressed: "+Math.round(o/1024)+"KB -> gzip "+Math.round(s/1024)+"KB -> base64 "+Math.round(a/1024)+"KB"),I(I({},e),{replay_format:t,platform:e.platform||"web",events_encoding:"gzip_base64",events:i})}catch(n){return Ti("Uploader","Events compression failed, fallback to plain_json:",n),I(I({},e),{replay_format:t,platform:e.platform||"web",events_encoding:"plain_json"})}},Ip.prototype.uint8ArrayToBase64=function(e){for(var t="",n=0;n<e.length;n+=32768){for(var r=e.subarray(n,n+32768),i="",o=0;o<r.length;o++)i+=String.fromCharCode(r[o]);t+=i}if("function"==typeof btoa)return btoa(t);if("undefined"!=typeof Buffer)return Buffer.from(e).toString("base64");throw new Error("base64 encode is not supported")},Ip.prototype.doUpload=function(s){return D(this,void 0,void 0,function(){var t,n,r,i,o;return L(this,function(e){switch(e.label){case 0:if(t=this.prepareUploadPayload(s),o=JSON.stringify(t),n={"Content-Type":"application/json","X-App-ID":this.config.appId},u("Uploader","Sending replay payload: "+Math.round(o.length/1024)+"KB, events_encoding="+(t.events_encoding||"plain_json")),o.length<65536||u("Uploader","Data size "+Math.round(o.length/1024)+"KB exceeds keepalive limit, using normal fetch"),this.config.transport)return[4,this.config.transport.request({kind:"replay",url:this.config.uploadUrl,method:"POST",headers:n,body:o,retry:!1})];throw new Error("Replay Transport is not configured");case 1:t=e.sent(),n=t||{ok:!1,status:0,statusText:"Transport failed"};try{i="string"==typeof n.body?JSON.parse(n.body):n.body,r=null==i?void 0:i.code}catch(e){}if(413===n.status||1007===r||1001===r||1006===r)throw new Rp("Replay rejected: HTTP "+(n.status||0)+", code "+(r||0));if(!n.ok)throw new Error("HTTP "+(n.status||0)+": "+(n.statusText||"Transport failed"));if(0!==(o="string"==typeof n.body?JSON.parse(n.body):n.body).code)throw new Error("Server error (code "+o.code+"): "+o.message);return[2]}})})},Ip.prototype.measurePayload=function(e){return Di(this.serializePayload(e))},Ip.prototype.sendBeacon=function(e){var t,n;try{var r,i=this.serializePayload(e);return null!=(t=this.config.transport)&&t.handoff?(r=this.config.transport.handoff({kind:"replay",url:this.config.uploadUrl,method:"POST",contentType:"application/json",body:i,sendBeacon:!0}))&&"function"==typeof r.then?(Ti("Uploader","sendBeacon handoff is async, acceptance is unknown"),!1):!0===(null==(n=r)?void 0:n.handoffAccepted):!1}catch(e){return Oi("Uploader","sendBeacon failed:",e),!1}},Ip.prototype.serializePayload=function(e){return JSON.stringify(this.prepareUploadPayload(e))},Ip.prototype.isUploadInProgress=function(){return this.isUploading},Ip.prototype.sleep=function(t){return new Promise(function(e){return setTimeout(e,t)})},Ip),Op=(xp.prototype.start=function(){this.isRunning||(document.addEventListener("pointerdown",this.handlePointerDown,!0),document.addEventListener("click",this.handleClick,!0),document.addEventListener("visibilitychange",this.onVisibility),window.addEventListener("pagehide",this.closeRage),window.addEventListener("beforeunload",this.closeRage),this.isRunning=!0,u("ClickDetector","Started"))},xp.prototype.stop=function(){this.isRunning&&(document.removeEventListener("pointerdown",this.handlePointerDown,!0),document.removeEventListener("click",this.handleClick,!0),document.removeEventListener("visibilitychange",this.onVisibility),window.removeEventListener("pagehide",this.closeRage),window.removeEventListener("beforeunload",this.closeRage),this.cleanupSlowClick(),this.finishRage(),this.isRunning=!1,u("ClickDetector","Stopped"))},xp.prototype.handlePointerDown=function(e){var t=this,n=e.target;n&&n instanceof Element&&(n=Ln(n),this.cleanupSlowClick(),this.clickStartTime=Date.now(),this.clickNode=n,(e=this.getExternalNavigationReason(e,n))?"custom"!==e?this.markEffectiveAction(e):this.cleanupSlowClick():(this.slowClickTimeoutId=setTimeout(function(){t.handleSlowClick("timeout")},this.options.slowClickTimeout),this.startMutationObserver()))},xp.prototype.handleClick=function(e){var t,n,r,i=this;e.target instanceof Element&&(r=Ln(e.target),t=Date.now(),e={node:this.getNodeInfo(r),target:r,event:e,timestamp:t,effectiveActionReason:this.getExternalNavigationReason(e,r)||void 0},this.cleanupSlowClick(),this.clickNode=r,this.clickStartTime=t,this.slowClickTimeoutId=setTimeout(function(){return i.handleSlowClick("timeout")},this.options.slowClickTimeout),this.startMutationObserver(),this.options.onClickStart(e),e.effectiveActionReason&&"custom"!==e.effectiveActionReason&&this.markEffectiveAction(e.effectiveActionReason),n=this.options.getClickContext(),this.rage&&(this.rage.target!==r||this.rage.context!==n||t-this.rage.lastAt>=this.options.rageClickWindow)&&this.finishRage(),r=this.rage||{target:r,context:n,candidates:[],related:[],count:0,lastAt:t},(this.rage=r).lastAt=t,r.anchor?(r.count++,r.related=g(r.related,[e]).slice(-10)):(r.candidates=g(r.candidates,[e]).filter(function(e){return t-e.timestamp<=i.options.rageClickWindow}).slice(-this.options.rageClickCount),r.candidates.length>=this.options.rageClickCount&&(r.anchor=r.candidates[0],r.count=r.candidates.length,r.related=r.candidates,r.candidates=[])),null!==this.rageTimer&&clearTimeout(this.rageTimer),this.rageTimer=setTimeout(function(){return i.finishRage()},this.options.rageClickWindow))},xp.prototype.finishRage=function(){null!==this.rageTimer&&clearTimeout(this.rageTimer),this.rageTimer=null;var e,t=this.rage;(this.rage=null)!=t&&t.anchor&&(e=t.related.includes(t.anchor)?t.related:g([t.anchor],t.related.slice(-9)),this.options.onRageClick({node:t.anchor.node,clickCount:t.count,timeWindowMs:this.options.rageClickWindow,timestamp:t.anchor.timestamp,lastTimestamp:t.lastAt,clicks:e}))},xp.prototype.startMutationObserver=function(){var t=this;this.clickNode&&document.body&&"undefined"!=typeof MutationObserver&&(this.mutationObserver=new MutationObserver(function(e){t.hasSignificantMutation(e)&&(t.emitEffectiveAction("dom_mutation"),t.handleSlowClick("mutation"))}),this.mutationObserver.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class","style","hidden","disabled","aria-hidden","aria-disabled","aria-busy"],characterData:!0}))},xp.prototype.hasSignificantMutation=function(e){for(var t=0,n=e;t<n.length;t++){var r=n[t];if("characterData"===r.type)return!0;if("childList"===r.type&&(0<r.addedNodes.length||0<r.removedNodes.length)&&Array.from(r.addedNodes).concat(Array.from(r.removedNodes)).some(function(e){var t;return e.nodeType===Node.TEXT_NODE&&!(null==(t=e.textContent)||!t.trim())||e.nodeType===Node.ELEMENT_NODE&&!["SCRIPT","STYLE","LINK"].includes(e.tagName)}))return!0;if("attributes"===r.type){r=r.attributeName;if(["class","style","hidden","disabled","aria-hidden","aria-disabled","aria-busy"].includes(r||""))return!0}}return!1},xp.prototype.handleSlowClick=function(e){var t;this.clickNode&&this.clickStartTime&&((t=Date.now()-this.clickStartTime)>=this.options.slowClickThreshold&&this.options.onSlowClick({node:this.getNodeInfo(this.clickNode),timeAfterClickMs:t,endReason:e,timestamp:this.clickStartTime}),this.cleanupSlowClick())},xp.prototype.cleanupSlowClick=function(){this.slowClickTimeoutId&&(clearTimeout(this.slowClickTimeoutId),this.slowClickTimeoutId=null),this.mutationObserver&&(this.mutationObserver.disconnect(),this.mutationObserver=null),this.clickStartTime=0,this.clickNode=null},xp.prototype.markEffectiveAction=function(e){this.clickNode&&this.clickStartTime&&(this.emitEffectiveAction(e),this.cleanupSlowClick())},xp.prototype.emitEffectiveAction=function(e){this.clickNode&&this.options.onEffectiveAction({reason:e,timestamp:Date.now(),node:this.getNodeInfo(this.clickNode)})},xp.prototype.getExternalNavigationReason=function(e,t){var n=t.closest("a");if(n){if(n.download)return"download";var r=(n.getAttribute("target")||"").toLowerCase();if(r&&"_self"!==r)return"external_navigation";if(n.href&&(1===e.button||e.metaKey||e.ctrlKey||e.shiftKey))return"external_navigation"}r=t.closest("form"),n=((null==r?void 0:r.getAttribute("target"))||"").toLowerCase();return n&&"_self"!==n?"external_navigation":t.hasAttribute("data-tdem-ignore-dead-click")||t.closest("[data-tdem-ignore-dead-click]")||t.hasAttribute("data-tdem-effective-action")||t.closest("[data-tdem-effective-action]")?"custom":null},xp.prototype.getNodeInfo=function(e){var t;return{id:(null==(t=e.__sn)?void 0:t.id)||0,tagName:e.tagName.toLowerCase(),textContent:(e.textContent||"").trim().substring(0,100),selector:this.getSelector(e)}},xp.prototype.getSelector=function(e){for(var t=[],n=e;n&&n!==document.body&&t.length<5;){var r,i=n.tagName.toLowerCase();if(n.id){i+="#"+n.id,t.unshift(i);break}n.className&&"string"==typeof n.className&&0<(r=n.className.trim().split(/\s+/).slice(0,2)).length&&(i+="."+r.join(".")),t.unshift(i),n=n.parentElement}return t.join(" > ")},xp.prototype.isActive=function(){return this.isRunning},xp);function xp(e){var t,n=this;void 0===e&&(e={}),this.isRunning=!1,this.clickStartTime=0,this.clickNode=null,this.slowClickTimeoutId=null,this.mutationObserver=null,this.rage=null,this.rageTimer=null,this.closeRage=function(){return n.finishRage()},this.onVisibility=function(){"hidden"===document.visibilityState&&n.finishRage()},this.options={slowClickTimeout:null!=(t=e.slowClickTimeout)?t:7e3,slowClickThreshold:null!=(t=e.slowClickThreshold)?t:3e3,rageClickCount:null!=(t=e.rageClickCount)?t:5,rageClickWindow:null!=(t=e.rageClickWindow)?t:3e3,onSlowClick:e.onSlowClick||function(){},onRageClick:e.onRageClick||function(){},onClickStart:e.onClickStart||function(){},onEffectiveAction:e.onEffectiveAction||function(){},onDeadClick:e.onDeadClick||function(){},getClickContext:e.getClickContext||function(){return window.location.href}},this.handleClick=this.handleClick.bind(this),this.handlePointerDown=this.handlePointerDown.bind(this)}function Ip(e){var t;this.isUploading=!1,this.useCompression=!1,this.config={uploadUrl:e.uploadUrl||"/api/v1/collect/replay",appId:e.appId,maxRetries:null!=(t=e.maxRetries)?t:3,beforeSend:e.beforeSend||function(e){return e},onError:e.onError||function(){},eventsCompression:null==(t=e.eventsCompression)||t,transport:e.transport}}function Mp(){var e=null!==Ep&&Ep.apply(this,arguments)||this;return e.permanent=!0,e}function Ap(e){return Number.isNaN(e)?0:Math.max(0,Math.min(1,e))}function Pp(e){return Ap((e=e,(Number.isNaN(e)?0:Math.max(0,Math.min(100,e)))/100))}function Dp(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Lp(e,t){var e=!1===(e=e)||void 0===e?{enabled:!1,sessionSampleRate:.1,errorSampleRate:1,errorTraceback:!0}:!0===e?{enabled:!0,sessionSampleRate:.1,errorSampleRate:1,errorTraceback:!0}:{enabled:!1!==e.enabled,sessionSampleRate:"number"==typeof e.sessionSampleRate?Ap(e.sessionSampleRate):.1,errorSampleRate:"number"==typeof e.errorSampleRate?Ap(e.errorSampleRate):1,errorTraceback:void 0===e.errorTraceback||!!e.errorTraceback},t=t&&"object"==typeof t?t:null,n=e.enabled,r=(t&&Dp(t,"enabled")&&(n=e.enabled&&!!t.enabled),e.sessionSampleRate),i=e.errorSampleRate,e=e.errorTraceback;return n&&t&&(Dp(t,"experience_sample_rate")&&null!=t.experience_sample_rate?r=Pp(Number(t.experience_sample_rate)):Dp(t,"replay_sample_rate")&&null!=t.replay_sample_rate&&(r=Pp(Number(t.replay_sample_rate))),Dp(t,"error_traceback")&&null!=t.error_traceback&&(e=!!t.error_traceback),Dp(t,"error_sample_rate"))&&null!=t.error_sample_rate&&(i=Pp(Number(t.error_sample_rate))),{enabled:n,sessionSampleRate:r,errorSampleRate:e?i:0,errorTraceback:e}}function Np(e,t){return I(I({},e),{enabled:t.enabled,sessionSampleRate:t.sessionSampleRate,errorSampleRate:t.errorSampleRate,errorTraceback:t.errorTraceback})}function Fp(e){if(!1!==(null==(t=e.config)?void 0:t.sessionReplay)){var t=e._effectiveReplayPolicy;if(!t||t.enabled)if(!1!==e._replaySampled)return!(e=null==(t=e)?void 0:t._tdemSampleGate)||e.isDecided}}function Up(e,t){return void 0===t&&(t=2),"number"==typeof e&&Number.isFinite(e)?(t=Math.pow(10,Math.max(0,Math.min(12,Math.floor(t)))),Math.round(e*t)/t):0}function zp(e,t){return void 0===t&&(t=2048),"string"==typeof e&&e.trim()?e.trim().slice(0,Math.max(1,Math.floor(t))):"unknown"}function Bp(e){var t,n=rm.get(e);if(n){n.destroyed=!0;try{null!=(t=n.observer)&&t.disconnect()}catch(e){}n.observer=null,n.lagRecords.length=0,e.lifeCycle.remove("destroy",n.onDestroy),rm.delete(e)}}function jp(e){var t=e.nodeName.toLowerCase(),n=e.id||"",r=(e="string"==typeof(e=e).className?e.className:e.getAttribute("class")||"").split(" ").filter(Boolean).map(function(e){return"."+e}).join("");return{tagName:t,id:n,className:e,selector:t+(n?"#"+n:"")+r}}function Wp(t,e){var n;if(null!=(n=null==e?void 0:e.tagName)&&n.some(function(e){return t.tagName===e.toLowerCase().trim()}))return!0;if(t.id&&null!=(n=null==e?void 0:e.id)&&n.some(function(e){return t.id===e.trim()}))return!0;if(t.className&&null!=(n=null==e?void 0:e.className)&&n.length){var r=t.className.split(" ").map(function(e){return e.trim()}).filter(Boolean);if(e.className.some(function(e){return r.includes(e.trim())}))return!0}return!1}function Hp(t,e){return e.some(function(e){return t.selector.includes(e)})}function qp(e){return{tagName:g(e.tagName||[]),id:g(e.id||[]),className:g(e.className||[])}}function Vp(){return I(I({},om),{containers:g(om.containers),ignoreContainers:g(om.ignoreContainers),containerMatchers:qp(om.containerMatchers),ignoreMatchers:qp(om.ignoreMatchers),detectStartPosition:I({},om.detectStartPosition),ignoreElesWhenDomChange:g(om.ignoreElesWhenDomChange)})}function Gp(e,t){return void 0===t&&(t=2),t=Math.pow(10,t),Math.round(e*t)/t}function Zp(e){var t,n=am.get(e);n&&(n.destroyed=!0,n.detectTimer&&clearTimeout(n.detectTimer),n.bodyWaitTimer&&clearTimeout(n.bodyWaitTimer),null!==n.idleCallbackId&&"function"==typeof window.cancelIdleCallback&&(window.cancelIdleCallback(n.idleCallbackId),n.idleCallbackId=null),null!==n.bodyWaitFrame&&(window.cancelAnimationFrame||clearTimeout)(n.bodyWaitFrame),null!=(t=n.observer)&&t.disconnect(),e.lifeCycle.remove("errorOccurred",n.onErrorOccurred),e.lifeCycle.remove("destroy",n.onDestroy),window.removeEventListener("pagehide",n.handlePageHide),window.removeEventListener("beforeunload",n.handleBeforeUnload),document.removeEventListener("visibilitychange",n.handleVisibilityChange),am.delete(e))}function Jp(e,t,n){null!=(e=null==e?void 0:e.config)&&e.debug&&"undefined"!=typeof console&&console.warn("[TDEM] "+t+": "+n+", fallback applied")}function Kp(){var e;try{var t=null==(e=window.performance)?void 0:e.memory;return!t||!dm(t.usedJSHeapSize)||!dm(t.totalJSHeapSize)||!dm(t.jsHeapSizeLimit)||t.usedJSHeapSize<0||t.totalJSHeapSize<0||t.jsHeapSizeLimit<0?null:{used:t.usedJSHeapSize,total:t.totalJSHeapSize,limit:t.jsHeapSizeLimit,ratio:0<t.jsHeapSizeLimit?Math.min(1,t.usedJSHeapSize/t.jsHeapSizeLimit):0}}catch(e){return null}}function $p(e){var t=cm.get(e);t&&(t.destroyed=!0,t.reportTimer&&clearInterval(t.reportTimer),t.oomCheckTimer&&clearInterval(t.oomCheckTimer),t.records.length=0,e.lifeCycle.remove("destroy",t.onDestroy),"undefined"!=typeof window&&(window.removeEventListener("pagehide",t.onPageExit),window.removeEventListener("beforeunload",t.onPageExit)),cm.delete(e))}function Xp(e,t,n){var r,i,o;t.destroyed||(i=Kp())&&(t.records.push(i),50<t.records.length&&t.records.shift(),o=P(e),n={event_id:A(),event_type:n,event_category:M.PERFORMANCE,timestamp:Date.now(),page_url:(null==(r=e.getOriginFrom)?void 0:r.call(e))||window.location.href,data:I(I({measurements:I({used_js_heap_size_bytes:i.used,total_js_heap_size_bytes:i.total,js_heap_size_limit_bytes:i.limit,usage_ratio:i.ratio},n===x.MEMORY_OOM?{oom_threshold_mb:t.config.oomThreshold}:{}),event_properties:{detection_source:"performance_memory"}},o?{replay_id:o}:{}),{tags:{environment:(null==(r=e.config)?void 0:r.env)||"production",version:String((null==(i=e.config)?void 0:i.version)||"")}})},e.reportTDEMEvent(n))}new e({name:"sessionReplay"});var f=new e({name:"sessionReplay",sessionManager:null,eventBuffer:null,recorderManager:null,samplerManager:null,uploader:null,clickDetector:null,removeClickVisitListener:null,flushTimer:null,replayConfig:null,isInitialized:!1,errorTraceback:!0,_tdemRef:null,_isCheckoutFlushing:!1,_lastLifecycleSnapshotAt:0,_pendingSegments:[],_baselineDelivered:!1,_baselineFlushScheduled:!1,_flushTail:Promise.resolve(),_drainPromise:null,_drainRequested:!1,_awaitingBaseline:!1,_recoveryMeta:null,init:function(e){},applyEffectivePolicy:function(e){var t,n;if(this.errorTraceback=e.errorTraceback,this.replayConfig&&(this.replayConfig=Np(this.replayConfig,e)),this.samplerManager&&this.samplerManager.updateRates(e.sessionSampleRate,e.errorSampleRate),this.isInitialized){if(e.enabled)return(n=this.samplerManager)?0<e.sessionSampleRate||e.errorTraceback&&0<e.errorSampleRate?!e.errorTraceback&&n.isBufferMode()?(u("Plugin","Error traceback off while in buffer, stopping replay"),this.stopReplay(),null!=(t=this.eventBuffer)&&t.clear(),this._pendingSegments=[],this._recoveryMeta=null,this._awaitingBaseline=!1,void n.forceMode(!1)):void(e.errorTraceback&&e.sessionSampleRate<=0&&0<e.errorSampleRate&&n.isSessionMode()&&(u("Plugin","Remote SSR=0 with traceback on: demote session→buffer"),n.forceMode("buffer"),this.flushTimer)&&(clearInterval(this.flushTimer),this.flushTimer=null)):(u("Plugin","Effective policy no longer allows recording, stopping"),this.stopReplay(),null!=(t=this.eventBuffer)&&t.clear(),this._pendingSegments=[],this._recoveryMeta=null,this._awaitingBaseline=!1,void n.forceMode(!1)):void 0;u("Plugin","Effective policy disabled, stopping replay"),this.stopReplay(),null!=(e=this.eventBuffer)&&e.clear(),this._pendingSegments=[],this._recoveryMeta=null,this._awaitingBaseline=!1}},shouldSkipBufferFlush:function(){var e;return!0===(null==(e=this.samplerManager)?void 0:e.isBufferMode())},onNewTdem:function(e,t){var n,r,t=this.parseConfig(t),i=null!=(i=t.debug)&&i,i=(Ei=i,e._effectiveReplayPolicy);i||(i=Lp(t,(n=e._prefetchedConfigData)&&"object"==typeof n&&("replay_sample_rate"in n||"error_traceback"in n||"error_sample_rate"in n||"tdem_sample_rate"in n||"enabled"in n)?(r={},Object.prototype.hasOwnProperty.call(n,"enabled")&&(r.enabled=!!n.enabled),Object.prototype.hasOwnProperty.call(n,"replay_sample_rate")&&(r.replay_sample_rate=Number(n.replay_sample_rate)),Object.prototype.hasOwnProperty.call(n,"error_traceback")&&(r.error_traceback=!!n.error_traceback),Object.prototype.hasOwnProperty.call(n,"error_sample_rate")&&(r.error_sample_rate=Number(n.error_sample_rate)),r):null),e._effectiveReplayPolicy=i,e._replaySampled=i.enabled),i.enabled?(n=Np(I(I({},t),{enabled:!0}),i),this.replayConfig=n,this.errorTraceback=i.errorTraceback,this._tdemRef=e,this.initializeModules(e,n),(r=this.samplerManager.initializeSampling()).shouldRecord?(this.startReplay(e,n,r.mode),this.registerReplaySamplingCheck(e,n),this.listenForErrors(e,n),this.listenForPerformance(e),this.listenForLifecycle(e,n),this.listenForUnload(e),this.isInitialized=!0):u("Plugin","Not sampled by sampler, skipping")):u("Plugin","disabled by effective policy")},registerReplaySamplingCheck:function(t,e){function n(e){clearInterval(i),e?(u("Plugin","Session/policy rejected, stopping replay and clearing buffer"),r.stopReplay(),r.eventBuffer&&r.eventBuffer.clear()):u("Plugin","Session sampled, replay continues")}var r=this,i=setInterval(function(){var e=t._effectiveReplayPolicy;e&&!e.enabled||!1===(null==(e=t.config)?void 0:e.sessionReplay)?n(!0):Fp(t)&&(null!=(e=r.maybeScheduleBaselineFlush)&&e.call(r),n(!1))},50);t.lifeCycle.on("destroy",function(){clearInterval(i)})},parseConfig:function(e){return!0===e?{enabled:!0}:"object"==typeof e?I(I({},e),{enabled:!1!==e.enabled}):{enabled:!1}},initializeModules:function(r,e){function t(){var e;return null==(e=n.clickDetector)?void 0:e.finishRage()}var n=this,i=(this.sessionManager=new xi({stickySession:null==(i=e.stickySession)||i}),this.sessionManager.setTdemInstance(r),r.sessionManager=this.sessionManager,this.eventBuffer=new Li({},null!=(i=e.useCompression)&&i),this.samplerManager=new jd({sessionSampleRate:e.sessionSampleRate,errorSampleRate:e.errorSampleRate}),this.recorderManager=new Bd({onRecordingEvent:function(e){n.handleRecordingEvent(e,r)},onCheckout:function(){if(!n._isCheckoutFlushing){n._isCheckoutFlushing=!0;try{var e,t;n.shouldSkipBufferFlush()?u("SessionReplay","Checkout in buffer mode (error traceback), skip flush"):(e=n._tdemRef,t=n.replayConfig,e&&t&&n.eventBuffer&&!n.eventBuffer.isEmpty()&&(u("SessionReplay","Checkout triggered, flushing current buffer"),n.flushReplayData(e,t,!0)))}finally{n._isCheckoutFlushing=!1}}},mode:"session"},e),(r.config.url||r.config.hostUrl||"").replace(/\/+$/,""));this.uploader=new Tp({uploadUrl:e.uploadUrl||i+"/api/v1/collect/replay",appId:String(r.config.id||""),beforeSend:e.beforeSend,onError:e.onError,eventsCompression:null==(i=e.eventsCompression)||i,transport:null==(i=r.getInternalTransport)?void 0:i.call(r)}),this.clickDetector=new Op({getClickContext:function(){var e,t,n;return[(n=(e=r).sessionManager,(null==(t=null==(t=null==n?void 0:n.getSession)?void 0:t.call(n))?void 0:t.id)||(null==(n=e.bean)?void 0:n.sessionId)||""),r._customPageUrl||window.location.href,null!=(n=null!=(t=r.viewId)?t:null==(e=r.bean)?void 0:e.viewId)?n:""].join("\n")},slowClickTimeout:e.slowClickTimeout,slowClickThreshold:e.slowClickThreshold,rageClickCount:e.rageClickCount,rageClickWindow:e.rageClickWindow,onSlowClick:function(e){n.handleSlowClick(e,r)},onRageClick:function(e){n.handleRageClick(e,r)}}),null!=(i=this.removeClickVisitListener)&&i.call(this);r.lifeCycle.on("pageVisitChanged",t),r.lifeCycle.on("pageChanged",t),r.lifeCycle.on("beforeCloseFlush",t),this.removeClickVisitListener=function(){r.lifeCycle.remove("pageVisitChanged",t),r.lifeCycle.remove("pageChanged",t),r.lifeCycle.remove("beforeCloseFlush",t)},u("Plugin","Modules initialized")},startReplay:function(e,t,n){var r;this.sessionManager&&this.recorderManager&&this.eventBuffer?(r=(r=this.sessionManager.restoreSession())||this.sessionManager.createSession(n),this._baselineDelivered=!1,this._baselineFlushScheduled=!1,this._awaitingBaseline=!1,this._recoveryMeta=null,u("Plugin","Session started:",r.id,"mode:",n),this.recorderManager.options.mode=n,r=Fd(I({maskAllText:!1!==t.maskAllInputs,maskAllInputs:t.maskAllInputs,maskTextSelector:t.maskTextSelector,blockSelector:t.blockSelector,ignoreSelector:t.ignoreSelector},t.privacy)),this.recorderManager.startRecording({privacy:r}),this.clickDetector&&this.clickDetector.start(),"session"===n?this.startFlushTimer(e,t):u("Plugin","Buffer mode - flush on error only")):Oi("Plugin","Modules not initialized")},handleRecordingEvent:function(e,t){if(this.eventBuffer&&this.sessionManager){this.sanitizeDataURLs(e);var n=Di(JSON.stringify(e))+1;if(5242880<n+1)this._awaitingBaseline=!0,this._recoveryMeta=null,this._baselineDelivered=!1,Oi("Replay","Event exceeds decoded events limit ("+n+" bytes), waiting for next baseline");else{if(this._awaitingBaseline){if(4===e.type)return this._recoveryMeta=e,void this.enforceReplayBudget();if(2!==e.type||!this._recoveryMeta)return;n=[this._recoveryMeta,e];if(5242880<Di(JSON.stringify(n)))return;this._recoveryMeta=null,this._awaitingBaseline=!1,this._baselineDelivered=!1,this.appendReplayEvents(n)}else this.appendReplayEvents([e]);this.sessionManager.updateActivity(),this.maybeScheduleBaselineFlush()}}},sanitizeDataURLs:function(e){var t=e.type;if(2===t){var n=null==(n=e.data)?void 0:n.node;n&&this.sanitizeNodeTree(n,1024)}else if(3===t){n=e.data;if(0===(null==n?void 0:n.source)&&Array.isArray(n.adds)){for(var r=0,i=n.adds;r<i.length;r++){var o=i[r];null!=o&&o.node&&this.sanitizeNodeTree(o.node,1024)}if(Array.isArray(n.attributes))for(var s=0,a=n.attributes;s<a.length;s++){var l=a[s];if(null!=l&&l.attributes)for(var u=0,c=Object.entries(l.attributes);u<c.length;u++){var d=c[u],f=d[0],d=d[1];"string"==typeof d&&1024<d.length&&d.startsWith("data:")&&(l.attributes[f]='data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg"%3E%3C/svg%3E')}}}}},sanitizeNodeTree:function(e,t){if(e){if(e.attributes)for(var n=e.attributes,r=0,i=Object.keys(n);r<i.length;r++){var o=i[r],s=n[o];"string"==typeof s&&s.length>t&&s.startsWith("data:")&&(n[o]='data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg"%3E%3C/svg%3E')}if(Array.isArray(e.childNodes))for(var a=0,l=e.childNodes;a<l.length;a++){var u=l[a];this.sanitizeNodeTree(u,t)}}},handleSlowClick:function(e,t){u("ClickDetector","Slow click detected:",e.timeAfterClickMs,"ms"),this.addCustomEvent({category:"ui.slowClickDetected",message:"Slow click: "+e.timeAfterClickMs+"ms on "+e.node.tagName,data:{node:e.node,timeAfterClickMs:e.timeAfterClickMs,endReason:e.endReason}},t)},handleRageClick:function(e,t){u("ClickDetector","Rage click detected:",e.clickCount,"clicks"),this.addCustomEvent({category:"ui.multiClick",message:"Rage click: "+e.clickCount+" clicks on "+e.node.tagName,data:{node:e.node,clickCount:e.clickCount,timeWindowMs:e.timeWindowMs}},t)},addCustomEvent:function(e,t){this.eventBuffer&&(e={type:5,data:{tag:e.category,payload:I({message:e.message},e.data)},timestamp:Date.now()},this.eventBuffer.addEvent(e))},startFlushTimer:function(e,t){var n=this;this.flushTimer&&clearInterval(this.flushTimer),this.flushTimer=setInterval(function(){n.flushReplayData(e,t)},2e4)},maybeScheduleBaselineFlush:function(){var e,t,n,r=this;this._baselineDelivered||this._baselineFlushScheduled||this._awaitingBaseline||this.shouldSkipBufferFlush()||null==(e=this.eventBuffer)||!e.hasBaselinePair()||(t=this._tdemRef,n=this.replayConfig,t&&n&&Fp(t)&&(this._baselineFlushScheduled=!0,Promise.resolve().then(function(){r._baselineFlushScheduled=!1,r._baselineDelivered||r.shouldSkipBufferFlush()||Fp(t)&&(r._baselineDelivered=!0,r.flushReplayData(t,n,!0))})))},canReportReplay:function(e){return!(!(this.sessionManager&&this.eventBuffer&&this.uploader)||!Fp(e)||this.shouldSkipBufferFlush()||!this.sessionManager.getSession())},getRetainedReplayBytes:function(){var e;return((null==(e=this.eventBuffer)?void 0:e.getSize())||0)+2+this._pendingSegments.reduce(function(e,t){return e+t.byteLength},0)+(this._recoveryMeta?Di(JSON.stringify(this._recoveryMeta))+1:0)},appendReplayEvents:function(e){var t,n=this;this.eventBuffer&&(t=e.reduce(function(e,t){return e+Di(JSON.stringify(t))+1},0),5242880<this.eventBuffer.getSize()+t+2||10485760<this.getRetainedReplayBytes()+t?this.compactReplayQueue(e):e.forEach(function(e){return n.eventBuffer.addEvent(e)}))},enforceReplayBudget:function(){(10485760<this.getRetainedReplayBytes()||64<this._pendingSegments.length)&&this.compactReplayQueue()},compactReplayQueue:function(e,t){var n=this;if(void 0===e&&(e=[]),this.eventBuffer){var r=this._awaitingBaseline,i=this._recoveryMeta,o=[],s=[],a=null;this._pendingSegments.forEach(function(e){e===t||"sending"===e.status?(e.events.forEach(function(e){4===e.type&&(a=e)}),e!==t&&s.push(e)):e.events.forEach(function(e){return o.push(e)})}),this.eventBuffer.detachEvents().forEach(function(e){return o.push(e)}),e.forEach(function(e){return o.push(e)});for(var l=-1,u=null,c=0;c<o.length;c++){var d=o[c];4===d.type&&(a=d),2===d.type&&a&&Di(JSON.stringify([a,d]))<=5242880&&(l=c,u=a)}var e=0<=l&&u?g([u],o.slice(l)):[],f=(this._pendingSegments=s,this._recoveryMeta=null,Di(JSON.stringify(e))),f=(e.length&&f<=5242880&&this.getRetainedReplayBytes()+f<=10485760?(e.forEach(function(e){return n.eventBuffer.addEvent(e)}),this._awaitingBaseline=r):this._awaitingBaseline=!0,i||a);this._awaitingBaseline&&f&&this.getRetainedReplayBytes()+Di(JSON.stringify(f))+1<=10485760&&(this._recoveryMeta=f),this._baselineDelivered=!1,Ti("Replay","Discarded replay dependency chain; retained latest complete checkpoint if it fits")}},freezeActiveBuffer:function(e){var t,n,r,i,o=this;this.sessionManager&&this.eventBuffer&&(t=this.sessionManager.getSession())&&!this.eventBuffer.isEmpty()&&(!e&&this.eventBuffer.getEventCount()<10?u("Flush","Skipping flush, only "+this.eventBuffer.getEventCount()+" events (min: 10)"):(0!==t.segmentId||this.eventBuffer.hasCheckout()||(Ti("Flush","First segment missing FullSnapshot, triggering manual checkout"),null==(e=this.recorderManager))||e.takeFullSnapshot(),0!==(e=this.eventBuffer.detachEvents()).length&&(r=!(n=[]),i=null,e.forEach(function(e){if(5242880<Di(JSON.stringify([e])))r=!0,i=null,Oi("Replay","Oversized event discarded before freezing");else{if(r){if(4===e.type&&(i=e),2!==e.type||!i||5242880<Di(JSON.stringify([i,e])))return;n.push(i),r=!1}n.push(e)}}),r&&(this._awaitingBaseline=!0,this._recoveryMeta=i,this._baselineDelivered=!1),(e=this.splitEventsIntoChunks(n,3145728,5242880)).forEach(function(e){0!==e.length&&o._pendingSegments.push({segmentId:o.sessionManager.incrementSegmentId(),sessionId:t.id,replayId:t.replayId,replayStarted:t.started,events:e,byteLength:Di(JSON.stringify(e)),status:"pending"})}),!this._awaitingBaseline&&n.some(function(e){e=e.type;return 2===e||4===e})&&(this._baselineDelivered=!0),this.enforceReplayBudget(),u("Flush","Frozen "+n.length+" events into "+e.length+" segment(s)"))))},buildSegmentPayload:function(e,t){return{project_key:String(e.config.id||""),session_id:t.sessionId,replay_id:t.replayId,segment_id:t.segmentId,timestamp:Date.now(),replay_start_timestamp:t.replayStarted,replay_format:"rrweb",platform:"web",events_encoding:"plain_json",events:JSON.stringify(t.events)}},measureSegment:function(e){return this.uploader&&"function"==typeof this.uploader.measurePayload?this.uploader.measurePayload(e):Di(JSON.stringify(e))},enqueueDrain:function(t){var e,n=this;return this._drainRequested=!0,this._drainPromise||(e=Promise.resolve().then(function(){return D(n,void 0,void 0,function(){return L(this,function(e){switch(e.label){case 0:return this._drainRequested=!1,[4,this.drainPendingUploads(t)];case 1:e.sent(),e.label=2;case 2:if(this._drainRequested&&this.canReportReplay(t))return[3,0];e.label=3;case 3:return[2]}})})}).finally(function(){n._drainPromise===e&&(n._drainPromise=null)}),this._drainPromise=e,this._flushTail=e)},drainPendingUploads:function(i){return D(this,void 0,void 0,function(){var t,r,n;return L(this,function(e){switch(e.label){case 0:t=function(){var t,n;return L(this,function(e){switch(e.label){case 0:return(t=r._pendingSegments.find(function(e){return"pending"===e.status}))?(t.status="sending",[4,r.uploader.uploadReplayResult(r.buildSegmentPayload(i,t))]):[2,{value:void 0}];case 1:if(n=e.sent(),!r._pendingSegments.includes(t))return[2,"continue"];if("success"===n.status)r._pendingSegments=r._pendingSegments.filter(function(e){return e!==t}),null!=(e=r.sessionManager)&&e.saveSession();else{if("busy"===n.status)return t.status="pending",[2,{value:void 0}];Ti("Flush","Segment "+t.segmentId+" terminated ("+n.status+", attempts="+n.attempts+")"),r.compactReplayQueue([],t),r.freezeActiveBuffer(!0)}return[2]}})},r=this,e.label=1;case 1:return this.canReportReplay(i)?[5,t()]:[3,3];case 2:return"object"==typeof(n=e.sent())?[2,n.value]:[3,1];case 3:return[2]}})})},flushReplayData:function(e,t,n){var r,i;return void 0===n&&(n=!1),this.canReportReplay(e)?this.sessionManager.shouldRefreshSession()?(u("Plugin","Session expired, refreshing"),this.stopReplay(),r=this.sessionManager.refreshSession(),e.lifeCycle.emit("sessionRefreshed"),i=e._replaySampled,r.sampled&&!1!==i&&this.startReplay(e,t,r.sampled),Promise.resolve()):(this.freezeActiveBuffer(n),this.enqueueDrain(e)):Promise.resolve()},handoffReplay:function(r,e){var i,o,s,a,l=this;this.canReportReplay(r)&&(this.freezeActiveBuffer(!0),s=o=i=0,a=[],this._pendingSegments.forEach(function(e){var t=l.buildSegmentPayload(r,e),n=l.measureSegment(t);!(n<=0||61440<n)&&i+n<=65536?!0===l.uploader.sendBeacon(t)?(i+=n,o+=1):(s+=1,Ti("Unload","sendBeacon rejected chunk (segment_id="+e.segmentId+"), kept for retry"),a.push(e)):a.push(e)}),this._pendingSegments=a,u("SessionReplay","sendBeacon on hide: "+o+" queued, "+s+" rejected, "+a.length+" pending"),e)&&0<a.length&&this.enqueueDrain(r)},splitEventsIntoChunks:function(e,t,n){if(void 0===t&&(t=3145728),void 0===n&&(n=5242880),0===e.length)return[];var r=Di(JSON.stringify(e));if(r<=Math.min(t,n))return[e];Ti("Split","Events size "+Math.round(r/1024)+"KB exceeds limit "+Math.round(t/1024)+"KB, splitting");for(var i=[],o=[],s=2,a=0,l=e;a<l.length;a++){var u,c,d=l[a],f=Di(JSON.stringify(d))+1;0<o.length&&t<s+f&&(i.push(o),o=[],s=2),n<f+1?((c=2===(u=d.type)||4===u)?Oi:Ti)("Split","Single event too large ("+Math.round(f/1024)+"KB), type="+u+(c?" (baseline snapshot, replay may become unplayable)":"")+", skipping"):(o.push(d),s+=f)}return 0<o.length&&i.push(o),i},stopReplay:function(){this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=null),this.recorderManager&&this.recorderManager.stopRecording(),this.clickDetector&&this.clickDetector.stop(),u("Plugin","Recording stopped")},listenForErrors:function(t,n){var r=this;t.lifeCycle.on("errorOccurred",function(e){(Array.isArray(e)?e:[e]).forEach(function(e){e&&r.handleError(e,t,n)})}),t.lifeCycle.on("tdemEventCreated",function(e){(Array.isArray(e)?e:[e]).forEach(function(e){r.isErrorTDEMEvent(e)&&r.handleError(e,t,n)})})},isErrorTDEMEvent:function(e){return!!e&&("error"===String(e.event_category||"").toLowerCase()||(e=String(e.event_type||"").toLowerCase(),["js_error","promise_error","resource_error","api_error"].includes(e)))},handleError:function(e,t,n){this.samplerManager&&(this.samplerManager.isBufferMode()&&this.samplerManager.onErrorOccurred(e)&&(u("Plugin","Converting to session mode due to error"),this.flushReplayData(t,n,!0),this.startFlushTimer(t,n)),this.addCustomEvent({category:"error",message:(null==e?void 0:e.msg)||(null==e?void 0:e.message)||"Unknown error",data:{type:(null==e?void 0:e.type)||"error",stack:null==e?void 0:e.stack}},t))},listenForPerformance:function(n){var r=this;if(n.lifeCycle.on("afterReportWebVitals",function(e){r.handlePerformanceEvent("webVitals",e,n)}),n.lifeCycle.on("afterReportPagePerformance",function(e){r.handlePerformanceEvent("pageLoad",e,n)}),"undefined"!=typeof PerformanceObserver)try{var e=new PerformanceObserver(function(e){var t,e=e.getEntries(),e=e[e.length-1];e&&r.addCustomEvent({category:"performance.lcp",message:"LCP: "+Math.round(e.startTime)+"ms",data:{value:e.startTime,element:(null==(t=e.element)?void 0:t.tagName)||"unknown",size:e.size}},n)}),t=(e.observe({type:"largest-contentful-paint",buffered:!0}),new PerformanceObserver(function(e){e.getEntries().forEach(function(e){"first-contentful-paint"===e.name&&r.addCustomEvent({category:"performance.fcp",message:"FCP: "+Math.round(e.startTime)+"ms",data:{value:e.startTime}},n)})})),i=(t.observe({type:"paint",buffered:!0}),new PerformanceObserver(function(e){e.getEntries().forEach(function(e){100<e.duration&&r.addCustomEvent({category:"performance.longTask",message:"Long Task: "+Math.round(e.duration)+"ms",data:{duration:e.duration,startTime:e.startTime}},n)})}));i.observe({type:"longtask",buffered:!0}),n.lifeCycle.on("destroy",function(){e.disconnect(),t.disconnect(),i.disconnect()})}catch(n){}},handlePerformanceEvent:function(e,n,r){var i=this;n&&("webVitals"===e?["LCP","FCP","FID","CLS","TTFB","TTI","INP"].forEach(function(e){var t=n[e];void 0!==t&&-1!==t&&0<t&&i.addCustomEvent({category:"performance."+e.toLowerCase(),message:e+": "+("number"==typeof t?Math.round(t):t)+("CLS"===e?"":"ms"),data:{metric:e,value:t}},r)}):"pageLoad"===e&&this.addCustomEvent({category:"performance.pageLoad",message:"Page Load: "+(n.firstScreenTiming?Math.round(n.firstScreenTiming):"N/A")+"ms",data:{dnsLookup:n.dnsLookup,tcp:n.tcp,ssl:n.ssl,ttfb:n.ttfb,contentDownload:n.contentDownload,domParse:n.domParse,resourceDownload:n.resourceDownload,firstScreenTiming:n.firstScreenTiming}},r))},listenForLifecycle:function(o,t){var n,e,s=this;"undefined"!=typeof document&&(n=function(e){var t,n=null==(n=s.sessionManager)?void 0:n.getSession(),n=(null==n?void 0:n.replayId)||"",r=(null==(r=null==(i=o)?void 0:i.getOriginFrom)?void 0:r.call(i))||("undefined"!=typeof location?location.href:""),i="undefined"!=typeof document&&document.title||"";null!=(t=o.reportTDEMEvent)&&t.call(o,{event_id:A(),event_type:e,event_category:M.BEHAVIOR,timestamp:Date.now(),page_url:r,data:{page_title:i,replay_id:n,is_effective_action:!1,tags:{environment:o.config.env||"production",version:String(o.config.version||"")},event_properties:{visibility_state:"undefined"!=typeof document?document.visibilityState:"",lifecycle_type:e}}})},document.addEventListener("visibilitychange",e=function(){var e;if("undefined"!=typeof document){if("hidden"===document.visibilityState)return n(x.TAB_HIDDEN),s.shouldSkipBufferFlush()?void u("Lifecycle","Buffer mode (error traceback), skip flush on hidden"):void s.handoffReplay(o,!0);"visible"===document.visibilityState&&(n(x.TAB_VISIBLE),(e=Date.now())-s._lastLifecycleSnapshotAt<5e3||(s._lastLifecycleSnapshotAt=e,null!=(e=s.recorderManager)&&e.takeFullSnapshot(),s.shouldSkipBufferFlush()?u("Lifecycle","Buffer mode (error traceback), skip flush on visible"):s.flushReplayData(o,t,!0)))}}),o.lifeCycle.on("destroy",function(){document.removeEventListener("visibilitychange",e)}))},listenForUnload:function(t){function e(e){r.flushOnUnload(t,e)}function n(e){r.resumeAfterRestore(e)}var r=this;window.addEventListener("pagehide",e),window.addEventListener("pageshow",n),t.lifeCycle.on("destroy",function(){window.removeEventListener("pagehide",e),window.removeEventListener("pageshow",n)})},resumeAfterRestore:function(e){null!=e&&e.persisted&&!this.shouldSkipBufferFlush()&&(this.recorderManager&&!this.recorderManager.isRecording()&&this.recorderManager.startRecording(),null!=(e=this.clickDetector))&&e.start()},flushOnUnload:function(e,t){this.canReportReplay(e)?(null!=t&&t.persisted||(null!=(t=this.recorderManager)&&t.stopRecording(),null==(t=this.clickDetector))||t.stop(),this.handoffReplay(e,!1)):this.shouldSkipBufferFlush()&&u("Unload","Buffer mode (error traceback), skip flush on unload")},destroy:function(){var e;if(this.option)return this.option.destroy.call(this.option);this.stopReplay(),null!=(e=this.removeClickVisitListener)&&e.call(this),this.removeClickVisitListener=null,this.sessionManager&&this.sessionManager.saveSession(),this.sessionManager=null,this.eventBuffer&&this.eventBuffer.destroy(),this.eventBuffer=null,this.recorderManager=null,this.samplerManager=null,this.uploader=null,this.clickDetector=null,this.replayConfig=null,this._tdemRef=null,this._isCheckoutFlushing=!1,this._lastLifecycleSnapshotAt=0,this._pendingSegments=[],this._baselineDelivered=!1,this._baselineFlushScheduled=!1,this._flushTail=Promise.resolve(),this._drainPromise=null,this._drainRequested=!1,this._awaitingBaseline=!1,this._recoveryMeta=null,this.isInitialized=!1,u("Plugin","destroyed")}}),Yp={enabled:!0,ruleVersion:"1.0.0",payloadAllowlist:[],click:{enabled:!0,deadClickWindowMs:3e3,deadClickDebounceIntervalMs:1e3,rageClickWindowMs:3e3,rageClickCount:5,errorClickWindowMs:3e3,resolveOnDomMutation:!0,resolveOnSpaNavigation:!0,resolveOnExternalNavigation:!0,resolveOnWindowOpen:!0,resolveOnPageUnload:!0,resolveOnFormAction:!0,resolveOnApiSuccess:!0,ignoreDeadClickSelectors:[],effectiveActionSelectors:[],clickableSelectors:[]},performance:{enabled:!0,slowPageLcpThreshold:4e3,slowPageInpThreshold:500},form:{enabled:!0,fieldIdAttr:"data-field-id",formIdAttr:"data-form-id",longFocusThresholdMs:2e4,incompleteMinFieldRatio:.3,zigzagMinCount:2},navigation:{enabled:!0,backForwardAsStruggle:!0},custom:{enabled:!0,detector:void 0}},Qp=new Set([x.JS_ERROR,x.PROMISE_ERROR,x.RESOURCE_ERROR,x.API_ERROR]),em=new Set([x.FORM_CHANGE,x.FORM_SUBMIT,x.FORM_SUBMIT_RESULT]),tm=(new e({name:"struggleMonitor"}),new e({name:"struggleMonitor",instanceStates:new Map,originalWindowOpen:null,windowOpenHooked:!1,onNewTdem:function(n){var e,t,r,i,o,s,a=this,l=!0===(e=this.$getConfig(n))?I({},Yp):e&&"object"==typeof e?(t=(void 0===(l=null==(l=e.click)?void 0:l.deadClickDebounceIntervalMs)||Number.isInteger(l)&&1<=l&&l<=6e4)&&null!=l?l:1e3,void 0!==l&&l!==t&&console.warn("struggleMonitor: invalid deadClickDebounceIntervalMs; using 1000ms"),I(I(I({},Yp),e),{click:I(I(I({},Yp.click),e.click||{}),{deadClickDebounceIntervalMs:t}),performance:I(I({},Yp.performance),e.performance||{}),form:I(I({},Yp.form),e.form||{}),navigation:I(I({},Yp.navigation),e.navigation||{}),custom:I(I({},Yp.custom),e.custom||{}),payloadAllowlist:(Array.isArray(e.payloadAllowlist)?e:Yp).payloadAllowlist,enabled:!1!==e.enabled})):I(I({},Yp),{enabled:!1});l.enabled&&(r={config:l,clickDetector:null,recentClicks:[],pendingDeadClicks:new Map,latestDead:new Map,clickContexts:new WeakMap,contextKey:this.getClickContextKey(n),closing:!1,focusStartMap:new Map,formStateMap:new Map,removeDomListeners:[],onEventCreated:null,onDestroy:null},this.instanceStates.set(n,r),this.initClickDetector(n,r),this.initFormListeners(n,r),r.onEventCreated=function(e){a.handleEventCreated(n,r,e||[])},n.lifeCycle.on("tdemEventCreated",r.onEventCreated),r.onDestroy=function(){return a.cleanupInstance(n)},n.lifeCycle.on("destroy",r.onDestroy),n.lifeCycle.on("clickCaptured",i=function(e){var t=e.event,n=e.source,e=r.clickContexts.get(t);e&&(e.sourceContext.replayId=String(n.data.replay_id||"")),r.pendingDeadClicks.forEach(function(e){e.event===t&&(e.clickEventId=n.event_id,e.ownerKey=n.data.target_element||e.ownerKey)})}),r.removeDomListeners.push(function(){return n.lifeCycle.remove("clickCaptured",i)}),n.lifeCycle.on("pageChanged",o=function(){return a.closeClickGroups(r)}),r.removeDomListeners.push(function(){return n.lifeCycle.remove("pageChanged",o)}),n.lifeCycle.on("pageVisitChanged",o),r.removeDomListeners.push(function(){return n.lifeCycle.remove("pageVisitChanged",o)}),n.lifeCycle.on("beforeCloseFlush",o),r.removeDomListeners.push(function(){return n.lifeCycle.remove("beforeCloseFlush",o)}),r.removeDomListeners.push("undefined"==typeof window?function(){}:(window.addEventListener("monitor-session-update",s=function(e){var t=e.detail.sessionId;e.detail.source,t!==r.contextKey.split("\n")[0]&&(r.contextKey=a.getClickContextKey(n),a.closeClickGroups(r,!0))}),function(){return window.removeEventListener("monitor-session-update",s)})))},initClickDetector:function(t,n){var e,r=this;"undefined"!=typeof window&&"undefined"!=typeof document&&(n.clickDetector=new Op({getClickContext:function(){return r.getClickContextKey(t)},slowClickTimeout:null!=(e=null==(e=n.config.click)?void 0:e.deadClickWindowMs)?e:3e3,slowClickThreshold:null!=(e=null==(e=n.config.click)?void 0:e.deadClickWindowMs)?e:3e3,rageClickCount:null!=(e=null==(e=n.config.click)?void 0:e.rageClickCount)?e:5,rageClickWindow:null!=(e=null==(e=n.config.click)?void 0:e.rageClickWindowMs)?e:3e3,onRageClick:function(e){r.onRageClick(t,n,e)},onClickStart:function(e){r.onClickStart(t,n,e)},onEffectiveAction:function(e){r.onEffectiveAction(t,n,e)},onSlowClick:function(e){r.onSlowClick(t,n,e)}}),n.clickDetector.start(),this.initClickEffectiveActionListeners(n),this.initWindowOpenHook())},initClickEffectiveActionListeners:function(n){var e,t,r=this;"undefined"!=typeof window&&((e=function(e,t){window.addEventListener(e,t),n.removeDomListeners.push(function(){window.removeEventListener(e,t)})})("pagehide",function(){var e;r.closeClickGroups(n),!1!==(null==(e=n.config.click)?void 0:e.resolveOnPageUnload)&&(r.resolvePendingDeadClicks(n,"page_unload"),null!=(e=n.clickDetector))&&e.markEffectiveAction("page_unload")}),e("beforeunload",function(){var e;r.closeClickGroups(n),!1!==(null==(e=n.config.click)?void 0:e.resolveOnPageUnload)&&(r.resolvePendingDeadClicks(n,"page_unload"),null!=(e=n.clickDetector))&&e.markEffectiveAction("page_unload")}),t=function(){"hidden"===document.visibilityState&&r.closeClickGroups(n)},document.addEventListener("visibilitychange",t),n.removeDomListeners.push(function(){return document.removeEventListener("visibilitychange",t)}))},initWindowOpenHook:function(){var r,i;"undefined"==typeof window||this.windowOpenHooked||(r=window.open,this.originalWindowOpen=r,this.windowOpenHooked=!0,i=this,window.open=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=r.apply(window,e);return i.resolveWindowOpenActions(),n})},resolveWindowOpenActions:function(){var r=this,i=Date.now();this.instanceStates.forEach(function(e,t){var n;!1!==(null==(n=e.config.click)?void 0:n.resolveOnWindowOpen)&&(null!=(n=e.clickDetector)&&n.markEffectiveAction("window_open"),r.resolvePendingDeadClicks(e,"window_open",i,t._customPageUrl||r.getCurrentPageUrl()))})},restoreWindowOpenHook:function(){"undefined"!=typeof window&&this.windowOpenHooked&&this.originalWindowOpen&&(window.open=this.originalWindowOpen,this.originalWindowOpen=null,this.windowOpenHooked=!1)},initFormListeners:function(r,i){var e,t,o=this;null!=(t=i.config.form)&&t.enabled&&"undefined"!=typeof document&&((t=function(e,t,n){void 0===n&&(n=!0),document.addEventListener(e,t,n),i.removeDomListeners.push(function(){document.removeEventListener(e,t,n)})})("focusin",function(e){e=o.getTrackableField(e.target);e&&o.reportFormEvent(r,i,x.FORM_FOCUS,e,e.form||void 0)}),t("focusout",function(e){e=o.getTrackableField(e.target);e&&o.reportFormEvent(r,i,x.FORM_BLUR,e,e.form||void 0)}),t("change",function(e){e=o.getTrackableField(e.target);e&&o.reportFormEvent(r,i,x.FORM_CHANGE,e,e.form||void 0)}),t("submit",function(e){e=e.target;e instanceof HTMLFormElement&&o.reportFormEvent(r,i,x.FORM_SUBMIT,null,e)}),t("invalid",function(e){var t,n,e=o.getTrackableField(e.target);e&&(n=e.form||void 0,n=o.buildFormBaseData(r,i,e,n),n={event_id:A(),event_type:x.FORM_SUBMIT_RESULT,event_category:M.BEHAVIOR,timestamp:Date.now(),page_url:"undefined"!=typeof window?window.location.href:(null==(t=r.getOriginFrom)?void 0:t.call(r))||"",data:I(I({},n),{event_name:"form_submit_fail",is_effective_action:!0,validation_message:e.validationMessage||void 0,event_properties:I(I({},n.event_properties||{}),{status:"fail",validation_code:!1===(null==(t=e.validity)?void 0:t.valid)?"invalid":"validation_error"})})},null!=(e=r.reportTDEMEvent))&&e.call(r,n)}),e=function(){o.reportPendingUncompletedForms(r,i,"pagehide")},"undefined"!=typeof window)&&(window.addEventListener("pagehide",e),i.removeDomListeners.push(function(){window.removeEventListener("pagehide",e)}))},getTrackableField:function(e){return!(e&&e instanceof Element)||!(e=e.closest("input, textarea, select"))||e instanceof HTMLInputElement&&["button","submit","reset","image","hidden"].includes(e.type)?null:e},buildFormBaseData:function(e,t,n,r){var n=n||null,r=r||(null==n?void 0:n.form)||void 0,i=(null==(i=t.config.form)?void 0:i.fieldIdAttr)||"data-field-id",t=(null==(t=t.config.form)?void 0:t.formIdAttr)||"data-form-id",i=n?n.getAttribute(i)||n.id||n.name||n.tagName.toLowerCase()+"_"+(n.type||"field"):void 0,t=r&&(r.getAttribute(t)||r.id||r.getAttribute("name")||r.getAttribute("action"))||void 0,o="string"==typeof(null==(o=n)?void 0:o.value)?n.value.length:0,o=0===o?"0":o<=10?"1_10":o<=50?"11_50":"51_plus";return{replay_id:P(e),is_effective_action:!0,form_id:t,field_id:i,tags:{},event_properties:{field_name:(null==n?void 0:n.name)||"",field_type:(null==n?void 0:n.type)||(null==(e=null==n?void 0:n.tagName)?void 0:e.toLowerCase())||"",form_name:(null==r?void 0:r.getAttribute("name"))||"",is_required:String(!(null==n||!n.required)),value_length_bucket:String(o)}}},reportFormEvent:function(e,t,n,r,i){var t=this.buildFormBaseData(e,t,r,i),i="undefined"!=typeof window?window.location.href:(null==(r=e.getOriginFrom)?void 0:r.call(e))||"",r={event_id:A(),timestamp:Date.now(),page_url:i};n!==x.FORM_FOCUS?n!==x.FORM_BLUR?n!==x.FORM_CHANGE?(i=I(I({},r),{event_type:x.FORM_SUBMIT,event_category:M.BEHAVIOR,data:I(I({},t),{submit_method:"native_submit"})}),null!=(n=e.reportTDEMEvent)&&n.call(e,i)):(n=I(I({},r),{event_type:x.FORM_CHANGE,event_category:M.BEHAVIOR,data:t}),null!=(i=e.reportTDEMEvent)&&i.call(e,n)):(i=I(I({},r),{event_type:x.FORM_BLUR,event_category:M.BEHAVIOR,data:t}),null!=(n=e.reportTDEMEvent)&&n.call(e,i)):(n=I(I({},r),{event_type:x.FORM_FOCUS,event_category:M.BEHAVIOR,data:t}),null!=(i=e.reportTDEMEvent)&&i.call(e,n))},onClickStart:function(e,t,n){var r,i,o,s,a=t.config.click||Yp.click;!1!==a.enabled&&(this.checkClickContext(e,t),r=Nn(n.event,e),i={timestamp:n.timestamp,sessionId:Xe(e),viewId:String(null!=(i=null!=(i=null!=(i=null==r?void 0:r.view_id)?i:e.viewId)?i:null==(i=e.bean)?void 0:i.viewId)?i:""),replayId:String(null!=(i=null==(i=null==r?void 0:r.data)?void 0:i.replay_id)?i:P(e))},o=e._customPageUrl||(null==r?void 0:r.page_url)||this.getCurrentPageUrl(),t.clickContexts.set(n.event,{pageUrl:o,sourceContext:i}),s=(null==(s=null==r?void 0:r.data)?void 0:s.target_element)||n.node.selector||n.node.tagName||"unknown",this.isDeadClickExempt(n,a)||this.shouldIgnoreDeadClick(n.target,a)||"custom"!==n.effectiveActionReason&&(n.effectiveActionReason&&this.shouldResolveByReason(t,n.effectiveActionReason)?this.resolvePendingDeadClicks(t,n.effectiveActionReason,n.timestamp,o):this.scheduleDeadClick(e,t,{pendingId:"pending_"+n.timestamp+"_"+Math.random().toString(16).slice(2),timestamp:n.timestamp,pageUrl:o,ownerKey:s,node:n.node,target:n.target,event:n.event,groupKey:t.contextKey,debounceIntervalMs:null!=(e=a.deadClickDebounceIntervalMs)?e:1e3,sourceContext:i,clickEventId:null==r?void 0:r.event_id})))},onEffectiveAction:function(e,t,n){this.checkClickContext(e,t),this.shouldResolveByReason(t,n.reason)&&(e=e._customPageUrl||this.getCurrentPageUrl(),this.resolvePendingDeadClicks(t,n.reason,n.timestamp,e))},scheduleDeadClick:function(t,n,r){var i=this,o=null!=(e=null==(e=n.config.click)?void 0:e.deadClickWindowMs)?e:3e3,e=n.latestDead.get(r.target),e=(e&&e.groupKey===r.groupKey&&r.timestamp>=e.timestamp&&r.timestamp-e.timestamp<e.debounceIntervalMs&&(r.debounceIntervalMs=e.debounceIntervalMs,this.removeDeadClick(n,e)),setTimeout(function(){i.checkClickContext(t,n);var e=n.pendingDeadClicks.get(r.pendingId);e&&(i.removeDeadClick(n,e),i.emitDeadClick(t,n,e,o))},Math.max(o,r.debounceIntervalMs))),e=I(I({},r),{timeout:e});n.pendingDeadClicks.set(r.pendingId,e),n.latestDead.set(r.target,e),200<n.pendingDeadClicks.size&&(e=n.pendingDeadClicks.values().next().value)&&this.removeDeadClick(n,e)},removeDeadClick:function(e,t){clearTimeout(t.timeout),e.pendingDeadClicks.delete(t.pendingId),e.latestDead.get(t.target)===t&&e.latestDead.delete(t.target)},getClickContextKey:function(e){var t;return[Xe(e),e._customPageUrl||this.getCurrentPageUrl(),null!=(e=null!=(t=e.viewId)?t:null==(t=e.bean)?void 0:t.viewId)?e:""].join("\n")},checkClickContext:function(e,t){var n,e=this.getClickContextKey(e);e!==t.contextKey&&(n=e.split("\n")[0]!==t.contextKey.split("\n")[0],t.contextKey=e,this.closeClickGroups(t,n))},closeClickGroups:function(t,e){var n,r=this;void 0===e&&(e=!1),null!=(n=t.clickDetector)&&n.finishRage(),t.latestDead.clear(),e&&(t.pendingDeadClicks.forEach(function(e){return r.removeDeadClick(t,e)}),t.recentClicks=[])},emitDeadClick:function(e,t,n,r){var i,o=n.clickEventId?[n.clickEventId]:void 0;null!=(i=e.reportStruggle)&&i.call(e,{type:"dead_click",ownerType:"element",ownerKey:n.ownerKey,pageUrl:n.pageUrl,sourceContext:I(I({},n.sourceContext),{timestamp:n.timestamp+r}),triggerEventId:n.clickEventId,relatedEventIds:o,detectionSource:"rule_engine",ruleVersion:t.config.ruleVersion,payloadAllowlist:t.config.payloadAllowlist,payload:{timeout_ms:r,selector:n.node.selector||""}})},resolvePendingDeadClicks:function(n,r,i,o){var e,s=this,a=(void 0===i&&(i=Date.now()),null!=(e=null==(e=n.config.click)?void 0:e.deadClickWindowMs)?e:3e3);n.pendingDeadClicks.forEach(function(e){var t=i-e.timestamp;t<0||a<t||"spa_navigation"!==r&&"page_unload"!==r&&o&&e.pageUrl&&o!==e.pageUrl||s.removeDeadClick(n,e)})},shouldResolveByReason:function(e,t){e=e.config.click||Yp.click;return!1!==e.enabled&&("dom_mutation"===t?!1!==e.resolveOnDomMutation:"spa_navigation"===t?!1!==e.resolveOnSpaNavigation:"external_navigation"===t||"download"===t?!1!==e.resolveOnExternalNavigation:"window_open"===t?!1!==e.resolveOnWindowOpen:"page_unload"===t?!1!==e.resolveOnPageUnload:"form_change"===t||"form_submit"===t?!1!==e.resolveOnFormAction:"api_success"!==t||!1!==e.resolveOnApiSuccess)},isDeadClickExempt:function(e,t){var e=e.event.target,t=Array.isArray(t.clickableSelectors)?t.clickableSelectors:[];return!(e instanceof Element&&((e,t)=>{if(void 0===t&&(t=[]),e.closest(Pn))return 1;for(var n=0;n<t.length;n++)try{if(t[n]&&e.closest(t[n]))return 1}catch(e){}try{return"pointer"===window.getComputedStyle(e).cursor}catch(e){}})(e,t)&&(!(t=e.closest("[contenteditable]"))||"false"===t.getAttribute("contenteditable"))&&!e.closest('input:not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="image"]),textarea,select,option,label'))},shouldIgnoreDeadClick:function(t,e){return g(e.ignoreDeadClickSelectors||[],e.effectiveActionSelectors||[]).some(function(e){try{return!!e&&!!t.closest(e)}catch(e){return!1}})},getCurrentPageUrl:function(){return"undefined"==typeof window?"":window.location.href},getEventPageUrl:function(e){return(null==e?void 0:e.page_url)||(null==(e=null==e?void 0:e.data)?void 0:e.page_url)||""},onRageClick:function(t,e,n){var r,i,o,s;!1!==e.config.click.enabled&&(r=n.node.selector||n.node.tagName||"unknown",i=e.clickContexts.get(n.clicks[0].event))&&(o=(s=n.clicks.map(function(e){return Nn(e.event,t)})).map(function(e){return null==e?void 0:e.event_id}).filter(Boolean).slice(-10),s={type:"rage_click",ownerType:"element",ownerKey:(null==(s=null==(s=s[0])?void 0:s.data)?void 0:s.target_element)||r,pageUrl:i.pageUrl,sourceContext:I(I({},i.sourceContext),{timestamp:n.lastTimestamp}),triggerEventId:o[0],relatedEventIds:o.length?o:void 0,detectionSource:"rule_engine",ruleVersion:e.config.ruleVersion,payloadAllowlist:e.config.payloadAllowlist,payload:{clickCount:n.clickCount,timeWindowMs:n.timeWindowMs,click_count:n.clickCount,time_window_ms:n.timeWindowMs,selector:n.node.selector||""}},null!=(r=t.reportStruggle))&&r.call(t,s)},onSlowClick:function(e,t,n){},handleEventCreated:function(i,o,e){var t,s=this,a=(this.checkClickContext(i,o),Date.now()),n=o.config.click||Yp.click,r=Math.max(null!=(t=n.errorClickWindowMs)?t:3e3,null!=(t=n.rageClickWindowMs)?t:3e3,null!=(t=n.deadClickWindowMs)?t:3e3);o.recentClicks=o.recentClicks.filter(function(e){return a-e.timestamp<=r}),e.forEach(function(e){var t,n,r;e&&e.event_type!==x.STRUGGLE&&(t=e.timestamp||a,n=s.getEventPageUrl(e),e.event_type===x.CLICK?(r=(null==(r=e.data)?void 0:r.target_element)||(null==(r=e.data)?void 0:r.target_id)||(null==(r=e.data)?void 0:r.target_class)||"unknown",o.recentClicks.push({eventId:e.event_id,timestamp:t,pageUrl:n,ownerKey:r}),o.recentClicks=o.recentClicks.slice(-200)):(e.event_type===x.PAGE_VIEW&&s.closeClickGroups(o),s.isEffectiveActionEvent(o,e)&&(s.resolvePendingDeadClicks(o,s.getEffectiveActionReason(e),t,n),null!=(r=o.clickDetector)&&r.markEffectiveAction(s.getEffectiveActionReason(e))),Qp.has(e.event_type)?s.tryReportErrorClick(i,o,e):e.event_type===x.PAGE_LOAD||e.event_type===x.true?s.tryReportSlowPage(i,o,e):e.event_type===x.FORM_FOCUS?(s.trackFormFocus(o,e),s.trackFormChangeAndZigzag(i,o,e)):e.event_type===x.FORM_CHANGE?s.trackFormChangeAndZigzag(i,o,e):e.event_type===x.FORM_BLUR?s.tryReportLongFocusTime(i,o,e):e.event_type===x.FORM_SUBMIT?s.trackFormSubmitResult(o,e):e.event_type===x.FORM_SUBMIT_RESULT?(s.trackFormSubmitResult(o,e),s.tryReportFormValidationError(i,o,e)):e.event_type===x.PAGE_VIEW&&null!=(n=null==(t=e.data)?void 0:t.event_properties)&&n.navigation_type&&s.tryReportBackForward(i,o,e)),s.tryReportCustomStruggle(i,o,e))})},isEffectiveActionEvent:function(e,t){var n;return!1!==(null==(n=e.config.click)?void 0:n.enabled)&&(t.event_type===x.API_CALL?!1!==(null==(n=e.config.click)?void 0:n.resolveOnApiSuccess):t.event_type===x.PAGE_VIEW&&null!=(n=null==(n=t.data)?void 0:n.event_properties)&&n.navigation_type?!1!==(null==(n=e.config.click)?void 0:n.resolveOnSpaNavigation):em.has(t.event_type)?!1!==(null==(n=e.config.click)?void 0:n.resolveOnFormAction):!0===(null==(e=t.data)?void 0:e.is_effective_action))},getEffectiveActionReason:function(e){return e.event_type===x.API_CALL?"api_success":e.event_type===x.PAGE_VIEW?"spa_navigation":e.event_type===x.FORM_CHANGE?"form_change":e.event_type===x.FORM_SUBMIT||e.event_type===x.FORM_SUBMIT_RESULT?"form_submit":"custom"},getFormStateKey:function(e,t){return e||t||"unknown_form"},ensureFormState:function(e,t,n){var r=this.getFormStateKey(t,n);return e.formStateMap.has(r)||e.formStateMap.set(r,{formId:t||r,pageUrl:n||"",touchedFieldIds:new Set,requiredFieldIds:new Set,changedFieldIds:new Set,focusPath:[],zigzagHits:0,hasSuccessSubmit:!1,reportedZigzag:!1,reportedUncompleted:!1}),e.formStateMap.get(r)},recordFormTouch:function(e,t){var n,e=this.ensureFormState(e,null==(e=null==t?void 0:t.data)?void 0:e.form_id,null==t?void 0:t.page_url),r=String((null==(r=null==t?void 0:t.data)?void 0:r.field_id)||"");return r&&(e.touchedFieldIds.add(r),!0===(null==(n=t.data)?void 0:n.is_required)&&e.requiredFieldIds.add(r),t.event_type===x.FORM_CHANGE)&&e.changedFieldIds.add(r),null!=t&&t.page_url&&(e.pageUrl=t.page_url),e},trackFormFocus:function(e,t){var n,r=t,i=String((null==(i=null==r?void 0:r.data)?void 0:i.field_id)||"");i&&((n=this.recordFormTouch(e,r)).focusPath.push(i),12<n.focusPath.length&&n.focusPath.shift(),e.focusStartMap.set(i,{timestamp:t.timestamp||Date.now(),eventId:t.event_id,formId:null==(n=null==r?void 0:r.data)?void 0:n.form_id,pageUrl:null==r?void 0:r.page_url}))},trackFormChangeAndZigzag:function(e,t,n){var r,i,o,s,a;n.event_type!==x.FORM_CHANGE?n.event_type!==x.FORM_FOCUS||(a=(i=this.recordFormTouch(t,r=n)).focusPath).length<4||i.reportedZigzag||(o=(a=a.slice(-4))[0],s=a[1],!o)||!s||o===s||o!==a[2]||s!==a[3]||i.changedFieldIds.size<2||(i.zigzagHits+=1,a=null!=(s=null==(o=t.config.form)?void 0:o.zigzagMinCount)?s:2,i.zigzagHits<a)||(i.reportedZigzag=!0,null==(o=e.reportStruggle))||o.call(e,{type:"form_zigzag",ownerType:"form",ownerKey:i.formId,pageUrl:i.pageUrl,formId:i.formId,fieldId:String((null==(s=null==r?void 0:r.data)?void 0:s.field_id)||""),triggerEventId:r.event_id,relatedEventIds:[r.event_id],detectionSource:"rule_engine",ruleVersion:t.config.ruleVersion,payloadAllowlist:t.config.payloadAllowlist,payload:{zigzag_hits:i.zigzagHits,changed_field_count:i.changedFieldIds.size}}):this.recordFormTouch(t,n)},trackFormSubmitResult:function(e,t){t.event_type!==x.FORM_SUBMIT&&t.event_type!==x.FORM_SUBMIT_RESULT||((e=this.recordFormTouch(e,t)).lastSubmitEventId=t.event_id,t.event_type===x.FORM_SUBMIT_RESULT&&"success"===(null==(t=null==(t=t.data)?void 0:t.event_properties)?void 0:t.status)&&(e.hasSuccessSubmit=!0))},reportPendingUncompletedForms:function(t,n,r){var i=this;n.formStateMap.forEach(function(e){i.tryReportUncompletedForm(t,n,e,r)})},tryReportUncompletedForm:function(e,t,n,r){var i,o,s,a;n.reportedUncompleted||n.hasSuccessSubmit||0===n.touchedFieldIds.size||(s=0<(o=n.requiredFieldIds.size)?o:n.touchedFieldIds.size)<=0||(s=n.changedFieldIds.size/s)<(a=null!=(a=null==(a=t.config.form)?void 0:a.incompleteMinFieldRatio)?a:.3)||(n.reportedUncompleted=!0,null==(i=e.reportStruggle))||i.call(e,{type:"uncompleted_form",ownerType:"form",ownerKey:n.formId,pageUrl:n.pageUrl,formId:n.formId,triggerEventId:n.lastSubmitEventId,relatedEventIds:n.lastSubmitEventId?[n.lastSubmitEventId]:void 0,detectionSource:"rule_engine",ruleVersion:t.config.ruleVersion,payloadAllowlist:t.config.payloadAllowlist,payload:{touched_field_count:n.touchedFieldIds.size,changed_field_count:n.changedFieldIds.size,required_field_count:o,changed_ratio:Number(s.toFixed(4)),threshold_ratio:a}})},tryReportLongFocusTime:function(e,t,n){var r,i,o,s,a=String((null==(a=null==n?void 0:n.data)?void 0:a.field_id)||"");a&&(i=t.focusStartMap.get(a))&&(t.focusStartMap.delete(a),o=null!=(o=null==(o=t.config.form)?void 0:o.longFocusThresholdMs)?o:2e4,(s=Math.max((n.timestamp||Date.now())-i.timestamp,0))<o||null==(r=e.reportStruggle)||r.call(e,{type:"long_focus_time",ownerType:"field",ownerKey:a,pageUrl:(null==n?void 0:n.page_url)||i.pageUrl,formId:(null==(r=null==n?void 0:n.data)?void 0:r.form_id)||i.formId,fieldId:a,triggerEventId:n.event_id,relatedEventIds:[i.eventId||"",n.event_id].filter(Boolean),detectionSource:"rule_engine",ruleVersion:t.config.ruleVersion,payloadAllowlist:t.config.payloadAllowlist,payload:{focus_duration_ms:s,threshold_ms:o}}))},tryReportErrorClick:function(e,t,n){var r,i,o;t.recentClicks.length&&(i=null!=(o=(t.config.click||Yp.click).errorClickWindowMs)?o:3e3,o=g(t.recentClicks).reverse().find(function(e){return 0<=n.timestamp-e.timestamp&&n.timestamp-e.timestamp<=i}))&&null!=(r=e.reportStruggle)&&r.call(e,{type:"error_click",ownerType:"element",ownerKey:o.ownerKey,pageUrl:o.pageUrl||n.page_url,triggerEventId:o.eventId,relatedEventIds:[n.event_id],detectionSource:"rule_engine",ruleVersion:t.config.ruleVersion,payloadAllowlist:t.config.payloadAllowlist,payload:{errorEventType:n.event_type}})},tryReportSlowPage:function(e,t,n){var r,i,o,s=t.config.performance||Yp.performance;s.enabled&&(i=(null==(i=n.data)?void 0:i.measurements)||{},r=Number(i.lcp||0),i=Number(i.inp||0),o=null!=(o=s.slowPageLcpThreshold)?o:4e3,s=null!=(s=s.slowPageInpThreshold)?s:500,o<=r||s<=i)&&null!=(o=e.reportStruggle)&&o.call(e,{type:"slow_page",ownerType:"page",ownerKey:n.page_url||("undefined"!=typeof window?window.location.href:""),pageUrl:n.page_url,triggerEventId:n.event_id,detectionSource:"rule_engine",ruleVersion:t.config.ruleVersion,payloadAllowlist:t.config.payloadAllowlist,payload:{lcp:r,inp:i,sourceEventType:n.event_type}})},tryReportFormValidationError:function(e,t,n){var r,i,o,s,a=(null==(a=null==n?void 0:n.data)?void 0:a.event_properties)||{},l=(null==n?void 0:n.data)||{};"fail"===String((null==a?void 0:a.status)||(null===(i=l)?void 0:i.status)||"")&&(i=String((null==a?void 0:a.field_id)||(null===(i=l)?void 0:i.field_id)||""),o=String((null==a?void 0:a.form_id)||(null===(o=l)?void 0:o.form_id)||""),s=i||o||(null==n?void 0:n.page_url)||"unknown",null!=(r=e.reportStruggle))&&r.call(e,{type:"form_validation_error",ownerType:i?"field":"form",ownerKey:s,pageUrl:null==n?void 0:n.page_url,formId:o,fieldId:i,triggerEventId:n.event_id,relatedEventIds:[n.event_id],detectionSource:"rule_engine",ruleVersion:t.config.ruleVersion,payloadAllowlist:t.config.payloadAllowlist,payload:{validation_code:(null==a?void 0:a.validation_code)||(null===(r=l)?void 0:r.validation_code),validation_message:null==(e=null==n?void 0:n.data)?void 0:e.validation_message,sourceEventType:n.event_type}})},tryReportBackForward:function(e,t,n){var r,i,o=t.config.navigation||Yp.navigation;o.enabled&&o.backForwardAsStruggle&&(n=null==(n=null==(o=n)?void 0:o.data)?void 0:n.event_properties,"back"!==(i=String((null==n?void 0:n.navigation_type)||""))&&"forward"!==i||null==(r=e.reportStruggle)||r.call(e,{type:"back_forward",ownerType:"page",ownerKey:String((null==n?void 0:n.to_page)||"")||(null==o?void 0:o.page_url)||"unknown",pageUrl:null==o?void 0:o.page_url,triggerEventId:o.event_id,relatedEventIds:[o.event_id],detectionSource:"rule_engine",ruleVersion:t.config.ruleVersion,payloadAllowlist:t.config.payloadAllowlist,payload:{navigation_type:i,from_page:null==n?void 0:n.from_page,to_page:null==n?void 0:n.to_page}}))},tryReportCustomStruggle:function(n,r,i){var e=r.config.custom||Yp.custom;e.enabled&&"function"==typeof e.detector&&(e=e.detector({event:i,tdem:n}),(Array.isArray(e)?e:e?[e]:[]).forEach(function(e){var t,e=I(I({},e),{type:(null==e?void 0:e.type)||"custom_struggle",ownerType:(null==e?void 0:e.ownerType)||"app",ownerKey:(null==e?void 0:e.ownerKey)||i.page_url||"custom",ruleVersion:(null==e?void 0:e.ruleVersion)||r.config.ruleVersion,payloadAllowlist:(null==e?void 0:e.payloadAllowlist)||r.config.payloadAllowlist,detectionSource:(null==e?void 0:e.detectionSource)||"custom"});null!=(t=n.reportStruggle)&&t.call(n,e)}))},cleanupInstance:function(e){var t=this.instanceStates.get(e);t&&!t.closing&&(t.closing=!0,this.closeClickGroups(t,!0),t.onEventCreated&&e.lifeCycle.remove("tdemEventCreated",t.onEventCreated),t.onDestroy&&e.lifeCycle.remove("destroy",t.onDestroy),t.clickDetector&&t.clickDetector.stop(),t.pendingDeadClicks.forEach(function(e){clearTimeout(e.timeout)}),t.pendingDeadClicks.clear(),this.reportPendingUncompletedForms(e,t,"destroy"),t.focusStartMap.clear(),t.formStateMap.clear(),t.removeDomListeners.forEach(function(e){return e()}),t.removeDomListeners=[],this.instanceStates.delete(e),0===this.instanceStates.size)&&this.restoreWindowOpenHook()},destroy:function(){var n=this.option||this;n.instanceStates.forEach(function(e,t){n.cleanupInstance(t)}),n.instanceStates.clear(),n.restoreWindowOpenHook()}})),nm={enabled:!0,threshold:2e3,noResponseThreshold:5e3,sampleRate:1},rm=new Map,im=new e({name:"lagMonitor",onNewTdem:function(o,e){t=e,void 0===(r=null!=(n=o.config)&&n.debug?function(e,t){"undefined"!=typeof console&&console.warn&&console.warn("[TDEM] "+e+": "+t+", fallback applied")}:function(){})&&(r=function(){});var t,r,n,s=!1===t?I(I({},nm),{enabled:!1}):!0===t||void 0===t?I({},nm):!t||"object"!=typeof t||Array.isArray(t)?(r("lagMonitor","invalid_type"),I({},nm)):(n=I({},nm),void 0!==t.enabled&&("boolean"==typeof t.enabled?n.enabled=t.enabled:r("lagMonitor.enabled","invalid_type")),n.threshold=(i=function(e,t,n){return void 0===e?n:"number"!=typeof e?(r(t,"invalid_type"),n):Number.isFinite(e)?e<=0?(r(t,"out_of_range"),n):e:(r(t,"invalid_number"),n)})(t.threshold,"lagMonitor.threshold",nm.threshold),n.noResponseThreshold=i(t.noResponseThreshold,"lagMonitor.noResponseThreshold",nm.noResponseThreshold),void 0!==t.sampleRate&&("number"!=typeof t.sampleRate?r("lagMonitor.sampleRate","invalid_type"):Number.isFinite(t.sampleRate)?t.sampleRate<0||1<t.sampleRate?r("lagMonitor.sampleRate","out_of_range"):n.sampleRate=t.sampleRate:r("lagMonitor.sampleRate","invalid_number")),n.noResponseThreshold<=n.threshold&&(n.noResponseThreshold=Math.max(5e3,n.threshold+1),r("lagMonitor.noResponseThreshold","relation_conflict")),n);if(s.enabled&&"undefined"!=typeof PerformanceObserver&&PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("long-animation-frame")&&(i=s.sampleRate,Math.random()<i)){var i,a=[],l={observer:null,lagRecords:a,sampled:!0,destroyed:!1,onDestroy:function(){return Bp(o)}};rm.set(o,l),o.lifeCycle.on("destroy",l.onDestroy);try{l.observer=new PerformanceObserver(function(e){if(!l.destroyed)try{e.getEntries().forEach(function(e){var t,n,r,i;l.destroyed||e.duration<=s.threshold||(t=null==(t=e.scripts)?void 0:t[0],e={name:e.name,timestamp:Date.now(),entryType:e.entryType,startTime:e.startTime,duration:e.duration,invoker:null==t?void 0:t.invoker,sourceURL:null==t?void 0:t.sourceURL},a.push(e),100<a.length&&a.shift(),t=o,r=(e=e).duration>=(n=s).noResponseThreshold,i=P(t),e={event_id:A(),event_type:r?x.NO_RESPONSE:x.LAG_DETECTED,event_category:r?M.ERROR:M.PERFORMANCE,timestamp:Date.now(),page_url:(null==(r=t.getOriginFrom)?void 0:r.call(t))||window.location.href,data:I(I({measurements:{duration:Up(e.duration),start_time_ms:Up(e.startTime),lag_threshold_ms:n.threshold,no_response_threshold_ms:n.noResponseThreshold},event_properties:{entry_type:e.entryType||"long-animation-frame",source_url:zp(e.sourceURL,2048),invoker:zp(e.invoker,256)}},i?{replay_id:i}:{}),{tags:{environment:(null==(r=t.config)?void 0:r.env)||"production",version:String((null==(n=t.config)?void 0:n.version)||"")}})},t.reportTDEMEvent(e))})}catch(e){}}),l.observer.observe({type:"long-animation-frame",buffered:!1})}catch(e){Bp(o)}}},getLagRecords:function(e){return g((null==(e=rm.get(e))?void 0:e.lagRecords)||[])},destroy:function(){Array.from(rm.keys()).forEach(Bp)}}),om={enabled:!0,containers:["body","html","#app","#root"],ignoreContainers:[],containerMatchers:{tagName:["body","html"],id:["app","root"],className:[]},ignoreMatchers:{tagName:[],id:[],className:[]},detectStartPosition:{x:0,y:0},emptyElementsPercent:70,sameElementsPercent:70,debounceDuration:2e3,everySideSampleNumber:9,disableSameElementsCheck:!0,ignoreElesWhenDomChange:[],reDetectInterval:2e3,samePointDepth:5,customBlankScreenDector:null},sm=["canvas","img","svg","iframe"],am=(0,new Map),lm=new e({name:"blankScreen",onNewTdem:function(_,e){var S,E,C,R,T,t,O,n,r,i,o,s,a,l,u,c,d,f,h,p,m,v=this;"undefined"!=typeof document&&document.elementsFromPoint&&(e=e,void 0===(a=null!=(m=_.config)&&m.debug?function(e,t){"undefined"!=typeof console&&console.warn&&console.warn("[TDEM] "+e+": "+t+", fallback applied")}:function(){})&&(a=function(){}),m=Vp(),(S=!1===e?I(I({},m),{enabled:!1}):!0===e||void 0===e?m:!e||"object"!=typeof e||Array.isArray(e)?(a("blankScreen","invalid_type"),m):(l="containerMatchers"in(e=e)||"ignoreMatchers"in e,p="containers"in e||"ignoreContainers"in e,u=function(e,t,n,r){return void 0===e?g(t):Array.isArray(e)&&e.length<=100&&e.every(function(e){return"string"==typeof e&&0<e.trim().length&&e.trim().length<=r})?e.map(function(e){return e.trim()}):(a(n,"invalid_array"),g(t))},h=function(e,t,n){return void 0===e?qp(t):!e||"object"!=typeof e||Array.isArray(e)?(a(n,"invalid_type"),qp(t)):{tagName:u((e=e).tagName,t.tagName||[],n+".tagName",128),id:u(e.id,t.id||[],n+".id",128),className:u(e.className,t.className||[],n+".className",128)}},c=function(e,t,n,r){return void 0===e?t:"number"!=typeof e?(a(n,"invalid_type"),t):Number.isFinite(e)?r(e)?e:(a(n,"out_of_range"),t):(a(n,"invalid_number"),t)},d=function(e,t,n,r,i){return c(e,t,n,function(e){return Number.isInteger(e)&&r<=e&&e<=i})},f=Vp(),void 0!==e.enabled&&("boolean"==typeof e.enabled?f.enabled=e.enabled:a("blankScreen.enabled","invalid_type")),f.containers=u(e.containers,m.containers,"blankScreen.containers",256),f.ignoreContainers=u(e.ignoreContainers,m.ignoreContainers,"blankScreen.ignoreContainers",256),f.containerMatchers=h(e.containerMatchers,m.containerMatchers,"blankScreen.containerMatchers"),f.ignoreMatchers=h(e.ignoreMatchers,m.ignoreMatchers,"blankScreen.ignoreMatchers"),p&&!l&&(f.containerMatchers={tagName:[],id:[],className:[]},f.ignoreMatchers={tagName:[],id:[],className:[]}),void 0===(h=e.detectStartPosition)||h&&"object"==typeof h&&!Array.isArray(h)?f.detectStartPosition={x:c((p=h||{}).x,m.detectStartPosition.x,"blankScreen.detectStartPosition.x",function(e){return 0<=e}),y:c(p.y,m.detectStartPosition.y,"blankScreen.detectStartPosition.y",function(e){return 0<=e})}:a("blankScreen.detectStartPosition","invalid_type"),f.emptyElementsPercent=c(e.emptyElementsPercent,m.emptyElementsPercent,"blankScreen.emptyElementsPercent",function(e){return 0<e&&e<=100}),f.sameElementsPercent=c(e.sameElementsPercent,m.sameElementsPercent,"blankScreen.sameElementsPercent",function(e){return 0<e&&e<=100}),f.debounceDuration=c(e.debounceDuration,m.debounceDuration,"blankScreen.debounceDuration",function(e){return 0<=e}),f.reDetectInterval=c(e.reDetectInterval,m.reDetectInterval,"blankScreen.reDetectInterval",function(e){return 0<e}),f.everySideSampleNumber=d(e.everySideSampleNumber,m.everySideSampleNumber,"blankScreen.everySideSampleNumber",2,50),f.samePointDepth=d(e.samePointDepth,m.samePointDepth,"blankScreen.samePointDepth",1,20),void 0!==e.disableSameElementsCheck&&("boolean"==typeof e.disableSameElementsCheck?f.disableSameElementsCheck=e.disableSameElementsCheck:a("blankScreen.disableSameElementsCheck","invalid_type")),f.ignoreElesWhenDomChange=u(e.ignoreElesWhenDomChange,m.ignoreElesWhenDomChange,"blankScreen.ignoreElesWhenDomChange",256),void 0!==e.customBlankScreenDector&&(null===e.customBlankScreenDector||"function"==typeof e.customBlankScreenDector?f.customBlankScreenDector=e.customBlankScreenDector:a("blankScreen.customBlankScreenDector","invalid_type")),f)).enabled)&&(l=((e,t,n)=>({totalSamplePoints:e=4*e-3,whitePointThreshold:Math.floor(e*t/100),samePointThreshold:Math.floor(e*n/100)}))(S.everySideSampleNumber,S.emptyElementsPercent,S.sameElementsPercent),E=l.totalSamplePoints,C=l.whitePointThreshold,R=l.samePointThreshold,T={observer:null,detectTimer:null,bodyWaitTimer:null,bodyWaitFrame:null,idleCallbackId:null,destroyed:!1,initialDetectionPending:!0,incidentStatus:"healthy",preDetectResult:null,triggerType:"dom_change",onErrorOccurred:function(){},onDestroy:function(){return Zp(_)},handlePageHide:function(){},handleBeforeUnload:function(){},handleVisibilityChange:function(){}},am.set(_,T),t=function(){return D(v,void 0,void 0,function(){var u,c,d,f,h,p,m,v,g,y,w,b,k;return L(this,function(e){var t,n,r,i,o,s,a,l;if(!T.destroyed)try{if("initial_load"===T.triggerType&&(T.initialDetectionPending=!1),u=window.innerHeight,c=window.innerWidth,d=S.detectStartPosition,f=d.x,h=d.y,c<=f||u<=h)return[2];if(p=[],v=m=0,((e,t,n,r)=>{for(var i=r.x,o=r.y,s=i+(e-i)/2,a=o+(t-o)/2,l=n+1,u=[],c=1;c<l;c+=1){var d=i+(e-i)*c/l,f=o+(t-o)*c/l;u.push({x:d,y:a}),c!==l/2&&u.push({x:s,y:f},{x:d,y:f},{x:d,y:t-f})}return u})(c,u,S.everySideSampleNumber,S.detectStartPosition).forEach(function(e){s=e.x,a=e.y,e=document.elementsFromPoint(s,a),e=(l=function(e){var t=e[0];if(t&&null!==t.shadowRoot){t=(null==(t=t.shadowRoot)?void 0:t.elementsFromPoint(s,a))||[];if(t.length>e.length)return l(t)}return e})(e),t=S.containers,n=S.ignoreContainers,r=S.containerMatchers,u=S.ignoreMatchers,e=e.map(jp),o=e.map(function(e){return e.selector});var t,n,r,i,o,s,a,l,u=(e=e[0])?(r=(i=!(!r||!(null!=(i=r.tagName)&&i.length||null!=(i=r.id)&&i.length||null!=(i=r.className)&&i.length)))?Wp(e,r):Hp(e,t),t=i?Wp(e,u):Hp(e,n),{isWhitePoint:r&&!t,selectorPointers:o}):{isWhitePoint:!1,selectorPointers:o};u.isWhitePoint&&(m+=1),p.push(u.selectorPointers)}),g=C<=m,y=!1,S.disableSameElementsCheck||(w=p.map(function(e){return e.slice(0,S.samePointDepth)}),o={},w.map(function(e){return e.join(" < ")}).forEach(function(e){o[e]=o[e]?o[e]+1:1}),s=Object.keys(o).map(function(e){return[e,o[e]]}).sort(function(e,t){return t[1]-e[1]})[0]||["",0],a=s[0],b={samePointerMap:o,maximumSamePointerClass:a,maximumSamePointerCounter:s[1]},y=R<=(v=b.maximumSamePointerCounter)&&(l=b.maximumSamePointerClass,!sm.some(function(e){return l.startsWith(e)}))),k=!1,S.customBlankScreenDector)try{k=!0===S.customBlankScreenDector()}catch(e){k=!1}if(!(g||y||k))return T.incidentStatus="healthy",T.preDetectResult=null,[2];if("reported"===T.incidentStatus)return[2];if("suspect"===T.incidentStatus&&T.preDetectResult)return t=T.preDetectResult,r=t.customTriggered?"custom":t.whitePointTriggered&&t.sameElementTriggered?"both":t.whitePointTriggered?"white_point":"same_element",i=P(_),t={event_id:A(),event_type:x.BLANK_SCREEN,event_category:M.ERROR,timestamp:Date.now(),page_url:(null==(n=_.getOriginFrom)?void 0:n.call(_))||window.location.href,data:I(I({measurements:{white_point_count:t.whitePointCount,same_point_count:t.samePointCount,total_sample_points:E,white_point_threshold:C,same_point_threshold:R,white_point_ratio:Gp(t.whitePointCount/E,6),same_point_ratio:Gp(t.samePointCount/E,6),viewport_width_px:Math.max(0,Math.round(window.innerWidth)),viewport_height_px:Math.max(0,Math.round(window.innerHeight))},event_properties:{trigger_reason:r,trigger_type:t.triggerType,detection_method:t.customTriggered?"custom_detector":"viewport_sampling",same_elements_check_enabled:String(!S.disableSameElementsCheck)}},i?{replay_id:i}:{}),{tags:{environment:(null==(n=_.config)?void 0:n.env)||"production",version:String((null==(r=_.config)?void 0:r.version)||"")}})},_.reportTDEMEvent(t),T.incidentStatus="reported",T.preDetectResult=null,[2];T.preDetectResult={whitePointCount:m,samePointCount:v,whitePointTriggered:g,sameElementTriggered:y,customTriggered:k,triggerType:T.triggerType},T.incidentStatus="suspect",T.detectTimer=setTimeout(function(){T.detectTimer=null,O()},S.reDetectInterval)}catch(e){}return[2]})})},O=function(){return D(v,void 0,void 0,function(){return L(this,function(e){switch(e.label){case 0:if(T.destroyed)return[2];if("function"!=typeof window.requestIdleCallback)return[3,5];e.label=1;case 1:return e.trys.push([1,2,,4]),T.idleCallbackId=window.requestIdleCallback(function(e){T.idleCallbackId=null,T.destroyed||(0<e.timeRemaining()?t():T.detectTimer=setTimeout(function(){T.detectTimer=null,t()},0))}),[3,4];case 2:return e.sent(),[4,t()];case 3:return e.sent(),[3,4];case 4:return[3,7];case 5:return[4,t()];case 6:e.sent(),e.label=7;case 7:return[2]}})})},n=function(e){void 0===e&&(e="dom_change"),T.destroyed||"suspect"===T.incidentStatus||"initial_load"!==e&&T.initialDetectionPending||(T.triggerType=e,T.detectTimer&&clearTimeout(T.detectTimer),T.detectTimer=setTimeout(function(){T.detectTimer=null,O()},S.debounceDuration))},T.onErrorOccurred=function(){return n("error")},_.lifeCycle.on("errorOccurred",T.onErrorOccurred),_.lifeCycle.on("destroy",T.onDestroy),r=function(){!T.destroyed&&document.body&&(T.observer=new MutationObserver(function(e){var t=null==(t=e[0])?void 0:t.target;if(1===e.length&&t instanceof Element){e=jp(t).selector;if(S.ignoreElesWhenDomChange.includes(e))return}n("dom_change")}),T.observer.observe(document.body,{childList:!0,subtree:!0}))},document.body?r():(i=window.requestAnimationFrame||function(e){return setTimeout(e,1e3/60)},o=function(){document.body?(T.bodyWaitTimer&&clearTimeout(T.bodyWaitTimer),r()):T.bodyWaitFrame=i(o)},T.bodyWaitFrame=i(o),T.bodyWaitTimer=setTimeout(function(){null!==T.bodyWaitFrame&&((window.cancelAnimationFrame||clearTimeout)(T.bodyWaitFrame),T.bodyWaitFrame=null)},1e4)),T.handlePageHide=s=function(){T.destroyed||(T.detectTimer&&clearTimeout(T.detectTimer),T.triggerType="page_state",T.preDetectResult&&(T.preDetectResult.triggerType="page_state"),t())},T.handleBeforeUnload=s,T.handleVisibilityChange=function(){"hidden"===document.visibilityState&&s()},window.addEventListener("pagehide",T.handlePageHide),window.addEventListener("beforeunload",T.handleBeforeUnload),document.addEventListener("visibilitychange",T.handleVisibilityChange),n("initial_load"))},destroy:function(){Array.from(am.keys()).forEach(Zp)}}),um={enabled:!0,enableMemoryReport:!0,enableOOMReport:!0,oomThreshold:100,memoryReportInterval:6e4,oomCheckInterval:1e4,monitorPages:[],sampleRate:1},cm=new Map,dm=function(e){return"number"==typeof e&&Number.isFinite(e)},m=new e({name:"memoryMonitor",onNewTdem:function(n,e){r=n;var r,i,o,s,t,a=!1===(e=e)?I(I({},um),{enabled:!1}):(i=e&&"object"==typeof e?e:{},void 0===e||!0===e||e&&"object"==typeof e&&!Array.isArray(e)||Jp(r,"memoryMonitor","invalid_type"),o=I(I({},um),{oomThreshold:0<(e=(null==(e=Kp())?void 0:e.limit)||0)?Math.round(e/1024/1024*.9):100}),["enabled","enableMemoryReport","enableOOMReport"].forEach(function(e){void 0!==i[e]&&("boolean"==typeof i[e]?o[e]=i[e]:Jp(r,"memoryMonitor."+e,"invalid_type"))}),["oomThreshold","memoryReportInterval","oomCheckInterval"].forEach(function(e){var t=i[e];void 0!==t&&(dm(t)&&0<t?o[e]=t:Jp(r,"memoryMonitor."+e,dm(t)?"out_of_range":"invalid_number"))}),void 0!==i.sampleRate&&(dm(i.sampleRate)&&0<=i.sampleRate&&i.sampleRate<=1?o.sampleRate=i.sampleRate:Jp(r,"memoryMonitor.sampleRate","out_of_range")),void 0!==i.monitorPages&&(Array.isArray(i.monitorPages)&&i.monitorPages.length<=100&&i.monitorPages.every(function(e){return"string"==typeof e&&!!e||e instanceof RegExp})?o.monitorPages=g(i.monitorPages):Jp(r,"memoryMonitor.monitorPages","invalid_value")),o);!a.enabled||!(()=>{var e;try{return"undefined"!=typeof window&&null!=(e=window.performance)&&e.memory}catch(e){}})()||Math.random()>=a.sampleRate||(e=a.monitorPages).length&&(t="undefined"==typeof window?"":window.location.href,!e.some(function(e){return"string"==typeof e?t.includes(e):(e.lastIndex=0,e.test(t))}))||(s={config:a,reportTimer:null,oomCheckTimer:null,lastOOMTime:0,records:[],destroyed:!1,onDestroy:function(){return $p(n)},onPageExit:function(){return $p(n)}},cm.set(n,s),n.lifeCycle.on("destroy",s.onDestroy),"undefined"!=typeof window&&(window.addEventListener("pagehide",s.onPageExit),window.addEventListener("beforeunload",s.onPageExit)),a.enableMemoryReport&&(s.reportTimer=setInterval(function(){return Xp(n,s,x.MEMORY_USAGE)},a.memoryReportInterval)),a.enableOOMReport&&(s.oomCheckTimer=setInterval(function(){var e=Kp(),t=Date.now();e&&e.used/1024/1024>a.oomThreshold&&3e5<t-s.lastOOMTime&&(s.lastOOMTime=t,Xp(n,s,x.MEMORY_OOM))},a.oomCheckInterval)))},destroy:function(){Array.from(cm.keys()).forEach($p)}});function fm(e,t){try{var n={projectKey:e,document:t,timestamp:Date.now()};localStorage.setItem("TDEM_SAMPLE_CONFIG",JSON.stringify(n))}catch(e){}}function hm(e){var t;try{var n,r=localStorage.getItem("TDEM_SAMPLE_CONFIG");return r?!((n=JSON.parse(r)).projectKey!==e||6048e5<=Date.now()-n.timestamp)&&null!=(t=n.document)&&t.event?n.document:null:null}catch(e){return null}}function pm(e,t){try{var n=e.config.sessionReplay,r=t,i=(!1===n&&(r=I(I({},t),{replay:I(I({},t.replay),{enabled:!1})})),e._tdemSampleConfig=r,e._tdemSampleGate||null);null!=i&&i.decide(!0),o=e,l=(null==r?void 0:r.replay)||{},u={},"boolean"==typeof l.enabled&&(u.enabled=l.enabled),void 0!==l.experience_sample_rate&&(u.experience_sample_rate=Number(l.experience_sample_rate)),"boolean"==typeof l.error_traceback&&(u.error_traceback=l.error_traceback),void 0!==l.error_sample_rate&&(u.error_sample_rate=Number(l.error_sample_rate)),s=u,s=Lp(o.config.sessionReplay,s),o._effectiveReplayPolicy=s,o._replaySampled=s.enabled,"function"==typeof(o=null==(o=null==(a=null==(a=null==(o=o.constructor.installedPlugins)?void 0:o.find)?void 0:a.call(o,function(e){return e&&"sessionReplay"===e.name}))?void 0:a.option)?void 0:o.applyEffectivePolicy)&&o.call(a.option,s)}catch(t){console.warn("[TDEM] sample config apply failed",t),e._tdemSampleConfig=rt}var o,s,a,l,u}function mm(e,t){var n=e.config.sampleConfigPreference||"remote-first",e=e.config.sampleConfig,r=n||"remote-first";try{return"local-first"===r?e||t||rt:t||e||rt}catch(n){return e||rt}}var vm=new e({name:"tdemConfig",onNewTdem:function(e){try{var t=e._prefetchedConfigData;null!=t&&t.event?pm(e,mm(e,t)):pm(e,mm(e,null)),function(s){var a;D(this,void 0,void 0,function(){var n,r,i,o;return L(this,function(e){switch(e.label){case 0:if(n=s.config.id,null!=(r=s._prefetchedConfigData)&&r.event)return delete s._prefetchedConfigData,i=mm(s,r),n&&fm(n,i),pm(s,i),[2];if(!n)return pm(s,mm(s,null)),[2];if(t=(s.config.url||"").replace(/\/+$/,""),!(r=t?t+"/api/v1/sample-config":""))return pm(s,mm(s,hm(n))),[2];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,s.transportRequest({kind:"config",url:r,method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({project_key:n})})];case 2:if(!(o=e.sent()).ok)throw new Error("HTTP "+o.status);if(0===(o="string"==typeof o.body?JSON.parse(o.body):o.body).code&&null!=(a=o.data)&&a.event)return i=mm(s,o.data),fm(n,i),pm(s,i),[2];throw new Error("API error: code="+o.code);case 3:return o=e.sent(),console.warn("[TDEM] Failed to fetch sample-config:",o),pm(s,mm(s,hm(n))),[3,4];case 4:return[2]}var t})})}(e)}catch(t){console.warn("[TDEM] tdemConfig init failed",t),pm(e,rt)}}});return r.entryName="tdem-web-sdk",r.use(An),r.use(En),r.use(Rt),r.use(oi),r.use(ni),r.use(St),r.use(n),r.use(ai),r.use(bi),r.use(Yn),r.use(tr),r.use(Rn),r.use(vm),r.use(f),r.use(tm),r.use(im),r.use(lm),r.use(m),w.default=r,w.registerCgiRequestFinalizer=on,Object.defineProperty(w,"__esModule",{value:!0}),w})({});