@devskin/browser-sdk 1.0.9 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/devskin.cjs.js +12191 -3923
- package/dist/devskin.cjs.js.map +1 -1
- package/dist/devskin.esm.js +12191 -3923
- package/dist/devskin.esm.js.map +1 -1
- package/dist/devskin.umd.js +12191 -3923
- package/dist/devskin.umd.js.map +1 -1
- package/dist/devskin.umd.min.js +1 -15
- package/dist/devskin.umd.min.js.map +1 -1
- package/dist/recorder/rrweb.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/devskin.umd.min.js
CHANGED
|
@@ -1,16 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).DevSkin=t()}(this,function(){"use strict";class e{constructor(e){this.config=e}collect(){return{type:this.getDeviceType(),vendor:this.getVendor(),model:this.getModel(),os:this.getOS(),screen:this.getScreenInfo(),memory:this.getMemory(),cores:this.getCores(),connection:this.getConnection()}}getDeviceType(){const e=navigator.userAgent;return/(tablet|ipad|playbook|silk)|(android(?!.*mobi))/i.test(e)?"tablet":/Mobile|Android|iP(hone|od)|IEMobile|BlackBerry|Kindle|Silk-Accelerated|(hpw|web)OS|Opera M(obi|ini)/.test(e)?"mobile":e.includes("Windows")||e.includes("Macintosh")||e.includes("Linux")?"desktop":"unknown"}getVendor(){return navigator.vendor||void 0}getModel(){const e=navigator.userAgent.match(/\(([^)]+)\)/);if(e&&e[1])return e[1]}getOS(){const e=navigator.userAgent;let t="Unknown",n="";if(e.includes("Win"))t="Windows",e.includes("Windows NT 10.0")?n="10":e.includes("Windows NT 6.3")?n="8.1":e.includes("Windows NT 6.2")?n="8":e.includes("Windows NT 6.1")&&(n="7");else if(e.includes("Mac")){t="macOS";const o=e.match(/Mac OS X (\d+[._]\d+[._]\d+)?/);o&&o[1]&&(n=o[1].replace(/_/g,"."))}else if(e.includes("X11")||e.includes("Linux"))t="Linux";else if(e.includes("Android")){t="Android";const o=e.match(/Android (\d+\.?\d*)/);o&&o[1]&&(n=o[1])}else if(e.includes("iOS")||e.includes("iPhone")||e.includes("iPad")){t="iOS";const o=e.match(/OS (\d+_\d+(_\d+)?)/);o&&o[1]&&(n=o[1].replace(/_/g,"."))}return{name:t,version:n}}getScreenInfo(){return{width:window.screen.width,height:window.screen.height,orientation:this.getOrientation(),pixelRatio:window.devicePixelRatio||1}}getOrientation(){return window.screen.orientation?window.screen.orientation.type:window.innerWidth>window.innerHeight?"landscape":"portrait"}getMemory(){return navigator.deviceMemory}getCores(){return navigator.hardwareConcurrency}getConnection(){const e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(e)return{effectiveType:e.effectiveType,downlink:e.downlink,rtt:e.rtt,saveData:e.saveData}}}function t(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{c(o.next(e))}catch(e){r(e)}}function a(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(s,a)}c((o=o.apply(e,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;class n{constructor(e){this.config=e,this.geoData=null,this.config.captureLocation&&this.requestGeolocation()}collect(){return Object.assign({url:window.location.href,hostname:window.location.hostname,pathname:window.location.pathname,search:window.location.search,hash:window.location.hash,protocol:window.location.protocol,port:window.location.port,referrer:document.referrer},this.geoData)}requestGeolocation(){return t(this,void 0,void 0,function*(){try{const e=Intl.DateTimeFormat().resolvedOptions().timeZone;this.geoData={timezone:e},"geolocation"in navigator&&navigator.geolocation.getCurrentPosition(e=>{this.geoData=Object.assign(Object.assign({},this.geoData),{latitude:e.coords.latitude,longitude:e.coords.longitude}),this.reverseGeocode(e.coords.latitude,e.coords.longitude)},e=>{this.config.debug&&console.log("[DevSkin] Geolocation permission denied or error:",e)},{timeout:5e3,maximumAge:6e5})}catch(e){this.config.debug&&console.error("[DevSkin] Error requesting geolocation:",e)}})}reverseGeocode(e,n){return t(this,void 0,void 0,function*(){try{const t=yield fetch(`https://nominatim.openstreetmap.org/reverse?format=json&lat=${e}&lon=${n}&zoom=10&addressdetails=1`,{headers:{"User-Agent":"DevSkin-SDK/1.0"}});if(t.ok){const e=yield t.json();e.address&&(this.geoData=Object.assign(Object.assign({},this.geoData),{country:e.address.country,region:e.address.state||e.address.region,city:e.address.city||e.address.town||e.address.village}))}}catch(e){this.config.debug&&console.error("[DevSkin] Error reverse geocoding:",e)}})}}class o{constructor(e){this.config=e}collect(){return{name:this.getBrowserName(),version:this.getBrowserVersion(),engine:this.getEngine(),userAgent:navigator.userAgent,language:navigator.language,languages:navigator.languages?Array.from(navigator.languages):[navigator.language],cookieEnabled:navigator.cookieEnabled,doNotTrack:this.getDoNotTrack(),viewport:{width:window.innerWidth,height:window.innerHeight},timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,timezoneOffset:(new Date).getTimezoneOffset()}}getBrowserName(){const e=navigator.userAgent;return e.includes("Firefox")?"Firefox":e.includes("Edg")?"Edge":e.includes("Chrome")?"Chrome":e.includes("Safari")&&!e.includes("Chrome")?"Safari":e.includes("Opera")||e.includes("OPR")?"Opera":e.includes("Trident")||e.includes("MSIE")?"Internet Explorer":"Unknown"}getBrowserVersion(){const e=navigator.userAgent;let t=null;switch(this.getBrowserName()){case"Chrome":t=e.match(/Chrome\/(\d+\.\d+)/);break;case"Firefox":t=e.match(/Firefox\/(\d+\.\d+)/);break;case"Safari":t=e.match(/Version\/(\d+\.\d+)/);break;case"Edge":t=e.match(/Edg\/(\d+\.\d+)/);break;case"Opera":if(t=e.match(/(Opera|OPR)\/(\d+\.\d+)/),t)return t[2];break;case"Internet Explorer":if(t=e.match(/(MSIE |rv:)(\d+\.\d+)/),t)return t[2]}return t&&t[1]?t[1]:""}getEngine(){const e=navigator.userAgent;return e.includes("Gecko")&&e.includes("Firefox")?"Gecko":e.includes("AppleWebKit")?e.includes("Chrome")||e.includes("Edg")?"Blink":"WebKit":e.includes("Trident")?"Trident":"Unknown"}getDoNotTrack(){const e=navigator.doNotTrack||window.doNotTrack||navigator.msDoNotTrack;return"1"===e||"yes"===e||"0"!==e&&"no"!==e&&null}}var i,r,s,a,c,l=-1,d=function(e){addEventListener("pageshow",function(t){t.persisted&&(l=t.timeStamp,e(t))},!0)},u=function(){return window.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},h=function(){var e=u();return e&&e.activationStart||0},g=function(e,t){var n=u(),o="navigate";return l>=0?o="back-forward-cache":n&&(document.prerendering||h()>0?o="prerender":document.wasDiscarded?o="restore":n.type&&(o=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:o}},p=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var o=new PerformanceObserver(function(e){Promise.resolve().then(function(){t(e.getEntries())})});return o.observe(Object.assign({type:e,buffered:!0},n||{})),o}}catch(e){}},m=function(e,t,n,o){var i,r;return function(s){t.value>=0&&(s||o)&&((r=t.value-(i||0))||void 0===i)&&(i=t.value,t.delta=r,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,n),e(t))}},f=function(e){requestAnimationFrame(function(){return requestAnimationFrame(function(){return e()})})},I=function(e){var t=function(t){"pagehide"!==t.type&&"hidden"!==document.visibilityState||e(t)};addEventListener("visibilitychange",t,!0),addEventListener("pagehide",t,!0)},v=function(e){var t=!1;return function(n){t||(e(n),t=!0)}},y=-1,C=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},S=function(e){"hidden"===document.visibilityState&&y>-1&&(y="visibilitychange"===e.type?e.timeStamp:0,w())},b=function(){addEventListener("visibilitychange",S,!0),addEventListener("prerenderingchange",S,!0)},w=function(){removeEventListener("visibilitychange",S,!0),removeEventListener("prerenderingchange",S,!0)},k=function(){return y<0&&(y=C(),b(),d(function(){setTimeout(function(){y=C(),b()},0)})),{get firstHiddenTime(){return y}}},A=function(e){document.prerendering?addEventListener("prerenderingchange",function(){return e()},!0):e()},T=[1800,3e3],M=function(e,t){t=t||{},A(function(){var n,o=k(),i=g("FCP"),r=p("paint",function(e){e.forEach(function(e){"first-contentful-paint"===e.name&&(r.disconnect(),e.startTime<o.firstHiddenTime&&(i.value=Math.max(e.startTime-h(),0),i.entries.push(e),n(!0)))})});r&&(n=m(e,i,T,t.reportAllChanges),d(function(o){i=g("FCP"),n=m(e,i,T,t.reportAllChanges),f(function(){i.value=performance.now()-o.timeStamp,n(!0)})}))})},E=[.1,.25],R={passive:!0,capture:!0},O=new Date,D=function(e,t){i||(i=t,r=e,s=new Date,L(removeEventListener),N())},N=function(){if(r>=0&&r<s-O){var e={entryType:"first-input",name:i.type,target:i.target,cancelable:i.cancelable,startTime:i.timeStamp,processingStart:i.timeStamp+r};a.forEach(function(t){t(e)}),a=[]}},F=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var n=function(){D(e,t),i()},o=function(){i()},i=function(){removeEventListener("pointerup",n,R),removeEventListener("pointercancel",o,R)};addEventListener("pointerup",n,R),addEventListener("pointercancel",o,R)}(t,e):D(t,e)}},L=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach(function(t){return e(t,F,R)})},x=[100,300],B=[2500,4e3],W={},V=[800,1800],G=function e(t){document.prerendering?A(function(){return e(t)}):"complete"!==document.readyState?addEventListener("load",function(){return e(t)},!0):setTimeout(t,0)},Z=function(e,t){t=t||{};var n=g("TTFB"),o=m(e,n,V,t.reportAllChanges);G(function(){var i=u();if(i){var r=i.responseStart;if(r<=0||r>performance.now())return;n.value=Math.max(r-h(),0),n.entries=[i],o(!0),d(function(){n=g("TTFB",0),(o=m(e,n,V,t.reportAllChanges))(!0)})}})};class U{constructor(e,t){this.config=e,this.transport=t,this.metrics={}}start(){!function(e,t){t=t||{},M(v(function(){var n,o=g("CLS",0),i=0,r=[],s=function(e){e.forEach(function(e){if(!e.hadRecentInput){var t=r[0],n=r[r.length-1];i&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(i+=e.value,r.push(e)):(i=e.value,r=[e])}}),i>o.value&&(o.value=i,o.entries=r,n())},a=p("layout-shift",s);a&&(n=m(e,o,E,t.reportAllChanges),I(function(){s(a.takeRecords()),n(!0)}),d(function(){i=0,o=g("CLS",0),n=m(e,o,E,t.reportAllChanges),f(function(){return n()})}),setTimeout(n,0))}))}(e=>this.handleMetric(e)),M(e=>this.handleMetric(e)),function(e,t){t=t||{},A(function(){var n,o=k(),s=g("FID"),c=function(e){e.startTime<o.firstHiddenTime&&(s.value=e.processingStart-e.startTime,s.entries.push(e),n(!0))},l=function(e){e.forEach(c)},u=p("first-input",l);n=m(e,s,x,t.reportAllChanges),u&&I(v(function(){l(u.takeRecords()),u.disconnect()})),u&&d(function(){var o;s=g("FID"),n=m(e,s,x,t.reportAllChanges),a=[],r=-1,i=null,L(addEventListener),o=c,a.push(o),N()})})}(e=>this.handleMetric(e)),function(e,t){t=t||{},A(function(){var n,o=k(),i=g("LCP"),r=function(e){var t=e[e.length-1];t&&t.startTime<o.firstHiddenTime&&(i.value=Math.max(t.startTime-h(),0),i.entries=[t],n())},s=p("largest-contentful-paint",r);if(s){n=m(e,i,B,t.reportAllChanges);var a=v(function(){W[i.id]||(r(s.takeRecords()),s.disconnect(),W[i.id]=!0,n(!0))});["keydown","click"].forEach(function(e){addEventListener(e,function(){return setTimeout(a,0)},!0)}),I(a),d(function(o){i=g("LCP"),n=m(e,i,B,t.reportAllChanges),f(function(){i.value=performance.now()-o.timeStamp,W[i.id]=!0,n(!0)})})}})}(e=>this.handleMetric(e)),Z(e=>this.handleMetric(e)),this.collectNavigationTimings(),this.collectResourceTimings(),this.config.longTaskThreshold&&this.observeLongTasks()}handleMetric(e){const t=e.name.toLowerCase();this.metrics[t]=e.value,this.config.debug&&console.log(`[DevSkin] Web Vital ${e.name}:`,e.value),this.transport.sendPerformanceMetric({name:e.name,value:e.value,rating:e.rating,delta:e.delta,timestamp:(new Date).toISOString()})}collectNavigationTimings(){window.performance&&window.performance.timing&&window.addEventListener("load",()=>{setTimeout(()=>{const e=window.performance.timing,t=window.performance.navigation,n=e.domContentLoadedEventEnd-e.navigationStart,o=e.loadEventEnd-e.navigationStart;this.metrics.domLoad=n,this.metrics.windowLoad=o,this.config.debug&&console.log("[DevSkin] Navigation Timings:",{domLoad:n,windowLoad:o,navigationType:t.type}),this.transport.sendPerformanceMetric({name:"Navigation",value:o,details:{domLoad:n,windowLoad:o,navigationType:t.type,redirectCount:t.redirectCount,dns:e.domainLookupEnd-e.domainLookupStart,tcp:e.connectEnd-e.connectStart,request:e.responseStart-e.requestStart,response:e.responseEnd-e.responseStart,dom:e.domComplete-e.domLoading},timestamp:(new Date).toISOString()})},0)})}collectResourceTimings(){window.performance&&window.performance.getEntriesByType&&window.addEventListener("load",()=>{setTimeout(()=>{const e=window.performance.getEntriesByType("resource"),t={total:e.length,byType:{},slowest:[]};e.forEach(e=>{const n=e.initiatorType||"other";t.byType[n]=(t.byType[n]||0)+1}),t.slowest=e.map(e=>({name:e.name,duration:e.duration,type:e.initiatorType})).sort((e,t)=>t.duration-e.duration).slice(0,10),this.config.debug&&console.log("[DevSkin] Resource Timings:",t),this.transport.sendPerformanceMetric({name:"Resources",value:e.length,details:t,timestamp:(new Date).toISOString()})},1e3)})}observeLongTasks(){if("PerformanceObserver"in window)try{new PerformanceObserver(e=>{for(const t of e.getEntries())t.duration>=(this.config.longTaskThreshold||50)&&(this.config.debug&&console.log("[DevSkin] Long Task detected:",t),this.transport.sendPerformanceMetric({name:"LongTask",value:t.duration,details:{name:t.name,entryType:t.entryType,startTime:t.startTime},timestamp:(new Date).toISOString()}))}).observe({entryTypes:["longtask"]})}catch(e){this.config.debug&&console.error("[DevSkin] Error observing long tasks:",e)}}getMetrics(){return Object.assign({},this.metrics)}}class K{constructor(e,t){var n;this.config=e,this.transport=t,this.breadcrumbs=[],this.maxBreadcrumbs=(null===(n=e.errorOptions)||void 0===n?void 0:n.maxBreadcrumbs)||30}start(){window.addEventListener("error",e=>{this.handleError(e.error||e.message,{filename:e.filename,lineno:e.lineno,colno:e.colno})}),window.addEventListener("unhandledrejection",e=>{this.handleError(e.reason,{type:"unhandledrejection"})}),this.setupAutomaticBreadcrumbs()}captureError(e,t){this.handleError(e,t)}addBreadcrumb(e){const t={category:e.category,message:e.message,level:e.level||"info",timestamp:(new Date).toISOString(),data:e.data};this.breadcrumbs.push(t),this.breadcrumbs.length>this.maxBreadcrumbs&&this.breadcrumbs.shift(),this.config.debug&&console.log("[DevSkin] Breadcrumb added:",t)}handleError(e,t){var n;if(this.shouldIgnoreError(e))return;let o;if(e instanceof Error){if(o={message:e.message,stack:e.stack,type:e.name||"Error",timestamp:(new Date).toISOString(),session_id:"",url:window.location.href,breadcrumbs:[...this.breadcrumbs],context:Object.assign(Object.assign({},t),{userAgent:navigator.userAgent,viewport:{width:window.innerWidth,height:window.innerHeight}})},e.stack){const t=e.stack.match(/:(\d+):(\d+)/);t&&(o.line=parseInt(t[1],10),o.column=parseInt(t[2],10))}}else o={message:String(e),type:"Error",timestamp:(new Date).toISOString(),session_id:"",url:window.location.href,breadcrumbs:[...this.breadcrumbs],context:t};(null===(n=this.config.errorOptions)||void 0===n?void 0:n.includeLocalVariables)&&t&&(o.context=Object.assign(Object.assign({},o.context),{localVariables:t})),this.config.debug&&console.log("[DevSkin] Error captured:",o),this.addBreadcrumb({category:"error",message:o.message,level:"error",data:{type:o.type,stack:o.stack}}),this.transport.sendError(o)}shouldIgnoreError(e){var t,n;const o=(null===(t=this.config.errorOptions)||void 0===t?void 0:t.ignoreErrors)||[],i=e instanceof Error?e.message:String(e);for(const e of o)if(e instanceof RegExp){if(e.test(i))return!0}else if("string"==typeof e&&i.includes(e))return!0;const r=(null===(n=this.config.errorOptions)||void 0===n?void 0:n.denyUrls)||[],s=e instanceof Error?e.stack:"";for(const e of r)if(e.test(s||""))return!0;return!1}setupAutomaticBreadcrumbs(){this.wrapConsole(),document.addEventListener("click",e=>{var t;const n=e.target;this.addBreadcrumb({category:"ui.click",message:`Clicked on ${n.tagName}`,data:{tagName:n.tagName,id:n.id,className:n.className,innerText:null===(t=n.innerText)||void 0===t?void 0:t.substring(0,100)}})},!0);let e=window.location.href;const t=()=>{e!==window.location.href&&(this.addBreadcrumb({category:"navigation",message:`Navigated to ${window.location.pathname}`,data:{from:e,to:window.location.href}}),e=window.location.href)};window.addEventListener("popstate",t),window.addEventListener("hashchange",t);const n=history.pushState;history.pushState=function(...e){n.apply(this,e),t()};const o=history.replaceState;history.replaceState=function(...e){o.apply(this,e),t()}}wrapConsole(){["log","info","warn","error"].forEach(e=>{const t=console[e];console[e]=(...n)=>{if(t.apply(console,n),"warn"===e||"error"===e){const t=n.map(e=>String(e)).join(" ");if(t.startsWith("[DevSkin]"))return;this.addBreadcrumb({category:"console",message:t,level:"warn"===e?"warning":"error",data:{arguments:n}})}}})}getBreadcrumbs(){return[...this.breadcrumbs]}}class _{constructor(e,t){this.config=e,this.transport=t}start(){this.interceptFetch(),this.interceptXHR()}interceptFetch(){if(!window.fetch)return;const e=window.fetch;window.fetch=(...n)=>t(this,void 0,void 0,function*(){var t,o,i;const[r,s]=n,a="string"==typeof r?r:r instanceof Request?r.url:r.toString(),c=(null==s?void 0:s.method)||"GET",l=Date.now();try{const r=yield e(...n),s=r.clone(),d=Date.now()-l;if(this.shouldIgnoreUrl(a))return r;if((null===(t=this.config.networkRequestOptions)||void 0===t?void 0:t.captureFailedOnly)&&r.ok)return r;const u={url:a,method:c,status:r.status,duration:d,size:yield this.getResponseSize(s),type:"fetch",timestamp:(new Date).toISOString(),failed:!r.ok};if((null===(o=this.config.networkRequestOptions)||void 0===o?void 0:o.captureHeaders)&&(u.headers=this.headersToObject(r.headers)),(null===(i=this.config.networkRequestOptions)||void 0===i?void 0:i.captureBody)&&!r.ok)try{const e=yield s.text();u.body=e.substring(0,1e4)}catch(e){}return this.config.debug&&console.log("[DevSkin] Network request tracked:",u),this.transport.sendNetworkRequest(u),r}catch(e){const t=Date.now()-l;if(!this.shouldIgnoreUrl(a)){const e={url:a,method:c,duration:t,type:"fetch",timestamp:(new Date).toISOString(),failed:!0};this.config.debug&&console.log("[DevSkin] Network request failed:",e),this.transport.sendNetworkRequest(e)}throw e}})}interceptXHR(){const e=XMLHttpRequest.prototype.open,t=XMLHttpRequest.prototype.send;XMLHttpRequest.prototype.open=function(t,n,o,i,r){return this.__devskin={method:t,url:n.toString(),startTime:Date.now()},void 0!==i?e.call(this,t,n,null==o||o,i,null!=r?r:void 0):void 0!==o?e.call(this,t,n,o):e.call(this,t,n,!0)},XMLHttpRequest.prototype.send=function(e){const n=this,o=n.__devskin;if(!o)return t.call(this,e);const i=window.__devskinNetworkCollector,r=()=>{const e=Date.now()-o.startTime;if(!(null==i?void 0:i.shouldIgnoreUrl(o.url))){const t={url:o.url,method:o.method,duration:e,type:"xhr",timestamp:(new Date).toISOString(),failed:!0};(null==i?void 0:i.config.debug)&&console.log("[DevSkin] XHR request failed:",t),null==i||i.transport.sendNetworkRequest(t)}};return n.addEventListener("load",()=>{var e,t,r,s;const a=Date.now()-o.startTime;if(null==i?void 0:i.shouldIgnoreUrl(o.url))return;if((null===(e=null==i?void 0:i.config.networkRequestOptions)||void 0===e?void 0:e.captureFailedOnly)&&n.status>=200&&n.status<400)return;const c={url:o.url,method:o.method,status:n.status,duration:a,type:"xhr",timestamp:(new Date).toISOString(),failed:0===n.status||n.status>=400};if((null===(t=null==i?void 0:i.config.networkRequestOptions)||void 0===t?void 0:t.captureHeaders)&&(c.headers=i.parseResponseHeaders(n.getAllResponseHeaders())),(null===(r=null==i?void 0:i.config.networkRequestOptions)||void 0===r?void 0:r.captureBody)&&c.failed)try{c.body=null===(s=n.responseText)||void 0===s?void 0:s.substring(0,1e4)}catch(e){}(null==i?void 0:i.config.debug)&&console.log("[DevSkin] XHR request tracked:",c),null==i||i.transport.sendNetworkRequest(c)}),n.addEventListener("error",r),n.addEventListener("abort",r),t.call(this,e)},window.__devskinNetworkCollector=this}shouldIgnoreUrl(e){var t;if(e.includes(this.config.apiUrl||""))return!0;const n=(null===(t=this.config.networkRequestOptions)||void 0===t?void 0:t.ignoreUrls)||[];for(const t of n)if(t.test(e))return!0;return!1}getResponseSize(e){return t(this,void 0,void 0,function*(){try{return(yield e.blob()).size}catch(e){return}})}headersToObject(e){const t={};return e.forEach((e,n)=>{t[n]=e}),t}parseResponseHeaders(e){const t={};if(!e)return t;return e.trim().split(/[\r\n]+/).forEach(e=>{const n=e.split(": "),o=n.shift(),i=n.join(": ");o&&(t[o]=i)}),t}}class z{constructor(e,t){this.config=e,this.transport=t,this.clickData=[],this.scrollData=[],this.mouseMoveData=[],this.maxScrollDepth=0,this.flushInterval=null,this.mouseMoveSampling=.1}start(){var e;(null===(e=this.config.heatmapOptions)||void 0===e?void 0:e.enabled)&&(this.config.debug&&console.log("[DevSkin] Starting heatmap collection"),!1!==this.config.heatmapOptions.trackClicks&&this.trackClicks(),!1!==this.config.heatmapOptions.trackScroll&&this.trackScrollDepth(),this.config.heatmapOptions.trackMouseMovement&&(this.mouseMoveSampling=this.config.heatmapOptions.mouseMoveSampling||.1,this.trackMouseMovement()),this.flushInterval=setInterval(()=>{this.flush()},1e4),window.addEventListener("beforeunload",()=>{this.flush()}))}stop(){this.flushInterval&&(clearInterval(this.flushInterval),this.flushInterval=null),this.flush()}trackClicks(){document.addEventListener("click",e=>{const t=e.target,n=t.getBoundingClientRect(),o=e.clientX-n.left,i=e.clientY-n.top,r=e.clientX+window.scrollX,s=e.clientY+window.scrollY,a={x:e.clientX,y:e.clientY,relativeX:o,relativeY:i,pageX:r,pageY:s,element:this.getElementSelector(t),elementId:t.id||void 0,elementClass:t.className||void 0,pageUrl:window.location.href,timestamp:(new Date).toISOString(),viewportWidth:window.innerWidth,viewportHeight:window.innerHeight};this.clickData.push(a),this.config.debug&&console.log("[DevSkin] Click tracked:",a),this.clickData.length>=50&&this.flush()},!0)}trackScrollDepth(){const e=()=>{const e=window.innerHeight,t=document.documentElement.scrollHeight,n=window.scrollY||document.documentElement.scrollTop,o=Math.round((n+e)/t*100);if(o>this.maxScrollDepth){this.maxScrollDepth=o;const n={depth:o,maxDepth:this.maxScrollDepth,pageHeight:t,viewportHeight:e,pageUrl:window.location.href,timestamp:(new Date).toISOString()};this.scrollData.push(n),this.config.debug&&console.log("[DevSkin] Scroll depth:",o+"%")}};let t=null;window.addEventListener("scroll",()=>{t&&clearTimeout(t),t=setTimeout(e,100)}),e()}trackMouseMovement(){let e=null;window.addEventListener("mousemove",t=>{if(Math.random()>this.mouseMoveSampling)return;if(e)return;e=setTimeout(()=>{e=null},100);const n={x:t.clientX+window.scrollX,y:t.clientY+window.scrollY,pageUrl:window.location.href,timestamp:(new Date).toISOString()};this.mouseMoveData.push(n),this.mouseMoveData.length>=100&&this.flush()})}flush(){this.clickData.length>0&&(this.transport.sendHeatmapData({type:"clicks",data:this.clickData}),this.clickData=[]),this.scrollData.length>0&&(this.transport.sendHeatmapData({type:"scroll",data:this.scrollData}),this.scrollData=[]),this.mouseMoveData.length>0&&(this.transport.sendHeatmapData({type:"mousemove",data:this.mouseMoveData}),this.mouseMoveData=[])}getElementSelector(e){if(e.id)return`#${e.id}`;if(e.className){const t=e.className.split(" ").filter(e=>e);if(t.length>0)return`${e.tagName.toLowerCase()}.${t.join(".")}`}return e.tagName.toLowerCase()}}function Y(e){var t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function H(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function j(e){try{var t=e.rules||e.cssRules;return t?((n=Array.from(t).map(q).join("")).includes(" background-clip: text;")&&!n.includes(" -webkit-background-clip: text;")&&(n=n.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),n):null}catch(e){return null}var n}function q(e){var t=e.cssText;if(function(e){return"styleSheet"in e}(e))try{t=j(e.styleSheet)||t}catch(e){}return t}!function(e){e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment"}(c||(c={}));var P=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(e){var t;if(!e)return-1;var n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-1},e.prototype.getNode=function(e){return this.idNodeMap.get(e)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(e){return this.nodeMetaMap.get(e)||null},e.prototype.removeNodeFromMap=function(e){var t=this,n=this.getId(e);this.idNodeMap.delete(n),e.childNodes&&e.childNodes.forEach(function(e){return t.removeNodeFromMap(e)})},e.prototype.has=function(e){return this.idNodeMap.has(e)},e.prototype.hasNode=function(e){return this.nodeMetaMap.has(e)},e.prototype.add=function(e,t){var n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)},e.prototype.replace=function(e,t){var n=this.getNode(e);if(n){var o=this.nodeMetaMap.get(n);o&&this.nodeMetaMap.set(t,o)}this.idNodeMap.set(e,t)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function J(e){var t=e.maskInputOptions,n=e.tagName,o=e.type,i=e.value,r=e.maskInputFn,s=i||"";return(t[n.toLowerCase()]||t[o])&&(s=r?r(s):"*".repeat(s.length)),s}var Q="__rrweb_original__";var X,$,ee=1,te=new RegExp("[^a-z0-9-_:]");function ne(){return ee++}var oe=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,ie=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,re=/^(data:)([^,]*),(.*)/i;function se(e,t){return(e||"").replace(oe,function(e,n,o,i,r,s){var a,c=o||r||s,l=n||i||"";if(!c)return e;if(!ie.test(c))return"url(".concat(l).concat(c).concat(l,")");if(re.test(c))return"url(".concat(l).concat(c).concat(l,")");if("/"===c[0])return"url(".concat(l).concat((a=t,(a.indexOf("//")>-1?a.split("/").slice(0,3).join("/"):a.split("/")[0]).split("?")[0]+c)).concat(l,")");var d=t.split("/"),u=c.split("/");d.pop();for(var h=0,g=u;h<g.length;h++){var p=g[h];"."!==p&&(".."===p?d.pop():d.push(p))}return"url(".concat(l).concat(d.join("/")).concat(l,")")})}var ae=/^[^ \t\n\r\u000c]+/,ce=/^[, \t\n\r\u000c]+/;function le(e,t){if(!t||""===t.trim())return t;var n=e.createElement("a");return n.href=t,n.href}function de(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function ue(){var e=document.createElement("a");return e.href="",e.href}function he(e,t,n,o){return"src"===n||"href"===n&&o&&("use"!==t||"#"!==o[0])||"xlink:href"===n&&o&&"#"!==o[0]?le(e,o):"background"!==n||!o||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n&&o?function(e,t){if(""===t.trim())return t;var n=0;function o(e){var o,i=e.exec(t.substring(n));return i?(o=i[0],n+=o.length,o):""}for(var i=[];o(ce),!(n>=t.length);){var r=o(ae);if(","===r.slice(-1))r=le(e,r.substring(0,r.length-1)),i.push(r);else{var s="";r=le(e,r);for(var a=!1;;){var c=t.charAt(n);if(""===c){i.push((r+s).trim());break}if(a)")"===c&&(a=!1);else{if(","===c){n+=1,i.push((r+s).trim());break}"("===c&&(a=!0)}s+=c,n+=1}}}return i.join(", ")}(e,o):"style"===n&&o?se(o,ue()):"object"===t&&"data"===n&&o?le(e,o):o:le(e,o)}function ge(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&ge(e.parentNode,t,n);for(var o=e.classList.length;o--;){var i=e.classList[o];if(t.test(i))return!0}return!!n&&ge(e.parentNode,t,n)}function pe(e,t,n){var o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===o)return!1;if("string"==typeof t){if(o.classList.contains(t))return!0;if(o.closest(".".concat(t)))return!0}else if(ge(o,t,!0))return!0;if(n){if(o.matches(n))return!0;if(o.closest(n))return!0}return!1}function me(e,t){var n=t.doc,o=t.mirror,i=t.blockClass,r=t.blockSelector,s=t.maskTextClass,a=t.maskTextSelector,l=t.inlineStylesheet,d=t.maskInputOptions,u=void 0===d?{}:d,h=t.maskTextFn,g=t.maskInputFn,p=t.dataURLOptions,m=void 0===p?{}:p,f=t.inlineImages,I=t.recordCanvas,v=t.keepIframeSrcFn,y=t.newlyAddedElement,C=void 0!==y&&y,S=function(e,t){if(!t.hasNode(e))return;var n=t.getId(e);return 1===n?void 0:n}(n,o);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:c.Document,childNodes:[],compatMode:e.compatMode}:{type:c.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:c.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:S};case e.ELEMENT_NODE:return function(e,t){for(var n=t.doc,o=t.blockClass,i=t.blockSelector,r=t.inlineStylesheet,s=t.maskInputOptions,a=void 0===s?{}:s,l=t.maskInputFn,d=t.dataURLOptions,u=void 0===d?{}:d,h=t.inlineImages,g=t.recordCanvas,p=t.keepIframeSrcFn,m=t.newlyAddedElement,f=void 0!==m&&m,I=t.rootId,v=function(e,t,n){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var o=e.classList.length;o--;){var i=e.classList[o];if(t.test(i))return!0}return!!n&&e.matches(n)}(e,o,i),y=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return te.test(t)?"div":t}(e),C={},S=e.attributes.length,b=0;b<S;b++){var w=e.attributes[b];C[w.name]=he(n,y,w.name,w.value)}if("link"===y&&r){var k=Array.from(n.styleSheets).find(function(t){return t.href===e.href}),A=null;k&&(A=j(k)),A&&(delete C.rel,delete C.href,C._cssText=se(A,k.href))}if("style"===y&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){(A=j(e.sheet))&&(C._cssText=se(A,ue()))}if("input"===y||"textarea"===y||"select"===y){var T=e.value,M=e.checked;"radio"!==C.type&&"checkbox"!==C.type&&"submit"!==C.type&&"button"!==C.type&&T?C.value=J({type:C.type,tagName:y,value:T,maskInputOptions:a,maskInputFn:l}):M&&(C.checked=M)}"option"===y&&(e.selected&&!a.select?C.selected=!0:delete C.selected);if("canvas"===y&&g)if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var n=0;n<e.width;n+=50)for(var o=0;o<e.height;o+=50){var i=t.getImageData,r=Q in i?i[Q]:i;if(new Uint32Array(r.call(t,n,o,Math.min(50,e.width-n),Math.min(50,e.height-o)).data.buffer).some(function(e){return 0!==e}))return!1}return!0})(e)||(C.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){var E=e.toDataURL(u.type,u.quality),R=document.createElement("canvas");R.width=e.width,R.height=e.height,E!==R.toDataURL(u.type,u.quality)&&(C.rr_dataURL=E)}if("img"===y&&h){X||(X=n.createElement("canvas"),$=X.getContext("2d"));var O=e,D=O.crossOrigin;O.crossOrigin="anonymous";var N=function(){try{X.width=O.naturalWidth,X.height=O.naturalHeight,$.drawImage(O,0,0),C.rr_dataURL=X.toDataURL(u.type,u.quality)}catch(e){console.warn("Cannot inline img src=".concat(O.currentSrc,"! Error: ").concat(e))}D?C.crossOrigin=D:O.removeAttribute("crossorigin")};O.complete&&0!==O.naturalWidth?N():O.onload=N}"audio"!==y&&"video"!==y||(C.rr_mediaState=e.paused?"paused":"played",C.rr_mediaCurrentTime=e.currentTime);f||(e.scrollLeft&&(C.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(C.rr_scrollTop=e.scrollTop));if(v){var F=e.getBoundingClientRect(),L=F.width,x=F.height;C={class:C.class,rr_width:"".concat(L,"px"),rr_height:"".concat(x,"px")}}"iframe"!==y||p(C.src)||(e.contentDocument||(C.rr_src=C.src),delete C.src);return{type:c.Element,tagName:y,attributes:C,childNodes:[],isSVG:de(e)||void 0,needBlock:v,rootId:I}}(e,{doc:n,blockClass:i,blockSelector:r,inlineStylesheet:l,maskInputOptions:u,maskInputFn:g,dataURLOptions:m,inlineImages:f,recordCanvas:I,keepIframeSrcFn:v,newlyAddedElement:C,rootId:S});case e.TEXT_NODE:return function(e,t){var n,o=t.maskTextClass,i=t.maskTextSelector,r=t.maskTextFn,s=t.rootId,a=e.parentNode&&e.parentNode.tagName,l=e.textContent,d="STYLE"===a||void 0,u="SCRIPT"===a||void 0;if(d&&l){try{e.nextSibling||e.previousSibling||(null===(n=e.parentNode.sheet)||void 0===n?void 0:n.cssRules)&&(l=(h=e.parentNode.sheet).cssRules?Array.from(h.cssRules).map(function(e){return e.cssText||""}).join(""):"")}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(t),e)}l=se(l,ue())}var h;u&&(l="SCRIPT_PLACEHOLDER");!d&&!u&&l&&pe(e,o,i)&&(l=r?r(l):l.replace(/[\S]/g,"*"));return{type:c.Text,textContent:l||"",isStyle:d,rootId:s}}(e,{maskTextClass:s,maskTextSelector:a,maskTextFn:h,rootId:S});case e.CDATA_SECTION_NODE:return{type:c.CDATA,textContent:"",rootId:S};case e.COMMENT_NODE:return{type:c.Comment,textContent:e.textContent||"",rootId:S};default:return!1}}function fe(e){return void 0===e?"":e.toLowerCase()}function Ie(e,t){var n,o=t.doc,i=t.mirror,r=t.blockClass,s=t.blockSelector,a=t.maskTextClass,l=t.maskTextSelector,d=t.skipChild,u=void 0!==d&&d,h=t.inlineStylesheet,g=void 0===h||h,p=t.maskInputOptions,m=void 0===p?{}:p,f=t.maskTextFn,I=t.maskInputFn,v=t.slimDOMOptions,y=t.dataURLOptions,C=void 0===y?{}:y,S=t.inlineImages,b=void 0!==S&&S,w=t.recordCanvas,k=void 0!==w&&w,A=t.onSerialize,T=t.onIframeLoad,M=t.iframeLoadTimeout,E=void 0===M?5e3:M,R=t.onStylesheetLoad,O=t.stylesheetLoadTimeout,D=void 0===O?5e3:O,N=t.keepIframeSrcFn,F=void 0===N?function(){return!1}:N,L=t.newlyAddedElement,x=void 0!==L&&L,B=t.preserveWhiteSpace,W=void 0===B||B,V=me(e,{doc:o,mirror:i,blockClass:r,blockSelector:s,maskTextClass:a,maskTextSelector:l,inlineStylesheet:g,maskInputOptions:m,maskTextFn:f,maskInputFn:I,dataURLOptions:C,inlineImages:b,recordCanvas:k,keepIframeSrcFn:F,newlyAddedElement:x});if(!V)return console.warn(e,"not serialized"),null;n=i.hasNode(e)?i.getId(e):!function(e,t){if(t.comment&&e.type===c.Comment)return!0;if(e.type===c.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&"preload"===e.attributes.rel&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&e.attributes.href.endsWith(".js")))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(fe(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===fe(e.attributes.name)||"icon"===fe(e.attributes.rel)||"apple-touch-icon"===fe(e.attributes.rel)||"shortcut icon"===fe(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&fe(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(fe(e.attributes.property).match(/^(og|twitter|fb):/)||fe(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===fe(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===fe(e.attributes.name)||"googlebot"===fe(e.attributes.name)||"bingbot"===fe(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===fe(e.attributes.name)||"generator"===fe(e.attributes.name)||"framework"===fe(e.attributes.name)||"publisher"===fe(e.attributes.name)||"progid"===fe(e.attributes.name)||fe(e.attributes.property).match(/^article:/)||fe(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===fe(e.attributes.name)||"yandex-verification"===fe(e.attributes.name)||"csrf-token"===fe(e.attributes.name)||"p:domain_verify"===fe(e.attributes.name)||"verify-v1"===fe(e.attributes.name)||"verification"===fe(e.attributes.name)||"shopify-checkout-api-token"===fe(e.attributes.name)))return!0}}return!1}(V,v)&&(W||V.type!==c.Text||V.isStyle||V.textContent.replace(/^\s+|\s+$/gm,"").length)?ne():-2;var G=Object.assign(V,{id:n});if(i.add(e,G),-2===n)return null;A&&A(e);var Z=!u;if(G.type===c.Element){Z=Z&&!G.needBlock,delete G.needBlock;var U=e.shadowRoot;U&&H(U)&&(G.isShadowHost=!0)}if((G.type===c.Document||G.type===c.Element)&&Z){v.headWhitespace&&G.type===c.Element&&"head"===G.tagName&&(W=!1);for(var K={doc:o,mirror:i,blockClass:r,blockSelector:s,maskTextClass:a,maskTextSelector:l,skipChild:u,inlineStylesheet:g,maskInputOptions:m,maskTextFn:f,maskInputFn:I,slimDOMOptions:v,dataURLOptions:C,inlineImages:b,recordCanvas:k,preserveWhiteSpace:W,onSerialize:A,onIframeLoad:T,iframeLoadTimeout:E,onStylesheetLoad:R,stylesheetLoadTimeout:D,keepIframeSrcFn:F},_=0,z=Array.from(e.childNodes);_<z.length;_++){(P=Ie(z[_],K))&&G.childNodes.push(P)}if(function(e){return e.nodeType===e.ELEMENT_NODE}(e)&&e.shadowRoot)for(var j=0,q=Array.from(e.shadowRoot.childNodes);j<q.length;j++){var P;(P=Ie(q[j],K))&&(H(e.shadowRoot)&&(P.isShadow=!0),G.childNodes.push(P))}}return e.parentNode&&Y(e.parentNode)&&H(e.parentNode)&&(G.isShadow=!0),G.type===c.Element&&"iframe"===G.tagName&&function(e,t,n){var o=e.contentWindow;if(o){var i,r=!1;try{i=o.document.readyState}catch(e){return}if("complete"===i){var s="about:blank";if(o.location.href!==s||e.src===s||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var a=setTimeout(function(){r||(t(),r=!0)},n);e.addEventListener("load",function(){clearTimeout(a),r=!0,t()})}}}(e,function(){var t=e.contentDocument;if(t&&T){var n=Ie(t,{doc:t,mirror:i,blockClass:r,blockSelector:s,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:g,maskInputOptions:m,maskTextFn:f,maskInputFn:I,slimDOMOptions:v,dataURLOptions:C,inlineImages:b,recordCanvas:k,preserveWhiteSpace:W,onSerialize:A,onIframeLoad:T,iframeLoadTimeout:E,onStylesheetLoad:R,stylesheetLoadTimeout:D,keepIframeSrcFn:F});n&&T(e,n)}},E),G.type===c.Element&&"link"===G.tagName&&"stylesheet"===G.attributes.rel&&function(e,t,n){var o,i=!1;try{o=e.sheet}catch(e){return}if(!o){var r=setTimeout(function(){i||(t(),i=!0)},n);e.addEventListener("load",function(){clearTimeout(r),i=!0,t()})}}(e,function(){if(R){var t=Ie(e,{doc:o,mirror:i,blockClass:r,blockSelector:s,maskTextClass:a,maskTextSelector:l,skipChild:!1,inlineStylesheet:g,maskInputOptions:m,maskTextFn:f,maskInputFn:I,slimDOMOptions:v,dataURLOptions:C,inlineImages:b,recordCanvas:k,preserveWhiteSpace:W,onSerialize:A,onIframeLoad:T,iframeLoadTimeout:E,onStylesheetLoad:R,stylesheetLoadTimeout:D,keepIframeSrcFn:F});t&&R(e,t)}},D),G}function ve(e,t,n=document){const o={capture:!0,passive:!0};return n.addEventListener(e,t,o),()=>n.removeEventListener(e,t,o)}const ye="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let Ce={map:{},getId:()=>(console.error(ye),-1),getNode:()=>(console.error(ye),null),removeNodeFromMap(){console.error(ye)},has:()=>(console.error(ye),!1),reset(){console.error(ye)}};function Se(e,t,n={}){let o=null,i=0;return function(...r){const s=Date.now();i||!1!==n.leading||(i=s);const a=t-(s-i),c=this;a<=0||a>t?(o&&(clearTimeout(o),o=null),i=s,e.apply(c,r)):o||!1===n.trailing||(o=setTimeout(()=>{i=!1===n.leading?0:Date.now(),o=null,e.apply(c,r)},a))}}function be(e,t,n,o,i=window){const r=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,o?n:{set(e){setTimeout(()=>{n.set.call(this,e)},0),r&&r.set&&r.set.call(this,e)}}),()=>be(e,t,r||{},!0)}function we(e,t,n){try{if(!(t in e))return()=>{};const o=e[t],i=n(o);return"function"==typeof i&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:o}})),e[t]=i,()=>{e[t]=o}}catch(e){return()=>{}}}function ke(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Ae(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Te(e,t,n,o){if(!e)return!1;const i=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!i)return!1;if("string"==typeof t){if(i.classList.contains(t))return!0;if(o&&null!==i.closest("."+t))return!0}else if(ge(i,t,o))return!0;if(n){if(e.matches(n))return!0;if(o&&null!==i.closest(n))return!0}return!1}function Me(e,t){return-2===t.getId(e)}function Ee(e,t){if(Y(e))return!1;const n=t.getId(e);return!t.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||Ee(e.parentNode,t))}function Re(e){return Boolean(e.changedTouches)}function Oe(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function De(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Ne(e){return Boolean(null==e?void 0:e.shadowRoot)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Ce=new Proxy(Ce,{get:(e,t,n)=>("map"===t&&console.error(ye),Reflect.get(e,t,n))}));class Fe{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}var Le=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(Le||{}),xe=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e))(xe||{}),Be=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(Be||{}),We=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(We||{});function Ve(e){return"__ln"in e}class Ge{constructor(){this.length=0,this.head=null}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let n=0;n<e;n++)t=(null==t?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Ve(e.previousSibling)){const n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&Ve(e.nextSibling)&&e.nextSibling.__ln.previous){const n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next&&(t.next.previous=t.previous)):(this.head=t.next,this.head&&(this.head.previous=null)),e.__ln&&delete e.__ln,this.length--)}}const Ze=(e,t)=>`${e}@${t}`;class Ue{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const e=[],t=new Ge,n=e=>{let t=e,n=-2;for(;-2===n;)t=t&&t.nextSibling,n=t&&this.mirror.getId(t);return n},o=o=>{var i,r,s,a;let c=null;(null===(r=null===(i=o.getRootNode)||void 0===i?void 0:i.call(o))||void 0===r?void 0:r.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&o.getRootNode().host&&(c=o.getRootNode().host);let l=c;for(;(null===(a=null===(s=null==l?void 0:l.getRootNode)||void 0===s?void 0:s.call(l))||void 0===a?void 0:a.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&l.getRootNode().host;)l=l.getRootNode().host;const d=!(this.doc.contains(o)||l&&this.doc.contains(l));if(!o.parentNode||d)return;const u=Y(o.parentNode)?this.mirror.getId(c):this.mirror.getId(o.parentNode),h=n(o);if(-1===u||-1===h)return t.addNode(o);const g=Ie(o,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{Oe(e,this.mirror)&&this.iframeManager.addIframe(e),De(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Ne(o)&&this.shadowDomManager.addShadowRoot(o.shadowRoot,this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});g&&e.push({parentId:u,nextId:h,node:g})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of Array.from(this.movedSet.values()))_e(this.removes,e,this.mirror)&&!this.movedSet.has(e.parentNode)||o(e);for(const e of Array.from(this.addedSet.values()))Ye(this.droppedSet,e)||_e(this.removes,e,this.mirror)?Ye(this.movedSet,e)?o(e):this.droppedSet.add(e):o(e);let i=null;for(;t.length;){let e=null;if(i){const t=this.mirror.getId(i.value.parentNode),o=n(i.value);-1!==t&&-1!==o&&(e=i)}if(!e)for(let o=t.length-1;o>=0;o--){const i=t.get(o);if(i){const t=this.mirror.getId(i.value.parentNode);if(-1===n(i.value))continue;if(-1!==t){e=i;break}{const t=i.value;if(t.parentNode&&t.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const n=t.parentNode.host;if(-1!==this.mirror.getId(n)){e=i;break}}}}}if(!e){for(;t.head;)t.removeNode(t.head.value);break}i=e.previous,t.removeNode(e.value),o(e.value)}const r={texts:this.texts.map(e=>({id:this.mirror.getId(e.node),value:e.value})).filter(e=>this.mirror.has(e.id)),attributes:this.attributes.map(e=>({id:this.mirror.getId(e.node),attributes:e.attributes})).filter(e=>this.mirror.has(e.id)),removes:this.removes,adds:e};(r.texts.length||r.attributes.length||r.removes.length||r.adds.length)&&(this.texts=[],this.attributes=[],this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(r))},this.processMutation=e=>{if(!Me(e.target,this.mirror))switch(e.type){case"characterData":{const t=e.target.textContent;Te(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:pe(e.target,this.maskTextClass,this.maskTextSelector)&&t?this.maskTextFn?this.maskTextFn(t):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let n=e.target.getAttribute(e.attributeName);if("value"===e.attributeName&&(n=J({maskInputOptions:this.maskInputOptions,tagName:e.target.tagName,type:e.target.getAttribute("type"),value:n,maskInputFn:this.maskInputFn})),Te(e.target,this.blockClass,this.blockSelector,!1)||n===e.oldValue)return;let o=this.attributes.find(t=>t.node===e.target);if("IFRAME"===t.tagName&&"src"===e.attributeName&&!this.keepIframeSrcFn(n)){if(t.contentDocument)return;e.attributeName="rr_src"}if(o||(o={node:e.target,attributes:{}},this.attributes.push(o)),"style"===e.attributeName){const n=this.doc.createElement("span");e.oldValue&&n.setAttribute("style",e.oldValue),void 0!==o.attributes.style&&null!==o.attributes.style||(o.attributes.style={});const i=o.attributes.style;for(const e of Array.from(t.style)){const o=t.style.getPropertyValue(e),r=t.style.getPropertyPriority(e);o===n.style.getPropertyValue(e)&&r===n.style.getPropertyPriority(e)||(i[e]=""===r?o:[o,r])}for(const e of Array.from(n.style))""===t.style.getPropertyValue(e)&&(i[e]=!1)}else o.attributes[e.attributeName]=he(this.doc,t.tagName,e.attributeName,n);break}case"childList":if(Te(e.target,this.blockClass,this.blockSelector,!0))return;e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{const n=this.mirror.getId(t),o=Y(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);Te(e.target,this.blockClass,this.blockSelector,!1)||Me(t,this.mirror)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Ke(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||Ee(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Ze(n,o)]?Ke(this.movedSet,t):this.removes.push({parentId:o,id:n,isShadow:!(!Y(e.target)||!H(e.target))||void 0})),this.mapRemoves.push(t))})}},this.genAdds=(e,t)=>{if(this.mirror.hasNode(e)){if(Me(e,this.mirror))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&-1!==n&&(this.movedMap[Ze(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Te(e,this.blockClass,this.blockSelector,!1)||e.childNodes.forEach(e=>this.genAdds(e))}}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function Ke(e,t){e.delete(t),t.childNodes.forEach(t=>Ke(e,t))}function _e(e,t,n){return 0!==e.length&&ze(e,t,n)}function ze(e,t,n){const{parentNode:o}=t;if(!o)return!1;const i=n.getId(o);return!!e.some(e=>e.id===i)||ze(e,o,n)}function Ye(e,t){return 0!==e.size&&He(e,t)}function He(e,t){const{parentNode:n}=t;return!!n&&(!!e.has(n)||He(e,n))}const je=[],qe="undefined"!=typeof CSSGroupingRule,Pe="undefined"!=typeof CSSMediaRule,Je="undefined"!=typeof CSSSupportsRule,Qe="undefined"!=typeof CSSConditionRule;function Xe(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0];return e.target}catch(t){return e.target}}function $e(e,t){var n,o;const i=new Ue;je.push(i),i.init(e);let r=window.MutationObserver||window.__rrMutationObserver;const s=null===(o=null===(n=null===window||void 0===window?void 0:window.Zone)||void 0===n?void 0:n.__symbol__)||void 0===o?void 0:o.call(n,"MutationObserver");s&&window[s]&&(r=window[s]);const a=new r(i.processMutations.bind(i));return a.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),a}function et({mouseInteractionCb:e,doc:t,mirror:n,blockClass:o,blockSelector:i,sampling:r}){if(!1===r.mouseInteraction)return()=>{};const s=!0===r.mouseInteraction||void 0===r.mouseInteraction?{}:r.mouseInteraction,a=[];return Object.keys(Be).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==s[e]).forEach(r=>{const s=r.toLowerCase(),c=(t=>r=>{const s=Xe(r);if(Te(s,o,i,!0))return;const a=Re(r)?r.changedTouches[0]:r;if(!a)return;const c=n.getId(s),{clientX:l,clientY:d}=a;e({type:Be[t],id:c,x:l,y:d})})(r);a.push(ve(s,c,t))}),()=>{a.forEach(e=>e())}}function tt({scrollCb:e,doc:t,mirror:n,blockClass:o,blockSelector:i,sampling:r}){return ve("scroll",Se(r=>{const s=Xe(r);if(!s||Te(s,o,i,!0))return;const a=n.getId(s);if(s===t){const n=t.scrollingElement||t.documentElement;e({id:a,x:n.scrollLeft,y:n.scrollTop})}else e({id:a,x:s.scrollLeft,y:s.scrollTop})},r.scroll||100),t)}function nt(e,t){const n=Object.assign({},e);return t||delete n.userTriggered,n}const ot=["INPUT","TEXTAREA","SELECT"],it=new WeakMap;function rt(e){return function(e,t){if(qe&&e.parentRule instanceof CSSGroupingRule||Pe&&e.parentRule instanceof CSSMediaRule||Je&&e.parentRule instanceof CSSSupportsRule||Qe&&e.parentRule instanceof CSSConditionRule){const n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){const n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function st(e,t,n){let o,i;return e?(e.ownerNode?o=t.getId(e.ownerNode):i=n.getId(e),{styleId:i,id:o}):{}}function at({mirror:e,stylesheetManager:t},n){var o,i,r;let s=null;s="#document"===n.nodeName?e.getId(n):e.getId(n.host);const a="#document"===n.nodeName?null===(o=n.defaultView)||void 0===o?void 0:o.Document:null===(r=null===(i=n.ownerDocument)||void 0===i?void 0:i.defaultView)||void 0===r?void 0:r.ShadowRoot,c=Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets");return null!==s&&-1!==s&&a&&c?(Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var e;return null===(e=c.get)||void 0===e?void 0:e.call(this)},set(e){var n;const o=null===(n=c.set)||void 0===n?void 0:n.call(this,e);if(null!==s&&-1!==s)try{t.adoptStyleSheets(e,s)}catch(e){}return o}}),()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}):()=>{}}function ct(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};!function(e,t){const{mutationCb:n,mousemoveCb:o,mouseInteractionCb:i,scrollCb:r,viewportResizeCb:s,inputCb:a,mediaInteractionCb:c,styleSheetRuleCb:l,styleDeclarationCb:d,canvasMutationCb:u,fontCb:h,selectionCb:g}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),n(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),o(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),i(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),r(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),s(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),a(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),c(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),l(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),d(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),u(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),h(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),g(...e)}}(e,t);const o=$e(e,e.doc),i=function({mousemoveCb:e,sampling:t,doc:n,mirror:o}){if(!1===t.mousemove)return()=>{};const i="number"==typeof t.mousemove?t.mousemove:50,r="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let s,a=[];const c=Se(t=>{const n=Date.now()-s;e(a.map(e=>(e.timeOffset-=n,e)),t),a=[],s=null},r),l=Se(e=>{const t=Xe(e),{clientX:n,clientY:i}=Re(e)?e.changedTouches[0]:e;s||(s=Date.now()),a.push({x:n,y:i,id:o.getId(t),timeOffset:Date.now()-s}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?xe.Drag:e instanceof MouseEvent?xe.MouseMove:xe.TouchMove)},i,{trailing:!1}),d=[ve("mousemove",l,n),ve("touchmove",l,n),ve("drag",l,n)];return()=>{d.forEach(e=>e())}}(e),r=et(e),s=tt(e),a=function({viewportResizeCb:e}){let t=-1,n=-1;return ve("resize",Se(()=>{const o=ke(),i=Ae();t===o&&n===i||(e({width:Number(i),height:Number(o)}),t=o,n=i)},200),window)}(e),c=function({inputCb:e,doc:t,mirror:n,blockClass:o,blockSelector:i,ignoreClass:r,maskInputOptions:s,maskInputFn:a,sampling:c,userTriggeredOnInput:l}){function d(e){let n=Xe(e);const c=e.isTrusted;if(n&&"OPTION"===n.tagName&&(n=n.parentElement),!n||!n.tagName||ot.indexOf(n.tagName)<0||Te(n,o,i,!0))return;const d=n.type;if(n.classList.contains(r))return;let h=n.value,g=!1;"radio"===d||"checkbox"===d?g=n.checked:(s[n.tagName.toLowerCase()]||s[d])&&(h=J({maskInputOptions:s,tagName:n.tagName,type:d,value:h,maskInputFn:a})),u(n,nt({text:h,isChecked:g,userTriggered:c},l));const p=n.name;"radio"===d&&p&&g&&t.querySelectorAll(`input[type="radio"][name="${p}"]`).forEach(e=>{e!==n&&u(e,nt({text:e.value,isChecked:!g,userTriggered:!1},l))})}function u(t,o){const i=it.get(t);if(!i||i.text!==o.text||i.isChecked!==o.isChecked){it.set(t,o);const i=n.getId(t);e(Object.assign(Object.assign({},o),{id:i}))}}const h=("last"===c.input?["change"]:["input","change"]).map(e=>ve(e,d,t)),g=t.defaultView;if(!g)return()=>{h.forEach(e=>e())};const p=g.Object.getOwnPropertyDescriptor(g.HTMLInputElement.prototype,"value"),m=[[g.HTMLInputElement.prototype,"value"],[g.HTMLInputElement.prototype,"checked"],[g.HTMLSelectElement.prototype,"value"],[g.HTMLTextAreaElement.prototype,"value"],[g.HTMLSelectElement.prototype,"selectedIndex"],[g.HTMLOptionElement.prototype,"selected"]];return p&&p.set&&h.push(...m.map(e=>be(e[0],e[1],{set(){d({target:this})}},!1,g))),()=>{h.forEach(e=>e())}}(e),l=function({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:o,sampling:i}){const r=r=>Se(i=>{const s=Xe(i);if(!s||Te(s,t,n,!0))return;const{currentTime:a,volume:c,muted:l,playbackRate:d}=s;e({type:r,id:o.getId(s),currentTime:a,volume:c,muted:l,playbackRate:d})},i.media||500),s=[ve("play",r(0)),ve("pause",r(1)),ve("seeked",r(2)),ve("volumechange",r(3)),ve("ratechange",r(4))];return()=>{s.forEach(e=>e())}}(e),d=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:o}){const i=o.CSSStyleSheet.prototype.insertRule;o.CSSStyleSheet.prototype.insertRule=function(o,r){const{id:s,styleId:a}=st(this,t,n.styleMirror);return(s&&-1!==s||a&&-1!==a)&&e({id:s,styleId:a,adds:[{rule:o,index:r}]}),i.apply(this,[o,r])};const r=o.CSSStyleSheet.prototype.deleteRule;let s,a;o.CSSStyleSheet.prototype.deleteRule=function(o){const{id:i,styleId:s}=st(this,t,n.styleMirror);return(i&&-1!==i||s&&-1!==s)&&e({id:i,styleId:s,removes:[{index:o}]}),r.apply(this,[o])},o.CSSStyleSheet.prototype.replace&&(s=o.CSSStyleSheet.prototype.replace,o.CSSStyleSheet.prototype.replace=function(o){const{id:i,styleId:r}=st(this,t,n.styleMirror);return(i&&-1!==i||r&&-1!==r)&&e({id:i,styleId:r,replace:o}),s.apply(this,[o])}),o.CSSStyleSheet.prototype.replaceSync&&(a=o.CSSStyleSheet.prototype.replaceSync,o.CSSStyleSheet.prototype.replaceSync=function(o){const{id:i,styleId:r}=st(this,t,n.styleMirror);return(i&&-1!==i||r&&-1!==r)&&e({id:i,styleId:r,replaceSync:o}),a.apply(this,[o])});const c={};qe?c.CSSGroupingRule=o.CSSGroupingRule:(Pe&&(c.CSSMediaRule=o.CSSMediaRule),Qe&&(c.CSSConditionRule=o.CSSConditionRule),Je&&(c.CSSSupportsRule=o.CSSSupportsRule));const l={};return Object.entries(c).forEach(([o,i])=>{l[o]={insertRule:i.prototype.insertRule,deleteRule:i.prototype.deleteRule},i.prototype.insertRule=function(i,r){const{id:s,styleId:a}=st(this.parentStyleSheet,t,n.styleMirror);return(s&&-1!==s||a&&-1!==a)&&e({id:s,styleId:a,adds:[{rule:i,index:[...rt(this),r||0]}]}),l[o].insertRule.apply(this,[i,r])},i.prototype.deleteRule=function(i){const{id:r,styleId:s}=st(this.parentStyleSheet,t,n.styleMirror);return(r&&-1!==r||s&&-1!==s)&&e({id:r,styleId:s,removes:[{index:[...rt(this),i]}]}),l[o].deleteRule.apply(this,[i])}}),()=>{o.CSSStyleSheet.prototype.insertRule=i,o.CSSStyleSheet.prototype.deleteRule=r,s&&(o.CSSStyleSheet.prototype.replace=s),a&&(o.CSSStyleSheet.prototype.replaceSync=a),Object.entries(c).forEach(([e,t])=>{t.prototype.insertRule=l[e].insertRule,t.prototype.deleteRule=l[e].deleteRule})}}(e,{win:n}),u=at(e,e.doc),h=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:o},{win:i}){const r=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=function(i,s,a){var c;if(n.has(i))return r.apply(this,[i,s,a]);const{id:l,styleId:d}=st(null===(c=this.parentRule)||void 0===c?void 0:c.parentStyleSheet,t,o.styleMirror);return(l&&-1!==l||d&&-1!==d)&&e({id:l,styleId:d,set:{property:i,value:s,priority:a},index:rt(this.parentRule)}),r.apply(this,[i,s,a])};const s=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=function(i){var r;if(n.has(i))return s.apply(this,[i]);const{id:a,styleId:c}=st(null===(r=this.parentRule)||void 0===r?void 0:r.parentStyleSheet,t,o.styleMirror);return(a&&-1!==a||c&&-1!==c)&&e({id:a,styleId:c,remove:{property:i},index:rt(this.parentRule)}),s.apply(this,[i])},()=>{i.CSSStyleDeclaration.prototype.setProperty=r,i.CSSStyleDeclaration.prototype.removeProperty=s}}(e,{win:n}),g=e.collectFonts?function({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const o=[],i=new WeakMap,r=n.FontFace;n.FontFace=function(e,t,n){const o=new r(e,t,n);return i.set(o,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),o};const s=we(t.fonts,"add",function(t){return function(n){return setTimeout(()=>{const t=i.get(n);t&&(e(t),i.delete(n))},0),t.apply(this,[n])}});return o.push(()=>{n.FontFace=r}),o.push(s),()=>{o.forEach(e=>e())}}(e):()=>{},p=function(e){const{doc:t,mirror:n,blockClass:o,blockSelector:i,selectionCb:r}=e;let s=!0;const a=()=>{const e=t.getSelection();if(!e||s&&(null==e?void 0:e.isCollapsed))return;s=e.isCollapsed||!1;const a=[],c=e.rangeCount||0;for(let t=0;t<c;t++){const r=e.getRangeAt(t),{startContainer:s,startOffset:c,endContainer:l,endOffset:d}=r;Te(s,o,i,!0)||Te(l,o,i,!0)||a.push({start:n.getId(s),startOffset:c,end:n.getId(l),endOffset:d})}r({ranges:a})};return a(),ve("selectionchange",a)}(e),m=[];for(const t of e.plugins)m.push(t.observer(t.callback,n,t.options));return()=>{je.forEach(e=>e.reset()),o.disconnect(),i(),r(),s(),a(),c(),l(),d(),u(),h(),g(),p(),m.forEach(e=>e())}}class lt{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,t,n,o){const i=n||this.getIdToRemoteIdMap(e),r=o||this.getRemoteIdToIdMap(e);let s=i.get(t);return s||(s=this.generateIdFn(),i.set(t,s),r.set(s,t)),s}getIds(e,t){const n=this.getIdToRemoteIdMap(e),o=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,n,o))}getRemoteId(e,t,n){const o=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const i=o.get(t);return i||-1}getRemoteIds(e,t){const n=this.getRemoteIdToIdMap(e);return t.map(t=>this.getRemoteId(e,t,n))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class dt{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new lt(ne),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new lt(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var n;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(n=this.loadListener)||void 0===n||n.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){if("rrweb"===e.data.type){if(!e.source)return;const t=this.crossOriginIframeMap.get(e.source);if(!t)return;const n=this.transformCrossOriginEvent(t,e.data.event);n&&this.wrappedEmit(n,e.data.isCheckout)}}transformCrossOriginEvent(e,t){var n;switch(t.type){case Le.FullSnapshot:return this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e),{timestamp:t.timestamp,type:Le.IncrementalSnapshot,data:{source:xe.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case Le.Meta:case Le.Load:case Le.DomContentLoaded:return!1;case Le.Plugin:return t;case Le.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case Le.IncrementalSnapshot:switch(t.data.source){case xe.Mutation:return t.data.adds.forEach(t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e)}),t.data.removes.forEach(t=>{this.replaceIds(t,e,["parentId","id"])}),t.data.attributes.forEach(t=>{this.replaceIds(t,e,["id"])}),t.data.texts.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case xe.Drag:case xe.TouchMove:case xe.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case xe.ViewportResize:return!1;case xe.MediaInteraction:case xe.MouseInteraction:case xe.Scroll:case xe.CanvasMutation:case xe.Input:return this.replaceIds(t.data,e,["id"]),t;case xe.StyleSheetRule:case xe.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case xe.Font:return t;case xe.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case xe.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null===(n=t.data.styles)||void 0===n||n.forEach(t=>{this.replaceStyleIds(t,e,["styleId"])}),t}}}replace(e,t,n,o){for(const i of o)(Array.isArray(t[i])||"number"==typeof t[i])&&(Array.isArray(t[i])?t[i]=e.getIds(n,t[i]):t[i]=e.getId(n,t[i]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id"]),"childNodes"in e&&e.childNodes.forEach(e=>{this.replaceIdOnNode(e,t)})}}class ut{constructor(e){this.shadowDoms=new WeakSet,this.restorePatches=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror;const t=this;this.restorePatches.push(we(Element.prototype,"attachShadow",function(e){return function(n){const o=e.call(this,n);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,this.ownerDocument),o}}))}addShadowRoot(e,t){H(e)&&(this.shadowDoms.has(e)||(this.shadowDoms.add(e),$e(Object.assign(Object.assign({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),tt(Object.assign(Object.assign({},this.bypassOptions),{scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(e.host)),at({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e)},0)))}observeAttachShadow(e){if(e.contentWindow){const t=this;this.restorePatches.push(we(e.contentWindow.HTMLElement.prototype,"attachShadow",function(n){return function(o){const i=n.call(this,o);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,e.contentDocument),i}}))}}reset(){this.restorePatches.forEach(e=>e()),this.shadowDoms=new WeakSet}}
|
|
2
|
-
/*! *****************************************************************************
|
|
3
|
-
Copyright (c) Microsoft Corporation.
|
|
4
|
-
|
|
5
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
-
purpose with or without fee is hereby granted.
|
|
7
|
-
|
|
8
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */function ht(e,t,n,o){return new(n||(n=Promise))(function(t,i){function r(e){try{a(o.next(e))}catch(e){i(e)}}function s(e){try{a(o.throw(e))}catch(e){i(e)}}function a(e){var o;e.done?t(e.value):(o=e.value,o instanceof n?o:new n(function(e){e(o)})).then(r,s)}a((o=o.apply(e,[])).next())})}for(var gt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",pt="undefined"==typeof Uint8Array?[]:new Uint8Array(256),mt=0;mt<64;mt++)pt[gt.charCodeAt(mt)]=mt;const ft=new Map;const It=(e,t,n)=>{if(!e||!Ct(e,t)&&"object"!=typeof e)return;const o=function(e,t){let n=ft.get(e);return n||(n=new Map,ft.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name);let i=o.indexOf(e);return-1===i&&(i=o.length,o.push(e)),i};function vt(e,t,n){if(e instanceof Array)return e.map(e=>vt(e,t,n));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray){return{rr_type:e.constructor.name,args:[Object.values(e)]}}if(e instanceof ArrayBuffer){const t=e.constructor.name,n=function(e){var t,n=new Uint8Array(e),o=n.length,i="";for(t=0;t<o;t+=3)i+=gt[n[t]>>2],i+=gt[(3&n[t])<<4|n[t+1]>>4],i+=gt[(15&n[t+1])<<2|n[t+2]>>6],i+=gt[63&n[t+2]];return o%3==2?i=i.substring(0,i.length-1)+"=":o%3==1&&(i=i.substring(0,i.length-2)+"=="),i}(e);return{rr_type:t,base64:n}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[vt(e.buffer,t,n),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[vt(e.data,t,n),e.width,e.height]}}if(Ct(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:It(e,t,n)}}return e}const yt=(e,t,n)=>[...e].map(e=>vt(e,t,n)),Ct=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(e=>"function"==typeof t[e]);return Boolean(n.find(n=>e instanceof t[n]))};function St(e,t,n){const o=[];try{const i=we(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(o,...i){return Te(this,t,n,!0)||"__context"in this||(this.__context=o),e.apply(this,[o,...i])}});o.push(i)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{o.forEach(e=>e())}}function bt(e,t,n,o,i,r,s){const a=[],c=Object.getOwnPropertyNames(e);for(const r of c)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(r))try{if("function"!=typeof e[r])continue;const c=we(e,r,function(e){return function(...a){const c=e.apply(this,a);if(It(c,s,this),!Te(this.canvas,o,i,!0)){const e=yt([...a],s,this),o={type:t,property:r,args:e};n(this.canvas,o)}return c}});a.push(c)}catch(o){const i=be(e,r,{set(e){n(this.canvas,{type:t,property:r,args:[e],setter:!0})}});a.push(i)}return a}var wt=null;try{var kt="undefined"!=typeof module&&"function"==typeof module.require&&module.require("worker_threads")||"function"==typeof __non_webpack_require__&&__non_webpack_require__("worker_threads")||"function"==typeof require&&require("worker_threads");wt=kt.Worker}catch(i){}function At(e,t,n){var o=function(e){return Buffer.from(e,"base64").toString("utf8")}(e),i=o.indexOf("\n",10)+1,r=o.substring(i)+"";return function(e){return new wt(r,Object.assign({},e,{eval:!0}))}}function Tt(e,t,n){var o=function(e){return atob(e)}(e),i=o.indexOf("\n",10)+1,r=o.substring(i)+"",s=new Blob([r],{type:"application/javascript"});return URL.createObjectURL(s)}var Mt="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0);var Et,Rt=(Et="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=",Mt?At(Et):function(e){var t;return function(n){return t=t||Tt(e),new Worker(t,n)}}(Et));class Ot{constructor(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)};const{sampling:t="all",win:n,blockClass:o,blockSelector:i,recordCanvas:r,dataURLOptions:s}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,r&&"all"===t&&this.initCanvasMutationObserver(n,o,i),r&&"number"==typeof t&&this.initCanvasFPSObserver(t,n,o,i,{dataURLOptions:s})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,n,o,i){const r=St(t,n,o),s=new Map,a=new Rt;a.onmessage=e=>{const{id:t}=e.data;if(s.set(t,!1),!("base64"in e.data))return;const{base64:n,type:o,width:i,height:r}=e.data;this.mutationCb({id:t,type:We["2D"],commands:[{property:"clearRect",args:[0,0,i,r]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:o}]},0,0]}]})};const c=1e3/e;let l,d=0;const u=e=>{d&&e-d<c||(d=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach(t=>{Te(t,n,o,!0)||e.push(t)}),e})().forEach(e=>ht(this,0,void 0,function*(){var t;const n=this.mirror.getId(e);if(s.get(n))return;if(s.set(n,!0),["webgl","webgl2"].includes(e.__context)){const n=e.getContext(e.__context);!1===(null===(t=null==n?void 0:n.getContextAttributes())||void 0===t?void 0:t.preserveDrawingBuffer)&&(null==n||n.clear(n.COLOR_BUFFER_BIT))}const o=yield createImageBitmap(e);a.postMessage({id:n,bitmap:o,width:e.width,height:e.height,dataURLOptions:i.dataURLOptions},[o])}))),l=requestAnimationFrame(u)};l=requestAnimationFrame(u),this.resetObservers=()=>{r(),cancelAnimationFrame(l)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const o=St(e,t,n),i=function(e,t,n,o){const i=[],r=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const s of r)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[s])continue;const r=we(t.CanvasRenderingContext2D.prototype,s,function(i){return function(...r){return Te(this.canvas,n,o,!0)||setTimeout(()=>{const n=yt([...r],t,this);e(this.canvas,{type:We["2D"],property:s,args:n})},0),i.apply(this,r)}});i.push(r)}catch(n){const o=be(t.CanvasRenderingContext2D.prototype,s,{set(t){e(this.canvas,{type:We["2D"],property:s,args:[t],setter:!0})}});i.push(o)}return()=>{i.forEach(e=>e())}}(this.processMutation.bind(this),e,t,n),r=function(e,t,n,o){const i=[];return i.push(...bt(t.WebGLRenderingContext.prototype,We.WebGL,e,n,o,0,t)),void 0!==t.WebGL2RenderingContext&&i.push(...bt(t.WebGL2RenderingContext.prototype,We.WebGL2,e,n,o,0,t)),()=>{i.forEach(e=>e())}}(this.processMutation.bind(this),e,t,n,this.mirror);this.resetObservers=()=>{o(),i(),r()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{const n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(e);if(!n||-1===t)return;const o=n.map(e=>{const t=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(e);i<o.length;i++)t.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(e,o[i])&&(n[o[i]]=e[o[i]])}return n}(e,["type"]);return t}),{type:i}=n[0];this.mutationCb({id:t,type:i,commands:o}),this.pendingCanvasMutations.delete(e)}}class Dt{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new Fe,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const n={id:t,styleIds:[]},o=[];for(const t of e){let e;if(this.styleMirror.has(t))e=this.styleMirror.getId(t);else{e=this.styleMirror.add(t);const n=Array.from(t.rules||CSSRule);o.push({styleId:e,rules:n.map((e,t)=>({rule:q(e),index:t}))})}n.styleIds.push(e)}o.length>0&&(n.styles=o),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}function Nt(e){return Object.assign(Object.assign({},e),{timestamp:Date.now()})}let Ft,Lt,xt,Bt=!1;const Wt=new P;function Vt(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:o,blockClass:i="rr-block",blockSelector:r=null,ignoreClass:s="rr-ignore",maskTextClass:a="rr-mask",maskTextSelector:c=null,inlineStylesheet:l=!0,maskAllInputs:d,maskInputOptions:u,slimDOMOptions:h,maskInputFn:g,maskTextFn:p,hooks:m,packFn:f,sampling:I={},dataURLOptions:v={},mousemoveWait:y,recordCanvas:C=!1,recordCrossOriginIframes:S=!1,userTriggeredOnInput:b=!1,collectFonts:w=!1,inlineImages:k=!1,plugins:A,keepIframeSrcFn:T=()=>!1,ignoreCSSAttributes:M=new Set([])}=e,E=!S||window.parent===window;let R=!1;if(!E)try{window.parent.document,R=!1}catch(e){R=!0}if(E&&!t)throw new Error("emit function is required");void 0!==y&&void 0===I.mousemove&&(I.mousemove=y),Wt.reset();const O=!0===d?{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!==u?u:{password:!0},D=!0===h||"all"===h?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===h,headMetaDescKeywords:"all"===h}:h||{};let N;!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let t=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do{if(this===t)return!0}while(t=t&&t.parentNode);return!1})}();let F=0;const L=e=>{for(const t of A||[])t.eventProcessor&&(e=t.eventProcessor(e));return f&&(e=f(e)),e};Ft=(e,i)=>{var r;if(!(null===(r=je[0])||void 0===r?void 0:r.isFrozen())||e.type===Le.FullSnapshot||e.type===Le.IncrementalSnapshot&&e.data.source===xe.Mutation||je.forEach(e=>e.unfreeze()),E)null==t||t(L(e),i);else if(R){const t={type:"rrweb",event:L(e),isCheckout:i};window.parent.postMessage(t,"*")}if(e.type===Le.FullSnapshot)N=e,F=0;else if(e.type===Le.IncrementalSnapshot){if(e.data.source===xe.Mutation&&e.data.isAttachIframe)return;F++;const t=o&&F>=o,i=n&&e.timestamp-N.timestamp>n;(t||i)&&Lt(!0)}};const x=e=>{Ft(Nt({type:Le.IncrementalSnapshot,data:Object.assign({source:xe.Mutation},e)}))},B=e=>Ft(Nt({type:Le.IncrementalSnapshot,data:Object.assign({source:xe.Scroll},e)})),W=e=>Ft(Nt({type:Le.IncrementalSnapshot,data:Object.assign({source:xe.CanvasMutation},e)})),V=new Dt({mutationCb:x,adoptedStyleSheetCb:e=>Ft(Nt({type:Le.IncrementalSnapshot,data:Object.assign({source:xe.AdoptedStyleSheet},e)}))}),G=new dt({mirror:Wt,mutationCb:x,stylesheetManager:V,recordCrossOriginIframes:S,wrappedEmit:Ft});for(const e of A||[])e.getMirror&&e.getMirror({nodeMirror:Wt,crossOriginIframeMirror:G.crossOriginIframeMirror,crossOriginIframeStyleMirror:G.crossOriginIframeStyleMirror});xt=new Ot({recordCanvas:C,mutationCb:W,win:window,blockClass:i,blockSelector:r,mirror:Wt,sampling:I.canvas,dataURLOptions:v});const Z=new ut({mutationCb:x,scrollCb:B,bypassOptions:{blockClass:i,blockSelector:r,maskTextClass:a,maskTextSelector:c,inlineStylesheet:l,maskInputOptions:O,dataURLOptions:v,maskTextFn:p,maskInputFn:g,recordCanvas:C,inlineImages:k,sampling:I,slimDOMOptions:D,iframeManager:G,stylesheetManager:V,canvasManager:xt,keepIframeSrcFn:T},mirror:Wt});Lt=(e=!1)=>{var t,n,o,s,d,u;Ft(Nt({type:Le.Meta,data:{href:window.location.href,width:Ae(),height:ke()}}),e),V.reset(),je.forEach(e=>e.lock());const h=function(e,t){var n=t||{},o=n.mirror,i=void 0===o?new P:o,r=n.blockClass,s=void 0===r?"rr-block":r,a=n.blockSelector,c=void 0===a?null:a,l=n.maskTextClass,d=void 0===l?"rr-mask":l,u=n.maskTextSelector,h=void 0===u?null:u,g=n.inlineStylesheet,p=void 0===g||g,m=n.inlineImages,f=void 0!==m&&m,I=n.recordCanvas,v=void 0!==I&&I,y=n.maskAllInputs,C=void 0!==y&&y,S=n.maskTextFn,b=n.maskInputFn,w=n.slimDOM,k=void 0!==w&&w,A=n.dataURLOptions,T=n.preserveWhiteSpace,M=n.onSerialize,E=n.onIframeLoad,R=n.iframeLoadTimeout,O=n.onStylesheetLoad,D=n.stylesheetLoadTimeout,N=n.keepIframeSrcFn;return Ie(e,{doc:e,mirror:i,blockClass:s,blockSelector:c,maskTextClass:d,maskTextSelector:h,skipChild:!1,inlineStylesheet:p,maskInputOptions:!0===C?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===C?{password:!0}:C,maskTextFn:S,maskInputFn:b,slimDOMOptions:!0===k||"all"===k?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===k,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===k?{}:k,dataURLOptions:A,inlineImages:f,recordCanvas:v,preserveWhiteSpace:T,onSerialize:M,onIframeLoad:E,iframeLoadTimeout:R,onStylesheetLoad:O,stylesheetLoadTimeout:D,keepIframeSrcFn:void 0===N?function(){return!1}:N,newlyAddedElement:!1})}(document,{mirror:Wt,blockClass:i,blockSelector:r,maskTextClass:a,maskTextSelector:c,inlineStylesheet:l,maskAllInputs:O,maskTextFn:p,slimDOM:D,dataURLOptions:v,recordCanvas:C,inlineImages:k,onSerialize:e=>{Oe(e,Wt)&&G.addIframe(e),De(e,Wt)&&V.trackLinkElement(e),Ne(e)&&Z.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{G.attachIframe(e,t),Z.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{V.attachLinkElement(e,t)},keepIframeSrcFn:T});if(!h)return console.warn("Failed to snapshot the document");Ft(Nt({type:Le.FullSnapshot,data:{node:h,initialOffset:{left:void 0!==window.pageXOffset?window.pageXOffset:(null===document||void 0===document?void 0:document.documentElement.scrollLeft)||(null===(n=null===(t=null===document||void 0===document?void 0:document.body)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===(o=null===document||void 0===document?void 0:document.body)||void 0===o?void 0:o.scrollLeft)||0,top:void 0!==window.pageYOffset?window.pageYOffset:(null===document||void 0===document?void 0:document.documentElement.scrollTop)||(null===(d=null===(s=null===document||void 0===document?void 0:document.body)||void 0===s?void 0:s.parentElement)||void 0===d?void 0:d.scrollTop)||(null===(u=null===document||void 0===document?void 0:document.body)||void 0===u?void 0:u.scrollTop)||0}}})),je.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&V.adoptStyleSheets(document.adoptedStyleSheets,Wt.getId(document))};try{const e=[];e.push(ve("DOMContentLoaded",()=>{Ft(Nt({type:Le.DomContentLoaded,data:{}}))}));const t=e=>{var t;return ct({mutationCb:x,mousemoveCb:(e,t)=>Ft(Nt({type:Le.IncrementalSnapshot,data:{source:t,positions:e}})),mouseInteractionCb:e=>Ft(Nt({type:Le.IncrementalSnapshot,data:Object.assign({source:xe.MouseInteraction},e)})),scrollCb:B,viewportResizeCb:e=>Ft(Nt({type:Le.IncrementalSnapshot,data:Object.assign({source:xe.ViewportResize},e)})),inputCb:e=>Ft(Nt({type:Le.IncrementalSnapshot,data:Object.assign({source:xe.Input},e)})),mediaInteractionCb:e=>Ft(Nt({type:Le.IncrementalSnapshot,data:Object.assign({source:xe.MediaInteraction},e)})),styleSheetRuleCb:e=>Ft(Nt({type:Le.IncrementalSnapshot,data:Object.assign({source:xe.StyleSheetRule},e)})),styleDeclarationCb:e=>Ft(Nt({type:Le.IncrementalSnapshot,data:Object.assign({source:xe.StyleDeclaration},e)})),canvasMutationCb:W,fontCb:e=>Ft(Nt({type:Le.IncrementalSnapshot,data:Object.assign({source:xe.Font},e)})),selectionCb:e=>{Ft(Nt({type:Le.IncrementalSnapshot,data:Object.assign({source:xe.Selection},e)}))},blockClass:i,ignoreClass:s,maskTextClass:a,maskTextSelector:c,maskInputOptions:O,inlineStylesheet:l,sampling:I,recordCanvas:C,inlineImages:k,userTriggeredOnInput:b,collectFonts:w,doc:e,maskInputFn:g,maskTextFn:p,keepIframeSrcFn:T,blockSelector:r,slimDOMOptions:D,dataURLOptions:v,mirror:Wt,iframeManager:G,stylesheetManager:V,shadowDomManager:Z,canvasManager:xt,ignoreCSSAttributes:M,plugins:(null===(t=null==A?void 0:A.filter(e=>e.observer))||void 0===t?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>Ft(Nt({type:Le.Plugin,data:{plugin:e.name,payload:t}}))})))||[]},m)};G.addLoadListener(n=>{e.push(t(n.contentDocument))});const n=()=>{Lt(),e.push(t(document)),Bt=!0};return"interactive"===document.readyState||"complete"===document.readyState?n():e.push(ve("load",()=>{Ft(Nt({type:Le.Load,data:{}})),n()},window)),()=>{e.forEach(e=>e()),Bt=!1}}catch(e){console.warn(e)}}Vt.addCustomEvent=(e,t)=>{if(!Bt)throw new Error("please add custom event after start recording");Ft(Nt({type:Le.Custom,data:{tag:e,payload:t}}))},Vt.freezePage=()=>{je.forEach(e=>e.freeze())},Vt.takeFullSnapshot=e=>{if(!Bt)throw new Error("please take full snapshot after start recording");Lt(e)},Vt.mirror=Wt;class Gt{constructor(e,t,n){this.stopFn=null,this.events=[],this.onEventsReady=null,this.flushInterval=null,this.hasFullSnapshot=!1,this.sessionId=e,this.config=t,this.onEventsReady=n}start(){if(this.config.enabled)if(this.stopFn)console.warn("[RRWeb] Recording already started");else try{console.log("[RRWeb] Starting session recording:",this.sessionId),console.log("[RRWeb] SDK Version: 1.0.9"),this.stopFn=Vt({emit:e=>{this.events.push(e),2===e.type?(this.hasFullSnapshot=!0,console.log("[RRWeb] ✅ FullSnapshot captured! Sending immediately..."),this.flush()):this.hasFullSnapshot&&this.events.length>=50&&this.flush()},sampling:{mousemove:void 0===this.config.sampleRate||Math.floor(100/this.config.sampleRate),mouseInteraction:!0,scroll:150,media:800,input:"last"},checkoutEveryNms:this.config.checkoutEveryNms||3e5,checkoutEveryNth:this.config.checkoutEveryNth||200,blockClass:this.config.blockClass||"rr-block",ignoreClass:this.config.ignoreClass||"rr-ignore",maskAllInputs:void 0===this.config.maskAllInputs||this.config.maskAllInputs,maskInputOptions:this.config.maskInputOptions||{password:!0,email:!0,tel:!0},maskTextClass:"rr-mask",inlineStylesheet:void 0===this.config.inlineStylesheet||this.config.inlineStylesheet,recordCanvas:this.config.recordCanvas||!1,collectFonts:void 0===this.config.collectFonts||this.config.collectFonts,recordCrossOriginIframes:!1}),this.flushInterval=window.setInterval(()=>{this.hasFullSnapshot&&this.events.length>0&&this.flush()},1e4),console.log("[RRWeb] Recording started successfully")}catch(e){console.error("[RRWeb] Failed to start recording:",e)}else console.log("[RRWeb] Recording disabled in config")}stop(){this.stopFn&&(this.stopFn(),this.stopFn=null,console.log("[RRWeb] Recording stopped")),this.flushInterval&&(clearInterval(this.flushInterval),this.flushInterval=null),this.events.length>0&&(this.hasFullSnapshot||console.warn("[RRWeb] Flushing events without FullSnapshot - recording may not replay correctly"),this.flush())}flush(){if(0===this.events.length)return;const e=[...this.events];this.events=[];const t={};e.forEach(e=>{t[e.type]=(t[e.type]||0)+1}),console.log("[RRWeb] Flushing events:",t),this.onEventsReady&&this.onEventsReady(e)}getEventCount(){return this.events.length}isRecording(){return null!==this.stopFn}}class Zt{constructor(e){this.config=e,this.queue=[],this.flushInterval=null,this.maxQueueSize=50,this.flushIntervalMs=5e3,this.apiUrl=e.apiUrl||"https://api.devskin.com",this.startPeriodicFlush(),"undefined"!=typeof window&&(window.addEventListener("beforeunload",()=>{this.flush()}),window.addEventListener("visibilitychange",()=>{document.hidden&&this.flush(!0)}))}sendEvent(e){this.enqueue("event",e)}identifyUser(e){this.sendToBackend("/v1/analytics/identify",e)}startSession(e){this.sendToBackend("/v1/analytics/session",e)}sendError(e){this.enqueue("error",e)}sendNetworkRequest(e){this.enqueue("network",e)}sendPerformanceMetric(e){this.enqueue("performance",e)}sendRecordingEvents(e,n){return t(this,void 0,void 0,function*(){const t=n.reduce((e,t)=>(e[t.type]=(e[t.type]||0)+1,e),{});console.log(`[DevSkin SDK] Sending ${n.length} recording events:`,t),console.log("[DevSkin SDK] First 3 events:",n.slice(0,3).map(e=>({type:e.type,timestamp:e.timestamp})));try{yield this.sendToBackend("/v1/rum/recordings",{session_id:e,events:n,timestamp:(new Date).toISOString()}),console.log("[DevSkin SDK] ✅ Recording events sent successfully")}catch(e){console.error("[DevSkin SDK] ❌ Failed to send recording events:",e)}})}sendHeatmapData(e){this.enqueue("heatmap",e)}flush(e=!1){if(0===this.queue.length)return;const t=[...this.queue];this.queue=[];const n={};t.forEach(e=>{n[e.type]||(n[e.type]=[]),n[e.type].push(e.data)}),Object.entries(n).forEach(([t,n])=>{const o=this.getEndpointForType(t);this.sendToBackend(o,{[t+"s"]:n},e)}),this.config.debug&&console.log(`[DevSkin] Flushed ${t.length} items to backend`)}enqueue(e,t){this.queue.push({type:e,data:t,timestamp:Date.now()}),this.queue.length>=this.maxQueueSize&&this.flush()}startPeriodicFlush(){this.flushInterval=setInterval(()=>{this.flush()},this.flushIntervalMs)}getEndpointForType(e){switch(e){case"event":default:return"/v1/analytics/events";case"error":return"/v1/analytics/errors";case"network":return"/v1/analytics/network";case"performance":return"/v1/analytics/performance";case"heatmap":return"/v1/analytics/heatmap"}}sendToBackend(e,n){return t(this,arguments,void 0,function*(e,t,n=!1){const o=`${this.apiUrl}${e}`,i=Object.assign(Object.assign({},t),{apiKey:this.config.apiKey,appId:this.config.appId,environment:this.config.environment,release:this.config.release});if(this.config.beforeSend){if(!this.config.beforeSend(i))return}if(n&&navigator.sendBeacon){const e=new Blob([JSON.stringify(i)],{type:"application/json"});return void navigator.sendBeacon(o,e)}try{const t=yield fetch(o,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.config.apiKey}`},body:JSON.stringify(i),keepalive:!0});if(!t.ok){const e=yield t.text();throw console.error("[DevSkin] HTTP Error:",t.status,e),new Error(`HTTP ${t.status}: ${t.statusText}`)}this.config.debug&&console.log("[DevSkin] Data sent successfully:",e)}catch(t){throw console.error("[DevSkin] Failed to send data to",e,":",t),t}})}destroy(){this.flushInterval&&(clearInterval(this.flushInterval),this.flushInterval=null),this.flush()}}return new class{constructor(){this.config=null,this.transport=null,this.sessionId=null,this.userId=null,this.anonymousId=null,this.sessionStartTime=0,this.initialized=!1,this.deviceCollector=null,this.locationCollector=null,this.browserCollector=null,this.performanceCollector=null,this.errorCollector=null,this.networkCollector=null,this.heatmapCollector=null,this.rrwebRecorder=null}init(t){var i,r;this.initialized?console.warn("[DevSkin] SDK already initialized"):(this.config=Object.assign({debug:!1,captureWebVitals:!0,captureNetworkRequests:!0,captureErrors:!0,captureUserAgent:!0,captureLocation:!0,captureDevice:!0},t),this.config.debug&&console.log("[DevSkin] Initializing SDK with config:",this.config),this.transport=new Zt(this.config),this.anonymousId=this.getOrCreateAnonymousId(),this.deviceCollector=new e(this.config),this.locationCollector=new n(this.config),this.browserCollector=new o(this.config),this.startSession(),this.config.captureWebVitals&&(this.performanceCollector=new U(this.config,this.transport),this.performanceCollector.start()),this.config.captureErrors&&(this.errorCollector=new K(this.config,this.transport),this.errorCollector.start()),this.config.captureNetworkRequests&&(this.networkCollector=new _(this.config,this.transport),this.networkCollector.start()),(null===(i=this.config.heatmapOptions)||void 0===i?void 0:i.enabled)&&(this.heatmapCollector=new z(this.config,this.transport),this.heatmapCollector.start()),(null===(r=this.config.sessionRecording)||void 0===r?void 0:r.enabled)&&(this.rrwebRecorder=new Gt(this.sessionId,{enabled:!0,sampleRate:this.config.sessionRecording.sampling||.5,blockClass:"rr-block",ignoreClass:this.config.sessionRecording.ignoreClass||"rr-ignore",maskAllInputs:void 0===this.config.sessionRecording.maskAllInputs||this.config.sessionRecording.maskAllInputs,maskInputOptions:{password:!0,email:!0,tel:!0},recordCanvas:this.config.sessionRecording.recordCanvas||!1,collectFonts:!0,inlineStylesheet:!0,checkoutEveryNms:3e5,checkoutEveryNth:200},e=>{var t;null===(t=this.transport)||void 0===t||t.sendRecordingEvents(this.sessionId,e)}),this.rrwebRecorder.start(),this.config.debug&&console.log("[DevSkin] RRWeb recording started for session:",this.sessionId)),this.trackPageView(),this.setupVisibilityTracking(),this.setupUnloadTracking(),this.initialized=!0,this.config.debug&&console.log("[DevSkin] SDK initialized successfully"))}track(e,t){var n,o;if(!this.initialized)return void console.warn("[DevSkin] SDK not initialized. Call init() first.");const i={event_name:e,event_type:"track",timestamp:(new Date).toISOString(),session_id:this.sessionId,user_id:this.userId||void 0,anonymous_id:this.anonymousId||void 0,properties:Object.assign(Object.assign({},t),this.getContextData()),page_url:window.location.href,page_title:document.title};null===(n=this.transport)||void 0===n||n.sendEvent(i),(null===(o=this.config)||void 0===o?void 0:o.debug)&&console.log("[DevSkin] Event tracked:",i)}trackPageView(e){this.track("page_view",Object.assign({path:window.location.pathname,search:window.location.search,hash:window.location.hash,referrer:document.referrer},e))}identify(e,t){var n,o;if(!this.initialized)return void console.warn("[DevSkin] SDK not initialized. Call init() first.");this.userId=e;const i={user_id:e,anonymous_id:this.anonymousId||void 0,traits:Object.assign(Object.assign({},t),this.getContextData()),session_id:this.sessionId,timestamp:(new Date).toISOString()};null===(n=this.transport)||void 0===n||n.identifyUser(i),(null===(o=this.config)||void 0===o?void 0:o.debug)&&console.log("[DevSkin] User identified:",i)}captureError(e,t){var n;this.initialized?null===(n=this.errorCollector)||void 0===n||n.captureError(e,Object.assign(Object.assign({},t),{session_id:this.sessionId,user_id:this.userId||void 0})):console.warn("[DevSkin] SDK not initialized. Call init() first.")}addBreadcrumb(e){var t;this.initialized&&(null===(t=this.errorCollector)||void 0===t||t.addBreadcrumb(e))}startRecording(){var e;null===(e=this.rrwebRecorder)||void 0===e||e.start()}stopRecording(){var e;null===(e=this.rrwebRecorder)||void 0===e||e.stop()}optOut(){localStorage.setItem("devskin_opt_out","true"),this.initialized=!1}optIn(){localStorage.removeItem("devskin_opt_out")}startSession(){var e;this.sessionId=this.generateId(),this.sessionStartTime=Date.now();const t=Object.assign({session_id:this.sessionId,user_id:this.userId||void 0,anonymous_id:this.anonymousId,started_at:(new Date).toISOString()},this.getContextData());null===(e=this.transport)||void 0===e||e.startSession(t)}getContextData(){const e={};return this.deviceCollector&&(e.device=this.deviceCollector.collect()),this.browserCollector&&(e.browser=this.browserCollector.collect()),this.locationCollector&&(e.location=this.locationCollector.collect()),e}getOrCreateAnonymousId(){let e=localStorage.getItem("devskin_anonymous_id");return e||(e=this.generateId(),localStorage.setItem("devskin_anonymous_id",e)),e}generateId(){return`${Date.now()}-${Math.random().toString(36).substr(2,9)}`}setupVisibilityTracking(){document.addEventListener("visibilitychange",()=>{document.hidden?this.track("page_hidden"):this.track("page_visible")})}setupUnloadTracking(){window.addEventListener("beforeunload",()=>{var e,t;if(this.track("page_unload"),this.sessionId&&this.sessionStartTime){const t=new Date,n=Date.now()-this.sessionStartTime;null===(e=this.transport)||void 0===e||e.startSession(Object.assign({session_id:this.sessionId,user_id:this.userId||void 0,anonymous_id:this.anonymousId,ended_at:t.toISOString(),duration_ms:n},this.getContextData()))}null===(t=this.transport)||void 0===t||t.flush(!0)})}}});
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).DevSkin=t()}(this,function(){"use strict";class e{constructor(e){this.config=e}collect(){return{type:this.getDeviceType(),vendor:this.getVendor(),model:this.getModel(),os:this.getOS(),screen:this.getScreenInfo(),memory:this.getMemory(),cores:this.getCores(),connection:this.getConnection()}}getDeviceType(){const e=navigator.userAgent;return/(tablet|ipad|playbook|silk)|(android(?!.*mobi))/i.test(e)?"tablet":/Mobile|Android|iP(hone|od)|IEMobile|BlackBerry|Kindle|Silk-Accelerated|(hpw|web)OS|Opera M(obi|ini)/.test(e)?"mobile":e.includes("Windows")||e.includes("Macintosh")||e.includes("Linux")?"desktop":"unknown"}getVendor(){return navigator.vendor||void 0}getModel(){const e=navigator.userAgent.match(/\(([^)]+)\)/);if(e&&e[1])return e[1]}getOS(){const e=navigator.userAgent;let t="Unknown",r="";if(e.includes("Win"))t="Windows",e.includes("Windows NT 10.0")?r="10":e.includes("Windows NT 6.3")?r="8.1":e.includes("Windows NT 6.2")?r="8":e.includes("Windows NT 6.1")&&(r="7");else if(e.includes("Mac")){t="macOS";const s=e.match(/Mac OS X (\d+[._]\d+[._]\d+)?/);s&&s[1]&&(r=s[1].replace(/_/g,"."))}else if(e.includes("X11")||e.includes("Linux"))t="Linux";else if(e.includes("Android")){t="Android";const s=e.match(/Android (\d+\.?\d*)/);s&&s[1]&&(r=s[1])}else if(e.includes("iOS")||e.includes("iPhone")||e.includes("iPad")){t="iOS";const s=e.match(/OS (\d+_\d+(_\d+)?)/);s&&s[1]&&(r=s[1].replace(/_/g,"."))}return{name:t,version:r}}getScreenInfo(){return{width:window.screen.width,height:window.screen.height,orientation:this.getOrientation(),pixelRatio:window.devicePixelRatio||1}}getOrientation(){return window.screen.orientation?window.screen.orientation.type:window.innerWidth>window.innerHeight?"landscape":"portrait"}getMemory(){return navigator.deviceMemory}getCores(){return navigator.hardwareConcurrency}getConnection(){const e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(e)return{effectiveType:e.effectiveType,downlink:e.downlink,rtt:e.rtt,saveData:e.saveData}}}function t(e,t,r,s){return new(r||(r=Promise))(function(n,o){function i(e){try{l(s.next(e))}catch(e){o(e)}}function a(e){try{l(s.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r(function(e){e(t)})).then(i,a)}l((s=s.apply(e,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;class r{constructor(e){this.config=e,this.geoData=null,this.config.captureLocation&&this.requestGeolocation()}collect(){return Object.assign({url:window.location.href,hostname:window.location.hostname,pathname:window.location.pathname,search:window.location.search,hash:window.location.hash,protocol:window.location.protocol,port:window.location.port,referrer:document.referrer},this.geoData)}requestGeolocation(){return t(this,void 0,void 0,function*(){try{const e=Intl.DateTimeFormat().resolvedOptions().timeZone;this.geoData={timezone:e},"geolocation"in navigator&&navigator.geolocation.getCurrentPosition(e=>{this.geoData=Object.assign(Object.assign({},this.geoData),{latitude:e.coords.latitude,longitude:e.coords.longitude}),this.reverseGeocode(e.coords.latitude,e.coords.longitude)},e=>{this.config.debug&&console.log("[DevSkin] Geolocation permission denied or error:",e)},{timeout:5e3,maximumAge:6e5})}catch(e){this.config.debug&&console.error("[DevSkin] Error requesting geolocation:",e)}})}reverseGeocode(e,r){return t(this,void 0,void 0,function*(){try{const t=yield fetch(`https://nominatim.openstreetmap.org/reverse?format=json&lat=${e}&lon=${r}&zoom=10&addressdetails=1`,{headers:{"User-Agent":"DevSkin-SDK/1.0"}});if(t.ok){const e=yield t.json();e.address&&(this.geoData=Object.assign(Object.assign({},this.geoData),{country:e.address.country,region:e.address.state||e.address.region,city:e.address.city||e.address.town||e.address.village}))}}catch(e){this.config.debug&&console.error("[DevSkin] Error reverse geocoding:",e)}})}}class s{constructor(e){this.config=e}collect(){return{name:this.getBrowserName(),version:this.getBrowserVersion(),engine:this.getEngine(),userAgent:navigator.userAgent,language:navigator.language,languages:navigator.languages?Array.from(navigator.languages):[navigator.language],cookieEnabled:navigator.cookieEnabled,doNotTrack:this.getDoNotTrack(),viewport:{width:window.innerWidth,height:window.innerHeight},timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,timezoneOffset:(new Date).getTimezoneOffset()}}getBrowserName(){const e=navigator.userAgent;return e.includes("Firefox")?"Firefox":e.includes("Edg")?"Edge":e.includes("Chrome")?"Chrome":e.includes("Safari")&&!e.includes("Chrome")?"Safari":e.includes("Opera")||e.includes("OPR")?"Opera":e.includes("Trident")||e.includes("MSIE")?"Internet Explorer":"Unknown"}getBrowserVersion(){const e=navigator.userAgent;let t=null;switch(this.getBrowserName()){case"Chrome":t=e.match(/Chrome\/(\d+\.\d+)/);break;case"Firefox":t=e.match(/Firefox\/(\d+\.\d+)/);break;case"Safari":t=e.match(/Version\/(\d+\.\d+)/);break;case"Edge":t=e.match(/Edg\/(\d+\.\d+)/);break;case"Opera":if(t=e.match(/(Opera|OPR)\/(\d+\.\d+)/),t)return t[2];break;case"Internet Explorer":if(t=e.match(/(MSIE |rv:)(\d+\.\d+)/),t)return t[2]}return t&&t[1]?t[1]:""}getEngine(){const e=navigator.userAgent;return e.includes("Gecko")&&e.includes("Firefox")?"Gecko":e.includes("AppleWebKit")?e.includes("Chrome")||e.includes("Edg")?"Blink":"WebKit":e.includes("Trident")?"Trident":"Unknown"}getDoNotTrack(){const e=navigator.doNotTrack||window.doNotTrack||navigator.msDoNotTrack;return"1"===e||"yes"===e||"0"!==e&&"no"!==e&&null}}var n,o,i,a,l=-1,c=function(e){addEventListener("pageshow",function(t){t.persisted&&(l=t.timeStamp,e(t))},!0)},h=function(){return window.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},u=function(){var e=h();return e&&e.activationStart||0},d=function(e,t){var r=h(),s="navigate";return l>=0?s="back-forward-cache":r&&(document.prerendering||u()>0?s="prerender":document.wasDiscarded?s="restore":r.type&&(s=r.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:s}},p=function(e,t,r){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var s=new PerformanceObserver(function(e){Promise.resolve().then(function(){t(e.getEntries())})});return s.observe(Object.assign({type:e,buffered:!0},r||{})),s}}catch(e){}},f=function(e,t,r,s){var n,o;return function(i){t.value>=0&&(i||s)&&((o=t.value-(n||0))||void 0===n)&&(n=t.value,t.delta=o,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,r),e(t))}},m=function(e){requestAnimationFrame(function(){return requestAnimationFrame(function(){return e()})})},g=function(e){var t=function(t){"pagehide"!==t.type&&"hidden"!==document.visibilityState||e(t)};addEventListener("visibilitychange",t,!0),addEventListener("pagehide",t,!0)},y=function(e){var t=!1;return function(r){t||(e(r),t=!0)}},w=-1,v=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},b=function(e){"hidden"===document.visibilityState&&w>-1&&(w="visibilitychange"===e.type?e.timeStamp:0,C())},S=function(){addEventListener("visibilitychange",b,!0),addEventListener("prerenderingchange",b,!0)},C=function(){removeEventListener("visibilitychange",b,!0),removeEventListener("prerenderingchange",b,!0)},k=function(){return w<0&&(w=v(),S(),c(function(){setTimeout(function(){w=v(),S()},0)})),{get firstHiddenTime(){return w}}},I=function(e){document.prerendering?addEventListener("prerenderingchange",function(){return e()},!0):e()},x=[1800,3e3],O=function(e,t){t=t||{},I(function(){var r,s=k(),n=d("FCP"),o=p("paint",function(e){e.forEach(function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<s.firstHiddenTime&&(n.value=Math.max(e.startTime-u(),0),n.entries.push(e),r(!0)))})});o&&(r=f(e,n,x,t.reportAllChanges),c(function(s){n=d("FCP"),r=f(e,n,x,t.reportAllChanges),m(function(){n.value=performance.now()-s.timeStamp,r(!0)})}))})},M=[.1,.25],E={passive:!0,capture:!0},R=new Date,A=function(e,t){n||(n=t,o=e,i=new Date,N(removeEventListener),T())},T=function(){if(o>=0&&o<i-R){var e={entryType:"first-input",name:n.type,target:n.target,cancelable:n.cancelable,startTime:n.timeStamp,processingStart:n.timeStamp+o};a.forEach(function(t){t(e)}),a=[]}},D=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var r=function(){A(e,t),n()},s=function(){n()},n=function(){removeEventListener("pointerup",r,E),removeEventListener("pointercancel",s,E)};addEventListener("pointerup",r,E),addEventListener("pointercancel",s,E)}(t,e):A(t,e)}},N=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach(function(t){return e(t,D,E)})},L=[100,300],F=[2500,4e3],P={},B=[800,1800],_=function e(t){document.prerendering?I(function(){return e(t)}):"complete"!==document.readyState?addEventListener("load",function(){return e(t)},!0):setTimeout(t,0)},U=function(e,t){t=t||{};var r=d("TTFB"),s=f(e,r,B,t.reportAllChanges);_(function(){var n=h();if(n){var o=n.responseStart;if(o<=0||o>performance.now())return;r.value=Math.max(o-u(),0),r.entries=[n],s(!0),c(function(){r=d("TTFB",0),(s=f(e,r,B,t.reportAllChanges))(!0)})}})};class W{constructor(e,t){this.config=e,this.transport=t,this.metrics={}}start(){!function(e,t){t=t||{},O(y(function(){var r,s=d("CLS",0),n=0,o=[],i=function(e){e.forEach(function(e){if(!e.hadRecentInput){var t=o[0],r=o[o.length-1];n&&e.startTime-r.startTime<1e3&&e.startTime-t.startTime<5e3?(n+=e.value,o.push(e)):(n=e.value,o=[e])}}),n>s.value&&(s.value=n,s.entries=o,r())},a=p("layout-shift",i);a&&(r=f(e,s,M,t.reportAllChanges),g(function(){i(a.takeRecords()),r(!0)}),c(function(){n=0,s=d("CLS",0),r=f(e,s,M,t.reportAllChanges),m(function(){return r()})}),setTimeout(r,0))}))}(e=>this.handleMetric(e)),O(e=>this.handleMetric(e)),function(e,t){t=t||{},I(function(){var r,s=k(),i=d("FID"),l=function(e){e.startTime<s.firstHiddenTime&&(i.value=e.processingStart-e.startTime,i.entries.push(e),r(!0))},h=function(e){e.forEach(l)},u=p("first-input",h);r=f(e,i,L,t.reportAllChanges),u&&g(y(function(){h(u.takeRecords()),u.disconnect()})),u&&c(function(){var s;i=d("FID"),r=f(e,i,L,t.reportAllChanges),a=[],o=-1,n=null,N(addEventListener),s=l,a.push(s),T()})})}(e=>this.handleMetric(e)),function(e,t){t=t||{},I(function(){var r,s=k(),n=d("LCP"),o=function(e){var t=e[e.length-1];t&&t.startTime<s.firstHiddenTime&&(n.value=Math.max(t.startTime-u(),0),n.entries=[t],r())},i=p("largest-contentful-paint",o);if(i){r=f(e,n,F,t.reportAllChanges);var a=y(function(){P[n.id]||(o(i.takeRecords()),i.disconnect(),P[n.id]=!0,r(!0))});["keydown","click"].forEach(function(e){addEventListener(e,function(){return setTimeout(a,0)},!0)}),g(a),c(function(s){n=d("LCP"),r=f(e,n,F,t.reportAllChanges),m(function(){n.value=performance.now()-s.timeStamp,P[n.id]=!0,r(!0)})})}})}(e=>this.handleMetric(e)),U(e=>this.handleMetric(e)),this.collectNavigationTimings(),this.collectResourceTimings(),this.config.longTaskThreshold&&this.observeLongTasks()}handleMetric(e){const t=e.name.toLowerCase();this.metrics[t]=e.value,this.config.debug&&console.log(`[DevSkin] Web Vital ${e.name}:`,e.value),this.transport.sendPerformanceMetric({name:e.name,value:e.value,rating:e.rating,delta:e.delta,timestamp:(new Date).toISOString()})}collectNavigationTimings(){window.performance&&window.performance.timing&&window.addEventListener("load",()=>{setTimeout(()=>{const e=window.performance.timing,t=window.performance.navigation,r=e.domContentLoadedEventEnd-e.navigationStart,s=e.loadEventEnd-e.navigationStart;this.metrics.domLoad=r,this.metrics.windowLoad=s,this.config.debug&&console.log("[DevSkin] Navigation Timings:",{domLoad:r,windowLoad:s,navigationType:t.type}),this.transport.sendPerformanceMetric({name:"Navigation",value:s,details:{domLoad:r,windowLoad:s,navigationType:t.type,redirectCount:t.redirectCount,dns:e.domainLookupEnd-e.domainLookupStart,tcp:e.connectEnd-e.connectStart,request:e.responseStart-e.requestStart,response:e.responseEnd-e.responseStart,dom:e.domComplete-e.domLoading},timestamp:(new Date).toISOString()})},0)})}collectResourceTimings(){window.performance&&window.performance.getEntriesByType&&window.addEventListener("load",()=>{setTimeout(()=>{const e=window.performance.getEntriesByType("resource"),t={total:e.length,byType:{},slowest:[]};e.forEach(e=>{const r=e.initiatorType||"other";t.byType[r]=(t.byType[r]||0)+1}),t.slowest=e.map(e=>({name:e.name,duration:e.duration,type:e.initiatorType})).sort((e,t)=>t.duration-e.duration).slice(0,10),this.config.debug&&console.log("[DevSkin] Resource Timings:",t),this.transport.sendPerformanceMetric({name:"Resources",value:e.length,details:t,timestamp:(new Date).toISOString()})},1e3)})}observeLongTasks(){if("PerformanceObserver"in window)try{const e=new PerformanceObserver(e=>{for(const t of e.getEntries())t.duration>=(this.config.longTaskThreshold||50)&&(this.config.debug&&console.log("[DevSkin] Long Task detected:",t),this.transport.sendPerformanceMetric({name:"LongTask",value:t.duration,details:{name:t.name,entryType:t.entryType,startTime:t.startTime},timestamp:(new Date).toISOString()}))});e.observe({entryTypes:["longtask"]})}catch(e){this.config.debug&&console.error("[DevSkin] Error observing long tasks:",e)}}getMetrics(){return Object.assign({},this.metrics)}}class z{constructor(e,t){var r;this.config=e,this.transport=t,this.breadcrumbs=[],this.maxBreadcrumbs=(null===(r=e.errorOptions)||void 0===r?void 0:r.maxBreadcrumbs)||30}start(){window.addEventListener("error",e=>{this.handleError(e.error||e.message,{filename:e.filename,lineno:e.lineno,colno:e.colno})}),window.addEventListener("unhandledrejection",e=>{this.handleError(e.reason,{type:"unhandledrejection"})}),this.setupAutomaticBreadcrumbs()}captureError(e,t){this.handleError(e,t)}addBreadcrumb(e){const t={category:e.category,message:e.message,level:e.level||"info",timestamp:(new Date).toISOString(),data:e.data};this.breadcrumbs.push(t),this.breadcrumbs.length>this.maxBreadcrumbs&&this.breadcrumbs.shift(),this.config.debug&&console.log("[DevSkin] Breadcrumb added:",t)}handleError(e,t){var r;if(this.shouldIgnoreError(e))return;let s;if(e instanceof Error){if(s={message:e.message,stack:e.stack,type:e.name||"Error",timestamp:(new Date).toISOString(),session_id:"",url:window.location.href,breadcrumbs:[...this.breadcrumbs],context:Object.assign(Object.assign({},t),{userAgent:navigator.userAgent,viewport:{width:window.innerWidth,height:window.innerHeight}})},e.stack){const t=e.stack.match(/:(\d+):(\d+)/);t&&(s.line=parseInt(t[1],10),s.column=parseInt(t[2],10))}}else s={message:String(e),type:"Error",timestamp:(new Date).toISOString(),session_id:"",url:window.location.href,breadcrumbs:[...this.breadcrumbs],context:t};(null===(r=this.config.errorOptions)||void 0===r?void 0:r.includeLocalVariables)&&t&&(s.context=Object.assign(Object.assign({},s.context),{localVariables:t})),this.config.debug&&console.log("[DevSkin] Error captured:",s),this.addBreadcrumb({category:"error",message:s.message,level:"error",data:{type:s.type,stack:s.stack}}),this.transport.sendError(s)}shouldIgnoreError(e){var t,r;const s=(null===(t=this.config.errorOptions)||void 0===t?void 0:t.ignoreErrors)||[],n=e instanceof Error?e.message:String(e);for(const e of s)if(e instanceof RegExp){if(e.test(n))return!0}else if("string"==typeof e&&n.includes(e))return!0;const o=(null===(r=this.config.errorOptions)||void 0===r?void 0:r.denyUrls)||[],i=e instanceof Error?e.stack:"";for(const e of o)if(e.test(i||""))return!0;return!1}setupAutomaticBreadcrumbs(){this.wrapConsole(),document.addEventListener("click",e=>{var t;const r=e.target;this.addBreadcrumb({category:"ui.click",message:`Clicked on ${r.tagName}`,data:{tagName:r.tagName,id:r.id,className:r.className,innerText:null===(t=r.innerText)||void 0===t?void 0:t.substring(0,100)}})},!0);let e=window.location.href;const t=()=>{e!==window.location.href&&(this.addBreadcrumb({category:"navigation",message:`Navigated to ${window.location.pathname}`,data:{from:e,to:window.location.href}}),e=window.location.href)};window.addEventListener("popstate",t),window.addEventListener("hashchange",t);const r=history.pushState;history.pushState=function(...e){r.apply(this,e),t()};const s=history.replaceState;history.replaceState=function(...e){s.apply(this,e),t()}}wrapConsole(){["log","info","warn","error"].forEach(e=>{const t=console[e];console[e]=(...r)=>{if(t.apply(console,r),"warn"===e||"error"===e){const t=r.map(e=>String(e)).join(" ");if(t.startsWith("[DevSkin]"))return;this.addBreadcrumb({category:"console",message:t,level:"warn"===e?"warning":"error",data:{arguments:r}})}}})}getBreadcrumbs(){return[...this.breadcrumbs]}}class j{constructor(e,t){this.config=e,this.transport=t}start(){this.interceptFetch(),this.interceptXHR()}interceptFetch(){if(!window.fetch)return;const e=window.fetch;window.fetch=(...r)=>t(this,void 0,void 0,function*(){var t,s,n;const[o,i]=r,a="string"==typeof o?o:o instanceof Request?o.url:o.toString(),l=(null==i?void 0:i.method)||"GET",c=Date.now();try{const o=yield e(...r),i=o.clone(),h=Date.now()-c;if(this.shouldIgnoreUrl(a))return o;if((null===(t=this.config.networkRequestOptions)||void 0===t?void 0:t.captureFailedOnly)&&o.ok)return o;const u={url:a,method:l,status:o.status,duration:h,size:yield this.getResponseSize(i),type:"fetch",timestamp:(new Date).toISOString(),failed:!o.ok};if((null===(s=this.config.networkRequestOptions)||void 0===s?void 0:s.captureHeaders)&&(u.headers=this.headersToObject(o.headers)),(null===(n=this.config.networkRequestOptions)||void 0===n?void 0:n.captureBody)&&!o.ok)try{const e=yield i.text();u.body=e.substring(0,1e4)}catch(e){}return this.config.debug&&console.log("[DevSkin] Network request tracked:",u),this.transport.sendNetworkRequest(u),o}catch(e){const t=Date.now()-c;if(!this.shouldIgnoreUrl(a)){const e={url:a,method:l,duration:t,type:"fetch",timestamp:(new Date).toISOString(),failed:!0};this.config.debug&&console.log("[DevSkin] Network request failed:",e),this.transport.sendNetworkRequest(e)}throw e}})}interceptXHR(){const e=XMLHttpRequest.prototype.open,t=XMLHttpRequest.prototype.send;XMLHttpRequest.prototype.open=function(t,r,s,n,o){return this.__devskin={method:t,url:r.toString(),startTime:Date.now()},void 0!==n?e.call(this,t,r,null==s||s,n,null!=o?o:void 0):void 0!==s?e.call(this,t,r,s):e.call(this,t,r,!0)},XMLHttpRequest.prototype.send=function(e){const r=this,s=r.__devskin;if(!s)return t.call(this,e);const n=window.__devskinNetworkCollector,o=()=>{const e=Date.now()-s.startTime;if(!(null==n?void 0:n.shouldIgnoreUrl(s.url))){const t={url:s.url,method:s.method,duration:e,type:"xhr",timestamp:(new Date).toISOString(),failed:!0};(null==n?void 0:n.config.debug)&&console.log("[DevSkin] XHR request failed:",t),null==n||n.transport.sendNetworkRequest(t)}};return r.addEventListener("load",()=>{var e,t,o,i;const a=Date.now()-s.startTime;if(null==n?void 0:n.shouldIgnoreUrl(s.url))return;if((null===(e=null==n?void 0:n.config.networkRequestOptions)||void 0===e?void 0:e.captureFailedOnly)&&r.status>=200&&r.status<400)return;const l={url:s.url,method:s.method,status:r.status,duration:a,type:"xhr",timestamp:(new Date).toISOString(),failed:0===r.status||r.status>=400};if((null===(t=null==n?void 0:n.config.networkRequestOptions)||void 0===t?void 0:t.captureHeaders)&&(l.headers=n.parseResponseHeaders(r.getAllResponseHeaders())),(null===(o=null==n?void 0:n.config.networkRequestOptions)||void 0===o?void 0:o.captureBody)&&l.failed)try{l.body=null===(i=r.responseText)||void 0===i?void 0:i.substring(0,1e4)}catch(e){}(null==n?void 0:n.config.debug)&&console.log("[DevSkin] XHR request tracked:",l),null==n||n.transport.sendNetworkRequest(l)}),r.addEventListener("error",o),r.addEventListener("abort",o),t.call(this,e)},window.__devskinNetworkCollector=this}shouldIgnoreUrl(e){var t;if(e.includes(this.config.apiUrl||""))return!0;const r=(null===(t=this.config.networkRequestOptions)||void 0===t?void 0:t.ignoreUrls)||[];for(const t of r)if(t.test(e))return!0;return!1}getResponseSize(e){return t(this,void 0,void 0,function*(){try{return(yield e.blob()).size}catch(e){return}})}headersToObject(e){const t={};return e.forEach((e,r)=>{t[r]=e}),t}parseResponseHeaders(e){const t={};if(!e)return t;return e.trim().split(/[\r\n]+/).forEach(e=>{const r=e.split(": "),s=r.shift(),n=r.join(": ");s&&(t[s]=n)}),t}}class V{constructor(e,t){this.config=e,this.transport=t,this.clickData=[],this.scrollData=[],this.mouseMoveData=[],this.maxScrollDepth=0,this.flushInterval=null,this.mouseMoveSampling=.1}start(){var e;(null===(e=this.config.heatmapOptions)||void 0===e?void 0:e.enabled)&&(this.config.debug&&console.log("[DevSkin] Starting heatmap collection"),!1!==this.config.heatmapOptions.trackClicks&&this.trackClicks(),!1!==this.config.heatmapOptions.trackScroll&&this.trackScrollDepth(),this.config.heatmapOptions.trackMouseMovement&&(this.mouseMoveSampling=this.config.heatmapOptions.mouseMoveSampling||.1,this.trackMouseMovement()),this.flushInterval=setInterval(()=>{this.flush()},1e4),window.addEventListener("beforeunload",()=>{this.flush()}))}stop(){this.flushInterval&&(clearInterval(this.flushInterval),this.flushInterval=null),this.flush()}trackClicks(){document.addEventListener("click",e=>{const t=e.target,r=t.getBoundingClientRect(),s=e.clientX-r.left,n=e.clientY-r.top,o=e.clientX+window.scrollX,i=e.clientY+window.scrollY,a={x:e.clientX,y:e.clientY,relativeX:s,relativeY:n,pageX:o,pageY:i,element:this.getElementSelector(t),elementId:t.id||void 0,elementClass:t.className||void 0,pageUrl:window.location.href,timestamp:(new Date).toISOString(),viewportWidth:window.innerWidth,viewportHeight:window.innerHeight};this.clickData.push(a),this.config.debug&&console.log("[DevSkin] Click tracked:",a),this.clickData.length>=50&&this.flush()},!0)}trackScrollDepth(){const e=()=>{const e=window.innerHeight,t=document.documentElement.scrollHeight,r=window.scrollY||document.documentElement.scrollTop,s=Math.round((r+e)/t*100);if(s>this.maxScrollDepth){this.maxScrollDepth=s;const r={depth:s,maxDepth:this.maxScrollDepth,pageHeight:t,viewportHeight:e,pageUrl:window.location.href,timestamp:(new Date).toISOString()};this.scrollData.push(r),this.config.debug&&console.log("[DevSkin] Scroll depth:",s+"%")}};let t=null;window.addEventListener("scroll",()=>{t&&clearTimeout(t),t=setTimeout(e,100)}),e()}trackMouseMovement(){let e=null;window.addEventListener("mousemove",t=>{if(Math.random()>this.mouseMoveSampling)return;if(e)return;e=setTimeout(()=>{e=null},100);const r={x:t.clientX+window.scrollX,y:t.clientY+window.scrollY,pageUrl:window.location.href,timestamp:(new Date).toISOString()};this.mouseMoveData.push(r),this.mouseMoveData.length>=100&&this.flush()})}flush(){this.clickData.length>0&&(this.transport.sendHeatmapData({type:"clicks",data:this.clickData}),this.clickData=[]),this.scrollData.length>0&&(this.transport.sendHeatmapData({type:"scroll",data:this.scrollData}),this.scrollData=[]),this.mouseMoveData.length>0&&(this.transport.sendHeatmapData({type:"mousemove",data:this.mouseMoveData}),this.mouseMoveData=[])}getElementSelector(e){if(e.id)return`#${e.id}`;if(e.className){const t=e.className.split(" ").filter(e=>e);if(t.length>0)return`${e.tagName.toLowerCase()}.${t.join(".")}`}return e.tagName.toLowerCase()}}var G,Y=Object.defineProperty,Z=(e,t,r)=>((e,t,r)=>t in e?Y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),H=Object.defineProperty,X=(e,t,r)=>((e,t,r)=>t in e?H(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r),J=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(J||{});const $={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},K={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},q={};function Q(e){if(q[e])return q[e];const t=globalThis[e],r=t.prototype,s=e in $?$[e]:void 0,n=Boolean(s&&s.every(e=>{var t,s;return Boolean(null==(s=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:s.toString().includes("[native code]"))})),o=e in K?K[e]:void 0,i=Boolean(o&&o.every(e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))}));if(n&&i&&!globalThis.Zone)return q[e]=t.prototype,t.prototype;try{const s=document.createElement("iframe");document.body.appendChild(s);const n=s.contentWindow;if(!n)return t.prototype;const o=n[e].prototype;return document.body.removeChild(s),o?q[e]=o:r}catch{return r}}const ee={};function te(e,t,r){var s;const n=`${e}.${String(r)}`;if(ee[n])return ee[n].call(t);const o=Q(e),i=null==(s=Object.getOwnPropertyDescriptor(o,r))?void 0:s.get;return i?(ee[n]=i,i.call(t)):t[r]}const re={};function se(e,t,r){const s=`${e}.${String(r)}`;if(re[s])return re[s].bind(t);const n=Q(e)[r];return"function"!=typeof n?t[r]:(re[s]=n,n.bind(t))}const ne={childNodes:function(e){return te("Node",e,"childNodes")},parentNode:function(e){return te("Node",e,"parentNode")},parentElement:function(e){return te("Node",e,"parentElement")},textContent:function(e){return te("Node",e,"textContent")},contains:function(e,t){return se("Node",e,"contains")(t)},getRootNode:function(e){return se("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?te("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?te("Element",e,"shadowRoot"):null},querySelector:function(e,t){return te("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return te("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return Q("MutationObserver").constructor}};function oe(e){return e.nodeType===e.ELEMENT_NODE}function ie(e){const t=e&&"host"in e&&"mode"in e&&ne.host(e)||null;return Boolean(t&&"shadowRoot"in t&&ne.shadowRoot(t)===e)}function ae(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function le(e){try{const r=e.rules||e.cssRules;if(!r)return null;let s=e.href;!s&&e.ownerNode&&e.ownerNode.ownerDocument&&(s=e.ownerNode.ownerDocument.location.href);const n=Array.from(r,e=>ce(e,s)).join("");return(t=n).includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}catch(e){return null}var t}function ce(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=le(e.styleSheet)||function(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const r=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?r.push("layer"):e.layerName&&r.push(`layer(${e.layerName})`),e.supportsText&&r.push(`supports(${e.supportsText})`),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}(e)}catch(r){t=e.cssText}return e.styleSheet.href?be(t,e.styleSheet.href):t}{let r=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(r=function(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}(r)),t?be(r,t):r}}class he{constructor(){X(this,"idNodeMap",new Map),X(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;return(null==(t=this.getMeta(e))?void 0:t.id)??-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){const r=this.getNode(e);if(r){const e=this.nodeMetaMap.get(r);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function ue({element:e,maskInputOptions:t,tagName:r,type:s,value:n,maskInputFn:o}){let i=n||"";const a=s&&de(s);return(t[r.toLowerCase()]||a&&t[a])&&(i=o?o(i,e):"*".repeat(i.length)),i}function de(e){return e.toLowerCase()}const pe="__rrweb_original__";function fe(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?de(t):null}function me(e,t){let r;try{r=new URL(e,t??window.location.href)}catch(e){return null}const s=r.pathname.match(/\.([0-9a-z]+)(?:$)/i);return(null==s?void 0:s[1])??null}const ge=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,ye=/^(?:[a-z+]+:)?\/\//i,we=/^www\..*/i,ve=/^(data:)([^,]*),(.*)/i;function be(e,t){return(e||"").replace(ge,(e,r,s,n,o,i)=>{const a=s||o||i,l=r||n||"";if(!a)return e;if(ye.test(a)||we.test(a))return`url(${l}${a}${l})`;if(ve.test(a))return`url(${l}${a}${l})`;if("/"===a[0])return`url(${l}${function(e){let t="";return t=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0],t=t.split("?")[0],t}(t)+a}${l})`;const c=t.split("/"),h=a.split("/");c.pop();for(const e of h)"."!==e&&(".."===e?c.pop():c.push(e));return`url(${l}${c.join("/")}${l})`})}function Se(e){return e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"")}function Ce(e,t){return function(e,t){const r=Array.from(t.childNodes),s=[];if(r.length>1&&e&&"string"==typeof e){const t=Se(e);for(let n=1;n<r.length;n++)if(r[n].textContent&&"string"==typeof r[n].textContent){const o=Se(r[n].textContent);for(let r=3;r<o.length;r++){const n=o.substring(0,r);if(2===t.split(n).length){const r=t.indexOf(n);for(let t=r;t<e.length;t++)if(Se(e.substring(0,t)).length===r){s.push(e.substring(0,t)),e=e.substring(t);break}break}}}}return s.push(e),s}(e,t).join("/* rr_split */")}let ke=1;const Ie=new RegExp("[^a-z0-9-_:]");function xe(){return ke++}let Oe,Me;const Ee=/^[^ \t\n\r\u000c]+/,Re=/^[, \t\n\r\u000c]+/;const Ae=new WeakMap;function Te(e,t){return t&&""!==t.trim()?Ne(e,t):t}function De(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function Ne(e,t){let r=Ae.get(e);if(r||(r=e.createElement("a"),Ae.set(e,r)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return r.setAttribute("href",t),r.href}function Le(e,t,r,s){return s?"src"===r||"href"===r&&("use"!==t||"#"!==s[0])||"xlink:href"===r&&"#"!==s[0]?Te(e,s):"background"!==r||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===r?function(e,t){if(""===t.trim())return t;let r=0;function s(e){let s;const n=e.exec(t.substring(r));return n?(s=n[0],r+=s.length,s):""}const n=[];for(;s(Re),!(r>=t.length);){let o=s(Ee);if(","===o.slice(-1))o=Te(e,o.substring(0,o.length-1)),n.push(o);else{let s="";o=Te(e,o);let i=!1;for(;;){const e=t.charAt(r);if(""===e){n.push((o+s).trim());break}if(i)")"===e&&(i=!1);else{if(","===e){r+=1,n.push((o+s).trim());break}"("===e&&(i=!0)}s+=e,r+=1}}}return n.join(", ")}(e,s):"style"===r?be(s,Ne(e)):"object"===t&&"data"===r?Te(e,s):s:Te(e,s):s}function Fe(e,t,r){return("video"===e||"audio"===e)&&"autoplay"===t}function Pe(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!r&&Pe(ne.parentNode(e),t,r);for(let r=e.classList.length;r--;){const s=e.classList[r];if(t.test(s))return!0}return!!r&&Pe(ne.parentNode(e),t,r)}function Be(e,t,r,s){let n;if(oe(e)){if(n=e,!ne.childNodes(n).length)return!1}else{if(null===ne.parentElement(e))return!1;n=ne.parentElement(e)}try{if("string"==typeof t){if(s){if(n.closest(`.${t}`))return!0}else if(n.classList.contains(t))return!0}else if(Pe(n,t,s))return!0;if(r)if(s){if(n.closest(r))return!0}else if(n.matches(r))return!0}catch(e){}return!1}function _e(e,t){const{doc:r,mirror:s,blockClass:n,blockSelector:o,needsMask:i,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:c,maskInputFn:h,dataURLOptions:u={},inlineImages:d,recordCanvas:p,keepIframeSrcFn:f,newlyAddedElement:m=!1,cssCaptured:g=!1}=t,y=function(e,t){if(!t.hasNode(e))return;const r=t.getId(e);return 1===r?void 0:r}(r,s);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:J.Document,childNodes:[],compatMode:e.compatMode}:{type:J.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:J.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:y};case e.ELEMENT_NODE:return function(e,t){const{doc:r,blockClass:s,blockSelector:n,inlineStylesheet:o,maskInputOptions:i={},maskInputFn:a,dataURLOptions:l={},inlineImages:c,recordCanvas:h,keepIframeSrcFn:u,newlyAddedElement:d=!1,rootId:p}=t,f=function(e,t,r){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let r=e.classList.length;r--;){const s=e.classList[r];if(t.test(s))return!0}if(r)return e.matches(r)}catch(e){}return!1}(e,s,n),m=function(e){if(e instanceof HTMLFormElement)return"form";const t=de(e.tagName);return Ie.test(t)?"div":t}(e);let g={};const y=e.attributes.length;for(let t=0;t<y;t++){const s=e.attributes[t];Fe(m,s.name,s.value)||(g[s.name]=Le(r,m,de(s.name),s.value))}if("link"===m&&o){const t=Array.from(r.styleSheets).find(t=>t.href===e.href);let s=null;t&&(s=le(t)),s&&(delete g.rel,delete g.href,g._cssText=s)}if("style"===m&&e.sheet){let t=le(e.sheet);t&&(e.childNodes.length>1&&(t=Ce(t,e)),g._cssText=t)}if("input"===m||"textarea"===m||"select"===m){const t=e.value,r=e.checked;"radio"!==g.type&&"checkbox"!==g.type&&"submit"!==g.type&&"button"!==g.type&&t?g.value=ue({element:e,type:fe(e),tagName:m,value:t,maskInputOptions:i,maskInputFn:a}):r&&(g.checked=r)}"option"===m&&(e.selected&&!i.select?g.selected=!0:delete g.selected);"dialog"===m&&e.open&&(g.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal");if("canvas"===m&&h)if("2d"===e.__context)(function(e){const t=e.getContext("2d");if(!t)return!0;for(let r=0;r<e.width;r+=50)for(let s=0;s<e.height;s+=50){const n=t.getImageData,o=pe in n?n[pe]:n;if(new Uint32Array(o.call(t,r,s,Math.min(50,e.width-r),Math.min(50,e.height-s)).data.buffer).some(e=>0!==e))return!1}return!0})(e)||(g.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!("__context"in e)){const t=e.toDataURL(l.type,l.quality),s=r.createElement("canvas");s.width=e.width,s.height=e.height;t!==s.toDataURL(l.type,l.quality)&&(g.rr_dataURL=t)}if("img"===m&&c){Oe||(Oe=r.createElement("canvas"),Me=Oe.getContext("2d"));const t=e,s=t.currentSrc||t.getAttribute("src")||"<unknown-src>",n=t.crossOrigin,o=()=>{t.removeEventListener("load",o);try{Oe.width=t.naturalWidth,Oe.height=t.naturalHeight,Me.drawImage(t,0,0),g.rr_dataURL=Oe.toDataURL(l.type,l.quality)}catch(e){if("anonymous"!==t.crossOrigin)return t.crossOrigin="anonymous",void(t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o));console.warn(`Cannot inline img src=${s}! Error: ${e}`)}"anonymous"===t.crossOrigin&&(n?g.crossOrigin=n:t.removeAttribute("crossorigin"))};t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o)}if("audio"===m||"video"===m){const t=g;t.rr_mediaState=e.paused?"paused":"played",t.rr_mediaCurrentTime=e.currentTime,t.rr_mediaPlaybackRate=e.playbackRate,t.rr_mediaMuted=e.muted,t.rr_mediaLoop=e.loop,t.rr_mediaVolume=e.volume}d||(e.scrollLeft&&(g.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(g.rr_scrollTop=e.scrollTop));if(f){const{width:t,height:r}=e.getBoundingClientRect();g={class:g.class,rr_width:`${t}px`,rr_height:`${r}px`}}"iframe"!==m||u(g.src)||(e.contentDocument||(g.rr_src=g.src),delete g.src);let w;try{customElements.get(m)&&(w=!0)}catch(e){}return{type:J.Element,tagName:m,attributes:g,childNodes:[],isSVG:De(e)||void 0,needBlock:f,rootId:p,isCustom:w}}(e,{doc:r,blockClass:n,blockSelector:o,inlineStylesheet:a,maskInputOptions:l,maskInputFn:h,dataURLOptions:u,inlineImages:d,recordCanvas:p,keepIframeSrcFn:f,newlyAddedElement:m,rootId:y});case e.TEXT_NODE:return function(e,t){const{needsMask:r,maskTextFn:s,rootId:n,cssCaptured:o}=t,i=ne.parentNode(e),a=i&&i.tagName;let l="";const c="STYLE"===a||void 0,h="SCRIPT"===a||void 0;h?l="SCRIPT_PLACEHOLDER":o||(l=ne.textContent(e),c&&l&&(l=be(l,Ne(t.doc))));!c&&!h&&l&&r&&(l=s?s(l,ne.parentElement(e)):l.replace(/[\S]/g,"*"));return{type:J.Text,textContent:l||"",rootId:n}}(e,{doc:r,needsMask:i,maskTextFn:c,rootId:y,cssCaptured:g});case e.CDATA_SECTION_NODE:return{type:J.CDATA,textContent:"",rootId:y};case e.COMMENT_NODE:return{type:J.Comment,textContent:ne.textContent(e)||"",rootId:y};default:return!1}}function Ue(e){return null==e?"":e.toLowerCase()}function We(e,t){const{doc:r,mirror:s,blockClass:n,blockSelector:o,maskTextClass:i,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:c=!0,maskInputOptions:h={},maskTextFn:u,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f={},inlineImages:m=!1,recordCanvas:g=!1,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:v=5e3,onStylesheetLoad:b,stylesheetLoadTimeout:S=5e3,keepIframeSrcFn:C=()=>!1,newlyAddedElement:k=!1,cssCaptured:I=!1}=t;let{needsMask:x}=t,{preserveWhiteSpace:O=!0}=t;if(!x){x=Be(e,i,a,void 0===x)}const M=_e(e,{doc:r,mirror:s,blockClass:n,blockSelector:o,needsMask:x,inlineStylesheet:c,maskInputOptions:h,maskTextFn:u,maskInputFn:d,dataURLOptions:f,inlineImages:m,recordCanvas:g,keepIframeSrcFn:C,newlyAddedElement:k,cssCaptured:I});if(!M)return console.warn(e,"not serialized"),null;let E;E=s.hasNode(e)?s.getId(e):function(e,t){if(t.comment&&e.type===J.Comment)return!0;if(e.type===J.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel||"modulepreload"===e.attributes.rel)&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===me(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Ue(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Ue(e.attributes.name)||"icon"===Ue(e.attributes.rel)||"apple-touch-icon"===Ue(e.attributes.rel)||"shortcut icon"===Ue(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Ue(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Ue(e.attributes.property).match(/^(og|twitter|fb):/)||Ue(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Ue(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Ue(e.attributes.name)||"googlebot"===Ue(e.attributes.name)||"bingbot"===Ue(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Ue(e.attributes.name)||"generator"===Ue(e.attributes.name)||"framework"===Ue(e.attributes.name)||"publisher"===Ue(e.attributes.name)||"progid"===Ue(e.attributes.name)||Ue(e.attributes.property).match(/^article:/)||Ue(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Ue(e.attributes.name)||"yandex-verification"===Ue(e.attributes.name)||"csrf-token"===Ue(e.attributes.name)||"p:domain_verify"===Ue(e.attributes.name)||"verify-v1"===Ue(e.attributes.name)||"verification"===Ue(e.attributes.name)||"shopify-checkout-api-token"===Ue(e.attributes.name)))return!0}}return!1}(M,p)||!O&&M.type===J.Text&&!M.textContent.replace(/^\s+|\s+$/gm,"").length?-2:xe();const R=Object.assign(M,{id:E});if(s.add(e,R),-2===E)return null;y&&y(e);let A=!l;if(R.type===J.Element){A=A&&!R.needBlock,delete R.needBlock;const t=ne.shadowRoot(e);t&&ae(t)&&(R.isShadowHost=!0)}if((R.type===J.Document||R.type===J.Element)&&A){p.headWhitespace&&R.type===J.Element&&"head"===R.tagName&&(O=!1);const t={doc:r,mirror:s,blockClass:n,blockSelector:o,needsMask:x,maskTextClass:i,maskTextSelector:a,skipChild:l,inlineStylesheet:c,maskInputOptions:h,maskTextFn:u,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:O,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:v,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:C,cssCaptured:!1};if(R.type===J.Element&&"textarea"===R.tagName&&void 0!==R.attributes.value);else{R.type===J.Element&&void 0!==R.attributes._cssText&&"string"==typeof R.attributes._cssText&&(t.cssCaptured=!0);for(const r of Array.from(ne.childNodes(e))){const e=We(r,t);e&&R.childNodes.push(e)}}let k=null;if(oe(e)&&(k=ne.shadowRoot(e)))for(const e of Array.from(ne.childNodes(k))){const r=We(e,t);r&&(ae(k)&&(r.isShadow=!0),R.childNodes.push(r))}}const T=ne.parentNode(e);return T&&ie(T)&&ae(T)&&(R.isShadow=!0),R.type===J.Element&&"iframe"===R.tagName&&function(e,t,r){const s=e.contentWindow;if(!s)return;let n,o=!1;try{n=s.document.readyState}catch(e){return}if("complete"!==n){const s=setTimeout(()=>{o||(t(),o=!0)},r);return void e.addEventListener("load",()=>{clearTimeout(s),o=!0,t()})}const i="about:blank";if(s.location.href!==i||e.src===i||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(e,()=>{const t=e.contentDocument;if(t&&w){const r=We(t,{doc:t,mirror:s,blockClass:n,blockSelector:o,needsMask:x,maskTextClass:i,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:h,maskTextFn:u,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:O,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:v,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:C});r&&w(e,r)}},v),R.type===J.Element&&"link"===R.tagName&&"string"==typeof R.attributes.rel&&("stylesheet"===R.attributes.rel||"preload"===R.attributes.rel&&"string"==typeof R.attributes.href&&"css"===me(R.attributes.href))&&function(e,t,r){let s,n=!1;try{s=e.sheet}catch(e){return}if(s)return;const o=setTimeout(()=>{n||(t(),n=!0)},r);e.addEventListener("load",()=>{clearTimeout(o),n=!0,t()})}(e,()=>{if(b){const t=We(e,{doc:r,mirror:s,blockClass:n,blockSelector:o,needsMask:x,maskTextClass:i,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:h,maskTextFn:u,maskInputFn:d,slimDOMOptions:p,dataURLOptions:f,inlineImages:m,recordCanvas:g,preserveWhiteSpace:O,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:v,onStylesheetLoad:b,stylesheetLoadTimeout:S,keepIframeSrcFn:C});t&&b(e,t)}},S),R}function ze(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function je(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var s=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,s.get?s:{enumerable:!0,get:function(){return e[t]}})}),r}var Ve={exports:{}},Ge=String,Ye=function(){return{isColorSupported:!1,reset:Ge,bold:Ge,dim:Ge,italic:Ge,underline:Ge,inverse:Ge,hidden:Ge,strikethrough:Ge,black:Ge,red:Ge,green:Ge,yellow:Ge,blue:Ge,magenta:Ge,cyan:Ge,white:Ge,gray:Ge,bgBlack:Ge,bgRed:Ge,bgGreen:Ge,bgYellow:Ge,bgBlue:Ge,bgMagenta:Ge,bgCyan:Ge,bgWhite:Ge}};Ve.exports=Ye(),Ve.exports.createColors=Ye;var Ze=Ve.exports;const He=je(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Xe=Ze,Je=He,$e=class e extends Error{constructor(t,r,s,n,o,i){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),n&&(this.source=n),i&&(this.plugin=i),void 0!==r&&void 0!==s&&("number"==typeof r?(this.line=r,this.column=s):(this.line=r.line,this.column=r.column,this.endLine=s.line,this.endColumn=s.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=Xe.isColorSupported),Je&&e&&(t=Je(t));let r,s,n=t.split(/\r?\n/),o=Math.max(this.line-3,0),i=Math.min(this.line+2,n.length),a=String(i).length;if(e){let{bold:e,gray:t,red:n}=Xe.createColors(!0);r=t=>e(n(t)),s=e=>t(e)}else r=s=e=>e;return n.slice(o,i).map((e,t)=>{let n=o+1+t,i=" "+(" "+n).slice(-a)+" | ";if(n===this.line){let t=s(i.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+s(i)+e+"\n "+t+r("^")}return" "+s(i)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var Ke=$e;$e.default=$e;var qe={};qe.isClean=Symbol("isClean"),qe.my=Symbol("my");const Qe={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let et=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,s=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?r+=e.raws.afterName:s&&(r+=" "),e.nodes)this.block(e,r+s);else{let n=(e.raws.between||"")+(t?";":"");this.builder(r+s+n,e)}}beforeAfter(e,t){let r;r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let s=e.parent,n=0;for(;s&&"root"!==s.type;)n+=1,s=s.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<n;e++)r+=t}return r}block(e,t){let r,s=this.raw(e,"between","beforeOpen");this.builder(t+s+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let s=0;s<e.nodes.length;s++){let n=e.nodes[s],o=this.raw(n,"before");o&&this.builder(o),this.stringify(n,t!==s||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),s=e.prop+r+this.rawValue(e,"value");e.important&&(s+=e.raws.important||" !important"),t&&(s+=";"),this.builder(s,e)}document(e){this.body(e)}raw(e,t,r){let s;if(r||(r=t),t&&(s=e.raws[t],void 0!==s))return s;let n=e.parent;if("before"===r){if(!n||"root"===n.type&&n.first===e)return"";if(n&&"document"===n.type)return""}if(!n)return Qe[r];let o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[r])return o.rawCache[r];if("before"===r||"after"===r)return this.beforeAfter(e,r);{let n="raw"+((i=r)[0].toUpperCase()+i.slice(1));this[n]?s=this[n](o,e):o.walk(e=>{if(s=e.raws[t],void 0!==s)return!1})}var i;return void 0===s&&(s=Qe[r]),o.rawCache[r]=s,s}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&void 0!==r.raws.before)return t=r.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(r=>{let s=r.parent;if(s&&s!==e&&s.parent&&s.parent===e&&void 0!==r.raws.before){let e=r.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let r=e[t],s=e.raws[t];return s&&s.value===r?s.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};var tt=et;et.default=et;let rt=tt;function st(e,t){new rt(t).stringify(e)}var nt=st;st.default=st;let{isClean:ot,my:it}=qe,at=Ke,lt=tt,ct=nt;function ht(e,t){let r=new e.constructor;for(let s in e){if(!Object.prototype.hasOwnProperty.call(e,s))continue;if("proxyCache"===s)continue;let n=e[s],o=typeof n;"parent"===s&&"object"===o?t&&(r[s]=t):"source"===s?r[s]=n:Array.isArray(n)?r[s]=n.map(e=>ht(e,r)):("object"===o&&null!==n&&(n=ht(n)),r[s]=n)}return r}let ut=class{constructor(e={}){this.raws={},this[ot]=!1,this[it]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=ht(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:s}=this.rangeBy(t);return this.source.input.error(e,{column:s.column,line:s.line},{column:r.column,line:r.line},t)}return new at(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[ot]){this[ot]=!1;let e=this;for(;e=e.parent;)e[ot]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let s=(t=this.toString()).indexOf(e.word);-1!==s&&(r=this.positionInside(s,t))}return r}positionInside(e,t){let r=t||this.toString(),s=this.source.start.column,n=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(s=1,n+=1):s+=1;return{column:s,line:n}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let s=this.toString(),n=s.indexOf(e.word);-1!==n&&(t=this.positionInside(n,s),r=this.positionInside(n+e.word.length,s))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new lt).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let s of e)s===this?r=!0:r?(this.parent.insertAfter(t,s),t=s):this.parent.insertBefore(t,s);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},s=null==t;t=t||new Map;let n=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let s=this[e];if(Array.isArray(s))r[e]=s.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof s&&s.toJSON)r[e]=s.toJSON(null,t);else if("source"===e){let o=t.get(s.input);null==o&&(o=n,t.set(s.input,n),n++),r[e]={end:s.end,inputId:o,start:s.start}}else r[e]=s}return s&&(r.inputs=[...t.keys()].map(e=>e.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=ct){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let s={node:this};for(let e in r)s[e]=r[e];return e.warn(t,s)}get proxyOf(){return this}};var dt=ut;ut.default=ut;let pt=dt,ft=class extends pt{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var mt=ft;ft.default=ft;var gt={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}};let{SourceMapConsumer:yt,SourceMapGenerator:wt}=He,{existsSync:vt,readFileSync:bt}=He,{dirname:St,join:Ct}=He;let kt=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,s=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=St(this.mapFile)),s&&(this.text=s)}consumer(){return this.consumerCache||(this.consumerCache=new yt(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),s=e.indexOf("*/",r);r>-1&&s>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,s)))}loadFile(e){if(this.root=St(e),vt(e))return this.mapFile=e,bt(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof yt)return wt.fromSourceMap(t).toString();if(t instanceof wt)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw new Error("Unable to load previous source map: "+r.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=Ct(St(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var It=kt;kt.default=kt;let{SourceMapConsumer:xt,SourceMapGenerator:Ot}=He,{fileURLToPath:Mt,pathToFileURL:Et}=He,{isAbsolute:Rt,resolve:At}=He,{nanoid:Tt}=gt,Dt=He,Nt=Ke,Lt=It,Ft=Symbol("fromOffsetCache"),Pt=Boolean(xt&&Ot),Bt=Boolean(At&&Rt),_t=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!Bt||/^\w+:\/\//.test(t.from)||Rt(t.from)?this.file=t.from:this.file=At(t.from)),Bt&&Pt){let e=new Lt(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+Tt(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,s={}){let n,o,i;if(t&&"object"==typeof t){let e=t,s=r;if("number"==typeof e.offset){let s=this.fromOffset(e.offset);t=s.line,r=s.col}else t=e.line,r=e.column;if("number"==typeof s.offset){let e=this.fromOffset(s.offset);o=e.line,i=e.col}else o=s.line,i=s.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,o,i);return n=a?new Nt(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 Nt(e,void 0===o?t:{column:r,line:t},void 0===o?r:{column:i,line:o},this.css,this.file,s.plugin),n.input={column:r,endColumn:i,endLine:o,line:t,source:this.css},this.file&&(Et&&(n.input.url=Et(this.file).toString()),n.input.file=this.file),n}fromOffset(e){let t,r;if(this[Ft])r=this[Ft];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let s=0,n=e.length;s<n;s++)r[s]=t,t+=e[s].length+1;this[Ft]=r}t=r[r.length-1];let s=0;if(e>=t)s=r.length-1;else{let t,n=r.length-2;for(;s<n;)if(t=s+(n-s>>1),e<r[t])n=t-1;else{if(!(e>=r[t+1])){s=t;break}s=t+1}}return{col:e-r[s]+1,line:s+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:At(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,s){if(!this.map)return!1;let n,o,i=this.map.consumer(),a=i.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(n=i.originalPositionFor({column:s,line:r})),o=Rt(a.source)?Et(a.source):new URL(a.source,this.map.consumer().sourceRoot||Et(this.map.mapFile));let l={column:a.column,endColumn:n&&n.column,endLine:n&&n.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!Mt)throw new Error("file: protocol is not available in this PostCSS build");l.file=Mt(o)}let c=i.sourceContentFor(a.source);return c&&(l.source=c),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var Ut=_t;_t.default=_t,Dt&&Dt.registerInput&&Dt.registerInput(_t);let{SourceMapConsumer:Wt,SourceMapGenerator:zt}=He,{dirname:jt,relative:Vt,resolve:Gt,sep:Yt}=He,{pathToFileURL:Zt}=He,Ht=Ut,Xt=Boolean(Wt&&zt),Jt=Boolean(jt&&Gt&&Vt&&Yt);var $t=class{constructor(e,t,r,s){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=s,this.originalCSS=s,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,r=this.toUrl(this.path(e.file)),s=e.root||jt(e.file);!1===this.mapOpts.sourcesContent?(t=new Wt(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,r,this.toUrl(this.path(s)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),Jt&&Xt&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=zt.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new zt({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new zt({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,s=1,n="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(i,a,l)=>{if(this.css+=i,a&&"end"!==l&&(o.generated.line=r,o.generated.column=s-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=n,o.original.line=1,o.original.column=0,this.map.addMapping(o))),e=i.match(/\n/g),e?(r+=e.length,t=i.lastIndexOf("\n"),s=i.length-t):s+=i.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=r,o.generated.column=s-2,this.map.addMapping(o)):(o.source=n,o.original.line=1,o.original.column=0,o.generated.line=r,o.generated.column=s-1,this.map.addMapping(o)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?jt(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=jt(Gt(r,this.mapOpts.annotation)));let s=Vt(r,e);return this.memoizedPaths.set(e,s),s}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new Ht(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let s=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(s,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(Zt){let t=Zt(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===Yt&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let Kt=dt,qt=class extends Kt{constructor(e){super(e),this.type="comment"}};var Qt=qt;qt.default=qt;let er,tr,rr,sr,{isClean:nr,my:or}=qe,ir=mt,ar=Qt,lr=dt;function cr(e){return e.map(e=>(e.nodes&&(e.nodes=cr(e.nodes)),delete e.source,e))}function hr(e){if(e[nr]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)hr(t)}let ur=class e extends lr{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,r,s=this.getIterator();for(;this.indexes[s]<this.proxyOf.nodes.length&&(t=this.indexes[s],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[s]+=1;return delete this.indexes[s],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map(e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e)):"every"===t||"some"===t?r=>e[t]((e,...t)=>r(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r,s=this.index(e),n=this.normalize(t,this.proxyOf.nodes[s]).reverse();s=this.index(e);for(let e of n)this.proxyOf.nodes.splice(s+1,0,e);for(let e in this.indexes)r=this.indexes[e],s<r&&(this.indexes[e]=r+n.length);return this.markDirty(),this}insertBefore(e,t){let r,s=this.index(e),n=0===s&&"prepend",o=this.normalize(t,this.proxyOf.nodes[s],n).reverse();s=this.index(e);for(let e of o)this.proxyOf.nodes.splice(s,0,e);for(let e in this.indexes)r=this.indexes[e],s<=r&&(this.indexes[e]=r+o.length);return this.markDirty(),this}normalize(t,r){if("string"==typeof t)t=cr(er(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new ir(t)]}else if(t.selector)t=[new tr(t)];else if(t.name)t=[new rr(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new ar(t)]}return t.map(t=>(t[or]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[nr]&&hr(t),void 0===t.raws.before&&r&&void 0!==r.raws.before&&(t.raws.before=r.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(s=>{t.props&&!t.props.includes(s.prop)||t.fast&&!s.value.includes(t.fast)||(s.value=s.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let s;try{s=e(t,r)}catch(e){throw t.addToError(e)}return!1!==s&&t.walk&&(s=t.walk(e)),s})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,s)=>{if("atrule"===r.type&&e.test(r.name))return t(r,s)}):this.walk((r,s)=>{if("atrule"===r.type&&r.name===e)return t(r,s)}):(t=e,this.walk((e,r)=>{if("atrule"===e.type)return t(e,r)}))}walkComments(e){return this.walk((t,r)=>{if("comment"===t.type)return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,s)=>{if("decl"===r.type&&e.test(r.prop))return t(r,s)}):this.walk((r,s)=>{if("decl"===r.type&&r.prop===e)return t(r,s)}):(t=e,this.walk((e,r)=>{if("decl"===e.type)return t(e,r)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,s)=>{if("rule"===r.type&&e.test(r.selector))return t(r,s)}):this.walk((r,s)=>{if("rule"===r.type&&r.selector===e)return t(r,s)}):(t=e,this.walk((e,r)=>{if("rule"===e.type)return t(e,r)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};ur.registerParse=e=>{er=e},ur.registerRule=e=>{tr=e},ur.registerAtRule=e=>{rr=e},ur.registerRoot=e=>{sr=e};var dr=ur;ur.default=ur,ur.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,rr.prototype):"rule"===e.type?Object.setPrototypeOf(e,tr.prototype):"decl"===e.type?Object.setPrototypeOf(e,ir.prototype):"comment"===e.type?Object.setPrototypeOf(e,ar.prototype):"root"===e.type&&Object.setPrototypeOf(e,sr.prototype),e[or]=!0,e.nodes&&e.nodes.forEach(e=>{ur.rebuild(e)})};let pr,fr,mr=dr,gr=class extends mr{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new pr(new fr,this,e).stringify()}};gr.registerLazyResult=e=>{pr=e},gr.registerProcessor=e=>{fr=e};var yr=gr;gr.default=gr;let wr={};var vr=function(e){wr[e]||(wr[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let br=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};var Sr=br;br.default=br;let Cr=Sr,kr=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new Cr(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var Ir=kr;kr.default=kr;const xr="'".charCodeAt(0),Or='"'.charCodeAt(0),Mr="\\".charCodeAt(0),Er="/".charCodeAt(0),Rr="\n".charCodeAt(0),Ar=" ".charCodeAt(0),Tr="\f".charCodeAt(0),Dr="\t".charCodeAt(0),Nr="\r".charCodeAt(0),Lr="[".charCodeAt(0),Fr="]".charCodeAt(0),Pr="(".charCodeAt(0),Br=")".charCodeAt(0),_r="{".charCodeAt(0),Ur="}".charCodeAt(0),Wr=";".charCodeAt(0),zr="*".charCodeAt(0),jr=":".charCodeAt(0),Vr="@".charCodeAt(0),Gr=/[\t\n\f\r "#'()/;[\\\]{}]/g,Yr=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Zr=/.[\r\n"'(/\\]/,Hr=/[\da-f]/i;let Xr=dr,Jr=class extends Xr{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};var $r=Jr;Jr.default=Jr,Xr.registerAtRule(Jr);let Kr,qr,Qr=dr,es=class extends Qr{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let s=super.normalize(e);if(t)if("prepend"===r)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of s)e.raws.before=t.raws.before;return s}removeChild(e,t){let r=this.index(e);return!t&&0===r&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new Kr(new qr,this,e).stringify()}};es.registerLazyResult=e=>{Kr=e},es.registerProcessor=e=>{qr=e};var ts=es;es.default=es,Qr.registerRoot(es);let rs={comma:e=>rs.split(e,[","],!0),space:e=>rs.split(e,[" ","\n","\t"]),split(e,t,r){let s=[],n="",o=!1,i=0,a=!1,l="",c=!1;for(let r of e)c?c=!1:"\\"===r?c=!0:a?r===l&&(a=!1):'"'===r||"'"===r?(a=!0,l=r):"("===r?i+=1:")"===r?i>0&&(i-=1):0===i&&t.includes(r)&&(o=!0),o?(""!==n&&s.push(n.trim()),n="",o=!1):n+=r;return(r||""!==n)&&s.push(n.trim()),s}};var ss=rs;rs.default=rs;let ns=dr,os=ss,is=class extends ns{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return os.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}};var as=is;is.default=is,ns.registerRule(is);let ls=mt,cs=function(e,t={}){let r,s,n,o,i,a,l,c,h,u,d=e.css.valueOf(),p=t.ignoreErrors,f=d.length,m=0,g=[],y=[];function w(t){throw e.error("Unclosed "+t,m)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&m>=f},nextToken:function(e){if(y.length)return y.pop();if(m>=f)return;let t=!!e&&e.ignoreUnclosed;switch(r=d.charCodeAt(m),r){case Rr:case Ar:case Dr:case Nr:case Tr:s=m;do{s+=1,r=d.charCodeAt(s)}while(r===Ar||r===Rr||r===Dr||r===Nr||r===Tr);u=["space",d.slice(m,s)],m=s-1;break;case Lr:case Fr:case _r:case Ur:case jr:case Wr:case Br:{let e=String.fromCharCode(r);u=[e,e,m];break}case Pr:if(c=g.length?g.pop()[1]:"",h=d.charCodeAt(m+1),"url"===c&&h!==xr&&h!==Or&&h!==Ar&&h!==Rr&&h!==Dr&&h!==Tr&&h!==Nr){s=m;do{if(a=!1,s=d.indexOf(")",s+1),-1===s){if(p||t){s=m;break}w("bracket")}for(l=s;d.charCodeAt(l-1)===Mr;)l-=1,a=!a}while(a);u=["brackets",d.slice(m,s+1),m,s],m=s}else s=d.indexOf(")",m+1),o=d.slice(m,s+1),-1===s||Zr.test(o)?u=["(","(",m]:(u=["brackets",o,m,s],m=s);break;case xr:case Or:n=r===xr?"'":'"',s=m;do{if(a=!1,s=d.indexOf(n,s+1),-1===s){if(p||t){s=m+1;break}w("string")}for(l=s;d.charCodeAt(l-1)===Mr;)l-=1,a=!a}while(a);u=["string",d.slice(m,s+1),m,s],m=s;break;case Vr:Gr.lastIndex=m+1,Gr.test(d),s=0===Gr.lastIndex?d.length-1:Gr.lastIndex-2,u=["at-word",d.slice(m,s+1),m,s],m=s;break;case Mr:for(s=m,i=!0;d.charCodeAt(s+1)===Mr;)s+=1,i=!i;if(r=d.charCodeAt(s+1),i&&r!==Er&&r!==Ar&&r!==Rr&&r!==Dr&&r!==Nr&&r!==Tr&&(s+=1,Hr.test(d.charAt(s)))){for(;Hr.test(d.charAt(s+1));)s+=1;d.charCodeAt(s+1)===Ar&&(s+=1)}u=["word",d.slice(m,s+1),m,s],m=s;break;default:r===Er&&d.charCodeAt(m+1)===zr?(s=d.indexOf("*/",m+2)+1,0===s&&(p||t?s=d.length:w("comment")),u=["comment",d.slice(m,s+1),m,s],m=s):(Yr.lastIndex=m+1,Yr.test(d),s=0===Yr.lastIndex?d.length-1:Yr.lastIndex-2,u=["word",d.slice(m,s+1),m,s],g.push(u),m=s)}return m++,u},position:function(){return m}}},hs=Qt,us=$r,ds=ts,ps=as;const fs={empty:!0,space:!0};let ms=dr,gs=class{constructor(e){this.input=e,this.root=new ds,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,s,n=new us;n.name=e[1].slice(1),""===n.name&&this.unnamedAtrule(n,e),this.init(n,e[2]);let o=!1,i=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){n.source.end=this.getPosition(e[2]),n.source.end.offset++,this.semicolon=!0;break}if("{"===t){i=!0;break}if("}"===t){if(a.length>0){for(s=a.length-1,r=a[s];r&&"space"===r[0];)r=a[--s];r&&(n.source.end=this.getPosition(r[3]||r[2]),n.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}n.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(n.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(n,"params",a),o&&(e=a[a.length-1],n.source.end=this.getPosition(e[3]||e[2]),n.source.end.offset++,this.spaces=n.raws.between,n.raws.between="")):(n.raws.afterName="",n.params=""),i&&(n.nodes=[],this.current=n)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,s=0;for(let n=t-1;n>=0&&(r=e[n],"space"===r[0]||(s+=1,2!==s));n--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,s,n=0;for(let[o,i]of e.entries()){if(t=i,r=t[0],"("===r&&(n+=1),")"===r&&(n-=1),0===n&&":"===r){if(s){if("word"===s[0]&&"progid"===s[1])continue;return o}this.doubleColon(t)}s=t}return!1}comment(e){let t=new hs;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=cs(this.input)}decl(e,t){let r=new ls;this.init(r,e[0][2]);let s,n=e[e.length-1];for(";"===n[0]&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(n[3]||n[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],s=r[3]||r[2];if(s)return s}}(e)),r.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;r.prop+=e.shift()[1]}for(r.raws.between="";e.length;){if(s=e.shift(),":"===s[0]){r.raws.between+=s[1];break}"word"===s[0]&&/\w/.test(s[1])&&this.unknownWord([s]),r.raws.between+=s[1]}"_"!==r.prop[0]&&"*"!==r.prop[0]||(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let o,i=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)i.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(s=e[t],"!important"===s[1].toLowerCase()){r.important=!0;let s=this.stringFrom(e,t);s=this.spacesFromEnd(e)+s," !important"!==s&&(r.raws.important=s);break}if("important"===s[1].toLowerCase()){let s=e.slice(0),n="";for(let e=t;e>0;e--){let t=s[e][0];if(0===n.trim().indexOf("!")&&"space"!==t)break;n=s.pop()[1]+n}0===n.trim().indexOf("!")&&(r.important=!0,r.raws.important=n,e=s)}if("space"!==s[0]&&"comment"!==s[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(r.raws.between+=i.map(e=>e[1]).join(""),i=[]),this.raw(r,"value",i.concat(e),t),r.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new ps;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,r=null,s=!1,n=null,o=[],i=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)n||(n=l),o.push("("===r?")":"]");else if(i&&s&&"{"===r)n||(n=l),o.push("}");else if(0===o.length){if(";"===r){if(s)return void this.decl(a,i);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(s=!0)}else r===o[o.length-1]&&(o.pop(),0===o.length&&(n=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(n),t&&s){if(!i)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,i)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,s){let n,o,i,a,l=r.length,c="",h=!0;for(let e=0;e<l;e+=1)n=r[e],o=n[0],"space"!==o||e!==l-1||s?"comment"===o?(a=r[e-1]?r[e-1][0]:"empty",i=r[e+1]?r[e+1][0]:"empty",fs[a]||fs[i]||","===c.slice(-1)?h=!1:c+=n[1]):c+=n[1]:h=!1;if(!h){let s=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:s,value:c}}e[t]=c}rule(e){e.pop();let t=new ps;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let s=t;s<e.length;s++)r+=e[s][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}},ys=Ut;function ws(e,t){let r=new ys(e,t),s=new gs(r);try{s.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 s.root}var vs=ws;ws.default=ws,ms.registerParse(ws);let{isClean:bs,my:Ss}=qe,Cs=$t,ks=nt,Is=dr,xs=yr,Os=vr,Ms=Ir,Es=vs,Rs=ts;const As={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Ts={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},Ds={Once:!0,postcssPlugin:!0,prepare:!0};function Ns(e){return"object"==typeof e&&"function"==typeof e.then}function Ls(e){let t=!1,r=As[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,0,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,0,r+"Exit"]:[r,r+"Exit"]}function Fs(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:Ls(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function Ps(e){return e[bs]=!1,e.nodes&&e.nodes.forEach(e=>Ps(e)),e}let Bs={},_s=class e{constructor(t,r,s){let n;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof e||r instanceof Ms)n=Ps(r.root),r.map&&(void 0===s.map&&(s.map={}),s.map.inline||(s.map.inline=!1),s.map.prev=r.map);else{let e=Es;s.syntax&&(e=s.syntax.parse),s.parser&&(e=s.parser),e.parse&&(e=e.parse);try{n=e(r,s)}catch(e){this.processed=!0,this.error=e}n&&!n[Ss]&&Is.rebuild(n)}else n=Ps(r);this.result=new Ms(t,n,s),this.helpers={...Bs,postcss:Bs,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){let e=r.postcssPlugin,t=r.postcssVersion,s=this.result.processor.version,n=t.split("."),o=s.split(".");(n[0]!==o[0]||parseInt(n[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+s+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(let t of this.plugins)if("object"==typeof t)for(let r in t){if(!Ts[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Ds[r])if("object"==typeof t[r])for(let s in t[r])e(t,"*"===s?r:r+"-"+s.toLowerCase(),t[r][s]);else"function"==typeof t[r]&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(Ns(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[bs];){e[bs]=!0;let t=[Fs(e)];for(;t.length>0;){let e=this.visitTick(t);if(Ns(e))try{await e}catch(e){let r=t[t.length-1].node;throw this.handleError(e,r)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>r(e,this.helpers));await Promise.all(t)}else await r(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return Ns(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=ks;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new Cs(t,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){if(Ns(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[bs];)e[bs]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||Os("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,s]of e){let e;this.result.lastPlugin=r;try{e=s(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(Ns(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:s}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(s.length>0&&t.visitorIndex<s.length){let[e,n]=s[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===s.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return n(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){let s,n=t.iterator;for(;s=r.nodes[r.indexes[n]];)if(r.indexes[n]+=1,!s[bs])return s[bs]=!0,void e.push(Fs(s));t.iterator=0,delete r.indexes[n]}let n=t.events;for(;t.eventIndex<n.length;){let e=n[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[bs]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[bs]=!0;let t=Ls(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[bs]||this.walkSync(e)});else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};_s.registerPostcss=e=>{Bs=e};var Us=_s;_s.default=_s,Rs.registerLazyResult(_s),xs.registerLazyResult(_s);let Ws=$t,zs=nt,js=vr,Vs=vs;const Gs=Ir;let Ys=class{constructor(e,t,r){let s;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let n=zs;this.result=new Gs(this._processor,s,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let i=new Ws(n,s,this._opts,t);if(i.isMap()){let[e,t]=i.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else i.clearAnnotation(),this.result.css=i.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||js("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=Vs;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var Zs=Ys;Ys.default=Ys;let Hs=Zs,Xs=Us,Js=yr,$s=ts,Ks=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new Xs(this,e,t):new Hs(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var qs=Ks;Ks.default=Ks,$s.registerProcessor(Ks),Js.registerProcessor(Ks);let Qs=mt,en=It,tn=Qt,rn=$r,sn=Ut,nn=ts,on=as;function an(e,t){if(Array.isArray(e))return e.map(e=>an(e));let{inputs:r,...s}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:sn.prototype};r.map&&(r.map={...r.map,__proto__:en.prototype}),t.push(r)}}if(s.nodes&&(s.nodes=e.nodes.map(e=>an(e,t))),s.source){let{inputId:e,...r}=s.source;s.source=r,null!=e&&(s.source.input=t[e])}if("root"===s.type)return new nn(s);if("decl"===s.type)return new Qs(s);if("rule"===s.type)return new on(s);if("comment"===s.type)return new tn(s);if("atrule"===s.type)return new rn(s);throw new Error("Unknown node type: "+e.type)}var ln=an;an.default=an;let cn=Ke,hn=mt,un=Us,dn=dr,pn=qs,fn=nt,mn=ln,gn=yr,yn=Sr,wn=Qt,vn=$r,bn=Ir,Sn=Ut,Cn=vs,kn=ss,In=as,xn=ts,On=dt;function Mn(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new pn(e)}Mn.plugin=function(e,t){let r,s=!1;function n(...r){console&&console.warn&&!s&&(s=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let n=t(...r);return n.postcssPlugin=e,n.postcssVersion=(new pn).version,n}return Object.defineProperty(n,"postcss",{get:()=>(r||(r=n()),r)}),n.process=function(e,t,r){return Mn([n(r)]).process(e,t)},n},Mn.stringify=fn,Mn.parse=Cn,Mn.fromJSON=mn,Mn.list=kn,Mn.comment=e=>new wn(e),Mn.atRule=e=>new vn(e),Mn.decl=e=>new hn(e),Mn.rule=e=>new In(e),Mn.root=e=>new xn(e),Mn.document=e=>new gn(e),Mn.CssSyntaxError=cn,Mn.Declaration=hn,Mn.Container=dn,Mn.Processor=pn,Mn.Document=gn,Mn.Comment=wn,Mn.Warning=yn,Mn.AtRule=vn,Mn.Result=bn,Mn.Input=Sn,Mn.Rule=In,Mn.Root=xn,Mn.Node=On,un.registerPostcss(Mn);var En=Mn;Mn.default=Mn;const Rn=ze(En);Rn.stringify,Rn.fromJSON,Rn.plugin,Rn.parse,Rn.list,Rn.document,Rn.comment,Rn.atRule,Rn.rule,Rn.decl,Rn.root,Rn.CssSyntaxError,Rn.Declaration,Rn.Container,Rn.Processor,Rn.Document,Rn.Comment,Rn.Warning,Rn.AtRule,Rn.Result,Rn.Input,Rn.Rule,Rn.Root,Rn.Node;var An=Object.defineProperty,Tn=(e,t,r)=>((e,t,r)=>t in e?An(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r)(e,"symbol"!=typeof t?t+"":t,r);function Dn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Nn(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var s=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,s.get?s:{enumerable:!0,get:function(){return e[t]}})}),r}var Ln={exports:{}},Fn=String,Pn=function(){return{isColorSupported:!1,reset:Fn,bold:Fn,dim:Fn,italic:Fn,underline:Fn,inverse:Fn,hidden:Fn,strikethrough:Fn,black:Fn,red:Fn,green:Fn,yellow:Fn,blue:Fn,magenta:Fn,cyan:Fn,white:Fn,gray:Fn,bgBlack:Fn,bgRed:Fn,bgGreen:Fn,bgYellow:Fn,bgBlue:Fn,bgMagenta:Fn,bgCyan:Fn,bgWhite:Fn}};Ln.exports=Pn(),Ln.exports.createColors=Pn;var Bn=Ln.exports;const _n=Nn(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Un=Bn,Wn=_n,zn=class e extends Error{constructor(t,r,s,n,o,i){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),n&&(this.source=n),i&&(this.plugin=i),void 0!==r&&void 0!==s&&("number"==typeof r?(this.line=r,this.column=s):(this.line=r.line,this.column=r.column,this.endLine=s.line,this.endColumn=s.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=Un.isColorSupported),Wn&&e&&(t=Wn(t));let r,s,n=t.split(/\r?\n/),o=Math.max(this.line-3,0),i=Math.min(this.line+2,n.length),a=String(i).length;if(e){let{bold:e,gray:t,red:n}=Un.createColors(!0);r=t=>e(n(t)),s=e=>t(e)}else r=s=e=>e;return n.slice(o,i).map((e,t)=>{let n=o+1+t,i=" "+(" "+n).slice(-a)+" | ";if(n===this.line){let t=s(i.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return r(">")+s(i)+e+"\n "+t+r("^")}return" "+s(i)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var jn=zn;zn.default=zn;var Vn={};Vn.isClean=Symbol("isClean"),Vn.my=Symbol("my");const Gn={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let Yn=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,s=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?r+=e.raws.afterName:s&&(r+=" "),e.nodes)this.block(e,r+s);else{let n=(e.raws.between||"")+(t?";":"");this.builder(r+s+n,e)}}beforeAfter(e,t){let r;r="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let s=e.parent,n=0;for(;s&&"root"!==s.type;)n+=1,s=s.parent;if(r.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<n;e++)r+=t}return r}block(e,t){let r,s=this.raw(e,"between","beforeOpen");this.builder(t+s+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),r=this.raw(e,"after")):r=this.raw(e,"after","emptyBody"),r&&this.builder(r),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let r=this.raw(e,"semicolon");for(let s=0;s<e.nodes.length;s++){let n=e.nodes[s],o=this.raw(n,"before");o&&this.builder(o),this.stringify(n,t!==s||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),s=e.prop+r+this.rawValue(e,"value");e.important&&(s+=e.raws.important||" !important"),t&&(s+=";"),this.builder(s,e)}document(e){this.body(e)}raw(e,t,r){let s;if(r||(r=t),t&&(s=e.raws[t],void 0!==s))return s;let n=e.parent;if("before"===r){if(!n||"root"===n.type&&n.first===e)return"";if(n&&"document"===n.type)return""}if(!n)return Gn[r];let o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[r])return o.rawCache[r];if("before"===r||"after"===r)return this.beforeAfter(e,r);{let n="raw"+((i=r)[0].toUpperCase()+i.slice(1));this[n]?s=this[n](o,e):o.walk(e=>{if(s=e.raws[t],void 0!==s)return!1})}var i;return void 0===s&&(s=Gn[r]),o.rawCache[r]=s,s}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls(e=>{if(void 0!==e.raws.before)return r=e.raws.before,r.includes("\n")&&(r=r.replace(/[^\n]+$/,"")),!1}),void 0===r?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&void 0!==r.raws.before)return t=r.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(r=>{let s=r.parent;if(s&&s!==e&&s.parent&&s.parent===e&&void 0!==r.raws.before){let e=r.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let r=e[t],s=e.raws[t];return s&&s.value===r?s.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};var Zn=Yn;Yn.default=Yn;let Hn=Zn;function Xn(e,t){new Hn(t).stringify(e)}var Jn=Xn;Xn.default=Xn;let{isClean:$n,my:Kn}=Vn,qn=jn,Qn=Zn,eo=Jn;function to(e,t){let r=new e.constructor;for(let s in e){if(!Object.prototype.hasOwnProperty.call(e,s))continue;if("proxyCache"===s)continue;let n=e[s],o=typeof n;"parent"===s&&"object"===o?t&&(r[s]=t):"source"===s?r[s]=n:Array.isArray(n)?r[s]=n.map(e=>to(e,r)):("object"===o&&null!==n&&(n=to(n)),r[s]=n)}return r}let ro=class{constructor(e={}){this.raws={},this[$n]=!1,this[Kn]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let r of e[t])"function"==typeof r.clone?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=to(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:s}=this.rangeBy(t);return this.source.input.error(e,{column:s.column,line:s.line},{column:r.column,line:r.line},t)}return new qn(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[$n]){this[$n]=!1;let e=this;for(;e=e.parent;)e[$n]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){let s=(t=this.toString()).indexOf(e.word);-1!==s&&(r=this.positionInside(s,t))}return r}positionInside(e,t){let r=t||this.toString(),s=this.source.start.column,n=this.source.start.line;for(let t=0;t<e;t++)"\n"===r[t]?(s=1,n+=1):s+=1;return{column:s,line:n}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let s=this.toString(),n=s.indexOf(e.word);-1!==n&&(t=this.positionInside(n,s),r=this.positionInside(n+e.word.length,s))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return(new Qn).raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let s of e)s===this?r=!0:r?(this.parent.insertAfter(t,s),t=s):this.parent.insertBefore(t,s);r||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let r={},s=null==t;t=t||new Map;let n=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let s=this[e];if(Array.isArray(s))r[e]=s.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof s&&s.toJSON)r[e]=s.toJSON(null,t);else if("source"===e){let o=t.get(s.input);null==o&&(o=n,t.set(s.input,n),n++),r[e]={end:s.end,inputId:o,start:s.start}}else r[e]=s}return s&&(r.inputs=[...t.keys()].map(e=>e.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=eo){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,r){let s={node:this};for(let e in r)s[e]=r[e];return e.warn(t,s)}get proxyOf(){return this}};var so=ro;ro.default=ro;let no=so,oo=class extends no{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var io=oo;oo.default=oo;var ao={nanoid:(e=21)=>{let t="",r=e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}};let{SourceMapConsumer:lo,SourceMapGenerator:co}=_n,{existsSync:ho,readFileSync:uo}=_n,{dirname:po,join:fo}=_n;let mo=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,s=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=po(this.mapFile)),s&&(this.text=s)}consumer(){return this.consumerCache||(this.consumerCache=new lo(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let r=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),s=e.indexOf("*/",r);r>-1&&s>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,s)))}loadFile(e){if(this.root=po(e),ho(e))return this.mapFile=e,uo(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof lo)return co.fromSourceMap(t).toString();if(t instanceof co)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let r=t(e);if(r){let e=this.loadFile(r);if(!e)throw new Error("Unable to load previous source map: "+r.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=fo(po(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var go=mo;mo.default=mo;let{SourceMapConsumer:yo,SourceMapGenerator:wo}=_n,{fileURLToPath:vo,pathToFileURL:bo}=_n,{isAbsolute:So,resolve:Co}=_n,{nanoid:ko}=ao,Io=_n,xo=jn,Oo=go,Mo=Symbol("fromOffsetCache"),Eo=Boolean(yo&&wo),Ro=Boolean(Co&&So),Ao=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||""===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!Ro||/^\w+:\/\//.test(t.from)||So(t.from)?this.file=t.from:this.file=Co(t.from)),Ro&&Eo){let e=new Oo(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+ko(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,s={}){let n,o,i;if(t&&"object"==typeof t){let e=t,s=r;if("number"==typeof e.offset){let s=this.fromOffset(e.offset);t=s.line,r=s.col}else t=e.line,r=e.column;if("number"==typeof s.offset){let e=this.fromOffset(s.offset);o=e.line,i=e.col}else o=s.line,i=s.column}else if(!r){let e=this.fromOffset(t);t=e.line,r=e.col}let a=this.origin(t,r,o,i);return n=a?new xo(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,s.plugin):new xo(e,void 0===o?t:{column:r,line:t},void 0===o?r:{column:i,line:o},this.css,this.file,s.plugin),n.input={column:r,endColumn:i,endLine:o,line:t,source:this.css},this.file&&(bo&&(n.input.url=bo(this.file).toString()),n.input.file=this.file),n}fromOffset(e){let t,r;if(this[Mo])r=this[Mo];else{let e=this.css.split("\n");r=new Array(e.length);let t=0;for(let s=0,n=e.length;s<n;s++)r[s]=t,t+=e[s].length+1;this[Mo]=r}t=r[r.length-1];let s=0;if(e>=t)s=r.length-1;else{let t,n=r.length-2;for(;s<n;)if(t=s+(n-s>>1),e<r[t])n=t-1;else{if(!(e>=r[t+1])){s=t;break}s=t+1}}return{col:e-r[s]+1,line:s+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Co(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,s){if(!this.map)return!1;let n,o,i=this.map.consumer(),a=i.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof r&&(n=i.originalPositionFor({column:s,line:r})),o=So(a.source)?bo(a.source):new URL(a.source,this.map.consumer().sourceRoot||bo(this.map.mapFile));let l={column:a.column,endColumn:n&&n.column,endLine:n&&n.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!vo)throw new Error("file: protocol is not available in this PostCSS build");l.file=vo(o)}let c=i.sourceContentFor(a.source);return c&&(l.source=c),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var To=Ao;Ao.default=Ao,Io&&Io.registerInput&&Io.registerInput(Ao);let{SourceMapConsumer:Do,SourceMapGenerator:No}=_n,{dirname:Lo,relative:Fo,resolve:Po,sep:Bo}=_n,{pathToFileURL:_o}=_n,Uo=To,Wo=Boolean(Do&&No),zo=Boolean(Lo&&Po&&Fo&&Bo);var jo=class{constructor(e,t,r,s){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=s,this.originalCSS=s,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,r=this.toUrl(this.path(e.file)),s=e.root||Lo(e.file);!1===this.mapOpts.sourcesContent?(t=new Do(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,r,this.toUrl(this.path(s)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),zo&&Wo&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=No.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new No({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new No({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,r=1,s=1,n="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(i,a,l)=>{if(this.css+=i,a&&"end"!==l&&(o.generated.line=r,o.generated.column=s-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=n,o.original.line=1,o.original.column=0,this.map.addMapping(o))),e=i.match(/\n/g),e?(r+=e.length,t=i.lastIndexOf("\n"),s=i.length-t):s+=i.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=r,o.generated.column=s-2,this.map.addMapping(o)):(o.source=n,o.original.line=1,o.original.column=0,o.generated.line=r,o.generated.column=s-1,this.map.addMapping(o)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?Lo(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(r=Lo(Po(r,this.mapOpts.annotation)));let s=Fo(r,e);return this.memoizedPaths.set(e,s),s}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new Uo(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let s=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(s,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(_o){let t=_o(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===Bo&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let Vo=so,Go=class extends Vo{constructor(e){super(e),this.type="comment"}};var Yo=Go;Go.default=Go;let Zo,Ho,Xo,Jo,{isClean:$o,my:Ko}=Vn,qo=io,Qo=Yo,ei=so;function ti(e){return e.map(e=>(e.nodes&&(e.nodes=ti(e.nodes)),delete e.source,e))}function ri(e){if(e[$o]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)ri(t)}let si=class e extends ei{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,r,s=this.getIterator();for(;this.indexes[s]<this.proxyOf.nodes.length&&(t=this.indexes[s],r=e(this.proxyOf.nodes[t],t),!1!==r);)this.indexes[s]+=1;return delete this.indexes[s],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...r)=>e[t](...r.map(e=>"function"==typeof e?(t,r)=>e(t.toProxy(),r):e)):"every"===t||"some"===t?r=>e[t]((e,...t)=>r(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,r)=>(e[t]===r||(e[t]=r,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r,s=this.index(e),n=this.normalize(t,this.proxyOf.nodes[s]).reverse();s=this.index(e);for(let e of n)this.proxyOf.nodes.splice(s+1,0,e);for(let e in this.indexes)r=this.indexes[e],s<r&&(this.indexes[e]=r+n.length);return this.markDirty(),this}insertBefore(e,t){let r,s=this.index(e),n=0===s&&"prepend",o=this.normalize(t,this.proxyOf.nodes[s],n).reverse();s=this.index(e);for(let e of o)this.proxyOf.nodes.splice(s,0,e);for(let e in this.indexes)r=this.indexes[e],s<=r&&(this.indexes[e]=r+o.length);return this.markDirty(),this}normalize(t,r){if("string"==typeof t)t=ti(Zo(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new qo(t)]}else if(t.selector)t=[new Ho(t)];else if(t.name)t=[new Xo(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Qo(t)]}return t.map(t=>(t[Ko]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[$o]&&ri(t),void 0===t.raws.before&&r&&void 0!==r.raws.before&&(t.raws.before=r.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(s=>{t.props&&!t.props.includes(s.prop)||t.fast&&!s.value.includes(t.fast)||(s.value=s.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let s;try{s=e(t,r)}catch(e){throw t.addToError(e)}return!1!==s&&t.walk&&(s=t.walk(e)),s})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,s)=>{if("atrule"===r.type&&e.test(r.name))return t(r,s)}):this.walk((r,s)=>{if("atrule"===r.type&&r.name===e)return t(r,s)}):(t=e,this.walk((e,r)=>{if("atrule"===e.type)return t(e,r)}))}walkComments(e){return this.walk((t,r)=>{if("comment"===t.type)return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,s)=>{if("decl"===r.type&&e.test(r.prop))return t(r,s)}):this.walk((r,s)=>{if("decl"===r.type&&r.prop===e)return t(r,s)}):(t=e,this.walk((e,r)=>{if("decl"===e.type)return t(e,r)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,s)=>{if("rule"===r.type&&e.test(r.selector))return t(r,s)}):this.walk((r,s)=>{if("rule"===r.type&&r.selector===e)return t(r,s)}):(t=e,this.walk((e,r)=>{if("rule"===e.type)return t(e,r)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};si.registerParse=e=>{Zo=e},si.registerRule=e=>{Ho=e},si.registerAtRule=e=>{Xo=e},si.registerRoot=e=>{Jo=e};var ni=si;si.default=si,si.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Xo.prototype):"rule"===e.type?Object.setPrototypeOf(e,Ho.prototype):"decl"===e.type?Object.setPrototypeOf(e,qo.prototype):"comment"===e.type?Object.setPrototypeOf(e,Qo.prototype):"root"===e.type&&Object.setPrototypeOf(e,Jo.prototype),e[Ko]=!0,e.nodes&&e.nodes.forEach(e=>{si.rebuild(e)})};let oi,ii,ai=ni,li=class extends ai{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new oi(new ii,this,e).stringify()}};li.registerLazyResult=e=>{oi=e},li.registerProcessor=e=>{ii=e};var ci=li;li.default=li;let hi={};var ui=function(e){hi[e]||(hi[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let di=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};var pi=di;di.default=di;let fi=pi,mi=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new fi(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var gi=mi;mi.default=mi;const yi="'".charCodeAt(0),wi='"'.charCodeAt(0),vi="\\".charCodeAt(0),bi="/".charCodeAt(0),Si="\n".charCodeAt(0),Ci=" ".charCodeAt(0),ki="\f".charCodeAt(0),Ii="\t".charCodeAt(0),xi="\r".charCodeAt(0),Oi="[".charCodeAt(0),Mi="]".charCodeAt(0),Ei="(".charCodeAt(0),Ri=")".charCodeAt(0),Ai="{".charCodeAt(0),Ti="}".charCodeAt(0),Di=";".charCodeAt(0),Ni="*".charCodeAt(0),Li=":".charCodeAt(0),Fi="@".charCodeAt(0),Pi=/[\t\n\f\r "#'()/;[\\\]{}]/g,Bi=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,_i=/.[\r\n"'(/\\]/,Ui=/[\da-f]/i;let Wi=ni,zi=class extends Wi{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};var ji=zi;zi.default=zi,Wi.registerAtRule(zi);let Vi,Gi,Yi=ni,Zi=class extends Yi{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let s=super.normalize(e);if(t)if("prepend"===r)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of s)e.raws.before=t.raws.before;return s}removeChild(e,t){let r=this.index(e);return!t&&0===r&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new Vi(new Gi,this,e).stringify()}};Zi.registerLazyResult=e=>{Vi=e},Zi.registerProcessor=e=>{Gi=e};var Hi=Zi;Zi.default=Zi,Yi.registerRoot(Zi);let Xi={comma:e=>Xi.split(e,[","],!0),space:e=>Xi.split(e,[" ","\n","\t"]),split(e,t,r){let s=[],n="",o=!1,i=0,a=!1,l="",c=!1;for(let r of e)c?c=!1:"\\"===r?c=!0:a?r===l&&(a=!1):'"'===r||"'"===r?(a=!0,l=r):"("===r?i+=1:")"===r?i>0&&(i-=1):0===i&&t.includes(r)&&(o=!0),o?(""!==n&&s.push(n.trim()),n="",o=!1):n+=r;return(r||""!==n)&&s.push(n.trim()),s}};var Ji=Xi;Xi.default=Xi;let $i=ni,Ki=Ji,qi=class extends $i{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Ki.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}};var Qi=qi;qi.default=qi,$i.registerRule(qi);let ea=io,ta=function(e,t={}){let r,s,n,o,i,a,l,c,h,u,d=e.css.valueOf(),p=t.ignoreErrors,f=d.length,m=0,g=[],y=[];function w(t){throw e.error("Unclosed "+t,m)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&m>=f},nextToken:function(e){if(y.length)return y.pop();if(m>=f)return;let t=!!e&&e.ignoreUnclosed;switch(r=d.charCodeAt(m),r){case Si:case Ci:case Ii:case xi:case ki:s=m;do{s+=1,r=d.charCodeAt(s)}while(r===Ci||r===Si||r===Ii||r===xi||r===ki);u=["space",d.slice(m,s)],m=s-1;break;case Oi:case Mi:case Ai:case Ti:case Li:case Di:case Ri:{let e=String.fromCharCode(r);u=[e,e,m];break}case Ei:if(c=g.length?g.pop()[1]:"",h=d.charCodeAt(m+1),"url"===c&&h!==yi&&h!==wi&&h!==Ci&&h!==Si&&h!==Ii&&h!==ki&&h!==xi){s=m;do{if(a=!1,s=d.indexOf(")",s+1),-1===s){if(p||t){s=m;break}w("bracket")}for(l=s;d.charCodeAt(l-1)===vi;)l-=1,a=!a}while(a);u=["brackets",d.slice(m,s+1),m,s],m=s}else s=d.indexOf(")",m+1),o=d.slice(m,s+1),-1===s||_i.test(o)?u=["(","(",m]:(u=["brackets",o,m,s],m=s);break;case yi:case wi:n=r===yi?"'":'"',s=m;do{if(a=!1,s=d.indexOf(n,s+1),-1===s){if(p||t){s=m+1;break}w("string")}for(l=s;d.charCodeAt(l-1)===vi;)l-=1,a=!a}while(a);u=["string",d.slice(m,s+1),m,s],m=s;break;case Fi:Pi.lastIndex=m+1,Pi.test(d),s=0===Pi.lastIndex?d.length-1:Pi.lastIndex-2,u=["at-word",d.slice(m,s+1),m,s],m=s;break;case vi:for(s=m,i=!0;d.charCodeAt(s+1)===vi;)s+=1,i=!i;if(r=d.charCodeAt(s+1),i&&r!==bi&&r!==Ci&&r!==Si&&r!==Ii&&r!==xi&&r!==ki&&(s+=1,Ui.test(d.charAt(s)))){for(;Ui.test(d.charAt(s+1));)s+=1;d.charCodeAt(s+1)===Ci&&(s+=1)}u=["word",d.slice(m,s+1),m,s],m=s;break;default:r===bi&&d.charCodeAt(m+1)===Ni?(s=d.indexOf("*/",m+2)+1,0===s&&(p||t?s=d.length:w("comment")),u=["comment",d.slice(m,s+1),m,s],m=s):(Bi.lastIndex=m+1,Bi.test(d),s=0===Bi.lastIndex?d.length-1:Bi.lastIndex-2,u=["word",d.slice(m,s+1),m,s],g.push(u),m=s)}return m++,u},position:function(){return m}}},ra=Yo,sa=ji,na=Hi,oa=Qi;const ia={empty:!0,space:!0};let aa=ni,la=class{constructor(e){this.input=e,this.root=new na,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t,r,s,n=new sa;n.name=e[1].slice(1),""===n.name&&this.unnamedAtrule(n,e),this.init(n,e[2]);let o=!1,i=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){n.source.end=this.getPosition(e[2]),n.source.end.offset++,this.semicolon=!0;break}if("{"===t){i=!0;break}if("}"===t){if(a.length>0){for(s=a.length-1,r=a[s];r&&"space"===r[0];)r=a[--s];r&&(n.source.end=this.getPosition(r[3]||r[2]),n.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}n.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(n.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(n,"params",a),o&&(e=a[a.length-1],n.source.end=this.getPosition(e[3]||e[2]),n.source.end.offset++,this.spaces=n.raws.between,n.raws.between="")):(n.raws.afterName="",n.params=""),i&&(n.nodes=[],this.current=n)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let r,s=0;for(let n=t-1;n>=0&&(r=e[n],"space"===r[0]||(s+=1,2!==s));n--);throw this.input.error("Missed semicolon","word"===r[0]?r[3]+1:r[2])}colon(e){let t,r,s,n=0;for(let[o,i]of e.entries()){if(t=i,r=t[0],"("===r&&(n+=1),")"===r&&(n-=1),0===n&&":"===r){if(s){if("word"===s[0]&&"progid"===s[1])continue;return o}this.doubleColon(t)}s=t}return!1}comment(e){let t=new ra;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=ta(this.input)}decl(e,t){let r=new ea;this.init(r,e[0][2]);let s,n=e[e.length-1];for(";"===n[0]&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(n[3]||n[2]||function(e){for(let t=e.length-1;t>=0;t--){let r=e[t],s=r[3]||r[2];if(s)return s}}(e)),r.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;r.prop+=e.shift()[1]}for(r.raws.between="";e.length;){if(s=e.shift(),":"===s[0]){r.raws.between+=s[1];break}"word"===s[0]&&/\w/.test(s[1])&&this.unknownWord([s]),r.raws.between+=s[1]}"_"!==r.prop[0]&&"*"!==r.prop[0]||(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let o,i=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)i.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(s=e[t],"!important"===s[1].toLowerCase()){r.important=!0;let s=this.stringFrom(e,t);s=this.spacesFromEnd(e)+s," !important"!==s&&(r.raws.important=s);break}if("important"===s[1].toLowerCase()){let s=e.slice(0),n="";for(let e=t;e>0;e--){let t=s[e][0];if(0===n.trim().indexOf("!")&&"space"!==t)break;n=s.pop()[1]+n}0===n.trim().indexOf("!")&&(r.important=!0,r.raws.important=n,e=s)}if("space"!==s[0]&&"comment"!==s[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(r.raws.between+=i.map(e=>e[1]).join(""),i=[]),this.raw(r,"value",i.concat(e),t),r.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new oa;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,r=null,s=!1,n=null,o=[],i=e[1].startsWith("--"),a=[],l=e;for(;l;){if(r=l[0],a.push(l),"("===r||"["===r)n||(n=l),o.push("("===r?")":"]");else if(i&&s&&"{"===r)n||(n=l),o.push("}");else if(0===o.length){if(";"===r){if(s)return void this.decl(a,i);break}if("{"===r)return void this.rule(a);if("}"===r){this.tokenizer.back(a.pop()),t=!0;break}":"===r&&(s=!0)}else r===o[o.length-1]&&(o.pop(),0===o.length&&(n=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(n),t&&s){if(!i)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,i)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,s){let n,o,i,a,l=r.length,c="",h=!0;for(let e=0;e<l;e+=1)n=r[e],o=n[0],"space"!==o||e!==l-1||s?"comment"===o?(a=r[e-1]?r[e-1][0]:"empty",i=r[e+1]?r[e+1][0]:"empty",ia[a]||ia[i]||","===c.slice(-1)?h=!1:c+=n[1]):c+=n[1]:h=!1;if(!h){let s=r.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:s,value:c}}e[t]=c}rule(e){e.pop();let t=new oa;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let s=t;s<e.length;s++)r+=e[s][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}},ca=To;function ha(e,t){let r=new ca(e,t),s=new la(r);try{s.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 s.root}var ua=ha;ha.default=ha,aa.registerParse(ha);let{isClean:da,my:pa}=Vn,fa=jo,ma=Jn,ga=ni,ya=ci,wa=ui,va=gi,ba=ua,Sa=Hi;const Ca={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},ka={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},Ia={Once:!0,postcssPlugin:!0,prepare:!0};function xa(e){return"object"==typeof e&&"function"==typeof e.then}function Oa(e){let t=!1,r=Ca[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[r,r+"-"+t,0,r+"Exit",r+"Exit-"+t]:t?[r,r+"-"+t,r+"Exit",r+"Exit-"+t]:e.append?[r,0,r+"Exit"]:[r,r+"Exit"]}function Ma(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:Oa(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function Ea(e){return e[da]=!1,e.nodes&&e.nodes.forEach(e=>Ea(e)),e}let Ra={},Aa=class e{constructor(t,r,s){let n;if(this.stringified=!1,this.processed=!1,"object"!=typeof r||null===r||"root"!==r.type&&"document"!==r.type)if(r instanceof e||r instanceof va)n=Ea(r.root),r.map&&(void 0===s.map&&(s.map={}),s.map.inline||(s.map.inline=!1),s.map.prev=r.map);else{let e=ba;s.syntax&&(e=s.syntax.parse),s.parser&&(e=s.parser),e.parse&&(e=e.parse);try{n=e(r,s)}catch(e){this.processed=!0,this.error=e}n&&!n[pa]&&ga.rebuild(n)}else n=Ea(r);this.result=new va(t,n,s),this.helpers={...Ra,postcss:Ra,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(r.postcssVersion&&"production"!==process.env.NODE_ENV){let e=r.postcssPlugin,t=r.postcssVersion,s=this.result.processor.version,n=t.split("."),o=s.split(".");(n[0]!==o[0]||parseInt(n[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+s+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=r.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,r)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,r])};for(let t of this.plugins)if("object"==typeof t)for(let r in t){if(!ka[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Ia[r])if("object"==typeof t[r])for(let s in t[r])e(t,"*"===s?r:r+"-"+s.toLowerCase(),t[r][s]);else"function"==typeof t[r]&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(xa(r))try{await r}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[da];){e[da]=!0;let t=[Ma(e)];for(;t.length>0;){let e=this.visitTick(t);if(xa(e))try{await e}catch(e){let r=t[t.length-1].node;throw this.handleError(e,r)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>r(e,this.helpers));await Promise.all(t)}else await r(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return xa(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=ma;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let r=new fa(t,this.result.root,this.result.opts).generate();return this.result.css=r[0],this.result.map=r[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){if(xa(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[da];)e[da]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||wa("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,s]of e){let e;this.result.lastPlugin=r;try{e=s(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(xa(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:s}=t;if("root"!==r.type&&"document"!==r.type&&!r.parent)return void e.pop();if(s.length>0&&t.visitorIndex<s.length){let[e,n]=s[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===s.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return n(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(0!==t.iterator){let s,n=t.iterator;for(;s=r.nodes[r.indexes[n]];)if(r.indexes[n]+=1,!s[da])return s[da]=!0,void e.push(Ma(s));t.iterator=0,delete r.indexes[n]}let n=t.events;for(;t.eventIndex<n.length;){let e=n[t.eventIndex];if(t.eventIndex+=1,0===e)return void(r.nodes&&r.nodes.length&&(r[da]=!0,t.iterator=r.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[da]=!0;let t=Oa(e);for(let r of t)if(0===r)e.nodes&&e.each(e=>{e[da]||this.walkSync(e)});else{let t=this.listeners[r];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};Aa.registerPostcss=e=>{Ra=e};var Ta=Aa;Aa.default=Aa,Sa.registerLazyResult(Aa),ya.registerLazyResult(Aa);let Da=jo,Na=Jn,La=ui,Fa=ua;const Pa=gi;let Ba=class{constructor(e,t,r){let s;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let n=Na;this.result=new Pa(this._processor,s,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let i=new Da(n,s,this._opts,t);if(i.isMap()){let[e,t]=i.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else i.clearAnnotation(),this.result.css=i.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||La("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=Fa;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var _a=Ba;Ba.default=Ba;let Ua=_a,Wa=Ta,za=ci,ja=Hi,Va=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(!0===r.postcss?r=r():r.postcss&&(r=r.postcss),"object"==typeof r&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if("object"==typeof r&&r.postcssPlugin)t.push(r);else if("function"==typeof r)t.push(r);else{if("object"!=typeof r||!r.parse&&!r.stringify)throw new Error(r+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new Wa(this,e,t):new Ua(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Ga=Va;Va.default=Va,ja.registerProcessor(Va),za.registerProcessor(Va);let Ya=io,Za=go,Ha=Yo,Xa=ji,Ja=To,$a=Hi,Ka=Qi;function qa(e,t){if(Array.isArray(e))return e.map(e=>qa(e));let{inputs:r,...s}=e;if(r){t=[];for(let e of r){let r={...e,__proto__:Ja.prototype};r.map&&(r.map={...r.map,__proto__:Za.prototype}),t.push(r)}}if(s.nodes&&(s.nodes=e.nodes.map(e=>qa(e,t))),s.source){let{inputId:e,...r}=s.source;s.source=r,null!=e&&(s.source.input=t[e])}if("root"===s.type)return new $a(s);if("decl"===s.type)return new Ya(s);if("rule"===s.type)return new Ka(s);if("comment"===s.type)return new Ha(s);if("atrule"===s.type)return new Xa(s);throw new Error("Unknown node type: "+e.type)}var Qa=qa;qa.default=qa;let el=jn,tl=io,rl=Ta,sl=ni,nl=Ga,ol=Jn,il=Qa,al=ci,ll=pi,cl=Yo,hl=ji,ul=gi,dl=To,pl=ua,fl=Ji,ml=Qi,gl=Hi,yl=so;function wl(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new nl(e)}wl.plugin=function(e,t){let r,s=!1;function n(...r){console&&console.warn&&!s&&(s=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let n=t(...r);return n.postcssPlugin=e,n.postcssVersion=(new nl).version,n}return Object.defineProperty(n,"postcss",{get:()=>(r||(r=n()),r)}),n.process=function(e,t,r){return wl([n(r)]).process(e,t)},n},wl.stringify=ol,wl.parse=pl,wl.fromJSON=il,wl.list=fl,wl.comment=e=>new cl(e),wl.atRule=e=>new hl(e),wl.decl=e=>new tl(e),wl.rule=e=>new ml(e),wl.root=e=>new gl(e),wl.document=e=>new al(e),wl.CssSyntaxError=el,wl.Declaration=tl,wl.Container=sl,wl.Processor=nl,wl.Document=al,wl.Comment=cl,wl.Warning=ll,wl.AtRule=hl,wl.Result=ul,wl.Input=dl,wl.Rule=ml,wl.Root=gl,wl.Node=yl,rl.registerPostcss(wl);var vl=wl;wl.default=wl;const bl=Dn(vl);bl.stringify,bl.fromJSON,bl.plugin,bl.parse,bl.list,bl.document,bl.comment,bl.atRule,bl.rule,bl.decl,bl.root,bl.CssSyntaxError,bl.Declaration,bl.Container,bl.Processor,bl.Document,bl.Comment,bl.Warning,bl.AtRule,bl.Result,bl.Input,bl.Rule,bl.Root,bl.Node;class Sl{constructor(...e){Tn(this,"parentElement",null),Tn(this,"parentNode",null),Tn(this,"ownerDocument"),Tn(this,"firstChild",null),Tn(this,"lastChild",null),Tn(this,"previousSibling",null),Tn(this,"nextSibling",null),Tn(this,"ELEMENT_NODE",1),Tn(this,"TEXT_NODE",3),Tn(this,"nodeType"),Tn(this,"nodeName"),Tn(this,"RRNodeType")}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof Sl))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}const Cl={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},kl={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Il={};function xl(e){if(Il[e])return Il[e];const t=globalThis[e],r=t.prototype,s=e in Cl?Cl[e]:void 0,n=Boolean(s&&s.every(e=>{var t,s;return Boolean(null==(s=null==(t=Object.getOwnPropertyDescriptor(r,e))?void 0:t.get)?void 0:s.toString().includes("[native code]"))})),o=e in kl?kl[e]:void 0,i=Boolean(o&&o.every(e=>{var t;return"function"==typeof r[e]&&(null==(t=r[e])?void 0:t.toString().includes("[native code]"))}));if(n&&i&&!globalThis.Zone)return Il[e]=t.prototype,t.prototype;try{const s=document.createElement("iframe");document.body.appendChild(s);const n=s.contentWindow;if(!n)return t.prototype;const o=n[e].prototype;return document.body.removeChild(s),o?Il[e]=o:r}catch{return r}}const Ol={};function Ml(e,t,r){var s;const n=`${e}.${String(r)}`;if(Ol[n])return Ol[n].call(t);const o=xl(e),i=null==(s=Object.getOwnPropertyDescriptor(o,r))?void 0:s.get;return i?(Ol[n]=i,i.call(t)):t[r]}const El={};function Rl(e,t,r){const s=`${e}.${String(r)}`;if(El[s])return El[s].bind(t);const n=xl(e)[r];return"function"!=typeof n?t[r]:(El[s]=n,n.bind(t))}function Al(){return xl("MutationObserver").constructor}const Tl={childNodes:function(e){return Ml("Node",e,"childNodes")},parentNode:function(e){return Ml("Node",e,"parentNode")},parentElement:function(e){return Ml("Node",e,"parentElement")},textContent:function(e){return Ml("Node",e,"textContent")},contains:function(e,t){return Rl("Node",e,"contains")(t)},getRootNode:function(e){return Rl("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Ml("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Ml("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Ml("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Ml("Element",e,"querySelectorAll")(t)},mutationObserver:Al};function Dl(e,t,r=document){const s={capture:!0,passive:!0};return r.addEventListener(e,t,s),()=>r.removeEventListener(e,t,s)}const Nl="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let Ll={map:{},getId:()=>(console.error(Nl),-1),getNode:()=>(console.error(Nl),null),removeNodeFromMap(){console.error(Nl)},has:()=>(console.error(Nl),!1),reset(){console.error(Nl)}};function Fl(e,t,r={}){let s=null,n=0;return function(...o){const i=Date.now();n||!1!==r.leading||(n=i);const a=t-(i-n),l=this;a<=0||a>t?(s&&(clearTimeout(s),s=null),n=i,e.apply(l,o)):s||!1===r.trailing||(s=setTimeout(()=>{n=!1===r.leading?0:Date.now(),s=null,e.apply(l,o)},a))}}function Pl(e,t,r,s,n=window){const o=n.Object.getOwnPropertyDescriptor(e,t);return n.Object.defineProperty(e,t,s?r:{set(e){setTimeout(()=>{r.set.call(this,e)},0),o&&o.set&&o.set.call(this,e)}}),()=>Pl(e,t,o||{},!0)}function Bl(e,t,r){try{if(!(t in e))return()=>{};const s=e[t],n=r(s);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:s}})),e[t]=n,()=>{e[t]=s}}catch{return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Ll=new Proxy(Ll,{get:(e,t,r)=>("map"===t&&console.error(Nl),Reflect.get(e,t,r))}));let _l=Date.now;function Ul(e){var t,r,s,n;const o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=Tl.parentElement(o.body))?void 0:t.scrollLeft)||(null==(r=null==o?void 0:o.body)?void 0:r.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(s=Tl.parentElement(o.body))?void 0:s.scrollTop)||(null==(n=null==o?void 0:o.body)?void 0:n.scrollTop)||0}}function Wl(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function zl(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function jl(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:Tl.parentElement(e)}function Vl(e,t,r,s){if(!e)return!1;const n=jl(e);if(!n)return!1;try{if("string"==typeof t){if(n.classList.contains(t))return!0;if(s&&null!==n.closest("."+t))return!0}else if(Pe(n,t,s))return!0}catch(e){}if(r){if(n.matches(r))return!0;if(s&&null!==n.closest(r))return!0}return!1}function Gl(e,t,r){return!("TITLE"!==e.tagName||!r.headTitleMutations)||-2===t.getId(e)}function Yl(e,t){if(ie(e))return!1;const r=t.getId(e);if(!t.has(r))return!0;const s=Tl.parentNode(e);return(!s||s.nodeType!==e.DOCUMENT_NODE)&&(!s||Yl(s,t))}function Zl(e){return Boolean(e.changedTouches)}function Hl(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function Xl(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Jl(e){return!!e&&(e instanceof Sl&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(Tl.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(_l=()=>(new Date).getTime());class $l{constructor(){Z(this,"id",1),Z(this,"styleIDMap",new WeakMap),Z(this,"idStyleMap",new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let r;return r=void 0===t?this.id++:t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function Kl(e){var t;let r=null;return"getRootNode"in e&&(null==(t=Tl.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Tl.host(Tl.getRootNode(e))&&(r=Tl.host(Tl.getRootNode(e))),r}function ql(e){const t=e.ownerDocument;if(!t)return!1;const r=function(e){let t,r=e;for(;t=Kl(r);)r=t;return r}(e);return Tl.contains(t,r)}function Ql(e){const t=e.ownerDocument;return!!t&&(Tl.contains(t,e)||ql(e))}var ec=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(ec||{}),tc=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(tc||{}),rc=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(rc||{}),sc=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(sc||{}),nc=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(nc||{}),oc=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(oc||{}),ic=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(ic||{});function ac(e){return"__ln"in e}class lc{constructor(){Z(this,"length",0),Z(this,"head",null),Z(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let r=0;r<e;r++)t=(null==t?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&ac(e.previousSibling)){const r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&ac(e.nextSibling)&&e.nextSibling.__ln.previous){const r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const cc=(e,t)=>`${e}@${t}`;class hc{constructor(){Z(this,"frozen",!1),Z(this,"locked",!1),Z(this,"texts",[]),Z(this,"attributes",[]),Z(this,"attributeMap",new WeakMap),Z(this,"removes",[]),Z(this,"mapRemoves",[]),Z(this,"movedMap",{}),Z(this,"addedSet",new Set),Z(this,"movedSet",new Set),Z(this,"droppedSet",new Set),Z(this,"removesSubTreeCache",new Set),Z(this,"mutationCb"),Z(this,"blockClass"),Z(this,"blockSelector"),Z(this,"maskTextClass"),Z(this,"maskTextSelector"),Z(this,"inlineStylesheet"),Z(this,"maskInputOptions"),Z(this,"maskTextFn"),Z(this,"maskInputFn"),Z(this,"keepIframeSrcFn"),Z(this,"recordCanvas"),Z(this,"inlineImages"),Z(this,"slimDOMOptions"),Z(this,"dataURLOptions"),Z(this,"doc"),Z(this,"mirror"),Z(this,"iframeManager"),Z(this,"stylesheetManager"),Z(this,"shadowDomManager"),Z(this,"canvasManager"),Z(this,"processedNodeManager"),Z(this,"unattachedDoc"),Z(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),Z(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new lc,s=e=>{let t=e,r=-2;for(;-2===r;)t=t&&t.nextSibling,r=t&&this.mirror.getId(t);return r},n=n=>{const o=Tl.parentNode(n);if(!o||!Ql(n))return;let i=!1;if(n.nodeType===Node.TEXT_NODE){const e=o.tagName;if("TEXTAREA"===e)return;"STYLE"===e&&this.addedSet.has(o)&&(i=!0)}const a=ie(o)?this.mirror.getId(Kl(n)):this.mirror.getId(o),l=s(n);if(-1===a||-1===l)return r.addNode(n);const c=We(n,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{Hl(e,this.mirror)&&this.iframeManager.addIframe(e),Xl(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Jl(n)&&this.shadowDomManager.addShadowRoot(Tl.shadowRoot(n),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)},cssCaptured:i});c&&(e.push({parentId:a,nextId:l,node:c}),t.add(c.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of this.movedSet)dc(this.removesSubTreeCache,e,this.mirror)&&!this.movedSet.has(Tl.parentNode(e))||n(e);for(const e of this.addedSet)pc(this.droppedSet,e)||dc(this.removesSubTreeCache,e,this.mirror)?pc(this.movedSet,e)?n(e):this.droppedSet.add(e):n(e);let o=null;for(;r.length;){let e=null;if(o){const t=this.mirror.getId(Tl.parentNode(o.value)),r=s(o.value);-1!==t&&-1!==r&&(e=o)}if(!e){let t=r.tail;for(;t;){const r=t;if(t=t.previous,r){const t=this.mirror.getId(Tl.parentNode(r.value));if(-1===s(r.value))continue;if(-1!==t){e=r;break}{const t=r.value,s=Tl.parentNode(t);if(s&&s.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=Tl.host(s);if(-1!==this.mirror.getId(t)){e=r;break}}}}}}if(!e){for(;r.head;)r.removeNode(r.head.value);break}o=e.previous,r.removeNode(e.value),n(e.value)}const i={texts:this.texts.map(e=>{const t=e.node,r=Tl.parentNode(t);return r&&"TEXTAREA"===r.tagName&&this.genTextAreaValueMutation(r),{id:this.mirror.getId(t),value:e.value}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),attributes:this.attributes.map(e=>{const{attributes:t}=e;if("string"==typeof t.style){const r=JSON.stringify(e.styleDiff),s=JSON.stringify(e._unchangedStyles);r.length<t.style.length&&(r+s).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),removes:this.removes,adds:e};(i.texts.length||i.attributes.length||i.removes.length||i.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(i))}),Z(this,"genTextAreaValueMutation",e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t)),t.attributes.value=Array.from(Tl.childNodes(e),e=>Tl.textContent(e)||"").join("")}),Z(this,"processMutation",e=>{if(!Gl(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=Tl.textContent(e.target);Vl(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:Be(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,jl(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let r=e.attributeName,s=e.target.getAttribute(r);if("value"===r){const e=fe(t);s=ue({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:s,maskInputFn:this.maskInputFn})}if(Vl(e.target,this.blockClass,this.blockSelector,!1)||s===e.oldValue)return;let n=this.attributeMap.get(e.target);if("IFRAME"===t.tagName&&"src"===r&&!this.keepIframeSrcFn(s)){if(t.contentDocument)return;r="rr_src"}if(n||(n={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(n),this.attributeMap.set(e.target,n)),"type"===r&&"INPUT"===t.tagName&&"password"===(e.oldValue||"").toLowerCase()&&t.setAttribute("data-rr-is-password","true"),!Fe(t.tagName,r))if(n.attributes[r]=Le(this.doc,de(t.tagName),de(r),s),"style"===r){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}const r=this.unattachedDoc.createElement("span");e.oldValue&&r.setAttribute("style",e.oldValue);for(const e of Array.from(t.style)){const s=t.style.getPropertyValue(e),o=t.style.getPropertyPriority(e);s!==r.style.getPropertyValue(e)||o!==r.style.getPropertyPriority(e)?n.styleDiff[e]=""===o?s:[s,o]:n._unchangedStyles[e]=[s,o]}for(const e of Array.from(r.style))""===t.style.getPropertyValue(e)&&(n.styleDiff[e]=!1)}else"open"===r&&"DIALOG"===t.tagName&&(t.matches("dialog:modal")?n.attributes.rr_open_mode="modal":n.attributes.rr_open_mode="non-modal");break}case"childList":if(Vl(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{const r=this.mirror.getId(t),s=ie(e.target)?this.mirror.getId(Tl.host(e.target)):this.mirror.getId(e.target);Vl(e.target,this.blockClass,this.blockSelector,!1)||Gl(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(uc(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===r||Yl(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[cc(r,s)]?uc(this.movedSet,t):(this.removes.push({parentId:s,id:r,isShadow:!(!ie(e.target)||!ae(e.target))||void 0}),function(e,t){const r=[e];for(;r.length;){const e=r.pop();t.has(e)||(t.add(e),Tl.childNodes(e).forEach(e=>r.push(e)))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))})}}),Z(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(Gl(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&-1!==r&&(this.movedMap[cc(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Vl(e,this.blockClass,this.blockSelector,!1)||(Tl.childNodes(e).forEach(e=>this.genAdds(e)),Jl(e)&&Tl.childNodes(Tl.shadowRoot(e)).forEach(t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function uc(e,t){e.delete(t),Tl.childNodes(t).forEach(t=>uc(e,t))}function dc(e,t,r){return 0!==e.size&&function(e,t){const r=Tl.parentNode(t);return!!r&&e.has(r)}(e,t)}function pc(e,t){return 0!==e.size&&fc(e,t)}function fc(e,t){const r=Tl.parentNode(t);return!!r&&(!!e.has(r)||fc(e,r))}let mc;const gc=e=>{if(!mc)return e;return(...t)=>{try{return e(...t)}catch(e){if(mc&&!0===mc(e))return;throw e}}},yc=[];function wc(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function vc(e,t){const r=new hc;yc.push(r),r.init(e);const s=new(Al())(gc(r.processMutations.bind(r)));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function bc({mouseInteractionCb:e,doc:t,mirror:r,blockClass:s,blockSelector:n,sampling:o}){if(!1===o.mouseInteraction)return()=>{};const i=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,a=[];let l=null;return Object.keys(rc).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==i[e]).forEach(o=>{let i=de(o);const c=(t=>o=>{const i=wc(o);if(Vl(i,s,n,!0))return;let a=null,c=t;if("pointerType"in o){switch(o.pointerType){case"mouse":a=sc.Mouse;break;case"touch":a=sc.Touch;break;case"pen":a=sc.Pen}a===sc.Touch?rc[t]===rc.MouseDown?c="TouchStart":rc[t]===rc.MouseUp&&(c="TouchEnd"):sc.Pen}else Zl(o)&&(a=sc.Touch);null!==a?(l=a,(c.startsWith("Touch")&&a===sc.Touch||c.startsWith("Mouse")&&a===sc.Mouse)&&(a=null)):rc[t]===rc.Click&&(a=l,l=null);const h=Zl(o)?o.changedTouches[0]:o;if(!h)return;const u=r.getId(i),{clientX:d,clientY:p}=h;gc(e)({type:rc[c],id:u,x:d,y:p,...null!==a&&{pointerType:a}})})(o);if(window.PointerEvent)switch(rc[o]){case rc.MouseDown:case rc.MouseUp:i=i.replace("mouse","pointer");break;case rc.TouchStart:case rc.TouchEnd:return}a.push(Dl(i,c,t))}),gc(()=>{a.forEach(e=>e())})}function Sc({scrollCb:e,doc:t,mirror:r,blockClass:s,blockSelector:n,sampling:o}){return Dl("scroll",gc(Fl(gc(o=>{const i=wc(o);if(!i||Vl(i,s,n,!0))return;const a=r.getId(i);if(i===t&&t.defaultView){const r=Ul(t.defaultView);e({id:a,x:r.left,y:r.top})}else e({id:a,x:i.scrollLeft,y:i.scrollTop})}),o.scroll||100)),t)}const Cc=["INPUT","TEXTAREA","SELECT"],kc=new WeakMap;function Ic(e){return function(e,t){if(Ec("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Ec("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Ec("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Ec("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const r=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(r)}else if(e.parentStyleSheet){const r=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(r)}return t}(e,[])}function xc(e,t,r){let s,n;return e?(e.ownerNode?s=t.getId(e.ownerNode):n=r.getId(e),{styleId:n,id:s}):{}}function Oc({mirror:e,stylesheetManager:t},r){var s,n,o;let i=null;i="#document"===r.nodeName?e.getId(r):e.getId(Tl.host(r));const a="#document"===r.nodeName?null==(s=r.defaultView)?void 0:s.Document:null==(o=null==(n=r.ownerDocument)?void 0:n.defaultView)?void 0:o.ShadowRoot,l=(null==a?void 0:a.prototype)?Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets"):void 0;return null!==i&&-1!==i&&a&&l?(Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var e;return null==(e=l.get)?void 0:e.call(this)},set(e){var r;const s=null==(r=l.set)?void 0:r.call(this,e);if(null!==i&&-1!==i)try{t.adoptStyleSheets(e,i)}catch(e){}return s}}),gc(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})):()=>{}}function Mc(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};let s;!function(e,t){const{mutationCb:r,mousemoveCb:s,mouseInteractionCb:n,scrollCb:o,viewportResizeCb:i,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:h,canvasMutationCb:u,fontCb:d,selectionCb:p,customElementCb:f}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),r(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),s(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),n(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),o(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),i(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),a(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),l(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),c(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),h(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),u(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),d(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),p(...e)},e.customElementCb=(...e)=>{t.customElement&&t.customElement(...e),f(...e)}}(e,t),e.recordDOM&&(s=vc(e,e.doc));const n=function({mousemoveCb:e,sampling:t,doc:r,mirror:s}){if(!1===t.mousemove)return()=>{};const n="number"==typeof t.mousemove?t.mousemove:50,o="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let i,a=[];const l=Fl(gc(t=>{const r=Date.now()-i;e(a.map(e=>(e.timeOffset-=r,e)),t),a=[],i=null}),o),c=gc(Fl(gc(e=>{const t=wc(e),{clientX:r,clientY:n}=Zl(e)?e.changedTouches[0]:e;i||(i=_l()),a.push({x:r,y:n,id:s.getId(t),timeOffset:_l()-i}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?tc.Drag:e instanceof MouseEvent?tc.MouseMove:tc.TouchMove)}),n,{trailing:!1})),h=[Dl("mousemove",c,r),Dl("touchmove",c,r),Dl("drag",c,r)];return gc(()=>{h.forEach(e=>e())})}(e),o=bc(e),i=Sc(e),a=function({viewportResizeCb:e},{win:t}){let r=-1,s=-1;return Dl("resize",gc(Fl(gc(()=>{const t=Wl(),n=zl();r===t&&s===n||(e({width:Number(n),height:Number(t)}),r=t,s=n)}),200)),t)}(e,{win:r}),l=function({inputCb:e,doc:t,mirror:r,blockClass:s,blockSelector:n,ignoreClass:o,ignoreSelector:i,maskInputOptions:a,maskInputFn:l,sampling:c,userTriggeredOnInput:h}){function u(e){let r=wc(e);const c=e.isTrusted,u=r&&r.tagName;if(r&&"OPTION"===u&&(r=Tl.parentElement(r)),!r||!u||Cc.indexOf(u)<0||Vl(r,s,n,!0))return;if(r.classList.contains(o)||i&&r.matches(i))return;let p=r.value,f=!1;const m=fe(r)||"";"radio"===m||"checkbox"===m?f=r.checked:(a[u.toLowerCase()]||a[m])&&(p=ue({element:r,maskInputOptions:a,tagName:u,type:m,value:p,maskInputFn:l})),d(r,h?{text:p,isChecked:f,userTriggered:c}:{text:p,isChecked:f});const g=r.name;"radio"===m&&g&&f&&t.querySelectorAll(`input[type="radio"][name="${g}"]`).forEach(e=>{if(e!==r){const t=e.value;d(e,h?{text:t,isChecked:!f,userTriggered:!1}:{text:t,isChecked:!f})}})}function d(t,s){const n=kc.get(t);if(!n||n.text!==s.text||n.isChecked!==s.isChecked){kc.set(t,s);const n=r.getId(t);gc(e)({...s,id:n})}}const p=("last"===c.input?["change"]:["input","change"]).map(e=>Dl(e,gc(u),t)),f=t.defaultView;if(!f)return()=>{p.forEach(e=>e())};const m=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),g=[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&p.push(...g.map(e=>Pl(e[0],e[1],{set(){gc(u)({target:this,isTrusted:!1})}},!1,f))),gc(()=>{p.forEach(e=>e())})}(e),c=function({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:s,sampling:n,doc:o}){const i=gc(o=>Fl(gc(n=>{const i=wc(n);if(!i||Vl(i,t,r,!0))return;const{currentTime:a,volume:l,muted:c,playbackRate:h,loop:u}=i;e({type:o,id:s.getId(i),currentTime:a,volume:l,muted:c,playbackRate:h,loop:u})}),n.media||500)),a=[Dl("play",i(oc.Play),o),Dl("pause",i(oc.Pause),o),Dl("seeked",i(oc.Seeked),o),Dl("volumechange",i(oc.VolumeChange),o),Dl("ratechange",i(oc.RateChange),o)];return gc(()=>{a.forEach(e=>e())})}(e);let h=()=>{},u=()=>{},d=()=>{},p=()=>{};e.recordDOM&&(h=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:s}){if(!s.CSSStyleSheet||!s.CSSStyleSheet.prototype)return()=>{};const n=s.CSSStyleSheet.prototype.insertRule;s.CSSStyleSheet.prototype.insertRule=new Proxy(n,{apply:gc((s,n,o)=>{const[i,a]=o,{id:l,styleId:c}=xc(n,t,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:i,index:a}]}),s.apply(n,o)})}),s.CSSStyleSheet.prototype.addRule=function(e,t,r=this.cssRules.length){const n=`${e} { ${t} }`;return s.CSSStyleSheet.prototype.insertRule.apply(this,[n,r])};const o=s.CSSStyleSheet.prototype.deleteRule;let i,a;s.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:gc((s,n,o)=>{const[i]=o,{id:a,styleId:l}=xc(n,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:i}]}),s.apply(n,o)})}),s.CSSStyleSheet.prototype.removeRule=function(e){return s.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},s.CSSStyleSheet.prototype.replace&&(i=s.CSSStyleSheet.prototype.replace,s.CSSStyleSheet.prototype.replace=new Proxy(i,{apply:gc((s,n,o)=>{const[i]=o,{id:a,styleId:l}=xc(n,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replace:i}),s.apply(n,o)})})),s.CSSStyleSheet.prototype.replaceSync&&(a=s.CSSStyleSheet.prototype.replaceSync,s.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:gc((s,n,o)=>{const[i]=o,{id:a,styleId:l}=xc(n,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replaceSync:i}),s.apply(n,o)})}));const l={};Rc("CSSGroupingRule")?l.CSSGroupingRule=s.CSSGroupingRule:(Rc("CSSMediaRule")&&(l.CSSMediaRule=s.CSSMediaRule),Rc("CSSConditionRule")&&(l.CSSConditionRule=s.CSSConditionRule),Rc("CSSSupportsRule")&&(l.CSSSupportsRule=s.CSSSupportsRule));const c={};return Object.entries(l).forEach(([s,n])=>{c[s]={insertRule:n.prototype.insertRule,deleteRule:n.prototype.deleteRule},n.prototype.insertRule=new Proxy(c[s].insertRule,{apply:gc((s,n,o)=>{const[i,a]=o,{id:l,styleId:c}=xc(n.parentStyleSheet,t,r.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:i,index:[...Ic(n),a||0]}]}),s.apply(n,o)})}),n.prototype.deleteRule=new Proxy(c[s].deleteRule,{apply:gc((s,n,o)=>{const[i]=o,{id:a,styleId:l}=xc(n.parentStyleSheet,t,r.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:[...Ic(n),i]}]}),s.apply(n,o)})})}),gc(()=>{s.CSSStyleSheet.prototype.insertRule=n,s.CSSStyleSheet.prototype.deleteRule=o,i&&(s.CSSStyleSheet.prototype.replace=i),a&&(s.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach(([e,t])=>{t.prototype.insertRule=c[e].insertRule,t.prototype.deleteRule=c[e].deleteRule})})}(e,{win:r}),u=Oc(e,e.doc),d=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:s},{win:n}){const o=n.CSSStyleDeclaration.prototype.setProperty;n.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:gc((n,i,a)=>{var l;const[c,h,u]=a;if(r.has(c))return o.apply(i,[c,h,u]);const{id:d,styleId:p}=xc(null==(l=i.parentRule)?void 0:l.parentStyleSheet,t,s.styleMirror);return(d&&-1!==d||p&&-1!==p)&&e({id:d,styleId:p,set:{property:c,value:h,priority:u},index:Ic(i.parentRule)}),n.apply(i,a)})});const i=n.CSSStyleDeclaration.prototype.removeProperty;return n.CSSStyleDeclaration.prototype.removeProperty=new Proxy(i,{apply:gc((n,o,a)=>{var l;const[c]=a;if(r.has(c))return i.apply(o,[c]);const{id:h,styleId:u}=xc(null==(l=o.parentRule)?void 0:l.parentStyleSheet,t,s.styleMirror);return(h&&-1!==h||u&&-1!==u)&&e({id:h,styleId:u,remove:{property:c},index:Ic(o.parentRule)}),n.apply(o,a)})}),gc(()=>{n.CSSStyleDeclaration.prototype.setProperty=o,n.CSSStyleDeclaration.prototype.removeProperty=i})}(e,{win:r}),e.collectFonts&&(p=function({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const s=[],n=new WeakMap,o=r.FontFace;r.FontFace=function(e,t,r){const s=new o(e,t,r);return n.set(s,{family:e,buffer:"string"!=typeof t,descriptors:r,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),s};const i=Bl(t.fonts,"add",function(t){return function(r){return setTimeout(gc(()=>{const t=n.get(r);t&&(e(t),n.delete(r))}),0),t.apply(this,[r])}});return s.push(()=>{r.FontFace=o}),s.push(i),gc(()=>{s.forEach(e=>e())})}(e)));const f=function(e){const{doc:t,mirror:r,blockClass:s,blockSelector:n,selectionCb:o}=e;let i=!0;const a=gc(()=>{const e=t.getSelection();if(!e||i&&(null==e?void 0:e.isCollapsed))return;i=e.isCollapsed||!1;const a=[],l=e.rangeCount||0;for(let t=0;t<l;t++){const o=e.getRangeAt(t),{startContainer:i,startOffset:l,endContainer:c,endOffset:h}=o;Vl(i,s,n,!0)||Vl(c,s,n,!0)||a.push({start:r.getId(i),startOffset:l,end:r.getId(c),endOffset:h})}o({ranges:a})});return a(),Dl("selectionchange",a)}(e),m=function({doc:e,customElementCb:t}){const r=e.defaultView;return r&&r.customElements?Bl(r.customElements,"define",function(e){return function(r,s,n){try{t({define:{name:r}})}catch(e){console.warn(`Custom element callback failed for ${r}`)}return e.apply(this,[r,s,n])}}):()=>{}}(e),g=[];for(const t of e.plugins)g.push(t.observer(t.callback,r,t.options));return gc(()=>{yc.forEach(e=>e.reset()),null==s||s.disconnect(),n(),o(),i(),a(),l(),c(),h(),u(),d(),p(),f(),m(),g.forEach(e=>e())})}function Ec(e){return void 0!==window[e]}function Rc(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Ac{constructor(e){Z(this,"iframeIdToRemoteIdMap",new WeakMap),Z(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,s){const n=r||this.getIdToRemoteIdMap(e),o=s||this.getRemoteIdToIdMap(e);let i=n.get(t);return i||(i=this.generateIdFn(),n.set(t,i),o.set(i,t)),i}getIds(e,t){const r=this.getIdToRemoteIdMap(e),s=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,r,s))}getRemoteId(e,t,r){const s=r||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const n=s.get(t);return n||-1}getRemoteIds(e,t){const r=this.getRemoteIdToIdMap(e);return t.map(t=>this.getRemoteId(e,t,r))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class Tc{constructor(e){Z(this,"iframes",new WeakMap),Z(this,"crossOriginIframeMap",new WeakMap),Z(this,"crossOriginIframeMirror",new Ac(xe)),Z(this,"crossOriginIframeStyleMirror"),Z(this,"crossOriginIframeRootIdMap",new WeakMap),Z(this,"mirror"),Z(this,"mutationCb"),Z(this,"wrappedEmit"),Z(this,"loadListener"),Z(this,"stylesheetManager"),Z(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Ac(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var r,s;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(r=e.contentWindow)||r.addEventListener("message",this.handleMessage.bind(this))),null==(s=this.loadListener)||s.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const t=e;if("rrweb"!==t.data.type||t.origin!==t.data.origin)return;if(!e.source)return;const r=this.crossOriginIframeMap.get(e.source);if(!r)return;const s=this.transformCrossOriginEvent(r,t.data.event);s&&this.wrappedEmit(s,t.data.isCheckout)}transformCrossOriginEvent(e,t){var r;switch(t.type){case ec.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const r=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,r),this.patchRootIdOnNode(t.data.node,r),{timestamp:t.timestamp,type:ec.IncrementalSnapshot,data:{source:tc.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case ec.Meta:case ec.Load:case ec.DomContentLoaded:return!1;case ec.Plugin:return t;case ec.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case ec.IncrementalSnapshot:switch(t.data.source){case tc.Mutation:return t.data.adds.forEach(t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);const r=this.crossOriginIframeRootIdMap.get(e);r&&this.patchRootIdOnNode(t.node,r)}),t.data.removes.forEach(t=>{this.replaceIds(t,e,["parentId","id"])}),t.data.attributes.forEach(t=>{this.replaceIds(t,e,["id"])}),t.data.texts.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case tc.Drag:case tc.TouchMove:case tc.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case tc.ViewportResize:return!1;case tc.MediaInteraction:case tc.MouseInteraction:case tc.Scroll:case tc.CanvasMutation:case tc.Input:return this.replaceIds(t.data,e,["id"]),t;case tc.StyleSheetRule:case tc.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case tc.Font:return t;case tc.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case tc.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(r=t.data.styles)||r.forEach(t=>{this.replaceStyleIds(t,e,["styleId"])}),t}}return!1}replace(e,t,r,s){for(const n of s)(Array.isArray(t[n])||"number"==typeof t[n])&&(Array.isArray(t[n])?t[n]=e.getIds(r,t[n]):t[n]=e.getId(r,t[n]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(e=>{this.replaceIdOnNode(e,t)})}patchRootIdOnNode(e,t){e.type===ic.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}}class Dc{constructor(e){Z(this,"shadowDoms",new WeakSet),Z(this,"mutationCb"),Z(this,"scrollCb"),Z(this,"bypassOptions"),Z(this,"mirror"),Z(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!ae(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=vc({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(Sc({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(Tl.host(e))),this.restoreHandlers.push(Oc({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){const r=this;this.restoreHandlers.push(Bl(e.prototype,"attachShadow",function(e){return function(s){const n=e.call(this,s),o=Tl.shadowRoot(this);return o&&Ql(this)&&r.addShadowRoot(o,t),n}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(e){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var Nc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Lc="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Fc=0;Fc<64;Fc++)Lc[Nc.charCodeAt(Fc)]=Fc;const Pc=new Map;const Bc=(e,t,r)=>{if(!e||!Wc(e,t)&&"object"!=typeof e)return;const s=function(e,t){let r=Pc.get(e);return r||(r=new Map,Pc.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}(r,e.constructor.name);let n=s.indexOf(e);return-1===n&&(n=s.length,s.push(e)),n};function _c(e,t,r){if(e instanceof Array)return e.map(e=>_c(e,t,r));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray){return{rr_type:e.constructor.name,args:[Object.values(e)]}}if(e instanceof ArrayBuffer){return{rr_type:e.constructor.name,base64:function(e){var t,r=new Uint8Array(e),s=r.length,n="";for(t=0;t<s;t+=3)n+=Nc[r[t]>>2],n+=Nc[(3&r[t])<<4|r[t+1]>>4],n+=Nc[(15&r[t+1])<<2|r[t+2]>>6],n+=Nc[63&r[t+2]];return s%3==2?n=n.substring(0,n.length-1)+"=":s%3==1&&(n=n.substring(0,n.length-2)+"=="),n}(e)}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[_c(e.buffer,t,r),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:r}=e;return{rr_type:t,src:r}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[_c(e.data,t,r),e.width,e.height]}}if(Wc(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:Bc(e,t,r)}}return e}const Uc=(e,t,r)=>e.map(e=>_c(e,t,r)),Wc=(e,t)=>{const r=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(e=>"function"==typeof t[e]);return Boolean(r.find(r=>e instanceof t[r]))};function zc(e,t,r,s){const n=[];try{const o=Bl(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(n,...o){if(!Vl(this,t,r,!0)){const e=function(e){return"experimental-webgl"===e?"webgl":e}(n);if("__context"in this||(this.__context=e),s&&["webgl","webgl2"].includes(e))if(o[0]&&"object"==typeof o[0]){const e=o[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[n,...o])}});n.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach(e=>e())}}function jc(e,t,r,s,n,o){const i=[],a=Object.getOwnPropertyNames(e);for(const l of a)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if("function"!=typeof e[l])continue;const a=Bl(e,l,function(e){return function(...i){const a=e.apply(this,i);if(Bc(a,o,this),"tagName"in this.canvas&&!Vl(this.canvas,s,n,!0)){const e=Uc(i,o,this),s={type:t,property:l,args:e};r(this.canvas,s)}return a}});i.push(a)}catch{const s=Pl(e,l,{set(e){r(this.canvas,{type:t,property:l,args:[e],setter:!0})}});i.push(s)}return i}const Vc="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Gc="undefined"!=typeof window&&window.Blob&&new Blob([(Yc=Vc,Uint8Array.from(atob(Yc),e=>e.charCodeAt(0)))],{type:"text/javascript;charset=utf-8"});var Yc;function Zc(e){let t;try{if(t=Gc&&(window.URL||window.webkitURL).createObjectURL(Gc),!t)throw"";const r=new Worker(t,{name:null==e?void 0:e.name});return r.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(t)}),r}catch(t){return new Worker("data:text/javascript;base64,"+Vc,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class Hc{constructor(e){Z(this,"pendingCanvasMutations",new Map),Z(this,"rafStamps",{latestId:0,invokeId:null}),Z(this,"mirror"),Z(this,"mutationCb"),Z(this,"resetObservers"),Z(this,"frozen",!1),Z(this,"locked",!1),Z(this,"processMutation",(e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)});const{sampling:t="all",win:r,blockClass:s,blockSelector:n,recordCanvas:o,dataURLOptions:i}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&"all"===t&&this.initCanvasMutationObserver(r,s,n),o&&"number"==typeof t&&this.initCanvasFPSObserver(t,r,s,n,{dataURLOptions:i})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,r,s,n){const o=zc(t,r,s,!0),i=new Map,a=new Zc;a.onmessage=e=>{const{id:t}=e.data;if(i.set(t,!1),!("base64"in e.data))return;const{base64:r,type:s,width:n,height:o}=e.data;this.mutationCb({id:t,type:nc["2D"],commands:[{property:"clearRect",args:[0,0,n,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:s}]},0,0]}]})};const l=1e3/e;let c,h=0;const u=e=>{h&&e-h<l||(h=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach(t=>{Vl(t,r,s,!0)||e.push(t)}),e})().forEach(async e=>{var t;const r=this.mirror.getId(e);if(i.get(r))return;if(0===e.width||0===e.height)return;if(i.set(r,!0),["webgl","webgl2"].includes(e.__context)){const r=e.getContext(e.__context);!1===(null==(t=null==r?void 0:r.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&r.clear(r.COLOR_BUFFER_BIT)}const s=await createImageBitmap(e);a.postMessage({id:r,bitmap:s,width:e.width,height:e.height,dataURLOptions:n.dataURLOptions},[s])})),c=requestAnimationFrame(u)};c=requestAnimationFrame(u),this.resetObservers=()=>{o(),cancelAnimationFrame(c)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const s=zc(e,t,r,!1),n=function(e,t,r,s){const n=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const i of o)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[i])continue;const o=Bl(t.CanvasRenderingContext2D.prototype,i,function(n){return function(...o){return Vl(this.canvas,r,s,!0)||setTimeout(()=>{const r=Uc(o,t,this);e(this.canvas,{type:nc["2D"],property:i,args:r})},0),n.apply(this,o)}});n.push(o)}catch{const r=Pl(t.CanvasRenderingContext2D.prototype,i,{set(t){e(this.canvas,{type:nc["2D"],property:i,args:[t],setter:!0})}});n.push(r)}return()=>{n.forEach(e=>e())}}(this.processMutation.bind(this),e,t,r),o=function(e,t,r,s){const n=[];return n.push(...jc(t.WebGLRenderingContext.prototype,nc.WebGL,e,r,s,t)),void 0!==t.WebGL2RenderingContext&&n.push(...jc(t.WebGL2RenderingContext.prototype,nc.WebGL2,e,r,s,t)),()=>{n.forEach(e=>e())}}(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{s(),n(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{const r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const r=this.pendingCanvasMutations.get(e);if(!r||-1===t)return;const s=r.map(e=>{const{type:t,...r}=e;return r}),{type:n}=r[0];this.mutationCb({id:t,type:n,commands:s}),this.pendingCanvasMutations.delete(e)}}class Xc{constructor(e){Z(this,"trackedLinkElements",new WeakSet),Z(this,"mutationCb"),Z(this,"adoptedStyleSheetCb"),Z(this,"styleMirror",new $l),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const r={id:t,styleIds:[]},s=[];for(const t of e){let e;this.styleMirror.has(t)?e=this.styleMirror.getId(t):(e=this.styleMirror.add(t),s.push({styleId:e,rules:Array.from(t.rules||CSSRule,(e,r)=>({rule:ce(e,t.href),index:r}))})),r.styleIds.push(e)}s.length>0&&(r.styles=s),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class Jc{constructor(){Z(this,"nodeMap",new WeakMap),Z(this,"active",!1)}inOtherBuffer(e,t){const r=this.nodeMap.get(e);return r&&Array.from(r).some(e=>e!==t)}add(e,t){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}let $c,Kc,qc,Qc=!1;try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(G=e.contentWindow)?void 0:G.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const eh=new he;function th(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:s,blockClass:n="rr-block",blockSelector:o=null,ignoreClass:i="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:c=null,inlineStylesheet:h=!0,maskAllInputs:u,maskInputOptions:d,slimDOMOptions:p,maskInputFn:f,maskTextFn:m,hooks:g,packFn:y,sampling:w={},dataURLOptions:v={},mousemoveWait:b,recordDOM:S=!0,recordCanvas:C=!1,recordCrossOriginIframes:k=!1,recordAfter:I=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:x=!1,collectFonts:O=!1,inlineImages:M=!1,plugins:E,keepIframeSrcFn:R=()=>!1,ignoreCSSAttributes:A=new Set([]),errorHandler:T}=e;mc=T;const D=!k||window.parent===window;let N=!1;if(!D)try{window.parent.document&&(N=!1)}catch(e){N=!0}if(D&&!t)throw new Error("emit function is required");if(!D&&!N)return()=>{};void 0!==b&&void 0===w.mousemove&&(w.mousemove=b),eh.reset();const L=!0===u?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==d?d:{password:!0},F=!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===p,headMetaDescKeywords:"all"===p,headTitleMutations:"all"===p}:p||{};let P;!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();let B=0;const _=e=>{for(const t of E||[])t.eventProcessor&&(e=t.eventProcessor(e));return y&&!N&&(e=y(e)),e};$c=(e,n)=>{var o;const i=e;if(i.timestamp=_l(),!(null==(o=yc[0])?void 0:o.isFrozen())||i.type===ec.FullSnapshot||i.type===ec.IncrementalSnapshot&&i.data.source===tc.Mutation||yc.forEach(e=>e.unfreeze()),D)null==t||t(_(i),n);else if(N){const e={type:"rrweb",event:_(i),origin:window.location.origin,isCheckout:n};window.parent.postMessage(e,"*")}if(i.type===ec.FullSnapshot)P=i,B=0;else if(i.type===ec.IncrementalSnapshot){if(i.data.source===tc.Mutation&&i.data.isAttachIframe)return;B++;const e=s&&B>=s,t=r&&i.timestamp-P.timestamp>r;(e||t)&&Kc(!0)}};const U=e=>{$c({type:ec.IncrementalSnapshot,data:{source:tc.Mutation,...e}})},W=e=>$c({type:ec.IncrementalSnapshot,data:{source:tc.Scroll,...e}}),z=e=>$c({type:ec.IncrementalSnapshot,data:{source:tc.CanvasMutation,...e}}),j=new Xc({mutationCb:U,adoptedStyleSheetCb:e=>$c({type:ec.IncrementalSnapshot,data:{source:tc.AdoptedStyleSheet,...e}})}),V=new Tc({mirror:eh,mutationCb:U,stylesheetManager:j,recordCrossOriginIframes:k,wrappedEmit:$c});for(const e of E||[])e.getMirror&&e.getMirror({nodeMirror:eh,crossOriginIframeMirror:V.crossOriginIframeMirror,crossOriginIframeStyleMirror:V.crossOriginIframeStyleMirror});const G=new Jc;qc=new Hc({recordCanvas:C,mutationCb:z,win:window,blockClass:n,blockSelector:o,mirror:eh,sampling:w.canvas,dataURLOptions:v});const Y=new Dc({mutationCb:U,scrollCb:W,bypassOptions:{blockClass:n,blockSelector:o,maskTextClass:l,maskTextSelector:c,inlineStylesheet:h,maskInputOptions:L,dataURLOptions:v,maskTextFn:m,maskInputFn:f,recordCanvas:C,inlineImages:M,sampling:w,slimDOMOptions:F,iframeManager:V,stylesheetManager:j,canvasManager:qc,keepIframeSrcFn:R,processedNodeManager:G},mirror:eh});Kc=(e=!1)=>{if(!S)return;$c({type:ec.Meta,data:{href:window.location.href,width:zl(),height:Wl()}},e),j.reset(),Y.init(),yc.forEach(e=>e.lock());const t=function(e,t){const{mirror:r=new he,blockClass:s="rr-block",blockSelector:n=null,maskTextClass:o="rr-mask",maskTextSelector:i=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:c=!1,maskAllInputs:h=!1,maskTextFn:u,maskInputFn:d,slimDOM:p=!1,dataURLOptions:f,preserveWhiteSpace:m,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:w,onStylesheetLoad:v,stylesheetLoadTimeout:b,keepIframeSrcFn:S=()=>!1}=t||{};return We(e,{doc:e,mirror:r,blockClass:s,blockSelector:n,maskTextClass:o,maskTextSelector:i,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===h?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===h?{password:!0}:h,maskTextFn:u,maskInputFn:d,slimDOMOptions:!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===p,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===p?{}:p,dataURLOptions:f,inlineImages:l,recordCanvas:c,preserveWhiteSpace:m,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:w,onStylesheetLoad:v,stylesheetLoadTimeout:b,keepIframeSrcFn:S,newlyAddedElement:!1})}(document,{mirror:eh,blockClass:n,blockSelector:o,maskTextClass:l,maskTextSelector:c,inlineStylesheet:h,maskAllInputs:L,maskTextFn:m,maskInputFn:f,slimDOM:F,dataURLOptions:v,recordCanvas:C,inlineImages:M,onSerialize:e=>{Hl(e,eh)&&V.addIframe(e),Xl(e,eh)&&j.trackLinkElement(e),Jl(e)&&Y.addShadowRoot(Tl.shadowRoot(e),document)},onIframeLoad:(e,t)=>{V.attachIframe(e,t),Y.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{j.attachLinkElement(e,t)},keepIframeSrcFn:R});if(!t)return console.warn("Failed to snapshot the document");$c({type:ec.FullSnapshot,data:{node:t,initialOffset:Ul(window)}},e),yc.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&j.adoptStyleSheets(document.adoptedStyleSheets,eh.getId(document))};try{const e=[],t=e=>{var t;return gc(Mc)({mutationCb:U,mousemoveCb:(e,t)=>$c({type:ec.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>$c({type:ec.IncrementalSnapshot,data:{source:tc.MouseInteraction,...e}}),scrollCb:W,viewportResizeCb:e=>$c({type:ec.IncrementalSnapshot,data:{source:tc.ViewportResize,...e}}),inputCb:e=>$c({type:ec.IncrementalSnapshot,data:{source:tc.Input,...e}}),mediaInteractionCb:e=>$c({type:ec.IncrementalSnapshot,data:{source:tc.MediaInteraction,...e}}),styleSheetRuleCb:e=>$c({type:ec.IncrementalSnapshot,data:{source:tc.StyleSheetRule,...e}}),styleDeclarationCb:e=>$c({type:ec.IncrementalSnapshot,data:{source:tc.StyleDeclaration,...e}}),canvasMutationCb:z,fontCb:e=>$c({type:ec.IncrementalSnapshot,data:{source:tc.Font,...e}}),selectionCb:e=>{$c({type:ec.IncrementalSnapshot,data:{source:tc.Selection,...e}})},customElementCb:e=>{$c({type:ec.IncrementalSnapshot,data:{source:tc.CustomElement,...e}})},blockClass:n,ignoreClass:i,ignoreSelector:a,maskTextClass:l,maskTextSelector:c,maskInputOptions:L,inlineStylesheet:h,sampling:w,recordDOM:S,recordCanvas:C,inlineImages:M,userTriggeredOnInput:x,collectFonts:O,doc:e,maskInputFn:f,maskTextFn:m,keepIframeSrcFn:R,blockSelector:o,slimDOMOptions:F,dataURLOptions:v,mirror:eh,iframeManager:V,stylesheetManager:j,shadowDomManager:Y,processedNodeManager:G,canvasManager:qc,ignoreCSSAttributes:A,plugins:(null==(t=null==E?void 0:E.filter(e=>e.observer))?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>$c({type:ec.Plugin,data:{plugin:e.name,payload:t}})})))||[]},g)};V.addLoadListener(r=>{try{e.push(t(r.contentDocument))}catch(e){console.warn(e)}});const r=()=>{Kc(),e.push(t(document)),Qc=!0};return"interactive"===document.readyState||"complete"===document.readyState?r():(e.push(Dl("DOMContentLoaded",()=>{$c({type:ec.DomContentLoaded,data:{}}),"DOMContentLoaded"===I&&r()})),e.push(Dl("load",()=>{$c({type:ec.Load,data:{}}),"load"===I&&r()},window))),()=>{e.forEach(e=>e()),G.destroy(),Qc=!1,mc=void 0}}catch(e){console.warn(e)}}var rh,sh;th.addCustomEvent=(e,t)=>{if(!Qc)throw new Error("please add custom event after start recording");$c({type:ec.Custom,data:{tag:e,payload:t}})},th.freezePage=()=>{yc.forEach(e=>e.freeze())},th.takeFullSnapshot=e=>{if(!Qc)throw new Error("please take full snapshot after start recording");Kc(e)},th.mirror=eh,(sh=rh||(rh={}))[sh.NotStarted=0]="NotStarted",sh[sh.Running=1]="Running",sh[sh.Stopped=2]="Stopped";class nh{constructor(e,t,r){this.stopFn=null,this.events=[],this.onEventsReady=null,this.flushInterval=null,this.hasFullSnapshot=!1,this.sessionId=e,this.config=t,this.onEventsReady=r}start(){if(this.config.enabled)if(this.stopFn)console.warn("[RRWeb] Recording already started");else try{console.log("[RRWeb] Starting session recording:",this.sessionId),console.log("[RRWeb] SDK Version: 1.0.10"),this.stopFn=th({emit:e=>{this.hasFullSnapshot||console.log("[RRWeb] Event captured:",{type:e.type,timestamp:e.timestamp,hasData:!!e.data}),this.events.push(e),2===e.type?(this.hasFullSnapshot=!0,console.log("[RRWeb] ✅ FullSnapshot captured! Sending immediately..."),console.log("[RRWeb] FullSnapshot data keys:",Object.keys(e.data||{})),this.flush()):this.hasFullSnapshot&&this.events.length>=50&&this.flush()},sampling:{mousemove:void 0===this.config.sampleRate||Math.floor(100/this.config.sampleRate),mouseInteraction:!0,scroll:150,media:800,input:"last"},checkoutEveryNms:this.config.checkoutEveryNms||3e5,checkoutEveryNth:this.config.checkoutEveryNth||200,blockClass:this.config.blockClass||"rr-block",ignoreClass:this.config.ignoreClass||"rr-ignore",maskAllInputs:void 0===this.config.maskAllInputs||this.config.maskAllInputs,maskInputOptions:this.config.maskInputOptions||{password:!0,email:!0,tel:!0},maskTextClass:"rr-mask",inlineStylesheet:void 0===this.config.inlineStylesheet||this.config.inlineStylesheet,recordCanvas:this.config.recordCanvas||!1,collectFonts:void 0===this.config.collectFonts||this.config.collectFonts,recordCrossOriginIframes:!1}),this.flushInterval=window.setInterval(()=>{this.hasFullSnapshot&&this.events.length>0&&this.flush()},1e4),setTimeout(()=>{this.hasFullSnapshot||(console.warn("[RRWeb] ⚠️ No FullSnapshot captured after 3 seconds!"),console.warn("[RRWeb] Events captured so far:",this.events.length),console.warn("[RRWeb] Event types:",this.events.map(e=>e.type)),console.warn("[RRWeb] This may indicate an rrweb initialization issue."),this.events.length>0&&(console.warn("[RRWeb] Flushing events WITHOUT FullSnapshot - replay may not work!"),this.hasFullSnapshot=!0,this.flush()))},3e3),console.log("[RRWeb] Recording started successfully")}catch(e){console.error("[RRWeb] Failed to start recording:",e)}else console.log("[RRWeb] Recording disabled in config")}stop(){this.stopFn&&(this.stopFn(),this.stopFn=null,console.log("[RRWeb] Recording stopped")),this.flushInterval&&(clearInterval(this.flushInterval),this.flushInterval=null),this.events.length>0&&(this.hasFullSnapshot||console.warn("[RRWeb] Flushing events without FullSnapshot - recording may not replay correctly"),this.flush())}flush(){if(0===this.events.length)return;const e=[...this.events];this.events=[];const t={};e.forEach(e=>{t[e.type]=(t[e.type]||0)+1}),console.log("[RRWeb] Flushing events:",t),this.onEventsReady&&this.onEventsReady(e)}getEventCount(){return this.events.length}isRecording(){return null!==this.stopFn}}class oh{constructor(e){this.config=e,this.queue=[],this.flushInterval=null,this.maxQueueSize=50,this.flushIntervalMs=5e3,this.apiUrl=e.apiUrl||"https://api.devskin.com",this.startPeriodicFlush(),"undefined"!=typeof window&&(window.addEventListener("beforeunload",()=>{this.flush()}),window.addEventListener("visibilitychange",()=>{document.hidden&&this.flush(!0)}))}sendEvent(e){this.enqueue("event",e)}identifyUser(e){this.sendToBackend("/v1/analytics/identify",e)}startSession(e){this.sendToBackend("/v1/analytics/session",e)}sendError(e){this.enqueue("error",e)}sendNetworkRequest(e){this.enqueue("network",e)}sendPerformanceMetric(e){this.enqueue("performance",e)}sendRecordingEvents(e,r){return t(this,void 0,void 0,function*(){const t=r.reduce((e,t)=>(e[t.type]=(e[t.type]||0)+1,e),{});console.log(`[DevSkin SDK] Sending ${r.length} recording events:`,t),console.log("[DevSkin SDK] First 3 events:",r.slice(0,3).map(e=>({type:e.type,timestamp:e.timestamp})));try{yield this.sendToBackend("/v1/rum/recordings",{session_id:e,events:r,timestamp:(new Date).toISOString()}),console.log("[DevSkin SDK] ✅ Recording events sent successfully")}catch(e){console.error("[DevSkin SDK] ❌ Failed to send recording events:",e)}})}sendHeatmapData(e){this.enqueue("heatmap",e)}flush(e=!1){if(0===this.queue.length)return;const t=[...this.queue];this.queue=[];const r={};t.forEach(e=>{r[e.type]||(r[e.type]=[]),r[e.type].push(e.data)}),Object.entries(r).forEach(([t,r])=>{const s=this.getEndpointForType(t);this.sendToBackend(s,{[t+"s"]:r},e)}),this.config.debug&&console.log(`[DevSkin] Flushed ${t.length} items to backend`)}enqueue(e,t){this.queue.push({type:e,data:t,timestamp:Date.now()}),this.queue.length>=this.maxQueueSize&&this.flush()}startPeriodicFlush(){this.flushInterval=setInterval(()=>{this.flush()},this.flushIntervalMs)}getEndpointForType(e){switch(e){case"event":default:return"/v1/analytics/events";case"error":return"/v1/analytics/errors";case"network":return"/v1/analytics/network";case"performance":return"/v1/analytics/performance";case"heatmap":return"/v1/analytics/heatmap"}}sendToBackend(e,r){return t(this,arguments,void 0,function*(e,t,r=!1){const s=`${this.apiUrl}${e}`,n=Object.assign(Object.assign({},t),{apiKey:this.config.apiKey,appId:this.config.appId,environment:this.config.environment,release:this.config.release});if(this.config.beforeSend){if(!this.config.beforeSend(n))return}if(r&&navigator.sendBeacon){const e=new Blob([JSON.stringify(n)],{type:"application/json"});return void navigator.sendBeacon(s,e)}try{const t=yield fetch(s,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.config.apiKey}`},body:JSON.stringify(n),keepalive:!0});if(!t.ok){const e=yield t.text();throw console.error("[DevSkin] HTTP Error:",t.status,e),new Error(`HTTP ${t.status}: ${t.statusText}`)}this.config.debug&&console.log("[DevSkin] Data sent successfully:",e)}catch(t){throw console.error("[DevSkin] Failed to send data to",e,":",t),t}})}destroy(){this.flushInterval&&(clearInterval(this.flushInterval),this.flushInterval=null),this.flush()}}const ih=new class{constructor(){this.config=null,this.transport=null,this.sessionId=null,this.userId=null,this.anonymousId=null,this.sessionStartTime=0,this.initialized=!1,this.deviceCollector=null,this.locationCollector=null,this.browserCollector=null,this.performanceCollector=null,this.errorCollector=null,this.networkCollector=null,this.heatmapCollector=null,this.rrwebRecorder=null}init(t){var n,o;this.initialized?console.warn("[DevSkin] SDK already initialized"):(this.config=Object.assign({debug:!1,captureWebVitals:!0,captureNetworkRequests:!0,captureErrors:!0,captureUserAgent:!0,captureLocation:!0,captureDevice:!0},t),this.config.debug&&console.log("[DevSkin] Initializing SDK with config:",this.config),this.transport=new oh(this.config),this.anonymousId=this.getOrCreateAnonymousId(),this.deviceCollector=new e(this.config),this.locationCollector=new r(this.config),this.browserCollector=new s(this.config),this.startSession(),this.config.captureWebVitals&&(this.performanceCollector=new W(this.config,this.transport),this.performanceCollector.start()),this.config.captureErrors&&(this.errorCollector=new z(this.config,this.transport),this.errorCollector.start()),this.config.captureNetworkRequests&&(this.networkCollector=new j(this.config,this.transport),this.networkCollector.start()),(null===(n=this.config.heatmapOptions)||void 0===n?void 0:n.enabled)&&(this.heatmapCollector=new V(this.config,this.transport),this.heatmapCollector.start()),(null===(o=this.config.sessionRecording)||void 0===o?void 0:o.enabled)&&(this.rrwebRecorder=new nh(this.sessionId,{enabled:!0,sampleRate:this.config.sessionRecording.sampling||.5,blockClass:"rr-block",ignoreClass:this.config.sessionRecording.ignoreClass||"rr-ignore",maskAllInputs:void 0===this.config.sessionRecording.maskAllInputs||this.config.sessionRecording.maskAllInputs,maskInputOptions:{password:!0,email:!0,tel:!0},recordCanvas:this.config.sessionRecording.recordCanvas||!1,collectFonts:!0,inlineStylesheet:!0,checkoutEveryNms:3e5,checkoutEveryNth:200},e=>{var t;null===(t=this.transport)||void 0===t||t.sendRecordingEvents(this.sessionId,e)}),this.rrwebRecorder.start(),this.config.debug&&console.log("[DevSkin] RRWeb recording started for session:",this.sessionId)),this.trackPageView(),this.setupVisibilityTracking(),this.setupUnloadTracking(),this.initialized=!0,this.config.debug&&console.log("[DevSkin] SDK initialized successfully"))}track(e,t){var r,s;if(!this.initialized)return void console.warn("[DevSkin] SDK not initialized. Call init() first.");const n={event_name:e,event_type:"track",timestamp:(new Date).toISOString(),session_id:this.sessionId,user_id:this.userId||void 0,anonymous_id:this.anonymousId||void 0,properties:Object.assign(Object.assign({},t),this.getContextData()),page_url:window.location.href,page_title:document.title};null===(r=this.transport)||void 0===r||r.sendEvent(n),(null===(s=this.config)||void 0===s?void 0:s.debug)&&console.log("[DevSkin] Event tracked:",n)}trackPageView(e){this.track("page_view",Object.assign({path:window.location.pathname,search:window.location.search,hash:window.location.hash,referrer:document.referrer},e))}identify(e,t){var r,s;if(!this.initialized)return void console.warn("[DevSkin] SDK not initialized. Call init() first.");this.userId=e;const n={user_id:e,anonymous_id:this.anonymousId||void 0,traits:Object.assign(Object.assign({},t),this.getContextData()),session_id:this.sessionId,timestamp:(new Date).toISOString()};null===(r=this.transport)||void 0===r||r.identifyUser(n),(null===(s=this.config)||void 0===s?void 0:s.debug)&&console.log("[DevSkin] User identified:",n)}captureError(e,t){var r;this.initialized?null===(r=this.errorCollector)||void 0===r||r.captureError(e,Object.assign(Object.assign({},t),{session_id:this.sessionId,user_id:this.userId||void 0})):console.warn("[DevSkin] SDK not initialized. Call init() first.")}addBreadcrumb(e){var t;this.initialized&&(null===(t=this.errorCollector)||void 0===t||t.addBreadcrumb(e))}startRecording(){var e;null===(e=this.rrwebRecorder)||void 0===e||e.start()}stopRecording(){var e;null===(e=this.rrwebRecorder)||void 0===e||e.stop()}optOut(){localStorage.setItem("devskin_opt_out","true"),this.initialized=!1}optIn(){localStorage.removeItem("devskin_opt_out")}startSession(){var e;this.sessionId=this.generateId(),this.sessionStartTime=Date.now();const t=Object.assign({session_id:this.sessionId,user_id:this.userId||void 0,anonymous_id:this.anonymousId,started_at:(new Date).toISOString()},this.getContextData());null===(e=this.transport)||void 0===e||e.startSession(t)}getContextData(){const e={};return this.deviceCollector&&(e.device=this.deviceCollector.collect()),this.browserCollector&&(e.browser=this.browserCollector.collect()),this.locationCollector&&(e.location=this.locationCollector.collect()),e}getOrCreateAnonymousId(){let e=localStorage.getItem("devskin_anonymous_id");return e||(e=this.generateId(),localStorage.setItem("devskin_anonymous_id",e)),e}generateId(){return`${Date.now()}-${Math.random().toString(36).substr(2,9)}`}setupVisibilityTracking(){document.addEventListener("visibilitychange",()=>{document.hidden?this.track("page_hidden"):this.track("page_visible")})}setupUnloadTracking(){window.addEventListener("beforeunload",()=>{var e,t;if(this.track("page_unload"),this.sessionId&&this.sessionStartTime){const t=new Date,r=Date.now()-this.sessionStartTime;null===(e=this.transport)||void 0===e||e.startSession(Object.assign({session_id:this.sessionId,user_id:this.userId||void 0,anonymous_id:this.anonymousId,ended_at:t.toISOString(),duration_ms:r},this.getContextData()))}null===(t=this.transport)||void 0===t||t.flush(!0)})}};return ih});
|
|
16
2
|
//# sourceMappingURL=devskin.umd.min.js.map
|