@h-ai/feedback 0.1.0-alpha.69 → 0.1.0-alpha.71

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.
@@ -21,9 +21,10 @@ try {
21
21
  text('p',report.description||m.empty,section(m.user));
22
22
  const attachments=section(m.attachments);
23
23
  for(const file of manifest.files.filter(item=>item.kind==='attachment')){
24
- if(!/^attachments\\/[\\w-]+\\.(png|jpg|webp|txt|json|bin)$/.test(file.path))continue;
24
+ if(!/^attachments\\/[\\w-]+\\.(png|jpg|webp|webm|mp4|txt|json|bin)$/.test(file.path))continue;
25
25
  const figure=document.createElement('figure');attachments.append(figure);text('figcaption',file.name||file.attachmentId,figure);
26
26
  if(safeImage(file)){const image=document.createElement('img');image.src='../'+file.path;image.alt=file.name||'';image.loading='lazy';figure.append(image);}
27
+ if(['video/webm','video/mp4'].includes(file.contentType)){const video=document.createElement('video');video.src='../'+file.path;video.controls=true;video.preload='metadata';video.style.maxWidth='100%';figure.append(video);}
27
28
  const link=text('a',m.download,figure);link.href='../'+file.path;link.download=file.name||file.path.split('/').pop();
28
29
  }
29
30
  const replayEvents=evidence.filter(item=>item.kind==='replay'&&item.data&&item.data.event).map(item=>item.data.event).sort((a,b)=>a.timestamp-b.timestamp);
@@ -69,7 +70,7 @@ try {
69
70
  `;
70
71
  function feedbackViewerFiles() {
71
72
  return {
72
- "viewer/index.html": strToU8(`<!doctype html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta http-equiv="Content-Security-Policy" content="default-src 'none'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' blob: data:; connect-src 'self'; frame-src 'self' about: blob:; font-src 'self' data:; base-uri 'none'; form-action 'none'"><title>Feedback</title><link rel="stylesheet" href="style.css"></head><body><header></header><main></main><script type="module" src="app.js"></script></body></html>`),
73
+ "viewer/index.html": strToU8(`<!doctype html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta http-equiv="Content-Security-Policy" content="default-src 'none'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' blob: data:; media-src 'self' blob:; connect-src 'self'; frame-src 'self' about: blob:; font-src 'self' data:; base-uri 'none'; form-action 'none'"><title>Feedback</title><link rel="stylesheet" href="style.css"></head><body><header></header><main></main><script type="module" src="app.js"></script></body></html>`),
73
74
  "viewer/style.css": strToU8("body{font:15px system-ui,sans-serif;line-height:1.6;margin:0;background:#f5f6f8;color:#172033}header,main{max-width:1080px;margin:auto;padding:24px}section{background:white;padding:24px;margin-bottom:20px;border:1px solid #dce1e8;border-radius:12px}h1{font-size:26px}h2{font-size:19px;margin-top:0}pre{white-space:pre-wrap;overflow-wrap:anywhere;font:13px/1.6 ui-monospace,monospace}img{max-width:100%;height:auto;border:1px solid #dce1e8}figure{margin:16px 0}input,select,button{font:inherit;padding:8px;margin:4px;border:1px solid #ccd2dc;border-radius:6px}button{cursor:pointer}a{display:block;color:#215dc0}"),
74
75
  "viewer/app.js": strToU8(VIEWER_SCRIPT),
75
76
  "viewer/replay.js": strToU8('(()=>{var Ys=Object.defineProperty,Hs=(e,t,r)=>t in e?Ys(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,T=(e,t,r)=>Hs(e,typeof t!="symbol"?t+"":t,r),zr,Js=Object.defineProperty,Qs=(e,t,r)=>t in e?Js(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Wr=(e,t,r)=>Qs(e,typeof t!="symbol"?t+"":t,r),z=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(z||{});Date.now().toString();function Xs(e){return e.nodeType===e.ELEMENT_NODE}var _e=class{constructor(){Wr(this,"idNodeMap",new Map),Wr(this,"nodeMetaMap",new WeakMap)}getId(t){var r;return t?((r=this.getMeta(t))==null?void 0:r.id)??-1:-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){let r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(o=>this.removeNodeFromMap(o))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){let o=r.id;this.idNodeMap.set(o,t),this.nodeMetaMap.set(t,r)}replace(t,r){let o=this.getNode(t);if(o){let s=this.nodeMetaMap.get(o);s&&this.nodeMetaMap.set(r,s)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function ds(){return new _e}function Zs(e){return e.toLowerCase()}function Ks(e,t){return!e||!t||e.type!==t.type?!1:e.type===z.Document?e.compatMode===t.compatMode:e.type===z.DocumentType?e.name===t.name&&e.publicId===t.publicId&&e.systemId===t.systemId:e.type===z.Comment||e.type===z.Text||e.type===z.CDATA?e.textContent===t.textContent:e.type===z.Element?e.tagName===t.tagName&&JSON.stringify(e.attributes)===JSON.stringify(t.attributes)&&e.isSVG===t.isSVG&&e.needBlock===t.needBlock:!1}function en(e,t){let r;try{r=new URL(e,t??window.location.href)}catch{return null}let o=/\\.([0-9a-z]+)(?:$)/i,s=r.pathname.match(o);return s?.[1]??null}var tn=/(max|min)-device-(width|height)/,qr=new RegExp(tn.source,"g"),rn={postcssPlugin:"postcss-custom-selectors",prepare(){return{postcssPlugin:"postcss-custom-selectors",AtRule:function(e){e.params.match(qr)&&(e.params=e.params.replace(qr,"$1-$2"))}}}},sn={postcssPlugin:"postcss-hover-classes",prepare:function(){let e=[];return{Rule:function(t){e.indexOf(t)===-1&&(e.push(t),t.selectors.forEach(function(r){r.includes(":hover")&&(t.selector+=`,\n`+r.replace(/:hover/g,".\\\\:hover"))}))}}}};function nn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function on(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function o(){return this instanceof o?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(o){var s=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(r,o,s.get?s:{enumerable:!0,get:function(){return e[o]}})}),r}var Re={exports:{}},jr;function an(){if(jr)return Re.exports;jr=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return Re.exports=t(),Re.exports.createColors=t,Re.exports}var ln={},un=Object.freeze(Object.defineProperty({__proto__:null,default:ln},Symbol.toStringTag,{value:"Module"})),J=on(un),it,Vr;function Er(){if(Vr)return it;Vr=1;let e=an(),t=J;class r extends Error{constructor(s,u,n,a,h,c){super(s),this.name="CssSyntaxError",this.reason=s,h&&(this.file=h),a&&(this.source=a),c&&(this.plugin=c),typeof u<"u"&&typeof n<"u"&&(typeof u=="number"?(this.line=u,this.column=n):(this.line=u.line,this.column=u.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,r)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(s){if(!this.source)return"";let u=this.source;s==null&&(s=e.isColorSupported),t&&s&&(u=t(u));let n=u.split(/\\r?\\n/),a=Math.max(this.line-3,0),h=Math.min(this.line+2,n.length),c=String(h).length,i,p;if(s){let{bold:l,gray:f,red:m}=e.createColors(!0);i=d=>l(m(d)),p=d=>f(d)}else i=p=l=>l;return n.slice(a,h).map((l,f)=>{let m=a+1+f,d=" "+(" "+m).slice(-c)+" | ";if(m===this.line){let g=p(d.replace(/\\d/g," "))+l.slice(0,this.column-1).replace(/[^\\t]/g," ");return i(">")+p(d)+l+`\n `+g+i("^")}return" "+p(d)+l}).join(`\n`)}toString(){let s=this.showSourceCode();return s&&(s=`\n\n`+s+`\n`),this.name+": "+this.message+s}}return it=r,r.default=r,it}var Ne={},Gr;function Rr(){return Gr||(Gr=1,Ne.isClean=Symbol("isClean"),Ne.my=Symbol("my")),Ne}var st,Yr;function ms(){if(Yr)return st;Yr=1;let e={after:`\n`,beforeClose:`\n`,beforeComment:`\n`,beforeDecl:`\n`,beforeOpen:" ",beforeRule:`\n`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function t(o){return o[0].toUpperCase()+o.slice(1)}class r{constructor(s){this.builder=s}atrule(s,u){let n="@"+s.name,a=s.params?this.rawValue(s,"params"):"";if(typeof s.raws.afterName<"u"?n+=s.raws.afterName:a&&(n+=" "),s.nodes)this.block(s,n+a);else{let h=(s.raws.between||"")+(u?";":"");this.builder(n+a+h,s)}}beforeAfter(s,u){let n;s.type==="decl"?n=this.raw(s,null,"beforeDecl"):s.type==="comment"?n=this.raw(s,null,"beforeComment"):u==="before"?n=this.raw(s,null,"beforeRule"):n=this.raw(s,null,"beforeClose");let a=s.parent,h=0;for(;a&&a.type!=="root";)h+=1,a=a.parent;if(n.includes(`\n`)){let c=this.raw(s,null,"indent");if(c.length)for(let i=0;i<h;i++)n+=c}return n}block(s,u){let n=this.raw(s,"between","beforeOpen");this.builder(u+n+"{",s,"start");let a;s.nodes&&s.nodes.length?(this.body(s),a=this.raw(s,"after")):a=this.raw(s,"after","emptyBody"),a&&this.builder(a),this.builder("}",s,"end")}body(s){let u=s.nodes.length-1;for(;u>0&&s.nodes[u].type==="comment";)u-=1;let n=this.raw(s,"semicolon");for(let a=0;a<s.nodes.length;a++){let h=s.nodes[a],c=this.raw(h,"before");c&&this.builder(c),this.stringify(h,u!==a||n)}}comment(s){let u=this.raw(s,"left","commentLeft"),n=this.raw(s,"right","commentRight");this.builder("/*"+u+s.text+n+"*/",s)}decl(s,u){let n=this.raw(s,"between","colon"),a=s.prop+n+this.rawValue(s,"value");s.important&&(a+=s.raws.important||" !important"),u&&(a+=";"),this.builder(a,s)}document(s){this.body(s)}raw(s,u,n){let a;if(n||(n=u),u&&(a=s.raws[u],typeof a<"u"))return a;let h=s.parent;if(n==="before"&&(!h||h.type==="root"&&h.first===s||h&&h.type==="document"))return"";if(!h)return e[n];let c=s.root();if(c.rawCache||(c.rawCache={}),typeof c.rawCache[n]<"u")return c.rawCache[n];if(n==="before"||n==="after")return this.beforeAfter(s,n);{let i="raw"+t(n);this[i]?a=this[i](c,s):c.walk(p=>{if(a=p.raws[u],typeof a<"u")return!1})}return typeof a>"u"&&(a=e[n]),c.rawCache[n]=a,a}rawBeforeClose(s){let u;return s.walk(n=>{if(n.nodes&&n.nodes.length>0&&typeof n.raws.after<"u")return u=n.raws.after,u.includes(`\n`)&&(u=u.replace(/[^\\n]+$/,"")),!1}),u&&(u=u.replace(/\\S/g,"")),u}rawBeforeComment(s,u){let n;return s.walkComments(a=>{if(typeof a.raws.before<"u")return n=a.raws.before,n.includes(`\n`)&&(n=n.replace(/[^\\n]+$/,"")),!1}),typeof n>"u"?n=this.raw(u,null,"beforeDecl"):n&&(n=n.replace(/\\S/g,"")),n}rawBeforeDecl(s,u){let n;return s.walkDecls(a=>{if(typeof a.raws.before<"u")return n=a.raws.before,n.includes(`\n`)&&(n=n.replace(/[^\\n]+$/,"")),!1}),typeof n>"u"?n=this.raw(u,null,"beforeRule"):n&&(n=n.replace(/\\S/g,"")),n}rawBeforeOpen(s){let u;return s.walk(n=>{if(n.type!=="decl"&&(u=n.raws.between,typeof u<"u"))return!1}),u}rawBeforeRule(s){let u;return s.walk(n=>{if(n.nodes&&(n.parent!==s||s.first!==n)&&typeof n.raws.before<"u")return u=n.raws.before,u.includes(`\n`)&&(u=u.replace(/[^\\n]+$/,"")),!1}),u&&(u=u.replace(/\\S/g,"")),u}rawColon(s){let u;return s.walkDecls(n=>{if(typeof n.raws.between<"u")return u=n.raws.between.replace(/[^\\s:]/g,""),!1}),u}rawEmptyBody(s){let u;return s.walk(n=>{if(n.nodes&&n.nodes.length===0&&(u=n.raws.after,typeof u<"u"))return!1}),u}rawIndent(s){if(s.raws.indent)return s.raws.indent;let u;return s.walk(n=>{let a=n.parent;if(a&&a!==s&&a.parent&&a.parent===s&&typeof n.raws.before<"u"){let h=n.raws.before.split(`\n`);return u=h[h.length-1],u=u.replace(/\\S/g,""),!1}}),u}rawSemicolon(s){let u;return s.walk(n=>{if(n.nodes&&n.nodes.length&&n.last.type==="decl"&&(u=n.raws.semicolon,typeof u<"u"))return!1}),u}rawValue(s,u){let n=s[u],a=s.raws[u];return a&&a.value===n?a.raw:n}root(s){this.body(s),s.raws.after&&this.builder(s.raws.after)}rule(s){this.block(s,this.rawValue(s,"selector")),s.raws.ownSemicolon&&this.builder(s.raws.ownSemicolon,s,"end")}stringify(s,u){if(!this[s.type])throw new Error("Unknown AST node type "+s.type+". Maybe you need to change PostCSS stringifier.");this[s.type](s,u)}}return st=r,r.default=r,st}var nt,Hr;function We(){if(Hr)return nt;Hr=1;let e=ms();function t(r,o){new e(o).stringify(r)}return nt=t,t.default=t,nt}var ot,Jr;function qe(){if(Jr)return ot;Jr=1;let{isClean:e,my:t}=Rr(),r=Er(),o=ms(),s=We();function u(a,h){let c=new a.constructor;for(let i in a){if(!Object.prototype.hasOwnProperty.call(a,i)||i==="proxyCache")continue;let p=a[i],l=typeof p;i==="parent"&&l==="object"?h&&(c[i]=h):i==="source"?c[i]=p:Array.isArray(p)?c[i]=p.map(f=>u(f,c)):(l==="object"&&p!==null&&(p=u(p)),c[i]=p)}return c}class n{constructor(h={}){this.raws={},this[e]=!1,this[t]=!0;for(let c in h)if(c==="nodes"){this.nodes=[];for(let i of h[c])typeof i.clone=="function"?this.append(i.clone()):this.append(i)}else this[c]=h[c]}addToError(h){if(h.postcssNode=this,h.stack&&this.source&&/\\n\\s{4}at /.test(h.stack)){let c=this.source;h.stack=h.stack.replace(/\\n\\s{4}at /,`$&${c.input.from}:${c.start.line}:${c.start.column}$&`)}return h}after(h){return this.parent.insertAfter(this,h),this}assign(h={}){for(let c in h)this[c]=h[c];return this}before(h){return this.parent.insertBefore(this,h),this}cleanRaws(h){delete this.raws.before,delete this.raws.after,h||delete this.raws.between}clone(h={}){let c=u(this);for(let i in h)c[i]=h[i];return c}cloneAfter(h={}){let c=this.clone(h);return this.parent.insertAfter(this,c),c}cloneBefore(h={}){let c=this.clone(h);return this.parent.insertBefore(this,c),c}error(h,c={}){if(this.source){let{end:i,start:p}=this.rangeBy(c);return this.source.input.error(h,{column:p.column,line:p.line},{column:i.column,line:i.line},c)}return new r(h)}getProxyProcessor(){return{get(h,c){return c==="proxyOf"?h:c==="root"?()=>h.root().toProxy():h[c]},set(h,c,i){return h[c]===i||(h[c]=i,(c==="prop"||c==="value"||c==="name"||c==="params"||c==="important"||c==="text")&&h.markDirty()),!0}}}markDirty(){if(this[e]){this[e]=!1;let h=this;for(;h=h.parent;)h[e]=!1}}next(){if(!this.parent)return;let h=this.parent.index(this);return this.parent.nodes[h+1]}positionBy(h,c){let i=this.source.start;if(h.index)i=this.positionInside(h.index,c);else if(h.word){c=this.toString();let p=c.indexOf(h.word);p!==-1&&(i=this.positionInside(p,c))}return i}positionInside(h,c){let i=c||this.toString(),p=this.source.start.column,l=this.source.start.line;for(let f=0;f<h;f++)i[f]===`\n`?(p=1,l+=1):p+=1;return{column:p,line:l}}prev(){if(!this.parent)return;let h=this.parent.index(this);return this.parent.nodes[h-1]}rangeBy(h){let c={column:this.source.start.column,line:this.source.start.line},i=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:c.column+1,line:c.line};if(h.word){let p=this.toString(),l=p.indexOf(h.word);l!==-1&&(c=this.positionInside(l,p),i=this.positionInside(l+h.word.length,p))}else h.start?c={column:h.start.column,line:h.start.line}:h.index&&(c=this.positionInside(h.index)),h.end?i={column:h.end.column,line:h.end.line}:typeof h.endIndex=="number"?i=this.positionInside(h.endIndex):h.index&&(i=this.positionInside(h.index+1));return(i.line<c.line||i.line===c.line&&i.column<=c.column)&&(i={column:c.column+1,line:c.line}),{end:i,start:c}}raw(h,c){return new o().raw(this,h,c)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...h){if(this.parent){let c=this,i=!1;for(let p of h)p===this?i=!0:i?(this.parent.insertAfter(c,p),c=p):this.parent.insertBefore(c,p);i||this.remove()}return this}root(){let h=this;for(;h.parent&&h.parent.type!=="document";)h=h.parent;return h}toJSON(h,c){let i={},p=c==null;c=c||new Map;let l=0;for(let f in this){if(!Object.prototype.hasOwnProperty.call(this,f)||f==="parent"||f==="proxyCache")continue;let m=this[f];if(Array.isArray(m))i[f]=m.map(d=>typeof d=="object"&&d.toJSON?d.toJSON(null,c):d);else if(typeof m=="object"&&m.toJSON)i[f]=m.toJSON(null,c);else if(f==="source"){let d=c.get(m.input);d==null&&(d=l,c.set(m.input,l),l++),i[f]={end:m.end,inputId:d,start:m.start}}else i[f]=m}return p&&(i.inputs=[...c.keys()].map(f=>f.toJSON())),i}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(h=s){h.stringify&&(h=h.stringify);let c="";return h(this,i=>{c+=i}),c}warn(h,c,i){let p={node:this};for(let l in i)p[l]=i[l];return h.warn(c,p)}get proxyOf(){return this}}return ot=n,n.default=n,ot}var at,Qr;function je(){if(Qr)return at;Qr=1;let e=qe();class t extends e{constructor(o){o&&typeof o.value<"u"&&typeof o.value!="string"&&(o={...o,value:String(o.value)}),super(o),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}}return at=t,t.default=t,at}var lt,Xr;function cn(){if(Xr)return lt;Xr=1;let e="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";return lt={nanoid:(o=21)=>{let s="",u=o;for(;u--;)s+=e[Math.random()*64|0];return s},customAlphabet:(o,s=21)=>(u=s)=>{let n="",a=u;for(;a--;)n+=o[Math.random()*o.length|0];return n}},lt}var ut,Zr;function gs(){if(Zr)return ut;Zr=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=J,{existsSync:r,readFileSync:o}=J,{dirname:s,join:u}=J;function n(h){return Buffer?Buffer.from(h,"base64").toString():window.atob(h)}class a{constructor(c,i){if(i.map===!1)return;this.loadAnnotation(c),this.inline=this.startWith(this.annotation,"data:");let p=i.map?i.map.prev:void 0,l=this.loadMap(i.from,p);!this.mapFile&&i.from&&(this.mapFile=i.from),this.mapFile&&(this.root=s(this.mapFile)),l&&(this.text=l)}consumer(){return this.consumerCache||(this.consumerCache=new e(this.text)),this.consumerCache}decodeInline(c){let i=/^data:application\\/json;charset=utf-?8;base64,/,p=/^data:application\\/json;base64,/,l=/^data:application\\/json;charset=utf-?8,/,f=/^data:application\\/json,/;if(l.test(c)||f.test(c))return decodeURIComponent(c.substr(RegExp.lastMatch.length));if(i.test(c)||p.test(c))return n(c.substr(RegExp.lastMatch.length));let m=c.match(/data:application\\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+m)}getAnnotationURL(c){return c.replace(/^\\/\\*\\s*# sourceMappingURL=/,"").trim()}isMap(c){return typeof c!="object"?!1:typeof c.mappings=="string"||typeof c._mappings=="string"||Array.isArray(c.sections)}loadAnnotation(c){let i=c.match(/\\/\\*\\s*# sourceMappingURL=/gm);if(!i)return;let p=c.lastIndexOf(i.pop()),l=c.indexOf("*/",p);p>-1&&l>-1&&(this.annotation=this.getAnnotationURL(c.substring(p,l)))}loadFile(c){if(this.root=s(c),r(c))return this.mapFile=c,o(c,"utf-8").toString().trim()}loadMap(c,i){if(i===!1)return!1;if(i){if(typeof i=="string")return i;if(typeof i=="function"){let p=i(c);if(p){let l=this.loadFile(p);if(!l)throw new Error("Unable to load previous source map: "+p.toString());return l}}else{if(i instanceof e)return t.fromSourceMap(i).toString();if(i instanceof t)return i.toString();if(this.isMap(i))return JSON.stringify(i);throw new Error("Unsupported previous source map format: "+i.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let p=this.annotation;return c&&(p=u(s(c),p)),this.loadFile(p)}}}startWith(c,i){return c?c.substr(0,i.length)===i:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return ut=a,a.default=a,ut}var ct,Kr;function Ve(){if(Kr)return ct;Kr=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=J,{fileURLToPath:r,pathToFileURL:o}=J,{isAbsolute:s,resolve:u}=J,{nanoid:n}=cn(),a=J,h=Er(),c=gs(),i=Symbol("fromOffsetCache"),p=!!(e&&t),l=!!(u&&s);class f{constructor(d,g={}){if(d===null||typeof d>"u"||typeof d=="object"&&!d.toString)throw new Error(`PostCSS received ${d} instead of CSS string`);if(this.css=d.toString(),this.css[0]==="\\uFEFF"||this.css[0]==="\\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,g.from&&(!l||/^\\w+:\\/\\//.test(g.from)||s(g.from)?this.file=g.from:this.file=u(g.from)),l&&p){let y=new c(this.css,g);if(y.text){this.map=y;let w=y.consumer().file;!this.file&&w&&(this.file=this.mapResolve(w))}}this.file||(this.id="<input css "+n(6)+">"),this.map&&(this.map.file=this.from)}error(d,g,y,w={}){let S,x,v;if(g&&typeof g=="object"){let C=g,R=y;if(typeof C.offset=="number"){let A=this.fromOffset(C.offset);g=A.line,y=A.col}else g=C.line,y=C.column;if(typeof R.offset=="number"){let A=this.fromOffset(R.offset);x=A.line,v=A.col}else x=R.line,v=R.column}else if(!y){let C=this.fromOffset(g);g=C.line,y=C.col}let b=this.origin(g,y,x,v);return b?S=new h(d,b.endLine===void 0?b.line:{column:b.column,line:b.line},b.endLine===void 0?b.column:{column:b.endColumn,line:b.endLine},b.source,b.file,w.plugin):S=new h(d,x===void 0?g:{column:y,line:g},x===void 0?y:{column:v,line:x},this.css,this.file,w.plugin),S.input={column:y,endColumn:v,endLine:x,line:g,source:this.css},this.file&&(o&&(S.input.url=o(this.file).toString()),S.input.file=this.file),S}fromOffset(d){let g,y;if(this[i])y=this[i];else{let S=this.css.split(`\n`);y=new Array(S.length);let x=0;for(let v=0,b=S.length;v<b;v++)y[v]=x,x+=S[v].length+1;this[i]=y}g=y[y.length-1];let w=0;if(d>=g)w=y.length-1;else{let S=y.length-2,x;for(;w<S;)if(x=w+(S-w>>1),d<y[x])S=x-1;else if(d>=y[x+1])w=x+1;else{w=x;break}}return{col:d-y[w]+1,line:w+1}}mapResolve(d){return/^\\w+:\\/\\//.test(d)?d:u(this.map.consumer().sourceRoot||this.map.root||".",d)}origin(d,g,y,w){if(!this.map)return!1;let S=this.map.consumer(),x=S.originalPositionFor({column:g,line:d});if(!x.source)return!1;let v;typeof y=="number"&&(v=S.originalPositionFor({column:w,line:y}));let b;s(x.source)?b=o(x.source):b=new URL(x.source,this.map.consumer().sourceRoot||o(this.map.mapFile));let C={column:x.column,endColumn:v&&v.column,endLine:v&&v.line,line:x.line,url:b.toString()};if(b.protocol==="file:")if(r)C.file=r(b);else throw new Error("file: protocol is not available in this PostCSS build");let R=S.sourceContentFor(x.source);return R&&(C.source=R),C}toJSON(){let d={};for(let g of["hasBOM","css","file","id"])this[g]!=null&&(d[g]=this[g]);return this.map&&(d.map={...this.map},d.map.consumerCache&&(d.map.consumerCache=void 0)),d}get from(){return this.file||this.id}}return ct=f,f.default=f,a&&a.registerInput&&a.registerInput(f),ct}var ht,ei;function ys(){if(ei)return ht;ei=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=J,{dirname:r,relative:o,resolve:s,sep:u}=J,{pathToFileURL:n}=J,a=Ve(),h=!!(e&&t),c=!!(r&&s&&o&&u);class i{constructor(l,f,m,d){this.stringify=l,this.mapOpts=m.map||{},this.root=f,this.opts=m,this.css=d,this.originalCSS=d,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let l;this.isInline()?l="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?l=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?l=this.mapOpts.annotation(this.opts.to,this.root):l=this.outputFile()+".map";let f=`\n`;this.css.includes(`\\r\n`)&&(f=`\\r\n`),this.css+=f+"/*# sourceMappingURL="+l+" */"}applyPrevMaps(){for(let l of this.previous()){let f=this.toUrl(this.path(l.file)),m=l.root||r(l.file),d;this.mapOpts.sourcesContent===!1?(d=new e(l.text),d.sourcesContent&&(d.sourcesContent=null)):d=l.consumer(),this.map.applySourceMap(d,f,this.toUrl(this.path(m)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let l;for(let f=this.root.nodes.length-1;f>=0;f--)l=this.root.nodes[f],l.type==="comment"&&l.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(f)}else this.css&&(this.css=this.css.replace(/\\n*?\\/\\*#[\\S\\s]*?\\*\\/$/gm,""))}generate(){if(this.clearAnnotation(),c&&h&&this.isMap())return this.generateMap();{let l="";return this.stringify(this.root,f=>{l+=f}),[l]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let l=this.previous()[0].consumer();l.file=this.outputFile(),this.map=t.fromSourceMap(l,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0});let l=1,f=1,m="<no source>",d={generated:{column:0,line:0},original:{column:0,line:0},source:""},g,y;this.stringify(this.root,(w,S,x)=>{if(this.css+=w,S&&x!=="end"&&(d.generated.line=l,d.generated.column=f-1,S.source&&S.source.start?(d.source=this.sourcePath(S),d.original.line=S.source.start.line,d.original.column=S.source.start.column-1,this.map.addMapping(d)):(d.source=m,d.original.line=1,d.original.column=0,this.map.addMapping(d))),g=w.match(/\\n/g),g?(l+=g.length,y=w.lastIndexOf(`\n`),f=w.length-y):f+=w.length,S&&x!=="start"){let v=S.parent||{raws:{}};(!(S.type==="decl"||S.type==="atrule"&&!S.nodes)||S!==v.last||v.raws.semicolon)&&(S.source&&S.source.end?(d.source=this.sourcePath(S),d.original.line=S.source.end.line,d.original.column=S.source.end.column-1,d.generated.line=l,d.generated.column=f-2,this.map.addMapping(d)):(d.source=m,d.original.line=1,d.original.column=0,d.generated.line=l,d.generated.column=f-1,this.map.addMapping(d)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(l=>l.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let l=this.mapOpts.annotation;return typeof l<"u"&&l!==!0?!1:this.previous().length?this.previous().some(f=>f.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(l=>l.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(l){if(this.mapOpts.absolute||l.charCodeAt(0)===60||/^\\w+:\\/\\//.test(l))return l;let f=this.memoizedPaths.get(l);if(f)return f;let m=this.opts.to?r(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(m=r(s(m,this.mapOpts.annotation)));let d=o(m,l);return this.memoizedPaths.set(l,d),d}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(l=>{if(l.source&&l.source.input.map){let f=l.source.input.map;this.previousMaps.includes(f)||this.previousMaps.push(f)}});else{let l=new a(this.originalCSS,this.opts);l.map&&this.previousMaps.push(l.map)}return this.previousMaps}setSourcesContent(){let l={};if(this.root)this.root.walk(f=>{if(f.source){let m=f.source.input.from;if(m&&!l[m]){l[m]=!0;let d=this.usesFileUrls?this.toFileUrl(m):this.toUrl(this.path(m));this.map.setSourceContent(d,f.source.input.css)}}});else if(this.css){let f=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(f,this.css)}}sourcePath(l){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(l.source.input.from):this.toUrl(this.path(l.source.input.from))}toBase64(l){return Buffer?Buffer.from(l).toString("base64"):window.btoa(unescape(encodeURIComponent(l)))}toFileUrl(l){let f=this.memoizedFileURLs.get(l);if(f)return f;if(n){let m=n(l).toString();return this.memoizedFileURLs.set(l,m),m}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(l){let f=this.memoizedURLs.get(l);if(f)return f;u==="\\\\"&&(l=l.replace(/\\\\/g,"/"));let m=encodeURI(l).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(l,m),m}}return ht=i,ht}var ft,ti;function Ge(){if(ti)return ft;ti=1;let e=qe();class t extends e{constructor(o){super(o),this.type="comment"}}return ft=t,t.default=t,ft}var pt,ri;function le(){if(ri)return pt;ri=1;let{isClean:e,my:t}=Rr(),r=je(),o=Ge(),s=qe(),u,n,a,h;function c(l){return l.map(f=>(f.nodes&&(f.nodes=c(f.nodes)),delete f.source,f))}function i(l){if(l[e]=!1,l.proxyOf.nodes)for(let f of l.proxyOf.nodes)i(f)}class p extends s{append(...f){for(let m of f){let d=this.normalize(m,this.last);for(let g of d)this.proxyOf.nodes.push(g)}return this.markDirty(),this}cleanRaws(f){if(super.cleanRaws(f),this.nodes)for(let m of this.nodes)m.cleanRaws(f)}each(f){if(!this.proxyOf.nodes)return;let m=this.getIterator(),d,g;for(;this.indexes[m]<this.proxyOf.nodes.length&&(d=this.indexes[m],g=f(this.proxyOf.nodes[d],d),g!==!1);)this.indexes[m]+=1;return delete this.indexes[m],g}every(f){return this.nodes.every(f)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let f=this.lastEach;return this.indexes[f]=0,f}getProxyProcessor(){return{get(f,m){return m==="proxyOf"?f:f[m]?m==="each"||typeof m=="string"&&m.startsWith("walk")?(...d)=>f[m](...d.map(g=>typeof g=="function"?(y,w)=>g(y.toProxy(),w):g)):m==="every"||m==="some"?d=>f[m]((g,...y)=>d(g.toProxy(),...y)):m==="root"?()=>f.root().toProxy():m==="nodes"?f.nodes.map(d=>d.toProxy()):m==="first"||m==="last"?f[m].toProxy():f[m]:f[m]},set(f,m,d){return f[m]===d||(f[m]=d,(m==="name"||m==="params"||m==="selector")&&f.markDirty()),!0}}}index(f){return typeof f=="number"?f:(f.proxyOf&&(f=f.proxyOf),this.proxyOf.nodes.indexOf(f))}insertAfter(f,m){let d=this.index(f),g=this.normalize(m,this.proxyOf.nodes[d]).reverse();d=this.index(f);for(let w of g)this.proxyOf.nodes.splice(d+1,0,w);let y;for(let w in this.indexes)y=this.indexes[w],d<y&&(this.indexes[w]=y+g.length);return this.markDirty(),this}insertBefore(f,m){let d=this.index(f),g=d===0?"prepend":!1,y=this.normalize(m,this.proxyOf.nodes[d],g).reverse();d=this.index(f);for(let S of y)this.proxyOf.nodes.splice(d,0,S);let w;for(let S in this.indexes)w=this.indexes[S],d<=w&&(this.indexes[S]=w+y.length);return this.markDirty(),this}normalize(f,m){if(typeof f=="string")f=c(u(f).nodes);else if(typeof f>"u")f=[];else if(Array.isArray(f)){f=f.slice(0);for(let g of f)g.parent&&g.parent.removeChild(g,"ignore")}else if(f.type==="root"&&this.type!=="document"){f=f.nodes.slice(0);for(let g of f)g.parent&&g.parent.removeChild(g,"ignore")}else if(f.type)f=[f];else if(f.prop){if(typeof f.value>"u")throw new Error("Value field is missed in node creation");typeof f.value!="string"&&(f.value=String(f.value)),f=[new r(f)]}else if(f.selector)f=[new n(f)];else if(f.name)f=[new a(f)];else if(f.text)f=[new o(f)];else throw new Error("Unknown node type in node creation");return f.map(g=>(g[t]||p.rebuild(g),g=g.proxyOf,g.parent&&g.parent.removeChild(g),g[e]&&i(g),typeof g.raws.before>"u"&&m&&typeof m.raws.before<"u"&&(g.raws.before=m.raws.before.replace(/\\S/g,"")),g.parent=this.proxyOf,g))}prepend(...f){f=f.reverse();for(let m of f){let d=this.normalize(m,this.first,"prepend").reverse();for(let g of d)this.proxyOf.nodes.unshift(g);for(let g in this.indexes)this.indexes[g]=this.indexes[g]+d.length}return this.markDirty(),this}push(f){return f.parent=this,this.proxyOf.nodes.push(f),this}removeAll(){for(let f of this.proxyOf.nodes)f.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(f){f=this.index(f),this.proxyOf.nodes[f].parent=void 0,this.proxyOf.nodes.splice(f,1);let m;for(let d in this.indexes)m=this.indexes[d],m>=f&&(this.indexes[d]=m-1);return this.markDirty(),this}replaceValues(f,m,d){return d||(d=m,m={}),this.walkDecls(g=>{m.props&&!m.props.includes(g.prop)||m.fast&&!g.value.includes(m.fast)||(g.value=g.value.replace(f,d))}),this.markDirty(),this}some(f){return this.nodes.some(f)}walk(f){return this.each((m,d)=>{let g;try{g=f(m,d)}catch(y){throw m.addToError(y)}return g!==!1&&m.walk&&(g=m.walk(f)),g})}walkAtRules(f,m){return m?f instanceof RegExp?this.walk((d,g)=>{if(d.type==="atrule"&&f.test(d.name))return m(d,g)}):this.walk((d,g)=>{if(d.type==="atrule"&&d.name===f)return m(d,g)}):(m=f,this.walk((d,g)=>{if(d.type==="atrule")return m(d,g)}))}walkComments(f){return this.walk((m,d)=>{if(m.type==="comment")return f(m,d)})}walkDecls(f,m){return m?f instanceof RegExp?this.walk((d,g)=>{if(d.type==="decl"&&f.test(d.prop))return m(d,g)}):this.walk((d,g)=>{if(d.type==="decl"&&d.prop===f)return m(d,g)}):(m=f,this.walk((d,g)=>{if(d.type==="decl")return m(d,g)}))}walkRules(f,m){return m?f instanceof RegExp?this.walk((d,g)=>{if(d.type==="rule"&&f.test(d.selector))return m(d,g)}):this.walk((d,g)=>{if(d.type==="rule"&&d.selector===f)return m(d,g)}):(m=f,this.walk((d,g)=>{if(d.type==="rule")return m(d,g)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}return p.registerParse=l=>{u=l},p.registerRule=l=>{n=l},p.registerAtRule=l=>{a=l},p.registerRoot=l=>{h=l},pt=p,p.default=p,p.rebuild=l=>{l.type==="atrule"?Object.setPrototypeOf(l,a.prototype):l.type==="rule"?Object.setPrototypeOf(l,n.prototype):l.type==="decl"?Object.setPrototypeOf(l,r.prototype):l.type==="comment"?Object.setPrototypeOf(l,o.prototype):l.type==="root"&&Object.setPrototypeOf(l,h.prototype),l[t]=!0,l.nodes&&l.nodes.forEach(f=>{p.rebuild(f)})},pt}var dt,ii;function Nr(){if(ii)return dt;ii=1;let e=le(),t,r;class o extends e{constructor(u){super({type:"document",...u}),this.nodes||(this.nodes=[])}toResult(u={}){return new t(new r,this,u).stringify()}}return o.registerLazyResult=s=>{t=s},o.registerProcessor=s=>{r=s},dt=o,o.default=o,dt}var mt,si;function ws(){if(si)return mt;si=1;let e={};return mt=function(r){e[r]||(e[r]=!0,typeof console<"u"&&console.warn&&console.warn(r))},mt}var gt,ni;function vs(){if(ni)return gt;ni=1;class e{constructor(r,o={}){if(this.type="warning",this.text=r,o.node&&o.node.source){let s=o.node.rangeBy(o);this.line=s.start.line,this.column=s.start.column,this.endLine=s.end.line,this.endColumn=s.end.column}for(let s in o)this[s]=o[s]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}return gt=e,e.default=e,gt}var yt,oi;function Mr(){if(oi)return yt;oi=1;let e=vs();class t{constructor(o,s,u){this.processor=o,this.messages=[],this.root=s,this.opts=u,this.css=void 0,this.map=void 0}toString(){return this.css}warn(o,s={}){s.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(s.plugin=this.lastPlugin.postcssPlugin);let u=new e(o,s);return this.messages.push(u),u}warnings(){return this.messages.filter(o=>o.type==="warning")}get content(){return this.css}}return yt=t,t.default=t,yt}var wt,ai;function hn(){if(ai)return wt;ai=1;let e=39,t=34,r=92,o=47,s=10,u=32,n=12,a=9,h=13,c=91,i=93,p=40,l=41,f=123,m=125,d=59,g=42,y=58,w=64,S=/[\\t\\n\\f\\r "#\'()/;[\\\\\\]{}]/g,x=/[\\t\\n\\f\\r !"#\'():;@[\\\\\\]{}]|\\/(?=\\*)/g,v=/.[\\r\\n"\'(/\\\\]/,b=/[\\da-f]/i;return wt=function(R,A={}){let N=R.css.valueOf(),k=A.ignoreErrors,D,E,se,K,H,P,j,te,W,F,ye=N.length,M=0,ne=[],ee=[];function Ke(){return M}function oe(V){throw R.error("Unclosed "+V,M)}function et(){return ee.length===0&&M>=ye}function tt(V){if(ee.length)return ee.pop();if(M>=ye)return;let ae=V?V.ignoreUnclosed:!1;switch(D=N.charCodeAt(M),D){case s:case u:case a:case h:case n:{E=M;do E+=1,D=N.charCodeAt(E);while(D===u||D===s||D===a||D===h||D===n);F=["space",N.slice(M,E)],M=E-1;break}case c:case i:case f:case m:case y:case d:case l:{let we=String.fromCharCode(D);F=[we,we,M];break}case p:{if(te=ne.length?ne.pop()[1]:"",W=N.charCodeAt(M+1),te==="url"&&W!==e&&W!==t&&W!==u&&W!==s&&W!==a&&W!==n&&W!==h){E=M;do{if(P=!1,E=N.indexOf(")",E+1),E===-1)if(k||ae){E=M;break}else oe("bracket");for(j=E;N.charCodeAt(j-1)===r;)j-=1,P=!P}while(P);F=["brackets",N.slice(M,E+1),M,E],M=E}else E=N.indexOf(")",M+1),K=N.slice(M,E+1),E===-1||v.test(K)?F=["(","(",M]:(F=["brackets",K,M,E],M=E);break}case e:case t:{se=D===e?"\'":\'"\',E=M;do{if(P=!1,E=N.indexOf(se,E+1),E===-1)if(k||ae){E=M+1;break}else oe("string");for(j=E;N.charCodeAt(j-1)===r;)j-=1,P=!P}while(P);F=["string",N.slice(M,E+1),M,E],M=E;break}case w:{S.lastIndex=M+1,S.test(N),S.lastIndex===0?E=N.length-1:E=S.lastIndex-2,F=["at-word",N.slice(M,E+1),M,E],M=E;break}case r:{for(E=M,H=!0;N.charCodeAt(E+1)===r;)E+=1,H=!H;if(D=N.charCodeAt(E+1),H&&D!==o&&D!==u&&D!==s&&D!==a&&D!==h&&D!==n&&(E+=1,b.test(N.charAt(E)))){for(;b.test(N.charAt(E+1));)E+=1;N.charCodeAt(E+1)===u&&(E+=1)}F=["word",N.slice(M,E+1),M,E],M=E;break}default:{D===o&&N.charCodeAt(M+1)===g?(E=N.indexOf("*/",M+2)+1,E===0&&(k||ae?E=N.length:oe("comment")),F=["comment",N.slice(M,E+1),M,E],M=E):(x.lastIndex=M+1,x.test(N),x.lastIndex===0?E=N.length-1:E=x.lastIndex-2,F=["word",N.slice(M,E+1),M,E],ne.push(F),M=E);break}}return M++,F}function rt(V){ee.push(V)}return{back:rt,endOfFile:et,nextToken:tt,position:Ke}},wt}var vt,li;function Ar(){if(li)return vt;li=1;let e=le();class t extends e{constructor(o){super(o),this.type="atrule"}append(...o){return this.proxyOf.nodes||(this.nodes=[]),super.append(...o)}prepend(...o){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...o)}}return vt=t,t.default=t,e.registerAtRule(t),vt}var bt,ui;function Ce(){if(ui)return bt;ui=1;let e=le(),t,r;class o extends e{constructor(u){super(u),this.type="root",this.nodes||(this.nodes=[])}normalize(u,n,a){let h=super.normalize(u);if(n){if(a==="prepend")this.nodes.length>1?n.raws.before=this.nodes[1].raws.before:delete n.raws.before;else if(this.first!==n)for(let c of h)c.raws.before=n.raws.before}return h}removeChild(u,n){let a=this.index(u);return!n&&a===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[a].raws.before),super.removeChild(u)}toResult(u={}){return new t(new r,this,u).stringify()}}return o.registerLazyResult=s=>{t=s},o.registerProcessor=s=>{r=s},bt=o,o.default=o,e.registerRoot(o),bt}var St,ci;function bs(){if(ci)return St;ci=1;let e={comma(t){return e.split(t,[","],!0)},space(t){let r=[" ",`\n`," "];return e.split(t,r)},split(t,r,o){let s=[],u="",n=!1,a=0,h=!1,c="",i=!1;for(let p of t)i?i=!1:p==="\\\\"?i=!0:h?p===c&&(h=!1):p===\'"\'||p==="\'"?(h=!0,c=p):p==="("?a+=1:p===")"?a>0&&(a-=1):a===0&&r.includes(p)&&(n=!0),n?(u!==""&&s.push(u.trim()),u="",n=!1):u+=p;return(o||u!=="")&&s.push(u.trim()),s}};return St=e,e.default=e,St}var xt,hi;function Or(){if(hi)return xt;hi=1;let e=le(),t=bs();class r extends e{constructor(s){super(s),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.comma(this.selector)}set selectors(s){let u=this.selector?this.selector.match(/,\\s*/):null,n=u?u[0]:","+this.raw("between","beforeOpen");this.selector=s.join(n)}}return xt=r,r.default=r,e.registerRule(r),xt}var Ct,fi;function fn(){if(fi)return Ct;fi=1;let e=je(),t=hn(),r=Ge(),o=Ar(),s=Ce(),u=Or(),n={empty:!0,space:!0};function a(c){for(let i=c.length-1;i>=0;i--){let p=c[i],l=p[3]||p[2];if(l)return l}}class h{constructor(i){this.input=i,this.root=new s,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:i,start:{column:1,line:1,offset:0}}}atrule(i){let p=new o;p.name=i[1].slice(1),p.name===""&&this.unnamedAtrule(p,i),this.init(p,i[2]);let l,f,m,d=!1,g=!1,y=[],w=[];for(;!this.tokenizer.endOfFile();){if(i=this.tokenizer.nextToken(),l=i[0],l==="("||l==="["?w.push(l==="("?")":"]"):l==="{"&&w.length>0?w.push("}"):l===w[w.length-1]&&w.pop(),w.length===0)if(l===";"){p.source.end=this.getPosition(i[2]),p.source.end.offset++,this.semicolon=!0;break}else if(l==="{"){g=!0;break}else if(l==="}"){if(y.length>0){for(m=y.length-1,f=y[m];f&&f[0]==="space";)f=y[--m];f&&(p.source.end=this.getPosition(f[3]||f[2]),p.source.end.offset++)}this.end(i);break}else y.push(i);else y.push(i);if(this.tokenizer.endOfFile()){d=!0;break}}p.raws.between=this.spacesAndCommentsFromEnd(y),y.length?(p.raws.afterName=this.spacesAndCommentsFromStart(y),this.raw(p,"params",y),d&&(i=y[y.length-1],p.source.end=this.getPosition(i[3]||i[2]),p.source.end.offset++,this.spaces=p.raws.between,p.raws.between="")):(p.raws.afterName="",p.params=""),g&&(p.nodes=[],this.current=p)}checkMissedSemicolon(i){let p=this.colon(i);if(p===!1)return;let l=0,f;for(let m=p-1;m>=0&&(f=i[m],!(f[0]!=="space"&&(l+=1,l===2)));m--);throw this.input.error("Missed semicolon",f[0]==="word"?f[3]+1:f[2])}colon(i){let p=0,l,f,m;for(let[d,g]of i.entries()){if(l=g,f=l[0],f==="("&&(p+=1),f===")"&&(p-=1),p===0&&f===":")if(!m)this.doubleColon(l);else{if(m[0]==="word"&&m[1]==="progid")continue;return d}m=l}return!1}comment(i){let p=new r;this.init(p,i[2]),p.source.end=this.getPosition(i[3]||i[2]),p.source.end.offset++;let l=i[1].slice(2,-2);if(/^\\s*$/.test(l))p.text="",p.raws.left=l,p.raws.right="";else{let f=l.match(/^(\\s*)([^]*\\S)(\\s*)$/);p.text=f[2],p.raws.left=f[1],p.raws.right=f[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(i,p){let l=new e;this.init(l,i[0][2]);let f=i[i.length-1];for(f[0]===";"&&(this.semicolon=!0,i.pop()),l.source.end=this.getPosition(f[3]||f[2]||a(i)),l.source.end.offset++;i[0][0]!=="word";)i.length===1&&this.unknownWord(i),l.raws.before+=i.shift()[1];for(l.source.start=this.getPosition(i[0][2]),l.prop="";i.length;){let w=i[0][0];if(w===":"||w==="space"||w==="comment")break;l.prop+=i.shift()[1]}l.raws.between="";let m;for(;i.length;)if(m=i.shift(),m[0]===":"){l.raws.between+=m[1];break}else m[0]==="word"&&/\\w/.test(m[1])&&this.unknownWord([m]),l.raws.between+=m[1];(l.prop[0]==="_"||l.prop[0]==="*")&&(l.raws.before+=l.prop[0],l.prop=l.prop.slice(1));let d=[],g;for(;i.length&&(g=i[0][0],!(g!=="space"&&g!=="comment"));)d.push(i.shift());this.precheckMissedSemicolon(i);for(let w=i.length-1;w>=0;w--){if(m=i[w],m[1].toLowerCase()==="!important"){l.important=!0;let S=this.stringFrom(i,w);S=this.spacesFromEnd(i)+S,S!==" !important"&&(l.raws.important=S);break}else if(m[1].toLowerCase()==="important"){let S=i.slice(0),x="";for(let v=w;v>0;v--){let b=S[v][0];if(x.trim().indexOf("!")===0&&b!=="space")break;x=S.pop()[1]+x}x.trim().indexOf("!")===0&&(l.important=!0,l.raws.important=x,i=S)}if(m[0]!=="space"&&m[0]!=="comment")break}i.some(w=>w[0]!=="space"&&w[0]!=="comment")&&(l.raws.between+=d.map(w=>w[1]).join(""),d=[]),this.raw(l,"value",d.concat(i),p),l.value.includes(":")&&!p&&this.checkMissedSemicolon(i)}doubleColon(i){throw this.input.error("Double colon",{offset:i[2]},{offset:i[2]+i[1].length})}emptyRule(i){let p=new u;this.init(p,i[2]),p.selector="",p.raws.between="",this.current=p}end(i){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(i[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(i)}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(i){if(this.spaces+=i[1],this.current.nodes){let p=this.current.nodes[this.current.nodes.length-1];p&&p.type==="rule"&&!p.raws.ownSemicolon&&(p.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(i){let p=this.input.fromOffset(i);return{column:p.col,line:p.line,offset:i}}init(i,p){this.current.push(i),i.source={input:this.input,start:this.getPosition(p)},i.raws.before=this.spaces,this.spaces="",i.type!=="comment"&&(this.semicolon=!1)}other(i){let p=!1,l=null,f=!1,m=null,d=[],g=i[1].startsWith("--"),y=[],w=i;for(;w;){if(l=w[0],y.push(w),l==="("||l==="[")m||(m=w),d.push(l==="("?")":"]");else if(g&&f&&l==="{")m||(m=w),d.push("}");else if(d.length===0)if(l===";")if(f){this.decl(y,g);return}else break;else if(l==="{"){this.rule(y);return}else if(l==="}"){this.tokenizer.back(y.pop()),p=!0;break}else l===":"&&(f=!0);else l===d[d.length-1]&&(d.pop(),d.length===0&&(m=null));w=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(p=!0),d.length>0&&this.unclosedBracket(m),p&&f){if(!g)for(;y.length&&(w=y[y.length-1][0],!(w!=="space"&&w!=="comment"));)this.tokenizer.back(y.pop());this.decl(y,g)}else this.unknownWord(y)}parse(){let i;for(;!this.tokenizer.endOfFile();)switch(i=this.tokenizer.nextToken(),i[0]){case"space":this.spaces+=i[1];break;case";":this.freeSemicolon(i);break;case"}":this.end(i);break;case"comment":this.comment(i);break;case"at-word":this.atrule(i);break;case"{":this.emptyRule(i);break;default:this.other(i);break}this.endFile()}precheckMissedSemicolon(){}raw(i,p,l,f){let m,d,g=l.length,y="",w=!0,S,x;for(let v=0;v<g;v+=1)m=l[v],d=m[0],d==="space"&&v===g-1&&!f?w=!1:d==="comment"?(x=l[v-1]?l[v-1][0]:"empty",S=l[v+1]?l[v+1][0]:"empty",!n[x]&&!n[S]?y.slice(-1)===","?w=!1:y+=m[1]:w=!1):y+=m[1];if(!w){let v=l.reduce((b,C)=>b+C[1],"");i.raws[p]={raw:v,value:y}}i[p]=y}rule(i){i.pop();let p=new u;this.init(p,i[0][2]),p.raws.between=this.spacesAndCommentsFromEnd(i),this.raw(p,"selector",i),this.current=p}spacesAndCommentsFromEnd(i){let p,l="";for(;i.length&&(p=i[i.length-1][0],!(p!=="space"&&p!=="comment"));)l=i.pop()[1]+l;return l}spacesAndCommentsFromStart(i){let p,l="";for(;i.length&&(p=i[0][0],!(p!=="space"&&p!=="comment"));)l+=i.shift()[1];return l}spacesFromEnd(i){let p,l="";for(;i.length&&(p=i[i.length-1][0],p==="space");)l=i.pop()[1]+l;return l}stringFrom(i,p){let l="";for(let f=p;f<i.length;f++)l+=i[f][1];return i.splice(p,i.length-p),l}unclosedBlock(){let i=this.current.source.start;throw this.input.error("Unclosed block",i.line,i.column)}unclosedBracket(i){throw this.input.error("Unclosed bracket",{offset:i[2]},{offset:i[2]+1})}unexpectedClose(i){throw this.input.error("Unexpected }",{offset:i[2]},{offset:i[2]+1})}unknownWord(i){throw this.input.error("Unknown word",{offset:i[0][2]},{offset:i[0][2]+i[0][1].length})}unnamedAtrule(i,p){throw this.input.error("At-rule without name",{offset:p[2]},{offset:p[2]+p[1].length})}}return Ct=h,Ct}var Et,pi;function Dr(){if(pi)return Et;pi=1;let e=le(),t=fn(),r=Ve();function o(s,u){let n=new r(s,u),a=new t(n);try{a.parse()}catch(h){throw h}return a.root}return Et=o,o.default=o,e.registerParse(o),Et}var Rt,di;function Ss(){if(di)return Rt;di=1;let{isClean:e,my:t}=Rr(),r=ys(),o=We(),s=le(),u=Nr(),n=ws(),a=Mr(),h=Dr(),c=Ce(),i={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},p={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},l={Once:!0,postcssPlugin:!0,prepare:!0},f=0;function m(x){return typeof x=="object"&&typeof x.then=="function"}function d(x){let v=!1,b=i[x.type];return x.type==="decl"?v=x.prop.toLowerCase():x.type==="atrule"&&(v=x.name.toLowerCase()),v&&x.append?[b,b+"-"+v,f,b+"Exit",b+"Exit-"+v]:v?[b,b+"-"+v,b+"Exit",b+"Exit-"+v]:x.append?[b,f,b+"Exit"]:[b,b+"Exit"]}function g(x){let v;return x.type==="document"?v=["Document",f,"DocumentExit"]:x.type==="root"?v=["Root",f,"RootExit"]:v=d(x),{eventIndex:0,events:v,iterator:0,node:x,visitorIndex:0,visitors:[]}}function y(x){return x[e]=!1,x.nodes&&x.nodes.forEach(v=>y(v)),x}let w={};class S{constructor(v,b,C){this.stringified=!1,this.processed=!1;let R;if(typeof b=="object"&&b!==null&&(b.type==="root"||b.type==="document"))R=y(b);else if(b instanceof S||b instanceof a)R=y(b.root),b.map&&(typeof C.map>"u"&&(C.map={}),C.map.inline||(C.map.inline=!1),C.map.prev=b.map);else{let A=h;C.syntax&&(A=C.syntax.parse),C.parser&&(A=C.parser),A.parse&&(A=A.parse);try{R=A(b,C)}catch(N){this.processed=!0,this.error=N}R&&!R[t]&&s.rebuild(R)}this.result=new a(v,R,C),this.helpers={...w,postcss:w,result:this.result},this.plugins=this.processor.plugins.map(A=>typeof A=="object"&&A.prepare?{...A,...A.prepare(this.result)}:A)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(v){return this.async().catch(v)}finally(v){return this.async().then(v,v)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(v,b){let C=this.result.lastPlugin;try{b&&b.addToError(v),this.error=v,v.name==="CssSyntaxError"&&!v.plugin?(v.plugin=C.postcssPlugin,v.setMessage()):C.postcssVersion}catch(R){console&&console.error&&console.error(R)}return v}prepareVisitors(){this.listeners={};let v=(b,C,R)=>{this.listeners[C]||(this.listeners[C]=[]),this.listeners[C].push([b,R])};for(let b of this.plugins)if(typeof b=="object")for(let C in b){if(!p[C]&&/^[A-Z]/.test(C))throw new Error(`Unknown event ${C} in ${b.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!l[C])if(typeof b[C]=="object")for(let R in b[C])R==="*"?v(b,C,b[C][R]):v(b,C+"-"+R.toLowerCase(),b[C][R]);else typeof b[C]=="function"&&v(b,C,b[C])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let v=0;v<this.plugins.length;v++){let b=this.plugins[v],C=this.runOnRoot(b);if(m(C))try{await C}catch(R){throw this.handleError(R)}}if(this.prepareVisitors(),this.hasListener){let v=this.result.root;for(;!v[e];){v[e]=!0;let b=[g(v)];for(;b.length>0;){let C=this.visitTick(b);if(m(C))try{await C}catch(R){let A=b[b.length-1].node;throw this.handleError(R,A)}}}if(this.listeners.OnceExit)for(let[b,C]of this.listeners.OnceExit){this.result.lastPlugin=b;try{if(v.type==="document"){let R=v.nodes.map(A=>C(A,this.helpers));await Promise.all(R)}else await C(v,this.helpers)}catch(R){throw this.handleError(R)}}}return this.processed=!0,this.stringify()}runOnRoot(v){this.result.lastPlugin=v;try{if(typeof v=="object"&&v.Once){if(this.result.root.type==="document"){let b=this.result.root.nodes.map(C=>v.Once(C,this.helpers));return m(b[0])?Promise.all(b):b}return v.Once(this.result.root,this.helpers)}else if(typeof v=="function")return v(this.result.root,this.result)}catch(b){throw this.handleError(b)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let v=this.result.opts,b=o;v.syntax&&(b=v.syntax.stringify),v.stringifier&&(b=v.stringifier),b.stringify&&(b=b.stringify);let R=new r(b,this.result.root,this.result.opts).generate();return this.result.css=R[0],this.result.map=R[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let v of this.plugins){let b=this.runOnRoot(v);if(m(b))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let v=this.result.root;for(;!v[e];)v[e]=!0,this.walkSync(v);if(this.listeners.OnceExit)if(v.type==="document")for(let b of v.nodes)this.visitSync(this.listeners.OnceExit,b);else this.visitSync(this.listeners.OnceExit,v)}return this.result}then(v,b){return this.async().then(v,b)}toString(){return this.css}visitSync(v,b){for(let[C,R]of v){this.result.lastPlugin=C;let A;try{A=R(b,this.helpers)}catch(N){throw this.handleError(N,b.proxyOf)}if(b.type!=="root"&&b.type!=="document"&&!b.parent)return!0;if(m(A))throw this.getAsyncError()}}visitTick(v){let b=v[v.length-1],{node:C,visitors:R}=b;if(C.type!=="root"&&C.type!=="document"&&!C.parent){v.pop();return}if(R.length>0&&b.visitorIndex<R.length){let[N,k]=R[b.visitorIndex];b.visitorIndex+=1,b.visitorIndex===R.length&&(b.visitors=[],b.visitorIndex=0),this.result.lastPlugin=N;try{return k(C.toProxy(),this.helpers)}catch(D){throw this.handleError(D,C)}}if(b.iterator!==0){let N=b.iterator,k;for(;k=C.nodes[C.indexes[N]];)if(C.indexes[N]+=1,!k[e]){k[e]=!0,v.push(g(k));return}b.iterator=0,delete C.indexes[N]}let A=b.events;for(;b.eventIndex<A.length;){let N=A[b.eventIndex];if(b.eventIndex+=1,N===f){C.nodes&&C.nodes.length&&(C[e]=!0,b.iterator=C.getIterator());return}else if(this.listeners[N]){b.visitors=this.listeners[N];return}}v.pop()}walkSync(v){v[e]=!0;let b=d(v);for(let C of b)if(C===f)v.nodes&&v.each(R=>{R[e]||this.walkSync(R)});else{let R=this.listeners[C];if(R&&this.visitSync(R,v.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}return S.registerPostcss=x=>{w=x},Rt=S,S.default=S,c.registerLazyResult(S),u.registerLazyResult(S),Rt}var Nt,mi;function pn(){if(mi)return Nt;mi=1;let e=ys(),t=We(),r=ws(),o=Dr(),s=Mr();class u{constructor(a,h,c){h=h.toString(),this.stringified=!1,this._processor=a,this._css=h,this._opts=c,this._map=void 0;let i,p=t;this.result=new s(this._processor,i,this._opts),this.result.css=h;let l=this;Object.defineProperty(this.result,"root",{get(){return l.root}});let f=new e(p,i,this._opts,h);if(f.isMap()){let[m,d]=f.generate();m&&(this.result.css=m),d&&(this.result.map=d)}else f.clearAnnotation(),this.result.css=f.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(a){return this.async().catch(a)}finally(a){return this.async().then(a,a)}sync(){if(this.error)throw this.error;return this.result}then(a,h){return this.async().then(a,h)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let a,h=o;try{a=h(this._css,this._opts)}catch(c){this.error=c}if(this.error)throw this.error;return this._root=a,a}get[Symbol.toStringTag](){return"NoWorkResult"}}return Nt=u,u.default=u,Nt}var Mt,gi;function dn(){if(gi)return Mt;gi=1;let e=pn(),t=Ss(),r=Nr(),o=Ce();class s{constructor(n=[]){this.version="8.4.38",this.plugins=this.normalize(n)}normalize(n){let a=[];for(let h of n)if(h.postcss===!0?h=h():h.postcss&&(h=h.postcss),typeof h=="object"&&Array.isArray(h.plugins))a=a.concat(h.plugins);else if(typeof h=="object"&&h.postcssPlugin)a.push(h);else if(typeof h=="function")a.push(h);else if(!(typeof h=="object"&&(h.parse||h.stringify)))throw new Error(h+" is not a PostCSS plugin");return a}process(n,a={}){return!this.plugins.length&&!a.parser&&!a.stringifier&&!a.syntax?new e(this,n,a):new t(this,n,a)}use(n){return this.plugins=this.plugins.concat(this.normalize([n])),this}}return Mt=s,s.default=s,o.registerProcessor(s),r.registerProcessor(s),Mt}var At,yi;function mn(){if(yi)return At;yi=1;let e=je(),t=gs(),r=Ge(),o=Ar(),s=Ve(),u=Ce(),n=Or();function a(h,c){if(Array.isArray(h))return h.map(l=>a(l));let{inputs:i,...p}=h;if(i){c=[];for(let l of i){let f={...l,__proto__:s.prototype};f.map&&(f.map={...f.map,__proto__:t.prototype}),c.push(f)}}if(p.nodes&&(p.nodes=h.nodes.map(l=>a(l,c))),p.source){let{inputId:l,...f}=p.source;p.source=f,l!=null&&(p.source.input=c[l])}if(p.type==="root")return new u(p);if(p.type==="decl")return new e(p);if(p.type==="rule")return new n(p);if(p.type==="comment")return new r(p);if(p.type==="atrule")return new o(p);throw new Error("Unknown node type: "+h.type)}return At=a,a.default=a,At}var Ot,wi;function gn(){if(wi)return Ot;wi=1;let e=Er(),t=je(),r=Ss(),o=le(),s=dn(),u=We(),n=mn(),a=Nr(),h=vs(),c=Ge(),i=Ar(),p=Mr(),l=Ve(),f=Dr(),m=bs(),d=Or(),g=Ce(),y=qe();function w(...S){return S.length===1&&Array.isArray(S[0])&&(S=S[0]),new s(S)}return w.plugin=function(x,v){let b=!1;function C(...A){console&&console.warn&&!b&&(b=!0,console.warn(x+`: postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(x+`: \\u91CC\\u9762 postcss.plugin \\u88AB\\u5F03\\u7528. \\u8FC1\\u79FB\\u6307\\u5357:\nhttps://www.w3ctech.com/topic/2226`));let N=v(...A);return N.postcssPlugin=x,N.postcssVersion=new s().version,N}let R;return Object.defineProperty(C,"postcss",{get(){return R||(R=C()),R}}),C.process=function(A,N,k){return w([C(k)]).process(A,N)},C},w.stringify=u,w.parse=f,w.fromJSON=n,w.list=m,w.comment=S=>new c(S),w.atRule=S=>new i(S),w.decl=S=>new t(S),w.rule=S=>new d(S),w.root=S=>new g(S),w.document=S=>new a(S),w.CssSyntaxError=e,w.Declaration=t,w.Container=o,w.Processor=s,w.Document=a,w.Comment=c,w.Warning=h,w.AtRule=i,w.Result=p,w.Input=l,w.Rule=d,w.Root=g,w.Node=y,r.registerPostcss(w),Ot=w,w.default=w,Ot}var yn=gn(),U=nn(yn);U.stringify;U.fromJSON;U.plugin;U.parse;U.list;U.document;U.comment;U.atRule;U.rule;U.decl;U.root;U.CssSyntaxError;U.Declaration;U.Container;U.Processor;U.Document;U.Comment;U.Warning;U.AtRule;U.Result;U.Input;U.Rule;U.Root;U.Node;var vi={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 wn(e){let t=vi[e.tagName]?vi[e.tagName]:e.tagName;return t==="link"&&e.attributes._cssText&&(t="style"),t}function Ye(e,t){let r=t?.stylesWithHoverClass.get(e);if(r)return r;let o=e;try{o=U([rn,sn]).process(e).css}catch(s){console.warn("Failed to adapt css for replay",s)}return t?.stylesWithHoverClass.set(e,o),o}function bi(){return{stylesWithHoverClass:new Map}}var vn="rrweb-snapshot.rebuild() cannot rebuild into an unprotected browser document. Use rebuildIntoSandboxedIframe() or set UNSAFE_allowUnprotectedRebuild: true only when you accept the script-execution risk.",Si="rrweb-snapshot.createSandboxedIframe() requires root to be connected to a document before creating a sandboxed iframe.",xs=new WeakSet;function bn(e){if(!e||e.tagName!=="IFRAME"||!("sandbox"in e))return!1;let t=Array.from(e.sandbox);return t.length===1&&t[0]==="allow-same-origin"}function Sn(e){if(e.UNSAFE_allowUnprotectedRebuild)return;let t=e.doc.defaultView;if(t&&!(xs.has(e.doc)&&bn(t.frameElement)))throw new Error(vn)}function xn(e,t,r,o){let s=[];for(let c of e.childNodes)c.type===z.Text&&s.push(c);let u=t.split("/* rr_split */");for(;u.length>1&&u.length>s.length;)u.splice(-2,2,u.slice(-2).join(""));let n="";r&&(n=Ye(u.join(""),o));let a=0,h=-1;for(let c=0;c<s.length&&c!==u.length;c++){let i=s[c],p=u[c],l=c<u.length-1?u[c+1]:null;if(r&&l){let f=a,m=l.length;m=Math.min(m,30);let d=!1;for(;m>2;m--){let g=l.substring(0,m),y=n.substring(a).indexOf(g);if(d=y!==-1,d){f+=y;break}}d||(f+=p.length),p=n.substring(a,f),a=f}else r&&(p=n.substring(a));h!==-1&&(p=p.substring(h)),l&&(h!==-1||p.endsWith("0p")&&l.startsWith("x"))&&(h=l.indexOf("}"),h!==-1&&(h+=1,p+=l.substring(0,h))),i.textContent=p}}function Cn(e,t,r,o){let{doc:s,hackCss:u,cache:n}=o;e.childNodes.length?xn(e,r,u,n):(u&&(r=Ye(r,n)),t.appendChild(s.createTextNode(r)))}function En(e,t){var r;let{doc:o,hackCss:s,cache:u}=t;switch(e.type){case z.Document:return o.implementation.createDocument(null,"",null);case z.DocumentType:return o.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case z.Element:{let n=wn(e),a;e.isSVG?a=o.createElementNS("http://www.w3.org/2000/svg",n):(e.isCustom&&((r=o.defaultView)!=null&&r.customElements)&&!o.defaultView.customElements.get(e.tagName)&&o.defaultView.customElements.define(e.tagName,class extends o.defaultView.HTMLElement{}),a=o.createElement(n));let h={};for(let c in e.attributes){if(!Object.prototype.hasOwnProperty.call(e.attributes,c))continue;let i=e.attributes[c];if(!(n==="option"&&c==="selected"&&i===!1)&&i!==null){if(i===!0&&(i=""),c.startsWith("rr_")){h[c]=i;continue}if(typeof i=="string"){if(n==="style"&&c==="_cssText"){Cn(e,a,i,t);continue}else if(n==="textarea"&&c==="value"){a.appendChild(o.createTextNode(i)),e.childNodes=[];continue}}try{if(e.isSVG&&c==="xlink:href")a.setAttributeNS("http://www.w3.org/1999/xlink",c,i.toString());else if(c==="onload"||c==="onclick"||c.substring(0,7)==="onmouse")a.setAttribute("_"+c,i.toString());else if(n==="meta"&&e.attributes["http-equiv"]==="Content-Security-Policy"&&c==="content"){a.setAttribute("csp-content",i.toString());continue}else n==="link"&&(e.attributes.rel==="preload"&&e.attributes.as==="script"||e.attributes.rel==="modulepreload")||n==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&en(e.attributes.href)==="js"||(n==="img"&&e.attributes.srcset&&e.attributes.rr_dataURL?a.setAttribute("rrweb-original-srcset",e.attributes.srcset):a.setAttribute(c,i.toString()))}catch{}}}for(let c in h){let i=h[c];if(n==="canvas"&&c==="rr_dataURL"){let p=o.createElement("img");p.onload=()=>{let l=a.getContext("2d");l&&l.drawImage(p,0,0,p.width,p.height)},p.src=i.toString(),a.RRNodeType&&(a.rr_dataURL=i.toString())}else if(n==="img"&&c==="rr_dataURL"){let p=a;p.currentSrc.startsWith("data:")||(p.setAttribute("rrweb-original-src",e.attributes.src),p.src=i.toString())}if(c==="rr_width")a.style.setProperty("width",i.toString());else if(c==="rr_height")a.style.setProperty("height",i.toString());else if(c==="rr_mediaCurrentTime"&&typeof i=="number")a.currentTime=i;else if(c==="rr_mediaState")switch(i){case"played":a.play().catch(p=>console.warn("media playback error",p));break;case"paused":a.pause();break}else c==="rr_mediaPlaybackRate"&&typeof i=="number"?a.playbackRate=i:c==="rr_mediaMuted"&&typeof i=="boolean"?a.muted=i:c==="rr_mediaLoop"&&typeof i=="boolean"?a.loop=i:c==="rr_mediaVolume"&&typeof i=="number"?a.volume=i:c==="rr_open_mode"&&a.setAttribute("rr_open_mode",i)}if(e.isShadowHost)if(!a.shadowRoot)a.attachShadow({mode:"open"});else for(;a.shadowRoot.firstChild;)a.shadowRoot.removeChild(a.shadowRoot.firstChild);return(n==="input"||n==="textarea")&&a.setAttribute("autocomplete","off"),a}case z.Text:return e.isStyle&&s?o.createTextNode(Ye(e.textContent,u)):o.createTextNode(e.textContent);case z.CDATA:return o.createCDATASection(e.textContent);case z.Comment:return o.createComment(e.textContent);default:return null}}function xe(e,t){let{doc:r,mirror:o,skipChild:s=!1,hackCss:u=!0,afterAppend:n,cache:a}=t;if(o.has(e.id)){let c=o.getNode(e.id),i=o.getMeta(c);if(Ks(i,e))return o.getNode(e.id)}let h=En(e,{doc:r,hackCss:u,cache:a});if(!h)return null;if(e.rootId&&o.getNode(e.rootId)!==r&&o.replace(e.rootId,r),e.type===z.Document&&(r.close(),r.open(),e.compatMode==="BackCompat"&&e.childNodes&&e.childNodes[0].type!==z.DocumentType&&(e.childNodes[0].type===z.Element&&"xmlns"in e.childNodes[0].attributes&&e.childNodes[0].attributes.xmlns==="http://www.w3.org/1999/xhtml"?r.write(\'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">\'):r.write(\'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">\')),h=r),o.add(h,e),(e.type===z.Document||e.type===z.Element)&&!s)for(let c of e.childNodes){let i=xe(c,{doc:r,mirror:o,skipChild:!1,hackCss:u,afterAppend:n,cache:a});if(!i){console.warn("Failed to rebuild",c);continue}if(c.isShadow&&Xs(h)&&h.shadowRoot)h.shadowRoot.appendChild(i);else if(e.type===z.Document&&c.type==z.Element){let p=i,l=null;p.childNodes.forEach(f=>{f.nodeName==="BODY"&&(l=f)}),l?(p.removeChild(l),h.appendChild(i),p.appendChild(l)):h.appendChild(i)}else h.appendChild(i);n&&n(i,c.id)}return h}function Rn(e,t){function r(o){t(o)}for(let o of e.getIds())e.has(o)&&r(e.getNode(o))}function Nn(e,t){let r=t.getMeta(e);if(r?.type!==z.Element)return;let o=e;for(let s in r.attributes){if(!(Object.prototype.hasOwnProperty.call(r.attributes,s)&&s.startsWith("rr_")))continue;let u=r.attributes[s];s==="rr_scrollLeft"&&(o.scrollLeft=u),s==="rr_scrollTop"&&(o.scrollTop=u)}}function Mn(e,t){Sn(t);let{doc:r,onVisit:o,hackCss:s=!0,afterAppend:u,cache:n,mirror:a=new _e}=t,h=xe(e,{doc:r,mirror:a,skipChild:!1,hackCss:s,afterAppend:u,cache:n});return Rn(a,c=>{o&&o(c),Nn(c,a)}),h}function An(e){var t;if(!e.root.isConnected)throw new Error(Si);let r=e.root.ownerDocument.createElement("iframe");for(let[s,u]of Object.entries(e.iframeAttributes||{}))s!=="sandbox"&&r.setAttribute(s,u);r.setAttribute("sandbox","allow-same-origin"),e.root.appendChild(r);let o=r.contentDocument;if(!o||!r.contentWindow)throw(t=r.parentNode)==null||t.removeChild(r),new Error(Si);return xs.add(o),r}var On=Object.defineProperty,Dn=(e,t,r)=>t in e?On(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,O=(e,t,r)=>Dn(e,typeof t!="symbol"?t+"":t,r),Tn=Object.defineProperty,_n=(e,t,r)=>t in e?Tn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,xi=(e,t,r)=>_n(e,typeof t!="symbol"?t+"":t,r);Date.now().toString();var Pn=class{constructor(){xi(this,"idNodeMap",new Map),xi(this,"nodeMetaMap",new WeakMap)}getId(t){var r;return t?((r=this.getMeta(t))==null?void 0:r.id)??-1:-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){let r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(o=>this.removeNodeFromMap(o))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){let o=r.id;this.idNodeMap.set(o,t),this.nodeMetaMap.set(t,r)}replace(t,r){let o=this.getNode(t);if(o){let s=this.nodeMetaMap.get(o);s&&this.nodeMetaMap.set(r,s)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function In(){return new Pn}function Ln(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function kn(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function o(){return this instanceof o?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(o){var s=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(r,o,s.get?s:{enumerable:!0,get:function(){return e[o]}})}),r}var Me={exports:{}},Ci;function Fn(){if(Ci)return Me.exports;Ci=1;var e=String,t=function(){return{isColorSupported:!1,reset:e,bold:e,dim:e,italic:e,underline:e,inverse:e,hidden:e,strikethrough:e,black:e,red:e,green:e,yellow:e,blue:e,magenta:e,cyan:e,white:e,gray:e,bgBlack:e,bgRed:e,bgGreen:e,bgYellow:e,bgBlue:e,bgMagenta:e,bgCyan:e,bgWhite:e}};return Me.exports=t(),Me.exports.createColors=t,Me.exports}var Un={},Bn=Object.freeze(Object.defineProperty({__proto__:null,default:Un},Symbol.toStringTag,{value:"Module"})),Q=kn(Bn),Dt,Ei;function Tr(){if(Ei)return Dt;Ei=1;let e=Fn(),t=Q;class r extends Error{constructor(s,u,n,a,h,c){super(s),this.name="CssSyntaxError",this.reason=s,h&&(this.file=h),a&&(this.source=a),c&&(this.plugin=c),typeof u<"u"&&typeof n<"u"&&(typeof u=="number"?(this.line=u,this.column=n):(this.line=u.line,this.column=u.column,this.endLine=n.line,this.endColumn=n.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,r)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(s){if(!this.source)return"";let u=this.source;s==null&&(s=e.isColorSupported),t&&s&&(u=t(u));let n=u.split(/\\r?\\n/),a=Math.max(this.line-3,0),h=Math.min(this.line+2,n.length),c=String(h).length,i,p;if(s){let{bold:l,gray:f,red:m}=e.createColors(!0);i=d=>l(m(d)),p=d=>f(d)}else i=p=l=>l;return n.slice(a,h).map((l,f)=>{let m=a+1+f,d=" "+(" "+m).slice(-c)+" | ";if(m===this.line){let g=p(d.replace(/\\d/g," "))+l.slice(0,this.column-1).replace(/[^\\t]/g," ");return i(">")+p(d)+l+`\n `+g+i("^")}return" "+p(d)+l}).join(`\n`)}toString(){let s=this.showSourceCode();return s&&(s=`\n\n`+s+`\n`),this.name+": "+this.message+s}}return Dt=r,r.default=r,Dt}var Ae={},Ri;function _r(){return Ri||(Ri=1,Ae.isClean=Symbol("isClean"),Ae.my=Symbol("my")),Ae}var Tt,Ni;function Cs(){if(Ni)return Tt;Ni=1;let e={after:`\n`,beforeClose:`\n`,beforeComment:`\n`,beforeDecl:`\n`,beforeOpen:" ",beforeRule:`\n`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function t(o){return o[0].toUpperCase()+o.slice(1)}class r{constructor(s){this.builder=s}atrule(s,u){let n="@"+s.name,a=s.params?this.rawValue(s,"params"):"";if(typeof s.raws.afterName<"u"?n+=s.raws.afterName:a&&(n+=" "),s.nodes)this.block(s,n+a);else{let h=(s.raws.between||"")+(u?";":"");this.builder(n+a+h,s)}}beforeAfter(s,u){let n;s.type==="decl"?n=this.raw(s,null,"beforeDecl"):s.type==="comment"?n=this.raw(s,null,"beforeComment"):u==="before"?n=this.raw(s,null,"beforeRule"):n=this.raw(s,null,"beforeClose");let a=s.parent,h=0;for(;a&&a.type!=="root";)h+=1,a=a.parent;if(n.includes(`\n`)){let c=this.raw(s,null,"indent");if(c.length)for(let i=0;i<h;i++)n+=c}return n}block(s,u){let n=this.raw(s,"between","beforeOpen");this.builder(u+n+"{",s,"start");let a;s.nodes&&s.nodes.length?(this.body(s),a=this.raw(s,"after")):a=this.raw(s,"after","emptyBody"),a&&this.builder(a),this.builder("}",s,"end")}body(s){let u=s.nodes.length-1;for(;u>0&&s.nodes[u].type==="comment";)u-=1;let n=this.raw(s,"semicolon");for(let a=0;a<s.nodes.length;a++){let h=s.nodes[a],c=this.raw(h,"before");c&&this.builder(c),this.stringify(h,u!==a||n)}}comment(s){let u=this.raw(s,"left","commentLeft"),n=this.raw(s,"right","commentRight");this.builder("/*"+u+s.text+n+"*/",s)}decl(s,u){let n=this.raw(s,"between","colon"),a=s.prop+n+this.rawValue(s,"value");s.important&&(a+=s.raws.important||" !important"),u&&(a+=";"),this.builder(a,s)}document(s){this.body(s)}raw(s,u,n){let a;if(n||(n=u),u&&(a=s.raws[u],typeof a<"u"))return a;let h=s.parent;if(n==="before"&&(!h||h.type==="root"&&h.first===s||h&&h.type==="document"))return"";if(!h)return e[n];let c=s.root();if(c.rawCache||(c.rawCache={}),typeof c.rawCache[n]<"u")return c.rawCache[n];if(n==="before"||n==="after")return this.beforeAfter(s,n);{let i="raw"+t(n);this[i]?a=this[i](c,s):c.walk(p=>{if(a=p.raws[u],typeof a<"u")return!1})}return typeof a>"u"&&(a=e[n]),c.rawCache[n]=a,a}rawBeforeClose(s){let u;return s.walk(n=>{if(n.nodes&&n.nodes.length>0&&typeof n.raws.after<"u")return u=n.raws.after,u.includes(`\n`)&&(u=u.replace(/[^\\n]+$/,"")),!1}),u&&(u=u.replace(/\\S/g,"")),u}rawBeforeComment(s,u){let n;return s.walkComments(a=>{if(typeof a.raws.before<"u")return n=a.raws.before,n.includes(`\n`)&&(n=n.replace(/[^\\n]+$/,"")),!1}),typeof n>"u"?n=this.raw(u,null,"beforeDecl"):n&&(n=n.replace(/\\S/g,"")),n}rawBeforeDecl(s,u){let n;return s.walkDecls(a=>{if(typeof a.raws.before<"u")return n=a.raws.before,n.includes(`\n`)&&(n=n.replace(/[^\\n]+$/,"")),!1}),typeof n>"u"?n=this.raw(u,null,"beforeRule"):n&&(n=n.replace(/\\S/g,"")),n}rawBeforeOpen(s){let u;return s.walk(n=>{if(n.type!=="decl"&&(u=n.raws.between,typeof u<"u"))return!1}),u}rawBeforeRule(s){let u;return s.walk(n=>{if(n.nodes&&(n.parent!==s||s.first!==n)&&typeof n.raws.before<"u")return u=n.raws.before,u.includes(`\n`)&&(u=u.replace(/[^\\n]+$/,"")),!1}),u&&(u=u.replace(/\\S/g,"")),u}rawColon(s){let u;return s.walkDecls(n=>{if(typeof n.raws.between<"u")return u=n.raws.between.replace(/[^\\s:]/g,""),!1}),u}rawEmptyBody(s){let u;return s.walk(n=>{if(n.nodes&&n.nodes.length===0&&(u=n.raws.after,typeof u<"u"))return!1}),u}rawIndent(s){if(s.raws.indent)return s.raws.indent;let u;return s.walk(n=>{let a=n.parent;if(a&&a!==s&&a.parent&&a.parent===s&&typeof n.raws.before<"u"){let h=n.raws.before.split(`\n`);return u=h[h.length-1],u=u.replace(/\\S/g,""),!1}}),u}rawSemicolon(s){let u;return s.walk(n=>{if(n.nodes&&n.nodes.length&&n.last.type==="decl"&&(u=n.raws.semicolon,typeof u<"u"))return!1}),u}rawValue(s,u){let n=s[u],a=s.raws[u];return a&&a.value===n?a.raw:n}root(s){this.body(s),s.raws.after&&this.builder(s.raws.after)}rule(s){this.block(s,this.rawValue(s,"selector")),s.raws.ownSemicolon&&this.builder(s.raws.ownSemicolon,s,"end")}stringify(s,u){if(!this[s.type])throw new Error("Unknown AST node type "+s.type+". Maybe you need to change PostCSS stringifier.");this[s.type](s,u)}}return Tt=r,r.default=r,Tt}var _t,Mi;function He(){if(Mi)return _t;Mi=1;let e=Cs();function t(r,o){new e(o).stringify(r)}return _t=t,t.default=t,_t}var Pt,Ai;function Je(){if(Ai)return Pt;Ai=1;let{isClean:e,my:t}=_r(),r=Tr(),o=Cs(),s=He();function u(a,h){let c=new a.constructor;for(let i in a){if(!Object.prototype.hasOwnProperty.call(a,i)||i==="proxyCache")continue;let p=a[i],l=typeof p;i==="parent"&&l==="object"?h&&(c[i]=h):i==="source"?c[i]=p:Array.isArray(p)?c[i]=p.map(f=>u(f,c)):(l==="object"&&p!==null&&(p=u(p)),c[i]=p)}return c}class n{constructor(h={}){this.raws={},this[e]=!1,this[t]=!0;for(let c in h)if(c==="nodes"){this.nodes=[];for(let i of h[c])typeof i.clone=="function"?this.append(i.clone()):this.append(i)}else this[c]=h[c]}addToError(h){if(h.postcssNode=this,h.stack&&this.source&&/\\n\\s{4}at /.test(h.stack)){let c=this.source;h.stack=h.stack.replace(/\\n\\s{4}at /,`$&${c.input.from}:${c.start.line}:${c.start.column}$&`)}return h}after(h){return this.parent.insertAfter(this,h),this}assign(h={}){for(let c in h)this[c]=h[c];return this}before(h){return this.parent.insertBefore(this,h),this}cleanRaws(h){delete this.raws.before,delete this.raws.after,h||delete this.raws.between}clone(h={}){let c=u(this);for(let i in h)c[i]=h[i];return c}cloneAfter(h={}){let c=this.clone(h);return this.parent.insertAfter(this,c),c}cloneBefore(h={}){let c=this.clone(h);return this.parent.insertBefore(this,c),c}error(h,c={}){if(this.source){let{end:i,start:p}=this.rangeBy(c);return this.source.input.error(h,{column:p.column,line:p.line},{column:i.column,line:i.line},c)}return new r(h)}getProxyProcessor(){return{get(h,c){return c==="proxyOf"?h:c==="root"?()=>h.root().toProxy():h[c]},set(h,c,i){return h[c]===i||(h[c]=i,(c==="prop"||c==="value"||c==="name"||c==="params"||c==="important"||c==="text")&&h.markDirty()),!0}}}markDirty(){if(this[e]){this[e]=!1;let h=this;for(;h=h.parent;)h[e]=!1}}next(){if(!this.parent)return;let h=this.parent.index(this);return this.parent.nodes[h+1]}positionBy(h,c){let i=this.source.start;if(h.index)i=this.positionInside(h.index,c);else if(h.word){c=this.toString();let p=c.indexOf(h.word);p!==-1&&(i=this.positionInside(p,c))}return i}positionInside(h,c){let i=c||this.toString(),p=this.source.start.column,l=this.source.start.line;for(let f=0;f<h;f++)i[f]===`\n`?(p=1,l+=1):p+=1;return{column:p,line:l}}prev(){if(!this.parent)return;let h=this.parent.index(this);return this.parent.nodes[h-1]}rangeBy(h){let c={column:this.source.start.column,line:this.source.start.line},i=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:c.column+1,line:c.line};if(h.word){let p=this.toString(),l=p.indexOf(h.word);l!==-1&&(c=this.positionInside(l,p),i=this.positionInside(l+h.word.length,p))}else h.start?c={column:h.start.column,line:h.start.line}:h.index&&(c=this.positionInside(h.index)),h.end?i={column:h.end.column,line:h.end.line}:typeof h.endIndex=="number"?i=this.positionInside(h.endIndex):h.index&&(i=this.positionInside(h.index+1));return(i.line<c.line||i.line===c.line&&i.column<=c.column)&&(i={column:c.column+1,line:c.line}),{end:i,start:c}}raw(h,c){return new o().raw(this,h,c)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...h){if(this.parent){let c=this,i=!1;for(let p of h)p===this?i=!0:i?(this.parent.insertAfter(c,p),c=p):this.parent.insertBefore(c,p);i||this.remove()}return this}root(){let h=this;for(;h.parent&&h.parent.type!=="document";)h=h.parent;return h}toJSON(h,c){let i={},p=c==null;c=c||new Map;let l=0;for(let f in this){if(!Object.prototype.hasOwnProperty.call(this,f)||f==="parent"||f==="proxyCache")continue;let m=this[f];if(Array.isArray(m))i[f]=m.map(d=>typeof d=="object"&&d.toJSON?d.toJSON(null,c):d);else if(typeof m=="object"&&m.toJSON)i[f]=m.toJSON(null,c);else if(f==="source"){let d=c.get(m.input);d==null&&(d=l,c.set(m.input,l),l++),i[f]={end:m.end,inputId:d,start:m.start}}else i[f]=m}return p&&(i.inputs=[...c.keys()].map(f=>f.toJSON())),i}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(h=s){h.stringify&&(h=h.stringify);let c="";return h(this,i=>{c+=i}),c}warn(h,c,i){let p={node:this};for(let l in i)p[l]=i[l];return h.warn(c,p)}get proxyOf(){return this}}return Pt=n,n.default=n,Pt}var It,Oi;function Qe(){if(Oi)return It;Oi=1;let e=Je();class t extends e{constructor(o){o&&typeof o.value<"u"&&typeof o.value!="string"&&(o={...o,value:String(o.value)}),super(o),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}}return It=t,t.default=t,It}var Lt,Di;function $n(){if(Di)return Lt;Di=1;let e="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";return Lt={nanoid:(o=21)=>{let s="",u=o;for(;u--;)s+=e[Math.random()*64|0];return s},customAlphabet:(o,s=21)=>(u=s)=>{let n="",a=u;for(;a--;)n+=o[Math.random()*o.length|0];return n}},Lt}var kt,Ti;function Es(){if(Ti)return kt;Ti=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Q,{existsSync:r,readFileSync:o}=Q,{dirname:s,join:u}=Q;function n(h){return Buffer?Buffer.from(h,"base64").toString():window.atob(h)}class a{constructor(c,i){if(i.map===!1)return;this.loadAnnotation(c),this.inline=this.startWith(this.annotation,"data:");let p=i.map?i.map.prev:void 0,l=this.loadMap(i.from,p);!this.mapFile&&i.from&&(this.mapFile=i.from),this.mapFile&&(this.root=s(this.mapFile)),l&&(this.text=l)}consumer(){return this.consumerCache||(this.consumerCache=new e(this.text)),this.consumerCache}decodeInline(c){let i=/^data:application\\/json;charset=utf-?8;base64,/,p=/^data:application\\/json;base64,/,l=/^data:application\\/json;charset=utf-?8,/,f=/^data:application\\/json,/;if(l.test(c)||f.test(c))return decodeURIComponent(c.substr(RegExp.lastMatch.length));if(i.test(c)||p.test(c))return n(c.substr(RegExp.lastMatch.length));let m=c.match(/data:application\\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+m)}getAnnotationURL(c){return c.replace(/^\\/\\*\\s*# sourceMappingURL=/,"").trim()}isMap(c){return typeof c!="object"?!1:typeof c.mappings=="string"||typeof c._mappings=="string"||Array.isArray(c.sections)}loadAnnotation(c){let i=c.match(/\\/\\*\\s*# sourceMappingURL=/gm);if(!i)return;let p=c.lastIndexOf(i.pop()),l=c.indexOf("*/",p);p>-1&&l>-1&&(this.annotation=this.getAnnotationURL(c.substring(p,l)))}loadFile(c){if(this.root=s(c),r(c))return this.mapFile=c,o(c,"utf-8").toString().trim()}loadMap(c,i){if(i===!1)return!1;if(i){if(typeof i=="string")return i;if(typeof i=="function"){let p=i(c);if(p){let l=this.loadFile(p);if(!l)throw new Error("Unable to load previous source map: "+p.toString());return l}}else{if(i instanceof e)return t.fromSourceMap(i).toString();if(i instanceof t)return i.toString();if(this.isMap(i))return JSON.stringify(i);throw new Error("Unsupported previous source map format: "+i.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let p=this.annotation;return c&&(p=u(s(c),p)),this.loadFile(p)}}}startWith(c,i){return c?c.substr(0,i.length)===i:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return kt=a,a.default=a,kt}var Ft,_i;function Xe(){if(_i)return Ft;_i=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Q,{fileURLToPath:r,pathToFileURL:o}=Q,{isAbsolute:s,resolve:u}=Q,{nanoid:n}=$n(),a=Q,h=Tr(),c=Es(),i=Symbol("fromOffsetCache"),p=!!(e&&t),l=!!(u&&s);class f{constructor(d,g={}){if(d===null||typeof d>"u"||typeof d=="object"&&!d.toString)throw new Error(`PostCSS received ${d} instead of CSS string`);if(this.css=d.toString(),this.css[0]==="\\uFEFF"||this.css[0]==="\\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,g.from&&(!l||/^\\w+:\\/\\//.test(g.from)||s(g.from)?this.file=g.from:this.file=u(g.from)),l&&p){let y=new c(this.css,g);if(y.text){this.map=y;let w=y.consumer().file;!this.file&&w&&(this.file=this.mapResolve(w))}}this.file||(this.id="<input css "+n(6)+">"),this.map&&(this.map.file=this.from)}error(d,g,y,w={}){let S,x,v;if(g&&typeof g=="object"){let C=g,R=y;if(typeof C.offset=="number"){let A=this.fromOffset(C.offset);g=A.line,y=A.col}else g=C.line,y=C.column;if(typeof R.offset=="number"){let A=this.fromOffset(R.offset);x=A.line,v=A.col}else x=R.line,v=R.column}else if(!y){let C=this.fromOffset(g);g=C.line,y=C.col}let b=this.origin(g,y,x,v);return b?S=new h(d,b.endLine===void 0?b.line:{column:b.column,line:b.line},b.endLine===void 0?b.column:{column:b.endColumn,line:b.endLine},b.source,b.file,w.plugin):S=new h(d,x===void 0?g:{column:y,line:g},x===void 0?y:{column:v,line:x},this.css,this.file,w.plugin),S.input={column:y,endColumn:v,endLine:x,line:g,source:this.css},this.file&&(o&&(S.input.url=o(this.file).toString()),S.input.file=this.file),S}fromOffset(d){let g,y;if(this[i])y=this[i];else{let S=this.css.split(`\n`);y=new Array(S.length);let x=0;for(let v=0,b=S.length;v<b;v++)y[v]=x,x+=S[v].length+1;this[i]=y}g=y[y.length-1];let w=0;if(d>=g)w=y.length-1;else{let S=y.length-2,x;for(;w<S;)if(x=w+(S-w>>1),d<y[x])S=x-1;else if(d>=y[x+1])w=x+1;else{w=x;break}}return{col:d-y[w]+1,line:w+1}}mapResolve(d){return/^\\w+:\\/\\//.test(d)?d:u(this.map.consumer().sourceRoot||this.map.root||".",d)}origin(d,g,y,w){if(!this.map)return!1;let S=this.map.consumer(),x=S.originalPositionFor({column:g,line:d});if(!x.source)return!1;let v;typeof y=="number"&&(v=S.originalPositionFor({column:w,line:y}));let b;s(x.source)?b=o(x.source):b=new URL(x.source,this.map.consumer().sourceRoot||o(this.map.mapFile));let C={column:x.column,endColumn:v&&v.column,endLine:v&&v.line,line:x.line,url:b.toString()};if(b.protocol==="file:")if(r)C.file=r(b);else throw new Error("file: protocol is not available in this PostCSS build");let R=S.sourceContentFor(x.source);return R&&(C.source=R),C}toJSON(){let d={};for(let g of["hasBOM","css","file","id"])this[g]!=null&&(d[g]=this[g]);return this.map&&(d.map={...this.map},d.map.consumerCache&&(d.map.consumerCache=void 0)),d}get from(){return this.file||this.id}}return Ft=f,f.default=f,a&&a.registerInput&&a.registerInput(f),Ft}var Ut,Pi;function Rs(){if(Pi)return Ut;Pi=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=Q,{dirname:r,relative:o,resolve:s,sep:u}=Q,{pathToFileURL:n}=Q,a=Xe(),h=!!(e&&t),c=!!(r&&s&&o&&u);class i{constructor(l,f,m,d){this.stringify=l,this.mapOpts=m.map||{},this.root=f,this.opts=m,this.css=d,this.originalCSS=d,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let l;this.isInline()?l="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?l=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?l=this.mapOpts.annotation(this.opts.to,this.root):l=this.outputFile()+".map";let f=`\n`;this.css.includes(`\\r\n`)&&(f=`\\r\n`),this.css+=f+"/*# sourceMappingURL="+l+" */"}applyPrevMaps(){for(let l of this.previous()){let f=this.toUrl(this.path(l.file)),m=l.root||r(l.file),d;this.mapOpts.sourcesContent===!1?(d=new e(l.text),d.sourcesContent&&(d.sourcesContent=null)):d=l.consumer(),this.map.applySourceMap(d,f,this.toUrl(this.path(m)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let l;for(let f=this.root.nodes.length-1;f>=0;f--)l=this.root.nodes[f],l.type==="comment"&&l.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(f)}else this.css&&(this.css=this.css.replace(/\\n*?\\/\\*#[\\S\\s]*?\\*\\/$/gm,""))}generate(){if(this.clearAnnotation(),c&&h&&this.isMap())return this.generateMap();{let l="";return this.stringify(this.root,f=>{l+=f}),[l]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let l=this.previous()[0].consumer();l.file=this.outputFile(),this.map=t.fromSourceMap(l,{ignoreInvalidMapping:!0})}else this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new t({file:this.outputFile(),ignoreInvalidMapping:!0});let l=1,f=1,m="<no source>",d={generated:{column:0,line:0},original:{column:0,line:0},source:""},g,y;this.stringify(this.root,(w,S,x)=>{if(this.css+=w,S&&x!=="end"&&(d.generated.line=l,d.generated.column=f-1,S.source&&S.source.start?(d.source=this.sourcePath(S),d.original.line=S.source.start.line,d.original.column=S.source.start.column-1,this.map.addMapping(d)):(d.source=m,d.original.line=1,d.original.column=0,this.map.addMapping(d))),g=w.match(/\\n/g),g?(l+=g.length,y=w.lastIndexOf(`\n`),f=w.length-y):f+=w.length,S&&x!=="start"){let v=S.parent||{raws:{}};(!(S.type==="decl"||S.type==="atrule"&&!S.nodes)||S!==v.last||v.raws.semicolon)&&(S.source&&S.source.end?(d.source=this.sourcePath(S),d.original.line=S.source.end.line,d.original.column=S.source.end.column-1,d.generated.line=l,d.generated.column=f-2,this.map.addMapping(d)):(d.source=m,d.original.line=1,d.original.column=0,d.generated.line=l,d.generated.column=f-1,this.map.addMapping(d)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(l=>l.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let l=this.mapOpts.annotation;return typeof l<"u"&&l!==!0?!1:this.previous().length?this.previous().some(f=>f.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(l=>l.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(l){if(this.mapOpts.absolute||l.charCodeAt(0)===60||/^\\w+:\\/\\//.test(l))return l;let f=this.memoizedPaths.get(l);if(f)return f;let m=this.opts.to?r(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(m=r(s(m,this.mapOpts.annotation)));let d=o(m,l);return this.memoizedPaths.set(l,d),d}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(l=>{if(l.source&&l.source.input.map){let f=l.source.input.map;this.previousMaps.includes(f)||this.previousMaps.push(f)}});else{let l=new a(this.originalCSS,this.opts);l.map&&this.previousMaps.push(l.map)}return this.previousMaps}setSourcesContent(){let l={};if(this.root)this.root.walk(f=>{if(f.source){let m=f.source.input.from;if(m&&!l[m]){l[m]=!0;let d=this.usesFileUrls?this.toFileUrl(m):this.toUrl(this.path(m));this.map.setSourceContent(d,f.source.input.css)}}});else if(this.css){let f=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(f,this.css)}}sourcePath(l){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(l.source.input.from):this.toUrl(this.path(l.source.input.from))}toBase64(l){return Buffer?Buffer.from(l).toString("base64"):window.btoa(unescape(encodeURIComponent(l)))}toFileUrl(l){let f=this.memoizedFileURLs.get(l);if(f)return f;if(n){let m=n(l).toString();return this.memoizedFileURLs.set(l,m),m}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(l){let f=this.memoizedURLs.get(l);if(f)return f;u==="\\\\"&&(l=l.replace(/\\\\/g,"/"));let m=encodeURI(l).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(l,m),m}}return Ut=i,Ut}var Bt,Ii;function Ze(){if(Ii)return Bt;Ii=1;let e=Je();class t extends e{constructor(o){super(o),this.type="comment"}}return Bt=t,t.default=t,Bt}var $t,Li;function ue(){if(Li)return $t;Li=1;let{isClean:e,my:t}=_r(),r=Qe(),o=Ze(),s=Je(),u,n,a,h;function c(l){return l.map(f=>(f.nodes&&(f.nodes=c(f.nodes)),delete f.source,f))}function i(l){if(l[e]=!1,l.proxyOf.nodes)for(let f of l.proxyOf.nodes)i(f)}class p extends s{append(...f){for(let m of f){let d=this.normalize(m,this.last);for(let g of d)this.proxyOf.nodes.push(g)}return this.markDirty(),this}cleanRaws(f){if(super.cleanRaws(f),this.nodes)for(let m of this.nodes)m.cleanRaws(f)}each(f){if(!this.proxyOf.nodes)return;let m=this.getIterator(),d,g;for(;this.indexes[m]<this.proxyOf.nodes.length&&(d=this.indexes[m],g=f(this.proxyOf.nodes[d],d),g!==!1);)this.indexes[m]+=1;return delete this.indexes[m],g}every(f){return this.nodes.every(f)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let f=this.lastEach;return this.indexes[f]=0,f}getProxyProcessor(){return{get(f,m){return m==="proxyOf"?f:f[m]?m==="each"||typeof m=="string"&&m.startsWith("walk")?(...d)=>f[m](...d.map(g=>typeof g=="function"?(y,w)=>g(y.toProxy(),w):g)):m==="every"||m==="some"?d=>f[m]((g,...y)=>d(g.toProxy(),...y)):m==="root"?()=>f.root().toProxy():m==="nodes"?f.nodes.map(d=>d.toProxy()):m==="first"||m==="last"?f[m].toProxy():f[m]:f[m]},set(f,m,d){return f[m]===d||(f[m]=d,(m==="name"||m==="params"||m==="selector")&&f.markDirty()),!0}}}index(f){return typeof f=="number"?f:(f.proxyOf&&(f=f.proxyOf),this.proxyOf.nodes.indexOf(f))}insertAfter(f,m){let d=this.index(f),g=this.normalize(m,this.proxyOf.nodes[d]).reverse();d=this.index(f);for(let w of g)this.proxyOf.nodes.splice(d+1,0,w);let y;for(let w in this.indexes)y=this.indexes[w],d<y&&(this.indexes[w]=y+g.length);return this.markDirty(),this}insertBefore(f,m){let d=this.index(f),g=d===0?"prepend":!1,y=this.normalize(m,this.proxyOf.nodes[d],g).reverse();d=this.index(f);for(let S of y)this.proxyOf.nodes.splice(d,0,S);let w;for(let S in this.indexes)w=this.indexes[S],d<=w&&(this.indexes[S]=w+y.length);return this.markDirty(),this}normalize(f,m){if(typeof f=="string")f=c(u(f).nodes);else if(typeof f>"u")f=[];else if(Array.isArray(f)){f=f.slice(0);for(let g of f)g.parent&&g.parent.removeChild(g,"ignore")}else if(f.type==="root"&&this.type!=="document"){f=f.nodes.slice(0);for(let g of f)g.parent&&g.parent.removeChild(g,"ignore")}else if(f.type)f=[f];else if(f.prop){if(typeof f.value>"u")throw new Error("Value field is missed in node creation");typeof f.value!="string"&&(f.value=String(f.value)),f=[new r(f)]}else if(f.selector)f=[new n(f)];else if(f.name)f=[new a(f)];else if(f.text)f=[new o(f)];else throw new Error("Unknown node type in node creation");return f.map(g=>(g[t]||p.rebuild(g),g=g.proxyOf,g.parent&&g.parent.removeChild(g),g[e]&&i(g),typeof g.raws.before>"u"&&m&&typeof m.raws.before<"u"&&(g.raws.before=m.raws.before.replace(/\\S/g,"")),g.parent=this.proxyOf,g))}prepend(...f){f=f.reverse();for(let m of f){let d=this.normalize(m,this.first,"prepend").reverse();for(let g of d)this.proxyOf.nodes.unshift(g);for(let g in this.indexes)this.indexes[g]=this.indexes[g]+d.length}return this.markDirty(),this}push(f){return f.parent=this,this.proxyOf.nodes.push(f),this}removeAll(){for(let f of this.proxyOf.nodes)f.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(f){f=this.index(f),this.proxyOf.nodes[f].parent=void 0,this.proxyOf.nodes.splice(f,1);let m;for(let d in this.indexes)m=this.indexes[d],m>=f&&(this.indexes[d]=m-1);return this.markDirty(),this}replaceValues(f,m,d){return d||(d=m,m={}),this.walkDecls(g=>{m.props&&!m.props.includes(g.prop)||m.fast&&!g.value.includes(m.fast)||(g.value=g.value.replace(f,d))}),this.markDirty(),this}some(f){return this.nodes.some(f)}walk(f){return this.each((m,d)=>{let g;try{g=f(m,d)}catch(y){throw m.addToError(y)}return g!==!1&&m.walk&&(g=m.walk(f)),g})}walkAtRules(f,m){return m?f instanceof RegExp?this.walk((d,g)=>{if(d.type==="atrule"&&f.test(d.name))return m(d,g)}):this.walk((d,g)=>{if(d.type==="atrule"&&d.name===f)return m(d,g)}):(m=f,this.walk((d,g)=>{if(d.type==="atrule")return m(d,g)}))}walkComments(f){return this.walk((m,d)=>{if(m.type==="comment")return f(m,d)})}walkDecls(f,m){return m?f instanceof RegExp?this.walk((d,g)=>{if(d.type==="decl"&&f.test(d.prop))return m(d,g)}):this.walk((d,g)=>{if(d.type==="decl"&&d.prop===f)return m(d,g)}):(m=f,this.walk((d,g)=>{if(d.type==="decl")return m(d,g)}))}walkRules(f,m){return m?f instanceof RegExp?this.walk((d,g)=>{if(d.type==="rule"&&f.test(d.selector))return m(d,g)}):this.walk((d,g)=>{if(d.type==="rule"&&d.selector===f)return m(d,g)}):(m=f,this.walk((d,g)=>{if(d.type==="rule")return m(d,g)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}return p.registerParse=l=>{u=l},p.registerRule=l=>{n=l},p.registerAtRule=l=>{a=l},p.registerRoot=l=>{h=l},$t=p,p.default=p,p.rebuild=l=>{l.type==="atrule"?Object.setPrototypeOf(l,a.prototype):l.type==="rule"?Object.setPrototypeOf(l,n.prototype):l.type==="decl"?Object.setPrototypeOf(l,r.prototype):l.type==="comment"?Object.setPrototypeOf(l,o.prototype):l.type==="root"&&Object.setPrototypeOf(l,h.prototype),l[t]=!0,l.nodes&&l.nodes.forEach(f=>{p.rebuild(f)})},$t}var zt,ki;function Pr(){if(ki)return zt;ki=1;let e=ue(),t,r;class o extends e{constructor(u){super({type:"document",...u}),this.nodes||(this.nodes=[])}toResult(u={}){return new t(new r,this,u).stringify()}}return o.registerLazyResult=s=>{t=s},o.registerProcessor=s=>{r=s},zt=o,o.default=o,zt}var Wt,Fi;function Ns(){if(Fi)return Wt;Fi=1;let e={};return Wt=function(r){e[r]||(e[r]=!0,typeof console<"u"&&console.warn&&console.warn(r))},Wt}var qt,Ui;function Ms(){if(Ui)return qt;Ui=1;class e{constructor(r,o={}){if(this.type="warning",this.text=r,o.node&&o.node.source){let s=o.node.rangeBy(o);this.line=s.start.line,this.column=s.start.column,this.endLine=s.end.line,this.endColumn=s.end.column}for(let s in o)this[s]=o[s]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}return qt=e,e.default=e,qt}var jt,Bi;function Ir(){if(Bi)return jt;Bi=1;let e=Ms();class t{constructor(o,s,u){this.processor=o,this.messages=[],this.root=s,this.opts=u,this.css=void 0,this.map=void 0}toString(){return this.css}warn(o,s={}){s.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(s.plugin=this.lastPlugin.postcssPlugin);let u=new e(o,s);return this.messages.push(u),u}warnings(){return this.messages.filter(o=>o.type==="warning")}get content(){return this.css}}return jt=t,t.default=t,jt}var Vt,$i;function zn(){if($i)return Vt;$i=1;let e=39,t=34,r=92,o=47,s=10,u=32,n=12,a=9,h=13,c=91,i=93,p=40,l=41,f=123,m=125,d=59,g=42,y=58,w=64,S=/[\\t\\n\\f\\r "#\'()/;[\\\\\\]{}]/g,x=/[\\t\\n\\f\\r !"#\'():;@[\\\\\\]{}]|\\/(?=\\*)/g,v=/.[\\r\\n"\'(/\\\\]/,b=/[\\da-f]/i;return Vt=function(R,A={}){let N=R.css.valueOf(),k=A.ignoreErrors,D,E,se,K,H,P,j,te,W,F,ye=N.length,M=0,ne=[],ee=[];function Ke(){return M}function oe(V){throw R.error("Unclosed "+V,M)}function et(){return ee.length===0&&M>=ye}function tt(V){if(ee.length)return ee.pop();if(M>=ye)return;let ae=V?V.ignoreUnclosed:!1;switch(D=N.charCodeAt(M),D){case s:case u:case a:case h:case n:{E=M;do E+=1,D=N.charCodeAt(E);while(D===u||D===s||D===a||D===h||D===n);F=["space",N.slice(M,E)],M=E-1;break}case c:case i:case f:case m:case y:case d:case l:{let we=String.fromCharCode(D);F=[we,we,M];break}case p:{if(te=ne.length?ne.pop()[1]:"",W=N.charCodeAt(M+1),te==="url"&&W!==e&&W!==t&&W!==u&&W!==s&&W!==a&&W!==n&&W!==h){E=M;do{if(P=!1,E=N.indexOf(")",E+1),E===-1)if(k||ae){E=M;break}else oe("bracket");for(j=E;N.charCodeAt(j-1)===r;)j-=1,P=!P}while(P);F=["brackets",N.slice(M,E+1),M,E],M=E}else E=N.indexOf(")",M+1),K=N.slice(M,E+1),E===-1||v.test(K)?F=["(","(",M]:(F=["brackets",K,M,E],M=E);break}case e:case t:{se=D===e?"\'":\'"\',E=M;do{if(P=!1,E=N.indexOf(se,E+1),E===-1)if(k||ae){E=M+1;break}else oe("string");for(j=E;N.charCodeAt(j-1)===r;)j-=1,P=!P}while(P);F=["string",N.slice(M,E+1),M,E],M=E;break}case w:{S.lastIndex=M+1,S.test(N),S.lastIndex===0?E=N.length-1:E=S.lastIndex-2,F=["at-word",N.slice(M,E+1),M,E],M=E;break}case r:{for(E=M,H=!0;N.charCodeAt(E+1)===r;)E+=1,H=!H;if(D=N.charCodeAt(E+1),H&&D!==o&&D!==u&&D!==s&&D!==a&&D!==h&&D!==n&&(E+=1,b.test(N.charAt(E)))){for(;b.test(N.charAt(E+1));)E+=1;N.charCodeAt(E+1)===u&&(E+=1)}F=["word",N.slice(M,E+1),M,E],M=E;break}default:{D===o&&N.charCodeAt(M+1)===g?(E=N.indexOf("*/",M+2)+1,E===0&&(k||ae?E=N.length:oe("comment")),F=["comment",N.slice(M,E+1),M,E],M=E):(x.lastIndex=M+1,x.test(N),x.lastIndex===0?E=N.length-1:E=x.lastIndex-2,F=["word",N.slice(M,E+1),M,E],ne.push(F),M=E);break}}return M++,F}function rt(V){ee.push(V)}return{back:rt,endOfFile:et,nextToken:tt,position:Ke}},Vt}var Gt,zi;function Lr(){if(zi)return Gt;zi=1;let e=ue();class t extends e{constructor(o){super(o),this.type="atrule"}append(...o){return this.proxyOf.nodes||(this.nodes=[]),super.append(...o)}prepend(...o){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...o)}}return Gt=t,t.default=t,e.registerAtRule(t),Gt}var Yt,Wi;function Ee(){if(Wi)return Yt;Wi=1;let e=ue(),t,r;class o extends e{constructor(u){super(u),this.type="root",this.nodes||(this.nodes=[])}normalize(u,n,a){let h=super.normalize(u);if(n){if(a==="prepend")this.nodes.length>1?n.raws.before=this.nodes[1].raws.before:delete n.raws.before;else if(this.first!==n)for(let c of h)c.raws.before=n.raws.before}return h}removeChild(u,n){let a=this.index(u);return!n&&a===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[a].raws.before),super.removeChild(u)}toResult(u={}){return new t(new r,this,u).stringify()}}return o.registerLazyResult=s=>{t=s},o.registerProcessor=s=>{r=s},Yt=o,o.default=o,e.registerRoot(o),Yt}var Ht,qi;function As(){if(qi)return Ht;qi=1;let e={comma(t){return e.split(t,[","],!0)},space(t){let r=[" ",`\n`," "];return e.split(t,r)},split(t,r,o){let s=[],u="",n=!1,a=0,h=!1,c="",i=!1;for(let p of t)i?i=!1:p==="\\\\"?i=!0:h?p===c&&(h=!1):p===\'"\'||p==="\'"?(h=!0,c=p):p==="("?a+=1:p===")"?a>0&&(a-=1):a===0&&r.includes(p)&&(n=!0),n?(u!==""&&s.push(u.trim()),u="",n=!1):u+=p;return(o||u!=="")&&s.push(u.trim()),s}};return Ht=e,e.default=e,Ht}var Jt,ji;function kr(){if(ji)return Jt;ji=1;let e=ue(),t=As();class r extends e{constructor(s){super(s),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return t.comma(this.selector)}set selectors(s){let u=this.selector?this.selector.match(/,\\s*/):null,n=u?u[0]:","+this.raw("between","beforeOpen");this.selector=s.join(n)}}return Jt=r,r.default=r,e.registerRule(r),Jt}var Qt,Vi;function Wn(){if(Vi)return Qt;Vi=1;let e=Qe(),t=zn(),r=Ze(),o=Lr(),s=Ee(),u=kr(),n={empty:!0,space:!0};function a(c){for(let i=c.length-1;i>=0;i--){let p=c[i],l=p[3]||p[2];if(l)return l}}class h{constructor(i){this.input=i,this.root=new s,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:i,start:{column:1,line:1,offset:0}}}atrule(i){let p=new o;p.name=i[1].slice(1),p.name===""&&this.unnamedAtrule(p,i),this.init(p,i[2]);let l,f,m,d=!1,g=!1,y=[],w=[];for(;!this.tokenizer.endOfFile();){if(i=this.tokenizer.nextToken(),l=i[0],l==="("||l==="["?w.push(l==="("?")":"]"):l==="{"&&w.length>0?w.push("}"):l===w[w.length-1]&&w.pop(),w.length===0)if(l===";"){p.source.end=this.getPosition(i[2]),p.source.end.offset++,this.semicolon=!0;break}else if(l==="{"){g=!0;break}else if(l==="}"){if(y.length>0){for(m=y.length-1,f=y[m];f&&f[0]==="space";)f=y[--m];f&&(p.source.end=this.getPosition(f[3]||f[2]),p.source.end.offset++)}this.end(i);break}else y.push(i);else y.push(i);if(this.tokenizer.endOfFile()){d=!0;break}}p.raws.between=this.spacesAndCommentsFromEnd(y),y.length?(p.raws.afterName=this.spacesAndCommentsFromStart(y),this.raw(p,"params",y),d&&(i=y[y.length-1],p.source.end=this.getPosition(i[3]||i[2]),p.source.end.offset++,this.spaces=p.raws.between,p.raws.between="")):(p.raws.afterName="",p.params=""),g&&(p.nodes=[],this.current=p)}checkMissedSemicolon(i){let p=this.colon(i);if(p===!1)return;let l=0,f;for(let m=p-1;m>=0&&(f=i[m],!(f[0]!=="space"&&(l+=1,l===2)));m--);throw this.input.error("Missed semicolon",f[0]==="word"?f[3]+1:f[2])}colon(i){let p=0,l,f,m;for(let[d,g]of i.entries()){if(l=g,f=l[0],f==="("&&(p+=1),f===")"&&(p-=1),p===0&&f===":")if(!m)this.doubleColon(l);else{if(m[0]==="word"&&m[1]==="progid")continue;return d}m=l}return!1}comment(i){let p=new r;this.init(p,i[2]),p.source.end=this.getPosition(i[3]||i[2]),p.source.end.offset++;let l=i[1].slice(2,-2);if(/^\\s*$/.test(l))p.text="",p.raws.left=l,p.raws.right="";else{let f=l.match(/^(\\s*)([^]*\\S)(\\s*)$/);p.text=f[2],p.raws.left=f[1],p.raws.right=f[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(i,p){let l=new e;this.init(l,i[0][2]);let f=i[i.length-1];for(f[0]===";"&&(this.semicolon=!0,i.pop()),l.source.end=this.getPosition(f[3]||f[2]||a(i)),l.source.end.offset++;i[0][0]!=="word";)i.length===1&&this.unknownWord(i),l.raws.before+=i.shift()[1];for(l.source.start=this.getPosition(i[0][2]),l.prop="";i.length;){let w=i[0][0];if(w===":"||w==="space"||w==="comment")break;l.prop+=i.shift()[1]}l.raws.between="";let m;for(;i.length;)if(m=i.shift(),m[0]===":"){l.raws.between+=m[1];break}else m[0]==="word"&&/\\w/.test(m[1])&&this.unknownWord([m]),l.raws.between+=m[1];(l.prop[0]==="_"||l.prop[0]==="*")&&(l.raws.before+=l.prop[0],l.prop=l.prop.slice(1));let d=[],g;for(;i.length&&(g=i[0][0],!(g!=="space"&&g!=="comment"));)d.push(i.shift());this.precheckMissedSemicolon(i);for(let w=i.length-1;w>=0;w--){if(m=i[w],m[1].toLowerCase()==="!important"){l.important=!0;let S=this.stringFrom(i,w);S=this.spacesFromEnd(i)+S,S!==" !important"&&(l.raws.important=S);break}else if(m[1].toLowerCase()==="important"){let S=i.slice(0),x="";for(let v=w;v>0;v--){let b=S[v][0];if(x.trim().indexOf("!")===0&&b!=="space")break;x=S.pop()[1]+x}x.trim().indexOf("!")===0&&(l.important=!0,l.raws.important=x,i=S)}if(m[0]!=="space"&&m[0]!=="comment")break}i.some(w=>w[0]!=="space"&&w[0]!=="comment")&&(l.raws.between+=d.map(w=>w[1]).join(""),d=[]),this.raw(l,"value",d.concat(i),p),l.value.includes(":")&&!p&&this.checkMissedSemicolon(i)}doubleColon(i){throw this.input.error("Double colon",{offset:i[2]},{offset:i[2]+i[1].length})}emptyRule(i){let p=new u;this.init(p,i[2]),p.selector="",p.raws.between="",this.current=p}end(i){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(i[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(i)}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(i){if(this.spaces+=i[1],this.current.nodes){let p=this.current.nodes[this.current.nodes.length-1];p&&p.type==="rule"&&!p.raws.ownSemicolon&&(p.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(i){let p=this.input.fromOffset(i);return{column:p.col,line:p.line,offset:i}}init(i,p){this.current.push(i),i.source={input:this.input,start:this.getPosition(p)},i.raws.before=this.spaces,this.spaces="",i.type!=="comment"&&(this.semicolon=!1)}other(i){let p=!1,l=null,f=!1,m=null,d=[],g=i[1].startsWith("--"),y=[],w=i;for(;w;){if(l=w[0],y.push(w),l==="("||l==="[")m||(m=w),d.push(l==="("?")":"]");else if(g&&f&&l==="{")m||(m=w),d.push("}");else if(d.length===0)if(l===";")if(f){this.decl(y,g);return}else break;else if(l==="{"){this.rule(y);return}else if(l==="}"){this.tokenizer.back(y.pop()),p=!0;break}else l===":"&&(f=!0);else l===d[d.length-1]&&(d.pop(),d.length===0&&(m=null));w=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(p=!0),d.length>0&&this.unclosedBracket(m),p&&f){if(!g)for(;y.length&&(w=y[y.length-1][0],!(w!=="space"&&w!=="comment"));)this.tokenizer.back(y.pop());this.decl(y,g)}else this.unknownWord(y)}parse(){let i;for(;!this.tokenizer.endOfFile();)switch(i=this.tokenizer.nextToken(),i[0]){case"space":this.spaces+=i[1];break;case";":this.freeSemicolon(i);break;case"}":this.end(i);break;case"comment":this.comment(i);break;case"at-word":this.atrule(i);break;case"{":this.emptyRule(i);break;default:this.other(i);break}this.endFile()}precheckMissedSemicolon(){}raw(i,p,l,f){let m,d,g=l.length,y="",w=!0,S,x;for(let v=0;v<g;v+=1)m=l[v],d=m[0],d==="space"&&v===g-1&&!f?w=!1:d==="comment"?(x=l[v-1]?l[v-1][0]:"empty",S=l[v+1]?l[v+1][0]:"empty",!n[x]&&!n[S]?y.slice(-1)===","?w=!1:y+=m[1]:w=!1):y+=m[1];if(!w){let v=l.reduce((b,C)=>b+C[1],"");i.raws[p]={raw:v,value:y}}i[p]=y}rule(i){i.pop();let p=new u;this.init(p,i[0][2]),p.raws.between=this.spacesAndCommentsFromEnd(i),this.raw(p,"selector",i),this.current=p}spacesAndCommentsFromEnd(i){let p,l="";for(;i.length&&(p=i[i.length-1][0],!(p!=="space"&&p!=="comment"));)l=i.pop()[1]+l;return l}spacesAndCommentsFromStart(i){let p,l="";for(;i.length&&(p=i[0][0],!(p!=="space"&&p!=="comment"));)l+=i.shift()[1];return l}spacesFromEnd(i){let p,l="";for(;i.length&&(p=i[i.length-1][0],p==="space");)l=i.pop()[1]+l;return l}stringFrom(i,p){let l="";for(let f=p;f<i.length;f++)l+=i[f][1];return i.splice(p,i.length-p),l}unclosedBlock(){let i=this.current.source.start;throw this.input.error("Unclosed block",i.line,i.column)}unclosedBracket(i){throw this.input.error("Unclosed bracket",{offset:i[2]},{offset:i[2]+1})}unexpectedClose(i){throw this.input.error("Unexpected }",{offset:i[2]},{offset:i[2]+1})}unknownWord(i){throw this.input.error("Unknown word",{offset:i[0][2]},{offset:i[0][2]+i[0][1].length})}unnamedAtrule(i,p){throw this.input.error("At-rule without name",{offset:p[2]},{offset:p[2]+p[1].length})}}return Qt=h,Qt}var Xt,Gi;function Fr(){if(Gi)return Xt;Gi=1;let e=ue(),t=Wn(),r=Xe();function o(s,u){let n=new r(s,u),a=new t(n);try{a.parse()}catch(h){throw h}return a.root}return Xt=o,o.default=o,e.registerParse(o),Xt}var Zt,Yi;function Os(){if(Yi)return Zt;Yi=1;let{isClean:e,my:t}=_r(),r=Rs(),o=He(),s=ue(),u=Pr(),n=Ns(),a=Ir(),h=Fr(),c=Ee(),i={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},p={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},l={Once:!0,postcssPlugin:!0,prepare:!0},f=0;function m(x){return typeof x=="object"&&typeof x.then=="function"}function d(x){let v=!1,b=i[x.type];return x.type==="decl"?v=x.prop.toLowerCase():x.type==="atrule"&&(v=x.name.toLowerCase()),v&&x.append?[b,b+"-"+v,f,b+"Exit",b+"Exit-"+v]:v?[b,b+"-"+v,b+"Exit",b+"Exit-"+v]:x.append?[b,f,b+"Exit"]:[b,b+"Exit"]}function g(x){let v;return x.type==="document"?v=["Document",f,"DocumentExit"]:x.type==="root"?v=["Root",f,"RootExit"]:v=d(x),{eventIndex:0,events:v,iterator:0,node:x,visitorIndex:0,visitors:[]}}function y(x){return x[e]=!1,x.nodes&&x.nodes.forEach(v=>y(v)),x}let w={};class S{constructor(v,b,C){this.stringified=!1,this.processed=!1;let R;if(typeof b=="object"&&b!==null&&(b.type==="root"||b.type==="document"))R=y(b);else if(b instanceof S||b instanceof a)R=y(b.root),b.map&&(typeof C.map>"u"&&(C.map={}),C.map.inline||(C.map.inline=!1),C.map.prev=b.map);else{let A=h;C.syntax&&(A=C.syntax.parse),C.parser&&(A=C.parser),A.parse&&(A=A.parse);try{R=A(b,C)}catch(N){this.processed=!0,this.error=N}R&&!R[t]&&s.rebuild(R)}this.result=new a(v,R,C),this.helpers={...w,postcss:w,result:this.result},this.plugins=this.processor.plugins.map(A=>typeof A=="object"&&A.prepare?{...A,...A.prepare(this.result)}:A)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(v){return this.async().catch(v)}finally(v){return this.async().then(v,v)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(v,b){let C=this.result.lastPlugin;try{b&&b.addToError(v),this.error=v,v.name==="CssSyntaxError"&&!v.plugin?(v.plugin=C.postcssPlugin,v.setMessage()):C.postcssVersion}catch(R){console&&console.error&&console.error(R)}return v}prepareVisitors(){this.listeners={};let v=(b,C,R)=>{this.listeners[C]||(this.listeners[C]=[]),this.listeners[C].push([b,R])};for(let b of this.plugins)if(typeof b=="object")for(let C in b){if(!p[C]&&/^[A-Z]/.test(C))throw new Error(`Unknown event ${C} in ${b.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!l[C])if(typeof b[C]=="object")for(let R in b[C])R==="*"?v(b,C,b[C][R]):v(b,C+"-"+R.toLowerCase(),b[C][R]);else typeof b[C]=="function"&&v(b,C,b[C])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let v=0;v<this.plugins.length;v++){let b=this.plugins[v],C=this.runOnRoot(b);if(m(C))try{await C}catch(R){throw this.handleError(R)}}if(this.prepareVisitors(),this.hasListener){let v=this.result.root;for(;!v[e];){v[e]=!0;let b=[g(v)];for(;b.length>0;){let C=this.visitTick(b);if(m(C))try{await C}catch(R){let A=b[b.length-1].node;throw this.handleError(R,A)}}}if(this.listeners.OnceExit)for(let[b,C]of this.listeners.OnceExit){this.result.lastPlugin=b;try{if(v.type==="document"){let R=v.nodes.map(A=>C(A,this.helpers));await Promise.all(R)}else await C(v,this.helpers)}catch(R){throw this.handleError(R)}}}return this.processed=!0,this.stringify()}runOnRoot(v){this.result.lastPlugin=v;try{if(typeof v=="object"&&v.Once){if(this.result.root.type==="document"){let b=this.result.root.nodes.map(C=>v.Once(C,this.helpers));return m(b[0])?Promise.all(b):b}return v.Once(this.result.root,this.helpers)}else if(typeof v=="function")return v(this.result.root,this.result)}catch(b){throw this.handleError(b)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let v=this.result.opts,b=o;v.syntax&&(b=v.syntax.stringify),v.stringifier&&(b=v.stringifier),b.stringify&&(b=b.stringify);let R=new r(b,this.result.root,this.result.opts).generate();return this.result.css=R[0],this.result.map=R[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let v of this.plugins){let b=this.runOnRoot(v);if(m(b))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let v=this.result.root;for(;!v[e];)v[e]=!0,this.walkSync(v);if(this.listeners.OnceExit)if(v.type==="document")for(let b of v.nodes)this.visitSync(this.listeners.OnceExit,b);else this.visitSync(this.listeners.OnceExit,v)}return this.result}then(v,b){return this.async().then(v,b)}toString(){return this.css}visitSync(v,b){for(let[C,R]of v){this.result.lastPlugin=C;let A;try{A=R(b,this.helpers)}catch(N){throw this.handleError(N,b.proxyOf)}if(b.type!=="root"&&b.type!=="document"&&!b.parent)return!0;if(m(A))throw this.getAsyncError()}}visitTick(v){let b=v[v.length-1],{node:C,visitors:R}=b;if(C.type!=="root"&&C.type!=="document"&&!C.parent){v.pop();return}if(R.length>0&&b.visitorIndex<R.length){let[N,k]=R[b.visitorIndex];b.visitorIndex+=1,b.visitorIndex===R.length&&(b.visitors=[],b.visitorIndex=0),this.result.lastPlugin=N;try{return k(C.toProxy(),this.helpers)}catch(D){throw this.handleError(D,C)}}if(b.iterator!==0){let N=b.iterator,k;for(;k=C.nodes[C.indexes[N]];)if(C.indexes[N]+=1,!k[e]){k[e]=!0,v.push(g(k));return}b.iterator=0,delete C.indexes[N]}let A=b.events;for(;b.eventIndex<A.length;){let N=A[b.eventIndex];if(b.eventIndex+=1,N===f){C.nodes&&C.nodes.length&&(C[e]=!0,b.iterator=C.getIterator());return}else if(this.listeners[N]){b.visitors=this.listeners[N];return}}v.pop()}walkSync(v){v[e]=!0;let b=d(v);for(let C of b)if(C===f)v.nodes&&v.each(R=>{R[e]||this.walkSync(R)});else{let R=this.listeners[C];if(R&&this.visitSync(R,v.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}}return S.registerPostcss=x=>{w=x},Zt=S,S.default=S,c.registerLazyResult(S),u.registerLazyResult(S),Zt}var Kt,Hi;function qn(){if(Hi)return Kt;Hi=1;let e=Rs(),t=He(),r=Ns(),o=Fr(),s=Ir();class u{constructor(a,h,c){h=h.toString(),this.stringified=!1,this._processor=a,this._css=h,this._opts=c,this._map=void 0;let i,p=t;this.result=new s(this._processor,i,this._opts),this.result.css=h;let l=this;Object.defineProperty(this.result,"root",{get(){return l.root}});let f=new e(p,i,this._opts,h);if(f.isMap()){let[m,d]=f.generate();m&&(this.result.css=m),d&&(this.result.map=d)}else f.clearAnnotation(),this.result.css=f.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(a){return this.async().catch(a)}finally(a){return this.async().then(a,a)}sync(){if(this.error)throw this.error;return this.result}then(a,h){return this.async().then(a,h)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let a,h=o;try{a=h(this._css,this._opts)}catch(c){this.error=c}if(this.error)throw this.error;return this._root=a,a}get[Symbol.toStringTag](){return"NoWorkResult"}}return Kt=u,u.default=u,Kt}var er,Ji;function jn(){if(Ji)return er;Ji=1;let e=qn(),t=Os(),r=Pr(),o=Ee();class s{constructor(n=[]){this.version="8.4.38",this.plugins=this.normalize(n)}normalize(n){let a=[];for(let h of n)if(h.postcss===!0?h=h():h.postcss&&(h=h.postcss),typeof h=="object"&&Array.isArray(h.plugins))a=a.concat(h.plugins);else if(typeof h=="object"&&h.postcssPlugin)a.push(h);else if(typeof h=="function")a.push(h);else if(!(typeof h=="object"&&(h.parse||h.stringify)))throw new Error(h+" is not a PostCSS plugin");return a}process(n,a={}){return!this.plugins.length&&!a.parser&&!a.stringifier&&!a.syntax?new e(this,n,a):new t(this,n,a)}use(n){return this.plugins=this.plugins.concat(this.normalize([n])),this}}return er=s,s.default=s,o.registerProcessor(s),r.registerProcessor(s),er}var tr,Qi;function Vn(){if(Qi)return tr;Qi=1;let e=Qe(),t=Es(),r=Ze(),o=Lr(),s=Xe(),u=Ee(),n=kr();function a(h,c){if(Array.isArray(h))return h.map(l=>a(l));let{inputs:i,...p}=h;if(i){c=[];for(let l of i){let f={...l,__proto__:s.prototype};f.map&&(f.map={...f.map,__proto__:t.prototype}),c.push(f)}}if(p.nodes&&(p.nodes=h.nodes.map(l=>a(l,c))),p.source){let{inputId:l,...f}=p.source;p.source=f,l!=null&&(p.source.input=c[l])}if(p.type==="root")return new u(p);if(p.type==="decl")return new e(p);if(p.type==="rule")return new n(p);if(p.type==="comment")return new r(p);if(p.type==="atrule")return new o(p);throw new Error("Unknown node type: "+h.type)}return tr=a,a.default=a,tr}var rr,Xi;function Gn(){if(Xi)return rr;Xi=1;let e=Tr(),t=Qe(),r=Os(),o=ue(),s=jn(),u=He(),n=Vn(),a=Pr(),h=Ms(),c=Ze(),i=Lr(),p=Ir(),l=Xe(),f=Fr(),m=As(),d=kr(),g=Ee(),y=Je();function w(...S){return S.length===1&&Array.isArray(S[0])&&(S=S[0]),new s(S)}return w.plugin=function(x,v){let b=!1;function C(...A){console&&console.warn&&!b&&(b=!0,console.warn(x+`: postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(x+`: \\u91CC\\u9762 postcss.plugin \\u88AB\\u5F03\\u7528. \\u8FC1\\u79FB\\u6307\\u5357:\nhttps://www.w3ctech.com/topic/2226`));let N=v(...A);return N.postcssPlugin=x,N.postcssVersion=new s().version,N}let R;return Object.defineProperty(C,"postcss",{get(){return R||(R=C()),R}}),C.process=function(A,N,k){return w([C(k)]).process(A,N)},C},w.stringify=u,w.parse=f,w.fromJSON=n,w.list=m,w.comment=S=>new c(S),w.atRule=S=>new i(S),w.decl=S=>new t(S),w.rule=S=>new d(S),w.root=S=>new g(S),w.document=S=>new a(S),w.CssSyntaxError=e,w.Declaration=t,w.Container=o,w.Processor=s,w.Document=a,w.Comment=c,w.Warning=h,w.AtRule=i,w.Result=p,w.Input=l,w.Rule=d,w.Root=g,w.Node=y,r.registerPostcss(w),rr=w,w.default=w,rr}var Yn=Gn(),B=Ln(Yn);B.stringify;B.fromJSON;B.plugin;B.parse;B.list;B.document;B.comment;B.atRule;B.rule;B.decl;B.root;B.CssSyntaxError;B.Declaration;B.Container;B.Processor;B.Document;B.Comment;B.Warning;B.AtRule;B.Result;B.Input;B.Rule;B.Root;B.Node;var _=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(_||{});function Hn(e){let t={},r=/;(?![^(]*\\))/g,o=/:(.+)/,s=/\\/\\*.*?\\*\\//g;return e.replace(s,"").split(r).forEach(function(u){if(u){let n=u.split(o);n.length>1&&(t[lr(n[0].trim())]=n[1].trim())}}),t}function Zi(e){let t=[];for(let r in e){let o=e[r];if(typeof o!="string")continue;let s=Zn(r);t.push(`${s}: ${o};`)}return t.join(" ")}var Jn=/-([a-z])/g,Qn=/^--[a-zA-Z0-9-]+$/,lr=e=>Qn.test(e)?e:e.replace(Jn,(t,r)=>r?r.toUpperCase():""),Xn=/\\B([A-Z])/g,Zn=e=>e.replace(Xn,"-$1").toLowerCase(),X=class e{constructor(...t){O(this,"parentElement",null),O(this,"parentNode",null),O(this,"ownerDocument"),O(this,"firstChild",null),O(this,"lastChild",null),O(this,"previousSibling",null),O(this,"nextSibling",null),O(this,"ELEMENT_NODE",1),O(this,"TEXT_NODE",3),O(this,"nodeType"),O(this,"nodeName"),O(this,"RRNodeType")}get childNodes(){let t=[],r=this.firstChild;for(;r;)t.push(r),r=r.nextSibling;return t}contains(t){if(t instanceof e){if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0}else return!1;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute \'appendChild\' on \'RRNode\': This RRNode type does not support this method.")}insertBefore(t,r){throw new Error("RRDomException: Failed to execute \'insertBefore\' on \'RRNode\': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute \'removeChild\' on \'RRNode\': This RRNode type does not support this method.")}toString(){return"RRNode"}},ur=class e extends X{constructor(...t){super(t),O(this,"nodeType",9),O(this,"nodeName","#document"),O(this,"compatMode","CSS1Compat"),O(this,"RRNodeType",_.Document),O(this,"textContent",null),this.ownerDocument=this}get documentElement(){return this.childNodes.find(t=>t.RRNodeType===_.Element&&t.tagName==="HTML")||null}get body(){var t;return((t=this.documentElement)==null?void 0:t.childNodes.find(r=>r.RRNodeType===_.Element&&r.tagName==="BODY"))||null}get head(){var t;return((t=this.documentElement)==null?void 0:t.childNodes.find(r=>r.RRNodeType===_.Element&&r.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(t){let r=t.RRNodeType;if((r===_.Element||r===_.DocumentType)&&this.childNodes.some(s=>s.RRNodeType===r))throw new Error(`RRDomException: Failed to execute \'appendChild\' on \'RRNode\': Only one ${r===_.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);let o=Ur(this,t);return o.parentElement=null,o}insertBefore(t,r){let o=t.RRNodeType;if((o===_.Element||o===_.DocumentType)&&this.childNodes.some(u=>u.RRNodeType===o))throw new Error(`RRDomException: Failed to execute \'insertBefore\' on \'RRNode\': Only one ${o===_.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);let s=Ds(this,t,r);return s.parentElement=null,s}removeChild(t){return Ts(this,t)}open(){this.firstChild=null,this.lastChild=null}close(){}write(t){let r;if(t===\'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">\'?r="-//W3C//DTD XHTML 1.0 Transitional//EN":t===\'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">\'&&(r="-//W3C//DTD HTML 4.0 Transitional//EN"),r){let o=this.createDocumentType("html",r,"");this.open(),this.appendChild(o)}}createDocument(t,r,o){return new e}createDocumentType(t,r,o){let s=new Pe(t,r,o);return s.ownerDocument=this,s}createElement(t){let r=new de(t);return r.ownerDocument=this,r}createElementNS(t,r){return this.createElement(r)}createTextNode(t){let r=new Ie(t);return r.ownerDocument=this,r}createComment(t){let r=new Le(t);return r.ownerDocument=this,r}createCDATASection(t){let r=new ke(t);return r.ownerDocument=this,r}toString(){return"RRDocument"}},Pe=class extends X{constructor(t,r,o){super(),O(this,"nodeType",10),O(this,"RRNodeType",_.DocumentType),O(this,"name"),O(this,"publicId"),O(this,"systemId"),O(this,"textContent",null),this.name=t,this.publicId=r,this.systemId=o,this.nodeName=t}toString(){return"RRDocumentType"}},de=class extends X{constructor(t){super(),O(this,"nodeType",1),O(this,"RRNodeType",_.Element),O(this,"tagName"),O(this,"attributes",{}),O(this,"shadowRoot",null),O(this,"scrollLeft"),O(this,"scrollTop"),this.tagName=t.toUpperCase(),this.nodeName=t.toUpperCase()}get textContent(){let t="";return this.childNodes.forEach(r=>t+=r.textContent),t}set textContent(t){this.firstChild=null,this.lastChild=null,this.appendChild(this.ownerDocument.createTextNode(t))}get classList(){return new fr(this.attributes.class,t=>{this.attributes.class=t})}get id(){return this.attributes.id||""}get className(){return this.attributes.class||""}get style(){let t=this.attributes.style?Hn(this.attributes.style):{},r=/\\B([A-Z])/g;return t.setProperty=(o,s,u)=>{if(r.test(o))return;let n=lr(o);s?t[n]=s:delete t[n],u==="important"&&(t[n]+=" !important"),this.attributes.style=Zi(t)},t.removeProperty=o=>{if(r.test(o))return"";let s=lr(o),u=t[s]||"";return delete t[s],this.attributes.style=Zi(t),u},t}getAttribute(t){return this.attributes[t]===void 0?null:this.attributes[t]}setAttribute(t,r){this.attributes[t]=r}setAttributeNS(t,r,o){this.setAttribute(r,o)}removeAttribute(t){delete this.attributes[t]}appendChild(t){return Ur(this,t)}insertBefore(t,r){return Ds(this,t,r)}removeChild(t){return Ts(this,t)}attachShadow(t){let r=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=r,r}dispatchEvent(t){return!0}toString(){let t="";for(let r in this.attributes)t+=`${r}="${this.attributes[r]}" `;return`${this.tagName} ${t}`}},cr=class extends de{constructor(){super(...arguments),O(this,"currentTime"),O(this,"volume"),O(this,"paused"),O(this,"muted"),O(this,"playbackRate"),O(this,"loop")}attachShadow(t){throw new Error("RRDomException: Failed to execute \'attachShadow\' on \'RRElement\': This RRElement does not support attachShadow")}play(){this.paused=!1}pause(){this.paused=!0}},hr=class extends de{constructor(){super(...arguments),O(this,"tagName","DIALOG"),O(this,"nodeName","DIALOG")}get isModal(){return this.getAttribute("rr_open_mode")==="modal"}get open(){return this.getAttribute("open")!==null}close(){this.removeAttribute("open"),this.removeAttribute("rr_open_mode")}show(){this.setAttribute("open",""),this.setAttribute("rr_open_mode","non-modal")}showModal(){this.setAttribute("open",""),this.setAttribute("rr_open_mode","modal")}},Ie=class extends X{constructor(t){super(),O(this,"nodeType",3),O(this,"nodeName","#text"),O(this,"RRNodeType",_.Text),O(this,"data"),this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRText text=${JSON.stringify(this.data)}`}},Le=class extends X{constructor(t){super(),O(this,"nodeType",8),O(this,"nodeName","#comment"),O(this,"RRNodeType",_.Comment),O(this,"data"),this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRComment text=${JSON.stringify(this.data)}`}},ke=class extends X{constructor(t){super(),O(this,"nodeName","#cdata-section"),O(this,"nodeType",4),O(this,"RRNodeType",_.CDATA),O(this,"data"),this.data=t}get textContent(){return this.data}set textContent(t){this.data=t}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}},fr=class{constructor(t,r){if(O(this,"onChange"),O(this,"classes",[]),O(this,"add",(...o)=>{for(let s of o){let u=String(s);this.classes.indexOf(u)>=0||this.classes.push(u)}this.onChange&&this.onChange(this.classes.join(" "))}),O(this,"remove",(...o)=>{this.classes=this.classes.filter(s=>o.indexOf(s)===-1),this.onChange&&this.onChange(this.classes.join(" "))}),t){let o=t.trim().split(/\\s+/);this.classes.push(...o)}this.onChange=r}};function Ur(e,t){return t.parentNode&&t.parentNode.removeChild(t),e.lastChild?(e.lastChild.nextSibling=t,t.previousSibling=e.lastChild):(e.firstChild=t,t.previousSibling=null),e.lastChild=t,t.nextSibling=null,t.parentNode=e,t.parentElement=e,t.ownerDocument=e.ownerDocument,t}function Ds(e,t,r){if(!r)return Ur(e,t);if(r.parentNode!==e)throw new Error("Failed to execute \'insertBefore\' on \'RRNode\': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return t===r||(t.parentNode&&t.parentNode.removeChild(t),t.previousSibling=r.previousSibling,r.previousSibling=t,t.nextSibling=r,t.previousSibling?t.previousSibling.nextSibling=t:e.firstChild=t,t.parentElement=e,t.parentNode=e,t.ownerDocument=e.ownerDocument),t}function Ts(e,t){if(t.parentNode!==e)throw new Error("Failed to execute \'removeChild\' on \'RRNode\': The RRNode to be removed is not a child of this RRNode.");return t.previousSibling?t.previousSibling.nextSibling=t.nextSibling:e.firstChild=t.nextSibling,t.nextSibling?t.nextSibling.previousSibling=t.previousSibling:e.lastChild=t.previousSibling,t.previousSibling=null,t.nextSibling=null,t.parentElement=null,t.parentNode=null,t}var G=(e=>(e[e.PLACEHOLDER=0]="PLACEHOLDER",e[e.ELEMENT_NODE=1]="ELEMENT_NODE",e[e.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",e[e.TEXT_NODE=3]="TEXT_NODE",e[e.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",e[e.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",e[e.ENTITY_NODE=6]="ENTITY_NODE",e[e.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",e[e.COMMENT_NODE=8]="COMMENT_NODE",e[e.DOCUMENT_NODE=9]="DOCUMENT_NODE",e[e.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",e[e.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE",e))(G||{}),pr={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},Kn={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"},Z=null;function Fe(e,t,r,o=t.mirror||t.ownerDocument.mirror){e=eo(e,t,r,o),_s(e,t,r,o),to(e,t,r)}function eo(e,t,r,o){var s;if(r.afterAppend&&!Z&&(Z=new WeakSet,setTimeout(()=>{Z=null},0)),!Br(e,t)){let u=Ue(t,r.mirror,o);(s=e.parentNode)==null||s.replaceChild(u,e),e=u}switch(t.RRNodeType){case _.Document:{if(!ce(e,t,r.mirror,o)){let u=o.getMeta(t);u&&(r.mirror.removeNodeFromMap(e),e.close(),e.open(),r.mirror.add(e,u),Z?.add(e))}break}case _.Element:{let u=e,n=t;switch(n.tagName){case"IFRAME":{let a=e.contentDocument;if(!a)break;Fe(a,t.contentDocument,r,o);break}}n.shadowRoot&&(u.shadowRoot||u.attachShadow({mode:"open"}),_s(u.shadowRoot,n.shadowRoot,r,o)),ro(u,n,o);break}}return e}function to(e,t,r){var o;switch(t.RRNodeType){case _.Document:{let s=t.scrollData;s&&r.applyScroll(s,!0);break}case _.Element:{let s=e,u=t;switch(u.scrollData&&r.applyScroll(u.scrollData,!0),u.inputData&&r.applyInput(u.inputData),u.tagName){case"AUDIO":case"VIDEO":{let n=e,a=u;a.paused!==void 0&&(a.paused?n.pause():n.play()),a.muted!==void 0&&(n.muted=a.muted),a.volume!==void 0&&(n.volume=a.volume),a.currentTime!==void 0&&(n.currentTime=a.currentTime),a.playbackRate!==void 0&&(n.playbackRate=a.playbackRate),a.loop!==void 0&&(n.loop=a.loop);break}case"CANVAS":{let n=t;if(n.rr_dataURL!==null){let a=document.createElement("img");a.onload=()=>{let h=s.getContext("2d");h&&h.drawImage(a,0,0,a.width,a.height)},a.src=n.rr_dataURL}n.canvasMutations.forEach(a=>r.applyCanvas(a.event,a.mutation,e));break}case"STYLE":{let n=s.sheet;n&&t.rules.forEach(a=>r.applyStyleSheetMutation(a,n));break}case"DIALOG":{let n=s,a=u,h=n.open,c=n.matches("dialog:modal"),i=a.open,p=a.isModal,l=c!==p,f=h!==i;if((l||h&&f)&&n.close(),i&&(f||l))try{p?n.showModal():n.show()}catch(m){console.warn(m)}break}}break}case _.Text:case _.Comment:case _.CDATA:{e.textContent!==t.data&&(e.textContent=t.data);break}}Z?.has(e)&&(Z.delete(e),(o=r.afterAppend)==null||o.call(r,e,r.mirror.getId(e)))}function ro(e,t,r){let o=e.attributes,s=t.attributes;for(let u in s){let n=s[u],a=r.getMeta(t);if(a?.isSVG&&pr[u])e.setAttributeNS(pr[u],u,n);else if(t.tagName==="CANVAS"&&u==="rr_dataURL"){let h=document.createElement("img");h.src=n,h.onload=()=>{let c=e.getContext("2d");c&&c.drawImage(h,0,0,h.width,h.height)}}else{if(t.tagName==="IFRAME"&&u==="srcdoc")continue;try{e.setAttribute(u,n)}catch(h){console.warn(h)}}}for(let{name:u}of Array.from(o))u in s||e.removeAttribute(u);t.scrollLeft&&(e.scrollLeft=t.scrollLeft),t.scrollTop&&(e.scrollTop=t.scrollTop)}function _s(e,t,r,o){let s=Array.from(e.childNodes),u=t.childNodes;if(s.length===0&&u.length===0)return;let n=0,a=s.length-1,h=0,c=u.length-1,i=s[n],p=s[a],l=u[h],f=u[c],m,d;for(;n<=a&&h<=c;)if(i===void 0)i=s[++n];else if(p===void 0)p=s[--a];else if(ce(i,l,r.mirror,o))i=s[++n],l=u[++h];else if(ce(p,f,r.mirror,o))p=s[--a],f=u[--c];else if(ce(i,f,r.mirror,o)){try{e.insertBefore(i,p.nextSibling)}catch(w){console.warn(w)}i=s[++n],f=u[--c]}else if(ce(p,l,r.mirror,o)){try{e.insertBefore(p,i)}catch(w){console.warn(w)}p=s[--a],l=u[++h]}else{if(!m){m={};for(let S=n;S<=a;S++){let x=s[S];x&&r.mirror.hasNode(x)&&(m[r.mirror.getId(x)]=S)}}d=m[o.getId(l)];let w=s[d];if(d!==void 0&&w&&ce(w,l,r.mirror,o)){try{e.insertBefore(w,i)}catch(S){console.warn(S)}s[d]=void 0}else{let S=Ue(l,r.mirror,o);e.nodeName==="#document"&&i&&(S.nodeType===S.DOCUMENT_TYPE_NODE&&i.nodeType===i.DOCUMENT_TYPE_NODE||S.nodeType===S.ELEMENT_NODE&&i.nodeType===i.ELEMENT_NODE)&&(e.removeChild(i),r.mirror.removeNodeFromMap(i),i=s[++n]);try{e.insertBefore(S,i||null)}catch(x){console.warn(x)}}l=u[++h]}if(n>a){let w=u[c+1],S=null;for(w&&(S=r.mirror.getNode(o.getId(w)));h<=c;++h){let x=Ue(u[h],r.mirror,o);try{e.insertBefore(x,S)}catch(v){console.warn(v)}}}else if(h>c)for(;n<=a;n++){let w=s[n];if(!(!w||w.parentNode!==e))try{e.removeChild(w),r.mirror.removeNodeFromMap(w)}catch(S){console.warn(S)}}let g=e.firstChild,y=t.firstChild;for(;g!==null&&y!==null;)Fe(g,y,r,o),g=g.nextSibling,y=y.nextSibling}function Ue(e,t,r){let o=r.getId(e),s=r.getMeta(e),u=null;if(o>-1&&(u=t.getNode(o)),u!==null&&Br(u,e))return u;switch(e.RRNodeType){case _.Document:u=new Document;break;case _.DocumentType:u=document.implementation.createDocumentType(e.name,e.publicId,e.systemId);break;case _.Element:{let n=e.tagName.toLowerCase();n=Kn[n]||n,s&&"isSVG"in s&&s?.isSVG?u=document.createElementNS(pr.svg,n):u=document.createElement(e.tagName);break}case _.Text:u=document.createTextNode(e.data);break;case _.Comment:u=document.createComment(e.data);break;case _.CDATA:u=document.createCDATASection(e.data);break}s&&t.add(u,{...s});try{Z?.add(u)}catch{}return u}function Br(e,t){return e.nodeType!==t.nodeType?!1:e.nodeType!==e.ELEMENT_NODE||e.tagName.toUpperCase()===t.tagName}function ce(e,t,r,o){let s=r.getId(e),u=o.getId(t);return s===-1||s!==u?!1:Br(e,t)}var me=class e extends ur{constructor(t){super(),O(this,"UNSERIALIZED_STARTING_ID",-2),O(this,"_unserializedId",this.UNSERIALIZED_STARTING_ID),O(this,"mirror",uo()),O(this,"scrollData",null),t&&(this.mirror=t)}get unserializedId(){return this._unserializedId--}createDocument(t,r,o){return new e}createDocumentType(t,r,o){let s=new io(t,r,o);return s.ownerDocument=this,s}createElement(t){let r=t.toUpperCase(),o;switch(r){case"AUDIO":case"VIDEO":o=new dr(r);break;case"IFRAME":o=new wr(r,this.mirror);break;case"CANVAS":o=new gr(r);break;case"STYLE":o=new yr(r);break;case"DIALOG":o=new mr(r);break;default:o=new ge(r);break}return o.ownerDocument=this,o}createComment(t){let r=new no(t);return r.ownerDocument=this,r}createCDATASection(t){let r=new oo(t);return r.ownerDocument=this,r}createTextNode(t){let r=new so(t);return r.ownerDocument=this,r}destroyTree(){this.firstChild=null,this.lastChild=null,this.mirror.reset()}open(){super.open(),this._unserializedId=this.UNSERIALIZED_STARTING_ID}},io=Pe,ge=class extends de{constructor(){super(...arguments),O(this,"inputData",null),O(this,"scrollData",null)}},dr=class extends cr{},mr=class extends hr{},gr=class extends ge{constructor(){super(...arguments),O(this,"rr_dataURL",null),O(this,"canvasMutations",[])}getContext(){return null}},yr=class extends ge{constructor(){super(...arguments),O(this,"rules",[])}},wr=class extends ge{constructor(t,r){super(t),O(this,"contentDocument",new me),this.contentDocument.mirror=r}},so=Ie,no=Le,oo=ke;function ao(e){return e instanceof HTMLFormElement?"FORM":e.tagName.toUpperCase()}function Ps(e,t,r,o){let s;switch(e.nodeType){case G.DOCUMENT_NODE:o&&o.nodeName==="IFRAME"?s=o.contentDocument:(s=t,s.compatMode=e.compatMode);break;case G.DOCUMENT_TYPE_NODE:{let n=e;s=t.createDocumentType(n.name,n.publicId,n.systemId);break}case G.ELEMENT_NODE:{let n=e,a=ao(n);s=t.createElement(a);let h=s;for(let{name:c,value:i}of Array.from(n.attributes))h.attributes[c]=i;n.scrollLeft&&(h.scrollLeft=n.scrollLeft),n.scrollTop&&(h.scrollTop=n.scrollTop);break}case G.TEXT_NODE:s=t.createTextNode(e.textContent||"");break;case G.CDATA_SECTION_NODE:s=t.createCDATASection(e.data);break;case G.COMMENT_NODE:s=t.createComment(e.textContent||"");break;case G.DOCUMENT_FRAGMENT_NODE:s=o.attachShadow({mode:"open"});break;default:return null}let u=r.getMeta(e);return t instanceof me&&(u||(u=Is(s,t.unserializedId),r.add(e,u)),t.mirror.add(s,{...u})),s}function lo(e,t=In(),r=new me){function o(s,u){let n=Ps(s,r,t,u);if(n!==null)if(u?.nodeName!=="IFRAME"&&s.nodeType!==G.DOCUMENT_FRAGMENT_NODE&&(u?.appendChild(n),n.parentNode=u,n.parentElement=u),s.nodeName==="IFRAME"){let a=s.contentDocument;a&&o(a,n)}else(s.nodeType===G.DOCUMENT_NODE||s.nodeType===G.ELEMENT_NODE||s.nodeType===G.DOCUMENT_FRAGMENT_NODE)&&(s.nodeType===G.ELEMENT_NODE&&s.shadowRoot&&o(s.shadowRoot,n),s.childNodes.forEach(a=>o(a,n)))}return o(e,null),r}function uo(){return new vr}var vr=class{constructor(){O(this,"idNodeMap",new Map),O(this,"nodeMetaMap",new WeakMap)}getId(t){var r;return t?((r=this.getMeta(t))==null?void 0:r.id)??-1:-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){let r=this.getId(t);this.idNodeMap.delete(r),t.childNodes&&t.childNodes.forEach(o=>this.removeNodeFromMap(o))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,r){let o=r.id;this.idNodeMap.set(o,t),this.nodeMetaMap.set(t,r)}replace(t,r){let o=this.getNode(t);if(o){let s=this.nodeMetaMap.get(o);s&&this.nodeMetaMap.set(r,s)}this.idNodeMap.set(t,r)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Is(e,t){switch(e.RRNodeType){case _.Document:return{id:t,type:e.RRNodeType,childNodes:[]};case _.DocumentType:{let r=e;return{id:t,type:e.RRNodeType,name:r.name,publicId:r.publicId,systemId:r.systemId}}case _.Element:return{id:t,type:e.RRNodeType,tagName:e.tagName.toLowerCase(),attributes:{},childNodes:[]};case _.Text:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case _.Comment:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case _.CDATA:return{id:t,type:e.RRNodeType,textContent:""}}}var Ki={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument","firstChild","lastChild","nextSibling","previousSibling"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},es={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Oe={},Ls={},co=()=>!!globalThis.Zone;function $r(e){if(Oe[e])return Oe[e];let t=globalThis[e],r=t.prototype,o=e in Ki?Ki[e]:void 0,s=!!(o&&o.every(a=>{var h,c;return!!((c=(h=Object.getOwnPropertyDescriptor(r,a))==null?void 0:h.get)!=null&&c.toString().includes("[native code]"))})),u=e in es?es[e]:void 0,n=!!(u&&u.every(a=>{var h;return typeof r[a]=="function"&&((h=r[a])==null?void 0:h.toString().includes("[native code]"))}));if(s&&n&&!co())return Oe[e]=t.prototype,t.prototype;try{let a=document.createElement("iframe");a.style.display="none",document.body.appendChild(a);let h=a.contentWindow;if(!h)return t.prototype;let c=h[e].prototype;if(!c)return a.remove(),r;let i=navigator.userAgent;return i.includes("Safari")&&!i.includes("Chrome")?(a.classList.add("rr-block"),a.setAttribute("__rrwebUntaintedMutationObserver",""),Ls[e]=()=>a.remove()):a.remove(),Oe[e]=c}catch{return r}}var ir={};function Y(e,t,r){var o,s;let u=(o=ir[e])==null?void 0:o[r];if(u)return u.call(t);let n=$r(e),a=(s=Object.getOwnPropertyDescriptor(n,r))==null?void 0:s.get;return a?((ir[e]||(ir[e]={}))[r]=a,a.call(t)):t[r]}var sr={};function ks(e,t,r){let o=`${e}.${String(r)}`;if(sr[o])return sr[o].bind(t);let u=$r(e)[r];return typeof u!="function"?t[r]:(sr[o]=u,u.bind(t))}function ho(e){return Y("Node",e,"ownerDocument")}function fo(e){return Y("Node",e,"childNodes")}function po(e){return Y("Node",e,"parentNode")}function mo(e){return Y("Node",e,"parentElement")}function go(e){return Y("Node",e,"textContent")}function yo(e){return Y("Node",e,"firstChild")}function wo(e){return Y("Node",e,"lastChild")}function vo(e){return Y("Node",e,"nextSibling")}function bo(e){return Y("Node",e,"previousSibling")}function So(e,t){return ks("Node",e,"contains")(t)}function xo(e){return ks("Node",e,"getRootNode")()}function Co(e){return!e||!("host"in e)?null:Y("ShadowRoot",e,"host")}function Eo(e){return e.styleSheets}function Ro(e){return!e||!("shadowRoot"in e)?null:Y("Element",e,"shadowRoot")}function No(e,t){return Y("Element",e,"querySelector")(t)}function Mo(e,t){return Y("Element",e,"querySelectorAll")(t)}function Ao(){return[$r("MutationObserver").constructor,Ls.MutationObserver??(()=>{})]}var Fs=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Fs=()=>new Date().getTime());function Oo(e,t,r){try{if(!(t in e))return()=>{};let o=e[t],s=r(o);return typeof s=="function"&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:o}})),e[t]=s,()=>{e[t]=o}}catch{return()=>{}}}var Do={ownerDocument:ho,childNodes:fo,parentNode:po,parentElement:mo,textContent:go,firstChild:yo,lastChild:wo,nextSibling:vo,previousSibling:bo,contains:So,getRootNode:xo,host:Co,styleSheets:Eo,shadowRoot:Ro,querySelector:No,querySelectorAll:Mo,nowTimestamp:Fs,mutationObserverCtor:Ao,patch:Oo},he=`Please stop import mirror directly. Instead of that,\\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\\r\nor you can use record.mirror to access the mirror instance during recording.`,ts={map:{},getId(){return console.error(he),-1},getNode(){return console.error(he),null},removeNodeFromMap(){console.error(he)},has(){return console.error(he),!1},reset(){console.error(he)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(ts=new Proxy(ts,{get(e,t,r){return t==="map"&&console.error(he),Reflect.get(e,t,r)}}));function To(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function _o(e){let t={},r=(s,u)=>{let n={value:s,parent:u,children:[]};return t[s.node.id]=n,n},o=[];for(let s of e){let{nextId:u,parentId:n}=s;if(u&&u in t){let a=t[u];if(a.parent){let h=a.parent.children.indexOf(a);a.parent.children.splice(h,0,r(s,a.parent))}else{let h=o.indexOf(a);o.splice(h,0,r(s,null))}continue}if(n in t){let a=t[n];a.children.push(r(s,a));continue}o.push(r(s,null))}return o}function Us(e,t){t(e.value);for(let r=e.children.length-1;r>=0;r--)Us(e.children[r],t)}function nr(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function Bs(e,t){var r,o;let s=(o=(r=e.ownerDocument)==null?void 0:r.defaultView)==null?void 0:o.frameElement;if(!s||s===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};let u=s.getBoundingClientRect(),n=Bs(s,t),a=u.height/s.clientHeight;return{x:u.x*n.relativeScale+n.x,y:u.y*n.relativeScale+n.y,relativeScale:a,absoluteScale:n.absoluteScale*a}}function De(e){return e?e instanceof X&&"shadowRoot"in e?!!e.shadowRoot:!!Do.shadowRoot(e):!1}function be(e,t){let r=e?.[t[0]];return r?t.length===1?r:be(r.cssRules,t.slice(1)):null}function rs(e){let t=[...e],r=t.pop();return{positions:t,index:r}}function Po(e){let t=new Set,r=[];for(let o=e.length;o--;){let s=e[o];t.has(s.id)||(r.push(s),t.add(s.id))}return r}var br=class{constructor(){T(this,"id",1),T(this,"styleIDMap",new WeakMap),T(this,"idStyleMap",new Map)}getId(t){return this.styleIDMap.get(t)??-1}has(t){return this.styleIDMap.has(t)}add(t,r){if(this.has(t))return this.getId(t);let o;return r===void 0?o=this.id++:o=r,this.styleIDMap.set(t,o),this.idStyleMap.set(o,t),o}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}},$=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e[e.Asset=7]="Asset",e))($||{}),L=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(L||{}),q=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(q||{}),Be=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(Be||{}),Sr=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(Sr||{}),I=(e=>(e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back",e.Destroy="destroy",e))(I||{}),re=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(re||{}),is="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Se=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(ve=0;ve<is.length;ve++)Se[is.charCodeAt(ve)]=ve;var ve,Io=function(e){var t=e.length*.75,r=e.length,o,s=0,u,n,a,h;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var c=new ArrayBuffer(t),i=new Uint8Array(c);for(o=0;o<r;o+=4)u=Se[e.charCodeAt(o)],n=Se[e.charCodeAt(o+1)],a=Se[e.charCodeAt(o+2)],h=Se[e.charCodeAt(o+3)],i[s++]=u<<2|n>>4,i[s++]=(n&15)<<4|a>>2,i[s++]=(a&3)<<6|h&63;return c},Lo=`(function() {\n "use strict";\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) {\n lookup[chars.charCodeAt(i)] = i;\n }\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i2, len = bytes.length, base64 = "";\n for (i2 = 0; i2 < len; i2 += 3) {\n base64 += chars[bytes[i2] >> 2];\n base64 += chars[(bytes[i2] & 3) << 4 | bytes[i2 + 1] >> 4];\n base64 += chars[(bytes[i2 + 1] & 15) << 2 | bytes[i2 + 2] >> 6];\n base64 += chars[bytes[i2 + 2] & 63];\n }\n if (len % 3 === 2) {\n base64 = base64.substring(0, base64.length - 1) + "=";\n } else if (len % 3 === 1) {\n base64 = base64.substring(0, base64.length - 2) + "==";\n }\n return base64;\n };\n const lastBlobMap = /* @__PURE__ */ new Map();\n const transparentBlobMap = /* @__PURE__ */ new Map();\n async function getTransparentBlobFor(width, height, dataURLOptions) {\n const id = \\`\\${width}-\\${height}\\`;\n if ("OffscreenCanvas" in globalThis) {\n if (transparentBlobMap.has(id)) return transparentBlobMap.get(id);\n const offscreen = new OffscreenCanvas(width, height);\n offscreen.getContext("2d");\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n transparentBlobMap.set(id, base64);\n return base64;\n } else {\n return "";\n }\n }\n const worker = self;\n worker.onmessage = async function(e) {\n if ("OffscreenCanvas" in globalThis) {\n const { id, bitmap, width, height, dataURLOptions } = e.data;\n const transparentBase64 = getTransparentBlobFor(\n width,\n height,\n dataURLOptions\n );\n const offscreen = new OffscreenCanvas(width, height);\n const ctx = offscreen.getContext("2d");\n ctx.drawImage(bitmap, 0, 0);\n bitmap.close();\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const type = blob.type;\n const arrayBuffer = await blob.arrayBuffer();\n const base64 = encode(arrayBuffer);\n if (!lastBlobMap.has(id) && await transparentBase64 === base64) {\n lastBlobMap.set(id, base64);\n return worker.postMessage({ id });\n }\n if (lastBlobMap.get(id) === base64) return worker.postMessage({ id });\n worker.postMessage({\n id,\n type,\n base64,\n width,\n height\n });\n lastBlobMap.set(id, base64);\n } else {\n return worker.postMessage({ id: e.data.id });\n }\n };\n})();\n//# sourceMappingURL=image-bitmap-data-url-worker-IJpC7g_b.js.map\n`;typeof self<"u"&&self.Blob&&new Blob([Lo],{type:"text/javascript;charset=utf-8"});try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement("iframe");document.body.appendChild(e),Array.from=((zr=e.contentWindow)==null?void 0:zr.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}ds();function ko(e){return{all:e=e||new Map,on:function(t,r){var o=e.get(t);o?o.push(r):e.set(t,[r])},off:function(t,r){var o=e.get(t);o&&(r?o.splice(o.indexOf(r)>>>0,1):e.set(t,[]))},emit:function(t,r){var o=e.get(t);o&&o.slice().map(function(s){s(r)}),(o=e.get("*"))&&o.slice().map(function(s){s(t,r)})}}}function Fo(e=window,t=document){if("scrollBehavior"in t.documentElement.style&&e.__forceSmoothScrollPolyfill__!==!0)return;let r=e.HTMLElement||e.Element,o=468,s={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:r.prototype.scroll||h,scrollIntoView:r.prototype.scrollIntoView},u=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now;function n(y){let w=["MSIE ","Trident/","Edge/"];return new RegExp(w.join("|")).test(y)}let a=n(e.navigator.userAgent)?1:0;function h(y,w){this.scrollLeft=y,this.scrollTop=w}function c(y){return .5*(1-Math.cos(Math.PI*y))}function i(y){if(y===null||typeof y!="object"||y.behavior===void 0||y.behavior==="auto"||y.behavior==="instant")return!0;if(typeof y=="object"&&y.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+y.behavior+" is not a valid value for enumeration ScrollBehavior.")}function p(y,w){if(w==="Y")return y.clientHeight+a<y.scrollHeight;if(w==="X")return y.clientWidth+a<y.scrollWidth}function l(y,w){let S=e.getComputedStyle(y,null)["overflow"+w];return S==="auto"||S==="scroll"}function f(y){let w=p(y,"Y")&&l(y,"Y"),S=p(y,"X")&&l(y,"X");return w||S}function m(y){for(;y!==t.body&&f(y)===!1;)y=y.parentNode||y.host;return y}function d(y){let w=u(),S,x,v,b=(w-y.startTime)/o;b=b>1?1:b,S=c(b),x=y.startX+(y.x-y.startX)*S,v=y.startY+(y.y-y.startY)*S,y.method.call(y.scrollable,x,v),(x!==y.x||v!==y.y)&&e.requestAnimationFrame(d.bind(e,y))}function g(y,w,S){let x,v,b,C,R=u();y===t.body?(x=e,v=e.scrollX||e.pageXOffset,b=e.scrollY||e.pageYOffset,C=s.scroll):(x=y,v=y.scrollLeft,b=y.scrollTop,C=h),d({scrollable:x,method:C,startTime:R,startX:v,startY:b,x:w,y:S})}e.scroll=e.scrollTo=function(){if(arguments[0]!==void 0){if(i(arguments[0])===!0){s.scroll.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:e.scrollY||e.pageYOffset);return}g.call(e,t.body,arguments[0].left!==void 0?~~arguments[0].left:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:e.scrollY||e.pageYOffset)}},e.scrollBy=function(){if(arguments[0]!==void 0){if(i(arguments[0])){s.scrollBy.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:0,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:0);return}g.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset))}},r.prototype.scroll=r.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(i(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");s.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}let y=arguments[0].left,w=arguments[0].top;g.call(this,this,typeof y>"u"?this.scrollLeft:~~y,typeof w>"u"?this.scrollTop:~~w)},r.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(i(arguments[0])===!0){s.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},r.prototype.scrollIntoView=function(){if(i(arguments[0])===!0){s.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}let y=m(this),w=y.getBoundingClientRect(),S=this.getBoundingClientRect();y!==t.body?(g.call(this,y,y.scrollLeft+S.left-w.left,y.scrollTop+S.top-w.top),e.getComputedStyle(y).position!=="fixed"&&e.scrollBy({left:w.left,top:w.top,behavior:"smooth"})):e.scrollBy({left:S.left,top:S.top,behavior:"smooth"})}}var xr=class{constructor(t=[],r){T(this,"timeOffset",0),T(this,"speed"),T(this,"actions"),T(this,"raf",null),T(this,"lastTimestamp"),this.actions=t,this.speed=r.speed}addAction(t){let r=this.raf===!0;if(!this.actions.length||this.actions[this.actions.length-1].delay<=t.delay)this.actions.push(t);else{let o=this.findActionIndex(t);this.actions.splice(o,0,t)}r&&(this.raf=requestAnimationFrame(this.rafCheck.bind(this)))}start(){this.timeOffset=0,this.lastTimestamp=performance.now(),this.raf=requestAnimationFrame(this.rafCheck.bind(this))}updateLiveTime(){this.raf===!0&&this.rafCheck()}rafCheck(){let t=performance.now();for(this.timeOffset+=(t-this.lastTimestamp)*this.speed,this.lastTimestamp=t;this.actions.length;){let r=this.actions[0];if(this.timeOffset>=r.delay)this.actions.shift(),r.doAction();else break}this.actions.length>0?this.raf=requestAnimationFrame(this.rafCheck.bind(this)):this.raf=!0}clear(){this.raf&&(this.raf!==!0&&cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(t){this.speed=t}isActive(){return this.raf!==null}findActionIndex(t){let r=0,o=this.actions.length-1;for(;r<=o;){let s=Math.floor((r+o)/2);if(this.actions[s].delay<t.delay)r=s+1;else if(this.actions[s].delay>t.delay)o=s-1;else return s+1}return r}};function ss(e,t){if(e.type===$.IncrementalSnapshot&&e.data.source===L.MouseMove&&e.data.positions&&e.data.positions.length){let r=e.data.positions[0].timeOffset,o=e.timestamp+r;return e.delay=o-t,o-t}return e.delay=e.timestamp-t,e.delay}/*! *****************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */function ns(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var o,s,u=r.call(e),n=[];try{for(;(t===void 0||t-- >0)&&!(o=u.next()).done;)n.push(o.value)}catch(a){s={error:a}}finally{try{o&&!o.done&&(r=u.return)&&r.call(u)}finally{if(s)throw s.error}}return n}var pe;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(pe||(pe={}));var $s={type:"xstate.init"};function or(e){return e===void 0?[]:[].concat(e)}function fe(e){return{type:"xstate.assign",assignment:e}}function os(e,t){return typeof(e=typeof e=="string"&&t&&t[e]?t[e]:e)=="string"?{type:e}:typeof e=="function"?{type:e.name,exec:e}:e}function $e(e){return function(t){return e===t}}function zs(e){return typeof e=="string"?{type:e}:e}function as(e,t){return{value:e,context:t,actions:[],changed:!1,matches:$e(e)}}function ls(e,t,r){var o=t,s=!1;return[e.filter(function(u){if(u.type==="xstate.assign"){s=!0;var n=Object.assign({},o);return typeof u.assignment=="function"?n=u.assignment(o,r):Object.keys(u.assignment).forEach(function(a){n[a]=typeof u.assignment[a]=="function"?u.assignment[a](o,r):u.assignment[a]}),o=n,!1}return!0}),o,s]}function Ws(e,t){t===void 0&&(t={});var r=ns(ls(or(e.states[e.initial].entry).map(function(n){return os(n,t.actions)}),e.context,$s),2),o=r[0],s=r[1],u={config:e,_options:t,initialState:{value:e.initial,actions:o,context:s,matches:$e(e.initial)},transition:function(n,a){var h,c,i=typeof n=="string"?{value:n,context:e.context}:n,p=i.value,l=i.context,f=zs(a),m=e.states[p];if(m.on){var d=or(m.on[f.type]);try{for(var g=(function(P){var j=typeof Symbol=="function"&&Symbol.iterator,te=j&&P[j],W=0;if(te)return te.call(P);if(P&&typeof P.length=="number")return{next:function(){return P&&W>=P.length&&(P=void 0),{value:P&&P[W++],done:!P}}};throw new TypeError(j?"Object is not iterable.":"Symbol.iterator is not defined.")})(d),y=g.next();!y.done;y=g.next()){var w=y.value;if(w===void 0)return as(p,l);var S=typeof w=="string"?{target:w}:w,x=S.target,v=S.actions,b=v===void 0?[]:v,C=S.cond,R=C===void 0?function(){return!0}:C,A=x===void 0,N=x??p,k=e.states[N];if(R(l,f)){var D=ns(ls((A?or(b):[].concat(m.exit,b,k.entry).filter(function(P){return P})).map(function(P){return os(P,u._options.actions)}),l,f),3),E=D[0],se=D[1],K=D[2],H=x??p;return{value:H,context:se,actions:E,changed:x!==p||E.length>0||K,matches:$e(H)}}}}catch(P){h={error:P}}finally{try{y&&!y.done&&(c=g.return)&&c.call(g)}finally{if(h)throw h.error}}}return as(p,l)}};return u}var us=function(e,t){return e.actions.forEach(function(r){var o=r.exec;return o&&o(e.context,t)})};function qs(e){var t=e.initialState,r=pe.NotStarted,o=new Set,s={_machine:e,send:function(u){r===pe.Running&&(t=e.transition(t,u),us(t,zs(u)),o.forEach(function(n){return n(t)}))},subscribe:function(u){return o.add(u),u(t),{unsubscribe:function(){return o.delete(u)}}},start:function(u){if(u){var n=typeof u=="object"?u:{context:e.config.context,value:u};t={value:n.value,actions:[],context:n.context,matches:$e(n.value)}}return r=pe.Running,us(t,$s),s},stop:function(){return r=pe.Stopped,o.clear(),s},get state(){return t},get status(){return r}};return s}function Uo(e,t){for(let r=e.length-1;r>=0;r--){let o=e[r];if(o.type===$.Meta&&o.timestamp<=t)return e.slice(r)}return e}function Bo(e,{getCastFn:t,applyEventsSynchronously:r,emitter:o}){let s=Ws({id:"player",context:e,initial:"paused",states:{playing:{on:{PAUSE:{target:"paused",actions:["pause"]},CAST_EVENT:{target:"playing",actions:"castEvent"},END:{target:"paused",actions:["resetLastPlayedEvent","pause"]},ADD_EVENT:{target:"playing",actions:["addEvent"]}}},paused:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"},TO_LIVE:{target:"live",actions:["startLive"]},ADD_EVENT:{target:"paused",actions:["addEvent"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:fe({lastPlayedEvent:(u,n)=>n.type==="CAST_EVENT"?n.payload.event:u.lastPlayedEvent}),recordTimeOffset:fe((u,n)=>{let a=u.timeOffset;return"payload"in n&&"timeOffset"in n.payload&&(a=n.payload.timeOffset),{...u,timeOffset:a,baselineTime:u.events[0].timestamp+a}}),play(u){var n;let{timer:a,events:h,baselineTime:c,lastPlayedEvent:i}=u;a.clear();for(let m of h)ss(m,c);let p=Uo(h,c),l=i?.timestamp;i?.type===$.IncrementalSnapshot&&i.data.source===L.MouseMove&&(l=i.timestamp+((n=i.data.positions[0])==null?void 0:n.timeOffset)),c<(l||0)&&o.emit(I.PlayBack);let f=new Array;for(let m of p)if(!(l&&l<c&&(m.timestamp<=l||m===i)))if(m.timestamp<c)f.push(m);else{let d=t(m,!1);a.addAction({doAction:()=>{d()},delay:m.delay})}r(f),o.emit(I.Flush),a.start()},pause(u){u.timer.clear()},resetLastPlayedEvent:fe(u=>({...u,lastPlayedEvent:null})),startLive:fe({baselineTime:(u,n)=>(u.timer.start(),n.type==="TO_LIVE"&&n.payload.baselineTime?n.payload.baselineTime:Date.now())}),addEvent:fe((u,n)=>{let{baselineTime:a,timer:h,events:c}=u;if(n.type==="ADD_EVENT"){let{event:i}=n.payload;ss(i,a);let p=c.length-1;if(!c[p]||c[p].timestamp<=i.timestamp)c.push(i);else{let m=-1,d=0;for(;d<=p;){let g=Math.floor((d+p)/2);c[g].timestamp<=i.timestamp?d=g+1:p=g-1}m===-1&&(m=d),c.splice(m,0,i)}let l=i.timestamp<a,f=t(i,l);l?f():h.isActive()&&h.addAction({doAction:()=>{f()},delay:i.delay})}return{...u,events:c}})}});return qs(s)}function $o(e){let t=Ws({id:"speed",context:e,initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:(r,o)=>{"payload"in o&&r.timer.setSpeed(o.payload.speed)},recordSpeed:fe({normalSpeed:r=>r.timer.speed}),restoreSpeed:r=>{r.timer.setSpeed(r.normalSpeed)}}});return qs(t)}var zo=e=>[`.${e} { background: currentColor }`,"noscript { display: none !important; }"],cs=new Map;function js(e,t){let r=cs.get(e);return r||(r=new Map,cs.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}function ie(e,t,r){return async o=>{if(o&&typeof o=="object"&&"rr_type"in o)if(r&&(r.isUnchanged=!1),o.rr_type==="ImageBitmap"&&"args"in o){let s=await ie(e,t,r)(o.args);return await createImageBitmap.apply(null,s)}else if("index"in o){if(r||t===null)return o;let{rr_type:s,index:u}=o;return js(t,s)[u]}else if("args"in o){let{rr_type:s,args:u}=o,n=window[s];return new n(...await Promise.all(u.map(ie(e,t,r))))}else{if("base64"in o)return Io(o.base64);if("src"in o){let s=e.get(o.src);if(s)return s;{let u=new Image;return u.src=o.src,e.set(o.src,u),u}}else if("data"in o&&o.rr_type==="Blob"){let s=await Promise.all(o.data.map(ie(e,t,r)));return new Blob(s,{type:o.type})}}else if(Array.isArray(o))return await Promise.all(o.map(ie(e,t,r)));return o}}function Wo(e,t){try{return t===Be.WebGL?e.getContext("webgl")||e.getContext("experimental-webgl"):e.getContext("webgl2")}catch{return null}}var qo=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function jo(e,t){if(!t?.constructor)return;let{name:r}=t.constructor;if(!qo.includes(r))return;let o=js(e,r);o.includes(t)||o.push(t)}async function Vo({mutation:e,target:t,type:r,imageMap:o,errorHandler:s}){try{let u=Wo(t,r);if(!u)return;if(e.setter){u[e.property]=e.args[0];return}let n=u[e.property],a=await Promise.all(e.args.map(ie(o,u))),h=n.apply(u,a);jo(u,h);let c=!1}catch(u){s(e,u)}}async function Go({event:e,mutations:t,target:r,imageMap:o,errorHandler:s}){let u=r.getContext("2d");if(!u){s(t[0],new Error("Canvas context is null"));return}let n=t.map(async h=>Promise.all(h.args.map(ie(o,u))));(await Promise.all(n)).forEach((h,c)=>{let i=t[c];try{if(i.setter){u[i.property]=i.args[0];return}let p=u[i.property];i.property==="drawImage"&&typeof i.args[0]=="string"?(o.get(e),p.apply(u,i.args)):p.apply(u,h)}catch(p){s(i,p)}})}async function hs({event:e,mutation:t,target:r,imageMap:o,canvasEventMap:s,errorHandler:u}){try{let n=s.get(e)||t,a="commands"in n?n.commands:[n];if([Be.WebGL,Be.WebGL2].includes(t.type)){for(let h=0;h<a.length;h++){let c=a[h];await Vo({mutation:c,type:t.type,target:r,imageMap:o,errorHandler:u})}return}await Go({event:e,mutations:a,target:r,imageMap:o,errorHandler:u})}catch(n){u(t,n)}}var Cr=class{constructor(t){T(this,"mediaMap",new Map),T(this,"warn"),T(this,"service"),T(this,"speedService"),T(this,"emitter"),T(this,"getCurrentTime"),T(this,"metadataCallbackMap",new Map),this.warn=t.warn,this.service=t.service,this.speedService=t.speedService,this.emitter=t.emitter,this.getCurrentTime=t.getCurrentTime,this.emitter.on(I.Start,this.start.bind(this)),this.emitter.on(I.SkipStart,this.start.bind(this)),this.emitter.on(I.Pause,this.pause.bind(this)),this.emitter.on(I.Finish,this.pause.bind(this)),this.speedService.subscribe(()=>{this.syncAllMediaElements()})}syncAllMediaElements(t={pause:!1}){this.mediaMap.forEach((r,o)=>{this.syncTargetWithState(o),t.pause&&o.pause()})}start(){this.syncAllMediaElements()}pause(){this.syncAllMediaElements({pause:!0})}seekTo({time:t,target:r,mediaState:o}){if(o.isPlaying){let u=(t-o.lastInteractionTimeOffset)/1e3*o.playbackRate,n="duration"in r&&r.duration;if(Number.isNaN(n)){this.waitForMetadata(r);return}let a=o.currentTimeAtLastInteraction+u;r.loop&&n!==!1&&(a=a%n),r.currentTime=a}else r.pause(),r.currentTime=o.currentTimeAtLastInteraction}waitForMetadata(t){if(this.metadataCallbackMap.has(t)||!("addEventListener"in t))return;let r=()=>{this.metadataCallbackMap.delete(t);let o=this.mediaMap.get(t);o&&this.seekTo({time:this.getCurrentTime(),target:t,mediaState:o})};this.metadataCallbackMap.set(t,r),t.addEventListener("loadedmetadata",r,{once:!0})}getMediaStateFromMutation({target:t,timeOffset:r,mutation:o}){let s=this.mediaMap.get(t),{type:u,playbackRate:n,currentTime:a,muted:h,volume:c,loop:i}=o;return{isPlaying:u===Sr.Play||u!==Sr.Pause&&(s?.isPlaying||t.getAttribute("autoplay")!==null),currentTimeAtLastInteraction:a??s?.currentTimeAtLastInteraction??0,lastInteractionTimeOffset:r,playbackRate:n??s?.playbackRate??1,volume:c??s?.volume??1,muted:h??s?.muted??t.getAttribute("muted")===null,loop:i??s?.loop??t.getAttribute("loop")===null}}syncTargetWithState(t){let r=this.mediaMap.get(t);if(!r)return;let{muted:o,loop:s,volume:u,isPlaying:n}=r,a=this.service.state.matches("paused"),h=r.playbackRate*this.speedService.state.context.timer.speed;try{this.seekTo({time:this.getCurrentTime(),target:t,mediaState:r}),t.volume!==u&&(t.volume=u),t.muted=o,t.loop=s,t.playbackRate!==h&&(t.playbackRate=h),n&&!a?t.play():t.pause()}catch(c){this.warn(`Failed to replay media interactions: ${c.message||c}`)}}addMediaElements(t,r,o){if(!["AUDIO","VIDEO"].includes(t.nodeName))return;let s=t,u=o.getMeta(s);if(!u||!("attributes"in u))return;let n=this.service.state.matches("paused"),a=u.attributes,h=!1;a.rr_mediaState?h=a.rr_mediaState==="played":h=s.getAttribute("autoplay")!==null,h&&n&&s.pause();let c=1;typeof a.rr_mediaPlaybackRate=="number"&&(c=a.rr_mediaPlaybackRate);let i=!1;typeof a.rr_mediaMuted=="boolean"?i=a.rr_mediaMuted:i=s.getAttribute("muted")!==null;let p=!1;typeof a.rr_mediaLoop=="boolean"?p=a.rr_mediaLoop:p=s.getAttribute("loop")!==null;let l=1;typeof a.rr_mediaVolume=="number"&&(l=a.rr_mediaVolume);let f=0;typeof a.rr_mediaCurrentTime=="number"&&(f=a.rr_mediaCurrentTime),this.mediaMap.set(s,{isPlaying:h,currentTimeAtLastInteraction:f,lastInteractionTimeOffset:r,playbackRate:c,volume:l,muted:i,loop:p}),this.syncTargetWithState(s)}mediaMutation({target:t,timeOffset:r,mutation:o}){this.mediaMap.set(t,this.getMediaStateFromMutation({target:t,timeOffset:r,mutation:o})),this.syncTargetWithState(t)}isSupportedMediaElement(t){return["AUDIO","VIDEO"].includes(t.nodeName)}reset(){this.mediaMap.clear()}};function Te(e,t){if(e.nodeName!=="DIALOG"||e instanceof X)return;let r=e,o=r.open,s=o&&r.matches("dialog:modal"),u=r.getAttribute("rr_open_mode"),n=typeof t?.attributes.open=="string"||typeof r.getAttribute("open")=="string",a=u==="modal";if(!(o&&!(s&&u==="non-modal"||!s&&a))){if(!r.isConnected){console.warn("dialog is not attached to the dom",r);return}o&&r.close(),n&&(a?r.showModal():r.show())}}function Yo(e,t){if(e.nodeName!=="DIALOG"||e instanceof X)return;let r=e;if(!r.isConnected){console.warn("dialog is not attached to the dom",r);return}t.attributes.open===null&&(r.removeAttribute("open"),r.removeAttribute("rr_open_mode"))}var Ho=5*1e3,Jo=ko,fs="[replayer]",ar={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function ps(e){return e.type==$.IncrementalSnapshot&&(e.data.source==L.TouchMove||e.data.source==L.MouseInteraction&&e.data.type==q.TouchStart)}var ze=class{constructor(t,r){if(T(this,"wrapper"),T(this,"iframe"),T(this,"UNSAFE_replayCanvas",!1),T(this,"service"),T(this,"speedService"),T(this,"config"),T(this,"usingVirtualDom",!1),T(this,"virtualDom",new me),T(this,"mouse"),T(this,"mouseTail",null),T(this,"tailPositions",[]),T(this,"emitter",Jo()),T(this,"nextUserInteractionEvent"),T(this,"legacy_missingNodeRetryMap",{}),T(this,"cache",bi()),T(this,"imageMap",new Map),T(this,"canvasEventMap",new Map),T(this,"mirror",ds()),T(this,"styleMirror",new br),T(this,"mediaManager"),T(this,"firstFullSnapshot",null),T(this,"newDocumentQueue",[]),T(this,"mousePos",null),T(this,"touchActive",null),T(this,"lastMouseDownEvent",null),T(this,"lastHoveredRootNode"),T(this,"lastSelectionData",null),T(this,"constructedStyleMutations",[]),T(this,"adoptedStyleSheets",[]),T(this,"handleResize",a=>{this.iframe.style.display="inherit";for(let h of[this.mouseTail,this.iframe])h&&(h.setAttribute("width",String(a.width)),h.setAttribute("height",String(a.height)))}),T(this,"applyEventsSynchronously",a=>{for(let h of a){switch(h.type){case $.DomContentLoaded:case $.Load:continue;case $.FullSnapshot:case $.Meta:case $.Plugin:case $.IncrementalSnapshot:break}this.getCastFn(h,!0)()}}),T(this,"getCastFn",(a,h=!1)=>{let c;switch(a.type){case $.DomContentLoaded:case $.Load:break;case $.Custom:c=()=>{this.emitter.emit(I.CustomEvent,a)};break;case $.Meta:c=()=>this.emitter.emit(I.Resize,{width:a.data.width,height:a.data.height});break;case $.FullSnapshot:c=()=>{var p;if(this.firstFullSnapshot){if(this.firstFullSnapshot===a){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.mediaManager.reset(),this.styleMirror.reset(),this.rebuildFullSnapshot(a,h),(p=this.iframe.contentWindow)==null||p.scrollTo(a.data.initialOffset)};break;case $.IncrementalSnapshot:c=()=>{if(this.applyIncremental(a,h),!h&&(a===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(let p of this.service.state.context.events)if(!(p.timestamp<=a.timestamp)&&this.isUserInteraction(p)){p.delay-a.delay>this.config.inactivePeriodThreshold*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=p);break}if(this.nextUserInteractionEvent){let p=this.nextUserInteractionEvent.delay-a.delay,l={speed:Math.min(Math.round(p/Ho),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:l}),this.emitter.emit(I.SkipStart,l)}}};break}return()=>{c&&c();for(let l of this.config.plugins||[])l.handler&&l.handler(a,h,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:a}});let p=this.service.state.context.events.length-1;if(!this.config.liveMode&&a===this.service.state.context.events[p]){let l=()=>{p<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(I.Finish))},f=50;a.type===$.IncrementalSnapshot&&a.data.source===L.MouseMove&&a.data.positions.length&&(f+=Math.max(0,-a.data.positions[0].timeOffset)),setTimeout(l,f)}this.emitter.emit(I.EventCast,a)}}),!r?.liveMode&&t.length<2)throw new Error("Replayer need at least 2 events.");let o={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:ar,useVirtualDom:!0,logger:console};this.config=Object.assign({},o,r),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(I.Resize,this.handleResize),this.setupDom();for(let a of this.config.plugins||[])a.getMirror&&a.getMirror({nodeMirror:this.mirror});this.emitter.on(I.Flush,()=>{if(this.usingVirtualDom){let a={mirror:this.mirror,applyCanvas:(h,c,i)=>{hs({event:h,mutation:c,target:i,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this),applyStyleSheetMutation:(h,c)=>{h.source===L.StyleSheetRule?this.applyStyleSheetRule(h,c):h.source===L.StyleDeclaration&&this.applyStyleDeclaration(h,c)},afterAppend:(h,c)=>{for(let i of this.config.plugins||[])i.onBuild&&i.onBuild(h,{id:c,replayer:this})}};if(this.iframe.contentDocument)try{Fe(this.iframe.contentDocument,this.virtualDom,a,this.virtualDom.mirror)}catch(h){this.warn(h)}if(this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(let h in this.legacy_missingNodeRetryMap)try{let c=this.legacy_missingNodeRetryMap[h],i=Ue(c.node,this.mirror,this.virtualDom.mirror);Fe(i,c.node,a,this.virtualDom.mirror),c.node=i}catch(c){this.warn(c)}this.constructedStyleMutations.forEach(h=>{this.applyStyleSheetMutation(h)}),this.constructedStyleMutations=[],this.adoptedStyleSheets.forEach(h=>{this.applyAdoptedStyleSheet(h)}),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){let[a,h]=this.lastMouseDownEvent;a.dispatchEvent(h)}this.lastMouseDownEvent=null,this.lastSelectionData&&(this.applySelection(this.lastSelectionData),this.lastSelectionData=null)}),this.emitter.on(I.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset()});let s=new xr([],{speed:this.config.speed});this.service=Bo({events:t.map(a=>r&&r.unpackFn?r.unpackFn(a):a).sort((a,h)=>a.timestamp-h.timestamp),timer:s,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(a=>{this.emitter.emit(I.StateChange,{player:a})}),this.speedService=$o({normalSpeed:-1,timer:s}),this.speedService.start(),this.speedService.subscribe(a=>{this.emitter.emit(I.StateChange,{speed:a})}),this.mediaManager=new Cr({warn:this.warn.bind(this),service:this.service,speedService:this.speedService,emitter:this.emitter,getCurrentTime:this.getCurrentTime.bind(this)});let u=this.service.state.context.events.find(a=>a.type===$.Meta),n=this.service.state.context.events.find(a=>a.type===$.FullSnapshot);if(u){let{width:a,height:h}=u.data;setTimeout(()=>{this.emitter.emit(I.Resize,{width:a,height:h})},0)}n&&setTimeout(()=>{var a;this.firstFullSnapshot||(this.firstFullSnapshot=n,this.rebuildFullSnapshot(n),(a=this.iframe.contentWindow)==null||a.scrollTo(n.data.initialOffset))},1),this.service.state.context.events.find(ps)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(t,r){return this.emitter.on(t,r),this}off(t,r){return this.emitter.off(t,r),this}setConfig(t){Object.keys(t).forEach(r=>{t[r],this.config[r]=t[r]}),this.config.skipInactive||this.backToNormal(),typeof t.speed<"u"&&this.speedService.send({type:"SET_SPEED",payload:{speed:t.speed}}),typeof t.mouseTail<"u"&&(t.mouseTail===!1?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))}getMetaData(){let t=this.service.state.context.events[0],r=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:t.timestamp,endTime:r.timestamp,totalTime:r.timestamp-t.timestamp}}getCurrentTime(){return this.config.liveMode&&this.timer.updateLiveTime(),this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){let{baselineTime:t,events:r}=this.service.state.context;return t-r[0].timestamp}getMirror(){return this.mirror}play(t=0){var r,o;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:t}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:t}})),(o=(r=this.iframe.contentDocument)==null?void 0:r.getElementsByTagName("html")[0])==null||o.classList.remove("rrweb-paused"),this.emitter.emit(I.Start)}pause(t){var r,o;t===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof t=="number"&&(this.play(t),this.service.send({type:"PAUSE"})),(o=(r=this.iframe.contentDocument)==null?void 0:r.getElementsByTagName("html")[0])==null||o.classList.add("rrweb-paused"),this.emitter.emit(I.Pause)}resume(t=0){this.warn("The \'resume\' was deprecated in 1.0. Please use \'play\' method which has the same interface."),this.play(t),this.emitter.emit(I.Resume)}destroy(){this.pause(),this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset(),this.config.root.removeChild(this.wrapper),this.emitter.emit(I.Destroy)}startLive(t){this.service.send({type:"TO_LIVE",payload:{baselineTime:t}})}addEvent(t){let r=this.config.unpackFn?this.config.unpackFn(t):t;ps(r)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:r}}))}enableInteract(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"}disableInteract(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"}resetCache(){this.cache=bi()}setupDom(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),this.config.mouseTail!==!1&&(this.mouseTail=document.createElement("canvas"),this.mouseTail.classList.add("replayer-mouse-tail"),this.mouseTail.style.display="inherit",this.wrapper.appendChild(this.mouseTail)),this.config.UNSAFE_replayCanvas?(this.iframe=document.createElement("iframe"),this.iframe.setAttribute("sandbox","allow-same-origin allow-scripts"),this.wrapper.appendChild(this.iframe),this.UNSAFE_replayCanvas=!0):(this.iframe=An({root:this.wrapper}),this.UNSAFE_replayCanvas=!1),this.iframe.style.display="none",this.disableInteract(),this.iframe.contentWindow&&this.iframe.contentDocument&&(Fo(this.iframe.contentWindow,this.iframe.contentDocument),To(this.iframe.contentWindow))}rebuildFullSnapshot(t,r=!1){if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&this.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};let o=[],s=new Set,u=(h,c)=>{if(h.nodeName==="DIALOG"&&s.add(h),this.collectIframeAndAttachDocument(o,h),this.mediaManager.isSupportedMediaElement(h)){let{events:i}=this.service.state.context;this.mediaManager.addMediaElements(h,t.timestamp-i[0].timestamp,this.mirror)}for(let i of this.config.plugins||[])i.onBuild&&i.onBuild(h,{id:c,replayer:this})};this.usingVirtualDom&&(this.virtualDom.destroyTree(),this.usingVirtualDom=!1),this.mirror.reset(),Mn(t.data.node,{doc:this.iframe.contentDocument,afterAppend:u,cache:this.cache,mirror:this.mirror,UNSAFE_allowUnprotectedRebuild:this.UNSAFE_replayCanvas}),u(this.iframe.contentDocument,t.data.node.id);for(let{mutationInQueue:h,builtNode:c}of o)this.attachDocumentToIframe(h,c),this.newDocumentQueue=this.newDocumentQueue.filter(i=>i!==h);let{documentElement:n,head:a}=this.iframe.contentDocument;this.insertStyleRules(n,a),s.forEach(h=>Te(h)),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(I.FullsnapshotRebuilded,t),r||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(t,r){var o;let s=zo(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&s.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),!!s.length)if(this.usingVirtualDom){let u=this.virtualDom.createElement("style");this.virtualDom.mirror.add(u,Is(u,this.virtualDom.unserializedId)),t.insertBefore(u,r),u.rules.push({source:L.StyleSheetRule,adds:s.map((n,a)=>({rule:n,index:a}))})}else{let u=document.createElement("style");t.insertBefore(u,r);for(let n=0;n<s.length;n++)(o=u.sheet)==null||o.insertRule(s[n],n)}}attachDocumentToIframe(t,r){let o=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,s=[],u=new Set,n=(a,h)=>{a.nodeName==="DIALOG"&&u.add(a),this.collectIframeAndAttachDocument(s,a);let c=o.getMeta(a);if(c?.type===re.Element&&c?.tagName.toUpperCase()==="HTML"){let{documentElement:i,head:p}=r.contentDocument;this.insertStyleRules(i,p)}if(!this.usingVirtualDom)for(let i of this.config.plugins||[])i.onBuild&&i.onBuild(a,{id:h,replayer:this})};xe(t.node,{doc:r.contentDocument,mirror:o,hackCss:!0,skipChild:!1,afterAppend:n,cache:this.cache}),n(r.contentDocument,t.node.id);for(let{mutationInQueue:a,builtNode:h}of s)this.attachDocumentToIframe(a,h),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==a);u.forEach(a=>Te(a))}collectIframeAndAttachDocument(t,r){if(nr(r,this.mirror)){let o=this.newDocumentQueue.find(s=>s.parentId===this.mirror.getId(r));o&&t.push({mutationInQueue:o,builtNode:r})}}waitForStylesheetLoad(){var t;let r=(t=this.iframe.contentDocument)==null?void 0:t.head;if(r){let o=new Set,s,u=this.service.state,n=()=>{u=this.service.state};this.emitter.on(I.Start,n),this.emitter.on(I.Pause,n);let a=()=>{this.emitter.off(I.Start,n),this.emitter.off(I.Pause,n)};r.querySelectorAll(\'link[rel="stylesheet"]\').forEach(h=>{h.sheet||(o.add(h),h.addEventListener("load",()=>{o.delete(h),o.size===0&&s!==-1&&(u.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(I.LoadStylesheetEnd),s&&clearTimeout(s),a())}))}),o.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(I.LoadStylesheetStart),s=setTimeout(()=>{u.matches("playing")&&this.play(this.getCurrentTime()),s=-1,a()},this.config.loadTimeout))}}async preloadAllImages(){let t=[];for(let r of this.service.state.context.events)r.type===$.IncrementalSnapshot&&r.data.source===L.CanvasMutation&&(t.push(this.deserializeAndPreloadCanvasEvents(r.data,r)),("commands"in r.data?r.data.commands:[r.data]).forEach(s=>{this.preloadImages(s,r)}));return Promise.all(t)}preloadImages(t,r){if(t.property==="drawImage"&&typeof t.args[0]=="string"&&!this.imageMap.has(r)){let o=document.createElement("canvas"),s=o.getContext("2d"),u=s?.createImageData(o.width,o.height);s?.putImageData(u,0,0)}}async deserializeAndPreloadCanvasEvents(t,r){if(!this.canvasEventMap.has(r)){let o={isUnchanged:!0};if("commands"in t){let s=await Promise.all(t.commands.map(async u=>{let n=await Promise.all(u.args.map(ie(this.imageMap,null,o)));return{...u,args:n}}));o.isUnchanged===!1&&this.canvasEventMap.set(r,{...t,commands:s})}else{let s=await Promise.all(t.args.map(ie(this.imageMap,null,o)));o.isUnchanged===!1&&this.canvasEventMap.set(r,{...t,args:s})}}}applyIncremental(t,r){var o,s,u;let{data:n}=t;switch(n.source){case L.Mutation:{try{this.applyMutation(n,r)}catch(a){this.warn(`Exception in mutation ${a.message||a}`,n)}break}case L.Drag:case L.TouchMove:case L.MouseMove:if(r){let a=n.positions[n.positions.length-1];this.mousePos={x:a.x,y:a.y,id:a.id,debugData:n}}else n.positions.forEach(a=>{let h={doAction:()=>{this.moveAndHover(a.x,a.y,a.id,r,n)},delay:a.timeOffset+t.timestamp-this.service.state.context.baselineTime};this.timer.addAction(h)}),this.timer.addAction({doAction(){},delay:t.delay-((o=n.positions[0])==null?void 0:o.timeOffset)});break;case L.MouseInteraction:{if(n.id===-1)break;let a=new Event(Zs(q[n.type])),h=this.mirror.getNode(n.id);if(!h)return this.debugNodeNotFound(n,n.id);this.emitter.emit(I.MouseInteraction,{type:n.type,target:h});let{triggerFocus:c}=this.config;switch(n.type){case q.Blur:"blur"in h&&h.blur();break;case q.Focus:c&&h.focus&&h.focus({preventScroll:!0});break;case q.Click:case q.TouchStart:case q.TouchEnd:case q.MouseDown:case q.MouseUp:r?(n.type===q.TouchStart?this.touchActive=!0:n.type===q.TouchEnd&&(this.touchActive=!1),n.type===q.MouseDown?this.lastMouseDownEvent=[h,a]:n.type===q.MouseUp&&(this.lastMouseDownEvent=null),this.mousePos={x:n.x||0,y:n.y||0,id:n.id,debugData:n}):(n.type===q.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(n.x||0,n.y||0,n.id,r,n),n.type===q.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):n.type===q.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):n.type===q.TouchEnd?this.mouse.classList.remove("touch-active"):h.dispatchEvent(a));break;case q.TouchCancel:r?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:h.dispatchEvent(a)}break}case L.Scroll:{if(n.id===-1)break;if(this.usingVirtualDom){let a=this.virtualDom.mirror.getNode(n.id);if(!a)return this.debugNodeNotFound(n,n.id);a.scrollData=n;break}this.applyScroll(n,r);break}case L.ViewportResize:this.emitter.emit(I.Resize,{width:n.width,height:n.height});break;case L.Input:{if(n.id===-1)break;if(this.usingVirtualDom){let a=this.virtualDom.mirror.getNode(n.id);if(!a)return this.debugNodeNotFound(n,n.id);a.inputData=n;break}this.applyInput(n);break}case L.MediaInteraction:{let a=this.usingVirtualDom?this.virtualDom.mirror.getNode(n.id):this.mirror.getNode(n.id);if(!a)return this.debugNodeNotFound(n,n.id);let h=a,{events:c}=this.service.state.context;this.mediaManager.mediaMutation({target:h,timeOffset:t.timestamp-c[0].timestamp,mutation:n});break}case L.StyleSheetRule:case L.StyleDeclaration:{this.usingVirtualDom?n.styleId?this.constructedStyleMutations.push(n):n.id&&((s=this.virtualDom.mirror.getNode(n.id))==null||s.rules.push(n)):this.applyStyleSheetMutation(n);break}case L.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){let a=this.virtualDom.mirror.getNode(n.id);if(!a)return this.debugNodeNotFound(n,n.id);a.canvasMutations.push({event:t,mutation:n})}else{let a=this.mirror.getNode(n.id);if(!a)return this.debugNodeNotFound(n,n.id);hs({event:t,mutation:n,target:a,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case L.Font:{try{let a=new FontFace(n.family,n.buffer?new Uint8Array(JSON.parse(n.fontSource)):n.fontSource,n.descriptors);(u=this.iframe.contentDocument)==null||u.fonts.add(a)}catch(a){this.warn(a)}break}case L.Selection:{if(r){this.lastSelectionData=n;break}this.applySelection(n);break}case L.AdoptedStyleSheet:{this.usingVirtualDom?this.adoptedStyleSheets.push(n):this.applyAdoptedStyleSheet(n);break}}}applyMutation(t,r){if(this.config.useVirtualDom&&!this.usingVirtualDom&&r&&(this.usingVirtualDom=!0,lo(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(let c in this.legacy_missingNodeRetryMap)try{let i=this.legacy_missingNodeRetryMap[c],p=Ps(i.node,this.virtualDom,this.mirror);p&&(i.node=p)}catch(i){this.warn(i)}let o=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;t.removes=t.removes.filter(c=>o.getNode(c.id)?!0:(this.warnNodeNotFound(t,c.id),!1)),t.removes.forEach(c=>{var i;let p=o.getNode(c.id);if(!p)return;let l=o.getNode(c.parentId);if(!l)return this.warnNodeNotFound(t,c.parentId);if(c.isShadow&&De(l)&&(l=l.shadowRoot),o.removeNodeFromMap(p),l)try{l.removeChild(p),this.usingVirtualDom&&p.nodeName==="#text"&&l.nodeName==="STYLE"&&((i=l.rules)==null?void 0:i.length)>0&&(l.rules=[])}catch(f){if(f instanceof DOMException)this.warn("parent could not remove child in mutation",l,p,t);else throw f}});let s={...this.legacy_missingNodeRetryMap},u=[],n=c=>{let i=null;return c.nextId&&(i=o.getNode(c.nextId)),c.nextId!==null&&c.nextId!==void 0&&c.nextId!==-1&&!i},a=c=>{var i,p;if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");let l=o.getNode(c.parentId);if(!l)return c.node.type===re.Document?this.newDocumentQueue.push(c):u.push(c);c.node.isShadow&&(De(l)||l.attachShadow({mode:"open"}),l=l.shadowRoot);let f=null,m=null;if(c.previousId&&(f=o.getNode(c.previousId)),c.nextId&&(m=o.getNode(c.nextId)),n(c))return u.push(c);if(c.node.rootId&&!o.getNode(c.node.rootId))return;let d=c.node.rootId?o.getNode(c.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(nr(l,o)){this.attachDocumentToIframe(c,l);return}let g=(S,x)=>{if(!this.usingVirtualDom){Te(S);for(let v of this.config.plugins||[])v.onBuild&&v.onBuild(S,{id:x,replayer:this})}},y=xe(c.node,{doc:d,mirror:o,skipChild:!0,hackCss:!0,cache:this.cache,afterAppend:g});if(c.previousId===-1||c.nextId===-1){s[c.node.id]={node:y,mutation:c};return}let w=o.getMeta(l);if(w&&w.type===re.Element&&c.node.type===re.Text){let S=Array.isArray(l.childNodes)?l.childNodes:Array.from(l.childNodes);if(w.tagName==="textarea")for(let x of S)x.nodeType===l.TEXT_NODE&&l.removeChild(x);else if(w.tagName==="style"&&S.length===1)for(let x of S)x.nodeType===l.TEXT_NODE&&!o.hasNode(x)&&(y.textContent=x.textContent,l.removeChild(x))}else if(w?.type===re.Document){let S=l;c.node.type===re.DocumentType&&((i=S.childNodes[0])==null?void 0:i.nodeType)===Node.DOCUMENT_TYPE_NODE&&S.removeChild(S.childNodes[0]),y.nodeName==="HTML"&&S.documentElement&&S.removeChild(S.documentElement)}if(f&&f.nextSibling&&f.nextSibling.parentNode?l.insertBefore(y,f.nextSibling):m&&m.parentNode?l.contains(m)?l.insertBefore(y,m):l.insertBefore(y,null):l.appendChild(y),g(y,c.node.id),this.usingVirtualDom&&y.nodeName==="#text"&&l.nodeName==="STYLE"&&((p=l.rules)==null?void 0:p.length)>0&&(l.rules=[]),nr(y,this.mirror)){let S=this.mirror.getId(y),x=this.newDocumentQueue.find(v=>v.parentId===S);x&&(this.attachDocumentToIframe(x,y),this.newDocumentQueue=this.newDocumentQueue.filter(v=>v!==x))}(c.previousId||c.nextId)&&this.legacy_resolveMissingNode(s,l,y,c)};t.adds.forEach(c=>{a(c)});let h=Date.now();for(;u.length;){let c=_o(u);if(u.length=0,Date.now()-h>500){this.warn("Timeout in the loop, please check the resolve tree data:",c);break}for(let i of c)o.getNode(i.value.parentId)?Us(i,l=>{a(l)}):this.debug("Drop resolve tree since there is no parent for the root node.",i)}Object.keys(s).length&&Object.assign(this.legacy_missingNodeRetryMap,s),Po(t.texts).forEach(c=>{var i;let p=o.getNode(c.id);if(!p)return t.removes.find(f=>f.id===c.id)?void 0:this.warnNodeNotFound(t,c.id);let l=p.parentElement;if(c.value&&l&&l.tagName==="STYLE"?p.textContent=Ye(c.value,this.cache):p.textContent=c.value,this.usingVirtualDom){let f=p.parentNode;((i=f?.rules)==null?void 0:i.length)>0&&(f.rules=[])}}),t.attributes.forEach(c=>{var i;let p=o.getNode(c.id);if(!p)return t.removes.find(l=>l.id===c.id)?void 0:this.warnNodeNotFound(t,c.id);for(let l in c.attributes)if(typeof l=="string"){let f=c.attributes[l];if(f===null)p.removeAttribute(l),l==="open"&&Yo(p,c);else if(typeof f=="string")try{if(l==="_cssText"&&(p.nodeName==="LINK"||p.nodeName==="STYLE"))try{let m=o.getMeta(p),d=xe({...m,attributes:{...m.attributes,...c.attributes}},{doc:p.ownerDocument,mirror:o,skipChild:!0,hackCss:!0,cache:this.cache});Object.assign(m.attributes,c.attributes);let g=p.nextSibling,y=p.parentNode;if(d&&y){y.removeChild(p),y.insertBefore(d,g),o.replace(c.id,d);break}}catch{}if(l==="value"&&p.nodeName==="TEXTAREA"){let m=p;m.childNodes.forEach(g=>m.removeChild(g));let d=(i=p.ownerDocument)==null?void 0:i.createTextNode(f);d&&m.appendChild(d)}else p.setAttribute(l,f);l==="rr_open_mode"&&p.nodeName==="DIALOG"&&Te(p,c)}catch(m){this.warn("An error occurred may due to the checkout feature.",m)}else if(l==="style"){let m=f,d=p;for(let g in m)if(m[g]===!1)d.style.removeProperty(g);else if(m[g]instanceof Array){let y=m[g];d.style.setProperty(g,y[0],y[1])}else{let y=m[g];d.style.setProperty(g,y)}}}})}applyScroll(t,r){var o,s;let u=this.mirror.getNode(t.id);if(!u)return this.debugNodeNotFound(t,t.id);let n=this.mirror.getMeta(u);if(u===this.iframe.contentDocument)(o=this.iframe.contentWindow)==null||o.scrollTo({top:t.y,left:t.x,behavior:r?"auto":"smooth"});else if(n?.type===re.Document)(s=u.defaultView)==null||s.scrollTo({top:t.y,left:t.x,behavior:r?"auto":"smooth"});else try{u.scrollTo({top:t.y,left:t.x,behavior:r?"auto":"smooth"})}catch{}}applyInput(t){let r=this.mirror.getNode(t.id);if(!r)return this.debugNodeNotFound(t,t.id);try{r.checked=t.isChecked,r.value=t.text}catch{}}applySelection(t){try{let r=new Set,o=t.ranges.map(({start:s,startOffset:u,end:n,endOffset:a})=>{let h=this.mirror.getNode(s),c=this.mirror.getNode(n);if(!h||!c)return;let i=new Range;i.setStart(h,u),i.setEnd(c,a);let p=h.ownerDocument,l=p?.getSelection();return l&&r.add(l),{range:i,selection:l}});r.forEach(s=>s.removeAllRanges()),o.forEach(s=>{var u;return s&&((u=s.selection)==null?void 0:u.addRange(s.range))})}catch{}}applyStyleSheetMutation(t){var r;let o=null;t.styleId?o=this.styleMirror.getStyle(t.styleId):t.id&&(o=((r=this.mirror.getNode(t.id))==null?void 0:r.sheet)||null),o&&(t.source===L.StyleSheetRule?this.applyStyleSheetRule(t,o):t.source===L.StyleDeclaration&&this.applyStyleDeclaration(t,o))}applyStyleSheetRule(t,r){var o,s,u,n;if((o=t.adds)==null||o.forEach(({rule:a,index:h})=>{try{if(Array.isArray(h)){let{positions:c,index:i}=rs(h),p=be(r.cssRules,c);p?.insertRule(a,i)}else{let c=h===void 0?void 0:Math.min(h,r.cssRules.length);r?.insertRule(a,c)}}catch{}}),(s=t.removes)==null||s.forEach(({index:a})=>{try{if(Array.isArray(a)){let{positions:h,index:c}=rs(a),i=be(r.cssRules,h);i?.deleteRule(c||0)}else r?.deleteRule(a)}catch{}}),typeof t.replace=="string")try{(u=r.replace)==null||u.call(r,t.replace)}catch{}if(typeof t.replaceSync=="string")try{(n=r.replaceSync)==null||n.call(r,t.replaceSync)}catch{}}applyStyleDeclaration(t,r){if(t.set){let o=be(r.rules,t.index);o?.style&&o.style.setProperty(t.set.property,t.set.value,t.set.priority)}if(t.remove){let o=be(r.rules,t.index);o?.style&&o.style.removeProperty(t.remove.property)}}applyAdoptedStyleSheet(t){var r;let o=this.mirror.getNode(t.id);if(!o)return;(r=t.styles)==null||r.forEach(a=>{var h;let c=null,i=null;if(De(o)?i=((h=o.ownerDocument)==null?void 0:h.defaultView)||null:o.nodeName==="#document"&&(i=o.defaultView),!!i)try{c=new i.CSSStyleSheet,this.styleMirror.add(c,a.styleId),this.applyStyleSheetRule({source:L.StyleSheetRule,adds:a.rules},c)}catch{}});let s=10,u=0,n=(a,h)=>{let c=h.map(i=>this.styleMirror.getStyle(i)).filter(i=>i!==null);De(a)?a.shadowRoot.adoptedStyleSheets=c:a.nodeName==="#document"&&(a.adoptedStyleSheets=c),c.length!==h.length&&u<s&&(setTimeout(()=>n(a,h),0+100*u),u++)};n(o,t.styleIds)}legacy_resolveMissingNode(t,r,o,s){let{previousId:u,nextId:n}=s,a=u&&t[u],h=n&&t[n];if(a){let{node:c,mutation:i}=a;r.insertBefore(c,o),delete t[i.node.id],delete this.legacy_missingNodeRetryMap[i.node.id],(i.previousId||i.nextId)&&this.legacy_resolveMissingNode(t,r,c,i)}if(h){let{node:c,mutation:i}=h;r.insertBefore(c,o.nextSibling),delete t[i.node.id],delete this.legacy_missingNodeRetryMap[i.node.id],(i.previousId||i.nextId)&&this.legacy_resolveMissingNode(t,r,c,i)}}moveAndHover(t,r,o,s,u){let n=this.mirror.getNode(o);if(!n)return this.debugNodeNotFound(u,o);let a=Bs(n,this.iframe),h=t*a.absoluteScale+a.x,c=r*a.absoluteScale+a.y;this.mouse.style.left=`${h}px`,this.mouse.style.top=`${c}px`,s||this.drawMouseTail({x:h,y:c}),this.hoverElements(n)}drawMouseTail(t){if(!this.mouseTail)return;let{lineCap:r,lineWidth:o,strokeStyle:s,duration:u}=this.config.mouseTail===!0?ar:Object.assign({},ar,this.config.mouseTail),n=()=>{if(!this.mouseTail)return;let a=this.mouseTail.getContext("2d");!a||!this.tailPositions.length||(a.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),a.beginPath(),a.lineWidth=o,a.lineCap=r,a.strokeStyle=s,a.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(h=>a.lineTo(h.x,h.y)),a.stroke())};this.tailPositions.push(t),n(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(a=>a!==t),n()},u/this.speedService.state.context.timer.speed)}hoverElements(t){var r;(r=this.lastHoveredRootNode||this.iframe.contentDocument)==null||r.querySelectorAll(".\\\\:hover").forEach(s=>{s.classList.remove(":hover")}),this.lastHoveredRootNode=t.getRootNode();let o=t;for(;o;)o.classList&&o.classList.add(":hover"),o=o.parentElement}isUserInteraction(t){return t.type!==$.IncrementalSnapshot?!1:t.data.source>L.Mutation&&t.data.source<=L.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(I.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(t,r){this.warn(`Node with id \'${r}\' not found. `,t)}warnCanvasMutationFailed(t,r){this.warn("Has error on canvas update",r,"canvas mutation:",t)}debugNodeNotFound(t,r){this.debug(`Node with id \'${r}\' not found. `,t)}warn(...t){this.config.showWarning&&this.config.logger.warn(fs,...t)}debug(...t){this.config.showDebug&&this.config.logger.log(fs,...t)}};var Vs=`.replayer-wrapper {\n position: relative;\n}\n.replayer-mouse {\n position: absolute;\n width: 20px;\n height: 20px;\n transition: left 0.05s linear, top 0.05s linear;\n background-size: contain;\n background-position: center center;\n background-repeat: no-repeat;\n background-image: url(\'data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzMwMHB4JyB3aWR0aD0nMzAwcHgnICBmaWxsPSIjMDAwMDAwIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGRhdGEtbmFtZT0iTGF5ZXIgMSIgdmlld0JveD0iMCAwIDUwIDUwIiB4PSIwcHgiIHk9IjBweCI+PHRpdGxlPkRlc2lnbl90bnA8L3RpdGxlPjxwYXRoIGQ9Ik00OC43MSw0Mi45MUwzNC4wOCwyOC4yOSw0NC4zMywxOEExLDEsMCwwLDAsNDQsMTYuMzlMMi4zNSwxLjA2QTEsMSwwLDAsMCwxLjA2LDIuMzVMMTYuMzksNDRhMSwxLDAsMCwwLDEuNjUuMzZMMjguMjksMzQuMDgsNDIuOTEsNDguNzFhMSwxLDAsMCwwLDEuNDEsMGw0LjM4LTQuMzhBMSwxLDAsMCwwLDQ4LjcxLDQyLjkxWm0tNS4wOSwzLjY3TDI5LDMyYTEsMSwwLDAsMC0xLjQxLDBsLTkuODUsOS44NUwzLjY5LDMuNjlsMzguMTIsMTRMMzIsMjcuNThBMSwxLDAsMCwwLDMyLDI5TDQ2LjU5LDQzLjYyWiI+PC9wYXRoPjwvc3ZnPg==\');\n border-color: transparent; /* otherwise we transition from black when .touch-device class is added */\n}\n.replayer-mouse::after {\n content: \'\';\n display: inline-block;\n width: 20px;\n height: 20px;\n background: rgb(73, 80, 246);\n border-radius: 100%;\n transform: translate(-50%, -50%);\n opacity: 0.3;\n}\n.replayer-mouse.active::after {\n animation: click 0.2s ease-in-out 1;\n}\n.replayer-mouse.touch-device {\n background-image: none; /* there\'s no passive cursor on touch-only screens */\n width: 70px;\n height: 70px;\n border-width: 4px;\n border-style: solid;\n border-radius: 100%;\n margin-left: -37px;\n margin-top: -37px;\n border-color: rgba(73, 80, 246, 0);\n transition: left 0s linear, top 0s linear, border-color 0.2s ease-in-out;\n}\n.replayer-mouse.touch-device.touch-active {\n border-color: rgba(73, 80, 246, 1);\n transition: left 0.25s linear, top 0.25s linear, border-color 0.2s ease-in-out;\n}\n.replayer-mouse.touch-device::after {\n opacity: 0; /* there\'s no passive cursor on touch-only screens */\n}\n.replayer-mouse.touch-device.active::after {\n animation: touch-click 0.2s ease-in-out 1;\n}\n.replayer-mouse-tail {\n position: absolute;\n pointer-events: none;\n}\n\n@keyframes click {\n 0% {\n opacity: 0.3;\n width: 20px;\n height: 20px;\n }\n 50% {\n opacity: 0.5;\n width: 10px;\n height: 10px;\n }\n}\n\n@keyframes touch-click {\n 0% {\n opacity: 0;\n width: 20px;\n height: 20px;\n }\n 50% {\n opacity: 0.5;\n width: 10px;\n height: 10px;\n }\n}\n`;var Gs=document.createElement("style");Gs.textContent=Vs;document.head.append(Gs);globalThis.__HAI_FEEDBACK_REPLAY__=(e,t)=>new ze(e,{root:t,showWarning:!1,showDebug:!1,loadTimeout:1e3});})();\n' )
@@ -206,6 +207,8 @@ async function createFeedbackBundle(input) {
206
207
  const report = jsonObject(input.report);
207
208
  if (typeof report.id !== "string" || !SAFE_ID.test(report.id))
208
209
  throw new Error("Invalid report");
210
+ if (["appVersion", "buildId", "commit"].some((key) => report[key] !== void 0 && (typeof report[key] !== "string" || report[key].length > 128)))
211
+ throw new Error("Invalid build metadata");
209
212
  if (report.evidenceRevision !== void 0 && (typeof report.evidenceRevision !== "number" || !Number.isSafeInteger(report.evidenceRevision) || report.evidenceRevision < 0))
210
213
  throw new Error("Invalid evidence revision");
211
214
  const evidence = input.evidence.map(evidenceFrom);
@@ -226,7 +229,7 @@ async function createFeedbackBundle(input) {
226
229
  if (typeof attachment.id !== "string" || attachment.id.length < 1 || attachment.id.length > 128 || ids.has(attachment.id) || attachment.bytes.byteLength > MAX_FILE_BYTES)
227
230
  throw new Error("Invalid attachment");
228
231
  ids.add(attachment.id);
229
- const suffix = { "image/png": "png", "image/jpeg": "jpg", "image/webp": "webp", "text/plain": "txt", "application/json": "json" }[attachment.contentType] ?? "bin";
232
+ const suffix = { "image/png": "png", "image/jpeg": "jpg", "image/webp": "webp", "video/webm": "webm", "video/mp4": "mp4", "text/plain": "txt", "application/json": "json" }[attachment.contentType] ?? "bin";
230
233
  const path = `attachments/${await checksum(strToU8(JSON.stringify(attachment.id)))}.${suffix}`;
231
234
  const hash = await checksum(attachment.bytes);
232
235
  if (attachment.checksum && attachment.checksum !== hash)
@@ -245,7 +248,7 @@ async function createFeedbackBundle(input) {
245
248
  }
246
249
  files["manifest.json"] = strToU8(JSON.stringify(manifest, null, 2));
247
250
  const total = Object.values(files).reduce((sum, file) => sum + file.byteLength, 0);
248
- if (Object.keys(files).length > MAX_FILES || total > MAX_BYTES || Object.values(files).some((file) => file.byteLength > MAX_FILE_BYTES))
251
+ if (Object.keys(files).length > MAX_FILES || total > Math.min(input.maxBytes ?? MAX_BYTES, MAX_BYTES) || Object.values(files).some((file) => file.byteLength > MAX_FILE_BYTES))
249
252
  throw new Error("Bundle limits exceeded");
250
253
  return ok(zipSync(files, { level: 1, mtime: new Date(1980, 0, 1) }));
251
254
  } catch {
@@ -270,6 +273,8 @@ async function readFeedbackBundle(bytes, options) {
270
273
  if (total > limits.maxBytes)
271
274
  throw new Error("Bundle expansion limit");
272
275
  const report = objectFromFile(files, "report.json");
276
+ if (["appVersion", "buildId", "commit"].some((key) => report[key] !== void 0 && (typeof report[key] !== "string" || report[key].length > 128)))
277
+ throw new Error("Invalid build metadata");
273
278
  if (typeof report.id !== "string" || report.id !== manifest.reportId)
274
279
  throw new Error("Report mismatch");
275
280
  const records = JSON.parse(strFromU8(files["evidence/records.json"] ?? new Uint8Array()));
@@ -329,5 +334,5 @@ function getFeedbackBundleViewerFiles() {
329
334
  }
330
335
 
331
336
  export { createFeedbackBundle, getFeedbackBundleViewerFiles, queryFeedbackBundle, readFeedbackBundle, summarizeFeedbackBundle };
332
- //# sourceMappingURL=chunk-43AOXE4W.js.map
333
- //# sourceMappingURL=chunk-43AOXE4W.js.map
337
+ //# sourceMappingURL=chunk-XQXX5WMV.js.map
338
+ //# sourceMappingURL=chunk-XQXX5WMV.js.map