@spectosh/browser 0.1.3 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
1
- Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var e=Object.defineProperty,t=(t,n,r)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r,n=(e,n,r)=>t(e,typeof n==`symbol`?n:n+``,r),r=Object.defineProperty,i=(e,t,n)=>t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,a=(e,t,n)=>i(e,typeof t==`symbol`?t:t+``,n),o=(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))(o||{}),s={Node:[`childNodes`,`parentNode`,`parentElement`,`textContent`,`ownerDocument`],ShadowRoot:[`host`,`styleSheets`],Element:[`shadowRoot`,`querySelector`,`querySelectorAll`],MutationObserver:[]},c={Node:[`contains`,`getRootNode`],ShadowRoot:[`getSelection`],Element:[],MutationObserver:[`constructor`]},l={},u={},d=()=>!!globalThis.Zone;function f(e){if(l[e])return l[e];let t=globalThis[e],n=t.prototype,r=e in s?s[e]:void 0,i=!!(r&&r.every(e=>!!(Object.getOwnPropertyDescriptor(n,e)?.get)?.toString().includes(`[native code]`))),a=e in c?c[e]:void 0,o=!!(a&&a.every(e=>typeof n[e]==`function`&&n[e]?.toString().includes(`[native code]`)));if(i&&o&&!d())return l[e]=t.prototype,t.prototype;try{let r=document.createElement(`iframe`);r.style.display=`none`,document.body.appendChild(r);let i=r.contentWindow;if(!i)return t.prototype;let a=i[e].prototype;if(!a)return r.remove(),n;let o=navigator.userAgent;return o.includes(`Safari`)&&!o.includes(`Chrome`)?(r.classList.add(`rr-block`),r.setAttribute(`__rrwebUntaintedMutationObserver`,``),u[e]=()=>r.remove()):r.remove(),l[e]=a}catch{return n}}var p={};function m(e,t,n){let r=`${e}.${String(n)}`;if(p[r])return p[r].call(t);let i=f(e),a=Object.getOwnPropertyDescriptor(i,n)?.get;return a?(p[r]=a,a.call(t)):t[n]}var h={};function g(e,t,n){let r=`${e}.${String(n)}`;if(h[r])return h[r].bind(t);let i=f(e)[n];return typeof i==`function`?(h[r]=i,i.bind(t)):t[n]}function _(e){return m(`Node`,e,`ownerDocument`)}function v(e){return m(`Node`,e,`childNodes`)}function y(e){return m(`Node`,e,`parentNode`)}function b(e){return m(`Node`,e,`parentElement`)}function x(e){return m(`Node`,e,`textContent`)}function S(e,t){return g(`Node`,e,`contains`)(t)}function C(e){return g(`Node`,e,`getRootNode`)()}function w(e){return!e||!(`host`in e)?null:m(`ShadowRoot`,e,`host`)}function ee(e){return e.styleSheets}function T(e){return!e||!(`shadowRoot`in e)?null:m(`Element`,e,`shadowRoot`)}function E(e,t){return m(`Element`,e,`querySelector`)(t)}function D(e,t){return m(`Element`,e,`querySelectorAll`)(t)}function O(){return[f(`MutationObserver`).constructor,u.MutationObserver??(()=>{})]}var k=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(k=()=>new Date().getTime());function te(e,t,n){try{if(!(t in e))return()=>{};let r=e[t],i=n(r);return typeof i==`function`&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch{return()=>{}}}var A={ownerDocument:_,childNodes:v,parentNode:y,parentElement:b,textContent:x,contains:S,getRootNode:C,host:w,styleSheets:ee,shadowRoot:T,querySelector:E,querySelectorAll:D,nowTimestamp:k,mutationObserverCtor:O,patch:te};function ne(e){return e.nodeType===e.ELEMENT_NODE}function j(e){let t=e&&`host`in e&&`mode`in e&&A.host(e)||null;return!!(t&&`shadowRoot`in t&&A.shadowRoot(t)===e)}function M(e){return Object.prototype.toString.call(e)===`[object ShadowRoot]`}function re(e){return e.includes(` background-clip: text;`)&&!e.includes(` -webkit-background-clip: text;`)&&(e=e.replace(/\sbackground-clip:\s*text;/g,` -webkit-background-clip: text; background-clip: text;`)),e}function ie(e){let{cssText:t}=e;if(t.split(`"`).length<3)return t;let n=[`@import`,`url(${JSON.stringify(e.href)})`];return e.layerName===``?n.push(`layer`):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(` `)+`;`}function ae(e){try{let t=e.rules||e.cssRules;if(!t)return null;let n=e.href;return!n&&e.ownerNode&&(n=e.ownerNode.baseURI),re(Array.from(t,e=>oe(e,n)).join(``))}catch{return null}}function oe(e,t){if(ce(e)){let t;try{t=ae(e.styleSheet)||ie(e)}catch{t=e.cssText}return e.styleSheet.href?be(t,e.styleSheet.href):t}else{let n=e.cssText;return N(e)&&e.selectorText.includes(`:`)&&(n=se(n)),t?be(n,t):n}}function se(e){return e.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,`$1\\$2`)}function ce(e){return`styleSheet`in e}function N(e){return`selectorText`in e}var P=class{constructor(){a(this,`idNodeMap`,new Map),a(this,`nodeMetaMap`,new WeakMap)}getId(e){return e?this.getMeta(e)?.id??-1:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){let t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){let n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){let n=this.getNode(e);if(n){let e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function le(){return new P}function F({element:e,maskInputOptions:t,tagName:n,type:r,value:i,maskInputFn:a}){let o=i||``,s=r&&ue(r);return(t[n.toLowerCase()]||s&&t[s])&&(o=a?a(o,e):`*`.repeat(o.length)),o}function ue(e){return e.toLowerCase()}var de=`__rrweb_original__`;function fe(e){let t=e.getContext(`2d`);if(!t)return!0;for(let n=0;n<e.width;n+=50)for(let r=0;r<e.height;r+=50){let i=t.getImageData,a=de in i?i[de]:i;if(new Uint32Array(a.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some(e=>e!==0))return!1}return!0}function pe(e){let t=e.type;return e.hasAttribute(`data-rr-is-password`)?`password`:t?ue(t):null}function me(e,t){let n;try{n=new URL(e,t??window.location.href)}catch{return null}return n.pathname.match(/\.([0-9a-z]+)(?:$)/i)?.[1]??null}function he(e){let t=``;return t=e.indexOf(`//`)>-1?e.split(`/`).slice(0,3).join(`/`):e.split(`/`)[0],t=t.split(`?`)[0],t}var ge=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,_e=/^(?:[a-z+]+:)?\/\//i,ve=/^www\..*/i,ye=/^(data:)([^,]*),(.*)/i;function be(e,t){return(e||``).replace(ge,(e,n,r,i,a,o)=>{let s=r||a||o,c=n||i||``;if(!s)return e;if(_e.test(s)||ve.test(s)||ye.test(s))return`url(${c}${s}${c})`;if(s[0]===`/`)return`url(${c}${he(t)+s}${c})`;let l=s.split(`#`)[0],u=s.substring(l.length),d=t.split(`#`)[0].split(`/`),f=l.split(`/`);d.pop();for(let e of f)if(e===`.`)continue;else e===`..`?d.pop():d.push(e);return`url(${c}${d.join(`/`)}${u}${c})`})}function xe(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,``):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,``).replace(/0px/g,`0`)}function Se(e,t,n=!1){let r=Array.from(t.childNodes),i=[],a=0;if(r.length>1&&e&&typeof e==`string`){let t=xe(e,n),o=t.length/e.length;for(let s=1;s<r.length;s++)if(r[s].textContent&&typeof r[s].textContent==`string`){let c=xe(r[s].textContent,n),l=3;for(;l<c.length&&(c[l].match(/[a-zA-Z0-9]/)||c.indexOf(c.substring(0,l),1)!==-1);l++);for(;l<c.length;l++){let u=c.substring(0,l),d=t.split(u),f=-1;if(d.length===2)f=d[0].length;else if(d.length>2&&d[0]===``&&r[s-1].textContent!==``)f=t.indexOf(u,1);else if(d.length===1){if(u=u.substring(0,u.length-1),d=t.split(u),d.length<=1)return i.push(e),i;l=101}else l===c.length-1&&(f=t.indexOf(u));if(d.length>=2&&l>100){let e=r[s-1].textContent;if(e&&typeof e==`string`){let n=xe(e).length;f=t.indexOf(u,n)}f===-1&&(f=d[0].length)}if(f!==-1){let s=Math.floor(f/o);for(;s>0&&s<e.length;){if(a+=1,a>50*r.length)return i.push(e),i;let c=xe(e.substring(0,s),n);if(c.length===f){i.push(e.substring(0,s)),e=e.substring(s),t=t.substring(f);break}else c.length<f?s+=Math.max(1,Math.floor((f-c.length)/o)):s-=Math.max(1,Math.floor((c.length-f)*o))}break}}}}return i.push(e),i}function Ce(e,t){return Se(e,t).join(`/* rr_split */`)}var we=1,Te=RegExp(`[^a-z0-9-_:]`),Ee=-2;function De(){return we++}function Oe(e){if(e instanceof HTMLFormElement)return`form`;let t=ue(e.tagName);return Te.test(t)?`div`:t}var ke,Ae,je=/^[^ \t\n\r\u000c]+/,Me=/^[, \t\n\r\u000c]+/;function Ne(e,t){if(t.trim()===``)return t;let n=0;function r(e){let r,i=e.exec(t.substring(n));return i?(r=i[0],n+=r.length,r):``}let i=[];for(;r(Me),!(n>=t.length);){let a=r(je);if(a.slice(-1)===`,`)a=Fe(e,a.substring(0,a.length-1)),i.push(a);else{let r=``;a=Fe(e,a);let o=!1;for(;;){let e=t.charAt(n);if(e===``){i.push((a+r).trim());break}else if(o)e===`)`&&(o=!1);else if(e===`,`){n+=1,i.push((a+r).trim());break}else e===`(`&&(o=!0);r+=e,n+=1}}}return i.join(`, `)}var Pe=new WeakMap;function Fe(e,t){return!t||t.trim()===``?t:Le(e,t)}function Ie(e){return!!(e.tagName===`svg`||e.ownerSVGElement)}function Le(e,t){let n=Pe.get(e);if(n||(n=e.createElement(`a`),Pe.set(e,n)),!t)t=``;else if(t.startsWith(`blob:`)||t.startsWith(`data:`))return t;return n.setAttribute(`href`,t),n.href}function Re(e,t,n,r){return r&&(n===`src`||n===`href`&&!(t===`use`&&r[0]===`#`)||n===`xlink:href`&&r[0]!==`#`||n===`background`&&[`table`,`td`,`th`].includes(t)?Fe(e,r):n===`srcset`?Ne(e,r):n===`style`?be(r,Le(e)):t===`object`&&n===`data`?Fe(e,r):r)}function ze(e,t,n){return[`video`,`audio`].includes(e)&&t===`autoplay`}function Be(e,t,n){try{if(typeof t==`string`){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){let r=e.classList[n];if(t.test(r))return!0}if(n)return e.matches(n)}catch{}return!1}function Ve(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return n?Ve(A.parentNode(e),t,n):!1;for(let n=e.classList.length;n--;){let r=e.classList[n];if(t.test(r))return!0}return n?Ve(A.parentNode(e),t,n):!1}function He(e,t,n,r){let i;if(ne(e)){if(i=e,!A.childNodes(i).length)return!1}else if(A.parentElement(e)===null)return!1;else i=A.parentElement(e);try{if(typeof t==`string`){if(r){if(i.closest(`.${t}`))return!0}else if(i.classList.contains(t))return!0}else if(Ve(i,t,r))return!0;if(n){if(r){if(i.closest(n))return!0}else if(i.matches(n))return!0}}catch{}return!1}function Ue(e,t,n){let r=e.contentWindow;if(!r)return;let i=!1,a;try{a=r.document.readyState}catch{return}if(a!==`complete`){let r=setTimeout(()=>{i||=(t(),!0)},n);e.addEventListener(`load`,()=>{clearTimeout(r),i=!0,t()});return}let o=`about:blank`;if(r.location.href!==o||e.src===o||e.src===``)return setTimeout(t,0),e.addEventListener(`load`,t);e.addEventListener(`load`,t)}function We(e,t,n){let r=!1,i;try{i=e.sheet}catch{return}if(i)return;let a=setTimeout(()=>{r||=(t(),!0)},n);e.addEventListener(`load`,()=>{clearTimeout(a),r=!0,t()})}function Ge(e,t){let{doc:n,mirror:r,blockClass:i,blockSelector:a,needsMask:s,inlineStylesheet:c,maskInputOptions:l={},maskTextFn:u,maskInputFn:d,dataURLOptions:f={},inlineImages:p,recordCanvas:m,keepIframeSrcFn:h,newlyAddedElement:g=!1,cssCaptured:_=!1}=t,v=Ke(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode===`CSS1Compat`?{type:o.Document,childNodes:[]}:{type:o.Document,childNodes:[],compatMode:e.compatMode};case e.DOCUMENT_TYPE_NODE:return{type:o.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:v};case e.ELEMENT_NODE:return Je(e,{doc:n,blockClass:i,blockSelector:a,inlineStylesheet:c,maskInputOptions:l,maskInputFn:d,dataURLOptions:f,inlineImages:p,recordCanvas:m,keepIframeSrcFn:h,newlyAddedElement:g,rootId:v});case e.TEXT_NODE:return qe(e,{doc:n,needsMask:s,maskTextFn:u,rootId:v,cssCaptured:_});case e.CDATA_SECTION_NODE:return{type:o.CDATA,textContent:``,rootId:v};case e.COMMENT_NODE:return{type:o.Comment,textContent:A.textContent(e)||``,rootId:v};default:return!1}}function Ke(e,t){if(!t.hasNode(e))return;let n=t.getId(e);return n===1?void 0:n}function qe(e,t){let{needsMask:n,maskTextFn:r,rootId:i,cssCaptured:a}=t,s=A.parentNode(e),c=s&&s.tagName,l=``,u=c===`STYLE`||void 0,d=c===`SCRIPT`||void 0;return d?l=`SCRIPT_PLACEHOLDER`:a||(l=A.textContent(e),u&&l&&(l=be(l,Le(t.doc)))),!u&&!d&&l&&n&&(l=r?r(l,A.parentElement(e)):l.replace(/[\S]/g,`*`)),{type:o.Text,textContent:l||``,rootId:i}}function Je(e,t){let{doc:n,blockClass:r,blockSelector:i,inlineStylesheet:a,maskInputOptions:s={},maskInputFn:c,dataURLOptions:l={},inlineImages:u,recordCanvas:d,keepIframeSrcFn:f,newlyAddedElement:p=!1,rootId:m}=t,h=Be(e,r,i),g=Oe(e),_={},v=e.attributes.length;for(let t=0;t<v;t++){let r=e.attributes[t];ze(g,r.name,r.value)||(_[r.name]=Re(n,g,ue(r.name),r.value))}if(g===`link`&&a){let t=Array.from(n.styleSheets).find(t=>t.href===e.href),r=null;t&&(r=ae(t)),r&&(delete _.rel,delete _.href,_._cssText=r)}if(g===`style`&&e.sheet){let t=ae(e.sheet);t&&(e.childNodes.length>1&&(t=Ce(t,e)),_._cssText=t)}if([`input`,`textarea`,`select`].includes(g)){let t=e.value,n=e.checked;_.type!==`radio`&&_.type!==`checkbox`&&_.type!==`submit`&&_.type!==`button`&&t?_.value=F({element:e,type:pe(e),tagName:g,value:t,maskInputOptions:s,maskInputFn:c}):n&&(_.checked=n)}if(g===`option`&&(e.selected&&!s.select?_.selected=!0:delete _.selected),g===`dialog`&&e.open&&(_.rr_open_mode=e.matches(`dialog:modal`)?`modal`:`non-modal`),g===`canvas`&&d){if(e.__context===`2d`)fe(e)||(_.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!(`__context`in e)){let t=e.toDataURL(l.type,l.quality),r=n.createElement(`canvas`);r.width=e.width,r.height=e.height,t!==r.toDataURL(l.type,l.quality)&&(_.rr_dataURL=t)}}if(g===`img`&&u){ke||(ke=n.createElement(`canvas`),Ae=ke.getContext(`2d`));let t=e,r=t.currentSrc||t.getAttribute(`src`)||`<unknown-src>`,i=t.crossOrigin,a=()=>{t.removeEventListener(`load`,a);try{ke.width=t.naturalWidth,ke.height=t.naturalHeight,Ae.drawImage(t,0,0),_.rr_dataURL=ke.toDataURL(l.type,l.quality)}catch(e){if(t.crossOrigin!==`anonymous`){t.crossOrigin=`anonymous`,t.complete&&t.naturalWidth!==0?a():t.addEventListener(`load`,a);return}else console.warn(`Cannot inline img src=${r}! Error: ${e}`)}t.crossOrigin===`anonymous`&&(i?_.crossOrigin=i:t.removeAttribute(`crossorigin`))};t.complete&&t.naturalWidth!==0?a():t.addEventListener(`load`,a)}if([`audio`,`video`].includes(g)){let t=_;t.rr_mediaState=e.paused?`paused`:`played`,t.rr_mediaCurrentTime=e.currentTime,t.rr_mediaPlaybackRate=e.playbackRate,t.rr_mediaMuted=e.muted,t.rr_mediaLoop=e.loop,t.rr_mediaVolume=e.volume}if(p||(e.scrollLeft&&(_.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(_.rr_scrollTop=e.scrollTop)),h){let{width:t,height:n}=e.getBoundingClientRect();_={class:_.class,rr_width:`${t}px`,rr_height:`${n}px`}}g===`iframe`&&!f(_.src)&&(e.contentDocument||(_.rr_src=_.src),delete _.src);let y;try{customElements.get(g)&&(y=!0)}catch{}return{type:o.Element,tagName:g,attributes:_,childNodes:[],isSVG:Ie(e)||void 0,needBlock:h,rootId:m,isCustom:y}}function I(e){return e==null?``:e.toLowerCase()}function Ye(e){return e===!0||e===`all`?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:e===`all`,headMetaDescKeywords:e===`all`,headTitleMutations:e===`all`}:e||{}}function Xe(e,t){return!!(t.comment&&e.type===o.Comment||e.type===o.Element&&(t.script&&(e.tagName===`script`||e.tagName===`link`&&(e.attributes.rel===`preload`&&e.attributes.as===`script`||e.attributes.rel===`modulepreload`)||e.tagName===`link`&&e.attributes.rel===`prefetch`&&typeof e.attributes.href==`string`&&me(e.attributes.href)===`js`)||t.headFavicon&&(e.tagName===`link`&&e.attributes.rel===`shortcut icon`||e.tagName===`meta`&&(I(e.attributes.name).match(/^msapplication-tile(image|color)$/)||I(e.attributes.name)===`application-name`||I(e.attributes.rel)===`icon`||I(e.attributes.rel)===`apple-touch-icon`||I(e.attributes.rel)===`shortcut icon`))||e.tagName===`meta`&&(t.headMetaDescKeywords&&I(e.attributes.name).match(/^description|keywords$/)||t.headMetaSocial&&(I(e.attributes.property).match(/^(og|twitter|fb):/)||I(e.attributes.name).match(/^(og|twitter):/)||I(e.attributes.name)===`pinterest`)||t.headMetaRobots&&(I(e.attributes.name)===`robots`||I(e.attributes.name)===`googlebot`||I(e.attributes.name)===`bingbot`)||t.headMetaHttpEquiv&&e.attributes[`http-equiv`]!==void 0||t.headMetaAuthorship&&(I(e.attributes.name)===`author`||I(e.attributes.name)===`generator`||I(e.attributes.name)===`framework`||I(e.attributes.name)===`publisher`||I(e.attributes.name)===`progid`||I(e.attributes.property).match(/^article:/)||I(e.attributes.property).match(/^product:/))||t.headMetaVerification&&(I(e.attributes.name)===`google-site-verification`||I(e.attributes.name)===`yandex-verification`||I(e.attributes.name)===`csrf-token`||I(e.attributes.name)===`p:domain_verify`||I(e.attributes.name)===`verify-v1`||I(e.attributes.name)===`verification`||I(e.attributes.name)===`shopify-checkout-api-token`))))}function Ze(e,t){let{doc:n,mirror:r,blockClass:i,blockSelector:a,maskTextClass:s,maskTextSelector:c,skipChild:l=!1,inlineStylesheet:u=!0,maskInputOptions:d={},maskTextFn:f,maskInputFn:p,slimDOMOptions:m,dataURLOptions:h={},inlineImages:g=!1,recordCanvas:_=!1,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b=5e3,onStylesheetLoad:x,stylesheetLoadTimeout:S=5e3,keepIframeSrcFn:C=()=>!1,newlyAddedElement:w=!1,cssCaptured:ee=!1}=t,{needsMask:T}=t,{preserveWhiteSpace:E=!0}=t;T||=He(e,s,c,T===void 0);let D=Ge(e,{doc:n,mirror:r,blockClass:i,blockSelector:a,needsMask:T,inlineStylesheet:u,maskInputOptions:d,maskTextFn:f,maskInputFn:p,dataURLOptions:h,inlineImages:g,recordCanvas:_,keepIframeSrcFn:C,newlyAddedElement:w,cssCaptured:ee});if(!D)return console.warn(e,`not serialized`),null;let O;O=r.hasNode(e)?r.getId(e):Xe(D,m)||!E&&D.type===o.Text&&!D.textContent.replace(/^\s+|\s+$/gm,``).length?Ee:De();let k=Object.assign(D,{id:O});if(r.add(e,k),O===Ee)return null;v&&v(e);let te=!l;if(k.type===o.Element){te&&=!k.needBlock,delete k.needBlock;let t=A.shadowRoot(e);t&&M(t)&&(k.isShadowHost=!0)}if((k.type===o.Document||k.type===o.Element)&&te){m.headWhitespace&&k.type===o.Element&&k.tagName===`head`&&(E=!1);let t={doc:n,mirror:r,blockClass:i,blockSelector:a,needsMask:T,maskTextClass:s,maskTextSelector:c,skipChild:l,inlineStylesheet:u,maskInputOptions:d,maskTextFn:f,maskInputFn:p,slimDOMOptions:m,dataURLOptions:h,inlineImages:g,recordCanvas:_,preserveWhiteSpace:E,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:x,stylesheetLoadTimeout:S,keepIframeSrcFn:C,cssCaptured:!1};if(!(k.type===o.Element&&k.tagName===`textarea`&&k.attributes.value!==void 0)){k.type===o.Element&&k.attributes._cssText!==void 0&&typeof k.attributes._cssText==`string`&&(t.cssCaptured=!0);for(let n of Array.from(A.childNodes(e))){let e=Ze(n,t);e&&k.childNodes.push(e)}}let w=null;if(ne(e)&&(w=A.shadowRoot(e)))for(let e of Array.from(A.childNodes(w))){let n=Ze(e,t);n&&(M(w)&&(n.isShadow=!0),k.childNodes.push(n))}}let re=A.parentNode(e);return re&&j(re)&&M(re)&&(k.isShadow=!0),k.type===o.Element&&k.tagName===`iframe`&&Ue(e,()=>{let t=e.contentDocument;if(t&&y){let n=Ze(t,{doc:t,mirror:r,blockClass:i,blockSelector:a,needsMask:T,maskTextClass:s,maskTextSelector:c,skipChild:!1,inlineStylesheet:u,maskInputOptions:d,maskTextFn:f,maskInputFn:p,slimDOMOptions:m,dataURLOptions:h,inlineImages:g,recordCanvas:_,preserveWhiteSpace:E,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:x,stylesheetLoadTimeout:S,keepIframeSrcFn:C});n&&y(e,n)}},b),k.type===o.Element&&k.tagName===`link`&&typeof k.attributes.rel==`string`&&(k.attributes.rel===`stylesheet`||k.attributes.rel===`preload`&&typeof k.attributes.href==`string`&&me(k.attributes.href)===`css`)&&We(e,()=>{if(x){let t=Ze(e,{doc:n,mirror:r,blockClass:i,blockSelector:a,needsMask:T,maskTextClass:s,maskTextSelector:c,skipChild:!1,inlineStylesheet:u,maskInputOptions:d,maskTextFn:f,maskInputFn:p,slimDOMOptions:m,dataURLOptions:h,inlineImages:g,recordCanvas:_,preserveWhiteSpace:E,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:x,stylesheetLoadTimeout:S,keepIframeSrcFn:C});t&&x(e,t)}},S),k}function Qe(e,t){let{mirror:n=new P,blockClass:r=`rr-block`,blockSelector:i=null,maskTextClass:a=`rr-mask`,maskTextSelector:o=null,inlineStylesheet:s=!0,inlineImages:c=!1,recordCanvas:l=!1,maskAllInputs:u=!1,maskTextFn:d,maskInputFn:f,slimDOM:p=!1,dataURLOptions:m,preserveWhiteSpace:h,onSerialize:g,onIframeLoad:_,iframeLoadTimeout:v,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:x=()=>!1}=t;return Ze(e,{doc:e,mirror:n,blockClass:r,blockSelector:i,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:s,maskInputOptions:u===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:u===!1?{password:!0}:u,maskTextFn:d,maskInputFn:f,slimDOMOptions:Ye(p),dataURLOptions:m,inlineImages:c,recordCanvas:l,preserveWhiteSpace:h,onSerialize:g,onIframeLoad:_,iframeLoadTimeout:v,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:x,newlyAddedElement:!1})}function $e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}function et(e){if(e.__esModule)return e;var t=e.default;if(typeof t==`function`){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var tt={exports:{}},nt;function rt(){if(nt)return tt.exports;nt=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 tt.exports=t(),tt.exports.createColors=t,tt.exports}var L=et(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:`Module`}))),it,at;function ot(){if(at)return it;at=1;let e=rt(),t=L;class n extends Error{constructor(e,t,r,i,a,o){super(e),this.name=`CssSyntaxError`,this.reason=e,a&&(this.file=a),i&&(this.source=i),o&&(this.plugin=o),t!==void 0&&r!==void 0&&(typeof t==`number`?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,n)}setMessage(){this.message=this.plugin?this.plugin+`: `:``,this.message+=this.file?this.file:`<css input>`,this.line!==void 0&&(this.message+=`:`+this.line+`:`+this.column),this.message+=`: `+this.reason}showSourceCode(n){if(!this.source)return``;let r=this.source;n??=e.isColorSupported,t&&n&&(r=t(r));let i=r.split(/\r?\n/),a=Math.max(this.line-3,0),o=Math.min(this.line+2,i.length),s=String(o).length,c,l;if(n){let{bold:t,gray:n,red:r}=e.createColors(!0);c=e=>t(r(e)),l=e=>n(e)}else c=l=e=>e;return i.slice(a,o).map((e,t)=>{let n=a+1+t,r=` `+(` `+n).slice(-s)+` | `;if(n===this.line){let t=l(r.replace(/\d/g,` `))+e.slice(0,this.column-1).replace(/[^\t]/g,` `);return c(`>`)+l(r)+e+`
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var e=Object.defineProperty,t=(t,n,r)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r,n=(e,n,r)=>t(e,typeof n==`symbol`?n:n+``,r),r=Object.defineProperty,i=(e,t,n)=>t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,a=(e,t,n)=>i(e,typeof t==`symbol`?t:t+``,n),o=(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))(o||{}),s={Node:[`childNodes`,`parentNode`,`parentElement`,`textContent`,`ownerDocument`,`firstChild`,`lastChild`,`nextSibling`,`previousSibling`],ShadowRoot:[`host`,`styleSheets`],Element:[`shadowRoot`,`querySelector`,`querySelectorAll`],MutationObserver:[]},c={Node:[`contains`,`getRootNode`],ShadowRoot:[`getSelection`],Element:[],MutationObserver:[`constructor`]},l={},u={},d=()=>!!globalThis.Zone;function f(e){if(l[e])return l[e];let t=globalThis[e],n=t.prototype,r=e in s?s[e]:void 0,i=!!(r&&r.every(e=>!!(Object.getOwnPropertyDescriptor(n,e)?.get)?.toString().includes(`[native code]`))),a=e in c?c[e]:void 0,o=!!(a&&a.every(e=>typeof n[e]==`function`&&n[e]?.toString().includes(`[native code]`)));if(i&&o&&!d())return l[e]=t.prototype,t.prototype;try{let r=document.createElement(`iframe`);r.style.display=`none`,document.body.appendChild(r);let i=r.contentWindow;if(!i)return t.prototype;let a=i[e].prototype;if(!a)return r.remove(),n;let o=navigator.userAgent;return o.includes(`Safari`)&&!o.includes(`Chrome`)?(r.classList.add(`rr-block`),r.setAttribute(`__rrwebUntaintedMutationObserver`,``),u[e]=()=>r.remove()):r.remove(),l[e]=a}catch{return n}}var p={};function m(e,t,n){let r=p[e]?.[n];if(r)return r.call(t);let i=f(e),a=Object.getOwnPropertyDescriptor(i,n)?.get;return a?((p[e]||(p[e]={}))[n]=a,a.call(t)):t[n]}var h={};function g(e,t,n){let r=`${e}.${String(n)}`;if(h[r])return h[r].bind(t);let i=f(e)[n];return typeof i==`function`?(h[r]=i,i.bind(t)):t[n]}function _(e){return m(`Node`,e,`ownerDocument`)}function v(e){return m(`Node`,e,`childNodes`)}function y(e){return m(`Node`,e,`parentNode`)}function b(e){return m(`Node`,e,`parentElement`)}function x(e){return m(`Node`,e,`textContent`)}function S(e){return m(`Node`,e,`firstChild`)}function C(e){return m(`Node`,e,`lastChild`)}function w(e){return m(`Node`,e,`nextSibling`)}function T(e){return m(`Node`,e,`previousSibling`)}function E(e,t){return g(`Node`,e,`contains`)(t)}function D(e){return g(`Node`,e,`getRootNode`)()}function O(e){return!e||!(`host`in e)?null:m(`ShadowRoot`,e,`host`)}function k(e){return e.styleSheets}function A(e){return!e||!(`shadowRoot`in e)?null:m(`Element`,e,`shadowRoot`)}function ee(e,t){return m(`Element`,e,`querySelector`)(t)}function j(e,t){return m(`Element`,e,`querySelectorAll`)(t)}function M(){return[f(`MutationObserver`).constructor,u.MutationObserver??(()=>{})]}var te=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(te=()=>new Date().getTime());function ne(e,t,n){try{if(!(t in e))return()=>{};let r=e[t],i=n(r);return typeof i==`function`&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch{return()=>{}}}var N={ownerDocument:_,childNodes:v,parentNode:y,parentElement:b,textContent:x,firstChild:S,lastChild:C,nextSibling:w,previousSibling:T,contains:E,getRootNode:D,host:O,styleSheets:k,shadowRoot:A,querySelector:ee,querySelectorAll:j,nowTimestamp:te,mutationObserverCtor:M,patch:ne};function re(e){return e.nodeType===e.ELEMENT_NODE}function P(e){let t=e&&`host`in e&&`mode`in e&&N.host(e)||null;return!!(t&&`shadowRoot`in t&&N.shadowRoot(t)===e)}function F(e){return Object.prototype.toString.call(e)===`[object ShadowRoot]`}function ie(e){return e.includes(` background-clip: text;`)&&!e.includes(` -webkit-background-clip: text;`)&&(e=e.replace(/\sbackground-clip:\s*text;/g,` -webkit-background-clip: text; background-clip: text;`)),e}function ae(e){let{cssText:t}=e;if(t.split(`"`).length<3)return t;let n=[`@import`,`url(${JSON.stringify(e.href)})`];return e.layerName===``?n.push(`layer`):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(` `)+`;`}function I(e){try{let t=e.rules||e.cssRules;if(!t)return null;let n=e.href;return!n&&e.ownerNode&&(n=e.ownerNode.baseURI),ie(Array.from(t,e=>L(e,n)).join(``))}catch{return null}}function L(e,t){if(se(e)){let t;try{t=I(e.styleSheet)||ae(e)}catch{t=e.cssText}return e.styleSheet.href?Se(t,e.styleSheet.href):t}{let n=e.cssText;return ce(e)&&e.selectorText.includes(`:`)&&(n=oe(n)),t?Se(n,t):n}}function oe(e){return e.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,`$1\\$2`)}function se(e){return`styleSheet`in e}function ce(e){return`selectorText`in e}var le=class{constructor(){a(this,`idNodeMap`,new Map),a(this,`nodeMetaMap`,new WeakMap)}getId(e){return e?this.getMeta(e)?.id??-1:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){let t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){let n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){let n=this.getNode(e);if(n){let e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function ue(){return new le}function de({element:e,maskInputOptions:t,tagName:n,type:r,value:i,maskInputFn:a}){let o=i||``,s=r&&fe(r);return(t[n.toLowerCase()]||s&&t[s])&&(o=a?a(o,e):`*`.repeat(o.length)),o}function fe(e){return e.toLowerCase()}var pe=`__rrweb_original__`;function me(e){let t=e.getContext(`2d`);if(!t)return!0;for(let n=0;n<e.width;n+=50)for(let r=0;r<e.height;r+=50){let i=t.getImageData,a=pe in i?i[pe]:i;if(new Uint32Array(a.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some(e=>e!==0))return!1}return!0}function he(e){let t=e.type;return e.hasAttribute(`data-rr-is-password`)?`password`:t?fe(t):null}function ge(e,t){let n;try{n=new URL(e,t??window.location.href)}catch{return null}return n.pathname.match(/\.([0-9a-z]+)(?:$)/i)?.[1]??null}function _e(e){let t=``;return t=e.indexOf(`//`)>-1?e.split(`/`).slice(0,3).join(`/`):e.split(`/`)[0],t=t.split(`?`)[0],t}var ve=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,ye=/^(?:[a-z+]+:)?\/\//i,be=/^www\..*/i,xe=/^(data:)([^,]*),(.*)/i;function Se(e,t){return(e||``).replace(ve,(e,n,r,i,a,o)=>{let s=r||a||o,c=n||i||``;if(!s)return e;if(ye.test(s)||be.test(s)||xe.test(s))return`url(${c}${s}${c})`;if(s[0]===`/`)return`url(${c}${_e(t)+s}${c})`;let l=s.split(`#`)[0],u=s.substring(l.length),d=t.split(`#`)[0].split(`/`),f=l.split(`/`);d.pop();for(let e of f)if(e===`.`)continue;else e===`..`?d.pop():d.push(e);return`url(${c}${d.join(`/`)}${u}${c})`})}function Ce(e,t=!1){return t?e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,``):e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,``).replace(/0px/g,`0`)}function we(e,t,n=!1){let r=Array.from(t.childNodes),i=[],a=0;if(r.length>1&&e&&typeof e==`string`){let t=Ce(e,n),o=t.length/e.length;for(let s=1;s<r.length;s++)if(r[s].textContent&&typeof r[s].textContent==`string`){let c=Ce(r[s].textContent,n),l=3;for(;l<c.length&&(c[l].match(/[a-zA-Z0-9]/)||c.indexOf(c.substring(0,l),1)!==-1);l++);for(;l<c.length;l++){let u=c.substring(0,l),d=t.split(u),f=-1;if(d.length===2)f=d[0].length;else if(d.length>2&&d[0]===``&&r[s-1].textContent!==``)f=t.indexOf(u,1);else if(d.length===1){if(u=u.substring(0,u.length-1),d=t.split(u),d.length<=1)return i.push(e),i;l=101}else l===c.length-1&&(f=t.indexOf(u));if(d.length>=2&&l>100){let e=r[s-1].textContent;if(e&&typeof e==`string`){let n=Ce(e).length;f=t.indexOf(u,n)}f===-1&&(f=d[0].length)}if(f!==-1){let s=Math.floor(f/o);for(;s>0&&s<e.length;){if(a+=1,a>50*r.length)return i.push(e),i;let c=Ce(e.substring(0,s),n);if(c.length===f){i.push(e.substring(0,s)),e=e.substring(s),t=t.substring(f);break}c.length<f?s+=Math.max(1,Math.floor((f-c.length)/o)):s-=Math.max(1,Math.floor((c.length-f)*o))}break}}}}return i.push(e),i}function Te(e,t){return we(e,t).join(`/* rr_split */`)}var Ee=1,De=RegExp(`[^a-z0-9-_:]`),Oe=-2;function ke(){return Ee++}function Ae(e){if(e instanceof HTMLFormElement)return`form`;let t=fe(e.tagName);return De.test(t)?`div`:t}var je,Me,Ne=/^[^ \t\n\r\u000c]+/,Pe=/^[, \t\n\r\u000c]+/;function Fe(e,t){if(t.trim()===``)return t;let n=0;function r(e){let r,i=e.exec(t.substring(n));return i?(r=i[0],n+=r.length,r):``}let i=[];for(;r(Pe),!(n>=t.length);){let a=r(Ne);if(a.slice(-1)===`,`)a=Le(e,a.substring(0,a.length-1)),i.push(a);else{let r=``;a=Le(e,a);let o=!1;for(;;){let e=t.charAt(n);if(e===``){i.push((a+r).trim());break}if(o)e===`)`&&(o=!1);else{if(e===`,`){n+=1,i.push((a+r).trim());break}e===`(`&&(o=!0)}r+=e,n+=1}}}return i.join(`, `)}var Ie=new WeakMap;function Le(e,t){return!t||t.trim()===``?t:ze(e,t)}function Re(e){return!!(e.tagName===`svg`||e.ownerSVGElement)}function ze(e,t){let n=Ie.get(e);if(n||(n=e.createElement(`a`),Ie.set(e,n)),!t)t=``;else if(t.startsWith(`blob:`)||t.startsWith(`data:`))return t;return n.setAttribute(`href`,t),n.href}function Be(e,t,n,r){return r&&(n===`src`||n===`href`&&(t!==`use`||r[0]!==`#`)||n===`xlink:href`&&r[0]!==`#`||n===`background`&&[`table`,`td`,`th`].includes(t)?Le(e,r):n===`srcset`?Fe(e,r):n===`style`?Se(r,ze(e)):t===`object`&&n===`data`?Le(e,r):r)}function Ve(e,t,n){return[`video`,`audio`].includes(e)&&fe(t)===`autoplay`}function He(e,t,n){try{if(typeof t==`string`){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){let r=e.classList[n];if(t.test(r))return!0}if(n)return e.matches(n)}catch{}return!1}function Ue(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return n?Ue(N.parentNode(e),t,n):!1;for(let n=e.classList.length;n--;){let r=e.classList[n];if(t.test(r))return!0}return n?Ue(N.parentNode(e),t,n):!1}function We(e,t,n,r){let i;if(re(e)){if(i=e,!N.childNodes(i).length)return!1}else if(N.parentElement(e)===null)return!1;else i=N.parentElement(e);try{if(typeof t==`string`){if(r){if(i.closest(`.${t}`))return!0}else if(i.classList.contains(t))return!0}else if(Ue(i,t,r))return!0;if(n){if(r){if(i.closest(n))return!0}else if(i.matches(n))return!0}}catch{}return!1}function Ge(e,t,n){let r=e.contentWindow;if(!r)return;let i=!1,a;try{a=r.document.readyState}catch{return}if(a!==`complete`){let r=setTimeout(()=>{i||=(t(),!0)},n);e.addEventListener(`load`,()=>{clearTimeout(r),i=!0,t()});return}let o=`about:blank`;if(r.location.href!==o||e.src===o||e.src===``)return setTimeout(t,0),e.addEventListener(`load`,t);e.addEventListener(`load`,t)}function Ke(e,t,n){let r=!1,i;try{i=e.sheet}catch{return}if(i)return;let a=setTimeout(()=>{r||=(t(),!0)},n);e.addEventListener(`load`,()=>{clearTimeout(a),r=!0,t()})}function qe(e,t){let{doc:n,mirror:r,blockClass:i,blockSelector:a,needsMask:s,inlineStylesheet:c,maskInputOptions:l={},maskTextFn:u,maskInputFn:d,dataURLOptions:f={},inlineImages:p,recordCanvas:m,keepIframeSrcFn:h,newlyAddedElement:g=!1,cssCaptured:_=!1}=t,v=Je(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode===`CSS1Compat`?{type:o.Document,childNodes:[]}:{type:o.Document,childNodes:[],compatMode:e.compatMode};case e.DOCUMENT_TYPE_NODE:return{type:o.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:v};case e.ELEMENT_NODE:return Xe(e,{doc:n,blockClass:i,blockSelector:a,inlineStylesheet:c,maskInputOptions:l,maskInputFn:d,dataURLOptions:f,inlineImages:p,recordCanvas:m,keepIframeSrcFn:h,newlyAddedElement:g,rootId:v});case e.TEXT_NODE:return Ye(e,{doc:n,needsMask:s,maskTextFn:u,rootId:v,cssCaptured:_});case e.CDATA_SECTION_NODE:return{type:o.CDATA,textContent:``,rootId:v};case e.COMMENT_NODE:return{type:o.Comment,textContent:N.textContent(e)||``,rootId:v};default:return!1}}function Je(e,t){if(!t.hasNode(e))return;let n=t.getId(e);return n===1?void 0:n}function Ye(e,t){let{needsMask:n,maskTextFn:r,rootId:i,cssCaptured:a}=t,s=N.parentNode(e),c=s&&s.tagName,l=``,u=c===`STYLE`||void 0,d=c===`SCRIPT`||void 0;return d?l=`SCRIPT_PLACEHOLDER`:a||(l=N.textContent(e),u&&l&&(l=Se(l,ze(t.doc)))),!u&&!d&&l&&n&&(l=r?r(l,N.parentElement(e)):l.replace(/[\S]/g,`*`)),{type:o.Text,textContent:l||``,rootId:i}}function Xe(e,t){let{doc:n,blockClass:r,blockSelector:i,inlineStylesheet:a,maskInputOptions:s={},maskInputFn:c,dataURLOptions:l={},inlineImages:u,recordCanvas:d,keepIframeSrcFn:f,newlyAddedElement:p=!1,rootId:m}=t,h=He(e,r,i),g=Ae(e),_={},v=e.attributes.length;for(let t=0;t<v;t++){let r=e.attributes[t];Ve(g,r.name,r.value)||(_[r.name]=Be(n,g,fe(r.name),r.value))}if(g===`link`&&a){let t=Array.from(n.styleSheets).find(t=>t.href===e.href),r=null;t&&(r=I(t)),r&&(delete _.rel,delete _.href,_._cssText=r)}if(g===`style`&&e.sheet){let t=I(e.sheet);t&&(e.childNodes.length>1&&(t=Te(t,e)),_._cssText=t)}if([`input`,`textarea`,`select`].includes(g)){let t=e.value,n=e.checked;_.type!==`radio`&&_.type!==`checkbox`&&_.type!==`submit`&&_.type!==`button`&&t?_.value=de({element:e,type:he(e),tagName:g,value:t,maskInputOptions:s,maskInputFn:c}):n&&(_.checked=n)}if(g===`option`&&(e.selected&&!s.select?_.selected=!0:delete _.selected),g===`dialog`&&e.open&&(_.rr_open_mode=e.matches(`dialog:modal`)?`modal`:`non-modal`),g===`canvas`&&d){if(e.__context===`2d`)me(e)||(_.rr_dataURL=e.toDataURL(l.type,l.quality));else if(!(`__context`in e)){let t=e.toDataURL(l.type,l.quality),r=n.createElement(`canvas`);r.width=e.width,r.height=e.height,t!==r.toDataURL(l.type,l.quality)&&(_.rr_dataURL=t)}}if(g===`img`&&u){je||(je=n.createElement(`canvas`),Me=je.getContext(`2d`));let t=e,r=t.currentSrc||t.getAttribute(`src`)||`<unknown-src>`,i=t.crossOrigin,a=()=>{t.removeEventListener(`load`,a);try{je.width=t.naturalWidth,je.height=t.naturalHeight,Me.drawImage(t,0,0),_.rr_dataURL=je.toDataURL(l.type,l.quality)}catch(e){if(t.crossOrigin!==`anonymous`){t.crossOrigin=`anonymous`,t.complete&&t.naturalWidth!==0?a():t.addEventListener(`load`,a);return}console.warn(`Cannot inline img src=${r}! Error: ${e}`)}t.crossOrigin===`anonymous`&&(i?_.crossOrigin=i:t.removeAttribute(`crossorigin`))};t.complete&&t.naturalWidth!==0?a():t.addEventListener(`load`,a)}if([`audio`,`video`].includes(g)){let t=_;t.rr_mediaState=e.paused?`paused`:`played`,t.rr_mediaCurrentTime=e.currentTime,t.rr_mediaPlaybackRate=e.playbackRate,t.rr_mediaMuted=e.muted,t.rr_mediaLoop=e.loop,t.rr_mediaVolume=e.volume}if(p||(e.scrollLeft&&(_.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(_.rr_scrollTop=e.scrollTop)),h){let{width:t,height:n}=e.getBoundingClientRect();_={class:_.class,rr_width:`${t}px`,rr_height:`${n}px`}}g===`iframe`&&!f(_.src)&&(e.contentDocument||(_.rr_src=_.src),delete _.src);let y;try{customElements.get(g)&&(y=!0)}catch{}return{type:o.Element,tagName:g,attributes:_,childNodes:[],isSVG:Re(e)||void 0,needBlock:h,rootId:m,isCustom:y}}function R(e){return e==null?``:e.toLowerCase()}function Ze(e){return e===!0||e===`all`?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:e===`all`,headMetaDescKeywords:e===`all`,headTitleMutations:e===`all`}:e||{}}function Qe(e,t){return!!(t.comment&&e.type===o.Comment||e.type===o.Element&&(t.script&&(e.tagName===`script`||e.tagName===`link`&&(e.attributes.rel===`preload`&&e.attributes.as===`script`||e.attributes.rel===`modulepreload`)||e.tagName===`link`&&e.attributes.rel===`prefetch`&&typeof e.attributes.href==`string`&&ge(e.attributes.href)===`js`)||t.headFavicon&&(e.tagName===`link`&&e.attributes.rel===`shortcut icon`||e.tagName===`meta`&&(R(e.attributes.name).match(/^msapplication-tile(image|color)$/)||R(e.attributes.name)===`application-name`||R(e.attributes.rel)===`icon`||R(e.attributes.rel)===`apple-touch-icon`||R(e.attributes.rel)===`shortcut icon`))||e.tagName===`meta`&&(t.headMetaDescKeywords&&R(e.attributes.name).match(/^description|keywords$/)||t.headMetaSocial&&(R(e.attributes.property).match(/^(og|twitter|fb):/)||R(e.attributes.name).match(/^(og|twitter):/)||R(e.attributes.name)===`pinterest`)||t.headMetaRobots&&(R(e.attributes.name)===`robots`||R(e.attributes.name)===`googlebot`||R(e.attributes.name)===`bingbot`)||t.headMetaHttpEquiv&&e.attributes[`http-equiv`]!==void 0||t.headMetaAuthorship&&(R(e.attributes.name)===`author`||R(e.attributes.name)===`generator`||R(e.attributes.name)===`framework`||R(e.attributes.name)===`publisher`||R(e.attributes.name)===`progid`||R(e.attributes.property).match(/^article:/)||R(e.attributes.property).match(/^product:/))||t.headMetaVerification&&(R(e.attributes.name)===`google-site-verification`||R(e.attributes.name)===`yandex-verification`||R(e.attributes.name)===`csrf-token`||R(e.attributes.name)===`p:domain_verify`||R(e.attributes.name)===`verify-v1`||R(e.attributes.name)===`verification`||R(e.attributes.name)===`shopify-checkout-api-token`))))}function $e(e,t){let{doc:n,mirror:r,blockClass:i,blockSelector:a,maskTextClass:s,maskTextSelector:c,skipChild:l=!1,inlineStylesheet:u=!0,maskInputOptions:d={},maskTextFn:f,maskInputFn:p,slimDOMOptions:m,dataURLOptions:h={},inlineImages:g=!1,recordCanvas:_=!1,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b=5e3,onStylesheetLoad:x,stylesheetLoadTimeout:S=5e3,keepIframeSrcFn:C=()=>!1,newlyAddedElement:w=!1,cssCaptured:T=!1}=t,{needsMask:E}=t,{preserveWhiteSpace:D=!0}=t;E||=We(e,s,c,E===void 0);let O=qe(e,{doc:n,mirror:r,blockClass:i,blockSelector:a,needsMask:E,inlineStylesheet:u,maskInputOptions:d,maskTextFn:f,maskInputFn:p,dataURLOptions:h,inlineImages:g,recordCanvas:_,keepIframeSrcFn:C,newlyAddedElement:w,cssCaptured:T});if(!O)return console.warn(e,`not serialized`),null;let k;k=r.hasNode(e)?r.getId(e):Qe(O,m)||!D&&O.type===o.Text&&!O.textContent.replace(/^\s+|\s+$/gm,``).length?Oe:ke();let A=Object.assign(O,{id:k});if(r.add(e,A),k===Oe)return null;v&&v(e);let ee=!l;if(A.type===o.Element){ee&&=!A.needBlock,delete A.needBlock;let t=N.shadowRoot(e);t&&F(t)&&(A.isShadowHost=!0)}if((A.type===o.Document||A.type===o.Element)&&ee){m.headWhitespace&&A.type===o.Element&&A.tagName===`head`&&(D=!1);let t={doc:n,mirror:r,blockClass:i,blockSelector:a,needsMask:E,maskTextClass:s,maskTextSelector:c,skipChild:l,inlineStylesheet:u,maskInputOptions:d,maskTextFn:f,maskInputFn:p,slimDOMOptions:m,dataURLOptions:h,inlineImages:g,recordCanvas:_,preserveWhiteSpace:D,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:x,stylesheetLoadTimeout:S,keepIframeSrcFn:C,cssCaptured:!1};if(A.type!==o.Element||A.tagName!==`textarea`||A.attributes.value===void 0){A.type===o.Element&&A.attributes._cssText!==void 0&&typeof A.attributes._cssText==`string`&&(t.cssCaptured=!0);for(let n of Array.from(N.childNodes(e))){let e=$e(n,t);e&&A.childNodes.push(e)}}let w=null;if(re(e)&&(w=N.shadowRoot(e)))for(let e of Array.from(N.childNodes(w))){let n=$e(e,t);n&&(F(w)&&(n.isShadow=!0),A.childNodes.push(n))}}let j=N.parentNode(e);return j&&P(j)&&F(j)&&(A.isShadow=!0),A.type===o.Element&&A.tagName===`iframe`&&Ge(e,()=>{let t=e.contentDocument;if(t&&y){let n=$e(t,{doc:t,mirror:r,blockClass:i,blockSelector:a,needsMask:E,maskTextClass:s,maskTextSelector:c,skipChild:!1,inlineStylesheet:u,maskInputOptions:d,maskTextFn:f,maskInputFn:p,slimDOMOptions:m,dataURLOptions:h,inlineImages:g,recordCanvas:_,preserveWhiteSpace:D,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:x,stylesheetLoadTimeout:S,keepIframeSrcFn:C});n&&y(e,n)}},b),A.type===o.Element&&A.tagName===`link`&&typeof A.attributes.rel==`string`&&(A.attributes.rel===`stylesheet`||A.attributes.rel===`preload`&&typeof A.attributes.href==`string`&&ge(A.attributes.href)===`css`)&&Ke(e,()=>{if(x){let t=$e(e,{doc:n,mirror:r,blockClass:i,blockSelector:a,needsMask:E,maskTextClass:s,maskTextSelector:c,skipChild:!1,inlineStylesheet:u,maskInputOptions:d,maskTextFn:f,maskInputFn:p,slimDOMOptions:m,dataURLOptions:h,inlineImages:g,recordCanvas:_,preserveWhiteSpace:D,onSerialize:v,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:x,stylesheetLoadTimeout:S,keepIframeSrcFn:C});t&&x(e,t)}},S),A}function et(e,t){let{mirror:n=new le,blockClass:r=`rr-block`,blockSelector:i=null,maskTextClass:a=`rr-mask`,maskTextSelector:o=null,inlineStylesheet:s=!0,inlineImages:c=!1,recordCanvas:l=!1,maskAllInputs:u=!1,maskTextFn:d,maskInputFn:f,slimDOM:p=!1,dataURLOptions:m,preserveWhiteSpace:h,onSerialize:g,onIframeLoad:_,iframeLoadTimeout:v,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:x=()=>!1}=t;return $e(e,{doc:e,mirror:n,blockClass:r,blockSelector:i,maskTextClass:a,maskTextSelector:o,skipChild:!1,inlineStylesheet:s,maskInputOptions:u===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:u===!1?{password:!0}:u,maskTextFn:d,maskInputFn:f,slimDOMOptions:Ze(p),dataURLOptions:m,inlineImages:c,recordCanvas:l,preserveWhiteSpace:h,onSerialize:g,onIframeLoad:_,iframeLoadTimeout:v,onStylesheetLoad:y,stylesheetLoadTimeout:b,keepIframeSrcFn:x,newlyAddedElement:!1})}function tt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}function nt(e){if(e.__esModule)return e;var t=e.default;if(typeof t==`function`){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var rt={exports:{}},it;function at(){if(it)return rt.exports;it=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 rt.exports=t(),rt.exports.createColors=t,rt.exports}var z=nt(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:`Module`}))),ot,st;function ct(){if(st)return ot;st=1;let e=at(),t=z;class n extends Error{constructor(e,t,r,i,a,o){super(e),this.name=`CssSyntaxError`,this.reason=e,a&&(this.file=a),i&&(this.source=i),o&&(this.plugin=o),t!==void 0&&r!==void 0&&(typeof t==`number`?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,n)}setMessage(){this.message=this.plugin?this.plugin+`: `:``,this.message+=this.file?this.file:`<css input>`,this.line!==void 0&&(this.message+=`:`+this.line+`:`+this.column),this.message+=`: `+this.reason}showSourceCode(n){if(!this.source)return``;let r=this.source;n??=e.isColorSupported,t&&n&&(r=t(r));let i=r.split(/\r?\n/),a=Math.max(this.line-3,0),o=Math.min(this.line+2,i.length),s=String(o).length,c,l;if(n){let{bold:t,gray:n,red:r}=e.createColors(!0);c=e=>t(r(e)),l=e=>n(e)}else c=l=e=>e;return i.slice(a,o).map((e,t)=>{let n=a+1+t,r=` `+(` `+n).slice(-s)+` | `;if(n===this.line){let t=l(r.replace(/\d/g,` `))+e.slice(0,this.column-1).replace(/[^\t]/g,` `);return c(`>`)+l(r)+e+`
2
2
  `+t+c(`^`)}return` `+l(r)+e}).join(`
3
3
  `)}toString(){let e=this.showSourceCode();return e&&=`
4
4
 
5
5
  `+e+`
6
- `,this.name+`: `+this.message+e}}return it=n,n.default=n,it}var st={},ct;function lt(){return ct?st:(ct=1,st.isClean=Symbol(`isClean`),st.my=Symbol(`my`),st)}var ut,dt;function ft(){if(dt)return ut;dt=1;let e={after:`
6
+ `,this.name+`: `+this.message+e}}return ot=n,n.default=n,ot}var lt={},ut;function dt(){return ut?lt:(ut=1,lt.isClean=Symbol(`isClean`),lt.my=Symbol(`my`),lt)}var ft,pt;function mt(){if(pt)return ft;pt=1;let e={after:`
7
7
  `,beforeClose:`
8
8
  `,beforeComment:`
9
9
  `,beforeDecl:`
@@ -14,24 +14,24 @@ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{val
14
14
  `)&&(n=n.replace(/[^\n]+$/,``)),!1}),n===void 0?n=this.raw(t,null,`beforeDecl`):n&&=n.replace(/\S/g,``),n}rawBeforeDecl(e,t){let n;return e.walkDecls(e=>{if(e.raws.before!==void 0)return n=e.raws.before,n.includes(`
15
15
  `)&&(n=n.replace(/[^\n]+$/,``)),!1}),n===void 0?n=this.raw(t,null,`beforeRule`):n&&=n.replace(/\S/g,``),n}rawBeforeOpen(e){let t;return e.walk(e=>{if(e.type!==`decl`&&(t=e.raws.between,t!==void 0))return!1}),t}rawBeforeRule(e){let t;return e.walk(n=>{if(n.nodes&&(n.parent!==e||e.first!==n)&&n.raws.before!==void 0)return t=n.raws.before,t.includes(`
16
16
  `)&&(t=t.replace(/[^\n]+$/,``)),!1}),t&&=t.replace(/\S/g,``),t}rawColon(e){let t;return e.walkDecls(e=>{if(e.raws.between!==void 0)return t=e.raws.between.replace(/[^\s:]/g,``),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length===0&&(t=e.raws.after,t!==void 0))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(n=>{let r=n.parent;if(r&&r!==e&&r.parent&&r.parent===e&&n.raws.before!==void 0){let e=n.raws.before.split(`
17
- `);return t=e[e.length-1],t=t.replace(/\S/g,``),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&e.last.type===`decl`&&(t=e.raws.semicolon,t!==void 0))return!1}),t}rawValue(e,t){let n=e[t],r=e.raws[t];return r&&r.value===n?r.raw:n}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,`selector`)),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,`end`)}stringify(e,t){if(!this[e.type])throw Error(`Unknown AST node type `+e.type+`. Maybe you need to change PostCSS stringifier.`);this[e.type](e,t)}}return ut=n,n.default=n,ut}var pt,mt;function ht(){if(mt)return pt;mt=1;let e=ft();function t(t,n){new e(n).stringify(t)}return pt=t,t.default=t,pt}var gt,_t;function vt(){if(_t)return gt;_t=1;let{isClean:e,my:t}=lt(),n=ot(),r=ft(),i=ht();function a(e,t){let n=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r)||r===`proxyCache`)continue;let i=e[r],o=typeof i;r===`parent`&&o===`object`?t&&(n[r]=t):r===`source`?n[r]=i:Array.isArray(i)?n[r]=i.map(e=>a(e,n)):(o===`object`&&i!==null&&(i=a(i)),n[r]=i)}return n}class o{constructor(n={}){this.raws={},this[e]=!1,this[t]=!0;for(let e in n)if(e===`nodes`){this.nodes=[];for(let t of n[e])typeof t.clone==`function`?this.append(t.clone()):this.append(t)}else this[e]=n[e]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=a(this);for(let n in e)t[n]=e[n];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:n,start:r}=this.rangeBy(t);return this.source.input.error(e,{column:r.column,line:r.line},{column:n.column,line:n.line},t)}return new n(e)}getProxyProcessor(){return{get(e,t){return t===`proxyOf`?e:t===`root`?()=>e.root().toProxy():e[t]},set(e,t,n){return e[t]===n?!0:(e[t]=n,(t===`prop`||t===`value`||t===`name`||t===`params`||t===`important`||t===`text`)&&e.markDirty(),!0)}}}markDirty(){if(this[e]){this[e]=!1;let t=this;for(;t=t.parent;)t[e]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let n=this.source.start;if(e.index)n=this.positionInside(e.index,t);else if(e.word){t=this.toString();let r=t.indexOf(e.word);r!==-1&&(n=this.positionInside(r,t))}return n}positionInside(e,t){let n=t||this.toString(),r=this.source.start.column,i=this.source.start.line;for(let t=0;t<e;t++)n[t]===`
18
- `?(r=1,i+=1):r+=1;return{column:r,line:i}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let r=this.toString(),i=r.indexOf(e.word);i!==-1&&(t=this.positionInside(i,r),n=this.positionInside(i+e.word.length,r))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line}:typeof e.endIndex==`number`?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<t.line||n.line===t.line&&n.column<=t.column)&&(n={column:t.column+1,line:t.line}),{end:n,start:t}}raw(e,t){return new r().raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,n=!1;for(let r of e)r===this?n=!0:n?(this.parent.insertAfter(t,r),t=r):this.parent.insertBefore(t,r);n||this.remove()}return this}root(){let e=this;for(;e.parent&&e.parent.type!==`document`;)e=e.parent;return e}toJSON(e,t){let n={},r=t==null;t||=new Map;let i=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e)||e===`parent`||e===`proxyCache`)continue;let r=this[e];if(Array.isArray(r))n[e]=r.map(e=>typeof e==`object`&&e.toJSON?e.toJSON(null,t):e);else if(typeof r==`object`&&r.toJSON)n[e]=r.toJSON(null,t);else if(e===`source`){let a=t.get(r.input);a??(a=i,t.set(r.input,i),i++),n[e]={end:r.end,inputId:a,start:r.start}}else n[e]=r}return r&&(n.inputs=[...t.keys()].map(e=>e.toJSON())),n}toProxy(){return this.proxyCache||=new Proxy(this,this.getProxyProcessor()),this.proxyCache}toString(e=i){e.stringify&&(e=e.stringify);let t=``;return e(this,e=>{t+=e}),t}warn(e,t,n){let r={node:this};for(let e in n)r[e]=n[e];return e.warn(t,r)}get proxyOf(){return this}}return gt=o,o.default=o,gt}var yt,bt;function xt(){if(bt)return yt;bt=1;let e=vt();class t extends e{constructor(e){e&&e.value!==void 0&&typeof e.value!=`string`&&(e={...e,value:String(e.value)}),super(e),this.type=`decl`}get variable(){return this.prop.startsWith(`--`)||this.prop[0]===`$`}}return yt=t,t.default=t,yt}var St,Ct;function wt(){return Ct?St:(Ct=1,St={nanoid:(e=21)=>{let t=``,n=e;for(;n--;)t+=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`[Math.random()*64|0];return t},customAlphabet:(e,t=21)=>(n=t)=>{let r=``,i=n;for(;i--;)r+=e[Math.random()*e.length|0];return r}},St)}var Tt,Et;function Dt(){if(Et)return Tt;Et=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=L,{existsSync:n,readFileSync:r}=L,{dirname:i,join:a}=L;function o(e){return Buffer?Buffer.from(e,`base64`).toString():window.atob(e)}class s{constructor(e,t){if(t.map===!1)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,`data:`);let n=t.map?t.map.prev:void 0,r=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=i(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||=new e(this.text),this.consumerCache}decodeInline(e){let t=/^data:application\/json;charset=utf-?8;base64,/,n=/^data:application\/json;base64,/;if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(t.test(e)||n.test(e))return o(e.substr(RegExp.lastMatch.length));let r=e.match(/data:application\/json;([^,]+),/)[1];throw Error(`Unsupported source map encoding `+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,``).trim()}isMap(e){return typeof e==`object`?typeof e.mappings==`string`||typeof e._mappings==`string`||Array.isArray(e.sections):!1}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let n=e.lastIndexOf(t.pop()),r=e.indexOf(`*/`,n);n>-1&&r>-1&&(this.annotation=this.getAnnotationURL(e.substring(n,r)))}loadFile(e){if(this.root=i(e),n(e))return this.mapFile=e,r(e,`utf-8`).toString().trim()}loadMap(n,r){if(r===!1)return!1;if(r){if(typeof r==`string`)return r;if(typeof r==`function`){let e=r(n);if(e){let t=this.loadFile(e);if(!t)throw Error(`Unable to load previous source map: `+e.toString());return t}}else if(r instanceof e)return t.fromSourceMap(r).toString();else if(r instanceof t)return r.toString();else if(this.isMap(r))return JSON.stringify(r);else throw Error(`Unsupported previous source map format: `+r.toString())}else if(this.inline)return this.decodeInline(this.annotation);else if(this.annotation){let e=this.annotation;return n&&(e=a(i(n),e)),this.loadFile(e)}}startWith(e,t){return e?e.substr(0,t.length)===t:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return Tt=s,s.default=s,Tt}var Ot,kt;function At(){if(kt)return Ot;kt=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=L,{fileURLToPath:n,pathToFileURL:r}=L,{isAbsolute:i,resolve:a}=L,{nanoid:o}=wt(),s=L,c=ot(),l=Dt(),u=Symbol(`fromOffsetCache`),d=!!(e&&t),f=!!(a&&i);class p{constructor(e,t={}){if(e==null||typeof e==`object`&&!e.toString)throw Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),this.css[0]===``||this.css[0]===`￾`?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!f||/^\w+:\/\//.test(t.from)||i(t.from)?this.file=t.from:this.file=a(t.from)),f&&d){let e=new l(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id=`<input css `+o(6)+`>`),this.map&&(this.map.file=this.from)}error(e,t,n,i={}){let a,o,s;if(t&&typeof t==`object`){let e=t,r=n;if(typeof e.offset==`number`){let r=this.fromOffset(e.offset);t=r.line,n=r.col}else t=e.line,n=e.column;if(typeof r.offset==`number`){let e=this.fromOffset(r.offset);o=e.line,s=e.col}else o=r.line,s=r.column}else if(!n){let e=this.fromOffset(t);t=e.line,n=e.col}let l=this.origin(t,n,o,s);return a=l?new c(e,l.endLine===void 0?l.line:{column:l.column,line:l.line},l.endLine===void 0?l.column:{column:l.endColumn,line:l.endLine},l.source,l.file,i.plugin):new c(e,o===void 0?t:{column:n,line:t},o===void 0?n:{column:s,line:o},this.css,this.file,i.plugin),a.input={column:n,endColumn:s,endLine:o,line:t,source:this.css},this.file&&(r&&(a.input.url=r(this.file).toString()),a.input.file=this.file),a}fromOffset(e){let t,n;if(this[u])n=this[u];else{let e=this.css.split(`
19
- `);n=Array(e.length);let t=0;for(let r=0,i=e.length;r<i;r++)n[r]=t,t+=e[r].length+1;this[u]=n}t=n[n.length-1];let r=0;if(e>=t)r=n.length-1;else{let t=n.length-2,i;for(;r<t;)if(i=r+(t-r>>1),e<n[i])t=i-1;else if(e>=n[i+1])r=i+1;else{r=i;break}}return{col:e-n[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:a(this.map.consumer().sourceRoot||this.map.root||`.`,e)}origin(e,t,a,o){if(!this.map)return!1;let s=this.map.consumer(),c=s.originalPositionFor({column:t,line:e});if(!c.source)return!1;let l;typeof a==`number`&&(l=s.originalPositionFor({column:o,line:a}));let u;u=i(c.source)?r(c.source):new URL(c.source,this.map.consumer().sourceRoot||r(this.map.mapFile));let d={column:c.column,endColumn:l&&l.column,endLine:l&&l.line,line:c.line,url:u.toString()};if(u.protocol===`file:`)if(n)d.file=n(u);else throw Error(`file: protocol is not available in this PostCSS build`);let f=s.sourceContentFor(c.source);return f&&(d.source=f),d}toJSON(){let e={};for(let t of[`hasBOM`,`css`,`file`,`id`])this[t]!=null&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}}return Ot=p,p.default=p,s&&s.registerInput&&s.registerInput(p),Ot}var jt,Mt;function Nt(){if(Mt)return jt;Mt=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=L,{dirname:n,relative:r,resolve:i,sep:a}=L,{pathToFileURL:o}=L,s=At(),c=!!(e&&t),l=!!(n&&i&&r&&a);class u{constructor(e,t,n,r){this.stringify=e,this.mapOpts=n.map||{},this.root=t,this.opts=n,this.css=r,this.originalCSS=r,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?`data:application/json;base64,`+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation==`string`?this.mapOpts.annotation:typeof this.mapOpts.annotation==`function`?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+`.map`;let t=`
17
+ `);return t=e[e.length-1],t=t.replace(/\S/g,``),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&e.last.type===`decl`&&(t=e.raws.semicolon,t!==void 0))return!1}),t}rawValue(e,t){let n=e[t],r=e.raws[t];return r&&r.value===n?r.raw:n}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,`selector`)),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,`end`)}stringify(e,t){if(!this[e.type])throw Error(`Unknown AST node type `+e.type+`. Maybe you need to change PostCSS stringifier.`);this[e.type](e,t)}}return ft=n,n.default=n,ft}var ht,gt;function _t(){if(gt)return ht;gt=1;let e=mt();function t(t,n){new e(n).stringify(t)}return ht=t,t.default=t,ht}var vt,yt;function bt(){if(yt)return vt;yt=1;let{isClean:e,my:t}=dt(),n=ct(),r=mt(),i=_t();function a(e,t){let n=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r)||r===`proxyCache`)continue;let i=e[r],o=typeof i;r===`parent`&&o===`object`?t&&(n[r]=t):r===`source`?n[r]=i:Array.isArray(i)?n[r]=i.map(e=>a(e,n)):(o===`object`&&i!==null&&(i=a(i)),n[r]=i)}return n}class o{constructor(n={}){this.raws={},this[e]=!1,this[t]=!0;for(let e in n)if(e===`nodes`){this.nodes=[];for(let t of n[e])typeof t.clone==`function`?this.append(t.clone()):this.append(t)}else this[e]=n[e]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=a(this);for(let n in e)t[n]=e[n];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:n,start:r}=this.rangeBy(t);return this.source.input.error(e,{column:r.column,line:r.line},{column:n.column,line:n.line},t)}return new n(e)}getProxyProcessor(){return{get(e,t){return t===`proxyOf`?e:t===`root`?()=>e.root().toProxy():e[t]},set(e,t,n){return e[t]===n||(e[t]=n,(t===`prop`||t===`value`||t===`name`||t===`params`||t===`important`||t===`text`)&&e.markDirty(),!0)}}}markDirty(){if(this[e]){this[e]=!1;let t=this;for(;t=t.parent;)t[e]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let n=this.source.start;if(e.index)n=this.positionInside(e.index,t);else if(e.word){t=this.toString();let r=t.indexOf(e.word);r!==-1&&(n=this.positionInside(r,t))}return n}positionInside(e,t){let n=t||this.toString(),r=this.source.start.column,i=this.source.start.line;for(let t=0;t<e;t++)n[t]===`
18
+ `?(r=1,i+=1):r+=1;return{column:r,line:i}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let r=this.toString(),i=r.indexOf(e.word);i!==-1&&(t=this.positionInside(i,r),n=this.positionInside(i+e.word.length,r))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line}:typeof e.endIndex==`number`?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<t.line||n.line===t.line&&n.column<=t.column)&&(n={column:t.column+1,line:t.line}),{end:n,start:t}}raw(e,t){return new r().raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,n=!1;for(let r of e)r===this?n=!0:n?(this.parent.insertAfter(t,r),t=r):this.parent.insertBefore(t,r);n||this.remove()}return this}root(){let e=this;for(;e.parent&&e.parent.type!==`document`;)e=e.parent;return e}toJSON(e,t){let n={},r=t==null;t||=new Map;let i=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e)||e===`parent`||e===`proxyCache`)continue;let r=this[e];if(Array.isArray(r))n[e]=r.map(e=>typeof e==`object`&&e.toJSON?e.toJSON(null,t):e);else if(typeof r==`object`&&r.toJSON)n[e]=r.toJSON(null,t);else if(e===`source`){let a=t.get(r.input);a??(a=i,t.set(r.input,i),i++),n[e]={end:r.end,inputId:a,start:r.start}}else n[e]=r}return r&&(n.inputs=[...t.keys()].map(e=>e.toJSON())),n}toProxy(){return this.proxyCache||=new Proxy(this,this.getProxyProcessor()),this.proxyCache}toString(e=i){e.stringify&&(e=e.stringify);let t=``;return e(this,e=>{t+=e}),t}warn(e,t,n){let r={node:this};for(let e in n)r[e]=n[e];return e.warn(t,r)}get proxyOf(){return this}}return vt=o,o.default=o,vt}var xt,St;function Ct(){if(St)return xt;St=1;let e=bt();class t extends e{constructor(e){e&&e.value!==void 0&&typeof e.value!=`string`&&(e={...e,value:String(e.value)}),super(e),this.type=`decl`}get variable(){return this.prop.startsWith(`--`)||this.prop[0]===`$`}}return xt=t,t.default=t,xt}var wt,Tt;function Et(){return Tt?wt:(Tt=1,wt={nanoid:(e=21)=>{let t=``,n=e;for(;n--;)t+=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`[Math.random()*64|0];return t},customAlphabet:(e,t=21)=>(n=t)=>{let r=``,i=n;for(;i--;)r+=e[Math.random()*e.length|0];return r}},wt)}var Dt,Ot;function kt(){if(Ot)return Dt;Ot=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=z,{existsSync:n,readFileSync:r}=z,{dirname:i,join:a}=z;function o(e){return Buffer?Buffer.from(e,`base64`).toString():window.atob(e)}class s{constructor(e,t){if(t.map===!1)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,`data:`);let n=t.map?t.map.prev:void 0,r=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=i(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||=new e(this.text),this.consumerCache}decodeInline(e){let t=/^data:application\/json;charset=utf-?8;base64,/,n=/^data:application\/json;base64,/;if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(t.test(e)||n.test(e))return o(e.substr(RegExp.lastMatch.length));let r=e.match(/data:application\/json;([^,]+),/)[1];throw Error(`Unsupported source map encoding `+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,``).trim()}isMap(e){return typeof e==`object`?typeof e.mappings==`string`||typeof e._mappings==`string`||Array.isArray(e.sections):!1}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let n=e.lastIndexOf(t.pop()),r=e.indexOf(`*/`,n);n>-1&&r>-1&&(this.annotation=this.getAnnotationURL(e.substring(n,r)))}loadFile(e){if(this.root=i(e),n(e))return this.mapFile=e,r(e,`utf-8`).toString().trim()}loadMap(n,r){if(r===!1)return!1;if(r){if(typeof r==`string`)return r;if(typeof r==`function`){let e=r(n);if(e){let t=this.loadFile(e);if(!t)throw Error(`Unable to load previous source map: `+e.toString());return t}}else if(r instanceof e)return t.fromSourceMap(r).toString();else if(r instanceof t)return r.toString();else if(this.isMap(r))return JSON.stringify(r);else throw Error(`Unsupported previous source map format: `+r.toString())}else if(this.inline)return this.decodeInline(this.annotation);else if(this.annotation){let e=this.annotation;return n&&(e=a(i(n),e)),this.loadFile(e)}}startWith(e,t){return e?e.substr(0,t.length)===t:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return Dt=s,s.default=s,Dt}var At,jt;function Mt(){if(jt)return At;jt=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=z,{fileURLToPath:n,pathToFileURL:r}=z,{isAbsolute:i,resolve:a}=z,{nanoid:o}=Et(),s=z,c=ct(),l=kt(),u=Symbol(`fromOffsetCache`),d=!!(e&&t),f=!!(a&&i);class p{constructor(e,t={}){if(e==null||typeof e==`object`&&!e.toString)throw Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),this.css[0]===``||this.css[0]===`￾`?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(this.file=!f||/^\w+:\/\//.test(t.from)||i(t.from)?t.from:a(t.from)),f&&d){let e=new l(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id=`<input css `+o(6)+`>`),this.map&&(this.map.file=this.from)}error(e,t,n,i={}){let a,o,s;if(t&&typeof t==`object`){let e=t,r=n;if(typeof e.offset==`number`){let r=this.fromOffset(e.offset);t=r.line,n=r.col}else t=e.line,n=e.column;if(typeof r.offset==`number`){let e=this.fromOffset(r.offset);o=e.line,s=e.col}else o=r.line,s=r.column}else if(!n){let e=this.fromOffset(t);t=e.line,n=e.col}let l=this.origin(t,n,o,s);return a=l?new c(e,l.endLine===void 0?l.line:{column:l.column,line:l.line},l.endLine===void 0?l.column:{column:l.endColumn,line:l.endLine},l.source,l.file,i.plugin):new c(e,o===void 0?t:{column:n,line:t},o===void 0?n:{column:s,line:o},this.css,this.file,i.plugin),a.input={column:n,endColumn:s,endLine:o,line:t,source:this.css},this.file&&(r&&(a.input.url=r(this.file).toString()),a.input.file=this.file),a}fromOffset(e){let t,n;if(this[u])n=this[u];else{let e=this.css.split(`
19
+ `);n=Array(e.length);let t=0;for(let r=0,i=e.length;r<i;r++)n[r]=t,t+=e[r].length+1;this[u]=n}t=n[n.length-1];let r=0;if(e>=t)r=n.length-1;else{let t=n.length-2,i;for(;r<t;)if(i=r+(t-r>>1),e<n[i])t=i-1;else if(e>=n[i+1])r=i+1;else{r=i;break}}return{col:e-n[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:a(this.map.consumer().sourceRoot||this.map.root||`.`,e)}origin(e,t,a,o){if(!this.map)return!1;let s=this.map.consumer(),c=s.originalPositionFor({column:t,line:e});if(!c.source)return!1;let l;typeof a==`number`&&(l=s.originalPositionFor({column:o,line:a}));let u;u=i(c.source)?r(c.source):new URL(c.source,this.map.consumer().sourceRoot||r(this.map.mapFile));let d={column:c.column,endColumn:l&&l.column,endLine:l&&l.line,line:c.line,url:u.toString()};if(u.protocol===`file:`){if(n)d.file=n(u);else throw Error(`file: protocol is not available in this PostCSS build`)}let f=s.sourceContentFor(c.source);return f&&(d.source=f),d}toJSON(){let e={};for(let t of[`hasBOM`,`css`,`file`,`id`])this[t]!=null&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}}return At=p,p.default=p,s&&s.registerInput&&s.registerInput(p),At}var Nt,Pt;function Ft(){if(Pt)return Nt;Pt=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=z,{dirname:n,relative:r,resolve:i,sep:a}=z,{pathToFileURL:o}=z,s=Mt(),c=!!(e&&t),l=!!(n&&i&&r&&a);class u{constructor(e,t,n,r){this.stringify=e,this.mapOpts=n.map||{},this.root=t,this.opts=n,this.css=r,this.originalCSS=r,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?`data:application/json;base64,`+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation==`string`?this.mapOpts.annotation:typeof this.mapOpts.annotation==`function`?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+`.map`;let t=`
20
20
  `;this.css.includes(`\r
21
21
  `)&&(t=`\r
22
- `),this.css+=t+`/*# sourceMappingURL=`+e+` */`}applyPrevMaps(){for(let t of this.previous()){let r=this.toUrl(this.path(t.file)),i=t.root||n(t.file),a;this.mapOpts.sourcesContent===!1?(a=new e(t.text),a.sourcesContent&&=null):a=t.consumer(),this.map.applySourceMap(a,r,this.toUrl(this.path(i)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],e.type===`comment`&&e.text.indexOf(`# sourceMappingURL=`)===0&&this.root.removeChild(t)}else this.css&&=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,``)}generate(){if(this.clearAnnotation(),l&&c&&this.isMap())return this.generateMap();{let e=``;return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=t.fromSourceMap(e,{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 e=1,n=1,r=`<no source>`,i={generated:{column:0,line:0},original:{column:0,line:0},source:``},a,o;this.stringify(this.root,(t,s,c)=>{if(this.css+=t,s&&c!==`end`&&(i.generated.line=e,i.generated.column=n-1,s.source&&s.source.start?(i.source=this.sourcePath(s),i.original.line=s.source.start.line,i.original.column=s.source.start.column-1,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,this.map.addMapping(i))),a=t.match(/\n/g),a?(e+=a.length,o=t.lastIndexOf(`
23
- `),n=t.length-o):n+=t.length,s&&c!==`start`){let t=s.parent||{raws:{}};(!(s.type===`decl`||s.type===`atrule`&&!s.nodes)||s!==t.last||t.raws.semicolon)&&(s.source&&s.source.end?(i.source=this.sourcePath(s),i.original.line=s.source.end.line,i.original.column=s.source.end.column-1,i.generated.line=e,i.generated.column=n-2,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,i.generated.line=e,i.generated.column=n-1,this.map.addMapping(i)))}})}isAnnotation(){return this.isInline()?!0:this.mapOpts.annotation===void 0?!this.previous().length||this.previous().some(e=>e.annotation):this.mapOpts.annotation}isInline(){if(this.mapOpts.inline!==void 0)return this.mapOpts.inline;let e=this.mapOpts.annotation;return e!==void 0&&e!==!0?!1:!this.previous().length||this.previous().some(e=>e.inline)}isMap(){return this.opts.map===void 0?this.previous().length>0:!!this.opts.map}isSourcesContent(){return this.mapOpts.sourcesContent===void 0?!this.previous().length||this.previous().some(e=>e.withContent()):this.mapOpts.sourcesContent}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):`to.css`}path(e){if(this.mapOpts.absolute||e.charCodeAt(0)===60||/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let a=this.opts.to?n(this.opts.to):`.`;typeof this.mapOpts.annotation==`string`&&(a=n(i(a,this.mapOpts.annotation)));let o=r(a,e);return this.memoizedPaths.set(e,o),o}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new s(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let n=t.source.input.from;if(n&&!e[n]){e[n]=!0;let r=this.usesFileUrls?this.toFileUrl(n):this.toUrl(this.path(n));this.map.setSourceContent(r,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):`<no source>`;this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString(`base64`):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(o){let t=o(e).toString();return this.memoizedFileURLs.set(e,t),t}else throw Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;a===`\\`&&(e=e.replace(/\\/g,`/`));let n=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,n),n}}return jt=u,jt}var Pt,Ft;function It(){if(Ft)return Pt;Ft=1;let e=vt();class t extends e{constructor(e){super(e),this.type=`comment`}}return Pt=t,t.default=t,Pt}var Lt,Rt;function zt(){if(Rt)return Lt;Rt=1;let{isClean:e,my:t}=lt(),n=xt(),r=It(),i=vt(),a,o,s,c;function l(e){return e.map(e=>(e.nodes&&=l(e.nodes),delete e.source,e))}function u(t){if(t[e]=!1,t.proxyOf.nodes)for(let e of t.proxyOf.nodes)u(e)}class d extends i{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t=this.getIterator(),n,r;for(;this.indexes[t]<this.proxyOf.nodes.length&&(n=this.indexes[t],r=e(this.proxyOf.nodes[n],n),r!==!1);)this.indexes[t]+=1;return delete this.indexes[t],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||=0,this.indexes||={},this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get(e,t){return t===`proxyOf`?e:e[t]?t===`each`||typeof t==`string`&&t.startsWith(`walk`)?(...n)=>e[t](...n.map(e=>typeof e==`function`?(t,n)=>e(t.toProxy(),n):e)):t===`every`||t===`some`?n=>e[t]((e,...t)=>n(e.toProxy(),...t)):t===`root`?()=>e.root().toProxy():t===`nodes`?e.nodes.map(e=>e.toProxy()):t===`first`||t===`last`?e[t].toProxy():e[t]:e[t]},set(e,t,n){return e[t]===n?!0:(e[t]=n,(t===`name`||t===`params`||t===`selector`)&&e.markDirty(),!0)}}}index(e){return typeof e==`number`?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let n=this.index(e),r=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of r)this.proxyOf.nodes.splice(n+1,0,e);let i;for(let e in this.indexes)i=this.indexes[e],n<i&&(this.indexes[e]=i+r.length);return this.markDirty(),this}insertBefore(e,t){let n=this.index(e),r=n===0&&`prepend`,i=this.normalize(t,this.proxyOf.nodes[n],r).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n,0,e);let a;for(let e in this.indexes)a=this.indexes[e],n<=a&&(this.indexes[e]=a+i.length);return this.markDirty(),this}normalize(i,c){if(typeof i==`string`)i=l(a(i).nodes);else if(i===void 0)i=[];else if(Array.isArray(i)){i=i.slice(0);for(let e of i)e.parent&&e.parent.removeChild(e,`ignore`)}else if(i.type===`root`&&this.type!==`document`){i=i.nodes.slice(0);for(let e of i)e.parent&&e.parent.removeChild(e,`ignore`)}else if(i.type)i=[i];else if(i.prop){if(i.value===void 0)throw Error(`Value field is missed in node creation`);typeof i.value!=`string`&&(i.value=String(i.value)),i=[new n(i)]}else if(i.selector)i=[new o(i)];else if(i.name)i=[new s(i)];else if(i.text)i=[new r(i)];else throw Error(`Unknown node type in node creation`);return i.map(n=>(n[t]||d.rebuild(n),n=n.proxyOf,n.parent&&n.parent.removeChild(n),n[e]&&u(n),n.raws.before===void 0&&c&&c.raws.before!==void 0&&(n.raws.before=c.raws.before.replace(/\S/g,``)),n.parent=this.proxyOf,n))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,`prepend`).reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let t;for(let n in this.indexes)t=this.indexes[n],t>=e&&(this.indexes[n]=t-1);return this.markDirty(),this}replaceValues(e,t,n){return n||(n=t,t={}),this.walkDecls(r=>{t.props&&!t.props.includes(r.prop)||t.fast&&!r.value.includes(t.fast)||(r.value=r.value.replace(e,n))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,n)=>{let r;try{r=e(t,n)}catch(e){throw t.addToError(e)}return r!==!1&&t.walk&&(r=t.walk(e)),r})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if(n.type===`atrule`&&e.test(n.name))return t(n,r)}):this.walk((n,r)=>{if(n.type===`atrule`&&n.name===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if(e.type===`atrule`)return t(e,n)}))}walkComments(e){return this.walk((t,n)=>{if(t.type===`comment`)return e(t,n)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if(n.type===`decl`&&e.test(n.prop))return t(n,r)}):this.walk((n,r)=>{if(n.type===`decl`&&n.prop===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if(e.type===`decl`)return t(e,n)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if(n.type===`rule`&&e.test(n.selector))return t(n,r)}):this.walk((n,r)=>{if(n.type===`rule`&&n.selector===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if(e.type===`rule`)return t(e,n)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}return d.registerParse=e=>{a=e},d.registerRule=e=>{o=e},d.registerAtRule=e=>{s=e},d.registerRoot=e=>{c=e},Lt=d,d.default=d,d.rebuild=e=>{e.type===`atrule`?Object.setPrototypeOf(e,s.prototype):e.type===`rule`?Object.setPrototypeOf(e,o.prototype):e.type===`decl`?Object.setPrototypeOf(e,n.prototype):e.type===`comment`?Object.setPrototypeOf(e,r.prototype):e.type===`root`&&Object.setPrototypeOf(e,c.prototype),e[t]=!0,e.nodes&&e.nodes.forEach(e=>{d.rebuild(e)})},Lt}var Bt,Vt;function Ht(){if(Vt)return Bt;Vt=1;let e=zt(),t,n;class r extends e{constructor(e){super({type:`document`,...e}),this.nodes||=[]}toResult(e={}){return new t(new n,this,e).stringify()}}return r.registerLazyResult=e=>{t=e},r.registerProcessor=e=>{n=e},Bt=r,r.default=r,Bt}var Ut,Wt;function Gt(){if(Wt)return Ut;Wt=1;let e={};return Ut=function(t){e[t]||(e[t]=!0,typeof console<`u`&&console.warn&&console.warn(t))},Ut}var Kt,qt;function Jt(){if(qt)return Kt;qt=1;class e{constructor(e,t={}){if(this.type=`warning`,this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+`: `+this.text:this.text}}return Kt=e,e.default=e,Kt}var Yt,Xt;function Zt(){if(Xt)return Yt;Xt=1;let e=Jt();class t{constructor(e,t,n){this.processor=e,this.messages=[],this.root=t,this.opts=n,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,n={}){n.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(n.plugin=this.lastPlugin.postcssPlugin);let r=new e(t,n);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>e.type===`warning`)}get content(){return this.css}}return Yt=t,t.default=t,Yt}var Qt,$t;function en(){if($t)return Qt;$t=1;let e=/[\t\n\f\r "#'()/;[\\\]{}]/g,t=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,n=/.[\r\n"'(/\\]/,r=/[\da-f]/i;return Qt=function(i,a={}){let o=i.css.valueOf(),s=a.ignoreErrors,c,l,u,d,f,p,m,h,g,_,v=o.length,y=0,b=[],x=[];function S(){return y}function C(e){throw i.error(`Unclosed `+e,y)}function w(){return x.length===0&&y>=v}function ee(i){if(x.length)return x.pop();if(y>=v)return;let a=i?i.ignoreUnclosed:!1;switch(c=o.charCodeAt(y),c){case 10:case 32:case 9:case 13:case 12:l=y;do l+=1,c=o.charCodeAt(l);while(c===32||c===10||c===9||c===13||c===12);_=[`space`,o.slice(y,l)],y=l-1;break;case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let e=String.fromCharCode(c);_=[e,e,y];break}case 40:if(h=b.length?b.pop()[1]:``,g=o.charCodeAt(y+1),h===`url`&&g!==39&&g!==34&&g!==32&&g!==10&&g!==9&&g!==12&&g!==13){l=y;do{if(p=!1,l=o.indexOf(`)`,l+1),l===-1)if(s||a){l=y;break}else C(`bracket`);for(m=l;o.charCodeAt(m-1)===92;)--m,p=!p}while(p);_=[`brackets`,o.slice(y,l+1),y,l],y=l}else l=o.indexOf(`)`,y+1),d=o.slice(y,l+1),l===-1||n.test(d)?_=[`(`,`(`,y]:(_=[`brackets`,d,y,l],y=l);break;case 39:case 34:u=c===39?`'`:`"`,l=y;do{if(p=!1,l=o.indexOf(u,l+1),l===-1)if(s||a){l=y+1;break}else C(`string`);for(m=l;o.charCodeAt(m-1)===92;)--m,p=!p}while(p);_=[`string`,o.slice(y,l+1),y,l],y=l;break;case 64:e.lastIndex=y+1,e.test(o),l=e.lastIndex===0?o.length-1:e.lastIndex-2,_=[`at-word`,o.slice(y,l+1),y,l],y=l;break;case 92:for(l=y,f=!0;o.charCodeAt(l+1)===92;)l+=1,f=!f;if(c=o.charCodeAt(l+1),f&&c!==47&&c!==32&&c!==10&&c!==9&&c!==13&&c!==12&&(l+=1,r.test(o.charAt(l)))){for(;r.test(o.charAt(l+1));)l+=1;o.charCodeAt(l+1)===32&&(l+=1)}_=[`word`,o.slice(y,l+1),y,l],y=l;break;default:c===47&&o.charCodeAt(y+1)===42?(l=o.indexOf(`*/`,y+2)+1,l===0&&(s||a?l=o.length:C(`comment`)),_=[`comment`,o.slice(y,l+1),y,l],y=l):(t.lastIndex=y+1,t.test(o),l=t.lastIndex===0?o.length-1:t.lastIndex-2,_=[`word`,o.slice(y,l+1),y,l],b.push(_),y=l);break}return y++,_}function T(e){x.push(e)}return{back:T,endOfFile:w,nextToken:ee,position:S}},Qt}var tn,nn;function rn(){if(nn)return tn;nn=1;let e=zt();class t extends e{constructor(e){super(e),this.type=`atrule`}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}return tn=t,t.default=t,e.registerAtRule(t),tn}var an,on;function sn(){if(on)return an;on=1;let e=zt(),t,n;class r extends e{constructor(e){super(e),this.type=`root`,this.nodes||=[]}normalize(e,t,n){let r=super.normalize(e);if(t){if(n===`prepend`)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of r)e.raws.before=t.raws.before}return r}removeChild(e,t){let n=this.index(e);return!t&&n===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(e)}toResult(e={}){return new t(new n,this,e).stringify()}}return r.registerLazyResult=e=>{t=e},r.registerProcessor=e=>{n=e},an=r,r.default=r,e.registerRoot(r),an}var cn,ln;function un(){if(ln)return cn;ln=1;let e={comma(t){return e.split(t,[`,`],!0)},space(t){return e.split(t,[` `,`
24
- `,` `])},split(e,t,n){let r=[],i=``,a=!1,o=0,s=!1,c=``,l=!1;for(let n of e)l?l=!1:n===`\\`?l=!0:s?n===c&&(s=!1):n===`"`||n===`'`?(s=!0,c=n):n===`(`?o+=1:n===`)`?o>0&&--o:o===0&&t.includes(n)&&(a=!0),a?(i!==``&&r.push(i.trim()),i=``,a=!1):i+=n;return(n||i!==``)&&r.push(i.trim()),r}};return cn=e,e.default=e,cn}var dn,fn;function pn(){if(fn)return dn;fn=1;let e=zt(),t=un();class n extends e{constructor(e){super(e),this.type=`rule`,this.nodes||=[]}get selectors(){return t.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,n=t?t[0]:`,`+this.raw(`between`,`beforeOpen`);this.selector=e.join(n)}}return dn=n,n.default=n,e.registerRule(n),dn}var mn,hn;function gn(){if(hn)return mn;hn=1;let e=xt(),t=en(),n=It(),r=rn(),i=sn(),a=pn(),o={empty:!0,space:!0};function s(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}class c{constructor(e){this.input=e,this.root=new i,this.current=this.root,this.spaces=``,this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t=new r;t.name=e[1].slice(1),t.name===``&&this.unnamedAtrule(t,e),this.init(t,e[2]);let n,i,a,o=!1,s=!1,c=[],l=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),n=e[0],n===`(`||n===`[`?l.push(n===`(`?`)`:`]`):n===`{`&&l.length>0?l.push(`}`):n===l[l.length-1]&&l.pop(),l.length===0)if(n===`;`){t.source.end=this.getPosition(e[2]),t.source.end.offset++,this.semicolon=!0;break}else if(n===`{`){s=!0;break}else if(n===`}`){if(c.length>0){for(a=c.length-1,i=c[a];i&&i[0]===`space`;)i=c[--a];i&&(t.source.end=this.getPosition(i[3]||i[2]),t.source.end.offset++)}this.end(e);break}else c.push(e);else c.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}t.raws.between=this.spacesAndCommentsFromEnd(c),c.length?(t.raws.afterName=this.spacesAndCommentsFromStart(c),this.raw(t,`params`,c),o&&(e=c[c.length-1],t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,this.spaces=t.raws.between,t.raws.between=``)):(t.raws.afterName=``,t.params=``),s&&(t.nodes=[],this.current=t)}checkMissedSemicolon(e){let t=this.colon(e);if(t===!1)return;let n=0,r;for(let i=t-1;i>=0&&(r=e[i],!(r[0]!==`space`&&(n+=1,n===2)));i--);throw this.input.error(`Missed semicolon`,r[0]===`word`?r[3]+1:r[2])}colon(e){let t=0,n,r,i;for(let[a,o]of e.entries()){if(n=o,r=n[0],r===`(`&&(t+=1),r===`)`&&--t,t===0&&r===`:`)if(!i)this.doubleColon(n);else if(i[0]===`word`&&i[1]===`progid`)continue;else return a;i=n}return!1}comment(e){let t=new n;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text=``,t.raws.left=r,t.raws.right=``;else{let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(t,n){let r=new e;this.init(r,t[0][2]);let i=t[t.length-1];for(i[0]===`;`&&(this.semicolon=!0,t.pop()),r.source.end=this.getPosition(i[3]||i[2]||s(t)),r.source.end.offset++;t[0][0]!==`word`;)t.length===1&&this.unknownWord(t),r.raws.before+=t.shift()[1];for(r.source.start=this.getPosition(t[0][2]),r.prop=``;t.length;){let e=t[0][0];if(e===`:`||e===`space`||e===`comment`)break;r.prop+=t.shift()[1]}r.raws.between=``;let a;for(;t.length;)if(a=t.shift(),a[0]===`:`){r.raws.between+=a[1];break}else a[0]===`word`&&/\w/.test(a[1])&&this.unknownWord([a]),r.raws.between+=a[1];(r.prop[0]===`_`||r.prop[0]===`*`)&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let o=[],c;for(;t.length&&(c=t[0][0],!(c!==`space`&&c!==`comment`));)o.push(t.shift());this.precheckMissedSemicolon(t);for(let e=t.length-1;e>=0;e--){if(a=t[e],a[1].toLowerCase()===`!important`){r.important=!0;let n=this.stringFrom(t,e);n=this.spacesFromEnd(t)+n,n!==` !important`&&(r.raws.important=n);break}else if(a[1].toLowerCase()===`important`){let n=t.slice(0),i=``;for(let t=e;t>0;t--){let e=n[t][0];if(i.trim().indexOf(`!`)===0&&e!==`space`)break;i=n.pop()[1]+i}i.trim().indexOf(`!`)===0&&(r.important=!0,r.raws.important=i,t=n)}if(a[0]!==`space`&&a[0]!==`comment`)break}t.some(e=>e[0]!==`space`&&e[0]!==`comment`)&&(r.raws.between+=o.map(e=>e[1]).join(``),o=[]),this.raw(r,`value`,o.concat(t),n),r.value.includes(`:`)&&!n&&this.checkMissedSemicolon(t)}doubleColon(e){throw this.input.error(`Double colon`,{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new a;this.init(t,e[2]),t.selector=``,t.raws.between=``,this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||``)+this.spaces,this.spaces=``,this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||``)+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&e.type===`rule`&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces=``)}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces=``,e.type!==`comment`&&(this.semicolon=!1)}other(e){let t=!1,n=null,r=!1,i=null,a=[],o=e[1].startsWith(`--`),s=[],c=e;for(;c;){if(n=c[0],s.push(c),n===`(`||n===`[`)i||=c,a.push(n===`(`?`)`:`]`);else if(o&&r&&n===`{`)i||=c,a.push(`}`);else if(a.length===0)if(n===`;`)if(r){this.decl(s,o);return}else break;else if(n===`{`){this.rule(s);return}else if(n===`}`){this.tokenizer.back(s.pop()),t=!0;break}else n===`:`&&(r=!0);else n===a[a.length-1]&&(a.pop(),a.length===0&&(i=null));c=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),a.length>0&&this.unclosedBracket(i),t&&r){if(!o)for(;s.length&&(c=s[s.length-1][0],!(c!==`space`&&c!==`comment`));)this.tokenizer.back(s.pop());this.decl(s,o)}else this.unknownWord(s)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case`space`:this.spaces+=e[1];break;case`;`:this.freeSemicolon(e);break;case`}`:this.end(e);break;case`comment`:this.comment(e);break;case`at-word`:this.atrule(e);break;case`{`:this.emptyRule(e);break;default:this.other(e);break}this.endFile()}precheckMissedSemicolon(){}raw(e,t,n,r){let i,a,s=n.length,c=``,l=!0,u,d;for(let e=0;e<s;e+=1)i=n[e],a=i[0],a===`space`&&e===s-1&&!r?l=!1:a===`comment`?(d=n[e-1]?n[e-1][0]:`empty`,u=n[e+1]?n[e+1][0]:`empty`,!o[d]&&!o[u]?c.slice(-1)===`,`?l=!1:c+=i[1]:l=!1):c+=i[1];if(!l){let r=n.reduce((e,t)=>e+t[1],``);e.raws[t]={raw:r,value:c}}e[t]=c}rule(e){e.pop();let t=new a;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,`selector`,e),this.current=t}spacesAndCommentsFromEnd(e){let t,n=``;for(;e.length&&(t=e[e.length-1][0],!(t!==`space`&&t!==`comment`));)n=e.pop()[1]+n;return n}spacesAndCommentsFromStart(e){let t,n=``;for(;e.length&&(t=e[0][0],!(t!==`space`&&t!==`comment`));)n+=e.shift()[1];return n}spacesFromEnd(e){let t,n=``;for(;e.length&&(t=e[e.length-1][0],t===`space`);)n=e.pop()[1]+n;return n}stringFrom(e,t){let n=``;for(let r=t;r<e.length;r++)n+=e[r][1];return e.splice(t,e.length-t),n}unclosedBlock(){let e=this.current.source.start;throw this.input.error(`Unclosed block`,e.line,e.column)}unclosedBracket(e){throw this.input.error(`Unclosed bracket`,{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error(`Unexpected }`,{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error(`Unknown word`,{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error(`At-rule without name`,{offset:t[2]},{offset:t[2]+t[1].length})}}return mn=c,mn}var _n,vn;function yn(){if(vn)return _n;vn=1;let e=zt(),t=gn(),n=At();function r(e,r){let i=new n(e,r),a=new t(i);try{a.parse()}catch(e){throw process.env.NODE_ENV!==`production`&&e.name===`CssSyntaxError`&&r&&r.from&&(/\.scss$/i.test(r.from)?e.message+=`
22
+ `),this.css+=t+`/*# sourceMappingURL=`+e+` */`}applyPrevMaps(){for(let t of this.previous()){let r=this.toUrl(this.path(t.file)),i=t.root||n(t.file),a;this.mapOpts.sourcesContent===!1?(a=new e(t.text),a.sourcesContent&&(a.sourcesContent=null)):a=t.consumer(),this.map.applySourceMap(a,r,this.toUrl(this.path(i)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1){if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],e.type===`comment`&&e.text.indexOf(`# sourceMappingURL=`)===0&&this.root.removeChild(t)}else this.css&&=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,``)}}generate(){if(this.clearAnnotation(),l&&c&&this.isMap())return this.generateMap();{let e=``;return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=t.fromSourceMap(e,{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 e=1,n=1,r=`<no source>`,i={generated:{column:0,line:0},original:{column:0,line:0},source:``},a,o;this.stringify(this.root,(t,s,c)=>{if(this.css+=t,s&&c!==`end`&&(i.generated.line=e,i.generated.column=n-1,s.source&&s.source.start?(i.source=this.sourcePath(s),i.original.line=s.source.start.line,i.original.column=s.source.start.column-1,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,this.map.addMapping(i))),a=t.match(/\n/g),a?(e+=a.length,o=t.lastIndexOf(`
23
+ `),n=t.length-o):n+=t.length,s&&c!==`start`){let t=s.parent||{raws:{}};(!(s.type===`decl`||s.type===`atrule`&&!s.nodes)||s!==t.last||t.raws.semicolon)&&(s.source&&s.source.end?(i.source=this.sourcePath(s),i.original.line=s.source.end.line,i.original.column=s.source.end.column-1,i.generated.line=e,i.generated.column=n-2,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,i.generated.line=e,i.generated.column=n-1,this.map.addMapping(i)))}})}isAnnotation(){return this.isInline()?!0:this.mapOpts.annotation===void 0?!this.previous().length||this.previous().some(e=>e.annotation):this.mapOpts.annotation}isInline(){if(this.mapOpts.inline!==void 0)return this.mapOpts.inline;let e=this.mapOpts.annotation;return e!==void 0&&e!==!0?!1:!this.previous().length||this.previous().some(e=>e.inline)}isMap(){return this.opts.map===void 0?this.previous().length>0:!!this.opts.map}isSourcesContent(){return this.mapOpts.sourcesContent===void 0?!this.previous().length||this.previous().some(e=>e.withContent()):this.mapOpts.sourcesContent}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):`to.css`}path(e){if(this.mapOpts.absolute||e.charCodeAt(0)===60||/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let a=this.opts.to?n(this.opts.to):`.`;typeof this.mapOpts.annotation==`string`&&(a=n(i(a,this.mapOpts.annotation)));let o=r(a,e);return this.memoizedPaths.set(e,o),o}previous(){if(!this.previousMaps){if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new s(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let n=t.source.input.from;if(n&&!e[n]){e[n]=!0;let r=this.usesFileUrls?this.toFileUrl(n):this.toUrl(this.path(n));this.map.setSourceContent(r,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):`<no source>`;this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString(`base64`):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(o){let t=o(e).toString();return this.memoizedFileURLs.set(e,t),t}throw Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;a===`\\`&&(e=e.replace(/\\/g,`/`));let n=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,n),n}}return Nt=u,Nt}var It,Lt;function Rt(){if(Lt)return It;Lt=1;let e=bt();class t extends e{constructor(e){super(e),this.type=`comment`}}return It=t,t.default=t,It}var zt,Bt;function Vt(){if(Bt)return zt;Bt=1;let{isClean:e,my:t}=dt(),n=Ct(),r=Rt(),i=bt(),a,o,s,c;function l(e){return e.map(e=>(e.nodes&&=l(e.nodes),delete e.source,e))}function u(t){if(t[e]=!1,t.proxyOf.nodes)for(let e of t.proxyOf.nodes)u(e)}class d extends i{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t=this.getIterator(),n,r;for(;this.indexes[t]<this.proxyOf.nodes.length&&(n=this.indexes[t],r=e(this.proxyOf.nodes[n],n),r!==!1);)this.indexes[t]+=1;return delete this.indexes[t],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||=0,this.indexes||={},this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get(e,t){return t===`proxyOf`?e:e[t]?t===`each`||typeof t==`string`&&t.startsWith(`walk`)?(...n)=>e[t](...n.map(e=>typeof e==`function`?(t,n)=>e(t.toProxy(),n):e)):t===`every`||t===`some`?n=>e[t]((e,...t)=>n(e.toProxy(),...t)):t===`root`?()=>e.root().toProxy():t===`nodes`?e.nodes.map(e=>e.toProxy()):t===`first`||t===`last`?e[t].toProxy():e[t]:e[t]},set(e,t,n){return e[t]===n||(e[t]=n,(t===`name`||t===`params`||t===`selector`)&&e.markDirty(),!0)}}}index(e){return typeof e==`number`?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let n=this.index(e),r=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of r)this.proxyOf.nodes.splice(n+1,0,e);let i;for(let e in this.indexes)i=this.indexes[e],n<i&&(this.indexes[e]=i+r.length);return this.markDirty(),this}insertBefore(e,t){let n=this.index(e),r=n===0&&`prepend`,i=this.normalize(t,this.proxyOf.nodes[n],r).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n,0,e);let a;for(let e in this.indexes)a=this.indexes[e],n<=a&&(this.indexes[e]=a+i.length);return this.markDirty(),this}normalize(i,c){if(typeof i==`string`)i=l(a(i).nodes);else if(i===void 0)i=[];else if(Array.isArray(i)){i=i.slice(0);for(let e of i)e.parent&&e.parent.removeChild(e,`ignore`)}else if(i.type===`root`&&this.type!==`document`){i=i.nodes.slice(0);for(let e of i)e.parent&&e.parent.removeChild(e,`ignore`)}else if(i.type)i=[i];else if(i.prop){if(i.value===void 0)throw Error(`Value field is missed in node creation`);typeof i.value!=`string`&&(i.value=String(i.value)),i=[new n(i)]}else if(i.selector)i=[new o(i)];else if(i.name)i=[new s(i)];else if(i.text)i=[new r(i)];else throw Error(`Unknown node type in node creation`);return i.map(n=>(n[t]||d.rebuild(n),n=n.proxyOf,n.parent&&n.parent.removeChild(n),n[e]&&u(n),n.raws.before===void 0&&c&&c.raws.before!==void 0&&(n.raws.before=c.raws.before.replace(/\S/g,``)),n.parent=this.proxyOf,n))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,`prepend`).reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let t;for(let n in this.indexes)t=this.indexes[n],t>=e&&(this.indexes[n]=t-1);return this.markDirty(),this}replaceValues(e,t,n){return n||(n=t,t={}),this.walkDecls(r=>{(!t.props||t.props.includes(r.prop))&&(!t.fast||r.value.includes(t.fast))&&(r.value=r.value.replace(e,n))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,n)=>{let r;try{r=e(t,n)}catch(e){throw t.addToError(e)}return r!==!1&&t.walk&&(r=t.walk(e)),r})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if(n.type===`atrule`&&e.test(n.name))return t(n,r)}):this.walk((n,r)=>{if(n.type===`atrule`&&n.name===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if(e.type===`atrule`)return t(e,n)}))}walkComments(e){return this.walk((t,n)=>{if(t.type===`comment`)return e(t,n)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if(n.type===`decl`&&e.test(n.prop))return t(n,r)}):this.walk((n,r)=>{if(n.type===`decl`&&n.prop===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if(e.type===`decl`)return t(e,n)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if(n.type===`rule`&&e.test(n.selector))return t(n,r)}):this.walk((n,r)=>{if(n.type===`rule`&&n.selector===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if(e.type===`rule`)return t(e,n)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}return d.registerParse=e=>{a=e},d.registerRule=e=>{o=e},d.registerAtRule=e=>{s=e},d.registerRoot=e=>{c=e},zt=d,d.default=d,d.rebuild=e=>{e.type===`atrule`?Object.setPrototypeOf(e,s.prototype):e.type===`rule`?Object.setPrototypeOf(e,o.prototype):e.type===`decl`?Object.setPrototypeOf(e,n.prototype):e.type===`comment`?Object.setPrototypeOf(e,r.prototype):e.type===`root`&&Object.setPrototypeOf(e,c.prototype),e[t]=!0,e.nodes&&e.nodes.forEach(e=>{d.rebuild(e)})},zt}var Ht,Ut;function Wt(){if(Ut)return Ht;Ut=1;let e=Vt(),t,n;class r extends e{constructor(e){super({type:`document`,...e}),this.nodes||=[]}toResult(e={}){return new t(new n,this,e).stringify()}}return r.registerLazyResult=e=>{t=e},r.registerProcessor=e=>{n=e},Ht=r,r.default=r,Ht}var Gt,Kt;function qt(){if(Kt)return Gt;Kt=1;let e={};return Gt=function(t){e[t]||(e[t]=!0,typeof console<`u`&&console.warn&&console.warn(t))},Gt}var Jt,Yt;function Xt(){if(Yt)return Jt;Yt=1;class e{constructor(e,t={}){if(this.type=`warning`,this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+`: `+this.text:this.text}}return Jt=e,e.default=e,Jt}var Zt,Qt;function $t(){if(Qt)return Zt;Qt=1;let e=Xt();class t{constructor(e,t,n){this.processor=e,this.messages=[],this.root=t,this.opts=n,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,n={}){n.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(n.plugin=this.lastPlugin.postcssPlugin);let r=new e(t,n);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>e.type===`warning`)}get content(){return this.css}}return Zt=t,t.default=t,Zt}var en,tn;function nn(){if(tn)return en;tn=1;let e=/[\t\n\f\r "#'()/;[\\\]{}]/g,t=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,n=/.[\r\n"'(/\\]/,r=/[\da-f]/i;return en=function(i,a={}){let o=i.css.valueOf(),s=a.ignoreErrors,c,l,u,d,f,p,m,h,g,_,v=o.length,y=0,b=[],x=[];function S(){return y}function C(e){throw i.error(`Unclosed `+e,y)}function w(){return x.length===0&&y>=v}function T(i){if(x.length)return x.pop();if(y>=v)return;let a=i?i.ignoreUnclosed:!1;switch(c=o.charCodeAt(y),c){case 10:case 32:case 9:case 13:case 12:l=y;do l+=1,c=o.charCodeAt(l);while(c===32||c===10||c===9||c===13||c===12);_=[`space`,o.slice(y,l)],y=l-1;break;case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let e=String.fromCharCode(c);_=[e,e,y];break}case 40:if(h=b.length?b.pop()[1]:``,g=o.charCodeAt(y+1),h===`url`&&g!==39&&g!==34&&g!==32&&g!==10&&g!==9&&g!==12&&g!==13){l=y;do{if(p=!1,l=o.indexOf(`)`,l+1),l===-1){if(s||a){l=y;break}C(`bracket`)}for(m=l;o.charCodeAt(m-1)===92;)--m,p=!p}while(p);_=[`brackets`,o.slice(y,l+1),y,l],y=l}else l=o.indexOf(`)`,y+1),d=o.slice(y,l+1),l===-1||n.test(d)?_=[`(`,`(`,y]:(_=[`brackets`,d,y,l],y=l);break;case 39:case 34:u=c===39?`'`:`"`,l=y;do{if(p=!1,l=o.indexOf(u,l+1),l===-1){if(s||a){l=y+1;break}C(`string`)}for(m=l;o.charCodeAt(m-1)===92;)--m,p=!p}while(p);_=[`string`,o.slice(y,l+1),y,l],y=l;break;case 64:e.lastIndex=y+1,e.test(o),l=e.lastIndex===0?o.length-1:e.lastIndex-2,_=[`at-word`,o.slice(y,l+1),y,l],y=l;break;case 92:for(l=y,f=!0;o.charCodeAt(l+1)===92;)l+=1,f=!f;if(c=o.charCodeAt(l+1),f&&c!==47&&c!==32&&c!==10&&c!==9&&c!==13&&c!==12&&(l+=1,r.test(o.charAt(l)))){for(;r.test(o.charAt(l+1));)l+=1;o.charCodeAt(l+1)===32&&(l+=1)}_=[`word`,o.slice(y,l+1),y,l],y=l;break;default:c===47&&o.charCodeAt(y+1)===42?(l=o.indexOf(`*/`,y+2)+1,l===0&&(s||a?l=o.length:C(`comment`)),_=[`comment`,o.slice(y,l+1),y,l],y=l):(t.lastIndex=y+1,t.test(o),l=t.lastIndex===0?o.length-1:t.lastIndex-2,_=[`word`,o.slice(y,l+1),y,l],b.push(_),y=l)}return y++,_}function E(e){x.push(e)}return{back:E,endOfFile:w,nextToken:T,position:S}},en}var rn,an;function on(){if(an)return rn;an=1;let e=Vt();class t extends e{constructor(e){super(e),this.type=`atrule`}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}return rn=t,t.default=t,e.registerAtRule(t),rn}var sn,cn;function ln(){if(cn)return sn;cn=1;let e=Vt(),t,n;class r extends e{constructor(e){super(e),this.type=`root`,this.nodes||=[]}normalize(e,t,n){let r=super.normalize(e);if(t){if(n===`prepend`)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of r)e.raws.before=t.raws.before}return r}removeChild(e,t){let n=this.index(e);return!t&&n===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(e)}toResult(e={}){return new t(new n,this,e).stringify()}}return r.registerLazyResult=e=>{t=e},r.registerProcessor=e=>{n=e},sn=r,r.default=r,e.registerRoot(r),sn}var un,dn;function fn(){if(dn)return un;dn=1;let e={comma(t){return e.split(t,[`,`],!0)},space(t){return e.split(t,[` `,`
24
+ `,` `])},split(e,t,n){let r=[],i=``,a=!1,o=0,s=!1,c=``,l=!1;for(let n of e)l?l=!1:n===`\\`?l=!0:s?n===c&&(s=!1):n===`"`||n===`'`?(s=!0,c=n):n===`(`?o+=1:n===`)`?o>0&&--o:o===0&&t.includes(n)&&(a=!0),a?(i!==``&&r.push(i.trim()),i=``,a=!1):i+=n;return(n||i!==``)&&r.push(i.trim()),r}};return un=e,e.default=e,un}var pn,mn;function hn(){if(mn)return pn;mn=1;let e=Vt(),t=fn();class n extends e{constructor(e){super(e),this.type=`rule`,this.nodes||=[]}get selectors(){return t.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,n=t?t[0]:`,`+this.raw(`between`,`beforeOpen`);this.selector=e.join(n)}}return pn=n,n.default=n,e.registerRule(n),pn}var gn,_n;function vn(){if(_n)return gn;_n=1;let e=Ct(),t=nn(),n=Rt(),r=on(),i=ln(),a=hn(),o={empty:!0,space:!0};function s(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}class c{constructor(e){this.input=e,this.root=new i,this.current=this.root,this.spaces=``,this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t=new r;t.name=e[1].slice(1),t.name===``&&this.unnamedAtrule(t,e),this.init(t,e[2]);let n,i,a,o=!1,s=!1,c=[],l=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),n=e[0],n===`(`||n===`[`?l.push(n===`(`?`)`:`]`):n===`{`&&l.length>0?l.push(`}`):n===l[l.length-1]&&l.pop(),l.length===0){if(n===`;`){t.source.end=this.getPosition(e[2]),t.source.end.offset++,this.semicolon=!0;break}if(n===`{`){s=!0;break}if(n===`}`){if(c.length>0){for(a=c.length-1,i=c[a];i&&i[0]===`space`;)i=c[--a];i&&(t.source.end=this.getPosition(i[3]||i[2]),t.source.end.offset++)}this.end(e);break}c.push(e)}else c.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}t.raws.between=this.spacesAndCommentsFromEnd(c),c.length?(t.raws.afterName=this.spacesAndCommentsFromStart(c),this.raw(t,`params`,c),o&&(e=c[c.length-1],t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,this.spaces=t.raws.between,t.raws.between=``)):(t.raws.afterName=``,t.params=``),s&&(t.nodes=[],this.current=t)}checkMissedSemicolon(e){let t=this.colon(e);if(t===!1)return;let n=0,r;for(let i=t-1;i>=0&&(r=e[i],!(r[0]!==`space`&&(n+=1,n===2)));i--);throw this.input.error(`Missed semicolon`,r[0]===`word`?r[3]+1:r[2])}colon(e){let t=0,n,r,i;for(let[a,o]of e.entries()){if(n=o,r=n[0],r===`(`&&(t+=1),r===`)`&&--t,t===0&&r===`:`){if(!i)this.doubleColon(n);else if(i[0]===`word`&&i[1]===`progid`)continue;else return a}i=n}return!1}comment(e){let t=new n;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text=``,t.raws.left=r,t.raws.right=``;else{let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(t,n){let r=new e;this.init(r,t[0][2]);let i=t[t.length-1];for(i[0]===`;`&&(this.semicolon=!0,t.pop()),r.source.end=this.getPosition(i[3]||i[2]||s(t)),r.source.end.offset++;t[0][0]!==`word`;)t.length===1&&this.unknownWord(t),r.raws.before+=t.shift()[1];for(r.source.start=this.getPosition(t[0][2]),r.prop=``;t.length;){let e=t[0][0];if(e===`:`||e===`space`||e===`comment`)break;r.prop+=t.shift()[1]}r.raws.between=``;let a;for(;t.length;){if(a=t.shift(),a[0]===`:`){r.raws.between+=a[1];break}a[0]===`word`&&/\w/.test(a[1])&&this.unknownWord([a]),r.raws.between+=a[1]}(r.prop[0]===`_`||r.prop[0]===`*`)&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let o=[],c;for(;t.length&&(c=t[0][0],c===`space`||c===`comment`);)o.push(t.shift());this.precheckMissedSemicolon(t);for(let e=t.length-1;e>=0;e--){if(a=t[e],a[1].toLowerCase()===`!important`){r.important=!0;let n=this.stringFrom(t,e);n=this.spacesFromEnd(t)+n,n!==` !important`&&(r.raws.important=n);break}if(a[1].toLowerCase()===`important`){let n=t.slice(0),i=``;for(let t=e;t>0;t--){let e=n[t][0];if(i.trim().indexOf(`!`)===0&&e!==`space`)break;i=n.pop()[1]+i}i.trim().indexOf(`!`)===0&&(r.important=!0,r.raws.important=i,t=n)}if(a[0]!==`space`&&a[0]!==`comment`)break}t.some(e=>e[0]!==`space`&&e[0]!==`comment`)&&(r.raws.between+=o.map(e=>e[1]).join(``),o=[]),this.raw(r,`value`,o.concat(t),n),r.value.includes(`:`)&&!n&&this.checkMissedSemicolon(t)}doubleColon(e){throw this.input.error(`Double colon`,{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new a;this.init(t,e[2]),t.selector=``,t.raws.between=``,this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||``)+this.spaces,this.spaces=``,this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||``)+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&e.type===`rule`&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces=``)}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces=``,e.type!==`comment`&&(this.semicolon=!1)}other(e){let t=!1,n=null,r=!1,i=null,a=[],o=e[1].startsWith(`--`),s=[],c=e;for(;c;){if(n=c[0],s.push(c),n===`(`||n===`[`)i||=c,a.push(n===`(`?`)`:`]`);else if(o&&r&&n===`{`)i||=c,a.push(`}`);else if(a.length===0){if(n===`;`){if(r){this.decl(s,o);return}break}if(n===`{`){this.rule(s);return}if(n===`}`){this.tokenizer.back(s.pop()),t=!0;break}n===`:`&&(r=!0)}else n===a[a.length-1]&&(a.pop(),a.length===0&&(i=null));c=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),a.length>0&&this.unclosedBracket(i),t&&r){if(!o)for(;s.length&&(c=s[s.length-1][0],c===`space`||c===`comment`);)this.tokenizer.back(s.pop());this.decl(s,o)}else this.unknownWord(s)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case`space`:this.spaces+=e[1];break;case`;`:this.freeSemicolon(e);break;case`}`:this.end(e);break;case`comment`:this.comment(e);break;case`at-word`:this.atrule(e);break;case`{`:this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,n,r){let i,a,s=n.length,c=``,l=!0,u,d;for(let e=0;e<s;e+=1)i=n[e],a=i[0],a===`space`&&e===s-1&&!r?l=!1:a===`comment`?(d=n[e-1]?n[e-1][0]:`empty`,u=n[e+1]?n[e+1][0]:`empty`,!o[d]&&!o[u]?c.slice(-1)===`,`?l=!1:c+=i[1]:l=!1):c+=i[1];if(!l){let r=n.reduce((e,t)=>e+t[1],``);e.raws[t]={raw:r,value:c}}e[t]=c}rule(e){e.pop();let t=new a;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,`selector`,e),this.current=t}spacesAndCommentsFromEnd(e){let t,n=``;for(;e.length&&(t=e[e.length-1][0],t===`space`||t===`comment`);)n=e.pop()[1]+n;return n}spacesAndCommentsFromStart(e){let t,n=``;for(;e.length&&(t=e[0][0],t===`space`||t===`comment`);)n+=e.shift()[1];return n}spacesFromEnd(e){let t,n=``;for(;e.length&&(t=e[e.length-1][0],t===`space`);)n=e.pop()[1]+n;return n}stringFrom(e,t){let n=``;for(let r=t;r<e.length;r++)n+=e[r][1];return e.splice(t,e.length-t),n}unclosedBlock(){let e=this.current.source.start;throw this.input.error(`Unclosed block`,e.line,e.column)}unclosedBracket(e){throw this.input.error(`Unclosed bracket`,{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error(`Unexpected }`,{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error(`Unknown word`,{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error(`At-rule without name`,{offset:t[2]},{offset:t[2]+t[1].length})}}return gn=c,gn}var yn,bn;function xn(){if(bn)return yn;bn=1;let e=Vt(),t=vn(),n=Mt();function r(e,r){let i=new n(e,r),a=new t(i);try{a.parse()}catch(e){throw process.env.NODE_ENV!==`production`&&e.name===`CssSyntaxError`&&r&&r.from&&(/\.scss$/i.test(r.from)?e.message+=`
25
25
  You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser`:/\.sass/i.test(r.from)?e.message+=`
26
26
  You tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser`:/\.less$/i.test(r.from)&&(e.message+=`
27
- You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),e}return a.root}return _n=r,r.default=r,e.registerParse(r),_n}var bn,xn;function Sn(){if(xn)return bn;xn=1;let{isClean:e,my:t}=lt(),n=Nt(),r=ht(),i=zt(),a=Ht(),o=Gt(),s=Zt(),c=yn(),l=sn(),u={atrule:`AtRule`,comment:`Comment`,decl:`Declaration`,document:`Document`,root:`Root`,rule:`Rule`},d={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},f={Once:!0,postcssPlugin:!0,prepare:!0};function p(e){return typeof e==`object`&&typeof e.then==`function`}function m(e){let t=!1,n=u[e.type];return e.type===`decl`?t=e.prop.toLowerCase():e.type===`atrule`&&(t=e.name.toLowerCase()),t&&e.append?[n,n+`-`+t,0,n+`Exit`,n+`Exit-`+t]:t?[n,n+`-`+t,n+`Exit`,n+`Exit-`+t]:e.append?[n,0,n+`Exit`]:[n,n+`Exit`]}function h(e){let t;return t=e.type===`document`?[`Document`,0,`DocumentExit`]:e.type===`root`?[`Root`,0,`RootExit`]:m(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function g(t){return t[e]=!1,t.nodes&&t.nodes.forEach(e=>g(e)),t}let _={};class v{constructor(e,n,r){this.stringified=!1,this.processed=!1;let a;if(typeof n==`object`&&n&&(n.type===`root`||n.type===`document`))a=g(n);else if(n instanceof v||n instanceof s)a=g(n.root),n.map&&(r.map===void 0&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{let e=c;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{a=e(n,r)}catch(e){this.processed=!0,this.error=e}a&&!a[t]&&i.rebuild(a)}this.result=new s(e,a,r),this.helpers={..._,postcss:_,result:this.result},this.plugins=this.processor.plugins.map(e=>typeof e==`object`&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||=this.runAsync(),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw Error(`Use process(css).then(cb) to work with async plugins`)}handleError(e,t){let n=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,e.name===`CssSyntaxError`&&!e.plugin)e.plugin=n.postcssPlugin,e.setMessage();else if(n.postcssVersion&&process.env.NODE_ENV!==`production`){let e=n.postcssPlugin,t=n.postcssVersion,r=this.result.processor.version,i=t.split(`.`),a=r.split(`.`);(i[0]!==a[0]||parseInt(i[1])>parseInt(a[1]))&&console.error(`Unknown error from PostCSS plugin. Your current PostCSS version is `+r+`, but `+e+` uses `+t+`. Perhaps this is the source of the error below.`)}}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,n)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,n])};for(let t of this.plugins)if(typeof t==`object`)for(let n in t){if(!d[n]&&/^[A-Z]/.test(n))throw Error(`Unknown event ${n} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!f[n])if(typeof t[n]==`object`)for(let r in t[n])r===`*`?e(t,n,t[n][r]):e(t,n+`-`+r.toLowerCase(),t[n][r]);else typeof t[n]==`function`&&e(t,n,t[n])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],n=this.runOnRoot(t);if(p(n))try{await n}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];){t[e]=!0;let n=[h(t)];for(;n.length>0;){let e=this.visitTick(n);if(p(e))try{await e}catch(e){let t=n[n.length-1].node;throw this.handleError(e,t)}}}if(this.listeners.OnceExit)for(let[e,n]of this.listeners.OnceExit){this.result.lastPlugin=e;try{if(t.type===`document`){let e=t.nodes.map(e=>n(e,this.helpers));await Promise.all(e)}else await n(t,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if(typeof e==`object`&&e.Once){if(this.result.root.type===`document`){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return p(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}else if(typeof e==`function`)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=r;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let i=new n(t,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins)if(p(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];)t[e]=!0,this.walkSync(t);if(this.listeners.OnceExit)if(t.type===`document`)for(let e of t.nodes)this.visitSync(this.listeners.OnceExit,e);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(e,t){return process.env.NODE_ENV!==`production`&&(`from`in this.opts||o("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[n,r]of e){this.result.lastPlugin=n;let e;try{e=r(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if(t.type!==`root`&&t.type!==`document`&&!t.parent)return!0;if(p(e))throw this.getAsyncError()}}visitTick(t){let n=t[t.length-1],{node:r,visitors:i}=n;if(r.type!==`root`&&r.type!==`document`&&!r.parent){t.pop();return}if(i.length>0&&n.visitorIndex<i.length){let[e,t]=i[n.visitorIndex];n.visitorIndex+=1,n.visitorIndex===i.length&&(n.visitors=[],n.visitorIndex=0),this.result.lastPlugin=e;try{return t(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(n.iterator!==0){let i=n.iterator,a;for(;a=r.nodes[r.indexes[i]];)if(r.indexes[i]+=1,!a[e]){a[e]=!0,t.push(h(a));return}n.iterator=0,delete r.indexes[i]}let a=n.events;for(;n.eventIndex<a.length;){let t=a[n.eventIndex];if(n.eventIndex+=1,t===0){r.nodes&&r.nodes.length&&(r[e]=!0,n.iterator=r.getIterator());return}else if(this.listeners[t]){n.visitors=this.listeners[t];return}}t.pop()}walkSync(t){t[e]=!0;let n=m(t);for(let r of n)if(r===0)t.nodes&&t.each(t=>{t[e]||this.walkSync(t)});else{let e=this.listeners[r];if(e&&this.visitSync(e,t.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 v.registerPostcss=e=>{_=e},bn=v,v.default=v,l.registerLazyResult(v),a.registerLazyResult(v),bn}var Cn,wn;function Tn(){if(wn)return Cn;wn=1;let e=Nt(),t=ht(),n=Gt(),r=yn(),i=Zt();class a{constructor(n,r,a){r=r.toString(),this.stringified=!1,this._processor=n,this._css=r,this._opts=a,this._map=void 0;let o=t;this.result=new i(this._processor,void 0,this._opts),this.result.css=r;let s=this;Object.defineProperty(this.result,"root",{get(){return s.root}});let c=new e(o,void 0,this._opts,r);if(c.isMap()){let[e,t]=c.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else c.clearAnnotation(),this.result.css=c.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return process.env.NODE_ENV!==`production`&&(`from`in this._opts||n("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=r;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return`NoWorkResult`}}return Cn=a,a.default=a,Cn}var En,Dn;function On(){if(Dn)return En;Dn=1;let e=Tn(),t=Sn(),n=Ht(),r=sn();class i{constructor(e=[]){this.version=`8.4.38`,this.plugins=this.normalize(e)}normalize(e){let t=[];for(let n of e)if(n.postcss===!0?n=n():n.postcss&&(n=n.postcss),typeof n==`object`&&Array.isArray(n.plugins))t=t.concat(n.plugins);else if(typeof n==`object`&&n.postcssPlugin)t.push(n);else if(typeof n==`function`)t.push(n);else if(typeof n==`object`&&(n.parse||n.stringify)){if(process.env.NODE_ENV!==`production`)throw Error(`PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.`)}else throw Error(n+` is not a PostCSS plugin`);return t}process(n,r={}){return!this.plugins.length&&!r.parser&&!r.stringifier&&!r.syntax?new e(this,n,r):new t(this,n,r)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return En=i,i.default=i,r.registerProcessor(i),n.registerProcessor(i),En}var kn,An;function jn(){if(An)return kn;An=1;let e=xt(),t=Dt(),n=It(),r=rn(),i=At(),a=sn(),o=pn();function s(c,l){if(Array.isArray(c))return c.map(e=>s(e));let{inputs:u,...d}=c;if(u){l=[];for(let e of u){let n={...e,__proto__:i.prototype};n.map&&={...n.map,__proto__:t.prototype},l.push(n)}}if(d.nodes&&=c.nodes.map(e=>s(e,l)),d.source){let{inputId:e,...t}=d.source;d.source=t,e!=null&&(d.source.input=l[e])}if(d.type===`root`)return new a(d);if(d.type===`decl`)return new e(d);if(d.type===`rule`)return new o(d);if(d.type===`comment`)return new n(d);if(d.type===`atrule`)return new r(d);throw Error(`Unknown node type: `+c.type)}return kn=s,s.default=s,kn}var Mn,Nn;function Pn(){if(Nn)return Mn;Nn=1;let e=ot(),t=xt(),n=Sn(),r=zt(),i=On(),a=ht(),o=jn(),s=Ht(),c=Jt(),l=It(),u=rn(),d=Zt(),f=At(),p=yn(),m=un(),h=pn(),g=sn(),_=vt();function v(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new i(e)}return v.plugin=function(e,t){let n=!1;function r(...r){console&&console.warn&&!n&&(n=!0,console.warn(e+`: postcss.plugin was deprecated. Migration guide:
27
+ You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),e}return a.root}return yn=r,r.default=r,e.registerParse(r),yn}var Sn,Cn;function wn(){if(Cn)return Sn;Cn=1;let{isClean:e,my:t}=dt(),n=Ft(),r=_t(),i=Vt(),a=Wt(),o=qt(),s=$t(),c=xn(),l=ln(),u={atrule:`AtRule`,comment:`Comment`,decl:`Declaration`,document:`Document`,root:`Root`,rule:`Rule`},d={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},f={Once:!0,postcssPlugin:!0,prepare:!0};function p(e){return typeof e==`object`&&typeof e.then==`function`}function m(e){let t=!1,n=u[e.type];return e.type===`decl`?t=e.prop.toLowerCase():e.type===`atrule`&&(t=e.name.toLowerCase()),t&&e.append?[n,n+`-`+t,0,n+`Exit`,n+`Exit-`+t]:t?[n,n+`-`+t,n+`Exit`,n+`Exit-`+t]:e.append?[n,0,n+`Exit`]:[n,n+`Exit`]}function h(e){let t;return t=e.type===`document`?[`Document`,0,`DocumentExit`]:e.type===`root`?[`Root`,0,`RootExit`]:m(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function g(t){return t[e]=!1,t.nodes&&t.nodes.forEach(e=>g(e)),t}let _={};class v{constructor(e,n,r){this.stringified=!1,this.processed=!1;let a;if(typeof n==`object`&&n&&(n.type===`root`||n.type===`document`))a=g(n);else if(n instanceof v||n instanceof s)a=g(n.root),n.map&&(r.map===void 0&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{let e=c;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{a=e(n,r)}catch(e){this.processed=!0,this.error=e}a&&!a[t]&&i.rebuild(a)}this.result=new s(e,a,r),this.helpers={..._,postcss:_,result:this.result},this.plugins=this.processor.plugins.map(e=>typeof e==`object`&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||=this.runAsync(),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw Error(`Use process(css).then(cb) to work with async plugins`)}handleError(e,t){let n=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,e.name===`CssSyntaxError`&&!e.plugin)e.plugin=n.postcssPlugin,e.setMessage();else if(n.postcssVersion&&process.env.NODE_ENV!==`production`){let e=n.postcssPlugin,t=n.postcssVersion,r=this.result.processor.version,i=t.split(`.`),a=r.split(`.`);(i[0]!==a[0]||parseInt(i[1])>parseInt(a[1]))&&console.error(`Unknown error from PostCSS plugin. Your current PostCSS version is `+r+`, but `+e+` uses `+t+`. Perhaps this is the source of the error below.`)}}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,n)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,n])};for(let t of this.plugins)if(typeof t==`object`)for(let n in t){if(!d[n]&&/^[A-Z]/.test(n))throw Error(`Unknown event ${n} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!f[n]){if(typeof t[n]==`object`)for(let r in t[n])r===`*`?e(t,n,t[n][r]):e(t,n+`-`+r.toLowerCase(),t[n][r]);else typeof t[n]==`function`&&e(t,n,t[n])}}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],n=this.runOnRoot(t);if(p(n))try{await n}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];){t[e]=!0;let n=[h(t)];for(;n.length>0;){let e=this.visitTick(n);if(p(e))try{await e}catch(e){let t=n[n.length-1].node;throw this.handleError(e,t)}}}if(this.listeners.OnceExit)for(let[e,n]of this.listeners.OnceExit){this.result.lastPlugin=e;try{if(t.type===`document`){let e=t.nodes.map(e=>n(e,this.helpers));await Promise.all(e)}else await n(t,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if(typeof e==`object`&&e.Once){if(this.result.root.type===`document`){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return p(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if(typeof e==`function`)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=r;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let i=new n(t,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins)if(p(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];)t[e]=!0,this.walkSync(t);if(this.listeners.OnceExit){if(t.type===`document`)for(let e of t.nodes)this.visitSync(this.listeners.OnceExit,e);else this.visitSync(this.listeners.OnceExit,t)}}return this.result}then(e,t){return process.env.NODE_ENV!==`production`&&(`from`in this.opts||o("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[n,r]of e){this.result.lastPlugin=n;let e;try{e=r(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if(t.type!==`root`&&t.type!==`document`&&!t.parent)return!0;if(p(e))throw this.getAsyncError()}}visitTick(t){let n=t[t.length-1],{node:r,visitors:i}=n;if(r.type!==`root`&&r.type!==`document`&&!r.parent){t.pop();return}if(i.length>0&&n.visitorIndex<i.length){let[e,t]=i[n.visitorIndex];n.visitorIndex+=1,n.visitorIndex===i.length&&(n.visitors=[],n.visitorIndex=0),this.result.lastPlugin=e;try{return t(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(n.iterator!==0){let i=n.iterator,a;for(;a=r.nodes[r.indexes[i]];)if(r.indexes[i]+=1,!a[e]){a[e]=!0,t.push(h(a));return}n.iterator=0,delete r.indexes[i]}let a=n.events;for(;n.eventIndex<a.length;){let t=a[n.eventIndex];if(n.eventIndex+=1,t===0){r.nodes&&r.nodes.length&&(r[e]=!0,n.iterator=r.getIterator());return}if(this.listeners[t]){n.visitors=this.listeners[t];return}}t.pop()}walkSync(t){t[e]=!0;let n=m(t);for(let r of n)if(r===0)t.nodes&&t.each(t=>{t[e]||this.walkSync(t)});else{let e=this.listeners[r];if(e&&this.visitSync(e,t.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 v.registerPostcss=e=>{_=e},Sn=v,v.default=v,l.registerLazyResult(v),a.registerLazyResult(v),Sn}var Tn,En;function Dn(){if(En)return Tn;En=1;let e=Ft(),t=_t(),n=qt(),r=xn(),i=$t();class a{constructor(n,r,a){r=r.toString(),this.stringified=!1,this._processor=n,this._css=r,this._opts=a,this._map=void 0;let o,s=t;this.result=new i(this._processor,o,this._opts),this.result.css=r;let c=this;Object.defineProperty(this.result,"root",{get(){return c.root}});let l=new e(s,o,this._opts,r);if(l.isMap()){let[e,t]=l.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else l.clearAnnotation(),this.result.css=l.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return process.env.NODE_ENV!==`production`&&(`from`in this._opts||n("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=r;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return`NoWorkResult`}}return Tn=a,a.default=a,Tn}var On,kn;function An(){if(kn)return On;kn=1;let e=Dn(),t=wn(),n=Wt(),r=ln();class i{constructor(e=[]){this.version=`8.4.38`,this.plugins=this.normalize(e)}normalize(e){let t=[];for(let n of e)if(n.postcss===!0?n=n():n.postcss&&(n=n.postcss),typeof n==`object`&&Array.isArray(n.plugins))t=t.concat(n.plugins);else if(typeof n==`object`&&n.postcssPlugin)t.push(n);else if(typeof n==`function`)t.push(n);else if(typeof n==`object`&&(n.parse||n.stringify)){if(process.env.NODE_ENV!==`production`)throw Error(`PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.`)}else throw Error(n+` is not a PostCSS plugin`);return t}process(n,r={}){return!this.plugins.length&&!r.parser&&!r.stringifier&&!r.syntax?new e(this,n,r):new t(this,n,r)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return On=i,i.default=i,r.registerProcessor(i),n.registerProcessor(i),On}var jn,Mn;function Nn(){if(Mn)return jn;Mn=1;let e=Ct(),t=kt(),n=Rt(),r=on(),i=Mt(),a=ln(),o=hn();function s(c,l){if(Array.isArray(c))return c.map(e=>s(e));let{inputs:u,...d}=c;if(u){l=[];for(let e of u){let n={...e,__proto__:i.prototype};n.map&&={...n.map,__proto__:t.prototype},l.push(n)}}if(d.nodes&&=c.nodes.map(e=>s(e,l)),d.source){let{inputId:e,...t}=d.source;d.source=t,e!=null&&(d.source.input=l[e])}if(d.type===`root`)return new a(d);if(d.type===`decl`)return new e(d);if(d.type===`rule`)return new o(d);if(d.type===`comment`)return new n(d);if(d.type===`atrule`)return new r(d);throw Error(`Unknown node type: `+c.type)}return jn=s,s.default=s,jn}var Pn,Fn;function In(){if(Fn)return Pn;Fn=1;let e=ct(),t=Ct(),n=wn(),r=Vt(),i=An(),a=_t(),o=Nn(),s=Wt(),c=Xt(),l=Rt(),u=on(),d=$t(),f=Mt(),p=xn(),m=fn(),h=hn(),g=ln(),_=bt();function v(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new i(e)}return v.plugin=function(e,t){let n=!1;function r(...r){console&&console.warn&&!n&&(n=!0,console.warn(e+`: postcss.plugin was deprecated. Migration guide:
28
28
  https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith(`cn`)&&console.warn(e+`: 里面 postcss.plugin 被弃用. 迁移指南:
29
- https://www.w3ctech.com/topic/2226`));let a=t(...r);return a.postcssPlugin=e,a.postcssVersion=new i().version,a}let a;return Object.defineProperty(r,"postcss",{get(){return a||=r(),a}}),r.process=function(e,t,n){return v([r(n)]).process(e,t)},r},v.stringify=a,v.parse=p,v.fromJSON=o,v.list=m,v.comment=e=>new l(e),v.atRule=e=>new u(e),v.decl=e=>new t(e),v.rule=e=>new h(e),v.root=e=>new g(e),v.document=e=>new s(e),v.CssSyntaxError=e,v.Declaration=t,v.Container=r,v.Processor=i,v.Document=s,v.Comment=l,v.Warning=c,v.AtRule=u,v.Result=d,v.Input=f,v.Rule=h,v.Root=g,v.Node=_,n.registerPostcss(v),Mn=v,v.default=v,Mn}var R=$e(Pn());R.stringify,R.fromJSON,R.plugin,R.parse,R.list,R.document,R.comment,R.atRule,R.rule,R.decl,R.root,R.CssSyntaxError,R.Declaration,R.Container,R.Processor,R.Document,R.Comment,R.Warning,R.AtRule,R.Result,R.Input,R.Rule,R.Root,R.Node;var Fn=Object.defineProperty,In=(e,t,n)=>t in e?Fn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,z=(e,t,n)=>In(e,typeof t==`symbol`?t:t+``,n);Date.now().toString();function Ln(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}function Rn(e){if(e.__esModule)return e;var t=e.default;if(typeof t==`function`){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var zn={exports:{}},Bn;function Vn(){if(Bn)return zn.exports;Bn=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 zn.exports=t(),zn.exports.createColors=t,zn.exports}var B=Rn(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:`Module`}))),Hn,Un;function Wn(){if(Un)return Hn;Un=1;let e=Vn(),t=B;class n extends Error{constructor(e,t,r,i,a,o){super(e),this.name=`CssSyntaxError`,this.reason=e,a&&(this.file=a),i&&(this.source=i),o&&(this.plugin=o),t!==void 0&&r!==void 0&&(typeof t==`number`?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,n)}setMessage(){this.message=this.plugin?this.plugin+`: `:``,this.message+=this.file?this.file:`<css input>`,this.line!==void 0&&(this.message+=`:`+this.line+`:`+this.column),this.message+=`: `+this.reason}showSourceCode(n){if(!this.source)return``;let r=this.source;n??=e.isColorSupported,t&&n&&(r=t(r));let i=r.split(/\r?\n/),a=Math.max(this.line-3,0),o=Math.min(this.line+2,i.length),s=String(o).length,c,l;if(n){let{bold:t,gray:n,red:r}=e.createColors(!0);c=e=>t(r(e)),l=e=>n(e)}else c=l=e=>e;return i.slice(a,o).map((e,t)=>{let n=a+1+t,r=` `+(` `+n).slice(-s)+` | `;if(n===this.line){let t=l(r.replace(/\d/g,` `))+e.slice(0,this.column-1).replace(/[^\t]/g,` `);return c(`>`)+l(r)+e+`
29
+ https://www.w3ctech.com/topic/2226`));let a=t(...r);return a.postcssPlugin=e,a.postcssVersion=new i().version,a}let a;return Object.defineProperty(r,"postcss",{get(){return a||=r(),a}}),r.process=function(e,t,n){return v([r(n)]).process(e,t)},r},v.stringify=a,v.parse=p,v.fromJSON=o,v.list=m,v.comment=e=>new l(e),v.atRule=e=>new u(e),v.decl=e=>new t(e),v.rule=e=>new h(e),v.root=e=>new g(e),v.document=e=>new s(e),v.CssSyntaxError=e,v.Declaration=t,v.Container=r,v.Processor=i,v.Document=s,v.Comment=l,v.Warning=c,v.AtRule=u,v.Result=d,v.Input=f,v.Rule=h,v.Root=g,v.Node=_,n.registerPostcss(v),Pn=v,v.default=v,Pn}var B=tt(In());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 Ln=Object.defineProperty,Rn=(e,t,n)=>t in e?Ln(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,V=(e,t,n)=>Rn(e,typeof t==`symbol`?t:t+``,n);Date.now().toString();function zn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}function Bn(e){if(e.__esModule)return e;var t=e.default;if(typeof t==`function`){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var Vn={exports:{}},Hn;function Un(){if(Hn)return Vn.exports;Hn=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 Vn.exports=t(),Vn.exports.createColors=t,Vn.exports}var H=Bn(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:`Module`}))),Wn,Gn;function Kn(){if(Gn)return Wn;Gn=1;let e=Un(),t=H;class n extends Error{constructor(e,t,r,i,a,o){super(e),this.name=`CssSyntaxError`,this.reason=e,a&&(this.file=a),i&&(this.source=i),o&&(this.plugin=o),t!==void 0&&r!==void 0&&(typeof t==`number`?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,n)}setMessage(){this.message=this.plugin?this.plugin+`: `:``,this.message+=this.file?this.file:`<css input>`,this.line!==void 0&&(this.message+=`:`+this.line+`:`+this.column),this.message+=`: `+this.reason}showSourceCode(n){if(!this.source)return``;let r=this.source;n??=e.isColorSupported,t&&n&&(r=t(r));let i=r.split(/\r?\n/),a=Math.max(this.line-3,0),o=Math.min(this.line+2,i.length),s=String(o).length,c,l;if(n){let{bold:t,gray:n,red:r}=e.createColors(!0);c=e=>t(r(e)),l=e=>n(e)}else c=l=e=>e;return i.slice(a,o).map((e,t)=>{let n=a+1+t,r=` `+(` `+n).slice(-s)+` | `;if(n===this.line){let t=l(r.replace(/\d/g,` `))+e.slice(0,this.column-1).replace(/[^\t]/g,` `);return c(`>`)+l(r)+e+`
30
30
  `+t+c(`^`)}return` `+l(r)+e}).join(`
31
31
  `)}toString(){let e=this.showSourceCode();return e&&=`
32
32
 
33
33
  `+e+`
34
- `,this.name+`: `+this.message+e}}return Hn=n,n.default=n,Hn}var Gn={},Kn;function qn(){return Kn?Gn:(Kn=1,Gn.isClean=Symbol(`isClean`),Gn.my=Symbol(`my`),Gn)}var Jn,Yn;function Xn(){if(Yn)return Jn;Yn=1;let e={after:`
34
+ `,this.name+`: `+this.message+e}}return Wn=n,n.default=n,Wn}var qn={},Jn;function Yn(){return Jn?qn:(Jn=1,qn.isClean=Symbol(`isClean`),qn.my=Symbol(`my`),qn)}var Xn,Zn;function Qn(){if(Zn)return Xn;Zn=1;let e={after:`
35
35
  `,beforeClose:`
36
36
  `,beforeComment:`
37
37
  `,beforeDecl:`
@@ -42,21 +42,21 @@ https://www.w3ctech.com/topic/2226`));let a=t(...r);return a.postcssPlugin=e,a.p
42
42
  `)&&(n=n.replace(/[^\n]+$/,``)),!1}),n===void 0?n=this.raw(t,null,`beforeDecl`):n&&=n.replace(/\S/g,``),n}rawBeforeDecl(e,t){let n;return e.walkDecls(e=>{if(e.raws.before!==void 0)return n=e.raws.before,n.includes(`
43
43
  `)&&(n=n.replace(/[^\n]+$/,``)),!1}),n===void 0?n=this.raw(t,null,`beforeRule`):n&&=n.replace(/\S/g,``),n}rawBeforeOpen(e){let t;return e.walk(e=>{if(e.type!==`decl`&&(t=e.raws.between,t!==void 0))return!1}),t}rawBeforeRule(e){let t;return e.walk(n=>{if(n.nodes&&(n.parent!==e||e.first!==n)&&n.raws.before!==void 0)return t=n.raws.before,t.includes(`
44
44
  `)&&(t=t.replace(/[^\n]+$/,``)),!1}),t&&=t.replace(/\S/g,``),t}rawColon(e){let t;return e.walkDecls(e=>{if(e.raws.between!==void 0)return t=e.raws.between.replace(/[^\s:]/g,``),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length===0&&(t=e.raws.after,t!==void 0))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(n=>{let r=n.parent;if(r&&r!==e&&r.parent&&r.parent===e&&n.raws.before!==void 0){let e=n.raws.before.split(`
45
- `);return t=e[e.length-1],t=t.replace(/\S/g,``),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&e.last.type===`decl`&&(t=e.raws.semicolon,t!==void 0))return!1}),t}rawValue(e,t){let n=e[t],r=e.raws[t];return r&&r.value===n?r.raw:n}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,`selector`)),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,`end`)}stringify(e,t){if(!this[e.type])throw Error(`Unknown AST node type `+e.type+`. Maybe you need to change PostCSS stringifier.`);this[e.type](e,t)}}return Jn=n,n.default=n,Jn}var Zn,Qn;function $n(){if(Qn)return Zn;Qn=1;let e=Xn();function t(t,n){new e(n).stringify(t)}return Zn=t,t.default=t,Zn}var er,tr;function nr(){if(tr)return er;tr=1;let{isClean:e,my:t}=qn(),n=Wn(),r=Xn(),i=$n();function a(e,t){let n=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r)||r===`proxyCache`)continue;let i=e[r],o=typeof i;r===`parent`&&o===`object`?t&&(n[r]=t):r===`source`?n[r]=i:Array.isArray(i)?n[r]=i.map(e=>a(e,n)):(o===`object`&&i!==null&&(i=a(i)),n[r]=i)}return n}class o{constructor(n={}){this.raws={},this[e]=!1,this[t]=!0;for(let e in n)if(e===`nodes`){this.nodes=[];for(let t of n[e])typeof t.clone==`function`?this.append(t.clone()):this.append(t)}else this[e]=n[e]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=a(this);for(let n in e)t[n]=e[n];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:n,start:r}=this.rangeBy(t);return this.source.input.error(e,{column:r.column,line:r.line},{column:n.column,line:n.line},t)}return new n(e)}getProxyProcessor(){return{get(e,t){return t===`proxyOf`?e:t===`root`?()=>e.root().toProxy():e[t]},set(e,t,n){return e[t]===n?!0:(e[t]=n,(t===`prop`||t===`value`||t===`name`||t===`params`||t===`important`||t===`text`)&&e.markDirty(),!0)}}}markDirty(){if(this[e]){this[e]=!1;let t=this;for(;t=t.parent;)t[e]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let n=this.source.start;if(e.index)n=this.positionInside(e.index,t);else if(e.word){t=this.toString();let r=t.indexOf(e.word);r!==-1&&(n=this.positionInside(r,t))}return n}positionInside(e,t){let n=t||this.toString(),r=this.source.start.column,i=this.source.start.line;for(let t=0;t<e;t++)n[t]===`
46
- `?(r=1,i+=1):r+=1;return{column:r,line:i}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let r=this.toString(),i=r.indexOf(e.word);i!==-1&&(t=this.positionInside(i,r),n=this.positionInside(i+e.word.length,r))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line}:typeof e.endIndex==`number`?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<t.line||n.line===t.line&&n.column<=t.column)&&(n={column:t.column+1,line:t.line}),{end:n,start:t}}raw(e,t){return new r().raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,n=!1;for(let r of e)r===this?n=!0:n?(this.parent.insertAfter(t,r),t=r):this.parent.insertBefore(t,r);n||this.remove()}return this}root(){let e=this;for(;e.parent&&e.parent.type!==`document`;)e=e.parent;return e}toJSON(e,t){let n={},r=t==null;t||=new Map;let i=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e)||e===`parent`||e===`proxyCache`)continue;let r=this[e];if(Array.isArray(r))n[e]=r.map(e=>typeof e==`object`&&e.toJSON?e.toJSON(null,t):e);else if(typeof r==`object`&&r.toJSON)n[e]=r.toJSON(null,t);else if(e===`source`){let a=t.get(r.input);a??(a=i,t.set(r.input,i),i++),n[e]={end:r.end,inputId:a,start:r.start}}else n[e]=r}return r&&(n.inputs=[...t.keys()].map(e=>e.toJSON())),n}toProxy(){return this.proxyCache||=new Proxy(this,this.getProxyProcessor()),this.proxyCache}toString(e=i){e.stringify&&(e=e.stringify);let t=``;return e(this,e=>{t+=e}),t}warn(e,t,n){let r={node:this};for(let e in n)r[e]=n[e];return e.warn(t,r)}get proxyOf(){return this}}return er=o,o.default=o,er}var rr,ir;function ar(){if(ir)return rr;ir=1;let e=nr();class t extends e{constructor(e){e&&e.value!==void 0&&typeof e.value!=`string`&&(e={...e,value:String(e.value)}),super(e),this.type=`decl`}get variable(){return this.prop.startsWith(`--`)||this.prop[0]===`$`}}return rr=t,t.default=t,rr}var or,sr;function cr(){return sr?or:(sr=1,or={nanoid:(e=21)=>{let t=``,n=e;for(;n--;)t+=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`[Math.random()*64|0];return t},customAlphabet:(e,t=21)=>(n=t)=>{let r=``,i=n;for(;i--;)r+=e[Math.random()*e.length|0];return r}},or)}var lr,ur;function dr(){if(ur)return lr;ur=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=B,{existsSync:n,readFileSync:r}=B,{dirname:i,join:a}=B;function o(e){return Buffer?Buffer.from(e,`base64`).toString():window.atob(e)}class s{constructor(e,t){if(t.map===!1)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,`data:`);let n=t.map?t.map.prev:void 0,r=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=i(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||=new e(this.text),this.consumerCache}decodeInline(e){let t=/^data:application\/json;charset=utf-?8;base64,/,n=/^data:application\/json;base64,/;if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(t.test(e)||n.test(e))return o(e.substr(RegExp.lastMatch.length));let r=e.match(/data:application\/json;([^,]+),/)[1];throw Error(`Unsupported source map encoding `+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,``).trim()}isMap(e){return typeof e==`object`?typeof e.mappings==`string`||typeof e._mappings==`string`||Array.isArray(e.sections):!1}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let n=e.lastIndexOf(t.pop()),r=e.indexOf(`*/`,n);n>-1&&r>-1&&(this.annotation=this.getAnnotationURL(e.substring(n,r)))}loadFile(e){if(this.root=i(e),n(e))return this.mapFile=e,r(e,`utf-8`).toString().trim()}loadMap(n,r){if(r===!1)return!1;if(r){if(typeof r==`string`)return r;if(typeof r==`function`){let e=r(n);if(e){let t=this.loadFile(e);if(!t)throw Error(`Unable to load previous source map: `+e.toString());return t}}else if(r instanceof e)return t.fromSourceMap(r).toString();else if(r instanceof t)return r.toString();else if(this.isMap(r))return JSON.stringify(r);else throw Error(`Unsupported previous source map format: `+r.toString())}else if(this.inline)return this.decodeInline(this.annotation);else if(this.annotation){let e=this.annotation;return n&&(e=a(i(n),e)),this.loadFile(e)}}startWith(e,t){return e?e.substr(0,t.length)===t:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return lr=s,s.default=s,lr}var fr,pr;function mr(){if(pr)return fr;pr=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=B,{fileURLToPath:n,pathToFileURL:r}=B,{isAbsolute:i,resolve:a}=B,{nanoid:o}=cr(),s=B,c=Wn(),l=dr(),u=Symbol(`fromOffsetCache`),d=!!(e&&t),f=!!(a&&i);class p{constructor(e,t={}){if(e==null||typeof e==`object`&&!e.toString)throw Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),this.css[0]===``||this.css[0]===`￾`?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!f||/^\w+:\/\//.test(t.from)||i(t.from)?this.file=t.from:this.file=a(t.from)),f&&d){let e=new l(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id=`<input css `+o(6)+`>`),this.map&&(this.map.file=this.from)}error(e,t,n,i={}){let a,o,s;if(t&&typeof t==`object`){let e=t,r=n;if(typeof e.offset==`number`){let r=this.fromOffset(e.offset);t=r.line,n=r.col}else t=e.line,n=e.column;if(typeof r.offset==`number`){let e=this.fromOffset(r.offset);o=e.line,s=e.col}else o=r.line,s=r.column}else if(!n){let e=this.fromOffset(t);t=e.line,n=e.col}let l=this.origin(t,n,o,s);return a=l?new c(e,l.endLine===void 0?l.line:{column:l.column,line:l.line},l.endLine===void 0?l.column:{column:l.endColumn,line:l.endLine},l.source,l.file,i.plugin):new c(e,o===void 0?t:{column:n,line:t},o===void 0?n:{column:s,line:o},this.css,this.file,i.plugin),a.input={column:n,endColumn:s,endLine:o,line:t,source:this.css},this.file&&(r&&(a.input.url=r(this.file).toString()),a.input.file=this.file),a}fromOffset(e){let t,n;if(this[u])n=this[u];else{let e=this.css.split(`
47
- `);n=Array(e.length);let t=0;for(let r=0,i=e.length;r<i;r++)n[r]=t,t+=e[r].length+1;this[u]=n}t=n[n.length-1];let r=0;if(e>=t)r=n.length-1;else{let t=n.length-2,i;for(;r<t;)if(i=r+(t-r>>1),e<n[i])t=i-1;else if(e>=n[i+1])r=i+1;else{r=i;break}}return{col:e-n[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:a(this.map.consumer().sourceRoot||this.map.root||`.`,e)}origin(e,t,a,o){if(!this.map)return!1;let s=this.map.consumer(),c=s.originalPositionFor({column:t,line:e});if(!c.source)return!1;let l;typeof a==`number`&&(l=s.originalPositionFor({column:o,line:a}));let u;u=i(c.source)?r(c.source):new URL(c.source,this.map.consumer().sourceRoot||r(this.map.mapFile));let d={column:c.column,endColumn:l&&l.column,endLine:l&&l.line,line:c.line,url:u.toString()};if(u.protocol===`file:`)if(n)d.file=n(u);else throw Error(`file: protocol is not available in this PostCSS build`);let f=s.sourceContentFor(c.source);return f&&(d.source=f),d}toJSON(){let e={};for(let t of[`hasBOM`,`css`,`file`,`id`])this[t]!=null&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}}return fr=p,p.default=p,s&&s.registerInput&&s.registerInput(p),fr}var hr,gr;function _r(){if(gr)return hr;gr=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=B,{dirname:n,relative:r,resolve:i,sep:a}=B,{pathToFileURL:o}=B,s=mr(),c=!!(e&&t),l=!!(n&&i&&r&&a);class u{constructor(e,t,n,r){this.stringify=e,this.mapOpts=n.map||{},this.root=t,this.opts=n,this.css=r,this.originalCSS=r,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?`data:application/json;base64,`+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation==`string`?this.mapOpts.annotation:typeof this.mapOpts.annotation==`function`?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+`.map`;let t=`
45
+ `);return t=e[e.length-1],t=t.replace(/\S/g,``),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&e.last.type===`decl`&&(t=e.raws.semicolon,t!==void 0))return!1}),t}rawValue(e,t){let n=e[t],r=e.raws[t];return r&&r.value===n?r.raw:n}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,`selector`)),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,`end`)}stringify(e,t){if(!this[e.type])throw Error(`Unknown AST node type `+e.type+`. Maybe you need to change PostCSS stringifier.`);this[e.type](e,t)}}return Xn=n,n.default=n,Xn}var $n,er;function tr(){if(er)return $n;er=1;let e=Qn();function t(t,n){new e(n).stringify(t)}return $n=t,t.default=t,$n}var nr,rr;function ir(){if(rr)return nr;rr=1;let{isClean:e,my:t}=Yn(),n=Kn(),r=Qn(),i=tr();function a(e,t){let n=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r)||r===`proxyCache`)continue;let i=e[r],o=typeof i;r===`parent`&&o===`object`?t&&(n[r]=t):r===`source`?n[r]=i:Array.isArray(i)?n[r]=i.map(e=>a(e,n)):(o===`object`&&i!==null&&(i=a(i)),n[r]=i)}return n}class o{constructor(n={}){this.raws={},this[e]=!1,this[t]=!0;for(let e in n)if(e===`nodes`){this.nodes=[];for(let t of n[e])typeof t.clone==`function`?this.append(t.clone()):this.append(t)}else this[e]=n[e]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=a(this);for(let n in e)t[n]=e[n];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:n,start:r}=this.rangeBy(t);return this.source.input.error(e,{column:r.column,line:r.line},{column:n.column,line:n.line},t)}return new n(e)}getProxyProcessor(){return{get(e,t){return t===`proxyOf`?e:t===`root`?()=>e.root().toProxy():e[t]},set(e,t,n){return e[t]===n||(e[t]=n,(t===`prop`||t===`value`||t===`name`||t===`params`||t===`important`||t===`text`)&&e.markDirty(),!0)}}}markDirty(){if(this[e]){this[e]=!1;let t=this;for(;t=t.parent;)t[e]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let n=this.source.start;if(e.index)n=this.positionInside(e.index,t);else if(e.word){t=this.toString();let r=t.indexOf(e.word);r!==-1&&(n=this.positionInside(r,t))}return n}positionInside(e,t){let n=t||this.toString(),r=this.source.start.column,i=this.source.start.line;for(let t=0;t<e;t++)n[t]===`
46
+ `?(r=1,i+=1):r+=1;return{column:r,line:i}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},n=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let r=this.toString(),i=r.indexOf(e.word);i!==-1&&(t=this.positionInside(i,r),n=this.positionInside(i+e.word.length,r))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?n={column:e.end.column,line:e.end.line}:typeof e.endIndex==`number`?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<t.line||n.line===t.line&&n.column<=t.column)&&(n={column:t.column+1,line:t.line}),{end:n,start:t}}raw(e,t){return new r().raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,n=!1;for(let r of e)r===this?n=!0:n?(this.parent.insertAfter(t,r),t=r):this.parent.insertBefore(t,r);n||this.remove()}return this}root(){let e=this;for(;e.parent&&e.parent.type!==`document`;)e=e.parent;return e}toJSON(e,t){let n={},r=t==null;t||=new Map;let i=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e)||e===`parent`||e===`proxyCache`)continue;let r=this[e];if(Array.isArray(r))n[e]=r.map(e=>typeof e==`object`&&e.toJSON?e.toJSON(null,t):e);else if(typeof r==`object`&&r.toJSON)n[e]=r.toJSON(null,t);else if(e===`source`){let a=t.get(r.input);a??(a=i,t.set(r.input,i),i++),n[e]={end:r.end,inputId:a,start:r.start}}else n[e]=r}return r&&(n.inputs=[...t.keys()].map(e=>e.toJSON())),n}toProxy(){return this.proxyCache||=new Proxy(this,this.getProxyProcessor()),this.proxyCache}toString(e=i){e.stringify&&(e=e.stringify);let t=``;return e(this,e=>{t+=e}),t}warn(e,t,n){let r={node:this};for(let e in n)r[e]=n[e];return e.warn(t,r)}get proxyOf(){return this}}return nr=o,o.default=o,nr}var ar,or;function sr(){if(or)return ar;or=1;let e=ir();class t extends e{constructor(e){e&&e.value!==void 0&&typeof e.value!=`string`&&(e={...e,value:String(e.value)}),super(e),this.type=`decl`}get variable(){return this.prop.startsWith(`--`)||this.prop[0]===`$`}}return ar=t,t.default=t,ar}var cr,lr;function ur(){return lr?cr:(lr=1,cr={nanoid:(e=21)=>{let t=``,n=e;for(;n--;)t+=`useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict`[Math.random()*64|0];return t},customAlphabet:(e,t=21)=>(n=t)=>{let r=``,i=n;for(;i--;)r+=e[Math.random()*e.length|0];return r}},cr)}var dr,fr;function pr(){if(fr)return dr;fr=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=H,{existsSync:n,readFileSync:r}=H,{dirname:i,join:a}=H;function o(e){return Buffer?Buffer.from(e,`base64`).toString():window.atob(e)}class s{constructor(e,t){if(t.map===!1)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,`data:`);let n=t.map?t.map.prev:void 0,r=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=i(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||=new e(this.text),this.consumerCache}decodeInline(e){let t=/^data:application\/json;charset=utf-?8;base64,/,n=/^data:application\/json;base64,/;if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(t.test(e)||n.test(e))return o(e.substr(RegExp.lastMatch.length));let r=e.match(/data:application\/json;([^,]+),/)[1];throw Error(`Unsupported source map encoding `+r)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,``).trim()}isMap(e){return typeof e==`object`?typeof e.mappings==`string`||typeof e._mappings==`string`||Array.isArray(e.sections):!1}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let n=e.lastIndexOf(t.pop()),r=e.indexOf(`*/`,n);n>-1&&r>-1&&(this.annotation=this.getAnnotationURL(e.substring(n,r)))}loadFile(e){if(this.root=i(e),n(e))return this.mapFile=e,r(e,`utf-8`).toString().trim()}loadMap(n,r){if(r===!1)return!1;if(r){if(typeof r==`string`)return r;if(typeof r==`function`){let e=r(n);if(e){let t=this.loadFile(e);if(!t)throw Error(`Unable to load previous source map: `+e.toString());return t}}else if(r instanceof e)return t.fromSourceMap(r).toString();else if(r instanceof t)return r.toString();else if(this.isMap(r))return JSON.stringify(r);else throw Error(`Unsupported previous source map format: `+r.toString())}else if(this.inline)return this.decodeInline(this.annotation);else if(this.annotation){let e=this.annotation;return n&&(e=a(i(n),e)),this.loadFile(e)}}startWith(e,t){return e?e.substr(0,t.length)===t:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return dr=s,s.default=s,dr}var mr,hr;function gr(){if(hr)return mr;hr=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=H,{fileURLToPath:n,pathToFileURL:r}=H,{isAbsolute:i,resolve:a}=H,{nanoid:o}=ur(),s=H,c=Kn(),l=pr(),u=Symbol(`fromOffsetCache`),d=!!(e&&t),f=!!(a&&i);class p{constructor(e,t={}){if(e==null||typeof e==`object`&&!e.toString)throw Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),this.css[0]===``||this.css[0]===`￾`?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(this.file=!f||/^\w+:\/\//.test(t.from)||i(t.from)?t.from:a(t.from)),f&&d){let e=new l(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id=`<input css `+o(6)+`>`),this.map&&(this.map.file=this.from)}error(e,t,n,i={}){let a,o,s;if(t&&typeof t==`object`){let e=t,r=n;if(typeof e.offset==`number`){let r=this.fromOffset(e.offset);t=r.line,n=r.col}else t=e.line,n=e.column;if(typeof r.offset==`number`){let e=this.fromOffset(r.offset);o=e.line,s=e.col}else o=r.line,s=r.column}else if(!n){let e=this.fromOffset(t);t=e.line,n=e.col}let l=this.origin(t,n,o,s);return a=l?new c(e,l.endLine===void 0?l.line:{column:l.column,line:l.line},l.endLine===void 0?l.column:{column:l.endColumn,line:l.endLine},l.source,l.file,i.plugin):new c(e,o===void 0?t:{column:n,line:t},o===void 0?n:{column:s,line:o},this.css,this.file,i.plugin),a.input={column:n,endColumn:s,endLine:o,line:t,source:this.css},this.file&&(r&&(a.input.url=r(this.file).toString()),a.input.file=this.file),a}fromOffset(e){let t,n;if(this[u])n=this[u];else{let e=this.css.split(`
47
+ `);n=Array(e.length);let t=0;for(let r=0,i=e.length;r<i;r++)n[r]=t,t+=e[r].length+1;this[u]=n}t=n[n.length-1];let r=0;if(e>=t)r=n.length-1;else{let t=n.length-2,i;for(;r<t;)if(i=r+(t-r>>1),e<n[i])t=i-1;else if(e>=n[i+1])r=i+1;else{r=i;break}}return{col:e-n[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:a(this.map.consumer().sourceRoot||this.map.root||`.`,e)}origin(e,t,a,o){if(!this.map)return!1;let s=this.map.consumer(),c=s.originalPositionFor({column:t,line:e});if(!c.source)return!1;let l;typeof a==`number`&&(l=s.originalPositionFor({column:o,line:a}));let u;u=i(c.source)?r(c.source):new URL(c.source,this.map.consumer().sourceRoot||r(this.map.mapFile));let d={column:c.column,endColumn:l&&l.column,endLine:l&&l.line,line:c.line,url:u.toString()};if(u.protocol===`file:`){if(n)d.file=n(u);else throw Error(`file: protocol is not available in this PostCSS build`)}let f=s.sourceContentFor(c.source);return f&&(d.source=f),d}toJSON(){let e={};for(let t of[`hasBOM`,`css`,`file`,`id`])this[t]!=null&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}}return mr=p,p.default=p,s&&s.registerInput&&s.registerInput(p),mr}var _r,vr;function yr(){if(vr)return _r;vr=1;let{SourceMapConsumer:e,SourceMapGenerator:t}=H,{dirname:n,relative:r,resolve:i,sep:a}=H,{pathToFileURL:o}=H,s=gr(),c=!!(e&&t),l=!!(n&&i&&r&&a);class u{constructor(e,t,n,r){this.stringify=e,this.mapOpts=n.map||{},this.root=t,this.opts=n,this.css=r,this.originalCSS=r,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?`data:application/json;base64,`+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation==`string`?this.mapOpts.annotation:typeof this.mapOpts.annotation==`function`?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+`.map`;let t=`
48
48
  `;this.css.includes(`\r
49
49
  `)&&(t=`\r
50
- `),this.css+=t+`/*# sourceMappingURL=`+e+` */`}applyPrevMaps(){for(let t of this.previous()){let r=this.toUrl(this.path(t.file)),i=t.root||n(t.file),a;this.mapOpts.sourcesContent===!1?(a=new e(t.text),a.sourcesContent&&=null):a=t.consumer(),this.map.applySourceMap(a,r,this.toUrl(this.path(i)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],e.type===`comment`&&e.text.indexOf(`# sourceMappingURL=`)===0&&this.root.removeChild(t)}else this.css&&=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,``)}generate(){if(this.clearAnnotation(),l&&c&&this.isMap())return this.generateMap();{let e=``;return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=t.fromSourceMap(e,{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 e=1,n=1,r=`<no source>`,i={generated:{column:0,line:0},original:{column:0,line:0},source:``},a,o;this.stringify(this.root,(t,s,c)=>{if(this.css+=t,s&&c!==`end`&&(i.generated.line=e,i.generated.column=n-1,s.source&&s.source.start?(i.source=this.sourcePath(s),i.original.line=s.source.start.line,i.original.column=s.source.start.column-1,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,this.map.addMapping(i))),a=t.match(/\n/g),a?(e+=a.length,o=t.lastIndexOf(`
51
- `),n=t.length-o):n+=t.length,s&&c!==`start`){let t=s.parent||{raws:{}};(!(s.type===`decl`||s.type===`atrule`&&!s.nodes)||s!==t.last||t.raws.semicolon)&&(s.source&&s.source.end?(i.source=this.sourcePath(s),i.original.line=s.source.end.line,i.original.column=s.source.end.column-1,i.generated.line=e,i.generated.column=n-2,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,i.generated.line=e,i.generated.column=n-1,this.map.addMapping(i)))}})}isAnnotation(){return this.isInline()?!0:this.mapOpts.annotation===void 0?!this.previous().length||this.previous().some(e=>e.annotation):this.mapOpts.annotation}isInline(){if(this.mapOpts.inline!==void 0)return this.mapOpts.inline;let e=this.mapOpts.annotation;return e!==void 0&&e!==!0?!1:!this.previous().length||this.previous().some(e=>e.inline)}isMap(){return this.opts.map===void 0?this.previous().length>0:!!this.opts.map}isSourcesContent(){return this.mapOpts.sourcesContent===void 0?!this.previous().length||this.previous().some(e=>e.withContent()):this.mapOpts.sourcesContent}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):`to.css`}path(e){if(this.mapOpts.absolute||e.charCodeAt(0)===60||/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let a=this.opts.to?n(this.opts.to):`.`;typeof this.mapOpts.annotation==`string`&&(a=n(i(a,this.mapOpts.annotation)));let o=r(a,e);return this.memoizedPaths.set(e,o),o}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new s(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let n=t.source.input.from;if(n&&!e[n]){e[n]=!0;let r=this.usesFileUrls?this.toFileUrl(n):this.toUrl(this.path(n));this.map.setSourceContent(r,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):`<no source>`;this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString(`base64`):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(o){let t=o(e).toString();return this.memoizedFileURLs.set(e,t),t}else throw Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;a===`\\`&&(e=e.replace(/\\/g,`/`));let n=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,n),n}}return hr=u,hr}var vr,yr;function br(){if(yr)return vr;yr=1;let e=nr();class t extends e{constructor(e){super(e),this.type=`comment`}}return vr=t,t.default=t,vr}var xr,Sr;function Cr(){if(Sr)return xr;Sr=1;let{isClean:e,my:t}=qn(),n=ar(),r=br(),i=nr(),a,o,s,c;function l(e){return e.map(e=>(e.nodes&&=l(e.nodes),delete e.source,e))}function u(t){if(t[e]=!1,t.proxyOf.nodes)for(let e of t.proxyOf.nodes)u(e)}class d extends i{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t=this.getIterator(),n,r;for(;this.indexes[t]<this.proxyOf.nodes.length&&(n=this.indexes[t],r=e(this.proxyOf.nodes[n],n),r!==!1);)this.indexes[t]+=1;return delete this.indexes[t],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||=0,this.indexes||={},this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get(e,t){return t===`proxyOf`?e:e[t]?t===`each`||typeof t==`string`&&t.startsWith(`walk`)?(...n)=>e[t](...n.map(e=>typeof e==`function`?(t,n)=>e(t.toProxy(),n):e)):t===`every`||t===`some`?n=>e[t]((e,...t)=>n(e.toProxy(),...t)):t===`root`?()=>e.root().toProxy():t===`nodes`?e.nodes.map(e=>e.toProxy()):t===`first`||t===`last`?e[t].toProxy():e[t]:e[t]},set(e,t,n){return e[t]===n?!0:(e[t]=n,(t===`name`||t===`params`||t===`selector`)&&e.markDirty(),!0)}}}index(e){return typeof e==`number`?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let n=this.index(e),r=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of r)this.proxyOf.nodes.splice(n+1,0,e);let i;for(let e in this.indexes)i=this.indexes[e],n<i&&(this.indexes[e]=i+r.length);return this.markDirty(),this}insertBefore(e,t){let n=this.index(e),r=n===0&&`prepend`,i=this.normalize(t,this.proxyOf.nodes[n],r).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n,0,e);let a;for(let e in this.indexes)a=this.indexes[e],n<=a&&(this.indexes[e]=a+i.length);return this.markDirty(),this}normalize(i,c){if(typeof i==`string`)i=l(a(i).nodes);else if(i===void 0)i=[];else if(Array.isArray(i)){i=i.slice(0);for(let e of i)e.parent&&e.parent.removeChild(e,`ignore`)}else if(i.type===`root`&&this.type!==`document`){i=i.nodes.slice(0);for(let e of i)e.parent&&e.parent.removeChild(e,`ignore`)}else if(i.type)i=[i];else if(i.prop){if(i.value===void 0)throw Error(`Value field is missed in node creation`);typeof i.value!=`string`&&(i.value=String(i.value)),i=[new n(i)]}else if(i.selector)i=[new o(i)];else if(i.name)i=[new s(i)];else if(i.text)i=[new r(i)];else throw Error(`Unknown node type in node creation`);return i.map(n=>(n[t]||d.rebuild(n),n=n.proxyOf,n.parent&&n.parent.removeChild(n),n[e]&&u(n),n.raws.before===void 0&&c&&c.raws.before!==void 0&&(n.raws.before=c.raws.before.replace(/\S/g,``)),n.parent=this.proxyOf,n))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,`prepend`).reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let t;for(let n in this.indexes)t=this.indexes[n],t>=e&&(this.indexes[n]=t-1);return this.markDirty(),this}replaceValues(e,t,n){return n||(n=t,t={}),this.walkDecls(r=>{t.props&&!t.props.includes(r.prop)||t.fast&&!r.value.includes(t.fast)||(r.value=r.value.replace(e,n))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,n)=>{let r;try{r=e(t,n)}catch(e){throw t.addToError(e)}return r!==!1&&t.walk&&(r=t.walk(e)),r})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if(n.type===`atrule`&&e.test(n.name))return t(n,r)}):this.walk((n,r)=>{if(n.type===`atrule`&&n.name===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if(e.type===`atrule`)return t(e,n)}))}walkComments(e){return this.walk((t,n)=>{if(t.type===`comment`)return e(t,n)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if(n.type===`decl`&&e.test(n.prop))return t(n,r)}):this.walk((n,r)=>{if(n.type===`decl`&&n.prop===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if(e.type===`decl`)return t(e,n)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if(n.type===`rule`&&e.test(n.selector))return t(n,r)}):this.walk((n,r)=>{if(n.type===`rule`&&n.selector===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if(e.type===`rule`)return t(e,n)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}return d.registerParse=e=>{a=e},d.registerRule=e=>{o=e},d.registerAtRule=e=>{s=e},d.registerRoot=e=>{c=e},xr=d,d.default=d,d.rebuild=e=>{e.type===`atrule`?Object.setPrototypeOf(e,s.prototype):e.type===`rule`?Object.setPrototypeOf(e,o.prototype):e.type===`decl`?Object.setPrototypeOf(e,n.prototype):e.type===`comment`?Object.setPrototypeOf(e,r.prototype):e.type===`root`&&Object.setPrototypeOf(e,c.prototype),e[t]=!0,e.nodes&&e.nodes.forEach(e=>{d.rebuild(e)})},xr}var wr,Tr;function Er(){if(Tr)return wr;Tr=1;let e=Cr(),t,n;class r extends e{constructor(e){super({type:`document`,...e}),this.nodes||=[]}toResult(e={}){return new t(new n,this,e).stringify()}}return r.registerLazyResult=e=>{t=e},r.registerProcessor=e=>{n=e},wr=r,r.default=r,wr}var Dr,Or;function kr(){if(Or)return Dr;Or=1;let e={};return Dr=function(t){e[t]||(e[t]=!0,typeof console<`u`&&console.warn&&console.warn(t))},Dr}var Ar,jr;function Mr(){if(jr)return Ar;jr=1;class e{constructor(e,t={}){if(this.type=`warning`,this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+`: `+this.text:this.text}}return Ar=e,e.default=e,Ar}var Nr,Pr;function Fr(){if(Pr)return Nr;Pr=1;let e=Mr();class t{constructor(e,t,n){this.processor=e,this.messages=[],this.root=t,this.opts=n,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,n={}){n.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(n.plugin=this.lastPlugin.postcssPlugin);let r=new e(t,n);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>e.type===`warning`)}get content(){return this.css}}return Nr=t,t.default=t,Nr}var Ir,Lr;function Rr(){if(Lr)return Ir;Lr=1;let e=/[\t\n\f\r "#'()/;[\\\]{}]/g,t=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,n=/.[\r\n"'(/\\]/,r=/[\da-f]/i;return Ir=function(i,a={}){let o=i.css.valueOf(),s=a.ignoreErrors,c,l,u,d,f,p,m,h,g,_,v=o.length,y=0,b=[],x=[];function S(){return y}function C(e){throw i.error(`Unclosed `+e,y)}function w(){return x.length===0&&y>=v}function ee(i){if(x.length)return x.pop();if(y>=v)return;let a=i?i.ignoreUnclosed:!1;switch(c=o.charCodeAt(y),c){case 10:case 32:case 9:case 13:case 12:l=y;do l+=1,c=o.charCodeAt(l);while(c===32||c===10||c===9||c===13||c===12);_=[`space`,o.slice(y,l)],y=l-1;break;case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let e=String.fromCharCode(c);_=[e,e,y];break}case 40:if(h=b.length?b.pop()[1]:``,g=o.charCodeAt(y+1),h===`url`&&g!==39&&g!==34&&g!==32&&g!==10&&g!==9&&g!==12&&g!==13){l=y;do{if(p=!1,l=o.indexOf(`)`,l+1),l===-1)if(s||a){l=y;break}else C(`bracket`);for(m=l;o.charCodeAt(m-1)===92;)--m,p=!p}while(p);_=[`brackets`,o.slice(y,l+1),y,l],y=l}else l=o.indexOf(`)`,y+1),d=o.slice(y,l+1),l===-1||n.test(d)?_=[`(`,`(`,y]:(_=[`brackets`,d,y,l],y=l);break;case 39:case 34:u=c===39?`'`:`"`,l=y;do{if(p=!1,l=o.indexOf(u,l+1),l===-1)if(s||a){l=y+1;break}else C(`string`);for(m=l;o.charCodeAt(m-1)===92;)--m,p=!p}while(p);_=[`string`,o.slice(y,l+1),y,l],y=l;break;case 64:e.lastIndex=y+1,e.test(o),l=e.lastIndex===0?o.length-1:e.lastIndex-2,_=[`at-word`,o.slice(y,l+1),y,l],y=l;break;case 92:for(l=y,f=!0;o.charCodeAt(l+1)===92;)l+=1,f=!f;if(c=o.charCodeAt(l+1),f&&c!==47&&c!==32&&c!==10&&c!==9&&c!==13&&c!==12&&(l+=1,r.test(o.charAt(l)))){for(;r.test(o.charAt(l+1));)l+=1;o.charCodeAt(l+1)===32&&(l+=1)}_=[`word`,o.slice(y,l+1),y,l],y=l;break;default:c===47&&o.charCodeAt(y+1)===42?(l=o.indexOf(`*/`,y+2)+1,l===0&&(s||a?l=o.length:C(`comment`)),_=[`comment`,o.slice(y,l+1),y,l],y=l):(t.lastIndex=y+1,t.test(o),l=t.lastIndex===0?o.length-1:t.lastIndex-2,_=[`word`,o.slice(y,l+1),y,l],b.push(_),y=l);break}return y++,_}function T(e){x.push(e)}return{back:T,endOfFile:w,nextToken:ee,position:S}},Ir}var zr,Br;function Vr(){if(Br)return zr;Br=1;let e=Cr();class t extends e{constructor(e){super(e),this.type=`atrule`}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}return zr=t,t.default=t,e.registerAtRule(t),zr}var Hr,Ur;function Wr(){if(Ur)return Hr;Ur=1;let e=Cr(),t,n;class r extends e{constructor(e){super(e),this.type=`root`,this.nodes||=[]}normalize(e,t,n){let r=super.normalize(e);if(t){if(n===`prepend`)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of r)e.raws.before=t.raws.before}return r}removeChild(e,t){let n=this.index(e);return!t&&n===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(e)}toResult(e={}){return new t(new n,this,e).stringify()}}return r.registerLazyResult=e=>{t=e},r.registerProcessor=e=>{n=e},Hr=r,r.default=r,e.registerRoot(r),Hr}var Gr,Kr;function qr(){if(Kr)return Gr;Kr=1;let e={comma(t){return e.split(t,[`,`],!0)},space(t){return e.split(t,[` `,`
52
- `,` `])},split(e,t,n){let r=[],i=``,a=!1,o=0,s=!1,c=``,l=!1;for(let n of e)l?l=!1:n===`\\`?l=!0:s?n===c&&(s=!1):n===`"`||n===`'`?(s=!0,c=n):n===`(`?o+=1:n===`)`?o>0&&--o:o===0&&t.includes(n)&&(a=!0),a?(i!==``&&r.push(i.trim()),i=``,a=!1):i+=n;return(n||i!==``)&&r.push(i.trim()),r}};return Gr=e,e.default=e,Gr}var Jr,Yr;function Xr(){if(Yr)return Jr;Yr=1;let e=Cr(),t=qr();class n extends e{constructor(e){super(e),this.type=`rule`,this.nodes||=[]}get selectors(){return t.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,n=t?t[0]:`,`+this.raw(`between`,`beforeOpen`);this.selector=e.join(n)}}return Jr=n,n.default=n,e.registerRule(n),Jr}var Zr,Qr;function $r(){if(Qr)return Zr;Qr=1;let e=ar(),t=Rr(),n=br(),r=Vr(),i=Wr(),a=Xr(),o={empty:!0,space:!0};function s(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}class c{constructor(e){this.input=e,this.root=new i,this.current=this.root,this.spaces=``,this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t=new r;t.name=e[1].slice(1),t.name===``&&this.unnamedAtrule(t,e),this.init(t,e[2]);let n,i,a,o=!1,s=!1,c=[],l=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),n=e[0],n===`(`||n===`[`?l.push(n===`(`?`)`:`]`):n===`{`&&l.length>0?l.push(`}`):n===l[l.length-1]&&l.pop(),l.length===0)if(n===`;`){t.source.end=this.getPosition(e[2]),t.source.end.offset++,this.semicolon=!0;break}else if(n===`{`){s=!0;break}else if(n===`}`){if(c.length>0){for(a=c.length-1,i=c[a];i&&i[0]===`space`;)i=c[--a];i&&(t.source.end=this.getPosition(i[3]||i[2]),t.source.end.offset++)}this.end(e);break}else c.push(e);else c.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}t.raws.between=this.spacesAndCommentsFromEnd(c),c.length?(t.raws.afterName=this.spacesAndCommentsFromStart(c),this.raw(t,`params`,c),o&&(e=c[c.length-1],t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,this.spaces=t.raws.between,t.raws.between=``)):(t.raws.afterName=``,t.params=``),s&&(t.nodes=[],this.current=t)}checkMissedSemicolon(e){let t=this.colon(e);if(t===!1)return;let n=0,r;for(let i=t-1;i>=0&&(r=e[i],!(r[0]!==`space`&&(n+=1,n===2)));i--);throw this.input.error(`Missed semicolon`,r[0]===`word`?r[3]+1:r[2])}colon(e){let t=0,n,r,i;for(let[a,o]of e.entries()){if(n=o,r=n[0],r===`(`&&(t+=1),r===`)`&&--t,t===0&&r===`:`)if(!i)this.doubleColon(n);else if(i[0]===`word`&&i[1]===`progid`)continue;else return a;i=n}return!1}comment(e){let t=new n;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text=``,t.raws.left=r,t.raws.right=``;else{let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(t,n){let r=new e;this.init(r,t[0][2]);let i=t[t.length-1];for(i[0]===`;`&&(this.semicolon=!0,t.pop()),r.source.end=this.getPosition(i[3]||i[2]||s(t)),r.source.end.offset++;t[0][0]!==`word`;)t.length===1&&this.unknownWord(t),r.raws.before+=t.shift()[1];for(r.source.start=this.getPosition(t[0][2]),r.prop=``;t.length;){let e=t[0][0];if(e===`:`||e===`space`||e===`comment`)break;r.prop+=t.shift()[1]}r.raws.between=``;let a;for(;t.length;)if(a=t.shift(),a[0]===`:`){r.raws.between+=a[1];break}else a[0]===`word`&&/\w/.test(a[1])&&this.unknownWord([a]),r.raws.between+=a[1];(r.prop[0]===`_`||r.prop[0]===`*`)&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let o=[],c;for(;t.length&&(c=t[0][0],!(c!==`space`&&c!==`comment`));)o.push(t.shift());this.precheckMissedSemicolon(t);for(let e=t.length-1;e>=0;e--){if(a=t[e],a[1].toLowerCase()===`!important`){r.important=!0;let n=this.stringFrom(t,e);n=this.spacesFromEnd(t)+n,n!==` !important`&&(r.raws.important=n);break}else if(a[1].toLowerCase()===`important`){let n=t.slice(0),i=``;for(let t=e;t>0;t--){let e=n[t][0];if(i.trim().indexOf(`!`)===0&&e!==`space`)break;i=n.pop()[1]+i}i.trim().indexOf(`!`)===0&&(r.important=!0,r.raws.important=i,t=n)}if(a[0]!==`space`&&a[0]!==`comment`)break}t.some(e=>e[0]!==`space`&&e[0]!==`comment`)&&(r.raws.between+=o.map(e=>e[1]).join(``),o=[]),this.raw(r,`value`,o.concat(t),n),r.value.includes(`:`)&&!n&&this.checkMissedSemicolon(t)}doubleColon(e){throw this.input.error(`Double colon`,{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new a;this.init(t,e[2]),t.selector=``,t.raws.between=``,this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||``)+this.spaces,this.spaces=``,this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||``)+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&e.type===`rule`&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces=``)}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces=``,e.type!==`comment`&&(this.semicolon=!1)}other(e){let t=!1,n=null,r=!1,i=null,a=[],o=e[1].startsWith(`--`),s=[],c=e;for(;c;){if(n=c[0],s.push(c),n===`(`||n===`[`)i||=c,a.push(n===`(`?`)`:`]`);else if(o&&r&&n===`{`)i||=c,a.push(`}`);else if(a.length===0)if(n===`;`)if(r){this.decl(s,o);return}else break;else if(n===`{`){this.rule(s);return}else if(n===`}`){this.tokenizer.back(s.pop()),t=!0;break}else n===`:`&&(r=!0);else n===a[a.length-1]&&(a.pop(),a.length===0&&(i=null));c=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),a.length>0&&this.unclosedBracket(i),t&&r){if(!o)for(;s.length&&(c=s[s.length-1][0],!(c!==`space`&&c!==`comment`));)this.tokenizer.back(s.pop());this.decl(s,o)}else this.unknownWord(s)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case`space`:this.spaces+=e[1];break;case`;`:this.freeSemicolon(e);break;case`}`:this.end(e);break;case`comment`:this.comment(e);break;case`at-word`:this.atrule(e);break;case`{`:this.emptyRule(e);break;default:this.other(e);break}this.endFile()}precheckMissedSemicolon(){}raw(e,t,n,r){let i,a,s=n.length,c=``,l=!0,u,d;for(let e=0;e<s;e+=1)i=n[e],a=i[0],a===`space`&&e===s-1&&!r?l=!1:a===`comment`?(d=n[e-1]?n[e-1][0]:`empty`,u=n[e+1]?n[e+1][0]:`empty`,!o[d]&&!o[u]?c.slice(-1)===`,`?l=!1:c+=i[1]:l=!1):c+=i[1];if(!l){let r=n.reduce((e,t)=>e+t[1],``);e.raws[t]={raw:r,value:c}}e[t]=c}rule(e){e.pop();let t=new a;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,`selector`,e),this.current=t}spacesAndCommentsFromEnd(e){let t,n=``;for(;e.length&&(t=e[e.length-1][0],!(t!==`space`&&t!==`comment`));)n=e.pop()[1]+n;return n}spacesAndCommentsFromStart(e){let t,n=``;for(;e.length&&(t=e[0][0],!(t!==`space`&&t!==`comment`));)n+=e.shift()[1];return n}spacesFromEnd(e){let t,n=``;for(;e.length&&(t=e[e.length-1][0],t===`space`);)n=e.pop()[1]+n;return n}stringFrom(e,t){let n=``;for(let r=t;r<e.length;r++)n+=e[r][1];return e.splice(t,e.length-t),n}unclosedBlock(){let e=this.current.source.start;throw this.input.error(`Unclosed block`,e.line,e.column)}unclosedBracket(e){throw this.input.error(`Unclosed bracket`,{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error(`Unexpected }`,{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error(`Unknown word`,{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error(`At-rule without name`,{offset:t[2]},{offset:t[2]+t[1].length})}}return Zr=c,Zr}var ei,ti;function ni(){if(ti)return ei;ti=1;let e=Cr(),t=$r(),n=mr();function r(e,r){let i=new n(e,r),a=new t(i);try{a.parse()}catch(e){throw process.env.NODE_ENV!==`production`&&e.name===`CssSyntaxError`&&r&&r.from&&(/\.scss$/i.test(r.from)?e.message+=`
50
+ `),this.css+=t+`/*# sourceMappingURL=`+e+` */`}applyPrevMaps(){for(let t of this.previous()){let r=this.toUrl(this.path(t.file)),i=t.root||n(t.file),a;this.mapOpts.sourcesContent===!1?(a=new e(t.text),a.sourcesContent&&(a.sourcesContent=null)):a=t.consumer(),this.map.applySourceMap(a,r,this.toUrl(this.path(i)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1){if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],e.type===`comment`&&e.text.indexOf(`# sourceMappingURL=`)===0&&this.root.removeChild(t)}else this.css&&=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,``)}}generate(){if(this.clearAnnotation(),l&&c&&this.isMap())return this.generateMap();{let e=``;return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=t.fromSourceMap(e,{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 e=1,n=1,r=`<no source>`,i={generated:{column:0,line:0},original:{column:0,line:0},source:``},a,o;this.stringify(this.root,(t,s,c)=>{if(this.css+=t,s&&c!==`end`&&(i.generated.line=e,i.generated.column=n-1,s.source&&s.source.start?(i.source=this.sourcePath(s),i.original.line=s.source.start.line,i.original.column=s.source.start.column-1,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,this.map.addMapping(i))),a=t.match(/\n/g),a?(e+=a.length,o=t.lastIndexOf(`
51
+ `),n=t.length-o):n+=t.length,s&&c!==`start`){let t=s.parent||{raws:{}};(!(s.type===`decl`||s.type===`atrule`&&!s.nodes)||s!==t.last||t.raws.semicolon)&&(s.source&&s.source.end?(i.source=this.sourcePath(s),i.original.line=s.source.end.line,i.original.column=s.source.end.column-1,i.generated.line=e,i.generated.column=n-2,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,i.generated.line=e,i.generated.column=n-1,this.map.addMapping(i)))}})}isAnnotation(){return this.isInline()?!0:this.mapOpts.annotation===void 0?!this.previous().length||this.previous().some(e=>e.annotation):this.mapOpts.annotation}isInline(){if(this.mapOpts.inline!==void 0)return this.mapOpts.inline;let e=this.mapOpts.annotation;return e!==void 0&&e!==!0?!1:!this.previous().length||this.previous().some(e=>e.inline)}isMap(){return this.opts.map===void 0?this.previous().length>0:!!this.opts.map}isSourcesContent(){return this.mapOpts.sourcesContent===void 0?!this.previous().length||this.previous().some(e=>e.withContent()):this.mapOpts.sourcesContent}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):`to.css`}path(e){if(this.mapOpts.absolute||e.charCodeAt(0)===60||/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let a=this.opts.to?n(this.opts.to):`.`;typeof this.mapOpts.annotation==`string`&&(a=n(i(a,this.mapOpts.annotation)));let o=r(a,e);return this.memoizedPaths.set(e,o),o}previous(){if(!this.previousMaps){if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new s(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let n=t.source.input.from;if(n&&!e[n]){e[n]=!0;let r=this.usesFileUrls?this.toFileUrl(n):this.toUrl(this.path(n));this.map.setSourceContent(r,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):`<no source>`;this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString(`base64`):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(o){let t=o(e).toString();return this.memoizedFileURLs.set(e,t),t}throw Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;a===`\\`&&(e=e.replace(/\\/g,`/`));let n=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,n),n}}return _r=u,_r}var br,xr;function Sr(){if(xr)return br;xr=1;let e=ir();class t extends e{constructor(e){super(e),this.type=`comment`}}return br=t,t.default=t,br}var Cr,wr;function Tr(){if(wr)return Cr;wr=1;let{isClean:e,my:t}=Yn(),n=sr(),r=Sr(),i=ir(),a,o,s,c;function l(e){return e.map(e=>(e.nodes&&=l(e.nodes),delete e.source,e))}function u(t){if(t[e]=!1,t.proxyOf.nodes)for(let e of t.proxyOf.nodes)u(e)}class d extends i{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t=this.getIterator(),n,r;for(;this.indexes[t]<this.proxyOf.nodes.length&&(n=this.indexes[t],r=e(this.proxyOf.nodes[n],n),r!==!1);)this.indexes[t]+=1;return delete this.indexes[t],r}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||=0,this.indexes||={},this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get(e,t){return t===`proxyOf`?e:e[t]?t===`each`||typeof t==`string`&&t.startsWith(`walk`)?(...n)=>e[t](...n.map(e=>typeof e==`function`?(t,n)=>e(t.toProxy(),n):e)):t===`every`||t===`some`?n=>e[t]((e,...t)=>n(e.toProxy(),...t)):t===`root`?()=>e.root().toProxy():t===`nodes`?e.nodes.map(e=>e.toProxy()):t===`first`||t===`last`?e[t].toProxy():e[t]:e[t]},set(e,t,n){return e[t]===n||(e[t]=n,(t===`name`||t===`params`||t===`selector`)&&e.markDirty(),!0)}}}index(e){return typeof e==`number`?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let n=this.index(e),r=this.normalize(t,this.proxyOf.nodes[n]).reverse();n=this.index(e);for(let e of r)this.proxyOf.nodes.splice(n+1,0,e);let i;for(let e in this.indexes)i=this.indexes[e],n<i&&(this.indexes[e]=i+r.length);return this.markDirty(),this}insertBefore(e,t){let n=this.index(e),r=n===0&&`prepend`,i=this.normalize(t,this.proxyOf.nodes[n],r).reverse();n=this.index(e);for(let e of i)this.proxyOf.nodes.splice(n,0,e);let a;for(let e in this.indexes)a=this.indexes[e],n<=a&&(this.indexes[e]=a+i.length);return this.markDirty(),this}normalize(i,c){if(typeof i==`string`)i=l(a(i).nodes);else if(i===void 0)i=[];else if(Array.isArray(i)){i=i.slice(0);for(let e of i)e.parent&&e.parent.removeChild(e,`ignore`)}else if(i.type===`root`&&this.type!==`document`){i=i.nodes.slice(0);for(let e of i)e.parent&&e.parent.removeChild(e,`ignore`)}else if(i.type)i=[i];else if(i.prop){if(i.value===void 0)throw Error(`Value field is missed in node creation`);typeof i.value!=`string`&&(i.value=String(i.value)),i=[new n(i)]}else if(i.selector)i=[new o(i)];else if(i.name)i=[new s(i)];else if(i.text)i=[new r(i)];else throw Error(`Unknown node type in node creation`);return i.map(n=>(n[t]||d.rebuild(n),n=n.proxyOf,n.parent&&n.parent.removeChild(n),n[e]&&u(n),n.raws.before===void 0&&c&&c.raws.before!==void 0&&(n.raws.before=c.raws.before.replace(/\S/g,``)),n.parent=this.proxyOf,n))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,`prepend`).reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let t;for(let n in this.indexes)t=this.indexes[n],t>=e&&(this.indexes[n]=t-1);return this.markDirty(),this}replaceValues(e,t,n){return n||(n=t,t={}),this.walkDecls(r=>{(!t.props||t.props.includes(r.prop))&&(!t.fast||r.value.includes(t.fast))&&(r.value=r.value.replace(e,n))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,n)=>{let r;try{r=e(t,n)}catch(e){throw t.addToError(e)}return r!==!1&&t.walk&&(r=t.walk(e)),r})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if(n.type===`atrule`&&e.test(n.name))return t(n,r)}):this.walk((n,r)=>{if(n.type===`atrule`&&n.name===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if(e.type===`atrule`)return t(e,n)}))}walkComments(e){return this.walk((t,n)=>{if(t.type===`comment`)return e(t,n)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if(n.type===`decl`&&e.test(n.prop))return t(n,r)}):this.walk((n,r)=>{if(n.type===`decl`&&n.prop===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if(e.type===`decl`)return t(e,n)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if(n.type===`rule`&&e.test(n.selector))return t(n,r)}):this.walk((n,r)=>{if(n.type===`rule`&&n.selector===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if(e.type===`rule`)return t(e,n)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}}return d.registerParse=e=>{a=e},d.registerRule=e=>{o=e},d.registerAtRule=e=>{s=e},d.registerRoot=e=>{c=e},Cr=d,d.default=d,d.rebuild=e=>{e.type===`atrule`?Object.setPrototypeOf(e,s.prototype):e.type===`rule`?Object.setPrototypeOf(e,o.prototype):e.type===`decl`?Object.setPrototypeOf(e,n.prototype):e.type===`comment`?Object.setPrototypeOf(e,r.prototype):e.type===`root`&&Object.setPrototypeOf(e,c.prototype),e[t]=!0,e.nodes&&e.nodes.forEach(e=>{d.rebuild(e)})},Cr}var Er,Dr;function Or(){if(Dr)return Er;Dr=1;let e=Tr(),t,n;class r extends e{constructor(e){super({type:`document`,...e}),this.nodes||=[]}toResult(e={}){return new t(new n,this,e).stringify()}}return r.registerLazyResult=e=>{t=e},r.registerProcessor=e=>{n=e},Er=r,r.default=r,Er}var kr,Ar;function jr(){if(Ar)return kr;Ar=1;let e={};return kr=function(t){e[t]||(e[t]=!0,typeof console<`u`&&console.warn&&console.warn(t))},kr}var Mr,Nr;function Pr(){if(Nr)return Mr;Nr=1;class e{constructor(e,t={}){if(this.type=`warning`,this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+`: `+this.text:this.text}}return Mr=e,e.default=e,Mr}var Fr,Ir;function Lr(){if(Ir)return Fr;Ir=1;let e=Pr();class t{constructor(e,t,n){this.processor=e,this.messages=[],this.root=t,this.opts=n,this.css=void 0,this.map=void 0}toString(){return this.css}warn(t,n={}){n.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(n.plugin=this.lastPlugin.postcssPlugin);let r=new e(t,n);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>e.type===`warning`)}get content(){return this.css}}return Fr=t,t.default=t,Fr}var Rr,zr;function Br(){if(zr)return Rr;zr=1;let e=/[\t\n\f\r "#'()/;[\\\]{}]/g,t=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,n=/.[\r\n"'(/\\]/,r=/[\da-f]/i;return Rr=function(i,a={}){let o=i.css.valueOf(),s=a.ignoreErrors,c,l,u,d,f,p,m,h,g,_,v=o.length,y=0,b=[],x=[];function S(){return y}function C(e){throw i.error(`Unclosed `+e,y)}function w(){return x.length===0&&y>=v}function T(i){if(x.length)return x.pop();if(y>=v)return;let a=i?i.ignoreUnclosed:!1;switch(c=o.charCodeAt(y),c){case 10:case 32:case 9:case 13:case 12:l=y;do l+=1,c=o.charCodeAt(l);while(c===32||c===10||c===9||c===13||c===12);_=[`space`,o.slice(y,l)],y=l-1;break;case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let e=String.fromCharCode(c);_=[e,e,y];break}case 40:if(h=b.length?b.pop()[1]:``,g=o.charCodeAt(y+1),h===`url`&&g!==39&&g!==34&&g!==32&&g!==10&&g!==9&&g!==12&&g!==13){l=y;do{if(p=!1,l=o.indexOf(`)`,l+1),l===-1){if(s||a){l=y;break}C(`bracket`)}for(m=l;o.charCodeAt(m-1)===92;)--m,p=!p}while(p);_=[`brackets`,o.slice(y,l+1),y,l],y=l}else l=o.indexOf(`)`,y+1),d=o.slice(y,l+1),l===-1||n.test(d)?_=[`(`,`(`,y]:(_=[`brackets`,d,y,l],y=l);break;case 39:case 34:u=c===39?`'`:`"`,l=y;do{if(p=!1,l=o.indexOf(u,l+1),l===-1){if(s||a){l=y+1;break}C(`string`)}for(m=l;o.charCodeAt(m-1)===92;)--m,p=!p}while(p);_=[`string`,o.slice(y,l+1),y,l],y=l;break;case 64:e.lastIndex=y+1,e.test(o),l=e.lastIndex===0?o.length-1:e.lastIndex-2,_=[`at-word`,o.slice(y,l+1),y,l],y=l;break;case 92:for(l=y,f=!0;o.charCodeAt(l+1)===92;)l+=1,f=!f;if(c=o.charCodeAt(l+1),f&&c!==47&&c!==32&&c!==10&&c!==9&&c!==13&&c!==12&&(l+=1,r.test(o.charAt(l)))){for(;r.test(o.charAt(l+1));)l+=1;o.charCodeAt(l+1)===32&&(l+=1)}_=[`word`,o.slice(y,l+1),y,l],y=l;break;default:c===47&&o.charCodeAt(y+1)===42?(l=o.indexOf(`*/`,y+2)+1,l===0&&(s||a?l=o.length:C(`comment`)),_=[`comment`,o.slice(y,l+1),y,l],y=l):(t.lastIndex=y+1,t.test(o),l=t.lastIndex===0?o.length-1:t.lastIndex-2,_=[`word`,o.slice(y,l+1),y,l],b.push(_),y=l)}return y++,_}function E(e){x.push(e)}return{back:E,endOfFile:w,nextToken:T,position:S}},Rr}var Vr,Hr;function Ur(){if(Hr)return Vr;Hr=1;let e=Tr();class t extends e{constructor(e){super(e),this.type=`atrule`}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}}return Vr=t,t.default=t,e.registerAtRule(t),Vr}var Wr,Gr;function Kr(){if(Gr)return Wr;Gr=1;let e=Tr(),t,n;class r extends e{constructor(e){super(e),this.type=`root`,this.nodes||=[]}normalize(e,t,n){let r=super.normalize(e);if(t){if(n===`prepend`)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of r)e.raws.before=t.raws.before}return r}removeChild(e,t){let n=this.index(e);return!t&&n===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(e)}toResult(e={}){return new t(new n,this,e).stringify()}}return r.registerLazyResult=e=>{t=e},r.registerProcessor=e=>{n=e},Wr=r,r.default=r,e.registerRoot(r),Wr}var qr,Jr;function Yr(){if(Jr)return qr;Jr=1;let e={comma(t){return e.split(t,[`,`],!0)},space(t){return e.split(t,[` `,`
52
+ `,` `])},split(e,t,n){let r=[],i=``,a=!1,o=0,s=!1,c=``,l=!1;for(let n of e)l?l=!1:n===`\\`?l=!0:s?n===c&&(s=!1):n===`"`||n===`'`?(s=!0,c=n):n===`(`?o+=1:n===`)`?o>0&&--o:o===0&&t.includes(n)&&(a=!0),a?(i!==``&&r.push(i.trim()),i=``,a=!1):i+=n;return(n||i!==``)&&r.push(i.trim()),r}};return qr=e,e.default=e,qr}var Xr,Zr;function Qr(){if(Zr)return Xr;Zr=1;let e=Tr(),t=Yr();class n extends e{constructor(e){super(e),this.type=`rule`,this.nodes||=[]}get selectors(){return t.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,n=t?t[0]:`,`+this.raw(`between`,`beforeOpen`);this.selector=e.join(n)}}return Xr=n,n.default=n,e.registerRule(n),Xr}var $r,ei;function ti(){if(ei)return $r;ei=1;let e=sr(),t=Br(),n=Sr(),r=Ur(),i=Kr(),a=Qr(),o={empty:!0,space:!0};function s(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}class c{constructor(e){this.input=e,this.root=new i,this.current=this.root,this.spaces=``,this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t=new r;t.name=e[1].slice(1),t.name===``&&this.unnamedAtrule(t,e),this.init(t,e[2]);let n,i,a,o=!1,s=!1,c=[],l=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),n=e[0],n===`(`||n===`[`?l.push(n===`(`?`)`:`]`):n===`{`&&l.length>0?l.push(`}`):n===l[l.length-1]&&l.pop(),l.length===0){if(n===`;`){t.source.end=this.getPosition(e[2]),t.source.end.offset++,this.semicolon=!0;break}if(n===`{`){s=!0;break}if(n===`}`){if(c.length>0){for(a=c.length-1,i=c[a];i&&i[0]===`space`;)i=c[--a];i&&(t.source.end=this.getPosition(i[3]||i[2]),t.source.end.offset++)}this.end(e);break}c.push(e)}else c.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}t.raws.between=this.spacesAndCommentsFromEnd(c),c.length?(t.raws.afterName=this.spacesAndCommentsFromStart(c),this.raw(t,`params`,c),o&&(e=c[c.length-1],t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,this.spaces=t.raws.between,t.raws.between=``)):(t.raws.afterName=``,t.params=``),s&&(t.nodes=[],this.current=t)}checkMissedSemicolon(e){let t=this.colon(e);if(t===!1)return;let n=0,r;for(let i=t-1;i>=0&&(r=e[i],!(r[0]!==`space`&&(n+=1,n===2)));i--);throw this.input.error(`Missed semicolon`,r[0]===`word`?r[3]+1:r[2])}colon(e){let t=0,n,r,i;for(let[a,o]of e.entries()){if(n=o,r=n[0],r===`(`&&(t+=1),r===`)`&&--t,t===0&&r===`:`){if(!i)this.doubleColon(n);else if(i[0]===`word`&&i[1]===`progid`)continue;else return a}i=n}return!1}comment(e){let t=new n;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text=``,t.raws.left=r,t.raws.right=``;else{let e=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=t(this.input)}decl(t,n){let r=new e;this.init(r,t[0][2]);let i=t[t.length-1];for(i[0]===`;`&&(this.semicolon=!0,t.pop()),r.source.end=this.getPosition(i[3]||i[2]||s(t)),r.source.end.offset++;t[0][0]!==`word`;)t.length===1&&this.unknownWord(t),r.raws.before+=t.shift()[1];for(r.source.start=this.getPosition(t[0][2]),r.prop=``;t.length;){let e=t[0][0];if(e===`:`||e===`space`||e===`comment`)break;r.prop+=t.shift()[1]}r.raws.between=``;let a;for(;t.length;){if(a=t.shift(),a[0]===`:`){r.raws.between+=a[1];break}a[0]===`word`&&/\w/.test(a[1])&&this.unknownWord([a]),r.raws.between+=a[1]}(r.prop[0]===`_`||r.prop[0]===`*`)&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let o=[],c;for(;t.length&&(c=t[0][0],c===`space`||c===`comment`);)o.push(t.shift());this.precheckMissedSemicolon(t);for(let e=t.length-1;e>=0;e--){if(a=t[e],a[1].toLowerCase()===`!important`){r.important=!0;let n=this.stringFrom(t,e);n=this.spacesFromEnd(t)+n,n!==` !important`&&(r.raws.important=n);break}if(a[1].toLowerCase()===`important`){let n=t.slice(0),i=``;for(let t=e;t>0;t--){let e=n[t][0];if(i.trim().indexOf(`!`)===0&&e!==`space`)break;i=n.pop()[1]+i}i.trim().indexOf(`!`)===0&&(r.important=!0,r.raws.important=i,t=n)}if(a[0]!==`space`&&a[0]!==`comment`)break}t.some(e=>e[0]!==`space`&&e[0]!==`comment`)&&(r.raws.between+=o.map(e=>e[1]).join(``),o=[]),this.raw(r,`value`,o.concat(t),n),r.value.includes(`:`)&&!n&&this.checkMissedSemicolon(t)}doubleColon(e){throw this.input.error(`Double colon`,{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new a;this.init(t,e[2]),t.selector=``,t.raws.between=``,this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||``)+this.spaces,this.spaces=``,this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||``)+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&e.type===`rule`&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces=``)}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces=``,e.type!==`comment`&&(this.semicolon=!1)}other(e){let t=!1,n=null,r=!1,i=null,a=[],o=e[1].startsWith(`--`),s=[],c=e;for(;c;){if(n=c[0],s.push(c),n===`(`||n===`[`)i||=c,a.push(n===`(`?`)`:`]`);else if(o&&r&&n===`{`)i||=c,a.push(`}`);else if(a.length===0){if(n===`;`){if(r){this.decl(s,o);return}break}if(n===`{`){this.rule(s);return}if(n===`}`){this.tokenizer.back(s.pop()),t=!0;break}n===`:`&&(r=!0)}else n===a[a.length-1]&&(a.pop(),a.length===0&&(i=null));c=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),a.length>0&&this.unclosedBracket(i),t&&r){if(!o)for(;s.length&&(c=s[s.length-1][0],c===`space`||c===`comment`);)this.tokenizer.back(s.pop());this.decl(s,o)}else this.unknownWord(s)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case`space`:this.spaces+=e[1];break;case`;`:this.freeSemicolon(e);break;case`}`:this.end(e);break;case`comment`:this.comment(e);break;case`at-word`:this.atrule(e);break;case`{`:this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,n,r){let i,a,s=n.length,c=``,l=!0,u,d;for(let e=0;e<s;e+=1)i=n[e],a=i[0],a===`space`&&e===s-1&&!r?l=!1:a===`comment`?(d=n[e-1]?n[e-1][0]:`empty`,u=n[e+1]?n[e+1][0]:`empty`,!o[d]&&!o[u]?c.slice(-1)===`,`?l=!1:c+=i[1]:l=!1):c+=i[1];if(!l){let r=n.reduce((e,t)=>e+t[1],``);e.raws[t]={raw:r,value:c}}e[t]=c}rule(e){e.pop();let t=new a;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,`selector`,e),this.current=t}spacesAndCommentsFromEnd(e){let t,n=``;for(;e.length&&(t=e[e.length-1][0],t===`space`||t===`comment`);)n=e.pop()[1]+n;return n}spacesAndCommentsFromStart(e){let t,n=``;for(;e.length&&(t=e[0][0],t===`space`||t===`comment`);)n+=e.shift()[1];return n}spacesFromEnd(e){let t,n=``;for(;e.length&&(t=e[e.length-1][0],t===`space`);)n=e.pop()[1]+n;return n}stringFrom(e,t){let n=``;for(let r=t;r<e.length;r++)n+=e[r][1];return e.splice(t,e.length-t),n}unclosedBlock(){let e=this.current.source.start;throw this.input.error(`Unclosed block`,e.line,e.column)}unclosedBracket(e){throw this.input.error(`Unclosed bracket`,{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error(`Unexpected }`,{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error(`Unknown word`,{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error(`At-rule without name`,{offset:t[2]},{offset:t[2]+t[1].length})}}return $r=c,$r}var ni,ri;function ii(){if(ri)return ni;ri=1;let e=Tr(),t=ti(),n=gr();function r(e,r){let i=new n(e,r),a=new t(i);try{a.parse()}catch(e){throw process.env.NODE_ENV!==`production`&&e.name===`CssSyntaxError`&&r&&r.from&&(/\.scss$/i.test(r.from)?e.message+=`
53
53
  You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser`:/\.sass/i.test(r.from)?e.message+=`
54
54
  You tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser`:/\.less$/i.test(r.from)&&(e.message+=`
55
- You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),e}return a.root}return ei=r,r.default=r,e.registerParse(r),ei}var ri,ii;function ai(){if(ii)return ri;ii=1;let{isClean:e,my:t}=qn(),n=_r(),r=$n(),i=Cr(),a=Er(),o=kr(),s=Fr(),c=ni(),l=Wr(),u={atrule:`AtRule`,comment:`Comment`,decl:`Declaration`,document:`Document`,root:`Root`,rule:`Rule`},d={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},f={Once:!0,postcssPlugin:!0,prepare:!0};function p(e){return typeof e==`object`&&typeof e.then==`function`}function m(e){let t=!1,n=u[e.type];return e.type===`decl`?t=e.prop.toLowerCase():e.type===`atrule`&&(t=e.name.toLowerCase()),t&&e.append?[n,n+`-`+t,0,n+`Exit`,n+`Exit-`+t]:t?[n,n+`-`+t,n+`Exit`,n+`Exit-`+t]:e.append?[n,0,n+`Exit`]:[n,n+`Exit`]}function h(e){let t;return t=e.type===`document`?[`Document`,0,`DocumentExit`]:e.type===`root`?[`Root`,0,`RootExit`]:m(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function g(t){return t[e]=!1,t.nodes&&t.nodes.forEach(e=>g(e)),t}let _={};class v{constructor(e,n,r){this.stringified=!1,this.processed=!1;let a;if(typeof n==`object`&&n&&(n.type===`root`||n.type===`document`))a=g(n);else if(n instanceof v||n instanceof s)a=g(n.root),n.map&&(r.map===void 0&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{let e=c;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{a=e(n,r)}catch(e){this.processed=!0,this.error=e}a&&!a[t]&&i.rebuild(a)}this.result=new s(e,a,r),this.helpers={..._,postcss:_,result:this.result},this.plugins=this.processor.plugins.map(e=>typeof e==`object`&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||=this.runAsync(),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw Error(`Use process(css).then(cb) to work with async plugins`)}handleError(e,t){let n=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,e.name===`CssSyntaxError`&&!e.plugin)e.plugin=n.postcssPlugin,e.setMessage();else if(n.postcssVersion&&process.env.NODE_ENV!==`production`){let e=n.postcssPlugin,t=n.postcssVersion,r=this.result.processor.version,i=t.split(`.`),a=r.split(`.`);(i[0]!==a[0]||parseInt(i[1])>parseInt(a[1]))&&console.error(`Unknown error from PostCSS plugin. Your current PostCSS version is `+r+`, but `+e+` uses `+t+`. Perhaps this is the source of the error below.`)}}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,n)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,n])};for(let t of this.plugins)if(typeof t==`object`)for(let n in t){if(!d[n]&&/^[A-Z]/.test(n))throw Error(`Unknown event ${n} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!f[n])if(typeof t[n]==`object`)for(let r in t[n])r===`*`?e(t,n,t[n][r]):e(t,n+`-`+r.toLowerCase(),t[n][r]);else typeof t[n]==`function`&&e(t,n,t[n])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],n=this.runOnRoot(t);if(p(n))try{await n}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];){t[e]=!0;let n=[h(t)];for(;n.length>0;){let e=this.visitTick(n);if(p(e))try{await e}catch(e){let t=n[n.length-1].node;throw this.handleError(e,t)}}}if(this.listeners.OnceExit)for(let[e,n]of this.listeners.OnceExit){this.result.lastPlugin=e;try{if(t.type===`document`){let e=t.nodes.map(e=>n(e,this.helpers));await Promise.all(e)}else await n(t,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if(typeof e==`object`&&e.Once){if(this.result.root.type===`document`){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return p(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}else if(typeof e==`function`)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=r;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let i=new n(t,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins)if(p(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];)t[e]=!0,this.walkSync(t);if(this.listeners.OnceExit)if(t.type===`document`)for(let e of t.nodes)this.visitSync(this.listeners.OnceExit,e);else this.visitSync(this.listeners.OnceExit,t)}return this.result}then(e,t){return process.env.NODE_ENV!==`production`&&(`from`in this.opts||o("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[n,r]of e){this.result.lastPlugin=n;let e;try{e=r(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if(t.type!==`root`&&t.type!==`document`&&!t.parent)return!0;if(p(e))throw this.getAsyncError()}}visitTick(t){let n=t[t.length-1],{node:r,visitors:i}=n;if(r.type!==`root`&&r.type!==`document`&&!r.parent){t.pop();return}if(i.length>0&&n.visitorIndex<i.length){let[e,t]=i[n.visitorIndex];n.visitorIndex+=1,n.visitorIndex===i.length&&(n.visitors=[],n.visitorIndex=0),this.result.lastPlugin=e;try{return t(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(n.iterator!==0){let i=n.iterator,a;for(;a=r.nodes[r.indexes[i]];)if(r.indexes[i]+=1,!a[e]){a[e]=!0,t.push(h(a));return}n.iterator=0,delete r.indexes[i]}let a=n.events;for(;n.eventIndex<a.length;){let t=a[n.eventIndex];if(n.eventIndex+=1,t===0){r.nodes&&r.nodes.length&&(r[e]=!0,n.iterator=r.getIterator());return}else if(this.listeners[t]){n.visitors=this.listeners[t];return}}t.pop()}walkSync(t){t[e]=!0;let n=m(t);for(let r of n)if(r===0)t.nodes&&t.each(t=>{t[e]||this.walkSync(t)});else{let e=this.listeners[r];if(e&&this.visitSync(e,t.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 v.registerPostcss=e=>{_=e},ri=v,v.default=v,l.registerLazyResult(v),a.registerLazyResult(v),ri}var oi,si;function ci(){if(si)return oi;si=1;let e=_r(),t=$n(),n=kr(),r=ni(),i=Fr();class a{constructor(n,r,a){r=r.toString(),this.stringified=!1,this._processor=n,this._css=r,this._opts=a,this._map=void 0;let o=t;this.result=new i(this._processor,void 0,this._opts),this.result.css=r;let s=this;Object.defineProperty(this.result,"root",{get(){return s.root}});let c=new e(o,void 0,this._opts,r);if(c.isMap()){let[e,t]=c.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else c.clearAnnotation(),this.result.css=c.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return process.env.NODE_ENV!==`production`&&(`from`in this._opts||n("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=r;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return`NoWorkResult`}}return oi=a,a.default=a,oi}var li,ui;function di(){if(ui)return li;ui=1;let e=ci(),t=ai(),n=Er(),r=Wr();class i{constructor(e=[]){this.version=`8.4.38`,this.plugins=this.normalize(e)}normalize(e){let t=[];for(let n of e)if(n.postcss===!0?n=n():n.postcss&&(n=n.postcss),typeof n==`object`&&Array.isArray(n.plugins))t=t.concat(n.plugins);else if(typeof n==`object`&&n.postcssPlugin)t.push(n);else if(typeof n==`function`)t.push(n);else if(typeof n==`object`&&(n.parse||n.stringify)){if(process.env.NODE_ENV!==`production`)throw Error(`PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.`)}else throw Error(n+` is not a PostCSS plugin`);return t}process(n,r={}){return!this.plugins.length&&!r.parser&&!r.stringifier&&!r.syntax?new e(this,n,r):new t(this,n,r)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return li=i,i.default=i,r.registerProcessor(i),n.registerProcessor(i),li}var fi,pi;function mi(){if(pi)return fi;pi=1;let e=ar(),t=dr(),n=br(),r=Vr(),i=mr(),a=Wr(),o=Xr();function s(c,l){if(Array.isArray(c))return c.map(e=>s(e));let{inputs:u,...d}=c;if(u){l=[];for(let e of u){let n={...e,__proto__:i.prototype};n.map&&={...n.map,__proto__:t.prototype},l.push(n)}}if(d.nodes&&=c.nodes.map(e=>s(e,l)),d.source){let{inputId:e,...t}=d.source;d.source=t,e!=null&&(d.source.input=l[e])}if(d.type===`root`)return new a(d);if(d.type===`decl`)return new e(d);if(d.type===`rule`)return new o(d);if(d.type===`comment`)return new n(d);if(d.type===`atrule`)return new r(d);throw Error(`Unknown node type: `+c.type)}return fi=s,s.default=s,fi}var hi,gi;function _i(){if(gi)return hi;gi=1;let e=Wn(),t=ar(),n=ai(),r=Cr(),i=di(),a=$n(),o=mi(),s=Er(),c=Mr(),l=br(),u=Vr(),d=Fr(),f=mr(),p=ni(),m=qr(),h=Xr(),g=Wr(),_=nr();function v(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new i(e)}return v.plugin=function(e,t){let n=!1;function r(...r){console&&console.warn&&!n&&(n=!0,console.warn(e+`: postcss.plugin was deprecated. Migration guide:
55
+ You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),e}return a.root}return ni=r,r.default=r,e.registerParse(r),ni}var ai,oi;function si(){if(oi)return ai;oi=1;let{isClean:e,my:t}=Yn(),n=yr(),r=tr(),i=Tr(),a=Or(),o=jr(),s=Lr(),c=ii(),l=Kr(),u={atrule:`AtRule`,comment:`Comment`,decl:`Declaration`,document:`Document`,root:`Root`,rule:`Rule`},d={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},f={Once:!0,postcssPlugin:!0,prepare:!0};function p(e){return typeof e==`object`&&typeof e.then==`function`}function m(e){let t=!1,n=u[e.type];return e.type===`decl`?t=e.prop.toLowerCase():e.type===`atrule`&&(t=e.name.toLowerCase()),t&&e.append?[n,n+`-`+t,0,n+`Exit`,n+`Exit-`+t]:t?[n,n+`-`+t,n+`Exit`,n+`Exit-`+t]:e.append?[n,0,n+`Exit`]:[n,n+`Exit`]}function h(e){let t;return t=e.type===`document`?[`Document`,0,`DocumentExit`]:e.type===`root`?[`Root`,0,`RootExit`]:m(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function g(t){return t[e]=!1,t.nodes&&t.nodes.forEach(e=>g(e)),t}let _={};class v{constructor(e,n,r){this.stringified=!1,this.processed=!1;let a;if(typeof n==`object`&&n&&(n.type===`root`||n.type===`document`))a=g(n);else if(n instanceof v||n instanceof s)a=g(n.root),n.map&&(r.map===void 0&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{let e=c;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{a=e(n,r)}catch(e){this.processed=!0,this.error=e}a&&!a[t]&&i.rebuild(a)}this.result=new s(e,a,r),this.helpers={..._,postcss:_,result:this.result},this.plugins=this.processor.plugins.map(e=>typeof e==`object`&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||=this.runAsync(),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw Error(`Use process(css).then(cb) to work with async plugins`)}handleError(e,t){let n=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,e.name===`CssSyntaxError`&&!e.plugin)e.plugin=n.postcssPlugin,e.setMessage();else if(n.postcssVersion&&process.env.NODE_ENV!==`production`){let e=n.postcssPlugin,t=n.postcssVersion,r=this.result.processor.version,i=t.split(`.`),a=r.split(`.`);(i[0]!==a[0]||parseInt(i[1])>parseInt(a[1]))&&console.error(`Unknown error from PostCSS plugin. Your current PostCSS version is `+r+`, but `+e+` uses `+t+`. Perhaps this is the source of the error below.`)}}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,n)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,n])};for(let t of this.plugins)if(typeof t==`object`)for(let n in t){if(!d[n]&&/^[A-Z]/.test(n))throw Error(`Unknown event ${n} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!f[n]){if(typeof t[n]==`object`)for(let r in t[n])r===`*`?e(t,n,t[n][r]):e(t,n+`-`+r.toLowerCase(),t[n][r]);else typeof t[n]==`function`&&e(t,n,t[n])}}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],n=this.runOnRoot(t);if(p(n))try{await n}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];){t[e]=!0;let n=[h(t)];for(;n.length>0;){let e=this.visitTick(n);if(p(e))try{await e}catch(e){let t=n[n.length-1].node;throw this.handleError(e,t)}}}if(this.listeners.OnceExit)for(let[e,n]of this.listeners.OnceExit){this.result.lastPlugin=e;try{if(t.type===`document`){let e=t.nodes.map(e=>n(e,this.helpers));await Promise.all(e)}else await n(t,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if(typeof e==`object`&&e.Once){if(this.result.root.type===`document`){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return p(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if(typeof e==`function`)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=r;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let i=new n(t,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins)if(p(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let t=this.result.root;for(;!t[e];)t[e]=!0,this.walkSync(t);if(this.listeners.OnceExit){if(t.type===`document`)for(let e of t.nodes)this.visitSync(this.listeners.OnceExit,e);else this.visitSync(this.listeners.OnceExit,t)}}return this.result}then(e,t){return process.env.NODE_ENV!==`production`&&(`from`in this.opts||o("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[n,r]of e){this.result.lastPlugin=n;let e;try{e=r(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if(t.type!==`root`&&t.type!==`document`&&!t.parent)return!0;if(p(e))throw this.getAsyncError()}}visitTick(t){let n=t[t.length-1],{node:r,visitors:i}=n;if(r.type!==`root`&&r.type!==`document`&&!r.parent){t.pop();return}if(i.length>0&&n.visitorIndex<i.length){let[e,t]=i[n.visitorIndex];n.visitorIndex+=1,n.visitorIndex===i.length&&(n.visitors=[],n.visitorIndex=0),this.result.lastPlugin=e;try{return t(r.toProxy(),this.helpers)}catch(e){throw this.handleError(e,r)}}if(n.iterator!==0){let i=n.iterator,a;for(;a=r.nodes[r.indexes[i]];)if(r.indexes[i]+=1,!a[e]){a[e]=!0,t.push(h(a));return}n.iterator=0,delete r.indexes[i]}let a=n.events;for(;n.eventIndex<a.length;){let t=a[n.eventIndex];if(n.eventIndex+=1,t===0){r.nodes&&r.nodes.length&&(r[e]=!0,n.iterator=r.getIterator());return}if(this.listeners[t]){n.visitors=this.listeners[t];return}}t.pop()}walkSync(t){t[e]=!0;let n=m(t);for(let r of n)if(r===0)t.nodes&&t.each(t=>{t[e]||this.walkSync(t)});else{let e=this.listeners[r];if(e&&this.visitSync(e,t.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 v.registerPostcss=e=>{_=e},ai=v,v.default=v,l.registerLazyResult(v),a.registerLazyResult(v),ai}var ci,li;function ui(){if(li)return ci;li=1;let e=yr(),t=tr(),n=jr(),r=ii(),i=Lr();class a{constructor(n,r,a){r=r.toString(),this.stringified=!1,this._processor=n,this._css=r,this._opts=a,this._map=void 0;let o,s=t;this.result=new i(this._processor,o,this._opts),this.result.css=r;let c=this;Object.defineProperty(this.result,"root",{get(){return c.root}});let l=new e(s,o,this._opts,r);if(l.isMap()){let[e,t]=l.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else l.clearAnnotation(),this.result.css=l.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return process.env.NODE_ENV!==`production`&&(`from`in this._opts||n("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=r;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return`NoWorkResult`}}return ci=a,a.default=a,ci}var di,fi;function pi(){if(fi)return di;fi=1;let e=ui(),t=si(),n=Or(),r=Kr();class i{constructor(e=[]){this.version=`8.4.38`,this.plugins=this.normalize(e)}normalize(e){let t=[];for(let n of e)if(n.postcss===!0?n=n():n.postcss&&(n=n.postcss),typeof n==`object`&&Array.isArray(n.plugins))t=t.concat(n.plugins);else if(typeof n==`object`&&n.postcssPlugin)t.push(n);else if(typeof n==`function`)t.push(n);else if(typeof n==`object`&&(n.parse||n.stringify)){if(process.env.NODE_ENV!==`production`)throw Error(`PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.`)}else throw Error(n+` is not a PostCSS plugin`);return t}process(n,r={}){return!this.plugins.length&&!r.parser&&!r.stringifier&&!r.syntax?new e(this,n,r):new t(this,n,r)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}}return di=i,i.default=i,r.registerProcessor(i),n.registerProcessor(i),di}var mi,hi;function gi(){if(hi)return mi;hi=1;let e=sr(),t=pr(),n=Sr(),r=Ur(),i=gr(),a=Kr(),o=Qr();function s(c,l){if(Array.isArray(c))return c.map(e=>s(e));let{inputs:u,...d}=c;if(u){l=[];for(let e of u){let n={...e,__proto__:i.prototype};n.map&&={...n.map,__proto__:t.prototype},l.push(n)}}if(d.nodes&&=c.nodes.map(e=>s(e,l)),d.source){let{inputId:e,...t}=d.source;d.source=t,e!=null&&(d.source.input=l[e])}if(d.type===`root`)return new a(d);if(d.type===`decl`)return new e(d);if(d.type===`rule`)return new o(d);if(d.type===`comment`)return new n(d);if(d.type===`atrule`)return new r(d);throw Error(`Unknown node type: `+c.type)}return mi=s,s.default=s,mi}var _i,vi;function yi(){if(vi)return _i;vi=1;let e=Kn(),t=sr(),n=si(),r=Tr(),i=pi(),a=tr(),o=gi(),s=Or(),c=Pr(),l=Sr(),u=Ur(),d=Lr(),f=gr(),p=ii(),m=Yr(),h=Qr(),g=Kr(),_=ir();function v(...e){return e.length===1&&Array.isArray(e[0])&&(e=e[0]),new i(e)}return v.plugin=function(e,t){let n=!1;function r(...r){console&&console.warn&&!n&&(n=!0,console.warn(e+`: postcss.plugin was deprecated. Migration guide:
56
56
  https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith(`cn`)&&console.warn(e+`: 里面 postcss.plugin 被弃用. 迁移指南:
57
- https://www.w3ctech.com/topic/2226`));let a=t(...r);return a.postcssPlugin=e,a.postcssVersion=new i().version,a}let a;return Object.defineProperty(r,"postcss",{get(){return a||=r(),a}}),r.process=function(e,t,n){return v([r(n)]).process(e,t)},r},v.stringify=a,v.parse=p,v.fromJSON=o,v.list=m,v.comment=e=>new l(e),v.atRule=e=>new u(e),v.decl=e=>new t(e),v.rule=e=>new h(e),v.root=e=>new g(e),v.document=e=>new s(e),v.CssSyntaxError=e,v.Declaration=t,v.Container=r,v.Processor=i,v.Document=s,v.Comment=l,v.Warning=c,v.AtRule=u,v.Result=d,v.Input=f,v.Rule=h,v.Root=g,v.Node=_,n.registerPostcss(v),hi=v,v.default=v,hi}var V=Ln(_i());V.stringify,V.fromJSON,V.plugin,V.parse,V.list,V.document,V.comment,V.atRule,V.rule,V.decl,V.root,V.CssSyntaxError,V.Declaration,V.Container,V.Processor,V.Document,V.Comment,V.Warning,V.AtRule,V.Result,V.Input,V.Rule,V.Root,V.Node;var vi=class e{constructor(...e){z(this,`parentElement`,null),z(this,`parentNode`,null),z(this,`ownerDocument`),z(this,`firstChild`,null),z(this,`lastChild`,null),z(this,`previousSibling`,null),z(this,`nextSibling`,null),z(this,`ELEMENT_NODE`,1),z(this,`TEXT_NODE`,3),z(this,`nodeType`),z(this,`nodeName`),z(this,`RRNodeType`)}get childNodes(){let e=[],t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(t){if(!(t instanceof e)||t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(e){throw Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.`)}insertBefore(e,t){throw Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.`)}removeChild(e){throw Error(`RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.`)}toString(){return`RRNode`}},yi={Node:[`childNodes`,`parentNode`,`parentElement`,`textContent`,`ownerDocument`],ShadowRoot:[`host`,`styleSheets`],Element:[`shadowRoot`,`querySelector`,`querySelectorAll`],MutationObserver:[]},bi={Node:[`contains`,`getRootNode`],ShadowRoot:[`getSelection`],Element:[],MutationObserver:[`constructor`]},xi={},Si={},Ci=()=>!!globalThis.Zone;function wi(e){if(xi[e])return xi[e];let t=globalThis[e],n=t.prototype,r=e in yi?yi[e]:void 0,i=!!(r&&r.every(e=>!!(Object.getOwnPropertyDescriptor(n,e)?.get)?.toString().includes(`[native code]`))),a=e in bi?bi[e]:void 0,o=!!(a&&a.every(e=>typeof n[e]==`function`&&n[e]?.toString().includes(`[native code]`)));if(i&&o&&!Ci())return xi[e]=t.prototype,t.prototype;try{let r=document.createElement(`iframe`);r.style.display=`none`,document.body.appendChild(r);let i=r.contentWindow;if(!i)return t.prototype;let a=i[e].prototype;if(!a)return r.remove(),n;let o=navigator.userAgent;return o.includes(`Safari`)&&!o.includes(`Chrome`)?(r.classList.add(`rr-block`),r.setAttribute(`__rrwebUntaintedMutationObserver`,``),Si[e]=()=>r.remove()):r.remove(),xi[e]=a}catch{return n}}var Ti={};function H(e,t,n){let r=`${e}.${String(n)}`;if(Ti[r])return Ti[r].call(t);let i=wi(e),a=Object.getOwnPropertyDescriptor(i,n)?.get;return a?(Ti[r]=a,a.call(t)):t[n]}var Ei={};function Di(e,t,n){let r=`${e}.${String(n)}`;if(Ei[r])return Ei[r].bind(t);let i=wi(e)[n];return typeof i==`function`?(Ei[r]=i,i.bind(t)):t[n]}function Oi(e){return H(`Node`,e,`ownerDocument`)}function ki(e){return H(`Node`,e,`childNodes`)}function Ai(e){return H(`Node`,e,`parentNode`)}function ji(e){return H(`Node`,e,`parentElement`)}function Mi(e){return H(`Node`,e,`textContent`)}function Ni(e,t){return Di(`Node`,e,`contains`)(t)}function Pi(e){return Di(`Node`,e,`getRootNode`)()}function Fi(e){return!e||!(`host`in e)?null:H(`ShadowRoot`,e,`host`)}function Ii(e){return e.styleSheets}function Li(e){return!e||!(`shadowRoot`in e)?null:H(`Element`,e,`shadowRoot`)}function Ri(e,t){return H(`Element`,e,`querySelector`)(t)}function zi(e,t){return H(`Element`,e,`querySelectorAll`)(t)}function Bi(){return[wi(`MutationObserver`).constructor,Si.MutationObserver??(()=>{})]}var Vi=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Vi=()=>new Date().getTime());function Hi(e,t,n){try{if(!(t in e))return()=>{};let r=e[t],i=n(r);return typeof i==`function`&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch{return()=>{}}}var U={ownerDocument:Oi,childNodes:ki,parentNode:Ai,parentElement:ji,textContent:Mi,contains:Ni,getRootNode:Pi,host:Fi,styleSheets:Ii,shadowRoot:Li,querySelector:Ri,querySelectorAll:zi,nowTimestamp:Vi,mutationObserverCtor:Bi,patch:Hi};function W(e,t,n=document){let r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}var Ui=`Please stop import mirror directly. Instead of that,\r
57
+ https://www.w3ctech.com/topic/2226`));let a=t(...r);return a.postcssPlugin=e,a.postcssVersion=new i().version,a}let a;return Object.defineProperty(r,"postcss",{get(){return a||=r(),a}}),r.process=function(e,t,n){return v([r(n)]).process(e,t)},r},v.stringify=a,v.parse=p,v.fromJSON=o,v.list=m,v.comment=e=>new l(e),v.atRule=e=>new u(e),v.decl=e=>new t(e),v.rule=e=>new h(e),v.root=e=>new g(e),v.document=e=>new s(e),v.CssSyntaxError=e,v.Declaration=t,v.Container=r,v.Processor=i,v.Document=s,v.Comment=l,v.Warning=c,v.AtRule=u,v.Result=d,v.Input=f,v.Rule=h,v.Root=g,v.Node=_,n.registerPostcss(v),_i=v,v.default=v,_i}var U=zn(yi());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 bi=class e{constructor(...e){V(this,`parentElement`,null),V(this,`parentNode`,null),V(this,`ownerDocument`),V(this,`firstChild`,null),V(this,`lastChild`,null),V(this,`previousSibling`,null),V(this,`nextSibling`,null),V(this,`ELEMENT_NODE`,1),V(this,`TEXT_NODE`,3),V(this,`nodeType`),V(this,`nodeName`),V(this,`RRNodeType`)}get childNodes(){let e=[],t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(t){if(!(t instanceof e)||t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(e){throw Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.`)}insertBefore(e,t){throw Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.`)}removeChild(e){throw Error(`RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.`)}toString(){return`RRNode`}},xi={Node:[`childNodes`,`parentNode`,`parentElement`,`textContent`,`ownerDocument`,`firstChild`,`lastChild`,`nextSibling`,`previousSibling`],ShadowRoot:[`host`,`styleSheets`],Element:[`shadowRoot`,`querySelector`,`querySelectorAll`],MutationObserver:[]},Si={Node:[`contains`,`getRootNode`],ShadowRoot:[`getSelection`],Element:[],MutationObserver:[`constructor`]},Ci={},wi={},Ti=()=>!!globalThis.Zone;function Ei(e){if(Ci[e])return Ci[e];let t=globalThis[e],n=t.prototype,r=e in xi?xi[e]:void 0,i=!!(r&&r.every(e=>!!(Object.getOwnPropertyDescriptor(n,e)?.get)?.toString().includes(`[native code]`))),a=e in Si?Si[e]:void 0,o=!!(a&&a.every(e=>typeof n[e]==`function`&&n[e]?.toString().includes(`[native code]`)));if(i&&o&&!Ti())return Ci[e]=t.prototype,t.prototype;try{let r=document.createElement(`iframe`);r.style.display=`none`,document.body.appendChild(r);let i=r.contentWindow;if(!i)return t.prototype;let a=i[e].prototype;if(!a)return r.remove(),n;let o=navigator.userAgent;return o.includes(`Safari`)&&!o.includes(`Chrome`)?(r.classList.add(`rr-block`),r.setAttribute(`__rrwebUntaintedMutationObserver`,``),wi[e]=()=>r.remove()):r.remove(),Ci[e]=a}catch{return n}}var Di={};function W(e,t,n){let r=Di[e]?.[n];if(r)return r.call(t);let i=Ei(e),a=Object.getOwnPropertyDescriptor(i,n)?.get;return a?((Di[e]||(Di[e]={}))[n]=a,a.call(t)):t[n]}var Oi={};function ki(e,t,n){let r=`${e}.${String(n)}`;if(Oi[r])return Oi[r].bind(t);let i=Ei(e)[n];return typeof i==`function`?(Oi[r]=i,i.bind(t)):t[n]}function Ai(e){return W(`Node`,e,`ownerDocument`)}function ji(e){return W(`Node`,e,`childNodes`)}function Mi(e){return W(`Node`,e,`parentNode`)}function Ni(e){return W(`Node`,e,`parentElement`)}function Pi(e){return W(`Node`,e,`textContent`)}function Fi(e){return W(`Node`,e,`firstChild`)}function Ii(e){return W(`Node`,e,`lastChild`)}function Li(e){return W(`Node`,e,`nextSibling`)}function Ri(e){return W(`Node`,e,`previousSibling`)}function zi(e,t){return ki(`Node`,e,`contains`)(t)}function Bi(e){return ki(`Node`,e,`getRootNode`)()}function Vi(e){return!e||!(`host`in e)?null:W(`ShadowRoot`,e,`host`)}function Hi(e){return e.styleSheets}function Ui(e){return!e||!(`shadowRoot`in e)?null:W(`Element`,e,`shadowRoot`)}function Wi(e,t){return W(`Element`,e,`querySelector`)(t)}function Gi(e,t){return W(`Element`,e,`querySelectorAll`)(t)}function Ki(){return[Ei(`MutationObserver`).constructor,wi.MutationObserver??(()=>{})]}var qi=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(qi=()=>new Date().getTime());function Ji(e,t,n){try{if(!(t in e))return()=>{};let r=e[t],i=n(r);return typeof i==`function`&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch{return()=>{}}}var G={ownerDocument:Ai,childNodes:ji,parentNode:Mi,parentElement:Ni,textContent:Pi,firstChild:Fi,lastChild:Ii,nextSibling:Li,previousSibling:Ri,contains:zi,getRootNode:Bi,host:Vi,styleSheets:Hi,shadowRoot:Ui,querySelector:Wi,querySelectorAll:Gi,nowTimestamp:qi,mutationObserverCtor:Ki,patch:Ji};function K(e,t,n=document){let r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}var Yi=`Please stop import mirror directly. Instead of that,\r
58
58
  now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
59
- or you can use record.mirror to access the mirror instance during recording.`,Wi={map:{},getId(){return console.error(Ui),-1},getNode(){return console.error(Ui),null},removeNodeFromMap(){console.error(Ui)},has(){return console.error(Ui),!1},reset(){console.error(Ui)}};typeof window<`u`&&window.Proxy&&window.Reflect&&(Wi=new Proxy(Wi,{get(e,t,n){return t===`map`&&console.error(Ui),Reflect.get(e,t,n)}}));function Gi(e,t,n={}){let r=null,i=0;return function(...a){let o=Date.now();!i&&n.leading===!1&&(i=o);let s=t-(o-i),c=this;s<=0||s>t?(r&&=(clearTimeout(r),null),i=o,e.apply(c,a)):!r&&n.trailing!==!1&&(r=setTimeout(()=>{i=n.leading===!1?0:Date.now(),r=null,e.apply(c,a)},s))}}function Ki(e,t,n,r,i=window){let a=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set(e){setTimeout(()=>{n.set.call(this,e)},0),a&&a.set&&a.set.call(this,e)}}),()=>Ki(e,t,a||{},!0)}function qi(e){let t=e.document;return{left:t.scrollingElement?t.scrollingElement.scrollLeft:e.pageXOffset===void 0?t.documentElement.scrollLeft||t?.body&&U.parentElement(t.body)?.scrollLeft||t?.body?.scrollLeft||0:e.pageXOffset,top:t.scrollingElement?t.scrollingElement.scrollTop:e.pageYOffset===void 0?t?.documentElement.scrollTop||t?.body&&U.parentElement(t.body)?.scrollTop||t?.body?.scrollTop||0:e.pageYOffset}}function Ji(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Yi(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Xi(e){return e?e.nodeType===e.ELEMENT_NODE?e:U.parentElement(e):null}function G(e,t,n,r){if(!e)return!1;let i=Xi(e);if(!i)return!1;try{if(typeof t==`string`){if(i.classList.contains(t)||r&&i.closest(`.`+t)!==null)return!0}else if(Ve(i,t,r))return!0}catch{}return!!(n&&(i.matches(n)||r&&i.closest(n)!==null))}function Zi(e,t){return t.getId(e)!==-1}function Qi(e,t,n){return e.tagName===`TITLE`&&n.headTitleMutations?!0:t.getId(e)===Ee}function $i(e,t){if(j(e))return!1;let n=t.getId(e);if(!t.has(n))return!0;let r=U.parentNode(e);return r&&r.nodeType===e.DOCUMENT_NODE?!1:!r||$i(r,t)}function ea(e){return!!e.changedTouches}function ta(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 na(e,t){return!!(e.nodeName===`IFRAME`&&t.getMeta(e))}function ra(e,t){return!!(e.nodeName===`LINK`&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute(`rel`)===`stylesheet`&&t.getMeta(e))}function ia(e){return e?e instanceof vi&&`shadowRoot`in e?!!e.shadowRoot:!!U.shadowRoot(e):!1}var aa=class{constructor(){n(this,`id`,1),n(this,`styleIDMap`,new WeakMap),n(this,`idStyleMap`,new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=t===void 0?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function oa(e){let t=null;return`getRootNode`in e&&U.getRootNode(e)?.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&U.host(U.getRootNode(e))&&(t=U.host(U.getRootNode(e))),t}function sa(e){let t=e,n;for(;n=oa(t);)t=n;return t}function ca(e){let t=U.ownerDocument(e);if(!t)return!1;let n=sa(e);return U.contains(t,n)}function la(e){let t=U.ownerDocument(e);return t?U.contains(t,e)||ca(e):!1}var K=(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))(K||{}),q=(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))(q||{}),J=(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))(J||{}),Y=(e=>(e[e.Mouse=0]=`Mouse`,e[e.Pen=1]=`Pen`,e[e.Touch=2]=`Touch`,e))(Y||{}),ua=(e=>(e[e[`2D`]=0]=`2D`,e[e.WebGL=1]=`WebGL`,e[e.WebGL2=2]=`WebGL2`,e))(ua||{}),da=(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))(da||{}),fa=(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))(fa||{});function pa(e){return`__ln`in e}var ma=class{constructor(){n(this,`length`,0),n(this,`head`,null),n(this,`tail`,null)}get(e){if(e>=this.length)throw Error(`Position outside of list range`);let t=this.head;for(let n=0;n<e;n++)t=t?.next||null;return t}addNode(e){let t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&pa(e.previousSibling)){let n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&pa(e.nextSibling)&&e.nextSibling.__ln.previous){let n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;t.next===null&&(this.tail=t),this.length++}removeNode(e){let t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}},ha=(e,t)=>`${e}@${t}`,ga=class{constructor(){n(this,`frozen`,!1),n(this,`locked`,!1),n(this,`texts`,[]),n(this,`attributes`,[]),n(this,`attributeMap`,new WeakMap),n(this,`removes`,[]),n(this,`mapRemoves`,[]),n(this,`movedMap`,{}),n(this,`addedSet`,new Set),n(this,`movedSet`,new Set),n(this,`droppedSet`,new Set),n(this,`removesSubTreeCache`,new Set),n(this,`mutationCb`),n(this,`blockClass`),n(this,`blockSelector`),n(this,`maskTextClass`),n(this,`maskTextSelector`),n(this,`inlineStylesheet`),n(this,`maskInputOptions`),n(this,`maskTextFn`),n(this,`maskInputFn`),n(this,`keepIframeSrcFn`),n(this,`recordCanvas`),n(this,`inlineImages`),n(this,`slimDOMOptions`),n(this,`dataURLOptions`),n(this,`doc`),n(this,`mirror`),n(this,`iframeManager`),n(this,`stylesheetManager`),n(this,`shadowDomManager`),n(this,`canvasManager`),n(this,`processedNodeManager`),n(this,`unattachedDoc`),n(this,`processMutations`,e=>{e.forEach(this.processMutation),this.emit()}),n(this,`emit`,()=>{if(this.frozen||this.locked)return;let e=[],t=new Set,n=new ma,r=e=>{let t=e,n=Ee;for(;n===Ee;)t&&=t.nextSibling,n=t&&this.mirror.getId(t);return n},i=i=>{let a=U.parentNode(i);if(!a||!la(i))return;let o=!1;if(i.nodeType===Node.TEXT_NODE){let e=a.tagName;if(e===`TEXTAREA`)return;e===`STYLE`&&this.addedSet.has(a)&&(o=!0)}let s=j(a)?this.mirror.getId(oa(i)):this.mirror.getId(a),c=r(i);if(s===-1||c===-1)return n.addNode(i);let l=Ze(i,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{na(e,this.mirror)&&this.iframeManager.addIframe(e),ra(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),ia(i)&&this.shadowDomManager.addShadowRoot(U.shadowRoot(i),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)},cssCaptured:o});l&&(e.push({parentId:s,nextId:c,node:l}),t.add(l.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let e of this.movedSet)ya(this.removesSubTreeCache,e,this.mirror)&&!this.movedSet.has(U.parentNode(e))||i(e);for(let e of this.addedSet)!xa(this.droppedSet,e)&&!ya(this.removesSubTreeCache,e,this.mirror)||xa(this.movedSet,e)?i(e):this.droppedSet.add(e);let a=null;for(;n.length;){let e=null;if(a){let t=this.mirror.getId(U.parentNode(a.value)),n=r(a.value);t!==-1&&n!==-1&&(e=a)}if(!e){let t=n.tail;for(;t;){let n=t;if(t=t.previous,n){let t=this.mirror.getId(U.parentNode(n.value));if(r(n.value)===-1)continue;if(t!==-1){e=n;break}else{let t=n.value,r=U.parentNode(t);if(r&&r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let t=U.host(r);if(this.mirror.getId(t)!==-1){e=n;break}}}}}}if(!e){for(;n.head;)n.removeNode(n.head.value);break}a=e.previous,n.removeNode(e.value),i(e.value)}let o={texts:this.texts.map(e=>{let t=e.node,n=U.parentNode(t);return n&&n.tagName===`TEXTAREA`&&this.genTextAreaValueMutation(n),{id:this.mirror.getId(t),value:e.value}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),attributes:this.attributes.map(e=>{let{attributes:t}=e;if(typeof t.style==`string`){let n=JSON.stringify(e.styleDiff),r=JSON.stringify(e._unchangedStyles);n.length<t.style.length&&(n+r).split(`var(`).length===t.style.split(`var(`).length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),removes:this.removes,adds:e};!o.texts.length&&!o.attributes.length&&!o.removes.length&&!o.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(o))}),n(this,`genTextAreaValueMutation`,e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t));let n=Array.from(U.childNodes(e),e=>U.textContent(e)||``).join(``);t.attributes.value=F({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:pe(e),value:n,maskInputFn:this.maskInputFn})}),n(this,`processMutation`,e=>{if(!Qi(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case`characterData`:{let t=U.textContent(e.target);!G(e.target,this.blockClass,this.blockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:He(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,Xi(e.target)):t.replace(/[\S]/g,`*`):t,node:e.target});break}case`attributes`:{let t=e.target,n=e.attributeName,r=e.target.getAttribute(n);if(n===`value`){let e=pe(t);r=F({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:r,maskInputFn:this.maskInputFn})}if(G(e.target,this.blockClass,this.blockSelector,!1)||r===e.oldValue)return;let i=this.attributeMap.get(e.target);if(t.tagName===`IFRAME`&&n===`src`&&!this.keepIframeSrcFn(r))if(!t.contentDocument)n=`rr_src`;else return;if(i||(i={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(e.target,i)),n===`type`&&t.tagName===`INPUT`&&(e.oldValue||``).toLowerCase()===`password`&&t.setAttribute(`data-rr-is-password`,`true`),!ze(t.tagName,n))if(i.attributes[n]=Re(this.doc,ue(t.tagName),ue(n),r),n===`style`){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}let n=this.unattachedDoc.createElement(`span`);e.oldValue&&n.setAttribute(`style`,e.oldValue);for(let e of Array.from(t.style)){let r=t.style.getPropertyValue(e),a=t.style.getPropertyPriority(e);r!==n.style.getPropertyValue(e)||a!==n.style.getPropertyPriority(e)?a===``?i.styleDiff[e]=r:i.styleDiff[e]=[r,a]:i._unchangedStyles[e]=[r,a]}for(let e of Array.from(n.style))t.style.getPropertyValue(e)===``&&(i.styleDiff[e]=!1)}else n===`open`&&t.tagName===`DIALOG`&&(t.matches(`dialog:modal`)?i.attributes.rr_open_mode=`modal`:i.attributes.rr_open_mode=`non-modal`);break}case`childList`:if(G(e.target,this.blockClass,this.blockSelector,!0))return;if(e.target.tagName===`TEXTAREA`){this.genTextAreaValueMutation(e.target);return}e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{let n=this.mirror.getId(t),r=j(e.target)?this.mirror.getId(U.host(e.target)):this.mirror.getId(e.target);G(e.target,this.blockClass,this.blockSelector,!1)||Qi(t,this.mirror,this.slimDOMOptions)||!Zi(t,this.mirror)||(this.addedSet.has(t)?(_a(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&n===-1||$i(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[ha(n,r)]?_a(this.movedSet,t):(this.removes.push({parentId:r,id:n,isShadow:j(e.target)&&M(e.target)?!0:void 0}),va(t,this.removesSubTreeCache))),this.mapRemoves.push(t))});break}}),n(this,`genAdds`,(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(Qi(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&n!==-1&&(this.movedMap[ha(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);G(e,this.blockClass,this.blockSelector,!1)||(U.childNodes(e).forEach(e=>this.genAdds(e)),ia(e)&&U.childNodes(U.shadowRoot(e)).forEach(t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)}))}})}init(e){[`mutationCb`,`blockClass`,`blockSelector`,`maskTextClass`,`maskTextSelector`,`inlineStylesheet`,`maskInputOptions`,`maskTextFn`,`maskInputFn`,`keepIframeSrcFn`,`recordCanvas`,`inlineImages`,`slimDOMOptions`,`dataURLOptions`,`doc`,`mirror`,`iframeManager`,`stylesheetManager`,`shadowDomManager`,`canvasManager`,`processedNodeManager`].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}};function _a(e,t){e.delete(t),U.childNodes(t).forEach(t=>_a(e,t))}function va(e,t){let n=[e];for(;n.length;){let e=n.pop();t.has(e)||(t.add(e),U.childNodes(e).forEach(e=>n.push(e)))}}function ya(e,t,n){return e.size!==0&&ba(e,t)}function ba(e,t,n){let r=U.parentNode(t);return r?e.has(r):!1}function xa(e,t){return e.size!==0&&Sa(e,t)}function Sa(e,t){let n=U.parentNode(t);return n?e.has(n)?!0:Sa(e,n):!1}var Ca;function wa(e){Ca=e}function Ta(){Ca=void 0}var X=e=>Ca?(...t)=>{try{return e(...t)}catch(e){if(Ca&&Ca(e)===!0)return;throw e}}:e,Ea=[];function Da(e){try{if(`composedPath`in e){let t=e.composedPath();if(t.length)return t[0]}else if(`path`in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function Oa(e,t){let n=new ga;Ea.push(n),n.init(e);let[r,i]=Bi(),a=new r(X(n.processMutations.bind(n)));return a.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),[a,i]}function ka({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(t.mousemove===!1)return()=>{};let i=typeof t.mousemove==`number`?t.mousemove:50,a=typeof t.mousemoveCallback==`number`?t.mousemoveCallback:500,o=[],s,c=Gi(X(t=>{let n=Date.now()-s;e(o.map(e=>(e.timeOffset-=n,e)),t),o=[],s=null}),a),l=X(Gi(X(e=>{let t=Da(e),{clientX:n,clientY:i}=ea(e)?e.changedTouches[0]:e;s||=Vi(),o.push({x:n,y:i,id:r.getId(t),timeOffset:Vi()-s}),c(typeof DragEvent<`u`&&e instanceof DragEvent?q.Drag:e instanceof MouseEvent?q.MouseMove:q.TouchMove)}),i,{trailing:!1})),u=[W(`mousemove`,l,n),W(`touchmove`,l,n),W(`drag`,l,n)];return X(()=>{u.forEach(e=>e())})}function Aa({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,sampling:a}){if(a.mouseInteraction===!1)return()=>{};let o=a.mouseInteraction===!0||a.mouseInteraction===void 0?{}:a.mouseInteraction,s=[],c=null,l=t=>a=>{let o=Da(a);if(G(o,r,i,!0))return;let s=null,l=t;if(`pointerType`in a){switch(a.pointerType){case`mouse`:s=Y.Mouse;break;case`touch`:s=Y.Touch;break;case`pen`:s=Y.Pen;break}s===Y.Touch?J[t]===J.MouseDown?l=`TouchStart`:J[t]===J.MouseUp&&(l=`TouchEnd`):Y.Pen}else ea(a)&&(s=Y.Touch);s===null?J[t]===J.Click&&(s=c,c=null):(c=s,(l.startsWith(`Touch`)&&s===Y.Touch||l.startsWith(`Mouse`)&&s===Y.Mouse)&&(s=null));let u=ea(a)?a.changedTouches[0]:a;if(!u)return;let d=n.getId(o),{clientX:f,clientY:p}=u;X(e)({type:J[l],id:d,x:f,y:p,...s!==null&&{pointerType:s}})};return Object.keys(J).filter(e=>Number.isNaN(Number(e))&&!e.endsWith(`_Departed`)&&o[e]!==!1).forEach(e=>{let n=ue(e),r=l(e);if(window.PointerEvent)switch(J[e]){case J.MouseDown:case J.MouseUp:n=n.replace(`mouse`,`pointer`);break;case J.TouchStart:case J.TouchEnd:return}s.push(W(n,r,t))}),X(()=>{s.forEach(e=>e())})}function ja({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,sampling:a}){return W(`scroll`,X(Gi(X(a=>{let o=Da(a);if(!o||G(o,r,i,!0))return;let s=n.getId(o);if(o===t&&t.defaultView){let n=qi(t.defaultView);e({id:s,x:n.left,y:n.top})}else e({id:s,x:o.scrollLeft,y:o.scrollTop})}),a.scroll||100)),t)}function Ma({viewportResizeCb:e},{win:t}){let n=-1,r=-1;return W(`resize`,X(Gi(X(()=>{let t=Ji(),i=Yi();(n!==t||r!==i)&&(e({width:Number(i),height:Number(t)}),n=t,r=i)}),200)),t)}var Na=[`INPUT`,`TEXTAREA`,`SELECT`],Pa=new WeakMap;function Fa({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,ignoreClass:a,ignoreSelector:o,maskInputOptions:s,maskInputFn:c,sampling:l,userTriggeredOnInput:u}){function d(e){let n=Da(e),l=e.isTrusted,d=n&&n.tagName;if(n&&d===`OPTION`&&(n=U.parentElement(n)),!n||!d||Na.indexOf(d)<0||G(n,r,i,!0)||n.classList.contains(a)||o&&n.matches(o))return;let p=n.value,m=!1,h=pe(n)||``;h===`radio`||h===`checkbox`?m=n.checked:(s[d.toLowerCase()]||s[h])&&(p=F({element:n,maskInputOptions:s,tagName:d,type:h,value:p,maskInputFn:c})),f(n,u?{text:p,isChecked:m,userTriggered:l}:{text:p,isChecked:m});let g=n.name;h===`radio`&&g&&m&&t.querySelectorAll(`input[type="radio"][name="${g}"]`).forEach(e=>{if(e!==n){let t=e.value;f(e,u?{text:t,isChecked:!m,userTriggered:!1}:{text:t,isChecked:!m})}})}function f(t,r){let i=Pa.get(t);if(!i||i.text!==r.text||i.isChecked!==r.isChecked){Pa.set(t,r);let i=n.getId(t);X(e)({...r,id:i})}}let p=(l.input===`last`?[`change`]:[`input`,`change`]).map(e=>W(e,X(d),t)),m=t.defaultView;if(!m)return()=>{p.forEach(e=>e())};let h=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,`value`),g=[[m.HTMLInputElement.prototype,`value`],[m.HTMLInputElement.prototype,`checked`],[m.HTMLSelectElement.prototype,`value`],[m.HTMLTextAreaElement.prototype,`value`],[m.HTMLSelectElement.prototype,`selectedIndex`],[m.HTMLOptionElement.prototype,`selected`]];return h&&h.set&&p.push(...g.map(e=>Ki(e[0],e[1],{set(){X(d)({target:this,isTrusted:!1})}},!1,m))),X(()=>{p.forEach(e=>e())})}function Ia(e){let t=[];function n(e,t){if(Ka(`CSSGroupingRule`)&&e.parentRule instanceof CSSGroupingRule||Ka(`CSSMediaRule`)&&e.parentRule instanceof CSSMediaRule||Ka(`CSSSupportsRule`)&&e.parentRule instanceof CSSSupportsRule||Ka(`CSSConditionRule`)&&e.parentRule instanceof CSSConditionRule){let r=Array.from(e.parentRule.cssRules).indexOf(e);return t.unshift(r),n(e.parentRule,t)}else if(e.parentStyleSheet){let n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}return n(e,t)}function Z(e,t,n){let r,i;return e?(e.ownerNode?r=t.getId(e.ownerNode):i=n.getId(e),{styleId:i,id:r}):{}}function La({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};let i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:X((r,i,a)=>{let[o,s]=a,{id:c,styleId:l}=Z(i,t,n.styleMirror);return(c&&c!==-1||l&&l!==-1)&&e({id:c,styleId:l,adds:[{rule:o,index:s}]}),r.apply(i,a)})}),r.CSSStyleSheet.prototype.addRule=function(e,t,n=this.cssRules.length){let i=`${e} { ${t} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[i,n])};let a=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(a,{apply:X((r,i,a)=>{let[o]=a,{id:s,styleId:c}=Z(i,t,n.styleMirror);return(s&&s!==-1||c&&c!==-1)&&e({id:s,styleId:c,removes:[{index:o}]}),r.apply(i,a)})}),r.CSSStyleSheet.prototype.removeRule=function(e){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[e])};let o;r.CSSStyleSheet.prototype.replace&&(o=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:X((r,i,a)=>{let[o]=a,{id:s,styleId:c}=Z(i,t,n.styleMirror);return(s&&s!==-1||c&&c!==-1)&&e({id:s,styleId:c,replace:o}),r.apply(i,a)})}));let s;r.CSSStyleSheet.prototype.replaceSync&&(s=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(s,{apply:X((r,i,a)=>{let[o]=a,{id:s,styleId:c}=Z(i,t,n.styleMirror);return(s&&s!==-1||c&&c!==-1)&&e({id:s,styleId:c,replaceSync:o}),r.apply(i,a)})}));let c={};qa(`CSSGroupingRule`)?c.CSSGroupingRule=r.CSSGroupingRule:(qa(`CSSMediaRule`)&&(c.CSSMediaRule=r.CSSMediaRule),qa(`CSSConditionRule`)&&(c.CSSConditionRule=r.CSSConditionRule),qa(`CSSSupportsRule`)&&(c.CSSSupportsRule=r.CSSSupportsRule));let l={};return Object.entries(c).forEach(([r,i])=>{l[r]={insertRule:i.prototype.insertRule,deleteRule:i.prototype.deleteRule},i.prototype.insertRule=new Proxy(l[r].insertRule,{apply:X((r,i,a)=>{let[o,s]=a,{id:c,styleId:l}=Z(i.parentStyleSheet,t,n.styleMirror);return(c&&c!==-1||l&&l!==-1)&&e({id:c,styleId:l,adds:[{rule:o,index:[...Ia(i),s||0]}]}),r.apply(i,a)})}),i.prototype.deleteRule=new Proxy(l[r].deleteRule,{apply:X((r,i,a)=>{let[o]=a,{id:s,styleId:c}=Z(i.parentStyleSheet,t,n.styleMirror);return(s&&s!==-1||c&&c!==-1)&&e({id:s,styleId:c,removes:[{index:[...Ia(i),o]}]}),r.apply(i,a)})})}),X(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=a,o&&(r.CSSStyleSheet.prototype.replace=o),s&&(r.CSSStyleSheet.prototype.replaceSync=s),Object.entries(c).forEach(([e,t])=>{t.prototype.insertRule=l[e].insertRule,t.prototype.deleteRule=l[e].deleteRule})})}function Ra({mirror:e,stylesheetManager:t},n){let r=null;r=n.nodeName===`#document`?e.getId(n):e.getId(U.host(n));let i=n.nodeName===`#document`?n.defaultView?.Document:n.ownerDocument?.defaultView?.ShadowRoot,a=i?.prototype?Object.getOwnPropertyDescriptor(i?.prototype,`adoptedStyleSheets`):void 0;return r===null||r===-1||!i||!a?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get(){return a.get?.call(this)},set(e){let n=a.set?.call(this,e);if(r!==null&&r!==-1)try{t.adoptStyleSheets(e,r)}catch{}return n}}),X(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})}))}function za({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:i}){let a=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:X((i,o,s)=>{let[c,l,u]=s;if(n.has(c))return a.apply(o,[c,l,u]);let{id:d,styleId:f}=Z(o.parentRule?.parentStyleSheet,t,r.styleMirror);return(d&&d!==-1||f&&f!==-1)&&e({id:d,styleId:f,set:{property:c,value:l,priority:u},index:Ia(o.parentRule)}),i.apply(o,s)})});let o=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:X((i,a,s)=>{let[c]=s;if(n.has(c))return o.apply(a,[c]);let{id:l,styleId:u}=Z(a.parentRule?.parentStyleSheet,t,r.styleMirror);return(l&&l!==-1||u&&u!==-1)&&e({id:l,styleId:u,remove:{property:c},index:Ia(a.parentRule)}),i.apply(a,s)})}),X(()=>{i.CSSStyleDeclaration.prototype.setProperty=a,i.CSSStyleDeclaration.prototype.removeProperty=o})}function Ba({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:r,sampling:i,doc:a}){let o=X(a=>Gi(X(i=>{let o=Da(i);if(!o||G(o,t,n,!0))return;let{currentTime:s,volume:c,muted:l,playbackRate:u,loop:d}=o;e({type:a,id:r.getId(o),currentTime:s,volume:c,muted:l,playbackRate:u,loop:d})}),i.media||500)),s=[W(`play`,o(da.Play),a),W(`pause`,o(da.Pause),a),W(`seeked`,o(da.Seeked),a),W(`volumechange`,o(da.VolumeChange),a),W(`ratechange`,o(da.RateChange),a)];return X(()=>{s.forEach(e=>e())})}function Va({fontCb:e,doc:t}){let n=t.defaultView;if(!n)return()=>{};let r=[],i=new WeakMap,a=n.FontFace;n.FontFace=function(e,t,n){let r=new a(e,t,n);return i.set(r,{family:e,buffer:typeof t!=`string`,descriptors:n,fontSource:typeof t==`string`?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};let o=Hi(t.fonts,`add`,function(t){return function(n){return setTimeout(X(()=>{let t=i.get(n);t&&(e(t),i.delete(n))}),0),t.apply(this,[n])}});return r.push(()=>{n.FontFace=a}),r.push(o),X(()=>{r.forEach(e=>e())})}function Ha(e){let{doc:t,mirror:n,blockClass:r,blockSelector:i,selectionCb:a}=e,o=!0,s=X(()=>{let e=t.getSelection();if(!e||o&&e?.isCollapsed)return;o=e.isCollapsed||!1;let s=[],c=e.rangeCount||0;for(let t=0;t<c;t++){let{startContainer:a,startOffset:o,endContainer:c,endOffset:l}=e.getRangeAt(t);G(a,r,i,!0)||G(c,r,i,!0)||s.push({start:n.getId(a),startOffset:o,end:n.getId(c),endOffset:l})}a({ranges:s})});return s(),W(`selectionchange`,s)}function Ua({doc:e,customElementCb:t}){let n=e.defaultView;return!n||!n.customElements?()=>{}:Hi(n.customElements,`define`,function(e){return function(n,r,i){try{t({define:{name:n}})}catch{console.warn(`Custom element callback failed for ${n}`)}return e.apply(this,[n,r,i])}})}function Wa(e,t){let{mutationCb:n,mousemoveCb:r,mouseInteractionCb:i,scrollCb:a,viewportResizeCb:o,inputCb:s,mediaInteractionCb:c,styleSheetRuleCb:l,styleDeclarationCb:u,canvasMutationCb:d,fontCb:f,selectionCb:p,customElementCb:m}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),n(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),r(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),i(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),a(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),o(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),s(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),c(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),l(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),u(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),d(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),f(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),p(...e)},e.customElementCb=(...e)=>{t.customElement&&t.customElement(...e),m(...e)}}function Ga(e,t={}){let n=e.doc.defaultView;if(!n)return()=>{};Wa(e,t);let r,i=()=>{};e.recordDOM&&([r,i]=Oa(e,e.doc));let a=ka(e),o=Aa(e),s=ja(e),c=Ma(e,{win:n}),l=Fa(e),u=Ba(e),d=()=>{},f=()=>{},p=()=>{},m=()=>{};e.recordDOM&&(d=La(e,{win:n}),f=Ra(e,e.doc),p=za(e,{win:n}),e.collectFonts&&(m=Va(e)));let h=Ha(e),g=Ua(e),_=[];for(let t of e.plugins)_.push(t.observer(t.callback,n,t.options));return X(()=>{Ea.forEach(e=>e.reset()),r?.disconnect(),i(),a(),o(),s(),c(),l(),u(),d(),f(),p(),m(),h(),g(),_.forEach(e=>e())})}function Ka(e){return window[e]!==void 0}function qa(e){return!!(window[e]!==void 0&&window[e].prototype&&`insertRule`in window[e].prototype&&`deleteRule`in window[e].prototype)}for(var Ja=class{constructor(e){n(this,`iframeIdToRemoteIdMap`,new WeakMap),n(this,`iframeRemoteIdToIdMap`,new WeakMap),this.generateIdFn=e}getId(e,t,n,r){let i=n||this.getIdToRemoteIdMap(e),a=r||this.getRemoteIdToIdMap(e),o=i.get(t);return o||(o=this.generateIdFn(),i.set(t,o),a.set(o,t)),o}getIds(e,t){let n=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,n,r))}getRemoteId(e,t,n){let r=n||this.getRemoteIdToIdMap(e);return typeof t==`number`?r.get(t)||-1:t}getRemoteIds(e,t){let n=this.getRemoteIdToIdMap(e);return t.map(t=>this.getRemoteId(e,t,n))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}},Ya=class{constructor(e){n(this,`iframes`,new WeakMap),n(this,`crossOriginIframeMap`,new WeakMap),n(this,`crossOriginIframeMirror`,new Ja(De)),n(this,`crossOriginIframeStyleMirror`),n(this,`crossOriginIframeRootIdMap`,new WeakMap),n(this,`mirror`),n(this,`mutationCb`),n(this,`wrappedEmit`),n(this,`loadListener`),n(this,`stylesheetManager`),n(this,`recordCrossOriginIframes`),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Ja(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener(`message`,this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var n,r;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((n=e.contentWindow)==null||n.addEventListener(`message`,this.handleMessage.bind(this))),(r=this.loadListener)==null||r.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){let t=e;if(t.data.type!==`rrweb`||t.origin!==t.data.origin||!e.source)return;let n=this.crossOriginIframeMap.get(e.source);if(!n)return;let r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}transformCrossOriginEvent(e,t){var n;switch(t.type){case K.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);let n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:K.IncrementalSnapshot,data:{source:q.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case K.Meta:case K.Load:case K.DomContentLoaded:return!1;case K.Plugin:return t;case K.Custom:return this.replaceIds(t.data.payload,e,[`id`,`parentId`,`previousId`,`nextId`]),t;case K.IncrementalSnapshot:switch(t.data.source){case q.Mutation:return t.data.adds.forEach(t=>{this.replaceIds(t,e,[`parentId`,`nextId`,`previousId`]),this.replaceIdOnNode(t.node,e);let n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(t.node,n)}),t.data.removes.forEach(t=>{this.replaceIds(t,e,[`parentId`,`id`])}),t.data.attributes.forEach(t=>{this.replaceIds(t,e,[`id`])}),t.data.texts.forEach(t=>{this.replaceIds(t,e,[`id`])}),t;case q.Drag:case q.TouchMove:case q.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,[`id`])}),t;case q.ViewportResize:return!1;case q.MediaInteraction:case q.MouseInteraction:case q.Scroll:case q.CanvasMutation:case q.Input:return this.replaceIds(t.data,e,[`id`]),t;case q.StyleSheetRule:case q.StyleDeclaration:return this.replaceIds(t.data,e,[`id`]),this.replaceStyleIds(t.data,e,[`styleId`]),t;case q.Font:return t;case q.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,[`start`,`end`])}),t;case q.AdoptedStyleSheet:return this.replaceIds(t.data,e,[`id`]),this.replaceStyleIds(t.data,e,[`styleIds`]),(n=t.data.styles)==null||n.forEach(t=>{this.replaceStyleIds(t,e,[`styleId`])}),t}}return!1}replace(e,t,n,r){for(let i of r)!Array.isArray(t[i])&&typeof t[i]!=`number`||(Array.isArray(t[i])?t[i]=e.getIds(n,t[i]):t[i]=e.getId(n,t[i]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}replaceIdOnNode(e,t){this.replaceIds(e,t,[`id`,`rootId`]),`childNodes`in e&&e.childNodes.forEach(e=>{this.replaceIdOnNode(e,t)})}patchRootIdOnNode(e,t){e.type!==fa.Document&&!e.rootId&&(e.rootId=t),`childNodes`in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}},Xa=class{constructor(e){n(this,`shadowDoms`,new WeakSet),n(this,`mutationCb`),n(this,`scrollCb`),n(this,`bypassOptions`),n(this,`mirror`),n(this,`restoreHandlers`,[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!M(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);let[n]=Oa({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(ja({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(U.host(e))),this.restoreHandlers.push(Ra({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){!e.contentWindow||!e.contentDocument||this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){let n=this;this.restoreHandlers.push(Hi(e.prototype,`attachShadow`,function(e){return function(r){let i=e.call(this,r),a=U.shadowRoot(this);return a&&la(this)&&n.addShadowRoot(a,t),i}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}},Za=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,Qa=typeof Uint8Array>`u`?[]:new Uint8Array(256),$a=0;$a<Za.length;$a++)Qa[Za.charCodeAt($a)]=$a;var eo=function(e){var t=new Uint8Array(e),n,r=t.length,i=``;for(n=0;n<r;n+=3)i+=Za[t[n]>>2],i+=Za[(t[n]&3)<<4|t[n+1]>>4],i+=Za[(t[n+1]&15)<<2|t[n+2]>>6],i+=Za[t[n+2]&63];return r%3==2?i=i.substring(0,i.length-1)+`=`:r%3==1&&(i=i.substring(0,i.length-2)+`==`),i},to=new Map;function no(e,t){let n=to.get(e);return n||(n=new Map,to.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}var ro=(e,t,n)=>{if(!e||!(oo(e,t)||typeof e==`object`))return;let r=e.constructor.name,i=no(n,r),a=i.indexOf(e);return a===-1&&(a=i.length,i.push(e)),a};function io(e,t,n){if(e instanceof Array)return e.map(e=>io(e,t,n));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer)return{rr_type:e.constructor.name,base64:eo(e)};if(e instanceof DataView)return{rr_type:e.constructor.name,args:[io(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){let t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}else if(e instanceof HTMLCanvasElement)return{rr_type:`HTMLImageElement`,src:e.toDataURL()};else if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[io(e.data,t,n),e.width,e.height]};else if(oo(e,t)||typeof e==`object`)return{rr_type:e.constructor.name,index:ro(e,t,n)};return e}var ao=(e,t,n)=>e.map(e=>io(e,t,n)),oo=(e,t)=>!![`WebGLActiveInfo`,`WebGLBuffer`,`WebGLFramebuffer`,`WebGLProgram`,`WebGLRenderbuffer`,`WebGLShader`,`WebGLShaderPrecisionFormat`,`WebGLTexture`,`WebGLUniformLocation`,`WebGLVertexArrayObject`,`WebGLVertexArrayObjectOES`].filter(e=>typeof t[e]==`function`).find(n=>e instanceof t[n]);function so(e,t,n,r){let i=[],a=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let o of a)try{if(typeof t.CanvasRenderingContext2D.prototype[o]!=`function`)continue;let a=Hi(t.CanvasRenderingContext2D.prototype,o,function(i){return function(...a){return G(this.canvas,n,r,!0)||setTimeout(()=>{let n=ao(a,t,this);e(this.canvas,{type:ua[`2D`],property:o,args:n})},0),i.apply(this,a)}});i.push(a)}catch{let n=Ki(t.CanvasRenderingContext2D.prototype,o,{set(t){e(this.canvas,{type:ua[`2D`],property:o,args:[t],setter:!0})}});i.push(n)}return()=>{i.forEach(e=>e())}}function co(e){return e===`experimental-webgl`?`webgl`:e}function lo(e,t,n,r){let i=[];try{let a=Hi(e.HTMLCanvasElement.prototype,`getContext`,function(e){return function(i,...a){if(!G(this,t,n,!0)){let e=co(i);if(`__context`in this||(this.__context=e),r&&[`webgl`,`webgl2`].includes(e))if(a[0]&&typeof a[0]==`object`){let e=a[0];e.preserveDrawingBuffer||=!0}else a.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[i,...a])}});i.push(a)}catch{console.error(`failed to patch HTMLCanvasElement.prototype.getContext`)}return()=>{i.forEach(e=>e())}}function uo(e,t,n,r,i,a){let o=[],s=Object.getOwnPropertyNames(e);for(let c of s)if(![`isContextLost`,`canvas`,`drawingBufferWidth`,`drawingBufferHeight`].includes(c))try{if(typeof e[c]!=`function`)continue;let s=Hi(e,c,function(e){return function(...o){let s=e.apply(this,o);if(ro(s,a,this),`tagName`in this.canvas&&!G(this.canvas,r,i,!0)){let e=ao(o,a,this),r={type:t,property:c,args:e};n(this.canvas,r)}return s}});o.push(s)}catch{let r=Ki(e,c,{set(e){n(this.canvas,{type:t,property:c,args:[e],setter:!0})}});o.push(r)}return o}function fo(e,t,n,r){let i=[];return t.WebGLRenderingContext!==void 0&&i.push(...uo(t.WebGLRenderingContext.prototype,ua.WebGL,e,n,r,t)),t.WebGL2RenderingContext!==void 0&&i.push(...uo(t.WebGL2RenderingContext.prototype,ua.WebGL2,e,n,r,t)),()=>{i.forEach(e=>e())}}var po=`(function() {
59
+ or you can use record.mirror to access the mirror instance during recording.`,Xi={map:{},getId(){return console.error(Yi),-1},getNode(){return console.error(Yi),null},removeNodeFromMap(){console.error(Yi)},has(){return console.error(Yi),!1},reset(){console.error(Yi)}};typeof window<`u`&&window.Proxy&&window.Reflect&&(Xi=new Proxy(Xi,{get(e,t,n){return t===`map`&&console.error(Yi),Reflect.get(e,t,n)}}));function Zi(e,t,n={}){let r=null,i=0;return function(...a){let o=Date.now();!i&&n.leading===!1&&(i=o);let s=t-(o-i),c=this;s<=0||s>t?(r&&=(clearTimeout(r),null),i=o,e.apply(c,a)):!r&&n.trailing!==!1&&(r=setTimeout(()=>{i=n.leading===!1?0:Date.now(),r=null,e.apply(c,a)},s))}}function Qi(e,t,n,r,i=window){let a=i.Object.getOwnPropertyDescriptor(e,t);return i.Object.defineProperty(e,t,r?n:{set(e){setTimeout(()=>{n.set.call(this,e)},0),a&&a.set&&a.set.call(this,e)}}),()=>Qi(e,t,a||{},!0)}function $i(e){let t=e.document;return{left:t.scrollingElement?t.scrollingElement.scrollLeft:e.pageXOffset===void 0?t.documentElement.scrollLeft||t?.body&&G.parentElement(t.body)?.scrollLeft||t?.body?.scrollLeft||0:e.pageXOffset,top:t.scrollingElement?t.scrollingElement.scrollTop:e.pageYOffset===void 0?t?.documentElement.scrollTop||t?.body&&G.parentElement(t.body)?.scrollTop||t?.body?.scrollTop||0:e.pageYOffset}}function ea(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function ta(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function na(e){return e?e.nodeType===e.ELEMENT_NODE?e:G.parentElement(e):null}function q(e,t,n,r){if(!e)return!1;let i=na(e);if(!i)return!1;try{if(typeof t==`string`){if(i.classList.contains(t)||r&&i.closest(`.`+t)!==null)return!0}else if(Ue(i,t,r))return!0}catch{}return!!(n&&(i.matches(n)||r&&i.closest(n)!==null))}function ra(e,t){return t.getId(e)!==-1}function ia(e,t,n){return e.tagName===`TITLE`&&n.headTitleMutations?!0:t.getId(e)===Oe}function aa(e,t){if(P(e))return!1;let n=t.getId(e);if(!t.has(n))return!0;let r=G.parentNode(e);return r&&r.nodeType===e.DOCUMENT_NODE?!1:!r||aa(r,t)}function oa(e){return!!e.changedTouches}function sa(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 ca(e,t){return!!(e.nodeName===`IFRAME`&&t.getMeta(e))}function la(e,t){return!!(e.nodeName===`LINK`&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute(`rel`)===`stylesheet`&&t.getMeta(e))}function ua(e){return e?e instanceof bi&&`shadowRoot`in e?!!e.shadowRoot:!!G.shadowRoot(e):!1}var da=class{constructor(){n(this,`id`,1),n(this,`styleIDMap`,new WeakMap),n(this,`idStyleMap`,new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=t===void 0?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};function fa(e){let t=null;return`getRootNode`in e&&G.getRootNode(e)?.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&G.host(G.getRootNode(e))&&(t=G.host(G.getRootNode(e))),t}function pa(e){let t=e,n;for(;n=fa(t);)t=n;return t}function ma(e){let t=G.ownerDocument(e);if(!t)return!1;let n=pa(e);return G.contains(t,n)}function ha(e){let t=G.ownerDocument(e);return t?G.contains(t,e)||ma(e):!1}var J=(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))(J||{}),Y=(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))(Y||{}),X=(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))(X||{}),ga=(e=>(e[e.Mouse=0]=`Mouse`,e[e.Pen=1]=`Pen`,e[e.Touch=2]=`Touch`,e))(ga||{}),_a=(e=>(e[e[`2D`]=0]=`2D`,e[e.WebGL=1]=`WebGL`,e[e.WebGL2=2]=`WebGL2`,e))(_a||{}),va=(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))(va||{}),ya=(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))(ya||{}),ba=(e,t)=>`${e}@${t}`,xa=class{constructor(){n(this,`frozen`,!1),n(this,`locked`,!1),n(this,`texts`,[]),n(this,`attributes`,[]),n(this,`attributeMap`,new WeakMap),n(this,`removes`,[]),n(this,`mapRemoves`,[]),n(this,`movedMap`,{}),n(this,`addedSet`,new Set),n(this,`movedSet`,new Set),n(this,`droppedSet`,new Set),n(this,`removesSubTreeCache`,new Set),n(this,`mutationCb`),n(this,`blockClass`),n(this,`blockSelector`),n(this,`maskTextClass`),n(this,`maskTextSelector`),n(this,`inlineStylesheet`),n(this,`maskInputOptions`),n(this,`maskTextFn`),n(this,`maskInputFn`),n(this,`keepIframeSrcFn`),n(this,`recordCanvas`),n(this,`inlineImages`),n(this,`slimDOMOptions`),n(this,`dataURLOptions`),n(this,`doc`),n(this,`mirror`),n(this,`iframeManager`),n(this,`stylesheetManager`),n(this,`shadowDomManager`),n(this,`canvasManager`),n(this,`processedNodeManager`),n(this,`unattachedDoc`),n(this,`processMutations`,e=>{e.forEach(this.processMutation),this.emit()}),n(this,`emit`,()=>{if(this.frozen||this.locked)return;let e=[],t=new Set;for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let e of this.movedSet){let t=G.parentNode(e);(!this.removesSubTreeCache.has(t)||this.movedSet.has(t))&&this.addedSet.add(e)}let n=null,r=null,i=-1,a=null,o=!1,s=new Set,c=this.addedSet.values(),l=c.next();for(;this.addedSet.size;){if(n!==null&&this.addedSet.has(G.previousSibling(n)))a=n,n=G.previousSibling(n);else{for(this.addedSet.has(l.value)||(l=c.next()),n=l.value;;){if(r=G.parentNode(n),this.addedSet.has(r)){n=r;continue}break}if(s.has(r))r=null;else if(r){if(ha(r)?(o=wa(this.droppedSet,r)||this.removesSubTreeCache.has(r),o&&wa(this.movedSet,n)&&(o=!1)):o=!0,this.addedSet.has(G.lastChild(r)))n=G.lastChild(r),a=null;else for(;;){if(a=G.nextSibling(n),this.addedSet.has(a)){n=a;continue}break}if(i=P(r)?this.mirror.getId(fa(n)):this.mirror.getId(r),i===-1&&r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let e=G.host(r);i=this.mirror.getId(e)}}}if(this.addedSet.delete(n),!r||i===-1){s.add(n);continue}if(o){this.droppedSet.add(n);continue}let u=!1;if(n.nodeType===Node.TEXT_NODE){let e=r.tagName;if(e===`TEXTAREA`)continue;e===`STYLE`&&t.has(i)&&(u=!0)}let d=a?this.mirror.getId(a):null;for(;d===Oe;)a&&=G.nextSibling(a),d=a&&this.mirror.getId(a);if(d===-1){console.warn(`Couldn't record new node. Couldn't find mirror id for nextSibling:`,a),n=null;continue}let f=$e(n,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{ca(e,this.mirror)&&this.iframeManager.addIframe(e),la(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),ua(n)&&this.shadowDomManager.addShadowRoot(G.shadowRoot(n),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)},cssCaptured:u});f&&(e.push({parentId:i,nextId:d,node:f}),t.add(f.id))}let u={texts:this.texts.map(e=>{let t=e.node,n=G.parentNode(t);return n&&n.tagName===`TEXTAREA`&&this.genTextAreaValueMutation(n),{id:this.mirror.getId(t),value:e.value}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),attributes:this.attributes.map(e=>{let{attributes:t}=e;if(typeof t.style==`string`){let n=JSON.stringify(e.styleDiff),r=JSON.stringify(e._unchangedStyles);n.length<t.style.length&&(n+r).split(`var(`).length===t.style.split(`var(`).length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),removes:this.removes,adds:e};(u.texts.length||u.attributes.length||u.removes.length||u.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(u))}),n(this,`genTextAreaValueMutation`,e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t));let n=Array.from(G.childNodes(e),e=>G.textContent(e)||``).join(``);t.attributes.value=de({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:he(e),value:n,maskInputFn:this.maskInputFn})}),n(this,`processMutation`,e=>{if(!ia(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case`characterData`:{let t=G.textContent(e.target);!q(e.target,this.blockClass,this.blockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:We(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,na(e.target)):t.replace(/[\S]/g,`*`):t,node:e.target});break}case`attributes`:{let t=e.target,n=fe(t.tagName),r=e.attributeName,i=e.target.getAttribute(r);if(r===`value`){let e=he(t);i=de({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:i,maskInputFn:this.maskInputFn})}if(q(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;let a=this.attributeMap.get(e.target);if(n===`iframe`&&r===`src`&&!this.keepIframeSrcFn(i)){if(!t.contentDocument)r=`rr_src`;else return}if(a||(a={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(a),this.attributeMap.set(e.target,a)),r===`type`&&n===`input`&&(e.oldValue||``).toLowerCase()===`password`&&t.setAttribute(`data-rr-is-password`,`true`),!Ve(n,r)){if(a.attributes[r]=Be(this.doc,n,fe(r),i),r===`style`){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}let n=this.unattachedDoc.createElement(`span`);e.oldValue&&n.setAttribute(`style`,e.oldValue);for(let e of Array.from(t.style)){let r=t.style.getPropertyValue(e),i=t.style.getPropertyPriority(e);r!==n.style.getPropertyValue(e)||i!==n.style.getPropertyPriority(e)?i===``?a.styleDiff[e]=r:a.styleDiff[e]=[r,i]:a._unchangedStyles[e]=[r,i]}for(let e of Array.from(n.style))t.style.getPropertyValue(e)===``&&(a.styleDiff[e]=!1)}else r===`open`&&t.tagName===`DIALOG`&&(t.matches(`dialog:modal`)?a.attributes.rr_open_mode=`modal`:a.attributes.rr_open_mode=`non-modal`)}break}case`childList`:if(q(e.target,this.blockClass,this.blockSelector,!0))return;if(e.target.tagName===`TEXTAREA`){this.genTextAreaValueMutation(e.target);return}e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{let n=this.mirror.getId(t),r=P(e.target)?this.mirror.getId(G.host(e.target)):this.mirror.getId(e.target);q(e.target,this.blockClass,this.blockSelector,!1)||ia(t,this.mirror,this.slimDOMOptions)||!ra(t,this.mirror)||(this.addedSet.has(t)?(Sa(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&n===-1||aa(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[ba(n,r)]?Sa(this.movedSet,t):(this.removes.push({parentId:r,id:n,isShadow:P(e.target)&&F(e.target)?!0:void 0}),Ca(t,this.removesSubTreeCache))),this.mapRemoves.push(t))})}}),n(this,`genAdds`,(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(ia(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&n!==-1&&(this.movedMap[ba(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);q(e,this.blockClass,this.blockSelector,!1)||(G.childNodes(e).forEach(e=>this.genAdds(e)),ua(e)&&G.childNodes(G.shadowRoot(e)).forEach(t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)}))}})}init(e){[`mutationCb`,`blockClass`,`blockSelector`,`maskTextClass`,`maskTextSelector`,`inlineStylesheet`,`maskInputOptions`,`maskTextFn`,`maskInputFn`,`keepIframeSrcFn`,`recordCanvas`,`inlineImages`,`slimDOMOptions`,`dataURLOptions`,`doc`,`mirror`,`iframeManager`,`stylesheetManager`,`shadowDomManager`,`canvasManager`,`processedNodeManager`].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}};function Sa(e,t){e.delete(t),G.childNodes(t).forEach(t=>Sa(e,t))}function Ca(e,t){let n=[e];for(;n.length;){let e=n.pop();t.has(e)||(t.add(e),G.childNodes(e).forEach(e=>n.push(e)))}}function wa(e,t){return e.size!==0&&Ta(e,t)}function Ta(e,t){if(e.has(t))return!0;let n=G.parentNode(t);return n?Ta(e,n):!1}var Ea;function Da(e){Ea=e}function Oa(){Ea=void 0}var Z=e=>Ea?(...t)=>{try{return e(...t)}catch(e){if(Ea&&Ea(e)===!0)return;throw e}}:e,ka=[];function Aa(e){try{if(`composedPath`in e){let t=e.composedPath();if(t.length)return t[0]}else if(`path`in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function ja(e,t){let n=new xa;ka.push(n),n.init(e);let[r,i]=Ki(),a=new r(Z(n.processMutations.bind(n)));return a.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),[a,i]}function Ma({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(t.mousemove===!1)return()=>{};let i=typeof t.mousemove==`number`?t.mousemove:50,a=typeof t.mousemoveCallback==`number`?t.mousemoveCallback:500,o=[],s,c=Zi(Z(t=>{let n=Date.now()-s;e(o.map(e=>(e.timeOffset-=n,e)),t),o=[],s=null}),a),l=Z(Zi(Z(e=>{let t=Aa(e),{clientX:n,clientY:i}=oa(e)?e.changedTouches[0]:e;s||=qi(),o.push({x:n,y:i,id:r.getId(t),timeOffset:qi()-s}),c(typeof DragEvent<`u`&&e instanceof DragEvent?Y.Drag:e instanceof MouseEvent?Y.MouseMove:Y.TouchMove)}),i,{trailing:!1})),u=[K(`mousemove`,l,n),K(`touchmove`,l,n),K(`drag`,l,n)];return Z(()=>{u.forEach(e=>e())})}function Na({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,sampling:a}){if(a.mouseInteraction===!1)return()=>{};let o=a.mouseInteraction===!0||a.mouseInteraction===void 0?{}:a.mouseInteraction,s=[],c=null,l=t=>a=>{let o=Aa(a);if(q(o,r,i,!0))return;let s=null,l=t;if(`pointerType`in a){switch(a.pointerType){case`mouse`:s=ga.Mouse;break;case`touch`:s=ga.Touch;break;case`pen`:s=ga.Pen}s===ga.Touch?X[t]===X.MouseDown?l=`TouchStart`:X[t]===X.MouseUp&&(l=`TouchEnd`):ga.Pen}else oa(a)&&(s=ga.Touch);s===null?X[t]===X.Click&&(s=c,c=null):(c=s,(l.startsWith(`Touch`)&&s===ga.Touch||l.startsWith(`Mouse`)&&s===ga.Mouse)&&(s=null));let u=oa(a)?a.changedTouches[0]:a;if(!u)return;let d=n.getId(o),{clientX:f,clientY:p}=u;Z(e)({type:X[l],id:d,x:f,y:p,...s!==null&&{pointerType:s}})};return Object.keys(X).filter(e=>Number.isNaN(Number(e))&&!e.endsWith(`_Departed`)&&o[e]!==!1).forEach(e=>{let n=fe(e),r=l(e);if(window.PointerEvent)switch(X[e]){case X.MouseDown:case X.MouseUp:n=n.replace(`mouse`,`pointer`);break;case X.TouchStart:case X.TouchEnd:return}s.push(K(n,r,t))}),Z(()=>{s.forEach(e=>e())})}function Pa({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,sampling:a}){return K(`scroll`,Z(Zi(Z(a=>{let o=Aa(a);if(!o||q(o,r,i,!0))return;let s=n.getId(o);if(o===t&&t.defaultView){let n=$i(t.defaultView);e({id:s,x:n.left,y:n.top})}else e({id:s,x:o.scrollLeft,y:o.scrollTop})}),a.scroll||100)),t)}function Fa({viewportResizeCb:e},{win:t}){let n=-1,r=-1;return K(`resize`,Z(Zi(Z(()=>{let t=ea(),i=ta();(n!==t||r!==i)&&(e({width:Number(i),height:Number(t)}),n=t,r=i)}),200)),t)}var Ia=[`INPUT`,`TEXTAREA`,`SELECT`],La=new WeakMap;function Ra({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:i,ignoreClass:a,ignoreSelector:o,maskInputOptions:s,maskInputFn:c,sampling:l,userTriggeredOnInput:u}){function d(e){let n=Aa(e),l=e.isTrusted,d=n&&n.tagName;if(n&&d===`OPTION`&&(n=G.parentElement(n)),!n||!d||Ia.indexOf(d)<0||q(n,r,i,!0)||n.classList.contains(a)||o&&n.matches(o))return;let p=n.value,m=!1,h=he(n)||``;h===`radio`||h===`checkbox`?m=n.checked:(s[d.toLowerCase()]||s[h])&&(p=de({element:n,maskInputOptions:s,tagName:d,type:h,value:p,maskInputFn:c})),f(n,u?{text:p,isChecked:m,userTriggered:l}:{text:p,isChecked:m});let g=n.name;h===`radio`&&g&&m&&t.querySelectorAll(`input[type="radio"][name="${g}"]`).forEach(e=>{if(e!==n){let t=e.value;f(e,u?{text:t,isChecked:!m,userTriggered:!1}:{text:t,isChecked:!m})}})}function f(t,r){let i=La.get(t);if(!i||i.text!==r.text||i.isChecked!==r.isChecked){La.set(t,r);let i=n.getId(t);Z(e)({...r,id:i})}}let p=(l.input===`last`?[`change`]:[`input`,`change`]).map(e=>K(e,Z(d),t)),m=t.defaultView;if(!m)return()=>{p.forEach(e=>e())};let h=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,`value`),g=[[m.HTMLInputElement.prototype,`value`],[m.HTMLInputElement.prototype,`checked`],[m.HTMLSelectElement.prototype,`value`],[m.HTMLTextAreaElement.prototype,`value`],[m.HTMLSelectElement.prototype,`selectedIndex`],[m.HTMLOptionElement.prototype,`selected`]];return h&&h.set&&p.push(...g.map(e=>Qi(e[0],e[1],{set(){Z(d)({target:this,isTrusted:!1})}},!1,m))),Z(()=>{p.forEach(e=>e())})}function za(e){let t=[];function n(e,t){if(Xa(`CSSGroupingRule`)&&e.parentRule instanceof CSSGroupingRule||Xa(`CSSMediaRule`)&&e.parentRule instanceof CSSMediaRule||Xa(`CSSSupportsRule`)&&e.parentRule instanceof CSSSupportsRule||Xa(`CSSConditionRule`)&&e.parentRule instanceof CSSConditionRule){let r=Array.from(e.parentRule.cssRules).indexOf(e);return t.unshift(r),n(e.parentRule,t)}if(e.parentStyleSheet){let n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}return n(e,t)}function Ba(e,t,n){let r,i;return e?(e.ownerNode?r=t.getId(e.ownerNode):i=n.getId(e),{styleId:i,id:r}):{}}function Va({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};let i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:Z((r,i,a)=>{let[o,s]=a,{id:c,styleId:l}=Ba(i,t,n.styleMirror);return(c&&c!==-1||l&&l!==-1)&&e({id:c,styleId:l,adds:[{rule:o,index:s}]}),r.apply(i,a)})}),r.CSSStyleSheet.prototype.addRule=function(e,t,n=this.cssRules.length){let i=`${e} { ${t} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[i,n])};let a=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(a,{apply:Z((r,i,a)=>{let[o]=a,{id:s,styleId:c}=Ba(i,t,n.styleMirror);return(s&&s!==-1||c&&c!==-1)&&e({id:s,styleId:c,removes:[{index:o}]}),r.apply(i,a)})}),r.CSSStyleSheet.prototype.removeRule=function(e){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[e])};let o;r.CSSStyleSheet.prototype.replace&&(o=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:Z((r,i,a)=>{let[o]=a,{id:s,styleId:c}=Ba(i,t,n.styleMirror);return(s&&s!==-1||c&&c!==-1)&&e({id:s,styleId:c,replace:o}),r.apply(i,a)})}));let s;r.CSSStyleSheet.prototype.replaceSync&&(s=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(s,{apply:Z((r,i,a)=>{let[o]=a,{id:s,styleId:c}=Ba(i,t,n.styleMirror);return(s&&s!==-1||c&&c!==-1)&&e({id:s,styleId:c,replaceSync:o}),r.apply(i,a)})}));let c={};Za(`CSSGroupingRule`)?c.CSSGroupingRule=r.CSSGroupingRule:(Za(`CSSMediaRule`)&&(c.CSSMediaRule=r.CSSMediaRule),Za(`CSSConditionRule`)&&(c.CSSConditionRule=r.CSSConditionRule),Za(`CSSSupportsRule`)&&(c.CSSSupportsRule=r.CSSSupportsRule));let l={};return Object.entries(c).forEach(([r,i])=>{l[r]={insertRule:i.prototype.insertRule,deleteRule:i.prototype.deleteRule},i.prototype.insertRule=new Proxy(l[r].insertRule,{apply:Z((r,i,a)=>{let[o,s]=a,{id:c,styleId:l}=Ba(i.parentStyleSheet,t,n.styleMirror);return(c&&c!==-1||l&&l!==-1)&&e({id:c,styleId:l,adds:[{rule:o,index:[...za(i),s||0]}]}),r.apply(i,a)})}),i.prototype.deleteRule=new Proxy(l[r].deleteRule,{apply:Z((r,i,a)=>{let[o]=a,{id:s,styleId:c}=Ba(i.parentStyleSheet,t,n.styleMirror);return(s&&s!==-1||c&&c!==-1)&&e({id:s,styleId:c,removes:[{index:[...za(i),o]}]}),r.apply(i,a)})})}),Z(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=a,o&&(r.CSSStyleSheet.prototype.replace=o),s&&(r.CSSStyleSheet.prototype.replaceSync=s),Object.entries(c).forEach(([e,t])=>{t.prototype.insertRule=l[e].insertRule,t.prototype.deleteRule=l[e].deleteRule})})}function Ha({mirror:e,stylesheetManager:t},n){let r=null;r=n.nodeName===`#document`?e.getId(n):e.getId(G.host(n));let i=n.nodeName===`#document`?n.defaultView?.Document:n.ownerDocument?.defaultView?.ShadowRoot,a=i?.prototype?Object.getOwnPropertyDescriptor(i?.prototype,`adoptedStyleSheets`):void 0;return r===null||r===-1||!i||!a?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get(){return a.get?.call(this)},set(e){let n=a.set?.call(this,e);if(r!==null&&r!==-1)try{t.adoptStyleSheets(e,r)}catch{}return n}}),Z(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})}))}function Ua({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:i}){let a=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(a,{apply:Z((i,o,s)=>{let[c,l,u]=s;if(n.has(c))return a.apply(o,[c,l,u]);let{id:d,styleId:f}=Ba(o.parentRule?.parentStyleSheet,t,r.styleMirror);return(d&&d!==-1||f&&f!==-1)&&e({id:d,styleId:f,set:{property:c,value:l,priority:u},index:za(o.parentRule)}),i.apply(o,s)})});let o=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:Z((i,a,s)=>{let[c]=s;if(n.has(c))return o.apply(a,[c]);let{id:l,styleId:u}=Ba(a.parentRule?.parentStyleSheet,t,r.styleMirror);return(l&&l!==-1||u&&u!==-1)&&e({id:l,styleId:u,remove:{property:c},index:za(a.parentRule)}),i.apply(a,s)})}),Z(()=>{i.CSSStyleDeclaration.prototype.setProperty=a,i.CSSStyleDeclaration.prototype.removeProperty=o})}function Wa({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:r,sampling:i,doc:a}){let o=Z(a=>Zi(Z(i=>{let o=Aa(i);if(!o||q(o,t,n,!0))return;let{currentTime:s,volume:c,muted:l,playbackRate:u,loop:d}=o;e({type:a,id:r.getId(o),currentTime:s,volume:c,muted:l,playbackRate:u,loop:d})}),i.media||500)),s=[K(`play`,o(va.Play),a),K(`pause`,o(va.Pause),a),K(`seeked`,o(va.Seeked),a),K(`volumechange`,o(va.VolumeChange),a),K(`ratechange`,o(va.RateChange),a)];return Z(()=>{s.forEach(e=>e())})}function Ga({fontCb:e,doc:t}){let n=t.defaultView;if(!n)return()=>{};let r=[],i=new WeakMap,a=n.FontFace;n.FontFace=function(e,t,n){let r=new a(e,t,n);return i.set(r,{family:e,buffer:typeof t!=`string`,descriptors:n,fontSource:typeof t==`string`?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};let o=Ji(t.fonts,`add`,function(t){return function(n){return setTimeout(Z(()=>{let t=i.get(n);t&&(e(t),i.delete(n))}),0),t.apply(this,[n])}});return r.push(()=>{n.FontFace=a}),r.push(o),Z(()=>{r.forEach(e=>e())})}function Ka(e){let{doc:t,mirror:n,blockClass:r,blockSelector:i,selectionCb:a}=e,o=!0,s=Z(()=>{let e=t.getSelection();if(!e||o&&e?.isCollapsed)return;o=e.isCollapsed||!1;let s=[],c=e.rangeCount||0;for(let t=0;t<c;t++){let{startContainer:a,startOffset:o,endContainer:c,endOffset:l}=e.getRangeAt(t);q(a,r,i,!0)||q(c,r,i,!0)||s.push({start:n.getId(a),startOffset:o,end:n.getId(c),endOffset:l})}a({ranges:s})});return s(),K(`selectionchange`,s)}function qa({doc:e,customElementCb:t}){let n=e.defaultView;return!n||!n.customElements?()=>{}:Ji(n.customElements,`define`,function(e){return function(n,r,i){try{t({define:{name:n}})}catch{console.warn(`Custom element callback failed for ${n}`)}return e.apply(this,[n,r,i])}})}function Ja(e,t){let{mutationCb:n,mousemoveCb:r,mouseInteractionCb:i,scrollCb:a,viewportResizeCb:o,inputCb:s,mediaInteractionCb:c,styleSheetRuleCb:l,styleDeclarationCb:u,canvasMutationCb:d,fontCb:f,selectionCb:p,customElementCb:m}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),n(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),r(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),i(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),a(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),o(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),s(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),c(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),l(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),u(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),d(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),f(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),p(...e)},e.customElementCb=(...e)=>{t.customElement&&t.customElement(...e),m(...e)}}function Ya(e,t={}){let n=e.doc.defaultView;if(!n)return()=>{};Ja(e,t);let r,i=()=>{};e.recordDOM&&([r,i]=ja(e,e.doc));let a=Ma(e),o=Na(e),s=Pa(e),c=Fa(e,{win:n}),l=Ra(e),u=Wa(e),d=()=>{},f=()=>{},p=()=>{},m=()=>{};e.recordDOM&&(d=Va(e,{win:n}),f=Ha(e,e.doc),p=Ua(e,{win:n}),e.collectFonts&&(m=Ga(e)));let h=Ka(e),g=qa(e),_=[];for(let t of e.plugins)_.push(t.observer(t.callback,n,t.options));return Z(()=>{ka.forEach(e=>e.reset()),r?.disconnect(),i(),a(),o(),s(),c(),l(),u(),d(),f(),p(),m(),h(),g(),_.forEach(e=>e())})}function Xa(e){return window[e]!==void 0}function Za(e){return!!(window[e]!==void 0&&window[e].prototype&&`insertRule`in window[e].prototype&&`deleteRule`in window[e].prototype)}for(var Qa=class{constructor(e){n(this,`iframeIdToRemoteIdMap`,new WeakMap),n(this,`iframeRemoteIdToIdMap`,new WeakMap),this.generateIdFn=e}getId(e,t,n,r){let i=n||this.getIdToRemoteIdMap(e),a=r||this.getRemoteIdToIdMap(e),o=i.get(t);return o||(o=this.generateIdFn(),i.set(t,o),a.set(o,t)),o}getIds(e,t){let n=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,n,r))}getRemoteId(e,t,n){let r=n||this.getRemoteIdToIdMap(e);return typeof t==`number`?r.get(t)||-1:t}getRemoteIds(e,t){let n=this.getRemoteIdToIdMap(e);return t.map(t=>this.getRemoteId(e,t,n))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}},$a=class{constructor(e){n(this,`iframes`,new WeakMap),n(this,`crossOriginIframeMap`,new WeakMap),n(this,`crossOriginIframeMirror`,new Qa(ke)),n(this,`crossOriginIframeStyleMirror`),n(this,`crossOriginIframeRootIdMap`,new WeakMap),n(this,`mirror`),n(this,`mutationCb`),n(this,`wrappedEmit`),n(this,`loadListener`),n(this,`stylesheetManager`),n(this,`recordCrossOriginIframes`),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Qa(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener(`message`,this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var n,r;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((n=e.contentWindow)==null||n.addEventListener(`message`,this.handleMessage.bind(this))),(r=this.loadListener)==null||r.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){let t=e;if(t.data.type!==`rrweb`||t.origin!==t.data.origin||!e.source)return;let n=this.crossOriginIframeMap.get(e.source);if(!n)return;let r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}transformCrossOriginEvent(e,t){var n;switch(t.type){case J.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);let n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:J.IncrementalSnapshot,data:{source:Y.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case J.Meta:case J.Load:case J.DomContentLoaded:return!1;case J.Plugin:return t;case J.Custom:return this.replaceIds(t.data.payload,e,[`id`,`parentId`,`previousId`,`nextId`]),t;case J.IncrementalSnapshot:switch(t.data.source){case Y.Mutation:return t.data.adds.forEach(t=>{this.replaceIds(t,e,[`parentId`,`nextId`,`previousId`]),this.replaceIdOnNode(t.node,e);let n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(t.node,n)}),t.data.removes.forEach(t=>{this.replaceIds(t,e,[`parentId`,`id`])}),t.data.attributes.forEach(t=>{this.replaceIds(t,e,[`id`])}),t.data.texts.forEach(t=>{this.replaceIds(t,e,[`id`])}),t;case Y.Drag:case Y.TouchMove:case Y.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,[`id`])}),t;case Y.ViewportResize:return!1;case Y.MediaInteraction:case Y.MouseInteraction:case Y.Scroll:case Y.CanvasMutation:case Y.Input:return this.replaceIds(t.data,e,[`id`]),t;case Y.StyleSheetRule:case Y.StyleDeclaration:return this.replaceIds(t.data,e,[`id`]),this.replaceStyleIds(t.data,e,[`styleId`]),t;case Y.Font:return t;case Y.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,[`start`,`end`])}),t;case Y.AdoptedStyleSheet:return this.replaceIds(t.data,e,[`id`]),this.replaceStyleIds(t.data,e,[`styleIds`]),(n=t.data.styles)==null||n.forEach(t=>{this.replaceStyleIds(t,e,[`styleId`])}),t}}return!1}replace(e,t,n,r){for(let i of r)(Array.isArray(t[i])||typeof t[i]==`number`)&&(t[i]=Array.isArray(t[i])?e.getIds(n,t[i]):e.getId(n,t[i]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}replaceIdOnNode(e,t){this.replaceIds(e,t,[`id`,`rootId`]),`childNodes`in e&&e.childNodes.forEach(e=>{this.replaceIdOnNode(e,t)})}patchRootIdOnNode(e,t){e.type!==ya.Document&&!e.rootId&&(e.rootId=t),`childNodes`in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}},eo=class{constructor(e){n(this,`shadowDoms`,new WeakSet),n(this,`mutationCb`),n(this,`scrollCb`),n(this,`bypassOptions`),n(this,`mirror`),n(this,`restoreHandlers`,[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!F(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);let[n]=ja({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(Pa({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(G.host(e))),this.restoreHandlers.push(Ha({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){let n=this;this.restoreHandlers.push(Ji(e.prototype,`attachShadow`,function(e){return function(r){let i=e.call(this,r),a=G.shadowRoot(this);return a&&ha(this)&&n.addShadowRoot(a,t),i}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}},to=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,no=typeof Uint8Array>`u`?[]:new Uint8Array(256),ro=0;ro<to.length;ro++)no[to.charCodeAt(ro)]=ro;var io=function(e){var t=new Uint8Array(e),n,r=t.length,i=``;for(n=0;n<r;n+=3)i+=to[t[n]>>2],i+=to[(t[n]&3)<<4|t[n+1]>>4],i+=to[(t[n+1]&15)<<2|t[n+2]>>6],i+=to[t[n+2]&63];return r%3==2?i=i.substring(0,i.length-1)+`=`:r%3==1&&(i=i.substring(0,i.length-2)+`==`),i},ao=new Map;function oo(e,t){let n=ao.get(e);return n||(n=new Map,ao.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}var so=(e,t,n)=>{if(!e||!(uo(e,t)||typeof e==`object`))return;let r=e.constructor.name,i=oo(n,r),a=i.indexOf(e);return a===-1&&(a=i.length,i.push(e)),a};function co(e,t,n){if(e instanceof Array)return e.map(e=>co(e,t,n));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer)return{rr_type:e.constructor.name,base64:io(e)};if(e instanceof DataView)return{rr_type:e.constructor.name,args:[co(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){let t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}return e instanceof HTMLCanvasElement?{rr_type:`HTMLImageElement`,src:e.toDataURL()}:e instanceof ImageData?{rr_type:e.constructor.name,args:[co(e.data,t,n),e.width,e.height]}:uo(e,t)||typeof e==`object`?{rr_type:e.constructor.name,index:so(e,t,n)}:e}var lo=(e,t,n)=>e.map(e=>co(e,t,n)),uo=(e,t)=>!![`WebGLActiveInfo`,`WebGLBuffer`,`WebGLFramebuffer`,`WebGLProgram`,`WebGLRenderbuffer`,`WebGLShader`,`WebGLShaderPrecisionFormat`,`WebGLTexture`,`WebGLUniformLocation`,`WebGLVertexArrayObject`,`WebGLVertexArrayObjectOES`].filter(e=>typeof t[e]==`function`).find(n=>e instanceof t[n]);function fo(e,t,n,r){let i=[],a=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let o of a)try{if(typeof t.CanvasRenderingContext2D.prototype[o]!=`function`)continue;let a=Ji(t.CanvasRenderingContext2D.prototype,o,function(i){return function(...a){return q(this.canvas,n,r,!0)||setTimeout(()=>{let n=lo(a,t,this);e(this.canvas,{type:_a[`2D`],property:o,args:n})},0),i.apply(this,a)}});i.push(a)}catch{let n=Qi(t.CanvasRenderingContext2D.prototype,o,{set(t){e(this.canvas,{type:_a[`2D`],property:o,args:[t],setter:!0})}});i.push(n)}return()=>{i.forEach(e=>e())}}function po(e){return e===`experimental-webgl`?`webgl`:e}function mo(e,t,n,r){let i=[];try{let a=Ji(e.HTMLCanvasElement.prototype,`getContext`,function(e){return function(i,...a){if(!q(this,t,n,!0)){let e=po(i);if(`__context`in this||(this.__context=e),r&&[`webgl`,`webgl2`].includes(e)){if(a[0]&&typeof a[0]==`object`){let e=a[0];e.preserveDrawingBuffer||=!0}else a.splice(0,1,{preserveDrawingBuffer:!0})}}return e.apply(this,[i,...a])}});i.push(a)}catch{console.error(`failed to patch HTMLCanvasElement.prototype.getContext`)}return()=>{i.forEach(e=>e())}}function ho(e,t,n,r,i,a){let o=[],s=Object.getOwnPropertyNames(e);for(let c of s)if(![`isContextLost`,`canvas`,`drawingBufferWidth`,`drawingBufferHeight`].includes(c))try{if(typeof e[c]!=`function`)continue;let s=Ji(e,c,function(e){return function(...o){let s=e.apply(this,o);if(so(s,a,this),`tagName`in this.canvas&&!q(this.canvas,r,i,!0)){let e=lo(o,a,this),r={type:t,property:c,args:e};n(this.canvas,r)}return s}});o.push(s)}catch{let r=Qi(e,c,{set(e){n(this.canvas,{type:t,property:c,args:[e],setter:!0})}});o.push(r)}return o}function go(e,t,n,r){let i=[];return t.WebGLRenderingContext!==void 0&&i.push(...ho(t.WebGLRenderingContext.prototype,_a.WebGL,e,n,r,t)),t.WebGL2RenderingContext!==void 0&&i.push(...ho(t.WebGL2RenderingContext.prototype,_a.WebGL2,e,n,r,t)),()=>{i.forEach(e=>e())}}var _o=`(function() {
60
60
  "use strict";
61
61
  var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
62
62
  var lookup = typeof Uint8Array === "undefined" ? [] : new Uint8Array(256);
@@ -131,4 +131,6 @@ or you can use record.mirror to access the mirror instance during recording.`,Wi
131
131
  };
132
132
  })();
133
133
  //# sourceMappingURL=image-bitmap-data-url-worker-IJpC7g_b.js.map
134
- `,mo=typeof self<`u`&&self.Blob&&new Blob([po],{type:`text/javascript;charset=utf-8`});function ho(e){let t;try{if(t=mo&&(self.URL||self.webkitURL).createObjectURL(mo),!t)throw``;let n=new Worker(t,{name:e?.name});return n.addEventListener(`error`,()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),n}catch{return new Worker(`data:text/javascript;charset=utf-8,`+encodeURIComponent(po),{name:e?.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var go=class{constructor(e){n(this,`pendingCanvasMutations`,new Map),n(this,`rafStamps`,{latestId:0,invokeId:null}),n(this,`mirror`),n(this,`mutationCb`),n(this,`resetObservers`),n(this,`frozen`,!1),n(this,`locked`,!1),n(this,`processMutation`,(e,t)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)});let{sampling:t=`all`,win:r,blockClass:i,blockSelector:a,recordCanvas:o,dataURLOptions:s}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&t===`all`&&this.initCanvasMutationObserver(r,i,a),o&&typeof t==`number`&&this.initCanvasFPSObserver(t,r,i,a,{dataURLOptions:s})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,n,r,i){let a=lo(t,n,r,!0),o=new Map,s=new ho;s.onmessage=e=>{let{id:t}=e.data;if(o.set(t,!1),!(`base64`in e.data))return;let{base64:n,type:r,width:i,height:a}=e.data;this.mutationCb({id:t,type:ua[`2D`],commands:[{property:`clearRect`,args:[0,0,i,a]},{property:`drawImage`,args:[{rr_type:`ImageBitmap`,args:[{rr_type:`Blob`,data:[{rr_type:`ArrayBuffer`,base64:n}],type:r}]},0,0]}]})};let c=1e3/e,l=0,u,d=()=>{let e=[];return t.document.querySelectorAll(`canvas`).forEach(t=>{G(t,n,r,!0)||e.push(t)}),e},f=e=>{if(l&&e-l<c){u=requestAnimationFrame(f);return}l=e,d().forEach(async e=>{let t=this.mirror.getId(e);if(o.get(t)||e.width===0||e.height===0)return;if(o.set(t,!0),[`webgl`,`webgl2`].includes(e.__context)){let t=e.getContext(e.__context);t?.getContextAttributes()?.preserveDrawingBuffer===!1&&t.clear(t.COLOR_BUFFER_BIT)}let n=await createImageBitmap(e);s.postMessage({id:t,bitmap:n,width:e.width,height:e.height,dataURLOptions:i.dataURLOptions},[n])}),u=requestAnimationFrame(f)};u=requestAnimationFrame(f),this.resetObservers=()=>{a(),cancelAnimationFrame(u)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let r=lo(e,t,n,!1),i=so(this.processMutation.bind(this),e,t,n),a=fo(this.processMutation.bind(this),e,t,n);this.resetObservers=()=>{r(),i(),a()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{let n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;let n=this.pendingCanvasMutations.get(e);if(!n||t===-1)return;let r=n.map(e=>{let{type:t,...n}=e;return n}),{type:i}=n[0];this.mutationCb({id:t,type:i,commands:r}),this.pendingCanvasMutations.delete(e)}},_o=class{constructor(e){n(this,`trackedLinkElements`,new WeakSet),n(this,`mutationCb`),n(this,`adoptedStyleSheetCb`),n(this,`styleMirror`,new aa),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){`_cssText`in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(e.length===0)return;let n={id:t,styleIds:[]},r=[];for(let t of e){let e;this.styleMirror.has(t)?e=this.styleMirror.getId(t):(e=this.styleMirror.add(t),r.push({styleId:e,rules:Array.from(t.rules||CSSRule,(e,n)=>({rule:oe(e,t.href),index:n}))})),n.styleIds.push(e)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}},vo=class{constructor(){n(this,`nodeMap`,new WeakMap),n(this,`active`,!1)}inOtherBuffer(e,t){let n=this.nodeMap.get(e);return n&&Array.from(n).some(e=>e!==t)}add(e,t){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}},Q,yo,bo,xo=!1;try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement(`iframe`);document.body.appendChild(e),Array.from=e.contentWindow?.Array.from||Array.from,document.body.removeChild(e)}}catch(e){console.debug(`Unable to override Array.from`,e)}var $=le();function So(e={}){let{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:i=`rr-block`,blockSelector:a=null,ignoreClass:o=`rr-ignore`,ignoreSelector:s=null,maskTextClass:c=`rr-mask`,maskTextSelector:l=null,inlineStylesheet:u=!0,maskAllInputs:d,maskInputOptions:f,slimDOMOptions:p,maskInputFn:m,maskTextFn:h,hooks:g,packFn:_,sampling:v={},dataURLOptions:y={},mousemoveWait:b,recordDOM:x=!0,recordCanvas:S=!1,recordCrossOriginIframes:C=!1,recordAfter:w=e.recordAfter===`DOMContentLoaded`?e.recordAfter:`load`,userTriggeredOnInput:ee=!1,collectFonts:T=!1,inlineImages:E=!1,plugins:D,keepIframeSrcFn:O=()=>!1,ignoreCSSAttributes:k=new Set([]),errorHandler:te}=e;wa(te);let A=!C||window.parent===window,ne=!1;if(!A)try{window.parent.document&&(ne=!1)}catch{ne=!0}if(A&&!t)throw Error(`emit function is required`);if(!A&&!ne)return()=>{};b!==void 0&&v.mousemove===void 0&&(v.mousemove=b),$.reset();let j=d===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:f===void 0?{password:!0}:f,M=Ye(p);ta();let re,ie=0,ae=e=>{for(let t of D||[])t.eventProcessor&&(e=t.eventProcessor(e));return _&&!ne&&(e=_(e)),e};Q=(e,i)=>{let a=e;if(a.timestamp=Vi(),Ea[0]?.isFrozen()&&a.type!==K.FullSnapshot&&!(a.type===K.IncrementalSnapshot&&a.data.source===q.Mutation)&&Ea.forEach(e=>e.unfreeze()),A)t?.(ae(a),i);else if(ne){let e={type:`rrweb`,event:ae(a),origin:window.location.origin,isCheckout:i};window.parent.postMessage(e,`*`)}if(a.type===K.FullSnapshot)re=a,ie=0;else if(a.type===K.IncrementalSnapshot){if(a.data.source===q.Mutation&&a.data.isAttachIframe)return;ie++;let e=r&&ie>=r,t=n&&a.timestamp-re.timestamp>n;(e||t)&&yo(!0)}};let oe=e=>{Q({type:K.IncrementalSnapshot,data:{source:q.Mutation,...e}})},se=e=>Q({type:K.IncrementalSnapshot,data:{source:q.Scroll,...e}}),ce=e=>Q({type:K.IncrementalSnapshot,data:{source:q.CanvasMutation,...e}}),N=new _o({mutationCb:oe,adoptedStyleSheetCb:e=>Q({type:K.IncrementalSnapshot,data:{source:q.AdoptedStyleSheet,...e}})}),P=new Ya({mirror:$,mutationCb:oe,stylesheetManager:N,recordCrossOriginIframes:C,wrappedEmit:Q});for(let e of D||[])e.getMirror&&e.getMirror({nodeMirror:$,crossOriginIframeMirror:P.crossOriginIframeMirror,crossOriginIframeStyleMirror:P.crossOriginIframeStyleMirror});let le=new vo;bo=new go({recordCanvas:S,mutationCb:ce,win:window,blockClass:i,blockSelector:a,mirror:$,sampling:v.canvas,dataURLOptions:y});let F=new Xa({mutationCb:oe,scrollCb:se,bypassOptions:{blockClass:i,blockSelector:a,maskTextClass:c,maskTextSelector:l,inlineStylesheet:u,maskInputOptions:j,dataURLOptions:y,maskTextFn:h,maskInputFn:m,recordCanvas:S,inlineImages:E,sampling:v,slimDOMOptions:M,iframeManager:P,stylesheetManager:N,canvasManager:bo,keepIframeSrcFn:O,processedNodeManager:le},mirror:$});yo=(e=!1)=>{if(!x)return;Q({type:K.Meta,data:{href:window.location.href,width:Yi(),height:Ji()}},e),N.reset(),F.init(),Ea.forEach(e=>e.lock());let t=Qe(document,{mirror:$,blockClass:i,blockSelector:a,maskTextClass:c,maskTextSelector:l,inlineStylesheet:u,maskAllInputs:j,maskTextFn:h,maskInputFn:m,slimDOM:M,dataURLOptions:y,recordCanvas:S,inlineImages:E,onSerialize:e=>{na(e,$)&&P.addIframe(e),ra(e,$)&&N.trackLinkElement(e),ia(e)&&F.addShadowRoot(U.shadowRoot(e),document)},onIframeLoad:(e,t)=>{P.attachIframe(e,t),F.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{N.attachLinkElement(e,t)},keepIframeSrcFn:O});if(!t)return console.warn(`Failed to snapshot the document`);Q({type:K.FullSnapshot,data:{node:t,initialOffset:qi(window)}},e),Ea.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&N.adoptStyleSheets(document.adoptedStyleSheets,$.getId(document))};try{let e=[],t=e=>X(Ga)({mutationCb:oe,mousemoveCb:(e,t)=>Q({type:K.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>Q({type:K.IncrementalSnapshot,data:{source:q.MouseInteraction,...e}}),scrollCb:se,viewportResizeCb:e=>Q({type:K.IncrementalSnapshot,data:{source:q.ViewportResize,...e}}),inputCb:e=>Q({type:K.IncrementalSnapshot,data:{source:q.Input,...e}}),mediaInteractionCb:e=>Q({type:K.IncrementalSnapshot,data:{source:q.MediaInteraction,...e}}),styleSheetRuleCb:e=>Q({type:K.IncrementalSnapshot,data:{source:q.StyleSheetRule,...e}}),styleDeclarationCb:e=>Q({type:K.IncrementalSnapshot,data:{source:q.StyleDeclaration,...e}}),canvasMutationCb:ce,fontCb:e=>Q({type:K.IncrementalSnapshot,data:{source:q.Font,...e}}),selectionCb:e=>{Q({type:K.IncrementalSnapshot,data:{source:q.Selection,...e}})},customElementCb:e=>{Q({type:K.IncrementalSnapshot,data:{source:q.CustomElement,...e}})},blockClass:i,ignoreClass:o,ignoreSelector:s,maskTextClass:c,maskTextSelector:l,maskInputOptions:j,inlineStylesheet:u,sampling:v,recordDOM:x,recordCanvas:S,inlineImages:E,userTriggeredOnInput:ee,collectFonts:T,doc:e,maskInputFn:m,maskTextFn:h,keepIframeSrcFn:O,blockSelector:a,slimDOMOptions:M,dataURLOptions:y,mirror:$,iframeManager:P,stylesheetManager:N,shadowDomManager:F,processedNodeManager:le,canvasManager:bo,ignoreCSSAttributes:k,plugins:(D?.filter(e=>e.observer))?.map(e=>({observer:e.observer,options:e.options,callback:t=>Q({type:K.Plugin,data:{plugin:e.name,payload:t}})}))||[]},g);P.addLoadListener(n=>{try{e.push(t(n.contentDocument))}catch(e){console.warn(e)}});let n=()=>{yo(),e.push(t(document)),xo=!0};return[`interactive`,`complete`].includes(document.readyState)?n():(e.push(W(`DOMContentLoaded`,()=>{Q({type:K.DomContentLoaded,data:{}}),w===`DOMContentLoaded`&&n()})),e.push(W(`load`,()=>{Q({type:K.Load,data:{}}),w===`load`&&n()},window))),()=>{e.forEach(e=>{try{e()}catch(e){String(e).toLowerCase().includes(`cross-origin`)||console.warn(e)}}),le.destroy(),xo=!1,Ta()}}catch(e){console.warn(e)}}So.addCustomEvent=(e,t)=>{if(!xo)throw Error(`please add custom event after start recording`);Q({type:K.Custom,data:{tag:e,payload:t}})},So.freezePage=()=>{Ea.forEach(e=>e.freeze())},So.takeFullSnapshot=e=>{if(!xo)throw Error(`please take full snapshot after start recording`);yo(e)},So.mirror=$;var Co;(function(e){e[e.NotStarted=0]=`NotStarted`,e[e.Running=1]=`Running`,e[e.Stopped=2]=`Stopped`})(Co||={});var{addCustomEvent:wo}=So,{freezePage:To}=So,{takeFullSnapshot:Eo}=So,Do=`pk_acme_8f2a91c4`,Oo=e=>(e=e.toLowerCase(),e.startsWith(`data-`)||e===`title`||e===`alt`||e===`placeholder`||e===`aria-label`);function ko(e){if(!(!e||typeof e!=`object`))for(let t of Object.keys(e))Oo(t)&&typeof e[t]==`string`&&e[t]&&(e[t]=`***`)}function Ao(e){!e||typeof e!=`object`||(e.attributes&&ko(e.attributes),Array.isArray(e.childNodes)&&e.childNodes.forEach(Ao))}function jo(e){try{e.type===2&&e.data?.node?Ao(e.data.node):e.type===3&&e.data&&(Array.isArray(e.data.adds)&&e.data.adds.forEach(e=>Ao(e.node)),Array.isArray(e.data.attributes)&&e.data.attributes.forEach(e=>ko(e.attributes)))}catch{}return e}function Mo(e=`rec_`){return e+(typeof crypto<`u`&&crypto.getRandomValues?Array.from(crypto.getRandomValues(new Uint8Array(8))).map(e=>e.toString(16).padStart(2,`0`)).join(``):Math.abs(Date.now()^performance.now()*1e3|0).toString(16))}function No(){try{let e=localStorage.getItem(`specto-vid`);return e||(e=Mo(`v_`),localStorage.setItem(`specto-vid`,e)),e}catch{return}}function Po(e={}){let t=e.endpoint||`/api/ingest`,n=e.key||Do,r=e.sessionId||Mo(),i=e.onUpdate||(()=>{});if(typeof window<`u`&&window.__spectoRec)return window.__spectoRec;if(navigator.doNotTrack===`1`||navigator.globalPrivacyControl)return{sessionId:r,stop(){},count:()=>0,disabled:!0};let a=[],o=0,s=new Date().toISOString(),c=performance.now(),l=()=>Math.round(performance.now()-c),u=(e,t)=>{a.push({kind:e,payload:t}),o++,i({total:o,kind:e})},d=So({emit:e=>u(`dom`,jo(e)),maskAllInputs:!0,maskInputOptions:{password:!0,email:!0,tel:!0,color:!1},maskTextClass:`specto-mask`,maskTextSelector:e.privacy===`strict`?`*`:void 0,blockClass:`specto-block`,recordCanvas:!1,collectFonts:!1,sampling:{mousemove:50,scroll:150,input:`last`}}),f={};for(let e of[`log`,`info`,`warn`,`error`])f[e]=console[e],console[e]=(...t)=>{try{u(`console`,{t:l(),level:e,text:t.map(Fo).join(` `).slice(0,2e3)})}catch{}f[e].apply(console,t)};let p=window.fetch;window.fetch=async(...e)=>{let t=performance.now(),n=typeof e[0]==`string`?e[0]:e[0]?.url||``,r=(e[1]?.method||typeof e[0]!=`string`&&e[0]?.method||`GET`).toUpperCase();try{let i=await p.apply(window,e),a;try{a=i.headers.get(`x-trace-id`)||void 0}catch{}return u(`network`,{t:l(),method:r,url:String(n).slice(0,300),status:i.status,dur:Math.round(performance.now()-t),...a?{traceId:a}:{}}),i}catch(e){throw u(`network`,{t:l(),method:r,url:String(n).slice(0,300),status:0,dur:Math.round(performance.now()-t),error:!0}),e}};let m=window.XMLHttpRequest,h=m.prototype.open,g=m.prototype.send;m.prototype.open=function(e,t){return this.__specto={method:String(e).toUpperCase(),url:String(t).slice(0,300),started:0},h.apply(this,arguments)},m.prototype.send=function(){return this.__specto&&(this.__specto.started=performance.now(),this.addEventListener(`loadend`,()=>{let e=this.__specto,t;try{t=this.getResponseHeader(`x-trace-id`)||void 0}catch{}u(`network`,{t:l(),method:e.method,url:e.url,status:this.status,dur:Math.round(performance.now()-e.started),...t?{traceId:t}:{}})})),g.apply(this,arguments)};let _=e=>u(`event`,{t:l(),type:`error`,message:String(e.message||e.reason||`error`).slice(0,500)});window.addEventListener(`error`,_),window.addEventListener(`unhandledrejection`,_);let v=()=>u(`event`,{t:l(),type:`nav`,path:(location.pathname+location.hash).slice(0,300)}),y=history.pushState,b=history.replaceState;history.pushState=function(...e){let t=y.apply(this,e);try{v()}catch{}return t},history.replaceState=function(...e){let t=b.apply(this,e);try{v()}catch{}return t},window.addEventListener(`popstate`,v),window.addEventListener(`hashchange`,v);let x=[],S=e=>{let t=performance.now();if(x=x.filter(e=>t-e.t<800),x.push({t,x:e.clientX,y:e.clientY}),x.length>=3){let t=e.target?.tagName?e.target.tagName.toLowerCase()+(e.target.id?`#`+e.target.id:``):`element`;u(`event`,{t:l(),type:`rage`,target:t.slice(0,80),count:x.length}),x=[]}};window.addEventListener(`click`,S,!0);let C={page:location.pathname,userAgent:navigator.userAgent,startedAt:s,visitorId:No()},w=null;try{w=e.createWorker?e.createWorker():null,w&&w.postMessage({t:`init`,cfg:{endpoint:t,key:n,sessionId:r,meta:C}})}catch{w=null}async function ee(e){let i=null;if(typeof CompressionStream<`u`)try{i=await new Response(new Blob([JSON.stringify({sessionId:r,key:n,meta:C,events:e})]).stream().pipeThrough(new CompressionStream(`gzip`))).blob()}catch{i=null}let a=JSON.stringify({sessionId:r,key:n,meta:C,events:e});await p.call(window,t,i?{method:`POST`,headers:{"Content-Type":`application/octet-stream`,"x-specto-gzip":`1`},body:i,keepalive:!0}:{method:`POST`,headers:{"Content-Type":`application/json`},body:a,keepalive:!0})}function T(){if(!a.length)return;let e=a;a=[],w?w.postMessage({t:`upload`,batch:e}):ee(e).catch(()=>{a=e.concat(a)})}let E=setInterval(T,2e3),D=()=>{T(),a.length&&navigator.sendBeacon&&(navigator.sendBeacon(t,new Blob([JSON.stringify({sessionId:r,key:n,meta:C,events:a})],{type:`application/json`})),a=[])};window.addEventListener(`pagehide`,D);let O=!1;function k(){if(!O){O=!0,d&&d();for(let e of[`log`,`info`,`warn`,`error`])console[e]=f[e];window.fetch=p,m.prototype.open=h,m.prototype.send=g,window.removeEventListener(`error`,_),window.removeEventListener(`unhandledrejection`,_),window.removeEventListener(`click`,S,!0),window.removeEventListener(`pagehide`,D),window.removeEventListener(`popstate`,v),window.removeEventListener(`hashchange`,v),history.pushState=y,history.replaceState=b,clearInterval(E),T(),w&&setTimeout(()=>w.terminate(),1500),typeof window<`u`&&window.__spectoRec===te&&delete window.__spectoRec}}let te={sessionId:r,stop:k,flushNow:T,count:()=>o};return typeof window<`u`&&(window.__spectoRec=te),te}function Fo(e){if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}var Io='(function(){let e=null;self.onmessage=t=>{let r=t.data;r.t===`init`?e=r.cfg:r.t===`upload`&&n(r.batch)};async function t(e){if(typeof CompressionStream>`u`)return null;try{return await new Response(new Blob([e]).stream().pipeThrough(new CompressionStream(`gzip`))).blob()}catch{return null}}async function n(n){if(!e||!n||!n.length)return;let r=JSON.stringify({sessionId:e.sessionId,key:e.key,meta:e.meta,events:n}),i=await t(r);try{await fetch(e.endpoint,i?{method:`POST`,headers:{"Content-Type":`application/octet-stream`,"x-specto-gzip":`1`},body:i,keepalive:!0}:{method:`POST`,headers:{"Content-Type":`application/json`},body:r,keepalive:!0})}catch{}}})();',Lo=typeof self<`u`&&self.Blob&&new Blob([`(self.URL || self.webkitURL).revokeObjectURL(self.location.href);`,Io],{type:`text/javascript;charset=utf-8`});function Ro(e){let t;try{if(t=Lo&&(self.URL||self.webkitURL).createObjectURL(Lo),!t)throw``;let n=new Worker(t,{name:e?.name});return n.addEventListener(`error`,()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),n}catch{return new Worker(`data:text/javascript;charset=utf-8,`+encodeURIComponent(Io),{name:e?.name})}}function zo(e={}){if(!e.endpoint)throw Error(`@spectosh/browser: opts.endpoint is required (https://<your-specto-host>/api/ingest)`);if(!e.key)throw Error(`@spectosh/browser: opts.key is required (your publishable pk_… key)`);return Po({createWorker:()=>new Ro,...e})}var Bo={startRecording:zo};exports.default=Bo,exports.startRecording=zo;
134
+ `,vo=typeof self<`u`&&self.Blob&&new Blob([_o],{type:`text/javascript;charset=utf-8`});function yo(e){let t;try{if(t=vo&&(self.URL||self.webkitURL).createObjectURL(vo),!t)throw``;let n=new Worker(t,{name:e?.name});return n.addEventListener(`error`,()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),n}catch{return new Worker(`data:text/javascript;charset=utf-8,`+encodeURIComponent(_o),{name:e?.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}var bo=class{constructor(e){n(this,`pendingCanvasMutations`,new Map),n(this,`rafStamps`,{latestId:0,invokeId:null}),n(this,`mirror`),n(this,`mutationCb`),n(this,`resetObservers`),n(this,`frozen`,!1),n(this,`locked`,!1),n(this,`processMutation`,(e,t)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)});let{sampling:t=`all`,win:r,blockClass:i,blockSelector:a,recordCanvas:o,dataURLOptions:s}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&t===`all`&&this.initCanvasMutationObserver(r,i,a),o&&typeof t==`number`&&this.initCanvasFPSObserver(t,r,i,a,{dataURLOptions:s})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,n,r,i){let a=mo(t,n,r,!0),o=new Map,s=new yo;s.onmessage=e=>{let{id:t}=e.data;if(o.set(t,!1),!(`base64`in e.data))return;let{base64:n,type:r,width:i,height:a}=e.data;this.mutationCb({id:t,type:_a[`2D`],commands:[{property:`clearRect`,args:[0,0,i,a]},{property:`drawImage`,args:[{rr_type:`ImageBitmap`,args:[{rr_type:`Blob`,data:[{rr_type:`ArrayBuffer`,base64:n}],type:r}]},0,0]}]})};let c=1e3/e,l=0,u,d=()=>{let e=[];return t.document.querySelectorAll(`canvas`).forEach(t=>{q(t,n,r,!0)||e.push(t)}),e},f=e=>{if(l&&e-l<c){u=requestAnimationFrame(f);return}l=e,d().forEach(async e=>{let t=this.mirror.getId(e);if(o.get(t)||e.width===0||e.height===0)return;if(o.set(t,!0),[`webgl`,`webgl2`].includes(e.__context)){let t=e.getContext(e.__context);t?.getContextAttributes()?.preserveDrawingBuffer===!1&&t.clear(t.COLOR_BUFFER_BIT)}let n=await createImageBitmap(e);s.postMessage({id:t,bitmap:n,width:e.width,height:e.height,dataURLOptions:i.dataURLOptions},[n])}),u=requestAnimationFrame(f)};u=requestAnimationFrame(f),this.resetObservers=()=>{a(),cancelAnimationFrame(u)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let r=mo(e,t,n,!1),i=fo(this.processMutation.bind(this),e,t,n),a=go(this.processMutation.bind(this),e,t,n);this.resetObservers=()=>{r(),i(),a()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{let n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;let n=this.pendingCanvasMutations.get(e);if(!n||t===-1)return;let r=n.map(e=>{let{type:t,...n}=e;return n}),{type:i}=n[0];this.mutationCb({id:t,type:i,commands:r}),this.pendingCanvasMutations.delete(e)}},xo=class{constructor(e){n(this,`trackedLinkElements`,new WeakSet),n(this,`mutationCb`),n(this,`adoptedStyleSheetCb`),n(this,`styleMirror`,new da),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){`_cssText`in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(e.length===0)return;let n={id:t,styleIds:[]},r=[];for(let t of e){let e;this.styleMirror.has(t)?e=this.styleMirror.getId(t):(e=this.styleMirror.add(t),r.push({styleId:e,rules:Array.from(t.rules||CSSRule,(e,n)=>({rule:L(e,t.href),index:n}))})),n.styleIds.push(e)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}},So=class{constructor(){n(this,`nodeMap`,new WeakMap),n(this,`active`,!1)}inOtherBuffer(e,t){let n=this.nodeMap.get(e);return n&&Array.from(n).some(e=>e!==t)}add(e,t){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}},Q,Co,wo,To=!1;try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement(`iframe`);document.body.appendChild(e),Array.from=e.contentWindow?.Array.from||Array.from,document.body.removeChild(e)}}catch(e){console.debug(`Unable to override Array.from`,e)}var $=ue();function Eo(e={}){let{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:i=`rr-block`,blockSelector:a=null,ignoreClass:o=`rr-ignore`,ignoreSelector:s=null,maskTextClass:c=`rr-mask`,maskTextSelector:l=null,inlineStylesheet:u=!0,maskAllInputs:d,maskInputOptions:f,slimDOMOptions:p,maskInputFn:m,maskTextFn:h,hooks:g,packFn:_,sampling:v={},dataURLOptions:y={},mousemoveWait:b,recordDOM:x=!0,recordCanvas:S=!1,recordCrossOriginIframes:C=!1,recordAfter:w=e.recordAfter===`DOMContentLoaded`?e.recordAfter:`load`,userTriggeredOnInput:T=!1,collectFonts:E=!1,inlineImages:D=!1,plugins:O,keepIframeSrcFn:k=()=>!1,ignoreCSSAttributes:A=new Set([]),errorHandler:ee}=e;Da(ee);let j=!C||window.parent===window,M=!1;if(!j)try{window.parent.document&&(M=!1)}catch{M=!0}if(j&&!t)throw Error(`emit function is required`);if(!j&&!M)return()=>{};b!==void 0&&v.mousemove===void 0&&(v.mousemove=b),$.reset();let te=d===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:f===void 0?{password:!0}:f,ne=Ze(p);sa();let N,re=0,P=e=>{for(let t of O||[])t.eventProcessor&&(e=t.eventProcessor(e));return _&&!M&&(e=_(e)),e};Q=(e,i)=>{let a=e;if(a.timestamp=qi(),ka[0]?.isFrozen()&&a.type!==J.FullSnapshot&&(a.type!==J.IncrementalSnapshot||a.data.source!==Y.Mutation)&&ka.forEach(e=>e.unfreeze()),j)t?.(P(a),i);else if(M){let e={type:`rrweb`,event:P(a),origin:window.location.origin,isCheckout:i};window.parent.postMessage(e,`*`)}if(a.type===J.FullSnapshot)N=a,re=0;else if(a.type===J.IncrementalSnapshot){if(a.data.source===Y.Mutation&&a.data.isAttachIframe)return;re++;let e=r&&re>=r,t=n&&a.timestamp-N.timestamp>n;(e||t)&&Co(!0)}};let F=e=>{Q({type:J.IncrementalSnapshot,data:{source:Y.Mutation,...e}})},ie=e=>Q({type:J.IncrementalSnapshot,data:{source:Y.Scroll,...e}}),ae=e=>Q({type:J.IncrementalSnapshot,data:{source:Y.CanvasMutation,...e}}),I=new xo({mutationCb:F,adoptedStyleSheetCb:e=>Q({type:J.IncrementalSnapshot,data:{source:Y.AdoptedStyleSheet,...e}})}),L=new $a({mirror:$,mutationCb:F,stylesheetManager:I,recordCrossOriginIframes:C,wrappedEmit:Q});for(let e of O||[])e.getMirror&&e.getMirror({nodeMirror:$,crossOriginIframeMirror:L.crossOriginIframeMirror,crossOriginIframeStyleMirror:L.crossOriginIframeStyleMirror});let oe=new So;wo=new bo({recordCanvas:S,mutationCb:ae,win:window,blockClass:i,blockSelector:a,mirror:$,sampling:v.canvas,dataURLOptions:y});let se=new eo({mutationCb:F,scrollCb:ie,bypassOptions:{blockClass:i,blockSelector:a,maskTextClass:c,maskTextSelector:l,inlineStylesheet:u,maskInputOptions:te,dataURLOptions:y,maskTextFn:h,maskInputFn:m,recordCanvas:S,inlineImages:D,sampling:v,slimDOMOptions:ne,iframeManager:L,stylesheetManager:I,canvasManager:wo,keepIframeSrcFn:k,processedNodeManager:oe},mirror:$});Co=(e=!1)=>{if(!x)return;Q({type:J.Meta,data:{href:window.location.href,width:ta(),height:ea()}},e),I.reset(),se.init(),ka.forEach(e=>e.lock());let t=et(document,{mirror:$,blockClass:i,blockSelector:a,maskTextClass:c,maskTextSelector:l,inlineStylesheet:u,maskAllInputs:te,maskTextFn:h,maskInputFn:m,slimDOM:ne,dataURLOptions:y,recordCanvas:S,inlineImages:D,onSerialize:e=>{ca(e,$)&&L.addIframe(e),la(e,$)&&I.trackLinkElement(e),ua(e)&&se.addShadowRoot(G.shadowRoot(e),document)},onIframeLoad:(e,t)=>{L.attachIframe(e,t),se.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{I.attachLinkElement(e,t)},keepIframeSrcFn:k});if(!t)return console.warn(`Failed to snapshot the document`);Q({type:J.FullSnapshot,data:{node:t,initialOffset:$i(window)}},e),ka.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&I.adoptStyleSheets(document.adoptedStyleSheets,$.getId(document))};try{let e=[],t=e=>Z(Ya)({mutationCb:F,mousemoveCb:(e,t)=>Q({type:J.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>Q({type:J.IncrementalSnapshot,data:{source:Y.MouseInteraction,...e}}),scrollCb:ie,viewportResizeCb:e=>Q({type:J.IncrementalSnapshot,data:{source:Y.ViewportResize,...e}}),inputCb:e=>Q({type:J.IncrementalSnapshot,data:{source:Y.Input,...e}}),mediaInteractionCb:e=>Q({type:J.IncrementalSnapshot,data:{source:Y.MediaInteraction,...e}}),styleSheetRuleCb:e=>Q({type:J.IncrementalSnapshot,data:{source:Y.StyleSheetRule,...e}}),styleDeclarationCb:e=>Q({type:J.IncrementalSnapshot,data:{source:Y.StyleDeclaration,...e}}),canvasMutationCb:ae,fontCb:e=>Q({type:J.IncrementalSnapshot,data:{source:Y.Font,...e}}),selectionCb:e=>{Q({type:J.IncrementalSnapshot,data:{source:Y.Selection,...e}})},customElementCb:e=>{Q({type:J.IncrementalSnapshot,data:{source:Y.CustomElement,...e}})},blockClass:i,ignoreClass:o,ignoreSelector:s,maskTextClass:c,maskTextSelector:l,maskInputOptions:te,inlineStylesheet:u,sampling:v,recordDOM:x,recordCanvas:S,inlineImages:D,userTriggeredOnInput:T,collectFonts:E,doc:e,maskInputFn:m,maskTextFn:h,keepIframeSrcFn:k,blockSelector:a,slimDOMOptions:ne,dataURLOptions:y,mirror:$,iframeManager:L,stylesheetManager:I,shadowDomManager:se,processedNodeManager:oe,canvasManager:wo,ignoreCSSAttributes:A,plugins:(O?.filter(e=>e.observer))?.map(e=>({observer:e.observer,options:e.options,callback:t=>Q({type:J.Plugin,data:{plugin:e.name,payload:t}})}))||[]},g);L.addLoadListener(n=>{try{e.push(t(n.contentDocument))}catch(e){console.warn(e)}});let n=()=>{Co(),e.push(t(document)),To=!0};return[`interactive`,`complete`].includes(document.readyState)?n():(e.push(K(`DOMContentLoaded`,()=>{Q({type:J.DomContentLoaded,data:{}}),w===`DOMContentLoaded`&&n()})),e.push(K(`load`,()=>{Q({type:J.Load,data:{}}),w===`load`&&n()},window))),()=>{e.forEach(e=>{try{e()}catch(e){String(e).toLowerCase().includes(`cross-origin`)||console.warn(e)}}),oe.destroy(),To=!1,Oa()}}catch(e){console.warn(e)}}Eo.addCustomEvent=(e,t)=>{if(!To)throw Error(`please add custom event after start recording`);Q({type:J.Custom,data:{tag:e,payload:t}})},Eo.freezePage=()=>{ka.forEach(e=>e.freeze())},Eo.takeFullSnapshot=e=>{if(!To)throw Error(`please take full snapshot after start recording`);Co(e)},Eo.mirror=$;var Do;(function(e){e[e.NotStarted=0]=`NotStarted`,e[e.Running=1]=`Running`,e[e.Stopped=2]=`Stopped`})(Do||={});var{addCustomEvent:Oo}=Eo,{freezePage:ko}=Eo,{takeFullSnapshot:Ao}=Eo,jo=40,Mo=7,No=6e4;async function Po(e){if(typeof CompressionStream>`u`)return null;try{return await new Response(new Blob([e]).stream().pipeThrough(new CompressionStream(`gzip`))).blob()}catch{return null}}function Fo({endpoint:e,onEvent:t=()=>{}}){let n=[],r=!1,i=null,a=!1,o=(e,r)=>{if(e.tries++,e.tries>=Mo)return n.shift(),t({t:`drop`,b:e.b,reason:`retries`}),s();let a=r>0?r*1e3:Math.min(3e4,1e3*2**(e.tries-1))*(.75+Math.random()/2);i=setTimeout(()=>{i=null,s()},a)};async function s(){if(r||i||a||!n.length)return;r=!0;let c=n[0];try{let i=await Po(c.json),s=i||c.json,l=i?i.size:c.json.length,u=await fetch(e,{method:`POST`,body:s,credentials:`omit`,mode:`cors`,headers:{"Content-Type":`text/plain;charset=UTF-8`},keepalive:l<No});if(u.ok)n.shift(),t({t:`ack`,b:c.b});else{let e=``;try{e=(await u.json())?.code||``}catch{}if(e===`session_limit`||e===`session_key`)n.length=0,t({t:`rotate`,code:e});else if(e===`quota_exceeded`||e===`recording_disabled`||u.status===401||u.status===403)n.length=0,a=!0,t({t:`stop`,code:e||String(u.status)});else if(u.status===429||u.status>=500)return r=!1,o(c,Number(u.headers.get(`Retry-After`))||0);else n.shift(),t({t:`drop`,b:c.b,reason:String(u.status)})}}catch{return r=!1,o(c,0)}r=!1,s()}return{push(e){a||(n.push({...e,tries:0}),n.length>jo&&t({t:`drop`,b:n.shift().b,reason:`overflow`}),s())},nudge(){i&&=(clearTimeout(i),null),s()},stop(){a=!0,n.length=0,i&&clearTimeout(i)},pending:()=>n.length}}var Io=`0.2.0`,Lo=e=>(e=e.toLowerCase(),e.startsWith(`data-`)||e===`title`||e===`alt`||e===`placeholder`||e===`aria-label`||e===`value`);function Ro(e){if(e&&typeof e==`object`)for(let t of Object.keys(e))Lo(t)&&typeof e[t]==`string`&&e[t]&&(e[t]=`***`)}function zo(e){e&&typeof e==`object`&&(e.attributes&&Ro(e.attributes),Array.isArray(e.childNodes)&&e.childNodes.forEach(zo))}function Bo(e,t){try{e.type===4&&typeof e.data?.href==`string`?e.data.href=qo(e.data.href,t):e.type===2&&e.data?.node?zo(e.data.node):e.type===3&&e.data&&(Array.isArray(e.data.adds)&&e.data.adds.forEach(e=>zo(e.node)),Array.isArray(e.data.attributes)&&e.data.attributes.forEach(e=>Ro(e.attributes)))}catch{}return e}var Vo=[[/[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}/gi,`[email]`],[/\beyJ[\w-]{6,}\.[\w-]{6,}\.[\w-]{6,}\b/g,`[jwt]`],[/\b(Bearer|Basic)\s+[\w.~+/=-]{8,}/gi,`$1 [token]`],[/\b(?:\d[ -]?){13,19}\b/g,`[number]`],[/\b(sk|pk|rk)_(live|test)_[\w]{8,}\b/g,`[key]`]];function Ho(e){let t=String(e??``);for(let[e,n]of Vo)t=t.replace(e,n);return t}function Uo(e){return typeof e==`string`?e:e&&typeof e.href==`string`?e.href:e&&typeof e.url==`string`?e.url:e==null?``:String(e)}var Wo=600,Go=/(?:^|[-_.])(token|secret|password|passwd|auth|authorization|key|apikey|api[-_]?key|session|sid|code|signature|credential|email)s?$/i,Ko=e=>e.split(/[?&=]/)[0];function qo(e,t=!1){let n=String(e??``);try{let e=new URL(n,location.href),r=!1;(e.username||e.password)&&(e.username=``,e.password=``,r=!0),t&&(e.search||Ko(e.hash)!==e.hash)&&(e.search=``,e.hash=Ko(e.hash),r=!0);for(let t of[...e.searchParams.keys()])Go.test(t)&&(e.searchParams.set(t,`***`),r=!0);if(e.hash){let t=e.hash.replace(/([?&#]|^)([^=&?#]+)=([^&#]*)/g,(e,t,n)=>Go.test(n)?`${t}${n}=***`:e);t!==e.hash&&(e.hash=t,r=!0)}let i=Ho(decodeURIComponent(e.pathname));return i!==decodeURIComponent(e.pathname)&&(e.pathname=i,r=!0),r?(/^[a-z][a-z0-9+.-]*:/i.test(n)?e.href:e.pathname+e.search+e.hash).slice(0,Wo):n.slice(0,Wo)}catch{return Ho(t?n.split(`?`)[0]:n).slice(0,Wo)}}var Jo=e=>{try{return new URL(e,location.href).href}catch{return String(e??``)}},Yo=[`content-type`,`content-length`,`content-encoding`,`cache-control`,`etag`,`vary`,`age`,`server-timing`,`x-request-id`];function Xo(e){let t={};for(let n of Yo)try{let r=e(n);r&&(t[n]=String(r).slice(0,200))}catch{}return Object.keys(t).length?t:void 0}function Zo(e,t){try{if(!e)return;if(typeof e.get==`function`)return e.get(t)||void 0;if(Array.isArray(e)){let n=e.find(e=>String(e?.[0]).toLowerCase()===t);return n?String(n[1]):void 0}for(let n of Object.keys(e))if(n.toLowerCase()===t)return String(e[n])}catch{}}function Qo(e){try{return e==null?void 0:typeof e==`string`?e.length:typeof Blob<`u`&&e instanceof Blob?e.size:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:typeof URLSearchParams<`u`&&e instanceof URLSearchParams?String(e).length:void 0}catch{return}}function $o(e,t,n){typeof performance<`u`&&performance.getEntriesByName&&setTimeout(()=>{try{let r=null;for(let e of performance.getEntriesByName(t,`resource`)){let t=Math.abs(e.startTime-n);t<1500&&(!r||t<Math.abs(r.startTime-n))&&(r=e)}if(!r)return;let i=e.detail||={};if(r.transferSize&&(i.xfer=Math.round(r.transferSize)),r.decodedBodySize&&i.resSize==null&&(i.resSize=Math.round(r.decodedBodySize)),r.responseStart>0){let e=r.secureConnectionStart>0?r.secureConnectionStart:r.connectEnd,t={dns:r.domainLookupEnd-r.domainLookupStart,tcp:e-r.connectStart,tls:r.secureConnectionStart>0?r.connectEnd-r.secureConnectionStart:0,ttfb:r.responseStart-r.requestStart,dl:r.responseEnd-r.responseStart};i.timing={};for(let e of Object.keys(t))t[e]>0&&(i.timing[e]=Math.round(t[e]*10)/10);Object.keys(i.timing).length||delete i.timing}}catch{}},300)}function es(e=`rec_`){return e+(typeof crypto<`u`&&crypto.getRandomValues?Array.from(crypto.getRandomValues(new Uint8Array(12))).map(e=>e.toString(16).padStart(2,`0`)).join(``):Math.abs(Date.now()^performance.now()*1e3|0).toString(16)+Math.random().toString(16).slice(2,10))}function ts(){if(typeof crypto>`u`||!crypto.getRandomValues)return null;let e=crypto.getRandomValues(new Uint8Array(16));return btoa(String.fromCharCode(...e)).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}var ns={get(e,t){try{return JSON.parse(window[e].getItem(t))}catch{return null}},set(e,t,n){try{window[e].setItem(t,JSON.stringify(n))}catch{}},del(e,t){try{window[e].removeItem(t)}catch{}}},rs=`specto-optout`,is=`specto-consent`,as=()=>ns.get(`localStorage`,rs)===!0,os=()=>ns.get(`localStorage`,is)===`granted`;function ss(){let e=ns.get(`localStorage`,`specto-vid`);return typeof e!=`string`&&(e=es(`v_`),ns.set(`localStorage`,`specto-vid`,e)),e}var cs=18e5,ls=144e5,us=4e3;async function ds(e,t){if(!e)return null;try{let n=typeof AbortController<`u`?new AbortController:null,r=n&&setTimeout(()=>n.abort(),3e3),i=await fetch(`${e}?key=${encodeURIComponent(t)}`,{credentials:`omit`,signal:n?.signal});return r&&clearTimeout(r),i.ok?await i.json():null}catch{return null}}function fs(e={}){if(typeof window>`u`)return{disabled:!0,reason:`no window`,stop(){}};if(window.__spectoRec&&!window.__spectoRec.disabled)return window.__spectoRec;if(!e.key)throw Error(`Specto: a publishable key is required`);let t=String(e.key),n=e.endpoint||`/api/ingest`,r=e.configUrl===!1?null:e.configUrl||String(n).replace(/\/api\/ingest$/,`/api/sdk/config`),i={disabled:!0,reason:`starting`,sessionId:null,stop(){},flushNow(){},count:()=>0,identify(){},track(){},sessionUrl:()=>null};if(navigator.doNotTrack===`1`||navigator.globalPrivacyControl)return Object.assign(i,{reason:`dnt`});if(as())return Object.assign(i,{reason:`opted-out`});if(e.consent===`required`&&!os())return Object.assign(i,{reason:`consent-required`});let a=ps(e,t,n);return window.__spectoRec=a,ds(r,t).then(e=>a._begin(e)).catch(()=>a._begin(null)),a}function ps(e,t,n){let r=[],i=0,a=!1,o=!1,s=null,c=[],l=performance.now(),u=()=>Math.round(performance.now()-l),d=`specto-session:${t}`,f=null,p=null,m=null,h=!1,g=[],_=null,v=Date.now(),y=[],b=(t,n)=>{if(!o){if(!a){y.length<50&&y.push([t,n]);return}r.push({kind:t,payload:n}),i++,e.onUpdate?.({total:i,kind:t})}},x=()=>ns.set(`sessionStorage`,d,f);function S(e){let t=Date.now(),n=e?null:ns.get(`sessionStorage`,d),r=!!(n&&typeof n.id==`string`&&t-n.active<cs&&t-n.started<ls);if(r)f=n;else{let e=Math.max(0,Math.min(1,p.sampleRate));f={id:es(),sk:ts(),b:0,started:t,active:t,sampled:Math.random()<e}}return f.active=t,x(),r}function C(){if(E(),S(!0),!f.sampled)return k.stop(`not-sampled`);try{Eo.takeFullSnapshot(!0)}catch{}}function w(e){if(!e.length||!f?.sampled)return;let n={b:f.b++,json:JSON.stringify({key:t,sessionId:f.id,...f.sk?{sk:f.sk}:{},b:f.b-1,sdk:Io,meta:{page:qo(location.pathname),userAgent:navigator.userAgent,visitorId:ss()},events:e})};f.active=Math.max(f.active,v),x(),m?(m.postMessage({t:`upload`,item:n}),h||g.push(n)):_.push(n)}function T(){if(!_){try{m?.terminate()}catch{}m=null,_=Fo({endpoint:n,onEvent:D});for(let e of g.splice(0))_.push(e)}}function E(){if(!r.length)return;let e=r;r=[],w(e)}function D(t){t.t===`stop`?k.stop(t.code):t.t===`rotate`&&C(),e.onDelivery?.(t)}function O(){if(!r.length||!navigator.sendBeacon||!f?.sampled)return;let e=r;r=[];let i=[],a=0,o=()=>{if(!i.length)return;let e=JSON.stringify({key:t,sessionId:f.id,...f.sk?{sk:f.sk}:{},b:f.b++,sdk:Io,meta:{page:qo(location.pathname)},events:i});try{navigator.sendBeacon(n,new Blob([e],{type:`text/plain;charset=UTF-8`}))}catch{}i=[],a=0};for(let t of e){let e=JSON.stringify(t).length;a+e>55e3&&o(),!(e>55e3)&&(i.push(t),a+=e)}o(),x()}let k={disabled:!1,get sessionId(){return f?.id||null},count:()=>i,flushNow:()=>E(),identify(e,t){e!=null&&e!==``&&b(`identify`,{id:String(e).slice(0,256),traits:t&&typeof t==`object`?t:void 0})},track(e,t){e&&b(`event`,{t:u(),type:`custom`,name:String(e).slice(0,120),props:t&&typeof t==`object`?JSON.parse(JSON.stringify(t,(e,t)=>typeof t==`string`?Ho(t).slice(0,500):t)):void 0})},sessionUrl(){try{return f?`${new URL(n,location.href).origin}/#replay/${f.id}`:null}catch{return null}},stop(e){if(o)return;o=!0,k.disabled=!0,k.reason=e||`stopped`;try{s?.()}catch{}for(let e of c.splice(0))try{e()}catch{}E(),m&&!h&&g.length&&T();let t=m;t&&setTimeout(()=>t.terminate(),2e3),window.__spectoRec===k&&delete window.__spectoRec},_begin(t){if(o||a)return;let r=t&&typeof t==`object`?t:{};if(r.enabled===!1)return k.stop(`recording-disabled`);p={strict:e.privacy===`strict`||r.privacy===`strict`,console:e.console!==!1&&r.captureConsole!==!1,networkDetails:e.networkDetails!==!1&&r.captureNetworkDetails!==!1,sampleRate:Math.min(e.sampleRate??1,typeof r.sampleRate==`number`?r.sampleRate:1)};let i=S(!1);if(!f.sampled)return k.stop(`not-sampled`);a=!0;for(let[e,t]of y.splice(0))b(e,t);try{if(m=e.createWorker?e.createWorker():null,m){m.onmessage=e=>{let t=e.data||{};if(t.t===`ready`){h=!0,g=[];return}D(t)},m.onerror=()=>{h||T()},m.postMessage({t:`init`,endpoint:n});let e=setTimeout(()=>{h||T()},us);c.push(()=>clearTimeout(e))}}catch{m=null}m||(_=Fo({endpoint:n,onEvent:D})),A(i);let s=setInterval(E,2e3);c.push(()=>clearInterval(s))}};function A(t){s=Eo({emit:e=>b(`dom`,Bo(e,p.strict)),maskAllInputs:!0,maskInputOptions:{password:!0,email:!0,tel:!0,color:!1},maskTextClass:`specto-mask`,maskTextSelector:p.strict?`*`:void 0,blockClass:`specto-block`,recordCanvas:!1,collectFonts:!1,checkoutEveryNms:3e5,sampling:{mousemove:50,scroll:150,input:`last`}});let r=()=>{let e=Date.now();if(e-v>cs){v=e,C();return}v=e};for(let e of[`click`,`keydown`,`scroll`,`pointerdown`])window.addEventListener(e,r,{capture:!0,passive:!0}),c.push(()=>window.removeEventListener(e,r,{capture:!0}));if(p.console)for(let e of[`log`,`info`,`warn`,`error`]){let t=console[e];console[e]=(...n)=>{try{b(`console`,{t:u(),level:e,text:p.strict?`[masked]`:Ho(n.map(_s).join(` `)).slice(0,2e3)})}catch{}t.apply(console,n)},c.push(()=>{console[e]=t})}if(p.networkDetails)try{performance.setResourceTimingBufferSize?.(1e3)}catch{}let i=window.fetch,a=null;try{a=new URL(n,location.href).href.split(/[?#]/)[0]}catch{}let o=e=>{try{return a!=null&&new URL(e,location.href).href.split(/[?#]/)[0]===a}catch{return!1}},l=new Set((Array.isArray(e.traceOrigins)?e.traceOrigins:[]).map(e=>{try{return new URL(e).origin}catch{return null}}).filter(Boolean)),d=!!e.traces||l.size>0,f=e=>{if(!d)return!1;try{let t=new URL(e,location.href).origin;return t===location.origin||l.has(t)}catch{return!1}},h=e=>{try{let[t,n]=e,r=typeof Request<`u`&&t instanceof Request,i=new Headers(n?.headers??(r?t.headers:void 0)),a=hs.exec(i.get(`traceparent`)||``);if(a)return[e,a[1].toLowerCase()];let o=ms(16);return i.set(`traceparent`,`00-${o}-${ms(8)}-01`),[[t,{...n,headers:i}],o]}catch{return[e,void 0]}};window.fetch=async(...e)=>{if(o(Uo(e[0])))return i.apply(window,e);let t=performance.now(),n=Uo(e[0]),r=qo(n,p.strict),a=(e[1]?.method||typeof e[0]!=`string`&&e[0]?.method||`GET`).toUpperCase(),s;f(n)&&([e,s]=h(e));try{let o=await i.apply(window,e),c=s;try{c=c||o.headers.get(`x-trace-id`)||void 0}catch{}let l={t:u(),method:a,url:r,status:o.status,dur:Math.round(performance.now()-t),...c?{traceId:c}:{}};if(p.networkDetails){let r={initiator:`fetch`};try{o.statusText&&(r.statusText=String(o.statusText).slice(0,80));let t=Xo(e=>o.headers.get(e));t&&(r.headers=t),t?.[`content-type`]&&(r.resType=t[`content-type`].split(`;`)[0]);let n=Number(t?.[`content-length`]);t?.[`content-length`]!=null&&Number.isFinite(n)&&(r.resSize=n);let i=Zo((e[1]||(typeof e[0]==`object`?e[0]:null))?.headers,`content-type`);i&&(r.reqType=i.split(`;`)[0].slice(0,80));let a=Qo(e[1]?.body);a!=null&&(r.reqSize=a)}catch{}l.detail=r,$o(l,Jo(n),t)}return b(`network`,l),o}catch(e){throw b(`network`,{t:u(),method:a,url:r,status:0,dur:Math.round(performance.now()-t),error:!0,...p.networkDetails?{detail:{initiator:`fetch`,message:Ho(String(e?.message||e)).slice(0,200)}}:{}}),e}},c.push(()=>{window.fetch=i});let g=window.XMLHttpRequest,y=g.prototype.open,x=g.prototype.send,S=g.prototype.setRequestHeader;g.prototype.open=function(e,t){return this.__specto={method:String(e).toUpperCase(),url:qo(t,p.strict),rawUrl:Jo(t),started:0,trace:f(t)},y.apply(this,arguments)},g.prototype.setRequestHeader=function(e,t){let n=String(e).toLowerCase();if(this.__specto&&n===`content-type`&&(this.__specto.reqType=String(t).split(`;`)[0].slice(0,80)),this.__specto&&n===`traceparent`){let e=hs.exec(String(t));e&&(this.__specto.traceId=e[1].toLowerCase()),this.__specto.trace=!1}return S.apply(this,arguments)},g.prototype.send=function(e){if(this.__specto){if(this.__specto.trace)try{let e=ms(16);S.call(this,`traceparent`,`00-${e}-${ms(8)}-01`),this.__specto.traceId=e}catch{}this.__specto.started=performance.now(),p.networkDetails&&(this.__specto.reqSize=Qo(e)),this.addEventListener(`loadend`,()=>{let e=this.__specto,t=e.traceId;try{t=t||this.getResponseHeader(`x-trace-id`)||void 0}catch{}let n={t:u(),method:e.method,url:e.url,status:this.status,dur:Math.round(performance.now()-e.started),...t?{traceId:t}:{},...this.status===0?{error:!0}:{}};if(p.networkDetails){let t={initiator:`xhr`};try{this.statusText&&(t.statusText=String(this.statusText).slice(0,80));let n=Xo(e=>this.getResponseHeader(e));n&&(t.headers=n),n?.[`content-type`]&&(t.resType=n[`content-type`].split(`;`)[0]);let r=Number(n?.[`content-length`]);n?.[`content-length`]!=null&&Number.isFinite(r)&&(t.resSize=r),e.reqType&&(t.reqType=e.reqType),e.reqSize!=null&&(t.reqSize=e.reqSize)}catch{}n.detail=t,$o(n,e.rawUrl,e.started)}b(`network`,n)})}return x.apply(this,arguments)},c.push(()=>{g.prototype.open=y,g.prototype.send=x,g.prototype.setRequestHeader=S});let w=e=>{let t=e.error||e.reason,n=t?.stack?Ho(String(t.stack)).split(`
135
+ `).slice(0,6).map(e=>e.replace(/\?[^\s:)]*/g,``).slice(0,300)).join(`
136
+ `):void 0;b(`event`,{t:u(),type:`error`,message:Ho(String(e.message||t?.message||e.reason||`error`)).slice(0,500),...n?{stack:n}:{}})};window.addEventListener(`error`,w),window.addEventListener(`unhandledrejection`,w),c.push(()=>{window.removeEventListener(`error`,w),window.removeEventListener(`unhandledrejection`,w)});let T=()=>{},E=()=>{T(),b(`event`,{t:u(),type:`nav`,path:qo(location.pathname+location.search+location.hash,p.strict).slice(0,300)})},D=history.pushState,k=history.replaceState;if(history.pushState=function(...e){let t=D.apply(this,e);try{E()}catch{}return t},history.replaceState=function(...e){let t=k.apply(this,e);try{E()}catch{}return t},window.addEventListener(`popstate`,E),window.addEventListener(`hashchange`,E),c.push(()=>{history.pushState=D,history.replaceState=k,window.removeEventListener(`popstate`,E),window.removeEventListener(`hashchange`,E)}),t||location.hash.length>1)try{E()}catch{}let A=[],ee=e=>{let t=performance.now();if(A=A.filter(n=>t-n.t<800&&Math.abs(n.x-e.clientX)<40&&Math.abs(n.y-e.clientY)<40),A.push({t,x:e.clientX,y:e.clientY}),A.length>=3){let t=e.target?.tagName?e.target.tagName.toLowerCase()+(e.target.id?`#`+e.target.id:``):`element`;b(`event`,{t:u(),type:`rage`,target:t.slice(0,80),count:A.length}),A=[]}};window.addEventListener(`click`,ee,!0),c.push(()=>window.removeEventListener(`click`,ee,!0));let j=()=>Math.max(document.documentElement?.scrollHeight||0,document.body?.scrollHeight||0),M=null,te=()=>{let e=j();M&&e>0&&(M.depth=Math.max(M.depth,Math.min(1,(window.scrollY+window.innerHeight)/e)))},ne=()=>{M={id:Math.random().toString(36).slice(2,10),path:qo(location.pathname,p.strict).slice(0,300),depth:0,clicks:0},te()},N=()=>{M&&b(`event`,{t:u(),type:`scroll`,path:M.path,pv:M.id,depth:Math.round(M.depth*1e3)/1e3,vw:window.innerWidth,dh:j()})};ne(),T=()=>{qo(location.pathname,p.strict).slice(0,300)!==M?.path&&(N(),ne())};let re=!1,P=()=>{re||(re=!0,requestAnimationFrame(()=>{re=!1,te()}))},F=e=>{!M||M.clicks>=300||(M.clicks++,b(`event`,{t:u(),type:`click`,path:M.path,pv:M.id,x:Math.round(e.pageX),y:Math.round(e.pageY),vw:window.innerWidth,dh:j(),sel:gs(e.target)}))};window.addEventListener(`scroll`,P,{passive:!0,capture:!0}),window.addEventListener(`click`,F,!0),c.push(()=>{window.removeEventListener(`scroll`,P,{capture:!0}),window.removeEventListener(`click`,F,!0)});let ie=()=>{N(),O()},ae=()=>{document.visibilityState===`hidden`&&(N(),O())},I=()=>{m?m.postMessage({t:`nudge`}):_?.nudge()};window.addEventListener(`pagehide`,ie),document.addEventListener(`visibilitychange`,ae),window.addEventListener(`online`,I),c.push(()=>{window.removeEventListener(`pagehide`,ie),document.removeEventListener(`visibilitychange`,ae),window.removeEventListener(`online`,I)})}return k}var ms=e=>{let t=new Uint8Array(e);return crypto.getRandomValues(t),Array.from(t,e=>e.toString(16).padStart(2,`0`)).join(``)},hs=/^00-([0-9a-f]{32})-[0-9a-f]{16}-[0-9a-f]{2}$/i;function gs(e){let t=[];for(let n=e,r=0;n&&n.nodeType===1&&r<3&&n!==document.body&&n!==document.documentElement;n=n.parentElement,r++){let e=String(n.tagName||``).toLowerCase();if(n.id){t.unshift(`${e}#${n.id}`);break}let r=typeof n.className==`string`?n.className.trim().split(/\s+/).filter(e=>e&&!e.startsWith(`specto-`)).slice(0,2):[];t.unshift(r.length?`${e}.${r.join(`.`)}`:e)}return Ho(t.join(` > `)||`body`).slice(0,160)}function _s(e){if(typeof e==`string`)return e;if(e instanceof Error)return`${e.name}: ${e.message}`;try{return JSON.stringify(e)}catch{return String(e)}}var vs='(function(){async function e(e){if(typeof CompressionStream>`u`)return null;try{return await new Response(new Blob([e]).stream().pipeThrough(new CompressionStream(`gzip`))).blob()}catch{return null}}function t({endpoint:t,onEvent:n=()=>{}}){let r=[],i=!1,a=null,o=!1,s=(e,t)=>{if(e.tries++,e.tries>=7)return r.shift(),n({t:`drop`,b:e.b,reason:`retries`}),c();let i=t>0?t*1e3:Math.min(3e4,1e3*2**(e.tries-1))*(.75+Math.random()/2);a=setTimeout(()=>{a=null,c()},i)};async function c(){if(i||a||o||!r.length)return;i=!0;let l=r[0];try{let a=await e(l.json),c=a||l.json,u=a?a.size:l.json.length,d=await fetch(t,{method:`POST`,body:c,credentials:`omit`,mode:`cors`,headers:{"Content-Type":`text/plain;charset=UTF-8`},keepalive:u<6e4});if(d.ok)r.shift(),n({t:`ack`,b:l.b});else{let e=``;try{e=(await d.json())?.code||``}catch{}if(e===`session_limit`||e===`session_key`)r.length=0,n({t:`rotate`,code:e});else if(e===`quota_exceeded`||e===`recording_disabled`||d.status===401||d.status===403)r.length=0,o=!0,n({t:`stop`,code:e||String(d.status)});else if(d.status===429||d.status>=500)return i=!1,s(l,Number(d.headers.get(`Retry-After`))||0);else r.shift(),n({t:`drop`,b:l.b,reason:String(d.status)})}}catch{return i=!1,s(l,0)}i=!1,c()}return{push(e){o||(r.push({...e,tries:0}),r.length>40&&n({t:`drop`,b:r.shift().b,reason:`overflow`}),c())},nudge(){a&&=(clearTimeout(a),null),c()},stop(){o=!0,r.length=0,a&&clearTimeout(a)},pending:()=>r.length}}let n=null;self.onmessage=e=>{let r=e.data||{};r.t===`init`?(n=t({endpoint:r.endpoint,onEvent:e=>self.postMessage(e)}),self.postMessage({t:`ready`})):r.t===`upload`?n?.push(r.item):r.t===`nudge`?n?.nudge():r.t===`stop`&&n?.stop()}})();',ys=typeof self<`u`&&self.Blob&&new Blob([`(self.URL || self.webkitURL).revokeObjectURL(self.location.href);`,vs],{type:`text/javascript;charset=utf-8`});function bs(e){let t;try{if(t=ys&&(self.URL||self.webkitURL).createObjectURL(ys),!t)throw``;let n=new Worker(t,{name:e?.name});return n.addEventListener(`error`,()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),n}catch{return new Worker(`data:text/javascript;charset=utf-8,`+encodeURIComponent(vs),{name:e?.name})}}var xs=null;function Ss(e={}){if(!e.endpoint)throw Error(`@spectosh/browser: opts.endpoint is required (https://<your-specto-host>/api/ingest)`);if(!e.key)throw Error(`@spectosh/browser: opts.key is required (your publishable pk_… key)`);return xs=e,fs({createWorker:()=>new bs,...e})}var Cs=()=>typeof window<`u`?window.__spectoRec:null,ws=(e,t)=>Cs()?.identify(e,t),Ts=(e,t)=>Cs()?.track(e,t),Es=()=>Cs()?.sessionUrl?.()||null,Ds=()=>Cs()?.stop();function Os(){try{localStorage.setItem(`specto-consent`,JSON.stringify(`granted`))}catch{}return xs?Ss(xs):null}function ks(){try{localStorage.removeItem(`specto-consent`)}catch{}Ds()}function As(){try{localStorage.setItem(`specto-optout`,`true`)}catch{}Ds()}function js(){try{localStorage.removeItem(`specto-optout`)}catch{}}var Ms={startRecording:Ss,identify:ws,track:Ts,sessionUrl:Es,stopRecording:Ds,grantConsent:Os,revokeConsent:ks,optOut:As,optIn:js};exports.SDK_VERSION=Io,exports.default=Ms,exports.grantConsent=Os,exports.hasConsent=os,exports.identify=ws,exports.isOptedOut=as,exports.optIn=js,exports.optOut=As,exports.revokeConsent=ks,exports.scrubText=Ho,exports.sessionUrl=Es,exports.startRecording=Ss,exports.stopRecording=Ds,exports.track=Ts;