@screeb/rrweb 1.0.20 → 2.1.6-screeb.1
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/README.md +107 -48
- package/dist/assets/image-bitmap-data-url-worker-IJpC7g_b.js.map +1 -0
- package/dist/entries/assets/image-bitmap-data-url-worker-IJpC7g_b.js.map +1 -0
- package/dist/entries/rrweb-record.cjs +5001 -0
- package/dist/entries/rrweb-record.cjs.map +1 -0
- package/dist/entries/rrweb-record.js +5001 -0
- package/dist/entries/rrweb-record.js.map +1 -0
- package/dist/entries/rrweb-record.umd.cjs +5027 -0
- package/dist/entries/rrweb-record.umd.cjs.map +7 -0
- package/dist/entries/rrweb-record.umd.min.cjs +109 -0
- package/dist/entries/rrweb-record.umd.min.cjs.map +7 -0
- package/dist/entries/rrweb.d.ts +372 -0
- package/dist/rrweb.cjs +10981 -3655
- package/dist/rrweb.cjs.map +1 -1
- package/dist/rrweb.d.cts +80 -172
- package/dist/rrweb.d.ts +80 -172
- package/dist/rrweb.js +10981 -3654
- package/dist/rrweb.js.map +1 -1
- package/dist/rrweb.umd.cjs +11733 -4550
- package/dist/rrweb.umd.cjs.map +4 -4
- package/dist/rrweb.umd.min.cjs +143 -6
- package/dist/rrweb.umd.min.cjs.map +4 -4
- package/dist/style.min.css +1 -1
- package/dist/style.min.css.map +1 -1
- package/dist/umd/rrweb-record.js +5027 -0
- package/dist/umd/rrweb-record.min.js +109 -0
- package/package.json +46 -33
- package/umd/rrweb.js +17661 -0
- package/umd/rrweb.min.js +173 -0
- package/LICENSE +0 -42
- package/dist/ts3.8/rrweb.d.ts +0 -481
package/umd/rrweb.min.js
ADDED
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
(function (g, f) {
|
|
2
|
+
if ("object" == typeof exports && "object" == typeof module) {
|
|
3
|
+
module.exports = f();
|
|
4
|
+
} else if ("function" == typeof define && define.amd) {
|
|
5
|
+
define("rrweb", [], f);
|
|
6
|
+
} else if ("object" == typeof exports) {
|
|
7
|
+
exports["rrweb"] = f();
|
|
8
|
+
} else {
|
|
9
|
+
g["rrweb"] = f();
|
|
10
|
+
}
|
|
11
|
+
}(this, () => {
|
|
12
|
+
var exports = {};
|
|
13
|
+
var module = { exports };
|
|
14
|
+
"use strict";var _o=Object.defineProperty,ko=Object.defineProperties;var Po=Object.getOwnPropertyDescriptors;var ht=Object.getOwnPropertySymbols;var Gs=Object.prototype.hasOwnProperty,Hs=Object.prototype.propertyIsEnumerable;var js=(e,t,r)=>t in e?_o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,P=(e,t)=>{for(var r in t||(t={}))Gs.call(t,r)&&js(e,r,t[r]);if(ht)for(var r of ht(t))Hs.call(t,r)&&js(e,r,t[r]);return e},re=(e,t)=>ko(e,Po(t));var We=(e,t)=>{var r={};for(var i in e)Gs.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&ht)for(var i of ht(e))t.indexOf(i)<0&&Hs.call(e,i)&&(r[i]=e[i]);return r};var Lo=Object.defineProperty,Fo=(e,t,r)=>t in e?Lo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,M=(e,t,r)=>Fo(e,typeof t!="symbol"?t+"":t,r),Ys;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var Uo=Object.defineProperty,Bo=(e,t,r)=>t in e?Uo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Xs=(e,t,r)=>Bo(e,typeof t!="symbol"?t+"":t,r),U=(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))(U||{});const Js={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument","firstChild","lastChild","nextSibling","previousSibling"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Qs={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ft={},An={},$o=()=>!!globalThis.Zone;function cs(e){if(ft[e])return ft[e];const t=globalThis[e],r=t.prototype,i=e in Js?Js[e]:void 0,s=!!(i&&i.every(u=>{var l,c;return!!((c=(l=Object.getOwnPropertyDescriptor(r,u))==null?void 0:l.get)!=null&&c.toString().includes("[native code]"))})),a=e in Qs?Qs[e]:void 0,o=!!(a&&a.every(u=>{var l;return typeof r[u]=="function"&&((l=r[u])==null?void 0:l.toString().includes("[native code]"))}));if(s&&o&&!$o())return ft[e]=t.prototype,t.prototype;try{const u=document.createElement("iframe");u.style.display="none",document.body.appendChild(u);const l=u.contentWindow;if(!l)return t.prototype;const c=l[e].prototype;if(!c)return u.remove(),r;const n=navigator.userAgent;return n.includes("Safari")&&!n.includes("Chrome")?(u.classList.add("rr-block"),u.setAttribute("__rrwebUntaintedMutationObserver",""),An[e]=()=>u.remove()):u.remove(),ft[e]=c}catch(u){return r}}const Qt={};function fe(e,t,r){var i,s;const a=(i=Qt[e])==null?void 0:i[r];if(a)return a.call(t);const o=cs(e),u=(s=Object.getOwnPropertyDescriptor(o,r))==null?void 0:s.get;return u?((Qt[e]||(Qt[e]={}))[r]=u,u.call(t)):t[r]}const Zt={};function Tn(e,t,r){const i=`${e}.${String(r)}`;if(Zt[i])return Zt[i].bind(t);const a=cs(e)[r];return typeof a!="function"?t[r]:(Zt[i]=a,a.bind(t))}function Wo(e){return fe("Node",e,"ownerDocument")}function zo(e){return fe("Node",e,"childNodes")}function Vo(e){return fe("Node",e,"parentNode")}function qo(e){return fe("Node",e,"parentElement")}function jo(e){return fe("Node",e,"textContent")}function Go(e){return fe("Node",e,"firstChild")}function Ho(e){return fe("Node",e,"lastChild")}function Yo(e){return fe("Node",e,"nextSibling")}function Xo(e){return fe("Node",e,"previousSibling")}function Jo(e,t){return Tn("Node",e,"contains")(t)}function Qo(e){return Tn("Node",e,"getRootNode")()}function Zo(e){return!e||!("host"in e)?null:fe("ShadowRoot",e,"host")}function Ko(e){return e.styleSheets}function ea(e){return!e||!("shadowRoot"in e)?null:fe("Element",e,"shadowRoot")}function ta(e,t){return fe("Element",e,"querySelector")(t)}function ra(e,t){return fe("Element",e,"querySelectorAll")(t)}function sa(){var e;return[cs("MutationObserver").constructor,(e=An.MutationObserver)!=null?e:()=>{}]}let _n=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(_n=()=>new Date().getTime());function ia(e,t,r){try{if(!(t in e))return()=>{};const i=e[t],s=r(i);return typeof s=="function"&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:i}})),e[t]=s,()=>{e[t]=i}}catch(i){return()=>{}}}const ie={ownerDocument:Wo,childNodes:zo,parentNode:Vo,parentElement:qo,textContent:jo,firstChild:Go,lastChild:Ho,nextSibling:Yo,previousSibling:Xo,contains:Jo,getRootNode:Qo,host:Zo,styleSheets:Ko,shadowRoot:ea,querySelector:ta,querySelectorAll:ra,nowTimestamp:_n,mutationObserverCtor:sa,patch:ia};function hs(e){return e.nodeType===e.ELEMENT_NODE}function st(e){const t=e&&"host"in e&&"mode"in e&&ie.host(e)||null;return!!(t&&"shadowRoot"in t&&ie.shadowRoot(t)===e)}function it(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function na(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}function oa(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(" ")+";"}function is(e){try{const t=e.rules||e.cssRules;if(!t)return null;let r=e.href;!r&&e.ownerNode&&(r=e.ownerNode.baseURI);const i=Array.from(t,s=>kn(s,r)).join("");return na(i)}catch(t){return null}}function kn(e,t){if(la(e)){let r;try{r=is(e.styleSheet)||oa(e)}catch(i){r=e.cssText}return e.styleSheet.href?Ot(r,e.styleSheet.href):r}else{let r=e.cssText;return ua(e)&&e.selectorText.includes(":")&&(r=aa(r)),t?Ot(r,t):r}}function aa(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function la(e){return"styleSheet"in e}function ua(e){return"selectorText"in e}class fs{constructor(){Xs(this,"idNodeMap",new Map),Xs(this,"nodeMetaMap",new WeakMap)}getId(t){var r;if(!t)return-1;const i=(r=this.getMeta(t))==null?void 0:r.id;return i!=null?i:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(i=>this.removeNodeFromMap(i))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){const i=r.id;this.idNodeMap.set(i,t),this.nodeMetaMap.set(t,r)}replace(t,r){const i=this.getNode(t);if(i){const s=this.nodeMetaMap.get(i);s&&this.nodeMetaMap.set(r,s)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Pn(){return new fs}function Mt({element:e,maskInputOptions:t,tagName:r,type:i,value:s,maskInputFn:a}){let o=s||"";const u=i&&Oe(i);return(t[r.toLowerCase()]||u&&t[u])&&(a?o=a(o,e):o="*".repeat(o.length)),o}function Oe(e){return e.toLowerCase()}const Zs="__rrweb_original__";function ca(e){const t=e.getContext("2d");if(!t)return!0;const r=50;for(let i=0;i<e.width;i+=r)for(let s=0;s<e.height;s+=r){const a=t.getImageData,o=Zs in a?a[Zs]:a;if(new Uint32Array(o.call(t,i,s,Math.min(r,e.width-i),Math.min(r,e.height-s)).data.buffer).some(l=>l!==0))return!1}return!0}function ha(e,t){return!e||!t||e.type!==t.type?!1:e.type===U.Document?e.compatMode===t.compatMode:e.type===U.DocumentType?e.name===t.name&&e.publicId===t.publicId&&e.systemId===t.systemId:e.type===U.Comment||e.type===U.Text||e.type===U.CDATA?e.textContent===t.textContent:e.type===U.Element?e.tagName===t.tagName&&JSON.stringify(e.attributes)===JSON.stringify(t.attributes)&&e.isSVG===t.isSVG&&e.needBlock===t.needBlock:!1}function Nt(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Oe(t):null}function ds(e,t){var a;let r;try{r=new URL(e,t!=null?t:window.location.href)}catch(o){return null}const i=/\.([0-9a-z]+)(?:$)/i,s=r.pathname.match(i);return(a=s==null?void 0:s[1])!=null?a:null}function fa(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}const da=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,pa=/^(?:[a-z+]+:)?\/\//i,ma=/^www\..*/i,ga=/^(data:)([^,]*),(.*)/i;function Ot(e,t){return(e||"").replace(da,(r,i,s,a,o,u)=>{const l=s||o||u,c=i||a||"";if(!l)return r;if(pa.test(l)||ma.test(l))return`url(${c}${l}${c})`;if(ga.test(l))return`url(${c}${l}${c})`;if(l[0]==="/")return`url(${c}${fa(t)+l}${c})`;const n=l.split("#")[0],d=l.substring(n.length),h=t.split("#")[0].split("/"),f=n.split("/");h.pop();for(const m of f)m!=="."&&(m===".."?h.pop():h.push(m));return`url(${c}${h.join("/")}${d}${c})`})}function dt(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function ya(e,t,r=!1){const i=Array.from(t.childNodes),s=[];let a=0;if(i.length>1&&e&&typeof e=="string"){let o=dt(e,r);const u=o.length/e.length;for(let l=1;l<i.length;l++)if(i[l].textContent&&typeof i[l].textContent=="string"){const c=dt(i[l].textContent,r),n=100;let d=3;for(;d<c.length&&(c[d].match(/[a-zA-Z0-9]/)||c.indexOf(c.substring(0,d),1)!==-1);d++);for(;d<c.length;d++){let h=c.substring(0,d),f=o.split(h),m=-1;if(f.length===2)m=f[0].length;else if(f.length>2&&f[0]===""&&i[l-1].textContent!=="")m=o.indexOf(h,1);else if(f.length===1){if(h=h.substring(0,h.length-1),f=o.split(h),f.length<=1)return s.push(e),s;d=n+1}else d===c.length-1&&(m=o.indexOf(h));if(f.length>=2&&d>n){const p=i[l-1].textContent;if(p&&typeof p=="string"){const g=dt(p).length;m=o.indexOf(h,g)}m===-1&&(m=f[0].length)}if(m!==-1){let p=Math.floor(m/u);for(;p>0&&p<e.length;){if(a+=1,a>50*i.length)return s.push(e),s;const g=dt(e.substring(0,p),r);if(g.length===m){s.push(e.substring(0,p)),e=e.substring(p),o=o.substring(m);break}else g.length<m?p+=Math.max(1,Math.floor((m-g.length)/u)):p-=Math.max(1,Math.floor((g.length-m)*u))}break}}}}return s.push(e),s}function wa(e,t){return ya(e,t).join("/* rr_split */")}let ba=1;const va=new RegExp("[^a-z0-9-_:]"),It=-2;function Ln(){return ba++}function Sa(e){if(Object.prototype.toString.call(e)==="[object HTMLFormElement]")return"form";const t=Oe(e.tagName);return va.test(t)?"div":t}let ze,Ks;const Ca=/^[^ \t\n\r\u000c]+/,Ea=/^[, \t\n\r\u000c]+/;function xa(e,t){if(t.trim()==="")return t;let r=0;function i(a){let o;const u=a.exec(t.substring(r));return u?(o=u[0],r+=o.length,o):""}const s=[];for(;i(Ea),!(r>=t.length);){let a=i(Ca);if(a.slice(-1)===",")a=Ge(e,a.substring(0,a.length-1)),s.push(a);else{let o="";a=Ge(e,a);let u=!1;for(;;){const l=t.charAt(r);if(l===""){s.push((a+o).trim());break}else if(u)l===")"&&(u=!1);else if(l===","){r+=1,s.push((a+o).trim());break}else l==="("&&(u=!0);o+=l,r+=1}}}return s.join(", ")}const ei=new WeakMap;function Ge(e,t){return!t||t.trim()===""?t:ps(e,t)}function Ra(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function ps(e,t){let r=ei.get(e);if(r||(r=e.createElement("a"),ei.set(e,r)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return r.setAttribute("href",t),r.href}function Fn(e,t,r,i){return i&&(r==="src"||r==="href"&&!(t==="use"&&i[0]==="#")||r==="xlink:href"&&i[0]!=="#"||r==="background"&&["table","td","th"].includes(t)?Ge(e,i):r==="srcset"?xa(e,i):r==="style"?Ot(i,ps(e)):t==="object"&&r==="data"?Ge(e,i):i)}function Un(e,t,r){return["video","audio"].includes(e)&&Oe(t)==="autoplay"}function Ma(e,t,r){try{if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let i=e.classList.length;i--;){const s=e.classList[i];if(t.test(s))return!0}if(r)return e.matches(r)}catch(i){}return!1}function Dt(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?Dt(ie.parentNode(e),t,r):!1;for(let i=e.classList.length;i--;){const s=e.classList[i];if(t.test(s))return!0}return r?Dt(ie.parentNode(e),t,r):!1}function Bn(e,t,r,i){let s;if(hs(e)){if(s=e,!ie.childNodes(s).length)return!1}else{if(ie.parentElement(e)===null)return!1;s=ie.parentElement(e)}try{if(typeof t=="string"){if(i){if(s.closest(`.${t}`))return!0}else if(s.classList.contains(t))return!0}else if(Dt(s,t,i))return!0;if(r){if(i){if(s.closest(r))return!0}else if(s.matches(r))return!0}}catch(a){}return!1}function Na(e,t,r){const i=e.contentWindow;if(!i)return;let s=!1,a;try{a=i.document.readyState}catch(u){return}if(a!=="complete"){const u=setTimeout(()=>{s||(t(),s=!0)},r);e.addEventListener("load",()=>{clearTimeout(u),s=!0,t()});return}const o="about:blank";if(i.location.href!==o||e.src===o||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function Oa(e,t,r){let i=!1,s;try{s=e.sheet}catch(o){return}if(s)return;const a=setTimeout(()=>{i||(t(),i=!0)},r);e.addEventListener("load",()=>{clearTimeout(a),i=!0,t()})}function Ia(e,t){const{doc:r,mirror:i,blockClass:s,blockSelector:a,needsMask:o,inlineStylesheet:u,maskInputOptions:l={},maskTextFn:c,maskInputFn:n,dataURLOptions:d={},inlineImages:h,recordCanvas:f,keepIframeSrcFn:m,newlyAddedElement:p=!1,cssCaptured:g=!1}=t,b=Da(r,i);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:U.Document,childNodes:[],compatMode:e.compatMode}:{type:U.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:U.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:b};case e.ELEMENT_NODE:return Ta(e,{doc:r,blockClass:s,blockSelector:a,inlineStylesheet:u,maskInputOptions:l,maskInputFn:n,dataURLOptions:d,inlineImages:h,recordCanvas:f,keepIframeSrcFn:m,newlyAddedElement:p,rootId:b});case e.TEXT_NODE:return Aa(e,{doc:r,needsMask:o,maskTextFn:c,rootId:b,cssCaptured:g});case e.CDATA_SECTION_NODE:return{type:U.CDATA,textContent:"",rootId:b};case e.COMMENT_NODE:return{type:U.Comment,textContent:ie.textContent(e)||"",rootId:b};default:return!1}}function Da(e,t){if(!t.hasNode(e))return;const r=t.getId(e);return r===1?void 0:r}function Aa(e,t){const{needsMask:r,maskTextFn:i,rootId:s,cssCaptured:a}=t,o=ie.parentNode(e),u=o&&o.tagName;let l="";const c=u==="STYLE"?!0:void 0,n=u==="SCRIPT"?!0:void 0;return n?l="SCRIPT_PLACEHOLDER":a||(l=ie.textContent(e),c&&l&&(l=Ot(l,ps(t.doc)))),!c&&!n&&l&&r&&(l=i?i(l,ie.parentElement(e)):l.replace(/[\S]/g,"*")),{type:U.Text,textContent:l||"",rootId:s}}function Ta(e,t){const{doc:r,blockClass:i,blockSelector:s,inlineStylesheet:a,maskInputOptions:o={},maskInputFn:u,dataURLOptions:l={},inlineImages:c,recordCanvas:n,keepIframeSrcFn:d,newlyAddedElement:h=!1,rootId:f}=t,m=Ma(e,i,s),p=Sa(e);let g={};const b=e.attributes.length;for(let w=0;w<b;w++){const C=e.attributes[w];Un(p,C.name,C.value)||(g[C.name]=Fn(r,p,Oe(C.name),C.value))}if(p==="link"&&a){const w=Array.from(r.styleSheets).find(v=>v.href===e.href);let C=null;w&&(C=is(w)),C&&(delete g.rel,delete g.href,g._cssText=C)}if(p==="style"&&e.sheet){let w=is(e.sheet);w&&(e.childNodes.length>1&&(w=wa(w,e)),g._cssText=w)}if(["input","textarea","select"].includes(p)){const w=e.value,C=e.checked;g.type!=="radio"&&g.type!=="checkbox"&&g.type!=="submit"&&g.type!=="button"&&w?g.value=Mt({element:e,type:Nt(e),tagName:p,value:w,maskInputOptions:o,maskInputFn:u}):C&&(g.checked=C)}if(p==="option"&&(e.selected&&!o.select?g.selected=!0:delete g.selected),p==="dialog"&&e.open&&(g.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"),p==="canvas"&&n){if(e.__context==="2d")ca(e)||(g.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!("__context"in e)){const w=e.toDataURL(l.type,l.quality),C=r.createElement("canvas");C.width=e.width,C.height=e.height;const v=C.toDataURL(l.type,l.quality);w!==v&&(g.rr_dataURL=w)}}if(p==="img"&&c){ze||(ze=r.createElement("canvas"),Ks=ze.getContext("2d"));const w=e,C=w.currentSrc||w.getAttribute("src")||"<unknown-src>",v=w.crossOrigin,S=()=>{w.removeEventListener("load",S);try{ze.width=w.naturalWidth,ze.height=w.naturalHeight,Ks.drawImage(w,0,0),g.rr_dataURL=ze.toDataURL(l.type,l.quality)}catch(E){if(w.crossOrigin!=="anonymous"){w.crossOrigin="anonymous",w.complete&&w.naturalWidth!==0?S():w.addEventListener("load",S);return}else console.warn(`Cannot inline img src=${C}! Error: ${E}`)}w.crossOrigin==="anonymous"&&(v?g.crossOrigin=v:w.removeAttribute("crossorigin"))};w.complete&&w.naturalWidth!==0?S():w.addEventListener("load",S)}if(["audio","video"].includes(p)){const w=g;w.rr_mediaState=e.paused?"paused":"played",w.rr_mediaCurrentTime=e.currentTime,w.rr_mediaPlaybackRate=e.playbackRate,w.rr_mediaMuted=e.muted,w.rr_mediaLoop=e.loop,w.rr_mediaVolume=e.volume}if(h||(e.scrollLeft&&(g.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(g.rr_scrollTop=e.scrollTop)),m){const{width:w,height:C}=e.getBoundingClientRect();g={class:g.class,rr_width:`${w}px`,rr_height:`${C}px`}}p==="iframe"&&!d(g.src)&&(e.contentDocument||(g.rr_src=g.src),delete g.src);let y;try{customElements.get(p)&&(y=!0)}catch(w){}return{type:U.Element,tagName:p,attributes:g,childNodes:[],isSVG:Ra(e)||void 0,needBlock:m,rootId:f,isCustom:y}}function Y(e){return e==null?"":e.toLowerCase()}function $n(e){return e===!0||e==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:e==="all",headMetaDescKeywords:e==="all",headTitleMutations:e==="all"}:e||{}}function _a(e,t){if(t.comment&&e.type===U.Comment)return!0;if(e.type===U.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"&&e.attributes.as==="script"||e.attributes.rel==="modulepreload")||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&ds(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(Y(e.attributes.name).match(/^msapplication-tile(image|color)$/)||Y(e.attributes.name)==="application-name"||Y(e.attributes.rel)==="icon"||Y(e.attributes.rel)==="apple-touch-icon"||Y(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&Y(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Y(e.attributes.property).match(/^(og|twitter|fb):/)||Y(e.attributes.name).match(/^(og|twitter):/)||Y(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(Y(e.attributes.name)==="robots"||Y(e.attributes.name)==="googlebot"||Y(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(Y(e.attributes.name)==="author"||Y(e.attributes.name)==="generator"||Y(e.attributes.name)==="framework"||Y(e.attributes.name)==="publisher"||Y(e.attributes.name)==="progid"||Y(e.attributes.property).match(/^article:/)||Y(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(Y(e.attributes.name)==="google-site-verification"||Y(e.attributes.name)==="yandex-verification"||Y(e.attributes.name)==="csrf-token"||Y(e.attributes.name)==="p:domain_verify"||Y(e.attributes.name)==="verify-v1"||Y(e.attributes.name)==="verification"||Y(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function He(e,t){const{doc:r,mirror:i,blockClass:s,blockSelector:a,maskTextClass:o,maskTextSelector:u,skipChild:l=!1,inlineStylesheet:c=!0,maskInputOptions:n={},maskTextFn:d,maskInputFn:h,slimDOMOptions:f,dataURLOptions:m={},inlineImages:p=!1,recordCanvas:g=!1,onSerialize:b,onIframeLoad:y,iframeLoadTimeout:w=5e3,onStylesheetLoad:C,stylesheetLoadTimeout:v=5e3,keepIframeSrcFn:S=()=>!1,newlyAddedElement:E=!1,cssCaptured:R=!1}=t;let{needsMask:I}=t,{preserveWhiteSpace:N=!0}=t;I||(I=Bn(e,o,u,I===void 0));const L=Ia(e,{doc:r,mirror:i,blockClass:s,blockSelector:a,needsMask:I,inlineStylesheet:c,maskInputOptions:n,maskTextFn:d,maskInputFn:h,dataURLOptions:m,inlineImages:p,recordCanvas:g,keepIframeSrcFn:S,newlyAddedElement:E,cssCaptured:R});if(!L)return console.warn(e,"not serialized"),null;let k;i.hasNode(e)?k=i.getId(e):_a(L,f)||!N&&L.type===U.Text&&!L.textContent.replace(/^\s+|\s+$/gm,"").length?k=It:k=Ln();const x=Object.assign(L,{id:k});if(i.add(e,x),k===It)return null;b&&b(e);let ae=!l;if(x.type===U.Element){ae=ae&&!x.needBlock,delete x.needBlock;const q=ie.shadowRoot(e);q&&it(q)&&(x.isShadowHost=!0)}if((x.type===U.Document||x.type===U.Element)&&ae){f.headWhitespace&&x.type===U.Element&&x.tagName==="head"&&(N=!1);const q={doc:r,mirror:i,blockClass:s,blockSelector:a,needsMask:I,maskTextClass:o,maskTextSelector:u,skipChild:l,inlineStylesheet:c,maskInputOptions:n,maskTextFn:d,maskInputFn:h,slimDOMOptions:f,dataURLOptions:m,inlineImages:p,recordCanvas:g,preserveWhiteSpace:N,onSerialize:b,onIframeLoad:y,iframeLoadTimeout:w,onStylesheetLoad:C,stylesheetLoadTimeout:v,keepIframeSrcFn:S,cssCaptured:!1};if(!(x.type===U.Element&&x.tagName==="textarea"&&x.attributes.value!==void 0)){x.type===U.Element&&x.attributes._cssText!==void 0&&typeof x.attributes._cssText=="string"&&(q.cssCaptured=!0);for(const H of Array.from(ie.childNodes(e))){const te=He(H,q);te&&x.childNodes.push(te)}}let D=null;if(hs(e)&&(D=ie.shadowRoot(e)))for(const H of Array.from(ie.childNodes(D))){const te=He(H,q);te&&(it(D)&&(te.isShadow=!0),x.childNodes.push(te))}}const le=ie.parentNode(e);return le&&st(le)&&it(le)&&(x.isShadow=!0),x.type===U.Element&&x.tagName==="iframe"&&Na(e,()=>{const q=e.contentDocument;if(q&&y){const D=He(q,{doc:q,mirror:i,blockClass:s,blockSelector:a,needsMask:I,maskTextClass:o,maskTextSelector:u,skipChild:!1,inlineStylesheet:c,maskInputOptions:n,maskTextFn:d,maskInputFn:h,slimDOMOptions:f,dataURLOptions:m,inlineImages:p,recordCanvas:g,preserveWhiteSpace:N,onSerialize:b,onIframeLoad:y,iframeLoadTimeout:w,onStylesheetLoad:C,stylesheetLoadTimeout:v,keepIframeSrcFn:S});D&&y(e,D)}},w),x.type===U.Element&&x.tagName==="link"&&typeof x.attributes.rel=="string"&&(x.attributes.rel==="stylesheet"||x.attributes.rel==="preload"&&typeof x.attributes.href=="string"&&ds(x.attributes.href)==="css")&&Oa(e,()=>{if(C){const q=He(e,{doc:r,mirror:i,blockClass:s,blockSelector:a,needsMask:I,maskTextClass:o,maskTextSelector:u,skipChild:!1,inlineStylesheet:c,maskInputOptions:n,maskTextFn:d,maskInputFn:h,slimDOMOptions:f,dataURLOptions:m,inlineImages:p,recordCanvas:g,preserveWhiteSpace:N,onSerialize:b,onIframeLoad:y,iframeLoadTimeout:w,onStylesheetLoad:C,stylesheetLoadTimeout:v,keepIframeSrcFn:S});q&&C(e,q)}},v),x}function ka(e,t){const{mirror:r=new fs,blockClass:i="rr-block",blockSelector:s=null,maskTextClass:a="rr-mask",maskTextSelector:o=null,inlineStylesheet:u=!0,inlineImages:l=!1,recordCanvas:c=!1,maskAllInputs:n=!1,maskTextFn:d,maskInputFn:h,slimDOM:f=!1,dataURLOptions:m,preserveWhiteSpace:p,onSerialize:g,onIframeLoad:b,iframeLoadTimeout:y,onStylesheetLoad:w,stylesheetLoadTimeout:C,keepIframeSrcFn:v=()=>!1}=t,S=n===!0?{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}:n===!1?{password:!0}:n,E=$n(f);return He(e,{doc:e,mirror:r,blockClass:i,blockSelector:s,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:u,maskInputOptions:S,maskTextFn:d,maskInputFn:h,slimDOMOptions:E,dataURLOptions:m,inlineImages:l,recordCanvas:c,preserveWhiteSpace:p,onSerialize:g,onIframeLoad:b,iframeLoadTimeout:y,onStylesheetLoad:w,stylesheetLoadTimeout:C,keepIframeSrcFn:v,newlyAddedElement:!1})}const Pa=/(max|min)-device-(width|height)/,ti=new RegExp(Pa.source,"g"),La={postcssPlugin:"postcss-custom-selectors",prepare(){return{postcssPlugin:"postcss-custom-selectors",AtRule:function(e){e.params.match(ti)&&(e.params=e.params.replace(ti,"$1-$2"))}}}},Fa={postcssPlugin:"postcss-hover-classes",prepare:function(){const e=[];return{Rule:function(t){e.indexOf(t)===-1&&(e.push(t),t.selectors.forEach(function(r){r.includes(":hover")&&(t.selector+=`,
|
|
15
|
+
`+r.replace(/:hover/g,".\\:hover"))}))}}}};function Ua(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ba(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function i(){return this instanceof i?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(i){var s=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(r,i,s.get?s:{enumerable:!0,get:function(){return e[i]}})}),r}var pt={exports:{}},ri;function $a(){if(ri)return pt.exports;ri=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return pt.exports=t(),pt.exports.createColors=t,pt.exports}const Wa={},za=Object.freeze(Object.defineProperty({__proto__:null,default:Wa},Symbol.toStringTag,{value:"Module"})),be=Ba(za);var Kt,si;function ms(){if(si)return Kt;si=1;let e=$a(),t=be;class r extends Error{constructor(s,a,o,u,l,c){super(s),this.name="CssSyntaxError",this.reason=s,l&&(this.file=l),u&&(this.source=u),c&&(this.plugin=c),typeof a!="undefined"&&typeof o!="undefined"&&(typeof a=="number"?(this.line=a,this.column=o):(this.line=a.line,this.column=a.column,this.endLine=o.line,this.endColumn=o.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,r)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line!="undefined"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(s){if(!this.source)return"";let a=this.source;s==null&&(s=e.isColorSupported),t&&s&&(a=t(a));let o=a.split(/\r?\n/),u=Math.max(this.line-3,0),l=Math.min(this.line+2,o.length),c=String(l).length,n,d;if(s){let{bold:h,gray:f,red:m}=e.createColors(!0);n=p=>h(m(p)),d=p=>f(p)}else n=d=h=>h;return o.slice(u,l).map((h,f)=>{let m=u+1+f,p=" "+(" "+m).slice(-c)+" | ";if(m===this.line){let g=d(p.replace(/\d/g," "))+h.slice(0,this.column-1).replace(/[^\t]/g," ");return n(">")+d(p)+h+`
|
|
16
|
+
`+g+n("^")}return" "+d(p)+h}).join(`
|
|
17
|
+
`)}toString(){let s=this.showSourceCode();return s&&(s=`
|
|
18
|
+
|
|
19
|
+
`+s+`
|
|
20
|
+
`),this.name+": "+this.message+s}}return Kt=r,r.default=r,Kt}var mt={},ii;function gs(){return ii||(ii=1,mt.isClean=Symbol("isClean"),mt.my=Symbol("my")),mt}var er,ni;function Wn(){if(ni)return er;ni=1;const e={after:`
|
|
21
|
+
`,beforeClose:`
|
|
22
|
+
`,beforeComment:`
|
|
23
|
+
`,beforeDecl:`
|
|
24
|
+
`,beforeOpen:" ",beforeRule:`
|
|
25
|
+
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function t(i){return i[0].toUpperCase()+i.slice(1)}class r{constructor(s){this.builder=s}atrule(s,a){let o="@"+s.name,u=s.params?this.rawValue(s,"params"):"";if(typeof s.raws.afterName!="undefined"?o+=s.raws.afterName:u&&(o+=" "),s.nodes)this.block(s,o+u);else{let l=(s.raws.between||"")+(a?";":"");this.builder(o+u+l,s)}}beforeAfter(s,a){let o;s.type==="decl"?o=this.raw(s,null,"beforeDecl"):s.type==="comment"?o=this.raw(s,null,"beforeComment"):a==="before"?o=this.raw(s,null,"beforeRule"):o=this.raw(s,null,"beforeClose");let u=s.parent,l=0;for(;u&&u.type!=="root";)l+=1,u=u.parent;if(o.includes(`
|
|
26
|
+
`)){let c=this.raw(s,null,"indent");if(c.length)for(let n=0;n<l;n++)o+=c}return o}block(s,a){let o=this.raw(s,"between","beforeOpen");this.builder(a+o+"{",s,"start");let u;s.nodes&&s.nodes.length?(this.body(s),u=this.raw(s,"after")):u=this.raw(s,"after","emptyBody"),u&&this.builder(u),this.builder("}",s,"end")}body(s){let a=s.nodes.length-1;for(;a>0&&s.nodes[a].type==="comment";)a-=1;let o=this.raw(s,"semicolon");for(let u=0;u<s.nodes.length;u++){let l=s.nodes[u],c=this.raw(l,"before");c&&this.builder(c),this.stringify(l,a!==u||o)}}comment(s){let a=this.raw(s,"left","commentLeft"),o=this.raw(s,"right","commentRight");this.builder("/*"+a+s.text+o+"*/",s)}decl(s,a){let o=this.raw(s,"between","colon"),u=s.prop+o+this.rawValue(s,"value");s.important&&(u+=s.raws.important||" !important"),a&&(u+=";"),this.builder(u,s)}document(s){this.body(s)}raw(s,a,o){let u;if(o||(o=a),a&&(u=s.raws[a],typeof u!="undefined"))return u;let l=s.parent;if(o==="before"&&(!l||l.type==="root"&&l.first===s||l&&l.type==="document"))return"";if(!l)return e[o];let c=s.root();if(c.rawCache||(c.rawCache={}),typeof c.rawCache[o]!="undefined")return c.rawCache[o];if(o==="before"||o==="after")return this.beforeAfter(s,o);{let n="raw"+t(o);this[n]?u=this[n](c,s):c.walk(d=>{if(u=d.raws[a],typeof u!="undefined")return!1})}return typeof u=="undefined"&&(u=e[o]),c.rawCache[o]=u,u}rawBeforeClose(s){let a;return s.walk(o=>{if(o.nodes&&o.nodes.length>0&&typeof o.raws.after!="undefined")return a=o.raws.after,a.includes(`
|
|
27
|
+
`)&&(a=a.replace(/[^\n]+$/,"")),!1}),a&&(a=a.replace(/\S/g,"")),a}rawBeforeComment(s,a){let o;return s.walkComments(u=>{if(typeof u.raws.before!="undefined")return o=u.raws.before,o.includes(`
|
|
28
|
+
`)&&(o=o.replace(/[^\n]+$/,"")),!1}),typeof o=="undefined"?o=this.raw(a,null,"beforeDecl"):o&&(o=o.replace(/\S/g,"")),o}rawBeforeDecl(s,a){let o;return s.walkDecls(u=>{if(typeof u.raws.before!="undefined")return o=u.raws.before,o.includes(`
|
|
29
|
+
`)&&(o=o.replace(/[^\n]+$/,"")),!1}),typeof o=="undefined"?o=this.raw(a,null,"beforeRule"):o&&(o=o.replace(/\S/g,"")),o}rawBeforeOpen(s){let a;return s.walk(o=>{if(o.type!=="decl"&&(a=o.raws.between,typeof a!="undefined"))return!1}),a}rawBeforeRule(s){let a;return s.walk(o=>{if(o.nodes&&(o.parent!==s||s.first!==o)&&typeof o.raws.before!="undefined")return a=o.raws.before,a.includes(`
|
|
30
|
+
`)&&(a=a.replace(/[^\n]+$/,"")),!1}),a&&(a=a.replace(/\S/g,"")),a}rawColon(s){let a;return s.walkDecls(o=>{if(typeof o.raws.between!="undefined")return a=o.raws.between.replace(/[^\s:]/g,""),!1}),a}rawEmptyBody(s){let a;return s.walk(o=>{if(o.nodes&&o.nodes.length===0&&(a=o.raws.after,typeof a!="undefined"))return!1}),a}rawIndent(s){if(s.raws.indent)return s.raws.indent;let a;return s.walk(o=>{let u=o.parent;if(u&&u!==s&&u.parent&&u.parent===s&&typeof o.raws.before!="undefined"){let l=o.raws.before.split(`
|
|
31
|
+
`);return a=l[l.length-1],a=a.replace(/\S/g,""),!1}}),a}rawSemicolon(s){let a;return s.walk(o=>{if(o.nodes&&o.nodes.length&&o.last.type==="decl"&&(a=o.raws.semicolon,typeof a!="undefined"))return!1}),a}rawValue(s,a){let o=s[a],u=s.raws[a];return u&&u.value===o?u.raw:o}root(s){this.body(s),s.raws.after&&this.builder(s.raws.after)}rule(s){this.block(s,this.rawValue(s,"selector")),s.raws.ownSemicolon&&this.builder(s.raws.ownSemicolon,s,"end")}stringify(s,a){if(!this[s.type])throw new Error("Unknown AST node type "+s.type+". Maybe you need to change PostCSS stringifier.");this[s.type](s,a)}}return er=r,r.default=r,er}var tr,oi;function Ft(){if(oi)return tr;oi=1;let e=Wn();function t(r,i){new e(i).stringify(r)}return tr=t,t.default=t,tr}var rr,ai;function Ut(){if(ai)return rr;ai=1;let{isClean:e,my:t}=gs(),r=ms(),i=Wn(),s=Ft();function a(u,l){let c=new u.constructor;for(let n in u){if(!Object.prototype.hasOwnProperty.call(u,n)||n==="proxyCache")continue;let d=u[n],h=typeof d;n==="parent"&&h==="object"?l&&(c[n]=l):n==="source"?c[n]=d:Array.isArray(d)?c[n]=d.map(f=>a(f,c)):(h==="object"&&d!==null&&(d=a(d)),c[n]=d)}return c}class o{constructor(l={}){this.raws={},this[e]=!1,this[t]=!0;for(let c in l)if(c==="nodes"){this.nodes=[];for(let n of l[c])typeof n.clone=="function"?this.append(n.clone()):this.append(n)}else this[c]=l[c]}addToError(l){if(l.postcssNode=this,l.stack&&this.source&&/\n\s{4}at /.test(l.stack)){let c=this.source;l.stack=l.stack.replace(/\n\s{4}at /,`$&${c.input.from}:${c.start.line}:${c.start.column}$&`)}return l}after(l){return this.parent.insertAfter(this,l),this}assign(l={}){for(let c in l)this[c]=l[c];return this}before(l){return this.parent.insertBefore(this,l),this}cleanRaws(l){delete this.raws.before,delete this.raws.after,l||delete this.raws.between}clone(l={}){let c=a(this);for(let n in l)c[n]=l[n];return c}cloneAfter(l={}){let c=this.clone(l);return this.parent.insertAfter(this,c),c}cloneBefore(l={}){let c=this.clone(l);return this.parent.insertBefore(this,c),c}error(l,c={}){if(this.source){let{end:n,start:d}=this.rangeBy(c);return this.source.input.error(l,{column:d.column,line:d.line},{column:n.column,line:n.line},c)}return new r(l)}getProxyProcessor(){return{get(l,c){return c==="proxyOf"?l:c==="root"?()=>l.root().toProxy():l[c]},set(l,c,n){return l[c]===n||(l[c]=n,(c==="prop"||c==="value"||c==="name"||c==="params"||c==="important"||c==="text")&&l.markDirty()),!0}}}markDirty(){if(this[e]){this[e]=!1;let l=this;for(;l=l.parent;)l[e]=!1}}next(){if(!this.parent)return;let l=this.parent.index(this);return this.parent.nodes[l+1]}positionBy(l,c){let n=this.source.start;if(l.index)n=this.positionInside(l.index,c);else if(l.word){c=this.toString();let d=c.indexOf(l.word);d!==-1&&(n=this.positionInside(d,c))}return n}positionInside(l,c){let n=c||this.toString(),d=this.source.start.column,h=this.source.start.line;for(let f=0;f<l;f++)n[f]===`
|
|
32
|
+
`?(d=1,h+=1):d+=1;return{column:d,line:h}}prev(){if(!this.parent)return;let l=this.parent.index(this);return this.parent.nodes[l-1]}rangeBy(l){let c={column:this.source.start.column,line:this.source.start.line},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:c.column+1,line:c.line};if(l.word){let d=this.toString(),h=d.indexOf(l.word);h!==-1&&(c=this.positionInside(h,d),n=this.positionInside(h+l.word.length,d))}else l.start?c={column:l.start.column,line:l.start.line}:l.index&&(c=this.positionInside(l.index)),l.end?n={column:l.end.column,line:l.end.line}:typeof l.endIndex=="number"?n=this.positionInside(l.endIndex):l.index&&(n=this.positionInside(l.index+1));return(n.line<c.line||n.line===c.line&&n.column<=c.column)&&(n={column:c.column+1,line:c.line}),{end:n,start:c}}raw(l,c){return new i().raw(this,l,c)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...l){if(this.parent){let c=this,n=!1;for(let d of l)d===this?n=!0:n?(this.parent.insertAfter(c,d),c=d):this.parent.insertBefore(c,d);n||this.remove()}return this}root(){let l=this;for(;l.parent&&l.parent.type!=="document";)l=l.parent;return l}toJSON(l,c){let n={},d=c==null;c=c||new Map;let h=0;for(let f in this){if(!Object.prototype.hasOwnProperty.call(this,f)||f==="parent"||f==="proxyCache")continue;let m=this[f];if(Array.isArray(m))n[f]=m.map(p=>typeof p=="object"&&p.toJSON?p.toJSON(null,c):p);else if(typeof m=="object"&&m.toJSON)n[f]=m.toJSON(null,c);else if(f==="source"){let p=c.get(m.input);p==null&&(p=h,c.set(m.input,h),h++),n[f]={end:m.end,inputId:p,start:m.start}}else n[f]=m}return d&&(n.inputs=[...c.keys()].map(f=>f.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(l=s){l.stringify&&(l=l.stringify);let c="";return l(this,n=>{c+=n}),c}warn(l,c,n){let d={node:this};for(let h in n)d[h]=n[h];return l.warn(c,d)}get proxyOf(){return this}}return rr=o,o.default=o,rr}var sr,li;function Bt(){if(li)return sr;li=1;let e=Ut();class t extends e{constructor(i){i&&typeof i.value!="undefined"&&typeof i.value!="string"&&(i=re(P({},i),{value:String(i.value)})),super(i),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}}return sr=t,t.default=t,sr}var ir,ui;function Va(){if(ui)return ir;ui=1;let e="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";return ir={nanoid:(i=21)=>{let s="",a=i;for(;a--;)s+=e[Math.random()*64|0];return s},customAlphabet:(i,s=21)=>(a=s)=>{let o="",u=a;for(;u--;)o+=i[Math.random()*i.length|0];return o}},ir}var nr,ci;function zn(){if(ci)return nr;ci=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=be,{existsSync:r,readFileSync:i}=be,{dirname:s,join:a}=be;function o(l){return Buffer?Buffer.from(l,"base64").toString():window.atob(l)}class u{constructor(c,n){if(n.map===!1)return;this.loadAnnotation(c),this.inline=this.startWith(this.annotation,"data:");let d=n.map?n.map.prev:void 0,h=this.loadMap(n.from,d);!this.mapFile&&n.from&&(this.mapFile=n.from),this.mapFile&&(this.root=s(this.mapFile)),h&&(this.text=h)}consumer(){return this.consumerCache||(this.consumerCache=new e(this.text)),this.consumerCache}decodeInline(c){let n=/^data:application\/json;charset=utf-?8;base64,/,d=/^data:application\/json;base64,/,h=/^data:application\/json;charset=utf-?8,/,f=/^data:application\/json,/;if(h.test(c)||f.test(c))return decodeURIComponent(c.substr(RegExp.lastMatch.length));if(n.test(c)||d.test(c))return o(c.substr(RegExp.lastMatch.length));let m=c.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+m)}getAnnotationURL(c){return c.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(c){return typeof c!="object"?!1:typeof c.mappings=="string"||typeof c._mappings=="string"||Array.isArray(c.sections)}loadAnnotation(c){let n=c.match(/\/\*\s*# sourceMappingURL=/gm);if(!n)return;let d=c.lastIndexOf(n.pop()),h=c.indexOf("*/",d);d>-1&&h>-1&&(this.annotation=this.getAnnotationURL(c.substring(d,h)))}loadFile(c){if(this.root=s(c),r(c))return this.mapFile=c,i(c,"utf-8").toString().trim()}loadMap(c,n){if(n===!1)return!1;if(n){if(typeof n=="string")return n;if(typeof n=="function"){let d=n(c);if(d){let h=this.loadFile(d);if(!h)throw new Error("Unable to load previous source map: "+d.toString());return h}}else{if(n instanceof e)return t.fromSourceMap(n).toString();if(n instanceof t)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let d=this.annotation;return c&&(d=a(s(c),d)),this.loadFile(d)}}}startWith(c,n){return c?c.substr(0,n.length)===n:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return nr=u,u.default=u,nr}var or,hi;function $t(){if(hi)return or;hi=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=be,{fileURLToPath:r,pathToFileURL:i}=be,{isAbsolute:s,resolve:a}=be,{nanoid:o}=Va(),u=be,l=ms(),c=zn(),n=Symbol("fromOffsetCache"),d=!!(e&&t),h=!!(a&&s);class f{constructor(p,g={}){if(p===null||typeof p=="undefined"||typeof p=="object"&&!p.toString)throw new Error(`PostCSS received ${p} instead of CSS string`);if(this.css=p.toString(),this.css[0]==="\uFEFF"||this.css[0]==="\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,g.from&&(!h||/^\w+:\/\//.test(g.from)||s(g.from)?this.file=g.from:this.file=a(g.from)),h&&d){let b=new c(this.css,g);if(b.text){this.map=b;let y=b.consumer().file;!this.file&&y&&(this.file=this.mapResolve(y))}}this.file||(this.id="<input css "+o(6)+">"),this.map&&(this.map.file=this.from)}error(p,g,b,y={}){let w,C,v;if(g&&typeof g=="object"){let E=g,R=b;if(typeof E.offset=="number"){let I=this.fromOffset(E.offset);g=I.line,b=I.col}else g=E.line,b=E.column;if(typeof R.offset=="number"){let I=this.fromOffset(R.offset);C=I.line,v=I.col}else C=R.line,v=R.column}else if(!b){let E=this.fromOffset(g);g=E.line,b=E.col}let S=this.origin(g,b,C,v);return S?w=new l(p,S.endLine===void 0?S.line:{column:S.column,line:S.line},S.endLine===void 0?S.column:{column:S.endColumn,line:S.endLine},S.source,S.file,y.plugin):w=new l(p,C===void 0?g:{column:b,line:g},C===void 0?b:{column:v,line:C},this.css,this.file,y.plugin),w.input={column:b,endColumn:v,endLine:C,line:g,source:this.css},this.file&&(i&&(w.input.url=i(this.file).toString()),w.input.file=this.file),w}fromOffset(p){let g,b;if(this[n])b=this[n];else{let w=this.css.split(`
|
|
33
|
+
`);b=new Array(w.length);let C=0;for(let v=0,S=w.length;v<S;v++)b[v]=C,C+=w[v].length+1;this[n]=b}g=b[b.length-1];let y=0;if(p>=g)y=b.length-1;else{let w=b.length-2,C;for(;y<w;)if(C=y+(w-y>>1),p<b[C])w=C-1;else if(p>=b[C+1])y=C+1;else{y=C;break}}return{col:p-b[y]+1,line:y+1}}mapResolve(p){return/^\w+:\/\//.test(p)?p:a(this.map.consumer().sourceRoot||this.map.root||".",p)}origin(p,g,b,y){if(!this.map)return!1;let w=this.map.consumer(),C=w.originalPositionFor({column:g,line:p});if(!C.source)return!1;let v;typeof b=="number"&&(v=w.originalPositionFor({column:y,line:b}));let S;s(C.source)?S=i(C.source):S=new URL(C.source,this.map.consumer().sourceRoot||i(this.map.mapFile));let E={column:C.column,endColumn:v&&v.column,endLine:v&&v.line,line:C.line,url:S.toString()};if(S.protocol==="file:")if(r)E.file=r(S);else throw new Error("file: protocol is not available in this PostCSS build");let R=w.sourceContentFor(C.source);return R&&(E.source=R),E}toJSON(){let p={};for(let g of["hasBOM","css","file","id"])this[g]!=null&&(p[g]=this[g]);return this.map&&(p.map=P({},this.map),p.map.consumerCache&&(p.map.consumerCache=void 0)),p}get from(){return this.file||this.id}}return or=f,f.default=f,u&&u.registerInput&&u.registerInput(f),or}var ar,fi;function Vn(){if(fi)return ar;fi=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=be,{dirname:r,relative:i,resolve:s,sep:a}=be,{pathToFileURL:o}=be,u=$t(),l=!!(e&&t),c=!!(r&&s&&i&&a);class n{constructor(h,f,m,p){this.stringify=h,this.mapOpts=m.map||{},this.root=f,this.opts=m,this.css=p,this.originalCSS=p,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let h;this.isInline()?h="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?h=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?h=this.mapOpts.annotation(this.opts.to,this.root):h=this.outputFile()+".map";let f=`
|
|
34
|
+
`;this.css.includes(`\r
|
|
35
|
+
`)&&(f=`\r
|
|
36
|
+
`),this.css+=f+"/*# sourceMappingURL="+h+" */"}applyPrevMaps(){for(let h of this.previous()){let f=this.toUrl(this.path(h.file)),m=h.root||r(h.file),p;this.mapOpts.sourcesContent===!1?(p=new e(h.text),p.sourcesContent&&(p.sourcesContent=null)):p=h.consumer(),this.map.applySourceMap(p,f,this.toUrl(this.path(m)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let h;for(let f=this.root.nodes.length-1;f>=0;f--)h=this.root.nodes[f],h.type==="comment"&&h.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(f)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),c&&l&&this.isMap())return this.generateMap();{let h="";return this.stringify(this.root,f=>{h+=f}),[h]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let h=this.previous()[0].consumer();h.file=this.outputFile(),this.map=t.fromSourceMap(h,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});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 t({file:this.outputFile(),ignoreInvalidMapping:!0});let h=1,f=1,m="<no source>",p={generated:{column:0,line:0},original:{column:0,line:0},source:""},g,b;this.stringify(this.root,(y,w,C)=>{if(this.css+=y,w&&C!=="end"&&(p.generated.line=h,p.generated.column=f-1,w.source&&w.source.start?(p.source=this.sourcePath(w),p.original.line=w.source.start.line,p.original.column=w.source.start.column-1,this.map.addMapping(p)):(p.source=m,p.original.line=1,p.original.column=0,this.map.addMapping(p))),g=y.match(/\n/g),g?(h+=g.length,b=y.lastIndexOf(`
|
|
37
|
+
`),f=y.length-b):f+=y.length,w&&C!=="start"){let v=w.parent||{raws:{}};(!(w.type==="decl"||w.type==="atrule"&&!w.nodes)||w!==v.last||v.raws.semicolon)&&(w.source&&w.source.end?(p.source=this.sourcePath(w),p.original.line=w.source.end.line,p.original.column=w.source.end.column-1,p.generated.line=h,p.generated.column=f-2,this.map.addMapping(p)):(p.source=m,p.original.line=1,p.original.column=0,p.generated.line=h,p.generated.column=f-1,this.map.addMapping(p)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation!="undefined"?this.mapOpts.annotation:this.previous().length?this.previous().some(h=>h.annotation):!0}isInline(){if(typeof this.mapOpts.inline!="undefined")return this.mapOpts.inline;let h=this.mapOpts.annotation;return typeof h!="undefined"&&h!==!0?!1:this.previous().length?this.previous().some(f=>f.inline):!0}isMap(){return typeof this.opts.map!="undefined"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent!="undefined"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(h=>h.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(h){if(this.mapOpts.absolute||h.charCodeAt(0)===60||/^\w+:\/\//.test(h))return h;let f=this.memoizedPaths.get(h);if(f)return f;let m=this.opts.to?r(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(m=r(s(m,this.mapOpts.annotation)));let p=i(m,h);return this.memoizedPaths.set(h,p),p}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(h=>{if(h.source&&h.source.input.map){let f=h.source.input.map;this.previousMaps.includes(f)||this.previousMaps.push(f)}});else{let h=new u(this.originalCSS,this.opts);h.map&&this.previousMaps.push(h.map)}return this.previousMaps}setSourcesContent(){let h={};if(this.root)this.root.walk(f=>{if(f.source){let m=f.source.input.from;if(m&&!h[m]){h[m]=!0;let p=this.usesFileUrls?this.toFileUrl(m):this.toUrl(this.path(m));this.map.setSourceContent(p,f.source.input.css)}}});else if(this.css){let f=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(f,this.css)}}sourcePath(h){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(h.source.input.from):this.toUrl(this.path(h.source.input.from))}toBase64(h){return Buffer?Buffer.from(h).toString("base64"):window.btoa(unescape(encodeURIComponent(h)))}toFileUrl(h){let f=this.memoizedFileURLs.get(h);if(f)return f;if(o){let m=o(h).toString();return this.memoizedFileURLs.set(h,m),m}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(h){let f=this.memoizedURLs.get(h);if(f)return f;a==="\\"&&(h=h.replace(/\\/g,"/"));let m=encodeURI(h).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(h,m),m}}return ar=n,ar}var lr,di;function Wt(){if(di)return lr;di=1;let e=Ut();class t extends e{constructor(i){super(i),this.type="comment"}}return lr=t,t.default=t,lr}var ur,pi;function Fe(){if(pi)return ur;pi=1;let{isClean:e,my:t}=gs(),r=Bt(),i=Wt(),s=Ut(),a,o,u,l;function c(h){return h.map(f=>(f.nodes&&(f.nodes=c(f.nodes)),delete f.source,f))}function n(h){if(h[e]=!1,h.proxyOf.nodes)for(let f of h.proxyOf.nodes)n(f)}class d extends s{append(...f){for(let m of f){let p=this.normalize(m,this.last);for(let g of p)this.proxyOf.nodes.push(g)}return this.markDirty(),this}cleanRaws(f){if(super.cleanRaws(f),this.nodes)for(let m of this.nodes)m.cleanRaws(f)}each(f){if(!this.proxyOf.nodes)return;let m=this.getIterator(),p,g;for(;this.indexes[m]<this.proxyOf.nodes.length&&(p=this.indexes[m],g=f(this.proxyOf.nodes[p],p),g!==!1);)this.indexes[m]+=1;return delete this.indexes[m],g}every(f){return this.nodes.every(f)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let f=this.lastEach;return this.indexes[f]=0,f}getProxyProcessor(){return{get(f,m){return m==="proxyOf"?f:f[m]?m==="each"||typeof m=="string"&&m.startsWith("walk")?(...p)=>f[m](...p.map(g=>typeof g=="function"?(b,y)=>g(b.toProxy(),y):g)):m==="every"||m==="some"?p=>f[m]((g,...b)=>p(g.toProxy(),...b)):m==="root"?()=>f.root().toProxy():m==="nodes"?f.nodes.map(p=>p.toProxy()):m==="first"||m==="last"?f[m].toProxy():f[m]:f[m]},set(f,m,p){return f[m]===p||(f[m]=p,(m==="name"||m==="params"||m==="selector")&&f.markDirty()),!0}}}index(f){return typeof f=="number"?f:(f.proxyOf&&(f=f.proxyOf),this.proxyOf.nodes.indexOf(f))}insertAfter(f,m){let p=this.index(f),g=this.normalize(m,this.proxyOf.nodes[p]).reverse();p=this.index(f);for(let y of g)this.proxyOf.nodes.splice(p+1,0,y);let b;for(let y in this.indexes)b=this.indexes[y],p<b&&(this.indexes[y]=b+g.length);return this.markDirty(),this}insertBefore(f,m){let p=this.index(f),g=p===0?"prepend":!1,b=this.normalize(m,this.proxyOf.nodes[p],g).reverse();p=this.index(f);for(let w of b)this.proxyOf.nodes.splice(p,0,w);let y;for(let w in this.indexes)y=this.indexes[w],p<=y&&(this.indexes[w]=y+b.length);return this.markDirty(),this}normalize(f,m){if(typeof f=="string")f=c(a(f).nodes);else if(typeof f=="undefined")f=[];else if(Array.isArray(f)){f=f.slice(0);for(let g of f)g.parent&&g.parent.removeChild(g,"ignore")}else if(f.type==="root"&&this.type!=="document"){f=f.nodes.slice(0);for(let g of f)g.parent&&g.parent.removeChild(g,"ignore")}else if(f.type)f=[f];else if(f.prop){if(typeof f.value=="undefined")throw new Error("Value field is missed in node creation");typeof f.value!="string"&&(f.value=String(f.value)),f=[new r(f)]}else if(f.selector)f=[new o(f)];else if(f.name)f=[new u(f)];else if(f.text)f=[new i(f)];else throw new Error("Unknown node type in node creation");return f.map(g=>(g[t]||d.rebuild(g),g=g.proxyOf,g.parent&&g.parent.removeChild(g),g[e]&&n(g),typeof g.raws.before=="undefined"&&m&&typeof m.raws.before!="undefined"&&(g.raws.before=m.raws.before.replace(/\S/g,"")),g.parent=this.proxyOf,g))}prepend(...f){f=f.reverse();for(let m of f){let p=this.normalize(m,this.first,"prepend").reverse();for(let g of p)this.proxyOf.nodes.unshift(g);for(let g in this.indexes)this.indexes[g]=this.indexes[g]+p.length}return this.markDirty(),this}push(f){return f.parent=this,this.proxyOf.nodes.push(f),this}removeAll(){for(let f of this.proxyOf.nodes)f.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(f){f=this.index(f),this.proxyOf.nodes[f].parent=void 0,this.proxyOf.nodes.splice(f,1);let m;for(let p in this.indexes)m=this.indexes[p],m>=f&&(this.indexes[p]=m-1);return this.markDirty(),this}replaceValues(f,m,p){return p||(p=m,m={}),this.walkDecls(g=>{m.props&&!m.props.includes(g.prop)||m.fast&&!g.value.includes(m.fast)||(g.value=g.value.replace(f,p))}),this.markDirty(),this}some(f){return this.nodes.some(f)}walk(f){return this.each((m,p)=>{let g;try{g=f(m,p)}catch(b){throw m.addToError(b)}return g!==!1&&m.walk&&(g=m.walk(f)),g})}walkAtRules(f,m){return m?f instanceof RegExp?this.walk((p,g)=>{if(p.type==="atrule"&&f.test(p.name))return m(p,g)}):this.walk((p,g)=>{if(p.type==="atrule"&&p.name===f)return m(p,g)}):(m=f,this.walk((p,g)=>{if(p.type==="atrule")return m(p,g)}))}walkComments(f){return this.walk((m,p)=>{if(m.type==="comment")return f(m,p)})}walkDecls(f,m){return m?f instanceof RegExp?this.walk((p,g)=>{if(p.type==="decl"&&f.test(p.prop))return m(p,g)}):this.walk((p,g)=>{if(p.type==="decl"&&p.prop===f)return m(p,g)}):(m=f,this.walk((p,g)=>{if(p.type==="decl")return m(p,g)}))}walkRules(f,m){return m?f instanceof RegExp?this.walk((p,g)=>{if(p.type==="rule"&&f.test(p.selector))return m(p,g)}):this.walk((p,g)=>{if(p.type==="rule"&&p.selector===f)return m(p,g)}):(m=f,this.walk((p,g)=>{if(p.type==="rule")return m(p,g)}))}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]}}return d.registerParse=h=>{a=h},d.registerRule=h=>{o=h},d.registerAtRule=h=>{u=h},d.registerRoot=h=>{l=h},ur=d,d.default=d,d.rebuild=h=>{h.type==="atrule"?Object.setPrototypeOf(h,u.prototype):h.type==="rule"?Object.setPrototypeOf(h,o.prototype):h.type==="decl"?Object.setPrototypeOf(h,r.prototype):h.type==="comment"?Object.setPrototypeOf(h,i.prototype):h.type==="root"&&Object.setPrototypeOf(h,l.prototype),h[t]=!0,h.nodes&&h.nodes.forEach(f=>{d.rebuild(f)})},ur}var cr,mi;function ys(){if(mi)return cr;mi=1;let e=Fe(),t,r;class i extends e{constructor(a){super(P({type:"document"},a)),this.nodes||(this.nodes=[])}toResult(a={}){return new t(new r,this,a).stringify()}}return i.registerLazyResult=s=>{t=s},i.registerProcessor=s=>{r=s},cr=i,i.default=i,cr}var hr,gi;function qn(){if(gi)return hr;gi=1;let e={};return hr=function(r){e[r]||(e[r]=!0,typeof console!="undefined"&&console.warn&&console.warn(r))},hr}var fr,yi;function jn(){if(yi)return fr;yi=1;class e{constructor(r,i={}){if(this.type="warning",this.text=r,i.node&&i.node.source){let s=i.node.rangeBy(i);this.line=s.start.line,this.column=s.start.column,this.endLine=s.end.line,this.endColumn=s.end.column}for(let s in i)this[s]=i[s]}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}}return fr=e,e.default=e,fr}var dr,wi;function ws(){if(wi)return dr;wi=1;let e=jn();class t{constructor(i,s,a){this.processor=i,this.messages=[],this.root=s,this.opts=a,this.css=void 0,this.map=void 0}toString(){return this.css}warn(i,s={}){s.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(s.plugin=this.lastPlugin.postcssPlugin);let a=new e(i,s);return this.messages.push(a),a}warnings(){return this.messages.filter(i=>i.type==="warning")}get content(){return this.css}}return dr=t,t.default=t,dr}var pr,bi;function qa(){if(bi)return pr;bi=1;const e=39,t=34,r=92,i=47,s=10,a=32,o=12,u=9,l=13,c=91,n=93,d=40,h=41,f=123,m=125,p=59,g=42,b=58,y=64,w=/[\t\n\f\r "#'()/;[\\\]{}]/g,C=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,v=/.[\r\n"'(/\\]/,S=/[\da-f]/i;return pr=function(R,I={}){let N=R.css.valueOf(),L=I.ignoreErrors,k,x,ae,le,q,D,H,te,J,j,De=N.length,O=0,Ce=[],ue=[];function $e(){return O}function Ee(se){throw R.error("Unclosed "+se,O)}function tt(){return ue.length===0&&O>=De}function me(se){if(ue.length)return ue.pop();if(O>=De)return;let pe=se?se.ignoreUnclosed:!1;switch(k=N.charCodeAt(O),k){case s:case a:case u:case l:case o:{x=O;do x+=1,k=N.charCodeAt(x);while(k===a||k===s||k===u||k===l||k===o);j=["space",N.slice(O,x)],O=x-1;break}case c:case n:case f:case m:case b:case p:case h:{let B=String.fromCharCode(k);j=[B,B,O];break}case d:{if(te=Ce.length?Ce.pop()[1]:"",J=N.charCodeAt(O+1),te==="url"&&J!==e&&J!==t&&J!==a&&J!==s&&J!==u&&J!==o&&J!==l){x=O;do{if(D=!1,x=N.indexOf(")",x+1),x===-1)if(L||pe){x=O;break}else Ee("bracket");for(H=x;N.charCodeAt(H-1)===r;)H-=1,D=!D}while(D);j=["brackets",N.slice(O,x+1),O,x],O=x}else x=N.indexOf(")",O+1),le=N.slice(O,x+1),x===-1||v.test(le)?j=["(","(",O]:(j=["brackets",le,O,x],O=x);break}case e:case t:{ae=k===e?"'":'"',x=O;do{if(D=!1,x=N.indexOf(ae,x+1),x===-1)if(L||pe){x=O+1;break}else Ee("string");for(H=x;N.charCodeAt(H-1)===r;)H-=1,D=!D}while(D);j=["string",N.slice(O,x+1),O,x],O=x;break}case y:{w.lastIndex=O+1,w.test(N),w.lastIndex===0?x=N.length-1:x=w.lastIndex-2,j=["at-word",N.slice(O,x+1),O,x],O=x;break}case r:{for(x=O,q=!0;N.charCodeAt(x+1)===r;)x+=1,q=!q;if(k=N.charCodeAt(x+1),q&&k!==i&&k!==a&&k!==s&&k!==u&&k!==l&&k!==o&&(x+=1,S.test(N.charAt(x)))){for(;S.test(N.charAt(x+1));)x+=1;N.charCodeAt(x+1)===a&&(x+=1)}j=["word",N.slice(O,x+1),O,x],O=x;break}default:{k===i&&N.charCodeAt(O+1)===g?(x=N.indexOf("*/",O+2)+1,x===0&&(L||pe?x=N.length:Ee("comment")),j=["comment",N.slice(O,x+1),O,x],O=x):(C.lastIndex=O+1,C.test(N),C.lastIndex===0?x=N.length-1:x=C.lastIndex-2,j=["word",N.slice(O,x+1),O,x],Ce.push(j),O=x);break}}return O++,j}function ge(se){ue.push(se)}return{back:ge,endOfFile:tt,nextToken:me,position:$e}},pr}var mr,vi;function bs(){if(vi)return mr;vi=1;let e=Fe();class t extends e{constructor(i){super(i),this.type="atrule"}append(...i){return this.proxyOf.nodes||(this.nodes=[]),super.append(...i)}prepend(...i){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...i)}}return mr=t,t.default=t,e.registerAtRule(t),mr}var gr,Si;function at(){if(Si)return gr;Si=1;let e=Fe(),t,r;class i extends e{constructor(a){super(a),this.type="root",this.nodes||(this.nodes=[])}normalize(a,o,u){let l=super.normalize(a);if(o){if(u==="prepend")this.nodes.length>1?o.raws.before=this.nodes[1].raws.before:delete o.raws.before;else if(this.first!==o)for(let c of l)c.raws.before=o.raws.before}return l}removeChild(a,o){let u=this.index(a);return!o&&u===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[u].raws.before),super.removeChild(a)}toResult(a={}){return new t(new r,this,a).stringify()}}return i.registerLazyResult=s=>{t=s},i.registerProcessor=s=>{r=s},gr=i,i.default=i,e.registerRoot(i),gr}var yr,Ci;function Gn(){if(Ci)return yr;Ci=1;let e={comma(t){return e.split(t,[","],!0)},space(t){let r=[" ",`
|
|
38
|
+
`," "];return e.split(t,r)},split(t,r,i){let s=[],a="",o=!1,u=0,l=!1,c="",n=!1;for(let d of t)n?n=!1:d==="\\"?n=!0:l?d===c&&(l=!1):d==='"'||d==="'"?(l=!0,c=d):d==="("?u+=1:d===")"?u>0&&(u-=1):u===0&&r.includes(d)&&(o=!0),o?(a!==""&&s.push(a.trim()),a="",o=!1):a+=d;return(i||a!=="")&&s.push(a.trim()),s}};return yr=e,e.default=e,yr}var wr,Ei;function vs(){if(Ei)return wr;Ei=1;let e=Fe(),t=Gn();class r extends e{constructor(s){super(s),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.comma(this.selector)}set selectors(s){let a=this.selector?this.selector.match(/,\s*/):null,o=a?a[0]:","+this.raw("between","beforeOpen");this.selector=s.join(o)}}return wr=r,r.default=r,e.registerRule(r),wr}var br,xi;function ja(){if(xi)return br;xi=1;let e=Bt(),t=qa(),r=Wt(),i=bs(),s=at(),a=vs();const o={empty:!0,space:!0};function u(c){for(let n=c.length-1;n>=0;n--){let d=c[n],h=d[3]||d[2];if(h)return h}}class l{constructor(n){this.input=n,this.root=new s,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:n,start:{column:1,line:1,offset:0}}}atrule(n){let d=new i;d.name=n[1].slice(1),d.name===""&&this.unnamedAtrule(d,n),this.init(d,n[2]);let h,f,m,p=!1,g=!1,b=[],y=[];for(;!this.tokenizer.endOfFile();){if(n=this.tokenizer.nextToken(),h=n[0],h==="("||h==="["?y.push(h==="("?")":"]"):h==="{"&&y.length>0?y.push("}"):h===y[y.length-1]&&y.pop(),y.length===0)if(h===";"){d.source.end=this.getPosition(n[2]),d.source.end.offset++,this.semicolon=!0;break}else if(h==="{"){g=!0;break}else if(h==="}"){if(b.length>0){for(m=b.length-1,f=b[m];f&&f[0]==="space";)f=b[--m];f&&(d.source.end=this.getPosition(f[3]||f[2]),d.source.end.offset++)}this.end(n);break}else b.push(n);else b.push(n);if(this.tokenizer.endOfFile()){p=!0;break}}d.raws.between=this.spacesAndCommentsFromEnd(b),b.length?(d.raws.afterName=this.spacesAndCommentsFromStart(b),this.raw(d,"params",b),p&&(n=b[b.length-1],d.source.end=this.getPosition(n[3]||n[2]),d.source.end.offset++,this.spaces=d.raws.between,d.raws.between="")):(d.raws.afterName="",d.params=""),g&&(d.nodes=[],this.current=d)}checkMissedSemicolon(n){let d=this.colon(n);if(d===!1)return;let h=0,f;for(let m=d-1;m>=0&&(f=n[m],!(f[0]!=="space"&&(h+=1,h===2)));m--);throw this.input.error("Missed semicolon",f[0]==="word"?f[3]+1:f[2])}colon(n){let d=0,h,f,m;for(let[p,g]of n.entries()){if(h=g,f=h[0],f==="("&&(d+=1),f===")"&&(d-=1),d===0&&f===":")if(!m)this.doubleColon(h);else{if(m[0]==="word"&&m[1]==="progid")continue;return p}m=h}return!1}comment(n){let d=new r;this.init(d,n[2]),d.source.end=this.getPosition(n[3]||n[2]),d.source.end.offset++;let h=n[1].slice(2,-2);if(/^\s*$/.test(h))d.text="",d.raws.left=h,d.raws.right="";else{let f=h.match(/^(\s*)([^]*\S)(\s*)$/);d.text=f[2],d.raws.left=f[1],d.raws.right=f[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(n,d){let h=new e;this.init(h,n[0][2]);let f=n[n.length-1];for(f[0]===";"&&(this.semicolon=!0,n.pop()),h.source.end=this.getPosition(f[3]||f[2]||u(n)),h.source.end.offset++;n[0][0]!=="word";)n.length===1&&this.unknownWord(n),h.raws.before+=n.shift()[1];for(h.source.start=this.getPosition(n[0][2]),h.prop="";n.length;){let y=n[0][0];if(y===":"||y==="space"||y==="comment")break;h.prop+=n.shift()[1]}h.raws.between="";let m;for(;n.length;)if(m=n.shift(),m[0]===":"){h.raws.between+=m[1];break}else m[0]==="word"&&/\w/.test(m[1])&&this.unknownWord([m]),h.raws.between+=m[1];(h.prop[0]==="_"||h.prop[0]==="*")&&(h.raws.before+=h.prop[0],h.prop=h.prop.slice(1));let p=[],g;for(;n.length&&(g=n[0][0],!(g!=="space"&&g!=="comment"));)p.push(n.shift());this.precheckMissedSemicolon(n);for(let y=n.length-1;y>=0;y--){if(m=n[y],m[1].toLowerCase()==="!important"){h.important=!0;let w=this.stringFrom(n,y);w=this.spacesFromEnd(n)+w,w!==" !important"&&(h.raws.important=w);break}else if(m[1].toLowerCase()==="important"){let w=n.slice(0),C="";for(let v=y;v>0;v--){let S=w[v][0];if(C.trim().indexOf("!")===0&&S!=="space")break;C=w.pop()[1]+C}C.trim().indexOf("!")===0&&(h.important=!0,h.raws.important=C,n=w)}if(m[0]!=="space"&&m[0]!=="comment")break}n.some(y=>y[0]!=="space"&&y[0]!=="comment")&&(h.raws.between+=p.map(y=>y[1]).join(""),p=[]),this.raw(h,"value",p.concat(n),d),h.value.includes(":")&&!d&&this.checkMissedSemicolon(n)}doubleColon(n){throw this.input.error("Double colon",{offset:n[2]},{offset:n[2]+n[1].length})}emptyRule(n){let d=new a;this.init(d,n[2]),d.selector="",d.raws.between="",this.current=d}end(n){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(n[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(n)}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(n){if(this.spaces+=n[1],this.current.nodes){let d=this.current.nodes[this.current.nodes.length-1];d&&d.type==="rule"&&!d.raws.ownSemicolon&&(d.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(n){let d=this.input.fromOffset(n);return{column:d.col,line:d.line,offset:n}}init(n,d){this.current.push(n),n.source={input:this.input,start:this.getPosition(d)},n.raws.before=this.spaces,this.spaces="",n.type!=="comment"&&(this.semicolon=!1)}other(n){let d=!1,h=null,f=!1,m=null,p=[],g=n[1].startsWith("--"),b=[],y=n;for(;y;){if(h=y[0],b.push(y),h==="("||h==="[")m||(m=y),p.push(h==="("?")":"]");else if(g&&f&&h==="{")m||(m=y),p.push("}");else if(p.length===0)if(h===";")if(f){this.decl(b,g);return}else break;else if(h==="{"){this.rule(b);return}else if(h==="}"){this.tokenizer.back(b.pop()),d=!0;break}else h===":"&&(f=!0);else h===p[p.length-1]&&(p.pop(),p.length===0&&(m=null));y=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(d=!0),p.length>0&&this.unclosedBracket(m),d&&f){if(!g)for(;b.length&&(y=b[b.length-1][0],!(y!=="space"&&y!=="comment"));)this.tokenizer.back(b.pop());this.decl(b,g)}else this.unknownWord(b)}parse(){let n;for(;!this.tokenizer.endOfFile();)switch(n=this.tokenizer.nextToken(),n[0]){case"space":this.spaces+=n[1];break;case";":this.freeSemicolon(n);break;case"}":this.end(n);break;case"comment":this.comment(n);break;case"at-word":this.atrule(n);break;case"{":this.emptyRule(n);break;default:this.other(n);break}this.endFile()}precheckMissedSemicolon(){}raw(n,d,h,f){let m,p,g=h.length,b="",y=!0,w,C;for(let v=0;v<g;v+=1)m=h[v],p=m[0],p==="space"&&v===g-1&&!f?y=!1:p==="comment"?(C=h[v-1]?h[v-1][0]:"empty",w=h[v+1]?h[v+1][0]:"empty",!o[C]&&!o[w]?b.slice(-1)===","?y=!1:b+=m[1]:y=!1):b+=m[1];if(!y){let v=h.reduce((S,E)=>S+E[1],"");n.raws[d]={raw:v,value:b}}n[d]=b}rule(n){n.pop();let d=new a;this.init(d,n[0][2]),d.raws.between=this.spacesAndCommentsFromEnd(n),this.raw(d,"selector",n),this.current=d}spacesAndCommentsFromEnd(n){let d,h="";for(;n.length&&(d=n[n.length-1][0],!(d!=="space"&&d!=="comment"));)h=n.pop()[1]+h;return h}spacesAndCommentsFromStart(n){let d,h="";for(;n.length&&(d=n[0][0],!(d!=="space"&&d!=="comment"));)h+=n.shift()[1];return h}spacesFromEnd(n){let d,h="";for(;n.length&&(d=n[n.length-1][0],d==="space");)h=n.pop()[1]+h;return h}stringFrom(n,d){let h="";for(let f=d;f<n.length;f++)h+=n[f][1];return n.splice(d,n.length-d),h}unclosedBlock(){let n=this.current.source.start;throw this.input.error("Unclosed block",n.line,n.column)}unclosedBracket(n){throw this.input.error("Unclosed bracket",{offset:n[2]},{offset:n[2]+1})}unexpectedClose(n){throw this.input.error("Unexpected }",{offset:n[2]},{offset:n[2]+1})}unknownWord(n){throw this.input.error("Unknown word",{offset:n[0][2]},{offset:n[0][2]+n[0][1].length})}unnamedAtrule(n,d){throw this.input.error("At-rule without name",{offset:d[2]},{offset:d[2]+d[1].length})}}return br=l,br}var vr,Ri;function Ss(){if(Ri)return vr;Ri=1;let e=Fe(),t=ja(),r=$t();function i(s,a){let o=new r(s,a),u=new t(o);try{u.parse()}catch(l){throw l}return u.root}return vr=i,i.default=i,e.registerParse(i),vr}var Sr,Mi;function Hn(){if(Mi)return Sr;Mi=1;let{isClean:e,my:t}=gs(),r=Vn(),i=Ft(),s=Fe(),a=ys(),o=qn(),u=ws(),l=Ss(),c=at();const n={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},d={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},h={Once:!0,postcssPlugin:!0,prepare:!0},f=0;function m(C){return typeof C=="object"&&typeof C.then=="function"}function p(C){let v=!1,S=n[C.type];return C.type==="decl"?v=C.prop.toLowerCase():C.type==="atrule"&&(v=C.name.toLowerCase()),v&&C.append?[S,S+"-"+v,f,S+"Exit",S+"Exit-"+v]:v?[S,S+"-"+v,S+"Exit",S+"Exit-"+v]:C.append?[S,f,S+"Exit"]:[S,S+"Exit"]}function g(C){let v;return C.type==="document"?v=["Document",f,"DocumentExit"]:C.type==="root"?v=["Root",f,"RootExit"]:v=p(C),{eventIndex:0,events:v,iterator:0,node:C,visitorIndex:0,visitors:[]}}function b(C){return C[e]=!1,C.nodes&&C.nodes.forEach(v=>b(v)),C}let y={};class w{constructor(v,S,E){this.stringified=!1,this.processed=!1;let R;if(typeof S=="object"&&S!==null&&(S.type==="root"||S.type==="document"))R=b(S);else if(S instanceof w||S instanceof u)R=b(S.root),S.map&&(typeof E.map=="undefined"&&(E.map={}),E.map.inline||(E.map.inline=!1),E.map.prev=S.map);else{let I=l;E.syntax&&(I=E.syntax.parse),E.parser&&(I=E.parser),I.parse&&(I=I.parse);try{R=I(S,E)}catch(N){this.processed=!0,this.error=N}R&&!R[t]&&s.rebuild(R)}this.result=new u(v,R,E),this.helpers=re(P({},y),{postcss:y,result:this.result}),this.plugins=this.processor.plugins.map(I=>typeof I=="object"&&I.prepare?P(P({},I),I.prepare(this.result)):I)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(v){return this.async().catch(v)}finally(v){return this.async().then(v,v)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(v,S){let E=this.result.lastPlugin;try{S&&S.addToError(v),this.error=v,v.name==="CssSyntaxError"&&!v.plugin?(v.plugin=E.postcssPlugin,v.setMessage()):E.postcssVersion}catch(R){console&&console.error&&console.error(R)}return v}prepareVisitors(){this.listeners={};let v=(S,E,R)=>{this.listeners[E]||(this.listeners[E]=[]),this.listeners[E].push([S,R])};for(let S of this.plugins)if(typeof S=="object")for(let E in S){if(!d[E]&&/^[A-Z]/.test(E))throw new Error(`Unknown event ${E} in ${S.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!h[E])if(typeof S[E]=="object")for(let R in S[E])R==="*"?v(S,E,S[E][R]):v(S,E+"-"+R.toLowerCase(),S[E][R]);else typeof S[E]=="function"&&v(S,E,S[E])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let v=0;v<this.plugins.length;v++){let S=this.plugins[v],E=this.runOnRoot(S);if(m(E))try{await E}catch(R){throw this.handleError(R)}}if(this.prepareVisitors(),this.hasListener){let v=this.result.root;for(;!v[e];){v[e]=!0;let S=[g(v)];for(;S.length>0;){let E=this.visitTick(S);if(m(E))try{await E}catch(R){let I=S[S.length-1].node;throw this.handleError(R,I)}}}if(this.listeners.OnceExit)for(let[S,E]of this.listeners.OnceExit){this.result.lastPlugin=S;try{if(v.type==="document"){let R=v.nodes.map(I=>E(I,this.helpers));await Promise.all(R)}else await E(v,this.helpers)}catch(R){throw this.handleError(R)}}}return this.processed=!0,this.stringify()}runOnRoot(v){this.result.lastPlugin=v;try{if(typeof v=="object"&&v.Once){if(this.result.root.type==="document"){let S=this.result.root.nodes.map(E=>v.Once(E,this.helpers));return m(S[0])?Promise.all(S):S}return v.Once(this.result.root,this.helpers)}else if(typeof v=="function")return v(this.result.root,this.result)}catch(S){throw this.handleError(S)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let v=this.result.opts,S=i;v.syntax&&(S=v.syntax.stringify),v.stringifier&&(S=v.stringifier),S.stringify&&(S=S.stringify);let R=new r(S,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 v of this.plugins){let S=this.runOnRoot(v);if(m(S))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let v=this.result.root;for(;!v[e];)v[e]=!0,this.walkSync(v);if(this.listeners.OnceExit)if(v.type==="document")for(let S of v.nodes)this.visitSync(this.listeners.OnceExit,S);else this.visitSync(this.listeners.OnceExit,v)}return this.result}then(v,S){return this.async().then(v,S)}toString(){return this.css}visitSync(v,S){for(let[E,R]of v){this.result.lastPlugin=E;let I;try{I=R(S,this.helpers)}catch(N){throw this.handleError(N,S.proxyOf)}if(S.type!=="root"&&S.type!=="document"&&!S.parent)return!0;if(m(I))throw this.getAsyncError()}}visitTick(v){let S=v[v.length-1],{node:E,visitors:R}=S;if(E.type!=="root"&&E.type!=="document"&&!E.parent){v.pop();return}if(R.length>0&&S.visitorIndex<R.length){let[N,L]=R[S.visitorIndex];S.visitorIndex+=1,S.visitorIndex===R.length&&(S.visitors=[],S.visitorIndex=0),this.result.lastPlugin=N;try{return L(E.toProxy(),this.helpers)}catch(k){throw this.handleError(k,E)}}if(S.iterator!==0){let N=S.iterator,L;for(;L=E.nodes[E.indexes[N]];)if(E.indexes[N]+=1,!L[e]){L[e]=!0,v.push(g(L));return}S.iterator=0,delete E.indexes[N]}let I=S.events;for(;S.eventIndex<I.length;){let N=I[S.eventIndex];if(S.eventIndex+=1,N===f){E.nodes&&E.nodes.length&&(E[e]=!0,S.iterator=E.getIterator());return}else if(this.listeners[N]){S.visitors=this.listeners[N];return}}v.pop()}walkSync(v){v[e]=!0;let S=p(v);for(let E of S)if(E===f)v.nodes&&v.each(R=>{R[e]||this.walkSync(R)});else{let R=this.listeners[E];if(R&&this.visitSync(R,v.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"}}return w.registerPostcss=C=>{y=C},Sr=w,w.default=w,c.registerLazyResult(w),a.registerLazyResult(w),Sr}var Cr,Ni;function Ga(){if(Ni)return Cr;Ni=1;let e=Vn(),t=Ft(),r=qn(),i=Ss();const s=ws();class a{constructor(u,l,c){l=l.toString(),this.stringified=!1,this._processor=u,this._css=l,this._opts=c,this._map=void 0;let n,d=t;this.result=new s(this._processor,n,this._opts),this.result.css=l;let h=this;Object.defineProperty(this.result,"root",{get(){return h.root}});let f=new e(d,n,this._opts,l);if(f.isMap()){let[m,p]=f.generate();m&&(this.result.css=m),p&&(this.result.map=p)}else f.clearAnnotation(),this.result.css=f.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(u){return this.async().catch(u)}finally(u){return this.async().then(u,u)}sync(){if(this.error)throw this.error;return this.result}then(u,l){return this.async().then(u,l)}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 u,l=i;try{u=l(this._css,this._opts)}catch(c){this.error=c}if(this.error)throw this.error;return this._root=u,u}get[Symbol.toStringTag](){return"NoWorkResult"}}return Cr=a,a.default=a,Cr}var Er,Oi;function Ha(){if(Oi)return Er;Oi=1;let e=Ga(),t=Hn(),r=ys(),i=at();class s{constructor(o=[]){this.version="8.4.38",this.plugins=this.normalize(o)}normalize(o){let u=[];for(let l of o)if(l.postcss===!0?l=l():l.postcss&&(l=l.postcss),typeof l=="object"&&Array.isArray(l.plugins))u=u.concat(l.plugins);else if(typeof l=="object"&&l.postcssPlugin)u.push(l);else if(typeof l=="function")u.push(l);else if(!(typeof l=="object"&&(l.parse||l.stringify)))throw new Error(l+" is not a PostCSS plugin");return u}process(o,u={}){return!this.plugins.length&&!u.parser&&!u.stringifier&&!u.syntax?new e(this,o,u):new t(this,o,u)}use(o){return this.plugins=this.plugins.concat(this.normalize([o])),this}}return Er=s,s.default=s,i.registerProcessor(s),r.registerProcessor(s),Er}var xr,Ii;function Ya(){if(Ii)return xr;Ii=1;let e=Bt(),t=zn(),r=Wt(),i=bs(),s=$t(),a=at(),o=vs();function u(l,c){if(Array.isArray(l))return l.map(m=>u(m));let h=l,{inputs:n}=h,d=We(h,["inputs"]);if(n){c=[];for(let m of n){let p=re(P({},m),{__proto__:s.prototype});p.map&&(p.map=re(P({},p.map),{__proto__:t.prototype})),c.push(p)}}if(d.nodes&&(d.nodes=l.nodes.map(m=>u(m,c))),d.source){let f=d.source,{inputId:m}=f,p=We(f,["inputId"]);d.source=p,m!=null&&(d.source.input=c[m])}if(d.type==="root")return new a(d);if(d.type==="decl")return new e(d);if(d.type==="rule")return new o(d);if(d.type==="comment")return new r(d);if(d.type==="atrule")return new i(d);throw new Error("Unknown node type: "+l.type)}return xr=u,u.default=u,xr}var Rr,Di;function Xa(){if(Di)return Rr;Di=1;let e=ms(),t=Bt(),r=Hn(),i=Fe(),s=Ha(),a=Ft(),o=Ya(),u=ys(),l=jn(),c=Wt(),n=bs(),d=ws(),h=$t(),f=Ss(),m=Gn(),p=vs(),g=at(),b=Ut();function y(...w){return w.length===1&&Array.isArray(w[0])&&(w=w[0]),new s(w)}return y.plugin=function(C,v){let S=!1;function E(...I){console&&console.warn&&!S&&(S=!0,console.warn(C+`: postcss.plugin was deprecated. Migration guide:
|
|
39
|
+
https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(C+`: \u91CC\u9762 postcss.plugin \u88AB\u5F03\u7528. \u8FC1\u79FB\u6307\u5357:
|
|
40
|
+
https://www.w3ctech.com/topic/2226`));let N=v(...I);return N.postcssPlugin=C,N.postcssVersion=new s().version,N}let R;return Object.defineProperty(E,"postcss",{get(){return R||(R=E()),R}}),E.process=function(I,N,L){return y([E(L)]).process(I,N)},E},y.stringify=a,y.parse=f,y.fromJSON=o,y.list=m,y.comment=w=>new c(w),y.atRule=w=>new n(w),y.decl=w=>new t(w),y.rule=w=>new p(w),y.root=w=>new g(w),y.document=w=>new u(w),y.CssSyntaxError=e,y.Declaration=t,y.Container=i,y.Processor=s,y.Document=u,y.Comment=c,y.Warning=l,y.AtRule=n,y.Result=d,y.Input=h,y.Rule=p,y.Root=g,y.Node=b,r.registerPostcss(y),Rr=y,y.default=y,Rr}var Ja=Xa();const X=Ua(Ja);X.stringify;X.fromJSON;X.plugin;X.parse;X.list;X.document;X.comment;X.atRule;X.rule;X.decl;X.root;X.CssSyntaxError;X.Declaration;X.Container;X.Processor;X.Document;X.Comment;X.Warning;X.AtRule;X.Result;X.Input;X.Rule;X.Root;X.Node;const Ai={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};function Qa(e){let t=Ai[e.tagName]?Ai[e.tagName]:e.tagName;return t==="link"&&e.attributes._cssText&&(t="style"),t}function zt(e,t){const r=t==null?void 0:t.stylesWithHoverClass.get(e);if(r)return r;let i=e;try{i=X([La,Fa]).process(e).css}catch(s){console.warn("Failed to adapt css for replay",s)}return t==null||t.stylesWithHoverClass.set(e,i),i}function Ti(){return{stylesWithHoverClass:new Map}}const Za="rrweb-snapshot.rebuild() cannot rebuild into an unprotected browser document. Use rebuildIntoSandboxedIframe() or set UNSAFE_allowUnprotectedRebuild: true only when you accept the script-execution risk.",_i="rrweb-snapshot.createSandboxedIframe() requires root to be connected to a document before creating a sandboxed iframe.",Yn=new WeakSet;function Ka(e){if(!e||e.tagName!=="IFRAME"||!("sandbox"in e))return!1;const t=Array.from(e.sandbox);return t.length===1&&t[0]==="allow-same-origin"}function el(e){if(e.UNSAFE_allowUnprotectedRebuild)return;const t=e.doc.defaultView;if(t&&!(Yn.has(e.doc)&&Ka(t.frameElement)))throw new Error(Za)}function tl(e,t,r,i){const s=[];for(const l of e.childNodes)l.type===U.Text&&s.push(l);const a=t.split("/* rr_split */");for(;a.length>1&&a.length>s.length;)a.splice(-2,2,a.slice(-2).join(""));let o="";r&&(o=zt(a.join(""),i));let u=0;for(let l=0;l<s.length&&l!==a.length;l++){const c=s[l];if(!r)c.textContent=a[l];else if(l<a.length-1){let n=u,d=a[l+1].length;d=Math.min(d,30);let h=!1;for(;d>2;d--){const f=a[l+1].substring(0,d),m=o.substring(u).indexOf(f);if(h=m!==-1,h){n+=m;break}}h||(n+=a[l].length),c.textContent=o.substring(u,n),u=n}else c.textContent=o.substring(u)}}function rl(e,t,r,i){const{doc:s,hackCss:a,cache:o}=i;e.childNodes.length?tl(e,r,a,o):(a&&(r=zt(r,o)),t.appendChild(s.createTextNode(r)))}function sl(e,t){var r;const{doc:i,hackCss:s,cache:a}=t;switch(e.type){case U.Document:return i.implementation.createDocument(null,"",null);case U.DocumentType:return i.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case U.Element:{const o=Qa(e);let u;e.isSVG?u=i.createElementNS("http://www.w3.org/2000/svg",o):(e.isCustom&&((r=i.defaultView)!=null&&r.customElements)&&!i.defaultView.customElements.get(e.tagName)&&i.defaultView.customElements.define(e.tagName,class extends i.defaultView.HTMLElement{}),u=i.createElement(o));const l={};for(const c in e.attributes){if(!Object.prototype.hasOwnProperty.call(e.attributes,c))continue;let n=e.attributes[c];if(!(o==="option"&&c==="selected"&&n===!1)&&n!==null){if(n===!0&&(n=""),c.startsWith("rr_")){l[c]=n;continue}if(typeof n=="string"){if(o==="style"&&c==="_cssText"){rl(e,u,n,t);continue}else if(o==="textarea"&&c==="value"){u.appendChild(i.createTextNode(n)),e.childNodes=[];continue}}try{if(e.isSVG&&c==="xlink:href")u.setAttributeNS("http://www.w3.org/1999/xlink",c,n.toString());else if(c==="onload"||c==="onclick"||c.substring(0,7)==="onmouse")u.setAttribute("_"+c,n.toString());else if(o==="meta"&&e.attributes["http-equiv"]==="Content-Security-Policy"&&c==="content"){u.setAttribute("csp-content",n.toString());continue}else o==="link"&&(e.attributes.rel==="preload"&&e.attributes.as==="script"||e.attributes.rel==="modulepreload")||o==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&ds(e.attributes.href)==="js"||(o==="img"&&e.attributes.srcset&&e.attributes.rr_dataURL?u.setAttribute("rrweb-original-srcset",e.attributes.srcset):u.setAttribute(c,n.toString()))}catch(d){}}}for(const c in l){const n=l[c];if(o==="canvas"&&c==="rr_dataURL"){const d=i.createElement("img");d.onload=()=>{const h=u.getContext("2d");h&&h.drawImage(d,0,0,d.width,d.height)},d.src=n.toString(),u.RRNodeType&&(u.rr_dataURL=n.toString())}else if(o==="img"&&c==="rr_dataURL"){const d=u;d.currentSrc.startsWith("data:")||(d.setAttribute("rrweb-original-src",e.attributes.src),d.src=n.toString())}if(c==="rr_width")u.style.setProperty("width",n.toString());else if(c==="rr_height")u.style.setProperty("height",n.toString());else if(c==="rr_mediaCurrentTime"&&typeof n=="number")u.currentTime=n;else if(c==="rr_mediaState")switch(n){case"played":u.play().catch(d=>console.warn("media playback error",d));break;case"paused":u.pause();break}else c==="rr_mediaPlaybackRate"&&typeof n=="number"?u.playbackRate=n:c==="rr_mediaMuted"&&typeof n=="boolean"?u.muted=n:c==="rr_mediaLoop"&&typeof n=="boolean"?u.loop=n:c==="rr_mediaVolume"&&typeof n=="number"?u.volume=n:c==="rr_open_mode"&&u.setAttribute("rr_open_mode",n)}if(e.isShadowHost)if(!u.shadowRoot)u.attachShadow({mode:"open"});else for(;u.shadowRoot.firstChild;)u.shadowRoot.removeChild(u.shadowRoot.firstChild);return(o==="input"||o==="textarea")&&u.setAttribute("autocomplete","off"),u}case U.Text:return e.isStyle&&s?i.createTextNode(zt(e.textContent,a)):i.createTextNode(e.textContent);case U.CDATA:return i.createCDATASection(e.textContent);case U.Comment:return i.createComment(e.textContent);default:return null}}function nt(e,t){const{doc:r,mirror:i,skipChild:s=!1,hackCss:a=!0,afterAppend:o,cache:u}=t;if(i.has(e.id)){const c=i.getNode(e.id),n=i.getMeta(c);if(ha(n,e))return i.getNode(e.id)}let l=sl(e,{doc:r,hackCss:a,cache:u});if(!l)return null;if(e.rootId&&i.getNode(e.rootId)!==r&&i.replace(e.rootId,r),e.type===U.Document&&(r.close(),r.open(),e.compatMode==="BackCompat"&&e.childNodes&&e.childNodes[0].type!==U.DocumentType&&(e.childNodes[0].type===U.Element&&"xmlns"in e.childNodes[0].attributes&&e.childNodes[0].attributes.xmlns==="http://www.w3.org/1999/xhtml"?r.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):r.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),l=r),i.add(l,e),(e.type===U.Document||e.type===U.Element)&&!s)for(const c of e.childNodes){const n=nt(c,{doc:r,mirror:i,skipChild:!1,hackCss:a,afterAppend:o,cache:u});if(!n){console.warn("Failed to rebuild",c);continue}if(c.isShadow&&hs(l)&&l.shadowRoot)l.shadowRoot.appendChild(n);else if(e.type===U.Document&&c.type==U.Element){const d=n;let h=null;d.childNodes.forEach(f=>{f.nodeName==="BODY"&&(h=f)}),h?(d.removeChild(h),l.appendChild(n),d.appendChild(h)):l.appendChild(n)}else l.appendChild(n);o&&o(n,c.id)}return l}function il(e,t){function r(i){t(i)}for(const i of e.getIds())e.has(i)&&r(e.getNode(i))}function nl(e,t){const r=t.getMeta(e);if((r==null?void 0:r.type)!==U.Element)return;const i=e;for(const s in r.attributes){if(!(Object.prototype.hasOwnProperty.call(r.attributes,s)&&s.startsWith("rr_")))continue;const a=r.attributes[s];s==="rr_scrollLeft"&&(i.scrollLeft=a),s==="rr_scrollTop"&&(i.scrollTop=a)}}function ol(e,t){el(t);const{doc:r,onVisit:i,hackCss:s=!0,afterAppend:a,cache:o,mirror:u=new fs}=t,l=nt(e,{doc:r,mirror:u,skipChild:!1,hackCss:s,afterAppend:a,cache:o});return il(u,c=>{i&&i(c),nl(c,u)}),l}function al(e){var t;if(!e.root.isConnected)throw new Error(_i);const r=e.root.ownerDocument.createElement("iframe");for(const[s,a]of Object.entries(e.iframeAttributes||{}))s!=="sandbox"&&r.setAttribute(s,a);r.setAttribute("sandbox","allow-same-origin"),e.root.appendChild(r);const i=r.contentDocument;if(!i||!r.contentWindow)throw(t=r.parentNode)==null||t.removeChild(r),new Error(_i);return Yn.add(i),r}var ll=Object.defineProperty,ul=(e,t,r)=>t in e?ll(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,A=(e,t,r)=>ul(e,typeof t!="symbol"?t+"":t,r),cl=Object.defineProperty,hl=(e,t,r)=>t in e?cl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ki=(e,t,r)=>hl(e,typeof t!="symbol"?t+"":t,r);Date.now().toString();let fl=class{constructor(){ki(this,"idNodeMap",new Map),ki(this,"nodeMetaMap",new WeakMap)}getId(t){var r;if(!t)return-1;const i=(r=this.getMeta(t))==null?void 0:r.id;return i!=null?i:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(i=>this.removeNodeFromMap(i))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){const i=r.id;this.idNodeMap.set(i,t),this.nodeMetaMap.set(t,r)}replace(t,r){const i=this.getNode(t);if(i){const s=this.nodeMetaMap.get(i);s&&this.nodeMetaMap.set(r,s)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function dl(){return new fl}function pl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ml(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function i(){return this instanceof i?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(i){var s=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(r,i,s.get?s:{enumerable:!0,get:function(){return e[i]}})}),r}var gt={exports:{}},Pi;function gl(){if(Pi)return gt.exports;Pi=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return gt.exports=t(),gt.exports.createColors=t,gt.exports}const yl={},wl=Object.freeze(Object.defineProperty({__proto__:null,default:yl},Symbol.toStringTag,{value:"Module"})),ve=ml(wl);var Mr,Li;function Cs(){if(Li)return Mr;Li=1;let e=gl(),t=ve;class r extends Error{constructor(s,a,o,u,l,c){super(s),this.name="CssSyntaxError",this.reason=s,l&&(this.file=l),u&&(this.source=u),c&&(this.plugin=c),typeof a!="undefined"&&typeof o!="undefined"&&(typeof a=="number"?(this.line=a,this.column=o):(this.line=a.line,this.column=a.column,this.endLine=o.line,this.endColumn=o.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,r)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line!="undefined"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(s){if(!this.source)return"";let a=this.source;s==null&&(s=e.isColorSupported),t&&s&&(a=t(a));let o=a.split(/\r?\n/),u=Math.max(this.line-3,0),l=Math.min(this.line+2,o.length),c=String(l).length,n,d;if(s){let{bold:h,gray:f,red:m}=e.createColors(!0);n=p=>h(m(p)),d=p=>f(p)}else n=d=h=>h;return o.slice(u,l).map((h,f)=>{let m=u+1+f,p=" "+(" "+m).slice(-c)+" | ";if(m===this.line){let g=d(p.replace(/\d/g," "))+h.slice(0,this.column-1).replace(/[^\t]/g," ");return n(">")+d(p)+h+`
|
|
41
|
+
`+g+n("^")}return" "+d(p)+h}).join(`
|
|
42
|
+
`)}toString(){let s=this.showSourceCode();return s&&(s=`
|
|
43
|
+
|
|
44
|
+
`+s+`
|
|
45
|
+
`),this.name+": "+this.message+s}}return Mr=r,r.default=r,Mr}var yt={},Fi;function Es(){return Fi||(Fi=1,yt.isClean=Symbol("isClean"),yt.my=Symbol("my")),yt}var Nr,Ui;function Xn(){if(Ui)return Nr;Ui=1;const e={after:`
|
|
46
|
+
`,beforeClose:`
|
|
47
|
+
`,beforeComment:`
|
|
48
|
+
`,beforeDecl:`
|
|
49
|
+
`,beforeOpen:" ",beforeRule:`
|
|
50
|
+
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function t(i){return i[0].toUpperCase()+i.slice(1)}class r{constructor(s){this.builder=s}atrule(s,a){let o="@"+s.name,u=s.params?this.rawValue(s,"params"):"";if(typeof s.raws.afterName!="undefined"?o+=s.raws.afterName:u&&(o+=" "),s.nodes)this.block(s,o+u);else{let l=(s.raws.between||"")+(a?";":"");this.builder(o+u+l,s)}}beforeAfter(s,a){let o;s.type==="decl"?o=this.raw(s,null,"beforeDecl"):s.type==="comment"?o=this.raw(s,null,"beforeComment"):a==="before"?o=this.raw(s,null,"beforeRule"):o=this.raw(s,null,"beforeClose");let u=s.parent,l=0;for(;u&&u.type!=="root";)l+=1,u=u.parent;if(o.includes(`
|
|
51
|
+
`)){let c=this.raw(s,null,"indent");if(c.length)for(let n=0;n<l;n++)o+=c}return o}block(s,a){let o=this.raw(s,"between","beforeOpen");this.builder(a+o+"{",s,"start");let u;s.nodes&&s.nodes.length?(this.body(s),u=this.raw(s,"after")):u=this.raw(s,"after","emptyBody"),u&&this.builder(u),this.builder("}",s,"end")}body(s){let a=s.nodes.length-1;for(;a>0&&s.nodes[a].type==="comment";)a-=1;let o=this.raw(s,"semicolon");for(let u=0;u<s.nodes.length;u++){let l=s.nodes[u],c=this.raw(l,"before");c&&this.builder(c),this.stringify(l,a!==u||o)}}comment(s){let a=this.raw(s,"left","commentLeft"),o=this.raw(s,"right","commentRight");this.builder("/*"+a+s.text+o+"*/",s)}decl(s,a){let o=this.raw(s,"between","colon"),u=s.prop+o+this.rawValue(s,"value");s.important&&(u+=s.raws.important||" !important"),a&&(u+=";"),this.builder(u,s)}document(s){this.body(s)}raw(s,a,o){let u;if(o||(o=a),a&&(u=s.raws[a],typeof u!="undefined"))return u;let l=s.parent;if(o==="before"&&(!l||l.type==="root"&&l.first===s||l&&l.type==="document"))return"";if(!l)return e[o];let c=s.root();if(c.rawCache||(c.rawCache={}),typeof c.rawCache[o]!="undefined")return c.rawCache[o];if(o==="before"||o==="after")return this.beforeAfter(s,o);{let n="raw"+t(o);this[n]?u=this[n](c,s):c.walk(d=>{if(u=d.raws[a],typeof u!="undefined")return!1})}return typeof u=="undefined"&&(u=e[o]),c.rawCache[o]=u,u}rawBeforeClose(s){let a;return s.walk(o=>{if(o.nodes&&o.nodes.length>0&&typeof o.raws.after!="undefined")return a=o.raws.after,a.includes(`
|
|
52
|
+
`)&&(a=a.replace(/[^\n]+$/,"")),!1}),a&&(a=a.replace(/\S/g,"")),a}rawBeforeComment(s,a){let o;return s.walkComments(u=>{if(typeof u.raws.before!="undefined")return o=u.raws.before,o.includes(`
|
|
53
|
+
`)&&(o=o.replace(/[^\n]+$/,"")),!1}),typeof o=="undefined"?o=this.raw(a,null,"beforeDecl"):o&&(o=o.replace(/\S/g,"")),o}rawBeforeDecl(s,a){let o;return s.walkDecls(u=>{if(typeof u.raws.before!="undefined")return o=u.raws.before,o.includes(`
|
|
54
|
+
`)&&(o=o.replace(/[^\n]+$/,"")),!1}),typeof o=="undefined"?o=this.raw(a,null,"beforeRule"):o&&(o=o.replace(/\S/g,"")),o}rawBeforeOpen(s){let a;return s.walk(o=>{if(o.type!=="decl"&&(a=o.raws.between,typeof a!="undefined"))return!1}),a}rawBeforeRule(s){let a;return s.walk(o=>{if(o.nodes&&(o.parent!==s||s.first!==o)&&typeof o.raws.before!="undefined")return a=o.raws.before,a.includes(`
|
|
55
|
+
`)&&(a=a.replace(/[^\n]+$/,"")),!1}),a&&(a=a.replace(/\S/g,"")),a}rawColon(s){let a;return s.walkDecls(o=>{if(typeof o.raws.between!="undefined")return a=o.raws.between.replace(/[^\s:]/g,""),!1}),a}rawEmptyBody(s){let a;return s.walk(o=>{if(o.nodes&&o.nodes.length===0&&(a=o.raws.after,typeof a!="undefined"))return!1}),a}rawIndent(s){if(s.raws.indent)return s.raws.indent;let a;return s.walk(o=>{let u=o.parent;if(u&&u!==s&&u.parent&&u.parent===s&&typeof o.raws.before!="undefined"){let l=o.raws.before.split(`
|
|
56
|
+
`);return a=l[l.length-1],a=a.replace(/\S/g,""),!1}}),a}rawSemicolon(s){let a;return s.walk(o=>{if(o.nodes&&o.nodes.length&&o.last.type==="decl"&&(a=o.raws.semicolon,typeof a!="undefined"))return!1}),a}rawValue(s,a){let o=s[a],u=s.raws[a];return u&&u.value===o?u.raw:o}root(s){this.body(s),s.raws.after&&this.builder(s.raws.after)}rule(s){this.block(s,this.rawValue(s,"selector")),s.raws.ownSemicolon&&this.builder(s.raws.ownSemicolon,s,"end")}stringify(s,a){if(!this[s.type])throw new Error("Unknown AST node type "+s.type+". Maybe you need to change PostCSS stringifier.");this[s.type](s,a)}}return Nr=r,r.default=r,Nr}var Or,Bi;function Vt(){if(Bi)return Or;Bi=1;let e=Xn();function t(r,i){new e(i).stringify(r)}return Or=t,t.default=t,Or}var Ir,$i;function qt(){if($i)return Ir;$i=1;let{isClean:e,my:t}=Es(),r=Cs(),i=Xn(),s=Vt();function a(u,l){let c=new u.constructor;for(let n in u){if(!Object.prototype.hasOwnProperty.call(u,n)||n==="proxyCache")continue;let d=u[n],h=typeof d;n==="parent"&&h==="object"?l&&(c[n]=l):n==="source"?c[n]=d:Array.isArray(d)?c[n]=d.map(f=>a(f,c)):(h==="object"&&d!==null&&(d=a(d)),c[n]=d)}return c}class o{constructor(l={}){this.raws={},this[e]=!1,this[t]=!0;for(let c in l)if(c==="nodes"){this.nodes=[];for(let n of l[c])typeof n.clone=="function"?this.append(n.clone()):this.append(n)}else this[c]=l[c]}addToError(l){if(l.postcssNode=this,l.stack&&this.source&&/\n\s{4}at /.test(l.stack)){let c=this.source;l.stack=l.stack.replace(/\n\s{4}at /,`$&${c.input.from}:${c.start.line}:${c.start.column}$&`)}return l}after(l){return this.parent.insertAfter(this,l),this}assign(l={}){for(let c in l)this[c]=l[c];return this}before(l){return this.parent.insertBefore(this,l),this}cleanRaws(l){delete this.raws.before,delete this.raws.after,l||delete this.raws.between}clone(l={}){let c=a(this);for(let n in l)c[n]=l[n];return c}cloneAfter(l={}){let c=this.clone(l);return this.parent.insertAfter(this,c),c}cloneBefore(l={}){let c=this.clone(l);return this.parent.insertBefore(this,c),c}error(l,c={}){if(this.source){let{end:n,start:d}=this.rangeBy(c);return this.source.input.error(l,{column:d.column,line:d.line},{column:n.column,line:n.line},c)}return new r(l)}getProxyProcessor(){return{get(l,c){return c==="proxyOf"?l:c==="root"?()=>l.root().toProxy():l[c]},set(l,c,n){return l[c]===n||(l[c]=n,(c==="prop"||c==="value"||c==="name"||c==="params"||c==="important"||c==="text")&&l.markDirty()),!0}}}markDirty(){if(this[e]){this[e]=!1;let l=this;for(;l=l.parent;)l[e]=!1}}next(){if(!this.parent)return;let l=this.parent.index(this);return this.parent.nodes[l+1]}positionBy(l,c){let n=this.source.start;if(l.index)n=this.positionInside(l.index,c);else if(l.word){c=this.toString();let d=c.indexOf(l.word);d!==-1&&(n=this.positionInside(d,c))}return n}positionInside(l,c){let n=c||this.toString(),d=this.source.start.column,h=this.source.start.line;for(let f=0;f<l;f++)n[f]===`
|
|
57
|
+
`?(d=1,h+=1):d+=1;return{column:d,line:h}}prev(){if(!this.parent)return;let l=this.parent.index(this);return this.parent.nodes[l-1]}rangeBy(l){let c={column:this.source.start.column,line:this.source.start.line},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:c.column+1,line:c.line};if(l.word){let d=this.toString(),h=d.indexOf(l.word);h!==-1&&(c=this.positionInside(h,d),n=this.positionInside(h+l.word.length,d))}else l.start?c={column:l.start.column,line:l.start.line}:l.index&&(c=this.positionInside(l.index)),l.end?n={column:l.end.column,line:l.end.line}:typeof l.endIndex=="number"?n=this.positionInside(l.endIndex):l.index&&(n=this.positionInside(l.index+1));return(n.line<c.line||n.line===c.line&&n.column<=c.column)&&(n={column:c.column+1,line:c.line}),{end:n,start:c}}raw(l,c){return new i().raw(this,l,c)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...l){if(this.parent){let c=this,n=!1;for(let d of l)d===this?n=!0:n?(this.parent.insertAfter(c,d),c=d):this.parent.insertBefore(c,d);n||this.remove()}return this}root(){let l=this;for(;l.parent&&l.parent.type!=="document";)l=l.parent;return l}toJSON(l,c){let n={},d=c==null;c=c||new Map;let h=0;for(let f in this){if(!Object.prototype.hasOwnProperty.call(this,f)||f==="parent"||f==="proxyCache")continue;let m=this[f];if(Array.isArray(m))n[f]=m.map(p=>typeof p=="object"&&p.toJSON?p.toJSON(null,c):p);else if(typeof m=="object"&&m.toJSON)n[f]=m.toJSON(null,c);else if(f==="source"){let p=c.get(m.input);p==null&&(p=h,c.set(m.input,h),h++),n[f]={end:m.end,inputId:p,start:m.start}}else n[f]=m}return d&&(n.inputs=[...c.keys()].map(f=>f.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(l=s){l.stringify&&(l=l.stringify);let c="";return l(this,n=>{c+=n}),c}warn(l,c,n){let d={node:this};for(let h in n)d[h]=n[h];return l.warn(c,d)}get proxyOf(){return this}}return Ir=o,o.default=o,Ir}var Dr,Wi;function jt(){if(Wi)return Dr;Wi=1;let e=qt();class t extends e{constructor(i){i&&typeof i.value!="undefined"&&typeof i.value!="string"&&(i=re(P({},i),{value:String(i.value)})),super(i),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}}return Dr=t,t.default=t,Dr}var Ar,zi;function bl(){if(zi)return Ar;zi=1;let e="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";return Ar={nanoid:(i=21)=>{let s="",a=i;for(;a--;)s+=e[Math.random()*64|0];return s},customAlphabet:(i,s=21)=>(a=s)=>{let o="",u=a;for(;u--;)o+=i[Math.random()*i.length|0];return o}},Ar}var Tr,Vi;function Jn(){if(Vi)return Tr;Vi=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=ve,{existsSync:r,readFileSync:i}=ve,{dirname:s,join:a}=ve;function o(l){return Buffer?Buffer.from(l,"base64").toString():window.atob(l)}class u{constructor(c,n){if(n.map===!1)return;this.loadAnnotation(c),this.inline=this.startWith(this.annotation,"data:");let d=n.map?n.map.prev:void 0,h=this.loadMap(n.from,d);!this.mapFile&&n.from&&(this.mapFile=n.from),this.mapFile&&(this.root=s(this.mapFile)),h&&(this.text=h)}consumer(){return this.consumerCache||(this.consumerCache=new e(this.text)),this.consumerCache}decodeInline(c){let n=/^data:application\/json;charset=utf-?8;base64,/,d=/^data:application\/json;base64,/,h=/^data:application\/json;charset=utf-?8,/,f=/^data:application\/json,/;if(h.test(c)||f.test(c))return decodeURIComponent(c.substr(RegExp.lastMatch.length));if(n.test(c)||d.test(c))return o(c.substr(RegExp.lastMatch.length));let m=c.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+m)}getAnnotationURL(c){return c.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(c){return typeof c!="object"?!1:typeof c.mappings=="string"||typeof c._mappings=="string"||Array.isArray(c.sections)}loadAnnotation(c){let n=c.match(/\/\*\s*# sourceMappingURL=/gm);if(!n)return;let d=c.lastIndexOf(n.pop()),h=c.indexOf("*/",d);d>-1&&h>-1&&(this.annotation=this.getAnnotationURL(c.substring(d,h)))}loadFile(c){if(this.root=s(c),r(c))return this.mapFile=c,i(c,"utf-8").toString().trim()}loadMap(c,n){if(n===!1)return!1;if(n){if(typeof n=="string")return n;if(typeof n=="function"){let d=n(c);if(d){let h=this.loadFile(d);if(!h)throw new Error("Unable to load previous source map: "+d.toString());return h}}else{if(n instanceof e)return t.fromSourceMap(n).toString();if(n instanceof t)return n.toString();if(this.isMap(n))return JSON.stringify(n);throw new Error("Unsupported previous source map format: "+n.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let d=this.annotation;return c&&(d=a(s(c),d)),this.loadFile(d)}}}startWith(c,n){return c?c.substr(0,n.length)===n:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return Tr=u,u.default=u,Tr}var _r,qi;function Gt(){if(qi)return _r;qi=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=ve,{fileURLToPath:r,pathToFileURL:i}=ve,{isAbsolute:s,resolve:a}=ve,{nanoid:o}=bl(),u=ve,l=Cs(),c=Jn(),n=Symbol("fromOffsetCache"),d=!!(e&&t),h=!!(a&&s);class f{constructor(p,g={}){if(p===null||typeof p=="undefined"||typeof p=="object"&&!p.toString)throw new Error(`PostCSS received ${p} instead of CSS string`);if(this.css=p.toString(),this.css[0]==="\uFEFF"||this.css[0]==="\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,g.from&&(!h||/^\w+:\/\//.test(g.from)||s(g.from)?this.file=g.from:this.file=a(g.from)),h&&d){let b=new c(this.css,g);if(b.text){this.map=b;let y=b.consumer().file;!this.file&&y&&(this.file=this.mapResolve(y))}}this.file||(this.id="<input css "+o(6)+">"),this.map&&(this.map.file=this.from)}error(p,g,b,y={}){let w,C,v;if(g&&typeof g=="object"){let E=g,R=b;if(typeof E.offset=="number"){let I=this.fromOffset(E.offset);g=I.line,b=I.col}else g=E.line,b=E.column;if(typeof R.offset=="number"){let I=this.fromOffset(R.offset);C=I.line,v=I.col}else C=R.line,v=R.column}else if(!b){let E=this.fromOffset(g);g=E.line,b=E.col}let S=this.origin(g,b,C,v);return S?w=new l(p,S.endLine===void 0?S.line:{column:S.column,line:S.line},S.endLine===void 0?S.column:{column:S.endColumn,line:S.endLine},S.source,S.file,y.plugin):w=new l(p,C===void 0?g:{column:b,line:g},C===void 0?b:{column:v,line:C},this.css,this.file,y.plugin),w.input={column:b,endColumn:v,endLine:C,line:g,source:this.css},this.file&&(i&&(w.input.url=i(this.file).toString()),w.input.file=this.file),w}fromOffset(p){let g,b;if(this[n])b=this[n];else{let w=this.css.split(`
|
|
58
|
+
`);b=new Array(w.length);let C=0;for(let v=0,S=w.length;v<S;v++)b[v]=C,C+=w[v].length+1;this[n]=b}g=b[b.length-1];let y=0;if(p>=g)y=b.length-1;else{let w=b.length-2,C;for(;y<w;)if(C=y+(w-y>>1),p<b[C])w=C-1;else if(p>=b[C+1])y=C+1;else{y=C;break}}return{col:p-b[y]+1,line:y+1}}mapResolve(p){return/^\w+:\/\//.test(p)?p:a(this.map.consumer().sourceRoot||this.map.root||".",p)}origin(p,g,b,y){if(!this.map)return!1;let w=this.map.consumer(),C=w.originalPositionFor({column:g,line:p});if(!C.source)return!1;let v;typeof b=="number"&&(v=w.originalPositionFor({column:y,line:b}));let S;s(C.source)?S=i(C.source):S=new URL(C.source,this.map.consumer().sourceRoot||i(this.map.mapFile));let E={column:C.column,endColumn:v&&v.column,endLine:v&&v.line,line:C.line,url:S.toString()};if(S.protocol==="file:")if(r)E.file=r(S);else throw new Error("file: protocol is not available in this PostCSS build");let R=w.sourceContentFor(C.source);return R&&(E.source=R),E}toJSON(){let p={};for(let g of["hasBOM","css","file","id"])this[g]!=null&&(p[g]=this[g]);return this.map&&(p.map=P({},this.map),p.map.consumerCache&&(p.map.consumerCache=void 0)),p}get from(){return this.file||this.id}}return _r=f,f.default=f,u&&u.registerInput&&u.registerInput(f),_r}var kr,ji;function Qn(){if(ji)return kr;ji=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=ve,{dirname:r,relative:i,resolve:s,sep:a}=ve,{pathToFileURL:o}=ve,u=Gt(),l=!!(e&&t),c=!!(r&&s&&i&&a);class n{constructor(h,f,m,p){this.stringify=h,this.mapOpts=m.map||{},this.root=f,this.opts=m,this.css=p,this.originalCSS=p,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let h;this.isInline()?h="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?h=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?h=this.mapOpts.annotation(this.opts.to,this.root):h=this.outputFile()+".map";let f=`
|
|
59
|
+
`;this.css.includes(`\r
|
|
60
|
+
`)&&(f=`\r
|
|
61
|
+
`),this.css+=f+"/*# sourceMappingURL="+h+" */"}applyPrevMaps(){for(let h of this.previous()){let f=this.toUrl(this.path(h.file)),m=h.root||r(h.file),p;this.mapOpts.sourcesContent===!1?(p=new e(h.text),p.sourcesContent&&(p.sourcesContent=null)):p=h.consumer(),this.map.applySourceMap(p,f,this.toUrl(this.path(m)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let h;for(let f=this.root.nodes.length-1;f>=0;f--)h=this.root.nodes[f],h.type==="comment"&&h.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(f)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),c&&l&&this.isMap())return this.generateMap();{let h="";return this.stringify(this.root,f=>{h+=f}),[h]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let h=this.previous()[0].consumer();h.file=this.outputFile(),this.map=t.fromSourceMap(h,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});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 t({file:this.outputFile(),ignoreInvalidMapping:!0});let h=1,f=1,m="<no source>",p={generated:{column:0,line:0},original:{column:0,line:0},source:""},g,b;this.stringify(this.root,(y,w,C)=>{if(this.css+=y,w&&C!=="end"&&(p.generated.line=h,p.generated.column=f-1,w.source&&w.source.start?(p.source=this.sourcePath(w),p.original.line=w.source.start.line,p.original.column=w.source.start.column-1,this.map.addMapping(p)):(p.source=m,p.original.line=1,p.original.column=0,this.map.addMapping(p))),g=y.match(/\n/g),g?(h+=g.length,b=y.lastIndexOf(`
|
|
62
|
+
`),f=y.length-b):f+=y.length,w&&C!=="start"){let v=w.parent||{raws:{}};(!(w.type==="decl"||w.type==="atrule"&&!w.nodes)||w!==v.last||v.raws.semicolon)&&(w.source&&w.source.end?(p.source=this.sourcePath(w),p.original.line=w.source.end.line,p.original.column=w.source.end.column-1,p.generated.line=h,p.generated.column=f-2,this.map.addMapping(p)):(p.source=m,p.original.line=1,p.original.column=0,p.generated.line=h,p.generated.column=f-1,this.map.addMapping(p)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation!="undefined"?this.mapOpts.annotation:this.previous().length?this.previous().some(h=>h.annotation):!0}isInline(){if(typeof this.mapOpts.inline!="undefined")return this.mapOpts.inline;let h=this.mapOpts.annotation;return typeof h!="undefined"&&h!==!0?!1:this.previous().length?this.previous().some(f=>f.inline):!0}isMap(){return typeof this.opts.map!="undefined"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent!="undefined"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(h=>h.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(h){if(this.mapOpts.absolute||h.charCodeAt(0)===60||/^\w+:\/\//.test(h))return h;let f=this.memoizedPaths.get(h);if(f)return f;let m=this.opts.to?r(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(m=r(s(m,this.mapOpts.annotation)));let p=i(m,h);return this.memoizedPaths.set(h,p),p}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(h=>{if(h.source&&h.source.input.map){let f=h.source.input.map;this.previousMaps.includes(f)||this.previousMaps.push(f)}});else{let h=new u(this.originalCSS,this.opts);h.map&&this.previousMaps.push(h.map)}return this.previousMaps}setSourcesContent(){let h={};if(this.root)this.root.walk(f=>{if(f.source){let m=f.source.input.from;if(m&&!h[m]){h[m]=!0;let p=this.usesFileUrls?this.toFileUrl(m):this.toUrl(this.path(m));this.map.setSourceContent(p,f.source.input.css)}}});else if(this.css){let f=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(f,this.css)}}sourcePath(h){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(h.source.input.from):this.toUrl(this.path(h.source.input.from))}toBase64(h){return Buffer?Buffer.from(h).toString("base64"):window.btoa(unescape(encodeURIComponent(h)))}toFileUrl(h){let f=this.memoizedFileURLs.get(h);if(f)return f;if(o){let m=o(h).toString();return this.memoizedFileURLs.set(h,m),m}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(h){let f=this.memoizedURLs.get(h);if(f)return f;a==="\\"&&(h=h.replace(/\\/g,"/"));let m=encodeURI(h).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(h,m),m}}return kr=n,kr}var Pr,Gi;function Ht(){if(Gi)return Pr;Gi=1;let e=qt();class t extends e{constructor(i){super(i),this.type="comment"}}return Pr=t,t.default=t,Pr}var Lr,Hi;function Ue(){if(Hi)return Lr;Hi=1;let{isClean:e,my:t}=Es(),r=jt(),i=Ht(),s=qt(),a,o,u,l;function c(h){return h.map(f=>(f.nodes&&(f.nodes=c(f.nodes)),delete f.source,f))}function n(h){if(h[e]=!1,h.proxyOf.nodes)for(let f of h.proxyOf.nodes)n(f)}class d extends s{append(...f){for(let m of f){let p=this.normalize(m,this.last);for(let g of p)this.proxyOf.nodes.push(g)}return this.markDirty(),this}cleanRaws(f){if(super.cleanRaws(f),this.nodes)for(let m of this.nodes)m.cleanRaws(f)}each(f){if(!this.proxyOf.nodes)return;let m=this.getIterator(),p,g;for(;this.indexes[m]<this.proxyOf.nodes.length&&(p=this.indexes[m],g=f(this.proxyOf.nodes[p],p),g!==!1);)this.indexes[m]+=1;return delete this.indexes[m],g}every(f){return this.nodes.every(f)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let f=this.lastEach;return this.indexes[f]=0,f}getProxyProcessor(){return{get(f,m){return m==="proxyOf"?f:f[m]?m==="each"||typeof m=="string"&&m.startsWith("walk")?(...p)=>f[m](...p.map(g=>typeof g=="function"?(b,y)=>g(b.toProxy(),y):g)):m==="every"||m==="some"?p=>f[m]((g,...b)=>p(g.toProxy(),...b)):m==="root"?()=>f.root().toProxy():m==="nodes"?f.nodes.map(p=>p.toProxy()):m==="first"||m==="last"?f[m].toProxy():f[m]:f[m]},set(f,m,p){return f[m]===p||(f[m]=p,(m==="name"||m==="params"||m==="selector")&&f.markDirty()),!0}}}index(f){return typeof f=="number"?f:(f.proxyOf&&(f=f.proxyOf),this.proxyOf.nodes.indexOf(f))}insertAfter(f,m){let p=this.index(f),g=this.normalize(m,this.proxyOf.nodes[p]).reverse();p=this.index(f);for(let y of g)this.proxyOf.nodes.splice(p+1,0,y);let b;for(let y in this.indexes)b=this.indexes[y],p<b&&(this.indexes[y]=b+g.length);return this.markDirty(),this}insertBefore(f,m){let p=this.index(f),g=p===0?"prepend":!1,b=this.normalize(m,this.proxyOf.nodes[p],g).reverse();p=this.index(f);for(let w of b)this.proxyOf.nodes.splice(p,0,w);let y;for(let w in this.indexes)y=this.indexes[w],p<=y&&(this.indexes[w]=y+b.length);return this.markDirty(),this}normalize(f,m){if(typeof f=="string")f=c(a(f).nodes);else if(typeof f=="undefined")f=[];else if(Array.isArray(f)){f=f.slice(0);for(let g of f)g.parent&&g.parent.removeChild(g,"ignore")}else if(f.type==="root"&&this.type!=="document"){f=f.nodes.slice(0);for(let g of f)g.parent&&g.parent.removeChild(g,"ignore")}else if(f.type)f=[f];else if(f.prop){if(typeof f.value=="undefined")throw new Error("Value field is missed in node creation");typeof f.value!="string"&&(f.value=String(f.value)),f=[new r(f)]}else if(f.selector)f=[new o(f)];else if(f.name)f=[new u(f)];else if(f.text)f=[new i(f)];else throw new Error("Unknown node type in node creation");return f.map(g=>(g[t]||d.rebuild(g),g=g.proxyOf,g.parent&&g.parent.removeChild(g),g[e]&&n(g),typeof g.raws.before=="undefined"&&m&&typeof m.raws.before!="undefined"&&(g.raws.before=m.raws.before.replace(/\S/g,"")),g.parent=this.proxyOf,g))}prepend(...f){f=f.reverse();for(let m of f){let p=this.normalize(m,this.first,"prepend").reverse();for(let g of p)this.proxyOf.nodes.unshift(g);for(let g in this.indexes)this.indexes[g]=this.indexes[g]+p.length}return this.markDirty(),this}push(f){return f.parent=this,this.proxyOf.nodes.push(f),this}removeAll(){for(let f of this.proxyOf.nodes)f.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(f){f=this.index(f),this.proxyOf.nodes[f].parent=void 0,this.proxyOf.nodes.splice(f,1);let m;for(let p in this.indexes)m=this.indexes[p],m>=f&&(this.indexes[p]=m-1);return this.markDirty(),this}replaceValues(f,m,p){return p||(p=m,m={}),this.walkDecls(g=>{m.props&&!m.props.includes(g.prop)||m.fast&&!g.value.includes(m.fast)||(g.value=g.value.replace(f,p))}),this.markDirty(),this}some(f){return this.nodes.some(f)}walk(f){return this.each((m,p)=>{let g;try{g=f(m,p)}catch(b){throw m.addToError(b)}return g!==!1&&m.walk&&(g=m.walk(f)),g})}walkAtRules(f,m){return m?f instanceof RegExp?this.walk((p,g)=>{if(p.type==="atrule"&&f.test(p.name))return m(p,g)}):this.walk((p,g)=>{if(p.type==="atrule"&&p.name===f)return m(p,g)}):(m=f,this.walk((p,g)=>{if(p.type==="atrule")return m(p,g)}))}walkComments(f){return this.walk((m,p)=>{if(m.type==="comment")return f(m,p)})}walkDecls(f,m){return m?f instanceof RegExp?this.walk((p,g)=>{if(p.type==="decl"&&f.test(p.prop))return m(p,g)}):this.walk((p,g)=>{if(p.type==="decl"&&p.prop===f)return m(p,g)}):(m=f,this.walk((p,g)=>{if(p.type==="decl")return m(p,g)}))}walkRules(f,m){return m?f instanceof RegExp?this.walk((p,g)=>{if(p.type==="rule"&&f.test(p.selector))return m(p,g)}):this.walk((p,g)=>{if(p.type==="rule"&&p.selector===f)return m(p,g)}):(m=f,this.walk((p,g)=>{if(p.type==="rule")return m(p,g)}))}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]}}return d.registerParse=h=>{a=h},d.registerRule=h=>{o=h},d.registerAtRule=h=>{u=h},d.registerRoot=h=>{l=h},Lr=d,d.default=d,d.rebuild=h=>{h.type==="atrule"?Object.setPrototypeOf(h,u.prototype):h.type==="rule"?Object.setPrototypeOf(h,o.prototype):h.type==="decl"?Object.setPrototypeOf(h,r.prototype):h.type==="comment"?Object.setPrototypeOf(h,i.prototype):h.type==="root"&&Object.setPrototypeOf(h,l.prototype),h[t]=!0,h.nodes&&h.nodes.forEach(f=>{d.rebuild(f)})},Lr}var Fr,Yi;function xs(){if(Yi)return Fr;Yi=1;let e=Ue(),t,r;class i extends e{constructor(a){super(P({type:"document"},a)),this.nodes||(this.nodes=[])}toResult(a={}){return new t(new r,this,a).stringify()}}return i.registerLazyResult=s=>{t=s},i.registerProcessor=s=>{r=s},Fr=i,i.default=i,Fr}var Ur,Xi;function Zn(){if(Xi)return Ur;Xi=1;let e={};return Ur=function(r){e[r]||(e[r]=!0,typeof console!="undefined"&&console.warn&&console.warn(r))},Ur}var Br,Ji;function Kn(){if(Ji)return Br;Ji=1;class e{constructor(r,i={}){if(this.type="warning",this.text=r,i.node&&i.node.source){let s=i.node.rangeBy(i);this.line=s.start.line,this.column=s.start.column,this.endLine=s.end.line,this.endColumn=s.end.column}for(let s in i)this[s]=i[s]}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}}return Br=e,e.default=e,Br}var $r,Qi;function Rs(){if(Qi)return $r;Qi=1;let e=Kn();class t{constructor(i,s,a){this.processor=i,this.messages=[],this.root=s,this.opts=a,this.css=void 0,this.map=void 0}toString(){return this.css}warn(i,s={}){s.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(s.plugin=this.lastPlugin.postcssPlugin);let a=new e(i,s);return this.messages.push(a),a}warnings(){return this.messages.filter(i=>i.type==="warning")}get content(){return this.css}}return $r=t,t.default=t,$r}var Wr,Zi;function vl(){if(Zi)return Wr;Zi=1;const e=39,t=34,r=92,i=47,s=10,a=32,o=12,u=9,l=13,c=91,n=93,d=40,h=41,f=123,m=125,p=59,g=42,b=58,y=64,w=/[\t\n\f\r "#'()/;[\\\]{}]/g,C=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,v=/.[\r\n"'(/\\]/,S=/[\da-f]/i;return Wr=function(R,I={}){let N=R.css.valueOf(),L=I.ignoreErrors,k,x,ae,le,q,D,H,te,J,j,De=N.length,O=0,Ce=[],ue=[];function $e(){return O}function Ee(se){throw R.error("Unclosed "+se,O)}function tt(){return ue.length===0&&O>=De}function me(se){if(ue.length)return ue.pop();if(O>=De)return;let pe=se?se.ignoreUnclosed:!1;switch(k=N.charCodeAt(O),k){case s:case a:case u:case l:case o:{x=O;do x+=1,k=N.charCodeAt(x);while(k===a||k===s||k===u||k===l||k===o);j=["space",N.slice(O,x)],O=x-1;break}case c:case n:case f:case m:case b:case p:case h:{let B=String.fromCharCode(k);j=[B,B,O];break}case d:{if(te=Ce.length?Ce.pop()[1]:"",J=N.charCodeAt(O+1),te==="url"&&J!==e&&J!==t&&J!==a&&J!==s&&J!==u&&J!==o&&J!==l){x=O;do{if(D=!1,x=N.indexOf(")",x+1),x===-1)if(L||pe){x=O;break}else Ee("bracket");for(H=x;N.charCodeAt(H-1)===r;)H-=1,D=!D}while(D);j=["brackets",N.slice(O,x+1),O,x],O=x}else x=N.indexOf(")",O+1),le=N.slice(O,x+1),x===-1||v.test(le)?j=["(","(",O]:(j=["brackets",le,O,x],O=x);break}case e:case t:{ae=k===e?"'":'"',x=O;do{if(D=!1,x=N.indexOf(ae,x+1),x===-1)if(L||pe){x=O+1;break}else Ee("string");for(H=x;N.charCodeAt(H-1)===r;)H-=1,D=!D}while(D);j=["string",N.slice(O,x+1),O,x],O=x;break}case y:{w.lastIndex=O+1,w.test(N),w.lastIndex===0?x=N.length-1:x=w.lastIndex-2,j=["at-word",N.slice(O,x+1),O,x],O=x;break}case r:{for(x=O,q=!0;N.charCodeAt(x+1)===r;)x+=1,q=!q;if(k=N.charCodeAt(x+1),q&&k!==i&&k!==a&&k!==s&&k!==u&&k!==l&&k!==o&&(x+=1,S.test(N.charAt(x)))){for(;S.test(N.charAt(x+1));)x+=1;N.charCodeAt(x+1)===a&&(x+=1)}j=["word",N.slice(O,x+1),O,x],O=x;break}default:{k===i&&N.charCodeAt(O+1)===g?(x=N.indexOf("*/",O+2)+1,x===0&&(L||pe?x=N.length:Ee("comment")),j=["comment",N.slice(O,x+1),O,x],O=x):(C.lastIndex=O+1,C.test(N),C.lastIndex===0?x=N.length-1:x=C.lastIndex-2,j=["word",N.slice(O,x+1),O,x],Ce.push(j),O=x);break}}return O++,j}function ge(se){ue.push(se)}return{back:ge,endOfFile:tt,nextToken:me,position:$e}},Wr}var zr,Ki;function Ms(){if(Ki)return zr;Ki=1;let e=Ue();class t extends e{constructor(i){super(i),this.type="atrule"}append(...i){return this.proxyOf.nodes||(this.nodes=[]),super.append(...i)}prepend(...i){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...i)}}return zr=t,t.default=t,e.registerAtRule(t),zr}var Vr,en;function lt(){if(en)return Vr;en=1;let e=Ue(),t,r;class i extends e{constructor(a){super(a),this.type="root",this.nodes||(this.nodes=[])}normalize(a,o,u){let l=super.normalize(a);if(o){if(u==="prepend")this.nodes.length>1?o.raws.before=this.nodes[1].raws.before:delete o.raws.before;else if(this.first!==o)for(let c of l)c.raws.before=o.raws.before}return l}removeChild(a,o){let u=this.index(a);return!o&&u===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[u].raws.before),super.removeChild(a)}toResult(a={}){return new t(new r,this,a).stringify()}}return i.registerLazyResult=s=>{t=s},i.registerProcessor=s=>{r=s},Vr=i,i.default=i,e.registerRoot(i),Vr}var qr,tn;function eo(){if(tn)return qr;tn=1;let e={comma(t){return e.split(t,[","],!0)},space(t){let r=[" ",`
|
|
63
|
+
`," "];return e.split(t,r)},split(t,r,i){let s=[],a="",o=!1,u=0,l=!1,c="",n=!1;for(let d of t)n?n=!1:d==="\\"?n=!0:l?d===c&&(l=!1):d==='"'||d==="'"?(l=!0,c=d):d==="("?u+=1:d===")"?u>0&&(u-=1):u===0&&r.includes(d)&&(o=!0),o?(a!==""&&s.push(a.trim()),a="",o=!1):a+=d;return(i||a!=="")&&s.push(a.trim()),s}};return qr=e,e.default=e,qr}var jr,rn;function Ns(){if(rn)return jr;rn=1;let e=Ue(),t=eo();class r extends e{constructor(s){super(s),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.comma(this.selector)}set selectors(s){let a=this.selector?this.selector.match(/,\s*/):null,o=a?a[0]:","+this.raw("between","beforeOpen");this.selector=s.join(o)}}return jr=r,r.default=r,e.registerRule(r),jr}var Gr,sn;function Sl(){if(sn)return Gr;sn=1;let e=jt(),t=vl(),r=Ht(),i=Ms(),s=lt(),a=Ns();const o={empty:!0,space:!0};function u(c){for(let n=c.length-1;n>=0;n--){let d=c[n],h=d[3]||d[2];if(h)return h}}class l{constructor(n){this.input=n,this.root=new s,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:n,start:{column:1,line:1,offset:0}}}atrule(n){let d=new i;d.name=n[1].slice(1),d.name===""&&this.unnamedAtrule(d,n),this.init(d,n[2]);let h,f,m,p=!1,g=!1,b=[],y=[];for(;!this.tokenizer.endOfFile();){if(n=this.tokenizer.nextToken(),h=n[0],h==="("||h==="["?y.push(h==="("?")":"]"):h==="{"&&y.length>0?y.push("}"):h===y[y.length-1]&&y.pop(),y.length===0)if(h===";"){d.source.end=this.getPosition(n[2]),d.source.end.offset++,this.semicolon=!0;break}else if(h==="{"){g=!0;break}else if(h==="}"){if(b.length>0){for(m=b.length-1,f=b[m];f&&f[0]==="space";)f=b[--m];f&&(d.source.end=this.getPosition(f[3]||f[2]),d.source.end.offset++)}this.end(n);break}else b.push(n);else b.push(n);if(this.tokenizer.endOfFile()){p=!0;break}}d.raws.between=this.spacesAndCommentsFromEnd(b),b.length?(d.raws.afterName=this.spacesAndCommentsFromStart(b),this.raw(d,"params",b),p&&(n=b[b.length-1],d.source.end=this.getPosition(n[3]||n[2]),d.source.end.offset++,this.spaces=d.raws.between,d.raws.between="")):(d.raws.afterName="",d.params=""),g&&(d.nodes=[],this.current=d)}checkMissedSemicolon(n){let d=this.colon(n);if(d===!1)return;let h=0,f;for(let m=d-1;m>=0&&(f=n[m],!(f[0]!=="space"&&(h+=1,h===2)));m--);throw this.input.error("Missed semicolon",f[0]==="word"?f[3]+1:f[2])}colon(n){let d=0,h,f,m;for(let[p,g]of n.entries()){if(h=g,f=h[0],f==="("&&(d+=1),f===")"&&(d-=1),d===0&&f===":")if(!m)this.doubleColon(h);else{if(m[0]==="word"&&m[1]==="progid")continue;return p}m=h}return!1}comment(n){let d=new r;this.init(d,n[2]),d.source.end=this.getPosition(n[3]||n[2]),d.source.end.offset++;let h=n[1].slice(2,-2);if(/^\s*$/.test(h))d.text="",d.raws.left=h,d.raws.right="";else{let f=h.match(/^(\s*)([^]*\S)(\s*)$/);d.text=f[2],d.raws.left=f[1],d.raws.right=f[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(n,d){let h=new e;this.init(h,n[0][2]);let f=n[n.length-1];for(f[0]===";"&&(this.semicolon=!0,n.pop()),h.source.end=this.getPosition(f[3]||f[2]||u(n)),h.source.end.offset++;n[0][0]!=="word";)n.length===1&&this.unknownWord(n),h.raws.before+=n.shift()[1];for(h.source.start=this.getPosition(n[0][2]),h.prop="";n.length;){let y=n[0][0];if(y===":"||y==="space"||y==="comment")break;h.prop+=n.shift()[1]}h.raws.between="";let m;for(;n.length;)if(m=n.shift(),m[0]===":"){h.raws.between+=m[1];break}else m[0]==="word"&&/\w/.test(m[1])&&this.unknownWord([m]),h.raws.between+=m[1];(h.prop[0]==="_"||h.prop[0]==="*")&&(h.raws.before+=h.prop[0],h.prop=h.prop.slice(1));let p=[],g;for(;n.length&&(g=n[0][0],!(g!=="space"&&g!=="comment"));)p.push(n.shift());this.precheckMissedSemicolon(n);for(let y=n.length-1;y>=0;y--){if(m=n[y],m[1].toLowerCase()==="!important"){h.important=!0;let w=this.stringFrom(n,y);w=this.spacesFromEnd(n)+w,w!==" !important"&&(h.raws.important=w);break}else if(m[1].toLowerCase()==="important"){let w=n.slice(0),C="";for(let v=y;v>0;v--){let S=w[v][0];if(C.trim().indexOf("!")===0&&S!=="space")break;C=w.pop()[1]+C}C.trim().indexOf("!")===0&&(h.important=!0,h.raws.important=C,n=w)}if(m[0]!=="space"&&m[0]!=="comment")break}n.some(y=>y[0]!=="space"&&y[0]!=="comment")&&(h.raws.between+=p.map(y=>y[1]).join(""),p=[]),this.raw(h,"value",p.concat(n),d),h.value.includes(":")&&!d&&this.checkMissedSemicolon(n)}doubleColon(n){throw this.input.error("Double colon",{offset:n[2]},{offset:n[2]+n[1].length})}emptyRule(n){let d=new a;this.init(d,n[2]),d.selector="",d.raws.between="",this.current=d}end(n){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(n[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(n)}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(n){if(this.spaces+=n[1],this.current.nodes){let d=this.current.nodes[this.current.nodes.length-1];d&&d.type==="rule"&&!d.raws.ownSemicolon&&(d.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(n){let d=this.input.fromOffset(n);return{column:d.col,line:d.line,offset:n}}init(n,d){this.current.push(n),n.source={input:this.input,start:this.getPosition(d)},n.raws.before=this.spaces,this.spaces="",n.type!=="comment"&&(this.semicolon=!1)}other(n){let d=!1,h=null,f=!1,m=null,p=[],g=n[1].startsWith("--"),b=[],y=n;for(;y;){if(h=y[0],b.push(y),h==="("||h==="[")m||(m=y),p.push(h==="("?")":"]");else if(g&&f&&h==="{")m||(m=y),p.push("}");else if(p.length===0)if(h===";")if(f){this.decl(b,g);return}else break;else if(h==="{"){this.rule(b);return}else if(h==="}"){this.tokenizer.back(b.pop()),d=!0;break}else h===":"&&(f=!0);else h===p[p.length-1]&&(p.pop(),p.length===0&&(m=null));y=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(d=!0),p.length>0&&this.unclosedBracket(m),d&&f){if(!g)for(;b.length&&(y=b[b.length-1][0],!(y!=="space"&&y!=="comment"));)this.tokenizer.back(b.pop());this.decl(b,g)}else this.unknownWord(b)}parse(){let n;for(;!this.tokenizer.endOfFile();)switch(n=this.tokenizer.nextToken(),n[0]){case"space":this.spaces+=n[1];break;case";":this.freeSemicolon(n);break;case"}":this.end(n);break;case"comment":this.comment(n);break;case"at-word":this.atrule(n);break;case"{":this.emptyRule(n);break;default:this.other(n);break}this.endFile()}precheckMissedSemicolon(){}raw(n,d,h,f){let m,p,g=h.length,b="",y=!0,w,C;for(let v=0;v<g;v+=1)m=h[v],p=m[0],p==="space"&&v===g-1&&!f?y=!1:p==="comment"?(C=h[v-1]?h[v-1][0]:"empty",w=h[v+1]?h[v+1][0]:"empty",!o[C]&&!o[w]?b.slice(-1)===","?y=!1:b+=m[1]:y=!1):b+=m[1];if(!y){let v=h.reduce((S,E)=>S+E[1],"");n.raws[d]={raw:v,value:b}}n[d]=b}rule(n){n.pop();let d=new a;this.init(d,n[0][2]),d.raws.between=this.spacesAndCommentsFromEnd(n),this.raw(d,"selector",n),this.current=d}spacesAndCommentsFromEnd(n){let d,h="";for(;n.length&&(d=n[n.length-1][0],!(d!=="space"&&d!=="comment"));)h=n.pop()[1]+h;return h}spacesAndCommentsFromStart(n){let d,h="";for(;n.length&&(d=n[0][0],!(d!=="space"&&d!=="comment"));)h+=n.shift()[1];return h}spacesFromEnd(n){let d,h="";for(;n.length&&(d=n[n.length-1][0],d==="space");)h=n.pop()[1]+h;return h}stringFrom(n,d){let h="";for(let f=d;f<n.length;f++)h+=n[f][1];return n.splice(d,n.length-d),h}unclosedBlock(){let n=this.current.source.start;throw this.input.error("Unclosed block",n.line,n.column)}unclosedBracket(n){throw this.input.error("Unclosed bracket",{offset:n[2]},{offset:n[2]+1})}unexpectedClose(n){throw this.input.error("Unexpected }",{offset:n[2]},{offset:n[2]+1})}unknownWord(n){throw this.input.error("Unknown word",{offset:n[0][2]},{offset:n[0][2]+n[0][1].length})}unnamedAtrule(n,d){throw this.input.error("At-rule without name",{offset:d[2]},{offset:d[2]+d[1].length})}}return Gr=l,Gr}var Hr,nn;function Os(){if(nn)return Hr;nn=1;let e=Ue(),t=Sl(),r=Gt();function i(s,a){let o=new r(s,a),u=new t(o);try{u.parse()}catch(l){throw l}return u.root}return Hr=i,i.default=i,e.registerParse(i),Hr}var Yr,on;function to(){if(on)return Yr;on=1;let{isClean:e,my:t}=Es(),r=Qn(),i=Vt(),s=Ue(),a=xs(),o=Zn(),u=Rs(),l=Os(),c=lt();const n={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},d={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},h={Once:!0,postcssPlugin:!0,prepare:!0},f=0;function m(C){return typeof C=="object"&&typeof C.then=="function"}function p(C){let v=!1,S=n[C.type];return C.type==="decl"?v=C.prop.toLowerCase():C.type==="atrule"&&(v=C.name.toLowerCase()),v&&C.append?[S,S+"-"+v,f,S+"Exit",S+"Exit-"+v]:v?[S,S+"-"+v,S+"Exit",S+"Exit-"+v]:C.append?[S,f,S+"Exit"]:[S,S+"Exit"]}function g(C){let v;return C.type==="document"?v=["Document",f,"DocumentExit"]:C.type==="root"?v=["Root",f,"RootExit"]:v=p(C),{eventIndex:0,events:v,iterator:0,node:C,visitorIndex:0,visitors:[]}}function b(C){return C[e]=!1,C.nodes&&C.nodes.forEach(v=>b(v)),C}let y={};class w{constructor(v,S,E){this.stringified=!1,this.processed=!1;let R;if(typeof S=="object"&&S!==null&&(S.type==="root"||S.type==="document"))R=b(S);else if(S instanceof w||S instanceof u)R=b(S.root),S.map&&(typeof E.map=="undefined"&&(E.map={}),E.map.inline||(E.map.inline=!1),E.map.prev=S.map);else{let I=l;E.syntax&&(I=E.syntax.parse),E.parser&&(I=E.parser),I.parse&&(I=I.parse);try{R=I(S,E)}catch(N){this.processed=!0,this.error=N}R&&!R[t]&&s.rebuild(R)}this.result=new u(v,R,E),this.helpers=re(P({},y),{postcss:y,result:this.result}),this.plugins=this.processor.plugins.map(I=>typeof I=="object"&&I.prepare?P(P({},I),I.prepare(this.result)):I)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(v){return this.async().catch(v)}finally(v){return this.async().then(v,v)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(v,S){let E=this.result.lastPlugin;try{S&&S.addToError(v),this.error=v,v.name==="CssSyntaxError"&&!v.plugin?(v.plugin=E.postcssPlugin,v.setMessage()):E.postcssVersion}catch(R){console&&console.error&&console.error(R)}return v}prepareVisitors(){this.listeners={};let v=(S,E,R)=>{this.listeners[E]||(this.listeners[E]=[]),this.listeners[E].push([S,R])};for(let S of this.plugins)if(typeof S=="object")for(let E in S){if(!d[E]&&/^[A-Z]/.test(E))throw new Error(`Unknown event ${E} in ${S.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!h[E])if(typeof S[E]=="object")for(let R in S[E])R==="*"?v(S,E,S[E][R]):v(S,E+"-"+R.toLowerCase(),S[E][R]);else typeof S[E]=="function"&&v(S,E,S[E])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let v=0;v<this.plugins.length;v++){let S=this.plugins[v],E=this.runOnRoot(S);if(m(E))try{await E}catch(R){throw this.handleError(R)}}if(this.prepareVisitors(),this.hasListener){let v=this.result.root;for(;!v[e];){v[e]=!0;let S=[g(v)];for(;S.length>0;){let E=this.visitTick(S);if(m(E))try{await E}catch(R){let I=S[S.length-1].node;throw this.handleError(R,I)}}}if(this.listeners.OnceExit)for(let[S,E]of this.listeners.OnceExit){this.result.lastPlugin=S;try{if(v.type==="document"){let R=v.nodes.map(I=>E(I,this.helpers));await Promise.all(R)}else await E(v,this.helpers)}catch(R){throw this.handleError(R)}}}return this.processed=!0,this.stringify()}runOnRoot(v){this.result.lastPlugin=v;try{if(typeof v=="object"&&v.Once){if(this.result.root.type==="document"){let S=this.result.root.nodes.map(E=>v.Once(E,this.helpers));return m(S[0])?Promise.all(S):S}return v.Once(this.result.root,this.helpers)}else if(typeof v=="function")return v(this.result.root,this.result)}catch(S){throw this.handleError(S)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let v=this.result.opts,S=i;v.syntax&&(S=v.syntax.stringify),v.stringifier&&(S=v.stringifier),S.stringify&&(S=S.stringify);let R=new r(S,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 v of this.plugins){let S=this.runOnRoot(v);if(m(S))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let v=this.result.root;for(;!v[e];)v[e]=!0,this.walkSync(v);if(this.listeners.OnceExit)if(v.type==="document")for(let S of v.nodes)this.visitSync(this.listeners.OnceExit,S);else this.visitSync(this.listeners.OnceExit,v)}return this.result}then(v,S){return this.async().then(v,S)}toString(){return this.css}visitSync(v,S){for(let[E,R]of v){this.result.lastPlugin=E;let I;try{I=R(S,this.helpers)}catch(N){throw this.handleError(N,S.proxyOf)}if(S.type!=="root"&&S.type!=="document"&&!S.parent)return!0;if(m(I))throw this.getAsyncError()}}visitTick(v){let S=v[v.length-1],{node:E,visitors:R}=S;if(E.type!=="root"&&E.type!=="document"&&!E.parent){v.pop();return}if(R.length>0&&S.visitorIndex<R.length){let[N,L]=R[S.visitorIndex];S.visitorIndex+=1,S.visitorIndex===R.length&&(S.visitors=[],S.visitorIndex=0),this.result.lastPlugin=N;try{return L(E.toProxy(),this.helpers)}catch(k){throw this.handleError(k,E)}}if(S.iterator!==0){let N=S.iterator,L;for(;L=E.nodes[E.indexes[N]];)if(E.indexes[N]+=1,!L[e]){L[e]=!0,v.push(g(L));return}S.iterator=0,delete E.indexes[N]}let I=S.events;for(;S.eventIndex<I.length;){let N=I[S.eventIndex];if(S.eventIndex+=1,N===f){E.nodes&&E.nodes.length&&(E[e]=!0,S.iterator=E.getIterator());return}else if(this.listeners[N]){S.visitors=this.listeners[N];return}}v.pop()}walkSync(v){v[e]=!0;let S=p(v);for(let E of S)if(E===f)v.nodes&&v.each(R=>{R[e]||this.walkSync(R)});else{let R=this.listeners[E];if(R&&this.visitSync(R,v.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"}}return w.registerPostcss=C=>{y=C},Yr=w,w.default=w,c.registerLazyResult(w),a.registerLazyResult(w),Yr}var Xr,an;function Cl(){if(an)return Xr;an=1;let e=Qn(),t=Vt(),r=Zn(),i=Os();const s=Rs();class a{constructor(u,l,c){l=l.toString(),this.stringified=!1,this._processor=u,this._css=l,this._opts=c,this._map=void 0;let n,d=t;this.result=new s(this._processor,n,this._opts),this.result.css=l;let h=this;Object.defineProperty(this.result,"root",{get(){return h.root}});let f=new e(d,n,this._opts,l);if(f.isMap()){let[m,p]=f.generate();m&&(this.result.css=m),p&&(this.result.map=p)}else f.clearAnnotation(),this.result.css=f.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(u){return this.async().catch(u)}finally(u){return this.async().then(u,u)}sync(){if(this.error)throw this.error;return this.result}then(u,l){return this.async().then(u,l)}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 u,l=i;try{u=l(this._css,this._opts)}catch(c){this.error=c}if(this.error)throw this.error;return this._root=u,u}get[Symbol.toStringTag](){return"NoWorkResult"}}return Xr=a,a.default=a,Xr}var Jr,ln;function El(){if(ln)return Jr;ln=1;let e=Cl(),t=to(),r=xs(),i=lt();class s{constructor(o=[]){this.version="8.4.38",this.plugins=this.normalize(o)}normalize(o){let u=[];for(let l of o)if(l.postcss===!0?l=l():l.postcss&&(l=l.postcss),typeof l=="object"&&Array.isArray(l.plugins))u=u.concat(l.plugins);else if(typeof l=="object"&&l.postcssPlugin)u.push(l);else if(typeof l=="function")u.push(l);else if(!(typeof l=="object"&&(l.parse||l.stringify)))throw new Error(l+" is not a PostCSS plugin");return u}process(o,u={}){return!this.plugins.length&&!u.parser&&!u.stringifier&&!u.syntax?new e(this,o,u):new t(this,o,u)}use(o){return this.plugins=this.plugins.concat(this.normalize([o])),this}}return Jr=s,s.default=s,i.registerProcessor(s),r.registerProcessor(s),Jr}var Qr,un;function xl(){if(un)return Qr;un=1;let e=jt(),t=Jn(),r=Ht(),i=Ms(),s=Gt(),a=lt(),o=Ns();function u(l,c){if(Array.isArray(l))return l.map(m=>u(m));let h=l,{inputs:n}=h,d=We(h,["inputs"]);if(n){c=[];for(let m of n){let p=re(P({},m),{__proto__:s.prototype});p.map&&(p.map=re(P({},p.map),{__proto__:t.prototype})),c.push(p)}}if(d.nodes&&(d.nodes=l.nodes.map(m=>u(m,c))),d.source){let f=d.source,{inputId:m}=f,p=We(f,["inputId"]);d.source=p,m!=null&&(d.source.input=c[m])}if(d.type==="root")return new a(d);if(d.type==="decl")return new e(d);if(d.type==="rule")return new o(d);if(d.type==="comment")return new r(d);if(d.type==="atrule")return new i(d);throw new Error("Unknown node type: "+l.type)}return Qr=u,u.default=u,Qr}var Zr,cn;function Rl(){if(cn)return Zr;cn=1;let e=Cs(),t=jt(),r=to(),i=Ue(),s=El(),a=Vt(),o=xl(),u=xs(),l=Kn(),c=Ht(),n=Ms(),d=Rs(),h=Gt(),f=Os(),m=eo(),p=Ns(),g=lt(),b=qt();function y(...w){return w.length===1&&Array.isArray(w[0])&&(w=w[0]),new s(w)}return y.plugin=function(C,v){let S=!1;function E(...I){console&&console.warn&&!S&&(S=!0,console.warn(C+`: postcss.plugin was deprecated. Migration guide:
|
|
64
|
+
https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(C+`: \u91CC\u9762 postcss.plugin \u88AB\u5F03\u7528. \u8FC1\u79FB\u6307\u5357:
|
|
65
|
+
https://www.w3ctech.com/topic/2226`));let N=v(...I);return N.postcssPlugin=C,N.postcssVersion=new s().version,N}let R;return Object.defineProperty(E,"postcss",{get(){return R||(R=E()),R}}),E.process=function(I,N,L){return y([E(L)]).process(I,N)},E},y.stringify=a,y.parse=f,y.fromJSON=o,y.list=m,y.comment=w=>new c(w),y.atRule=w=>new n(w),y.decl=w=>new t(w),y.rule=w=>new p(w),y.root=w=>new g(w),y.document=w=>new u(w),y.CssSyntaxError=e,y.Declaration=t,y.Container=i,y.Processor=s,y.Document=u,y.Comment=c,y.Warning=l,y.AtRule=n,y.Result=d,y.Input=h,y.Rule=p,y.Root=g,y.Node=b,r.registerPostcss(y),Zr=y,y.default=y,Zr}var Ml=Rl();const Q=pl(Ml);Q.stringify;Q.fromJSON;Q.plugin;Q.parse;Q.list;Q.document;Q.comment;Q.atRule;Q.rule;Q.decl;Q.root;Q.CssSyntaxError;Q.Declaration;Q.Container;Q.Processor;Q.Document;Q.Comment;Q.Warning;Q.AtRule;Q.Result;Q.Input;Q.Rule;Q.Root;Q.Node;var $=(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))($||{});function Nl(e){const t={},r=/;(?![^(]*\))/g,i=/:(.+)/,s=/\/\*.*?\*\//g;return e.replace(s,"").split(r).forEach(function(a){if(a){const o=a.split(i);o.length>1&&(t[ns(o[0].trim())]=o[1].trim())}}),t}function hn(e){const t=[];for(const r in e){const i=e[r];if(typeof i!="string")continue;const s=Al(r);t.push(`${s}: ${i};`)}return t.join(" ")}const Ol=/-([a-z])/g,Il=/^--[a-zA-Z0-9-]+$/,ns=e=>Il.test(e)?e:e.replace(Ol,(t,r)=>r?r.toUpperCase():""),Dl=/\B([A-Z])/g,Al=e=>e.replace(Dl,"-$1").toLowerCase();class Se{constructor(...t){A(this,"parentElement",null),A(this,"parentNode",null),A(this,"ownerDocument"),A(this,"firstChild",null),A(this,"lastChild",null),A(this,"previousSibling",null),A(this,"nextSibling",null),A(this,"ELEMENT_NODE",1),A(this,"TEXT_NODE",3),A(this,"nodeType"),A(this,"nodeName"),A(this,"RRNodeType")}get childNodes(){const t=[];let r=this.firstChild;for(;r;)t.push(r),r=r.nextSibling;return t}contains(t){if(t instanceof Se){if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0}else return!1;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(t,r){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}class Is extends Se{constructor(...t){super(t),A(this,"nodeType",9),A(this,"nodeName","#document"),A(this,"compatMode","CSS1Compat"),A(this,"RRNodeType",$.Document),A(this,"textContent",null),this.ownerDocument=this}get documentElement(){return this.childNodes.find(t=>t.RRNodeType===$.Element&&t.tagName==="HTML")||null}get body(){var t;return((t=this.documentElement)==null?void 0:t.childNodes.find(r=>r.RRNodeType===$.Element&&r.tagName==="BODY"))||null}get head(){var t;return((t=this.documentElement)==null?void 0:t.childNodes.find(r=>r.RRNodeType===$.Element&&r.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(t){const r=t.RRNodeType;if((r===$.Element||r===$.DocumentType)&&this.childNodes.some(s=>s.RRNodeType===r))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${r===$.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);const i=Ds(this,t);return i.parentElement=null,i}insertBefore(t,r){const i=t.RRNodeType;if((i===$.Element||i===$.DocumentType)&&this.childNodes.some(a=>a.RRNodeType===i))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${i===$.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);const s=oo(this,t,r);return s.parentElement=null,s}removeChild(t){return ao(this,t)}open(){this.firstChild=null,this.lastChild=null}close(){}write(t){let r;if(t==='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'?r="-//W3C//DTD XHTML 1.0 Transitional//EN":t==='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">'&&(r="-//W3C//DTD HTML 4.0 Transitional//EN"),r){const i=this.createDocumentType("html",r,"");this.open(),this.appendChild(i)}}createDocument(t,r,i){return new Is}createDocumentType(t,r,i){const s=new ro(t,r,i);return s.ownerDocument=this,s}createElement(t){const r=new Yt(t);return r.ownerDocument=this,r}createElementNS(t,r){return this.createElement(r)}createTextNode(t){const r=new so(t);return r.ownerDocument=this,r}createComment(t){const r=new io(t);return r.ownerDocument=this,r}createCDATASection(t){const r=new no(t);return r.ownerDocument=this,r}toString(){return"RRDocument"}}class ro extends Se{constructor(t,r,i){super(),A(this,"nodeType",10),A(this,"RRNodeType",$.DocumentType),A(this,"name"),A(this,"publicId"),A(this,"systemId"),A(this,"textContent",null),this.name=t,this.publicId=r,this.systemId=i,this.nodeName=t}toString(){return"RRDocumentType"}}class Yt extends Se{constructor(t){super(),A(this,"nodeType",1),A(this,"RRNodeType",$.Element),A(this,"tagName"),A(this,"attributes",{}),A(this,"shadowRoot",null),A(this,"scrollLeft"),A(this,"scrollTop"),this.tagName=t.toUpperCase(),this.nodeName=t.toUpperCase()}get textContent(){let t="";return this.childNodes.forEach(r=>t+=r.textContent),t}set textContent(t){this.firstChild=null,this.lastChild=null,this.appendChild(this.ownerDocument.createTextNode(t))}get classList(){return new kl(this.attributes.class,t=>{this.attributes.class=t})}get id(){return this.attributes.id||""}get className(){return this.attributes.class||""}get style(){const t=this.attributes.style?Nl(this.attributes.style):{},r=/\B([A-Z])/g;return t.setProperty=(i,s,a)=>{if(r.test(i))return;const o=ns(i);s?t[o]=s:delete t[o],a==="important"&&(t[o]+=" !important"),this.attributes.style=hn(t)},t.removeProperty=i=>{if(r.test(i))return"";const s=ns(i),a=t[s]||"";return delete t[s],this.attributes.style=hn(t),a},t}getAttribute(t){return this.attributes[t]===void 0?null:this.attributes[t]}setAttribute(t,r){this.attributes[t]=r}setAttributeNS(t,r,i){this.setAttribute(r,i)}removeAttribute(t){delete this.attributes[t]}appendChild(t){return Ds(this,t)}insertBefore(t,r){return oo(this,t,r)}removeChild(t){return ao(this,t)}attachShadow(t){const r=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=r,r}dispatchEvent(t){return!0}toString(){let t="";for(const r in this.attributes)t+=`${r}="${this.attributes[r]}" `;return`${this.tagName} ${t}`}}class Tl extends Yt{constructor(){super(...arguments),A(this,"currentTime"),A(this,"volume"),A(this,"paused"),A(this,"muted"),A(this,"playbackRate"),A(this,"loop")}attachShadow(t){throw new Error("RRDomException: Failed to execute 'attachShadow' on 'RRElement': This RRElement does not support attachShadow")}play(){this.paused=!1}pause(){this.paused=!0}}class _l extends Yt{constructor(){super(...arguments),A(this,"tagName","DIALOG"),A(this,"nodeName","DIALOG")}get isModal(){return this.getAttribute("rr_open_mode")==="modal"}get open(){return this.getAttribute("open")!==null}close(){this.removeAttribute("open"),this.removeAttribute("rr_open_mode")}show(){this.setAttribute("open",""),this.setAttribute("rr_open_mode","non-modal")}showModal(){this.setAttribute("open",""),this.setAttribute("rr_open_mode","modal")}}class so extends Se{constructor(t){super(),A(this,"nodeType",3),A(this,"nodeName","#text"),A(this,"RRNodeType",$.Text),A(this,"data"),this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRText text=${JSON.stringify(this.data)}`}}class io extends Se{constructor(t){super(),A(this,"nodeType",8),A(this,"nodeName","#comment"),A(this,"RRNodeType",$.Comment),A(this,"data"),this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRComment text=${JSON.stringify(this.data)}`}}class no extends Se{constructor(t){super(),A(this,"nodeName","#cdata-section"),A(this,"nodeType",4),A(this,"RRNodeType",$.CDATA),A(this,"data"),this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}}class kl{constructor(t,r){if(A(this,"onChange"),A(this,"classes",[]),A(this,"add",(...i)=>{for(const s of i){const a=String(s);this.classes.indexOf(a)>=0||this.classes.push(a)}this.onChange&&this.onChange(this.classes.join(" "))}),A(this,"remove",(...i)=>{this.classes=this.classes.filter(s=>i.indexOf(s)===-1),this.onChange&&this.onChange(this.classes.join(" "))}),t){const i=t.trim().split(/\s+/);this.classes.push(...i)}this.onChange=r}}function Ds(e,t){return t.parentNode&&t.parentNode.removeChild(t),e.lastChild?(e.lastChild.nextSibling=t,t.previousSibling=e.lastChild):(e.firstChild=t,t.previousSibling=null),e.lastChild=t,t.nextSibling=null,t.parentNode=e,t.parentElement=e,t.ownerDocument=e.ownerDocument,t}function oo(e,t,r){if(!r)return Ds(e,t);if(r.parentNode!==e)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return t===r||(t.parentNode&&t.parentNode.removeChild(t),t.previousSibling=r.previousSibling,r.previousSibling=t,t.nextSibling=r,t.previousSibling?t.previousSibling.nextSibling=t:e.firstChild=t,t.parentElement=e,t.parentNode=e,t.ownerDocument=e.ownerDocument),t}function ao(e,t){if(t.parentNode!==e)throw new Error("Failed to execute 'removeChild' on 'RRNode': The RRNode to be removed is not a child of this RRNode.");return t.previousSibling?t.previousSibling.nextSibling=t.nextSibling:e.firstChild=t.nextSibling,t.nextSibling?t.nextSibling.previousSibling=t.previousSibling:e.lastChild=t.previousSibling,t.previousSibling=null,t.nextSibling=null,t.parentElement=null,t.parentNode=null,t}var he=(e=>(e[e.PLACEHOLDER=0]="PLACEHOLDER",e[e.ELEMENT_NODE=1]="ELEMENT_NODE",e[e.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",e[e.TEXT_NODE=3]="TEXT_NODE",e[e.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",e[e.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",e[e.ENTITY_NODE=6]="ENTITY_NODE",e[e.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",e[e.COMMENT_NODE=8]="COMMENT_NODE",e[e.DOCUMENT_NODE=9]="DOCUMENT_NODE",e[e.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",e[e.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE",e))(he||{});const os={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},Pl={altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};let xe=null;function At(e,t,r,i=t.mirror||t.ownerDocument.mirror){e=Ll(e,t,r,i),lo(e,t,r,i),Fl(e,t,r)}function Ll(e,t,r,i){var s;if(r.afterAppend&&!xe&&(xe=new WeakSet,setTimeout(()=>{xe=null},0)),!As(e,t)){const a=Tt(t,r.mirror,i);(s=e.parentNode)==null||s.replaceChild(a,e),e=a}switch(t.RRNodeType){case $.Document:{if(!Ve(e,t,r.mirror,i)){const a=i.getMeta(t);a&&(r.mirror.removeNodeFromMap(e),e.close(),e.open(),r.mirror.add(e,a),xe==null||xe.add(e))}break}case $.Element:{const a=e,o=t;switch(o.tagName){case"IFRAME":{const u=e.contentDocument;if(!u)break;At(u,t.contentDocument,r,i);break}}o.shadowRoot&&(a.shadowRoot||a.attachShadow({mode:"open"}),lo(a.shadowRoot,o.shadowRoot,r,i)),Ul(a,o,i);break}}return e}function Fl(e,t,r){var i;switch(t.RRNodeType){case $.Document:{const s=t.scrollData;s&&r.applyScroll(s,!0);break}case $.Element:{const s=e,a=t;switch(a.scrollData&&r.applyScroll(a.scrollData,!0),a.inputData&&r.applyInput(a.inputData),a.tagName){case"AUDIO":case"VIDEO":{const o=e,u=a;u.paused!==void 0&&(u.paused?o.pause():o.play()),u.muted!==void 0&&(o.muted=u.muted),u.volume!==void 0&&(o.volume=u.volume),u.currentTime!==void 0&&(o.currentTime=u.currentTime),u.playbackRate!==void 0&&(o.playbackRate=u.playbackRate),u.loop!==void 0&&(o.loop=u.loop);break}case"CANVAS":{const o=t;if(o.rr_dataURL!==null){const u=document.createElement("img");u.onload=()=>{const l=s.getContext("2d");l&&l.drawImage(u,0,0,u.width,u.height)},u.src=o.rr_dataURL}o.canvasMutations.forEach(u=>r.applyCanvas(u.event,u.mutation,e));break}case"STYLE":{const o=s.sheet;o&&t.rules.forEach(u=>r.applyStyleSheetMutation(u,o));break}case"DIALOG":{const o=s,u=a,l=o.open,c=o.matches("dialog:modal"),n=u.open,d=u.isModal,h=c!==d,f=l!==n;if((h||l&&f)&&o.close(),n&&(f||h))try{d?o.showModal():o.show()}catch(m){console.warn(m)}break}}break}case $.Text:case $.Comment:case $.CDATA:{e.textContent!==t.data&&(e.textContent=t.data);break}}xe!=null&&xe.has(e)&&(xe.delete(e),(i=r.afterAppend)==null||i.call(r,e,r.mirror.getId(e)))}function Ul(e,t,r){const i=e.attributes,s=t.attributes;for(const a in s){const o=s[a],u=r.getMeta(t);if(u!=null&&u.isSVG&&os[a])e.setAttributeNS(os[a],a,o);else if(t.tagName==="CANVAS"&&a==="rr_dataURL"){const l=document.createElement("img");l.src=o,l.onload=()=>{const c=e.getContext("2d");c&&c.drawImage(l,0,0,l.width,l.height)}}else{if(t.tagName==="IFRAME"&&a==="srcdoc")continue;try{e.setAttribute(a,o)}catch(l){console.warn(l)}}}for(const{name:a}of Array.from(i))a in s||e.removeAttribute(a);t.scrollLeft&&(e.scrollLeft=t.scrollLeft),t.scrollTop&&(e.scrollTop=t.scrollTop)}function lo(e,t,r,i){const s=Array.from(e.childNodes),a=t.childNodes;if(s.length===0&&a.length===0)return;let o=0,u=s.length-1,l=0,c=a.length-1,n=s[o],d=s[u],h=a[l],f=a[c],m,p;for(;o<=u&&l<=c;)if(n===void 0)n=s[++o];else if(d===void 0)d=s[--u];else if(Ve(n,h,r.mirror,i))n=s[++o],h=a[++l];else if(Ve(d,f,r.mirror,i))d=s[--u],f=a[--c];else if(Ve(n,f,r.mirror,i)){try{e.insertBefore(n,d.nextSibling)}catch(y){console.warn(y)}n=s[++o],f=a[--c]}else if(Ve(d,h,r.mirror,i)){try{e.insertBefore(d,n)}catch(y){console.warn(y)}d=s[--u],h=a[++l]}else{if(!m){m={};for(let w=o;w<=u;w++){const C=s[w];C&&r.mirror.hasNode(C)&&(m[r.mirror.getId(C)]=w)}}p=m[i.getId(h)];const y=s[p];if(p!==void 0&&y&&Ve(y,h,r.mirror,i)){try{e.insertBefore(y,n)}catch(w){console.warn(w)}s[p]=void 0}else{const w=Tt(h,r.mirror,i);e.nodeName==="#document"&&n&&(w.nodeType===w.DOCUMENT_TYPE_NODE&&n.nodeType===n.DOCUMENT_TYPE_NODE||w.nodeType===w.ELEMENT_NODE&&n.nodeType===n.ELEMENT_NODE)&&(e.removeChild(n),r.mirror.removeNodeFromMap(n),n=s[++o]);try{e.insertBefore(w,n||null)}catch(C){console.warn(C)}}h=a[++l]}if(o>u){const y=a[c+1];let w=null;for(y&&(w=r.mirror.getNode(i.getId(y)));l<=c;++l){const C=Tt(a[l],r.mirror,i);try{e.insertBefore(C,w)}catch(v){console.warn(v)}}}else if(l>c)for(;o<=u;o++){const y=s[o];if(!(!y||y.parentNode!==e))try{e.removeChild(y),r.mirror.removeNodeFromMap(y)}catch(w){console.warn(w)}}let g=e.firstChild,b=t.firstChild;for(;g!==null&&b!==null;)At(g,b,r,i),g=g.nextSibling,b=b.nextSibling}function Tt(e,t,r){const i=r.getId(e),s=r.getMeta(e);let a=null;if(i>-1&&(a=t.getNode(i)),a!==null&&As(a,e))return a;switch(e.RRNodeType){case $.Document:a=new Document;break;case $.DocumentType:a=document.implementation.createDocumentType(e.name,e.publicId,e.systemId);break;case $.Element:{let o=e.tagName.toLowerCase();o=Pl[o]||o,s&&"isSVG"in s&&(s!=null&&s.isSVG)?a=document.createElementNS(os.svg,o):a=document.createElement(e.tagName);break}case $.Text:a=document.createTextNode(e.data);break;case $.Comment:a=document.createComment(e.data);break;case $.CDATA:a=document.createCDATASection(e.data);break}s&&t.add(a,P({},s));try{xe==null||xe.add(a)}catch(o){}return a}function As(e,t){return e.nodeType!==t.nodeType?!1:e.nodeType!==e.ELEMENT_NODE||e.tagName.toUpperCase()===t.tagName}function Ve(e,t,r,i){const s=r.getId(e),a=i.getId(t);return s===-1||s!==a?!1:As(e,t)}class et extends Is{constructor(t){super(),A(this,"UNSERIALIZED_STARTING_ID",-2),A(this,"_unserializedId",this.UNSERIALIZED_STARTING_ID),A(this,"mirror",Jl()),A(this,"scrollData",null),t&&(this.mirror=t)}get unserializedId(){return this._unserializedId--}createDocument(t,r,i){return new et}createDocumentType(t,r,i){const s=new Bl(t,r,i);return s.ownerDocument=this,s}createElement(t){const r=t.toUpperCase();let i;switch(r){case"AUDIO":case"VIDEO":i=new $l(r);break;case"IFRAME":i=new ql(r,this.mirror);break;case"CANVAS":i=new zl(r);break;case"STYLE":i=new Vl(r);break;case"DIALOG":i=new Wl(r);break;default:i=new Xt(r);break}return i.ownerDocument=this,i}createComment(t){const r=new Gl(t);return r.ownerDocument=this,r}createCDATASection(t){const r=new Hl(t);return r.ownerDocument=this,r}createTextNode(t){const r=new jl(t);return r.ownerDocument=this,r}destroyTree(){this.firstChild=null,this.lastChild=null,this.mirror.reset()}open(){super.open(),this._unserializedId=this.UNSERIALIZED_STARTING_ID}}const Bl=ro;class Xt extends Yt{constructor(){super(...arguments),A(this,"inputData",null),A(this,"scrollData",null)}}class $l extends Tl{}class Wl extends _l{}class zl extends Xt{constructor(){super(...arguments),A(this,"rr_dataURL",null),A(this,"canvasMutations",[])}getContext(){return null}}class Vl extends Xt{constructor(){super(...arguments),A(this,"rules",[])}}class ql extends Xt{constructor(t,r){super(t),A(this,"contentDocument",new et),this.contentDocument.mirror=r}}const jl=so,Gl=io,Hl=no;function Yl(e){return e instanceof HTMLFormElement?"FORM":e.tagName.toUpperCase()}function uo(e,t,r,i){let s;switch(e.nodeType){case he.DOCUMENT_NODE:i&&i.nodeName==="IFRAME"?s=i.contentDocument:(s=t,s.compatMode=e.compatMode);break;case he.DOCUMENT_TYPE_NODE:{const o=e;s=t.createDocumentType(o.name,o.publicId,o.systemId);break}case he.ELEMENT_NODE:{const o=e,u=Yl(o);s=t.createElement(u);const l=s;for(const{name:c,value:n}of Array.from(o.attributes))l.attributes[c]=n;o.scrollLeft&&(l.scrollLeft=o.scrollLeft),o.scrollTop&&(l.scrollTop=o.scrollTop);break}case he.TEXT_NODE:s=t.createTextNode(e.textContent||"");break;case he.CDATA_SECTION_NODE:s=t.createCDATASection(e.data);break;case he.COMMENT_NODE:s=t.createComment(e.textContent||"");break;case he.DOCUMENT_FRAGMENT_NODE:s=i.attachShadow({mode:"open"});break;default:return null}let a=r.getMeta(e);return t instanceof et&&(a||(a=co(s,t.unserializedId),r.add(e,a)),t.mirror.add(s,P({},a))),s}function Xl(e,t=dl(),r=new et){function i(s,a){const o=uo(s,r,t,a);if(o!==null)if((a==null?void 0:a.nodeName)!=="IFRAME"&&s.nodeType!==he.DOCUMENT_FRAGMENT_NODE&&(a==null||a.appendChild(o),o.parentNode=a,o.parentElement=a),s.nodeName==="IFRAME"){const u=s.contentDocument;u&&i(u,o)}else(s.nodeType===he.DOCUMENT_NODE||s.nodeType===he.ELEMENT_NODE||s.nodeType===he.DOCUMENT_FRAGMENT_NODE)&&(s.nodeType===he.ELEMENT_NODE&&s.shadowRoot&&i(s.shadowRoot,o),s.childNodes.forEach(u=>i(u,o)))}return i(e,null),r}function Jl(){return new Ql}class Ql{constructor(){A(this,"idNodeMap",new Map),A(this,"nodeMetaMap",new WeakMap)}getId(t){var r;if(!t)return-1;const i=(r=this.getMeta(t))==null?void 0:r.id;return i!=null?i:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(i=>this.removeNodeFromMap(i))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){const i=r.id;this.idNodeMap.set(i,t),this.nodeMetaMap.set(t,r)}replace(t,r){const i=this.getNode(t);if(i){const s=this.nodeMetaMap.get(i);s&&this.nodeMetaMap.set(r,s)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function co(e,t){switch(e.RRNodeType){case $.Document:return{id:t,type:e.RRNodeType,childNodes:[]};case $.DocumentType:{const r=e;return{id:t,type:e.RRNodeType,name:r.name,publicId:r.publicId,systemId:r.systemId}}case $.Element:return{id:t,type:e.RRNodeType,tagName:e.tagName.toLowerCase(),attributes:{},childNodes:[]};case $.Text:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case $.Comment:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case $.CDATA:return{id:t,type:e.RRNodeType,textContent:""}}}const fn={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument","firstChild","lastChild","nextSibling","previousSibling"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},dn={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},wt={},ho={},Zl=()=>!!globalThis.Zone;function Ts(e){if(wt[e])return wt[e];const t=globalThis[e],r=t.prototype,i=e in fn?fn[e]:void 0,s=!!(i&&i.every(u=>{var l,c;return!!((c=(l=Object.getOwnPropertyDescriptor(r,u))==null?void 0:l.get)!=null&&c.toString().includes("[native code]"))})),a=e in dn?dn[e]:void 0,o=!!(a&&a.every(u=>{var l;return typeof r[u]=="function"&&((l=r[u])==null?void 0:l.toString().includes("[native code]"))}));if(s&&o&&!Zl())return wt[e]=t.prototype,t.prototype;try{const u=document.createElement("iframe");u.style.display="none",document.body.appendChild(u);const l=u.contentWindow;if(!l)return t.prototype;const c=l[e].prototype;if(!c)return u.remove(),r;const n=navigator.userAgent;return n.includes("Safari")&&!n.includes("Chrome")?(u.classList.add("rr-block"),u.setAttribute("__rrwebUntaintedMutationObserver",""),ho[e]=()=>u.remove()):u.remove(),wt[e]=c}catch(u){return r}}const Kr={};function de(e,t,r){var i,s;const a=(i=Kr[e])==null?void 0:i[r];if(a)return a.call(t);const o=Ts(e),u=(s=Object.getOwnPropertyDescriptor(o,r))==null?void 0:s.get;return u?((Kr[e]||(Kr[e]={}))[r]=u,u.call(t)):t[r]}const es={};function fo(e,t,r){const i=`${e}.${String(r)}`;if(es[i])return es[i].bind(t);const a=Ts(e)[r];return typeof a!="function"?t[r]:(es[i]=a,a.bind(t))}function Kl(e){return de("Node",e,"ownerDocument")}function eu(e){return de("Node",e,"childNodes")}function tu(e){return de("Node",e,"parentNode")}function ru(e){return de("Node",e,"parentElement")}function su(e){return de("Node",e,"textContent")}function iu(e){return de("Node",e,"firstChild")}function nu(e){return de("Node",e,"lastChild")}function ou(e){return de("Node",e,"nextSibling")}function au(e){return de("Node",e,"previousSibling")}function lu(e,t){return fo("Node",e,"contains")(t)}function uu(e){return fo("Node",e,"getRootNode")()}function cu(e){return!e||!("host"in e)?null:de("ShadowRoot",e,"host")}function hu(e){return e.styleSheets}function fu(e){return!e||!("shadowRoot"in e)?null:de("Element",e,"shadowRoot")}function du(e,t){return de("Element",e,"querySelector")(t)}function pu(e,t){return de("Element",e,"querySelectorAll")(t)}function po(){var e;return[Ts("MutationObserver").constructor,(e=ho.MutationObserver)!=null?e:()=>{}]}let Ze=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Ze=()=>new Date().getTime());function Be(e,t,r){try{if(!(t in e))return()=>{};const i=e[t],s=r(i);return typeof s=="function"&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:i}})),e[t]=s,()=>{e[t]=i}}catch(i){return()=>{}}}const F={ownerDocument:Kl,childNodes:eu,parentNode:tu,parentElement:ru,textContent:su,firstChild:iu,lastChild:nu,nextSibling:ou,previousSibling:au,contains:lu,getRootNode:uu,host:cu,styleSheets:hu,shadowRoot:fu,querySelector:du,querySelectorAll:pu,nowTimestamp:Ze,mutationObserverCtor:po,patch:Be};function ne(e,t,r=document){const i={capture:!0,passive:!0};return r.addEventListener(e,t,i),()=>r.removeEventListener(e,t,i)}const qe=`Please stop import mirror directly. Instead of that,\r
|
|
66
|
+
now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
|
|
67
|
+
or you can use record.mirror to access the mirror instance during recording.`;exports.mirror={map:{},getId(){return console.error(qe),-1},getNode(){return console.error(qe),null},removeNodeFromMap(){console.error(qe)},has(){return console.error(qe),!1},reset(){console.error(qe)}};typeof window!="undefined"&&window.Proxy&&window.Reflect&&(exports.mirror=new Proxy(exports.mirror,{get(e,t,r){return t==="map"&&console.error(qe),Reflect.get(e,t,r)}}));function Ke(e,t,r={}){let i=null,s=0;return function(...a){const o=Date.now();!s&&r.leading===!1&&(s=o);const u=t-(o-s),l=this;u<=0||u>t?(i&&(clearTimeout(i),i=null),s=o,e.apply(l,a)):!i&&r.trailing!==!1&&(i=setTimeout(()=>{s=r.leading===!1?0:Date.now(),i=null,e.apply(l,a)},u))}}function ut(e,t,r,i,s=window){const a=s.Object.getOwnPropertyDescriptor(e,t);return s.Object.defineProperty(e,t,i?r:{set(o){setTimeout(()=>{r.set.call(this,o)},0),a&&a.set&&a.set.call(this,o)}}),()=>ut(e,t,a||{},!0)}function _s(e){var t,r,i,s;const a=e.document;return{left:a.scrollingElement?a.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:a.documentElement.scrollLeft||(a==null?void 0:a.body)&&((t=F.parentElement(a.body))==null?void 0:t.scrollLeft)||((r=a==null?void 0:a.body)==null?void 0:r.scrollLeft)||0,top:a.scrollingElement?a.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:(a==null?void 0:a.documentElement.scrollTop)||(a==null?void 0:a.body)&&((i=F.parentElement(a.body))==null?void 0:i.scrollTop)||((s=a==null?void 0:a.body)==null?void 0:s.scrollTop)||0}}function ks(e){var t,r;return e.innerHeight||((t=e.document.documentElement)==null?void 0:t.clientHeight)||((r=e.document.body)==null?void 0:r.clientHeight)}function Ps(e){var t,r;return e.innerWidth||((t=e.document.documentElement)==null?void 0:t.clientWidth)||((r=e.document.body)==null?void 0:r.clientWidth)}function Ls(e){return e?e.nodeType===e.ELEMENT_NODE?e:F.parentElement(e):null}function oe(e,t,r,i){if(!e)return!1;const s=Ls(e);if(!s)return!1;try{if(typeof t=="string"){if(s.classList.contains(t)||i&&s.closest("."+t)!==null)return!0}else if(Dt(s,t,i))return!0}catch(a){}return!!(r&&(s.matches(r)||i&&s.closest(r)!==null))}function mo(e,t){return t.getId(e)!==-1}function Et(e,t,r){return e.tagName==="TITLE"&&r.headTitleMutations?!0:t.getId(e)===It}function Fs(e,t){if(st(e))return!1;const r=t.getId(e);if(!t.has(r))return!0;const i=F.parentNode(e);return i&&i.nodeType===e.DOCUMENT_NODE?!1:i?Fs(i,t):!0}function _t(e){return!!e.changedTouches}function Me(e,t){var r,i;const s=(i=(r=e.Zone)==null?void 0:r.__symbol__)==null?void 0:i.call(r,"requestAnimationFrame");return(s&&e[s]||e.requestAnimationFrame).call(e,t)}function Us(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function go(e){const t={},r=(s,a)=>{const o={value:s,parent:a,children:[]};return t[s.node.id]=o,o},i=[];for(const s of e){const{nextId:a,parentId:o}=s;if(a&&a in t){const u=t[a];if(u.parent){const l=u.parent.children.indexOf(u);u.parent.children.splice(l,0,r(s,u.parent))}else{const l=i.indexOf(u);i.splice(l,0,r(s,null))}continue}if(o in t){const u=t[o];u.children.push(r(s,u));continue}i.push(r(s,null))}return i}function Bs(e,t){t(e.value);for(let r=e.children.length-1;r>=0;r--)Bs(e.children[r],t)}function Qe(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function $s(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Ws(e,t){var r,i;const s=(i=(r=e.ownerDocument)==null?void 0:r.defaultView)==null?void 0:i.frameElement;if(!s||s===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};const a=s.getBoundingClientRect(),o=Ws(s,t),u=a.height/s.clientHeight;return{x:a.x*o.relativeScale+o.x,y:a.y*o.relativeScale+o.y,relativeScale:u,absoluteScale:o.absoluteScale*u}}function _e(e){return e?e instanceof Se&&"shadowRoot"in e?!!e.shadowRoot:!!F.shadowRoot(e):!1}function Ye(e,t){const r=e==null?void 0:e[t[0]];return r?t.length===1?r:Ye(r.cssRules,t.slice(1)):null}function as(e){const t=[...e],r=t.pop();return{positions:t,index:r}}function yo(e){const t=new Set,r=[];for(let i=e.length;i--;){const s=e[i];t.has(s.id)||(r.push(s),t.add(s.id))}return r}class zs{constructor(){M(this,"id",1),M(this,"styleIDMap",new WeakMap),M(this,"idStyleMap",new Map)}getId(t){var r;return(r=this.styleIDMap.get(t))!=null?r:-1}has(t){return this.styleIDMap.has(t)}add(t,r){if(this.has(t))return this.getId(t);let i;return r===void 0?i=this.id++:i=r,this.styleIDMap.set(t,i),this.idStyleMap.set(i,t),i}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function Vs(e){var t;let r=null;return"getRootNode"in e&&((t=F.getRootNode(e))==null?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&F.host(F.getRootNode(e))&&(r=F.host(F.getRootNode(e))),r}function wo(e){let t=e,r;for(;r=Vs(t);)t=r;return t}function bo(e){const t=F.ownerDocument(e);if(!t)return!1;const r=wo(e);return F.contains(t,r)}function qs(e){const t=F.ownerDocument(e);return t?F.contains(t,e)||bo(e):!1}const mu=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:zs,get _mirror(){return exports.mirror},closestElementOfNode:Ls,getBaseDimension:Ws,getNestedRule:Ye,getPositionsAndIndex:as,getRootShadowHost:wo,getShadowHost:Vs,getWindowHeight:ks,getWindowScroll:_s,getWindowWidth:Ps,hasShadowRoot:_e,hookSetter:ut,inDom:qs,isAncestorRemoved:Fs,isBlocked:oe,isIgnored:Et,isSerialized:mo,isSerializedIframe:Qe,isSerializedStylesheet:$s,iterateResolveTree:Bs,legacy_isTouchEvent:_t,get nowTimestamp(){return Ze},on:ne,polyfill:Us,queueToResolveTrees:go,requestAnimationFrameIn:Me,shadowHostInDom:bo,throttle:Ke,uniqueTextMutations:yo},Symbol.toStringTag,{value:"Module"}));var _=(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[e.Asset=7]="Asset",e))(_||{}),T=(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))(T||{}),V=(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))(V||{}),Re=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Re||{}),Ie=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Ie||{}),Te=(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))(Te||{}),z=(e=>(e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back",e.Destroy="destroy",e))(z||{}),Ne=(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))(Ne||{});const pn=(e,t)=>`${e}@${t}`;class gu{constructor(){M(this,"frozen",!1),M(this,"locked",!1),M(this,"texts",[]),M(this,"attributes",[]),M(this,"attributeMap",new WeakMap),M(this,"removes",[]),M(this,"mapRemoves",[]),M(this,"movedMap",{}),M(this,"addedSet",new Set),M(this,"movedSet",new Set),M(this,"droppedSet",new Set),M(this,"removesSubTreeCache",new Set),M(this,"mutationCb"),M(this,"blockClass"),M(this,"blockSelector"),M(this,"maskTextClass"),M(this,"maskTextSelector"),M(this,"inlineStylesheet"),M(this,"maskInputOptions"),M(this,"maskTextFn"),M(this,"maskInputFn"),M(this,"keepIframeSrcFn"),M(this,"recordCanvas"),M(this,"inlineImages"),M(this,"slimDOMOptions"),M(this,"dataURLOptions"),M(this,"doc"),M(this,"mirror"),M(this,"iframeManager"),M(this,"stylesheetManager"),M(this,"shadowDomManager"),M(this,"canvasManager"),M(this,"processedNodeManager"),M(this,"unattachedDoc"),M(this,"processMutations",t=>{t.forEach(this.processMutation),this.emit()}),M(this,"emit",()=>{if(this.frozen||this.locked)return;const t=[],r=new Set;for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const h of this.movedSet){const f=F.parentNode(h);this.removesSubTreeCache.has(f)&&!this.movedSet.has(f)||this.addedSet.add(h)}let i=null,s=null,a=-1,o=null,u=!1;const l=new Set,c=this.addedSet.values();let n=c.next();for(;this.addedSet.size;){if(i!==null&&this.addedSet.has(F.previousSibling(i)))o=i,i=F.previousSibling(i);else{for(this.addedSet.has(n.value)||(n=c.next()),i=n.value;;){if(s=F.parentNode(i),this.addedSet.has(s)){i=s;continue}break}if(l.has(s))s=null;else if(s){if(qs(s)?(u=mn(this.droppedSet,s)||this.removesSubTreeCache.has(s),u&&mn(this.movedSet,i)&&(u=!1)):u=!0,this.addedSet.has(F.lastChild(s)))i=F.lastChild(s),o=null;else for(;;){if(o=F.nextSibling(i),this.addedSet.has(o)){i=o;continue}break}if(a=st(s)?this.mirror.getId(Vs(i)):this.mirror.getId(s),a===-1&&s.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const p=F.host(s);a=this.mirror.getId(p)}}}if(this.addedSet.delete(i),!s||a===-1){l.add(i);continue}else if(u){this.droppedSet.add(i);continue}let h=!1;if(i.nodeType===Node.TEXT_NODE){const p=s.tagName;if(p==="TEXTAREA")continue;p==="STYLE"&&r.has(a)&&(h=!0)}let f=o?this.mirror.getId(o):null;for(;f===It;)o=o&&F.nextSibling(o),f=o&&this.mirror.getId(o);if(f===-1){console.warn("Couldn't record new node. Couldn't find mirror id for nextSibling:",o),i=null;continue}const m=He(i,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:p=>{Qe(p,this.mirror)&&this.iframeManager.addIframe(p),$s(p,this.mirror)&&this.stylesheetManager.trackLinkElement(p),_e(i)&&this.shadowDomManager.addShadowRoot(F.shadowRoot(i),this.doc)},onIframeLoad:(p,g)=>{this.iframeManager.attachIframe(p,g),this.shadowDomManager.observeAttachShadow(p)},onStylesheetLoad:(p,g)=>{this.stylesheetManager.attachLinkElement(p,g)},cssCaptured:h});m&&(t.push({parentId:a,nextId:f,node:m}),r.add(m.id))}const d={texts:this.texts.map(h=>{const f=h.node,m=F.parentNode(f);return m&&m.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(m),{id:this.mirror.getId(f),value:h.value}}).filter(h=>!r.has(h.id)).filter(h=>this.mirror.has(h.id)),attributes:this.attributes.map(h=>{const{attributes:f}=h;if(typeof f.style=="string"){const m=JSON.stringify(h.styleDiff),p=JSON.stringify(h._unchangedStyles);m.length<f.style.length&&(m+p).split("var(").length===f.style.split("var(").length&&(f.style=h.styleDiff)}return{id:this.mirror.getId(h.node),attributes:f}}).filter(h=>!r.has(h.id)).filter(h=>this.mirror.has(h.id)),removes:this.removes,adds:t};!d.texts.length&&!d.attributes.length&&!d.removes.length&&!d.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(d))}),M(this,"genTextAreaValueMutation",t=>{let r=this.attributeMap.get(t);r||(r={node:t,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(r),this.attributeMap.set(t,r));const i=Array.from(F.childNodes(t),s=>F.textContent(s)||"").join("");r.attributes.value=Mt({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:Nt(t),value:i,maskInputFn:this.maskInputFn})}),M(this,"processMutation",t=>{if(!Et(t.target,this.mirror,this.slimDOMOptions))switch(t.type){case"characterData":{const r=F.textContent(t.target);!oe(t.target,this.blockClass,this.blockSelector,!1)&&r!==t.oldValue&&this.texts.push({value:Bn(t.target,this.maskTextClass,this.maskTextSelector,!0)&&r?this.maskTextFn?this.maskTextFn(r,Ls(t.target)):r.replace(/[\S]/g,"*"):r,node:t.target});break}case"attributes":{const r=t.target,i=Oe(r.tagName);let s=t.attributeName,a=t.target.getAttribute(s);if(s==="value"){const u=Nt(r);a=Mt({element:r,maskInputOptions:this.maskInputOptions,tagName:r.tagName,type:u,value:a,maskInputFn:this.maskInputFn})}if(oe(t.target,this.blockClass,this.blockSelector,!1)||a===t.oldValue)return;let o=this.attributeMap.get(t.target);if(i==="iframe"&&s==="src"&&!this.keepIframeSrcFn(a))if(!r.contentDocument)s="rr_src";else return;if(o||(o={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(t.target,o)),s==="type"&&i==="input"&&(t.oldValue||"").toLowerCase()==="password"&&r.setAttribute("data-rr-is-password","true"),!Un(i,s))if(o.attributes[s]=Fn(this.doc,i,Oe(s),a),s==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(l){this.unattachedDoc=this.doc}const u=this.unattachedDoc.createElement("span");t.oldValue&&u.setAttribute("style",t.oldValue);for(const l of Array.from(r.style)){const c=r.style.getPropertyValue(l),n=r.style.getPropertyPriority(l);c!==u.style.getPropertyValue(l)||n!==u.style.getPropertyPriority(l)?n===""?o.styleDiff[l]=c:o.styleDiff[l]=[c,n]:o._unchangedStyles[l]=[c,n]}for(const l of Array.from(u.style))r.style.getPropertyValue(l)===""&&(o.styleDiff[l]=!1)}else s==="open"&&r.tagName==="DIALOG"&&(r.matches("dialog:modal")?o.attributes.rr_open_mode="modal":o.attributes.rr_open_mode="non-modal");break}case"childList":{if(oe(t.target,this.blockClass,this.blockSelector,!0))return;if(t.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(t.target);return}t.addedNodes.forEach(r=>this.genAdds(r,t.target)),t.removedNodes.forEach(r=>{const i=this.mirror.getId(r),s=st(t.target)?this.mirror.getId(F.host(t.target)):this.mirror.getId(t.target);oe(t.target,this.blockClass,this.blockSelector,!1)||Et(r,this.mirror,this.slimDOMOptions)||!mo(r,this.mirror)||(this.addedSet.has(r)?(ls(this.addedSet,r),this.droppedSet.add(r)):this.addedSet.has(t.target)&&i===-1||Fs(t.target,this.mirror)||(this.movedSet.has(r)&&this.movedMap[pn(i,s)]?ls(this.movedSet,r):(this.removes.push({parentId:s,id:i,isShadow:st(t.target)&&it(t.target)?!0:void 0}),yu(r,this.removesSubTreeCache))),this.mapRemoves.push(r))});break}}}),M(this,"genAdds",(t,r)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(Et(t,this.mirror,this.slimDOMOptions))return;this.movedSet.add(t);let i=null;r&&this.mirror.hasNode(r)&&(i=this.mirror.getId(r)),i&&i!==-1&&(this.movedMap[pn(this.mirror.getId(t),i)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);oe(t,this.blockClass,this.blockSelector,!1)||(F.childNodes(t).forEach(i=>this.genAdds(i)),_e(t)&&F.childNodes(F.shadowRoot(t)).forEach(i=>{this.processedNodeManager.add(i,this),this.genAdds(i,t)}))}})}init(t){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(r=>{this[r]=t[r]})}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 ls(e,t){e.delete(t),F.childNodes(t).forEach(r=>ls(e,r))}function yu(e,t){const r=[e];for(;r.length;){const i=r.pop();t.has(i)||(t.add(i),F.childNodes(i).forEach(s=>r.push(s)))}}function mn(e,t){return e.size===0?!1:vo(e,t)}function vo(e,t){if(e.has(t))return!0;const r=F.parentNode(t);return r?vo(e,r):!1}let ot;function wu(e){ot=e}function bu(){ot=void 0}const W=e=>ot?(...r)=>{try{return e(...r)}catch(i){if(ot&&ot(i)===!0)return;throw i}}:e,Le=[];function ct(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(t){}return e&&e.target}function So(e,t){const r=new gu;Le.push(r),r.init(e);const[i,s]=po(),a=new i(W(r.processMutations.bind(r)));return a.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),[a,s]}function vu({mousemoveCb:e,sampling:t,doc:r,mirror:i}){if(t.mousemove===!1)return()=>{};const s=typeof t.mousemove=="number"?t.mousemove:50,a=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let o=[],u;const l=Ke(W(d=>{const h=Date.now()-u;e(o.map(f=>(f.timeOffset-=h,f)),d),o=[],u=null}),a),c=W(Ke(W(d=>{const h=ct(d),{clientX:f,clientY:m}=_t(d)?d.changedTouches[0]:d;u||(u=Ze()),o.push({x:f,y:m,id:i.getId(h),timeOffset:Ze()-u}),l(typeof DragEvent!="undefined"&&d instanceof DragEvent?T.Drag:d instanceof MouseEvent?T.MouseMove:T.TouchMove)}),s,{trailing:!1})),n=[ne("mousemove",c,r),ne("touchmove",c,r),ne("drag",c,r)];return W(()=>{n.forEach(d=>d())})}function Su({mouseInteractionCb:e,doc:t,win:r,mirror:i,blockClass:s,blockSelector:a,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const u=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,l=[];let c=null;const n=d=>h=>{const f=ct(h);if(oe(f,s,a,!0))return;let m=null,p=d;if("pointerType"in h){switch(h.pointerType){case"mouse":m=Re.Mouse;break;case"touch":m=Re.Touch;break;case"pen":m=Re.Pen;break}m===Re.Touch?V[d]===V.MouseDown?p="TouchStart":V[d]===V.MouseUp&&(p="TouchEnd"):Re.Pen}else _t(h)&&(m=Re.Touch);m!==null?(c=m,(p.startsWith("Touch")&&m===Re.Touch||p.startsWith("Mouse")&&m===Re.Mouse)&&(m=null)):V[d]===V.Click&&(m=c,c=null);const g=_t(h)?h.changedTouches[0]:h;if(!g)return;const b=i.getId(f),{clientX:y,clientY:w}=g;W(e)(P({type:V[p],id:b,x:y,y:w},m!==null&&{pointerType:m}))};return Object.keys(V).filter(d=>Number.isNaN(Number(d))&&!d.endsWith("_Departed")&&u[d]!==!1).forEach(d=>{let h=Oe(d);const f=n(d);if(r.PointerEvent)switch(V[d]){case V.MouseDown:case V.MouseUp:h=h.replace("mouse","pointer");break;case V.TouchStart:case V.TouchEnd:return}l.push(ne(h,f,t))}),W(()=>{l.forEach(d=>d())})}function Co({scrollCb:e,doc:t,mirror:r,blockClass:i,blockSelector:s,sampling:a}){const o=W(Ke(W(u=>{const l=ct(u);if(!l||oe(l,i,s,!0))return;const c=r.getId(l);if(l===t&&t.defaultView){const n=_s(t.defaultView);e({id:c,x:n.left,y:n.top})}else e({id:c,x:l.scrollLeft,y:l.scrollTop})}),a.scroll||100));return ne("scroll",o,t)}function Cu({viewportResizeCb:e,win:t},{win:r}){let i=-1,s=-1;const a=W(Ke(W(()=>{const o=ks(t),u=Ps(t);(i!==o||s!==u)&&(e({width:Number(u),height:Number(o)}),i=o,s=u)}),200));return ne("resize",a,r)}const Eu=["INPUT","TEXTAREA","SELECT"],gn=new WeakMap;function xu({inputCb:e,doc:t,mirror:r,blockClass:i,blockSelector:s,ignoreClass:a,ignoreSelector:o,maskInputOptions:u,maskInputFn:l,sampling:c,userTriggeredOnInput:n}){function d(y){let w=ct(y);const C=y.isTrusted,v=w&&w.tagName;if(w&&v==="OPTION"&&(w=F.parentElement(w)),!w||!v||Eu.indexOf(v)<0||oe(w,i,s,!0)||w.classList.contains(a)||o&&w.matches(o))return;let S=w.value,E=!1;const R=Nt(w)||"";R==="radio"||R==="checkbox"?E=w.checked:(u[v.toLowerCase()]||u[R])&&(S=Mt({element:w,maskInputOptions:u,tagName:v,type:R,value:S,maskInputFn:l})),h(w,n?{text:S,isChecked:E,userTriggered:C}:{text:S,isChecked:E});const I=w.name;R==="radio"&&I&&E&&t.querySelectorAll(`input[type="radio"][name="${I}"]`).forEach(N=>{if(N!==w){const L=N.value;h(N,n?{text:L,isChecked:!E,userTriggered:!1}:{text:L,isChecked:!E})}})}function h(y,w){const C=gn.get(y);if(!C||C.text!==w.text||C.isChecked!==w.isChecked){gn.set(y,w);const v=r.getId(y);W(e)(re(P({},w),{id:v}))}}const m=(c.input==="last"?["change"]:["input","change"]).map(y=>ne(y,W(d),t)),p=t.defaultView;if(!p)return()=>{m.forEach(y=>y())};const g=p.Object.getOwnPropertyDescriptor(p.HTMLInputElement.prototype,"value"),b=[[p.HTMLInputElement.prototype,"value"],[p.HTMLInputElement.prototype,"checked"],[p.HTMLSelectElement.prototype,"value"],[p.HTMLTextAreaElement.prototype,"value"],[p.HTMLSelectElement.prototype,"selectedIndex"],[p.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&m.push(...b.map(y=>ut(y[0],y[1],{set(){W(d)({target:this,isTrusted:!1})}},!1,p))),W(()=>{m.forEach(y=>y())})}function kt(e,t){const r=[];function i(s,a){if(bt(e,"CSSGroupingRule")&&s.parentRule instanceof e.CSSGroupingRule||bt(e,"CSSMediaRule")&&s.parentRule instanceof e.CSSMediaRule||bt(e,"CSSSupportsRule")&&s.parentRule instanceof e.CSSSupportsRule||bt(e,"CSSConditionRule")&&s.parentRule instanceof e.CSSConditionRule){const u=Array.from(s.parentRule.cssRules).indexOf(s);return a.unshift(u),i(s.parentRule,a)}else if(s.parentStyleSheet){const u=Array.from(s.parentStyleSheet.cssRules).indexOf(s);a.unshift(u)}return a}return i(t,r)}function Ae(e,t,r){let i,s;return e?(e.ownerNode?i=t.getId(e.ownerNode):s=r.getId(e),{styleId:s,id:i}):{}}function Ru({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:i}){if(!i.CSSStyleSheet||!i.CSSStyleSheet.prototype)return()=>{};const s=i.CSSStyleSheet.prototype.insertRule;i.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:W((n,d,h)=>{const[f,m]=h,{id:p,styleId:g}=Ae(d,t,r.styleMirror);return(p&&p!==-1||g&&g!==-1)&&e({id:p,styleId:g,adds:[{rule:f,index:m}]}),n.apply(d,h)})}),i.CSSStyleSheet.prototype.addRule=function(n,d,h=this.cssRules.length){const f=`${n} { ${d} }`;return i.CSSStyleSheet.prototype.insertRule.apply(this,[f,h])};const a=i.CSSStyleSheet.prototype.deleteRule;i.CSSStyleSheet.prototype.deleteRule=new Proxy(a,{apply:W((n,d,h)=>{const[f]=h,{id:m,styleId:p}=Ae(d,t,r.styleMirror);return(m&&m!==-1||p&&p!==-1)&&e({id:m,styleId:p,removes:[{index:f}]}),n.apply(d,h)})}),i.CSSStyleSheet.prototype.removeRule=function(n){return i.CSSStyleSheet.prototype.deleteRule.apply(this,[n])};let o;i.CSSStyleSheet.prototype.replace&&(o=i.CSSStyleSheet.prototype.replace,i.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:W((n,d,h)=>{const[f]=h,{id:m,styleId:p}=Ae(d,t,r.styleMirror);return(m&&m!==-1||p&&p!==-1)&&e({id:m,styleId:p,replace:f}),n.apply(d,h)})}));let u;i.CSSStyleSheet.prototype.replaceSync&&(u=i.CSSStyleSheet.prototype.replaceSync,i.CSSStyleSheet.prototype.replaceSync=new Proxy(u,{apply:W((n,d,h)=>{const[f]=h,{id:m,styleId:p}=Ae(d,t,r.styleMirror);return(m&&m!==-1||p&&p!==-1)&&e({id:m,styleId:p,replaceSync:f}),n.apply(d,h)})}));const l={};vt(i,"CSSGroupingRule")?l.CSSGroupingRule=i.CSSGroupingRule:(vt(i,"CSSMediaRule")&&(l.CSSMediaRule=i.CSSMediaRule),vt(i,"CSSConditionRule")&&(l.CSSConditionRule=i.CSSConditionRule),vt(i,"CSSSupportsRule")&&(l.CSSSupportsRule=i.CSSSupportsRule));const c={};return Object.entries(l).forEach(([n,d])=>{c[n]={insertRule:d.prototype.insertRule,deleteRule:d.prototype.deleteRule},d.prototype.insertRule=new Proxy(c[n].insertRule,{apply:W((h,f,m)=>{const[p,g]=m,{id:b,styleId:y}=Ae(f.parentStyleSheet,t,r.styleMirror);return(b&&b!==-1||y&&y!==-1)&&e({id:b,styleId:y,adds:[{rule:p,index:[...kt(i,f),g||0]}]}),h.apply(f,m)})}),d.prototype.deleteRule=new Proxy(c[n].deleteRule,{apply:W((h,f,m)=>{const[p]=m,{id:g,styleId:b}=Ae(f.parentStyleSheet,t,r.styleMirror);return(g&&g!==-1||b&&b!==-1)&&e({id:g,styleId:b,removes:[{index:[...kt(i,f),p]}]}),h.apply(f,m)})})}),W(()=>{i.CSSStyleSheet.prototype.insertRule=s,i.CSSStyleSheet.prototype.deleteRule=a,o&&(i.CSSStyleSheet.prototype.replace=o),u&&(i.CSSStyleSheet.prototype.replaceSync=u),Object.entries(l).forEach(([n,d])=>{d.prototype.insertRule=c[n].insertRule,d.prototype.deleteRule=c[n].deleteRule})})}function Eo({mirror:e,stylesheetManager:t},r){var i,s,a;let o=null;r.nodeName==="#document"?o=e.getId(r):o=e.getId(F.host(r));const u=r.nodeName==="#document"?(i=r.defaultView)==null?void 0:i.Document:(a=(s=r.ownerDocument)==null?void 0:s.defaultView)==null?void 0:a.ShadowRoot,l=u!=null&&u.prototype?Object.getOwnPropertyDescriptor(u==null?void 0:u.prototype,"adoptedStyleSheets"):void 0;return o===null||o===-1||!u||!l?()=>{}:(Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var c;return(c=l.get)==null?void 0:c.call(this)},set(c){var n;const d=(n=l.set)==null?void 0:n.call(this,c);if(o!==null&&o!==-1)try{t.adoptStyleSheets(c,o)}catch(h){}return d}}),W(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))}function Mu({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:i},{win:s}){const a=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:W((u,l,c)=>{var n;const[d,h,f]=c;if(r.has(d))return a.apply(l,[d,h,f]);const{id:m,styleId:p}=Ae((n=l.parentRule)==null?void 0:n.parentStyleSheet,t,i.styleMirror);return(m&&m!==-1||p&&p!==-1)&&e({id:m,styleId:p,set:{property:d,value:h,priority:f},index:kt(s,l.parentRule)}),u.apply(l,c)})});const o=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:W((u,l,c)=>{var n;const[d]=c;if(r.has(d))return o.apply(l,[d]);const{id:h,styleId:f}=Ae((n=l.parentRule)==null?void 0:n.parentStyleSheet,t,i.styleMirror);return(h&&h!==-1||f&&f!==-1)&&e({id:h,styleId:f,remove:{property:d},index:kt(s,l.parentRule)}),u.apply(l,c)})}),W(()=>{s.CSSStyleDeclaration.prototype.setProperty=a,s.CSSStyleDeclaration.prototype.removeProperty=o})}function Nu({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:i,sampling:s,doc:a}){const o=W(l=>Ke(W(c=>{const n=ct(c);if(!n||oe(n,t,r,!0))return;const{currentTime:d,volume:h,muted:f,playbackRate:m,loop:p}=n;e({type:l,id:i.getId(n),currentTime:d,volume:h,muted:f,playbackRate:m,loop:p})}),s.media||500)),u=[ne("play",o(Te.Play),a),ne("pause",o(Te.Pause),a),ne("seeked",o(Te.Seeked),a),ne("volumechange",o(Te.VolumeChange),a),ne("ratechange",o(Te.RateChange),a)];return W(()=>{u.forEach(l=>l())})}function Ou({fontCb:e,doc:t}){const r=t.defaultView;if(!r)return()=>{};const i=[],s=new WeakMap,a=r.FontFace;r.FontFace=function(l,c,n){const d=new a(l,c,n);return s.set(d,{family:l,buffer:typeof c!="string",descriptors:n,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(new Uint8Array(c)))}),d};const o=Be(t.fonts,"add",function(u){return function(l){return setTimeout(W(()=>{const c=s.get(l);c&&(e(c),s.delete(l))}),0),u.apply(this,[l])}});return i.push(()=>{r.FontFace=a}),i.push(o),W(()=>{i.forEach(u=>u())})}function Iu(e){const{doc:t,mirror:r,blockClass:i,blockSelector:s,selectionCb:a}=e;let o=!0;const u=W(()=>{const l=t.getSelection();if(!l||o&&(l!=null&&l.isCollapsed))return;o=l.isCollapsed||!1;const c=[],n=l.rangeCount||0;for(let d=0;d<n;d++){const h=l.getRangeAt(d),{startContainer:f,startOffset:m,endContainer:p,endOffset:g}=h;oe(f,i,s,!0)||oe(p,i,s,!0)||c.push({start:r.getId(f),startOffset:m,end:r.getId(p),endOffset:g})}a({ranges:c})});return u(),ne("selectionchange",u)}function Du({doc:e,customElementCb:t}){const r=e.defaultView;return!r||!r.customElements?()=>{}:Be(r.customElements,"define",function(s){return function(a,o,u){try{t({define:{name:a}})}catch(l){console.warn(`Custom element callback failed for ${a}`)}return s.apply(this,[a,o,u])}})}function Au(e,t){const{mutationCb:r,mousemoveCb:i,mouseInteractionCb:s,scrollCb:a,viewportResizeCb:o,inputCb:u,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:n,canvasMutationCb:d,fontCb:h,selectionCb:f,customElementCb:m}=e;e.mutationCb=(...p)=>{t.mutation&&t.mutation(...p),r(...p)},e.mousemoveCb=(...p)=>{t.mousemove&&t.mousemove(...p),i(...p)},e.mouseInteractionCb=(...p)=>{t.mouseInteraction&&t.mouseInteraction(...p),s(...p)},e.scrollCb=(...p)=>{t.scroll&&t.scroll(...p),a(...p)},e.viewportResizeCb=(...p)=>{t.viewportResize&&t.viewportResize(...p),o(...p)},e.inputCb=(...p)=>{t.input&&t.input(...p),u(...p)},e.mediaInteractionCb=(...p)=>{t.mediaInteaction&&t.mediaInteaction(...p),l(...p)},e.styleSheetRuleCb=(...p)=>{t.styleSheetRule&&t.styleSheetRule(...p),c(...p)},e.styleDeclarationCb=(...p)=>{t.styleDeclaration&&t.styleDeclaration(...p),n(...p)},e.canvasMutationCb=(...p)=>{t.canvasMutation&&t.canvasMutation(...p),d(...p)},e.fontCb=(...p)=>{t.font&&t.font(...p),h(...p)},e.selectionCb=(...p)=>{t.selection&&t.selection(...p),f(...p)},e.customElementCb=(...p)=>{t.customElement&&t.customElement(...p),m(...p)}}function Tu(e,t={}){const r=e.doc.defaultView;if(!r)return()=>{};Au(e,t);let i,s=()=>{};e.recordDOM&&([i,s]=So(e,e.doc));const a=vu(e),o=Su(e),u=Co(e),l=Cu(e,{win:r}),c=xu(e),n=Nu(e);let d=()=>{},h=()=>{},f=()=>{},m=()=>{};e.recordDOM&&(d=Ru(e,{win:r}),h=Eo(e,e.doc),f=Mu(e,{win:r}),e.collectFonts&&(m=Ou(e)));const p=Iu(e),g=Du(e),b=[];for(const y of e.plugins)b.push(y.observer(y.callback,r,y.options));return W(()=>{Le.forEach(y=>y.reset()),i==null||i.disconnect(),s(),a(),o(),u(),l(),c(),n(),d(),h(),f(),m(),p(),g(),b.forEach(y=>y())})}function bt(e,t){return typeof e[t]!="undefined"}function vt(e,t){return!!(typeof e[t]!="undefined"&&e[t].prototype&&"insertRule"in e[t].prototype&&"deleteRule"in e[t].prototype)}class yn{constructor(t){M(this,"iframeIdToRemoteIdMap",new WeakMap),M(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=t}getId(t,r,i,s){const a=i||this.getIdToRemoteIdMap(t),o=s||this.getRemoteIdToIdMap(t);let u=a.get(r);return u||(u=this.generateIdFn(),a.set(r,u),o.set(u,r)),u}getIds(t,r){const i=this.getIdToRemoteIdMap(t),s=this.getRemoteIdToIdMap(t);return r.map(a=>this.getId(t,a,i,s))}getRemoteId(t,r,i){const s=i||this.getRemoteIdToIdMap(t);if(typeof r!="number")return r;const a=s.get(r);return a||-1}getRemoteIds(t,r){const i=this.getRemoteIdToIdMap(t);return r.map(s=>this.getRemoteId(t,s,i))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let r=this.iframeIdToRemoteIdMap.get(t);return r||(r=new Map,this.iframeIdToRemoteIdMap.set(t,r)),r}getRemoteIdToIdMap(t){let r=this.iframeRemoteIdToIdMap.get(t);return r||(r=new Map,this.iframeRemoteIdToIdMap.set(t,r)),r}}class _u{constructor(t){M(this,"iframes",new WeakMap),M(this,"crossOriginIframeMap",new WeakMap),M(this,"crossOriginIframeMirror",new yn(Ln)),M(this,"crossOriginIframeStyleMirror"),M(this,"crossOriginIframeRootIdMap",new WeakMap),M(this,"mirror"),M(this,"mutationCb"),M(this,"wrappedEmit"),M(this,"loadListener"),M(this,"stylesheetManager"),M(this,"recordCrossOriginIframes"),this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new yn(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&t.win.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,r){var i,s;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:r}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((i=t.contentWindow)==null||i.addEventListener("message",this.handleMessage.bind(this))),(s=this.loadListener)==null||s.call(this,t),t.contentDocument&&t.contentDocument.adoptedStyleSheets&&t.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(t.contentDocument.adoptedStyleSheets,this.mirror.getId(t.contentDocument))}handleMessage(t){const r=t;if(r.data.type!=="rrweb"||r.origin!==r.data.origin||!t.source)return;const s=this.crossOriginIframeMap.get(t.source);if(!s)return;const a=this.transformCrossOriginEvent(s,r.data.event);a&&this.wrappedEmit(a,r.data.isCheckout)}transformCrossOriginEvent(t,r){var i;switch(r.type){case _.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(r.data.node,t);const s=r.data.node.id;return this.crossOriginIframeRootIdMap.set(t,s),this.patchRootIdOnNode(r.data.node,s),{timestamp:r.timestamp,type:_.IncrementalSnapshot,data:{source:T.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:r.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case _.Meta:case _.Load:case _.DomContentLoaded:return!1;case _.Plugin:return r;case _.Custom:return this.replaceIds(r.data.payload,t,["id","parentId","previousId","nextId"]),r;case _.IncrementalSnapshot:switch(r.data.source){case T.Mutation:return r.data.adds.forEach(s=>{this.replaceIds(s,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(s.node,t);const a=this.crossOriginIframeRootIdMap.get(t);a&&this.patchRootIdOnNode(s.node,a)}),r.data.removes.forEach(s=>{this.replaceIds(s,t,["parentId","id"])}),r.data.attributes.forEach(s=>{this.replaceIds(s,t,["id"])}),r.data.texts.forEach(s=>{this.replaceIds(s,t,["id"])}),r;case T.Drag:case T.TouchMove:case T.MouseMove:return r.data.positions.forEach(s=>{this.replaceIds(s,t,["id"])}),r;case T.ViewportResize:return!1;case T.MediaInteraction:case T.MouseInteraction:case T.Scroll:case T.CanvasMutation:case T.Input:return this.replaceIds(r.data,t,["id"]),r;case T.StyleSheetRule:case T.StyleDeclaration:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleId"]),r;case T.Font:return r;case T.Selection:return r.data.ranges.forEach(s=>{this.replaceIds(s,t,["start","end"])}),r;case T.AdoptedStyleSheet:return this.replaceIds(r.data,t,["id"]),this.replaceStyleIds(r.data,t,["styleIds"]),(i=r.data.styles)==null||i.forEach(s=>{this.replaceStyleIds(s,t,["styleId"])}),r}}return!1}replace(t,r,i,s){for(const a of s)!Array.isArray(r[a])&&typeof r[a]!="number"||(Array.isArray(r[a])?r[a]=t.getIds(i,r[a]):r[a]=t.getId(i,r[a]));return r}replaceIds(t,r,i){return this.replace(this.crossOriginIframeMirror,t,r,i)}replaceStyleIds(t,r,i){return this.replace(this.crossOriginIframeStyleMirror,t,r,i)}replaceIdOnNode(t,r){this.replaceIds(t,r,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(i=>{this.replaceIdOnNode(i,r)})}patchRootIdOnNode(t,r){t.type!==Ne.Document&&!t.rootId&&(t.rootId=r),"childNodes"in t&&t.childNodes.forEach(i=>{this.patchRootIdOnNode(i,r)})}}class ku{constructor(t){M(this,"shadowDoms",new WeakSet),M(this,"mutationCb"),M(this,"scrollCb"),M(this,"bypassOptions"),M(this,"mirror"),M(this,"restoreHandlers",[]),this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(this.bypassOptions.win.Element,this.bypassOptions.win.document)}addShadowRoot(t,r){if(!it(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t);const[i]=So(re(P({},this.bypassOptions),{doc:r,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),t);this.restoreHandlers.push(()=>i.disconnect()),this.restoreHandlers.push(Co(re(P({},this.bypassOptions),{scrollCb:this.scrollCb,doc:t,mirror:this.mirror}))),setTimeout(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(F.host(t))),this.restoreHandlers.push(Eo({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){!t.contentWindow||!t.contentDocument||this.patchAttachShadow(t.contentWindow.Element,t.contentDocument)}patchAttachShadow(t,r){const i=this;this.restoreHandlers.push(Be(t.prototype,"attachShadow",function(s){return function(a){const o=s.call(this,a),u=F.shadowRoot(this);return u&&qs(this)&&i.addShadowRoot(u,r),o}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch(r){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}var Xe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",rt=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(var St=0;St<Xe.length;St++)rt[Xe.charCodeAt(St)]=St;var Pu=function(e){var t=new Uint8Array(e),r,i=t.length,s="";for(r=0;r<i;r+=3)s+=Xe[t[r]>>2],s+=Xe[(t[r]&3)<<4|t[r+1]>>4],s+=Xe[(t[r+1]&15)<<2|t[r+2]>>6],s+=Xe[t[r+2]&63];return i%3===2?s=s.substring(0,s.length-1)+"=":i%3===1&&(s=s.substring(0,s.length-2)+"=="),s},Lu=function(e){var t=e.length*.75,r=e.length,i,s=0,a,o,u,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var c=new ArrayBuffer(t),n=new Uint8Array(c);for(i=0;i<r;i+=4)a=rt[e.charCodeAt(i)],o=rt[e.charCodeAt(i+1)],u=rt[e.charCodeAt(i+2)],l=rt[e.charCodeAt(i+3)],n[s++]=a<<2|o>>4,n[s++]=(o&15)<<4|u>>2,n[s++]=(u&3)<<6|l&63;return c};const wn=new Map;function Fu(e,t){let r=wn.get(e);return r||(r=new Map,wn.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}const xo=(e,t,r)=>{if(!e||!(Mo(e,t)||typeof e=="object"))return;const i=e.constructor.name,s=Fu(r,i);let a=s.indexOf(e);return a===-1&&(a=s.length,s.push(e)),a};function xt(e,t,r){if(e instanceof Array)return e.map(i=>xt(i,t,r));if(e===null)return e;if(e instanceof t.Float32Array||e instanceof t.Float64Array||e instanceof t.Int32Array||e instanceof t.Uint32Array||e instanceof t.Uint8Array||e instanceof t.Uint16Array||e instanceof t.Int16Array||e instanceof t.Int8Array||e instanceof t.Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof t.ArrayBuffer){const i=e.constructor.name,s=Pu(e);return{rr_type:i,base64:s}}else{if(e instanceof t.DataView)return{rr_type:e.constructor.name,args:[xt(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof t.HTMLImageElement){const i=e.constructor.name,{src:s}=e;return{rr_type:i,src:s}}else if(e instanceof t.HTMLCanvasElement){const i="HTMLImageElement",s=e.toDataURL();return{rr_type:i,src:s}}else{if(e instanceof t.ImageData)return{rr_type:e.constructor.name,args:[xt(e.data,t,r),e.width,e.height]};if(Mo(e,t)||typeof e=="object"){const i=e.constructor.name,s=xo(e,t,r);return{rr_type:i,index:s}}}}return e}const Ro=(e,t,r)=>e.map(i=>xt(i,t,r)),Mo=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(s=>typeof t[s]=="function").find(s=>e instanceof t[s]);function Uu(e,t,r,i){const s=[],a=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const o of a)try{if(typeof t.CanvasRenderingContext2D.prototype[o]!="function")continue;const u=Be(t.CanvasRenderingContext2D.prototype,o,function(l){return function(...c){return oe(this.canvas,r,i,!0)||setTimeout(()=>{const n=Ro(c,t,this);e(this.canvas,{type:Ie["2D"],property:o,args:n})},0),l.apply(this,c)}});s.push(u)}catch(u){const l=ut(t.CanvasRenderingContext2D.prototype,o,{set(c){e(this.canvas,{type:Ie["2D"],property:o,args:[c],setter:!0})}});s.push(l)}return()=>{s.forEach(o=>o())}}function Bu(e){return e==="experimental-webgl"?"webgl":e}function bn(e,t,r,i){const s=[];try{const a=Be(e.HTMLCanvasElement.prototype,"getContext",function(o){return function(u,...l){if(!oe(this,t,r,!0)){const c=Bu(u);if("__context"in this||(this.__context=c),i&&["webgl","webgl2"].includes(c))if(l[0]&&typeof l[0]=="object"){const n=l[0];n.preserveDrawingBuffer||(n.preserveDrawingBuffer=!0)}else l.splice(0,1,{preserveDrawingBuffer:!0})}return o.apply(this,[u,...l])}});s.push(a)}catch(a){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach(a=>a())}}function vn(e,t,r,i,s,a){const o=[],u=Object.getOwnPropertyNames(e);for(const l of u)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if(typeof e[l]!="function")continue;const c=Be(e,l,function(n){return function(...d){const h=n.apply(this,d);if(xo(h,a,this),"tagName"in this.canvas&&!oe(this.canvas,i,s,!0)){const f=Ro(d,a,this),m={type:t,property:l,args:f};r(this.canvas,m)}return h}});o.push(c)}catch(c){const n=ut(e,l,{set(d){r(this.canvas,{type:t,property:l,args:[d],setter:!0})}});o.push(n)}return o}function $u(e,t,r,i){const s=[];return typeof t.WebGLRenderingContext!="undefined"&&s.push(...vn(t.WebGLRenderingContext.prototype,Ie.WebGL,e,r,i,t)),typeof t.WebGL2RenderingContext!="undefined"&&s.push(...vn(t.WebGL2RenderingContext.prototype,Ie.WebGL2,e,r,i,t)),()=>{s.forEach(a=>a())}}const No=`(function() {
|
|
68
|
+
"use strict";
|
|
69
|
+
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
70
|
+
var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);
|
|
71
|
+
for (var i = 0; i < chars.length; i++) {
|
|
72
|
+
lookup[chars.charCodeAt(i)] = i;
|
|
73
|
+
}
|
|
74
|
+
var encode = function(arraybuffer) {
|
|
75
|
+
var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";
|
|
76
|
+
for (i2 = 0; i2 < len; i2 += 3) {
|
|
77
|
+
base64 += chars[bytes[i2] >> 2];
|
|
78
|
+
base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];
|
|
79
|
+
base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];
|
|
80
|
+
base64 += chars[bytes[i2 + 2] & 63];
|
|
81
|
+
}
|
|
82
|
+
if (len % 3 === 2) {
|
|
83
|
+
base64 = base64.substring(0, base64.length - 1) + "=";
|
|
84
|
+
} else if (len % 3 === 1) {
|
|
85
|
+
base64 = base64.substring(0, base64.length - 2) + "==";
|
|
86
|
+
}
|
|
87
|
+
return base64;
|
|
88
|
+
};
|
|
89
|
+
const lastBlobMap = /* @__PURE__ */ new Map();
|
|
90
|
+
const transparentBlobMap = /* @__PURE__ */ new Map();
|
|
91
|
+
async function getTransparentBlobFor(width, height, dataURLOptions) {
|
|
92
|
+
const id = \`\${width}-\${height}\`;
|
|
93
|
+
if ("OffscreenCanvas" in globalThis) {
|
|
94
|
+
if (transparentBlobMap.has(id)) return transparentBlobMap.get(id);
|
|
95
|
+
const offscreen = new OffscreenCanvas(width, height);
|
|
96
|
+
offscreen.getContext("2d");
|
|
97
|
+
const blob = await offscreen.convertToBlob(dataURLOptions);
|
|
98
|
+
const arrayBuffer = await blob.arrayBuffer();
|
|
99
|
+
const base64 = encode(arrayBuffer);
|
|
100
|
+
transparentBlobMap.set(id, base64);
|
|
101
|
+
return base64;
|
|
102
|
+
} else {
|
|
103
|
+
return "";
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
const worker = self;
|
|
107
|
+
worker.onmessage = async function(e) {
|
|
108
|
+
if ("OffscreenCanvas" in globalThis) {
|
|
109
|
+
const { id, bitmap, width, height, dataURLOptions } = e.data;
|
|
110
|
+
const transparentBase64 = getTransparentBlobFor(
|
|
111
|
+
width,
|
|
112
|
+
height,
|
|
113
|
+
dataURLOptions
|
|
114
|
+
);
|
|
115
|
+
const offscreen = new OffscreenCanvas(width, height);
|
|
116
|
+
const ctx = offscreen.getContext("2d");
|
|
117
|
+
ctx.drawImage(bitmap, 0, 0);
|
|
118
|
+
bitmap.close();
|
|
119
|
+
const blob = await offscreen.convertToBlob(dataURLOptions);
|
|
120
|
+
const type = blob.type;
|
|
121
|
+
const arrayBuffer = await blob.arrayBuffer();
|
|
122
|
+
const base64 = encode(arrayBuffer);
|
|
123
|
+
if (!lastBlobMap.has(id) && await transparentBase64 === base64) {
|
|
124
|
+
lastBlobMap.set(id, base64);
|
|
125
|
+
return worker.postMessage({ id });
|
|
126
|
+
}
|
|
127
|
+
if (lastBlobMap.get(id) === base64) return worker.postMessage({ id });
|
|
128
|
+
worker.postMessage({
|
|
129
|
+
id,
|
|
130
|
+
type,
|
|
131
|
+
base64,
|
|
132
|
+
width,
|
|
133
|
+
height
|
|
134
|
+
});
|
|
135
|
+
lastBlobMap.set(id, base64);
|
|
136
|
+
} else {
|
|
137
|
+
return worker.postMessage({ id: e.data.id });
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
})();
|
|
141
|
+
//# sourceMappingURL=image-bitmap-data-url-worker-IJpC7g_b.js.map
|
|
142
|
+
`,Sn=typeof self!="undefined"&&self.Blob&&new Blob([No],{type:"text/javascript;charset=utf-8"});function Wu(e){let t;try{if(t=Sn&&(self.URL||self.webkitURL).createObjectURL(Sn),!t)throw"";const r=new Worker(t,{name:e==null?void 0:e.name});return r.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),r}catch(r){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(No),{name:e==null?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}class zu{constructor(t){M(this,"pendingCanvasMutations",new Map),M(this,"rafStamps",{latestId:0,invokeId:null}),M(this,"mirror"),M(this,"mutationCb"),M(this,"resetObservers"),M(this,"frozen",!1),M(this,"locked",!1),M(this,"win"),M(this,"processMutation",(l,c)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(l)||this.pendingCanvasMutations.set(l,[]),this.pendingCanvasMutations.get(l).push(c)});const{sampling:r="all",win:i,blockClass:s,blockSelector:a,recordCanvas:o,dataURLOptions:u}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,this.win=i,o&&r==="all"&&this.initCanvasMutationObserver(i,s,a),o&&typeof r=="number"&&this.initCanvasFPSObserver(r,i,s,a,{dataURLOptions:u})}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(t,r,i,s,a){const o=bn(r,i,s,!0),u=new Map,l=new Wu;l.onmessage=m=>{const{id:p}=m.data;if(u.set(p,!1),!("base64"in m.data))return;const{base64:g,type:b,width:y,height:w}=m.data;this.mutationCb({id:p,type:Ie["2D"],commands:[{property:"clearRect",args:[0,0,y,w]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:g}],type:b}]},0,0]}]})};const c=1e3/t;let n=0,d;const h=()=>{const m=[];return r.document.querySelectorAll("canvas").forEach(p=>{oe(p,i,s,!0)||m.push(p)}),m},f=m=>{if(n&&m-n<c){d=Me(r,f);return}n=m,h().forEach(async p=>{var g;const b=this.mirror.getId(p);if(u.get(b)||p.width===0||p.height===0)return;if(u.set(b,!0),["webgl","webgl2"].includes(p.__context)){const w=p.getContext(p.__context);((g=w==null?void 0:w.getContextAttributes())==null?void 0:g.preserveDrawingBuffer)===!1&&w.clear(w.COLOR_BUFFER_BIT)}const y=await createImageBitmap(p);l.postMessage({id:b,bitmap:y,width:p.width,height:p.height,dataURLOptions:a.dataURLOptions},[y])}),d=Me(r,f)};d=Me(r,f),this.resetObservers=()=>{o(),r.cancelAnimationFrame(d)}}initCanvasMutationObserver(t,r,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const s=bn(t,r,i,!1),a=Uu(this.processMutation.bind(this),t,r,i),o=$u(this.processMutation.bind(this),t,r,i);this.resetObservers=()=>{s(),a(),o()}}startPendingCanvasMutationFlusher(){Me(this.win,()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=r=>{this.rafStamps.latestId=r,Me(this.win,t)};Me(this.win,t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{const i=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,i)}),Me(this.win,()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;const i=this.pendingCanvasMutations.get(t);if(!i||r===-1)return;const s=i.map(o=>{const c=o,{type:u}=c;return We(c,["type"])}),{type:a}=i[0];this.mutationCb({id:r,type:a,commands:s}),this.pendingCanvasMutations.delete(t)}}class Vu{constructor(t){M(this,"trackedLinkElements",new WeakSet),M(this,"mutationCb"),M(this,"adoptedStyleSheetCb"),M(this,"styleMirror",new zs),this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,r){"_cssText"in r.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:r.id,attributes:r.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,r){if(t.length===0)return;const i={id:r,styleIds:[]},s=[];for(const a of t){let o;this.styleMirror.has(a)?o=this.styleMirror.getId(a):(o=this.styleMirror.add(a),s.push({styleId:o,rules:Array.from(a.rules||CSSRule,(u,l)=>({rule:kn(u,a.href),index:l}))})),i.styleIds.push(o)}s.length>0&&(i.styles=s),this.adoptedStyleSheetCb(i)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class qu{constructor(t){M(this,"nodeMap",new WeakMap),M(this,"active",!1),this.win=t}inOtherBuffer(t,r){const i=this.nodeMap.get(t);return i&&Array.from(i).some(s=>s!==r)}add(t,r){this.active||(this.active=!0,Me(this.win,()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(r))}destroy(){}}let ee,Rt,ts,Pt=!1;try{if(Array.from([1],e=>e*2)[0]!==2){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=((Ys=e.contentWindow)==null?void 0:Ys.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const we=Pn();function Pe(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:i,blockClass:s="rr-block",blockSelector:a=null,ignoreClass:o="rr-ignore",ignoreSelector:u=null,maskTextClass:l="rr-mask",maskTextSelector:c=null,inlineStylesheet:n=!0,maskAllInputs:d,maskInputOptions:h,slimDOMOptions:f,maskInputFn:m,maskTextFn:p,hooks:g,packFn:b,sampling:y={},dataURLOptions:w={},mousemoveWait:C,recordDOM:v=!0,recordCanvas:S=!1,recordCrossOriginIframes:E=!1,recordAfter:R=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:I=!1,collectFonts:N=!1,inlineImages:L=!1,win:k=window,plugins:x,keepIframeSrcFn:ae=()=>!1,ignoreCSSAttributes:le=new Set([]),errorHandler:q}=e,D=k;wu(q);const H=E?D.parent===D:!0;let te=!1;if(!H)try{D.parent.document&&(te=!1)}catch(B){te=!0}if(H&&!t)throw new Error("emit function is required");if(!H&&!te)return()=>{};C!==void 0&&y.mousemove===void 0&&(y.mousemove=C),we.reset();const J=d===!0?{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}:h!==void 0?h:{password:!0},j=$n(f);Us(D);let De,O=0;const Ce=B=>{for(const ye of x||[])ye.eventProcessor&&(B=ye.eventProcessor(B));return b&&!te&&(B=b(B)),B};ee=(B,ye)=>{var Z;const K=B;if(K.timestamp=Ze(),(Z=Le[0])!=null&&Z.isFrozen()&&K.type!==_.FullSnapshot&&!(K.type===_.IncrementalSnapshot&&K.data.source===T.Mutation)&&Le.forEach(ce=>ce.unfreeze()),H)t==null||t(Ce(K),ye);else if(te){const ce={type:"rrweb",event:Ce(K),origin:D.location.origin,isCheckout:ye};D.parent.postMessage(ce,"*")}if(K.type===_.FullSnapshot)De=K,O=0;else if(K.type===_.IncrementalSnapshot){if(K.data.source===T.Mutation&&K.data.isAttachIframe)return;O++;const ce=i&&O>=i,G=r&&K.timestamp-De.timestamp>r;(ce||G)&&Rt(!0)}};const ue=B=>{ee({type:_.IncrementalSnapshot,data:P({source:T.Mutation},B)})},$e=B=>ee({type:_.IncrementalSnapshot,data:P({source:T.Scroll},B)}),Ee=B=>ee({type:_.IncrementalSnapshot,data:P({source:T.CanvasMutation},B)}),tt=B=>ee({type:_.IncrementalSnapshot,data:P({source:T.AdoptedStyleSheet},B)}),me=new Vu({mutationCb:ue,adoptedStyleSheetCb:tt}),ge=new _u({win:D,mirror:we,mutationCb:ue,stylesheetManager:me,recordCrossOriginIframes:E,wrappedEmit:ee});for(const B of x||[])B.getMirror&&B.getMirror({nodeMirror:we,crossOriginIframeMirror:ge.crossOriginIframeMirror,crossOriginIframeStyleMirror:ge.crossOriginIframeStyleMirror});const se=new qu(D);ts=new zu({recordCanvas:S,mutationCb:Ee,win:D,blockClass:s,blockSelector:a,mirror:we,sampling:y.canvas,dataURLOptions:w});const pe=new ku({mutationCb:ue,scrollCb:$e,bypassOptions:{win:D,blockClass:s,blockSelector:a,maskTextClass:l,maskTextSelector:c,inlineStylesheet:n,maskInputOptions:J,dataURLOptions:w,maskTextFn:p,maskInputFn:m,recordCanvas:S,inlineImages:L,sampling:y,slimDOMOptions:j,iframeManager:ge,stylesheetManager:me,canvasManager:ts,keepIframeSrcFn:ae,processedNodeManager:se},mirror:we});Rt=(B=!1)=>{if(!v)return;ee({type:_.Meta,data:{href:D.location.href,width:Ps(D),height:ks(D)}},B),me.reset(),pe.init(),Le.forEach(Z=>Z.lock());const ye=ka(D.document,{mirror:we,blockClass:s,blockSelector:a,maskTextClass:l,maskTextSelector:c,inlineStylesheet:n,maskAllInputs:J,maskTextFn:p,maskInputFn:m,slimDOM:j,dataURLOptions:w,recordCanvas:S,inlineImages:L,onSerialize:Z=>{Qe(Z,we)&&ge.addIframe(Z),$s(Z,we)&&me.trackLinkElement(Z),_e(Z)&&pe.addShadowRoot(F.shadowRoot(Z),D.document)},onIframeLoad:(Z,K)=>{ge.attachIframe(Z,K),pe.observeAttachShadow(Z)},onStylesheetLoad:(Z,K)=>{me.attachLinkElement(Z,K)},keepIframeSrcFn:ae});if(!ye)return console.warn("Failed to snapshot the document");ee({type:_.FullSnapshot,data:{node:ye,initialOffset:_s(D)}},B),Le.forEach(Z=>Z.unlock()),D.document.adoptedStyleSheets&&D.document.adoptedStyleSheets.length>0&&me.adoptStyleSheets(D.document.adoptedStyleSheets,we.getId(D.document))};try{const B=[],ye=K=>{var ce;return W(Tu)({mutationCb:ue,mousemoveCb:(G,Jt)=>ee({type:_.IncrementalSnapshot,data:{source:Jt,positions:G}}),mouseInteractionCb:G=>ee({type:_.IncrementalSnapshot,data:P({source:T.MouseInteraction},G)}),scrollCb:$e,viewportResizeCb:G=>ee({type:_.IncrementalSnapshot,data:P({source:T.ViewportResize},G)}),inputCb:G=>ee({type:_.IncrementalSnapshot,data:P({source:T.Input},G)}),mediaInteractionCb:G=>ee({type:_.IncrementalSnapshot,data:P({source:T.MediaInteraction},G)}),styleSheetRuleCb:G=>ee({type:_.IncrementalSnapshot,data:P({source:T.StyleSheetRule},G)}),styleDeclarationCb:G=>ee({type:_.IncrementalSnapshot,data:P({source:T.StyleDeclaration},G)}),canvasMutationCb:Ee,fontCb:G=>ee({type:_.IncrementalSnapshot,data:P({source:T.Font},G)}),selectionCb:G=>{ee({type:_.IncrementalSnapshot,data:P({source:T.Selection},G)})},customElementCb:G=>{ee({type:_.IncrementalSnapshot,data:P({source:T.CustomElement},G)})},blockClass:s,ignoreClass:o,ignoreSelector:u,maskTextClass:l,maskTextSelector:c,maskInputOptions:J,inlineStylesheet:n,sampling:y,recordDOM:v,recordCanvas:S,inlineImages:L,userTriggeredOnInput:I,collectFonts:N,win:D,doc:K,maskInputFn:m,maskTextFn:p,keepIframeSrcFn:ae,blockSelector:a,slimDOMOptions:j,dataURLOptions:w,mirror:we,iframeManager:ge,stylesheetManager:me,shadowDomManager:pe,processedNodeManager:se,canvasManager:ts,ignoreCSSAttributes:le,plugins:((ce=x==null?void 0:x.filter(G=>G.observer))==null?void 0:ce.map(G=>({observer:G.observer,options:G.options,callback:Jt=>ee({type:_.Plugin,data:{plugin:G.name,payload:Jt}})})))||[]},g)};ge.addLoadListener(K=>{try{B.push(ye(K.contentDocument))}catch(ce){console.warn(ce)}});const Z=()=>{Rt(),B.push(ye(D.document)),Pt=!0};return["interactive","complete"].includes(D.document.readyState)?Z():(B.push(ne("DOMContentLoaded",()=>{ee({type:_.DomContentLoaded,data:{}}),R==="DOMContentLoaded"&&Z()},D.document)),B.push(ne("load",()=>{ee({type:_.Load,data:{}}),R==="load"&&Z()},D))),()=>{B.forEach(K=>{try{K()}catch(ce){String(ce).toLowerCase().includes("cross-origin")||console.warn(ce)}}),se.destroy(),Pt=!1,bu()}}catch(B){console.warn(B)}}Pe.addCustomEvent=(e,t)=>{if(!Pt)throw new Error("please add custom event after start recording");ee({type:_.Custom,data:{tag:e,payload:t}})};Pe.freezePage=()=>{Le.forEach(e=>e.freeze())};Pe.takeFullSnapshot=e=>{if(!Pt)throw new Error("please take full snapshot after start recording");Rt(e)};Pe.mirror=we;function ju(e){return{all:e=e||new Map,on:function(t,r){var i=e.get(t);i?i.push(r):e.set(t,[r])},off:function(t,r){var i=e.get(t);i&&(r?i.splice(i.indexOf(r)>>>0,1):e.set(t,[]))},emit:function(t,r){var i=e.get(t);i&&i.slice().map(function(s){s(r)}),(i=e.get("*"))&&i.slice().map(function(s){s(t,r)})}}}function Gu(e=window,t=document){if("scrollBehavior"in t.documentElement.style&&e.__forceSmoothScrollPolyfill__!==!0)return;const r=e.HTMLElement||e.Element,i=468,s={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:r.prototype.scroll||l,scrollIntoView:r.prototype.scrollIntoView},a=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now;function o(b){const y=["MSIE ","Trident/","Edge/"];return new RegExp(y.join("|")).test(b)}const u=o(e.navigator.userAgent)?1:0;function l(b,y){this.scrollLeft=b,this.scrollTop=y}function c(b){return .5*(1-Math.cos(Math.PI*b))}function n(b){if(b===null||typeof b!="object"||b.behavior===void 0||b.behavior==="auto"||b.behavior==="instant")return!0;if(typeof b=="object"&&b.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+b.behavior+" is not a valid value for enumeration ScrollBehavior.")}function d(b,y){if(y==="Y")return b.clientHeight+u<b.scrollHeight;if(y==="X")return b.clientWidth+u<b.scrollWidth}function h(b,y){const w=e.getComputedStyle(b,null)["overflow"+y];return w==="auto"||w==="scroll"}function f(b){const y=d(b,"Y")&&h(b,"Y"),w=d(b,"X")&&h(b,"X");return y||w}function m(b){for(;b!==t.body&&f(b)===!1;)b=b.parentNode||b.host;return b}function p(b){const y=a();let w,C,v,S=(y-b.startTime)/i;S=S>1?1:S,w=c(S),C=b.startX+(b.x-b.startX)*w,v=b.startY+(b.y-b.startY)*w,b.method.call(b.scrollable,C,v),(C!==b.x||v!==b.y)&&e.requestAnimationFrame(p.bind(e,b))}function g(b,y,w){let C,v,S,E;const R=a();b===t.body?(C=e,v=e.scrollX||e.pageXOffset,S=e.scrollY||e.pageYOffset,E=s.scroll):(C=b,v=b.scrollLeft,S=b.scrollTop,E=l),p({scrollable:C,method:E,startTime:R,startX:v,startY:S,x:y,y:w})}e.scroll=e.scrollTo=function(){if(arguments[0]!==void 0){if(n(arguments[0])===!0){s.scroll.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:e.scrollY||e.pageYOffset);return}g.call(e,t.body,arguments[0].left!==void 0?~~arguments[0].left:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:e.scrollY||e.pageYOffset)}},e.scrollBy=function(){if(arguments[0]!==void 0){if(n(arguments[0])){s.scrollBy.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:0,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:0);return}g.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset))}},r.prototype.scroll=r.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(n(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");s.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}const b=arguments[0].left,y=arguments[0].top;g.call(this,this,typeof b=="undefined"?this.scrollLeft:~~b,typeof y=="undefined"?this.scrollTop:~~y)},r.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(n(arguments[0])===!0){s.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},r.prototype.scrollIntoView=function(){if(n(arguments[0])===!0){s.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}const b=m(this),y=b.getBoundingClientRect(),w=this.getBoundingClientRect();b!==t.body?(g.call(this,b,b.scrollLeft+w.left-y.left,b.scrollTop+w.top-y.top),e.getComputedStyle(b).position!=="fixed"&&e.scrollBy({left:y.left,top:y.top,behavior:"smooth"})):e.scrollBy({left:w.left,top:w.top,behavior:"smooth"})}}class Hu{constructor(t=[],r){M(this,"timeOffset",0),M(this,"speed"),M(this,"actions"),M(this,"raf",null),M(this,"lastTimestamp"),this.actions=t,this.speed=r.speed}addAction(t){const r=this.raf===!0;if(!this.actions.length||this.actions[this.actions.length-1].delay<=t.delay)this.actions.push(t);else{const i=this.findActionIndex(t);this.actions.splice(i,0,t)}r&&(this.raf=requestAnimationFrame(this.rafCheck.bind(this)))}start(){this.timeOffset=0,this.lastTimestamp=performance.now(),this.raf=requestAnimationFrame(this.rafCheck.bind(this))}updateLiveTime(){this.raf===!0&&this.rafCheck()}rafCheck(){const t=performance.now();for(this.timeOffset+=(t-this.lastTimestamp)*this.speed,this.lastTimestamp=t;this.actions.length;){const r=this.actions[0];if(this.timeOffset>=r.delay)this.actions.shift(),r.doAction();else break}this.actions.length>0?this.raf=requestAnimationFrame(this.rafCheck.bind(this)):this.raf=!0}clear(){this.raf&&(this.raf!==!0&&cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(t){this.speed=t}isActive(){return this.raf!==null}findActionIndex(t){let r=0,i=this.actions.length-1;for(;r<=i;){const s=Math.floor((r+i)/2);if(this.actions[s].delay<t.delay)r=s+1;else if(this.actions[s].delay>t.delay)i=s-1;else return s+1}return r}}function Cn(e,t){if(e.type===_.IncrementalSnapshot&&e.data.source===T.MouseMove&&e.data.positions&&e.data.positions.length){const r=e.data.positions[0].timeOffset,i=e.timestamp+r;return e.delay=i-t,i-t}return e.delay=e.timestamp-t,e.delay}/*! *****************************************************************************
|
|
143
|
+
Copyright (c) Microsoft Corporation.
|
|
144
|
+
|
|
145
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
146
|
+
purpose with or without fee is hereby granted.
|
|
147
|
+
|
|
148
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
149
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
150
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
151
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
152
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
153
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
154
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
155
|
+
***************************************************************************** */function En(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var i,s,a=r.call(e),o=[];try{for(;(t===void 0||t-- >0)&&!(i=a.next()).done;)o.push(i.value)}catch(u){s={error:u}}finally{try{i&&!i.done&&(r=a.return)&&r.call(a)}finally{if(s)throw s.error}}return o}var Je;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Je||(Je={}));var Oo={type:"xstate.init"};function rs(e){return e===void 0?[]:[].concat(e)}function je(e){return{type:"xstate.assign",assignment:e}}function xn(e,t){return typeof(e=typeof e=="string"&&t&&t[e]?t[e]:e)=="string"?{type:e}:typeof e=="function"?{type:e.name,exec:e}:e}function Lt(e){return function(t){return e===t}}function Io(e){return typeof e=="string"?{type:e}:e}function Rn(e,t){return{value:e,context:t,actions:[],changed:!1,matches:Lt(e)}}function Mn(e,t,r){var i=t,s=!1;return[e.filter(function(a){if(a.type==="xstate.assign"){s=!0;var o=Object.assign({},i);return typeof a.assignment=="function"?o=a.assignment(i,r):Object.keys(a.assignment).forEach(function(u){o[u]=typeof a.assignment[u]=="function"?a.assignment[u](i,r):a.assignment[u]}),i=o,!1}return!0}),i,s]}function Do(e,t){t===void 0&&(t={});var r=En(Mn(rs(e.states[e.initial].entry).map(function(o){return xn(o,t.actions)}),e.context,Oo),2),i=r[0],s=r[1],a={config:e,_options:t,initialState:{value:e.initial,actions:i,context:s,matches:Lt(e.initial)},transition:function(o,u){var l,c,n=typeof o=="string"?{value:o,context:e.context}:o,d=n.value,h=n.context,f=Io(u),m=e.states[d];if(m.on){var p=rs(m.on[f.type]);try{for(var g=function(D){var H=typeof Symbol=="function"&&Symbol.iterator,te=H&&D[H],J=0;if(te)return te.call(D);if(D&&typeof D.length=="number")return{next:function(){return D&&J>=D.length&&(D=void 0),{value:D&&D[J++],done:!D}}};throw new TypeError(H?"Object is not iterable.":"Symbol.iterator is not defined.")}(p),b=g.next();!b.done;b=g.next()){var y=b.value;if(y===void 0)return Rn(d,h);var w=typeof y=="string"?{target:y}:y,C=w.target,v=w.actions,S=v===void 0?[]:v,E=w.cond,R=E===void 0?function(){return!0}:E,I=C===void 0,N=C!=null?C:d,L=e.states[N];if(R(h,f)){var k=En(Mn((I?rs(S):[].concat(m.exit,S,L.entry).filter(function(D){return D})).map(function(D){return xn(D,a._options.actions)}),h,f),3),x=k[0],ae=k[1],le=k[2],q=C!=null?C:d;return{value:q,context:ae,actions:x,changed:C!==d||x.length>0||le,matches:Lt(q)}}}}catch(D){l={error:D}}finally{try{b&&!b.done&&(c=g.return)&&c.call(g)}finally{if(l)throw l.error}}}return Rn(d,h)}};return a}var Nn=function(e,t){return e.actions.forEach(function(r){var i=r.exec;return i&&i(e.context,t)})};function Ao(e){var t=e.initialState,r=Je.NotStarted,i=new Set,s={_machine:e,send:function(a){r===Je.Running&&(t=e.transition(t,a),Nn(t,Io(a)),i.forEach(function(o){return o(t)}))},subscribe:function(a){return i.add(a),a(t),{unsubscribe:function(){return i.delete(a)}}},start:function(a){if(a){var o=typeof a=="object"?a:{context:e.config.context,value:a};t={value:o.value,actions:[],context:o.context,matches:Lt(o.value)}}return r=Je.Running,Nn(t,Oo),s},stop:function(){return r=Je.Stopped,i.clear(),s},get state(){return t},get status(){return r}};return s}function Yu(e,t){let r=!1;for(let i=e.length-1;i>=0;i--){const s=e[i];if(s.type===_.FullSnapshot&&(r=!0),s.type===_.Meta&&r&&s.timestamp<=t)return e.slice(i)}return e}function Xu(e,{getCastFn:t,applyEventsSynchronously:r,emitter:i}){const s=Do({id:"player",context:e,initial:"paused",states:{playing:{on:{PAUSE:{target:"paused",actions:["pause"]},CAST_EVENT:{target:"playing",actions:"castEvent"},END:{target:"paused",actions:["resetLastPlayedEvent","pause"]},ADD_EVENT:{target:"playing",actions:["addEvent"]}}},paused:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"},TO_LIVE:{target:"live",actions:["startLive"]},ADD_EVENT:{target:"paused",actions:["addEvent"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:je({lastPlayedEvent:(a,o)=>o.type==="CAST_EVENT"?o.payload.event:a.lastPlayedEvent}),recordTimeOffset:je((a,o)=>{let u=a.timeOffset;return"payload"in o&&"timeOffset"in o.payload&&(u=o.payload.timeOffset),re(P({},a),{timeOffset:u,baselineTime:a.events[0].timestamp+u})}),play(a){var o;const{timer:u,events:l,baselineTime:c,lastPlayedEvent:n}=a;u.clear();for(const p of l)Cn(p,c);const d=Yu(l,c);let h=n==null?void 0:n.timestamp;(n==null?void 0:n.type)===_.IncrementalSnapshot&&n.data.source===T.MouseMove&&(h=n.timestamp+((o=n.data.positions[0])==null?void 0:o.timeOffset)),c<(h||0)&&i.emit(z.PlayBack);const f=new Array;let m=!1;for(const p of d){const g=p.type===_.FullSnapshot;if(h&&h<c&&(p.timestamp<=h||p===n)){g&&(m=!0);continue}if(p.timestamp<=c||g&&!m)g&&(m=!0),f.push(p);else{const b=t(p,!1);u.addAction({doAction:()=>{b()},delay:p.delay})}}r(f),i.emit(z.Flush),u.start()},pause(a){a.timer.clear()},resetLastPlayedEvent:je(a=>re(P({},a),{lastPlayedEvent:null})),startLive:je({baselineTime:(a,o)=>(a.timer.start(),o.type==="TO_LIVE"&&o.payload.baselineTime?o.payload.baselineTime:Date.now())}),addEvent:je((a,o)=>{const{baselineTime:u,timer:l,events:c}=a;if(o.type==="ADD_EVENT"){const{event:n}=o.payload;Cn(n,u);let d=c.length-1;if(!c[d]||c[d].timestamp<=n.timestamp)c.push(n);else{let m=-1,p=0;for(;p<=d;){const g=Math.floor((p+d)/2);c[g].timestamp<=n.timestamp?p=g+1:d=g-1}m===-1&&(m=p),c.splice(m,0,n)}const h=n.timestamp<u,f=t(n,h);h?f():l.isActive()&&l.addAction({doAction:()=>{f()},delay:n.delay})}return re(P({},a),{events:c})})}});return Ao(s)}function Ju(e){const t=Do({id:"speed",context:e,initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:(r,i)=>{"payload"in i&&r.timer.setSpeed(i.payload.speed)},recordSpeed:je({normalSpeed:r=>r.timer.speed}),restoreSpeed:r=>{r.timer.setSpeed(r.normalSpeed)}}});return Ao(t)}const Qu=e=>[`.${e} { background: currentColor }`,"noscript { display: none !important; }"],On=new Map;function To(e,t){let r=On.get(e);return r||(r=new Map,On.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}function ke(e,t,r){return async i=>{if(i&&typeof i=="object"&&"rr_type"in i)if(r&&(r.isUnchanged=!1),i.rr_type==="ImageBitmap"&&"args"in i){const s=await ke(e,t,r)(i.args);return await createImageBitmap.apply(null,s)}else if("index"in i){if(r||t===null)return i;const{rr_type:s,index:a}=i;return To(t,s)[a]}else if("args"in i){const{rr_type:s,args:a}=i,o=window[s];return new o(...await Promise.all(a.map(ke(e,t,r))))}else{if("base64"in i)return Lu(i.base64);if("src"in i){const s=e.get(i.src);if(s)return s;{const a=new Image;return a.src=i.src,e.set(i.src,a),a}}else if("data"in i&&i.rr_type==="Blob"){const s=await Promise.all(i.data.map(ke(e,t,r)));return new Blob(s,{type:i.type})}}else if(Array.isArray(i))return await Promise.all(i.map(ke(e,t,r)));return i}}function Zu(e,t){try{return t===Ie.WebGL?e.getContext("webgl")||e.getContext("experimental-webgl"):e.getContext("webgl2")}catch(r){return null}}const Ku=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function ec(e,t){if(!(t!=null&&t.constructor))return;const{name:r}=t.constructor;if(!Ku.includes(r))return;const i=To(e,r);i.includes(t)||i.push(t)}async function tc({mutation:e,target:t,type:r,imageMap:i,errorHandler:s}){try{const a=Zu(t,r);if(!a)return;if(e.setter){a[e.property]=e.args[0];return}const o=a[e.property],u=await Promise.all(e.args.map(ke(i,a))),l=o.apply(a,u);ec(a,l);const c=!1}catch(a){s(e,a)}}async function rc({event:e,mutations:t,target:r,imageMap:i,errorHandler:s}){const a=r.getContext("2d");if(!a){s(t[0],new Error("Canvas context is null"));return}const o=t.map(async l=>Promise.all(l.args.map(ke(i,a))));(await Promise.all(o)).forEach((l,c)=>{const n=t[c];try{if(n.setter){a[n.property]=n.args[0];return}const d=a[n.property];n.property==="drawImage"&&typeof n.args[0]=="string"?(i.get(e),d.apply(a,n.args)):d.apply(a,l)}catch(d){s(n,d)}})}async function us({event:e,mutation:t,target:r,imageMap:i,canvasEventMap:s,errorHandler:a}){try{const o=s.get(e)||t,u="commands"in o?o.commands:[o];if([Ie.WebGL,Ie.WebGL2].includes(t.type)){for(let l=0;l<u.length;l++){const c=u[l];await tc({mutation:c,type:t.type,target:r,imageMap:i,errorHandler:a})}return}await rc({event:e,mutations:u,target:r,imageMap:i,errorHandler:a})}catch(o){a(t,o)}}class sc{constructor(t){M(this,"mediaMap",new Map),M(this,"warn"),M(this,"service"),M(this,"speedService"),M(this,"emitter"),M(this,"getCurrentTime"),M(this,"metadataCallbackMap",new Map),this.warn=t.warn,this.service=t.service,this.speedService=t.speedService,this.emitter=t.emitter,this.getCurrentTime=t.getCurrentTime,this.emitter.on(z.Start,this.start.bind(this)),this.emitter.on(z.SkipStart,this.start.bind(this)),this.emitter.on(z.Pause,this.pause.bind(this)),this.emitter.on(z.Finish,this.pause.bind(this)),this.speedService.subscribe(()=>{this.syncAllMediaElements()})}syncAllMediaElements(t={pause:!1}){this.mediaMap.forEach((r,i)=>{this.syncTargetWithState(i),t.pause&&i.pause()})}start(){this.syncAllMediaElements()}pause(){this.syncAllMediaElements({pause:!0})}seekTo({time:t,target:r,mediaState:i}){if(i.isPlaying){const a=(t-i.lastInteractionTimeOffset)/1e3*i.playbackRate,o="duration"in r&&r.duration;if(Number.isNaN(o)){this.waitForMetadata(r);return}let u=i.currentTimeAtLastInteraction+a;r.loop&&o!==!1&&(u=u%o),r.currentTime=u}else r.pause(),r.currentTime=i.currentTimeAtLastInteraction}waitForMetadata(t){if(this.metadataCallbackMap.has(t)||!("addEventListener"in t))return;const r=()=>{this.metadataCallbackMap.delete(t);const i=this.mediaMap.get(t);i&&this.seekTo({time:this.getCurrentTime(),target:t,mediaState:i})};this.metadataCallbackMap.set(t,r),t.addEventListener("loadedmetadata",r,{once:!0})}getMediaStateFromMutation({target:t,timeOffset:r,mutation:i}){var f,m,p,g,b;const s=this.mediaMap.get(t),{type:a,playbackRate:o,currentTime:u,muted:l,volume:c,loop:n}=i;return{isPlaying:a===Te.Play||a!==Te.Pause&&((s==null?void 0:s.isPlaying)||t.getAttribute("autoplay")!==null),currentTimeAtLastInteraction:(f=u!=null?u:s==null?void 0:s.currentTimeAtLastInteraction)!=null?f:0,lastInteractionTimeOffset:r,playbackRate:(m=o!=null?o:s==null?void 0:s.playbackRate)!=null?m:1,volume:(p=c!=null?c:s==null?void 0:s.volume)!=null?p:1,muted:(g=l!=null?l:s==null?void 0:s.muted)!=null?g:t.getAttribute("muted")===null,loop:(b=n!=null?n:s==null?void 0:s.loop)!=null?b:t.getAttribute("loop")===null}}syncTargetWithState(t){const r=this.mediaMap.get(t);if(!r)return;const{muted:i,loop:s,volume:a,isPlaying:o}=r,u=this.service.state.matches("paused"),l=r.playbackRate*this.speedService.state.context.timer.speed;try{this.seekTo({time:this.getCurrentTime(),target:t,mediaState:r}),t.volume!==a&&(t.volume=a),t.muted=i,t.loop=s,t.playbackRate!==l&&(t.playbackRate=l),o&&!u?t.play():t.pause()}catch(c){this.warn(`Failed to replay media interactions: ${c.message||c}`)}}addMediaElements(t,r,i){if(!["AUDIO","VIDEO"].includes(t.nodeName))return;const s=t,a=i.getMeta(s);if(!a||!("attributes"in a))return;const o=this.service.state.matches("paused"),u=a.attributes;let l=!1;u.rr_mediaState?l=u.rr_mediaState==="played":l=s.getAttribute("autoplay")!==null,l&&o&&s.pause();let c=1;typeof u.rr_mediaPlaybackRate=="number"&&(c=u.rr_mediaPlaybackRate);let n=!1;typeof u.rr_mediaMuted=="boolean"?n=u.rr_mediaMuted:n=s.getAttribute("muted")!==null;let d=!1;typeof u.rr_mediaLoop=="boolean"?d=u.rr_mediaLoop:d=s.getAttribute("loop")!==null;let h=1;typeof u.rr_mediaVolume=="number"&&(h=u.rr_mediaVolume);let f=0;typeof u.rr_mediaCurrentTime=="number"&&(f=u.rr_mediaCurrentTime),this.mediaMap.set(s,{isPlaying:l,currentTimeAtLastInteraction:f,lastInteractionTimeOffset:r,playbackRate:c,volume:h,muted:n,loop:d}),this.syncTargetWithState(s)}mediaMutation({target:t,timeOffset:r,mutation:i}){this.mediaMap.set(t,this.getMediaStateFromMutation({target:t,timeOffset:r,mutation:i})),this.syncTargetWithState(t)}isSupportedMediaElement(t){return["AUDIO","VIDEO"].includes(t.nodeName)}reset(){this.mediaMap.clear()}}function Ct(e,t){if(e.nodeName!=="DIALOG"||e instanceof Se)return;const r=e,i=r.open,s=i&&r.matches("dialog:modal"),a=r.getAttribute("rr_open_mode"),o=typeof(t==null?void 0:t.attributes.open)=="string"||typeof r.getAttribute("open")=="string",u=a==="modal";if(!(i&&!(s&&a==="non-modal"||!s&&u))){if(!r.isConnected){console.warn("dialog is not attached to the dom",r);return}i&&r.close(),o&&(u?r.showModal():r.show())}}function ic(e,t){if(e.nodeName!=="DIALOG"||e instanceof Se)return;const r=e;if(!r.isConnected){console.warn("dialog is not attached to the dom",r);return}t.attributes.open===null&&(r.removeAttribute("open"),r.removeAttribute("rr_open_mode"))}const nc=5*1e3,oc=ju,In="[replayer]",ss={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function Dn(e){return e.type==_.IncrementalSnapshot&&e.data.source==T.MouseInteraction&&e.data.type==V.TouchStart}class ac{constructor(t,r){if(M(this,"wrapper"),M(this,"iframe"),M(this,"UNSAFE_replayCanvas",!1),M(this,"service"),M(this,"speedService"),M(this,"config"),M(this,"usingVirtualDom",!1),M(this,"virtualDom",new et),M(this,"mouse"),M(this,"mouseTail",null),M(this,"tailPositions",[]),M(this,"mouseTailFrame",null),M(this,"emitter",oc()),M(this,"nextUserInteractionEvent"),M(this,"legacy_missingNodeRetryMap",{}),M(this,"cache",Ti()),M(this,"imageMap",new Map),M(this,"canvasEventMap",new Map),M(this,"mirror",Pn()),M(this,"styleMirror",new zs),M(this,"mediaManager"),M(this,"firstFullSnapshot",null),M(this,"newDocumentQueue",[]),M(this,"mousePos",null),M(this,"touchActive",null),M(this,"lastMouseDownEvent",null),M(this,"lastHoveredRootNode"),M(this,"lastSelectionData",null),M(this,"constructedStyleMutations",[]),M(this,"adoptedStyleSheets",[]),M(this,"handleResize",u=>{this.iframe.style.display="inherit";for(const l of[this.mouseTail,this.iframe])l&&(l.setAttribute("width",String(u.width)),l.setAttribute("height",String(u.height)))}),M(this,"applyEventsSynchronously",u=>{for(const l of u){switch(l.type){case _.DomContentLoaded:case _.Load:continue;case _.FullSnapshot:case _.Meta:case _.Plugin:case _.IncrementalSnapshot:break}this.getCastFn(l,!0)()}}),M(this,"getCastFn",(u,l=!1)=>{let c;switch(u.type){case _.DomContentLoaded:case _.Load:break;case _.Custom:c=()=>{this.emitter.emit(z.CustomEvent,u)};break;case _.Meta:c=()=>this.emitter.emit(z.Resize,{width:u.data.width,height:u.data.height});break;case _.FullSnapshot:c=()=>{var d;if(this.firstFullSnapshot){if(this.firstFullSnapshot===u){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.mediaManager.reset(),this.styleMirror.reset(),this.rebuildFullSnapshot(u,l),(d=this.iframe.contentWindow)==null||d.scrollTo(u.data.initialOffset)};break;case _.IncrementalSnapshot:c=()=>{if(this.applyIncremental(u,l),!l&&(u===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(const d of this.service.state.context.events)if(!(d.timestamp<=u.timestamp)&&this.isUserInteraction(d)){d.delay-u.delay>this.config.inactivePeriodThreshold*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=d);break}if(this.nextUserInteractionEvent){const d=this.nextUserInteractionEvent.delay-u.delay,h={speed:Math.min(Math.round(d/nc),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:h}),this.emitter.emit(z.SkipStart,h)}}};break}return()=>{c&&c();for(const h of this.config.plugins||[])h.handler&&h.handler(u,l,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:u}});const d=this.service.state.context.events.length-1;if(!this.config.liveMode&&u===this.service.state.context.events[d]){const h=()=>{d<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(z.Finish))};let f=50;u.type===_.IncrementalSnapshot&&u.data.source===T.MouseMove&&u.data.positions.length&&(f+=Math.max(0,-u.data.positions[0].timeOffset)),setTimeout(h,f)}this.emitter.emit(z.EventCast,u)}}),M(this,"stepMouseTail",u=>{var l;this.mouseTailFrame=null;const c=(l=this.mouseTail)==null?void 0:l.getContext("2d");if(!this.mouseTail||!c)return;const{lineCap:n,lineWidth:d,strokeStyle:h,duration:f}=this.config.mouseTail===!0?ss:Object.assign({},ss,this.config.mouseTail),m=f/this.speedService.state.context.timer.speed;if(this.tailPositions=this.tailPositions.filter(p=>u-p.t<=m),c.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),this.tailPositions.length<2){this.tailPositions.length&&(this.mouseTailFrame=requestAnimationFrame(this.stepMouseTail));return}c.lineWidth=d,c.lineCap=n,c.strokeStyle=h;for(let p=1;p<this.tailPositions.length;p++){const g=this.tailPositions[p-1],b=this.tailPositions[p];c.globalAlpha=Math.max(0,1-(u-b.t)/m),c.beginPath(),c.moveTo(g.x,g.y),c.lineTo(b.x,b.y),c.stroke()}c.globalAlpha=1,this.mouseTailFrame=requestAnimationFrame(this.stepMouseTail)}),!(r!=null&&r.liveMode)&&t.length<2)throw new Error("Replayer need at least 2 events.");const i={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,inactivePeriodThreshold:10*1e3,showWarning:!0,showDebug:!1,blockClass:"rr-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:ss,useVirtualDom:!0,logger:console};this.config=Object.assign({},i,r),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(z.Resize,this.handleResize),this.setupDom();for(const u of this.config.plugins||[])u.getMirror&&u.getMirror({nodeMirror:this.mirror});this.emitter.on(z.Flush,()=>{if(this.usingVirtualDom){const u={mirror:this.mirror,applyCanvas:(l,c,n)=>{us({event:l,mutation:c,target:n,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this),applyStyleSheetMutation:(l,c)=>{l.source===T.StyleSheetRule?this.applyStyleSheetRule(l,c):l.source===T.StyleDeclaration&&this.applyStyleDeclaration(l,c)},afterAppend:(l,c)=>{for(const n of this.config.plugins||[])n.onBuild&&n.onBuild(l,{id:c,replayer:this})}};if(this.iframe.contentDocument)try{At(this.iframe.contentDocument,this.virtualDom,u,this.virtualDom.mirror)}catch(l){this.warn(l)}if(this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const l in this.legacy_missingNodeRetryMap)try{const c=this.legacy_missingNodeRetryMap[l],n=Tt(c.node,this.mirror,this.virtualDom.mirror);At(n,c.node,u,this.virtualDom.mirror),c.node=n}catch(c){this.warn(c)}this.constructedStyleMutations.forEach(l=>{this.applyStyleSheetMutation(l)}),this.constructedStyleMutations=[],this.adoptedStyleSheets.forEach(l=>{this.applyAdoptedStyleSheet(l)}),this.adoptedStyleSheets=[]}if(this.mousePos&&(this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null),this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null,this.lastMouseDownEvent){const[u,l]=this.lastMouseDownEvent;u.dispatchEvent(l)}this.lastMouseDownEvent=null,this.lastSelectionData&&(this.applySelection(this.lastSelectionData),this.lastSelectionData=null)}),this.emitter.on(z.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset()});const s=new Hu([],{speed:this.config.speed});this.service=Xu({events:t.map(u=>r&&r.unpackFn?r.unpackFn(u):u).sort((u,l)=>u.timestamp-l.timestamp),timer:s,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(u=>{this.emitter.emit(z.StateChange,{player:u})}),this.speedService=Ju({normalSpeed:-1,timer:s}),this.speedService.start(),this.speedService.subscribe(u=>{this.emitter.emit(z.StateChange,{speed:u})}),this.mediaManager=new sc({warn:this.warn.bind(this),service:this.service,speedService:this.speedService,emitter:this.emitter,getCurrentTime:this.getCurrentTime.bind(this)});const a=this.service.state.context.events.find(u=>u.type===_.Meta),o=this.service.state.context.events.find(u=>u.type===_.FullSnapshot);if(a){const{width:u,height:l}=a.data;setTimeout(()=>{this.emitter.emit(z.Resize,{width:u,height:l})},0)}o&&setTimeout(()=>{var u;this.firstFullSnapshot||(this.firstFullSnapshot=o,this.rebuildFullSnapshot(o),(u=this.iframe.contentWindow)==null||u.scrollTo(o.data.initialOffset))},1),this.service.state.context.events.find(Dn)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(t,r){return this.emitter.on(t,r),this}off(t,r){return this.emitter.off(t,r),this}setConfig(t){Object.keys(t).forEach(r=>{t[r],this.config[r]=t[r]}),this.config.skipInactive||this.backToNormal(),typeof t.speed!="undefined"&&this.speedService.send({type:"SET_SPEED",payload:{speed:t.speed}}),typeof t.mouseTail!="undefined"&&(t.mouseTail===!1?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))}getMetaData(){const t=this.service.state.context.events[0],r=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:t.timestamp,endTime:r.timestamp,totalTime:r.timestamp-t.timestamp}}getCurrentTime(){return this.config.liveMode&&this.timer.updateLiveTime(),this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){const{baselineTime:t,events:r}=this.service.state.context;return t-r[0].timestamp}getMirror(){return this.mirror}play(t=0){var r,i;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:t}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:t}})),(i=(r=this.iframe.contentDocument)==null?void 0:r.getElementsByTagName("html")[0])==null||i.classList.remove("rrweb-paused"),this.emitter.emit(z.Start)}pause(t){var r,i;t===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof t=="number"&&(this.play(t),this.service.send({type:"PAUSE"})),(i=(r=this.iframe.contentDocument)==null?void 0:r.getElementsByTagName("html")[0])==null||i.classList.add("rrweb-paused"),this.emitter.emit(z.Pause)}resume(t=0){this.warn("The 'resume' was deprecated in 1.0. Please use 'play' method which has the same interface."),this.play(t),this.emitter.emit(z.Resume)}destroy(){this.pause(),this.mouseTailFrame!==null&&(cancelAnimationFrame(this.mouseTailFrame),this.mouseTailFrame=null),this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset(),this.config.root.removeChild(this.wrapper),this.emitter.emit(z.Destroy)}startLive(t){this.service.send({type:"TO_LIVE",payload:{baselineTime:t}})}addEvent(t){const r=this.config.unpackFn?this.config.unpackFn(t):t;Dn(r)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:r}}))}enableInteract(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"}disableInteract(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"}resetCache(){this.cache=Ti()}setupDom(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),this.config.mouseTail!==!1&&(this.mouseTail=document.createElement("canvas"),this.mouseTail.classList.add("replayer-mouse-tail"),this.mouseTail.style.display="inherit",this.wrapper.appendChild(this.mouseTail)),this.config.UNSAFE_replayCanvas?(this.iframe=document.createElement("iframe"),this.iframe.setAttribute("sandbox","allow-same-origin allow-scripts"),this.wrapper.appendChild(this.iframe),this.UNSAFE_replayCanvas=!0):(this.iframe=al({root:this.wrapper}),this.UNSAFE_replayCanvas=!1),this.iframe.style.display="none",this.disableInteract(),this.iframe.contentWindow&&this.iframe.contentDocument&&(Gu(this.iframe.contentWindow,this.iframe.contentDocument),Us(this.iframe.contentWindow))}rebuildFullSnapshot(t,r=!1){if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&this.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};const i=[],s=new Set,a=(l,c)=>{if(l.nodeName==="DIALOG"&&s.add(l),this.collectIframeAndAttachDocument(i,l),this.mediaManager.isSupportedMediaElement(l)){const{events:n}=this.service.state.context;this.mediaManager.addMediaElements(l,t.timestamp-n[0].timestamp,this.mirror)}for(const n of this.config.plugins||[])n.onBuild&&n.onBuild(l,{id:c,replayer:this})};this.usingVirtualDom&&(this.virtualDom.destroyTree(),this.usingVirtualDom=!1),this.mirror.reset(),ol(t.data.node,{doc:this.iframe.contentDocument,afterAppend:a,cache:this.cache,mirror:this.mirror,UNSAFE_allowUnprotectedRebuild:this.UNSAFE_replayCanvas}),a(this.iframe.contentDocument,t.data.node.id);for(const{mutationInQueue:l,builtNode:c}of i)this.attachDocumentToIframe(l,c),this.newDocumentQueue=this.newDocumentQueue.filter(n=>n!==l);const{documentElement:o,head:u}=this.iframe.contentDocument;this.insertStyleRules(o,u),s.forEach(l=>Ct(l)),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(z.FullsnapshotRebuilded,t),r||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(t,r){var i;const s=Qu(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&s.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),!!s.length)if(this.usingVirtualDom){const a=this.virtualDom.createElement("style");this.virtualDom.mirror.add(a,co(a,this.virtualDom.unserializedId)),t.insertBefore(a,r),a.rules.push({source:T.StyleSheetRule,adds:s.map((o,u)=>({rule:o,index:u}))})}else{const a=document.createElement("style");t.insertBefore(a,r);for(let o=0;o<s.length;o++)(i=a.sheet)==null||i.insertRule(s[o],o)}}attachDocumentToIframe(t,r){const i=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,s=[],a=new Set,o=(u,l)=>{u.nodeName==="DIALOG"&&a.add(u),this.collectIframeAndAttachDocument(s,u);const c=i.getMeta(u);if((c==null?void 0:c.type)===Ne.Element&&(c==null?void 0:c.tagName.toUpperCase())==="HTML"){const{documentElement:n,head:d}=r.contentDocument;this.insertStyleRules(n,d)}if(!this.usingVirtualDom)for(const n of this.config.plugins||[])n.onBuild&&n.onBuild(u,{id:l,replayer:this})};nt(t.node,{doc:r.contentDocument,mirror:i,hackCss:!0,skipChild:!1,afterAppend:o,cache:this.cache}),o(r.contentDocument,t.node.id);for(const{mutationInQueue:u,builtNode:l}of s)this.attachDocumentToIframe(u,l),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==u);a.forEach(u=>Ct(u))}collectIframeAndAttachDocument(t,r){if(Qe(r,this.mirror)){const i=this.newDocumentQueue.find(s=>s.parentId===this.mirror.getId(r));i&&t.push({mutationInQueue:i,builtNode:r})}}waitForStylesheetLoad(){var t;const r=(t=this.iframe.contentDocument)==null?void 0:t.head;if(r){const i=new Set;let s,a=this.service.state;const o=()=>{a=this.service.state};this.emitter.on(z.Start,o),this.emitter.on(z.Pause,o);const u=()=>{this.emitter.off(z.Start,o),this.emitter.off(z.Pause,o)};r.querySelectorAll('link[rel="stylesheet"]').forEach(l=>{l.sheet||(i.add(l),l.addEventListener("load",()=>{i.delete(l),i.size===0&&s!==-1&&(a.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(z.LoadStylesheetEnd),s&&clearTimeout(s),u())}))}),i.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(z.LoadStylesheetStart),s=setTimeout(()=>{a.matches("playing")&&this.play(this.getCurrentTime()),s=-1,u()},this.config.loadTimeout))}}async preloadAllImages(){const t=[];for(const r of this.service.state.context.events)r.type===_.IncrementalSnapshot&&r.data.source===T.CanvasMutation&&(t.push(this.deserializeAndPreloadCanvasEvents(r.data,r)),("commands"in r.data?r.data.commands:[r.data]).forEach(s=>{this.preloadImages(s,r)}));return Promise.all(t)}preloadImages(t,r){if(t.property==="drawImage"&&typeof t.args[0]=="string"&&!this.imageMap.has(r)){const i=document.createElement("canvas"),s=i.getContext("2d"),a=s==null?void 0:s.createImageData(i.width,i.height);s==null||s.putImageData(a,0,0)}}async deserializeAndPreloadCanvasEvents(t,r){if(!this.canvasEventMap.has(r)){const i={isUnchanged:!0};if("commands"in t){const s=await Promise.all(t.commands.map(async a=>{const o=await Promise.all(a.args.map(ke(this.imageMap,null,i)));return re(P({},a),{args:o})}));i.isUnchanged===!1&&this.canvasEventMap.set(r,re(P({},t),{commands:s}))}else{const s=await Promise.all(t.args.map(ke(this.imageMap,null,i)));i.isUnchanged===!1&&this.canvasEventMap.set(r,re(P({},t),{args:s}))}}}applyIncremental(t,r){var i,s,a;const{data:o}=t;switch(o.source){case T.Mutation:{try{this.applyMutation(o,r)}catch(u){this.warn(`Exception in mutation ${u.message||u}`,o)}break}case T.Drag:case T.TouchMove:case T.MouseMove:if(r){const u=o.positions[o.positions.length-1];this.mousePos={x:u.x,y:u.y,id:u.id,debugData:o}}else o.positions.forEach(u=>{const l={doAction:()=>{this.moveAndHover(u.x,u.y,u.id,r,o)},delay:u.timeOffset+t.timestamp-this.service.state.context.baselineTime};this.timer.addAction(l)}),this.timer.addAction({doAction(){},delay:t.delay-((i=o.positions[0])==null?void 0:i.timeOffset)});break;case T.MouseInteraction:{if(o.id===-1)break;const u=new Event(Oe(V[o.type])),l=this.mirror.getNode(o.id);if(!l)return this.debugNodeNotFound(o,o.id);this.emitter.emit(z.MouseInteraction,{type:o.type,target:l});const{triggerFocus:c}=this.config;switch(o.type){case V.Blur:"blur"in l&&l.blur();break;case V.Focus:c&&l.focus&&l.focus({preventScroll:!0});break;case V.Click:case V.TouchStart:case V.TouchEnd:case V.MouseDown:case V.MouseUp:r?(o.type===V.TouchStart?this.touchActive=!0:o.type===V.TouchEnd&&(this.touchActive=!1),o.type===V.MouseDown?this.lastMouseDownEvent=[l,u]:o.type===V.MouseUp&&(this.lastMouseDownEvent=null),this.mousePos={x:o.x||0,y:o.y||0,id:o.id,debugData:o}):(o.type===V.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(o.x||0,o.y||0,o.id,r,o),o.type===V.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):o.type===V.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):o.type===V.TouchEnd?this.mouse.classList.remove("touch-active"):l.dispatchEvent(u));break;case V.TouchCancel:r?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:l.dispatchEvent(u)}break}case T.Scroll:{if(o.id===-1)break;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(o.id);if(!u)return this.debugNodeNotFound(o,o.id);u.scrollData=o;break}this.applyScroll(o,r);break}case T.ViewportResize:this.emitter.emit(z.Resize,{width:o.width,height:o.height});break;case T.Input:{if(o.id===-1)break;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(o.id);if(!u)return this.debugNodeNotFound(o,o.id);u.inputData=o;break}this.applyInput(o);break}case T.MediaInteraction:{const u=this.usingVirtualDom?this.virtualDom.mirror.getNode(o.id):this.mirror.getNode(o.id);if(!u)return this.debugNodeNotFound(o,o.id);const l=u,{events:c}=this.service.state.context;this.mediaManager.mediaMutation({target:l,timeOffset:t.timestamp-c[0].timestamp,mutation:o});break}case T.StyleSheetRule:case T.StyleDeclaration:{this.usingVirtualDom?o.styleId?this.constructedStyleMutations.push(o):o.id&&((s=this.virtualDom.mirror.getNode(o.id))==null||s.rules.push(o)):this.applyStyleSheetMutation(o);break}case T.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const u=this.virtualDom.mirror.getNode(o.id);if(!u)return this.debugNodeNotFound(o,o.id);u.canvasMutations.push({event:t,mutation:o})}else{const u=this.mirror.getNode(o.id);if(!u)return this.debugNodeNotFound(o,o.id);us({event:t,mutation:o,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case T.Font:{try{const u=new FontFace(o.family,o.buffer?new Uint8Array(JSON.parse(o.fontSource)):o.fontSource,o.descriptors);(a=this.iframe.contentDocument)==null||a.fonts.add(u)}catch(u){this.warn(u)}break}case T.Selection:{if(r){this.lastSelectionData=o;break}this.applySelection(o);break}case T.AdoptedStyleSheet:{this.usingVirtualDom?this.adoptedStyleSheets.push(o):this.applyAdoptedStyleSheet(o);break}}}applyMutation(t,r){if(this.config.useVirtualDom&&!this.usingVirtualDom&&r&&(this.usingVirtualDom=!0,Xl(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const c in this.legacy_missingNodeRetryMap)try{const n=this.legacy_missingNodeRetryMap[c],d=uo(n.node,this.virtualDom,this.mirror);d&&(n.node=d)}catch(n){this.warn(n)}const i=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;t.removes=t.removes.filter(c=>i.getNode(c.id)?!0:(this.warnNodeNotFound(t,c.id),!1)),t.removes.forEach(c=>{var n;const d=i.getNode(c.id);if(!d)return;let h=i.getNode(c.parentId);if(!h)return this.warnNodeNotFound(t,c.parentId);if(c.isShadow&&_e(h)&&(h=h.shadowRoot),i.removeNodeFromMap(d),h)try{h.removeChild(d),this.usingVirtualDom&&d.nodeName==="#text"&&h.nodeName==="STYLE"&&((n=h.rules)==null?void 0:n.length)>0&&(h.rules=[])}catch(f){if(f instanceof DOMException)this.warn("parent could not remove child in mutation",h,d,t);else throw f}});const s=P({},this.legacy_missingNodeRetryMap),a=[],o=c=>{let n=null;return c.nextId&&(n=i.getNode(c.nextId)),c.nextId!==null&&c.nextId!==void 0&&c.nextId!==-1&&!n},u=c=>{var n,d;if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");let h=i.getNode(c.parentId);if(!h)return c.node.type===Ne.Document?this.newDocumentQueue.push(c):a.push(c);c.node.isShadow&&(_e(h)||h.attachShadow({mode:"open"}),h=h.shadowRoot);let f=null,m=null;if(c.previousId&&(f=i.getNode(c.previousId)),c.nextId&&(m=i.getNode(c.nextId)),o(c))return a.push(c);if(c.node.rootId&&!i.getNode(c.node.rootId))return;const p=c.node.rootId?i.getNode(c.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(Qe(h,i)){this.attachDocumentToIframe(c,h);return}const g=(w,C)=>{if(!this.usingVirtualDom){Ct(w);for(const v of this.config.plugins||[])v.onBuild&&v.onBuild(w,{id:C,replayer:this})}},b=nt(c.node,{doc:p,mirror:i,skipChild:!0,hackCss:!0,cache:this.cache,afterAppend:g});if(c.previousId===-1||c.nextId===-1){s[c.node.id]={node:b,mutation:c};return}const y=i.getMeta(h);if(y&&y.type===Ne.Element&&c.node.type===Ne.Text){const w=Array.isArray(h.childNodes)?h.childNodes:Array.from(h.childNodes);if(y.tagName==="textarea")for(const C of w)C.nodeType===h.TEXT_NODE&&h.removeChild(C);else if(y.tagName==="style"&&w.length===1)for(const C of w)C.nodeType===h.TEXT_NODE&&!i.hasNode(C)&&(b.textContent=C.textContent,h.removeChild(C))}else if((y==null?void 0:y.type)===Ne.Document){const w=h;c.node.type===Ne.DocumentType&&((n=w.childNodes[0])==null?void 0:n.nodeType)===Node.DOCUMENT_TYPE_NODE&&w.removeChild(w.childNodes[0]),b.nodeName==="HTML"&&w.documentElement&&w.removeChild(w.documentElement)}if(f&&f.nextSibling&&f.nextSibling.parentNode?h.insertBefore(b,f.nextSibling):m&&m.parentNode?h.contains(m)?h.insertBefore(b,m):h.insertBefore(b,null):h.appendChild(b),g(b,c.node.id),this.usingVirtualDom&&b.nodeName==="#text"&&h.nodeName==="STYLE"&&((d=h.rules)==null?void 0:d.length)>0&&(h.rules=[]),Qe(b,this.mirror)){const w=this.mirror.getId(b),C=this.newDocumentQueue.find(v=>v.parentId===w);C&&(this.attachDocumentToIframe(C,b),this.newDocumentQueue=this.newDocumentQueue.filter(v=>v!==C))}(c.previousId||c.nextId)&&this.legacy_resolveMissingNode(s,h,b,c)};t.adds.forEach(c=>{u(c)});const l=Date.now();for(;a.length;){const c=go(a);if(a.length=0,Date.now()-l>500){this.warn("Timeout in the loop, please check the resolve tree data:",c);break}for(const n of c)i.getNode(n.value.parentId)?Bs(n,h=>{u(h)}):this.debug("Drop resolve tree since there is no parent for the root node.",n)}Object.keys(s).length&&Object.assign(this.legacy_missingNodeRetryMap,s),yo(t.texts).forEach(c=>{var n;const d=i.getNode(c.id);if(!d)return t.removes.find(f=>f.id===c.id)?void 0:this.warnNodeNotFound(t,c.id);const h=d.parentElement;if(c.value&&h&&h.tagName==="STYLE"?d.textContent=zt(c.value,this.cache):d.textContent=c.value,this.usingVirtualDom){const f=d.parentNode;((n=f==null?void 0:f.rules)==null?void 0:n.length)>0&&(f.rules=[])}}),t.attributes.forEach(c=>{var n;const d=i.getNode(c.id);if(!d)return t.removes.find(h=>h.id===c.id)?void 0:this.warnNodeNotFound(t,c.id);for(const h in c.attributes)if(typeof h=="string"){const f=c.attributes[h];if(f===null)d.removeAttribute(h),h==="open"&&ic(d,c);else if(typeof f=="string")try{if(h==="_cssText"&&(d.nodeName==="LINK"||d.nodeName==="STYLE"))try{const m=i.getMeta(d),p=nt(re(P({},m),{attributes:P(P({},m.attributes),c.attributes)}),{doc:d.ownerDocument,mirror:i,skipChild:!0,hackCss:!0,cache:this.cache});Object.assign(m.attributes,c.attributes);const g=d.nextSibling,b=d.parentNode;if(p&&b){b.removeChild(d),b.insertBefore(p,g),i.replace(c.id,p);break}}catch(m){}if(h==="value"&&d.nodeName==="TEXTAREA"){const m=d;m.childNodes.forEach(g=>m.removeChild(g));const p=(n=d.ownerDocument)==null?void 0:n.createTextNode(f);p&&m.appendChild(p)}else d.setAttribute(h,f);h==="rr_open_mode"&&d.nodeName==="DIALOG"&&Ct(d,c)}catch(m){this.warn("An error occurred may due to the checkout feature.",m)}else if(h==="style"){const m=f,p=d;for(const g in m)if(m[g]===!1)p.style.removeProperty(g);else if(m[g]instanceof Array){const b=m[g];p.style.setProperty(g,b[0],b[1])}else{const b=m[g];p.style.setProperty(g,b)}}}})}applyScroll(t,r){var i,s;const a=this.mirror.getNode(t.id);if(!a)return this.debugNodeNotFound(t,t.id);const o=this.mirror.getMeta(a);if(a===this.iframe.contentDocument)(i=this.iframe.contentWindow)==null||i.scrollTo({top:t.y,left:t.x,behavior:r?"auto":"smooth"});else if((o==null?void 0:o.type)===Ne.Document)(s=a.defaultView)==null||s.scrollTo({top:t.y,left:t.x,behavior:r?"auto":"smooth"});else try{a.scrollTo({top:t.y,left:t.x,behavior:r?"auto":"smooth"})}catch(u){}}applyInput(t){const r=this.mirror.getNode(t.id);if(!r)return this.debugNodeNotFound(t,t.id);try{r.checked=t.isChecked,r.value=t.text}catch(i){}}applySelection(t){try{const r=new Set,i=t.ranges.map(({start:s,startOffset:a,end:o,endOffset:u})=>{const l=this.mirror.getNode(s),c=this.mirror.getNode(o);if(!l||!c)return;const n=new Range;n.setStart(l,a),n.setEnd(c,u);const d=l.ownerDocument,h=d==null?void 0:d.getSelection();return h&&r.add(h),{range:n,selection:h}});r.forEach(s=>s.removeAllRanges()),i.forEach(s=>{var a;return s&&((a=s.selection)==null?void 0:a.addRange(s.range))})}catch(r){}}applyStyleSheetMutation(t){var r;let i=null;t.styleId?i=this.styleMirror.getStyle(t.styleId):t.id&&(i=((r=this.mirror.getNode(t.id))==null?void 0:r.sheet)||null),i&&(t.source===T.StyleSheetRule?this.applyStyleSheetRule(t,i):t.source===T.StyleDeclaration&&this.applyStyleDeclaration(t,i))}applyStyleSheetRule(t,r){var i,s,a,o;if((i=t.adds)==null||i.forEach(({rule:u,index:l})=>{try{if(Array.isArray(l)){const{positions:c,index:n}=as(l),d=Ye(r.cssRules,c);d==null||d.insertRule(u,n)}else{const c=l===void 0?void 0:Math.min(l,r.cssRules.length);r==null||r.insertRule(u,c)}}catch(c){}}),(s=t.removes)==null||s.forEach(({index:u})=>{try{if(Array.isArray(u)){const{positions:l,index:c}=as(u),n=Ye(r.cssRules,l);n==null||n.deleteRule(c||0)}else r==null||r.deleteRule(u)}catch(l){}}),typeof t.replace=="string")try{(a=r.replace)==null||a.call(r,t.replace)}catch(u){}if(typeof t.replaceSync=="string")try{(o=r.replaceSync)==null||o.call(r,t.replaceSync)}catch(u){}}applyStyleDeclaration(t,r){if(t.set){const i=Ye(r.rules,t.index);i!=null&&i.style&&i.style.setProperty(t.set.property,t.set.value,t.set.priority)}if(t.remove){const i=Ye(r.rules,t.index);i!=null&&i.style&&i.style.removeProperty(t.remove.property)}}applyAdoptedStyleSheet(t){var r;const i=this.mirror.getNode(t.id);if(!i)return;(r=t.styles)==null||r.forEach(u=>{var l;let c=null,n=null;if(_e(i)?n=((l=i.ownerDocument)==null?void 0:l.defaultView)||null:i.nodeName==="#document"&&(n=i.defaultView),!!n)try{c=new n.CSSStyleSheet,this.styleMirror.add(c,u.styleId),this.applyStyleSheetRule({source:T.StyleSheetRule,adds:u.rules},c)}catch(d){}});const s=10;let a=0;const o=(u,l)=>{const c=l.map(n=>this.styleMirror.getStyle(n)).filter(n=>n!==null);_e(u)?u.shadowRoot.adoptedStyleSheets=c:u.nodeName==="#document"&&(u.adoptedStyleSheets=c),c.length!==l.length&&a<s&&(setTimeout(()=>o(u,l),0+100*a),a++)};o(i,t.styleIds)}legacy_resolveMissingNode(t,r,i,s){const{previousId:a,nextId:o}=s,u=a&&t[a],l=o&&t[o];if(u){const{node:c,mutation:n}=u;r.insertBefore(c,i),delete t[n.node.id],delete this.legacy_missingNodeRetryMap[n.node.id],(n.previousId||n.nextId)&&this.legacy_resolveMissingNode(t,r,c,n)}if(l){const{node:c,mutation:n}=l;r.insertBefore(c,i.nextSibling),delete t[n.node.id],delete this.legacy_missingNodeRetryMap[n.node.id],(n.previousId||n.nextId)&&this.legacy_resolveMissingNode(t,r,c,n)}}moveAndHover(t,r,i,s,a){const o=this.mirror.getNode(i);if(!o)return this.debugNodeNotFound(a,i);const u=Ws(o,this.iframe),l=t*u.absoluteScale+u.x,c=r*u.absoluteScale+u.y;this.mouse.style.left=`${l}px`,this.mouse.style.top=`${c}px`,s||this.drawMouseTail({x:l,y:c}),this.hoverElements(o)}drawMouseTail(t){this.mouseTail&&(this.tailPositions.push(re(P({},t),{t:performance.now()})),this.mouseTailFrame===null&&(this.mouseTailFrame=requestAnimationFrame(this.stepMouseTail)))}hoverElements(t){var r;(r=this.lastHoveredRootNode||this.iframe.contentDocument)==null||r.querySelectorAll(".\\:hover").forEach(s=>{s.classList.remove(":hover")}),this.lastHoveredRootNode=t.getRootNode();let i=t;for(;i;)i.classList&&i.classList.add(":hover"),i=i.parentElement}isUserInteraction(t){return t.type!==_.IncrementalSnapshot?!1:t.data.source>T.Mutation&&t.data.source<=T.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(z.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(t,r){this.warn(`Node with id '${r}' not found. `,t)}warnCanvasMutationFailed(t,r){this.warn("Has error on canvas update",r,"canvas mutation:",t)}debugNodeNotFound(t,r){this.debug(`Node with id '${r}' not found. `,t)}warn(...t){this.config.showWarning&&this.config.logger.warn(In,...t)}debug(...t){this.config.showDebug&&this.config.logger.log(In,...t)}}const{addCustomEvent:lc}=Pe,{freezePage:uc}=Pe,{takeFullSnapshot:cc}=Pe;exports.EventType=_;exports.IncrementalSource=T;exports.MouseInteractions=V;exports.Replayer=ac;exports.ReplayerEvents=z;exports.addCustomEvent=lc;exports.canvasMutation=us;exports.freezePage=uc;exports.record=Pe;exports.takeFullSnapshot=cc;exports.utils=mu;
|
|
156
|
+
if (typeof module.exports == "object" && typeof exports == "object") {
|
|
157
|
+
var __cp = (to, from, except, desc) => {
|
|
158
|
+
if ((from && typeof from === "object") || typeof from === "function") {
|
|
159
|
+
for (let key of Object.getOwnPropertyNames(from)) {
|
|
160
|
+
if (!Object.prototype.hasOwnProperty.call(to, key) && key !== except)
|
|
161
|
+
Object.defineProperty(to, key, {
|
|
162
|
+
get: () => from[key],
|
|
163
|
+
enumerable: !(desc = Object.getOwnPropertyDescriptor(from, key)) || desc.enumerable,
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
return to;
|
|
168
|
+
};
|
|
169
|
+
module.exports = __cp(module.exports, exports);
|
|
170
|
+
}
|
|
171
|
+
return module.exports;
|
|
172
|
+
}))
|
|
173
|
+
//# sourceMappingURL=rrweb.umd.min.cjs.map
|