@uicopilot/storybook-addon 0.5.45 → 0.5.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/manager.mjs +3 -3
- package/package.json +1 -1
package/dist/manager.mjs
CHANGED
|
@@ -9,9 +9,9 @@ var yE=Object.create;var el=Object.defineProperty;var bE=Object.getOwnPropertyDe
|
|
|
9
9
|
value: `+(i||"<empty string>")+`
|
|
10
10
|
--------`+new Array(o.mismatchOffset+1).join("-")+"^",Object.assign(o,u),o.loc={source:n&&n.loc&&n.loc.source||"<unknown>",start:u,end:c},o}});function Ll(e,t){return t=t||0,e.length-t>=2&&e.charCodeAt(t)===Al&&e.charCodeAt(t+1)===Al}function Hb(e,t){if(t=t||0,e.length-t>=3&&e.charCodeAt(t)===Al&&e.charCodeAt(t+1)!==Al){let n=e.indexOf("-",t+2);if(n!==-1)return e.substring(t,n+1)}return""}function WA(e){if(El.has(e))return El.get(e);let t=e.toLowerCase(),n=El.get(t);if(n===void 0){let r=Ll(t,0),o=r?"":Hb(t,0);n=Object.freeze({basename:t.substr(o.length),name:t,prefix:o,vendor:o,custom:r})}return El.set(e,n),n}function VA(e){if(Li.has(e))return Li.get(e);let t=e,n=e[0];n==="/"?n=e[1]==="/"?"//":"/":n!=="_"&&n!=="*"&&n!=="$"&&n!=="#"&&n!=="+"&&n!=="&"&&(n="");let r=Ll(t,n.length);if(!r&&(t=t.toLowerCase(),Li.has(t))){let a=Li.get(t);return Li.set(e,a),a}let o=r?"":Hb(t,n.length),i=t.substr(0,n.length+o.length),s=Object.freeze({basename:t.substr(i.length),name:t.substr(n.length),hack:n,vendor:o,prefix:i,custom:r});return Li.set(e,s),s}var El,Li,Al,Pl,ap,Ml=$(()=>{"use strict";El=new Map,Li=new Map,Al=45,Pl=WA,ap=VA});var Mi,Bl=$(()=>{"use strict";Mi=["initial","inherit","unset","revert","revert-layer"]});function up(e,t){return e!==null&&e.type===9&&e.value.charCodeAt(0)===t}function Ms(e,t,n){for(;e!==null&&(e.type===13||e.type===25);)e=n(++t);return t}function Eo(e,t,n,r){if(!e)return 0;let o=e.value.charCodeAt(t);if(o===Bs||o===$r){if(n)return 0;t++}for(;t<e.value.length;t++)if(!Ht(e.value.charCodeAt(t)))return 0;return r+1}function cp(e,t,n){let r=!1,o=Ms(e,t,n);if(e=n(o),e===null)return t;if(e.type!==10)if(up(e,Bs)||up(e,$r)){if(r=!0,o=Ms(n(++o),o,n),e=n(o),e===null||e.type!==10)return 0}else return t;if(!r){let i=e.value.charCodeAt(0);if(i!==Bs&&i!==$r)return 0}return Eo(e,r?0:1,r,o)}function pp(e,t){let n=0;if(!e)return 0;if(e.type===10)return Eo(e,0,qA,n);if(e.type===1&&e.value.charCodeAt(0)===$r){if(!Jr(e.value,1,lp))return 0;switch(e.value.length){case 2:return cp(t(++n),n,t);case 3:return e.value.charCodeAt(2)!==$r?0:(n=Ms(t(++n),n,t),e=t(n),Eo(e,0,Bi,n));default:return e.value.charCodeAt(2)!==$r?0:Eo(e,3,Bi,n)}}else if(e.type===1||up(e,Bs)&&t(n+1).type===1){if(e.type!==1&&(e=t(++n)),e===null||!Jr(e.value,0,lp))return 0;switch(e.value.length){case 1:return cp(t(++n),n,t);case 2:return e.value.charCodeAt(1)!==$r?0:(n=Ms(t(++n),n,t),e=t(n),Eo(e,0,Bi,n));default:return e.value.charCodeAt(1)!==$r?0:Eo(e,2,Bi,n)}}else if(e.type===12){let r=e.value.charCodeAt(0),o=r===Bs||r===$r?1:0,i=o;for(;i<e.value.length&&Ht(e.value.charCodeAt(i));i++);return i===o||!Jr(e.value,i,lp)?0:i+1===e.value.length?cp(t(++n),n,t):e.value.charCodeAt(i+1)!==$r?0:i+2===e.value.length?(n=Ms(t(++n),n,t),e=t(n),Eo(e,0,Bi,n)):Eo(e,i+2,Bi,n)}return 0}var Bs,$r,lp,Bi,qA,Wb=$(()=>{"use strict";lr();Bs=43,$r=45,lp=110,Bi=!0,qA=!1});function dp(e,t){return e!==null&&e.type===9&&e.value.charCodeAt(0)===t}function XA(e,t){return e.value.charCodeAt(0)===t}function Ds(e,t,n){let r=0;for(let o=t;o<e.value.length;o++){let i=e.value.charCodeAt(o);if(i===Vb&&n&&r!==0)return Ds(e,t+r+1,!1),6;if(!On(i)||++r>6)return 0}return r}function Dl(e,t,n){if(!e)return 0;for(;dp(n(t),Gb);){if(++e>6)return 0;t++}return t}function gp(e,t){let n=0;if(e===null||e.type!==1||!Jr(e.value,0,KA)||(e=t(++n),e===null))return 0;if(dp(e,YA))return e=t(++n),e===null?0:e.type===1?Dl(Ds(e,0,!0),++n,t):dp(e,Gb)?Dl(1,++n,t):0;if(e.type===10){let r=Ds(e,1,!0);return r===0?0:(e=t(++n),e===null?n:e.type===12||e.type===10?!XA(e,Vb)||!Ds(e,1,!1)?0:n+1:Dl(r,n,t))}return e.type===12?Dl(Ds(e,1,!0),++n,t):0}var YA,Vb,Gb,KA,qb=$(()=>{"use strict";lr();YA=43,Vb=45,Gb=63,KA=117});function Ir(e,t){return t<e.length?e.charCodeAt(t):0}function Kb(e,t){return Zr(e,0,e.length,t)}function Xb(e,t){for(let n=0;n<t.length;n++)if(Kb(e,t[n]))return!0;return!1}function Qb(e,t){return t!==e.length-2?!1:Ir(e,t)===92&&Ht(Ir(e,t+1))}function Rl(e,t,n){if(e&&e.type==="Range"){let r=Number(n!==void 0&&n!==t.length?t.substr(0,n):t);if(isNaN(r)||e.min!==null&&r<e.min&&typeof e.min!="string"||e.max!==null&&r>e.max&&typeof e.max!="string")return!0}return!1}function t2(e,t){let n=0,r=[],o=0;e:do{switch(e.type){case 24:case 22:case 20:if(e.type!==n)break e;if(n=r.pop(),r.length===0){o++;break e}break;case 2:case 21:case 19:case 23:r.push(n),n=bp.get(e.type);break}o++}while(e=t(o));return o}function ur(e,t){return function(n,r,o){return n===null?0:n.type===2&&Xb(n.value,t)?t2(n,r):e(n,r,o)}}function Lt(e){return function(t){return t===null||t.type!==e?0:1}}function n2(e){if(e===null||e.type!==1)return 0;let t=e.value.toLowerCase();return Xb(t,Mi)||Kb(t,"default")?0:1}function Jb(e){return e===null||e.type!==1||Ir(e.value,0)!==45||Ir(e.value,1)!==45?0:1}function r2(e){return!Jb(e)||e.value==="--"?0:1}function o2(e){if(e===null||e.type!==4)return 0;let t=e.value.length;if(t!==4&&t!==5&&t!==7&&t!==9)return 0;for(let n=1;n<t;n++)if(!On(Ir(e.value,n)))return 0;return 1}function i2(e){return e===null||e.type!==4||!vi(Ir(e.value,1),Ir(e.value,2),Ir(e.value,3))?0:1}function s2(e,t){if(!e)return 0;let n=0,r=[],o=0;e:do{switch(e.type){case 6:case 8:break e;case 24:case 22:case 20:if(e.type!==n)break e;n=r.pop();break;case 17:if(n===0)break e;break;case 9:if(n===0&&e.value==="!")break e;break;case 2:case 21:case 19:case 23:r.push(n),n=bp.get(e.type);break}o++}while(e=t(o));return o}function a2(e,t){if(!e)return 0;let n=0,r=[],o=0;e:do{switch(e.type){case 6:case 8:break e;case 24:case 22:case 20:if(e.type!==n)break e;n=r.pop();break;case 2:case 21:case 19:case 23:r.push(n),n=bp.get(e.type);break}o++}while(e=t(o));return o}function oo(e){return e&&(e=new Set(e)),function(t,n,r){if(t===null||t.type!==12)return 0;let o=Jo(t.value,0);if(e!==null){let i=t.value.indexOf("\\",o),s=i===-1||!Qb(t.value,i)?t.value.substr(o):t.value.substring(o,i);if(e.has(s.toLowerCase())===!1)return 0}return Rl(r,t.value,o)?0:1}}function l2(e,t,n){return e===null||e.type!==11||Rl(n,e.value,e.value.length-1)?0:1}function Zb(e){return typeof e!="function"&&(e=function(){return 0}),function(t,n,r){return t!==null&&t.type===10&&Number(t.value)===0?1:e(t,n,r)}}function c2(e,t,n){if(e===null)return 0;let r=Jo(e.value,0);return!(r===e.value.length)&&!Qb(e.value,r)||Rl(n,e.value,r)?0:1}function u2(e,t,n){if(e===null||e.type!==10)return 0;let r=Ir(e.value,0)===43||Ir(e.value,0)===45?1:0;for(;r<e.value.length;r++)if(!Ht(Ir(e.value,r)))return 0;return Rl(n,e.value,r)?0:1}function f2(e){let{angle:t,decibel:n,frequency:r,flex:o,length:i,resolution:s,semitones:a,time:u}=e||{};return{dimension:ur(oo(null),ro),angle:ur(oo(t),ro),decibel:ur(oo(n),ro),frequency:ur(oo(r),ro),flex:ur(oo(o),ro),length:ur(Zb(oo(i)),ro),resolution:ur(oo(s),ro),semitones:ur(oo(a),ro),time:ur(oo(u),ro)}}function m2(e){let t=new Set;for(let n of g2)if(Array.isArray(e[n]))for(let r of e[n])t.add(r.toLowerCase());return function(r){return r===null?0:r.type===9&&r.value==="%"||r.type===1&&t.has(r.value.toLowerCase())?1:0}}function e0(e){return{...p2,...d2,...f2(e),"attr-unit":m2(e)}}var fp,mp,hp,QA,JA,ZA,xp,yp,Yb,e2,ro,bp,p2,d2,g2,t0=$(()=>{"use strict";Bl();Wb();qb();lr();fp=["calc(","-moz-calc(","-webkit-calc("],mp=["min(","max(","clamp("],hp=["round(","mod(","rem("],QA=["sin(","cos(","tan("],JA=["asin(","acos(","atan(","atan2("],ZA=["pow(","sqrt(","log(","exp(","sign("],xp=["hypot("],yp=["abs("],Yb=[...fp,...mp,...hp,...QA,...ZA,...xp,...yp],e2=[...fp,...mp,...hp,...xp,...yp],ro=[...fp,...mp,...hp,...JA,...xp,...yp],bp=new Map([[2,22],[21,22],[19,20],[23,24]]);p2={"ident-token":Lt(1),"function-token":Lt(2),"at-keyword-token":Lt(3),"hash-token":Lt(4),"string-token":Lt(5),"bad-string-token":Lt(6),"url-token":Lt(7),"bad-url-token":Lt(8),"delim-token":Lt(9),"number-token":Lt(10),"percentage-token":Lt(11),"dimension-token":Lt(12),"whitespace-token":Lt(13),"CDO-token":Lt(14),"CDC-token":Lt(15),"colon-token":Lt(16),"semicolon-token":Lt(17),"comma-token":Lt(18),"[-token":Lt(19),"]-token":Lt(20),"(-token":Lt(21),")-token":Lt(22),"{-token":Lt(23),"}-token":Lt(24)},d2={string:Lt(5),ident:Lt(1),percentage:ur(l2,e2),zero:Zb(),number:ur(c2,Yb),integer:ur(u2,Yb),"custom-ident":n2,"dashed-ident":Jb,"custom-property-name":r2,"hex-color":o2,"id-selector":i2,"an-plus-b":pp,urange:gp,"declaration-value":s2,"any-value":a2},g2=["length","angle","time","frequency","resolution","flex","decibel","semitones"]});var zl={};ye(zl,{angle:()=>x2,decibel:()=>v2,flex:()=>w2,frequency:()=>b2,length:()=>h2,resolution:()=>S2,semitones:()=>k2,time:()=>y2});var h2,x2,y2,b2,S2,w2,v2,k2,n0=$(()=>{"use strict";h2=["cm","mm","q","in","pt","pc","px","em","rem","ex","rex","cap","rcap","ch","rch","ic","ric","lh","rlh","vw","svw","lvw","dvw","vh","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax","cqw","cqh","cqi","cqb","cqmin","cqmax"],x2=["deg","grad","rad","turn"],y2=["s","ms"],b2=["hz","khz"],S2=["dpi","dpcm","dppx","x"],w2=["fr"],v2=["db"],k2=["st"]});function r0(e,t,n){return Object.assign(ei("SyntaxError",e),{input:t,offset:n,rawMessage:e,message:e+`
|
|
11
11
|
`+t+`
|
|
12
|
-
--`+new Array((n||t.length)+1).join("-")+"^"})}var o0=$(()=>{"use strict";wl()});var C2,T2,I2,F2,E2,i0,Nl,s0=$(()=>{"use strict";o0();C2=9,T2=10,I2=12,F2=13,E2=32,i0=new Uint8Array(128).map((e,t)=>/[a-zA-Z0-9\-]/.test(String.fromCharCode(t))?1:0),Nl=class{constructor(t){this.str=t,this.pos=0}charCodeAt(t){return t<this.str.length?this.str.charCodeAt(t):0}charCode(){return this.charCodeAt(this.pos)}isNameCharCode(t=this.charCode()){return t<128&&i0[t]===1}nextCharCode(){return this.charCodeAt(this.pos+1)}nextNonWsCode(t){return this.charCodeAt(this.findWsEnd(t))}skipWs(){this.pos=this.findWsEnd(this.pos)}findWsEnd(t){for(;t<this.str.length;t++){let n=this.str.charCodeAt(t);if(n!==F2&&n!==T2&&n!==I2&&n!==E2&&n!==C2)break}return t}substringToPos(t){return this.str.substring(this.pos,this.pos=t)}eat(t){this.charCode()!==t&&this.error("Expect `"+String.fromCharCode(t)+"`"),this.pos++}peek(){return this.pos<this.str.length?this.str.charAt(this.pos++):""}error(t){throw new r0(t,this.str,this.pos)}scanSpaces(){return this.substringToPos(this.findWsEnd(this.pos))}scanWord(){let t=this.pos;for(;t<this.str.length;t++){let n=this.str.charCodeAt(t);if(n>=128||i0[n]===0)break}return this.pos===t&&this.error("Expect a keyword"),this.substringToPos(t)}scanNumber(){let t=this.pos;for(;t<this.str.length;t++){let n=this.str.charCodeAt(t);if(n<48||n>57)break}return this.pos===t&&this.error("Expect a number"),this.substringToPos(t)}scanString(){let t=this.str.indexOf("'",this.pos+1);return t===-1&&(this.pos=this.str.length,this.error("Expect an apostrophe")),this.substringToPos(t+1)}}});function d0(e){let t=null,n=null;return e.eat($l),e.skipWs(),t=e.scanNumber(e),e.skipWs(),e.charCode()===Tp?(e.pos++,e.skipWs(),e.charCode()!==vp&&(n=e.scanNumber(e),e.skipWs())):n=t,e.eat(vp),{min:Number(t),max:n?Number(n):0}}function R2(e){let t=null,n=!1;switch(e.charCode()){case h0:e.pos++,t={min:0,max:0};break;case Cp:e.pos++,t={min:1,max:0};break;case _l:e.pos++,t={min:0,max:1};break;case kp:e.pos++,n=!0,e.charCode()===$l?t=d0(e):e.charCode()===_l?(e.pos++,t={min:0,max:0}):t={min:1,max:0};break;case $l:t=d0(e);break;default:return null}return{type:"Multiplier",comma:n,min:t.min,max:t.max,term:null}}function io(e,t){let n=R2(e);return n!==null?(n.term=t,e.charCode()===kp&&e.charCodeAt(e.pos-1)===Cp||e.charCode()===_l&&e.charCodeAt(e.pos-1)===vp?io(e,n):n):t}function Sp(e){let t=e.peek();return t===""?null:io(e,{type:"Token",value:t})}function z2(e){let t;return e.eat(Ip),e.eat(Ol),t=e.scanWord(),e.eat(Ol),e.eat(wp),io(e,{type:"Property",name:t})}function N2(e){let t=null,n=null,r=1;return e.eat(Rs),e.charCode()===l0&&(e.peek(),r=-1),r==-1&&e.charCode()===u0?e.peek():(t=r*Number(e.scanNumber(e)),e.isNameCharCode()&&(t+=e.scanWord())),e.skipWs(),e.eat(Tp),e.skipWs(),e.charCode()===u0?e.peek():(r=1,e.charCode()===l0&&(e.peek(),r=-1),n=r*Number(e.scanNumber(e)),e.isNameCharCode()&&(n+=e.scanWord())),e.eat(Di),{type:"Range",min:t,max:n}}function O2(e){let t,n=null;if(e.eat(Ip),t=e.scanWord(),t==="boolean-expr"){e.eat(Rs);let r=Ul(e,Di);return e.eat(Di),e.eat(wp),io(e,{type:"Boolean",term:r.terms.length===1?r.terms[0]:r})}return e.charCode()===f0&&e.nextCharCode()===m0&&(e.pos+=2,t+="()"),e.charCodeAt(e.findWsEnd(e.pos))===Rs&&(e.skipWs(),n=N2(e)),e.eat(wp),io(e,{type:"Type",name:t,opts:n})}function _2(e){let t=e.scanWord();return e.charCode()===f0?(e.pos++,{type:"Function",name:t}):io(e,{type:"Keyword",name:t})}function $2(e,t){function n(o,i){return{type:"Group",terms:o,combinator:i,disallowEmpty:!1,explicit:!1}}let r;for(t=Object.keys(t).sort((o,i)=>p0[o]-p0[i]);t.length>0;){r=t.shift();let o=0,i=0;for(;o<e.length;o++){let s=e[o];s.type==="Combinator"&&(s.value===r?(i===-1&&(i=o-1),e.splice(o,1),o--):(i!==-1&&o-i>1&&(e.splice(i,o-i,n(e.slice(i,o),r)),o=i+1),i=-1))}i!==-1&&t.length&&e.splice(i,o-i,n(e.slice(i,o),r))}return r}function Ul(e,t=-1){let n=Object.create(null),r=[],o=null,i=e.pos,s=!1;for(;e.charCode()!==t;){let a=s?Ul(e,m0):j2(e);if(!a)break;if(a.type!=="Spaces"){if(s){if(a.terms.length===0){s=!1;continue}if(a.combinator===" "){for(;a.terms.length>1;)n[" "]=!0,r.push({type:"Combinator",value:" "},a.terms.shift());a=a.terms[0]}}a.type==="Combinator"?((o===null||o.type==="Combinator")&&(e.pos=i,e.error("Unexpected combinator")),n[a.value]=!0):o!==null&&o.type!=="Combinator"&&(n[" "]=!0,r.push({type:"Combinator",value:" "})),r.push(a),o=a,i=e.pos,s=a.type==="Function"}}return o!==null&&o.type==="Combinator"&&(e.pos-=i,e.error("Unexpected combinator")),{type:"Group",terms:r,combinator:$2(r,n)||" ",disallowEmpty:!1,explicit:!1}}function U2(e){let t;return e.eat(Rs),t=Ul(e,Di),e.eat(Di),t.explicit=!0,e.charCode()===g0&&(e.pos++,t.disallowEmpty=!0),t}function j2(e){let t=e.charCode();switch(t){case Di:break;case Rs:return io(e,U2(e));case Ip:return e.nextCharCode()===Ol?z2(e):O2(e);case c0:return{type:"Combinator",value:e.substringToPos(e.pos+(e.nextCharCode()===c0?2:1))};case a0:return e.pos++,e.eat(a0),{type:"Combinator",value:"&&"};case Tp:return e.pos++,{type:"Comma"};case Ol:return io(e,{type:"String",value:e.scanString()});case B2:case A2:case P2:case M2:case L2:return{type:"Spaces",value:e.scanSpaces()};case D2:return t=e.nextCharCode(),e.isNameCharCode(t)?(e.pos++,{type:"AtKeyword",name:e.scanWord()}):Sp(e);case h0:case Cp:case _l:case kp:case g0:break;case $l:if(t=e.nextCharCode(),t<48||t>57)return Sp(e);break;default:return e.isNameCharCode(t)?_2(e):Sp(e)}}function zs(e){let t=new Nl(e),n=Ul(t);return t.pos!==e.length&&t.error("Unexpected input"),n.terms.length===1&&n.terms[0].type==="Group"?n.terms[0]:n}var A2,P2,L2,M2,B2,g0,kp,a0,Ol,f0,m0,h0,Cp,Tp,l0,Ip,wp,_l,D2,Rs,Di,$l,c0,vp,u0,p0,Fp=$(()=>{"use strict";s0();A2=9,P2=10,L2=12,M2=13,B2=32,g0=33,kp=35,a0=38,Ol=39,f0=40,m0=41,h0=42,Cp=43,Tp=44,l0=45,Ip=60,wp=62,_l=63,D2=64,Rs=91,Di=93,$l=123,c0=124,vp=125,u0=8734,p0={" ":1,"&&":2,"||":3,"|":4}});function x0(e){return typeof e=="function"?e:Ns}function Ep(e,t,n){function r(s){switch(o.call(n,s),s.type){case"Group":s.terms.forEach(r);break;case"Multiplier":case"Boolean":r(s.term);break;case"Type":case"Property":case"Keyword":case"AtKeyword":case"Function":case"String":case"Token":case"Comma":break;default:throw new Error("Unknown type: "+s.type)}i.call(n,s)}let o=Ns,i=Ns;if(typeof t=="function"?o=t:t&&(o=x0(t.enter),i=x0(t.leave)),o===Ns&&i===Ns)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");r(e,n)}var Ns,y0=$(()=>{"use strict";Ns=function(){}});var Ap=$(()=>{"use strict";sp();Fp();y0()});function V2(e){let t=[];return Fo(e,(n,r,o)=>t.push({type:n,value:e.slice(r,o),node:null})),t}function b0(e,t){return typeof e=="string"?V2(e):t.generate(e,W2)}var W2,S0=$(()=>{"use strict";lr();W2={decorator(e){let t=[],n=null;return{...e,node(r){let o=n;n=r,e.node.call(this,r),n=o},emit(r,o,i){t.push({type:o,value:r,node:i?null:n})},result(){return t}}}}});function kn(e,t,n){return t===ft&&n===kt||e===ft&&t===ft&&n===ft?e:(e.type==="If"&&e.else===kt&&t===ft&&(t=e.then,e=e.match),{type:"If",match:e,then:t,else:n})}function v0(e){return e.length>2&&e.charCodeAt(e.length-2)===G2&&e.charCodeAt(e.length-1)===q2}function w0(e){return e.type==="Keyword"||e.type==="AtKeyword"||e.type==="Function"||e.type==="Type"&&v0(e.name)}function Ao(e,t=" ",n=!1){return{type:"Group",terms:e,combinator:t,disallowEmpty:!1,explicit:n}}function Os(e,t,n=new Set){if(!n.has(e))switch(n.add(e),e.type){case"If":e.match=Os(e.match,t,n),e.then=Os(e.then,t,n),e.else=Os(e.else,t,n);break;case"Type":return t[e.name]||e}return e}function Pp(e,t,n){switch(e){case" ":{let r=ft;for(let o=t.length-1;o>=0;o--){let i=t[o];r=kn(i,r,kt)}return r}case"|":{let r=kt,o=null;for(let i=t.length-1;i>=0;i--){let s=t[i];if(w0(s)&&(o===null&&i>0&&w0(t[i-1])&&(o=Object.create(null),r=kn({type:"Enum",map:o},ft,r)),o!==null)){let a=(v0(s.name)?s.name.slice(0,-1):s.name).toLowerCase();if(!(a in o)){o[a]=s;continue}}o=null,r=kn(s,ft,r)}return r}case"&&":{if(t.length>5)return{type:"MatchOnce",terms:t,all:!0};let r=kt;for(let o=t.length-1;o>=0;o--){let i=t[o],s;t.length>1?s=Pp(e,t.filter(function(a){return a!==i}),!1):s=ft,r=kn(i,s,r)}return r}case"||":{if(t.length>5)return{type:"MatchOnce",terms:t,all:!1};let r=n?ft:kt;for(let o=t.length-1;o>=0;o--){let i=t[o],s;t.length>1?s=Pp(e,t.filter(function(a){return a!==i}),!0):s=ft,r=kn(i,s,r)}return r}}}function Y2(e){let t=ft,n=Ri(e.term);if(e.max===0)n=kn(n,jl,kt),t=kn(n,null,kt),t.then=kn(ft,ft,t),e.comma&&(t.then.else=kn({type:"Comma",syntax:e},t,kt));else for(let r=e.min||1;r<=e.max;r++)e.comma&&t!==ft&&(t=kn({type:"Comma",syntax:e},t,kt)),t=kn(n,kn(ft,ft,t),kt);if(e.min===0)t=kn(ft,ft,t);else for(let r=0;r<e.min-1;r++)e.comma&&t!==ft&&(t=kn({type:"Comma",syntax:e},t,kt)),t=kn(n,t,kt);return t}function Ri(e){if(typeof e=="function")return{type:"Generic",fn:e};switch(e.type){case"Group":{let t=Pp(e.combinator,e.terms.map(Ri),!1);return e.disallowEmpty&&(t=kn(t,jl,kt)),t}case"Multiplier":return Y2(e);case"Boolean":{let t=Ri(e.term),n=Ri(Ao([Ao([{type:"Keyword",name:"not"},{type:"Type",name:"!boolean-group"}]),Ao([{type:"Type",name:"!boolean-group"},Ao([{type:"Multiplier",comma:!1,min:0,max:0,term:Ao([{type:"Keyword",name:"and"},{type:"Type",name:"!boolean-group"}])},{type:"Multiplier",comma:!1,min:0,max:0,term:Ao([{type:"Keyword",name:"or"},{type:"Type",name:"!boolean-group"}])}],"|")])],"|")),r=Ri(Ao([{type:"Type",name:"!term"},Ao([{type:"Token",value:"("},{type:"Type",name:"!self"},{type:"Token",value:")"}]),{type:"Type",name:"general-enclosed"}],"|"));return Os(r,{"!term":t,"!self":n}),Os(n,{"!boolean-group":r}),n}case"Type":case"Property":return{type:e.type,name:e.name,syntax:e};case"Keyword":return{type:e.type,name:e.name.toLowerCase(),syntax:e};case"AtKeyword":return{type:e.type,name:"@"+e.name.toLowerCase(),syntax:e};case"Function":return{type:e.type,name:e.name.toLowerCase()+"(",syntax:e};case"String":return e.value.length===3?{type:"Token",value:e.value.charAt(1),syntax:e}:{type:e.type,value:e.value.substr(1,e.value.length-2).replace(/\\'/g,"'"),syntax:e};case"Token":return{type:e.type,value:e.value,syntax:e};case"Comma":return{type:e.type,syntax:e};default:throw new Error("Unknown node type:",e.type)}}function _s(e,t){return typeof e=="string"&&(e=zs(e)),{type:"MatchGraph",match:Ri(e),syntax:t||null,source:e}}var ft,kt,jl,G2,q2,Lp=$(()=>{"use strict";Fp();ft={type:"Match"},kt={type:"Mismatch"},jl={type:"DisallowEmpty"},G2=40,q2=41});function eP(e){let t=null,n=null,r=e;for(;r!==null;)n=r.prev,r.prev=t,t=r,r=n;return t}function Mp(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let r=t.charCodeAt(n),o=e.charCodeAt(n);if(o>=65&&o<=90&&(o=o|32),o!==r)return!1}return!0}function tP(e){return e.type!==9?!1:e.value!=="?"}function I0(e){return e===null?!0:e.type===18||e.type===2||e.type===21||e.type===19||e.type===23||tP(e)}function F0(e){return e===null?!0:e.type===22||e.type===20||e.type===24||e.type===9&&e.value==="/"}function nP(e,t,n){function r(){do v++,F=v<e.length?e[v]:null;while(F!==null&&(F.type===13||F.type===25))}function o(U){let L=v+U;return L<e.length?e[L]:null}function i(U,L){return{nextState:U,matchStack:N,syntaxStack:d,thenStack:g,tokenIndex:v,prev:L}}function s(U){g={nextState:U,matchStack:N,syntaxStack:d,prev:g}}function a(U){p=i(U,p)}function u(){N={type:X2,syntax:t.syntax,token:F,prev:N},r(),h=null,v>D&&(D=v)}function c(){d={syntax:t.syntax,opts:t.syntax.opts||d!==null&&d.opts||null,prev:d},N={type:Bp,syntax:t.syntax,token:N.token,prev:N}}function l(){N.type===Bp?N=N.prev:N={type:E0,syntax:d.syntax,token:N.token,prev:N},d=d.prev}let d=null,g=null,p=null,h=null,S=0,T=null,F=null,v=-1,D=0,N={type:K2,syntax:null,token:null,prev:null};for(r();T===null&&++S<T0;)switch(t.type){case"Match":if(g===null){if(F!==null&&(v!==e.length-1||F.value!=="\\0"&&F.value!=="\\9")){t=kt;break}T=C0;break}if(t=g.nextState,t===jl)if(g.matchStack===N){t=kt;break}else t=ft;for(;g.syntaxStack!==d;)l();g=g.prev;break;case"Mismatch":if(h!==null&&h!==!1)(p===null||v>p.tokenIndex)&&(p=h,h=!1);else if(p===null){T=Q2;break}t=p.nextState,g=p.thenStack,d=p.syntaxStack,N=p.matchStack,v=p.tokenIndex,F=v<e.length?e[v]:null,p=p.prev;break;case"MatchGraph":t=t.match;break;case"If":t.else!==kt&&a(t.else),t.then!==ft&&s(t.then),t=t.match;break;case"MatchOnce":t={type:"MatchOnceBuffer",syntax:t,index:0,mask:0};break;case"MatchOnceBuffer":{let z=t.syntax.terms;if(t.index===z.length){if(t.mask===0||t.syntax.all){t=kt;break}t=ft;break}if(t.mask===(1<<z.length)-1){t=ft;break}for(;t.index<z.length;t.index++){let m=1<<t.index;if((t.mask&m)===0){a(t),s({type:"AddMatchOnce",syntax:t.syntax,mask:t.mask|m}),t=z[t.index++];break}}break}case"AddMatchOnce":t={type:"MatchOnceBuffer",syntax:t.syntax,index:0,mask:t.mask};break;case"Enum":if(F!==null){let z=F.value.toLowerCase();if(z.indexOf("\\")!==-1&&(z=z.replace(/\\[09].*$/,"")),k0.call(t.map,z)){t=t.map[z];break}}t=kt;break;case"Generic":{let z=d!==null?d.opts:null,m=v+Math.floor(t.fn(F,o,z));if(!isNaN(m)&&m>v){for(;v<m;)u();t=ft}else t=kt;break}case"Type":case"Property":{let z=t.type==="Type"?"types":"properties",m=k0.call(n,z)?n[z][t.name]:null;if(!m||!m.match)throw new Error("Bad syntax reference: "+(t.type==="Type"?"<"+t.name+">":"<'"+t.name+"'>"));if(h!==!1&&F!==null&&t.type==="Type"&&(t.name==="custom-ident"&&F.type===1||t.name==="length"&&F.value==="0")){h===null&&(h=i(t,p)),t=kt;break}c(),t=m.matchRef||m.match;break}case"Keyword":{let z=t.name;if(F!==null){let m=F.value;if(m.indexOf("\\")!==-1&&(m=m.replace(/\\[09].*$/,"")),Mp(m,z)){u(),t=ft;break}}t=kt;break}case"AtKeyword":case"Function":if(F!==null&&Mp(F.value,t.name)){u(),t=ft;break}t=kt;break;case"Token":if(F!==null&&F.value===t.value){u(),t=ft;break}t=kt;break;case"Comma":F!==null&&F.type===18?I0(N.token)?t=kt:(u(),t=F0(F)?kt:ft):t=I0(N.token)||F0(F)?ft:kt;break;case"String":let U="",L=v;for(;L<e.length&&U.length<t.value.length;L++)U+=e[L].value;if(Mp(U,t.value)){for(;v<L;)u();t=ft}else t=kt;break;default:throw new Error("Unknown node type: "+t.type)}switch(Z2+=S,T){case null:console.warn("[csstree-match] BREAK after "+T0+" iterations"),T=J2,N=null;break;case C0:for(;d!==null;)l();break;default:N=null}return{tokens:e,reason:T,iterations:S,match:N,longestMatch:D}}function Dp(e,t,n){let r=nP(e,t,n||{});if(r.match===null)return r;let o=r.match,i=r.match={syntax:t.syntax||null,match:[]},s=[i];for(o=eP(o).prev;o!==null;){switch(o.type){case Bp:i.match.push(i={syntax:o.syntax,match:[]}),s.push(i);break;case E0:s.pop(),i=s[s.length-1];break;default:i.match.push({syntax:o.syntax||null,token:o.token.value,node:o.token.node})}o=o.prev}return r}var k0,K2,X2,Bp,E0,C0,Q2,J2,T0,Z2,A0=$(()=>{"use strict";Lp();({hasOwnProperty:k0}=Object.prototype),K2=0,X2=1,Bp=2,E0=3,C0="Match",Q2="Mismatch",J2="Maximum iteration number exceeded (please fill an issue on https://github.com/csstree/csstree/issues)",T0=15e3,Z2=0});var zp={};ye(zp,{getTrace:()=>P0,isKeyword:()=>iP,isProperty:()=>oP,isType:()=>rP});function P0(e){function t(o){return o===null?!1:o.type==="Type"||o.type==="Property"||o.type==="Keyword"}function n(o){if(Array.isArray(o.match)){for(let i=0;i<o.match.length;i++)if(n(o.match[i]))return t(o.syntax)&&r.unshift(o.syntax),!0}else if(o.node===e)return r=t(o.syntax)?[o.syntax]:[],!0;return!1}let r=null;return this.matched!==null&&n(this.matched),r}function rP(e,t){return Rp(this,e,n=>n.type==="Type"&&n.name===t)}function oP(e,t){return Rp(this,e,n=>n.type==="Property"&&n.name===t)}function iP(e){return Rp(this,e,t=>t.type==="Keyword")}function Rp(e,t,n){let r=P0.call(e,t);return r===null?!1:r.some(n)}var L0=$(()=>{"use strict"});function M0(e){return"node"in e?e.node:M0(e.match[0])}function B0(e){return"node"in e?e.node:B0(e.match[e.match.length-1])}function Np(e,t,n,r,o){function i(a){if(a.syntax!==null&&a.syntax.type===r&&a.syntax.name===o){let u=M0(a),c=B0(a);e.syntax.walk(t,function(l,d,g){if(l===u){let p=new Zn;do{if(p.appendData(d.data),d.data===c)break;d=d.next}while(d!==null);s.push({parent:g,nodes:p})}})}Array.isArray(a.match)&&a.match.forEach(i)}let s=[];return n.matched!==null&&i(n.matched),s}var D0=$(()=>{"use strict";Fs()});function Op(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&e>=0}function R0(e){return!!e&&Op(e.offset)&&Op(e.line)&&Op(e.column)}function sP(e,t){return function(r,o){if(!r||r.constructor!==Object)return o(r,"Type of node should be an Object");for(let i in r){let s=!0;if($s.call(r,i)!==!1){if(i==="type")r.type!==e&&o(r,"Wrong node type `"+r.type+"`, expected `"+e+"`");else if(i==="loc"){if(r.loc===null)continue;if(r.loc&&r.loc.constructor===Object)if(typeof r.loc.source!="string")i+=".source";else if(!R0(r.loc.start))i+=".start";else if(!R0(r.loc.end))i+=".end";else continue;s=!1}else if(t.hasOwnProperty(i)){s=!1;for(let a=0;!s&&a<t[i].length;a++){let u=t[i][a];switch(u){case String:s=typeof r[i]=="string";break;case Boolean:s=typeof r[i]=="boolean";break;case null:s=r[i]===null;break;default:typeof u=="string"?s=r[i]&&r[i].type===u:Array.isArray(u)&&(s=r[i]instanceof Zn)}}}else o(r,"Unknown field `"+i+"` for "+e+" node type");s||o(r,"Bad value for `"+e+"."+i+"`")}}for(let i in t)$s.call(t,i)&&$s.call(r,i)===!1&&o(r,"Field `"+e+"."+i+"` is missed")}}function z0(e,t){let n=[];for(let r=0;r<e.length;r++){let o=e[r];if(o===String||o===Boolean)n.push(o.name.toLowerCase());else if(o===null)n.push("null");else if(typeof o=="string")n.push(o);else if(Array.isArray(o))n.push("List<"+(z0(o,t)||"any")+">");else throw new Error("Wrong value `"+o+"` in `"+t+"` structure definition")}return n.join(" | ")}function aP(e,t){let n=t.structure,r={type:String,loc:!0},o={type:'"'+e+'"'};for(let i in n){if($s.call(n,i)===!1)continue;let s=r[i]=Array.isArray(n[i])?n[i].slice():[n[i]];o[i]=z0(s,e+"."+i)}return{docs:o,check:sP(e,r)}}function N0(e){let t={};if(e.node){for(let n in e.node)if($s.call(e.node,n)){let r=e.node[n];if(r.structure)t[n]=aP(n,r);else throw new Error("Missed `structure` field in `"+n+"` node type definition")}}return t}var $s,O0=$(()=>{"use strict";Fs();({hasOwnProperty:$s}=Object.prototype)});function _p(e,t,n){let r={};for(let o in e)e[o].syntax&&(r[o]=n?e[o].syntax:Ai(e[o].syntax,{compact:t}));return r}function lP(e,t,n){let r={};for(let[o,i]of Object.entries(e))r[o]={prelude:i.prelude&&(n?i.prelude.syntax:Ai(i.prelude.syntax,{compact:t})),descriptors:i.descriptors&&_p(i.descriptors,t,n)};return r}function cP(e){for(let t=0;t<e.length;t++)if(e[t].value.toLowerCase()==="var(")return!0;return!1}function uP(e){let t=e.terms[0];return e.explicit===!1&&e.terms.length===1&&t.type==="Multiplier"&&t.comma===!0}function Fr(e,t,n){return{matched:e,iterations:n,error:t,...zp}}function zi(e,t,n,r){let o=b0(n,e.syntax),i;return cP(o)?Fr(null,new Error("Matching for a tree with var() is not supported")):(r&&(i=Dp(o,e.cssWideKeywordsSyntax,e)),(!r||!i.match)&&(i=Dp(o,t.match,e),!i.match)?Fr(null,new Ub(i.reason,t.syntax,n,i),i.iterations):Fr(i.match,null,i.iterations))}var Us,_0=$(()=>{"use strict";jb();Ml();Bl();t0();n0();Ap();S0();Lp();A0();L0();D0();O0();Us=class{constructor(t,n,r){if(this.cssWideKeywords=Mi,this.syntax=n,this.generic=!1,this.units={...zl},this.atrules=Object.create(null),this.properties=Object.create(null),this.types=Object.create(null),this.structure=r||N0(t),t){if(t.cssWideKeywords&&(this.cssWideKeywords=t.cssWideKeywords),t.units)for(let o of Object.keys(zl))Array.isArray(t.units[o])&&(this.units[o]=t.units[o]);if(t.types)for(let[o,i]of Object.entries(t.types))this.addType_(o,i);if(t.generic){this.generic=!0;for(let[o,i]of Object.entries(e0(this.units)))this.addType_(o,i)}if(t.atrules)for(let[o,i]of Object.entries(t.atrules))this.addAtrule_(o,i);if(t.properties)for(let[o,i]of Object.entries(t.properties))this.addProperty_(o,i)}this.cssWideKeywordsSyntax=_s(this.cssWideKeywords.join(" | "))}checkStructure(t){function n(i,s){o.push({node:i,message:s})}let r=this.structure,o=[];return this.syntax.walk(t,function(i){r.hasOwnProperty(i.type)?r[i.type].check(i,n):n(i,"Unknown node type `"+i.type+"`")}),o.length?o:!1}createDescriptor(t,n,r,o=null){let i={type:n,name:r},s={type:n,name:r,parent:o,serializable:typeof t=="string"||t&&typeof t.type=="string",syntax:null,match:null,matchRef:null};return typeof t=="function"?s.match=_s(t,i):(typeof t=="string"?Object.defineProperty(s,"syntax",{get(){return Object.defineProperty(s,"syntax",{value:zs(t)}),s.syntax}}):s.syntax=t,Object.defineProperty(s,"match",{get(){return Object.defineProperty(s,"match",{value:_s(s.syntax,i)}),s.match}}),n==="Property"&&Object.defineProperty(s,"matchRef",{get(){let a=s.syntax,u=uP(a)?_s({...a,terms:[a.terms[0].term]},i):null;return Object.defineProperty(s,"matchRef",{value:u}),u}})),s}addAtrule_(t,n){n&&(this.atrules[t]={type:"Atrule",name:t,prelude:n.prelude?this.createDescriptor(n.prelude,"AtrulePrelude",t):null,descriptors:n.descriptors?Object.keys(n.descriptors).reduce((r,o)=>(r[o]=this.createDescriptor(n.descriptors[o],"AtruleDescriptor",o,t),r),Object.create(null)):null})}addProperty_(t,n){n&&(this.properties[t]=this.createDescriptor(n,"Property",t))}addType_(t,n){n&&(this.types[t]=this.createDescriptor(n,"Type",t))}checkAtruleName(t){if(!this.getAtrule(t))return new Pi("Unknown at-rule","@"+t)}checkAtrulePrelude(t,n){let r=this.checkAtruleName(t);if(r)return r;let o=this.getAtrule(t);if(!o.prelude&&n)return new SyntaxError("At-rule `@"+t+"` should not contain a prelude");if(o.prelude&&!n&&!zi(this,o.prelude,"",!1).matched)return new SyntaxError("At-rule `@"+t+"` should contain a prelude")}checkAtruleDescriptorName(t,n){let r=this.checkAtruleName(t);if(r)return r;let o=this.getAtrule(t),i=Pl(n);if(!o.descriptors)return new SyntaxError("At-rule `@"+t+"` has no known descriptors");if(!o.descriptors[i.name]&&!o.descriptors[i.basename])return new Pi("Unknown at-rule descriptor",n)}checkPropertyName(t){if(!this.getProperty(t))return new Pi("Unknown property",t)}matchAtrulePrelude(t,n){let r=this.checkAtrulePrelude(t,n);if(r)return Fr(null,r);let o=this.getAtrule(t);return o.prelude?zi(this,o.prelude,n||"",!1):Fr(null,null)}matchAtruleDescriptor(t,n,r){let o=this.checkAtruleDescriptorName(t,n);if(o)return Fr(null,o);let i=this.getAtrule(t),s=Pl(n);return zi(this,i.descriptors[s.name]||i.descriptors[s.basename],r,!1)}matchDeclaration(t){return t.type!=="Declaration"?Fr(null,new Error("Not a Declaration node")):this.matchProperty(t.property,t.value)}matchProperty(t,n){if(ap(t).custom)return Fr(null,new Error("Lexer matching doesn't applicable for custom properties"));let r=this.checkPropertyName(t);return r?Fr(null,r):zi(this,this.getProperty(t),n,!0)}matchType(t,n){let r=this.getType(t);return r?zi(this,r,n,!1):Fr(null,new Pi("Unknown type",t))}match(t,n){return typeof t!="string"&&(!t||!t.type)?Fr(null,new Pi("Bad syntax")):((typeof t=="string"||!t.match)&&(t=this.createDescriptor(t,"Type","anonymous")),zi(this,t,n,!1))}findValueFragments(t,n,r,o){return Np(this,n,this.matchProperty(t,n),r,o)}findDeclarationValueFragments(t,n,r){return Np(this,t.value,this.matchDeclaration(t),n,r)}findAllFragments(t,n,r){let o=[];return this.syntax.walk(t,{visit:"Declaration",enter:i=>{o.push.apply(o,this.findDeclarationValueFragments(i,n,r))}}),o}getAtrule(t,n=!0){let r=Pl(t);return(r.vendor&&n?this.atrules[r.name]||this.atrules[r.basename]:this.atrules[r.name])||null}getAtrulePrelude(t,n=!0){let r=this.getAtrule(t,n);return r&&r.prelude||null}getAtruleDescriptor(t,n){return this.atrules.hasOwnProperty(t)&&this.atrules.declarators&&this.atrules[t].declarators[n]||null}getProperty(t,n=!0){let r=ap(t);return(r.vendor&&n?this.properties[r.name]||this.properties[r.basename]:this.properties[r.name])||null}getType(t){return hasOwnProperty.call(this.types,t)?this.types[t]:null}validate(){function t(u,c){return c?`<${u}>`:`<'${u}'>`}function n(u,c,l,d){if(l.has(c))return l.get(c);l.set(c,!1),d.syntax!==null&&Ep(d.syntax,function(g){if(g.type!=="Type"&&g.type!=="Property")return;let p=g.type==="Type"?u.types:u.properties,h=g.type==="Type"?o:i;hasOwnProperty.call(p,g.name)?n(u,g.name,h,p[g.name])&&(r.push(`${t(c,l===o)} used broken syntax definition ${t(g.name,g.type==="Type")}`),l.set(c,!0)):(r.push(`${t(c,l===o)} used missed syntax definition ${t(g.name,g.type==="Type")}`),l.set(c,!0))},this)}let r=[],o=new Map,i=new Map;for(let u in this.types)n(this,u,o,this.types[u]);for(let u in this.properties)n(this,u,i,this.properties[u]);let s=[...o.keys()].filter(u=>o.get(u)),a=[...i.keys()].filter(u=>i.get(u));return s.length||a.length?{errors:r,types:s,properties:a}:null}dump(t,n){return{generic:this.generic,cssWideKeywords:this.cssWideKeywords,units:this.units,types:_p(this.types,!n,t),properties:_p(this.properties,!n,t),atrules:lP(this.atrules,!n,t)}}toString(){return JSON.stringify(this.dump())}}});function $p(e,t){return typeof t=="string"&&/^\s*\|/.test(t)?typeof e=="string"?e+t:t.replace(/^\s*\|\s*/,""):t||null}function pP(e,t){let n=Object.create(null);for(let r of Object.keys(e))t.includes(r)&&(n[r]=e[r]);return n}function Up(e,t,n){let r={...e};for(let[o,i]of Object.entries(t))r[o]={...r[o],...n?pP(i,n):i};return r}function js(e,t){let n={...e};for(let[r,o]of Object.entries(t))switch(r){case"generic":n[r]=!!o;break;case"cssWideKeywords":n[r]=e[r]?[...e[r],...o]:o||[];break;case"units":n[r]={...e[r]};for(let[i,s]of Object.entries(o))n[r][i]=Array.isArray(s)?s:[];break;case"atrules":n[r]={...e[r]};for(let[i,s]of Object.entries(o)){let a=n[r][i]||{},u=n[r][i]={prelude:a.prelude||null,descriptors:{...a.descriptors}};if(s){u.prelude=s.prelude?$p(u.prelude,s.prelude):u.prelude||null;for(let[c,l]of Object.entries(s.descriptors||{}))u.descriptors[c]=l?$p(u.descriptors[c],l):null;Object.keys(u.descriptors).length||(u.descriptors=null)}}break;case"types":case"properties":n[r]={...e[r]};for(let[i,s]of Object.entries(o))n[r][i]=$p(n[r][i],s);break;case"parseContext":n[r]={...e[r],...o};break;case"scope":case"features":n[r]=Up(e[r],o);break;case"atrule":case"pseudo":n[r]=Up(e[r],o,["parse"]);break;case"node":n[r]=Up(e[r],o,["name","structure","parse","generate","walkContext"]);break}return n}var $0=$(()=>{"use strict"});function U0(e){let t=nb(e),n=Ob(e),r=Pb(e),{fromPlainObject:o,toPlainObject:i}=Mb(n),s={lexer:null,createLexer:a=>new Us(a,s,s.lexer.structure),tokenize:Fo,parse:t,generate:r,walk:n,find:n.find,findLast:n.findLast,findAll:n.findAll,fromPlainObject:o,toPlainObject:i,fork(a){let u=js({},e);return U0(typeof a=="function"?a(u):js(u,a))}};return s.lexer=new Us({generic:e.generic,cssWideKeywords:e.cssWideKeywords,units:e.units,types:e.types,atrules:e.atrules,properties:e.properties,node:e.node},s),s}var j0,H0=$(()=>{"use strict";lr();rb();Lb();Bb();_b();_0();$0();j0=e=>U0(js({},e))});var W0,V0=$(()=>{"use strict";W0={generic:!0,cssWideKeywords:["initial","inherit","unset","revert","revert-layer"],units:{angle:["deg","grad","rad","turn"],decibel:["db"],flex:["fr"],frequency:["hz","khz"],length:["cm","mm","q","in","pt","pc","px","em","rem","ex","rex","cap","rcap","ch","rch","ic","ric","lh","rlh","vw","svw","lvw","dvw","vh","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax","cqw","cqh","cqi","cqb","cqmin","cqmax"],resolution:["dpi","dpcm","dppx","x"],semitones:["st"],time:["s","ms"]},types:{"abs()":"abs( <calc-sum> )","absolute-size":"xx-small|x-small|small|medium|large|x-large|xx-large|xxx-large","acos()":"acos( <calc-sum> )","alpha-value":"<number>|<percentage>","an+b":"odd|even|<integer>|<n-dimension>|'+'? \u2020 n|-n|<ndashdigit-dimension>|'+'? \u2020 <ndashdigit-ident>|<dashndashdigit-ident>|<n-dimension> <signed-integer>|'+'? \u2020 n <signed-integer>|-n <signed-integer>|<ndash-dimension> <signless-integer>|'+'? \u2020 n- <signless-integer>|-n- <signless-integer>|<n-dimension> ['+'|'-'] <signless-integer>|'+'? \u2020 n ['+'|'-'] <signless-integer>|-n ['+'|'-'] <signless-integer>","anchor()":"anchor( <anchor-name>?&&<anchor-side> , <length-percentage>? )","anchor-name":"<dashed-ident>","anchor-side":"inside|outside|top|left|right|bottom|start|end|self-start|self-end|<percentage>|center","anchor-size":"width|height|block|inline|self-block|self-inline","anchor-size()":"anchor-size( [<anchor-name>||<anchor-size>]? , <length-percentage>? )","angle-percentage":"<angle>|<percentage>","angular-color-hint":"<angle-percentage>|<zero>","angular-color-stop":"<color> <color-stop-angle>?","angular-color-stop-list":"<angular-color-stop> , [<angular-color-hint>? , <angular-color-stop>]#?","animateable-feature":"scroll-position|contents|<custom-ident>","animation-action":"none|play|play-once|play-forwards|play-backwards|pause|reset|replay","asin()":"asin( <calc-sum> )","atan()":"atan( <calc-sum> )","atan2()":"atan2( <calc-sum> , <calc-sum> )",attachment:"scroll|fixed|local","attr()":"attr( <attr-name> <attr-type>? , <declaration-value>? )","attr-matcher":"['~'|'|'|'^'|'$'|'*']? '='","attr-modifier":"i|s","attr-type":"type( <syntax> )|raw-string|number|<attr-unit>","attribute-selector":"'[' <wq-name> ']'|'[' <wq-name> <attr-matcher> [<string-token>|<ident-token>] <attr-modifier>? ']'","auto-repeat":"repeat( [auto-fill|auto-fit] , [<line-names>? <fixed-size>]+ <line-names>? )","auto-track-list":"[<line-names>? [<fixed-size>|<fixed-repeat>]]* <line-names>? <auto-repeat> [<line-names>? [<fixed-size>|<fixed-repeat>]]* <line-names>?",axis:"block|inline|x|y","baseline-position":"[first|last]? baseline","basic-shape":"<inset()>|<xywh()>|<rect()>|<circle()>|<ellipse()>|<polygon()>|<path()>","basic-shape-rect":"<inset()>|<rect()>|<xywh()>","bg-clip":"<visual-box>|border-area|text","bg-image":"<image>|none","bg-layer":"<bg-image>||<bg-position> [/ <bg-size>]?||<repeat-style>||<attachment>||<visual-box>||<visual-box>","bg-position":"[[left|center|right|top|bottom|<length-percentage>]|[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]|[center|[left|right] <length-percentage>?]&&[center|[top|bottom] <length-percentage>?]]","bg-size":"[<length-percentage [0,\u221E]>|auto]{1,2}|cover|contain","blend-mode":"normal|multiply|screen|overlay|darken|lighten|color-dodge|color-burn|hard-light|soft-light|difference|exclusion|hue|saturation|color|luminosity","blur()":"blur( <length>? )","brightness()":"brightness( [<number>|<percentage>]? )","calc()":"calc( <calc-sum> )","calc-constant":"e|pi|infinity|-infinity|NaN","calc-product":"<calc-value> ['*' <calc-value>|'/' <number>]*","calc-size()":"calc-size( <calc-size-basis> , <calc-sum> )","calc-size-basis":"<intrinsic-size-keyword>|<calc-size()>|any|<calc-sum>","calc-sum":"<calc-product> [['+'|'-'] <calc-product>]*","calc-value":"<number>|<dimension>|<percentage>|<calc-constant>|( <calc-sum> )","cf-final-image":"<image>|<color>","cf-mixing-image":"<percentage>?&&<image>","circle()":"circle( <radial-size>? [at <position>]? )","clamp()":"clamp( <calc-sum>#{3} )","class-selector":"'.' <ident-token>","clip-source":"<url>",color:"<color-base>|currentColor|<system-color>|<device-cmyk()>|<light-dark()>|<-non-standard-color>","color()":"color( <colorspace-params> [/ [<alpha-value>|none]]? )","color-base":"<hex-color>|<color-function>|<named-color>|<color-mix()>|transparent","color-function":"<rgb()>|<rgba()>|<hsl()>|<hsla()>|<hwb()>|<lab()>|<lch()>|<oklab()>|<oklch()>|<color()>","color-interpolation-method":"in [<rectangular-color-space>|<polar-color-space> <hue-interpolation-method>?|<custom-color-space>]","color-mix()":"color-mix( <color-interpolation-method> , [<color>&&<percentage [0,100]>?]#{2} )","color-stop":"<color-stop-length>|<color-stop-angle>","color-stop-angle":"[<angle-percentage>|<zero>]{1,2}","color-stop-length":"<length-percentage>{1,2}","color-stop-list":"<linear-color-stop> , [<linear-color-hint>? , <linear-color-stop>]#?","colorspace-params":"[<predefined-rgb-params>|<xyz-params>]",combinator:"'>'|'+'|'~'|['|' '|']","common-lig-values":"[common-ligatures|no-common-ligatures]","compat-auto":"searchfield|textarea|checkbox|radio|menulist|listbox|meter|progress-bar|button","compat-special":"textfield|menulist-button","complex-selector":"<complex-selector-unit> [<combinator>? <complex-selector-unit>]*","complex-selector-list":"<complex-selector>#","composite-style":"clear|copy|source-over|source-in|source-out|source-atop|destination-over|destination-in|destination-out|destination-atop|xor","compositing-operator":"add|subtract|intersect|exclude","compound-selector":"[<type-selector>? <subclass-selector>*]!","compound-selector-list":"<compound-selector>#","conic-gradient()":"conic-gradient( [<conic-gradient-syntax>] )","conic-gradient-syntax":"[[[from [<angle>|<zero>]]? [at <position>]?]||<color-interpolation-method>]? , <angular-color-stop-list>","container-condition":"not <query-in-parens>|<query-in-parens> [[and <query-in-parens>]*|[or <query-in-parens>]*]","container-name":"<custom-ident>","container-query":"not <query-in-parens>|<query-in-parens> [[and <query-in-parens>]*|[or <query-in-parens>]*]","content-distribution":"space-between|space-around|space-evenly|stretch","content-list":"[<string>|contents|<image>|<counter>|<quote>|<target>|<leader()>|<attr()>]+","content-position":"center|start|end|flex-start|flex-end","content-replacement":"<image>","contextual-alt-values":"[contextual|no-contextual]","contrast()":"contrast( [<number>|<percentage>]? )","coord-box":"content-box|padding-box|border-box|fill-box|stroke-box|view-box","corner-shape-value":"round|scoop|bevel|notch|square|squircle|<superellipse()>","cos()":"cos( <calc-sum> )",counter:"<counter()>|<counters()>","counter()":"counter( <counter-name> , <counter-style>? )","counter-name":"<custom-ident>","counter-style":"<counter-style-name>|symbols( )","counter-style-name":"<custom-ident>","counters()":"counters( <counter-name> , <string> , <counter-style>? )","cross-fade()":"cross-fade( <cf-mixing-image> , <cf-final-image>? )","cubic-bezier()":"cubic-bezier( [<number [0,1]> , <number>]#{2} )","cubic-bezier-easing-function":"ease|ease-in|ease-out|ease-in-out|cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )","cursor-predefined":"auto|default|none|context-menu|help|pointer|progress|wait|cell|crosshair|text|vertical-text|alias|copy|move|no-drop|not-allowed|e-resize|n-resize|ne-resize|nw-resize|s-resize|se-resize|sw-resize|w-resize|ew-resize|ns-resize|nesw-resize|nwse-resize|col-resize|row-resize|all-scroll|zoom-in|zoom-out|grab|grabbing","custom-color-space":"<dashed-ident>","custom-params":"<dashed-ident> [<number>|<percentage>|none]+",dasharray:"[[<length-percentage>|<number>]+]#","dashndashdigit-ident":"<ident-token>","deprecated-system-color":"ActiveBorder|ActiveCaption|AppWorkspace|Background|ButtonHighlight|ButtonShadow|CaptionText|InactiveBorder|InactiveCaption|InactiveCaptionText|InfoBackground|InfoText|Menu|MenuText|Scrollbar|ThreeDDarkShadow|ThreeDFace|ThreeDHighlight|ThreeDLightShadow|ThreeDShadow|Window|WindowFrame|WindowText","discretionary-lig-values":"[discretionary-ligatures|no-discretionary-ligatures]","display-box":"contents|none","display-inside":"flow|flow-root|table|flex|grid|ruby","display-internal":"table-row-group|table-header-group|table-footer-group|table-row|table-cell|table-column-group|table-column|table-caption|ruby-base|ruby-text|ruby-base-container|ruby-text-container","display-legacy":"inline-block|inline-list-item|inline-table|inline-flex|inline-grid","display-listitem":"<display-outside>?&&[flow|flow-root]?&&list-item","display-outside":"block|inline|run-in","drop-shadow()":"drop-shadow( [<color>?&&<length>{2,3}] )","dynamic-range-limit-mix()":"dynamic-range-limit-mix( [<'dynamic-range-limit'>&&<percentage [0,100]>]#{2,} )","easing-function":"<linear-easing-function>|<cubic-bezier-easing-function>|<step-easing-function>","east-asian-variant-values":"[jis78|jis83|jis90|jis04|simplified|traditional]","east-asian-width-values":"[full-width|proportional-width]","element()":"element( <custom-ident> , [first|start|last|first-except]? )|element( <id-selector> )","ellipse()":"ellipse( <radial-size>? [at <position>]? )","env()":"env( <custom-ident> , <declaration-value>? )","exp()":"exp( <calc-sum> )","explicit-track-list":"[<line-names>? <track-size>]+ <line-names>?","family-name":"<string>|<custom-ident>+","feature-tag-value":"<string> [<integer>|on|off]?","feature-type":"@stylistic|@historical-forms|@styleset|@character-variant|@swash|@ornaments|@annotation","feature-value-block":"<feature-type> '{' <feature-value-declaration-list> '}'","feature-value-block-list":"<feature-value-block>+","feature-value-declaration":"<custom-ident> : <integer>+ ;","feature-value-declaration-list":"<feature-value-declaration>","feature-value-name":"<custom-ident>","filter-function":"<blur()>|<brightness()>|<contrast()>|<drop-shadow()>|<grayscale()>|<hue-rotate()>|<invert()>|<opacity()>|<saturate()>|<sepia()>","filter-value-list":"[<filter-function>|<url>]+","final-bg-layer":"<bg-image>||<bg-position> [/ <bg-size>]?||<repeat-style>||<attachment>||<visual-box>||<visual-box>||<'background-color'>","fit-content()":"fit-content( <length-percentage [0,\u221E]> )","fixed-breadth":"<length-percentage>","fixed-repeat":"repeat( [<integer [1,\u221E]>] , [<line-names>? <fixed-size>]+ <line-names>? )","fixed-size":"<fixed-breadth>|minmax( <fixed-breadth> , <track-breadth> )|minmax( <inflexible-breadth> , <fixed-breadth> )","font-stretch-absolute":"normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded|<percentage>","font-variant-css2":"normal|small-caps","font-weight-absolute":"normal|bold|<number [1,1000]>","font-width-css3":"normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded","form-control-identifier":"select","frequency-percentage":"<frequency>|<percentage>","generic-complete":"serif|sans-serif|system-ui|cursive|fantasy|math|monospace","general-enclosed":"[<function-token> <any-value>? )]|[( <any-value>? )]","generic-family":"<generic-script-specific>|<generic-complete>|<generic-incomplete>|<-non-standard-generic-family>","generic-incomplete":"ui-serif|ui-sans-serif|ui-monospace|ui-rounded","geometry-box":"<shape-box>|fill-box|stroke-box|view-box",gradient:"<linear-gradient()>|<repeating-linear-gradient()>|<radial-gradient()>|<repeating-radial-gradient()>|<conic-gradient()>|<repeating-conic-gradient()>|<-legacy-gradient>","grayscale()":"grayscale( [<number>|<percentage>]? )","grid-line":"auto|<custom-ident>|[<integer>&&<custom-ident>?]|[span&&[<integer>||<custom-ident>]]","historical-lig-values":"[historical-ligatures|no-historical-ligatures]","hsl()":"hsl( <hue> , <percentage> , <percentage> , <alpha-value>? )|hsl( [<hue>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )","hsla()":"hsla( <hue> , <percentage> , <percentage> , <alpha-value>? )|hsla( [<hue>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )",hue:"<number>|<angle>","hue-interpolation-method":"[shorter|longer|increasing|decreasing] hue","hue-rotate()":"hue-rotate( [<angle>|<zero>]? )","hwb()":"hwb( [<hue>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )","hypot()":"hypot( <calc-sum># )",image:"<url>|<image()>|<image-set()>|<element()>|<paint()>|<cross-fade()>|<gradient>","image()":"image( <image-tags>? [<image-src>? , <color>?]! )","image-set()":"image-set( <image-set-option># )","image-set-option":"[<image>|<string>] [<resolution>||type( <string> )]","image-src":"<url>|<string>","image-tags":"ltr|rtl","inflexible-breadth":"<length-percentage>|min-content|max-content|auto","inset()":"inset( <length-percentage>{1,4} [round <'border-radius'>]? )","invert()":"invert( [<number>|<percentage>]? )","keyframe-block":"<keyframe-selector># { <declaration-list> }","keyframe-selector":"from|to|<percentage [0,100]>|<timeline-range-name> <percentage>","keyframes-name":"<custom-ident>|<string>","lab()":"lab( [<percentage>|<number>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )","layer()":"layer( <layer-name> )","layer-name":"<ident> ['.' <ident>]*","lch()":"lch( [<percentage>|<number>|none] [<percentage>|<number>|none] [<hue>|none] [/ [<alpha-value>|none]]? )","leader()":"leader( <leader-type> )","leader-type":"dotted|solid|space|<string>","length-percentage":"<length>|<percentage>","light-dark()":"light-dark( <color> , <color> )","line-name-list":"[<line-names>|<name-repeat>]+","line-names":"'[' <custom-ident>* ']'","line-style":"none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset","line-width":"<length>|thin|medium|thick","linear()":"linear( [<number>&&<percentage>{0,2}]# )","linear-color-hint":"<length-percentage>","linear-color-stop":"<color> <color-stop-length>?","linear-easing-function":"linear|<linear()>","linear-gradient()":"linear-gradient( [<linear-gradient-syntax>] )","linear-gradient-syntax":"[[<angle>|<zero>|to <side-or-corner>]||<color-interpolation-method>]? , <color-stop-list>","log()":"log( <calc-sum> , <calc-sum>? )","mask-layer":"<mask-reference>||<position> [/ <bg-size>]?||<repeat-style>||<geometry-box>||[<geometry-box>|no-clip]||<compositing-operator>||<masking-mode>","mask-position":"[<length-percentage>|left|center|right] [<length-percentage>|top|center|bottom]?","mask-reference":"none|<image>|<mask-source>","mask-source":"<url>","masking-mode":"alpha|luminance|match-source","matrix()":"matrix( <number>#{6} )","matrix3d()":"matrix3d( <number>#{16} )","max()":"max( <calc-sum># )","media-and":"<media-in-parens> [and <media-in-parens>]+","media-condition":"<media-not>|<media-and>|<media-or>|<media-in-parens>","media-condition-without-or":"<media-not>|<media-and>|<media-in-parens>","media-feature":"( [<mf-plain>|<mf-boolean>|<mf-range>] )","media-in-parens":"( <media-condition> )|<media-feature>|<general-enclosed>","media-not":"not <media-in-parens>","media-or":"<media-in-parens> [or <media-in-parens>]+","media-query":"<media-condition>|[not|only]? <media-type> [and <media-condition-without-or>]?","media-query-list":"<media-query>#","media-type":"<ident>","mf-boolean":"<mf-name>","mf-name":"<ident>","mf-plain":"<mf-name> : <mf-value>","mf-range":"<mf-name> ['<'|'>']? '='? <mf-value>|<mf-value> ['<'|'>']? '='? <mf-name>|<mf-value> '<' '='? <mf-name> '<' '='? <mf-value>|<mf-value> '>' '='? <mf-name> '>' '='? <mf-value>","mf-value":"<number>|<dimension>|<ident>|<ratio>","min()":"min( <calc-sum># )","minmax()":"minmax( [<length-percentage>|min-content|max-content|auto] , [<length-percentage>|<flex>|min-content|max-content|auto] )","mod()":"mod( <calc-sum> , <calc-sum> )","n-dimension":"<dimension-token>","name-repeat":"repeat( [<integer [1,\u221E]>|auto-fill] , <line-names>+ )","named-color":"aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen","namespace-prefix":"<ident>","ndash-dimension":"<dimension-token>","ndashdigit-dimension":"<dimension-token>","ndashdigit-ident":"<ident-token>","ns-prefix":"[<ident-token>|'*']? '|'","number-percentage":"<number>|<percentage>","numeric-figure-values":"[lining-nums|oldstyle-nums]","numeric-fraction-values":"[diagonal-fractions|stacked-fractions]","numeric-spacing-values":"[proportional-nums|tabular-nums]","offset-path":"<ray()>|<url>|<basic-shape>","oklab()":"oklab( [<percentage>|<number>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )","oklch()":"oklch( [<percentage>|<number>|none] [<percentage>|<number>|none] [<hue>|none] [/ [<alpha-value>|none]]? )","opacity()":"opacity( [<number>|<percentage>]? )","opacity-value":"<number>|<percentage>","outline-line-style":"none|dotted|dashed|solid|double|groove|ridge|inset|outset","outline-radius":"<length>|<percentage>","overflow-position":"unsafe|safe","page-body":"<declaration>? [; <page-body>]?|<page-margin-box> <page-body>","page-margin-box":"<page-margin-box-type> '{' <declaration-list> '}'","page-margin-box-type":"@top-left-corner|@top-left|@top-center|@top-right|@top-right-corner|@bottom-left-corner|@bottom-left|@bottom-center|@bottom-right|@bottom-right-corner|@left-top|@left-middle|@left-bottom|@right-top|@right-middle|@right-bottom","page-selector":"<pseudo-page>+|<ident> <pseudo-page>*","page-selector-list":"[<page-selector>#]?","page-size":"A5|A4|A3|B5|B4|JIS-B5|JIS-B4|letter|legal|ledger",paint:"none|<color>|<url> [none|<color>]?|context-fill|context-stroke","paint()":"paint( <ident> , <declaration-value>? )","paint-box":"<visual-box>|fill-box|stroke-box","palette-identifier":"<dashed-ident>","palette-mix()":"palette-mix( <color-interpolation-method> , [[normal|light|dark|<palette-identifier>|<palette-mix()>]&&<percentage [0,100]>?]#{2} )","path()":"path( <'fill-rule'>? , <string> )","perspective()":"perspective( [<length [0,\u221E]>|none] )","polar-color-space":"hsl|hwb|lch|oklch","polygon()":"polygon( <'fill-rule'>? , [<length-percentage> <length-percentage>]# )",position:"[[left|center|right]||[top|center|bottom]|[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]?|[[left|right] <length-percentage>]&&[[top|bottom] <length-percentage>]]","position-area":"[[left|center|right|span-left|span-right|x-start|x-end|span-x-start|span-x-end|x-self-start|x-self-end|span-x-self-start|span-x-self-end|span-all]||[top|center|bottom|span-top|span-bottom|y-start|y-end|span-y-start|span-y-end|y-self-start|y-self-end|span-y-self-start|span-y-self-end|span-all]|[block-start|center|block-end|span-block-start|span-block-end|span-all]||[inline-start|center|inline-end|span-inline-start|span-inline-end|span-all]|[self-block-start|center|self-block-end|span-self-block-start|span-self-block-end|span-all]||[self-inline-start|center|self-inline-end|span-self-inline-start|span-self-inline-end|span-all]|[start|center|end|span-start|span-end|span-all]{1,2}|[self-start|center|self-end|span-self-start|span-self-end|span-all]{1,2}]","pow()":"pow( <calc-sum> , <calc-sum> )","predefined-rgb":"srgb|srgb-linear|display-p3|display-p3-linear|a98-rgb|prophoto-rgb|rec2020","predefined-rgb-params":"<predefined-rgb> [<number>|<percentage>|none]{3}","pseudo-class-selector":"':' <ident-token>|':' <function-token> <any-value> ')'","pseudo-element-selector":"':' <pseudo-class-selector>|<legacy-pseudo-element-selector>","pseudo-page":": [left|right|first|blank]","query-in-parens":"( <container-condition> )|( <size-feature> )|style( <style-query> )|<general-enclosed>",quote:"open-quote|close-quote|no-open-quote|no-close-quote","radial-extent":"closest-corner|closest-side|farthest-corner|farthest-side","radial-gradient()":"radial-gradient( [<radial-gradient-syntax>] )","radial-gradient-syntax":"[[[<radial-shape>||<radial-size>]? [at <position>]?]||<color-interpolation-method>]? , <color-stop-list>","radial-shape":"circle|ellipse","radial-size":"<radial-extent>|<length [0,\u221E]>|<length-percentage [0,\u221E]>{2}",ratio:"<number [0,\u221E]> [/ <number [0,\u221E]>]?","ray()":"ray( <angle>&&<ray-size>?&&contain?&&[at <position>]? )","ray-size":"closest-side|closest-corner|farthest-side|farthest-corner|sides","rect()":"rect( [<length-percentage>|auto]{4} [round <'border-radius'>]? )","rectangular-color-space":"srgb|srgb-linear|display-p3|display-p3-linear|a98-rgb|prophoto-rgb|rec2020|lab|oklab|xyz|xyz-d50|xyz-d65","relative-selector":"<combinator>? <complex-selector>","relative-selector-list":"<relative-selector>#","relative-size":"larger|smaller","rem()":"rem( <calc-sum> , <calc-sum> )","repeat-style":"repeat-x|repeat-y|[repeat|space|round|no-repeat]{1,2}","repeating-conic-gradient()":"repeating-conic-gradient( [<conic-gradient-syntax>] )","repeating-linear-gradient()":"repeating-linear-gradient( [<linear-gradient-syntax>] )","repeating-radial-gradient()":"repeating-radial-gradient( [<radial-gradient-syntax>] )","reversed-counter-name":"reversed( <counter-name> )","rgb()":"rgb( <percentage>#{3} , <alpha-value>? )|rgb( <number>#{3} , <alpha-value>? )|rgb( [<number>|<percentage>|none]{3} [/ [<alpha-value>|none]]? )","rgba()":"rgba( <percentage>#{3} , <alpha-value>? )|rgba( <number>#{3} , <alpha-value>? )|rgba( [<number>|<percentage>|none]{3} [/ [<alpha-value>|none]]? )","rotate()":"rotate( [<angle>|<zero>] )","rotate3d()":"rotate3d( <number> , <number> , <number> , [<angle>|<zero>] )","rotateX()":"rotateX( [<angle>|<zero>] )","rotateY()":"rotateY( [<angle>|<zero>] )","rotateZ()":"rotateZ( [<angle>|<zero>] )","round()":"round( <rounding-strategy>? , <calc-sum> , <calc-sum> )","rounding-strategy":"nearest|up|down|to-zero","saturate()":"saturate( [<number>|<percentage>]? )","scale()":"scale( [<number>|<percentage>]#{1,2} )","scale3d()":"scale3d( [<number>|<percentage>]#{3} )","scaleX()":"scaleX( [<number>|<percentage>] )","scaleY()":"scaleY( [<number>|<percentage>] )","scaleZ()":"scaleZ( [<number>|<percentage>] )","scope-end":"<forgiving-selector-list>","scope-start":"<forgiving-selector-list>","scroll()":"scroll( [<scroller>||<axis>]? )",scroller:"root|nearest|self","scroll-state-feature":"<media-query-list>","scroll-state-in-parens":"( <scroll-state-query> )|( <scroll-state-feature> )|<general-enclosed>","scroll-state-query":"not <scroll-state-in-parens>|<scroll-state-in-parens> [[and <scroll-state-in-parens>]*|[or <scroll-state-in-parens>]*]|<scroll-state-feature>","selector-list":"<complex-selector-list>","self-position":"center|start|end|self-start|self-end|flex-start|flex-end","sepia()":"sepia( [<number>|<percentage>]? )",shadow:"inset?&&<length>{2,4}&&<color>?","shadow-t":"[<length>{2,3}&&<color>?]",shape:"rect( <top> , <right> , <bottom> , <left> )|rect( <top> <right> <bottom> <left> )","shape-box":"<visual-box>|margin-box","side-or-corner":"[left|right]||[top|bottom]","sign()":"sign( <calc-sum> )","signed-integer":"<number-token>","signless-integer":"<number-token>","sin()":"sin( <calc-sum> )","single-animation":"<'animation-duration'>||<easing-function>||<'animation-delay'>||<single-animation-iteration-count>||<single-animation-direction>||<single-animation-fill-mode>||<single-animation-play-state>||[none|<keyframes-name>]||<single-animation-timeline>","single-animation-composition":"replace|add|accumulate","single-animation-direction":"normal|reverse|alternate|alternate-reverse","single-animation-fill-mode":"none|forwards|backwards|both","single-animation-iteration-count":"infinite|<number>","single-animation-play-state":"running|paused","single-animation-timeline":"auto|none|<dashed-ident>|<scroll()>|<view()>","single-transition":"[none|<single-transition-property>]||<time>||<easing-function>||<time>||<transition-behavior-value>","single-transition-property":"all|<custom-ident>",size:"closest-side|farthest-side|closest-corner|farthest-corner|<length>|<length-percentage>{2}","size-feature":"<mf-plain>|<mf-boolean>|<mf-range>","skew()":"skew( [<angle>|<zero>] , [<angle>|<zero>]? )","skewX()":"skewX( [<angle>|<zero>] )","skewY()":"skewY( [<angle>|<zero>] )","sqrt()":"sqrt( <calc-sum> )","step-position":"jump-start|jump-end|jump-none|jump-both|start|end","step-easing-function":"step-start|step-end|<steps()>","steps()":"steps( <integer> , <step-position>? )","style-feature":"<declaration>","style-in-parens":"( <style-condition> )|( <style-feature> )|<general-enclosed>","style-query":"<style-condition>|<style-feature>","subclass-selector":"<id-selector>|<class-selector>|<attribute-selector>|<pseudo-class-selector>","superellipse()":"superellipse( [<number>|infinity|-infinity] )","supports-condition":"not <supports-in-parens>|<supports-in-parens> [and <supports-in-parens>]*|<supports-in-parens> [or <supports-in-parens>]*","supports-decl":"( <declaration> )","supports-feature":"<supports-decl>|<supports-selector-fn>","supports-in-parens":"( <supports-condition> )|<supports-feature>|<general-enclosed>","supports-selector-fn":"selector( <complex-selector> )",symbol:"<string>|<image>|<custom-ident>","symbols()":"symbols( <symbols-type>? [<string>|<image>]+ )","symbols-type":"cyclic|numeric|alphabetic|symbolic|fixed","system-color":"AccentColor|AccentColorText|ActiveText|ButtonBorder|ButtonFace|ButtonText|Canvas|CanvasText|Field|FieldText|GrayText|Highlight|HighlightText|LinkText|Mark|MarkText|SelectedItem|SelectedItemText|VisitedText","system-family-name":"caption|icon|menu|message-box|small-caption|status-bar","tan()":"tan( <calc-sum> )",target:"<target-counter()>|<target-counters()>|<target-text()>","target-counter()":"target-counter( [<string>|<url>] , <custom-ident> , <counter-style>? )","target-counters()":"target-counters( [<string>|<url>] , <custom-ident> , <string> , <counter-style>? )","target-text()":"target-text( [<string>|<url>] , [content|before|after|first-letter]? )","text-edge":"[text|cap|ex|ideographic|ideographic-ink] [text|alphabetic|ideographic|ideographic-ink]?","time-percentage":"<time>|<percentage>","timeline-range-name":"cover|contain|entry|exit|entry-crossing|exit-crossing","track-breadth":"<length-percentage>|<flex>|min-content|max-content|auto","track-list":"[<line-names>? [<track-size>|<track-repeat>]]+ <line-names>?","track-repeat":"repeat( [<integer [1,\u221E]>] , [<line-names>? <track-size>]+ <line-names>? )","track-size":"<track-breadth>|minmax( <inflexible-breadth> , <track-breadth> )|fit-content( <length-percentage> )","transform-function":"<matrix()>|<translate()>|<translateX()>|<translateY()>|<scale()>|<scaleX()>|<scaleY()>|<rotate()>|<skew()>|<skewX()>|<skewY()>|<matrix3d()>|<translate3d()>|<translateZ()>|<scale3d()>|<scaleZ()>|<rotate3d()>|<rotateX()>|<rotateY()>|<rotateZ()>|<perspective()>","transform-list":"<transform-function>+","transition-behavior-value":"normal|allow-discrete","translate()":"translate( <length-percentage> , <length-percentage>? )","translate3d()":"translate3d( <length-percentage> , <length-percentage> , <length> )","translateX()":"translateX( <length-percentage> )","translateY()":"translateY( <length-percentage> )","translateZ()":"translateZ( <length> )","try-size":"most-width|most-height|most-block-size|most-inline-size","try-tactic":"flip-block||flip-inline||flip-start","type-or-unit":"string|color|url|integer|number|length|angle|time|frequency|cap|ch|em|ex|ic|lh|rlh|rem|vb|vi|vw|vh|vmin|vmax|mm|Q|cm|in|pt|pc|px|deg|grad|rad|turn|ms|s|Hz|kHz|%","type-selector":"<wq-name>|<ns-prefix>? '*'","var()":"var( <custom-property-name> , <declaration-value>? )","view()":"view( [<axis>||<'view-timeline-inset'>]? )","viewport-length":"auto|<length-percentage>","visual-box":"content-box|padding-box|border-box","wq-name":"<ns-prefix>? <ident-token>","xywh()":"xywh( <length-percentage>{2} <length-percentage [0,\u221E]>{2} [round <'border-radius'>]? )",xyz:"xyz|xyz-d50|xyz-d65","xyz-params":"<xyz-space> [<number>|<percentage>|none]{3}","-legacy-gradient":"<-webkit-gradient()>|<-legacy-linear-gradient>|<-legacy-repeating-linear-gradient>|<-legacy-radial-gradient>|<-legacy-repeating-radial-gradient>","-legacy-linear-gradient":"-moz-linear-gradient( <-legacy-linear-gradient-arguments> )|-webkit-linear-gradient( <-legacy-linear-gradient-arguments> )|-o-linear-gradient( <-legacy-linear-gradient-arguments> )","-legacy-repeating-linear-gradient":"-moz-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )|-webkit-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )|-o-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )","-legacy-linear-gradient-arguments":"[<angle>|<side-or-corner>]? , <color-stop-list>","-legacy-radial-gradient":"-moz-radial-gradient( <-legacy-radial-gradient-arguments> )|-webkit-radial-gradient( <-legacy-radial-gradient-arguments> )|-o-radial-gradient( <-legacy-radial-gradient-arguments> )","-legacy-repeating-radial-gradient":"-moz-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )|-webkit-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )|-o-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )","-legacy-radial-gradient-arguments":"[<position> ,]? [[[<-legacy-radial-gradient-shape>||<-legacy-radial-gradient-size>]|[<length>|<percentage>]{2}] ,]? <color-stop-list>","-legacy-radial-gradient-size":"closest-side|closest-corner|farthest-side|farthest-corner|contain|cover","-legacy-radial-gradient-shape":"circle|ellipse","-non-standard-font":"-apple-system-body|-apple-system-headline|-apple-system-subheadline|-apple-system-caption1|-apple-system-caption2|-apple-system-footnote|-apple-system-short-body|-apple-system-short-headline|-apple-system-short-subheadline|-apple-system-short-caption1|-apple-system-short-footnote|-apple-system-tall-body","-non-standard-color":"-moz-ButtonDefault|-moz-ButtonHoverFace|-moz-ButtonHoverText|-moz-CellHighlight|-moz-CellHighlightText|-moz-Combobox|-moz-ComboboxText|-moz-Dialog|-moz-DialogText|-moz-dragtargetzone|-moz-EvenTreeRow|-moz-Field|-moz-FieldText|-moz-html-CellHighlight|-moz-html-CellHighlightText|-moz-mac-accentdarkestshadow|-moz-mac-accentdarkshadow|-moz-mac-accentface|-moz-mac-accentlightesthighlight|-moz-mac-accentlightshadow|-moz-mac-accentregularhighlight|-moz-mac-accentregularshadow|-moz-mac-chrome-active|-moz-mac-chrome-inactive|-moz-mac-focusring|-moz-mac-menuselect|-moz-mac-menushadow|-moz-mac-menutextselect|-moz-MenuHover|-moz-MenuHoverText|-moz-MenuBarText|-moz-MenuBarHoverText|-moz-nativehyperlinktext|-moz-OddTreeRow|-moz-win-communicationstext|-moz-win-mediatext|-moz-activehyperlinktext|-moz-default-background-color|-moz-default-color|-moz-hyperlinktext|-moz-visitedhyperlinktext|-webkit-activelink|-webkit-focus-ring-color|-webkit-link|-webkit-text","-non-standard-image-rendering":"optimize-contrast|-moz-crisp-edges|-o-crisp-edges|-webkit-optimize-contrast","-non-standard-overflow":"overlay|-moz-scrollbars-none|-moz-scrollbars-horizontal|-moz-scrollbars-vertical|-moz-hidden-unscrollable","-non-standard-size":"intrinsic|min-intrinsic|-webkit-fill-available|-webkit-fit-content|-webkit-min-content|-webkit-max-content|-moz-available|-moz-fit-content|-moz-min-content|-moz-max-content","-webkit-gradient()":"-webkit-gradient( <-webkit-gradient-type> , <-webkit-gradient-point> [, <-webkit-gradient-point>|, <-webkit-gradient-radius> , <-webkit-gradient-point>] [, <-webkit-gradient-radius>]? [, <-webkit-gradient-color-stop>]* )","-webkit-gradient-color-stop":"from( <color> )|color-stop( [<number-zero-one>|<percentage>] , <color> )|to( <color> )","-webkit-gradient-point":"[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]","-webkit-gradient-radius":"<length>|<percentage>","-webkit-gradient-type":"linear|radial","-webkit-mask-box-repeat":"repeat|stretch|round","-ms-filter-function-list":"<-ms-filter-function>+","-ms-filter-function":"<-ms-filter-function-progid>|<-ms-filter-function-legacy>","-ms-filter-function-progid":"'progid:' [<ident-token> '.']* [<ident-token>|<function-token> <any-value>? )]","-ms-filter-function-legacy":"<ident-token>|<function-token> <any-value>? )",age:"child|young|old","attr-name":"<wq-name>","attr-fallback":"<any-value>",autospace:"no-autospace|[ideograph-alpha||ideograph-numeric||punctuation]||[insert|replace]",bottom:"<length>|auto","generic-voice":"[<age>? <gender> <integer>?]",gender:"male|female|neutral","generic-script-specific":"generic( kai )|generic( fangsong )|generic( nastaliq )","-non-standard-generic-family":"-apple-system|BlinkMacSystemFont","intrinsic-size-keyword":"min-content|max-content|fit-content",left:"<length>|auto","device-cmyk()":"<legacy-device-cmyk-syntax>|<modern-device-cmyk-syntax>","legacy-device-cmyk-syntax":"device-cmyk( <number>#{4} )","modern-device-cmyk-syntax":"device-cmyk( <cmyk-component>{4} [/ [<alpha-value>|none]]? )","cmyk-component":"<number>|<percentage>|none","color-space":"<rectangular-color-space>|<polar-color-space>|<custom-color-space>",right:"<length>|auto","forgiving-selector-list":"<complex-real-selector-list>","forgiving-relative-selector-list":"<relative-real-selector-list>","complex-real-selector-list":"<complex-real-selector>#","simple-selector-list":"<simple-selector>#","relative-real-selector-list":"<relative-real-selector>#","complex-selector-unit":"[<compound-selector>? <pseudo-compound-selector>*]!","complex-real-selector":"<compound-selector> [<combinator>? <compound-selector>]*","relative-real-selector":"<combinator>? <complex-real-selector>","pseudo-compound-selector":"<pseudo-element-selector> <pseudo-class-selector>*","simple-selector":"<type-selector>|<subclass-selector>","legacy-pseudo-element-selector":"':' [before|after|first-line|first-letter]","svg-length":"<percentage>|<length>|<number>","svg-writing-mode":"lr-tb|rl-tb|tb-rl|lr|rl|tb",top:"<length>|auto",x:"<number>",y:"<number>",declaration:"<ident-token> : <declaration-value>? ['!' important]?","declaration-list":"[<declaration>? ';']* <declaration>?",url:"url( <string> <url-modifier>* )|<url-token>","url-modifier":"<ident>|<function-token> <any-value> )","number-zero-one":"<number [0,1]>","number-one-or-greater":"<number [1,\u221E]>","xyz-space":"xyz|xyz-d50|xyz-d65","style-condition":"not <style-in-parens>|<style-in-parens> [[and <style-in-parens>]*|[or <style-in-parens>]*]","-non-standard-display":"-ms-inline-flexbox|-ms-grid|-ms-inline-grid|-webkit-flex|-webkit-inline-flex|-webkit-box|-webkit-inline-box|-moz-inline-stack|-moz-box|-moz-inline-box","inset-area":"[[left|center|right|span-left|span-right|x-start|x-end|span-x-start|span-x-end|x-self-start|x-self-end|span-x-self-start|span-x-self-end|span-all]||[top|center|bottom|span-top|span-bottom|y-start|y-end|span-y-start|span-y-end|y-self-start|y-self-end|span-y-self-start|span-y-self-end|span-all]|[block-start|center|block-end|span-block-start|span-block-end|span-all]||[inline-start|center|inline-end|span-inline-start|span-inline-end|span-all]|[self-block-start|self-block-end|span-self-block-start|span-self-block-end|span-all]||[self-inline-start|self-inline-end|span-self-inline-start|span-self-inline-end|span-all]|[start|center|end|span-start|span-end|span-all]{1,2}|[self-start|center|self-end|span-self-start|span-self-end|span-all]{1,2}]",syntax:"'*'|<syntax-component> [<syntax-combinator> <syntax-component>]*|<syntax-string>","syntax-component":"<syntax-single-component> <syntax-multiplier>?|'<' transform-list '>'","syntax-single-component":"'<' <syntax-type-name> '>'|<ident>","syntax-type-name":"angle|color|custom-ident|image|integer|length|length-percentage|number|percentage|resolution|string|time|url|transform-function","syntax-combinator":"'|'","syntax-multiplier":"'#'|'+'","syntax-string":"<string>"},properties:{"--*":"<declaration-value>","-ms-accelerator":"false|true","-ms-block-progression":"tb|rl|bt|lr","-ms-content-zoom-chaining":"none|chained","-ms-content-zoom-limit":"<'-ms-content-zoom-limit-min'> <'-ms-content-zoom-limit-max'>","-ms-content-zoom-limit-max":"<percentage>","-ms-content-zoom-limit-min":"<percentage>","-ms-content-zoom-snap":"<'-ms-content-zoom-snap-type'>||<'-ms-content-zoom-snap-points'>","-ms-content-zoom-snap-points":"snapInterval( <percentage> , <percentage> )|snapList( <percentage># )","-ms-content-zoom-snap-type":"none|proximity|mandatory","-ms-content-zooming":"none|zoom","-ms-filter":"<string>","-ms-flow-from":"[none|<custom-ident>]#","-ms-flow-into":"[none|<custom-ident>]#","-ms-grid-columns":"none|<track-list>|<auto-track-list>","-ms-grid-rows":"none|<track-list>|<auto-track-list>","-ms-high-contrast-adjust":"auto|none","-ms-hyphenate-limit-chars":"auto|<integer>{1,3}","-ms-hyphenate-limit-lines":"no-limit|<integer>","-ms-hyphenate-limit-zone":"<percentage>|<length>","-ms-ime-align":"auto|after","-ms-overflow-style":"auto|none|scrollbar|-ms-autohiding-scrollbar","-ms-scroll-chaining":"chained|none","-ms-scroll-limit":"<'-ms-scroll-limit-x-min'> <'-ms-scroll-limit-y-min'> <'-ms-scroll-limit-x-max'> <'-ms-scroll-limit-y-max'>","-ms-scroll-limit-x-max":"auto|<length>","-ms-scroll-limit-x-min":"<length>","-ms-scroll-limit-y-max":"auto|<length>","-ms-scroll-limit-y-min":"<length>","-ms-scroll-rails":"none|railed","-ms-scroll-snap-points-x":"snapInterval( <length-percentage> , <length-percentage> )|snapList( <length-percentage># )","-ms-scroll-snap-points-y":"snapInterval( <length-percentage> , <length-percentage> )|snapList( <length-percentage># )","-ms-scroll-snap-type":"none|proximity|mandatory","-ms-scroll-snap-x":"<'-ms-scroll-snap-type'> <'-ms-scroll-snap-points-x'>","-ms-scroll-snap-y":"<'-ms-scroll-snap-type'> <'-ms-scroll-snap-points-y'>","-ms-scroll-translation":"none|vertical-to-horizontal","-ms-scrollbar-3dlight-color":"<color>","-ms-scrollbar-arrow-color":"<color>","-ms-scrollbar-base-color":"<color>","-ms-scrollbar-darkshadow-color":"<color>","-ms-scrollbar-face-color":"<color>","-ms-scrollbar-highlight-color":"<color>","-ms-scrollbar-shadow-color":"<color>","-ms-scrollbar-track-color":"<color>","-ms-text-autospace":"none|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space","-ms-touch-select":"grippers|none","-ms-user-select":"none|element|text","-ms-wrap-flow":"auto|both|start|end|maximum|clear","-ms-wrap-margin":"<length>","-ms-wrap-through":"wrap|none","-moz-appearance":"none|button|button-arrow-down|button-arrow-next|button-arrow-previous|button-arrow-up|button-bevel|button-focus|caret|checkbox|checkbox-container|checkbox-label|checkmenuitem|dualbutton|groupbox|listbox|listitem|menuarrow|menubar|menucheckbox|menuimage|menuitem|menuitemtext|menulist|menulist-button|menulist-text|menulist-textfield|menupopup|menuradio|menuseparator|meterbar|meterchunk|progressbar|progressbar-vertical|progresschunk|progresschunk-vertical|radio|radio-container|radio-label|radiomenuitem|range|range-thumb|resizer|resizerpanel|scale-horizontal|scalethumbend|scalethumb-horizontal|scalethumbstart|scalethumbtick|scalethumb-vertical|scale-vertical|scrollbarbutton-down|scrollbarbutton-left|scrollbarbutton-right|scrollbarbutton-up|scrollbarthumb-horizontal|scrollbarthumb-vertical|scrollbartrack-horizontal|scrollbartrack-vertical|searchfield|separator|sheet|spinner|spinner-downbutton|spinner-textfield|spinner-upbutton|splitter|statusbar|statusbarpanel|tab|tabpanel|tabpanels|tab-scroll-arrow-back|tab-scroll-arrow-forward|textfield|textfield-multiline|toolbar|toolbarbutton|toolbarbutton-dropdown|toolbargripper|toolbox|tooltip|treeheader|treeheadercell|treeheadersortarrow|treeitem|treeline|treetwisty|treetwistyopen|treeview|-moz-mac-unified-toolbar|-moz-win-borderless-glass|-moz-win-browsertabbar-toolbox|-moz-win-communicationstext|-moz-win-communications-toolbox|-moz-win-exclude-glass|-moz-win-glass|-moz-win-mediatext|-moz-win-media-toolbox|-moz-window-button-box|-moz-window-button-box-maximized|-moz-window-button-close|-moz-window-button-maximize|-moz-window-button-minimize|-moz-window-button-restore|-moz-window-frame-bottom|-moz-window-frame-left|-moz-window-frame-right|-moz-window-titlebar|-moz-window-titlebar-maximized","-moz-binding":"<url>|none","-moz-border-bottom-colors":"<color>+|none","-moz-border-left-colors":"<color>+|none","-moz-border-right-colors":"<color>+|none","-moz-border-top-colors":"<color>+|none","-moz-context-properties":"none|[fill|fill-opacity|stroke|stroke-opacity]#","-moz-float-edge":"border-box|content-box|margin-box|padding-box","-moz-force-broken-image-icon":"0|1","-moz-orient":"inline|block|horizontal|vertical","-moz-outline-radius":"<outline-radius>{1,4} [/ <outline-radius>{1,4}]?","-moz-outline-radius-bottomleft":"<outline-radius>","-moz-outline-radius-bottomright":"<outline-radius>","-moz-outline-radius-topleft":"<outline-radius>","-moz-outline-radius-topright":"<outline-radius>","-moz-stack-sizing":"ignore|stretch-to-fit","-moz-text-blink":"none|blink","-moz-user-focus":"ignore|normal|select-after|select-before|select-menu|select-same|select-all|none","-moz-user-input":"auto|none|enabled|disabled","-moz-user-modify":"read-only|read-write|write-only","-moz-window-dragging":"drag|no-drag","-moz-window-shadow":"default|menu|tooltip|sheet|none","-webkit-appearance":"none|button|button-bevel|caps-lock-indicator|caret|checkbox|default-button|inner-spin-button|listbox|listitem|media-controls-background|media-controls-fullscreen-background|media-current-time-display|media-enter-fullscreen-button|media-exit-fullscreen-button|media-fullscreen-button|media-mute-button|media-overlay-play-button|media-play-button|media-seek-back-button|media-seek-forward-button|media-slider|media-sliderthumb|media-time-remaining-display|media-toggle-closed-captions-button|media-volume-slider|media-volume-slider-container|media-volume-sliderthumb|menulist|menulist-button|menulist-text|menulist-textfield|meter|progress-bar|progress-bar-value|push-button|radio|scrollbarbutton-down|scrollbarbutton-left|scrollbarbutton-right|scrollbarbutton-up|scrollbargripper-horizontal|scrollbargripper-vertical|scrollbarthumb-horizontal|scrollbarthumb-vertical|scrollbartrack-horizontal|scrollbartrack-vertical|searchfield|searchfield-cancel-button|searchfield-decoration|searchfield-results-button|searchfield-results-decoration|slider-horizontal|slider-vertical|sliderthumb-horizontal|sliderthumb-vertical|square-button|textarea|textfield|-apple-pay-button","-webkit-border-before":"<'border-width'>||<'border-style'>||<color>","-webkit-border-before-color":"<color>","-webkit-border-before-style":"<'border-style'>","-webkit-border-before-width":"<'border-width'>","-webkit-box-reflect":"[above|below|right|left]? <length>? <image>?","-webkit-line-clamp":"none|<integer>","-webkit-mask":"[<mask-reference>||<position> [/ <bg-size>]?||<repeat-style>||[<visual-box>|border|padding|content|text]||[<visual-box>|border|padding|content]]#","-webkit-mask-attachment":"<attachment>#","-webkit-mask-clip":"[<coord-box>|no-clip|border|padding|content|text]#","-webkit-mask-composite":"<composite-style>#","-webkit-mask-image":"<mask-reference>#","-webkit-mask-origin":"[<coord-box>|border|padding|content]#","-webkit-mask-position":"<position>#","-webkit-mask-position-x":"[<length-percentage>|left|center|right]#","-webkit-mask-position-y":"[<length-percentage>|top|center|bottom]#","-webkit-mask-repeat":"<repeat-style>#","-webkit-mask-repeat-x":"repeat|no-repeat|space|round","-webkit-mask-repeat-y":"repeat|no-repeat|space|round","-webkit-mask-size":"<bg-size>#","-webkit-overflow-scrolling":"auto|touch","-webkit-tap-highlight-color":"<color>","-webkit-text-fill-color":"<color>","-webkit-text-stroke":"<length>||<color>","-webkit-text-stroke-color":"<color>","-webkit-text-stroke-width":"<length>","-webkit-touch-callout":"default|none","-webkit-user-modify":"read-only|read-write|read-write-plaintext-only","-webkit-user-select":"auto|none|text|all","accent-color":"auto|<color>","align-content":"normal|<baseline-position>|<content-distribution>|<overflow-position>? <content-position>","align-items":"normal|stretch|<baseline-position>|[<overflow-position>? <self-position>]|anchor-center","align-self":"auto|normal|stretch|<baseline-position>|<overflow-position>? <self-position>|anchor-center","align-tracks":"[normal|<baseline-position>|<content-distribution>|<overflow-position>? <content-position>]#","alignment-baseline":"auto|baseline|before-edge|text-before-edge|middle|central|after-edge|text-after-edge|ideographic|alphabetic|hanging|mathematical",all:"initial|inherit|unset|revert|revert-layer","anchor-name":"none|<dashed-ident>#","anchor-scope":"none|all|<dashed-ident>#",animation:"<single-animation>#","animation-composition":"<single-animation-composition>#","animation-delay":"<time>#","animation-direction":"<single-animation-direction>#","animation-duration":"[auto|<time [0s,\u221E]>]#","animation-fill-mode":"<single-animation-fill-mode>#","animation-iteration-count":"<single-animation-iteration-count>#","animation-name":"[none|<keyframes-name>]#","animation-play-state":"<single-animation-play-state>#","animation-range":"[<'animation-range-start'> <'animation-range-end'>?]#","animation-range-end":"[normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#","animation-range-start":"[normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#","animation-timeline":"<single-animation-timeline>#","animation-timing-function":"<easing-function>#","animation-trigger":"[none|[<dashed-ident> <animation-action>+]+]#",appearance:"none|auto|<compat-auto>|<compat-special>","aspect-ratio":"auto||<ratio>","backdrop-filter":"none|<filter-value-list>","backface-visibility":"visible|hidden",background:"<bg-layer>#? , <final-bg-layer>","background-attachment":"<attachment>#","background-blend-mode":"<blend-mode>#","background-clip":"<bg-clip>#","background-color":"<color>","background-image":"<bg-image>#","background-origin":"<visual-box>#","background-position":"<bg-position>#","background-position-x":"[center|[[left|right|x-start|x-end]? <length-percentage>?]!]#","background-position-y":"[center|[[top|bottom|y-start|y-end]? <length-percentage>?]!]#","background-repeat":"<repeat-style>#","background-size":"<bg-size>#","baseline-shift":"baseline|sub|super|<svg-length>","baseline-source":"auto|first|last","block-size":"<'width'>",border:"<line-width>||<line-style>||<color>","border-block":"<'border-block-start'>","border-block-color":"<'border-top-color'>{1,2}","border-block-end":"<'border-top-width'>||<'border-top-style'>||<color>","border-block-end-color":"<'border-top-color'>","border-block-end-style":"<'border-top-style'>","border-block-end-width":"<'border-top-width'>","border-block-start":"<'border-top-width'>||<'border-top-style'>||<color>","border-block-start-color":"<'border-top-color'>","border-block-start-style":"<'border-top-style'>","border-block-start-width":"<'border-top-width'>","border-block-style":"<'border-top-style'>{1,2}","border-block-width":"<'border-top-width'>{1,2}","border-bottom":"<line-width>||<line-style>||<color>","border-bottom-color":"<'border-top-color'>","border-bottom-left-radius":"<length-percentage [0,\u221E]>{1,2}","border-bottom-right-radius":"<length-percentage [0,\u221E]>{1,2}","border-bottom-style":"<line-style>","border-bottom-width":"<line-width>","border-collapse":"separate|collapse","border-color":"<color>{1,4}","border-end-end-radius":"<'border-top-left-radius'>","border-end-start-radius":"<'border-top-left-radius'>","border-image":"<'border-image-source'>||<'border-image-slice'> [/ <'border-image-width'>|/ <'border-image-width'>? / <'border-image-outset'>]?||<'border-image-repeat'>","border-image-outset":"[<length [0,\u221E]>|<number [0,\u221E]>]{1,4}","border-image-repeat":"[stretch|repeat|round|space]{1,2}","border-image-slice":"[<number [0,\u221E]>|<percentage [0,\u221E]>]{1,4}&&fill?","border-image-source":"none|<image>","border-image-width":"[<length-percentage [0,\u221E]>|<number [0,\u221E]>|auto]{1,4}","border-inline":"<'border-block-start'>","border-inline-color":"<'border-top-color'>{1,2}","border-inline-end":"<'border-top-width'>||<'border-top-style'>||<color>","border-inline-end-color":"<'border-top-color'>","border-inline-end-style":"<'border-top-style'>","border-inline-end-width":"<'border-top-width'>","border-inline-start":"<'border-top-width'>||<'border-top-style'>||<color>","border-inline-start-color":"<'border-top-color'>","border-inline-start-style":"<'border-top-style'>","border-inline-start-width":"<'border-top-width'>","border-inline-style":"<'border-top-style'>{1,2}","border-inline-width":"<'border-top-width'>{1,2}","border-left":"<line-width>||<line-style>||<color>","border-left-color":"<color>","border-left-style":"<line-style>","border-left-width":"<line-width>","border-radius":"<length-percentage [0,\u221E]>{1,4} [/ <length-percentage [0,\u221E]>{1,4}]?","border-right":"<line-width>||<line-style>||<color>","border-right-color":"<color>","border-right-style":"<line-style>","border-right-width":"<line-width>","border-spacing":"<length>{1,2}","border-start-end-radius":"<'border-top-left-radius'>","border-start-start-radius":"<'border-top-left-radius'>","border-style":"<line-style>{1,4}","border-top":"<line-width>||<line-style>||<color>","border-top-color":"<color>","border-top-left-radius":"<length-percentage [0,\u221E]>{1,2}","border-top-right-radius":"<length-percentage [0,\u221E]>{1,2}","border-top-style":"<line-style>","border-top-width":"<line-width>","border-width":"<line-width>{1,4}",bottom:"auto|<length-percentage>|<anchor()>|<anchor-size()>","box-align":"start|center|end|baseline|stretch","box-decoration-break":"slice|clone","box-direction":"normal|reverse|inherit","box-flex":"<number>","box-flex-group":"<integer>","box-lines":"single|multiple","box-ordinal-group":"<integer>","box-orient":"horizontal|vertical|inline-axis|block-axis|inherit","box-pack":"start|center|end|justify","box-shadow":"none|<shadow>#","box-sizing":"content-box|border-box","break-after":"auto|avoid|always|all|avoid-page|page|left|right|recto|verso|avoid-column|column|avoid-region|region","break-before":"auto|avoid|always|all|avoid-page|page|left|right|recto|verso|avoid-column|column|avoid-region|region","break-inside":"auto|avoid|avoid-page|avoid-column|avoid-region","caption-side":"top|bottom",caret:"<'caret-color'>||<'caret-animation'>||<'caret-shape'>","caret-animation":"auto|manual","caret-color":"auto|<color>","caret-shape":"auto|bar|block|underscore",clear:"none|left|right|both|inline-start|inline-end",clip:"<shape>|auto","clip-path":"<clip-source>|[<basic-shape>||<geometry-box>]|none","clip-rule":"nonzero|evenodd",color:"<color>","color-interpolation-filters":"auto|sRGB|linearRGB","color-scheme":"normal|[light|dark|<custom-ident>]+&&only?","column-count":"<integer>|auto","column-fill":"auto|balance","column-gap":"normal|<length-percentage>","column-height":"auto|<length [0,\u221E]>","column-rule":"<'column-rule-width'>||<'column-rule-style'>||<'column-rule-color'>","column-rule-color":"<color>","column-rule-style":"<'border-style'>","column-rule-width":"<'border-width'>","column-span":"none|all","column-width":"auto|<length [0,\u221E]>","column-wrap":"auto|nowrap|wrap",columns:"[<'column-width'>||<'column-count'>] [/ <'column-height'>]?",contain:"none|strict|content|[[size||inline-size]||layout||style||paint]","contain-intrinsic-block-size":"auto? [none|<length>]","contain-intrinsic-height":"auto? [none|<length>]","contain-intrinsic-inline-size":"auto? [none|<length>]","contain-intrinsic-size":"[auto? [none|<length>]]{1,2}","contain-intrinsic-width":"auto? [none|<length>]",container:"<'container-name'> [/ <'container-type'>]?","container-name":"none|<custom-ident>+","container-type":"normal||[size|inline-size]",content:"normal|none|[<content-replacement>|<content-list>] [/ [<string>|<counter>|<attr()>]+]?","content-visibility":"visible|auto|hidden","corner-block-end-shape":"<corner-shape-value>{1,2}","corner-block-start-shape":"<corner-shape-value>{1,2}","corner-bottom-shape":"<corner-shape-value>{1,2}","corner-bottom-left-shape":"<corner-shape-value>","corner-bottom-right-shape":"<corner-shape-value>","corner-end-end-shape":"<corner-shape-value>","corner-end-start-shape":"<corner-shape-value>","corner-inline-end-shape":"<corner-shape-value>{1,2}","corner-inline-start-shape":"<corner-shape-value>{1,2}","corner-left-shape":"<corner-shape-value>{1,2}","corner-right-shape":"<corner-shape-value>{1,2}","corner-shape":"<corner-shape-value>{1,4}","corner-start-start-shape":"<corner-shape-value>","corner-start-end-shape":"<corner-shape-value>","corner-top-shape":"<corner-shape-value>{1,2}","corner-top-left-shape":"<corner-shape-value>","corner-top-right-shape":"<corner-shape-value>","counter-increment":"[<counter-name> <integer>?]+|none","counter-reset":"[<counter-name> <integer>?|<reversed-counter-name> <integer>?]+|none","counter-set":"[<counter-name> <integer>?]+|none",cursor:"[[<url> [<x> <y>]? ,]* [auto|default|none|context-menu|help|pointer|progress|wait|cell|crosshair|text|vertical-text|alias|copy|move|no-drop|not-allowed|e-resize|n-resize|ne-resize|nw-resize|s-resize|se-resize|sw-resize|w-resize|ew-resize|ns-resize|nesw-resize|nwse-resize|col-resize|row-resize|all-scroll|zoom-in|zoom-out|grab|grabbing|hand|-webkit-grab|-webkit-grabbing|-webkit-zoom-in|-webkit-zoom-out|-moz-grab|-moz-grabbing|-moz-zoom-in|-moz-zoom-out]]",cx:"<length>|<percentage>",cy:"<length>|<percentage>",d:"none|path( <string> )",direction:"ltr|rtl",display:"[<display-outside>||<display-inside>]|<display-listitem>|<display-internal>|<display-box>|<display-legacy>|<-non-standard-display>","dominant-baseline":"auto|use-script|no-change|reset-size|ideographic|alphabetic|hanging|mathematical|central|middle|text-after-edge|text-before-edge","dynamic-range-limit":"standard|no-limit|constrained|<dynamic-range-limit-mix()>","empty-cells":"show|hide","field-sizing":"content|fixed",fill:"<paint>","fill-opacity":"<number-zero-one>|<percentage>","fill-rule":"nonzero|evenodd",filter:"none|<filter-value-list>|<-ms-filter-function-list>",flex:"none|[<'flex-grow'> <'flex-shrink'>?||<'flex-basis'>]","flex-basis":"content|<'width'>","flex-direction":"row|row-reverse|column|column-reverse","flex-flow":"<'flex-direction'>||<'flex-wrap'>","flex-grow":"<number>","flex-shrink":"<number>","flex-wrap":"nowrap|wrap|wrap-reverse",float:"left|right|none|inline-start|inline-end","flood-color":"<color>","flood-opacity":"<'opacity'>",font:"[[<'font-style'>||<font-variant-css2>||<'font-weight'>||<font-width-css3>]? <'font-size'> [/ <'line-height'>]? <'font-family'>#]|<system-family-name>|<-non-standard-font>","font-family":"[<family-name>|<generic-family>]#","font-feature-settings":"normal|<feature-tag-value>#","font-kerning":"auto|normal|none","font-language-override":"normal|<string>","font-optical-sizing":"auto|none","font-palette":"normal|light|dark|<palette-identifier>|<palette-mix()>","font-size":"<absolute-size>|<relative-size>|<length-percentage [0,\u221E]>|math","font-size-adjust":"none|[ex-height|cap-height|ch-width|ic-width|ic-height]? [from-font|<number>]","font-smooth":"auto|never|always|<absolute-size>|<length>","font-stretch":"<font-stretch-absolute>","font-style":"normal|italic|oblique <angle>?","font-synthesis":"none|[weight||style||small-caps||position]","font-synthesis-position":"auto|none","font-synthesis-small-caps":"auto|none","font-synthesis-style":"auto|none","font-synthesis-weight":"auto|none","font-variant":"normal|none|[<common-lig-values>||<discretionary-lig-values>||<historical-lig-values>||<contextual-alt-values>||stylistic( <feature-value-name> )||historical-forms||styleset( <feature-value-name># )||character-variant( <feature-value-name># )||swash( <feature-value-name> )||ornaments( <feature-value-name> )||annotation( <feature-value-name> )||[small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps]||<numeric-figure-values>||<numeric-spacing-values>||<numeric-fraction-values>||ordinal||slashed-zero||<east-asian-variant-values>||<east-asian-width-values>||ruby]","font-variant-alternates":"normal|[stylistic( <feature-value-name> )||historical-forms||styleset( <feature-value-name># )||character-variant( <feature-value-name># )||swash( <feature-value-name> )||ornaments( <feature-value-name> )||annotation( <feature-value-name> )]","font-variant-caps":"normal|small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps","font-variant-east-asian":"normal|[<east-asian-variant-values>||<east-asian-width-values>||ruby]","font-variant-emoji":"normal|text|emoji|unicode","font-variant-ligatures":"normal|none|[<common-lig-values>||<discretionary-lig-values>||<historical-lig-values>||<contextual-alt-values>]","font-variant-numeric":"normal|[<numeric-figure-values>||<numeric-spacing-values>||<numeric-fraction-values>||ordinal||slashed-zero]","font-variant-position":"normal|sub|super","font-variation-settings":"normal|[<string> <number>]#","font-weight":"<font-weight-absolute>|bolder|lighter","font-width":"normal|<percentage [0,\u221E]>|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded","forced-color-adjust":"auto|none|preserve-parent-color",gap:"<'row-gap'> <'column-gap'>?",grid:"<'grid-template'>|<'grid-template-rows'> / [auto-flow&&dense?] <'grid-auto-columns'>?|[auto-flow&&dense?] <'grid-auto-rows'>? / <'grid-template-columns'>","grid-area":"<grid-line> [/ <grid-line>]{0,3}","grid-auto-columns":"<track-size>+","grid-auto-flow":"[row|column]||dense","grid-auto-rows":"<track-size>+","grid-column":"<grid-line> [/ <grid-line>]?","grid-column-end":"<grid-line>","grid-column-gap":"<length-percentage>","grid-column-start":"<grid-line>","grid-gap":"<'grid-row-gap'> <'grid-column-gap'>?","grid-row":"<grid-line> [/ <grid-line>]?","grid-row-end":"<grid-line>","grid-row-gap":"<length-percentage>","grid-row-start":"<grid-line>","grid-template":"none|[<'grid-template-rows'> / <'grid-template-columns'>]|[<line-names>? <string> <track-size>? <line-names>?]+ [/ <explicit-track-list>]?","grid-template-areas":"none|<string>+","grid-template-columns":"none|<track-list>|<auto-track-list>|subgrid <line-name-list>?","grid-template-rows":"none|<track-list>|<auto-track-list>|subgrid <line-name-list>?","hanging-punctuation":"none|[first||[force-end|allow-end]||last]",height:"auto|<length-percentage [0,\u221E]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,\u221E]> )|<calc-size()>|<anchor-size()>|stretch|<-non-standard-size>","hyphenate-character":"auto|<string>","hyphenate-limit-chars":"[auto|<integer>]{1,3}",hyphens:"none|manual|auto","image-orientation":"from-image|<angle>|[<angle>? flip]","image-rendering":"auto|crisp-edges|pixelated|smooth|optimizeSpeed|optimizeQuality|<-non-standard-image-rendering>","image-resolution":"[from-image||<resolution>]&&snap?","ime-mode":"auto|normal|active|inactive|disabled","initial-letter":"normal|[<number> <integer>?]","initial-letter-align":"[auto|alphabetic|hanging|ideographic]","inline-size":"<'width'>",inset:"<'top'>{1,4}","inset-block":"<'top'>{1,2}","inset-block-end":"<'top'>","inset-block-start":"<'top'>","inset-inline":"<'top'>{1,2}","inset-inline-end":"<'top'>","inset-inline-start":"<'top'>","interpolate-size":"numeric-only|allow-keywords",isolation:"auto|isolate",interactivity:"auto|inert","interest-delay":"<'interest-delay-start'>{1,2}","interest-delay-end":"normal|<time>","interest-delay-start":"normal|<time>","justify-content":"normal|<content-distribution>|<overflow-position>? [<content-position>|left|right]","justify-items":"normal|stretch|<baseline-position>|<overflow-position>? [<self-position>|left|right]|legacy|legacy&&[left|right|center]|anchor-center","justify-self":"auto|normal|stretch|<baseline-position>|<overflow-position>? [<self-position>|left|right]|anchor-center","justify-tracks":"[normal|<content-distribution>|<overflow-position>? [<content-position>|left|right]]#",left:"auto|<length-percentage>|<anchor()>|<anchor-size()>","letter-spacing":"normal|<length-percentage>","lighting-color":"<color>","line-break":"auto|loose|normal|strict|anywhere","line-clamp":"none|<integer>","line-height":"normal|<number>|<length>|<percentage>","line-height-step":"<length>","list-style":"<'list-style-type'>||<'list-style-position'>||<'list-style-image'>","list-style-image":"<image>|none","list-style-position":"inside|outside","list-style-type":"<counter-style>|<string>|none",margin:"<'margin-top'>{1,4}","margin-block":"<'margin-top'>{1,2}","margin-block-end":"<'margin-top'>","margin-block-start":"<'margin-top'>","margin-bottom":"<length-percentage>|auto|<anchor-size()>","margin-inline":"<'margin-top'>{1,2}","margin-inline-end":"<'margin-top'>","margin-inline-start":"<'margin-top'>","margin-left":"<length-percentage>|auto|<anchor-size()>","margin-right":"<length-percentage>|auto|<anchor-size()>","margin-top":"<length-percentage>|auto|<anchor-size()>","margin-trim":"none|in-flow|all",marker:"none|<url>","marker-end":"none|<url>","marker-mid":"none|<url>","marker-start":"none|<url>",mask:"<mask-layer>#","mask-border":"<'mask-border-source'>||<'mask-border-slice'> [/ <'mask-border-width'>? [/ <'mask-border-outset'>]?]?||<'mask-border-repeat'>||<'mask-border-mode'>","mask-border-mode":"luminance|alpha","mask-border-outset":"[<length>|<number>]{1,4}","mask-border-repeat":"[stretch|repeat|round|space]{1,2}","mask-border-slice":"<number-percentage>{1,4} fill?","mask-border-source":"none|<image>","mask-border-width":"[<length-percentage>|<number>|auto]{1,4}","mask-clip":"[<coord-box>|no-clip]#","mask-composite":"<compositing-operator>#","mask-image":"<mask-reference>#","mask-mode":"<masking-mode>#","mask-origin":"<coord-box>#","mask-position":"<position>#","mask-repeat":"<repeat-style>#","mask-size":"<bg-size>#","mask-type":"luminance|alpha","masonry-auto-flow":"[pack|next]||[definite-first|ordered]","math-depth":"auto-add|add( <integer> )|<integer>","math-shift":"normal|compact","math-style":"normal|compact","max-block-size":"<'max-width'>","max-height":"none|<length-percentage [0,\u221E]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,\u221E]> )|<calc-size()>|<anchor-size()>|stretch|<-non-standard-size>","max-inline-size":"<'max-width'>","max-lines":"none|<integer>","max-width":"none|<length-percentage [0,\u221E]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,\u221E]> )|<calc-size()>|<anchor-size()>|stretch|<-non-standard-size>","min-block-size":"<'min-width'>","min-height":"auto|<length-percentage [0,\u221E]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,\u221E]> )|<calc-size()>|<anchor-size()>|stretch|<-non-standard-size>","min-inline-size":"<'min-width'>","min-width":"auto|<length-percentage [0,\u221E]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,\u221E]> )|<calc-size()>|<anchor-size()>|stretch|<-non-standard-size>","mix-blend-mode":"<blend-mode>|plus-darker|plus-lighter","object-fit":"fill|contain|cover|none|scale-down","object-position":"<position>","object-view-box":"none|<basic-shape-rect>",offset:"[<'offset-position'>? [<'offset-path'> [<'offset-distance'>||<'offset-rotate'>]?]?]! [/ <'offset-anchor'>]?","offset-anchor":"auto|<position>","offset-distance":"<length-percentage>","offset-path":"none|<offset-path>||<coord-box>","offset-position":"normal|auto|<position>","offset-rotate":"[auto|reverse]||<angle>",opacity:"<opacity-value>",order:"<integer>",orphans:"<integer>",outline:"<'outline-width'>||<'outline-style'>||<'outline-color'>","outline-color":"auto|<color>","outline-offset":"<length>","outline-style":"auto|<outline-line-style>","outline-width":"<line-width>",overflow:"[visible|hidden|clip|scroll|auto]{1,2}|<-non-standard-overflow>","overflow-anchor":"auto|none","overflow-block":"visible|hidden|clip|scroll|auto|<-non-standard-overflow>","overflow-clip-box":"padding-box|content-box","overflow-clip-margin":"<visual-box>||<length [0,\u221E]>","overflow-inline":"visible|hidden|clip|scroll|auto|<-non-standard-overflow>","overflow-wrap":"normal|break-word|anywhere","overflow-x":"visible|hidden|clip|scroll|auto|<-non-standard-overflow>","overflow-y":"visible|hidden|clip|scroll|auto|<-non-standard-overflow>",overlay:"none|auto","overscroll-behavior":"[contain|none|auto]{1,2}","overscroll-behavior-block":"contain|none|auto","overscroll-behavior-inline":"contain|none|auto","overscroll-behavior-x":"contain|none|auto","overscroll-behavior-y":"contain|none|auto",padding:"<'padding-top'>{1,4}","padding-block":"<'padding-top'>{1,2}","padding-block-end":"<'padding-top'>","padding-block-start":"<'padding-top'>","padding-bottom":"<length-percentage [0,\u221E]>","padding-inline":"<'padding-top'>{1,2}","padding-inline-end":"<'padding-top'>","padding-inline-start":"<'padding-top'>","padding-left":"<length-percentage [0,\u221E]>","padding-right":"<length-percentage [0,\u221E]>","padding-top":"<length-percentage [0,\u221E]>",page:"auto|<custom-ident>","page-break-after":"auto|always|avoid|left|right|recto|verso","page-break-before":"auto|always|avoid|left|right|recto|verso","page-break-inside":"auto|avoid","paint-order":"normal|[fill||stroke||markers]",perspective:"none|<length>","perspective-origin":"<position>","place-content":"<'align-content'> <'justify-content'>?","place-items":"<'align-items'> <'justify-items'>?","place-self":"<'align-self'> <'justify-self'>?","pointer-events":"auto|none|visiblePainted|visibleFill|visibleStroke|visible|painted|fill|stroke|all|inherit",position:"static|relative|absolute|sticky|fixed|-webkit-sticky","position-anchor":"auto|none|<anchor-name>","position-area":"none|<position-area>","position-try":"<'position-try-order'>? <'position-try-fallbacks'>","position-try-fallbacks":"none|[[<dashed-ident>||<try-tactic>]|<'position-area'>]#","position-try-order":"normal|<try-size>","position-visibility":"always|[anchors-valid||anchors-visible||no-overflow]","print-color-adjust":"economy|exact",quotes:"none|auto|[<string> <string>]+",r:"<length>|<percentage>","reading-flow":"normal|source-order|flex-visual|flex-flow|grid-rows|grid-columns|grid-order","reading-order":"<integer>",resize:"none|both|horizontal|vertical|block|inline",right:"auto|<length-percentage>|<anchor()>|<anchor-size()>",rotate:"none|<angle>|[x|y|z|<number>{3}]&&<angle>","row-gap":"normal|<length-percentage>","ruby-align":"start|center|space-between|space-around","ruby-merge":"separate|collapse|auto","ruby-overhang":"auto|none","ruby-position":"[alternate||[over|under]]|inter-character",rx:"<length>|<percentage>",ry:"<length>|<percentage>",scale:"none|[<number>|<percentage>]{1,3}","scroll-behavior":"auto|smooth","scroll-initial-target":"none|nearest","scroll-margin":"<length>{1,4}","scroll-margin-block":"<length>{1,2}","scroll-margin-block-end":"<length>","scroll-margin-block-start":"<length>","scroll-margin-bottom":"<length>","scroll-margin-inline":"<length>{1,2}","scroll-margin-inline-end":"<length>","scroll-margin-inline-start":"<length>","scroll-margin-left":"<length>","scroll-margin-right":"<length>","scroll-margin-top":"<length>","scroll-marker-group":"none|before|after","scroll-padding":"[auto|<length-percentage>]{1,4}","scroll-padding-block":"[auto|<length-percentage>]{1,2}","scroll-padding-block-end":"auto|<length-percentage>","scroll-padding-block-start":"auto|<length-percentage>","scroll-padding-bottom":"auto|<length-percentage>","scroll-padding-inline":"[auto|<length-percentage>]{1,2}","scroll-padding-inline-end":"auto|<length-percentage>","scroll-padding-inline-start":"auto|<length-percentage>","scroll-padding-left":"auto|<length-percentage>","scroll-padding-right":"auto|<length-percentage>","scroll-padding-top":"auto|<length-percentage>","scroll-snap-align":"[none|start|end|center]{1,2}","scroll-snap-coordinate":"none|<position>#","scroll-snap-destination":"<position>","scroll-snap-points-x":"none|repeat( <length-percentage> )","scroll-snap-points-y":"none|repeat( <length-percentage> )","scroll-snap-stop":"normal|always","scroll-snap-type":"none|[x|y|block|inline|both] [mandatory|proximity]?","scroll-snap-type-x":"none|mandatory|proximity","scroll-snap-type-y":"none|mandatory|proximity","scroll-target-group":"none|auto","scroll-timeline":"[<'scroll-timeline-name'> <'scroll-timeline-axis'>?]#","scroll-timeline-axis":"[block|inline|x|y]#","scroll-timeline-name":"[none|<dashed-ident>]#","scrollbar-color":"auto|<color>{2}","scrollbar-gutter":"auto|stable&&both-edges?","scrollbar-width":"auto|thin|none","shape-image-threshold":"<opacity-value>","shape-margin":"<length-percentage>","shape-outside":"none|[<shape-box>||<basic-shape>]|<image>","shape-rendering":"auto|optimizeSpeed|crispEdges|geometricPrecision","speak-as":"normal|spell-out||digits||[literal-punctuation|no-punctuation]","stop-color":"<'color'>","stop-opacity":"<'opacity'>",stroke:"<paint>","stroke-color":"<color>","stroke-dasharray":"none|[<svg-length>+]#","stroke-dashoffset":"<svg-length>","stroke-linecap":"butt|round|square","stroke-linejoin":"miter|round|bevel","stroke-miterlimit":"<number-one-or-greater>","stroke-opacity":"<'opacity'>","stroke-width":"<svg-length>","tab-size":"<integer>|<length>","table-layout":"auto|fixed","text-align":"start|end|left|right|center|justify|match-parent","text-align-last":"auto|start|end|left|right|center|justify","text-anchor":"start|middle|end","text-autospace":"normal|<autospace>|auto","text-box":"normal|<'text-box-trim'>||<'text-box-edge'>","text-box-edge":"auto|<text-edge>","text-box-trim":"none|trim-start|trim-end|trim-both","text-combine-upright":"none|all|[digits <integer>?]","text-decoration":"<'text-decoration-line'>||<'text-decoration-style'>||<'text-decoration-color'>||<'text-decoration-thickness'>","text-decoration-color":"<color>","text-decoration-inset":"<length>{1,2}|auto","text-decoration-line":"none|[underline||overline||line-through||blink]|spelling-error|grammar-error","text-decoration-skip":"none|[objects||[spaces|[leading-spaces||trailing-spaces]]||edges||box-decoration]","text-decoration-skip-ink":"auto|all|none","text-decoration-style":"solid|double|dotted|dashed|wavy","text-decoration-thickness":"auto|from-font|<length>|<percentage>","text-emphasis":"<'text-emphasis-style'>||<'text-emphasis-color'>","text-emphasis-color":"<color>","text-emphasis-position":"auto|[over|under]&&[right|left]?","text-emphasis-style":"none|[[filled|open]||[dot|circle|double-circle|triangle|sesame]]|<string>","text-indent":"<length-percentage>&&hanging?&&each-line?","text-justify":"auto|inter-character|inter-word|none","text-orientation":"mixed|upright|sideways","text-overflow":"[clip|ellipsis|<string>]{1,2}","text-rendering":"auto|optimizeSpeed|optimizeLegibility|geometricPrecision","text-shadow":"none|<shadow-t>#","text-size-adjust":"none|auto|<percentage>","text-spacing-trim":"space-all|normal|space-first|trim-start","text-transform":"none|[capitalize|uppercase|lowercase]||full-width||full-size-kana|math-auto","text-underline-offset":"auto|<length>|<percentage>","text-underline-position":"auto|from-font|[under||[left|right]]","text-wrap":"<'text-wrap-mode'>||<'text-wrap-style'>","text-wrap-mode":"wrap|nowrap","text-wrap-style":"auto|balance|stable|pretty","timeline-scope":"none|<dashed-ident>#","timeline-trigger":"none|[<'timeline-trigger-name'> <'timeline-trigger-source'> <'timeline-trigger-range'> ['/' <'timeline-trigger-exit-range'>]?]#","timeline-trigger-name":"none|<dashed-ident>#","timeline-trigger-exit-range":"[<'timeline-trigger-exit-range-start'> <'timeline-trigger-exit-range-end'>?]#","timeline-trigger-exit-range-end":"[auto|normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#","timeline-trigger-exit-range-start":"[auto|normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#","timeline-trigger-range":"[<'timeline-trigger-range-start'> <'timeline-trigger-range-end'>?]#","timeline-trigger-range-end":"[normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#","timeline-trigger-range-start":"[normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#","timeline-trigger-source":"<single-animation-timeline>#",top:"auto|<length-percentage>|<anchor()>|<anchor-size()>","touch-action":"auto|none|[[pan-x|pan-left|pan-right]||[pan-y|pan-up|pan-down]||pinch-zoom]|manipulation",transform:"none|<transform-list>","transform-box":"content-box|border-box|fill-box|stroke-box|view-box","transform-origin":"[<length-percentage>|left|center|right|top|bottom]|[[<length-percentage>|left|center|right]&&[<length-percentage>|top|center|bottom]] <length>?","transform-style":"flat|preserve-3d",transition:"<single-transition>#","transition-behavior":"<transition-behavior-value>#","transition-delay":"<time>#","transition-duration":"<time>#","transition-property":"none|<single-transition-property>#","transition-timing-function":"<easing-function>#",translate:"none|<length-percentage> [<length-percentage> <length>?]?","trigger-scope":"none|all|<dashed-ident>#","unicode-bidi":"normal|embed|isolate|bidi-override|isolate-override|plaintext|-moz-isolate|-moz-isolate-override|-moz-plaintext|-webkit-isolate|-webkit-isolate-override|-webkit-plaintext","user-select":"auto|text|none|all","vector-effect":"none|non-scaling-stroke|non-scaling-size|non-rotation|fixed-position","vertical-align":"baseline|sub|super|text-top|text-bottom|middle|top|bottom|<percentage>|<length>","view-timeline":"[<'view-timeline-name'> [<'view-timeline-axis'>||<'view-timeline-inset'>]?]#","view-timeline-axis":"[block|inline|x|y]#","view-timeline-inset":"[[auto|<length-percentage>]{1,2}]#","view-timeline-name":"[none|<dashed-ident>]#","view-transition-class":"none|<custom-ident>+","view-transition-name":"none|<custom-ident>|match-element",visibility:"visible|hidden|collapse","white-space":"normal|pre|pre-wrap|pre-line|<'white-space-collapse'>||<'text-wrap-mode'>","white-space-collapse":"collapse|preserve|preserve-breaks|preserve-spaces|break-spaces",widows:"<integer>",width:"auto|<length-percentage [0,\u221E]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,\u221E]> )|<calc-size()>|<anchor-size()>|stretch|<-non-standard-size>","will-change":"auto|<animateable-feature>#","word-break":"normal|break-all|keep-all|break-word|auto-phrase","word-spacing":"normal|<length>","word-wrap":"normal|break-word","writing-mode":"horizontal-tb|vertical-rl|vertical-lr|sideways-rl|sideways-lr|<svg-writing-mode>",x:"<length>|<percentage>",y:"<length>|<percentage>","z-index":"auto|<integer>",zoom:"normal|reset|<number [0,\u221E]>||<percentage [0,\u221E]>","-moz-background-clip":"padding|border","-moz-border-radius-bottomleft":"<'border-bottom-left-radius'>","-moz-border-radius-bottomright":"<'border-bottom-right-radius'>","-moz-border-radius-topleft":"<'border-top-left-radius'>","-moz-border-radius-topright":"<'border-bottom-right-radius'>","-moz-control-character-visibility":"visible|hidden","-moz-osx-font-smoothing":"auto|grayscale","-moz-user-select":"none|text|all|-moz-none","-ms-flex-align":"start|end|center|baseline|stretch","-ms-flex-item-align":"auto|start|end|center|baseline|stretch","-ms-flex-line-pack":"start|end|center|justify|distribute|stretch","-ms-flex-negative":"<'flex-shrink'>","-ms-flex-pack":"start|end|center|justify|distribute","-ms-flex-order":"<integer>","-ms-flex-positive":"<'flex-grow'>","-ms-flex-preferred-size":"<'flex-basis'>","-ms-interpolation-mode":"nearest-neighbor|bicubic","-ms-grid-column-align":"start|end|center|stretch","-ms-grid-row-align":"start|end|center|stretch","-ms-hyphenate-limit-last":"none|always|column|page|spread","-webkit-background-clip":"[<visual-box>|border|padding|content|text]#","-webkit-column-break-after":"always|auto|avoid","-webkit-column-break-before":"always|auto|avoid","-webkit-column-break-inside":"always|auto|avoid","-webkit-font-smoothing":"auto|none|antialiased|subpixel-antialiased","-webkit-mask-box-image":"[<url>|<gradient>|none] [<length-percentage>{4} <-webkit-mask-box-repeat>{2}]?","-webkit-print-color-adjust":"economy|exact","-webkit-text-security":"none|circle|disc|square","-webkit-user-drag":"none|element|auto",behavior:"<url>+",cue:"<'cue-before'> <'cue-after'>?","cue-after":"<url> <decibel>?|none","cue-before":"<url> <decibel>?|none","glyph-orientation-horizontal":"<angle>","glyph-orientation-vertical":"<angle>",kerning:"auto|<svg-length>",pause:"<'pause-before'> <'pause-after'>?","pause-after":"<time>|none|x-weak|weak|medium|strong|x-strong","pause-before":"<time>|none|x-weak|weak|medium|strong|x-strong","position-try-options":"<'position-try-fallbacks'>",rest:"<'rest-before'> <'rest-after'>?","rest-after":"<time>|none|x-weak|weak|medium|strong|x-strong","rest-before":"<time>|none|x-weak|weak|medium|strong|x-strong",speak:"auto|never|always","voice-balance":"<number>|left|center|right|leftwards|rightwards","voice-duration":"auto|<time>","voice-family":"[[<family-name>|<generic-voice>] ,]* [<family-name>|<generic-voice>]|preserve","voice-pitch":"<frequency>&&absolute|[[x-low|low|medium|high|x-high]||[<frequency>|<semitones>|<percentage>]]","voice-range":"<frequency>&&absolute|[[x-low|low|medium|high|x-high]||[<frequency>|<semitones>|<percentage>]]","voice-rate":"[normal|x-slow|slow|medium|fast|x-fast]||<percentage>","voice-stress":"normal|strong|moderate|none|reduced","voice-volume":"silent|[[x-soft|soft|medium|loud|x-loud]||<decibel>]","white-space-trim":"none|discard-before||discard-after||discard-inner"},atrules:{charset:{prelude:"<string>",descriptors:null},"counter-style":{prelude:"<counter-style-name>",descriptors:{"additive-symbols":"[<integer [0,\u221E]>&&<symbol>]#",fallback:"<counter-style-name>",negative:"<symbol> <symbol>?",pad:"<integer [0,\u221E]>&&<symbol>",prefix:"<symbol>",range:"[[<integer>|infinite]{2}]#|auto","speak-as":"auto|bullets|numbers|words|spell-out|<counter-style-name>",suffix:"<symbol>",symbols:"<symbol>+",system:"cyclic|numeric|alphabetic|symbolic|additive|[fixed <integer>?]|[extends <counter-style-name>]"}},container:{prelude:"[<container-name>]? <container-condition>",descriptors:null},document:{prelude:"[<url>|url-prefix( <string> )|domain( <string> )|media-document( <string> )|regexp( <string> )]#",descriptors:null},"font-face":{prelude:null,descriptors:{"ascent-override":"normal|<percentage>","descent-override":"normal|<percentage>","font-display":"auto|block|swap|fallback|optional","font-family":"<family-name>","font-feature-settings":"normal|<feature-tag-value>#","font-stretch":"<font-stretch-absolute>{1,2}","font-style":"normal|italic|oblique <angle>{0,2}","font-variation-settings":"normal|[<string> <number>]#","font-weight":"<font-weight-absolute>{1,2}","line-gap-override":"normal|<percentage>","size-adjust":"<percentage>",src:"[<url> [format( <string># )]?|local( <family-name> )]#","unicode-range":"<urange>#"}},"font-feature-values":{prelude:"<family-name>#",descriptors:null},"font-palette-values":{prelude:"<dashed-ident>",descriptors:{"base-palette":"light|dark|<integer [0,\u221E]>","font-family":"<family-name>#","override-colors":"[<integer [0,\u221E]> <color>]#"}},import:{prelude:"[<string>|<url>] [layer|layer( <layer-name> )]? [supports( [<supports-condition>|<declaration>] )]? <media-query-list>?",descriptors:null},keyframes:{prelude:"<keyframes-name>",descriptors:null},layer:{prelude:"[<layer-name>#|<layer-name>?]",descriptors:null},media:{prelude:"<media-query-list>",descriptors:null},namespace:{prelude:"<namespace-prefix>? [<string>|<url>]",descriptors:null},page:{prelude:"<page-selector-list>",descriptors:{bleed:"auto|<length>",marks:"none|[crop||cross]","page-orientation":"upright|rotate-left|rotate-right",size:"<length [0,\u221E]>{1,2}|auto|[<page-size>||[portrait|landscape]]"}},"position-try":{prelude:"<dashed-ident>",descriptors:{top:"<'top'>",left:"<'left'>",bottom:"<'bottom'>",right:"<'right'>","inset-block-start":"<'inset-block-start'>","inset-block-end":"<'inset-block-end'>","inset-inline-start":"<'inset-inline-start'>","inset-inline-end":"<'inset-inline-end'>","inset-block":"<'inset-block'>","inset-inline":"<'inset-inline'>",inset:"<'inset'>","margin-top":"<'margin-top'>","margin-left":"<'margin-left'>","margin-bottom":"<'margin-bottom'>","margin-right":"<'margin-right'>","margin-block-start":"<'margin-block-start'>","margin-block-end":"<'margin-block-end'>","margin-inline-start":"<'margin-inline-start'>","margin-inline-end":"<'margin-inline-end'>",margin:"<'margin'>","margin-block":"<'margin-block'>","margin-inline":"<'margin-inline'>",width:"<'width'>",height:"<'height'>","min-width":"<'min-width'>","min-height":"<'min-height'>","max-width":"<'max-width'>","max-height":"<'max-height'>","block-size":"<'block-size'>","inline-size":"<'inline-size'>","min-block-size":"<'min-block-size'>","min-inline-size":"<'min-inline-size'>","max-block-size":"<'max-block-size'>","max-inline-size":"<'max-inline-size'>","align-self":"<'align-self'>|anchor-center","justify-self":"<'justify-self'>|anchor-center"}},property:{prelude:"<custom-property-name>",descriptors:{inherits:"true|false","initial-value":"<declaration-value>?",syntax:"<string>"}},scope:{prelude:"[( <scope-start> )]? [to ( <scope-end> )]?",descriptors:null},"starting-style":{prelude:null,descriptors:null},supports:{prelude:"<supports-condition>",descriptors:null},"view-transition":{prelude:null,descriptors:{navigation:"auto|none",types:"none|<custom-ident>+"}},"font-features-values":{prelude:"[<string>|<custom-ident>]+",descriptors:{"font-display":"auto|block|swap|fallback|optional"}}}}});var Wp={};ye(Wp,{generate:()=>mP,name:()=>gP,parse:()=>Hp,structure:()=>fP});function Wl(e,t){let n=this.tokenStart+e,r=this.charCodeAt(n);for((r===Ur||r===er)&&(t&&this.error("Number sign is not allowed"),n++);n<this.tokenEnd;n++)Ht(this.charCodeAt(n))||this.error("Integer is expected",n)}function Ni(e){return Wl.call(this,0,e)}function Po(e,t){if(!this.cmpChar(this.tokenStart+e,t)){let n="";switch(t){case Hl:n="N is expected";break;case er:n="HyphenMinus is expected";break}this.error(n,this.tokenStart+e)}}function jp(){let e=0,t=0,n=this.tokenType;for(;n===13||n===25;)n=this.lookupType(++e);if(n!==10)if(this.isDelim(Ur,e)||this.isDelim(er,e)){t=this.isDelim(Ur,e)?Ur:er;do n=this.lookupType(++e);while(n===13||n===25);n!==10&&(this.skip(e),Ni.call(this,ni))}else return null;return e>0&&this.skip(e),t===0&&(n=this.charCodeAt(this.tokenStart),n!==Ur&&n!==er&&this.error("Number sign is expected")),Ni.call(this,t!==0),t===er?"-"+this.consume(10):this.consume(10)}function Hp(){let e=this.tokenStart,t=null,n=null;if(this.tokenType===10)Ni.call(this,dP),n=this.consume(10);else if(this.tokenType===1&&this.cmpChar(this.tokenStart,er))switch(t="-1",Po.call(this,1,Hl),this.tokenEnd-this.tokenStart){case 2:this.next(),n=jp.call(this);break;case 3:Po.call(this,2,er),this.next(),this.skipSC(),Ni.call(this,ni),n="-"+this.consume(10);break;default:Po.call(this,2,er),Wl.call(this,3,ni),this.next(),n=this.substrToCursor(e+2)}else if(this.tokenType===1||this.isDelim(Ur)&&this.lookupType(1)===1){let r=0;switch(t="1",this.isDelim(Ur)&&(r=1,this.next()),Po.call(this,0,Hl),this.tokenEnd-this.tokenStart){case 1:this.next(),n=jp.call(this);break;case 2:Po.call(this,1,er),this.next(),this.skipSC(),Ni.call(this,ni),n="-"+this.consume(10);break;default:Po.call(this,1,er),Wl.call(this,2,ni),this.next(),n=this.substrToCursor(e+r+1)}}else if(this.tokenType===12){let r=this.charCodeAt(this.tokenStart),o=r===Ur||r===er,i=this.tokenStart+o;for(;i<this.tokenEnd&&Ht(this.charCodeAt(i));i++);i===this.tokenStart+o&&this.error("Integer is expected",this.tokenStart+o),Po.call(this,i-this.tokenStart,Hl),t=this.substring(e,i),i+1===this.tokenEnd?(this.next(),n=jp.call(this)):(Po.call(this,i-this.tokenStart+1,er),i+2===this.tokenEnd?(this.next(),this.skipSC(),Ni.call(this,ni),n="-"+this.consume(10)):(Wl.call(this,i-this.tokenStart+2,ni),this.next(),n=this.substrToCursor(i+1)))}else this.error();return t!==null&&t.charCodeAt(0)===Ur&&(t=t.substr(1)),n!==null&&n.charCodeAt(0)===Ur&&(n=n.substr(1)),{type:"AnPlusB",loc:this.getLocation(e,this.tokenStart),a:t,b:n}}function mP(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)}var Ur,er,Hl,ni,dP,gP,fP,Vp=$(()=>{"use strict";lr();Ur=43,er=45,Hl=110,ni=!0,dP=!1;gP="AnPlusB",fP={a:[String,null],b:[String,null]}});var qp={};ye(qp,{generate:()=>SP,name:()=>xP,parse:()=>Gp,structure:()=>bP,walkContext:()=>yP});function G0(){return this.Raw(this.consumeUntilLeftCurlyBracketOrSemicolon,!0)}function hP(){for(let e=1,t;t=this.lookupType(e);e++){if(t===24)return!0;if(t===23||t===3)return!1}return!1}function Gp(e=!1){let t=this.tokenStart,n,r,o=null,i=null;switch(this.eat(3),n=this.substrToCursor(t+1),r=n.toLowerCase(),this.skipSC(),this.eof===!1&&this.tokenType!==23&&this.tokenType!==17&&(this.parseAtrulePrelude?o=this.parseWithFallback(this.AtrulePrelude.bind(this,n,e),G0):o=G0.call(this,this.tokenIndex),this.skipSC()),this.tokenType){case 17:this.next();break;case 23:hasOwnProperty.call(this.atrule,r)&&typeof this.atrule[r].block=="function"?i=this.atrule[r].block.call(this,e):i=this.Block(hP.call(this));break}return{type:"Atrule",loc:this.getLocation(t,this.tokenStart),name:n,prelude:o,block:i}}function SP(e){this.token(3,"@"+e.name),e.prelude!==null&&this.node(e.prelude),e.block?this.node(e.block):this.token(17,";")}var xP,yP,bP,Yp=$(()=>{"use strict";xP="Atrule",yP="atrule",bP={name:String,prelude:["AtrulePrelude","Raw",null],block:["Block",null]}});var Xp={};ye(Xp,{generate:()=>CP,name:()=>wP,parse:()=>Kp,structure:()=>kP,walkContext:()=>vP});function Kp(e){let t=null;return e!==null&&(e=e.toLowerCase()),this.skipSC(),hasOwnProperty.call(this.atrule,e)&&typeof this.atrule[e].prelude=="function"?t=this.atrule[e].prelude.call(this):t=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 CP(e){this.children(e)}var wP,vP,kP,Qp=$(()=>{"use strict";wP="AtrulePrelude",vP="atrulePrelude",kP={children:[[]]}});var ed={};ye(ed,{generate:()=>MP,name:()=>PP,parse:()=>Zp,structure:()=>LP});function EP(){this.eof&&this.error("Unexpected end of input");let e=this.tokenStart,t=!1;return this.isDelim(q0)?(t=!0,this.next()):this.isDelim(Jp)||this.eat(1),this.isDelim(Jp)?this.charCodeAt(this.tokenStart+1)!==Vl?(this.next(),this.eat(1)):t&&this.error("Identifier is expected",this.tokenEnd):t&&this.error("Vertical line is expected"),{type:"Identifier",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function AP(){let e=this.tokenStart,t=this.charCodeAt(e);return t!==Vl&&t!==FP&&t!==IP&&t!==TP&&t!==q0&&t!==Jp&&this.error("Attribute selector (=, ~=, ^=, $=, *=, |=) is expected"),this.next(),t!==Vl&&(this.isDelim(Vl)||this.error("Equal sign is expected"),this.next()),this.substrToCursor(e)}function Zp(){let e=this.tokenStart,t,n=null,r=null,o=null;return this.eat(19),this.skipSC(),t=EP.call(this),this.skipSC(),this.tokenType!==20&&(this.tokenType!==1&&(n=AP.call(this),this.skipSC(),r=this.tokenType===5?this.String():this.Identifier(),this.skipSC()),this.tokenType===1&&(o=this.consume(1),this.skipSC())),this.eat(20),{type:"AttributeSelector",loc:this.getLocation(e,this.tokenStart),name:t,matcher:n,value:r,flags:o}}function MP(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,"]")}var TP,q0,Vl,IP,Jp,FP,PP,LP,td=$(()=>{"use strict";TP=36,q0=42,Vl=61,IP=94,Jp=124,FP=126;PP="AttributeSelector",LP={name:"Identifier",matcher:[String,null],value:["String","Identifier",null],flags:[String,null]}});var rd={};ye(rd,{generate:()=>OP,name:()=>RP,parse:()=>nd,structure:()=>NP,walkContext:()=>zP});function X0(){return this.Raw(null,!0)}function Y0(){return this.parseWithFallback(this.Rule,X0)}function K0(){return this.Raw(this.consumeUntilSemicolonIncluded,!0)}function DP(){if(this.tokenType===17)return K0.call(this,this.tokenIndex);let e=this.parseWithFallback(this.Declaration,K0);return this.tokenType===17&&this.next(),e}function nd(e){let t=e?DP:Y0,n=this.tokenStart,r=this.createList();this.eat(23);e:for(;!this.eof;)switch(this.tokenType){case 24:break e;case 13:case 25:this.next();break;case 3:r.push(this.parseWithFallback(this.Atrule.bind(this,e),X0));break;default:e&&this.isDelim(BP)?r.push(Y0.call(this)):r.push(t.call(this))}return this.eof||this.eat(24),{type:"Block",loc:this.getLocation(n,this.tokenStart),children:r}}function OP(e){this.token(23,"{"),this.children(e,t=>{t.type==="Declaration"&&this.token(17,";")}),this.token(24,"}")}var BP,RP,zP,NP,od=$(()=>{"use strict";BP=38;RP="Block",zP="block",NP={children:[["Atrule","Rule","Declaration"]]}});var sd={};ye(sd,{generate:()=>UP,name:()=>_P,parse:()=>id,structure:()=>$P});function id(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 UP(e){this.token(9,"["),this.children(e),this.token(9,"]")}var _P,$P,ad=$(()=>{"use strict";_P="Brackets",$P={children:[[]]}});var cd={};ye(cd,{generate:()=>WP,name:()=>jP,parse:()=>ld,structure:()=>HP});function ld(){let e=this.tokenStart;return this.eat(15),{type:"CDC",loc:this.getLocation(e,this.tokenStart)}}function WP(){this.token(15,"-->")}var jP,HP,ud=$(()=>{"use strict";jP="CDC",HP=[]});var dd={};ye(dd,{generate:()=>qP,name:()=>VP,parse:()=>pd,structure:()=>GP});function pd(){let e=this.tokenStart;return this.eat(14),{type:"CDO",loc:this.getLocation(e,this.tokenStart)}}function qP(){this.token(14,"<!--")}var VP,GP,gd=$(()=>{"use strict";VP="CDO",GP=[]});var md={};ye(md,{generate:()=>QP,name:()=>KP,parse:()=>fd,structure:()=>XP});function fd(){return this.eatDelim(YP),{type:"ClassSelector",loc:this.getLocation(this.tokenStart-1,this.tokenEnd),name:this.consume(1)}}function QP(e){this.token(9,"."),this.token(1,e.name)}var YP,KP,XP,hd=$(()=>{"use strict";YP=46,KP="ClassSelector",XP={name:String}});var yd={};ye(yd,{generate:()=>rL,name:()=>tL,parse:()=>xd,structure:()=>nL});function xd(){let e=this.tokenStart,t;switch(this.tokenType){case 13:t=" ";break;case 9:switch(this.charCodeAt(this.tokenStart)){case ZP:case JP:case eL:this.next();break;case Q0:this.next(),this.eatIdent("deep"),this.eatDelim(Q0);break;default:this.error("Combinator is expected")}t=this.substrToCursor(e);break}return{type:"Combinator",loc:this.getLocation(e,this.tokenStart),name:t}}function rL(e){this.tokenize(e.name)}var JP,Q0,ZP,eL,tL,nL,bd=$(()=>{"use strict";JP=43,Q0=47,ZP=62,eL=126,tL="Combinator",nL={name:String}});var wd={};ye(wd,{generate:()=>lL,name:()=>sL,parse:()=>Sd,structure:()=>aL});function Sd(){let e=this.tokenStart,t=this.tokenEnd;return this.eat(25),t-e+2>=2&&this.charCodeAt(t-2)===oL&&this.charCodeAt(t-1)===iL&&(t-=2),{type:"Comment",loc:this.getLocation(e,this.tokenStart),value:this.substring(e+2,t)}}function lL(e){this.token(25,"/*"+e.value+"*/")}var oL,iL,sL,aL,vd=$(()=>{"use strict";oL=42,iL=47,sL="Comment",aL={value:String}});var Cd={};ye(Cd,{generate:()=>gL,name:()=>uL,parse:()=>kd,structure:()=>pL});function J0(e){return this.lookupTypeNonSC(1)===1&&cL.has(this.lookupTypeNonSC(2))?this.Feature(e):this.FeatureRange(e)}function kd(e="media"){let t=this.createList();e: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(()=>dL[e].call(this,e),()=>null);n||(n=this.parseWithFallback(()=>{this.eat(21);let r=this.Condition(e);return this.eat(22),r},()=>this.GeneralEnclosed(e))),t.push(n);break}case 2:{let n=this.parseWithFallback(()=>this.FeatureFunction(e),()=>null);n||(n=this.GeneralEnclosed(e)),t.push(n);break}default:break e}return t.isEmpty&&this.error("Condition is expected"),{type:"Condition",loc:this.getLocationFromList(t),kind:e,children:t}}function gL(e){e.children.forEach(t=>{t.type==="Condition"?(this.token(21,"("),this.node(t),this.token(22,")")):this.node(t)})}var cL,uL,pL,dL,Td=$(()=>{"use strict";cL=new Set([16,22,0]),uL="Condition",pL={kind:String,children:[["Identifier","Feature","FeatureFunction","FeatureRange","SupportsDeclaration"]]};dL={media:J0,container:J0,supports(){return this.SupportsDeclaration()}}});var Fd={};ye(Fd,{generate:()=>TL,name:()=>vL,parse:()=>Id,structure:()=>CL,walkContext:()=>kL});function bL(){return this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!0)}function SL(){return this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!1)}function wL(){let e=this.tokenIndex,t=this.Value();return t.type!=="Raw"&&this.eof===!1&&this.tokenType!==17&&this.isDelim(eS)===!1&&this.isBalanceEdge(e)===!1&&this.error(),t}function Id(){let e=this.tokenStart,t=this.tokenIndex,n=IL.call(this),r=Ll(n),o=r?this.parseCustomProperty:this.parseValue,i=r?SL:bL,s=!1,a;this.skipSC(),this.eat(16);let u=this.tokenIndex;if(r||this.skipSC(),o?a=this.parseWithFallback(wL,i):a=i.call(this,this.tokenIndex),r&&a.type==="Value"&&a.children.isEmpty){for(let c=u-this.tokenIndex;c<=0;c++)if(this.lookupType(c)===13){a.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}}return this.isDelim(eS)&&(s=FL.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:s,property:n,value:a}}function TL(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 IL(){let e=this.tokenStart;if(this.tokenType===9)switch(this.charCodeAt(this.tokenStart)){case xL:case mL:case yL:case fL:case hL:this.next();break;case Z0:this.next(),this.isDelim(Z0)&&this.next();break}return this.tokenType===4?this.eat(4):this.eat(1),this.substrToCursor(e)}function FL(){this.eat(9),this.skipSC();let e=this.consume(1);return e==="important"?!0:e}var eS,fL,mL,hL,xL,yL,Z0,vL,kL,CL,Ed=$(()=>{"use strict";Ml();eS=33,fL=35,mL=36,hL=38,xL=42,yL=43,Z0=47;vL="Declaration",kL="declaration",CL={important:[Boolean,String],property:String,value:["Value","Raw"]}});var Ld={};ye(Ld,{generate:()=>LL,name:()=>AL,parse:()=>Pd,structure:()=>PL});function Ad(){return this.Raw(this.consumeUntilSemicolonIncluded,!0)}function Pd(){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),Ad));break;default:this.isDelim(EL)?e.push(this.parseWithFallback(this.Rule,Ad)):e.push(this.parseWithFallback(this.Declaration,Ad))}return{type:"DeclarationList",loc:this.getLocationFromList(e),children:e}}function LL(e){this.children(e,t=>{t.type==="Declaration"&&this.token(17,";")})}var EL,AL,PL,Md=$(()=>{"use strict";EL=38;AL="DeclarationList",PL={children:[["Declaration","Atrule","Rule"]]}});var Dd={};ye(Dd,{generate:()=>DL,name:()=>ML,parse:()=>Bd,structure:()=>BL});function Bd(){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 DL(e){this.token(12,e.value+e.unit)}var ML,BL,Rd=$(()=>{"use strict";ML="Dimension",BL={value:String,unit:String}});var Nd={};ye(Nd,{generate:()=>OL,name:()=>zL,parse:()=>zd,structure:()=>NL});function zd(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:this.lookupNonWSType(1)===9?r=this.Ratio():r=this.Number();break;case 12:r=this.Dimension();break;case 1:r=this.Identifier();break;case 2:r=this.parseWithFallback(()=>{let o=this.Function(this.readSequence,this.scope.Value);return this.skipSC(),this.isDelim(RL)&&this.error(),o},()=>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 OL(e){this.token(21,"("),this.token(1,e.name),e.value!==null&&(this.token(16,":"),this.node(e.value)),this.token(22,")")}var RL,zL,NL,Od=$(()=>{"use strict";RL=47,zL="Feature",NL={kind:String,name:String,value:["Identifier","Number","Dimension","Ratio","Function",null]}});var $d={};ye($d,{generate:()=>jL,name:()=>_L,parse:()=>_d,structure:()=>$L});function UL(e,t){let r=(this.features[e]||{})[t];return typeof r!="function"&&this.error(`Unknown feature ${t}()`),r}function _d(e="unknown"){let t=this.tokenStart,n=this.consumeFunctionName(),r=UL.call(this,e,n.toLowerCase());this.skipSC();let o=this.parseWithFallback(()=>{let i=this.tokenIndex,s=r.call(this);return this.eof===!1&&this.isBalanceEdge(i)===!1&&this.error(),s},()=>this.Raw(null,!1));return this.eof||this.eat(22),{type:"FeatureFunction",loc:this.getLocation(t,this.tokenStart),kind:e,feature:n,value:o}}function jL(e){this.token(2,e.feature+"("),this.node(e.value),this.token(22,")")}var _L,$L,Ud=$(()=>{"use strict";_L="FeatureFunction",$L={kind:String,feature:String,value:["Declaration","Selector"]}});var Wd={};ye(Wd,{generate:()=>qL,name:()=>VL,parse:()=>Hd,structure:()=>GL});function jd(){switch(this.skipSC(),this.tokenType){case 10:return this.isDelim(tS,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(tS)&&this.error(),e},()=>this.Ratio());default:this.error("Number, dimension, ratio or identifier is expected")}}function rS(e){if(this.skipSC(),this.isDelim(HL)||this.isDelim(WL)){let t=this.source[this.tokenStart];return this.next(),this.isDelim(nS)?(this.next(),t+"="):t}if(this.isDelim(nS))return"=";this.error(`Expected ${e?'":", ':""}"<", ">", "=" or ")"`)}function Hd(e="unknown"){let t=this.tokenStart;this.skipSC(),this.eat(21);let n=jd.call(this),r=rS.call(this,n.type==="Identifier"),o=jd.call(this),i=null,s=null;return this.lookupNonWSType(0)!==22&&(i=rS.call(this),s=jd.call(this)),this.skipSC(),this.eat(22),{type:"FeatureRange",loc:this.getLocation(t,this.tokenStart),kind:e,left:n,leftComparison:r,middle:o,rightComparison:i,right:s}}function qL(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,")")}var tS,HL,nS,WL,VL,GL,Vd=$(()=>{"use strict";tS=47,HL=60,nS=61,WL=62,VL="FeatureRange",GL={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]}});var qd={};ye(qd,{generate:()=>QL,name:()=>YL,parse:()=>Gd,structure:()=>XL,walkContext:()=>KL});function Gd(e,t){let n=this.tokenStart,r=this.consumeFunctionName(),o=r.toLowerCase(),i;return i=t.hasOwnProperty(o)?t[o].call(this,t):e.call(this,t),this.eof||this.eat(22),{type:"Function",loc:this.getLocation(n,this.tokenStart),name:r,children:i}}function QL(e){this.token(2,e.name+"("),this.children(e),this.token(22,")")}var YL,KL,XL,Yd=$(()=>{"use strict";YL="Function",KL="function",XL={name:String,children:[[]]}});var Xd={};ye(Xd,{generate:()=>eM,name:()=>JL,parse:()=>Kd,structure:()=>ZL});function Kd(e){let t=this.tokenStart,n=null;this.tokenType===2?n=this.consumeFunctionName():this.eat(21);let r=this.parseWithFallback(()=>{let o=this.tokenIndex,i=this.readSequence(this.scope.Value);return this.eof===!1&&this.isBalanceEdge(o)===!1&&this.error(),i},()=>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 eM(e){e.function?this.token(2,e.function+"("):this.token(21,"("),this.children(e),this.token(22,")")}var JL,ZL,Qd=$(()=>{"use strict";JL="GeneralEnclosed",ZL={kind:String,function:[String,null],children:[[]]}});var Zd={};ye(Zd,{generate:()=>oM,name:()=>nM,parse:()=>Jd,structure:()=>rM,xxx:()=>tM});function Jd(){let e=this.tokenStart;return this.eat(4),{type:"Hash",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e+1)}}function oM(e){this.token(4,"#"+e.value)}var tM,nM,rM,eg=$(()=>{"use strict";tM="XXX",nM="Hash",rM={value:String}});var ng={};ye(ng,{generate:()=>aM,name:()=>iM,parse:()=>tg,structure:()=>sM});function tg(){return{type:"Identifier",loc:this.getLocation(this.tokenStart,this.tokenEnd),name:this.consume(1)}}function aM(e){this.token(1,e.name)}var iM,sM,rg=$(()=>{"use strict";iM="Identifier",sM={name:String}});var ig={};ye(ig,{generate:()=>uM,name:()=>lM,parse:()=>og,structure:()=>cM});function og(){let e=this.tokenStart;return this.eat(4),{type:"IdSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e+1)}}function uM(e){this.token(9,"#"+e.name)}var lM,cM,sg=$(()=>{"use strict";lM="IdSelector",cM={name:String}});var lg={};ye(lg,{generate:()=>fM,name:()=>dM,parse:()=>ag,structure:()=>gM});function ag(){let e=this.tokenStart,t=this.consume(1);for(;this.isDelim(pM);)this.eat(9),t+="."+this.consume(1);return{type:"Layer",loc:this.getLocation(e,this.tokenStart),name:t}}function fM(e){this.tokenize(e.name)}var pM,dM,gM,cg=$(()=>{"use strict";pM=46,dM="Layer",gM={name:String}});var pg={};ye(pg,{generate:()=>xM,name:()=>mM,parse:()=>ug,structure:()=>hM});function ug(){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 xM(e){this.children(e,()=>this.token(18,","))}var mM,hM,dg=$(()=>{"use strict";mM="LayerList",hM={children:[["Layer"]]}});var fg={};ye(fg,{generate:()=>SM,name:()=>yM,parse:()=>gg,structure:()=>bM});function gg(){let e=this.tokenStart,t=null,n=null,r=null;if(this.skipSC(),this.tokenType===1&&this.lookupTypeNonSC(1)!==21){let o=this.consume(1),i=o.toLowerCase();switch(i==="not"||i==="only"?(this.skipSC(),t=i,n=this.consume(1)):n=o,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 SM(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)}var yM,bM,mg=$(()=>{"use strict";yM="MediaQuery",bM={modifier:[String,null],mediaType:[String,null],condition:["Condition",null]}});var xg={};ye(xg,{generate:()=>kM,name:()=>wM,parse:()=>hg,structure:()=>vM});function hg(){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 kM(e){this.children(e,()=>this.token(18,","))}var wM,vM,yg=$(()=>{"use strict";wM="MediaQueryList",vM={children:[["MediaQuery"]]}});var Sg={};ye(Sg,{generate:()=>FM,name:()=>TM,parse:()=>bg,structure:()=>IM});function bg(){let e=this.tokenStart;return this.eatDelim(CM),{type:"NestingSelector",loc:this.getLocation(e,this.tokenStart)}}function FM(){this.token(9,"&")}var CM,TM,IM,wg=$(()=>{"use strict";CM=38,TM="NestingSelector",IM={}});var kg={};ye(kg,{generate:()=>PM,name:()=>EM,parse:()=>vg,structure:()=>AM});function vg(){this.skipSC();let e=this.tokenStart,t=e,n=null,r;return this.lookupValue(0,"odd")||this.lookupValue(0,"even")?r=this.Identifier():r=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 PM(e){this.node(e.nth),e.selector!==null&&(this.token(1,"of"),this.node(e.selector))}var EM,AM,Cg=$(()=>{"use strict";EM="Nth",AM={nth:["AnPlusB","Identifier"],selector:["SelectorList",null]}});var Ig={};ye(Ig,{generate:()=>BM,name:()=>LM,parse:()=>Tg,structure:()=>MM});function Tg(){return{type:"Number",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consume(10)}}function BM(e){this.token(10,e.value)}var LM,MM,Fg=$(()=>{"use strict";LM="Number",MM={value:String}});var Ag={};ye(Ag,{generate:()=>zM,name:()=>DM,parse:()=>Eg,structure:()=>RM});function Eg(){let e=this.tokenStart;return this.next(),{type:"Operator",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function zM(e){this.tokenize(e.value)}var DM,RM,Pg=$(()=>{"use strict";DM="Operator",RM={value:String}});var Mg={};ye(Mg,{generate:()=>_M,name:()=>NM,parse:()=>Lg,structure:()=>OM});function Lg(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 _M(e){this.token(21,"("),this.children(e),this.token(22,")")}var NM,OM,Bg=$(()=>{"use strict";NM="Parentheses",OM={children:[[]]}});var Rg={};ye(Rg,{generate:()=>jM,name:()=>$M,parse:()=>Dg,structure:()=>UM});function Dg(){return{type:"Percentage",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consumeNumber(11)}}function jM(e){this.token(11,e.value+"%")}var $M,UM,zg=$(()=>{"use strict";$M="Percentage",UM={value:String}});var Og={};ye(Og,{generate:()=>GM,name:()=>HM,parse:()=>Ng,structure:()=>VM,walkContext:()=>WM});function Ng(){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 GM(e){this.token(16,":"),e.children===null?this.token(1,e.name):(this.token(2,e.name+"("),this.children(e),this.token(22,")"))}var HM,WM,VM,_g=$(()=>{"use strict";HM="PseudoClassSelector",WM="function",VM={name:String,children:[["Raw"],null]}});var Ug={};ye(Ug,{generate:()=>XM,name:()=>qM,parse:()=>$g,structure:()=>KM,walkContext:()=>YM});function $g(){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 XM(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,")"))}var qM,YM,KM,jg=$(()=>{"use strict";qM="PseudoElementSelector",YM="function",KM={name:String,children:[["Raw"],null]}});var Wg={};ye(Wg,{generate:()=>ZM,name:()=>QM,parse:()=>Hg,structure:()=>JM});function iS(){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")}}function Hg(){let e=this.tokenStart,t=iS.call(this),n=null;return this.skipSC(),this.isDelim(oS)&&(this.eatDelim(oS),n=iS.call(this)),{type:"Ratio",loc:this.getLocation(e,this.tokenStart),left:t,right:n}}function ZM(e){this.node(e.left),this.token(9,"/"),e.right?this.node(e.right):this.node(10,1)}var oS,QM,JM,Vg=$(()=>{"use strict";oS=47;QM="Ratio",JM={left:["Number","Function"],right:["Number","Function",null]}});var qg={};ye(qg,{generate:()=>rB,name:()=>tB,parse:()=>Gg,structure:()=>nB});function eB(){return this.tokenIndex>0&&this.lookupType(-1)===13?this.tokenIndex>1?this.getTokenStart(this.tokenIndex-1):this.firstCharOffset:this.tokenStart}function Gg(e,t){let n=this.getTokenStart(this.tokenIndex),r;return this.skipUntilBalanced(this.tokenIndex,e||this.consumeUntilBalanceEnd),t&&this.tokenStart>n?r=eB.call(this):r=this.tokenStart,{type:"Raw",loc:this.getLocation(n,r),value:this.substring(n,r)}}function rB(e){this.tokenize(e.value)}var tB,nB,Yg=$(()=>{"use strict";tB="Raw",nB={value:String}});var Xg={};ye(Xg,{generate:()=>lB,name:()=>iB,parse:()=>Kg,structure:()=>aB,walkContext:()=>sB});function sS(){return this.Raw(this.consumeUntilLeftCurlyBracket,!0)}function oB(){let e=this.SelectorList();return e.type!=="Raw"&&this.eof===!1&&this.tokenType!==23&&this.error(),e}function Kg(){let e=this.tokenIndex,t=this.tokenStart,n,r;return this.parseRulePrelude?n=this.parseWithFallback(oB,sS):n=sS.call(this,e),r=this.Block(!0),{type:"Rule",loc:this.getLocation(t,this.tokenStart),prelude:n,block:r}}function lB(e){this.node(e.prelude),this.node(e.block)}var iB,sB,aB,Qg=$(()=>{"use strict";iB="Rule",sB="rule",aB={prelude:["SelectorList","Raw"],block:["Block"]}});var Zg={};ye(Zg,{generate:()=>pB,name:()=>cB,parse:()=>Jg,structure:()=>uB});function Jg(){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 pB(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,")"))}var cB,uB,ef=$(()=>{"use strict";cB="Scope",uB={root:["SelectorList","Raw",null],limit:["SelectorList","Raw",null]}});var nf={};ye(nf,{generate:()=>fB,name:()=>dB,parse:()=>tf,structure:()=>gB});function tf(){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 fB(e){this.children(e)}var dB,gB,rf=$(()=>{"use strict";dB="Selector",gB={children:[["TypeSelector","IdSelector","ClassSelector","AttributeSelector","PseudoClassSelector","PseudoElementSelector","Combinator"]]}});var sf={};ye(sf,{generate:()=>yB,name:()=>mB,parse:()=>of,structure:()=>xB,walkContext:()=>hB});function of(){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 yB(e){this.children(e,()=>this.token(18,","))}var mB,hB,xB,af=$(()=>{"use strict";mB="SelectorList",hB="selector",xB={children:[["Selector","Raw"]]}});function Gl(e){let t=e.length,n=e.charCodeAt(0),r=n===aS||n===lS?1:0,o=r===1&&t>1&&e.charCodeAt(t-1)===n?t-2:t-1,i="";for(let s=r;s<=o;s++){let a=e.charCodeAt(s);if(a===lf){if(s===o){s!==t-1&&(i=e.substr(s+1));break}if(a=e.charCodeAt(++s),Nn(lf,a)){let u=s-1,c=eo(e,u);s=c-1,i+=ml(e.substring(u+1,c))}else a===13&&e.charCodeAt(s+1)===10&&s++}else i+=e[s]}return i}function cS(e,t){let n=t?"'":'"',r=t?lS:aS,o="",i=!1;for(let s=0;s<e.length;s++){let a=e.charCodeAt(s);if(a===0){o+="\uFFFD";continue}if(a<=31||a===127){o+="\\"+a.toString(16),i=!0;continue}a===r||a===lf?(o+="\\"+e.charAt(s),i=!1):(i&&(On(a)||_r(a))&&(o+=" "),o+=e.charAt(s),i=!1)}return n+o+n}var lf,aS,lS,ql=$(()=>{"use strict";lr();lf=92,aS=34,lS=39});var uf={};ye(uf,{generate:()=>wB,name:()=>bB,parse:()=>cf,structure:()=>SB});function cf(){return{type:"String",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:Gl(this.consume(5))}}function wB(e){this.token(5,cS(e.value))}var bB,SB,pf=$(()=>{"use strict";ql();bB="String",SB={value:String}});var gf={};ye(gf,{generate:()=>IB,name:()=>kB,parse:()=>df,structure:()=>TB,walkContext:()=>CB});function pS(){return this.Raw(null,!1)}function df(){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)!==vB){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,pS);break;default:n=this.parseWithFallback(this.Rule,pS)}t.push(n)}return{type:"StyleSheet",loc:this.getLocation(e,this.tokenStart),children:t}}function IB(e){this.children(e)}var vB,kB,CB,TB,ff=$(()=>{"use strict";vB=33;kB="StyleSheet",CB="stylesheet",TB={children:[["Comment","CDO","CDC","Atrule","Rule","Raw"]]}});var hf={};ye(hf,{generate:()=>AB,name:()=>FB,parse:()=>mf,structure:()=>EB});function mf(){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 AB(e){this.token(21,"("),this.node(e.declaration),this.token(22,")")}var FB,EB,xf=$(()=>{"use strict";FB="SupportsDeclaration",EB={declaration:"Declaration"}});var Sf={};ye(Sf,{generate:()=>BB,name:()=>LB,parse:()=>bf,structure:()=>MB});function yf(){this.tokenType!==1&&this.isDelim(PB)===!1&&this.error("Identifier or asterisk is expected"),this.next()}function bf(){let e=this.tokenStart;return this.isDelim(dS)?(this.next(),yf.call(this)):(yf.call(this),this.isDelim(dS)&&(this.next(),yf.call(this))),{type:"TypeSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function BB(e){this.tokenize(e.name)}var PB,dS,LB,MB,wf=$(()=>{"use strict";PB=42,dS=124;LB="TypeSelector",MB={name:String}});var Cf={};ye(Cf,{generate:()=>OB,name:()=>zB,parse:()=>kf,structure:()=>NB});function Hs(e,t){let n=0;for(let r=this.tokenStart+e;r<this.tokenEnd;r++){let o=this.charCodeAt(r);if(o===fS&&t&&n!==0)return Hs.call(this,e+n+1,!1),-1;On(o)||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 Yl(e){let t=0;for(;this.isDelim(vf);)++t>e&&this.error("Too many question marks"),this.next()}function DB(e){this.charCodeAt(this.tokenStart)!==e&&this.error((e===gS?"Plus sign":"Hyphen minus")+" is expected")}function RB(){let e=0;switch(this.tokenType){case 10:if(e=Hs.call(this,1,!0),this.isDelim(vf)){Yl.call(this,6-e);break}if(this.tokenType===12||this.tokenType===10){DB.call(this,fS),Hs.call(this,1,!1);break}break;case 12:e=Hs.call(this,1,!0),e>0&&Yl.call(this,6-e);break;default:if(this.eatDelim(gS),this.tokenType===1){e=Hs.call(this,0,!0),e>0&&Yl.call(this,6-e);break}if(this.isDelim(vf)){this.next(),Yl.call(this,5);break}this.error("Hex digit or question mark is expected")}}function kf(){let e=this.tokenStart;return this.eatIdent("u"),RB.call(this),{type:"UnicodeRange",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function OB(e){this.tokenize(e.value)}var gS,fS,vf,zB,NB,Tf=$(()=>{"use strict";lr();gS=43,fS=45,vf=63;zB="UnicodeRange",NB={value:String}});function hS(e){let t=e.length,n=4,r=e.charCodeAt(t-1)===mS?t-2:t-1,o="";for(;n<r&&_r(e.charCodeAt(n));)n++;for(;n<r&&_r(e.charCodeAt(r));)r--;for(let i=n;i<=r;i++){let s=e.charCodeAt(i);if(s===If){if(i===r){i!==t-1&&(o=e.substr(i+1));break}if(s=e.charCodeAt(++i),Nn(If,s)){let a=i-1,u=eo(e,a);i=u-1,o+=ml(e.substring(a+1,u))}else s===13&&e.charCodeAt(i+1)===10&&i++}else o+=e[i]}return o}function xS(e){let t="",n=!1;for(let r=0;r<e.length;r++){let o=e.charCodeAt(r);if(o===0){t+="\uFFFD";continue}if(o<=31||o===127){t+="\\"+o.toString(16),n=!0;continue}o===_B||o===If||o===$B||o===UB||o===jB||o===mS?(t+="\\"+e.charAt(r),n=!1):(n&&On(o)&&(t+=" "),t+=e.charAt(r),n=!1)}return"url("+t+")"}var _B,If,$B,UB,jB,mS,Ff=$(()=>{"use strict";lr();_B=32,If=92,$B=34,UB=39,jB=40,mS=41});var Af={};ye(Af,{generate:()=>VB,name:()=>HB,parse:()=>Ef,structure:()=>WB});function Ef(){let e=this.tokenStart,t;switch(this.tokenType){case 7:t=hS(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=Gl(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 VB(e){this.token(7,xS(e.value))}var HB,WB,Pf=$(()=>{"use strict";Ff();ql();HB="Url",WB={value:String}});var Mf={};ye(Mf,{generate:()=>YB,name:()=>GB,parse:()=>Lf,structure:()=>qB});function Lf(){let e=this.tokenStart,t=this.readSequence(this.scope.Value);return{type:"Value",loc:this.getLocation(e,this.tokenStart),children:t}}function YB(e){this.children(e)}var GB,qB,Bf=$(()=>{"use strict";GB="Value",qB={children:[[]]}});var Rf={};ye(Rf,{generate:()=>JB,name:()=>XB,parse:()=>Df,structure:()=>QB});function Df(){return this.eat(13),KB}function JB(e){this.token(13,e.value)}var KB,XB,QB,zf=$(()=>{"use strict";KB=Object.freeze({type:"WhiteSpace",loc:null,value:" "}),XB="WhiteSpace",QB={value:String}});var Ws={};ye(Ws,{AnPlusB:()=>Wp,Atrule:()=>qp,AtrulePrelude:()=>Xp,AttributeSelector:()=>ed,Block:()=>rd,Brackets:()=>sd,CDC:()=>cd,CDO:()=>dd,ClassSelector:()=>md,Combinator:()=>yd,Comment:()=>wd,Condition:()=>Cd,Declaration:()=>Fd,DeclarationList:()=>Ld,Dimension:()=>Dd,Feature:()=>Nd,FeatureFunction:()=>$d,FeatureRange:()=>Wd,Function:()=>qd,GeneralEnclosed:()=>Xd,Hash:()=>Zd,IdSelector:()=>ig,Identifier:()=>ng,Layer:()=>lg,LayerList:()=>pg,MediaQuery:()=>fg,MediaQueryList:()=>xg,NestingSelector:()=>Sg,Nth:()=>kg,Number:()=>Ig,Operator:()=>Ag,Parentheses:()=>Mg,Percentage:()=>Rg,PseudoClassSelector:()=>Og,PseudoElementSelector:()=>Ug,Ratio:()=>Wg,Raw:()=>qg,Rule:()=>Xg,Scope:()=>Zg,Selector:()=>nf,SelectorList:()=>sf,String:()=>uf,StyleSheet:()=>gf,SupportsDeclaration:()=>hf,TypeSelector:()=>Sf,UnicodeRange:()=>Cf,Url:()=>Af,Value:()=>Mf,WhiteSpace:()=>Rf});var Nf=$(()=>{"use strict";Vp();Yp();Qp();td();od();ad();ud();gd();hd();bd();vd();Td();Ed();Md();Rd();Od();Ud();Vd();Yd();Qd();eg();rg();sg();cg();dg();mg();yg();wg();Cg();Fg();Pg();Bg();zg();_g();jg();Vg();Yg();Qg();ef();rf();af();pf();ff();xf();wf();Tf();Pf();Bf();zf()});var bS,SS=$(()=>{"use strict";Bl();V0();Nf();bS={generic:!0,cssWideKeywords:Mi,...W0,node:Ws}});function Vs(e){switch(this.tokenType){case 4:return this.Hash();case 18:return this.Operator();case 21:return this.Parentheses(this.readSequence,e.recognizer);case 19:return this.Brackets(this.readSequence,e.recognizer);case 5:return this.String();case 12:return this.Dimension();case 11:return this.Percentage();case 10:return this.Number();case 2:return this.cmpStr(this.tokenStart,this.tokenEnd,"url(")?this.Url():this.Function(this.readSequence,e.recognizer);case 7:return this.Url();case 1:return this.cmpChar(this.tokenStart,rD)&&this.cmpChar(this.tokenStart+1,wS)?this.UnicodeRange():this.Identifier();case 9:{let t=this.charCodeAt(this.tokenStart);if(t===nD||t===eD||t===wS||t===tD)return this.Operator();t===ZB&&this.error("Hex or identifier is expected",this.tokenStart+1);break}}}var ZB,eD,wS,tD,nD,rD,Of=$(()=>{"use strict";ZB=35,eD=42,wS=43,tD=45,nD=47,rD=117});var vS,kS=$(()=>{"use strict";Of();vS={getNode:Vs}});function dD(e,t){t.last!==null&&t.last.type!=="Combinator"&&e!==null&&e.type!=="Combinator"&&t.push({type:"Combinator",loc:null,name:" "})}function gD(){switch(this.tokenType){case 19:return this.AttributeSelector();case 4:return this.IdSelector();case 16:return this.lookupType(1)===16?this.PseudoElementSelector():this.PseudoClassSelector();case 1:return this.TypeSelector();case 10:case 11:return this.Percentage();case 12:this.charCodeAt(this.tokenStart)===CS&&this.error("Identifier is expected",this.tokenStart+1);break;case 9:{switch(this.charCodeAt(this.tokenStart)){case aD:case cD:case pD:case lD:return this.Combinator();case CS:return this.ClassSelector();case sD:case uD:return this.TypeSelector();case oD:return this.IdSelector();case iD:return this.NestingSelector()}break}}}var oD,iD,sD,aD,lD,CS,cD,uD,pD,TS,IS=$(()=>{"use strict";oD=35,iD=38,sD=42,aD=43,lD=47,CS=46,cD=62,uD=124,pD=126;TS={onWhiteSpace:dD,getNode:gD}});function FS(){return this.createSingleNodeList(this.Raw(null,!1))}var ES=$(()=>{"use strict"});function AS(){let e=this.createList();if(this.skipSC(),e.push(this.Identifier()),this.skipSC(),this.tokenType===18){e.push(this.Operator());let t=this.tokenIndex,n=this.parseCustomProperty?this.Value(null):this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!1);if(n.type==="Value"&&n.children.isEmpty){for(let r=t-this.tokenIndex;r<=0;r++)if(this.lookupType(r)===13){n.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}}e.push(n)}return e}var PS=$(()=>{"use strict"});function LS(e){return e!==null&&e.type==="Operator"&&(e.value[e.value.length-1]==="-"||e.value[e.value.length-1]==="+")}var MS,BS=$(()=>{"use strict";Of();ES();PS();MS={getNode:Vs,onWhiteSpace(e,t){LS(e)&&(e.value=" "+e.value),LS(t.last)&&(t.last.value+=" ")},expression:FS,var:AS}});var _f={};ye(_f,{AtrulePrelude:()=>vS,Selector:()=>TS,Value:()=>MS});var DS=$(()=>{"use strict";kS();IS();BS()});var fD,RS,zS=$(()=>{"use strict";fD=new Set(["none","and","not","or"]),RS={parse:{prelude(){let e=this.createList();if(this.tokenType===1){let t=this.substring(this.tokenStart,this.tokenEnd);fD.has(t.toLowerCase())||e.push(this.Identifier())}return e.push(this.Condition("container")),e},block(e=!1){return this.Block(e)}}}});var NS,OS=$(()=>{"use strict";NS={parse:{prelude:null,block(){return this.Block(!0)}}}});function $f(e,t){return this.parseWithFallback(()=>{try{return e.call(this)}finally{this.skipSC(),this.lookupNonWSType(0)!==22&&this.error()}},t||(()=>this.Raw(null,!0)))}var _S,$S,US=$(()=>{"use strict";_S={layer(){this.skipSC();let e=this.createList(),t=$f.call(this,this.Layer);return(t.type!=="Raw"||t.value!=="")&&e.push(t),e},supports(){this.skipSC();let e=this.createList(),t=$f.call(this,this.Declaration,()=>$f.call(this,()=>this.Condition("supports")));return(t.type!=="Raw"||t.value!=="")&&e.push(t),e}},$S={parse:{prelude(){let e=this.createList();switch(this.tokenType){case 5:e.push(this.String());break;case 7:case 2:e.push(this.Url());break;default:this.error("String or url() is expected")}return this.skipSC(),this.tokenType===1&&this.cmpStr(this.tokenStart,this.tokenEnd,"layer")?e.push(this.Identifier()):this.tokenType===2&&this.cmpStr(this.tokenStart,this.tokenEnd,"layer(")&&e.push(this.Function(null,_S)),this.skipSC(),this.tokenType===2&&this.cmpStr(this.tokenStart,this.tokenEnd,"supports(")&&e.push(this.Function(null,_S)),(this.lookupNonWSType(0)===1||this.lookupNonWSType(0)===21)&&e.push(this.MediaQueryList()),e},block:null}}});var jS,HS=$(()=>{"use strict";jS={parse:{prelude(){return this.createSingleNodeList(this.LayerList())},block(){return this.Block(!1)}}}});var WS,VS=$(()=>{"use strict";WS={parse:{prelude(){return this.createSingleNodeList(this.MediaQueryList())},block(e=!1){return this.Block(e)}}}});var GS,qS=$(()=>{"use strict";GS={parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}}});var YS,KS=$(()=>{"use strict";YS={parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}}});var XS,QS=$(()=>{"use strict";XS={parse:{prelude(){return this.createSingleNodeList(this.Scope())},block(e=!1){return this.Block(e)}}}});var JS,ZS=$(()=>{"use strict";JS={parse:{prelude:null,block(e=!1){return this.Block(e)}}}});var ew,tw=$(()=>{"use strict";ew={parse:{prelude(){return this.createSingleNodeList(this.Condition("supports"))},block(e=!1){return this.Block(e)}}}});var nw,rw=$(()=>{"use strict";zS();OS();US();HS();VS();qS();KS();QS();ZS();tw();nw={container:RS,"font-face":NS,import:$S,layer:jS,media:WS,nest:GS,page:YS,scope:XS,"starting-style":JS,supports:ew}});function ow(){let e=this.createList();this.skipSC();e:for(;!this.eof;){switch(this.tokenType){case 1:e.push(this.Identifier());break;case 5:e.push(this.String());break;case 18:e.push(this.Operator());break;case 22:break e;default:this.error("Identifier, string or comma is expected")}this.skipSC()}return e}var iw=$(()=>{"use strict"});var ri,Uf,mD,hD,Kl,sw,aw=$(()=>{"use strict";iw();ri={parse(){return this.createSingleNodeList(this.SelectorList())}},Uf={parse(){return this.createSingleNodeList(this.Selector())}},mD={parse(){return this.createSingleNodeList(this.Identifier())}},hD={parse:ow},Kl={parse(){return this.createSingleNodeList(this.Nth())}},sw={dir:mD,has:ri,lang:hD,matches:ri,is:ri,"-moz-any":ri,"-webkit-any":ri,where:ri,not:ri,"nth-child":Kl,"nth-last-child":Kl,"nth-last-of-type":Kl,"nth-of-type":Kl,slotted:Uf,host:Uf,"host-context":Uf}});var jf={};ye(jf,{AnPlusB:()=>Hp,Atrule:()=>Gp,AtrulePrelude:()=>Kp,AttributeSelector:()=>Zp,Block:()=>nd,Brackets:()=>id,CDC:()=>ld,CDO:()=>pd,ClassSelector:()=>fd,Combinator:()=>xd,Comment:()=>Sd,Condition:()=>kd,Declaration:()=>Id,DeclarationList:()=>Pd,Dimension:()=>Bd,Feature:()=>zd,FeatureFunction:()=>_d,FeatureRange:()=>Hd,Function:()=>Gd,GeneralEnclosed:()=>Kd,Hash:()=>Jd,IdSelector:()=>og,Identifier:()=>tg,Layer:()=>ag,LayerList:()=>ug,MediaQuery:()=>gg,MediaQueryList:()=>hg,NestingSelector:()=>bg,Nth:()=>vg,Number:()=>Tg,Operator:()=>Eg,Parentheses:()=>Lg,Percentage:()=>Dg,PseudoClassSelector:()=>Ng,PseudoElementSelector:()=>$g,Ratio:()=>Hg,Raw:()=>Gg,Rule:()=>Kg,Scope:()=>Jg,Selector:()=>tf,SelectorList:()=>of,String:()=>cf,StyleSheet:()=>df,SupportsDeclaration:()=>mf,TypeSelector:()=>bf,UnicodeRange:()=>kf,Url:()=>Ef,Value:()=>Lf,WhiteSpace:()=>Df});var lw=$(()=>{"use strict";Vp();Yp();Qp();td();od();ad();ud();gd();hd();bd();vd();Td();Ed();Md();Rd();Od();Ud();Vd();Yd();Qd();eg();rg();sg();cg();dg();mg();yg();wg();Cg();Fg();Pg();Bg();zg();_g();jg();Vg();Yg();Qg();ef();rf();af();pf();ff();xf();wf();Tf();Pf();Bf();zf()});var cw,uw=$(()=>{"use strict";DS();rw();aw();lw();cw={parseContext:{default:"StyleSheet",stylesheet:"StyleSheet",atrule:"Atrule",atrulePrelude(e){return this.AtrulePrelude(e.atrule?String(e.atrule):null)},mediaQueryList:"MediaQueryList",mediaQuery:"MediaQuery",condition(e){return this.Condition(e.kind)},rule:"Rule",selectorList:"SelectorList",selector:"Selector",block(){return this.Block(!0)},declarationList:"DeclarationList",declaration:"Declaration",value:"Value"},features:{supports:{selector(){return this.Selector()}},container:{style(){return this.Declaration()}}},scope:_f,atrule:nw,pseudo:sw,node:jf}});var pw,dw=$(()=>{"use strict";Nf();pw={node:Ws}});var gw,fw=$(()=>{"use strict";H0();SS();uw();dw();gw=j0({...bS,...cw,...pw})});var mw=$(()=>{"use strict"});var hw=$(()=>{"use strict"});var oK,xw,iK,sK,aK,yw,lK,cK,uK,pK,dK,gK,bw=$(()=>{"use strict";fw();mw();Ap();Ml();hw();ql();Ff();({tokenize:oK,parse:xw,generate:iK,lexer:sK,createLexer:aK,walk:yw,find:lK,findLast:cK,findAll:uK,toPlainObject:pK,fromPlainObject:dK,fork:gK}=gw)});function SD(e){return e.toLowerCase().replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function ww(e){try{let t=xw(e.trim(),{context:"value"}),n=[];return yw(t,{enter(r){if(r.type==="Dimension"){let o=parseFloat(r.value);n.push(`${o}${r.unit}`)}else if(r.type==="Number"){let o=parseFloat(r.value);n.push(`${o}`)}else r.type==="Percentage"?n.push(`${parseFloat(r.value)}%`):r.type==="Identifier"?n.push(r.name.toLowerCase()):r.type==="Hash"?n.push(`#${r.value.toLowerCase()}`):r.type}}),n}catch{return[e.trim().toLowerCase()]}}function wD(e,t){let n=SD(e);if(!bD.has(n))return t;let r=ww(t);if(r.length<1||r.length>4)return t;let o=r.map(i=>i==="0"?"0px":i);return o.length===1?`${o[0]} ${o[0]} ${o[0]} ${o[0]}`:o.length===2?`${o[0]} ${o[1]} ${o[0]} ${o[1]}`:o.length===3?`${o[0]} ${o[1]} ${o[2]} ${o[1]}`:o.join(" ")}function Sw(e,t){let n=t.trim();if(!n)return"";let r=wD(e,n);return ww(r).map(i=>i==="0"?"0px":i).join(" ")}function vw(e,t,n){let r=Sw(e,t),o=Sw(e,n);return r!==""&&o!==""&&r===o}var bD,kw=$(()=>{"use strict";bw();bD=new Set(["padding","margin","border-radius","borderradius","inset","border-width","borderwidth"])});function vD(e){let t=e.toLowerCase();return t.length===4?`#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}`:t}function kD(e){let t=e.match(/rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*[\d.]+)?\s*\)/);if(!t)return null;let n=parseInt(t[1],10).toString(16).padStart(2,"0"),r=parseInt(t[2],10).toString(16).padStart(2,"0"),o=parseInt(t[3],10).toString(16).padStart(2,"0");return`#${n}${r}${o}`}function Cw(e){let t=typeof e=="string"?e:String(e??"");if(!t||t==="[object Object]")return"";let n=t.match(/rgba?\s*\(\s*\d+\s*,\s*\d+\s*,\s*\d+(?:\s*,\s*[\d.]+)?\s*\)/);if(n){let i=kD(n[0]);if(i)return i}let r=t.match(/#([0-9a-fA-F]{3,8})/);if(r)return vD(r[0]);let o=t.match(/(-?\d+\.?\d*)(px|em|rem|%|pt|vw|vh)?/g);return o&&o.length>1?o.join(" ").toLowerCase():o&&o.length===1?o[0].toLowerCase():t.toLowerCase().trim().replace(/\s+/g," ")}function oi(e,t,n){if(!e||!t)return!1;let r=String(e),o=String(t),i=r.toLowerCase(),s=o.toLowerCase(),a=i.includes("none"),u=s.includes("none");if(a!==u)return!1;let c=/\b(fill|stroke)\s*:/i,l=c.test(r),d=c.test(o);if(l!==d)return!1;let g=Cw(r),p=Cw(o);return!!(g===p||n&&vw(n,r,o))}var Hf=$(()=>{"use strict";kw()});function ED(e){let t=String(e.property||"").toLowerCase(),n=String(e.description||"").toLowerCase(),r=String(e.expected||e.suggestedValue||"").toLowerCase(),o=String(e.actual||e.currentValue||"").toLowerCase();if(t.includes("color")||t.includes("fill")||t.includes("background")||n.includes("color")||n.includes("fill"))return!0;let i=s=>/^#[0-9a-f]{3,8}$/i.test(s)||s.includes("rgb")||["white","black","red","blue","green","orange","yellow","transparent"].includes(s);return!!(i(r)||i(o)||e.relatedProperties?.some(s=>{let a=s.property?.toLowerCase()||"";return a.includes("color")||a.includes("fill")||a.includes("background")}))}function Tw(e){if(e.includes("\xD7")||/\d+px\s*x\s*\d+px/i.test(e))return!1;let t=e.match(/\d+px/g);return t?t.length>1:!1}function AD(e){let t=String(e.expected||e.suggestedValue||"").toLowerCase(),n=String(e.actual||e.currentValue||"").toLowerCase(),r=String(e.property||"").toLowerCase(),o=String(e.description||"").toLowerCase(),i=n.includes("margin")||t.includes("margin")||r==="margin",s=t.includes("gap")||o.includes("gap");return i&&s}function PD(e,t,n){if(!e||!t)return!1;let r=typeof e=="string"?e:String(e??""),o=typeof t=="string"?t:String(t??"");if(!r||!o||r==="[object Object]"||o==="[object Object]"||n&&ED(n)||Tw(r)||Tw(o)||n&&AD(n))return!1;let i=parseFloat(r),s=parseFloat(o);if(isNaN(i)||isNaN(s))return!1;let a=Math.abs(i-s);if(r.includes("px")||o.includes("px")){let u=n?.property?.toLowerCase()||"";return u==="width"||u==="height"||u.includes("width")||u.includes("height")?a<Ew:a<Fw}return r.includes("%")||o.includes("%")?a<1:!1}function LD(e){let t=`${e.description||""} ${e.title||""} ${e.suggestedFix||""}`.toLowerCase();if(FD.some(s=>t.includes(s))||!TD.some(s=>t.includes(s)))return!1;let o=e.expected||e.suggestedValue,i=e.actual||e.currentValue;return!(o&&i&&!oi(o,i,e.property))}function MD(e){let t=(e.expected!==void 0?"fill":"").toLowerCase(),n=e.actual!==void 0||e.currentValue!==void 0?"fill":"";if(!(t==="fill"||n==="fill"||e.description?.toLowerCase().includes("fill")||e.title?.toLowerCase().includes("fill")))return!1;let o=String(e.expected||e.suggestedValue||"").toLowerCase();if(!(o==="none"||o==="transparent"||o.includes("no fills")||o.includes("transparent")))return!1;let s=`${e.description||""} ${e.title||""}`.toLowerCase();return s.includes("container")||s.includes("svg ")||s.includes("<svg")||s.includes("wrapper")}function BD(e){let t=`${e.description||""} ${e.title||""}`.toLowerCase(),n=e.property?.toLowerCase()||"";if(!(t.includes("text ")||t.includes("text layer")||t.includes("text span")||t.includes("span ")||t.includes("label "))||!(n==="width"||n==="height"||n.includes("width")||n.includes("height")||t.includes("width")||t.includes("height")))return!1;let i=e.expected||e.suggestedValue||"",s=e.actual||e.currentValue||"",a=parseFloat(i),u=parseFloat(s);return isNaN(a)||isNaN(u)?!1:Math.abs(a-u)<Aw}function DD(e){let t=`${e.description||""} ${e.title||""} ${e.suggestedFix||""}`.toLowerCase(),n=String(e.expected||e.suggestedValue||"").toLowerCase(),r=String(e.actual||e.currentValue||"").toLowerCase();if(!ID.some(d=>t.includes(d)||n.includes(d)))return!1;let i=`${t} ${n} ${r}`;if(i.includes("min-width")||i.includes("max-width")||i.includes("min-height")||i.includes("max-height")||i.includes("explicit")||i.includes("constraint")||i.includes("forced"))return!1;let a=n.includes("hug")||n.includes("auto"),u=/\d+\.?\d*px/.test(r);if(!a||!u)return!1;let c=n.match(/(\d+\.?\d*)px/),l=r.match(/(\d+\.?\d*)px/);return!(c&&l&&Math.abs(parseFloat(c[1])-parseFloat(l[1]))>CD)}function RD(e){let t=String(e.expected||e.suggestedValue||"").toLowerCase(),n=String(e.actual||e.currentValue||"").toLowerCase();return(!n||!t||n.includes("see ")||t.includes("see ")||n.includes("image")||t.includes("image"))&&e.type==="visual"}function Iw(e){return typeof e!="string"?"":(e.split(",")[0]||"").replace(/['"]/g,"").replace(/[\s_-]/g,"").toLowerCase().trim()}function zD(e,t,n){if((n||"").toLowerCase().replace(/[\s_-]/g,"")!=="fontfamily")return!1;let o=Iw(e),i=Iw(t);return o.length>0&&i.length>0&&o===i}function Gs(e){if(e.programmaticallyVerified)return{dismissed:!1};let t=e.expected||e.suggestedValue,n=e.actual||e.currentValue;if(e.fixRequired===!1)return{dismissed:!0,dismissReason:"Auto-dismissed: FixRequired is false (no code change needed)",dismissedBy:"post-ai-validation"};if(oi(t,n,e.property))return{dismissed:!0,dismissReason:"Auto-dismissed: expected equals actual (identical values)",dismissedBy:"post-ai-validation"};if(zD(t,n,e.property))return{dismissed:!0,dismissReason:"Auto-dismissed: font-family naming difference (same font)",dismissedBy:"post-ai-validation"};if(e.fixRequired===!0)return{dismissed:!1};if(BD(e))return{dismissed:!0,dismissReason:`Auto-dismissed: text dimension variance (<${Aw}px) - font rendering difference, not actionable`,dismissedBy:"post-ai-validation"};if(PD(t,n,e)){let r=e.property?.toLowerCase()||"";return{dismissed:!0,dismissReason:`Auto-dismissed: negligible difference (<${r==="width"||r==="height"||r.includes("width")||r.includes("height")?Ew:Fw}px)`,dismissedBy:"post-ai-validation"}}return RD(e)?{dismissed:!0,dismissReason:"Auto-dismissed: no measurable values to compare",dismissedBy:"post-ai-validation"}:LD(e)?{dismissed:!0,dismissReason:"Auto-dismissed: no fix needed",dismissedBy:"post-ai-validation"}:DD(e)?{dismissed:!0,dismissReason:"Auto-dismissed: HUG sizing - CSS auto-sizes content without explicit dimensions",dismissedBy:"post-ai-validation"}:MD(e)?{dismissed:!0,dismissReason:"Auto-dismissed: SVG container fill - child elements use their own fills",dismissedBy:"post-ai-validation"}:{dismissed:!1}}var Fw,Ew,Aw,CD,TD,ID,FD,Pw=$(()=>{"use strict";Hf();Fw=.5,Ew=2,Aw=2,CD=5,TD=["values match","values already match","already correct","correctly implemented","implementation is correct","css matches","matches figma","identical","same value","no difference","none - ","no changes needed","no fix needed"],ID=["hug","auto (hug)","should be hug","fixed pixel values are being rendered","fixed values are being rendered"],FD=["duplicate","extra","missing","additional","removed","should not exist","does not exist","not in figma","not in storybook","renders 2","renders two","has 1","has one"]});function Wf(e){let t=e.trim().match(/^#?([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/);if(!t)return null;let n=t[1];return n.length===3||n.length===4?n=n.slice(0,3).split("").map(r=>r+r).join(""):n.length===8&&(n=n.slice(0,6)),[parseInt(n.slice(0,2),16),parseInt(n.slice(2,4),16),parseInt(n.slice(4,6),16)]}function ND(e){let t=e.trim().match(/^rgba?\(\s*([^)]+)\)$/i);if(!t)return null;let n=t[1].replace(/\//g," ").split(/[\s,]+/).filter(Boolean);if(n.length<3)return null;let r=u=>u.endsWith("%")?Math.round(parseFloat(u)/100*255):Math.round(parseFloat(u)),o=r(n[0]),i=r(n[1]),s=r(n[2]);if([o,i,s].some(u=>isNaN(u)))return null;let a=u=>Math.max(0,Math.min(255,u));return[a(o),a(i),a(s)]}function OD(e,t,n){let r=(1-Math.abs(2*n-1))*t,o=(e%360+360)%360/60,i=r*(1-Math.abs(o%2-1)),s=0,a=0,u=0;o<1?[s,a,u]=[r,i,0]:o<2?[s,a,u]=[i,r,0]:o<3?[s,a,u]=[0,r,i]:o<4?[s,a,u]=[0,i,r]:o<5?[s,a,u]=[i,0,r]:[s,a,u]=[r,0,i];let c=n-r/2;return[Math.round((s+c)*255),Math.round((a+c)*255),Math.round((u+c)*255)]}function _D(e){let t=e.trim().match(/^hsla?\(\s*([^)]+)\)$/i);if(!t)return null;let n=t[1].replace(/\//g," ").split(/[\s,]+/).filter(Boolean);if(n.length<3)return null;let r=parseFloat(n[0]),o=parseFloat(n[1]),i=parseFloat(n[2]);return[r,o,i].some(s=>isNaN(s))?null:OD(r,o/100,i/100)}function UD(e){return $D[e.trim().toLowerCase()]??null}function Lw(e){return e?Wf(e)??ND(e)??_D(e)??Vf(e)??UD(e):null}function Vf(e){let t=e.trim().match(/^color\(\s*display-p3\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)(?:\s*\/\s*[\d.]+)?\s*\)$/);if(!t)return null;let n=parseFloat(t[1]),r=parseFloat(t[2]),o=parseFloat(t[3]);if(isNaN(n)||isNaN(r)||isNaN(o))return null;let i=p=>p<=.04045?p/12.92:Math.pow((p+.055)/1.055,2.4),s=i(n),a=i(r),u=i(o),c=1.2249*s-.2247*a+0*u,l=-.042*s+1.0419*a+0*u,d=-.0197*s-.0786*a+1.0983*u,g=p=>{let h=Math.max(0,Math.min(1,p));return h<=.0031308?12.92*h:1.055*Math.pow(h,1/2.4)-.055};return[Math.round(g(c)*255),Math.round(g(l)*255),Math.round(g(d)*255)]}function Mw(e,t,n){let r=F=>{let v=F/255;return v<=.04045?v/12.92:Math.pow((v+.055)/1.055,2.4)},o=r(e),i=r(t),s=r(n),a=o*.4124564+i*.3575761+s*.1804375,u=o*.2126729+i*.7151522+s*.072175,c=o*.0193339+i*.119192+s*.9503041,l=.95047,d=1,g=1.08883,p=F=>F>.008856?Math.cbrt(F):7.787*F+16/116,h=p(a/l),S=p(u/d),T=p(c/g);return[116*S-16,500*(h-S),200*(S-T)]}function Bw(e,t){let[n,r,o]=Mw(...e),[i,s,a]=Mw(...t),u=(n+i)/2,c=Math.sqrt(r*r+o*o),l=Math.sqrt(s*s+a*a),d=(c+l)/2,g=.5*(1-Math.sqrt(Math.pow(d,7)/(Math.pow(d,7)+Math.pow(25,7)))),p=(1+g)*r,h=(1+g)*s,S=Math.sqrt(p*p+o*o),T=Math.sqrt(h*h+a*a),F=(S+T)/2,v=(Math.atan2(o,p)*180/Math.PI+360)%360,D=(Math.atan2(a,h)*180/Math.PI+360)%360,N=D-v;Math.abs(N)>180&&(N-=Math.sign(N)*360);let U=i-n,L=T-S,z=2*Math.sqrt(S*T)*Math.sin(N*Math.PI/360),m=Math.abs(v-D)>180?(v+D+360)/2:(v+D)/2,b=1-.17*Math.cos((m-30)*Math.PI/180)+.24*Math.cos(2*m*Math.PI/180)+.32*Math.cos((3*m+6)*Math.PI/180)-.2*Math.cos((4*m-63)*Math.PI/180),w=1+.015*Math.pow(u-50,2)/Math.sqrt(20+Math.pow(u-50,2)),A=1+.045*F,f=1+.015*F*b,C=-2*Math.sqrt(Math.pow(F,7)/(Math.pow(F,7)+Math.pow(25,7)))*Math.sin(60*Math.exp(-Math.pow((m-275)/25,2))*Math.PI/180);return Math.sqrt(Math.pow(U/w,2)+Math.pow(L/A,2)+Math.pow(z/f,2)+C*(L/A)*(z/f))}function Dw(e){let t=(e.property||"").toLowerCase();if(!(t.includes("color")||t==="fill"||t==="background"||t==="backgroundcolor"))return!1;let r=String(e.expected||e.suggestedValue||""),o=String(e.actual||e.currentValue||""),i=Wf(r)??Wf(o),s=Vf(r)??Vf(o);return!i||!s||r===o?!1:Bw(i,s)<5}function Rw(e){let t=String(e.expected??e.suggestedValue??""),n=String(e.actual??e.currentValue??"");if(!t||!n||t===n)return null;let r=Lw(t),o=Lw(n);return!r||!o?null:Bw(r,o)}function qs(e){let t=e.severity||"minor";if(t==="minor")return t;if(Dw(e))return"minor";let n=Rw(e);if(n!==null)return n<2?"minor":n<5&&t==="critical"?"major":t;let r=["width","height","size","dimension","dimensions","r","cx","cy"],o=["dimension","layout"],i=new Set((e.property||"").replace(/([a-z])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(Boolean)),s=(e.type||"").toLowerCase();if(!(r.some(p=>i.has(p))||o.some(p=>s===p)))return t;let u=String(e.expected||e.suggestedValue||""),c=String(e.actual||e.currentValue||""),l=parseFloat(u.replace(/[^0-9.-]/g,"")),d=parseFloat(c.replace(/[^0-9.-]/g,""));if(isNaN(l)||isNaN(d))return t;let g=Math.abs(l-d);return g<5?"minor":g<10&&t==="critical"?"major":t}function Xl(e,t,n){return e>0?"D":t>0?"C":n>0?"B":"A"}function Ql(e){let t=e.filter(n=>!n.dismissed).map(n=>qs(n));return Xl(t.filter(n=>n==="critical").length,t.filter(n=>n==="major").length,t.filter(n=>n==="minor").length)}function ao(e,t,n){let r=100-n*1-t*3-e*10,o=so[Xl(e,t,n)];return Math.max(0,Math.min(o,r))}var $D,so,zw=$(()=>{"use strict";$D={white:[255,255,255],black:[0,0,0],red:[255,0,0],green:[0,128,0],blue:[0,0,255],yellow:[255,255,0],cyan:[0,255,255],aqua:[0,255,255],magenta:[255,0,255],fuchsia:[255,0,255],gray:[128,128,128],grey:[128,128,128],silver:[192,192,192],maroon:[128,0,0],olive:[128,128,0],lime:[0,255,0],teal:[0,128,128],navy:[0,0,128],purple:[128,0,128],orange:[255,165,0],pink:[255,192,203],brown:[165,42,42],gold:[255,215,0],beige:[245,245,220],ivory:[255,255,240],indigo:[75,0,130],violet:[238,130,238],coral:[255,127,80],salmon:[250,128,114],khaki:[240,230,140],crimson:[220,20,60],turquoise:[64,224,208],lightgray:[211,211,211],lightgrey:[211,211,211],darkgray:[169,169,169],darkgrey:[169,169,169],whitesmoke:[245,245,245],gainsboro:[220,220,220]};so={A:100,B:99,C:89,D:69}});var Nw=$(()=>{"use strict"});var Ow=$(()=>{"use strict"});var Gf=$(()=>{"use strict";Hf();Pw();zw();Nw();Ow()});var KD,XD,PK,qf=$(()=>{"use strict";KD=["flex","inline-flex"],XD=["grid","inline-grid"],PK=[...KD,...XD]});var $w=$(()=>{"use strict";Gf();qf()});var Uw=$(()=>{"use strict"});var ln=$(()=>{"use strict";Ou();_y();$y();Gf();qf();$w();Uw()});function JD(e){let{aiPrompt:t,aiResponse:n,...r}=e;return r}function tr(e){try{let t=e.map(JD),n=JSON.stringify(t,ZD);sessionStorage.setItem(Yf,n)}catch(t){y.error("[SessionStorage] Failed to save review history:",t)}}function Kf(){try{let e=sessionStorage.getItem(Yf);if(!e)return[];let t=JSON.parse(e,eR);return Array.isArray(t)?t:[]}catch(e){return y.error("[SessionStorage] Failed to load review history:",e),[]}}function jw(){try{let e=Kf();if(e.length===0)return;let t=!1,n=e.map(r=>{if(r.aiPrompt!==void 0||r.aiResponse!==void 0){t=!0;let{aiPrompt:o,aiResponse:i,...s}=r;return s}return r});t&&(tr(n),y.debug("[SessionStorage] Stripped aiPrompt/aiResponse from existing review history"))}catch(e){y.error("[SessionStorage] Failed to strip sensitive fields:",e)}}function Hw(){try{sessionStorage.removeItem(Yf),y.debug("[SessionStorage] Review history cleared")}catch(e){y.error("[SessionStorage] Failed to clear review history:",e)}}function ZD(e,t){return t instanceof Date?{__type:"Date",value:t.toISOString()}:t}function eR(e,t){return t&&t.__type==="Date"?new Date(t.value):t}var Yf,Xf=$(()=>{"use strict";ze();Yf="uicopilot_review_history"});import tR,{createContext as nR,useContext as rR,useReducer as oR,useMemo as Ww,useRef as iR,useEffect as sR}from"react";function Jl(e){let t=e.length>Vw?e.slice(e.length-Vw):e,n=Math.max(0,t.length-aR);return n===0?t:t.map((r,o)=>{if(o>=n)return r;let i=r.storybookImageData?.startsWith("data:"),s=r.figmaImageData?.startsWith("data:");return!i&&!s?r:{...r,storybookImageData:i?void 0:r.storybookImageData,figmaImageData:s?void 0:r.figmaImageData}})}function lR(e,t){switch(t.type){case"SET_STATE":return{...e,...t.payload};case"ADD_STREAMING_MESSAGE":return{...e,streamingMessages:[...e.streamingMessages,t.payload]};case"UPDATE_STREAMING_MESSAGE":return{...e,streamingMessages:e.streamingMessages.map((n,r)=>r===t.payload.index?{...n,content:t.payload.content}:n)};case"CLEAR_STREAMING_MESSAGES":return{...e,streamingMessages:[]};case"TOGGLE_MODEL":{let n=e.selectedModels.includes(t.payload);return n&&e.selectedModels.length===1?e:{...e,selectedModels:n?e.selectedModels.filter(r=>r!==t.payload):[...e.selectedModels,t.payload]}}case"SET_REVIEW_RESULTS":{if(!t.payload)return{...e,reviewResults:null,currentReviewId:null};let n=e.userRole==="admin",r={id:t.payload.id,componentId:t.payload.componentId,storyId:t.payload.storyId,modelId:t.payload.modelId,complianceScore:t.payload.complianceScore,issuesCount:t.payload.issuesCount,issues:t.payload.issues,createdAt:t.payload.createdAt,visualSimilarity:t.payload.visualSimilarity,storybookImageData:e.storybookImageUrl||void 0,figmaImageData:e.figmaImageUrl||void 0,aiPrompt:n&&e.fullPrompt||void 0,aiResponse:n&&e.fullResponse||void 0,costUsd:t.payload.costUsd,inputTokens:t.payload.inputTokens,outputTokens:t.payload.outputTokens},o=e.reviewHistory.findIndex(s=>s.id===t.payload.id),i;return o>=0?i=e.reviewHistory.map((s,a)=>a===o?r:s):i=[...e.reviewHistory,r],i=Jl(i),tr(i),{...e,reviewResults:t.payload,reviewHistory:i,currentReviewId:t.payload.id}}case"UPDATE_MULTI_MODEL_STREAMING":return e.multiModelResults?{...e,multiModelResults:{...e.multiModelResults,byModel:{...e.multiModelResults.byModel,[t.payload.modelId]:{...e.multiModelResults.byModel[t.payload.modelId],streamingMessages:t.payload.messages}}}}:{...e,multiModelResults:{byModel:{[t.payload.modelId]:{streamingMessages:t.payload.messages}},activeModelId:t.payload.modelId}};case"SET_MODEL_COMPLETED":return e.multiModelResults?{...e,multiModelResults:{...e.multiModelResults,byModel:{...e.multiModelResults.byModel,[t.payload]:{...e.multiModelResults.byModel[t.payload],completed:!0}}}}:e;case"BULK_ADD_REVIEWS":{if(t.payload.length===0)return e;let n=new Map(e.reviewHistory.map(s=>[s.id,s])),r=!1,o=e.reviewHistory.slice();for(let s of t.payload){let a=n.get(s.id);if(!a){o.push(s),r=!0;continue}let u=s.issues?.length??0,c=a.issues?.length??0;if(u>c){let l=o.indexOf(a);l!==-1&&(o[l]=s,r=!0)}}if(!r)return e;let i=Jl(o);return tr(i),{...e,reviewHistory:i}}case"ADD_REVIEW":{let n=Jl([...e.reviewHistory,t.payload]);return tr(n),{...e,reviewHistory:n,currentReviewId:t.payload.id}}case"TOGGLE_ISSUE_SELECTION":{if(!e.currentReviewId)return e;let n=e.reviewHistory.map(r=>r.id!==e.currentReviewId?r:{...r,issues:r.issues.map(o=>o.id===t.payload?{...o,selectedForFix:!o.selectedForFix}:o)});return tr(n),{...e,reviewHistory:n}}case"UPDATE_ISSUE_STATUS":{if(!e.currentReviewId)return e;let n=e.reviewHistory.map(r=>r.id!==e.currentReviewId?r:{...r,issues:r.issues.map(o=>o.id===t.payload.issueId?{...o,status:t.payload.status,error:t.payload.error}:o)});return tr(n),{...e,reviewHistory:n}}case"UPDATE_ISSUE_GENERATED_FIX":{if(!e.currentReviewId)return e;let n=e.reviewHistory.map(r=>r.id!==e.currentReviewId?r:{...r,issues:r.issues.map(o=>o.id===t.payload.issueId?{...o,generatedFix:o.generatedFix?{...o.generatedFix,...t.payload.generatedFix}:t.payload.generatedFix,selectedForFix:t.payload.generatedFix?.status==="failed"?!1:o.selectedForFix}:o)});return tr(n),{...e,reviewHistory:n}}case"BATCH_UPDATE_ISSUE_GENERATED_FIXES":{if(!e.currentReviewId)return e;let n=new Map(t.payload.map(o=>[o.issueId,o.generatedFix])),r=e.reviewHistory.map(o=>o.id!==e.currentReviewId?o:{...o,issues:o.issues.map(i=>{let s=n.get(i.id);return s?{...i,generatedFix:i.generatedFix?{...i.generatedFix,...s}:s,selectedForFix:s?.status==="failed"?!1:i.selectedForFix}:i})});return tr(r),{...e,reviewHistory:r}}case"DISMISS_ISSUE":{if(!e.currentReviewId)return e;let n=e.reviewHistory.map(r=>{if(r.id!==e.currentReviewId)return r;let o=r.issues.map(c=>c.id===t.payload.issueId?{...c,dismissed:!0,dismissReason:t.payload.reason,dismissedAt:new Date,dismissedBy:t.payload.dismissedBy}:c),i=o.filter(c=>!c.dismissed),s=i.filter(c=>c.severity==="critical").length,a=i.filter(c=>c.severity==="major").length,u=i.filter(c=>c.severity==="minor").length;return{...r,issues:o,complianceScore:ao(s,a,u),issuesCount:i.length}});return tr(n),{...e,reviewHistory:n}}case"UNDISMISS_ISSUE":{if(!e.currentReviewId)return e;let n=e.reviewHistory.map(r=>{if(r.id!==e.currentReviewId)return r;let o=r.issues.map(c=>c.id===t.payload?{...c,dismissed:!1,dismissReason:void 0,dismissedAt:void 0}:c),i=o.filter(c=>!c.dismissed),s=i.filter(c=>c.severity==="critical").length,a=i.filter(c=>c.severity==="major").length,u=i.filter(c=>c.severity==="minor").length;return{...r,issues:o,complianceScore:ao(s,a,u),issuesCount:i.length}});return tr(n),{...e,reviewHistory:n}}case"RECALCULATE_SCORE":{if(!e.currentReviewId)return e;let n=e.reviewHistory.map(r=>{if(r.id!==e.currentReviewId)return r;let o=r.issues.filter(c=>!c.dismissed),i=o.filter(c=>c.severity==="critical").length,s=o.filter(c=>c.severity==="major").length,a=o.filter(c=>c.severity==="minor").length,u=ao(i,s,a);return y.debug(`[recalculateScore] Active: ${o.length}, score: ${u}`),{...r,complianceScore:u,issuesCount:o.length}});return tr(n),{...e,reviewHistory:n}}case"UPDATE_REVIEW_SCORE":{let n=e.reviewHistory.map(r=>r.id!==t.payload.reviewId?r:{...r,complianceScore:t.payload.newScore});return tr(n),{...e,reviewHistory:n}}case"CLEAR_ALL_REVIEWS":return Hw(),{...e,reviewHistory:[],currentReviewId:null};case"CLEAR_STALE_REVIEWS":return{...e,currentReviewId:null,reviewResults:null};case"RESET_REVIEW":{let n=e.isReviewing;return{...e,isReviewing:!1,reviewError:null,reviewResults:n?null:e.reviewResults,multiModelResults:null,streamingMessages:[],streamingProgress:0,streamingStatus:"",reviewDetailTab:n?"chat":e.reviewDetailTab,fullPrompt:"",fullResponse:"",figmaImageUrl:n?null:e.figmaImageUrl,storybookImageUrl:n?null:e.storybookImageUrl,currentReviewId:n?null:e.currentReviewId}}case"RESET_PROMPT":return{...e,isGenerating:!1,generatedPrompt:null,promptError:null};case"TRIGGER_SCREENSHOT_REFRESH":return{...e,screenshotRefreshKey:e.screenshotRefreshKey+1};default:return e}}function Jf({children:e}){let[t,n]=oR(lR,gR),r=iR(t);sR(()=>{r.current=t},[t]);let o=Ww(()=>({setIsReviewing:s=>n({type:"SET_STATE",payload:{isReviewing:s}}),setReviewingStoryId:s=>n({type:"SET_STATE",payload:{reviewingStoryId:s}}),setReviewError:s=>n({type:"SET_STATE",payload:{reviewError:s}}),bulkAddReviews:s=>n({type:"BULK_ADD_REVIEWS",payload:s}),setReviewResults:s=>n({type:"SET_REVIEW_RESULTS",payload:s}),setMultiModelResults:s=>n({type:"SET_STATE",payload:{multiModelResults:s}}),updateMultiModelStreamingMessages:(s,a)=>n({type:"UPDATE_MULTI_MODEL_STREAMING",payload:{modelId:s,messages:a}}),setModelCompleted:s=>n({type:"SET_MODEL_COMPLETED",payload:s}),setActiveModelId:s=>{let a=r.current;a.multiModelResults&&n({type:"SET_STATE",payload:{multiModelResults:{...a.multiModelResults,activeModelId:s}}})},setShowReviewMenu:s=>n({type:"SET_STATE",payload:{showReviewMenu:s}}),setSeverityFilter:s=>n({type:"SET_STATE",payload:{severityFilter:s}}),setShowStreamingPanel:s=>n({type:"SET_STATE",payload:{showStreamingPanel:s}}),setStreamingPanelCollapsed:s=>n({type:"SET_STATE",payload:{streamingPanelCollapsed:s}}),addStreamingMessage:s=>n({type:"ADD_STREAMING_MESSAGE",payload:s}),updateStreamingMessage:(s,a)=>n({type:"UPDATE_STREAMING_MESSAGE",payload:{index:s,content:a}}),clearStreamingMessages:()=>n({type:"CLEAR_STREAMING_MESSAGES"}),setStreamingProgress:s=>n({type:"SET_STATE",payload:{streamingProgress:s}}),setStreamingStatus:s=>n({type:"SET_STATE",payload:{streamingStatus:s}}),setReviewDetailTab:s=>n({type:"SET_STATE",payload:{reviewDetailTab:s}}),setFullPrompt:s=>n({type:"SET_STATE",payload:{fullPrompt:s}}),setFullResponse:s=>n({type:"SET_STATE",payload:{fullResponse:s}}),setFigmaImageUrl:s=>n({type:"SET_STATE",payload:{figmaImageUrl:s}}),setStorybookImageUrl:s=>n({type:"SET_STATE",payload:{storybookImageUrl:s}}),setFigmaDimensions:s=>n({type:"SET_STATE",payload:{figmaDimensions:s}}),setSelectedModels:s=>n({type:"SET_STATE",payload:{selectedModels:s}}),toggleModel:s=>n({type:"TOGGLE_MODEL",payload:s}),setModelComparisonView:s=>n({type:"SET_STATE",payload:{modelComparisonView:s}}),resetReview:()=>n({type:"RESET_REVIEW"}),addReview:s=>n({type:"ADD_REVIEW",payload:s}),getCurrentReview:()=>{let s=r.current;return s.currentReviewId&&s.reviewHistory.find(a=>a.id===s.currentReviewId)||null},getReviewById:s=>r.current.reviewHistory.find(a=>a.id===s)||null,getParentReview:()=>{let s=r.current,a=s.reviewHistory.find(u=>u.id===s.currentReviewId);return a?.parentReviewId&&s.reviewHistory.find(u=>u.id===a.parentReviewId)||null},hasAppliedFixes:()=>{let s=r.current,a=s.reviewHistory.find(u=>u.id===s.currentReviewId);return!a||!Array.isArray(a.issues)||a.issues.length===0?!1:a.issues.some(u=>u.status==="applied"||u.generatedFix?.status==="applied")},toggleIssueSelection:s=>n({type:"TOGGLE_ISSUE_SELECTION",payload:s}),updateIssueStatus:(s,a,u)=>n({type:"UPDATE_ISSUE_STATUS",payload:{issueId:s,status:a,error:u}}),updateIssueGeneratedFix:(s,a)=>n({type:"UPDATE_ISSUE_GENERATED_FIX",payload:{issueId:s,generatedFix:a}}),batchUpdateIssueGeneratedFixes:s=>n({type:"BATCH_UPDATE_ISSUE_GENERATED_FIXES",payload:s}),dismissIssue:(s,a,u)=>n({type:"DISMISS_ISSUE",payload:{issueId:s,reason:a,dismissedBy:u}}),undismissIssue:s=>n({type:"UNDISMISS_ISSUE",payload:s}),recalculateScore:()=>n({type:"RECALCULATE_SCORE"}),updateReviewScore:(s,a)=>n({type:"UPDATE_REVIEW_SCORE",payload:{reviewId:s,newScore:a}}),clearAllReviews:()=>n({type:"CLEAR_ALL_REVIEWS"}),clearStaleReviewsForStory:s=>n({type:"CLEAR_STALE_REVIEWS",payload:s}),setIsApplying:s=>n({type:"SET_STATE",payload:{isApplying:s}}),setApplyFixesResult:s=>n({type:"SET_STATE",payload:{applyFixesResult:s}}),setIncludeComponentIssues:s=>n({type:"SET_STATE",payload:{includeComponentIssues:s}}),setIncludeTextComparison:s=>n({type:"SET_STATE",payload:{includeTextComparison:s}}),setUsePromptCache:s=>n({type:"SET_STATE",payload:{usePromptCache:s}}),setIsValidating:s=>n({type:"SET_STATE",payload:{isValidating:s}}),setReviewHistoryLoading:s=>n({type:"SET_STATE",payload:{reviewHistoryLoading:s}}),setValidationUsage:s=>n({type:"SET_STATE",payload:{validationUsage:s}}),setWorkspacePath:s=>n({type:"SET_STATE",payload:{workspacePath:s}}),triggerScreenshotRefresh:()=>n({type:"TRIGGER_SCREENSHOT_REFRESH"}),setHoveredIssueId:s=>n({type:"SET_STATE",payload:{hoveredIssueId:s}}),setFeatureFlags:s=>n({type:"SET_STATE",payload:{featureFlags:s}}),setUserRole:s=>n({type:"SET_STATE",payload:{userRole:s}}),setRoleOverride:s=>{try{s?localStorage.setItem("uicopilot_role_override",s):localStorage.removeItem("uicopilot_role_override")}catch{}n({type:"SET_STATE",payload:{roleOverride:s}})},setReviewAllConcurrency:s=>{let a=Math.max(1,Math.min(5,s));try{localStorage.setItem("uicopilot_review_all_concurrency",String(a))}catch{}n({type:"SET_STATE",payload:{reviewAllConcurrency:a}})},setIsGenerating:s=>n({type:"SET_STATE",payload:{isGenerating:s}}),setGeneratedPrompt:s=>n({type:"SET_STATE",payload:{generatedPrompt:s}}),setPromptError:s=>n({type:"SET_STATE",payload:{promptError:s}}),resetPrompt:()=>n({type:"RESET_PROMPT"})}),[]),i=Ww(()=>({...t,...o}),[t,o]);return tR.createElement(Gw.Provider,{value:i},e)}function ce(){let e=rR(Gw);if(!e)throw new Error("useReviewStore must be used within a ReviewProvider");return e}var Vw,aR,cR,uR,Qf,pR,dR,gR,Gw,Zf=$(()=>{"use strict";ln();Xf();ze();Vw=20,aR=5;cR=()=>{if(typeof localStorage>"u")return 3;try{let e=localStorage.getItem("uicopilot_review_all_concurrency");if(e)return Math.max(1,Math.min(5,parseInt(e,10)))}catch{}return 3},uR=()=>{if(typeof localStorage>"u")return null;try{let e=localStorage.getItem("uicopilot_role_override");if(e==="admin"||e==="beta")return e}catch{}return null},Qf={enableFixGeneration:!1,enableFixApply:!1,enableAutoMap:!1,enableReviewBadges:!1,showCosts:!1,enableParallelReview:!1,enableModelSelection:!1},pR=()=>{if(typeof localStorage>"u")return Qf;try{let e=localStorage.getItem("uicopilot_feature_flags");if(!e)return Qf;let t=JSON.parse(e);return{enableFixGeneration:!!t.enableFixGeneration,enableFixApply:!!t.enableFixApply,enableAutoMap:!!t.enableAutoMap,enableReviewBadges:!!t.enableReviewBadges,showCosts:!!t.showCosts,enableParallelReview:!!t.enableParallelReview,enableModelSelection:!!t.enableModelSelection}}catch{}return Qf},dR=()=>{if(typeof localStorage>"u")return"beta";try{let e=localStorage.getItem("uicopilot_user_role");if(e==="admin"||e==="beta")return e}catch{}return"beta"},gR={isReviewing:!1,reviewingStoryId:null,reviewError:null,reviewResults:null,multiModelResults:null,showReviewMenu:!1,severityFilter:"all",showStreamingPanel:!1,streamingPanelCollapsed:!1,streamingMessages:[],streamingProgress:0,streamingStatus:"",reviewDetailTab:"chat",fullPrompt:"",fullResponse:"",figmaImageUrl:null,storybookImageUrl:null,figmaDimensions:null,selectedModels:["claude-sonnet-4-5-20250929"],modelComparisonView:"side-by-side",reviewHistory:Jl(Kf()),currentReviewId:null,includeComponentIssues:!0,includeTextComparison:!1,usePromptCache:!1,isApplying:!1,applyFixesResult:null,screenshotRefreshKey:0,isValidating:!1,reviewHistoryLoading:!1,validationUsage:null,lastAiCallTimestamp:null,aiRateLimitSeconds:0,isGenerating:!1,generatedPrompt:null,promptError:null,workspacePath:null,userRole:dR(),roleOverride:uR(),featureFlags:pR(),reviewAllConcurrency:cR(),hoveredIssueId:null},Gw=nR(null)});import Ys,{useMemo as fR}from"react";function tm({children:e}){return Ys.createElement(Mu,null,Ys.createElement(Du,null,Ys.createElement(zu,null,Ys.createElement(Jf,null,Ys.createElement(mR,null),e))))}function qw(e){let t=we(),n=Xe(),r=et(),o=ce(),i=fR(()=>({...t,...n,...r,...o}),[t,n,r,o]);return e?e(i):i}function mR(){return em=qw(),null}var em,xt,Yw=$(()=>{"use strict";Bu();Ru();Nu();Zf();em=null,xt=Object.assign(qw,{getState:()=>{if(!em)throw new Error("Store not initialized. Make sure StoreProvider is mounted.");return em}})});var ke=$(()=>{"use strict";Yw();Bu();Ru();Nu();Zf()});function K(){return(process.env.STORYBOOK_UICOPILOT_URL||hR).replace(/\/$/,"")}var hR,Kw,Ne=$(()=>{"use strict";hR="https://app.uiparity.com";Kw=3.6});async function oe(e,t,n=3e4){let r=new AbortController,o=setTimeout(()=>r.abort(),n);try{return await fetch(e,{...t,signal:r.signal})}catch(i){throw i instanceof DOMException&&i.name==="AbortError"?new Error(`Request timed out after ${n}ms: ${e}`):i}finally{clearTimeout(o)}}var ct=$(()=>{"use strict"});import{useEffect as Mo,useState as nc,useRef as pv,useCallback as im}from"react";import{addons as sm}from"storybook/manager-api";async function yz(e,t,n){let r=`${e}:${t}`,o=am.get(r);if(o)return y.debug("[useReviewScreenshots] Reusing in-flight Figma image fetch for",r),o;let i=(async()=>{let s=await oe(`${hv}/api/figma/image?projectId=${e}&nodeId=${t}`,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`}});return s.ok?s.json():{imageUrl:null}})().finally(()=>{am.delete(r)});return am.set(r,i),i}function bz(e,t,n){try{sessionStorage.setItem(`${rc}${e}`,JSON.stringify({figmaNodeId:t,imageUrl:n,timestamp:Date.now()}))}catch{}}function Sz(e,t){try{let n=sessionStorage.getItem(`${rc}${e}`);if(!n)return null;let r=JSON.parse(n);if(r.figmaNodeId===t&&Date.now()-r.timestamp<1800*1e3)return r.imageUrl;sessionStorage.removeItem(`${rc}${e}`)}catch{}return null}function wz(e){try{let t=sessionStorage.getItem(`${rc}${e}`);if(!t)return null;let n=JSON.parse(t);if(n.imageUrl&&Date.now()-n.timestamp<300*1e3)return n.imageUrl}catch{}return null}var dv,gv,fv,mv,$i,hv,Cn,lm,am,rc,xv,yv,ii,Ui=$(()=>{"use strict";ke();cm();ze();Ne();ct();dv="storyArgsUpdated",gv="storyRendered",fv="forceRemount",mv=null,$i=()=>mv,hv=K(),Cn=new Map,lm=null,am=new Map;rc="uicopilot-figma-image-";xv=(e,t,n)=>{let r=Cn.get(e);r?(r.storybookImageUrl=t,n&&(r.figmaImageUrl=n)):Cn.set(e,{storybookImageUrl:t,figmaImageUrl:n??null}),y.debug("[useReviewScreenshots] Populated historical screenshots for story:",e)},yv=(e,t,n)=>{lm=t;let r=Cn.get(e);r?r.figmaImageUrl=n:Cn.set(e,{storybookImageUrl:null,figmaImageUrl:n}),y.debug("[useReviewScreenshots] Pre-set Figma image for mapping:",{storyId:e,figmaNodeId:t,imageUrl:n.substring(0,50)+"..."})},ii=()=>{let[e,t]=nc(!1),[n,r]=nc(!1),[o,i]=nc(!1),[s,a]=nc(null),u=pv(null),{screenshotRefreshKey:c,triggerScreenshotRefresh:l}=ce(),d=im(()=>{let L=xt.getState().currentStoryId;L&&(y.debug("[useReviewScreenshots] Refreshing screenshots for story:",L),Cn.delete(L),u.current=null,i(!0),l())},[l]),g=im(()=>{let L=xt.getState().currentStoryId;if(L){y.debug("[useReviewScreenshots] Refreshing Storybook screenshot only for story:",L);let z=Cn.get(L);z&&(z.storybookImageUrl=null),u.current=null,i(!0),l()}},[l]),{sessionToken:p}=we(),{selectedProjectId:h}=Xe(),{currentStoryId:S,currentMapping:T,loadingMapping:F}=et(),{setStorybookImageUrl:v,setFigmaImageUrl:D}=ce(),N=pv(null);Mo(()=>{S&&N.current&&N.current!==S&&(y.debug("[useReviewScreenshots] Story switched, clearing images"),v(""),D("")),N.current=S},[S,v,D]),Mo(()=>{!S||F||T||D("")},[S,T,F,D]),Mo(()=>{if(!S)return;let L=wz(S);L&&(y.debug("[useReviewScreenshots] Quick-restored Figma image for:",S),D(L))},[S,D]),Mo(()=>{if(!S||F)return;let L=T?.figmaFileUrl;if(L){y.debug("[useReviewScreenshots] Restoring Figma image from mapping.figmaFileUrl for:",S),D(L);let z=Cn.get(S);z?z.figmaImageUrl=L:Cn.set(S,{storybookImageUrl:null,figmaImageUrl:L})}},[S,T,F,D]),Mo(()=>{let L=!1;return(async()=>{if(!p||!h||!S){y.debug("[useReviewScreenshots] Missing required context, skipping auto-load");return}u.current&&u.current!==S&&(y.debug("[useReviewScreenshots] Story changed, clearing stale screenshots"),v(""),D(""));let m=xt.getState();if(u.current===S&&m.storybookImageUrl&&m.figmaImageUrl){y.debug("[useReviewScreenshots] Screenshots already loaded for this story, skipping capture");return}let b=T?.figmaNodeId??null;if(b!==lm){y.debug("[useReviewScreenshots] Figma mapping changed, invalidating Figma image only for story:",S);let P=Cn.get(S);P&&(P.figmaImageUrl=null),lm=b,u.current=null}let w=T?.figmaNodeId;if(w&&!Cn.get(S)?.figmaImageUrl){let P=Sz(S,w);if(P){y.debug("[useReviewScreenshots] Hydrated Figma image from sessionStorage for story:",S),D(P);let B=Cn.get(S);B?B.figmaImageUrl=P:Cn.set(S,{storybookImageUrl:null,figmaImageUrl:P})}}let A=Cn.get(S),f=A&&A.storybookImageUrl&&A.figmaImageUrl,C=A&&A.storybookImageUrl&&!A.figmaImageUrl,E=A&&!A.storybookImageUrl&&A.figmaImageUrl;if(f){y.debug("[useReviewScreenshots] Using fully cached screenshots for story:",S),v(A.storybookImageUrl),D(A.figmaImageUrl),u.current=S;return}let x=C&&T?.figmaNodeId;x&&(y.debug("[useReviewScreenshots] Using cached Storybook, fetching new Figma for story:",S),v(A.storybookImageUrl));let I=E;if(I&&(y.debug("[useReviewScreenshots] Using cached Figma, recapturing Storybook for story:",S),D(A.figmaImageUrl)),u.current===S&&T?.figmaNodeId){y.debug("[useReviewScreenshots] Screenshots already loaded for this story, skipping");return}try{if(a(null),x?r(!0):(I||(t(!0),r(!0)),i(!0)),u.current=S,L)return;let P=I?A.figmaImageUrl:null,B;if(I)y.debug("[useReviewScreenshots] Figma cached (storybookOnlyRefresh), skipping fetch"),r(!1);else if(w){y.debug("[useReviewScreenshots] Found Figma node ID from mapping:",w);let k=null;try{y.debug("[useReviewScreenshots] Fetching Figma image (with caching)...");let R=await yz(h,w,p);k=R.imageUrl||null;let H=R.cached?"(cached)":"(fresh)";y.debug(`[useReviewScreenshots] Figma image fetched ${H}:`,k?"success":"not found")}catch(R){y.warn("[useReviewScreenshots] Failed to fetch Figma image:",R)}if(k)try{y.debug("[useReviewScreenshots] Fetching Figma image via proxy...");let R=`${hv}/api/proxy/image?url=${encodeURIComponent(k)}`,H=await oe(R);if(H.ok){let M=await H.blob(),se=new FileReader,X=await new Promise((me,Pe)=>{se.onloadend=()=>me(se.result),se.onerror=Pe,se.readAsDataURL(M)});P=X,D(X),y.debug("[useReviewScreenshots] Figma image loaded via proxy");let re=new Image;await new Promise(me=>{re.onload=()=>{B={width:re.naturalWidth,height:re.naturalHeight},y.debug("[useReviewScreenshots] Figma dimensions:",B),me()},re.onerror=()=>me(),re.src=X})}else P=k,D(k),y.warn("[useReviewScreenshots] Proxy failed, using direct URL as fallback")}catch(R){y.warn("[useReviewScreenshots] Proxy error, using direct URL as fallback:",R),P=k,D(k)}else y.warn("[useReviewScreenshots] No thumbnail found for node:",w),D(null);P&&w&&bz(S,w,P),r(!1)}else y.debug("[useReviewScreenshots] No Figma mapping exists for this component"),D(null),r(!1);let _=A?.storybookImageUrl||null;if(_)y.debug("[useReviewScreenshots] Using cached Storybook screenshot"),i(!1);else{y.debug("[useReviewScreenshots] Capturing Storybook screenshot for story:",S);let k=await oc({storyId:S,sessionToken:p||void 0,...B&&{figmaWidth:B.width,figmaHeight:B.height}});k&&!L?(_=k,v(k),y.debug("[useReviewScreenshots] Storybook screenshot captured at dimensions:",B||"natural")):y.warn("[useReviewScreenshots] Failed to capture Storybook screenshot"),i(!1)}Cn.set(S,{storybookImageUrl:_,figmaImageUrl:P}),y.debug("[useReviewScreenshots] Screenshots cached for story:",S)}catch(P){y.error("[useReviewScreenshots] Error loading screenshots:",P),a(P instanceof Error?P.message:"Failed to load screenshots"),u.current=null,r(!1),i(!1)}finally{t(!1)}})(),()=>{L=!0}},[p,h,S,T?.figmaNodeId,c]),Mo(()=>{let L=sm.getChannel(),z=null,m=b=>{mv=b.args,y.debug("[useReviewScreenshots] Args updated for story:",b.storyId,"args:",b.args),z&&clearTimeout(z),z=setTimeout(()=>{y.debug("[useReviewScreenshots] Story args changed, refreshing screenshot"),d()},500)};return L.on(dv,m),()=>{L.off(dv,m),z&&clearTimeout(z)}},[d]),Mo(()=>{let L=sm.getChannel(),z=!1,m=null,b=()=>{y.debug("[useReviewScreenshots] FORCE_REMOUNT detected, showing Storybook loader"),z=!0,i(!0)},w=()=>{z&&(y.debug("[useReviewScreenshots] STORY_RENDERED after remount, waiting for styles to settle..."),m&&clearTimeout(m),m=setTimeout(()=>{z=!1,y.debug("[useReviewScreenshots] Refreshing Storybook screenshot after HMR (preserving Figma)"),g()},500))};return L.on(fv,b),L.on(gv,w),()=>{L.off(fv,b),L.off(gv,w),m&&clearTimeout(m)}},[g]),Mo(()=>{let L=sm.getChannel(),z=async m=>{if(!m?.snapshot?.html){y.debug("[useReviewScreenshots] DOM mutated but no snapshot available");return}y.debug("[useReviewScreenshots] DOM mutated, capturing snapshot screenshot"),i(!0);try{let b=xt.getState().currentStoryId,w=await fetch("/__uicopilot/screenshot-snapshot",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...m.snapshot,storyId:b})});if(w.ok){let A=await w.json();if(A.screenshot){v(A.screenshot);let f=xt.getState().currentStoryId;if(f){let C=Cn.get(f);C?C.storybookImageUrl=A.screenshot:Cn.set(f,{storybookImageUrl:A.screenshot,figmaImageUrl:null})}}}else y.error("[useReviewScreenshots] Snapshot screenshot failed:",await w.text())}catch(b){y.error("[useReviewScreenshots] Snapshot screenshot error:",b)}finally{i(!1)}};return L.on("UICOPILOT/STORY_DOM_MUTATED",z),()=>{L.off("UICOPILOT/STORY_DOM_MUTATED",z)}},[]);let U=im((L,z,m)=>{y.debug("[useReviewScreenshots] setFigmaImageDirect called - bypassing load"),yv(L,z,m),D(m),r(!1),u.current=L},[D]);return{isLoadingScreenshots:e,isLoadingFigma:n,isLoadingStorybook:o,screenshotError:s,refreshScreenshots:d,refreshStorybookOnly:g,setFigmaImageDirect:U}}});function kz(){return!K().startsWith("http://localhost")}function Cz(e,t,n){let r=t.createElement("div");r.style.color=e,t.body.appendChild(r);let o=n.getComputedStyle(r).color;return r.remove(),o}function bv(e,t,n){let r=new Map;return e.replace(/(?:color|oklch|oklab|lab|lch)\([^)]+\)/g,o=>{if(r.has(o))return r.get(o);let i=Cz(o,t,n);return r.set(o,i),i})}async function Tz(){let e=(await import("html2canvas")).default,t=document.getElementById("storybook-preview-iframe");if(!t?.contentDocument||!t.contentWindow)throw new Error("Storybook iframe not accessible");let n=t.contentDocument.querySelector("#storybook-root > *")||t.contentDocument.querySelector("#root > *");if(!n)throw new Error("Story element not found in iframe");let r=t.contentWindow,o=t.contentDocument;return(await e(n,{useCORS:!0,logging:!1,backgroundColor:null,onclone:s=>{s.querySelectorAll("style").forEach(u=>{let c=u.textContent||"";/(?:color|oklch|oklab|lab|lch)\(/.test(c)&&(u.textContent=bv(c,o,r))});let a=Array.from(o.styleSheets);s.querySelectorAll('link[rel="stylesheet"]').forEach(u=>{let c=u.href,l=a.find(d=>d.href===c);if(l)try{let d="";for(let g of Array.from(l.cssRules))d+=g.cssText+`
|
|
12
|
+
--`+new Array((n||t.length)+1).join("-")+"^"})}var o0=$(()=>{"use strict";wl()});var C2,T2,I2,F2,E2,i0,Nl,s0=$(()=>{"use strict";o0();C2=9,T2=10,I2=12,F2=13,E2=32,i0=new Uint8Array(128).map((e,t)=>/[a-zA-Z0-9\-]/.test(String.fromCharCode(t))?1:0),Nl=class{constructor(t){this.str=t,this.pos=0}charCodeAt(t){return t<this.str.length?this.str.charCodeAt(t):0}charCode(){return this.charCodeAt(this.pos)}isNameCharCode(t=this.charCode()){return t<128&&i0[t]===1}nextCharCode(){return this.charCodeAt(this.pos+1)}nextNonWsCode(t){return this.charCodeAt(this.findWsEnd(t))}skipWs(){this.pos=this.findWsEnd(this.pos)}findWsEnd(t){for(;t<this.str.length;t++){let n=this.str.charCodeAt(t);if(n!==F2&&n!==T2&&n!==I2&&n!==E2&&n!==C2)break}return t}substringToPos(t){return this.str.substring(this.pos,this.pos=t)}eat(t){this.charCode()!==t&&this.error("Expect `"+String.fromCharCode(t)+"`"),this.pos++}peek(){return this.pos<this.str.length?this.str.charAt(this.pos++):""}error(t){throw new r0(t,this.str,this.pos)}scanSpaces(){return this.substringToPos(this.findWsEnd(this.pos))}scanWord(){let t=this.pos;for(;t<this.str.length;t++){let n=this.str.charCodeAt(t);if(n>=128||i0[n]===0)break}return this.pos===t&&this.error("Expect a keyword"),this.substringToPos(t)}scanNumber(){let t=this.pos;for(;t<this.str.length;t++){let n=this.str.charCodeAt(t);if(n<48||n>57)break}return this.pos===t&&this.error("Expect a number"),this.substringToPos(t)}scanString(){let t=this.str.indexOf("'",this.pos+1);return t===-1&&(this.pos=this.str.length,this.error("Expect an apostrophe")),this.substringToPos(t+1)}}});function d0(e){let t=null,n=null;return e.eat($l),e.skipWs(),t=e.scanNumber(e),e.skipWs(),e.charCode()===Tp?(e.pos++,e.skipWs(),e.charCode()!==vp&&(n=e.scanNumber(e),e.skipWs())):n=t,e.eat(vp),{min:Number(t),max:n?Number(n):0}}function R2(e){let t=null,n=!1;switch(e.charCode()){case h0:e.pos++,t={min:0,max:0};break;case Cp:e.pos++,t={min:1,max:0};break;case _l:e.pos++,t={min:0,max:1};break;case kp:e.pos++,n=!0,e.charCode()===$l?t=d0(e):e.charCode()===_l?(e.pos++,t={min:0,max:0}):t={min:1,max:0};break;case $l:t=d0(e);break;default:return null}return{type:"Multiplier",comma:n,min:t.min,max:t.max,term:null}}function io(e,t){let n=R2(e);return n!==null?(n.term=t,e.charCode()===kp&&e.charCodeAt(e.pos-1)===Cp||e.charCode()===_l&&e.charCodeAt(e.pos-1)===vp?io(e,n):n):t}function Sp(e){let t=e.peek();return t===""?null:io(e,{type:"Token",value:t})}function z2(e){let t;return e.eat(Ip),e.eat(Ol),t=e.scanWord(),e.eat(Ol),e.eat(wp),io(e,{type:"Property",name:t})}function N2(e){let t=null,n=null,r=1;return e.eat(Rs),e.charCode()===l0&&(e.peek(),r=-1),r==-1&&e.charCode()===u0?e.peek():(t=r*Number(e.scanNumber(e)),e.isNameCharCode()&&(t+=e.scanWord())),e.skipWs(),e.eat(Tp),e.skipWs(),e.charCode()===u0?e.peek():(r=1,e.charCode()===l0&&(e.peek(),r=-1),n=r*Number(e.scanNumber(e)),e.isNameCharCode()&&(n+=e.scanWord())),e.eat(Di),{type:"Range",min:t,max:n}}function O2(e){let t,n=null;if(e.eat(Ip),t=e.scanWord(),t==="boolean-expr"){e.eat(Rs);let r=Ul(e,Di);return e.eat(Di),e.eat(wp),io(e,{type:"Boolean",term:r.terms.length===1?r.terms[0]:r})}return e.charCode()===f0&&e.nextCharCode()===m0&&(e.pos+=2,t+="()"),e.charCodeAt(e.findWsEnd(e.pos))===Rs&&(e.skipWs(),n=N2(e)),e.eat(wp),io(e,{type:"Type",name:t,opts:n})}function _2(e){let t=e.scanWord();return e.charCode()===f0?(e.pos++,{type:"Function",name:t}):io(e,{type:"Keyword",name:t})}function $2(e,t){function n(o,i){return{type:"Group",terms:o,combinator:i,disallowEmpty:!1,explicit:!1}}let r;for(t=Object.keys(t).sort((o,i)=>p0[o]-p0[i]);t.length>0;){r=t.shift();let o=0,i=0;for(;o<e.length;o++){let s=e[o];s.type==="Combinator"&&(s.value===r?(i===-1&&(i=o-1),e.splice(o,1),o--):(i!==-1&&o-i>1&&(e.splice(i,o-i,n(e.slice(i,o),r)),o=i+1),i=-1))}i!==-1&&t.length&&e.splice(i,o-i,n(e.slice(i,o),r))}return r}function Ul(e,t=-1){let n=Object.create(null),r=[],o=null,i=e.pos,s=!1;for(;e.charCode()!==t;){let a=s?Ul(e,m0):j2(e);if(!a)break;if(a.type!=="Spaces"){if(s){if(a.terms.length===0){s=!1;continue}if(a.combinator===" "){for(;a.terms.length>1;)n[" "]=!0,r.push({type:"Combinator",value:" "},a.terms.shift());a=a.terms[0]}}a.type==="Combinator"?((o===null||o.type==="Combinator")&&(e.pos=i,e.error("Unexpected combinator")),n[a.value]=!0):o!==null&&o.type!=="Combinator"&&(n[" "]=!0,r.push({type:"Combinator",value:" "})),r.push(a),o=a,i=e.pos,s=a.type==="Function"}}return o!==null&&o.type==="Combinator"&&(e.pos-=i,e.error("Unexpected combinator")),{type:"Group",terms:r,combinator:$2(r,n)||" ",disallowEmpty:!1,explicit:!1}}function U2(e){let t;return e.eat(Rs),t=Ul(e,Di),e.eat(Di),t.explicit=!0,e.charCode()===g0&&(e.pos++,t.disallowEmpty=!0),t}function j2(e){let t=e.charCode();switch(t){case Di:break;case Rs:return io(e,U2(e));case Ip:return e.nextCharCode()===Ol?z2(e):O2(e);case c0:return{type:"Combinator",value:e.substringToPos(e.pos+(e.nextCharCode()===c0?2:1))};case a0:return e.pos++,e.eat(a0),{type:"Combinator",value:"&&"};case Tp:return e.pos++,{type:"Comma"};case Ol:return io(e,{type:"String",value:e.scanString()});case B2:case A2:case P2:case M2:case L2:return{type:"Spaces",value:e.scanSpaces()};case D2:return t=e.nextCharCode(),e.isNameCharCode(t)?(e.pos++,{type:"AtKeyword",name:e.scanWord()}):Sp(e);case h0:case Cp:case _l:case kp:case g0:break;case $l:if(t=e.nextCharCode(),t<48||t>57)return Sp(e);break;default:return e.isNameCharCode(t)?_2(e):Sp(e)}}function zs(e){let t=new Nl(e),n=Ul(t);return t.pos!==e.length&&t.error("Unexpected input"),n.terms.length===1&&n.terms[0].type==="Group"?n.terms[0]:n}var A2,P2,L2,M2,B2,g0,kp,a0,Ol,f0,m0,h0,Cp,Tp,l0,Ip,wp,_l,D2,Rs,Di,$l,c0,vp,u0,p0,Fp=$(()=>{"use strict";s0();A2=9,P2=10,L2=12,M2=13,B2=32,g0=33,kp=35,a0=38,Ol=39,f0=40,m0=41,h0=42,Cp=43,Tp=44,l0=45,Ip=60,wp=62,_l=63,D2=64,Rs=91,Di=93,$l=123,c0=124,vp=125,u0=8734,p0={" ":1,"&&":2,"||":3,"|":4}});function x0(e){return typeof e=="function"?e:Ns}function Ep(e,t,n){function r(s){switch(o.call(n,s),s.type){case"Group":s.terms.forEach(r);break;case"Multiplier":case"Boolean":r(s.term);break;case"Type":case"Property":case"Keyword":case"AtKeyword":case"Function":case"String":case"Token":case"Comma":break;default:throw new Error("Unknown type: "+s.type)}i.call(n,s)}let o=Ns,i=Ns;if(typeof t=="function"?o=t:t&&(o=x0(t.enter),i=x0(t.leave)),o===Ns&&i===Ns)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");r(e,n)}var Ns,y0=$(()=>{"use strict";Ns=function(){}});var Ap=$(()=>{"use strict";sp();Fp();y0()});function V2(e){let t=[];return Fo(e,(n,r,o)=>t.push({type:n,value:e.slice(r,o),node:null})),t}function b0(e,t){return typeof e=="string"?V2(e):t.generate(e,W2)}var W2,S0=$(()=>{"use strict";lr();W2={decorator(e){let t=[],n=null;return{...e,node(r){let o=n;n=r,e.node.call(this,r),n=o},emit(r,o,i){t.push({type:o,value:r,node:i?null:n})},result(){return t}}}}});function kn(e,t,n){return t===ft&&n===kt||e===ft&&t===ft&&n===ft?e:(e.type==="If"&&e.else===kt&&t===ft&&(t=e.then,e=e.match),{type:"If",match:e,then:t,else:n})}function v0(e){return e.length>2&&e.charCodeAt(e.length-2)===G2&&e.charCodeAt(e.length-1)===q2}function w0(e){return e.type==="Keyword"||e.type==="AtKeyword"||e.type==="Function"||e.type==="Type"&&v0(e.name)}function Ao(e,t=" ",n=!1){return{type:"Group",terms:e,combinator:t,disallowEmpty:!1,explicit:n}}function Os(e,t,n=new Set){if(!n.has(e))switch(n.add(e),e.type){case"If":e.match=Os(e.match,t,n),e.then=Os(e.then,t,n),e.else=Os(e.else,t,n);break;case"Type":return t[e.name]||e}return e}function Pp(e,t,n){switch(e){case" ":{let r=ft;for(let o=t.length-1;o>=0;o--){let i=t[o];r=kn(i,r,kt)}return r}case"|":{let r=kt,o=null;for(let i=t.length-1;i>=0;i--){let s=t[i];if(w0(s)&&(o===null&&i>0&&w0(t[i-1])&&(o=Object.create(null),r=kn({type:"Enum",map:o},ft,r)),o!==null)){let a=(v0(s.name)?s.name.slice(0,-1):s.name).toLowerCase();if(!(a in o)){o[a]=s;continue}}o=null,r=kn(s,ft,r)}return r}case"&&":{if(t.length>5)return{type:"MatchOnce",terms:t,all:!0};let r=kt;for(let o=t.length-1;o>=0;o--){let i=t[o],s;t.length>1?s=Pp(e,t.filter(function(a){return a!==i}),!1):s=ft,r=kn(i,s,r)}return r}case"||":{if(t.length>5)return{type:"MatchOnce",terms:t,all:!1};let r=n?ft:kt;for(let o=t.length-1;o>=0;o--){let i=t[o],s;t.length>1?s=Pp(e,t.filter(function(a){return a!==i}),!0):s=ft,r=kn(i,s,r)}return r}}}function Y2(e){let t=ft,n=Ri(e.term);if(e.max===0)n=kn(n,jl,kt),t=kn(n,null,kt),t.then=kn(ft,ft,t),e.comma&&(t.then.else=kn({type:"Comma",syntax:e},t,kt));else for(let r=e.min||1;r<=e.max;r++)e.comma&&t!==ft&&(t=kn({type:"Comma",syntax:e},t,kt)),t=kn(n,kn(ft,ft,t),kt);if(e.min===0)t=kn(ft,ft,t);else for(let r=0;r<e.min-1;r++)e.comma&&t!==ft&&(t=kn({type:"Comma",syntax:e},t,kt)),t=kn(n,t,kt);return t}function Ri(e){if(typeof e=="function")return{type:"Generic",fn:e};switch(e.type){case"Group":{let t=Pp(e.combinator,e.terms.map(Ri),!1);return e.disallowEmpty&&(t=kn(t,jl,kt)),t}case"Multiplier":return Y2(e);case"Boolean":{let t=Ri(e.term),n=Ri(Ao([Ao([{type:"Keyword",name:"not"},{type:"Type",name:"!boolean-group"}]),Ao([{type:"Type",name:"!boolean-group"},Ao([{type:"Multiplier",comma:!1,min:0,max:0,term:Ao([{type:"Keyword",name:"and"},{type:"Type",name:"!boolean-group"}])},{type:"Multiplier",comma:!1,min:0,max:0,term:Ao([{type:"Keyword",name:"or"},{type:"Type",name:"!boolean-group"}])}],"|")])],"|")),r=Ri(Ao([{type:"Type",name:"!term"},Ao([{type:"Token",value:"("},{type:"Type",name:"!self"},{type:"Token",value:")"}]),{type:"Type",name:"general-enclosed"}],"|"));return Os(r,{"!term":t,"!self":n}),Os(n,{"!boolean-group":r}),n}case"Type":case"Property":return{type:e.type,name:e.name,syntax:e};case"Keyword":return{type:e.type,name:e.name.toLowerCase(),syntax:e};case"AtKeyword":return{type:e.type,name:"@"+e.name.toLowerCase(),syntax:e};case"Function":return{type:e.type,name:e.name.toLowerCase()+"(",syntax:e};case"String":return e.value.length===3?{type:"Token",value:e.value.charAt(1),syntax:e}:{type:e.type,value:e.value.substr(1,e.value.length-2).replace(/\\'/g,"'"),syntax:e};case"Token":return{type:e.type,value:e.value,syntax:e};case"Comma":return{type:e.type,syntax:e};default:throw new Error("Unknown node type:",e.type)}}function _s(e,t){return typeof e=="string"&&(e=zs(e)),{type:"MatchGraph",match:Ri(e),syntax:t||null,source:e}}var ft,kt,jl,G2,q2,Lp=$(()=>{"use strict";Fp();ft={type:"Match"},kt={type:"Mismatch"},jl={type:"DisallowEmpty"},G2=40,q2=41});function eP(e){let t=null,n=null,r=e;for(;r!==null;)n=r.prev,r.prev=t,t=r,r=n;return t}function Mp(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let r=t.charCodeAt(n),o=e.charCodeAt(n);if(o>=65&&o<=90&&(o=o|32),o!==r)return!1}return!0}function tP(e){return e.type!==9?!1:e.value!=="?"}function I0(e){return e===null?!0:e.type===18||e.type===2||e.type===21||e.type===19||e.type===23||tP(e)}function F0(e){return e===null?!0:e.type===22||e.type===20||e.type===24||e.type===9&&e.value==="/"}function nP(e,t,n){function r(){do v++,F=v<e.length?e[v]:null;while(F!==null&&(F.type===13||F.type===25))}function o(U){let L=v+U;return L<e.length?e[L]:null}function i(U,L){return{nextState:U,matchStack:N,syntaxStack:d,thenStack:g,tokenIndex:v,prev:L}}function s(U){g={nextState:U,matchStack:N,syntaxStack:d,prev:g}}function a(U){p=i(U,p)}function u(){N={type:X2,syntax:t.syntax,token:F,prev:N},r(),h=null,v>D&&(D=v)}function c(){d={syntax:t.syntax,opts:t.syntax.opts||d!==null&&d.opts||null,prev:d},N={type:Bp,syntax:t.syntax,token:N.token,prev:N}}function l(){N.type===Bp?N=N.prev:N={type:E0,syntax:d.syntax,token:N.token,prev:N},d=d.prev}let d=null,g=null,p=null,h=null,S=0,T=null,F=null,v=-1,D=0,N={type:K2,syntax:null,token:null,prev:null};for(r();T===null&&++S<T0;)switch(t.type){case"Match":if(g===null){if(F!==null&&(v!==e.length-1||F.value!=="\\0"&&F.value!=="\\9")){t=kt;break}T=C0;break}if(t=g.nextState,t===jl)if(g.matchStack===N){t=kt;break}else t=ft;for(;g.syntaxStack!==d;)l();g=g.prev;break;case"Mismatch":if(h!==null&&h!==!1)(p===null||v>p.tokenIndex)&&(p=h,h=!1);else if(p===null){T=Q2;break}t=p.nextState,g=p.thenStack,d=p.syntaxStack,N=p.matchStack,v=p.tokenIndex,F=v<e.length?e[v]:null,p=p.prev;break;case"MatchGraph":t=t.match;break;case"If":t.else!==kt&&a(t.else),t.then!==ft&&s(t.then),t=t.match;break;case"MatchOnce":t={type:"MatchOnceBuffer",syntax:t,index:0,mask:0};break;case"MatchOnceBuffer":{let z=t.syntax.terms;if(t.index===z.length){if(t.mask===0||t.syntax.all){t=kt;break}t=ft;break}if(t.mask===(1<<z.length)-1){t=ft;break}for(;t.index<z.length;t.index++){let m=1<<t.index;if((t.mask&m)===0){a(t),s({type:"AddMatchOnce",syntax:t.syntax,mask:t.mask|m}),t=z[t.index++];break}}break}case"AddMatchOnce":t={type:"MatchOnceBuffer",syntax:t.syntax,index:0,mask:t.mask};break;case"Enum":if(F!==null){let z=F.value.toLowerCase();if(z.indexOf("\\")!==-1&&(z=z.replace(/\\[09].*$/,"")),k0.call(t.map,z)){t=t.map[z];break}}t=kt;break;case"Generic":{let z=d!==null?d.opts:null,m=v+Math.floor(t.fn(F,o,z));if(!isNaN(m)&&m>v){for(;v<m;)u();t=ft}else t=kt;break}case"Type":case"Property":{let z=t.type==="Type"?"types":"properties",m=k0.call(n,z)?n[z][t.name]:null;if(!m||!m.match)throw new Error("Bad syntax reference: "+(t.type==="Type"?"<"+t.name+">":"<'"+t.name+"'>"));if(h!==!1&&F!==null&&t.type==="Type"&&(t.name==="custom-ident"&&F.type===1||t.name==="length"&&F.value==="0")){h===null&&(h=i(t,p)),t=kt;break}c(),t=m.matchRef||m.match;break}case"Keyword":{let z=t.name;if(F!==null){let m=F.value;if(m.indexOf("\\")!==-1&&(m=m.replace(/\\[09].*$/,"")),Mp(m,z)){u(),t=ft;break}}t=kt;break}case"AtKeyword":case"Function":if(F!==null&&Mp(F.value,t.name)){u(),t=ft;break}t=kt;break;case"Token":if(F!==null&&F.value===t.value){u(),t=ft;break}t=kt;break;case"Comma":F!==null&&F.type===18?I0(N.token)?t=kt:(u(),t=F0(F)?kt:ft):t=I0(N.token)||F0(F)?ft:kt;break;case"String":let U="",L=v;for(;L<e.length&&U.length<t.value.length;L++)U+=e[L].value;if(Mp(U,t.value)){for(;v<L;)u();t=ft}else t=kt;break;default:throw new Error("Unknown node type: "+t.type)}switch(Z2+=S,T){case null:console.warn("[csstree-match] BREAK after "+T0+" iterations"),T=J2,N=null;break;case C0:for(;d!==null;)l();break;default:N=null}return{tokens:e,reason:T,iterations:S,match:N,longestMatch:D}}function Dp(e,t,n){let r=nP(e,t,n||{});if(r.match===null)return r;let o=r.match,i=r.match={syntax:t.syntax||null,match:[]},s=[i];for(o=eP(o).prev;o!==null;){switch(o.type){case Bp:i.match.push(i={syntax:o.syntax,match:[]}),s.push(i);break;case E0:s.pop(),i=s[s.length-1];break;default:i.match.push({syntax:o.syntax||null,token:o.token.value,node:o.token.node})}o=o.prev}return r}var k0,K2,X2,Bp,E0,C0,Q2,J2,T0,Z2,A0=$(()=>{"use strict";Lp();({hasOwnProperty:k0}=Object.prototype),K2=0,X2=1,Bp=2,E0=3,C0="Match",Q2="Mismatch",J2="Maximum iteration number exceeded (please fill an issue on https://github.com/csstree/csstree/issues)",T0=15e3,Z2=0});var zp={};ye(zp,{getTrace:()=>P0,isKeyword:()=>iP,isProperty:()=>oP,isType:()=>rP});function P0(e){function t(o){return o===null?!1:o.type==="Type"||o.type==="Property"||o.type==="Keyword"}function n(o){if(Array.isArray(o.match)){for(let i=0;i<o.match.length;i++)if(n(o.match[i]))return t(o.syntax)&&r.unshift(o.syntax),!0}else if(o.node===e)return r=t(o.syntax)?[o.syntax]:[],!0;return!1}let r=null;return this.matched!==null&&n(this.matched),r}function rP(e,t){return Rp(this,e,n=>n.type==="Type"&&n.name===t)}function oP(e,t){return Rp(this,e,n=>n.type==="Property"&&n.name===t)}function iP(e){return Rp(this,e,t=>t.type==="Keyword")}function Rp(e,t,n){let r=P0.call(e,t);return r===null?!1:r.some(n)}var L0=$(()=>{"use strict"});function M0(e){return"node"in e?e.node:M0(e.match[0])}function B0(e){return"node"in e?e.node:B0(e.match[e.match.length-1])}function Np(e,t,n,r,o){function i(a){if(a.syntax!==null&&a.syntax.type===r&&a.syntax.name===o){let u=M0(a),c=B0(a);e.syntax.walk(t,function(l,d,g){if(l===u){let p=new Zn;do{if(p.appendData(d.data),d.data===c)break;d=d.next}while(d!==null);s.push({parent:g,nodes:p})}})}Array.isArray(a.match)&&a.match.forEach(i)}let s=[];return n.matched!==null&&i(n.matched),s}var D0=$(()=>{"use strict";Fs()});function Op(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&e>=0}function R0(e){return!!e&&Op(e.offset)&&Op(e.line)&&Op(e.column)}function sP(e,t){return function(r,o){if(!r||r.constructor!==Object)return o(r,"Type of node should be an Object");for(let i in r){let s=!0;if($s.call(r,i)!==!1){if(i==="type")r.type!==e&&o(r,"Wrong node type `"+r.type+"`, expected `"+e+"`");else if(i==="loc"){if(r.loc===null)continue;if(r.loc&&r.loc.constructor===Object)if(typeof r.loc.source!="string")i+=".source";else if(!R0(r.loc.start))i+=".start";else if(!R0(r.loc.end))i+=".end";else continue;s=!1}else if(t.hasOwnProperty(i)){s=!1;for(let a=0;!s&&a<t[i].length;a++){let u=t[i][a];switch(u){case String:s=typeof r[i]=="string";break;case Boolean:s=typeof r[i]=="boolean";break;case null:s=r[i]===null;break;default:typeof u=="string"?s=r[i]&&r[i].type===u:Array.isArray(u)&&(s=r[i]instanceof Zn)}}}else o(r,"Unknown field `"+i+"` for "+e+" node type");s||o(r,"Bad value for `"+e+"."+i+"`")}}for(let i in t)$s.call(t,i)&&$s.call(r,i)===!1&&o(r,"Field `"+e+"."+i+"` is missed")}}function z0(e,t){let n=[];for(let r=0;r<e.length;r++){let o=e[r];if(o===String||o===Boolean)n.push(o.name.toLowerCase());else if(o===null)n.push("null");else if(typeof o=="string")n.push(o);else if(Array.isArray(o))n.push("List<"+(z0(o,t)||"any")+">");else throw new Error("Wrong value `"+o+"` in `"+t+"` structure definition")}return n.join(" | ")}function aP(e,t){let n=t.structure,r={type:String,loc:!0},o={type:'"'+e+'"'};for(let i in n){if($s.call(n,i)===!1)continue;let s=r[i]=Array.isArray(n[i])?n[i].slice():[n[i]];o[i]=z0(s,e+"."+i)}return{docs:o,check:sP(e,r)}}function N0(e){let t={};if(e.node){for(let n in e.node)if($s.call(e.node,n)){let r=e.node[n];if(r.structure)t[n]=aP(n,r);else throw new Error("Missed `structure` field in `"+n+"` node type definition")}}return t}var $s,O0=$(()=>{"use strict";Fs();({hasOwnProperty:$s}=Object.prototype)});function _p(e,t,n){let r={};for(let o in e)e[o].syntax&&(r[o]=n?e[o].syntax:Ai(e[o].syntax,{compact:t}));return r}function lP(e,t,n){let r={};for(let[o,i]of Object.entries(e))r[o]={prelude:i.prelude&&(n?i.prelude.syntax:Ai(i.prelude.syntax,{compact:t})),descriptors:i.descriptors&&_p(i.descriptors,t,n)};return r}function cP(e){for(let t=0;t<e.length;t++)if(e[t].value.toLowerCase()==="var(")return!0;return!1}function uP(e){let t=e.terms[0];return e.explicit===!1&&e.terms.length===1&&t.type==="Multiplier"&&t.comma===!0}function Fr(e,t,n){return{matched:e,iterations:n,error:t,...zp}}function zi(e,t,n,r){let o=b0(n,e.syntax),i;return cP(o)?Fr(null,new Error("Matching for a tree with var() is not supported")):(r&&(i=Dp(o,e.cssWideKeywordsSyntax,e)),(!r||!i.match)&&(i=Dp(o,t.match,e),!i.match)?Fr(null,new Ub(i.reason,t.syntax,n,i),i.iterations):Fr(i.match,null,i.iterations))}var Us,_0=$(()=>{"use strict";jb();Ml();Bl();t0();n0();Ap();S0();Lp();A0();L0();D0();O0();Us=class{constructor(t,n,r){if(this.cssWideKeywords=Mi,this.syntax=n,this.generic=!1,this.units={...zl},this.atrules=Object.create(null),this.properties=Object.create(null),this.types=Object.create(null),this.structure=r||N0(t),t){if(t.cssWideKeywords&&(this.cssWideKeywords=t.cssWideKeywords),t.units)for(let o of Object.keys(zl))Array.isArray(t.units[o])&&(this.units[o]=t.units[o]);if(t.types)for(let[o,i]of Object.entries(t.types))this.addType_(o,i);if(t.generic){this.generic=!0;for(let[o,i]of Object.entries(e0(this.units)))this.addType_(o,i)}if(t.atrules)for(let[o,i]of Object.entries(t.atrules))this.addAtrule_(o,i);if(t.properties)for(let[o,i]of Object.entries(t.properties))this.addProperty_(o,i)}this.cssWideKeywordsSyntax=_s(this.cssWideKeywords.join(" | "))}checkStructure(t){function n(i,s){o.push({node:i,message:s})}let r=this.structure,o=[];return this.syntax.walk(t,function(i){r.hasOwnProperty(i.type)?r[i.type].check(i,n):n(i,"Unknown node type `"+i.type+"`")}),o.length?o:!1}createDescriptor(t,n,r,o=null){let i={type:n,name:r},s={type:n,name:r,parent:o,serializable:typeof t=="string"||t&&typeof t.type=="string",syntax:null,match:null,matchRef:null};return typeof t=="function"?s.match=_s(t,i):(typeof t=="string"?Object.defineProperty(s,"syntax",{get(){return Object.defineProperty(s,"syntax",{value:zs(t)}),s.syntax}}):s.syntax=t,Object.defineProperty(s,"match",{get(){return Object.defineProperty(s,"match",{value:_s(s.syntax,i)}),s.match}}),n==="Property"&&Object.defineProperty(s,"matchRef",{get(){let a=s.syntax,u=uP(a)?_s({...a,terms:[a.terms[0].term]},i):null;return Object.defineProperty(s,"matchRef",{value:u}),u}})),s}addAtrule_(t,n){n&&(this.atrules[t]={type:"Atrule",name:t,prelude:n.prelude?this.createDescriptor(n.prelude,"AtrulePrelude",t):null,descriptors:n.descriptors?Object.keys(n.descriptors).reduce((r,o)=>(r[o]=this.createDescriptor(n.descriptors[o],"AtruleDescriptor",o,t),r),Object.create(null)):null})}addProperty_(t,n){n&&(this.properties[t]=this.createDescriptor(n,"Property",t))}addType_(t,n){n&&(this.types[t]=this.createDescriptor(n,"Type",t))}checkAtruleName(t){if(!this.getAtrule(t))return new Pi("Unknown at-rule","@"+t)}checkAtrulePrelude(t,n){let r=this.checkAtruleName(t);if(r)return r;let o=this.getAtrule(t);if(!o.prelude&&n)return new SyntaxError("At-rule `@"+t+"` should not contain a prelude");if(o.prelude&&!n&&!zi(this,o.prelude,"",!1).matched)return new SyntaxError("At-rule `@"+t+"` should contain a prelude")}checkAtruleDescriptorName(t,n){let r=this.checkAtruleName(t);if(r)return r;let o=this.getAtrule(t),i=Pl(n);if(!o.descriptors)return new SyntaxError("At-rule `@"+t+"` has no known descriptors");if(!o.descriptors[i.name]&&!o.descriptors[i.basename])return new Pi("Unknown at-rule descriptor",n)}checkPropertyName(t){if(!this.getProperty(t))return new Pi("Unknown property",t)}matchAtrulePrelude(t,n){let r=this.checkAtrulePrelude(t,n);if(r)return Fr(null,r);let o=this.getAtrule(t);return o.prelude?zi(this,o.prelude,n||"",!1):Fr(null,null)}matchAtruleDescriptor(t,n,r){let o=this.checkAtruleDescriptorName(t,n);if(o)return Fr(null,o);let i=this.getAtrule(t),s=Pl(n);return zi(this,i.descriptors[s.name]||i.descriptors[s.basename],r,!1)}matchDeclaration(t){return t.type!=="Declaration"?Fr(null,new Error("Not a Declaration node")):this.matchProperty(t.property,t.value)}matchProperty(t,n){if(ap(t).custom)return Fr(null,new Error("Lexer matching doesn't applicable for custom properties"));let r=this.checkPropertyName(t);return r?Fr(null,r):zi(this,this.getProperty(t),n,!0)}matchType(t,n){let r=this.getType(t);return r?zi(this,r,n,!1):Fr(null,new Pi("Unknown type",t))}match(t,n){return typeof t!="string"&&(!t||!t.type)?Fr(null,new Pi("Bad syntax")):((typeof t=="string"||!t.match)&&(t=this.createDescriptor(t,"Type","anonymous")),zi(this,t,n,!1))}findValueFragments(t,n,r,o){return Np(this,n,this.matchProperty(t,n),r,o)}findDeclarationValueFragments(t,n,r){return Np(this,t.value,this.matchDeclaration(t),n,r)}findAllFragments(t,n,r){let o=[];return this.syntax.walk(t,{visit:"Declaration",enter:i=>{o.push.apply(o,this.findDeclarationValueFragments(i,n,r))}}),o}getAtrule(t,n=!0){let r=Pl(t);return(r.vendor&&n?this.atrules[r.name]||this.atrules[r.basename]:this.atrules[r.name])||null}getAtrulePrelude(t,n=!0){let r=this.getAtrule(t,n);return r&&r.prelude||null}getAtruleDescriptor(t,n){return this.atrules.hasOwnProperty(t)&&this.atrules.declarators&&this.atrules[t].declarators[n]||null}getProperty(t,n=!0){let r=ap(t);return(r.vendor&&n?this.properties[r.name]||this.properties[r.basename]:this.properties[r.name])||null}getType(t){return hasOwnProperty.call(this.types,t)?this.types[t]:null}validate(){function t(u,c){return c?`<${u}>`:`<'${u}'>`}function n(u,c,l,d){if(l.has(c))return l.get(c);l.set(c,!1),d.syntax!==null&&Ep(d.syntax,function(g){if(g.type!=="Type"&&g.type!=="Property")return;let p=g.type==="Type"?u.types:u.properties,h=g.type==="Type"?o:i;hasOwnProperty.call(p,g.name)?n(u,g.name,h,p[g.name])&&(r.push(`${t(c,l===o)} used broken syntax definition ${t(g.name,g.type==="Type")}`),l.set(c,!0)):(r.push(`${t(c,l===o)} used missed syntax definition ${t(g.name,g.type==="Type")}`),l.set(c,!0))},this)}let r=[],o=new Map,i=new Map;for(let u in this.types)n(this,u,o,this.types[u]);for(let u in this.properties)n(this,u,i,this.properties[u]);let s=[...o.keys()].filter(u=>o.get(u)),a=[...i.keys()].filter(u=>i.get(u));return s.length||a.length?{errors:r,types:s,properties:a}:null}dump(t,n){return{generic:this.generic,cssWideKeywords:this.cssWideKeywords,units:this.units,types:_p(this.types,!n,t),properties:_p(this.properties,!n,t),atrules:lP(this.atrules,!n,t)}}toString(){return JSON.stringify(this.dump())}}});function $p(e,t){return typeof t=="string"&&/^\s*\|/.test(t)?typeof e=="string"?e+t:t.replace(/^\s*\|\s*/,""):t||null}function pP(e,t){let n=Object.create(null);for(let r of Object.keys(e))t.includes(r)&&(n[r]=e[r]);return n}function Up(e,t,n){let r={...e};for(let[o,i]of Object.entries(t))r[o]={...r[o],...n?pP(i,n):i};return r}function js(e,t){let n={...e};for(let[r,o]of Object.entries(t))switch(r){case"generic":n[r]=!!o;break;case"cssWideKeywords":n[r]=e[r]?[...e[r],...o]:o||[];break;case"units":n[r]={...e[r]};for(let[i,s]of Object.entries(o))n[r][i]=Array.isArray(s)?s:[];break;case"atrules":n[r]={...e[r]};for(let[i,s]of Object.entries(o)){let a=n[r][i]||{},u=n[r][i]={prelude:a.prelude||null,descriptors:{...a.descriptors}};if(s){u.prelude=s.prelude?$p(u.prelude,s.prelude):u.prelude||null;for(let[c,l]of Object.entries(s.descriptors||{}))u.descriptors[c]=l?$p(u.descriptors[c],l):null;Object.keys(u.descriptors).length||(u.descriptors=null)}}break;case"types":case"properties":n[r]={...e[r]};for(let[i,s]of Object.entries(o))n[r][i]=$p(n[r][i],s);break;case"parseContext":n[r]={...e[r],...o};break;case"scope":case"features":n[r]=Up(e[r],o);break;case"atrule":case"pseudo":n[r]=Up(e[r],o,["parse"]);break;case"node":n[r]=Up(e[r],o,["name","structure","parse","generate","walkContext"]);break}return n}var $0=$(()=>{"use strict"});function U0(e){let t=nb(e),n=Ob(e),r=Pb(e),{fromPlainObject:o,toPlainObject:i}=Mb(n),s={lexer:null,createLexer:a=>new Us(a,s,s.lexer.structure),tokenize:Fo,parse:t,generate:r,walk:n,find:n.find,findLast:n.findLast,findAll:n.findAll,fromPlainObject:o,toPlainObject:i,fork(a){let u=js({},e);return U0(typeof a=="function"?a(u):js(u,a))}};return s.lexer=new Us({generic:e.generic,cssWideKeywords:e.cssWideKeywords,units:e.units,types:e.types,atrules:e.atrules,properties:e.properties,node:e.node},s),s}var j0,H0=$(()=>{"use strict";lr();rb();Lb();Bb();_b();_0();$0();j0=e=>U0(js({},e))});var W0,V0=$(()=>{"use strict";W0={generic:!0,cssWideKeywords:["initial","inherit","unset","revert","revert-layer"],units:{angle:["deg","grad","rad","turn"],decibel:["db"],flex:["fr"],frequency:["hz","khz"],length:["cm","mm","q","in","pt","pc","px","em","rem","ex","rex","cap","rcap","ch","rch","ic","ric","lh","rlh","vw","svw","lvw","dvw","vh","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax","cqw","cqh","cqi","cqb","cqmin","cqmax"],resolution:["dpi","dpcm","dppx","x"],semitones:["st"],time:["s","ms"]},types:{"abs()":"abs( <calc-sum> )","absolute-size":"xx-small|x-small|small|medium|large|x-large|xx-large|xxx-large","acos()":"acos( <calc-sum> )","alpha-value":"<number>|<percentage>","an+b":"odd|even|<integer>|<n-dimension>|'+'? \u2020 n|-n|<ndashdigit-dimension>|'+'? \u2020 <ndashdigit-ident>|<dashndashdigit-ident>|<n-dimension> <signed-integer>|'+'? \u2020 n <signed-integer>|-n <signed-integer>|<ndash-dimension> <signless-integer>|'+'? \u2020 n- <signless-integer>|-n- <signless-integer>|<n-dimension> ['+'|'-'] <signless-integer>|'+'? \u2020 n ['+'|'-'] <signless-integer>|-n ['+'|'-'] <signless-integer>","anchor()":"anchor( <anchor-name>?&&<anchor-side> , <length-percentage>? )","anchor-name":"<dashed-ident>","anchor-side":"inside|outside|top|left|right|bottom|start|end|self-start|self-end|<percentage>|center","anchor-size":"width|height|block|inline|self-block|self-inline","anchor-size()":"anchor-size( [<anchor-name>||<anchor-size>]? , <length-percentage>? )","angle-percentage":"<angle>|<percentage>","angular-color-hint":"<angle-percentage>|<zero>","angular-color-stop":"<color> <color-stop-angle>?","angular-color-stop-list":"<angular-color-stop> , [<angular-color-hint>? , <angular-color-stop>]#?","animateable-feature":"scroll-position|contents|<custom-ident>","animation-action":"none|play|play-once|play-forwards|play-backwards|pause|reset|replay","asin()":"asin( <calc-sum> )","atan()":"atan( <calc-sum> )","atan2()":"atan2( <calc-sum> , <calc-sum> )",attachment:"scroll|fixed|local","attr()":"attr( <attr-name> <attr-type>? , <declaration-value>? )","attr-matcher":"['~'|'|'|'^'|'$'|'*']? '='","attr-modifier":"i|s","attr-type":"type( <syntax> )|raw-string|number|<attr-unit>","attribute-selector":"'[' <wq-name> ']'|'[' <wq-name> <attr-matcher> [<string-token>|<ident-token>] <attr-modifier>? ']'","auto-repeat":"repeat( [auto-fill|auto-fit] , [<line-names>? <fixed-size>]+ <line-names>? )","auto-track-list":"[<line-names>? [<fixed-size>|<fixed-repeat>]]* <line-names>? <auto-repeat> [<line-names>? [<fixed-size>|<fixed-repeat>]]* <line-names>?",axis:"block|inline|x|y","baseline-position":"[first|last]? baseline","basic-shape":"<inset()>|<xywh()>|<rect()>|<circle()>|<ellipse()>|<polygon()>|<path()>","basic-shape-rect":"<inset()>|<rect()>|<xywh()>","bg-clip":"<visual-box>|border-area|text","bg-image":"<image>|none","bg-layer":"<bg-image>||<bg-position> [/ <bg-size>]?||<repeat-style>||<attachment>||<visual-box>||<visual-box>","bg-position":"[[left|center|right|top|bottom|<length-percentage>]|[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]|[center|[left|right] <length-percentage>?]&&[center|[top|bottom] <length-percentage>?]]","bg-size":"[<length-percentage [0,\u221E]>|auto]{1,2}|cover|contain","blend-mode":"normal|multiply|screen|overlay|darken|lighten|color-dodge|color-burn|hard-light|soft-light|difference|exclusion|hue|saturation|color|luminosity","blur()":"blur( <length>? )","brightness()":"brightness( [<number>|<percentage>]? )","calc()":"calc( <calc-sum> )","calc-constant":"e|pi|infinity|-infinity|NaN","calc-product":"<calc-value> ['*' <calc-value>|'/' <number>]*","calc-size()":"calc-size( <calc-size-basis> , <calc-sum> )","calc-size-basis":"<intrinsic-size-keyword>|<calc-size()>|any|<calc-sum>","calc-sum":"<calc-product> [['+'|'-'] <calc-product>]*","calc-value":"<number>|<dimension>|<percentage>|<calc-constant>|( <calc-sum> )","cf-final-image":"<image>|<color>","cf-mixing-image":"<percentage>?&&<image>","circle()":"circle( <radial-size>? [at <position>]? )","clamp()":"clamp( <calc-sum>#{3} )","class-selector":"'.' <ident-token>","clip-source":"<url>",color:"<color-base>|currentColor|<system-color>|<device-cmyk()>|<light-dark()>|<-non-standard-color>","color()":"color( <colorspace-params> [/ [<alpha-value>|none]]? )","color-base":"<hex-color>|<color-function>|<named-color>|<color-mix()>|transparent","color-function":"<rgb()>|<rgba()>|<hsl()>|<hsla()>|<hwb()>|<lab()>|<lch()>|<oklab()>|<oklch()>|<color()>","color-interpolation-method":"in [<rectangular-color-space>|<polar-color-space> <hue-interpolation-method>?|<custom-color-space>]","color-mix()":"color-mix( <color-interpolation-method> , [<color>&&<percentage [0,100]>?]#{2} )","color-stop":"<color-stop-length>|<color-stop-angle>","color-stop-angle":"[<angle-percentage>|<zero>]{1,2}","color-stop-length":"<length-percentage>{1,2}","color-stop-list":"<linear-color-stop> , [<linear-color-hint>? , <linear-color-stop>]#?","colorspace-params":"[<predefined-rgb-params>|<xyz-params>]",combinator:"'>'|'+'|'~'|['|' '|']","common-lig-values":"[common-ligatures|no-common-ligatures]","compat-auto":"searchfield|textarea|checkbox|radio|menulist|listbox|meter|progress-bar|button","compat-special":"textfield|menulist-button","complex-selector":"<complex-selector-unit> [<combinator>? <complex-selector-unit>]*","complex-selector-list":"<complex-selector>#","composite-style":"clear|copy|source-over|source-in|source-out|source-atop|destination-over|destination-in|destination-out|destination-atop|xor","compositing-operator":"add|subtract|intersect|exclude","compound-selector":"[<type-selector>? <subclass-selector>*]!","compound-selector-list":"<compound-selector>#","conic-gradient()":"conic-gradient( [<conic-gradient-syntax>] )","conic-gradient-syntax":"[[[from [<angle>|<zero>]]? [at <position>]?]||<color-interpolation-method>]? , <angular-color-stop-list>","container-condition":"not <query-in-parens>|<query-in-parens> [[and <query-in-parens>]*|[or <query-in-parens>]*]","container-name":"<custom-ident>","container-query":"not <query-in-parens>|<query-in-parens> [[and <query-in-parens>]*|[or <query-in-parens>]*]","content-distribution":"space-between|space-around|space-evenly|stretch","content-list":"[<string>|contents|<image>|<counter>|<quote>|<target>|<leader()>|<attr()>]+","content-position":"center|start|end|flex-start|flex-end","content-replacement":"<image>","contextual-alt-values":"[contextual|no-contextual]","contrast()":"contrast( [<number>|<percentage>]? )","coord-box":"content-box|padding-box|border-box|fill-box|stroke-box|view-box","corner-shape-value":"round|scoop|bevel|notch|square|squircle|<superellipse()>","cos()":"cos( <calc-sum> )",counter:"<counter()>|<counters()>","counter()":"counter( <counter-name> , <counter-style>? )","counter-name":"<custom-ident>","counter-style":"<counter-style-name>|symbols( )","counter-style-name":"<custom-ident>","counters()":"counters( <counter-name> , <string> , <counter-style>? )","cross-fade()":"cross-fade( <cf-mixing-image> , <cf-final-image>? )","cubic-bezier()":"cubic-bezier( [<number [0,1]> , <number>]#{2} )","cubic-bezier-easing-function":"ease|ease-in|ease-out|ease-in-out|cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )","cursor-predefined":"auto|default|none|context-menu|help|pointer|progress|wait|cell|crosshair|text|vertical-text|alias|copy|move|no-drop|not-allowed|e-resize|n-resize|ne-resize|nw-resize|s-resize|se-resize|sw-resize|w-resize|ew-resize|ns-resize|nesw-resize|nwse-resize|col-resize|row-resize|all-scroll|zoom-in|zoom-out|grab|grabbing","custom-color-space":"<dashed-ident>","custom-params":"<dashed-ident> [<number>|<percentage>|none]+",dasharray:"[[<length-percentage>|<number>]+]#","dashndashdigit-ident":"<ident-token>","deprecated-system-color":"ActiveBorder|ActiveCaption|AppWorkspace|Background|ButtonHighlight|ButtonShadow|CaptionText|InactiveBorder|InactiveCaption|InactiveCaptionText|InfoBackground|InfoText|Menu|MenuText|Scrollbar|ThreeDDarkShadow|ThreeDFace|ThreeDHighlight|ThreeDLightShadow|ThreeDShadow|Window|WindowFrame|WindowText","discretionary-lig-values":"[discretionary-ligatures|no-discretionary-ligatures]","display-box":"contents|none","display-inside":"flow|flow-root|table|flex|grid|ruby","display-internal":"table-row-group|table-header-group|table-footer-group|table-row|table-cell|table-column-group|table-column|table-caption|ruby-base|ruby-text|ruby-base-container|ruby-text-container","display-legacy":"inline-block|inline-list-item|inline-table|inline-flex|inline-grid","display-listitem":"<display-outside>?&&[flow|flow-root]?&&list-item","display-outside":"block|inline|run-in","drop-shadow()":"drop-shadow( [<color>?&&<length>{2,3}] )","dynamic-range-limit-mix()":"dynamic-range-limit-mix( [<'dynamic-range-limit'>&&<percentage [0,100]>]#{2,} )","easing-function":"<linear-easing-function>|<cubic-bezier-easing-function>|<step-easing-function>","east-asian-variant-values":"[jis78|jis83|jis90|jis04|simplified|traditional]","east-asian-width-values":"[full-width|proportional-width]","element()":"element( <custom-ident> , [first|start|last|first-except]? )|element( <id-selector> )","ellipse()":"ellipse( <radial-size>? [at <position>]? )","env()":"env( <custom-ident> , <declaration-value>? )","exp()":"exp( <calc-sum> )","explicit-track-list":"[<line-names>? <track-size>]+ <line-names>?","family-name":"<string>|<custom-ident>+","feature-tag-value":"<string> [<integer>|on|off]?","feature-type":"@stylistic|@historical-forms|@styleset|@character-variant|@swash|@ornaments|@annotation","feature-value-block":"<feature-type> '{' <feature-value-declaration-list> '}'","feature-value-block-list":"<feature-value-block>+","feature-value-declaration":"<custom-ident> : <integer>+ ;","feature-value-declaration-list":"<feature-value-declaration>","feature-value-name":"<custom-ident>","filter-function":"<blur()>|<brightness()>|<contrast()>|<drop-shadow()>|<grayscale()>|<hue-rotate()>|<invert()>|<opacity()>|<saturate()>|<sepia()>","filter-value-list":"[<filter-function>|<url>]+","final-bg-layer":"<bg-image>||<bg-position> [/ <bg-size>]?||<repeat-style>||<attachment>||<visual-box>||<visual-box>||<'background-color'>","fit-content()":"fit-content( <length-percentage [0,\u221E]> )","fixed-breadth":"<length-percentage>","fixed-repeat":"repeat( [<integer [1,\u221E]>] , [<line-names>? <fixed-size>]+ <line-names>? )","fixed-size":"<fixed-breadth>|minmax( <fixed-breadth> , <track-breadth> )|minmax( <inflexible-breadth> , <fixed-breadth> )","font-stretch-absolute":"normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded|<percentage>","font-variant-css2":"normal|small-caps","font-weight-absolute":"normal|bold|<number [1,1000]>","font-width-css3":"normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded","form-control-identifier":"select","frequency-percentage":"<frequency>|<percentage>","generic-complete":"serif|sans-serif|system-ui|cursive|fantasy|math|monospace","general-enclosed":"[<function-token> <any-value>? )]|[( <any-value>? )]","generic-family":"<generic-script-specific>|<generic-complete>|<generic-incomplete>|<-non-standard-generic-family>","generic-incomplete":"ui-serif|ui-sans-serif|ui-monospace|ui-rounded","geometry-box":"<shape-box>|fill-box|stroke-box|view-box",gradient:"<linear-gradient()>|<repeating-linear-gradient()>|<radial-gradient()>|<repeating-radial-gradient()>|<conic-gradient()>|<repeating-conic-gradient()>|<-legacy-gradient>","grayscale()":"grayscale( [<number>|<percentage>]? )","grid-line":"auto|<custom-ident>|[<integer>&&<custom-ident>?]|[span&&[<integer>||<custom-ident>]]","historical-lig-values":"[historical-ligatures|no-historical-ligatures]","hsl()":"hsl( <hue> , <percentage> , <percentage> , <alpha-value>? )|hsl( [<hue>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )","hsla()":"hsla( <hue> , <percentage> , <percentage> , <alpha-value>? )|hsla( [<hue>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )",hue:"<number>|<angle>","hue-interpolation-method":"[shorter|longer|increasing|decreasing] hue","hue-rotate()":"hue-rotate( [<angle>|<zero>]? )","hwb()":"hwb( [<hue>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )","hypot()":"hypot( <calc-sum># )",image:"<url>|<image()>|<image-set()>|<element()>|<paint()>|<cross-fade()>|<gradient>","image()":"image( <image-tags>? [<image-src>? , <color>?]! )","image-set()":"image-set( <image-set-option># )","image-set-option":"[<image>|<string>] [<resolution>||type( <string> )]","image-src":"<url>|<string>","image-tags":"ltr|rtl","inflexible-breadth":"<length-percentage>|min-content|max-content|auto","inset()":"inset( <length-percentage>{1,4} [round <'border-radius'>]? )","invert()":"invert( [<number>|<percentage>]? )","keyframe-block":"<keyframe-selector># { <declaration-list> }","keyframe-selector":"from|to|<percentage [0,100]>|<timeline-range-name> <percentage>","keyframes-name":"<custom-ident>|<string>","lab()":"lab( [<percentage>|<number>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )","layer()":"layer( <layer-name> )","layer-name":"<ident> ['.' <ident>]*","lch()":"lch( [<percentage>|<number>|none] [<percentage>|<number>|none] [<hue>|none] [/ [<alpha-value>|none]]? )","leader()":"leader( <leader-type> )","leader-type":"dotted|solid|space|<string>","length-percentage":"<length>|<percentage>","light-dark()":"light-dark( <color> , <color> )","line-name-list":"[<line-names>|<name-repeat>]+","line-names":"'[' <custom-ident>* ']'","line-style":"none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset","line-width":"<length>|thin|medium|thick","linear()":"linear( [<number>&&<percentage>{0,2}]# )","linear-color-hint":"<length-percentage>","linear-color-stop":"<color> <color-stop-length>?","linear-easing-function":"linear|<linear()>","linear-gradient()":"linear-gradient( [<linear-gradient-syntax>] )","linear-gradient-syntax":"[[<angle>|<zero>|to <side-or-corner>]||<color-interpolation-method>]? , <color-stop-list>","log()":"log( <calc-sum> , <calc-sum>? )","mask-layer":"<mask-reference>||<position> [/ <bg-size>]?||<repeat-style>||<geometry-box>||[<geometry-box>|no-clip]||<compositing-operator>||<masking-mode>","mask-position":"[<length-percentage>|left|center|right] [<length-percentage>|top|center|bottom]?","mask-reference":"none|<image>|<mask-source>","mask-source":"<url>","masking-mode":"alpha|luminance|match-source","matrix()":"matrix( <number>#{6} )","matrix3d()":"matrix3d( <number>#{16} )","max()":"max( <calc-sum># )","media-and":"<media-in-parens> [and <media-in-parens>]+","media-condition":"<media-not>|<media-and>|<media-or>|<media-in-parens>","media-condition-without-or":"<media-not>|<media-and>|<media-in-parens>","media-feature":"( [<mf-plain>|<mf-boolean>|<mf-range>] )","media-in-parens":"( <media-condition> )|<media-feature>|<general-enclosed>","media-not":"not <media-in-parens>","media-or":"<media-in-parens> [or <media-in-parens>]+","media-query":"<media-condition>|[not|only]? <media-type> [and <media-condition-without-or>]?","media-query-list":"<media-query>#","media-type":"<ident>","mf-boolean":"<mf-name>","mf-name":"<ident>","mf-plain":"<mf-name> : <mf-value>","mf-range":"<mf-name> ['<'|'>']? '='? <mf-value>|<mf-value> ['<'|'>']? '='? <mf-name>|<mf-value> '<' '='? <mf-name> '<' '='? <mf-value>|<mf-value> '>' '='? <mf-name> '>' '='? <mf-value>","mf-value":"<number>|<dimension>|<ident>|<ratio>","min()":"min( <calc-sum># )","minmax()":"minmax( [<length-percentage>|min-content|max-content|auto] , [<length-percentage>|<flex>|min-content|max-content|auto] )","mod()":"mod( <calc-sum> , <calc-sum> )","n-dimension":"<dimension-token>","name-repeat":"repeat( [<integer [1,\u221E]>|auto-fill] , <line-names>+ )","named-color":"aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen","namespace-prefix":"<ident>","ndash-dimension":"<dimension-token>","ndashdigit-dimension":"<dimension-token>","ndashdigit-ident":"<ident-token>","ns-prefix":"[<ident-token>|'*']? '|'","number-percentage":"<number>|<percentage>","numeric-figure-values":"[lining-nums|oldstyle-nums]","numeric-fraction-values":"[diagonal-fractions|stacked-fractions]","numeric-spacing-values":"[proportional-nums|tabular-nums]","offset-path":"<ray()>|<url>|<basic-shape>","oklab()":"oklab( [<percentage>|<number>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )","oklch()":"oklch( [<percentage>|<number>|none] [<percentage>|<number>|none] [<hue>|none] [/ [<alpha-value>|none]]? )","opacity()":"opacity( [<number>|<percentage>]? )","opacity-value":"<number>|<percentage>","outline-line-style":"none|dotted|dashed|solid|double|groove|ridge|inset|outset","outline-radius":"<length>|<percentage>","overflow-position":"unsafe|safe","page-body":"<declaration>? [; <page-body>]?|<page-margin-box> <page-body>","page-margin-box":"<page-margin-box-type> '{' <declaration-list> '}'","page-margin-box-type":"@top-left-corner|@top-left|@top-center|@top-right|@top-right-corner|@bottom-left-corner|@bottom-left|@bottom-center|@bottom-right|@bottom-right-corner|@left-top|@left-middle|@left-bottom|@right-top|@right-middle|@right-bottom","page-selector":"<pseudo-page>+|<ident> <pseudo-page>*","page-selector-list":"[<page-selector>#]?","page-size":"A5|A4|A3|B5|B4|JIS-B5|JIS-B4|letter|legal|ledger",paint:"none|<color>|<url> [none|<color>]?|context-fill|context-stroke","paint()":"paint( <ident> , <declaration-value>? )","paint-box":"<visual-box>|fill-box|stroke-box","palette-identifier":"<dashed-ident>","palette-mix()":"palette-mix( <color-interpolation-method> , [[normal|light|dark|<palette-identifier>|<palette-mix()>]&&<percentage [0,100]>?]#{2} )","path()":"path( <'fill-rule'>? , <string> )","perspective()":"perspective( [<length [0,\u221E]>|none] )","polar-color-space":"hsl|hwb|lch|oklch","polygon()":"polygon( <'fill-rule'>? , [<length-percentage> <length-percentage>]# )",position:"[[left|center|right]||[top|center|bottom]|[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]?|[[left|right] <length-percentage>]&&[[top|bottom] <length-percentage>]]","position-area":"[[left|center|right|span-left|span-right|x-start|x-end|span-x-start|span-x-end|x-self-start|x-self-end|span-x-self-start|span-x-self-end|span-all]||[top|center|bottom|span-top|span-bottom|y-start|y-end|span-y-start|span-y-end|y-self-start|y-self-end|span-y-self-start|span-y-self-end|span-all]|[block-start|center|block-end|span-block-start|span-block-end|span-all]||[inline-start|center|inline-end|span-inline-start|span-inline-end|span-all]|[self-block-start|center|self-block-end|span-self-block-start|span-self-block-end|span-all]||[self-inline-start|center|self-inline-end|span-self-inline-start|span-self-inline-end|span-all]|[start|center|end|span-start|span-end|span-all]{1,2}|[self-start|center|self-end|span-self-start|span-self-end|span-all]{1,2}]","pow()":"pow( <calc-sum> , <calc-sum> )","predefined-rgb":"srgb|srgb-linear|display-p3|display-p3-linear|a98-rgb|prophoto-rgb|rec2020","predefined-rgb-params":"<predefined-rgb> [<number>|<percentage>|none]{3}","pseudo-class-selector":"':' <ident-token>|':' <function-token> <any-value> ')'","pseudo-element-selector":"':' <pseudo-class-selector>|<legacy-pseudo-element-selector>","pseudo-page":": [left|right|first|blank]","query-in-parens":"( <container-condition> )|( <size-feature> )|style( <style-query> )|<general-enclosed>",quote:"open-quote|close-quote|no-open-quote|no-close-quote","radial-extent":"closest-corner|closest-side|farthest-corner|farthest-side","radial-gradient()":"radial-gradient( [<radial-gradient-syntax>] )","radial-gradient-syntax":"[[[<radial-shape>||<radial-size>]? [at <position>]?]||<color-interpolation-method>]? , <color-stop-list>","radial-shape":"circle|ellipse","radial-size":"<radial-extent>|<length [0,\u221E]>|<length-percentage [0,\u221E]>{2}",ratio:"<number [0,\u221E]> [/ <number [0,\u221E]>]?","ray()":"ray( <angle>&&<ray-size>?&&contain?&&[at <position>]? )","ray-size":"closest-side|closest-corner|farthest-side|farthest-corner|sides","rect()":"rect( [<length-percentage>|auto]{4} [round <'border-radius'>]? )","rectangular-color-space":"srgb|srgb-linear|display-p3|display-p3-linear|a98-rgb|prophoto-rgb|rec2020|lab|oklab|xyz|xyz-d50|xyz-d65","relative-selector":"<combinator>? <complex-selector>","relative-selector-list":"<relative-selector>#","relative-size":"larger|smaller","rem()":"rem( <calc-sum> , <calc-sum> )","repeat-style":"repeat-x|repeat-y|[repeat|space|round|no-repeat]{1,2}","repeating-conic-gradient()":"repeating-conic-gradient( [<conic-gradient-syntax>] )","repeating-linear-gradient()":"repeating-linear-gradient( [<linear-gradient-syntax>] )","repeating-radial-gradient()":"repeating-radial-gradient( [<radial-gradient-syntax>] )","reversed-counter-name":"reversed( <counter-name> )","rgb()":"rgb( <percentage>#{3} , <alpha-value>? )|rgb( <number>#{3} , <alpha-value>? )|rgb( [<number>|<percentage>|none]{3} [/ [<alpha-value>|none]]? )","rgba()":"rgba( <percentage>#{3} , <alpha-value>? )|rgba( <number>#{3} , <alpha-value>? )|rgba( [<number>|<percentage>|none]{3} [/ [<alpha-value>|none]]? )","rotate()":"rotate( [<angle>|<zero>] )","rotate3d()":"rotate3d( <number> , <number> , <number> , [<angle>|<zero>] )","rotateX()":"rotateX( [<angle>|<zero>] )","rotateY()":"rotateY( [<angle>|<zero>] )","rotateZ()":"rotateZ( [<angle>|<zero>] )","round()":"round( <rounding-strategy>? , <calc-sum> , <calc-sum> )","rounding-strategy":"nearest|up|down|to-zero","saturate()":"saturate( [<number>|<percentage>]? )","scale()":"scale( [<number>|<percentage>]#{1,2} )","scale3d()":"scale3d( [<number>|<percentage>]#{3} )","scaleX()":"scaleX( [<number>|<percentage>] )","scaleY()":"scaleY( [<number>|<percentage>] )","scaleZ()":"scaleZ( [<number>|<percentage>] )","scope-end":"<forgiving-selector-list>","scope-start":"<forgiving-selector-list>","scroll()":"scroll( [<scroller>||<axis>]? )",scroller:"root|nearest|self","scroll-state-feature":"<media-query-list>","scroll-state-in-parens":"( <scroll-state-query> )|( <scroll-state-feature> )|<general-enclosed>","scroll-state-query":"not <scroll-state-in-parens>|<scroll-state-in-parens> [[and <scroll-state-in-parens>]*|[or <scroll-state-in-parens>]*]|<scroll-state-feature>","selector-list":"<complex-selector-list>","self-position":"center|start|end|self-start|self-end|flex-start|flex-end","sepia()":"sepia( [<number>|<percentage>]? )",shadow:"inset?&&<length>{2,4}&&<color>?","shadow-t":"[<length>{2,3}&&<color>?]",shape:"rect( <top> , <right> , <bottom> , <left> )|rect( <top> <right> <bottom> <left> )","shape-box":"<visual-box>|margin-box","side-or-corner":"[left|right]||[top|bottom]","sign()":"sign( <calc-sum> )","signed-integer":"<number-token>","signless-integer":"<number-token>","sin()":"sin( <calc-sum> )","single-animation":"<'animation-duration'>||<easing-function>||<'animation-delay'>||<single-animation-iteration-count>||<single-animation-direction>||<single-animation-fill-mode>||<single-animation-play-state>||[none|<keyframes-name>]||<single-animation-timeline>","single-animation-composition":"replace|add|accumulate","single-animation-direction":"normal|reverse|alternate|alternate-reverse","single-animation-fill-mode":"none|forwards|backwards|both","single-animation-iteration-count":"infinite|<number>","single-animation-play-state":"running|paused","single-animation-timeline":"auto|none|<dashed-ident>|<scroll()>|<view()>","single-transition":"[none|<single-transition-property>]||<time>||<easing-function>||<time>||<transition-behavior-value>","single-transition-property":"all|<custom-ident>",size:"closest-side|farthest-side|closest-corner|farthest-corner|<length>|<length-percentage>{2}","size-feature":"<mf-plain>|<mf-boolean>|<mf-range>","skew()":"skew( [<angle>|<zero>] , [<angle>|<zero>]? )","skewX()":"skewX( [<angle>|<zero>] )","skewY()":"skewY( [<angle>|<zero>] )","sqrt()":"sqrt( <calc-sum> )","step-position":"jump-start|jump-end|jump-none|jump-both|start|end","step-easing-function":"step-start|step-end|<steps()>","steps()":"steps( <integer> , <step-position>? )","style-feature":"<declaration>","style-in-parens":"( <style-condition> )|( <style-feature> )|<general-enclosed>","style-query":"<style-condition>|<style-feature>","subclass-selector":"<id-selector>|<class-selector>|<attribute-selector>|<pseudo-class-selector>","superellipse()":"superellipse( [<number>|infinity|-infinity] )","supports-condition":"not <supports-in-parens>|<supports-in-parens> [and <supports-in-parens>]*|<supports-in-parens> [or <supports-in-parens>]*","supports-decl":"( <declaration> )","supports-feature":"<supports-decl>|<supports-selector-fn>","supports-in-parens":"( <supports-condition> )|<supports-feature>|<general-enclosed>","supports-selector-fn":"selector( <complex-selector> )",symbol:"<string>|<image>|<custom-ident>","symbols()":"symbols( <symbols-type>? [<string>|<image>]+ )","symbols-type":"cyclic|numeric|alphabetic|symbolic|fixed","system-color":"AccentColor|AccentColorText|ActiveText|ButtonBorder|ButtonFace|ButtonText|Canvas|CanvasText|Field|FieldText|GrayText|Highlight|HighlightText|LinkText|Mark|MarkText|SelectedItem|SelectedItemText|VisitedText","system-family-name":"caption|icon|menu|message-box|small-caption|status-bar","tan()":"tan( <calc-sum> )",target:"<target-counter()>|<target-counters()>|<target-text()>","target-counter()":"target-counter( [<string>|<url>] , <custom-ident> , <counter-style>? )","target-counters()":"target-counters( [<string>|<url>] , <custom-ident> , <string> , <counter-style>? )","target-text()":"target-text( [<string>|<url>] , [content|before|after|first-letter]? )","text-edge":"[text|cap|ex|ideographic|ideographic-ink] [text|alphabetic|ideographic|ideographic-ink]?","time-percentage":"<time>|<percentage>","timeline-range-name":"cover|contain|entry|exit|entry-crossing|exit-crossing","track-breadth":"<length-percentage>|<flex>|min-content|max-content|auto","track-list":"[<line-names>? [<track-size>|<track-repeat>]]+ <line-names>?","track-repeat":"repeat( [<integer [1,\u221E]>] , [<line-names>? <track-size>]+ <line-names>? )","track-size":"<track-breadth>|minmax( <inflexible-breadth> , <track-breadth> )|fit-content( <length-percentage> )","transform-function":"<matrix()>|<translate()>|<translateX()>|<translateY()>|<scale()>|<scaleX()>|<scaleY()>|<rotate()>|<skew()>|<skewX()>|<skewY()>|<matrix3d()>|<translate3d()>|<translateZ()>|<scale3d()>|<scaleZ()>|<rotate3d()>|<rotateX()>|<rotateY()>|<rotateZ()>|<perspective()>","transform-list":"<transform-function>+","transition-behavior-value":"normal|allow-discrete","translate()":"translate( <length-percentage> , <length-percentage>? )","translate3d()":"translate3d( <length-percentage> , <length-percentage> , <length> )","translateX()":"translateX( <length-percentage> )","translateY()":"translateY( <length-percentage> )","translateZ()":"translateZ( <length> )","try-size":"most-width|most-height|most-block-size|most-inline-size","try-tactic":"flip-block||flip-inline||flip-start","type-or-unit":"string|color|url|integer|number|length|angle|time|frequency|cap|ch|em|ex|ic|lh|rlh|rem|vb|vi|vw|vh|vmin|vmax|mm|Q|cm|in|pt|pc|px|deg|grad|rad|turn|ms|s|Hz|kHz|%","type-selector":"<wq-name>|<ns-prefix>? '*'","var()":"var( <custom-property-name> , <declaration-value>? )","view()":"view( [<axis>||<'view-timeline-inset'>]? )","viewport-length":"auto|<length-percentage>","visual-box":"content-box|padding-box|border-box","wq-name":"<ns-prefix>? <ident-token>","xywh()":"xywh( <length-percentage>{2} <length-percentage [0,\u221E]>{2} [round <'border-radius'>]? )",xyz:"xyz|xyz-d50|xyz-d65","xyz-params":"<xyz-space> [<number>|<percentage>|none]{3}","-legacy-gradient":"<-webkit-gradient()>|<-legacy-linear-gradient>|<-legacy-repeating-linear-gradient>|<-legacy-radial-gradient>|<-legacy-repeating-radial-gradient>","-legacy-linear-gradient":"-moz-linear-gradient( <-legacy-linear-gradient-arguments> )|-webkit-linear-gradient( <-legacy-linear-gradient-arguments> )|-o-linear-gradient( <-legacy-linear-gradient-arguments> )","-legacy-repeating-linear-gradient":"-moz-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )|-webkit-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )|-o-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )","-legacy-linear-gradient-arguments":"[<angle>|<side-or-corner>]? , <color-stop-list>","-legacy-radial-gradient":"-moz-radial-gradient( <-legacy-radial-gradient-arguments> )|-webkit-radial-gradient( <-legacy-radial-gradient-arguments> )|-o-radial-gradient( <-legacy-radial-gradient-arguments> )","-legacy-repeating-radial-gradient":"-moz-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )|-webkit-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )|-o-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )","-legacy-radial-gradient-arguments":"[<position> ,]? [[[<-legacy-radial-gradient-shape>||<-legacy-radial-gradient-size>]|[<length>|<percentage>]{2}] ,]? <color-stop-list>","-legacy-radial-gradient-size":"closest-side|closest-corner|farthest-side|farthest-corner|contain|cover","-legacy-radial-gradient-shape":"circle|ellipse","-non-standard-font":"-apple-system-body|-apple-system-headline|-apple-system-subheadline|-apple-system-caption1|-apple-system-caption2|-apple-system-footnote|-apple-system-short-body|-apple-system-short-headline|-apple-system-short-subheadline|-apple-system-short-caption1|-apple-system-short-footnote|-apple-system-tall-body","-non-standard-color":"-moz-ButtonDefault|-moz-ButtonHoverFace|-moz-ButtonHoverText|-moz-CellHighlight|-moz-CellHighlightText|-moz-Combobox|-moz-ComboboxText|-moz-Dialog|-moz-DialogText|-moz-dragtargetzone|-moz-EvenTreeRow|-moz-Field|-moz-FieldText|-moz-html-CellHighlight|-moz-html-CellHighlightText|-moz-mac-accentdarkestshadow|-moz-mac-accentdarkshadow|-moz-mac-accentface|-moz-mac-accentlightesthighlight|-moz-mac-accentlightshadow|-moz-mac-accentregularhighlight|-moz-mac-accentregularshadow|-moz-mac-chrome-active|-moz-mac-chrome-inactive|-moz-mac-focusring|-moz-mac-menuselect|-moz-mac-menushadow|-moz-mac-menutextselect|-moz-MenuHover|-moz-MenuHoverText|-moz-MenuBarText|-moz-MenuBarHoverText|-moz-nativehyperlinktext|-moz-OddTreeRow|-moz-win-communicationstext|-moz-win-mediatext|-moz-activehyperlinktext|-moz-default-background-color|-moz-default-color|-moz-hyperlinktext|-moz-visitedhyperlinktext|-webkit-activelink|-webkit-focus-ring-color|-webkit-link|-webkit-text","-non-standard-image-rendering":"optimize-contrast|-moz-crisp-edges|-o-crisp-edges|-webkit-optimize-contrast","-non-standard-overflow":"overlay|-moz-scrollbars-none|-moz-scrollbars-horizontal|-moz-scrollbars-vertical|-moz-hidden-unscrollable","-non-standard-size":"intrinsic|min-intrinsic|-webkit-fill-available|-webkit-fit-content|-webkit-min-content|-webkit-max-content|-moz-available|-moz-fit-content|-moz-min-content|-moz-max-content","-webkit-gradient()":"-webkit-gradient( <-webkit-gradient-type> , <-webkit-gradient-point> [, <-webkit-gradient-point>|, <-webkit-gradient-radius> , <-webkit-gradient-point>] [, <-webkit-gradient-radius>]? [, <-webkit-gradient-color-stop>]* )","-webkit-gradient-color-stop":"from( <color> )|color-stop( [<number-zero-one>|<percentage>] , <color> )|to( <color> )","-webkit-gradient-point":"[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]","-webkit-gradient-radius":"<length>|<percentage>","-webkit-gradient-type":"linear|radial","-webkit-mask-box-repeat":"repeat|stretch|round","-ms-filter-function-list":"<-ms-filter-function>+","-ms-filter-function":"<-ms-filter-function-progid>|<-ms-filter-function-legacy>","-ms-filter-function-progid":"'progid:' [<ident-token> '.']* [<ident-token>|<function-token> <any-value>? )]","-ms-filter-function-legacy":"<ident-token>|<function-token> <any-value>? )",age:"child|young|old","attr-name":"<wq-name>","attr-fallback":"<any-value>",autospace:"no-autospace|[ideograph-alpha||ideograph-numeric||punctuation]||[insert|replace]",bottom:"<length>|auto","generic-voice":"[<age>? <gender> <integer>?]",gender:"male|female|neutral","generic-script-specific":"generic( kai )|generic( fangsong )|generic( nastaliq )","-non-standard-generic-family":"-apple-system|BlinkMacSystemFont","intrinsic-size-keyword":"min-content|max-content|fit-content",left:"<length>|auto","device-cmyk()":"<legacy-device-cmyk-syntax>|<modern-device-cmyk-syntax>","legacy-device-cmyk-syntax":"device-cmyk( <number>#{4} )","modern-device-cmyk-syntax":"device-cmyk( <cmyk-component>{4} [/ [<alpha-value>|none]]? )","cmyk-component":"<number>|<percentage>|none","color-space":"<rectangular-color-space>|<polar-color-space>|<custom-color-space>",right:"<length>|auto","forgiving-selector-list":"<complex-real-selector-list>","forgiving-relative-selector-list":"<relative-real-selector-list>","complex-real-selector-list":"<complex-real-selector>#","simple-selector-list":"<simple-selector>#","relative-real-selector-list":"<relative-real-selector>#","complex-selector-unit":"[<compound-selector>? <pseudo-compound-selector>*]!","complex-real-selector":"<compound-selector> [<combinator>? <compound-selector>]*","relative-real-selector":"<combinator>? <complex-real-selector>","pseudo-compound-selector":"<pseudo-element-selector> <pseudo-class-selector>*","simple-selector":"<type-selector>|<subclass-selector>","legacy-pseudo-element-selector":"':' [before|after|first-line|first-letter]","svg-length":"<percentage>|<length>|<number>","svg-writing-mode":"lr-tb|rl-tb|tb-rl|lr|rl|tb",top:"<length>|auto",x:"<number>",y:"<number>",declaration:"<ident-token> : <declaration-value>? ['!' important]?","declaration-list":"[<declaration>? ';']* <declaration>?",url:"url( <string> <url-modifier>* )|<url-token>","url-modifier":"<ident>|<function-token> <any-value> )","number-zero-one":"<number [0,1]>","number-one-or-greater":"<number [1,\u221E]>","xyz-space":"xyz|xyz-d50|xyz-d65","style-condition":"not <style-in-parens>|<style-in-parens> [[and <style-in-parens>]*|[or <style-in-parens>]*]","-non-standard-display":"-ms-inline-flexbox|-ms-grid|-ms-inline-grid|-webkit-flex|-webkit-inline-flex|-webkit-box|-webkit-inline-box|-moz-inline-stack|-moz-box|-moz-inline-box","inset-area":"[[left|center|right|span-left|span-right|x-start|x-end|span-x-start|span-x-end|x-self-start|x-self-end|span-x-self-start|span-x-self-end|span-all]||[top|center|bottom|span-top|span-bottom|y-start|y-end|span-y-start|span-y-end|y-self-start|y-self-end|span-y-self-start|span-y-self-end|span-all]|[block-start|center|block-end|span-block-start|span-block-end|span-all]||[inline-start|center|inline-end|span-inline-start|span-inline-end|span-all]|[self-block-start|self-block-end|span-self-block-start|span-self-block-end|span-all]||[self-inline-start|self-inline-end|span-self-inline-start|span-self-inline-end|span-all]|[start|center|end|span-start|span-end|span-all]{1,2}|[self-start|center|self-end|span-self-start|span-self-end|span-all]{1,2}]",syntax:"'*'|<syntax-component> [<syntax-combinator> <syntax-component>]*|<syntax-string>","syntax-component":"<syntax-single-component> <syntax-multiplier>?|'<' transform-list '>'","syntax-single-component":"'<' <syntax-type-name> '>'|<ident>","syntax-type-name":"angle|color|custom-ident|image|integer|length|length-percentage|number|percentage|resolution|string|time|url|transform-function","syntax-combinator":"'|'","syntax-multiplier":"'#'|'+'","syntax-string":"<string>"},properties:{"--*":"<declaration-value>","-ms-accelerator":"false|true","-ms-block-progression":"tb|rl|bt|lr","-ms-content-zoom-chaining":"none|chained","-ms-content-zoom-limit":"<'-ms-content-zoom-limit-min'> <'-ms-content-zoom-limit-max'>","-ms-content-zoom-limit-max":"<percentage>","-ms-content-zoom-limit-min":"<percentage>","-ms-content-zoom-snap":"<'-ms-content-zoom-snap-type'>||<'-ms-content-zoom-snap-points'>","-ms-content-zoom-snap-points":"snapInterval( <percentage> , <percentage> )|snapList( <percentage># )","-ms-content-zoom-snap-type":"none|proximity|mandatory","-ms-content-zooming":"none|zoom","-ms-filter":"<string>","-ms-flow-from":"[none|<custom-ident>]#","-ms-flow-into":"[none|<custom-ident>]#","-ms-grid-columns":"none|<track-list>|<auto-track-list>","-ms-grid-rows":"none|<track-list>|<auto-track-list>","-ms-high-contrast-adjust":"auto|none","-ms-hyphenate-limit-chars":"auto|<integer>{1,3}","-ms-hyphenate-limit-lines":"no-limit|<integer>","-ms-hyphenate-limit-zone":"<percentage>|<length>","-ms-ime-align":"auto|after","-ms-overflow-style":"auto|none|scrollbar|-ms-autohiding-scrollbar","-ms-scroll-chaining":"chained|none","-ms-scroll-limit":"<'-ms-scroll-limit-x-min'> <'-ms-scroll-limit-y-min'> <'-ms-scroll-limit-x-max'> <'-ms-scroll-limit-y-max'>","-ms-scroll-limit-x-max":"auto|<length>","-ms-scroll-limit-x-min":"<length>","-ms-scroll-limit-y-max":"auto|<length>","-ms-scroll-limit-y-min":"<length>","-ms-scroll-rails":"none|railed","-ms-scroll-snap-points-x":"snapInterval( <length-percentage> , <length-percentage> )|snapList( <length-percentage># )","-ms-scroll-snap-points-y":"snapInterval( <length-percentage> , <length-percentage> )|snapList( <length-percentage># )","-ms-scroll-snap-type":"none|proximity|mandatory","-ms-scroll-snap-x":"<'-ms-scroll-snap-type'> <'-ms-scroll-snap-points-x'>","-ms-scroll-snap-y":"<'-ms-scroll-snap-type'> <'-ms-scroll-snap-points-y'>","-ms-scroll-translation":"none|vertical-to-horizontal","-ms-scrollbar-3dlight-color":"<color>","-ms-scrollbar-arrow-color":"<color>","-ms-scrollbar-base-color":"<color>","-ms-scrollbar-darkshadow-color":"<color>","-ms-scrollbar-face-color":"<color>","-ms-scrollbar-highlight-color":"<color>","-ms-scrollbar-shadow-color":"<color>","-ms-scrollbar-track-color":"<color>","-ms-text-autospace":"none|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space","-ms-touch-select":"grippers|none","-ms-user-select":"none|element|text","-ms-wrap-flow":"auto|both|start|end|maximum|clear","-ms-wrap-margin":"<length>","-ms-wrap-through":"wrap|none","-moz-appearance":"none|button|button-arrow-down|button-arrow-next|button-arrow-previous|button-arrow-up|button-bevel|button-focus|caret|checkbox|checkbox-container|checkbox-label|checkmenuitem|dualbutton|groupbox|listbox|listitem|menuarrow|menubar|menucheckbox|menuimage|menuitem|menuitemtext|menulist|menulist-button|menulist-text|menulist-textfield|menupopup|menuradio|menuseparator|meterbar|meterchunk|progressbar|progressbar-vertical|progresschunk|progresschunk-vertical|radio|radio-container|radio-label|radiomenuitem|range|range-thumb|resizer|resizerpanel|scale-horizontal|scalethumbend|scalethumb-horizontal|scalethumbstart|scalethumbtick|scalethumb-vertical|scale-vertical|scrollbarbutton-down|scrollbarbutton-left|scrollbarbutton-right|scrollbarbutton-up|scrollbarthumb-horizontal|scrollbarthumb-vertical|scrollbartrack-horizontal|scrollbartrack-vertical|searchfield|separator|sheet|spinner|spinner-downbutton|spinner-textfield|spinner-upbutton|splitter|statusbar|statusbarpanel|tab|tabpanel|tabpanels|tab-scroll-arrow-back|tab-scroll-arrow-forward|textfield|textfield-multiline|toolbar|toolbarbutton|toolbarbutton-dropdown|toolbargripper|toolbox|tooltip|treeheader|treeheadercell|treeheadersortarrow|treeitem|treeline|treetwisty|treetwistyopen|treeview|-moz-mac-unified-toolbar|-moz-win-borderless-glass|-moz-win-browsertabbar-toolbox|-moz-win-communicationstext|-moz-win-communications-toolbox|-moz-win-exclude-glass|-moz-win-glass|-moz-win-mediatext|-moz-win-media-toolbox|-moz-window-button-box|-moz-window-button-box-maximized|-moz-window-button-close|-moz-window-button-maximize|-moz-window-button-minimize|-moz-window-button-restore|-moz-window-frame-bottom|-moz-window-frame-left|-moz-window-frame-right|-moz-window-titlebar|-moz-window-titlebar-maximized","-moz-binding":"<url>|none","-moz-border-bottom-colors":"<color>+|none","-moz-border-left-colors":"<color>+|none","-moz-border-right-colors":"<color>+|none","-moz-border-top-colors":"<color>+|none","-moz-context-properties":"none|[fill|fill-opacity|stroke|stroke-opacity]#","-moz-float-edge":"border-box|content-box|margin-box|padding-box","-moz-force-broken-image-icon":"0|1","-moz-orient":"inline|block|horizontal|vertical","-moz-outline-radius":"<outline-radius>{1,4} [/ <outline-radius>{1,4}]?","-moz-outline-radius-bottomleft":"<outline-radius>","-moz-outline-radius-bottomright":"<outline-radius>","-moz-outline-radius-topleft":"<outline-radius>","-moz-outline-radius-topright":"<outline-radius>","-moz-stack-sizing":"ignore|stretch-to-fit","-moz-text-blink":"none|blink","-moz-user-focus":"ignore|normal|select-after|select-before|select-menu|select-same|select-all|none","-moz-user-input":"auto|none|enabled|disabled","-moz-user-modify":"read-only|read-write|write-only","-moz-window-dragging":"drag|no-drag","-moz-window-shadow":"default|menu|tooltip|sheet|none","-webkit-appearance":"none|button|button-bevel|caps-lock-indicator|caret|checkbox|default-button|inner-spin-button|listbox|listitem|media-controls-background|media-controls-fullscreen-background|media-current-time-display|media-enter-fullscreen-button|media-exit-fullscreen-button|media-fullscreen-button|media-mute-button|media-overlay-play-button|media-play-button|media-seek-back-button|media-seek-forward-button|media-slider|media-sliderthumb|media-time-remaining-display|media-toggle-closed-captions-button|media-volume-slider|media-volume-slider-container|media-volume-sliderthumb|menulist|menulist-button|menulist-text|menulist-textfield|meter|progress-bar|progress-bar-value|push-button|radio|scrollbarbutton-down|scrollbarbutton-left|scrollbarbutton-right|scrollbarbutton-up|scrollbargripper-horizontal|scrollbargripper-vertical|scrollbarthumb-horizontal|scrollbarthumb-vertical|scrollbartrack-horizontal|scrollbartrack-vertical|searchfield|searchfield-cancel-button|searchfield-decoration|searchfield-results-button|searchfield-results-decoration|slider-horizontal|slider-vertical|sliderthumb-horizontal|sliderthumb-vertical|square-button|textarea|textfield|-apple-pay-button","-webkit-border-before":"<'border-width'>||<'border-style'>||<color>","-webkit-border-before-color":"<color>","-webkit-border-before-style":"<'border-style'>","-webkit-border-before-width":"<'border-width'>","-webkit-box-reflect":"[above|below|right|left]? <length>? <image>?","-webkit-line-clamp":"none|<integer>","-webkit-mask":"[<mask-reference>||<position> [/ <bg-size>]?||<repeat-style>||[<visual-box>|border|padding|content|text]||[<visual-box>|border|padding|content]]#","-webkit-mask-attachment":"<attachment>#","-webkit-mask-clip":"[<coord-box>|no-clip|border|padding|content|text]#","-webkit-mask-composite":"<composite-style>#","-webkit-mask-image":"<mask-reference>#","-webkit-mask-origin":"[<coord-box>|border|padding|content]#","-webkit-mask-position":"<position>#","-webkit-mask-position-x":"[<length-percentage>|left|center|right]#","-webkit-mask-position-y":"[<length-percentage>|top|center|bottom]#","-webkit-mask-repeat":"<repeat-style>#","-webkit-mask-repeat-x":"repeat|no-repeat|space|round","-webkit-mask-repeat-y":"repeat|no-repeat|space|round","-webkit-mask-size":"<bg-size>#","-webkit-overflow-scrolling":"auto|touch","-webkit-tap-highlight-color":"<color>","-webkit-text-fill-color":"<color>","-webkit-text-stroke":"<length>||<color>","-webkit-text-stroke-color":"<color>","-webkit-text-stroke-width":"<length>","-webkit-touch-callout":"default|none","-webkit-user-modify":"read-only|read-write|read-write-plaintext-only","-webkit-user-select":"auto|none|text|all","accent-color":"auto|<color>","align-content":"normal|<baseline-position>|<content-distribution>|<overflow-position>? <content-position>","align-items":"normal|stretch|<baseline-position>|[<overflow-position>? <self-position>]|anchor-center","align-self":"auto|normal|stretch|<baseline-position>|<overflow-position>? <self-position>|anchor-center","align-tracks":"[normal|<baseline-position>|<content-distribution>|<overflow-position>? <content-position>]#","alignment-baseline":"auto|baseline|before-edge|text-before-edge|middle|central|after-edge|text-after-edge|ideographic|alphabetic|hanging|mathematical",all:"initial|inherit|unset|revert|revert-layer","anchor-name":"none|<dashed-ident>#","anchor-scope":"none|all|<dashed-ident>#",animation:"<single-animation>#","animation-composition":"<single-animation-composition>#","animation-delay":"<time>#","animation-direction":"<single-animation-direction>#","animation-duration":"[auto|<time [0s,\u221E]>]#","animation-fill-mode":"<single-animation-fill-mode>#","animation-iteration-count":"<single-animation-iteration-count>#","animation-name":"[none|<keyframes-name>]#","animation-play-state":"<single-animation-play-state>#","animation-range":"[<'animation-range-start'> <'animation-range-end'>?]#","animation-range-end":"[normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#","animation-range-start":"[normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#","animation-timeline":"<single-animation-timeline>#","animation-timing-function":"<easing-function>#","animation-trigger":"[none|[<dashed-ident> <animation-action>+]+]#",appearance:"none|auto|<compat-auto>|<compat-special>","aspect-ratio":"auto||<ratio>","backdrop-filter":"none|<filter-value-list>","backface-visibility":"visible|hidden",background:"<bg-layer>#? , <final-bg-layer>","background-attachment":"<attachment>#","background-blend-mode":"<blend-mode>#","background-clip":"<bg-clip>#","background-color":"<color>","background-image":"<bg-image>#","background-origin":"<visual-box>#","background-position":"<bg-position>#","background-position-x":"[center|[[left|right|x-start|x-end]? <length-percentage>?]!]#","background-position-y":"[center|[[top|bottom|y-start|y-end]? <length-percentage>?]!]#","background-repeat":"<repeat-style>#","background-size":"<bg-size>#","baseline-shift":"baseline|sub|super|<svg-length>","baseline-source":"auto|first|last","block-size":"<'width'>",border:"<line-width>||<line-style>||<color>","border-block":"<'border-block-start'>","border-block-color":"<'border-top-color'>{1,2}","border-block-end":"<'border-top-width'>||<'border-top-style'>||<color>","border-block-end-color":"<'border-top-color'>","border-block-end-style":"<'border-top-style'>","border-block-end-width":"<'border-top-width'>","border-block-start":"<'border-top-width'>||<'border-top-style'>||<color>","border-block-start-color":"<'border-top-color'>","border-block-start-style":"<'border-top-style'>","border-block-start-width":"<'border-top-width'>","border-block-style":"<'border-top-style'>{1,2}","border-block-width":"<'border-top-width'>{1,2}","border-bottom":"<line-width>||<line-style>||<color>","border-bottom-color":"<'border-top-color'>","border-bottom-left-radius":"<length-percentage [0,\u221E]>{1,2}","border-bottom-right-radius":"<length-percentage [0,\u221E]>{1,2}","border-bottom-style":"<line-style>","border-bottom-width":"<line-width>","border-collapse":"separate|collapse","border-color":"<color>{1,4}","border-end-end-radius":"<'border-top-left-radius'>","border-end-start-radius":"<'border-top-left-radius'>","border-image":"<'border-image-source'>||<'border-image-slice'> [/ <'border-image-width'>|/ <'border-image-width'>? / <'border-image-outset'>]?||<'border-image-repeat'>","border-image-outset":"[<length [0,\u221E]>|<number [0,\u221E]>]{1,4}","border-image-repeat":"[stretch|repeat|round|space]{1,2}","border-image-slice":"[<number [0,\u221E]>|<percentage [0,\u221E]>]{1,4}&&fill?","border-image-source":"none|<image>","border-image-width":"[<length-percentage [0,\u221E]>|<number [0,\u221E]>|auto]{1,4}","border-inline":"<'border-block-start'>","border-inline-color":"<'border-top-color'>{1,2}","border-inline-end":"<'border-top-width'>||<'border-top-style'>||<color>","border-inline-end-color":"<'border-top-color'>","border-inline-end-style":"<'border-top-style'>","border-inline-end-width":"<'border-top-width'>","border-inline-start":"<'border-top-width'>||<'border-top-style'>||<color>","border-inline-start-color":"<'border-top-color'>","border-inline-start-style":"<'border-top-style'>","border-inline-start-width":"<'border-top-width'>","border-inline-style":"<'border-top-style'>{1,2}","border-inline-width":"<'border-top-width'>{1,2}","border-left":"<line-width>||<line-style>||<color>","border-left-color":"<color>","border-left-style":"<line-style>","border-left-width":"<line-width>","border-radius":"<length-percentage [0,\u221E]>{1,4} [/ <length-percentage [0,\u221E]>{1,4}]?","border-right":"<line-width>||<line-style>||<color>","border-right-color":"<color>","border-right-style":"<line-style>","border-right-width":"<line-width>","border-spacing":"<length>{1,2}","border-start-end-radius":"<'border-top-left-radius'>","border-start-start-radius":"<'border-top-left-radius'>","border-style":"<line-style>{1,4}","border-top":"<line-width>||<line-style>||<color>","border-top-color":"<color>","border-top-left-radius":"<length-percentage [0,\u221E]>{1,2}","border-top-right-radius":"<length-percentage [0,\u221E]>{1,2}","border-top-style":"<line-style>","border-top-width":"<line-width>","border-width":"<line-width>{1,4}",bottom:"auto|<length-percentage>|<anchor()>|<anchor-size()>","box-align":"start|center|end|baseline|stretch","box-decoration-break":"slice|clone","box-direction":"normal|reverse|inherit","box-flex":"<number>","box-flex-group":"<integer>","box-lines":"single|multiple","box-ordinal-group":"<integer>","box-orient":"horizontal|vertical|inline-axis|block-axis|inherit","box-pack":"start|center|end|justify","box-shadow":"none|<shadow>#","box-sizing":"content-box|border-box","break-after":"auto|avoid|always|all|avoid-page|page|left|right|recto|verso|avoid-column|column|avoid-region|region","break-before":"auto|avoid|always|all|avoid-page|page|left|right|recto|verso|avoid-column|column|avoid-region|region","break-inside":"auto|avoid|avoid-page|avoid-column|avoid-region","caption-side":"top|bottom",caret:"<'caret-color'>||<'caret-animation'>||<'caret-shape'>","caret-animation":"auto|manual","caret-color":"auto|<color>","caret-shape":"auto|bar|block|underscore",clear:"none|left|right|both|inline-start|inline-end",clip:"<shape>|auto","clip-path":"<clip-source>|[<basic-shape>||<geometry-box>]|none","clip-rule":"nonzero|evenodd",color:"<color>","color-interpolation-filters":"auto|sRGB|linearRGB","color-scheme":"normal|[light|dark|<custom-ident>]+&&only?","column-count":"<integer>|auto","column-fill":"auto|balance","column-gap":"normal|<length-percentage>","column-height":"auto|<length [0,\u221E]>","column-rule":"<'column-rule-width'>||<'column-rule-style'>||<'column-rule-color'>","column-rule-color":"<color>","column-rule-style":"<'border-style'>","column-rule-width":"<'border-width'>","column-span":"none|all","column-width":"auto|<length [0,\u221E]>","column-wrap":"auto|nowrap|wrap",columns:"[<'column-width'>||<'column-count'>] [/ <'column-height'>]?",contain:"none|strict|content|[[size||inline-size]||layout||style||paint]","contain-intrinsic-block-size":"auto? [none|<length>]","contain-intrinsic-height":"auto? [none|<length>]","contain-intrinsic-inline-size":"auto? [none|<length>]","contain-intrinsic-size":"[auto? [none|<length>]]{1,2}","contain-intrinsic-width":"auto? [none|<length>]",container:"<'container-name'> [/ <'container-type'>]?","container-name":"none|<custom-ident>+","container-type":"normal||[size|inline-size]",content:"normal|none|[<content-replacement>|<content-list>] [/ [<string>|<counter>|<attr()>]+]?","content-visibility":"visible|auto|hidden","corner-block-end-shape":"<corner-shape-value>{1,2}","corner-block-start-shape":"<corner-shape-value>{1,2}","corner-bottom-shape":"<corner-shape-value>{1,2}","corner-bottom-left-shape":"<corner-shape-value>","corner-bottom-right-shape":"<corner-shape-value>","corner-end-end-shape":"<corner-shape-value>","corner-end-start-shape":"<corner-shape-value>","corner-inline-end-shape":"<corner-shape-value>{1,2}","corner-inline-start-shape":"<corner-shape-value>{1,2}","corner-left-shape":"<corner-shape-value>{1,2}","corner-right-shape":"<corner-shape-value>{1,2}","corner-shape":"<corner-shape-value>{1,4}","corner-start-start-shape":"<corner-shape-value>","corner-start-end-shape":"<corner-shape-value>","corner-top-shape":"<corner-shape-value>{1,2}","corner-top-left-shape":"<corner-shape-value>","corner-top-right-shape":"<corner-shape-value>","counter-increment":"[<counter-name> <integer>?]+|none","counter-reset":"[<counter-name> <integer>?|<reversed-counter-name> <integer>?]+|none","counter-set":"[<counter-name> <integer>?]+|none",cursor:"[[<url> [<x> <y>]? ,]* [auto|default|none|context-menu|help|pointer|progress|wait|cell|crosshair|text|vertical-text|alias|copy|move|no-drop|not-allowed|e-resize|n-resize|ne-resize|nw-resize|s-resize|se-resize|sw-resize|w-resize|ew-resize|ns-resize|nesw-resize|nwse-resize|col-resize|row-resize|all-scroll|zoom-in|zoom-out|grab|grabbing|hand|-webkit-grab|-webkit-grabbing|-webkit-zoom-in|-webkit-zoom-out|-moz-grab|-moz-grabbing|-moz-zoom-in|-moz-zoom-out]]",cx:"<length>|<percentage>",cy:"<length>|<percentage>",d:"none|path( <string> )",direction:"ltr|rtl",display:"[<display-outside>||<display-inside>]|<display-listitem>|<display-internal>|<display-box>|<display-legacy>|<-non-standard-display>","dominant-baseline":"auto|use-script|no-change|reset-size|ideographic|alphabetic|hanging|mathematical|central|middle|text-after-edge|text-before-edge","dynamic-range-limit":"standard|no-limit|constrained|<dynamic-range-limit-mix()>","empty-cells":"show|hide","field-sizing":"content|fixed",fill:"<paint>","fill-opacity":"<number-zero-one>|<percentage>","fill-rule":"nonzero|evenodd",filter:"none|<filter-value-list>|<-ms-filter-function-list>",flex:"none|[<'flex-grow'> <'flex-shrink'>?||<'flex-basis'>]","flex-basis":"content|<'width'>","flex-direction":"row|row-reverse|column|column-reverse","flex-flow":"<'flex-direction'>||<'flex-wrap'>","flex-grow":"<number>","flex-shrink":"<number>","flex-wrap":"nowrap|wrap|wrap-reverse",float:"left|right|none|inline-start|inline-end","flood-color":"<color>","flood-opacity":"<'opacity'>",font:"[[<'font-style'>||<font-variant-css2>||<'font-weight'>||<font-width-css3>]? <'font-size'> [/ <'line-height'>]? <'font-family'>#]|<system-family-name>|<-non-standard-font>","font-family":"[<family-name>|<generic-family>]#","font-feature-settings":"normal|<feature-tag-value>#","font-kerning":"auto|normal|none","font-language-override":"normal|<string>","font-optical-sizing":"auto|none","font-palette":"normal|light|dark|<palette-identifier>|<palette-mix()>","font-size":"<absolute-size>|<relative-size>|<length-percentage [0,\u221E]>|math","font-size-adjust":"none|[ex-height|cap-height|ch-width|ic-width|ic-height]? [from-font|<number>]","font-smooth":"auto|never|always|<absolute-size>|<length>","font-stretch":"<font-stretch-absolute>","font-style":"normal|italic|oblique <angle>?","font-synthesis":"none|[weight||style||small-caps||position]","font-synthesis-position":"auto|none","font-synthesis-small-caps":"auto|none","font-synthesis-style":"auto|none","font-synthesis-weight":"auto|none","font-variant":"normal|none|[<common-lig-values>||<discretionary-lig-values>||<historical-lig-values>||<contextual-alt-values>||stylistic( <feature-value-name> )||historical-forms||styleset( <feature-value-name># )||character-variant( <feature-value-name># )||swash( <feature-value-name> )||ornaments( <feature-value-name> )||annotation( <feature-value-name> )||[small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps]||<numeric-figure-values>||<numeric-spacing-values>||<numeric-fraction-values>||ordinal||slashed-zero||<east-asian-variant-values>||<east-asian-width-values>||ruby]","font-variant-alternates":"normal|[stylistic( <feature-value-name> )||historical-forms||styleset( <feature-value-name># )||character-variant( <feature-value-name># )||swash( <feature-value-name> )||ornaments( <feature-value-name> )||annotation( <feature-value-name> )]","font-variant-caps":"normal|small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps","font-variant-east-asian":"normal|[<east-asian-variant-values>||<east-asian-width-values>||ruby]","font-variant-emoji":"normal|text|emoji|unicode","font-variant-ligatures":"normal|none|[<common-lig-values>||<discretionary-lig-values>||<historical-lig-values>||<contextual-alt-values>]","font-variant-numeric":"normal|[<numeric-figure-values>||<numeric-spacing-values>||<numeric-fraction-values>||ordinal||slashed-zero]","font-variant-position":"normal|sub|super","font-variation-settings":"normal|[<string> <number>]#","font-weight":"<font-weight-absolute>|bolder|lighter","font-width":"normal|<percentage [0,\u221E]>|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded","forced-color-adjust":"auto|none|preserve-parent-color",gap:"<'row-gap'> <'column-gap'>?",grid:"<'grid-template'>|<'grid-template-rows'> / [auto-flow&&dense?] <'grid-auto-columns'>?|[auto-flow&&dense?] <'grid-auto-rows'>? / <'grid-template-columns'>","grid-area":"<grid-line> [/ <grid-line>]{0,3}","grid-auto-columns":"<track-size>+","grid-auto-flow":"[row|column]||dense","grid-auto-rows":"<track-size>+","grid-column":"<grid-line> [/ <grid-line>]?","grid-column-end":"<grid-line>","grid-column-gap":"<length-percentage>","grid-column-start":"<grid-line>","grid-gap":"<'grid-row-gap'> <'grid-column-gap'>?","grid-row":"<grid-line> [/ <grid-line>]?","grid-row-end":"<grid-line>","grid-row-gap":"<length-percentage>","grid-row-start":"<grid-line>","grid-template":"none|[<'grid-template-rows'> / <'grid-template-columns'>]|[<line-names>? <string> <track-size>? <line-names>?]+ [/ <explicit-track-list>]?","grid-template-areas":"none|<string>+","grid-template-columns":"none|<track-list>|<auto-track-list>|subgrid <line-name-list>?","grid-template-rows":"none|<track-list>|<auto-track-list>|subgrid <line-name-list>?","hanging-punctuation":"none|[first||[force-end|allow-end]||last]",height:"auto|<length-percentage [0,\u221E]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,\u221E]> )|<calc-size()>|<anchor-size()>|stretch|<-non-standard-size>","hyphenate-character":"auto|<string>","hyphenate-limit-chars":"[auto|<integer>]{1,3}",hyphens:"none|manual|auto","image-orientation":"from-image|<angle>|[<angle>? flip]","image-rendering":"auto|crisp-edges|pixelated|smooth|optimizeSpeed|optimizeQuality|<-non-standard-image-rendering>","image-resolution":"[from-image||<resolution>]&&snap?","ime-mode":"auto|normal|active|inactive|disabled","initial-letter":"normal|[<number> <integer>?]","initial-letter-align":"[auto|alphabetic|hanging|ideographic]","inline-size":"<'width'>",inset:"<'top'>{1,4}","inset-block":"<'top'>{1,2}","inset-block-end":"<'top'>","inset-block-start":"<'top'>","inset-inline":"<'top'>{1,2}","inset-inline-end":"<'top'>","inset-inline-start":"<'top'>","interpolate-size":"numeric-only|allow-keywords",isolation:"auto|isolate",interactivity:"auto|inert","interest-delay":"<'interest-delay-start'>{1,2}","interest-delay-end":"normal|<time>","interest-delay-start":"normal|<time>","justify-content":"normal|<content-distribution>|<overflow-position>? [<content-position>|left|right]","justify-items":"normal|stretch|<baseline-position>|<overflow-position>? [<self-position>|left|right]|legacy|legacy&&[left|right|center]|anchor-center","justify-self":"auto|normal|stretch|<baseline-position>|<overflow-position>? [<self-position>|left|right]|anchor-center","justify-tracks":"[normal|<content-distribution>|<overflow-position>? [<content-position>|left|right]]#",left:"auto|<length-percentage>|<anchor()>|<anchor-size()>","letter-spacing":"normal|<length-percentage>","lighting-color":"<color>","line-break":"auto|loose|normal|strict|anywhere","line-clamp":"none|<integer>","line-height":"normal|<number>|<length>|<percentage>","line-height-step":"<length>","list-style":"<'list-style-type'>||<'list-style-position'>||<'list-style-image'>","list-style-image":"<image>|none","list-style-position":"inside|outside","list-style-type":"<counter-style>|<string>|none",margin:"<'margin-top'>{1,4}","margin-block":"<'margin-top'>{1,2}","margin-block-end":"<'margin-top'>","margin-block-start":"<'margin-top'>","margin-bottom":"<length-percentage>|auto|<anchor-size()>","margin-inline":"<'margin-top'>{1,2}","margin-inline-end":"<'margin-top'>","margin-inline-start":"<'margin-top'>","margin-left":"<length-percentage>|auto|<anchor-size()>","margin-right":"<length-percentage>|auto|<anchor-size()>","margin-top":"<length-percentage>|auto|<anchor-size()>","margin-trim":"none|in-flow|all",marker:"none|<url>","marker-end":"none|<url>","marker-mid":"none|<url>","marker-start":"none|<url>",mask:"<mask-layer>#","mask-border":"<'mask-border-source'>||<'mask-border-slice'> [/ <'mask-border-width'>? [/ <'mask-border-outset'>]?]?||<'mask-border-repeat'>||<'mask-border-mode'>","mask-border-mode":"luminance|alpha","mask-border-outset":"[<length>|<number>]{1,4}","mask-border-repeat":"[stretch|repeat|round|space]{1,2}","mask-border-slice":"<number-percentage>{1,4} fill?","mask-border-source":"none|<image>","mask-border-width":"[<length-percentage>|<number>|auto]{1,4}","mask-clip":"[<coord-box>|no-clip]#","mask-composite":"<compositing-operator>#","mask-image":"<mask-reference>#","mask-mode":"<masking-mode>#","mask-origin":"<coord-box>#","mask-position":"<position>#","mask-repeat":"<repeat-style>#","mask-size":"<bg-size>#","mask-type":"luminance|alpha","masonry-auto-flow":"[pack|next]||[definite-first|ordered]","math-depth":"auto-add|add( <integer> )|<integer>","math-shift":"normal|compact","math-style":"normal|compact","max-block-size":"<'max-width'>","max-height":"none|<length-percentage [0,\u221E]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,\u221E]> )|<calc-size()>|<anchor-size()>|stretch|<-non-standard-size>","max-inline-size":"<'max-width'>","max-lines":"none|<integer>","max-width":"none|<length-percentage [0,\u221E]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,\u221E]> )|<calc-size()>|<anchor-size()>|stretch|<-non-standard-size>","min-block-size":"<'min-width'>","min-height":"auto|<length-percentage [0,\u221E]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,\u221E]> )|<calc-size()>|<anchor-size()>|stretch|<-non-standard-size>","min-inline-size":"<'min-width'>","min-width":"auto|<length-percentage [0,\u221E]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,\u221E]> )|<calc-size()>|<anchor-size()>|stretch|<-non-standard-size>","mix-blend-mode":"<blend-mode>|plus-darker|plus-lighter","object-fit":"fill|contain|cover|none|scale-down","object-position":"<position>","object-view-box":"none|<basic-shape-rect>",offset:"[<'offset-position'>? [<'offset-path'> [<'offset-distance'>||<'offset-rotate'>]?]?]! [/ <'offset-anchor'>]?","offset-anchor":"auto|<position>","offset-distance":"<length-percentage>","offset-path":"none|<offset-path>||<coord-box>","offset-position":"normal|auto|<position>","offset-rotate":"[auto|reverse]||<angle>",opacity:"<opacity-value>",order:"<integer>",orphans:"<integer>",outline:"<'outline-width'>||<'outline-style'>||<'outline-color'>","outline-color":"auto|<color>","outline-offset":"<length>","outline-style":"auto|<outline-line-style>","outline-width":"<line-width>",overflow:"[visible|hidden|clip|scroll|auto]{1,2}|<-non-standard-overflow>","overflow-anchor":"auto|none","overflow-block":"visible|hidden|clip|scroll|auto|<-non-standard-overflow>","overflow-clip-box":"padding-box|content-box","overflow-clip-margin":"<visual-box>||<length [0,\u221E]>","overflow-inline":"visible|hidden|clip|scroll|auto|<-non-standard-overflow>","overflow-wrap":"normal|break-word|anywhere","overflow-x":"visible|hidden|clip|scroll|auto|<-non-standard-overflow>","overflow-y":"visible|hidden|clip|scroll|auto|<-non-standard-overflow>",overlay:"none|auto","overscroll-behavior":"[contain|none|auto]{1,2}","overscroll-behavior-block":"contain|none|auto","overscroll-behavior-inline":"contain|none|auto","overscroll-behavior-x":"contain|none|auto","overscroll-behavior-y":"contain|none|auto",padding:"<'padding-top'>{1,4}","padding-block":"<'padding-top'>{1,2}","padding-block-end":"<'padding-top'>","padding-block-start":"<'padding-top'>","padding-bottom":"<length-percentage [0,\u221E]>","padding-inline":"<'padding-top'>{1,2}","padding-inline-end":"<'padding-top'>","padding-inline-start":"<'padding-top'>","padding-left":"<length-percentage [0,\u221E]>","padding-right":"<length-percentage [0,\u221E]>","padding-top":"<length-percentage [0,\u221E]>",page:"auto|<custom-ident>","page-break-after":"auto|always|avoid|left|right|recto|verso","page-break-before":"auto|always|avoid|left|right|recto|verso","page-break-inside":"auto|avoid","paint-order":"normal|[fill||stroke||markers]",perspective:"none|<length>","perspective-origin":"<position>","place-content":"<'align-content'> <'justify-content'>?","place-items":"<'align-items'> <'justify-items'>?","place-self":"<'align-self'> <'justify-self'>?","pointer-events":"auto|none|visiblePainted|visibleFill|visibleStroke|visible|painted|fill|stroke|all|inherit",position:"static|relative|absolute|sticky|fixed|-webkit-sticky","position-anchor":"auto|none|<anchor-name>","position-area":"none|<position-area>","position-try":"<'position-try-order'>? <'position-try-fallbacks'>","position-try-fallbacks":"none|[[<dashed-ident>||<try-tactic>]|<'position-area'>]#","position-try-order":"normal|<try-size>","position-visibility":"always|[anchors-valid||anchors-visible||no-overflow]","print-color-adjust":"economy|exact",quotes:"none|auto|[<string> <string>]+",r:"<length>|<percentage>","reading-flow":"normal|source-order|flex-visual|flex-flow|grid-rows|grid-columns|grid-order","reading-order":"<integer>",resize:"none|both|horizontal|vertical|block|inline",right:"auto|<length-percentage>|<anchor()>|<anchor-size()>",rotate:"none|<angle>|[x|y|z|<number>{3}]&&<angle>","row-gap":"normal|<length-percentage>","ruby-align":"start|center|space-between|space-around","ruby-merge":"separate|collapse|auto","ruby-overhang":"auto|none","ruby-position":"[alternate||[over|under]]|inter-character",rx:"<length>|<percentage>",ry:"<length>|<percentage>",scale:"none|[<number>|<percentage>]{1,3}","scroll-behavior":"auto|smooth","scroll-initial-target":"none|nearest","scroll-margin":"<length>{1,4}","scroll-margin-block":"<length>{1,2}","scroll-margin-block-end":"<length>","scroll-margin-block-start":"<length>","scroll-margin-bottom":"<length>","scroll-margin-inline":"<length>{1,2}","scroll-margin-inline-end":"<length>","scroll-margin-inline-start":"<length>","scroll-margin-left":"<length>","scroll-margin-right":"<length>","scroll-margin-top":"<length>","scroll-marker-group":"none|before|after","scroll-padding":"[auto|<length-percentage>]{1,4}","scroll-padding-block":"[auto|<length-percentage>]{1,2}","scroll-padding-block-end":"auto|<length-percentage>","scroll-padding-block-start":"auto|<length-percentage>","scroll-padding-bottom":"auto|<length-percentage>","scroll-padding-inline":"[auto|<length-percentage>]{1,2}","scroll-padding-inline-end":"auto|<length-percentage>","scroll-padding-inline-start":"auto|<length-percentage>","scroll-padding-left":"auto|<length-percentage>","scroll-padding-right":"auto|<length-percentage>","scroll-padding-top":"auto|<length-percentage>","scroll-snap-align":"[none|start|end|center]{1,2}","scroll-snap-coordinate":"none|<position>#","scroll-snap-destination":"<position>","scroll-snap-points-x":"none|repeat( <length-percentage> )","scroll-snap-points-y":"none|repeat( <length-percentage> )","scroll-snap-stop":"normal|always","scroll-snap-type":"none|[x|y|block|inline|both] [mandatory|proximity]?","scroll-snap-type-x":"none|mandatory|proximity","scroll-snap-type-y":"none|mandatory|proximity","scroll-target-group":"none|auto","scroll-timeline":"[<'scroll-timeline-name'> <'scroll-timeline-axis'>?]#","scroll-timeline-axis":"[block|inline|x|y]#","scroll-timeline-name":"[none|<dashed-ident>]#","scrollbar-color":"auto|<color>{2}","scrollbar-gutter":"auto|stable&&both-edges?","scrollbar-width":"auto|thin|none","shape-image-threshold":"<opacity-value>","shape-margin":"<length-percentage>","shape-outside":"none|[<shape-box>||<basic-shape>]|<image>","shape-rendering":"auto|optimizeSpeed|crispEdges|geometricPrecision","speak-as":"normal|spell-out||digits||[literal-punctuation|no-punctuation]","stop-color":"<'color'>","stop-opacity":"<'opacity'>",stroke:"<paint>","stroke-color":"<color>","stroke-dasharray":"none|[<svg-length>+]#","stroke-dashoffset":"<svg-length>","stroke-linecap":"butt|round|square","stroke-linejoin":"miter|round|bevel","stroke-miterlimit":"<number-one-or-greater>","stroke-opacity":"<'opacity'>","stroke-width":"<svg-length>","tab-size":"<integer>|<length>","table-layout":"auto|fixed","text-align":"start|end|left|right|center|justify|match-parent","text-align-last":"auto|start|end|left|right|center|justify","text-anchor":"start|middle|end","text-autospace":"normal|<autospace>|auto","text-box":"normal|<'text-box-trim'>||<'text-box-edge'>","text-box-edge":"auto|<text-edge>","text-box-trim":"none|trim-start|trim-end|trim-both","text-combine-upright":"none|all|[digits <integer>?]","text-decoration":"<'text-decoration-line'>||<'text-decoration-style'>||<'text-decoration-color'>||<'text-decoration-thickness'>","text-decoration-color":"<color>","text-decoration-inset":"<length>{1,2}|auto","text-decoration-line":"none|[underline||overline||line-through||blink]|spelling-error|grammar-error","text-decoration-skip":"none|[objects||[spaces|[leading-spaces||trailing-spaces]]||edges||box-decoration]","text-decoration-skip-ink":"auto|all|none","text-decoration-style":"solid|double|dotted|dashed|wavy","text-decoration-thickness":"auto|from-font|<length>|<percentage>","text-emphasis":"<'text-emphasis-style'>||<'text-emphasis-color'>","text-emphasis-color":"<color>","text-emphasis-position":"auto|[over|under]&&[right|left]?","text-emphasis-style":"none|[[filled|open]||[dot|circle|double-circle|triangle|sesame]]|<string>","text-indent":"<length-percentage>&&hanging?&&each-line?","text-justify":"auto|inter-character|inter-word|none","text-orientation":"mixed|upright|sideways","text-overflow":"[clip|ellipsis|<string>]{1,2}","text-rendering":"auto|optimizeSpeed|optimizeLegibility|geometricPrecision","text-shadow":"none|<shadow-t>#","text-size-adjust":"none|auto|<percentage>","text-spacing-trim":"space-all|normal|space-first|trim-start","text-transform":"none|[capitalize|uppercase|lowercase]||full-width||full-size-kana|math-auto","text-underline-offset":"auto|<length>|<percentage>","text-underline-position":"auto|from-font|[under||[left|right]]","text-wrap":"<'text-wrap-mode'>||<'text-wrap-style'>","text-wrap-mode":"wrap|nowrap","text-wrap-style":"auto|balance|stable|pretty","timeline-scope":"none|<dashed-ident>#","timeline-trigger":"none|[<'timeline-trigger-name'> <'timeline-trigger-source'> <'timeline-trigger-range'> ['/' <'timeline-trigger-exit-range'>]?]#","timeline-trigger-name":"none|<dashed-ident>#","timeline-trigger-exit-range":"[<'timeline-trigger-exit-range-start'> <'timeline-trigger-exit-range-end'>?]#","timeline-trigger-exit-range-end":"[auto|normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#","timeline-trigger-exit-range-start":"[auto|normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#","timeline-trigger-range":"[<'timeline-trigger-range-start'> <'timeline-trigger-range-end'>?]#","timeline-trigger-range-end":"[normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#","timeline-trigger-range-start":"[normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#","timeline-trigger-source":"<single-animation-timeline>#",top:"auto|<length-percentage>|<anchor()>|<anchor-size()>","touch-action":"auto|none|[[pan-x|pan-left|pan-right]||[pan-y|pan-up|pan-down]||pinch-zoom]|manipulation",transform:"none|<transform-list>","transform-box":"content-box|border-box|fill-box|stroke-box|view-box","transform-origin":"[<length-percentage>|left|center|right|top|bottom]|[[<length-percentage>|left|center|right]&&[<length-percentage>|top|center|bottom]] <length>?","transform-style":"flat|preserve-3d",transition:"<single-transition>#","transition-behavior":"<transition-behavior-value>#","transition-delay":"<time>#","transition-duration":"<time>#","transition-property":"none|<single-transition-property>#","transition-timing-function":"<easing-function>#",translate:"none|<length-percentage> [<length-percentage> <length>?]?","trigger-scope":"none|all|<dashed-ident>#","unicode-bidi":"normal|embed|isolate|bidi-override|isolate-override|plaintext|-moz-isolate|-moz-isolate-override|-moz-plaintext|-webkit-isolate|-webkit-isolate-override|-webkit-plaintext","user-select":"auto|text|none|all","vector-effect":"none|non-scaling-stroke|non-scaling-size|non-rotation|fixed-position","vertical-align":"baseline|sub|super|text-top|text-bottom|middle|top|bottom|<percentage>|<length>","view-timeline":"[<'view-timeline-name'> [<'view-timeline-axis'>||<'view-timeline-inset'>]?]#","view-timeline-axis":"[block|inline|x|y]#","view-timeline-inset":"[[auto|<length-percentage>]{1,2}]#","view-timeline-name":"[none|<dashed-ident>]#","view-transition-class":"none|<custom-ident>+","view-transition-name":"none|<custom-ident>|match-element",visibility:"visible|hidden|collapse","white-space":"normal|pre|pre-wrap|pre-line|<'white-space-collapse'>||<'text-wrap-mode'>","white-space-collapse":"collapse|preserve|preserve-breaks|preserve-spaces|break-spaces",widows:"<integer>",width:"auto|<length-percentage [0,\u221E]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,\u221E]> )|<calc-size()>|<anchor-size()>|stretch|<-non-standard-size>","will-change":"auto|<animateable-feature>#","word-break":"normal|break-all|keep-all|break-word|auto-phrase","word-spacing":"normal|<length>","word-wrap":"normal|break-word","writing-mode":"horizontal-tb|vertical-rl|vertical-lr|sideways-rl|sideways-lr|<svg-writing-mode>",x:"<length>|<percentage>",y:"<length>|<percentage>","z-index":"auto|<integer>",zoom:"normal|reset|<number [0,\u221E]>||<percentage [0,\u221E]>","-moz-background-clip":"padding|border","-moz-border-radius-bottomleft":"<'border-bottom-left-radius'>","-moz-border-radius-bottomright":"<'border-bottom-right-radius'>","-moz-border-radius-topleft":"<'border-top-left-radius'>","-moz-border-radius-topright":"<'border-bottom-right-radius'>","-moz-control-character-visibility":"visible|hidden","-moz-osx-font-smoothing":"auto|grayscale","-moz-user-select":"none|text|all|-moz-none","-ms-flex-align":"start|end|center|baseline|stretch","-ms-flex-item-align":"auto|start|end|center|baseline|stretch","-ms-flex-line-pack":"start|end|center|justify|distribute|stretch","-ms-flex-negative":"<'flex-shrink'>","-ms-flex-pack":"start|end|center|justify|distribute","-ms-flex-order":"<integer>","-ms-flex-positive":"<'flex-grow'>","-ms-flex-preferred-size":"<'flex-basis'>","-ms-interpolation-mode":"nearest-neighbor|bicubic","-ms-grid-column-align":"start|end|center|stretch","-ms-grid-row-align":"start|end|center|stretch","-ms-hyphenate-limit-last":"none|always|column|page|spread","-webkit-background-clip":"[<visual-box>|border|padding|content|text]#","-webkit-column-break-after":"always|auto|avoid","-webkit-column-break-before":"always|auto|avoid","-webkit-column-break-inside":"always|auto|avoid","-webkit-font-smoothing":"auto|none|antialiased|subpixel-antialiased","-webkit-mask-box-image":"[<url>|<gradient>|none] [<length-percentage>{4} <-webkit-mask-box-repeat>{2}]?","-webkit-print-color-adjust":"economy|exact","-webkit-text-security":"none|circle|disc|square","-webkit-user-drag":"none|element|auto",behavior:"<url>+",cue:"<'cue-before'> <'cue-after'>?","cue-after":"<url> <decibel>?|none","cue-before":"<url> <decibel>?|none","glyph-orientation-horizontal":"<angle>","glyph-orientation-vertical":"<angle>",kerning:"auto|<svg-length>",pause:"<'pause-before'> <'pause-after'>?","pause-after":"<time>|none|x-weak|weak|medium|strong|x-strong","pause-before":"<time>|none|x-weak|weak|medium|strong|x-strong","position-try-options":"<'position-try-fallbacks'>",rest:"<'rest-before'> <'rest-after'>?","rest-after":"<time>|none|x-weak|weak|medium|strong|x-strong","rest-before":"<time>|none|x-weak|weak|medium|strong|x-strong",speak:"auto|never|always","voice-balance":"<number>|left|center|right|leftwards|rightwards","voice-duration":"auto|<time>","voice-family":"[[<family-name>|<generic-voice>] ,]* [<family-name>|<generic-voice>]|preserve","voice-pitch":"<frequency>&&absolute|[[x-low|low|medium|high|x-high]||[<frequency>|<semitones>|<percentage>]]","voice-range":"<frequency>&&absolute|[[x-low|low|medium|high|x-high]||[<frequency>|<semitones>|<percentage>]]","voice-rate":"[normal|x-slow|slow|medium|fast|x-fast]||<percentage>","voice-stress":"normal|strong|moderate|none|reduced","voice-volume":"silent|[[x-soft|soft|medium|loud|x-loud]||<decibel>]","white-space-trim":"none|discard-before||discard-after||discard-inner"},atrules:{charset:{prelude:"<string>",descriptors:null},"counter-style":{prelude:"<counter-style-name>",descriptors:{"additive-symbols":"[<integer [0,\u221E]>&&<symbol>]#",fallback:"<counter-style-name>",negative:"<symbol> <symbol>?",pad:"<integer [0,\u221E]>&&<symbol>",prefix:"<symbol>",range:"[[<integer>|infinite]{2}]#|auto","speak-as":"auto|bullets|numbers|words|spell-out|<counter-style-name>",suffix:"<symbol>",symbols:"<symbol>+",system:"cyclic|numeric|alphabetic|symbolic|additive|[fixed <integer>?]|[extends <counter-style-name>]"}},container:{prelude:"[<container-name>]? <container-condition>",descriptors:null},document:{prelude:"[<url>|url-prefix( <string> )|domain( <string> )|media-document( <string> )|regexp( <string> )]#",descriptors:null},"font-face":{prelude:null,descriptors:{"ascent-override":"normal|<percentage>","descent-override":"normal|<percentage>","font-display":"auto|block|swap|fallback|optional","font-family":"<family-name>","font-feature-settings":"normal|<feature-tag-value>#","font-stretch":"<font-stretch-absolute>{1,2}","font-style":"normal|italic|oblique <angle>{0,2}","font-variation-settings":"normal|[<string> <number>]#","font-weight":"<font-weight-absolute>{1,2}","line-gap-override":"normal|<percentage>","size-adjust":"<percentage>",src:"[<url> [format( <string># )]?|local( <family-name> )]#","unicode-range":"<urange>#"}},"font-feature-values":{prelude:"<family-name>#",descriptors:null},"font-palette-values":{prelude:"<dashed-ident>",descriptors:{"base-palette":"light|dark|<integer [0,\u221E]>","font-family":"<family-name>#","override-colors":"[<integer [0,\u221E]> <color>]#"}},import:{prelude:"[<string>|<url>] [layer|layer( <layer-name> )]? [supports( [<supports-condition>|<declaration>] )]? <media-query-list>?",descriptors:null},keyframes:{prelude:"<keyframes-name>",descriptors:null},layer:{prelude:"[<layer-name>#|<layer-name>?]",descriptors:null},media:{prelude:"<media-query-list>",descriptors:null},namespace:{prelude:"<namespace-prefix>? [<string>|<url>]",descriptors:null},page:{prelude:"<page-selector-list>",descriptors:{bleed:"auto|<length>",marks:"none|[crop||cross]","page-orientation":"upright|rotate-left|rotate-right",size:"<length [0,\u221E]>{1,2}|auto|[<page-size>||[portrait|landscape]]"}},"position-try":{prelude:"<dashed-ident>",descriptors:{top:"<'top'>",left:"<'left'>",bottom:"<'bottom'>",right:"<'right'>","inset-block-start":"<'inset-block-start'>","inset-block-end":"<'inset-block-end'>","inset-inline-start":"<'inset-inline-start'>","inset-inline-end":"<'inset-inline-end'>","inset-block":"<'inset-block'>","inset-inline":"<'inset-inline'>",inset:"<'inset'>","margin-top":"<'margin-top'>","margin-left":"<'margin-left'>","margin-bottom":"<'margin-bottom'>","margin-right":"<'margin-right'>","margin-block-start":"<'margin-block-start'>","margin-block-end":"<'margin-block-end'>","margin-inline-start":"<'margin-inline-start'>","margin-inline-end":"<'margin-inline-end'>",margin:"<'margin'>","margin-block":"<'margin-block'>","margin-inline":"<'margin-inline'>",width:"<'width'>",height:"<'height'>","min-width":"<'min-width'>","min-height":"<'min-height'>","max-width":"<'max-width'>","max-height":"<'max-height'>","block-size":"<'block-size'>","inline-size":"<'inline-size'>","min-block-size":"<'min-block-size'>","min-inline-size":"<'min-inline-size'>","max-block-size":"<'max-block-size'>","max-inline-size":"<'max-inline-size'>","align-self":"<'align-self'>|anchor-center","justify-self":"<'justify-self'>|anchor-center"}},property:{prelude:"<custom-property-name>",descriptors:{inherits:"true|false","initial-value":"<declaration-value>?",syntax:"<string>"}},scope:{prelude:"[( <scope-start> )]? [to ( <scope-end> )]?",descriptors:null},"starting-style":{prelude:null,descriptors:null},supports:{prelude:"<supports-condition>",descriptors:null},"view-transition":{prelude:null,descriptors:{navigation:"auto|none",types:"none|<custom-ident>+"}},"font-features-values":{prelude:"[<string>|<custom-ident>]+",descriptors:{"font-display":"auto|block|swap|fallback|optional"}}}}});var Wp={};ye(Wp,{generate:()=>mP,name:()=>gP,parse:()=>Hp,structure:()=>fP});function Wl(e,t){let n=this.tokenStart+e,r=this.charCodeAt(n);for((r===Ur||r===er)&&(t&&this.error("Number sign is not allowed"),n++);n<this.tokenEnd;n++)Ht(this.charCodeAt(n))||this.error("Integer is expected",n)}function Ni(e){return Wl.call(this,0,e)}function Po(e,t){if(!this.cmpChar(this.tokenStart+e,t)){let n="";switch(t){case Hl:n="N is expected";break;case er:n="HyphenMinus is expected";break}this.error(n,this.tokenStart+e)}}function jp(){let e=0,t=0,n=this.tokenType;for(;n===13||n===25;)n=this.lookupType(++e);if(n!==10)if(this.isDelim(Ur,e)||this.isDelim(er,e)){t=this.isDelim(Ur,e)?Ur:er;do n=this.lookupType(++e);while(n===13||n===25);n!==10&&(this.skip(e),Ni.call(this,ni))}else return null;return e>0&&this.skip(e),t===0&&(n=this.charCodeAt(this.tokenStart),n!==Ur&&n!==er&&this.error("Number sign is expected")),Ni.call(this,t!==0),t===er?"-"+this.consume(10):this.consume(10)}function Hp(){let e=this.tokenStart,t=null,n=null;if(this.tokenType===10)Ni.call(this,dP),n=this.consume(10);else if(this.tokenType===1&&this.cmpChar(this.tokenStart,er))switch(t="-1",Po.call(this,1,Hl),this.tokenEnd-this.tokenStart){case 2:this.next(),n=jp.call(this);break;case 3:Po.call(this,2,er),this.next(),this.skipSC(),Ni.call(this,ni),n="-"+this.consume(10);break;default:Po.call(this,2,er),Wl.call(this,3,ni),this.next(),n=this.substrToCursor(e+2)}else if(this.tokenType===1||this.isDelim(Ur)&&this.lookupType(1)===1){let r=0;switch(t="1",this.isDelim(Ur)&&(r=1,this.next()),Po.call(this,0,Hl),this.tokenEnd-this.tokenStart){case 1:this.next(),n=jp.call(this);break;case 2:Po.call(this,1,er),this.next(),this.skipSC(),Ni.call(this,ni),n="-"+this.consume(10);break;default:Po.call(this,1,er),Wl.call(this,2,ni),this.next(),n=this.substrToCursor(e+r+1)}}else if(this.tokenType===12){let r=this.charCodeAt(this.tokenStart),o=r===Ur||r===er,i=this.tokenStart+o;for(;i<this.tokenEnd&&Ht(this.charCodeAt(i));i++);i===this.tokenStart+o&&this.error("Integer is expected",this.tokenStart+o),Po.call(this,i-this.tokenStart,Hl),t=this.substring(e,i),i+1===this.tokenEnd?(this.next(),n=jp.call(this)):(Po.call(this,i-this.tokenStart+1,er),i+2===this.tokenEnd?(this.next(),this.skipSC(),Ni.call(this,ni),n="-"+this.consume(10)):(Wl.call(this,i-this.tokenStart+2,ni),this.next(),n=this.substrToCursor(i+1)))}else this.error();return t!==null&&t.charCodeAt(0)===Ur&&(t=t.substr(1)),n!==null&&n.charCodeAt(0)===Ur&&(n=n.substr(1)),{type:"AnPlusB",loc:this.getLocation(e,this.tokenStart),a:t,b:n}}function mP(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)}var Ur,er,Hl,ni,dP,gP,fP,Vp=$(()=>{"use strict";lr();Ur=43,er=45,Hl=110,ni=!0,dP=!1;gP="AnPlusB",fP={a:[String,null],b:[String,null]}});var qp={};ye(qp,{generate:()=>SP,name:()=>xP,parse:()=>Gp,structure:()=>bP,walkContext:()=>yP});function G0(){return this.Raw(this.consumeUntilLeftCurlyBracketOrSemicolon,!0)}function hP(){for(let e=1,t;t=this.lookupType(e);e++){if(t===24)return!0;if(t===23||t===3)return!1}return!1}function Gp(e=!1){let t=this.tokenStart,n,r,o=null,i=null;switch(this.eat(3),n=this.substrToCursor(t+1),r=n.toLowerCase(),this.skipSC(),this.eof===!1&&this.tokenType!==23&&this.tokenType!==17&&(this.parseAtrulePrelude?o=this.parseWithFallback(this.AtrulePrelude.bind(this,n,e),G0):o=G0.call(this,this.tokenIndex),this.skipSC()),this.tokenType){case 17:this.next();break;case 23:hasOwnProperty.call(this.atrule,r)&&typeof this.atrule[r].block=="function"?i=this.atrule[r].block.call(this,e):i=this.Block(hP.call(this));break}return{type:"Atrule",loc:this.getLocation(t,this.tokenStart),name:n,prelude:o,block:i}}function SP(e){this.token(3,"@"+e.name),e.prelude!==null&&this.node(e.prelude),e.block?this.node(e.block):this.token(17,";")}var xP,yP,bP,Yp=$(()=>{"use strict";xP="Atrule",yP="atrule",bP={name:String,prelude:["AtrulePrelude","Raw",null],block:["Block",null]}});var Xp={};ye(Xp,{generate:()=>CP,name:()=>wP,parse:()=>Kp,structure:()=>kP,walkContext:()=>vP});function Kp(e){let t=null;return e!==null&&(e=e.toLowerCase()),this.skipSC(),hasOwnProperty.call(this.atrule,e)&&typeof this.atrule[e].prelude=="function"?t=this.atrule[e].prelude.call(this):t=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 CP(e){this.children(e)}var wP,vP,kP,Qp=$(()=>{"use strict";wP="AtrulePrelude",vP="atrulePrelude",kP={children:[[]]}});var ed={};ye(ed,{generate:()=>MP,name:()=>PP,parse:()=>Zp,structure:()=>LP});function EP(){this.eof&&this.error("Unexpected end of input");let e=this.tokenStart,t=!1;return this.isDelim(q0)?(t=!0,this.next()):this.isDelim(Jp)||this.eat(1),this.isDelim(Jp)?this.charCodeAt(this.tokenStart+1)!==Vl?(this.next(),this.eat(1)):t&&this.error("Identifier is expected",this.tokenEnd):t&&this.error("Vertical line is expected"),{type:"Identifier",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function AP(){let e=this.tokenStart,t=this.charCodeAt(e);return t!==Vl&&t!==FP&&t!==IP&&t!==TP&&t!==q0&&t!==Jp&&this.error("Attribute selector (=, ~=, ^=, $=, *=, |=) is expected"),this.next(),t!==Vl&&(this.isDelim(Vl)||this.error("Equal sign is expected"),this.next()),this.substrToCursor(e)}function Zp(){let e=this.tokenStart,t,n=null,r=null,o=null;return this.eat(19),this.skipSC(),t=EP.call(this),this.skipSC(),this.tokenType!==20&&(this.tokenType!==1&&(n=AP.call(this),this.skipSC(),r=this.tokenType===5?this.String():this.Identifier(),this.skipSC()),this.tokenType===1&&(o=this.consume(1),this.skipSC())),this.eat(20),{type:"AttributeSelector",loc:this.getLocation(e,this.tokenStart),name:t,matcher:n,value:r,flags:o}}function MP(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,"]")}var TP,q0,Vl,IP,Jp,FP,PP,LP,td=$(()=>{"use strict";TP=36,q0=42,Vl=61,IP=94,Jp=124,FP=126;PP="AttributeSelector",LP={name:"Identifier",matcher:[String,null],value:["String","Identifier",null],flags:[String,null]}});var rd={};ye(rd,{generate:()=>OP,name:()=>RP,parse:()=>nd,structure:()=>NP,walkContext:()=>zP});function X0(){return this.Raw(null,!0)}function Y0(){return this.parseWithFallback(this.Rule,X0)}function K0(){return this.Raw(this.consumeUntilSemicolonIncluded,!0)}function DP(){if(this.tokenType===17)return K0.call(this,this.tokenIndex);let e=this.parseWithFallback(this.Declaration,K0);return this.tokenType===17&&this.next(),e}function nd(e){let t=e?DP:Y0,n=this.tokenStart,r=this.createList();this.eat(23);e:for(;!this.eof;)switch(this.tokenType){case 24:break e;case 13:case 25:this.next();break;case 3:r.push(this.parseWithFallback(this.Atrule.bind(this,e),X0));break;default:e&&this.isDelim(BP)?r.push(Y0.call(this)):r.push(t.call(this))}return this.eof||this.eat(24),{type:"Block",loc:this.getLocation(n,this.tokenStart),children:r}}function OP(e){this.token(23,"{"),this.children(e,t=>{t.type==="Declaration"&&this.token(17,";")}),this.token(24,"}")}var BP,RP,zP,NP,od=$(()=>{"use strict";BP=38;RP="Block",zP="block",NP={children:[["Atrule","Rule","Declaration"]]}});var sd={};ye(sd,{generate:()=>UP,name:()=>_P,parse:()=>id,structure:()=>$P});function id(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 UP(e){this.token(9,"["),this.children(e),this.token(9,"]")}var _P,$P,ad=$(()=>{"use strict";_P="Brackets",$P={children:[[]]}});var cd={};ye(cd,{generate:()=>WP,name:()=>jP,parse:()=>ld,structure:()=>HP});function ld(){let e=this.tokenStart;return this.eat(15),{type:"CDC",loc:this.getLocation(e,this.tokenStart)}}function WP(){this.token(15,"-->")}var jP,HP,ud=$(()=>{"use strict";jP="CDC",HP=[]});var dd={};ye(dd,{generate:()=>qP,name:()=>VP,parse:()=>pd,structure:()=>GP});function pd(){let e=this.tokenStart;return this.eat(14),{type:"CDO",loc:this.getLocation(e,this.tokenStart)}}function qP(){this.token(14,"<!--")}var VP,GP,gd=$(()=>{"use strict";VP="CDO",GP=[]});var md={};ye(md,{generate:()=>QP,name:()=>KP,parse:()=>fd,structure:()=>XP});function fd(){return this.eatDelim(YP),{type:"ClassSelector",loc:this.getLocation(this.tokenStart-1,this.tokenEnd),name:this.consume(1)}}function QP(e){this.token(9,"."),this.token(1,e.name)}var YP,KP,XP,hd=$(()=>{"use strict";YP=46,KP="ClassSelector",XP={name:String}});var yd={};ye(yd,{generate:()=>rL,name:()=>tL,parse:()=>xd,structure:()=>nL});function xd(){let e=this.tokenStart,t;switch(this.tokenType){case 13:t=" ";break;case 9:switch(this.charCodeAt(this.tokenStart)){case ZP:case JP:case eL:this.next();break;case Q0:this.next(),this.eatIdent("deep"),this.eatDelim(Q0);break;default:this.error("Combinator is expected")}t=this.substrToCursor(e);break}return{type:"Combinator",loc:this.getLocation(e,this.tokenStart),name:t}}function rL(e){this.tokenize(e.name)}var JP,Q0,ZP,eL,tL,nL,bd=$(()=>{"use strict";JP=43,Q0=47,ZP=62,eL=126,tL="Combinator",nL={name:String}});var wd={};ye(wd,{generate:()=>lL,name:()=>sL,parse:()=>Sd,structure:()=>aL});function Sd(){let e=this.tokenStart,t=this.tokenEnd;return this.eat(25),t-e+2>=2&&this.charCodeAt(t-2)===oL&&this.charCodeAt(t-1)===iL&&(t-=2),{type:"Comment",loc:this.getLocation(e,this.tokenStart),value:this.substring(e+2,t)}}function lL(e){this.token(25,"/*"+e.value+"*/")}var oL,iL,sL,aL,vd=$(()=>{"use strict";oL=42,iL=47,sL="Comment",aL={value:String}});var Cd={};ye(Cd,{generate:()=>gL,name:()=>uL,parse:()=>kd,structure:()=>pL});function J0(e){return this.lookupTypeNonSC(1)===1&&cL.has(this.lookupTypeNonSC(2))?this.Feature(e):this.FeatureRange(e)}function kd(e="media"){let t=this.createList();e: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(()=>dL[e].call(this,e),()=>null);n||(n=this.parseWithFallback(()=>{this.eat(21);let r=this.Condition(e);return this.eat(22),r},()=>this.GeneralEnclosed(e))),t.push(n);break}case 2:{let n=this.parseWithFallback(()=>this.FeatureFunction(e),()=>null);n||(n=this.GeneralEnclosed(e)),t.push(n);break}default:break e}return t.isEmpty&&this.error("Condition is expected"),{type:"Condition",loc:this.getLocationFromList(t),kind:e,children:t}}function gL(e){e.children.forEach(t=>{t.type==="Condition"?(this.token(21,"("),this.node(t),this.token(22,")")):this.node(t)})}var cL,uL,pL,dL,Td=$(()=>{"use strict";cL=new Set([16,22,0]),uL="Condition",pL={kind:String,children:[["Identifier","Feature","FeatureFunction","FeatureRange","SupportsDeclaration"]]};dL={media:J0,container:J0,supports(){return this.SupportsDeclaration()}}});var Fd={};ye(Fd,{generate:()=>TL,name:()=>vL,parse:()=>Id,structure:()=>CL,walkContext:()=>kL});function bL(){return this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!0)}function SL(){return this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!1)}function wL(){let e=this.tokenIndex,t=this.Value();return t.type!=="Raw"&&this.eof===!1&&this.tokenType!==17&&this.isDelim(eS)===!1&&this.isBalanceEdge(e)===!1&&this.error(),t}function Id(){let e=this.tokenStart,t=this.tokenIndex,n=IL.call(this),r=Ll(n),o=r?this.parseCustomProperty:this.parseValue,i=r?SL:bL,s=!1,a;this.skipSC(),this.eat(16);let u=this.tokenIndex;if(r||this.skipSC(),o?a=this.parseWithFallback(wL,i):a=i.call(this,this.tokenIndex),r&&a.type==="Value"&&a.children.isEmpty){for(let c=u-this.tokenIndex;c<=0;c++)if(this.lookupType(c)===13){a.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}}return this.isDelim(eS)&&(s=FL.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:s,property:n,value:a}}function TL(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 IL(){let e=this.tokenStart;if(this.tokenType===9)switch(this.charCodeAt(this.tokenStart)){case xL:case mL:case yL:case fL:case hL:this.next();break;case Z0:this.next(),this.isDelim(Z0)&&this.next();break}return this.tokenType===4?this.eat(4):this.eat(1),this.substrToCursor(e)}function FL(){this.eat(9),this.skipSC();let e=this.consume(1);return e==="important"?!0:e}var eS,fL,mL,hL,xL,yL,Z0,vL,kL,CL,Ed=$(()=>{"use strict";Ml();eS=33,fL=35,mL=36,hL=38,xL=42,yL=43,Z0=47;vL="Declaration",kL="declaration",CL={important:[Boolean,String],property:String,value:["Value","Raw"]}});var Ld={};ye(Ld,{generate:()=>LL,name:()=>AL,parse:()=>Pd,structure:()=>PL});function Ad(){return this.Raw(this.consumeUntilSemicolonIncluded,!0)}function Pd(){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),Ad));break;default:this.isDelim(EL)?e.push(this.parseWithFallback(this.Rule,Ad)):e.push(this.parseWithFallback(this.Declaration,Ad))}return{type:"DeclarationList",loc:this.getLocationFromList(e),children:e}}function LL(e){this.children(e,t=>{t.type==="Declaration"&&this.token(17,";")})}var EL,AL,PL,Md=$(()=>{"use strict";EL=38;AL="DeclarationList",PL={children:[["Declaration","Atrule","Rule"]]}});var Dd={};ye(Dd,{generate:()=>DL,name:()=>ML,parse:()=>Bd,structure:()=>BL});function Bd(){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 DL(e){this.token(12,e.value+e.unit)}var ML,BL,Rd=$(()=>{"use strict";ML="Dimension",BL={value:String,unit:String}});var Nd={};ye(Nd,{generate:()=>OL,name:()=>zL,parse:()=>zd,structure:()=>NL});function zd(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:this.lookupNonWSType(1)===9?r=this.Ratio():r=this.Number();break;case 12:r=this.Dimension();break;case 1:r=this.Identifier();break;case 2:r=this.parseWithFallback(()=>{let o=this.Function(this.readSequence,this.scope.Value);return this.skipSC(),this.isDelim(RL)&&this.error(),o},()=>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 OL(e){this.token(21,"("),this.token(1,e.name),e.value!==null&&(this.token(16,":"),this.node(e.value)),this.token(22,")")}var RL,zL,NL,Od=$(()=>{"use strict";RL=47,zL="Feature",NL={kind:String,name:String,value:["Identifier","Number","Dimension","Ratio","Function",null]}});var $d={};ye($d,{generate:()=>jL,name:()=>_L,parse:()=>_d,structure:()=>$L});function UL(e,t){let r=(this.features[e]||{})[t];return typeof r!="function"&&this.error(`Unknown feature ${t}()`),r}function _d(e="unknown"){let t=this.tokenStart,n=this.consumeFunctionName(),r=UL.call(this,e,n.toLowerCase());this.skipSC();let o=this.parseWithFallback(()=>{let i=this.tokenIndex,s=r.call(this);return this.eof===!1&&this.isBalanceEdge(i)===!1&&this.error(),s},()=>this.Raw(null,!1));return this.eof||this.eat(22),{type:"FeatureFunction",loc:this.getLocation(t,this.tokenStart),kind:e,feature:n,value:o}}function jL(e){this.token(2,e.feature+"("),this.node(e.value),this.token(22,")")}var _L,$L,Ud=$(()=>{"use strict";_L="FeatureFunction",$L={kind:String,feature:String,value:["Declaration","Selector"]}});var Wd={};ye(Wd,{generate:()=>qL,name:()=>VL,parse:()=>Hd,structure:()=>GL});function jd(){switch(this.skipSC(),this.tokenType){case 10:return this.isDelim(tS,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(tS)&&this.error(),e},()=>this.Ratio());default:this.error("Number, dimension, ratio or identifier is expected")}}function rS(e){if(this.skipSC(),this.isDelim(HL)||this.isDelim(WL)){let t=this.source[this.tokenStart];return this.next(),this.isDelim(nS)?(this.next(),t+"="):t}if(this.isDelim(nS))return"=";this.error(`Expected ${e?'":", ':""}"<", ">", "=" or ")"`)}function Hd(e="unknown"){let t=this.tokenStart;this.skipSC(),this.eat(21);let n=jd.call(this),r=rS.call(this,n.type==="Identifier"),o=jd.call(this),i=null,s=null;return this.lookupNonWSType(0)!==22&&(i=rS.call(this),s=jd.call(this)),this.skipSC(),this.eat(22),{type:"FeatureRange",loc:this.getLocation(t,this.tokenStart),kind:e,left:n,leftComparison:r,middle:o,rightComparison:i,right:s}}function qL(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,")")}var tS,HL,nS,WL,VL,GL,Vd=$(()=>{"use strict";tS=47,HL=60,nS=61,WL=62,VL="FeatureRange",GL={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]}});var qd={};ye(qd,{generate:()=>QL,name:()=>YL,parse:()=>Gd,structure:()=>XL,walkContext:()=>KL});function Gd(e,t){let n=this.tokenStart,r=this.consumeFunctionName(),o=r.toLowerCase(),i;return i=t.hasOwnProperty(o)?t[o].call(this,t):e.call(this,t),this.eof||this.eat(22),{type:"Function",loc:this.getLocation(n,this.tokenStart),name:r,children:i}}function QL(e){this.token(2,e.name+"("),this.children(e),this.token(22,")")}var YL,KL,XL,Yd=$(()=>{"use strict";YL="Function",KL="function",XL={name:String,children:[[]]}});var Xd={};ye(Xd,{generate:()=>eM,name:()=>JL,parse:()=>Kd,structure:()=>ZL});function Kd(e){let t=this.tokenStart,n=null;this.tokenType===2?n=this.consumeFunctionName():this.eat(21);let r=this.parseWithFallback(()=>{let o=this.tokenIndex,i=this.readSequence(this.scope.Value);return this.eof===!1&&this.isBalanceEdge(o)===!1&&this.error(),i},()=>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 eM(e){e.function?this.token(2,e.function+"("):this.token(21,"("),this.children(e),this.token(22,")")}var JL,ZL,Qd=$(()=>{"use strict";JL="GeneralEnclosed",ZL={kind:String,function:[String,null],children:[[]]}});var Zd={};ye(Zd,{generate:()=>oM,name:()=>nM,parse:()=>Jd,structure:()=>rM,xxx:()=>tM});function Jd(){let e=this.tokenStart;return this.eat(4),{type:"Hash",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e+1)}}function oM(e){this.token(4,"#"+e.value)}var tM,nM,rM,eg=$(()=>{"use strict";tM="XXX",nM="Hash",rM={value:String}});var ng={};ye(ng,{generate:()=>aM,name:()=>iM,parse:()=>tg,structure:()=>sM});function tg(){return{type:"Identifier",loc:this.getLocation(this.tokenStart,this.tokenEnd),name:this.consume(1)}}function aM(e){this.token(1,e.name)}var iM,sM,rg=$(()=>{"use strict";iM="Identifier",sM={name:String}});var ig={};ye(ig,{generate:()=>uM,name:()=>lM,parse:()=>og,structure:()=>cM});function og(){let e=this.tokenStart;return this.eat(4),{type:"IdSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e+1)}}function uM(e){this.token(9,"#"+e.name)}var lM,cM,sg=$(()=>{"use strict";lM="IdSelector",cM={name:String}});var lg={};ye(lg,{generate:()=>fM,name:()=>dM,parse:()=>ag,structure:()=>gM});function ag(){let e=this.tokenStart,t=this.consume(1);for(;this.isDelim(pM);)this.eat(9),t+="."+this.consume(1);return{type:"Layer",loc:this.getLocation(e,this.tokenStart),name:t}}function fM(e){this.tokenize(e.name)}var pM,dM,gM,cg=$(()=>{"use strict";pM=46,dM="Layer",gM={name:String}});var pg={};ye(pg,{generate:()=>xM,name:()=>mM,parse:()=>ug,structure:()=>hM});function ug(){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 xM(e){this.children(e,()=>this.token(18,","))}var mM,hM,dg=$(()=>{"use strict";mM="LayerList",hM={children:[["Layer"]]}});var fg={};ye(fg,{generate:()=>SM,name:()=>yM,parse:()=>gg,structure:()=>bM});function gg(){let e=this.tokenStart,t=null,n=null,r=null;if(this.skipSC(),this.tokenType===1&&this.lookupTypeNonSC(1)!==21){let o=this.consume(1),i=o.toLowerCase();switch(i==="not"||i==="only"?(this.skipSC(),t=i,n=this.consume(1)):n=o,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 SM(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)}var yM,bM,mg=$(()=>{"use strict";yM="MediaQuery",bM={modifier:[String,null],mediaType:[String,null],condition:["Condition",null]}});var xg={};ye(xg,{generate:()=>kM,name:()=>wM,parse:()=>hg,structure:()=>vM});function hg(){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 kM(e){this.children(e,()=>this.token(18,","))}var wM,vM,yg=$(()=>{"use strict";wM="MediaQueryList",vM={children:[["MediaQuery"]]}});var Sg={};ye(Sg,{generate:()=>FM,name:()=>TM,parse:()=>bg,structure:()=>IM});function bg(){let e=this.tokenStart;return this.eatDelim(CM),{type:"NestingSelector",loc:this.getLocation(e,this.tokenStart)}}function FM(){this.token(9,"&")}var CM,TM,IM,wg=$(()=>{"use strict";CM=38,TM="NestingSelector",IM={}});var kg={};ye(kg,{generate:()=>PM,name:()=>EM,parse:()=>vg,structure:()=>AM});function vg(){this.skipSC();let e=this.tokenStart,t=e,n=null,r;return this.lookupValue(0,"odd")||this.lookupValue(0,"even")?r=this.Identifier():r=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 PM(e){this.node(e.nth),e.selector!==null&&(this.token(1,"of"),this.node(e.selector))}var EM,AM,Cg=$(()=>{"use strict";EM="Nth",AM={nth:["AnPlusB","Identifier"],selector:["SelectorList",null]}});var Ig={};ye(Ig,{generate:()=>BM,name:()=>LM,parse:()=>Tg,structure:()=>MM});function Tg(){return{type:"Number",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consume(10)}}function BM(e){this.token(10,e.value)}var LM,MM,Fg=$(()=>{"use strict";LM="Number",MM={value:String}});var Ag={};ye(Ag,{generate:()=>zM,name:()=>DM,parse:()=>Eg,structure:()=>RM});function Eg(){let e=this.tokenStart;return this.next(),{type:"Operator",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function zM(e){this.tokenize(e.value)}var DM,RM,Pg=$(()=>{"use strict";DM="Operator",RM={value:String}});var Mg={};ye(Mg,{generate:()=>_M,name:()=>NM,parse:()=>Lg,structure:()=>OM});function Lg(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 _M(e){this.token(21,"("),this.children(e),this.token(22,")")}var NM,OM,Bg=$(()=>{"use strict";NM="Parentheses",OM={children:[[]]}});var Rg={};ye(Rg,{generate:()=>jM,name:()=>$M,parse:()=>Dg,structure:()=>UM});function Dg(){return{type:"Percentage",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consumeNumber(11)}}function jM(e){this.token(11,e.value+"%")}var $M,UM,zg=$(()=>{"use strict";$M="Percentage",UM={value:String}});var Og={};ye(Og,{generate:()=>GM,name:()=>HM,parse:()=>Ng,structure:()=>VM,walkContext:()=>WM});function Ng(){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 GM(e){this.token(16,":"),e.children===null?this.token(1,e.name):(this.token(2,e.name+"("),this.children(e),this.token(22,")"))}var HM,WM,VM,_g=$(()=>{"use strict";HM="PseudoClassSelector",WM="function",VM={name:String,children:[["Raw"],null]}});var Ug={};ye(Ug,{generate:()=>XM,name:()=>qM,parse:()=>$g,structure:()=>KM,walkContext:()=>YM});function $g(){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 XM(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,")"))}var qM,YM,KM,jg=$(()=>{"use strict";qM="PseudoElementSelector",YM="function",KM={name:String,children:[["Raw"],null]}});var Wg={};ye(Wg,{generate:()=>ZM,name:()=>QM,parse:()=>Hg,structure:()=>JM});function iS(){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")}}function Hg(){let e=this.tokenStart,t=iS.call(this),n=null;return this.skipSC(),this.isDelim(oS)&&(this.eatDelim(oS),n=iS.call(this)),{type:"Ratio",loc:this.getLocation(e,this.tokenStart),left:t,right:n}}function ZM(e){this.node(e.left),this.token(9,"/"),e.right?this.node(e.right):this.node(10,1)}var oS,QM,JM,Vg=$(()=>{"use strict";oS=47;QM="Ratio",JM={left:["Number","Function"],right:["Number","Function",null]}});var qg={};ye(qg,{generate:()=>rB,name:()=>tB,parse:()=>Gg,structure:()=>nB});function eB(){return this.tokenIndex>0&&this.lookupType(-1)===13?this.tokenIndex>1?this.getTokenStart(this.tokenIndex-1):this.firstCharOffset:this.tokenStart}function Gg(e,t){let n=this.getTokenStart(this.tokenIndex),r;return this.skipUntilBalanced(this.tokenIndex,e||this.consumeUntilBalanceEnd),t&&this.tokenStart>n?r=eB.call(this):r=this.tokenStart,{type:"Raw",loc:this.getLocation(n,r),value:this.substring(n,r)}}function rB(e){this.tokenize(e.value)}var tB,nB,Yg=$(()=>{"use strict";tB="Raw",nB={value:String}});var Xg={};ye(Xg,{generate:()=>lB,name:()=>iB,parse:()=>Kg,structure:()=>aB,walkContext:()=>sB});function sS(){return this.Raw(this.consumeUntilLeftCurlyBracket,!0)}function oB(){let e=this.SelectorList();return e.type!=="Raw"&&this.eof===!1&&this.tokenType!==23&&this.error(),e}function Kg(){let e=this.tokenIndex,t=this.tokenStart,n,r;return this.parseRulePrelude?n=this.parseWithFallback(oB,sS):n=sS.call(this,e),r=this.Block(!0),{type:"Rule",loc:this.getLocation(t,this.tokenStart),prelude:n,block:r}}function lB(e){this.node(e.prelude),this.node(e.block)}var iB,sB,aB,Qg=$(()=>{"use strict";iB="Rule",sB="rule",aB={prelude:["SelectorList","Raw"],block:["Block"]}});var Zg={};ye(Zg,{generate:()=>pB,name:()=>cB,parse:()=>Jg,structure:()=>uB});function Jg(){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 pB(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,")"))}var cB,uB,ef=$(()=>{"use strict";cB="Scope",uB={root:["SelectorList","Raw",null],limit:["SelectorList","Raw",null]}});var nf={};ye(nf,{generate:()=>fB,name:()=>dB,parse:()=>tf,structure:()=>gB});function tf(){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 fB(e){this.children(e)}var dB,gB,rf=$(()=>{"use strict";dB="Selector",gB={children:[["TypeSelector","IdSelector","ClassSelector","AttributeSelector","PseudoClassSelector","PseudoElementSelector","Combinator"]]}});var sf={};ye(sf,{generate:()=>yB,name:()=>mB,parse:()=>of,structure:()=>xB,walkContext:()=>hB});function of(){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 yB(e){this.children(e,()=>this.token(18,","))}var mB,hB,xB,af=$(()=>{"use strict";mB="SelectorList",hB="selector",xB={children:[["Selector","Raw"]]}});function Gl(e){let t=e.length,n=e.charCodeAt(0),r=n===aS||n===lS?1:0,o=r===1&&t>1&&e.charCodeAt(t-1)===n?t-2:t-1,i="";for(let s=r;s<=o;s++){let a=e.charCodeAt(s);if(a===lf){if(s===o){s!==t-1&&(i=e.substr(s+1));break}if(a=e.charCodeAt(++s),Nn(lf,a)){let u=s-1,c=eo(e,u);s=c-1,i+=ml(e.substring(u+1,c))}else a===13&&e.charCodeAt(s+1)===10&&s++}else i+=e[s]}return i}function cS(e,t){let n=t?"'":'"',r=t?lS:aS,o="",i=!1;for(let s=0;s<e.length;s++){let a=e.charCodeAt(s);if(a===0){o+="\uFFFD";continue}if(a<=31||a===127){o+="\\"+a.toString(16),i=!0;continue}a===r||a===lf?(o+="\\"+e.charAt(s),i=!1):(i&&(On(a)||_r(a))&&(o+=" "),o+=e.charAt(s),i=!1)}return n+o+n}var lf,aS,lS,ql=$(()=>{"use strict";lr();lf=92,aS=34,lS=39});var uf={};ye(uf,{generate:()=>wB,name:()=>bB,parse:()=>cf,structure:()=>SB});function cf(){return{type:"String",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:Gl(this.consume(5))}}function wB(e){this.token(5,cS(e.value))}var bB,SB,pf=$(()=>{"use strict";ql();bB="String",SB={value:String}});var gf={};ye(gf,{generate:()=>IB,name:()=>kB,parse:()=>df,structure:()=>TB,walkContext:()=>CB});function pS(){return this.Raw(null,!1)}function df(){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)!==vB){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,pS);break;default:n=this.parseWithFallback(this.Rule,pS)}t.push(n)}return{type:"StyleSheet",loc:this.getLocation(e,this.tokenStart),children:t}}function IB(e){this.children(e)}var vB,kB,CB,TB,ff=$(()=>{"use strict";vB=33;kB="StyleSheet",CB="stylesheet",TB={children:[["Comment","CDO","CDC","Atrule","Rule","Raw"]]}});var hf={};ye(hf,{generate:()=>AB,name:()=>FB,parse:()=>mf,structure:()=>EB});function mf(){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 AB(e){this.token(21,"("),this.node(e.declaration),this.token(22,")")}var FB,EB,xf=$(()=>{"use strict";FB="SupportsDeclaration",EB={declaration:"Declaration"}});var Sf={};ye(Sf,{generate:()=>BB,name:()=>LB,parse:()=>bf,structure:()=>MB});function yf(){this.tokenType!==1&&this.isDelim(PB)===!1&&this.error("Identifier or asterisk is expected"),this.next()}function bf(){let e=this.tokenStart;return this.isDelim(dS)?(this.next(),yf.call(this)):(yf.call(this),this.isDelim(dS)&&(this.next(),yf.call(this))),{type:"TypeSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function BB(e){this.tokenize(e.name)}var PB,dS,LB,MB,wf=$(()=>{"use strict";PB=42,dS=124;LB="TypeSelector",MB={name:String}});var Cf={};ye(Cf,{generate:()=>OB,name:()=>zB,parse:()=>kf,structure:()=>NB});function Hs(e,t){let n=0;for(let r=this.tokenStart+e;r<this.tokenEnd;r++){let o=this.charCodeAt(r);if(o===fS&&t&&n!==0)return Hs.call(this,e+n+1,!1),-1;On(o)||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 Yl(e){let t=0;for(;this.isDelim(vf);)++t>e&&this.error("Too many question marks"),this.next()}function DB(e){this.charCodeAt(this.tokenStart)!==e&&this.error((e===gS?"Plus sign":"Hyphen minus")+" is expected")}function RB(){let e=0;switch(this.tokenType){case 10:if(e=Hs.call(this,1,!0),this.isDelim(vf)){Yl.call(this,6-e);break}if(this.tokenType===12||this.tokenType===10){DB.call(this,fS),Hs.call(this,1,!1);break}break;case 12:e=Hs.call(this,1,!0),e>0&&Yl.call(this,6-e);break;default:if(this.eatDelim(gS),this.tokenType===1){e=Hs.call(this,0,!0),e>0&&Yl.call(this,6-e);break}if(this.isDelim(vf)){this.next(),Yl.call(this,5);break}this.error("Hex digit or question mark is expected")}}function kf(){let e=this.tokenStart;return this.eatIdent("u"),RB.call(this),{type:"UnicodeRange",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function OB(e){this.tokenize(e.value)}var gS,fS,vf,zB,NB,Tf=$(()=>{"use strict";lr();gS=43,fS=45,vf=63;zB="UnicodeRange",NB={value:String}});function hS(e){let t=e.length,n=4,r=e.charCodeAt(t-1)===mS?t-2:t-1,o="";for(;n<r&&_r(e.charCodeAt(n));)n++;for(;n<r&&_r(e.charCodeAt(r));)r--;for(let i=n;i<=r;i++){let s=e.charCodeAt(i);if(s===If){if(i===r){i!==t-1&&(o=e.substr(i+1));break}if(s=e.charCodeAt(++i),Nn(If,s)){let a=i-1,u=eo(e,a);i=u-1,o+=ml(e.substring(a+1,u))}else s===13&&e.charCodeAt(i+1)===10&&i++}else o+=e[i]}return o}function xS(e){let t="",n=!1;for(let r=0;r<e.length;r++){let o=e.charCodeAt(r);if(o===0){t+="\uFFFD";continue}if(o<=31||o===127){t+="\\"+o.toString(16),n=!0;continue}o===_B||o===If||o===$B||o===UB||o===jB||o===mS?(t+="\\"+e.charAt(r),n=!1):(n&&On(o)&&(t+=" "),t+=e.charAt(r),n=!1)}return"url("+t+")"}var _B,If,$B,UB,jB,mS,Ff=$(()=>{"use strict";lr();_B=32,If=92,$B=34,UB=39,jB=40,mS=41});var Af={};ye(Af,{generate:()=>VB,name:()=>HB,parse:()=>Ef,structure:()=>WB});function Ef(){let e=this.tokenStart,t;switch(this.tokenType){case 7:t=hS(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=Gl(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 VB(e){this.token(7,xS(e.value))}var HB,WB,Pf=$(()=>{"use strict";Ff();ql();HB="Url",WB={value:String}});var Mf={};ye(Mf,{generate:()=>YB,name:()=>GB,parse:()=>Lf,structure:()=>qB});function Lf(){let e=this.tokenStart,t=this.readSequence(this.scope.Value);return{type:"Value",loc:this.getLocation(e,this.tokenStart),children:t}}function YB(e){this.children(e)}var GB,qB,Bf=$(()=>{"use strict";GB="Value",qB={children:[[]]}});var Rf={};ye(Rf,{generate:()=>JB,name:()=>XB,parse:()=>Df,structure:()=>QB});function Df(){return this.eat(13),KB}function JB(e){this.token(13,e.value)}var KB,XB,QB,zf=$(()=>{"use strict";KB=Object.freeze({type:"WhiteSpace",loc:null,value:" "}),XB="WhiteSpace",QB={value:String}});var Ws={};ye(Ws,{AnPlusB:()=>Wp,Atrule:()=>qp,AtrulePrelude:()=>Xp,AttributeSelector:()=>ed,Block:()=>rd,Brackets:()=>sd,CDC:()=>cd,CDO:()=>dd,ClassSelector:()=>md,Combinator:()=>yd,Comment:()=>wd,Condition:()=>Cd,Declaration:()=>Fd,DeclarationList:()=>Ld,Dimension:()=>Dd,Feature:()=>Nd,FeatureFunction:()=>$d,FeatureRange:()=>Wd,Function:()=>qd,GeneralEnclosed:()=>Xd,Hash:()=>Zd,IdSelector:()=>ig,Identifier:()=>ng,Layer:()=>lg,LayerList:()=>pg,MediaQuery:()=>fg,MediaQueryList:()=>xg,NestingSelector:()=>Sg,Nth:()=>kg,Number:()=>Ig,Operator:()=>Ag,Parentheses:()=>Mg,Percentage:()=>Rg,PseudoClassSelector:()=>Og,PseudoElementSelector:()=>Ug,Ratio:()=>Wg,Raw:()=>qg,Rule:()=>Xg,Scope:()=>Zg,Selector:()=>nf,SelectorList:()=>sf,String:()=>uf,StyleSheet:()=>gf,SupportsDeclaration:()=>hf,TypeSelector:()=>Sf,UnicodeRange:()=>Cf,Url:()=>Af,Value:()=>Mf,WhiteSpace:()=>Rf});var Nf=$(()=>{"use strict";Vp();Yp();Qp();td();od();ad();ud();gd();hd();bd();vd();Td();Ed();Md();Rd();Od();Ud();Vd();Yd();Qd();eg();rg();sg();cg();dg();mg();yg();wg();Cg();Fg();Pg();Bg();zg();_g();jg();Vg();Yg();Qg();ef();rf();af();pf();ff();xf();wf();Tf();Pf();Bf();zf()});var bS,SS=$(()=>{"use strict";Bl();V0();Nf();bS={generic:!0,cssWideKeywords:Mi,...W0,node:Ws}});function Vs(e){switch(this.tokenType){case 4:return this.Hash();case 18:return this.Operator();case 21:return this.Parentheses(this.readSequence,e.recognizer);case 19:return this.Brackets(this.readSequence,e.recognizer);case 5:return this.String();case 12:return this.Dimension();case 11:return this.Percentage();case 10:return this.Number();case 2:return this.cmpStr(this.tokenStart,this.tokenEnd,"url(")?this.Url():this.Function(this.readSequence,e.recognizer);case 7:return this.Url();case 1:return this.cmpChar(this.tokenStart,rD)&&this.cmpChar(this.tokenStart+1,wS)?this.UnicodeRange():this.Identifier();case 9:{let t=this.charCodeAt(this.tokenStart);if(t===nD||t===eD||t===wS||t===tD)return this.Operator();t===ZB&&this.error("Hex or identifier is expected",this.tokenStart+1);break}}}var ZB,eD,wS,tD,nD,rD,Of=$(()=>{"use strict";ZB=35,eD=42,wS=43,tD=45,nD=47,rD=117});var vS,kS=$(()=>{"use strict";Of();vS={getNode:Vs}});function dD(e,t){t.last!==null&&t.last.type!=="Combinator"&&e!==null&&e.type!=="Combinator"&&t.push({type:"Combinator",loc:null,name:" "})}function gD(){switch(this.tokenType){case 19:return this.AttributeSelector();case 4:return this.IdSelector();case 16:return this.lookupType(1)===16?this.PseudoElementSelector():this.PseudoClassSelector();case 1:return this.TypeSelector();case 10:case 11:return this.Percentage();case 12:this.charCodeAt(this.tokenStart)===CS&&this.error("Identifier is expected",this.tokenStart+1);break;case 9:{switch(this.charCodeAt(this.tokenStart)){case aD:case cD:case pD:case lD:return this.Combinator();case CS:return this.ClassSelector();case sD:case uD:return this.TypeSelector();case oD:return this.IdSelector();case iD:return this.NestingSelector()}break}}}var oD,iD,sD,aD,lD,CS,cD,uD,pD,TS,IS=$(()=>{"use strict";oD=35,iD=38,sD=42,aD=43,lD=47,CS=46,cD=62,uD=124,pD=126;TS={onWhiteSpace:dD,getNode:gD}});function FS(){return this.createSingleNodeList(this.Raw(null,!1))}var ES=$(()=>{"use strict"});function AS(){let e=this.createList();if(this.skipSC(),e.push(this.Identifier()),this.skipSC(),this.tokenType===18){e.push(this.Operator());let t=this.tokenIndex,n=this.parseCustomProperty?this.Value(null):this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!1);if(n.type==="Value"&&n.children.isEmpty){for(let r=t-this.tokenIndex;r<=0;r++)if(this.lookupType(r)===13){n.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}}e.push(n)}return e}var PS=$(()=>{"use strict"});function LS(e){return e!==null&&e.type==="Operator"&&(e.value[e.value.length-1]==="-"||e.value[e.value.length-1]==="+")}var MS,BS=$(()=>{"use strict";Of();ES();PS();MS={getNode:Vs,onWhiteSpace(e,t){LS(e)&&(e.value=" "+e.value),LS(t.last)&&(t.last.value+=" ")},expression:FS,var:AS}});var _f={};ye(_f,{AtrulePrelude:()=>vS,Selector:()=>TS,Value:()=>MS});var DS=$(()=>{"use strict";kS();IS();BS()});var fD,RS,zS=$(()=>{"use strict";fD=new Set(["none","and","not","or"]),RS={parse:{prelude(){let e=this.createList();if(this.tokenType===1){let t=this.substring(this.tokenStart,this.tokenEnd);fD.has(t.toLowerCase())||e.push(this.Identifier())}return e.push(this.Condition("container")),e},block(e=!1){return this.Block(e)}}}});var NS,OS=$(()=>{"use strict";NS={parse:{prelude:null,block(){return this.Block(!0)}}}});function $f(e,t){return this.parseWithFallback(()=>{try{return e.call(this)}finally{this.skipSC(),this.lookupNonWSType(0)!==22&&this.error()}},t||(()=>this.Raw(null,!0)))}var _S,$S,US=$(()=>{"use strict";_S={layer(){this.skipSC();let e=this.createList(),t=$f.call(this,this.Layer);return(t.type!=="Raw"||t.value!=="")&&e.push(t),e},supports(){this.skipSC();let e=this.createList(),t=$f.call(this,this.Declaration,()=>$f.call(this,()=>this.Condition("supports")));return(t.type!=="Raw"||t.value!=="")&&e.push(t),e}},$S={parse:{prelude(){let e=this.createList();switch(this.tokenType){case 5:e.push(this.String());break;case 7:case 2:e.push(this.Url());break;default:this.error("String or url() is expected")}return this.skipSC(),this.tokenType===1&&this.cmpStr(this.tokenStart,this.tokenEnd,"layer")?e.push(this.Identifier()):this.tokenType===2&&this.cmpStr(this.tokenStart,this.tokenEnd,"layer(")&&e.push(this.Function(null,_S)),this.skipSC(),this.tokenType===2&&this.cmpStr(this.tokenStart,this.tokenEnd,"supports(")&&e.push(this.Function(null,_S)),(this.lookupNonWSType(0)===1||this.lookupNonWSType(0)===21)&&e.push(this.MediaQueryList()),e},block:null}}});var jS,HS=$(()=>{"use strict";jS={parse:{prelude(){return this.createSingleNodeList(this.LayerList())},block(){return this.Block(!1)}}}});var WS,VS=$(()=>{"use strict";WS={parse:{prelude(){return this.createSingleNodeList(this.MediaQueryList())},block(e=!1){return this.Block(e)}}}});var GS,qS=$(()=>{"use strict";GS={parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}}});var YS,KS=$(()=>{"use strict";YS={parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}}});var XS,QS=$(()=>{"use strict";XS={parse:{prelude(){return this.createSingleNodeList(this.Scope())},block(e=!1){return this.Block(e)}}}});var JS,ZS=$(()=>{"use strict";JS={parse:{prelude:null,block(e=!1){return this.Block(e)}}}});var ew,tw=$(()=>{"use strict";ew={parse:{prelude(){return this.createSingleNodeList(this.Condition("supports"))},block(e=!1){return this.Block(e)}}}});var nw,rw=$(()=>{"use strict";zS();OS();US();HS();VS();qS();KS();QS();ZS();tw();nw={container:RS,"font-face":NS,import:$S,layer:jS,media:WS,nest:GS,page:YS,scope:XS,"starting-style":JS,supports:ew}});function ow(){let e=this.createList();this.skipSC();e:for(;!this.eof;){switch(this.tokenType){case 1:e.push(this.Identifier());break;case 5:e.push(this.String());break;case 18:e.push(this.Operator());break;case 22:break e;default:this.error("Identifier, string or comma is expected")}this.skipSC()}return e}var iw=$(()=>{"use strict"});var ri,Uf,mD,hD,Kl,sw,aw=$(()=>{"use strict";iw();ri={parse(){return this.createSingleNodeList(this.SelectorList())}},Uf={parse(){return this.createSingleNodeList(this.Selector())}},mD={parse(){return this.createSingleNodeList(this.Identifier())}},hD={parse:ow},Kl={parse(){return this.createSingleNodeList(this.Nth())}},sw={dir:mD,has:ri,lang:hD,matches:ri,is:ri,"-moz-any":ri,"-webkit-any":ri,where:ri,not:ri,"nth-child":Kl,"nth-last-child":Kl,"nth-last-of-type":Kl,"nth-of-type":Kl,slotted:Uf,host:Uf,"host-context":Uf}});var jf={};ye(jf,{AnPlusB:()=>Hp,Atrule:()=>Gp,AtrulePrelude:()=>Kp,AttributeSelector:()=>Zp,Block:()=>nd,Brackets:()=>id,CDC:()=>ld,CDO:()=>pd,ClassSelector:()=>fd,Combinator:()=>xd,Comment:()=>Sd,Condition:()=>kd,Declaration:()=>Id,DeclarationList:()=>Pd,Dimension:()=>Bd,Feature:()=>zd,FeatureFunction:()=>_d,FeatureRange:()=>Hd,Function:()=>Gd,GeneralEnclosed:()=>Kd,Hash:()=>Jd,IdSelector:()=>og,Identifier:()=>tg,Layer:()=>ag,LayerList:()=>ug,MediaQuery:()=>gg,MediaQueryList:()=>hg,NestingSelector:()=>bg,Nth:()=>vg,Number:()=>Tg,Operator:()=>Eg,Parentheses:()=>Lg,Percentage:()=>Dg,PseudoClassSelector:()=>Ng,PseudoElementSelector:()=>$g,Ratio:()=>Hg,Raw:()=>Gg,Rule:()=>Kg,Scope:()=>Jg,Selector:()=>tf,SelectorList:()=>of,String:()=>cf,StyleSheet:()=>df,SupportsDeclaration:()=>mf,TypeSelector:()=>bf,UnicodeRange:()=>kf,Url:()=>Ef,Value:()=>Lf,WhiteSpace:()=>Df});var lw=$(()=>{"use strict";Vp();Yp();Qp();td();od();ad();ud();gd();hd();bd();vd();Td();Ed();Md();Rd();Od();Ud();Vd();Yd();Qd();eg();rg();sg();cg();dg();mg();yg();wg();Cg();Fg();Pg();Bg();zg();_g();jg();Vg();Yg();Qg();ef();rf();af();pf();ff();xf();wf();Tf();Pf();Bf();zf()});var cw,uw=$(()=>{"use strict";DS();rw();aw();lw();cw={parseContext:{default:"StyleSheet",stylesheet:"StyleSheet",atrule:"Atrule",atrulePrelude(e){return this.AtrulePrelude(e.atrule?String(e.atrule):null)},mediaQueryList:"MediaQueryList",mediaQuery:"MediaQuery",condition(e){return this.Condition(e.kind)},rule:"Rule",selectorList:"SelectorList",selector:"Selector",block(){return this.Block(!0)},declarationList:"DeclarationList",declaration:"Declaration",value:"Value"},features:{supports:{selector(){return this.Selector()}},container:{style(){return this.Declaration()}}},scope:_f,atrule:nw,pseudo:sw,node:jf}});var pw,dw=$(()=>{"use strict";Nf();pw={node:Ws}});var gw,fw=$(()=>{"use strict";H0();SS();uw();dw();gw=j0({...bS,...cw,...pw})});var mw=$(()=>{"use strict"});var hw=$(()=>{"use strict"});var oK,xw,iK,sK,aK,yw,lK,cK,uK,pK,dK,gK,bw=$(()=>{"use strict";fw();mw();Ap();Ml();hw();ql();Ff();({tokenize:oK,parse:xw,generate:iK,lexer:sK,createLexer:aK,walk:yw,find:lK,findLast:cK,findAll:uK,toPlainObject:pK,fromPlainObject:dK,fork:gK}=gw)});function SD(e){return e.toLowerCase().replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function ww(e){try{let t=xw(e.trim(),{context:"value"}),n=[];return yw(t,{enter(r){if(r.type==="Dimension"){let o=parseFloat(r.value);n.push(`${o}${r.unit}`)}else if(r.type==="Number"){let o=parseFloat(r.value);n.push(`${o}`)}else r.type==="Percentage"?n.push(`${parseFloat(r.value)}%`):r.type==="Identifier"?n.push(r.name.toLowerCase()):r.type==="Hash"?n.push(`#${r.value.toLowerCase()}`):r.type}}),n}catch{return[e.trim().toLowerCase()]}}function wD(e,t){let n=SD(e);if(!bD.has(n))return t;let r=ww(t);if(r.length<1||r.length>4)return t;let o=r.map(i=>i==="0"?"0px":i);return o.length===1?`${o[0]} ${o[0]} ${o[0]} ${o[0]}`:o.length===2?`${o[0]} ${o[1]} ${o[0]} ${o[1]}`:o.length===3?`${o[0]} ${o[1]} ${o[2]} ${o[1]}`:o.join(" ")}function Sw(e,t){let n=t.trim();if(!n)return"";let r=wD(e,n);return ww(r).map(i=>i==="0"?"0px":i).join(" ")}function vw(e,t,n){let r=Sw(e,t),o=Sw(e,n);return r!==""&&o!==""&&r===o}var bD,kw=$(()=>{"use strict";bw();bD=new Set(["padding","margin","border-radius","borderradius","inset","border-width","borderwidth"])});function vD(e){let t=e.toLowerCase();return t.length===4?`#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}`:t}function kD(e){let t=e.match(/rgba?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*[\d.]+)?\s*\)/);if(!t)return null;let n=parseInt(t[1],10).toString(16).padStart(2,"0"),r=parseInt(t[2],10).toString(16).padStart(2,"0"),o=parseInt(t[3],10).toString(16).padStart(2,"0");return`#${n}${r}${o}`}function Cw(e){let t=typeof e=="string"?e:String(e??"");if(!t||t==="[object Object]")return"";let n=t.match(/rgba?\s*\(\s*\d+\s*,\s*\d+\s*,\s*\d+(?:\s*,\s*[\d.]+)?\s*\)/);if(n){let i=kD(n[0]);if(i)return i}let r=t.match(/#([0-9a-fA-F]{3,8})/);if(r)return vD(r[0]);let o=t.match(/(-?\d+\.?\d*)(px|em|rem|%|pt|vw|vh)?/g);return o&&o.length>1?o.join(" ").toLowerCase():o&&o.length===1?o[0].toLowerCase():t.toLowerCase().trim().replace(/\s+/g," ")}function oi(e,t,n){if(!e||!t)return!1;let r=String(e),o=String(t),i=r.toLowerCase(),s=o.toLowerCase(),a=i.includes("none"),u=s.includes("none");if(a!==u)return!1;let c=/\b(fill|stroke)\s*:/i,l=c.test(r),d=c.test(o);if(l!==d)return!1;let g=Cw(r),p=Cw(o);return!!(g===p||n&&vw(n,r,o))}var Hf=$(()=>{"use strict";kw()});function ED(e){let t=String(e.property||"").toLowerCase(),n=String(e.description||"").toLowerCase(),r=String(e.expected||e.suggestedValue||"").toLowerCase(),o=String(e.actual||e.currentValue||"").toLowerCase();if(t.includes("color")||t.includes("fill")||t.includes("background")||n.includes("color")||n.includes("fill"))return!0;let i=s=>/^#[0-9a-f]{3,8}$/i.test(s)||s.includes("rgb")||["white","black","red","blue","green","orange","yellow","transparent"].includes(s);return!!(i(r)||i(o)||e.relatedProperties?.some(s=>{let a=s.property?.toLowerCase()||"";return a.includes("color")||a.includes("fill")||a.includes("background")}))}function Tw(e){if(e.includes("\xD7")||/\d+px\s*x\s*\d+px/i.test(e))return!1;let t=e.match(/\d+px/g);return t?t.length>1:!1}function AD(e){let t=String(e.expected||e.suggestedValue||"").toLowerCase(),n=String(e.actual||e.currentValue||"").toLowerCase(),r=String(e.property||"").toLowerCase(),o=String(e.description||"").toLowerCase(),i=n.includes("margin")||t.includes("margin")||r==="margin",s=t.includes("gap")||o.includes("gap");return i&&s}function PD(e,t,n){if(!e||!t)return!1;let r=typeof e=="string"?e:String(e??""),o=typeof t=="string"?t:String(t??"");if(!r||!o||r==="[object Object]"||o==="[object Object]"||n&&ED(n)||Tw(r)||Tw(o)||n&&AD(n))return!1;let i=parseFloat(r),s=parseFloat(o);if(isNaN(i)||isNaN(s))return!1;let a=Math.abs(i-s);if(r.includes("px")||o.includes("px")){let u=n?.property?.toLowerCase()||"";return u==="width"||u==="height"||u.includes("width")||u.includes("height")?a<Ew:a<Fw}return r.includes("%")||o.includes("%")?a<1:!1}function LD(e){let t=`${e.description||""} ${e.title||""} ${e.suggestedFix||""}`.toLowerCase();if(FD.some(s=>t.includes(s))||!TD.some(s=>t.includes(s)))return!1;let o=e.expected||e.suggestedValue,i=e.actual||e.currentValue;return!(o&&i&&!oi(o,i,e.property))}function MD(e){let t=(e.expected!==void 0?"fill":"").toLowerCase(),n=e.actual!==void 0||e.currentValue!==void 0?"fill":"";if(!(t==="fill"||n==="fill"||e.description?.toLowerCase().includes("fill")||e.title?.toLowerCase().includes("fill")))return!1;let o=String(e.expected||e.suggestedValue||"").toLowerCase();if(!(o==="none"||o==="transparent"||o.includes("no fills")||o.includes("transparent")))return!1;let s=`${e.description||""} ${e.title||""}`.toLowerCase();return s.includes("container")||s.includes("svg ")||s.includes("<svg")||s.includes("wrapper")}function BD(e){let t=`${e.description||""} ${e.title||""}`.toLowerCase(),n=e.property?.toLowerCase()||"";if(!(t.includes("text ")||t.includes("text layer")||t.includes("text span")||t.includes("span ")||t.includes("label "))||!(n==="width"||n==="height"||n.includes("width")||n.includes("height")||t.includes("width")||t.includes("height")))return!1;let i=e.expected||e.suggestedValue||"",s=e.actual||e.currentValue||"",a=parseFloat(i),u=parseFloat(s);return isNaN(a)||isNaN(u)?!1:Math.abs(a-u)<Aw}function DD(e){let t=`${e.description||""} ${e.title||""} ${e.suggestedFix||""}`.toLowerCase(),n=String(e.expected||e.suggestedValue||"").toLowerCase(),r=String(e.actual||e.currentValue||"").toLowerCase();if(!ID.some(d=>t.includes(d)||n.includes(d)))return!1;let i=`${t} ${n} ${r}`;if(i.includes("min-width")||i.includes("max-width")||i.includes("min-height")||i.includes("max-height")||i.includes("explicit")||i.includes("constraint")||i.includes("forced"))return!1;let a=n.includes("hug")||n.includes("auto"),u=/\d+\.?\d*px/.test(r);if(!a||!u)return!1;let c=n.match(/(\d+\.?\d*)px/),l=r.match(/(\d+\.?\d*)px/);return!(c&&l&&Math.abs(parseFloat(c[1])-parseFloat(l[1]))>CD)}function RD(e){let t=String(e.expected||e.suggestedValue||"").toLowerCase(),n=String(e.actual||e.currentValue||"").toLowerCase();return(!n||!t||n.includes("see ")||t.includes("see ")||n.includes("image")||t.includes("image"))&&e.type==="visual"}function Iw(e){return typeof e!="string"?"":(e.split(",")[0]||"").replace(/['"]/g,"").replace(/[\s_-]/g,"").toLowerCase().trim()}function zD(e,t,n){if((n||"").toLowerCase().replace(/[\s_-]/g,"")!=="fontfamily")return!1;let o=Iw(e),i=Iw(t);return o.length>0&&i.length>0&&o===i}function Gs(e){let t=e.expected||e.suggestedValue,n=e.actual||e.currentValue;if(zD(t,n,e.property))return{dismissed:!0,dismissReason:"Auto-dismissed: font-family naming difference (same font)",dismissedBy:"post-ai-validation"};if(e.programmaticallyVerified)return{dismissed:!1};if(e.fixRequired===!1)return{dismissed:!0,dismissReason:"Auto-dismissed: FixRequired is false (no code change needed)",dismissedBy:"post-ai-validation"};if(oi(t,n,e.property))return{dismissed:!0,dismissReason:"Auto-dismissed: expected equals actual (identical values)",dismissedBy:"post-ai-validation"};if(e.fixRequired===!0)return{dismissed:!1};if(BD(e))return{dismissed:!0,dismissReason:`Auto-dismissed: text dimension variance (<${Aw}px) - font rendering difference, not actionable`,dismissedBy:"post-ai-validation"};if(PD(t,n,e)){let r=e.property?.toLowerCase()||"";return{dismissed:!0,dismissReason:`Auto-dismissed: negligible difference (<${r==="width"||r==="height"||r.includes("width")||r.includes("height")?Ew:Fw}px)`,dismissedBy:"post-ai-validation"}}return RD(e)?{dismissed:!0,dismissReason:"Auto-dismissed: no measurable values to compare",dismissedBy:"post-ai-validation"}:LD(e)?{dismissed:!0,dismissReason:"Auto-dismissed: no fix needed",dismissedBy:"post-ai-validation"}:DD(e)?{dismissed:!0,dismissReason:"Auto-dismissed: HUG sizing - CSS auto-sizes content without explicit dimensions",dismissedBy:"post-ai-validation"}:MD(e)?{dismissed:!0,dismissReason:"Auto-dismissed: SVG container fill - child elements use their own fills",dismissedBy:"post-ai-validation"}:{dismissed:!1}}var Fw,Ew,Aw,CD,TD,ID,FD,Pw=$(()=>{"use strict";Hf();Fw=.5,Ew=2,Aw=2,CD=5,TD=["values match","values already match","already correct","correctly implemented","implementation is correct","css matches","matches figma","identical","same value","no difference","none - ","no changes needed","no fix needed"],ID=["hug","auto (hug)","should be hug","fixed pixel values are being rendered","fixed values are being rendered"],FD=["duplicate","extra","missing","additional","removed","should not exist","does not exist","not in figma","not in storybook","renders 2","renders two","has 1","has one"]});function Wf(e){let t=e.trim().match(/^#?([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/);if(!t)return null;let n=t[1];return n.length===3||n.length===4?n=n.slice(0,3).split("").map(r=>r+r).join(""):n.length===8&&(n=n.slice(0,6)),[parseInt(n.slice(0,2),16),parseInt(n.slice(2,4),16),parseInt(n.slice(4,6),16)]}function ND(e){let t=e.trim().match(/^rgba?\(\s*([^)]+)\)$/i);if(!t)return null;let n=t[1].replace(/\//g," ").split(/[\s,]+/).filter(Boolean);if(n.length<3)return null;let r=u=>u.endsWith("%")?Math.round(parseFloat(u)/100*255):Math.round(parseFloat(u)),o=r(n[0]),i=r(n[1]),s=r(n[2]);if([o,i,s].some(u=>isNaN(u)))return null;let a=u=>Math.max(0,Math.min(255,u));return[a(o),a(i),a(s)]}function OD(e,t,n){let r=(1-Math.abs(2*n-1))*t,o=(e%360+360)%360/60,i=r*(1-Math.abs(o%2-1)),s=0,a=0,u=0;o<1?[s,a,u]=[r,i,0]:o<2?[s,a,u]=[i,r,0]:o<3?[s,a,u]=[0,r,i]:o<4?[s,a,u]=[0,i,r]:o<5?[s,a,u]=[i,0,r]:[s,a,u]=[r,0,i];let c=n-r/2;return[Math.round((s+c)*255),Math.round((a+c)*255),Math.round((u+c)*255)]}function _D(e){let t=e.trim().match(/^hsla?\(\s*([^)]+)\)$/i);if(!t)return null;let n=t[1].replace(/\//g," ").split(/[\s,]+/).filter(Boolean);if(n.length<3)return null;let r=parseFloat(n[0]),o=parseFloat(n[1]),i=parseFloat(n[2]);return[r,o,i].some(s=>isNaN(s))?null:OD(r,o/100,i/100)}function UD(e){return $D[e.trim().toLowerCase()]??null}function Lw(e){return e?Wf(e)??ND(e)??_D(e)??Vf(e)??UD(e):null}function Vf(e){let t=e.trim().match(/^color\(\s*display-p3\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)(?:\s*\/\s*[\d.]+)?\s*\)$/);if(!t)return null;let n=parseFloat(t[1]),r=parseFloat(t[2]),o=parseFloat(t[3]);if(isNaN(n)||isNaN(r)||isNaN(o))return null;let i=p=>p<=.04045?p/12.92:Math.pow((p+.055)/1.055,2.4),s=i(n),a=i(r),u=i(o),c=1.2249*s-.2247*a+0*u,l=-.042*s+1.0419*a+0*u,d=-.0197*s-.0786*a+1.0983*u,g=p=>{let h=Math.max(0,Math.min(1,p));return h<=.0031308?12.92*h:1.055*Math.pow(h,1/2.4)-.055};return[Math.round(g(c)*255),Math.round(g(l)*255),Math.round(g(d)*255)]}function Mw(e,t,n){let r=F=>{let v=F/255;return v<=.04045?v/12.92:Math.pow((v+.055)/1.055,2.4)},o=r(e),i=r(t),s=r(n),a=o*.4124564+i*.3575761+s*.1804375,u=o*.2126729+i*.7151522+s*.072175,c=o*.0193339+i*.119192+s*.9503041,l=.95047,d=1,g=1.08883,p=F=>F>.008856?Math.cbrt(F):7.787*F+16/116,h=p(a/l),S=p(u/d),T=p(c/g);return[116*S-16,500*(h-S),200*(S-T)]}function Bw(e,t){let[n,r,o]=Mw(...e),[i,s,a]=Mw(...t),u=(n+i)/2,c=Math.sqrt(r*r+o*o),l=Math.sqrt(s*s+a*a),d=(c+l)/2,g=.5*(1-Math.sqrt(Math.pow(d,7)/(Math.pow(d,7)+Math.pow(25,7)))),p=(1+g)*r,h=(1+g)*s,S=Math.sqrt(p*p+o*o),T=Math.sqrt(h*h+a*a),F=(S+T)/2,v=(Math.atan2(o,p)*180/Math.PI+360)%360,D=(Math.atan2(a,h)*180/Math.PI+360)%360,N=D-v;Math.abs(N)>180&&(N-=Math.sign(N)*360);let U=i-n,L=T-S,z=2*Math.sqrt(S*T)*Math.sin(N*Math.PI/360),m=Math.abs(v-D)>180?(v+D+360)/2:(v+D)/2,b=1-.17*Math.cos((m-30)*Math.PI/180)+.24*Math.cos(2*m*Math.PI/180)+.32*Math.cos((3*m+6)*Math.PI/180)-.2*Math.cos((4*m-63)*Math.PI/180),w=1+.015*Math.pow(u-50,2)/Math.sqrt(20+Math.pow(u-50,2)),A=1+.045*F,f=1+.015*F*b,C=-2*Math.sqrt(Math.pow(F,7)/(Math.pow(F,7)+Math.pow(25,7)))*Math.sin(60*Math.exp(-Math.pow((m-275)/25,2))*Math.PI/180);return Math.sqrt(Math.pow(U/w,2)+Math.pow(L/A,2)+Math.pow(z/f,2)+C*(L/A)*(z/f))}function Dw(e){let t=(e.property||"").toLowerCase();if(!(t.includes("color")||t==="fill"||t==="background"||t==="backgroundcolor"))return!1;let r=String(e.expected||e.suggestedValue||""),o=String(e.actual||e.currentValue||""),i=Wf(r)??Wf(o),s=Vf(r)??Vf(o);return!i||!s||r===o?!1:Bw(i,s)<5}function Rw(e){let t=String(e.expected??e.suggestedValue??""),n=String(e.actual??e.currentValue??"");if(!t||!n||t===n)return null;let r=Lw(t),o=Lw(n);return!r||!o?null:Bw(r,o)}function qs(e){let t=e.severity||"minor";if(t==="minor")return t;if(Dw(e))return"minor";let n=Rw(e);if(n!==null)return n<2?"minor":n<5&&t==="critical"?"major":t;let r=["width","height","size","dimension","dimensions","r","cx","cy"],o=["dimension","layout"],i=new Set((e.property||"").replace(/([a-z])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(Boolean)),s=(e.type||"").toLowerCase();if(!(r.some(p=>i.has(p))||o.some(p=>s===p)))return t;let u=String(e.expected||e.suggestedValue||""),c=String(e.actual||e.currentValue||""),l=parseFloat(u.replace(/[^0-9.-]/g,"")),d=parseFloat(c.replace(/[^0-9.-]/g,""));if(isNaN(l)||isNaN(d))return t;let g=Math.abs(l-d);return g<5?"minor":g<10&&t==="critical"?"major":t}function Xl(e,t,n){return e>0?"D":t>0?"C":n>0?"B":"A"}function Ql(e){let t=e.filter(n=>!n.dismissed).map(n=>qs(n));return Xl(t.filter(n=>n==="critical").length,t.filter(n=>n==="major").length,t.filter(n=>n==="minor").length)}function ao(e,t,n){let r=100-n*1-t*3-e*10,o=so[Xl(e,t,n)];return Math.max(0,Math.min(o,r))}var $D,so,zw=$(()=>{"use strict";$D={white:[255,255,255],black:[0,0,0],red:[255,0,0],green:[0,128,0],blue:[0,0,255],yellow:[255,255,0],cyan:[0,255,255],aqua:[0,255,255],magenta:[255,0,255],fuchsia:[255,0,255],gray:[128,128,128],grey:[128,128,128],silver:[192,192,192],maroon:[128,0,0],olive:[128,128,0],lime:[0,255,0],teal:[0,128,128],navy:[0,0,128],purple:[128,0,128],orange:[255,165,0],pink:[255,192,203],brown:[165,42,42],gold:[255,215,0],beige:[245,245,220],ivory:[255,255,240],indigo:[75,0,130],violet:[238,130,238],coral:[255,127,80],salmon:[250,128,114],khaki:[240,230,140],crimson:[220,20,60],turquoise:[64,224,208],lightgray:[211,211,211],lightgrey:[211,211,211],darkgray:[169,169,169],darkgrey:[169,169,169],whitesmoke:[245,245,245],gainsboro:[220,220,220]};so={A:100,B:99,C:89,D:69}});var Nw=$(()=>{"use strict"});var Ow=$(()=>{"use strict"});var Gf=$(()=>{"use strict";Hf();Pw();zw();Nw();Ow()});var KD,XD,PK,qf=$(()=>{"use strict";KD=["flex","inline-flex"],XD=["grid","inline-grid"],PK=[...KD,...XD]});var $w=$(()=>{"use strict";Gf();qf()});var Uw=$(()=>{"use strict"});var ln=$(()=>{"use strict";Ou();_y();$y();Gf();qf();$w();Uw()});function JD(e){let{aiPrompt:t,aiResponse:n,...r}=e;return r}function tr(e){try{let t=e.map(JD),n=JSON.stringify(t,ZD);sessionStorage.setItem(Yf,n)}catch(t){y.error("[SessionStorage] Failed to save review history:",t)}}function Kf(){try{let e=sessionStorage.getItem(Yf);if(!e)return[];let t=JSON.parse(e,eR);return Array.isArray(t)?t:[]}catch(e){return y.error("[SessionStorage] Failed to load review history:",e),[]}}function jw(){try{let e=Kf();if(e.length===0)return;let t=!1,n=e.map(r=>{if(r.aiPrompt!==void 0||r.aiResponse!==void 0){t=!0;let{aiPrompt:o,aiResponse:i,...s}=r;return s}return r});t&&(tr(n),y.debug("[SessionStorage] Stripped aiPrompt/aiResponse from existing review history"))}catch(e){y.error("[SessionStorage] Failed to strip sensitive fields:",e)}}function Hw(){try{sessionStorage.removeItem(Yf),y.debug("[SessionStorage] Review history cleared")}catch(e){y.error("[SessionStorage] Failed to clear review history:",e)}}function ZD(e,t){return t instanceof Date?{__type:"Date",value:t.toISOString()}:t}function eR(e,t){return t&&t.__type==="Date"?new Date(t.value):t}var Yf,Xf=$(()=>{"use strict";ze();Yf="uicopilot_review_history"});import tR,{createContext as nR,useContext as rR,useReducer as oR,useMemo as Ww,useRef as iR,useEffect as sR}from"react";function Jl(e){let t=e.length>Vw?e.slice(e.length-Vw):e,n=Math.max(0,t.length-aR);return n===0?t:t.map((r,o)=>{if(o>=n)return r;let i=r.storybookImageData?.startsWith("data:"),s=r.figmaImageData?.startsWith("data:");return!i&&!s?r:{...r,storybookImageData:i?void 0:r.storybookImageData,figmaImageData:s?void 0:r.figmaImageData}})}function lR(e,t){switch(t.type){case"SET_STATE":return{...e,...t.payload};case"ADD_STREAMING_MESSAGE":return{...e,streamingMessages:[...e.streamingMessages,t.payload]};case"UPDATE_STREAMING_MESSAGE":return{...e,streamingMessages:e.streamingMessages.map((n,r)=>r===t.payload.index?{...n,content:t.payload.content}:n)};case"CLEAR_STREAMING_MESSAGES":return{...e,streamingMessages:[]};case"TOGGLE_MODEL":{let n=e.selectedModels.includes(t.payload);return n&&e.selectedModels.length===1?e:{...e,selectedModels:n?e.selectedModels.filter(r=>r!==t.payload):[...e.selectedModels,t.payload]}}case"SET_REVIEW_RESULTS":{if(!t.payload)return{...e,reviewResults:null,currentReviewId:null};let n=e.userRole==="admin",r={id:t.payload.id,componentId:t.payload.componentId,storyId:t.payload.storyId,modelId:t.payload.modelId,complianceScore:t.payload.complianceScore,issuesCount:t.payload.issuesCount,issues:t.payload.issues,createdAt:t.payload.createdAt,visualSimilarity:t.payload.visualSimilarity,storybookImageData:e.storybookImageUrl||void 0,figmaImageData:e.figmaImageUrl||void 0,aiPrompt:n&&e.fullPrompt||void 0,aiResponse:n&&e.fullResponse||void 0,costUsd:t.payload.costUsd,inputTokens:t.payload.inputTokens,outputTokens:t.payload.outputTokens},o=e.reviewHistory.findIndex(s=>s.id===t.payload.id),i;return o>=0?i=e.reviewHistory.map((s,a)=>a===o?r:s):i=[...e.reviewHistory,r],i=Jl(i),tr(i),{...e,reviewResults:t.payload,reviewHistory:i,currentReviewId:t.payload.id}}case"UPDATE_MULTI_MODEL_STREAMING":return e.multiModelResults?{...e,multiModelResults:{...e.multiModelResults,byModel:{...e.multiModelResults.byModel,[t.payload.modelId]:{...e.multiModelResults.byModel[t.payload.modelId],streamingMessages:t.payload.messages}}}}:{...e,multiModelResults:{byModel:{[t.payload.modelId]:{streamingMessages:t.payload.messages}},activeModelId:t.payload.modelId}};case"SET_MODEL_COMPLETED":return e.multiModelResults?{...e,multiModelResults:{...e.multiModelResults,byModel:{...e.multiModelResults.byModel,[t.payload]:{...e.multiModelResults.byModel[t.payload],completed:!0}}}}:e;case"BULK_ADD_REVIEWS":{if(t.payload.length===0)return e;let n=new Map(e.reviewHistory.map(s=>[s.id,s])),r=!1,o=e.reviewHistory.slice();for(let s of t.payload){let a=n.get(s.id);if(!a){o.push(s),r=!0;continue}let u=s.issues?.length??0,c=a.issues?.length??0;if(u>c){let l=o.indexOf(a);l!==-1&&(o[l]=s,r=!0)}}if(!r)return e;let i=Jl(o);return tr(i),{...e,reviewHistory:i}}case"ADD_REVIEW":{let n=Jl([...e.reviewHistory,t.payload]);return tr(n),{...e,reviewHistory:n,currentReviewId:t.payload.id}}case"TOGGLE_ISSUE_SELECTION":{if(!e.currentReviewId)return e;let n=e.reviewHistory.map(r=>r.id!==e.currentReviewId?r:{...r,issues:r.issues.map(o=>o.id===t.payload?{...o,selectedForFix:!o.selectedForFix}:o)});return tr(n),{...e,reviewHistory:n}}case"UPDATE_ISSUE_STATUS":{if(!e.currentReviewId)return e;let n=e.reviewHistory.map(r=>r.id!==e.currentReviewId?r:{...r,issues:r.issues.map(o=>o.id===t.payload.issueId?{...o,status:t.payload.status,error:t.payload.error}:o)});return tr(n),{...e,reviewHistory:n}}case"UPDATE_ISSUE_GENERATED_FIX":{if(!e.currentReviewId)return e;let n=e.reviewHistory.map(r=>r.id!==e.currentReviewId?r:{...r,issues:r.issues.map(o=>o.id===t.payload.issueId?{...o,generatedFix:o.generatedFix?{...o.generatedFix,...t.payload.generatedFix}:t.payload.generatedFix,selectedForFix:t.payload.generatedFix?.status==="failed"?!1:o.selectedForFix}:o)});return tr(n),{...e,reviewHistory:n}}case"BATCH_UPDATE_ISSUE_GENERATED_FIXES":{if(!e.currentReviewId)return e;let n=new Map(t.payload.map(o=>[o.issueId,o.generatedFix])),r=e.reviewHistory.map(o=>o.id!==e.currentReviewId?o:{...o,issues:o.issues.map(i=>{let s=n.get(i.id);return s?{...i,generatedFix:i.generatedFix?{...i.generatedFix,...s}:s,selectedForFix:s?.status==="failed"?!1:i.selectedForFix}:i})});return tr(r),{...e,reviewHistory:r}}case"DISMISS_ISSUE":{if(!e.currentReviewId)return e;let n=e.reviewHistory.map(r=>{if(r.id!==e.currentReviewId)return r;let o=r.issues.map(c=>c.id===t.payload.issueId?{...c,dismissed:!0,dismissReason:t.payload.reason,dismissedAt:new Date,dismissedBy:t.payload.dismissedBy}:c),i=o.filter(c=>!c.dismissed),s=i.filter(c=>c.severity==="critical").length,a=i.filter(c=>c.severity==="major").length,u=i.filter(c=>c.severity==="minor").length;return{...r,issues:o,complianceScore:ao(s,a,u),issuesCount:i.length}});return tr(n),{...e,reviewHistory:n}}case"UNDISMISS_ISSUE":{if(!e.currentReviewId)return e;let n=e.reviewHistory.map(r=>{if(r.id!==e.currentReviewId)return r;let o=r.issues.map(c=>c.id===t.payload?{...c,dismissed:!1,dismissReason:void 0,dismissedAt:void 0}:c),i=o.filter(c=>!c.dismissed),s=i.filter(c=>c.severity==="critical").length,a=i.filter(c=>c.severity==="major").length,u=i.filter(c=>c.severity==="minor").length;return{...r,issues:o,complianceScore:ao(s,a,u),issuesCount:i.length}});return tr(n),{...e,reviewHistory:n}}case"RECALCULATE_SCORE":{if(!e.currentReviewId)return e;let n=e.reviewHistory.map(r=>{if(r.id!==e.currentReviewId)return r;let o=r.issues.filter(c=>!c.dismissed),i=o.filter(c=>c.severity==="critical").length,s=o.filter(c=>c.severity==="major").length,a=o.filter(c=>c.severity==="minor").length,u=ao(i,s,a);return y.debug(`[recalculateScore] Active: ${o.length}, score: ${u}`),{...r,complianceScore:u,issuesCount:o.length}});return tr(n),{...e,reviewHistory:n}}case"UPDATE_REVIEW_SCORE":{let n=e.reviewHistory.map(r=>r.id!==t.payload.reviewId?r:{...r,complianceScore:t.payload.newScore});return tr(n),{...e,reviewHistory:n}}case"CLEAR_ALL_REVIEWS":return Hw(),{...e,reviewHistory:[],currentReviewId:null};case"CLEAR_STALE_REVIEWS":return{...e,currentReviewId:null,reviewResults:null};case"RESET_REVIEW":{let n=e.isReviewing;return{...e,isReviewing:!1,reviewError:null,reviewResults:n?null:e.reviewResults,multiModelResults:null,streamingMessages:[],streamingProgress:0,streamingStatus:"",reviewDetailTab:n?"chat":e.reviewDetailTab,fullPrompt:"",fullResponse:"",figmaImageUrl:n?null:e.figmaImageUrl,storybookImageUrl:n?null:e.storybookImageUrl,currentReviewId:n?null:e.currentReviewId}}case"RESET_PROMPT":return{...e,isGenerating:!1,generatedPrompt:null,promptError:null};case"TRIGGER_SCREENSHOT_REFRESH":return{...e,screenshotRefreshKey:e.screenshotRefreshKey+1};default:return e}}function Jf({children:e}){let[t,n]=oR(lR,gR),r=iR(t);sR(()=>{r.current=t},[t]);let o=Ww(()=>({setIsReviewing:s=>n({type:"SET_STATE",payload:{isReviewing:s}}),setReviewingStoryId:s=>n({type:"SET_STATE",payload:{reviewingStoryId:s}}),setReviewError:s=>n({type:"SET_STATE",payload:{reviewError:s}}),bulkAddReviews:s=>n({type:"BULK_ADD_REVIEWS",payload:s}),setReviewResults:s=>n({type:"SET_REVIEW_RESULTS",payload:s}),setMultiModelResults:s=>n({type:"SET_STATE",payload:{multiModelResults:s}}),updateMultiModelStreamingMessages:(s,a)=>n({type:"UPDATE_MULTI_MODEL_STREAMING",payload:{modelId:s,messages:a}}),setModelCompleted:s=>n({type:"SET_MODEL_COMPLETED",payload:s}),setActiveModelId:s=>{let a=r.current;a.multiModelResults&&n({type:"SET_STATE",payload:{multiModelResults:{...a.multiModelResults,activeModelId:s}}})},setShowReviewMenu:s=>n({type:"SET_STATE",payload:{showReviewMenu:s}}),setSeverityFilter:s=>n({type:"SET_STATE",payload:{severityFilter:s}}),setShowStreamingPanel:s=>n({type:"SET_STATE",payload:{showStreamingPanel:s}}),setStreamingPanelCollapsed:s=>n({type:"SET_STATE",payload:{streamingPanelCollapsed:s}}),addStreamingMessage:s=>n({type:"ADD_STREAMING_MESSAGE",payload:s}),updateStreamingMessage:(s,a)=>n({type:"UPDATE_STREAMING_MESSAGE",payload:{index:s,content:a}}),clearStreamingMessages:()=>n({type:"CLEAR_STREAMING_MESSAGES"}),setStreamingProgress:s=>n({type:"SET_STATE",payload:{streamingProgress:s}}),setStreamingStatus:s=>n({type:"SET_STATE",payload:{streamingStatus:s}}),setReviewDetailTab:s=>n({type:"SET_STATE",payload:{reviewDetailTab:s}}),setFullPrompt:s=>n({type:"SET_STATE",payload:{fullPrompt:s}}),setFullResponse:s=>n({type:"SET_STATE",payload:{fullResponse:s}}),setFigmaImageUrl:s=>n({type:"SET_STATE",payload:{figmaImageUrl:s}}),setStorybookImageUrl:s=>n({type:"SET_STATE",payload:{storybookImageUrl:s}}),setFigmaDimensions:s=>n({type:"SET_STATE",payload:{figmaDimensions:s}}),setSelectedModels:s=>n({type:"SET_STATE",payload:{selectedModels:s}}),toggleModel:s=>n({type:"TOGGLE_MODEL",payload:s}),setModelComparisonView:s=>n({type:"SET_STATE",payload:{modelComparisonView:s}}),resetReview:()=>n({type:"RESET_REVIEW"}),addReview:s=>n({type:"ADD_REVIEW",payload:s}),getCurrentReview:()=>{let s=r.current;return s.currentReviewId&&s.reviewHistory.find(a=>a.id===s.currentReviewId)||null},getReviewById:s=>r.current.reviewHistory.find(a=>a.id===s)||null,getParentReview:()=>{let s=r.current,a=s.reviewHistory.find(u=>u.id===s.currentReviewId);return a?.parentReviewId&&s.reviewHistory.find(u=>u.id===a.parentReviewId)||null},hasAppliedFixes:()=>{let s=r.current,a=s.reviewHistory.find(u=>u.id===s.currentReviewId);return!a||!Array.isArray(a.issues)||a.issues.length===0?!1:a.issues.some(u=>u.status==="applied"||u.generatedFix?.status==="applied")},toggleIssueSelection:s=>n({type:"TOGGLE_ISSUE_SELECTION",payload:s}),updateIssueStatus:(s,a,u)=>n({type:"UPDATE_ISSUE_STATUS",payload:{issueId:s,status:a,error:u}}),updateIssueGeneratedFix:(s,a)=>n({type:"UPDATE_ISSUE_GENERATED_FIX",payload:{issueId:s,generatedFix:a}}),batchUpdateIssueGeneratedFixes:s=>n({type:"BATCH_UPDATE_ISSUE_GENERATED_FIXES",payload:s}),dismissIssue:(s,a,u)=>n({type:"DISMISS_ISSUE",payload:{issueId:s,reason:a,dismissedBy:u}}),undismissIssue:s=>n({type:"UNDISMISS_ISSUE",payload:s}),recalculateScore:()=>n({type:"RECALCULATE_SCORE"}),updateReviewScore:(s,a)=>n({type:"UPDATE_REVIEW_SCORE",payload:{reviewId:s,newScore:a}}),clearAllReviews:()=>n({type:"CLEAR_ALL_REVIEWS"}),clearStaleReviewsForStory:s=>n({type:"CLEAR_STALE_REVIEWS",payload:s}),setIsApplying:s=>n({type:"SET_STATE",payload:{isApplying:s}}),setApplyFixesResult:s=>n({type:"SET_STATE",payload:{applyFixesResult:s}}),setIncludeComponentIssues:s=>n({type:"SET_STATE",payload:{includeComponentIssues:s}}),setIncludeTextComparison:s=>n({type:"SET_STATE",payload:{includeTextComparison:s}}),setUsePromptCache:s=>n({type:"SET_STATE",payload:{usePromptCache:s}}),setIsValidating:s=>n({type:"SET_STATE",payload:{isValidating:s}}),setReviewHistoryLoading:s=>n({type:"SET_STATE",payload:{reviewHistoryLoading:s}}),setValidationUsage:s=>n({type:"SET_STATE",payload:{validationUsage:s}}),setWorkspacePath:s=>n({type:"SET_STATE",payload:{workspacePath:s}}),triggerScreenshotRefresh:()=>n({type:"TRIGGER_SCREENSHOT_REFRESH"}),setHoveredIssueId:s=>n({type:"SET_STATE",payload:{hoveredIssueId:s}}),setFeatureFlags:s=>n({type:"SET_STATE",payload:{featureFlags:s}}),setUserRole:s=>n({type:"SET_STATE",payload:{userRole:s}}),setRoleOverride:s=>{try{s?localStorage.setItem("uicopilot_role_override",s):localStorage.removeItem("uicopilot_role_override")}catch{}n({type:"SET_STATE",payload:{roleOverride:s}})},setReviewAllConcurrency:s=>{let a=Math.max(1,Math.min(5,s));try{localStorage.setItem("uicopilot_review_all_concurrency",String(a))}catch{}n({type:"SET_STATE",payload:{reviewAllConcurrency:a}})},setIsGenerating:s=>n({type:"SET_STATE",payload:{isGenerating:s}}),setGeneratedPrompt:s=>n({type:"SET_STATE",payload:{generatedPrompt:s}}),setPromptError:s=>n({type:"SET_STATE",payload:{promptError:s}}),resetPrompt:()=>n({type:"RESET_PROMPT"})}),[]),i=Ww(()=>({...t,...o}),[t,o]);return tR.createElement(Gw.Provider,{value:i},e)}function ce(){let e=rR(Gw);if(!e)throw new Error("useReviewStore must be used within a ReviewProvider");return e}var Vw,aR,cR,uR,Qf,pR,dR,gR,Gw,Zf=$(()=>{"use strict";ln();Xf();ze();Vw=20,aR=5;cR=()=>{if(typeof localStorage>"u")return 3;try{let e=localStorage.getItem("uicopilot_review_all_concurrency");if(e)return Math.max(1,Math.min(5,parseInt(e,10)))}catch{}return 3},uR=()=>{if(typeof localStorage>"u")return null;try{let e=localStorage.getItem("uicopilot_role_override");if(e==="admin"||e==="beta")return e}catch{}return null},Qf={enableFixGeneration:!1,enableFixApply:!1,enableAutoMap:!1,enableReviewBadges:!1,showCosts:!1,enableParallelReview:!1,enableModelSelection:!1},pR=()=>{if(typeof localStorage>"u")return Qf;try{let e=localStorage.getItem("uicopilot_feature_flags");if(!e)return Qf;let t=JSON.parse(e);return{enableFixGeneration:!!t.enableFixGeneration,enableFixApply:!!t.enableFixApply,enableAutoMap:!!t.enableAutoMap,enableReviewBadges:!!t.enableReviewBadges,showCosts:!!t.showCosts,enableParallelReview:!!t.enableParallelReview,enableModelSelection:!!t.enableModelSelection}}catch{}return Qf},dR=()=>{if(typeof localStorage>"u")return"beta";try{let e=localStorage.getItem("uicopilot_user_role");if(e==="admin"||e==="beta")return e}catch{}return"beta"},gR={isReviewing:!1,reviewingStoryId:null,reviewError:null,reviewResults:null,multiModelResults:null,showReviewMenu:!1,severityFilter:"all",showStreamingPanel:!1,streamingPanelCollapsed:!1,streamingMessages:[],streamingProgress:0,streamingStatus:"",reviewDetailTab:"chat",fullPrompt:"",fullResponse:"",figmaImageUrl:null,storybookImageUrl:null,figmaDimensions:null,selectedModels:["claude-sonnet-4-5-20250929"],modelComparisonView:"side-by-side",reviewHistory:Jl(Kf()),currentReviewId:null,includeComponentIssues:!0,includeTextComparison:!1,usePromptCache:!1,isApplying:!1,applyFixesResult:null,screenshotRefreshKey:0,isValidating:!1,reviewHistoryLoading:!1,validationUsage:null,lastAiCallTimestamp:null,aiRateLimitSeconds:0,isGenerating:!1,generatedPrompt:null,promptError:null,workspacePath:null,userRole:dR(),roleOverride:uR(),featureFlags:pR(),reviewAllConcurrency:cR(),hoveredIssueId:null},Gw=nR(null)});import Ys,{useMemo as fR}from"react";function tm({children:e}){return Ys.createElement(Mu,null,Ys.createElement(Du,null,Ys.createElement(zu,null,Ys.createElement(Jf,null,Ys.createElement(mR,null),e))))}function qw(e){let t=we(),n=Xe(),r=et(),o=ce(),i=fR(()=>({...t,...n,...r,...o}),[t,n,r,o]);return e?e(i):i}function mR(){return em=qw(),null}var em,xt,Yw=$(()=>{"use strict";Bu();Ru();Nu();Zf();em=null,xt=Object.assign(qw,{getState:()=>{if(!em)throw new Error("Store not initialized. Make sure StoreProvider is mounted.");return em}})});var ke=$(()=>{"use strict";Yw();Bu();Ru();Nu();Zf()});function K(){return(process.env.STORYBOOK_UICOPILOT_URL||hR).replace(/\/$/,"")}var hR,Kw,Ne=$(()=>{"use strict";hR="https://app.uiparity.com";Kw=3.6});async function oe(e,t,n=3e4){let r=new AbortController,o=setTimeout(()=>r.abort(),n);try{return await fetch(e,{...t,signal:r.signal})}catch(i){throw i instanceof DOMException&&i.name==="AbortError"?new Error(`Request timed out after ${n}ms: ${e}`):i}finally{clearTimeout(o)}}var ct=$(()=>{"use strict"});import{useEffect as Mo,useState as nc,useRef as pv,useCallback as im}from"react";import{addons as sm}from"storybook/manager-api";async function yz(e,t,n){let r=`${e}:${t}`,o=am.get(r);if(o)return y.debug("[useReviewScreenshots] Reusing in-flight Figma image fetch for",r),o;let i=(async()=>{let s=await oe(`${hv}/api/figma/image?projectId=${e}&nodeId=${t}`,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`}});return s.ok?s.json():{imageUrl:null}})().finally(()=>{am.delete(r)});return am.set(r,i),i}function bz(e,t,n){try{sessionStorage.setItem(`${rc}${e}`,JSON.stringify({figmaNodeId:t,imageUrl:n,timestamp:Date.now()}))}catch{}}function Sz(e,t){try{let n=sessionStorage.getItem(`${rc}${e}`);if(!n)return null;let r=JSON.parse(n);if(r.figmaNodeId===t&&Date.now()-r.timestamp<1800*1e3)return r.imageUrl;sessionStorage.removeItem(`${rc}${e}`)}catch{}return null}function wz(e){try{let t=sessionStorage.getItem(`${rc}${e}`);if(!t)return null;let n=JSON.parse(t);if(n.imageUrl&&Date.now()-n.timestamp<300*1e3)return n.imageUrl}catch{}return null}var dv,gv,fv,mv,$i,hv,Cn,lm,am,rc,xv,yv,ii,Ui=$(()=>{"use strict";ke();cm();ze();Ne();ct();dv="storyArgsUpdated",gv="storyRendered",fv="forceRemount",mv=null,$i=()=>mv,hv=K(),Cn=new Map,lm=null,am=new Map;rc="uicopilot-figma-image-";xv=(e,t,n)=>{let r=Cn.get(e);r?(r.storybookImageUrl=t,n&&(r.figmaImageUrl=n)):Cn.set(e,{storybookImageUrl:t,figmaImageUrl:n??null}),y.debug("[useReviewScreenshots] Populated historical screenshots for story:",e)},yv=(e,t,n)=>{lm=t;let r=Cn.get(e);r?r.figmaImageUrl=n:Cn.set(e,{storybookImageUrl:null,figmaImageUrl:n}),y.debug("[useReviewScreenshots] Pre-set Figma image for mapping:",{storyId:e,figmaNodeId:t,imageUrl:n.substring(0,50)+"..."})},ii=()=>{let[e,t]=nc(!1),[n,r]=nc(!1),[o,i]=nc(!1),[s,a]=nc(null),u=pv(null),{screenshotRefreshKey:c,triggerScreenshotRefresh:l}=ce(),d=im(()=>{let L=xt.getState().currentStoryId;L&&(y.debug("[useReviewScreenshots] Refreshing screenshots for story:",L),Cn.delete(L),u.current=null,i(!0),l())},[l]),g=im(()=>{let L=xt.getState().currentStoryId;if(L){y.debug("[useReviewScreenshots] Refreshing Storybook screenshot only for story:",L);let z=Cn.get(L);z&&(z.storybookImageUrl=null),u.current=null,i(!0),l()}},[l]),{sessionToken:p}=we(),{selectedProjectId:h}=Xe(),{currentStoryId:S,currentMapping:T,loadingMapping:F}=et(),{setStorybookImageUrl:v,setFigmaImageUrl:D}=ce(),N=pv(null);Mo(()=>{S&&N.current&&N.current!==S&&(y.debug("[useReviewScreenshots] Story switched, clearing images"),v(""),D("")),N.current=S},[S,v,D]),Mo(()=>{!S||F||T||D("")},[S,T,F,D]),Mo(()=>{if(!S)return;let L=wz(S);L&&(y.debug("[useReviewScreenshots] Quick-restored Figma image for:",S),D(L))},[S,D]),Mo(()=>{if(!S||F)return;let L=T?.figmaFileUrl;if(L){y.debug("[useReviewScreenshots] Restoring Figma image from mapping.figmaFileUrl for:",S),D(L);let z=Cn.get(S);z?z.figmaImageUrl=L:Cn.set(S,{storybookImageUrl:null,figmaImageUrl:L})}},[S,T,F,D]),Mo(()=>{let L=!1;return(async()=>{if(!p||!h||!S){y.debug("[useReviewScreenshots] Missing required context, skipping auto-load");return}u.current&&u.current!==S&&(y.debug("[useReviewScreenshots] Story changed, clearing stale screenshots"),v(""),D(""));let m=xt.getState();if(u.current===S&&m.storybookImageUrl&&m.figmaImageUrl){y.debug("[useReviewScreenshots] Screenshots already loaded for this story, skipping capture");return}let b=T?.figmaNodeId??null;if(b!==lm){y.debug("[useReviewScreenshots] Figma mapping changed, invalidating Figma image only for story:",S);let P=Cn.get(S);P&&(P.figmaImageUrl=null),lm=b,u.current=null}let w=T?.figmaNodeId;if(w&&!Cn.get(S)?.figmaImageUrl){let P=Sz(S,w);if(P){y.debug("[useReviewScreenshots] Hydrated Figma image from sessionStorage for story:",S),D(P);let B=Cn.get(S);B?B.figmaImageUrl=P:Cn.set(S,{storybookImageUrl:null,figmaImageUrl:P})}}let A=Cn.get(S),f=A&&A.storybookImageUrl&&A.figmaImageUrl,C=A&&A.storybookImageUrl&&!A.figmaImageUrl,E=A&&!A.storybookImageUrl&&A.figmaImageUrl;if(f){y.debug("[useReviewScreenshots] Using fully cached screenshots for story:",S),v(A.storybookImageUrl),D(A.figmaImageUrl),u.current=S;return}let x=C&&T?.figmaNodeId;x&&(y.debug("[useReviewScreenshots] Using cached Storybook, fetching new Figma for story:",S),v(A.storybookImageUrl));let I=E;if(I&&(y.debug("[useReviewScreenshots] Using cached Figma, recapturing Storybook for story:",S),D(A.figmaImageUrl)),u.current===S&&T?.figmaNodeId){y.debug("[useReviewScreenshots] Screenshots already loaded for this story, skipping");return}try{if(a(null),x?r(!0):(I||(t(!0),r(!0)),i(!0)),u.current=S,L)return;let P=I?A.figmaImageUrl:null,B;if(I)y.debug("[useReviewScreenshots] Figma cached (storybookOnlyRefresh), skipping fetch"),r(!1);else if(w){y.debug("[useReviewScreenshots] Found Figma node ID from mapping:",w);let k=null;try{y.debug("[useReviewScreenshots] Fetching Figma image (with caching)...");let R=await yz(h,w,p);k=R.imageUrl||null;let H=R.cached?"(cached)":"(fresh)";y.debug(`[useReviewScreenshots] Figma image fetched ${H}:`,k?"success":"not found")}catch(R){y.warn("[useReviewScreenshots] Failed to fetch Figma image:",R)}if(k)try{y.debug("[useReviewScreenshots] Fetching Figma image via proxy...");let R=`${hv}/api/proxy/image?url=${encodeURIComponent(k)}`,H=await oe(R);if(H.ok){let M=await H.blob(),se=new FileReader,X=await new Promise((me,Pe)=>{se.onloadend=()=>me(se.result),se.onerror=Pe,se.readAsDataURL(M)});P=X,D(X),y.debug("[useReviewScreenshots] Figma image loaded via proxy");let re=new Image;await new Promise(me=>{re.onload=()=>{B={width:re.naturalWidth,height:re.naturalHeight},y.debug("[useReviewScreenshots] Figma dimensions:",B),me()},re.onerror=()=>me(),re.src=X})}else P=k,D(k),y.warn("[useReviewScreenshots] Proxy failed, using direct URL as fallback")}catch(R){y.warn("[useReviewScreenshots] Proxy error, using direct URL as fallback:",R),P=k,D(k)}else y.warn("[useReviewScreenshots] No thumbnail found for node:",w),D(null);P&&w&&bz(S,w,P),r(!1)}else y.debug("[useReviewScreenshots] No Figma mapping exists for this component"),D(null),r(!1);let _=A?.storybookImageUrl||null;if(_)y.debug("[useReviewScreenshots] Using cached Storybook screenshot"),i(!1);else{y.debug("[useReviewScreenshots] Capturing Storybook screenshot for story:",S);let k=await oc({storyId:S,sessionToken:p||void 0,...B&&{figmaWidth:B.width,figmaHeight:B.height}});k&&!L?(_=k,v(k),y.debug("[useReviewScreenshots] Storybook screenshot captured at dimensions:",B||"natural")):y.warn("[useReviewScreenshots] Failed to capture Storybook screenshot"),i(!1)}Cn.set(S,{storybookImageUrl:_,figmaImageUrl:P}),y.debug("[useReviewScreenshots] Screenshots cached for story:",S)}catch(P){y.error("[useReviewScreenshots] Error loading screenshots:",P),a(P instanceof Error?P.message:"Failed to load screenshots"),u.current=null,r(!1),i(!1)}finally{t(!1)}})(),()=>{L=!0}},[p,h,S,T?.figmaNodeId,c]),Mo(()=>{let L=sm.getChannel(),z=null,m=b=>{mv=b.args,y.debug("[useReviewScreenshots] Args updated for story:",b.storyId,"args:",b.args),z&&clearTimeout(z),z=setTimeout(()=>{y.debug("[useReviewScreenshots] Story args changed, refreshing screenshot"),d()},500)};return L.on(dv,m),()=>{L.off(dv,m),z&&clearTimeout(z)}},[d]),Mo(()=>{let L=sm.getChannel(),z=!1,m=null,b=()=>{y.debug("[useReviewScreenshots] FORCE_REMOUNT detected, showing Storybook loader"),z=!0,i(!0)},w=()=>{z&&(y.debug("[useReviewScreenshots] STORY_RENDERED after remount, waiting for styles to settle..."),m&&clearTimeout(m),m=setTimeout(()=>{z=!1,y.debug("[useReviewScreenshots] Refreshing Storybook screenshot after HMR (preserving Figma)"),g()},500))};return L.on(fv,b),L.on(gv,w),()=>{L.off(fv,b),L.off(gv,w),m&&clearTimeout(m)}},[g]),Mo(()=>{let L=sm.getChannel(),z=async m=>{if(!m?.snapshot?.html){y.debug("[useReviewScreenshots] DOM mutated but no snapshot available");return}y.debug("[useReviewScreenshots] DOM mutated, capturing snapshot screenshot"),i(!0);try{let b=xt.getState().currentStoryId,w=await fetch("/__uicopilot/screenshot-snapshot",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...m.snapshot,storyId:b})});if(w.ok){let A=await w.json();if(A.screenshot){v(A.screenshot);let f=xt.getState().currentStoryId;if(f){let C=Cn.get(f);C?C.storybookImageUrl=A.screenshot:Cn.set(f,{storybookImageUrl:A.screenshot,figmaImageUrl:null})}}}else y.error("[useReviewScreenshots] Snapshot screenshot failed:",await w.text())}catch(b){y.error("[useReviewScreenshots] Snapshot screenshot error:",b)}finally{i(!1)}};return L.on("UICOPILOT/STORY_DOM_MUTATED",z),()=>{L.off("UICOPILOT/STORY_DOM_MUTATED",z)}},[]);let U=im((L,z,m)=>{y.debug("[useReviewScreenshots] setFigmaImageDirect called - bypassing load"),yv(L,z,m),D(m),r(!1),u.current=L},[D]);return{isLoadingScreenshots:e,isLoadingFigma:n,isLoadingStorybook:o,screenshotError:s,refreshScreenshots:d,refreshStorybookOnly:g,setFigmaImageDirect:U}}});function kz(){return!K().startsWith("http://localhost")}function Cz(e,t,n){let r=t.createElement("div");r.style.color=e,t.body.appendChild(r);let o=n.getComputedStyle(r).color;return r.remove(),o}function bv(e,t,n){let r=new Map;return e.replace(/(?:color|oklch|oklab|lab|lch)\([^)]+\)/g,o=>{if(r.has(o))return r.get(o);let i=Cz(o,t,n);return r.set(o,i),i})}async function Tz(){let e=(await import("html2canvas")).default,t=document.getElementById("storybook-preview-iframe");if(!t?.contentDocument||!t.contentWindow)throw new Error("Storybook iframe not accessible");let n=t.contentDocument.querySelector("#storybook-root > *")||t.contentDocument.querySelector("#root > *");if(!n)throw new Error("Story element not found in iframe");let r=t.contentWindow,o=t.contentDocument;return(await e(n,{useCORS:!0,logging:!1,backgroundColor:null,onclone:s=>{s.querySelectorAll("style").forEach(u=>{let c=u.textContent||"";/(?:color|oklch|oklab|lab|lch)\(/.test(c)&&(u.textContent=bv(c,o,r))});let a=Array.from(o.styleSheets);s.querySelectorAll('link[rel="stylesheet"]').forEach(u=>{let c=u.href,l=a.find(d=>d.href===c);if(l)try{let d="";for(let g of Array.from(l.cssRules))d+=g.cssText+`
|
|
13
13
|
`;if(/(?:color|oklch|oklab|lab|lch)\(/.test(d)){let g=s.createElement("style");g.textContent=bv(d,o,r),u.replaceWith(g)}}catch{}})}})).toDataURL("image/png")}function Iz(e){let t=[];for(let[n,r]of Object.entries(e)){if(r===void 0)continue;let o;typeof r=="boolean"?o=`!${r}`:typeof r=="number"?o=String(r):typeof r=="string"?o=encodeURIComponent(r).replace(/%20/g,"+"):o=encodeURIComponent(JSON.stringify(r)),t.push(`${n}:${o}`)}return t.join(";")}async function Fz(e,t){y.debug("[Screenshot] Using server-side Chrome capture for:",e);let n={"Content-Type":"application/json"};t?.sessionToken&&(n.Authorization=`Bearer ${t.sessionToken}`);let r=await oe(`${vz}/api/screenshot`,{method:"POST",headers:n,body:JSON.stringify({url:e,selector:t?.selector,width:t?.width,height:t?.height,scale:t?.scale||1,figmaWidth:t?.figmaWidth,figmaHeight:t?.figmaHeight})});if(!r.ok){let i=await r.json().catch(()=>({error:"Unknown error"}));throw new Error(i.error||`Screenshot failed: ${r.status}`)}return(await r.json()).screenshot}function Ez(e){let t={};if(!e)return t;let n=e.split(";");for(let r of n){let o=r.indexOf(":");if(o===-1)continue;let i=r.slice(0,o),s=r.slice(o+1);typeof s=="string"&&(s==="!true"?s=!0:s==="!false"?s=!1:!isNaN(Number(s))&&s!==""?s=Number(s):s=decodeURIComponent(s.replace(/\+/g," "))),t[i]=s}return t}function Az(e){let t=new URLSearchParams(window.location.search),n=e;if(n||(n=(t.get("path")||"").replace("/story/","").replace("/docs/",""),y.debug("[Screenshot] Warning: Using story ID from URL (fallback):",n)),!n)throw new Error("Could not determine current story ID. Please select a story first.");let r=window.location.origin,o=Date.now(),i=`${r}/iframe.html?viewMode=story&id=${n}&globals=&_cb=${o}`,s=$i();if(!s||Object.keys(s).length===0){let a=t.get("args");a&&(s=Ez(a),y.debug("[Screenshot] Parsed args from URL:",s))}if(s&&Object.keys(s).length>0){let a=Iz(s);i+=`&args=${a}`,y.debug("[Screenshot] Using URL with current args:",i)}else y.debug("[Screenshot] No current args, using default URL:",i);return i}async function Pz(e){try{let t=await fetch(`/__uicopilot/screenshot?storyId=${encodeURIComponent(e)}`);if(t.status===501)return y.info("[Screenshot] Local Puppeteer not available, falling back"),null;if(!t.ok){let r=await t.json().catch(()=>({error:"Unknown"}));throw new Error(r.error||`Screenshot failed: ${t.status}`)}let n=await t.json();return y.info("[Screenshot] Captured via local Puppeteer (pixel-perfect)"),n.screenshot}catch(t){if(t instanceof TypeError&&t.message.includes("fetch"))return null;throw t}}async function oc(e){let t=e?.storyId||Lz();if(t){let n=um.get(t);if(n)return y.debug("[Screenshot] Reusing in-flight capture for",t),n;let r=Sv(t,e).finally(()=>{um.delete(t)});return um.set(t,r),r}return Sv(void 0,e)}async function Sv(e,t){try{if(e){let n=await Pz(e);if(n)return n}if(!kz()){let n=Az(t?.storyId);return await Fz(n,{...t,selector:"#storybook-root > *"})}return y.info("[Screenshot] Using client-side capture (html2canvas fallback)"),await Tz()}catch(n){throw y.error("Error capturing screenshot:",n),new Error(`Failed to capture screenshot: ${n instanceof Error?n.message:"Unknown error"}`)}}function Lz(){return(new URLSearchParams(window.location.search).get("path")||"").replace("/story/","").replace("/docs/","")||void 0}var vz,um,cm=$(()=>{"use strict";Ne();Ui();ze();ct();vz=K();um=new Map});function Ln(e){if(e==="transparent"||e==="rgba(0, 0, 0, 0)")return"transparent";let t=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)/);if(!t)return e;let[,n,r,o,i]=t,s=i?parseFloat(i):1;return s<1?`rgba(${n}, ${r}, ${o}, ${s})`:`#${[n,r,o].map(u=>parseInt(u).toString(16).padStart(2,"0")).join("")}`}function jn(e,t){let r={backgroundColor:["transparent","rgba(0, 0, 0, 0)"],border:["none","0px none","0px none rgb(0, 0, 0)"],borderRadius:["0px"],boxShadow:["none"],opacity:["1"],gap:["normal","0px"],flexDirection:["row"],justifyContent:["normal","flex-start"],alignItems:["normal","stretch"],textAlign:["start","left"],letterSpacing:["normal","0px"],margin:["0px","0px 0px 0px 0px"],padding:["0px","0px 0px 0px 0px"]}[e];return r?r.includes(t):!1}function ta(e){return e.split(",").map(n=>n.trim().replace(/['"]/g,""))[0]||e}function wv(e){let t=e.ownerDocument,r=(t.defaultView||window).getComputedStyle(e);if("fonts"in t){let T=r.fontSize||"16px",F=r.fontWeight||"400";if(r.fontFamily.includes("Roboto")){let v=t.fonts.check(`${F} ${T} Roboto`);if(y.debug("[computedStyles] Roboto check:",{cssFamily:r.fontFamily,robotoLoaded:v,fontWeight:F,fontSize:T,isIframe:t!==document,fontStatus:Array.from(t.fonts).map(D=>({family:D.family,status:D.status}))}),v)return"Roboto"}}let o="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",s=t.createElement("canvas").getContext("2d");if(!s)return"unknown";let a=r.fontSize,u=r.fontWeight,c=r.fontStyle,l=r.fontFamily.split(",").map(T=>T.trim().replace(/['"]/g,"")),d=["Arial","Helvetica","Helvetica Neue","Times New Roman","Georgia","Courier New","Verdana","Tahoma","Trebuchet MS","sans-serif","serif","monospace"],g=[...new Set([...l,...d])];s.font=`${c} ${u} ${a} monospace`;let p=s.measureText(o).width,h="unknown",S=new Map;for(let T of g){s.font=`${c} ${u} ${a} "${T}", monospace`;let F=s.measureText(o).width;if(S.set(T,F),F!==p){s.font=`${c} ${u} ${a} "${T}"`;let v=s.measureText(o).width;s.font=`${c} ${u} ${a} ${r.fontFamily}`;let D=s.measureText(o).width;if(Math.abs(v-D)<.1){h=T;break}}}return y.debug("[computedStyles] Font detection:",{declared:r.fontFamily,detected:h,declaredFonts:l,fontWidths:Array.from(S.entries()),isIframe:t!==document}),h}var na=$(()=>{"use strict";ze()});function ji(e,t){if(!t)return e;let n=t.split(" ").filter(i=>i.trim()),r=n.find(i=>!i.includes("--")),o=n.filter(i=>i.includes("--"));return r&&o.length>0?`${e}.${r}.${o[0]}`:r?`${e}.${r}`:n[0]?`${e}.${n[0]}`:e}function pm(e){let n=(e.ownerDocument.defaultView||window).getComputedStyle(e);return y.debug("[computedStyles] Extracting styles:",{fontFamily:n.fontFamily,fontWeight:n.fontWeight,borderRadius:n.borderRadius,backgroundColor:n.backgroundColor,padding:{top:n.paddingTop,right:n.paddingRight,bottom:n.paddingBottom,left:n.paddingLeft},isIframeContext:e.ownerDocument!==document}),{color:Ln(n.color),backgroundColor:Ln(n.backgroundColor),borderColor:Ln(n.borderColor),padding:{top:n.paddingTop,right:n.paddingRight,bottom:n.paddingBottom,left:n.paddingLeft},margin:{top:n.marginTop,right:n.marginRight,bottom:n.marginBottom,left:n.marginLeft},gap:n.gap,fontFamily:n.fontFamily,renderedFont:wv(e),fontSize:n.fontSize,fontWeight:n.fontWeight,lineHeight:n.lineHeight,letterSpacing:n.letterSpacing,textAlign:n.textAlign,textTransform:n.textTransform,width:n.width,height:n.height,minWidth:n.minWidth,minHeight:n.minHeight,maxWidth:n.maxWidth,maxHeight:n.maxHeight,borderWidth:n.borderWidth,borderStyle:n.borderStyle,borderRadius:n.borderRadius,boxShadow:n.boxShadow,textShadow:n.textShadow,display:n.display,flexDirection:n.display==="flex"?n.flexDirection:void 0,justifyContent:n.display==="flex"?n.justifyContent:void 0,alignItems:n.display==="flex"?n.alignItems:void 0,position:n.position,opacity:n.opacity,cursor:n.cursor}}function dm(e,t){let n={width:null,height:null,minWidth:null,minHeight:null,maxWidth:null,maxHeight:null,display:null,flexGrow:null,flexShrink:null,flexBasis:null};try{let r=Array.from(t.styleSheets);for(let i of r)try{let s=i.cssRules||i.rules;if(!s)continue;for(let a of Array.from(s))if(a.type===1){let u=a;try{if(e.matches(u.selectorText)){let c=u.style;c.width&&(n.width=c.width),c.height&&(n.height=c.height),c.minWidth&&(n.minWidth=c.minWidth),c.minHeight&&(n.minHeight=c.minHeight),c.maxWidth&&(n.maxWidth=c.maxWidth),c.maxHeight&&(n.maxHeight=c.maxHeight),c.display&&(n.display=c.display),c.flexGrow&&(n.flexGrow=c.flexGrow),c.flexShrink&&(n.flexShrink=c.flexShrink),c.flexBasis&&(n.flexBasis=c.flexBasis)}}catch{continue}}}catch{continue}let o=e.style;o.width&&(n.width=o.width),o.height&&(n.height=o.height),o.minWidth&&(n.minWidth=o.minWidth),o.minHeight&&(n.minHeight=o.minHeight),o.maxWidth&&(n.maxWidth=o.maxWidth),o.maxHeight&&(n.maxHeight=o.maxHeight),o.display&&(n.display=o.display),o.flexGrow&&(n.flexGrow=o.flexGrow),o.flexShrink&&(n.flexShrink=o.flexShrink),o.flexBasis&&(n.flexBasis=o.flexBasis)}catch(r){y.error("Error extracting declared styles:",r)}return n}var ic=$(()=>{"use strict";ze();na()});function Mz(e){let t=[],n=new Set,r=vv.join(", "),o=e.querySelectorAll(r);for(let i of Array.from(o)){let s=`${i.tagName.toLowerCase()}.${i.className}`;n.has(s)||(n.add(s),t.push(i))}if(vv.includes(e.tagName.toLowerCase())){let i=`${e.tagName.toLowerCase()}.${e.className}`;n.has(i)||t.unshift(e)}return t}function Bz(e){let n=(e.ownerDocument.defaultView||window).getComputedStyle(e),r=e.tagName.toLowerCase(),o=e.className,i=typeof o=="string"?o:o?.baseVal||"";return{selector:ji(r,i),tagName:r,className:i,styles:{fontSize:n.fontSize,fontFamily:ta(n.fontFamily),fontWeight:n.fontWeight,lineHeight:n.lineHeight,letterSpacing:n.letterSpacing,color:Ln(n.color),textAlign:n.textAlign,textTransform:n.textTransform}}}function Dz(e,t=2){let n=[e],r=new Set,o=s=>{let a=s.className;return typeof a=="string"?a:a?.baseVal||""};r.add(`${e.tagName}.${o(e)}`);function i(s,a){if(a>=t)return;let u=Array.from(s.children);for(let c of u){let l=c.tagName.toLowerCase();if(["script","style","link","meta","br","hr"].includes(l))continue;let d=`${c.tagName}.${o(c)}`;r.has(d)||(r.add(d),n.push(c),i(c,a+1))}}return i(e,0),n}function Rz(e){let n=(e.ownerDocument.defaultView||window).getComputedStyle(e),r=e.tagName.toLowerCase(),o=e.className,i=typeof o=="string"?o:o?.baseVal||"",s=n.borderWidth!=="0px",a=n.backgroundColor!=="transparent"&&n.backgroundColor!=="rgba(0, 0, 0, 0)",u=n.borderRadius!=="0px",c=n.gap!=="normal"&&n.gap!=="0px";if(!s&&!a&&!u&&!c)return null;let l=n.borderWidth,d=n.borderStyle,g=Ln(n.borderColor),p=s?`${l} ${d} ${g}`:"none";return{selector:ji(r,i),className:i,border:p,borderRadius:n.borderRadius,backgroundColor:Ln(n.backgroundColor),gap:n.gap}}function ra(){y.debug("[computedStyles] extractStoryStyles called - FULL CONTEXT VERSION");try{let e=document.getElementById("storybook-preview-iframe");if(!e||!e.contentDocument)throw new Error("Storybook preview iframe not found");let t=e.contentDocument,n=t.getElementById("storybook-root");if(!n)throw new Error("Story root element not found");let r=n.firstElementChild;if(!r)throw new Error("Component element not found in story root");let o=Dz(r,2),i=o.map(Rz).filter(a=>a!==null);y.debug("[computedStyles] Extracted visual styles from nested elements:",{total:o.length,withVisuals:i.length,elements:i.map(a=>({selector:a.selector,border:a.border,background:a.backgroundColor,borderRadius:a.borderRadius}))});let s=[];try{let a=Mz(r);s=a.map(Bz),y.debug("[computedStyles] Text elements found:",{count:a.length,elements:s.map(u=>({selector:u.selector,fontSize:u.styles.fontSize,fontWeight:u.styles.fontWeight}))})}catch(a){y.error("[computedStyles] Error extracting text elements:",a)}return{computed:pm(r),declared:dm(r,t),markup:r.outerHTML,textElementStyles:s,nestedElementStyles:i}}catch(e){return y.error("Error extracting computed styles:",e),null}}var vv,kv=$(()=>{"use strict";ze();na();ic();vv=["input","textarea","button","select","label","span","a","p","h1","h2","h3","h4","h5","h6"]});function gm(e,t,n,r){return e===t&&t===n&&n===r?e:e===n&&t===r?`${e} ${t}`:t===r?`${e} ${t} ${n}`:`${e} ${t} ${n} ${r}`}function Nz(e,t,n){if(!(e==="0px"||t==="none"))return`${e} ${t} ${n}`}function Oz(e){let n=(e.ownerDocument.defaultView||window).getComputedStyle(e),r={},o=Ln(n.backgroundColor);jn("backgroundColor",o)||(r.backgroundColor=o);let i=Nz(n.borderWidth,n.borderStyle,Ln(n.borderColor));i&&(r.border=i),jn("borderRadius",n.borderRadius)||(r.borderRadius=n.borderRadius),jn("boxShadow",n.boxShadow)||(r.boxShadow=n.boxShadow),jn("opacity",n.opacity)||(r.opacity=n.opacity);let s=e.tagName.toLowerCase(),a=["svg","circle","rect","ellipse","line","polyline","polygon","path","text","tspan","g","use","defs","clipPath","mask"];if(e instanceof SVGElement||a.includes(s)){for(let T=0;T<e.attributes.length;T++){let F=e.attributes[T];if(["class","style","id","xmlns","xmlns:xlink"].includes(F.name))continue;let v=F.name.replace(/-([a-z])/g,(N,U)=>U.toUpperCase()),D=F.value.startsWith("rgb")?Ln(F.value):F.value;v==="d"&&D.length>100?r[v]=D.substring(0,100)+"...":r[v]=D}let p=n.getPropertyValue("fill"),h=n.getPropertyValue("stroke");if(p&&p!=="none"&&(r.fill=p.startsWith("rgb")?Ln(p):p),h&&h!=="none"&&(r.stroke=h.startsWith("rgb")?Ln(h):h),["circle","ellipse","rect","path","line","polyline","polygon"].includes(s)){let T=e.getBoundingClientRect();T.width>0&&(r.width=`${Math.round(T.width*100)/100}px`),T.height>0&&(r.height=`${Math.round(T.height*100)/100}px`)}}let c=e.textContent&&e.textContent.trim().length>0,l=zz.includes(e.tagName.toLowerCase());(c||l)&&(r.fontSize=n.fontSize,r.fontFamily=ta(n.fontFamily),r.fontWeight=n.fontWeight,r.lineHeight=n.lineHeight,r.color=Ln(n.color),jn("letterSpacing",n.letterSpacing)||(r.letterSpacing=n.letterSpacing),jn("textAlign",n.textAlign)||(r.textAlign=n.textAlign)),r.display=n.display;let d=gm(n.paddingTop,n.paddingRight,n.paddingBottom,n.paddingLeft);jn("padding",d)||(r.padding=d);let g=gm(n.marginTop,n.marginRight,n.marginBottom,n.marginLeft);return jn("margin",g)||(r.margin=g),jn("gap",n.gap)||(r.gap=n.gap),(n.display==="flex"||n.display==="inline-flex")&&(jn("flexDirection",n.flexDirection)||(r.flexDirection=n.flexDirection),jn("justifyContent",n.justifyContent)||(r.justifyContent=n.justifyContent),jn("alignItems",n.alignItems)||(r.alignItems=n.alignItems)),r.width||(r.width=n.width),r.height||(r.height=n.height),r}function Cv(e){let t=1;for(let n of e.children)t+=Cv(n);return t}function Tv(e,t=4){function n(o,i){let s=o.tagName.toLowerCase(),a=o.className,u=typeof a=="string"?a:a?.baseVal||"",c=o.id||void 0,l=o.getAttribute("role")||void 0,d;for(let S of Array.from(o.childNodes))if(S.nodeType===Node.TEXT_NODE){let T=S.textContent?.trim();if(T){d=T.length>50?T.substring(0,50)+"...":T;break}}let g=s;c?g=`${s}#${c}`:u&&(g=ji(s,u));let p=Oz(o),h=[];if(i<t){let S=Array.from(o.children);for(let T of S){let F=T.tagName.toLowerCase();if(["script","style","link","meta","br","hr","noscript"].includes(F))continue;let D=(T.ownerDocument.defaultView||window).getComputedStyle(T);D.display==="none"||D.visibility==="hidden"||h.push(n(T,i+1))}}return{selector:g,tagName:s,className:u,id:c,role:l,textContent:d,styles:p,children:h}}y.debug("[computedStyles] Extracting DOM tree with maxDepth:",t);let r=n(e,0);return y.debug("[computedStyles] DOM tree extracted:",{rootSelector:r.selector,childrenCount:r.children.length,totalNodes:Cv(r)}),r}function fm(e=4){y.debug("[extractStoryDOMTree] Starting DOM tree extraction...");try{let t=document.getElementById("storybook-preview-iframe");if(y.debug("[extractStoryDOMTree] iframe found:",!!t),!t)throw new Error("Storybook preview iframe not found");if(y.debug("[extractStoryDOMTree] iframe.contentDocument:",!!t.contentDocument),!t.contentDocument)throw new Error("iframe.contentDocument is not accessible (possible cross-origin issue)");let n=t.contentDocument.getElementById("storybook-root");if(y.debug("[extractStoryDOMTree] storyRoot found:",!!n),!n)throw new Error("Story root element not found");let r=n.firstElementChild;if(y.debug("[extractStoryDOMTree] componentElement found:",!!r,r?.tagName),!r)throw new Error("Component element not found in story root");let o=Tv(r,e);return y.debug("[extractStoryDOMTree] DOM tree extracted successfully:",{selector:o.selector,childrenCount:o.children.length}),o}catch(t){return y.error("[extractStoryDOMTree] Error extracting DOM tree:",t),null}}var zz,Iv=$(()=>{"use strict";ze();na();ic();zz=["input","textarea","button","select","label","span","a","p","h1","h2","h3","h4","h5","h6"]});var mm=$(()=>{"use strict";na();ic();kv();Iv()});var Jv=ir((yJ,Qv)=>{"use strict";Qv.exports={compareTwoStrings:Xv,findBestMatch:cN};function Xv(e,t){if(e=e.replace(/\s+/g,""),t=t.replace(/\s+/g,""),e===t)return 1;if(e.length<2||t.length<2)return 0;let n=new Map;for(let o=0;o<e.length-1;o++){let i=e.substring(o,o+2),s=n.has(i)?n.get(i)+1:1;n.set(i,s)}let r=0;for(let o=0;o<t.length-1;o++){let i=t.substring(o,o+2),s=n.has(i)?n.get(i):0;s>0&&(n.set(i,s-1),r++)}return 2*r/(e.length+t.length-2)}function cN(e,t){if(!uN(e,t))throw new Error("Bad arguments: First argument should be a string, second should be an array of strings");let n=[],r=0;for(let i=0;i<t.length;i++){let s=t[i],a=Xv(e,s);n.push({target:s,rating:a}),a>n[r].rating&&(r=i)}let o=n[r];return{ratings:n,bestMatch:o,bestMatchIndex:r}}function uN(e,t){return!(typeof e!="string"||!Array.isArray(t)||!t.length||t.find(function(n){return typeof n!="string"}))}});var X1=ir((qae,K1)=>{"use strict";var V1=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,I3=/\n/g,F3=/^\s*/,E3=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,A3=/^:\s*/,P3=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,L3=/^[;\s]*/,M3=/^\s+|\s+$/g,B3=`
|
|
14
|
-
`,G1="/",q1="*",di="",D3="comment",R3="declaration";function z3(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function o(h){var S=h.match(I3);S&&(n+=S.length);var T=h.lastIndexOf(B3);r=~T?h.length-T:r+h.length}function i(){var h={line:n,column:r};return function(S){return S.position=new s(h),c(),S}}function s(h){this.start=h,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function a(h){var S=new Error(t.source+":"+n+":"+r+": "+h);if(S.reason=h,S.filename=t.source,S.line=n,S.column=r,S.source=e,!t.silent)throw S}function u(h){var S=h.exec(e);if(S){var T=S[0];return o(T),e=e.slice(T.length),S}}function c(){u(F3)}function l(h){var S;for(h=h||[];S=d();)S!==!1&&h.push(S);return h}function d(){var h=i();if(!(G1!=e.charAt(0)||q1!=e.charAt(1))){for(var S=2;di!=e.charAt(S)&&(q1!=e.charAt(S)||G1!=e.charAt(S+1));)++S;if(S+=2,di===e.charAt(S-1))return a("End of comment missing");var T=e.slice(2,S-2);return r+=2,o(T),e=e.slice(S),r+=2,h({type:D3,comment:T})}}function g(){var h=i(),S=u(E3);if(S){if(d(),!u(A3))return a("property missing ':'");var T=u(P3),F=h({type:R3,property:Y1(S[0].replace(V1,di)),value:T?Y1(T[0].replace(V1,di)):di});return u(L3),F}}function p(){var h=[];l(h);for(var S;S=g();)S!==!1&&(h.push(S),l(h));return h}return c(),p()}function Y1(e){return e?e.replace(M3,di):di}K1.exports=z3});var Q1=ir(Ta=>{"use strict";var N3=Ta&&Ta.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ta,"__esModule",{value:!0});Ta.default=_3;var O3=N3(X1());function _3(e,t){let n=null;if(!e||typeof e!="string")return n;let r=(0,O3.default)(e),o=typeof t=="function";return r.forEach(i=>{if(i.type!=="declaration")return;let{property:s,value:a}=i;o?t(s,a,i):a&&(n=n||{},n[s]=a)}),n}});var Z1=ir($c=>{"use strict";Object.defineProperty($c,"__esModule",{value:!0});$c.camelCase=void 0;var $3=/^--[a-zA-Z0-9_-]+$/,U3=/-([a-z])/g,j3=/^[^-]+$/,H3=/^-(webkit|moz|ms|o|khtml)-/,W3=/^-(ms)-/,V3=function(e){return!e||j3.test(e)||$3.test(e)},G3=function(e,t){return t.toUpperCase()},J1=function(e,t){return"".concat(t,"-")},q3=function(e,t){return t===void 0&&(t={}),V3(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(W3,J1):e=e.replace(H3,J1),e.replace(U3,G3))};$c.camelCase=q3});var tT=ir((Kh,eT)=>{"use strict";var Y3=Kh&&Kh.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},K3=Y3(Q1()),X3=Z1();function Yh(e,t){var n={};return!e||typeof e!="string"||(0,K3.default)(e,function(r,o){r&&o&&(n[(0,X3.camelCase)(r,t)]=o)}),n}Yh.default=Yh;eT.exports=Yh});var EI=ir((vge,FI)=>{"use strict";var cu=Object.prototype.hasOwnProperty,II=Object.prototype.toString,SI=Object.defineProperty,wI=Object.getOwnPropertyDescriptor,vI=function(t){return typeof Array.isArray=="function"?Array.isArray(t):II.call(t)==="[object Array]"},kI=function(t){if(!t||II.call(t)!=="[object Object]")return!1;var n=cu.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&cu.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var o;for(o in t);return typeof o>"u"||cu.call(t,o)},CI=function(t,n){SI&&n.name==="__proto__"?SI(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},TI=function(t,n){if(n==="__proto__")if(cu.call(t,n)){if(wI)return wI(t,n).value}else return;return t[n]};FI.exports=function e(){var t,n,r,o,i,s,a=arguments[0],u=1,c=arguments.length,l=!1;for(typeof a=="boolean"&&(l=a,a=arguments[1]||{},u=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});u<c;++u)if(t=arguments[u],t!=null)for(n in t)r=TI(a,n),o=TI(t,n),a!==o&&(l&&o&&(kI(o)||(i=vI(o)))?(i?(i=!1,s=r&&vI(r)?r:[]):s=r&&kI(r)?r:{},CI(a,{name:n,newValue:e(l,s,o)})):typeof o<"u"&&CI(a,{name:n,newValue:o}));return a}});import Ja from"react";import{addons as Cu,types as by,experimental_getStatusStore as Sy}from"storybook/manager-api";import{AddonPanel as I9}from"storybook/internal/components";import zt,{useState as VV,useEffect as GV}from"react";import{styled as yr}from"storybook/theming";import Ay from"react";import{styled as Dt}from"storybook/theming";var le="#ea580c",Eu="#c2410c",nl="#ff6b35";var ky=Dt.div(({theme:e})=>({fontFamily:e.typography.fonts.base,height:"100%",display:"flex",flexDirection:"column",backgroundColor:e.background.content,color:e.color.defaultText})),Cy=Dt.div({flex:1,overflow:"auto",padding:"6px 20px 20px"}),vo=Dt.div({marginBottom:"20px"}),ko=Dt.label(({theme:e})=>({display:"block",marginBottom:`${e.layoutMargin*.6}px`,fontSize:e.typography.size.s2,fontFamily:e.typography.fonts.base,fontWeight:e.typography.weight.bold,color:e.color.defaultText})),ys=Dt.input(({theme:e})=>({width:"100%",padding:`${e.layoutMargin*.8}px ${e.layoutMargin}px`,fontSize:e.typography.size.s2,fontFamily:e.typography.fonts.base,border:`1px solid ${e.appBorderColor}`,borderRadius:e.appBorderRadius,backgroundColor:e.input.background,color:e.color.defaultText,"&:focus":{outline:"none",borderColor:e.color.secondary,boxShadow:`0 0 0 2px ${e.color.secondary}20`}})),Sn=Dt.select(({theme:e})=>({width:"100%",padding:`${e.layoutMargin*.8}px 32px ${e.layoutMargin*.8}px ${e.layoutMargin}px`,fontSize:e.typography.size.s2,fontFamily:e.typography.fonts.base,border:`1px solid ${e.appBorderColor}`,borderRadius:e.appBorderRadius,backgroundColor:e.input.background,color:e.color.defaultText,cursor:"pointer",appearance:"none",backgroundImage:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E")`,backgroundRepeat:"no-repeat",backgroundPosition:"right 10px center",backgroundSize:"12px",transition:"border-color 0.15s, box-shadow 0.15s","&:focus":{outline:"none",borderColor:e.color.secondary,boxShadow:`0 0 0 2px ${e.color.secondary}20`},"&:hover":{borderColor:e.color.mediumdark},"&:disabled":{opacity:.6,cursor:"not-allowed"}})),Ty=Dt(Sn)(({theme:e})=>({width:"auto",padding:`${e.layoutMargin*.6}px 28px ${e.layoutMargin*.6}px ${e.layoutMargin}px`,fontSize:e.typography.size.s1})),rl=e=>({padding:`${e.layoutMargin*.8}px ${e.layoutMargin*1.6}px`,fontSize:e.typography.size.s2,fontFamily:e.typography.fonts.base,fontWeight:e.typography.weight.bold,border:"none",borderRadius:e.appBorderRadius,cursor:"pointer",transition:"all 0.15s","&:disabled":{opacity:.5,cursor:"not-allowed"}}),An=Dt.button(({theme:e})=>({...rl(e),backgroundColor:e.color.secondary,color:e.color.inverseText,"&:hover:not(:disabled)":{opacity:.9}})),on=Dt.button(({theme:e})=>({...rl(e),backgroundColor:le,color:e.color.inverseText,boxShadow:`0 2px 4px ${le}4d`,"&:hover:not(:disabled)":{backgroundColor:Eu,transform:"translateY(-1px)",boxShadow:`0 4px 8px ${le}66`}})),Or=Dt.button(({theme:e})=>({...rl(e),backgroundColor:"transparent",border:`1px solid ${e.appBorderColor}`,color:e.color.defaultText,"&:hover:not(:disabled)":{backgroundColor:e.background.hoverable}})),Iy=Dt.button(({theme:e})=>({...rl(e),backgroundColor:e.color.negative,color:e.color.inverseText,"&:hover:not(:disabled)":{opacity:.9}})),Pn=Dt.button(({theme:e})=>({display:"inline-flex",alignItems:"center",justifyContent:"center",padding:`${e.layoutMargin*.4}px`,fontSize:e.typography.size.s2,color:e.color.mediumdark,backgroundColor:"transparent",border:"none",borderRadius:e.appBorderRadius,cursor:"pointer",transition:"all 0.15s","&:hover":{color:e.color.defaultText,backgroundColor:e.background.hoverable},"&:disabled":{opacity:.5,cursor:"not-allowed"}})),Au=Dt.button(({theme:e})=>({padding:0,fontSize:e.typography.size.s1,fontFamily:e.typography.fonts.base,color:e.color.secondary,backgroundColor:"transparent",border:"none",cursor:"pointer",textDecoration:"none","&:hover":{textDecoration:"underline"},"&:disabled":{opacity:.5,cursor:"not-allowed"}})),Co=Dt.button(({theme:e,active:t})=>({padding:`${e.layoutMargin*.6}px ${e.layoutMargin*1.2}px`,fontSize:e.typography.size.s2,fontFamily:e.typography.fonts.base,fontWeight:t?e.typography.weight.bold:400,color:t?e.color.secondary:e.color.mediumdark,backgroundColor:"transparent",border:"none",borderBottom:t?`2px solid ${e.color.secondary}`:"2px solid transparent",cursor:"pointer",transition:"all 0.15s","&:hover":{color:t?e.color.secondary:e.color.defaultText}})),To=Dt(ys)(({theme:e})=>({paddingLeft:`${e.layoutMargin*3}px`,backgroundImage:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E")`,backgroundRepeat:"no-repeat",backgroundPosition:`${e.layoutMargin}px center`,backgroundSize:"14px"})),D9=Dt.div(({theme:e})=>({padding:`${e.layoutMargin*1.6}px`,borderRadius:e.appBorderRadius,border:`1px solid ${e.appBorderColor}`,backgroundColor:e.background.content})),Fy=Dt.h2(({theme:e})=>({margin:`0 0 ${e.layoutMargin*1.6}px`,fontSize:e.typography.size.s3,fontFamily:e.typography.fonts.base,fontWeight:e.typography.weight.bold,color:e.color.defaultText})),R9=Dt.h3(({theme:e})=>({margin:`0 0 ${e.layoutMargin*1.2}px`,fontSize:e.typography.size.s2,fontFamily:e.typography.fonts.base,fontWeight:e.typography.weight.bold,color:e.color.defaultText})),bs=Dt.p(({theme:e})=>({margin:`0 0 ${e.layoutMargin*.8}px`,fontSize:e.typography.size.s2,fontFamily:e.typography.fonts.base,color:e.color.defaultText,lineHeight:1.5})),z9=Dt.div(({theme:e,width:t="100%",height:n="40px"})=>({width:t,height:n,backgroundColor:e.background.hoverable,borderRadius:e.appBorderRadius,position:"relative",overflow:"hidden","&::after":{content:'""',position:"absolute",top:0,left:0,width:"100%",height:"100%",background:`linear-gradient(90deg, transparent, ${e.color.mediumlight}33, transparent)`,animation:"shimmer 1.5s infinite"},"@keyframes shimmer":{"0%":{transform:"translateX(-100%)"},"100%":{transform:"translateX(100%)"}}})),Ey=Dt.span(({theme:e,variant:t="default"})=>{let n={default:{bg:e.background.hoverable,color:e.color.defaultText},success:{bg:`${e.color.positive}40`,color:e.color.positive},warning:{bg:`${e.color.warning}40`,color:e.color.warning},error:{bg:`${e.color.negative}40`,color:e.color.negative}};return{display:"inline-block",padding:"2px 8px",fontSize:e.typography.size.s1,fontWeight:e.typography.weight.bold,borderRadius:"3px",backgroundColor:n[t].bg,color:n[t].color}}),N9=Dt.div(({theme:e})=>({padding:"40px 20px",textAlign:"center",color:e.color.mediumdark})),O9=Dt.div(({theme:e})=>({fontSize:e.typography.size.s3,fontWeight:e.typography.weight.bold,marginBottom:`${e.layoutMargin*.8}px`,color:e.color.defaultText})),_9=Dt.div(({theme:e})=>({fontSize:e.typography.size.s2,color:e.color.mediumdark}));var Pu=({header:e,children:t,footer:n})=>Ay.createElement(ky,null,e,Ay.createElement(Cy,null,t),n);import TE from"react";import{styled as IE}from"storybook/theming";var FE=IE.div(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-end",padding:"6px 12px",borderBottom:`1px solid ${e.appBorderColor}`,position:"sticky",top:0,zIndex:100,backgroundColor:e.background.content})),Lu=({toolbar:e})=>TE.createElement(FE,null,e);import K9 from"react";import{styled as ol}from"storybook/theming";var J9=ol.div(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",padding:"6px 12px",borderBottom:`1px solid ${e.appBorderColor}`,position:"sticky",top:0,zIndex:100,backgroundColor:e.background.content})),Z9=ol.div({display:"flex",flex:1}),eG=ol(Co)(({theme:e,disabled:t})=>({padding:"6px 12px",...t?{color:e.color.mediumlight,cursor:"not-allowed",opacity:.5,"&:hover":{}}:{}})),tG=ol.div({display:"flex",gap:"8px",alignItems:"center"});import en,{useState as rm,useCallback as av,useEffect as lv}from"react";import{styled as lo}from"storybook/theming";import ve,{useEffect as Xw}from"react";import{styled as lt}from"storybook/theming";ke();Ne();ze();ct();var Qw=lt.div({position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:1e4}),Jw=lt.div(({theme:e})=>({position:"absolute",top:"100%",right:0,marginTop:"8px",backgroundColor:e.background.content,borderRadius:"12px",width:"360px",maxWidth:"90vw",boxShadow:"0 10px 40px rgba(0, 0, 0, 0.3)",overflow:"hidden",zIndex:10001})),xR=lt.div({display:"flex",alignItems:"center",gap:"12px",padding:"16px 16px 12px"}),yR=lt.div({width:"36px",height:"36px",borderRadius:"50%",backgroundColor:le,display:"flex",alignItems:"center",justifyContent:"center",color:"#fff",fontSize:"14px",fontWeight:700,flexShrink:0}),bR=lt.div({display:"flex",flexDirection:"column",gap:"4px"}),SR=lt.div(({theme:e})=>({fontSize:"15px",fontWeight:600,color:e.color.defaultText,lineHeight:1.2})),wR=lt.span({display:"inline-block",alignSelf:"flex-start",padding:"2px 10px",borderRadius:"6px",fontSize:"11px",fontWeight:600,color:"#7c3aed",backgroundColor:"rgba(124, 58, 237, 0.1)",letterSpacing:"0.3px"}),vR=lt.div(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 16px 8px",fontSize:"14px",color:e.color.defaultText})),kR=lt.span(({theme:e})=>({color:e.textMutedColor,fontSize:"13px"})),CR=lt.span(({theme:e})=>({color:e.color.defaultText,fontSize:"15px",fontWeight:600})),TR=lt.div(({theme:e})=>({height:"8px",borderRadius:"4px",backgroundColor:e.base==="dark"?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.08)",margin:"0 16px 8px",overflow:"hidden"})),IR=lt.div(({percent:e})=>({height:"100%",width:`${Math.min(100,Math.max(0,e))}%`,background:`linear-gradient(90deg, #f59e0b 0%, ${le} 100%)`,transition:"width 0.3s ease"})),FR=lt.div(({theme:e})=>({padding:"0 16px 14px",fontSize:"12px",color:e.textMutedColor})),ER=lt.div(({theme:e})=>({height:"1px",backgroundColor:e.appBorderColor})),AR=lt.button({width:"100%",padding:"14px 16px",background:"transparent",border:"none",color:le,fontSize:"14px",fontWeight:500,textAlign:"left",cursor:"pointer",display:"flex",alignItems:"center",gap:"6px","&:hover":{backgroundColor:"rgba(0, 0, 0, 0.03)"}}),Zw=lt.button(({theme:e})=>({position:"absolute",top:"12px",right:"12px",width:"24px",height:"24px",borderRadius:"4px",border:"none",background:"transparent",color:e.textMutedColor,cursor:"pointer",fontSize:"16px",display:"flex",alignItems:"center",justifyContent:"center","&:hover":{backgroundColor:e.background.hoverable}})),PR=lt.div(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px",borderBottom:`1px solid ${e.appBorderColor}`})),LR=lt.div(({theme:e})=>({display:"flex",alignItems:"center",gap:"10px",color:e.color.defaultText,fontSize:"14px",fontWeight:500})),MR=lt.div(({theme:e})=>({width:"32px",height:"32px",borderRadius:"50%",backgroundColor:le,display:"flex",alignItems:"center",justifyContent:"center",color:e.color.inverseText,fontSize:"14px",fontWeight:600})),BR=lt.div({display:"flex",gap:"8px"}),ev=lt(Pn)({fontSize:"18px"}),DR=lt.div({padding:"20px 16px"}),RR=lt.div(({theme:e})=>({padding:"16px",borderRadius:"8px",background:"linear-gradient(135deg, #10B981 0%, #3B82F6 100%)",marginBottom:"16px",color:"#fff"})),zR=lt.div({fontSize:"12px",fontWeight:500,opacity:.9,marginBottom:"4px"}),NR=lt.div({fontSize:"28px",fontWeight:700}),OR=lt.div({fontSize:"11px",opacity:.8,marginTop:"4px"}),_R=lt.div(({theme:e})=>({padding:"16px",borderRadius:"8px",border:`1px solid ${e.appBorderColor}`,marginBottom:"16px"})),$R=lt.div({display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"8px"}),UR=lt.div({display:"flex",alignItems:"center",gap:"8px"}),jR=lt.span(({theme:e})=>({fontSize:"14px",fontWeight:600,color:e.color.defaultText})),HR=lt.span(({theme:e})=>({fontSize:"10px",fontWeight:600,padding:"2px 6px",borderRadius:"4px",backgroundColor:le,color:e.color.inverseText})),WR=lt.button(({theme:e})=>({background:"none",border:"none",color:le,fontSize:"12px",cursor:"pointer","&:hover":{textDecoration:"underline"}})),VR=lt.div(({theme:e})=>({fontSize:"12px",color:e.color.mediumdark})),GR=lt.button(({theme:e,variant:t="primary"})=>({width:"100%",padding:"12px",borderRadius:"6px",fontSize:"14px",fontWeight:600,cursor:"pointer",border:"none",marginBottom:"12px",backgroundColor:t==="primary"?le:e.background.hoverable,color:t==="primary"?e.color.inverseText:e.color.defaultText,"&:hover":{opacity:.9}})),qR=30*1e3,tv=({onClose:e})=>{let{sessionToken:t,resetAuth:n,usageData:r,usageLastFetched:o,setUsageData:i}=we(),{featureFlags:s}=ce(),a=s.showCosts,u=r,c=!r&&t,l=async(h=!1)=>{if(!t)return;let S=o&&Date.now()-o<qR;if(!(!h&&S&&r))try{let T=K(),F=await oe(`${T}/api/addon/account`,{headers:{Authorization:`Bearer ${t}`}});if(F.ok){let v=await F.json();i(v)}}catch(T){y.error("Failed to fetch usage:",T)}};Xw(()=>{l()},[t]),Xw(()=>{let h=()=>{document.visibilityState==="visible"&&(y.debug("[TokenUsageModal] Tab visible, refreshing balance..."),l(!0))};return document.addEventListener("visibilitychange",h),()=>document.removeEventListener("visibilitychange",h)},[t]);let d=async()=>{if(t){let h=K();try{await fetch(`${h}/api/addon/auth/sign-out`,{method:"POST",headers:{Authorization:`Bearer ${t}`}})}catch{}}n(),e()},g=()=>{let h=K();window.open(`${h}/pricing`,"_blank")},p=()=>{let h=K();window.open(`${h}/pricing#add-credits`,"_blank")};if(t&&!a&&!c){let h=Math.floor(u?.creditBalance??0),T=Math.max(h,10),F=Math.max(0,T-h),v=T>0?h/T*100:0;return ve.createElement(ve.Fragment,null,ve.createElement(Qw,{onClick:e}),ve.createElement(Jw,{onClick:D=>D.stopPropagation(),style:{width:"320px"}},ve.createElement(xR,null,ve.createElement(yR,null,u?.email?u.email[0].toUpperCase():"U"),ve.createElement(bR,null,ve.createElement(SR,null,"UI Review"),ve.createElement(wR,null,(u?.plan||"BETA").toUpperCase())),ve.createElement("div",{style:{marginLeft:"auto",display:"flex",alignItems:"center",gap:"2px"}},ve.createElement(Zw,{onClick:d,title:"Sign out",style:{position:"static"}},ve.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},ve.createElement("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}),ve.createElement("polyline",{points:"16 17 21 12 16 7"}),ve.createElement("line",{x1:"21",y1:"12",x2:"9",y2:"12"}))),ve.createElement(Zw,{onClick:e,title:"Close",style:{position:"static"}},"\xD7"))),ve.createElement(vR,null,ve.createElement(kR,null,"Credits"),ve.createElement(CR,null,h," left")),ve.createElement(TR,null,ve.createElement(IR,{percent:v})),ve.createElement(FR,null,F," used \xB7 ",h," remaining"),ve.createElement(ER,null),ve.createElement(AR,{onClick:()=>window.open("mailto:hello@uiparity.com?subject=Credits request","_blank")},"Contact us for credits \u2192")))}return ve.createElement(ve.Fragment,null,ve.createElement(Qw,{onClick:e}),ve.createElement(Jw,{onClick:h=>h.stopPropagation()},ve.createElement(PR,null,ve.createElement(LR,null,ve.createElement(MR,null,u?.email?u.email[0].toUpperCase():"U"),ve.createElement("span",null,u?.email||"Loading...")),ve.createElement(BR,null,ve.createElement(ev,{onClick:d,title:"Sign out"},ve.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},ve.createElement("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}),ve.createElement("polyline",{points:"16 17 21 12 16 7"}),ve.createElement("line",{x1:"21",y1:"12",x2:"9",y2:"12"}))),ve.createElement(ev,{onClick:e,title:"Close"},"\xD7"))),ve.createElement(DR,null,c?ve.createElement("div",{style:{textAlign:"center",padding:"20px"}},"Loading..."):t?ve.createElement(ve.Fragment,null,ve.createElement(RR,null,ve.createElement(zR,null,"Credit Balance"),ve.createElement(NR,null,"$",(u?.creditBalance??0).toFixed(2)),ve.createElement(OR,null,(u?.creditBalance??0)<2?"Low balance - consider topping up":"Pay only for what you use")),ve.createElement(_R,null,ve.createElement($R,null,ve.createElement(UR,null,ve.createElement(jR,null,"Current Plan"),ve.createElement(HR,null,u?.plan||"Free")),ve.createElement(WR,{onClick:g},"View detail >")),ve.createElement(VR,null,"~$0.02-0.05 per review depending on complexity"),ve.createElement(GR,{onClick:p,style:{marginTop:"16px"}},"Add Credits"))):ve.createElement("div",{style:{textAlign:"center",padding:"20px"}},"Please sign in to view usage"))))};ke();import Oi from"react";import{styled as nv}from"storybook/theming";Ne();ke();ct();ze();var YR=nv.div({display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"}),KR=nv.span(({theme:e})=>({fontSize:e.typography.size.s1,color:e.color.mediumdark})),XR={admin:{enableFixGeneration:!0,enableFixApply:!0,enableAutoMap:!0,enableReviewBadges:!0,showCosts:!0,enableParallelReview:!0,enableModelSelection:!0},beta:{enableFixGeneration:!0,enableFixApply:!1,enableAutoMap:!0,enableReviewBadges:!1,showCosts:!1,enableParallelReview:!1,enableModelSelection:!1}},rv=()=>{let{userRole:e,roleOverride:t,setRoleOverride:n,setFeatureFlags:r}=ce(),{sessionToken:o}=we();return e!=="admin"?null:Oi.createElement(YR,null,Oi.createElement(KR,null,"View as:"),Oi.createElement(Ty,{value:t??e,onChange:a=>{let u=a.target.value;if(u===e)n(null),o&&oe(`${K()}/api/addon/flags`,{headers:{Authorization:`Bearer ${o}`}}).then(c=>c.json()).then(c=>{let l={enableFixGeneration:!!c.enableFixGeneration,enableFixApply:!!c.enableFixApply,enableAutoMap:!!c.enableAutoMap,enableReviewBadges:!!c.enableReviewBadges,showCosts:!!c.showCosts,enableParallelReview:!!c.enableParallelReview,enableModelSelection:!!c.enableModelSelection};r(l);try{localStorage.setItem("uicopilot_feature_flags",JSON.stringify(l))}catch{}}).catch(c=>y.warn("[RoleSwitcher] Failed to re-fetch flags:",c.message));else{n(u);let c=XR[u];r(c);try{localStorage.setItem("uicopilot_feature_flags",JSON.stringify(c))}catch{}}},style:{width:"auto",minWidth:"100px"}},Oi.createElement("option",{value:"admin"},"Admin"),Oi.createElement("option",{value:"beta"},"Beta Tester")),t&&Oi.createElement(Ey,{variant:"warning"},"Previewing as ",t))};Ne();ke();ct();import St,{useState as Ks,useCallback as nm}from"react";import{styled as Er}from"storybook/theming";var QR="0.5.7",JR=[{value:"bug",label:"\u{1F41E} Bug \u2014 something broke"},{value:"ux",label:"\u{1F9ED} UX \u2014 confusing or slow"},{value:"feature",label:"\u2728 Feature \u2014 missing something"},{value:"praise",label:"\u{1F49A} Praise \u2014 works great"},{value:"other",label:"\u{1F4AC} Other"}],ZR=Er.div({position:"fixed",inset:0,backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:1e4,display:"flex",alignItems:"center",justifyContent:"center"}),ez=Er.div(({theme:e})=>({backgroundColor:e.background.content,borderRadius:"12px",width:"460px",maxWidth:"94%",maxHeight:"90vh",overflow:"auto",boxShadow:"0 16px 48px rgba(0, 0, 0, 0.25)"})),tz=Er.div(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px 12px",borderBottom:`1px solid ${e.appBorderColor}`})),nz=Er.h3(({theme:e})=>({margin:0,fontSize:"15px",fontWeight:600,color:e.color.defaultText,display:"flex",alignItems:"center",gap:"8px"})),rz=Er.button(({theme:e})=>({background:"transparent",border:"none",fontSize:"20px",color:e.color.mediumdark,cursor:"pointer",padding:"0 6px",lineHeight:1,"&:hover":{color:e.color.defaultText}})),oz=Er.div({padding:"16px 20px",display:"flex",flexDirection:"column",gap:"14px"}),iz=Er.textarea(({theme:e})=>({width:"100%",minHeight:"110px",padding:"8px 10px",borderRadius:e.appBorderRadius,border:`1px solid ${e.appBorderColor}`,fontFamily:e.typography.fonts.base,fontSize:e.typography.size.s2,color:e.color.defaultText,backgroundColor:e.background.app,resize:"vertical",boxSizing:"border-box","&:focus":{outline:"none",borderColor:le}})),ov=Er.div(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 20px 16px",borderTop:`1px solid ${e.appBorderColor}`,gap:"8px"})),iv=Er.p(({theme:e})=>({margin:0,fontSize:e.typography.size.s1,color:e.color.mediumdark,lineHeight:1.4})),sz=Er.p(({theme:e})=>({margin:0,fontSize:e.typography.size.s1,color:e.color.negative})),az=Er.div(({theme:e})=>({padding:"24px 20px",textAlign:"center",display:"flex",flexDirection:"column",gap:"10px","& h4":{margin:0,fontSize:"15px",fontWeight:600,color:e.color.positive},"& p":{margin:0,fontSize:e.typography.size.s2,color:e.color.mediumdark}}));function sv({isOpen:e,onClose:t}){let{sessionToken:n,isConnected:r}=we(),{selectedProjectId:o}=Xe(),{currentStoryId:i}=et(),[s,a]=Ks("other"),[u,c]=Ks(""),[l,d]=Ks(!1),[g,p]=Ks(!1),[h,S]=Ks(null),T=nm(()=>{c(""),a("other"),p(!1),S(null),d(!1)},[]),F=nm(()=>{T(),t()},[T,t]),v=nm(async D=>{if(D.preventDefault(),!u.trim()){S("Please write a message.");return}if(!r||!n){S("Sign in to send feedback.");return}d(!0),S(null);try{let N=await oe(`${K()}/api/feedback`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify({message:u.trim(),severity:s,projectId:o||void 0,storyId:i||void 0,addonVersion:QR})});if(!N.ok){let U=await N.json().catch(()=>({}));throw new Error(U.error||`Request failed (${N.status})`)}p(!0)}catch(N){S(N instanceof Error?N.message:"Something went wrong")}finally{d(!1)}},[u,s,n,r,o,i]);return e?St.createElement(ZR,{onClick:F},St.createElement(ez,{onClick:D=>D.stopPropagation()},St.createElement(tz,null,St.createElement(nz,null,St.createElement("span",null,"\u{1F4AC}"),"Send feedback"),St.createElement(rz,{onClick:F,"aria-label":"Close"},"\xD7")),g?St.createElement(St.Fragment,null,St.createElement(az,null,St.createElement("h4",null,"Thanks \u2014 got it."),St.createElement("p",null,"We read every message. If it's a bug, we'll likely follow up by email.")),St.createElement(ov,null,St.createElement("span",null),St.createElement(An,{onClick:F},"Close"))):St.createElement("form",{onSubmit:v},St.createElement(oz,null,St.createElement(vo,null,St.createElement(ko,{htmlFor:"feedback-severity"},"Type"),St.createElement(Sn,{id:"feedback-severity",value:s,onChange:D=>a(D.target.value),disabled:l},JR.map(D=>St.createElement("option",{key:D.value,value:D.value},D.label)))),St.createElement(vo,null,St.createElement(ko,{htmlFor:"feedback-message"},"What happened?"),St.createElement(iz,{id:"feedback-message",value:u,onChange:D=>c(D.target.value),placeholder:"Tell us what you were doing, what you expected, and what happened.",disabled:l,autoFocus:!0,maxLength:5e3})),St.createElement(iv,null,"We auto-attach your current story and project so we can reproduce it. No screenshots sent."),h&&St.createElement(sz,null,h)),St.createElement(ov,null,St.createElement(iv,null,i?`Context: ${i}`:"No story selected"),St.createElement("div",{style:{display:"flex",gap:"8px"}},St.createElement(An,{type:"button",onClick:F,disabled:l},"Cancel"),St.createElement(on,{type:"submit",disabled:l||!u.trim()},l?"Sending\u2026":"Send")))))):null}ke();Ne();ct();var lz=lo.div({display:"flex",alignItems:"center"}),_i=lo.div(({theme:e})=>({display:"flex",alignItems:"center",paddingLeft:"8px",borderLeft:`1px solid ${e.appBorderColor}`,"&:first-of-type":{paddingLeft:0,borderLeft:"none"}})),cz=lo.span(({theme:e})=>({fontSize:e.typography.size.s1,color:e.color.secondary,fontWeight:e.typography.weight.bold,paddingRight:"8px",opacity:.8})),uz=lo.div({position:"relative"}),pz=lo.button(({theme:e})=>({width:"26px",height:"26px",padding:0,background:`linear-gradient(135deg, ${e.color.secondary} 0%, ${e.color.secondary}cc 100%)`,border:"none",borderRadius:"50%",color:e.color.inverseText,cursor:"pointer",fontSize:e.typography.size.s2,fontWeight:e.typography.weight.bold,display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s","&:hover":{transform:"scale(1.05)",boxShadow:`0 2px 8px ${e.color.secondary}66`}})),cv=lo.button(({isLow:e})=>({display:"flex",alignItems:"center",gap:"6px",padding:"4px 10px",background:e?"#FEF3C7":"linear-gradient(135deg, #10B981 0%, #3B82F6 100%)",border:"none",borderRadius:"12px",color:e?"#92400E":"#fff",cursor:"pointer",fontSize:"12px",fontWeight:600,transition:"all 0.2s",minWidth:"60px",justifyContent:"center","&:hover":{transform:"scale(1.02)",boxShadow:"0 2px 8px rgba(0,0,0,0.15)"}})),dz=lo.span({display:"inline-block",width:"12px",height:"12px",border:"2px solid rgba(255,255,255,0.3)",borderTopColor:"#fff",borderRadius:"50%",animation:"credit-spin 0.8s linear infinite","@keyframes credit-spin":{"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}}),gz=lo.button(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",gap:"4px",padding:"4px 10px",height:"28px",border:`1px solid ${e.appBorderColor}`,borderRadius:e.appBorderRadius,backgroundColor:"transparent",color:e.color.mediumdark,fontSize:"12px",fontWeight:500,cursor:"pointer",transition:"all 0.15s","&:hover":{backgroundColor:e.background.hoverable,color:e.color.defaultText,borderColor:e.color.mediumdark}})),fz=lo.button({position:"fixed",bottom:"20px",right:"20px",width:"48px",height:"48px",borderRadius:"50%",backgroundColor:le,color:"white",border:"none",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"22px",cursor:"pointer",boxShadow:`0 4px 14px ${le}66, 0 2px 4px rgba(0,0,0,0.1)`,transition:"all 0.2s ease",zIndex:9999,"&:hover":{transform:"scale(1.08)",boxShadow:`0 6px 20px ${le}88, 0 3px 6px rgba(0,0,0,0.15)`},"&:active":{transform:"scale(0.96)"}}),mz=30*1e3,om=({onOpenSettings:e})=>{let[t,n]=rm(!1),[r,o]=rm(!1),[i,s]=rm(!1),{usageData:a,usageLastFetched:u,setUsageData:c,sessionToken:l}=we(),{userRole:d,roleOverride:g,featureFlags:p}=ce(),h=g??d;lv(()=>{(async()=>{if(!(!l||u&&Date.now()-u<mz&&a)){s(!0);try{let U=K(),L=await oe(`${U}/api/addon/account`,{headers:{Authorization:`Bearer ${l}`}});if(L.ok){let z=await L.json();c(z)}}catch(U){console.error("Failed to fetch balance:",U)}finally{s(!1)}}})()},[l,u,a,c]),lv(()=>{let D=()=>{document.visibilityState==="visible"&&t&&n(!1)},N=()=>{t&&n(!1)};return document.addEventListener("visibilitychange",D),window.addEventListener("focus",N),()=>{document.removeEventListener("visibilitychange",D),window.removeEventListener("focus",N)}},[t]);let S=av(()=>{n(!0)},[]),T=av(()=>{n(!1)},[]),F=a?.creditBalance??0,v=F<2&&!i;return en.createElement(lz,null,e&&en.createElement(_i,null,en.createElement(gz,{onClick:e,title:"Settings"},en.createElement("span",{style:{fontSize:"14px"}},"\u2699"),"Settings")),l&&d==="admin"&&h==="admin"&&en.createElement(_i,null,en.createElement(rv,null)),en.createElement(_i,null,en.createElement(cz,null,"v","0.5.45")),l&&p.showCosts&&en.createElement(_i,null,en.createElement(cv,{onClick:S,isLow:v,title:i?"Loading...":a?v?"Low balance - click to top up":"Credit balance - click for details":"Click to load balance"},i?en.createElement(dz,null):a?`$${F.toFixed(2)}`:"...")),l&&!p.showCosts&&a&&en.createElement(_i,null,en.createElement(cv,{onClick:S,isLow:Math.floor(F)<=3,title:`${Math.floor(F)} review credits \u2014 click for details`},"\u26A1 ",Math.floor(F))),en.createElement(_i,null,en.createElement(uz,null,en.createElement(pz,{title:"Account & Usage",onClick:S},a?.email?a.email[0].toUpperCase():"?"),t&&en.createElement(tv,{onClose:T}))),l&&en.createElement(fz,{onClick:()=>o(!0),title:"Send feedback","aria-label":"Send feedback"},"\u{1F4AC}"),en.createElement(sv,{isOpen:r,onClose:()=>o(!1)}))};import Bt,{useEffect as w5,useRef as v5}from"react";import{styled as fr}from"storybook/theming";import tt from"react";ke();ze();Ne();ct();ln();import{useState as hz,useCallback as Lo,useRef as xz,useEffect as uv}from"react";var Ar=K();y.debug("[useAuth] Module loaded, APP_URL:",Ar);var Zl=null,ec=null,Xs=null;function Qs(){Zl&&(clearInterval(Zl),Zl=null),ec&&(clearTimeout(ec),ec=null)}var Js=()=>{let e=xz(null),{sessionToken:t,apiKey:n,authMethod:r,deviceCode:o,userCode:i,verificationUri:s,isConnected:a,authError:u,setSessionToken:c,setApiKey:l,setAuthMethod:d,setDeviceCode:g,setUserCode:p,setVerificationUri:h,setPollingInterval:S,setAuthError:T,resetAuth:F}=we(),[v,D]=hz(!1),N=Lo(()=>{Qs(),Xs=null},[]),U=Lo(f=>{Xs=f,Qs();let C=async()=>{let E=Xs;if(!E){Qs();return}try{let I=await(await fetch(`${Ar}/api/addon/auth/poll`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({device_code:E})})).json();I.status==="authorized"&&I.session_token?(y.debug("[useAuth] \u2705 OAuth poll successful! Got token."),Qs(),Xs=null,localStorage.setItem("uicopilot_session_token",I.session_token),c(I.session_token),D(!1)):I.status==="expired"&&(y.debug("[useAuth] OAuth poll_code expired"),Qs(),Xs=null,D(!1))}catch(x){y.error("[useAuth] OAuth poll error:",x)}};Zl=setInterval(C,2e3),ec=setTimeout(C,1e3)},[c]);uv(()=>{function f(C){if(!C.origin.startsWith(Ar))return;let E=C.data;if(!E||typeof E!="object")return;let x=E;if(x.type==="UICOPILOT_AUTH_ERROR"){y.debug("[useAuth] Popup reported auth error:",x.step,x.detail),N(),D(!1);let I=typeof x.step=="string"?x.step:"auth",P=typeof x.detail=="string"?x.detail:"Unknown error";T(`${Et.NAME} auth failed (${I}): ${P}`)}else x.type==="UICOPILOT_AUTH_POLL_CODE"&&typeof x.pollCode=="string"&&x.pollCode&&(y.debug("[useAuth] Popup handed us a fresh poll_code, switching"),T(null),U(x.pollCode))}return window.addEventListener("message",f),()=>window.removeEventListener("message",f)},[U,N,T]);let L=Lo(async()=>{try{y.debug("[useAuth] Starting OAuth flow, requesting poll_code...");let f;try{f=await oe(`${Ar}/api/addon/auth/oauth-poll`,{method:"POST"})}catch(I){let B=I instanceof Error&&I.message.includes("timed out")?`Cannot reach ${Et.NAME} server at ${Ar}. Is the dashboard running?`:`Connection failed: ${Ar} is not responding.`;T(B),y.error("[useAuth]",B);return}if(!f.ok){let I=`Cannot reach ${Et.NAME} server. Is the dashboard running?`;T(I),y.error("[useAuth]",I);return}let{poll_code:C}=await f.json();y.debug("[useAuth] Got poll_code:",C.substring(0,15)+"...");let E=localStorage.getItem("uicopilot_force_sign_in")==="true";E&&localStorage.removeItem("uicopilot_force_sign_in");let x=`${Ar}/addon/auth?poll_code=${C}${E?"&force_sign_in=true":""}`;D(!0),window.open(x,"uiparity-auth","width=520,height=620,left=300,top=150"),y.debug("[useAuth] Starting OAuth poll for token..."),U(C)}catch(f){y.error("[useAuth] OAuth flow error:",f),T(`Connection failed. Is the dashboard running at ${Ar}?`),D(!1)}},[T,U]),z=Lo(async()=>{try{let f=await fetch(`${Ar}/api/addon/auth/device`,{method:"POST"});if(!f.ok)throw new Error("Failed to start device code flow");let C=await f.json();g(C.device_code),p(C.user_code),h(C.verification_uri),window.open(C.verification_uri,"_blank"),m(C.device_code,C.interval*1e3)}catch(f){throw y.error("[useAuth] Device code flow error:",f),f}},[g,p,h]),m=Lo((f,C)=>{y.debug("[useAuth] Starting polling. Device code:",f,"Interval:",C),e.current&&clearInterval(e.current);let E=async()=>{try{let I=await(await fetch(`${Ar}/api/addon/auth/poll`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({device_code:f})})).json();I.status==="authorized"?(y.debug("[useAuth] Device code authorization successful!"),e.current&&(clearInterval(e.current),e.current=null),g(null),p(null),h(null),localStorage.setItem("uicopilot_session_token",I.session_token),c(I.session_token),D(!1)):(I.status==="expired"||I.status==="denied")&&(y.debug("[useAuth] Device code expired or denied"),e.current&&(clearInterval(e.current),e.current=null),g(null),p(null),h(null))}catch(x){y.error("[useAuth] Polling error:",x)}};e.current=setInterval(E,C),S(C)},[g,p,h,c,S]),b=Lo(()=>{e.current&&(clearInterval(e.current),e.current=null),g(null),p(null),h(null),S(null)},[g,p,h,S]),w=Lo(f=>{l(f),c(f),localStorage.setItem("uicopilot_api_key",f)},[l,c]),A=Lo(async()=>{if(t)try{await oe(`${Ar}/api/addon/auth/sign-out`,{method:"POST",headers:{Authorization:`Bearer ${t}`}})}catch{}F(),D(!1),e.current&&(clearInterval(e.current),e.current=null),N()},[t,F,N]);return uv(()=>()=>{e.current&&clearInterval(e.current)},[]),{sessionToken:t,apiKey:n,authMethod:r,deviceCode:o,userCode:i,verificationUri:s,isConnected:a,authError:u,oauthPending:v,setAuthMethod:d,startOAuth:L,startDeviceCode:z,cancelDeviceCode:b,saveApiKey:w,logout:A}};ke();ze();Ne();ct();import{useCallback as tc}from"react";var Zs=K(),co=()=>{let{projects:e,selectedProjectId:t,loadingProjects:n,setProjects:r,setSelectedProjectId:o,setLoadingProjects:i,getSelectedProject:s}=Xe(),{sessionToken:a}=we(),u=tc(async()=>{if(!a){y.debug("[useProjects] No session token, skipping fetch");return}try{i(!0),y.debug("[useProjects] Fetching from:",`${Zs}/api/projects`);let g=await oe(`${Zs}/api/projects`,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`}});if(g.ok){let p=await g.json();y.debug("[useProjects] Projects:",p.projects),r(p.projects||[])}else y.error("[useProjects] Failed to fetch projects:",g.status,g.statusText)}catch(g){y.error("[useProjects] Error fetching projects:",g)}finally{i(!1)}},[a,r,i]),c=tc(async g=>{if(!a)throw new Error("Not authenticated");let p=await oe(`${Zs}/api/projects`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`},body:JSON.stringify(g)});if(!p.ok)throw new Error("Failed to create project");let h=await p.json();return await u(),h.project},[a,u]),l=tc(async(g,p)=>{if(!a)throw new Error("Not authenticated");let h={};if(p.name!==void 0&&(h.name=p.name),p.description!==void 0&&(h.description=p.description),p.figmaFileUrl!==void 0&&(h.figmaFileId=p.figmaFileUrl===""?null:p.figmaFileUrl),!(await oe(`${Zs}/api/projects/${g}`,{method:"PATCH",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`},body:JSON.stringify(h)})).ok)throw new Error("Failed to update project");await u()},[a,u]),d=tc(async g=>{if(!a)throw new Error("Not authenticated");if(!(await oe(`${Zs}/api/projects/${g}`,{method:"DELETE",headers:{Authorization:`Bearer ${a}`}})).ok)throw new Error("Failed to delete project");await u(),t===g&&o(null)},[a,t,u,o]);return{projects:e,selectedProjectId:t,selectedProject:s(),loadingProjects:n,setSelectedProjectId:o,fetchProjects:u,createProject:c,updateProject:l,deleteProject:d}};ke();var ea=()=>{let{showComponentBrowser:e,figmaFileUrl:t,currentMapping:n,mappingSource:r,loadingMapping:o,showFigmaQuality:i,setShowComponentBrowser:s,setFigmaFileUrl:a,setCurrentMapping:u,setMappingSource:c,setLoadingMapping:l,setShowFigmaQuality:d}=et();return{showComponentBrowser:e,figmaFileUrl:t,currentMapping:n,mappingSource:r,loadingMapping:o,showFigmaQuality:i,setShowComponentBrowser:s,setFigmaFileUrl:a,setCurrentMapping:u,setMappingSource:c,setLoadingMapping:l,setShowFigmaQuality:d,openComponentBrowser:()=>s(!0),closeComponentBrowser:()=>s(!1)}};ke();cm();mm();import{useCallback as la,useRef as gc}from"react";ze();function sc(){return new Promise(e=>{let t=document.getElementById("storybook-preview-iframe");if(!t||!t.contentWindow){y.warn("[iframeReload] No preview iframe found"),e();return}let n=t.contentWindow.location.href,r=new URL(n);r.searchParams.set("_cb",Date.now().toString());let o=r.toString();y.debug("[iframeReload] Triggering cache-busted reload:",o);let i=setTimeout(()=>{y.warn("[iframeReload] Iframe reload timed out after 5s"),t.removeEventListener("load",s),e()},5e3),s=()=>{clearTimeout(i),t.removeEventListener("load",s),y.debug("[iframeReload] Iframe loaded, waiting for HMR and styles to settle..."),setTimeout(()=>{y.debug("[iframeReload] Iframe reloaded and styles should be fresh"),e()},2e3)};t.addEventListener("load",s),t.contentWindow.location.href=o})}function ac(e){return e&&e!=="admin"?{"X-UIC-Role-Preview":e}:{}}var lc=BigInt(4294967295),Fv=BigInt(32);function _z(e,t=!1){return t?{h:Number(e&lc),l:Number(e>>Fv&lc)}:{h:Number(e>>Fv&lc)|0,l:Number(e&lc)|0}}function Ev(e,t=!1){let n=e.length,r=new Uint32Array(n),o=new Uint32Array(n);for(let i=0;i<n;i++){let{h:s,l:a}=_z(e[i],t);[r[i],o[i]]=[s,a]}return[r,o]}var Av=(e,t,n)=>e<<n|t>>>32-n,Pv=(e,t,n)=>t<<n|e>>>32-n,Lv=(e,t,n)=>t<<n-32|e>>>64-n,Mv=(e,t,n)=>e<<n-32|t>>>64-n;function $z(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function hm(e,t=""){if(!Number.isSafeInteger(e)||e<0){let n=t&&`"${t}" `;throw new Error(`${n}expected integer >= 0, got ${e}`)}}function cc(e,t,n=""){let r=$z(e),o=e?.length,i=t!==void 0;if(!r||i&&o!==t){let s=n&&`"${n}" `,a=i?` of length ${t}`:"",u=r?`length=${o}`:`type=${typeof e}`;throw new Error(s+"expected Uint8Array"+a+", got "+u)}return e}function xm(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Bv(e,t){cc(e,void 0,"digestInto() output");let n=t.outputLen;if(e.length<n)throw new Error('"digestInto() output" expected to be of length >='+n)}function Dv(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function ym(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}var Uz=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function jz(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function Hz(e){for(let t=0;t<e.length;t++)e[t]=jz(e[t]);return e}var bm=Uz?e=>e:Hz;function Rv(e,t={}){let n=(o,i)=>e(i).update(o).digest(),r=e(void 0);return n.outputLen=r.outputLen,n.blockLen=r.blockLen,n.create=o=>e(o),Object.assign(n,t),Object.freeze(n)}var zv=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});var Wz=BigInt(0),oa=BigInt(1),Vz=BigInt(2),Gz=BigInt(7),qz=BigInt(256),Yz=BigInt(113),_v=[],$v=[],Uv=[];for(let e=0,t=oa,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],_v.push(2*(5*r+n)),$v.push((e+1)*(e+2)/2%64);let o=Wz;for(let i=0;i<7;i++)t=(t<<oa^(t>>Gz)*Yz)%qz,t&Vz&&(o^=oa<<(oa<<BigInt(i))-oa);Uv.push(o)}var jv=Ev(Uv,!0),Kz=jv[0],Xz=jv[1],Nv=(e,t,n)=>n>32?Lv(e,t,n):Av(e,t,n),Ov=(e,t,n)=>n>32?Mv(e,t,n):Pv(e,t,n);function Qz(e,t=24){let n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let s=0;s<10;s++)n[s]=e[s]^e[s+10]^e[s+20]^e[s+30]^e[s+40];for(let s=0;s<10;s+=2){let a=(s+8)%10,u=(s+2)%10,c=n[u],l=n[u+1],d=Nv(c,l,1)^n[a],g=Ov(c,l,1)^n[a+1];for(let p=0;p<50;p+=10)e[s+p]^=d,e[s+p+1]^=g}let o=e[2],i=e[3];for(let s=0;s<24;s++){let a=$v[s],u=Nv(o,i,a),c=Ov(o,i,a),l=_v[s];o=e[l],i=e[l+1],e[l]=u,e[l+1]=c}for(let s=0;s<50;s+=10){for(let a=0;a<10;a++)n[a]=e[s+a];for(let a=0;a<10;a++)e[s+a]^=~n[(a+2)%10]&n[(a+4)%10]}e[0]^=Kz[r],e[1]^=Xz[r]}ym(n)}var Sm=class e{constructor(t,n,r,o=!1,i=24){sr(this,"state");sr(this,"pos",0);sr(this,"posOut",0);sr(this,"finished",!1);sr(this,"state32");sr(this,"destroyed",!1);sr(this,"blockLen");sr(this,"suffix");sr(this,"outputLen");sr(this,"enableXOF",!1);sr(this,"rounds");if(this.blockLen=t,this.suffix=n,this.outputLen=r,this.enableXOF=o,this.rounds=i,hm(r,"outputLen"),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=Dv(this.state)}clone(){return this._cloneInto()}keccak(){bm(this.state32),Qz(this.state32,this.rounds),bm(this.state32),this.posOut=0,this.pos=0}update(t){xm(this),cc(t);let{blockLen:n,state:r}=this,o=t.length;for(let i=0;i<o;){let s=Math.min(n-this.pos,o-i);for(let a=0;a<s;a++)r[this.pos++]^=t[i++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:n,pos:r,blockLen:o}=this;t[r]^=n,(n&128)!==0&&r===o-1&&this.keccak(),t[o-1]^=128,this.keccak()}writeInto(t){xm(this,!1),cc(t),this.finish();let n=this.state,{blockLen:r}=this;for(let o=0,i=t.length;o<i;){this.posOut>=r&&this.keccak();let s=Math.min(r-this.posOut,i-o);t.set(n.subarray(this.posOut,this.posOut+s),o),this.posOut+=s,o+=s}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return hm(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Bv(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,ym(this.state)}_cloneInto(t){let{blockLen:n,suffix:r,outputLen:o,rounds:i,enableXOF:s}=this;return t||(t=new e(n,r,o,s,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=r,t.outputLen=o,t.enableXOF=s,t.destroyed=this.destroyed,t}},Jz=(e,t,n,r={})=>Rv(()=>new Sm(t,e,n),r);var Hv=Jz(6,72,64,zv(10));var Zz=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,wm=Math.ceil,dr=Math.floor,Hn="[BigNumber Error] ",Wv=Hn+"Number primitive has more than 15 significant digits: ",Pr=1e14,He=14,vm=9007199254740991,km=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Bo=1e7,cn=1e9;function Vv(e){var t,n,r,o=v.prototype={constructor:v,toString:null,valueOf:null},i=new v(1),s=20,a=4,u=-7,c=21,l=-1e7,d=1e7,g=!1,p=1,h=0,S={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xA0",suffix:""},T="0123456789abcdefghijklmnopqrstuvwxyz",F=!0;function v(m,b){var w,A,f,C,E,x,I,P,B=this;if(!(B instanceof v))return new v(m,b);if(b==null){if(m&&m._isBigNumber===!0){B.s=m.s,!m.c||m.e>d?B.c=B.e=null:m.e<l?B.c=[B.e=0]:(B.e=m.e,B.c=m.c.slice());return}if((x=typeof m=="number")&&m*0==0){if(B.s=1/m<0?(m=-m,-1):1,m===~~m){for(C=0,E=m;E>=10;E/=10,C++);C>d?B.c=B.e=null:(B.e=C,B.c=[m]);return}P=String(m)}else{if(!Zz.test(P=String(m)))return r(B,P,x);B.s=P.charCodeAt(0)==45?(P=P.slice(1),-1):1}(C=P.indexOf("."))>-1&&(P=P.replace(".","")),(E=P.search(/e/i))>0?(C<0&&(C=E),C+=+P.slice(E+1),P=P.substring(0,E)):C<0&&(C=P.length)}else{if(Ot(b,2,T.length,"Base"),b==10&&F)return B=new v(m),L(B,s+B.e+1,a);if(P=String(m),x=typeof m=="number"){if(m*0!=0)return r(B,P,x,b);if(B.s=1/m<0?(P=P.slice(1),-1):1,v.DEBUG&&P.replace(/^0\.0*|\./,"").length>15)throw Error(Wv+m)}else B.s=P.charCodeAt(0)===45?(P=P.slice(1),-1):1;for(w=T.slice(0,b),C=E=0,I=P.length;E<I;E++)if(w.indexOf(A=P.charAt(E))<0){if(A=="."){if(E>C){C=I;continue}}else if(!f&&(P==P.toUpperCase()&&(P=P.toLowerCase())||P==P.toLowerCase()&&(P=P.toUpperCase()))){f=!0,E=-1,C=0;continue}return r(B,String(m),x,b)}x=!1,P=n(P,b,10,B.s),(C=P.indexOf("."))>-1?P=P.replace(".",""):C=P.length}for(E=0;P.charCodeAt(E)===48;E++);for(I=P.length;P.charCodeAt(--I)===48;);if(P=P.slice(E,++I)){if(I-=E,x&&v.DEBUG&&I>15&&(m>vm||m!==dr(m)))throw Error(Wv+B.s*m);if((C=C-E-1)>d)B.c=B.e=null;else if(C<l)B.c=[B.e=0];else{if(B.e=C,B.c=[],E=(C+1)%He,C<0&&(E+=He),E<I){for(E&&B.c.push(+P.slice(0,E)),I-=He;E<I;)B.c.push(+P.slice(E,E+=He));E=He-(P=P.slice(E)).length}else E-=I;for(;E--;P+="0");B.c.push(+P)}}else B.c=[B.e=0]}v.clone=Vv,v.ROUND_UP=0,v.ROUND_DOWN=1,v.ROUND_CEIL=2,v.ROUND_FLOOR=3,v.ROUND_HALF_UP=4,v.ROUND_HALF_DOWN=5,v.ROUND_HALF_EVEN=6,v.ROUND_HALF_CEIL=7,v.ROUND_HALF_FLOOR=8,v.EUCLID=9,v.config=v.set=function(m){var b,w;if(m!=null)if(typeof m=="object"){if(m.hasOwnProperty(b="DECIMAL_PLACES")&&(w=m[b],Ot(w,0,cn,b),s=w),m.hasOwnProperty(b="ROUNDING_MODE")&&(w=m[b],Ot(w,0,8,b),a=w),m.hasOwnProperty(b="EXPONENTIAL_AT")&&(w=m[b],w&&w.pop?(Ot(w[0],-cn,0,b),Ot(w[1],0,cn,b),u=w[0],c=w[1]):(Ot(w,-cn,cn,b),u=-(c=w<0?-w:w))),m.hasOwnProperty(b="RANGE"))if(w=m[b],w&&w.pop)Ot(w[0],-cn,-1,b),Ot(w[1],1,cn,b),l=w[0],d=w[1];else if(Ot(w,-cn,cn,b),w)l=-(d=w<0?-w:w);else throw Error(Hn+b+" cannot be zero: "+w);if(m.hasOwnProperty(b="CRYPTO"))if(w=m[b],w===!!w)if(w)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))g=w;else throw g=!w,Error(Hn+"crypto unavailable");else g=w;else throw Error(Hn+b+" not true or false: "+w);if(m.hasOwnProperty(b="MODULO_MODE")&&(w=m[b],Ot(w,0,9,b),p=w),m.hasOwnProperty(b="POW_PRECISION")&&(w=m[b],Ot(w,0,cn,b),h=w),m.hasOwnProperty(b="FORMAT"))if(w=m[b],typeof w=="object")S=w;else throw Error(Hn+b+" not an object: "+w);if(m.hasOwnProperty(b="ALPHABET"))if(w=m[b],typeof w=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(w))F=w.slice(0,10)=="0123456789",T=w;else throw Error(Hn+b+" invalid: "+w)}else throw Error(Hn+"Object expected: "+m);return{DECIMAL_PLACES:s,ROUNDING_MODE:a,EXPONENTIAL_AT:[u,c],RANGE:[l,d],CRYPTO:g,MODULO_MODE:p,POW_PRECISION:h,FORMAT:S,ALPHABET:T}},v.isBigNumber=function(m){if(!m||m._isBigNumber!==!0)return!1;if(!v.DEBUG)return!0;var b,w,A=m.c,f=m.e,C=m.s;e:if({}.toString.call(A)=="[object Array]"){if((C===1||C===-1)&&f>=-cn&&f<=cn&&f===dr(f)){if(A[0]===0){if(f===0&&A.length===1)return!0;break e}if(b=(f+1)%He,b<1&&(b+=He),String(A[0]).length==b){for(b=0;b<A.length;b++)if(w=A[b],w<0||w>=Pr||w!==dr(w))break e;if(w!==0)return!0}}}else if(A===null&&f===null&&(C===null||C===1||C===-1))return!0;throw Error(Hn+"Invalid BigNumber: "+m)},v.maximum=v.max=function(){return N(arguments,-1)},v.minimum=v.min=function(){return N(arguments,1)},v.random=(function(){var m=9007199254740992,b=Math.random()*m&2097151?function(){return dr(Math.random()*m)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(w){var A,f,C,E,x,I=0,P=[],B=new v(i);if(w==null?w=s:Ot(w,0,cn),E=wm(w/He),g)if(crypto.getRandomValues){for(A=crypto.getRandomValues(new Uint32Array(E*=2));I<E;)x=A[I]*131072+(A[I+1]>>>11),x>=9e15?(f=crypto.getRandomValues(new Uint32Array(2)),A[I]=f[0],A[I+1]=f[1]):(P.push(x%1e14),I+=2);I=E/2}else if(crypto.randomBytes){for(A=crypto.randomBytes(E*=7);I<E;)x=(A[I]&31)*281474976710656+A[I+1]*1099511627776+A[I+2]*4294967296+A[I+3]*16777216+(A[I+4]<<16)+(A[I+5]<<8)+A[I+6],x>=9e15?crypto.randomBytes(7).copy(A,I):(P.push(x%1e14),I+=7);I=E/7}else throw g=!1,Error(Hn+"crypto unavailable");if(!g)for(;I<E;)x=b(),x<9e15&&(P[I++]=x%1e14);for(E=P[--I],w%=He,E&&w&&(x=km[He-w],P[I]=dr(E/x)*x);P[I]===0;P.pop(),I--);if(I<0)P=[C=0];else{for(C=-1;P[0]===0;P.splice(0,1),C-=He);for(I=1,x=P[0];x>=10;x/=10,I++);I<He&&(C-=He-I)}return B.e=C,B.c=P,B}})(),v.sum=function(){for(var m=1,b=arguments,w=new v(b[0]);m<b.length;)w=w.plus(b[m++]);return w},n=(function(){var m="0123456789";function b(w,A,f,C){for(var E,x=[0],I,P=0,B=w.length;P<B;){for(I=x.length;I--;x[I]*=A);for(x[0]+=C.indexOf(w.charAt(P++)),E=0;E<x.length;E++)x[E]>f-1&&(x[E+1]==null&&(x[E+1]=0),x[E+1]+=x[E]/f|0,x[E]%=f)}return x.reverse()}return function(w,A,f,C,E){var x,I,P,B,_,k,R,H,M=w.indexOf("."),se=s,X=a;for(M>=0&&(B=h,h=0,w=w.replace(".",""),H=new v(A),k=H.pow(w.length-M),h=B,H.c=b(uo(pr(k.c),k.e,"0"),10,f,m),H.e=H.c.length),R=b(w,A,f,E?(x=T,m):(x=m,T)),P=B=R.length;R[--B]==0;R.pop());if(!R[0])return x.charAt(0);if(M<0?--P:(k.c=R,k.e=P,k.s=C,k=t(k,H,se,X,f),R=k.c,_=k.r,P=k.e),I=P+se+1,M=R[I],B=f/2,_=_||I<0||R[I+1]!=null,_=X<4?(M!=null||_)&&(X==0||X==(k.s<0?3:2)):M>B||M==B&&(X==4||_||X==6&&R[I-1]&1||X==(k.s<0?8:7)),I<1||!R[0])w=_?uo(x.charAt(1),-se,x.charAt(0)):x.charAt(0);else{if(R.length=I,_)for(--f;++R[--I]>f;)R[I]=0,I||(++P,R=[1].concat(R));for(B=R.length;!R[--B];);for(M=0,w="";M<=B;w+=x.charAt(R[M++]));w=uo(w,P,x.charAt(0))}return w}})(),t=(function(){function m(A,f,C){var E,x,I,P,B=0,_=A.length,k=f%Bo,R=f/Bo|0;for(A=A.slice();_--;)I=A[_]%Bo,P=A[_]/Bo|0,E=R*I+P*k,x=k*I+E%Bo*Bo+B,B=(x/C|0)+(E/Bo|0)+R*P,A[_]=x%C;return B&&(A=[B].concat(A)),A}function b(A,f,C,E){var x,I;if(C!=E)I=C>E?1:-1;else for(x=I=0;x<C;x++)if(A[x]!=f[x]){I=A[x]>f[x]?1:-1;break}return I}function w(A,f,C,E){for(var x=0;C--;)A[C]-=x,x=A[C]<f[C]?1:0,A[C]=x*E+A[C]-f[C];for(;!A[0]&&A.length>1;A.splice(0,1));}return function(A,f,C,E,x){var I,P,B,_,k,R,H,M,se,X,re,me,Pe,qe,ge,Ue,it,V=A.s==f.s?1:-1,Se=A.c,pe=f.c;if(!Se||!Se[0]||!pe||!pe[0])return new v(!A.s||!f.s||(Se?pe&&Se[0]==pe[0]:!pe)?NaN:Se&&Se[0]==0||!pe?V*0:V/0);for(M=new v(V),se=M.c=[],P=A.e-f.e,V=C+P+1,x||(x=Pr,P=gr(A.e/He)-gr(f.e/He),V=V/He|0),B=0;pe[B]==(Se[B]||0);B++);if(pe[B]>(Se[B]||0)&&P--,V<0)se.push(1),_=!0;else{for(qe=Se.length,Ue=pe.length,B=0,V+=2,k=dr(x/(pe[0]+1)),k>1&&(pe=m(pe,k,x),Se=m(Se,k,x),Ue=pe.length,qe=Se.length),Pe=Ue,X=Se.slice(0,Ue),re=X.length;re<Ue;X[re++]=0);it=pe.slice(),it=[0].concat(it),ge=pe[0],pe[1]>=x/2&&ge++;do{if(k=0,I=b(pe,X,Ue,re),I<0){if(me=X[0],Ue!=re&&(me=me*x+(X[1]||0)),k=dr(me/ge),k>1)for(k>=x&&(k=x-1),R=m(pe,k,x),H=R.length,re=X.length;b(R,X,H,re)==1;)k--,w(R,Ue<H?it:pe,H,x),H=R.length,I=1;else k==0&&(I=k=1),R=pe.slice(),H=R.length;if(H<re&&(R=[0].concat(R)),w(X,R,re,x),re=X.length,I==-1)for(;b(pe,X,Ue,re)<1;)k++,w(X,Ue<re?it:pe,re,x),re=X.length}else I===0&&(k++,X=[0]);se[B++]=k,X[0]?X[re++]=Se[Pe]||0:(X=[Se[Pe]],re=1)}while((Pe++<qe||X[0]!=null)&&V--);_=X[0]!=null,se[0]||se.splice(0,1)}if(x==Pr){for(B=1,V=se[0];V>=10;V/=10,B++);L(M,C+(M.e=B+P*He-1)+1,E,_)}else M.e=P,M.r=+_;return M}})();function D(m,b,w,A){var f,C,E,x,I;if(w==null?w=a:Ot(w,0,8),!m.c)return m.toString();if(f=m.c[0],E=m.e,b==null)I=pr(m.c),I=A==1||A==2&&(E<=u||E>=c)?pc(I,E):uo(I,E,"0");else if(m=L(new v(m),b,w),C=m.e,I=pr(m.c),x=I.length,A==1||A==2&&(b<=C||C<=u)){for(;x<b;I+="0",x++);I=pc(I,C)}else if(b-=E+(A===2&&C>E),I=uo(I,C,"0"),C+1>x){if(--b>0)for(I+=".";b--;I+="0");}else if(b+=C-x,b>0)for(C+1==x&&(I+=".");b--;I+="0");return m.s<0&&f?"-"+I:I}function N(m,b){for(var w,A,f=1,C=new v(m[0]);f<m.length;f++)A=new v(m[f]),(!A.s||(w=si(C,A))===b||w===0&&C.s===b)&&(C=A);return C}function U(m,b,w){for(var A=1,f=b.length;!b[--f];b.pop());for(f=b[0];f>=10;f/=10,A++);return(w=A+w*He-1)>d?m.c=m.e=null:w<l?m.c=[m.e=0]:(m.e=w,m.c=b),m}r=(function(){var m=/^(-?)0([xbo])(?=\w[\w.]*$)/i,b=/^([^.]+)\.$/,w=/^\.([^.]+)$/,A=/^-?(Infinity|NaN)$/,f=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(C,E,x,I){var P,B=x?E:E.replace(f,"");if(A.test(B))C.s=isNaN(B)?null:B<0?-1:1;else{if(!x&&(B=B.replace(m,function(_,k,R){return P=(R=R.toLowerCase())=="x"?16:R=="b"?2:8,!I||I==P?k:_}),I&&(P=I,B=B.replace(b,"$1").replace(w,"0.$1")),E!=B))return new v(B,P);if(v.DEBUG)throw Error(Hn+"Not a"+(I?" base "+I:"")+" number: "+E);C.s=null}C.c=C.e=null}})();function L(m,b,w,A){var f,C,E,x,I,P,B,_=m.c,k=km;if(_){e:{for(f=1,x=_[0];x>=10;x/=10,f++);if(C=b-f,C<0)C+=He,E=b,I=_[P=0],B=dr(I/k[f-E-1]%10);else if(P=wm((C+1)/He),P>=_.length)if(A){for(;_.length<=P;_.push(0));I=B=0,f=1,C%=He,E=C-He+1}else break e;else{for(I=x=_[P],f=1;x>=10;x/=10,f++);C%=He,E=C-He+f,B=E<0?0:dr(I/k[f-E-1]%10)}if(A=A||b<0||_[P+1]!=null||(E<0?I:I%k[f-E-1]),A=w<4?(B||A)&&(w==0||w==(m.s<0?3:2)):B>5||B==5&&(w==4||A||w==6&&(C>0?E>0?I/k[f-E]:0:_[P-1])%10&1||w==(m.s<0?8:7)),b<1||!_[0])return _.length=0,A?(b-=m.e+1,_[0]=k[(He-b%He)%He],m.e=-b||0):_[0]=m.e=0,m;if(C==0?(_.length=P,x=1,P--):(_.length=P+1,x=k[He-C],_[P]=E>0?dr(I/k[f-E]%k[E])*x:0),A)for(;;)if(P==0){for(C=1,E=_[0];E>=10;E/=10,C++);for(E=_[0]+=x,x=1;E>=10;E/=10,x++);C!=x&&(m.e++,_[0]==Pr&&(_[0]=1));break}else{if(_[P]+=x,_[P]!=Pr)break;_[P--]=0,x=1}for(C=_.length;_[--C]===0;_.pop());}m.e>d?m.c=m.e=null:m.e<l&&(m.c=[m.e=0])}return m}function z(m){var b,w=m.e;return w===null?m.toString():(b=pr(m.c),b=w<=u||w>=c?pc(b,w):uo(b,w,"0"),m.s<0?"-"+b:b)}return o.absoluteValue=o.abs=function(){var m=new v(this);return m.s<0&&(m.s=1),m},o.comparedTo=function(m,b){return si(this,new v(m,b))},o.decimalPlaces=o.dp=function(m,b){var w,A,f,C=this;if(m!=null)return Ot(m,0,cn),b==null?b=a:Ot(b,0,8),L(new v(C),m+C.e+1,b);if(!(w=C.c))return null;if(A=((f=w.length-1)-gr(this.e/He))*He,f=w[f])for(;f%10==0;f/=10,A--);return A<0&&(A=0),A},o.dividedBy=o.div=function(m,b){return t(this,new v(m,b),s,a)},o.dividedToIntegerBy=o.idiv=function(m,b){return t(this,new v(m,b),0,1)},o.exponentiatedBy=o.pow=function(m,b){var w,A,f,C,E,x,I,P,B,_=this;if(m=new v(m),m.c&&!m.isInteger())throw Error(Hn+"Exponent not an integer: "+z(m));if(b!=null&&(b=new v(b)),x=m.e>14,!_.c||!_.c[0]||_.c[0]==1&&!_.e&&_.c.length==1||!m.c||!m.c[0])return B=new v(Math.pow(+z(_),x?m.s*(2-uc(m)):+z(m))),b?B.mod(b):B;if(I=m.s<0,b){if(b.c?!b.c[0]:!b.s)return new v(NaN);A=!I&&_.isInteger()&&b.isInteger(),A&&(_=_.mod(b))}else{if(m.e>9&&(_.e>0||_.e<-1||(_.e==0?_.c[0]>1||x&&_.c[1]>=24e7:_.c[0]<8e13||x&&_.c[0]<=9999975e7)))return C=_.s<0&&uc(m)?-0:0,_.e>-1&&(C=1/C),new v(I?1/C:C);h&&(C=wm(h/He+2))}for(x?(w=new v(.5),I&&(m.s=1),P=uc(m)):(f=Math.abs(+z(m)),P=f%2),B=new v(i);;){if(P){if(B=B.times(_),!B.c)break;C?B.c.length>C&&(B.c.length=C):A&&(B=B.mod(b))}if(f){if(f=dr(f/2),f===0)break;P=f%2}else if(m=m.times(w),L(m,m.e+1,1),m.e>14)P=uc(m);else{if(f=+z(m),f===0)break;P=f%2}_=_.times(_),C?_.c&&_.c.length>C&&(_.c.length=C):A&&(_=_.mod(b))}return A?B:(I&&(B=i.div(B)),b?B.mod(b):C?L(B,h,a,E):B)},o.integerValue=function(m){var b=new v(this);return m==null?m=a:Ot(m,0,8),L(b,b.e+1,m)},o.isEqualTo=o.eq=function(m,b){return si(this,new v(m,b))===0},o.isFinite=function(){return!!this.c},o.isGreaterThan=o.gt=function(m,b){return si(this,new v(m,b))>0},o.isGreaterThanOrEqualTo=o.gte=function(m,b){return(b=si(this,new v(m,b)))===1||b===0},o.isInteger=function(){return!!this.c&&gr(this.e/He)>this.c.length-2},o.isLessThan=o.lt=function(m,b){return si(this,new v(m,b))<0},o.isLessThanOrEqualTo=o.lte=function(m,b){return(b=si(this,new v(m,b)))===-1||b===0},o.isNaN=function(){return!this.s},o.isNegative=function(){return this.s<0},o.isPositive=function(){return this.s>0},o.isZero=function(){return!!this.c&&this.c[0]==0},o.minus=function(m,b){var w,A,f,C,E=this,x=E.s;if(m=new v(m,b),b=m.s,!x||!b)return new v(NaN);if(x!=b)return m.s=-b,E.plus(m);var I=E.e/He,P=m.e/He,B=E.c,_=m.c;if(!I||!P){if(!B||!_)return B?(m.s=-b,m):new v(_?E:NaN);if(!B[0]||!_[0])return _[0]?(m.s=-b,m):new v(B[0]?E:a==3?-0:0)}if(I=gr(I),P=gr(P),B=B.slice(),x=I-P){for((C=x<0)?(x=-x,f=B):(P=I,f=_),f.reverse(),b=x;b--;f.push(0));f.reverse()}else for(A=(C=(x=B.length)<(b=_.length))?x:b,x=b=0;b<A;b++)if(B[b]!=_[b]){C=B[b]<_[b];break}if(C&&(f=B,B=_,_=f,m.s=-m.s),b=(A=_.length)-(w=B.length),b>0)for(;b--;B[w++]=0);for(b=Pr-1;A>x;){if(B[--A]<_[A]){for(w=A;w&&!B[--w];B[w]=b);--B[w],B[A]+=Pr}B[A]-=_[A]}for(;B[0]==0;B.splice(0,1),--P);return B[0]?U(m,B,P):(m.s=a==3?-1:1,m.c=[m.e=0],m)},o.modulo=o.mod=function(m,b){var w,A,f=this;return m=new v(m,b),!f.c||!m.s||m.c&&!m.c[0]?new v(NaN):!m.c||f.c&&!f.c[0]?new v(f):(p==9?(A=m.s,m.s=1,w=t(f,m,0,3),m.s=A,w.s*=A):w=t(f,m,0,p),m=f.minus(w.times(m)),!m.c[0]&&p==1&&(m.s=f.s),m)},o.multipliedBy=o.times=function(m,b){var w,A,f,C,E,x,I,P,B,_,k,R,H,M,se,X=this,re=X.c,me=(m=new v(m,b)).c;if(!re||!me||!re[0]||!me[0])return!X.s||!m.s||re&&!re[0]&&!me||me&&!me[0]&&!re?m.c=m.e=m.s=null:(m.s*=X.s,!re||!me?m.c=m.e=null:(m.c=[0],m.e=0)),m;for(A=gr(X.e/He)+gr(m.e/He),m.s*=X.s,I=re.length,_=me.length,I<_&&(H=re,re=me,me=H,f=I,I=_,_=f),f=I+_,H=[];f--;H.push(0));for(M=Pr,se=Bo,f=_;--f>=0;){for(w=0,k=me[f]%se,R=me[f]/se|0,E=I,C=f+E;C>f;)P=re[--E]%se,B=re[E]/se|0,x=R*P+B*k,P=k*P+x%se*se+H[C]+w,w=(P/M|0)+(x/se|0)+R*B,H[C--]=P%M;H[C]=w}return w?++A:H.splice(0,1),U(m,H,A)},o.negated=function(){var m=new v(this);return m.s=-m.s||null,m},o.plus=function(m,b){var w,A=this,f=A.s;if(m=new v(m,b),b=m.s,!f||!b)return new v(NaN);if(f!=b)return m.s=-b,A.minus(m);var C=A.e/He,E=m.e/He,x=A.c,I=m.c;if(!C||!E){if(!x||!I)return new v(f/0);if(!x[0]||!I[0])return I[0]?m:new v(x[0]?A:f*0)}if(C=gr(C),E=gr(E),x=x.slice(),f=C-E){for(f>0?(E=C,w=I):(f=-f,w=x),w.reverse();f--;w.push(0));w.reverse()}for(f=x.length,b=I.length,f-b<0&&(w=I,I=x,x=w,b=f),f=0;b;)f=(x[--b]=x[b]+I[b]+f)/Pr|0,x[b]=Pr===x[b]?0:x[b]%Pr;return f&&(x=[f].concat(x),++E),U(m,x,E)},o.precision=o.sd=function(m,b){var w,A,f,C=this;if(m!=null&&m!==!!m)return Ot(m,1,cn),b==null?b=a:Ot(b,0,8),L(new v(C),m,b);if(!(w=C.c))return null;if(f=w.length-1,A=f*He+1,f=w[f]){for(;f%10==0;f/=10,A--);for(f=w[0];f>=10;f/=10,A++);}return m&&C.e+1>A&&(A=C.e+1),A},o.shiftedBy=function(m){return Ot(m,-vm,vm),this.times("1e"+m)},o.squareRoot=o.sqrt=function(){var m,b,w,A,f,C=this,E=C.c,x=C.s,I=C.e,P=s+4,B=new v("0.5");if(x!==1||!E||!E[0])return new v(!x||x<0&&(!E||E[0])?NaN:E?C:1/0);if(x=Math.sqrt(+z(C)),x==0||x==1/0?(b=pr(E),(b.length+I)%2==0&&(b+="0"),x=Math.sqrt(+b),I=gr((I+1)/2)-(I<0||I%2),x==1/0?b="5e"+I:(b=x.toExponential(),b=b.slice(0,b.indexOf("e")+1)+I),w=new v(b)):w=new v(x+""),w.c[0]){for(I=w.e,x=I+P,x<3&&(x=0);;)if(f=w,w=B.times(f.plus(t(C,f,P,1))),pr(f.c).slice(0,x)===(b=pr(w.c)).slice(0,x))if(w.e<I&&--x,b=b.slice(x-3,x+1),b=="9999"||!A&&b=="4999"){if(!A&&(L(f,f.e+s+2,0),f.times(f).eq(C))){w=f;break}P+=4,x+=4,A=1}else{(!+b||!+b.slice(1)&&b.charAt(0)=="5")&&(L(w,w.e+s+2,1),m=!w.times(w).eq(C));break}}return L(w,w.e+s+1,a,m)},o.toExponential=function(m,b){return m!=null&&(Ot(m,0,cn),m++),D(this,m,b,1)},o.toFixed=function(m,b){return m!=null&&(Ot(m,0,cn),m=m+this.e+1),D(this,m,b)},o.toFormat=function(m,b,w){var A,f=this;if(w==null)m!=null&&b&&typeof b=="object"?(w=b,b=null):m&&typeof m=="object"?(w=m,m=b=null):w=S;else if(typeof w!="object")throw Error(Hn+"Argument not an object: "+w);if(A=f.toFixed(m,b),f.c){var C,E=A.split("."),x=+w.groupSize,I=+w.secondaryGroupSize,P=w.groupSeparator||"",B=E[0],_=E[1],k=f.s<0,R=k?B.slice(1):B,H=R.length;if(I&&(C=x,x=I,I=C,H-=C),x>0&&H>0){for(C=H%x||x,B=R.substr(0,C);C<H;C+=x)B+=P+R.substr(C,x);I>0&&(B+=P+R.slice(C)),k&&(B="-"+B)}A=_?B+(w.decimalSeparator||"")+((I=+w.fractionGroupSize)?_.replace(new RegExp("\\d{"+I+"}\\B","g"),"$&"+(w.fractionGroupSeparator||"")):_):B}return(w.prefix||"")+A+(w.suffix||"")},o.toFraction=function(m){var b,w,A,f,C,E,x,I,P,B,_,k,R=this,H=R.c;if(m!=null&&(x=new v(m),!x.isInteger()&&(x.c||x.s!==1)||x.lt(i)))throw Error(Hn+"Argument "+(x.isInteger()?"out of range: ":"not an integer: ")+z(x));if(!H)return new v(R);for(b=new v(i),P=w=new v(i),A=I=new v(i),k=pr(H),C=b.e=k.length-R.e-1,b.c[0]=km[(E=C%He)<0?He+E:E],m=!m||x.comparedTo(b)>0?C>0?b:P:x,E=d,d=1/0,x=new v(k),I.c[0]=0;B=t(x,b,0,1),f=w.plus(B.times(A)),f.comparedTo(m)!=1;)w=A,A=f,P=I.plus(B.times(f=P)),I=f,b=x.minus(B.times(f=b)),x=f;return f=t(m.minus(w),A,0,1),I=I.plus(f.times(P)),w=w.plus(f.times(A)),I.s=P.s=R.s,C=C*2,_=t(P,A,C,a).minus(R).abs().comparedTo(t(I,w,C,a).minus(R).abs())<1?[P,A]:[I,w],d=E,_},o.toNumber=function(){return+z(this)},o.toPrecision=function(m,b){return m!=null&&Ot(m,1,cn),D(this,m,b,2)},o.toString=function(m){var b,w=this,A=w.s,f=w.e;return f===null?A?(b="Infinity",A<0&&(b="-"+b)):b="NaN":(m==null?b=f<=u||f>=c?pc(pr(w.c),f):uo(pr(w.c),f,"0"):m===10&&F?(w=L(new v(w),s+f+1,a),b=uo(pr(w.c),w.e,"0")):(Ot(m,2,T.length,"Base"),b=n(uo(pr(w.c),f,"0"),10,m,A,!0)),A<0&&w.c[0]&&(b="-"+b)),b},o.valueOf=o.toJSON=function(){return z(this)},o._isBigNumber=!0,o[Symbol.toStringTag]="BigNumber",o[Symbol.for("nodejs.util.inspect.custom")]=o.valueOf,e!=null&&v.set(e),v}function gr(e){var t=e|0;return e>0||e===t?t:t-1}function pr(e){for(var t,n,r=1,o=e.length,i=e[0]+"";r<o;){for(t=e[r++]+"",n=He-t.length;n--;t="0"+t);i+=t}for(o=i.length;i.charCodeAt(--o)===48;);return i.slice(0,o+1||1)}function si(e,t){var n,r,o=e.c,i=t.c,s=e.s,a=t.s,u=e.e,c=t.e;if(!s||!a)return null;if(n=o&&!o[0],r=i&&!i[0],n||r)return n?r?0:-a:s;if(s!=a)return s;if(n=s<0,r=u==c,!o||!i)return r?0:!o^n?1:-1;if(!r)return u>c^n?1:-1;for(a=(u=o.length)<(c=i.length)?u:c,s=0;s<a;s++)if(o[s]!=i[s])return o[s]>i[s]^n?1:-1;return u==c?0:u>c^n?1:-1}function Ot(e,t,n,r){if(e<t||e>n||e!==dr(e))throw Error(Hn+(r||"Argument")+(typeof e=="number"?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function uc(e){var t=e.c.length-1;return gr(e.e/He)==t&&e.c[t]%2!=0}function pc(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function uo(e,t,n){var r,o;if(t<0){for(o=n+".";++t;o+=n);e=o+e}else if(r=e.length,++t>r){for(o=n,t-=r;--t;o+=n);e+=o}else t<r&&(e=e.slice(0,t)+"."+e.slice(t));return e}var eN=Vv(),Gv=eN;var tN=24,ia=32,nN=()=>typeof globalThis<"u"&&globalThis.crypto&&typeof globalThis.crypto.getRandomValues=="function"?()=>{let e=new Uint32Array(1);return globalThis.crypto.getRandomValues(e),e[0]/4294967296}:Math.random,Tm=nN(),Cm=(e=4,t=Tm)=>{let n="";for(;n.length<e;)n=n+Math.floor(t()*36).toString(36);return n};function rN(e){let t=new Gv(0);for(let n of e.values())t=t.multipliedBy(256).plus(n);return t}var Yv=(e="")=>{let t=new TextEncoder;return rN(Hv(t.encode(e))).toString(36).slice(1)},qv=Array.from({length:26},(e,t)=>String.fromCharCode(t+97)),oN=e=>qv[Math.floor(e()*qv.length)],iN=({globalObj:e=typeof global<"u"?global:typeof window<"u"?window:{},random:t=Tm}={})=>{let n=Object.keys(e).toString(),r=n.length?n+Cm(ia,t):Cm(ia,t);return Yv(r).substring(0,ia)},sN=e=>()=>e++,aN=476782367,Kv=({random:e=Tm,counter:t=sN(Math.floor(e()*aN)),length:n=tN,fingerprint:r=iN({random:e})}={})=>{if(n>ia)throw new Error(`Length must be between 2 and ${ia}. Received: ${n}`);return function(){let i=oN(e),s=Date.now().toString(36),a=t().toString(36),u=Cm(n,e),c=`${s+u+a+r}`;return`${i+Yv(c).substring(1,n)}`}},Do=lN(Kv);function lN(e){let t;return()=>(t||(t=e()),t())}var pN=tl(Jv());ln();ze();var dc=/\[([^\]]+)\]\s*\[([^\]]+)\]\s*\[([^\]]+)\]\s*-\s*(.+)/g;function dN(e){return e.replace(/\*\*/g,"").replace(/\*/g,"").replace(/__/g,"").replace(/_/g," ").trim()}function Im(e,t){let n=[],r=e.split(`
|
|
14
|
+
`,G1="/",q1="*",di="",D3="comment",R3="declaration";function z3(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function o(h){var S=h.match(I3);S&&(n+=S.length);var T=h.lastIndexOf(B3);r=~T?h.length-T:r+h.length}function i(){var h={line:n,column:r};return function(S){return S.position=new s(h),c(),S}}function s(h){this.start=h,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function a(h){var S=new Error(t.source+":"+n+":"+r+": "+h);if(S.reason=h,S.filename=t.source,S.line=n,S.column=r,S.source=e,!t.silent)throw S}function u(h){var S=h.exec(e);if(S){var T=S[0];return o(T),e=e.slice(T.length),S}}function c(){u(F3)}function l(h){var S;for(h=h||[];S=d();)S!==!1&&h.push(S);return h}function d(){var h=i();if(!(G1!=e.charAt(0)||q1!=e.charAt(1))){for(var S=2;di!=e.charAt(S)&&(q1!=e.charAt(S)||G1!=e.charAt(S+1));)++S;if(S+=2,di===e.charAt(S-1))return a("End of comment missing");var T=e.slice(2,S-2);return r+=2,o(T),e=e.slice(S),r+=2,h({type:D3,comment:T})}}function g(){var h=i(),S=u(E3);if(S){if(d(),!u(A3))return a("property missing ':'");var T=u(P3),F=h({type:R3,property:Y1(S[0].replace(V1,di)),value:T?Y1(T[0].replace(V1,di)):di});return u(L3),F}}function p(){var h=[];l(h);for(var S;S=g();)S!==!1&&(h.push(S),l(h));return h}return c(),p()}function Y1(e){return e?e.replace(M3,di):di}K1.exports=z3});var Q1=ir(Ta=>{"use strict";var N3=Ta&&Ta.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ta,"__esModule",{value:!0});Ta.default=_3;var O3=N3(X1());function _3(e,t){let n=null;if(!e||typeof e!="string")return n;let r=(0,O3.default)(e),o=typeof t=="function";return r.forEach(i=>{if(i.type!=="declaration")return;let{property:s,value:a}=i;o?t(s,a,i):a&&(n=n||{},n[s]=a)}),n}});var Z1=ir($c=>{"use strict";Object.defineProperty($c,"__esModule",{value:!0});$c.camelCase=void 0;var $3=/^--[a-zA-Z0-9_-]+$/,U3=/-([a-z])/g,j3=/^[^-]+$/,H3=/^-(webkit|moz|ms|o|khtml)-/,W3=/^-(ms)-/,V3=function(e){return!e||j3.test(e)||$3.test(e)},G3=function(e,t){return t.toUpperCase()},J1=function(e,t){return"".concat(t,"-")},q3=function(e,t){return t===void 0&&(t={}),V3(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(W3,J1):e=e.replace(H3,J1),e.replace(U3,G3))};$c.camelCase=q3});var tT=ir((Kh,eT)=>{"use strict";var Y3=Kh&&Kh.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},K3=Y3(Q1()),X3=Z1();function Yh(e,t){var n={};return!e||typeof e!="string"||(0,K3.default)(e,function(r,o){r&&o&&(n[(0,X3.camelCase)(r,t)]=o)}),n}Yh.default=Yh;eT.exports=Yh});var EI=ir((vge,FI)=>{"use strict";var cu=Object.prototype.hasOwnProperty,II=Object.prototype.toString,SI=Object.defineProperty,wI=Object.getOwnPropertyDescriptor,vI=function(t){return typeof Array.isArray=="function"?Array.isArray(t):II.call(t)==="[object Array]"},kI=function(t){if(!t||II.call(t)!=="[object Object]")return!1;var n=cu.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&cu.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var o;for(o in t);return typeof o>"u"||cu.call(t,o)},CI=function(t,n){SI&&n.name==="__proto__"?SI(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},TI=function(t,n){if(n==="__proto__")if(cu.call(t,n)){if(wI)return wI(t,n).value}else return;return t[n]};FI.exports=function e(){var t,n,r,o,i,s,a=arguments[0],u=1,c=arguments.length,l=!1;for(typeof a=="boolean"&&(l=a,a=arguments[1]||{},u=2),(a==null||typeof a!="object"&&typeof a!="function")&&(a={});u<c;++u)if(t=arguments[u],t!=null)for(n in t)r=TI(a,n),o=TI(t,n),a!==o&&(l&&o&&(kI(o)||(i=vI(o)))?(i?(i=!1,s=r&&vI(r)?r:[]):s=r&&kI(r)?r:{},CI(a,{name:n,newValue:e(l,s,o)})):typeof o<"u"&&CI(a,{name:n,newValue:o}));return a}});import Ja from"react";import{addons as Cu,types as by,experimental_getStatusStore as Sy}from"storybook/manager-api";import{AddonPanel as I9}from"storybook/internal/components";import zt,{useState as VV,useEffect as GV}from"react";import{styled as yr}from"storybook/theming";import Ay from"react";import{styled as Dt}from"storybook/theming";var le="#ea580c",Eu="#c2410c",nl="#ff6b35";var ky=Dt.div(({theme:e})=>({fontFamily:e.typography.fonts.base,height:"100%",display:"flex",flexDirection:"column",backgroundColor:e.background.content,color:e.color.defaultText})),Cy=Dt.div({flex:1,overflow:"auto",padding:"6px 20px 20px"}),vo=Dt.div({marginBottom:"20px"}),ko=Dt.label(({theme:e})=>({display:"block",marginBottom:`${e.layoutMargin*.6}px`,fontSize:e.typography.size.s2,fontFamily:e.typography.fonts.base,fontWeight:e.typography.weight.bold,color:e.color.defaultText})),ys=Dt.input(({theme:e})=>({width:"100%",padding:`${e.layoutMargin*.8}px ${e.layoutMargin}px`,fontSize:e.typography.size.s2,fontFamily:e.typography.fonts.base,border:`1px solid ${e.appBorderColor}`,borderRadius:e.appBorderRadius,backgroundColor:e.input.background,color:e.color.defaultText,"&:focus":{outline:"none",borderColor:e.color.secondary,boxShadow:`0 0 0 2px ${e.color.secondary}20`}})),Sn=Dt.select(({theme:e})=>({width:"100%",padding:`${e.layoutMargin*.8}px 32px ${e.layoutMargin*.8}px ${e.layoutMargin}px`,fontSize:e.typography.size.s2,fontFamily:e.typography.fonts.base,border:`1px solid ${e.appBorderColor}`,borderRadius:e.appBorderRadius,backgroundColor:e.input.background,color:e.color.defaultText,cursor:"pointer",appearance:"none",backgroundImage:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E")`,backgroundRepeat:"no-repeat",backgroundPosition:"right 10px center",backgroundSize:"12px",transition:"border-color 0.15s, box-shadow 0.15s","&:focus":{outline:"none",borderColor:e.color.secondary,boxShadow:`0 0 0 2px ${e.color.secondary}20`},"&:hover":{borderColor:e.color.mediumdark},"&:disabled":{opacity:.6,cursor:"not-allowed"}})),Ty=Dt(Sn)(({theme:e})=>({width:"auto",padding:`${e.layoutMargin*.6}px 28px ${e.layoutMargin*.6}px ${e.layoutMargin}px`,fontSize:e.typography.size.s1})),rl=e=>({padding:`${e.layoutMargin*.8}px ${e.layoutMargin*1.6}px`,fontSize:e.typography.size.s2,fontFamily:e.typography.fonts.base,fontWeight:e.typography.weight.bold,border:"none",borderRadius:e.appBorderRadius,cursor:"pointer",transition:"all 0.15s","&:disabled":{opacity:.5,cursor:"not-allowed"}}),An=Dt.button(({theme:e})=>({...rl(e),backgroundColor:e.color.secondary,color:e.color.inverseText,"&:hover:not(:disabled)":{opacity:.9}})),on=Dt.button(({theme:e})=>({...rl(e),backgroundColor:le,color:e.color.inverseText,boxShadow:`0 2px 4px ${le}4d`,"&:hover:not(:disabled)":{backgroundColor:Eu,transform:"translateY(-1px)",boxShadow:`0 4px 8px ${le}66`}})),Or=Dt.button(({theme:e})=>({...rl(e),backgroundColor:"transparent",border:`1px solid ${e.appBorderColor}`,color:e.color.defaultText,"&:hover:not(:disabled)":{backgroundColor:e.background.hoverable}})),Iy=Dt.button(({theme:e})=>({...rl(e),backgroundColor:e.color.negative,color:e.color.inverseText,"&:hover:not(:disabled)":{opacity:.9}})),Pn=Dt.button(({theme:e})=>({display:"inline-flex",alignItems:"center",justifyContent:"center",padding:`${e.layoutMargin*.4}px`,fontSize:e.typography.size.s2,color:e.color.mediumdark,backgroundColor:"transparent",border:"none",borderRadius:e.appBorderRadius,cursor:"pointer",transition:"all 0.15s","&:hover":{color:e.color.defaultText,backgroundColor:e.background.hoverable},"&:disabled":{opacity:.5,cursor:"not-allowed"}})),Au=Dt.button(({theme:e})=>({padding:0,fontSize:e.typography.size.s1,fontFamily:e.typography.fonts.base,color:e.color.secondary,backgroundColor:"transparent",border:"none",cursor:"pointer",textDecoration:"none","&:hover":{textDecoration:"underline"},"&:disabled":{opacity:.5,cursor:"not-allowed"}})),Co=Dt.button(({theme:e,active:t})=>({padding:`${e.layoutMargin*.6}px ${e.layoutMargin*1.2}px`,fontSize:e.typography.size.s2,fontFamily:e.typography.fonts.base,fontWeight:t?e.typography.weight.bold:400,color:t?e.color.secondary:e.color.mediumdark,backgroundColor:"transparent",border:"none",borderBottom:t?`2px solid ${e.color.secondary}`:"2px solid transparent",cursor:"pointer",transition:"all 0.15s","&:hover":{color:t?e.color.secondary:e.color.defaultText}})),To=Dt(ys)(({theme:e})=>({paddingLeft:`${e.layoutMargin*3}px`,backgroundImage:`url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E")`,backgroundRepeat:"no-repeat",backgroundPosition:`${e.layoutMargin}px center`,backgroundSize:"14px"})),D9=Dt.div(({theme:e})=>({padding:`${e.layoutMargin*1.6}px`,borderRadius:e.appBorderRadius,border:`1px solid ${e.appBorderColor}`,backgroundColor:e.background.content})),Fy=Dt.h2(({theme:e})=>({margin:`0 0 ${e.layoutMargin*1.6}px`,fontSize:e.typography.size.s3,fontFamily:e.typography.fonts.base,fontWeight:e.typography.weight.bold,color:e.color.defaultText})),R9=Dt.h3(({theme:e})=>({margin:`0 0 ${e.layoutMargin*1.2}px`,fontSize:e.typography.size.s2,fontFamily:e.typography.fonts.base,fontWeight:e.typography.weight.bold,color:e.color.defaultText})),bs=Dt.p(({theme:e})=>({margin:`0 0 ${e.layoutMargin*.8}px`,fontSize:e.typography.size.s2,fontFamily:e.typography.fonts.base,color:e.color.defaultText,lineHeight:1.5})),z9=Dt.div(({theme:e,width:t="100%",height:n="40px"})=>({width:t,height:n,backgroundColor:e.background.hoverable,borderRadius:e.appBorderRadius,position:"relative",overflow:"hidden","&::after":{content:'""',position:"absolute",top:0,left:0,width:"100%",height:"100%",background:`linear-gradient(90deg, transparent, ${e.color.mediumlight}33, transparent)`,animation:"shimmer 1.5s infinite"},"@keyframes shimmer":{"0%":{transform:"translateX(-100%)"},"100%":{transform:"translateX(100%)"}}})),Ey=Dt.span(({theme:e,variant:t="default"})=>{let n={default:{bg:e.background.hoverable,color:e.color.defaultText},success:{bg:`${e.color.positive}40`,color:e.color.positive},warning:{bg:`${e.color.warning}40`,color:e.color.warning},error:{bg:`${e.color.negative}40`,color:e.color.negative}};return{display:"inline-block",padding:"2px 8px",fontSize:e.typography.size.s1,fontWeight:e.typography.weight.bold,borderRadius:"3px",backgroundColor:n[t].bg,color:n[t].color}}),N9=Dt.div(({theme:e})=>({padding:"40px 20px",textAlign:"center",color:e.color.mediumdark})),O9=Dt.div(({theme:e})=>({fontSize:e.typography.size.s3,fontWeight:e.typography.weight.bold,marginBottom:`${e.layoutMargin*.8}px`,color:e.color.defaultText})),_9=Dt.div(({theme:e})=>({fontSize:e.typography.size.s2,color:e.color.mediumdark}));var Pu=({header:e,children:t,footer:n})=>Ay.createElement(ky,null,e,Ay.createElement(Cy,null,t),n);import TE from"react";import{styled as IE}from"storybook/theming";var FE=IE.div(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"flex-end",padding:"6px 12px",borderBottom:`1px solid ${e.appBorderColor}`,position:"sticky",top:0,zIndex:100,backgroundColor:e.background.content})),Lu=({toolbar:e})=>TE.createElement(FE,null,e);import K9 from"react";import{styled as ol}from"storybook/theming";var J9=ol.div(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",padding:"6px 12px",borderBottom:`1px solid ${e.appBorderColor}`,position:"sticky",top:0,zIndex:100,backgroundColor:e.background.content})),Z9=ol.div({display:"flex",flex:1}),eG=ol(Co)(({theme:e,disabled:t})=>({padding:"6px 12px",...t?{color:e.color.mediumlight,cursor:"not-allowed",opacity:.5,"&:hover":{}}:{}})),tG=ol.div({display:"flex",gap:"8px",alignItems:"center"});import en,{useState as rm,useCallback as av,useEffect as lv}from"react";import{styled as lo}from"storybook/theming";import ve,{useEffect as Xw}from"react";import{styled as lt}from"storybook/theming";ke();Ne();ze();ct();var Qw=lt.div({position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:1e4}),Jw=lt.div(({theme:e})=>({position:"absolute",top:"100%",right:0,marginTop:"8px",backgroundColor:e.background.content,borderRadius:"12px",width:"360px",maxWidth:"90vw",boxShadow:"0 10px 40px rgba(0, 0, 0, 0.3)",overflow:"hidden",zIndex:10001})),xR=lt.div({display:"flex",alignItems:"center",gap:"12px",padding:"16px 16px 12px"}),yR=lt.div({width:"36px",height:"36px",borderRadius:"50%",backgroundColor:le,display:"flex",alignItems:"center",justifyContent:"center",color:"#fff",fontSize:"14px",fontWeight:700,flexShrink:0}),bR=lt.div({display:"flex",flexDirection:"column",gap:"4px"}),SR=lt.div(({theme:e})=>({fontSize:"15px",fontWeight:600,color:e.color.defaultText,lineHeight:1.2})),wR=lt.span({display:"inline-block",alignSelf:"flex-start",padding:"2px 10px",borderRadius:"6px",fontSize:"11px",fontWeight:600,color:"#7c3aed",backgroundColor:"rgba(124, 58, 237, 0.1)",letterSpacing:"0.3px"}),vR=lt.div(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 16px 8px",fontSize:"14px",color:e.color.defaultText})),kR=lt.span(({theme:e})=>({color:e.textMutedColor,fontSize:"13px"})),CR=lt.span(({theme:e})=>({color:e.color.defaultText,fontSize:"15px",fontWeight:600})),TR=lt.div(({theme:e})=>({height:"8px",borderRadius:"4px",backgroundColor:e.base==="dark"?"rgba(255,255,255,0.1)":"rgba(0,0,0,0.08)",margin:"0 16px 8px",overflow:"hidden"})),IR=lt.div(({percent:e})=>({height:"100%",width:`${Math.min(100,Math.max(0,e))}%`,background:`linear-gradient(90deg, #f59e0b 0%, ${le} 100%)`,transition:"width 0.3s ease"})),FR=lt.div(({theme:e})=>({padding:"0 16px 14px",fontSize:"12px",color:e.textMutedColor})),ER=lt.div(({theme:e})=>({height:"1px",backgroundColor:e.appBorderColor})),AR=lt.button({width:"100%",padding:"14px 16px",background:"transparent",border:"none",color:le,fontSize:"14px",fontWeight:500,textAlign:"left",cursor:"pointer",display:"flex",alignItems:"center",gap:"6px","&:hover":{backgroundColor:"rgba(0, 0, 0, 0.03)"}}),Zw=lt.button(({theme:e})=>({position:"absolute",top:"12px",right:"12px",width:"24px",height:"24px",borderRadius:"4px",border:"none",background:"transparent",color:e.textMutedColor,cursor:"pointer",fontSize:"16px",display:"flex",alignItems:"center",justifyContent:"center","&:hover":{backgroundColor:e.background.hoverable}})),PR=lt.div(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px",borderBottom:`1px solid ${e.appBorderColor}`})),LR=lt.div(({theme:e})=>({display:"flex",alignItems:"center",gap:"10px",color:e.color.defaultText,fontSize:"14px",fontWeight:500})),MR=lt.div(({theme:e})=>({width:"32px",height:"32px",borderRadius:"50%",backgroundColor:le,display:"flex",alignItems:"center",justifyContent:"center",color:e.color.inverseText,fontSize:"14px",fontWeight:600})),BR=lt.div({display:"flex",gap:"8px"}),ev=lt(Pn)({fontSize:"18px"}),DR=lt.div({padding:"20px 16px"}),RR=lt.div(({theme:e})=>({padding:"16px",borderRadius:"8px",background:"linear-gradient(135deg, #10B981 0%, #3B82F6 100%)",marginBottom:"16px",color:"#fff"})),zR=lt.div({fontSize:"12px",fontWeight:500,opacity:.9,marginBottom:"4px"}),NR=lt.div({fontSize:"28px",fontWeight:700}),OR=lt.div({fontSize:"11px",opacity:.8,marginTop:"4px"}),_R=lt.div(({theme:e})=>({padding:"16px",borderRadius:"8px",border:`1px solid ${e.appBorderColor}`,marginBottom:"16px"})),$R=lt.div({display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"8px"}),UR=lt.div({display:"flex",alignItems:"center",gap:"8px"}),jR=lt.span(({theme:e})=>({fontSize:"14px",fontWeight:600,color:e.color.defaultText})),HR=lt.span(({theme:e})=>({fontSize:"10px",fontWeight:600,padding:"2px 6px",borderRadius:"4px",backgroundColor:le,color:e.color.inverseText})),WR=lt.button(({theme:e})=>({background:"none",border:"none",color:le,fontSize:"12px",cursor:"pointer","&:hover":{textDecoration:"underline"}})),VR=lt.div(({theme:e})=>({fontSize:"12px",color:e.color.mediumdark})),GR=lt.button(({theme:e,variant:t="primary"})=>({width:"100%",padding:"12px",borderRadius:"6px",fontSize:"14px",fontWeight:600,cursor:"pointer",border:"none",marginBottom:"12px",backgroundColor:t==="primary"?le:e.background.hoverable,color:t==="primary"?e.color.inverseText:e.color.defaultText,"&:hover":{opacity:.9}})),qR=30*1e3,tv=({onClose:e})=>{let{sessionToken:t,resetAuth:n,usageData:r,usageLastFetched:o,setUsageData:i}=we(),{featureFlags:s}=ce(),a=s.showCosts,u=r,c=!r&&t,l=async(h=!1)=>{if(!t)return;let S=o&&Date.now()-o<qR;if(!(!h&&S&&r))try{let T=K(),F=await oe(`${T}/api/addon/account`,{headers:{Authorization:`Bearer ${t}`}});if(F.ok){let v=await F.json();i(v)}}catch(T){y.error("Failed to fetch usage:",T)}};Xw(()=>{l()},[t]),Xw(()=>{let h=()=>{document.visibilityState==="visible"&&(y.debug("[TokenUsageModal] Tab visible, refreshing balance..."),l(!0))};return document.addEventListener("visibilitychange",h),()=>document.removeEventListener("visibilitychange",h)},[t]);let d=async()=>{if(t){let h=K();try{await fetch(`${h}/api/addon/auth/sign-out`,{method:"POST",headers:{Authorization:`Bearer ${t}`}})}catch{}}n(),e()},g=()=>{let h=K();window.open(`${h}/pricing`,"_blank")},p=()=>{let h=K();window.open(`${h}/pricing#add-credits`,"_blank")};if(t&&!a&&!c){let h=Math.floor(u?.creditBalance??0),T=Math.max(h,10),F=Math.max(0,T-h),v=T>0?h/T*100:0;return ve.createElement(ve.Fragment,null,ve.createElement(Qw,{onClick:e}),ve.createElement(Jw,{onClick:D=>D.stopPropagation(),style:{width:"320px"}},ve.createElement(xR,null,ve.createElement(yR,null,u?.email?u.email[0].toUpperCase():"U"),ve.createElement(bR,null,ve.createElement(SR,null,"UI Review"),ve.createElement(wR,null,(u?.plan||"BETA").toUpperCase())),ve.createElement("div",{style:{marginLeft:"auto",display:"flex",alignItems:"center",gap:"2px"}},ve.createElement(Zw,{onClick:d,title:"Sign out",style:{position:"static"}},ve.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},ve.createElement("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}),ve.createElement("polyline",{points:"16 17 21 12 16 7"}),ve.createElement("line",{x1:"21",y1:"12",x2:"9",y2:"12"}))),ve.createElement(Zw,{onClick:e,title:"Close",style:{position:"static"}},"\xD7"))),ve.createElement(vR,null,ve.createElement(kR,null,"Credits"),ve.createElement(CR,null,h," left")),ve.createElement(TR,null,ve.createElement(IR,{percent:v})),ve.createElement(FR,null,F," used \xB7 ",h," remaining"),ve.createElement(ER,null),ve.createElement(AR,{onClick:()=>window.open("mailto:hello@uiparity.com?subject=Credits request","_blank")},"Contact us for credits \u2192")))}return ve.createElement(ve.Fragment,null,ve.createElement(Qw,{onClick:e}),ve.createElement(Jw,{onClick:h=>h.stopPropagation()},ve.createElement(PR,null,ve.createElement(LR,null,ve.createElement(MR,null,u?.email?u.email[0].toUpperCase():"U"),ve.createElement("span",null,u?.email||"Loading...")),ve.createElement(BR,null,ve.createElement(ev,{onClick:d,title:"Sign out"},ve.createElement("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},ve.createElement("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}),ve.createElement("polyline",{points:"16 17 21 12 16 7"}),ve.createElement("line",{x1:"21",y1:"12",x2:"9",y2:"12"}))),ve.createElement(ev,{onClick:e,title:"Close"},"\xD7"))),ve.createElement(DR,null,c?ve.createElement("div",{style:{textAlign:"center",padding:"20px"}},"Loading..."):t?ve.createElement(ve.Fragment,null,ve.createElement(RR,null,ve.createElement(zR,null,"Credit Balance"),ve.createElement(NR,null,"$",(u?.creditBalance??0).toFixed(2)),ve.createElement(OR,null,(u?.creditBalance??0)<2?"Low balance - consider topping up":"Pay only for what you use")),ve.createElement(_R,null,ve.createElement($R,null,ve.createElement(UR,null,ve.createElement(jR,null,"Current Plan"),ve.createElement(HR,null,u?.plan||"Free")),ve.createElement(WR,{onClick:g},"View detail >")),ve.createElement(VR,null,"~$0.02-0.05 per review depending on complexity"),ve.createElement(GR,{onClick:p,style:{marginTop:"16px"}},"Add Credits"))):ve.createElement("div",{style:{textAlign:"center",padding:"20px"}},"Please sign in to view usage"))))};ke();import Oi from"react";import{styled as nv}from"storybook/theming";Ne();ke();ct();ze();var YR=nv.div({display:"flex",alignItems:"center",gap:"8px",flexWrap:"wrap"}),KR=nv.span(({theme:e})=>({fontSize:e.typography.size.s1,color:e.color.mediumdark})),XR={admin:{enableFixGeneration:!0,enableFixApply:!0,enableAutoMap:!0,enableReviewBadges:!0,showCosts:!0,enableParallelReview:!0,enableModelSelection:!0},beta:{enableFixGeneration:!0,enableFixApply:!1,enableAutoMap:!0,enableReviewBadges:!1,showCosts:!1,enableParallelReview:!1,enableModelSelection:!1}},rv=()=>{let{userRole:e,roleOverride:t,setRoleOverride:n,setFeatureFlags:r}=ce(),{sessionToken:o}=we();return e!=="admin"?null:Oi.createElement(YR,null,Oi.createElement(KR,null,"View as:"),Oi.createElement(Ty,{value:t??e,onChange:a=>{let u=a.target.value;if(u===e)n(null),o&&oe(`${K()}/api/addon/flags`,{headers:{Authorization:`Bearer ${o}`}}).then(c=>c.json()).then(c=>{let l={enableFixGeneration:!!c.enableFixGeneration,enableFixApply:!!c.enableFixApply,enableAutoMap:!!c.enableAutoMap,enableReviewBadges:!!c.enableReviewBadges,showCosts:!!c.showCosts,enableParallelReview:!!c.enableParallelReview,enableModelSelection:!!c.enableModelSelection};r(l);try{localStorage.setItem("uicopilot_feature_flags",JSON.stringify(l))}catch{}}).catch(c=>y.warn("[RoleSwitcher] Failed to re-fetch flags:",c.message));else{n(u);let c=XR[u];r(c);try{localStorage.setItem("uicopilot_feature_flags",JSON.stringify(c))}catch{}}},style:{width:"auto",minWidth:"100px"}},Oi.createElement("option",{value:"admin"},"Admin"),Oi.createElement("option",{value:"beta"},"Beta Tester")),t&&Oi.createElement(Ey,{variant:"warning"},"Previewing as ",t))};Ne();ke();ct();import St,{useState as Ks,useCallback as nm}from"react";import{styled as Er}from"storybook/theming";var QR="0.5.7",JR=[{value:"bug",label:"\u{1F41E} Bug \u2014 something broke"},{value:"ux",label:"\u{1F9ED} UX \u2014 confusing or slow"},{value:"feature",label:"\u2728 Feature \u2014 missing something"},{value:"praise",label:"\u{1F49A} Praise \u2014 works great"},{value:"other",label:"\u{1F4AC} Other"}],ZR=Er.div({position:"fixed",inset:0,backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:1e4,display:"flex",alignItems:"center",justifyContent:"center"}),ez=Er.div(({theme:e})=>({backgroundColor:e.background.content,borderRadius:"12px",width:"460px",maxWidth:"94%",maxHeight:"90vh",overflow:"auto",boxShadow:"0 16px 48px rgba(0, 0, 0, 0.25)"})),tz=Er.div(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",padding:"16px 20px 12px",borderBottom:`1px solid ${e.appBorderColor}`})),nz=Er.h3(({theme:e})=>({margin:0,fontSize:"15px",fontWeight:600,color:e.color.defaultText,display:"flex",alignItems:"center",gap:"8px"})),rz=Er.button(({theme:e})=>({background:"transparent",border:"none",fontSize:"20px",color:e.color.mediumdark,cursor:"pointer",padding:"0 6px",lineHeight:1,"&:hover":{color:e.color.defaultText}})),oz=Er.div({padding:"16px 20px",display:"flex",flexDirection:"column",gap:"14px"}),iz=Er.textarea(({theme:e})=>({width:"100%",minHeight:"110px",padding:"8px 10px",borderRadius:e.appBorderRadius,border:`1px solid ${e.appBorderColor}`,fontFamily:e.typography.fonts.base,fontSize:e.typography.size.s2,color:e.color.defaultText,backgroundColor:e.background.app,resize:"vertical",boxSizing:"border-box","&:focus":{outline:"none",borderColor:le}})),ov=Er.div(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 20px 16px",borderTop:`1px solid ${e.appBorderColor}`,gap:"8px"})),iv=Er.p(({theme:e})=>({margin:0,fontSize:e.typography.size.s1,color:e.color.mediumdark,lineHeight:1.4})),sz=Er.p(({theme:e})=>({margin:0,fontSize:e.typography.size.s1,color:e.color.negative})),az=Er.div(({theme:e})=>({padding:"24px 20px",textAlign:"center",display:"flex",flexDirection:"column",gap:"10px","& h4":{margin:0,fontSize:"15px",fontWeight:600,color:e.color.positive},"& p":{margin:0,fontSize:e.typography.size.s2,color:e.color.mediumdark}}));function sv({isOpen:e,onClose:t}){let{sessionToken:n,isConnected:r}=we(),{selectedProjectId:o}=Xe(),{currentStoryId:i}=et(),[s,a]=Ks("other"),[u,c]=Ks(""),[l,d]=Ks(!1),[g,p]=Ks(!1),[h,S]=Ks(null),T=nm(()=>{c(""),a("other"),p(!1),S(null),d(!1)},[]),F=nm(()=>{T(),t()},[T,t]),v=nm(async D=>{if(D.preventDefault(),!u.trim()){S("Please write a message.");return}if(!r||!n){S("Sign in to send feedback.");return}d(!0),S(null);try{let N=await oe(`${K()}/api/feedback`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify({message:u.trim(),severity:s,projectId:o||void 0,storyId:i||void 0,addonVersion:QR})});if(!N.ok){let U=await N.json().catch(()=>({}));throw new Error(U.error||`Request failed (${N.status})`)}p(!0)}catch(N){S(N instanceof Error?N.message:"Something went wrong")}finally{d(!1)}},[u,s,n,r,o,i]);return e?St.createElement(ZR,{onClick:F},St.createElement(ez,{onClick:D=>D.stopPropagation()},St.createElement(tz,null,St.createElement(nz,null,St.createElement("span",null,"\u{1F4AC}"),"Send feedback"),St.createElement(rz,{onClick:F,"aria-label":"Close"},"\xD7")),g?St.createElement(St.Fragment,null,St.createElement(az,null,St.createElement("h4",null,"Thanks \u2014 got it."),St.createElement("p",null,"We read every message. If it's a bug, we'll likely follow up by email.")),St.createElement(ov,null,St.createElement("span",null),St.createElement(An,{onClick:F},"Close"))):St.createElement("form",{onSubmit:v},St.createElement(oz,null,St.createElement(vo,null,St.createElement(ko,{htmlFor:"feedback-severity"},"Type"),St.createElement(Sn,{id:"feedback-severity",value:s,onChange:D=>a(D.target.value),disabled:l},JR.map(D=>St.createElement("option",{key:D.value,value:D.value},D.label)))),St.createElement(vo,null,St.createElement(ko,{htmlFor:"feedback-message"},"What happened?"),St.createElement(iz,{id:"feedback-message",value:u,onChange:D=>c(D.target.value),placeholder:"Tell us what you were doing, what you expected, and what happened.",disabled:l,autoFocus:!0,maxLength:5e3})),St.createElement(iv,null,"We auto-attach your current story and project so we can reproduce it. No screenshots sent."),h&&St.createElement(sz,null,h)),St.createElement(ov,null,St.createElement(iv,null,i?`Context: ${i}`:"No story selected"),St.createElement("div",{style:{display:"flex",gap:"8px"}},St.createElement(An,{type:"button",onClick:F,disabled:l},"Cancel"),St.createElement(on,{type:"submit",disabled:l||!u.trim()},l?"Sending\u2026":"Send")))))):null}ke();Ne();ct();var lz=lo.div({display:"flex",alignItems:"center"}),_i=lo.div(({theme:e})=>({display:"flex",alignItems:"center",paddingLeft:"8px",borderLeft:`1px solid ${e.appBorderColor}`,"&:first-of-type":{paddingLeft:0,borderLeft:"none"}})),cz=lo.span(({theme:e})=>({fontSize:e.typography.size.s1,color:e.color.secondary,fontWeight:e.typography.weight.bold,paddingRight:"8px",opacity:.8})),uz=lo.div({position:"relative"}),pz=lo.button(({theme:e})=>({width:"26px",height:"26px",padding:0,background:`linear-gradient(135deg, ${e.color.secondary} 0%, ${e.color.secondary}cc 100%)`,border:"none",borderRadius:"50%",color:e.color.inverseText,cursor:"pointer",fontSize:e.typography.size.s2,fontWeight:e.typography.weight.bold,display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s","&:hover":{transform:"scale(1.05)",boxShadow:`0 2px 8px ${e.color.secondary}66`}})),cv=lo.button(({isLow:e})=>({display:"flex",alignItems:"center",gap:"6px",padding:"4px 10px",background:e?"#FEF3C7":"linear-gradient(135deg, #10B981 0%, #3B82F6 100%)",border:"none",borderRadius:"12px",color:e?"#92400E":"#fff",cursor:"pointer",fontSize:"12px",fontWeight:600,transition:"all 0.2s",minWidth:"60px",justifyContent:"center","&:hover":{transform:"scale(1.02)",boxShadow:"0 2px 8px rgba(0,0,0,0.15)"}})),dz=lo.span({display:"inline-block",width:"12px",height:"12px",border:"2px solid rgba(255,255,255,0.3)",borderTopColor:"#fff",borderRadius:"50%",animation:"credit-spin 0.8s linear infinite","@keyframes credit-spin":{"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}}),gz=lo.button(({theme:e})=>({display:"flex",alignItems:"center",justifyContent:"center",gap:"4px",padding:"4px 10px",height:"28px",border:`1px solid ${e.appBorderColor}`,borderRadius:e.appBorderRadius,backgroundColor:"transparent",color:e.color.mediumdark,fontSize:"12px",fontWeight:500,cursor:"pointer",transition:"all 0.15s","&:hover":{backgroundColor:e.background.hoverable,color:e.color.defaultText,borderColor:e.color.mediumdark}})),fz=lo.button({position:"fixed",bottom:"20px",right:"20px",width:"48px",height:"48px",borderRadius:"50%",backgroundColor:le,color:"white",border:"none",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"22px",cursor:"pointer",boxShadow:`0 4px 14px ${le}66, 0 2px 4px rgba(0,0,0,0.1)`,transition:"all 0.2s ease",zIndex:9999,"&:hover":{transform:"scale(1.08)",boxShadow:`0 6px 20px ${le}88, 0 3px 6px rgba(0,0,0,0.15)`},"&:active":{transform:"scale(0.96)"}}),mz=30*1e3,om=({onOpenSettings:e})=>{let[t,n]=rm(!1),[r,o]=rm(!1),[i,s]=rm(!1),{usageData:a,usageLastFetched:u,setUsageData:c,sessionToken:l}=we(),{userRole:d,roleOverride:g,featureFlags:p}=ce(),h=g??d;lv(()=>{(async()=>{if(!(!l||u&&Date.now()-u<mz&&a)){s(!0);try{let U=K(),L=await oe(`${U}/api/addon/account`,{headers:{Authorization:`Bearer ${l}`}});if(L.ok){let z=await L.json();c(z)}}catch(U){console.error("Failed to fetch balance:",U)}finally{s(!1)}}})()},[l,u,a,c]),lv(()=>{let D=()=>{document.visibilityState==="visible"&&t&&n(!1)},N=()=>{t&&n(!1)};return document.addEventListener("visibilitychange",D),window.addEventListener("focus",N),()=>{document.removeEventListener("visibilitychange",D),window.removeEventListener("focus",N)}},[t]);let S=av(()=>{n(!0)},[]),T=av(()=>{n(!1)},[]),F=a?.creditBalance??0,v=F<2&&!i;return en.createElement(lz,null,e&&en.createElement(_i,null,en.createElement(gz,{onClick:e,title:"Settings"},en.createElement("span",{style:{fontSize:"14px"}},"\u2699"),"Settings")),l&&d==="admin"&&h==="admin"&&en.createElement(_i,null,en.createElement(rv,null)),en.createElement(_i,null,en.createElement(cz,null,"v","0.5.46")),l&&p.showCosts&&en.createElement(_i,null,en.createElement(cv,{onClick:S,isLow:v,title:i?"Loading...":a?v?"Low balance - click to top up":"Credit balance - click for details":"Click to load balance"},i?en.createElement(dz,null):a?`$${F.toFixed(2)}`:"...")),l&&!p.showCosts&&a&&en.createElement(_i,null,en.createElement(cv,{onClick:S,isLow:Math.floor(F)<=3,title:`${Math.floor(F)} review credits \u2014 click for details`},"\u26A1 ",Math.floor(F))),en.createElement(_i,null,en.createElement(uz,null,en.createElement(pz,{title:"Account & Usage",onClick:S},a?.email?a.email[0].toUpperCase():"?"),t&&en.createElement(tv,{onClose:T}))),l&&en.createElement(fz,{onClick:()=>o(!0),title:"Send feedback","aria-label":"Send feedback"},"\u{1F4AC}"),en.createElement(sv,{isOpen:r,onClose:()=>o(!1)}))};import Bt,{useEffect as w5,useRef as v5}from"react";import{styled as fr}from"storybook/theming";import tt from"react";ke();ze();Ne();ct();ln();import{useState as hz,useCallback as Lo,useRef as xz,useEffect as uv}from"react";var Ar=K();y.debug("[useAuth] Module loaded, APP_URL:",Ar);var Zl=null,ec=null,Xs=null;function Qs(){Zl&&(clearInterval(Zl),Zl=null),ec&&(clearTimeout(ec),ec=null)}var Js=()=>{let e=xz(null),{sessionToken:t,apiKey:n,authMethod:r,deviceCode:o,userCode:i,verificationUri:s,isConnected:a,authError:u,setSessionToken:c,setApiKey:l,setAuthMethod:d,setDeviceCode:g,setUserCode:p,setVerificationUri:h,setPollingInterval:S,setAuthError:T,resetAuth:F}=we(),[v,D]=hz(!1),N=Lo(()=>{Qs(),Xs=null},[]),U=Lo(f=>{Xs=f,Qs();let C=async()=>{let E=Xs;if(!E){Qs();return}try{let I=await(await fetch(`${Ar}/api/addon/auth/poll`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({device_code:E})})).json();I.status==="authorized"&&I.session_token?(y.debug("[useAuth] \u2705 OAuth poll successful! Got token."),Qs(),Xs=null,localStorage.setItem("uicopilot_session_token",I.session_token),c(I.session_token),D(!1)):I.status==="expired"&&(y.debug("[useAuth] OAuth poll_code expired"),Qs(),Xs=null,D(!1))}catch(x){y.error("[useAuth] OAuth poll error:",x)}};Zl=setInterval(C,2e3),ec=setTimeout(C,1e3)},[c]);uv(()=>{function f(C){if(!C.origin.startsWith(Ar))return;let E=C.data;if(!E||typeof E!="object")return;let x=E;if(x.type==="UICOPILOT_AUTH_ERROR"){y.debug("[useAuth] Popup reported auth error:",x.step,x.detail),N(),D(!1);let I=typeof x.step=="string"?x.step:"auth",P=typeof x.detail=="string"?x.detail:"Unknown error";T(`${Et.NAME} auth failed (${I}): ${P}`)}else x.type==="UICOPILOT_AUTH_POLL_CODE"&&typeof x.pollCode=="string"&&x.pollCode&&(y.debug("[useAuth] Popup handed us a fresh poll_code, switching"),T(null),U(x.pollCode))}return window.addEventListener("message",f),()=>window.removeEventListener("message",f)},[U,N,T]);let L=Lo(async()=>{try{y.debug("[useAuth] Starting OAuth flow, requesting poll_code...");let f;try{f=await oe(`${Ar}/api/addon/auth/oauth-poll`,{method:"POST"})}catch(I){let B=I instanceof Error&&I.message.includes("timed out")?`Cannot reach ${Et.NAME} server at ${Ar}. Is the dashboard running?`:`Connection failed: ${Ar} is not responding.`;T(B),y.error("[useAuth]",B);return}if(!f.ok){let I=`Cannot reach ${Et.NAME} server. Is the dashboard running?`;T(I),y.error("[useAuth]",I);return}let{poll_code:C}=await f.json();y.debug("[useAuth] Got poll_code:",C.substring(0,15)+"...");let E=localStorage.getItem("uicopilot_force_sign_in")==="true";E&&localStorage.removeItem("uicopilot_force_sign_in");let x=`${Ar}/addon/auth?poll_code=${C}${E?"&force_sign_in=true":""}`;D(!0),window.open(x,"uiparity-auth","width=520,height=620,left=300,top=150"),y.debug("[useAuth] Starting OAuth poll for token..."),U(C)}catch(f){y.error("[useAuth] OAuth flow error:",f),T(`Connection failed. Is the dashboard running at ${Ar}?`),D(!1)}},[T,U]),z=Lo(async()=>{try{let f=await fetch(`${Ar}/api/addon/auth/device`,{method:"POST"});if(!f.ok)throw new Error("Failed to start device code flow");let C=await f.json();g(C.device_code),p(C.user_code),h(C.verification_uri),window.open(C.verification_uri,"_blank"),m(C.device_code,C.interval*1e3)}catch(f){throw y.error("[useAuth] Device code flow error:",f),f}},[g,p,h]),m=Lo((f,C)=>{y.debug("[useAuth] Starting polling. Device code:",f,"Interval:",C),e.current&&clearInterval(e.current);let E=async()=>{try{let I=await(await fetch(`${Ar}/api/addon/auth/poll`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({device_code:f})})).json();I.status==="authorized"?(y.debug("[useAuth] Device code authorization successful!"),e.current&&(clearInterval(e.current),e.current=null),g(null),p(null),h(null),localStorage.setItem("uicopilot_session_token",I.session_token),c(I.session_token),D(!1)):(I.status==="expired"||I.status==="denied")&&(y.debug("[useAuth] Device code expired or denied"),e.current&&(clearInterval(e.current),e.current=null),g(null),p(null),h(null))}catch(x){y.error("[useAuth] Polling error:",x)}};e.current=setInterval(E,C),S(C)},[g,p,h,c,S]),b=Lo(()=>{e.current&&(clearInterval(e.current),e.current=null),g(null),p(null),h(null),S(null)},[g,p,h,S]),w=Lo(f=>{l(f),c(f),localStorage.setItem("uicopilot_api_key",f)},[l,c]),A=Lo(async()=>{if(t)try{await oe(`${Ar}/api/addon/auth/sign-out`,{method:"POST",headers:{Authorization:`Bearer ${t}`}})}catch{}F(),D(!1),e.current&&(clearInterval(e.current),e.current=null),N()},[t,F,N]);return uv(()=>()=>{e.current&&clearInterval(e.current)},[]),{sessionToken:t,apiKey:n,authMethod:r,deviceCode:o,userCode:i,verificationUri:s,isConnected:a,authError:u,oauthPending:v,setAuthMethod:d,startOAuth:L,startDeviceCode:z,cancelDeviceCode:b,saveApiKey:w,logout:A}};ke();ze();Ne();ct();import{useCallback as tc}from"react";var Zs=K(),co=()=>{let{projects:e,selectedProjectId:t,loadingProjects:n,setProjects:r,setSelectedProjectId:o,setLoadingProjects:i,getSelectedProject:s}=Xe(),{sessionToken:a}=we(),u=tc(async()=>{if(!a){y.debug("[useProjects] No session token, skipping fetch");return}try{i(!0),y.debug("[useProjects] Fetching from:",`${Zs}/api/projects`);let g=await oe(`${Zs}/api/projects`,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`}});if(g.ok){let p=await g.json();y.debug("[useProjects] Projects:",p.projects),r(p.projects||[])}else y.error("[useProjects] Failed to fetch projects:",g.status,g.statusText)}catch(g){y.error("[useProjects] Error fetching projects:",g)}finally{i(!1)}},[a,r,i]),c=tc(async g=>{if(!a)throw new Error("Not authenticated");let p=await oe(`${Zs}/api/projects`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`},body:JSON.stringify(g)});if(!p.ok)throw new Error("Failed to create project");let h=await p.json();return await u(),h.project},[a,u]),l=tc(async(g,p)=>{if(!a)throw new Error("Not authenticated");let h={};if(p.name!==void 0&&(h.name=p.name),p.description!==void 0&&(h.description=p.description),p.figmaFileUrl!==void 0&&(h.figmaFileId=p.figmaFileUrl===""?null:p.figmaFileUrl),!(await oe(`${Zs}/api/projects/${g}`,{method:"PATCH",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`},body:JSON.stringify(h)})).ok)throw new Error("Failed to update project");await u()},[a,u]),d=tc(async g=>{if(!a)throw new Error("Not authenticated");if(!(await oe(`${Zs}/api/projects/${g}`,{method:"DELETE",headers:{Authorization:`Bearer ${a}`}})).ok)throw new Error("Failed to delete project");await u(),t===g&&o(null)},[a,t,u,o]);return{projects:e,selectedProjectId:t,selectedProject:s(),loadingProjects:n,setSelectedProjectId:o,fetchProjects:u,createProject:c,updateProject:l,deleteProject:d}};ke();var ea=()=>{let{showComponentBrowser:e,figmaFileUrl:t,currentMapping:n,mappingSource:r,loadingMapping:o,showFigmaQuality:i,setShowComponentBrowser:s,setFigmaFileUrl:a,setCurrentMapping:u,setMappingSource:c,setLoadingMapping:l,setShowFigmaQuality:d}=et();return{showComponentBrowser:e,figmaFileUrl:t,currentMapping:n,mappingSource:r,loadingMapping:o,showFigmaQuality:i,setShowComponentBrowser:s,setFigmaFileUrl:a,setCurrentMapping:u,setMappingSource:c,setLoadingMapping:l,setShowFigmaQuality:d,openComponentBrowser:()=>s(!0),closeComponentBrowser:()=>s(!1)}};ke();cm();mm();import{useCallback as la,useRef as gc}from"react";ze();function sc(){return new Promise(e=>{let t=document.getElementById("storybook-preview-iframe");if(!t||!t.contentWindow){y.warn("[iframeReload] No preview iframe found"),e();return}let n=t.contentWindow.location.href,r=new URL(n);r.searchParams.set("_cb",Date.now().toString());let o=r.toString();y.debug("[iframeReload] Triggering cache-busted reload:",o);let i=setTimeout(()=>{y.warn("[iframeReload] Iframe reload timed out after 5s"),t.removeEventListener("load",s),e()},5e3),s=()=>{clearTimeout(i),t.removeEventListener("load",s),y.debug("[iframeReload] Iframe loaded, waiting for HMR and styles to settle..."),setTimeout(()=>{y.debug("[iframeReload] Iframe reloaded and styles should be fresh"),e()},2e3)};t.addEventListener("load",s),t.contentWindow.location.href=o})}function ac(e){return e&&e!=="admin"?{"X-UIC-Role-Preview":e}:{}}var lc=BigInt(4294967295),Fv=BigInt(32);function _z(e,t=!1){return t?{h:Number(e&lc),l:Number(e>>Fv&lc)}:{h:Number(e>>Fv&lc)|0,l:Number(e&lc)|0}}function Ev(e,t=!1){let n=e.length,r=new Uint32Array(n),o=new Uint32Array(n);for(let i=0;i<n;i++){let{h:s,l:a}=_z(e[i],t);[r[i],o[i]]=[s,a]}return[r,o]}var Av=(e,t,n)=>e<<n|t>>>32-n,Pv=(e,t,n)=>t<<n|e>>>32-n,Lv=(e,t,n)=>t<<n-32|e>>>64-n,Mv=(e,t,n)=>e<<n-32|t>>>64-n;function $z(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function hm(e,t=""){if(!Number.isSafeInteger(e)||e<0){let n=t&&`"${t}" `;throw new Error(`${n}expected integer >= 0, got ${e}`)}}function cc(e,t,n=""){let r=$z(e),o=e?.length,i=t!==void 0;if(!r||i&&o!==t){let s=n&&`"${n}" `,a=i?` of length ${t}`:"",u=r?`length=${o}`:`type=${typeof e}`;throw new Error(s+"expected Uint8Array"+a+", got "+u)}return e}function xm(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Bv(e,t){cc(e,void 0,"digestInto() output");let n=t.outputLen;if(e.length<n)throw new Error('"digestInto() output" expected to be of length >='+n)}function Dv(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function ym(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}var Uz=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function jz(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function Hz(e){for(let t=0;t<e.length;t++)e[t]=jz(e[t]);return e}var bm=Uz?e=>e:Hz;function Rv(e,t={}){let n=(o,i)=>e(i).update(o).digest(),r=e(void 0);return n.outputLen=r.outputLen,n.blockLen=r.blockLen,n.create=o=>e(o),Object.assign(n,t),Object.freeze(n)}var zv=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});var Wz=BigInt(0),oa=BigInt(1),Vz=BigInt(2),Gz=BigInt(7),qz=BigInt(256),Yz=BigInt(113),_v=[],$v=[],Uv=[];for(let e=0,t=oa,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],_v.push(2*(5*r+n)),$v.push((e+1)*(e+2)/2%64);let o=Wz;for(let i=0;i<7;i++)t=(t<<oa^(t>>Gz)*Yz)%qz,t&Vz&&(o^=oa<<(oa<<BigInt(i))-oa);Uv.push(o)}var jv=Ev(Uv,!0),Kz=jv[0],Xz=jv[1],Nv=(e,t,n)=>n>32?Lv(e,t,n):Av(e,t,n),Ov=(e,t,n)=>n>32?Mv(e,t,n):Pv(e,t,n);function Qz(e,t=24){let n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let s=0;s<10;s++)n[s]=e[s]^e[s+10]^e[s+20]^e[s+30]^e[s+40];for(let s=0;s<10;s+=2){let a=(s+8)%10,u=(s+2)%10,c=n[u],l=n[u+1],d=Nv(c,l,1)^n[a],g=Ov(c,l,1)^n[a+1];for(let p=0;p<50;p+=10)e[s+p]^=d,e[s+p+1]^=g}let o=e[2],i=e[3];for(let s=0;s<24;s++){let a=$v[s],u=Nv(o,i,a),c=Ov(o,i,a),l=_v[s];o=e[l],i=e[l+1],e[l]=u,e[l+1]=c}for(let s=0;s<50;s+=10){for(let a=0;a<10;a++)n[a]=e[s+a];for(let a=0;a<10;a++)e[s+a]^=~n[(a+2)%10]&n[(a+4)%10]}e[0]^=Kz[r],e[1]^=Xz[r]}ym(n)}var Sm=class e{constructor(t,n,r,o=!1,i=24){sr(this,"state");sr(this,"pos",0);sr(this,"posOut",0);sr(this,"finished",!1);sr(this,"state32");sr(this,"destroyed",!1);sr(this,"blockLen");sr(this,"suffix");sr(this,"outputLen");sr(this,"enableXOF",!1);sr(this,"rounds");if(this.blockLen=t,this.suffix=n,this.outputLen=r,this.enableXOF=o,this.rounds=i,hm(r,"outputLen"),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=Dv(this.state)}clone(){return this._cloneInto()}keccak(){bm(this.state32),Qz(this.state32,this.rounds),bm(this.state32),this.posOut=0,this.pos=0}update(t){xm(this),cc(t);let{blockLen:n,state:r}=this,o=t.length;for(let i=0;i<o;){let s=Math.min(n-this.pos,o-i);for(let a=0;a<s;a++)r[this.pos++]^=t[i++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:n,pos:r,blockLen:o}=this;t[r]^=n,(n&128)!==0&&r===o-1&&this.keccak(),t[o-1]^=128,this.keccak()}writeInto(t){xm(this,!1),cc(t),this.finish();let n=this.state,{blockLen:r}=this;for(let o=0,i=t.length;o<i;){this.posOut>=r&&this.keccak();let s=Math.min(r-this.posOut,i-o);t.set(n.subarray(this.posOut,this.posOut+s),o),this.posOut+=s,o+=s}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return hm(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(Bv(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,ym(this.state)}_cloneInto(t){let{blockLen:n,suffix:r,outputLen:o,rounds:i,enableXOF:s}=this;return t||(t=new e(n,r,o,s,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=r,t.outputLen=o,t.enableXOF=s,t.destroyed=this.destroyed,t}},Jz=(e,t,n,r={})=>Rv(()=>new Sm(t,e,n),r);var Hv=Jz(6,72,64,zv(10));var Zz=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,wm=Math.ceil,dr=Math.floor,Hn="[BigNumber Error] ",Wv=Hn+"Number primitive has more than 15 significant digits: ",Pr=1e14,He=14,vm=9007199254740991,km=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],Bo=1e7,cn=1e9;function Vv(e){var t,n,r,o=v.prototype={constructor:v,toString:null,valueOf:null},i=new v(1),s=20,a=4,u=-7,c=21,l=-1e7,d=1e7,g=!1,p=1,h=0,S={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"\xA0",suffix:""},T="0123456789abcdefghijklmnopqrstuvwxyz",F=!0;function v(m,b){var w,A,f,C,E,x,I,P,B=this;if(!(B instanceof v))return new v(m,b);if(b==null){if(m&&m._isBigNumber===!0){B.s=m.s,!m.c||m.e>d?B.c=B.e=null:m.e<l?B.c=[B.e=0]:(B.e=m.e,B.c=m.c.slice());return}if((x=typeof m=="number")&&m*0==0){if(B.s=1/m<0?(m=-m,-1):1,m===~~m){for(C=0,E=m;E>=10;E/=10,C++);C>d?B.c=B.e=null:(B.e=C,B.c=[m]);return}P=String(m)}else{if(!Zz.test(P=String(m)))return r(B,P,x);B.s=P.charCodeAt(0)==45?(P=P.slice(1),-1):1}(C=P.indexOf("."))>-1&&(P=P.replace(".","")),(E=P.search(/e/i))>0?(C<0&&(C=E),C+=+P.slice(E+1),P=P.substring(0,E)):C<0&&(C=P.length)}else{if(Ot(b,2,T.length,"Base"),b==10&&F)return B=new v(m),L(B,s+B.e+1,a);if(P=String(m),x=typeof m=="number"){if(m*0!=0)return r(B,P,x,b);if(B.s=1/m<0?(P=P.slice(1),-1):1,v.DEBUG&&P.replace(/^0\.0*|\./,"").length>15)throw Error(Wv+m)}else B.s=P.charCodeAt(0)===45?(P=P.slice(1),-1):1;for(w=T.slice(0,b),C=E=0,I=P.length;E<I;E++)if(w.indexOf(A=P.charAt(E))<0){if(A=="."){if(E>C){C=I;continue}}else if(!f&&(P==P.toUpperCase()&&(P=P.toLowerCase())||P==P.toLowerCase()&&(P=P.toUpperCase()))){f=!0,E=-1,C=0;continue}return r(B,String(m),x,b)}x=!1,P=n(P,b,10,B.s),(C=P.indexOf("."))>-1?P=P.replace(".",""):C=P.length}for(E=0;P.charCodeAt(E)===48;E++);for(I=P.length;P.charCodeAt(--I)===48;);if(P=P.slice(E,++I)){if(I-=E,x&&v.DEBUG&&I>15&&(m>vm||m!==dr(m)))throw Error(Wv+B.s*m);if((C=C-E-1)>d)B.c=B.e=null;else if(C<l)B.c=[B.e=0];else{if(B.e=C,B.c=[],E=(C+1)%He,C<0&&(E+=He),E<I){for(E&&B.c.push(+P.slice(0,E)),I-=He;E<I;)B.c.push(+P.slice(E,E+=He));E=He-(P=P.slice(E)).length}else E-=I;for(;E--;P+="0");B.c.push(+P)}}else B.c=[B.e=0]}v.clone=Vv,v.ROUND_UP=0,v.ROUND_DOWN=1,v.ROUND_CEIL=2,v.ROUND_FLOOR=3,v.ROUND_HALF_UP=4,v.ROUND_HALF_DOWN=5,v.ROUND_HALF_EVEN=6,v.ROUND_HALF_CEIL=7,v.ROUND_HALF_FLOOR=8,v.EUCLID=9,v.config=v.set=function(m){var b,w;if(m!=null)if(typeof m=="object"){if(m.hasOwnProperty(b="DECIMAL_PLACES")&&(w=m[b],Ot(w,0,cn,b),s=w),m.hasOwnProperty(b="ROUNDING_MODE")&&(w=m[b],Ot(w,0,8,b),a=w),m.hasOwnProperty(b="EXPONENTIAL_AT")&&(w=m[b],w&&w.pop?(Ot(w[0],-cn,0,b),Ot(w[1],0,cn,b),u=w[0],c=w[1]):(Ot(w,-cn,cn,b),u=-(c=w<0?-w:w))),m.hasOwnProperty(b="RANGE"))if(w=m[b],w&&w.pop)Ot(w[0],-cn,-1,b),Ot(w[1],1,cn,b),l=w[0],d=w[1];else if(Ot(w,-cn,cn,b),w)l=-(d=w<0?-w:w);else throw Error(Hn+b+" cannot be zero: "+w);if(m.hasOwnProperty(b="CRYPTO"))if(w=m[b],w===!!w)if(w)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))g=w;else throw g=!w,Error(Hn+"crypto unavailable");else g=w;else throw Error(Hn+b+" not true or false: "+w);if(m.hasOwnProperty(b="MODULO_MODE")&&(w=m[b],Ot(w,0,9,b),p=w),m.hasOwnProperty(b="POW_PRECISION")&&(w=m[b],Ot(w,0,cn,b),h=w),m.hasOwnProperty(b="FORMAT"))if(w=m[b],typeof w=="object")S=w;else throw Error(Hn+b+" not an object: "+w);if(m.hasOwnProperty(b="ALPHABET"))if(w=m[b],typeof w=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(w))F=w.slice(0,10)=="0123456789",T=w;else throw Error(Hn+b+" invalid: "+w)}else throw Error(Hn+"Object expected: "+m);return{DECIMAL_PLACES:s,ROUNDING_MODE:a,EXPONENTIAL_AT:[u,c],RANGE:[l,d],CRYPTO:g,MODULO_MODE:p,POW_PRECISION:h,FORMAT:S,ALPHABET:T}},v.isBigNumber=function(m){if(!m||m._isBigNumber!==!0)return!1;if(!v.DEBUG)return!0;var b,w,A=m.c,f=m.e,C=m.s;e:if({}.toString.call(A)=="[object Array]"){if((C===1||C===-1)&&f>=-cn&&f<=cn&&f===dr(f)){if(A[0]===0){if(f===0&&A.length===1)return!0;break e}if(b=(f+1)%He,b<1&&(b+=He),String(A[0]).length==b){for(b=0;b<A.length;b++)if(w=A[b],w<0||w>=Pr||w!==dr(w))break e;if(w!==0)return!0}}}else if(A===null&&f===null&&(C===null||C===1||C===-1))return!0;throw Error(Hn+"Invalid BigNumber: "+m)},v.maximum=v.max=function(){return N(arguments,-1)},v.minimum=v.min=function(){return N(arguments,1)},v.random=(function(){var m=9007199254740992,b=Math.random()*m&2097151?function(){return dr(Math.random()*m)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(w){var A,f,C,E,x,I=0,P=[],B=new v(i);if(w==null?w=s:Ot(w,0,cn),E=wm(w/He),g)if(crypto.getRandomValues){for(A=crypto.getRandomValues(new Uint32Array(E*=2));I<E;)x=A[I]*131072+(A[I+1]>>>11),x>=9e15?(f=crypto.getRandomValues(new Uint32Array(2)),A[I]=f[0],A[I+1]=f[1]):(P.push(x%1e14),I+=2);I=E/2}else if(crypto.randomBytes){for(A=crypto.randomBytes(E*=7);I<E;)x=(A[I]&31)*281474976710656+A[I+1]*1099511627776+A[I+2]*4294967296+A[I+3]*16777216+(A[I+4]<<16)+(A[I+5]<<8)+A[I+6],x>=9e15?crypto.randomBytes(7).copy(A,I):(P.push(x%1e14),I+=7);I=E/7}else throw g=!1,Error(Hn+"crypto unavailable");if(!g)for(;I<E;)x=b(),x<9e15&&(P[I++]=x%1e14);for(E=P[--I],w%=He,E&&w&&(x=km[He-w],P[I]=dr(E/x)*x);P[I]===0;P.pop(),I--);if(I<0)P=[C=0];else{for(C=-1;P[0]===0;P.splice(0,1),C-=He);for(I=1,x=P[0];x>=10;x/=10,I++);I<He&&(C-=He-I)}return B.e=C,B.c=P,B}})(),v.sum=function(){for(var m=1,b=arguments,w=new v(b[0]);m<b.length;)w=w.plus(b[m++]);return w},n=(function(){var m="0123456789";function b(w,A,f,C){for(var E,x=[0],I,P=0,B=w.length;P<B;){for(I=x.length;I--;x[I]*=A);for(x[0]+=C.indexOf(w.charAt(P++)),E=0;E<x.length;E++)x[E]>f-1&&(x[E+1]==null&&(x[E+1]=0),x[E+1]+=x[E]/f|0,x[E]%=f)}return x.reverse()}return function(w,A,f,C,E){var x,I,P,B,_,k,R,H,M=w.indexOf("."),se=s,X=a;for(M>=0&&(B=h,h=0,w=w.replace(".",""),H=new v(A),k=H.pow(w.length-M),h=B,H.c=b(uo(pr(k.c),k.e,"0"),10,f,m),H.e=H.c.length),R=b(w,A,f,E?(x=T,m):(x=m,T)),P=B=R.length;R[--B]==0;R.pop());if(!R[0])return x.charAt(0);if(M<0?--P:(k.c=R,k.e=P,k.s=C,k=t(k,H,se,X,f),R=k.c,_=k.r,P=k.e),I=P+se+1,M=R[I],B=f/2,_=_||I<0||R[I+1]!=null,_=X<4?(M!=null||_)&&(X==0||X==(k.s<0?3:2)):M>B||M==B&&(X==4||_||X==6&&R[I-1]&1||X==(k.s<0?8:7)),I<1||!R[0])w=_?uo(x.charAt(1),-se,x.charAt(0)):x.charAt(0);else{if(R.length=I,_)for(--f;++R[--I]>f;)R[I]=0,I||(++P,R=[1].concat(R));for(B=R.length;!R[--B];);for(M=0,w="";M<=B;w+=x.charAt(R[M++]));w=uo(w,P,x.charAt(0))}return w}})(),t=(function(){function m(A,f,C){var E,x,I,P,B=0,_=A.length,k=f%Bo,R=f/Bo|0;for(A=A.slice();_--;)I=A[_]%Bo,P=A[_]/Bo|0,E=R*I+P*k,x=k*I+E%Bo*Bo+B,B=(x/C|0)+(E/Bo|0)+R*P,A[_]=x%C;return B&&(A=[B].concat(A)),A}function b(A,f,C,E){var x,I;if(C!=E)I=C>E?1:-1;else for(x=I=0;x<C;x++)if(A[x]!=f[x]){I=A[x]>f[x]?1:-1;break}return I}function w(A,f,C,E){for(var x=0;C--;)A[C]-=x,x=A[C]<f[C]?1:0,A[C]=x*E+A[C]-f[C];for(;!A[0]&&A.length>1;A.splice(0,1));}return function(A,f,C,E,x){var I,P,B,_,k,R,H,M,se,X,re,me,Pe,qe,ge,Ue,it,V=A.s==f.s?1:-1,Se=A.c,pe=f.c;if(!Se||!Se[0]||!pe||!pe[0])return new v(!A.s||!f.s||(Se?pe&&Se[0]==pe[0]:!pe)?NaN:Se&&Se[0]==0||!pe?V*0:V/0);for(M=new v(V),se=M.c=[],P=A.e-f.e,V=C+P+1,x||(x=Pr,P=gr(A.e/He)-gr(f.e/He),V=V/He|0),B=0;pe[B]==(Se[B]||0);B++);if(pe[B]>(Se[B]||0)&&P--,V<0)se.push(1),_=!0;else{for(qe=Se.length,Ue=pe.length,B=0,V+=2,k=dr(x/(pe[0]+1)),k>1&&(pe=m(pe,k,x),Se=m(Se,k,x),Ue=pe.length,qe=Se.length),Pe=Ue,X=Se.slice(0,Ue),re=X.length;re<Ue;X[re++]=0);it=pe.slice(),it=[0].concat(it),ge=pe[0],pe[1]>=x/2&&ge++;do{if(k=0,I=b(pe,X,Ue,re),I<0){if(me=X[0],Ue!=re&&(me=me*x+(X[1]||0)),k=dr(me/ge),k>1)for(k>=x&&(k=x-1),R=m(pe,k,x),H=R.length,re=X.length;b(R,X,H,re)==1;)k--,w(R,Ue<H?it:pe,H,x),H=R.length,I=1;else k==0&&(I=k=1),R=pe.slice(),H=R.length;if(H<re&&(R=[0].concat(R)),w(X,R,re,x),re=X.length,I==-1)for(;b(pe,X,Ue,re)<1;)k++,w(X,Ue<re?it:pe,re,x),re=X.length}else I===0&&(k++,X=[0]);se[B++]=k,X[0]?X[re++]=Se[Pe]||0:(X=[Se[Pe]],re=1)}while((Pe++<qe||X[0]!=null)&&V--);_=X[0]!=null,se[0]||se.splice(0,1)}if(x==Pr){for(B=1,V=se[0];V>=10;V/=10,B++);L(M,C+(M.e=B+P*He-1)+1,E,_)}else M.e=P,M.r=+_;return M}})();function D(m,b,w,A){var f,C,E,x,I;if(w==null?w=a:Ot(w,0,8),!m.c)return m.toString();if(f=m.c[0],E=m.e,b==null)I=pr(m.c),I=A==1||A==2&&(E<=u||E>=c)?pc(I,E):uo(I,E,"0");else if(m=L(new v(m),b,w),C=m.e,I=pr(m.c),x=I.length,A==1||A==2&&(b<=C||C<=u)){for(;x<b;I+="0",x++);I=pc(I,C)}else if(b-=E+(A===2&&C>E),I=uo(I,C,"0"),C+1>x){if(--b>0)for(I+=".";b--;I+="0");}else if(b+=C-x,b>0)for(C+1==x&&(I+=".");b--;I+="0");return m.s<0&&f?"-"+I:I}function N(m,b){for(var w,A,f=1,C=new v(m[0]);f<m.length;f++)A=new v(m[f]),(!A.s||(w=si(C,A))===b||w===0&&C.s===b)&&(C=A);return C}function U(m,b,w){for(var A=1,f=b.length;!b[--f];b.pop());for(f=b[0];f>=10;f/=10,A++);return(w=A+w*He-1)>d?m.c=m.e=null:w<l?m.c=[m.e=0]:(m.e=w,m.c=b),m}r=(function(){var m=/^(-?)0([xbo])(?=\w[\w.]*$)/i,b=/^([^.]+)\.$/,w=/^\.([^.]+)$/,A=/^-?(Infinity|NaN)$/,f=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(C,E,x,I){var P,B=x?E:E.replace(f,"");if(A.test(B))C.s=isNaN(B)?null:B<0?-1:1;else{if(!x&&(B=B.replace(m,function(_,k,R){return P=(R=R.toLowerCase())=="x"?16:R=="b"?2:8,!I||I==P?k:_}),I&&(P=I,B=B.replace(b,"$1").replace(w,"0.$1")),E!=B))return new v(B,P);if(v.DEBUG)throw Error(Hn+"Not a"+(I?" base "+I:"")+" number: "+E);C.s=null}C.c=C.e=null}})();function L(m,b,w,A){var f,C,E,x,I,P,B,_=m.c,k=km;if(_){e:{for(f=1,x=_[0];x>=10;x/=10,f++);if(C=b-f,C<0)C+=He,E=b,I=_[P=0],B=dr(I/k[f-E-1]%10);else if(P=wm((C+1)/He),P>=_.length)if(A){for(;_.length<=P;_.push(0));I=B=0,f=1,C%=He,E=C-He+1}else break e;else{for(I=x=_[P],f=1;x>=10;x/=10,f++);C%=He,E=C-He+f,B=E<0?0:dr(I/k[f-E-1]%10)}if(A=A||b<0||_[P+1]!=null||(E<0?I:I%k[f-E-1]),A=w<4?(B||A)&&(w==0||w==(m.s<0?3:2)):B>5||B==5&&(w==4||A||w==6&&(C>0?E>0?I/k[f-E]:0:_[P-1])%10&1||w==(m.s<0?8:7)),b<1||!_[0])return _.length=0,A?(b-=m.e+1,_[0]=k[(He-b%He)%He],m.e=-b||0):_[0]=m.e=0,m;if(C==0?(_.length=P,x=1,P--):(_.length=P+1,x=k[He-C],_[P]=E>0?dr(I/k[f-E]%k[E])*x:0),A)for(;;)if(P==0){for(C=1,E=_[0];E>=10;E/=10,C++);for(E=_[0]+=x,x=1;E>=10;E/=10,x++);C!=x&&(m.e++,_[0]==Pr&&(_[0]=1));break}else{if(_[P]+=x,_[P]!=Pr)break;_[P--]=0,x=1}for(C=_.length;_[--C]===0;_.pop());}m.e>d?m.c=m.e=null:m.e<l&&(m.c=[m.e=0])}return m}function z(m){var b,w=m.e;return w===null?m.toString():(b=pr(m.c),b=w<=u||w>=c?pc(b,w):uo(b,w,"0"),m.s<0?"-"+b:b)}return o.absoluteValue=o.abs=function(){var m=new v(this);return m.s<0&&(m.s=1),m},o.comparedTo=function(m,b){return si(this,new v(m,b))},o.decimalPlaces=o.dp=function(m,b){var w,A,f,C=this;if(m!=null)return Ot(m,0,cn),b==null?b=a:Ot(b,0,8),L(new v(C),m+C.e+1,b);if(!(w=C.c))return null;if(A=((f=w.length-1)-gr(this.e/He))*He,f=w[f])for(;f%10==0;f/=10,A--);return A<0&&(A=0),A},o.dividedBy=o.div=function(m,b){return t(this,new v(m,b),s,a)},o.dividedToIntegerBy=o.idiv=function(m,b){return t(this,new v(m,b),0,1)},o.exponentiatedBy=o.pow=function(m,b){var w,A,f,C,E,x,I,P,B,_=this;if(m=new v(m),m.c&&!m.isInteger())throw Error(Hn+"Exponent not an integer: "+z(m));if(b!=null&&(b=new v(b)),x=m.e>14,!_.c||!_.c[0]||_.c[0]==1&&!_.e&&_.c.length==1||!m.c||!m.c[0])return B=new v(Math.pow(+z(_),x?m.s*(2-uc(m)):+z(m))),b?B.mod(b):B;if(I=m.s<0,b){if(b.c?!b.c[0]:!b.s)return new v(NaN);A=!I&&_.isInteger()&&b.isInteger(),A&&(_=_.mod(b))}else{if(m.e>9&&(_.e>0||_.e<-1||(_.e==0?_.c[0]>1||x&&_.c[1]>=24e7:_.c[0]<8e13||x&&_.c[0]<=9999975e7)))return C=_.s<0&&uc(m)?-0:0,_.e>-1&&(C=1/C),new v(I?1/C:C);h&&(C=wm(h/He+2))}for(x?(w=new v(.5),I&&(m.s=1),P=uc(m)):(f=Math.abs(+z(m)),P=f%2),B=new v(i);;){if(P){if(B=B.times(_),!B.c)break;C?B.c.length>C&&(B.c.length=C):A&&(B=B.mod(b))}if(f){if(f=dr(f/2),f===0)break;P=f%2}else if(m=m.times(w),L(m,m.e+1,1),m.e>14)P=uc(m);else{if(f=+z(m),f===0)break;P=f%2}_=_.times(_),C?_.c&&_.c.length>C&&(_.c.length=C):A&&(_=_.mod(b))}return A?B:(I&&(B=i.div(B)),b?B.mod(b):C?L(B,h,a,E):B)},o.integerValue=function(m){var b=new v(this);return m==null?m=a:Ot(m,0,8),L(b,b.e+1,m)},o.isEqualTo=o.eq=function(m,b){return si(this,new v(m,b))===0},o.isFinite=function(){return!!this.c},o.isGreaterThan=o.gt=function(m,b){return si(this,new v(m,b))>0},o.isGreaterThanOrEqualTo=o.gte=function(m,b){return(b=si(this,new v(m,b)))===1||b===0},o.isInteger=function(){return!!this.c&&gr(this.e/He)>this.c.length-2},o.isLessThan=o.lt=function(m,b){return si(this,new v(m,b))<0},o.isLessThanOrEqualTo=o.lte=function(m,b){return(b=si(this,new v(m,b)))===-1||b===0},o.isNaN=function(){return!this.s},o.isNegative=function(){return this.s<0},o.isPositive=function(){return this.s>0},o.isZero=function(){return!!this.c&&this.c[0]==0},o.minus=function(m,b){var w,A,f,C,E=this,x=E.s;if(m=new v(m,b),b=m.s,!x||!b)return new v(NaN);if(x!=b)return m.s=-b,E.plus(m);var I=E.e/He,P=m.e/He,B=E.c,_=m.c;if(!I||!P){if(!B||!_)return B?(m.s=-b,m):new v(_?E:NaN);if(!B[0]||!_[0])return _[0]?(m.s=-b,m):new v(B[0]?E:a==3?-0:0)}if(I=gr(I),P=gr(P),B=B.slice(),x=I-P){for((C=x<0)?(x=-x,f=B):(P=I,f=_),f.reverse(),b=x;b--;f.push(0));f.reverse()}else for(A=(C=(x=B.length)<(b=_.length))?x:b,x=b=0;b<A;b++)if(B[b]!=_[b]){C=B[b]<_[b];break}if(C&&(f=B,B=_,_=f,m.s=-m.s),b=(A=_.length)-(w=B.length),b>0)for(;b--;B[w++]=0);for(b=Pr-1;A>x;){if(B[--A]<_[A]){for(w=A;w&&!B[--w];B[w]=b);--B[w],B[A]+=Pr}B[A]-=_[A]}for(;B[0]==0;B.splice(0,1),--P);return B[0]?U(m,B,P):(m.s=a==3?-1:1,m.c=[m.e=0],m)},o.modulo=o.mod=function(m,b){var w,A,f=this;return m=new v(m,b),!f.c||!m.s||m.c&&!m.c[0]?new v(NaN):!m.c||f.c&&!f.c[0]?new v(f):(p==9?(A=m.s,m.s=1,w=t(f,m,0,3),m.s=A,w.s*=A):w=t(f,m,0,p),m=f.minus(w.times(m)),!m.c[0]&&p==1&&(m.s=f.s),m)},o.multipliedBy=o.times=function(m,b){var w,A,f,C,E,x,I,P,B,_,k,R,H,M,se,X=this,re=X.c,me=(m=new v(m,b)).c;if(!re||!me||!re[0]||!me[0])return!X.s||!m.s||re&&!re[0]&&!me||me&&!me[0]&&!re?m.c=m.e=m.s=null:(m.s*=X.s,!re||!me?m.c=m.e=null:(m.c=[0],m.e=0)),m;for(A=gr(X.e/He)+gr(m.e/He),m.s*=X.s,I=re.length,_=me.length,I<_&&(H=re,re=me,me=H,f=I,I=_,_=f),f=I+_,H=[];f--;H.push(0));for(M=Pr,se=Bo,f=_;--f>=0;){for(w=0,k=me[f]%se,R=me[f]/se|0,E=I,C=f+E;C>f;)P=re[--E]%se,B=re[E]/se|0,x=R*P+B*k,P=k*P+x%se*se+H[C]+w,w=(P/M|0)+(x/se|0)+R*B,H[C--]=P%M;H[C]=w}return w?++A:H.splice(0,1),U(m,H,A)},o.negated=function(){var m=new v(this);return m.s=-m.s||null,m},o.plus=function(m,b){var w,A=this,f=A.s;if(m=new v(m,b),b=m.s,!f||!b)return new v(NaN);if(f!=b)return m.s=-b,A.minus(m);var C=A.e/He,E=m.e/He,x=A.c,I=m.c;if(!C||!E){if(!x||!I)return new v(f/0);if(!x[0]||!I[0])return I[0]?m:new v(x[0]?A:f*0)}if(C=gr(C),E=gr(E),x=x.slice(),f=C-E){for(f>0?(E=C,w=I):(f=-f,w=x),w.reverse();f--;w.push(0));w.reverse()}for(f=x.length,b=I.length,f-b<0&&(w=I,I=x,x=w,b=f),f=0;b;)f=(x[--b]=x[b]+I[b]+f)/Pr|0,x[b]=Pr===x[b]?0:x[b]%Pr;return f&&(x=[f].concat(x),++E),U(m,x,E)},o.precision=o.sd=function(m,b){var w,A,f,C=this;if(m!=null&&m!==!!m)return Ot(m,1,cn),b==null?b=a:Ot(b,0,8),L(new v(C),m,b);if(!(w=C.c))return null;if(f=w.length-1,A=f*He+1,f=w[f]){for(;f%10==0;f/=10,A--);for(f=w[0];f>=10;f/=10,A++);}return m&&C.e+1>A&&(A=C.e+1),A},o.shiftedBy=function(m){return Ot(m,-vm,vm),this.times("1e"+m)},o.squareRoot=o.sqrt=function(){var m,b,w,A,f,C=this,E=C.c,x=C.s,I=C.e,P=s+4,B=new v("0.5");if(x!==1||!E||!E[0])return new v(!x||x<0&&(!E||E[0])?NaN:E?C:1/0);if(x=Math.sqrt(+z(C)),x==0||x==1/0?(b=pr(E),(b.length+I)%2==0&&(b+="0"),x=Math.sqrt(+b),I=gr((I+1)/2)-(I<0||I%2),x==1/0?b="5e"+I:(b=x.toExponential(),b=b.slice(0,b.indexOf("e")+1)+I),w=new v(b)):w=new v(x+""),w.c[0]){for(I=w.e,x=I+P,x<3&&(x=0);;)if(f=w,w=B.times(f.plus(t(C,f,P,1))),pr(f.c).slice(0,x)===(b=pr(w.c)).slice(0,x))if(w.e<I&&--x,b=b.slice(x-3,x+1),b=="9999"||!A&&b=="4999"){if(!A&&(L(f,f.e+s+2,0),f.times(f).eq(C))){w=f;break}P+=4,x+=4,A=1}else{(!+b||!+b.slice(1)&&b.charAt(0)=="5")&&(L(w,w.e+s+2,1),m=!w.times(w).eq(C));break}}return L(w,w.e+s+1,a,m)},o.toExponential=function(m,b){return m!=null&&(Ot(m,0,cn),m++),D(this,m,b,1)},o.toFixed=function(m,b){return m!=null&&(Ot(m,0,cn),m=m+this.e+1),D(this,m,b)},o.toFormat=function(m,b,w){var A,f=this;if(w==null)m!=null&&b&&typeof b=="object"?(w=b,b=null):m&&typeof m=="object"?(w=m,m=b=null):w=S;else if(typeof w!="object")throw Error(Hn+"Argument not an object: "+w);if(A=f.toFixed(m,b),f.c){var C,E=A.split("."),x=+w.groupSize,I=+w.secondaryGroupSize,P=w.groupSeparator||"",B=E[0],_=E[1],k=f.s<0,R=k?B.slice(1):B,H=R.length;if(I&&(C=x,x=I,I=C,H-=C),x>0&&H>0){for(C=H%x||x,B=R.substr(0,C);C<H;C+=x)B+=P+R.substr(C,x);I>0&&(B+=P+R.slice(C)),k&&(B="-"+B)}A=_?B+(w.decimalSeparator||"")+((I=+w.fractionGroupSize)?_.replace(new RegExp("\\d{"+I+"}\\B","g"),"$&"+(w.fractionGroupSeparator||"")):_):B}return(w.prefix||"")+A+(w.suffix||"")},o.toFraction=function(m){var b,w,A,f,C,E,x,I,P,B,_,k,R=this,H=R.c;if(m!=null&&(x=new v(m),!x.isInteger()&&(x.c||x.s!==1)||x.lt(i)))throw Error(Hn+"Argument "+(x.isInteger()?"out of range: ":"not an integer: ")+z(x));if(!H)return new v(R);for(b=new v(i),P=w=new v(i),A=I=new v(i),k=pr(H),C=b.e=k.length-R.e-1,b.c[0]=km[(E=C%He)<0?He+E:E],m=!m||x.comparedTo(b)>0?C>0?b:P:x,E=d,d=1/0,x=new v(k),I.c[0]=0;B=t(x,b,0,1),f=w.plus(B.times(A)),f.comparedTo(m)!=1;)w=A,A=f,P=I.plus(B.times(f=P)),I=f,b=x.minus(B.times(f=b)),x=f;return f=t(m.minus(w),A,0,1),I=I.plus(f.times(P)),w=w.plus(f.times(A)),I.s=P.s=R.s,C=C*2,_=t(P,A,C,a).minus(R).abs().comparedTo(t(I,w,C,a).minus(R).abs())<1?[P,A]:[I,w],d=E,_},o.toNumber=function(){return+z(this)},o.toPrecision=function(m,b){return m!=null&&Ot(m,1,cn),D(this,m,b,2)},o.toString=function(m){var b,w=this,A=w.s,f=w.e;return f===null?A?(b="Infinity",A<0&&(b="-"+b)):b="NaN":(m==null?b=f<=u||f>=c?pc(pr(w.c),f):uo(pr(w.c),f,"0"):m===10&&F?(w=L(new v(w),s+f+1,a),b=uo(pr(w.c),w.e,"0")):(Ot(m,2,T.length,"Base"),b=n(uo(pr(w.c),f,"0"),10,m,A,!0)),A<0&&w.c[0]&&(b="-"+b)),b},o.valueOf=o.toJSON=function(){return z(this)},o._isBigNumber=!0,o[Symbol.toStringTag]="BigNumber",o[Symbol.for("nodejs.util.inspect.custom")]=o.valueOf,e!=null&&v.set(e),v}function gr(e){var t=e|0;return e>0||e===t?t:t-1}function pr(e){for(var t,n,r=1,o=e.length,i=e[0]+"";r<o;){for(t=e[r++]+"",n=He-t.length;n--;t="0"+t);i+=t}for(o=i.length;i.charCodeAt(--o)===48;);return i.slice(0,o+1||1)}function si(e,t){var n,r,o=e.c,i=t.c,s=e.s,a=t.s,u=e.e,c=t.e;if(!s||!a)return null;if(n=o&&!o[0],r=i&&!i[0],n||r)return n?r?0:-a:s;if(s!=a)return s;if(n=s<0,r=u==c,!o||!i)return r?0:!o^n?1:-1;if(!r)return u>c^n?1:-1;for(a=(u=o.length)<(c=i.length)?u:c,s=0;s<a;s++)if(o[s]!=i[s])return o[s]>i[s]^n?1:-1;return u==c?0:u>c^n?1:-1}function Ot(e,t,n,r){if(e<t||e>n||e!==dr(e))throw Error(Hn+(r||"Argument")+(typeof e=="number"?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function uc(e){var t=e.c.length-1;return gr(e.e/He)==t&&e.c[t]%2!=0}function pc(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function uo(e,t,n){var r,o;if(t<0){for(o=n+".";++t;o+=n);e=o+e}else if(r=e.length,++t>r){for(o=n,t-=r;--t;o+=n);e+=o}else t<r&&(e=e.slice(0,t)+"."+e.slice(t));return e}var eN=Vv(),Gv=eN;var tN=24,ia=32,nN=()=>typeof globalThis<"u"&&globalThis.crypto&&typeof globalThis.crypto.getRandomValues=="function"?()=>{let e=new Uint32Array(1);return globalThis.crypto.getRandomValues(e),e[0]/4294967296}:Math.random,Tm=nN(),Cm=(e=4,t=Tm)=>{let n="";for(;n.length<e;)n=n+Math.floor(t()*36).toString(36);return n};function rN(e){let t=new Gv(0);for(let n of e.values())t=t.multipliedBy(256).plus(n);return t}var Yv=(e="")=>{let t=new TextEncoder;return rN(Hv(t.encode(e))).toString(36).slice(1)},qv=Array.from({length:26},(e,t)=>String.fromCharCode(t+97)),oN=e=>qv[Math.floor(e()*qv.length)],iN=({globalObj:e=typeof global<"u"?global:typeof window<"u"?window:{},random:t=Tm}={})=>{let n=Object.keys(e).toString(),r=n.length?n+Cm(ia,t):Cm(ia,t);return Yv(r).substring(0,ia)},sN=e=>()=>e++,aN=476782367,Kv=({random:e=Tm,counter:t=sN(Math.floor(e()*aN)),length:n=tN,fingerprint:r=iN({random:e})}={})=>{if(n>ia)throw new Error(`Length must be between 2 and ${ia}. Received: ${n}`);return function(){let i=oN(e),s=Date.now().toString(36),a=t().toString(36),u=Cm(n,e),c=`${s+u+a+r}`;return`${i+Yv(c).substring(1,n)}`}},Do=lN(Kv);function lN(e){let t;return()=>(t||(t=e()),t())}var pN=tl(Jv());ln();ze();var dc=/\[([^\]]+)\]\s*\[([^\]]+)\]\s*\[([^\]]+)\]\s*-\s*(.+)/g;function dN(e){return e.replace(/\*\*/g,"").replace(/\*/g,"").replace(/__/g,"").replace(/_/g," ").trim()}function Im(e,t){let n=[],r=e.split(`
|
|
15
15
|
`);for(let s=0;s<r.length;s++){let a=dN(r[s]),u=dc.exec(a);if(u){let[,c,l,,d]=u,g=gN(l),p=fN(r,s+1),h={id:Do(),reviewId:t,type:c.trim(),severity:g,title:d.trim(),description:p.description,file:p.file,lineNumber:p.lineNumber,property:p.property,currentValue:p.currentValue,suggestedValue:p.suggestedValue,suggestedCode:p.suggestedCode,suggestedFix:p.suggestedFix,fixTarget:p.fixTarget,fixRequired:p.fixRequired,status:"pending",selectedForFix:!1,createdAt:new Date};n.push(h)}dc.lastIndex=0}return n.map(s=>{let a=Gs(s);return a.dismissed?(y.debug(`[parseIssues] Auto-dismissed: ${s.title} - ${a.dismissReason}`),{...s,dismissed:!0,dismissReason:a.dismissReason,dismissedBy:a.dismissedBy,dismissedAt:new Date}):s})}function gN(e){let t=e.toLowerCase().trim();return t.includes("critical")||t.includes("high")?"critical":t.includes("major")||t.includes("medium")?"major":"minor"}function fN(e,t){let n={description:"",file:void 0,lineNumber:void 0,property:void 0,currentValue:void 0,suggestedValue:void 0,suggestedCode:void 0,suggestedFix:void 0,fixTarget:void 0,fixRequired:void 0},r=[];for(let o=t;o<e.length;o++){let i=e[o].trim();if(!i||dc.test(i)){dc.lastIndex=0;break}if(i.startsWith("Expected:"))n.suggestedValue=i.replace("Expected:","").trim();else if(i.startsWith("Actual:")||i.startsWith("Current:"))n.currentValue=i.replace(/^(Actual|Current):/,"").trim();else if(i.startsWith("File:")){let s=i.replace("File:","").trim(),a=s.match(/^(.+?):(\d+)$/);a?(n.file=a[1],n.lineNumber=parseInt(a[2],10)):n.file=s}else if(i.startsWith("Property:"))n.property=i.replace("Property:","").trim();else if(i.startsWith("FixTarget:")){let s=i.replace("FixTarget:","").trim().toLowerCase();(s==="css"||s==="component")&&(n.fixTarget=s)}else if(i.startsWith("FixRequired:")){let s=i.replace("FixRequired:","").trim().toLowerCase();n.fixRequired=s==="true"}else if(i.startsWith("Fix:"))n.suggestedFix=i.replace("Fix:","").trim();else if(i.startsWith("```")){let s=[];for(o++;o<e.length&&!e[o].trim().startsWith("```");)s.push(e[o]),o++;n.suggestedCode=s.join(`
|
|
16
16
|
`)}else r.push(i)}return n.description=r.join(" ").trim(),n}ze();var sa=null,Zv=0,mN=3e4;async function hN(){let e=Date.now();if(sa&&e-Zv<mN)return sa;try{let t=await fetch("/index.json");if(!t.ok)throw new Error(`Failed to fetch index.json: ${t.status}`);let n=await t.json();return sa=n.entries||n.stories||{},Zv=e,y.debug("[storyFilePaths] Fetched index.json, entries:",Object.keys(sa).length),sa}catch(t){throw y.error("[storyFilePaths] Error fetching index.json:",t),t}}async function aa(e){try{let n=(await hN())[e];if(!n?.importPath)return y.warn("[storyFilePaths] No importPath found for story:",e),null;let r=n.importPath;y.debug("[storyFilePaths] Found importPath:",r);let o=r.replace(/^\.\//,""),i;n.componentPath?(i=n.componentPath.replace(/^\.\//,""),y.debug("[storyFilePaths] Using Storybook componentPath:",i)):(i=`${o.replace(/\.stories\.tsx$/,"").replace(/\.stories\.ts$/,"").replace(/\.stories\.jsx$/,"").replace(/\.stories\.js$/,"")}.tsx`,y.debug("[storyFilePaths] Derived componentFile:",i));let s=i.replace(/\.tsx$/,".css").replace(/\.ts$/,".css").replace(/\.jsx$/,".css").replace(/\.js$/,".css"),a=i.substring(0,i.lastIndexOf("/")),u={storyFile:o,componentFile:i,cssFile:s,baseDir:a};return y.debug("[storyFilePaths] Final paths:",u),u}catch(t){return y.error("[storyFilePaths] Error getting file paths:",t),null}}function Fm(e,t){if(e==="css")return t.cssFile;if(e==="component")return t.componentFile;if(e==="story")return t.storyFile}function xN(e,t){let n=e.toLowerCase().trim();return["color","spacing","typography","dimension","border","shadow","layout","background","font","size","margin","padding"].some(i=>n.includes(i))?t.cssFile:t.componentFile}function Em(e,t){let n=e.property?.toLowerCase()||"",r=e.domElement?.toLowerCase()||"",o=r.startsWith("svg"),i=r.startsWith("img"),s=n==="width"||n==="height",a=/\[(?:width|height)=/.test(r);return(o||i)&&s||a?(y.debug(`[storyFilePaths] \u{1F50D} INLINE ATTRIBUTE: domElement="${e.domElement}", property="${e.property}" \u2192 component file`),t.componentFile):xN(e.type,t)}ln();ze();function yN(e){let t=(e.description||"").toLowerCase(),n=(e.title||"").toLowerCase(),r=`${t} ${n}`;return r.includes("inner icon")||r.includes("inner vector")?"inner-icon":r.includes("second icon")?"icon-2":r.includes("first icon")?"icon-1":r.includes("icon")||r.includes("vector")||r.includes("svg")?"icon":r.includes("button")?"button":r.includes("text")||r.includes("label")?"text":r.includes("container")||r.includes("wrapper")?"container":"other"}function bN(e){let t=(e.property||"").toLowerCase(),n=(e.description||"").toLowerCase();return t.includes("width")||t.includes("height")||t.includes("size")||t.includes("dimensions")?"dimensions":t.includes("padding")||t.includes("margin")||t.includes("gap")?"spacing":t.includes("color")||t.includes("background")||t.includes("fill")?"colors":t.includes("font")||t.includes("text")||t.includes("line-height")?"typography":t.includes("border")||t.includes("radius")?"border":n.includes("overall")||n.includes("visual fidelity")||n.includes("pixel similarity")||t.includes("overall")?"summary":"other"}function SN(e){let t=(e.property||"").toLowerCase(),n=(e.description||"").toLowerCase();return t.includes("overall")||t.includes("visual fidelity")||n.includes("pixel similarity score")||n.includes("primarily explained by")||n.includes("visual discrepancy")}function wN(e,t,n){let r={critical:3,major:2,minor:1},i=[...e].sort((c,l)=>(r[l.severity]||0)-(r[c.severity]||0))[0],s=e.length,a,u;if(t.includes("icon")&&n==="dimensions"){let c=e.map(d=>d.currentValue).filter(Boolean),l=e.map(d=>d.suggestedValue).filter(Boolean);a=`Icon sizing is incorrect (${s} related issues)`,u=`Icons are rendered at wrong dimensions. Current: ${c[0]||"10px"}, Expected: ${l[0]||"20px"}. This single CSS fix will resolve all ${s} icon dimension issues.`}else a=`${t} ${n} issues (${s} related)`,u=`${s} related ${n} issues for ${t}. ${i.description}`;return{...i,id:`merged-${t}-${n}-${i.id}`,title:a,description:u,currentValue:i.currentValue,suggestedValue:i.suggestedValue,mergedCount:s,mergedIssueIds:e.map(c=>c.id)}}function Am(e){if(!e||e.length===0)return[];let t=e.filter(i=>!SN(i)),n=[],r=[];for(let i of t){let s=yN(i),a=bN(i);s.includes("icon")&&a==="dimensions"?n.push(i):r.push(i)}let o=[];return n.length>0&&(n.length===1?o.push(n[0]):o.push(wN(n,"icon","dimensions"))),o.push(...r),y.debug("[deduplicateIssues] Input:",e.length,"issues, Output:",o.length,"issues"),y.debug("[deduplicateIssues] Removed",e.length-t.length,"summary issues"),y.debug("[deduplicateIssues] Merged",n.length,"icon issues into",n.length>0?1:0),o}ze();ln();var vN=[/Failed to fetch/i,/NetworkError/i,/network request failed/i,/load failed/i,/ERR_(NETWORK|INTERNET|CONNECTION|NAME_NOT_RESOLVED)/i,/timed out/i,/aborted/i],kN=[/credits?/i,/Rate limit/i,/Figma connection expired/i,/Map.*to Figma|Figma mapping required/i,/No project selected/i,/Not authenticated/i,/No story/i,/Monthly review limit/i,/Upgrade your plan/i];function ek(e){let t=e instanceof Error?e.message:typeof e=="string"?e:"Review failed";return kN.some(n=>n.test(t))?t:vN.some(n=>n.test(t))?`Can't reach ${Et.NAME}. Check your internet connection and try again. If the dashboard URL is wrong, fix it in Settings.`:/Unauthorized|401/i.test(t)?"Your session expired. Sign out and back in from Settings to continue.":/Internal Server Error|5\d\d|server error/i.test(t)?`${Et.NAME}'s servers had a hiccup. Try the review again in a moment. If it keeps failing, send feedback.`:/parsing|SSE|stream|structured result|failed to receive/i.test(t)?"Review completed but the result was malformed. Try again, or send feedback if it keeps happening.":`Review failed: ${t}. Try again, or send feedback if this keeps happening.`}Ne();import{addons as Vi}from"storybook/manager-api";var Pm="uireview/badge",Hi={REVIEW_START:"uireview/review-start",REVIEW_COMPLETE:"uireview/review-complete",REVIEW_ERROR:"uireview/review-error"};function CN(e){return e.score<70?"status-value:error":e.score<90?"status-value:warning":"status-value:success"}function TN(e){let t=[`Score: ${e.score}`];return e.criticalCount>0&&t.push(`${e.criticalCount} critical`),e.majorCount>0&&t.push(`${e.majorCount} major`),e.minorCount>0&&t.push(`${e.minorCount} minor`),t.join(" \xB7 ")}function IN(e){return e.score>=90?`\u2713 Score ${e.score}`:e.score>=70?`\u26A0 Score ${e.score}`:`\u2717 Score ${e.score}`}function Wi(){try{let e=localStorage.getItem("uicopilot_feature_flags");return e?!!JSON.parse(e).enableReviewBadges:!1}catch{return!1}}function rk(e){if(Wi())try{Vi.getChannel().emit(Hi.REVIEW_START,{storyId:e})}catch{}}function jr(e,t){if(Wi())try{Vi.getChannel().emit(Hi.REVIEW_COMPLETE,{storyId:e,summary:t})}catch{}}function ok(e){if(Wi())try{Vi.getChannel().emit(Hi.REVIEW_ERROR,{storyId:e})}catch{}}function tk(e){try{typeof e.unset=="function"?e.unset():typeof e.set=="function"&&e.set([])}catch{}}var nk=null;function ik(e){if(nk!==null)return;let t=Vi.getChannel(),n=o=>i=>{Wi()&&o(i)};t.on(Hi.REVIEW_START,n(({storyId:o})=>{e.set([{value:"status-value:pending",typeId:Pm,storyId:o,title:"Reviewing...",description:"AI review in progress"}])})),t.on(Hi.REVIEW_COMPLETE,n(({storyId:o,summary:i})=>{e.set([{value:CN(i),typeId:Pm,storyId:o,title:IN(i),description:TN(i)}])})),t.on(Hi.REVIEW_ERROR,n(({storyId:o})=>{e.set([{value:"status-value:error",typeId:Pm,storyId:o,title:"Review Failed",description:"An error occurred during review"}])}));let r=Wi();r||tk(e),nk=setInterval(()=>{let o=Wi();o!==r&&(r=o,o||tk(e))},1500)}var FN="uireview/mapped",sk="uireview/mappings-updated";function ak(e){try{Vi.getChannel().emit(sk,{storyIds:e})}catch{}}function lk(e){Vi.getChannel().on(sk,({storyIds:n})=>{n.length&&e.set(n.map(r=>({value:"status-value:success",typeId:FN,storyId:r,title:"\u2713 Linked to Figma",description:"Story has a Figma mapping"})))})}var Lm=K(),Mm=180;function Ro(e){if(e==null)return"";if(typeof e=="string")return e;if(typeof e=="object"){let t=e;if("value"in t&&typeof t.value=="string")return t.value;if("top"in t||"left"in t){let n=[t.top,t.right,t.bottom,t.left].filter(Boolean);if(n.length>0)return n.join(" ")}return JSON.stringify(e)}return String(e)}var Bm=()=>{let{isReviewing:e,reviewError:t,reviewResults:n,showReviewMenu:r,severityFilter:o,showStreamingPanel:i,streamingPanelCollapsed:s,streamingMessages:a,streamingProgress:u,streamingStatus:c,selectedModels:l,setIsReviewing:d,setReviewingStoryId:g,setReviewError:p,setReviewResults:h,setShowReviewMenu:S,setSeverityFilter:T,setShowStreamingPanel:F,setStreamingPanelCollapsed:v,addStreamingMessage:D,updateStreamingMessage:N,clearStreamingMessages:U,setStreamingProgress:L,setStreamingStatus:z,setFullPrompt:m,setFullResponse:b,setFigmaImageUrl:w,storybookImageUrl:A,setStorybookImageUrl:f,setFigmaDimensions:C,setMultiModelResults:E,updateMultiModelStreamingMessages:x,setModelCompleted:I,setActiveModelId:P,resetReview:B,addReview:_,setReviewDetailTab:k,includeTextComparison:R,usePromptCache:H,setApplyFixesResult:M,featureFlags:se,roleOverride:X}=ce(),{sessionToken:re,usageData:me,setUsageData:Pe}=we(),{selectedProjectId:qe}=Xe(),{currentStoryId:ge,currentStoryName:Ue}=et(),it=gc(me);it.current=me;let V=gc(null),Se=gc(null),pe=gc({}),st=la((fe,Fe)=>{D({role:fe,content:Fe})},[D]),Ze=la((fe,Fe)=>{L(fe),z(Fe)},[L,z]),bn=la(async fe=>{let{isIteration:Fe=!1,parentReviewId:Y=null}=fe||{};if(!re)throw new Error("Not authenticated");if(!qe)throw new Error("No project selected");if(!ge||!Ue)throw new Error("No story is currently selected in Storybook");if(e){y.debug("[useAIReview] Review already in progress, ignoring duplicate request");return}let je=Date.now();try{d(!0),g(ge),p(null),h(null),k("issues"),M(null),ge&&se.enableReviewBadges&&rk(ge),Se.current&&clearTimeout(Se.current),Se.current=setTimeout(()=>{y.debug(`[useAIReview] Auto-stopping review after ${Mm}s timeout`),V.current&&V.current.abort(),D({role:"system",content:`Review auto-stopped after ${Mm} seconds timeout.`})},Mm*1e3),m(""),b(""),F(!0),v(!1),U(),Ze(0,"Starting review..."),Ze(5,"Refreshing component preview..."),y.debug("[Review] Forcing iframe reload for fresh styles..."),await sc(),y.debug("[Review] Iframe reloaded, styles should be fresh"),Ze(20,"Capturing screenshot & extracting styles..."),y.debug("[Review] Starting parallel data collection...");let[dt,O,j]=await Promise.all([oc({sessionToken:re||void 0}),Promise.resolve(ra()),Promise.resolve(fm())]);if(dt&&dt!==A&&(f(dt),y.debug("[Review] Storybook screenshot captured and set")),!O)throw new Error("Failed to extract styles from component");let{computed:q,declared:W,markup:ae,textElementStyles:he,nestedElementStyles:Rn}=O;j?y.debug("[Review] DOM tree extracted:",{selector:j.selector,childrenCount:j.children.length}):(y.error("[Review] DOM tree extraction FAILED - domTree is null"),y.error("[Review] This will cause AI to use comparison table instead of tree comparison")),Ze(50,"Preparing metadata..."),y.debug("[Review] Current story:",{id:ge,name:Ue});let vt=xt.getState().currentMapping?.figmaNodeId??null,Sr=xt.getState().figmaImageUrl;if(vt&&(y.debug("[Review] Using Figma node ID from store:",vt),Sr&&(Ze(65,"Using existing Figma design..."),y.debug("[Review] Reusing already-loaded Figma image"))),!vt)try{let Ke=await fetch(`${Lm}/api/mappings?projectId=${qe}&storyId=${ge}`,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${re}`}});if(Ke.ok){let Nt=await Ke.json();Nt.mapping?.figmaNodeId?(vt=Nt.mapping.figmaNodeId,y.debug("[Review] Found Figma node ID from API:",vt)):y.debug("[Review] No mapping found for story:",ge)}else y.debug("[Review] Failed to fetch mapping:",Ke.status)}catch(Ke){y.error("[Review] Error fetching mapping:",Ke)}if(vt&&!Sr){Ze(65,"Fetching Figma design...");try{let Ke=await fetch(`${Lm}/api/figma/frames?projectId=${qe}`,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${re}`}});if(Ke.ok){let jt=(await Ke.json()).thumbnails?.[vt];jt?(w(jt),y.debug("[Review] Figma thumbnail fetched and displayed:",jt)):y.warn("[Review] No thumbnail found for node:",vt)}else y.warn("[Review] Failed to fetch Figma frames:",Ke.status)}catch(Ke){y.error("[Review] Error fetching Figma frames:",Ke)}}if(!vt)throw new Error('Figma mapping required. Please link this story to a Figma frame using the "Map to Figma" button before reviewing.');Ze(80,"AI is analyzing your component..."),y.debug("[Review] Sending to streaming API...");let So={projectId:qe,storyId:ge,storyName:Ue,storybookScreenshot:dt,computedStyles:q,declaredStyles:W,textElementStyles:he,nestedElementStyles:Rn,componentMarkup:ae,domTree:j,figmaNodeId:vt,figmaImageUrl:Sr||void 0,aiModels:l,includeTextComparison:R,usePromptCache:H,parentReviewId:Fe?Y:void 0,isIteration:Fe};y.debug("[Review] Request payload:",{...So,storybookScreenshot:dt?`${dt.substring(0,50)}...`:null,domTree:j?{selector:j.selector,childrenCount:j.children.length}:null}),V.current=new AbortController;let $t=await fetch(`${Lm}/api/review/stream`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",Authorization:`Bearer ${re}`,...ac(X)},body:JSON.stringify(So),signal:V.current.signal});if(y.debug("[Review] Response status:",$t.status,$t.statusText),!$t.ok){let Ke=await $t.json();if(y.error("[Review] API error response:",Ke),$t.status===429){let Nt=Ke.retryAfter||60;throw new Error(`Rate limit exceeded. Please wait ${Nt} seconds before trying again.`)}if($t.status===402){if(Ke.code==="INSUFFICIENT_CREDITS"){let Nt=Ke.details?.required??1,jt=Ke.details?.balance??0;throw new Error(`Not enough credits. This review requires ${Nt} credit(s) but you have ${jt}. Visit Settings to add more.`)}throw Ke.code==="SUBSCRIPTION_LIMIT_EXCEEDED"?new Error(Ke.message||"Monthly review limit reached. Upgrade your plan to continue."):new Error(Ke.message||"Payment required")}throw $t.status===401&&Ke.code==="FIGMA_AUTH_EXPIRED"?new Error("Figma connection expired. Open Settings \u2192 Disconnect \u2192 Reconnect Figma to continue."):new Error(Ke.error||Ke.message||"Review request failed")}let Qr=$t.body?.getReader(),wr=new TextDecoder,Iu="",wo="",Oe=null,Fu=null,wy=l.length>1,Qo={},hs={},A9={};if(!Qr)throw new Error("Response body is not readable");let vy=xt.getState().streamingMessages.length;for(st("assistant","");;){let{done:Ke,value:Nt}=await Qr.read();if(Ke)break;Iu+=wr.decode(Nt,{stream:!0});let jt=Iu.split(`
|
|
17
17
|
`);Iu=jt.pop()||"";for(let Xn of jt)if(Xn.startsWith("data: ")){let fn=Xn.slice(6);if(fn==="[DONE]")continue;try{let ie=JSON.parse(fn);if(ie.type!=="text"&&ie.type!=="content"&&y.debug("[Review] SSE Event received:",ie.type),ie.type==="prompt")ie.prompt&&(m(ie.prompt),y.debug("[Review] Prompt received early"));else if(ie.type==="model_started")y.debug("[Review] Model started:",ie.modelId),Qo[ie.modelId]||(Qo[ie.modelId]="",hs[ie.modelId]=[{role:"assistant",content:""}]);else if(ie.type==="text"||ie.type==="content")if(wy&&ie.modelId){Qo[ie.modelId]||(Qo[ie.modelId]="",hs[ie.modelId]=[{role:"assistant",content:""}]),Qo[ie.modelId]+=ie.content,hs[ie.modelId][0].content=Qo[ie.modelId],x(ie.modelId,hs[ie.modelId]);let Kt=Object.entries(Qo).map(([mn,at])=>`[${mn}]
|
|
@@ -215,7 +215,7 @@ ${"=".repeat(40)}
|
|
|
215
215
|
color: ${({theme:e})=>e.color.mediumdark};
|
|
216
216
|
text-align: center;
|
|
217
217
|
opacity: 0.7;
|
|
218
|
-
`,ZV=yr.div(({theme:e})=>({display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"48px 24px",textAlign:"center",gap:"16px"})),e9=yr.div({fontSize:"32px"}),t9=yr.h3(({theme:e})=>({margin:0,fontSize:e.typography.size.s3,fontWeight:e.typography.weight.bold,color:e.color.defaultText})),n9=yr.p(({theme:e})=>({margin:0,fontSize:e.typography.size.s2,color:e.color.mediumdark,maxWidth:"320px",lineHeight:1.5})),ZF=yr.div(({theme:e})=>({display:"flex",alignItems:"center",gap:"10px",padding:"10px 14px",margin:"8px 12px",backgroundColor:`${e.color.warning}15`,border:`1px solid ${e.color.warning}50`,borderRadius:e.appBorderRadius,fontSize:e.typography.size.s2,color:e.color.defaultText})),eE=yr.span({flex:1}),tE=yr.button(({theme:e})=>({padding:"4px 12px",fontSize:11,fontWeight:600,border:`1px solid ${e.color.warning}`,borderRadius:e.appBorderRadius,backgroundColor:"transparent",color:e.color.warning,cursor:"pointer",whiteSpace:"nowrap","&:hover":{backgroundColor:`${e.color.warning}15`}})),nE=()=>{let{selectedProjectId:e,projects:t,loadingProjects:n}=Xe(),{isConnected:r,sessionToken:o,authError:i}=we(),{currentStoryId:s}=et(),{currentReviewId:a,userRole:u,roleOverride:c,setRoleOverride:l,setFeatureFlags:d}=ce(),[g,p]=VV(!1),h=()=>{l(null),o&&fetch(`${K()}/api/addon/flags`,{headers:{Authorization:`Bearer ${o}`}}).then(L=>L.json()).then(L=>{d({enableFixGeneration:!!L.enableFixGeneration,enableFixApply:!!L.enableFixApply,enableAutoMap:!!L.enableAutoMap,enableReviewBadges:!!L.enableReviewBadges,showCosts:!!L.showCosts,enableParallelReview:!!L.enableParallelReview,enableModelSelection:!!L.enableModelSelection})}).catch(()=>{})};Dm(),Qm(),JF(),Hm(),$m();let{notification:S,dismissNotification:T}=XF();GV(()=>{if(S){let L=setTimeout(T,5e3);return()=>clearTimeout(L)}},[S,T]);let F=t.find(L=>L.id===e),v=r&&!!e&&!!F,D=!!o&&!!e&&(n||t.length===0),{loadingMapping:N}=et(),U=v&&!!s&&!a&&N;return zt.createElement(Pu,{header:zt.createElement(Lu,{toolbar:zt.createElement(om,{onOpenSettings:()=>p(!0)})}),footer:zt.createElement(JV,null,Et.NAME," v","0.5.
|
|
218
|
+
`,ZV=yr.div(({theme:e})=>({display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"48px 24px",textAlign:"center",gap:"16px"})),e9=yr.div({fontSize:"32px"}),t9=yr.h3(({theme:e})=>({margin:0,fontSize:e.typography.size.s3,fontWeight:e.typography.weight.bold,color:e.color.defaultText})),n9=yr.p(({theme:e})=>({margin:0,fontSize:e.typography.size.s2,color:e.color.mediumdark,maxWidth:"320px",lineHeight:1.5})),ZF=yr.div(({theme:e})=>({display:"flex",alignItems:"center",gap:"10px",padding:"10px 14px",margin:"8px 12px",backgroundColor:`${e.color.warning}15`,border:`1px solid ${e.color.warning}50`,borderRadius:e.appBorderRadius,fontSize:e.typography.size.s2,color:e.color.defaultText})),eE=yr.span({flex:1}),tE=yr.button(({theme:e})=>({padding:"4px 12px",fontSize:11,fontWeight:600,border:`1px solid ${e.color.warning}`,borderRadius:e.appBorderRadius,backgroundColor:"transparent",color:e.color.warning,cursor:"pointer",whiteSpace:"nowrap","&:hover":{backgroundColor:`${e.color.warning}15`}})),nE=()=>{let{selectedProjectId:e,projects:t,loadingProjects:n}=Xe(),{isConnected:r,sessionToken:o,authError:i}=we(),{currentStoryId:s}=et(),{currentReviewId:a,userRole:u,roleOverride:c,setRoleOverride:l,setFeatureFlags:d}=ce(),[g,p]=VV(!1),h=()=>{l(null),o&&fetch(`${K()}/api/addon/flags`,{headers:{Authorization:`Bearer ${o}`}}).then(L=>L.json()).then(L=>{d({enableFixGeneration:!!L.enableFixGeneration,enableFixApply:!!L.enableFixApply,enableAutoMap:!!L.enableAutoMap,enableReviewBadges:!!L.enableReviewBadges,showCosts:!!L.showCosts,enableParallelReview:!!L.enableParallelReview,enableModelSelection:!!L.enableModelSelection})}).catch(()=>{})};Dm(),Qm(),JF(),Hm(),$m();let{notification:S,dismissNotification:T}=XF();GV(()=>{if(S){let L=setTimeout(T,5e3);return()=>clearTimeout(L)}},[S,T]);let F=t.find(L=>L.id===e),v=r&&!!e&&!!F,D=!!o&&!!e&&(n||t.length===0),{loadingMapping:N}=et(),U=v&&!!s&&!a&&N;return zt.createElement(Pu,{header:zt.createElement(Lu,{toolbar:zt.createElement(om,{onOpenSettings:()=>p(!0)})}),footer:zt.createElement(JV,null,Et.NAME," v","0.5.46")},S&&zt.createElement(YV,{variant:S.variant||"success"},zt.createElement(KV,null,S.variant==="error"?"!":S.variant==="warning"?"\u26A0":"+"),zt.createElement(XV,null,S.message),zt.createElement(QV,{onClick:T},"x")),i&&zt.createElement(ZF,null,zt.createElement("span",null,"\u26A0"),zt.createElement(eE,null,i),zt.createElement(tE,{onClick:()=>p(!0)},"Reconnect")),u==="admin"&&c&&zt.createElement(ZF,null,zt.createElement("span",null,"\u{1F441}"),zt.createElement(eE,null,"Previewing as ",c),zt.createElement(tE,{onClick:h},"Exit preview")),D||U?zt.createElement(gu,{label:D?"Loading...":"Loading review..."}):v?zt.createElement(dy,null):zt.createElement(ZV,null,zt.createElement(e9,null,"\u2699"),zt.createElement(t9,null,i?"Connection issue":`Set up ${Et.NAME}`),zt.createElement(n9,null,i?"Session expired or dashboard unreachable. Please reconnect.":"Connect your account and select a project to start reviewing your components against Figma designs."),zt.createElement(on,{onClick:()=>p(!0)},i?"Reconnect":"Open Settings")),g&&zt.createElement(C1,{onClose:()=>p(!1)}))};import rE,{useCallback as r9}from"react";import{useStorybookApi as o9}from"storybook/manager-api";import{IconButton as i9}from"storybook/internal/components";var s9="uireview",a9=`${s9}/panel`,oE=()=>{let e=o9();u1(e);let t=r9(()=>{e.togglePanel(!0),e.setSelectedPanel(a9)},[e]);return rE.createElement(i9,{key:"uireview-tool",title:"UI Review - Compare with Figma",onClick:t},rE.createElement(jF,null))};ke();import Yt,{useState as Qa,useCallback as lE,useEffect as yy}from"react";import{styled as bo,useTheme as y9}from"storybook/theming";import{addons as ku}from"storybook/manager-api";Ne();ze();import{addons as g9,experimental_getStatusStore as vu}from"storybook/manager-api";async function iE(e,t,n,r){let o=new Array(e.length),i=0;async function s(){for(;i<e.length&&!r();){let a=i++;try{let u=await e[a]();o[a]=u,r()||n(a,u)}catch(u){o[a]=u,r()||n(a,u)}}}return await Promise.all(Array.from({length:Math.min(t,e.length)},()=>s())),o}Ne();ze();var l9=K(),c9="uireview/badge";async function u9(e,t,n=3){for(let r=0;r<=n;r++){let o=await fetch(e,t);if(o.status!==429||r===n)return o;let i=Math.pow(2,r)*1e3;y.warn(`[reviewAll] Rate limited, retrying in ${i}ms`),await new Promise(s=>setTimeout(s,i))}throw new Error("Max retries exceeded")}async function p9(e,t){let n=new TextDecoder,r="",o=null,i=0,s=0,a=0,u=0,c=0,l=0;for(;;){let{done:d,value:g}=await e.read();if(d)break;if(t()){e.cancel();break}r+=n.decode(g,{stream:!0});let p=r.split(`
|
|
219
219
|
`);r=p.pop()||"";for(let h of p)if(h.startsWith("data: "))try{let S=JSON.parse(h.slice(6));if(S.type==="complete"){o=S.complianceScore??S.validation?.complianceScore??null;let F=(S.issues||[]).filter(v=>!v.dismissed);i=F.filter(v=>v.severity==="critical").length,s=F.filter(v=>v.severity==="major").length,a=F.filter(v=>v.severity==="minor").length,u=S.costUsd||0,c=S.inputTokens||0,l=S.outputTokens||0}}catch{}}return{score:o,criticalCount:i,majorCount:s,minorCount:a,costUsd:u,inputTokens:c,outputTokens:l}}function wu(e,t,n,r,o){e&&e.set([{value:n,typeId:c9,storyId:t,title:r,description:o}])}async function d9(e){let t=window.location.origin;try{let n=await fetch(`${t}/__uicopilot/capture?storyId=${encodeURIComponent(e)}`);if(n.ok){let r=await n.json();return{screenshot:r.screenshot||void 0,computedStyles:r.computedStyles||void 0,domTree:r.domTree||void 0}}}catch{}try{let n=await fetch(`${t}/__uicopilot/screenshot?storyId=${encodeURIComponent(e)}`);if(n.ok)return{screenshot:(await n.json()).screenshot||void 0}}catch{}return{}}async function sE(e,t,n,r,o,i){wu(o,e.storyId,"status-value:pending","Reviewing...",e.storyName);try{console.warn(`[reviewAll] Capturing for: ${e.storyName} (${e.storyId})`);let s=await d9(e.storyId);console.warn(`[reviewAll] Captured: screenshot=${!!s.screenshot} domTree=${!!s.domTree} styles=${!!s.computedStyles} for: ${e.storyName}`);let a=await u9(`${l9}/api/review/stream`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify({projectId:n,storyId:e.storyId,storyName:e.storyName,storybookScreenshot:s.screenshot,computedStyles:s.computedStyles,domTree:s.domTree,aiModels:[r]})});if(console.warn(`[reviewAll] API response for ${e.storyName}: HTTP ${a.status}`),!a.ok)throw new Error(`HTTP ${a.status}`);let u=a.body?.getReader();if(!u)throw new Error("No response body");let c=await p9(u,i),{score:l,criticalCount:d,majorCount:g,minorCount:p,costUsd:h,inputTokens:S,outputTokens:T}=c;if(l!==null){let F=d>0||l<70?"status-value:error":g>0||l<90?"status-value:warning":"status-value:success",v=[`Score: ${l}`];d>0&&v.push(`${d} critical`),g>0&&v.push(`${g} major`),p>0&&v.push(`${p} minor`);let D=l>=90?`\u2713 Score ${l}`:l>=70?`\u26A0 Score ${l}`:`\u2717 Score ${l}`;return wu(o,e.storyId,F,D,v.join(" \xB7 ")),{passed:l>=70,score:l,costUsd:h,inputTokens:S,outputTokens:T}}return wu(o,e.storyId,"status-value:error","Review Failed","No score received"),{passed:!1,score:null,costUsd:0,inputTokens:0,outputTokens:0}}catch(s){y.error(`[reviewAll] Failed to review ${e.storyName}:`,s);let a=s instanceof Error?s.message:"Unknown error";return wu(o,e.storyId,"status-value:error","Review Failed",a),{passed:!1,score:null,costUsd:0,inputTokens:0,outputTokens:0}}}var f9=K(),Ya="uireview/badge";function aE(){let e=!1,t=!1;try{let n=g9.getChannel();n.on(hy,async()=>{if(!t){t=!0,e=!1;try{await x9(n,()=>e)}finally{t=!1}}}),n.on(xy,()=>{e=!0})}catch{}}async function my(){try{let e=localStorage.getItem("uicopilot_session_token"),t=localStorage.getItem("uicopilot_selected_project_id");if(!e||!t)return[];let n=await fetch(`${f9}/api/mappings?projectId=${t}`,{headers:{Authorization:`Bearer ${e}`}});if(!n.ok)return[];let i=((await n.json()).mappings||[]).filter(s=>s.figmaNodeId).map(s=>{let a=s;return{storyId:a.storyId,storyName:a.name||a.storyId,figmaNodeId:a.figmaNodeId}});return m9(i),i}catch(e){return y.error("[useReviewAll] Failed to load mapped stories:",e),[]}}function m9(e){try{if(typeof vu!="function")return;let t=vu(Ya);if(!t)return;let n=t.getAll?.()||{},r=new Set(e.map(s=>s.storyId)),o=Object.keys(n).filter(s=>n[s]?.[Ya]&&!r.has(s));o.length>0&&t.unset(o);let i=e.filter(s=>{let a=n[s.storyId]?.[Ya];return!(a?.value==="status-value:success"||a?.value==="status-value:warning"||a?.value==="status-value:error")}).map(s=>({value:"status-value:pending",typeId:Ya,storyId:s.storyId,title:"Mapped to Figma",description:"Ready for UI review \u2014 click Run to start"}));i.length>0&&t.set(i)}catch{}}function h9(){try{let e=localStorage.getItem("uicopilot_review_all_concurrency");if(e)return Math.max(1,Math.min(5,parseInt(e,10)))}catch{}return 3}async function x9(e,t){let n=await my();if(n.length===0){e.emit(Xa,{total:0,passed:0,failed:0});return}let r=localStorage.getItem("uicopilot_session_token"),o=localStorage.getItem("uicopilot_selected_project_id");if(!r||!o)return;let i="claude-sonnet-4-6";try{let S=localStorage.getItem("uicopilot_selected_models");if(S){let T=JSON.parse(S);Array.isArray(T)&&T.length>0&&(i=T[0])}}catch{}let s=null;try{typeof vu=="function"&&(s=vu(Ya))}catch{}let a=h9(),u=0,c=0,l=0,d=0,g=0,p=0;e.emit(Ka,{total:n.length,completed:0,currentStoryName:n[0]?.storyName||""});let h=n.map(S=>()=>sE(S,r,o,i,s,t));await iE(h,a,(S,T)=>{if(T&&typeof T=="object"&&"score"in T){let F=T;F.score!==null&&F.score>=90?u++:F.score!==null&&F.score>=70?c++:l++,d+=F.costUsd||0,g+=F.inputTokens||0,p+=F.outputTokens||0}else l++;console.warn(`[reviewAll] Story ${S+1}/${n.length} done:`,n[S].storyName,T),e.emit(Ka,{total:n.length,completed:u+c+l,currentStoryName:n[S].storyName})},t),e.emit(Xa,{total:n.length,passed:u,failed:l,warnCount:c,costUsd:d,inputTokens:g,outputTokens:p})}var b9=bo.div({padding:"8px 12px",display:"flex",flexDirection:"column",gap:"6px"}),S9=bo.div({display:"flex",alignItems:"center",justifyContent:"space-between",gap:"8px"}),w9=bo.span(({theme:e})=>({fontSize:"12px",fontWeight:500,color:e.color.defaultText})),cE=bo.span(({theme:e})=>({fontSize:"11px",color:e.color.mediumdark})),uE=bo.button(({theme:e,running:t})=>({display:"flex",alignItems:"center",gap:"6px",padding:"4px 12px",background:t?e.color.warning:e.color.secondary,border:"none",borderRadius:"6px",color:e.color.inverseText,cursor:"pointer",fontSize:e.typography.size.s1,fontWeight:e.typography.weight.bold,transition:"all 0.2s","&:disabled":{opacity:.4,cursor:"not-allowed"},"&:hover:not(:disabled)":{opacity:.9}})),v9=bo.div(({theme:e})=>({width:"100%",height:"3px",backgroundColor:e.appBorderColor,borderRadius:"2px",overflow:"hidden"})),k9=bo.div(({theme:e,percent:t})=>({width:`${t}%`,height:"100%",backgroundColor:e.color.secondary,borderRadius:"2px",transition:"width 0.3s ease"})),pE=bo.div(({theme:e})=>({display:"flex",alignItems:"center",gap:`${e.layoutMargin*.8}px`,fontSize:e.typography.size.s1,color:e.color.mediumdark})),ms=bo.span(e=>({display:"flex",alignItems:"center",gap:"3px","&::before":{content:'""',display:"inline-block",width:"7px",height:"7px",borderRadius:"50%",backgroundColor:e.dotColor}})),hy="uireview/review-all-start",xy="uireview/review-all-cancel",Ka="uireview/review-all-progress",Xa="uireview/review-all-complete";function dE(){try{let e=localStorage.getItem("uicopilot_feature_flags");return e?!!JSON.parse(e).enableParallelReview:!1}catch{return!1}}var gE=()=>{let[e,t]=Qa(!1),[n,r]=Qa(null),[o,i]=Qa(null),[s,a]=Qa(null),[u,c]=Qa(dE);yy(()=>{let h=()=>c(dE()),S=setInterval(h,2e3);return window.addEventListener("storage",h),()=>{clearInterval(S),window.removeEventListener("storage",h)}},[]),yy(()=>{let h=()=>{my().then(v=>{a(v.length)}).catch(()=>{})},S=setTimeout(h,3e3),T=null;try{T=ku.getChannel(),T.on("storyChanged",h),T.on("uireview/mappings-changed",h)}catch{}let F=setInterval(h,6e4);return()=>{clearTimeout(S),clearInterval(F),T&&(T.off("storyChanged",h),T.off("uireview/mappings-changed",h))}},[]),yy(()=>{let h;try{h=ku.getChannel()}catch{return}let S=F=>{r(F),t(!0)},T=F=>{t(!1),r(null),i({total:F.total,passed:F.passed,failed:F.failed,warned:F.warnCount||0,costUsd:F.costUsd||0})};return h.on(Ka,S),h.on(Xa,T),()=>{h.off(Ka,S),h.off(Xa,T)}},[]);let l=lE(()=>{try{ku.getChannel().emit(hy),t(!0),i(null)}catch{}},[]),d=lE(()=>{try{ku.getChannel().emit(xy)}catch{}t(!1),r(null)},[]),g=n?Math.round(n.completed/n.total*100):0,p=y9();return u?Yt.createElement(b9,null,Yt.createElement(S9,null,Yt.createElement(w9,null,"UI Review"),e?Yt.createElement(uE,{running:!0,onClick:d},"Cancel"):Yt.createElement(uE,{onClick:l,disabled:!s||s===0},"Run",s?` (${s})`:"")),!e&&o?Yt.createElement(Yt.Fragment,null,Yt.createElement(pE,null,Yt.createElement(ms,{dotColor:p.color.positive},"Pass (",o.passed,")"),Yt.createElement(ms,{dotColor:p.color.warning},"Warn (",o.warned,")"),Yt.createElement(ms,{dotColor:p.color.negative},"Fail (",o.failed,")")),o.costUsd>0&&Yt.createElement(cE,null,"$",o.costUsd.toFixed(3)," \xB7 \u20AA",(o.costUsd*3.6).toFixed(3))):e?null:Yt.createElement(pE,null,Yt.createElement(ms,{dotColor:p.color.positive},"Pass"),Yt.createElement(ms,{dotColor:p.color.warning},"Warn"),Yt.createElement(ms,{dotColor:p.color.negative},"Fail")),e&&n&&Yt.createElement(Yt.Fragment,null,Yt.createElement(v9,null,Yt.createElement(k9,{percent:g})),Yt.createElement(cE,null,"Reviewing ",Math.min(n.completed+1,n.total),"/",n.total," \u2014 ",n.currentStoryName))):null};import*as mE from"@sentry/react";var C9="https://015e961f5f626bad5315430e02940616@o138219.ingest.us.sentry.io/4511134750539776",fE=!1;function T9(){if(typeof window>"u")return"production";let e=window.location.hostname;return/^(localhost|127\.0\.0\.1|0\.0\.0\.0)$/i.test(e)?"localhost":"production"}function hE(){if(!fE){fE=!0;try{mE.init({dsn:C9,environment:T9(),release:`uicopilot-addon@${process.env.npm_package_version||"unknown"}`,tracesSampleRate:0,enabled:!0,beforeSend(e){return e.tags={...e.tags,component:"storybook-addon"},e}})}catch{}}}hE();var Tu="uireview",F9=`${Tu}/panel`,E9=`${Tu}/tool`,xE=`${Tu}/test-provider`;Cu.register(Tu,()=>{if(console.log("[UI Review] Registering addon, checking for StatusStore API..."),typeof Sy=="function"){console.log("[UI Review] StatusStore API available, initializing badges");let t=Sy("uireview/badge");ik(t);let n=Sy("uireview/mapped");lk(n),console.log("[UI Review] Badge listener initialized")}else console.warn("[UI Review] experimental_getStatusStore not available \u2014 badges disabled");Cu.add(E9,{type:by.TOOL,title:"UI Review",match:({viewMode:t})=>t==="story",render:()=>Ja.createElement(oE,null)}),aE(),(()=>{try{let t=localStorage.getItem("uicopilot_feature_flags");return t?!!JSON.parse(t).enableParallelReview:!1}catch{return!1}})()&&Cu.add(xE,{type:by.experimental_TEST_PROVIDER,id:xE,render:()=>Ja.createElement(gE,null)}),Cu.add(F9,{type:by.PANEL,title:"UI Review",match:({viewMode:t})=>t==="story",render:({active:t})=>Ja.createElement(I9,{active:t||!1},Ja.createElement(tm,null,Ja.createElement(nE,null)))})});
|
|
220
220
|
/*! Bundled license information:
|
|
221
221
|
|