@sailfish-rrweb/replay 0.5.4 → 0.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,62 +1,62 @@
1
1
  (function (g, f) {if ("object" == typeof exports && "object" == typeof module) {module.exports = f();} else if ("function" == typeof define && define.amd) {define("@sailfish-rrweb/rrweb", [], f);} else if ("object" == typeof exports) {exports["@sailfish-rrweb/rrweb"] = f();} else {g["@sailfish-rrweb/rrweb"] = f();}}(typeof self !== 'undefined' ? self : typeof globalThis !== 'undefined' ? globalThis : this, () => {var exports = {};var module = { exports };
2
- "use strict";var Un=Object.defineProperty,Bn=Object.defineProperties;var Wn=Object.getOwnPropertyDescriptors;var Fe=Object.getOwnPropertySymbols;var Js=Object.prototype.hasOwnProperty,$s=Object.prototype.propertyIsEnumerable;var Hs=(t,e,s)=>e in t?Un(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,O=(t,e)=>{for(var s in e||(e={}))Js.call(e,s)&&Hs(t,s,e[s]);if(Fe)for(var s of Fe(e))$s.call(e,s)&&Hs(t,s,e[s]);return t},W=(t,e)=>Bn(t,Wn(e));var pe=(t,e)=>{var s={};for(var r in t)Js.call(t,r)&&e.indexOf(r)<0&&(s[r]=t[r]);if(t!=null&&Fe)for(var r of Fe(t))e.indexOf(r)<0&&$s.call(t,r)&&(s[r]=t[r]);return s};Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var jn=Object.defineProperty,Vn=(t,e,s)=>e in t?jn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,v=(t,e,s)=>Vn(t,typeof e!="symbol"?e+"":e,s),zn=Object.defineProperty,Yn=(t,e,s)=>e in t?zn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,Qs=(t,e,s)=>Yn(t,typeof e!="symbol"?e+"":e,s),R=(t=>(t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t))(R||{});function Gn(t){return t.nodeType===t.ELEMENT_NODE}let $r=class{constructor(){Qs(this,"idNodeMap",new Map),Qs(this,"nodeMetaMap",new WeakMap)}getId(t){var s;var e;return t&&(s=(e=this.getMeta(t))==null?void 0:e.id)!=null?s:-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 e=this.getId(t);this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach(s=>this.removeNodeFromMap(s))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){const s=e.id;this.idNodeMap.set(s,t),this.nodeMetaMap.set(t,e)}replace(t,e){const s=this.getNode(t);if(s){const r=this.nodeMetaMap.get(s);r&&this.nodeMetaMap.set(e,r)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Qr(){return new $r}function Xn(t){return t.toLowerCase()}function Zn(t,e){return!t||!e||t.type!==e.type?!1:t.type===R.Document?t.compatMode===e.compatMode:t.type===R.DocumentType?t.name===e.name&&t.publicId===e.publicId&&t.systemId===e.systemId:t.type===R.Comment||t.type===R.Text||t.type===R.CDATA?t.textContent===e.textContent:t.type===R.Element?t.tagName===e.tagName&&JSON.stringify(t.attributes)===JSON.stringify(e.attributes)&&t.isSVG===e.isSVG&&t.needBlock===e.needBlock:!1}function Hn(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Jn(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var s=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};s.prototype=e.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(s,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),s}var vs={exports:{}},C=String,Kr=function(){return{isColorSupported:!1,reset:C,bold:C,dim:C,italic:C,underline:C,inverse:C,hidden:C,strikethrough:C,black:C,red:C,green:C,yellow:C,blue:C,magenta:C,cyan:C,white:C,gray:C,bgBlack:C,bgRed:C,bgGreen:C,bgYellow:C,bgBlue:C,bgMagenta:C,bgCyan:C,bgWhite:C,blackBright:C,redBright:C,greenBright:C,yellowBright:C,blueBright:C,magentaBright:C,cyanBright:C,whiteBright:C,bgBlackBright:C,bgRedBright:C,bgGreenBright:C,bgYellowBright:C,bgBlueBright:C,bgMagentaBright:C,bgCyanBright:C,bgWhiteBright:C}};vs.exports=Kr();vs.exports.createColors=Kr;var $n=vs.exports;const Qn={},Kn=Object.freeze(Object.defineProperty({__proto__:null,default:Qn},Symbol.toStringTag,{value:"Module"})),z=Jn(Kn);let Ks=$n,qs=z,jt=class qr extends Error{constructor(e,s,r,i,o,a){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),i&&(this.source=i),a&&(this.plugin=a),typeof s<"u"&&typeof r<"u"&&(typeof s=="number"?(this.line=s,this.column=r):(this.line=s.line,this.column=s.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,qr)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let s=this.source;e==null&&(e=Ks.isColorSupported);let r=h=>h,i=h=>h,o=h=>h;if(e){let{bold:h,gray:u,red:p}=Ks.createColors(!0);i=m=>h(p(m)),r=m=>u(m),qs&&(o=m=>qs(m))}let a=s.split(/\r?\n/),n=Math.max(this.line-3,0),l=Math.min(this.line+2,a.length),c=String(l).length;return a.slice(n,l).map((h,u)=>{let p=n+1+u,m=" "+(" "+p).slice(-c)+" | ";if(p===this.line){if(h.length>160){let d=20,S=Math.max(0,this.column-d),f=Math.max(this.column+d,this.endColumn+d),w=h.slice(S,f),g=r(m.replace(/\d/g," "))+h.slice(0,Math.min(this.column-1,d-1)).replace(/[^\t]/g," ");return i(">")+r(m)+o(w)+`
2
+ "use strict";var jn=Object.defineProperty,Vn=Object.defineProperties;var zn=Object.getOwnPropertyDescriptors;var _e=Object.getOwnPropertySymbols;var Js=Object.prototype.hasOwnProperty,Qs=Object.prototype.propertyIsEnumerable;var $s=(t,e,s)=>e in t?jn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,O=(t,e)=>{for(var s in e||(e={}))Js.call(e,s)&&$s(t,s,e[s]);if(_e)for(var s of _e(e))Qs.call(e,s)&&$s(t,s,e[s]);return t},W=(t,e)=>Vn(t,zn(e));var fe=(t,e)=>{var s={};for(var r in t)Js.call(t,r)&&e.indexOf(r)<0&&(s[r]=t[r]);if(t!=null&&_e)for(var r of _e(t))e.indexOf(r)<0&&Qs.call(t,r)&&(s[r]=t[r]);return s};Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var Yn=Object.defineProperty,Gn=(t,e,s)=>e in t?Yn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,v=(t,e,s)=>Gn(t,typeof e!="symbol"?e+"":e,s),Xn=Object.defineProperty,Zn=(t,e,s)=>e in t?Xn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,Ks=(t,e,s)=>Zn(t,typeof e!="symbol"?e+"":e,s),R=(t=>(t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t))(R||{});function Hn(t){return t.nodeType===t.ELEMENT_NODE}let qr=class{constructor(){Ks(this,"idNodeMap",new Map),Ks(this,"nodeMetaMap",new WeakMap)}getId(t){var s;var e;return t&&(s=(e=this.getMeta(t))==null?void 0:e.id)!=null?s:-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 e=this.getId(t);this.idNodeMap.delete(e),t.childNodes&&t.childNodes.forEach(s=>this.removeNodeFromMap(s))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,e){const s=e.id;this.idNodeMap.set(s,t),this.nodeMetaMap.set(t,e)}replace(t,e){const s=this.getNode(t);if(s){const r=this.nodeMetaMap.get(s);r&&this.nodeMetaMap.set(e,r)}this.idNodeMap.set(t,e)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function ei(){return new qr}function $n(t){return t.toLowerCase()}function Jn(t,e){return!t||!e||t.type!==e.type?!1:t.type===R.Document?t.compatMode===e.compatMode:t.type===R.DocumentType?t.name===e.name&&t.publicId===e.publicId&&t.systemId===e.systemId:t.type===R.Comment||t.type===R.Text||t.type===R.CDATA?t.textContent===e.textContent:t.type===R.Element?t.tagName===e.tagName&&JSON.stringify(t.attributes)===JSON.stringify(e.attributes)&&t.isSVG===e.isSVG&&t.needBlock===e.needBlock:!1}function Qn(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Kn(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var s=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};s.prototype=e.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(s,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),s}var Ss={exports:{}},C=String,ti=function(){return{isColorSupported:!1,reset:C,bold:C,dim:C,italic:C,underline:C,inverse:C,hidden:C,strikethrough:C,black:C,red:C,green:C,yellow:C,blue:C,magenta:C,cyan:C,white:C,gray:C,bgBlack:C,bgRed:C,bgGreen:C,bgYellow:C,bgBlue:C,bgMagenta:C,bgCyan:C,bgWhite:C,blackBright:C,redBright:C,greenBright:C,yellowBright:C,blueBright:C,magentaBright:C,cyanBright:C,whiteBright:C,bgBlackBright:C,bgRedBright:C,bgGreenBright:C,bgYellowBright:C,bgBlueBright:C,bgMagentaBright:C,bgCyanBright:C,bgWhiteBright:C}};Ss.exports=ti();Ss.exports.createColors=ti;var qn=Ss.exports;const eo={},to=Object.freeze(Object.defineProperty({__proto__:null,default:eo},Symbol.toStringTag,{value:"Module"})),z=Kn(to);let qs=qn,er=z,Vt=class si extends Error{constructor(e,s,r,i,o,a){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),i&&(this.source=i),a&&(this.plugin=a),typeof s<"u"&&typeof r<"u"&&(typeof s=="number"?(this.line=s,this.column=r):(this.line=s.line,this.column=s.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,si)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let s=this.source;e==null&&(e=qs.isColorSupported);let r=h=>h,i=h=>h,o=h=>h;if(e){let{bold:h,gray:u,red:p}=qs.createColors(!0);i=m=>h(p(m)),r=m=>u(m),er&&(o=m=>er(m))}let a=s.split(/\r?\n/),n=Math.max(this.line-3,0),c=Math.min(this.line+2,a.length),l=String(c).length;return a.slice(n,c).map((h,u)=>{let p=n+1+u,m=" "+(" "+p).slice(-l)+" | ";if(p===this.line){if(h.length>160){let d=20,S=Math.max(0,this.column-d),f=Math.max(this.column+d,this.endColumn+d),w=h.slice(S,f),g=r(m.replace(/\d/g," "))+h.slice(0,Math.min(this.column-1,d-1)).replace(/[^\t]/g," ");return i(">")+r(m)+o(w)+`
3
3
  `+g+i("^")}let b=r(m.replace(/\d/g," "))+h.slice(0,this.column-1).replace(/[^\t]/g," ");return i(">")+r(m)+o(h)+`
4
4
  `+b+i("^")}return" "+r(m)+o(h)}).join(`
5
5
  `)}toString(){let e=this.showSourceCode();return e&&(e=`
6
6
 
7
7
  `+e+`
8
- `),this.name+": "+this.message+e}};var Ss=jt;jt.default=jt;const er={after:`
8
+ `),this.name+": "+this.message+e}};var xs=Vt;Vt.default=Vt;const tr={after:`
9
9
  `,beforeClose:`
10
10
  `,beforeComment:`
11
11
  `,beforeDecl:`
12
12
  `,beforeOpen:" ",beforeRule:`
13
- `,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function qn(t){return t[0].toUpperCase()+t.slice(1)}let Vt=class{constructor(t){this.builder=t}atrule(t,e){let s="@"+t.name,r=t.params?this.rawValue(t,"params"):"";if(typeof t.raws.afterName<"u"?s+=t.raws.afterName:r&&(s+=" "),t.nodes)this.block(t,s+r);else{let i=(t.raws.between||"")+(e?";":"");this.builder(s+r+i,t)}}beforeAfter(t,e){let s;t.type==="decl"?s=this.raw(t,null,"beforeDecl"):t.type==="comment"?s=this.raw(t,null,"beforeComment"):e==="before"?s=this.raw(t,null,"beforeRule"):s=this.raw(t,null,"beforeClose");let r=t.parent,i=0;for(;r&&r.type!=="root";)i+=1,r=r.parent;if(s.includes(`
14
- `)){let o=this.raw(t,null,"indent");if(o.length)for(let a=0;a<i;a++)s+=o}return s}block(t,e){let s=this.raw(t,"between","beforeOpen");this.builder(e+s+"{",t,"start");let r;t.nodes&&t.nodes.length?(this.body(t),r=this.raw(t,"after")):r=this.raw(t,"after","emptyBody"),r&&this.builder(r),this.builder("}",t,"end")}body(t){let e=t.nodes.length-1;for(;e>0&&t.nodes[e].type==="comment";)e-=1;let s=this.raw(t,"semicolon");for(let r=0;r<t.nodes.length;r++){let i=t.nodes[r],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,e!==r||s)}}comment(t){let e=this.raw(t,"left","commentLeft"),s=this.raw(t,"right","commentRight");this.builder("/*"+e+t.text+s+"*/",t)}decl(t,e){let s=this.raw(t,"between","colon"),r=t.prop+s+this.rawValue(t,"value");t.important&&(r+=t.raws.important||" !important"),e&&(r+=";"),this.builder(r,t)}document(t){this.body(t)}raw(t,e,s){let r;if(s||(s=e),e&&(r=t.raws[e],typeof r<"u"))return r;let i=t.parent;if(s==="before"&&(!i||i.type==="root"&&i.first===t||i&&i.type==="document"))return"";if(!i)return er[s];let o=t.root();if(o.rawCache||(o.rawCache={}),typeof o.rawCache[s]<"u")return o.rawCache[s];if(s==="before"||s==="after")return this.beforeAfter(t,s);{let a="raw"+qn(s);this[a]?r=this[a](o,t):o.walk(n=>{if(r=n.raws[e],typeof r<"u")return!1})}return typeof r>"u"&&(r=er[s]),o.rawCache[s]=r,r}rawBeforeClose(t){let e;return t.walk(s=>{if(s.nodes&&s.nodes.length>0&&typeof s.raws.after<"u")return e=s.raws.after,e.includes(`
13
+ `,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function so(t){return t[0].toUpperCase()+t.slice(1)}let zt=class{constructor(t){this.builder=t}atrule(t,e){let s="@"+t.name,r=t.params?this.rawValue(t,"params"):"";if(typeof t.raws.afterName<"u"?s+=t.raws.afterName:r&&(s+=" "),t.nodes)this.block(t,s+r);else{let i=(t.raws.between||"")+(e?";":"");this.builder(s+r+i,t)}}beforeAfter(t,e){let s;t.type==="decl"?s=this.raw(t,null,"beforeDecl"):t.type==="comment"?s=this.raw(t,null,"beforeComment"):e==="before"?s=this.raw(t,null,"beforeRule"):s=this.raw(t,null,"beforeClose");let r=t.parent,i=0;for(;r&&r.type!=="root";)i+=1,r=r.parent;if(s.includes(`
14
+ `)){let o=this.raw(t,null,"indent");if(o.length)for(let a=0;a<i;a++)s+=o}return s}block(t,e){let s=this.raw(t,"between","beforeOpen");this.builder(e+s+"{",t,"start");let r;t.nodes&&t.nodes.length?(this.body(t),r=this.raw(t,"after")):r=this.raw(t,"after","emptyBody"),r&&this.builder(r),this.builder("}",t,"end")}body(t){let e=t.nodes.length-1;for(;e>0&&t.nodes[e].type==="comment";)e-=1;let s=this.raw(t,"semicolon");for(let r=0;r<t.nodes.length;r++){let i=t.nodes[r],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,e!==r||s)}}comment(t){let e=this.raw(t,"left","commentLeft"),s=this.raw(t,"right","commentRight");this.builder("/*"+e+t.text+s+"*/",t)}decl(t,e){let s=this.raw(t,"between","colon"),r=t.prop+s+this.rawValue(t,"value");t.important&&(r+=t.raws.important||" !important"),e&&(r+=";"),this.builder(r,t)}document(t){this.body(t)}raw(t,e,s){let r;if(s||(s=e),e&&(r=t.raws[e],typeof r<"u"))return r;let i=t.parent;if(s==="before"&&(!i||i.type==="root"&&i.first===t||i&&i.type==="document"))return"";if(!i)return tr[s];let o=t.root();if(o.rawCache||(o.rawCache={}),typeof o.rawCache[s]<"u")return o.rawCache[s];if(s==="before"||s==="after")return this.beforeAfter(t,s);{let a="raw"+so(s);this[a]?r=this[a](o,t):o.walk(n=>{if(r=n.raws[e],typeof r<"u")return!1})}return typeof r>"u"&&(r=tr[s]),o.rawCache[s]=r,r}rawBeforeClose(t){let e;return t.walk(s=>{if(s.nodes&&s.nodes.length>0&&typeof s.raws.after<"u")return e=s.raws.after,e.includes(`
15
15
  `)&&(e=e.replace(/[^\n]+$/,"")),!1}),e&&(e=e.replace(/\S/g,"")),e}rawBeforeComment(t,e){let s;return t.walkComments(r=>{if(typeof r.raws.before<"u")return s=r.raws.before,s.includes(`
16
16
  `)&&(s=s.replace(/[^\n]+$/,"")),!1}),typeof s>"u"?s=this.raw(e,null,"beforeDecl"):s&&(s=s.replace(/\S/g,"")),s}rawBeforeDecl(t,e){let s;return t.walkDecls(r=>{if(typeof r.raws.before<"u")return s=r.raws.before,s.includes(`
17
17
  `)&&(s=s.replace(/[^\n]+$/,"")),!1}),typeof s>"u"?s=this.raw(e,null,"beforeRule"):s&&(s=s.replace(/\S/g,"")),s}rawBeforeOpen(t){let e;return t.walk(s=>{if(s.type!=="decl"&&(e=s.raws.between,typeof e<"u"))return!1}),e}rawBeforeRule(t){let e;return t.walk(s=>{if(s.nodes&&(s.parent!==t||t.first!==s)&&typeof s.raws.before<"u")return e=s.raws.before,e.includes(`
18
18
  `)&&(e=e.replace(/[^\n]+$/,"")),!1}),e&&(e=e.replace(/\S/g,"")),e}rawColon(t){let e;return t.walkDecls(s=>{if(typeof s.raws.between<"u")return e=s.raws.between.replace(/[^\s:]/g,""),!1}),e}rawEmptyBody(t){let e;return t.walk(s=>{if(s.nodes&&s.nodes.length===0&&(e=s.raws.after,typeof e<"u"))return!1}),e}rawIndent(t){if(t.raws.indent)return t.raws.indent;let e;return t.walk(s=>{let r=s.parent;if(r&&r!==t&&r.parent&&r.parent===t&&typeof s.raws.before<"u"){let i=s.raws.before.split(`
19
- `);return e=i[i.length-1],e=e.replace(/\S/g,""),!1}}),e}rawSemicolon(t){let e;return t.walk(s=>{if(s.nodes&&s.nodes.length&&s.last.type==="decl"&&(e=s.raws.semicolon,typeof e<"u"))return!1}),e}rawValue(t,e){let s=t[e],r=t.raws[e];return r&&r.value===s?r.raw:s}root(t){this.body(t),t.raws.after&&this.builder(t.raws.after)}rule(t){this.block(t,this.rawValue(t,"selector")),t.raws.ownSemicolon&&this.builder(t.raws.ownSemicolon,t,"end")}stringify(t,e){if(!this[t.type])throw new Error("Unknown AST node type "+t.type+". Maybe you need to change PostCSS stringifier.");this[t.type](t,e)}};var ei=Vt;Vt.default=Vt;let eo=ei;function zt(t,e){new eo(e).stringify(t)}var yt=zt;zt.default=zt;var Ae={};Ae.isClean=Symbol("isClean");Ae.my=Symbol("my");let to=Ss,so=ei,ro=yt,{isClean:de,my:io}=Ae;function Yt(t,e){let s=new t.constructor;for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||r==="proxyCache")continue;let i=t[r],o=typeof i;r==="parent"&&o==="object"?e&&(s[r]=e):r==="source"?s[r]=i:Array.isArray(i)?s[r]=i.map(a=>Yt(a,s)):(o==="object"&&i!==null&&(i=Yt(i)),s[r]=i)}return s}function fe(t,e){if(e&&typeof e.offset<"u")return e.offset;let s=1,r=1,i=0;for(let o=0;o<t.length;o++){if(r===e.line&&s===e.column){i=o;break}t[o]===`
20
- `?(s=1,r+=1):s+=1}return i}let Gt=class{get proxyOf(){return this}constructor(t={}){this.raws={},this[de]=!1,this[io]=!0;for(let e in t)if(e==="nodes"){this.nodes=[];for(let s of t[e])typeof s.clone=="function"?this.append(s.clone()):this.append(s)}else this[e]=t[e]}addToError(t){if(t.postcssNode=this,t.stack&&this.source&&/\n\s{4}at /.test(t.stack)){let e=this.source;t.stack=t.stack.replace(/\n\s{4}at /,`$&${e.input.from}:${e.start.line}:${e.start.column}$&`)}return t}after(t){return this.parent.insertAfter(this,t),this}assign(t={}){for(let e in t)this[e]=t[e];return this}before(t){return this.parent.insertBefore(this,t),this}cleanRaws(t){delete this.raws.before,delete this.raws.after,t||delete this.raws.between}clone(t={}){let e=Yt(this);for(let s in t)e[s]=t[s];return e}cloneAfter(t={}){let e=this.clone(t);return this.parent.insertAfter(this,e),e}cloneBefore(t={}){let e=this.clone(t);return this.parent.insertBefore(this,e),e}error(t,e={}){if(this.source){let{end:s,start:r}=this.rangeBy(e);return this.source.input.error(t,{column:r.column,line:r.line},{column:s.column,line:s.line},e)}return new to(t)}getProxyProcessor(){return{get(t,e){return e==="proxyOf"?t:e==="root"?()=>t.root().toProxy():t[e]},set(t,e,s){return t[e]===s||(t[e]=s,(e==="prop"||e==="value"||e==="name"||e==="params"||e==="important"||e==="text")&&t.markDirty()),!0}}}markClean(){this[de]=!0}markDirty(){if(this[de]){this[de]=!1;let t=this;for(;t=t.parent;)t[de]=!1}}next(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t+1]}positionBy(t){let e=this.source.start;if(t.index)e=this.positionInside(t.index);else if(t.word){let s="document"in this.source.input?this.source.input.document:this.source.input.css,r=s.slice(fe(s,this.source.start),fe(s,this.source.end)).indexOf(t.word);r!==-1&&(e=this.positionInside(r))}return e}positionInside(t){let e=this.source.start.column,s=this.source.start.line,r="document"in this.source.input?this.source.input.document:this.source.input.css,i=fe(r,this.source.start),o=i+t;for(let a=i;a<o;a++)r[a]===`
21
- `?(e=1,s+=1):e+=1;return{column:e,line:s}}prev(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t-1]}rangeBy(t){let e={column:this.source.start.column,line:this.source.start.line},s=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:e.column+1,line:e.line};if(t.word){let r="document"in this.source.input?this.source.input.document:this.source.input.css,i=r.slice(fe(r,this.source.start),fe(r,this.source.end)).indexOf(t.word);i!==-1&&(e=this.positionInside(i),s=this.positionInside(i+t.word.length))}else t.start?e={column:t.start.column,line:t.start.line}:t.index&&(e=this.positionInside(t.index)),t.end?s={column:t.end.column,line:t.end.line}:typeof t.endIndex=="number"?s=this.positionInside(t.endIndex):t.index&&(s=this.positionInside(t.index+1));return(s.line<e.line||s.line===e.line&&s.column<=e.column)&&(s={column:e.column+1,line:e.line}),{end:s,start:e}}raw(t,e){return new so().raw(this,t,e)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...t){if(this.parent){let e=this,s=!1;for(let r of t)r===this?s=!0:s?(this.parent.insertAfter(e,r),e=r):this.parent.insertBefore(e,r);s||this.remove()}return this}root(){let t=this;for(;t.parent&&t.parent.type!=="document";)t=t.parent;return t}toJSON(t,e){let s={},r=e==null;e=e||new Map;let i=0;for(let o in this){if(!Object.prototype.hasOwnProperty.call(this,o)||o==="parent"||o==="proxyCache")continue;let a=this[o];if(Array.isArray(a))s[o]=a.map(n=>typeof n=="object"&&n.toJSON?n.toJSON(null,e):n);else if(typeof a=="object"&&a.toJSON)s[o]=a.toJSON(null,e);else if(o==="source"){let n=e.get(a.input);n==null&&(n=i,e.set(a.input,i),i++),s[o]={end:a.end,inputId:n,start:a.start}}else s[o]=a}return r&&(s.inputs=[...e.keys()].map(o=>o.toJSON())),s}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(t=ro){t.stringify&&(t=t.stringify);let e="";return t(this,s=>{e+=s}),e}warn(t,e,s){let r={node:this};for(let i in s)r[i]=s[i];return t.warn(e,r)}};var wt=Gt;Gt.default=Gt;let no=wt,Xt=class extends no{constructor(t){super(t),this.type="comment"}};var bt=Xt;Xt.default=Xt;let oo=wt,Zt=class extends oo{get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}constructor(t){t&&typeof t.value<"u"&&typeof t.value!="string"&&(t=W(O({},t),{value:String(t.value)})),super(t),this.type="decl"}};var vt=Zt;Zt.default=Zt;let ti=bt,si=vt,ao=wt,{isClean:ri,my:ii}=Ae,xs,ni,oi,Cs;function ai(t){return t.map(e=>(e.nodes&&(e.nodes=ai(e.nodes)),delete e.source,e))}function li(t){if(t[ri]=!1,t.proxyOf.nodes)for(let e of t.proxyOf.nodes)li(e)}let H=class ci extends ao{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]}append(...e){for(let s of e){let r=this.normalize(s,this.last);for(let i of r)this.proxyOf.nodes.push(i)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let s of this.nodes)s.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let s=this.getIterator(),r,i;for(;this.indexes[s]<this.proxyOf.nodes.length&&(r=this.indexes[s],i=e(this.proxyOf.nodes[r],r),i!==!1);)this.indexes[s]+=1;return delete this.indexes[s],i}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get(e,s){return s==="proxyOf"?e:e[s]?s==="each"||typeof s=="string"&&s.startsWith("walk")?(...r)=>e[s](...r.map(i=>typeof i=="function"?(o,a)=>i(o.toProxy(),a):i)):s==="every"||s==="some"?r=>e[s]((i,...o)=>r(i.toProxy(),...o)):s==="root"?()=>e.root().toProxy():s==="nodes"?e.nodes.map(r=>r.toProxy()):s==="first"||s==="last"?e[s].toProxy():e[s]:e[s]},set(e,s,r){return e[s]===r||(e[s]=r,(s==="name"||s==="params"||s==="selector")&&e.markDirty()),!0}}}index(e){return typeof e=="number"?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,s){let r=this.index(e),i=this.normalize(s,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let a of i)this.proxyOf.nodes.splice(r+1,0,a);let o;for(let a in this.indexes)o=this.indexes[a],r<o&&(this.indexes[a]=o+i.length);return this.markDirty(),this}insertBefore(e,s){let r=this.index(e),i=r===0?"prepend":!1,o=this.normalize(s,this.proxyOf.nodes[r],i).reverse();r=this.index(e);for(let n of o)this.proxyOf.nodes.splice(r,0,n);let a;for(let n in this.indexes)a=this.indexes[n],r<=a&&(this.indexes[n]=a+o.length);return this.markDirty(),this}normalize(e,s){if(typeof e=="string")e=ai(ni(e).nodes);else if(typeof e>"u")e=[];else if(Array.isArray(e)){e=e.slice(0);for(let r of e)r.parent&&r.parent.removeChild(r,"ignore")}else if(e.type==="root"&&this.type!=="document"){e=e.nodes.slice(0);for(let r of e)r.parent&&r.parent.removeChild(r,"ignore")}else if(e.type)e=[e];else if(e.prop){if(typeof e.value>"u")throw new Error("Value field is missed in node creation");typeof e.value!="string"&&(e.value=String(e.value)),e=[new si(e)]}else if(e.selector||e.selectors)e=[new Cs(e)];else if(e.name)e=[new xs(e)];else if(e.text)e=[new ti(e)];else throw new Error("Unknown node type in node creation");return e.map(r=>(r[ii]||ci.rebuild(r),r=r.proxyOf,r.parent&&r.parent.removeChild(r),r[ri]&&li(r),r.raws||(r.raws={}),typeof r.raws.before>"u"&&s&&typeof s.raws.before<"u"&&(r.raws.before=s.raws.before.replace(/\S/g,"")),r.parent=this.proxyOf,r))}prepend(...e){e=e.reverse();for(let s of e){let r=this.normalize(s,this.first,"prepend").reverse();for(let i of r)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+r.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let s;for(let r in this.indexes)s=this.indexes[r],s>=e&&(this.indexes[r]=s-1);return this.markDirty(),this}replaceValues(e,s,r){return r||(r=s,s={}),this.walkDecls(i=>{s.props&&!s.props.includes(i.prop)||s.fast&&!i.value.includes(s.fast)||(i.value=i.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((s,r)=>{let i;try{i=e(s,r)}catch(o){throw s.addToError(o)}return i!==!1&&s.walk&&(i=s.walk(e)),i})}walkAtRules(e,s){return s?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="atrule"&&e.test(r.name))return s(r,i)}):this.walk((r,i)=>{if(r.type==="atrule"&&r.name===e)return s(r,i)}):(s=e,this.walk((r,i)=>{if(r.type==="atrule")return s(r,i)}))}walkComments(e){return this.walk((s,r)=>{if(s.type==="comment")return e(s,r)})}walkDecls(e,s){return s?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="decl"&&e.test(r.prop))return s(r,i)}):this.walk((r,i)=>{if(r.type==="decl"&&r.prop===e)return s(r,i)}):(s=e,this.walk((r,i)=>{if(r.type==="decl")return s(r,i)}))}walkRules(e,s){return s?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="rule"&&e.test(r.selector))return s(r,i)}):this.walk((r,i)=>{if(r.type==="rule"&&r.selector===e)return s(r,i)}):(s=e,this.walk((r,i)=>{if(r.type==="rule")return s(r,i)}))}};H.registerParse=t=>{ni=t};H.registerRule=t=>{Cs=t};H.registerAtRule=t=>{xs=t};H.registerRoot=t=>{oi=t};var q=H;H.default=H;H.rebuild=t=>{t.type==="atrule"?Object.setPrototypeOf(t,xs.prototype):t.type==="rule"?Object.setPrototypeOf(t,Cs.prototype):t.type==="decl"?Object.setPrototypeOf(t,si.prototype):t.type==="comment"?Object.setPrototypeOf(t,ti.prototype):t.type==="root"&&Object.setPrototypeOf(t,oi.prototype),t[ii]=!0,t.nodes&&t.nodes.forEach(e=>{H.rebuild(e)})};let hi=q,nt=class extends hi{constructor(t){super(t),this.type="atrule"}append(...t){return this.proxyOf.nodes||(this.nodes=[]),super.append(...t)}prepend(...t){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...t)}};var Es=nt;nt.default=nt;hi.registerAtRule(nt);let lo=q,ui,pi,Ee=class extends lo{constructor(t){super(O({type:"document"},t)),this.nodes||(this.nodes=[])}toResult(t={}){return new ui(new pi,this,t).stringify()}};Ee.registerLazyResult=t=>{ui=t};Ee.registerProcessor=t=>{pi=t};var Ms=Ee;Ee.default=Ee;let co="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",ho=(t=21)=>{let e="",s=t|0;for(;s--;)e+=co[Math.random()*64|0];return e};var uo={nanoid:ho};let{existsSync:po,readFileSync:fo}=z,{dirname:Rt,join:mo}=z,{SourceMapConsumer:tr,SourceMapGenerator:sr}=z;function go(t){return Buffer?Buffer.from(t,"base64").toString():window.atob(t)}let Ht=class{constructor(t,e){if(e.map===!1)return;this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:");let s=e.map?e.map.prev:void 0,r=this.loadMap(e.from,s);!this.mapFile&&e.from&&(this.mapFile=e.from),this.mapFile&&(this.root=Rt(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new tr(this.text)),this.consumerCache}decodeInline(t){let e=/^data:application\/json;charset=utf-?8;base64,/,s=/^data:application\/json;base64,/,r=/^data:application\/json;charset=utf-?8,/,i=/^data:application\/json,/,o=t.match(r)||t.match(i);if(o)return decodeURIComponent(t.substr(o[0].length));let a=t.match(e)||t.match(s);if(a)return go(t.substr(a[0].length));let n=t.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+n)}getAnnotationURL(t){return t.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(t){return typeof t!="object"?!1:typeof t.mappings=="string"||typeof t._mappings=="string"||Array.isArray(t.sections)}loadAnnotation(t){let e=t.match(/\/\*\s*# sourceMappingURL=/g);if(!e)return;let s=t.lastIndexOf(e.pop()),r=t.indexOf("*/",s);s>-1&&r>-1&&(this.annotation=this.getAnnotationURL(t.substring(s,r)))}loadFile(t){if(this.root=Rt(t),po(t))return this.mapFile=t,fo(t,"utf-8").toString().trim()}loadMap(t,e){if(e===!1)return!1;if(e){if(typeof e=="string")return e;if(typeof e=="function"){let s=e(t);if(s){let r=this.loadFile(s);if(!r)throw new Error("Unable to load previous source map: "+s.toString());return r}}else{if(e instanceof tr)return sr.fromSourceMap(e).toString();if(e instanceof sr)return e.toString();if(this.isMap(e))return JSON.stringify(e);throw new Error("Unsupported previous source map format: "+e.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let s=this.annotation;return t&&(s=mo(Rt(t),s)),this.loadFile(s)}}}startWith(t,e){return t?t.substr(0,e.length)===e:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var di=Ht;Ht.default=Ht;let{nanoid:yo}=uo,{isAbsolute:Jt,resolve:$t}=z,{SourceMapConsumer:wo,SourceMapGenerator:bo}=z,{fileURLToPath:rr,pathToFileURL:_e}=z,ir=Ss,vo=di,Ot=z,At=Symbol("fromOffsetCache"),So=!!(wo&&bo),nr=!!($t&&Jt),ot=class{get from(){return this.file||this.id}constructor(t,e={}){if(t===null||typeof t>"u"||typeof t=="object"&&!t.toString)throw new Error(`PostCSS received ${t} instead of CSS string`);if(this.css=t.toString(),this.css[0]==="\uFEFF"||this.css[0]==="\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,e.document&&(this.document=e.document.toString()),e.from&&(!nr||/^\w+:\/\//.test(e.from)||Jt(e.from)?this.file=e.from:this.file=$t(e.from)),nr&&So){let s=new vo(this.css,e);if(s.text){this.map=s;let r=s.consumer().file;!this.file&&r&&(this.file=this.mapResolve(r))}}this.file||(this.id="<input css "+yo(6)+">"),this.map&&(this.map.file=this.from)}error(t,e,s,r={}){let i,o,a;if(e&&typeof e=="object"){let l=e,c=s;if(typeof l.offset=="number"){let h=this.fromOffset(l.offset);e=h.line,s=h.col}else e=l.line,s=l.column;if(typeof c.offset=="number"){let h=this.fromOffset(c.offset);o=h.line,i=h.col}else o=c.line,i=c.column}else if(!s){let l=this.fromOffset(e);e=l.line,s=l.col}let n=this.origin(e,s,o,i);return n?a=new ir(t,n.endLine===void 0?n.line:{column:n.column,line:n.line},n.endLine===void 0?n.column:{column:n.endColumn,line:n.endLine},n.source,n.file,r.plugin):a=new ir(t,o===void 0?e:{column:s,line:e},o===void 0?s:{column:i,line:o},this.css,this.file,r.plugin),a.input={column:s,endColumn:i,endLine:o,line:e,source:this.css},this.file&&(_e&&(a.input.url=_e(this.file).toString()),a.input.file=this.file),a}fromOffset(t){let e,s;if(this[At])s=this[At];else{let i=this.css.split(`
22
- `);s=new Array(i.length);let o=0;for(let a=0,n=i.length;a<n;a++)s[a]=o,o+=i[a].length+1;this[At]=s}e=s[s.length-1];let r=0;if(t>=e)r=s.length-1;else{let i=s.length-2,o;for(;r<i;)if(o=r+(i-r>>1),t<s[o])i=o-1;else if(t>=s[o+1])r=o+1;else{r=o;break}}return{col:t-s[r]+1,line:r+1}}mapResolve(t){return/^\w+:\/\//.test(t)?t:$t(this.map.consumer().sourceRoot||this.map.root||".",t)}origin(t,e,s,r){if(!this.map)return!1;let i=this.map.consumer(),o=i.originalPositionFor({column:e,line:t});if(!o.source)return!1;let a;typeof s=="number"&&(a=i.originalPositionFor({column:r,line:s}));let n;Jt(o.source)?n=_e(o.source):n=new URL(o.source,this.map.consumer().sourceRoot||_e(this.map.mapFile));let l={column:o.column,endColumn:a&&a.column,endLine:a&&a.line,line:o.line,url:n.toString()};if(n.protocol==="file:")if(rr)l.file=rr(n);else throw new Error("file: protocol is not available in this PostCSS build");let c=i.sourceContentFor(o.source);return c&&(l.source=c),l}toJSON(){let t={};for(let e of["hasBOM","css","file","id"])this[e]!=null&&(t[e]=this[e]);return this.map&&(t.map=O({},this.map),t.map.consumerCache&&(t.map.consumerCache=void 0)),t}};var St=ot;ot.default=ot;Ot&&Ot.registerInput&&Ot.registerInput(ot);let fi=q,mi,gi,ne=class extends fi{constructor(t){super(t),this.type="root",this.nodes||(this.nodes=[])}normalize(t,e,s){let r=super.normalize(t);if(e){if(s==="prepend")this.nodes.length>1?e.raws.before=this.nodes[1].raws.before:delete e.raws.before;else if(this.first!==e)for(let i of r)i.raws.before=e.raws.before}return r}removeChild(t,e){let s=this.index(t);return!e&&s===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[s].raws.before),super.removeChild(t)}toResult(t={}){return new mi(new gi,this,t).stringify()}};ne.registerLazyResult=t=>{mi=t};ne.registerProcessor=t=>{gi=t};var Ie=ne;ne.default=ne;fi.registerRoot(ne);let Me={comma(t){return Me.split(t,[","],!0)},space(t){let e=[" ",`
23
- `," "];return Me.split(t,e)},split(t,e,s){let r=[],i="",o=!1,a=0,n=!1,l="",c=!1;for(let h of t)c?c=!1:h==="\\"?c=!0:n?h===l&&(n=!1):h==='"'||h==="'"?(n=!0,l=h):h==="("?a+=1:h===")"?a>0&&(a-=1):a===0&&e.includes(h)&&(o=!0),o?(i!==""&&r.push(i.trim()),i="",o=!1):i+=h;return(s||i!=="")&&r.push(i.trim()),r}};var yi=Me;Me.default=Me;let wi=q,xo=yi,at=class extends wi{get selectors(){return xo.comma(this.selector)}set selectors(t){let e=this.selector?this.selector.match(/,\s*/):null,s=e?e[0]:","+this.raw("between","beforeOpen");this.selector=t.join(s)}constructor(t){super(t),this.type="rule",this.nodes||(this.nodes=[])}};var Ns=at;at.default=at;wi.registerRule(at);let Co=Es,Eo=bt,Mo=vt,No=St,To=di,ko=Ie,Do=Ns;function Ne(t,e){if(Array.isArray(t))return t.map(a=>Ne(a));let i=t,{inputs:s}=i,r=pe(i,["inputs"]);if(s){e=[];for(let a of s){let n=W(O({},a),{__proto__:No.prototype});n.map&&(n.map=W(O({},n.map),{__proto__:To.prototype})),e.push(n)}}if(r.nodes&&(r.nodes=t.nodes.map(a=>Ne(a,e))),r.source){let o=r.source,{inputId:a}=o,n=pe(o,["inputId"]);r.source=n,a!=null&&(r.source.input=e[a])}if(r.type==="root")return new ko(r);if(r.type==="decl")return new Mo(r);if(r.type==="rule")return new Do(r);if(r.type==="comment")return new Eo(r);if(r.type==="atrule")return new Co(r);throw new Error("Unknown node type: "+t.type)}var Ro=Ne;Ne.default=Ne;let{dirname:tt,relative:bi,resolve:vi,sep:Si}=z,{SourceMapConsumer:xi,SourceMapGenerator:st}=z,{pathToFileURL:or}=z,Oo=St,Ao=!!(xi&&st),Io=!!(tt&&vi&&bi&&Si),Po=class{constructor(t,e,s,r){this.stringify=t,this.mapOpts=s.map||{},this.root=e,this.opts=s,this.css=r,this.originalCSS=r,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let t;this.isInline()?t="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?t=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?t=this.mapOpts.annotation(this.opts.to,this.root):t=this.outputFile()+".map";let e=`
19
+ `);return e=i[i.length-1],e=e.replace(/\S/g,""),!1}}),e}rawSemicolon(t){let e;return t.walk(s=>{if(s.nodes&&s.nodes.length&&s.last.type==="decl"&&(e=s.raws.semicolon,typeof e<"u"))return!1}),e}rawValue(t,e){let s=t[e],r=t.raws[e];return r&&r.value===s?r.raw:s}root(t){this.body(t),t.raws.after&&this.builder(t.raws.after)}rule(t){this.block(t,this.rawValue(t,"selector")),t.raws.ownSemicolon&&this.builder(t.raws.ownSemicolon,t,"end")}stringify(t,e){if(!this[t.type])throw new Error("Unknown AST node type "+t.type+". Maybe you need to change PostCSS stringifier.");this[t.type](t,e)}};var ri=zt;zt.default=zt;let ro=ri;function Yt(t,e){new ro(e).stringify(t)}var wt=Yt;Yt.default=Yt;var Ie={};Ie.isClean=Symbol("isClean");Ie.my=Symbol("my");let io=xs,no=ri,oo=wt,{isClean:me,my:ao}=Ie;function Gt(t,e){let s=new t.constructor;for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||r==="proxyCache")continue;let i=t[r],o=typeof i;r==="parent"&&o==="object"?e&&(s[r]=e):r==="source"?s[r]=i:Array.isArray(i)?s[r]=i.map(a=>Gt(a,s)):(o==="object"&&i!==null&&(i=Gt(i)),s[r]=i)}return s}function H(t,e){if(e&&typeof e.offset<"u")return e.offset;let s=1,r=1,i=0;for(let o=0;o<t.length;o++){if(r===e.line&&s===e.column){i=o;break}t[o]===`
20
+ `?(s=1,r+=1):s+=1}return i}let Xt=class{get proxyOf(){return this}constructor(t={}){this.raws={},this[me]=!1,this[ao]=!0;for(let e in t)if(e==="nodes"){this.nodes=[];for(let s of t[e])typeof s.clone=="function"?this.append(s.clone()):this.append(s)}else this[e]=t[e]}addToError(t){if(t.postcssNode=this,t.stack&&this.source&&/\n\s{4}at /.test(t.stack)){let e=this.source;t.stack=t.stack.replace(/\n\s{4}at /,`$&${e.input.from}:${e.start.line}:${e.start.column}$&`)}return t}after(t){return this.parent.insertAfter(this,t),this}assign(t={}){for(let e in t)this[e]=t[e];return this}before(t){return this.parent.insertBefore(this,t),this}cleanRaws(t){delete this.raws.before,delete this.raws.after,t||delete this.raws.between}clone(t={}){let e=Gt(this);for(let s in t)e[s]=t[s];return e}cloneAfter(t={}){let e=this.clone(t);return this.parent.insertAfter(this,e),e}cloneBefore(t={}){let e=this.clone(t);return this.parent.insertBefore(this,e),e}error(t,e={}){if(this.source){let{end:s,start:r}=this.rangeBy(e);return this.source.input.error(t,{column:r.column,line:r.line},{column:s.column,line:s.line},e)}return new io(t)}getProxyProcessor(){return{get(t,e){return e==="proxyOf"?t:e==="root"?()=>t.root().toProxy():t[e]},set(t,e,s){return t[e]===s||(t[e]=s,(e==="prop"||e==="value"||e==="name"||e==="params"||e==="important"||e==="text")&&t.markDirty()),!0}}}markClean(){this[me]=!0}markDirty(){if(this[me]){this[me]=!1;let t=this;for(;t=t.parent;)t[me]=!1}}next(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t+1]}positionBy(t={}){let e=this.source.start;if(t.index)e=this.positionInside(t.index);else if(t.word){let s="document"in this.source.input?this.source.input.document:this.source.input.css,r=s.slice(H(s,this.source.start),H(s,this.source.end)).indexOf(t.word);r!==-1&&(e=this.positionInside(r))}return e}positionInside(t){let e=this.source.start.column,s=this.source.start.line,r="document"in this.source.input?this.source.input.document:this.source.input.css,i=H(r,this.source.start),o=i+t;for(let a=i;a<o;a++)r[a]===`
21
+ `?(e=1,s+=1):e+=1;return{column:e,line:s,offset:o}}prev(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t-1]}rangeBy(t={}){let e="document"in this.source.input?this.source.input.document:this.source.input.css,s={column:this.source.start.column,line:this.source.start.line,offset:H(e,this.source.start)},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:typeof this.source.end.offset=="number"?this.source.end.offset:H(e,this.source.end)+1}:{column:s.column+1,line:s.line,offset:s.offset+1};if(t.word){let i=e.slice(H(e,this.source.start),H(e,this.source.end)).indexOf(t.word);i!==-1&&(s=this.positionInside(i),r=this.positionInside(i+t.word.length))}else t.start?s={column:t.start.column,line:t.start.line,offset:H(e,t.start)}:t.index&&(s=this.positionInside(t.index)),t.end?r={column:t.end.column,line:t.end.line,offset:H(e,t.end)}:typeof t.endIndex=="number"?r=this.positionInside(t.endIndex):t.index&&(r=this.positionInside(t.index+1));return(r.line<s.line||r.line===s.line&&r.column<=s.column)&&(r={column:s.column+1,line:s.line,offset:s.offset+1}),{end:r,start:s}}raw(t,e){return new no().raw(this,t,e)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...t){if(this.parent){let e=this,s=!1;for(let r of t)r===this?s=!0:s?(this.parent.insertAfter(e,r),e=r):this.parent.insertBefore(e,r);s||this.remove()}return this}root(){let t=this;for(;t.parent&&t.parent.type!=="document";)t=t.parent;return t}toJSON(t,e){let s={},r=e==null;e=e||new Map;let i=0;for(let o in this){if(!Object.prototype.hasOwnProperty.call(this,o)||o==="parent"||o==="proxyCache")continue;let a=this[o];if(Array.isArray(a))s[o]=a.map(n=>typeof n=="object"&&n.toJSON?n.toJSON(null,e):n);else if(typeof a=="object"&&a.toJSON)s[o]=a.toJSON(null,e);else if(o==="source"){if(a==null)continue;let n=e.get(a.input);n==null&&(n=i,e.set(a.input,i),i++),s[o]={end:a.end,inputId:n,start:a.start}}else s[o]=a}return r&&(s.inputs=[...e.keys()].map(o=>o.toJSON())),s}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(t=oo){t.stringify&&(t=t.stringify);let e="";return t(this,s=>{e+=s}),e}warn(t,e,s={}){let r={node:this};for(let i in s)r[i]=s[i];return t.warn(e,r)}};var bt=Xt;Xt.default=Xt;let lo=bt,Zt=class extends lo{constructor(t){super(t),this.type="comment"}};var vt=Zt;Zt.default=Zt;let co=bt,Ht=class extends co{get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}constructor(t){t&&typeof t.value<"u"&&typeof t.value!="string"&&(t=W(O({},t),{value:String(t.value)})),super(t),this.type="decl"}};var St=Ht;Ht.default=Ht;let ii=vt,ni=St,ho=bt,{isClean:oi,my:ai}=Ie,Cs,li,ci,Es;function hi(t){return t.map(e=>(e.nodes&&(e.nodes=hi(e.nodes)),delete e.source,e))}function ui(t){if(t[oi]=!1,t.proxyOf.nodes)for(let e of t.proxyOf.nodes)ui(e)}let J=class pi extends ho{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]}append(...e){for(let s of e){let r=this.normalize(s,this.last);for(let i of r)this.proxyOf.nodes.push(i)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let s of this.nodes)s.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let s=this.getIterator(),r,i;for(;this.indexes[s]<this.proxyOf.nodes.length&&(r=this.indexes[s],i=e(this.proxyOf.nodes[r],r),i!==!1);)this.indexes[s]+=1;return delete this.indexes[s],i}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get(e,s){return s==="proxyOf"?e:e[s]?s==="each"||typeof s=="string"&&s.startsWith("walk")?(...r)=>e[s](...r.map(i=>typeof i=="function"?(o,a)=>i(o.toProxy(),a):i)):s==="every"||s==="some"?r=>e[s]((i,...o)=>r(i.toProxy(),...o)):s==="root"?()=>e.root().toProxy():s==="nodes"?e.nodes.map(r=>r.toProxy()):s==="first"||s==="last"?e[s].toProxy():e[s]:e[s]},set(e,s,r){return e[s]===r||(e[s]=r,(s==="name"||s==="params"||s==="selector")&&e.markDirty()),!0}}}index(e){return typeof e=="number"?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,s){let r=this.index(e),i=this.normalize(s,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let a of i)this.proxyOf.nodes.splice(r+1,0,a);let o;for(let a in this.indexes)o=this.indexes[a],r<o&&(this.indexes[a]=o+i.length);return this.markDirty(),this}insertBefore(e,s){let r=this.index(e),i=r===0?"prepend":!1,o=this.normalize(s,this.proxyOf.nodes[r],i).reverse();r=this.index(e);for(let n of o)this.proxyOf.nodes.splice(r,0,n);let a;for(let n in this.indexes)a=this.indexes[n],r<=a&&(this.indexes[n]=a+o.length);return this.markDirty(),this}normalize(e,s){if(typeof e=="string")e=hi(li(e).nodes);else if(typeof e>"u")e=[];else if(Array.isArray(e)){e=e.slice(0);for(let r of e)r.parent&&r.parent.removeChild(r,"ignore")}else if(e.type==="root"&&this.type!=="document"){e=e.nodes.slice(0);for(let r of e)r.parent&&r.parent.removeChild(r,"ignore")}else if(e.type)e=[e];else if(e.prop){if(typeof e.value>"u")throw new Error("Value field is missed in node creation");typeof e.value!="string"&&(e.value=String(e.value)),e=[new ni(e)]}else if(e.selector||e.selectors)e=[new Es(e)];else if(e.name)e=[new Cs(e)];else if(e.text)e=[new ii(e)];else throw new Error("Unknown node type in node creation");return e.map(r=>(r[ai]||pi.rebuild(r),r=r.proxyOf,r.parent&&r.parent.removeChild(r),r[oi]&&ui(r),r.raws||(r.raws={}),typeof r.raws.before>"u"&&s&&typeof s.raws.before<"u"&&(r.raws.before=s.raws.before.replace(/\S/g,"")),r.parent=this.proxyOf,r))}prepend(...e){e=e.reverse();for(let s of e){let r=this.normalize(s,this.first,"prepend").reverse();for(let i of r)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+r.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let s;for(let r in this.indexes)s=this.indexes[r],s>=e&&(this.indexes[r]=s-1);return this.markDirty(),this}replaceValues(e,s,r){return r||(r=s,s={}),this.walkDecls(i=>{s.props&&!s.props.includes(i.prop)||s.fast&&!i.value.includes(s.fast)||(i.value=i.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((s,r)=>{let i;try{i=e(s,r)}catch(o){throw s.addToError(o)}return i!==!1&&s.walk&&(i=s.walk(e)),i})}walkAtRules(e,s){return s?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="atrule"&&e.test(r.name))return s(r,i)}):this.walk((r,i)=>{if(r.type==="atrule"&&r.name===e)return s(r,i)}):(s=e,this.walk((r,i)=>{if(r.type==="atrule")return s(r,i)}))}walkComments(e){return this.walk((s,r)=>{if(s.type==="comment")return e(s,r)})}walkDecls(e,s){return s?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="decl"&&e.test(r.prop))return s(r,i)}):this.walk((r,i)=>{if(r.type==="decl"&&r.prop===e)return s(r,i)}):(s=e,this.walk((r,i)=>{if(r.type==="decl")return s(r,i)}))}walkRules(e,s){return s?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="rule"&&e.test(r.selector))return s(r,i)}):this.walk((r,i)=>{if(r.type==="rule"&&r.selector===e)return s(r,i)}):(s=e,this.walk((r,i)=>{if(r.type==="rule")return s(r,i)}))}};J.registerParse=t=>{li=t};J.registerRule=t=>{Es=t};J.registerAtRule=t=>{Cs=t};J.registerRoot=t=>{ci=t};var te=J;J.default=J;J.rebuild=t=>{t.type==="atrule"?Object.setPrototypeOf(t,Cs.prototype):t.type==="rule"?Object.setPrototypeOf(t,Es.prototype):t.type==="decl"?Object.setPrototypeOf(t,ni.prototype):t.type==="comment"?Object.setPrototypeOf(t,ii.prototype):t.type==="root"&&Object.setPrototypeOf(t,ci.prototype),t[ai]=!0,t.nodes&&t.nodes.forEach(e=>{J.rebuild(e)})};let di=te,ot=class extends di{constructor(t){super(t),this.type="atrule"}append(...t){return this.proxyOf.nodes||(this.nodes=[]),super.append(...t)}prepend(...t){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...t)}};var Ms=ot;ot.default=ot;di.registerAtRule(ot);let uo=te,fi,mi,Me=class extends uo{constructor(t){super(O({type:"document"},t)),this.nodes||(this.nodes=[])}toResult(t={}){return new fi(new mi,this,t).stringify()}};Me.registerLazyResult=t=>{fi=t};Me.registerProcessor=t=>{mi=t};var Ns=Me;Me.default=Me;let po="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",fo=(t=21)=>{let e="",s=t|0;for(;s--;)e+=po[Math.random()*64|0];return e};var mo={nanoid:fo};let{existsSync:go,readFileSync:yo}=z,{dirname:Ot,join:wo}=z,{SourceMapConsumer:sr,SourceMapGenerator:rr}=z;function bo(t){return Buffer?Buffer.from(t,"base64").toString():window.atob(t)}let $t=class{constructor(t,e){if(e.map===!1)return;this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:");let s=e.map?e.map.prev:void 0,r=this.loadMap(e.from,s);!this.mapFile&&e.from&&(this.mapFile=e.from),this.mapFile&&(this.root=Ot(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new sr(this.text)),this.consumerCache}decodeInline(t){let e=/^data:application\/json;charset=utf-?8;base64,/,s=/^data:application\/json;base64,/,r=/^data:application\/json;charset=utf-?8,/,i=/^data:application\/json,/,o=t.match(r)||t.match(i);if(o)return decodeURIComponent(t.substr(o[0].length));let a=t.match(e)||t.match(s);if(a)return bo(t.substr(a[0].length));let n=t.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+n)}getAnnotationURL(t){return t.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(t){return typeof t!="object"?!1:typeof t.mappings=="string"||typeof t._mappings=="string"||Array.isArray(t.sections)}loadAnnotation(t){let e=t.match(/\/\*\s*# sourceMappingURL=/g);if(!e)return;let s=t.lastIndexOf(e.pop()),r=t.indexOf("*/",s);s>-1&&r>-1&&(this.annotation=this.getAnnotationURL(t.substring(s,r)))}loadFile(t){if(this.root=Ot(t),go(t))return this.mapFile=t,yo(t,"utf-8").toString().trim()}loadMap(t,e){if(e===!1)return!1;if(e){if(typeof e=="string")return e;if(typeof e=="function"){let s=e(t);if(s){let r=this.loadFile(s);if(!r)throw new Error("Unable to load previous source map: "+s.toString());return r}}else{if(e instanceof sr)return rr.fromSourceMap(e).toString();if(e instanceof rr)return e.toString();if(this.isMap(e))return JSON.stringify(e);throw new Error("Unsupported previous source map format: "+e.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let s=this.annotation;return t&&(s=wo(Ot(t),s)),this.loadFile(s)}}}startWith(t,e){return t?t.substr(0,e.length)===e:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var gi=$t;$t.default=$t;let{nanoid:vo}=mo,{isAbsolute:Jt,resolve:Qt}=z,{SourceMapConsumer:So,SourceMapGenerator:xo}=z,{fileURLToPath:ir,pathToFileURL:Ue}=z,nr=xs,Co=gi,At=z,It=Symbol("lineToIndexCache"),Eo=!!(So&&xo),or=!!(Qt&&Jt);function ar(t){if(t[It])return t[It];let e=t.css.split(`
22
+ `),s=new Array(e.length),r=0;for(let i=0,o=e.length;i<o;i++)s[i]=r,r+=e[i].length+1;return t[It]=s,s}let at=class{get from(){return this.file||this.id}constructor(t,e={}){if(t===null||typeof t>"u"||typeof t=="object"&&!t.toString)throw new Error(`PostCSS received ${t} instead of CSS string`);if(this.css=t.toString(),this.css[0]==="\uFEFF"||this.css[0]==="\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,e.document&&(this.document=e.document.toString()),e.from&&(!or||/^\w+:\/\//.test(e.from)||Jt(e.from)?this.file=e.from:this.file=Qt(e.from)),or&&Eo){let s=new Co(this.css,e);if(s.text){this.map=s;let r=s.consumer().file;!this.file&&r&&(this.file=this.mapResolve(r))}}this.file||(this.id="<input css "+vo(6)+">"),this.map&&(this.map.file=this.from)}error(t,e,s,r={}){let i,o,a,n,c;if(e&&typeof e=="object"){let h=e,u=s;if(typeof h.offset=="number"){n=h.offset;let p=this.fromOffset(n);e=p.line,s=p.col}else e=h.line,s=h.column,n=this.fromLineAndColumn(e,s);if(typeof u.offset=="number"){a=u.offset;let p=this.fromOffset(a);o=p.line,i=p.col}else o=u.line,i=u.column,a=this.fromLineAndColumn(u.line,u.column)}else if(s)n=this.fromLineAndColumn(e,s);else{n=e;let h=this.fromOffset(n);e=h.line,s=h.col}let l=this.origin(e,s,o,i);return l?c=new nr(t,l.endLine===void 0?l.line:{column:l.column,line:l.line},l.endLine===void 0?l.column:{column:l.endColumn,line:l.endLine},l.source,l.file,r.plugin):c=new nr(t,o===void 0?e:{column:s,line:e},o===void 0?s:{column:i,line:o},this.css,this.file,r.plugin),c.input={column:s,endColumn:i,endLine:o,endOffset:a,line:e,offset:n,source:this.css},this.file&&(Ue&&(c.input.url=Ue(this.file).toString()),c.input.file=this.file),c}fromLineAndColumn(t,e){return ar(this)[t-1]+e-1}fromOffset(t){let e=ar(this),s=e[e.length-1],r=0;if(t>=s)r=e.length-1;else{let i=e.length-2,o;for(;r<i;)if(o=r+(i-r>>1),t<e[o])i=o-1;else if(t>=e[o+1])r=o+1;else{r=o;break}}return{col:t-e[r]+1,line:r+1}}mapResolve(t){return/^\w+:\/\//.test(t)?t:Qt(this.map.consumer().sourceRoot||this.map.root||".",t)}origin(t,e,s,r){if(!this.map)return!1;let i=this.map.consumer(),o=i.originalPositionFor({column:e,line:t});if(!o.source)return!1;let a;typeof s=="number"&&(a=i.originalPositionFor({column:r,line:s}));let n;Jt(o.source)?n=Ue(o.source):n=new URL(o.source,this.map.consumer().sourceRoot||Ue(this.map.mapFile));let c={column:o.column,endColumn:a&&a.column,endLine:a&&a.line,line:o.line,url:n.toString()};if(n.protocol==="file:")if(ir)c.file=ir(n);else throw new Error("file: protocol is not available in this PostCSS build");let l=i.sourceContentFor(o.source);return l&&(c.source=l),c}toJSON(){let t={};for(let e of["hasBOM","css","file","id"])this[e]!=null&&(t[e]=this[e]);return this.map&&(t.map=O({},this.map),t.map.consumerCache&&(t.map.consumerCache=void 0)),t}};var xt=at;at.default=at;At&&At.registerInput&&At.registerInput(at);let yi=te,wi,bi,ae=class extends yi{constructor(t){super(t),this.type="root",this.nodes||(this.nodes=[])}normalize(t,e,s){let r=super.normalize(t);if(e){if(s==="prepend")this.nodes.length>1?e.raws.before=this.nodes[1].raws.before:delete e.raws.before;else if(this.first!==e)for(let i of r)i.raws.before=e.raws.before}return r}removeChild(t,e){let s=this.index(t);return!e&&s===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[s].raws.before),super.removeChild(t)}toResult(t={}){return new wi(new bi,this,t).stringify()}};ae.registerLazyResult=t=>{wi=t};ae.registerProcessor=t=>{bi=t};var Pe=ae;ae.default=ae;yi.registerRoot(ae);let Ne={comma(t){return Ne.split(t,[","],!0)},space(t){let e=[" ",`
23
+ `," "];return Ne.split(t,e)},split(t,e,s){let r=[],i="",o=!1,a=0,n=!1,c="",l=!1;for(let h of t)l?l=!1:h==="\\"?l=!0:n?h===c&&(n=!1):h==='"'||h==="'"?(n=!0,c=h):h==="("?a+=1:h===")"?a>0&&(a-=1):a===0&&e.includes(h)&&(o=!0),o?(i!==""&&r.push(i.trim()),i="",o=!1):i+=h;return(s||i!=="")&&r.push(i.trim()),r}};var vi=Ne;Ne.default=Ne;let Si=te,Mo=vi,lt=class extends Si{get selectors(){return Mo.comma(this.selector)}set selectors(t){let e=this.selector?this.selector.match(/,\s*/):null,s=e?e[0]:","+this.raw("between","beforeOpen");this.selector=t.join(s)}constructor(t){super(t),this.type="rule",this.nodes||(this.nodes=[])}};var Ts=lt;lt.default=lt;Si.registerRule(lt);let No=Ms,To=vt,ko=St,Do=xt,Ro=gi,Oo=Pe,Ao=Ts;function Te(t,e){if(Array.isArray(t))return t.map(a=>Te(a));let i=t,{inputs:s}=i,r=fe(i,["inputs"]);if(s){e=[];for(let a of s){let n=W(O({},a),{__proto__:Do.prototype});n.map&&(n.map=W(O({},n.map),{__proto__:Ro.prototype})),e.push(n)}}if(r.nodes&&(r.nodes=t.nodes.map(a=>Te(a,e))),r.source){let o=r.source,{inputId:a}=o,n=fe(o,["inputId"]);r.source=n,a!=null&&(r.source.input=e[a])}if(r.type==="root")return new Oo(r);if(r.type==="decl")return new ko(r);if(r.type==="rule")return new Ao(r);if(r.type==="comment")return new To(r);if(r.type==="atrule")return new No(r);throw new Error("Unknown node type: "+t.type)}var Io=Te;Te.default=Te;let{dirname:st,relative:xi,resolve:Ci,sep:Ei}=z,{SourceMapConsumer:Mi,SourceMapGenerator:rt}=z,{pathToFileURL:lr}=z,Po=xt,Lo=!!(Mi&&rt),Fo=!!(st&&Ci&&xi&&Ei),_o=class{constructor(t,e,s,r){this.stringify=t,this.mapOpts=s.map||{},this.root=e,this.opts=s,this.css=r,this.originalCSS=r,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let t;this.isInline()?t="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?t=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?t=this.mapOpts.annotation(this.opts.to,this.root):t=this.outputFile()+".map";let e=`
24
24
  `;this.css.includes(`\r
25
25
  `)&&(e=`\r
26
- `),this.css+=e+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let e=this.toUrl(this.path(t.file)),s=t.root||tt(t.file),r;this.mapOpts.sourcesContent===!1?(r=new xi(t.text),r.sourcesContent&&(r.sourcesContent=null)):r=t.consumer(),this.map.applySourceMap(r,e,this.toUrl(this.path(s)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let t;for(let e=this.root.nodes.length-1;e>=0;e--)t=this.root.nodes[e],t.type==="comment"&&t.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(e)}else this.css&&(this.css=this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),Io&&Ao&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,e=>{t+=e}),[t]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let t=this.previous()[0].consumer();t.file=this.outputFile(),this.map=st.fromSourceMap(t,{ignoreInvalidMapping:!0})}else this.map=new st({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 st({file:this.outputFile(),ignoreInvalidMapping:!0});let t=1,e=1,s="<no source>",r={generated:{column:0,line:0},original:{column:0,line:0},source:""},i,o;this.stringify(this.root,(a,n,l)=>{if(this.css+=a,n&&l!=="end"&&(r.generated.line=t,r.generated.column=e-1,n.source&&n.source.start?(r.source=this.sourcePath(n),r.original.line=n.source.start.line,r.original.column=n.source.start.column-1,this.map.addMapping(r)):(r.source=s,r.original.line=1,r.original.column=0,this.map.addMapping(r))),o=a.match(/\n/g),o?(t+=o.length,i=a.lastIndexOf(`
27
- `),e=a.length-i):e+=a.length,n&&l!=="start"){let c=n.parent||{raws:{}};(!(n.type==="decl"||n.type==="atrule"&&!n.nodes)||n!==c.last||c.raws.semicolon)&&(n.source&&n.source.end?(r.source=this.sourcePath(n),r.original.line=n.source.end.line,r.original.column=n.source.end.column-1,r.generated.line=t,r.generated.column=e-2,this.map.addMapping(r)):(r.source=s,r.original.line=1,r.original.column=0,r.generated.line=t,r.generated.column=e-1,this.map.addMapping(r)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(t=>t.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let t=this.mapOpts.annotation;return typeof t<"u"&&t!==!0?!1:this.previous().length?this.previous().some(e=>e.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(t=>t.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(t){if(this.mapOpts.absolute||t.charCodeAt(0)===60||/^\w+:\/\//.test(t))return t;let e=this.memoizedPaths.get(t);if(e)return e;let s=this.opts.to?tt(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(s=tt(vi(s,this.mapOpts.annotation)));let r=bi(s,t);return this.memoizedPaths.set(t,r),r}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(t=>{if(t.source&&t.source.input.map){let e=t.source.input.map;this.previousMaps.includes(e)||this.previousMaps.push(e)}});else{let t=new Oo(this.originalCSS,this.opts);t.map&&this.previousMaps.push(t.map)}return this.previousMaps}setSourcesContent(){let t={};if(this.root)this.root.walk(e=>{if(e.source){let s=e.source.input.from;if(s&&!t[s]){t[s]=!0;let r=this.usesFileUrls?this.toFileUrl(s):this.toUrl(this.path(s));this.map.setSourceContent(r,e.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(t){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(t.source.input.from):this.toUrl(this.path(t.source.input.from))}toBase64(t){return Buffer?Buffer.from(t).toString("base64"):window.btoa(unescape(encodeURIComponent(t)))}toFileUrl(t){let e=this.memoizedFileURLs.get(t);if(e)return e;if(or){let s=or(t).toString();return this.memoizedFileURLs.set(t,s),s}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(t){let e=this.memoizedURLs.get(t);if(e)return e;Si==="\\"&&(t=t.replace(/\\/g,"/"));let s=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,s),s}};var Ci=Po;const It=39,ar=34,Ue=92,lr=47,Be=10,me=32,We=12,je=9,Ve=13,Lo=91,Fo=93,_o=40,Uo=41,Bo=123,Wo=125,jo=59,Vo=42,zo=58,Yo=64,ze=/[\t\n\f\r "#'()/;[\\\]{}]/g,Ye=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Go=/.[\r\n"'(/\\]/,cr=/[\da-f]/i;var Xo=function(t,e={}){let s=t.css.valueOf(),r=e.ignoreErrors,i,o,a,n,l,c,h,u,p,m,b=s.length,d=0,S=[],f=[];function w(){return d}function g(F){throw t.error("Unclosed "+F,d)}function x(){return f.length===0&&d>=b}function P(F){if(f.length)return f.pop();if(d>=b)return;let V=F?F.ignoreUnclosed:!1;switch(i=s.charCodeAt(d),i){case Be:case me:case je:case Ve:case We:{n=d;do n+=1,i=s.charCodeAt(n);while(i===me||i===Be||i===je||i===Ve||i===We);c=["space",s.slice(d,n)],d=n-1;break}case Lo:case Fo:case Bo:case Wo:case zo:case jo:case Uo:{let K=String.fromCharCode(i);c=[K,K,d];break}case _o:{if(m=S.length?S.pop()[1]:"",p=s.charCodeAt(d+1),m==="url"&&p!==It&&p!==ar&&p!==me&&p!==Be&&p!==je&&p!==We&&p!==Ve){n=d;do{if(h=!1,n=s.indexOf(")",n+1),n===-1)if(r||V){n=d;break}else g("bracket");for(u=n;s.charCodeAt(u-1)===Ue;)u-=1,h=!h}while(h);c=["brackets",s.slice(d,n+1),d,n],d=n}else n=s.indexOf(")",d+1),o=s.slice(d,n+1),n===-1||Go.test(o)?c=["(","(",d]:(c=["brackets",o,d,n],d=n);break}case It:case ar:{l=i===It?"'":'"',n=d;do{if(h=!1,n=s.indexOf(l,n+1),n===-1)if(r||V){n=d+1;break}else g("string");for(u=n;s.charCodeAt(u-1)===Ue;)u-=1,h=!h}while(h);c=["string",s.slice(d,n+1),d,n],d=n;break}case Yo:{ze.lastIndex=d+1,ze.test(s),ze.lastIndex===0?n=s.length-1:n=ze.lastIndex-2,c=["at-word",s.slice(d,n+1),d,n],d=n;break}case Ue:{for(n=d,a=!0;s.charCodeAt(n+1)===Ue;)n+=1,a=!a;if(i=s.charCodeAt(n+1),a&&i!==lr&&i!==me&&i!==Be&&i!==je&&i!==Ve&&i!==We&&(n+=1,cr.test(s.charAt(n)))){for(;cr.test(s.charAt(n+1));)n+=1;s.charCodeAt(n+1)===me&&(n+=1)}c=["word",s.slice(d,n+1),d,n],d=n;break}default:{i===lr&&s.charCodeAt(d+1)===Vo?(n=s.indexOf("*/",d+2)+1,n===0&&(r||V?n=s.length:g("comment")),c=["comment",s.slice(d,n+1),d,n],d=n):(Ye.lastIndex=d+1,Ye.test(s),Ye.lastIndex===0?n=s.length-1:n=Ye.lastIndex-2,c=["word",s.slice(d,n+1),d,n],S.push(c),d=n);break}}return d++,c}function B(F){f.push(F)}return{back:B,endOfFile:x,nextToken:P,position:w}};let Zo=Es,Ho=bt,Jo=vt,$o=Ie,hr=Ns,Qo=Xo;const ur={empty:!0,space:!0};function Ko(t){for(let e=t.length-1;e>=0;e--){let s=t[e],r=s[3]||s[2];if(r)return r}}let qo=class{constructor(t){this.input=t,this.root=new $o,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{column:1,line:1,offset:0}}}atrule(t){let e=new Zo;e.name=t[1].slice(1),e.name===""&&this.unnamedAtrule(e,t),this.init(e,t[2]);let s,r,i,o=!1,a=!1,n=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=this.tokenizer.nextToken(),s=t[0],s==="("||s==="["?l.push(s==="("?")":"]"):s==="{"&&l.length>0?l.push("}"):s===l[l.length-1]&&l.pop(),l.length===0)if(s===";"){e.source.end=this.getPosition(t[2]),e.source.end.offset++,this.semicolon=!0;break}else if(s==="{"){a=!0;break}else if(s==="}"){if(n.length>0){for(i=n.length-1,r=n[i];r&&r[0]==="space";)r=n[--i];r&&(e.source.end=this.getPosition(r[3]||r[2]),e.source.end.offset++)}this.end(t);break}else n.push(t);else n.push(t);if(this.tokenizer.endOfFile()){o=!0;break}}e.raws.between=this.spacesAndCommentsFromEnd(n),n.length?(e.raws.afterName=this.spacesAndCommentsFromStart(n),this.raw(e,"params",n),o&&(t=n[n.length-1],e.source.end=this.getPosition(t[3]||t[2]),e.source.end.offset++,this.spaces=e.raws.between,e.raws.between="")):(e.raws.afterName="",e.params=""),a&&(e.nodes=[],this.current=e)}checkMissedSemicolon(t){let e=this.colon(t);if(e===!1)return;let s=0,r;for(let i=e-1;i>=0&&(r=t[i],!(r[0]!=="space"&&(s+=1,s===2)));i--);throw this.input.error("Missed semicolon",r[0]==="word"?r[3]+1:r[2])}colon(t){let e=0,s,r,i;for(let[o,a]of t.entries()){if(r=a,i=r[0],i==="("&&(e+=1),i===")"&&(e-=1),e===0&&i===":")if(!s)this.doubleColon(r);else{if(s[0]==="word"&&s[1]==="progid")continue;return o}s=r}return!1}comment(t){let e=new Ho;this.init(e,t[2]),e.source.end=this.getPosition(t[3]||t[2]),e.source.end.offset++;let s=t[1].slice(2,-2);if(/^\s*$/.test(s))e.text="",e.raws.left=s,e.raws.right="";else{let r=s.match(/^(\s*)([^]*\S)(\s*)$/);e.text=r[2],e.raws.left=r[1],e.raws.right=r[3]}}createTokenizer(){this.tokenizer=Qo(this.input)}decl(t,e){let s=new Jo;this.init(s,t[0][2]);let r=t[t.length-1];for(r[0]===";"&&(this.semicolon=!0,t.pop()),s.source.end=this.getPosition(r[3]||r[2]||Ko(t)),s.source.end.offset++;t[0][0]!=="word";)t.length===1&&this.unknownWord(t),s.raws.before+=t.shift()[1];for(s.source.start=this.getPosition(t[0][2]),s.prop="";t.length;){let n=t[0][0];if(n===":"||n==="space"||n==="comment")break;s.prop+=t.shift()[1]}s.raws.between="";let i;for(;t.length;)if(i=t.shift(),i[0]===":"){s.raws.between+=i[1];break}else i[0]==="word"&&/\w/.test(i[1])&&this.unknownWord([i]),s.raws.between+=i[1];(s.prop[0]==="_"||s.prop[0]==="*")&&(s.raws.before+=s.prop[0],s.prop=s.prop.slice(1));let o=[],a;for(;t.length&&(a=t[0][0],!(a!=="space"&&a!=="comment"));)o.push(t.shift());this.precheckMissedSemicolon(t);for(let n=t.length-1;n>=0;n--){if(i=t[n],i[1].toLowerCase()==="!important"){s.important=!0;let l=this.stringFrom(t,n);l=this.spacesFromEnd(t)+l,l!==" !important"&&(s.raws.important=l);break}else if(i[1].toLowerCase()==="important"){let l=t.slice(0),c="";for(let h=n;h>0;h--){let u=l[h][0];if(c.trim().startsWith("!")&&u!=="space")break;c=l.pop()[1]+c}c.trim().startsWith("!")&&(s.important=!0,s.raws.important=c,t=l)}if(i[0]!=="space"&&i[0]!=="comment")break}t.some(n=>n[0]!=="space"&&n[0]!=="comment")&&(s.raws.between+=o.map(n=>n[1]).join(""),o=[]),this.raw(s,"value",o.concat(t),e),s.value.includes(":")&&!e&&this.checkMissedSemicolon(t)}doubleColon(t){throw this.input.error("Double colon",{offset:t[2]},{offset:t[2]+t[1].length})}emptyRule(t){let e=new hr;this.init(e,t[2]),e.selector="",e.raws.between="",this.current=e}end(t){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(t[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(t)}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(t){if(this.spaces+=t[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&e.type==="rule"&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="",e.source.end=this.getPosition(t[2]),e.source.end.offset+=e.raws.ownSemicolon.length)}}getPosition(t){let e=this.input.fromOffset(t);return{column:e.col,line:e.line,offset:t}}init(t,e){this.current.push(t),t.source={input:this.input,start:this.getPosition(e)},t.raws.before=this.spaces,this.spaces="",t.type!=="comment"&&(this.semicolon=!1)}other(t){let e=!1,s=null,r=!1,i=null,o=[],a=t[1].startsWith("--"),n=[],l=t;for(;l;){if(s=l[0],n.push(l),s==="("||s==="[")i||(i=l),o.push(s==="("?")":"]");else if(a&&r&&s==="{")i||(i=l),o.push("}");else if(o.length===0)if(s===";")if(r){this.decl(n,a);return}else break;else if(s==="{"){this.rule(n);return}else if(s==="}"){this.tokenizer.back(n.pop()),e=!0;break}else s===":"&&(r=!0);else s===o[o.length-1]&&(o.pop(),o.length===0&&(i=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(e=!0),o.length>0&&this.unclosedBracket(i),e&&r){if(!a)for(;n.length&&(l=n[n.length-1][0],!(l!=="space"&&l!=="comment"));)this.tokenizer.back(n.pop());this.decl(n,a)}else this.unknownWord(n)}parse(){let t;for(;!this.tokenizer.endOfFile();)switch(t=this.tokenizer.nextToken(),t[0]){case"space":this.spaces+=t[1];break;case";":this.freeSemicolon(t);break;case"}":this.end(t);break;case"comment":this.comment(t);break;case"at-word":this.atrule(t);break;case"{":this.emptyRule(t);break;default:this.other(t);break}this.endFile()}precheckMissedSemicolon(){}raw(t,e,s,r){let i,o,a=s.length,n="",l=!0,c,h;for(let u=0;u<a;u+=1)i=s[u],o=i[0],o==="space"&&u===a-1&&!r?l=!1:o==="comment"?(h=s[u-1]?s[u-1][0]:"empty",c=s[u+1]?s[u+1][0]:"empty",!ur[h]&&!ur[c]?n.slice(-1)===","?l=!1:n+=i[1]:l=!1):n+=i[1];if(!l){let u=s.reduce((p,m)=>p+m[1],"");t.raws[e]={raw:u,value:n}}t[e]=n}rule(t){t.pop();let e=new hr;this.init(e,t[0][2]),e.raws.between=this.spacesAndCommentsFromEnd(t),this.raw(e,"selector",t),this.current=e}spacesAndCommentsFromEnd(t){let e,s="";for(;t.length&&(e=t[t.length-1][0],!(e!=="space"&&e!=="comment"));)s=t.pop()[1]+s;return s}spacesAndCommentsFromStart(t){let e,s="";for(;t.length&&(e=t[0][0],!(e!=="space"&&e!=="comment"));)s+=t.shift()[1];return s}spacesFromEnd(t){let e,s="";for(;t.length&&(e=t[t.length-1][0],e==="space");)s=t.pop()[1]+s;return s}stringFrom(t,e){let s="";for(let r=e;r<t.length;r++)s+=t[r][1];return t.splice(e,t.length-e),s}unclosedBlock(){let t=this.current.source.start;throw this.input.error("Unclosed block",t.line,t.column)}unclosedBracket(t){throw this.input.error("Unclosed bracket",{offset:t[2]},{offset:t[2]+1})}unexpectedClose(t){throw this.input.error("Unexpected }",{offset:t[2]},{offset:t[2]+1})}unknownWord(t){throw this.input.error("Unknown word "+t[0][1],{offset:t[0][2]},{offset:t[0][2]+t[0][1].length})}unnamedAtrule(t,e){throw this.input.error("At-rule without name",{offset:e[2]},{offset:e[2]+e[1].length})}};var ea=qo;let ta=q,sa=St,ra=ea;function lt(t,e){let s=new sa(t,e),r=new ra(s);try{r.parse()}catch(i){throw i}return r.root}var Ts=lt;lt.default=lt;ta.registerParse(lt);let Qt=class{constructor(t,e={}){if(this.type="warning",this.text=t,e.node&&e.node.source){let s=e.node.rangeBy(e);this.line=s.start.line,this.column=s.start.column,this.endLine=s.end.line,this.endColumn=s.end.column}for(let s in e)this[s]=e[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}};var Ei=Qt;Qt.default=Qt;let ia=Ei,Kt=class{get content(){return this.css}constructor(t,e,s){this.processor=t,this.messages=[],this.root=e,this.opts=s,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,e={}){e.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(e.plugin=this.lastPlugin.postcssPlugin);let s=new ia(t,e);return this.messages.push(s),s}warnings(){return this.messages.filter(t=>t.type==="warning")}};var ks=Kt;Kt.default=Kt;let na=q,oa=Ms,aa=Ci,la=Ts,pr=ks,ca=Ie,ha=yt,{isClean:G,my:ua}=Ae;const pa={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},da={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},fa={Once:!0,postcssPlugin:!0,prepare:!0},oe=0;function ge(t){return typeof t=="object"&&typeof t.then=="function"}function Mi(t){let e=!1,s=pa[t.type];return t.type==="decl"?e=t.prop.toLowerCase():t.type==="atrule"&&(e=t.name.toLowerCase()),e&&t.append?[s,s+"-"+e,oe,s+"Exit",s+"Exit-"+e]:e?[s,s+"-"+e,s+"Exit",s+"Exit-"+e]:t.append?[s,oe,s+"Exit"]:[s,s+"Exit"]}function dr(t){let e;return t.type==="document"?e=["Document",oe,"DocumentExit"]:t.type==="root"?e=["Root",oe,"RootExit"]:e=Mi(t),{eventIndex:0,events:e,iterator:0,node:t,visitorIndex:0,visitors:[]}}function qt(t){return t[G]=!1,t.nodes&&t.nodes.forEach(e=>qt(e)),t}let es={},ae=class Ni{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"}constructor(e,s,r){this.stringified=!1,this.processed=!1;let i;if(typeof s=="object"&&s!==null&&(s.type==="root"||s.type==="document"))i=qt(s);else if(s instanceof Ni||s instanceof pr)i=qt(s.root),s.map&&(typeof r.map>"u"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=s.map);else{let o=la;r.syntax&&(o=r.syntax.parse),r.parser&&(o=r.parser),o.parse&&(o=o.parse);try{i=o(s,r)}catch(a){this.processed=!0,this.error=a}i&&!i[ua]&&na.rebuild(i)}this.result=new pr(e,i,r),this.helpers=W(O({},es),{postcss:es,result:this.result}),this.plugins=this.processor.plugins.map(o=>typeof o=="object"&&o.prepare?O(O({},o),o.prepare(this.result)):o)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,s){let r=this.result.lastPlugin;try{s&&s.addToError(e),this.error=e,e.name==="CssSyntaxError"&&!e.plugin?(e.plugin=r.postcssPlugin,e.setMessage()):r.postcssVersion}catch(i){console&&console.error&&console.error(i)}return e}prepareVisitors(){this.listeners={};let e=(s,r,i)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([s,i])};for(let s of this.plugins)if(typeof s=="object")for(let r in s){if(!da[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${s.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!fa[r])if(typeof s[r]=="object")for(let i in s[r])i==="*"?e(s,r,s[r][i]):e(s,r+"-"+i.toLowerCase(),s[r][i]);else typeof s[r]=="function"&&e(s,r,s[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let s=this.plugins[e],r=this.runOnRoot(s);if(ge(r))try{await r}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[G];){e[G]=!0;let s=[dr(e)];for(;s.length>0;){let r=this.visitTick(s);if(ge(r))try{await r}catch(i){let o=s[s.length-1].node;throw this.handleError(i,o)}}}if(this.listeners.OnceExit)for(let[s,r]of this.listeners.OnceExit){this.result.lastPlugin=s;try{if(e.type==="document"){let i=e.nodes.map(o=>r(o,this.helpers));await Promise.all(i)}else await r(e,this.helpers)}catch(i){throw this.handleError(i)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if(typeof e=="object"&&e.Once){if(this.result.root.type==="document"){let s=this.result.root.nodes.map(r=>e.Once(r,this.helpers));return ge(s[0])?Promise.all(s):s}return e.Once(this.result.root,this.helpers)}else if(typeof e=="function")return e(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 e=this.result.opts,s=ha;e.syntax&&(s=e.syntax.stringify),e.stringifier&&(s=e.stringifier),s.stringify&&(s=s.stringify);let r=new aa(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 e of this.plugins){let s=this.runOnRoot(e);if(ge(s))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[G];)e[G]=!0,this.walkSync(e);if(this.listeners.OnceExit)if(e.type==="document")for(let s of e.nodes)this.visitSync(this.listeners.OnceExit,s);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,s){return this.async().then(e,s)}toString(){return this.css}visitSync(e,s){for(let[r,i]of e){this.result.lastPlugin=r;let o;try{o=i(s,this.helpers)}catch(a){throw this.handleError(a,s.proxyOf)}if(s.type!=="root"&&s.type!=="document"&&!s.parent)return!0;if(ge(o))throw this.getAsyncError()}}visitTick(e){let s=e[e.length-1],{node:r,visitors:i}=s;if(r.type!=="root"&&r.type!=="document"&&!r.parent){e.pop();return}if(i.length>0&&s.visitorIndex<i.length){let[a,n]=i[s.visitorIndex];s.visitorIndex+=1,s.visitorIndex===i.length&&(s.visitors=[],s.visitorIndex=0),this.result.lastPlugin=a;try{return n(r.toProxy(),this.helpers)}catch(l){throw this.handleError(l,r)}}if(s.iterator!==0){let a=s.iterator,n;for(;n=r.nodes[r.indexes[a]];)if(r.indexes[a]+=1,!n[G]){n[G]=!0,e.push(dr(n));return}s.iterator=0,delete r.indexes[a]}let o=s.events;for(;s.eventIndex<o.length;){let a=o[s.eventIndex];if(s.eventIndex+=1,a===oe){r.nodes&&r.nodes.length&&(r[G]=!0,s.iterator=r.getIterator());return}else if(this.listeners[a]){s.visitors=this.listeners[a];return}}e.pop()}walkSync(e){e[G]=!0;let s=Mi(e);for(let r of s)if(r===oe)e.nodes&&e.each(i=>{i[G]||this.walkSync(i)});else{let i=this.listeners[r];if(i&&this.visitSync(i,e.toProxy()))return}}warnings(){return this.sync().warnings()}};ae.registerPostcss=t=>{es=t};var Ti=ae;ae.default=ae;ca.registerLazyResult(ae);oa.registerLazyResult(ae);let ma=Ci,ga=Ts;const ya=ks;let wa=yt;let ts=class{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 t,e=ga;try{t=e(this._css,this._opts)}catch(s){this.error=s}if(this.error)throw this.error;return this._root=t,t}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(t,e,s){e=e.toString(),this.stringified=!1,this._processor=t,this._css=e,this._opts=s,this._map=void 0;let r,i=wa;this.result=new ya(this._processor,r,this._opts),this.result.css=e;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let a=new ma(i,r,this._opts,e);if(a.isMap()){let[n,l]=a.generate();n&&(this.result.css=n),l&&(this.result.map=l)}else a.clearAnnotation(),this.result.css=a.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}sync(){if(this.error)throw this.error;return this.result}then(t,e){return this.async().then(t,e)}toString(){return this._css}warnings(){return[]}};var ba=ts;ts.default=ts;let va=Ms,Sa=Ti,xa=ba,Ca=Ie,Te=class{constructor(t=[]){this.version="8.5.3",this.plugins=this.normalize(t)}normalize(t){let e=[];for(let s of t)if(s.postcss===!0?s=s():s.postcss&&(s=s.postcss),typeof s=="object"&&Array.isArray(s.plugins))e=e.concat(s.plugins);else if(typeof s=="object"&&s.postcssPlugin)e.push(s);else if(typeof s=="function")e.push(s);else if(!(typeof s=="object"&&(s.parse||s.stringify)))throw new Error(s+" is not a PostCSS plugin");return e}process(t,e={}){return!this.plugins.length&&!e.parser&&!e.stringifier&&!e.syntax?new xa(this,t,e):new Sa(this,t,e)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}};var Ea=Te;Te.default=Te;Ca.registerProcessor(Te);va.registerProcessor(Te);let ki=Es,Di=bt,Ma=q,Na=Ss,Ri=vt,Oi=Ms,Ta=Ro,ka=St,Da=Ti,Ra=yi,Oa=wt,Aa=Ts,Ds=Ea,Ia=ks,Ai=Ie,Ii=Ns,Pa=yt,La=Ei;function k(...t){return t.length===1&&Array.isArray(t[0])&&(t=t[0]),new Ds(t)}k.plugin=function(t,e){let s=!1;function r(...o){console&&console.warn&&!s&&(s=!0,console.warn(t+`: postcss.plugin was deprecated. Migration guide:
26
+ `),this.css+=e+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let e=this.toUrl(this.path(t.file)),s=t.root||st(t.file),r;this.mapOpts.sourcesContent===!1?(r=new Mi(t.text),r.sourcesContent&&(r.sourcesContent=null)):r=t.consumer(),this.map.applySourceMap(r,e,this.toUrl(this.path(s)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let t;for(let e=this.root.nodes.length-1;e>=0;e--)t=this.root.nodes[e],t.type==="comment"&&t.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(e)}else this.css&&(this.css=this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),Fo&&Lo&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,e=>{t+=e}),[t]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let t=this.previous()[0].consumer();t.file=this.outputFile(),this.map=rt.fromSourceMap(t,{ignoreInvalidMapping:!0})}else this.map=new rt({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 rt({file:this.outputFile(),ignoreInvalidMapping:!0});let t=1,e=1,s="<no source>",r={generated:{column:0,line:0},original:{column:0,line:0},source:""},i,o;this.stringify(this.root,(a,n,c)=>{if(this.css+=a,n&&c!=="end"&&(r.generated.line=t,r.generated.column=e-1,n.source&&n.source.start?(r.source=this.sourcePath(n),r.original.line=n.source.start.line,r.original.column=n.source.start.column-1,this.map.addMapping(r)):(r.source=s,r.original.line=1,r.original.column=0,this.map.addMapping(r))),o=a.match(/\n/g),o?(t+=o.length,i=a.lastIndexOf(`
27
+ `),e=a.length-i):e+=a.length,n&&c!=="start"){let l=n.parent||{raws:{}};(!(n.type==="decl"||n.type==="atrule"&&!n.nodes)||n!==l.last||l.raws.semicolon)&&(n.source&&n.source.end?(r.source=this.sourcePath(n),r.original.line=n.source.end.line,r.original.column=n.source.end.column-1,r.generated.line=t,r.generated.column=e-2,this.map.addMapping(r)):(r.source=s,r.original.line=1,r.original.column=0,r.generated.line=t,r.generated.column=e-1,this.map.addMapping(r)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(t=>t.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let t=this.mapOpts.annotation;return typeof t<"u"&&t!==!0?!1:this.previous().length?this.previous().some(e=>e.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(t=>t.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(t){if(this.mapOpts.absolute||t.charCodeAt(0)===60||/^\w+:\/\//.test(t))return t;let e=this.memoizedPaths.get(t);if(e)return e;let s=this.opts.to?st(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(s=st(Ci(s,this.mapOpts.annotation)));let r=xi(s,t);return this.memoizedPaths.set(t,r),r}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(t=>{if(t.source&&t.source.input.map){let e=t.source.input.map;this.previousMaps.includes(e)||this.previousMaps.push(e)}});else{let t=new Po(this.originalCSS,this.opts);t.map&&this.previousMaps.push(t.map)}return this.previousMaps}setSourcesContent(){let t={};if(this.root)this.root.walk(e=>{if(e.source){let s=e.source.input.from;if(s&&!t[s]){t[s]=!0;let r=this.usesFileUrls?this.toFileUrl(s):this.toUrl(this.path(s));this.map.setSourceContent(r,e.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(t){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(t.source.input.from):this.toUrl(this.path(t.source.input.from))}toBase64(t){return Buffer?Buffer.from(t).toString("base64"):window.btoa(unescape(encodeURIComponent(t)))}toFileUrl(t){let e=this.memoizedFileURLs.get(t);if(e)return e;if(lr){let s=lr(t).toString();return this.memoizedFileURLs.set(t,s),s}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(t){let e=this.memoizedURLs.get(t);if(e)return e;Ei==="\\"&&(t=t.replace(/\\/g,"/"));let s=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,s),s}};var Ni=_o;const Pt=39,cr=34,Be=92,hr=47,We=10,ge=32,je=12,Ve=9,ze=13,Uo=91,Bo=93,Wo=40,jo=41,Vo=123,zo=125,Yo=59,Go=42,Xo=58,Zo=64,Ye=/[\t\n\f\r "#'()/;[\\\]{}]/g,Ge=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Ho=/.[\r\n"'(/\\]/,ur=/[\da-f]/i;var $o=function(t,e={}){let s=t.css.valueOf(),r=e.ignoreErrors,i,o,a,n,c,l,h,u,p,m,b=s.length,d=0,S=[],f=[];function w(){return d}function g(F){throw t.error("Unclosed "+F,d)}function x(){return f.length===0&&d>=b}function P(F){if(f.length)return f.pop();if(d>=b)return;let V=F?F.ignoreUnclosed:!1;switch(i=s.charCodeAt(d),i){case We:case ge:case Ve:case ze:case je:{n=d;do n+=1,i=s.charCodeAt(n);while(i===ge||i===We||i===Ve||i===ze||i===je);l=["space",s.slice(d,n)],d=n-1;break}case Uo:case Bo:case Vo:case zo:case Xo:case Yo:case jo:{let ee=String.fromCharCode(i);l=[ee,ee,d];break}case Wo:{if(m=S.length?S.pop()[1]:"",p=s.charCodeAt(d+1),m==="url"&&p!==Pt&&p!==cr&&p!==ge&&p!==We&&p!==Ve&&p!==je&&p!==ze){n=d;do{if(h=!1,n=s.indexOf(")",n+1),n===-1)if(r||V){n=d;break}else g("bracket");for(u=n;s.charCodeAt(u-1)===Be;)u-=1,h=!h}while(h);l=["brackets",s.slice(d,n+1),d,n],d=n}else n=s.indexOf(")",d+1),o=s.slice(d,n+1),n===-1||Ho.test(o)?l=["(","(",d]:(l=["brackets",o,d,n],d=n);break}case Pt:case cr:{c=i===Pt?"'":'"',n=d;do{if(h=!1,n=s.indexOf(c,n+1),n===-1)if(r||V){n=d+1;break}else g("string");for(u=n;s.charCodeAt(u-1)===Be;)u-=1,h=!h}while(h);l=["string",s.slice(d,n+1),d,n],d=n;break}case Zo:{Ye.lastIndex=d+1,Ye.test(s),Ye.lastIndex===0?n=s.length-1:n=Ye.lastIndex-2,l=["at-word",s.slice(d,n+1),d,n],d=n;break}case Be:{for(n=d,a=!0;s.charCodeAt(n+1)===Be;)n+=1,a=!a;if(i=s.charCodeAt(n+1),a&&i!==hr&&i!==ge&&i!==We&&i!==Ve&&i!==ze&&i!==je&&(n+=1,ur.test(s.charAt(n)))){for(;ur.test(s.charAt(n+1));)n+=1;s.charCodeAt(n+1)===ge&&(n+=1)}l=["word",s.slice(d,n+1),d,n],d=n;break}default:{i===hr&&s.charCodeAt(d+1)===Go?(n=s.indexOf("*/",d+2)+1,n===0&&(r||V?n=s.length:g("comment")),l=["comment",s.slice(d,n+1),d,n],d=n):(Ge.lastIndex=d+1,Ge.test(s),Ge.lastIndex===0?n=s.length-1:n=Ge.lastIndex-2,l=["word",s.slice(d,n+1),d,n],S.push(l),d=n);break}}return d++,l}function B(F){f.push(F)}return{back:B,endOfFile:x,nextToken:P,position:w}};let Jo=Ms,Qo=vt,Ko=St,qo=Pe,pr=Ts,ea=$o;const dr={empty:!0,space:!0};function ta(t){for(let e=t.length-1;e>=0;e--){let s=t[e],r=s[3]||s[2];if(r)return r}}let sa=class{constructor(t){this.input=t,this.root=new qo,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{column:1,line:1,offset:0}}}atrule(t){let e=new Jo;e.name=t[1].slice(1),e.name===""&&this.unnamedAtrule(e,t),this.init(e,t[2]);let s,r,i,o=!1,a=!1,n=[],c=[];for(;!this.tokenizer.endOfFile();){if(t=this.tokenizer.nextToken(),s=t[0],s==="("||s==="["?c.push(s==="("?")":"]"):s==="{"&&c.length>0?c.push("}"):s===c[c.length-1]&&c.pop(),c.length===0)if(s===";"){e.source.end=this.getPosition(t[2]),e.source.end.offset++,this.semicolon=!0;break}else if(s==="{"){a=!0;break}else if(s==="}"){if(n.length>0){for(i=n.length-1,r=n[i];r&&r[0]==="space";)r=n[--i];r&&(e.source.end=this.getPosition(r[3]||r[2]),e.source.end.offset++)}this.end(t);break}else n.push(t);else n.push(t);if(this.tokenizer.endOfFile()){o=!0;break}}e.raws.between=this.spacesAndCommentsFromEnd(n),n.length?(e.raws.afterName=this.spacesAndCommentsFromStart(n),this.raw(e,"params",n),o&&(t=n[n.length-1],e.source.end=this.getPosition(t[3]||t[2]),e.source.end.offset++,this.spaces=e.raws.between,e.raws.between="")):(e.raws.afterName="",e.params=""),a&&(e.nodes=[],this.current=e)}checkMissedSemicolon(t){let e=this.colon(t);if(e===!1)return;let s=0,r;for(let i=e-1;i>=0&&(r=t[i],!(r[0]!=="space"&&(s+=1,s===2)));i--);throw this.input.error("Missed semicolon",r[0]==="word"?r[3]+1:r[2])}colon(t){let e=0,s,r,i;for(let[o,a]of t.entries()){if(r=a,i=r[0],i==="("&&(e+=1),i===")"&&(e-=1),e===0&&i===":")if(!s)this.doubleColon(r);else{if(s[0]==="word"&&s[1]==="progid")continue;return o}s=r}return!1}comment(t){let e=new Qo;this.init(e,t[2]),e.source.end=this.getPosition(t[3]||t[2]),e.source.end.offset++;let s=t[1].slice(2,-2);if(/^\s*$/.test(s))e.text="",e.raws.left=s,e.raws.right="";else{let r=s.match(/^(\s*)([^]*\S)(\s*)$/);e.text=r[2],e.raws.left=r[1],e.raws.right=r[3]}}createTokenizer(){this.tokenizer=ea(this.input)}decl(t,e){let s=new Ko;this.init(s,t[0][2]);let r=t[t.length-1];for(r[0]===";"&&(this.semicolon=!0,t.pop()),s.source.end=this.getPosition(r[3]||r[2]||ta(t)),s.source.end.offset++;t[0][0]!=="word";)t.length===1&&this.unknownWord(t),s.raws.before+=t.shift()[1];for(s.source.start=this.getPosition(t[0][2]),s.prop="";t.length;){let n=t[0][0];if(n===":"||n==="space"||n==="comment")break;s.prop+=t.shift()[1]}s.raws.between="";let i;for(;t.length;)if(i=t.shift(),i[0]===":"){s.raws.between+=i[1];break}else i[0]==="word"&&/\w/.test(i[1])&&this.unknownWord([i]),s.raws.between+=i[1];(s.prop[0]==="_"||s.prop[0]==="*")&&(s.raws.before+=s.prop[0],s.prop=s.prop.slice(1));let o=[],a;for(;t.length&&(a=t[0][0],!(a!=="space"&&a!=="comment"));)o.push(t.shift());this.precheckMissedSemicolon(t);for(let n=t.length-1;n>=0;n--){if(i=t[n],i[1].toLowerCase()==="!important"){s.important=!0;let c=this.stringFrom(t,n);c=this.spacesFromEnd(t)+c,c!==" !important"&&(s.raws.important=c);break}else if(i[1].toLowerCase()==="important"){let c=t.slice(0),l="";for(let h=n;h>0;h--){let u=c[h][0];if(l.trim().startsWith("!")&&u!=="space")break;l=c.pop()[1]+l}l.trim().startsWith("!")&&(s.important=!0,s.raws.important=l,t=c)}if(i[0]!=="space"&&i[0]!=="comment")break}t.some(n=>n[0]!=="space"&&n[0]!=="comment")&&(s.raws.between+=o.map(n=>n[1]).join(""),o=[]),this.raw(s,"value",o.concat(t),e),s.value.includes(":")&&!e&&this.checkMissedSemicolon(t)}doubleColon(t){throw this.input.error("Double colon",{offset:t[2]},{offset:t[2]+t[1].length})}emptyRule(t){let e=new pr;this.init(e,t[2]),e.selector="",e.raws.between="",this.current=e}end(t){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(t[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(t)}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(t){if(this.spaces+=t[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&e.type==="rule"&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="",e.source.end=this.getPosition(t[2]),e.source.end.offset+=e.raws.ownSemicolon.length)}}getPosition(t){let e=this.input.fromOffset(t);return{column:e.col,line:e.line,offset:t}}init(t,e){this.current.push(t),t.source={input:this.input,start:this.getPosition(e)},t.raws.before=this.spaces,this.spaces="",t.type!=="comment"&&(this.semicolon=!1)}other(t){let e=!1,s=null,r=!1,i=null,o=[],a=t[1].startsWith("--"),n=[],c=t;for(;c;){if(s=c[0],n.push(c),s==="("||s==="[")i||(i=c),o.push(s==="("?")":"]");else if(a&&r&&s==="{")i||(i=c),o.push("}");else if(o.length===0)if(s===";")if(r){this.decl(n,a);return}else break;else if(s==="{"){this.rule(n);return}else if(s==="}"){this.tokenizer.back(n.pop()),e=!0;break}else s===":"&&(r=!0);else s===o[o.length-1]&&(o.pop(),o.length===0&&(i=null));c=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(e=!0),o.length>0&&this.unclosedBracket(i),e&&r){if(!a)for(;n.length&&(c=n[n.length-1][0],!(c!=="space"&&c!=="comment"));)this.tokenizer.back(n.pop());this.decl(n,a)}else this.unknownWord(n)}parse(){let t;for(;!this.tokenizer.endOfFile();)switch(t=this.tokenizer.nextToken(),t[0]){case"space":this.spaces+=t[1];break;case";":this.freeSemicolon(t);break;case"}":this.end(t);break;case"comment":this.comment(t);break;case"at-word":this.atrule(t);break;case"{":this.emptyRule(t);break;default:this.other(t);break}this.endFile()}precheckMissedSemicolon(){}raw(t,e,s,r){let i,o,a=s.length,n="",c=!0,l,h;for(let u=0;u<a;u+=1)i=s[u],o=i[0],o==="space"&&u===a-1&&!r?c=!1:o==="comment"?(h=s[u-1]?s[u-1][0]:"empty",l=s[u+1]?s[u+1][0]:"empty",!dr[h]&&!dr[l]?n.slice(-1)===","?c=!1:n+=i[1]:c=!1):n+=i[1];if(!c){let u=s.reduce((p,m)=>p+m[1],"");t.raws[e]={raw:u,value:n}}t[e]=n}rule(t){t.pop();let e=new pr;this.init(e,t[0][2]),e.raws.between=this.spacesAndCommentsFromEnd(t),this.raw(e,"selector",t),this.current=e}spacesAndCommentsFromEnd(t){let e,s="";for(;t.length&&(e=t[t.length-1][0],!(e!=="space"&&e!=="comment"));)s=t.pop()[1]+s;return s}spacesAndCommentsFromStart(t){let e,s="";for(;t.length&&(e=t[0][0],!(e!=="space"&&e!=="comment"));)s+=t.shift()[1];return s}spacesFromEnd(t){let e,s="";for(;t.length&&(e=t[t.length-1][0],e==="space");)s=t.pop()[1]+s;return s}stringFrom(t,e){let s="";for(let r=e;r<t.length;r++)s+=t[r][1];return t.splice(e,t.length-e),s}unclosedBlock(){let t=this.current.source.start;throw this.input.error("Unclosed block",t.line,t.column)}unclosedBracket(t){throw this.input.error("Unclosed bracket",{offset:t[2]},{offset:t[2]+1})}unexpectedClose(t){throw this.input.error("Unexpected }",{offset:t[2]},{offset:t[2]+1})}unknownWord(t){throw this.input.error("Unknown word "+t[0][1],{offset:t[0][2]},{offset:t[0][2]+t[0][1].length})}unnamedAtrule(t,e){throw this.input.error("At-rule without name",{offset:e[2]},{offset:e[2]+e[1].length})}};var ra=sa;let ia=te,na=xt,oa=ra;function ct(t,e){let s=new na(t,e),r=new oa(s);try{r.parse()}catch(i){throw i}return r.root}var ks=ct;ct.default=ct;ia.registerParse(ct);let Kt=class{constructor(t,e={}){if(this.type="warning",this.text=t,e.node&&e.node.source){let s=e.node.rangeBy(e);this.line=s.start.line,this.column=s.start.column,this.endLine=s.end.line,this.endColumn=s.end.column}for(let s in e)this[s]=e[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}};var Ti=Kt;Kt.default=Kt;let aa=Ti,qt=class{get content(){return this.css}constructor(t,e,s){this.processor=t,this.messages=[],this.root=e,this.opts=s,this.css="",this.map=void 0}toString(){return this.css}warn(t,e={}){e.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(e.plugin=this.lastPlugin.postcssPlugin);let s=new aa(t,e);return this.messages.push(s),s}warnings(){return this.messages.filter(t=>t.type==="warning")}};var Ds=qt;qt.default=qt;let la=te,ca=Ns,ha=Ni,ua=ks,fr=Ds,pa=Pe,da=wt,{isClean:G,my:fa}=Ie;const ma={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},ga={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},ya={Once:!0,postcssPlugin:!0,prepare:!0},le=0;function ye(t){return typeof t=="object"&&typeof t.then=="function"}function ki(t){let e=!1,s=ma[t.type];return t.type==="decl"?e=t.prop.toLowerCase():t.type==="atrule"&&(e=t.name.toLowerCase()),e&&t.append?[s,s+"-"+e,le,s+"Exit",s+"Exit-"+e]:e?[s,s+"-"+e,s+"Exit",s+"Exit-"+e]:t.append?[s,le,s+"Exit"]:[s,s+"Exit"]}function mr(t){let e;return t.type==="document"?e=["Document",le,"DocumentExit"]:t.type==="root"?e=["Root",le,"RootExit"]:e=ki(t),{eventIndex:0,events:e,iterator:0,node:t,visitorIndex:0,visitors:[]}}function es(t){return t[G]=!1,t.nodes&&t.nodes.forEach(e=>es(e)),t}let ts={},ce=class Di{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"}constructor(e,s,r){this.stringified=!1,this.processed=!1;let i;if(typeof s=="object"&&s!==null&&(s.type==="root"||s.type==="document"))i=es(s);else if(s instanceof Di||s instanceof fr)i=es(s.root),s.map&&(typeof r.map>"u"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=s.map);else{let o=ua;r.syntax&&(o=r.syntax.parse),r.parser&&(o=r.parser),o.parse&&(o=o.parse);try{i=o(s,r)}catch(a){this.processed=!0,this.error=a}i&&!i[fa]&&la.rebuild(i)}this.result=new fr(e,i,r),this.helpers=W(O({},ts),{postcss:ts,result:this.result}),this.plugins=this.processor.plugins.map(o=>typeof o=="object"&&o.prepare?O(O({},o),o.prepare(this.result)):o)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,s){let r=this.result.lastPlugin;try{s&&s.addToError(e),this.error=e,e.name==="CssSyntaxError"&&!e.plugin?(e.plugin=r.postcssPlugin,e.setMessage()):r.postcssVersion}catch(i){console&&console.error&&console.error(i)}return e}prepareVisitors(){this.listeners={};let e=(s,r,i)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([s,i])};for(let s of this.plugins)if(typeof s=="object")for(let r in s){if(!ga[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${s.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!ya[r])if(typeof s[r]=="object")for(let i in s[r])i==="*"?e(s,r,s[r][i]):e(s,r+"-"+i.toLowerCase(),s[r][i]);else typeof s[r]=="function"&&e(s,r,s[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let s=this.plugins[e],r=this.runOnRoot(s);if(ye(r))try{await r}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[G];){e[G]=!0;let s=[mr(e)];for(;s.length>0;){let r=this.visitTick(s);if(ye(r))try{await r}catch(i){let o=s[s.length-1].node;throw this.handleError(i,o)}}}if(this.listeners.OnceExit)for(let[s,r]of this.listeners.OnceExit){this.result.lastPlugin=s;try{if(e.type==="document"){let i=e.nodes.map(o=>r(o,this.helpers));await Promise.all(i)}else await r(e,this.helpers)}catch(i){throw this.handleError(i)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if(typeof e=="object"&&e.Once){if(this.result.root.type==="document"){let s=this.result.root.nodes.map(r=>e.Once(r,this.helpers));return ye(s[0])?Promise.all(s):s}return e.Once(this.result.root,this.helpers)}else if(typeof e=="function")return e(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 e=this.result.opts,s=da;e.syntax&&(s=e.syntax.stringify),e.stringifier&&(s=e.stringifier),s.stringify&&(s=s.stringify);let r=new ha(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 e of this.plugins){let s=this.runOnRoot(e);if(ye(s))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[G];)e[G]=!0,this.walkSync(e);if(this.listeners.OnceExit)if(e.type==="document")for(let s of e.nodes)this.visitSync(this.listeners.OnceExit,s);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,s){return this.async().then(e,s)}toString(){return this.css}visitSync(e,s){for(let[r,i]of e){this.result.lastPlugin=r;let o;try{o=i(s,this.helpers)}catch(a){throw this.handleError(a,s.proxyOf)}if(s.type!=="root"&&s.type!=="document"&&!s.parent)return!0;if(ye(o))throw this.getAsyncError()}}visitTick(e){let s=e[e.length-1],{node:r,visitors:i}=s;if(r.type!=="root"&&r.type!=="document"&&!r.parent){e.pop();return}if(i.length>0&&s.visitorIndex<i.length){let[a,n]=i[s.visitorIndex];s.visitorIndex+=1,s.visitorIndex===i.length&&(s.visitors=[],s.visitorIndex=0),this.result.lastPlugin=a;try{return n(r.toProxy(),this.helpers)}catch(c){throw this.handleError(c,r)}}if(s.iterator!==0){let a=s.iterator,n;for(;n=r.nodes[r.indexes[a]];)if(r.indexes[a]+=1,!n[G]){n[G]=!0,e.push(mr(n));return}s.iterator=0,delete r.indexes[a]}let o=s.events;for(;s.eventIndex<o.length;){let a=o[s.eventIndex];if(s.eventIndex+=1,a===le){r.nodes&&r.nodes.length&&(r[G]=!0,s.iterator=r.getIterator());return}else if(this.listeners[a]){s.visitors=this.listeners[a];return}}e.pop()}walkSync(e){e[G]=!0;let s=ki(e);for(let r of s)if(r===le)e.nodes&&e.each(i=>{i[G]||this.walkSync(i)});else{let i=this.listeners[r];if(i&&this.visitSync(i,e.toProxy()))return}}warnings(){return this.sync().warnings()}};ce.registerPostcss=t=>{ts=t};var Ri=ce;ce.default=ce;pa.registerLazyResult(ce);ca.registerLazyResult(ce);let wa=Ni,ba=ks;const va=Ds;let Sa=wt;let ss=class{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 t,e=ba;try{t=e(this._css,this._opts)}catch(s){this.error=s}if(this.error)throw this.error;return this._root=t,t}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(t,e,s){e=e.toString(),this.stringified=!1,this._processor=t,this._css=e,this._opts=s,this._map=void 0;let r,i=Sa;this.result=new va(this._processor,r,this._opts),this.result.css=e;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let a=new wa(i,r,this._opts,e);if(a.isMap()){let[n,c]=a.generate();n&&(this.result.css=n),c&&(this.result.map=c)}else a.clearAnnotation(),this.result.css=a.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}sync(){if(this.error)throw this.error;return this.result}then(t,e){return this.async().then(t,e)}toString(){return this._css}warnings(){return[]}};var xa=ss;ss.default=ss;let Ca=Ns,Ea=Ri,Ma=xa,Na=Pe,ke=class{constructor(t=[]){this.version="8.5.6",this.plugins=this.normalize(t)}normalize(t){let e=[];for(let s of t)if(s.postcss===!0?s=s():s.postcss&&(s=s.postcss),typeof s=="object"&&Array.isArray(s.plugins))e=e.concat(s.plugins);else if(typeof s=="object"&&s.postcssPlugin)e.push(s);else if(typeof s=="function")e.push(s);else if(!(typeof s=="object"&&(s.parse||s.stringify)))throw new Error(s+" is not a PostCSS plugin");return e}process(t,e={}){return!this.plugins.length&&!e.parser&&!e.stringifier&&!e.syntax?new Ma(this,t,e):new Ea(this,t,e)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}};var Ta=ke;ke.default=ke;Na.registerProcessor(ke);Ca.registerProcessor(ke);let Oi=Ms,Ai=vt,ka=te,Da=xs,Ii=St,Pi=Ns,Ra=Io,Oa=xt,Aa=Ri,Ia=vi,Pa=bt,La=ks,Rs=Ta,Fa=Ds,Li=Pe,Fi=Ts,_a=wt,Ua=Ti;function k(...t){return t.length===1&&Array.isArray(t[0])&&(t=t[0]),new Rs(t)}k.plugin=function(t,e){let s=!1;function r(...o){console&&console.warn&&!s&&(s=!0,console.warn(t+`: postcss.plugin was deprecated. Migration guide:
28
28
  https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(t+`: \u91CC\u9762 postcss.plugin \u88AB\u5F03\u7528. \u8FC1\u79FB\u6307\u5357:
29
- https://www.w3ctech.com/topic/2226`));let a=e(...o);return a.postcssPlugin=t,a.postcssVersion=new Ds().version,a}let i;return Object.defineProperty(r,"postcss",{get(){return i||(i=r()),i}}),r.process=function(o,a,n){return k([r(n)]).process(o,a)},r};k.stringify=Pa;k.parse=Aa;k.fromJSON=Ta;k.list=Ra;k.comment=t=>new Di(t);k.atRule=t=>new ki(t);k.decl=t=>new Ri(t);k.rule=t=>new Ii(t);k.root=t=>new Ai(t);k.document=t=>new Oi(t);k.CssSyntaxError=Na;k.Declaration=Ri;k.Container=Ma;k.Processor=Ds;k.Document=Oi;k.Comment=Di;k.Warning=La;k.AtRule=ki;k.Result=Ia;k.Input=ka;k.Rule=Ii;k.Root=Ai;k.Node=Oa;Da.registerPostcss(k);var Fa=k;k.default=k;const A=Hn(Fa);A.stringify;A.fromJSON;A.plugin;A.parse;A.list;A.document;A.comment;A.atRule;A.rule;A.decl;A.root;A.CssSyntaxError;A.Declaration;A.Container;A.Processor;A.Document;A.Comment;A.Warning;A.AtRule;A.Result;A.Input;A.Rule;A.Root;A.Node;const _a=/(max|min)-device-(width|height)/,fr=new RegExp(_a.source,"g"),Ua={postcssPlugin:"postcss-custom-selectors",prepare(){return{postcssPlugin:"postcss-custom-selectors",AtRule:function(t){t.params.match(fr)&&(t.params=t.params.replace(fr,"$1-$2"))}}}},Ba={postcssPlugin:"postcss-hover-classes",prepare:function(){const t=[];return{Rule:function(e){t.indexOf(e)===-1&&(t.push(e),e.selectors.forEach(function(s){if(!s.includes(":"))return;const r=s.replace(/\n/g," ").split(" "),i=[];r.forEach(function(a){const n=a.match(/::?([^:]+)/g);if(!n){i.push(a);return}const l=a.substr(0,a.length-n.join("").length),c=n.map(function(h){return h.replace(/\(.*/g,"")!==":hover"||h.match(/^::/)?h:(h=h.substr(1),h=h.replace(/\(/g,"\\("),h=h.replace(/\)/g,"\\)"),".\\:"+h)});i.push(l+c.join(""))}),o(i.join(" "));function o(a){a&&a!==s&&(e.selector+=`,
30
- `+a)}}))}}}},mr={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 Wa(t){let e=mr[t.tagName]?mr[t.tagName]:t.tagName;return e==="link"&&t.attributes._cssText&&(e="style"),e}function gr(t,e){const s=e==null?void 0:e.stylesWithHoverClass.get(t);if(s)return s;const r=A([Ua,Ba]).process(t).css;return e==null||e.stylesWithHoverClass.set(t,r),r}function yr(){return{stylesWithHoverClass:new Map}}function ja(t,e){var s;const{doc:r,hackCss:i,cache:o}=e;switch(t.type){case R.Document:return r.implementation.createDocument(null,"",null);case R.DocumentType:return r.implementation.createDocumentType(t.name||"html",t.publicId,t.systemId);case R.Element:{const a=Wa(t);let n;t.isSVG?n=r.createElementNS("http://www.w3.org/2000/svg",a):(t.isCustom&&(s=r.defaultView)!=null&&s.customElements&&!r.defaultView.customElements.get(t.tagName)&&r.defaultView.customElements.define(t.tagName,class extends r.defaultView.HTMLElement{}),n=r.createElement(a));const l={};for(const c in t.attributes){if(!Object.prototype.hasOwnProperty.call(t.attributes,c))continue;let h=t.attributes[c];if(a==="option"&&c==="selected"&&h===!1||h===null)continue;if(h===!0&&(h=""),c.startsWith("rr_")){l[c]=h;continue}const u=a==="textarea"&&c==="value",p=a==="style"&&c==="_cssText";if(p&&i&&typeof h=="string"&&(h=gr(h,o)),(u||p)&&typeof h=="string"){n.appendChild(r.createTextNode(h)),t.childNodes=[];continue}try{if(t.isSVG&&c==="xlink:href")n.setAttributeNS("http://www.w3.org/1999/xlink",c,h.toString());else if(c==="onload"||c==="onclick"||c.substring(0,7)==="onmouse")n.setAttribute("_"+c,h.toString());else if(a==="meta"&&t.attributes["http-equiv"]==="Content-Security-Policy"&&c==="content"){n.setAttribute("csp-content",h.toString());continue}else a==="link"&&(t.attributes.rel==="preload"||t.attributes.rel==="modulepreload")&&t.attributes.as==="script"||a==="link"&&t.attributes.rel==="prefetch"&&typeof t.attributes.href=="string"&&t.attributes.href.endsWith(".js")||(a==="img"&&t.attributes.srcset&&t.attributes.rr_dataURL?n.setAttribute("original-srcset",t.attributes.srcset):n.setAttribute(c,h.toString()))}catch(m){}}for(const c in l){const h=l[c];if(a==="canvas"&&c==="rr_dataURL"){const u=r.createElement("img");u.onload=()=>{const p=n.getContext("2d");p&&p.drawImage(u,0,0,u.width,u.height)},u.src=h.toString(),n.RRNodeType&&(n.rr_dataURL=h.toString())}else if(a==="img"&&c==="rr_dataURL"){const u=n;u.currentSrc.startsWith("data:")||(u.setAttribute("original-src",t.attributes.src),u.src=h.toString())}if(c==="rr_width")n.style.width=h.toString();else if(c==="rr_height")n.style.height=h.toString();else if(c==="rr_mediaCurrentTime"&&typeof h=="number")n.currentTime=h;else if(c==="rr_mediaState")switch(h){case"played":n.play().catch(u=>console.warn("media playback error",u));break;case"paused":n.pause();break}else c==="rr_mediaPlaybackRate"&&typeof h=="number"?n.playbackRate=h:c==="rr_mediaMuted"&&typeof h=="boolean"?n.muted=h:c==="rr_mediaLoop"&&typeof h=="boolean"?n.loop=h:c==="rr_mediaVolume"&&typeof h=="number"&&(n.volume=h)}if(t.isShadowHost)if(!n.shadowRoot)n.attachShadow({mode:"open"});else for(;n.shadowRoot.firstChild;)n.shadowRoot.removeChild(n.shadowRoot.firstChild);return n}case R.Text:return r.createTextNode(t.isStyle&&i?gr(t.textContent,o):t.textContent);case R.CDATA:return r.createCDATASection(t.textContent);case R.Comment:return r.createComment(t.textContent);default:return null}}function Ce(t,e){const{doc:s,mirror:r,skipChild:i=!1,hackCss:o=!0,afterAppend:a,cache:n}=e;if(r.has(t.id)){const c=r.getNode(t.id),h=r.getMeta(c);if(Zn(h,t))return r.getNode(t.id)}let l=ja(t,{doc:s,hackCss:o,cache:n});if(!l)return null;if(t.rootId&&r.getNode(t.rootId)!==s&&r.replace(t.rootId,s),t.type===R.Document&&(s.close(),s.open(),t.compatMode==="BackCompat"&&t.childNodes&&t.childNodes[0].type!==R.DocumentType&&(t.childNodes[0].type===R.Element&&"xmlns"in t.childNodes[0].attributes&&t.childNodes[0].attributes.xmlns==="http://www.w3.org/1999/xhtml"?s.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):s.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),l=s),r.add(l,t),(t.type===R.Document||t.type===R.Element)&&!i)for(const c of t.childNodes){const h=Ce(c,{doc:s,mirror:r,skipChild:!1,hackCss:o,afterAppend:a,cache:n});if(!h){console.warn("Failed to rebuild",c);continue}if(c.isShadow&&Gn(l)&&l.shadowRoot)l.shadowRoot.appendChild(h);else if(t.type===R.Document&&c.type==R.Element){const u=h;let p=null;u.childNodes.forEach(m=>{m.nodeName==="BODY"&&(p=m)}),p?(u.removeChild(p),l.appendChild(h),u.appendChild(p)):l.appendChild(h)}else l.appendChild(h);a&&a(h,c.id)}return l}function Va(t,e){function s(r){e(r)}for(const r of t.getIds())t.has(r)&&s(t.getNode(r))}function za(t,e){const s=e.getMeta(t);if((s==null?void 0:s.type)!==R.Element)return;const r=t;for(const i in s.attributes){if(!(Object.prototype.hasOwnProperty.call(s.attributes,i)&&i.startsWith("rr_")))continue;const o=s.attributes[i];i==="rr_scrollLeft"&&(r.scrollLeft=o),i==="rr_scrollTop"&&(r.scrollTop=o)}}function Ya(t,e){const{doc:s,onVisit:r,hackCss:i=!0,afterAppend:o,cache:a,mirror:n=new $r}=e,l=Ce(t,{doc:s,mirror:n,skipChild:!1,hackCss:i,afterAppend:o,cache:a});return Va(n,c=>{r&&r(c),za(c,n)}),l}var L=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t[t.Device=24]="Device",t[t.SailfishCustom=25]="SailfishCustom",t))(L||{}),T=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t[t.Typing=17]="Typing",t))(T||{}),_=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(_||{}),ct=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(ct||{}),ss=(t=>(t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t[t.RateChange=4]="RateChange",t))(ss||{}),N=(t=>(t.Start="start",t.Pause="pause",t.Resume="resume",t.Resize="resize",t.Finish="finish",t.FullsnapshotRebuilded="fullsnapshot-rebuilded",t.LoadStylesheetStart="load-stylesheet-start",t.LoadStylesheetEnd="load-stylesheet-end",t.SkipStart="skip-start",t.SkipEnd="skip-end",t.MouseInteraction="mouse-interaction",t.EventCast="event-cast",t.CustomEvent="custom-event",t.Flush="flush",t.StateChange="state-change",t.PlayBack="play-back",t.Destroy="destroy",t))(N||{});const te=`Please stop import mirror directly. Instead of that,\r
29
+ https://www.w3ctech.com/topic/2226`));let a=e(...o);return a.postcssPlugin=t,a.postcssVersion=new Rs().version,a}let i;return Object.defineProperty(r,"postcss",{get(){return i||(i=r()),i}}),r.process=function(o,a,n){return k([r(n)]).process(o,a)},r};k.stringify=_a;k.parse=La;k.fromJSON=Ra;k.list=Ia;k.comment=t=>new Ai(t);k.atRule=t=>new Oi(t);k.decl=t=>new Ii(t);k.rule=t=>new Fi(t);k.root=t=>new Li(t);k.document=t=>new Pi(t);k.CssSyntaxError=Da;k.Declaration=Ii;k.Container=ka;k.Processor=Rs;k.Document=Pi;k.Comment=Ai;k.Warning=Ua;k.AtRule=Oi;k.Result=Fa;k.Input=Oa;k.Rule=Fi;k.Root=Li;k.Node=Pa;Aa.registerPostcss(k);var Ba=k;k.default=k;const A=Qn(Ba);A.stringify;A.fromJSON;A.plugin;A.parse;A.list;A.document;A.comment;A.atRule;A.rule;A.decl;A.root;A.CssSyntaxError;A.Declaration;A.Container;A.Processor;A.Document;A.Comment;A.Warning;A.AtRule;A.Result;A.Input;A.Rule;A.Root;A.Node;const Wa=/(max|min)-device-(width|height)/,gr=new RegExp(Wa.source,"g"),ja={postcssPlugin:"postcss-custom-selectors",prepare(){return{postcssPlugin:"postcss-custom-selectors",AtRule:function(t){t.params.match(gr)&&(t.params=t.params.replace(gr,"$1-$2"))}}}},Va={postcssPlugin:"postcss-hover-classes",prepare:function(){const t=[];return{Rule:function(e){t.indexOf(e)===-1&&(t.push(e),e.selectors.forEach(function(s){if(!s.includes(":"))return;const r=s.replace(/\n/g," ").split(" "),i=[];r.forEach(function(a){const n=a.match(/::?([^:]+)/g);if(!n){i.push(a);return}const c=a.substr(0,a.length-n.join("").length),l=n.map(function(h){return h.replace(/\(.*/g,"")!==":hover"||h.match(/^::/)?h:(h=h.substr(1),h=h.replace(/\(/g,"\\("),h=h.replace(/\)/g,"\\)"),".\\:"+h)});i.push(c+l.join(""))}),o(i.join(" "));function o(a){a&&a!==s&&(e.selector+=`,
30
+ `+a)}}))}}}},yr={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 za(t){let e=yr[t.tagName]?yr[t.tagName]:t.tagName;return e==="link"&&t.attributes._cssText&&(e="style"),e}function wr(t,e){const s=e==null?void 0:e.stylesWithHoverClass.get(t);if(s)return s;const r=A([ja,Va]).process(t).css;return e==null||e.stylesWithHoverClass.set(t,r),r}function br(){return{stylesWithHoverClass:new Map}}function Ya(t,e){var s;const{doc:r,hackCss:i,cache:o}=e;switch(t.type){case R.Document:return r.implementation.createDocument(null,"",null);case R.DocumentType:return r.implementation.createDocumentType(t.name||"html",t.publicId,t.systemId);case R.Element:{const a=za(t);let n;t.isSVG?n=r.createElementNS("http://www.w3.org/2000/svg",a):(t.isCustom&&(s=r.defaultView)!=null&&s.customElements&&!r.defaultView.customElements.get(t.tagName)&&r.defaultView.customElements.define(t.tagName,class extends r.defaultView.HTMLElement{}),n=r.createElement(a));const c={};for(const l in t.attributes){if(!Object.prototype.hasOwnProperty.call(t.attributes,l))continue;let h=t.attributes[l];if(a==="option"&&l==="selected"&&h===!1||h===null)continue;if(h===!0&&(h=""),l.startsWith("rr_")){c[l]=h;continue}const u=a==="textarea"&&l==="value",p=a==="style"&&l==="_cssText";if(p&&i&&typeof h=="string"&&(h=wr(h,o)),(u||p)&&typeof h=="string"){n.appendChild(r.createTextNode(h)),t.childNodes=[];continue}try{if(t.isSVG&&l==="xlink:href")n.setAttributeNS("http://www.w3.org/1999/xlink",l,h.toString());else if(l==="onload"||l==="onclick"||l.substring(0,7)==="onmouse")n.setAttribute("_"+l,h.toString());else if(a==="meta"&&t.attributes["http-equiv"]==="Content-Security-Policy"&&l==="content"){n.setAttribute("csp-content",h.toString());continue}else a==="link"&&(t.attributes.rel==="preload"||t.attributes.rel==="modulepreload")&&t.attributes.as==="script"||a==="link"&&t.attributes.rel==="prefetch"&&typeof t.attributes.href=="string"&&t.attributes.href.endsWith(".js")||(a==="img"&&t.attributes.srcset&&t.attributes.rr_dataURL?n.setAttribute("original-srcset",t.attributes.srcset):n.setAttribute(l,h.toString()))}catch(m){}}for(const l in c){const h=c[l];if(a==="canvas"&&l==="rr_dataURL"){const u=r.createElement("img");u.onload=()=>{const p=n.getContext("2d");p&&p.drawImage(u,0,0,u.width,u.height)},u.src=h.toString(),n.RRNodeType&&(n.rr_dataURL=h.toString())}else if(a==="img"&&l==="rr_dataURL"){const u=n;u.currentSrc.startsWith("data:")||(u.setAttribute("original-src",t.attributes.src),u.src=h.toString())}if(l==="rr_width")n.style.width=h.toString();else if(l==="rr_height")n.style.height=h.toString();else if(l==="rr_mediaCurrentTime"&&typeof h=="number")n.currentTime=h;else if(l==="rr_mediaState")switch(h){case"played":n.play().catch(u=>console.warn("media playback error",u));break;case"paused":n.pause();break}else l==="rr_mediaPlaybackRate"&&typeof h=="number"?n.playbackRate=h:l==="rr_mediaMuted"&&typeof h=="boolean"?n.muted=h:l==="rr_mediaLoop"&&typeof h=="boolean"?n.loop=h:l==="rr_mediaVolume"&&typeof h=="number"&&(n.volume=h)}if(t.isShadowHost)if(!n.shadowRoot)n.attachShadow({mode:"open"});else for(;n.shadowRoot.firstChild;)n.shadowRoot.removeChild(n.shadowRoot.firstChild);return n}case R.Text:return r.createTextNode(t.isStyle&&i?wr(t.textContent,o):t.textContent);case R.CDATA:return r.createCDATASection(t.textContent);case R.Comment:return r.createComment(t.textContent);default:return null}}function Ee(t,e){const{doc:s,mirror:r,skipChild:i=!1,hackCss:o=!0,afterAppend:a,cache:n}=e;if(r.has(t.id)){const l=r.getNode(t.id),h=r.getMeta(l);if(Jn(h,t))return r.getNode(t.id)}let c=Ya(t,{doc:s,hackCss:o,cache:n});if(!c)return null;if(t.rootId&&r.getNode(t.rootId)!==s&&r.replace(t.rootId,s),t.type===R.Document&&(s.close(),s.open(),t.compatMode==="BackCompat"&&t.childNodes&&t.childNodes[0].type!==R.DocumentType&&(t.childNodes[0].type===R.Element&&"xmlns"in t.childNodes[0].attributes&&t.childNodes[0].attributes.xmlns==="http://www.w3.org/1999/xhtml"?s.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):s.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),c=s),r.add(c,t),(t.type===R.Document||t.type===R.Element)&&!i)for(const l of t.childNodes){const h=Ee(l,{doc:s,mirror:r,skipChild:!1,hackCss:o,afterAppend:a,cache:n});if(!h){console.warn("Failed to rebuild",l);continue}if(l.isShadow&&Hn(c)&&c.shadowRoot)c.shadowRoot.appendChild(h);else if(t.type===R.Document&&l.type==R.Element){const u=h;let p=null;u.childNodes.forEach(m=>{m.nodeName==="BODY"&&(p=m)}),p?(u.removeChild(p),c.appendChild(h),u.appendChild(p)):c.appendChild(h)}else c.appendChild(h);a&&a(h,l.id)}return c}function Ga(t,e){function s(r){e(r)}for(const r of t.getIds())t.has(r)&&s(t.getNode(r))}function Xa(t,e){const s=e.getMeta(t);if((s==null?void 0:s.type)!==R.Element)return;const r=t;for(const i in s.attributes){if(!(Object.prototype.hasOwnProperty.call(s.attributes,i)&&i.startsWith("rr_")))continue;const o=s.attributes[i];i==="rr_scrollLeft"&&(r.scrollLeft=o),i==="rr_scrollTop"&&(r.scrollTop=o)}}function Za(t,e){const{doc:s,onVisit:r,hackCss:i=!0,afterAppend:o,cache:a,mirror:n=new qr}=e,c=Ee(t,{doc:s,mirror:n,skipChild:!1,hackCss:i,afterAppend:o,cache:a});return Ga(n,l=>{r&&r(l),Xa(l,n)}),c}var L=(t=>(t[t.DomContentLoaded=0]="DomContentLoaded",t[t.Load=1]="Load",t[t.FullSnapshot=2]="FullSnapshot",t[t.IncrementalSnapshot=3]="IncrementalSnapshot",t[t.Meta=4]="Meta",t[t.Custom=5]="Custom",t[t.Plugin=6]="Plugin",t[t.Device=24]="Device",t[t.SailfishCustom=25]="SailfishCustom",t))(L||{}),T=(t=>(t[t.Mutation=0]="Mutation",t[t.MouseMove=1]="MouseMove",t[t.MouseInteraction=2]="MouseInteraction",t[t.Scroll=3]="Scroll",t[t.ViewportResize=4]="ViewportResize",t[t.Input=5]="Input",t[t.TouchMove=6]="TouchMove",t[t.MediaInteraction=7]="MediaInteraction",t[t.StyleSheetRule=8]="StyleSheetRule",t[t.CanvasMutation=9]="CanvasMutation",t[t.Font=10]="Font",t[t.Log=11]="Log",t[t.Drag=12]="Drag",t[t.StyleDeclaration=13]="StyleDeclaration",t[t.Selection=14]="Selection",t[t.AdoptedStyleSheet=15]="AdoptedStyleSheet",t[t.CustomElement=16]="CustomElement",t[t.Typing=17]="Typing",t))(T||{}),Se=(t=>(t.Append="append",t.Insert="insert",t.Delete="delete",t.Replace="replace",t))(Se||{}),_=(t=>(t[t.MouseUp=0]="MouseUp",t[t.MouseDown=1]="MouseDown",t[t.Click=2]="Click",t[t.ContextMenu=3]="ContextMenu",t[t.DblClick=4]="DblClick",t[t.Focus=5]="Focus",t[t.Blur=6]="Blur",t[t.TouchStart=7]="TouchStart",t[t.TouchMove_Departed=8]="TouchMove_Departed",t[t.TouchEnd=9]="TouchEnd",t[t.TouchCancel=10]="TouchCancel",t))(_||{}),ht=(t=>(t[t["2D"]=0]="2D",t[t.WebGL=1]="WebGL",t[t.WebGL2=2]="WebGL2",t))(ht||{}),rs=(t=>(t[t.Play=0]="Play",t[t.Pause=1]="Pause",t[t.Seeked=2]="Seeked",t[t.VolumeChange=3]="VolumeChange",t[t.RateChange=4]="RateChange",t))(rs||{}),N=(t=>(t.Start="start",t.Pause="pause",t.Resume="resume",t.Resize="resize",t.Finish="finish",t.FullsnapshotRebuilded="fullsnapshot-rebuilded",t.LoadStylesheetStart="load-stylesheet-start",t.LoadStylesheetEnd="load-stylesheet-end",t.SkipStart="skip-start",t.SkipEnd="skip-end",t.MouseInteraction="mouse-interaction",t.EventCast="event-cast",t.CustomEvent="custom-event",t.Flush="flush",t.StateChange="state-change",t.PlayBack="play-back",t.Destroy="destroy",t))(N||{});const re=`Please stop import mirror directly. Instead of that,\r
31
31
  now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
32
- or you can use record.mirror to access the mirror instance during recording.`;let wr={map:{},getId(){return console.error(te),-1},getNode(){return console.error(te),null},removeNodeFromMap(){console.error(te)},has(){return console.error(te),!1},reset(){console.error(te)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(wr=new Proxy(wr,{get(t,e,s){return e==="map"&&console.error(te),Reflect.get(t,e,s)}}));Date.now().toString();function Ga(t=window){"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let s=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do if(this===s)return!0;while(s=s&&s.parentNode);return!1})}function Xa(t){const e={},s=(i,o)=>{const a={value:i,parent:o,children:[]};return e[i.node.id]=a,a},r=[];for(const i of t){const{nextId:o,parentId:a}=i;if(o&&o in e){const n=e[o];if(n.parent){const l=n.parent.children.indexOf(n);n.parent.children.splice(l,0,s(i,n.parent))}else{const l=r.indexOf(n);r.splice(l,0,s(i,null))}continue}if(a in e){const n=e[a];n.children.push(s(i,n));continue}r.push(s(i,null))}return r}function Pi(t,e){e(t.value);for(let s=t.children.length-1;s>=0;s--)Pi(t.children[s],e)}function Pt(t,e){return!!(t.nodeName==="IFRAME"&&e.getMeta(t))}function Li(t,e){var s,r;const i=(r=(s=t.ownerDocument)==null?void 0:s.defaultView)==null?void 0:r.frameElement;if(!i||i===e)return{x:0,y:0,relativeScale:1,absoluteScale:1};const o=i.getBoundingClientRect(),a=Li(i,e),n=o.height/i.clientHeight;return{x:o.x*a.relativeScale+a.x,y:o.y*a.relativeScale+a.y,relativeScale:n,absoluteScale:a.absoluteScale*n}}function Ge(t){return!!(t!=null&&t.shadowRoot)}function Se(t,e){const s=t[e[0]];return e.length===1?s:Se(s.cssRules[e[1]].cssRules,e.slice(2))}function br(t){const e=[...t],s=e.pop();return{positions:e,index:s}}function Za(t){const e=new Set,s=[];for(let r=t.length;r--;){const i=t[r];e.has(i.id)||(s.push(i),e.add(i.id))}return s}class Ha{constructor(){v(this,"id",1),v(this,"styleIDMap",new WeakMap),v(this,"idStyleMap",new Map)}getId(e){var s;return(s=this.styleIDMap.get(e))!=null?s:-1}has(e){return this.styleIDMap.has(e)}add(e,s){if(this.has(e))return this.getId(e);let r;return s===void 0?r=this.id++:r=s,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}const Ja="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2Zvcih2YXIgcj0iQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyIsdz10eXBlb2YgVWludDhBcnJheT4idSI/W106bmV3IFVpbnQ4QXJyYXkoMjU2KSxpPTA7aTxyLmxlbmd0aDtpKyspd1tyLmNoYXJDb2RlQXQoaSldPWk7dmFyIHA9ZnVuY3Rpb24ocyl7dmFyIGU9bmV3IFVpbnQ4QXJyYXkocyksbixhPWUubGVuZ3RoLHQ9IiI7Zm9yKG49MDtuPGE7bis9Myl0Kz1yW2Vbbl0+PjJdLHQrPXJbKGVbbl0mMyk8PDR8ZVtuKzFdPj40XSx0Kz1yWyhlW24rMV0mMTUpPDwyfGVbbisyXT4+Nl0sdCs9cltlW24rMl0mNjNdO3JldHVybiBhJTM9PT0yP3Q9dC5zdWJzdHJpbmcoMCx0Lmxlbmd0aC0xKSsiPSI6YSUzPT09MSYmKHQ9dC5zdWJzdHJpbmcoMCx0Lmxlbmd0aC0yKSsiPT0iKSx0fTtjb25zdCBsPW5ldyBNYXAsYj1uZXcgTWFwO2FzeW5jIGZ1bmN0aW9uIHkocyxlLG4pe2NvbnN0IGE9YCR7c30tJHtlfWA7aWYoIk9mZnNjcmVlbkNhbnZhcyJpbiBnbG9iYWxUaGlzKXtpZihiLmhhcyhhKSlyZXR1cm4gYi5nZXQoYSk7Y29uc3QgdD1uZXcgT2Zmc2NyZWVuQ2FudmFzKHMsZSk7dC5nZXRDb250ZXh0KCIyZCIpO2NvbnN0IGc9YXdhaXQoYXdhaXQgdC5jb252ZXJ0VG9CbG9iKG4pKS5hcnJheUJ1ZmZlcigpLGM9cChnKTtyZXR1cm4gYi5zZXQoYSxjKSxjfWVsc2UgcmV0dXJuIiJ9Y29uc3Qgbz1zZWxmO28ub25tZXNzYWdlPWFzeW5jIGZ1bmN0aW9uKHMpe2lmKCJPZmZzY3JlZW5DYW52YXMiaW4gZ2xvYmFsVGhpcyl7Y29uc3R7aWQ6ZSxiaXRtYXA6bix3aWR0aDphLGhlaWdodDp0LGRhdGFVUkxPcHRpb25zOnV9PXMuZGF0YSxnPXkoYSx0LHUpLGM9bmV3IE9mZnNjcmVlbkNhbnZhcyhhLHQpO2MuZ2V0Q29udGV4dCgiMmQiKS5kcmF3SW1hZ2UobiwwLDApLG4uY2xvc2UoKTtjb25zdCBkPWF3YWl0IGMuY29udmVydFRvQmxvYih1KSx2PWQudHlwZSxoPWF3YWl0IGQuYXJyYXlCdWZmZXIoKSxmPXAoaCk7aWYoIWwuaGFzKGUpJiZhd2FpdCBnPT09ZilyZXR1cm4gbC5zZXQoZSxmKSxvLnBvc3RNZXNzYWdlKHtpZDplfSk7aWYobC5nZXQoZSk9PT1mKXJldHVybiBvLnBvc3RNZXNzYWdlKHtpZDplfSk7by5wb3N0TWVzc2FnZSh7aWQ6ZSx0eXBlOnYsYmFzZTY0OmYsd2lkdGg6YSxoZWlnaHQ6dH0pLGwuc2V0KGUsZil9ZWxzZSByZXR1cm4gby5wb3N0TWVzc2FnZSh7aWQ6cy5kYXRhLmlkfSl9fSkoKTsKLy8jIHNvdXJjZU1hcHBpbmdVUkw9aW1hZ2UtYml0bWFwLWRhdGEtdXJsLXdvcmtlci1Cb1hHVm1Zby5qcy5tYXAK",$a=t=>Uint8Array.from(atob(t),e=>e.charCodeAt(0));typeof self<"u"&&self.Blob&&new Blob([$a(Ja)],{type:"text/javascript;charset=utf-8"});var vr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",xe=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var Xe=0;Xe<vr.length;Xe++)xe[vr.charCodeAt(Xe)]=Xe;var Qa=function(t){var e=t.length*.75,s=t.length,r,i=0,o,a,n,l;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);var c=new ArrayBuffer(e),h=new Uint8Array(c);for(r=0;r<s;r+=4)o=xe[t.charCodeAt(r)],a=xe[t.charCodeAt(r+1)],n=xe[t.charCodeAt(r+2)],l=xe[t.charCodeAt(r+3)],h[i++]=o<<2|a>>4,h[i++]=(a&15)<<4|n>>2,h[i++]=(n&3)<<6|l&63;return c},Sr;try{if(Array.from([1],t=>t*2)[0]!==2){const t=document.createElement("iframe");document.body.appendChild(t),Array.from=((Sr=t.contentWindow)==null?void 0:Sr.Array.from)||Array.from,document.body.removeChild(t)}}catch(t){console.debug("Unable to override Array.from",t)}Qr();var Ka=Object.defineProperty,qa=(t,e,s)=>e in t?Ka(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,y=(t,e,s)=>qa(t,typeof e!="symbol"?e+"":e,s),el=Object.defineProperty,tl=(t,e,s)=>e in t?el(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,xr=(t,e,s)=>tl(t,typeof e!="symbol"?e+"":e,s),M=(t=>(t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t))(M||{});class sl{constructor(){xr(this,"idNodeMap",new Map),xr(this,"nodeMetaMap",new WeakMap)}getId(e){var r;var s;return e&&(r=(s=this.getMeta(e))==null?void 0:s.id)!=null?r:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const s=this.getId(e);this.idNodeMap.delete(s),e.childNodes&&e.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,s){const r=s.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,s)}replace(e,s){const r=this.getNode(e);if(r){const i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(s,i)}this.idNodeMap.set(e,s)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function rl(){return new sl}function il(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function nl(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var s=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};s.prototype=e.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(s,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),s}var Rs={exports:{}},E=String,Fi=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,blackBright:E,redBright:E,greenBright:E,yellowBright:E,blueBright:E,magentaBright:E,cyanBright:E,whiteBright:E,bgBlackBright:E,bgRedBright:E,bgGreenBright:E,bgYellowBright:E,bgBlueBright:E,bgMagentaBright:E,bgCyanBright:E,bgWhiteBright:E}};Rs.exports=Fi();Rs.exports.createColors=Fi;var ol=Rs.exports;const al={},ll=Object.freeze(Object.defineProperty({__proto__:null,default:al},Symbol.toStringTag,{value:"Module"})),Y=nl(ll);let Cr=ol,Er=Y,rs=class _i extends Error{constructor(e,s,r,i,o,a){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),i&&(this.source=i),a&&(this.plugin=a),typeof s<"u"&&typeof r<"u"&&(typeof s=="number"?(this.line=s,this.column=r):(this.line=s.line,this.column=s.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,_i)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let s=this.source;e==null&&(e=Cr.isColorSupported);let r=h=>h,i=h=>h,o=h=>h;if(e){let{bold:h,gray:u,red:p}=Cr.createColors(!0);i=m=>h(p(m)),r=m=>u(m),Er&&(o=m=>Er(m))}let a=s.split(/\r?\n/),n=Math.max(this.line-3,0),l=Math.min(this.line+2,a.length),c=String(l).length;return a.slice(n,l).map((h,u)=>{let p=n+1+u,m=" "+(" "+p).slice(-c)+" | ";if(p===this.line){if(h.length>160){let d=20,S=Math.max(0,this.column-d),f=Math.max(this.column+d,this.endColumn+d),w=h.slice(S,f),g=r(m.replace(/\d/g," "))+h.slice(0,Math.min(this.column-1,d-1)).replace(/[^\t]/g," ");return i(">")+r(m)+o(w)+`
32
+ or you can use record.mirror to access the mirror instance during recording.`;let vr={map:{},getId(){return console.error(re),-1},getNode(){return console.error(re),null},removeNodeFromMap(){console.error(re)},has(){return console.error(re),!1},reset(){console.error(re)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(vr=new Proxy(vr,{get(t,e,s){return e==="map"&&console.error(re),Reflect.get(t,e,s)}}));Date.now().toString();function Ha(t=window){"NodeList"in t&&!t.NodeList.prototype.forEach&&(t.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in t&&!t.DOMTokenList.prototype.forEach&&(t.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let s=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do if(this===s)return!0;while(s=s&&s.parentNode);return!1})}function $a(t){const e={},s=(i,o)=>{const a={value:i,parent:o,children:[]};return e[i.node.id]=a,a},r=[];for(const i of t){const{nextId:o,parentId:a}=i;if(o&&o in e){const n=e[o];if(n.parent){const c=n.parent.children.indexOf(n);n.parent.children.splice(c,0,s(i,n.parent))}else{const c=r.indexOf(n);r.splice(c,0,s(i,null))}continue}if(a in e){const n=e[a];n.children.push(s(i,n));continue}r.push(s(i,null))}return r}function _i(t,e){e(t.value);for(let s=t.children.length-1;s>=0;s--)_i(t.children[s],e)}function Lt(t,e){return!!(t.nodeName==="IFRAME"&&e.getMeta(t))}function Ui(t,e){var s,r;const i=(r=(s=t.ownerDocument)==null?void 0:s.defaultView)==null?void 0:r.frameElement;if(!i||i===e)return{x:0,y:0,relativeScale:1,absoluteScale:1};const o=i.getBoundingClientRect(),a=Ui(i,e),n=o.height/i.clientHeight;return{x:o.x*a.relativeScale+a.x,y:o.y*a.relativeScale+a.y,relativeScale:n,absoluteScale:a.absoluteScale*n}}function Xe(t){return!!(t!=null&&t.shadowRoot)}function xe(t,e){const s=t[e[0]];return e.length===1?s:xe(s.cssRules[e[1]].cssRules,e.slice(2))}function Sr(t){const e=[...t],s=e.pop();return{positions:e,index:s}}function Ja(t){const e=new Set,s=[];for(let r=t.length;r--;){const i=t[r];e.has(i.id)||(s.push(i),e.add(i.id))}return s}class Qa{constructor(){v(this,"id",1),v(this,"styleIDMap",new WeakMap),v(this,"idStyleMap",new Map)}getId(e){var s;return(s=this.styleIDMap.get(e))!=null?s:-1}has(e){return this.styleIDMap.has(e)}add(e,s){if(this.has(e))return this.getId(e);let r;return s===void 0?r=this.id++:r=s,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function Ka(t,e){const s=t||"";switch(e.op){case Se.Append:return s+e.text;case Se.Insert:return s.slice(0,e.pos)+e.text+s.slice(e.pos);case Se.Delete:return s.slice(0,e.pos)+s.slice(e.pos+e.length);case Se.Replace:return s.slice(0,e.pos)+e.text+s.slice(e.pos+e.deleteCount);default:return s}}const qa="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2Zvcih2YXIgcj0iQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyIsdz10eXBlb2YgVWludDhBcnJheT4idSI/W106bmV3IFVpbnQ4QXJyYXkoMjU2KSxpPTA7aTxyLmxlbmd0aDtpKyspd1tyLmNoYXJDb2RlQXQoaSldPWk7dmFyIHA9ZnVuY3Rpb24ocyl7dmFyIGU9bmV3IFVpbnQ4QXJyYXkocyksbixhPWUubGVuZ3RoLHQ9IiI7Zm9yKG49MDtuPGE7bis9Myl0Kz1yW2Vbbl0+PjJdLHQrPXJbKGVbbl0mMyk8PDR8ZVtuKzFdPj40XSx0Kz1yWyhlW24rMV0mMTUpPDwyfGVbbisyXT4+Nl0sdCs9cltlW24rMl0mNjNdO3JldHVybiBhJTM9PT0yP3Q9dC5zdWJzdHJpbmcoMCx0Lmxlbmd0aC0xKSsiPSI6YSUzPT09MSYmKHQ9dC5zdWJzdHJpbmcoMCx0Lmxlbmd0aC0yKSsiPT0iKSx0fTtjb25zdCBsPW5ldyBNYXAsYj1uZXcgTWFwO2FzeW5jIGZ1bmN0aW9uIHkocyxlLG4pe2NvbnN0IGE9YCR7c30tJHtlfWA7aWYoIk9mZnNjcmVlbkNhbnZhcyJpbiBnbG9iYWxUaGlzKXtpZihiLmhhcyhhKSlyZXR1cm4gYi5nZXQoYSk7Y29uc3QgdD1uZXcgT2Zmc2NyZWVuQ2FudmFzKHMsZSk7dC5nZXRDb250ZXh0KCIyZCIpO2NvbnN0IGc9YXdhaXQoYXdhaXQgdC5jb252ZXJ0VG9CbG9iKG4pKS5hcnJheUJ1ZmZlcigpLGM9cChnKTtyZXR1cm4gYi5zZXQoYSxjKSxjfWVsc2UgcmV0dXJuIiJ9Y29uc3Qgbz1zZWxmO28ub25tZXNzYWdlPWFzeW5jIGZ1bmN0aW9uKHMpe2lmKCJPZmZzY3JlZW5DYW52YXMiaW4gZ2xvYmFsVGhpcyl7Y29uc3R7aWQ6ZSxiaXRtYXA6bix3aWR0aDphLGhlaWdodDp0LGRhdGFVUkxPcHRpb25zOnV9PXMuZGF0YSxnPXkoYSx0LHUpLGM9bmV3IE9mZnNjcmVlbkNhbnZhcyhhLHQpO2MuZ2V0Q29udGV4dCgiMmQiKS5kcmF3SW1hZ2UobiwwLDApLG4uY2xvc2UoKTtjb25zdCBkPWF3YWl0IGMuY29udmVydFRvQmxvYih1KSx2PWQudHlwZSxoPWF3YWl0IGQuYXJyYXlCdWZmZXIoKSxmPXAoaCk7aWYoIWwuaGFzKGUpJiZhd2FpdCBnPT09ZilyZXR1cm4gbC5zZXQoZSxmKSxvLnBvc3RNZXNzYWdlKHtpZDplfSk7aWYobC5nZXQoZSk9PT1mKXJldHVybiBvLnBvc3RNZXNzYWdlKHtpZDplfSk7by5wb3N0TWVzc2FnZSh7aWQ6ZSx0eXBlOnYsYmFzZTY0OmYsd2lkdGg6YSxoZWlnaHQ6dH0pLGwuc2V0KGUsZil9ZWxzZSByZXR1cm4gby5wb3N0TWVzc2FnZSh7aWQ6cy5kYXRhLmlkfSl9fSkoKTsKLy8jIHNvdXJjZU1hcHBpbmdVUkw9aW1hZ2UtYml0bWFwLWRhdGEtdXJsLXdvcmtlci1Cb1hHVm1Zby5qcy5tYXAK",el=t=>Uint8Array.from(atob(t),e=>e.charCodeAt(0));typeof self<"u"&&self.Blob&&new Blob([el(qa)],{type:"text/javascript;charset=utf-8"});var xr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ce=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var Ze=0;Ze<xr.length;Ze++)Ce[xr.charCodeAt(Ze)]=Ze;var tl=function(t){var e=t.length*.75,s=t.length,r,i=0,o,a,n,c;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);var l=new ArrayBuffer(e),h=new Uint8Array(l);for(r=0;r<s;r+=4)o=Ce[t.charCodeAt(r)],a=Ce[t.charCodeAt(r+1)],n=Ce[t.charCodeAt(r+2)],c=Ce[t.charCodeAt(r+3)],h[i++]=o<<2|a>>4,h[i++]=(a&15)<<4|n>>2,h[i++]=(n&3)<<6|c&63;return l},Cr;try{if(Array.from([1],t=>t*2)[0]!==2){const t=document.createElement("iframe");document.body.appendChild(t),Array.from=((Cr=t.contentWindow)==null?void 0:Cr.Array.from)||Array.from,document.body.removeChild(t)}}catch(t){console.debug("Unable to override Array.from",t)}ei();var sl=Object.defineProperty,rl=(t,e,s)=>e in t?sl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,y=(t,e,s)=>rl(t,typeof e!="symbol"?e+"":e,s),il=Object.defineProperty,nl=(t,e,s)=>e in t?il(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,Er=(t,e,s)=>nl(t,typeof e!="symbol"?e+"":e,s),M=(t=>(t[t.Document=0]="Document",t[t.DocumentType=1]="DocumentType",t[t.Element=2]="Element",t[t.Text=3]="Text",t[t.CDATA=4]="CDATA",t[t.Comment=5]="Comment",t))(M||{});class ol{constructor(){Er(this,"idNodeMap",new Map),Er(this,"nodeMetaMap",new WeakMap)}getId(e){var r;var s;return e&&(r=(s=this.getMeta(e))==null?void 0:s.id)!=null?r:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const s=this.getId(e);this.idNodeMap.delete(s),e.childNodes&&e.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,s){const r=s.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,s)}replace(e,s){const r=this.getNode(e);if(r){const i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(s,i)}this.idNodeMap.set(e,s)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function al(){return new ol}function ll(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function cl(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var s=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};s.prototype=e.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(s,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),s}var Os={exports:{}},E=String,Bi=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,blackBright:E,redBright:E,greenBright:E,yellowBright:E,blueBright:E,magentaBright:E,cyanBright:E,whiteBright:E,bgBlackBright:E,bgRedBright:E,bgGreenBright:E,bgYellowBright:E,bgBlueBright:E,bgMagentaBright:E,bgCyanBright:E,bgWhiteBright:E}};Os.exports=Bi();Os.exports.createColors=Bi;var hl=Os.exports;const ul={},pl=Object.freeze(Object.defineProperty({__proto__:null,default:ul},Symbol.toStringTag,{value:"Module"})),Y=cl(pl);let Mr=hl,Nr=Y,is=class Wi extends Error{constructor(e,s,r,i,o,a){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),i&&(this.source=i),a&&(this.plugin=a),typeof s<"u"&&typeof r<"u"&&(typeof s=="number"?(this.line=s,this.column=r):(this.line=s.line,this.column=s.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Wi)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let s=this.source;e==null&&(e=Mr.isColorSupported);let r=h=>h,i=h=>h,o=h=>h;if(e){let{bold:h,gray:u,red:p}=Mr.createColors(!0);i=m=>h(p(m)),r=m=>u(m),Nr&&(o=m=>Nr(m))}let a=s.split(/\r?\n/),n=Math.max(this.line-3,0),c=Math.min(this.line+2,a.length),l=String(c).length;return a.slice(n,c).map((h,u)=>{let p=n+1+u,m=" "+(" "+p).slice(-l)+" | ";if(p===this.line){if(h.length>160){let d=20,S=Math.max(0,this.column-d),f=Math.max(this.column+d,this.endColumn+d),w=h.slice(S,f),g=r(m.replace(/\d/g," "))+h.slice(0,Math.min(this.column-1,d-1)).replace(/[^\t]/g," ");return i(">")+r(m)+o(w)+`
33
33
  `+g+i("^")}let b=r(m.replace(/\d/g," "))+h.slice(0,this.column-1).replace(/[^\t]/g," ");return i(">")+r(m)+o(h)+`
34
34
  `+b+i("^")}return" "+r(m)+o(h)}).join(`
35
35
  `)}toString(){let e=this.showSourceCode();return e&&(e=`
36
36
 
37
37
  `+e+`
38
- `),this.name+": "+this.message+e}};var Os=rs;rs.default=rs;const Mr={after:`
38
+ `),this.name+": "+this.message+e}};var As=is;is.default=is;const Tr={after:`
39
39
  `,beforeClose:`
40
40
  `,beforeComment:`
41
41
  `,beforeDecl:`
42
42
  `,beforeOpen:" ",beforeRule:`
43
- `,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function cl(t){return t[0].toUpperCase()+t.slice(1)}let is=class{constructor(t){this.builder=t}atrule(t,e){let s="@"+t.name,r=t.params?this.rawValue(t,"params"):"";if(typeof t.raws.afterName<"u"?s+=t.raws.afterName:r&&(s+=" "),t.nodes)this.block(t,s+r);else{let i=(t.raws.between||"")+(e?";":"");this.builder(s+r+i,t)}}beforeAfter(t,e){let s;t.type==="decl"?s=this.raw(t,null,"beforeDecl"):t.type==="comment"?s=this.raw(t,null,"beforeComment"):e==="before"?s=this.raw(t,null,"beforeRule"):s=this.raw(t,null,"beforeClose");let r=t.parent,i=0;for(;r&&r.type!=="root";)i+=1,r=r.parent;if(s.includes(`
44
- `)){let o=this.raw(t,null,"indent");if(o.length)for(let a=0;a<i;a++)s+=o}return s}block(t,e){let s=this.raw(t,"between","beforeOpen");this.builder(e+s+"{",t,"start");let r;t.nodes&&t.nodes.length?(this.body(t),r=this.raw(t,"after")):r=this.raw(t,"after","emptyBody"),r&&this.builder(r),this.builder("}",t,"end")}body(t){let e=t.nodes.length-1;for(;e>0&&t.nodes[e].type==="comment";)e-=1;let s=this.raw(t,"semicolon");for(let r=0;r<t.nodes.length;r++){let i=t.nodes[r],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,e!==r||s)}}comment(t){let e=this.raw(t,"left","commentLeft"),s=this.raw(t,"right","commentRight");this.builder("/*"+e+t.text+s+"*/",t)}decl(t,e){let s=this.raw(t,"between","colon"),r=t.prop+s+this.rawValue(t,"value");t.important&&(r+=t.raws.important||" !important"),e&&(r+=";"),this.builder(r,t)}document(t){this.body(t)}raw(t,e,s){let r;if(s||(s=e),e&&(r=t.raws[e],typeof r<"u"))return r;let i=t.parent;if(s==="before"&&(!i||i.type==="root"&&i.first===t||i&&i.type==="document"))return"";if(!i)return Mr[s];let o=t.root();if(o.rawCache||(o.rawCache={}),typeof o.rawCache[s]<"u")return o.rawCache[s];if(s==="before"||s==="after")return this.beforeAfter(t,s);{let a="raw"+cl(s);this[a]?r=this[a](o,t):o.walk(n=>{if(r=n.raws[e],typeof r<"u")return!1})}return typeof r>"u"&&(r=Mr[s]),o.rawCache[s]=r,r}rawBeforeClose(t){let e;return t.walk(s=>{if(s.nodes&&s.nodes.length>0&&typeof s.raws.after<"u")return e=s.raws.after,e.includes(`
43
+ `,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function dl(t){return t[0].toUpperCase()+t.slice(1)}let ns=class{constructor(t){this.builder=t}atrule(t,e){let s="@"+t.name,r=t.params?this.rawValue(t,"params"):"";if(typeof t.raws.afterName<"u"?s+=t.raws.afterName:r&&(s+=" "),t.nodes)this.block(t,s+r);else{let i=(t.raws.between||"")+(e?";":"");this.builder(s+r+i,t)}}beforeAfter(t,e){let s;t.type==="decl"?s=this.raw(t,null,"beforeDecl"):t.type==="comment"?s=this.raw(t,null,"beforeComment"):e==="before"?s=this.raw(t,null,"beforeRule"):s=this.raw(t,null,"beforeClose");let r=t.parent,i=0;for(;r&&r.type!=="root";)i+=1,r=r.parent;if(s.includes(`
44
+ `)){let o=this.raw(t,null,"indent");if(o.length)for(let a=0;a<i;a++)s+=o}return s}block(t,e){let s=this.raw(t,"between","beforeOpen");this.builder(e+s+"{",t,"start");let r;t.nodes&&t.nodes.length?(this.body(t),r=this.raw(t,"after")):r=this.raw(t,"after","emptyBody"),r&&this.builder(r),this.builder("}",t,"end")}body(t){let e=t.nodes.length-1;for(;e>0&&t.nodes[e].type==="comment";)e-=1;let s=this.raw(t,"semicolon");for(let r=0;r<t.nodes.length;r++){let i=t.nodes[r],o=this.raw(i,"before");o&&this.builder(o),this.stringify(i,e!==r||s)}}comment(t){let e=this.raw(t,"left","commentLeft"),s=this.raw(t,"right","commentRight");this.builder("/*"+e+t.text+s+"*/",t)}decl(t,e){let s=this.raw(t,"between","colon"),r=t.prop+s+this.rawValue(t,"value");t.important&&(r+=t.raws.important||" !important"),e&&(r+=";"),this.builder(r,t)}document(t){this.body(t)}raw(t,e,s){let r;if(s||(s=e),e&&(r=t.raws[e],typeof r<"u"))return r;let i=t.parent;if(s==="before"&&(!i||i.type==="root"&&i.first===t||i&&i.type==="document"))return"";if(!i)return Tr[s];let o=t.root();if(o.rawCache||(o.rawCache={}),typeof o.rawCache[s]<"u")return o.rawCache[s];if(s==="before"||s==="after")return this.beforeAfter(t,s);{let a="raw"+dl(s);this[a]?r=this[a](o,t):o.walk(n=>{if(r=n.raws[e],typeof r<"u")return!1})}return typeof r>"u"&&(r=Tr[s]),o.rawCache[s]=r,r}rawBeforeClose(t){let e;return t.walk(s=>{if(s.nodes&&s.nodes.length>0&&typeof s.raws.after<"u")return e=s.raws.after,e.includes(`
45
45
  `)&&(e=e.replace(/[^\n]+$/,"")),!1}),e&&(e=e.replace(/\S/g,"")),e}rawBeforeComment(t,e){let s;return t.walkComments(r=>{if(typeof r.raws.before<"u")return s=r.raws.before,s.includes(`
46
46
  `)&&(s=s.replace(/[^\n]+$/,"")),!1}),typeof s>"u"?s=this.raw(e,null,"beforeDecl"):s&&(s=s.replace(/\S/g,"")),s}rawBeforeDecl(t,e){let s;return t.walkDecls(r=>{if(typeof r.raws.before<"u")return s=r.raws.before,s.includes(`
47
47
  `)&&(s=s.replace(/[^\n]+$/,"")),!1}),typeof s>"u"?s=this.raw(e,null,"beforeRule"):s&&(s=s.replace(/\S/g,"")),s}rawBeforeOpen(t){let e;return t.walk(s=>{if(s.type!=="decl"&&(e=s.raws.between,typeof e<"u"))return!1}),e}rawBeforeRule(t){let e;return t.walk(s=>{if(s.nodes&&(s.parent!==t||t.first!==s)&&typeof s.raws.before<"u")return e=s.raws.before,e.includes(`
48
48
  `)&&(e=e.replace(/[^\n]+$/,"")),!1}),e&&(e=e.replace(/\S/g,"")),e}rawColon(t){let e;return t.walkDecls(s=>{if(typeof s.raws.between<"u")return e=s.raws.between.replace(/[^\s:]/g,""),!1}),e}rawEmptyBody(t){let e;return t.walk(s=>{if(s.nodes&&s.nodes.length===0&&(e=s.raws.after,typeof e<"u"))return!1}),e}rawIndent(t){if(t.raws.indent)return t.raws.indent;let e;return t.walk(s=>{let r=s.parent;if(r&&r!==t&&r.parent&&r.parent===t&&typeof s.raws.before<"u"){let i=s.raws.before.split(`
49
- `);return e=i[i.length-1],e=e.replace(/\S/g,""),!1}}),e}rawSemicolon(t){let e;return t.walk(s=>{if(s.nodes&&s.nodes.length&&s.last.type==="decl"&&(e=s.raws.semicolon,typeof e<"u"))return!1}),e}rawValue(t,e){let s=t[e],r=t.raws[e];return r&&r.value===s?r.raw:s}root(t){this.body(t),t.raws.after&&this.builder(t.raws.after)}rule(t){this.block(t,this.rawValue(t,"selector")),t.raws.ownSemicolon&&this.builder(t.raws.ownSemicolon,t,"end")}stringify(t,e){if(!this[t.type])throw new Error("Unknown AST node type "+t.type+". Maybe you need to change PostCSS stringifier.");this[t.type](t,e)}};var Ui=is;is.default=is;let hl=Ui;function ns(t,e){new hl(e).stringify(t)}var xt=ns;ns.default=ns;var Pe={};Pe.isClean=Symbol("isClean");Pe.my=Symbol("my");let ul=Os,pl=Ui,dl=xt,{isClean:ye,my:fl}=Pe;function os(t,e){let s=new t.constructor;for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||r==="proxyCache")continue;let i=t[r],o=typeof i;r==="parent"&&o==="object"?e&&(s[r]=e):r==="source"?s[r]=i:Array.isArray(i)?s[r]=i.map(a=>os(a,s)):(o==="object"&&i!==null&&(i=os(i)),s[r]=i)}return s}function we(t,e){if(e&&typeof e.offset<"u")return e.offset;let s=1,r=1,i=0;for(let o=0;o<t.length;o++){if(r===e.line&&s===e.column){i=o;break}t[o]===`
50
- `?(s=1,r+=1):s+=1}return i}let as=class{get proxyOf(){return this}constructor(t={}){this.raws={},this[ye]=!1,this[fl]=!0;for(let e in t)if(e==="nodes"){this.nodes=[];for(let s of t[e])typeof s.clone=="function"?this.append(s.clone()):this.append(s)}else this[e]=t[e]}addToError(t){if(t.postcssNode=this,t.stack&&this.source&&/\n\s{4}at /.test(t.stack)){let e=this.source;t.stack=t.stack.replace(/\n\s{4}at /,`$&${e.input.from}:${e.start.line}:${e.start.column}$&`)}return t}after(t){return this.parent.insertAfter(this,t),this}assign(t={}){for(let e in t)this[e]=t[e];return this}before(t){return this.parent.insertBefore(this,t),this}cleanRaws(t){delete this.raws.before,delete this.raws.after,t||delete this.raws.between}clone(t={}){let e=os(this);for(let s in t)e[s]=t[s];return e}cloneAfter(t={}){let e=this.clone(t);return this.parent.insertAfter(this,e),e}cloneBefore(t={}){let e=this.clone(t);return this.parent.insertBefore(this,e),e}error(t,e={}){if(this.source){let{end:s,start:r}=this.rangeBy(e);return this.source.input.error(t,{column:r.column,line:r.line},{column:s.column,line:s.line},e)}return new ul(t)}getProxyProcessor(){return{get(t,e){return e==="proxyOf"?t:e==="root"?()=>t.root().toProxy():t[e]},set(t,e,s){return t[e]===s||(t[e]=s,(e==="prop"||e==="value"||e==="name"||e==="params"||e==="important"||e==="text")&&t.markDirty()),!0}}}markClean(){this[ye]=!0}markDirty(){if(this[ye]){this[ye]=!1;let t=this;for(;t=t.parent;)t[ye]=!1}}next(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t+1]}positionBy(t){let e=this.source.start;if(t.index)e=this.positionInside(t.index);else if(t.word){let s="document"in this.source.input?this.source.input.document:this.source.input.css,r=s.slice(we(s,this.source.start),we(s,this.source.end)).indexOf(t.word);r!==-1&&(e=this.positionInside(r))}return e}positionInside(t){let e=this.source.start.column,s=this.source.start.line,r="document"in this.source.input?this.source.input.document:this.source.input.css,i=we(r,this.source.start),o=i+t;for(let a=i;a<o;a++)r[a]===`
51
- `?(e=1,s+=1):e+=1;return{column:e,line:s}}prev(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t-1]}rangeBy(t){let e={column:this.source.start.column,line:this.source.start.line},s=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:e.column+1,line:e.line};if(t.word){let r="document"in this.source.input?this.source.input.document:this.source.input.css,i=r.slice(we(r,this.source.start),we(r,this.source.end)).indexOf(t.word);i!==-1&&(e=this.positionInside(i),s=this.positionInside(i+t.word.length))}else t.start?e={column:t.start.column,line:t.start.line}:t.index&&(e=this.positionInside(t.index)),t.end?s={column:t.end.column,line:t.end.line}:typeof t.endIndex=="number"?s=this.positionInside(t.endIndex):t.index&&(s=this.positionInside(t.index+1));return(s.line<e.line||s.line===e.line&&s.column<=e.column)&&(s={column:e.column+1,line:e.line}),{end:s,start:e}}raw(t,e){return new pl().raw(this,t,e)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...t){if(this.parent){let e=this,s=!1;for(let r of t)r===this?s=!0:s?(this.parent.insertAfter(e,r),e=r):this.parent.insertBefore(e,r);s||this.remove()}return this}root(){let t=this;for(;t.parent&&t.parent.type!=="document";)t=t.parent;return t}toJSON(t,e){let s={},r=e==null;e=e||new Map;let i=0;for(let o in this){if(!Object.prototype.hasOwnProperty.call(this,o)||o==="parent"||o==="proxyCache")continue;let a=this[o];if(Array.isArray(a))s[o]=a.map(n=>typeof n=="object"&&n.toJSON?n.toJSON(null,e):n);else if(typeof a=="object"&&a.toJSON)s[o]=a.toJSON(null,e);else if(o==="source"){let n=e.get(a.input);n==null&&(n=i,e.set(a.input,i),i++),s[o]={end:a.end,inputId:n,start:a.start}}else s[o]=a}return r&&(s.inputs=[...e.keys()].map(o=>o.toJSON())),s}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(t=dl){t.stringify&&(t=t.stringify);let e="";return t(this,s=>{e+=s}),e}warn(t,e,s){let r={node:this};for(let i in s)r[i]=s[i];return t.warn(e,r)}};var Ct=as;as.default=as;let ml=Ct,ls=class extends ml{constructor(t){super(t),this.type="comment"}};var Et=ls;ls.default=ls;let gl=Ct,cs=class extends gl{get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}constructor(t){t&&typeof t.value<"u"&&typeof t.value!="string"&&(t=W(O({},t),{value:String(t.value)})),super(t),this.type="decl"}};var Mt=cs;cs.default=cs;let Bi=Et,Wi=Mt,yl=Ct,{isClean:ji,my:Vi}=Pe,As,zi,Yi,Is;function Gi(t){return t.map(e=>(e.nodes&&(e.nodes=Gi(e.nodes)),delete e.source,e))}function Xi(t){if(t[ji]=!1,t.proxyOf.nodes)for(let e of t.proxyOf.nodes)Xi(e)}let J=class Zi extends yl{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]}append(...e){for(let s of e){let r=this.normalize(s,this.last);for(let i of r)this.proxyOf.nodes.push(i)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let s of this.nodes)s.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let s=this.getIterator(),r,i;for(;this.indexes[s]<this.proxyOf.nodes.length&&(r=this.indexes[s],i=e(this.proxyOf.nodes[r],r),i!==!1);)this.indexes[s]+=1;return delete this.indexes[s],i}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get(e,s){return s==="proxyOf"?e:e[s]?s==="each"||typeof s=="string"&&s.startsWith("walk")?(...r)=>e[s](...r.map(i=>typeof i=="function"?(o,a)=>i(o.toProxy(),a):i)):s==="every"||s==="some"?r=>e[s]((i,...o)=>r(i.toProxy(),...o)):s==="root"?()=>e.root().toProxy():s==="nodes"?e.nodes.map(r=>r.toProxy()):s==="first"||s==="last"?e[s].toProxy():e[s]:e[s]},set(e,s,r){return e[s]===r||(e[s]=r,(s==="name"||s==="params"||s==="selector")&&e.markDirty()),!0}}}index(e){return typeof e=="number"?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,s){let r=this.index(e),i=this.normalize(s,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let a of i)this.proxyOf.nodes.splice(r+1,0,a);let o;for(let a in this.indexes)o=this.indexes[a],r<o&&(this.indexes[a]=o+i.length);return this.markDirty(),this}insertBefore(e,s){let r=this.index(e),i=r===0?"prepend":!1,o=this.normalize(s,this.proxyOf.nodes[r],i).reverse();r=this.index(e);for(let n of o)this.proxyOf.nodes.splice(r,0,n);let a;for(let n in this.indexes)a=this.indexes[n],r<=a&&(this.indexes[n]=a+o.length);return this.markDirty(),this}normalize(e,s){if(typeof e=="string")e=Gi(zi(e).nodes);else if(typeof e>"u")e=[];else if(Array.isArray(e)){e=e.slice(0);for(let r of e)r.parent&&r.parent.removeChild(r,"ignore")}else if(e.type==="root"&&this.type!=="document"){e=e.nodes.slice(0);for(let r of e)r.parent&&r.parent.removeChild(r,"ignore")}else if(e.type)e=[e];else if(e.prop){if(typeof e.value>"u")throw new Error("Value field is missed in node creation");typeof e.value!="string"&&(e.value=String(e.value)),e=[new Wi(e)]}else if(e.selector||e.selectors)e=[new Is(e)];else if(e.name)e=[new As(e)];else if(e.text)e=[new Bi(e)];else throw new Error("Unknown node type in node creation");return e.map(r=>(r[Vi]||Zi.rebuild(r),r=r.proxyOf,r.parent&&r.parent.removeChild(r),r[ji]&&Xi(r),r.raws||(r.raws={}),typeof r.raws.before>"u"&&s&&typeof s.raws.before<"u"&&(r.raws.before=s.raws.before.replace(/\S/g,"")),r.parent=this.proxyOf,r))}prepend(...e){e=e.reverse();for(let s of e){let r=this.normalize(s,this.first,"prepend").reverse();for(let i of r)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+r.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let s;for(let r in this.indexes)s=this.indexes[r],s>=e&&(this.indexes[r]=s-1);return this.markDirty(),this}replaceValues(e,s,r){return r||(r=s,s={}),this.walkDecls(i=>{s.props&&!s.props.includes(i.prop)||s.fast&&!i.value.includes(s.fast)||(i.value=i.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((s,r)=>{let i;try{i=e(s,r)}catch(o){throw s.addToError(o)}return i!==!1&&s.walk&&(i=s.walk(e)),i})}walkAtRules(e,s){return s?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="atrule"&&e.test(r.name))return s(r,i)}):this.walk((r,i)=>{if(r.type==="atrule"&&r.name===e)return s(r,i)}):(s=e,this.walk((r,i)=>{if(r.type==="atrule")return s(r,i)}))}walkComments(e){return this.walk((s,r)=>{if(s.type==="comment")return e(s,r)})}walkDecls(e,s){return s?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="decl"&&e.test(r.prop))return s(r,i)}):this.walk((r,i)=>{if(r.type==="decl"&&r.prop===e)return s(r,i)}):(s=e,this.walk((r,i)=>{if(r.type==="decl")return s(r,i)}))}walkRules(e,s){return s?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="rule"&&e.test(r.selector))return s(r,i)}):this.walk((r,i)=>{if(r.type==="rule"&&r.selector===e)return s(r,i)}):(s=e,this.walk((r,i)=>{if(r.type==="rule")return s(r,i)}))}};J.registerParse=t=>{zi=t};J.registerRule=t=>{Is=t};J.registerAtRule=t=>{As=t};J.registerRoot=t=>{Yi=t};var ee=J;J.default=J;J.rebuild=t=>{t.type==="atrule"?Object.setPrototypeOf(t,As.prototype):t.type==="rule"?Object.setPrototypeOf(t,Is.prototype):t.type==="decl"?Object.setPrototypeOf(t,Wi.prototype):t.type==="comment"?Object.setPrototypeOf(t,Bi.prototype):t.type==="root"&&Object.setPrototypeOf(t,Yi.prototype),t[Vi]=!0,t.nodes&&t.nodes.forEach(e=>{J.rebuild(e)})};let Hi=ee,ht=class extends Hi{constructor(t){super(t),this.type="atrule"}append(...t){return this.proxyOf.nodes||(this.nodes=[]),super.append(...t)}prepend(...t){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...t)}};var Ps=ht;ht.default=ht;Hi.registerAtRule(ht);let wl=ee,Ji,$i,ke=class extends wl{constructor(t){super(O({type:"document"},t)),this.nodes||(this.nodes=[])}toResult(t={}){return new Ji(new $i,this,t).stringify()}};ke.registerLazyResult=t=>{Ji=t};ke.registerProcessor=t=>{$i=t};var Ls=ke;ke.default=ke;let bl="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",vl=(t=21)=>{let e="",s=t|0;for(;s--;)e+=bl[Math.random()*64|0];return e};var Sl={nanoid:vl};let{existsSync:xl,readFileSync:Cl}=Y,{dirname:Lt,join:El}=Y,{SourceMapConsumer:Nr,SourceMapGenerator:Tr}=Y;function Ml(t){return Buffer?Buffer.from(t,"base64").toString():window.atob(t)}let hs=class{constructor(t,e){if(e.map===!1)return;this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:");let s=e.map?e.map.prev:void 0,r=this.loadMap(e.from,s);!this.mapFile&&e.from&&(this.mapFile=e.from),this.mapFile&&(this.root=Lt(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new Nr(this.text)),this.consumerCache}decodeInline(t){let e=/^data:application\/json;charset=utf-?8;base64,/,s=/^data:application\/json;base64,/,r=/^data:application\/json;charset=utf-?8,/,i=/^data:application\/json,/,o=t.match(r)||t.match(i);if(o)return decodeURIComponent(t.substr(o[0].length));let a=t.match(e)||t.match(s);if(a)return Ml(t.substr(a[0].length));let n=t.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+n)}getAnnotationURL(t){return t.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(t){return typeof t!="object"?!1:typeof t.mappings=="string"||typeof t._mappings=="string"||Array.isArray(t.sections)}loadAnnotation(t){let e=t.match(/\/\*\s*# sourceMappingURL=/g);if(!e)return;let s=t.lastIndexOf(e.pop()),r=t.indexOf("*/",s);s>-1&&r>-1&&(this.annotation=this.getAnnotationURL(t.substring(s,r)))}loadFile(t){if(this.root=Lt(t),xl(t))return this.mapFile=t,Cl(t,"utf-8").toString().trim()}loadMap(t,e){if(e===!1)return!1;if(e){if(typeof e=="string")return e;if(typeof e=="function"){let s=e(t);if(s){let r=this.loadFile(s);if(!r)throw new Error("Unable to load previous source map: "+s.toString());return r}}else{if(e instanceof Nr)return Tr.fromSourceMap(e).toString();if(e instanceof Tr)return e.toString();if(this.isMap(e))return JSON.stringify(e);throw new Error("Unsupported previous source map format: "+e.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let s=this.annotation;return t&&(s=El(Lt(t),s)),this.loadFile(s)}}}startWith(t,e){return t?t.substr(0,e.length)===e:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var Qi=hs;hs.default=hs;let{nanoid:Nl}=Sl,{isAbsolute:us,resolve:ps}=Y,{SourceMapConsumer:Tl,SourceMapGenerator:kl}=Y,{fileURLToPath:kr,pathToFileURL:Ze}=Y,Dr=Os,Dl=Qi,Ft=Y,_t=Symbol("fromOffsetCache"),Rl=!!(Tl&&kl),Rr=!!(ps&&us),ut=class{get from(){return this.file||this.id}constructor(t,e={}){if(t===null||typeof t>"u"||typeof t=="object"&&!t.toString)throw new Error(`PostCSS received ${t} instead of CSS string`);if(this.css=t.toString(),this.css[0]==="\uFEFF"||this.css[0]==="\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,e.document&&(this.document=e.document.toString()),e.from&&(!Rr||/^\w+:\/\//.test(e.from)||us(e.from)?this.file=e.from:this.file=ps(e.from)),Rr&&Rl){let s=new Dl(this.css,e);if(s.text){this.map=s;let r=s.consumer().file;!this.file&&r&&(this.file=this.mapResolve(r))}}this.file||(this.id="<input css "+Nl(6)+">"),this.map&&(this.map.file=this.from)}error(t,e,s,r={}){let i,o,a;if(e&&typeof e=="object"){let l=e,c=s;if(typeof l.offset=="number"){let h=this.fromOffset(l.offset);e=h.line,s=h.col}else e=l.line,s=l.column;if(typeof c.offset=="number"){let h=this.fromOffset(c.offset);o=h.line,i=h.col}else o=c.line,i=c.column}else if(!s){let l=this.fromOffset(e);e=l.line,s=l.col}let n=this.origin(e,s,o,i);return n?a=new Dr(t,n.endLine===void 0?n.line:{column:n.column,line:n.line},n.endLine===void 0?n.column:{column:n.endColumn,line:n.endLine},n.source,n.file,r.plugin):a=new Dr(t,o===void 0?e:{column:s,line:e},o===void 0?s:{column:i,line:o},this.css,this.file,r.plugin),a.input={column:s,endColumn:i,endLine:o,line:e,source:this.css},this.file&&(Ze&&(a.input.url=Ze(this.file).toString()),a.input.file=this.file),a}fromOffset(t){let e,s;if(this[_t])s=this[_t];else{let i=this.css.split(`
52
- `);s=new Array(i.length);let o=0;for(let a=0,n=i.length;a<n;a++)s[a]=o,o+=i[a].length+1;this[_t]=s}e=s[s.length-1];let r=0;if(t>=e)r=s.length-1;else{let i=s.length-2,o;for(;r<i;)if(o=r+(i-r>>1),t<s[o])i=o-1;else if(t>=s[o+1])r=o+1;else{r=o;break}}return{col:t-s[r]+1,line:r+1}}mapResolve(t){return/^\w+:\/\//.test(t)?t:ps(this.map.consumer().sourceRoot||this.map.root||".",t)}origin(t,e,s,r){if(!this.map)return!1;let i=this.map.consumer(),o=i.originalPositionFor({column:e,line:t});if(!o.source)return!1;let a;typeof s=="number"&&(a=i.originalPositionFor({column:r,line:s}));let n;us(o.source)?n=Ze(o.source):n=new URL(o.source,this.map.consumer().sourceRoot||Ze(this.map.mapFile));let l={column:o.column,endColumn:a&&a.column,endLine:a&&a.line,line:o.line,url:n.toString()};if(n.protocol==="file:")if(kr)l.file=kr(n);else throw new Error("file: protocol is not available in this PostCSS build");let c=i.sourceContentFor(o.source);return c&&(l.source=c),l}toJSON(){let t={};for(let e of["hasBOM","css","file","id"])this[e]!=null&&(t[e]=this[e]);return this.map&&(t.map=O({},this.map),t.map.consumerCache&&(t.map.consumerCache=void 0)),t}};var Nt=ut;ut.default=ut;Ft&&Ft.registerInput&&Ft.registerInput(ut);let Ki=ee,qi,en,le=class extends Ki{constructor(t){super(t),this.type="root",this.nodes||(this.nodes=[])}normalize(t,e,s){let r=super.normalize(t);if(e){if(s==="prepend")this.nodes.length>1?e.raws.before=this.nodes[1].raws.before:delete e.raws.before;else if(this.first!==e)for(let i of r)i.raws.before=e.raws.before}return r}removeChild(t,e){let s=this.index(t);return!e&&s===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[s].raws.before),super.removeChild(t)}toResult(t={}){return new qi(new en,this,t).stringify()}};le.registerLazyResult=t=>{qi=t};le.registerProcessor=t=>{en=t};var Le=le;le.default=le;Ki.registerRoot(le);let De={comma(t){return De.split(t,[","],!0)},space(t){let e=[" ",`
53
- `," "];return De.split(t,e)},split(t,e,s){let r=[],i="",o=!1,a=0,n=!1,l="",c=!1;for(let h of t)c?c=!1:h==="\\"?c=!0:n?h===l&&(n=!1):h==='"'||h==="'"?(n=!0,l=h):h==="("?a+=1:h===")"?a>0&&(a-=1):a===0&&e.includes(h)&&(o=!0),o?(i!==""&&r.push(i.trim()),i="",o=!1):i+=h;return(s||i!=="")&&r.push(i.trim()),r}};var tn=De;De.default=De;let sn=ee,Ol=tn,pt=class extends sn{get selectors(){return Ol.comma(this.selector)}set selectors(t){let e=this.selector?this.selector.match(/,\s*/):null,s=e?e[0]:","+this.raw("between","beforeOpen");this.selector=t.join(s)}constructor(t){super(t),this.type="rule",this.nodes||(this.nodes=[])}};var Fs=pt;pt.default=pt;sn.registerRule(pt);let Al=Ps,Il=Et,Pl=Mt,Ll=Nt,Fl=Qi,_l=Le,Ul=Fs;function Re(t,e){if(Array.isArray(t))return t.map(a=>Re(a));let i=t,{inputs:s}=i,r=pe(i,["inputs"]);if(s){e=[];for(let a of s){let n=W(O({},a),{__proto__:Ll.prototype});n.map&&(n.map=W(O({},n.map),{__proto__:Fl.prototype})),e.push(n)}}if(r.nodes&&(r.nodes=t.nodes.map(a=>Re(a,e))),r.source){let o=r.source,{inputId:a}=o,n=pe(o,["inputId"]);r.source=n,a!=null&&(r.source.input=e[a])}if(r.type==="root")return new _l(r);if(r.type==="decl")return new Pl(r);if(r.type==="rule")return new Ul(r);if(r.type==="comment")return new Il(r);if(r.type==="atrule")return new Al(r);throw new Error("Unknown node type: "+t.type)}var Bl=Re;Re.default=Re;let{dirname:rt,relative:rn,resolve:nn,sep:on}=Y,{SourceMapConsumer:an,SourceMapGenerator:it}=Y,{pathToFileURL:Or}=Y,Wl=Nt,jl=!!(an&&it),Vl=!!(rt&&nn&&rn&&on),zl=class{constructor(t,e,s,r){this.stringify=t,this.mapOpts=s.map||{},this.root=e,this.opts=s,this.css=r,this.originalCSS=r,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let t;this.isInline()?t="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?t=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?t=this.mapOpts.annotation(this.opts.to,this.root):t=this.outputFile()+".map";let e=`
49
+ `);return e=i[i.length-1],e=e.replace(/\S/g,""),!1}}),e}rawSemicolon(t){let e;return t.walk(s=>{if(s.nodes&&s.nodes.length&&s.last.type==="decl"&&(e=s.raws.semicolon,typeof e<"u"))return!1}),e}rawValue(t,e){let s=t[e],r=t.raws[e];return r&&r.value===s?r.raw:s}root(t){this.body(t),t.raws.after&&this.builder(t.raws.after)}rule(t){this.block(t,this.rawValue(t,"selector")),t.raws.ownSemicolon&&this.builder(t.raws.ownSemicolon,t,"end")}stringify(t,e){if(!this[t.type])throw new Error("Unknown AST node type "+t.type+". Maybe you need to change PostCSS stringifier.");this[t.type](t,e)}};var ji=ns;ns.default=ns;let fl=ji;function os(t,e){new fl(e).stringify(t)}var Ct=os;os.default=os;var Le={};Le.isClean=Symbol("isClean");Le.my=Symbol("my");let ml=As,gl=ji,yl=Ct,{isClean:we,my:wl}=Le;function as(t,e){let s=new t.constructor;for(let r in t){if(!Object.prototype.hasOwnProperty.call(t,r)||r==="proxyCache")continue;let i=t[r],o=typeof i;r==="parent"&&o==="object"?e&&(s[r]=e):r==="source"?s[r]=i:Array.isArray(i)?s[r]=i.map(a=>as(a,s)):(o==="object"&&i!==null&&(i=as(i)),s[r]=i)}return s}function $(t,e){if(e&&typeof e.offset<"u")return e.offset;let s=1,r=1,i=0;for(let o=0;o<t.length;o++){if(r===e.line&&s===e.column){i=o;break}t[o]===`
50
+ `?(s=1,r+=1):s+=1}return i}let ls=class{get proxyOf(){return this}constructor(t={}){this.raws={},this[we]=!1,this[wl]=!0;for(let e in t)if(e==="nodes"){this.nodes=[];for(let s of t[e])typeof s.clone=="function"?this.append(s.clone()):this.append(s)}else this[e]=t[e]}addToError(t){if(t.postcssNode=this,t.stack&&this.source&&/\n\s{4}at /.test(t.stack)){let e=this.source;t.stack=t.stack.replace(/\n\s{4}at /,`$&${e.input.from}:${e.start.line}:${e.start.column}$&`)}return t}after(t){return this.parent.insertAfter(this,t),this}assign(t={}){for(let e in t)this[e]=t[e];return this}before(t){return this.parent.insertBefore(this,t),this}cleanRaws(t){delete this.raws.before,delete this.raws.after,t||delete this.raws.between}clone(t={}){let e=as(this);for(let s in t)e[s]=t[s];return e}cloneAfter(t={}){let e=this.clone(t);return this.parent.insertAfter(this,e),e}cloneBefore(t={}){let e=this.clone(t);return this.parent.insertBefore(this,e),e}error(t,e={}){if(this.source){let{end:s,start:r}=this.rangeBy(e);return this.source.input.error(t,{column:r.column,line:r.line},{column:s.column,line:s.line},e)}return new ml(t)}getProxyProcessor(){return{get(t,e){return e==="proxyOf"?t:e==="root"?()=>t.root().toProxy():t[e]},set(t,e,s){return t[e]===s||(t[e]=s,(e==="prop"||e==="value"||e==="name"||e==="params"||e==="important"||e==="text")&&t.markDirty()),!0}}}markClean(){this[we]=!0}markDirty(){if(this[we]){this[we]=!1;let t=this;for(;t=t.parent;)t[we]=!1}}next(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t+1]}positionBy(t={}){let e=this.source.start;if(t.index)e=this.positionInside(t.index);else if(t.word){let s="document"in this.source.input?this.source.input.document:this.source.input.css,r=s.slice($(s,this.source.start),$(s,this.source.end)).indexOf(t.word);r!==-1&&(e=this.positionInside(r))}return e}positionInside(t){let e=this.source.start.column,s=this.source.start.line,r="document"in this.source.input?this.source.input.document:this.source.input.css,i=$(r,this.source.start),o=i+t;for(let a=i;a<o;a++)r[a]===`
51
+ `?(e=1,s+=1):e+=1;return{column:e,line:s,offset:o}}prev(){if(!this.parent)return;let t=this.parent.index(this);return this.parent.nodes[t-1]}rangeBy(t={}){let e="document"in this.source.input?this.source.input.document:this.source.input.css,s={column:this.source.start.column,line:this.source.start.line,offset:$(e,this.source.start)},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:typeof this.source.end.offset=="number"?this.source.end.offset:$(e,this.source.end)+1}:{column:s.column+1,line:s.line,offset:s.offset+1};if(t.word){let i=e.slice($(e,this.source.start),$(e,this.source.end)).indexOf(t.word);i!==-1&&(s=this.positionInside(i),r=this.positionInside(i+t.word.length))}else t.start?s={column:t.start.column,line:t.start.line,offset:$(e,t.start)}:t.index&&(s=this.positionInside(t.index)),t.end?r={column:t.end.column,line:t.end.line,offset:$(e,t.end)}:typeof t.endIndex=="number"?r=this.positionInside(t.endIndex):t.index&&(r=this.positionInside(t.index+1));return(r.line<s.line||r.line===s.line&&r.column<=s.column)&&(r={column:s.column+1,line:s.line,offset:s.offset+1}),{end:r,start:s}}raw(t,e){return new gl().raw(this,t,e)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...t){if(this.parent){let e=this,s=!1;for(let r of t)r===this?s=!0:s?(this.parent.insertAfter(e,r),e=r):this.parent.insertBefore(e,r);s||this.remove()}return this}root(){let t=this;for(;t.parent&&t.parent.type!=="document";)t=t.parent;return t}toJSON(t,e){let s={},r=e==null;e=e||new Map;let i=0;for(let o in this){if(!Object.prototype.hasOwnProperty.call(this,o)||o==="parent"||o==="proxyCache")continue;let a=this[o];if(Array.isArray(a))s[o]=a.map(n=>typeof n=="object"&&n.toJSON?n.toJSON(null,e):n);else if(typeof a=="object"&&a.toJSON)s[o]=a.toJSON(null,e);else if(o==="source"){if(a==null)continue;let n=e.get(a.input);n==null&&(n=i,e.set(a.input,i),i++),s[o]={end:a.end,inputId:n,start:a.start}}else s[o]=a}return r&&(s.inputs=[...e.keys()].map(o=>o.toJSON())),s}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(t=yl){t.stringify&&(t=t.stringify);let e="";return t(this,s=>{e+=s}),e}warn(t,e,s={}){let r={node:this};for(let i in s)r[i]=s[i];return t.warn(e,r)}};var Et=ls;ls.default=ls;let bl=Et,cs=class extends bl{constructor(t){super(t),this.type="comment"}};var Mt=cs;cs.default=cs;let vl=Et,hs=class extends vl{get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}constructor(t){t&&typeof t.value<"u"&&typeof t.value!="string"&&(t=W(O({},t),{value:String(t.value)})),super(t),this.type="decl"}};var Nt=hs;hs.default=hs;let Vi=Mt,zi=Nt,Sl=Et,{isClean:Yi,my:Gi}=Le,Is,Xi,Zi,Ps;function Hi(t){return t.map(e=>(e.nodes&&(e.nodes=Hi(e.nodes)),delete e.source,e))}function $i(t){if(t[Yi]=!1,t.proxyOf.nodes)for(let e of t.proxyOf.nodes)$i(e)}let Q=class Ji extends Sl{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]}append(...e){for(let s of e){let r=this.normalize(s,this.last);for(let i of r)this.proxyOf.nodes.push(i)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let s of this.nodes)s.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let s=this.getIterator(),r,i;for(;this.indexes[s]<this.proxyOf.nodes.length&&(r=this.indexes[s],i=e(this.proxyOf.nodes[r],r),i!==!1);)this.indexes[s]+=1;return delete this.indexes[s],i}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get(e,s){return s==="proxyOf"?e:e[s]?s==="each"||typeof s=="string"&&s.startsWith("walk")?(...r)=>e[s](...r.map(i=>typeof i=="function"?(o,a)=>i(o.toProxy(),a):i)):s==="every"||s==="some"?r=>e[s]((i,...o)=>r(i.toProxy(),...o)):s==="root"?()=>e.root().toProxy():s==="nodes"?e.nodes.map(r=>r.toProxy()):s==="first"||s==="last"?e[s].toProxy():e[s]:e[s]},set(e,s,r){return e[s]===r||(e[s]=r,(s==="name"||s==="params"||s==="selector")&&e.markDirty()),!0}}}index(e){return typeof e=="number"?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,s){let r=this.index(e),i=this.normalize(s,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let a of i)this.proxyOf.nodes.splice(r+1,0,a);let o;for(let a in this.indexes)o=this.indexes[a],r<o&&(this.indexes[a]=o+i.length);return this.markDirty(),this}insertBefore(e,s){let r=this.index(e),i=r===0?"prepend":!1,o=this.normalize(s,this.proxyOf.nodes[r],i).reverse();r=this.index(e);for(let n of o)this.proxyOf.nodes.splice(r,0,n);let a;for(let n in this.indexes)a=this.indexes[n],r<=a&&(this.indexes[n]=a+o.length);return this.markDirty(),this}normalize(e,s){if(typeof e=="string")e=Hi(Xi(e).nodes);else if(typeof e>"u")e=[];else if(Array.isArray(e)){e=e.slice(0);for(let r of e)r.parent&&r.parent.removeChild(r,"ignore")}else if(e.type==="root"&&this.type!=="document"){e=e.nodes.slice(0);for(let r of e)r.parent&&r.parent.removeChild(r,"ignore")}else if(e.type)e=[e];else if(e.prop){if(typeof e.value>"u")throw new Error("Value field is missed in node creation");typeof e.value!="string"&&(e.value=String(e.value)),e=[new zi(e)]}else if(e.selector||e.selectors)e=[new Ps(e)];else if(e.name)e=[new Is(e)];else if(e.text)e=[new Vi(e)];else throw new Error("Unknown node type in node creation");return e.map(r=>(r[Gi]||Ji.rebuild(r),r=r.proxyOf,r.parent&&r.parent.removeChild(r),r[Yi]&&$i(r),r.raws||(r.raws={}),typeof r.raws.before>"u"&&s&&typeof s.raws.before<"u"&&(r.raws.before=s.raws.before.replace(/\S/g,"")),r.parent=this.proxyOf,r))}prepend(...e){e=e.reverse();for(let s of e){let r=this.normalize(s,this.first,"prepend").reverse();for(let i of r)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+r.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let s;for(let r in this.indexes)s=this.indexes[r],s>=e&&(this.indexes[r]=s-1);return this.markDirty(),this}replaceValues(e,s,r){return r||(r=s,s={}),this.walkDecls(i=>{s.props&&!s.props.includes(i.prop)||s.fast&&!i.value.includes(s.fast)||(i.value=i.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((s,r)=>{let i;try{i=e(s,r)}catch(o){throw s.addToError(o)}return i!==!1&&s.walk&&(i=s.walk(e)),i})}walkAtRules(e,s){return s?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="atrule"&&e.test(r.name))return s(r,i)}):this.walk((r,i)=>{if(r.type==="atrule"&&r.name===e)return s(r,i)}):(s=e,this.walk((r,i)=>{if(r.type==="atrule")return s(r,i)}))}walkComments(e){return this.walk((s,r)=>{if(s.type==="comment")return e(s,r)})}walkDecls(e,s){return s?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="decl"&&e.test(r.prop))return s(r,i)}):this.walk((r,i)=>{if(r.type==="decl"&&r.prop===e)return s(r,i)}):(s=e,this.walk((r,i)=>{if(r.type==="decl")return s(r,i)}))}walkRules(e,s){return s?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="rule"&&e.test(r.selector))return s(r,i)}):this.walk((r,i)=>{if(r.type==="rule"&&r.selector===e)return s(r,i)}):(s=e,this.walk((r,i)=>{if(r.type==="rule")return s(r,i)}))}};Q.registerParse=t=>{Xi=t};Q.registerRule=t=>{Ps=t};Q.registerAtRule=t=>{Is=t};Q.registerRoot=t=>{Zi=t};var se=Q;Q.default=Q;Q.rebuild=t=>{t.type==="atrule"?Object.setPrototypeOf(t,Is.prototype):t.type==="rule"?Object.setPrototypeOf(t,Ps.prototype):t.type==="decl"?Object.setPrototypeOf(t,zi.prototype):t.type==="comment"?Object.setPrototypeOf(t,Vi.prototype):t.type==="root"&&Object.setPrototypeOf(t,Zi.prototype),t[Gi]=!0,t.nodes&&t.nodes.forEach(e=>{Q.rebuild(e)})};let Qi=se,ut=class extends Qi{constructor(t){super(t),this.type="atrule"}append(...t){return this.proxyOf.nodes||(this.nodes=[]),super.append(...t)}prepend(...t){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...t)}};var Ls=ut;ut.default=ut;Qi.registerAtRule(ut);let xl=se,Ki,qi,De=class extends xl{constructor(t){super(O({type:"document"},t)),this.nodes||(this.nodes=[])}toResult(t={}){return new Ki(new qi,this,t).stringify()}};De.registerLazyResult=t=>{Ki=t};De.registerProcessor=t=>{qi=t};var Fs=De;De.default=De;let Cl="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",El=(t=21)=>{let e="",s=t|0;for(;s--;)e+=Cl[Math.random()*64|0];return e};var Ml={nanoid:El};let{existsSync:Nl,readFileSync:Tl}=Y,{dirname:Ft,join:kl}=Y,{SourceMapConsumer:kr,SourceMapGenerator:Dr}=Y;function Dl(t){return Buffer?Buffer.from(t,"base64").toString():window.atob(t)}let us=class{constructor(t,e){if(e.map===!1)return;this.loadAnnotation(t),this.inline=this.startWith(this.annotation,"data:");let s=e.map?e.map.prev:void 0,r=this.loadMap(e.from,s);!this.mapFile&&e.from&&(this.mapFile=e.from),this.mapFile&&(this.root=Ft(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new kr(this.text)),this.consumerCache}decodeInline(t){let e=/^data:application\/json;charset=utf-?8;base64,/,s=/^data:application\/json;base64,/,r=/^data:application\/json;charset=utf-?8,/,i=/^data:application\/json,/,o=t.match(r)||t.match(i);if(o)return decodeURIComponent(t.substr(o[0].length));let a=t.match(e)||t.match(s);if(a)return Dl(t.substr(a[0].length));let n=t.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+n)}getAnnotationURL(t){return t.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(t){return typeof t!="object"?!1:typeof t.mappings=="string"||typeof t._mappings=="string"||Array.isArray(t.sections)}loadAnnotation(t){let e=t.match(/\/\*\s*# sourceMappingURL=/g);if(!e)return;let s=t.lastIndexOf(e.pop()),r=t.indexOf("*/",s);s>-1&&r>-1&&(this.annotation=this.getAnnotationURL(t.substring(s,r)))}loadFile(t){if(this.root=Ft(t),Nl(t))return this.mapFile=t,Tl(t,"utf-8").toString().trim()}loadMap(t,e){if(e===!1)return!1;if(e){if(typeof e=="string")return e;if(typeof e=="function"){let s=e(t);if(s){let r=this.loadFile(s);if(!r)throw new Error("Unable to load previous source map: "+s.toString());return r}}else{if(e instanceof kr)return Dr.fromSourceMap(e).toString();if(e instanceof Dr)return e.toString();if(this.isMap(e))return JSON.stringify(e);throw new Error("Unsupported previous source map format: "+e.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let s=this.annotation;return t&&(s=kl(Ft(t),s)),this.loadFile(s)}}}startWith(t,e){return t?t.substr(0,e.length)===e:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var en=us;us.default=us;let{nanoid:Rl}=Ml,{isAbsolute:ps,resolve:ds}=Y,{SourceMapConsumer:Ol,SourceMapGenerator:Al}=Y,{fileURLToPath:Rr,pathToFileURL:He}=Y,Or=As,Il=en,_t=Y,Ut=Symbol("lineToIndexCache"),Pl=!!(Ol&&Al),Ar=!!(ds&&ps);function Ir(t){if(t[Ut])return t[Ut];let e=t.css.split(`
52
+ `),s=new Array(e.length),r=0;for(let i=0,o=e.length;i<o;i++)s[i]=r,r+=e[i].length+1;return t[Ut]=s,s}let pt=class{get from(){return this.file||this.id}constructor(t,e={}){if(t===null||typeof t>"u"||typeof t=="object"&&!t.toString)throw new Error(`PostCSS received ${t} instead of CSS string`);if(this.css=t.toString(),this.css[0]==="\uFEFF"||this.css[0]==="\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,e.document&&(this.document=e.document.toString()),e.from&&(!Ar||/^\w+:\/\//.test(e.from)||ps(e.from)?this.file=e.from:this.file=ds(e.from)),Ar&&Pl){let s=new Il(this.css,e);if(s.text){this.map=s;let r=s.consumer().file;!this.file&&r&&(this.file=this.mapResolve(r))}}this.file||(this.id="<input css "+Rl(6)+">"),this.map&&(this.map.file=this.from)}error(t,e,s,r={}){let i,o,a,n,c;if(e&&typeof e=="object"){let h=e,u=s;if(typeof h.offset=="number"){n=h.offset;let p=this.fromOffset(n);e=p.line,s=p.col}else e=h.line,s=h.column,n=this.fromLineAndColumn(e,s);if(typeof u.offset=="number"){a=u.offset;let p=this.fromOffset(a);o=p.line,i=p.col}else o=u.line,i=u.column,a=this.fromLineAndColumn(u.line,u.column)}else if(s)n=this.fromLineAndColumn(e,s);else{n=e;let h=this.fromOffset(n);e=h.line,s=h.col}let l=this.origin(e,s,o,i);return l?c=new Or(t,l.endLine===void 0?l.line:{column:l.column,line:l.line},l.endLine===void 0?l.column:{column:l.endColumn,line:l.endLine},l.source,l.file,r.plugin):c=new Or(t,o===void 0?e:{column:s,line:e},o===void 0?s:{column:i,line:o},this.css,this.file,r.plugin),c.input={column:s,endColumn:i,endLine:o,endOffset:a,line:e,offset:n,source:this.css},this.file&&(He&&(c.input.url=He(this.file).toString()),c.input.file=this.file),c}fromLineAndColumn(t,e){return Ir(this)[t-1]+e-1}fromOffset(t){let e=Ir(this),s=e[e.length-1],r=0;if(t>=s)r=e.length-1;else{let i=e.length-2,o;for(;r<i;)if(o=r+(i-r>>1),t<e[o])i=o-1;else if(t>=e[o+1])r=o+1;else{r=o;break}}return{col:t-e[r]+1,line:r+1}}mapResolve(t){return/^\w+:\/\//.test(t)?t:ds(this.map.consumer().sourceRoot||this.map.root||".",t)}origin(t,e,s,r){if(!this.map)return!1;let i=this.map.consumer(),o=i.originalPositionFor({column:e,line:t});if(!o.source)return!1;let a;typeof s=="number"&&(a=i.originalPositionFor({column:r,line:s}));let n;ps(o.source)?n=He(o.source):n=new URL(o.source,this.map.consumer().sourceRoot||He(this.map.mapFile));let c={column:o.column,endColumn:a&&a.column,endLine:a&&a.line,line:o.line,url:n.toString()};if(n.protocol==="file:")if(Rr)c.file=Rr(n);else throw new Error("file: protocol is not available in this PostCSS build");let l=i.sourceContentFor(o.source);return l&&(c.source=l),c}toJSON(){let t={};for(let e of["hasBOM","css","file","id"])this[e]!=null&&(t[e]=this[e]);return this.map&&(t.map=O({},this.map),t.map.consumerCache&&(t.map.consumerCache=void 0)),t}};var Tt=pt;pt.default=pt;_t&&_t.registerInput&&_t.registerInput(pt);let tn=se,sn,rn,he=class extends tn{constructor(t){super(t),this.type="root",this.nodes||(this.nodes=[])}normalize(t,e,s){let r=super.normalize(t);if(e){if(s==="prepend")this.nodes.length>1?e.raws.before=this.nodes[1].raws.before:delete e.raws.before;else if(this.first!==e)for(let i of r)i.raws.before=e.raws.before}return r}removeChild(t,e){let s=this.index(t);return!e&&s===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[s].raws.before),super.removeChild(t)}toResult(t={}){return new sn(new rn,this,t).stringify()}};he.registerLazyResult=t=>{sn=t};he.registerProcessor=t=>{rn=t};var Fe=he;he.default=he;tn.registerRoot(he);let Re={comma(t){return Re.split(t,[","],!0)},space(t){let e=[" ",`
53
+ `," "];return Re.split(t,e)},split(t,e,s){let r=[],i="",o=!1,a=0,n=!1,c="",l=!1;for(let h of t)l?l=!1:h==="\\"?l=!0:n?h===c&&(n=!1):h==='"'||h==="'"?(n=!0,c=h):h==="("?a+=1:h===")"?a>0&&(a-=1):a===0&&e.includes(h)&&(o=!0),o?(i!==""&&r.push(i.trim()),i="",o=!1):i+=h;return(s||i!=="")&&r.push(i.trim()),r}};var nn=Re;Re.default=Re;let on=se,Ll=nn,dt=class extends on{get selectors(){return Ll.comma(this.selector)}set selectors(t){let e=this.selector?this.selector.match(/,\s*/):null,s=e?e[0]:","+this.raw("between","beforeOpen");this.selector=t.join(s)}constructor(t){super(t),this.type="rule",this.nodes||(this.nodes=[])}};var _s=dt;dt.default=dt;on.registerRule(dt);let Fl=Ls,_l=Mt,Ul=Nt,Bl=Tt,Wl=en,jl=Fe,Vl=_s;function Oe(t,e){if(Array.isArray(t))return t.map(a=>Oe(a));let i=t,{inputs:s}=i,r=fe(i,["inputs"]);if(s){e=[];for(let a of s){let n=W(O({},a),{__proto__:Bl.prototype});n.map&&(n.map=W(O({},n.map),{__proto__:Wl.prototype})),e.push(n)}}if(r.nodes&&(r.nodes=t.nodes.map(a=>Oe(a,e))),r.source){let o=r.source,{inputId:a}=o,n=fe(o,["inputId"]);r.source=n,a!=null&&(r.source.input=e[a])}if(r.type==="root")return new jl(r);if(r.type==="decl")return new Ul(r);if(r.type==="rule")return new Vl(r);if(r.type==="comment")return new _l(r);if(r.type==="atrule")return new Fl(r);throw new Error("Unknown node type: "+t.type)}var zl=Oe;Oe.default=Oe;let{dirname:it,relative:an,resolve:ln,sep:cn}=Y,{SourceMapConsumer:hn,SourceMapGenerator:nt}=Y,{pathToFileURL:Pr}=Y,Yl=Tt,Gl=!!(hn&&nt),Xl=!!(it&&ln&&an&&cn),Zl=class{constructor(t,e,s,r){this.stringify=t,this.mapOpts=s.map||{},this.root=e,this.opts=s,this.css=r,this.originalCSS=r,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let t;this.isInline()?t="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?t=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?t=this.mapOpts.annotation(this.opts.to,this.root):t=this.outputFile()+".map";let e=`
54
54
  `;this.css.includes(`\r
55
55
  `)&&(e=`\r
56
- `),this.css+=e+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let e=this.toUrl(this.path(t.file)),s=t.root||rt(t.file),r;this.mapOpts.sourcesContent===!1?(r=new an(t.text),r.sourcesContent&&(r.sourcesContent=null)):r=t.consumer(),this.map.applySourceMap(r,e,this.toUrl(this.path(s)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let t;for(let e=this.root.nodes.length-1;e>=0;e--)t=this.root.nodes[e],t.type==="comment"&&t.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(e)}else this.css&&(this.css=this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),Vl&&jl&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,e=>{t+=e}),[t]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let t=this.previous()[0].consumer();t.file=this.outputFile(),this.map=it.fromSourceMap(t,{ignoreInvalidMapping:!0})}else this.map=new it({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 it({file:this.outputFile(),ignoreInvalidMapping:!0});let t=1,e=1,s="<no source>",r={generated:{column:0,line:0},original:{column:0,line:0},source:""},i,o;this.stringify(this.root,(a,n,l)=>{if(this.css+=a,n&&l!=="end"&&(r.generated.line=t,r.generated.column=e-1,n.source&&n.source.start?(r.source=this.sourcePath(n),r.original.line=n.source.start.line,r.original.column=n.source.start.column-1,this.map.addMapping(r)):(r.source=s,r.original.line=1,r.original.column=0,this.map.addMapping(r))),o=a.match(/\n/g),o?(t+=o.length,i=a.lastIndexOf(`
57
- `),e=a.length-i):e+=a.length,n&&l!=="start"){let c=n.parent||{raws:{}};(!(n.type==="decl"||n.type==="atrule"&&!n.nodes)||n!==c.last||c.raws.semicolon)&&(n.source&&n.source.end?(r.source=this.sourcePath(n),r.original.line=n.source.end.line,r.original.column=n.source.end.column-1,r.generated.line=t,r.generated.column=e-2,this.map.addMapping(r)):(r.source=s,r.original.line=1,r.original.column=0,r.generated.line=t,r.generated.column=e-1,this.map.addMapping(r)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(t=>t.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let t=this.mapOpts.annotation;return typeof t<"u"&&t!==!0?!1:this.previous().length?this.previous().some(e=>e.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(t=>t.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(t){if(this.mapOpts.absolute||t.charCodeAt(0)===60||/^\w+:\/\//.test(t))return t;let e=this.memoizedPaths.get(t);if(e)return e;let s=this.opts.to?rt(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(s=rt(nn(s,this.mapOpts.annotation)));let r=rn(s,t);return this.memoizedPaths.set(t,r),r}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(t=>{if(t.source&&t.source.input.map){let e=t.source.input.map;this.previousMaps.includes(e)||this.previousMaps.push(e)}});else{let t=new Wl(this.originalCSS,this.opts);t.map&&this.previousMaps.push(t.map)}return this.previousMaps}setSourcesContent(){let t={};if(this.root)this.root.walk(e=>{if(e.source){let s=e.source.input.from;if(s&&!t[s]){t[s]=!0;let r=this.usesFileUrls?this.toFileUrl(s):this.toUrl(this.path(s));this.map.setSourceContent(r,e.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(t){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(t.source.input.from):this.toUrl(this.path(t.source.input.from))}toBase64(t){return Buffer?Buffer.from(t).toString("base64"):window.btoa(unescape(encodeURIComponent(t)))}toFileUrl(t){let e=this.memoizedFileURLs.get(t);if(e)return e;if(Or){let s=Or(t).toString();return this.memoizedFileURLs.set(t,s),s}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(t){let e=this.memoizedURLs.get(t);if(e)return e;on==="\\"&&(t=t.replace(/\\/g,"/"));let s=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,s),s}};var ln=zl;const Ut=39,Ar=34,He=92,Ir=47,Je=10,be=32,$e=12,Qe=9,Ke=13,Yl=91,Gl=93,Xl=40,Zl=41,Hl=123,Jl=125,$l=59,Ql=42,Kl=58,ql=64,qe=/[\t\n\f\r "#'()/;[\\\]{}]/g,et=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,ec=/.[\r\n"'(/\\]/,Pr=/[\da-f]/i;var tc=function(t,e={}){let s=t.css.valueOf(),r=e.ignoreErrors,i,o,a,n,l,c,h,u,p,m,b=s.length,d=0,S=[],f=[];function w(){return d}function g(F){throw t.error("Unclosed "+F,d)}function x(){return f.length===0&&d>=b}function P(F){if(f.length)return f.pop();if(d>=b)return;let V=F?F.ignoreUnclosed:!1;switch(i=s.charCodeAt(d),i){case Je:case be:case Qe:case Ke:case $e:{n=d;do n+=1,i=s.charCodeAt(n);while(i===be||i===Je||i===Qe||i===Ke||i===$e);c=["space",s.slice(d,n)],d=n-1;break}case Yl:case Gl:case Hl:case Jl:case Kl:case $l:case Zl:{let K=String.fromCharCode(i);c=[K,K,d];break}case Xl:{if(m=S.length?S.pop()[1]:"",p=s.charCodeAt(d+1),m==="url"&&p!==Ut&&p!==Ar&&p!==be&&p!==Je&&p!==Qe&&p!==$e&&p!==Ke){n=d;do{if(h=!1,n=s.indexOf(")",n+1),n===-1)if(r||V){n=d;break}else g("bracket");for(u=n;s.charCodeAt(u-1)===He;)u-=1,h=!h}while(h);c=["brackets",s.slice(d,n+1),d,n],d=n}else n=s.indexOf(")",d+1),o=s.slice(d,n+1),n===-1||ec.test(o)?c=["(","(",d]:(c=["brackets",o,d,n],d=n);break}case Ut:case Ar:{l=i===Ut?"'":'"',n=d;do{if(h=!1,n=s.indexOf(l,n+1),n===-1)if(r||V){n=d+1;break}else g("string");for(u=n;s.charCodeAt(u-1)===He;)u-=1,h=!h}while(h);c=["string",s.slice(d,n+1),d,n],d=n;break}case ql:{qe.lastIndex=d+1,qe.test(s),qe.lastIndex===0?n=s.length-1:n=qe.lastIndex-2,c=["at-word",s.slice(d,n+1),d,n],d=n;break}case He:{for(n=d,a=!0;s.charCodeAt(n+1)===He;)n+=1,a=!a;if(i=s.charCodeAt(n+1),a&&i!==Ir&&i!==be&&i!==Je&&i!==Qe&&i!==Ke&&i!==$e&&(n+=1,Pr.test(s.charAt(n)))){for(;Pr.test(s.charAt(n+1));)n+=1;s.charCodeAt(n+1)===be&&(n+=1)}c=["word",s.slice(d,n+1),d,n],d=n;break}default:{i===Ir&&s.charCodeAt(d+1)===Ql?(n=s.indexOf("*/",d+2)+1,n===0&&(r||V?n=s.length:g("comment")),c=["comment",s.slice(d,n+1),d,n],d=n):(et.lastIndex=d+1,et.test(s),et.lastIndex===0?n=s.length-1:n=et.lastIndex-2,c=["word",s.slice(d,n+1),d,n],S.push(c),d=n);break}}return d++,c}function B(F){f.push(F)}return{back:B,endOfFile:x,nextToken:P,position:w}};let sc=Ps,rc=Et,ic=Mt,nc=Le,Lr=Fs,oc=tc;const Fr={empty:!0,space:!0};function ac(t){for(let e=t.length-1;e>=0;e--){let s=t[e],r=s[3]||s[2];if(r)return r}}let lc=class{constructor(t){this.input=t,this.root=new nc,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{column:1,line:1,offset:0}}}atrule(t){let e=new sc;e.name=t[1].slice(1),e.name===""&&this.unnamedAtrule(e,t),this.init(e,t[2]);let s,r,i,o=!1,a=!1,n=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=this.tokenizer.nextToken(),s=t[0],s==="("||s==="["?l.push(s==="("?")":"]"):s==="{"&&l.length>0?l.push("}"):s===l[l.length-1]&&l.pop(),l.length===0)if(s===";"){e.source.end=this.getPosition(t[2]),e.source.end.offset++,this.semicolon=!0;break}else if(s==="{"){a=!0;break}else if(s==="}"){if(n.length>0){for(i=n.length-1,r=n[i];r&&r[0]==="space";)r=n[--i];r&&(e.source.end=this.getPosition(r[3]||r[2]),e.source.end.offset++)}this.end(t);break}else n.push(t);else n.push(t);if(this.tokenizer.endOfFile()){o=!0;break}}e.raws.between=this.spacesAndCommentsFromEnd(n),n.length?(e.raws.afterName=this.spacesAndCommentsFromStart(n),this.raw(e,"params",n),o&&(t=n[n.length-1],e.source.end=this.getPosition(t[3]||t[2]),e.source.end.offset++,this.spaces=e.raws.between,e.raws.between="")):(e.raws.afterName="",e.params=""),a&&(e.nodes=[],this.current=e)}checkMissedSemicolon(t){let e=this.colon(t);if(e===!1)return;let s=0,r;for(let i=e-1;i>=0&&(r=t[i],!(r[0]!=="space"&&(s+=1,s===2)));i--);throw this.input.error("Missed semicolon",r[0]==="word"?r[3]+1:r[2])}colon(t){let e=0,s,r,i;for(let[o,a]of t.entries()){if(r=a,i=r[0],i==="("&&(e+=1),i===")"&&(e-=1),e===0&&i===":")if(!s)this.doubleColon(r);else{if(s[0]==="word"&&s[1]==="progid")continue;return o}s=r}return!1}comment(t){let e=new rc;this.init(e,t[2]),e.source.end=this.getPosition(t[3]||t[2]),e.source.end.offset++;let s=t[1].slice(2,-2);if(/^\s*$/.test(s))e.text="",e.raws.left=s,e.raws.right="";else{let r=s.match(/^(\s*)([^]*\S)(\s*)$/);e.text=r[2],e.raws.left=r[1],e.raws.right=r[3]}}createTokenizer(){this.tokenizer=oc(this.input)}decl(t,e){let s=new ic;this.init(s,t[0][2]);let r=t[t.length-1];for(r[0]===";"&&(this.semicolon=!0,t.pop()),s.source.end=this.getPosition(r[3]||r[2]||ac(t)),s.source.end.offset++;t[0][0]!=="word";)t.length===1&&this.unknownWord(t),s.raws.before+=t.shift()[1];for(s.source.start=this.getPosition(t[0][2]),s.prop="";t.length;){let n=t[0][0];if(n===":"||n==="space"||n==="comment")break;s.prop+=t.shift()[1]}s.raws.between="";let i;for(;t.length;)if(i=t.shift(),i[0]===":"){s.raws.between+=i[1];break}else i[0]==="word"&&/\w/.test(i[1])&&this.unknownWord([i]),s.raws.between+=i[1];(s.prop[0]==="_"||s.prop[0]==="*")&&(s.raws.before+=s.prop[0],s.prop=s.prop.slice(1));let o=[],a;for(;t.length&&(a=t[0][0],!(a!=="space"&&a!=="comment"));)o.push(t.shift());this.precheckMissedSemicolon(t);for(let n=t.length-1;n>=0;n--){if(i=t[n],i[1].toLowerCase()==="!important"){s.important=!0;let l=this.stringFrom(t,n);l=this.spacesFromEnd(t)+l,l!==" !important"&&(s.raws.important=l);break}else if(i[1].toLowerCase()==="important"){let l=t.slice(0),c="";for(let h=n;h>0;h--){let u=l[h][0];if(c.trim().startsWith("!")&&u!=="space")break;c=l.pop()[1]+c}c.trim().startsWith("!")&&(s.important=!0,s.raws.important=c,t=l)}if(i[0]!=="space"&&i[0]!=="comment")break}t.some(n=>n[0]!=="space"&&n[0]!=="comment")&&(s.raws.between+=o.map(n=>n[1]).join(""),o=[]),this.raw(s,"value",o.concat(t),e),s.value.includes(":")&&!e&&this.checkMissedSemicolon(t)}doubleColon(t){throw this.input.error("Double colon",{offset:t[2]},{offset:t[2]+t[1].length})}emptyRule(t){let e=new Lr;this.init(e,t[2]),e.selector="",e.raws.between="",this.current=e}end(t){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(t[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(t)}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(t){if(this.spaces+=t[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&e.type==="rule"&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="",e.source.end=this.getPosition(t[2]),e.source.end.offset+=e.raws.ownSemicolon.length)}}getPosition(t){let e=this.input.fromOffset(t);return{column:e.col,line:e.line,offset:t}}init(t,e){this.current.push(t),t.source={input:this.input,start:this.getPosition(e)},t.raws.before=this.spaces,this.spaces="",t.type!=="comment"&&(this.semicolon=!1)}other(t){let e=!1,s=null,r=!1,i=null,o=[],a=t[1].startsWith("--"),n=[],l=t;for(;l;){if(s=l[0],n.push(l),s==="("||s==="[")i||(i=l),o.push(s==="("?")":"]");else if(a&&r&&s==="{")i||(i=l),o.push("}");else if(o.length===0)if(s===";")if(r){this.decl(n,a);return}else break;else if(s==="{"){this.rule(n);return}else if(s==="}"){this.tokenizer.back(n.pop()),e=!0;break}else s===":"&&(r=!0);else s===o[o.length-1]&&(o.pop(),o.length===0&&(i=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(e=!0),o.length>0&&this.unclosedBracket(i),e&&r){if(!a)for(;n.length&&(l=n[n.length-1][0],!(l!=="space"&&l!=="comment"));)this.tokenizer.back(n.pop());this.decl(n,a)}else this.unknownWord(n)}parse(){let t;for(;!this.tokenizer.endOfFile();)switch(t=this.tokenizer.nextToken(),t[0]){case"space":this.spaces+=t[1];break;case";":this.freeSemicolon(t);break;case"}":this.end(t);break;case"comment":this.comment(t);break;case"at-word":this.atrule(t);break;case"{":this.emptyRule(t);break;default:this.other(t);break}this.endFile()}precheckMissedSemicolon(){}raw(t,e,s,r){let i,o,a=s.length,n="",l=!0,c,h;for(let u=0;u<a;u+=1)i=s[u],o=i[0],o==="space"&&u===a-1&&!r?l=!1:o==="comment"?(h=s[u-1]?s[u-1][0]:"empty",c=s[u+1]?s[u+1][0]:"empty",!Fr[h]&&!Fr[c]?n.slice(-1)===","?l=!1:n+=i[1]:l=!1):n+=i[1];if(!l){let u=s.reduce((p,m)=>p+m[1],"");t.raws[e]={raw:u,value:n}}t[e]=n}rule(t){t.pop();let e=new Lr;this.init(e,t[0][2]),e.raws.between=this.spacesAndCommentsFromEnd(t),this.raw(e,"selector",t),this.current=e}spacesAndCommentsFromEnd(t){let e,s="";for(;t.length&&(e=t[t.length-1][0],!(e!=="space"&&e!=="comment"));)s=t.pop()[1]+s;return s}spacesAndCommentsFromStart(t){let e,s="";for(;t.length&&(e=t[0][0],!(e!=="space"&&e!=="comment"));)s+=t.shift()[1];return s}spacesFromEnd(t){let e,s="";for(;t.length&&(e=t[t.length-1][0],e==="space");)s=t.pop()[1]+s;return s}stringFrom(t,e){let s="";for(let r=e;r<t.length;r++)s+=t[r][1];return t.splice(e,t.length-e),s}unclosedBlock(){let t=this.current.source.start;throw this.input.error("Unclosed block",t.line,t.column)}unclosedBracket(t){throw this.input.error("Unclosed bracket",{offset:t[2]},{offset:t[2]+1})}unexpectedClose(t){throw this.input.error("Unexpected }",{offset:t[2]},{offset:t[2]+1})}unknownWord(t){throw this.input.error("Unknown word "+t[0][1],{offset:t[0][2]},{offset:t[0][2]+t[0][1].length})}unnamedAtrule(t,e){throw this.input.error("At-rule without name",{offset:e[2]},{offset:e[2]+e[1].length})}};var cc=lc;let hc=ee,uc=Nt,pc=cc;function dt(t,e){let s=new uc(t,e),r=new pc(s);try{r.parse()}catch(i){throw i}return r.root}var _s=dt;dt.default=dt;hc.registerParse(dt);let ds=class{constructor(t,e={}){if(this.type="warning",this.text=t,e.node&&e.node.source){let s=e.node.rangeBy(e);this.line=s.start.line,this.column=s.start.column,this.endLine=s.end.line,this.endColumn=s.end.column}for(let s in e)this[s]=e[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}};var cn=ds;ds.default=ds;let dc=cn,fs=class{get content(){return this.css}constructor(t,e,s){this.processor=t,this.messages=[],this.root=e,this.opts=s,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,e={}){e.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(e.plugin=this.lastPlugin.postcssPlugin);let s=new dc(t,e);return this.messages.push(s),s}warnings(){return this.messages.filter(t=>t.type==="warning")}};var Us=fs;fs.default=fs;let fc=ee,mc=Ls,gc=ln,yc=_s,_r=Us,wc=Le,bc=xt,{isClean:X,my:vc}=Pe;const Sc={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},xc={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},Cc={Once:!0,postcssPlugin:!0,prepare:!0},ce=0;function ve(t){return typeof t=="object"&&typeof t.then=="function"}function hn(t){let e=!1,s=Sc[t.type];return t.type==="decl"?e=t.prop.toLowerCase():t.type==="atrule"&&(e=t.name.toLowerCase()),e&&t.append?[s,s+"-"+e,ce,s+"Exit",s+"Exit-"+e]:e?[s,s+"-"+e,s+"Exit",s+"Exit-"+e]:t.append?[s,ce,s+"Exit"]:[s,s+"Exit"]}function Ur(t){let e;return t.type==="document"?e=["Document",ce,"DocumentExit"]:t.type==="root"?e=["Root",ce,"RootExit"]:e=hn(t),{eventIndex:0,events:e,iterator:0,node:t,visitorIndex:0,visitors:[]}}function ms(t){return t[X]=!1,t.nodes&&t.nodes.forEach(e=>ms(e)),t}let gs={},he=class un{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"}constructor(e,s,r){this.stringified=!1,this.processed=!1;let i;if(typeof s=="object"&&s!==null&&(s.type==="root"||s.type==="document"))i=ms(s);else if(s instanceof un||s instanceof _r)i=ms(s.root),s.map&&(typeof r.map>"u"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=s.map);else{let o=yc;r.syntax&&(o=r.syntax.parse),r.parser&&(o=r.parser),o.parse&&(o=o.parse);try{i=o(s,r)}catch(a){this.processed=!0,this.error=a}i&&!i[vc]&&fc.rebuild(i)}this.result=new _r(e,i,r),this.helpers=W(O({},gs),{postcss:gs,result:this.result}),this.plugins=this.processor.plugins.map(o=>typeof o=="object"&&o.prepare?O(O({},o),o.prepare(this.result)):o)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,s){let r=this.result.lastPlugin;try{s&&s.addToError(e),this.error=e,e.name==="CssSyntaxError"&&!e.plugin?(e.plugin=r.postcssPlugin,e.setMessage()):r.postcssVersion}catch(i){console&&console.error&&console.error(i)}return e}prepareVisitors(){this.listeners={};let e=(s,r,i)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([s,i])};for(let s of this.plugins)if(typeof s=="object")for(let r in s){if(!xc[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${s.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Cc[r])if(typeof s[r]=="object")for(let i in s[r])i==="*"?e(s,r,s[r][i]):e(s,r+"-"+i.toLowerCase(),s[r][i]);else typeof s[r]=="function"&&e(s,r,s[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let s=this.plugins[e],r=this.runOnRoot(s);if(ve(r))try{await r}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[X];){e[X]=!0;let s=[Ur(e)];for(;s.length>0;){let r=this.visitTick(s);if(ve(r))try{await r}catch(i){let o=s[s.length-1].node;throw this.handleError(i,o)}}}if(this.listeners.OnceExit)for(let[s,r]of this.listeners.OnceExit){this.result.lastPlugin=s;try{if(e.type==="document"){let i=e.nodes.map(o=>r(o,this.helpers));await Promise.all(i)}else await r(e,this.helpers)}catch(i){throw this.handleError(i)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if(typeof e=="object"&&e.Once){if(this.result.root.type==="document"){let s=this.result.root.nodes.map(r=>e.Once(r,this.helpers));return ve(s[0])?Promise.all(s):s}return e.Once(this.result.root,this.helpers)}else if(typeof e=="function")return e(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 e=this.result.opts,s=bc;e.syntax&&(s=e.syntax.stringify),e.stringifier&&(s=e.stringifier),s.stringify&&(s=s.stringify);let r=new gc(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 e of this.plugins){let s=this.runOnRoot(e);if(ve(s))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[X];)e[X]=!0,this.walkSync(e);if(this.listeners.OnceExit)if(e.type==="document")for(let s of e.nodes)this.visitSync(this.listeners.OnceExit,s);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,s){return this.async().then(e,s)}toString(){return this.css}visitSync(e,s){for(let[r,i]of e){this.result.lastPlugin=r;let o;try{o=i(s,this.helpers)}catch(a){throw this.handleError(a,s.proxyOf)}if(s.type!=="root"&&s.type!=="document"&&!s.parent)return!0;if(ve(o))throw this.getAsyncError()}}visitTick(e){let s=e[e.length-1],{node:r,visitors:i}=s;if(r.type!=="root"&&r.type!=="document"&&!r.parent){e.pop();return}if(i.length>0&&s.visitorIndex<i.length){let[a,n]=i[s.visitorIndex];s.visitorIndex+=1,s.visitorIndex===i.length&&(s.visitors=[],s.visitorIndex=0),this.result.lastPlugin=a;try{return n(r.toProxy(),this.helpers)}catch(l){throw this.handleError(l,r)}}if(s.iterator!==0){let a=s.iterator,n;for(;n=r.nodes[r.indexes[a]];)if(r.indexes[a]+=1,!n[X]){n[X]=!0,e.push(Ur(n));return}s.iterator=0,delete r.indexes[a]}let o=s.events;for(;s.eventIndex<o.length;){let a=o[s.eventIndex];if(s.eventIndex+=1,a===ce){r.nodes&&r.nodes.length&&(r[X]=!0,s.iterator=r.getIterator());return}else if(this.listeners[a]){s.visitors=this.listeners[a];return}}e.pop()}walkSync(e){e[X]=!0;let s=hn(e);for(let r of s)if(r===ce)e.nodes&&e.each(i=>{i[X]||this.walkSync(i)});else{let i=this.listeners[r];if(i&&this.visitSync(i,e.toProxy()))return}}warnings(){return this.sync().warnings()}};he.registerPostcss=t=>{gs=t};var pn=he;he.default=he;wc.registerLazyResult(he);mc.registerLazyResult(he);let Ec=ln,Mc=_s;const Nc=Us;let Tc=xt;let ys=class{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 t,e=Mc;try{t=e(this._css,this._opts)}catch(s){this.error=s}if(this.error)throw this.error;return this._root=t,t}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(t,e,s){e=e.toString(),this.stringified=!1,this._processor=t,this._css=e,this._opts=s,this._map=void 0;let r,i=Tc;this.result=new Nc(this._processor,r,this._opts),this.result.css=e;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let a=new Ec(i,r,this._opts,e);if(a.isMap()){let[n,l]=a.generate();n&&(this.result.css=n),l&&(this.result.map=l)}else a.clearAnnotation(),this.result.css=a.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}sync(){if(this.error)throw this.error;return this.result}then(t,e){return this.async().then(t,e)}toString(){return this._css}warnings(){return[]}};var kc=ys;ys.default=ys;let Dc=Ls,Rc=pn,Oc=kc,Ac=Le,Oe=class{constructor(t=[]){this.version="8.5.3",this.plugins=this.normalize(t)}normalize(t){let e=[];for(let s of t)if(s.postcss===!0?s=s():s.postcss&&(s=s.postcss),typeof s=="object"&&Array.isArray(s.plugins))e=e.concat(s.plugins);else if(typeof s=="object"&&s.postcssPlugin)e.push(s);else if(typeof s=="function")e.push(s);else if(!(typeof s=="object"&&(s.parse||s.stringify)))throw new Error(s+" is not a PostCSS plugin");return e}process(t,e={}){return!this.plugins.length&&!e.parser&&!e.stringifier&&!e.syntax?new Oc(this,t,e):new Rc(this,t,e)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}};var Ic=Oe;Oe.default=Oe;Ac.registerProcessor(Oe);Dc.registerProcessor(Oe);let dn=Ps,fn=Et,Pc=ee,Lc=Os,mn=Mt,gn=Ls,Fc=Bl,_c=Nt,Uc=pn,Bc=tn,Wc=Ct,jc=_s,Bs=Ic,Vc=Us,yn=Le,wn=Fs,zc=xt,Yc=cn;function D(...t){return t.length===1&&Array.isArray(t[0])&&(t=t[0]),new Bs(t)}D.plugin=function(t,e){let s=!1;function r(...o){console&&console.warn&&!s&&(s=!0,console.warn(t+`: postcss.plugin was deprecated. Migration guide:
56
+ `),this.css+=e+"/*# sourceMappingURL="+t+" */"}applyPrevMaps(){for(let t of this.previous()){let e=this.toUrl(this.path(t.file)),s=t.root||it(t.file),r;this.mapOpts.sourcesContent===!1?(r=new hn(t.text),r.sourcesContent&&(r.sourcesContent=null)):r=t.consumer(),this.map.applySourceMap(r,e,this.toUrl(this.path(s)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let t;for(let e=this.root.nodes.length-1;e>=0;e--)t=this.root.nodes[e],t.type==="comment"&&t.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(e)}else this.css&&(this.css=this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),Xl&&Gl&&this.isMap())return this.generateMap();{let t="";return this.stringify(this.root,e=>{t+=e}),[t]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let t=this.previous()[0].consumer();t.file=this.outputFile(),this.map=nt.fromSourceMap(t,{ignoreInvalidMapping:!0})}else this.map=new nt({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 nt({file:this.outputFile(),ignoreInvalidMapping:!0});let t=1,e=1,s="<no source>",r={generated:{column:0,line:0},original:{column:0,line:0},source:""},i,o;this.stringify(this.root,(a,n,c)=>{if(this.css+=a,n&&c!=="end"&&(r.generated.line=t,r.generated.column=e-1,n.source&&n.source.start?(r.source=this.sourcePath(n),r.original.line=n.source.start.line,r.original.column=n.source.start.column-1,this.map.addMapping(r)):(r.source=s,r.original.line=1,r.original.column=0,this.map.addMapping(r))),o=a.match(/\n/g),o?(t+=o.length,i=a.lastIndexOf(`
57
+ `),e=a.length-i):e+=a.length,n&&c!=="start"){let l=n.parent||{raws:{}};(!(n.type==="decl"||n.type==="atrule"&&!n.nodes)||n!==l.last||l.raws.semicolon)&&(n.source&&n.source.end?(r.source=this.sourcePath(n),r.original.line=n.source.end.line,r.original.column=n.source.end.column-1,r.generated.line=t,r.generated.column=e-2,this.map.addMapping(r)):(r.source=s,r.original.line=1,r.original.column=0,r.generated.line=t,r.generated.column=e-1,this.map.addMapping(r)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(t=>t.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let t=this.mapOpts.annotation;return typeof t<"u"&&t!==!0?!1:this.previous().length?this.previous().some(e=>e.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(t=>t.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(t){if(this.mapOpts.absolute||t.charCodeAt(0)===60||/^\w+:\/\//.test(t))return t;let e=this.memoizedPaths.get(t);if(e)return e;let s=this.opts.to?it(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(s=it(ln(s,this.mapOpts.annotation)));let r=an(s,t);return this.memoizedPaths.set(t,r),r}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(t=>{if(t.source&&t.source.input.map){let e=t.source.input.map;this.previousMaps.includes(e)||this.previousMaps.push(e)}});else{let t=new Yl(this.originalCSS,this.opts);t.map&&this.previousMaps.push(t.map)}return this.previousMaps}setSourcesContent(){let t={};if(this.root)this.root.walk(e=>{if(e.source){let s=e.source.input.from;if(s&&!t[s]){t[s]=!0;let r=this.usesFileUrls?this.toFileUrl(s):this.toUrl(this.path(s));this.map.setSourceContent(r,e.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(t){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(t.source.input.from):this.toUrl(this.path(t.source.input.from))}toBase64(t){return Buffer?Buffer.from(t).toString("base64"):window.btoa(unescape(encodeURIComponent(t)))}toFileUrl(t){let e=this.memoizedFileURLs.get(t);if(e)return e;if(Pr){let s=Pr(t).toString();return this.memoizedFileURLs.set(t,s),s}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(t){let e=this.memoizedURLs.get(t);if(e)return e;cn==="\\"&&(t=t.replace(/\\/g,"/"));let s=encodeURI(t).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(t,s),s}};var un=Zl;const Bt=39,Lr=34,$e=92,Fr=47,Je=10,be=32,Qe=12,Ke=9,qe=13,Hl=91,$l=93,Jl=40,Ql=41,Kl=123,ql=125,ec=59,tc=42,sc=58,rc=64,et=/[\t\n\f\r "#'()/;[\\\]{}]/g,tt=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,ic=/.[\r\n"'(/\\]/,_r=/[\da-f]/i;var nc=function(t,e={}){let s=t.css.valueOf(),r=e.ignoreErrors,i,o,a,n,c,l,h,u,p,m,b=s.length,d=0,S=[],f=[];function w(){return d}function g(F){throw t.error("Unclosed "+F,d)}function x(){return f.length===0&&d>=b}function P(F){if(f.length)return f.pop();if(d>=b)return;let V=F?F.ignoreUnclosed:!1;switch(i=s.charCodeAt(d),i){case Je:case be:case Ke:case qe:case Qe:{n=d;do n+=1,i=s.charCodeAt(n);while(i===be||i===Je||i===Ke||i===qe||i===Qe);l=["space",s.slice(d,n)],d=n-1;break}case Hl:case $l:case Kl:case ql:case sc:case ec:case Ql:{let ee=String.fromCharCode(i);l=[ee,ee,d];break}case Jl:{if(m=S.length?S.pop()[1]:"",p=s.charCodeAt(d+1),m==="url"&&p!==Bt&&p!==Lr&&p!==be&&p!==Je&&p!==Ke&&p!==Qe&&p!==qe){n=d;do{if(h=!1,n=s.indexOf(")",n+1),n===-1)if(r||V){n=d;break}else g("bracket");for(u=n;s.charCodeAt(u-1)===$e;)u-=1,h=!h}while(h);l=["brackets",s.slice(d,n+1),d,n],d=n}else n=s.indexOf(")",d+1),o=s.slice(d,n+1),n===-1||ic.test(o)?l=["(","(",d]:(l=["brackets",o,d,n],d=n);break}case Bt:case Lr:{c=i===Bt?"'":'"',n=d;do{if(h=!1,n=s.indexOf(c,n+1),n===-1)if(r||V){n=d+1;break}else g("string");for(u=n;s.charCodeAt(u-1)===$e;)u-=1,h=!h}while(h);l=["string",s.slice(d,n+1),d,n],d=n;break}case rc:{et.lastIndex=d+1,et.test(s),et.lastIndex===0?n=s.length-1:n=et.lastIndex-2,l=["at-word",s.slice(d,n+1),d,n],d=n;break}case $e:{for(n=d,a=!0;s.charCodeAt(n+1)===$e;)n+=1,a=!a;if(i=s.charCodeAt(n+1),a&&i!==Fr&&i!==be&&i!==Je&&i!==Ke&&i!==qe&&i!==Qe&&(n+=1,_r.test(s.charAt(n)))){for(;_r.test(s.charAt(n+1));)n+=1;s.charCodeAt(n+1)===be&&(n+=1)}l=["word",s.slice(d,n+1),d,n],d=n;break}default:{i===Fr&&s.charCodeAt(d+1)===tc?(n=s.indexOf("*/",d+2)+1,n===0&&(r||V?n=s.length:g("comment")),l=["comment",s.slice(d,n+1),d,n],d=n):(tt.lastIndex=d+1,tt.test(s),tt.lastIndex===0?n=s.length-1:n=tt.lastIndex-2,l=["word",s.slice(d,n+1),d,n],S.push(l),d=n);break}}return d++,l}function B(F){f.push(F)}return{back:B,endOfFile:x,nextToken:P,position:w}};let oc=Ls,ac=Mt,lc=Nt,cc=Fe,Ur=_s,hc=nc;const Br={empty:!0,space:!0};function uc(t){for(let e=t.length-1;e>=0;e--){let s=t[e],r=s[3]||s[2];if(r)return r}}let pc=class{constructor(t){this.input=t,this.root=new cc,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:t,start:{column:1,line:1,offset:0}}}atrule(t){let e=new oc;e.name=t[1].slice(1),e.name===""&&this.unnamedAtrule(e,t),this.init(e,t[2]);let s,r,i,o=!1,a=!1,n=[],c=[];for(;!this.tokenizer.endOfFile();){if(t=this.tokenizer.nextToken(),s=t[0],s==="("||s==="["?c.push(s==="("?")":"]"):s==="{"&&c.length>0?c.push("}"):s===c[c.length-1]&&c.pop(),c.length===0)if(s===";"){e.source.end=this.getPosition(t[2]),e.source.end.offset++,this.semicolon=!0;break}else if(s==="{"){a=!0;break}else if(s==="}"){if(n.length>0){for(i=n.length-1,r=n[i];r&&r[0]==="space";)r=n[--i];r&&(e.source.end=this.getPosition(r[3]||r[2]),e.source.end.offset++)}this.end(t);break}else n.push(t);else n.push(t);if(this.tokenizer.endOfFile()){o=!0;break}}e.raws.between=this.spacesAndCommentsFromEnd(n),n.length?(e.raws.afterName=this.spacesAndCommentsFromStart(n),this.raw(e,"params",n),o&&(t=n[n.length-1],e.source.end=this.getPosition(t[3]||t[2]),e.source.end.offset++,this.spaces=e.raws.between,e.raws.between="")):(e.raws.afterName="",e.params=""),a&&(e.nodes=[],this.current=e)}checkMissedSemicolon(t){let e=this.colon(t);if(e===!1)return;let s=0,r;for(let i=e-1;i>=0&&(r=t[i],!(r[0]!=="space"&&(s+=1,s===2)));i--);throw this.input.error("Missed semicolon",r[0]==="word"?r[3]+1:r[2])}colon(t){let e=0,s,r,i;for(let[o,a]of t.entries()){if(r=a,i=r[0],i==="("&&(e+=1),i===")"&&(e-=1),e===0&&i===":")if(!s)this.doubleColon(r);else{if(s[0]==="word"&&s[1]==="progid")continue;return o}s=r}return!1}comment(t){let e=new ac;this.init(e,t[2]),e.source.end=this.getPosition(t[3]||t[2]),e.source.end.offset++;let s=t[1].slice(2,-2);if(/^\s*$/.test(s))e.text="",e.raws.left=s,e.raws.right="";else{let r=s.match(/^(\s*)([^]*\S)(\s*)$/);e.text=r[2],e.raws.left=r[1],e.raws.right=r[3]}}createTokenizer(){this.tokenizer=hc(this.input)}decl(t,e){let s=new lc;this.init(s,t[0][2]);let r=t[t.length-1];for(r[0]===";"&&(this.semicolon=!0,t.pop()),s.source.end=this.getPosition(r[3]||r[2]||uc(t)),s.source.end.offset++;t[0][0]!=="word";)t.length===1&&this.unknownWord(t),s.raws.before+=t.shift()[1];for(s.source.start=this.getPosition(t[0][2]),s.prop="";t.length;){let n=t[0][0];if(n===":"||n==="space"||n==="comment")break;s.prop+=t.shift()[1]}s.raws.between="";let i;for(;t.length;)if(i=t.shift(),i[0]===":"){s.raws.between+=i[1];break}else i[0]==="word"&&/\w/.test(i[1])&&this.unknownWord([i]),s.raws.between+=i[1];(s.prop[0]==="_"||s.prop[0]==="*")&&(s.raws.before+=s.prop[0],s.prop=s.prop.slice(1));let o=[],a;for(;t.length&&(a=t[0][0],!(a!=="space"&&a!=="comment"));)o.push(t.shift());this.precheckMissedSemicolon(t);for(let n=t.length-1;n>=0;n--){if(i=t[n],i[1].toLowerCase()==="!important"){s.important=!0;let c=this.stringFrom(t,n);c=this.spacesFromEnd(t)+c,c!==" !important"&&(s.raws.important=c);break}else if(i[1].toLowerCase()==="important"){let c=t.slice(0),l="";for(let h=n;h>0;h--){let u=c[h][0];if(l.trim().startsWith("!")&&u!=="space")break;l=c.pop()[1]+l}l.trim().startsWith("!")&&(s.important=!0,s.raws.important=l,t=c)}if(i[0]!=="space"&&i[0]!=="comment")break}t.some(n=>n[0]!=="space"&&n[0]!=="comment")&&(s.raws.between+=o.map(n=>n[1]).join(""),o=[]),this.raw(s,"value",o.concat(t),e),s.value.includes(":")&&!e&&this.checkMissedSemicolon(t)}doubleColon(t){throw this.input.error("Double colon",{offset:t[2]},{offset:t[2]+t[1].length})}emptyRule(t){let e=new Ur;this.init(e,t[2]),e.selector="",e.raws.between="",this.current=e}end(t){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(t[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(t)}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(t){if(this.spaces+=t[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&e.type==="rule"&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="",e.source.end=this.getPosition(t[2]),e.source.end.offset+=e.raws.ownSemicolon.length)}}getPosition(t){let e=this.input.fromOffset(t);return{column:e.col,line:e.line,offset:t}}init(t,e){this.current.push(t),t.source={input:this.input,start:this.getPosition(e)},t.raws.before=this.spaces,this.spaces="",t.type!=="comment"&&(this.semicolon=!1)}other(t){let e=!1,s=null,r=!1,i=null,o=[],a=t[1].startsWith("--"),n=[],c=t;for(;c;){if(s=c[0],n.push(c),s==="("||s==="[")i||(i=c),o.push(s==="("?")":"]");else if(a&&r&&s==="{")i||(i=c),o.push("}");else if(o.length===0)if(s===";")if(r){this.decl(n,a);return}else break;else if(s==="{"){this.rule(n);return}else if(s==="}"){this.tokenizer.back(n.pop()),e=!0;break}else s===":"&&(r=!0);else s===o[o.length-1]&&(o.pop(),o.length===0&&(i=null));c=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(e=!0),o.length>0&&this.unclosedBracket(i),e&&r){if(!a)for(;n.length&&(c=n[n.length-1][0],!(c!=="space"&&c!=="comment"));)this.tokenizer.back(n.pop());this.decl(n,a)}else this.unknownWord(n)}parse(){let t;for(;!this.tokenizer.endOfFile();)switch(t=this.tokenizer.nextToken(),t[0]){case"space":this.spaces+=t[1];break;case";":this.freeSemicolon(t);break;case"}":this.end(t);break;case"comment":this.comment(t);break;case"at-word":this.atrule(t);break;case"{":this.emptyRule(t);break;default:this.other(t);break}this.endFile()}precheckMissedSemicolon(){}raw(t,e,s,r){let i,o,a=s.length,n="",c=!0,l,h;for(let u=0;u<a;u+=1)i=s[u],o=i[0],o==="space"&&u===a-1&&!r?c=!1:o==="comment"?(h=s[u-1]?s[u-1][0]:"empty",l=s[u+1]?s[u+1][0]:"empty",!Br[h]&&!Br[l]?n.slice(-1)===","?c=!1:n+=i[1]:c=!1):n+=i[1];if(!c){let u=s.reduce((p,m)=>p+m[1],"");t.raws[e]={raw:u,value:n}}t[e]=n}rule(t){t.pop();let e=new Ur;this.init(e,t[0][2]),e.raws.between=this.spacesAndCommentsFromEnd(t),this.raw(e,"selector",t),this.current=e}spacesAndCommentsFromEnd(t){let e,s="";for(;t.length&&(e=t[t.length-1][0],!(e!=="space"&&e!=="comment"));)s=t.pop()[1]+s;return s}spacesAndCommentsFromStart(t){let e,s="";for(;t.length&&(e=t[0][0],!(e!=="space"&&e!=="comment"));)s+=t.shift()[1];return s}spacesFromEnd(t){let e,s="";for(;t.length&&(e=t[t.length-1][0],e==="space");)s=t.pop()[1]+s;return s}stringFrom(t,e){let s="";for(let r=e;r<t.length;r++)s+=t[r][1];return t.splice(e,t.length-e),s}unclosedBlock(){let t=this.current.source.start;throw this.input.error("Unclosed block",t.line,t.column)}unclosedBracket(t){throw this.input.error("Unclosed bracket",{offset:t[2]},{offset:t[2]+1})}unexpectedClose(t){throw this.input.error("Unexpected }",{offset:t[2]},{offset:t[2]+1})}unknownWord(t){throw this.input.error("Unknown word "+t[0][1],{offset:t[0][2]},{offset:t[0][2]+t[0][1].length})}unnamedAtrule(t,e){throw this.input.error("At-rule without name",{offset:e[2]},{offset:e[2]+e[1].length})}};var dc=pc;let fc=se,mc=Tt,gc=dc;function ft(t,e){let s=new mc(t,e),r=new gc(s);try{r.parse()}catch(i){throw i}return r.root}var Us=ft;ft.default=ft;fc.registerParse(ft);let fs=class{constructor(t,e={}){if(this.type="warning",this.text=t,e.node&&e.node.source){let s=e.node.rangeBy(e);this.line=s.start.line,this.column=s.start.column,this.endLine=s.end.line,this.endColumn=s.end.column}for(let s in e)this[s]=e[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}};var pn=fs;fs.default=fs;let yc=pn,ms=class{get content(){return this.css}constructor(t,e,s){this.processor=t,this.messages=[],this.root=e,this.opts=s,this.css="",this.map=void 0}toString(){return this.css}warn(t,e={}){e.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(e.plugin=this.lastPlugin.postcssPlugin);let s=new yc(t,e);return this.messages.push(s),s}warnings(){return this.messages.filter(t=>t.type==="warning")}};var Bs=ms;ms.default=ms;let wc=se,bc=Fs,vc=un,Sc=Us,Wr=Bs,xc=Fe,Cc=Ct,{isClean:X,my:Ec}=Le;const Mc={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Nc={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},Tc={Once:!0,postcssPlugin:!0,prepare:!0},ue=0;function ve(t){return typeof t=="object"&&typeof t.then=="function"}function dn(t){let e=!1,s=Mc[t.type];return t.type==="decl"?e=t.prop.toLowerCase():t.type==="atrule"&&(e=t.name.toLowerCase()),e&&t.append?[s,s+"-"+e,ue,s+"Exit",s+"Exit-"+e]:e?[s,s+"-"+e,s+"Exit",s+"Exit-"+e]:t.append?[s,ue,s+"Exit"]:[s,s+"Exit"]}function jr(t){let e;return t.type==="document"?e=["Document",ue,"DocumentExit"]:t.type==="root"?e=["Root",ue,"RootExit"]:e=dn(t),{eventIndex:0,events:e,iterator:0,node:t,visitorIndex:0,visitors:[]}}function gs(t){return t[X]=!1,t.nodes&&t.nodes.forEach(e=>gs(e)),t}let ys={},pe=class fn{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"}constructor(e,s,r){this.stringified=!1,this.processed=!1;let i;if(typeof s=="object"&&s!==null&&(s.type==="root"||s.type==="document"))i=gs(s);else if(s instanceof fn||s instanceof Wr)i=gs(s.root),s.map&&(typeof r.map>"u"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=s.map);else{let o=Sc;r.syntax&&(o=r.syntax.parse),r.parser&&(o=r.parser),o.parse&&(o=o.parse);try{i=o(s,r)}catch(a){this.processed=!0,this.error=a}i&&!i[Ec]&&wc.rebuild(i)}this.result=new Wr(e,i,r),this.helpers=W(O({},ys),{postcss:ys,result:this.result}),this.plugins=this.processor.plugins.map(o=>typeof o=="object"&&o.prepare?O(O({},o),o.prepare(this.result)):o)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,s){let r=this.result.lastPlugin;try{s&&s.addToError(e),this.error=e,e.name==="CssSyntaxError"&&!e.plugin?(e.plugin=r.postcssPlugin,e.setMessage()):r.postcssVersion}catch(i){console&&console.error&&console.error(i)}return e}prepareVisitors(){this.listeners={};let e=(s,r,i)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([s,i])};for(let s of this.plugins)if(typeof s=="object")for(let r in s){if(!Nc[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${s.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Tc[r])if(typeof s[r]=="object")for(let i in s[r])i==="*"?e(s,r,s[r][i]):e(s,r+"-"+i.toLowerCase(),s[r][i]);else typeof s[r]=="function"&&e(s,r,s[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let s=this.plugins[e],r=this.runOnRoot(s);if(ve(r))try{await r}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[X];){e[X]=!0;let s=[jr(e)];for(;s.length>0;){let r=this.visitTick(s);if(ve(r))try{await r}catch(i){let o=s[s.length-1].node;throw this.handleError(i,o)}}}if(this.listeners.OnceExit)for(let[s,r]of this.listeners.OnceExit){this.result.lastPlugin=s;try{if(e.type==="document"){let i=e.nodes.map(o=>r(o,this.helpers));await Promise.all(i)}else await r(e,this.helpers)}catch(i){throw this.handleError(i)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if(typeof e=="object"&&e.Once){if(this.result.root.type==="document"){let s=this.result.root.nodes.map(r=>e.Once(r,this.helpers));return ve(s[0])?Promise.all(s):s}return e.Once(this.result.root,this.helpers)}else if(typeof e=="function")return e(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 e=this.result.opts,s=Cc;e.syntax&&(s=e.syntax.stringify),e.stringifier&&(s=e.stringifier),s.stringify&&(s=s.stringify);let r=new vc(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 e of this.plugins){let s=this.runOnRoot(e);if(ve(s))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[X];)e[X]=!0,this.walkSync(e);if(this.listeners.OnceExit)if(e.type==="document")for(let s of e.nodes)this.visitSync(this.listeners.OnceExit,s);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,s){return this.async().then(e,s)}toString(){return this.css}visitSync(e,s){for(let[r,i]of e){this.result.lastPlugin=r;let o;try{o=i(s,this.helpers)}catch(a){throw this.handleError(a,s.proxyOf)}if(s.type!=="root"&&s.type!=="document"&&!s.parent)return!0;if(ve(o))throw this.getAsyncError()}}visitTick(e){let s=e[e.length-1],{node:r,visitors:i}=s;if(r.type!=="root"&&r.type!=="document"&&!r.parent){e.pop();return}if(i.length>0&&s.visitorIndex<i.length){let[a,n]=i[s.visitorIndex];s.visitorIndex+=1,s.visitorIndex===i.length&&(s.visitors=[],s.visitorIndex=0),this.result.lastPlugin=a;try{return n(r.toProxy(),this.helpers)}catch(c){throw this.handleError(c,r)}}if(s.iterator!==0){let a=s.iterator,n;for(;n=r.nodes[r.indexes[a]];)if(r.indexes[a]+=1,!n[X]){n[X]=!0,e.push(jr(n));return}s.iterator=0,delete r.indexes[a]}let o=s.events;for(;s.eventIndex<o.length;){let a=o[s.eventIndex];if(s.eventIndex+=1,a===ue){r.nodes&&r.nodes.length&&(r[X]=!0,s.iterator=r.getIterator());return}else if(this.listeners[a]){s.visitors=this.listeners[a];return}}e.pop()}walkSync(e){e[X]=!0;let s=dn(e);for(let r of s)if(r===ue)e.nodes&&e.each(i=>{i[X]||this.walkSync(i)});else{let i=this.listeners[r];if(i&&this.visitSync(i,e.toProxy()))return}}warnings(){return this.sync().warnings()}};pe.registerPostcss=t=>{ys=t};var mn=pe;pe.default=pe;xc.registerLazyResult(pe);bc.registerLazyResult(pe);let kc=un,Dc=Us;const Rc=Bs;let Oc=Ct;let ws=class{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 t,e=Dc;try{t=e(this._css,this._opts)}catch(s){this.error=s}if(this.error)throw this.error;return this._root=t,t}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(t,e,s){e=e.toString(),this.stringified=!1,this._processor=t,this._css=e,this._opts=s,this._map=void 0;let r,i=Oc;this.result=new Rc(this._processor,r,this._opts),this.result.css=e;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let a=new kc(i,r,this._opts,e);if(a.isMap()){let[n,c]=a.generate();n&&(this.result.css=n),c&&(this.result.map=c)}else a.clearAnnotation(),this.result.css=a.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(t){return this.async().catch(t)}finally(t){return this.async().then(t,t)}sync(){if(this.error)throw this.error;return this.result}then(t,e){return this.async().then(t,e)}toString(){return this._css}warnings(){return[]}};var Ac=ws;ws.default=ws;let Ic=Fs,Pc=mn,Lc=Ac,Fc=Fe,Ae=class{constructor(t=[]){this.version="8.5.6",this.plugins=this.normalize(t)}normalize(t){let e=[];for(let s of t)if(s.postcss===!0?s=s():s.postcss&&(s=s.postcss),typeof s=="object"&&Array.isArray(s.plugins))e=e.concat(s.plugins);else if(typeof s=="object"&&s.postcssPlugin)e.push(s);else if(typeof s=="function")e.push(s);else if(!(typeof s=="object"&&(s.parse||s.stringify)))throw new Error(s+" is not a PostCSS plugin");return e}process(t,e={}){return!this.plugins.length&&!e.parser&&!e.stringifier&&!e.syntax?new Lc(this,t,e):new Pc(this,t,e)}use(t){return this.plugins=this.plugins.concat(this.normalize([t])),this}};var _c=Ae;Ae.default=Ae;Fc.registerProcessor(Ae);Ic.registerProcessor(Ae);let gn=Ls,yn=Mt,Uc=se,Bc=As,wn=Nt,bn=Fs,Wc=zl,jc=Tt,Vc=mn,zc=nn,Yc=Et,Gc=Us,Ws=_c,Xc=Bs,vn=Fe,Sn=_s,Zc=Ct,Hc=pn;function D(...t){return t.length===1&&Array.isArray(t[0])&&(t=t[0]),new Ws(t)}D.plugin=function(t,e){let s=!1;function r(...o){console&&console.warn&&!s&&(s=!0,console.warn(t+`: postcss.plugin was deprecated. Migration guide:
58
58
  https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(t+`: \u91CC\u9762 postcss.plugin \u88AB\u5F03\u7528. \u8FC1\u79FB\u6307\u5357:
59
- https://www.w3ctech.com/topic/2226`));let a=e(...o);return a.postcssPlugin=t,a.postcssVersion=new Bs().version,a}let i;return Object.defineProperty(r,"postcss",{get(){return i||(i=r()),i}}),r.process=function(o,a,n){return D([r(n)]).process(o,a)},r};D.stringify=zc;D.parse=jc;D.fromJSON=Fc;D.list=Bc;D.comment=t=>new fn(t);D.atRule=t=>new dn(t);D.decl=t=>new mn(t);D.rule=t=>new wn(t);D.root=t=>new yn(t);D.document=t=>new gn(t);D.CssSyntaxError=Lc;D.Declaration=mn;D.Container=Pc;D.Processor=Bs;D.Document=gn;D.Comment=fn;D.Warning=Yc;D.AtRule=dn;D.Result=Vc;D.Input=_c;D.Rule=wn;D.Root=yn;D.Node=Wc;Uc.registerPostcss(D);var Gc=D;D.default=D;const I=il(Gc);I.stringify;I.fromJSON;I.plugin;I.parse;I.list;I.document;I.comment;I.atRule;I.rule;I.decl;I.root;I.CssSyntaxError;I.Declaration;I.Container;I.Processor;I.Document;I.Comment;I.Warning;I.AtRule;I.Result;I.Input;I.Rule;I.Root;I.Node;function Xc(t){const e={},s=/;(?![^(]*\))/g,r=/:(.+)/,i=/\/\*.*?\*\//g;return t.replace(i,"").split(s).forEach(function(o){if(o){const a=o.split(r);a.length>1&&(e[ws(a[0].trim())]=a[1].trim())}}),e}function Br(t){const e=[];for(const s in t){const r=t[s];if(typeof r!="string")continue;const i=$c(s);e.push(`${i}: ${r};`)}return e.join(" ")}const Zc=/-([a-z])/g,Hc=/^--[a-zA-Z0-9-]+$/,ws=t=>Hc.test(t)?t:t.replace(Zc,(e,s)=>s?s.toUpperCase():""),Jc=/\B([A-Z])/g,$c=t=>t.replace(Jc,"-$1").toLowerCase();class Q{constructor(...e){y(this,"parentElement",null),y(this,"parentNode",null),y(this,"ownerDocument"),y(this,"firstChild",null),y(this,"lastChild",null),y(this,"previousSibling",null),y(this,"nextSibling",null),y(this,"ELEMENT_NODE",1),y(this,"TEXT_NODE",3),y(this,"nodeType"),y(this,"nodeName"),y(this,"RRNodeType")}get childNodes(){const e=[];let s=this.firstChild;for(;s;)e.push(s),s=s.nextSibling;return e}contains(e){if(e instanceof Q){if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0}else return!1;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,s){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}class Ws extends Q{constructor(...e){super(e),y(this,"nodeType",9),y(this,"nodeName","#document"),y(this,"compatMode","CSS1Compat"),y(this,"RRNodeType",M.Document),y(this,"textContent",null),this.ownerDocument=this}get documentElement(){return this.childNodes.find(e=>e.RRNodeType===M.Element&&e.tagName==="HTML")||null}get body(){var e;return((e=this.documentElement)==null?void 0:e.childNodes.find(s=>s.RRNodeType===M.Element&&s.tagName==="BODY"))||null}get head(){var e;return((e=this.documentElement)==null?void 0:e.childNodes.find(s=>s.RRNodeType===M.Element&&s.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(e){const s=e.RRNodeType;if((s===M.Element||s===M.DocumentType)&&this.childNodes.some(i=>i.RRNodeType===s))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${s===M.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);const r=Vs(this,e);return r.parentElement=null,r}insertBefore(e,s){const r=e.RRNodeType;if((r===M.Element||r===M.DocumentType)&&this.childNodes.some(o=>o.RRNodeType===r))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${r===M.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);const i=Cn(this,e,s);return i.parentElement=null,i}removeChild(e){return En(this,e)}open(){this.firstChild=null,this.lastChild=null}close(){}write(e){let s;if(e==='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'?s="-//W3C//DTD XHTML 1.0 Transitional//EN":e==='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">'&&(s="-//W3C//DTD HTML 4.0 Transitional//EN"),s){const r=this.createDocumentType("html",s,"");this.open(),this.appendChild(r)}}createDocument(e,s,r){return new Ws}createDocumentType(e,s,r){const i=new bn(e,s,r);return i.ownerDocument=this,i}createElement(e){const s=new js(e);return s.ownerDocument=this,s}createElementNS(e,s){return this.createElement(s)}createTextNode(e){const s=new vn(e);return s.ownerDocument=this,s}createComment(e){const s=new Sn(e);return s.ownerDocument=this,s}createCDATASection(e){const s=new xn(e);return s.ownerDocument=this,s}toString(){return"RRDocument"}}class bn extends Q{constructor(e,s,r){super(),y(this,"nodeType",10),y(this,"RRNodeType",M.DocumentType),y(this,"name"),y(this,"publicId"),y(this,"systemId"),y(this,"textContent",null),this.name=e,this.publicId=s,this.systemId=r,this.nodeName=e}toString(){return"RRDocumentType"}}class js extends Q{constructor(e){super(),y(this,"nodeType",1),y(this,"RRNodeType",M.Element),y(this,"tagName"),y(this,"attributes",{}),y(this,"shadowRoot",null),y(this,"scrollLeft"),y(this,"scrollTop"),this.tagName=e.toUpperCase(),this.nodeName=e.toUpperCase()}get textContent(){let e="";return this.childNodes.forEach(s=>e+=s.textContent),e}set textContent(e){this.firstChild=null,this.lastChild=null,this.appendChild(this.ownerDocument.createTextNode(e))}get classList(){return new Kc(this.attributes.class,e=>{this.attributes.class=e})}get id(){return this.attributes.id||""}get className(){return this.attributes.class||""}get style(){const e=this.attributes.style?Xc(this.attributes.style):{},s=/\B([A-Z])/g;return e.setProperty=(r,i,o)=>{if(s.test(r))return;const a=ws(r);i?e[a]=i:delete e[a],o==="important"&&(e[a]+=" !important"),this.attributes.style=Br(e)},e.removeProperty=r=>{if(s.test(r))return"";const i=ws(r),o=e[i]||"";return delete e[i],this.attributes.style=Br(e),o},e}getAttribute(e){return this.attributes[e]||null}setAttribute(e,s){this.attributes[e]=s}setAttributeNS(e,s,r){this.setAttribute(s,r)}removeAttribute(e){delete this.attributes[e]}appendChild(e){return Vs(this,e)}insertBefore(e,s){return Cn(this,e,s)}removeChild(e){return En(this,e)}attachShadow(e){const s=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=s,s}dispatchEvent(e){return!0}toString(){let e="";for(const s in this.attributes)e+=`${s}="${this.attributes[s]}" `;return`${this.tagName} ${e}`}}class Qc extends js{constructor(){super(...arguments),y(this,"currentTime"),y(this,"volume"),y(this,"paused"),y(this,"muted"),y(this,"playbackRate"),y(this,"loop")}attachShadow(e){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 vn extends Q{constructor(e){super(),y(this,"nodeType",3),y(this,"nodeName","#text"),y(this,"RRNodeType",M.Text),y(this,"data"),this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRText text=${JSON.stringify(this.data)}`}}class Sn extends Q{constructor(e){super(),y(this,"nodeType",8),y(this,"nodeName","#comment"),y(this,"RRNodeType",M.Comment),y(this,"data"),this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRComment text=${JSON.stringify(this.data)}`}}class xn extends Q{constructor(e){super(),y(this,"nodeName","#cdata-section"),y(this,"nodeType",4),y(this,"RRNodeType",M.CDATA),y(this,"data"),this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}}class Kc{constructor(e,s){if(y(this,"onChange"),y(this,"classes",[]),y(this,"add",(...r)=>{for(const i of r){const o=String(i);this.classes.indexOf(o)>=0||this.classes.push(o)}this.onChange&&this.onChange(this.classes.join(" "))}),y(this,"remove",(...r)=>{this.classes=this.classes.filter(i=>r.indexOf(i)===-1),this.onChange&&this.onChange(this.classes.join(" "))}),e){const r=e.trim().split(/\s+/);this.classes.push(...r)}this.onChange=s}}function Vs(t,e){return e.parentNode&&e.parentNode.removeChild(e),t.lastChild?(t.lastChild.nextSibling=e,e.previousSibling=t.lastChild):(t.firstChild=e,e.previousSibling=null),t.lastChild=e,e.nextSibling=null,e.parentNode=t,e.parentElement=t,e.ownerDocument=t.ownerDocument,e}function Cn(t,e,s){if(!s)return Vs(t,e);if(s.parentNode!==t)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 e===s||(e.parentNode&&e.parentNode.removeChild(e),e.previousSibling=s.previousSibling,s.previousSibling=e,e.nextSibling=s,e.previousSibling?e.previousSibling.nextSibling=e:t.firstChild=e,e.parentElement=t,e.parentNode=t,e.ownerDocument=t.ownerDocument),e}function En(t,e){if(e.parentNode!==t)throw new Error("Failed to execute 'removeChild' on 'RRNode': The RRNode to be removed is not a child of this RRNode.");return e.previousSibling?e.previousSibling.nextSibling=e.nextSibling:t.firstChild=e.nextSibling,e.nextSibling?e.nextSibling.previousSibling=e.previousSibling:t.lastChild=e.previousSibling,e.previousSibling=null,e.nextSibling=null,e.parentElement=null,e.parentNode=null,e}var j=(t=>(t[t.PLACEHOLDER=0]="PLACEHOLDER",t[t.ELEMENT_NODE=1]="ELEMENT_NODE",t[t.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",t[t.TEXT_NODE=3]="TEXT_NODE",t[t.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",t[t.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",t[t.ENTITY_NODE=6]="ENTITY_NODE",t[t.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",t[t.COMMENT_NODE=8]="COMMENT_NODE",t[t.DOCUMENT_NODE=9]="DOCUMENT_NODE",t[t.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",t[t.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE",t))(j||{});const bs={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},qc={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 Z=null;function ft(t,e,s,r=e.mirror||e.ownerDocument.mirror){t=eh(t,e,s,r),Mn(t,e,s,r),th(t,e,s)}function eh(t,e,s,r){var i;if(s.afterAppend&&!Z&&(Z=new WeakSet,setTimeout(()=>{Z=null},0)),!zs(t,e)){const o=mt(e,s.mirror,r);(i=t.parentNode)==null||i.replaceChild(o,t),t=o}switch(e.RRNodeType){case M.Document:{if(!se(t,e,s.mirror,r)){const o=r.getMeta(e);o&&(s.mirror.removeNodeFromMap(t),t.close(),t.open(),s.mirror.add(t,o),Z==null||Z.add(t))}break}case M.Element:{const o=t,a=e;switch(a.tagName){case"IFRAME":{const n=t.contentDocument;if(!n)break;ft(n,e.contentDocument,s,r);break}}a.shadowRoot&&(o.shadowRoot||o.attachShadow({mode:"open"}),Mn(o.shadowRoot,a.shadowRoot,s,r)),sh(o,a,r);break}}return t}function th(t,e,s){var r;switch(e.RRNodeType){case M.Document:{const i=e.scrollData;i&&s.applyScroll(i,!0);break}case M.Element:{const i=t,o=e;switch(o.scrollData&&s.applyScroll(o.scrollData,!0),o.inputData&&s.applyInput(o.inputData),o.tagName){case"AUDIO":case"VIDEO":{const a=t,n=o;n.paused!==void 0&&(n.paused?a.pause():a.play()),n.muted!==void 0&&(a.muted=n.muted),n.volume!==void 0&&(a.volume=n.volume),n.currentTime!==void 0&&(a.currentTime=n.currentTime),n.playbackRate!==void 0&&(a.playbackRate=n.playbackRate),n.loop!==void 0&&(a.loop=n.loop);break}case"CANVAS":{const a=e;if(a.rr_dataURL!==null){const n=document.createElement("img");n.onload=()=>{const l=i.getContext("2d");l&&l.drawImage(n,0,0,n.width,n.height)},n.src=a.rr_dataURL}a.canvasMutations.forEach(n=>s.applyCanvas(n.event,n.mutation,t));break}case"STYLE":{const a=i.sheet;a&&e.rules.forEach(n=>s.applyStyleSheetMutation(n,a));break}}break}case M.Text:case M.Comment:case M.CDATA:{t.textContent!==e.data&&(t.textContent=e.data);break}}Z!=null&&Z.has(t)&&(Z.delete(t),(r=s.afterAppend)==null||r.call(s,t,s.mirror.getId(t)))}function sh(t,e,s){const r=t.attributes,i=e.attributes;for(const o in i){const a=i[o],n=s.getMeta(e);if(n!=null&&n.isSVG&&bs[o])t.setAttributeNS(bs[o],o,a);else if(e.tagName==="CANVAS"&&o==="rr_dataURL"){const l=document.createElement("img");l.src=a,l.onload=()=>{const c=t.getContext("2d");c&&c.drawImage(l,0,0,l.width,l.height)}}else{if(e.tagName==="IFRAME"&&o==="srcdoc")continue;t.setAttribute(o,a)}}for(const{name:o}of Array.from(r))o in i||t.removeAttribute(o);e.scrollLeft&&(t.scrollLeft=e.scrollLeft),e.scrollTop&&(t.scrollTop=e.scrollTop)}function Mn(t,e,s,r){const i=Array.from(t.childNodes),o=e.childNodes;if(i.length===0&&o.length===0)return;let a=0,n=i.length-1,l=0,c=o.length-1,h=i[a],u=i[n],p=o[l],m=o[c],b,d;for(;a<=n&&l<=c;)if(h===void 0)h=i[++a];else if(u===void 0)u=i[--n];else if(se(h,p,s.mirror,r))h=i[++a],p=o[++l];else if(se(u,m,s.mirror,r))u=i[--n],m=o[--c];else if(se(h,m,s.mirror,r)){try{t.insertBefore(h,u.nextSibling)}catch(w){console.warn(w)}h=i[++a],m=o[--c]}else if(se(u,p,s.mirror,r)){try{t.insertBefore(u,h)}catch(w){console.warn(w)}u=i[--n],p=o[++l]}else{if(!b){b={};for(let g=a;g<=n;g++){const x=i[g];x&&s.mirror.hasNode(x)&&(b[s.mirror.getId(x)]=g)}}d=b[r.getId(p)];const w=i[d];if(d!==void 0&&w&&se(w,p,s.mirror,r)){try{t.insertBefore(w,h)}catch(g){console.warn(g)}i[d]=void 0}else{const g=mt(p,s.mirror,r);t.nodeName==="#document"&&h&&(g.nodeType===g.DOCUMENT_TYPE_NODE&&h.nodeType===h.DOCUMENT_TYPE_NODE||g.nodeType===g.ELEMENT_NODE&&h.nodeType===h.ELEMENT_NODE)&&(t.removeChild(h),s.mirror.removeNodeFromMap(h),h=i[++a]);try{t.insertBefore(g,h||null)}catch(x){console.warn(x)}}p=o[++l]}if(a>n){const w=o[c+1];let g=null;for(w&&(g=s.mirror.getNode(r.getId(w)));l<=c;++l){const x=mt(o[l],s.mirror,r);try{t.insertBefore(x,g)}catch(P){console.warn(P)}}}else if(l>c)for(;a<=n;a++){const w=i[a];if(!(!w||w.parentNode!==t))try{t.removeChild(w),s.mirror.removeNodeFromMap(w)}catch(g){console.warn(g)}}let S=t.firstChild,f=e.firstChild;for(;S!==null&&f!==null;)ft(S,f,s,r),S=S.nextSibling,f=f.nextSibling}function mt(t,e,s){const r=s.getId(t),i=s.getMeta(t);let o=null;if(r>-1&&(o=e.getNode(r)),o!==null&&zs(o,t))return o;switch(t.RRNodeType){case M.Document:o=new Document;break;case M.DocumentType:o=document.implementation.createDocumentType(t.name,t.publicId,t.systemId);break;case M.Element:{let a=t.tagName.toLowerCase();a=qc[a]||a,i&&"isSVG"in i&&i!=null&&i.isSVG?o=document.createElementNS(bs.svg,a):o=document.createElement(t.tagName);break}case M.Text:o=document.createTextNode(t.data);break;case M.Comment:o=document.createComment(t.data);break;case M.CDATA:o=document.createCDATASection(t.data);break}i&&e.add(o,O({},i));try{Z==null||Z.add(o)}catch(a){}return o}function zs(t,e){return t.nodeType!==e.nodeType?!1:t.nodeType!==t.ELEMENT_NODE||t.tagName.toUpperCase()===e.tagName}function se(t,e,s,r){const i=s.getId(t),o=r.getId(e);return i===-1||i!==o?!1:zs(t,e)}class ue extends Ws{constructor(e){super(),y(this,"UNSERIALIZED_STARTING_ID",-2),y(this,"_unserializedId",this.UNSERIALIZED_STARTING_ID),y(this,"mirror",dh()),y(this,"scrollData",null),e&&(this.mirror=e)}get unserializedId(){return this._unserializedId--}createDocument(e,s,r){return new ue}createDocumentType(e,s,r){const i=new rh(e,s,r);return i.ownerDocument=this,i}createElement(e){const s=e.toUpperCase();let r;switch(s){case"AUDIO":case"VIDEO":r=new ih(s);break;case"IFRAME":r=new ah(s,this.mirror);break;case"CANVAS":r=new nh(s);break;case"STYLE":r=new oh(s);break;default:r=new Tt(s);break}return r.ownerDocument=this,r}createComment(e){const s=new ch(e);return s.ownerDocument=this,s}createCDATASection(e){const s=new hh(e);return s.ownerDocument=this,s}createTextNode(e){const s=new lh(e);return s.ownerDocument=this,s}destroyTree(){this.firstChild=null,this.lastChild=null,this.mirror.reset()}open(){super.open(),this._unserializedId=this.UNSERIALIZED_STARTING_ID}}const rh=bn;class Tt extends js{constructor(){super(...arguments),y(this,"inputData",null),y(this,"scrollData",null)}}class ih extends Qc{}class nh extends Tt{constructor(){super(...arguments),y(this,"rr_dataURL",null),y(this,"canvasMutations",[])}getContext(){return null}}class oh extends Tt{constructor(){super(...arguments),y(this,"rules",[])}}class ah extends Tt{constructor(e,s){super(e),y(this,"contentDocument",new ue),this.contentDocument.mirror=s}}const lh=vn,ch=Sn,hh=xn;function uh(t){return t instanceof HTMLFormElement?"FORM":t.tagName.toUpperCase()}function Nn(t,e,s,r){let i;switch(t.nodeType){case j.DOCUMENT_NODE:r&&r.nodeName==="IFRAME"?i=r.contentDocument:(i=e,i.compatMode=t.compatMode);break;case j.DOCUMENT_TYPE_NODE:{const a=t;i=e.createDocumentType(a.name,a.publicId,a.systemId);break}case j.ELEMENT_NODE:{const a=t,n=uh(a);i=e.createElement(n);const l=i;for(const{name:c,value:h}of Array.from(a.attributes))l.attributes[c]=h;a.scrollLeft&&(l.scrollLeft=a.scrollLeft),a.scrollTop&&(l.scrollTop=a.scrollTop);break}case j.TEXT_NODE:i=e.createTextNode(t.textContent||"");break;case j.CDATA_SECTION_NODE:i=e.createCDATASection(t.data);break;case j.COMMENT_NODE:i=e.createComment(t.textContent||"");break;case j.DOCUMENT_FRAGMENT_NODE:i=r.attachShadow({mode:"open"});break;default:return null}let o=s.getMeta(t);return e instanceof ue&&(o||(o=Tn(i,e.unserializedId),s.add(t,o)),e.mirror.add(i,O({},o))),i}function ph(t,e=rl(),s=new ue){function r(i,o){const a=Nn(i,s,e,o);if(a!==null)if((o==null?void 0:o.nodeName)!=="IFRAME"&&i.nodeType!==j.DOCUMENT_FRAGMENT_NODE&&(o==null||o.appendChild(a),a.parentNode=o,a.parentElement=o),i.nodeName==="IFRAME"){const n=i.contentDocument;n&&r(n,a)}else(i.nodeType===j.DOCUMENT_NODE||i.nodeType===j.ELEMENT_NODE||i.nodeType===j.DOCUMENT_FRAGMENT_NODE)&&(i.nodeType===j.ELEMENT_NODE&&i.shadowRoot&&r(i.shadowRoot,a),i.childNodes.forEach(n=>r(n,a)))}return r(t,null),s}function dh(){return new fh}class fh{constructor(){y(this,"idNodeMap",new Map),y(this,"nodeMetaMap",new WeakMap)}getId(e){var r;var s;return e&&(r=(s=this.getMeta(e))==null?void 0:s.id)!=null?r:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const s=this.getId(e);this.idNodeMap.delete(s),e.childNodes&&e.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,s){const r=s.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,s)}replace(e,s){const r=this.getNode(e);if(r){const i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(s,i)}this.idNodeMap.set(e,s)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Tn(t,e){switch(t.RRNodeType){case M.Document:return{id:e,type:t.RRNodeType,childNodes:[]};case M.DocumentType:{const s=t;return{id:e,type:t.RRNodeType,name:s.name,publicId:s.publicId,systemId:s.systemId}}case M.Element:return{id:e,type:t.RRNodeType,tagName:t.tagName.toLowerCase(),attributes:{},childNodes:[]};case M.Text:return{id:e,type:t.RRNodeType,textContent:t.textContent||""};case M.Comment:return{id:e,type:t.RRNodeType,textContent:t.textContent||""};case M.CDATA:return{id:e,type:t.RRNodeType,textContent:""}}}function kn(t){return{all:t=t||new Map,on:function(e,s){var r=t.get(e);r?r.push(s):t.set(e,[s])},off:function(e,s){var r=t.get(e);r&&(s?r.splice(r.indexOf(s)>>>0,1):t.set(e,[]))},emit:function(e,s){var r=t.get(e);r&&r.slice().map(function(i){i(s)}),(r=t.get("*"))&&r.slice().map(function(i){i(e,s)})}}}const mh=Object.freeze(Object.defineProperty({__proto__:null,default:kn},Symbol.toStringTag,{value:"Module"})),Wr=new Map;function Dn(t,e){let s=Wr.get(t);return s||(s=new Map,Wr.set(t,s)),s.has(e)||s.set(e,[]),s.get(e)}function $(t,e,s){return async r=>{if(r&&typeof r=="object"&&"rr_type"in r)if(s&&(s.isUnchanged=!1),r.rr_type==="ImageBitmap"&&"args"in r){const i=await $(t,e,s)(r.args);return await createImageBitmap.apply(null,i)}else if("index"in r){if(s||e===null)return r;const{rr_type:i,index:o}=r;return Dn(e,i)[o]}else if("args"in r){const{rr_type:i,args:o}=r,a=window[i];return new a(...await Promise.all(o.map($(t,e,s))))}else{if("base64"in r)return Qa(r.base64);if("src"in r){const i=t.get(r.src);if(i)return i;{const o=new Image;return o.src=r.src,t.set(r.src,o),o}}else if("data"in r&&r.rr_type==="Blob"){const i=await Promise.all(r.data.map($(t,e,s)));return new Blob(i,{type:r.type})}}else if(Array.isArray(r))return await Promise.all(r.map($(t,e,s)));return r}}async function gh({event:t,mutations:e,target:s,imageMap:r,errorHandler:i}){const o=s.getContext("2d");if(!o){i(e[0],new Error("Canvas context is null"));return}const a=e.map(async n=>Promise.all(n.args.map($(r,o))));(await Promise.all(a)).forEach((n,l)=>{const c=e[l];try{if(c.setter){o[c.property]=c.args[0];return}const h=o[c.property];c.property==="drawImage"&&typeof c.args[0]=="string"?(r.get(t),h.apply(o,c.args)):h.apply(o,n)}catch(h){i(c,h)}})}function yh(t,e){try{return e===ct.WebGL?t.getContext("webgl")||t.getContext("experimental-webgl"):t.getContext("webgl2")}catch(s){return null}}const wh=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function bh(t,e){if(!(e!=null&&e.constructor))return;const{name:s}=e.constructor;if(!wh.includes(s))return;const r=Dn(t,s);r.includes(e)||r.push(e)}async function vh({mutation:t,target:e,type:s,imageMap:r,errorHandler:i}){try{const o=yh(e,s);if(!o)return;if(t.setter){o[t.property]=t.args[0];return}const a=o[t.property],n=await Promise.all(t.args.map($(r,o))),l=a.apply(o,n);bh(o,l);const c=!1}catch(o){i(t,o)}}async function jr({event:t,mutation:e,target:s,imageMap:r,canvasEventMap:i,errorHandler:o}){try{const a=i.get(t)||e,n="commands"in a?a.commands:[a];if([ct.WebGL,ct.WebGL2].includes(e.type)){for(let l=0;l<n.length;l++){const c=n[l];await vh({mutation:c,type:e.type,target:s,imageMap:r,errorHandler:o})}return}await gh({event:t,mutations:n,target:s,imageMap:r,errorHandler:o})}catch(a){o(e,a)}}/*! *****************************************************************************
59
+ https://www.w3ctech.com/topic/2226`));let a=e(...o);return a.postcssPlugin=t,a.postcssVersion=new Ws().version,a}let i;return Object.defineProperty(r,"postcss",{get(){return i||(i=r()),i}}),r.process=function(o,a,n){return D([r(n)]).process(o,a)},r};D.stringify=Zc;D.parse=Gc;D.fromJSON=Wc;D.list=zc;D.comment=t=>new yn(t);D.atRule=t=>new gn(t);D.decl=t=>new wn(t);D.rule=t=>new Sn(t);D.root=t=>new vn(t);D.document=t=>new bn(t);D.CssSyntaxError=Bc;D.Declaration=wn;D.Container=Uc;D.Processor=Ws;D.Document=bn;D.Comment=yn;D.Warning=Hc;D.AtRule=gn;D.Result=Xc;D.Input=jc;D.Rule=Sn;D.Root=vn;D.Node=Yc;Vc.registerPostcss(D);var $c=D;D.default=D;const I=ll($c);I.stringify;I.fromJSON;I.plugin;I.parse;I.list;I.document;I.comment;I.atRule;I.rule;I.decl;I.root;I.CssSyntaxError;I.Declaration;I.Container;I.Processor;I.Document;I.Comment;I.Warning;I.AtRule;I.Result;I.Input;I.Rule;I.Root;I.Node;function Jc(t){const e={},s=/;(?![^(]*\))/g,r=/:(.+)/,i=/\/\*.*?\*\//g;return t.replace(i,"").split(s).forEach(function(o){if(o){const a=o.split(r);a.length>1&&(e[bs(a[0].trim())]=a[1].trim())}}),e}function Vr(t){const e=[];for(const s in t){const r=t[s];if(typeof r!="string")continue;const i=eh(s);e.push(`${i}: ${r};`)}return e.join(" ")}const Qc=/-([a-z])/g,Kc=/^--[a-zA-Z0-9-]+$/,bs=t=>Kc.test(t)?t:t.replace(Qc,(e,s)=>s?s.toUpperCase():""),qc=/\B([A-Z])/g,eh=t=>t.replace(qc,"-$1").toLowerCase();class q{constructor(...e){y(this,"parentElement",null),y(this,"parentNode",null),y(this,"ownerDocument"),y(this,"firstChild",null),y(this,"lastChild",null),y(this,"previousSibling",null),y(this,"nextSibling",null),y(this,"ELEMENT_NODE",1),y(this,"TEXT_NODE",3),y(this,"nodeType"),y(this,"nodeName"),y(this,"RRNodeType")}get childNodes(){const e=[];let s=this.firstChild;for(;s;)e.push(s),s=s.nextSibling;return e}contains(e){if(e instanceof q){if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0}else return!1;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,s){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}class js extends q{constructor(...e){super(e),y(this,"nodeType",9),y(this,"nodeName","#document"),y(this,"compatMode","CSS1Compat"),y(this,"RRNodeType",M.Document),y(this,"textContent",null),this.ownerDocument=this}get documentElement(){return this.childNodes.find(e=>e.RRNodeType===M.Element&&e.tagName==="HTML")||null}get body(){var e;return((e=this.documentElement)==null?void 0:e.childNodes.find(s=>s.RRNodeType===M.Element&&s.tagName==="BODY"))||null}get head(){var e;return((e=this.documentElement)==null?void 0:e.childNodes.find(s=>s.RRNodeType===M.Element&&s.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(e){const s=e.RRNodeType;if((s===M.Element||s===M.DocumentType)&&this.childNodes.some(i=>i.RRNodeType===s))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${s===M.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);const r=zs(this,e);return r.parentElement=null,r}insertBefore(e,s){const r=e.RRNodeType;if((r===M.Element||r===M.DocumentType)&&this.childNodes.some(o=>o.RRNodeType===r))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${r===M.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);const i=Nn(this,e,s);return i.parentElement=null,i}removeChild(e){return Tn(this,e)}open(){this.firstChild=null,this.lastChild=null}close(){}write(e){let s;if(e==='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'?s="-//W3C//DTD XHTML 1.0 Transitional//EN":e==='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">'&&(s="-//W3C//DTD HTML 4.0 Transitional//EN"),s){const r=this.createDocumentType("html",s,"");this.open(),this.appendChild(r)}}createDocument(e,s,r){return new js}createDocumentType(e,s,r){const i=new xn(e,s,r);return i.ownerDocument=this,i}createElement(e){const s=new Vs(e);return s.ownerDocument=this,s}createElementNS(e,s){return this.createElement(s)}createTextNode(e){const s=new Cn(e);return s.ownerDocument=this,s}createComment(e){const s=new En(e);return s.ownerDocument=this,s}createCDATASection(e){const s=new Mn(e);return s.ownerDocument=this,s}toString(){return"RRDocument"}}class xn extends q{constructor(e,s,r){super(),y(this,"nodeType",10),y(this,"RRNodeType",M.DocumentType),y(this,"name"),y(this,"publicId"),y(this,"systemId"),y(this,"textContent",null),this.name=e,this.publicId=s,this.systemId=r,this.nodeName=e}toString(){return"RRDocumentType"}}class Vs extends q{constructor(e){super(),y(this,"nodeType",1),y(this,"RRNodeType",M.Element),y(this,"tagName"),y(this,"attributes",{}),y(this,"shadowRoot",null),y(this,"scrollLeft"),y(this,"scrollTop"),this.tagName=e.toUpperCase(),this.nodeName=e.toUpperCase()}get textContent(){let e="";return this.childNodes.forEach(s=>e+=s.textContent),e}set textContent(e){this.firstChild=null,this.lastChild=null,this.appendChild(this.ownerDocument.createTextNode(e))}get classList(){return new sh(this.attributes.class,e=>{this.attributes.class=e})}get id(){return this.attributes.id||""}get className(){return this.attributes.class||""}get style(){const e=this.attributes.style?Jc(this.attributes.style):{},s=/\B([A-Z])/g;return e.setProperty=(r,i,o)=>{if(s.test(r))return;const a=bs(r);i?e[a]=i:delete e[a],o==="important"&&(e[a]+=" !important"),this.attributes.style=Vr(e)},e.removeProperty=r=>{if(s.test(r))return"";const i=bs(r),o=e[i]||"";return delete e[i],this.attributes.style=Vr(e),o},e}getAttribute(e){return this.attributes[e]||null}setAttribute(e,s){this.attributes[e]=s}setAttributeNS(e,s,r){this.setAttribute(s,r)}removeAttribute(e){delete this.attributes[e]}appendChild(e){return zs(this,e)}insertBefore(e,s){return Nn(this,e,s)}removeChild(e){return Tn(this,e)}attachShadow(e){const s=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=s,s}dispatchEvent(e){return!0}toString(){let e="";for(const s in this.attributes)e+=`${s}="${this.attributes[s]}" `;return`${this.tagName} ${e}`}}class th extends Vs{constructor(){super(...arguments),y(this,"currentTime"),y(this,"volume"),y(this,"paused"),y(this,"muted"),y(this,"playbackRate"),y(this,"loop")}attachShadow(e){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 Cn extends q{constructor(e){super(),y(this,"nodeType",3),y(this,"nodeName","#text"),y(this,"RRNodeType",M.Text),y(this,"data"),this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRText text=${JSON.stringify(this.data)}`}}class En extends q{constructor(e){super(),y(this,"nodeType",8),y(this,"nodeName","#comment"),y(this,"RRNodeType",M.Comment),y(this,"data"),this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRComment text=${JSON.stringify(this.data)}`}}class Mn extends q{constructor(e){super(),y(this,"nodeName","#cdata-section"),y(this,"nodeType",4),y(this,"RRNodeType",M.CDATA),y(this,"data"),this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}}class sh{constructor(e,s){if(y(this,"onChange"),y(this,"classes",[]),y(this,"add",(...r)=>{for(const i of r){const o=String(i);this.classes.indexOf(o)>=0||this.classes.push(o)}this.onChange&&this.onChange(this.classes.join(" "))}),y(this,"remove",(...r)=>{this.classes=this.classes.filter(i=>r.indexOf(i)===-1),this.onChange&&this.onChange(this.classes.join(" "))}),e){const r=e.trim().split(/\s+/);this.classes.push(...r)}this.onChange=s}}function zs(t,e){return e.parentNode&&e.parentNode.removeChild(e),t.lastChild?(t.lastChild.nextSibling=e,e.previousSibling=t.lastChild):(t.firstChild=e,e.previousSibling=null),t.lastChild=e,e.nextSibling=null,e.parentNode=t,e.parentElement=t,e.ownerDocument=t.ownerDocument,e}function Nn(t,e,s){if(!s)return zs(t,e);if(s.parentNode!==t)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 e===s||(e.parentNode&&e.parentNode.removeChild(e),e.previousSibling=s.previousSibling,s.previousSibling=e,e.nextSibling=s,e.previousSibling?e.previousSibling.nextSibling=e:t.firstChild=e,e.parentElement=t,e.parentNode=t,e.ownerDocument=t.ownerDocument),e}function Tn(t,e){if(e.parentNode!==t)throw new Error("Failed to execute 'removeChild' on 'RRNode': The RRNode to be removed is not a child of this RRNode.");return e.previousSibling?e.previousSibling.nextSibling=e.nextSibling:t.firstChild=e.nextSibling,e.nextSibling?e.nextSibling.previousSibling=e.previousSibling:t.lastChild=e.previousSibling,e.previousSibling=null,e.nextSibling=null,e.parentElement=null,e.parentNode=null,e}var j=(t=>(t[t.PLACEHOLDER=0]="PLACEHOLDER",t[t.ELEMENT_NODE=1]="ELEMENT_NODE",t[t.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",t[t.TEXT_NODE=3]="TEXT_NODE",t[t.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",t[t.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",t[t.ENTITY_NODE=6]="ENTITY_NODE",t[t.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",t[t.COMMENT_NODE=8]="COMMENT_NODE",t[t.DOCUMENT_NODE=9]="DOCUMENT_NODE",t[t.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",t[t.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE",t))(j||{});const vs={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},rh={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 Z=null;function mt(t,e,s,r=e.mirror||e.ownerDocument.mirror){t=ih(t,e,s,r),kn(t,e,s,r),nh(t,e,s)}function ih(t,e,s,r){var i;if(s.afterAppend&&!Z&&(Z=new WeakSet,setTimeout(()=>{Z=null},0)),!Ys(t,e)){const o=gt(e,s.mirror,r);(i=t.parentNode)==null||i.replaceChild(o,t),t=o}switch(e.RRNodeType){case M.Document:{if(!ie(t,e,s.mirror,r)){const o=r.getMeta(e);o&&(s.mirror.removeNodeFromMap(t),t.close(),t.open(),s.mirror.add(t,o),Z==null||Z.add(t))}break}case M.Element:{const o=t,a=e;switch(a.tagName){case"IFRAME":{const n=t.contentDocument;if(!n)break;mt(n,e.contentDocument,s,r);break}}a.shadowRoot&&(o.shadowRoot||o.attachShadow({mode:"open"}),kn(o.shadowRoot,a.shadowRoot,s,r)),oh(o,a,r);break}}return t}function nh(t,e,s){var r;switch(e.RRNodeType){case M.Document:{const i=e.scrollData;i&&s.applyScroll(i,!0);break}case M.Element:{const i=t,o=e;switch(o.scrollData&&s.applyScroll(o.scrollData,!0),o.inputData&&s.applyInput(o.inputData),o.tagName){case"AUDIO":case"VIDEO":{const a=t,n=o;n.paused!==void 0&&(n.paused?a.pause():a.play()),n.muted!==void 0&&(a.muted=n.muted),n.volume!==void 0&&(a.volume=n.volume),n.currentTime!==void 0&&(a.currentTime=n.currentTime),n.playbackRate!==void 0&&(a.playbackRate=n.playbackRate),n.loop!==void 0&&(a.loop=n.loop);break}case"CANVAS":{const a=e;if(a.rr_dataURL!==null){const n=document.createElement("img");n.onload=()=>{const c=i.getContext("2d");c&&c.drawImage(n,0,0,n.width,n.height)},n.src=a.rr_dataURL}a.canvasMutations.forEach(n=>s.applyCanvas(n.event,n.mutation,t));break}case"STYLE":{const a=i.sheet;a&&e.rules.forEach(n=>s.applyStyleSheetMutation(n,a));break}}break}case M.Text:case M.Comment:case M.CDATA:{t.textContent!==e.data&&(t.textContent=e.data);break}}Z!=null&&Z.has(t)&&(Z.delete(t),(r=s.afterAppend)==null||r.call(s,t,s.mirror.getId(t)))}function oh(t,e,s){const r=t.attributes,i=e.attributes;for(const o in i){const a=i[o],n=s.getMeta(e);if(n!=null&&n.isSVG&&vs[o])t.setAttributeNS(vs[o],o,a);else if(e.tagName==="CANVAS"&&o==="rr_dataURL"){const c=document.createElement("img");c.src=a,c.onload=()=>{const l=t.getContext("2d");l&&l.drawImage(c,0,0,c.width,c.height)}}else{if(e.tagName==="IFRAME"&&o==="srcdoc")continue;t.setAttribute(o,a)}}for(const{name:o}of Array.from(r))o in i||t.removeAttribute(o);e.scrollLeft&&(t.scrollLeft=e.scrollLeft),e.scrollTop&&(t.scrollTop=e.scrollTop)}function kn(t,e,s,r){const i=Array.from(t.childNodes),o=e.childNodes;if(i.length===0&&o.length===0)return;let a=0,n=i.length-1,c=0,l=o.length-1,h=i[a],u=i[n],p=o[c],m=o[l],b,d;for(;a<=n&&c<=l;)if(h===void 0)h=i[++a];else if(u===void 0)u=i[--n];else if(ie(h,p,s.mirror,r))h=i[++a],p=o[++c];else if(ie(u,m,s.mirror,r))u=i[--n],m=o[--l];else if(ie(h,m,s.mirror,r)){try{t.insertBefore(h,u.nextSibling)}catch(w){console.warn(w)}h=i[++a],m=o[--l]}else if(ie(u,p,s.mirror,r)){try{t.insertBefore(u,h)}catch(w){console.warn(w)}u=i[--n],p=o[++c]}else{if(!b){b={};for(let g=a;g<=n;g++){const x=i[g];x&&s.mirror.hasNode(x)&&(b[s.mirror.getId(x)]=g)}}d=b[r.getId(p)];const w=i[d];if(d!==void 0&&w&&ie(w,p,s.mirror,r)){try{t.insertBefore(w,h)}catch(g){console.warn(g)}i[d]=void 0}else{const g=gt(p,s.mirror,r);t.nodeName==="#document"&&h&&(g.nodeType===g.DOCUMENT_TYPE_NODE&&h.nodeType===h.DOCUMENT_TYPE_NODE||g.nodeType===g.ELEMENT_NODE&&h.nodeType===h.ELEMENT_NODE)&&(t.removeChild(h),s.mirror.removeNodeFromMap(h),h=i[++a]);try{t.insertBefore(g,h||null)}catch(x){console.warn(x)}}p=o[++c]}if(a>n){const w=o[l+1];let g=null;for(w&&(g=s.mirror.getNode(r.getId(w)));c<=l;++c){const x=gt(o[c],s.mirror,r);try{t.insertBefore(x,g)}catch(P){console.warn(P)}}}else if(c>l)for(;a<=n;a++){const w=i[a];if(!(!w||w.parentNode!==t))try{t.removeChild(w),s.mirror.removeNodeFromMap(w)}catch(g){console.warn(g)}}let S=t.firstChild,f=e.firstChild;for(;S!==null&&f!==null;)mt(S,f,s,r),S=S.nextSibling,f=f.nextSibling}function gt(t,e,s){const r=s.getId(t),i=s.getMeta(t);let o=null;if(r>-1&&(o=e.getNode(r)),o!==null&&Ys(o,t))return o;switch(t.RRNodeType){case M.Document:o=new Document;break;case M.DocumentType:o=document.implementation.createDocumentType(t.name,t.publicId,t.systemId);break;case M.Element:{let a=t.tagName.toLowerCase();a=rh[a]||a,i&&"isSVG"in i&&i!=null&&i.isSVG?o=document.createElementNS(vs.svg,a):o=document.createElement(t.tagName);break}case M.Text:o=document.createTextNode(t.data);break;case M.Comment:o=document.createComment(t.data);break;case M.CDATA:o=document.createCDATASection(t.data);break}i&&e.add(o,O({},i));try{Z==null||Z.add(o)}catch(a){}return o}function Ys(t,e){return t.nodeType!==e.nodeType?!1:t.nodeType!==t.ELEMENT_NODE||t.tagName.toUpperCase()===e.tagName}function ie(t,e,s,r){const i=s.getId(t),o=r.getId(e);return i===-1||i!==o?!1:Ys(t,e)}class de extends js{constructor(e){super(),y(this,"UNSERIALIZED_STARTING_ID",-2),y(this,"_unserializedId",this.UNSERIALIZED_STARTING_ID),y(this,"mirror",yh()),y(this,"scrollData",null),e&&(this.mirror=e)}get unserializedId(){return this._unserializedId--}createDocument(e,s,r){return new de}createDocumentType(e,s,r){const i=new ah(e,s,r);return i.ownerDocument=this,i}createElement(e){const s=e.toUpperCase();let r;switch(s){case"AUDIO":case"VIDEO":r=new lh(s);break;case"IFRAME":r=new uh(s,this.mirror);break;case"CANVAS":r=new ch(s);break;case"STYLE":r=new hh(s);break;default:r=new kt(s);break}return r.ownerDocument=this,r}createComment(e){const s=new dh(e);return s.ownerDocument=this,s}createCDATASection(e){const s=new fh(e);return s.ownerDocument=this,s}createTextNode(e){const s=new ph(e);return s.ownerDocument=this,s}destroyTree(){this.firstChild=null,this.lastChild=null,this.mirror.reset()}open(){super.open(),this._unserializedId=this.UNSERIALIZED_STARTING_ID}}const ah=xn;class kt extends Vs{constructor(){super(...arguments),y(this,"inputData",null),y(this,"scrollData",null)}}class lh extends th{}class ch extends kt{constructor(){super(...arguments),y(this,"rr_dataURL",null),y(this,"canvasMutations",[])}getContext(){return null}}class hh extends kt{constructor(){super(...arguments),y(this,"rules",[])}}class uh extends kt{constructor(e,s){super(e),y(this,"contentDocument",new de),this.contentDocument.mirror=s}}const ph=Cn,dh=En,fh=Mn;function mh(t){return t instanceof HTMLFormElement?"FORM":t.tagName.toUpperCase()}function Dn(t,e,s,r){let i;switch(t.nodeType){case j.DOCUMENT_NODE:r&&r.nodeName==="IFRAME"?i=r.contentDocument:(i=e,i.compatMode=t.compatMode);break;case j.DOCUMENT_TYPE_NODE:{const a=t;i=e.createDocumentType(a.name,a.publicId,a.systemId);break}case j.ELEMENT_NODE:{const a=t,n=mh(a);i=e.createElement(n);const c=i;for(const{name:l,value:h}of Array.from(a.attributes))c.attributes[l]=h;a.scrollLeft&&(c.scrollLeft=a.scrollLeft),a.scrollTop&&(c.scrollTop=a.scrollTop);break}case j.TEXT_NODE:i=e.createTextNode(t.textContent||"");break;case j.CDATA_SECTION_NODE:i=e.createCDATASection(t.data);break;case j.COMMENT_NODE:i=e.createComment(t.textContent||"");break;case j.DOCUMENT_FRAGMENT_NODE:i=r.attachShadow({mode:"open"});break;default:return null}let o=s.getMeta(t);return e instanceof de&&(o||(o=Rn(i,e.unserializedId),s.add(t,o)),e.mirror.add(i,O({},o))),i}function gh(t,e=al(),s=new de){function r(i,o){const a=Dn(i,s,e,o);if(a!==null)if((o==null?void 0:o.nodeName)!=="IFRAME"&&i.nodeType!==j.DOCUMENT_FRAGMENT_NODE&&(o==null||o.appendChild(a),a.parentNode=o,a.parentElement=o),i.nodeName==="IFRAME"){const n=i.contentDocument;n&&r(n,a)}else(i.nodeType===j.DOCUMENT_NODE||i.nodeType===j.ELEMENT_NODE||i.nodeType===j.DOCUMENT_FRAGMENT_NODE)&&(i.nodeType===j.ELEMENT_NODE&&i.shadowRoot&&r(i.shadowRoot,a),i.childNodes.forEach(n=>r(n,a)))}return r(t,null),s}function yh(){return new wh}class wh{constructor(){y(this,"idNodeMap",new Map),y(this,"nodeMetaMap",new WeakMap)}getId(e){var r;var s;return e&&(r=(s=this.getMeta(e))==null?void 0:s.id)!=null?r:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const s=this.getId(e);this.idNodeMap.delete(s),e.childNodes&&e.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,s){const r=s.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,s)}replace(e,s){const r=this.getNode(e);if(r){const i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(s,i)}this.idNodeMap.set(e,s)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Rn(t,e){switch(t.RRNodeType){case M.Document:return{id:e,type:t.RRNodeType,childNodes:[]};case M.DocumentType:{const s=t;return{id:e,type:t.RRNodeType,name:s.name,publicId:s.publicId,systemId:s.systemId}}case M.Element:return{id:e,type:t.RRNodeType,tagName:t.tagName.toLowerCase(),attributes:{},childNodes:[]};case M.Text:return{id:e,type:t.RRNodeType,textContent:t.textContent||""};case M.Comment:return{id:e,type:t.RRNodeType,textContent:t.textContent||""};case M.CDATA:return{id:e,type:t.RRNodeType,textContent:""}}}function On(t){return{all:t=t||new Map,on:function(e,s){var r=t.get(e);r?r.push(s):t.set(e,[s])},off:function(e,s){var r=t.get(e);r&&(s?r.splice(r.indexOf(s)>>>0,1):t.set(e,[]))},emit:function(e,s){var r=t.get(e);r&&r.slice().map(function(i){i(s)}),(r=t.get("*"))&&r.slice().map(function(i){i(e,s)})}}}const bh=Object.freeze(Object.defineProperty({__proto__:null,default:On},Symbol.toStringTag,{value:"Module"})),zr=new Map;function An(t,e){let s=zr.get(t);return s||(s=new Map,zr.set(t,s)),s.has(e)||s.set(e,[]),s.get(e)}function K(t,e,s){return async r=>{if(r&&typeof r=="object"&&"rr_type"in r)if(s&&(s.isUnchanged=!1),r.rr_type==="ImageBitmap"&&"args"in r){const i=await K(t,e,s)(r.args);return await createImageBitmap.apply(null,i)}else if("index"in r){if(s||e===null)return r;const{rr_type:i,index:o}=r;return An(e,i)[o]}else if("args"in r){const{rr_type:i,args:o}=r,a=window[i];return new a(...await Promise.all(o.map(K(t,e,s))))}else{if("base64"in r)return tl(r.base64);if("src"in r){const i=t.get(r.src);if(i)return i;{const o=new Image;return o.src=r.src,t.set(r.src,o),o}}else if("data"in r&&r.rr_type==="Blob"){const i=await Promise.all(r.data.map(K(t,e,s)));return new Blob(i,{type:r.type})}}else if(Array.isArray(r))return await Promise.all(r.map(K(t,e,s)));return r}}async function vh({event:t,mutations:e,target:s,imageMap:r,errorHandler:i}){const o=s.getContext("2d");if(!o){i(e[0],new Error("Canvas context is null"));return}const a=e.map(async n=>Promise.all(n.args.map(K(r,o))));(await Promise.all(a)).forEach((n,c)=>{const l=e[c];try{if(l.setter){o[l.property]=l.args[0];return}const h=o[l.property];l.property==="drawImage"&&typeof l.args[0]=="string"?(r.get(t),h.apply(o,l.args)):h.apply(o,n)}catch(h){i(l,h)}})}function Sh(t,e){try{return e===ht.WebGL?t.getContext("webgl")||t.getContext("experimental-webgl"):t.getContext("webgl2")}catch(s){return null}}const xh=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function Ch(t,e){if(!(e!=null&&e.constructor))return;const{name:s}=e.constructor;if(!xh.includes(s))return;const r=An(t,s);r.includes(e)||r.push(e)}async function Eh({mutation:t,target:e,type:s,imageMap:r,errorHandler:i}){try{const o=Sh(e,s);if(!o)return;if(t.setter){o[t.property]=t.args[0];return}const a=o[t.property],n=await Promise.all(t.args.map(K(r,o))),c=a.apply(o,n);Ch(o,c);const l=!1}catch(o){i(t,o)}}async function Yr({event:t,mutation:e,target:s,imageMap:r,canvasEventMap:i,errorHandler:o}){try{const a=i.get(t)||e,n="commands"in a?a.commands:[a];if([ht.WebGL,ht.WebGL2].includes(e.type)){for(let c=0;c<n.length;c++){const l=n[c];await Eh({mutation:l,type:e.type,target:s,imageMap:r,errorHandler:o})}return}await vh({event:t,mutations:n,target:s,imageMap:r,errorHandler:o})}catch(a){o(e,a)}}/*! *****************************************************************************
60
60
  Copyright (c) Microsoft Corporation.
61
61
 
62
62
  Permission to use, copy, modify, and/or distribute this software for any
@@ -69,7 +69,7 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
69
69
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
70
70
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
71
71
  PERFORMANCE OF THIS SOFTWARE.
72
- ***************************************************************************** */function Vr(t,e){var s=typeof Symbol=="function"&&t[Symbol.iterator];if(!s)return t;var r,i,o=s.call(t),a=[];try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(n){i={error:n}}finally{try{r&&!r.done&&(s=o.return)&&s.call(o)}finally{if(i)throw i.error}}return a}var ie;(function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"})(ie||(ie={}));var Rn={type:"xstate.init"};function Bt(t){return t===void 0?[]:[].concat(t)}function re(t){return{type:"xstate.assign",assignment:t}}function zr(t,e){return typeof(t=typeof t=="string"&&e&&e[t]?e[t]:t)=="string"?{type:t}:typeof t=="function"?{type:t.name,exec:t}:t}function gt(t){return function(e){return t===e}}function On(t){return typeof t=="string"?{type:t}:t}function Yr(t,e){return{value:t,context:e,actions:[],changed:!1,matches:gt(t)}}function Gr(t,e,s){var r=e,i=!1;return[t.filter(function(o){if(o.type==="xstate.assign"){i=!0;var a=Object.assign({},r);return typeof o.assignment=="function"?a=o.assignment(r,s):Object.keys(o.assignment).forEach(function(n){a[n]=typeof o.assignment[n]=="function"?o.assignment[n](r,s):o.assignment[n]}),r=a,!1}return!0}),r,i]}function An(t,e){e===void 0&&(e={});var s=Vr(Gr(Bt(t.states[t.initial].entry).map(function(a){return zr(a,e.actions)}),t.context,Rn),2),r=s[0],i=s[1],o={config:t,_options:e,initialState:{value:t.initial,actions:r,context:i,matches:gt(t.initial)},transition:function(a,n){var l,c,h=typeof a=="string"?{value:a,context:t.context}:a,u=h.value,p=h.context,m=On(n),b=t.states[u];if(b.on){var d=Bt(b.on[m.type]);try{for(var S=function(U){var Dt=typeof Symbol=="function"&&Symbol.iterator,Xs=Dt&&U[Dt],Zs=0;if(Xs)return Xs.call(U);if(U&&typeof U.length=="number")return{next:function(){return U&&Zs>=U.length&&(U=void 0),{value:U&&U[Zs++],done:!U}}};throw new TypeError(Dt?"Object is not iterable.":"Symbol.iterator is not defined.")}(d),f=S.next();!f.done;f=S.next()){var w=f.value;if(w===void 0)return Yr(u,p);var g=typeof w=="string"?{target:w}:w,x=g.target,P=g.actions,B=P===void 0?[]:P,F=g.cond,V=F===void 0?function(){return!0}:F,K=x===void 0,Pn=x!=null?x:u,Ln=t.states[Pn];if(V(p,m)){var kt=Vr(Gr((K?Bt(B):[].concat(b.exit,B,Ln.entry).filter(function(U){return U})).map(function(U){return zr(U,o._options.actions)}),p,m),3),Ys=kt[0],Fn=kt[1],_n=kt[2],Gs=x!=null?x:u;return{value:Gs,context:Fn,actions:Ys,changed:x!==u||Ys.length>0||_n,matches:gt(Gs)}}}}catch(U){l={error:U}}finally{try{f&&!f.done&&(c=S.return)&&c.call(S)}finally{if(l)throw l.error}}}return Yr(u,p)}};return o}var Xr=function(t,e){return t.actions.forEach(function(s){var r=s.exec;return r&&r(t.context,e)})};function In(t){var e=t.initialState,s=ie.NotStarted,r=new Set,i={_machine:t,send:function(o){s===ie.Running&&(e=t.transition(e,o),Xr(e,On(o)),r.forEach(function(a){return a(e)}))},subscribe:function(o){return r.add(o),o(e),{unsubscribe:function(){return r.delete(o)}}},start:function(o){if(o){var a=typeof o=="object"?o:{context:t.config.context,value:o};e={value:a.value,actions:[],context:a.context,matches:gt(a.value)}}return s=ie.Running,Xr(e,Rn),i},stop:function(){return s=ie.Stopped,r.clear(),i},get state(){return e},get status(){return s}};return i}class Sh{constructor(e=[],s){v(this,"timeOffset",0),v(this,"speed"),v(this,"actions"),v(this,"raf",null),v(this,"lastTimestamp"),this.actions=e,this.speed=s.speed}addAction(e){const s=this.raf===!0;if(!this.actions.length||this.actions[this.actions.length-1].delay<=e.delay)this.actions.push(e);else{const r=this.findActionIndex(e);this.actions.splice(r,0,e)}s&&(this.raf=requestAnimationFrame(this.rafCheck.bind(this)))}start(){this.timeOffset=0,this.lastTimestamp=performance.now(),this.raf=requestAnimationFrame(this.rafCheck.bind(this))}rafCheck(){const e=performance.now();for(this.timeOffset+=(e-this.lastTimestamp)*this.speed,this.lastTimestamp=e;this.actions.length;){const s=this.actions[0];if(this.timeOffset>=s.delay)this.actions.shift(),s.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(e){this.speed=e}isActive(){return this.raf!==null}findActionIndex(e){let s=0,r=this.actions.length-1;for(;s<=r;){const i=Math.floor((s+r)/2);if(this.actions[i].delay<e.delay)s=i+1;else if(this.actions[i].delay>e.delay)r=i-1;else return i+1}return s}}function Zr(t,e){if(t.type===L.IncrementalSnapshot&&t.data.source===T.MouseMove&&t.data.positions&&t.data.positions.length){const s=t.data.positions[0].timeOffset,r=t.timestamp+s;return t.delay=r-e,r-e}return t.delay=t.timestamp-e,t.delay}function xh(t,e){for(let s=t.length-1;s>=0;s--){const r=t[s];if(r.type===L.Meta&&r.timestamp<=e)return t.slice(s)}return t}function Ch(t,{getCastFn:e,applyEventsSynchronously:s,emitter:r}){const i=An({id:"player",context:t,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:re({lastPlayedEvent:(o,a)=>a.type==="CAST_EVENT"?a.payload.event:o.lastPlayedEvent}),recordTimeOffset:re((o,a)=>{let n=o.timeOffset;return"payload"in a&&"timeOffset"in a.payload&&(n=a.payload.timeOffset),W(O({},o),{timeOffset:n,baselineTime:o.events[0].timestamp+n})}),play(o){const{timer:a,events:n,baselineTime:l}=o;a.clear();for(const u of n)Zr(u,l);const c=xh(n,l);r.emit(N.PlayBack);const h=new Array;for(const u of c)if(u.timestamp<l)h.push(u);else{const p=e(u,!1);a.addAction({doAction:()=>{p()},delay:u.delay})}s(h),r.emit(N.Flush),a.start()},pause(o){o.timer.clear()},resetLastPlayedEvent:re(o=>W(O({},o),{lastPlayedEvent:null})),startLive:re({baselineTime:(o,a)=>(o.timer.start(),a.type==="TO_LIVE"&&a.payload.baselineTime?a.payload.baselineTime:Date.now())}),addEvent:re((o,a)=>{const{baselineTime:n,timer:l,events:c}=o;if(a.type==="ADD_EVENT"){const{event:h}=a.payload;Zr(h,n);let u=c.length-1;if(!c[u]||c[u].timestamp<=h.timestamp)c.push(h);else{let b=-1,d=0;for(;d<=u;){const S=Math.floor((d+u)/2);c[S].timestamp<=h.timestamp?d=S+1:u=S-1}b===-1&&(b=d),c.splice(b,0,h)}const p=h.timestamp<n,m=e(h,p);p?m():l.isActive()&&l.addAction({doAction:()=>{m()},delay:h.delay})}return W(O({},o),{events:c})})}});return In(i)}function Eh(t){const e=An({id:"speed",context:t,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:(s,r)=>{"payload"in r&&s.timer.setSpeed(r.payload.speed)},recordSpeed:re({normalSpeed:s=>s.timer.speed}),restoreSpeed:s=>{s.timer.setSpeed(s.normalSpeed)}}});return In(e)}class Mh{constructor(e){v(this,"mediaMap",new Map),v(this,"warn"),v(this,"service"),v(this,"speedService"),v(this,"emitter"),v(this,"getCurrentTime"),v(this,"metadataCallbackMap",new Map),this.warn=e.warn,this.service=e.service,this.speedService=e.speedService,this.emitter=e.emitter,this.getCurrentTime=e.getCurrentTime,this.emitter.on(N.Start,this.start.bind(this)),this.emitter.on(N.SkipStart,this.start.bind(this)),this.emitter.on(N.Pause,this.pause.bind(this)),this.emitter.on(N.Finish,this.pause.bind(this)),this.speedService.subscribe(()=>{this.syncAllMediaElements()})}syncAllMediaElements(e={pause:!1}){this.mediaMap.forEach((s,r)=>{this.syncTargetWithState(r),e.pause&&r.pause()})}start(){this.syncAllMediaElements()}pause(){this.syncAllMediaElements({pause:!0})}seekTo({time:e,target:s,mediaState:r}){if(r.isPlaying){const i=(e-r.lastInteractionTimeOffset)/1e3*r.playbackRate,o="duration"in s&&s.duration;if(Number.isNaN(o)){this.waitForMetadata(s);return}let a=r.currentTimeAtLastInteraction+i;s.loop&&o!==!1&&(a=a%o),s.currentTime=a}else s.pause(),s.currentTime=r.currentTimeAtLastInteraction}waitForMetadata(e){if(this.metadataCallbackMap.has(e)||!("addEventListener"in e))return;const s=()=>{this.metadataCallbackMap.delete(e);const r=this.mediaMap.get(e);r&&this.seekTo({time:this.getCurrentTime(),target:e,mediaState:r})};this.metadataCallbackMap.set(e,s),e.addEventListener("loadedmetadata",s,{once:!0})}getMediaStateFromMutation({target:e,timeOffset:s,mutation:r}){var u,p,m,b,d;const i=this.mediaMap.get(e),{type:o,playbackRate:a,currentTime:n,muted:l,volume:c,loop:h}=r;return{isPlaying:o===ss.Play||o!==ss.Pause&&((i==null?void 0:i.isPlaying)||e.getAttribute("autoplay")!==null),currentTimeAtLastInteraction:(u=n!=null?n:i==null?void 0:i.currentTimeAtLastInteraction)!=null?u:0,lastInteractionTimeOffset:s,playbackRate:(p=a!=null?a:i==null?void 0:i.playbackRate)!=null?p:1,volume:(m=c!=null?c:i==null?void 0:i.volume)!=null?m:1,muted:(b=l!=null?l:i==null?void 0:i.muted)!=null?b:e.getAttribute("muted")===null,loop:(d=h!=null?h:i==null?void 0:i.loop)!=null?d:e.getAttribute("loop")===null}}syncTargetWithState(e){const s=this.mediaMap.get(e);if(!s)return;const{muted:r,loop:i,volume:o,isPlaying:a}=s,n=this.service.state.matches("paused"),l=s.playbackRate*this.speedService.state.context.timer.speed;try{this.seekTo({time:this.getCurrentTime(),target:e,mediaState:s}),e.volume!==o&&(e.volume=o),e.muted=r,e.loop=i,e.playbackRate!==l&&(e.playbackRate=l),a&&!n?e.play():e.pause()}catch(c){this.warn(`Failed to replay media interactions: ${c.message||c}`)}}addMediaElements(e,s,r){if(!["AUDIO","VIDEO"].includes(e.nodeName))return;const i=e,o=r.getMeta(i);if(!o||!("attributes"in o))return;const a=this.service.state.matches("paused"),n=o.attributes;let l=!1;n.rr_mediaState?l=n.rr_mediaState==="played":l=i.getAttribute("autoplay")!==null,l&&a&&i.pause();let c=1;typeof n.rr_mediaPlaybackRate=="number"&&(c=n.rr_mediaPlaybackRate);let h=!1;typeof n.rr_mediaMuted=="boolean"?h=n.rr_mediaMuted:h=i.getAttribute("muted")!==null;let u=!1;typeof n.rr_mediaLoop=="boolean"?u=n.rr_mediaLoop:u=i.getAttribute("loop")!==null;let p=1;typeof n.rr_mediaVolume=="number"&&(p=n.rr_mediaVolume);let m=0;typeof n.rr_mediaCurrentTime=="number"&&(m=n.rr_mediaCurrentTime),this.mediaMap.set(i,{isPlaying:l,currentTimeAtLastInteraction:m,lastInteractionTimeOffset:s,playbackRate:c,volume:p,muted:h,loop:u}),this.syncTargetWithState(i)}mediaMutation({target:e,timeOffset:s,mutation:r}){this.mediaMap.set(e,this.getMediaStateFromMutation({target:e,timeOffset:s,mutation:r})),this.syncTargetWithState(e)}isSupportedMediaElement(e){return["AUDIO","VIDEO"].includes(e.nodeName)}reset(){this.mediaMap.clear()}}function Nh(t=window,e=document){if("scrollBehavior"in e.documentElement.style&&t.__forceSmoothScrollPolyfill__!==!0)return;const s=t.HTMLElement||t.Element,r=468,i={scroll:t.scroll||t.scrollTo,scrollBy:t.scrollBy,elementScroll:s.prototype.scroll||l,scrollIntoView:s.prototype.scrollIntoView},o=t.performance&&t.performance.now?t.performance.now.bind(t.performance):Date.now;function a(f){const w=["MSIE ","Trident/","Edge/"];return new RegExp(w.join("|")).test(f)}const n=a(t.navigator.userAgent)?1:0;function l(f,w){this.scrollLeft=f,this.scrollTop=w}function c(f){return .5*(1-Math.cos(Math.PI*f))}function h(f){if(f===null||typeof f!="object"||f.behavior===void 0||f.behavior==="auto"||f.behavior==="instant")return!0;if(typeof f=="object"&&f.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+f.behavior+" is not a valid value for enumeration ScrollBehavior.")}function u(f,w){if(w==="Y")return f.clientHeight+n<f.scrollHeight;if(w==="X")return f.clientWidth+n<f.scrollWidth}function p(f,w){const g=t.getComputedStyle(f,null)["overflow"+w];return g==="auto"||g==="scroll"}function m(f){const w=u(f,"Y")&&p(f,"Y"),g=u(f,"X")&&p(f,"X");return w||g}function b(f){for(;f!==e.body&&m(f)===!1;)f=f.parentNode||f.host;return f}function d(f){const w=o();let g,x,P,B=(w-f.startTime)/r;B=B>1?1:B,g=c(B),x=f.startX+(f.x-f.startX)*g,P=f.startY+(f.y-f.startY)*g,f.method.call(f.scrollable,x,P),(x!==f.x||P!==f.y)&&t.requestAnimationFrame(d.bind(t,f))}function S(f,w,g){let x,P,B,F;const V=o();f===e.body?(x=t,P=t.scrollX||t.pageXOffset,B=t.scrollY||t.pageYOffset,F=i.scroll):(x=f,P=f.scrollLeft,B=f.scrollTop,F=l),d({scrollable:x,method:F,startTime:V,startX:P,startY:B,x:w,y:g})}t.scroll=t.scrollTo=function(){if(arguments[0]!==void 0){if(h(arguments[0])===!0){i.scroll.call(t,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:t.scrollX||t.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:t.scrollY||t.pageYOffset);return}S.call(t,e.body,arguments[0].left!==void 0?~~arguments[0].left:t.scrollX||t.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:t.scrollY||t.pageYOffset)}},t.scrollBy=function(){if(arguments[0]!==void 0){if(h(arguments[0])){i.scrollBy.call(t,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}S.call(t,e.body,~~arguments[0].left+(t.scrollX||t.pageXOffset),~~arguments[0].top+(t.scrollY||t.pageYOffset))}},s.prototype.scroll=s.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(h(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");i.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 f=arguments[0].left,w=arguments[0].top;S.call(this,this,typeof f>"u"?this.scrollLeft:~~f,typeof w>"u"?this.scrollTop:~~w)},s.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(h(arguments[0])===!0){i.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})}},s.prototype.scrollIntoView=function(){if(h(arguments[0])===!0){i.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}const f=b(this),w=f.getBoundingClientRect(),g=this.getBoundingClientRect();f!==e.body?(S.call(this,f,f.scrollLeft+g.left-w.left,f.scrollTop+g.top-w.top),t.getComputedStyle(f).position!=="fixed"&&t.scrollBy({left:w.left,top:w.top,behavior:"smooth"})):t.scrollBy({left:g.left,top:g.top,behavior:"smooth"})}}const Th=t=>[`.${t} { background: currentColor }`,"noscript { display: none !important; }"],kh=5*1e3,Dh=kn||mh,Hr="[replayer]",Wt={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function Jr(t){return t.type==L.IncrementalSnapshot&&(t.data.source==T.TouchMove||t.data.source==T.MouseInteraction&&t.data.type==_.TouchStart)}class Rh{constructor(e,s){if(v(this,"wrapper"),v(this,"iframe"),v(this,"service"),v(this,"speedService"),v(this,"config"),v(this,"usingVirtualDom",!1),v(this,"virtualDom",new ue),v(this,"mouse"),v(this,"mouseTail",null),v(this,"tailPositions",[]),v(this,"emitter",Dh()),v(this,"nextUserInteractionEvent"),v(this,"legacy_missingNodeRetryMap",{}),v(this,"cache",yr()),v(this,"imageMap",new Map),v(this,"canvasEventMap",new Map),v(this,"mirror",Qr()),v(this,"styleMirror",new Ha),v(this,"mediaManager"),v(this,"firstFullSnapshot",null),v(this,"newDocumentQueue",[]),v(this,"mousePos",null),v(this,"touchActive",null),v(this,"lastMouseDownEvent",null),v(this,"lastHoveredRootNode"),v(this,"lastSelectionData",null),v(this,"constructedStyleMutations",[]),v(this,"adoptedStyleSheets",[]),v(this,"handleResize",n=>{this.iframe.style.display="inherit";for(const l of[this.mouseTail,this.iframe])l&&(l.setAttribute("width",String(n.width)),l.setAttribute("height",String(n.height)))}),v(this,"applyEventsSynchronously",n=>{for(const l of n){switch(l.type){case L.DomContentLoaded:case L.Load:case L.Custom:continue;case L.FullSnapshot:case L.Meta:case L.Plugin:case L.IncrementalSnapshot:break}this.getCastFn(l,!0)()}}),v(this,"getCastFn",(n,l=!1)=>{let c;switch(n.type){case L.DomContentLoaded:case L.Load:break;case L.Custom:c=()=>{this.emitter.emit(N.CustomEvent,n)};break;case L.Meta:c=()=>this.emitter.emit(N.Resize,{width:n.data.width,height:n.data.height});break;case L.FullSnapshot:c=()=>{var h;if(this.firstFullSnapshot){if(this.firstFullSnapshot===n){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.mediaManager.reset(),this.styleMirror.reset(),this.rebuildFullSnapshot(n,l),(h=this.iframe.contentWindow)==null||h.scrollTo(n.data.initialOffset)};break;case L.IncrementalSnapshot:c=()=>{if(this.applyIncremental(n,l),!l&&(n===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),!this.nextUserInteractionEvent)){for(const h of this.service.state.context.events)if(!(h.timestamp<=n.timestamp)&&this.isUserInteraction(h)){h.delay-n.delay>this.config.inactivePeriodThreshold*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=h);break}if(this.nextUserInteractionEvent)if(this.config.skipInactive)this.play(this.nextUserInteractionEvent.timestamp-this.getMetaData().startTime-1e3);else{const h=this.nextUserInteractionEvent.delay-n.delay,u={speed:Math.min(Math.round(h/kh),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:u}),this.emitter.emit(N.SkipStart,u)}}};break}return()=>{c&&c();for(const u of this.config.plugins||[])u.handler&&u.handler(n,l,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:n}});const h=this.service.state.context.events.length-1;if(!this.config.liveMode&&n===this.service.state.context.events[h]){const u=()=>{h<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(N.Finish))};let p=50;n.type===L.IncrementalSnapshot&&n.data.source===T.MouseMove&&n.data.positions.length&&(p+=Math.max(0,-n.data.positions[0].timeOffset)),setTimeout(u,p)}this.emitter.emit(N.EventCast,n)}}),!(s!=null&&s.liveMode)&&e.length<2)throw new Error("Replayer need at least 2 events.");const r={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:Wt,useVirtualDom:!0,logger:console};this.config=Object.assign({},r,s),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(N.Resize,this.handleResize),this.setupDom();for(const n of this.config.plugins||[])n.getMirror&&n.getMirror({nodeMirror:this.mirror});this.emitter.on(N.Flush,()=>{if(this.usingVirtualDom){const n={mirror:this.mirror,applyCanvas:(l,c,h)=>{jr({event:l,mutation:c,target:h,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 h of this.config.plugins||[])h.onBuild&&h.onBuild(l,{id:c,replayer:this})}};if(this.iframe.contentDocument)try{ft(this.iframe.contentDocument,this.virtualDom,n,this.virtualDom.mirror)}catch(l){console.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],h=mt(c.node,this.mirror,this.virtualDom.mirror);ft(h,c.node,n,this.virtualDom.mirror),c.node=h}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[n,l]=this.lastMouseDownEvent;n.dispatchEvent(l)}this.lastMouseDownEvent=null,this.lastSelectionData&&(this.applySelection(this.lastSelectionData),this.lastSelectionData=null)}),this.emitter.on(N.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset()});const i=new Sh([],{speed:this.config.speed});this.service=Ch({events:e.map(n=>s&&s.unpackFn?s.unpackFn(n):n).sort((n,l)=>n.timestamp-l.timestamp),timer:i,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(n=>{this.emitter.emit(N.StateChange,{player:n})}),this.speedService=Eh({normalSpeed:-1,timer:i}),this.speedService.start(),this.speedService.subscribe(n=>{this.emitter.emit(N.StateChange,{speed:n})}),this.mediaManager=new Mh({warn:this.warn.bind(this),service:this.service,speedService:this.speedService,emitter:this.emitter,getCurrentTime:this.getCurrentTime.bind(this)});const o=this.service.state.context.events.find(n=>n.type===L.Meta),a=this.service.state.context.events.find(n=>n.type===L.FullSnapshot);if(o){const{width:n,height:l}=o.data;setTimeout(()=>{this.emitter.emit(N.Resize,{width:n,height:l})},0)}a&&setTimeout(()=>{var n;this.firstFullSnapshot||(this.firstFullSnapshot=a,this.rebuildFullSnapshot(a),(n=this.iframe.contentWindow)==null||n.scrollTo(a.data.initialOffset))},1),this.service.state.context.events.find(Jr)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(e,s){return this.emitter.on(e,s),this}off(e,s){return this.emitter.off(e,s),this}setConfig(e){Object.keys(e).forEach(s=>{e[s],this.config[s]=e[s]}),this.config.skipInactive||this.backToNormal(),typeof e.speed<"u"&&this.speedService.send({type:"SET_SPEED",payload:{speed:e.speed}}),typeof e.mouseTail<"u"&&(e.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 e=this.service.state.context.events[0],s=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:e.timestamp,endTime:s.timestamp,totalTime:s.timestamp-e.timestamp}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){const{baselineTime:e,events:s}=this.service.state.context;return e-s[0].timestamp}getMirror(){return this.mirror}play(e=0){var s,r;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:e}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:e}})),(r=(s=this.iframe.contentDocument)==null?void 0:s.getElementsByTagName("html")[0])==null||r.classList.remove("@sailfish-rrweb/rrweb-paused"),this.emitter.emit(N.Start)}pause(e){var s,r;e===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof e=="number"&&(this.play(e),this.service.send({type:"PAUSE"})),(r=(s=this.iframe.contentDocument)==null?void 0:s.getElementsByTagName("html")[0])==null||r.classList.add("@sailfish-rrweb/rrweb-paused"),this.emitter.emit(N.Pause)}resume(e=0){this.warn("The 'resume' was deprecated in 1.0. Please use 'play' method which has the same interface."),this.play(e),this.emitter.emit(N.Resume)}destroy(){this.pause(),this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset(),this.config.root.removeChild(this.wrapper),this.emitter.emit(N.Destroy)}startLive(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})}addEvent(e){const s=this.config.unpackFn?this.config.unpackFn(e):e;Jr(s)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:s}}))}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=yr()}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.iframe=document.createElement("iframe");const e=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&e.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",e.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(Nh(this.iframe.contentWindow,this.iframe.contentDocument),Ga(this.iframe.contentWindow))}rebuildFullSnapshot(e,s=!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 r=[],i=(n,l)=>{if(this.collectIframeAndAttachDocument(r,n),this.mediaManager.isSupportedMediaElement(n)){const{events:c}=this.service.state.context;this.mediaManager.addMediaElements(n,e.timestamp-c[0].timestamp,this.mirror)}for(const c of this.config.plugins||[])c.onBuild&&c.onBuild(n,{id:l,replayer:this})};this.usingVirtualDom&&(this.virtualDom.destroyTree(),this.usingVirtualDom=!1),this.mirror.reset(),Ya(e.data.node,{doc:this.iframe.contentDocument,afterAppend:i,cache:this.cache,mirror:this.mirror}),i(this.iframe.contentDocument,e.data.node.id);for(const{mutationInQueue:n,builtNode:l}of r)this.attachDocumentToIframe(n,l),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==n);const{documentElement:o,head:a}=this.iframe.contentDocument;this.insertStyleRules(o,a),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("@sailfish-rrweb/rrweb-paused"),this.emitter.emit(N.FullsnapshotRebuilded,e),s||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(e,s){var r;const i=Th(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&i.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),this.usingVirtualDom){const o=this.virtualDom.createElement("style");this.virtualDom.mirror.add(o,Tn(o,this.virtualDom.unserializedId)),e.insertBefore(o,s),o.rules.push({source:T.StyleSheetRule,adds:i.map((a,n)=>({rule:a,index:n}))})}else{const o=document.createElement("style");e.insertBefore(o,s);for(let a=0;a<i.length;a++)(r=o.sheet)==null||r.insertRule(i[a],a)}}attachDocumentToIframe(e,s){const r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,i=[],o=(a,n)=>{this.collectIframeAndAttachDocument(i,a);const l=r.getMeta(a);if((l==null?void 0:l.type)===R.Element&&(l==null?void 0:l.tagName.toUpperCase())==="HTML"){const{documentElement:c,head:h}=s.contentDocument;this.insertStyleRules(c,h)}if(!this.usingVirtualDom)for(const c of this.config.plugins||[])c.onBuild&&c.onBuild(a,{id:n,replayer:this})};Ce(e.node,{doc:s.contentDocument,mirror:r,hackCss:!0,skipChild:!1,afterAppend:o,cache:this.cache}),o(s.contentDocument,e.node.id);for(const{mutationInQueue:a,builtNode:n}of i)this.attachDocumentToIframe(a,n),this.newDocumentQueue=this.newDocumentQueue.filter(l=>l!==a)}collectIframeAndAttachDocument(e,s){if(Pt(s,this.mirror)){const r=this.newDocumentQueue.find(i=>i.parentId===this.mirror.getId(s));r&&e.push({mutationInQueue:r,builtNode:s})}}waitForStylesheetLoad(){var e;const s=(e=this.iframe.contentDocument)==null?void 0:e.head;if(s){const r=new Set;let i,o=this.service.state;const a=()=>{o=this.service.state};this.emitter.on(N.Start,a),this.emitter.on(N.Pause,a);const n=()=>{this.emitter.off(N.Start,a),this.emitter.off(N.Pause,a)};s.querySelectorAll('link[rel="stylesheet"]').forEach(l=>{l.sheet||(r.add(l),l.addEventListener("load",()=>{r.delete(l),r.size===0&&i!==-1&&(o.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(N.LoadStylesheetEnd),i&&clearTimeout(i),n())}))}),r.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(N.LoadStylesheetStart),i=setTimeout(()=>{o.matches("playing")&&this.play(this.getCurrentTime()),i=-1,n()},this.config.loadTimeout))}}async preloadAllImages(){const e=[];for(const s of this.service.state.context.events)s.type===L.IncrementalSnapshot&&s.data.source===T.CanvasMutation&&(e.push(this.deserializeAndPreloadCanvasEvents(s.data,s)),("commands"in s.data?s.data.commands:[s.data]).forEach(r=>{this.preloadImages(r,s)}));return Promise.all(e)}preloadImages(e,s){if(e.property==="drawImage"&&typeof e.args[0]=="string"&&!this.imageMap.has(s)){const r=document.createElement("canvas"),i=r.getContext("2d"),o=i==null?void 0:i.createImageData(r.width,r.height);i==null||i.putImageData(o,0,0)}}async deserializeAndPreloadCanvasEvents(e,s){if(!this.canvasEventMap.has(s)){const r={isUnchanged:!0};if("commands"in e){const i=await Promise.all(e.commands.map(async o=>{const a=await Promise.all(o.args.map($(this.imageMap,null,r)));return W(O({},o),{args:a})}));r.isUnchanged===!1&&this.canvasEventMap.set(s,W(O({},e),{commands:i}))}else{const i=await Promise.all(e.args.map($(this.imageMap,null,r)));r.isUnchanged===!1&&this.canvasEventMap.set(s,W(O({},e),{args:i}))}}}applyIncremental(e,s){var r,i,o;const{data:a}=e;switch(a.source){case T.Mutation:{try{this.applyMutation(a,s)}catch(n){this.warn(`Exception in mutation ${n.message||n}`,a)}break}case T.Drag:case T.TouchMove:case T.MouseMove:if(s){const n=a.positions[a.positions.length-1];this.mousePos={x:n.x,y:n.y,id:n.id,debugData:a}}else a.positions.forEach(n=>{const l={doAction:()=>{this.moveAndHover(n.x,n.y,n.id,s,a)},delay:n.timeOffset+e.timestamp-this.service.state.context.baselineTime};this.timer.addAction(l)}),this.timer.addAction({doAction(){},delay:e.delay-((r=a.positions[0])==null?void 0:r.timeOffset)});break;case T.MouseInteraction:{if(a.id===-1)break;const n=new Event(Xn(_[a.type])),l=this.mirror.getNode(a.id);if(!l)return this.debugNodeNotFound(a,a.id);this.emitter.emit(N.MouseInteraction,{type:a.type,target:l});const{triggerFocus:c}=this.config;switch(a.type){case _.Blur:"blur"in l&&l.blur();break;case _.Focus:c&&l.focus&&l.focus({preventScroll:!0});break;case _.Click:case _.TouchStart:case _.TouchEnd:case _.MouseDown:case _.MouseUp:s?(a.type===_.TouchStart?this.touchActive=!0:a.type===_.TouchEnd&&(this.touchActive=!1),a.type===_.MouseDown?this.lastMouseDownEvent=[l,n]:a.type===_.MouseUp&&(this.lastMouseDownEvent=null),this.mousePos={x:a.x||0,y:a.y||0,id:a.id,debugData:a}):(a.type===_.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(a.x||0,a.y||0,a.id,s,a),a.type===_.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):a.type===_.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):a.type===_.TouchEnd?this.mouse.classList.remove("touch-active"):l.dispatchEvent(n));break;case _.TouchCancel:s?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:l.dispatchEvent(n)}break}case T.Scroll:{if(a.id===-1)break;if(this.usingVirtualDom){const n=this.virtualDom.mirror.getNode(a.id);if(!n)return this.debugNodeNotFound(a,a.id);n.scrollData=a;break}this.applyScroll(a,s);break}case T.ViewportResize:this.emitter.emit(N.Resize,{width:a.width,height:a.height});break;case T.Input:{if(a.id===-1)break;if(this.usingVirtualDom){const n=this.virtualDom.mirror.getNode(a.id);if(!n)return this.debugNodeNotFound(a,a.id);n.inputData=a;break}this.applyInput(a);break}case T.MediaInteraction:{const n=this.usingVirtualDom?this.virtualDom.mirror.getNode(a.id):this.mirror.getNode(a.id);if(!n)return this.debugNodeNotFound(a,a.id);const l=n,{events:c}=this.service.state.context;this.mediaManager.mediaMutation({target:l,timeOffset:e.timestamp-c[0].timestamp,mutation:a});break}case T.StyleSheetRule:case T.StyleDeclaration:{this.usingVirtualDom?a.styleId?this.constructedStyleMutations.push(a):a.id&&((i=this.virtualDom.mirror.getNode(a.id))==null||i.rules.push(a)):this.applyStyleSheetMutation(a);break}case T.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const n=this.virtualDom.mirror.getNode(a.id);if(!n)return this.debugNodeNotFound(a,a.id);n.canvasMutations.push({event:e,mutation:a})}else{const n=this.mirror.getNode(a.id);if(!n)return this.debugNodeNotFound(a,a.id);jr({event:e,mutation:a,target:n,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case T.Font:{try{const n=new FontFace(a.family,a.buffer?new Uint8Array(JSON.parse(a.fontSource)):a.fontSource,a.descriptors);(o=this.iframe.contentDocument)==null||o.fonts.add(n)}catch(n){this.warn(n)}break}case T.Selection:{if(s){this.lastSelectionData=a;break}this.applySelection(a);break}case T.AdoptedStyleSheet:{this.usingVirtualDom?this.adoptedStyleSheets.push(a):this.applyAdoptedStyleSheet(a);break}}}applyMutation(e,s){if(this.config.useVirtualDom&&!this.usingVirtualDom&&s&&(this.usingVirtualDom=!0,ph(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const c in this.legacy_missingNodeRetryMap)try{const h=this.legacy_missingNodeRetryMap[c],u=Nn(h.node,this.virtualDom,this.mirror);u&&(h.node=u)}catch(h){this.warn(h)}const r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;e.removes=e.removes.filter(c=>r.getNode(c.id)?!0:(this.warnNodeNotFound(e,c.id),!1)),e.removes.forEach(c=>{var h;const u=r.getNode(c.id);if(!u)return;let p=r.getNode(c.parentId);if(!p)return this.warnNodeNotFound(e,c.parentId);if(c.isShadow&&Ge(p)&&(p=p.shadowRoot),r.removeNodeFromMap(u),p)try{p.removeChild(u),this.usingVirtualDom&&u.nodeName==="#text"&&p.nodeName==="STYLE"&&((h=p.rules)==null?void 0:h.length)>0&&(p.rules=[])}catch(m){if(m instanceof DOMException)this.warn("parent could not remove child in mutation",p,u,e);else throw m}});const i=O({},this.legacy_missingNodeRetryMap),o=[],a=c=>{let h=null;return c.nextId&&(h=r.getNode(c.nextId)),c.nextId!==null&&c.nextId!==void 0&&c.nextId!==-1&&!h},n=c=>{var h,u;if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");let p=r.getNode(c.parentId);if(!p)return c.node.type===R.Document?this.newDocumentQueue.push(c):o.push(c);c.node.isShadow&&(Ge(p)||p.attachShadow({mode:"open"}),p=p.shadowRoot);let m=null,b=null;if(c.previousId&&(m=r.getNode(c.previousId)),c.nextId&&(b=r.getNode(c.nextId)),a(c))return o.push(c);if(c.node.rootId&&!r.getNode(c.node.rootId))return;const d=c.node.rootId?r.getNode(c.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(Pt(p,r)){this.attachDocumentToIframe(c,p);return}const S=(g,x)=>{if(!this.usingVirtualDom)for(const P of this.config.plugins||[])P.onBuild&&P.onBuild(g,{id:x,replayer:this})},f=Ce(c.node,{doc:d,mirror:r,skipChild:!0,hackCss:!0,cache:this.cache,afterAppend:S});if(c.previousId===-1||c.nextId===-1){i[c.node.id]={node:f,mutation:c};return}const w=r.getMeta(p);if(w&&w.type===R.Element&&c.node.type===R.Text){const g=Array.isArray(p.childNodes)?p.childNodes:Array.from(p.childNodes);if(w.tagName==="textarea")for(const x of g)x.nodeType===p.TEXT_NODE&&p.removeChild(x);else if(w.tagName==="style"&&g.length===1)for(const x of g)x.nodeType===p.TEXT_NODE&&!r.hasNode(x)&&(f.textContent=x.textContent,p.removeChild(x))}else if((w==null?void 0:w.type)===R.Document){const g=p;c.node.type===R.DocumentType&&((h=g.childNodes[0])==null?void 0:h.nodeType)===Node.DOCUMENT_TYPE_NODE&&g.removeChild(g.childNodes[0]),f.nodeName==="HTML"&&g.documentElement&&g.removeChild(g.documentElement)}if(m&&m.nextSibling&&m.nextSibling.parentNode?p.insertBefore(f,m.nextSibling):b&&b.parentNode?p.contains(b)?p.insertBefore(f,b):p.insertBefore(f,null):p.appendChild(f),S(f,c.node.id),this.usingVirtualDom&&f.nodeName==="#text"&&p.nodeName==="STYLE"&&((u=p.rules)==null?void 0:u.length)>0&&(p.rules=[]),Pt(f,this.mirror)){const g=this.mirror.getId(f),x=this.newDocumentQueue.find(P=>P.parentId===g);x&&(this.attachDocumentToIframe(x,f),this.newDocumentQueue=this.newDocumentQueue.filter(P=>P!==x))}(c.previousId||c.nextId)&&this.legacy_resolveMissingNode(i,p,f,c)};e.adds.forEach(c=>{n(c)});const l=Date.now();for(;o.length;){const c=Xa(o);if(o.length=0,Date.now()-l>500){this.warn("Timeout in the loop, please check the resolve tree data:",c);break}for(const h of c)r.getNode(h.value.parentId)?Pi(h,u=>{n(u)}):this.debug("Drop resolve tree since there is no parent for the root node.",h)}Object.keys(i).length&&Object.assign(this.legacy_missingNodeRetryMap,i),Za(e.texts).forEach(c=>{var h;const u=r.getNode(c.id);if(!u)return e.removes.find(p=>p.id===c.id)?void 0:this.warnNodeNotFound(e,c.id);if(u.textContent=c.value,this.usingVirtualDom){const p=u.parentNode;((h=p==null?void 0:p.rules)==null?void 0:h.length)>0&&(p.rules=[])}}),e.attributes.forEach(c=>{var h;const u=r.getNode(c.id);if(!u)return e.removes.find(p=>p.id===c.id)?void 0:this.warnNodeNotFound(e,c.id);for(const p in c.attributes)if(typeof p=="string"){const m=c.attributes[p];if(m===null)u.removeAttribute(p);else if(typeof m=="string")try{if(p==="_cssText"&&(u.nodeName==="LINK"||u.nodeName==="STYLE"))try{const b=r.getMeta(u);Object.assign(b.attributes,c.attributes);const d=Ce(b,{doc:u.ownerDocument,mirror:r,skipChild:!0,hackCss:!0,cache:this.cache}),S=u.nextSibling,f=u.parentNode;if(d&&f){f.removeChild(u),f.insertBefore(d,S),r.replace(c.id,d);break}}catch(b){}if(p==="value"&&u.nodeName==="TEXTAREA"){const b=u;b.childNodes.forEach(S=>b.removeChild(S));const d=(h=u.ownerDocument)==null?void 0:h.createTextNode(m);d&&b.appendChild(d)}else u.setAttribute(p,m)}catch(b){this.warn("An error occurred may due to the checkout feature.",b)}else if(p==="style"){const b=m,d=u;for(const S in b)if(b[S]===!1)d.style.removeProperty(S);else if(b[S]instanceof Array){const f=b[S];d.style.setProperty(S,f[0],f[1])}else{const f=b[S];d.style.setProperty(S,f)}}}})}applyScroll(e,s){var r,i;const o=this.mirror.getNode(e.id);if(!o)return this.debugNodeNotFound(e,e.id);const a=this.mirror.getMeta(o);if(o===this.iframe.contentDocument)(r=this.iframe.contentWindow)==null||r.scrollTo({top:e.y,left:e.x,behavior:s?"auto":"smooth"});else if((a==null?void 0:a.type)===R.Document)(i=o.defaultView)==null||i.scrollTo({top:e.y,left:e.x,behavior:s?"auto":"smooth"});else try{o.scrollTo({top:e.y,left:e.x,behavior:s?"auto":"smooth"})}catch(n){}}applyInput(e){const s=this.mirror.getNode(e.id);if(!s)return this.debugNodeNotFound(e,e.id);try{s.checked=e.isChecked,s.value=e.text}catch(r){}}applySelection(e){try{const s=new Set,r=e.ranges.map(({start:i,startOffset:o,end:a,endOffset:n})=>{const l=this.mirror.getNode(i),c=this.mirror.getNode(a);if(!l||!c)return;const h=new Range;h.setStart(l,o),h.setEnd(c,n);const u=l.ownerDocument,p=u==null?void 0:u.getSelection();return p&&s.add(p),{range:h,selection:p}});s.forEach(i=>i.removeAllRanges()),r.forEach(i=>{var o;return i&&((o=i.selection)==null?void 0:o.addRange(i.range))})}catch(s){}}applyStyleSheetMutation(e){var s;let r=null;e.styleId?r=this.styleMirror.getStyle(e.styleId):e.id&&(r=((s=this.mirror.getNode(e.id))==null?void 0:s.sheet)||null),r&&(e.source===T.StyleSheetRule?this.applyStyleSheetRule(e,r):e.source===T.StyleDeclaration&&this.applyStyleDeclaration(e,r))}applyStyleSheetRule(e,s){var r,i,o,a;if((r=e.adds)==null||r.forEach(({rule:n,index:l})=>{try{if(Array.isArray(l)){const{positions:c,index:h}=br(l);Se(s.cssRules,c).insertRule(n,h)}else{const c=l===void 0?void 0:Math.min(l,s.cssRules.length);s==null||s.insertRule(n,c)}}catch(c){}}),(i=e.removes)==null||i.forEach(({index:n})=>{try{if(Array.isArray(n)){const{positions:l,index:c}=br(n);Se(s.cssRules,l).deleteRule(c||0)}else s==null||s.deleteRule(n)}catch(l){}}),e.replace)try{(o=s.replace)==null||o.call(s,e.replace)}catch(n){}if(e.replaceSync)try{(a=s.replaceSync)==null||a.call(s,e.replaceSync)}catch(n){}}applyStyleDeclaration(e,s){e.set&&Se(s.rules,e.index).style.setProperty(e.set.property,e.set.value,e.set.priority),e.remove&&Se(s.rules,e.index).style.removeProperty(e.remove.property)}applyAdoptedStyleSheet(e){var s;const r=this.mirror.getNode(e.id);if(!r)return;(s=e.styles)==null||s.forEach(n=>{var l;let c=null,h=null;if(Ge(r)?h=((l=r.ownerDocument)==null?void 0:l.defaultView)||null:r.nodeName==="#document"&&(h=r.defaultView),!!h)try{c=new h.CSSStyleSheet,this.styleMirror.add(c,n.styleId),this.applyStyleSheetRule({source:T.StyleSheetRule,adds:n.rules},c)}catch(u){}});const i=10;let o=0;const a=(n,l)=>{const c=l.map(h=>this.styleMirror.getStyle(h)).filter(h=>h!==null);Ge(n)?n.shadowRoot.adoptedStyleSheets=c:n.nodeName==="#document"&&(n.adoptedStyleSheets=c),c.length!==l.length&&o<i&&(setTimeout(()=>a(n,l),0+100*o),o++)};a(r,e.styleIds)}legacy_resolveMissingNode(e,s,r,i){const{previousId:o,nextId:a}=i,n=o&&e[o],l=a&&e[a];if(n){const{node:c,mutation:h}=n;s.insertBefore(c,r),delete e[h.node.id],delete this.legacy_missingNodeRetryMap[h.node.id],(h.previousId||h.nextId)&&this.legacy_resolveMissingNode(e,s,c,h)}if(l){const{node:c,mutation:h}=l;s.insertBefore(c,r.nextSibling),delete e[h.node.id],delete this.legacy_missingNodeRetryMap[h.node.id],(h.previousId||h.nextId)&&this.legacy_resolveMissingNode(e,s,c,h)}}moveAndHover(e,s,r,i,o){const a=this.mirror.getNode(r);if(!a)return this.debugNodeNotFound(o,r);const n=Li(a,this.iframe),l=e*n.absoluteScale+n.x,c=s*n.absoluteScale+n.y;this.mouse.style.left=`${l}px`,this.mouse.style.top=`${c}px`,i||this.drawMouseTail({x:l,y:c}),this.hoverElements(a)}drawMouseTail(e){if(!this.mouseTail)return;const{lineCap:s,lineWidth:r,strokeStyle:i,duration:o}=this.config.mouseTail===!0?Wt:Object.assign({},Wt,this.config.mouseTail),a=()=>{if(!this.mouseTail)return;const n=this.mouseTail.getContext("2d");!n||!this.tailPositions.length||(n.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),n.beginPath(),n.lineWidth=r,n.lineCap=s,n.strokeStyle=i,n.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(l=>n.lineTo(l.x,l.y)),n.stroke())};this.tailPositions.push(e),a(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(n=>n!==e),a()},o/this.speedService.state.context.timer.speed)}hoverElements(e){var s;(s=this.lastHoveredRootNode||this.iframe.contentDocument)==null||s.querySelectorAll(".\\:hover").forEach(i=>{i.classList.remove(":hover")}),this.lastHoveredRootNode=e.getRootNode();let r=e;for(;r;)r.classList&&r.classList.add(":hover"),r=r.parentElement}isUserInteraction(e){return e.type!==L.IncrementalSnapshot?!1:e.data.source>T.Mutation&&e.data.source<=T.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(N.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(e,s){this.warn(`Node with id '${s}' not found. `,e)}warnCanvasMutationFailed(e,s){this.warn("Has error on canvas update",s,"canvas mutation:",e)}debugNodeNotFound(e,s){this.debug(`Node with id '${s}' not found. `,e)}warn(...e){this.config.showWarning&&this.config.logger.warn(Hr,...e)}debug(...e){this.config.showDebug&&this.config.logger.log(Hr,...e)}}exports.Replayer=Rh;
72
+ ***************************************************************************** */function Gr(t,e){var s=typeof Symbol=="function"&&t[Symbol.iterator];if(!s)return t;var r,i,o=s.call(t),a=[];try{for(;(e===void 0||e-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(n){i={error:n}}finally{try{r&&!r.done&&(s=o.return)&&s.call(o)}finally{if(i)throw i.error}}return a}var oe;(function(t){t[t.NotStarted=0]="NotStarted",t[t.Running=1]="Running",t[t.Stopped=2]="Stopped"})(oe||(oe={}));var In={type:"xstate.init"};function Wt(t){return t===void 0?[]:[].concat(t)}function ne(t){return{type:"xstate.assign",assignment:t}}function Xr(t,e){return typeof(t=typeof t=="string"&&e&&e[t]?e[t]:t)=="string"?{type:t}:typeof t=="function"?{type:t.name,exec:t}:t}function yt(t){return function(e){return t===e}}function Pn(t){return typeof t=="string"?{type:t}:t}function Zr(t,e){return{value:t,context:e,actions:[],changed:!1,matches:yt(t)}}function Hr(t,e,s){var r=e,i=!1;return[t.filter(function(o){if(o.type==="xstate.assign"){i=!0;var a=Object.assign({},r);return typeof o.assignment=="function"?a=o.assignment(r,s):Object.keys(o.assignment).forEach(function(n){a[n]=typeof o.assignment[n]=="function"?o.assignment[n](r,s):o.assignment[n]}),r=a,!1}return!0}),r,i]}function Ln(t,e){e===void 0&&(e={});var s=Gr(Hr(Wt(t.states[t.initial].entry).map(function(a){return Xr(a,e.actions)}),t.context,In),2),r=s[0],i=s[1],o={config:t,_options:e,initialState:{value:t.initial,actions:r,context:i,matches:yt(t.initial)},transition:function(a,n){var c,l,h=typeof a=="string"?{value:a,context:t.context}:a,u=h.value,p=h.context,m=Pn(n),b=t.states[u];if(b.on){var d=Wt(b.on[m.type]);try{for(var S=function(U){var Rt=typeof Symbol=="function"&&Symbol.iterator,Zs=Rt&&U[Rt],Hs=0;if(Zs)return Zs.call(U);if(U&&typeof U.length=="number")return{next:function(){return U&&Hs>=U.length&&(U=void 0),{value:U&&U[Hs++],done:!U}}};throw new TypeError(Rt?"Object is not iterable.":"Symbol.iterator is not defined.")}(d),f=S.next();!f.done;f=S.next()){var w=f.value;if(w===void 0)return Zr(u,p);var g=typeof w=="string"?{target:w}:w,x=g.target,P=g.actions,B=P===void 0?[]:P,F=g.cond,V=F===void 0?function(){return!0}:F,ee=x===void 0,_n=x!=null?x:u,Un=t.states[_n];if(V(p,m)){var Dt=Gr(Hr((ee?Wt(B):[].concat(b.exit,B,Un.entry).filter(function(U){return U})).map(function(U){return Xr(U,o._options.actions)}),p,m),3),Gs=Dt[0],Bn=Dt[1],Wn=Dt[2],Xs=x!=null?x:u;return{value:Xs,context:Bn,actions:Gs,changed:x!==u||Gs.length>0||Wn,matches:yt(Xs)}}}}catch(U){c={error:U}}finally{try{f&&!f.done&&(l=S.return)&&l.call(S)}finally{if(c)throw c.error}}}return Zr(u,p)}};return o}var $r=function(t,e){return t.actions.forEach(function(s){var r=s.exec;return r&&r(t.context,e)})};function Fn(t){var e=t.initialState,s=oe.NotStarted,r=new Set,i={_machine:t,send:function(o){s===oe.Running&&(e=t.transition(e,o),$r(e,Pn(o)),r.forEach(function(a){return a(e)}))},subscribe:function(o){return r.add(o),o(e),{unsubscribe:function(){return r.delete(o)}}},start:function(o){if(o){var a=typeof o=="object"?o:{context:t.config.context,value:o};e={value:a.value,actions:[],context:a.context,matches:yt(a.value)}}return s=oe.Running,$r(e,In),i},stop:function(){return s=oe.Stopped,r.clear(),i},get state(){return e},get status(){return s}};return i}class Mh{constructor(e=[],s){v(this,"timeOffset",0),v(this,"speed"),v(this,"actions"),v(this,"raf",null),v(this,"lastTimestamp"),this.actions=e,this.speed=s.speed}addAction(e){const s=this.raf===!0;if(!this.actions.length||this.actions[this.actions.length-1].delay<=e.delay)this.actions.push(e);else{const r=this.findActionIndex(e);this.actions.splice(r,0,e)}s&&(this.raf=requestAnimationFrame(this.rafCheck.bind(this)))}start(){this.timeOffset=0,this.lastTimestamp=performance.now(),this.raf=requestAnimationFrame(this.rafCheck.bind(this))}rafCheck(){const e=performance.now();for(this.timeOffset+=(e-this.lastTimestamp)*this.speed,this.lastTimestamp=e;this.actions.length;){const s=this.actions[0];if(this.timeOffset>=s.delay)this.actions.shift(),s.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(e){this.speed=e}isActive(){return this.raf!==null}findActionIndex(e){let s=0,r=this.actions.length-1;for(;s<=r;){const i=Math.floor((s+r)/2);if(this.actions[i].delay<e.delay)s=i+1;else if(this.actions[i].delay>e.delay)r=i-1;else return i+1}return s}}function Jr(t,e){if(t.type===L.IncrementalSnapshot&&t.data.source===T.MouseMove&&t.data.positions&&t.data.positions.length){const s=t.data.positions[0].timeOffset,r=t.timestamp+s;return t.delay=r-e,r-e}return t.delay=t.timestamp-e,t.delay}function Nh(t,e){for(let s=t.length-1;s>=0;s--){const r=t[s];if(r.type===L.Meta&&r.timestamp<=e)return t.slice(s)}return t}function Th(t,{getCastFn:e,applyEventsSynchronously:s,emitter:r}){const i=Ln({id:"player",context:t,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:ne({lastPlayedEvent:(o,a)=>a.type==="CAST_EVENT"?a.payload.event:o.lastPlayedEvent}),recordTimeOffset:ne((o,a)=>{let n=o.timeOffset;return"payload"in a&&"timeOffset"in a.payload&&(n=a.payload.timeOffset),W(O({},o),{timeOffset:n,baselineTime:o.events[0].timestamp+n})}),play(o){const{timer:a,events:n,baselineTime:c}=o;a.clear();for(const u of n)Jr(u,c);const l=Nh(n,c);r.emit(N.PlayBack);const h=new Array;for(const u of l)if(u.timestamp<c)h.push(u);else{const p=e(u,!1);a.addAction({doAction:()=>{p()},delay:u.delay})}s(h),r.emit(N.Flush),a.start()},pause(o){o.timer.clear()},resetLastPlayedEvent:ne(o=>W(O({},o),{lastPlayedEvent:null})),startLive:ne({baselineTime:(o,a)=>(o.timer.start(),a.type==="TO_LIVE"&&a.payload.baselineTime?a.payload.baselineTime:Date.now())}),addEvent:ne((o,a)=>{const{baselineTime:n,timer:c,events:l}=o;if(a.type==="ADD_EVENT"){const{event:h}=a.payload;Jr(h,n);let u=l.length-1;if(!l[u]||l[u].timestamp<=h.timestamp)l.push(h);else{let b=-1,d=0;for(;d<=u;){const S=Math.floor((d+u)/2);l[S].timestamp<=h.timestamp?d=S+1:u=S-1}b===-1&&(b=d),l.splice(b,0,h)}const p=h.timestamp<n,m=e(h,p);p?m():c.isActive()&&c.addAction({doAction:()=>{m()},delay:h.delay})}return W(O({},o),{events:l})})}});return Fn(i)}function kh(t){const e=Ln({id:"speed",context:t,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:(s,r)=>{"payload"in r&&s.timer.setSpeed(r.payload.speed)},recordSpeed:ne({normalSpeed:s=>s.timer.speed}),restoreSpeed:s=>{s.timer.setSpeed(s.normalSpeed)}}});return Fn(e)}class Dh{constructor(e){v(this,"mediaMap",new Map),v(this,"warn"),v(this,"service"),v(this,"speedService"),v(this,"emitter"),v(this,"getCurrentTime"),v(this,"metadataCallbackMap",new Map),this.warn=e.warn,this.service=e.service,this.speedService=e.speedService,this.emitter=e.emitter,this.getCurrentTime=e.getCurrentTime,this.emitter.on(N.Start,this.start.bind(this)),this.emitter.on(N.SkipStart,this.start.bind(this)),this.emitter.on(N.Pause,this.pause.bind(this)),this.emitter.on(N.Finish,this.pause.bind(this)),this.speedService.subscribe(()=>{this.syncAllMediaElements()})}syncAllMediaElements(e={pause:!1}){this.mediaMap.forEach((s,r)=>{this.syncTargetWithState(r),e.pause&&r.pause()})}start(){this.syncAllMediaElements()}pause(){this.syncAllMediaElements({pause:!0})}seekTo({time:e,target:s,mediaState:r}){if(r.isPlaying){const i=(e-r.lastInteractionTimeOffset)/1e3*r.playbackRate,o="duration"in s&&s.duration;if(Number.isNaN(o)){this.waitForMetadata(s);return}let a=r.currentTimeAtLastInteraction+i;s.loop&&o!==!1&&(a=a%o),s.currentTime=a}else s.pause(),s.currentTime=r.currentTimeAtLastInteraction}waitForMetadata(e){if(this.metadataCallbackMap.has(e)||!("addEventListener"in e))return;const s=()=>{this.metadataCallbackMap.delete(e);const r=this.mediaMap.get(e);r&&this.seekTo({time:this.getCurrentTime(),target:e,mediaState:r})};this.metadataCallbackMap.set(e,s),e.addEventListener("loadedmetadata",s,{once:!0})}getMediaStateFromMutation({target:e,timeOffset:s,mutation:r}){var u,p,m,b,d;const i=this.mediaMap.get(e),{type:o,playbackRate:a,currentTime:n,muted:c,volume:l,loop:h}=r;return{isPlaying:o===rs.Play||o!==rs.Pause&&((i==null?void 0:i.isPlaying)||e.getAttribute("autoplay")!==null),currentTimeAtLastInteraction:(u=n!=null?n:i==null?void 0:i.currentTimeAtLastInteraction)!=null?u:0,lastInteractionTimeOffset:s,playbackRate:(p=a!=null?a:i==null?void 0:i.playbackRate)!=null?p:1,volume:(m=l!=null?l:i==null?void 0:i.volume)!=null?m:1,muted:(b=c!=null?c:i==null?void 0:i.muted)!=null?b:e.getAttribute("muted")===null,loop:(d=h!=null?h:i==null?void 0:i.loop)!=null?d:e.getAttribute("loop")===null}}syncTargetWithState(e){const s=this.mediaMap.get(e);if(!s)return;const{muted:r,loop:i,volume:o,isPlaying:a}=s,n=this.service.state.matches("paused"),c=s.playbackRate*this.speedService.state.context.timer.speed;try{this.seekTo({time:this.getCurrentTime(),target:e,mediaState:s}),e.volume!==o&&(e.volume=o),e.muted=r,e.loop=i,e.playbackRate!==c&&(e.playbackRate=c),a&&!n?e.play():e.pause()}catch(l){this.warn(`Failed to replay media interactions: ${l.message||l}`)}}addMediaElements(e,s,r){if(!["AUDIO","VIDEO"].includes(e.nodeName))return;const i=e,o=r.getMeta(i);if(!o||!("attributes"in o))return;const a=this.service.state.matches("paused"),n=o.attributes;let c=!1;n.rr_mediaState?c=n.rr_mediaState==="played":c=i.getAttribute("autoplay")!==null,c&&a&&i.pause();let l=1;typeof n.rr_mediaPlaybackRate=="number"&&(l=n.rr_mediaPlaybackRate);let h=!1;typeof n.rr_mediaMuted=="boolean"?h=n.rr_mediaMuted:h=i.getAttribute("muted")!==null;let u=!1;typeof n.rr_mediaLoop=="boolean"?u=n.rr_mediaLoop:u=i.getAttribute("loop")!==null;let p=1;typeof n.rr_mediaVolume=="number"&&(p=n.rr_mediaVolume);let m=0;typeof n.rr_mediaCurrentTime=="number"&&(m=n.rr_mediaCurrentTime),this.mediaMap.set(i,{isPlaying:c,currentTimeAtLastInteraction:m,lastInteractionTimeOffset:s,playbackRate:l,volume:p,muted:h,loop:u}),this.syncTargetWithState(i)}mediaMutation({target:e,timeOffset:s,mutation:r}){this.mediaMap.set(e,this.getMediaStateFromMutation({target:e,timeOffset:s,mutation:r})),this.syncTargetWithState(e)}isSupportedMediaElement(e){return["AUDIO","VIDEO"].includes(e.nodeName)}reset(){this.mediaMap.clear()}}function Rh(t=window,e=document){if("scrollBehavior"in e.documentElement.style&&t.__forceSmoothScrollPolyfill__!==!0)return;const s=t.HTMLElement||t.Element,r=468,i={scroll:t.scroll||t.scrollTo,scrollBy:t.scrollBy,elementScroll:s.prototype.scroll||c,scrollIntoView:s.prototype.scrollIntoView},o=t.performance&&t.performance.now?t.performance.now.bind(t.performance):Date.now;function a(f){const w=["MSIE ","Trident/","Edge/"];return new RegExp(w.join("|")).test(f)}const n=a(t.navigator.userAgent)?1:0;function c(f,w){this.scrollLeft=f,this.scrollTop=w}function l(f){return .5*(1-Math.cos(Math.PI*f))}function h(f){if(f===null||typeof f!="object"||f.behavior===void 0||f.behavior==="auto"||f.behavior==="instant")return!0;if(typeof f=="object"&&f.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+f.behavior+" is not a valid value for enumeration ScrollBehavior.")}function u(f,w){if(w==="Y")return f.clientHeight+n<f.scrollHeight;if(w==="X")return f.clientWidth+n<f.scrollWidth}function p(f,w){const g=t.getComputedStyle(f,null)["overflow"+w];return g==="auto"||g==="scroll"}function m(f){const w=u(f,"Y")&&p(f,"Y"),g=u(f,"X")&&p(f,"X");return w||g}function b(f){for(;f!==e.body&&m(f)===!1;)f=f.parentNode||f.host;return f}function d(f){const w=o();let g,x,P,B=(w-f.startTime)/r;B=B>1?1:B,g=l(B),x=f.startX+(f.x-f.startX)*g,P=f.startY+(f.y-f.startY)*g,f.method.call(f.scrollable,x,P),(x!==f.x||P!==f.y)&&t.requestAnimationFrame(d.bind(t,f))}function S(f,w,g){let x,P,B,F;const V=o();f===e.body?(x=t,P=t.scrollX||t.pageXOffset,B=t.scrollY||t.pageYOffset,F=i.scroll):(x=f,P=f.scrollLeft,B=f.scrollTop,F=c),d({scrollable:x,method:F,startTime:V,startX:P,startY:B,x:w,y:g})}t.scroll=t.scrollTo=function(){if(arguments[0]!==void 0){if(h(arguments[0])===!0){i.scroll.call(t,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:t.scrollX||t.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:t.scrollY||t.pageYOffset);return}S.call(t,e.body,arguments[0].left!==void 0?~~arguments[0].left:t.scrollX||t.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:t.scrollY||t.pageYOffset)}},t.scrollBy=function(){if(arguments[0]!==void 0){if(h(arguments[0])){i.scrollBy.call(t,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}S.call(t,e.body,~~arguments[0].left+(t.scrollX||t.pageXOffset),~~arguments[0].top+(t.scrollY||t.pageYOffset))}},s.prototype.scroll=s.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(h(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");i.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 f=arguments[0].left,w=arguments[0].top;S.call(this,this,typeof f>"u"?this.scrollLeft:~~f,typeof w>"u"?this.scrollTop:~~w)},s.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(h(arguments[0])===!0){i.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})}},s.prototype.scrollIntoView=function(){if(h(arguments[0])===!0){i.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}const f=b(this),w=f.getBoundingClientRect(),g=this.getBoundingClientRect();f!==e.body?(S.call(this,f,f.scrollLeft+g.left-w.left,f.scrollTop+g.top-w.top),t.getComputedStyle(f).position!=="fixed"&&t.scrollBy({left:w.left,top:w.top,behavior:"smooth"})):t.scrollBy({left:g.left,top:g.top,behavior:"smooth"})}}const Oh=t=>[`.${t} { background: currentColor }`,"noscript { display: none !important; }"],Ah=5*1e3,Ih=On||bh,Qr="[replayer]",jt={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function Kr(t){return t.type==L.IncrementalSnapshot&&(t.data.source==T.TouchMove||t.data.source==T.MouseInteraction&&t.data.type==_.TouchStart)}class Ph{constructor(e,s){if(v(this,"wrapper"),v(this,"iframe"),v(this,"service"),v(this,"speedService"),v(this,"config"),v(this,"usingVirtualDom",!1),v(this,"virtualDom",new de),v(this,"mouse"),v(this,"mouseTail",null),v(this,"tailPositions",[]),v(this,"emitter",Ih()),v(this,"nextUserInteractionEvent"),v(this,"legacy_missingNodeRetryMap",{}),v(this,"cache",br()),v(this,"imageMap",new Map),v(this,"canvasEventMap",new Map),v(this,"mirror",ei()),v(this,"styleMirror",new Qa),v(this,"mediaManager"),v(this,"firstFullSnapshot",null),v(this,"newDocumentQueue",[]),v(this,"mousePos",null),v(this,"touchActive",null),v(this,"lastMouseDownEvent",null),v(this,"lastHoveredRootNode"),v(this,"textValueMap",new Map),v(this,"lastSelectionData",null),v(this,"constructedStyleMutations",[]),v(this,"adoptedStyleSheets",[]),v(this,"handleResize",n=>{this.iframe.style.display="inherit";for(const c of[this.mouseTail,this.iframe])c&&(c.setAttribute("width",String(n.width)),c.setAttribute("height",String(n.height)))}),v(this,"applyEventsSynchronously",n=>{for(const c of n){switch(c.type){case L.DomContentLoaded:case L.Load:case L.Custom:continue;case L.FullSnapshot:case L.Meta:case L.Plugin:case L.IncrementalSnapshot:break}this.getCastFn(c,!0)()}}),v(this,"getCastFn",(n,c=!1)=>{let l;switch(n.type){case L.DomContentLoaded:case L.Load:break;case L.Custom:l=()=>{this.emitter.emit(N.CustomEvent,n)};break;case L.Meta:l=()=>this.emitter.emit(N.Resize,{width:n.data.width,height:n.data.height});break;case L.FullSnapshot:l=()=>{var h;if(this.firstFullSnapshot){if(this.firstFullSnapshot===n){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.mediaManager.reset(),this.styleMirror.reset(),this.rebuildFullSnapshot(n,c),(h=this.iframe.contentWindow)==null||h.scrollTo(n.data.initialOffset)};break;case L.IncrementalSnapshot:l=()=>{if(this.applyIncremental(n,c),!c&&(n===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),!this.nextUserInteractionEvent)){for(const h of this.service.state.context.events)if(!(h.timestamp<=n.timestamp)&&this.isUserInteraction(h)){h.delay-n.delay>this.config.inactivePeriodThreshold*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=h);break}if(this.nextUserInteractionEvent)if(this.config.skipInactive)this.play(this.nextUserInteractionEvent.timestamp-this.getMetaData().startTime-1e3);else{const h=this.nextUserInteractionEvent.delay-n.delay,u={speed:Math.min(Math.round(h/Ah),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:u}),this.emitter.emit(N.SkipStart,u)}}};break}return()=>{l&&l();for(const u of this.config.plugins||[])u.handler&&u.handler(n,c,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:n}});const h=this.service.state.context.events.length-1;if(!this.config.liveMode&&n===this.service.state.context.events[h]){const u=()=>{h<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(N.Finish))};let p=50;n.type===L.IncrementalSnapshot&&n.data.source===T.MouseMove&&n.data.positions.length&&(p+=Math.max(0,-n.data.positions[0].timeOffset)),setTimeout(u,p)}this.emitter.emit(N.EventCast,n)}}),!(s!=null&&s.liveMode)&&e.length<2)throw new Error("Replayer need at least 2 events.");const r={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:jt,useVirtualDom:!0,logger:console};this.config=Object.assign({},r,s),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(N.Resize,this.handleResize),this.setupDom();for(const n of this.config.plugins||[])n.getMirror&&n.getMirror({nodeMirror:this.mirror});this.emitter.on(N.Flush,()=>{if(this.usingVirtualDom){const n={mirror:this.mirror,applyCanvas:(c,l,h)=>{Yr({event:c,mutation:l,target:h,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this),applyStyleSheetMutation:(c,l)=>{c.source===T.StyleSheetRule?this.applyStyleSheetRule(c,l):c.source===T.StyleDeclaration&&this.applyStyleDeclaration(c,l)},afterAppend:(c,l)=>{for(const h of this.config.plugins||[])h.onBuild&&h.onBuild(c,{id:l,replayer:this})}};if(this.iframe.contentDocument)try{mt(this.iframe.contentDocument,this.virtualDom,n,this.virtualDom.mirror)}catch(c){console.warn(c)}if(this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(const c in this.legacy_missingNodeRetryMap)try{const l=this.legacy_missingNodeRetryMap[c],h=gt(l.node,this.mirror,this.virtualDom.mirror);mt(h,l.node,n,this.virtualDom.mirror),l.node=h}catch(l){this.warn(l)}this.constructedStyleMutations.forEach(c=>{this.applyStyleSheetMutation(c)}),this.constructedStyleMutations=[],this.adoptedStyleSheets.forEach(c=>{this.applyAdoptedStyleSheet(c)}),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[n,c]=this.lastMouseDownEvent;n.dispatchEvent(c)}this.lastMouseDownEvent=null,this.lastSelectionData&&(this.applySelection(this.lastSelectionData),this.lastSelectionData=null)}),this.emitter.on(N.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset(),this.textValueMap.clear()});const i=new Mh([],{speed:this.config.speed});this.service=Th({events:e.map(n=>s&&s.unpackFn?s.unpackFn(n):n).sort((n,c)=>n.timestamp-c.timestamp),timer:i,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(n=>{this.emitter.emit(N.StateChange,{player:n})}),this.speedService=kh({normalSpeed:-1,timer:i}),this.speedService.start(),this.speedService.subscribe(n=>{this.emitter.emit(N.StateChange,{speed:n})}),this.mediaManager=new Dh({warn:this.warn.bind(this),service:this.service,speedService:this.speedService,emitter:this.emitter,getCurrentTime:this.getCurrentTime.bind(this)});const o=this.service.state.context.events.find(n=>n.type===L.Meta),a=this.service.state.context.events.find(n=>n.type===L.FullSnapshot);if(o){const{width:n,height:c}=o.data;setTimeout(()=>{this.emitter.emit(N.Resize,{width:n,height:c})},0)}a&&setTimeout(()=>{var n;this.firstFullSnapshot||(this.firstFullSnapshot=a,this.rebuildFullSnapshot(a),(n=this.iframe.contentWindow)==null||n.scrollTo(a.data.initialOffset))},1),this.service.state.context.events.find(Kr)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(e,s){return this.emitter.on(e,s),this}off(e,s){return this.emitter.off(e,s),this}setConfig(e){Object.keys(e).forEach(s=>{e[s],this.config[s]=e[s]}),this.config.skipInactive||this.backToNormal(),typeof e.speed<"u"&&this.speedService.send({type:"SET_SPEED",payload:{speed:e.speed}}),typeof e.mouseTail<"u"&&(e.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 e=this.service.state.context.events[0],s=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:e.timestamp,endTime:s.timestamp,totalTime:s.timestamp-e.timestamp}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){const{baselineTime:e,events:s}=this.service.state.context;return e-s[0].timestamp}getMirror(){return this.mirror}play(e=0){var s,r;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:e}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:e}})),(r=(s=this.iframe.contentDocument)==null?void 0:s.getElementsByTagName("html")[0])==null||r.classList.remove("@sailfish-rrweb/rrweb-paused"),this.emitter.emit(N.Start)}pause(e){var s,r;e===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof e=="number"&&(this.play(e),this.service.send({type:"PAUSE"})),(r=(s=this.iframe.contentDocument)==null?void 0:s.getElementsByTagName("html")[0])==null||r.classList.add("@sailfish-rrweb/rrweb-paused"),this.emitter.emit(N.Pause)}resume(e=0){this.warn("The 'resume' was deprecated in 1.0. Please use 'play' method which has the same interface."),this.play(e),this.emitter.emit(N.Resume)}destroy(){this.pause(),this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset(),this.textValueMap.clear(),this.config.root.removeChild(this.wrapper),this.emitter.emit(N.Destroy)}startLive(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})}addEvent(e){const s=this.config.unpackFn?this.config.unpackFn(e):e;Kr(s)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:s}}))}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=br()}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.iframe=document.createElement("iframe");const e=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&e.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",e.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(Rh(this.iframe.contentWindow,this.iframe.contentDocument),Ha(this.iframe.contentWindow))}rebuildFullSnapshot(e,s=!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 r=[],i=(n,c)=>{if(this.collectIframeAndAttachDocument(r,n),this.mediaManager.isSupportedMediaElement(n)){const{events:l}=this.service.state.context;this.mediaManager.addMediaElements(n,e.timestamp-l[0].timestamp,this.mirror)}for(const l of this.config.plugins||[])l.onBuild&&l.onBuild(n,{id:c,replayer:this})};this.usingVirtualDom&&(this.virtualDom.destroyTree(),this.usingVirtualDom=!1),this.mirror.reset(),this.textValueMap.clear(),Za(e.data.node,{doc:this.iframe.contentDocument,afterAppend:i,cache:this.cache,mirror:this.mirror}),i(this.iframe.contentDocument,e.data.node.id);for(const{mutationInQueue:n,builtNode:c}of r)this.attachDocumentToIframe(n,c),this.newDocumentQueue=this.newDocumentQueue.filter(l=>l!==n);const{documentElement:o,head:a}=this.iframe.contentDocument;this.insertStyleRules(o,a),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("@sailfish-rrweb/rrweb-paused"),this.emitter.emit(N.FullsnapshotRebuilded,e),s||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(e,s){var r;const i=Oh(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&i.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),this.usingVirtualDom){const o=this.virtualDom.createElement("style");this.virtualDom.mirror.add(o,Rn(o,this.virtualDom.unserializedId)),e.insertBefore(o,s),o.rules.push({source:T.StyleSheetRule,adds:i.map((a,n)=>({rule:a,index:n}))})}else{const o=document.createElement("style");e.insertBefore(o,s);for(let a=0;a<i.length;a++)(r=o.sheet)==null||r.insertRule(i[a],a)}}attachDocumentToIframe(e,s){const r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,i=[],o=(a,n)=>{this.collectIframeAndAttachDocument(i,a);const c=r.getMeta(a);if((c==null?void 0:c.type)===R.Element&&(c==null?void 0:c.tagName.toUpperCase())==="HTML"){const{documentElement:l,head:h}=s.contentDocument;this.insertStyleRules(l,h)}if(!this.usingVirtualDom)for(const l of this.config.plugins||[])l.onBuild&&l.onBuild(a,{id:n,replayer:this})};Ee(e.node,{doc:s.contentDocument,mirror:r,hackCss:!0,skipChild:!1,afterAppend:o,cache:this.cache}),o(s.contentDocument,e.node.id);for(const{mutationInQueue:a,builtNode:n}of i)this.attachDocumentToIframe(a,n),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==a)}collectIframeAndAttachDocument(e,s){if(Lt(s,this.mirror)){const r=this.newDocumentQueue.find(i=>i.parentId===this.mirror.getId(s));r&&e.push({mutationInQueue:r,builtNode:s})}}waitForStylesheetLoad(){var e;const s=(e=this.iframe.contentDocument)==null?void 0:e.head;if(s){const r=new Set;let i,o=this.service.state;const a=()=>{o=this.service.state};this.emitter.on(N.Start,a),this.emitter.on(N.Pause,a);const n=()=>{this.emitter.off(N.Start,a),this.emitter.off(N.Pause,a)};s.querySelectorAll('link[rel="stylesheet"]').forEach(c=>{c.sheet||(r.add(c),c.addEventListener("load",()=>{r.delete(c),r.size===0&&i!==-1&&(o.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(N.LoadStylesheetEnd),i&&clearTimeout(i),n())}))}),r.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(N.LoadStylesheetStart),i=setTimeout(()=>{o.matches("playing")&&this.play(this.getCurrentTime()),i=-1,n()},this.config.loadTimeout))}}async preloadAllImages(){const e=[];for(const s of this.service.state.context.events)s.type===L.IncrementalSnapshot&&s.data.source===T.CanvasMutation&&(e.push(this.deserializeAndPreloadCanvasEvents(s.data,s)),("commands"in s.data?s.data.commands:[s.data]).forEach(r=>{this.preloadImages(r,s)}));return Promise.all(e)}preloadImages(e,s){if(e.property==="drawImage"&&typeof e.args[0]=="string"&&!this.imageMap.has(s)){const r=document.createElement("canvas"),i=r.getContext("2d"),o=i==null?void 0:i.createImageData(r.width,r.height);i==null||i.putImageData(o,0,0)}}async deserializeAndPreloadCanvasEvents(e,s){if(!this.canvasEventMap.has(s)){const r={isUnchanged:!0};if("commands"in e){const i=await Promise.all(e.commands.map(async o=>{const a=await Promise.all(o.args.map(K(this.imageMap,null,r)));return W(O({},o),{args:a})}));r.isUnchanged===!1&&this.canvasEventMap.set(s,W(O({},e),{commands:i}))}else{const i=await Promise.all(e.args.map(K(this.imageMap,null,r)));r.isUnchanged===!1&&this.canvasEventMap.set(s,W(O({},e),{args:i}))}}}applyIncremental(e,s){var r,i,o;const{data:a}=e;switch(a.source){case T.Mutation:{try{this.applyMutation(a,s)}catch(n){this.warn(`Exception in mutation ${n.message||n}`,a)}break}case T.Drag:case T.TouchMove:case T.MouseMove:if(s){const n=a.positions[a.positions.length-1];this.mousePos={x:n.x,y:n.y,id:n.id,debugData:a}}else a.positions.forEach(n=>{const c={doAction:()=>{this.moveAndHover(n.x,n.y,n.id,s,a)},delay:n.timeOffset+e.timestamp-this.service.state.context.baselineTime};this.timer.addAction(c)}),this.timer.addAction({doAction(){},delay:e.delay-((r=a.positions[0])==null?void 0:r.timeOffset)});break;case T.MouseInteraction:{if(a.id===-1)break;const n=new Event($n(_[a.type])),c=this.mirror.getNode(a.id);if(!c)return this.debugNodeNotFound(a,a.id);this.emitter.emit(N.MouseInteraction,{type:a.type,target:c});const{triggerFocus:l}=this.config;switch(a.type){case _.Blur:"blur"in c&&c.blur();break;case _.Focus:l&&c.focus&&c.focus({preventScroll:!0});break;case _.Click:case _.TouchStart:case _.TouchEnd:case _.MouseDown:case _.MouseUp:s?(a.type===_.TouchStart?this.touchActive=!0:a.type===_.TouchEnd&&(this.touchActive=!1),a.type===_.MouseDown?this.lastMouseDownEvent=[c,n]:a.type===_.MouseUp&&(this.lastMouseDownEvent=null),this.mousePos={x:a.x||0,y:a.y||0,id:a.id,debugData:a}):(a.type===_.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(a.x||0,a.y||0,a.id,s,a),a.type===_.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):a.type===_.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):a.type===_.TouchEnd?this.mouse.classList.remove("touch-active"):c.dispatchEvent(n));break;case _.TouchCancel:s?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:c.dispatchEvent(n)}break}case T.Scroll:{if(a.id===-1)break;if(this.usingVirtualDom){const n=this.virtualDom.mirror.getNode(a.id);if(!n)return this.debugNodeNotFound(a,a.id);n.scrollData=a;break}this.applyScroll(a,s);break}case T.ViewportResize:this.emitter.emit(N.Resize,{width:a.width,height:a.height});break;case T.Input:{if(a.id===-1)break;if(this.usingVirtualDom){const n=this.virtualDom.mirror.getNode(a.id);if(!n)return this.debugNodeNotFound(a,a.id);n.inputData=a;break}this.applyInput(a);break}case T.MediaInteraction:{const n=this.usingVirtualDom?this.virtualDom.mirror.getNode(a.id):this.mirror.getNode(a.id);if(!n)return this.debugNodeNotFound(a,a.id);const c=n,{events:l}=this.service.state.context;this.mediaManager.mediaMutation({target:c,timeOffset:e.timestamp-l[0].timestamp,mutation:a});break}case T.StyleSheetRule:case T.StyleDeclaration:{this.usingVirtualDom?a.styleId?this.constructedStyleMutations.push(a):a.id&&((i=this.virtualDom.mirror.getNode(a.id))==null||i.rules.push(a)):this.applyStyleSheetMutation(a);break}case T.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){const n=this.virtualDom.mirror.getNode(a.id);if(!n)return this.debugNodeNotFound(a,a.id);n.canvasMutations.push({event:e,mutation:a})}else{const n=this.mirror.getNode(a.id);if(!n)return this.debugNodeNotFound(a,a.id);Yr({event:e,mutation:a,target:n,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case T.Font:{try{const n=new FontFace(a.family,a.buffer?new Uint8Array(JSON.parse(a.fontSource)):a.fontSource,a.descriptors);(o=this.iframe.contentDocument)==null||o.fonts.add(n)}catch(n){this.warn(n)}break}case T.Selection:{if(s){this.lastSelectionData=a;break}this.applySelection(a);break}case T.AdoptedStyleSheet:{this.usingVirtualDom?this.adoptedStyleSheets.push(a):this.applyAdoptedStyleSheet(a);break}}}applyMutation(e,s){if(this.config.useVirtualDom&&!this.usingVirtualDom&&s&&(this.usingVirtualDom=!0,gh(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(const l in this.legacy_missingNodeRetryMap)try{const h=this.legacy_missingNodeRetryMap[l],u=Dn(h.node,this.virtualDom,this.mirror);u&&(h.node=u)}catch(h){this.warn(h)}const r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;e.removes=e.removes.filter(l=>r.getNode(l.id)?!0:(this.warnNodeNotFound(e,l.id),!1)),e.removes.forEach(l=>{var h;const u=r.getNode(l.id);if(!u)return;let p=r.getNode(l.parentId);if(!p)return this.warnNodeNotFound(e,l.parentId);if(l.isShadow&&Xe(p)&&(p=p.shadowRoot),r.removeNodeFromMap(u),p)try{p.removeChild(u),this.usingVirtualDom&&u.nodeName==="#text"&&p.nodeName==="STYLE"&&((h=p.rules)==null?void 0:h.length)>0&&(p.rules=[])}catch(m){if(m instanceof DOMException)this.warn("parent could not remove child in mutation",p,u,e);else throw m}});const i=O({},this.legacy_missingNodeRetryMap),o=[],a=l=>{let h=null;return l.nextId&&(h=r.getNode(l.nextId)),l.nextId!==null&&l.nextId!==void 0&&l.nextId!==-1&&!h},n=l=>{var h,u;if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");let p=r.getNode(l.parentId);if(!p)return l.node.type===R.Document?this.newDocumentQueue.push(l):o.push(l);l.node.isShadow&&(Xe(p)||p.attachShadow({mode:"open"}),p=p.shadowRoot);let m=null,b=null;if(l.previousId&&(m=r.getNode(l.previousId)),l.nextId&&(b=r.getNode(l.nextId)),a(l))return o.push(l);if(l.node.rootId&&!r.getNode(l.node.rootId))return;const d=l.node.rootId?r.getNode(l.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(Lt(p,r)){this.attachDocumentToIframe(l,p);return}const S=(g,x)=>{if(!this.usingVirtualDom)for(const P of this.config.plugins||[])P.onBuild&&P.onBuild(g,{id:x,replayer:this})},f=Ee(l.node,{doc:d,mirror:r,skipChild:!0,hackCss:!0,cache:this.cache,afterAppend:S});if(l.previousId===-1||l.nextId===-1){i[l.node.id]={node:f,mutation:l};return}const w=r.getMeta(p);if(w&&w.type===R.Element&&l.node.type===R.Text){const g=Array.isArray(p.childNodes)?p.childNodes:Array.from(p.childNodes);if(w.tagName==="textarea")for(const x of g)x.nodeType===p.TEXT_NODE&&p.removeChild(x);else if(w.tagName==="style"&&g.length===1)for(const x of g)x.nodeType===p.TEXT_NODE&&!r.hasNode(x)&&(f.textContent=x.textContent,p.removeChild(x))}else if((w==null?void 0:w.type)===R.Document){const g=p;l.node.type===R.DocumentType&&((h=g.childNodes[0])==null?void 0:h.nodeType)===Node.DOCUMENT_TYPE_NODE&&g.removeChild(g.childNodes[0]),f.nodeName==="HTML"&&g.documentElement&&g.removeChild(g.documentElement)}if(m&&m.nextSibling&&m.nextSibling.parentNode?p.insertBefore(f,m.nextSibling):b&&b.parentNode?p.contains(b)?p.insertBefore(f,b):p.insertBefore(f,null):p.appendChild(f),S(f,l.node.id),this.usingVirtualDom&&f.nodeName==="#text"&&p.nodeName==="STYLE"&&((u=p.rules)==null?void 0:u.length)>0&&(p.rules=[]),Lt(f,this.mirror)){const g=this.mirror.getId(f),x=this.newDocumentQueue.find(P=>P.parentId===g);x&&(this.attachDocumentToIframe(x,f),this.newDocumentQueue=this.newDocumentQueue.filter(P=>P!==x))}(l.previousId||l.nextId)&&this.legacy_resolveMissingNode(i,p,f,l)};e.adds.forEach(l=>{n(l)});const c=Date.now();for(;o.length;){const l=$a(o);if(o.length=0,Date.now()-c>500){this.warn("Timeout in the loop, please check the resolve tree data:",l);break}for(const h of l)r.getNode(h.value.parentId)?_i(h,u=>{n(u)}):this.debug("Drop resolve tree since there is no parent for the root node.",h)}Object.keys(i).length&&Object.assign(this.legacy_missingNodeRetryMap,i),Ja(e.texts).forEach(l=>{var m;var h;const u=r.getNode(l.id);if(!u)return e.removes.find(b=>b.id===l.id)?void 0:this.warnNodeNotFound(e,l.id);let p;if(l.delta){const b=this.textValueMap.get(l.id)||"";p=Ka(b,l.delta)}else p=(m=l.value)!=null?m:null;if(u.textContent=p,p!==null&&this.textValueMap.set(l.id,p),this.usingVirtualDom){const b=u.parentNode;((h=b==null?void 0:b.rules)==null?void 0:h.length)>0&&(b.rules=[])}}),e.attributes.forEach(l=>{var h;const u=r.getNode(l.id);if(!u)return e.removes.find(p=>p.id===l.id)?void 0:this.warnNodeNotFound(e,l.id);for(const p in l.attributes)if(typeof p=="string"){const m=l.attributes[p];if(m===null)u.removeAttribute(p);else if(typeof m=="string")try{if(p==="_cssText"&&(u.nodeName==="LINK"||u.nodeName==="STYLE"))try{const b=r.getMeta(u);Object.assign(b.attributes,l.attributes);const d=Ee(b,{doc:u.ownerDocument,mirror:r,skipChild:!0,hackCss:!0,cache:this.cache}),S=u.nextSibling,f=u.parentNode;if(d&&f){f.removeChild(u),f.insertBefore(d,S),r.replace(l.id,d);break}}catch(b){}if(p==="value"&&u.nodeName==="TEXTAREA"){const b=u;b.childNodes.forEach(S=>b.removeChild(S));const d=(h=u.ownerDocument)==null?void 0:h.createTextNode(m);d&&b.appendChild(d)}else u.setAttribute(p,m)}catch(b){this.warn("An error occurred may due to the checkout feature.",b)}else if(p==="style"){const b=m,d=u;for(const S in b)if(b[S]===!1)d.style.removeProperty(S);else if(b[S]instanceof Array){const f=b[S];d.style.setProperty(S,f[0],f[1])}else{const f=b[S];d.style.setProperty(S,f)}}}})}applyScroll(e,s){var r,i;const o=this.mirror.getNode(e.id);if(!o)return this.debugNodeNotFound(e,e.id);const a=this.mirror.getMeta(o);if(o===this.iframe.contentDocument)(r=this.iframe.contentWindow)==null||r.scrollTo({top:e.y,left:e.x,behavior:s?"auto":"smooth"});else if((a==null?void 0:a.type)===R.Document)(i=o.defaultView)==null||i.scrollTo({top:e.y,left:e.x,behavior:s?"auto":"smooth"});else try{o.scrollTo({top:e.y,left:e.x,behavior:s?"auto":"smooth"})}catch(n){}}applyInput(e){const s=this.mirror.getNode(e.id);if(!s)return this.debugNodeNotFound(e,e.id);try{s.checked=e.isChecked,s.value=e.text}catch(r){}}applySelection(e){try{const s=new Set,r=e.ranges.map(({start:i,startOffset:o,end:a,endOffset:n})=>{const c=this.mirror.getNode(i),l=this.mirror.getNode(a);if(!c||!l)return;const h=new Range;h.setStart(c,o),h.setEnd(l,n);const u=c.ownerDocument,p=u==null?void 0:u.getSelection();return p&&s.add(p),{range:h,selection:p}});s.forEach(i=>i.removeAllRanges()),r.forEach(i=>{var o;return i&&((o=i.selection)==null?void 0:o.addRange(i.range))})}catch(s){}}applyStyleSheetMutation(e){var s;let r=null;e.styleId?r=this.styleMirror.getStyle(e.styleId):e.id&&(r=((s=this.mirror.getNode(e.id))==null?void 0:s.sheet)||null),r&&(e.source===T.StyleSheetRule?this.applyStyleSheetRule(e,r):e.source===T.StyleDeclaration&&this.applyStyleDeclaration(e,r))}applyStyleSheetRule(e,s){var r,i,o,a;if((r=e.adds)==null||r.forEach(({rule:n,index:c})=>{try{if(Array.isArray(c)){const{positions:l,index:h}=Sr(c);xe(s.cssRules,l).insertRule(n,h)}else{const l=c===void 0?void 0:Math.min(c,s.cssRules.length);s==null||s.insertRule(n,l)}}catch(l){}}),(i=e.removes)==null||i.forEach(({index:n})=>{try{if(Array.isArray(n)){const{positions:c,index:l}=Sr(n);xe(s.cssRules,c).deleteRule(l||0)}else s==null||s.deleteRule(n)}catch(c){}}),e.replace)try{(o=s.replace)==null||o.call(s,e.replace)}catch(n){}if(e.replaceSync)try{(a=s.replaceSync)==null||a.call(s,e.replaceSync)}catch(n){}}applyStyleDeclaration(e,s){e.set&&xe(s.rules,e.index).style.setProperty(e.set.property,e.set.value,e.set.priority),e.remove&&xe(s.rules,e.index).style.removeProperty(e.remove.property)}applyAdoptedStyleSheet(e){var s;const r=this.mirror.getNode(e.id);if(!r)return;(s=e.styles)==null||s.forEach(n=>{var c;let l=null,h=null;if(Xe(r)?h=((c=r.ownerDocument)==null?void 0:c.defaultView)||null:r.nodeName==="#document"&&(h=r.defaultView),!!h)try{l=new h.CSSStyleSheet,this.styleMirror.add(l,n.styleId),this.applyStyleSheetRule({source:T.StyleSheetRule,adds:n.rules},l)}catch(u){}});const i=10;let o=0;const a=(n,c)=>{const l=c.map(h=>this.styleMirror.getStyle(h)).filter(h=>h!==null);Xe(n)?n.shadowRoot.adoptedStyleSheets=l:n.nodeName==="#document"&&(n.adoptedStyleSheets=l),l.length!==c.length&&o<i&&(setTimeout(()=>a(n,c),0+100*o),o++)};a(r,e.styleIds)}legacy_resolveMissingNode(e,s,r,i){const{previousId:o,nextId:a}=i,n=o&&e[o],c=a&&e[a];if(n){const{node:l,mutation:h}=n;s.insertBefore(l,r),delete e[h.node.id],delete this.legacy_missingNodeRetryMap[h.node.id],(h.previousId||h.nextId)&&this.legacy_resolveMissingNode(e,s,l,h)}if(c){const{node:l,mutation:h}=c;s.insertBefore(l,r.nextSibling),delete e[h.node.id],delete this.legacy_missingNodeRetryMap[h.node.id],(h.previousId||h.nextId)&&this.legacy_resolveMissingNode(e,s,l,h)}}moveAndHover(e,s,r,i,o){const a=this.mirror.getNode(r);if(!a)return this.debugNodeNotFound(o,r);const n=Ui(a,this.iframe),c=e*n.absoluteScale+n.x,l=s*n.absoluteScale+n.y;this.mouse.style.left=`${c}px`,this.mouse.style.top=`${l}px`,i||this.drawMouseTail({x:c,y:l}),this.hoverElements(a)}drawMouseTail(e){if(!this.mouseTail)return;const{lineCap:s,lineWidth:r,strokeStyle:i,duration:o}=this.config.mouseTail===!0?jt:Object.assign({},jt,this.config.mouseTail),a=()=>{if(!this.mouseTail)return;const n=this.mouseTail.getContext("2d");!n||!this.tailPositions.length||(n.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),n.beginPath(),n.lineWidth=r,n.lineCap=s,n.strokeStyle=i,n.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(c=>n.lineTo(c.x,c.y)),n.stroke())};this.tailPositions.push(e),a(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(n=>n!==e),a()},o/this.speedService.state.context.timer.speed)}hoverElements(e){var s;(s=this.lastHoveredRootNode||this.iframe.contentDocument)==null||s.querySelectorAll(".\\:hover").forEach(i=>{i.classList.remove(":hover")}),this.lastHoveredRootNode=e.getRootNode();let r=e;for(;r;)r.classList&&r.classList.add(":hover"),r=r.parentElement}isUserInteraction(e){return e.type!==L.IncrementalSnapshot?!1:e.data.source>T.Mutation&&e.data.source<=T.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(N.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(e,s){this.warn(`Node with id '${s}' not found. `,e)}warnCanvasMutationFailed(e,s){this.warn("Has error on canvas update",s,"canvas mutation:",e)}debugNodeNotFound(e,s){this.debug(`Node with id '${s}' not found. `,e)}warn(...e){this.config.showWarning&&this.config.logger.warn(Qr,...e)}debug(...e){this.config.showDebug&&this.config.logger.log(Qr,...e)}}exports.Replayer=Ph;
73
73
  ;if (typeof module.exports == "object" && typeof exports == "object") {
74
74
  var __cp = (to, from, except, desc) => {
75
75
  if ((from && typeof from === "object") || typeof from === "function") {