@getvitops/core 8.2.0-alpha.0 → 8.3.0-alpha.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,4 +1,4 @@
1
- var e=Object.defineProperty,t=Object.defineProperties,n=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable,o=(t,n,r)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r,s=(e,t)=>{for(var n in t||={})i.call(t,n)&&o(e,n,t[n]);if(r)for(var n of r(t))a.call(t,n)&&o(e,n,t[n]);return e},c=(e,r)=>t(e,n(r)),l=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())});const u=Math.min,d=Math.max,f=Math.round,p=Math.floor,m=e=>({x:e,y:e});function h(e,t){return typeof e==`function`?e(t):e}function g(e){return s({top:0,right:0,bottom:0,left:0},e)}function ee(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:g(e)}function _(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function v(e,t){return l(this,null,function*(){var n;t===void 0&&(t={});let{x:r,y:i,platform:a,rects:o,elements:s,strategy:c}=e,{boundary:l=`clippingAncestors`,rootBoundary:u=`viewport`,elementContext:d=`floating`,altBoundary:f=!1,padding:p=0}=h(t,e),m=ee(p),g=s[f?d===`floating`?`reference`:`floating`:d],v=_(yield a.getClippingRect({element:(n=yield a.isElement==null?void 0:a.isElement(g))==null||n?g:g.contextElement||(yield a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:l,rootBoundary:u,strategy:c})),y=d===`floating`?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,b=yield a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating),x=(yield a.isElement==null?void 0:a.isElement(b))&&(yield a.getScale==null?void 0:a.getScale(b))||{x:1,y:1},S=_(a.convertOffsetParentRelativeRectToViewportRelativeRect?yield a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:b,strategy:c}):y);return{top:(v.top-S.top+m.top)/x.y,bottom:(S.bottom-v.bottom+m.bottom)/x.y,left:(v.left-S.left+m.left)/x.x,right:(S.right-v.right+m.right)/x.x}})}function y(){return typeof window<`u`}function b(e){return te(e)?(e.nodeName||``).toLowerCase():`#document`}function x(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function S(e){return((te(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function te(e){return y()?e instanceof Node||e instanceof x(e).Node:!1}function C(e){return y()?e instanceof Element||e instanceof x(e).Element:!1}function w(e){return y()?e instanceof HTMLElement||e instanceof x(e).HTMLElement:!1}function ne(e){return!y()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof x(e).ShadowRoot}const re=/* @__PURE__ */ new Set([`inline`,`contents`]);function ie(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=E(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!re.has(i)}const ae=/* @__PURE__ */ new Set([`table`,`td`,`th`]);function oe(e){return ae.has(b(e))}const se=[`:popover-open`,`:modal`];function ce(e){return se.some(t=>{try{return e.matches(t)}catch{return!1}})}const le=[`transform`,`translate`,`scale`,`rotate`,`perspective`],ue=[`transform`,`translate`,`scale`,`rotate`,`perspective`,`filter`],de=[`paint`,`layout`,`strict`,`content`];function fe(e){let t=me(),n=C(e)?E(e):e;return le.some(e=>n[e]?n[e]!==`none`:!1)||(n.containerType?n.containerType!==`normal`:!1)||!t&&(n.backdropFilter?n.backdropFilter!==`none`:!1)||!t&&(n.filter?n.filter!==`none`:!1)||ue.some(e=>(n.willChange||``).includes(e))||de.some(e=>(n.contain||``).includes(e))}function pe(e){let t=D(e);for(;w(t)&&!T(t);){if(fe(t))return t;if(ce(t))return null;t=D(t)}return null}function me(){return typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter`,`none`)}const he=/* @__PURE__ */ new Set([`html`,`body`,`#document`]);function T(e){return he.has(b(e))}function E(e){return x(e).getComputedStyle(e)}function ge(e){return C(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function D(e){if(b(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ne(e)&&e.host||S(e);return ne(t)?t.host:t}function _e(e){let t=D(e);return T(t)?e.ownerDocument?e.ownerDocument.body:e.body:w(t)&&ie(t)?t:_e(t)}function O(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=_e(e),i=r===e.ownerDocument?.body,a=x(r);if(i){let e=ve(a);return t.concat(a,a.visualViewport||[],ie(r)?r:[],e&&n?O(e):[])}return t.concat(r,O(r,[],n))}function ve(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ye(e){let t=E(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=w(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=f(n)!==a||f(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function be(e){return C(e)?e:e.contextElement}function k(e){let t=be(e);if(!w(t))return m(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=ye(t),o=(a?f(n.width):n.width)/r,s=(a?f(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}const xe=/* @__PURE__ */ m(0);function Se(e){let t=x(e);return!me()||!t.visualViewport?xe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ce(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==x(e)?!1:t}function A(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=be(e),o=m(1);t&&(r?C(r)&&(o=k(r)):o=k(e));let s=Ce(a,n,r)?Se(a):m(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=x(a),t=r&&C(r)?x(r):r,n=e,i=ve(n);for(;i&&r&&t!==n;){let e=k(i),t=i.getBoundingClientRect(),r=E(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=x(i),i=ve(n)}}return _({width:u,height:d,x:c,y:l})}function we(e,t){let n=ge(e).scrollLeft;return t?t.left+n:A(S(e)).left+n}function Te(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-we(e,n),y:n.top+t.scrollTop}}function Ee(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=S(r),s=t?ce(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=m(1),u=m(0),d=w(r);if((d||!d&&!a)&&((b(r)!==`body`||ie(o))&&(c=ge(r)),w(r))){let e=A(r);l=k(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Te(o,c):m(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function De(e){return Array.from(e.getClientRects())}function Oe(e){let t=S(e),n=ge(e),r=e.ownerDocument.body,i=d(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=d(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+we(e),s=-n.scrollTop;return E(r).direction===`rtl`&&(o+=d(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}function ke(e,t){let n=x(e),r=S(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=me();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=we(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=25&&(a-=o)}else l<=25&&(a+=l);return{width:a,height:o,x:s,y:c}}const Ae=/* @__PURE__ */ new Set([`absolute`,`fixed`]);function je(e,t){let n=A(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=w(e)?k(e):m(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Me(e,t,n){let r;if(t===`viewport`)r=ke(e,n);else if(t===`document`)r=Oe(S(e));else if(C(t))r=je(t,n);else{let n=Se(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return _(r)}function Ne(e,t){let n=D(e);return n===t||!C(n)||T(n)?!1:E(n).position===`fixed`||Ne(n,t)}function Pe(e,t){let n=t.get(e);if(n)return n;let r=O(e,[],!1).filter(e=>C(e)&&b(e)!==`body`),i=null,a=E(e).position===`fixed`,o=a?D(e):e;for(;C(o)&&!T(o);){let t=E(o),n=fe(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&Ae.has(i.position)||ie(o)&&!n&&Ne(e,o))?r=r.filter(e=>e!==o):i=t,o=D(o)}return t.set(e,r),r}function Fe(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?ce(t)?[]:Pe(t,this._c):[].concat(n),r],o=a[0],s=a.reduce((e,n)=>{let r=Me(t,n,i);return e.top=d(r.top,e.top),e.right=u(r.right,e.right),e.bottom=u(r.bottom,e.bottom),e.left=d(r.left,e.left),e},Me(t,o,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function Ie(e){let{width:t,height:n}=ye(e);return{width:t,height:n}}function Le(e,t,n){let r=w(t),i=S(t),a=n===`fixed`,o=A(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=m(0);function l(){c.x=we(i)}if(r||!r&&!a){if((b(t)!==`body`||ie(i))&&(s=ge(t)),r){let e=A(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l()}a&&!r&&i&&l();let u=i&&!r&&!a?Te(i,s):m(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Re(e){return E(e).position===`static`}function ze(e,t){if(!w(e)||E(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return S(e)===n&&(n=n.ownerDocument.body),n}function Be(e,t){let n=x(e);if(ce(e))return n;if(!w(e)){let t=D(e);for(;t&&!T(t);){if(C(t)&&!Re(t))return t;t=D(t)}return n}let r=ze(e,t);for(;r&&oe(r)&&Re(r);)r=ze(r,t);return r&&T(r)&&Re(r)&&!fe(r)?n:r||pe(e)||n}const Ve=function(e){return l(this,null,function*(){let t=this.getOffsetParent||Be,n=this.getDimensions,r=yield n(e.floating);return{reference:Le(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}})};function He(e){return E(e).direction===`rtl`}const j={convertOffsetParentRelativeRectToViewportRelativeRect:Ee,getDocumentElement:S,getClippingRect:Fe,getOffsetParent:Be,getElementRects:Ve,getClientRects:De,getDimensions:Ie,getScale:k,isElement:C,isRTL:He};function Ue(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function We(e,t){let n=null,r,i=S(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(l,f){l===void 0&&(l=!1),f===void 0&&(f=1),a();let m=e.getBoundingClientRect(),{left:h,top:g,width:ee,height:_}=m;if(l||t(),!ee||!_)return;let v=p(g),y=p(i.clientWidth-(h+ee)),b=p(i.clientHeight-(g+_)),x=p(h),S={rootMargin:-v+`px `+-y+`px `+-b+`px `+-x+`px`,threshold:d(0,u(1,f))||1},te=!0;function C(t){let n=t[0].intersectionRatio;if(n!==f){if(!te)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!Ue(m,e.getBoundingClientRect())&&o(),te=!1}try{n=new IntersectionObserver(C,c(s({},S),{root:i.ownerDocument}))}catch{n=new IntersectionObserver(C,S)}n.observe(e)}return o(!0),a}function Ge(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=be(e),u=i||a?[...l?O(l):[],...O(t)]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?We(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),p.observe(t));let m,h=c?A(e):null;c&&g();function g(){let t=A(e);h&&!Ue(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}const Ke=v;let M=null;var qe=class e{static createItem(e){return{prev:null,next:null,data:e}}constructor(){this.head=null,this.tail=null,this.cursor=null}createItem(t){return e.createItem(t)}allocateCursor(e,t){let n;return M===null?n={prev:e,next:t,cursor:this.cursor}:(n=M,M=M.cursor,n.prev=e,n.next=t,n.cursor=this.cursor),this.cursor=n,n}releaseCursor(){let{cursor:e}=this;this.cursor=e.cursor,e.prev=null,e.next=null,e.cursor=M,M=e}updateCursors(e,t,n,r){let{cursor:i}=this;for(;i!==null;)i.prev===e&&(i.prev=t),i.next===n&&(i.next=r),i=i.cursor}*[Symbol.iterator](){for(let e=this.head;e!==null;e=e.next)yield e.data}get size(){let e=0;for(let t=this.head;t!==null;t=t.next)e++;return e}get isEmpty(){return this.head===null}get first(){return this.head&&this.head.data}get last(){return this.tail&&this.tail.data}fromArray(t){let n=null;this.head=null;for(let r of t){let t=e.createItem(r);n===null?this.head=t:n.next=t,t.prev=n,n=t}return this.tail=n,this}toArray(){return[...this]}toJSON(){return[...this]}forEach(e,t=this){let n=this.allocateCursor(null,this.head);for(;n.next!==null;){let r=n.next;n.next=r.next,e.call(t,r.data,r,this)}this.releaseCursor()}forEachRight(e,t=this){let n=this.allocateCursor(this.tail,null);for(;n.prev!==null;){let r=n.prev;n.prev=r.prev,e.call(t,r.data,r,this)}this.releaseCursor()}reduce(e,t,n=this){let r=this.allocateCursor(null,this.head),i=t,a;for(;r.next!==null;)a=r.next,r.next=a.next,i=e.call(n,i,a.data,a,this);return this.releaseCursor(),i}reduceRight(e,t,n=this){let r=this.allocateCursor(this.tail,null),i=t,a;for(;r.prev!==null;)a=r.prev,r.prev=a.prev,i=e.call(n,i,a.data,a,this);return this.releaseCursor(),i}some(e,t=this){for(let n=this.head;n!==null;n=n.next)if(e.call(t,n.data,n,this))return!0;return!1}map(t,n=this){let r=new e;for(let e=this.head;e!==null;e=e.next)r.appendData(t.call(n,e.data,e,this));return r}filter(t,n=this){let r=new e;for(let e=this.head;e!==null;e=e.next)t.call(n,e.data,e,this)&&r.appendData(e.data);return r}nextUntil(e,t,n=this){if(e===null)return;let r=this.allocateCursor(null,e);for(;r.next!==null;){let e=r.next;if(r.next=e.next,t.call(n,e.data,e,this))break}this.releaseCursor()}prevUntil(e,t,n=this){if(e===null)return;let r=this.allocateCursor(e,null);for(;r.prev!==null;){let e=r.prev;if(r.prev=e.prev,t.call(n,e.data,e,this))break}this.releaseCursor()}clear(){this.head=null,this.tail=null}copy(){let t=new e;for(let e of this)t.appendData(e);return t}prepend(e){return this.updateCursors(null,e,this.head,e),this.head===null?this.tail=e:(this.head.prev=e,e.next=this.head),this.head=e,this}prependData(t){return this.prepend(e.createItem(t))}append(e){return this.insert(e)}appendData(t){return this.insert(e.createItem(t))}insert(e,t=null){if(t!==null){if(this.updateCursors(t.prev,e,t,e),t.prev===null){if(this.head!==t)throw Error(`before doesn't belong to list`);this.head=e,t.prev=e,e.next=t,this.updateCursors(null,e)}else t.prev.next=e,e.prev=t.prev,t.prev=e,e.next=t}else this.updateCursors(this.tail,e,null,e),this.tail===null?this.head=e:(this.tail.next=e,e.prev=this.tail),this.tail=e;return this}insertData(t,n){return this.insert(e.createItem(t),n)}remove(e){if(this.updateCursors(e,e.prev,e,e.next),e.prev!==null)e.prev.next=e.next;else{if(this.head!==e)throw Error(`item doesn't belong to list`);this.head=e.next}if(e.next!==null)e.next.prev=e.prev;else{if(this.tail!==e)throw Error(`item doesn't belong to list`);this.tail=e.prev}return e.prev=null,e.next=null,e}push(t){this.insert(e.createItem(t))}pop(){return this.tail===null?null:this.remove(this.tail)}unshift(t){this.prepend(e.createItem(t))}shift(){return this.head===null?null:this.remove(this.head)}prependList(e){return this.insertList(e,this.head)}appendList(e){return this.insertList(e)}insertList(e,t){return e.head===null?this:(t==null?(this.updateCursors(this.tail,e.tail,null,e.head),this.tail===null?this.head=e.head:(this.tail.next=e.head,e.head.prev=this.tail),this.tail=e.tail):(this.updateCursors(t.prev,e.tail,t,e.head),t.prev===null?this.head=e.head:(t.prev.next=e.head,e.head.prev=t.prev),t.prev=e.tail,e.tail.next=t),e.head=null,e.tail=null,this)}replace(e,t){`head`in t?this.insertList(t,e):this.insert(t,e),this.remove(e)}};function Je(e){let t={};for(let n of Object.keys(e)){let r=e[n];r&&(Array.isArray(r)||r instanceof qe?r=r.map(Je):r.constructor===Object&&(r=Je(r))),t[n]=r}return t}function N(e){return e>=48&&e<=57}function P(e){return N(e)||e>=65&&e<=70||e>=97&&e<=102}function Ye(e){return e>=65&&e<=90}function Xe(e){return e>=97&&e<=122}function Ze(e){return Ye(e)||Xe(e)}function Qe(e){return e>=128}function $e(e){return Ze(e)||Qe(e)||e===95}function et(e){return $e(e)||N(e)||e===45}function tt(e){return e>=0&&e<=8||e===11||e>=14&&e<=31||e===127}function nt(e){return e===10||e===13||e===12}function F(e){return nt(e)||e===32||e===9}function I(e,t){return!(e!==92||nt(t)||t===0)}function rt(e,t,n){return e===45?$e(t)||t===45||I(t,n):$e(e)?!0:e===92&&I(e,t)}function it(e,t,n){return e===43||e===45?N(t)?2:t===46&&N(n)?3:0:e===46?N(t)?2:0:+!!N(e)}function at(e){return+(e===65279||e===65534)}const ot=Array(128);for(let e=0;e<ot.length;e++)ot[e]=F(e)&&130||N(e)&&131||$e(e)&&132||tt(e)&&133||e||128;function st(e){return e<128?ot[e]:132}function L(e,t){return t<e.length?e.charCodeAt(t):0}function ct(e,t,n){return n===13&&L(e,t+1)===10?2:1}function lt(e,t,n){let r=e.charCodeAt(t);return Ye(r)&&(r|=32),r===n}function ut(e,t,n,r){if(n-t!==r.length||t<0||n>e.length)return!1;for(let i=t;i<n;i++){let n=r.charCodeAt(i-t),a=e.charCodeAt(i);if(Ye(a)&&(a|=32),a!==n)return!1}return!0}function dt(e,t){for(;t>=0&&F(e.charCodeAt(t));t--);return t+1}function ft(e,t){for(;t<e.length&&F(e.charCodeAt(t));t++);return t}function pt(e,t){for(;t<e.length&&N(e.charCodeAt(t));t++);return t}function R(e,t){if(t+=2,P(L(e,t-1))){for(let n=Math.min(e.length,t+5);t<n&&P(L(e,t));t++);let n=L(e,t);F(n)&&(t+=ct(e,t,n))}return t}function mt(e,t){for(;t<e.length;t++){let n=e.charCodeAt(t);if(!et(n)){if(I(n,L(e,t+1))){t=R(e,t)-1;continue}break}}return t}function ht(e,t){let n=e.charCodeAt(t);if((n===43||n===45)&&(n=e.charCodeAt(t+=1)),N(n)&&(t=pt(e,t+1),n=e.charCodeAt(t)),n===46&&N(e.charCodeAt(t+1))&&(t+=2,t=pt(e,t)),lt(e,t,101)){let r=0;n=e.charCodeAt(t+1),(n===45||n===43)&&(r=1,n=e.charCodeAt(t+2)),N(n)&&(t=pt(e,t+1+r+1))}return t}function gt(e,t){for(;t<e.length;t++){let n=e.charCodeAt(t);if(n===41){t++;break}I(n,L(e,t+1))&&(t=R(e,t))}return t}function _t(e){if(e.length===1&&!P(e.charCodeAt(0)))return e[0];let t=parseInt(e,16);return(t===0||t>=55296&&t<=57343||t>1114111)&&(t=65533),String.fromCodePoint(t)}const vt=/* @__PURE__ */ `EOF-token.ident-token.function-token.at-keyword-token.hash-token.string-token.bad-string-token.url-token.bad-url-token.delim-token.number-token.percentage-token.dimension-token.whitespace-token.CDO-token.CDC-token.colon-token.semicolon-token.comma-token.[-token.]-token.(-token.)-token.{-token.}-token.comment-token`.split(`.`);function yt(e=null,t){return e===null||e.length<t?new Uint32Array(Math.max(t+1024,16384)):e}function bt(e){let t=e.source,n=t.length,r=t.length>0?at(t.charCodeAt(0)):0,i=yt(e.lines,n),a=yt(e.columns,n),o=e.startLine,s=e.startColumn;for(let e=r;e<n;e++){let r=t.charCodeAt(e);i[e]=o,a[e]=s++,(r===10||r===13||r===12)&&(r===13&&e+1<n&&t.charCodeAt(e+1)===10&&(e++,i[e]=o,a[e]=s),o++,s=1)}i[n]=o,a[n]=s,e.lines=i,e.columns=a,e.computed=!0}var xt=class{constructor(e,t,n,r){this.setSource(e,t,n,r),this.lines=null,this.columns=null}setSource(e=``,t=0,n=1,r=1){this.source=e,this.startOffset=t,this.startLine=n,this.startColumn=r,this.computed=!1}getLocation(e,t){return this.computed||bt(this),{source:t,offset:this.startOffset+e,line:this.lines[e],column:this.columns[e]}}getLocationRange(e,t,n){return this.computed||bt(this),{source:n,start:{offset:this.startOffset+e,line:this.lines[e],column:this.columns[e]},end:{offset:this.startOffset+t,line:this.lines[t],column:this.columns[t]}}}};const z=16777215,B=/* @__PURE__ */ new Uint8Array(32);B[2]=22,B[21]=22,B[19]=20,B[23]=24;function St(e){return B[e]!==0}var Ct=class{constructor(e,t){this.setSource(e,t)}reset(){this.eof=!1,this.tokenIndex=-1,this.tokenType=0,this.tokenStart=this.firstCharOffset,this.tokenEnd=this.firstCharOffset}setSource(e=``,t=()=>{}){e=String(e||``);let n=e.length,r=yt(this.offsetAndType,e.length+1),i=yt(this.balance,e.length+1),a=0,o=-1,s=0,c=e.length;this.offsetAndType=null,this.balance=null,i.fill(0),t(e,(e,t,n)=>{let l=a++;if(r[l]=e<<24|n,o===-1&&(o=t),i[l]=c,e===s){let e=i[c];i[c]=l,c=e,s=B[r[e]>>24]}else St(e)&&(c=l,s=B[e])}),r[a]=0|n,i[a]=a;for(let e=0;e<a;e++){let t=i[e];if(t<=e){let n=i[t];n!==e&&(i[e]=n)}else t>a&&(i[e]=a)}this.source=e,this.firstCharOffset=o===-1?0:o,this.tokenCount=a,this.offsetAndType=r,this.balance=i,this.reset(),this.next()}lookupType(e){return e+=this.tokenIndex,e<this.tokenCount?this.offsetAndType[e]>>24:0}lookupTypeNonSC(e){for(let t=this.tokenIndex;t<this.tokenCount;t++){let n=this.offsetAndType[t]>>24;if(n!==13&&n!==25&&e--===0)return n}return 0}lookupOffset(e){return e+=this.tokenIndex,e<this.tokenCount?this.offsetAndType[e-1]&z:this.source.length}lookupOffsetNonSC(e){for(let t=this.tokenIndex;t<this.tokenCount;t++){let n=this.offsetAndType[t]>>24;if(n!==13&&n!==25&&e--===0)return t-this.tokenIndex}return 0}lookupValue(e,t){return e+=this.tokenIndex,e<this.tokenCount&&ut(this.source,this.offsetAndType[e-1]&z,this.offsetAndType[e]&z,t)}getTokenStart(e){return e===this.tokenIndex?this.tokenStart:e>0?e<this.tokenCount?this.offsetAndType[e-1]&z:this.offsetAndType[this.tokenCount]&z:this.firstCharOffset}substrToCursor(e){return this.source.substring(e,this.tokenStart)}isBalanceEdge(e){return this.balance[this.tokenIndex]<e}isDelim(e,t){return t?this.lookupType(t)===9&&this.source.charCodeAt(this.lookupOffset(t))===e:this.tokenType===9&&this.source.charCodeAt(this.tokenStart)===e}skip(e){let t=this.tokenIndex+e;t<this.tokenCount?(this.tokenIndex=t,this.tokenStart=this.offsetAndType[t-1]&z,t=this.offsetAndType[t],this.tokenType=t>>24,this.tokenEnd=t&z):(this.tokenIndex=this.tokenCount,this.next())}next(){let e=this.tokenIndex+1;e<this.tokenCount?(this.tokenIndex=e,this.tokenStart=this.tokenEnd,e=this.offsetAndType[e],this.tokenType=e>>24,this.tokenEnd=e&z):(this.eof=!0,this.tokenIndex=this.tokenCount,this.tokenType=0,this.tokenStart=this.tokenEnd=this.source.length)}skipSC(){for(;this.tokenType===13||this.tokenType===25;)this.next()}skipUntilBalanced(e,t){let n=e,r=0,i=0;t:for(;n<this.tokenCount;n++){if(r=this.balance[n],r<e)break t;switch(i=n>0?this.offsetAndType[n-1]&z:this.firstCharOffset,t(this.source.charCodeAt(i))){case 1:break t;case 2:n++;break t;default:St(this.offsetAndType[n]>>24)&&(n=r)}}this.skip(n-this.tokenIndex)}forEachToken(e){for(let t=0,n=this.firstCharOffset;t<this.tokenCount;t++){let r=n,i=this.offsetAndType[t],a=i&z,o=i>>24;n=a,e(o,r,a,t)}}dump(){let e=Array(this.tokenCount);return this.forEachToken((t,n,r,i)=>{e[i]={idx:i,type:vt[t],chunk:this.source.substring(n,r),balance:this.balance[i]}}),e}};function wt(e,t){function n(t){return t<s?e.charCodeAt(t):0}function r(){if(l=ht(e,l),rt(n(l),n(l+1),n(l+2))){u=12,l=mt(e,l);return}if(n(l)===37){u=11,l++;return}u=10}function i(){let t=l;if(l=mt(e,l),ut(e,t,l,`url`)&&n(l)===40){if(l=ft(e,l+1),n(l)===34||n(l)===39){u=2,l=t+4;return}o();return}if(n(l)===40){u=2,l++;return}u=1}function a(t){for(t||=n(l++),u=5;l<e.length;l++){let r=e.charCodeAt(l);switch(st(r)){case t:l++;return;case 130:if(nt(r)){l+=ct(e,l,r),u=6;return}break;case 92:if(l===e.length-1)break;let i=n(l+1);nt(i)?l+=ct(e,l+1,i):I(r,i)&&(l=R(e,l)-1)}}}function o(){for(u=7,l=ft(e,l);l<e.length;l++){let t=e.charCodeAt(l);switch(st(t)){case 41:l++;return;case 130:if(l=ft(e,l),n(l)===41||l>=e.length){l<e.length&&l++;return}l=gt(e,l),u=8;return;case 34:case 39:case 40:case 133:l=gt(e,l),u=8;return;case 92:if(I(t,n(l+1))){l=R(e,l)-1;break}l=gt(e,l),u=8;return}}}e=String(e||``);let s=e.length,c=at(n(0)),l=c,u;for(;l<s;){let o=e.charCodeAt(l);switch(st(o)){case 130:u=13,l=ft(e,l+1);break;case 34:a();break;case 35:et(n(l+1))||I(n(l+1),n(l+2))?(u=4,l=mt(e,l+1)):(u=9,l++);break;case 39:a();break;case 40:u=21,l++;break;case 41:u=22,l++;break;case 43:it(o,n(l+1),n(l+2))?r():(u=9,l++);break;case 44:u=18,l++;break;case 45:it(o,n(l+1),n(l+2))?r():n(l+1)===45&&n(l+2)===62?(u=15,l+=3):rt(o,n(l+1),n(l+2))?i():(u=9,l++);break;case 46:it(o,n(l+1),n(l+2))?r():(u=9,l++);break;case 47:n(l+1)===42?(u=25,l=e.indexOf(`*/`,l+2),l=l===-1?e.length:l+2):(u=9,l++);break;case 58:u=16,l++;break;case 59:u=17,l++;break;case 60:n(l+1)===33&&n(l+2)===45&&n(l+3)===45?(u=14,l+=4):(u=9,l++);break;case 64:rt(n(l+1),n(l+2),n(l+3))?(u=3,l=mt(e,l+1)):(u=9,l++);break;case 91:u=19,l++;break;case 92:I(o,n(l+1))?i():(u=9,l++);break;case 93:u=20,l++;break;case 123:u=23,l++;break;case 125:u=24,l++;break;case 131:r();break;case 132:i();break;default:u=9,l++}t(u,c,c=l)}}function Tt(e,t){return t||=0,e.length-t>=2&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===45}function Et(e){let t=e.length,n=e.charCodeAt(0),r=+(n===34||n===39),i=r===1&&t>1&&e.charCodeAt(t-1)===n?t-2:t-1,a=``;for(let n=r;n<=i;n++){let r=e.charCodeAt(n);if(r===92){if(n===i){n!==t-1&&(a=e.substr(n+1));break}if(r=e.charCodeAt(++n),I(92,r)){let t=n-1,r=R(e,t);n=r-1,a+=_t(e.substring(t+1,r))}else r===13&&e.charCodeAt(n+1)===10&&n++}else a+=e[n]}return a}function Dt(e,t){let n=``,r=!1;for(let t=0;t<e.length;t++){let i=e.charCodeAt(t);if(i===0){n+=`�`;continue}if(i<=31||i===127){n+=`\\`+i.toString(16),r=!0;continue}i===34||i===92?(n+=`\\`+e.charAt(t),r=!1):(r&&(P(i)||F(i))&&(n+=` `),n+=e.charAt(t),r=!1)}return`"`+n+`"`}function Ot(e){let t=e.length,n=4,r=e.charCodeAt(t-1)===41?t-2:t-1,i=``;for(;n<r&&F(e.charCodeAt(n));)n++;for(;n<r&&F(e.charCodeAt(r));)r--;for(let a=n;a<=r;a++){let n=e.charCodeAt(a);if(n===92){if(a===r){a!==t-1&&(i=e.substr(a+1));break}if(n=e.charCodeAt(++a),I(92,n)){let t=a-1,n=R(e,t);a=n-1,i+=_t(e.substring(t+1,n))}else n===13&&e.charCodeAt(a+1)===10&&a++}else i+=e[a]}return i}function kt(e){let t=``,n=!1;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);if(i===0){t+=`�`;continue}if(i<=31||i===127){t+=`\\`+i.toString(16),n=!0;continue}i===32||i===92||i===34||i===39||i===40||i===41?(t+=`\\`+e.charAt(r),n=!1):(n&&P(i)&&(t+=` `),t+=e.charAt(r),n=!1)}return`url(`+t+`)`}const{hasOwnProperty:At}=Object.prototype,V=function(){};function jt(e){return typeof e==`function`?e:V}function Mt(e,t){return function(n,r,i){n.type===t&&e.call(this,n,r,i)}}function Nt(e,t){let n=t.structure,r=[];for(let e in n){if(At.call(n,e)===!1)continue;let t=n[e],i={name:e,type:!1,nullable:!1};Array.isArray(t)||(t=[t]);for(let e of t)e===null?i.nullable=!0:typeof e==`string`?i.type=`node`:Array.isArray(e)&&(i.type=`list`);i.type&&r.push(i)}return r.length?{context:t.walkContext,fields:r}:null}function Pt(e){let t={};for(let n in e.node)if(At.call(e.node,n)){let r=e.node[n];if(!r.structure)throw Error("Missed `structure` field in `"+n+"` node type definition");t[n]=Nt(n,r)}return t}function Ft(e,t){let n=e.fields.slice(),r=e.context,i=typeof r==`string`;return t&&n.reverse(),function(e,a,o,s){let c;i&&(c=a[r],a[r]=e);for(let r of n){let n=e[r.name];if(!r.nullable||n){if(r.type===`list`){if(t?n.reduceRight(s,!1):n.reduce(s,!1))return!0}else if(o(n))return!0}}i&&(a[r]=c)}}function It({StyleSheet:e,Atrule:t,Rule:n,Block:r,DeclarationList:i}){return{Atrule:{StyleSheet:e,Atrule:t,Rule:n,Block:r},Rule:{StyleSheet:e,Atrule:t,Rule:n,Block:r},Declaration:{StyleSheet:e,Atrule:t,Rule:n,Block:r,DeclarationList:i}}}function Lt(e){let t=Pt(e),n={},r={},i=/* @__PURE__ */ Symbol(`break-walk`),a=/* @__PURE__ */ Symbol(`skip-node`);for(let e in t)At.call(t,e)&&t[e]!==null&&(n[e]=Ft(t[e],!1),r[e]=Ft(t[e],!0));let o=It(n),s=It(r),c=function(e,c){function l(e,t,n){let r=u.call(m,e,t,n);return r===i||r!==a&&!!(f.hasOwnProperty(e.type)&&f[e.type](e,m,l,p)||d.call(m,e,t,n)===i)}let u=V,d=V,f=n,p=(e,t,n,r)=>e||l(t,n,r),m={break:i,skip:a,root:e,stylesheet:null,atrule:null,atrulePrelude:null,rule:null,selector:null,block:null,declaration:null,function:null};if(typeof c==`function`)u=c;else if(c&&(u=jt(c.enter),d=jt(c.leave),c.reverse&&(f=r),c.visit)){if(o.hasOwnProperty(c.visit))f=c.reverse?s[c.visit]:o[c.visit];else if(!t.hasOwnProperty(c.visit))throw Error("Bad value `"+c.visit+"` for `visit` option (should be: "+Object.keys(t).sort().join(`, `)+`)`);u=Mt(u,c.visit),d=Mt(d,c.visit)}if(u===V&&d===V)throw Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");l(e)};return c.break=i,c.skip=a,c.find=function(e,t){let n=null;return c(e,function(e,r,a){if(t.call(this,e,r,a))return n=e,i}),n},c.findLast=function(e,t){let n=null;return c(e,{reverse:!0,enter(e,r,a){if(t.call(this,e,r,a))return n=e,i}}),n},c.findAll=function(e,t){let n=[];return c(e,function(e,r,i){t.call(this,e,r,i)&&n.push(e)}),n},c}function Rt(e,t){let n=this.tokenStart+e,r=this.charCodeAt(n);for((r===43||r===45)&&(t&&this.error(`Number sign is not allowed`),n++);n<this.tokenEnd;n++)N(this.charCodeAt(n))||this.error(`Integer is expected`,n)}function H(e){return Rt.call(this,0,e)}function U(e,t){if(!this.cmpChar(this.tokenStart+e,t)){let n=``;switch(t){case 110:n=`N is expected`;break;case 45:n=`HyphenMinus is expected`}this.error(n,this.tokenStart+e)}}function zt(){let e=0,t=0,n=this.tokenType;for(;n===13||n===25;)n=this.lookupType(++e);if(n!==10){if(this.isDelim(43,e)||this.isDelim(45,e)){t=this.isDelim(43,e)?43:45;do n=this.lookupType(++e);while(n===13||n===25);n!==10&&(this.skip(e),H.call(this,!0))}else return null}return e>0&&this.skip(e),t===0&&(n=this.charCodeAt(this.tokenStart),n!==43&&n!==45&&this.error(`Number sign is expected`)),H.call(this,t!==0),t===45?`-`+this.consume(10):this.consume(10)}const Bt={a:[String,null],b:[String,null]};function Vt(){let e=this.tokenStart,t=null,n=null;if(this.tokenType===10)H.call(this,!1),n=this.consume(10);else if(this.tokenType===1&&this.cmpChar(this.tokenStart,45))switch(t=`-1`,U.call(this,1,110),this.tokenEnd-this.tokenStart){case 2:this.next(),n=zt.call(this);break;case 3:U.call(this,2,45),this.next(),this.skipSC(),H.call(this,!0),n=`-`+this.consume(10);break;default:U.call(this,2,45),Rt.call(this,3,!0),this.next(),n=this.substrToCursor(e+2)}else if(this.tokenType===1||this.isDelim(43)&&this.lookupType(1)===1){let r=0;switch(t=`1`,this.isDelim(43)&&(r=1,this.next()),U.call(this,0,110),this.tokenEnd-this.tokenStart){case 1:this.next(),n=zt.call(this);break;case 2:U.call(this,1,45),this.next(),this.skipSC(),H.call(this,!0),n=`-`+this.consume(10);break;default:U.call(this,1,45),Rt.call(this,2,!0),this.next(),n=this.substrToCursor(e+r+1)}}else if(this.tokenType===12){let r=this.charCodeAt(this.tokenStart),i=r===43||r===45,a=this.tokenStart+i;for(;a<this.tokenEnd&&N(this.charCodeAt(a));a++);a===this.tokenStart+i&&this.error(`Integer is expected`,this.tokenStart+i),U.call(this,a-this.tokenStart,110),t=this.substring(e,a),a+1===this.tokenEnd?(this.next(),n=zt.call(this)):(U.call(this,a-this.tokenStart+1,45),a+2===this.tokenEnd?(this.next(),this.skipSC(),H.call(this,!0),n=`-`+this.consume(10)):(Rt.call(this,a-this.tokenStart+2,!0),this.next(),n=this.substrToCursor(a+1)))}else this.error();return t!==null&&t.charCodeAt(0)===43&&(t=t.substr(1)),n!==null&&n.charCodeAt(0)===43&&(n=n.substr(1)),{type:`AnPlusB`,loc:this.getLocation(e,this.tokenStart),a:t,b:n}}function Ht(e){if(e.a){let t=e.a===`+1`&&`n`||e.a===`1`&&`n`||e.a===`-1`&&`-n`||e.a+`n`;if(e.b){let n=e.b[0]===`-`||e.b[0]===`+`?e.b:`+`+e.b;this.tokenize(t+n)}else this.tokenize(t)}else this.tokenize(e.b)}const Ut=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:Ht,name:`AnPlusB`,parse:Vt,structure:Bt},Symbol.toStringTag,{value:`Module`}));function Wt(){return this.Raw(this.consumeUntilLeftCurlyBracketOrSemicolon,!0)}function Gt(){for(let e=1,t;t=this.lookupType(e);e++){if(t===24)return!0;if(t===23||t===3)return!1}return!1}const Kt={name:String,prelude:[`AtrulePrelude`,`Raw`,null],block:[`Block`,null]};function qt(e=!1){let t=this.tokenStart,n,r,i=null,a=null;switch(this.eat(3),n=this.substrToCursor(t+1),r=n.toLowerCase(),this.skipSC(),this.eof===!1&&this.tokenType!==23&&this.tokenType!==17&&(i=this.parseAtrulePrelude?this.parseWithFallback(this.AtrulePrelude.bind(this,n,e),Wt):Wt.call(this,this.tokenIndex),this.skipSC()),this.tokenType){case 17:this.next();break;case 23:a=hasOwnProperty.call(this.atrule,r)&&typeof this.atrule[r].block==`function`?this.atrule[r].block.call(this,e):this.Block(Gt.call(this))}return{type:`Atrule`,loc:this.getLocation(t,this.tokenStart),name:n,prelude:i,block:a}}function Jt(e){this.token(3,`@`+e.name),e.prelude!==null&&this.node(e.prelude),e.block?this.node(e.block):this.token(17,`;`)}const Yt=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:Jt,name:`Atrule`,parse:qt,structure:Kt,walkContext:`atrule`},Symbol.toStringTag,{value:`Module`})),Xt={children:[[]]};function Zt(e){let t=null;return e!==null&&(e=e.toLowerCase()),this.skipSC(),t=hasOwnProperty.call(this.atrule,e)&&typeof this.atrule[e].prelude==`function`?this.atrule[e].prelude.call(this):this.readSequence(this.scope.AtrulePrelude),this.skipSC(),this.eof!==!0&&this.tokenType!==23&&this.tokenType!==17&&this.error(`Semicolon or block is expected`),{type:`AtrulePrelude`,loc:this.getLocationFromList(t),children:t}}function Qt(e){this.children(e)}const $t=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:Qt,name:`AtrulePrelude`,parse:Zt,structure:Xt,walkContext:`atrulePrelude`},Symbol.toStringTag,{value:`Module`}));function en(){this.eof&&this.error(`Unexpected end of input`);let e=this.tokenStart,t=!1;return this.isDelim(42)?(t=!0,this.next()):this.isDelim(124)||this.eat(1),this.isDelim(124)?this.charCodeAt(this.tokenStart+1)===61?t&&this.error(`Identifier is expected`,this.tokenEnd):(this.next(),this.eat(1)):t&&this.error(`Vertical line is expected`),{type:`Identifier`,loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function tn(){let e=this.tokenStart,t=this.charCodeAt(e);return t!==61&&t!==126&&t!==94&&t!==36&&t!==42&&t!==124&&this.error(`Attribute selector (=, ~=, ^=, $=, *=, |=) is expected`),this.next(),t!==61&&(this.isDelim(61)||this.error(`Equal sign is expected`),this.next()),this.substrToCursor(e)}const nn={name:`Identifier`,matcher:[String,null],value:[`String`,`Identifier`,null],flags:[String,null]};function rn(){let e=this.tokenStart,t,n=null,r=null,i=null;return this.eat(19),this.skipSC(),t=en.call(this),this.skipSC(),this.tokenType!==20&&(this.tokenType!==1&&(n=tn.call(this),this.skipSC(),r=this.tokenType===5?this.String():this.Identifier(),this.skipSC()),this.tokenType===1&&(i=this.consume(1),this.skipSC())),this.eat(20),{type:`AttributeSelector`,loc:this.getLocation(e,this.tokenStart),name:t,matcher:n,value:r,flags:i}}function an(e){this.token(9,`[`),this.node(e.name),e.matcher!==null&&(this.tokenize(e.matcher),this.node(e.value)),e.flags!==null&&this.token(1,e.flags),this.token(9,`]`)}const on=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:an,name:`AttributeSelector`,parse:rn,structure:nn},Symbol.toStringTag,{value:`Module`}));function sn(){return this.Raw(null,!0)}function cn(){return this.parseWithFallback(this.Rule,sn)}function ln(){return this.Raw(this.consumeUntilSemicolonIncluded,!0)}function un(){if(this.tokenType===17)return ln.call(this,this.tokenIndex);let e=this.parseWithFallback(this.Declaration,ln);return this.tokenType===17&&this.next(),e}const dn={children:[[`Atrule`,`Rule`,`Declaration`]]};function fn(e){let t=e?un:cn,n=this.tokenStart,r=this.createList();this.eat(23);t:for(;!this.eof;)switch(this.tokenType){case 24:break t;case 13:case 25:this.next();break;case 3:r.push(this.parseWithFallback(this.Atrule.bind(this,e),sn));break;default:e&&this.isDelim(38)?r.push(cn.call(this)):r.push(t.call(this))}return this.eof||this.eat(24),{type:`Block`,loc:this.getLocation(n,this.tokenStart),children:r}}function pn(e){this.token(23,`{`),this.children(e,e=>{e.type===`Declaration`&&this.token(17,`;`)}),this.token(24,`}`)}const mn=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:pn,name:`Block`,parse:fn,structure:dn,walkContext:`block`},Symbol.toStringTag,{value:`Module`})),hn={children:[[]]};function gn(e,t){let n=this.tokenStart,r=null;return this.eat(19),r=e.call(this,t),this.eof||this.eat(20),{type:`Brackets`,loc:this.getLocation(n,this.tokenStart),children:r}}function _n(e){this.token(9,`[`),this.children(e),this.token(9,`]`)}const vn=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:_n,name:`Brackets`,parse:gn,structure:hn},Symbol.toStringTag,{value:`Module`})),yn=[];function bn(){let e=this.tokenStart;return this.eat(15),{type:`CDC`,loc:this.getLocation(e,this.tokenStart)}}function xn(){this.token(15,`-->`)}const Sn=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:xn,name:`CDC`,parse:bn,structure:yn},Symbol.toStringTag,{value:`Module`})),Cn=[];function wn(){let e=this.tokenStart;return this.eat(14),{type:`CDO`,loc:this.getLocation(e,this.tokenStart)}}function Tn(){this.token(14,`<!--`)}const En=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:Tn,name:`CDO`,parse:wn,structure:Cn},Symbol.toStringTag,{value:`Module`})),Dn={name:String};function On(){return this.eatDelim(46),{type:`ClassSelector`,loc:this.getLocation(this.tokenStart-1,this.tokenEnd),name:this.consume(1)}}function kn(e){this.token(9,`.`),this.token(1,e.name)}const An=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:kn,name:`ClassSelector`,parse:On,structure:Dn},Symbol.toStringTag,{value:`Module`})),jn={name:String};function Mn(){let e=this.tokenStart,t;switch(this.tokenType){case 13:t=` `;break;case 9:switch(this.charCodeAt(this.tokenStart)){case 62:case 43:case 126:this.next();break;case 47:this.next(),this.eatIdent(`deep`),this.eatDelim(47);break;default:this.error(`Combinator is expected`)}t=this.substrToCursor(e)}return{type:`Combinator`,loc:this.getLocation(e,this.tokenStart),name:t}}function Nn(e){this.tokenize(e.name)}const Pn=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:Nn,name:`Combinator`,parse:Mn,structure:jn},Symbol.toStringTag,{value:`Module`})),Fn={value:String};function In(){let e=this.tokenStart,t=this.tokenEnd;return this.eat(25),t-e+2>=2&&this.charCodeAt(t-2)===42&&this.charCodeAt(t-1)===47&&(t-=2),{type:`Comment`,loc:this.getLocation(e,this.tokenStart),value:this.substring(e+2,t)}}function Ln(e){this.token(25,`/*`+e.value+`*/`)}const Rn=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:Ln,name:`Comment`,parse:In,structure:Fn},Symbol.toStringTag,{value:`Module`})),zn=/* @__PURE__ */ new Set([16,22,0]),Bn={kind:String,children:[[`Identifier`,`Feature`,`FeatureFunction`,`FeatureRange`,`SupportsDeclaration`]]};function Vn(e){return this.lookupTypeNonSC(1)===1&&zn.has(this.lookupTypeNonSC(2))?this.Feature(e):this.FeatureRange(e)}const Hn={media:Vn,container:Vn,supports(){return this.SupportsDeclaration()}};function Un(e=`media`){let t=this.createList();t:for(;!this.eof;)switch(this.tokenType){case 25:case 13:this.next();continue;case 1:t.push(this.Identifier());break;case 21:{let n=this.parseWithFallback(()=>Hn[e].call(this,e),()=>null);n||=this.parseWithFallback(()=>{this.eat(21);let t=this.Condition(e);return this.eat(22),t},()=>this.GeneralEnclosed(e)),t.push(n);break}case 2:{let n=this.parseWithFallback(()=>this.FeatureFunction(e),()=>null);n||=this.GeneralEnclosed(e),t.push(n);break}default:break t}return t.isEmpty&&this.error(`Condition is expected`),{type:`Condition`,loc:this.getLocationFromList(t),kind:e,children:t}}function Wn(e){e.children.forEach(e=>{e.type===`Condition`?(this.token(21,`(`),this.node(e),this.token(22,`)`)):this.node(e)})}const Gn=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:Wn,name:`Condition`,parse:Un,structure:Bn},Symbol.toStringTag,{value:`Module`}));function Kn(){return this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!0)}function qn(){return this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!1)}function Jn(){let e=this.tokenIndex,t=this.Value();return t.type!==`Raw`&&this.eof===!1&&this.tokenType!==17&&this.isDelim(33)===!1&&this.isBalanceEdge(e)===!1&&this.error(),t}const Yn={important:[Boolean,String],property:String,value:[`Value`,`Raw`]};function Xn(){let e=this.tokenStart,t=this.tokenIndex,n=Qn.call(this),r=Tt(n),i=r?this.parseCustomProperty:this.parseValue,a=r?qn:Kn,o=!1,s;this.skipSC(),this.eat(16);let c=this.tokenIndex;if(r||this.skipSC(),s=i?this.parseWithFallback(Jn,a):a.call(this,this.tokenIndex),r&&s.type===`Value`&&s.children.isEmpty){for(let e=c-this.tokenIndex;e<=0;e++)if(this.lookupType(e)===13){s.children.appendData({type:`WhiteSpace`,loc:null,value:` `});break}}return this.isDelim(33)&&(o=$n.call(this),this.skipSC()),this.eof===!1&&this.tokenType!==17&&this.isBalanceEdge(t)===!1&&this.error(),{type:`Declaration`,loc:this.getLocation(e,this.tokenStart),important:o,property:n,value:s}}function Zn(e){this.token(1,e.property),this.token(16,`:`),this.node(e.value),e.important&&(this.token(9,`!`),this.token(1,e.important===!0?`important`:e.important))}function Qn(){let e=this.tokenStart;if(this.tokenType===9)switch(this.charCodeAt(this.tokenStart)){case 42:case 36:case 43:case 35:case 38:this.next();break;case 47:this.next(),this.isDelim(47)&&this.next()}return this.tokenType===4?this.eat(4):this.eat(1),this.substrToCursor(e)}function $n(){this.eat(9),this.skipSC();let e=this.consume(1);return e===`important`||e}const er=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:Zn,name:`Declaration`,parse:Xn,structure:Yn,walkContext:`declaration`},Symbol.toStringTag,{value:`Module`}));function tr(){return this.Raw(this.consumeUntilSemicolonIncluded,!0)}const nr={children:[[`Declaration`,`Atrule`,`Rule`]]};function rr(){let e=this.createList();for(;!this.eof;)switch(this.tokenType){case 13:case 25:case 17:this.next();break;case 3:e.push(this.parseWithFallback(this.Atrule.bind(this,!0),tr));break;default:this.isDelim(38)?e.push(this.parseWithFallback(this.Rule,tr)):e.push(this.parseWithFallback(this.Declaration,tr))}return{type:`DeclarationList`,loc:this.getLocationFromList(e),children:e}}function ir(e){this.children(e,e=>{e.type===`Declaration`&&this.token(17,`;`)})}const ar=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:ir,name:`DeclarationList`,parse:rr,structure:nr},Symbol.toStringTag,{value:`Module`})),or={value:String,unit:String};function sr(){let e=this.tokenStart,t=this.consumeNumber(12);return{type:`Dimension`,loc:this.getLocation(e,this.tokenStart),value:t,unit:this.substring(e+t.length,this.tokenStart)}}function cr(e){this.token(12,e.value+e.unit)}const lr=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:cr,name:`Dimension`,parse:sr,structure:or},Symbol.toStringTag,{value:`Module`})),ur={kind:String,name:String,value:[`Identifier`,`Number`,`Dimension`,`Ratio`,`Function`,null]};function dr(e){let t=this.tokenStart,n,r=null;if(this.eat(21),this.skipSC(),n=this.consume(1),this.skipSC(),this.tokenType!==22){switch(this.eat(16),this.skipSC(),this.tokenType){case 10:r=this.lookupNonWSType(1)===9?this.Ratio():this.Number();break;case 12:r=this.Dimension();break;case 1:r=this.Identifier();break;case 2:r=this.parseWithFallback(()=>{let e=this.Function(this.readSequence,this.scope.Value);return this.skipSC(),this.isDelim(47)&&this.error(),e},()=>this.Ratio());break;default:this.error(`Number, dimension, ratio or identifier is expected`)}this.skipSC()}return this.eof||this.eat(22),{type:`Feature`,loc:this.getLocation(t,this.tokenStart),kind:e,name:n,value:r}}function fr(e){this.token(21,`(`),this.token(1,e.name),e.value!==null&&(this.token(16,`:`),this.node(e.value)),this.token(22,`)`)}const pr=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:fr,name:`Feature`,parse:dr,structure:ur},Symbol.toStringTag,{value:`Module`})),mr={kind:String,feature:String,value:[`Declaration`,`Selector`]};function hr(e,t){let n=(this.features[e]||{})[t];return typeof n!=`function`&&this.error(`Unknown feature ${t}()`),n}function gr(e=`unknown`){let t=this.tokenStart,n=this.consumeFunctionName(),r=hr.call(this,e,n.toLowerCase());this.skipSC();let i=this.parseWithFallback(()=>{let e=this.tokenIndex,t=r.call(this);return this.eof===!1&&this.isBalanceEdge(e)===!1&&this.error(),t},()=>this.Raw(null,!1));return this.eof||this.eat(22),{type:`FeatureFunction`,loc:this.getLocation(t,this.tokenStart),kind:e,feature:n,value:i}}function _r(e){this.token(2,e.feature+`(`),this.node(e.value),this.token(22,`)`)}const vr=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:_r,name:`FeatureFunction`,parse:gr,structure:mr},Symbol.toStringTag,{value:`Module`})),yr={kind:String,left:[`Identifier`,`Number`,`Dimension`,`Ratio`,`Function`],leftComparison:String,middle:[`Identifier`,`Number`,`Dimension`,`Ratio`,`Function`],rightComparison:[String,null],right:[`Identifier`,`Number`,`Dimension`,`Ratio`,`Function`,null]};function br(){switch(this.skipSC(),this.tokenType){case 10:return this.isDelim(47,this.lookupOffsetNonSC(1))?this.Ratio():this.Number();case 12:return this.Dimension();case 1:return this.Identifier();case 2:return this.parseWithFallback(()=>{let e=this.Function(this.readSequence,this.scope.Value);return this.skipSC(),this.isDelim(47)&&this.error(),e},()=>this.Ratio());default:this.error(`Number, dimension, ratio or identifier is expected`)}}function xr(e){if(this.skipSC(),this.isDelim(60)||this.isDelim(62)){let e=this.source[this.tokenStart];return this.next(),this.isDelim(61)?(this.next(),e+`=`):e}if(this.isDelim(61))return`=`;this.error(`Expected ${e?`":", `:``}"<", ">", "=" or ")"`)}function Sr(e=`unknown`){let t=this.tokenStart;this.skipSC(),this.eat(21);let n=br.call(this),r=xr.call(this,n.type===`Identifier`),i=br.call(this),a=null,o=null;return this.lookupNonWSType(0)!==22&&(a=xr.call(this),o=br.call(this)),this.skipSC(),this.eat(22),{type:`FeatureRange`,loc:this.getLocation(t,this.tokenStart),kind:e,left:n,leftComparison:r,middle:i,rightComparison:a,right:o}}function Cr(e){this.token(21,`(`),this.node(e.left),this.tokenize(e.leftComparison),this.node(e.middle),e.right&&(this.tokenize(e.rightComparison),this.node(e.right)),this.token(22,`)`)}const wr=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:Cr,name:`FeatureRange`,parse:Sr,structure:yr},Symbol.toStringTag,{value:`Module`})),Tr={name:String,children:[[]]};function Er(e,t){let n=this.tokenStart,r=this.consumeFunctionName(),i=r.toLowerCase(),a;return a=t.hasOwnProperty(i)?t[i].call(this,t):e.call(this,t),this.eof||this.eat(22),{type:`Function`,loc:this.getLocation(n,this.tokenStart),name:r,children:a}}function Dr(e){this.token(2,e.name+`(`),this.children(e),this.token(22,`)`)}const Or=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:Dr,name:`Function`,parse:Er,structure:Tr,walkContext:`function`},Symbol.toStringTag,{value:`Module`})),kr={kind:String,function:[String,null],children:[[]]};function Ar(e){let t=this.tokenStart,n=null;this.tokenType===2?n=this.consumeFunctionName():this.eat(21);let r=this.parseWithFallback(()=>{let e=this.tokenIndex,t=this.readSequence(this.scope.Value);return this.eof===!1&&this.isBalanceEdge(e)===!1&&this.error(),t},()=>this.createSingleNodeList(this.Raw(null,!1)));return this.eof||this.eat(22),{type:`GeneralEnclosed`,loc:this.getLocation(t,this.tokenStart),kind:e,function:n,children:r}}function jr(e){e.function?this.token(2,e.function+`(`):this.token(21,`(`),this.children(e),this.token(22,`)`)}const Mr=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:jr,name:`GeneralEnclosed`,parse:Ar,structure:kr},Symbol.toStringTag,{value:`Module`})),Nr={value:String};function Pr(){let e=this.tokenStart;return this.eat(4),{type:`Hash`,loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e+1)}}function Fr(e){this.token(4,`#`+e.value)}const Ir=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:Fr,name:`Hash`,parse:Pr,structure:Nr,xxx:`XXX`},Symbol.toStringTag,{value:`Module`})),Lr={name:String};function Rr(){return{type:`Identifier`,loc:this.getLocation(this.tokenStart,this.tokenEnd),name:this.consume(1)}}function zr(e){this.token(1,e.name)}const Br=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:zr,name:`Identifier`,parse:Rr,structure:Lr},Symbol.toStringTag,{value:`Module`})),Vr={name:String};function Hr(){let e=this.tokenStart;return this.eat(4),{type:`IdSelector`,loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e+1)}}function Ur(e){this.token(9,`#`+e.name)}const Wr=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:Ur,name:`IdSelector`,parse:Hr,structure:Vr},Symbol.toStringTag,{value:`Module`})),Gr={name:String};function Kr(){let e=this.tokenStart,t=this.consume(1);for(;this.isDelim(46);)this.eat(9),t+=`.`+this.consume(1);return{type:`Layer`,loc:this.getLocation(e,this.tokenStart),name:t}}function qr(e){this.tokenize(e.name)}const Jr=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:qr,name:`Layer`,parse:Kr,structure:Gr},Symbol.toStringTag,{value:`Module`})),Yr={children:[[`Layer`]]};function Xr(){let e=this.createList();for(this.skipSC();!this.eof&&(e.push(this.Layer()),this.lookupTypeNonSC(0)===18);)this.skipSC(),this.next(),this.skipSC();return{type:`LayerList`,loc:this.getLocationFromList(e),children:e}}function Zr(e){this.children(e,()=>this.token(18,`,`))}const Qr=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:Zr,name:`LayerList`,parse:Xr,structure:Yr},Symbol.toStringTag,{value:`Module`})),$r={modifier:[String,null],mediaType:[String,null],condition:[`Condition`,null]};function ei(){let e=this.tokenStart,t=null,n=null,r=null;if(this.skipSC(),this.tokenType===1&&this.lookupTypeNonSC(1)!==21){let e=this.consume(1),i=e.toLowerCase();switch(i===`not`||i===`only`?(this.skipSC(),t=i,n=this.consume(1)):n=e,this.lookupTypeNonSC(0)){case 1:this.skipSC(),this.eatIdent(`and`),r=this.Condition(`media`);break;case 23:case 17:case 18:case 0:break;default:this.error(`Identifier or parenthesis is expected`)}}else switch(this.tokenType){case 1:case 21:case 2:r=this.Condition(`media`);break;case 23:case 17:case 0:break;default:this.error(`Identifier or parenthesis is expected`)}return{type:`MediaQuery`,loc:this.getLocation(e,this.tokenStart),modifier:t,mediaType:n,condition:r}}function ti(e){e.mediaType?(e.modifier&&this.token(1,e.modifier),this.token(1,e.mediaType),e.condition&&(this.token(1,`and`),this.node(e.condition))):e.condition&&this.node(e.condition)}const ni=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:ti,name:`MediaQuery`,parse:ei,structure:$r},Symbol.toStringTag,{value:`Module`})),ri={children:[[`MediaQuery`]]};function ii(){let e=this.createList();for(this.skipSC();!this.eof&&(e.push(this.MediaQuery()),this.tokenType===18);)this.next();return{type:`MediaQueryList`,loc:this.getLocationFromList(e),children:e}}function ai(e){this.children(e,()=>this.token(18,`,`))}const oi=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:ai,name:`MediaQueryList`,parse:ii,structure:ri},Symbol.toStringTag,{value:`Module`})),si={};function ci(){let e=this.tokenStart;return this.eatDelim(38),{type:`NestingSelector`,loc:this.getLocation(e,this.tokenStart)}}function li(){this.token(9,`&`)}const ui=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:li,name:`NestingSelector`,parse:ci,structure:si},Symbol.toStringTag,{value:`Module`})),di={nth:[`AnPlusB`,`Identifier`],selector:[`SelectorList`,null]};function fi(){this.skipSC();let e=this.tokenStart,t=e,n=null,r;return r=this.lookupValue(0,`odd`)||this.lookupValue(0,`even`)?this.Identifier():this.AnPlusB(),t=this.tokenStart,this.skipSC(),this.lookupValue(0,`of`)&&(this.next(),n=this.SelectorList(),t=this.tokenStart),{type:`Nth`,loc:this.getLocation(e,t),nth:r,selector:n}}function pi(e){this.node(e.nth),e.selector!==null&&(this.token(1,`of`),this.node(e.selector))}const mi=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:pi,name:`Nth`,parse:fi,structure:di},Symbol.toStringTag,{value:`Module`})),hi={value:String};function gi(){return{type:`Number`,loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consume(10)}}function _i(e){this.token(10,e.value)}const vi=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:_i,name:`Number`,parse:gi,structure:hi},Symbol.toStringTag,{value:`Module`})),yi={value:String};function bi(){let e=this.tokenStart;return this.next(),{type:`Operator`,loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function xi(e){this.tokenize(e.value)}const Si=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:xi,name:`Operator`,parse:bi,structure:yi},Symbol.toStringTag,{value:`Module`})),Ci={children:[[]]};function wi(e,t){let n=this.tokenStart,r=null;return this.eat(21),r=e.call(this,t),this.eof||this.eat(22),{type:`Parentheses`,loc:this.getLocation(n,this.tokenStart),children:r}}function Ti(e){this.token(21,`(`),this.children(e),this.token(22,`)`)}const Ei=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:Ti,name:`Parentheses`,parse:wi,structure:Ci},Symbol.toStringTag,{value:`Module`})),Di={value:String};function Oi(){return{type:`Percentage`,loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consumeNumber(11)}}function ki(e){this.token(11,e.value+`%`)}const Ai=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:ki,name:`Percentage`,parse:Oi,structure:Di},Symbol.toStringTag,{value:`Module`})),ji={name:String,children:[[`Raw`],null]};function Mi(){let e=this.tokenStart,t=null,n,r;return this.eat(16),this.tokenType===2?(n=this.consumeFunctionName(),r=n.toLowerCase(),this.lookupNonWSType(0)==22?t=this.createList():hasOwnProperty.call(this.pseudo,r)?(this.skipSC(),t=this.pseudo[r].call(this),this.skipSC()):(t=this.createList(),t.push(this.Raw(null,!1))),this.eat(22)):n=this.consume(1),{type:`PseudoClassSelector`,loc:this.getLocation(e,this.tokenStart),name:n,children:t}}function Ni(e){this.token(16,`:`),e.children===null?this.token(1,e.name):(this.token(2,e.name+`(`),this.children(e),this.token(22,`)`))}const Pi=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:Ni,name:`PseudoClassSelector`,parse:Mi,structure:ji,walkContext:`function`},Symbol.toStringTag,{value:`Module`})),Fi={name:String,children:[[`Raw`],null]};function Ii(){let e=this.tokenStart,t=null,n,r;return this.eat(16),this.eat(16),this.tokenType===2?(n=this.consumeFunctionName(),r=n.toLowerCase(),this.lookupNonWSType(0)==22?t=this.createList():hasOwnProperty.call(this.pseudo,r)?(this.skipSC(),t=this.pseudo[r].call(this),this.skipSC()):(t=this.createList(),t.push(this.Raw(null,!1))),this.eat(22)):n=this.consume(1),{type:`PseudoElementSelector`,loc:this.getLocation(e,this.tokenStart),name:n,children:t}}function Li(e){this.token(16,`:`),this.token(16,`:`),e.children===null?this.token(1,e.name):(this.token(2,e.name+`(`),this.children(e),this.token(22,`)`))}const Ri=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:Li,name:`PseudoElementSelector`,parse:Ii,structure:Fi,walkContext:`function`},Symbol.toStringTag,{value:`Module`}));function zi(){switch(this.skipSC(),this.tokenType){case 10:return this.Number();case 2:return this.Function(this.readSequence,this.scope.Value);default:this.error(`Number of function is expected`)}}const Bi={left:[`Number`,`Function`],right:[`Number`,`Function`,null]};function Vi(){let e=this.tokenStart,t=zi.call(this),n=null;return this.skipSC(),this.isDelim(47)&&(this.eatDelim(47),n=zi.call(this)),{type:`Ratio`,loc:this.getLocation(e,this.tokenStart),left:t,right:n}}function Hi(e){this.node(e.left),this.token(9,`/`),e.right?this.node(e.right):this.node(10,1)}const Ui=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:Hi,name:`Ratio`,parse:Vi,structure:Bi},Symbol.toStringTag,{value:`Module`}));function Wi(){return this.tokenIndex>0&&this.lookupType(-1)===13?this.tokenIndex>1?this.getTokenStart(this.tokenIndex-1):this.firstCharOffset:this.tokenStart}const Gi={value:String};function Ki(e,t){let n=this.getTokenStart(this.tokenIndex),r;return this.skipUntilBalanced(this.tokenIndex,e||this.consumeUntilBalanceEnd),r=t&&this.tokenStart>n?Wi.call(this):this.tokenStart,{type:`Raw`,loc:this.getLocation(n,r),value:this.substring(n,r)}}function qi(e){this.tokenize(e.value)}const Ji=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:qi,name:`Raw`,parse:Ki,structure:Gi},Symbol.toStringTag,{value:`Module`}));function Yi(){return this.Raw(this.consumeUntilLeftCurlyBracket,!0)}function Xi(){let e=this.SelectorList();return e.type!==`Raw`&&this.eof===!1&&this.tokenType!==23&&this.error(),e}const Zi={prelude:[`SelectorList`,`Raw`],block:[`Block`]};function Qi(){let e=this.tokenIndex,t=this.tokenStart,n,r;return n=this.parseRulePrelude?this.parseWithFallback(Xi,Yi):Yi.call(this,e),r=this.Block(!0),{type:`Rule`,loc:this.getLocation(t,this.tokenStart),prelude:n,block:r}}function $i(e){this.node(e.prelude),this.node(e.block)}const ea=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:$i,name:`Rule`,parse:Qi,structure:Zi,walkContext:`rule`},Symbol.toStringTag,{value:`Module`})),ta={root:[`SelectorList`,`Raw`,null],limit:[`SelectorList`,`Raw`,null]};function na(){let e=null,t=null;this.skipSC();let n=this.tokenStart;return this.tokenType===21&&(this.next(),this.skipSC(),e=this.parseWithFallback(this.SelectorList,()=>this.Raw(!1,!0)),this.skipSC(),this.eat(22)),this.lookupNonWSType(0)===1&&(this.skipSC(),this.eatIdent(`to`),this.skipSC(),this.eat(21),this.skipSC(),t=this.parseWithFallback(this.SelectorList,()=>this.Raw(!1,!0)),this.skipSC(),this.eat(22)),{type:`Scope`,loc:this.getLocation(n,this.tokenStart),root:e,limit:t}}function ra(e){e.root&&(this.token(21,`(`),this.node(e.root),this.token(22,`)`)),e.limit&&(this.token(1,`to`),this.token(21,`(`),this.node(e.limit),this.token(22,`)`))}const ia=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:ra,name:`Scope`,parse:na,structure:ta},Symbol.toStringTag,{value:`Module`})),aa={children:[[`TypeSelector`,`IdSelector`,`ClassSelector`,`AttributeSelector`,`PseudoClassSelector`,`PseudoElementSelector`,`Combinator`]]};function oa(){let e=this.readSequence(this.scope.Selector);return this.getFirstListNode(e)===null&&this.error(`Selector is expected`),{type:`Selector`,loc:this.getLocationFromList(e),children:e}}function sa(e){this.children(e)}const ca=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:sa,name:`Selector`,parse:oa,structure:aa},Symbol.toStringTag,{value:`Module`})),la={children:[[`Selector`,`Raw`]]};function ua(){let e=this.createList();for(;!this.eof;){if(e.push(this.Selector()),this.tokenType===18){this.next();continue}break}return{type:`SelectorList`,loc:this.getLocationFromList(e),children:e}}function da(e){this.children(e,()=>this.token(18,`,`))}const fa=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:da,name:`SelectorList`,parse:ua,structure:la,walkContext:`selector`},Symbol.toStringTag,{value:`Module`})),pa={value:String};function ma(){return{type:`String`,loc:this.getLocation(this.tokenStart,this.tokenEnd),value:Et(this.consume(5))}}function ha(e){this.token(5,Dt(e.value))}const ga=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:ha,name:`String`,parse:ma,structure:pa},Symbol.toStringTag,{value:`Module`}));function _a(){return this.Raw(null,!1)}const va={children:[[`Comment`,`CDO`,`CDC`,`Atrule`,`Rule`,`Raw`]]};function ya(){let e=this.tokenStart,t=this.createList(),n;for(;!this.eof;){switch(this.tokenType){case 13:this.next();continue;case 25:if(this.charCodeAt(this.tokenStart+2)!==33){this.next();continue}n=this.Comment();break;case 14:n=this.CDO();break;case 15:n=this.CDC();break;case 3:n=this.parseWithFallback(this.Atrule,_a);break;default:n=this.parseWithFallback(this.Rule,_a)}t.push(n)}return{type:`StyleSheet`,loc:this.getLocation(e,this.tokenStart),children:t}}function ba(e){this.children(e)}const xa=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:ba,name:`StyleSheet`,parse:ya,structure:va,walkContext:`stylesheet`},Symbol.toStringTag,{value:`Module`})),Sa={declaration:`Declaration`};function Ca(){let e=this.tokenStart;this.eat(21),this.skipSC();let t=this.Declaration();return this.eof||this.eat(22),{type:`SupportsDeclaration`,loc:this.getLocation(e,this.tokenStart),declaration:t}}function wa(e){this.token(21,`(`),this.node(e.declaration),this.token(22,`)`)}const Ta=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:wa,name:`SupportsDeclaration`,parse:Ca,structure:Sa},Symbol.toStringTag,{value:`Module`}));function Ea(){this.tokenType!==1&&this.isDelim(42)===!1&&this.error(`Identifier or asterisk is expected`),this.next()}const Da={name:String};function Oa(){let e=this.tokenStart;return this.isDelim(124)?(this.next(),Ea.call(this)):(Ea.call(this),this.isDelim(124)&&(this.next(),Ea.call(this))),{type:`TypeSelector`,loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function ka(e){this.tokenize(e.name)}const Aa=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:ka,name:`TypeSelector`,parse:Oa,structure:Da},Symbol.toStringTag,{value:`Module`}));function ja(e,t){let n=0;for(let r=this.tokenStart+e;r<this.tokenEnd;r++){let i=this.charCodeAt(r);if(i===45&&t&&n!==0)return ja.call(this,e+n+1,!1),-1;P(i)||this.error(t&&n!==0?`Hyphen minus`+(n<6?` or hex digit`:``)+` is expected`:n<6?`Hex digit is expected`:`Unexpected input`,r),++n>6&&this.error(`Too many hex digits`,r)}return this.next(),n}function Ma(e){let t=0;for(;this.isDelim(63);)++t>e&&this.error(`Too many question marks`),this.next()}function Na(e){this.charCodeAt(this.tokenStart)!==e&&this.error((e===43?`Plus sign`:`Hyphen minus`)+` is expected`)}function Pa(){let e=0;switch(this.tokenType){case 10:if(e=ja.call(this,1,!0),this.isDelim(63)){Ma.call(this,6-e);break}if(this.tokenType===12||this.tokenType===10){Na.call(this,45),ja.call(this,1,!1);break}break;case 12:e=ja.call(this,1,!0),e>0&&Ma.call(this,6-e);break;default:if(this.eatDelim(43),this.tokenType===1){e=ja.call(this,0,!0),e>0&&Ma.call(this,6-e);break}if(this.isDelim(63)){this.next(),Ma.call(this,5);break}this.error(`Hex digit or question mark is expected`)}}const Fa={value:String};function Ia(){let e=this.tokenStart;return this.eatIdent(`u`),Pa.call(this),{type:`UnicodeRange`,loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function La(e){this.tokenize(e.value)}const Ra=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:La,name:`UnicodeRange`,parse:Ia,structure:Fa},Symbol.toStringTag,{value:`Module`})),za={value:String};function Ba(){let e=this.tokenStart,t;switch(this.tokenType){case 7:t=Ot(this.consume(7));break;case 2:this.cmpStr(this.tokenStart,this.tokenEnd,`url(`)||this.error("Function name must be `url`"),this.eat(2),this.skipSC(),t=Et(this.consume(5)),this.skipSC(),this.eof||this.eat(22);break;default:this.error(`Url or Function is expected`)}return{type:`Url`,loc:this.getLocation(e,this.tokenStart),value:t}}function Va(e){this.token(7,kt(e.value))}const Ha=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:Va,name:`Url`,parse:Ba,structure:za},Symbol.toStringTag,{value:`Module`})),Ua={children:[[]]};function Wa(){let e=this.tokenStart,t=this.readSequence(this.scope.Value);return{type:`Value`,loc:this.getLocation(e,this.tokenStart),children:t}}function Ga(e){this.children(e)}const Ka=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:Ga,name:`Value`,parse:Wa,structure:Ua},Symbol.toStringTag,{value:`Module`})),qa=Object.freeze({type:`WhiteSpace`,loc:null,value:` `}),Ja={value:String};function Ya(){return this.eat(13),qa}function Xa(e){this.token(13,e.value)}const W=Lt({node:/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,AnPlusB:Ut,Atrule:Yt,AtrulePrelude:$t,AttributeSelector:on,Block:mn,Brackets:vn,CDC:Sn,CDO:En,ClassSelector:An,Combinator:Pn,Comment:Rn,Condition:Gn,Declaration:er,DeclarationList:ar,Dimension:lr,Feature:pr,FeatureFunction:vr,FeatureRange:wr,Function:Or,GeneralEnclosed:Mr,Hash:Ir,IdSelector:Wr,Identifier:Br,Layer:Jr,LayerList:Qr,MediaQuery:ni,MediaQueryList:oi,NestingSelector:ui,Nth:mi,Number:vi,Operator:Si,Parentheses:Ei,Percentage:Ai,PseudoClassSelector:Pi,PseudoElementSelector:Ri,Ratio:Ui,Raw:Ji,Rule:ea,Scope:ia,Selector:ca,SelectorList:fa,String:ga,StyleSheet:xa,SupportsDeclaration:Ta,TypeSelector:Aa,UnicodeRange:Ra,Url:Ha,Value:Ka,WhiteSpace:/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:Xa,name:`WhiteSpace`,parse:Ya,structure:Ja},Symbol.toStringTag,{value:`Module`}))},Symbol.toStringTag,{value:`Module`}))}),Za=[`left`,`right`,`top`,`bottom`,`inset-block-start`,`inset-block-end`,`inset-inline-start`,`inset-inline-end`,`inset-block`,`inset-inline`,`inset`];function Qa(e){return Za.includes(e)}const $a=[`margin-block-start`,`margin-block-end`,`margin-block`,`margin-inline-start`,`margin-inline-end`,`margin-inline`,`margin-bottom`,`margin-left`,`margin-right`,`margin-top`,`margin`];function eo(e){return $a.includes(e)}const to=[`width`,`height`,`min-width`,`min-height`,`max-width`,`max-height`,`block-size`,`inline-size`,`min-block-size`,`min-inline-size`,`max-block-size`,`max-inline-size`];function no(e){return to.includes(e)}const ro=[`justify-self`,`align-self`,`place-self`];function io(e){return ro.includes(e)}const ao=[...Za,...$a,...to,...ro,`position-anchor`,`position-area`],oo=[...to,...Za,...$a];function so(e){return oo.includes(e)}const co=[`top`,`left`,`right`,`bottom`,`start`,`end`,`self-start`,`self-end`,`center`,`inside`,`outside`];function lo(e){return co.includes(e)}const uo=[`width`,`height`,`block`,`inline`,`self-block`,`self-inline`];function fo(e){return uo.includes(e)}const po=/* @__PURE__ */ new Set([`Atrule`,`Selector`,`Declaration`]);function mo(e){let t=new SourceMapGenerator,n={line:1,column:0},r={line:0,column:0},i={line:1,column:0},a={generated:i},o=1,s=0,c=!1,l=e.node;e.node=function(e){if(e.loc&&e.loc.start&&po.has(e.type)){let l=e.loc.start.line,u=e.loc.start.column-1;(r.line!==l||r.column!==u)&&(r.line=l,r.column=u,n.line=o,n.column=s,c&&(c=!1,(n.line!==i.line||n.column!==i.column)&&t.addMapping(a)),c=!0,t.addMapping({source:e.loc.source,original:r,generated:n}))}l.call(this,e),c&&po.has(e.type)&&(i.line=o,i.column=s)};let u=e.emit;e.emit=function(e,t,n){for(let t=0;t<e.length;t++)e.charCodeAt(t)===10?(o++,s=0):s++;u(e,t,n)};let d=e.result;return e.result=function(){return c&&t.addMapping(a),{css:d(),map:t}},e}const ho=(e,t)=>{if(e===9&&(e=t),typeof e==`string`){let t=e.charCodeAt(0);return t>127?32768:t<<8}return e},go=[[1,1],[1,2],[1,7],[1,8],[1,`-`],[1,10],[1,11],[1,12],[1,15],[1,21],[3,1],[3,2],[3,7],[3,8],[3,`-`],[3,10],[3,11],[3,12],[3,15],[4,1],[4,2],[4,7],[4,8],[4,`-`],[4,10],[4,11],[4,12],[4,15],[12,1],[12,2],[12,7],[12,8],[12,`-`],[12,10],[12,11],[12,12],[12,15],[`#`,1],[`#`,2],[`#`,7],[`#`,8],[`#`,`-`],[`#`,10],[`#`,11],[`#`,12],[`#`,15],[`-`,1],[`-`,2],[`-`,7],[`-`,8],[`-`,`-`],[`-`,10],[`-`,11],[`-`,12],[`-`,15],[10,1],[10,2],[10,7],[10,8],[10,10],[10,11],[10,12],[10,`%`],[10,15],[`@`,1],[`@`,2],[`@`,7],[`@`,8],[`@`,`-`],[`@`,15],[`.`,10],[`.`,11],[`.`,12],[`+`,10],[`+`,11],[`+`,12],[`/`,`*`]],_o=go.concat([[1,4],[12,4],[4,4],[3,21],[3,5],[3,16],[11,11],[11,12],[11,2],[11,`-`],[22,1],[22,2],[22,11],[22,12],[22,4],[22,`-`]]);function vo(e){let t=new Set(e.map(([e,t])=>ho(e)<<16|ho(t)));return function(e,n,r){let i=ho(n,r),a=r.charCodeAt(0);return(a===45&&n!==1&&n!==2&&n!==15||a===43?t.has(e<<16|a<<8):t.has(e<<16|i))&&this.emit(` `,13,!0),i}}const yo=vo(go),bo=vo(_o),xo=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,safe:bo,spec:yo},Symbol.toStringTag,{value:`Module`}));function So(e,t){if(typeof t==`function`){let n=null;e.children.forEach(e=>{n!==null&&t.call(this,n),this.node(e),n=e});return}e.children.forEach(this.node,this)}function Co(e){wt(e,(t,n,r)=>{this.token(t,e.slice(n,r))})}function wo(e){let t=/* @__PURE__ */ new Map;for(let[n,r]of Object.entries(e.node))typeof(r.generate||r)==`function`&&t.set(n,r.generate||r);return function(e,n){let r=``,i=0,a={node(e){if(t.has(e.type))t.get(e.type).call(o,e);else throw Error(`Unknown node type: `+e.type)},tokenBefore:bo,token(e,t){i=this.tokenBefore(i,e,t),this.emit(t,e,!1),e===9&&t.charCodeAt(0)===92&&this.emit(`
1
+ var e=Object.defineProperty,t=Object.defineProperties,n=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable,o=(t,n,r)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[n]=r,s=(e,t)=>{for(var n in t||={})i.call(t,n)&&o(e,n,t[n]);if(r)for(var n of r(t))a.call(t,n)&&o(e,n,t[n]);return e},c=(e,r)=>t(e,n(r)),l=(e,t,n)=>new Promise((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())});const u=Math.min,d=Math.max,f=Math.round,p=Math.floor,m=e=>({x:e,y:e});function h(e,t){return typeof e==`function`?e(t):e}function g(e){return s({top:0,right:0,bottom:0,left:0},e)}function ee(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:g(e)}function _(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function v(e,t){return l(this,null,function*(){var n;t===void 0&&(t={});let{x:r,y:i,platform:a,rects:o,elements:s,strategy:c}=e,{boundary:l=`clippingAncestors`,rootBoundary:u=`viewport`,elementContext:d=`floating`,altBoundary:f=!1,padding:p=0}=h(t,e),m=ee(p),g=s[f?d===`floating`?`reference`:`floating`:d],v=_(yield a.getClippingRect({element:(n=yield a.isElement==null?void 0:a.isElement(g))==null||n?g:g.contextElement||(yield a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:l,rootBoundary:u,strategy:c})),y=d===`floating`?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,b=yield a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating),x=(yield a.isElement==null?void 0:a.isElement(b))&&(yield a.getScale==null?void 0:a.getScale(b))||{x:1,y:1},S=_(a.convertOffsetParentRelativeRectToViewportRelativeRect?yield a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:b,strategy:c}):y);return{top:(v.top-S.top+m.top)/x.y,bottom:(S.bottom-v.bottom+m.bottom)/x.y,left:(v.left-S.left+m.left)/x.x,right:(S.right-v.right+m.right)/x.x}})}function y(){return typeof window<`u`}function b(e){return te(e)?(e.nodeName||``).toLowerCase():`#document`}function x(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function S(e){return((te(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function te(e){return y()?e instanceof Node||e instanceof x(e).Node:!1}function C(e){return y()?e instanceof Element||e instanceof x(e).Element:!1}function w(e){return y()?e instanceof HTMLElement||e instanceof x(e).HTMLElement:!1}function ne(e){return!y()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof x(e).ShadowRoot}const re=/* @__PURE__ */ new Set([`inline`,`contents`]);function ie(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=E(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!re.has(i)}const ae=/* @__PURE__ */ new Set([`table`,`td`,`th`]);function oe(e){return ae.has(b(e))}const se=[`:popover-open`,`:modal`];function ce(e){return se.some(t=>{try{return e.matches(t)}catch{return!1}})}const le=[`transform`,`translate`,`scale`,`rotate`,`perspective`],ue=[`transform`,`translate`,`scale`,`rotate`,`perspective`,`filter`],de=[`paint`,`layout`,`strict`,`content`];function fe(e){let t=me(),n=C(e)?E(e):e;return le.some(e=>n[e]?n[e]!==`none`:!1)||(n.containerType?n.containerType!==`normal`:!1)||!t&&(n.backdropFilter?n.backdropFilter!==`none`:!1)||!t&&(n.filter?n.filter!==`none`:!1)||ue.some(e=>(n.willChange||``).includes(e))||de.some(e=>(n.contain||``).includes(e))}function pe(e){let t=D(e);for(;w(t)&&!T(t);){if(fe(t))return t;if(ce(t))return null;t=D(t)}return null}function me(){return typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter`,`none`)}const he=/* @__PURE__ */ new Set([`html`,`body`,`#document`]);function T(e){return he.has(b(e))}function E(e){return x(e).getComputedStyle(e)}function ge(e){return C(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function D(e){if(b(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||ne(e)&&e.host||S(e);return ne(t)?t.host:t}function _e(e){let t=D(e);return T(t)?e.ownerDocument?e.ownerDocument.body:e.body:w(t)&&ie(t)?t:_e(t)}function O(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=_e(e),i=r===e.ownerDocument?.body,a=x(r);if(i){let e=ve(a);return t.concat(a,a.visualViewport||[],ie(r)?r:[],e&&n?O(e):[])}return t.concat(r,O(r,[],n))}function ve(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ye(e){let t=E(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=w(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=f(n)!==a||f(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function be(e){return C(e)?e:e.contextElement}function k(e){let t=be(e);if(!w(t))return m(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=ye(t),o=(a?f(n.width):n.width)/r,s=(a?f(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}const xe=/* @__PURE__ */ m(0);function Se(e){let t=x(e);return!me()||!t.visualViewport?xe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ce(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==x(e)?!1:t}function A(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=be(e),o=m(1);t&&(r?C(r)&&(o=k(r)):o=k(e));let s=Ce(a,n,r)?Se(a):m(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=x(a),t=r&&C(r)?x(r):r,n=e,i=ve(n);for(;i&&r&&t!==n;){let e=k(i),t=i.getBoundingClientRect(),r=E(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=x(i),i=ve(n)}}return _({width:u,height:d,x:c,y:l})}function we(e,t){let n=ge(e).scrollLeft;return t?t.left+n:A(S(e)).left+n}function Te(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-we(e,n),y:n.top+t.scrollTop}}function Ee(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=S(r),s=t?ce(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=m(1),u=m(0),d=w(r);if((d||!d&&!a)&&((b(r)!==`body`||ie(o))&&(c=ge(r)),w(r))){let e=A(r);l=k(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Te(o,c):m(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function De(e){return Array.from(e.getClientRects())}function Oe(e){let t=S(e),n=ge(e),r=e.ownerDocument.body,i=d(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=d(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+we(e),s=-n.scrollTop;return E(r).direction===`rtl`&&(o+=d(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}function ke(e,t){let n=x(e),r=S(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=me();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=we(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=25&&(a-=o)}else l<=25&&(a+=l);return{width:a,height:o,x:s,y:c}}const Ae=/* @__PURE__ */ new Set([`absolute`,`fixed`]);function je(e,t){let n=A(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=w(e)?k(e):m(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Me(e,t,n){let r;if(t===`viewport`)r=ke(e,n);else if(t===`document`)r=Oe(S(e));else if(C(t))r=je(t,n);else{let n=Se(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return _(r)}function Ne(e,t){let n=D(e);return n===t||!C(n)||T(n)?!1:E(n).position===`fixed`||Ne(n,t)}function Pe(e,t){let n=t.get(e);if(n)return n;let r=O(e,[],!1).filter(e=>C(e)&&b(e)!==`body`),i=null,a=E(e).position===`fixed`,o=a?D(e):e;for(;C(o)&&!T(o);){let t=E(o),n=fe(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&Ae.has(i.position)||ie(o)&&!n&&Ne(e,o))?r=r.filter(e=>e!==o):i=t,o=D(o)}return t.set(e,r),r}function Fe(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?ce(t)?[]:Pe(t,this._c):[].concat(n),r],o=a[0],s=a.reduce((e,n)=>{let r=Me(t,n,i);return e.top=d(r.top,e.top),e.right=u(r.right,e.right),e.bottom=u(r.bottom,e.bottom),e.left=d(r.left,e.left),e},Me(t,o,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function Ie(e){let{width:t,height:n}=ye(e);return{width:t,height:n}}function Le(e,t,n){let r=w(t),i=S(t),a=n===`fixed`,o=A(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=m(0);function l(){c.x=we(i)}if(r||!r&&!a){if((b(t)!==`body`||ie(i))&&(s=ge(t)),r){let e=A(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l()}a&&!r&&i&&l();let u=i&&!r&&!a?Te(i,s):m(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Re(e){return E(e).position===`static`}function ze(e,t){if(!w(e)||E(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return S(e)===n&&(n=n.ownerDocument.body),n}function Be(e,t){let n=x(e);if(ce(e))return n;if(!w(e)){let t=D(e);for(;t&&!T(t);){if(C(t)&&!Re(t))return t;t=D(t)}return n}let r=ze(e,t);for(;r&&oe(r)&&Re(r);)r=ze(r,t);return r&&T(r)&&Re(r)&&!fe(r)?n:r||pe(e)||n}const Ve=function(e){return l(this,null,function*(){let t=this.getOffsetParent||Be,n=this.getDimensions,r=yield n(e.floating);return{reference:Le(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}})};function He(e){return E(e).direction===`rtl`}const j={convertOffsetParentRelativeRectToViewportRelativeRect:Ee,getDocumentElement:S,getClippingRect:Fe,getOffsetParent:Be,getElementRects:Ve,getClientRects:De,getDimensions:Ie,getScale:k,isElement:C,isRTL:He};function Ue(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function We(e,t){let n=null,r,i=S(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(l,f){l===void 0&&(l=!1),f===void 0&&(f=1),a();let m=e.getBoundingClientRect(),{left:h,top:g,width:ee,height:_}=m;if(l||t(),!ee||!_)return;let v=p(g),y=p(i.clientWidth-(h+ee)),b=p(i.clientHeight-(g+_)),x=p(h),S={rootMargin:-v+`px `+-y+`px `+-b+`px `+-x+`px`,threshold:d(0,u(1,f))||1},te=!0;function C(t){let n=t[0].intersectionRatio;if(n!==f){if(!te)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!Ue(m,e.getBoundingClientRect())&&o(),te=!1}try{n=new IntersectionObserver(C,c(s({},S),{root:i.ownerDocument}))}catch{n=new IntersectionObserver(C,S)}n.observe(e)}return o(!0),a}function Ge(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=be(e),u=i||a?[...l?O(l):[],...O(t)]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?We(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),p.observe(t));let m,h=c?A(e):null;c&&g();function g(){let t=A(e);h&&!Ue(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}const Ke=v;let M=null;var qe=class e{static createItem(e){return{prev:null,next:null,data:e}}constructor(){this.head=null,this.tail=null,this.cursor=null}createItem(t){return e.createItem(t)}allocateCursor(e,t){let n;return M===null?n={prev:e,next:t,cursor:this.cursor}:(n=M,M=M.cursor,n.prev=e,n.next=t,n.cursor=this.cursor),this.cursor=n,n}releaseCursor(){let{cursor:e}=this;this.cursor=e.cursor,e.prev=null,e.next=null,e.cursor=M,M=e}updateCursors(e,t,n,r){let{cursor:i}=this;for(;i!==null;)i.prev===e&&(i.prev=t),i.next===n&&(i.next=r),i=i.cursor}*[Symbol.iterator](){for(let e=this.head;e!==null;e=e.next)yield e.data}get size(){let e=0;for(let t=this.head;t!==null;t=t.next)e++;return e}get isEmpty(){return this.head===null}get first(){return this.head&&this.head.data}get last(){return this.tail&&this.tail.data}fromArray(t){let n=null;this.head=null;for(let r of t){let t=e.createItem(r);n===null?this.head=t:n.next=t,t.prev=n,n=t}return this.tail=n,this}toArray(){return[...this]}toJSON(){return[...this]}forEach(e,t=this){let n=this.allocateCursor(null,this.head);for(;n.next!==null;){let r=n.next;n.next=r.next,e.call(t,r.data,r,this)}this.releaseCursor()}forEachRight(e,t=this){let n=this.allocateCursor(this.tail,null);for(;n.prev!==null;){let r=n.prev;n.prev=r.prev,e.call(t,r.data,r,this)}this.releaseCursor()}reduce(e,t,n=this){let r=this.allocateCursor(null,this.head),i=t,a;for(;r.next!==null;)a=r.next,r.next=a.next,i=e.call(n,i,a.data,a,this);return this.releaseCursor(),i}reduceRight(e,t,n=this){let r=this.allocateCursor(this.tail,null),i=t,a;for(;r.prev!==null;)a=r.prev,r.prev=a.prev,i=e.call(n,i,a.data,a,this);return this.releaseCursor(),i}some(e,t=this){for(let n=this.head;n!==null;n=n.next)if(e.call(t,n.data,n,this))return!0;return!1}map(t,n=this){let r=new e;for(let e=this.head;e!==null;e=e.next)r.appendData(t.call(n,e.data,e,this));return r}filter(t,n=this){let r=new e;for(let e=this.head;e!==null;e=e.next)t.call(n,e.data,e,this)&&r.appendData(e.data);return r}nextUntil(e,t,n=this){if(e===null)return;let r=this.allocateCursor(null,e);for(;r.next!==null;){let e=r.next;if(r.next=e.next,t.call(n,e.data,e,this))break}this.releaseCursor()}prevUntil(e,t,n=this){if(e===null)return;let r=this.allocateCursor(e,null);for(;r.prev!==null;){let e=r.prev;if(r.prev=e.prev,t.call(n,e.data,e,this))break}this.releaseCursor()}clear(){this.head=null,this.tail=null}copy(){let t=new e;for(let e of this)t.appendData(e);return t}prepend(e){return this.updateCursors(null,e,this.head,e),this.head===null?this.tail=e:(this.head.prev=e,e.next=this.head),this.head=e,this}prependData(t){return this.prepend(e.createItem(t))}append(e){return this.insert(e)}appendData(t){return this.insert(e.createItem(t))}insert(e,t=null){if(t!==null){if(this.updateCursors(t.prev,e,t,e),t.prev===null){if(this.head!==t)throw Error(`before doesn't belong to list`);this.head=e,t.prev=e,e.next=t,this.updateCursors(null,e)}else t.prev.next=e,e.prev=t.prev,t.prev=e,e.next=t}else this.updateCursors(this.tail,e,null,e),this.tail===null?this.head=e:(this.tail.next=e,e.prev=this.tail),this.tail=e;return this}insertData(t,n){return this.insert(e.createItem(t),n)}remove(e){if(this.updateCursors(e,e.prev,e,e.next),e.prev!==null)e.prev.next=e.next;else{if(this.head!==e)throw Error(`item doesn't belong to list`);this.head=e.next}if(e.next!==null)e.next.prev=e.prev;else{if(this.tail!==e)throw Error(`item doesn't belong to list`);this.tail=e.prev}return e.prev=null,e.next=null,e}push(t){this.insert(e.createItem(t))}pop(){return this.tail===null?null:this.remove(this.tail)}unshift(t){this.prepend(e.createItem(t))}shift(){return this.head===null?null:this.remove(this.head)}prependList(e){return this.insertList(e,this.head)}appendList(e){return this.insertList(e)}insertList(e,t){return e.head===null||(t==null?(this.updateCursors(this.tail,e.tail,null,e.head),this.tail===null?this.head=e.head:(this.tail.next=e.head,e.head.prev=this.tail),this.tail=e.tail):(this.updateCursors(t.prev,e.tail,t,e.head),t.prev===null?this.head=e.head:(t.prev.next=e.head,e.head.prev=t.prev),t.prev=e.tail,e.tail.next=t),e.head=null,e.tail=null),this}replace(e,t){`head`in t?this.insertList(t,e):this.insert(t,e),this.remove(e)}};function Je(e){let t={};for(let n of Object.keys(e)){let r=e[n];r&&(Array.isArray(r)||r instanceof qe?r=r.map(Je):r.constructor===Object&&(r=Je(r))),t[n]=r}return t}function N(e){return e>=48&&e<=57}function P(e){return N(e)||e>=65&&e<=70||e>=97&&e<=102}function Ye(e){return e>=65&&e<=90}function Xe(e){return e>=97&&e<=122}function Ze(e){return Ye(e)||Xe(e)}function Qe(e){return e>=128}function $e(e){return Ze(e)||Qe(e)||e===95}function et(e){return $e(e)||N(e)||e===45}function tt(e){return e>=0&&e<=8||e===11||e>=14&&e<=31||e===127}function nt(e){return e===10||e===13||e===12}function F(e){return nt(e)||e===32||e===9}function I(e,t){return!(e!==92||nt(t)||t===0)}function rt(e,t,n){return e===45?$e(t)||t===45||I(t,n):$e(e)?!0:e===92&&I(e,t)}function it(e,t,n){return e===43||e===45?N(t)?2:t===46&&N(n)?3:0:e===46?N(t)?2:0:+!!N(e)}function at(e){return+(e===65279||e===65534)}const ot=Array(128);for(let e=0;e<ot.length;e++)ot[e]=F(e)&&130||N(e)&&131||$e(e)&&132||tt(e)&&133||e||128;function st(e){return e<128?ot[e]:132}function L(e,t){return t<e.length?e.charCodeAt(t):0}function ct(e,t,n){return n===13&&L(e,t+1)===10?2:1}function lt(e,t,n){let r=e.charCodeAt(t);return Ye(r)&&(r|=32),r===n}function ut(e,t,n,r){if(n-t!==r.length||t<0||n>e.length)return!1;for(let i=t;i<n;i++){let n=r.charCodeAt(i-t),a=e.charCodeAt(i);if(Ye(a)&&(a|=32),a!==n)return!1}return!0}function dt(e,t){for(;t>=0&&F(e.charCodeAt(t));t--);return t+1}function ft(e,t){for(;t<e.length&&F(e.charCodeAt(t));t++);return t}function pt(e,t){for(;t<e.length&&N(e.charCodeAt(t));t++);return t}function R(e,t){if(t+=2,P(L(e,t-1))){for(let n=Math.min(e.length,t+5);t<n&&P(L(e,t));t++);let n=L(e,t);F(n)&&(t+=ct(e,t,n))}return t}function mt(e,t){for(;t<e.length;t++){let n=e.charCodeAt(t);if(!et(n)){if(I(n,L(e,t+1))){t=R(e,t)-1;continue}break}}return t}function ht(e,t){let n=e.charCodeAt(t);if((n===43||n===45)&&(n=e.charCodeAt(t+=1)),N(n)&&(t=pt(e,t+1),n=e.charCodeAt(t)),n===46&&N(e.charCodeAt(t+1))&&(t+=2,t=pt(e,t)),lt(e,t,101)){let r=0;n=e.charCodeAt(t+1),(n===45||n===43)&&(r=1,n=e.charCodeAt(t+2)),N(n)&&(t=pt(e,t+1+r+1))}return t}function gt(e,t){for(;t<e.length;t++){let n=e.charCodeAt(t);if(n===41){t++;break}I(n,L(e,t+1))&&(t=R(e,t))}return t}function _t(e){if(e.length===1&&!P(e.charCodeAt(0)))return e[0];let t=parseInt(e,16);return(t===0||t>=55296&&t<=57343||t>1114111)&&(t=65533),String.fromCodePoint(t)}const vt=/* @__PURE__ */ `EOF-token.ident-token.function-token.at-keyword-token.hash-token.string-token.bad-string-token.url-token.bad-url-token.delim-token.number-token.percentage-token.dimension-token.whitespace-token.CDO-token.CDC-token.colon-token.semicolon-token.comma-token.[-token.]-token.(-token.)-token.{-token.}-token.comment-token`.split(`.`);function yt(e=null,t){return e===null||e.length<t?new Uint32Array(Math.max(t+1024,16384)):e}function bt(e){let t=e.source,n=t.length,r=t.length>0?at(t.charCodeAt(0)):0,i=yt(e.lines,n),a=yt(e.columns,n),o=e.startLine,s=e.startColumn;for(let e=r;e<n;e++){let r=t.charCodeAt(e);i[e]=o,a[e]=s++,(r===10||r===13||r===12)&&(r===13&&e+1<n&&t.charCodeAt(e+1)===10&&(e++,i[e]=o,a[e]=s),o++,s=1)}i[n]=o,a[n]=s,e.lines=i,e.columns=a,e.computed=!0}var xt=class{constructor(e,t,n,r){this.setSource(e,t,n,r),this.lines=null,this.columns=null}setSource(e=``,t=0,n=1,r=1){this.source=e,this.startOffset=t,this.startLine=n,this.startColumn=r,this.computed=!1}getLocation(e,t){return this.computed||bt(this),{source:t,offset:this.startOffset+e,line:this.lines[e],column:this.columns[e]}}getLocationRange(e,t,n){return this.computed||bt(this),{source:n,start:{offset:this.startOffset+e,line:this.lines[e],column:this.columns[e]},end:{offset:this.startOffset+t,line:this.lines[t],column:this.columns[t]}}}};const z=16777215,B=/* @__PURE__ */ new Uint8Array(32);B[2]=22,B[21]=22,B[19]=20,B[23]=24;function St(e){return B[e]!==0}var Ct=class{constructor(e,t){this.setSource(e,t)}reset(){this.eof=!1,this.tokenIndex=-1,this.tokenType=0,this.tokenStart=this.firstCharOffset,this.tokenEnd=this.firstCharOffset}setSource(e=``,t=()=>{}){e=String(e||``);let n=e.length,r=yt(this.offsetAndType,e.length+1),i=yt(this.balance,e.length+1),a=0,o=-1,s=0,c=e.length;this.offsetAndType=null,this.balance=null,i.fill(0),t(e,(e,t,n)=>{let l=a++;if(r[l]=e<<24|n,o===-1&&(o=t),i[l]=c,e===s){let e=i[c];i[c]=l,c=e,s=B[r[e]>>24]}else St(e)&&(c=l,s=B[e])}),r[a]=0|n,i[a]=a;for(let e=0;e<a;e++){let t=i[e];if(t<=e){let n=i[t];n!==e&&(i[e]=n)}else t>a&&(i[e]=a)}this.source=e,this.firstCharOffset=o===-1?0:o,this.tokenCount=a,this.offsetAndType=r,this.balance=i,this.reset(),this.next()}lookupType(e){return e+=this.tokenIndex,e<this.tokenCount?this.offsetAndType[e]>>24:0}lookupTypeNonSC(e){for(let t=this.tokenIndex;t<this.tokenCount;t++){let n=this.offsetAndType[t]>>24;if(n!==13&&n!==25&&e--===0)return n}return 0}lookupOffset(e){return e+=this.tokenIndex,e<this.tokenCount?this.offsetAndType[e-1]&z:this.source.length}lookupOffsetNonSC(e){for(let t=this.tokenIndex;t<this.tokenCount;t++){let n=this.offsetAndType[t]>>24;if(n!==13&&n!==25&&e--===0)return t-this.tokenIndex}return 0}lookupValue(e,t){return e+=this.tokenIndex,e<this.tokenCount&&ut(this.source,this.offsetAndType[e-1]&z,this.offsetAndType[e]&z,t)}getTokenStart(e){return e===this.tokenIndex?this.tokenStart:e>0?e<this.tokenCount?this.offsetAndType[e-1]&z:this.offsetAndType[this.tokenCount]&z:this.firstCharOffset}substrToCursor(e){return this.source.substring(e,this.tokenStart)}isBalanceEdge(e){return this.balance[this.tokenIndex]<e}isDelim(e,t){return t?this.lookupType(t)===9&&this.source.charCodeAt(this.lookupOffset(t))===e:this.tokenType===9&&this.source.charCodeAt(this.tokenStart)===e}skip(e){let t=this.tokenIndex+e;t<this.tokenCount?(this.tokenIndex=t,this.tokenStart=this.offsetAndType[t-1]&z,t=this.offsetAndType[t],this.tokenType=t>>24,this.tokenEnd=t&z):(this.tokenIndex=this.tokenCount,this.next())}next(){let e=this.tokenIndex+1;e<this.tokenCount?(this.tokenIndex=e,this.tokenStart=this.tokenEnd,e=this.offsetAndType[e],this.tokenType=e>>24,this.tokenEnd=e&z):(this.eof=!0,this.tokenIndex=this.tokenCount,this.tokenType=0,this.tokenStart=this.tokenEnd=this.source.length)}skipSC(){for(;this.tokenType===13||this.tokenType===25;)this.next()}skipUntilBalanced(e,t){let n=e,r=0,i=0;t:for(;n<this.tokenCount;n++){if(r=this.balance[n],r<e)break t;switch(i=n>0?this.offsetAndType[n-1]&z:this.firstCharOffset,t(this.source.charCodeAt(i))){case 1:break t;case 2:n++;break t;default:St(this.offsetAndType[n]>>24)&&(n=r)}}this.skip(n-this.tokenIndex)}forEachToken(e){for(let t=0,n=this.firstCharOffset;t<this.tokenCount;t++){let r=n,i=this.offsetAndType[t],a=i&z,o=i>>24;n=a,e(o,r,a,t)}}dump(){let e=Array(this.tokenCount);return this.forEachToken((t,n,r,i)=>{e[i]={idx:i,type:vt[t],chunk:this.source.substring(n,r),balance:this.balance[i]}}),e}};function wt(e,t){function n(t){return t<s?e.charCodeAt(t):0}function r(){l=ht(e,l),rt(n(l),n(l+1),n(l+2))?(u=12,l=mt(e,l)):n(l)===37?(u=11,l++):u=10}function i(){let t=l;if(l=mt(e,l),ut(e,t,l,`url`)&&n(l)===40){if(l=ft(e,l+1),n(l)===34||n(l)===39){u=2,l=t+4;return}o()}else n(l)===40?(u=2,l++):u=1}function a(t){for(t||=n(l++),u=5;l<e.length;l++){let r=e.charCodeAt(l);switch(st(r)){case t:l++;return;case 130:if(nt(r)){l+=ct(e,l,r),u=6;return}break;case 92:if(l===e.length-1)break;let i=n(l+1);nt(i)?l+=ct(e,l+1,i):I(r,i)&&(l=R(e,l)-1)}}}function o(){for(u=7,l=ft(e,l);l<e.length;l++){let t=e.charCodeAt(l);switch(st(t)){case 41:l++;return;case 130:if(l=ft(e,l),n(l)===41||l>=e.length){l<e.length&&l++;return}l=gt(e,l),u=8;return;case 34:case 39:case 40:case 133:l=gt(e,l),u=8;return;case 92:if(I(t,n(l+1))){l=R(e,l)-1;break}l=gt(e,l),u=8;return}}}e=String(e||``);let s=e.length,c=at(n(0)),l=c,u;for(;l<s;){let o=e.charCodeAt(l);switch(st(o)){case 130:u=13,l=ft(e,l+1);break;case 34:a();break;case 35:et(n(l+1))||I(n(l+1),n(l+2))?(u=4,l=mt(e,l+1)):(u=9,l++);break;case 39:a();break;case 40:u=21,l++;break;case 41:u=22,l++;break;case 43:it(o,n(l+1),n(l+2))?r():(u=9,l++);break;case 44:u=18,l++;break;case 45:it(o,n(l+1),n(l+2))?r():n(l+1)===45&&n(l+2)===62?(u=15,l+=3):rt(o,n(l+1),n(l+2))?i():(u=9,l++);break;case 46:it(o,n(l+1),n(l+2))?r():(u=9,l++);break;case 47:n(l+1)===42?(u=25,l=e.indexOf(`*/`,l+2),l=l===-1?e.length:l+2):(u=9,l++);break;case 58:u=16,l++;break;case 59:u=17,l++;break;case 60:n(l+1)===33&&n(l+2)===45&&n(l+3)===45?(u=14,l+=4):(u=9,l++);break;case 64:rt(n(l+1),n(l+2),n(l+3))?(u=3,l=mt(e,l+1)):(u=9,l++);break;case 91:u=19,l++;break;case 92:I(o,n(l+1))?i():(u=9,l++);break;case 93:u=20,l++;break;case 123:u=23,l++;break;case 125:u=24,l++;break;case 131:r();break;case 132:i();break;default:u=9,l++}t(u,c,c=l)}}function Tt(e,t){return t||=0,e.length-t>=2&&e.charCodeAt(t)===45&&e.charCodeAt(t+1)===45}function Et(e){let t=e.length,n=e.charCodeAt(0),r=+(n===34||n===39),i=r===1&&t>1&&e.charCodeAt(t-1)===n?t-2:t-1,a=``;for(let n=r;n<=i;n++){let r=e.charCodeAt(n);if(r===92){if(n===i){n!==t-1&&(a=e.substr(n+1));break}if(r=e.charCodeAt(++n),I(92,r)){let t=n-1,r=R(e,t);n=r-1,a+=_t(e.substring(t+1,r))}else r===13&&e.charCodeAt(n+1)===10&&n++}else a+=e[n]}return a}function Dt(e,t){let n=``,r=!1;for(let t=0;t<e.length;t++){let i=e.charCodeAt(t);i===0?n+=`�`:i<=31||i===127?(n+=`\\`+i.toString(16),r=!0):i===34||i===92?(n+=`\\`+e.charAt(t),r=!1):(r&&(P(i)||F(i))&&(n+=` `),n+=e.charAt(t),r=!1)}return`"`+n+`"`}function Ot(e){let t=e.length,n=4,r=e.charCodeAt(t-1)===41?t-2:t-1,i=``;for(;n<r&&F(e.charCodeAt(n));)n++;for(;n<r&&F(e.charCodeAt(r));)r--;for(let a=n;a<=r;a++){let n=e.charCodeAt(a);if(n===92){if(a===r){a!==t-1&&(i=e.substr(a+1));break}if(n=e.charCodeAt(++a),I(92,n)){let t=a-1,n=R(e,t);a=n-1,i+=_t(e.substring(t+1,n))}else n===13&&e.charCodeAt(a+1)===10&&a++}else i+=e[a]}return i}function kt(e){let t=``,n=!1;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);i===0?t+=`�`:i<=31||i===127?(t+=`\\`+i.toString(16),n=!0):i===32||i===92||i===34||i===39||i===40||i===41?(t+=`\\`+e.charAt(r),n=!1):(n&&P(i)&&(t+=` `),t+=e.charAt(r),n=!1)}return`url(`+t+`)`}const{hasOwnProperty:At}=Object.prototype,V=function(){};function jt(e){return typeof e==`function`?e:V}function Mt(e,t){return function(n,r,i){n.type===t&&e.call(this,n,r,i)}}function Nt(e,t){let n=t.structure,r=[];for(let e in n){if(At.call(n,e)===!1)continue;let t=n[e],i={name:e,type:!1,nullable:!1};Array.isArray(t)||(t=[t]);for(let e of t)e===null?i.nullable=!0:typeof e==`string`?i.type=`node`:Array.isArray(e)&&(i.type=`list`);i.type&&r.push(i)}return r.length?{context:t.walkContext,fields:r}:null}function Pt(e){let t={};for(let n in e.node)if(At.call(e.node,n)){let r=e.node[n];if(!r.structure)throw Error("Missed `structure` field in `"+n+"` node type definition");t[n]=Nt(n,r)}return t}function Ft(e,t){let n=e.fields.slice(),r=e.context,i=typeof r==`string`;return t&&n.reverse(),function(e,a,o,s){let c;i&&(c=a[r],a[r]=e);for(let r of n){let n=e[r.name];if(!r.nullable||n){if(r.type===`list`){if(t?n.reduceRight(s,!1):n.reduce(s,!1))return!0}else if(o(n))return!0}}i&&(a[r]=c)}}function It({StyleSheet:e,Atrule:t,Rule:n,Block:r,DeclarationList:i}){return{Atrule:{StyleSheet:e,Atrule:t,Rule:n,Block:r},Rule:{StyleSheet:e,Atrule:t,Rule:n,Block:r},Declaration:{StyleSheet:e,Atrule:t,Rule:n,Block:r,DeclarationList:i}}}function Lt(e){let t=Pt(e),n={},r={},i=/* @__PURE__ */ Symbol(`break-walk`),a=/* @__PURE__ */ Symbol(`skip-node`);for(let e in t)At.call(t,e)&&t[e]!==null&&(n[e]=Ft(t[e],!1),r[e]=Ft(t[e],!0));let o=It(n),s=It(r),c=function(e,c){function l(e,t,n){let r=u.call(m,e,t,n);return r===i||r!==a&&!!(f.hasOwnProperty(e.type)&&f[e.type](e,m,l,p)||d.call(m,e,t,n)===i)}let u=V,d=V,f=n,p=(e,t,n,r)=>e||l(t,n,r),m={break:i,skip:a,root:e,stylesheet:null,atrule:null,atrulePrelude:null,rule:null,selector:null,block:null,declaration:null,function:null};if(typeof c==`function`)u=c;else if(c&&(u=jt(c.enter),d=jt(c.leave),c.reverse&&(f=r),c.visit)){if(o.hasOwnProperty(c.visit))f=c.reverse?s[c.visit]:o[c.visit];else if(!t.hasOwnProperty(c.visit))throw Error("Bad value `"+c.visit+"` for `visit` option (should be: "+Object.keys(t).sort().join(`, `)+`)`);u=Mt(u,c.visit),d=Mt(d,c.visit)}if(u===V&&d===V)throw Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");l(e)};return c.break=i,c.skip=a,c.find=function(e,t){let n=null;return c(e,function(e,r,a){if(t.call(this,e,r,a))return n=e,i}),n},c.findLast=function(e,t){let n=null;return c(e,{reverse:!0,enter(e,r,a){if(t.call(this,e,r,a))return n=e,i}}),n},c.findAll=function(e,t){let n=[];return c(e,function(e,r,i){t.call(this,e,r,i)&&n.push(e)}),n},c}function Rt(e,t){let n=this.tokenStart+e,r=this.charCodeAt(n);for((r===43||r===45)&&(t&&this.error(`Number sign is not allowed`),n++);n<this.tokenEnd;n++)N(this.charCodeAt(n))||this.error(`Integer is expected`,n)}function H(e){return Rt.call(this,0,e)}function U(e,t){if(!this.cmpChar(this.tokenStart+e,t)){let n=``;switch(t){case 110:n=`N is expected`;break;case 45:n=`HyphenMinus is expected`}this.error(n,this.tokenStart+e)}}function zt(){let e=0,t=0,n=this.tokenType;for(;n===13||n===25;)n=this.lookupType(++e);if(n!==10){if(this.isDelim(43,e)||this.isDelim(45,e)){t=this.isDelim(43,e)?43:45;do n=this.lookupType(++e);while(n===13||n===25);n!==10&&(this.skip(e),H.call(this,!0))}else return null}return e>0&&this.skip(e),t===0&&(n=this.charCodeAt(this.tokenStart),n!==43&&n!==45&&this.error(`Number sign is expected`)),H.call(this,t!==0),t===45?`-`+this.consume(10):this.consume(10)}const Bt={a:[String,null],b:[String,null]};function Vt(){let e=this.tokenStart,t=null,n=null;if(this.tokenType===10)H.call(this,!1),n=this.consume(10);else if(this.tokenType===1&&this.cmpChar(this.tokenStart,45))switch(t=`-1`,U.call(this,1,110),this.tokenEnd-this.tokenStart){case 2:this.next(),n=zt.call(this);break;case 3:U.call(this,2,45),this.next(),this.skipSC(),H.call(this,!0),n=`-`+this.consume(10);break;default:U.call(this,2,45),Rt.call(this,3,!0),this.next(),n=this.substrToCursor(e+2)}else if(this.tokenType===1||this.isDelim(43)&&this.lookupType(1)===1){let r=0;switch(t=`1`,this.isDelim(43)&&(r=1,this.next()),U.call(this,0,110),this.tokenEnd-this.tokenStart){case 1:this.next(),n=zt.call(this);break;case 2:U.call(this,1,45),this.next(),this.skipSC(),H.call(this,!0),n=`-`+this.consume(10);break;default:U.call(this,1,45),Rt.call(this,2,!0),this.next(),n=this.substrToCursor(e+r+1)}}else if(this.tokenType===12){let r=this.charCodeAt(this.tokenStart),i=r===43||r===45,a=this.tokenStart+i;for(;a<this.tokenEnd&&N(this.charCodeAt(a));a++);a===this.tokenStart+i&&this.error(`Integer is expected`,this.tokenStart+i),U.call(this,a-this.tokenStart,110),t=this.substring(e,a),a+1===this.tokenEnd?(this.next(),n=zt.call(this)):(U.call(this,a-this.tokenStart+1,45),a+2===this.tokenEnd?(this.next(),this.skipSC(),H.call(this,!0),n=`-`+this.consume(10)):(Rt.call(this,a-this.tokenStart+2,!0),this.next(),n=this.substrToCursor(a+1)))}else this.error();return t!==null&&t.charCodeAt(0)===43&&(t=t.substr(1)),n!==null&&n.charCodeAt(0)===43&&(n=n.substr(1)),{type:`AnPlusB`,loc:this.getLocation(e,this.tokenStart),a:t,b:n}}function Ht(e){if(e.a){let t=e.a===`+1`&&`n`||e.a===`1`&&`n`||e.a===`-1`&&`-n`||e.a+`n`;if(e.b){let n=e.b[0]===`-`||e.b[0]===`+`?e.b:`+`+e.b;this.tokenize(t+n)}else this.tokenize(t)}else this.tokenize(e.b)}const Ut=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:Ht,name:`AnPlusB`,parse:Vt,structure:Bt},Symbol.toStringTag,{value:`Module`}));function Wt(){return this.Raw(this.consumeUntilLeftCurlyBracketOrSemicolon,!0)}function Gt(){for(let e=1,t;t=this.lookupType(e);e++){if(t===24)return!0;if(t===23||t===3)return!1}return!1}const Kt={name:String,prelude:[`AtrulePrelude`,`Raw`,null],block:[`Block`,null]};function qt(e=!1){let t=this.tokenStart,n,r,i=null,a=null;switch(this.eat(3),n=this.substrToCursor(t+1),r=n.toLowerCase(),this.skipSC(),this.eof===!1&&this.tokenType!==23&&this.tokenType!==17&&(i=this.parseAtrulePrelude?this.parseWithFallback(this.AtrulePrelude.bind(this,n,e),Wt):Wt.call(this,this.tokenIndex),this.skipSC()),this.tokenType){case 17:this.next();break;case 23:a=hasOwnProperty.call(this.atrule,r)&&typeof this.atrule[r].block==`function`?this.atrule[r].block.call(this,e):this.Block(Gt.call(this))}return{type:`Atrule`,loc:this.getLocation(t,this.tokenStart),name:n,prelude:i,block:a}}function Jt(e){this.token(3,`@`+e.name),e.prelude!==null&&this.node(e.prelude),e.block?this.node(e.block):this.token(17,`;`)}const Yt=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:Jt,name:`Atrule`,parse:qt,structure:Kt,walkContext:`atrule`},Symbol.toStringTag,{value:`Module`})),Xt={children:[[]]};function Zt(e){let t=null;return e!==null&&(e=e.toLowerCase()),this.skipSC(),t=hasOwnProperty.call(this.atrule,e)&&typeof this.atrule[e].prelude==`function`?this.atrule[e].prelude.call(this):this.readSequence(this.scope.AtrulePrelude),this.skipSC(),this.eof!==!0&&this.tokenType!==23&&this.tokenType!==17&&this.error(`Semicolon or block is expected`),{type:`AtrulePrelude`,loc:this.getLocationFromList(t),children:t}}function Qt(e){this.children(e)}const $t=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:Qt,name:`AtrulePrelude`,parse:Zt,structure:Xt,walkContext:`atrulePrelude`},Symbol.toStringTag,{value:`Module`}));function en(){this.eof&&this.error(`Unexpected end of input`);let e=this.tokenStart,t=!1;return this.isDelim(42)?(t=!0,this.next()):this.isDelim(124)||this.eat(1),this.isDelim(124)?this.charCodeAt(this.tokenStart+1)===61?t&&this.error(`Identifier is expected`,this.tokenEnd):(this.next(),this.eat(1)):t&&this.error(`Vertical line is expected`),{type:`Identifier`,loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function tn(){let e=this.tokenStart,t=this.charCodeAt(e);return t!==61&&t!==126&&t!==94&&t!==36&&t!==42&&t!==124&&this.error(`Attribute selector (=, ~=, ^=, $=, *=, |=) is expected`),this.next(),t!==61&&(this.isDelim(61)||this.error(`Equal sign is expected`),this.next()),this.substrToCursor(e)}const nn={name:`Identifier`,matcher:[String,null],value:[`String`,`Identifier`,null],flags:[String,null]};function rn(){let e=this.tokenStart,t,n=null,r=null,i=null;return this.eat(19),this.skipSC(),t=en.call(this),this.skipSC(),this.tokenType!==20&&(this.tokenType!==1&&(n=tn.call(this),this.skipSC(),r=this.tokenType===5?this.String():this.Identifier(),this.skipSC()),this.tokenType===1&&(i=this.consume(1),this.skipSC())),this.eat(20),{type:`AttributeSelector`,loc:this.getLocation(e,this.tokenStart),name:t,matcher:n,value:r,flags:i}}function an(e){this.token(9,`[`),this.node(e.name),e.matcher!==null&&(this.tokenize(e.matcher),this.node(e.value)),e.flags!==null&&this.token(1,e.flags),this.token(9,`]`)}const on=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:an,name:`AttributeSelector`,parse:rn,structure:nn},Symbol.toStringTag,{value:`Module`}));function sn(){return this.Raw(null,!0)}function cn(){return this.parseWithFallback(this.Rule,sn)}function ln(){return this.Raw(this.consumeUntilSemicolonIncluded,!0)}function un(){if(this.tokenType===17)return ln.call(this,this.tokenIndex);let e=this.parseWithFallback(this.Declaration,ln);return this.tokenType===17&&this.next(),e}const dn={children:[[`Atrule`,`Rule`,`Declaration`]]};function fn(e){let t=e?un:cn,n=this.tokenStart,r=this.createList();this.eat(23);t:for(;!this.eof;)switch(this.tokenType){case 24:break t;case 13:case 25:this.next();break;case 3:r.push(this.parseWithFallback(this.Atrule.bind(this,e),sn));break;default:e&&this.isDelim(38)?r.push(cn.call(this)):r.push(t.call(this))}return this.eof||this.eat(24),{type:`Block`,loc:this.getLocation(n,this.tokenStart),children:r}}function pn(e){this.token(23,`{`),this.children(e,e=>{e.type===`Declaration`&&this.token(17,`;`)}),this.token(24,`}`)}const mn=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:pn,name:`Block`,parse:fn,structure:dn,walkContext:`block`},Symbol.toStringTag,{value:`Module`})),hn={children:[[]]};function gn(e,t){let n=this.tokenStart,r=null;return this.eat(19),r=e.call(this,t),this.eof||this.eat(20),{type:`Brackets`,loc:this.getLocation(n,this.tokenStart),children:r}}function _n(e){this.token(9,`[`),this.children(e),this.token(9,`]`)}const vn=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:_n,name:`Brackets`,parse:gn,structure:hn},Symbol.toStringTag,{value:`Module`})),yn=[];function bn(){let e=this.tokenStart;return this.eat(15),{type:`CDC`,loc:this.getLocation(e,this.tokenStart)}}function xn(){this.token(15,`-->`)}const Sn=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:xn,name:`CDC`,parse:bn,structure:yn},Symbol.toStringTag,{value:`Module`})),Cn=[];function wn(){let e=this.tokenStart;return this.eat(14),{type:`CDO`,loc:this.getLocation(e,this.tokenStart)}}function Tn(){this.token(14,`<!--`)}const En=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:Tn,name:`CDO`,parse:wn,structure:Cn},Symbol.toStringTag,{value:`Module`})),Dn={name:String};function On(){return this.eatDelim(46),{type:`ClassSelector`,loc:this.getLocation(this.tokenStart-1,this.tokenEnd),name:this.consume(1)}}function kn(e){this.token(9,`.`),this.token(1,e.name)}const An=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:kn,name:`ClassSelector`,parse:On,structure:Dn},Symbol.toStringTag,{value:`Module`})),jn={name:String};function Mn(){let e=this.tokenStart,t;switch(this.tokenType){case 13:t=` `;break;case 9:switch(this.charCodeAt(this.tokenStart)){case 62:case 43:case 126:this.next();break;case 47:this.next(),this.eatIdent(`deep`),this.eatDelim(47);break;default:this.error(`Combinator is expected`)}t=this.substrToCursor(e)}return{type:`Combinator`,loc:this.getLocation(e,this.tokenStart),name:t}}function Nn(e){this.tokenize(e.name)}const Pn=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:Nn,name:`Combinator`,parse:Mn,structure:jn},Symbol.toStringTag,{value:`Module`})),Fn={value:String};function In(){let e=this.tokenStart,t=this.tokenEnd;return this.eat(25),t-e+2>=2&&this.charCodeAt(t-2)===42&&this.charCodeAt(t-1)===47&&(t-=2),{type:`Comment`,loc:this.getLocation(e,this.tokenStart),value:this.substring(e+2,t)}}function Ln(e){this.token(25,`/*`+e.value+`*/`)}const Rn=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:Ln,name:`Comment`,parse:In,structure:Fn},Symbol.toStringTag,{value:`Module`})),zn=/* @__PURE__ */ new Set([16,22,0]),Bn={kind:String,children:[[`Identifier`,`Feature`,`FeatureFunction`,`FeatureRange`,`SupportsDeclaration`]]};function Vn(e){return this.lookupTypeNonSC(1)===1&&zn.has(this.lookupTypeNonSC(2))?this.Feature(e):this.FeatureRange(e)}const Hn={media:Vn,container:Vn,supports(){return this.SupportsDeclaration()}};function Un(e=`media`){let t=this.createList();t:for(;!this.eof;)switch(this.tokenType){case 25:case 13:this.next();continue;case 1:t.push(this.Identifier());break;case 21:{let n=this.parseWithFallback(()=>Hn[e].call(this,e),()=>null);n||=this.parseWithFallback(()=>{this.eat(21);let t=this.Condition(e);return this.eat(22),t},()=>this.GeneralEnclosed(e)),t.push(n);break}case 2:{let n=this.parseWithFallback(()=>this.FeatureFunction(e),()=>null);n||=this.GeneralEnclosed(e),t.push(n);break}default:break t}return t.isEmpty&&this.error(`Condition is expected`),{type:`Condition`,loc:this.getLocationFromList(t),kind:e,children:t}}function Wn(e){e.children.forEach(e=>{e.type===`Condition`?(this.token(21,`(`),this.node(e),this.token(22,`)`)):this.node(e)})}const Gn=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:Wn,name:`Condition`,parse:Un,structure:Bn},Symbol.toStringTag,{value:`Module`}));function Kn(){return this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!0)}function qn(){return this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!1)}function Jn(){let e=this.tokenIndex,t=this.Value();return t.type!==`Raw`&&this.eof===!1&&this.tokenType!==17&&this.isDelim(33)===!1&&this.isBalanceEdge(e)===!1&&this.error(),t}const Yn={important:[Boolean,String],property:String,value:[`Value`,`Raw`]};function Xn(){let e=this.tokenStart,t=this.tokenIndex,n=Qn.call(this),r=Tt(n),i=r?this.parseCustomProperty:this.parseValue,a=r?qn:Kn,o=!1,s;this.skipSC(),this.eat(16);let c=this.tokenIndex;if(r||this.skipSC(),s=i?this.parseWithFallback(Jn,a):a.call(this,this.tokenIndex),r&&s.type===`Value`&&s.children.isEmpty){for(let e=c-this.tokenIndex;e<=0;e++)if(this.lookupType(e)===13){s.children.appendData({type:`WhiteSpace`,loc:null,value:` `});break}}return this.isDelim(33)&&(o=$n.call(this),this.skipSC()),this.eof===!1&&this.tokenType!==17&&this.isBalanceEdge(t)===!1&&this.error(),{type:`Declaration`,loc:this.getLocation(e,this.tokenStart),important:o,property:n,value:s}}function Zn(e){this.token(1,e.property),this.token(16,`:`),this.node(e.value),e.important&&(this.token(9,`!`),this.token(1,e.important===!0?`important`:e.important))}function Qn(){let e=this.tokenStart;if(this.tokenType===9)switch(this.charCodeAt(this.tokenStart)){case 42:case 36:case 43:case 35:case 38:this.next();break;case 47:this.next(),this.isDelim(47)&&this.next()}return this.tokenType===4?this.eat(4):this.eat(1),this.substrToCursor(e)}function $n(){this.eat(9),this.skipSC();let e=this.consume(1);return e===`important`||e}const er=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:Zn,name:`Declaration`,parse:Xn,structure:Yn,walkContext:`declaration`},Symbol.toStringTag,{value:`Module`}));function tr(){return this.Raw(this.consumeUntilSemicolonIncluded,!0)}const nr={children:[[`Declaration`,`Atrule`,`Rule`]]};function rr(){let e=this.createList();for(;!this.eof;)switch(this.tokenType){case 13:case 25:case 17:this.next();break;case 3:e.push(this.parseWithFallback(this.Atrule.bind(this,!0),tr));break;default:this.isDelim(38)?e.push(this.parseWithFallback(this.Rule,tr)):e.push(this.parseWithFallback(this.Declaration,tr))}return{type:`DeclarationList`,loc:this.getLocationFromList(e),children:e}}function ir(e){this.children(e,e=>{e.type===`Declaration`&&this.token(17,`;`)})}const ar=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:ir,name:`DeclarationList`,parse:rr,structure:nr},Symbol.toStringTag,{value:`Module`})),or={value:String,unit:String};function sr(){let e=this.tokenStart,t=this.consumeNumber(12);return{type:`Dimension`,loc:this.getLocation(e,this.tokenStart),value:t,unit:this.substring(e+t.length,this.tokenStart)}}function cr(e){this.token(12,e.value+e.unit)}const lr=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:cr,name:`Dimension`,parse:sr,structure:or},Symbol.toStringTag,{value:`Module`})),ur={kind:String,name:String,value:[`Identifier`,`Number`,`Dimension`,`Ratio`,`Function`,null]};function dr(e){let t=this.tokenStart,n,r=null;if(this.eat(21),this.skipSC(),n=this.consume(1),this.skipSC(),this.tokenType!==22){switch(this.eat(16),this.skipSC(),this.tokenType){case 10:r=this.lookupNonWSType(1)===9?this.Ratio():this.Number();break;case 12:r=this.Dimension();break;case 1:r=this.Identifier();break;case 2:r=this.parseWithFallback(()=>{let e=this.Function(this.readSequence,this.scope.Value);return this.skipSC(),this.isDelim(47)&&this.error(),e},()=>this.Ratio());break;default:this.error(`Number, dimension, ratio or identifier is expected`)}this.skipSC()}return this.eof||this.eat(22),{type:`Feature`,loc:this.getLocation(t,this.tokenStart),kind:e,name:n,value:r}}function fr(e){this.token(21,`(`),this.token(1,e.name),e.value!==null&&(this.token(16,`:`),this.node(e.value)),this.token(22,`)`)}const pr=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:fr,name:`Feature`,parse:dr,structure:ur},Symbol.toStringTag,{value:`Module`})),mr={kind:String,feature:String,value:[`Declaration`,`Selector`]};function hr(e,t){let n=(this.features[e]||{})[t];return typeof n!=`function`&&this.error(`Unknown feature ${t}()`),n}function gr(e=`unknown`){let t=this.tokenStart,n=this.consumeFunctionName(),r=hr.call(this,e,n.toLowerCase());this.skipSC();let i=this.parseWithFallback(()=>{let e=this.tokenIndex,t=r.call(this);return this.eof===!1&&this.isBalanceEdge(e)===!1&&this.error(),t},()=>this.Raw(null,!1));return this.eof||this.eat(22),{type:`FeatureFunction`,loc:this.getLocation(t,this.tokenStart),kind:e,feature:n,value:i}}function _r(e){this.token(2,e.feature+`(`),this.node(e.value),this.token(22,`)`)}const vr=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:_r,name:`FeatureFunction`,parse:gr,structure:mr},Symbol.toStringTag,{value:`Module`})),yr={kind:String,left:[`Identifier`,`Number`,`Dimension`,`Ratio`,`Function`],leftComparison:String,middle:[`Identifier`,`Number`,`Dimension`,`Ratio`,`Function`],rightComparison:[String,null],right:[`Identifier`,`Number`,`Dimension`,`Ratio`,`Function`,null]};function br(){switch(this.skipSC(),this.tokenType){case 10:return this.isDelim(47,this.lookupOffsetNonSC(1))?this.Ratio():this.Number();case 12:return this.Dimension();case 1:return this.Identifier();case 2:return this.parseWithFallback(()=>{let e=this.Function(this.readSequence,this.scope.Value);return this.skipSC(),this.isDelim(47)&&this.error(),e},()=>this.Ratio());default:this.error(`Number, dimension, ratio or identifier is expected`)}}function xr(e){if(this.skipSC(),this.isDelim(60)||this.isDelim(62)){let e=this.source[this.tokenStart];return this.next(),this.isDelim(61)?(this.next(),e+`=`):e}if(this.isDelim(61))return`=`;this.error(`Expected ${e?`":", `:``}"<", ">", "=" or ")"`)}function Sr(e=`unknown`){let t=this.tokenStart;this.skipSC(),this.eat(21);let n=br.call(this),r=xr.call(this,n.type===`Identifier`),i=br.call(this),a=null,o=null;return this.lookupNonWSType(0)!==22&&(a=xr.call(this),o=br.call(this)),this.skipSC(),this.eat(22),{type:`FeatureRange`,loc:this.getLocation(t,this.tokenStart),kind:e,left:n,leftComparison:r,middle:i,rightComparison:a,right:o}}function Cr(e){this.token(21,`(`),this.node(e.left),this.tokenize(e.leftComparison),this.node(e.middle),e.right&&(this.tokenize(e.rightComparison),this.node(e.right)),this.token(22,`)`)}const wr=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:Cr,name:`FeatureRange`,parse:Sr,structure:yr},Symbol.toStringTag,{value:`Module`})),Tr={name:String,children:[[]]};function Er(e,t){let n=this.tokenStart,r=this.consumeFunctionName(),i=r.toLowerCase(),a;return a=t.hasOwnProperty(i)?t[i].call(this,t):e.call(this,t),this.eof||this.eat(22),{type:`Function`,loc:this.getLocation(n,this.tokenStart),name:r,children:a}}function Dr(e){this.token(2,e.name+`(`),this.children(e),this.token(22,`)`)}const Or=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:Dr,name:`Function`,parse:Er,structure:Tr,walkContext:`function`},Symbol.toStringTag,{value:`Module`})),kr={kind:String,function:[String,null],children:[[]]};function Ar(e){let t=this.tokenStart,n=null;this.tokenType===2?n=this.consumeFunctionName():this.eat(21);let r=this.parseWithFallback(()=>{let e=this.tokenIndex,t=this.readSequence(this.scope.Value);return this.eof===!1&&this.isBalanceEdge(e)===!1&&this.error(),t},()=>this.createSingleNodeList(this.Raw(null,!1)));return this.eof||this.eat(22),{type:`GeneralEnclosed`,loc:this.getLocation(t,this.tokenStart),kind:e,function:n,children:r}}function jr(e){e.function?this.token(2,e.function+`(`):this.token(21,`(`),this.children(e),this.token(22,`)`)}const Mr=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:jr,name:`GeneralEnclosed`,parse:Ar,structure:kr},Symbol.toStringTag,{value:`Module`})),Nr={value:String};function Pr(){let e=this.tokenStart;return this.eat(4),{type:`Hash`,loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e+1)}}function Fr(e){this.token(4,`#`+e.value)}const Ir=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:Fr,name:`Hash`,parse:Pr,structure:Nr,xxx:`XXX`},Symbol.toStringTag,{value:`Module`})),Lr={name:String};function Rr(){return{type:`Identifier`,loc:this.getLocation(this.tokenStart,this.tokenEnd),name:this.consume(1)}}function zr(e){this.token(1,e.name)}const Br=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:zr,name:`Identifier`,parse:Rr,structure:Lr},Symbol.toStringTag,{value:`Module`})),Vr={name:String};function Hr(){let e=this.tokenStart;return this.eat(4),{type:`IdSelector`,loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e+1)}}function Ur(e){this.token(9,`#`+e.name)}const Wr=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:Ur,name:`IdSelector`,parse:Hr,structure:Vr},Symbol.toStringTag,{value:`Module`})),Gr={name:String};function Kr(){let e=this.tokenStart,t=this.consume(1);for(;this.isDelim(46);)this.eat(9),t+=`.`+this.consume(1);return{type:`Layer`,loc:this.getLocation(e,this.tokenStart),name:t}}function qr(e){this.tokenize(e.name)}const Jr=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:qr,name:`Layer`,parse:Kr,structure:Gr},Symbol.toStringTag,{value:`Module`})),Yr={children:[[`Layer`]]};function Xr(){let e=this.createList();for(this.skipSC();!this.eof&&(e.push(this.Layer()),this.lookupTypeNonSC(0)===18);)this.skipSC(),this.next(),this.skipSC();return{type:`LayerList`,loc:this.getLocationFromList(e),children:e}}function Zr(e){this.children(e,()=>this.token(18,`,`))}const Qr=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:Zr,name:`LayerList`,parse:Xr,structure:Yr},Symbol.toStringTag,{value:`Module`})),$r={modifier:[String,null],mediaType:[String,null],condition:[`Condition`,null]};function ei(){let e=this.tokenStart,t=null,n=null,r=null;if(this.skipSC(),this.tokenType===1&&this.lookupTypeNonSC(1)!==21){let e=this.consume(1),i=e.toLowerCase();switch(i===`not`||i===`only`?(this.skipSC(),t=i,n=this.consume(1)):n=e,this.lookupTypeNonSC(0)){case 1:this.skipSC(),this.eatIdent(`and`),r=this.Condition(`media`);break;case 23:case 17:case 18:case 0:break;default:this.error(`Identifier or parenthesis is expected`)}}else switch(this.tokenType){case 1:case 21:case 2:r=this.Condition(`media`);break;case 23:case 17:case 0:break;default:this.error(`Identifier or parenthesis is expected`)}return{type:`MediaQuery`,loc:this.getLocation(e,this.tokenStart),modifier:t,mediaType:n,condition:r}}function ti(e){e.mediaType?(e.modifier&&this.token(1,e.modifier),this.token(1,e.mediaType),e.condition&&(this.token(1,`and`),this.node(e.condition))):e.condition&&this.node(e.condition)}const ni=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:ti,name:`MediaQuery`,parse:ei,structure:$r},Symbol.toStringTag,{value:`Module`})),ri={children:[[`MediaQuery`]]};function ii(){let e=this.createList();for(this.skipSC();!this.eof&&(e.push(this.MediaQuery()),this.tokenType===18);)this.next();return{type:`MediaQueryList`,loc:this.getLocationFromList(e),children:e}}function ai(e){this.children(e,()=>this.token(18,`,`))}const oi=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:ai,name:`MediaQueryList`,parse:ii,structure:ri},Symbol.toStringTag,{value:`Module`})),si={};function ci(){let e=this.tokenStart;return this.eatDelim(38),{type:`NestingSelector`,loc:this.getLocation(e,this.tokenStart)}}function li(){this.token(9,`&`)}const ui=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:li,name:`NestingSelector`,parse:ci,structure:si},Symbol.toStringTag,{value:`Module`})),di={nth:[`AnPlusB`,`Identifier`],selector:[`SelectorList`,null]};function fi(){this.skipSC();let e=this.tokenStart,t=e,n=null,r;return r=this.lookupValue(0,`odd`)||this.lookupValue(0,`even`)?this.Identifier():this.AnPlusB(),t=this.tokenStart,this.skipSC(),this.lookupValue(0,`of`)&&(this.next(),n=this.SelectorList(),t=this.tokenStart),{type:`Nth`,loc:this.getLocation(e,t),nth:r,selector:n}}function pi(e){this.node(e.nth),e.selector!==null&&(this.token(1,`of`),this.node(e.selector))}const mi=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:pi,name:`Nth`,parse:fi,structure:di},Symbol.toStringTag,{value:`Module`})),hi={value:String};function gi(){return{type:`Number`,loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consume(10)}}function _i(e){this.token(10,e.value)}const vi=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:_i,name:`Number`,parse:gi,structure:hi},Symbol.toStringTag,{value:`Module`})),yi={value:String};function bi(){let e=this.tokenStart;return this.next(),{type:`Operator`,loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function xi(e){this.tokenize(e.value)}const Si=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:xi,name:`Operator`,parse:bi,structure:yi},Symbol.toStringTag,{value:`Module`})),Ci={children:[[]]};function wi(e,t){let n=this.tokenStart,r=null;return this.eat(21),r=e.call(this,t),this.eof||this.eat(22),{type:`Parentheses`,loc:this.getLocation(n,this.tokenStart),children:r}}function Ti(e){this.token(21,`(`),this.children(e),this.token(22,`)`)}const Ei=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:Ti,name:`Parentheses`,parse:wi,structure:Ci},Symbol.toStringTag,{value:`Module`})),Di={value:String};function Oi(){return{type:`Percentage`,loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consumeNumber(11)}}function ki(e){this.token(11,e.value+`%`)}const Ai=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:ki,name:`Percentage`,parse:Oi,structure:Di},Symbol.toStringTag,{value:`Module`})),ji={name:String,children:[[`Raw`],null]};function Mi(){let e=this.tokenStart,t=null,n,r;return this.eat(16),this.tokenType===2?(n=this.consumeFunctionName(),r=n.toLowerCase(),this.lookupNonWSType(0)==22?t=this.createList():hasOwnProperty.call(this.pseudo,r)?(this.skipSC(),t=this.pseudo[r].call(this),this.skipSC()):(t=this.createList(),t.push(this.Raw(null,!1))),this.eat(22)):n=this.consume(1),{type:`PseudoClassSelector`,loc:this.getLocation(e,this.tokenStart),name:n,children:t}}function Ni(e){this.token(16,`:`),e.children===null?this.token(1,e.name):(this.token(2,e.name+`(`),this.children(e),this.token(22,`)`))}const Pi=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:Ni,name:`PseudoClassSelector`,parse:Mi,structure:ji,walkContext:`function`},Symbol.toStringTag,{value:`Module`})),Fi={name:String,children:[[`Raw`],null]};function Ii(){let e=this.tokenStart,t=null,n,r;return this.eat(16),this.eat(16),this.tokenType===2?(n=this.consumeFunctionName(),r=n.toLowerCase(),this.lookupNonWSType(0)==22?t=this.createList():hasOwnProperty.call(this.pseudo,r)?(this.skipSC(),t=this.pseudo[r].call(this),this.skipSC()):(t=this.createList(),t.push(this.Raw(null,!1))),this.eat(22)):n=this.consume(1),{type:`PseudoElementSelector`,loc:this.getLocation(e,this.tokenStart),name:n,children:t}}function Li(e){this.token(16,`:`),this.token(16,`:`),e.children===null?this.token(1,e.name):(this.token(2,e.name+`(`),this.children(e),this.token(22,`)`))}const Ri=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:Li,name:`PseudoElementSelector`,parse:Ii,structure:Fi,walkContext:`function`},Symbol.toStringTag,{value:`Module`}));function zi(){switch(this.skipSC(),this.tokenType){case 10:return this.Number();case 2:return this.Function(this.readSequence,this.scope.Value);default:this.error(`Number of function is expected`)}}const Bi={left:[`Number`,`Function`],right:[`Number`,`Function`,null]};function Vi(){let e=this.tokenStart,t=zi.call(this),n=null;return this.skipSC(),this.isDelim(47)&&(this.eatDelim(47),n=zi.call(this)),{type:`Ratio`,loc:this.getLocation(e,this.tokenStart),left:t,right:n}}function Hi(e){this.node(e.left),this.token(9,`/`),e.right?this.node(e.right):this.node(10,1)}const Ui=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:Hi,name:`Ratio`,parse:Vi,structure:Bi},Symbol.toStringTag,{value:`Module`}));function Wi(){return this.tokenIndex>0&&this.lookupType(-1)===13?this.tokenIndex>1?this.getTokenStart(this.tokenIndex-1):this.firstCharOffset:this.tokenStart}const Gi={value:String};function Ki(e,t){let n=this.getTokenStart(this.tokenIndex),r;return this.skipUntilBalanced(this.tokenIndex,e||this.consumeUntilBalanceEnd),r=t&&this.tokenStart>n?Wi.call(this):this.tokenStart,{type:`Raw`,loc:this.getLocation(n,r),value:this.substring(n,r)}}function qi(e){this.tokenize(e.value)}const Ji=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:qi,name:`Raw`,parse:Ki,structure:Gi},Symbol.toStringTag,{value:`Module`}));function Yi(){return this.Raw(this.consumeUntilLeftCurlyBracket,!0)}function Xi(){let e=this.SelectorList();return e.type!==`Raw`&&this.eof===!1&&this.tokenType!==23&&this.error(),e}const Zi={prelude:[`SelectorList`,`Raw`],block:[`Block`]};function Qi(){let e=this.tokenIndex,t=this.tokenStart,n,r;return n=this.parseRulePrelude?this.parseWithFallback(Xi,Yi):Yi.call(this,e),r=this.Block(!0),{type:`Rule`,loc:this.getLocation(t,this.tokenStart),prelude:n,block:r}}function $i(e){this.node(e.prelude),this.node(e.block)}const ea=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:$i,name:`Rule`,parse:Qi,structure:Zi,walkContext:`rule`},Symbol.toStringTag,{value:`Module`})),ta={root:[`SelectorList`,`Raw`,null],limit:[`SelectorList`,`Raw`,null]};function na(){let e=null,t=null;this.skipSC();let n=this.tokenStart;return this.tokenType===21&&(this.next(),this.skipSC(),e=this.parseWithFallback(this.SelectorList,()=>this.Raw(!1,!0)),this.skipSC(),this.eat(22)),this.lookupNonWSType(0)===1&&(this.skipSC(),this.eatIdent(`to`),this.skipSC(),this.eat(21),this.skipSC(),t=this.parseWithFallback(this.SelectorList,()=>this.Raw(!1,!0)),this.skipSC(),this.eat(22)),{type:`Scope`,loc:this.getLocation(n,this.tokenStart),root:e,limit:t}}function ra(e){e.root&&(this.token(21,`(`),this.node(e.root),this.token(22,`)`)),e.limit&&(this.token(1,`to`),this.token(21,`(`),this.node(e.limit),this.token(22,`)`))}const ia=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:ra,name:`Scope`,parse:na,structure:ta},Symbol.toStringTag,{value:`Module`})),aa={children:[[`TypeSelector`,`IdSelector`,`ClassSelector`,`AttributeSelector`,`PseudoClassSelector`,`PseudoElementSelector`,`Combinator`]]};function oa(){let e=this.readSequence(this.scope.Selector);return this.getFirstListNode(e)===null&&this.error(`Selector is expected`),{type:`Selector`,loc:this.getLocationFromList(e),children:e}}function sa(e){this.children(e)}const ca=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:sa,name:`Selector`,parse:oa,structure:aa},Symbol.toStringTag,{value:`Module`})),la={children:[[`Selector`,`Raw`]]};function ua(){let e=this.createList();for(;!this.eof&&(e.push(this.Selector()),this.tokenType===18);)this.next();return{type:`SelectorList`,loc:this.getLocationFromList(e),children:e}}function da(e){this.children(e,()=>this.token(18,`,`))}const fa=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:da,name:`SelectorList`,parse:ua,structure:la,walkContext:`selector`},Symbol.toStringTag,{value:`Module`})),pa={value:String};function ma(){return{type:`String`,loc:this.getLocation(this.tokenStart,this.tokenEnd),value:Et(this.consume(5))}}function ha(e){this.token(5,Dt(e.value))}const ga=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:ha,name:`String`,parse:ma,structure:pa},Symbol.toStringTag,{value:`Module`}));function _a(){return this.Raw(null,!1)}const va={children:[[`Comment`,`CDO`,`CDC`,`Atrule`,`Rule`,`Raw`]]};function ya(){let e=this.tokenStart,t=this.createList(),n;for(;!this.eof;){switch(this.tokenType){case 13:this.next();continue;case 25:if(this.charCodeAt(this.tokenStart+2)!==33){this.next();continue}n=this.Comment();break;case 14:n=this.CDO();break;case 15:n=this.CDC();break;case 3:n=this.parseWithFallback(this.Atrule,_a);break;default:n=this.parseWithFallback(this.Rule,_a)}t.push(n)}return{type:`StyleSheet`,loc:this.getLocation(e,this.tokenStart),children:t}}function ba(e){this.children(e)}const xa=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:ba,name:`StyleSheet`,parse:ya,structure:va,walkContext:`stylesheet`},Symbol.toStringTag,{value:`Module`})),Sa={declaration:`Declaration`};function Ca(){let e=this.tokenStart;this.eat(21),this.skipSC();let t=this.Declaration();return this.eof||this.eat(22),{type:`SupportsDeclaration`,loc:this.getLocation(e,this.tokenStart),declaration:t}}function wa(e){this.token(21,`(`),this.node(e.declaration),this.token(22,`)`)}const Ta=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:wa,name:`SupportsDeclaration`,parse:Ca,structure:Sa},Symbol.toStringTag,{value:`Module`}));function Ea(){this.tokenType!==1&&this.isDelim(42)===!1&&this.error(`Identifier or asterisk is expected`),this.next()}const Da={name:String};function Oa(){let e=this.tokenStart;return this.isDelim(124)?(this.next(),Ea.call(this)):(Ea.call(this),this.isDelim(124)&&(this.next(),Ea.call(this))),{type:`TypeSelector`,loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function ka(e){this.tokenize(e.name)}const Aa=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:ka,name:`TypeSelector`,parse:Oa,structure:Da},Symbol.toStringTag,{value:`Module`}));function ja(e,t){let n=0;for(let r=this.tokenStart+e;r<this.tokenEnd;r++){let i=this.charCodeAt(r);if(i===45&&t&&n!==0)return ja.call(this,e+n+1,!1),-1;P(i)||this.error(t&&n!==0?`Hyphen minus`+(n<6?` or hex digit`:``)+` is expected`:n<6?`Hex digit is expected`:`Unexpected input`,r),++n>6&&this.error(`Too many hex digits`,r)}return this.next(),n}function Ma(e){let t=0;for(;this.isDelim(63);)++t>e&&this.error(`Too many question marks`),this.next()}function Na(e){this.charCodeAt(this.tokenStart)!==e&&this.error((e===43?`Plus sign`:`Hyphen minus`)+` is expected`)}function Pa(){let e=0;switch(this.tokenType){case 10:if(e=ja.call(this,1,!0),this.isDelim(63)){Ma.call(this,6-e);break}if(this.tokenType===12||this.tokenType===10){Na.call(this,45),ja.call(this,1,!1);break}break;case 12:e=ja.call(this,1,!0),e>0&&Ma.call(this,6-e);break;default:if(this.eatDelim(43),this.tokenType===1){e=ja.call(this,0,!0),e>0&&Ma.call(this,6-e);break}if(this.isDelim(63)){this.next(),Ma.call(this,5);break}this.error(`Hex digit or question mark is expected`)}}const Fa={value:String};function Ia(){let e=this.tokenStart;return this.eatIdent(`u`),Pa.call(this),{type:`UnicodeRange`,loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function La(e){this.tokenize(e.value)}const Ra=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:La,name:`UnicodeRange`,parse:Ia,structure:Fa},Symbol.toStringTag,{value:`Module`})),za={value:String};function Ba(){let e=this.tokenStart,t;switch(this.tokenType){case 7:t=Ot(this.consume(7));break;case 2:this.cmpStr(this.tokenStart,this.tokenEnd,`url(`)||this.error("Function name must be `url`"),this.eat(2),this.skipSC(),t=Et(this.consume(5)),this.skipSC(),this.eof||this.eat(22);break;default:this.error(`Url or Function is expected`)}return{type:`Url`,loc:this.getLocation(e,this.tokenStart),value:t}}function Va(e){this.token(7,kt(e.value))}const Ha=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:Va,name:`Url`,parse:Ba,structure:za},Symbol.toStringTag,{value:`Module`})),Ua={children:[[]]};function Wa(){let e=this.tokenStart,t=this.readSequence(this.scope.Value);return{type:`Value`,loc:this.getLocation(e,this.tokenStart),children:t}}function Ga(e){this.children(e)}const Ka=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:Ga,name:`Value`,parse:Wa,structure:Ua},Symbol.toStringTag,{value:`Module`})),qa=Object.freeze({type:`WhiteSpace`,loc:null,value:` `}),Ja={value:String};function Ya(){return this.eat(13),qa}function Xa(e){this.token(13,e.value)}const W=Lt({node:/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,AnPlusB:Ut,Atrule:Yt,AtrulePrelude:$t,AttributeSelector:on,Block:mn,Brackets:vn,CDC:Sn,CDO:En,ClassSelector:An,Combinator:Pn,Comment:Rn,Condition:Gn,Declaration:er,DeclarationList:ar,Dimension:lr,Feature:pr,FeatureFunction:vr,FeatureRange:wr,Function:Or,GeneralEnclosed:Mr,Hash:Ir,IdSelector:Wr,Identifier:Br,Layer:Jr,LayerList:Qr,MediaQuery:ni,MediaQueryList:oi,NestingSelector:ui,Nth:mi,Number:vi,Operator:Si,Parentheses:Ei,Percentage:Ai,PseudoClassSelector:Pi,PseudoElementSelector:Ri,Ratio:Ui,Raw:Ji,Rule:ea,Scope:ia,Selector:ca,SelectorList:fa,String:ga,StyleSheet:xa,SupportsDeclaration:Ta,TypeSelector:Aa,UnicodeRange:Ra,Url:Ha,Value:Ka,WhiteSpace:/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,generate:Xa,name:`WhiteSpace`,parse:Ya,structure:Ja},Symbol.toStringTag,{value:`Module`}))},Symbol.toStringTag,{value:`Module`}))}),Za=[`left`,`right`,`top`,`bottom`,`inset-block-start`,`inset-block-end`,`inset-inline-start`,`inset-inline-end`,`inset-block`,`inset-inline`,`inset`];function Qa(e){return Za.includes(e)}const $a=[`margin-block-start`,`margin-block-end`,`margin-block`,`margin-inline-start`,`margin-inline-end`,`margin-inline`,`margin-bottom`,`margin-left`,`margin-right`,`margin-top`,`margin`];function eo(e){return $a.includes(e)}const to=[`width`,`height`,`min-width`,`min-height`,`max-width`,`max-height`,`block-size`,`inline-size`,`min-block-size`,`min-inline-size`,`max-block-size`,`max-inline-size`];function no(e){return to.includes(e)}const ro=[`justify-self`,`align-self`,`place-self`];function io(e){return ro.includes(e)}const ao=[...Za,...$a,...to,...ro,`position-anchor`,`position-area`],oo=[...to,...Za,...$a];function so(e){return oo.includes(e)}const co=[`top`,`left`,`right`,`bottom`,`start`,`end`,`self-start`,`self-end`,`center`,`inside`,`outside`];function lo(e){return co.includes(e)}const uo=[`width`,`height`,`block`,`inline`,`self-block`,`self-inline`];function fo(e){return uo.includes(e)}const po=/* @__PURE__ */ new Set([`Atrule`,`Selector`,`Declaration`]);function mo(e){let t=new SourceMapGenerator,n={line:1,column:0},r={line:0,column:0},i={line:1,column:0},a={generated:i},o=1,s=0,c=!1,l=e.node;e.node=function(e){if(e.loc&&e.loc.start&&po.has(e.type)){let l=e.loc.start.line,u=e.loc.start.column-1;(r.line!==l||r.column!==u)&&(r.line=l,r.column=u,n.line=o,n.column=s,c&&(c=!1,(n.line!==i.line||n.column!==i.column)&&t.addMapping(a)),c=!0,t.addMapping({source:e.loc.source,original:r,generated:n}))}l.call(this,e),c&&po.has(e.type)&&(i.line=o,i.column=s)};let u=e.emit;e.emit=function(e,t,n){for(let t=0;t<e.length;t++)e.charCodeAt(t)===10?(o++,s=0):s++;u(e,t,n)};let d=e.result;return e.result=function(){return c&&t.addMapping(a),{css:d(),map:t}},e}const ho=(e,t)=>{if(e===9&&(e=t),typeof e==`string`){let t=e.charCodeAt(0);return t>127?32768:t<<8}return e},go=[[1,1],[1,2],[1,7],[1,8],[1,`-`],[1,10],[1,11],[1,12],[1,15],[1,21],[3,1],[3,2],[3,7],[3,8],[3,`-`],[3,10],[3,11],[3,12],[3,15],[4,1],[4,2],[4,7],[4,8],[4,`-`],[4,10],[4,11],[4,12],[4,15],[12,1],[12,2],[12,7],[12,8],[12,`-`],[12,10],[12,11],[12,12],[12,15],[`#`,1],[`#`,2],[`#`,7],[`#`,8],[`#`,`-`],[`#`,10],[`#`,11],[`#`,12],[`#`,15],[`-`,1],[`-`,2],[`-`,7],[`-`,8],[`-`,`-`],[`-`,10],[`-`,11],[`-`,12],[`-`,15],[10,1],[10,2],[10,7],[10,8],[10,10],[10,11],[10,12],[10,`%`],[10,15],[`@`,1],[`@`,2],[`@`,7],[`@`,8],[`@`,`-`],[`@`,15],[`.`,10],[`.`,11],[`.`,12],[`+`,10],[`+`,11],[`+`,12],[`/`,`*`]],_o=go.concat([[1,4],[12,4],[4,4],[3,21],[3,5],[3,16],[11,11],[11,12],[11,2],[11,`-`],[22,1],[22,2],[22,11],[22,12],[22,4],[22,`-`]]);function vo(e){let t=new Set(e.map(([e,t])=>ho(e)<<16|ho(t)));return function(e,n,r){let i=ho(n,r),a=r.charCodeAt(0);return(a===45&&n!==1&&n!==2&&n!==15||a===43?t.has(e<<16|a<<8):t.has(e<<16|i))&&this.emit(` `,13,!0),i}}const yo=vo(go),bo=vo(_o),xo=/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,safe:bo,spec:yo},Symbol.toStringTag,{value:`Module`}));function So(e,t){if(typeof t==`function`){let n=null;e.children.forEach(e=>{n!==null&&t.call(this,n),this.node(e),n=e})}else e.children.forEach(this.node,this)}function Co(e){wt(e,(t,n,r)=>{this.token(t,e.slice(n,r))})}function wo(e){let t=/* @__PURE__ */ new Map;for(let[n,r]of Object.entries(e.node))typeof(r.generate||r)==`function`&&t.set(n,r.generate||r);return function(e,n){let r=``,i=0,a={node(e){if(t.has(e.type))t.get(e.type).call(o,e);else throw Error(`Unknown node type: `+e.type)},tokenBefore:bo,token(e,t){i=this.tokenBefore(i,e,t),this.emit(t,e,!1),e===9&&t.charCodeAt(0)===92&&this.emit(`
2
2
  `,13,!0)},emit(e){r+=e},result(){return r}};n&&(typeof n.decorator==`function`&&(a=n.decorator(a)),n.sourceMap&&(a=mo(a)),n.mode in xo&&(a.tokenBefore=xo[n.mode]));let o={node:e=>a.node(e),children:So,token:(e,t)=>a.token(e,t),tokenize:Co};return a.node(e),a.result()}}const To=wo({node:/* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({__proto__:null,AnPlusB:Ht,Atrule:Jt,AtrulePrelude:Qt,AttributeSelector:an,Block:pn,Brackets:_n,CDC:xn,CDO:Tn,ClassSelector:kn,Combinator:Nn,Comment:Ln,Condition:Wn,Declaration:Zn,DeclarationList:ir,Dimension:cr,Feature:fr,FeatureFunction:_r,FeatureRange:Cr,Function:Dr,GeneralEnclosed:jr,Hash:Fr,IdSelector:Ur,Identifier:zr,Layer:qr,LayerList:Zr,MediaQuery:ti,MediaQueryList:ai,NestingSelector:li,Nth:pi,Number:_i,Operator:xi,Parentheses:Ti,Percentage:ki,PseudoClassSelector:Ni,PseudoElementSelector:Li,Ratio:Hi,Raw:qi,Rule:$i,Scope:ra,Selector:sa,SelectorList:da,String:ha,StyleSheet:ba,SupportsDeclaration:wa,TypeSelector:ka,UnicodeRange:La,Url:Va,Value:Ga,WhiteSpace:Xa},Symbol.toStringTag,{value:`Module`}))});function Eo(e,t){let n=Object.create(SyntaxError.prototype),r=/* @__PURE__ */ Error();return Object.assign(n,{name:e,message:t,get stack(){return(r.stack||``).replace(/^(.+\n){1,3}/,`${e}: ${t}
3
3
  `)}})}function Do({source:e,line:t,column:n,baseLine:r,baseColumn:i},a){function o(e,t){return s.slice(e,t).map((t,n)=>String(e+n+1).padStart(u)+` |`+t).join(`
4
4
  `)}let s=(`
@@ -14,4 +14,4 @@ var e=Object.defineProperty,t=Object.defineProperties,n=Object.getOwnPropertyDes
14
14
  --pa-value-align-self: var(${e}-align-self);
15
15
  }
16
16
  `.replaceAll(`
17
- `,``)}const pc=[`normal`,`most-width`,`most-height`,`most-block-size`,`most-inline-size`],mc=[`flip-block`,`flip-inline`,`flip-start`];function hc(e){return e.type===`Declaration`}function gc(e){return e.type===`Declaration`&&e.property===`position-try-fallbacks`}function _c(e){return e.type===`Declaration`&&e.property===`position-try-order`}function vc(e){return e.type===`Declaration`&&e.property===`position-try`}function yc(e){return e.type===`Atrule`&&e.name===`position-try`}function bc(e){return mc.includes(e)}function xc(e){return pc.includes(e)}function Sc(e,t){let n=document.querySelector(e);if(n){let e=wc(n);return t.forEach(t=>{e=Nc(e,t)}),e}}function Cc(e,t){let n=e.declarations;return t.forEach(e=>{n=Nc(n,e)}),n}function wc(e){let t={};return ao.forEach(n=>{let r=Y(e,`--${n}-${ns}`);r&&(t[n]=r)}),t}const Tc={"flip-block":{top:`bottom`,bottom:`top`,"inset-block-start":`inset-block-end`,"inset-block-end":`inset-block-start`,"margin-top":`margin-bottom`,"margin-bottom":`margin-top`},"flip-inline":{left:`right`,right:`left`,"inset-inline-start":`inset-inline-end`,"inset-inline-end":`inset-inline-start`,"margin-left":`margin-right`,"margin-right":`margin-left`},"flip-start":{left:`top`,right:`bottom`,top:`left`,bottom:`right`,"inset-block-start":`inset-block-end`,"inset-block-end":`inset-block-start`,"inset-inline-start":`inset-inline-end`,"inset-inline-end":`inset-inline-start`,"inset-block":`inset-inline`,"inset-inline":`inset-block`}},Ec={"flip-block":{top:`bottom`,bottom:`top`,start:`end`,end:`start`,"self-end":`self-start`,"self-start":`self-end`},"flip-inline":{left:`right`,right:`left`,start:`end`,end:`start`,"self-end":`self-start`,"self-start":`self-end`},"flip-start":{top:`left`,left:`top`,right:`bottom`,bottom:`right`}},Dc={"flip-block":{top:`bottom`,bottom:`top`,start:`end`,end:`start`},"flip-inline":{left:`right`,right:`left`,start:`end`,end:`start`},"flip-start":{}};function Oc(e,t){return Tc[t][e]||e}function kc(e,t){return Ec[t][e]||e}function Ac(e,t){if(t===`flip-start`)return e;{let n=Dc[t];return e.split(`-`).map(e=>n[e]||e).join(`-`)}}function jc(e,t,n){if(e===`margin`){let[e,r,i,a]=t.children.toArray();n===`flip-block`?a?t.children.fromArray([i,r,e,a]):i&&t.children.fromArray([i,r,e]):n===`flip-inline`&&a&&t.children.fromArray([e,a,i,r])}else if(e===`margin-block`){let[e,r]=t.children.toArray();n===`flip-block`&&r&&t.children.fromArray([r,e])}else if(e===`margin-inline`){let[e,r]=t.children.toArray();n===`flip-inline`&&r&&t.children.fromArray([r,e])}}const Mc=(e,t)=>(q(`#id{${e}: ${t};}`).children.first?.block.children.first).value;function Nc(e,t){let n={};return Object.entries(e).forEach(([e,r])=>{let i=e,a=Mc(i,r),o=Oc(i,t);o!==i&&(n[i]??(n[i]=`revert`)),W(a,{visit:`Function`,enter(e){is(e)&&e.children.forEach(e=>{nl(e)&&lo(e.name)&&(e.name=kc(e.name,t))})}}),i===`position-area`&&a.children.forEach(e=>{nl(e)&&Ls(e.name)&&(e.name=Ac(e.name,t))}),i.startsWith(`margin`)&&jc(i,a,t),n[o]=J(a)}),n}function Pc(e){let t=os(e),n=[];return t.forEach(e=>{let t={atRules:[],tactics:[],positionAreas:[]};e.forEach(e=>{bc(e.name)?t.tactics.push(e.name):e.name.startsWith(`--`)?t.atRules.push(e.name):Ls(e.name)&&t.positionAreas.push(e.name)}),t.positionAreas.length?n.push({positionArea:t.positionAreas[0],type:`position-area`}):t.atRules.length&&t.tactics.length?n.push({tactics:t.tactics,atRule:t.atRules[0],type:`at-rule-with-try-tactic`}):t.atRules.length?n.push({atRule:t.atRules[0],type:`at-rule`}):t.tactics.length&&n.push({tactics:t.tactics,type:`try-tactic`})}),n}function Fc(e){return gc(e)&&e.value.children.first?Pc(e.value.children):[]}function Ic(e){if(vc(e)&&e.value.children.first){let t=Je(e),n,r=t.value.children.first.name;r&&xc(r)&&(n=r,t.value.children.shift());let i=Pc(t.value.children);return{order:n,options:i}}return{}}function Lc(e){return _c(e)&&e.value.children.first?{order:e.value.children.first.name}:{}}function Rc(e){let{order:t,options:n}=Ic(e);if(t||n)return{order:t,options:n};let{order:r}=Lc(e),i=Fc(e);return r||i?{order:r,options:i}:{}}function zc(e){return Qa(e.property)||eo(e.property)||no(e.property)||io(e.property)||[`position-anchor`,`position-area`].includes(e.property)}function Bc(e){var t,n;if(yc(e)&&(t=e.prelude)!=null&&t.value&&(n=e.block)!=null&&n.children){let t=e.prelude.value,n=e.block.children.filter(e=>hc(e)&&zc(e));return{name:t,tryBlock:{uuid:`${t}-try-${K(12)}`,declarations:Object.fromEntries(n.map(e=>[e.property,J(e.value)]))}}}return{}}function Vc(e){let t={},n={},r={};for(let n of e){let e=q(n.css);W(e,{visit:`Atrule`,enter(e){let{name:n,tryBlock:r}=Bc(e);n&&r&&(t[n]=r)}})}for(let i of e){let e=!1,a=/* @__PURE__ */ new Set,o=q(i.css);W(o,{visit:`Declaration`,enter(i){let o=ss(this.rule?.prelude);if(!o.length)return;let{order:s,options:c}=Rc(i),l={};s&&(l.order=s),o.forEach(({selector:i})=>{var o;c?.forEach(r=>{var o;let s;if(r.type===`at-rule`)s=r.atRule;else if(r.type===`try-tactic`){s=`${i}-${r.tactics.join(`-`)}`;let e=Sc(i,r.tactics);e&&(t[s]={uuid:`${i}-${r.tactics.join(`-`)}-try-${K(12)}`,declarations:e})}else if(r.type===`at-rule-with-try-tactic`){s=`${i}-${r.atRule}-${r.tactics.join(`-`)}`;let e=t[r.atRule],n=Cc(e,r.tactics);n&&(t[s]={uuid:`${i}-${r.atRule}-${r.tactics.join(`-`)}-try-${K(12)}`,declarations:n})}if(s&&t[s]){let r=`[data-anchor-polyfill="${t[s].uuid}"]`;n[r]??(n[r]=[]),n[r].push(i),a.has(s)||(l.fallbacks??=[],l.fallbacks.push(t[s]),a.add(s),(o=this.stylesheet)==null||o.children.prependData({type:`Rule`,prelude:{type:`Raw`,value:r},block:{type:`Block`,children:new qe().fromArray(Object.entries(t[s].declarations).map(([e,t])=>({type:`Declaration`,important:!0,property:e,value:{type:`Raw`,value:t}})))}}),e=!0)}}),Object.keys(l).length>0&&(r[i]?(l.order&&(r[i].order=l.order),l.fallbacks&&((o=r[i]).fallbacks??(o.fallbacks=[]),r[i].fallbacks.push(...l.fallbacks))):r[i]=l)})}}),e&&(i.css=J(o),i.changed=!0)}return{fallbackTargets:n,validPositions:r}}function Hc(e,t){return!e||e===t?!1:Uc(e)?e.document.contains(t):e.contains(t)}function Uc(e){return!!(e&&e===e.window)}function Wc(e){return X(e,`position`,`fixed`)}function Gc(e){return!!(e&&(Wc(e)||X(e,`position`,`absolute`)))}function Kc(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING}function qc(e){return l(this,null,function*(){return yield j.getOffsetParent(e)})}function Jc(e){return l(this,null,function*(){if(![`absolute`,`fixed`].includes(Y(e,`position`)))return yield qc(e);let t=e.parentElement;for(;t;){if(!X(t,`position`,`static`)&&X(t,`display`,`block`))return t;t=t.parentElement}return window})}function Yc(e,t,n,r){return l(this,null,function*(){let i=yield Jc(e),a=yield Jc(n);if(!(Hc(a,e)||Uc(a))||i===a&&Gc(e)&&!Kc(e,n))return!1;if(i!==a){let e,t=[];for(e=i;e&&e!==a&&e!==window;)t.push(e),e=yield Jc(e);let r=t[t.length-1];if(r instanceof HTMLElement&&Gc(r)&&!Kc(r,n))return!1}{let t=e.parentElement;for(;t;){if(X(t,`content-visibility`,`hidden`))return!1;t=t.parentElement}}return!(t&&r&&Xc(e,t,r)!==Xc(n,t,r))})}function Xc(e,t,n){for(;!(e.matches(n)&&bs(e,t));){if(!e.parentElement)return null;e=e.parentElement}return e}function Zc(e,t,n,r,i){return l(this,null,function*(){if(!(e instanceof HTMLElement&&n.length&&Gc(e)))return null;let a=n.flatMap(e=>vs(e,i)).filter(e=>ys(e,t)),o=r.map(e=>e.selector).join(`,`)||null;for(let n=a.length-1;n>=0;n--){let r=a[n],i=`fakePseudoElement`in r;if(yield Yc(i?r.fakePseudoElement:r,t,e,o))return i&&r.removeFakePseudoElement(),r}return null})}function Qc(e){return e.type===`Declaration`&&e.property===`anchor-name`}function $c(e){return e.type===`Declaration`&&e.property===`anchor-scope`}function el(e){return!!(e&&e.type===`Function`&&e.name===`anchor-size`)}function tl(e){return!!(e&&e.type===`Function`&&e.name===`var`)}function nl(e){return!!(e.type===`Identifier`&&e.name)}function rl(e){return!!(e.type===`Percentage`&&e.value)}function il(e,t){let n,r,i,a=``,o=!1,s,c=[];e.children.toArray().forEach(e=>{if(o){a=`${a}${J(e)}`;return}if(e.type===`Operator`&&e.value===`,`){o=!0;return}c.push(e)});let[l,u]=c;if(u||(u=l,l=void 0),l&&(nl(l)&&l.name.startsWith(`--`)?n=l.name:tl(l)&&l.children.first&&(s=l.children.first.name)),u){if(is(e)){if(nl(u)&&lo(u.name))r=u.name;else if(rl(u)){let e=Number(u.value);r=Number.isNaN(e)?void 0:e}}else el(e)&&nl(u)&&fo(u.name)&&(i=u.name)}let d=`--anchor-${K(12)}`;return Object.assign(e,{type:`Raw`,value:`var(${d})`,children:null}),Reflect.deleteProperty(e,`name`),{anchorName:n,anchorSide:r,anchorSize:i,fallbackValue:a,customPropName:s,uuid:d}}function al(e){return e.value.children.map(({name:e})=>e)}let ol={},Z={},Q={},sl={},$={};function cl(){ol={},Z={},Q={},sl={},$={}}function ll(e,t){if((is(e)||el(e))&&t){if(t.property.startsWith(`--`)){let n=J(t.value),r=il(e);return sl[r.uuid]=n,Q[t.property]=[...Q[t.property]??[],r],{changed:!0}}if(is(e)&&Qa(t.property)||el(e)&&so(t.property)){let n=il(e);return{prop:t.property,data:n,changed:!0}}}return{}}function ul(e,t,n){return l(this,null,function*(){let r=t?.anchorName,i=t?.customPropName;if(e&&!r){let t=Y(e,`position-anchor`);t?r=t:i&&(r=Y(e,i))}let a=r&&ol[r]||[],o=r&&Z[ms.All]||[],s=r&&Z[r]||[];return yield Zc(e,r||null,a,[...o,...s],{roots:n.roots})})}function dl(e,t){return l(this,null,function*(){var n;let r={},i={};cl();let{fallbackTargets:a,validPositions:o}=Vc(e);for(let t of e){let e=!1,n=q(t.css);W(n,function(t){let n=ss(this.rule?.prelude);if(Qc(t)&&n.length)for(let e of al(t))ol[e]??(ol[e]=[]),ol[e].push(...n);if($c(t)&&n.length)for(let e of al(t))Z[e]??(Z[e]=[]),Z[e].push(...n);let{prop:a,data:o,changed:l}=ll(t,this.declaration);if(a&&o&&n.length)for(let{selector:e}of n)r[e]=c(s({},r[e]),{[a]:[...r[e]?.[a]??[],o]});let u;if(this.block&&(u=cc(t),u)){lc(u,this.block);for(let{selector:e}of n)i[e]=[...i[e]??[],u]}(l||u)&&(e=!0)}),e&&(t.css=J(n),t.changed=!0)}let l=new Set(Object.keys(Q)),u={},d=e=>{var t;let n=[],r=new Set(u[e]?.names??[]);for(;r.size>0;)for(let e of r)n.push(...Q[e]??[]),r.delete(e),(t=u[e]?.names)!=null&&t.length&&u[e].names.forEach(e=>r.add(e));return n};for(;l.size>0;){let t=[];for(let n of e){let e=!1,r=q(n.css);W(r,{visit:`Function`,enter(n){let r=this.rule?.prelude,i=this.declaration,a=i?.property;if(r?.children.isEmpty===!1&&tl(n)&&i&&a&&n.children.first&&l.has(n.children.first.name)&&a.startsWith(`--`)){let r=n.children.first,o=Q[r.name]??[],s=d(r.name);if(!(o.length||s.length))return;let c=`${r.name}-anchor-${K(12)}`,l=J(i.value);sl[c]=l,u[a]||(u[a]={names:[],uuids:[]});let f=u[a];f.names.includes(r.name)||f.names.push(r.name),f.uuids.push(c),t.push(a),r.name=c,e=!0}}}),e&&(n.css=J(r),n.changed=!0)}l.clear(),t.forEach(e=>l.add(e))}for(let t of e){let e=!1,n=q(t.css);W(n,{visit:`Function`,enter(t){var n,i,a;let o=this.rule?.prelude,l=this.declaration,f=l?.property;if(o?.children.isEmpty===!1&&tl(t)&&l&&f&&t.children.first&&(Qa(f)||no(f))){let l=t.children.first,p=Q[l.name]??[],m=d(l.name);if(!(p.length||m.length))return;let h=`${f}-${K(12)}`;if(m.length){let e=/* @__PURE__ */ new Set([l.name]);for(;e.size>0;)for(let t of e){let r=u[t];if((n=r?.names)!=null&&n.length&&(i=r?.uuids)!=null&&i.length)for(let e of r.names)for(let t of r.uuids)$[t]=c(s({},$[t]),{[h]:`${e}-${h}`});e.delete(t),(a=r?.names)!=null&&a.length&&r.names.forEach(t=>e.add(t))}}let g=ss(o);for(let e of[...p,...m]){let t=s({},e),n=`--anchor-${K(12)}-${f}`,i=t.uuid;t.uuid=n;for(let{selector:e}of g)r[e]=c(s({},r[e]),{[f]:[...r[e]?.[f]??[],t]});$[i]=c(s({},$[i]),{[h]:n})}l.name=`${l.name}-${h}`,e=!0}}}),e&&(t.css=J(n),t.changed=!0)}if(Object.keys($).length>0)for(let t of e){let e=!1,n=q(t.css);W(n,{visit:`Function`,enter(t){var n,r;if(tl(t)&&(n=t.children.first?.name)!=null&&n.startsWith(`--`)&&(r=this.declaration?.property)!=null&&r.startsWith(`--`)&&this.block){let n=t.children.first,r=$[n.name];if(r)for(let[t,i]of Object.entries(r))this.block.children.appendData({type:`Declaration`,important:!1,property:`${this.declaration.property}-${t}`,value:{type:`Raw`,value:J(this.declaration.value).replace(`var(${n.name})`,`var(${i})`)}}),e=!0;sl[n.name]&&(this.declaration.value={type:`Raw`,value:sl[n.name]},e=!0)}}}),e&&(t.css=J(n),t.changed=!0)}let f=/* @__PURE__ */ new Map;for(let[e,i]of Object.entries(r)){let r;r=e.startsWith(`[data-anchor-polyfill=`)&&(n=a[e])!=null&&n.length?Ss(t.roots,a[e].join(`,`)):Ss(t.roots,e);for(let[n,a]of Object.entries(i))for(let i of a)for(let a of r){let r=yield ul(a,i,{roots:t.roots}),l=`--anchor-${K(12)}`;f.set(a,c(s({},f.get(a)??{}),{[i.uuid]:l})),a.setAttribute(`style`,`${i.uuid}: var(${l}); ${a.getAttribute(`style`)??``}`),o[e]=c(s({},o[e]),{declarations:c(s({},o[e]?.declarations),{[n]:[...o[e]?.declarations?.[n]??[],c(s({},i),{anchorEl:r,targetEl:a,uuid:l})]})})}}let p={el:document.createElement(`link`),changed:!1,created:!0,css:``};e.push(p);for(let[e,n]of Object.entries(i)){let r=Ss(t.roots,e);for(let i of r){let r=yield ul(i,null,{roots:t.roots});for(let t of n){let n=yield dc(i,t,r);p.css+=fc(n.targetUUID,t.selectorUUID),p.changed=!0,o[e]=c(s({},o[e]),{declarations:c(s({},o[e]?.declarations),{"position-area":[...o[e]?.declarations?.[`position-area`]??[],n]})})}}}return{rules:o,inlineStyles:f,anchorScopes:Z}})}const fl=[`as`,`blocking`,`crossorigin`,`disabled`,`fetchpriority`,`href`,`hreflang`,`integrity`,`referrerpolicy`,`rel`,`type`];function pl(e,t,n=!1){let r=[];for(let{el:i,css:a,changed:o,created:s=!1}of e){let e={el:i,css:a,changed:!1};if(o){if(i.tagName.toLowerCase()===`style`)i.innerHTML=a;else if(i instanceof HTMLLinkElement){let t=document.createElement(`style`);t.textContent=a;for(let e of i.getAttributeNames())if(!e.startsWith(`on`)&&!fl.includes(e)){let n=i.getAttribute(e);n!==null&&t.setAttribute(e,n)}i.hasAttribute(`href`)&&t.setAttribute(`data-original-href`,i.getAttribute(`href`)),s?(t.setAttribute(`data-generated-by-polyfill`,`true`),document.head.insertAdjacentElement(`beforeend`,t)):(i.insertAdjacentElement(`beforebegin`,t),i.remove()),e.el=t}else if(i.hasAttribute(`data-has-inline-styles`)){let e=i.getAttribute(`data-has-inline-styles`);if(e){let n=`[data-has-inline-styles="${e}"]{`,r=a.slice(n.length,-1),o=t?.get(i);if(o)for(let[e,t]of Object.entries(o))r=`${e}: var(${t}); ${r}`;i.setAttribute(`style`,r)}}}n&&i.hasAttribute(`data-has-inline-styles`)&&i.removeAttribute(`data-has-inline-styles`),r.push(e)}return r}const ml=c(s({},j),{_c:/* @__PURE__ */ new Map}),hl=(e,t)=>{let n;switch(e){case`start`:case`self-start`:n=0;break;case`end`:case`self-end`:n=100;break;default:typeof e==`number`&&!Number.isNaN(e)&&(n=e)}if(n!==void 0)return t?100-n:n},gl=(e,t)=>{let n;switch(e){case`block`:case`self-block`:n=t?`width`:`height`;break;case`inline`:case`self-inline`:n=t?`height`:`width`}return n},_l=e=>{switch(e){case`top`:case`bottom`:case`inset-block-start`:case`inset-block-end`:return`y`;case`left`:case`right`:case`inset-inline-start`:case`inset-inline-end`:return`x`}return null},vl=e=>{switch(e){case`x`:return`width`;case`y`:return`height`}return null},yl=e=>Y(e,`display`)===`inline`,bl=(e,t)=>(t===`x`?[`border-left-width`,`border-right-width`]:[`border-top-width`,`border-bottom-width`]).reduce((t,n)=>t+parseInt(Y(e,n),10),0)||0,xl=(e,t)=>parseInt(Y(e,`margin-${t}`),10)||0,Sl=e=>({top:xl(e,`top`),right:xl(e,`right`),bottom:xl(e,`bottom`),left:xl(e,`left`)}),Cl=e=>l(null,[e],function*({targetEl:e,targetProperty:t,anchorRect:n,anchorSide:r,anchorSize:i,fallback:a=null}){if(!((i||r!==void 0)&&e&&n))return a;if(i){if(!so(t))return a;let r;switch(i){case`width`:case`height`:r=i;break;default:{let t=!1,n=Y(e,`writing-mode`);t=n.startsWith(`vertical-`)||n.startsWith(`sideways-`),r=gl(i,t)}}return r?`${n[r]}px`:a}if(r!==void 0){let i,o,s=_l(t);if(!Qa(t)||!s||Qa(r)&&s!==_l(r))return a;let c=[`top`,`left`,`inset-block-start`,`inset-inline-start`],l=[`bottom`,`right`,`inset-block-end`,`inset-inline-end`];switch(r){case`left`:case`top`:i=0;break;case`right`:case`bottom`:i=100;break;case`center`:i=50;break;case`inside`:i=c.includes(t)?0:100;break;case`outside`:i=c.includes(t)?100:0;break;default:if(e){let t=(yield j.isRTL?.call(j,e))||!1;i=hl(r,t)}}let u=typeof i==`number`&&!Number.isNaN(i),d=vl(s);if(u&&d){l.includes(t)&&(o=yield xs(e));let r=n[s]+n[d]*(i/100);switch(t){case`bottom`:case`inset-block-end`:{if(!o)break;let e=o.clientHeight;if(e===0&&yl(o)){let t=bl(o,s);e=o.offsetHeight-t}r=e-r;break}case`right`:case`inset-inline-end`:{if(!o)break;let e=o.clientWidth;if(e===0&&yl(o)){let t=bl(o,s);e=o.offsetWidth-t}r=e-r;break}}return`${r}px`}}return a}),wl=e=>`wrapperEl`in e,Tl=e=>`uuid`in e;function El(e,t=!1){return l(this,null,function*(){let n=document.documentElement;for(let[r,i]of Object.entries(e))for(let e of i){let i=e.anchorEl,a=e.targetEl;if(i&&a){if(wl(e)){let r=e.wrapperEl,o=(e,t,n)=>l(null,null,function*(){return e===0?`0px`:yield Cl({targetEl:r,targetProperty:t,anchorRect:n,anchorSide:e})});Ge(i,r,()=>l(null,null,function*(){let t=Y(a,Ms);r.setAttribute(Ns,t);let s=yield j.getElementRects({reference:i,floating:r,strategy:`absolute`}),c=e.insets,l=yield o(c.block[0],`top`,s.reference),u=yield o(c.block[1],`bottom`,s.reference),d=yield o(c.inline[0],`left`,s.reference),f=yield o(c.inline[1],`right`,s.reference);n.style.setProperty(`${e.targetUUID}-top`,l||null),n.style.setProperty(`${e.targetUUID}-left`,d||null),n.style.setProperty(`${e.targetUUID}-right`,f||null),n.style.setProperty(`${e.targetUUID}-bottom`,u||null),n.style.setProperty(`${e.targetUUID}-justify-self`,e.alignments.inline),n.style.setProperty(`${e.targetUUID}-align-self`,e.alignments.block)}),{animationFrame:t})}else Ge(i,a,()=>l(null,null,function*(){let t=yield j.getElementRects({reference:i,floating:a,strategy:`absolute`}),o=yield Cl({targetEl:a,targetProperty:r,anchorRect:t.reference,anchorSide:e.anchorSide,anchorSize:e.anchorSize,fallback:e.fallbackValue});n.style.setProperty(e.uuid,o)}),{animationFrame:t})}else if(Tl(e)){let t=yield Cl({targetProperty:r,anchorSide:e.anchorSide,anchorSize:e.anchorSize,fallback:e.fallbackValue});n.style.setProperty(e.uuid,t)}}})}function Dl(e,t){return l(this,null,function*(){let n=yield j.getElementRects({reference:e,floating:e,strategy:`absolute`});return yield Ke({x:e.offsetLeft,y:e.offsetTop,platform:ml,rects:n,elements:{floating:e,reference:t},strategy:`absolute`},{padding:Sl(e)})})}function Ol(e,t,n=!1){return l(this,null,function*(){if(!t.length)return;let r=document.querySelectorAll(e);for(let e of r){let r=!1,i=yield xs(e);Ge({},e,()=>l(null,null,function*(){if(r)return;r=!0,e.removeAttribute(`data-anchor-polyfill`);let n=yield Dl(e,i);if(Object.values(n).every(e=>e<=0)){e.removeAttribute(`data-anchor-polyfill-last-successful`),r=!1;return}for(let[n,{uuid:a}]of t.entries()){e.setAttribute(`data-anchor-polyfill`,a);let o=yield Dl(e,i);if(Object.values(o).every(e=>e<=0)){e.setAttribute(`data-anchor-polyfill-last-successful`,a),r=!1;break}if(n===t.length-1){let t=e.getAttribute(`data-anchor-polyfill-last-successful`);t?e.setAttribute(`data-anchor-polyfill`,t):e.removeAttribute(`data-anchor-polyfill`),r=!1;break}}}),{animationFrame:n,layoutShift:!1})}})}function kl(e,t=!1){return l(this,null,function*(){for(let n of Object.values(e))yield El(n.declarations??{},t);for(let[n,r]of Object.entries(e))yield Ol(n,r.fallbacks??[],t)})}function Al(e={}){let t=typeof e==`boolean`?{useAnimationFrame:e}:e,n=t.useAnimationFrame===void 0?!!window.UPDATE_ANCHOR_ON_ANIMATION_FRAME:t.useAnimationFrame;return Array.isArray(t.elements)||(t.elements=void 0),(!Array.isArray(t.roots)||t.roots.length===0)&&(t.roots=[document]),Object.assign(t,{useAnimationFrame:n})}function jl(e){return l(this,null,function*(){let t=Al(e??window.ANCHOR_POSITIONING_POLYFILL_OPTIONS),n=yield As(t),r={},i;ls();try{ps(n)&&(n=pl(n));let e=yield dl(n,{roots:t.roots});r=e.rules,i=e.inlineStyles}catch(e){throw cs(),e}return Object.values(r).length&&(pl(n,i,!0),yield kl(r,t.useAnimationFrame)),r})}export{jl as default};
17
+ `,``)}const pc=[`normal`,`most-width`,`most-height`,`most-block-size`,`most-inline-size`],mc=[`flip-block`,`flip-inline`,`flip-start`];function hc(e){return e.type===`Declaration`}function gc(e){return e.type===`Declaration`&&e.property===`position-try-fallbacks`}function _c(e){return e.type===`Declaration`&&e.property===`position-try-order`}function vc(e){return e.type===`Declaration`&&e.property===`position-try`}function yc(e){return e.type===`Atrule`&&e.name===`position-try`}function bc(e){return mc.includes(e)}function xc(e){return pc.includes(e)}function Sc(e,t){let n=document.querySelector(e);if(n){let e=wc(n);return t.forEach(t=>{e=Nc(e,t)}),e}}function Cc(e,t){let n=e.declarations;return t.forEach(e=>{n=Nc(n,e)}),n}function wc(e){let t={};return ao.forEach(n=>{let r=Y(e,`--${n}-${ns}`);r&&(t[n]=r)}),t}const Tc={"flip-block":{top:`bottom`,bottom:`top`,"inset-block-start":`inset-block-end`,"inset-block-end":`inset-block-start`,"margin-top":`margin-bottom`,"margin-bottom":`margin-top`},"flip-inline":{left:`right`,right:`left`,"inset-inline-start":`inset-inline-end`,"inset-inline-end":`inset-inline-start`,"margin-left":`margin-right`,"margin-right":`margin-left`},"flip-start":{left:`top`,right:`bottom`,top:`left`,bottom:`right`,"inset-block-start":`inset-block-end`,"inset-block-end":`inset-block-start`,"inset-inline-start":`inset-inline-end`,"inset-inline-end":`inset-inline-start`,"inset-block":`inset-inline`,"inset-inline":`inset-block`}},Ec={"flip-block":{top:`bottom`,bottom:`top`,start:`end`,end:`start`,"self-end":`self-start`,"self-start":`self-end`},"flip-inline":{left:`right`,right:`left`,start:`end`,end:`start`,"self-end":`self-start`,"self-start":`self-end`},"flip-start":{top:`left`,left:`top`,right:`bottom`,bottom:`right`}},Dc={"flip-block":{top:`bottom`,bottom:`top`,start:`end`,end:`start`},"flip-inline":{left:`right`,right:`left`,start:`end`,end:`start`},"flip-start":{}};function Oc(e,t){return Tc[t][e]||e}function kc(e,t){return Ec[t][e]||e}function Ac(e,t){if(t===`flip-start`)return e;{let n=Dc[t];return e.split(`-`).map(e=>n[e]||e).join(`-`)}}function jc(e,t,n){if(e===`margin`){let[e,r,i,a]=t.children.toArray();n===`flip-block`?a?t.children.fromArray([i,r,e,a]):i&&t.children.fromArray([i,r,e]):n===`flip-inline`&&a&&t.children.fromArray([e,a,i,r])}else if(e===`margin-block`){let[e,r]=t.children.toArray();n===`flip-block`&&r&&t.children.fromArray([r,e])}else if(e===`margin-inline`){let[e,r]=t.children.toArray();n===`flip-inline`&&r&&t.children.fromArray([r,e])}}const Mc=(e,t)=>(q(`#id{${e}: ${t};}`).children.first?.block.children.first).value;function Nc(e,t){let n={};return Object.entries(e).forEach(([e,r])=>{let i=e,a=Mc(i,r),o=Oc(i,t);o!==i&&(n[i]??(n[i]=`revert`)),W(a,{visit:`Function`,enter(e){is(e)&&e.children.forEach(e=>{nl(e)&&lo(e.name)&&(e.name=kc(e.name,t))})}}),i===`position-area`&&a.children.forEach(e=>{nl(e)&&Ls(e.name)&&(e.name=Ac(e.name,t))}),i.startsWith(`margin`)&&jc(i,a,t),n[o]=J(a)}),n}function Pc(e){let t=os(e),n=[];return t.forEach(e=>{let t={atRules:[],tactics:[],positionAreas:[]};e.forEach(e=>{bc(e.name)?t.tactics.push(e.name):e.name.startsWith(`--`)?t.atRules.push(e.name):Ls(e.name)&&t.positionAreas.push(e.name)}),t.positionAreas.length?n.push({positionArea:t.positionAreas[0],type:`position-area`}):t.atRules.length&&t.tactics.length?n.push({tactics:t.tactics,atRule:t.atRules[0],type:`at-rule-with-try-tactic`}):t.atRules.length?n.push({atRule:t.atRules[0],type:`at-rule`}):t.tactics.length&&n.push({tactics:t.tactics,type:`try-tactic`})}),n}function Fc(e){return gc(e)&&e.value.children.first?Pc(e.value.children):[]}function Ic(e){if(vc(e)&&e.value.children.first){let t=Je(e),n,r=t.value.children.first.name;r&&xc(r)&&(n=r,t.value.children.shift());let i=Pc(t.value.children);return{order:n,options:i}}return{}}function Lc(e){return _c(e)&&e.value.children.first?{order:e.value.children.first.name}:{}}function Rc(e){let{order:t,options:n}=Ic(e);if(t||n)return{order:t,options:n};let{order:r}=Lc(e),i=Fc(e);return r||i?{order:r,options:i}:{}}function zc(e){return Qa(e.property)||eo(e.property)||no(e.property)||io(e.property)||[`position-anchor`,`position-area`].includes(e.property)}function Bc(e){var t,n;if(yc(e)&&(t=e.prelude)!=null&&t.value&&(n=e.block)!=null&&n.children){let t=e.prelude.value,n=e.block.children.filter(e=>hc(e)&&zc(e));return{name:t,tryBlock:{uuid:`${t}-try-${K(12)}`,declarations:Object.fromEntries(n.map(e=>[e.property,J(e.value)]))}}}return{}}function Vc(e){let t={},n={},r={};for(let n of e){let e=q(n.css);W(e,{visit:`Atrule`,enter(e){let{name:n,tryBlock:r}=Bc(e);n&&r&&(t[n]=r)}})}for(let i of e){let e=!1,a=/* @__PURE__ */ new Set,o=q(i.css);W(o,{visit:`Declaration`,enter(i){let o=ss(this.rule?.prelude);if(!o.length)return;let{order:s,options:c}=Rc(i),l={};s&&(l.order=s),o.forEach(({selector:i})=>{var o;c?.forEach(r=>{var o;let s;if(r.type===`at-rule`)s=r.atRule;else if(r.type===`try-tactic`){s=`${i}-${r.tactics.join(`-`)}`;let e=Sc(i,r.tactics);e&&(t[s]={uuid:`${i}-${r.tactics.join(`-`)}-try-${K(12)}`,declarations:e})}else if(r.type===`at-rule-with-try-tactic`){s=`${i}-${r.atRule}-${r.tactics.join(`-`)}`;let e=t[r.atRule],n=Cc(e,r.tactics);n&&(t[s]={uuid:`${i}-${r.atRule}-${r.tactics.join(`-`)}-try-${K(12)}`,declarations:n})}if(s&&t[s]){let r=`[data-anchor-polyfill="${t[s].uuid}"]`;n[r]??(n[r]=[]),n[r].push(i),a.has(s)||(l.fallbacks??=[],l.fallbacks.push(t[s]),a.add(s),(o=this.stylesheet)==null||o.children.prependData({type:`Rule`,prelude:{type:`Raw`,value:r},block:{type:`Block`,children:new qe().fromArray(Object.entries(t[s].declarations).map(([e,t])=>({type:`Declaration`,important:!0,property:e,value:{type:`Raw`,value:t}})))}}),e=!0)}}),Object.keys(l).length>0&&(r[i]?(l.order&&(r[i].order=l.order),l.fallbacks&&((o=r[i]).fallbacks??(o.fallbacks=[]),r[i].fallbacks.push(...l.fallbacks))):r[i]=l)})}}),e&&(i.css=J(o),i.changed=!0)}return{fallbackTargets:n,validPositions:r}}function Hc(e,t){return!e||e===t?!1:Uc(e)?e.document.contains(t):e.contains(t)}function Uc(e){return!!(e&&e===e.window)}function Wc(e){return X(e,`position`,`fixed`)}function Gc(e){return!!(e&&(Wc(e)||X(e,`position`,`absolute`)))}function Kc(e,t){return e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING}function qc(e){return l(this,null,function*(){return yield j.getOffsetParent(e)})}function Jc(e){return l(this,null,function*(){if(![`absolute`,`fixed`].includes(Y(e,`position`)))return yield qc(e);let t=e.parentElement;for(;t;){if(!X(t,`position`,`static`)&&X(t,`display`,`block`))return t;t=t.parentElement}return window})}function Yc(e,t,n,r){return l(this,null,function*(){let i=yield Jc(e),a=yield Jc(n);if(!(Hc(a,e)||Uc(a))||i===a&&Gc(e)&&!Kc(e,n))return!1;if(i!==a){let e,t=[];for(e=i;e&&e!==a&&e!==window;)t.push(e),e=yield Jc(e);let r=t[t.length-1];if(r instanceof HTMLElement&&Gc(r)&&!Kc(r,n))return!1}{let t=e.parentElement;for(;t;){if(X(t,`content-visibility`,`hidden`))return!1;t=t.parentElement}}return!(t&&r&&Xc(e,t,r)!==Xc(n,t,r))})}function Xc(e,t,n){for(;!(e.matches(n)&&bs(e,t));){if(!e.parentElement)return null;e=e.parentElement}return e}function Zc(e,t,n,r,i){return l(this,null,function*(){if(!(e instanceof HTMLElement&&n.length&&Gc(e)))return null;let a=n.flatMap(e=>vs(e,i)).filter(e=>ys(e,t)),o=r.map(e=>e.selector).join(`,`)||null;for(let n=a.length-1;n>=0;n--){let r=a[n],i=`fakePseudoElement`in r;if(yield Yc(i?r.fakePseudoElement:r,t,e,o))return i&&r.removeFakePseudoElement(),r}return null})}function Qc(e){return e.type===`Declaration`&&e.property===`anchor-name`}function $c(e){return e.type===`Declaration`&&e.property===`anchor-scope`}function el(e){return!!(e&&e.type===`Function`&&e.name===`anchor-size`)}function tl(e){return!!(e&&e.type===`Function`&&e.name===`var`)}function nl(e){return!!(e.type===`Identifier`&&e.name)}function rl(e){return!!(e.type===`Percentage`&&e.value)}function il(e,t){let n,r,i,a=``,o=!1,s,c=[];e.children.toArray().forEach(e=>{o?a=`${a}${J(e)}`:e.type===`Operator`&&e.value===`,`?o=!0:c.push(e)});let[l,u]=c;if(u||(u=l,l=void 0),l&&(nl(l)&&l.name.startsWith(`--`)?n=l.name:tl(l)&&l.children.first&&(s=l.children.first.name)),u){if(is(e)){if(nl(u)&&lo(u.name))r=u.name;else if(rl(u)){let e=Number(u.value);r=Number.isNaN(e)?void 0:e}}else el(e)&&nl(u)&&fo(u.name)&&(i=u.name)}let d=`--anchor-${K(12)}`;return Object.assign(e,{type:`Raw`,value:`var(${d})`,children:null}),Reflect.deleteProperty(e,`name`),{anchorName:n,anchorSide:r,anchorSize:i,fallbackValue:a,customPropName:s,uuid:d}}function al(e){return e.value.children.map(({name:e})=>e)}let ol={},Z={},Q={},sl={},$={};function cl(){ol={},Z={},Q={},sl={},$={}}function ll(e,t){if((is(e)||el(e))&&t){if(t.property.startsWith(`--`)){let n=J(t.value),r=il(e);return sl[r.uuid]=n,Q[t.property]=[...Q[t.property]??[],r],{changed:!0}}if(is(e)&&Qa(t.property)||el(e)&&so(t.property)){let n=il(e);return{prop:t.property,data:n,changed:!0}}}return{}}function ul(e,t,n){return l(this,null,function*(){let r=t?.anchorName,i=t?.customPropName;if(e&&!r){let t=Y(e,`position-anchor`);t?r=t:i&&(r=Y(e,i))}let a=r&&ol[r]||[],o=r&&Z[ms.All]||[],s=r&&Z[r]||[];return yield Zc(e,r||null,a,[...o,...s],{roots:n.roots})})}function dl(e,t){return l(this,null,function*(){var n;let r={},i={};cl();let{fallbackTargets:a,validPositions:o}=Vc(e);for(let t of e){let e=!1,n=q(t.css);W(n,function(t){let n=ss(this.rule?.prelude);if(Qc(t)&&n.length)for(let e of al(t))ol[e]??(ol[e]=[]),ol[e].push(...n);if($c(t)&&n.length)for(let e of al(t))Z[e]??(Z[e]=[]),Z[e].push(...n);let{prop:a,data:o,changed:l}=ll(t,this.declaration);if(a&&o&&n.length)for(let{selector:e}of n)r[e]=c(s({},r[e]),{[a]:[...r[e]?.[a]??[],o]});let u;if(this.block&&(u=cc(t),u)){lc(u,this.block);for(let{selector:e}of n)i[e]=[...i[e]??[],u]}(l||u)&&(e=!0)}),e&&(t.css=J(n),t.changed=!0)}let l=new Set(Object.keys(Q)),u={},d=e=>{var t;let n=[],r=new Set(u[e]?.names??[]);for(;r.size>0;)for(let e of r)n.push(...Q[e]??[]),r.delete(e),(t=u[e]?.names)!=null&&t.length&&u[e].names.forEach(e=>r.add(e));return n};for(;l.size>0;){let t=[];for(let n of e){let e=!1,r=q(n.css);W(r,{visit:`Function`,enter(n){let r=this.rule?.prelude,i=this.declaration,a=i?.property;if(r?.children.isEmpty===!1&&tl(n)&&i&&a&&n.children.first&&l.has(n.children.first.name)&&a.startsWith(`--`)){let r=n.children.first,o=Q[r.name]??[],s=d(r.name);if(!(o.length||s.length))return;let c=`${r.name}-anchor-${K(12)}`,l=J(i.value);sl[c]=l,u[a]||(u[a]={names:[],uuids:[]});let f=u[a];f.names.includes(r.name)||f.names.push(r.name),f.uuids.push(c),t.push(a),r.name=c,e=!0}}}),e&&(n.css=J(r),n.changed=!0)}l.clear(),t.forEach(e=>l.add(e))}for(let t of e){let e=!1,n=q(t.css);W(n,{visit:`Function`,enter(t){var n,i,a;let o=this.rule?.prelude,l=this.declaration,f=l?.property;if(o?.children.isEmpty===!1&&tl(t)&&l&&f&&t.children.first&&(Qa(f)||no(f))){let l=t.children.first,p=Q[l.name]??[],m=d(l.name);if(!(p.length||m.length))return;let h=`${f}-${K(12)}`;if(m.length){let e=/* @__PURE__ */ new Set([l.name]);for(;e.size>0;)for(let t of e){let r=u[t];if((n=r?.names)!=null&&n.length&&(i=r?.uuids)!=null&&i.length)for(let e of r.names)for(let t of r.uuids)$[t]=c(s({},$[t]),{[h]:`${e}-${h}`});e.delete(t),(a=r?.names)!=null&&a.length&&r.names.forEach(t=>e.add(t))}}let g=ss(o);for(let e of[...p,...m]){let t=s({},e),n=`--anchor-${K(12)}-${f}`,i=t.uuid;t.uuid=n;for(let{selector:e}of g)r[e]=c(s({},r[e]),{[f]:[...r[e]?.[f]??[],t]});$[i]=c(s({},$[i]),{[h]:n})}l.name=`${l.name}-${h}`,e=!0}}}),e&&(t.css=J(n),t.changed=!0)}if(Object.keys($).length>0)for(let t of e){let e=!1,n=q(t.css);W(n,{visit:`Function`,enter(t){var n,r;if(tl(t)&&(n=t.children.first?.name)!=null&&n.startsWith(`--`)&&(r=this.declaration?.property)!=null&&r.startsWith(`--`)&&this.block){let n=t.children.first,r=$[n.name];if(r)for(let[t,i]of Object.entries(r))this.block.children.appendData({type:`Declaration`,important:!1,property:`${this.declaration.property}-${t}`,value:{type:`Raw`,value:J(this.declaration.value).replace(`var(${n.name})`,`var(${i})`)}}),e=!0;sl[n.name]&&(this.declaration.value={type:`Raw`,value:sl[n.name]},e=!0)}}}),e&&(t.css=J(n),t.changed=!0)}let f=/* @__PURE__ */ new Map;for(let[e,i]of Object.entries(r)){let r;r=e.startsWith(`[data-anchor-polyfill=`)&&(n=a[e])!=null&&n.length?Ss(t.roots,a[e].join(`,`)):Ss(t.roots,e);for(let[n,a]of Object.entries(i))for(let i of a)for(let a of r){let r=yield ul(a,i,{roots:t.roots}),l=`--anchor-${K(12)}`;f.set(a,c(s({},f.get(a)??{}),{[i.uuid]:l})),a.setAttribute(`style`,`${i.uuid}: var(${l}); ${a.getAttribute(`style`)??``}`),o[e]=c(s({},o[e]),{declarations:c(s({},o[e]?.declarations),{[n]:[...o[e]?.declarations?.[n]??[],c(s({},i),{anchorEl:r,targetEl:a,uuid:l})]})})}}let p={el:document.createElement(`link`),changed:!1,created:!0,css:``};e.push(p);for(let[e,n]of Object.entries(i)){let r=Ss(t.roots,e);for(let i of r){let r=yield ul(i,null,{roots:t.roots});for(let t of n){let n=yield dc(i,t,r);p.css+=fc(n.targetUUID,t.selectorUUID),p.changed=!0,o[e]=c(s({},o[e]),{declarations:c(s({},o[e]?.declarations),{"position-area":[...o[e]?.declarations?.[`position-area`]??[],n]})})}}}return{rules:o,inlineStyles:f,anchorScopes:Z}})}const fl=[`as`,`blocking`,`crossorigin`,`disabled`,`fetchpriority`,`href`,`hreflang`,`integrity`,`referrerpolicy`,`rel`,`type`];function pl(e,t,n=!1){let r=[];for(let{el:i,css:a,changed:o,created:s=!1}of e){let e={el:i,css:a,changed:!1};if(o){if(i.tagName.toLowerCase()===`style`)i.innerHTML=a;else if(i instanceof HTMLLinkElement){let t=document.createElement(`style`);t.textContent=a;for(let e of i.getAttributeNames())if(!e.startsWith(`on`)&&!fl.includes(e)){let n=i.getAttribute(e);n!==null&&t.setAttribute(e,n)}i.hasAttribute(`href`)&&t.setAttribute(`data-original-href`,i.getAttribute(`href`)),s?(t.setAttribute(`data-generated-by-polyfill`,`true`),document.head.insertAdjacentElement(`beforeend`,t)):(i.insertAdjacentElement(`beforebegin`,t),i.remove()),e.el=t}else if(i.hasAttribute(`data-has-inline-styles`)){let e=i.getAttribute(`data-has-inline-styles`);if(e){let n=`[data-has-inline-styles="${e}"]{`,r=a.slice(n.length,-1),o=t?.get(i);if(o)for(let[e,t]of Object.entries(o))r=`${e}: var(${t}); ${r}`;i.setAttribute(`style`,r)}}}n&&i.hasAttribute(`data-has-inline-styles`)&&i.removeAttribute(`data-has-inline-styles`),r.push(e)}return r}const ml=c(s({},j),{_c:/* @__PURE__ */ new Map}),hl=(e,t)=>{let n;switch(e){case`start`:case`self-start`:n=0;break;case`end`:case`self-end`:n=100;break;default:typeof e==`number`&&!Number.isNaN(e)&&(n=e)}if(n!==void 0)return t?100-n:n},gl=(e,t)=>{let n;switch(e){case`block`:case`self-block`:n=t?`width`:`height`;break;case`inline`:case`self-inline`:n=t?`height`:`width`}return n},_l=e=>{switch(e){case`top`:case`bottom`:case`inset-block-start`:case`inset-block-end`:return`y`;case`left`:case`right`:case`inset-inline-start`:case`inset-inline-end`:return`x`}return null},vl=e=>{switch(e){case`x`:return`width`;case`y`:return`height`}return null},yl=e=>Y(e,`display`)===`inline`,bl=(e,t)=>(t===`x`?[`border-left-width`,`border-right-width`]:[`border-top-width`,`border-bottom-width`]).reduce((t,n)=>t+parseInt(Y(e,n),10),0)||0,xl=(e,t)=>parseInt(Y(e,`margin-${t}`),10)||0,Sl=e=>({top:xl(e,`top`),right:xl(e,`right`),bottom:xl(e,`bottom`),left:xl(e,`left`)}),Cl=e=>l(null,[e],function*({targetEl:e,targetProperty:t,anchorRect:n,anchorSide:r,anchorSize:i,fallback:a=null}){if(!((i||r!==void 0)&&e&&n))return a;if(i){if(!so(t))return a;let r;switch(i){case`width`:case`height`:r=i;break;default:{let t=!1,n=Y(e,`writing-mode`);t=n.startsWith(`vertical-`)||n.startsWith(`sideways-`),r=gl(i,t)}}return r?`${n[r]}px`:a}if(r!==void 0){let i,o,s=_l(t);if(!Qa(t)||!s||Qa(r)&&s!==_l(r))return a;let c=[`top`,`left`,`inset-block-start`,`inset-inline-start`],l=[`bottom`,`right`,`inset-block-end`,`inset-inline-end`];switch(r){case`left`:case`top`:i=0;break;case`right`:case`bottom`:i=100;break;case`center`:i=50;break;case`inside`:i=c.includes(t)?0:100;break;case`outside`:i=c.includes(t)?100:0;break;default:if(e){let t=(yield j.isRTL?.call(j,e))||!1;i=hl(r,t)}}let u=typeof i==`number`&&!Number.isNaN(i),d=vl(s);if(u&&d){l.includes(t)&&(o=yield xs(e));let r=n[s]+n[d]*(i/100);switch(t){case`bottom`:case`inset-block-end`:{if(!o)break;let e=o.clientHeight;if(e===0&&yl(o)){let t=bl(o,s);e=o.offsetHeight-t}r=e-r;break}case`right`:case`inset-inline-end`:{if(!o)break;let e=o.clientWidth;if(e===0&&yl(o)){let t=bl(o,s);e=o.offsetWidth-t}r=e-r;break}}return`${r}px`}}return a}),wl=e=>`wrapperEl`in e,Tl=e=>`uuid`in e;function El(e,t=!1){return l(this,null,function*(){let n=document.documentElement;for(let[r,i]of Object.entries(e))for(let e of i){let i=e.anchorEl,a=e.targetEl;if(i&&a){if(wl(e)){let r=e.wrapperEl,o=(e,t,n)=>l(null,null,function*(){return e===0?`0px`:yield Cl({targetEl:r,targetProperty:t,anchorRect:n,anchorSide:e})});Ge(i,r,()=>l(null,null,function*(){let t=Y(a,Ms);r.setAttribute(Ns,t);let s=yield j.getElementRects({reference:i,floating:r,strategy:`absolute`}),c=e.insets,l=yield o(c.block[0],`top`,s.reference),u=yield o(c.block[1],`bottom`,s.reference),d=yield o(c.inline[0],`left`,s.reference),f=yield o(c.inline[1],`right`,s.reference);n.style.setProperty(`${e.targetUUID}-top`,l||null),n.style.setProperty(`${e.targetUUID}-left`,d||null),n.style.setProperty(`${e.targetUUID}-right`,f||null),n.style.setProperty(`${e.targetUUID}-bottom`,u||null),n.style.setProperty(`${e.targetUUID}-justify-self`,e.alignments.inline),n.style.setProperty(`${e.targetUUID}-align-self`,e.alignments.block)}),{animationFrame:t})}else Ge(i,a,()=>l(null,null,function*(){let t=yield j.getElementRects({reference:i,floating:a,strategy:`absolute`}),o=yield Cl({targetEl:a,targetProperty:r,anchorRect:t.reference,anchorSide:e.anchorSide,anchorSize:e.anchorSize,fallback:e.fallbackValue});n.style.setProperty(e.uuid,o)}),{animationFrame:t})}else if(Tl(e)){let t=yield Cl({targetProperty:r,anchorSide:e.anchorSide,anchorSize:e.anchorSize,fallback:e.fallbackValue});n.style.setProperty(e.uuid,t)}}})}function Dl(e,t){return l(this,null,function*(){let n=yield j.getElementRects({reference:e,floating:e,strategy:`absolute`});return yield Ke({x:e.offsetLeft,y:e.offsetTop,platform:ml,rects:n,elements:{floating:e,reference:t},strategy:`absolute`},{padding:Sl(e)})})}function Ol(e,t,n=!1){return l(this,null,function*(){if(!t.length)return;let r=document.querySelectorAll(e);for(let e of r){let r=!1,i=yield xs(e);Ge({},e,()=>l(null,null,function*(){if(r)return;r=!0,e.removeAttribute(`data-anchor-polyfill`);let n=yield Dl(e,i);if(Object.values(n).every(e=>e<=0))e.removeAttribute(`data-anchor-polyfill-last-successful`),r=!1;else for(let[n,{uuid:a}]of t.entries()){e.setAttribute(`data-anchor-polyfill`,a);let o=yield Dl(e,i);if(Object.values(o).every(e=>e<=0)){e.setAttribute(`data-anchor-polyfill-last-successful`,a),r=!1;break}if(n===t.length-1){let t=e.getAttribute(`data-anchor-polyfill-last-successful`);t?e.setAttribute(`data-anchor-polyfill`,t):e.removeAttribute(`data-anchor-polyfill`),r=!1;break}}}),{animationFrame:n,layoutShift:!1})}})}function kl(e,t=!1){return l(this,null,function*(){for(let n of Object.values(e))yield El(n.declarations??{},t);for(let[n,r]of Object.entries(e))yield Ol(n,r.fallbacks??[],t)})}function Al(e={}){let t=typeof e==`boolean`?{useAnimationFrame:e}:e,n=t.useAnimationFrame===void 0?!!window.UPDATE_ANCHOR_ON_ANIMATION_FRAME:t.useAnimationFrame;return Array.isArray(t.elements)||(t.elements=void 0),Array.isArray(t.roots)&&t.roots.length!==0||(t.roots=[document]),Object.assign(t,{useAnimationFrame:n})}function jl(e){return l(this,null,function*(){let t=Al(e??window.ANCHOR_POSITIONING_POLYFILL_OPTIONS),n=yield As(t),r={},i;ls();try{ps(n)&&(n=pl(n));let e=yield dl(n,{roots:t.roots});r=e.rules,i=e.inlineStyles}catch(e){throw cs(),e}return Object.values(r).length&&(pl(n,i,!0),yield kl(r,t.useAnimationFrame)),r})}export{jl as default};
@@ -1,4 +1,4 @@
1
- var e=class extends Event{oldState;newState;constructor(e,t={}){let n=Object.assign({},t);delete n.oldState,delete n.newState,super(e,n),this.oldState=String(t.oldState||``),this.newState=String(t.newState||``)}},t=/* @__PURE__ */ new WeakMap;function n(n,r,i){t.set(n,setTimeout(()=>{t.has(n)&&n.dispatchEvent(new e(`toggle`,{cancelable:!1,oldState:r,newState:i}))},0))}var r=globalThis.ShadowRoot||function(){},i=globalThis.HTMLDialogElement||function(){},a=/* @__PURE__ */ new WeakMap,o=/* @__PURE__ */ new WeakMap,s=/* @__PURE__ */ new WeakMap,c=/* @__PURE__ */ new WeakMap;function l(e){return c.get(e)||`hidden`}var u=/* @__PURE__ */ new WeakMap;function d(e){return[...e].pop()}function f(e){let t=e.popoverTargetElement;if(!(t instanceof HTMLElement))return;let n=l(t);(e.popoverTargetAction!==`show`||n!==`showing`)&&(e.popoverTargetAction!==`hide`||n!==`hidden`)&&(n===`showing`?D(t,!0,!0):p(t,!1)&&(u.set(t,e),E(t)))}function p(e,t){return!(e.popover!==`auto`&&e.popover!==`manual`&&e.popover!==`hint`||!e.isConnected||t&&l(e)!==`showing`||!t&&l(e)!==`hidden`||e instanceof i&&e.hasAttribute(`open`)||document.fullscreenElement===e)}function m(e){if(!e)return 0;let t=o.get(document)||/* @__PURE__ */ new Set,n=s.get(document)||/* @__PURE__ */ new Set;return n.has(e)?[...n].indexOf(e)+t.size+1:t.has(e)?[...t].indexOf(e)+1:0}function h(e){let t=y(e),n=b(e);return m(t)>m(n)?t:n}function g(e){let t,n=s.get(e)||/* @__PURE__ */ new Set,r=o.get(e)||/* @__PURE__ */ new Set,i=n.size>0?n:r.size>0?r:null;return i?(t=d(i),t.isConnected?t:(i.delete(t),g(e))):null}function _(e){for(let t of e||[])if(!t.isConnected)e.delete(t);else return t;return null}function v(e){return typeof e.getRootNode==`function`?e.getRootNode():e.parentNode?v(e.parentNode):e}function y(e){for(;e;){if(e instanceof HTMLElement&&e.popover===`auto`&&c.get(e)===`showing`)return e;if(e=e instanceof Element&&e.assignedSlot||e.parentElement||v(e),e instanceof r&&(e=e.host),e instanceof Document)return}}function b(e){for(;e;){let t=e.popoverTargetElement;if(t instanceof HTMLElement)return t;if(e=e.parentElement||v(e),e instanceof r&&(e=e.host),e instanceof Document)return}}function x(e,t){let n=/* @__PURE__ */ new Map,r=0;for(let e of t||[])n.set(e,r),r+=1;n.set(e,r),r+=1;let i=null;function a(t){if(!t)return;let r=!1,a=null;for(;!r;){if(a=y(t)||null,a===null||!n.has(a))return;(e.popover===`hint`||a.popover===`auto`)&&(r=!0),r||(t=a.parentElement)}let o=n.get(a)??null;(i===null||n.get(i)<o)&&(i=a)}return a(e.parentElement||v(e)),i}function S(e){return e.hidden||e instanceof r||(e instanceof HTMLButtonElement||e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLOptGroupElement||e instanceof HTMLOptionElement||e instanceof HTMLFieldSetElement)&&e.disabled||e instanceof HTMLInputElement&&e.type===`hidden`||e instanceof HTMLAnchorElement&&e.href===``?!1:typeof e.tabIndex==`number`&&e.tabIndex!==-1}function C(e){if(e.shadowRoot&&e.shadowRoot.delegatesFocus!==!0)return null;let t=e;t.shadowRoot&&(t=t.shadowRoot);let n=t.querySelector(`[autofocus]`);if(n)return n;{let e=t.querySelectorAll(`slot`);for(let t of e){let e=t.assignedElements({flatten:!0});for(let t of e)if(t.hasAttribute(`autofocus`))return t;else if(n=t.querySelector(`[autofocus]`),n)return n}}let r=e.ownerDocument.createTreeWalker(t,NodeFilter.SHOW_ELEMENT),i=r.currentNode;for(;i;){if(S(i))return i;i=r.nextNode()}}function w(e){var t;(t=C(e))==null||t.focus()}var T=/* @__PURE__ */ new WeakMap;function E(t){if(!p(t,!1))return;let r=t.ownerDocument;if(!t.dispatchEvent(new e(`beforetoggle`,{cancelable:!0,oldState:`closed`,newState:`open`}))||!p(t,!1))return;let i=!1,l=t.popover,d=null,f=x(t,o.get(r)||/* @__PURE__ */ new Set),m=x(t,s.get(r)||/* @__PURE__ */ new Set);if(l===`auto`&&(k(s.get(r)||/* @__PURE__ */ new Set,i,!0),j(f||r,i,!0),d=`auto`),l===`hint`&&(m?(j(m,i,!0),d=`hint`):(k(s.get(r)||/* @__PURE__ */ new Set,i,!0),f?(j(f,i,!0),d=`auto`):d=`hint`)),l===`auto`||l===`hint`){if(l!==t.popover||!p(t,!1))return;g(r)||(i=!0),d===`auto`?(o.has(r)||o.set(r,/* @__PURE__ */ new Set),o.get(r).add(t)):d===`hint`&&(s.has(r)||s.set(r,/* @__PURE__ */ new Set),s.get(r).add(t))}T.delete(t);let h=r.activeElement;t.classList.add(`:popover-open`),c.set(t,`showing`),a.has(r)||a.set(r,/* @__PURE__ */ new Set),a.get(r).add(t),F(u.get(t),!0),w(t),i&&h&&t.popover===`auto`&&T.set(t,h),n(t,`closed`,`open`)}function D(t,r=!1,i=!1){var l,f;if(!p(t,!0))return;let m=t.ownerDocument;if([`auto`,`hint`].includes(t.popover)&&(j(t,r,i),!p(t,!0)))return;let h=o.get(m)||/* @__PURE__ */ new Set,g=h.has(t)&&d(h)===t;if(F(u.get(t),!1),u.delete(t),i&&(t.dispatchEvent(new e(`beforetoggle`,{oldState:`open`,newState:`closed`})),g&&d(h)!==t&&j(t,r,i),!p(t,!0)))return;(l=a.get(m))==null||l.delete(t),h.delete(t),(f=s.get(m))==null||f.delete(t),t.classList.remove(`:popover-open`),c.set(t,`hidden`),i&&n(t,`open`,`closed`);let _=T.get(t);_&&(T.delete(t),r&&_.focus())}function O(e,t=!1,n=!1){let r=g(e);for(;r;)D(r,t,n),r=g(e)}function k(e,t=!1,n=!1){let r=_(e);for(;r;)D(r,t,n),r=_(e)}function A(e,t,n,r){let i=!1,a=!1;for(;i||!a;){a=!0;let o=null,s=!1;for(let n of t)if(n===e)s=!0;else if(s){o=n;break}if(!o)return;for(;l(o)===`showing`&&t.size;)D(d(t),n,r);t.has(e)&&d(t)!==e&&(i=!0),i&&(r=!1)}}function j(e,t,n){let r=e.ownerDocument||e;if(e instanceof Document)return O(r,t,n);if(s.get(r)?.has(e)){A(e,s.get(r),t,n);return}k(s.get(r)||/* @__PURE__ */ new Set,t,n),o.get(r)?.has(e)&&A(e,o.get(r),t,n)}var M=/* @__PURE__ */ new WeakMap;function N(e){if(!e.isTrusted)return;let t=e.composedPath()[0];if(!t)return;let n=t.ownerDocument;if(!g(n))return;let r=h(t);if(r&&e.type===`pointerdown`)M.set(n,r);else if(e.type===`pointerup`){let e=M.get(n)===r;M.delete(n),e&&j(r||n,!1,!0)}}var P=/* @__PURE__ */ new WeakMap;function F(e,t=!1){if(!e)return;P.has(e)||P.set(e,e.getAttribute(`aria-expanded`));let n=e.popoverTargetElement;if(n instanceof HTMLElement&&n.popover===`auto`)e.setAttribute(`aria-expanded`,String(t));else{let t=P.get(e);t?e.setAttribute(`aria-expanded`,t):e.removeAttribute(`aria-expanded`)}}var I=globalThis.ShadowRoot||function(){},L=`popover-polyfill`;function R(){return typeof HTMLElement<`u`&&typeof HTMLElement.prototype==`object`&&`popover`in HTMLElement.prototype}function z(e,t,n){let r=e[t];Object.defineProperty(e,t,{value(e){return r.call(this,n(e))}})}var B=/(^|[^\\]):popover-open\b/g;function V(){return typeof globalThis.CSSLayerBlockRule==`function`}function H(e){let t=V(),n=CSS.escape(e??window.POPOVER_POLYFILL_OPTIONS?.layerName??L);return`
1
+ var e=class extends Event{oldState;newState;constructor(e,t={}){let n=Object.assign({},t);delete n.oldState,delete n.newState,super(e,n),this.oldState=String(t.oldState||``),this.newState=String(t.newState||``)}},t=/* @__PURE__ */ new WeakMap;function n(n,r,i){t.set(n,setTimeout(()=>{t.has(n)&&n.dispatchEvent(new e(`toggle`,{cancelable:!1,oldState:r,newState:i}))},0))}var r=globalThis.ShadowRoot||function(){},i=globalThis.HTMLDialogElement||function(){},a=/* @__PURE__ */ new WeakMap,o=/* @__PURE__ */ new WeakMap,s=/* @__PURE__ */ new WeakMap,c=/* @__PURE__ */ new WeakMap;function l(e){return c.get(e)||`hidden`}var u=/* @__PURE__ */ new WeakMap;function d(e){return[...e].pop()}function f(e){let t=e.popoverTargetElement;if(!(t instanceof HTMLElement))return;let n=l(t);e.popoverTargetAction===`show`&&n===`showing`||e.popoverTargetAction===`hide`&&n===`hidden`||(n===`showing`?D(t,!0,!0):p(t,!1)&&(u.set(t,e),E(t)))}function p(e,t){return!(e.popover!==`auto`&&e.popover!==`manual`&&e.popover!==`hint`||!e.isConnected||t&&l(e)!==`showing`||!t&&l(e)!==`hidden`||e instanceof i&&e.hasAttribute(`open`)||document.fullscreenElement===e)}function m(e){if(!e)return 0;let t=o.get(document)||/* @__PURE__ */ new Set,n=s.get(document)||/* @__PURE__ */ new Set;return n.has(e)?[...n].indexOf(e)+t.size+1:t.has(e)?[...t].indexOf(e)+1:0}function h(e){let t=y(e),n=b(e);return m(t)>m(n)?t:n}function g(e){let t,n=s.get(e)||/* @__PURE__ */ new Set,r=o.get(e)||/* @__PURE__ */ new Set,i=n.size>0?n:r.size>0?r:null;return i?(t=d(i),t.isConnected?t:(i.delete(t),g(e))):null}function _(e){for(let t of e||[])if(!t.isConnected)e.delete(t);else return t;return null}function v(e){return typeof e.getRootNode==`function`?e.getRootNode():e.parentNode?v(e.parentNode):e}function y(e){for(;e;){if(e instanceof HTMLElement&&e.popover===`auto`&&c.get(e)===`showing`)return e;if(e=e instanceof Element&&e.assignedSlot||e.parentElement||v(e),e instanceof r&&(e=e.host),e instanceof Document)return}}function b(e){for(;e;){let t=e.popoverTargetElement;if(t instanceof HTMLElement)return t;if(e=e.parentElement||v(e),e instanceof r&&(e=e.host),e instanceof Document)return}}function x(e,t){let n=/* @__PURE__ */ new Map,r=0;for(let e of t||[])n.set(e,r),r+=1;n.set(e,r),r+=1;let i=null;function a(t){if(!t)return;let r=!1,a=null;for(;!r;){if(a=y(t)||null,a===null||!n.has(a))return;(e.popover===`hint`||a.popover===`auto`)&&(r=!0),r||(t=a.parentElement)}let o=n.get(a)??null;(i===null||n.get(i)<o)&&(i=a)}return a(e.parentElement||v(e)),i}function S(e){return e.hidden||e instanceof r||(e instanceof HTMLButtonElement||e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLOptGroupElement||e instanceof HTMLOptionElement||e instanceof HTMLFieldSetElement)&&e.disabled||e instanceof HTMLInputElement&&e.type===`hidden`||e instanceof HTMLAnchorElement&&e.href===``?!1:typeof e.tabIndex==`number`&&e.tabIndex!==-1}function C(e){if(e.shadowRoot&&e.shadowRoot.delegatesFocus!==!0)return null;let t=e;t.shadowRoot&&(t=t.shadowRoot);let n=t.querySelector(`[autofocus]`);if(n)return n;{let e=t.querySelectorAll(`slot`);for(let t of e){let e=t.assignedElements({flatten:!0});for(let t of e)if(t.hasAttribute(`autofocus`))return t;else if(n=t.querySelector(`[autofocus]`),n)return n}}let r=e.ownerDocument.createTreeWalker(t,NodeFilter.SHOW_ELEMENT),i=r.currentNode;for(;i;){if(S(i))return i;i=r.nextNode()}}function w(e){var t;(t=C(e))==null||t.focus()}var T=/* @__PURE__ */ new WeakMap;function E(t){if(!p(t,!1))return;let r=t.ownerDocument;if(!t.dispatchEvent(new e(`beforetoggle`,{cancelable:!0,oldState:`closed`,newState:`open`}))||!p(t,!1))return;let i=!1,l=t.popover,d=null,f=x(t,o.get(r)||/* @__PURE__ */ new Set),m=x(t,s.get(r)||/* @__PURE__ */ new Set);if(l===`auto`&&(k(s.get(r)||/* @__PURE__ */ new Set,i,!0),j(f||r,i,!0),d=`auto`),l===`hint`&&(m?(j(m,i,!0),d=`hint`):(k(s.get(r)||/* @__PURE__ */ new Set,i,!0),f?(j(f,i,!0),d=`auto`):d=`hint`)),l===`auto`||l===`hint`){if(l!==t.popover||!p(t,!1))return;g(r)||(i=!0),d===`auto`?(o.has(r)||o.set(r,/* @__PURE__ */ new Set),o.get(r).add(t)):d===`hint`&&(s.has(r)||s.set(r,/* @__PURE__ */ new Set),s.get(r).add(t))}T.delete(t);let h=r.activeElement;t.classList.add(`:popover-open`),c.set(t,`showing`),a.has(r)||a.set(r,/* @__PURE__ */ new Set),a.get(r).add(t),F(u.get(t),!0),w(t),i&&h&&t.popover===`auto`&&T.set(t,h),n(t,`closed`,`open`)}function D(t,r=!1,i=!1){var l,f;if(!p(t,!0))return;let m=t.ownerDocument;if([`auto`,`hint`].includes(t.popover)&&(j(t,r,i),!p(t,!0)))return;let h=o.get(m)||/* @__PURE__ */ new Set,g=h.has(t)&&d(h)===t;if(F(u.get(t),!1),u.delete(t),i&&(t.dispatchEvent(new e(`beforetoggle`,{oldState:`open`,newState:`closed`})),g&&d(h)!==t&&j(t,r,i),!p(t,!0)))return;(l=a.get(m))==null||l.delete(t),h.delete(t),(f=s.get(m))==null||f.delete(t),t.classList.remove(`:popover-open`),c.set(t,`hidden`),i&&n(t,`open`,`closed`);let _=T.get(t);_&&(T.delete(t),r&&_.focus())}function O(e,t=!1,n=!1){let r=g(e);for(;r;)D(r,t,n),r=g(e)}function k(e,t=!1,n=!1){let r=_(e);for(;r;)D(r,t,n),r=_(e)}function A(e,t,n,r){let i=!1,a=!1;for(;i||!a;){a=!0;let o=null,s=!1;for(let n of t)if(n===e)s=!0;else if(s){o=n;break}if(!o)return;for(;l(o)===`showing`&&t.size;)D(d(t),n,r);t.has(e)&&d(t)!==e&&(i=!0),i&&(r=!1)}}function j(e,t,n){let r=e.ownerDocument||e;if(e instanceof Document)return O(r,t,n);s.get(r)?.has(e)?A(e,s.get(r),t,n):(k(s.get(r)||/* @__PURE__ */ new Set,t,n),o.get(r)?.has(e)&&A(e,o.get(r),t,n))}var M=/* @__PURE__ */ new WeakMap;function N(e){if(!e.isTrusted)return;let t=e.composedPath()[0];if(!t)return;let n=t.ownerDocument;if(!g(n))return;let r=h(t);if(r&&e.type===`pointerdown`)M.set(n,r);else if(e.type===`pointerup`){let e=M.get(n)===r;M.delete(n),e&&j(r||n,!1,!0)}}var P=/* @__PURE__ */ new WeakMap;function F(e,t=!1){if(!e)return;P.has(e)||P.set(e,e.getAttribute(`aria-expanded`));let n=e.popoverTargetElement;if(n instanceof HTMLElement&&n.popover===`auto`)e.setAttribute(`aria-expanded`,String(t));else{let t=P.get(e);t?e.setAttribute(`aria-expanded`,t):e.removeAttribute(`aria-expanded`)}}var I=globalThis.ShadowRoot||function(){},L=`popover-polyfill`;function R(){return typeof HTMLElement<`u`&&typeof HTMLElement.prototype==`object`&&`popover`in HTMLElement.prototype}function z(e,t,n){let r=e[t];Object.defineProperty(e,t,{value(e){return r.call(this,n(e))}})}var B=/(^|[^\\]):popover-open\b/g;function V(){return typeof globalThis.CSSLayerBlockRule==`function`}function H(e){let t=V(),n=CSS.escape(e??window.POPOVER_POLYFILL_OPTIONS?.layerName??L);return`
2
2
  ${t?`@layer ${n} {`:``}
3
3
  :where([popover]) {
4
4
  position: fixed;
@@ -60,4 +60,4 @@ ${t?`@layer ${n} {`:``}
60
60
  }
61
61
  }
62
62
  ${t?`}`:``}
63
- `}var U=null;function W(e,t){let n=H(t);if(U===null)try{U=new CSSStyleSheet,U.replaceSync(n)}catch{U=!1}if(U===!1){let t=document.createElement(`style`);t.textContent=n,e instanceof Document?e.head.prepend(t):e.prepend(t)}else e.adoptedStyleSheets=[U,...e.adoptedStyleSheets]}function G(t){if(typeof window>`u`)return;let n=t?.layerName;window.ToggleEvent=window.ToggleEvent||e;function r(e){return e?.includes(`:popover-open`)&&(e=e.replace(B,`$1.\\:popover-open`)),e}z(Document.prototype,`querySelector`,r),z(Document.prototype,`querySelectorAll`,r),z(Element.prototype,`querySelector`,r),z(Element.prototype,`querySelectorAll`,r),z(Element.prototype,`matches`,r),z(Element.prototype,`closest`,r),z(DocumentFragment.prototype,`querySelectorAll`,r),Object.defineProperties(HTMLElement.prototype,{popover:{enumerable:!0,configurable:!0,get(){if(!this.hasAttribute(`popover`))return null;let e=(this.getAttribute(`popover`)||``).toLowerCase();return e===``||e==`auto`?`auto`:e==`hint`?`hint`:`manual`},set(e){e===null?this.removeAttribute(`popover`):this.setAttribute(`popover`,e)}},showPopover:{enumerable:!0,configurable:!0,value(e={}){E(this)}},hidePopover:{enumerable:!0,configurable:!0,value(){D(this,!0,!0)}},togglePopover:{enumerable:!0,configurable:!0,value(e={}){return typeof e==`boolean`&&(e={force:e}),c.get(this)===`showing`&&e.force===void 0||e.force===!1?D(this,!0,!0):(e.force===void 0||e.force===!0)&&E(this),c.get(this)===`showing`}}});let i=Element.prototype.attachShadow;i&&Object.defineProperties(Element.prototype,{attachShadow:{enumerable:!0,configurable:!0,writable:!0,value(e){let t=i.call(this,e);return W(t,n),t}}});let a=HTMLElement.prototype.attachInternals;a&&Object.defineProperties(HTMLElement.prototype,{attachInternals:{enumerable:!0,configurable:!0,writable:!0,value(){let e=a.call(this);return e.shadowRoot&&W(e.shadowRoot,n),e}}});let o=/* @__PURE__ */ new WeakMap;function s(e){Object.defineProperties(e.prototype,{popoverTargetElement:{enumerable:!0,configurable:!0,set(e){if(e===null)this.removeAttribute(`popovertarget`),o.delete(this);else if(e instanceof Element)this.setAttribute(`popovertarget`,``),o.set(this,e);else throw TypeError(`popoverTargetElement must be an element or null`)},get(){if(this.localName!==`button`&&this.localName!==`input`||this.localName===`input`&&this.type!==`reset`&&this.type!==`image`&&this.type!==`button`||this.disabled||this.form&&this.type===`submit`)return null;let e=o.get(this);if(e&&e.isConnected)return e;if(e&&!e.isConnected)return o.delete(this),null;let t=v(this),n=this.getAttribute(`popovertarget`);return(t instanceof Document||t instanceof I)&&n&&t.getElementById(n)||null}},popoverTargetAction:{enumerable:!0,configurable:!0,get(){let e=(this.getAttribute(`popovertargetaction`)||``).toLowerCase();return e===`show`||e===`hide`?e:`toggle`},set(e){this.setAttribute(`popovertargetaction`,e)}}})}s(HTMLButtonElement),s(HTMLInputElement);let l=e=>{if(e.defaultPrevented)return;let t=e.composedPath(),n=t[0];if(!(n instanceof Element)||n?.shadowRoot)return;let r=v(n);if(!(r instanceof I||r instanceof Document))return;let i=t.find(e=>e.matches?.call(e,`[popovertargetaction],[popovertarget]`));if(i){f(i),e.preventDefault();return}},u=e=>{let t=e.key,n=e.target;!e.defaultPrevented&&n&&(t===`Escape`||t===`Esc`)&&j(n.ownerDocument,!0,!0)};(e=>{e.addEventListener(`click`,l),e.addEventListener(`keydown`,u),e.addEventListener(`pointerdown`,N),e.addEventListener(`pointerup`,N)})(document),W(document,n)}R()||G();
63
+ `}var U=null;function W(e,t){let n=H(t);if(U===null)try{U=new CSSStyleSheet,U.replaceSync(n)}catch{U=!1}if(U===!1){let t=document.createElement(`style`);t.textContent=n,e instanceof Document?e.head.prepend(t):e.prepend(t)}else e.adoptedStyleSheets=[U,...e.adoptedStyleSheets]}function G(t){if(typeof window>`u`)return;let n=t?.layerName;window.ToggleEvent=window.ToggleEvent||e;function r(e){return e?.includes(`:popover-open`)&&(e=e.replace(B,`$1.\\:popover-open`)),e}z(Document.prototype,`querySelector`,r),z(Document.prototype,`querySelectorAll`,r),z(Element.prototype,`querySelector`,r),z(Element.prototype,`querySelectorAll`,r),z(Element.prototype,`matches`,r),z(Element.prototype,`closest`,r),z(DocumentFragment.prototype,`querySelectorAll`,r),Object.defineProperties(HTMLElement.prototype,{popover:{enumerable:!0,configurable:!0,get(){if(!this.hasAttribute(`popover`))return null;let e=(this.getAttribute(`popover`)||``).toLowerCase();return e===``||e==`auto`?`auto`:e==`hint`?`hint`:`manual`},set(e){e===null?this.removeAttribute(`popover`):this.setAttribute(`popover`,e)}},showPopover:{enumerable:!0,configurable:!0,value(e={}){E(this)}},hidePopover:{enumerable:!0,configurable:!0,value(){D(this,!0,!0)}},togglePopover:{enumerable:!0,configurable:!0,value(e={}){return typeof e==`boolean`&&(e={force:e}),c.get(this)===`showing`&&e.force===void 0||e.force===!1?D(this,!0,!0):(e.force===void 0||e.force===!0)&&E(this),c.get(this)===`showing`}}});let i=Element.prototype.attachShadow;i&&Object.defineProperties(Element.prototype,{attachShadow:{enumerable:!0,configurable:!0,writable:!0,value(e){let t=i.call(this,e);return W(t,n),t}}});let a=HTMLElement.prototype.attachInternals;a&&Object.defineProperties(HTMLElement.prototype,{attachInternals:{enumerable:!0,configurable:!0,writable:!0,value(){let e=a.call(this);return e.shadowRoot&&W(e.shadowRoot,n),e}}});let o=/* @__PURE__ */ new WeakMap;function s(e){Object.defineProperties(e.prototype,{popoverTargetElement:{enumerable:!0,configurable:!0,set(e){if(e===null)this.removeAttribute(`popovertarget`),o.delete(this);else if(e instanceof Element)this.setAttribute(`popovertarget`,``),o.set(this,e);else throw TypeError(`popoverTargetElement must be an element or null`)},get(){if(this.localName!==`button`&&this.localName!==`input`||this.localName===`input`&&this.type!==`reset`&&this.type!==`image`&&this.type!==`button`||this.disabled||this.form&&this.type===`submit`)return null;let e=o.get(this);if(e&&e.isConnected)return e;if(e&&!e.isConnected)return o.delete(this),null;let t=v(this),n=this.getAttribute(`popovertarget`);return(t instanceof Document||t instanceof I)&&n&&t.getElementById(n)||null}},popoverTargetAction:{enumerable:!0,configurable:!0,get(){let e=(this.getAttribute(`popovertargetaction`)||``).toLowerCase();return e===`show`||e===`hide`?e:`toggle`},set(e){this.setAttribute(`popovertargetaction`,e)}}})}s(HTMLButtonElement),s(HTMLInputElement);let l=e=>{if(e.defaultPrevented)return;let t=e.composedPath(),n=t[0];if(!(n instanceof Element)||n?.shadowRoot)return;let r=v(n);if(!(r instanceof I||r instanceof Document))return;let i=t.find(e=>e.matches?.call(e,`[popovertargetaction],[popovertarget]`));i&&(f(i),e.preventDefault())},u=e=>{let t=e.key,n=e.target;!e.defaultPrevented&&n&&(t===`Escape`||t===`Esc`)&&j(n.ownerDocument,!0,!0)};(e=>{e.addEventListener(`click`,l),e.addEventListener(`keydown`,u),e.addEventListener(`pointerdown`,N),e.addEventListener(`pointerup`,N)})(document),W(document,n)}R()||G();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getvitops/core",
3
- "version": "8.2.0-alpha.0",
3
+ "version": "8.3.0-alpha.0",
4
4
  "description": "The Vitops design-system framework — CSS partials, Lit web components, and browser polyfills.",
5
5
  "homepage": "https://docs.vitops.ca",
6
6
  "bugs": "https://github.com/getvitops/design-system/issues",
@@ -29,6 +29,7 @@
29
29
  "access": "public"
30
30
  },
31
31
  "devDependencies": {
32
+ "@getvitops/utils": "8.3.0-alpha.0",
32
33
  "@lit-labs/signals": "^0.3.0",
33
34
  "@oddbird/css-anchor-positioning": "^0.9.0",
34
35
  "@oddbird/popover-polyfill": "^0.7.0",
@@ -44,8 +45,7 @@
44
45
  "postcss": "^8.5.26",
45
46
  "postcss-lit": "^1.4.1",
46
47
  "scroll-timeline-polyfill": "^1.1.0",
47
- "temporal-polyfill": "^1.0.1",
48
- "@getvitops/utils": "8.2.0-alpha.0"
48
+ "temporal-polyfill": "^1.0.1"
49
49
  },
50
50
  "engines": {
51
51
  "node": ">=24"