builder.io 1.5.13 → 1.5.14
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/cli/index.cjs +39 -45
- package/cli/index.cjs.map +3 -3
- package/core/index.cjs +1 -1
- package/core/index.mjs +1 -1
- package/node/index.cjs +1 -1
- package/node/index.mjs +1 -1
- package/package.json +1 -1
- package/server/index.cjs +84 -92
- package/server/index.mjs +84 -92
- package/types/cli/index.d.ts +0 -2
package/cli/index.cjs
CHANGED
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
`+s,x=y.join(C);D=`[
|
|
13
13
|
`+s+x+`,
|
|
14
14
|
`+g+"]"}return i.pop(),s=g,D}}});var Rm=se((KR,Om)=>{var cw=Fm(),pw=km(),dw={parse:cw,stringify:pw};Om.exports=dw});var wu=se(Xo=>{"use strict";Object.defineProperty(Xo,"__esModule",{value:!0});function zm(e){return Object.prototype.toString.call(e)}Xo.getType=zm;function Sw(e){throw new TypeError("unsupported data type: "+zm(e))}Xo.throwUnknownDataType=Sw});var Iu=se(Qr=>{"use strict";Object.defineProperty(Qr,"__esModule",{value:!0});var Xr="";for(let e=0;e<10;e++){let r=String.fromCharCode(48+e);Xr+=r}for(let e=0;e<26;e++){let r=String.fromCharCode(65+e);Xr+=r}for(let e=0;e<26;e++){let r=String.fromCharCode(97+e);Xr+=r}var vi=Xr.length,Au={};for(let e=0;e<vi;e++){let r=Xr[e];Au[r]=e}function vu(e){let r=0,t=1;for(let n=e.length-1;n>=0;n--){let i=e[n],s=Au[i];s*=t,r+=s,t*=vi}return r}Qr.s_to_int=vu;function qm(e){let r=BigInt(0),t=BigInt(1),n=BigInt(vi);for(let i=e.length-1;i>=0;i--){let s=e[i],o=BigInt(Au[s]);o*=t,r+=o,t*=n}return r}Qr.s_to_big_int=qm;function Pu(e){if(e===0)return Xr[0];let r=[];for(;e!==0;){let t=e%vi,n=Xr[t];r.push(n),e-=t,e/=vi}return r.reverse().join("")}Qr.int_to_s=Pu;function Wm(e){let r=BigInt(0),t=BigInt(vi);if(e===r)return Xr[0];let n=[];for(;e!==r;){let i=e%t,s=Xr[Number(i)];n.push(s),e-=i,e/=t}return n.reverse().join("")}Qr.big_int_to_s=Wm;function Zo(e){return e.split("").reverse().join("")}function Gm(e){if(e<0)return"-"+Gm(-e);let[r,t]=e.toString().split(".");if(!t)return Pu(e);let n;t&&([t,n]=t.split("e")),r=Qo(r),t=Zo(t),t=Qo(t);let i=r+"."+t;if(n){switch(i+=".",n[0]){case"+":n=n.slice(1);break;case"-":i+="-",n=n.slice(1);break}n=Zo(n),n=Qo(n),i+=n}return i}Qr.num_to_s=Gm;function Qo(e){let r=+e;return r.toString()===e?Pu(r):":"+Wm(BigInt(e))}Qr.int_str_to_s=Qo;function Tu(e){return e[0]===":"?qm(e.substring(1)).toString():vu(e).toString()}function Hm(e){if(e[0]==="-")return-Hm(e.substr(1));let[r,t,n]=e.split(".");if(!t)return vu(r);r=Tu(r),t=Tu(t),t=Zo(t);let i=r+"."+t;if(n){i+="e";let s=!1;n[0]==="-"&&(s=!0,n=n.slice(1)),n=Tu(n),n=Zo(n),i+=s?-n:+n}return+i}Qr.s_to_num=Hm});var Fu=se(Zr=>{"use strict";Object.defineProperty(Zr,"__esModule",{value:!0});var Nu=Iu();function ww(e){return"n|"+Nu.num_to_s(e)}Zr.encodeNum=ww;function Tw(e){return e=e.replace("n|",""),Nu.s_to_num(e)}Zr.decodeNum=Tw;function Aw(e){return typeof e=="number"?e:Nu.s_to_int(e)}Zr.decodeKey=Aw;function vw(e){return e?"b|T":"b|F"}Zr.encodeBool=vw;function Pw(e){switch(e){case"b|T":return!0;case"b|F":return!1}return!!e}Zr.decodeBool=Pw;function Iw(e){switch(e[0]+e[1]){case"b|":case"o|":case"n|":case"a|":case"s|":e="s|"+e}return e}Zr.encodeStr=Iw;function Nw(e){return e[0]+e[1]==="s|"?e.substr(2):e}Zr.decodeStr=Nw});var Jm=se(_u=>{"use strict";Object.defineProperty(_u,"__esModule",{value:!0});_u.config={sort_key:!1}});var Ou=se(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});var Fw=Jm(),_w=wu(),ku=Fu(),kw=Iu();function Ow(e){return e.store.toArray()}Hn.memToValues=Ow;function Ym(){let e=[];return{forEach(r){for(let t=0;t<e.length;t++)if(r(e[t])==="break")return},add(r){e.push(r)},toArray(){return e}}}Hn.makeInMemoryStore=Ym;function Xm(){let e=Object.create(null),r=Object.create(null);return{getValue(t){return e[t]},getSchema(t){return r[t]},forEachValue(t){for(let[n,i]of Object.entries(e))if(t(n,i)==="break")return},forEachSchema(t){for(let[n,i]of Object.entries(r))if(t(n,i)==="break")return},setValue(t,n){e[t]=n},setSchema(t,n){r[t]=n},hasValue(t){return t in e},hasSchema(t){return t in r}}}Hn.makeInMemoryCache=Xm;function Rw(){return{store:Ym(),cache:Xm(),keyCount:0}}Hn.makeInMemoryMemory=Rw;function Gn(e,r){if(e.cache.hasValue(r))return e.cache.getValue(r);let t=e.keyCount++,n=kw.num_to_s(t);return e.store.add(r),e.cache.setValue(r,n),n}function Lw(e,r){Fw.config.sort_key&&r.sort();let t=r.join(",");if(e.cache.hasSchema(t))return e.cache.getSchema(t);let n=Ns(e,r,void 0);return e.cache.setSchema(t,n),n}function Ns(e,r,t){if(r===null)return"";switch(typeof r){case"undefined":if(Array.isArray(t))return Ns(e,null,t);break;case"object":if(r===null)return Gn(e,null);if(Array.isArray(r)){let n="a";for(let i=0;i<r.length;i++){let s=r[i],o=s===null?"_":Ns(e,s,r);n+="|"+o}return n==="a"&&(n="a|"),Gn(e,n)}else{let n=Object.keys(r);if(n.length===0)return Gn(e,"o|");let i="o",s=Lw(e,n);i+="|"+s;for(let o of n){let a=r[o],l=Ns(e,a,r);i+="|"+l}return Gn(e,i)}case"boolean":return Gn(e,ku.encodeBool(r));case"number":return Gn(e,ku.encodeNum(r));case"string":return Gn(e,ku.encodeStr(r))}return _w.throwUnknownDataType(r)}Hn.addValue=Ns});var Lu=se(_s=>{"use strict";Object.defineProperty(_s,"__esModule",{value:!0});var Bw=wu(),ea=Fu(),Ru=Ou();function Mw(e){let r=Ru.makeInMemoryMemory(),t=Ru.addValue(r,e,void 0);return[Ru.memToValues(r),t]}_s.compress=Mw;function $w(e,r){if(r==="o|")return{};let t={},n=r.split("|"),i=n[1],s=Fs(e,i),o=n.length;o-2===1&&!Array.isArray(s)&&(s=[s]);for(let a=2;a<o;a++){let l=s[a-2],u=n[a];u=Fs(e,u),t[l]=u}return t}function Uw(e,r){if(r==="a|")return[];let t=r.split("|"),n=t.length-1,i=new Array(n);for(let s=0;s<n;s++){let o=t[s+1];o=Fs(e,o),i[s]=o}return i}function Fs(e,r){if(r===""||r==="_")return null;let t=ea.decodeKey(r),n=e[t];if(n===null)return n;switch(typeof n){case"undefined":return n;case"number":return n;case"string":switch(n[0]+n[1]){case"b|":return ea.decodeBool(n);case"o|":return $w(e,n);case"n|":return ea.decodeNum(n);case"a|":return Uw(e,n);default:return ea.decodeStr(n)}}return Bw.throwUnknownDataType(n)}_s.decode=Fs;function jw(e){let[r,t]=e;return Fs(r,t)}_s.decompress=jw});var Zm=se(ta=>{"use strict";Object.defineProperty(ta,"__esModule",{value:!0});function Kw(e){for(let r in e)e[r]===void 0&&delete e[r]}ta.trimUndefined=Kw;function Vw(e){Qm(e,new Set)}ta.trimUndefinedRecursively=Vw;function Qm(e,r){r.add(e);for(let t in e)if(e[t]===void 0)delete e[t];else{let n=e[t];n&&typeof n=="object"&&!r.has(n)&&Qm(n,r)}}});var rh=se(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});var eh=Lu();Sn.compress=eh.compress;Sn.decompress=eh.decompress;var zw=Lu();Sn.decode=zw.decode;var qw=Ou();Sn.addValue=qw.addValue;var th=Zm();Sn.trimUndefined=th.trimUndefined;Sn.trimUndefinedRecursively=th.trimUndefinedRecursively});var Ng=se((b3,Ig)=>{function yg(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(r=>{let t=e[r],n=typeof t;(n==="object"||n==="function")&&!Object.isFrozen(t)&&yg(t)}),e}var pa=class{constructor(r){r.data===void 0&&(r.data={}),this.data=r.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function Dg(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function An(e,...r){let t=Object.create(null);for(let n in e)t[n]=e[n];return r.forEach(function(n){for(let i in n)t[i]=n[i]}),t}var TT="</span>",pg=e=>!!e.scope,AT=(e,{prefix:r})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){let t=e.split(".");return[`${r}${t.shift()}`,...t.map((n,i)=>`${n}${"_".repeat(i+1)}`)].join(" ")}return`${r}${e}`},Ku=class{constructor(r,t){this.buffer="",this.classPrefix=t.classPrefix,r.walk(this)}addText(r){this.buffer+=Dg(r)}openNode(r){if(!pg(r))return;let t=AT(r.scope,{prefix:this.classPrefix});this.span(t)}closeNode(r){pg(r)&&(this.buffer+=TT)}value(){return this.buffer}span(r){this.buffer+=`<span class="${r}">`}},dg=(e={})=>{let r={children:[]};return Object.assign(r,e),r},Vu=class e{constructor(){this.rootNode=dg(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(r){this.top.children.push(r)}openNode(r){let t=dg({scope:r});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(r){return this.constructor._walk(r,this.rootNode)}static _walk(r,t){return typeof t=="string"?r.addText(t):t.children&&(r.openNode(t),t.children.forEach(n=>this._walk(r,n)),r.closeNode(t)),r}static _collapse(r){typeof r!="string"&&r.children&&(r.children.every(t=>typeof t=="string")?r.children=[r.children.join("")]:r.children.forEach(t=>{e._collapse(t)}))}},zu=class extends Vu{constructor(r){super(),this.options=r}addText(r){r!==""&&this.add(r)}startScope(r){this.openNode(r)}endScope(){this.closeNode()}__addSublanguage(r,t){let n=r.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new Ku(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function ks(e){return e?typeof e=="string"?e:e.source:null}function bg(e){return Yn("(?=",e,")")}function vT(e){return Yn("(?:",e,")*")}function PT(e){return Yn("(?:",e,")?")}function Yn(...e){return e.map(t=>ks(t)).join("")}function IT(e){let r=e[e.length-1];return typeof r=="object"&&r.constructor===Object?(e.splice(e.length-1,1),r):{}}function Wu(...e){return"("+(IT(e).capture?"":"?:")+e.map(n=>ks(n)).join("|")+")"}function xg(e){return new RegExp(e.toString()+"|").exec("").length-1}function NT(e,r){let t=e&&e.exec(r);return t&&t.index===0}var FT=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Gu(e,{joinWith:r}){let t=0;return e.map(n=>{t+=1;let i=t,s=ks(n),o="";for(;s.length>0;){let a=FT.exec(s);if(!a){o+=s;break}o+=s.substring(0,a.index),s=s.substring(a.index+a[0].length),a[0][0]==="\\"&&a[1]?o+="\\"+String(Number(a[1])+i):(o+=a[0],a[0]==="("&&t++)}return o}).map(n=>`(${n})`).join(r)}var _T=/\b\B/,Eg="[a-zA-Z]\\w*",Hu="[a-zA-Z_]\\w*",Cg="\\b\\d+(\\.\\d+)?",Sg="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",wg="\\b(0b[01]+)",kT="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",OT=(e={})=>{let r=/^#![ ]*\//;return e.binary&&(e.begin=Yn(r,/.*\b/,e.binary,/\b.*/)),An({scope:"meta",begin:r,end:/$/,relevance:0,"on:begin":(t,n)=>{t.index!==0&&n.ignoreMatch()}},e)},Os={begin:"\\\\[\\s\\S]",relevance:0},RT={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Os]},LT={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Os]},BT={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},fa=function(e,r,t={}){let n=An({scope:"comment",begin:e,end:r,contains:[]},t);n.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let i=Wu("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return n.contains.push({begin:Yn(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),n},MT=fa("//","$"),$T=fa("/\\*","\\*/"),UT=fa("#","$"),jT={scope:"number",begin:Cg,relevance:0},KT={scope:"number",begin:Sg,relevance:0},VT={scope:"number",begin:wg,relevance:0},zT={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Os,{begin:/\[/,end:/\]/,relevance:0,contains:[Os]}]},qT={scope:"title",begin:Eg,relevance:0},WT={scope:"title",begin:Hu,relevance:0},GT={begin:"\\.\\s*"+Hu,relevance:0},HT=function(e){return Object.assign(e,{"on:begin":(r,t)=>{t.data._beginMatch=r[1]},"on:end":(r,t)=>{t.data._beginMatch!==r[1]&&t.ignoreMatch()}})},ca=Object.freeze({__proto__:null,APOS_STRING_MODE:RT,BACKSLASH_ESCAPE:Os,BINARY_NUMBER_MODE:VT,BINARY_NUMBER_RE:wg,COMMENT:fa,C_BLOCK_COMMENT_MODE:$T,C_LINE_COMMENT_MODE:MT,C_NUMBER_MODE:KT,C_NUMBER_RE:Sg,END_SAME_AS_BEGIN:HT,HASH_COMMENT_MODE:UT,IDENT_RE:Eg,MATCH_NOTHING_RE:_T,METHOD_GUARD:GT,NUMBER_MODE:jT,NUMBER_RE:Cg,PHRASAL_WORDS_MODE:BT,QUOTE_STRING_MODE:LT,REGEXP_MODE:zT,RE_STARTERS_RE:kT,SHEBANG:OT,TITLE_MODE:qT,UNDERSCORE_IDENT_RE:Hu,UNDERSCORE_TITLE_MODE:WT});function JT(e,r){e.input[e.index-1]==="."&&r.ignoreMatch()}function YT(e,r){e.className!==void 0&&(e.scope=e.className,delete e.className)}function XT(e,r){r&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=JT,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function QT(e,r){Array.isArray(e.illegal)&&(e.illegal=Wu(...e.illegal))}function ZT(e,r){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function eA(e,r){e.relevance===void 0&&(e.relevance=1)}var tA=(e,r)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");let t=Object.assign({},e);Object.keys(e).forEach(n=>{delete e[n]}),e.keywords=t.keywords,e.begin=Yn(t.beforeMatch,bg(t.begin)),e.starts={relevance:0,contains:[Object.assign(t,{endsParent:!0})]},e.relevance=0,delete t.beforeMatch},rA=["of","and","for","in","not","or","if","then","parent","list","value"],nA="keyword";function Tg(e,r,t=nA){let n=Object.create(null);return typeof e=="string"?i(t,e.split(" ")):Array.isArray(e)?i(t,e):Object.keys(e).forEach(function(s){Object.assign(n,Tg(e[s],r,s))}),n;function i(s,o){r&&(o=o.map(a=>a.toLowerCase())),o.forEach(function(a){let l=a.split("|");n[l[0]]=[s,iA(l[0],l[1])]})}}function iA(e,r){return r?Number(r):sA(e)?0:1}function sA(e){return rA.includes(e.toLowerCase())}var fg={},Jn=e=>{console.error(e)},mg=(e,...r)=>{console.log(`WARN: ${e}`,...r)},Ni=(e,r)=>{fg[`${e}/${r}`]||(console.log(`Deprecated as of ${e}. ${r}`),fg[`${e}/${r}`]=!0)},da=new Error;function Ag(e,r,{key:t}){let n=0,i=e[t],s={},o={};for(let a=1;a<=r.length;a++)o[a+n]=i[a],s[a+n]=!0,n+=xg(r[a-1]);e[t]=o,e[t]._emit=s,e[t]._multi=!0}function oA(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw Jn("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),da;if(typeof e.beginScope!="object"||e.beginScope===null)throw Jn("beginScope must be object"),da;Ag(e,e.begin,{key:"beginScope"}),e.begin=Gu(e.begin,{joinWith:""})}}function aA(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw Jn("skip, excludeEnd, returnEnd not compatible with endScope: {}"),da;if(typeof e.endScope!="object"||e.endScope===null)throw Jn("endScope must be object"),da;Ag(e,e.end,{key:"endScope"}),e.end=Gu(e.end,{joinWith:""})}}function lA(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function uA(e){lA(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),oA(e),aA(e)}function cA(e){function r(o,a){return new RegExp(ks(o),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(a?"g":""))}class t{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(a,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,a]),this.matchAt+=xg(a)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let a=this.regexes.map(l=>l[1]);this.matcherRe=r(Gu(a,{joinWith:"|"}),!0),this.lastIndex=0}exec(a){this.matcherRe.lastIndex=this.lastIndex;let l=this.matcherRe.exec(a);if(!l)return null;let u=l.findIndex((p,d)=>d>0&&p!==void 0),c=this.matchIndexes[u];return l.splice(0,u),Object.assign(l,c)}}class n{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(a){if(this.multiRegexes[a])return this.multiRegexes[a];let l=new t;return this.rules.slice(a).forEach(([u,c])=>l.addRule(u,c)),l.compile(),this.multiRegexes[a]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(a,l){this.rules.push([a,l]),l.type==="begin"&&this.count++}exec(a){let l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let u=l.exec(a);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){let c=this.getMatcher(0);c.lastIndex=this.lastIndex+1,u=c.exec(a)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function i(o){let a=new n;return o.contains.forEach(l=>a.addRule(l.begin,{rule:l,type:"begin"})),o.terminatorEnd&&a.addRule(o.terminatorEnd,{type:"end"}),o.illegal&&a.addRule(o.illegal,{type:"illegal"}),a}function s(o,a){let l=o;if(o.isCompiled)return l;[YT,ZT,uA,tA].forEach(c=>c(o,a)),e.compilerExtensions.forEach(c=>c(o,a)),o.__beforeBegin=null,[XT,QT,eA].forEach(c=>c(o,a)),o.isCompiled=!0;let u=null;return typeof o.keywords=="object"&&o.keywords.$pattern&&(o.keywords=Object.assign({},o.keywords),u=o.keywords.$pattern,delete o.keywords.$pattern),u=u||/\w+/,o.keywords&&(o.keywords=Tg(o.keywords,e.case_insensitive)),l.keywordPatternRe=r(u,!0),a&&(o.begin||(o.begin=/\B|\b/),l.beginRe=r(l.begin),!o.end&&!o.endsWithParent&&(o.end=/\B|\b/),o.end&&(l.endRe=r(l.end)),l.terminatorEnd=ks(l.end)||"",o.endsWithParent&&a.terminatorEnd&&(l.terminatorEnd+=(o.end?"|":"")+a.terminatorEnd)),o.illegal&&(l.illegalRe=r(o.illegal)),o.contains||(o.contains=[]),o.contains=[].concat(...o.contains.map(function(c){return pA(c==="self"?o:c)})),o.contains.forEach(function(c){s(c,l)}),o.starts&&s(o.starts,a),l.matcher=i(l),l}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=An(e.classNameAliases||{}),s(e)}function vg(e){return e?e.endsWithParent||vg(e.starts):!1}function pA(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(r){return An(e,{variants:null},r)})),e.cachedVariants?e.cachedVariants:vg(e)?An(e,{starts:e.starts?An(e.starts):null}):Object.isFrozen(e)?An(e):e}var dA="11.9.0",qu=class extends Error{constructor(r,t){super(r),this.name="HTMLInjectionError",this.html=t}},ju=Dg,hg=An,gg=Symbol("nomatch"),fA=7,Pg=function(e){let r=Object.create(null),t=Object.create(null),n=[],i=!0,s="Could not find the language '{}', did you forget to load/include a language module?",o={disableAutodetect:!0,name:"Plain text",contains:[]},a={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:zu};function l(F){return a.noHighlightRe.test(F)}function u(F){let M=F.className+" ";M+=F.parentNode?F.parentNode.className:"";let X=a.languageDetectRe.exec(M);if(X){let v=L(X[1]);return v||(mg(s.replace("{}",X[1])),mg("Falling back to no-highlight mode for this block.",F)),v?X[1]:"no-highlight"}return M.split(/\s+/).find(v=>l(v)||L(v))}function c(F,M,X){let v="",I="";typeof M=="object"?(v=F,X=M.ignoreIllegals,I=M.language):(Ni("10.7.0","highlight(lang, code, ...args) has been deprecated."),Ni("10.7.0",`Please use highlight(code, options) instead.
|
|
15
|
-
https://github.com/highlightjs/highlight.js/issues/2277`),I=F,v=M),X===void 0&&(X=!0);let $={code:v,language:I};B("before:highlight",$);let H=$.result?$.result:p($.language,$.code,X);return H.code=$.code,B("after:highlight",H),H}function p(F,M,X,v){let I=Object.create(null);function $(z,Y){return z.keywords[Y]}function H(){if(!le.keywords){Dt.addText(Me);return}let z=0;le.keywordPatternRe.lastIndex=0;let Y=le.keywordPatternRe.exec(Me),pe="";for(;Y;){pe+=Me.substring(z,Y.index);let Fe=Xt.case_insensitive?Y[0].toLowerCase():Y[0],Ct=$(le,Fe);if(Ct){let[qr,KE]=Ct;if(Dt.addText(pe),pe="",I[Fe]=(I[Fe]||0)+1,I[Fe]<=fA&&(So+=KE),qr.startsWith("_"))pe+=Y[0];else{let VE=Xt.classNameAliases[qr]||qr;he(Y[0],VE)}}else pe+=Y[0];z=le.keywordPatternRe.lastIndex,Y=le.keywordPatternRe.exec(Me)}pe+=Me.substring(z),Dt.addText(pe)}function xe(){if(Me==="")return;let z=null;if(typeof le.subLanguage=="string"){if(!r[le.subLanguage]){Dt.addText(Me);return}z=p(le.subLanguage,Me,!0,yd[le.subLanguage]),yd[le.subLanguage]=z._top}else z=f(Me,le.subLanguage.length?le.subLanguage:null);le.relevance>0&&(So+=z.relevance),Dt.__addSublanguage(z._emitter,z.language)}function ae(){le.subLanguage!=null?xe():H(),Me=""}function he(z,Y){z!==""&&(Dt.startScope(Y),Dt.addText(z),Dt.endScope())}function yt(z,Y){let pe=1,Fe=Y.length-1;for(;pe<=Fe;){if(!z._emit[pe]){pe++;continue}let Ct=Xt.classNameAliases[z[pe]]||z[pe],qr=Y[pe];Ct?he(qr,Ct):(Me=qr,H(),Me=""),pe++}}function Pt(z,Y){return z.scope&&typeof z.scope=="string"&&Dt.openNode(Xt.classNameAliases[z.scope]||z.scope),z.beginScope&&(z.beginScope._wrap?(he(Me,Xt.classNameAliases[z.beginScope._wrap]||z.beginScope._wrap),Me=""):z.beginScope._multi&&(yt(z.beginScope,Y),Me="")),le=Object.create(z,{parent:{value:le}}),le}function Kr(z,Y,pe){let Fe=NT(z.endRe,pe);if(Fe){if(z["on:end"]){let Ct=new pa(z);z["on:end"](Y,Ct),Ct.isMatchIgnored&&(Fe=!1)}if(Fe){for(;z.endsParent&&z.parent;)z=z.parent;return z}}if(z.endsWithParent)return Kr(z.parent,Y,pe)}function cs(z){return le.matcher.regexIndex===0?(Me+=z[0],1):(Il=!0,0)}function Vr(z){let Y=z[0],pe=z.rule,Fe=new pa(pe),Ct=[pe.__beforeBegin,pe["on:begin"]];for(let qr of Ct)if(qr&&(qr(z,Fe),Fe.isMatchIgnored))return cs(Y);return pe.skip?Me+=Y:(pe.excludeBegin&&(Me+=Y),ae(),!pe.returnBegin&&!pe.excludeBegin&&(Me=Y)),Pt(pe,z),pe.returnBegin?0:Y.length}function ps(z){let Y=z[0],pe=M.substring(z.index),Fe=Kr(le,z,pe);if(!Fe)return gg;let Ct=le;le.endScope&&le.endScope._wrap?(ae(),he(Y,le.endScope._wrap)):le.endScope&&le.endScope._multi?(ae(),yt(le.endScope,z)):Ct.skip?Me+=Y:(Ct.returnEnd||Ct.excludeEnd||(Me+=Y),ae(),Ct.excludeEnd&&(Me=Y));do le.scope&&Dt.closeNode(),!le.skip&&!le.subLanguage&&(So+=le.relevance),le=le.parent;while(le!==Fe.parent);return Fe.starts&&Pt(Fe.starts,z),Ct.returnEnd?0:Y.length}function ve(){let z=[];for(let Y=le;Y!==Xt;Y=Y.parent)Y.scope&&z.unshift(Y.scope);z.forEach(Y=>Dt.openNode(Y))}let zr={};function hn(z,Y){let pe=Y&&Y[0];if(Me+=z,pe==null)return ae(),0;if(zr.type==="begin"&&Y.type==="end"&&zr.index===Y.index&&pe===""){if(Me+=M.slice(Y.index,Y.index+1),!i){let Fe=new Error(`0 width match regex (${F})`);throw Fe.languageName=F,Fe.badRule=zr.rule,Fe}return 1}if(zr=Y,Y.type==="begin")return Vr(Y);if(Y.type==="illegal"&&!X){let Fe=new Error('Illegal lexeme "'+pe+'" for mode "'+(le.scope||"<unnamed>")+'"');throw Fe.mode=le,Fe}else if(Y.type==="end"){let Fe=ps(Y);if(Fe!==gg)return Fe}if(Y.type==="illegal"&&pe==="")return 1;if(Pl>1e5&&Pl>Y.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Me+=pe,pe.length}let Xt=L(F);if(!Xt)throw Jn(s.replace("{}",F)),new Error('Unknown language: "'+F+'"');let jE=cA(Xt),vl="",le=v||jE,yd={},Dt=new a.__emitter(a);ve();let Me="",So=0,Bn=0,Pl=0,Il=!1;try{if(Xt.__emitTokens)Xt.__emitTokens(M,Dt);else{for(le.matcher.considerAll();;){Pl++,Il?Il=!1:le.matcher.considerAll(),le.matcher.lastIndex=Bn;let z=le.matcher.exec(M);if(!z)break;let Y=M.substring(Bn,z.index),pe=hn(Y,z);Bn=z.index+pe}hn(M.substring(Bn))}return Dt.finalize(),vl=Dt.toHTML(),{language:F,value:vl,relevance:So,illegal:!1,_emitter:Dt,_top:le}}catch(z){if(z.message&&z.message.includes("Illegal"))return{language:F,value:ju(M),illegal:!0,relevance:0,_illegalBy:{message:z.message,index:Bn,context:M.slice(Bn-100,Bn+100),mode:z.mode,resultSoFar:vl},_emitter:Dt};if(i)return{language:F,value:ju(M),illegal:!1,relevance:0,errorRaised:z,_emitter:Dt,_top:le};throw z}}function d(F){let M={value:ju(F),illegal:!1,relevance:0,_top:o,_emitter:new a.__emitter(a)};return M._emitter.addText(F),M}function f(F,M){M=M||a.languages||Object.keys(r);let X=d(F),v=M.filter(L).filter(U).map(ae=>p(ae,F,!1));v.unshift(X);let I=v.sort((ae,he)=>{if(ae.relevance!==he.relevance)return he.relevance-ae.relevance;if(ae.language&&he.language){if(L(ae.language).supersetOf===he.language)return 1;if(L(he.language).supersetOf===ae.language)return-1}return 0}),[$,H]=I,xe=$;return xe.secondBest=H,xe}function m(F,M,X){let v=M&&t[M]||X;F.classList.add("hljs"),F.classList.add(`language-${v}`)}function h(F){let M=null,X=u(F);if(l(X))return;if(B("before:highlightElement",{el:F,language:X}),F.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",F);return}if(F.children.length>0&&(a.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(F)),a.throwUnescapedHTML))throw new qu("One of your code blocks includes unescaped HTML.",F.innerHTML);M=F;let v=M.textContent,I=X?c(v,{language:X,ignoreIllegals:!0}):f(v);F.innerHTML=I.value,F.dataset.highlighted="yes",m(F,X,I.language),F.result={language:I.language,re:I.relevance,relevance:I.relevance},I.secondBest&&(F.secondBest={language:I.secondBest.language,relevance:I.secondBest.relevance}),B("after:highlightElement",{el:F,result:I,text:v})}function g(F){a=hg(a,F)}let y=()=>{x(),Ni("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function D(){x(),Ni("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let C=!1;function x(){if(document.readyState==="loading"){C=!0;return}document.querySelectorAll(a.cssSelector).forEach(h)}function b(){C&&x()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",b,!1);function E(F,M){let X=null;try{X=M(e)}catch(v){if(Jn("Language definition for '{}' could not be registered.".replace("{}",F)),i)Jn(v);else throw v;X=o}X.name||(X.name=F),r[F]=X,X.rawDefinition=M.bind(null,e),X.aliases&&N(X.aliases,{languageName:F})}function T(F){delete r[F];for(let M of Object.keys(t))t[M]===F&&delete t[M]}function O(){return Object.keys(r)}function L(F){return F=(F||"").toLowerCase(),r[F]||r[t[F]]}function N(F,{languageName:M}){typeof F=="string"&&(F=[F]),F.forEach(X=>{t[X.toLowerCase()]=M})}function U(F){let M=L(F);return M&&!M.disableAutodetect}function oe(F){F["before:highlightBlock"]&&!F["before:highlightElement"]&&(F["before:highlightElement"]=M=>{F["before:highlightBlock"](Object.assign({block:M.el},M))}),F["after:highlightBlock"]&&!F["after:highlightElement"]&&(F["after:highlightElement"]=M=>{F["after:highlightBlock"](Object.assign({block:M.el},M))})}function G(F){oe(F),n.push(F)}function P(F){let M=n.indexOf(F);M!==-1&&n.splice(M,1)}function B(F,M){let X=F;n.forEach(function(v){v[X]&&v[X](M)})}function re(F){return Ni("10.7.0","highlightBlock will be removed entirely in v12.0"),Ni("10.7.0","Please use highlightElement now."),h(F)}Object.assign(e,{highlight:c,highlightAuto:f,highlightAll:x,highlightElement:h,highlightBlock:re,configure:g,initHighlighting:y,initHighlightingOnLoad:D,registerLanguage:E,unregisterLanguage:T,listLanguages:O,getLanguage:L,registerAliases:N,autoDetection:U,inherit:hg,addPlugin:G,removePlugin:P}),e.debugMode=function(){i=!1},e.safeMode=function(){i=!0},e.versionString=dA,e.regex={concat:Yn,lookahead:bg,either:Wu,optional:PT,anyNumberOfTimes:vT};for(let F in ca)typeof ca[F]=="object"&&yg(ca[F]);return Object.assign(e,ca),e},Fi=Pg({});Fi.newInstance=()=>Pg({});Ig.exports=Fi;Fi.HighlightJS=Fi;Fi.default=Fi});var Xg=se(rc=>{var Yg="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");rc.encode=function(e){if(0<=e&&e<Yg.length)return Yg[e];throw new TypeError("Must be between 0 and 63: "+e)};rc.decode=function(e){var r=65,t=90,n=97,i=122,s=48,o=57,a=43,l=47,u=26,c=52;return r<=e&&e<=t?e-r:n<=e&&e<=i?e-n+u:s<=e&&e<=o?e-s+c:e==a?62:e==l?63:-1}});var sc=se(ic=>{var Qg=Xg(),nc=5,Zg=1<<nc,ey=Zg-1,ty=Zg;function IA(e){return e<0?(-e<<1)+1:(e<<1)+0}function NA(e){var r=(e&1)===1,t=e>>1;return r?-t:t}ic.encode=function(r){var t="",n,i=IA(r);do n=i&ey,i>>>=nc,i>0&&(n|=ty),t+=Qg.encode(n);while(i>0);return t};ic.decode=function(r,t,n){var i=r.length,s=0,o=0,a,l;do{if(t>=i)throw new Error("Expected more digits in base 64 VLQ value.");if(l=Qg.decode(r.charCodeAt(t++)),l===-1)throw new Error("Invalid base64 digit: "+r.charAt(t-1));a=!!(l&ty),l&=ey,s=s+(l<<o),o+=nc}while(a);n.value=NA(s),n.rest=t}});var Ri=se(mt=>{function FA(e,r,t){if(r in e)return e[r];if(arguments.length===3)return t;throw new Error('"'+r+'" is a required argument.')}mt.getArg=FA;var ry=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,_A=/^data:.+\,.+$/;function Bs(e){var r=e.match(ry);return r?{scheme:r[1],auth:r[2],host:r[3],port:r[4],path:r[5]}:null}mt.urlParse=Bs;function Oi(e){var r="";return e.scheme&&(r+=e.scheme+":"),r+="//",e.auth&&(r+=e.auth+"@"),e.host&&(r+=e.host),e.port&&(r+=":"+e.port),e.path&&(r+=e.path),r}mt.urlGenerate=Oi;var kA=32;function OA(e){var r=[];return function(t){for(var n=0;n<r.length;n++)if(r[n].input===t){var i=r[0];return r[0]=r[n],r[n]=i,r[0].result}var s=e(t);return r.unshift({input:t,result:s}),r.length>kA&&r.pop(),s}}var oc=OA(function(r){var t=r,n=Bs(r);if(n){if(!n.path)return r;t=n.path}for(var i=mt.isAbsolute(t),s=[],o=0,a=0;;)if(o=a,a=t.indexOf("/",o),a===-1){s.push(t.slice(o));break}else for(s.push(t.slice(o,a));a<t.length&&t[a]==="/";)a++;for(var l,u=0,a=s.length-1;a>=0;a--)l=s[a],l==="."?s.splice(a,1):l===".."?u++:u>0&&(l===""?(s.splice(a+1,u),u=0):(s.splice(a,2),u--));return t=s.join("/"),t===""&&(t=i?"/":"."),n?(n.path=t,Oi(n)):t});mt.normalize=oc;function ny(e,r){e===""&&(e="."),r===""&&(r=".");var t=Bs(r),n=Bs(e);if(n&&(e=n.path||"/"),t&&!t.scheme)return n&&(t.scheme=n.scheme),Oi(t);if(t||r.match(_A))return r;if(n&&!n.host&&!n.path)return n.host=r,Oi(n);var i=r.charAt(0)==="/"?r:oc(e.replace(/\/+$/,"")+"/"+r);return n?(n.path=i,Oi(n)):i}mt.join=ny;mt.isAbsolute=function(e){return e.charAt(0)==="/"||ry.test(e)};function RA(e,r){e===""&&(e="."),e=e.replace(/\/$/,"");for(var t=0;r.indexOf(e+"/")!==0;){var n=e.lastIndexOf("/");if(n<0||(e=e.slice(0,n),e.match(/^([^\/]+:\/)?\/*$/)))return r;++t}return Array(t+1).join("../")+r.substr(e.length+1)}mt.relative=RA;var iy=function(){var e=Object.create(null);return!("__proto__"in e)}();function sy(e){return e}function LA(e){return oy(e)?"$"+e:e}mt.toSetString=iy?sy:LA;function BA(e){return oy(e)?e.slice(1):e}mt.fromSetString=iy?sy:BA;function oy(e){if(!e)return!1;var r=e.length;if(r<9||e.charCodeAt(r-1)!==95||e.charCodeAt(r-2)!==95||e.charCodeAt(r-3)!==111||e.charCodeAt(r-4)!==116||e.charCodeAt(r-5)!==111||e.charCodeAt(r-6)!==114||e.charCodeAt(r-7)!==112||e.charCodeAt(r-8)!==95||e.charCodeAt(r-9)!==95)return!1;for(var t=r-10;t>=0;t--)if(e.charCodeAt(t)!==36)return!1;return!0}function MA(e,r,t){var n=tn(e.source,r.source);return n!==0||(n=e.originalLine-r.originalLine,n!==0)||(n=e.originalColumn-r.originalColumn,n!==0||t)||(n=e.generatedColumn-r.generatedColumn,n!==0)||(n=e.generatedLine-r.generatedLine,n!==0)?n:tn(e.name,r.name)}mt.compareByOriginalPositions=MA;function $A(e,r,t){var n;return n=e.originalLine-r.originalLine,n!==0||(n=e.originalColumn-r.originalColumn,n!==0||t)||(n=e.generatedColumn-r.generatedColumn,n!==0)||(n=e.generatedLine-r.generatedLine,n!==0)?n:tn(e.name,r.name)}mt.compareByOriginalPositionsNoSource=$A;function UA(e,r,t){var n=e.generatedLine-r.generatedLine;return n!==0||(n=e.generatedColumn-r.generatedColumn,n!==0||t)||(n=tn(e.source,r.source),n!==0)||(n=e.originalLine-r.originalLine,n!==0)||(n=e.originalColumn-r.originalColumn,n!==0)?n:tn(e.name,r.name)}mt.compareByGeneratedPositionsDeflated=UA;function jA(e,r,t){var n=e.generatedColumn-r.generatedColumn;return n!==0||t||(n=tn(e.source,r.source),n!==0)||(n=e.originalLine-r.originalLine,n!==0)||(n=e.originalColumn-r.originalColumn,n!==0)?n:tn(e.name,r.name)}mt.compareByGeneratedPositionsDeflatedNoLine=jA;function tn(e,r){return e===r?0:e===null?1:r===null?-1:e>r?1:-1}function KA(e,r){var t=e.generatedLine-r.generatedLine;return t!==0||(t=e.generatedColumn-r.generatedColumn,t!==0)||(t=tn(e.source,r.source),t!==0)||(t=e.originalLine-r.originalLine,t!==0)||(t=e.originalColumn-r.originalColumn,t!==0)?t:tn(e.name,r.name)}mt.compareByGeneratedPositionsInflated=KA;function VA(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))}mt.parseSourceMapInput=VA;function zA(e,r,t){if(r=r||"",e&&(e[e.length-1]!=="/"&&r[0]!=="/"&&(e+="/"),r=e+r),t){var n=Bs(t);if(!n)throw new Error("sourceMapURL could not be parsed");if(n.path){var i=n.path.lastIndexOf("/");i>=0&&(n.path=n.path.substring(0,i+1))}r=ny(Oi(n),r)}return oc(r)}mt.computeSourceURL=zA});var uc=se(ay=>{var ac=Ri(),lc=Object.prototype.hasOwnProperty,Qn=typeof Map<"u";function rn(){this._array=[],this._set=Qn?new Map:Object.create(null)}rn.fromArray=function(r,t){for(var n=new rn,i=0,s=r.length;i<s;i++)n.add(r[i],t);return n};rn.prototype.size=function(){return Qn?this._set.size:Object.getOwnPropertyNames(this._set).length};rn.prototype.add=function(r,t){var n=Qn?r:ac.toSetString(r),i=Qn?this.has(r):lc.call(this._set,n),s=this._array.length;(!i||t)&&this._array.push(r),i||(Qn?this._set.set(r,s):this._set[n]=s)};rn.prototype.has=function(r){if(Qn)return this._set.has(r);var t=ac.toSetString(r);return lc.call(this._set,t)};rn.prototype.indexOf=function(r){if(Qn){var t=this._set.get(r);if(t>=0)return t}else{var n=ac.toSetString(r);if(lc.call(this._set,n))return this._set[n]}throw new Error('"'+r+'" is not in the set.')};rn.prototype.at=function(r){if(r>=0&&r<this._array.length)return this._array[r];throw new Error("No element indexed by "+r)};rn.prototype.toArray=function(){return this._array.slice()};ay.ArraySet=rn});var cy=se(uy=>{var ly=Ri();function qA(e,r){var t=e.generatedLine,n=r.generatedLine,i=e.generatedColumn,s=r.generatedColumn;return n>t||n==t&&s>=i||ly.compareByGeneratedPositionsInflated(e,r)<=0}function Da(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}Da.prototype.unsortedForEach=function(r,t){this._array.forEach(r,t)};Da.prototype.add=function(r){qA(this._last,r)?(this._last=r,this._array.push(r)):(this._sorted=!1,this._array.push(r))};Da.prototype.toArray=function(){return this._sorted||(this._array.sort(ly.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};uy.MappingList=Da});var cc=se(py=>{var Ms=sc(),tt=Ri(),ba=uc().ArraySet,WA=cy().MappingList;function nr(e){e||(e={}),this._file=tt.getArg(e,"file",null),this._sourceRoot=tt.getArg(e,"sourceRoot",null),this._skipValidation=tt.getArg(e,"skipValidation",!1),this._ignoreInvalidMapping=tt.getArg(e,"ignoreInvalidMapping",!1),this._sources=new ba,this._names=new ba,this._mappings=new WA,this._sourcesContents=null}nr.prototype._version=3;nr.fromSourceMap=function(r,t){var n=r.sourceRoot,i=new nr(Object.assign(t||{},{file:r.file,sourceRoot:n}));return r.eachMapping(function(s){var o={generated:{line:s.generatedLine,column:s.generatedColumn}};s.source!=null&&(o.source=s.source,n!=null&&(o.source=tt.relative(n,o.source)),o.original={line:s.originalLine,column:s.originalColumn},s.name!=null&&(o.name=s.name)),i.addMapping(o)}),r.sources.forEach(function(s){var o=s;n!==null&&(o=tt.relative(n,s)),i._sources.has(o)||i._sources.add(o);var a=r.sourceContentFor(s);a!=null&&i.setSourceContent(s,a)}),i};nr.prototype.addMapping=function(r){var t=tt.getArg(r,"generated"),n=tt.getArg(r,"original",null),i=tt.getArg(r,"source",null),s=tt.getArg(r,"name",null);!this._skipValidation&&this._validateMapping(t,n,i,s)===!1||(i!=null&&(i=String(i),this._sources.has(i)||this._sources.add(i)),s!=null&&(s=String(s),this._names.has(s)||this._names.add(s)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:i,name:s}))};nr.prototype.setSourceContent=function(r,t){var n=r;this._sourceRoot!=null&&(n=tt.relative(this._sourceRoot,n)),t!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[tt.toSetString(n)]=t):this._sourcesContents&&(delete this._sourcesContents[tt.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};nr.prototype.applySourceMap=function(r,t,n){var i=t;if(t==null){if(r.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);i=r.file}var s=this._sourceRoot;s!=null&&(i=tt.relative(s,i));var o=new ba,a=new ba;this._mappings.unsortedForEach(function(l){if(l.source===i&&l.originalLine!=null){var u=r.originalPositionFor({line:l.originalLine,column:l.originalColumn});u.source!=null&&(l.source=u.source,n!=null&&(l.source=tt.join(n,l.source)),s!=null&&(l.source=tt.relative(s,l.source)),l.originalLine=u.line,l.originalColumn=u.column,u.name!=null&&(l.name=u.name))}var c=l.source;c!=null&&!o.has(c)&&o.add(c);var p=l.name;p!=null&&!a.has(p)&&a.add(p)},this),this._sources=o,this._names=a,r.sources.forEach(function(l){var u=r.sourceContentFor(l);u!=null&&(n!=null&&(l=tt.join(n,l)),s!=null&&(l=tt.relative(s,l)),this.setSourceContent(l,u))},this)};nr.prototype._validateMapping=function(r,t,n,i){if(t&&typeof t.line!="number"&&typeof t.column!="number"){var s="original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.";if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(s),!1;throw new Error(s)}if(!(r&&"line"in r&&"column"in r&&r.line>0&&r.column>=0&&!t&&!n&&!i)){if(r&&"line"in r&&"column"in r&&t&&"line"in t&&"column"in t&&r.line>0&&r.column>=0&&t.line>0&&t.column>=0&&n)return;var s="Invalid mapping: "+JSON.stringify({generated:r,source:n,original:t,name:i});if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(s),!1;throw new Error(s)}};nr.prototype._serializeMappings=function(){for(var r=0,t=1,n=0,i=0,s=0,o=0,a="",l,u,c,p,d=this._mappings.toArray(),f=0,m=d.length;f<m;f++){if(u=d[f],l="",u.generatedLine!==t)for(r=0;u.generatedLine!==t;)l+=";",t++;else if(f>0){if(!tt.compareByGeneratedPositionsInflated(u,d[f-1]))continue;l+=","}l+=Ms.encode(u.generatedColumn-r),r=u.generatedColumn,u.source!=null&&(p=this._sources.indexOf(u.source),l+=Ms.encode(p-o),o=p,l+=Ms.encode(u.originalLine-1-i),i=u.originalLine-1,l+=Ms.encode(u.originalColumn-n),n=u.originalColumn,u.name!=null&&(c=this._names.indexOf(u.name),l+=Ms.encode(c-s),s=c)),a+=l}return a};nr.prototype._generateSourcesContent=function(r,t){return r.map(function(n){if(!this._sourcesContents)return null;t!=null&&(n=tt.relative(t,n));var i=tt.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,i)?this._sourcesContents[i]:null},this)};nr.prototype.toJSON=function(){var r={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(r.file=this._file),this._sourceRoot!=null&&(r.sourceRoot=this._sourceRoot),this._sourcesContents&&(r.sourcesContent=this._generateSourcesContent(r.sources,r.sourceRoot)),r};nr.prototype.toString=function(){return JSON.stringify(this.toJSON())};py.SourceMapGenerator=nr});var dy=se(Zn=>{Zn.GREATEST_LOWER_BOUND=1;Zn.LEAST_UPPER_BOUND=2;function pc(e,r,t,n,i,s){var o=Math.floor((r-e)/2)+e,a=i(t,n[o],!0);return a===0?o:a>0?r-o>1?pc(o,r,t,n,i,s):s==Zn.LEAST_UPPER_BOUND?r<n.length?r:-1:o:o-e>1?pc(e,o,t,n,i,s):s==Zn.LEAST_UPPER_BOUND?o:e<0?-1:e}Zn.search=function(r,t,n,i){if(t.length===0)return-1;var s=pc(-1,t.length,r,t,n,i||Zn.GREATEST_LOWER_BOUND);if(s<0)return-1;for(;s-1>=0&&n(t[s],t[s-1],!0)===0;)--s;return s}});var hy=se(my=>{function GA(e){function r(i,s,o){var a=i[s];i[s]=i[o],i[o]=a}function t(i,s){return Math.round(i+Math.random()*(s-i))}function n(i,s,o,a){if(o<a){var l=t(o,a),u=o-1;r(i,l,a);for(var c=i[a],p=o;p<a;p++)s(i[p],c,!1)<=0&&(u+=1,r(i,u,p));r(i,u+1,p);var d=u+1;n(i,s,o,d-1),n(i,s,d+1,a)}}return n}function HA(e){let r=GA.toString();return new Function(`return ${r}`)()(e)}var fy=new WeakMap;my.quickSort=function(e,r,t=0){let n=fy.get(r);n===void 0&&(n=HA(r),fy.set(r,n)),n(e,r,t,e.length-1)}});var Dy=se(xa=>{var W=Ri(),fc=dy(),Li=uc().ArraySet,JA=sc(),$s=hy().quickSort;function Ke(e,r){var t=e;return typeof e=="string"&&(t=W.parseSourceMapInput(e)),t.sections!=null?new mr(t,r):new bt(t,r)}Ke.fromSourceMap=function(e,r){return bt.fromSourceMap(e,r)};Ke.prototype._version=3;Ke.prototype.__generatedMappings=null;Object.defineProperty(Ke.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}});Ke.prototype.__originalMappings=null;Object.defineProperty(Ke.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}});Ke.prototype._charIsMappingSeparator=function(r,t){var n=r.charAt(t);return n===";"||n===","};Ke.prototype._parseMappings=function(r,t){throw new Error("Subclasses must implement _parseMappings")};Ke.GENERATED_ORDER=1;Ke.ORIGINAL_ORDER=2;Ke.GREATEST_LOWER_BOUND=1;Ke.LEAST_UPPER_BOUND=2;Ke.prototype.eachMapping=function(r,t,n){var i=t||null,s=n||Ke.GENERATED_ORDER,o;switch(s){case Ke.GENERATED_ORDER:o=this._generatedMappings;break;case Ke.ORIGINAL_ORDER:o=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}for(var a=this.sourceRoot,l=r.bind(i),u=this._names,c=this._sources,p=this._sourceMapURL,d=0,f=o.length;d<f;d++){var m=o[d],h=m.source===null?null:c.at(m.source);h!==null&&(h=W.computeSourceURL(a,h,p)),l({source:h,generatedLine:m.generatedLine,generatedColumn:m.generatedColumn,originalLine:m.originalLine,originalColumn:m.originalColumn,name:m.name===null?null:u.at(m.name)})}};Ke.prototype.allGeneratedPositionsFor=function(r){var t=W.getArg(r,"line"),n={source:W.getArg(r,"source"),originalLine:t,originalColumn:W.getArg(r,"column",0)};if(n.source=this._findSourceIndex(n.source),n.source<0)return[];var i=[],s=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",W.compareByOriginalPositions,fc.LEAST_UPPER_BOUND);if(s>=0){var o=this._originalMappings[s];if(r.column===void 0)for(var a=o.originalLine;o&&o.originalLine===a;)i.push({line:W.getArg(o,"generatedLine",null),column:W.getArg(o,"generatedColumn",null),lastColumn:W.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++s];else for(var l=o.originalColumn;o&&o.originalLine===t&&o.originalColumn==l;)i.push({line:W.getArg(o,"generatedLine",null),column:W.getArg(o,"generatedColumn",null),lastColumn:W.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++s]}return i};xa.SourceMapConsumer=Ke;function bt(e,r){var t=e;typeof e=="string"&&(t=W.parseSourceMapInput(e));var n=W.getArg(t,"version"),i=W.getArg(t,"sources"),s=W.getArg(t,"names",[]),o=W.getArg(t,"sourceRoot",null),a=W.getArg(t,"sourcesContent",null),l=W.getArg(t,"mappings"),u=W.getArg(t,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);o&&(o=W.normalize(o)),i=i.map(String).map(W.normalize).map(function(c){return o&&W.isAbsolute(o)&&W.isAbsolute(c)?W.relative(o,c):c}),this._names=Li.fromArray(s.map(String),!0),this._sources=Li.fromArray(i,!0),this._absoluteSources=this._sources.toArray().map(function(c){return W.computeSourceURL(o,c,r)}),this.sourceRoot=o,this.sourcesContent=a,this._mappings=l,this._sourceMapURL=r,this.file=u}bt.prototype=Object.create(Ke.prototype);bt.prototype.consumer=Ke;bt.prototype._findSourceIndex=function(e){var r=e;if(this.sourceRoot!=null&&(r=W.relative(this.sourceRoot,r)),this._sources.has(r))return this._sources.indexOf(r);var t;for(t=0;t<this._absoluteSources.length;++t)if(this._absoluteSources[t]==e)return t;return-1};bt.fromSourceMap=function(r,t){var n=Object.create(bt.prototype),i=n._names=Li.fromArray(r._names.toArray(),!0),s=n._sources=Li.fromArray(r._sources.toArray(),!0);n.sourceRoot=r._sourceRoot,n.sourcesContent=r._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=r._file,n._sourceMapURL=t,n._absoluteSources=n._sources.toArray().map(function(f){return W.computeSourceURL(n.sourceRoot,f,t)});for(var o=r._mappings.toArray().slice(),a=n.__generatedMappings=[],l=n.__originalMappings=[],u=0,c=o.length;u<c;u++){var p=o[u],d=new yy;d.generatedLine=p.generatedLine,d.generatedColumn=p.generatedColumn,p.source&&(d.source=s.indexOf(p.source),d.originalLine=p.originalLine,d.originalColumn=p.originalColumn,p.name&&(d.name=i.indexOf(p.name)),l.push(d)),a.push(d)}return $s(n.__originalMappings,W.compareByOriginalPositions),n};bt.prototype._version=3;Object.defineProperty(bt.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function yy(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}var dc=W.compareByGeneratedPositionsDeflatedNoLine;function gy(e,r){let t=e.length,n=e.length-r;if(!(n<=1))if(n==2){let i=e[r],s=e[r+1];dc(i,s)>0&&(e[r]=s,e[r+1]=i)}else if(n<20)for(let i=r;i<t;i++)for(let s=i;s>r;s--){let o=e[s-1],a=e[s];if(dc(o,a)<=0)break;e[s-1]=a,e[s]=o}else $s(e,dc,r)}bt.prototype._parseMappings=function(r,t){var n=1,i=0,s=0,o=0,a=0,l=0,u=r.length,c=0,p={},d={},f=[],m=[],h,g,y,D,C;let x=0;for(;c<u;)if(r.charAt(c)===";")n++,c++,i=0,gy(m,x),x=m.length;else if(r.charAt(c)===",")c++;else{for(h=new yy,h.generatedLine=n,D=c;D<u&&!this._charIsMappingSeparator(r,D);D++);for(g=r.slice(c,D),y=[];c<D;)JA.decode(r,c,d),C=d.value,c=d.rest,y.push(C);if(y.length===2)throw new Error("Found a source, but no line and column");if(y.length===3)throw new Error("Found a source and line, but no column");if(h.generatedColumn=i+y[0],i=h.generatedColumn,y.length>1&&(h.source=a+y[1],a+=y[1],h.originalLine=s+y[2],s=h.originalLine,h.originalLine+=1,h.originalColumn=o+y[3],o=h.originalColumn,y.length>4&&(h.name=l+y[4],l+=y[4])),m.push(h),typeof h.originalLine=="number"){let E=h.source;for(;f.length<=E;)f.push(null);f[E]===null&&(f[E]=[]),f[E].push(h)}}gy(m,x),this.__generatedMappings=m;for(var b=0;b<f.length;b++)f[b]!=null&&$s(f[b],W.compareByOriginalPositionsNoSource);this.__originalMappings=[].concat(...f)};bt.prototype._findMapping=function(r,t,n,i,s,o){if(r[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+r[n]);if(r[i]<0)throw new TypeError("Column must be greater than or equal to 0, got "+r[i]);return fc.search(r,t,s,o)};bt.prototype.computeColumnSpans=function(){for(var r=0;r<this._generatedMappings.length;++r){var t=this._generatedMappings[r];if(r+1<this._generatedMappings.length){var n=this._generatedMappings[r+1];if(t.generatedLine===n.generatedLine){t.lastGeneratedColumn=n.generatedColumn-1;continue}}t.lastGeneratedColumn=1/0}};bt.prototype.originalPositionFor=function(r){var t={generatedLine:W.getArg(r,"line"),generatedColumn:W.getArg(r,"column")},n=this._findMapping(t,this._generatedMappings,"generatedLine","generatedColumn",W.compareByGeneratedPositionsDeflated,W.getArg(r,"bias",Ke.GREATEST_LOWER_BOUND));if(n>=0){var i=this._generatedMappings[n];if(i.generatedLine===t.generatedLine){var s=W.getArg(i,"source",null);s!==null&&(s=this._sources.at(s),s=W.computeSourceURL(this.sourceRoot,s,this._sourceMapURL));var o=W.getArg(i,"name",null);return o!==null&&(o=this._names.at(o)),{source:s,line:W.getArg(i,"originalLine",null),column:W.getArg(i,"originalColumn",null),name:o}}}return{source:null,line:null,column:null,name:null}};bt.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(r){return r==null}):!1};bt.prototype.sourceContentFor=function(r,t){if(!this.sourcesContent)return null;var n=this._findSourceIndex(r);if(n>=0)return this.sourcesContent[n];var i=r;this.sourceRoot!=null&&(i=W.relative(this.sourceRoot,i));var s;if(this.sourceRoot!=null&&(s=W.urlParse(this.sourceRoot))){var o=i.replace(/^file:\/\//,"");if(s.scheme=="file"&&this._sources.has(o))return this.sourcesContent[this._sources.indexOf(o)];if((!s.path||s.path=="/")&&this._sources.has("/"+i))return this.sourcesContent[this._sources.indexOf("/"+i)]}if(t)return null;throw new Error('"'+i+'" is not in the SourceMap.')};bt.prototype.generatedPositionFor=function(r){var t=W.getArg(r,"source");if(t=this._findSourceIndex(t),t<0)return{line:null,column:null,lastColumn:null};var n={source:t,originalLine:W.getArg(r,"line"),originalColumn:W.getArg(r,"column")},i=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",W.compareByOriginalPositions,W.getArg(r,"bias",Ke.GREATEST_LOWER_BOUND));if(i>=0){var s=this._originalMappings[i];if(s.source===n.source)return{line:W.getArg(s,"generatedLine",null),column:W.getArg(s,"generatedColumn",null),lastColumn:W.getArg(s,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};xa.BasicSourceMapConsumer=bt;function mr(e,r){var t=e;typeof e=="string"&&(t=W.parseSourceMapInput(e));var n=W.getArg(t,"version"),i=W.getArg(t,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new Li,this._names=new Li;var s={line:-1,column:0};this._sections=i.map(function(o){if(o.url)throw new Error("Support for url field in sections not implemented.");var a=W.getArg(o,"offset"),l=W.getArg(a,"line"),u=W.getArg(a,"column");if(l<s.line||l===s.line&&u<s.column)throw new Error("Section offsets must be ordered and non-overlapping.");return s=a,{generatedOffset:{generatedLine:l+1,generatedColumn:u+1},consumer:new Ke(W.getArg(o,"map"),r)}})}mr.prototype=Object.create(Ke.prototype);mr.prototype.constructor=Ke;mr.prototype._version=3;Object.defineProperty(mr.prototype,"sources",{get:function(){for(var e=[],r=0;r<this._sections.length;r++)for(var t=0;t<this._sections[r].consumer.sources.length;t++)e.push(this._sections[r].consumer.sources[t]);return e}});mr.prototype.originalPositionFor=function(r){var t={generatedLine:W.getArg(r,"line"),generatedColumn:W.getArg(r,"column")},n=fc.search(t,this._sections,function(s,o){var a=s.generatedLine-o.generatedOffset.generatedLine;return a||s.generatedColumn-o.generatedOffset.generatedColumn}),i=this._sections[n];return i?i.consumer.originalPositionFor({line:t.generatedLine-(i.generatedOffset.generatedLine-1),column:t.generatedColumn-(i.generatedOffset.generatedLine===t.generatedLine?i.generatedOffset.generatedColumn-1:0),bias:r.bias}):{source:null,line:null,column:null,name:null}};mr.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(r){return r.consumer.hasContentsOfAllSources()})};mr.prototype.sourceContentFor=function(r,t){for(var n=0;n<this._sections.length;n++){var i=this._sections[n],s=i.consumer.sourceContentFor(r,!0);if(s||s==="")return s}if(t)return null;throw new Error('"'+r+'" is not in the SourceMap.')};mr.prototype.generatedPositionFor=function(r){for(var t=0;t<this._sections.length;t++){var n=this._sections[t];if(n.consumer._findSourceIndex(W.getArg(r,"source"))!==-1){var i=n.consumer.generatedPositionFor(r);if(i){var s={line:i.line+(n.generatedOffset.generatedLine-1),column:i.column+(n.generatedOffset.generatedLine===i.line?n.generatedOffset.generatedColumn-1:0)};return s}}}return{line:null,column:null}};mr.prototype._parseMappings=function(r,t){this.__generatedMappings=[],this.__originalMappings=[];for(var n=0;n<this._sections.length;n++)for(var i=this._sections[n],s=i.consumer._generatedMappings,o=0;o<s.length;o++){var a=s[o],l=i.consumer._sources.at(a.source);l!==null&&(l=W.computeSourceURL(i.consumer.sourceRoot,l,this._sourceMapURL)),this._sources.add(l),l=this._sources.indexOf(l);var u=null;a.name&&(u=i.consumer._names.at(a.name),this._names.add(u),u=this._names.indexOf(u));var c={source:l,generatedLine:a.generatedLine+(i.generatedOffset.generatedLine-1),generatedColumn:a.generatedColumn+(i.generatedOffset.generatedLine===a.generatedLine?i.generatedOffset.generatedColumn-1:0),originalLine:a.originalLine,originalColumn:a.originalColumn,name:u};this.__generatedMappings.push(c),typeof c.originalLine=="number"&&this.__originalMappings.push(c)}$s(this.__generatedMappings,W.compareByGeneratedPositionsDeflated),$s(this.__originalMappings,W.compareByOriginalPositions)};xa.IndexedSourceMapConsumer=mr});var xy=se(by=>{var YA=cc().SourceMapGenerator,Ea=Ri(),XA=/(\r?\n)/,QA=10,Bi="$$$isSourceNode$$$";function Gt(e,r,t,n,i){this.children=[],this.sourceContents={},this.line=e??null,this.column=r??null,this.source=t??null,this.name=i??null,this[Bi]=!0,n!=null&&this.add(n)}Gt.fromStringWithSourceMap=function(r,t,n){var i=new Gt,s=r.split(XA),o=0,a=function(){var d=m(),f=m()||"";return d+f;function m(){return o<s.length?s[o++]:void 0}},l=1,u=0,c=null;return t.eachMapping(function(d){if(c!==null)if(l<d.generatedLine)p(c,a()),l++,u=0;else{var f=s[o]||"",m=f.substr(0,d.generatedColumn-u);s[o]=f.substr(d.generatedColumn-u),u=d.generatedColumn,p(c,m),c=d;return}for(;l<d.generatedLine;)i.add(a()),l++;if(u<d.generatedColumn){var f=s[o]||"";i.add(f.substr(0,d.generatedColumn)),s[o]=f.substr(d.generatedColumn),u=d.generatedColumn}c=d},this),o<s.length&&(c&&p(c,a()),i.add(s.splice(o).join(""))),t.sources.forEach(function(d){var f=t.sourceContentFor(d);f!=null&&(n!=null&&(d=Ea.join(n,d)),i.setSourceContent(d,f))}),i;function p(d,f){if(d===null||d.source===void 0)i.add(f);else{var m=n?Ea.join(n,d.source):d.source;i.add(new Gt(d.originalLine,d.originalColumn,m,f,d.name))}}};Gt.prototype.add=function(r){if(Array.isArray(r))r.forEach(function(t){this.add(t)},this);else if(r[Bi]||typeof r=="string")r&&this.children.push(r);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+r);return this};Gt.prototype.prepend=function(r){if(Array.isArray(r))for(var t=r.length-1;t>=0;t--)this.prepend(r[t]);else if(r[Bi]||typeof r=="string")this.children.unshift(r);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+r);return this};Gt.prototype.walk=function(r){for(var t,n=0,i=this.children.length;n<i;n++)t=this.children[n],t[Bi]?t.walk(r):t!==""&&r(t,{source:this.source,line:this.line,column:this.column,name:this.name})};Gt.prototype.join=function(r){var t,n,i=this.children.length;if(i>0){for(t=[],n=0;n<i-1;n++)t.push(this.children[n]),t.push(r);t.push(this.children[n]),this.children=t}return this};Gt.prototype.replaceRight=function(r,t){var n=this.children[this.children.length-1];return n[Bi]?n.replaceRight(r,t):typeof n=="string"?this.children[this.children.length-1]=n.replace(r,t):this.children.push("".replace(r,t)),this};Gt.prototype.setSourceContent=function(r,t){this.sourceContents[Ea.toSetString(r)]=t};Gt.prototype.walkSourceContents=function(r){for(var t=0,n=this.children.length;t<n;t++)this.children[t][Bi]&&this.children[t].walkSourceContents(r);for(var i=Object.keys(this.sourceContents),t=0,n=i.length;t<n;t++)r(Ea.fromSetString(i[t]),this.sourceContents[i[t]])};Gt.prototype.toString=function(){var r="";return this.walk(function(t){r+=t}),r};Gt.prototype.toStringWithSourceMap=function(r){var t={code:"",line:1,column:0},n=new YA(r),i=!1,s=null,o=null,a=null,l=null;return this.walk(function(u,c){t.code+=u,c.source!==null&&c.line!==null&&c.column!==null?((s!==c.source||o!==c.line||a!==c.column||l!==c.name)&&n.addMapping({source:c.source,original:{line:c.line,column:c.column},generated:{line:t.line,column:t.column},name:c.name}),s=c.source,o=c.line,a=c.column,l=c.name,i=!0):i&&(n.addMapping({generated:{line:t.line,column:t.column}}),s=null,i=!1);for(var p=0,d=u.length;p<d;p++)u.charCodeAt(p)===QA?(t.line++,t.column=0,p+1===d?(s=null,i=!1):i&&n.addMapping({source:c.source,original:{line:c.line,column:c.column},generated:{line:t.line,column:t.column},name:c.name})):t.column++}),this.walkSourceContents(function(u,c){n.setSourceContent(u,c)}),{code:t.code,map:n}};by.SourceNode=Gt});var Ey=se(Ca=>{Ca.SourceMapGenerator=cc().SourceMapGenerator;Ca.SourceMapConsumer=Dy().SourceMapConsumer;Ca.SourceNode=xy().SourceNode});var Qy=se(Js=>{"use strict";Object.defineProperty(Js,"__esModule",{value:!0});function ZA(e,r){if(e==null)return{};var t={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(r.includes(n))continue;t[n]=e[n]}return t}var Lr=class{constructor(r,t,n){this.line=void 0,this.column=void 0,this.index=void 0,this.line=r,this.column=t,this.index=n}},Ki=class{constructor(r,t){this.start=void 0,this.end=void 0,this.filename=void 0,this.identifierName=void 0,this.start=r,this.end=t}};function _t(e,r){let{line:t,column:n,index:i}=e;return new Lr(t,n+r,i+r)}var Cy="BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED",ev={ImportMetaOutsideModule:{message:`import.meta may appear only with 'sourceType: "module"'`,code:Cy},ImportOutsideModule:{message:`'import' and 'export' may appear only with 'sourceType: "module"'`,code:Cy}},Sy={ArrayPattern:"array destructuring pattern",AssignmentExpression:"assignment expression",AssignmentPattern:"assignment expression",ArrowFunctionExpression:"arrow function expression",ConditionalExpression:"conditional expression",CatchClause:"catch clause",ForOfStatement:"for-of statement",ForInStatement:"for-in statement",ForStatement:"for-loop",FormalParameters:"function parameter list",Identifier:"identifier",ImportSpecifier:"import specifier",ImportDefaultSpecifier:"import default specifier",ImportNamespaceSpecifier:"import namespace specifier",ObjectPattern:"object destructuring pattern",ParenthesizedExpression:"parenthesized expression",RestElement:"rest element",UpdateExpression:{true:"prefix operation",false:"postfix operation"},VariableDeclarator:"variable declaration",YieldExpression:"yield expression"},Ta=e=>e.type==="UpdateExpression"?Sy.UpdateExpression[`${e.prefix}`]:Sy[e.type],tv={AccessorIsGenerator:({kind:e})=>`A ${e}ter cannot be a generator.`,ArgumentsInClass:"'arguments' is only allowed in functions and class methods.",AsyncFunctionInSingleStatementContext:"Async functions can only be declared at the top level or inside a block.",AwaitBindingIdentifier:"Can not use 'await' as identifier inside an async function.",AwaitBindingIdentifierInStaticBlock:"Can not use 'await' as identifier inside a static block.",AwaitExpressionFormalParameter:"'await' is not allowed in async function parameters.",AwaitUsingNotInAsyncContext:"'await using' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncContext:"'await' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncFunction:"'await' is only allowed within async functions.",BadGetterArity:"A 'get' accessor must not have any formal parameters.",BadSetterArity:"A 'set' accessor must have exactly one formal parameter.",BadSetterRestParameter:"A 'set' accessor function argument must not be a rest parameter.",ConstructorClassField:"Classes may not have a field named 'constructor'.",ConstructorClassPrivateField:"Classes may not have a private field named '#constructor'.",ConstructorIsAccessor:"Class constructor may not be an accessor.",ConstructorIsAsync:"Constructor can't be an async function.",ConstructorIsGenerator:"Constructor can't be a generator.",DeclarationMissingInitializer:({kind:e})=>`Missing initializer in ${e} declaration.`,DecoratorArgumentsOutsideParentheses:"Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.",DecoratorBeforeExport:"Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.",DecoratorsBeforeAfterExport:"Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.",DecoratorConstructor:"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",DecoratorExportClass:"Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.",DecoratorSemicolon:"Decorators must not be followed by a semicolon.",DecoratorStaticBlock:"Decorators can't be used with a static block.",DeferImportRequiresNamespace:'Only `import defer * as x from "./module"` is valid.',DeletePrivateField:"Deleting a private field is not allowed.",DestructureNamedImport:"ES2015 named imports do not destructure. Use another statement for destructuring after the import.",DuplicateConstructor:"Duplicate constructor in the same class.",DuplicateDefaultExport:"Only one default export allowed per module.",DuplicateExport:({exportName:e})=>`\`${e}\` has already been exported. Exported identifiers must be unique.`,DuplicateProto:"Redefinition of __proto__ property.",DuplicateRegExpFlags:"Duplicate regular expression flag.",DynamicImportPhaseRequiresImportExpressions:({phase:e})=>`'import.${e}(...)' can only be parsed when using the 'createImportExpressions' option.`,ElementAfterRest:"Rest element must be last element.",EscapedCharNotAnIdentifier:"Invalid Unicode escape.",ExportBindingIsString:({localName:e,exportName:r})=>`A string literal cannot be used as an exported binding without \`from\`.
|
|
15
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),I=F,v=M),X===void 0&&(X=!0);let $={code:v,language:I};B("before:highlight",$);let H=$.result?$.result:p($.language,$.code,X);return H.code=$.code,B("after:highlight",H),H}function p(F,M,X,v){let I=Object.create(null);function $(z,Y){return z.keywords[Y]}function H(){if(!le.keywords){Dt.addText(Be);return}let z=0;le.keywordPatternRe.lastIndex=0;let Y=le.keywordPatternRe.exec(Be),pe="";for(;Y;){pe+=Be.substring(z,Y.index);let Fe=Xt.case_insensitive?Y[0].toLowerCase():Y[0],Ct=$(le,Fe);if(Ct){let[qr,KE]=Ct;if(Dt.addText(pe),pe="",I[Fe]=(I[Fe]||0)+1,I[Fe]<=fA&&(So+=KE),qr.startsWith("_"))pe+=Y[0];else{let VE=Xt.classNameAliases[qr]||qr;me(Y[0],VE)}}else pe+=Y[0];z=le.keywordPatternRe.lastIndex,Y=le.keywordPatternRe.exec(Be)}pe+=Be.substring(z),Dt.addText(pe)}function xe(){if(Be==="")return;let z=null;if(typeof le.subLanguage=="string"){if(!r[le.subLanguage]){Dt.addText(Be);return}z=p(le.subLanguage,Be,!0,yd[le.subLanguage]),yd[le.subLanguage]=z._top}else z=f(Be,le.subLanguage.length?le.subLanguage:null);le.relevance>0&&(So+=z.relevance),Dt.__addSublanguage(z._emitter,z.language)}function ae(){le.subLanguage!=null?xe():H(),Be=""}function me(z,Y){z!==""&&(Dt.startScope(Y),Dt.addText(z),Dt.endScope())}function yt(z,Y){let pe=1,Fe=Y.length-1;for(;pe<=Fe;){if(!z._emit[pe]){pe++;continue}let Ct=Xt.classNameAliases[z[pe]]||z[pe],qr=Y[pe];Ct?me(qr,Ct):(Be=qr,H(),Be=""),pe++}}function Pt(z,Y){return z.scope&&typeof z.scope=="string"&&Dt.openNode(Xt.classNameAliases[z.scope]||z.scope),z.beginScope&&(z.beginScope._wrap?(me(Be,Xt.classNameAliases[z.beginScope._wrap]||z.beginScope._wrap),Be=""):z.beginScope._multi&&(yt(z.beginScope,Y),Be="")),le=Object.create(z,{parent:{value:le}}),le}function Kr(z,Y,pe){let Fe=NT(z.endRe,pe);if(Fe){if(z["on:end"]){let Ct=new pa(z);z["on:end"](Y,Ct),Ct.isMatchIgnored&&(Fe=!1)}if(Fe){for(;z.endsParent&&z.parent;)z=z.parent;return z}}if(z.endsWithParent)return Kr(z.parent,Y,pe)}function cs(z){return le.matcher.regexIndex===0?(Be+=z[0],1):(Il=!0,0)}function Vr(z){let Y=z[0],pe=z.rule,Fe=new pa(pe),Ct=[pe.__beforeBegin,pe["on:begin"]];for(let qr of Ct)if(qr&&(qr(z,Fe),Fe.isMatchIgnored))return cs(Y);return pe.skip?Be+=Y:(pe.excludeBegin&&(Be+=Y),ae(),!pe.returnBegin&&!pe.excludeBegin&&(Be=Y)),Pt(pe,z),pe.returnBegin?0:Y.length}function ps(z){let Y=z[0],pe=M.substring(z.index),Fe=Kr(le,z,pe);if(!Fe)return gg;let Ct=le;le.endScope&&le.endScope._wrap?(ae(),me(Y,le.endScope._wrap)):le.endScope&&le.endScope._multi?(ae(),yt(le.endScope,z)):Ct.skip?Be+=Y:(Ct.returnEnd||Ct.excludeEnd||(Be+=Y),ae(),Ct.excludeEnd&&(Be=Y));do le.scope&&Dt.closeNode(),!le.skip&&!le.subLanguage&&(So+=le.relevance),le=le.parent;while(le!==Fe.parent);return Fe.starts&&Pt(Fe.starts,z),Ct.returnEnd?0:Y.length}function ve(){let z=[];for(let Y=le;Y!==Xt;Y=Y.parent)Y.scope&&z.unshift(Y.scope);z.forEach(Y=>Dt.openNode(Y))}let zr={};function hn(z,Y){let pe=Y&&Y[0];if(Be+=z,pe==null)return ae(),0;if(zr.type==="begin"&&Y.type==="end"&&zr.index===Y.index&&pe===""){if(Be+=M.slice(Y.index,Y.index+1),!i){let Fe=new Error(`0 width match regex (${F})`);throw Fe.languageName=F,Fe.badRule=zr.rule,Fe}return 1}if(zr=Y,Y.type==="begin")return Vr(Y);if(Y.type==="illegal"&&!X){let Fe=new Error('Illegal lexeme "'+pe+'" for mode "'+(le.scope||"<unnamed>")+'"');throw Fe.mode=le,Fe}else if(Y.type==="end"){let Fe=ps(Y);if(Fe!==gg)return Fe}if(Y.type==="illegal"&&pe==="")return 1;if(Pl>1e5&&Pl>Y.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Be+=pe,pe.length}let Xt=L(F);if(!Xt)throw Jn(s.replace("{}",F)),new Error('Unknown language: "'+F+'"');let jE=cA(Xt),vl="",le=v||jE,yd={},Dt=new a.__emitter(a);ve();let Be="",So=0,Bn=0,Pl=0,Il=!1;try{if(Xt.__emitTokens)Xt.__emitTokens(M,Dt);else{for(le.matcher.considerAll();;){Pl++,Il?Il=!1:le.matcher.considerAll(),le.matcher.lastIndex=Bn;let z=le.matcher.exec(M);if(!z)break;let Y=M.substring(Bn,z.index),pe=hn(Y,z);Bn=z.index+pe}hn(M.substring(Bn))}return Dt.finalize(),vl=Dt.toHTML(),{language:F,value:vl,relevance:So,illegal:!1,_emitter:Dt,_top:le}}catch(z){if(z.message&&z.message.includes("Illegal"))return{language:F,value:ju(M),illegal:!0,relevance:0,_illegalBy:{message:z.message,index:Bn,context:M.slice(Bn-100,Bn+100),mode:z.mode,resultSoFar:vl},_emitter:Dt};if(i)return{language:F,value:ju(M),illegal:!1,relevance:0,errorRaised:z,_emitter:Dt,_top:le};throw z}}function d(F){let M={value:ju(F),illegal:!1,relevance:0,_top:o,_emitter:new a.__emitter(a)};return M._emitter.addText(F),M}function f(F,M){M=M||a.languages||Object.keys(r);let X=d(F),v=M.filter(L).filter(U).map(ae=>p(ae,F,!1));v.unshift(X);let I=v.sort((ae,me)=>{if(ae.relevance!==me.relevance)return me.relevance-ae.relevance;if(ae.language&&me.language){if(L(ae.language).supersetOf===me.language)return 1;if(L(me.language).supersetOf===ae.language)return-1}return 0}),[$,H]=I,xe=$;return xe.secondBest=H,xe}function m(F,M,X){let v=M&&t[M]||X;F.classList.add("hljs"),F.classList.add(`language-${v}`)}function h(F){let M=null,X=u(F);if(l(X))return;if(B("before:highlightElement",{el:F,language:X}),F.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",F);return}if(F.children.length>0&&(a.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(F)),a.throwUnescapedHTML))throw new qu("One of your code blocks includes unescaped HTML.",F.innerHTML);M=F;let v=M.textContent,I=X?c(v,{language:X,ignoreIllegals:!0}):f(v);F.innerHTML=I.value,F.dataset.highlighted="yes",m(F,X,I.language),F.result={language:I.language,re:I.relevance,relevance:I.relevance},I.secondBest&&(F.secondBest={language:I.secondBest.language,relevance:I.secondBest.relevance}),B("after:highlightElement",{el:F,result:I,text:v})}function g(F){a=hg(a,F)}let y=()=>{x(),Ni("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function D(){x(),Ni("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let C=!1;function x(){if(document.readyState==="loading"){C=!0;return}document.querySelectorAll(a.cssSelector).forEach(h)}function b(){C&&x()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",b,!1);function E(F,M){let X=null;try{X=M(e)}catch(v){if(Jn("Language definition for '{}' could not be registered.".replace("{}",F)),i)Jn(v);else throw v;X=o}X.name||(X.name=F),r[F]=X,X.rawDefinition=M.bind(null,e),X.aliases&&N(X.aliases,{languageName:F})}function T(F){delete r[F];for(let M of Object.keys(t))t[M]===F&&delete t[M]}function O(){return Object.keys(r)}function L(F){return F=(F||"").toLowerCase(),r[F]||r[t[F]]}function N(F,{languageName:M}){typeof F=="string"&&(F=[F]),F.forEach(X=>{t[X.toLowerCase()]=M})}function U(F){let M=L(F);return M&&!M.disableAutodetect}function oe(F){F["before:highlightBlock"]&&!F["before:highlightElement"]&&(F["before:highlightElement"]=M=>{F["before:highlightBlock"](Object.assign({block:M.el},M))}),F["after:highlightBlock"]&&!F["after:highlightElement"]&&(F["after:highlightElement"]=M=>{F["after:highlightBlock"](Object.assign({block:M.el},M))})}function G(F){oe(F),n.push(F)}function P(F){let M=n.indexOf(F);M!==-1&&n.splice(M,1)}function B(F,M){let X=F;n.forEach(function(v){v[X]&&v[X](M)})}function re(F){return Ni("10.7.0","highlightBlock will be removed entirely in v12.0"),Ni("10.7.0","Please use highlightElement now."),h(F)}Object.assign(e,{highlight:c,highlightAuto:f,highlightAll:x,highlightElement:h,highlightBlock:re,configure:g,initHighlighting:y,initHighlightingOnLoad:D,registerLanguage:E,unregisterLanguage:T,listLanguages:O,getLanguage:L,registerAliases:N,autoDetection:U,inherit:hg,addPlugin:G,removePlugin:P}),e.debugMode=function(){i=!1},e.safeMode=function(){i=!0},e.versionString=dA,e.regex={concat:Yn,lookahead:bg,either:Wu,optional:PT,anyNumberOfTimes:vT};for(let F in ca)typeof ca[F]=="object"&&yg(ca[F]);return Object.assign(e,ca),e},Fi=Pg({});Fi.newInstance=()=>Pg({});Ig.exports=Fi;Fi.HighlightJS=Fi;Fi.default=Fi});var Xg=se(rc=>{var Yg="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");rc.encode=function(e){if(0<=e&&e<Yg.length)return Yg[e];throw new TypeError("Must be between 0 and 63: "+e)};rc.decode=function(e){var r=65,t=90,n=97,i=122,s=48,o=57,a=43,l=47,u=26,c=52;return r<=e&&e<=t?e-r:n<=e&&e<=i?e-n+u:s<=e&&e<=o?e-s+c:e==a?62:e==l?63:-1}});var sc=se(ic=>{var Qg=Xg(),nc=5,Zg=1<<nc,ey=Zg-1,ty=Zg;function IA(e){return e<0?(-e<<1)+1:(e<<1)+0}function NA(e){var r=(e&1)===1,t=e>>1;return r?-t:t}ic.encode=function(r){var t="",n,i=IA(r);do n=i&ey,i>>>=nc,i>0&&(n|=ty),t+=Qg.encode(n);while(i>0);return t};ic.decode=function(r,t,n){var i=r.length,s=0,o=0,a,l;do{if(t>=i)throw new Error("Expected more digits in base 64 VLQ value.");if(l=Qg.decode(r.charCodeAt(t++)),l===-1)throw new Error("Invalid base64 digit: "+r.charAt(t-1));a=!!(l&ty),l&=ey,s=s+(l<<o),o+=nc}while(a);n.value=NA(s),n.rest=t}});var Ri=se(mt=>{function FA(e,r,t){if(r in e)return e[r];if(arguments.length===3)return t;throw new Error('"'+r+'" is a required argument.')}mt.getArg=FA;var ry=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,_A=/^data:.+\,.+$/;function Bs(e){var r=e.match(ry);return r?{scheme:r[1],auth:r[2],host:r[3],port:r[4],path:r[5]}:null}mt.urlParse=Bs;function Oi(e){var r="";return e.scheme&&(r+=e.scheme+":"),r+="//",e.auth&&(r+=e.auth+"@"),e.host&&(r+=e.host),e.port&&(r+=":"+e.port),e.path&&(r+=e.path),r}mt.urlGenerate=Oi;var kA=32;function OA(e){var r=[];return function(t){for(var n=0;n<r.length;n++)if(r[n].input===t){var i=r[0];return r[0]=r[n],r[n]=i,r[0].result}var s=e(t);return r.unshift({input:t,result:s}),r.length>kA&&r.pop(),s}}var oc=OA(function(r){var t=r,n=Bs(r);if(n){if(!n.path)return r;t=n.path}for(var i=mt.isAbsolute(t),s=[],o=0,a=0;;)if(o=a,a=t.indexOf("/",o),a===-1){s.push(t.slice(o));break}else for(s.push(t.slice(o,a));a<t.length&&t[a]==="/";)a++;for(var l,u=0,a=s.length-1;a>=0;a--)l=s[a],l==="."?s.splice(a,1):l===".."?u++:u>0&&(l===""?(s.splice(a+1,u),u=0):(s.splice(a,2),u--));return t=s.join("/"),t===""&&(t=i?"/":"."),n?(n.path=t,Oi(n)):t});mt.normalize=oc;function ny(e,r){e===""&&(e="."),r===""&&(r=".");var t=Bs(r),n=Bs(e);if(n&&(e=n.path||"/"),t&&!t.scheme)return n&&(t.scheme=n.scheme),Oi(t);if(t||r.match(_A))return r;if(n&&!n.host&&!n.path)return n.host=r,Oi(n);var i=r.charAt(0)==="/"?r:oc(e.replace(/\/+$/,"")+"/"+r);return n?(n.path=i,Oi(n)):i}mt.join=ny;mt.isAbsolute=function(e){return e.charAt(0)==="/"||ry.test(e)};function RA(e,r){e===""&&(e="."),e=e.replace(/\/$/,"");for(var t=0;r.indexOf(e+"/")!==0;){var n=e.lastIndexOf("/");if(n<0||(e=e.slice(0,n),e.match(/^([^\/]+:\/)?\/*$/)))return r;++t}return Array(t+1).join("../")+r.substr(e.length+1)}mt.relative=RA;var iy=function(){var e=Object.create(null);return!("__proto__"in e)}();function sy(e){return e}function LA(e){return oy(e)?"$"+e:e}mt.toSetString=iy?sy:LA;function BA(e){return oy(e)?e.slice(1):e}mt.fromSetString=iy?sy:BA;function oy(e){if(!e)return!1;var r=e.length;if(r<9||e.charCodeAt(r-1)!==95||e.charCodeAt(r-2)!==95||e.charCodeAt(r-3)!==111||e.charCodeAt(r-4)!==116||e.charCodeAt(r-5)!==111||e.charCodeAt(r-6)!==114||e.charCodeAt(r-7)!==112||e.charCodeAt(r-8)!==95||e.charCodeAt(r-9)!==95)return!1;for(var t=r-10;t>=0;t--)if(e.charCodeAt(t)!==36)return!1;return!0}function MA(e,r,t){var n=tn(e.source,r.source);return n!==0||(n=e.originalLine-r.originalLine,n!==0)||(n=e.originalColumn-r.originalColumn,n!==0||t)||(n=e.generatedColumn-r.generatedColumn,n!==0)||(n=e.generatedLine-r.generatedLine,n!==0)?n:tn(e.name,r.name)}mt.compareByOriginalPositions=MA;function $A(e,r,t){var n;return n=e.originalLine-r.originalLine,n!==0||(n=e.originalColumn-r.originalColumn,n!==0||t)||(n=e.generatedColumn-r.generatedColumn,n!==0)||(n=e.generatedLine-r.generatedLine,n!==0)?n:tn(e.name,r.name)}mt.compareByOriginalPositionsNoSource=$A;function UA(e,r,t){var n=e.generatedLine-r.generatedLine;return n!==0||(n=e.generatedColumn-r.generatedColumn,n!==0||t)||(n=tn(e.source,r.source),n!==0)||(n=e.originalLine-r.originalLine,n!==0)||(n=e.originalColumn-r.originalColumn,n!==0)?n:tn(e.name,r.name)}mt.compareByGeneratedPositionsDeflated=UA;function jA(e,r,t){var n=e.generatedColumn-r.generatedColumn;return n!==0||t||(n=tn(e.source,r.source),n!==0)||(n=e.originalLine-r.originalLine,n!==0)||(n=e.originalColumn-r.originalColumn,n!==0)?n:tn(e.name,r.name)}mt.compareByGeneratedPositionsDeflatedNoLine=jA;function tn(e,r){return e===r?0:e===null?1:r===null?-1:e>r?1:-1}function KA(e,r){var t=e.generatedLine-r.generatedLine;return t!==0||(t=e.generatedColumn-r.generatedColumn,t!==0)||(t=tn(e.source,r.source),t!==0)||(t=e.originalLine-r.originalLine,t!==0)||(t=e.originalColumn-r.originalColumn,t!==0)?t:tn(e.name,r.name)}mt.compareByGeneratedPositionsInflated=KA;function VA(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))}mt.parseSourceMapInput=VA;function zA(e,r,t){if(r=r||"",e&&(e[e.length-1]!=="/"&&r[0]!=="/"&&(e+="/"),r=e+r),t){var n=Bs(t);if(!n)throw new Error("sourceMapURL could not be parsed");if(n.path){var i=n.path.lastIndexOf("/");i>=0&&(n.path=n.path.substring(0,i+1))}r=ny(Oi(n),r)}return oc(r)}mt.computeSourceURL=zA});var uc=se(ay=>{var ac=Ri(),lc=Object.prototype.hasOwnProperty,Qn=typeof Map<"u";function rn(){this._array=[],this._set=Qn?new Map:Object.create(null)}rn.fromArray=function(r,t){for(var n=new rn,i=0,s=r.length;i<s;i++)n.add(r[i],t);return n};rn.prototype.size=function(){return Qn?this._set.size:Object.getOwnPropertyNames(this._set).length};rn.prototype.add=function(r,t){var n=Qn?r:ac.toSetString(r),i=Qn?this.has(r):lc.call(this._set,n),s=this._array.length;(!i||t)&&this._array.push(r),i||(Qn?this._set.set(r,s):this._set[n]=s)};rn.prototype.has=function(r){if(Qn)return this._set.has(r);var t=ac.toSetString(r);return lc.call(this._set,t)};rn.prototype.indexOf=function(r){if(Qn){var t=this._set.get(r);if(t>=0)return t}else{var n=ac.toSetString(r);if(lc.call(this._set,n))return this._set[n]}throw new Error('"'+r+'" is not in the set.')};rn.prototype.at=function(r){if(r>=0&&r<this._array.length)return this._array[r];throw new Error("No element indexed by "+r)};rn.prototype.toArray=function(){return this._array.slice()};ay.ArraySet=rn});var cy=se(uy=>{var ly=Ri();function qA(e,r){var t=e.generatedLine,n=r.generatedLine,i=e.generatedColumn,s=r.generatedColumn;return n>t||n==t&&s>=i||ly.compareByGeneratedPositionsInflated(e,r)<=0}function Da(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}Da.prototype.unsortedForEach=function(r,t){this._array.forEach(r,t)};Da.prototype.add=function(r){qA(this._last,r)?(this._last=r,this._array.push(r)):(this._sorted=!1,this._array.push(r))};Da.prototype.toArray=function(){return this._sorted||(this._array.sort(ly.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};uy.MappingList=Da});var cc=se(py=>{var Ms=sc(),tt=Ri(),ba=uc().ArraySet,WA=cy().MappingList;function nr(e){e||(e={}),this._file=tt.getArg(e,"file",null),this._sourceRoot=tt.getArg(e,"sourceRoot",null),this._skipValidation=tt.getArg(e,"skipValidation",!1),this._ignoreInvalidMapping=tt.getArg(e,"ignoreInvalidMapping",!1),this._sources=new ba,this._names=new ba,this._mappings=new WA,this._sourcesContents=null}nr.prototype._version=3;nr.fromSourceMap=function(r,t){var n=r.sourceRoot,i=new nr(Object.assign(t||{},{file:r.file,sourceRoot:n}));return r.eachMapping(function(s){var o={generated:{line:s.generatedLine,column:s.generatedColumn}};s.source!=null&&(o.source=s.source,n!=null&&(o.source=tt.relative(n,o.source)),o.original={line:s.originalLine,column:s.originalColumn},s.name!=null&&(o.name=s.name)),i.addMapping(o)}),r.sources.forEach(function(s){var o=s;n!==null&&(o=tt.relative(n,s)),i._sources.has(o)||i._sources.add(o);var a=r.sourceContentFor(s);a!=null&&i.setSourceContent(s,a)}),i};nr.prototype.addMapping=function(r){var t=tt.getArg(r,"generated"),n=tt.getArg(r,"original",null),i=tt.getArg(r,"source",null),s=tt.getArg(r,"name",null);!this._skipValidation&&this._validateMapping(t,n,i,s)===!1||(i!=null&&(i=String(i),this._sources.has(i)||this._sources.add(i)),s!=null&&(s=String(s),this._names.has(s)||this._names.add(s)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:i,name:s}))};nr.prototype.setSourceContent=function(r,t){var n=r;this._sourceRoot!=null&&(n=tt.relative(this._sourceRoot,n)),t!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[tt.toSetString(n)]=t):this._sourcesContents&&(delete this._sourcesContents[tt.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};nr.prototype.applySourceMap=function(r,t,n){var i=t;if(t==null){if(r.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);i=r.file}var s=this._sourceRoot;s!=null&&(i=tt.relative(s,i));var o=new ba,a=new ba;this._mappings.unsortedForEach(function(l){if(l.source===i&&l.originalLine!=null){var u=r.originalPositionFor({line:l.originalLine,column:l.originalColumn});u.source!=null&&(l.source=u.source,n!=null&&(l.source=tt.join(n,l.source)),s!=null&&(l.source=tt.relative(s,l.source)),l.originalLine=u.line,l.originalColumn=u.column,u.name!=null&&(l.name=u.name))}var c=l.source;c!=null&&!o.has(c)&&o.add(c);var p=l.name;p!=null&&!a.has(p)&&a.add(p)},this),this._sources=o,this._names=a,r.sources.forEach(function(l){var u=r.sourceContentFor(l);u!=null&&(n!=null&&(l=tt.join(n,l)),s!=null&&(l=tt.relative(s,l)),this.setSourceContent(l,u))},this)};nr.prototype._validateMapping=function(r,t,n,i){if(t&&typeof t.line!="number"&&typeof t.column!="number"){var s="original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.";if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(s),!1;throw new Error(s)}if(!(r&&"line"in r&&"column"in r&&r.line>0&&r.column>=0&&!t&&!n&&!i)){if(r&&"line"in r&&"column"in r&&t&&"line"in t&&"column"in t&&r.line>0&&r.column>=0&&t.line>0&&t.column>=0&&n)return;var s="Invalid mapping: "+JSON.stringify({generated:r,source:n,original:t,name:i});if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(s),!1;throw new Error(s)}};nr.prototype._serializeMappings=function(){for(var r=0,t=1,n=0,i=0,s=0,o=0,a="",l,u,c,p,d=this._mappings.toArray(),f=0,m=d.length;f<m;f++){if(u=d[f],l="",u.generatedLine!==t)for(r=0;u.generatedLine!==t;)l+=";",t++;else if(f>0){if(!tt.compareByGeneratedPositionsInflated(u,d[f-1]))continue;l+=","}l+=Ms.encode(u.generatedColumn-r),r=u.generatedColumn,u.source!=null&&(p=this._sources.indexOf(u.source),l+=Ms.encode(p-o),o=p,l+=Ms.encode(u.originalLine-1-i),i=u.originalLine-1,l+=Ms.encode(u.originalColumn-n),n=u.originalColumn,u.name!=null&&(c=this._names.indexOf(u.name),l+=Ms.encode(c-s),s=c)),a+=l}return a};nr.prototype._generateSourcesContent=function(r,t){return r.map(function(n){if(!this._sourcesContents)return null;t!=null&&(n=tt.relative(t,n));var i=tt.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,i)?this._sourcesContents[i]:null},this)};nr.prototype.toJSON=function(){var r={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(r.file=this._file),this._sourceRoot!=null&&(r.sourceRoot=this._sourceRoot),this._sourcesContents&&(r.sourcesContent=this._generateSourcesContent(r.sources,r.sourceRoot)),r};nr.prototype.toString=function(){return JSON.stringify(this.toJSON())};py.SourceMapGenerator=nr});var dy=se(Zn=>{Zn.GREATEST_LOWER_BOUND=1;Zn.LEAST_UPPER_BOUND=2;function pc(e,r,t,n,i,s){var o=Math.floor((r-e)/2)+e,a=i(t,n[o],!0);return a===0?o:a>0?r-o>1?pc(o,r,t,n,i,s):s==Zn.LEAST_UPPER_BOUND?r<n.length?r:-1:o:o-e>1?pc(e,o,t,n,i,s):s==Zn.LEAST_UPPER_BOUND?o:e<0?-1:e}Zn.search=function(r,t,n,i){if(t.length===0)return-1;var s=pc(-1,t.length,r,t,n,i||Zn.GREATEST_LOWER_BOUND);if(s<0)return-1;for(;s-1>=0&&n(t[s],t[s-1],!0)===0;)--s;return s}});var hy=se(my=>{function GA(e){function r(i,s,o){var a=i[s];i[s]=i[o],i[o]=a}function t(i,s){return Math.round(i+Math.random()*(s-i))}function n(i,s,o,a){if(o<a){var l=t(o,a),u=o-1;r(i,l,a);for(var c=i[a],p=o;p<a;p++)s(i[p],c,!1)<=0&&(u+=1,r(i,u,p));r(i,u+1,p);var d=u+1;n(i,s,o,d-1),n(i,s,d+1,a)}}return n}function HA(e){let r=GA.toString();return new Function(`return ${r}`)()(e)}var fy=new WeakMap;my.quickSort=function(e,r,t=0){let n=fy.get(r);n===void 0&&(n=HA(r),fy.set(r,n)),n(e,r,t,e.length-1)}});var Dy=se(xa=>{var W=Ri(),fc=dy(),Li=uc().ArraySet,JA=sc(),$s=hy().quickSort;function Ke(e,r){var t=e;return typeof e=="string"&&(t=W.parseSourceMapInput(e)),t.sections!=null?new mr(t,r):new bt(t,r)}Ke.fromSourceMap=function(e,r){return bt.fromSourceMap(e,r)};Ke.prototype._version=3;Ke.prototype.__generatedMappings=null;Object.defineProperty(Ke.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}});Ke.prototype.__originalMappings=null;Object.defineProperty(Ke.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}});Ke.prototype._charIsMappingSeparator=function(r,t){var n=r.charAt(t);return n===";"||n===","};Ke.prototype._parseMappings=function(r,t){throw new Error("Subclasses must implement _parseMappings")};Ke.GENERATED_ORDER=1;Ke.ORIGINAL_ORDER=2;Ke.GREATEST_LOWER_BOUND=1;Ke.LEAST_UPPER_BOUND=2;Ke.prototype.eachMapping=function(r,t,n){var i=t||null,s=n||Ke.GENERATED_ORDER,o;switch(s){case Ke.GENERATED_ORDER:o=this._generatedMappings;break;case Ke.ORIGINAL_ORDER:o=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}for(var a=this.sourceRoot,l=r.bind(i),u=this._names,c=this._sources,p=this._sourceMapURL,d=0,f=o.length;d<f;d++){var m=o[d],h=m.source===null?null:c.at(m.source);h!==null&&(h=W.computeSourceURL(a,h,p)),l({source:h,generatedLine:m.generatedLine,generatedColumn:m.generatedColumn,originalLine:m.originalLine,originalColumn:m.originalColumn,name:m.name===null?null:u.at(m.name)})}};Ke.prototype.allGeneratedPositionsFor=function(r){var t=W.getArg(r,"line"),n={source:W.getArg(r,"source"),originalLine:t,originalColumn:W.getArg(r,"column",0)};if(n.source=this._findSourceIndex(n.source),n.source<0)return[];var i=[],s=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",W.compareByOriginalPositions,fc.LEAST_UPPER_BOUND);if(s>=0){var o=this._originalMappings[s];if(r.column===void 0)for(var a=o.originalLine;o&&o.originalLine===a;)i.push({line:W.getArg(o,"generatedLine",null),column:W.getArg(o,"generatedColumn",null),lastColumn:W.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++s];else for(var l=o.originalColumn;o&&o.originalLine===t&&o.originalColumn==l;)i.push({line:W.getArg(o,"generatedLine",null),column:W.getArg(o,"generatedColumn",null),lastColumn:W.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++s]}return i};xa.SourceMapConsumer=Ke;function bt(e,r){var t=e;typeof e=="string"&&(t=W.parseSourceMapInput(e));var n=W.getArg(t,"version"),i=W.getArg(t,"sources"),s=W.getArg(t,"names",[]),o=W.getArg(t,"sourceRoot",null),a=W.getArg(t,"sourcesContent",null),l=W.getArg(t,"mappings"),u=W.getArg(t,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);o&&(o=W.normalize(o)),i=i.map(String).map(W.normalize).map(function(c){return o&&W.isAbsolute(o)&&W.isAbsolute(c)?W.relative(o,c):c}),this._names=Li.fromArray(s.map(String),!0),this._sources=Li.fromArray(i,!0),this._absoluteSources=this._sources.toArray().map(function(c){return W.computeSourceURL(o,c,r)}),this.sourceRoot=o,this.sourcesContent=a,this._mappings=l,this._sourceMapURL=r,this.file=u}bt.prototype=Object.create(Ke.prototype);bt.prototype.consumer=Ke;bt.prototype._findSourceIndex=function(e){var r=e;if(this.sourceRoot!=null&&(r=W.relative(this.sourceRoot,r)),this._sources.has(r))return this._sources.indexOf(r);var t;for(t=0;t<this._absoluteSources.length;++t)if(this._absoluteSources[t]==e)return t;return-1};bt.fromSourceMap=function(r,t){var n=Object.create(bt.prototype),i=n._names=Li.fromArray(r._names.toArray(),!0),s=n._sources=Li.fromArray(r._sources.toArray(),!0);n.sourceRoot=r._sourceRoot,n.sourcesContent=r._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=r._file,n._sourceMapURL=t,n._absoluteSources=n._sources.toArray().map(function(f){return W.computeSourceURL(n.sourceRoot,f,t)});for(var o=r._mappings.toArray().slice(),a=n.__generatedMappings=[],l=n.__originalMappings=[],u=0,c=o.length;u<c;u++){var p=o[u],d=new yy;d.generatedLine=p.generatedLine,d.generatedColumn=p.generatedColumn,p.source&&(d.source=s.indexOf(p.source),d.originalLine=p.originalLine,d.originalColumn=p.originalColumn,p.name&&(d.name=i.indexOf(p.name)),l.push(d)),a.push(d)}return $s(n.__originalMappings,W.compareByOriginalPositions),n};bt.prototype._version=3;Object.defineProperty(bt.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function yy(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}var dc=W.compareByGeneratedPositionsDeflatedNoLine;function gy(e,r){let t=e.length,n=e.length-r;if(!(n<=1))if(n==2){let i=e[r],s=e[r+1];dc(i,s)>0&&(e[r]=s,e[r+1]=i)}else if(n<20)for(let i=r;i<t;i++)for(let s=i;s>r;s--){let o=e[s-1],a=e[s];if(dc(o,a)<=0)break;e[s-1]=a,e[s]=o}else $s(e,dc,r)}bt.prototype._parseMappings=function(r,t){var n=1,i=0,s=0,o=0,a=0,l=0,u=r.length,c=0,p={},d={},f=[],m=[],h,g,y,D,C;let x=0;for(;c<u;)if(r.charAt(c)===";")n++,c++,i=0,gy(m,x),x=m.length;else if(r.charAt(c)===",")c++;else{for(h=new yy,h.generatedLine=n,D=c;D<u&&!this._charIsMappingSeparator(r,D);D++);for(g=r.slice(c,D),y=[];c<D;)JA.decode(r,c,d),C=d.value,c=d.rest,y.push(C);if(y.length===2)throw new Error("Found a source, but no line and column");if(y.length===3)throw new Error("Found a source and line, but no column");if(h.generatedColumn=i+y[0],i=h.generatedColumn,y.length>1&&(h.source=a+y[1],a+=y[1],h.originalLine=s+y[2],s=h.originalLine,h.originalLine+=1,h.originalColumn=o+y[3],o=h.originalColumn,y.length>4&&(h.name=l+y[4],l+=y[4])),m.push(h),typeof h.originalLine=="number"){let E=h.source;for(;f.length<=E;)f.push(null);f[E]===null&&(f[E]=[]),f[E].push(h)}}gy(m,x),this.__generatedMappings=m;for(var b=0;b<f.length;b++)f[b]!=null&&$s(f[b],W.compareByOriginalPositionsNoSource);this.__originalMappings=[].concat(...f)};bt.prototype._findMapping=function(r,t,n,i,s,o){if(r[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+r[n]);if(r[i]<0)throw new TypeError("Column must be greater than or equal to 0, got "+r[i]);return fc.search(r,t,s,o)};bt.prototype.computeColumnSpans=function(){for(var r=0;r<this._generatedMappings.length;++r){var t=this._generatedMappings[r];if(r+1<this._generatedMappings.length){var n=this._generatedMappings[r+1];if(t.generatedLine===n.generatedLine){t.lastGeneratedColumn=n.generatedColumn-1;continue}}t.lastGeneratedColumn=1/0}};bt.prototype.originalPositionFor=function(r){var t={generatedLine:W.getArg(r,"line"),generatedColumn:W.getArg(r,"column")},n=this._findMapping(t,this._generatedMappings,"generatedLine","generatedColumn",W.compareByGeneratedPositionsDeflated,W.getArg(r,"bias",Ke.GREATEST_LOWER_BOUND));if(n>=0){var i=this._generatedMappings[n];if(i.generatedLine===t.generatedLine){var s=W.getArg(i,"source",null);s!==null&&(s=this._sources.at(s),s=W.computeSourceURL(this.sourceRoot,s,this._sourceMapURL));var o=W.getArg(i,"name",null);return o!==null&&(o=this._names.at(o)),{source:s,line:W.getArg(i,"originalLine",null),column:W.getArg(i,"originalColumn",null),name:o}}}return{source:null,line:null,column:null,name:null}};bt.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(r){return r==null}):!1};bt.prototype.sourceContentFor=function(r,t){if(!this.sourcesContent)return null;var n=this._findSourceIndex(r);if(n>=0)return this.sourcesContent[n];var i=r;this.sourceRoot!=null&&(i=W.relative(this.sourceRoot,i));var s;if(this.sourceRoot!=null&&(s=W.urlParse(this.sourceRoot))){var o=i.replace(/^file:\/\//,"");if(s.scheme=="file"&&this._sources.has(o))return this.sourcesContent[this._sources.indexOf(o)];if((!s.path||s.path=="/")&&this._sources.has("/"+i))return this.sourcesContent[this._sources.indexOf("/"+i)]}if(t)return null;throw new Error('"'+i+'" is not in the SourceMap.')};bt.prototype.generatedPositionFor=function(r){var t=W.getArg(r,"source");if(t=this._findSourceIndex(t),t<0)return{line:null,column:null,lastColumn:null};var n={source:t,originalLine:W.getArg(r,"line"),originalColumn:W.getArg(r,"column")},i=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",W.compareByOriginalPositions,W.getArg(r,"bias",Ke.GREATEST_LOWER_BOUND));if(i>=0){var s=this._originalMappings[i];if(s.source===n.source)return{line:W.getArg(s,"generatedLine",null),column:W.getArg(s,"generatedColumn",null),lastColumn:W.getArg(s,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};xa.BasicSourceMapConsumer=bt;function mr(e,r){var t=e;typeof e=="string"&&(t=W.parseSourceMapInput(e));var n=W.getArg(t,"version"),i=W.getArg(t,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new Li,this._names=new Li;var s={line:-1,column:0};this._sections=i.map(function(o){if(o.url)throw new Error("Support for url field in sections not implemented.");var a=W.getArg(o,"offset"),l=W.getArg(a,"line"),u=W.getArg(a,"column");if(l<s.line||l===s.line&&u<s.column)throw new Error("Section offsets must be ordered and non-overlapping.");return s=a,{generatedOffset:{generatedLine:l+1,generatedColumn:u+1},consumer:new Ke(W.getArg(o,"map"),r)}})}mr.prototype=Object.create(Ke.prototype);mr.prototype.constructor=Ke;mr.prototype._version=3;Object.defineProperty(mr.prototype,"sources",{get:function(){for(var e=[],r=0;r<this._sections.length;r++)for(var t=0;t<this._sections[r].consumer.sources.length;t++)e.push(this._sections[r].consumer.sources[t]);return e}});mr.prototype.originalPositionFor=function(r){var t={generatedLine:W.getArg(r,"line"),generatedColumn:W.getArg(r,"column")},n=fc.search(t,this._sections,function(s,o){var a=s.generatedLine-o.generatedOffset.generatedLine;return a||s.generatedColumn-o.generatedOffset.generatedColumn}),i=this._sections[n];return i?i.consumer.originalPositionFor({line:t.generatedLine-(i.generatedOffset.generatedLine-1),column:t.generatedColumn-(i.generatedOffset.generatedLine===t.generatedLine?i.generatedOffset.generatedColumn-1:0),bias:r.bias}):{source:null,line:null,column:null,name:null}};mr.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(r){return r.consumer.hasContentsOfAllSources()})};mr.prototype.sourceContentFor=function(r,t){for(var n=0;n<this._sections.length;n++){var i=this._sections[n],s=i.consumer.sourceContentFor(r,!0);if(s||s==="")return s}if(t)return null;throw new Error('"'+r+'" is not in the SourceMap.')};mr.prototype.generatedPositionFor=function(r){for(var t=0;t<this._sections.length;t++){var n=this._sections[t];if(n.consumer._findSourceIndex(W.getArg(r,"source"))!==-1){var i=n.consumer.generatedPositionFor(r);if(i){var s={line:i.line+(n.generatedOffset.generatedLine-1),column:i.column+(n.generatedOffset.generatedLine===i.line?n.generatedOffset.generatedColumn-1:0)};return s}}}return{line:null,column:null}};mr.prototype._parseMappings=function(r,t){this.__generatedMappings=[],this.__originalMappings=[];for(var n=0;n<this._sections.length;n++)for(var i=this._sections[n],s=i.consumer._generatedMappings,o=0;o<s.length;o++){var a=s[o],l=i.consumer._sources.at(a.source);l!==null&&(l=W.computeSourceURL(i.consumer.sourceRoot,l,this._sourceMapURL)),this._sources.add(l),l=this._sources.indexOf(l);var u=null;a.name&&(u=i.consumer._names.at(a.name),this._names.add(u),u=this._names.indexOf(u));var c={source:l,generatedLine:a.generatedLine+(i.generatedOffset.generatedLine-1),generatedColumn:a.generatedColumn+(i.generatedOffset.generatedLine===a.generatedLine?i.generatedOffset.generatedColumn-1:0),originalLine:a.originalLine,originalColumn:a.originalColumn,name:u};this.__generatedMappings.push(c),typeof c.originalLine=="number"&&this.__originalMappings.push(c)}$s(this.__generatedMappings,W.compareByGeneratedPositionsDeflated),$s(this.__originalMappings,W.compareByOriginalPositions)};xa.IndexedSourceMapConsumer=mr});var xy=se(by=>{var YA=cc().SourceMapGenerator,Ea=Ri(),XA=/(\r?\n)/,QA=10,Bi="$$$isSourceNode$$$";function Gt(e,r,t,n,i){this.children=[],this.sourceContents={},this.line=e??null,this.column=r??null,this.source=t??null,this.name=i??null,this[Bi]=!0,n!=null&&this.add(n)}Gt.fromStringWithSourceMap=function(r,t,n){var i=new Gt,s=r.split(XA),o=0,a=function(){var d=m(),f=m()||"";return d+f;function m(){return o<s.length?s[o++]:void 0}},l=1,u=0,c=null;return t.eachMapping(function(d){if(c!==null)if(l<d.generatedLine)p(c,a()),l++,u=0;else{var f=s[o]||"",m=f.substr(0,d.generatedColumn-u);s[o]=f.substr(d.generatedColumn-u),u=d.generatedColumn,p(c,m),c=d;return}for(;l<d.generatedLine;)i.add(a()),l++;if(u<d.generatedColumn){var f=s[o]||"";i.add(f.substr(0,d.generatedColumn)),s[o]=f.substr(d.generatedColumn),u=d.generatedColumn}c=d},this),o<s.length&&(c&&p(c,a()),i.add(s.splice(o).join(""))),t.sources.forEach(function(d){var f=t.sourceContentFor(d);f!=null&&(n!=null&&(d=Ea.join(n,d)),i.setSourceContent(d,f))}),i;function p(d,f){if(d===null||d.source===void 0)i.add(f);else{var m=n?Ea.join(n,d.source):d.source;i.add(new Gt(d.originalLine,d.originalColumn,m,f,d.name))}}};Gt.prototype.add=function(r){if(Array.isArray(r))r.forEach(function(t){this.add(t)},this);else if(r[Bi]||typeof r=="string")r&&this.children.push(r);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+r);return this};Gt.prototype.prepend=function(r){if(Array.isArray(r))for(var t=r.length-1;t>=0;t--)this.prepend(r[t]);else if(r[Bi]||typeof r=="string")this.children.unshift(r);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+r);return this};Gt.prototype.walk=function(r){for(var t,n=0,i=this.children.length;n<i;n++)t=this.children[n],t[Bi]?t.walk(r):t!==""&&r(t,{source:this.source,line:this.line,column:this.column,name:this.name})};Gt.prototype.join=function(r){var t,n,i=this.children.length;if(i>0){for(t=[],n=0;n<i-1;n++)t.push(this.children[n]),t.push(r);t.push(this.children[n]),this.children=t}return this};Gt.prototype.replaceRight=function(r,t){var n=this.children[this.children.length-1];return n[Bi]?n.replaceRight(r,t):typeof n=="string"?this.children[this.children.length-1]=n.replace(r,t):this.children.push("".replace(r,t)),this};Gt.prototype.setSourceContent=function(r,t){this.sourceContents[Ea.toSetString(r)]=t};Gt.prototype.walkSourceContents=function(r){for(var t=0,n=this.children.length;t<n;t++)this.children[t][Bi]&&this.children[t].walkSourceContents(r);for(var i=Object.keys(this.sourceContents),t=0,n=i.length;t<n;t++)r(Ea.fromSetString(i[t]),this.sourceContents[i[t]])};Gt.prototype.toString=function(){var r="";return this.walk(function(t){r+=t}),r};Gt.prototype.toStringWithSourceMap=function(r){var t={code:"",line:1,column:0},n=new YA(r),i=!1,s=null,o=null,a=null,l=null;return this.walk(function(u,c){t.code+=u,c.source!==null&&c.line!==null&&c.column!==null?((s!==c.source||o!==c.line||a!==c.column||l!==c.name)&&n.addMapping({source:c.source,original:{line:c.line,column:c.column},generated:{line:t.line,column:t.column},name:c.name}),s=c.source,o=c.line,a=c.column,l=c.name,i=!0):i&&(n.addMapping({generated:{line:t.line,column:t.column}}),s=null,i=!1);for(var p=0,d=u.length;p<d;p++)u.charCodeAt(p)===QA?(t.line++,t.column=0,p+1===d?(s=null,i=!1):i&&n.addMapping({source:c.source,original:{line:c.line,column:c.column},generated:{line:t.line,column:t.column},name:c.name})):t.column++}),this.walkSourceContents(function(u,c){n.setSourceContent(u,c)}),{code:t.code,map:n}};by.SourceNode=Gt});var Ey=se(Ca=>{Ca.SourceMapGenerator=cc().SourceMapGenerator;Ca.SourceMapConsumer=Dy().SourceMapConsumer;Ca.SourceNode=xy().SourceNode});var Qy=se(Js=>{"use strict";Object.defineProperty(Js,"__esModule",{value:!0});function ZA(e,r){if(e==null)return{};var t={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(r.includes(n))continue;t[n]=e[n]}return t}var Lr=class{constructor(r,t,n){this.line=void 0,this.column=void 0,this.index=void 0,this.line=r,this.column=t,this.index=n}},Ki=class{constructor(r,t){this.start=void 0,this.end=void 0,this.filename=void 0,this.identifierName=void 0,this.start=r,this.end=t}};function _t(e,r){let{line:t,column:n,index:i}=e;return new Lr(t,n+r,i+r)}var Cy="BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED",ev={ImportMetaOutsideModule:{message:`import.meta may appear only with 'sourceType: "module"'`,code:Cy},ImportOutsideModule:{message:`'import' and 'export' may appear only with 'sourceType: "module"'`,code:Cy}},Sy={ArrayPattern:"array destructuring pattern",AssignmentExpression:"assignment expression",AssignmentPattern:"assignment expression",ArrowFunctionExpression:"arrow function expression",ConditionalExpression:"conditional expression",CatchClause:"catch clause",ForOfStatement:"for-of statement",ForInStatement:"for-in statement",ForStatement:"for-loop",FormalParameters:"function parameter list",Identifier:"identifier",ImportSpecifier:"import specifier",ImportDefaultSpecifier:"import default specifier",ImportNamespaceSpecifier:"import namespace specifier",ObjectPattern:"object destructuring pattern",ParenthesizedExpression:"parenthesized expression",RestElement:"rest element",UpdateExpression:{true:"prefix operation",false:"postfix operation"},VariableDeclarator:"variable declaration",YieldExpression:"yield expression"},Ta=e=>e.type==="UpdateExpression"?Sy.UpdateExpression[`${e.prefix}`]:Sy[e.type],tv={AccessorIsGenerator:({kind:e})=>`A ${e}ter cannot be a generator.`,ArgumentsInClass:"'arguments' is only allowed in functions and class methods.",AsyncFunctionInSingleStatementContext:"Async functions can only be declared at the top level or inside a block.",AwaitBindingIdentifier:"Can not use 'await' as identifier inside an async function.",AwaitBindingIdentifierInStaticBlock:"Can not use 'await' as identifier inside a static block.",AwaitExpressionFormalParameter:"'await' is not allowed in async function parameters.",AwaitUsingNotInAsyncContext:"'await using' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncContext:"'await' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncFunction:"'await' is only allowed within async functions.",BadGetterArity:"A 'get' accessor must not have any formal parameters.",BadSetterArity:"A 'set' accessor must have exactly one formal parameter.",BadSetterRestParameter:"A 'set' accessor function argument must not be a rest parameter.",ConstructorClassField:"Classes may not have a field named 'constructor'.",ConstructorClassPrivateField:"Classes may not have a private field named '#constructor'.",ConstructorIsAccessor:"Class constructor may not be an accessor.",ConstructorIsAsync:"Constructor can't be an async function.",ConstructorIsGenerator:"Constructor can't be a generator.",DeclarationMissingInitializer:({kind:e})=>`Missing initializer in ${e} declaration.`,DecoratorArgumentsOutsideParentheses:"Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.",DecoratorBeforeExport:"Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.",DecoratorsBeforeAfterExport:"Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.",DecoratorConstructor:"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",DecoratorExportClass:"Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.",DecoratorSemicolon:"Decorators must not be followed by a semicolon.",DecoratorStaticBlock:"Decorators can't be used with a static block.",DeferImportRequiresNamespace:'Only `import defer * as x from "./module"` is valid.',DeletePrivateField:"Deleting a private field is not allowed.",DestructureNamedImport:"ES2015 named imports do not destructure. Use another statement for destructuring after the import.",DuplicateConstructor:"Duplicate constructor in the same class.",DuplicateDefaultExport:"Only one default export allowed per module.",DuplicateExport:({exportName:e})=>`\`${e}\` has already been exported. Exported identifiers must be unique.`,DuplicateProto:"Redefinition of __proto__ property.",DuplicateRegExpFlags:"Duplicate regular expression flag.",DynamicImportPhaseRequiresImportExpressions:({phase:e})=>`'import.${e}(...)' can only be parsed when using the 'createImportExpressions' option.`,ElementAfterRest:"Rest element must be last element.",EscapedCharNotAnIdentifier:"Invalid Unicode escape.",ExportBindingIsString:({localName:e,exportName:r})=>`A string literal cannot be used as an exported binding without \`from\`.
|
|
16
16
|
- Did you mean \`export { '${e}' as '${r}' } from 'some-module'\`?`,ExportDefaultFromAsIdentifier:"'from' is not allowed as an identifier after 'export default'.",ForInOfLoopInitializer:({type:e})=>`'${e==="ForInStatement"?"for-in":"for-of"}' loop variable declaration may not have an initializer.`,ForInUsing:"For-in loop may not start with 'using' declaration.",ForOfAsync:"The left-hand side of a for-of loop may not be 'async'.",ForOfLet:"The left-hand side of a for-of loop may not start with 'let'.",GeneratorInSingleStatementContext:"Generators can only be declared at the top level or inside a block.",IllegalBreakContinue:({type:e})=>`Unsyntactic ${e==="BreakStatement"?"break":"continue"}.`,IllegalLanguageModeDirective:"Illegal 'use strict' directive in function with non-simple parameter list.",IllegalReturn:"'return' outside of function.",ImportAttributesUseAssert:"The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedAssertSyntax: true` option in the import attributes plugin to suppress this error.",ImportBindingIsString:({importName:e})=>`A string literal cannot be used as an imported binding.
|
|
17
|
-
- Did you mean \`import { "${e}" as foo }\`?`,ImportCallArgumentTrailingComma:"Trailing comma is disallowed inside import(...) arguments.",ImportCallArity:({maxArgumentCount:e})=>`\`import()\` requires exactly ${e===1?"one argument":"one or two arguments"}.`,ImportCallNotNewExpression:"Cannot use new with import(...).",ImportCallSpreadArgument:"`...` is not allowed in `import()`.",ImportJSONBindingNotDefault:"A JSON module can only be imported with `default`.",ImportReflectionHasAssertion:"`import module x` cannot have assertions.",ImportReflectionNotBinding:'Only `import module x from "./module"` is valid.',IncompatibleRegExpUVFlags:"The 'u' and 'v' regular expression flags cannot be enabled at the same time.",InvalidBigIntLiteral:"Invalid BigIntLiteral.",InvalidCodePoint:"Code point out of bounds.",InvalidCoverInitializedName:"Invalid shorthand property initializer.",InvalidDecimal:"Invalid decimal.",InvalidDigit:({radix:e})=>`Expected number in radix ${e}.`,InvalidEscapeSequence:"Bad character escape sequence.",InvalidEscapeSequenceTemplate:"Invalid escape sequence in template.",InvalidEscapedReservedWord:({reservedWord:e})=>`Escape sequence in keyword ${e}.`,InvalidIdentifier:({identifierName:e})=>`Invalid identifier ${e}.`,InvalidLhs:({ancestor:e})=>`Invalid left-hand side in ${Ta(e)}.`,InvalidLhsBinding:({ancestor:e})=>`Binding invalid left-hand side in ${Ta(e)}.`,InvalidLhsOptionalChaining:({ancestor:e})=>`Invalid optional chaining in the left-hand side of ${Ta(e)}.`,InvalidNumber:"Invalid number.",InvalidOrMissingExponent:"Floating-point numbers require a valid exponent after the 'e'.",InvalidOrUnexpectedToken:({unexpected:e})=>`Unexpected character '${e}'.`,InvalidParenthesizedAssignment:"Invalid parenthesized assignment pattern.",InvalidPrivateFieldResolution:({identifierName:e})=>`Private name #${e} is not defined.`,InvalidPropertyBindingPattern:"Binding member expression.",InvalidRecordProperty:"Only properties and spread elements are allowed in record definitions.",InvalidRestAssignmentPattern:"Invalid rest operator's argument.",LabelRedeclaration:({labelName:e})=>`Label '${e}' is already declared.`,LetInLexicalBinding:"'let' is disallowed as a lexically bound name.",LineTerminatorBeforeArrow:"No line break is allowed before '=>'.",MalformedRegExpFlags:"Invalid regular expression flag.",MissingClassName:"A class name is required.",MissingEqInAssignment:"Only '=' operator can be used for specifying default value.",MissingSemicolon:"Missing semicolon.",MissingPlugin:({missingPlugin:e})=>`This experimental syntax requires enabling the parser plugin: ${e.map(r=>JSON.stringify(r)).join(", ")}.`,MissingOneOfPlugins:({missingPlugin:e})=>`This experimental syntax requires enabling one of the following parser plugin(s): ${e.map(r=>JSON.stringify(r)).join(", ")}.`,MissingUnicodeEscape:"Expecting Unicode escape sequence \\uXXXX.",MixingCoalesceWithLogical:"Nullish coalescing operator(??) requires parens when mixing with logical operators.",ModuleAttributeDifferentFromType:"The only accepted module attribute is `type`.",ModuleAttributeInvalidValue:"Only string literals are allowed as module attribute values.",ModuleAttributesWithDuplicateKeys:({key:e})=>`Duplicate key "${e}" is not allowed in module attributes.`,ModuleExportNameHasLoneSurrogate:({surrogateCharCode:e})=>`An export name cannot include a lone surrogate, found '\\u${e.toString(16)}'.`,ModuleExportUndefined:({localName:e})=>`Export '${e}' is not defined.`,MultipleDefaultsInSwitch:"Multiple default clauses.",NewlineAfterThrow:"Illegal newline after throw.",NoCatchOrFinally:"Missing catch or finally clause.",NumberIdentifier:"Identifier directly after number.",NumericSeparatorInEscapeSequence:"Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.",ObsoleteAwaitStar:"'await*' has been removed from the async functions proposal. Use Promise.all() instead.",OptionalChainingNoNew:"Constructors in/after an Optional Chain are not allowed.",OptionalChainingNoTemplate:"Tagged Template Literals are not allowed in optionalChain.",OverrideOnConstructor:"'override' modifier cannot appear on a constructor declaration.",ParamDupe:"Argument name clash.",PatternHasAccessor:"Object pattern can't contain getter or setter.",PatternHasMethod:"Object pattern can't contain methods.",PrivateInExpectedIn:({identifierName:e})=>`Private names are only allowed in property accesses (\`obj.#${e}\`) or in \`in\` expressions (\`#${e} in obj\`).`,PrivateNameRedeclaration:({identifierName:e})=>`Duplicate private name #${e}.`,RecordExpressionBarIncorrectEndSyntaxType:"Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionBarIncorrectStartSyntaxType:"Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionHashIncorrectStartSyntaxType:"Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",RecordNoProto:"'__proto__' is not allowed in Record expressions.",RestTrailingComma:"Unexpected trailing comma after rest element.",SloppyFunction:"In non-strict mode code, functions can only be declared at top level or inside a block.",SloppyFunctionAnnexB:"In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.",SourcePhaseImportRequiresDefault:'Only `import source x from "./module"` is valid.',StaticPrototype:"Classes may not have static property named prototype.",SuperNotAllowed:"`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?",SuperPrivateField:"Private fields can't be accessed on super.",TrailingDecorator:"Decorators must be attached to a class element.",TupleExpressionBarIncorrectEndSyntaxType:"Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionBarIncorrectStartSyntaxType:"Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionHashIncorrectStartSyntaxType:"Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",UnexpectedArgumentPlaceholder:"Unexpected argument placeholder.",UnexpectedAwaitAfterPipelineBody:'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.',UnexpectedDigitAfterHash:"Unexpected digit after hash token.",UnexpectedImportExport:"'import' and 'export' may only appear at the top level.",UnexpectedKeyword:({keyword:e})=>`Unexpected keyword '${e}'.`,UnexpectedLeadingDecorator:"Leading decorators must be attached to a class declaration.",UnexpectedLexicalDeclaration:"Lexical declaration cannot appear in a single-statement context.",UnexpectedNewTarget:"`new.target` can only be used in functions or class properties.",UnexpectedNumericSeparator:"A numeric separator is only allowed between two digits.",UnexpectedPrivateField:"Unexpected private name.",UnexpectedReservedWord:({reservedWord:e})=>`Unexpected reserved word '${e}'.`,UnexpectedSuper:"'super' is only allowed in object methods and classes.",UnexpectedToken:({expected:e,unexpected:r})=>`Unexpected token${r?` '${r}'.`:""}${e?`, expected "${e}"`:""}`,UnexpectedTokenUnaryExponentiation:"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.",UnexpectedUsingDeclaration:"Using declaration cannot appear in the top level when source type is `script`.",UnsupportedBind:"Binding should be performed on object property.",UnsupportedDecoratorExport:"A decorated export must export a class declaration.",UnsupportedDefaultExport:"Only expressions, functions or classes are allowed as the `default` export.",UnsupportedImport:"`import` can only be used in `import()` or `import.meta`.",UnsupportedMetaProperty:({target:e,onlyValidPropertyName:r})=>`The only valid meta property for ${e} is ${e}.${r}.`,UnsupportedParameterDecorator:"Decorators cannot be used to decorate parameters.",UnsupportedPropertyDecorator:"Decorators cannot be used to decorate object literal properties.",UnsupportedSuper:"'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).",UnterminatedComment:"Unterminated comment.",UnterminatedRegExp:"Unterminated regular expression.",UnterminatedString:"Unterminated string constant.",UnterminatedTemplate:"Unterminated template.",UsingDeclarationExport:"Using declaration cannot be exported.",UsingDeclarationHasBindingPattern:"Using declaration cannot have destructuring patterns.",VarRedeclaration:({identifierName:e})=>`Identifier '${e}' has already been declared.`,YieldBindingIdentifier:"Can not use 'yield' as identifier inside a generator.",YieldInParameter:"Yield expression is not allowed in formal parameters.",ZeroDigitNumericSeparator:"Numeric separator can not be used after leading 0."},rv={StrictDelete:"Deleting local variable in strict mode.",StrictEvalArguments:({referenceName:e})=>`Assigning to '${e}' in strict mode.`,StrictEvalArgumentsBinding:({bindingName:e})=>`Binding '${e}' in strict mode.`,StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block.",StrictNumericEscape:"The only valid numeric escape in strict mode is '\\0'.",StrictOctalLiteral:"Legacy octal literals are not allowed in strict mode.",StrictWith:"'with' in strict mode."},nv=new Set(["ArrowFunctionExpression","AssignmentExpression","ConditionalExpression","YieldExpression"]),iv={PipeBodyIsTighter:"Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.",PipeTopicRequiresHackPipes:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.',PipeTopicUnbound:"Topic reference is unbound; it must be inside a pipe body.",PipeTopicUnconfiguredToken:({token:e})=>`Invalid topic token ${e}. In order to use ${e} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${e}" }.`,PipeTopicUnused:"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.",PipeUnparenthesizedBody:({type:e})=>`Hack-style pipe body cannot be an unparenthesized ${Ta({type:e})}; please wrap it in parentheses.`,PipelineBodyNoArrow:'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized.',PipelineBodySequenceExpression:"Pipeline body may not be a comma-separated sequence expression.",PipelineHeadSequenceExpression:"Pipeline head should not be a comma-separated sequence expression.",PipelineTopicUnused:"Pipeline is in topic style but does not use topic reference.",PrimaryTopicNotAllowed:"Topic reference was used in a lexical context without topic binding.",PrimaryTopicRequiresSmartPipeline:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.'},sv=["message"];function wy(e,r,t){Object.defineProperty(e,r,{enumerable:!1,configurable:!0,value:t})}function ov({toMessage:e,code:r,reasonCode:t,syntaxPlugin:n}){let i=t==="MissingPlugin"||t==="MissingOneOfPlugins";{let s={AccessorCannotDeclareThisParameter:"AccesorCannotDeclareThisParameter",AccessorCannotHaveTypeParameters:"AccesorCannotHaveTypeParameters",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference",SetAccessorCannotHaveOptionalParameter:"SetAccesorCannotHaveOptionalParameter",SetAccessorCannotHaveRestParameter:"SetAccesorCannotHaveRestParameter",SetAccessorCannotHaveReturnType:"SetAccesorCannotHaveReturnType"};s[t]&&(t=s[t])}return function s(o,a){let l=new SyntaxError;return l.code=r,l.reasonCode=t,l.loc=o,l.pos=o.index,l.syntaxPlugin=n,i&&(l.missingPlugin=a.missingPlugin),wy(l,"clone",function(c={}){var p;let{line:d,column:f,index:m}=(p=c.loc)!=null?p:o;return s(new Lr(d,f,m),Object.assign({},a,c.details))}),wy(l,"details",a),Object.defineProperty(l,"message",{configurable:!0,get(){let u=`${e(a)} (${o.line}:${o.column})`;return this.message=u,u},set(u){Object.defineProperty(this,"message",{value:u,writable:!0})}}),l}}function an(e,r){if(Array.isArray(e))return n=>an(n,e[0]);let t={};for(let n of Object.keys(e)){let i=e[n],s=typeof i=="string"?{message:()=>i}:typeof i=="function"?{message:i}:i,{message:o}=s,a=ZA(s,sv),l=typeof o=="string"?()=>o:o;t[n]=ov(Object.assign({code:"BABEL_PARSER_SYNTAX_ERROR",reasonCode:n,toMessage:l},r?{syntaxPlugin:r}:{},a))}return t}var S=Object.assign({},an(ev),an(tv),an(rv),an`pipelineOperator`(iv)),{defineProperty:av}=Object,Ty=(e,r)=>{e&&av(e,r,{enumerable:!1,value:e[r]})};function Us(e){return Ty(e.loc.start,"index"),Ty(e.loc.end,"index"),e}var lv=e=>class extends e{parse(){let t=Us(super.parse());return this.options.tokens&&(t.tokens=t.tokens.map(Us)),t}parseRegExpLiteral({pattern:t,flags:n}){let i=null;try{i=new RegExp(t,n)}catch{}let s=this.estreeParseLiteral(i);return s.regex={pattern:t,flags:n},s}parseBigIntLiteral(t){let n;try{n=BigInt(t)}catch{n=null}let i=this.estreeParseLiteral(n);return i.bigint=String(i.value||t),i}parseDecimalLiteral(t){let i=this.estreeParseLiteral(null);return i.decimal=String(i.value||t),i}estreeParseLiteral(t){return this.parseLiteral(t,"Literal")}parseStringLiteral(t){return this.estreeParseLiteral(t)}parseNumericLiteral(t){return this.estreeParseLiteral(t)}parseNullLiteral(){return this.estreeParseLiteral(null)}parseBooleanLiteral(t){return this.estreeParseLiteral(t)}directiveToStmt(t){let n=t.value;delete t.value,n.type="Literal",n.raw=n.extra.raw,n.value=n.extra.expressionValue;let i=t;return i.type="ExpressionStatement",i.expression=n,i.directive=n.extra.rawValue,delete n.extra,i}initFunction(t,n){super.initFunction(t,n),t.expression=!1}checkDeclaration(t){t!=null&&this.isObjectProperty(t)?this.checkDeclaration(t.value):super.checkDeclaration(t)}getObjectOrClassMethodParams(t){return t.value.params}isValidDirective(t){var n;return t.type==="ExpressionStatement"&&t.expression.type==="Literal"&&typeof t.expression.value=="string"&&!((n=t.expression.extra)!=null&&n.parenthesized)}parseBlockBody(t,n,i,s,o){super.parseBlockBody(t,n,i,s,o);let a=t.directives.map(l=>this.directiveToStmt(l));t.body=a.concat(t.body),delete t.directives}pushClassMethod(t,n,i,s,o,a){this.parseMethod(n,i,s,o,a,"ClassMethod",!0),n.typeParameters&&(n.value.typeParameters=n.typeParameters,delete n.typeParameters),t.body.push(n)}parsePrivateName(){let t=super.parsePrivateName();return this.getPluginOption("estree","classFeatures")?this.convertPrivateNameToPrivateIdentifier(t):t}convertPrivateNameToPrivateIdentifier(t){let n=super.getPrivateNameSV(t);return t=t,delete t.id,t.name=n,t.type="PrivateIdentifier",t}isPrivateName(t){return this.getPluginOption("estree","classFeatures")?t.type==="PrivateIdentifier":super.isPrivateName(t)}getPrivateNameSV(t){return this.getPluginOption("estree","classFeatures")?t.name:super.getPrivateNameSV(t)}parseLiteral(t,n){let i=super.parseLiteral(t,n);return i.raw=i.extra.raw,delete i.extra,i}parseFunctionBody(t,n,i=!1){super.parseFunctionBody(t,n,i),t.expression=t.body.type!=="BlockStatement"}parseMethod(t,n,i,s,o,a,l=!1){let u=this.startNode();return u.kind=t.kind,u=super.parseMethod(u,n,i,s,o,a,l),u.type="FunctionExpression",delete u.kind,t.value=u,a==="ClassPrivateMethod"&&(t.computed=!1),this.finishNode(t,"MethodDefinition")}nameIsConstructor(t){return t.type==="Literal"?t.value==="constructor":super.nameIsConstructor(t)}parseClassProperty(...t){let n=super.parseClassProperty(...t);return this.getPluginOption("estree","classFeatures")&&(n.type="PropertyDefinition"),n}parseClassPrivateProperty(...t){let n=super.parseClassPrivateProperty(...t);return this.getPluginOption("estree","classFeatures")&&(n.type="PropertyDefinition",n.computed=!1),n}parseObjectMethod(t,n,i,s,o){let a=super.parseObjectMethod(t,n,i,s,o);return a&&(a.type="Property",a.kind==="method"&&(a.kind="init"),a.shorthand=!1),a}parseObjectProperty(t,n,i,s){let o=super.parseObjectProperty(t,n,i,s);return o&&(o.kind="init",o.type="Property"),o}isValidLVal(t,n,i){return t==="Property"?"value":super.isValidLVal(t,n,i)}isAssignable(t,n){return t!=null&&this.isObjectProperty(t)?this.isAssignable(t.value,n):super.isAssignable(t,n)}toAssignable(t,n=!1){if(t!=null&&this.isObjectProperty(t)){let{key:i,value:s}=t;this.isPrivateName(i)&&this.classScope.usePrivateName(this.getPrivateNameSV(i),i.loc.start),this.toAssignable(s,n)}else super.toAssignable(t,n)}toAssignableObjectExpressionProp(t,n,i){t.type==="Property"&&(t.kind==="get"||t.kind==="set")?this.raise(S.PatternHasAccessor,t.key):t.type==="Property"&&t.method?this.raise(S.PatternHasMethod,t.key):super.toAssignableObjectExpressionProp(t,n,i)}finishCallExpression(t,n){let i=super.finishCallExpression(t,n);if(i.callee.type==="Import"){if(i.type="ImportExpression",i.source=i.arguments[0],this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions")){var s,o;i.options=(s=i.arguments[1])!=null?s:null,i.attributes=(o=i.arguments[1])!=null?o:null}delete i.arguments,delete i.callee}return i}toReferencedArguments(t){t.type!=="ImportExpression"&&super.toReferencedArguments(t)}parseExport(t,n){let i=this.state.lastTokStartLoc,s=super.parseExport(t,n);switch(s.type){case"ExportAllDeclaration":s.exported=null;break;case"ExportNamedDeclaration":s.specifiers.length===1&&s.specifiers[0].type==="ExportNamespaceSpecifier"&&(s.type="ExportAllDeclaration",s.exported=s.specifiers[0].exported,delete s.specifiers);case"ExportDefaultDeclaration":{var o;let{declaration:a}=s;a?.type==="ClassDeclaration"&&((o=a.decorators)==null?void 0:o.length)>0&&a.start===s.start&&this.resetStartLocation(s,i)}break}return s}parseSubscript(t,n,i,s){let o=super.parseSubscript(t,n,i,s);if(s.optionalChainMember){if((o.type==="OptionalMemberExpression"||o.type==="OptionalCallExpression")&&(o.type=o.type.substring(8)),s.stop){let a=this.startNodeAtNode(o);return a.expression=o,this.finishNode(a,"ChainExpression")}}else(o.type==="MemberExpression"||o.type==="CallExpression")&&(o.optional=!1);return o}isOptionalMemberExpression(t){return t.type==="ChainExpression"?t.expression.type==="MemberExpression":super.isOptionalMemberExpression(t)}hasPropertyAsPrivateName(t){return t.type==="ChainExpression"&&(t=t.expression),super.hasPropertyAsPrivateName(t)}isObjectProperty(t){return t.type==="Property"&&t.kind==="init"&&!t.method}isObjectMethod(t){return t.type==="Property"&&(t.method||t.kind==="get"||t.kind==="set")}finishNodeAt(t,n,i){return Us(super.finishNodeAt(t,n,i))}resetStartLocation(t,n){super.resetStartLocation(t,n),Us(t)}resetEndLocation(t,n=this.state.lastTokEndLoc){super.resetEndLocation(t,n),Us(t)}},ti=class{constructor(r,t){this.token=void 0,this.preserveSpace=void 0,this.token=r,this.preserveSpace=!!t}},_e={brace:new ti("{"),j_oTag:new ti("<tag"),j_cTag:new ti("</tag"),j_expr:new ti("<tag>...</tag>",!0)};_e.template=new ti("`",!0);var me=!0,j=!0,mc=!0,js=!0,vn=!0,uv=!0,Pa=class{constructor(r,t={}){this.label=void 0,this.keyword=void 0,this.beforeExpr=void 0,this.startsExpr=void 0,this.rightAssociative=void 0,this.isLoop=void 0,this.isAssign=void 0,this.prefix=void 0,this.postfix=void 0,this.binop=void 0,this.label=r,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.rightAssociative=!!t.rightAssociative,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop!=null?t.binop:null,this.updateContext=null}},Uc=new Map;function be(e,r={}){r.keyword=e;let t=J(e,r);return Uc.set(e,t),t}function Ft(e,r){return J(e,{beforeExpr:me,binop:r})}var qs=-1,sn=[],jc=[],Kc=[],Vc=[],zc=[],qc=[];function J(e,r={}){var t,n,i,s;return++qs,jc.push(e),Kc.push((t=r.binop)!=null?t:-1),Vc.push((n=r.beforeExpr)!=null?n:!1),zc.push((i=r.startsExpr)!=null?i:!1),qc.push((s=r.prefix)!=null?s:!1),sn.push(new Pa(e,r)),qs}function fe(e,r={}){var t,n,i,s;return++qs,Uc.set(e,qs),jc.push(e),Kc.push((t=r.binop)!=null?t:-1),Vc.push((n=r.beforeExpr)!=null?n:!1),zc.push((i=r.startsExpr)!=null?i:!1),qc.push((s=r.prefix)!=null?s:!1),sn.push(new Pa("name",r)),qs}var cv={bracketL:J("[",{beforeExpr:me,startsExpr:j}),bracketHashL:J("#[",{beforeExpr:me,startsExpr:j}),bracketBarL:J("[|",{beforeExpr:me,startsExpr:j}),bracketR:J("]"),bracketBarR:J("|]"),braceL:J("{",{beforeExpr:me,startsExpr:j}),braceBarL:J("{|",{beforeExpr:me,startsExpr:j}),braceHashL:J("#{",{beforeExpr:me,startsExpr:j}),braceR:J("}"),braceBarR:J("|}"),parenL:J("(",{beforeExpr:me,startsExpr:j}),parenR:J(")"),comma:J(",",{beforeExpr:me}),semi:J(";",{beforeExpr:me}),colon:J(":",{beforeExpr:me}),doubleColon:J("::",{beforeExpr:me}),dot:J("."),question:J("?",{beforeExpr:me}),questionDot:J("?."),arrow:J("=>",{beforeExpr:me}),template:J("template"),ellipsis:J("...",{beforeExpr:me}),backQuote:J("`",{startsExpr:j}),dollarBraceL:J("${",{beforeExpr:me,startsExpr:j}),templateTail:J("...`",{startsExpr:j}),templateNonTail:J("...${",{beforeExpr:me,startsExpr:j}),at:J("@"),hash:J("#",{startsExpr:j}),interpreterDirective:J("#!..."),eq:J("=",{beforeExpr:me,isAssign:js}),assign:J("_=",{beforeExpr:me,isAssign:js}),slashAssign:J("_=",{beforeExpr:me,isAssign:js}),xorAssign:J("_=",{beforeExpr:me,isAssign:js}),moduloAssign:J("_=",{beforeExpr:me,isAssign:js}),incDec:J("++/--",{prefix:vn,postfix:uv,startsExpr:j}),bang:J("!",{beforeExpr:me,prefix:vn,startsExpr:j}),tilde:J("~",{beforeExpr:me,prefix:vn,startsExpr:j}),doubleCaret:J("^^",{startsExpr:j}),doubleAt:J("@@",{startsExpr:j}),pipeline:Ft("|>",0),nullishCoalescing:Ft("??",1),logicalOR:Ft("||",1),logicalAND:Ft("&&",2),bitwiseOR:Ft("|",3),bitwiseXOR:Ft("^",4),bitwiseAND:Ft("&",5),equality:Ft("==/!=/===/!==",6),lt:Ft("</>/<=/>=",7),gt:Ft("</>/<=/>=",7),relational:Ft("</>/<=/>=",7),bitShift:Ft("<</>>/>>>",8),bitShiftL:Ft("<</>>/>>>",8),bitShiftR:Ft("<</>>/>>>",8),plusMin:J("+/-",{beforeExpr:me,binop:9,prefix:vn,startsExpr:j}),modulo:J("%",{binop:10,startsExpr:j}),star:J("*",{binop:10}),slash:Ft("/",10),exponent:J("**",{beforeExpr:me,binop:11,rightAssociative:!0}),_in:be("in",{beforeExpr:me,binop:7}),_instanceof:be("instanceof",{beforeExpr:me,binop:7}),_break:be("break"),_case:be("case",{beforeExpr:me}),_catch:be("catch"),_continue:be("continue"),_debugger:be("debugger"),_default:be("default",{beforeExpr:me}),_else:be("else",{beforeExpr:me}),_finally:be("finally"),_function:be("function",{startsExpr:j}),_if:be("if"),_return:be("return",{beforeExpr:me}),_switch:be("switch"),_throw:be("throw",{beforeExpr:me,prefix:vn,startsExpr:j}),_try:be("try"),_var:be("var"),_const:be("const"),_with:be("with"),_new:be("new",{beforeExpr:me,startsExpr:j}),_this:be("this",{startsExpr:j}),_super:be("super",{startsExpr:j}),_class:be("class",{startsExpr:j}),_extends:be("extends",{beforeExpr:me}),_export:be("export"),_import:be("import",{startsExpr:j}),_null:be("null",{startsExpr:j}),_true:be("true",{startsExpr:j}),_false:be("false",{startsExpr:j}),_typeof:be("typeof",{beforeExpr:me,prefix:vn,startsExpr:j}),_void:be("void",{beforeExpr:me,prefix:vn,startsExpr:j}),_delete:be("delete",{beforeExpr:me,prefix:vn,startsExpr:j}),_do:be("do",{isLoop:mc,beforeExpr:me}),_for:be("for",{isLoop:mc}),_while:be("while",{isLoop:mc}),_as:fe("as",{startsExpr:j}),_assert:fe("assert",{startsExpr:j}),_async:fe("async",{startsExpr:j}),_await:fe("await",{startsExpr:j}),_defer:fe("defer",{startsExpr:j}),_from:fe("from",{startsExpr:j}),_get:fe("get",{startsExpr:j}),_let:fe("let",{startsExpr:j}),_meta:fe("meta",{startsExpr:j}),_of:fe("of",{startsExpr:j}),_sent:fe("sent",{startsExpr:j}),_set:fe("set",{startsExpr:j}),_source:fe("source",{startsExpr:j}),_static:fe("static",{startsExpr:j}),_using:fe("using",{startsExpr:j}),_yield:fe("yield",{startsExpr:j}),_asserts:fe("asserts",{startsExpr:j}),_checks:fe("checks",{startsExpr:j}),_exports:fe("exports",{startsExpr:j}),_global:fe("global",{startsExpr:j}),_implements:fe("implements",{startsExpr:j}),_intrinsic:fe("intrinsic",{startsExpr:j}),_infer:fe("infer",{startsExpr:j}),_is:fe("is",{startsExpr:j}),_mixins:fe("mixins",{startsExpr:j}),_proto:fe("proto",{startsExpr:j}),_require:fe("require",{startsExpr:j}),_satisfies:fe("satisfies",{startsExpr:j}),_keyof:fe("keyof",{startsExpr:j}),_readonly:fe("readonly",{startsExpr:j}),_unique:fe("unique",{startsExpr:j}),_abstract:fe("abstract",{startsExpr:j}),_declare:fe("declare",{startsExpr:j}),_enum:fe("enum",{startsExpr:j}),_module:fe("module",{startsExpr:j}),_namespace:fe("namespace",{startsExpr:j}),_interface:fe("interface",{startsExpr:j}),_type:fe("type",{startsExpr:j}),_opaque:fe("opaque",{startsExpr:j}),name:J("name",{startsExpr:j}),string:J("string",{startsExpr:j}),num:J("num",{startsExpr:j}),bigint:J("bigint",{startsExpr:j}),decimal:J("decimal",{startsExpr:j}),regexp:J("regexp",{startsExpr:j}),privateName:J("#name",{startsExpr:j}),eof:J("eof"),jsxName:J("jsxName"),jsxText:J("jsxText",{beforeExpr:!0}),jsxTagStart:J("jsxTagStart",{startsExpr:!0}),jsxTagEnd:J("jsxTagEnd"),placeholder:J("%%",{startsExpr:!0})};function we(e){return e>=93&&e<=132}function pv(e){return e<=92}function hr(e){return e>=58&&e<=132}function By(e){return e>=58&&e<=136}function dv(e){return Vc[e]}function xc(e){return zc[e]}function fv(e){return e>=29&&e<=33}function Ay(e){return e>=129&&e<=131}function mv(e){return e>=90&&e<=92}function Wc(e){return e>=58&&e<=92}function hv(e){return e>=39&&e<=59}function gv(e){return e===34}function yv(e){return qc[e]}function Dv(e){return e>=121&&e<=123}function bv(e){return e>=124&&e<=130}function In(e){return jc[e]}function Aa(e){return Kc[e]}function xv(e){return e===57}function Ia(e){return e>=24&&e<=25}function nn(e){return sn[e]}sn[8].updateContext=e=>{e.pop()},sn[5].updateContext=sn[7].updateContext=sn[23].updateContext=e=>{e.push(_e.brace)},sn[22].updateContext=e=>{e[e.length-1]===_e.template?e.pop():e.push(_e.template)},sn[142].updateContext=e=>{e.push(_e.j_expr,_e.j_oTag)};var Gc="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",My="\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",Ev=new RegExp("["+Gc+"]"),Cv=new RegExp("["+Gc+My+"]");Gc=My=null;var $y=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,2,60,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,496,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],Sv=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,343,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239];function Ec(e,r){let t=65536;for(let n=0,i=r.length;n<i;n+=2){if(t+=r[n],t>e)return!1;if(t+=r[n+1],t>=e)return!0}return!1}function on(e){return e<65?e===36:e<=90?!0:e<97?e===95:e<=122?!0:e<=65535?e>=170&&Ev.test(String.fromCharCode(e)):Ec(e,$y)}function $i(e){return e<48?e===36:e<58?!0:e<65?!1:e<=90?!0:e<97?e===95:e<=122?!0:e<=65535?e>=170&&Cv.test(String.fromCharCode(e)):Ec(e,$y)||Ec(e,Sv)}var Hc={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"],strictBind:["eval","arguments"]},wv=new Set(Hc.keyword),Tv=new Set(Hc.strict),Av=new Set(Hc.strictBind);function Uy(e,r){return r&&e==="await"||e==="enum"}function jy(e,r){return Uy(e,r)||Tv.has(e)}function Ky(e){return Av.has(e)}function Vy(e,r){return jy(e,r)||Ky(e)}function vv(e){return wv.has(e)}function Pv(e,r,t){return e===64&&r===64&&on(t)}var Iv=new Set(["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete","implements","interface","let","package","private","protected","public","static","yield","eval","arguments","enum","await"]);function Nv(e){return Iv.has(e)}var Ws=class{constructor(r){this.flags=0,this.names=new Map,this.firstLexicalName="",this.flags=r}},Gs=class{constructor(r,t){this.parser=void 0,this.scopeStack=[],this.inModule=void 0,this.undefinedExports=new Map,this.parser=r,this.inModule=t}get inTopLevel(){return(this.currentScope().flags&1)>0}get inFunction(){return(this.currentVarScopeFlags()&2)>0}get allowSuper(){return(this.currentThisScopeFlags()&16)>0}get allowDirectSuper(){return(this.currentThisScopeFlags()&32)>0}get inClass(){return(this.currentThisScopeFlags()&64)>0}get inClassAndNotInNonArrowFunction(){let r=this.currentThisScopeFlags();return(r&64)>0&&(r&2)===0}get inStaticBlock(){for(let r=this.scopeStack.length-1;;r--){let{flags:t}=this.scopeStack[r];if(t&128)return!0;if(t&451)return!1}}get inNonArrowFunction(){return(this.currentThisScopeFlags()&2)>0}get treatFunctionsAsVar(){return this.treatFunctionsAsVarInScope(this.currentScope())}createScope(r){return new Ws(r)}enter(r){this.scopeStack.push(this.createScope(r))}exit(){return this.scopeStack.pop().flags}treatFunctionsAsVarInScope(r){return!!(r.flags&130||!this.parser.inModule&&r.flags&1)}declareName(r,t,n){let i=this.currentScope();if(t&8||t&16){this.checkRedeclarationInScope(i,r,t,n);let s=i.names.get(r)||0;t&16?s=s|4:(i.firstLexicalName||(i.firstLexicalName=r),s=s|2),i.names.set(r,s),t&8&&this.maybeExportDefined(i,r)}else if(t&4)for(let s=this.scopeStack.length-1;s>=0&&(i=this.scopeStack[s],this.checkRedeclarationInScope(i,r,t,n),i.names.set(r,(i.names.get(r)||0)|1),this.maybeExportDefined(i,r),!(i.flags&387));--s);this.parser.inModule&&i.flags&1&&this.undefinedExports.delete(r)}maybeExportDefined(r,t){this.parser.inModule&&r.flags&1&&this.undefinedExports.delete(t)}checkRedeclarationInScope(r,t,n,i){this.isRedeclaredInScope(r,t,n)&&this.parser.raise(S.VarRedeclaration,i,{identifierName:t})}isRedeclaredInScope(r,t,n){if(!(n&1))return!1;if(n&8)return r.names.has(t);let i=r.names.get(t);return n&16?(i&2)>0||!this.treatFunctionsAsVarInScope(r)&&(i&1)>0:(i&2)>0&&!(r.flags&8&&r.firstLexicalName===t)||!this.treatFunctionsAsVarInScope(r)&&(i&4)>0}checkLocalExport(r){let{name:t}=r;this.scopeStack[0].names.has(t)||this.undefinedExports.set(t,r.loc.start)}currentScope(){return this.scopeStack[this.scopeStack.length-1]}currentVarScopeFlags(){for(let r=this.scopeStack.length-1;;r--){let{flags:t}=this.scopeStack[r];if(t&387)return t}}currentThisScopeFlags(){for(let r=this.scopeStack.length-1;;r--){let{flags:t}=this.scopeStack[r];if(t&451&&!(t&4))return t}}},Cc=class extends Ws{constructor(...r){super(...r),this.declareFunctions=new Set}},Sc=class extends Gs{createScope(r){return new Cc(r)}declareName(r,t,n){let i=this.currentScope();if(t&2048){this.checkRedeclarationInScope(i,r,t,n),this.maybeExportDefined(i,r),i.declareFunctions.add(r);return}super.declareName(r,t,n)}isRedeclaredInScope(r,t,n){if(super.isRedeclaredInScope(r,t,n))return!0;if(n&2048&&!r.declareFunctions.has(t)){let i=r.names.get(t);return(i&4)>0||(i&2)>0}return!1}checkLocalExport(r){this.scopeStack[0].declareFunctions.has(r.name)||super.checkLocalExport(r)}},wc=class{constructor(){this.sawUnambiguousESM=!1,this.ambiguousScriptDifferentAst=!1}hasPlugin(r){if(typeof r=="string")return this.plugins.has(r);{let[t,n]=r;if(!this.hasPlugin(t))return!1;let i=this.plugins.get(t);for(let s of Object.keys(n))if(i?.[s]!==n[s])return!1;return!0}}getPluginOption(r,t){var n;return(n=this.plugins.get(r))==null?void 0:n[t]}};function zy(e,r){e.trailingComments===void 0?e.trailingComments=r:e.trailingComments.unshift(...r)}function Fv(e,r){e.leadingComments===void 0?e.leadingComments=r:e.leadingComments.unshift(...r)}function Hs(e,r){e.innerComments===void 0?e.innerComments=r:e.innerComments.unshift(...r)}function Ks(e,r,t){let n=null,i=r.length;for(;n===null&&i>0;)n=r[--i];n===null||n.start>t.start?Hs(e,t.comments):zy(n,t.comments)}var Tc=class extends wc{addComment(r){this.filename&&(r.loc.filename=this.filename);let{commentsLen:t}=this.state;this.comments.length!==t&&(this.comments.length=t),this.comments.push(r),this.state.commentsLen++}processComment(r){let{commentStack:t}=this.state,n=t.length;if(n===0)return;let i=n-1,s=t[i];s.start===r.end&&(s.leadingNode=r,i--);let{start:o}=r;for(;i>=0;i--){let a=t[i],l=a.end;if(l>o)a.containingNode=r,this.finalizeComment(a),t.splice(i,1);else{l===o&&(a.trailingNode=r);break}}}finalizeComment(r){let{comments:t}=r;if(r.leadingNode!==null||r.trailingNode!==null)r.leadingNode!==null&&zy(r.leadingNode,t),r.trailingNode!==null&&Fv(r.trailingNode,t);else{let{containingNode:n,start:i}=r;if(this.input.charCodeAt(i-1)===44)switch(n.type){case"ObjectExpression":case"ObjectPattern":case"RecordExpression":Ks(n,n.properties,r);break;case"CallExpression":case"OptionalCallExpression":Ks(n,n.arguments,r);break;case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":case"ObjectMethod":case"ClassMethod":case"ClassPrivateMethod":Ks(n,n.params,r);break;case"ArrayExpression":case"ArrayPattern":case"TupleExpression":Ks(n,n.elements,r);break;case"ExportNamedDeclaration":case"ImportDeclaration":Ks(n,n.specifiers,r);break;default:Hs(n,t)}else Hs(n,t)}}finalizeRemainingComments(){let{commentStack:r}=this.state;for(let t=r.length-1;t>=0;t--)this.finalizeComment(r[t]);this.state.commentStack=[]}resetPreviousNodeTrailingComments(r){let{commentStack:t}=this.state,{length:n}=t;if(n===0)return;let i=t[n-1];i.leadingNode===r&&(i.leadingNode=null)}resetPreviousIdentifierLeadingComments(r){let{commentStack:t}=this.state,{length:n}=t;n!==0&&(t[n-1].trailingNode===r?t[n-1].trailingNode=null:n>=2&&t[n-2].trailingNode===r&&(t[n-2].trailingNode=null))}takeSurroundingComments(r,t,n){let{commentStack:i}=this.state,s=i.length;if(s===0)return;let o=s-1;for(;o>=0;o--){let a=i[o],l=a.end;if(a.start===n)a.leadingNode=r;else if(l===t)a.trailingNode=r;else if(l<t)break}}},_v=/\r\n|[\r\n\u2028\u2029]/,Sa=new RegExp(_v.source,"g");function Ui(e){switch(e){case 10:case 13:case 8232:case 8233:return!0;default:return!1}}function vy(e,r,t){for(let n=r;n<t;n++)if(Ui(e.charCodeAt(n)))return!0;return!1}var hc=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,gc=/(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g;function kv(e){switch(e){case 9:case 11:case 12:case 32:case 160:case 5760:case 8192:case 8193:case 8194:case 8195:case 8196:case 8197:case 8198:case 8199:case 8200:case 8201:case 8202:case 8239:case 8287:case 12288:case 65279:return!0;default:return!1}}var Ac=class e{constructor(){this.flags=1024,this.curLine=void 0,this.lineStart=void 0,this.startLoc=void 0,this.endLoc=void 0,this.errors=[],this.potentialArrowAt=-1,this.noArrowAt=[],this.noArrowParamsConversionAt=[],this.topicContext={maxNumOfResolvableTopics:0,maxTopicIndex:null},this.labels=[],this.commentsLen=0,this.commentStack=[],this.pos=0,this.type=139,this.value=null,this.start=0,this.end=0,this.lastTokEndLoc=null,this.lastTokStartLoc=null,this.context=[_e.brace],this.firstInvalidTemplateEscapePos=null,this.strictErrors=new Map,this.tokensLength=0}get strict(){return(this.flags&1)>0}set strict(r){r?this.flags|=1:this.flags&=-2}init({strictMode:r,sourceType:t,startLine:n,startColumn:i}){this.strict=r===!1?!1:r===!0?!0:t==="module",this.curLine=n,this.lineStart=-i,this.startLoc=this.endLoc=new Lr(n,i,0)}get maybeInArrowParameters(){return(this.flags&2)>0}set maybeInArrowParameters(r){r?this.flags|=2:this.flags&=-3}get inType(){return(this.flags&4)>0}set inType(r){r?this.flags|=4:this.flags&=-5}get noAnonFunctionType(){return(this.flags&8)>0}set noAnonFunctionType(r){r?this.flags|=8:this.flags&=-9}get hasFlowComment(){return(this.flags&16)>0}set hasFlowComment(r){r?this.flags|=16:this.flags&=-17}get isAmbientContext(){return(this.flags&32)>0}set isAmbientContext(r){r?this.flags|=32:this.flags&=-33}get inAbstractClass(){return(this.flags&64)>0}set inAbstractClass(r){r?this.flags|=64:this.flags&=-65}get inDisallowConditionalTypesContext(){return(this.flags&128)>0}set inDisallowConditionalTypesContext(r){r?this.flags|=128:this.flags&=-129}get soloAwait(){return(this.flags&256)>0}set soloAwait(r){r?this.flags|=256:this.flags&=-257}get inFSharpPipelineDirectBody(){return(this.flags&512)>0}set inFSharpPipelineDirectBody(r){r?this.flags|=512:this.flags&=-513}get canStartJSXElement(){return(this.flags&1024)>0}set canStartJSXElement(r){r?this.flags|=1024:this.flags&=-1025}get containsEsc(){return(this.flags&2048)>0}set containsEsc(r){r?this.flags|=2048:this.flags&=-2049}get hasTopLevelAwait(){return(this.flags&4096)>0}set hasTopLevelAwait(r){r?this.flags|=4096:this.flags&=-4097}curPosition(){return new Lr(this.curLine,this.pos-this.lineStart,this.pos)}clone(){let r=new e;return r.flags=this.flags,r.curLine=this.curLine,r.lineStart=this.lineStart,r.startLoc=this.startLoc,r.endLoc=this.endLoc,r.errors=this.errors.slice(),r.potentialArrowAt=this.potentialArrowAt,r.noArrowAt=this.noArrowAt.slice(),r.noArrowParamsConversionAt=this.noArrowParamsConversionAt.slice(),r.topicContext=this.topicContext,r.labels=this.labels.slice(),r.commentsLen=this.commentsLen,r.commentStack=this.commentStack.slice(),r.pos=this.pos,r.type=this.type,r.value=this.value,r.start=this.start,r.end=this.end,r.lastTokEndLoc=this.lastTokEndLoc,r.lastTokStartLoc=this.lastTokStartLoc,r.context=this.context.slice(),r.firstInvalidTemplateEscapePos=this.firstInvalidTemplateEscapePos,r.strictErrors=this.strictErrors,r.tokensLength=this.tokensLength,r}},Ov=function(r){return r>=48&&r<=57},Py={decBinOct:new Set([46,66,69,79,95,98,101,111]),hex:new Set([46,88,95,120])},wa={bin:e=>e===48||e===49,oct:e=>e>=48&&e<=55,dec:e=>e>=48&&e<=57,hex:e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102};function Iy(e,r,t,n,i,s){let o=t,a=n,l=i,u="",c=null,p=t,{length:d}=r;for(;;){if(t>=d){s.unterminated(o,a,l),u+=r.slice(p,t);break}let f=r.charCodeAt(t);if(Rv(e,f,r,t)){u+=r.slice(p,t);break}if(f===92){u+=r.slice(p,t);let m=Lv(r,t,n,i,e==="template",s);m.ch===null&&!c?c={pos:t,lineStart:n,curLine:i}:u+=m.ch,{pos:t,lineStart:n,curLine:i}=m,p=t}else f===8232||f===8233?(++t,++i,n=t):f===10||f===13?e==="template"?(u+=r.slice(p,t)+`
|
|
17
|
+
- Did you mean \`import { "${e}" as foo }\`?`,ImportCallArgumentTrailingComma:"Trailing comma is disallowed inside import(...) arguments.",ImportCallArity:({maxArgumentCount:e})=>`\`import()\` requires exactly ${e===1?"one argument":"one or two arguments"}.`,ImportCallNotNewExpression:"Cannot use new with import(...).",ImportCallSpreadArgument:"`...` is not allowed in `import()`.",ImportJSONBindingNotDefault:"A JSON module can only be imported with `default`.",ImportReflectionHasAssertion:"`import module x` cannot have assertions.",ImportReflectionNotBinding:'Only `import module x from "./module"` is valid.',IncompatibleRegExpUVFlags:"The 'u' and 'v' regular expression flags cannot be enabled at the same time.",InvalidBigIntLiteral:"Invalid BigIntLiteral.",InvalidCodePoint:"Code point out of bounds.",InvalidCoverInitializedName:"Invalid shorthand property initializer.",InvalidDecimal:"Invalid decimal.",InvalidDigit:({radix:e})=>`Expected number in radix ${e}.`,InvalidEscapeSequence:"Bad character escape sequence.",InvalidEscapeSequenceTemplate:"Invalid escape sequence in template.",InvalidEscapedReservedWord:({reservedWord:e})=>`Escape sequence in keyword ${e}.`,InvalidIdentifier:({identifierName:e})=>`Invalid identifier ${e}.`,InvalidLhs:({ancestor:e})=>`Invalid left-hand side in ${Ta(e)}.`,InvalidLhsBinding:({ancestor:e})=>`Binding invalid left-hand side in ${Ta(e)}.`,InvalidLhsOptionalChaining:({ancestor:e})=>`Invalid optional chaining in the left-hand side of ${Ta(e)}.`,InvalidNumber:"Invalid number.",InvalidOrMissingExponent:"Floating-point numbers require a valid exponent after the 'e'.",InvalidOrUnexpectedToken:({unexpected:e})=>`Unexpected character '${e}'.`,InvalidParenthesizedAssignment:"Invalid parenthesized assignment pattern.",InvalidPrivateFieldResolution:({identifierName:e})=>`Private name #${e} is not defined.`,InvalidPropertyBindingPattern:"Binding member expression.",InvalidRecordProperty:"Only properties and spread elements are allowed in record definitions.",InvalidRestAssignmentPattern:"Invalid rest operator's argument.",LabelRedeclaration:({labelName:e})=>`Label '${e}' is already declared.`,LetInLexicalBinding:"'let' is disallowed as a lexically bound name.",LineTerminatorBeforeArrow:"No line break is allowed before '=>'.",MalformedRegExpFlags:"Invalid regular expression flag.",MissingClassName:"A class name is required.",MissingEqInAssignment:"Only '=' operator can be used for specifying default value.",MissingSemicolon:"Missing semicolon.",MissingPlugin:({missingPlugin:e})=>`This experimental syntax requires enabling the parser plugin: ${e.map(r=>JSON.stringify(r)).join(", ")}.`,MissingOneOfPlugins:({missingPlugin:e})=>`This experimental syntax requires enabling one of the following parser plugin(s): ${e.map(r=>JSON.stringify(r)).join(", ")}.`,MissingUnicodeEscape:"Expecting Unicode escape sequence \\uXXXX.",MixingCoalesceWithLogical:"Nullish coalescing operator(??) requires parens when mixing with logical operators.",ModuleAttributeDifferentFromType:"The only accepted module attribute is `type`.",ModuleAttributeInvalidValue:"Only string literals are allowed as module attribute values.",ModuleAttributesWithDuplicateKeys:({key:e})=>`Duplicate key "${e}" is not allowed in module attributes.`,ModuleExportNameHasLoneSurrogate:({surrogateCharCode:e})=>`An export name cannot include a lone surrogate, found '\\u${e.toString(16)}'.`,ModuleExportUndefined:({localName:e})=>`Export '${e}' is not defined.`,MultipleDefaultsInSwitch:"Multiple default clauses.",NewlineAfterThrow:"Illegal newline after throw.",NoCatchOrFinally:"Missing catch or finally clause.",NumberIdentifier:"Identifier directly after number.",NumericSeparatorInEscapeSequence:"Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.",ObsoleteAwaitStar:"'await*' has been removed from the async functions proposal. Use Promise.all() instead.",OptionalChainingNoNew:"Constructors in/after an Optional Chain are not allowed.",OptionalChainingNoTemplate:"Tagged Template Literals are not allowed in optionalChain.",OverrideOnConstructor:"'override' modifier cannot appear on a constructor declaration.",ParamDupe:"Argument name clash.",PatternHasAccessor:"Object pattern can't contain getter or setter.",PatternHasMethod:"Object pattern can't contain methods.",PrivateInExpectedIn:({identifierName:e})=>`Private names are only allowed in property accesses (\`obj.#${e}\`) or in \`in\` expressions (\`#${e} in obj\`).`,PrivateNameRedeclaration:({identifierName:e})=>`Duplicate private name #${e}.`,RecordExpressionBarIncorrectEndSyntaxType:"Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionBarIncorrectStartSyntaxType:"Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionHashIncorrectStartSyntaxType:"Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",RecordNoProto:"'__proto__' is not allowed in Record expressions.",RestTrailingComma:"Unexpected trailing comma after rest element.",SloppyFunction:"In non-strict mode code, functions can only be declared at top level or inside a block.",SloppyFunctionAnnexB:"In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.",SourcePhaseImportRequiresDefault:'Only `import source x from "./module"` is valid.',StaticPrototype:"Classes may not have static property named prototype.",SuperNotAllowed:"`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?",SuperPrivateField:"Private fields can't be accessed on super.",TrailingDecorator:"Decorators must be attached to a class element.",TupleExpressionBarIncorrectEndSyntaxType:"Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionBarIncorrectStartSyntaxType:"Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionHashIncorrectStartSyntaxType:"Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",UnexpectedArgumentPlaceholder:"Unexpected argument placeholder.",UnexpectedAwaitAfterPipelineBody:'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.',UnexpectedDigitAfterHash:"Unexpected digit after hash token.",UnexpectedImportExport:"'import' and 'export' may only appear at the top level.",UnexpectedKeyword:({keyword:e})=>`Unexpected keyword '${e}'.`,UnexpectedLeadingDecorator:"Leading decorators must be attached to a class declaration.",UnexpectedLexicalDeclaration:"Lexical declaration cannot appear in a single-statement context.",UnexpectedNewTarget:"`new.target` can only be used in functions or class properties.",UnexpectedNumericSeparator:"A numeric separator is only allowed between two digits.",UnexpectedPrivateField:"Unexpected private name.",UnexpectedReservedWord:({reservedWord:e})=>`Unexpected reserved word '${e}'.`,UnexpectedSuper:"'super' is only allowed in object methods and classes.",UnexpectedToken:({expected:e,unexpected:r})=>`Unexpected token${r?` '${r}'.`:""}${e?`, expected "${e}"`:""}`,UnexpectedTokenUnaryExponentiation:"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.",UnexpectedUsingDeclaration:"Using declaration cannot appear in the top level when source type is `script`.",UnsupportedBind:"Binding should be performed on object property.",UnsupportedDecoratorExport:"A decorated export must export a class declaration.",UnsupportedDefaultExport:"Only expressions, functions or classes are allowed as the `default` export.",UnsupportedImport:"`import` can only be used in `import()` or `import.meta`.",UnsupportedMetaProperty:({target:e,onlyValidPropertyName:r})=>`The only valid meta property for ${e} is ${e}.${r}.`,UnsupportedParameterDecorator:"Decorators cannot be used to decorate parameters.",UnsupportedPropertyDecorator:"Decorators cannot be used to decorate object literal properties.",UnsupportedSuper:"'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).",UnterminatedComment:"Unterminated comment.",UnterminatedRegExp:"Unterminated regular expression.",UnterminatedString:"Unterminated string constant.",UnterminatedTemplate:"Unterminated template.",UsingDeclarationExport:"Using declaration cannot be exported.",UsingDeclarationHasBindingPattern:"Using declaration cannot have destructuring patterns.",VarRedeclaration:({identifierName:e})=>`Identifier '${e}' has already been declared.`,YieldBindingIdentifier:"Can not use 'yield' as identifier inside a generator.",YieldInParameter:"Yield expression is not allowed in formal parameters.",ZeroDigitNumericSeparator:"Numeric separator can not be used after leading 0."},rv={StrictDelete:"Deleting local variable in strict mode.",StrictEvalArguments:({referenceName:e})=>`Assigning to '${e}' in strict mode.`,StrictEvalArgumentsBinding:({bindingName:e})=>`Binding '${e}' in strict mode.`,StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block.",StrictNumericEscape:"The only valid numeric escape in strict mode is '\\0'.",StrictOctalLiteral:"Legacy octal literals are not allowed in strict mode.",StrictWith:"'with' in strict mode."},nv=new Set(["ArrowFunctionExpression","AssignmentExpression","ConditionalExpression","YieldExpression"]),iv={PipeBodyIsTighter:"Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.",PipeTopicRequiresHackPipes:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.',PipeTopicUnbound:"Topic reference is unbound; it must be inside a pipe body.",PipeTopicUnconfiguredToken:({token:e})=>`Invalid topic token ${e}. In order to use ${e} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${e}" }.`,PipeTopicUnused:"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.",PipeUnparenthesizedBody:({type:e})=>`Hack-style pipe body cannot be an unparenthesized ${Ta({type:e})}; please wrap it in parentheses.`,PipelineBodyNoArrow:'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized.',PipelineBodySequenceExpression:"Pipeline body may not be a comma-separated sequence expression.",PipelineHeadSequenceExpression:"Pipeline head should not be a comma-separated sequence expression.",PipelineTopicUnused:"Pipeline is in topic style but does not use topic reference.",PrimaryTopicNotAllowed:"Topic reference was used in a lexical context without topic binding.",PrimaryTopicRequiresSmartPipeline:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.'},sv=["message"];function wy(e,r,t){Object.defineProperty(e,r,{enumerable:!1,configurable:!0,value:t})}function ov({toMessage:e,code:r,reasonCode:t,syntaxPlugin:n}){let i=t==="MissingPlugin"||t==="MissingOneOfPlugins";{let s={AccessorCannotDeclareThisParameter:"AccesorCannotDeclareThisParameter",AccessorCannotHaveTypeParameters:"AccesorCannotHaveTypeParameters",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference",SetAccessorCannotHaveOptionalParameter:"SetAccesorCannotHaveOptionalParameter",SetAccessorCannotHaveRestParameter:"SetAccesorCannotHaveRestParameter",SetAccessorCannotHaveReturnType:"SetAccesorCannotHaveReturnType"};s[t]&&(t=s[t])}return function s(o,a){let l=new SyntaxError;return l.code=r,l.reasonCode=t,l.loc=o,l.pos=o.index,l.syntaxPlugin=n,i&&(l.missingPlugin=a.missingPlugin),wy(l,"clone",function(c={}){var p;let{line:d,column:f,index:m}=(p=c.loc)!=null?p:o;return s(new Lr(d,f,m),Object.assign({},a,c.details))}),wy(l,"details",a),Object.defineProperty(l,"message",{configurable:!0,get(){let u=`${e(a)} (${o.line}:${o.column})`;return this.message=u,u},set(u){Object.defineProperty(this,"message",{value:u,writable:!0})}}),l}}function an(e,r){if(Array.isArray(e))return n=>an(n,e[0]);let t={};for(let n of Object.keys(e)){let i=e[n],s=typeof i=="string"?{message:()=>i}:typeof i=="function"?{message:i}:i,{message:o}=s,a=ZA(s,sv),l=typeof o=="string"?()=>o:o;t[n]=ov(Object.assign({code:"BABEL_PARSER_SYNTAX_ERROR",reasonCode:n,toMessage:l},r?{syntaxPlugin:r}:{},a))}return t}var S=Object.assign({},an(ev),an(tv),an(rv),an`pipelineOperator`(iv)),{defineProperty:av}=Object,Ty=(e,r)=>{e&&av(e,r,{enumerable:!1,value:e[r]})};function Us(e){return Ty(e.loc.start,"index"),Ty(e.loc.end,"index"),e}var lv=e=>class extends e{parse(){let t=Us(super.parse());return this.options.tokens&&(t.tokens=t.tokens.map(Us)),t}parseRegExpLiteral({pattern:t,flags:n}){let i=null;try{i=new RegExp(t,n)}catch{}let s=this.estreeParseLiteral(i);return s.regex={pattern:t,flags:n},s}parseBigIntLiteral(t){let n;try{n=BigInt(t)}catch{n=null}let i=this.estreeParseLiteral(n);return i.bigint=String(i.value||t),i}parseDecimalLiteral(t){let i=this.estreeParseLiteral(null);return i.decimal=String(i.value||t),i}estreeParseLiteral(t){return this.parseLiteral(t,"Literal")}parseStringLiteral(t){return this.estreeParseLiteral(t)}parseNumericLiteral(t){return this.estreeParseLiteral(t)}parseNullLiteral(){return this.estreeParseLiteral(null)}parseBooleanLiteral(t){return this.estreeParseLiteral(t)}directiveToStmt(t){let n=t.value;delete t.value,n.type="Literal",n.raw=n.extra.raw,n.value=n.extra.expressionValue;let i=t;return i.type="ExpressionStatement",i.expression=n,i.directive=n.extra.rawValue,delete n.extra,i}initFunction(t,n){super.initFunction(t,n),t.expression=!1}checkDeclaration(t){t!=null&&this.isObjectProperty(t)?this.checkDeclaration(t.value):super.checkDeclaration(t)}getObjectOrClassMethodParams(t){return t.value.params}isValidDirective(t){var n;return t.type==="ExpressionStatement"&&t.expression.type==="Literal"&&typeof t.expression.value=="string"&&!((n=t.expression.extra)!=null&&n.parenthesized)}parseBlockBody(t,n,i,s,o){super.parseBlockBody(t,n,i,s,o);let a=t.directives.map(l=>this.directiveToStmt(l));t.body=a.concat(t.body),delete t.directives}pushClassMethod(t,n,i,s,o,a){this.parseMethod(n,i,s,o,a,"ClassMethod",!0),n.typeParameters&&(n.value.typeParameters=n.typeParameters,delete n.typeParameters),t.body.push(n)}parsePrivateName(){let t=super.parsePrivateName();return this.getPluginOption("estree","classFeatures")?this.convertPrivateNameToPrivateIdentifier(t):t}convertPrivateNameToPrivateIdentifier(t){let n=super.getPrivateNameSV(t);return t=t,delete t.id,t.name=n,t.type="PrivateIdentifier",t}isPrivateName(t){return this.getPluginOption("estree","classFeatures")?t.type==="PrivateIdentifier":super.isPrivateName(t)}getPrivateNameSV(t){return this.getPluginOption("estree","classFeatures")?t.name:super.getPrivateNameSV(t)}parseLiteral(t,n){let i=super.parseLiteral(t,n);return i.raw=i.extra.raw,delete i.extra,i}parseFunctionBody(t,n,i=!1){super.parseFunctionBody(t,n,i),t.expression=t.body.type!=="BlockStatement"}parseMethod(t,n,i,s,o,a,l=!1){let u=this.startNode();return u.kind=t.kind,u=super.parseMethod(u,n,i,s,o,a,l),u.type="FunctionExpression",delete u.kind,t.value=u,a==="ClassPrivateMethod"&&(t.computed=!1),this.finishNode(t,"MethodDefinition")}nameIsConstructor(t){return t.type==="Literal"?t.value==="constructor":super.nameIsConstructor(t)}parseClassProperty(...t){let n=super.parseClassProperty(...t);return this.getPluginOption("estree","classFeatures")&&(n.type="PropertyDefinition"),n}parseClassPrivateProperty(...t){let n=super.parseClassPrivateProperty(...t);return this.getPluginOption("estree","classFeatures")&&(n.type="PropertyDefinition",n.computed=!1),n}parseObjectMethod(t,n,i,s,o){let a=super.parseObjectMethod(t,n,i,s,o);return a&&(a.type="Property",a.kind==="method"&&(a.kind="init"),a.shorthand=!1),a}parseObjectProperty(t,n,i,s){let o=super.parseObjectProperty(t,n,i,s);return o&&(o.kind="init",o.type="Property"),o}isValidLVal(t,n,i){return t==="Property"?"value":super.isValidLVal(t,n,i)}isAssignable(t,n){return t!=null&&this.isObjectProperty(t)?this.isAssignable(t.value,n):super.isAssignable(t,n)}toAssignable(t,n=!1){if(t!=null&&this.isObjectProperty(t)){let{key:i,value:s}=t;this.isPrivateName(i)&&this.classScope.usePrivateName(this.getPrivateNameSV(i),i.loc.start),this.toAssignable(s,n)}else super.toAssignable(t,n)}toAssignableObjectExpressionProp(t,n,i){t.type==="Property"&&(t.kind==="get"||t.kind==="set")?this.raise(S.PatternHasAccessor,t.key):t.type==="Property"&&t.method?this.raise(S.PatternHasMethod,t.key):super.toAssignableObjectExpressionProp(t,n,i)}finishCallExpression(t,n){let i=super.finishCallExpression(t,n);if(i.callee.type==="Import"){if(i.type="ImportExpression",i.source=i.arguments[0],this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions")){var s,o;i.options=(s=i.arguments[1])!=null?s:null,i.attributes=(o=i.arguments[1])!=null?o:null}delete i.arguments,delete i.callee}return i}toReferencedArguments(t){t.type!=="ImportExpression"&&super.toReferencedArguments(t)}parseExport(t,n){let i=this.state.lastTokStartLoc,s=super.parseExport(t,n);switch(s.type){case"ExportAllDeclaration":s.exported=null;break;case"ExportNamedDeclaration":s.specifiers.length===1&&s.specifiers[0].type==="ExportNamespaceSpecifier"&&(s.type="ExportAllDeclaration",s.exported=s.specifiers[0].exported,delete s.specifiers);case"ExportDefaultDeclaration":{var o;let{declaration:a}=s;a?.type==="ClassDeclaration"&&((o=a.decorators)==null?void 0:o.length)>0&&a.start===s.start&&this.resetStartLocation(s,i)}break}return s}parseSubscript(t,n,i,s){let o=super.parseSubscript(t,n,i,s);if(s.optionalChainMember){if((o.type==="OptionalMemberExpression"||o.type==="OptionalCallExpression")&&(o.type=o.type.substring(8)),s.stop){let a=this.startNodeAtNode(o);return a.expression=o,this.finishNode(a,"ChainExpression")}}else(o.type==="MemberExpression"||o.type==="CallExpression")&&(o.optional=!1);return o}isOptionalMemberExpression(t){return t.type==="ChainExpression"?t.expression.type==="MemberExpression":super.isOptionalMemberExpression(t)}hasPropertyAsPrivateName(t){return t.type==="ChainExpression"&&(t=t.expression),super.hasPropertyAsPrivateName(t)}isObjectProperty(t){return t.type==="Property"&&t.kind==="init"&&!t.method}isObjectMethod(t){return t.type==="Property"&&(t.method||t.kind==="get"||t.kind==="set")}finishNodeAt(t,n,i){return Us(super.finishNodeAt(t,n,i))}resetStartLocation(t,n){super.resetStartLocation(t,n),Us(t)}resetEndLocation(t,n=this.state.lastTokEndLoc){super.resetEndLocation(t,n),Us(t)}},ti=class{constructor(r,t){this.token=void 0,this.preserveSpace=void 0,this.token=r,this.preserveSpace=!!t}},_e={brace:new ti("{"),j_oTag:new ti("<tag"),j_cTag:new ti("</tag"),j_expr:new ti("<tag>...</tag>",!0)};_e.template=new ti("`",!0);var fe=!0,j=!0,mc=!0,js=!0,vn=!0,uv=!0,Pa=class{constructor(r,t={}){this.label=void 0,this.keyword=void 0,this.beforeExpr=void 0,this.startsExpr=void 0,this.rightAssociative=void 0,this.isLoop=void 0,this.isAssign=void 0,this.prefix=void 0,this.postfix=void 0,this.binop=void 0,this.label=r,this.keyword=t.keyword,this.beforeExpr=!!t.beforeExpr,this.startsExpr=!!t.startsExpr,this.rightAssociative=!!t.rightAssociative,this.isLoop=!!t.isLoop,this.isAssign=!!t.isAssign,this.prefix=!!t.prefix,this.postfix=!!t.postfix,this.binop=t.binop!=null?t.binop:null,this.updateContext=null}},Uc=new Map;function be(e,r={}){r.keyword=e;let t=J(e,r);return Uc.set(e,t),t}function Ft(e,r){return J(e,{beforeExpr:fe,binop:r})}var qs=-1,sn=[],jc=[],Kc=[],Vc=[],zc=[],qc=[];function J(e,r={}){var t,n,i,s;return++qs,jc.push(e),Kc.push((t=r.binop)!=null?t:-1),Vc.push((n=r.beforeExpr)!=null?n:!1),zc.push((i=r.startsExpr)!=null?i:!1),qc.push((s=r.prefix)!=null?s:!1),sn.push(new Pa(e,r)),qs}function de(e,r={}){var t,n,i,s;return++qs,Uc.set(e,qs),jc.push(e),Kc.push((t=r.binop)!=null?t:-1),Vc.push((n=r.beforeExpr)!=null?n:!1),zc.push((i=r.startsExpr)!=null?i:!1),qc.push((s=r.prefix)!=null?s:!1),sn.push(new Pa("name",r)),qs}var cv={bracketL:J("[",{beforeExpr:fe,startsExpr:j}),bracketHashL:J("#[",{beforeExpr:fe,startsExpr:j}),bracketBarL:J("[|",{beforeExpr:fe,startsExpr:j}),bracketR:J("]"),bracketBarR:J("|]"),braceL:J("{",{beforeExpr:fe,startsExpr:j}),braceBarL:J("{|",{beforeExpr:fe,startsExpr:j}),braceHashL:J("#{",{beforeExpr:fe,startsExpr:j}),braceR:J("}"),braceBarR:J("|}"),parenL:J("(",{beforeExpr:fe,startsExpr:j}),parenR:J(")"),comma:J(",",{beforeExpr:fe}),semi:J(";",{beforeExpr:fe}),colon:J(":",{beforeExpr:fe}),doubleColon:J("::",{beforeExpr:fe}),dot:J("."),question:J("?",{beforeExpr:fe}),questionDot:J("?."),arrow:J("=>",{beforeExpr:fe}),template:J("template"),ellipsis:J("...",{beforeExpr:fe}),backQuote:J("`",{startsExpr:j}),dollarBraceL:J("${",{beforeExpr:fe,startsExpr:j}),templateTail:J("...`",{startsExpr:j}),templateNonTail:J("...${",{beforeExpr:fe,startsExpr:j}),at:J("@"),hash:J("#",{startsExpr:j}),interpreterDirective:J("#!..."),eq:J("=",{beforeExpr:fe,isAssign:js}),assign:J("_=",{beforeExpr:fe,isAssign:js}),slashAssign:J("_=",{beforeExpr:fe,isAssign:js}),xorAssign:J("_=",{beforeExpr:fe,isAssign:js}),moduloAssign:J("_=",{beforeExpr:fe,isAssign:js}),incDec:J("++/--",{prefix:vn,postfix:uv,startsExpr:j}),bang:J("!",{beforeExpr:fe,prefix:vn,startsExpr:j}),tilde:J("~",{beforeExpr:fe,prefix:vn,startsExpr:j}),doubleCaret:J("^^",{startsExpr:j}),doubleAt:J("@@",{startsExpr:j}),pipeline:Ft("|>",0),nullishCoalescing:Ft("??",1),logicalOR:Ft("||",1),logicalAND:Ft("&&",2),bitwiseOR:Ft("|",3),bitwiseXOR:Ft("^",4),bitwiseAND:Ft("&",5),equality:Ft("==/!=/===/!==",6),lt:Ft("</>/<=/>=",7),gt:Ft("</>/<=/>=",7),relational:Ft("</>/<=/>=",7),bitShift:Ft("<</>>/>>>",8),bitShiftL:Ft("<</>>/>>>",8),bitShiftR:Ft("<</>>/>>>",8),plusMin:J("+/-",{beforeExpr:fe,binop:9,prefix:vn,startsExpr:j}),modulo:J("%",{binop:10,startsExpr:j}),star:J("*",{binop:10}),slash:Ft("/",10),exponent:J("**",{beforeExpr:fe,binop:11,rightAssociative:!0}),_in:be("in",{beforeExpr:fe,binop:7}),_instanceof:be("instanceof",{beforeExpr:fe,binop:7}),_break:be("break"),_case:be("case",{beforeExpr:fe}),_catch:be("catch"),_continue:be("continue"),_debugger:be("debugger"),_default:be("default",{beforeExpr:fe}),_else:be("else",{beforeExpr:fe}),_finally:be("finally"),_function:be("function",{startsExpr:j}),_if:be("if"),_return:be("return",{beforeExpr:fe}),_switch:be("switch"),_throw:be("throw",{beforeExpr:fe,prefix:vn,startsExpr:j}),_try:be("try"),_var:be("var"),_const:be("const"),_with:be("with"),_new:be("new",{beforeExpr:fe,startsExpr:j}),_this:be("this",{startsExpr:j}),_super:be("super",{startsExpr:j}),_class:be("class",{startsExpr:j}),_extends:be("extends",{beforeExpr:fe}),_export:be("export"),_import:be("import",{startsExpr:j}),_null:be("null",{startsExpr:j}),_true:be("true",{startsExpr:j}),_false:be("false",{startsExpr:j}),_typeof:be("typeof",{beforeExpr:fe,prefix:vn,startsExpr:j}),_void:be("void",{beforeExpr:fe,prefix:vn,startsExpr:j}),_delete:be("delete",{beforeExpr:fe,prefix:vn,startsExpr:j}),_do:be("do",{isLoop:mc,beforeExpr:fe}),_for:be("for",{isLoop:mc}),_while:be("while",{isLoop:mc}),_as:de("as",{startsExpr:j}),_assert:de("assert",{startsExpr:j}),_async:de("async",{startsExpr:j}),_await:de("await",{startsExpr:j}),_defer:de("defer",{startsExpr:j}),_from:de("from",{startsExpr:j}),_get:de("get",{startsExpr:j}),_let:de("let",{startsExpr:j}),_meta:de("meta",{startsExpr:j}),_of:de("of",{startsExpr:j}),_sent:de("sent",{startsExpr:j}),_set:de("set",{startsExpr:j}),_source:de("source",{startsExpr:j}),_static:de("static",{startsExpr:j}),_using:de("using",{startsExpr:j}),_yield:de("yield",{startsExpr:j}),_asserts:de("asserts",{startsExpr:j}),_checks:de("checks",{startsExpr:j}),_exports:de("exports",{startsExpr:j}),_global:de("global",{startsExpr:j}),_implements:de("implements",{startsExpr:j}),_intrinsic:de("intrinsic",{startsExpr:j}),_infer:de("infer",{startsExpr:j}),_is:de("is",{startsExpr:j}),_mixins:de("mixins",{startsExpr:j}),_proto:de("proto",{startsExpr:j}),_require:de("require",{startsExpr:j}),_satisfies:de("satisfies",{startsExpr:j}),_keyof:de("keyof",{startsExpr:j}),_readonly:de("readonly",{startsExpr:j}),_unique:de("unique",{startsExpr:j}),_abstract:de("abstract",{startsExpr:j}),_declare:de("declare",{startsExpr:j}),_enum:de("enum",{startsExpr:j}),_module:de("module",{startsExpr:j}),_namespace:de("namespace",{startsExpr:j}),_interface:de("interface",{startsExpr:j}),_type:de("type",{startsExpr:j}),_opaque:de("opaque",{startsExpr:j}),name:J("name",{startsExpr:j}),string:J("string",{startsExpr:j}),num:J("num",{startsExpr:j}),bigint:J("bigint",{startsExpr:j}),decimal:J("decimal",{startsExpr:j}),regexp:J("regexp",{startsExpr:j}),privateName:J("#name",{startsExpr:j}),eof:J("eof"),jsxName:J("jsxName"),jsxText:J("jsxText",{beforeExpr:!0}),jsxTagStart:J("jsxTagStart",{startsExpr:!0}),jsxTagEnd:J("jsxTagEnd"),placeholder:J("%%",{startsExpr:!0})};function we(e){return e>=93&&e<=132}function pv(e){return e<=92}function hr(e){return e>=58&&e<=132}function By(e){return e>=58&&e<=136}function dv(e){return Vc[e]}function xc(e){return zc[e]}function fv(e){return e>=29&&e<=33}function Ay(e){return e>=129&&e<=131}function mv(e){return e>=90&&e<=92}function Wc(e){return e>=58&&e<=92}function hv(e){return e>=39&&e<=59}function gv(e){return e===34}function yv(e){return qc[e]}function Dv(e){return e>=121&&e<=123}function bv(e){return e>=124&&e<=130}function In(e){return jc[e]}function Aa(e){return Kc[e]}function xv(e){return e===57}function Ia(e){return e>=24&&e<=25}function nn(e){return sn[e]}sn[8].updateContext=e=>{e.pop()},sn[5].updateContext=sn[7].updateContext=sn[23].updateContext=e=>{e.push(_e.brace)},sn[22].updateContext=e=>{e[e.length-1]===_e.template?e.pop():e.push(_e.template)},sn[142].updateContext=e=>{e.push(_e.j_expr,_e.j_oTag)};var Gc="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",My="\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",Ev=new RegExp("["+Gc+"]"),Cv=new RegExp("["+Gc+My+"]");Gc=My=null;var $y=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,2,60,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,42,9,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,496,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],Sv=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,80,3,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,343,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,726,6,110,6,6,9,4759,9,787719,239];function Ec(e,r){let t=65536;for(let n=0,i=r.length;n<i;n+=2){if(t+=r[n],t>e)return!1;if(t+=r[n+1],t>=e)return!0}return!1}function on(e){return e<65?e===36:e<=90?!0:e<97?e===95:e<=122?!0:e<=65535?e>=170&&Ev.test(String.fromCharCode(e)):Ec(e,$y)}function $i(e){return e<48?e===36:e<58?!0:e<65?!1:e<=90?!0:e<97?e===95:e<=122?!0:e<=65535?e>=170&&Cv.test(String.fromCharCode(e)):Ec(e,$y)||Ec(e,Sv)}var Hc={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"],strictBind:["eval","arguments"]},wv=new Set(Hc.keyword),Tv=new Set(Hc.strict),Av=new Set(Hc.strictBind);function Uy(e,r){return r&&e==="await"||e==="enum"}function jy(e,r){return Uy(e,r)||Tv.has(e)}function Ky(e){return Av.has(e)}function Vy(e,r){return jy(e,r)||Ky(e)}function vv(e){return wv.has(e)}function Pv(e,r,t){return e===64&&r===64&&on(t)}var Iv=new Set(["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete","implements","interface","let","package","private","protected","public","static","yield","eval","arguments","enum","await"]);function Nv(e){return Iv.has(e)}var Ws=class{constructor(r){this.flags=0,this.names=new Map,this.firstLexicalName="",this.flags=r}},Gs=class{constructor(r,t){this.parser=void 0,this.scopeStack=[],this.inModule=void 0,this.undefinedExports=new Map,this.parser=r,this.inModule=t}get inTopLevel(){return(this.currentScope().flags&1)>0}get inFunction(){return(this.currentVarScopeFlags()&2)>0}get allowSuper(){return(this.currentThisScopeFlags()&16)>0}get allowDirectSuper(){return(this.currentThisScopeFlags()&32)>0}get inClass(){return(this.currentThisScopeFlags()&64)>0}get inClassAndNotInNonArrowFunction(){let r=this.currentThisScopeFlags();return(r&64)>0&&(r&2)===0}get inStaticBlock(){for(let r=this.scopeStack.length-1;;r--){let{flags:t}=this.scopeStack[r];if(t&128)return!0;if(t&451)return!1}}get inNonArrowFunction(){return(this.currentThisScopeFlags()&2)>0}get treatFunctionsAsVar(){return this.treatFunctionsAsVarInScope(this.currentScope())}createScope(r){return new Ws(r)}enter(r){this.scopeStack.push(this.createScope(r))}exit(){return this.scopeStack.pop().flags}treatFunctionsAsVarInScope(r){return!!(r.flags&130||!this.parser.inModule&&r.flags&1)}declareName(r,t,n){let i=this.currentScope();if(t&8||t&16){this.checkRedeclarationInScope(i,r,t,n);let s=i.names.get(r)||0;t&16?s=s|4:(i.firstLexicalName||(i.firstLexicalName=r),s=s|2),i.names.set(r,s),t&8&&this.maybeExportDefined(i,r)}else if(t&4)for(let s=this.scopeStack.length-1;s>=0&&(i=this.scopeStack[s],this.checkRedeclarationInScope(i,r,t,n),i.names.set(r,(i.names.get(r)||0)|1),this.maybeExportDefined(i,r),!(i.flags&387));--s);this.parser.inModule&&i.flags&1&&this.undefinedExports.delete(r)}maybeExportDefined(r,t){this.parser.inModule&&r.flags&1&&this.undefinedExports.delete(t)}checkRedeclarationInScope(r,t,n,i){this.isRedeclaredInScope(r,t,n)&&this.parser.raise(S.VarRedeclaration,i,{identifierName:t})}isRedeclaredInScope(r,t,n){if(!(n&1))return!1;if(n&8)return r.names.has(t);let i=r.names.get(t);return n&16?(i&2)>0||!this.treatFunctionsAsVarInScope(r)&&(i&1)>0:(i&2)>0&&!(r.flags&8&&r.firstLexicalName===t)||!this.treatFunctionsAsVarInScope(r)&&(i&4)>0}checkLocalExport(r){let{name:t}=r;this.scopeStack[0].names.has(t)||this.undefinedExports.set(t,r.loc.start)}currentScope(){return this.scopeStack[this.scopeStack.length-1]}currentVarScopeFlags(){for(let r=this.scopeStack.length-1;;r--){let{flags:t}=this.scopeStack[r];if(t&387)return t}}currentThisScopeFlags(){for(let r=this.scopeStack.length-1;;r--){let{flags:t}=this.scopeStack[r];if(t&451&&!(t&4))return t}}},Cc=class extends Ws{constructor(...r){super(...r),this.declareFunctions=new Set}},Sc=class extends Gs{createScope(r){return new Cc(r)}declareName(r,t,n){let i=this.currentScope();if(t&2048){this.checkRedeclarationInScope(i,r,t,n),this.maybeExportDefined(i,r),i.declareFunctions.add(r);return}super.declareName(r,t,n)}isRedeclaredInScope(r,t,n){if(super.isRedeclaredInScope(r,t,n))return!0;if(n&2048&&!r.declareFunctions.has(t)){let i=r.names.get(t);return(i&4)>0||(i&2)>0}return!1}checkLocalExport(r){this.scopeStack[0].declareFunctions.has(r.name)||super.checkLocalExport(r)}},wc=class{constructor(){this.sawUnambiguousESM=!1,this.ambiguousScriptDifferentAst=!1}hasPlugin(r){if(typeof r=="string")return this.plugins.has(r);{let[t,n]=r;if(!this.hasPlugin(t))return!1;let i=this.plugins.get(t);for(let s of Object.keys(n))if(i?.[s]!==n[s])return!1;return!0}}getPluginOption(r,t){var n;return(n=this.plugins.get(r))==null?void 0:n[t]}};function zy(e,r){e.trailingComments===void 0?e.trailingComments=r:e.trailingComments.unshift(...r)}function Fv(e,r){e.leadingComments===void 0?e.leadingComments=r:e.leadingComments.unshift(...r)}function Hs(e,r){e.innerComments===void 0?e.innerComments=r:e.innerComments.unshift(...r)}function Ks(e,r,t){let n=null,i=r.length;for(;n===null&&i>0;)n=r[--i];n===null||n.start>t.start?Hs(e,t.comments):zy(n,t.comments)}var Tc=class extends wc{addComment(r){this.filename&&(r.loc.filename=this.filename);let{commentsLen:t}=this.state;this.comments.length!==t&&(this.comments.length=t),this.comments.push(r),this.state.commentsLen++}processComment(r){let{commentStack:t}=this.state,n=t.length;if(n===0)return;let i=n-1,s=t[i];s.start===r.end&&(s.leadingNode=r,i--);let{start:o}=r;for(;i>=0;i--){let a=t[i],l=a.end;if(l>o)a.containingNode=r,this.finalizeComment(a),t.splice(i,1);else{l===o&&(a.trailingNode=r);break}}}finalizeComment(r){let{comments:t}=r;if(r.leadingNode!==null||r.trailingNode!==null)r.leadingNode!==null&&zy(r.leadingNode,t),r.trailingNode!==null&&Fv(r.trailingNode,t);else{let{containingNode:n,start:i}=r;if(this.input.charCodeAt(i-1)===44)switch(n.type){case"ObjectExpression":case"ObjectPattern":case"RecordExpression":Ks(n,n.properties,r);break;case"CallExpression":case"OptionalCallExpression":Ks(n,n.arguments,r);break;case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":case"ObjectMethod":case"ClassMethod":case"ClassPrivateMethod":Ks(n,n.params,r);break;case"ArrayExpression":case"ArrayPattern":case"TupleExpression":Ks(n,n.elements,r);break;case"ExportNamedDeclaration":case"ImportDeclaration":Ks(n,n.specifiers,r);break;default:Hs(n,t)}else Hs(n,t)}}finalizeRemainingComments(){let{commentStack:r}=this.state;for(let t=r.length-1;t>=0;t--)this.finalizeComment(r[t]);this.state.commentStack=[]}resetPreviousNodeTrailingComments(r){let{commentStack:t}=this.state,{length:n}=t;if(n===0)return;let i=t[n-1];i.leadingNode===r&&(i.leadingNode=null)}resetPreviousIdentifierLeadingComments(r){let{commentStack:t}=this.state,{length:n}=t;n!==0&&(t[n-1].trailingNode===r?t[n-1].trailingNode=null:n>=2&&t[n-2].trailingNode===r&&(t[n-2].trailingNode=null))}takeSurroundingComments(r,t,n){let{commentStack:i}=this.state,s=i.length;if(s===0)return;let o=s-1;for(;o>=0;o--){let a=i[o],l=a.end;if(a.start===n)a.leadingNode=r;else if(l===t)a.trailingNode=r;else if(l<t)break}}},_v=/\r\n|[\r\n\u2028\u2029]/,Sa=new RegExp(_v.source,"g");function Ui(e){switch(e){case 10:case 13:case 8232:case 8233:return!0;default:return!1}}function vy(e,r,t){for(let n=r;n<t;n++)if(Ui(e.charCodeAt(n)))return!0;return!1}var hc=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,gc=/(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g;function kv(e){switch(e){case 9:case 11:case 12:case 32:case 160:case 5760:case 8192:case 8193:case 8194:case 8195:case 8196:case 8197:case 8198:case 8199:case 8200:case 8201:case 8202:case 8239:case 8287:case 12288:case 65279:return!0;default:return!1}}var Ac=class e{constructor(){this.flags=1024,this.curLine=void 0,this.lineStart=void 0,this.startLoc=void 0,this.endLoc=void 0,this.errors=[],this.potentialArrowAt=-1,this.noArrowAt=[],this.noArrowParamsConversionAt=[],this.topicContext={maxNumOfResolvableTopics:0,maxTopicIndex:null},this.labels=[],this.commentsLen=0,this.commentStack=[],this.pos=0,this.type=139,this.value=null,this.start=0,this.end=0,this.lastTokEndLoc=null,this.lastTokStartLoc=null,this.context=[_e.brace],this.firstInvalidTemplateEscapePos=null,this.strictErrors=new Map,this.tokensLength=0}get strict(){return(this.flags&1)>0}set strict(r){r?this.flags|=1:this.flags&=-2}init({strictMode:r,sourceType:t,startLine:n,startColumn:i}){this.strict=r===!1?!1:r===!0?!0:t==="module",this.curLine=n,this.lineStart=-i,this.startLoc=this.endLoc=new Lr(n,i,0)}get maybeInArrowParameters(){return(this.flags&2)>0}set maybeInArrowParameters(r){r?this.flags|=2:this.flags&=-3}get inType(){return(this.flags&4)>0}set inType(r){r?this.flags|=4:this.flags&=-5}get noAnonFunctionType(){return(this.flags&8)>0}set noAnonFunctionType(r){r?this.flags|=8:this.flags&=-9}get hasFlowComment(){return(this.flags&16)>0}set hasFlowComment(r){r?this.flags|=16:this.flags&=-17}get isAmbientContext(){return(this.flags&32)>0}set isAmbientContext(r){r?this.flags|=32:this.flags&=-33}get inAbstractClass(){return(this.flags&64)>0}set inAbstractClass(r){r?this.flags|=64:this.flags&=-65}get inDisallowConditionalTypesContext(){return(this.flags&128)>0}set inDisallowConditionalTypesContext(r){r?this.flags|=128:this.flags&=-129}get soloAwait(){return(this.flags&256)>0}set soloAwait(r){r?this.flags|=256:this.flags&=-257}get inFSharpPipelineDirectBody(){return(this.flags&512)>0}set inFSharpPipelineDirectBody(r){r?this.flags|=512:this.flags&=-513}get canStartJSXElement(){return(this.flags&1024)>0}set canStartJSXElement(r){r?this.flags|=1024:this.flags&=-1025}get containsEsc(){return(this.flags&2048)>0}set containsEsc(r){r?this.flags|=2048:this.flags&=-2049}get hasTopLevelAwait(){return(this.flags&4096)>0}set hasTopLevelAwait(r){r?this.flags|=4096:this.flags&=-4097}curPosition(){return new Lr(this.curLine,this.pos-this.lineStart,this.pos)}clone(){let r=new e;return r.flags=this.flags,r.curLine=this.curLine,r.lineStart=this.lineStart,r.startLoc=this.startLoc,r.endLoc=this.endLoc,r.errors=this.errors.slice(),r.potentialArrowAt=this.potentialArrowAt,r.noArrowAt=this.noArrowAt.slice(),r.noArrowParamsConversionAt=this.noArrowParamsConversionAt.slice(),r.topicContext=this.topicContext,r.labels=this.labels.slice(),r.commentsLen=this.commentsLen,r.commentStack=this.commentStack.slice(),r.pos=this.pos,r.type=this.type,r.value=this.value,r.start=this.start,r.end=this.end,r.lastTokEndLoc=this.lastTokEndLoc,r.lastTokStartLoc=this.lastTokStartLoc,r.context=this.context.slice(),r.firstInvalidTemplateEscapePos=this.firstInvalidTemplateEscapePos,r.strictErrors=this.strictErrors,r.tokensLength=this.tokensLength,r}},Ov=function(r){return r>=48&&r<=57},Py={decBinOct:new Set([46,66,69,79,95,98,101,111]),hex:new Set([46,88,95,120])},wa={bin:e=>e===48||e===49,oct:e=>e>=48&&e<=55,dec:e=>e>=48&&e<=57,hex:e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102};function Iy(e,r,t,n,i,s){let o=t,a=n,l=i,u="",c=null,p=t,{length:d}=r;for(;;){if(t>=d){s.unterminated(o,a,l),u+=r.slice(p,t);break}let f=r.charCodeAt(t);if(Rv(e,f,r,t)){u+=r.slice(p,t);break}if(f===92){u+=r.slice(p,t);let m=Lv(r,t,n,i,e==="template",s);m.ch===null&&!c?c={pos:t,lineStart:n,curLine:i}:u+=m.ch,{pos:t,lineStart:n,curLine:i}=m,p=t}else f===8232||f===8233?(++t,++i,n=t):f===10||f===13?e==="template"?(u+=r.slice(p,t)+`
|
|
18
18
|
`,++t,f===13&&r.charCodeAt(t)===10&&++t,++i,p=n=t):s.unterminated(o,a,l):++t}return{pos:t,str:u,firstInvalidLoc:c,lineStart:n,curLine:i,containsInvalid:!!c}}function Rv(e,r,t,n){return e==="template"?r===96||r===36&&t.charCodeAt(n+1)===123:r===(e==="double"?34:39)}function Lv(e,r,t,n,i,s){let o=!i;r++;let a=u=>({pos:r,ch:u,lineStart:t,curLine:n}),l=e.charCodeAt(r++);switch(l){case 110:return a(`
|
|
19
19
|
`);case 114:return a("\r");case 120:{let u;return{code:u,pos:r}=vc(e,r,t,n,2,!1,o,s),a(u===null?null:String.fromCharCode(u))}case 117:{let u;return{code:u,pos:r}=Wy(e,r,t,n,o,s),a(u===null?null:String.fromCodePoint(u))}case 116:return a(" ");case 98:return a("\b");case 118:return a("\v");case 102:return a("\f");case 13:e.charCodeAt(r)===10&&++r;case 10:t=r,++n;case 8232:case 8233:return a("");case 56:case 57:if(i)return a(null);s.strictNumericEscape(r-1,t,n);default:if(l>=48&&l<=55){let u=r-1,p=/^[0-7]+/.exec(e.slice(u,r+2))[0],d=parseInt(p,8);d>255&&(p=p.slice(0,-1),d=parseInt(p,8)),r+=p.length-1;let f=e.charCodeAt(r);if(p!=="0"||f===56||f===57){if(i)return a(null);s.strictNumericEscape(u,t,n)}return a(String.fromCharCode(d))}return a(String.fromCharCode(l))}}function vc(e,r,t,n,i,s,o,a){let l=r,u;return{n:u,pos:r}=qy(e,r,t,n,16,i,s,!1,a,!o),u===null&&(o?a.invalidEscapeSequence(l,t,n):r=l-1),{code:u,pos:r}}function qy(e,r,t,n,i,s,o,a,l,u){let c=r,p=i===16?Py.hex:Py.decBinOct,d=i===16?wa.hex:i===10?wa.dec:i===8?wa.oct:wa.bin,f=!1,m=0;for(let h=0,g=s??1/0;h<g;++h){let y=e.charCodeAt(r),D;if(y===95&&a!=="bail"){let C=e.charCodeAt(r-1),x=e.charCodeAt(r+1);if(a){if(Number.isNaN(x)||!d(x)||p.has(C)||p.has(x)){if(u)return{n:null,pos:r};l.unexpectedNumericSeparator(r,t,n)}}else{if(u)return{n:null,pos:r};l.numericSeparatorInEscapeSequence(r,t,n)}++r;continue}if(y>=97?D=y-97+10:y>=65?D=y-65+10:Ov(y)?D=y-48:D=1/0,D>=i){if(D<=9&&u)return{n:null,pos:r};if(D<=9&&l.invalidDigit(r,t,n,i))D=0;else if(o)D=0,f=!0;else break}++r,m=m*i+D}return r===c||s!=null&&r-c!==s||f?{n:null,pos:r}:{n:m,pos:r}}function Wy(e,r,t,n,i,s){let o=e.charCodeAt(r),a;if(o===123){if(++r,{code:a,pos:r}=vc(e,r,t,n,e.indexOf("}",r)-r,!0,i,s),++r,a!==null&&a>1114111)if(i)s.invalidCodePoint(r,t,n);else return{code:null,pos:r}}else({code:a,pos:r}=vc(e,r,t,n,4,!1,i,s));return{code:a,pos:r}}function Vs(e,r,t){return new Lr(t,e-r,e)}var Bv=new Set([103,109,115,105,121,117,100,118]),Rr=class{constructor(r){this.type=r.type,this.value=r.value,this.start=r.start,this.end=r.end,this.loc=new Ki(r.startLoc,r.endLoc)}},Pc=class extends Tc{constructor(r,t){super(),this.isLookahead=void 0,this.tokens=[],this.errorHandlers_readInt={invalidDigit:(n,i,s,o)=>this.options.errorRecovery?(this.raise(S.InvalidDigit,Vs(n,i,s),{radix:o}),!0):!1,numericSeparatorInEscapeSequence:this.errorBuilder(S.NumericSeparatorInEscapeSequence),unexpectedNumericSeparator:this.errorBuilder(S.UnexpectedNumericSeparator)},this.errorHandlers_readCodePoint=Object.assign({},this.errorHandlers_readInt,{invalidEscapeSequence:this.errorBuilder(S.InvalidEscapeSequence),invalidCodePoint:this.errorBuilder(S.InvalidCodePoint)}),this.errorHandlers_readStringContents_string=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:(n,i,s)=>{this.recordStrictModeErrors(S.StrictNumericEscape,Vs(n,i,s))},unterminated:(n,i,s)=>{throw this.raise(S.UnterminatedString,Vs(n-1,i,s))}}),this.errorHandlers_readStringContents_template=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:this.errorBuilder(S.StrictNumericEscape),unterminated:(n,i,s)=>{throw this.raise(S.UnterminatedTemplate,Vs(n,i,s))}}),this.state=new Ac,this.state.init(r),this.input=t,this.length=t.length,this.comments=[],this.isLookahead=!1}pushToken(r){this.tokens.length=this.state.tokensLength,this.tokens.push(r),++this.state.tokensLength}next(){this.checkKeywordEscapes(),this.options.tokens&&this.pushToken(new Rr(this.state)),this.state.lastTokEndLoc=this.state.endLoc,this.state.lastTokStartLoc=this.state.startLoc,this.nextToken()}eat(r){return this.match(r)?(this.next(),!0):!1}match(r){return this.state.type===r}createLookaheadState(r){return{pos:r.pos,value:null,type:r.type,start:r.start,end:r.end,context:[this.curContext()],inType:r.inType,startLoc:r.startLoc,lastTokEndLoc:r.lastTokEndLoc,curLine:r.curLine,lineStart:r.lineStart,curPosition:r.curPosition}}lookahead(){let r=this.state;this.state=this.createLookaheadState(r),this.isLookahead=!0,this.nextToken(),this.isLookahead=!1;let t=this.state;return this.state=r,t}nextTokenStart(){return this.nextTokenStartSince(this.state.pos)}nextTokenStartSince(r){return hc.lastIndex=r,hc.test(this.input)?hc.lastIndex:r}lookaheadCharCode(){return this.input.charCodeAt(this.nextTokenStart())}nextTokenInLineStart(){return this.nextTokenInLineStartSince(this.state.pos)}nextTokenInLineStartSince(r){return gc.lastIndex=r,gc.test(this.input)?gc.lastIndex:r}lookaheadInLineCharCode(){return this.input.charCodeAt(this.nextTokenInLineStart())}codePointAtPos(r){let t=this.input.charCodeAt(r);if((t&64512)===55296&&++r<this.input.length){let n=this.input.charCodeAt(r);(n&64512)===56320&&(t=65536+((t&1023)<<10)+(n&1023))}return t}setStrict(r){this.state.strict=r,r&&(this.state.strictErrors.forEach(([t,n])=>this.raise(t,n)),this.state.strictErrors.clear())}curContext(){return this.state.context[this.state.context.length-1]}nextToken(){if(this.skipSpace(),this.state.start=this.state.pos,this.isLookahead||(this.state.startLoc=this.state.curPosition()),this.state.pos>=this.length){this.finishToken(139);return}this.getTokenFromCode(this.codePointAtPos(this.state.pos))}skipBlockComment(r){let t;this.isLookahead||(t=this.state.curPosition());let n=this.state.pos,i=this.input.indexOf(r,n+2);if(i===-1)throw this.raise(S.UnterminatedComment,this.state.curPosition());for(this.state.pos=i+r.length,Sa.lastIndex=n+2;Sa.test(this.input)&&Sa.lastIndex<=i;)++this.state.curLine,this.state.lineStart=Sa.lastIndex;if(this.isLookahead)return;let s={type:"CommentBlock",value:this.input.slice(n+2,i),start:n,end:i+r.length,loc:new Ki(t,this.state.curPosition())};return this.options.tokens&&this.pushToken(s),s}skipLineComment(r){let t=this.state.pos,n;this.isLookahead||(n=this.state.curPosition());let i=this.input.charCodeAt(this.state.pos+=r);if(this.state.pos<this.length)for(;!Ui(i)&&++this.state.pos<this.length;)i=this.input.charCodeAt(this.state.pos);if(this.isLookahead)return;let s=this.state.pos,a={type:"CommentLine",value:this.input.slice(t+r,s),start:t,end:s,loc:new Ki(n,this.state.curPosition())};return this.options.tokens&&this.pushToken(a),a}skipSpace(){let r=this.state.pos,t=[];e:for(;this.state.pos<this.length;){let n=this.input.charCodeAt(this.state.pos);switch(n){case 32:case 160:case 9:++this.state.pos;break;case 13:this.input.charCodeAt(this.state.pos+1)===10&&++this.state.pos;case 10:case 8232:case 8233:++this.state.pos,++this.state.curLine,this.state.lineStart=this.state.pos;break;case 47:switch(this.input.charCodeAt(this.state.pos+1)){case 42:{let i=this.skipBlockComment("*/");i!==void 0&&(this.addComment(i),this.options.attachComment&&t.push(i));break}case 47:{let i=this.skipLineComment(2);i!==void 0&&(this.addComment(i),this.options.attachComment&&t.push(i));break}default:break e}break;default:if(kv(n))++this.state.pos;else if(n===45&&!this.inModule&&this.options.annexB){let i=this.state.pos;if(this.input.charCodeAt(i+1)===45&&this.input.charCodeAt(i+2)===62&&(r===0||this.state.lineStart>r)){let s=this.skipLineComment(3);s!==void 0&&(this.addComment(s),this.options.attachComment&&t.push(s))}else break e}else if(n===60&&!this.inModule&&this.options.annexB){let i=this.state.pos;if(this.input.charCodeAt(i+1)===33&&this.input.charCodeAt(i+2)===45&&this.input.charCodeAt(i+3)===45){let s=this.skipLineComment(4);s!==void 0&&(this.addComment(s),this.options.attachComment&&t.push(s))}else break e}else break e}}if(t.length>0){let n=this.state.pos,i={start:r,end:n,comments:t,leadingNode:null,trailingNode:null,containingNode:null};this.state.commentStack.push(i)}}finishToken(r,t){this.state.end=this.state.pos,this.state.endLoc=this.state.curPosition();let n=this.state.type;this.state.type=r,this.state.value=t,this.isLookahead||this.updateContext(n)}replaceToken(r){this.state.type=r,this.updateContext()}readToken_numberSign(){if(this.state.pos===0&&this.readToken_interpreter())return;let r=this.state.pos+1,t=this.codePointAtPos(r);if(t>=48&&t<=57)throw this.raise(S.UnexpectedDigitAfterHash,this.state.curPosition());if(t===123||t===91&&this.hasPlugin("recordAndTuple")){if(this.expectPlugin("recordAndTuple"),this.getPluginOption("recordAndTuple","syntaxType")==="bar")throw this.raise(t===123?S.RecordExpressionHashIncorrectStartSyntaxType:S.TupleExpressionHashIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,t===123?this.finishToken(7):this.finishToken(1)}else on(t)?(++this.state.pos,this.finishToken(138,this.readWord1(t))):t===92?(++this.state.pos,this.finishToken(138,this.readWord1())):this.finishOp(27,1)}readToken_dot(){let r=this.input.charCodeAt(this.state.pos+1);if(r>=48&&r<=57){this.readNumber(!0);return}r===46&&this.input.charCodeAt(this.state.pos+2)===46?(this.state.pos+=3,this.finishToken(21)):(++this.state.pos,this.finishToken(16))}readToken_slash(){this.input.charCodeAt(this.state.pos+1)===61?this.finishOp(31,2):this.finishOp(56,1)}readToken_interpreter(){if(this.state.pos!==0||this.length<2)return!1;let r=this.input.charCodeAt(this.state.pos+1);if(r!==33)return!1;let t=this.state.pos;for(this.state.pos+=1;!Ui(r)&&++this.state.pos<this.length;)r=this.input.charCodeAt(this.state.pos);let n=this.input.slice(t+2,this.state.pos);return this.finishToken(28,n),!0}readToken_mult_modulo(r){let t=r===42?55:54,n=1,i=this.input.charCodeAt(this.state.pos+1);r===42&&i===42&&(n++,i=this.input.charCodeAt(this.state.pos+2),t=57),i===61&&!this.state.inType&&(n++,t=r===37?33:30),this.finishOp(t,n)}readToken_pipe_amp(r){let t=this.input.charCodeAt(this.state.pos+1);if(t===r){this.input.charCodeAt(this.state.pos+2)===61?this.finishOp(30,3):this.finishOp(r===124?41:42,2);return}if(r===124){if(t===62){this.finishOp(39,2);return}if(this.hasPlugin("recordAndTuple")&&t===125){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(S.RecordExpressionBarIncorrectEndSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(9);return}if(this.hasPlugin("recordAndTuple")&&t===93){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(S.TupleExpressionBarIncorrectEndSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(4);return}}if(t===61){this.finishOp(30,2);return}this.finishOp(r===124?43:45,1)}readToken_caret(){let r=this.input.charCodeAt(this.state.pos+1);r===61&&!this.state.inType?this.finishOp(32,2):r===94&&this.hasPlugin(["pipelineOperator",{proposal:"hack",topicToken:"^^"}])?(this.finishOp(37,2),this.input.codePointAt(this.state.pos)===94&&this.unexpected()):this.finishOp(44,1)}readToken_atSign(){this.input.charCodeAt(this.state.pos+1)===64&&this.hasPlugin(["pipelineOperator",{proposal:"hack",topicToken:"@@"}])?this.finishOp(38,2):this.finishOp(26,1)}readToken_plus_min(r){let t=this.input.charCodeAt(this.state.pos+1);if(t===r){this.finishOp(34,2);return}t===61?this.finishOp(30,2):this.finishOp(53,1)}readToken_lt(){let{pos:r}=this.state,t=this.input.charCodeAt(r+1);if(t===60){if(this.input.charCodeAt(r+2)===61){this.finishOp(30,3);return}this.finishOp(51,2);return}if(t===61){this.finishOp(49,2);return}this.finishOp(47,1)}readToken_gt(){let{pos:r}=this.state,t=this.input.charCodeAt(r+1);if(t===62){let n=this.input.charCodeAt(r+2)===62?3:2;if(this.input.charCodeAt(r+n)===61){this.finishOp(30,n+1);return}this.finishOp(52,n);return}if(t===61){this.finishOp(49,2);return}this.finishOp(48,1)}readToken_eq_excl(r){let t=this.input.charCodeAt(this.state.pos+1);if(t===61){this.finishOp(46,this.input.charCodeAt(this.state.pos+2)===61?3:2);return}if(r===61&&t===62){this.state.pos+=2,this.finishToken(19);return}this.finishOp(r===61?29:35,1)}readToken_question(){let r=this.input.charCodeAt(this.state.pos+1),t=this.input.charCodeAt(this.state.pos+2);r===63?t===61?this.finishOp(30,3):this.finishOp(40,2):r===46&&!(t>=48&&t<=57)?(this.state.pos+=2,this.finishToken(18)):(++this.state.pos,this.finishToken(17))}getTokenFromCode(r){switch(r){case 46:this.readToken_dot();return;case 40:++this.state.pos,this.finishToken(10);return;case 41:++this.state.pos,this.finishToken(11);return;case 59:++this.state.pos,this.finishToken(13);return;case 44:++this.state.pos,this.finishToken(12);return;case 91:if(this.hasPlugin("recordAndTuple")&&this.input.charCodeAt(this.state.pos+1)===124){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(S.TupleExpressionBarIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(2)}else++this.state.pos,this.finishToken(0);return;case 93:++this.state.pos,this.finishToken(3);return;case 123:if(this.hasPlugin("recordAndTuple")&&this.input.charCodeAt(this.state.pos+1)===124){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(S.RecordExpressionBarIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(6)}else++this.state.pos,this.finishToken(5);return;case 125:++this.state.pos,this.finishToken(8);return;case 58:this.hasPlugin("functionBind")&&this.input.charCodeAt(this.state.pos+1)===58?this.finishOp(15,2):(++this.state.pos,this.finishToken(14));return;case 63:this.readToken_question();return;case 96:this.readTemplateToken();return;case 48:{let t=this.input.charCodeAt(this.state.pos+1);if(t===120||t===88){this.readRadixNumber(16);return}if(t===111||t===79){this.readRadixNumber(8);return}if(t===98||t===66){this.readRadixNumber(2);return}}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:this.readNumber(!1);return;case 34:case 39:this.readString(r);return;case 47:this.readToken_slash();return;case 37:case 42:this.readToken_mult_modulo(r);return;case 124:case 38:this.readToken_pipe_amp(r);return;case 94:this.readToken_caret();return;case 43:case 45:this.readToken_plus_min(r);return;case 60:this.readToken_lt();return;case 62:this.readToken_gt();return;case 61:case 33:this.readToken_eq_excl(r);return;case 126:this.finishOp(36,1);return;case 64:this.readToken_atSign();return;case 35:this.readToken_numberSign();return;case 92:this.readWord();return;default:if(on(r)){this.readWord(r);return}}throw this.raise(S.InvalidOrUnexpectedToken,this.state.curPosition(),{unexpected:String.fromCodePoint(r)})}finishOp(r,t){let n=this.input.slice(this.state.pos,this.state.pos+t);this.state.pos+=t,this.finishToken(r,n)}readRegexp(){let r=this.state.startLoc,t=this.state.start+1,n,i,{pos:s}=this.state;for(;;++s){if(s>=this.length)throw this.raise(S.UnterminatedRegExp,_t(r,1));let u=this.input.charCodeAt(s);if(Ui(u))throw this.raise(S.UnterminatedRegExp,_t(r,1));if(n)n=!1;else{if(u===91)i=!0;else if(u===93&&i)i=!1;else if(u===47&&!i)break;n=u===92}}let o=this.input.slice(t,s);++s;let a="",l=()=>_t(r,s+2-t);for(;s<this.length;){let u=this.codePointAtPos(s),c=String.fromCharCode(u);if(Bv.has(u))u===118?a.includes("u")&&this.raise(S.IncompatibleRegExpUVFlags,l()):u===117&&a.includes("v")&&this.raise(S.IncompatibleRegExpUVFlags,l()),a.includes(c)&&this.raise(S.DuplicateRegExpFlags,l());else if($i(u)||u===92)this.raise(S.MalformedRegExpFlags,l());else break;++s,a+=c}this.state.pos=s,this.finishToken(137,{pattern:o,flags:a})}readInt(r,t,n=!1,i=!0){let{n:s,pos:o}=qy(this.input,this.state.pos,this.state.lineStart,this.state.curLine,r,t,n,i,this.errorHandlers_readInt,!1);return this.state.pos=o,s}readRadixNumber(r){let t=this.state.curPosition(),n=!1;this.state.pos+=2;let i=this.readInt(r);i==null&&this.raise(S.InvalidDigit,_t(t,2),{radix:r});let s=this.input.charCodeAt(this.state.pos);if(s===110)++this.state.pos,n=!0;else if(s===109)throw this.raise(S.InvalidDecimal,t);if(on(this.codePointAtPos(this.state.pos)))throw this.raise(S.NumberIdentifier,this.state.curPosition());if(n){let o=this.input.slice(t.index,this.state.pos).replace(/[_n]/g,"");this.finishToken(135,o);return}this.finishToken(134,i)}readNumber(r){let t=this.state.pos,n=this.state.curPosition(),i=!1,s=!1,o=!1,a=!1;!r&&this.readInt(10)===null&&this.raise(S.InvalidNumber,this.state.curPosition());let l=this.state.pos-t>=2&&this.input.charCodeAt(t)===48;if(l){let f=this.input.slice(t,this.state.pos);if(this.recordStrictModeErrors(S.StrictOctalLiteral,n),!this.state.strict){let m=f.indexOf("_");m>0&&this.raise(S.ZeroDigitNumericSeparator,_t(n,m))}a=l&&!/[89]/.test(f)}let u=this.input.charCodeAt(this.state.pos);if(u===46&&!a&&(++this.state.pos,this.readInt(10),i=!0,u=this.input.charCodeAt(this.state.pos)),(u===69||u===101)&&!a&&(u=this.input.charCodeAt(++this.state.pos),(u===43||u===45)&&++this.state.pos,this.readInt(10)===null&&this.raise(S.InvalidOrMissingExponent,n),i=!0,o=!0,u=this.input.charCodeAt(this.state.pos)),u===110&&((i||l)&&this.raise(S.InvalidBigIntLiteral,n),++this.state.pos,s=!0),u===109){this.expectPlugin("decimal",this.state.curPosition()),(o||l)&&this.raise(S.InvalidDecimal,n),++this.state.pos;var c=!0}if(on(this.codePointAtPos(this.state.pos)))throw this.raise(S.NumberIdentifier,this.state.curPosition());let p=this.input.slice(t,this.state.pos).replace(/[_mn]/g,"");if(s){this.finishToken(135,p);return}if(c){this.finishToken(136,p);return}let d=a?parseInt(p,8):parseFloat(p);this.finishToken(134,d)}readCodePoint(r){let{code:t,pos:n}=Wy(this.input,this.state.pos,this.state.lineStart,this.state.curLine,r,this.errorHandlers_readCodePoint);return this.state.pos=n,t}readString(r){let{str:t,pos:n,curLine:i,lineStart:s}=Iy(r===34?"double":"single",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_string);this.state.pos=n+1,this.state.lineStart=s,this.state.curLine=i,this.finishToken(133,t)}readTemplateContinuation(){this.match(8)||this.unexpected(null,8),this.state.pos--,this.readTemplateToken()}readTemplateToken(){let r=this.input[this.state.pos],{str:t,firstInvalidLoc:n,pos:i,curLine:s,lineStart:o}=Iy("template",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_template);this.state.pos=i+1,this.state.lineStart=o,this.state.curLine=s,n&&(this.state.firstInvalidTemplateEscapePos=new Lr(n.curLine,n.pos-n.lineStart,n.pos)),this.input.codePointAt(i)===96?this.finishToken(24,n?null:r+t+"`"):(this.state.pos++,this.finishToken(25,n?null:r+t+"${"))}recordStrictModeErrors(r,t){let n=t.index;this.state.strict&&!this.state.strictErrors.has(n)?this.raise(r,t):this.state.strictErrors.set(n,[r,t])}readWord1(r){this.state.containsEsc=!1;let t="",n=this.state.pos,i=this.state.pos;for(r!==void 0&&(this.state.pos+=r<=65535?1:2);this.state.pos<this.length;){let s=this.codePointAtPos(this.state.pos);if($i(s))this.state.pos+=s<=65535?1:2;else if(s===92){this.state.containsEsc=!0,t+=this.input.slice(i,this.state.pos);let o=this.state.curPosition(),a=this.state.pos===n?on:$i;if(this.input.charCodeAt(++this.state.pos)!==117){this.raise(S.MissingUnicodeEscape,this.state.curPosition()),i=this.state.pos-1;continue}++this.state.pos;let l=this.readCodePoint(!0);l!==null&&(a(l)||this.raise(S.EscapedCharNotAnIdentifier,o),t+=String.fromCodePoint(l)),i=this.state.pos}else break}return t+this.input.slice(i,this.state.pos)}readWord(r){let t=this.readWord1(r),n=Uc.get(t);n!==void 0?this.finishToken(n,In(n)):this.finishToken(132,t)}checkKeywordEscapes(){let{type:r}=this.state;Wc(r)&&this.state.containsEsc&&this.raise(S.InvalidEscapedReservedWord,this.state.startLoc,{reservedWord:In(r)})}raise(r,t,n={}){let i=t instanceof Lr?t:t.loc.start,s=r(i,n);if(!this.options.errorRecovery)throw s;return this.isLookahead||this.state.errors.push(s),s}raiseOverwrite(r,t,n={}){let i=t instanceof Lr?t:t.loc.start,s=i.index,o=this.state.errors;for(let a=o.length-1;a>=0;a--){let l=o[a];if(l.loc.index===s)return o[a]=r(i,n);if(l.loc.index<s)break}return this.raise(r,t,n)}updateContext(r){}unexpected(r,t){throw this.raise(S.UnexpectedToken,r??this.state.startLoc,{expected:t?In(t):null})}expectPlugin(r,t){if(this.hasPlugin(r))return!0;throw this.raise(S.MissingPlugin,t??this.state.startLoc,{missingPlugin:[r]})}expectOnePlugin(r){if(!r.some(t=>this.hasPlugin(t)))throw this.raise(S.MissingOneOfPlugins,this.state.startLoc,{missingPlugin:r})}errorBuilder(r){return(t,n,i)=>{this.raise(r,Vs(t,n,i))}}},Ic=class{constructor(){this.privateNames=new Set,this.loneAccessors=new Map,this.undefinedPrivateNames=new Map}},Nc=class{constructor(r){this.parser=void 0,this.stack=[],this.undefinedPrivateNames=new Map,this.parser=r}current(){return this.stack[this.stack.length-1]}enter(){this.stack.push(new Ic)}exit(){let r=this.stack.pop(),t=this.current();for(let[n,i]of Array.from(r.undefinedPrivateNames))t?t.undefinedPrivateNames.has(n)||t.undefinedPrivateNames.set(n,i):this.parser.raise(S.InvalidPrivateFieldResolution,i,{identifierName:n})}declarePrivateName(r,t,n){let{privateNames:i,loneAccessors:s,undefinedPrivateNames:o}=this.current(),a=i.has(r);if(t&3){let l=a&&s.get(r);if(l){let u=l&4,c=t&4,p=l&3,d=t&3;a=p===d||u!==c,a||s.delete(r)}else a||s.set(r,t)}a&&this.parser.raise(S.PrivateNameRedeclaration,n,{identifierName:r}),i.add(r),o.delete(r)}usePrivateName(r,t){let n;for(n of this.stack)if(n.privateNames.has(r))return;n?n.undefinedPrivateNames.set(r,t):this.parser.raise(S.InvalidPrivateFieldResolution,t,{identifierName:r})}},Vi=class{constructor(r=0){this.type=r}canBeArrowParameterDeclaration(){return this.type===2||this.type===1}isCertainlyParameterDeclaration(){return this.type===3}},Na=class extends Vi{constructor(r){super(r),this.declarationErrors=new Map}recordDeclarationError(r,t){let n=t.index;this.declarationErrors.set(n,[r,t])}clearDeclarationError(r){this.declarationErrors.delete(r)}iterateErrors(r){this.declarationErrors.forEach(r)}},Fc=class{constructor(r){this.parser=void 0,this.stack=[new Vi],this.parser=r}enter(r){this.stack.push(r)}exit(){this.stack.pop()}recordParameterInitializerError(r,t){let n=t.loc.start,{stack:i}=this,s=i.length-1,o=i[s];for(;!o.isCertainlyParameterDeclaration();){if(o.canBeArrowParameterDeclaration())o.recordDeclarationError(r,n);else return;o=i[--s]}this.parser.raise(r,n)}recordArrowParameterBindingError(r,t){let{stack:n}=this,i=n[n.length-1],s=t.loc.start;if(i.isCertainlyParameterDeclaration())this.parser.raise(r,s);else if(i.canBeArrowParameterDeclaration())i.recordDeclarationError(r,s);else return}recordAsyncArrowParametersError(r){let{stack:t}=this,n=t.length-1,i=t[n];for(;i.canBeArrowParameterDeclaration();)i.type===2&&i.recordDeclarationError(S.AwaitBindingIdentifier,r),i=t[--n]}validateAsPattern(){let{stack:r}=this,t=r[r.length-1];t.canBeArrowParameterDeclaration()&&t.iterateErrors(([n,i])=>{this.parser.raise(n,i);let s=r.length-2,o=r[s];for(;o.canBeArrowParameterDeclaration();)o.clearDeclarationError(i.index),o=r[--s]})}};function Mv(){return new Vi(3)}function $v(){return new Na(1)}function Uv(){return new Na(2)}function Gy(){return new Vi}var _c=class{constructor(){this.stacks=[]}enter(r){this.stacks.push(r)}exit(){this.stacks.pop()}currentFlags(){return this.stacks[this.stacks.length-1]}get hasAwait(){return(this.currentFlags()&2)>0}get hasYield(){return(this.currentFlags()&1)>0}get hasReturn(){return(this.currentFlags()&4)>0}get hasIn(){return(this.currentFlags()&8)>0}};function va(e,r){return(e?2:0)|(r?1:0)}var kc=class extends Pc{addExtra(r,t,n,i=!0){if(!r)return;let{extra:s}=r;s==null&&(s={},r.extra=s),i?s[t]=n:Object.defineProperty(s,t,{enumerable:i,value:n})}isContextual(r){return this.state.type===r&&!this.state.containsEsc}isUnparsedContextual(r,t){let n=r+t.length;if(this.input.slice(r,n)===t){let i=this.input.charCodeAt(n);return!($i(i)||(i&64512)===55296)}return!1}isLookaheadContextual(r){let t=this.nextTokenStart();return this.isUnparsedContextual(t,r)}eatContextual(r){return this.isContextual(r)?(this.next(),!0):!1}expectContextual(r,t){if(!this.eatContextual(r)){if(t!=null)throw this.raise(t,this.state.startLoc);this.unexpected(null,r)}}canInsertSemicolon(){return this.match(139)||this.match(8)||this.hasPrecedingLineBreak()}hasPrecedingLineBreak(){return vy(this.input,this.state.lastTokEndLoc.index,this.state.start)}hasFollowingLineBreak(){return vy(this.input,this.state.end,this.nextTokenStart())}isLineTerminator(){return this.eat(13)||this.canInsertSemicolon()}semicolon(r=!0){(r?this.isLineTerminator():this.eat(13))||this.raise(S.MissingSemicolon,this.state.lastTokEndLoc)}expect(r,t){this.eat(r)||this.unexpected(t,r)}tryParse(r,t=this.state.clone()){let n={node:null};try{let i=r((s=null)=>{throw n.node=s,n});if(this.state.errors.length>t.errors.length){let s=this.state;return this.state=t,this.state.tokensLength=s.tokensLength,{node:i,error:s.errors[t.errors.length],thrown:!1,aborted:!1,failState:s}}return{node:i,error:null,thrown:!1,aborted:!1,failState:null}}catch(i){let s=this.state;if(this.state=t,i instanceof SyntaxError)return{node:null,error:i,thrown:!0,aborted:!1,failState:s};if(i===n)return{node:n.node,error:null,thrown:!1,aborted:!0,failState:s};throw i}}checkExpressionErrors(r,t){if(!r)return!1;let{shorthandAssignLoc:n,doubleProtoLoc:i,privateKeyLoc:s,optionalParametersLoc:o}=r,a=!!n||!!i||!!o||!!s;if(!t)return a;n!=null&&this.raise(S.InvalidCoverInitializedName,n),i!=null&&this.raise(S.DuplicateProto,i),s!=null&&this.raise(S.UnexpectedPrivateField,s),o!=null&&this.unexpected(o)}isLiteralPropertyName(){return By(this.state.type)}isPrivateName(r){return r.type==="PrivateName"}getPrivateNameSV(r){return r.id.name}hasPropertyAsPrivateName(r){return(r.type==="MemberExpression"||r.type==="OptionalMemberExpression")&&this.isPrivateName(r.property)}isObjectProperty(r){return r.type==="ObjectProperty"}isObjectMethod(r){return r.type==="ObjectMethod"}initializeScopes(r=this.options.sourceType==="module"){let t=this.state.labels;this.state.labels=[];let n=this.exportedIdentifiers;this.exportedIdentifiers=new Set;let i=this.inModule;this.inModule=r;let s=this.scope,o=this.getScopeHandler();this.scope=new o(this,r);let a=this.prodParam;this.prodParam=new _c;let l=this.classScope;this.classScope=new Nc(this);let u=this.expressionScope;return this.expressionScope=new Fc(this),()=>{this.state.labels=t,this.exportedIdentifiers=n,this.inModule=i,this.scope=s,this.prodParam=a,this.classScope=l,this.expressionScope=u}}enterInitialScopes(){let r=0;this.inModule&&(r|=2),this.scope.enter(1),this.prodParam.enter(r)}checkDestructuringPrivate(r){let{privateKeyLoc:t}=r;t!==null&&this.expectPlugin("destructuringPrivate",t)}},ji=class{constructor(){this.shorthandAssignLoc=null,this.doubleProtoLoc=null,this.privateKeyLoc=null,this.optionalParametersLoc=null}},zi=class{constructor(r,t,n){this.type="",this.start=t,this.end=0,this.loc=new Ki(n),r!=null&&r.options.ranges&&(this.range=[t,0]),r!=null&&r.filename&&(this.loc.filename=r.filename)}},Jc=zi.prototype;Jc.__clone=function(){let e=new zi(void 0,this.start,this.loc.start),r=Object.keys(this);for(let t=0,n=r.length;t<n;t++){let i=r[t];i!=="leadingComments"&&i!=="trailingComments"&&i!=="innerComments"&&(e[i]=this[i])}return e};function jv(e){return ln(e)}function ln(e){let{type:r,start:t,end:n,loc:i,range:s,extra:o,name:a}=e,l=Object.create(Jc);return l.type=r,l.start=t,l.end=n,l.loc=i,l.range=s,l.extra=o,l.name=a,r==="Placeholder"&&(l.expectedNode=e.expectedNode),l}function Kv(e){let{type:r,start:t,end:n,loc:i,range:s,extra:o}=e;if(r==="Placeholder")return jv(e);let a=Object.create(Jc);return a.type=r,a.start=t,a.end=n,a.loc=i,a.range=s,e.raw!==void 0?a.raw=e.raw:a.extra=o,a.value=e.value,a}var Oc=class extends kc{startNode(){let r=this.state.startLoc;return new zi(this,r.index,r)}startNodeAt(r){return new zi(this,r.index,r)}startNodeAtNode(r){return this.startNodeAt(r.loc.start)}finishNode(r,t){return this.finishNodeAt(r,t,this.state.lastTokEndLoc)}finishNodeAt(r,t,n){return r.type=t,r.end=n.index,r.loc.end=n,this.options.ranges&&(r.range[1]=n.index),this.options.attachComment&&this.processComment(r),r}resetStartLocation(r,t){r.start=t.index,r.loc.start=t,this.options.ranges&&(r.range[0]=t.index)}resetEndLocation(r,t=this.state.lastTokEndLoc){r.end=t.index,r.loc.end=t,this.options.ranges&&(r.range[1]=t.index)}resetStartLocationFromNode(r,t){this.resetStartLocation(r,t.loc.start)}},Vv=new Set(["_","any","bool","boolean","empty","extends","false","interface","mixed","null","number","static","string","true","typeof","void"]),Q=an`flow`({AmbiguousConditionalArrow:"Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.",AmbiguousDeclareModuleKind:"Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.",AssignReservedType:({reservedType:e})=>`Cannot overwrite reserved type ${e}.`,DeclareClassElement:"The `declare` modifier can only appear on class fields.",DeclareClassFieldInitializer:"Initializers are not allowed in fields with the `declare` modifier.",DuplicateDeclareModuleExports:"Duplicate `declare module.exports` statement.",EnumBooleanMemberNotInitialized:({memberName:e,enumName:r})=>`Boolean enum members need to be initialized. Use either \`${e} = true,\` or \`${e} = false,\` in enum \`${r}\`.`,EnumDuplicateMemberName:({memberName:e,enumName:r})=>`Enum member names need to be unique, but the name \`${e}\` has already been used before in enum \`${r}\`.`,EnumInconsistentMemberValues:({enumName:e})=>`Enum \`${e}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`,EnumInvalidExplicitType:({invalidEnumType:e,enumName:r})=>`Enum type \`${e}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${r}\`.`,EnumInvalidExplicitTypeUnknownSupplied:({enumName:e})=>`Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${e}\`.`,EnumInvalidMemberInitializerPrimaryType:({enumName:e,memberName:r,explicitType:t})=>`Enum \`${e}\` has type \`${t}\`, so the initializer of \`${r}\` needs to be a ${t} literal.`,EnumInvalidMemberInitializerSymbolType:({enumName:e,memberName:r})=>`Symbol enum members cannot be initialized. Use \`${r},\` in enum \`${e}\`.`,EnumInvalidMemberInitializerUnknownType:({enumName:e,memberName:r})=>`The enum member initializer for \`${r}\` needs to be a literal (either a boolean, number, or string) in enum \`${e}\`.`,EnumInvalidMemberName:({enumName:e,memberName:r,suggestion:t})=>`Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${r}\`, consider using \`${t}\`, in enum \`${e}\`.`,EnumNumberMemberNotInitialized:({enumName:e,memberName:r})=>`Number enum members need to be initialized, e.g. \`${r} = 1\` in enum \`${e}\`.`,EnumStringMemberInconsistentlyInitialized:({enumName:e})=>`String enum members need to consistently either all use initializers, or use no initializers, in enum \`${e}\`.`,GetterMayNotHaveThisParam:"A getter cannot have a `this` parameter.",ImportReflectionHasImportType:"An `import module` declaration can not use `type` or `typeof` keyword.",ImportTypeShorthandOnlyInPureImport:"The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements.",InexactInsideExact:"Explicit inexact syntax cannot appear inside an explicit exact object type.",InexactInsideNonObject:"Explicit inexact syntax cannot appear in class or interface definitions.",InexactVariance:"Explicit inexact syntax cannot have variance.",InvalidNonTypeImportInDeclareModule:"Imports within a `declare module` body must always be `import type` or `import typeof`.",MissingTypeParamDefault:"Type parameter declaration needs a default, since a preceding type parameter declaration has a default.",NestedDeclareModule:"`declare module` cannot be used inside another `declare module`.",NestedFlowComment:"Cannot have a flow comment inside another flow comment.",PatternIsOptional:Object.assign({message:"A binding pattern parameter cannot be optional in an implementation signature."},{reasonCode:"OptionalBindingPattern"}),SetterMayNotHaveThisParam:"A setter cannot have a `this` parameter.",SpreadVariance:"Spread properties cannot have variance.",ThisParamAnnotationRequired:"A type annotation is required for the `this` parameter.",ThisParamBannedInConstructor:"Constructors cannot have a `this` parameter; constructors don't bind `this` like other functions.",ThisParamMayNotBeOptional:"The `this` parameter cannot be optional.",ThisParamMustBeFirst:"The `this` parameter must be the first function parameter.",ThisParamNoDefault:"The `this` parameter may not have a default value.",TypeBeforeInitializer:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeCastInPattern:"The type cast expression is expected to be wrapped with parenthesis.",UnexpectedExplicitInexactInObject:"Explicit inexact syntax must appear at the end of an inexact object.",UnexpectedReservedType:({reservedType:e})=>`Unexpected reserved type ${e}.`,UnexpectedReservedUnderscore:"`_` is only allowed as a type argument to call or new.",UnexpectedSpaceBetweenModuloChecks:"Spaces between `%` and `checks` are not allowed here.",UnexpectedSpreadType:"Spread operator cannot appear in class or interface definitions.",UnexpectedSubtractionOperand:'Unexpected token, expected "number" or "bigint".',UnexpectedTokenAfterTypeParameter:"Expected an arrow function after this type parameter declaration.",UnexpectedTypeParameterBeforeAsyncArrowFunction:"Type parameters must come after the async keyword, e.g. instead of `<T> async () => {}`, use `async <T>() => {}`.",UnsupportedDeclareExportKind:({unsupportedExportKind:e,suggestion:r})=>`\`declare export ${e}\` is not supported. Use \`${r}\` instead.`,UnsupportedStatementInDeclareModule:"Only declares and type imports are allowed inside declare module.",UnterminatedFlowComment:"Unterminated flow-comment."});function zv(e){return e.type==="DeclareExportAllDeclaration"||e.type==="DeclareExportDeclaration"&&(!e.declaration||e.declaration.type!=="TypeAlias"&&e.declaration.type!=="InterfaceDeclaration")}function Ny(e){return e.importKind==="type"||e.importKind==="typeof"}var qv={const:"declare export var",let:"declare export var",type:"export type",interface:"export interface"};function Wv(e,r){let t=[],n=[];for(let i=0;i<e.length;i++)(r(e[i],i,e)?t:n).push(e[i]);return[t,n]}var Gv=/\*?\s*@((?:no)?flow)\b/,Hv=e=>class extends e{constructor(...t){super(...t),this.flowPragma=void 0}getScopeHandler(){return Sc}shouldParseTypes(){return this.getPluginOption("flow","all")||this.flowPragma==="flow"}finishToken(t,n){t!==133&&t!==13&&t!==28&&this.flowPragma===void 0&&(this.flowPragma=null),super.finishToken(t,n)}addComment(t){if(this.flowPragma===void 0){let n=Gv.exec(t.value);if(n)if(n[1]==="flow")this.flowPragma="flow";else if(n[1]==="noflow")this.flowPragma="noflow";else throw new Error("Unexpected flow pragma")}super.addComment(t)}flowParseTypeInitialiser(t){let n=this.state.inType;this.state.inType=!0,this.expect(t||14);let i=this.flowParseType();return this.state.inType=n,i}flowParsePredicate(){let t=this.startNode(),n=this.state.startLoc;return this.next(),this.expectContextual(110),this.state.lastTokStartLoc.index>n.index+1&&this.raise(Q.UnexpectedSpaceBetweenModuloChecks,n),this.eat(10)?(t.value=super.parseExpression(),this.expect(11),this.finishNode(t,"DeclaredPredicate")):this.finishNode(t,"InferredPredicate")}flowParseTypeAndPredicateInitialiser(){let t=this.state.inType;this.state.inType=!0,this.expect(14);let n=null,i=null;return this.match(54)?(this.state.inType=t,i=this.flowParsePredicate()):(n=this.flowParseType(),this.state.inType=t,this.match(54)&&(i=this.flowParsePredicate())),[n,i]}flowParseDeclareClass(t){return this.next(),this.flowParseInterfaceish(t,!0),this.finishNode(t,"DeclareClass")}flowParseDeclareFunction(t){this.next();let n=t.id=this.parseIdentifier(),i=this.startNode(),s=this.startNode();this.match(47)?i.typeParameters=this.flowParseTypeParameterDeclaration():i.typeParameters=null,this.expect(10);let o=this.flowParseFunctionTypeParams();return i.params=o.params,i.rest=o.rest,i.this=o._this,this.expect(11),[i.returnType,t.predicate]=this.flowParseTypeAndPredicateInitialiser(),s.typeAnnotation=this.finishNode(i,"FunctionTypeAnnotation"),n.typeAnnotation=this.finishNode(s,"TypeAnnotation"),this.resetEndLocation(n),this.semicolon(),this.scope.declareName(t.id.name,2048,t.id.loc.start),this.finishNode(t,"DeclareFunction")}flowParseDeclare(t,n){if(this.match(80))return this.flowParseDeclareClass(t);if(this.match(68))return this.flowParseDeclareFunction(t);if(this.match(74))return this.flowParseDeclareVariable(t);if(this.eatContextual(127))return this.match(16)?this.flowParseDeclareModuleExports(t):(n&&this.raise(Q.NestedDeclareModule,this.state.lastTokStartLoc),this.flowParseDeclareModule(t));if(this.isContextual(130))return this.flowParseDeclareTypeAlias(t);if(this.isContextual(131))return this.flowParseDeclareOpaqueType(t);if(this.isContextual(129))return this.flowParseDeclareInterface(t);if(this.match(82))return this.flowParseDeclareExportDeclaration(t,n);this.unexpected()}flowParseDeclareVariable(t){return this.next(),t.id=this.flowParseTypeAnnotatableIdentifier(!0),this.scope.declareName(t.id.name,5,t.id.loc.start),this.semicolon(),this.finishNode(t,"DeclareVariable")}flowParseDeclareModule(t){this.scope.enter(0),this.match(133)?t.id=super.parseExprAtom():t.id=this.parseIdentifier();let n=t.body=this.startNode(),i=n.body=[];for(this.expect(5);!this.match(8);){let a=this.startNode();this.match(83)?(this.next(),!this.isContextual(130)&&!this.match(87)&&this.raise(Q.InvalidNonTypeImportInDeclareModule,this.state.lastTokStartLoc),super.parseImport(a)):(this.expectContextual(125,Q.UnsupportedStatementInDeclareModule),a=this.flowParseDeclare(a,!0)),i.push(a)}this.scope.exit(),this.expect(8),this.finishNode(n,"BlockStatement");let s=null,o=!1;return i.forEach(a=>{zv(a)?(s==="CommonJS"&&this.raise(Q.AmbiguousDeclareModuleKind,a),s="ES"):a.type==="DeclareModuleExports"&&(o&&this.raise(Q.DuplicateDeclareModuleExports,a),s==="ES"&&this.raise(Q.AmbiguousDeclareModuleKind,a),s="CommonJS",o=!0)}),t.kind=s||"CommonJS",this.finishNode(t,"DeclareModule")}flowParseDeclareExportDeclaration(t,n){if(this.expect(82),this.eat(65))return this.match(68)||this.match(80)?t.declaration=this.flowParseDeclare(this.startNode()):(t.declaration=this.flowParseType(),this.semicolon()),t.default=!0,this.finishNode(t,"DeclareExportDeclaration");if(this.match(75)||this.isLet()||(this.isContextual(130)||this.isContextual(129))&&!n){let i=this.state.value;throw this.raise(Q.UnsupportedDeclareExportKind,this.state.startLoc,{unsupportedExportKind:i,suggestion:qv[i]})}if(this.match(74)||this.match(68)||this.match(80)||this.isContextual(131))return t.declaration=this.flowParseDeclare(this.startNode()),t.default=!1,this.finishNode(t,"DeclareExportDeclaration");if(this.match(55)||this.match(5)||this.isContextual(129)||this.isContextual(130)||this.isContextual(131))return t=this.parseExport(t,null),t.type==="ExportNamedDeclaration"&&(t.type="ExportDeclaration",t.default=!1,delete t.exportKind),t.type="Declare"+t.type,t;this.unexpected()}flowParseDeclareModuleExports(t){return this.next(),this.expectContextual(111),t.typeAnnotation=this.flowParseTypeAnnotation(),this.semicolon(),this.finishNode(t,"DeclareModuleExports")}flowParseDeclareTypeAlias(t){this.next();let n=this.flowParseTypeAlias(t);return n.type="DeclareTypeAlias",n}flowParseDeclareOpaqueType(t){this.next();let n=this.flowParseOpaqueType(t,!0);return n.type="DeclareOpaqueType",n}flowParseDeclareInterface(t){return this.next(),this.flowParseInterfaceish(t,!1),this.finishNode(t,"DeclareInterface")}flowParseInterfaceish(t,n){if(t.id=this.flowParseRestrictedIdentifier(!n,!0),this.scope.declareName(t.id.name,n?17:8201,t.id.loc.start),this.match(47)?t.typeParameters=this.flowParseTypeParameterDeclaration():t.typeParameters=null,t.extends=[],this.eat(81))do t.extends.push(this.flowParseInterfaceExtends());while(!n&&this.eat(12));if(n){if(t.implements=[],t.mixins=[],this.eatContextual(117))do t.mixins.push(this.flowParseInterfaceExtends());while(this.eat(12));if(this.eatContextual(113))do t.implements.push(this.flowParseInterfaceExtends());while(this.eat(12))}t.body=this.flowParseObjectType({allowStatic:n,allowExact:!1,allowSpread:!1,allowProto:n,allowInexact:!1})}flowParseInterfaceExtends(){let t=this.startNode();return t.id=this.flowParseQualifiedTypeIdentifier(),this.match(47)?t.typeParameters=this.flowParseTypeParameterInstantiation():t.typeParameters=null,this.finishNode(t,"InterfaceExtends")}flowParseInterface(t){return this.flowParseInterfaceish(t,!1),this.finishNode(t,"InterfaceDeclaration")}checkNotUnderscore(t){t==="_"&&this.raise(Q.UnexpectedReservedUnderscore,this.state.startLoc)}checkReservedType(t,n,i){Vv.has(t)&&this.raise(i?Q.AssignReservedType:Q.UnexpectedReservedType,n,{reservedType:t})}flowParseRestrictedIdentifier(t,n){return this.checkReservedType(this.state.value,this.state.startLoc,n),this.parseIdentifier(t)}flowParseTypeAlias(t){return t.id=this.flowParseRestrictedIdentifier(!1,!0),this.scope.declareName(t.id.name,8201,t.id.loc.start),this.match(47)?t.typeParameters=this.flowParseTypeParameterDeclaration():t.typeParameters=null,t.right=this.flowParseTypeInitialiser(29),this.semicolon(),this.finishNode(t,"TypeAlias")}flowParseOpaqueType(t,n){return this.expectContextual(130),t.id=this.flowParseRestrictedIdentifier(!0,!0),this.scope.declareName(t.id.name,8201,t.id.loc.start),this.match(47)?t.typeParameters=this.flowParseTypeParameterDeclaration():t.typeParameters=null,t.supertype=null,this.match(14)&&(t.supertype=this.flowParseTypeInitialiser(14)),t.impltype=null,n||(t.impltype=this.flowParseTypeInitialiser(29)),this.semicolon(),this.finishNode(t,"OpaqueType")}flowParseTypeParameter(t=!1){let n=this.state.startLoc,i=this.startNode(),s=this.flowParseVariance(),o=this.flowParseTypeAnnotatableIdentifier();return i.name=o.name,i.variance=s,i.bound=o.typeAnnotation,this.match(29)?(this.eat(29),i.default=this.flowParseType()):t&&this.raise(Q.MissingTypeParamDefault,n),this.finishNode(i,"TypeParameter")}flowParseTypeParameterDeclaration(){let t=this.state.inType,n=this.startNode();n.params=[],this.state.inType=!0,this.match(47)||this.match(142)?this.next():this.unexpected();let i=!1;do{let s=this.flowParseTypeParameter(i);n.params.push(s),s.default&&(i=!0),this.match(48)||this.expect(12)}while(!this.match(48));return this.expect(48),this.state.inType=t,this.finishNode(n,"TypeParameterDeclaration")}flowParseTypeParameterInstantiation(){let t=this.startNode(),n=this.state.inType;t.params=[],this.state.inType=!0,this.expect(47);let i=this.state.noAnonFunctionType;for(this.state.noAnonFunctionType=!1;!this.match(48);)t.params.push(this.flowParseType()),this.match(48)||this.expect(12);return this.state.noAnonFunctionType=i,this.expect(48),this.state.inType=n,this.finishNode(t,"TypeParameterInstantiation")}flowParseTypeParameterInstantiationCallOrNew(){let t=this.startNode(),n=this.state.inType;for(t.params=[],this.state.inType=!0,this.expect(47);!this.match(48);)t.params.push(this.flowParseTypeOrImplicitInstantiation()),this.match(48)||this.expect(12);return this.expect(48),this.state.inType=n,this.finishNode(t,"TypeParameterInstantiation")}flowParseInterfaceType(){let t=this.startNode();if(this.expectContextual(129),t.extends=[],this.eat(81))do t.extends.push(this.flowParseInterfaceExtends());while(this.eat(12));return t.body=this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!1,allowProto:!1,allowInexact:!1}),this.finishNode(t,"InterfaceTypeAnnotation")}flowParseObjectPropertyKey(){return this.match(134)||this.match(133)?super.parseExprAtom():this.parseIdentifier(!0)}flowParseObjectTypeIndexer(t,n,i){return t.static=n,this.lookahead().type===14?(t.id=this.flowParseObjectPropertyKey(),t.key=this.flowParseTypeInitialiser()):(t.id=null,t.key=this.flowParseType()),this.expect(3),t.value=this.flowParseTypeInitialiser(),t.variance=i,this.finishNode(t,"ObjectTypeIndexer")}flowParseObjectTypeInternalSlot(t,n){return t.static=n,t.id=this.flowParseObjectPropertyKey(),this.expect(3),this.expect(3),this.match(47)||this.match(10)?(t.method=!0,t.optional=!1,t.value=this.flowParseObjectTypeMethodish(this.startNodeAt(t.loc.start))):(t.method=!1,this.eat(17)&&(t.optional=!0),t.value=this.flowParseTypeInitialiser()),this.finishNode(t,"ObjectTypeInternalSlot")}flowParseObjectTypeMethodish(t){for(t.params=[],t.rest=null,t.typeParameters=null,t.this=null,this.match(47)&&(t.typeParameters=this.flowParseTypeParameterDeclaration()),this.expect(10),this.match(78)&&(t.this=this.flowParseFunctionTypeParam(!0),t.this.name=null,this.match(11)||this.expect(12));!this.match(11)&&!this.match(21);)t.params.push(this.flowParseFunctionTypeParam(!1)),this.match(11)||this.expect(12);return this.eat(21)&&(t.rest=this.flowParseFunctionTypeParam(!1)),this.expect(11),t.returnType=this.flowParseTypeInitialiser(),this.finishNode(t,"FunctionTypeAnnotation")}flowParseObjectTypeCallProperty(t,n){let i=this.startNode();return t.static=n,t.value=this.flowParseObjectTypeMethodish(i),this.finishNode(t,"ObjectTypeCallProperty")}flowParseObjectType({allowStatic:t,allowExact:n,allowSpread:i,allowProto:s,allowInexact:o}){let a=this.state.inType;this.state.inType=!0;let l=this.startNode();l.callProperties=[],l.properties=[],l.indexers=[],l.internalSlots=[];let u,c,p=!1;for(n&&this.match(6)?(this.expect(6),u=9,c=!0):(this.expect(5),u=8,c=!1),l.exact=c;!this.match(u);){let f=!1,m=null,h=null,g=this.startNode();if(s&&this.isContextual(118)){let D=this.lookahead();D.type!==14&&D.type!==17&&(this.next(),m=this.state.startLoc,t=!1)}if(t&&this.isContextual(106)){let D=this.lookahead();D.type!==14&&D.type!==17&&(this.next(),f=!0)}let y=this.flowParseVariance();if(this.eat(0))m!=null&&this.unexpected(m),this.eat(0)?(y&&this.unexpected(y.loc.start),l.internalSlots.push(this.flowParseObjectTypeInternalSlot(g,f))):l.indexers.push(this.flowParseObjectTypeIndexer(g,f,y));else if(this.match(10)||this.match(47))m!=null&&this.unexpected(m),y&&this.unexpected(y.loc.start),l.callProperties.push(this.flowParseObjectTypeCallProperty(g,f));else{let D="init";if(this.isContextual(99)||this.isContextual(104)){let x=this.lookahead();By(x.type)&&(D=this.state.value,this.next())}let C=this.flowParseObjectTypeProperty(g,f,m,y,D,i,o??!c);C===null?(p=!0,h=this.state.lastTokStartLoc):l.properties.push(C)}this.flowObjectTypeSemicolon(),h&&!this.match(8)&&!this.match(9)&&this.raise(Q.UnexpectedExplicitInexactInObject,h)}this.expect(u),i&&(l.inexact=p);let d=this.finishNode(l,"ObjectTypeAnnotation");return this.state.inType=a,d}flowParseObjectTypeProperty(t,n,i,s,o,a,l){if(this.eat(21))return this.match(12)||this.match(13)||this.match(8)||this.match(9)?(a?l||this.raise(Q.InexactInsideExact,this.state.lastTokStartLoc):this.raise(Q.InexactInsideNonObject,this.state.lastTokStartLoc),s&&this.raise(Q.InexactVariance,s),null):(a||this.raise(Q.UnexpectedSpreadType,this.state.lastTokStartLoc),i!=null&&this.unexpected(i),s&&this.raise(Q.SpreadVariance,s),t.argument=this.flowParseType(),this.finishNode(t,"ObjectTypeSpreadProperty"));{t.key=this.flowParseObjectPropertyKey(),t.static=n,t.proto=i!=null,t.kind=o;let u=!1;return this.match(47)||this.match(10)?(t.method=!0,i!=null&&this.unexpected(i),s&&this.unexpected(s.loc.start),t.value=this.flowParseObjectTypeMethodish(this.startNodeAt(t.loc.start)),(o==="get"||o==="set")&&this.flowCheckGetterSetterParams(t),!a&&t.key.name==="constructor"&&t.value.this&&this.raise(Q.ThisParamBannedInConstructor,t.value.this)):(o!=="init"&&this.unexpected(),t.method=!1,this.eat(17)&&(u=!0),t.value=this.flowParseTypeInitialiser(),t.variance=s),t.optional=u,this.finishNode(t,"ObjectTypeProperty")}}flowCheckGetterSetterParams(t){let n=t.kind==="get"?0:1,i=t.value.params.length+(t.value.rest?1:0);t.value.this&&this.raise(t.kind==="get"?Q.GetterMayNotHaveThisParam:Q.SetterMayNotHaveThisParam,t.value.this),i!==n&&this.raise(t.kind==="get"?S.BadGetterArity:S.BadSetterArity,t),t.kind==="set"&&t.value.rest&&this.raise(S.BadSetterRestParameter,t)}flowObjectTypeSemicolon(){!this.eat(13)&&!this.eat(12)&&!this.match(8)&&!this.match(9)&&this.unexpected()}flowParseQualifiedTypeIdentifier(t,n){var i;(i=t)!=null||(t=this.state.startLoc);let s=n||this.flowParseRestrictedIdentifier(!0);for(;this.eat(16);){let o=this.startNodeAt(t);o.qualification=s,o.id=this.flowParseRestrictedIdentifier(!0),s=this.finishNode(o,"QualifiedTypeIdentifier")}return s}flowParseGenericType(t,n){let i=this.startNodeAt(t);return i.typeParameters=null,i.id=this.flowParseQualifiedTypeIdentifier(t,n),this.match(47)&&(i.typeParameters=this.flowParseTypeParameterInstantiation()),this.finishNode(i,"GenericTypeAnnotation")}flowParseTypeofType(){let t=this.startNode();return this.expect(87),t.argument=this.flowParsePrimaryType(),this.finishNode(t,"TypeofTypeAnnotation")}flowParseTupleType(){let t=this.startNode();for(t.types=[],this.expect(0);this.state.pos<this.length&&!this.match(3)&&(t.types.push(this.flowParseType()),!this.match(3));)this.expect(12);return this.expect(3),this.finishNode(t,"TupleTypeAnnotation")}flowParseFunctionTypeParam(t){let n=null,i=!1,s=null,o=this.startNode(),a=this.lookahead(),l=this.state.type===78;return a.type===14||a.type===17?(l&&!t&&this.raise(Q.ThisParamMustBeFirst,o),n=this.parseIdentifier(l),this.eat(17)&&(i=!0,l&&this.raise(Q.ThisParamMayNotBeOptional,o)),s=this.flowParseTypeInitialiser()):s=this.flowParseType(),o.name=n,o.optional=i,o.typeAnnotation=s,this.finishNode(o,"FunctionTypeParam")}reinterpretTypeAsFunctionTypeParam(t){let n=this.startNodeAt(t.loc.start);return n.name=null,n.optional=!1,n.typeAnnotation=t,this.finishNode(n,"FunctionTypeParam")}flowParseFunctionTypeParams(t=[]){let n=null,i=null;for(this.match(78)&&(i=this.flowParseFunctionTypeParam(!0),i.name=null,this.match(11)||this.expect(12));!this.match(11)&&!this.match(21);)t.push(this.flowParseFunctionTypeParam(!1)),this.match(11)||this.expect(12);return this.eat(21)&&(n=this.flowParseFunctionTypeParam(!1)),{params:t,rest:n,_this:i}}flowIdentToTypeAnnotation(t,n,i){switch(i.name){case"any":return this.finishNode(n,"AnyTypeAnnotation");case"bool":case"boolean":return this.finishNode(n,"BooleanTypeAnnotation");case"mixed":return this.finishNode(n,"MixedTypeAnnotation");case"empty":return this.finishNode(n,"EmptyTypeAnnotation");case"number":return this.finishNode(n,"NumberTypeAnnotation");case"string":return this.finishNode(n,"StringTypeAnnotation");case"symbol":return this.finishNode(n,"SymbolTypeAnnotation");default:return this.checkNotUnderscore(i.name),this.flowParseGenericType(t,i)}}flowParsePrimaryType(){let t=this.state.startLoc,n=this.startNode(),i,s,o=!1,a=this.state.noAnonFunctionType;switch(this.state.type){case 5:return this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!0,allowProto:!1,allowInexact:!0});case 6:return this.flowParseObjectType({allowStatic:!1,allowExact:!0,allowSpread:!0,allowProto:!1,allowInexact:!1});case 0:return this.state.noAnonFunctionType=!1,s=this.flowParseTupleType(),this.state.noAnonFunctionType=a,s;case 47:{let l=this.startNode();return l.typeParameters=this.flowParseTypeParameterDeclaration(),this.expect(10),i=this.flowParseFunctionTypeParams(),l.params=i.params,l.rest=i.rest,l.this=i._this,this.expect(11),this.expect(19),l.returnType=this.flowParseType(),this.finishNode(l,"FunctionTypeAnnotation")}case 10:{let l=this.startNode();if(this.next(),!this.match(11)&&!this.match(21))if(we(this.state.type)||this.match(78)){let u=this.lookahead().type;o=u!==17&&u!==14}else o=!0;if(o){if(this.state.noAnonFunctionType=!1,s=this.flowParseType(),this.state.noAnonFunctionType=a,this.state.noAnonFunctionType||!(this.match(12)||this.match(11)&&this.lookahead().type===19))return this.expect(11),s;this.eat(12)}return s?i=this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(s)]):i=this.flowParseFunctionTypeParams(),l.params=i.params,l.rest=i.rest,l.this=i._this,this.expect(11),this.expect(19),l.returnType=this.flowParseType(),l.typeParameters=null,this.finishNode(l,"FunctionTypeAnnotation")}case 133:return this.parseLiteral(this.state.value,"StringLiteralTypeAnnotation");case 85:case 86:return n.value=this.match(85),this.next(),this.finishNode(n,"BooleanLiteralTypeAnnotation");case 53:if(this.state.value==="-"){if(this.next(),this.match(134))return this.parseLiteralAtNode(-this.state.value,"NumberLiteralTypeAnnotation",n);if(this.match(135))return this.parseLiteralAtNode(-this.state.value,"BigIntLiteralTypeAnnotation",n);throw this.raise(Q.UnexpectedSubtractionOperand,this.state.startLoc)}this.unexpected();return;case 134:return this.parseLiteral(this.state.value,"NumberLiteralTypeAnnotation");case 135:return this.parseLiteral(this.state.value,"BigIntLiteralTypeAnnotation");case 88:return this.next(),this.finishNode(n,"VoidTypeAnnotation");case 84:return this.next(),this.finishNode(n,"NullLiteralTypeAnnotation");case 78:return this.next(),this.finishNode(n,"ThisTypeAnnotation");case 55:return this.next(),this.finishNode(n,"ExistsTypeAnnotation");case 87:return this.flowParseTypeofType();default:if(Wc(this.state.type)){let l=In(this.state.type);return this.next(),super.createIdentifier(n,l)}else if(we(this.state.type))return this.isContextual(129)?this.flowParseInterfaceType():this.flowIdentToTypeAnnotation(t,n,this.parseIdentifier())}this.unexpected()}flowParsePostfixType(){let t=this.state.startLoc,n=this.flowParsePrimaryType(),i=!1;for(;(this.match(0)||this.match(18))&&!this.canInsertSemicolon();){let s=this.startNodeAt(t),o=this.eat(18);i=i||o,this.expect(0),!o&&this.match(3)?(s.elementType=n,this.next(),n=this.finishNode(s,"ArrayTypeAnnotation")):(s.objectType=n,s.indexType=this.flowParseType(),this.expect(3),i?(s.optional=o,n=this.finishNode(s,"OptionalIndexedAccessType")):n=this.finishNode(s,"IndexedAccessType"))}return n}flowParsePrefixType(){let t=this.startNode();return this.eat(17)?(t.typeAnnotation=this.flowParsePrefixType(),this.finishNode(t,"NullableTypeAnnotation")):this.flowParsePostfixType()}flowParseAnonFunctionWithoutParens(){let t=this.flowParsePrefixType();if(!this.state.noAnonFunctionType&&this.eat(19)){let n=this.startNodeAt(t.loc.start);return n.params=[this.reinterpretTypeAsFunctionTypeParam(t)],n.rest=null,n.this=null,n.returnType=this.flowParseType(),n.typeParameters=null,this.finishNode(n,"FunctionTypeAnnotation")}return t}flowParseIntersectionType(){let t=this.startNode();this.eat(45);let n=this.flowParseAnonFunctionWithoutParens();for(t.types=[n];this.eat(45);)t.types.push(this.flowParseAnonFunctionWithoutParens());return t.types.length===1?n:this.finishNode(t,"IntersectionTypeAnnotation")}flowParseUnionType(){let t=this.startNode();this.eat(43);let n=this.flowParseIntersectionType();for(t.types=[n];this.eat(43);)t.types.push(this.flowParseIntersectionType());return t.types.length===1?n:this.finishNode(t,"UnionTypeAnnotation")}flowParseType(){let t=this.state.inType;this.state.inType=!0;let n=this.flowParseUnionType();return this.state.inType=t,n}flowParseTypeOrImplicitInstantiation(){if(this.state.type===132&&this.state.value==="_"){let t=this.state.startLoc,n=this.parseIdentifier();return this.flowParseGenericType(t,n)}else return this.flowParseType()}flowParseTypeAnnotation(){let t=this.startNode();return t.typeAnnotation=this.flowParseTypeInitialiser(),this.finishNode(t,"TypeAnnotation")}flowParseTypeAnnotatableIdentifier(t){let n=t?this.parseIdentifier():this.flowParseRestrictedIdentifier();return this.match(14)&&(n.typeAnnotation=this.flowParseTypeAnnotation(),this.resetEndLocation(n)),n}typeCastToParameter(t){return t.expression.typeAnnotation=t.typeAnnotation,this.resetEndLocation(t.expression,t.typeAnnotation.loc.end),t.expression}flowParseVariance(){let t=null;return this.match(53)?(t=this.startNode(),this.state.value==="+"?t.kind="plus":t.kind="minus",this.next(),this.finishNode(t,"Variance")):t}parseFunctionBody(t,n,i=!1){if(n){this.forwardNoArrowParamsConversionAt(t,()=>super.parseFunctionBody(t,!0,i));return}super.parseFunctionBody(t,!1,i)}parseFunctionBodyAndFinish(t,n,i=!1){if(this.match(14)){let s=this.startNode();[s.typeAnnotation,t.predicate]=this.flowParseTypeAndPredicateInitialiser(),t.returnType=s.typeAnnotation?this.finishNode(s,"TypeAnnotation"):null}return super.parseFunctionBodyAndFinish(t,n,i)}parseStatementLike(t){if(this.state.strict&&this.isContextual(129)){let i=this.lookahead();if(hr(i.type)){let s=this.startNode();return this.next(),this.flowParseInterface(s)}}else if(this.plugins.get("flow").enums&&this.isContextual(126)){let i=this.startNode();return this.next(),this.flowParseEnumDeclaration(i)}let n=super.parseStatementLike(t);return this.flowPragma===void 0&&!this.isValidDirective(n)&&(this.flowPragma=null),n}parseExpressionStatement(t,n,i){if(n.type==="Identifier"){if(n.name==="declare"){if(this.match(80)||we(this.state.type)||this.match(68)||this.match(74)||this.match(82))return this.flowParseDeclare(t)}else if(we(this.state.type)){if(n.name==="interface")return this.flowParseInterface(t);if(n.name==="type")return this.flowParseTypeAlias(t);if(n.name==="opaque")return this.flowParseOpaqueType(t,!1)}}return super.parseExpressionStatement(t,n,i)}shouldParseExportDeclaration(){let{type:t}=this.state;return Ay(t)||this.plugins.get("flow").enums&&t===126?!this.state.containsEsc:super.shouldParseExportDeclaration()}isExportDefaultSpecifier(){let{type:t}=this.state;return Ay(t)||this.plugins.get("flow").enums&&t===126?this.state.containsEsc:super.isExportDefaultSpecifier()}parseExportDefaultExpression(){if(this.plugins.get("flow").enums&&this.isContextual(126)){let t=this.startNode();return this.next(),this.flowParseEnumDeclaration(t)}return super.parseExportDefaultExpression()}parseConditional(t,n,i){if(!this.match(17))return t;if(this.state.maybeInArrowParameters){let d=this.lookaheadCharCode();if(d===44||d===61||d===58||d===41)return this.setOptionalParametersError(i),t}this.expect(17);let s=this.state.clone(),o=this.state.noArrowAt,a=this.startNodeAt(n),{consequent:l,failed:u}=this.tryParseConditionalConsequent(),[c,p]=this.getArrowLikeExpressions(l);if(u||p.length>0){let d=[...o];if(p.length>0){this.state=s,this.state.noArrowAt=d;for(let f=0;f<p.length;f++)d.push(p[f].start);({consequent:l,failed:u}=this.tryParseConditionalConsequent()),[c,p]=this.getArrowLikeExpressions(l)}u&&c.length>1&&this.raise(Q.AmbiguousConditionalArrow,s.startLoc),u&&c.length===1&&(this.state=s,d.push(c[0].start),this.state.noArrowAt=d,{consequent:l,failed:u}=this.tryParseConditionalConsequent())}return this.getArrowLikeExpressions(l,!0),this.state.noArrowAt=o,this.expect(14),a.test=t,a.consequent=l,a.alternate=this.forwardNoArrowParamsConversionAt(a,()=>this.parseMaybeAssign(void 0,void 0)),this.finishNode(a,"ConditionalExpression")}tryParseConditionalConsequent(){this.state.noArrowParamsConversionAt.push(this.state.start);let t=this.parseMaybeAssignAllowIn(),n=!this.match(14);return this.state.noArrowParamsConversionAt.pop(),{consequent:t,failed:n}}getArrowLikeExpressions(t,n){let i=[t],s=[];for(;i.length!==0;){let o=i.pop();o.type==="ArrowFunctionExpression"&&o.body.type!=="BlockStatement"?(o.typeParameters||!o.returnType?this.finishArrowValidation(o):s.push(o),i.push(o.body)):o.type==="ConditionalExpression"&&(i.push(o.consequent),i.push(o.alternate))}return n?(s.forEach(o=>this.finishArrowValidation(o)),[s,[]]):Wv(s,o=>o.params.every(a=>this.isAssignable(a,!0)))}finishArrowValidation(t){var n;this.toAssignableList(t.params,(n=t.extra)==null?void 0:n.trailingCommaLoc,!1),this.scope.enter(6),super.checkParams(t,!1,!0),this.scope.exit()}forwardNoArrowParamsConversionAt(t,n){let i;return this.state.noArrowParamsConversionAt.includes(t.start)?(this.state.noArrowParamsConversionAt.push(this.state.start),i=n(),this.state.noArrowParamsConversionAt.pop()):i=n(),i}parseParenItem(t,n){let i=super.parseParenItem(t,n);if(this.eat(17)&&(i.optional=!0,this.resetEndLocation(t)),this.match(14)){let s=this.startNodeAt(n);return s.expression=i,s.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(s,"TypeCastExpression")}return i}assertModuleNodeAllowed(t){t.type==="ImportDeclaration"&&(t.importKind==="type"||t.importKind==="typeof")||t.type==="ExportNamedDeclaration"&&t.exportKind==="type"||t.type==="ExportAllDeclaration"&&t.exportKind==="type"||super.assertModuleNodeAllowed(t)}parseExportDeclaration(t){if(this.isContextual(130)){t.exportKind="type";let n=this.startNode();return this.next(),this.match(5)?(t.specifiers=this.parseExportSpecifiers(!0),super.parseExportFrom(t),null):this.flowParseTypeAlias(n)}else if(this.isContextual(131)){t.exportKind="type";let n=this.startNode();return this.next(),this.flowParseOpaqueType(n,!1)}else if(this.isContextual(129)){t.exportKind="type";let n=this.startNode();return this.next(),this.flowParseInterface(n)}else if(this.plugins.get("flow").enums&&this.isContextual(126)){t.exportKind="value";let n=this.startNode();return this.next(),this.flowParseEnumDeclaration(n)}else return super.parseExportDeclaration(t)}eatExportStar(t){return super.eatExportStar(t)?!0:this.isContextual(130)&&this.lookahead().type===55?(t.exportKind="type",this.next(),this.next(),!0):!1}maybeParseExportNamespaceSpecifier(t){let{startLoc:n}=this.state,i=super.maybeParseExportNamespaceSpecifier(t);return i&&t.exportKind==="type"&&this.unexpected(n),i}parseClassId(t,n,i){super.parseClassId(t,n,i),this.match(47)&&(t.typeParameters=this.flowParseTypeParameterDeclaration())}parseClassMember(t,n,i){let{startLoc:s}=this.state;if(this.isContextual(125)){if(super.parseClassMemberFromModifier(t,n))return;n.declare=!0}super.parseClassMember(t,n,i),n.declare&&(n.type!=="ClassProperty"&&n.type!=="ClassPrivateProperty"&&n.type!=="PropertyDefinition"?this.raise(Q.DeclareClassElement,s):n.value&&this.raise(Q.DeclareClassFieldInitializer,n.value))}isIterator(t){return t==="iterator"||t==="asyncIterator"}readIterator(){let t=super.readWord1(),n="@@"+t;(!this.isIterator(t)||!this.state.inType)&&this.raise(S.InvalidIdentifier,this.state.curPosition(),{identifierName:n}),this.finishToken(132,n)}getTokenFromCode(t){let n=this.input.charCodeAt(this.state.pos+1);t===123&&n===124?this.finishOp(6,2):this.state.inType&&(t===62||t===60)?this.finishOp(t===62?48:47,1):this.state.inType&&t===63?n===46?this.finishOp(18,2):this.finishOp(17,1):Pv(t,n,this.input.charCodeAt(this.state.pos+2))?(this.state.pos+=2,this.readIterator()):super.getTokenFromCode(t)}isAssignable(t,n){return t.type==="TypeCastExpression"?this.isAssignable(t.expression,n):super.isAssignable(t,n)}toAssignable(t,n=!1){!n&&t.type==="AssignmentExpression"&&t.left.type==="TypeCastExpression"&&(t.left=this.typeCastToParameter(t.left)),super.toAssignable(t,n)}toAssignableList(t,n,i){for(let s=0;s<t.length;s++){let o=t[s];o?.type==="TypeCastExpression"&&(t[s]=this.typeCastToParameter(o))}super.toAssignableList(t,n,i)}toReferencedList(t,n){for(let s=0;s<t.length;s++){var i;let o=t[s];o&&o.type==="TypeCastExpression"&&!((i=o.extra)!=null&&i.parenthesized)&&(t.length>1||!n)&&this.raise(Q.TypeCastInPattern,o.typeAnnotation)}return t}parseArrayLike(t,n,i,s){let o=super.parseArrayLike(t,n,i,s);return n&&!this.state.maybeInArrowParameters&&this.toReferencedList(o.elements),o}isValidLVal(t,n,i){return t==="TypeCastExpression"||super.isValidLVal(t,n,i)}parseClassProperty(t){return this.match(14)&&(t.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassProperty(t)}parseClassPrivateProperty(t){return this.match(14)&&(t.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassPrivateProperty(t)}isClassMethod(){return this.match(47)||super.isClassMethod()}isClassProperty(){return this.match(14)||super.isClassProperty()}isNonstaticConstructor(t){return!this.match(14)&&super.isNonstaticConstructor(t)}pushClassMethod(t,n,i,s,o,a){if(n.variance&&this.unexpected(n.variance.loc.start),delete n.variance,this.match(47)&&(n.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassMethod(t,n,i,s,o,a),n.params&&o){let l=n.params;l.length>0&&this.isThisParam(l[0])&&this.raise(Q.ThisParamBannedInConstructor,n)}else if(n.type==="MethodDefinition"&&o&&n.value.params){let l=n.value.params;l.length>0&&this.isThisParam(l[0])&&this.raise(Q.ThisParamBannedInConstructor,n)}}pushClassPrivateMethod(t,n,i,s){n.variance&&this.unexpected(n.variance.loc.start),delete n.variance,this.match(47)&&(n.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassPrivateMethod(t,n,i,s)}parseClassSuper(t){if(super.parseClassSuper(t),t.superClass&&this.match(47)&&(t.superTypeParameters=this.flowParseTypeParameterInstantiation()),this.isContextual(113)){this.next();let n=t.implements=[];do{let i=this.startNode();i.id=this.flowParseRestrictedIdentifier(!0),this.match(47)?i.typeParameters=this.flowParseTypeParameterInstantiation():i.typeParameters=null,n.push(this.finishNode(i,"ClassImplements"))}while(this.eat(12))}}checkGetterSetterParams(t){super.checkGetterSetterParams(t);let n=this.getObjectOrClassMethodParams(t);if(n.length>0){let i=n[0];this.isThisParam(i)&&t.kind==="get"?this.raise(Q.GetterMayNotHaveThisParam,i):this.isThisParam(i)&&this.raise(Q.SetterMayNotHaveThisParam,i)}}parsePropertyNamePrefixOperator(t){t.variance=this.flowParseVariance()}parseObjPropValue(t,n,i,s,o,a,l){t.variance&&this.unexpected(t.variance.loc.start),delete t.variance;let u;this.match(47)&&!a&&(u=this.flowParseTypeParameterDeclaration(),this.match(10)||this.unexpected());let c=super.parseObjPropValue(t,n,i,s,o,a,l);return u&&((c.value||c).typeParameters=u),c}parseFunctionParamType(t){return this.eat(17)&&(t.type!=="Identifier"&&this.raise(Q.PatternIsOptional,t),this.isThisParam(t)&&this.raise(Q.ThisParamMayNotBeOptional,t),t.optional=!0),this.match(14)?t.typeAnnotation=this.flowParseTypeAnnotation():this.isThisParam(t)&&this.raise(Q.ThisParamAnnotationRequired,t),this.match(29)&&this.isThisParam(t)&&this.raise(Q.ThisParamNoDefault,t),this.resetEndLocation(t),t}parseMaybeDefault(t,n){let i=super.parseMaybeDefault(t,n);return i.type==="AssignmentPattern"&&i.typeAnnotation&&i.right.start<i.typeAnnotation.start&&this.raise(Q.TypeBeforeInitializer,i.typeAnnotation),i}checkImportReflection(t){super.checkImportReflection(t),t.module&&t.importKind!=="value"&&this.raise(Q.ImportReflectionHasImportType,t.specifiers[0].loc.start)}parseImportSpecifierLocal(t,n,i){n.local=Ny(t)?this.flowParseRestrictedIdentifier(!0,!0):this.parseIdentifier(),t.specifiers.push(this.finishImportSpecifier(n,i))}isPotentialImportPhase(t){if(super.isPotentialImportPhase(t))return!0;if(this.isContextual(130)){if(!t)return!0;let n=this.lookaheadCharCode();return n===123||n===42}return!t&&this.isContextual(87)}applyImportPhase(t,n,i,s){if(super.applyImportPhase(t,n,i,s),n){if(!i&&this.match(65))return;t.exportKind=i==="type"?i:"value"}else i==="type"&&this.match(55)&&this.unexpected(),t.importKind=i==="type"||i==="typeof"?i:"value"}parseImportSpecifier(t,n,i,s,o){let a=t.imported,l=null;a.type==="Identifier"&&(a.name==="type"?l="type":a.name==="typeof"&&(l="typeof"));let u=!1;if(this.isContextual(93)&&!this.isLookaheadContextual("as")){let p=this.parseIdentifier(!0);l!==null&&!hr(this.state.type)?(t.imported=p,t.importKind=l,t.local=ln(p)):(t.imported=a,t.importKind=null,t.local=this.parseIdentifier())}else{if(l!==null&&hr(this.state.type))t.imported=this.parseIdentifier(!0),t.importKind=l;else{if(n)throw this.raise(S.ImportBindingIsString,t,{importName:a.value});t.imported=a,t.importKind=null}this.eatContextual(93)?t.local=this.parseIdentifier():(u=!0,t.local=ln(t.imported))}let c=Ny(t);return i&&c&&this.raise(Q.ImportTypeShorthandOnlyInPureImport,t),(i||c)&&this.checkReservedType(t.local.name,t.local.loc.start,!0),u&&!i&&!c&&this.checkReservedWord(t.local.name,t.loc.start,!0,!0),this.finishImportSpecifier(t,"ImportSpecifier")}parseBindingAtom(){switch(this.state.type){case 78:return this.parseIdentifier(!0);default:return super.parseBindingAtom()}}parseFunctionParams(t,n){let i=t.kind;i!=="get"&&i!=="set"&&this.match(47)&&(t.typeParameters=this.flowParseTypeParameterDeclaration()),super.parseFunctionParams(t,n)}parseVarId(t,n){super.parseVarId(t,n),this.match(14)&&(t.id.typeAnnotation=this.flowParseTypeAnnotation(),this.resetEndLocation(t.id))}parseAsyncArrowFromCallExpression(t,n){if(this.match(14)){let i=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0,t.returnType=this.flowParseTypeAnnotation(),this.state.noAnonFunctionType=i}return super.parseAsyncArrowFromCallExpression(t,n)}shouldParseAsyncArrow(){return this.match(14)||super.shouldParseAsyncArrow()}parseMaybeAssign(t,n){var i;let s=null,o;if(this.hasPlugin("jsx")&&(this.match(142)||this.match(47))){if(s=this.state.clone(),o=this.tryParse(()=>super.parseMaybeAssign(t,n),s),!o.error)return o.node;let{context:u}=this.state,c=u[u.length-1];(c===_e.j_oTag||c===_e.j_expr)&&u.pop()}if((i=o)!=null&&i.error||this.match(47)){var a,l;s=s||this.state.clone();let u,c=this.tryParse(d=>{var f;u=this.flowParseTypeParameterDeclaration();let m=this.forwardNoArrowParamsConversionAt(u,()=>{let g=super.parseMaybeAssign(t,n);return this.resetStartLocationFromNode(g,u),g});(f=m.extra)!=null&&f.parenthesized&&d();let h=this.maybeUnwrapTypeCastExpression(m);return h.type!=="ArrowFunctionExpression"&&d(),h.typeParameters=u,this.resetStartLocationFromNode(h,u),m},s),p=null;if(c.node&&this.maybeUnwrapTypeCastExpression(c.node).type==="ArrowFunctionExpression"){if(!c.error&&!c.aborted)return c.node.async&&this.raise(Q.UnexpectedTypeParameterBeforeAsyncArrowFunction,u),c.node;p=c.node}if((a=o)!=null&&a.node)return this.state=o.failState,o.node;if(p)return this.state=c.failState,p;throw(l=o)!=null&&l.thrown?o.error:c.thrown?c.error:this.raise(Q.UnexpectedTokenAfterTypeParameter,u)}return super.parseMaybeAssign(t,n)}parseArrow(t){if(this.match(14)){let n=this.tryParse(()=>{let i=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0;let s=this.startNode();return[s.typeAnnotation,t.predicate]=this.flowParseTypeAndPredicateInitialiser(),this.state.noAnonFunctionType=i,this.canInsertSemicolon()&&this.unexpected(),this.match(19)||this.unexpected(),s});if(n.thrown)return null;n.error&&(this.state=n.failState),t.returnType=n.node.typeAnnotation?this.finishNode(n.node,"TypeAnnotation"):null}return super.parseArrow(t)}shouldParseArrow(t){return this.match(14)||super.shouldParseArrow(t)}setArrowFunctionParameters(t,n){this.state.noArrowParamsConversionAt.includes(t.start)?t.params=n:super.setArrowFunctionParameters(t,n)}checkParams(t,n,i,s=!0){if(!(i&&this.state.noArrowParamsConversionAt.includes(t.start))){for(let o=0;o<t.params.length;o++)this.isThisParam(t.params[o])&&o>0&&this.raise(Q.ThisParamMustBeFirst,t.params[o]);super.checkParams(t,n,i,s)}}parseParenAndDistinguishExpression(t){return super.parseParenAndDistinguishExpression(t&&!this.state.noArrowAt.includes(this.state.start))}parseSubscripts(t,n,i){if(t.type==="Identifier"&&t.name==="async"&&this.state.noArrowAt.includes(n.index)){this.next();let s=this.startNodeAt(n);s.callee=t,s.arguments=super.parseCallExpressionArguments(11,!1),t=this.finishNode(s,"CallExpression")}else if(t.type==="Identifier"&&t.name==="async"&&this.match(47)){let s=this.state.clone(),o=this.tryParse(l=>this.parseAsyncArrowWithTypeParameters(n)||l(),s);if(!o.error&&!o.aborted)return o.node;let a=this.tryParse(()=>super.parseSubscripts(t,n,i),s);if(a.node&&!a.error)return a.node;if(o.node)return this.state=o.failState,o.node;if(a.node)return this.state=a.failState,a.node;throw o.error||a.error}return super.parseSubscripts(t,n,i)}parseSubscript(t,n,i,s){if(this.match(18)&&this.isLookaheadToken_lt()){if(s.optionalChainMember=!0,i)return s.stop=!0,t;this.next();let o=this.startNodeAt(n);return o.callee=t,o.typeArguments=this.flowParseTypeParameterInstantiation(),this.expect(10),o.arguments=this.parseCallExpressionArguments(11,!1),o.optional=!0,this.finishCallExpression(o,!0)}else if(!i&&this.shouldParseTypes()&&this.match(47)){let o=this.startNodeAt(n);o.callee=t;let a=this.tryParse(()=>(o.typeArguments=this.flowParseTypeParameterInstantiationCallOrNew(),this.expect(10),o.arguments=super.parseCallExpressionArguments(11,!1),s.optionalChainMember&&(o.optional=!1),this.finishCallExpression(o,s.optionalChainMember)));if(a.node)return a.error&&(this.state=a.failState),a.node}return super.parseSubscript(t,n,i,s)}parseNewCallee(t){super.parseNewCallee(t);let n=null;this.shouldParseTypes()&&this.match(47)&&(n=this.tryParse(()=>this.flowParseTypeParameterInstantiationCallOrNew()).node),t.typeArguments=n}parseAsyncArrowWithTypeParameters(t){let n=this.startNodeAt(t);if(this.parseFunctionParams(n,!1),!!this.parseArrow(n))return super.parseArrowExpression(n,void 0,!0)}readToken_mult_modulo(t){let n=this.input.charCodeAt(this.state.pos+1);if(t===42&&n===47&&this.state.hasFlowComment){this.state.hasFlowComment=!1,this.state.pos+=2,this.nextToken();return}super.readToken_mult_modulo(t)}readToken_pipe_amp(t){let n=this.input.charCodeAt(this.state.pos+1);if(t===124&&n===125){this.finishOp(9,2);return}super.readToken_pipe_amp(t)}parseTopLevel(t,n){let i=super.parseTopLevel(t,n);return this.state.hasFlowComment&&this.raise(Q.UnterminatedFlowComment,this.state.curPosition()),i}skipBlockComment(){if(this.hasPlugin("flowComments")&&this.skipFlowComment()){if(this.state.hasFlowComment)throw this.raise(Q.NestedFlowComment,this.state.startLoc);this.hasFlowCommentCompletion();let t=this.skipFlowComment();t&&(this.state.pos+=t,this.state.hasFlowComment=!0);return}return super.skipBlockComment(this.state.hasFlowComment?"*-/":"*/")}skipFlowComment(){let{pos:t}=this.state,n=2;for(;[32,9].includes(this.input.charCodeAt(t+n));)n++;let i=this.input.charCodeAt(n+t),s=this.input.charCodeAt(n+t+1);return i===58&&s===58?n+2:this.input.slice(n+t,n+t+12)==="flow-include"?n+12:i===58&&s!==58?n:!1}hasFlowCommentCompletion(){if(this.input.indexOf("*/",this.state.pos)===-1)throw this.raise(S.UnterminatedComment,this.state.curPosition())}flowEnumErrorBooleanMemberNotInitialized(t,{enumName:n,memberName:i}){this.raise(Q.EnumBooleanMemberNotInitialized,t,{memberName:i,enumName:n})}flowEnumErrorInvalidMemberInitializer(t,n){return this.raise(n.explicitType?n.explicitType==="symbol"?Q.EnumInvalidMemberInitializerSymbolType:Q.EnumInvalidMemberInitializerPrimaryType:Q.EnumInvalidMemberInitializerUnknownType,t,n)}flowEnumErrorNumberMemberNotInitialized(t,n){this.raise(Q.EnumNumberMemberNotInitialized,t,n)}flowEnumErrorStringMemberInconsistentlyInitialized(t,n){this.raise(Q.EnumStringMemberInconsistentlyInitialized,t,n)}flowEnumMemberInit(){let t=this.state.startLoc,n=()=>this.match(12)||this.match(8);switch(this.state.type){case 134:{let i=this.parseNumericLiteral(this.state.value);return n()?{type:"number",loc:i.loc.start,value:i}:{type:"invalid",loc:t}}case 133:{let i=this.parseStringLiteral(this.state.value);return n()?{type:"string",loc:i.loc.start,value:i}:{type:"invalid",loc:t}}case 85:case 86:{let i=this.parseBooleanLiteral(this.match(85));return n()?{type:"boolean",loc:i.loc.start,value:i}:{type:"invalid",loc:t}}default:return{type:"invalid",loc:t}}}flowEnumMemberRaw(){let t=this.state.startLoc,n=this.parseIdentifier(!0),i=this.eat(29)?this.flowEnumMemberInit():{type:"none",loc:t};return{id:n,init:i}}flowEnumCheckExplicitTypeMismatch(t,n,i){let{explicitType:s}=n;s!==null&&s!==i&&this.flowEnumErrorInvalidMemberInitializer(t,n)}flowEnumMembers({enumName:t,explicitType:n}){let i=new Set,s={booleanMembers:[],numberMembers:[],stringMembers:[],defaultedMembers:[]},o=!1;for(;!this.match(8);){if(this.eat(21)){o=!0;break}let a=this.startNode(),{id:l,init:u}=this.flowEnumMemberRaw(),c=l.name;if(c==="")continue;/^[a-z]/.test(c)&&this.raise(Q.EnumInvalidMemberName,l,{memberName:c,suggestion:c[0].toUpperCase()+c.slice(1),enumName:t}),i.has(c)&&this.raise(Q.EnumDuplicateMemberName,l,{memberName:c,enumName:t}),i.add(c);let p={enumName:t,explicitType:n,memberName:c};switch(a.id=l,u.type){case"boolean":{this.flowEnumCheckExplicitTypeMismatch(u.loc,p,"boolean"),a.init=u.value,s.booleanMembers.push(this.finishNode(a,"EnumBooleanMember"));break}case"number":{this.flowEnumCheckExplicitTypeMismatch(u.loc,p,"number"),a.init=u.value,s.numberMembers.push(this.finishNode(a,"EnumNumberMember"));break}case"string":{this.flowEnumCheckExplicitTypeMismatch(u.loc,p,"string"),a.init=u.value,s.stringMembers.push(this.finishNode(a,"EnumStringMember"));break}case"invalid":throw this.flowEnumErrorInvalidMemberInitializer(u.loc,p);case"none":switch(n){case"boolean":this.flowEnumErrorBooleanMemberNotInitialized(u.loc,p);break;case"number":this.flowEnumErrorNumberMemberNotInitialized(u.loc,p);break;default:s.defaultedMembers.push(this.finishNode(a,"EnumDefaultedMember"))}}this.match(8)||this.expect(12)}return{members:s,hasUnknownMembers:o}}flowEnumStringMembers(t,n,{enumName:i}){if(t.length===0)return n;if(n.length===0)return t;if(n.length>t.length){for(let s of t)this.flowEnumErrorStringMemberInconsistentlyInitialized(s,{enumName:i});return n}else{for(let s of n)this.flowEnumErrorStringMemberInconsistentlyInitialized(s,{enumName:i});return t}}flowEnumParseExplicitType({enumName:t}){if(!this.eatContextual(102))return null;if(!we(this.state.type))throw this.raise(Q.EnumInvalidExplicitTypeUnknownSupplied,this.state.startLoc,{enumName:t});let{value:n}=this.state;return this.next(),n!=="boolean"&&n!=="number"&&n!=="string"&&n!=="symbol"&&this.raise(Q.EnumInvalidExplicitType,this.state.startLoc,{enumName:t,invalidEnumType:n}),n}flowEnumBody(t,n){let i=n.name,s=n.loc.start,o=this.flowEnumParseExplicitType({enumName:i});this.expect(5);let{members:a,hasUnknownMembers:l}=this.flowEnumMembers({enumName:i,explicitType:o});switch(t.hasUnknownMembers=l,o){case"boolean":return t.explicitType=!0,t.members=a.booleanMembers,this.expect(8),this.finishNode(t,"EnumBooleanBody");case"number":return t.explicitType=!0,t.members=a.numberMembers,this.expect(8),this.finishNode(t,"EnumNumberBody");case"string":return t.explicitType=!0,t.members=this.flowEnumStringMembers(a.stringMembers,a.defaultedMembers,{enumName:i}),this.expect(8),this.finishNode(t,"EnumStringBody");case"symbol":return t.members=a.defaultedMembers,this.expect(8),this.finishNode(t,"EnumSymbolBody");default:{let u=()=>(t.members=[],this.expect(8),this.finishNode(t,"EnumStringBody"));t.explicitType=!1;let c=a.booleanMembers.length,p=a.numberMembers.length,d=a.stringMembers.length,f=a.defaultedMembers.length;if(!c&&!p&&!d&&!f)return u();if(!c&&!p)return t.members=this.flowEnumStringMembers(a.stringMembers,a.defaultedMembers,{enumName:i}),this.expect(8),this.finishNode(t,"EnumStringBody");if(!p&&!d&&c>=f){for(let m of a.defaultedMembers)this.flowEnumErrorBooleanMemberNotInitialized(m.loc.start,{enumName:i,memberName:m.id.name});return t.members=a.booleanMembers,this.expect(8),this.finishNode(t,"EnumBooleanBody")}else if(!c&&!d&&p>=f){for(let m of a.defaultedMembers)this.flowEnumErrorNumberMemberNotInitialized(m.loc.start,{enumName:i,memberName:m.id.name});return t.members=a.numberMembers,this.expect(8),this.finishNode(t,"EnumNumberBody")}else return this.raise(Q.EnumInconsistentMemberValues,s,{enumName:i}),u()}}}flowParseEnumDeclaration(t){let n=this.parseIdentifier();return t.id=n,t.body=this.flowEnumBody(this.startNode(),n),this.finishNode(t,"EnumDeclaration")}isLookaheadToken_lt(){let t=this.nextTokenStart();if(this.input.charCodeAt(t)===60){let n=this.input.charCodeAt(t+1);return n!==60&&n!==61}return!1}maybeUnwrapTypeCastExpression(t){return t.type==="TypeCastExpression"?t.expression:t}},Jv={__proto__:null,quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:"\xA0",iexcl:"\xA1",cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",brvbar:"\xA6",sect:"\xA7",uml:"\xA8",copy:"\xA9",ordf:"\xAA",laquo:"\xAB",not:"\xAC",shy:"\xAD",reg:"\xAE",macr:"\xAF",deg:"\xB0",plusmn:"\xB1",sup2:"\xB2",sup3:"\xB3",acute:"\xB4",micro:"\xB5",para:"\xB6",middot:"\xB7",cedil:"\xB8",sup1:"\xB9",ordm:"\xBA",raquo:"\xBB",frac14:"\xBC",frac12:"\xBD",frac34:"\xBE",iquest:"\xBF",Agrave:"\xC0",Aacute:"\xC1",Acirc:"\xC2",Atilde:"\xC3",Auml:"\xC4",Aring:"\xC5",AElig:"\xC6",Ccedil:"\xC7",Egrave:"\xC8",Eacute:"\xC9",Ecirc:"\xCA",Euml:"\xCB",Igrave:"\xCC",Iacute:"\xCD",Icirc:"\xCE",Iuml:"\xCF",ETH:"\xD0",Ntilde:"\xD1",Ograve:"\xD2",Oacute:"\xD3",Ocirc:"\xD4",Otilde:"\xD5",Ouml:"\xD6",times:"\xD7",Oslash:"\xD8",Ugrave:"\xD9",Uacute:"\xDA",Ucirc:"\xDB",Uuml:"\xDC",Yacute:"\xDD",THORN:"\xDE",szlig:"\xDF",agrave:"\xE0",aacute:"\xE1",acirc:"\xE2",atilde:"\xE3",auml:"\xE4",aring:"\xE5",aelig:"\xE6",ccedil:"\xE7",egrave:"\xE8",eacute:"\xE9",ecirc:"\xEA",euml:"\xEB",igrave:"\xEC",iacute:"\xED",icirc:"\xEE",iuml:"\xEF",eth:"\xF0",ntilde:"\xF1",ograve:"\xF2",oacute:"\xF3",ocirc:"\xF4",otilde:"\xF5",ouml:"\xF6",divide:"\xF7",oslash:"\xF8",ugrave:"\xF9",uacute:"\xFA",ucirc:"\xFB",uuml:"\xFC",yacute:"\xFD",thorn:"\xFE",yuml:"\xFF",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",fnof:"\u0192",circ:"\u02C6",tilde:"\u02DC",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039A",Lambda:"\u039B",Mu:"\u039C",Nu:"\u039D",Xi:"\u039E",Omicron:"\u039F",Pi:"\u03A0",Rho:"\u03A1",Sigma:"\u03A3",Tau:"\u03A4",Upsilon:"\u03A5",Phi:"\u03A6",Chi:"\u03A7",Psi:"\u03A8",Omega:"\u03A9",alpha:"\u03B1",beta:"\u03B2",gamma:"\u03B3",delta:"\u03B4",epsilon:"\u03B5",zeta:"\u03B6",eta:"\u03B7",theta:"\u03B8",iota:"\u03B9",kappa:"\u03BA",lambda:"\u03BB",mu:"\u03BC",nu:"\u03BD",xi:"\u03BE",omicron:"\u03BF",pi:"\u03C0",rho:"\u03C1",sigmaf:"\u03C2",sigma:"\u03C3",tau:"\u03C4",upsilon:"\u03C5",phi:"\u03C6",chi:"\u03C7",psi:"\u03C8",omega:"\u03C9",thetasym:"\u03D1",upsih:"\u03D2",piv:"\u03D6",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200C",zwj:"\u200D",lrm:"\u200E",rlm:"\u200F",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201A",ldquo:"\u201C",rdquo:"\u201D",bdquo:"\u201E",dagger:"\u2020",Dagger:"\u2021",bull:"\u2022",hellip:"\u2026",permil:"\u2030",prime:"\u2032",Prime:"\u2033",lsaquo:"\u2039",rsaquo:"\u203A",oline:"\u203E",frasl:"\u2044",euro:"\u20AC",image:"\u2111",weierp:"\u2118",real:"\u211C",trade:"\u2122",alefsym:"\u2135",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21B5",lArr:"\u21D0",uArr:"\u21D1",rArr:"\u21D2",dArr:"\u21D3",hArr:"\u21D4",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220B",prod:"\u220F",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221A",prop:"\u221D",infin:"\u221E",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222A",int:"\u222B",there4:"\u2234",sim:"\u223C",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22A5",sdot:"\u22C5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230A",rfloor:"\u230B",lang:"\u2329",rang:"\u232A",loz:"\u25CA",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666"},ei=an`jsx`({AttributeIsEmpty:"JSX attributes must only be assigned a non-empty expression.",MissingClosingTagElement:({openingTagName:e})=>`Expected corresponding JSX closing tag for <${e}>.`,MissingClosingTagFragment:"Expected corresponding JSX closing tag for <>.",UnexpectedSequenceExpression:"Sequence expressions cannot be directly nested inside JSX. Did you mean to wrap it in parentheses (...)?",UnexpectedToken:({unexpected:e,HTMLEntity:r})=>`Unexpected token \`${e}\`. Did you mean \`${r}\` or \`{'${e}'}\`?`,UnsupportedJsxValue:"JSX value should be either an expression or a quoted JSX text.",UnterminatedJsxContent:"Unterminated JSX contents.",UnwrappedAdjacentJSXElements:"Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?"});function Pn(e){return e?e.type==="JSXOpeningFragment"||e.type==="JSXClosingFragment":!1}function Mi(e){if(e.type==="JSXIdentifier")return e.name;if(e.type==="JSXNamespacedName")return e.namespace.name+":"+e.name.name;if(e.type==="JSXMemberExpression")return Mi(e.object)+"."+Mi(e.property);throw new Error("Node had unexpected type: "+e.type)}var Yv=e=>class extends e{jsxReadToken(){let t="",n=this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(ei.UnterminatedJsxContent,this.state.startLoc);let i=this.input.charCodeAt(this.state.pos);switch(i){case 60:case 123:if(this.state.pos===this.state.start){i===60&&this.state.canStartJSXElement?(++this.state.pos,this.finishToken(142)):super.getTokenFromCode(i);return}t+=this.input.slice(n,this.state.pos),this.finishToken(141,t);return;case 38:t+=this.input.slice(n,this.state.pos),t+=this.jsxReadEntity(),n=this.state.pos;break;case 62:case 125:default:Ui(i)?(t+=this.input.slice(n,this.state.pos),t+=this.jsxReadNewLine(!0),n=this.state.pos):++this.state.pos}}}jsxReadNewLine(t){let n=this.input.charCodeAt(this.state.pos),i;return++this.state.pos,n===13&&this.input.charCodeAt(this.state.pos)===10?(++this.state.pos,i=t?`
|
|
20
20
|
`:`\r
|
|
@@ -27,7 +27,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`),I=F,v=M),X===void 0&&(
|
|
|
27
27
|
`).map(n=>bC(n,r,t)).join(`
|
|
28
28
|
`)}var xC=Object.defineProperty,EC=(e,r,t)=>r in e?xC(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,Qt=(e,r,t)=>(EC(e,typeof r!="symbol"?r+"":r,t),t);function CC(e,r){if(e===r)return;let t=e.split(`
|
|
29
29
|
`),n=r.split(`
|
|
30
|
-
`),i=[];for(let s=0;s<Math.max(t.length,n.length);s++)t[s]!==n[s]&&i.push(s);return i}var Kd=Symbol("clack:cancel");function
|
|
30
|
+
`),i=[];for(let s=0;s<Math.max(t.length,n.length);s++)t[s]!==n[s]&&i.push(s);return i}var Kd=Symbol("clack:cancel");function Me(e){return e===Kd}function Io(e,r){e.isTTY&&e.setRawMode(r)}var kd=new Map([["k","up"],["j","down"],["h","left"],["l","right"]]),SC=new Set(["up","down","left","right","space","enter"]),di=class{constructor({render:r,input:t=fi.stdin,output:n=fi.stdout,...i},s=!0){Qt(this,"input"),Qt(this,"output"),Qt(this,"rl"),Qt(this,"opts"),Qt(this,"_track",!1),Qt(this,"_render"),Qt(this,"_cursor",0),Qt(this,"state","initial"),Qt(this,"value"),Qt(this,"error",""),Qt(this,"subscribers",new Map),Qt(this,"_prevFrame",""),this.opts=i,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=r.bind(this),this._track=s,this.input=t,this.output=n}prompt(){let r=new Ld.WriteStream(0);return r._write=(t,n,i)=>{this._track&&(this.value=this.rl.line.replace(/\t/g,""),this._cursor=this.rl.cursor,this.emit("value",this.value)),i()},this.input.pipe(r),this.rl=$l.default.createInterface({input:this.input,output:r,tabSize:2,prompt:"",escapeCodeTimeout:50}),$l.default.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),Io(this.input,!0),this.output.on("resize",this.render),this.render(),new Promise((t,n)=>{this.once("submit",()=>{this.output.write(St.cursor.show),this.output.off("resize",this.render),Io(this.input,!1),t(this.value)}),this.once("cancel",()=>{this.output.write(St.cursor.show),this.output.off("resize",this.render),Io(this.input,!1),t(Kd)})})}on(r,t){let n=this.subscribers.get(r)??[];n.push({cb:t}),this.subscribers.set(r,n)}once(r,t){let n=this.subscribers.get(r)??[];n.push({cb:t,once:!0}),this.subscribers.set(r,n)}emit(r,...t){let n=this.subscribers.get(r)??[],i=[];for(let s of n)s.cb(...t),s.once&&i.push(()=>n.splice(n.indexOf(s),1));for(let s of i)s()}unsubscribe(){this.subscribers.clear()}onKeypress(r,t){if(this.state==="error"&&(this.state="active"),t?.name&&!this._track&&kd.has(t.name)&&this.emit("cursor",kd.get(t.name)),t?.name&&SC.has(t.name)&&this.emit("cursor",t.name),r&&(r.toLowerCase()==="y"||r.toLowerCase()==="n")&&this.emit("confirm",r.toLowerCase()==="y"),r===" "&&this.opts.placeholder&&(this.value||(this.rl.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),r&&this.emit("key",r.toLowerCase()),t?.name==="return"){if(this.opts.validate){let n=this.opts.validate(this.value);n&&(this.error=n,this.state="error",this.rl.write(this.value))}this.state!=="error"&&(this.state="submit")}r===""&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
|
|
31
31
|
`),Io(this.input,!1),this.rl.close(),this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let r=_d(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
|
|
32
32
|
`).length-1;this.output.write(St.cursor.move(-999,r*-1))}render(){let r=_d(this._render(this)??"",process.stdout.columns,{hard:!0});if(r!==this._prevFrame){if(this.state==="initial")this.output.write(St.cursor.hide);else{let t=CC(this._prevFrame,r);if(this.restoreCursor(),t&&t?.length===1){let n=t[0];this.output.write(St.cursor.move(0,n)),this.output.write(St.erase.lines(1));let i=r.split(`
|
|
33
33
|
`);this.output.write(i[n]),this._prevFrame=r,this.output.write(St.cursor.move(0,i.length-n-1));return}else if(t&&t?.length>1){let n=t[0];this.output.write(St.cursor.move(0,n)),this.output.write(St.erase.down());let i=r.split(`
|
|
@@ -63,7 +63,7 @@ ${k.default.yellow(Pe)} `)+`
|
|
|
63
63
|
`}default:return`${t}${k.default.cyan(Pe)} ${ql({options:this.options,cursor:this.cursor,maxItems:e.maxItems,style:n}).join(`
|
|
64
64
|
${k.default.cyan(Pe)} `)}
|
|
65
65
|
${k.default.cyan(yn)}
|
|
66
|
-
`}}}).prompt()};var
|
|
66
|
+
`}}}).prompt()};var he=(e="")=>{process.stdout.write(`${k.default.gray(yn)} ${k.default.red(e)}
|
|
67
67
|
|
|
68
68
|
`)},ot=(e="")=>{process.stdout.write(`${k.default.gray(OC)} ${e}
|
|
69
69
|
`)},ut=(e="")=>{process.stdout.write(`${k.default.gray(Pe)}
|
|
@@ -76,7 +76,7 @@ ${k.default.gray(yn)} ${e}
|
|
|
76
76
|
`);let m=0,h=0;u(),n=setInterval(()=>{let g=k.default.magenta(e[m]),y=".".repeat(Math.floor(h)).slice(0,3);process.stdout.write(mi.cursor.move(-999,0)),process.stdout.write(mi.erase.down(1)),process.stdout.write(`${g} ${s}${y}`),m=m+1<e.length?m+1:0,h=h<e.length?h+.125:0},r)},d=(f="",m=0)=>{s=f??s,i=!1,clearInterval(n);let h=m===0?k.default.green(Wl):m===1?k.default.red(Gd):k.default.red(Hd);process.stdout.write(mi.cursor.move(-999,0)),process.stdout.write(mi.erase.down(1)),process.stdout.write(`${h} ${s}
|
|
77
77
|
`),c(),t()};return{start:p,stop:d,message:(f="")=>{s=f??s}}};var Ln=V(Ze(),1),fn=V(require("@sentry/node"),1);var Xe=V(require("typescript"),1);var fd=V(require("@sentry/node"),1);var ge=V(Ze(),1);function Ee(e,r=""){return e.ts.createSourceFile("module.tsx",typeof r=="string"?r:"",e.ts.ScriptTarget.Latest,void 0)}function Ro(e,r=""){let t=Ee(e,r?.trim());if(t.statements.length===0)throw new Error(`No statements found in code: ${r}`);return t.statements[0]}function ct(e,r,t){if(r){let n=e.ts.createPrinter({newLine:e.ts.NewLineKind.LineFeed,removeComments:t});return e.ts.isSourceFile(r)?n.printFile(r).trim()+`
|
|
78
78
|
`:n.printNode(e.ts.EmitHint.Unspecified,r,e.ts.createSourceFile("module.tsx","",e.ts.ScriptTarget.Latest)).trim()+`
|
|
79
|
-
`}return""}var Zd=V(Gl(),1);function pt(e){return e.endsWith(".mapper.tsx")||e.endsWith(".mapper.jsx")||e.endsWith(".mapper.ts")||e.endsWith(".mapper.js")||e.endsWith(".mapper.mjs")}function Se(e,r,t){r=ar(r),t=ar(t),r=e.dirname(r);let n=e.basename(t,e.extname(t));t=e.dirname(t);let i;return n==="index"?i=e.relative(r,t):i=e.relative(r,e.join(t,n)),i=ar(e.normalize(i)),i.startsWith(".")||(i="./"+i),i}function ar(e){return e.startsWith("\\\\?\\")?e:e.replace(/\\/g,"/")}function Un(e,r){let t=e.extname(r),n=e.basename(r,t).split(/[\/\\]/),i=n[n.length-1];return Qd(i==="index"?e.basename(e.dirname(r)):i)}function Qd(e){return $e(e).replace(/ /g,"")}function er(e,r){let t=e.extname(r),n=ar(e.basename(r,t)).split("/").pop();return $e(n==="index"?e.basename(e.dirname(r)):n)}function
|
|
79
|
+
`}return""}var Zd=V(Gl(),1);function pt(e){return e.endsWith(".mapper.tsx")||e.endsWith(".mapper.jsx")||e.endsWith(".mapper.ts")||e.endsWith(".mapper.js")||e.endsWith(".mapper.mjs")}function Se(e,r,t){r=ar(r),t=ar(t),r=e.dirname(r);let n=e.basename(t,e.extname(t));t=e.dirname(t);let i;return n==="index"?i=e.relative(r,t):i=e.relative(r,e.join(t,n)),i=ar(e.normalize(i)),i.startsWith(".")||(i="./"+i),i}function ar(e){return e.startsWith("\\\\?\\")?e:e.replace(/\\/g,"/")}function Un(e,r){let t=e.extname(r),n=e.basename(r,t).split(/[\/\\]/),i=n[n.length-1];return Qd(i==="index"?e.basename(e.dirname(r)):i)}function Qd(e){return $e(e).replace(/ /g,"")}function er(e,r){let t=e.extname(r),n=ar(e.basename(r,t)).split("/").pop();return $e(n==="index"?e.basename(e.dirname(r)):n)}function Re(e,r){let t=ar(e.relative(e.getAppRootDir(),r));t=t.split("/").filter(i=>i!=="."&&i!==".."&&i!=="").join("/"),t.endsWith(".tsx")||t.endsWith(".jsx")?t=t.slice(0,-4):(t.endsWith(".ts")||t.endsWith(".js"))&&(t=t.slice(0,-3));let n=e.getFrameworks();return t.startsWith("src/")&&(t=t.slice(4)),n.some(i=>i.name.includes("next"))?"@/"+t:"~/"+t}function Ie(e,r){let t=r,n=[];for(let i=0;i<2;i++){let s=e.basename(t);if(!s||s==="components")break;n.unshift(s),t=e.dirname(t)}return n.join("/")}function $e(e){for(e=e.replace(/([A-Z])/g," $1").replace(/\./g," ").replace(/_/g," ").replace(/-/g," ").replace(/\s/g," ").trim();e.includes(" ");)e=e.replace(/ /g," ");return e.split(" ").map(r=>r.length>2?r[0].toUpperCase()+r.slice(1):r).join("").trim()}function $t(e){return e.sort((r,t)=>r.name.toLocaleLowerCase().localeCompare(t.name.toLocaleLowerCase()))}async function Le(e,r,t,n){if(typeof t!="string"||t==="")throw new Error(`getComponentId(), exportName must be a non-empty string, received: ${t}, ${r}`);return n&&(r=n),r=e.normalize(r),(await e.hash(r+"#"+t)).substring(0,8)}async function ef(e){return(await e.hash(e.getAppRootDir())).substring(0,8)}function ms(e){return typeof e=="number"}function gi(e){return typeof e=="boolean"}function It(e){return typeof e=="string"}function yi(e){return typeof e=="string"?/^[A-Z][A-Za-z0-9]*$/.test(e):!1}function zt(e){return JSON.parse(JSON.stringify(e))}function Lo(e,r,t){for(let n of r)if(e.dirname(t).includes(n))return!0;return!1}function tf(){try{let e=(0,Zd.default)();if(e?.name)return e.name}catch{}return"npm"}function qt(e){let r=e.join(e.getAppRootDir(),"tsconfig.json");return e.exists(r)}var KC=["node_modules","dist","build","public"];async function tr(e,r){async function t(i,s){if(s>10)return;let o=await e.readdir(i);for(let a of o){if(KC.includes(a))continue;let l=e.join(i,a),u=await e.stat(l);if(u){if(u.isFile()&&a.startsWith("builder-registry."))return l;if(u.isDirectory()){let c=await t(l,s+1);if(c)return c}}}}let n=await t(e.getAppRootDir(),0);if(!n){let s=`builder-registry.${await qt(e)?"ts":"js"}`;return e.join(r,s)}return n}async function Wr(e,r){let t=e.resolve("/");for(let n=0;n<20;n++){let i=e.join(r,"package.json"),s=await e.readFile(i);if(s)return JSON.parse(s);if(r===t)break;r=e.dirname(r)}return null}async function rf(e,r){for(let t=0;t<20;t++){let n=e.dirname(r),i=e.join(n,"node_modules");if(await e.exists(i))return i;if(r===e.getAppRootDir())break;r=e.dirname(r)}return e.join(e.getAppRootDir(),"node_modules")}async function hs(e,r,t){let n=await e.readdir(r);return n.includes(t)?e.join(r,t):(await Promise.all(n.map(async s=>{if(s.startsWith(".")||s==="node_modules")return;let o=e.join(r,s);if((await e.stat(o)).isDirectory()){let l=await hs(e,o,t);if(l)return l}}))).find(s=>typeof s=="string")}async function at(e,r,t){if(!Array.isArray(r)||r.length===0)throw new Error(`createTsProgram() Invalid filePaths: ${r}`);let n=await rf(e,r[0]),i=e.join(n,"typescript","lib"),s=new Map,o={fileExists:a=>{if(a=e.normalize(a),a.includes("node_modules")){let l=gs.get(a);if(!l){try{e.statSync(a).isFile()?l={exists:!0,content:e.readFileSync(a)}:l={exists:!1}}catch{l={exists:!1}}gs.set(a,l)}return l.exists}return s.has(a)||s.set(a,e.existsSync(a)),s.get(a)},getCanonicalFileName:a=>e.normalize(a),getCurrentDirectory:()=>e.cwd(),getDefaultLibFileName:()=>e.join(i,"lib.d.ts"),getDefaultLibLocation:()=>i,getNewLine:()=>`
|
|
80
80
|
`,getSourceFile:a=>{if(a=e.normalize(a),a.includes("node_modules")){let u=gs.get(a);if(u)return Ee(e,u.content)}let l=e.readFileSync(a);if(l==null){let u=e.basename(a),c=e.extname(u).toLowerCase();if(a.startsWith(i)&&c===".ts"&&(l=sf.get(u),l==null&&typeof self<"u"&&typeof fetch=="function"))throw new Mo(u)}return a.includes("node_modules")&&(l?gs.set(a,{exists:!0,content:l}):gs.set(a,{exists:!1})),Ee(e,l)},readFile:a=>{let l=e.readFileSync(a);return typeof l=="string"?l:void 0},useCaseSensitiveFileNames:()=>!1,writeFile:()=>{}};for(;;)try{return VC(e,o,r,t)}catch(a){if(a instanceof Mo){await zC(e,a.libName);continue}throw console.error("createTsProgram",a),new Error(`createTsProgram() Could not create program for: ${r[0]}`)}}function VC(e,r,t,n){let i={rootNames:[...t],options:{},host:r},s=e.ts.findConfigFile(e.dirname(t[0]),o=>e.existsSync(o));if(s){let o=nf.get(s);if(!o){let a=e.ts.readConfigFile(s,l=>{let u=e.readFileSync(l);return typeof u=="string"?u:void 0});a.error?console.error("error reading tsconfig for createTsProgram"):(o=e.ts.parseJsonConfigFileContent(a.config,e.ts.sys||{useCaseSensitiveFileNames:!1,readDirectory:(u,c)=>e.readdirSync(u),fileExists:u=>e.existsSync(u),readFile:u=>e.readFileSync(u)||void 0},e.dirname(s),void 0,s).options,nf.set(s,o))}o&&(i.options=zt(o))}return i.options.noEmit=!0,i.options.isolatedModules=!1,i.options.strict=!1,i.options.jsx=e.ts.JsxEmit.Preserve,i.options.allowJs=!0,Object.assign(i.options,n),e.ts.createProgram(i)}async function Di(e,r,t){t||(t=await at(e,[r]));let n=t.getSourceFile(r);if(!n)throw new Error(`getTypeChecker() Could not find source file: ${r}`);return{typeChecker:t.getTypeChecker(),sourceFile:n}}var Mo=class{constructor(r){this.libName=r}};async function zC(e,r){let t=`https://cdn.jsdelivr.net/npm/typescript@${e.ts.version}/lib/${r}`;Bo.has(r)||Bo.set(r,fetch(t).then(n=>n.text()).then(n=>{sf.set(r,n)})),await Bo.get(r),Bo.delete(r)}var sf=new Map,Bo=new Map,gs=new Map,nf=new Map;async function of(e,r){let t=await e.readFile(r.filePath);return t==null?{diagnostics:[{messageText:`Error reading: ${r.filePath}`}],code:null,output:null}:Hl(e,{code:t,filePath:r.filePath,compilerOptions:r.compilerOptions})}function Hl(e,r){let t={diagnostics:[],code:r.code,output:null};try{let n=e.ts.transpileModule(r.code,{compilerOptions:r.compilerOptions,fileName:r.filePath??"module.tsx",reportDiagnostics:!0});n.diagnostics?.forEach(i=>{t.diagnostics.push({messageText:String(i.messageText)})}),t.output=n.outputText}catch(n){console.error("transpileModule",n),t.diagnostics.push({messageText:String(n)})}return t}async function jn(e){let r=[],t=await Wr(e,e.getRepoRootDir());if(t){let n=await lf(t,e);r.push(...n)}return r}async function lf(e,r){let t=[];if(e&&typeof e=="object"){let n=new Set(Object.keys({...e.dependencies,...e.devDependencies}));for(let i of qC)if(n.has(i)&&!t.some(s=>s.name===i)){let s={name:i};af.has(i)&&(s.version=await af.get(i)(r)),t.push(s)}}return t}function Jl(e){let r=parseInt(e);return Number.isNaN(r)?void 0:r}var af=new Map([["next",async e=>{if(!e.spawnSync)return;let r=tf(),t=r==="npm"?"npx":r,{stdout:n}=e.spawnSync(t,["next","-v"],{encoding:"utf8"});if(!n)return;let i=n.match(/(Next.js v)([\d.]+)/g);if(!i)return;let s=i[0].split("Next.js v")[1],[o,a,l]=s.split(".");return{major:Jl(o),minor:Jl(a),patch:Jl(l)}}]]),qC=["@shopify/remix-oxygen","@shopify/hydrogen","@builder.io/qwik-city","@remix-run/react","@sveltejs/kit","astro","gatsby","next","nuxt","@builder.io/qwik","@angular/core","react","solid-js","svelte","vue"];async function Er(e){let r=uf(e),t=await e.readFile(r);return typeof t=="string"?JSON.parse(t):{}}async function Cr(e,r){r=typeof r=="object"&&r!=null?r:{};let t=uf(e);await e.writeFile(t,JSON.stringify(r??{},null,2))}function uf(e){let r=e.getAppRootDir();return e.join(r,"node_modules",".builder","builder-cache.json")}async function Dn(e,r,t){let n={envKey:t,envValue:null,file:""};for(let i of r){let s=e.join(e.getAppRootDir(),i),o=await WC(e,s);if(o){let a=o[t];if(typeof a=="string"&&a.length>0&&a!=="YOUR_API_KEY")return n.envValue=a,n.file=s,n}}return n.file=e.join(e.getAppRootDir(),r[r.length-1]),n}async function WC(e,r){let t=await e.readFile(r);return typeof t=="string"?cf(t):null}function cf(e){let r={},t=e.replace(/\r\n?/gm,`
|
|
81
81
|
`),n;for(;(n=GC.exec(t))!=null;){let i=n[1],s=n[2]||"";s=s.trim();let o=s[0];s=s.replace(/^(['"`])([\s\S]*)\1$/gm,"$2"),o==='"'&&(s=s.replace(/\\n/g,`
|
|
82
82
|
`),s=s.replace(/\\r/g,"\r")),r[i]=s}return r}var GC=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm;async function bn(e,r,t,n){let i="# https://www.builder.io/c/docs/using-your-api-key",s=await e.readFile(r);if(s)if(s.includes(t))if(s.includes(n))e.debug(`"${t}" with "${n}" already set in ${r}`);else return e.debug(`Replace "${t}" in ${r}`),s=s.replace(new RegExp(`${t}=.*`),`${t}=${n}`),await e.writeFile(r,s),"update";else return e.debug(`Append "${t}" to ${r}`),s+=`
|
|
@@ -95,7 +95,7 @@ ${t}=${n}
|
|
|
95
95
|
`}t+=` {
|
|
96
96
|
name: "${r.name}",
|
|
97
97
|
}
|
|
98
|
-
`,t+=");";let n=Ro(e,t);return eu(e,n,r)}function eu(e,r,t){if(!e.ts.isExpressionStatement(r))return r;let n=r.expression;if(!e.ts.isCallExpression(n))return r;let i=[...n.arguments];if(i.length<2)return r;t.acceptsChildren?e.ts.isCallExpression(i[0])&&e.ts.isIdentifier(i[0].expression)&&i[0].expression.text==="withChildren"||(i[0]=e.ts.factory.createCallExpression(e.ts.factory.createIdentifier("withChildren"),void 0,[i[0]])):e.ts.isCallExpression(i[0])&&e.ts.isIdentifier(i[0].expression)&&i[0].expression.text==="withChildren"&&(i[0]=i[0].arguments[0]);let s=i[1];return e.ts.isObjectLiteralExpression(s)?(i[1]=lt(e,s,t),e.ts.factory.updateExpressionStatement(r,e.ts.factory.updateCallExpression(n,n.expression,n.typeArguments,i))):r}function Ce(e,r,t,n="esm"){return Array.isArray(t.namedImports)&&t.namedImports.forEach(i=>{r=x0(e,r,i,t.importPath,!!t.isTypeOnly,n)}),typeof t.defaultImport=="string"&&(r=E0(e,r,t.defaultImport,t.importPath,n)),r}function x0(e,r,t,n,i,s){return s==="cjs"?bf(e,r,null,t,n):Df(e,r,null,t,n,i)}function E0(e,r,t,n,i){return i==="cjs"?bf(e,r,t,null,n):Df(e,r,t,null,n,!1)}function Df(e,r,t,n,i,s){let o=[...r.statements],a=0,l=!1,u=!1;for(let f=0;f<o.length;f++){let m=o[f];if(!e.ts.isImportDeclaration(m)||(a=f,!m.moduleSpecifier||!e.ts.isStringLiteral(m.moduleSpecifier))||m.moduleSpecifier.text!==i||!!m.importClause?.isTypeOnly!==s)continue;let h=[],g=m.importClause?.namedBindings;if(g&&e.ts.isNamedImports(g)&&g.elements&&h.push(...g.elements),typeof n=="string"){if(h.some(D=>D.name.text===n))return r;h.push(e.ts.factory.createImportSpecifier(!1,void 0,e.ts.factory.createIdentifier(n))),h.sort((D,C)=>D.name.text.localeCompare(C.name.text)),l=!0}let y=m.importClause?m.importClause.name:void 0;if(typeof t=="string"){if(y&&y.text===t)return r;y=e.ts.factory.createIdentifier(t),u=!0}if(l||u)return o[f]=e.ts.factory.updateImportDeclaration(m,void 0,e.ts.factory.createImportClause(s,y,e.ts.factory.createNamedImports(h)),m.moduleSpecifier,void 0),e.ts.factory.updateSourceFile(r,o)}let c,p;typeof t=="string"&&(c=e.ts.factory.createIdentifier(t)),typeof n=="string"&&(p=e.ts.factory.createNamedImports([e.ts.factory.createImportSpecifier(!1,void 0,e.ts.factory.createIdentifier(n))]));let d=e.ts.factory.createImportDeclaration(void 0,e.ts.factory.createImportClause(s,c,p),e.ts.factory.createStringLiteral(i));return o.splice(a,0,d),e.ts.factory.updateSourceFile(r,o)}function bf(e,r,t,n,i){let s=[...r.statements],o=0;for(let a=0;a<s.length;a++){let l=s[a];if(e.ts.isVariableStatement(l))for(let u=0;u<l.declarationList.declarations.length;u++){let c=[...l.declarationList.declarations],p=c[u],d=p.initializer;if(!d||!e.ts.isCallExpression(d))continue;let f=d.expression;if(!e.ts.isIdentifier(f)||f.text!=="require"||d.arguments.length!==1)continue;let m=d.arguments[0];if(e.ts.isStringLiteral(m)&&(o=a,m.text===i)){if(e.ts.isIdentifier(p.name)&&typeof t=="string")return p.name.text===t?r:(c[u]=e.ts.factory.updateVariableDeclaration(p,e.ts.factory.createIdentifier(t),p.exclamationToken,p.type,p.initializer),s[a]=e.ts.factory.updateVariableStatement(l,l.modifiers,e.ts.factory.updateVariableDeclarationList(l.declarationList,c)),e.ts.factory.updateSourceFile(r,s));if(e.ts.isObjectBindingPattern(p.name)&&typeof n=="string"){let h=[...p.name.elements];return h.some(y=>!e.ts.isBindingElement(y)||!e.ts.isIdentifier(y.name)?!1:y.name.text===n)?r:(h.push(e.ts.factory.createBindingElement(void 0,void 0,n)),h.sort((y,D)=>!e.ts.isBindingElement(y)||!e.ts.isIdentifier(y.name)||!e.ts.isBindingElement(D)||!e.ts.isIdentifier(D.name)?0:y.name.text.localeCompare(D.name.text)),c[u]=e.ts.factory.updateVariableDeclaration(p,e.ts.factory.createObjectBindingPattern(h),p.exclamationToken,p.type,p.initializer),s[a]=e.ts.factory.updateVariableStatement(l,l.modifiers,e.ts.factory.updateVariableDeclarationList(l.declarationList,c)),e.ts.factory.updateSourceFile(r,s))}}}}if(typeof t=="string"){let a=e.ts.factory.createVariableStatement(void 0,e.ts.factory.createVariableDeclarationList([e.ts.factory.createVariableDeclaration(t,void 0,void 0,e.ts.factory.createCallExpression(e.ts.factory.createIdentifier("require"),void 0,[e.ts.factory.createStringLiteral(i)]))],e.ts.NodeFlags.Const));return s.splice(o,0,a),e.ts.factory.updateSourceFile(r,s)}if(typeof n=="string"){let a=e.ts.factory.createVariableStatement(void 0,e.ts.factory.createVariableDeclarationList([e.ts.factory.createVariableDeclaration(e.ts.factory.createObjectBindingPattern([e.ts.factory.createBindingElement(void 0,void 0,n)]),void 0,void 0,e.ts.factory.createCallExpression(e.ts.factory.createIdentifier("require"),void 0,[e.ts.factory.createStringLiteral(i)]))],e.ts.NodeFlags.Const));return s.splice(o,0,a),e.ts.factory.updateSourceFile(r,s)}return r}function Vn(e,r,t="esm"){return t==="cjs"?S0(e,r):C0(e,r)}function C0(e,r){let t=[];for(let n of r.statements){if(e.ts.isExportDeclaration(n)){if(n.exportClause&&e.ts.isNamedExports(n.exportClause)){for(let i of n.exportClause.elements)if(n.moduleSpecifier&&t.push({isDefaultExport:!1,statement:n,node:i}),e.ts.isIdentifier(i.name)){let s=i.name.text;for(let o of r.statements)if(e.ts.isVariableStatement(o))for(let a of o.declarationList.declarations)e.ts.isIdentifier(a.name)&&a.name.text===s&&t.push({isDefaultExport:!1,statement:o,node:o});else e.ts.isFunctionDeclaration(o)&&o.name&&o.name.text===s&&t.push({isDefaultExport:!1,statement:o,node:o})}}else!n.exportClause&&n.moduleSpecifier&&t.push({isDefaultExport:!1,statement:n,node:n});continue}if(e.ts.isExportAssignment(n)){let i=n.flags===e.ts.NodeFlags.None,s=n.expression;if(e.ts.isIdentifier(s)){let o=s.text;for(let a of r.statements){if(e.ts.isVariableStatement(a))for(let l of a.declarationList.declarations)e.ts.isIdentifier(l.name)&&l.name.text===o&&t.push({isDefaultExport:i,statement:a,node:a});e.ts.isFunctionDeclaration(a)&&a.name?.text===o&&t.push({isDefaultExport:i,statement:a,node:a})}}else(e.ts.isArrowFunction(s)||e.ts.isCallExpression(s)||e.ts.isFunctionDeclaration(s)||e.ts.isObjectLiteralExpression(s))&&t.push({isDefaultExport:i,statement:n,node:s});continue}if((e.ts.isVariableStatement(n)||e.ts.isFunctionDeclaration(n))&&n.modifiers&&n.modifiers.some(i=>i.kind===e.ts.SyntaxKind.ExportKeyword)){t.push({isDefaultExport:n.modifiers.some(i=>i.kind===e.ts.SyntaxKind.DefaultKeyword),statement:n,node:n});continue}}return t}function S0(e,r){let t=[];for(let n of r.statements)if(e.ts.isExpressionStatement(n)&&e.ts.isBinaryExpression(n.expression)&&e.ts.isPropertyAccessExpression(n.expression.left)){let i=n.expression.left,s=n.expression.right;if(!e.ts.isIdentifier(i.expression))continue;if(i.expression.text==="module"&&i.name.text==="exports"){if(e.ts.isIdentifier(s)){let o=s.text;for(let a of r.statements)if(e.ts.isVariableStatement(a))for(let l of a.declarationList.declarations)e.ts.isIdentifier(l.name)&&l.name.text===o&&t.push({isDefaultExport:!0,statement:a,node:a});else e.ts.isFunctionDeclaration(a)&&a.name&&a.name.text===o&&t.push({isDefaultExport:!0,statement:a,node:a})}else t.push({isDefaultExport:!0,statement:n,node:s});continue}}return t}function w0(e,r,t){for(let n of r.statements)if(e.ts.isImportDeclaration(n)&&n.importClause){if(n.importClause.namedBindings&&e.ts.isNamedImports(n.importClause.namedBindings)){for(let i of n.importClause.namedBindings.elements)if(e.ts.isIdentifier(i.name)&&i.name.text===t&&e.ts.isStringLiteral(n.moduleSpecifier))return{importPath:n.moduleSpecifier.text,exportType:"named"}}if(n.importClause.name&&n.importClause.name.text===t&&e.ts.isStringLiteral(n.moduleSpecifier))return{importPath:n.moduleSpecifier.text,exportType:"default"}}return null}async function wr(e,r,t,n){let i=w0(e,t,n);if(i){let s=await Es(e,e.normalize(e.resolve(e.dirname(r),i.importPath))),o=e.relative(e.getAppRootDir(),s);return{displayFilePath:Ie(e,s),filePath:s,relFilePath:o,importPath:i.importPath,exportType:i.exportType}}return null}function Ei(e,r,t){for(let n=0;n<r.statements.length;n++){let i=r.statements[n];if(e.ts.isVariableStatement(i)){for(let s of i.declarationList.declarations)if(e.ts.isIdentifier(s.name)&&s.name.text===t)return{statement:i,statementIndex:n}}}return null}function it(e,r,t){let n=Ei(e,r,t);if(n&&n.statement.declarationList.declarations.length>0){let i=n.statement.declarationList.declarations[0];if(i.initializer&&e.ts.isArrayLiteralExpression(i.initializer))return{statement:n.statement,statementIndex:n.statementIndex,variableDeclaration:i,arrayLiteralExp:i.initializer}}return null}function $o(e,r){if(r){if(T0(e,r))return!0;let t=!1;if(r.forEachChild(n=>{$o(e,n)&&(t=!0)}),t)return!0}return!1}function T0(e,r){return e.ts.isJsxElement(r)||e.ts.isJsxOpeningElement(r)||e.ts.isJsxOpeningFragment(r)||e.ts.isJsxSelfClosingElement(r)||e.ts.isJsxFragment(r)||e.ts.isJsxChild(r)}async function Es(e,r){let t=e.extname(r).toLowerCase();if(t===""||!tu.includes(t)){for(let n of tu){let i=r+n;if(await e.exists(i))return i}for(let n of tu){let i=e.join(r,"index"+n);if(await e.exists(i))return i}}return r}var tu=[".tsx",".jsx",".ts",".js"];function Ci(e,r,t){if(!t||!r)return;let n=r.getSymbolAtLocation(t);if(!n)return;let i=n.valueDeclaration;if(!i)return;let s=i.getSourceFile().fileName,o=A0(e,s);return o?[{name:o}]:void 0}function A0(e,r){if(typeof r=="string"){r=e.normalize(ar(r));let t=r.split("/"),n=t.lastIndexOf("node_modules");if(n>-1){let i=t.slice(n+1),s=i[0];if(s)return s.startsWith("@")&&i[1]&&(s+="/"+i[1]),s}}}function Tr(e){let r=[];for(let t of e)if(t.dependencies)for(let n of t.dependencies)r.some(i=>i.name===n.name)||r.push({...n});return r.sort((t,n)=>t.name.localeCompare(n.name))}function xf(e,r,t="esm"){return t==="cjs"?I0(e,r):P0(e,r)}var v0=/^(@\w|\w)/;function P0(e,r){let t=[];for(let n of r.statements)if(e.ts.isImportDeclaration(n)&&e.ts.isLiteralExpression(n.moduleSpecifier)){if(!v0.test(n.moduleSpecifier.text)||n.importClause?.isTypeOnly)continue;if(n.importClause&&n.importClause.namedBindings&&e.ts.isNamedImports(n.importClause.namedBindings))for(let i of n.importClause.namedBindings.elements)i.isTypeOnly||t.push({isDefaultExport:!1,statement:n,node:i.name});n.importClause&&n.importClause.name&&t.push({isDefaultExport:!0,statement:n,node:n.importClause.name})}return t}function I0(e,r){return[]}async function Si(e,r){if(!r.some(o=>!o.isRegistered))return r;let n=await at(e,r.map(o=>o.filePath)),i=n.getTypeChecker();return await Promise.all(r.map(async o=>{let a=n.getSourceFile(o.filePath);if(a){let u=(await xn(e,i,o.filePath,a,!1)).find(c=>c.cmpInfo.id===o.id);u&&(o.inputs=Kn(e,i,u.node.fnNode))}return o}))}async function wi(e,r,t,n){if(r.node.fnNode){let{sourceFile:i,typeChecker:s}=await Di(e,r.cmpInfo.filePath,t),a=(await xn(e,s,r.cmpInfo.filePath,i,n)).find(l=>l.cmpInfo.id===r.cmpInfo.id);if(!a)throw new Error(`createComponentInputs() Could not find component ${r.cmpInfo.name} in ${r.cmpInfo.filePath}`);return Kn(e,s,a.node.fnNode)}return[]}async function Cf(e,r,t){let n=e.extname(r).toLowerCase();if(n===".tsx"||n===".jsx"||n===".ts"||n===".js"){let i=await e.readFile(r);if(i)return N0(e,r,i,t)}return null}function N0(e,r,t,n=!1){let i=Ee(e,t);return xn(e,null,r,i,n)}async function xn(e,r,t,n,i){let s=[];for(let a of n.statements)if(e.ts.isExpressionStatement(a)&&e.ts.isStringLiteral(a.expression)&&a.expression.text==="use server")return s;let o=Vn(e,n);return i&&o.push(...xf(e,n)),t=e.normalize(t),await Promise.all(o.map(async a=>{let l=await F0(e,r,t,a);s.push(...l)})),s}async function F0(e,r,t,n){let i=[],s=e.relative(e.getAppRootDir(),t),o=Le(e,t);if(e.ts.isVariableStatement(n.node)){for(let a of n.node.declarationList.declarations){if(!e.ts.isIdentifier(a.name)||!yi(a.name.text))continue;let l=Gr(e,r,a.initializer);if(l){let u=l.name||a.name.text,c=n.isDefaultExport?"default":u,p=n.isDefaultExport?"default":"named";i.push({cmpInfo:{id:await Be(e,t,c),displayFilePath:Ie(e,t),name:$e(u),inputs:[],exportName:c,exportType:p,importName:u,filePath:t,relFilePath:s,importPath:o,dependencies:l.deps},node:l})}}return i}if(e.ts.isArrowFunction(n.node)){let a=Gr(e,r,n.node);if(a){let l=er(e,t),u=n.isDefaultExport?"default":l,c=n.isDefaultExport?"default":"named";i.push({cmpInfo:{id:await Be(e,t,u),displayFilePath:Ie(e,t),name:l,inputs:[],exportName:u,exportType:c,importName:Un(e,t),filePath:t,relFilePath:s,importPath:o,dependencies:a.deps},node:a})}return i}if(e.ts.isFunctionExpression(n.node)||e.ts.isFunctionDeclaration(n.node)){let a=n.node.name?.text;if(a&&!yi(a))return i;let l=Gr(e,r,n.node);if(l){let u=l.name||er(e,t),c=n.isDefaultExport||!l.name?"default":l.name,p=n.isDefaultExport?"default":"named";i.push({cmpInfo:{id:await Be(e,t,c),displayFilePath:Ie(e,t),name:u,inputs:[],exportName:c,exportType:p,importName:l.name||Un(e,t),filePath:t,relFilePath:s,importPath:o,dependencies:l.deps},node:l})}return i}if((e.ts.isExportSpecifier(n.node)||e.ts.isIdentifier(n.node))&&yi(n.node.getText())){let a,l=Gr(e,r,n.node);if(l){let u=l.name||er(e,t),c=n.isDefaultExport||!l.name?"default":l.name,p=n.isDefaultExport?"default":"named",d=_0(e,n.node)?.moduleSpecifier??k0(e,n.node)?.moduleSpecifier;if(d&&e.ts.isStringLiteral(d)){let f=r?.getSymbolAtLocation(d);if(f&&f.declarations&&f.declarations.length>0){let m=f.declarations[0];(!e.ts.isSourceFile(m)||e.ts.isSourceFile(m)&&m.fileName.includes("node_modules"))&&(a=d.text)}}i.push({cmpInfo:{id:await Be(e,t,c,a),displayFilePath:Ie(e,t),name:u,inputs:[],exportName:c,exportType:p,importName:l.name||Un(e,t),filePath:t,relFilePath:s,importPath:a||o,externalImportPath:a,dependencies:l.deps},node:l})}return i}if(e.ts.isExportDeclaration(n.node)&&n.node.exportClause===void 0){let a=n.node.moduleSpecifier;if(a&&e.ts.isStringLiteral(a)){let l=await R0(e,r,t,a);i.push(...l)}return i}return i}function _0(e,r){for(;r;){if(e.ts.isExportDeclaration(r))return r;r=r.parent}return null}function k0(e,r){for(;r;){if(e.ts.isImportDeclaration(r))return r;r=r.parent}return null}function Gr(e,r,t){if(!t)return null;if(e.ts.isArrowFunction(t))return $o(e,t.body)?{name:"",fnNode:t,deps:Ci(e,r,t)}:null;if(e.ts.isFunctionExpression(t)||e.ts.isFunctionDeclaration(t))return $o(e,t.body)?{name:t.name?.text||"",fnNode:t,deps:Ci(e,r,t)}:null;if(e.ts.isCallExpression(t)){let n=t.expression;if(e.ts.isPropertyAccessExpression(n)){let i=t.arguments;if(i.length===0)return null;let s=n.expression;if(!e.ts.isIdentifier(s)||s.text!=="React")return null;let o=n.name;return!e.ts.isIdentifier(o)||o.text!=="forwardRef"?null:Gr(e,r,i[0])}else if(e.ts.isIdentifier(n)&&n.text==="observer"){let i=t.arguments;return i.length===0?null:Gr(e,r,i[0])}return null}if(!r)return null;if(e.ts.isPropertyAccessExpression(t)){let n=t.expression,i=t.name;if(!e.ts.isIdentifier(n)||!e.ts.isIdentifier(i)||!yi(i.text))return null;let o=r.getTypeAtLocation(i).getCallSignatures();if(o.length>0&&o[0].getParameters().length>0)return{name:"",fnNode:i,deps:Ci(e,r,i)}}if(e.ts.isExportSpecifier(t)){let n=t.name;return{name:n.text||"",fnNode:n,deps:Ci(e,r,n)}}if(e.ts.isIdentifier(t))return{name:t.text||"",fnNode:t,deps:Ci(e,r,t)};if(e.ts.isExpressionStatement(t)){let n=t.expression;if(e.ts.isAsExpression(n)&&e.ts.isIdentifier(n.type)&&n.type.text==="default")return Gr(e,r,n.expression)}if(e.ts.isVariableStatement(t)){for(let n of t.declarationList.declarations)if(n.initializer&&e.ts.isAsExpression(n.initializer)){let i=n.initializer;if(e.ts.isIdentifier(i.type)&&i.type.text==="default"){let s=Gr(e,r,i.expression);if(s&&e.ts.isIdentifier(n.name))return{name:n.name.text,fnNode:s.fnNode,deps:s.deps}}}}return null}async function Sf(e,r){let t=[],n=r.getSourceFiles(),i=r.getTypeChecker();return await Promise.all(n.map(async s=>{let o=e.normalize(s.fileName);if(Lo(e,O0,s.fileName)||o===e.reactConfigPath||o===e.builderComponentPath)return;let a=await xn(e,i,o,s,o===e.registryPath);t.push(...a)})),t.sort((s,o)=>s.cmpInfo.name.localeCompare(o.cmpInfo.name))}var O0=new Set(["node_modules","dist"]);async function R0(e,r,t,n){let i=[],s=n.text;if(!r)return i;try{let o=r.getSymbolAtLocation(n);if(!o)return i;let a=r.getExportsOfModule(o);for(let l of a){let u=l.valueDeclaration||l.declarations?.[0];if(!u)continue;let c=l.name;if(!yi(c)&&c!=="default"||!wf(e,r,u))continue;let p=Gr(e,r,u);if(p){let d=l.name,f=d==="default"?"default":"named",m=$e(d),h=d==="default"?Un(e,t):d;i.push({cmpInfo:{id:await Be(e,t,d,s),displayFilePath:Ie(e,t),name:m,inputs:[],exportName:d,exportType:f,importName:h,filePath:t,relFilePath:e.relative(e.getAppRootDir(),t),importPath:s,externalImportPath:s,dependencies:p.deps},node:p})}}}catch(o){console.error(`Error processing module ${s}:`,o)}return i}function wf(e,r,t){if(e.ts.isInterfaceDeclaration(t)||e.ts.isTypeAliasDeclaration(t))return!1;if(e.ts.isExportSpecifier(t)){let n=r.getSymbolAtLocation(t.name);if(n){let s=r.getAliasedSymbol(n).declarations?.[0];if(s)return wf(e,r,s)}return!1}if(e.ts.isFunctionDeclaration(t)||e.ts.isArrowFunction(t)||e.ts.isFunctionExpression(t)){let n=r.getSignatureFromDeclaration(t);if(n){let i=r.getReturnTypeOfSignature(n);return Ef(i,r)}}return e.ts.isClassDeclaration(t)?t.heritageClauses?.some(i=>i.types.some(s=>s.expression.getText()==="React.Component"||s.expression.getText()==="Component"))??!1:e.ts.isVariableDeclaration(t)?r.getTypeAtLocation(t).getCallSignatures().some(s=>Ef(r.getReturnTypeOfSignature(s),r)):!1}function Ef(e,r){let t=r.typeToString(e);return t==="JSX.Element"||t==="Element"||t.includes("ReactElement")||t.includes("React.ReactElement")||t.includes("ReactNode")}async function Tf(e,r){let t=[],n=r.getSourceFiles(),i=r.getTypeChecker();return await Promise.all(n.map(async s=>{let o=e.basename(s.fileName);if(e.appDir&&L0.has(o)||e.dirname(s.fileName).includes("node_modules"))return;let a=e.normalize(s.fileName);if(a===e.nextConfigPath||a===e.builderComponentPath)return;let l=await xn(e,i,a,s,a===e.registryPath||pt(a));t.push(...l)})),t.sort((s,o)=>s.cmpInfo.name.localeCompare(o.cmpInfo.name))}var L0=new Set(["default.tsx","default.ts","default.jsx","default.js","error.tsx","error.ts","error.jsx","error.js","layout.tsx","layout.ts","layout.jsx","layout.js","loading.tsx","loading.ts","loading.jsx","loading.js","not-found.tsx","not-found.ts","not-found.jsx","not-found.js","page.tsx","page.ts","page.jsx","page.js","route.tsx","route.ts","route.jsx","route.js","template.tsx","template.ts","template.jsx","template.js"]);function Ar(e,r){let t=[],n=[],i=[],s=[];for(let o of r.statements){if(e.ts.isImportDeclaration(o)){if(e.ts.isStringLiteral(o.moduleSpecifier)){let l=o.moduleSpecifier.text;if(!l.startsWith(".")&&!l.startsWith("/")){t.push(o);continue}}let a=o.importClause;if(a){if(a.namedBindings){n.push(o);continue}if(a.name){n.push(o);continue}}i.push(o);continue}s.push(o)}return e.ts.factory.updateSourceFile(r,[...ru(e,t),...ru(e,n),...ru(e,i),...s])}function lr(e){let r=e.split(`
|
|
98
|
+
`,t+=");";let n=Ro(e,t);return eu(e,n,r)}function eu(e,r,t){if(!e.ts.isExpressionStatement(r))return r;let n=r.expression;if(!e.ts.isCallExpression(n))return r;let i=[...n.arguments];if(i.length<2)return r;t.acceptsChildren?e.ts.isCallExpression(i[0])&&e.ts.isIdentifier(i[0].expression)&&i[0].expression.text==="withChildren"||(i[0]=e.ts.factory.createCallExpression(e.ts.factory.createIdentifier("withChildren"),void 0,[i[0]])):e.ts.isCallExpression(i[0])&&e.ts.isIdentifier(i[0].expression)&&i[0].expression.text==="withChildren"&&(i[0]=i[0].arguments[0]);let s=i[1];return e.ts.isObjectLiteralExpression(s)?(i[1]=lt(e,s,t),e.ts.factory.updateExpressionStatement(r,e.ts.factory.updateCallExpression(n,n.expression,n.typeArguments,i))):r}function Ce(e,r,t,n="esm"){return Array.isArray(t.namedImports)&&t.namedImports.forEach(i=>{r=x0(e,r,i,t.importPath,!!t.isTypeOnly,n)}),typeof t.defaultImport=="string"&&(r=E0(e,r,t.defaultImport,t.importPath,n)),r}function x0(e,r,t,n,i,s){return s==="cjs"?bf(e,r,null,t,n):Df(e,r,null,t,n,i)}function E0(e,r,t,n,i){return i==="cjs"?bf(e,r,t,null,n):Df(e,r,t,null,n,!1)}function Df(e,r,t,n,i,s){let o=[...r.statements],a=0,l=!1,u=!1;for(let f=0;f<o.length;f++){let m=o[f];if(!e.ts.isImportDeclaration(m)||(a=f,!m.moduleSpecifier||!e.ts.isStringLiteral(m.moduleSpecifier))||m.moduleSpecifier.text!==i||!!m.importClause?.isTypeOnly!==s)continue;let h=[],g=m.importClause?.namedBindings;if(g&&e.ts.isNamedImports(g)&&g.elements&&h.push(...g.elements),typeof n=="string"){if(h.some(D=>D.name.text===n))return r;h.push(e.ts.factory.createImportSpecifier(!1,void 0,e.ts.factory.createIdentifier(n))),h.sort((D,C)=>D.name.text.localeCompare(C.name.text)),l=!0}let y=m.importClause?m.importClause.name:void 0;if(typeof t=="string"){if(y&&y.text===t)return r;y=e.ts.factory.createIdentifier(t),u=!0}if(l||u)return o[f]=e.ts.factory.updateImportDeclaration(m,void 0,e.ts.factory.createImportClause(s,y,e.ts.factory.createNamedImports(h)),m.moduleSpecifier,void 0),e.ts.factory.updateSourceFile(r,o)}let c,p;typeof t=="string"&&(c=e.ts.factory.createIdentifier(t)),typeof n=="string"&&(p=e.ts.factory.createNamedImports([e.ts.factory.createImportSpecifier(!1,void 0,e.ts.factory.createIdentifier(n))]));let d=e.ts.factory.createImportDeclaration(void 0,e.ts.factory.createImportClause(s,c,p),e.ts.factory.createStringLiteral(i));return o.splice(a,0,d),e.ts.factory.updateSourceFile(r,o)}function bf(e,r,t,n,i){let s=[...r.statements],o=0;for(let a=0;a<s.length;a++){let l=s[a];if(e.ts.isVariableStatement(l))for(let u=0;u<l.declarationList.declarations.length;u++){let c=[...l.declarationList.declarations],p=c[u],d=p.initializer;if(!d||!e.ts.isCallExpression(d))continue;let f=d.expression;if(!e.ts.isIdentifier(f)||f.text!=="require"||d.arguments.length!==1)continue;let m=d.arguments[0];if(e.ts.isStringLiteral(m)&&(o=a,m.text===i)){if(e.ts.isIdentifier(p.name)&&typeof t=="string")return p.name.text===t?r:(c[u]=e.ts.factory.updateVariableDeclaration(p,e.ts.factory.createIdentifier(t),p.exclamationToken,p.type,p.initializer),s[a]=e.ts.factory.updateVariableStatement(l,l.modifiers,e.ts.factory.updateVariableDeclarationList(l.declarationList,c)),e.ts.factory.updateSourceFile(r,s));if(e.ts.isObjectBindingPattern(p.name)&&typeof n=="string"){let h=[...p.name.elements];return h.some(y=>!e.ts.isBindingElement(y)||!e.ts.isIdentifier(y.name)?!1:y.name.text===n)?r:(h.push(e.ts.factory.createBindingElement(void 0,void 0,n)),h.sort((y,D)=>!e.ts.isBindingElement(y)||!e.ts.isIdentifier(y.name)||!e.ts.isBindingElement(D)||!e.ts.isIdentifier(D.name)?0:y.name.text.localeCompare(D.name.text)),c[u]=e.ts.factory.updateVariableDeclaration(p,e.ts.factory.createObjectBindingPattern(h),p.exclamationToken,p.type,p.initializer),s[a]=e.ts.factory.updateVariableStatement(l,l.modifiers,e.ts.factory.updateVariableDeclarationList(l.declarationList,c)),e.ts.factory.updateSourceFile(r,s))}}}}if(typeof t=="string"){let a=e.ts.factory.createVariableStatement(void 0,e.ts.factory.createVariableDeclarationList([e.ts.factory.createVariableDeclaration(t,void 0,void 0,e.ts.factory.createCallExpression(e.ts.factory.createIdentifier("require"),void 0,[e.ts.factory.createStringLiteral(i)]))],e.ts.NodeFlags.Const));return s.splice(o,0,a),e.ts.factory.updateSourceFile(r,s)}if(typeof n=="string"){let a=e.ts.factory.createVariableStatement(void 0,e.ts.factory.createVariableDeclarationList([e.ts.factory.createVariableDeclaration(e.ts.factory.createObjectBindingPattern([e.ts.factory.createBindingElement(void 0,void 0,n)]),void 0,void 0,e.ts.factory.createCallExpression(e.ts.factory.createIdentifier("require"),void 0,[e.ts.factory.createStringLiteral(i)]))],e.ts.NodeFlags.Const));return s.splice(o,0,a),e.ts.factory.updateSourceFile(r,s)}return r}function Vn(e,r,t="esm"){return t==="cjs"?S0(e,r):C0(e,r)}function C0(e,r){let t=[];for(let n of r.statements){if(e.ts.isExportDeclaration(n)){if(n.exportClause&&e.ts.isNamedExports(n.exportClause)){for(let i of n.exportClause.elements)if(n.moduleSpecifier&&t.push({isDefaultExport:!1,statement:n,node:i}),e.ts.isIdentifier(i.name)){let s=i.name.text;for(let o of r.statements)if(e.ts.isVariableStatement(o))for(let a of o.declarationList.declarations)e.ts.isIdentifier(a.name)&&a.name.text===s&&t.push({isDefaultExport:!1,statement:o,node:o});else e.ts.isFunctionDeclaration(o)&&o.name&&o.name.text===s&&t.push({isDefaultExport:!1,statement:o,node:o})}}else!n.exportClause&&n.moduleSpecifier&&t.push({isDefaultExport:!1,statement:n,node:n});continue}if(e.ts.isExportAssignment(n)){let i=n.flags===e.ts.NodeFlags.None,s=n.expression;if(e.ts.isIdentifier(s)){let o=s.text;for(let a of r.statements){if(e.ts.isVariableStatement(a))for(let l of a.declarationList.declarations)e.ts.isIdentifier(l.name)&&l.name.text===o&&t.push({isDefaultExport:i,statement:a,node:a});e.ts.isFunctionDeclaration(a)&&a.name?.text===o&&t.push({isDefaultExport:i,statement:a,node:a})}}else(e.ts.isArrowFunction(s)||e.ts.isCallExpression(s)||e.ts.isFunctionDeclaration(s)||e.ts.isObjectLiteralExpression(s))&&t.push({isDefaultExport:i,statement:n,node:s});continue}if((e.ts.isVariableStatement(n)||e.ts.isFunctionDeclaration(n))&&n.modifiers&&n.modifiers.some(i=>i.kind===e.ts.SyntaxKind.ExportKeyword)){t.push({isDefaultExport:n.modifiers.some(i=>i.kind===e.ts.SyntaxKind.DefaultKeyword),statement:n,node:n});continue}}return t}function S0(e,r){let t=[];for(let n of r.statements)if(e.ts.isExpressionStatement(n)&&e.ts.isBinaryExpression(n.expression)&&e.ts.isPropertyAccessExpression(n.expression.left)){let i=n.expression.left,s=n.expression.right;if(!e.ts.isIdentifier(i.expression))continue;if(i.expression.text==="module"&&i.name.text==="exports"){if(e.ts.isIdentifier(s)){let o=s.text;for(let a of r.statements)if(e.ts.isVariableStatement(a))for(let l of a.declarationList.declarations)e.ts.isIdentifier(l.name)&&l.name.text===o&&t.push({isDefaultExport:!0,statement:a,node:a});else e.ts.isFunctionDeclaration(a)&&a.name&&a.name.text===o&&t.push({isDefaultExport:!0,statement:a,node:a})}else t.push({isDefaultExport:!0,statement:n,node:s});continue}}return t}function w0(e,r,t){for(let n of r.statements)if(e.ts.isImportDeclaration(n)&&n.importClause){if(n.importClause.namedBindings&&e.ts.isNamedImports(n.importClause.namedBindings)){for(let i of n.importClause.namedBindings.elements)if(e.ts.isIdentifier(i.name)&&i.name.text===t&&e.ts.isStringLiteral(n.moduleSpecifier))return{importPath:n.moduleSpecifier.text,exportType:"named"}}if(n.importClause.name&&n.importClause.name.text===t&&e.ts.isStringLiteral(n.moduleSpecifier))return{importPath:n.moduleSpecifier.text,exportType:"default"}}return null}async function wr(e,r,t,n){let i=w0(e,t,n);if(i){let s=await Es(e,e.normalize(e.resolve(e.dirname(r),i.importPath))),o=e.relative(e.getAppRootDir(),s);return{displayFilePath:Ie(e,s),filePath:s,relFilePath:o,importPath:i.importPath,exportType:i.exportType}}return null}function Ei(e,r,t){for(let n=0;n<r.statements.length;n++){let i=r.statements[n];if(e.ts.isVariableStatement(i)){for(let s of i.declarationList.declarations)if(e.ts.isIdentifier(s.name)&&s.name.text===t)return{statement:i,statementIndex:n}}}return null}function it(e,r,t){let n=Ei(e,r,t);if(n&&n.statement.declarationList.declarations.length>0){let i=n.statement.declarationList.declarations[0];if(i.initializer&&e.ts.isArrayLiteralExpression(i.initializer))return{statement:n.statement,statementIndex:n.statementIndex,variableDeclaration:i,arrayLiteralExp:i.initializer}}return null}function $o(e,r){if(r){if(T0(e,r))return!0;let t=!1;if(r.forEachChild(n=>{$o(e,n)&&(t=!0)}),t)return!0}return!1}function T0(e,r){return e.ts.isJsxElement(r)||e.ts.isJsxOpeningElement(r)||e.ts.isJsxOpeningFragment(r)||e.ts.isJsxSelfClosingElement(r)||e.ts.isJsxFragment(r)||e.ts.isJsxChild(r)}async function Es(e,r){let t=e.extname(r).toLowerCase();if(t===""||!tu.includes(t)){for(let n of tu){let i=r+n;if(await e.exists(i))return i}for(let n of tu){let i=e.join(r,"index"+n);if(await e.exists(i))return i}}return r}var tu=[".tsx",".jsx",".ts",".js"];function Ci(e,r,t){if(!t||!r)return;let n=r.getSymbolAtLocation(t);if(!n)return;let i=n.valueDeclaration;if(!i)return;let s=i.getSourceFile().fileName,o=A0(e,s);return o?[{name:o}]:void 0}function A0(e,r){if(typeof r=="string"){r=e.normalize(ar(r));let t=r.split("/"),n=t.lastIndexOf("node_modules");if(n>-1){let i=t.slice(n+1),s=i[0];if(s)return s.startsWith("@")&&i[1]&&(s+="/"+i[1]),s}}}function Tr(e){let r=[];for(let t of e)if(t.dependencies)for(let n of t.dependencies)r.some(i=>i.name===n.name)||r.push({...n});return r.sort((t,n)=>t.name.localeCompare(n.name))}function xf(e,r,t="esm"){return t==="cjs"?I0(e,r):P0(e,r)}var v0=/^(@\w|\w)/;function P0(e,r){let t=[];for(let n of r.statements)if(e.ts.isImportDeclaration(n)&&e.ts.isLiteralExpression(n.moduleSpecifier)){if(!v0.test(n.moduleSpecifier.text)||n.importClause?.isTypeOnly)continue;if(n.importClause&&n.importClause.namedBindings&&e.ts.isNamedImports(n.importClause.namedBindings))for(let i of n.importClause.namedBindings.elements)i.isTypeOnly||t.push({isDefaultExport:!1,statement:n,node:i.name});n.importClause&&n.importClause.name&&t.push({isDefaultExport:!0,statement:n,node:n.importClause.name})}return t}function I0(e,r){return[]}async function Si(e,r){if(!r.some(o=>!o.isRegistered))return r;let n=await at(e,r.map(o=>o.filePath)),i=n.getTypeChecker();return await Promise.all(r.map(async o=>{let a=n.getSourceFile(o.filePath);if(a){let u=(await xn(e,i,o.filePath,a,!1)).find(c=>c.cmpInfo.id===o.id);u&&(o.inputs=Kn(e,i,u.node.fnNode))}return o}))}async function wi(e,r,t,n){if(r.node.fnNode){let{sourceFile:i,typeChecker:s}=await Di(e,r.cmpInfo.filePath,t),a=(await xn(e,s,r.cmpInfo.filePath,i,n)).find(l=>l.cmpInfo.id===r.cmpInfo.id);if(!a)throw new Error(`createComponentInputs() Could not find component ${r.cmpInfo.name} in ${r.cmpInfo.filePath}`);return Kn(e,s,a.node.fnNode)}return[]}async function Cf(e,r,t){let n=e.extname(r).toLowerCase();if(n===".tsx"||n===".jsx"||n===".ts"||n===".js"){let i=await e.readFile(r);if(i)return N0(e,r,i,t)}return null}function N0(e,r,t,n=!1){let i=Ee(e,t);return xn(e,null,r,i,n)}async function xn(e,r,t,n,i){let s=[];for(let a of n.statements)if(e.ts.isExpressionStatement(a)&&e.ts.isStringLiteral(a.expression)&&a.expression.text==="use server")return s;let o=Vn(e,n);return i&&o.push(...xf(e,n)),t=e.normalize(t),await Promise.all(o.map(async a=>{let l=await F0(e,r,t,a);s.push(...l)})),s}async function F0(e,r,t,n){let i=[],s=e.relative(e.getAppRootDir(),t),o=Re(e,t);if(e.ts.isVariableStatement(n.node)){for(let a of n.node.declarationList.declarations){if(!e.ts.isIdentifier(a.name)||!yi(a.name.text))continue;let l=Gr(e,r,a.initializer);if(l){let u=l.name||a.name.text,c=n.isDefaultExport?"default":u,p=n.isDefaultExport?"default":"named";i.push({cmpInfo:{id:await Le(e,t,c),displayFilePath:Ie(e,t),name:$e(u),inputs:[],exportName:c,exportType:p,importName:u,filePath:t,relFilePath:s,importPath:o,dependencies:l.deps},node:l})}}return i}if(e.ts.isArrowFunction(n.node)){let a=Gr(e,r,n.node);if(a){let l=er(e,t),u=n.isDefaultExport?"default":l,c=n.isDefaultExport?"default":"named";i.push({cmpInfo:{id:await Le(e,t,u),displayFilePath:Ie(e,t),name:l,inputs:[],exportName:u,exportType:c,importName:Un(e,t),filePath:t,relFilePath:s,importPath:o,dependencies:a.deps},node:a})}return i}if(e.ts.isFunctionExpression(n.node)||e.ts.isFunctionDeclaration(n.node)){let a=n.node.name?.text;if(a&&!yi(a))return i;let l=Gr(e,r,n.node);if(l){let u=l.name||er(e,t),c=n.isDefaultExport||!l.name?"default":l.name,p=n.isDefaultExport?"default":"named";i.push({cmpInfo:{id:await Le(e,t,c),displayFilePath:Ie(e,t),name:u,inputs:[],exportName:c,exportType:p,importName:l.name||Un(e,t),filePath:t,relFilePath:s,importPath:o,dependencies:l.deps},node:l})}return i}if((e.ts.isExportSpecifier(n.node)||e.ts.isIdentifier(n.node))&&yi(n.node.getText())){let a,l=Gr(e,r,n.node);if(l){let u=l.name||er(e,t),c=n.isDefaultExport||!l.name?"default":l.name,p=n.isDefaultExport?"default":"named",d=_0(e,n.node)?.moduleSpecifier??k0(e,n.node)?.moduleSpecifier;if(d&&e.ts.isStringLiteral(d)){let f=r?.getSymbolAtLocation(d);if(f&&f.declarations&&f.declarations.length>0){let m=f.declarations[0];(!e.ts.isSourceFile(m)||e.ts.isSourceFile(m)&&m.fileName.includes("node_modules"))&&(a=d.text)}}i.push({cmpInfo:{id:await Le(e,t,c,a),displayFilePath:Ie(e,t),name:u,inputs:[],exportName:c,exportType:p,importName:l.name||Un(e,t),filePath:t,relFilePath:s,importPath:a||o,externalImportPath:a,dependencies:l.deps},node:l})}return i}if(e.ts.isExportDeclaration(n.node)&&n.node.exportClause===void 0){let a=n.node.moduleSpecifier;if(a&&e.ts.isStringLiteral(a)){let l=await R0(e,r,t,a);i.push(...l)}return i}return i}function _0(e,r){for(;r;){if(e.ts.isExportDeclaration(r))return r;r=r.parent}return null}function k0(e,r){for(;r;){if(e.ts.isImportDeclaration(r))return r;r=r.parent}return null}function Gr(e,r,t){if(!t)return null;if(e.ts.isArrowFunction(t))return $o(e,t.body)?{name:"",fnNode:t,deps:Ci(e,r,t)}:null;if(e.ts.isFunctionExpression(t)||e.ts.isFunctionDeclaration(t))return $o(e,t.body)?{name:t.name?.text||"",fnNode:t,deps:Ci(e,r,t)}:null;if(e.ts.isCallExpression(t)){let n=t.expression;if(e.ts.isPropertyAccessExpression(n)){let i=t.arguments;if(i.length===0)return null;let s=n.expression;if(!e.ts.isIdentifier(s)||s.text!=="React")return null;let o=n.name;return!e.ts.isIdentifier(o)||o.text!=="forwardRef"?null:Gr(e,r,i[0])}else if(e.ts.isIdentifier(n)&&n.text==="observer"){let i=t.arguments;return i.length===0?null:Gr(e,r,i[0])}return null}if(!r)return null;if(e.ts.isPropertyAccessExpression(t)){let n=t.expression,i=t.name;if(!e.ts.isIdentifier(n)||!e.ts.isIdentifier(i)||!yi(i.text))return null;let o=r.getTypeAtLocation(i).getCallSignatures();if(o.length>0&&o[0].getParameters().length>0)return{name:"",fnNode:i,deps:Ci(e,r,i)}}if(e.ts.isExportSpecifier(t)){let n=t.name;return{name:n.text||"",fnNode:n,deps:Ci(e,r,n)}}if(e.ts.isIdentifier(t))return{name:t.text||"",fnNode:t,deps:Ci(e,r,t)};if(e.ts.isExpressionStatement(t)){let n=t.expression;if(e.ts.isAsExpression(n)&&e.ts.isIdentifier(n.type)&&n.type.text==="default")return Gr(e,r,n.expression)}if(e.ts.isVariableStatement(t)){for(let n of t.declarationList.declarations)if(n.initializer&&e.ts.isAsExpression(n.initializer)){let i=n.initializer;if(e.ts.isIdentifier(i.type)&&i.type.text==="default"){let s=Gr(e,r,i.expression);if(s&&e.ts.isIdentifier(n.name))return{name:n.name.text,fnNode:s.fnNode,deps:s.deps}}}}return null}async function Sf(e,r){let t=[],n=r.getSourceFiles(),i=r.getTypeChecker();return await Promise.all(n.map(async s=>{let o=e.normalize(s.fileName);if(Lo(e,O0,s.fileName)||o===e.reactConfigPath||o===e.builderComponentPath)return;let a=await xn(e,i,o,s,o===e.registryPath);t.push(...a)})),t.sort((s,o)=>s.cmpInfo.name.localeCompare(o.cmpInfo.name))}var O0=new Set(["node_modules","dist"]);async function R0(e,r,t,n){let i=[],s=n.text;if(!r)return i;try{let o=r.getSymbolAtLocation(n);if(!o)return i;let a=r.getExportsOfModule(o);for(let l of a){let u=l.valueDeclaration||l.declarations?.[0];if(!u)continue;let c=l.name;if(!yi(c)&&c!=="default"||!wf(e,r,u))continue;let p=Gr(e,r,u);if(p){let d=l.name,f=d==="default"?"default":"named",m=$e(d),h=d==="default"?Un(e,t):d;i.push({cmpInfo:{id:await Le(e,t,d,s),displayFilePath:Ie(e,t),name:m,inputs:[],exportName:d,exportType:f,importName:h,filePath:t,relFilePath:e.relative(e.getAppRootDir(),t),importPath:s,externalImportPath:s,dependencies:p.deps},node:p})}}}catch(o){console.error(`Error processing module ${s}:`,o)}return i}function wf(e,r,t){if(e.ts.isInterfaceDeclaration(t)||e.ts.isTypeAliasDeclaration(t))return!1;if(e.ts.isExportSpecifier(t)){let n=r.getSymbolAtLocation(t.name);if(n){let s=r.getAliasedSymbol(n).declarations?.[0];if(s)return wf(e,r,s)}return!1}if(e.ts.isFunctionDeclaration(t)||e.ts.isArrowFunction(t)||e.ts.isFunctionExpression(t)){let n=r.getSignatureFromDeclaration(t);if(n){let i=r.getReturnTypeOfSignature(n);return Ef(i,r)}}return e.ts.isClassDeclaration(t)?t.heritageClauses?.some(i=>i.types.some(s=>s.expression.getText()==="React.Component"||s.expression.getText()==="Component"))??!1:e.ts.isVariableDeclaration(t)?r.getTypeAtLocation(t).getCallSignatures().some(s=>Ef(r.getReturnTypeOfSignature(s),r)):!1}function Ef(e,r){let t=r.typeToString(e);return t==="JSX.Element"||t==="Element"||t.includes("ReactElement")||t.includes("React.ReactElement")||t.includes("ReactNode")}async function Tf(e,r){let t=[],n=r.getSourceFiles(),i=r.getTypeChecker();return await Promise.all(n.map(async s=>{let o=e.basename(s.fileName);if(e.appDir&&L0.has(o)||e.dirname(s.fileName).includes("node_modules"))return;let a=e.normalize(s.fileName);if(a===e.nextConfigPath||a===e.builderComponentPath)return;let l=await xn(e,i,a,s,a===e.registryPath||pt(a));t.push(...l)})),t.sort((s,o)=>s.cmpInfo.name.localeCompare(o.cmpInfo.name))}var L0=new Set(["default.tsx","default.ts","default.jsx","default.js","error.tsx","error.ts","error.jsx","error.js","layout.tsx","layout.ts","layout.jsx","layout.js","loading.tsx","loading.ts","loading.jsx","loading.js","not-found.tsx","not-found.ts","not-found.jsx","not-found.js","page.tsx","page.ts","page.jsx","page.js","route.tsx","route.ts","route.jsx","route.js","template.tsx","template.ts","template.jsx","template.js"]);function Ar(e,r){let t=[],n=[],i=[],s=[];for(let o of r.statements){if(e.ts.isImportDeclaration(o)){if(e.ts.isStringLiteral(o.moduleSpecifier)){let l=o.moduleSpecifier.text;if(!l.startsWith(".")&&!l.startsWith("/")){t.push(o);continue}}let a=o.importClause;if(a){if(a.namedBindings){n.push(o);continue}if(a.name){n.push(o);continue}}i.push(o);continue}s.push(o)}return e.ts.factory.updateSourceFile(r,[...ru(e,t),...ru(e,n),...ru(e,i),...s])}function lr(e){let r=e.split(`
|
|
99
99
|
`).map(n=>n.trimEnd());e="";let t=!1;for(let n=r.length-1;n>=0;n--){let i=r[n];!t&&i.startsWith("import ")&&(t=!0,i=i+`
|
|
100
100
|
`),/^builder.init(.*)$/.test(i)&&(i=i+`
|
|
101
101
|
`),r[n-1]&&!r[n-1].includes("*/")&&(i.trim().startsWith("Builder.registerComponent")&&(i=`
|
|
@@ -105,7 +105,7 @@ ${t}=${n}
|
|
|
105
105
|
`+i)),e=i+`
|
|
106
106
|
`+e}return e.trim()+`
|
|
107
107
|
`}function ru(e,r){return r.sort((t,n)=>{let i=Af(e,t),s=Af(e,n);return i.toLocaleLowerCase().localeCompare(s.toLocaleLowerCase())})}function Af(e,r){let t=r.importClause;if(t){let n=t.namedBindings;if(n&&e.ts.isNamedImports(n)&&n.elements.length>0)return n.elements[0].name.text;if(t.name)return t.name.text}return r.moduleSpecifier&&e.ts.isStringLiteral(r.moduleSpecifier)?r.moduleSpecifier.text:""}function Pf(e){return typeof e=="string"&&!e.includes("'use client'")&&!e.includes(`"use client"'`)&&(e=`"use client"
|
|
108
|
-
${e}`),e}function If(e,r){let t=r.statements.filter(n=>!(e.ts.isExpressionStatement(n)&&e.ts.isStringLiteral(n.expression)&&e.ts.isStringLiteral(n.expression)&&n.expression.text==="use client"));return e.ts.factory.updateSourceFile(r,t)}function vr(e,r){return r.sort((t,n)=>{if(e.ts.isObjectLiteralExpression(t)&&e.ts.isObjectLiteralExpression(n)){let i=vf(e,t),s=vf(e,n);return i.toLocaleLowerCase().localeCompare(s.toLocaleLowerCase())}return 1})}function vf(e,r){let t=r.properties.find(n=>Ne(e,n)==="name");return t&&e.ts.isPropertyAssignment(t)&&e.ts.isStringLiteral(t.initializer)?t.initializer.text:"zzzz"}async function Nf(e){let r=await e.readFile(e.registryPath);return r?B0(e,r):{components:[],sourceFile:Ee(e,"")}}async function B0(e,r){let t=Ee(e,r);return e.sdkVersion===ne.gen2?$0(e,t):M0(e,t)}async function M0(e,r){let t=[];for(let n=0;n<r.statements.length;n++){let i=r.statements[n];if(!e.ts.isExpressionStatement(i))continue;let s=i.expression;if(!e.ts.isCallExpression(s))continue;let o=s.expression;if(!e.ts.isPropertyAccessExpression(o))continue;let a=o.expression;if(!e.ts.isIdentifier(a)||a.text!=="Builder"||o.name.text!=="registerComponent")continue;let u=s.arguments;if(u.length<2)continue;let c=u[1];if(!e.ts.isObjectLiteralExpression(c))continue;let p=u[0];if(e.ts.isCallExpression(p)){let d=e.ts.isIdentifier(p.expression)&&p.expression.text;if(d==="withChildren"){let m=su(e,p.arguments[0]);if(e.ts.isCallExpression(m)){let h=await nu(e,n,m,c,!0);h&&t.push(h)}else{let h=m;if(e.ts.isIdentifier(h)){let g=await iu(e,r,n,h,c,!0);g&&t.push(g)}}continue}if(d==="dynamic"){let m=await nu(e,n,p,c,!1);m&&t.push(m);continue}let f=su(e,p.arguments[0]);if(e.ts.isCallExpression(f)&&e.ts.isIdentifier(f.expression)&&f.expression.text==="dynamic"){let m=await nu(e,n,f,c,!1);m&&t.push(m);continue}if(e.ts.isIdentifier(f)){let m=await iu(e,r,n,f,c,!1);m&&t.push(m);continue}continue}if(e.ts.isIdentifier(p)){let d=await iu(e,r,n,p,c,!1);d&&t.push(d);continue}}return{sourceFile:r,components:$t(t)}}function su(e,r){return e.ts.isCallExpression(r)?(e.ts.isIdentifier(r.expression)&&r.expression.text)==="dynamic"?r:su(e,r.arguments[0]):r}async function nu(e,r,t,n,i){let s={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],nodeIndex:r,acceptsChildren:i},o=t.arguments;if(o.length===0)return null;let a=o[0];if(!e.ts.isArrowFunction(a))return null;let l=a.body;if(e.ts.isCallExpression(l)){if(l.expression.kind!==e.ts.SyntaxKind.ImportKeyword||l.arguments.length!==1)return null;let c=l.arguments[0];if(!e.ts.isStringLiteral(c))return null;let p=c.text,d=await Ti(e,p);s.filePath=d,s.relFilePath=e.relative(e.getAppRootDir(),s.filePath),await e.exists(d)?s.importPath=Le(e,s.filePath):(s.externalImportPath=p,s.importPath=s.externalImportPath),s.name=er(e,s.filePath),s.importName="default",s.exportName="default",s.exportType="default"}else if(e.ts.isPropertyAccessExpression(l)){let u=l.expression;if(!e.ts.isParenthesizedExpression(u))return null;let c=u.expression;if(!e.ts.isAwaitExpression(c))return null;let p=c.expression;if(!e.ts.isCallExpression(p)||p.expression.kind!==e.ts.SyntaxKind.ImportKeyword||p.arguments.length!==1)return null;let f=p.arguments[0];if(!e.ts.isStringLiteral(f)||!e.ts.isIdentifier(l.name))return null;let m=f.text,h=await Ti(e,m);s.filePath=h,s.relFilePath=e.relative(e.getAppRootDir(),s.filePath),await e.exists(h)?s.importPath=Le(e,s.filePath):(s.externalImportPath=m,s.importPath=s.externalImportPath),s.name=$e(l.name.text),s.importName=l.name.text,s.exportName=l.name.text,s.exportType="named"}else return null;return s=Ut(e,s,n),s.displayFilePath=Ie(e,s.filePath),s.filePath&&s.exportName&&(s.id=await Be(e,s.filePath,s.exportName,s.externalImportPath)),s}async function iu(e,r,t,n,i,s){let o={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],nodeIndex:t,acceptsChildren:s},a=r.statements.filter(u=>e.ts.isImportDeclaration(u)),l=a.find(u=>u.importClause&&u.importClause.name?.text===n.text);if(l){let u=l.moduleSpecifier;if(!e.ts.isStringLiteral(u))return null;let c=await Ti(e,u.text);o.filePath=c,o.relFilePath=e.relative(e.getAppRootDir(),o.filePath),await e.exists(c)?o.importPath=Le(e,o.filePath):(o.externalImportPath=u.text,o.importPath=o.externalImportPath),o.name=er(e,o.filePath),o.importName=n.text,o.exportName="default",o.exportType="default"}else{let u=a.find(d=>!d.importClause||!d.importClause.namedBindings||!e.ts.isNamedImports(d.importClause.namedBindings)?!1:d.importClause.namedBindings.elements.some(f=>f.name.text===n.text));if(!u)return null;let c=u.moduleSpecifier;if(!e.ts.isStringLiteral(c))return null;let p=await Ti(e,c.text);o.filePath=p,o.relFilePath=e.relative(e.getAppRootDir(),o.filePath),await e.exists(p)?o.importPath=Le(e,o.filePath):(o.externalImportPath=c.text,o.importPath=o.externalImportPath),o.name=$e(n.text),o.importName=n.text,o.exportName=n.text,o.exportType="named"}return o=Ut(e,o,i),o.displayFilePath=Ie(e,o.filePath),o.filePath&&o.exportName&&(o.id=await Be(e,o.filePath,o.exportName,o.externalImportPath)),o}function Ti(e,r){return Es(e,e.normalize(e.resolve(e.dirname(e.registryPath),r)))}function Ff(e,r,t){let n=!1,i=0,s=[...r.statements];for(let u=0;u<s.length;u++){let c=s[u];if(e.ts.isImportDeclaration(c)){i=u;continue}if(!e.ts.isExpressionStatement(c))continue;let p=c.expression;if(!e.ts.isCallExpression(p))continue;let d=p.expression;if(!e.ts.isPropertyAccessExpression(d))continue;let f=d.expression;if(!e.ts.isIdentifier(f)||f.text!=="builder")continue;if(d.name.text=="init"){n=!0;break}else continue}if(n)return r;let o=e.ts.factory.createPropertyAccessExpression(e.ts.factory.createPropertyAccessExpression(e.ts.factory.createIdentifier("process"),e.ts.factory.createIdentifier("env")),e.ts.factory.createIdentifier(Sr)),a=t?e.ts.factory.createNonNullExpression(o):o,l=e.ts.factory.createExpressionStatement(e.ts.factory.createCallExpression(e.ts.factory.createPropertyAccessExpression(e.ts.factory.createIdentifier("builder"),e.ts.factory.createIdentifier("init")),void 0,[a]));return s.splice(i+1,0,l),e.ts.factory.updateSourceFile(r,s)}async function $0(e,r){let t=[],n=it(e,r,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(i,s)=>{let o=await ou(e,r,i);o&&(o.nodeIndex=s,t.push(o))})),{sourceFile:r,components:$t(t)}}async function ou(e,r,t){if(!e.ts.isObjectLiteralExpression(t))return null;let n={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],acceptsChildren:!1};xi(e,t)&&(n.acceptsChildren=!0);for(let s of t.properties){if(!e.ts.isPropertyAssignment(s)||!e.ts.isIdentifier(s.name))continue;if(Ne(e,s)==="component"){let a,{initializer:l}=s;if(e.ts.isCallExpression(l)&&(e.ts.isIdentifier(l.expression)&&l.expression.text)==="dynamic"){let f=l.arguments;if(f.length===0)return null;let m=f[0];if(!e.ts.isArrowFunction(m))return null;let h=m.body;if(e.ts.isCallExpression(h)){if(h.expression.kind!==e.ts.SyntaxKind.ImportKeyword||h.arguments.length!==1)return null;let y=h.arguments[0];if(!e.ts.isStringLiteral(y))return null;let D=y.text,C=await Ti(e,D);n.filePath=C,n.relFilePath=e.relative(e.getAppRootDir(),n.filePath),await e.exists(C)?n.importPath=Le(e,n.filePath):(n.externalImportPath=D,n.importPath=n.externalImportPath),n.name=er(e,n.filePath),n.importName="default",n.exportName="default",n.exportType="default"}else if(e.ts.isPropertyAccessExpression(h)){let g=h.expression;if(!e.ts.isParenthesizedExpression(g))return null;let y=g.expression;if(!e.ts.isAwaitExpression(y))return null;let D=y.expression;if(!e.ts.isCallExpression(D)||D.expression.kind!==e.ts.SyntaxKind.ImportKeyword||D.arguments.length!==1)return null;let x=D.arguments[0];if(!e.ts.isStringLiteral(x)||!e.ts.isIdentifier(h.name))return null;let b=x.text,E=await Ti(e,b);n.filePath=E,n.relFilePath=e.relative(e.getAppRootDir(),n.filePath),await e.exists(E)?n.importPath=Le(e,n.filePath):(n.externalImportPath=b,n.importPath=n.externalImportPath),n.name=$e(h.name.text),n.importName=h.name.text,n.exportName=h.name.text,n.exportType="named"}else return null;return n=Ut(e,n,t),n.displayFilePath=Ie(e,n.filePath),n.filePath&&n.exportName&&(n.id=await Be(e,n.filePath,n.exportName,n.externalImportPath)),n}if(e.ts.isIdentifier(l)&&(a=l.text),!a)continue;n.name===""&&(n.name=$e(a)),n.importName=a;let u=await wr(e,e.registryPath,r,a);if(!u)continue;n.filePath=u.filePath,n.relFilePath=u.relFilePath,await e.exists(u.filePath)?n.importPath=Le(e,u.filePath):(n.externalImportPath=u.importPath,n.importPath=n.externalImportPath),n.importPath=Le(e,u.filePath),n.displayFilePath=u.displayFilePath,n.exportType=u.exportType;let c=r.statements.filter(d=>e.ts.isImportDeclaration(d)),p=c.find(d=>d.importClause&&d.importClause.name?.text===a);if(p){let d=p.moduleSpecifier;if(!e.ts.isStringLiteral(d))return null;n.exportName="default"}else{let d=c.find(m=>!m.importClause||!m.importClause.namedBindings||!e.ts.isNamedImports(m.importClause.namedBindings)?!1:m.importClause.namedBindings.elements.some(h=>h.name.text===a));if(!d)return null;let f=d.moduleSpecifier;if(!e.ts.isStringLiteral(f))return null;n.exportName=a}continue}}return n=Ut(e,n,t),n.filePath&&n.exportName&&(n.id=await Be(e,n.filePath,n.exportName,n.externalImportPath)),n}function Pr(e,r){let t=[...r.statements],n=!1;for(let i=r.statements.length-1;i>=0;i--){let s=r.statements[i];if(e.ts.isImportDeclaration(s)&&s.importClause){let o=!1,a=s.importClause.namedBindings;if(a&&e.ts.isNamedImports(a)&&a.elements){let l=[...a.elements];for(let u=l.length-1;u>=0;u--){let c=l[u];if(e.ts.isImportSpecifier(c)){let p=c.name;if(p&&e.ts.isIdentifier(p)){let d=p.text;_f(e,r,d)||l.splice(u,1)}}}if(l.length===0)o=!0;else if(a.elements.length!==l.length){let u=e.ts.factory.updateImportClause(s.importClause,!1,s.importClause.name,e.ts.factory.createNamedImports(l)),c=e.ts.factory.updateImportDeclaration(s,void 0,u,s.moduleSpecifier,void 0);t[i]=c,n=!0}}else if(s.importClause.name&&e.ts.isIdentifier(s.importClause.name)){let l=s.importClause.name.text;_f(e,r,l)||(o=!0)}o&&(t.splice(i,1),n=!0)}}return n?e.ts.factory.updateSourceFile(r,t):r}function _f(e,r,t){let n=!1;function i(s){if(!e.ts.isImportDeclaration(s)){if(e.ts.isIdentifier(s)&&s.text===t){n=!0;return}e.ts.forEachChild(s,i)}}return e.ts.forEachChild(r,i),n}function Ir(e,r,t,n,i,s,o){let a=null,l=null,u=null,c=-1;r=zt(r),t=zt(t);let p=r.find(f=>f.id===e),d=t.find(f=>f.id===e);if(n)d||(a={...zt(p),inputs:zt(p.inputs).map(f=>(f.isRegistered=!0,f))},c=t.length,t.push(a));else if(typeof d?.nodeIndex=="number"&&d.nodeIndex>-1){if(i)c=d.nodeIndex,l=zt(d),t=t.filter(f=>f.id!==e);else if(s!=null)U0(d,s),c=d.nodeIndex,u=d;else if(o!=null){let f=d.inputs.find(m=>m.name===o.name);f&&(o.registerInput===!1?f.isRegistered=!1:(j0(f,o),f.isRegistered=!0),u=d,c=d.nodeIndex)}}return{addCmpToRegistry:a,removeCmpFromRegistry:l,updateRegisteredCmp:u,nodeIndex:c,components:ur(r,t)}}function ur(e,r){let t=$t([...r.map(n=>(n.isRegistered=!0,n)),...e.filter(n=>!r.some(i=>i.id===n.id)).map(n=>(n.isRegistered=!1,n))]);return t.forEach(n=>{n.inputs=n.inputs.map(Zl),n.inputs.sort((o,a)=>o.name.toLowerCase().localeCompare(a.name.toLowerCase()));let i=r.find(o=>o.id===n.id);i&&(i.acceptsChildren=Ql(n));let s=e.find(o=>o.id===n.id&&o.externalImportPath);s&&(n.filePath=s.filePath,n.relFilePath=s.relFilePath)}),t}function U0(e,r){It(r.name)?e.name=r.name:r.name===null&&(e.name=e.importName),It(r.description)?e.description=r.description:r.description===null&&delete e.description,It(r.image)?e.image=r.image:r.image===null&&delete e.image}function j0(e,r){It(r.type)&&(e.type=r.type),It(r.friendlyName)?e.friendlyName=r.friendlyName:r.friendlyName===null&&delete e.friendlyName,It(r.defaultValue)||ms(r.defaultValue)||gi(r.defaultValue)?e.defaultValue=r.defaultValue:r.defaultValue===null&&delete e.defaultValue,It(r.helperText)?e.helperText=r.helperText:r.helperText===null&&delete e.helperText,r.required===!0?e.required=r.required:(r.required===null||r.required===!1)&&delete e.required}async function En(e){let r=new Set,t=async i=>{let s=await e.readdir(i);await Promise.all(s.map(async o=>{if(o.startsWith(".")||o==="node_modules")return;let a=e.join(i,o),l=e.extname(o).toLowerCase();if(l===".tsx"||l===".jsx"||l===".ts"||l===".js"){r.add(a);return}(await e.stat(a)).isDirectory()&&await t(a)}))};return await t(e.getAppRootDir()),await at(e,[...r])}function Nr(e,r,t){return Ei(e,r,t.variableName)?r:K0(e,r,t)}function K0(e,r,t){let n=typeof t.arrayType=="string"?e.ts.factory.createArrayTypeNode(e.ts.factory.createTypeReferenceNode(t.arrayType,void 0)):void 0,i=e.ts.factory.createArrayLiteralExpression([]),s=e.ts.factory.createVariableDeclaration(t.variableName,void 0,n,i),o=e.ts.factory.createVariableDeclarationList([s],e.ts.NodeFlags.Const),a=e.ts.factory.createModifier(e.ts.SyntaxKind.ExportKeyword),l=e.ts.factory.createVariableStatement([a],o),u=[...r.statements,l];return e.ts.factory.updateSourceFile(r,u)}async function Fr(e,r,t,n,i,s,o,a){let l=await En(e),[u,c,p,d]=await Promise.all([Tf(e,l),Nf(e),qt(e),ys(e)]),f=u.map(C=>C.cmpInfo),m=c.components,h={components:ur(f,m),registryPath:e.registryPath,registryDisplayPath:Ie(e,e.registryPath),frameworks:e.getFrameworks(),dependencies:Tr(f),publicApiKey:d.envValue??void 0,devToolsVersion:e.version};if(a)return h.components=await Si(e,h.components),h;let g=!1,y=c.sourceFile,D=Array.isArray(r)?r:typeof r=="string"?[r]:[];if(D.length>0){let C=D.map(E=>{let T=u.find(O=>O.cmpInfo.id===E);if(!T)throw new Error(`Component ${E} not found`);return T}),x=Array.from(new Set(C.map(E=>E.cmpInfo.filePath))),b=await at(e,x);for(let E of C){let T=h.components.find(U=>U.id===E.cmpInfo.id),O=await wi(e,E,b,e.registryPath===E.cmpInfo.filePath||pt(E.cmpInfo.filePath));Wt(T,O);let L=f.findIndex(U=>U.id===E.cmpInfo.id);f[L].inputs=O;let N=Ir(E.cmpInfo.id,f,m,t,n,i,s);if(e.sdkVersion===ne.gen2){let{elements:U,elmIndex:oe,statementIndex:G,statement:P,variableDeclaration:B}=await q0(e,y,E);if(N.addCmpToRegistry)U.push(z0(e,N.addCmpToRegistry)),g=!0;else if(N.removeCmpFromRegistry)U.splice(oe,1),g=!0;else if(N.updateRegisteredCmp){let re=lt(e,U[oe],N.updateRegisteredCmp);U[oe]=e.ts.factory.updateObjectLiteralExpression(re,[Of(e,N.updateRegisteredCmp),...re.properties.slice(1)]),g=!0}if(g&&o){let re=[...y.statements];re[G]=e.ts.factory.updateVariableStatement(P,P.modifiers,e.ts.factory.updateVariableDeclarationList(P.declarationList,[e.ts.factory.updateVariableDeclaration(B,B.name,B.exclamationToken,B.type,e.ts.factory.createArrayLiteralExpression(vr(e,U)))])),y=e.ts.factory.updateSourceFile(y,re),y=kf(e,N,y),y=Ce(e,y,{namedImports:["RegisteredComponent"],importPath:"@builder.io/sdk-react",isTypeOnly:!0}),y=Nr(e,y,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),h.components=N.components,m=N.components.filter(F=>F.isRegistered)}}else{let U=[...y.statements];N.addCmpToRegistry?(U.push(yf(e,N.addCmpToRegistry)),g=!0):N.removeCmpFromRegistry?(U.splice(N.nodeIndex,1),g=!0):N.updateRegisteredCmp&&(U[N.nodeIndex]=eu(e,U[N.nodeIndex],N.updateRegisteredCmp),g=!0),g&&o&&(y=e.ts.factory.updateSourceFile(y,U),y=Ce(e,y,{namedImports:["Builder","builder"],importPath:"@builder.io/react"}),y=Ff(e,y,p),y=kf(e,N,y),T?.acceptsChildren&&(y=Ce(e,y,{namedImports:["withChildren"],importPath:"@builder.io/react"})),h.components=N.components,m=N.components.filter(oe=>oe.isRegistered))}}}if(g&&o){y=Pr(e,y),y=Ar(e,y),e.appDir&&(y=If(e,y));let C=ct(e,y);C=lr(C),e.appDir&&(C=Pf(C)),C=await e.formatCode(e.registryPath,C),await e.writeFile(e.registryPath,C)}return h}function Of(e,r){let t=e.ts.factory.createIdentifier(r.importName);return e.appDir?e.ts.factory.createPropertyAssignment("component",t):e.ts.factory.createPropertyAssignment("component",W0(e,r))}function V0(e){return e.ts.factory.createPropertyAssignment("canHaveChildren",e.ts.factory.createTrue())}function z0(e,r){return lt(e,e.ts.factory.createObjectLiteralExpression([Of(e,r),...r.acceptsChildren?[V0(e)]:[]],!0),r)}async function q0(e,r,t){let n=it(e,r,"CUSTOM_COMPONENTS");if(!n)throw new Error(`Exported name of the Builder registry must be "CUSTOM_COMPONENTS". Please update your Builder registry file: ${e.registryPath}`);let i=n.arrayLiteralExp.elements.filter(o=>e.ts.isObjectLiteralExpression(o)),s=-1;for(let o=0;o<i.length;o++)if((await ou(e,r,i[o]))?.id===t.cmpInfo.id){s=o;break}return{...n,elements:i,elmIndex:s}}function kf(e,r,t){if(e.appDir){let n=r.addCmpToRegistry||r.updateRegisteredCmp;if(n){let i=n.externalImportPath?n.externalImportPath:Se(e,e.registryPath,n.filePath);n.exportType==="default"?t=Ce(e,t,{defaultImport:n.importName,importPath:i}):n.exportType==="named"&&(t=Ce(e,t,{namedImports:[n.importName],importPath:i}))}}else t=Ce(e,t,{defaultImport:"dynamic",importPath:"next/dynamic"});return t}function W0(e,r){let t=r.externalImportPath?r.externalImportPath:Se(e,e.registryPath,r.filePath),n=r.exportName!=="default",i;n?i=e.ts.factory.createPropertyAccessExpression(e.ts.factory.createAwaitExpression(e.ts.factory.createCallExpression(e.ts.factory.createIdentifier("import"),void 0,[e.ts.factory.createStringLiteral(t)])),e.ts.factory.createIdentifier(r.exportName)):i=e.ts.factory.createCallExpression(e.ts.factory.createIdentifier("import"),void 0,[e.ts.factory.createStringLiteral(t)]);let s=e.ts.factory.createArrowFunction(n?[e.ts.factory.createModifier(e.ts.SyntaxKind.AsyncKeyword)]:void 0,void 0,[],void 0,e.ts.factory.createToken(e.ts.SyntaxKind.EqualsGreaterThanToken),i);return e.ts.factory.createCallExpression(e.ts.factory.createIdentifier("dynamic"),void 0,[s])}async function Lf(e){let r=[],t=await X0(e,r);return await jf(e,r,t),e.appDir?(e.debug(`ensure builder setup for next.js app ${e.appDir}`),await H0(e,e.appDir,r)):e.pagesDir&&(e.debug(`ensure builder setup for next.js pages ${e.pagesDir}`),await J0(e,e.pagesDir,r)),r}async function Bf(e){let r=[];return await jf(e,r),e.appDir?(e.debug(`ensure figma-imports setup for next.js app ${e.appDir}`),await G0(e,e.appDir,r)):e.pagesDir&&(e.debug(`ensure figma-imports setup for next.js pages ${e.pagesDir}`),await Y0(e,e.pagesDir,r)),r}async function G0(e,r,t){let n=`page.${e.typescriptEnabled?"tsx":"jsx"}`,i=e.join(r,"figma-imports",n);if(!await e.exists(i)){let s=await e.formatCode(i,$f({sys:e,routePath:i,modelName:"figma-imports"}));await e.writeFile(i,s),t.push({filePath:i,modifiedType:"create"})}if(!await e.exists(e.builderComponentPath)){let s=await e.formatCode(e.builderComponentPath,Mf(e));await e.writeFile(e.builderComponentPath,s),t.push({filePath:e.builderComponentPath,modifiedType:"create"})}}async function H0(e,r,t){let n=`page.${e.typescriptEnabled?"tsx":"jsx"}`,i=e.join(r,"[...page]",n);if(!await e.exists(i)){let s=await e.formatCode(i,$f({sys:e,routePath:i,modelName:"page"}));await e.writeFile(i,s),t.push({filePath:i,modifiedType:"create"})}if(!await e.exists(e.builderComponentPath)){let s=await e.formatCode(e.builderComponentPath,Mf(e));await e.writeFile(e.builderComponentPath,s),t.push({filePath:e.builderComponentPath,modifiedType:"create"})}}function Mf(e){let r=e.typescriptEnabled;return e.sdkVersion===ne.gen2?`
|
|
108
|
+
${e}`),e}function If(e,r){let t=r.statements.filter(n=>!(e.ts.isExpressionStatement(n)&&e.ts.isStringLiteral(n.expression)&&e.ts.isStringLiteral(n.expression)&&n.expression.text==="use client"));return e.ts.factory.updateSourceFile(r,t)}function vr(e,r){return r.sort((t,n)=>{if(e.ts.isObjectLiteralExpression(t)&&e.ts.isObjectLiteralExpression(n)){let i=vf(e,t),s=vf(e,n);return i.toLocaleLowerCase().localeCompare(s.toLocaleLowerCase())}return 1})}function vf(e,r){let t=r.properties.find(n=>Ne(e,n)==="name");return t&&e.ts.isPropertyAssignment(t)&&e.ts.isStringLiteral(t.initializer)?t.initializer.text:"zzzz"}async function Nf(e){let r=await e.readFile(e.registryPath);return r?B0(e,r):{components:[],sourceFile:Ee(e,"")}}async function B0(e,r){let t=Ee(e,r);return e.sdkVersion===ne.gen2?$0(e,t):M0(e,t)}async function M0(e,r){let t=[];for(let n=0;n<r.statements.length;n++){let i=r.statements[n];if(!e.ts.isExpressionStatement(i))continue;let s=i.expression;if(!e.ts.isCallExpression(s))continue;let o=s.expression;if(!e.ts.isPropertyAccessExpression(o))continue;let a=o.expression;if(!e.ts.isIdentifier(a)||a.text!=="Builder"||o.name.text!=="registerComponent")continue;let u=s.arguments;if(u.length<2)continue;let c=u[1];if(!e.ts.isObjectLiteralExpression(c))continue;let p=u[0];if(e.ts.isCallExpression(p)){let d=e.ts.isIdentifier(p.expression)&&p.expression.text;if(d==="withChildren"){let m=su(e,p.arguments[0]);if(e.ts.isCallExpression(m)){let h=await nu(e,n,m,c,!0);h&&t.push(h)}else{let h=m;if(e.ts.isIdentifier(h)){let g=await iu(e,r,n,h,c,!0);g&&t.push(g)}}continue}if(d==="dynamic"){let m=await nu(e,n,p,c,!1);m&&t.push(m);continue}let f=su(e,p.arguments[0]);if(e.ts.isCallExpression(f)&&e.ts.isIdentifier(f.expression)&&f.expression.text==="dynamic"){let m=await nu(e,n,f,c,!1);m&&t.push(m);continue}if(e.ts.isIdentifier(f)){let m=await iu(e,r,n,f,c,!1);m&&t.push(m);continue}continue}if(e.ts.isIdentifier(p)){let d=await iu(e,r,n,p,c,!1);d&&t.push(d);continue}}return{sourceFile:r,components:$t(t)}}function su(e,r){return e.ts.isCallExpression(r)?(e.ts.isIdentifier(r.expression)&&r.expression.text)==="dynamic"?r:su(e,r.arguments[0]):r}async function nu(e,r,t,n,i){let s={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],nodeIndex:r,acceptsChildren:i},o=t.arguments;if(o.length===0)return null;let a=o[0];if(!e.ts.isArrowFunction(a))return null;let l=a.body;if(e.ts.isCallExpression(l)){if(l.expression.kind!==e.ts.SyntaxKind.ImportKeyword||l.arguments.length!==1)return null;let c=l.arguments[0];if(!e.ts.isStringLiteral(c))return null;let p=c.text,d=await Ti(e,p);s.filePath=d,s.relFilePath=e.relative(e.getAppRootDir(),s.filePath),await e.exists(d)?s.importPath=Re(e,s.filePath):(s.externalImportPath=p,s.importPath=s.externalImportPath),s.name=er(e,s.filePath),s.importName="default",s.exportName="default",s.exportType="default"}else if(e.ts.isPropertyAccessExpression(l)){let u=l.expression;if(!e.ts.isParenthesizedExpression(u))return null;let c=u.expression;if(!e.ts.isAwaitExpression(c))return null;let p=c.expression;if(!e.ts.isCallExpression(p)||p.expression.kind!==e.ts.SyntaxKind.ImportKeyword||p.arguments.length!==1)return null;let f=p.arguments[0];if(!e.ts.isStringLiteral(f)||!e.ts.isIdentifier(l.name))return null;let m=f.text,h=await Ti(e,m);s.filePath=h,s.relFilePath=e.relative(e.getAppRootDir(),s.filePath),await e.exists(h)?s.importPath=Re(e,s.filePath):(s.externalImportPath=m,s.importPath=s.externalImportPath),s.name=$e(l.name.text),s.importName=l.name.text,s.exportName=l.name.text,s.exportType="named"}else return null;return s=Ut(e,s,n),s.displayFilePath=Ie(e,s.filePath),s.filePath&&s.exportName&&(s.id=await Le(e,s.filePath,s.exportName,s.externalImportPath)),s}async function iu(e,r,t,n,i,s){let o={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],nodeIndex:t,acceptsChildren:s},a=r.statements.filter(u=>e.ts.isImportDeclaration(u)),l=a.find(u=>u.importClause&&u.importClause.name?.text===n.text);if(l){let u=l.moduleSpecifier;if(!e.ts.isStringLiteral(u))return null;let c=await Ti(e,u.text);o.filePath=c,o.relFilePath=e.relative(e.getAppRootDir(),o.filePath),await e.exists(c)?o.importPath=Re(e,o.filePath):(o.externalImportPath=u.text,o.importPath=o.externalImportPath),o.name=er(e,o.filePath),o.importName=n.text,o.exportName="default",o.exportType="default"}else{let u=a.find(d=>!d.importClause||!d.importClause.namedBindings||!e.ts.isNamedImports(d.importClause.namedBindings)?!1:d.importClause.namedBindings.elements.some(f=>f.name.text===n.text));if(!u)return null;let c=u.moduleSpecifier;if(!e.ts.isStringLiteral(c))return null;let p=await Ti(e,c.text);o.filePath=p,o.relFilePath=e.relative(e.getAppRootDir(),o.filePath),await e.exists(p)?o.importPath=Re(e,o.filePath):(o.externalImportPath=c.text,o.importPath=o.externalImportPath),o.name=$e(n.text),o.importName=n.text,o.exportName=n.text,o.exportType="named"}return o=Ut(e,o,i),o.displayFilePath=Ie(e,o.filePath),o.filePath&&o.exportName&&(o.id=await Le(e,o.filePath,o.exportName,o.externalImportPath)),o}function Ti(e,r){return Es(e,e.normalize(e.resolve(e.dirname(e.registryPath),r)))}function Ff(e,r,t){let n=!1,i=0,s=[...r.statements];for(let u=0;u<s.length;u++){let c=s[u];if(e.ts.isImportDeclaration(c)){i=u;continue}if(!e.ts.isExpressionStatement(c))continue;let p=c.expression;if(!e.ts.isCallExpression(p))continue;let d=p.expression;if(!e.ts.isPropertyAccessExpression(d))continue;let f=d.expression;if(!e.ts.isIdentifier(f)||f.text!=="builder")continue;if(d.name.text=="init"){n=!0;break}else continue}if(n)return r;let o=e.ts.factory.createPropertyAccessExpression(e.ts.factory.createPropertyAccessExpression(e.ts.factory.createIdentifier("process"),e.ts.factory.createIdentifier("env")),e.ts.factory.createIdentifier(Sr)),a=t?e.ts.factory.createNonNullExpression(o):o,l=e.ts.factory.createExpressionStatement(e.ts.factory.createCallExpression(e.ts.factory.createPropertyAccessExpression(e.ts.factory.createIdentifier("builder"),e.ts.factory.createIdentifier("init")),void 0,[a]));return s.splice(i+1,0,l),e.ts.factory.updateSourceFile(r,s)}async function $0(e,r){let t=[],n=it(e,r,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(i,s)=>{let o=await ou(e,r,i);o&&(o.nodeIndex=s,t.push(o))})),{sourceFile:r,components:$t(t)}}async function ou(e,r,t){if(!e.ts.isObjectLiteralExpression(t))return null;let n={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],acceptsChildren:!1};xi(e,t)&&(n.acceptsChildren=!0);for(let s of t.properties){if(!e.ts.isPropertyAssignment(s)||!e.ts.isIdentifier(s.name))continue;if(Ne(e,s)==="component"){let a,{initializer:l}=s;if(e.ts.isCallExpression(l)&&(e.ts.isIdentifier(l.expression)&&l.expression.text)==="dynamic"){let f=l.arguments;if(f.length===0)return null;let m=f[0];if(!e.ts.isArrowFunction(m))return null;let h=m.body;if(e.ts.isCallExpression(h)){if(h.expression.kind!==e.ts.SyntaxKind.ImportKeyword||h.arguments.length!==1)return null;let y=h.arguments[0];if(!e.ts.isStringLiteral(y))return null;let D=y.text,C=await Ti(e,D);n.filePath=C,n.relFilePath=e.relative(e.getAppRootDir(),n.filePath),await e.exists(C)?n.importPath=Re(e,n.filePath):(n.externalImportPath=D,n.importPath=n.externalImportPath),n.name=er(e,n.filePath),n.importName="default",n.exportName="default",n.exportType="default"}else if(e.ts.isPropertyAccessExpression(h)){let g=h.expression;if(!e.ts.isParenthesizedExpression(g))return null;let y=g.expression;if(!e.ts.isAwaitExpression(y))return null;let D=y.expression;if(!e.ts.isCallExpression(D)||D.expression.kind!==e.ts.SyntaxKind.ImportKeyword||D.arguments.length!==1)return null;let x=D.arguments[0];if(!e.ts.isStringLiteral(x)||!e.ts.isIdentifier(h.name))return null;let b=x.text,E=await Ti(e,b);n.filePath=E,n.relFilePath=e.relative(e.getAppRootDir(),n.filePath),await e.exists(E)?n.importPath=Re(e,n.filePath):(n.externalImportPath=b,n.importPath=n.externalImportPath),n.name=$e(h.name.text),n.importName=h.name.text,n.exportName=h.name.text,n.exportType="named"}else return null;return n=Ut(e,n,t),n.displayFilePath=Ie(e,n.filePath),n.filePath&&n.exportName&&(n.id=await Le(e,n.filePath,n.exportName,n.externalImportPath)),n}if(e.ts.isIdentifier(l)&&(a=l.text),!a)continue;n.name===""&&(n.name=$e(a)),n.importName=a;let u=await wr(e,e.registryPath,r,a);if(!u)continue;n.filePath=u.filePath,n.relFilePath=u.relFilePath,await e.exists(u.filePath)?n.importPath=Re(e,u.filePath):(n.externalImportPath=u.importPath,n.importPath=n.externalImportPath),n.importPath=Re(e,u.filePath),n.displayFilePath=u.displayFilePath,n.exportType=u.exportType;let c=r.statements.filter(d=>e.ts.isImportDeclaration(d)),p=c.find(d=>d.importClause&&d.importClause.name?.text===a);if(p){let d=p.moduleSpecifier;if(!e.ts.isStringLiteral(d))return null;n.exportName="default"}else{let d=c.find(m=>!m.importClause||!m.importClause.namedBindings||!e.ts.isNamedImports(m.importClause.namedBindings)?!1:m.importClause.namedBindings.elements.some(h=>h.name.text===a));if(!d)return null;let f=d.moduleSpecifier;if(!e.ts.isStringLiteral(f))return null;n.exportName=a}continue}}return n=Ut(e,n,t),n.filePath&&n.exportName&&(n.id=await Le(e,n.filePath,n.exportName,n.externalImportPath)),n}function Pr(e,r){let t=[...r.statements],n=!1;for(let i=r.statements.length-1;i>=0;i--){let s=r.statements[i];if(e.ts.isImportDeclaration(s)&&s.importClause){let o=!1,a=s.importClause.namedBindings;if(a&&e.ts.isNamedImports(a)&&a.elements){let l=[...a.elements];for(let u=l.length-1;u>=0;u--){let c=l[u];if(e.ts.isImportSpecifier(c)){let p=c.name;if(p&&e.ts.isIdentifier(p)){let d=p.text;_f(e,r,d)||l.splice(u,1)}}}if(l.length===0)o=!0;else if(a.elements.length!==l.length){let u=e.ts.factory.updateImportClause(s.importClause,!1,s.importClause.name,e.ts.factory.createNamedImports(l)),c=e.ts.factory.updateImportDeclaration(s,void 0,u,s.moduleSpecifier,void 0);t[i]=c,n=!0}}else if(s.importClause.name&&e.ts.isIdentifier(s.importClause.name)){let l=s.importClause.name.text;_f(e,r,l)||(o=!0)}o&&(t.splice(i,1),n=!0)}}return n?e.ts.factory.updateSourceFile(r,t):r}function _f(e,r,t){let n=!1;function i(s){if(!e.ts.isImportDeclaration(s)){if(e.ts.isIdentifier(s)&&s.text===t){n=!0;return}e.ts.forEachChild(s,i)}}return e.ts.forEachChild(r,i),n}function Ir(e,r,t,n,i,s,o){let a=null,l=null,u=null,c=-1;r=zt(r),t=zt(t);let p=r.find(f=>f.id===e),d=t.find(f=>f.id===e);if(n)d||(a={...zt(p),inputs:zt(p.inputs).map(f=>(f.isRegistered=!0,f))},c=t.length,t.push(a));else if(typeof d?.nodeIndex=="number"&&d.nodeIndex>-1){if(i)c=d.nodeIndex,l=zt(d),t=t.filter(f=>f.id!==e);else if(s!=null)U0(d,s),c=d.nodeIndex,u=d;else if(o!=null){let f=d.inputs.find(m=>m.name===o.name);f&&(o.registerInput===!1?f.isRegistered=!1:(j0(f,o),f.isRegistered=!0),u=d,c=d.nodeIndex)}}return{addCmpToRegistry:a,removeCmpFromRegistry:l,updateRegisteredCmp:u,nodeIndex:c,components:ur(r,t)}}function ur(e,r){let t=$t([...r.map(n=>(n.isRegistered=!0,n)),...e.filter(n=>!r.some(i=>i.id===n.id)).map(n=>(n.isRegistered=!1,n))]);return t.forEach(n=>{n.inputs=n.inputs.map(Zl),n.inputs.sort((o,a)=>o.name.toLowerCase().localeCompare(a.name.toLowerCase()));let i=r.find(o=>o.id===n.id);i&&(i.acceptsChildren=Ql(n));let s=e.find(o=>o.id===n.id&&o.externalImportPath);s&&(n.filePath=s.filePath,n.relFilePath=s.relFilePath)}),t}function U0(e,r){It(r.name)?e.name=r.name:r.name===null&&(e.name=e.importName),It(r.description)?e.description=r.description:r.description===null&&delete e.description,It(r.image)?e.image=r.image:r.image===null&&delete e.image}function j0(e,r){It(r.type)&&(e.type=r.type),It(r.friendlyName)?e.friendlyName=r.friendlyName:r.friendlyName===null&&delete e.friendlyName,It(r.defaultValue)||ms(r.defaultValue)||gi(r.defaultValue)?e.defaultValue=r.defaultValue:r.defaultValue===null&&delete e.defaultValue,It(r.helperText)?e.helperText=r.helperText:r.helperText===null&&delete e.helperText,r.required===!0?e.required=r.required:(r.required===null||r.required===!1)&&delete e.required}async function En(e){let r=new Set,t=async i=>{let s=await e.readdir(i);await Promise.all(s.map(async o=>{if(o.startsWith(".")||o==="node_modules")return;let a=e.join(i,o),l=e.extname(o).toLowerCase();if(l===".tsx"||l===".jsx"||l===".ts"||l===".js"){r.add(a);return}(await e.stat(a)).isDirectory()&&await t(a)}))};return await t(e.getAppRootDir()),await at(e,[...r])}function Nr(e,r,t){return Ei(e,r,t.variableName)?r:K0(e,r,t)}function K0(e,r,t){let n=typeof t.arrayType=="string"?e.ts.factory.createArrayTypeNode(e.ts.factory.createTypeReferenceNode(t.arrayType,void 0)):void 0,i=e.ts.factory.createArrayLiteralExpression([]),s=e.ts.factory.createVariableDeclaration(t.variableName,void 0,n,i),o=e.ts.factory.createVariableDeclarationList([s],e.ts.NodeFlags.Const),a=e.ts.factory.createModifier(e.ts.SyntaxKind.ExportKeyword),l=e.ts.factory.createVariableStatement([a],o),u=[...r.statements,l];return e.ts.factory.updateSourceFile(r,u)}async function Fr(e,r,t,n,i,s,o,a){let l=await En(e),[u,c,p,d]=await Promise.all([Tf(e,l),Nf(e),qt(e),ys(e)]),f=u.map(C=>C.cmpInfo),m=c.components,h={components:ur(f,m),registryPath:e.registryPath,registryDisplayPath:Ie(e,e.registryPath),frameworks:e.getFrameworks(),dependencies:Tr(f),publicApiKey:d.envValue??void 0,devToolsVersion:e.version};if(a)return h.components=await Si(e,h.components),h;let g=!1,y=c.sourceFile,D=Array.isArray(r)?r:typeof r=="string"?[r]:[];if(D.length>0){let C=D.map(E=>{let T=u.find(O=>O.cmpInfo.id===E);if(!T)throw new Error(`Component ${E} not found`);return T}),x=Array.from(new Set(C.map(E=>E.cmpInfo.filePath))),b=await at(e,x);for(let E of C){let T=h.components.find(U=>U.id===E.cmpInfo.id),O=await wi(e,E,b,e.registryPath===E.cmpInfo.filePath||pt(E.cmpInfo.filePath));Wt(T,O);let L=f.findIndex(U=>U.id===E.cmpInfo.id);f[L].inputs=O;let N=Ir(E.cmpInfo.id,f,m,t,n,i,s);if(e.sdkVersion===ne.gen2){let{elements:U,elmIndex:oe,statementIndex:G,statement:P,variableDeclaration:B}=await q0(e,y,E);if(N.addCmpToRegistry)U.push(z0(e,N.addCmpToRegistry)),g=!0;else if(N.removeCmpFromRegistry)U.splice(oe,1),g=!0;else if(N.updateRegisteredCmp){let re=lt(e,U[oe],N.updateRegisteredCmp);U[oe]=e.ts.factory.updateObjectLiteralExpression(re,[Of(e,N.updateRegisteredCmp),...re.properties.slice(1)]),g=!0}if(g&&o){let re=[...y.statements];re[G]=e.ts.factory.updateVariableStatement(P,P.modifiers,e.ts.factory.updateVariableDeclarationList(P.declarationList,[e.ts.factory.updateVariableDeclaration(B,B.name,B.exclamationToken,B.type,e.ts.factory.createArrayLiteralExpression(vr(e,U)))])),y=e.ts.factory.updateSourceFile(y,re),y=kf(e,N,y),y=Ce(e,y,{namedImports:["RegisteredComponent"],importPath:"@builder.io/sdk-react",isTypeOnly:!0}),y=Nr(e,y,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),h.components=N.components,m=N.components.filter(F=>F.isRegistered)}}else{let U=[...y.statements];N.addCmpToRegistry?(U.push(yf(e,N.addCmpToRegistry)),g=!0):N.removeCmpFromRegistry?(U.splice(N.nodeIndex,1),g=!0):N.updateRegisteredCmp&&(U[N.nodeIndex]=eu(e,U[N.nodeIndex],N.updateRegisteredCmp),g=!0),g&&o&&(y=e.ts.factory.updateSourceFile(y,U),y=Ce(e,y,{namedImports:["Builder","builder"],importPath:"@builder.io/react"}),y=Ff(e,y,p),y=kf(e,N,y),T?.acceptsChildren&&(y=Ce(e,y,{namedImports:["withChildren"],importPath:"@builder.io/react"})),h.components=N.components,m=N.components.filter(oe=>oe.isRegistered))}}}if(g&&o){y=Pr(e,y),y=Ar(e,y),e.appDir&&(y=If(e,y));let C=ct(e,y);C=lr(C),e.appDir&&(C=Pf(C)),C=await e.formatCode(e.registryPath,C),await e.writeFile(e.registryPath,C)}return h}function Of(e,r){let t=e.ts.factory.createIdentifier(r.importName);return e.appDir?e.ts.factory.createPropertyAssignment("component",t):e.ts.factory.createPropertyAssignment("component",W0(e,r))}function V0(e){return e.ts.factory.createPropertyAssignment("canHaveChildren",e.ts.factory.createTrue())}function z0(e,r){return lt(e,e.ts.factory.createObjectLiteralExpression([Of(e,r),...r.acceptsChildren?[V0(e)]:[]],!0),r)}async function q0(e,r,t){let n=it(e,r,"CUSTOM_COMPONENTS");if(!n)throw new Error(`Exported name of the Builder registry must be "CUSTOM_COMPONENTS". Please update your Builder registry file: ${e.registryPath}`);let i=n.arrayLiteralExp.elements.filter(o=>e.ts.isObjectLiteralExpression(o)),s=-1;for(let o=0;o<i.length;o++)if((await ou(e,r,i[o]))?.id===t.cmpInfo.id){s=o;break}return{...n,elements:i,elmIndex:s}}function kf(e,r,t){if(e.appDir){let n=r.addCmpToRegistry||r.updateRegisteredCmp;if(n){let i=n.externalImportPath?n.externalImportPath:Se(e,e.registryPath,n.filePath);n.exportType==="default"?t=Ce(e,t,{defaultImport:n.importName,importPath:i}):n.exportType==="named"&&(t=Ce(e,t,{namedImports:[n.importName],importPath:i}))}}else t=Ce(e,t,{defaultImport:"dynamic",importPath:"next/dynamic"});return t}function W0(e,r){let t=r.externalImportPath?r.externalImportPath:Se(e,e.registryPath,r.filePath),n=r.exportName!=="default",i;n?i=e.ts.factory.createPropertyAccessExpression(e.ts.factory.createAwaitExpression(e.ts.factory.createCallExpression(e.ts.factory.createIdentifier("import"),void 0,[e.ts.factory.createStringLiteral(t)])),e.ts.factory.createIdentifier(r.exportName)):i=e.ts.factory.createCallExpression(e.ts.factory.createIdentifier("import"),void 0,[e.ts.factory.createStringLiteral(t)]);let s=e.ts.factory.createArrowFunction(n?[e.ts.factory.createModifier(e.ts.SyntaxKind.AsyncKeyword)]:void 0,void 0,[],void 0,e.ts.factory.createToken(e.ts.SyntaxKind.EqualsGreaterThanToken),i);return e.ts.factory.createCallExpression(e.ts.factory.createIdentifier("dynamic"),void 0,[s])}async function Lf(e){let r=[],t=await X0(e,r);return await jf(e,r,t),e.appDir?(e.debug(`ensure builder setup for next.js app ${e.appDir}`),await H0(e,e.appDir,r)):e.pagesDir&&(e.debug(`ensure builder setup for next.js pages ${e.pagesDir}`),await J0(e,e.pagesDir,r)),r}async function Bf(e){let r=[];return await jf(e,r),e.appDir?(e.debug(`ensure figma-imports setup for next.js app ${e.appDir}`),await G0(e,e.appDir,r)):e.pagesDir&&(e.debug(`ensure figma-imports setup for next.js pages ${e.pagesDir}`),await Y0(e,e.pagesDir,r)),r}async function G0(e,r,t){let n=`page.${e.typescriptEnabled?"tsx":"jsx"}`,i=e.join(r,"figma-imports",n);if(!await e.exists(i)){let s=await e.formatCode(i,$f({sys:e,routePath:i,modelName:"figma-imports"}));await e.writeFile(i,s),t.push({filePath:i,modifiedType:"create"})}if(!await e.exists(e.builderComponentPath)){let s=await e.formatCode(e.builderComponentPath,Mf(e));await e.writeFile(e.builderComponentPath,s),t.push({filePath:e.builderComponentPath,modifiedType:"create"})}}async function H0(e,r,t){let n=`page.${e.typescriptEnabled?"tsx":"jsx"}`,i=e.join(r,"[...page]",n);if(!await e.exists(i)){let s=await e.formatCode(i,$f({sys:e,routePath:i,modelName:"page"}));await e.writeFile(i,s),t.push({filePath:i,modifiedType:"create"})}if(!await e.exists(e.builderComponentPath)){let s=await e.formatCode(e.builderComponentPath,Mf(e));await e.writeFile(e.builderComponentPath,s),t.push({filePath:e.builderComponentPath,modifiedType:"create"})}}function Mf(e){let r=e.typescriptEnabled;return e.sdkVersion===ne.gen2?`
|
|
109
109
|
"use client";
|
|
110
110
|
import { ${r?"BuilderContent, ":""} isPreviewing, Content } from "@builder.io/sdk-react";
|
|
111
111
|
import DefaultErrorPage from "next/error";
|
|
@@ -466,11 +466,11 @@ export const CUSTOM_COMPONENTS: RegisteredComponent[] = [
|
|
|
466
466
|
];
|
|
467
467
|
`}async function Ai(e){let r=await Wr(e,e.getRepoRootDir());if(r&&typeof r=="object"){let t=new Set(Object.keys({...r.dependencies,...r.devDependencies}));if(t.has("@builder.io/sdk-react"))return ne.gen2;if(t.has("@builder.io/react"))return ne.gen1}return null}async function Kf(e){let r=await eS(e);return{builderPageOptions:async()=>({templateContentId:"3de2f13211234071a4b19a17b4fbc5a7",pathname:"/builder-demo",title:"Builder + Next.js Demo Page"}),ensureBuilderSetup:()=>Lf(r),ensureFigmaImportPage:()=>Bf(r),getRegistryPath:()=>r.registryPath,getRegistry:n=>Fr(r,null,!1,!1,null,null,!1,!!n?.readAllInputTypes),addExternalPackage:n=>{r.addExternalPackage(n)},loadComponent:async n=>{let i=await Fr(r,n.cmpId,!1,!1,null,null,!1,!1);return{...i,component:i.components.find(s=>s.id===n.cmpId)}},registerComponent:n=>Fr(r,n.cmpId,!0,!1,null,null,!0,!1),setRegisteredComponentInfo:n=>Fr(r,n.cmpId,!1,!1,n,null,!0,!1),setRegisteredComponentInput:n=>Fr(r,n.cmpId,!1,!1,null,n,!0,!1),unregisterComponent:n=>Fr(r,n.cmpId,!1,!0,null,null,!0,!1),getPublicApiKey:()=>ys(r),setPublicApiKey:n=>pf(r,n.publicApiKey),getDependencies:n=>n.sdkVersion===ne.gen2?[{name:"@builder.io/dev-tools"},{name:"@builder.io/sdk-react"}]:[{name:"@builder.io/dev-tools"},{name:"@builder.io/react"},{name:"@builder.io/sdk"}],getDevRunCommand:()=>"dev",getCache:()=>Er(r),setCache:n=>Cr(r,n)}}async function eS(e){let r=e.getAppRootDir(),t=e.join(r,"src"),n=await tS(e),i=await qt(e),s=e.getFrameworks().find(u=>u.name==="next"),o={asyncParams:s?.version?.major!==void 0&&s.version.major>=15},a={},l={...e,addExternalPackage:u=>{a[e.join(r,u,"index.ts")]=`export * from "${u}";`},readFileSync:u=>a[u]??e.readFileSync(u),existsSync:u=>!!a[u]||e.existsSync(u),readdirSync:u=>{let c=e.readdirSync(u);return u===r?[...c,...Object.keys(a).map(p=>p.slice(r.length+1))]:c},readdir:async u=>{let c=await e.readdir(u);return u===r?[...c,...Object.keys(a).map(p=>p.slice(r.length+1))]:c},appDir:null,pagesDir:null,srcDir:null,builderComponentPath:"",componentsDir:"",registryPath:"",nextConfigPath:n,typescriptEnabled:i,features:o};if(e.sdkVersion?l.sdkVersion=e.sdkVersion:l.sdkVersion=await Ai(l),await e.exists(t)){l.srcDir=t,l.componentsDir=e.join(t,"components");let u=e.join(t,"app");await e.exists(u)&&(l.appDir=u);let c=e.join(t,"pages");await e.exists(c)&&(l.pagesDir=c),l.registryPath=await tr(e,t)}else l.componentsDir=e.join(r,"components"),l.registryPath=await tr(e,r);if(l.builderComponentPath=e.join(l.componentsDir,`builder.${i?"tsx":"jsx"}`),!l.appDir){let u=e.join(r,"app");await e.exists(u)&&(l.appDir=u)}if(!l.pagesDir){let u=e.join(r,"pages");await e.exists(u)&&(l.pagesDir=u)}if(!l.appDir&&!l.pagesDir)throw new Error(`Could not find Next.js "app" or "pages" directory. Searched in "${r}".`);return l}async function tS(e){let r=e.join(e.getAppRootDir(),"next.config.ts");if(await e.exists(r))return r;let t=e.join(e.getAppRootDir(),"next.config.mjs");if(await e.exists(t))return t;let n=e.join(e.getAppRootDir(),"next.config.js");if(await e.exists(n))return n;throw new Error(`Could not find Next.js config file. Searched for "next.config.ts", "next.config.mjs" and "next.config.js" in "${e.getAppRootDir()}".`)}async function Cs(e){return await Dn(e,[".env"],zf)}async function Vf(e,r){rS(r);let t=await Cs(e),n=await bn(e,t.file,t.envKey,r);return{...t,modifiedType:n}}function rS(e){typeof process<"u"&&(process.env[zf]=e)}var zf="PUBLIC_BUILDER_API_KEY";function qf(e,r,t){if(t.length===0)return e;let n=e.split(`
|
|
468
468
|
`),i=n.findIndex(a=>a.includes(t));if(i===-1||n.some(a=>a.includes(r[0])))return e;let o=["/**",...r.map(a=>` * ${a.trim()}`)," */"];return n.splice(i,0,...o),n.join(`
|
|
469
|
-
`)}async function Gf(e,r){let t=[],n=r.getSourceFiles(),i=r.getTypeChecker();return await Promise.all(n.map(async s=>{let o=e.basename(s.fileName);if(o.startsWith(".")||sS.has(o))return;let a=e.normalize(s.fileName);if(a===e.registryPath)return;let l=await Uo(e,i,a,s);t.push(...l)})),t}async function Hf(e,r){if(e.extname(r).toLowerCase()===".tsx"){let n=await e.readFile(r);if(n)return nS(e,r,n)}return null}function nS(e,r,t){let n=Ee(e,t);return Uo(e,null,r,n)}async function Uo(e,r,t,n){t=e.normalize(t);let i=[],s=Vn(e,n);return await Promise.all(s.map(async o=>{let a=await iS(e,r,t,o);a&&i.push(a)})),i}async function iS(e,r,t,n){let i=e.relative(e.getAppRootDir(),t),s=
|
|
469
|
+
`)}async function Gf(e,r){let t=[],n=r.getSourceFiles(),i=r.getTypeChecker();return await Promise.all(n.map(async s=>{let o=e.basename(s.fileName);if(o.startsWith(".")||sS.has(o))return;let a=e.normalize(s.fileName);if(a===e.registryPath)return;let l=await Uo(e,i,a,s);t.push(...l)})),t}async function Hf(e,r){if(e.extname(r).toLowerCase()===".tsx"){let n=await e.readFile(r);if(n)return nS(e,r,n)}return null}function nS(e,r,t){let n=Ee(e,t);return Uo(e,null,r,n)}async function Uo(e,r,t,n){t=e.normalize(t);let i=[],s=Vn(e,n);return await Promise.all(s.map(async o=>{let a=await iS(e,r,t,o);a&&i.push(a)})),i}async function iS(e,r,t,n){let i=e.relative(e.getAppRootDir(),t),s=Re(e,t);if(e.ts.isVariableStatement(n.node))for(let o of n.node.declarationList.declarations){let a=Wf(e,o.initializer);if(a&&e.ts.isIdentifier(o.name)){let l=o.name.text;return{cmpInfo:{id:await Le(e,t,l),displayFilePath:Ie(e,t),name:$e(l),inputs:[],exportName:n.isDefaultExport?"default":l,exportType:n.isDefaultExport?"default":"named",importName:l,filePath:t,relFilePath:i,importPath:s},node:a}}}else if(e.ts.isCallExpression(n.node)){let o=Wf(e,n.node);if(o)return{cmpInfo:{id:await Le(e,t,"default"),displayFilePath:Ie(e,t),name:er(e,t),inputs:[],exportName:"default",exportType:"default",importName:Un(e,t),filePath:t,relFilePath:i,importPath:s},node:o}}return null}function Wf(e,r){if(r&&e.ts.isCallExpression(r)&&e.ts.isIdentifier(r.expression)&&r.expression.text==="component$"&&r.arguments.length>0){let t=r.arguments[0];if(e.ts.isArrowFunction(t)||e.ts.isFunctionExpression(t))return{callExpression:r,fnNode:t}}return null}var sS=new Set(["node_modules","layout.tsx","404.tsx","router-head.tsx"]);async function Jf(e,r){let t=r.node.fnNode;if((e.ts.isArrowFunction(t)||e.ts.isFunctionExpression(t))&&t.parameters.length>0){let{sourceFile:i,typeChecker:s}=await Di(e,r.cmpInfo.filePath,null);if(!(await Uo(e,s,r.cmpInfo.filePath,i)).find(l=>l.cmpInfo.id===r.cmpInfo.id))throw new Error(`createComponentInputs() Could not find component ${r.cmpInfo.name} in ${r.cmpInfo.filePath}`);return Kn(e,s,t)}return[]}async function Yf(e){return au(e)}async function au(e){let r=[];return await e.exists(e.registryPath)||(await e.writeFile(e.registryPath,oS),r.push({filePath:e.registryPath,modifiedType:"create"})),r}var oS=`import type { RegisteredComponent } from "@builder.io/sdk-qwik";
|
|
470
470
|
|
|
471
471
|
export const CUSTOM_COMPONENTS: RegisteredComponent[] = [
|
|
472
472
|
];
|
|
473
|
-
`;async function Xf(e){await au(e);let r=await e.readFile(e.registryPath);return r?aS(e,r):{components:[],sourceFile:Ee(e,"")}}async function aS(e,r){let t=Ee(e,r);return lS(e,t)}async function lS(e,r){let t=[],n=it(e,r,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(i,s)=>{let o=await lu(e,r,i);o&&(o.nodeIndex=s,t.push(o))})),{sourceFile:r,components:$t(t)}}async function lu(e,r,t){if(!e.ts.isObjectLiteralExpression(t))return null;let n={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[]};for(let i of t.properties){if(!e.ts.isPropertyAssignment(i)||!e.ts.isIdentifier(i.name))continue;if(Ne(e,i)==="component"&&e.ts.isIdentifier(i.initializer)){let o=i.initializer.text;n.name===""&&(n.name=$e(o)),n.importName=o;let a=await wr(e,e.registryPath,r,o);if(!a)continue;n.filePath=a.filePath,n.relFilePath=a.relFilePath,n.importPath=Le(e,a.filePath),n.displayFilePath=a.displayFilePath,n.exportType=a.exportType;let l=await Hf(e,a.filePath);if(l&&l.length>0)if(l.length===1)n.exportName=l[0].cmpInfo.exportName;else{let u=l.find(c=>c.cmpInfo.exportName===o);u&&(n.exportName=u.cmpInfo.exportName)}continue}}return n=Ut(e,n,t),n.filePath&&n.exportName&&(n.id=await Be(e,n.filePath,n.exportName)),n}async function Qf(e){let r=new Set,t=async i=>{let s=await e.readdir(i);await Promise.all(s.map(async o=>{if(o.startsWith(".")||o==="node_modules")return;let a=e.join(i,o),l=e.extname(o).toLowerCase();if(l===".tsx"||l===".ts"){r.add(a);return}(await e.stat(a)).isDirectory()&&await t(a)}))};return await t(e.getAppRootDir()),await at(e,[...r])}async function zn(e,r,t,n,i,s,o,a){let l=await Qf(e),[u,c,p]=await Promise.all([Gf(e,l),Xf(e),Cs(e)]),d=u.map(h=>h.cmpInfo),f=c.components,m={components:ur(d,f),registryPath:e.registryPath,registryDisplayPath:Ie(e,e.registryPath),frameworks:e.getFrameworks(),dependencies:Tr(d),publicApiKey:p.envValue??void 0,devToolsVersion:e.version};if(a)return m;if(r!=null){let h=u.find(N=>N.cmpInfo.id===r);if(!h)throw new Error(`Component ${r} not found`);let g=c.sourceFile,y=m.components.find(N=>N.id===r),D=await Jf(e,h);Wt(y,D),r=Array.isArray(r)?r[0]:r;let C=Ir(r,d,f,t,n,i,s),{elements:x,elmIndex:b,statementIndex:E,statement:T,variableDeclaration:O}=await cS(e,g,h),L=!1;if(C.addCmpToRegistry?(x.push(uS(e,C.addCmpToRegistry)),L=!0):C.removeCmpFromRegistry?(x.splice(b,1),L=!0):C.updateRegisteredCmp&&(x[b]=lt(e,x[b],C.updateRegisteredCmp),L=!0),L&&o){let N=[...g.statements];N[E]=e.ts.factory.updateVariableStatement(T,T.modifiers,e.ts.factory.updateVariableDeclarationList(T.declarationList,[e.ts.factory.updateVariableDeclaration(O,O.name,O.exclamationToken,O.type,e.ts.factory.createArrayLiteralExpression(vr(e,x)))])),g=e.ts.factory.updateSourceFile(g,N),y.exportType==="named"?g=Ce(e,g,{namedImports:[y.importName],importPath:Se(e,e.registryPath,y.filePath)}):g=Ce(e,g,{defaultImport:y.importName,importPath:Se(e,e.registryPath,y.filePath)}),g=Ce(e,g,{namedImports:["RegisteredComponent"],importPath:"@builder.io/sdk-qwik",isTypeOnly:!0}),g=Nr(e,g,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),g=Pr(e,g),g=Ar(e,g);let U=ct(e,g);U=lr(U),U=qf(U,pS,"CUSTOM_COMPONENTS"),U=await e.formatCode(e.registryPath,U),await e.writeFile(e.registryPath,U)}m.components=C.components}return m}function uS(e,r){return lt(e,e.ts.factory.createObjectLiteralExpression([e.ts.factory.createPropertyAssignment("component",e.ts.factory.createIdentifier(r.importName))],!0),r)}async function cS(e,r,t){let n=it(e,r,"CUSTOM_COMPONENTS");if(!n)throw new Error(`Exported name of the Builder registry must be "CUSTOM_COMPONENTS". Please update your Builder registry file: ${e.registryPath}`);let i=n.arrayLiteralExp.elements.filter(o=>e.ts.isObjectLiteralExpression(o)),s=-1;for(let o=0;o<i.length;o++)if((await lu(e,r,i[o]))?.id===t.cmpInfo.id){s=o;break}return{...n,elements:i,elmIndex:s}}var pS=["This array is used to integrate custom components within Builder.","https://www.builder.io/c/docs/custom-components-intro","",'These components will be found the "Custom Components"',"section of Builder's visual editor.",'You can also turn on "components only mode" to limit',"editing to only these components.","https://www.builder.io/c/docs/guides/components-only-mode"];async function Zf(e){let r=await dS(e);return{builderPageOptions:async()=>({templateContentId:"dc70f1d979ad416d8fd357137eb9ddfb",pathname:"/",title:"Builder + Qwik Demo Page"}),ensureBuilderSetup:()=>Yf(r),ensureFigmaImportPage:async()=>[],getRegistryPath:()=>r.registryPath,getRegistry:n=>zn(r,null,!1,!1,null,null,!1,!!n?.readAllInputTypes),addExternalPackage:async n=>{},loadComponent:async n=>{let i=await zn(r,n.cmpId,!1,!1,null,null,!1,!1);return{...i,component:i.components.find(s=>s.id===n.cmpId)}},registerComponent:n=>zn(r,n.cmpId,!0,!1,null,null,!0,!1),setRegisteredComponentInfo:n=>zn(r,n.cmpId,!1,!1,n,null,!0,!1),setRegisteredComponentInput:n=>zn(r,n.cmpId,!1,!1,null,n,!0,!1),unregisterComponent:n=>zn(r,n.cmpId,!1,!0,null,null,!0,!1),getPublicApiKey:()=>Cs(r),setPublicApiKey:n=>Vf(r,n.publicApiKey),getDependencies:n=>[{name:"@builder.io/dev-tools"},{name:"@builder.io/sdk-qwik"}],getDevRunCommand:()=>"dev",getCache:()=>Er(r),setCache:n=>Cr(r,n)}}async function dS(e){let r=await hs(e,e.getAppRootDir(),"components");if(!r)throw new Error(`Could not find components directory within project: ${e.getAppRootDir()}`);let t=await tr(e,r),n=e.join(e.getAppRootDir(),".env");return{...e,componentsDir:r,registryPath:t,envPath:n}}async function Ss(e){return await Dn(e,[".env"],ws)}async function em(e,r){let t=await Ss(e),n=await bn(e,t.file,t.envKey,r);return{...t,modifiedType:n}}var ws="PUBLIC_BUILDER_KEY";var fS=new Set(["dist","node_modules"]);async function tm(e,r){let t=[],n=r.getSourceFiles(),i=r.getTypeChecker(),s=e.join(e.getAppRootDir(),"build");return await Promise.all(n.map(async o=>{let a=e.basename(o.fileName);if(a.startsWith(".")||a==="node_modules"||Lo(e,fS,o.fileName)||mS.has(a)||a.includes("$."))return;let l=e.normalize(o.fileName);if(l===e.remixConfigPath||l===s)return;let u=await xn(e,i,l,o,l===e.registryPath);t.push(...u)})),t}var mS=new Set(["root.tsx","root.ts","root.jsx","root.js","_index.tsx","_index.jsx","_index.ts","_index.js"]);async function rm(e){await jo(e);let r=await e.readFile(e.registryPath);return r?hS(e,r):{components:[],sourceFile:Ee(e,"")}}async function hS(e,r){let t=Ee(e,r);return gS(e,t)}async function gS(e,r){let t=[],n=it(e,r,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(i,s)=>{let o=await uu(e,r,i);o&&(o.nodeIndex=s,t.push(o))})),{sourceFile:r,components:$t(t)}}async function uu(e,r,t){if(!e.ts.isObjectLiteralExpression(t))return null;let n={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],acceptsChildren:!1};e.sdkVersion===ne.gen2&&xi(e,t)&&(n.acceptsChildren=!0);for(let i of t.properties){if(!e.ts.isPropertyAssignment(i)||!e.ts.isIdentifier(i.name))continue;if(Ne(e,i)==="component"){let o,{initializer:a}=i;if(e.ts.isIdentifier(a))o=a.text;else if(e.ts.isCallExpression(a)){(e.ts.isIdentifier(a.expression)&&a.expression.text)==="withChildren"&&(n.acceptsChildren=!0);let c=a.arguments[0];e.ts.isIdentifier(c)&&(o=c.text)}if(!o)continue;n.name===""&&(n.name=$e(o)),n.importName=o;let l=await wr(e,e.registryPath,r,o);if(!l)continue;if(n.filePath=l.filePath,n.relFilePath=l.relFilePath,await e.exists(l.filePath)?n.importPath=Le(e,l.filePath):(n.externalImportPath=l.importPath,n.importPath=n.externalImportPath),n.displayFilePath=l.displayFilePath,n.exportType=l.exportType,n.externalImportPath)n.exportName=o;else{let u=await Cf(e,l.filePath,e.registryPath===l.filePath||pt(l.filePath));if(u&&u.length>0)if(u.length===1)n.exportName=u[0].cmpInfo.exportName;else{let c=u.find(p=>p.cmpInfo.exportName===o);c&&(n.exportName=c.cmpInfo.exportName)}}continue}}return n=Ut(e,n,t),n.filePath&&n.exportName&&(n.id=await Be(e,n.filePath,n.exportName,n.externalImportPath)),n}async function _r(e,r,t,n,i,s,o,a){let l=await En(e),[u,c,p]=await Promise.all([tm(e,l),rm(e),Ss(e)]),d=u.map(D=>D.cmpInfo),f=c.components,m={components:ur(d,f),registryPath:e.registryPath,registryDisplayPath:Ie(e,e.registryPath),frameworks:e.getFrameworks(),dependencies:Tr(d),publicApiKey:p.envValue??void 0,devToolsVersion:e.version};if(a)return m.components=await Si(e,m.components),m;let h=!1,g=c.sourceFile,y=Array.isArray(r)?r:typeof r=="string"?[r]:[];if(y.length>0){let D=y.map(b=>{let E=u.find(T=>T.cmpInfo.id===b);if(!E)throw new Error(`Component ${b} not found`);return E}),C=Array.from(new Set(D.map(b=>b.cmpInfo.filePath))),x=await at(e,C);for(let b of D){let E=m.components.find(B=>B.id===b.cmpInfo.id),T=await wi(e,b,x,e.registryPath===b.cmpInfo.filePath||pt(b.cmpInfo.filePath));Wt(E,T);let O=d.findIndex(B=>B.id===b.cmpInfo.id);d[O].inputs=T;let L=Ir(b.cmpInfo.id,d,f,t,n,i,s),{elements:N,elmIndex:U,statementIndex:oe,statement:G,variableDeclaration:P}=await DS(e,g,b);if(L.addCmpToRegistry)N.push(yS(e,L.addCmpToRegistry)),h=!0;else if(L.removeCmpFromRegistry)N.splice(U,1),h=!0;else if(L.updateRegisteredCmp){let B=lt(e,N[U],L.updateRegisteredCmp);N[U]=e.ts.factory.updateObjectLiteralExpression(B,[nm(e,L.updateRegisteredCmp),...B.properties.slice(1)]),h=!0}if(h&&o){let B=[...g.statements];B[oe]=e.ts.factory.updateVariableStatement(G,G.modifiers,e.ts.factory.updateVariableDeclarationList(G.declarationList,[e.ts.factory.updateVariableDeclaration(P,P.name,P.exclamationToken,P.type,e.ts.factory.createArrayLiteralExpression(vr(e,N)))])),g=e.ts.factory.updateSourceFile(g,B),E.exportType==="named"?g=Ce(e,g,{namedImports:[E.importName],importPath:E.externalImportPath?E.externalImportPath:Se(e,e.registryPath,E.filePath)}):g=Ce(e,g,{defaultImport:E.importName,importPath:E.externalImportPath?E.externalImportPath:Se(e,e.registryPath,E.filePath)});let re=e.sdkVersion===ne.gen2?"@builder.io/sdk-react":"@builder.io/react";g=Ce(e,g,{namedImports:["RegisteredComponent"],importPath:re,isTypeOnly:!0}),E.acceptsChildren&&e.sdkVersion!==ne.gen2&&(g=Ce(e,g,{namedImports:["withChildren"],importPath:"@builder.io/react"})),g=Nr(e,g,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),m.components=L.components,f=L.components.filter(F=>F.isRegistered)}}}if(h&&o){g=Pr(e,g),g=Ar(e,g);let D=ct(e,g);D=lr(D),D=await e.formatCode(e.registryPath,D),await e.writeFile(e.registryPath,D)}return m}function nm(e,r){if(e.sdkVersion===ne.gen2)return e.ts.factory.createPropertyAssignment("component",e.ts.factory.createIdentifier(r.importName));let t=e.ts.factory.createIdentifier(r.importName),n=r.acceptsChildren?e.ts.factory.createCallExpression(e.ts.factory.createIdentifier("withChildren"),void 0,[t]):t;return e.ts.factory.createPropertyAssignment("component",n)}function yS(e,r){return lt(e,e.ts.factory.createObjectLiteralExpression([nm(e,r),...r.acceptsChildren&&e.sdkVersion===ne.gen2?[e.ts.factory.createPropertyAssignment("canHaveChildren",e.ts.factory.createTrue())]:[]],!0),r)}async function DS(e,r,t){let n=it(e,r,"CUSTOM_COMPONENTS");if(!n)throw new Error(`Exported name of the Builder registry must be "CUSTOM_COMPONENTS". Please update your Builder registry file: ${e.registryPath}`);let i=n.arrayLiteralExp.elements.filter(o=>e.ts.isObjectLiteralExpression(o)),s=-1;for(let o=0;o<i.length;o++)if((await uu(e,r,i[o]))?.id===t.cmpInfo.id){s=o;break}return{...n,elements:i,elmIndex:s}}async function im(e){let r=[],t=await ES(e,r);return r.push(...await jo(e)),await SS(e,t),await xS(e,r),r}async function sm(e){let r=[];return r.push(...await jo(e)),await bS(e,r),r}async function bS(e,r){let t=`figma-imports.${e.typescriptEnabled?"tsx":"jsx"}`;e.hasLocaleParam&&(e.debug("remixEnsureFigmaImportRoute, hasLocaleParam"),t=`($locale).${t}`);let n=e.join(e.routesDir,t),i=await e.exists(n);e.debug(`remixEnsureFigmaImportRoute, hasRoute: ${i}`);let s=await e.formatCode(n,om({sys:e,routePath:n,modelName:"figma-imports"}));await e.writeFile(n,s),r.push({filePath:n,modifiedType:i?"update":"create"})}async function xS(e,r){let t=`$.${e.typescriptEnabled?"tsx":"jsx"}`;e.hasLocaleParam&&(e.debug("remixEnsureAppRoute, hasLocaleParam"),t=`($locale).${t}`),e.sdkVersion===ne.gen2&&(t=`($slug)._index.${e.typescriptEnabled?"tsx":"jsx"}`);let n=e.join(e.routesDir,t),i=await e.exists(n);e.debug(`remixEnsureAppRoute, hasRoute: ${i}`);let s=await e.formatCode(n,om({sys:e,routePath:n,modelName:"page"}));await e.writeFile(n,s),r.push({filePath:n,modifiedType:i?"update":"create"})}function om({sys:e,routePath:r,modelName:t}){let n=e.typescriptEnabled,i=Se(e,r,e.registryPath),s="",o="";n&&(s="import type { LoaderArgs } from '@remix-run/server-runtime';",o=": LoaderArgs");let a=`process.env.${ws}`;return e.getFrameworks().some(l=>l.name==="@shopify/remix-oxygen")&&(a=`context.env.${ws}`),n&&(a+="!"),e.sdkVersion===ne.gen2?`
|
|
473
|
+
`;async function Xf(e){await au(e);let r=await e.readFile(e.registryPath);return r?aS(e,r):{components:[],sourceFile:Ee(e,"")}}async function aS(e,r){let t=Ee(e,r);return lS(e,t)}async function lS(e,r){let t=[],n=it(e,r,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(i,s)=>{let o=await lu(e,r,i);o&&(o.nodeIndex=s,t.push(o))})),{sourceFile:r,components:$t(t)}}async function lu(e,r,t){if(!e.ts.isObjectLiteralExpression(t))return null;let n={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[]};for(let i of t.properties){if(!e.ts.isPropertyAssignment(i)||!e.ts.isIdentifier(i.name))continue;if(Ne(e,i)==="component"&&e.ts.isIdentifier(i.initializer)){let o=i.initializer.text;n.name===""&&(n.name=$e(o)),n.importName=o;let a=await wr(e,e.registryPath,r,o);if(!a)continue;n.filePath=a.filePath,n.relFilePath=a.relFilePath,n.importPath=Re(e,a.filePath),n.displayFilePath=a.displayFilePath,n.exportType=a.exportType;let l=await Hf(e,a.filePath);if(l&&l.length>0)if(l.length===1)n.exportName=l[0].cmpInfo.exportName;else{let u=l.find(c=>c.cmpInfo.exportName===o);u&&(n.exportName=u.cmpInfo.exportName)}continue}}return n=Ut(e,n,t),n.filePath&&n.exportName&&(n.id=await Le(e,n.filePath,n.exportName)),n}async function Qf(e){let r=new Set,t=async i=>{let s=await e.readdir(i);await Promise.all(s.map(async o=>{if(o.startsWith(".")||o==="node_modules")return;let a=e.join(i,o),l=e.extname(o).toLowerCase();if(l===".tsx"||l===".ts"){r.add(a);return}(await e.stat(a)).isDirectory()&&await t(a)}))};return await t(e.getAppRootDir()),await at(e,[...r])}async function zn(e,r,t,n,i,s,o,a){let l=await Qf(e),[u,c,p]=await Promise.all([Gf(e,l),Xf(e),Cs(e)]),d=u.map(h=>h.cmpInfo),f=c.components,m={components:ur(d,f),registryPath:e.registryPath,registryDisplayPath:Ie(e,e.registryPath),frameworks:e.getFrameworks(),dependencies:Tr(d),publicApiKey:p.envValue??void 0,devToolsVersion:e.version};if(a)return m;if(r!=null){let h=u.find(N=>N.cmpInfo.id===r);if(!h)throw new Error(`Component ${r} not found`);let g=c.sourceFile,y=m.components.find(N=>N.id===r),D=await Jf(e,h);Wt(y,D),r=Array.isArray(r)?r[0]:r;let C=Ir(r,d,f,t,n,i,s),{elements:x,elmIndex:b,statementIndex:E,statement:T,variableDeclaration:O}=await cS(e,g,h),L=!1;if(C.addCmpToRegistry?(x.push(uS(e,C.addCmpToRegistry)),L=!0):C.removeCmpFromRegistry?(x.splice(b,1),L=!0):C.updateRegisteredCmp&&(x[b]=lt(e,x[b],C.updateRegisteredCmp),L=!0),L&&o){let N=[...g.statements];N[E]=e.ts.factory.updateVariableStatement(T,T.modifiers,e.ts.factory.updateVariableDeclarationList(T.declarationList,[e.ts.factory.updateVariableDeclaration(O,O.name,O.exclamationToken,O.type,e.ts.factory.createArrayLiteralExpression(vr(e,x)))])),g=e.ts.factory.updateSourceFile(g,N),y.exportType==="named"?g=Ce(e,g,{namedImports:[y.importName],importPath:Se(e,e.registryPath,y.filePath)}):g=Ce(e,g,{defaultImport:y.importName,importPath:Se(e,e.registryPath,y.filePath)}),g=Ce(e,g,{namedImports:["RegisteredComponent"],importPath:"@builder.io/sdk-qwik",isTypeOnly:!0}),g=Nr(e,g,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),g=Pr(e,g),g=Ar(e,g);let U=ct(e,g);U=lr(U),U=qf(U,pS,"CUSTOM_COMPONENTS"),U=await e.formatCode(e.registryPath,U),await e.writeFile(e.registryPath,U)}m.components=C.components}return m}function uS(e,r){return lt(e,e.ts.factory.createObjectLiteralExpression([e.ts.factory.createPropertyAssignment("component",e.ts.factory.createIdentifier(r.importName))],!0),r)}async function cS(e,r,t){let n=it(e,r,"CUSTOM_COMPONENTS");if(!n)throw new Error(`Exported name of the Builder registry must be "CUSTOM_COMPONENTS". Please update your Builder registry file: ${e.registryPath}`);let i=n.arrayLiteralExp.elements.filter(o=>e.ts.isObjectLiteralExpression(o)),s=-1;for(let o=0;o<i.length;o++)if((await lu(e,r,i[o]))?.id===t.cmpInfo.id){s=o;break}return{...n,elements:i,elmIndex:s}}var pS=["This array is used to integrate custom components within Builder.","https://www.builder.io/c/docs/custom-components-intro","",'These components will be found the "Custom Components"',"section of Builder's visual editor.",'You can also turn on "components only mode" to limit',"editing to only these components.","https://www.builder.io/c/docs/guides/components-only-mode"];async function Zf(e){let r=await dS(e);return{builderPageOptions:async()=>({templateContentId:"dc70f1d979ad416d8fd357137eb9ddfb",pathname:"/",title:"Builder + Qwik Demo Page"}),ensureBuilderSetup:()=>Yf(r),ensureFigmaImportPage:async()=>[],getRegistryPath:()=>r.registryPath,getRegistry:n=>zn(r,null,!1,!1,null,null,!1,!!n?.readAllInputTypes),addExternalPackage:async n=>{},loadComponent:async n=>{let i=await zn(r,n.cmpId,!1,!1,null,null,!1,!1);return{...i,component:i.components.find(s=>s.id===n.cmpId)}},registerComponent:n=>zn(r,n.cmpId,!0,!1,null,null,!0,!1),setRegisteredComponentInfo:n=>zn(r,n.cmpId,!1,!1,n,null,!0,!1),setRegisteredComponentInput:n=>zn(r,n.cmpId,!1,!1,null,n,!0,!1),unregisterComponent:n=>zn(r,n.cmpId,!1,!0,null,null,!0,!1),getPublicApiKey:()=>Cs(r),setPublicApiKey:n=>Vf(r,n.publicApiKey),getDependencies:n=>[{name:"@builder.io/dev-tools"},{name:"@builder.io/sdk-qwik"}],getDevRunCommand:()=>"dev",getCache:()=>Er(r),setCache:n=>Cr(r,n)}}async function dS(e){let r=await hs(e,e.getAppRootDir(),"components");if(!r)throw new Error(`Could not find components directory within project: ${e.getAppRootDir()}`);let t=await tr(e,r),n=e.join(e.getAppRootDir(),".env");return{...e,componentsDir:r,registryPath:t,envPath:n}}async function Ss(e){return await Dn(e,[".env"],ws)}async function em(e,r){let t=await Ss(e),n=await bn(e,t.file,t.envKey,r);return{...t,modifiedType:n}}var ws="PUBLIC_BUILDER_KEY";var fS=new Set(["dist","node_modules"]);async function tm(e,r){let t=[],n=r.getSourceFiles(),i=r.getTypeChecker(),s=e.join(e.getAppRootDir(),"build");return await Promise.all(n.map(async o=>{let a=e.basename(o.fileName);if(a.startsWith(".")||a==="node_modules"||Lo(e,fS,o.fileName)||mS.has(a)||a.includes("$."))return;let l=e.normalize(o.fileName);if(l===e.remixConfigPath||l===s)return;let u=await xn(e,i,l,o,l===e.registryPath);t.push(...u)})),t}var mS=new Set(["root.tsx","root.ts","root.jsx","root.js","_index.tsx","_index.jsx","_index.ts","_index.js"]);async function rm(e){await jo(e);let r=await e.readFile(e.registryPath);return r?hS(e,r):{components:[],sourceFile:Ee(e,"")}}async function hS(e,r){let t=Ee(e,r);return gS(e,t)}async function gS(e,r){let t=[],n=it(e,r,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(i,s)=>{let o=await uu(e,r,i);o&&(o.nodeIndex=s,t.push(o))})),{sourceFile:r,components:$t(t)}}async function uu(e,r,t){if(!e.ts.isObjectLiteralExpression(t))return null;let n={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],acceptsChildren:!1};e.sdkVersion===ne.gen2&&xi(e,t)&&(n.acceptsChildren=!0);for(let i of t.properties){if(!e.ts.isPropertyAssignment(i)||!e.ts.isIdentifier(i.name))continue;if(Ne(e,i)==="component"){let o,{initializer:a}=i;if(e.ts.isIdentifier(a))o=a.text;else if(e.ts.isCallExpression(a)){(e.ts.isIdentifier(a.expression)&&a.expression.text)==="withChildren"&&(n.acceptsChildren=!0);let c=a.arguments[0];e.ts.isIdentifier(c)&&(o=c.text)}if(!o)continue;n.name===""&&(n.name=$e(o)),n.importName=o;let l=await wr(e,e.registryPath,r,o);if(!l)continue;if(n.filePath=l.filePath,n.relFilePath=l.relFilePath,await e.exists(l.filePath)?n.importPath=Re(e,l.filePath):(n.externalImportPath=l.importPath,n.importPath=n.externalImportPath),n.displayFilePath=l.displayFilePath,n.exportType=l.exportType,n.externalImportPath)n.exportName=o;else{let u=await Cf(e,l.filePath,e.registryPath===l.filePath||pt(l.filePath));if(u&&u.length>0)if(u.length===1)n.exportName=u[0].cmpInfo.exportName;else{let c=u.find(p=>p.cmpInfo.exportName===o);c&&(n.exportName=c.cmpInfo.exportName)}}continue}}return n=Ut(e,n,t),n.filePath&&n.exportName&&(n.id=await Le(e,n.filePath,n.exportName,n.externalImportPath)),n}async function _r(e,r,t,n,i,s,o,a){let l=await En(e),[u,c,p]=await Promise.all([tm(e,l),rm(e),Ss(e)]),d=u.map(D=>D.cmpInfo),f=c.components,m={components:ur(d,f),registryPath:e.registryPath,registryDisplayPath:Ie(e,e.registryPath),frameworks:e.getFrameworks(),dependencies:Tr(d),publicApiKey:p.envValue??void 0,devToolsVersion:e.version};if(a)return m.components=await Si(e,m.components),m;let h=!1,g=c.sourceFile,y=Array.isArray(r)?r:typeof r=="string"?[r]:[];if(y.length>0){let D=y.map(b=>{let E=u.find(T=>T.cmpInfo.id===b);if(!E)throw new Error(`Component ${b} not found`);return E}),C=Array.from(new Set(D.map(b=>b.cmpInfo.filePath))),x=await at(e,C);for(let b of D){let E=m.components.find(B=>B.id===b.cmpInfo.id),T=await wi(e,b,x,e.registryPath===b.cmpInfo.filePath||pt(b.cmpInfo.filePath));Wt(E,T);let O=d.findIndex(B=>B.id===b.cmpInfo.id);d[O].inputs=T;let L=Ir(b.cmpInfo.id,d,f,t,n,i,s),{elements:N,elmIndex:U,statementIndex:oe,statement:G,variableDeclaration:P}=await DS(e,g,b);if(L.addCmpToRegistry)N.push(yS(e,L.addCmpToRegistry)),h=!0;else if(L.removeCmpFromRegistry)N.splice(U,1),h=!0;else if(L.updateRegisteredCmp){let B=lt(e,N[U],L.updateRegisteredCmp);N[U]=e.ts.factory.updateObjectLiteralExpression(B,[nm(e,L.updateRegisteredCmp),...B.properties.slice(1)]),h=!0}if(h&&o){let B=[...g.statements];B[oe]=e.ts.factory.updateVariableStatement(G,G.modifiers,e.ts.factory.updateVariableDeclarationList(G.declarationList,[e.ts.factory.updateVariableDeclaration(P,P.name,P.exclamationToken,P.type,e.ts.factory.createArrayLiteralExpression(vr(e,N)))])),g=e.ts.factory.updateSourceFile(g,B),E.exportType==="named"?g=Ce(e,g,{namedImports:[E.importName],importPath:E.externalImportPath?E.externalImportPath:Se(e,e.registryPath,E.filePath)}):g=Ce(e,g,{defaultImport:E.importName,importPath:E.externalImportPath?E.externalImportPath:Se(e,e.registryPath,E.filePath)});let re=e.sdkVersion===ne.gen2?"@builder.io/sdk-react":"@builder.io/react";g=Ce(e,g,{namedImports:["RegisteredComponent"],importPath:re,isTypeOnly:!0}),E.acceptsChildren&&e.sdkVersion!==ne.gen2&&(g=Ce(e,g,{namedImports:["withChildren"],importPath:"@builder.io/react"})),g=Nr(e,g,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),m.components=L.components,f=L.components.filter(F=>F.isRegistered)}}}if(h&&o){g=Pr(e,g),g=Ar(e,g);let D=ct(e,g);D=lr(D),D=await e.formatCode(e.registryPath,D),await e.writeFile(e.registryPath,D)}return m}function nm(e,r){if(e.sdkVersion===ne.gen2)return e.ts.factory.createPropertyAssignment("component",e.ts.factory.createIdentifier(r.importName));let t=e.ts.factory.createIdentifier(r.importName),n=r.acceptsChildren?e.ts.factory.createCallExpression(e.ts.factory.createIdentifier("withChildren"),void 0,[t]):t;return e.ts.factory.createPropertyAssignment("component",n)}function yS(e,r){return lt(e,e.ts.factory.createObjectLiteralExpression([nm(e,r),...r.acceptsChildren&&e.sdkVersion===ne.gen2?[e.ts.factory.createPropertyAssignment("canHaveChildren",e.ts.factory.createTrue())]:[]],!0),r)}async function DS(e,r,t){let n=it(e,r,"CUSTOM_COMPONENTS");if(!n)throw new Error(`Exported name of the Builder registry must be "CUSTOM_COMPONENTS". Please update your Builder registry file: ${e.registryPath}`);let i=n.arrayLiteralExp.elements.filter(o=>e.ts.isObjectLiteralExpression(o)),s=-1;for(let o=0;o<i.length;o++)if((await uu(e,r,i[o]))?.id===t.cmpInfo.id){s=o;break}return{...n,elements:i,elmIndex:s}}async function im(e){let r=[],t=await ES(e,r);return r.push(...await jo(e)),await SS(e,t),await xS(e,r),r}async function sm(e){let r=[];return r.push(...await jo(e)),await bS(e,r),r}async function bS(e,r){let t=`figma-imports.${e.typescriptEnabled?"tsx":"jsx"}`;e.hasLocaleParam&&(e.debug("remixEnsureFigmaImportRoute, hasLocaleParam"),t=`($locale).${t}`);let n=e.join(e.routesDir,t),i=await e.exists(n);e.debug(`remixEnsureFigmaImportRoute, hasRoute: ${i}`);let s=await e.formatCode(n,om({sys:e,routePath:n,modelName:"figma-imports"}));await e.writeFile(n,s),r.push({filePath:n,modifiedType:i?"update":"create"})}async function xS(e,r){let t=`$.${e.typescriptEnabled?"tsx":"jsx"}`;e.hasLocaleParam&&(e.debug("remixEnsureAppRoute, hasLocaleParam"),t=`($locale).${t}`),e.sdkVersion===ne.gen2&&(t=`($slug)._index.${e.typescriptEnabled?"tsx":"jsx"}`);let n=e.join(e.routesDir,t),i=await e.exists(n);e.debug(`remixEnsureAppRoute, hasRoute: ${i}`);let s=await e.formatCode(n,om({sys:e,routePath:n,modelName:"page"}));await e.writeFile(n,s),r.push({filePath:n,modifiedType:i?"update":"create"})}function om({sys:e,routePath:r,modelName:t}){let n=e.typescriptEnabled,i=Se(e,r,e.registryPath),s="",o="";n&&(s="import type { LoaderArgs } from '@remix-run/server-runtime';",o=": LoaderArgs");let a=`process.env.${ws}`;return e.getFrameworks().some(l=>l.name==="@shopify/remix-oxygen")&&(a=`context.env.${ws}`),n&&(a+="!"),e.sdkVersion===ne.gen2?`
|
|
474
474
|
|
|
475
475
|
import {
|
|
476
476
|
Content,
|
|
@@ -653,7 +653,7 @@ export const CUSTOM_COMPONENTS: RegisteredComponent[] = [
|
|
|
653
653
|
`,t+=` {
|
|
654
654
|
name: "${r.name}",
|
|
655
655
|
}
|
|
656
|
-
`,t+=");";let n=Ro(e,t);return cu(e,n,r)}function cu(e,r,t){if(!e.ts.isExpressionStatement(r))return r;let n=r.expression;if(!e.ts.isCallExpression(n))return r;let i=[...n.arguments];if(i.length<2)return r;let s=i[1];return e.ts.isObjectLiteralExpression(s)?(i[1]=lt(e,s,t),e.ts.factory.updateExpressionStatement(r,e.ts.factory.updateCallExpression(n,n.expression,n.typeArguments,i))):r}async function cm(e){let r=await e.readFile(e.registryPath);return r?IS(e,r):{components:[],sourceFile:Ee(e,"")}}async function IS(e,r){let t=Ee(e,r);return e.sdkVersion===ne.gen2?_S(e,t):NS(e,t)}async function NS(e,r){let t=[];for(let n=0;n<r.statements.length;n++){let i=r.statements[n];if(!e.ts.isExpressionStatement(i))continue;let s=i.expression;if(!e.ts.isCallExpression(s))continue;let o=s.expression;if(!e.ts.isPropertyAccessExpression(o))continue;let a=o.expression;if(!e.ts.isIdentifier(a)||a.text!=="Builder"||o.name.text!=="registerComponent")continue;let u=s.arguments;if(u.length<2)continue;let c=u[1];if(!e.ts.isObjectLiteralExpression(c))continue;let p=u[0];if(e.ts.isIdentifier(p)){let d=await FS(e,r,n,p,c,!1);d&&t.push(d);continue}}return{sourceFile:r,components:$t(t)}}async function FS(e,r,t,n,i,s){let o={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],nodeIndex:t,acceptsChildren:s},a=r.statements.filter(u=>e.ts.isImportDeclaration(u)),l=a.find(u=>u.importClause&&u.importClause.name?.text===n.text);if(l){let u=l.moduleSpecifier;if(!e.ts.isStringLiteral(u))return null;o.filePath=await pu(e,u.text),o.relFilePath=e.relative(e.getAppRootDir(),o.filePath),o.importPath=
|
|
656
|
+
`,t+=");";let n=Ro(e,t);return cu(e,n,r)}function cu(e,r,t){if(!e.ts.isExpressionStatement(r))return r;let n=r.expression;if(!e.ts.isCallExpression(n))return r;let i=[...n.arguments];if(i.length<2)return r;let s=i[1];return e.ts.isObjectLiteralExpression(s)?(i[1]=lt(e,s,t),e.ts.factory.updateExpressionStatement(r,e.ts.factory.updateCallExpression(n,n.expression,n.typeArguments,i))):r}async function cm(e){let r=await e.readFile(e.registryPath);return r?IS(e,r):{components:[],sourceFile:Ee(e,"")}}async function IS(e,r){let t=Ee(e,r);return e.sdkVersion===ne.gen2?_S(e,t):NS(e,t)}async function NS(e,r){let t=[];for(let n=0;n<r.statements.length;n++){let i=r.statements[n];if(!e.ts.isExpressionStatement(i))continue;let s=i.expression;if(!e.ts.isCallExpression(s))continue;let o=s.expression;if(!e.ts.isPropertyAccessExpression(o))continue;let a=o.expression;if(!e.ts.isIdentifier(a)||a.text!=="Builder"||o.name.text!=="registerComponent")continue;let u=s.arguments;if(u.length<2)continue;let c=u[1];if(!e.ts.isObjectLiteralExpression(c))continue;let p=u[0];if(e.ts.isIdentifier(p)){let d=await FS(e,r,n,p,c,!1);d&&t.push(d);continue}}return{sourceFile:r,components:$t(t)}}async function FS(e,r,t,n,i,s){let o={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],nodeIndex:t,acceptsChildren:s},a=r.statements.filter(u=>e.ts.isImportDeclaration(u)),l=a.find(u=>u.importClause&&u.importClause.name?.text===n.text);if(l){let u=l.moduleSpecifier;if(!e.ts.isStringLiteral(u))return null;o.filePath=await pu(e,u.text),o.relFilePath=e.relative(e.getAppRootDir(),o.filePath),o.importPath=Re(e,o.filePath),o.name=er(e,o.filePath),o.importName=n.text,o.exportName="default",o.exportType="default"}else{let u=a.find(d=>!d.importClause||!d.importClause.namedBindings||!e.ts.isNamedImports(d.importClause.namedBindings)?!1:d.importClause.namedBindings.elements.some(f=>f.name.text===n.text));if(!u)return null;let c=u.moduleSpecifier;if(!e.ts.isStringLiteral(c))return null;let p=await pu(e,c.text);o.filePath=await pu(e,c.text),o.relFilePath=e.relative(e.getAppRootDir(),o.filePath),await e.exists(p)?o.importPath=Re(e,o.filePath):(o.externalImportPath=c.text,o.importPath=o.externalImportPath),o.name=$e(n.text),o.importName=n.text,o.exportName=n.text,o.exportType="named"}return o=Ut(e,o,i),o.displayFilePath=Ie(e,o.filePath),o.filePath&&o.exportName&&(o.id=await Le(e,o.filePath,o.exportName,o.externalImportPath)),o}function pu(e,r){return Es(e,e.normalize(e.resolve(e.dirname(e.registryPath),r)))}async function _S(e,r){let t=[],n=it(e,r,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(i,s)=>{let o=await du(e,r,i);o&&(o.nodeIndex=s,t.push(o))})),{sourceFile:r,components:$t(t)}}async function du(e,r,t){if(!e.ts.isObjectLiteralExpression(t))return null;let n={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],acceptsChildren:!1};xi(e,t)&&(n.acceptsChildren=!0);for(let s of t.properties){if(!e.ts.isPropertyAssignment(s)||!e.ts.isIdentifier(s.name))continue;if(Ne(e,s)==="component"){let a,{initializer:l}=s;if(e.ts.isIdentifier(l)&&(a=l.text),!a)continue;n.name===""&&(n.name=$e(a)),n.importName=a;let u=await wr(e,e.registryPath,r,a);if(!u)continue;n.filePath=u.filePath,n.relFilePath=u.relFilePath,await e.exists(u.filePath)?n.importPath=Re(e,u.filePath):(n.externalImportPath=u.importPath,n.importPath=n.externalImportPath),n.displayFilePath=u.displayFilePath,n.exportType=u.exportType;let c=r.statements.filter(d=>e.ts.isImportDeclaration(d)),p=c.find(d=>d.importClause&&d.importClause.name?.text===a);if(p){let d=p.moduleSpecifier;if(!e.ts.isStringLiteral(d))return null;n.exportName="default"}else{let d=c.find(m=>!m.importClause||!m.importClause.namedBindings||!e.ts.isNamedImports(m.importClause.namedBindings)?!1:m.importClause.namedBindings.elements.some(h=>h.name.text===a));if(!d)return null;let f=d.moduleSpecifier;if(!e.ts.isStringLiteral(f))return null;n.exportName=a}continue}}return n=Ut(e,n,t),n.filePath&&n.exportName&&(n.id=await Le(e,n.filePath,n.exportName,n.externalImportPath)),n}async function kr(e,r,t,n,i,s,o,a){let l=await En(e),[u,c,p,d]=await Promise.all([Sf(e,l),cm(e),qt(e),Ts(e)]),f=u.map(C=>C.cmpInfo),m=c.components,h={components:ur(f,m),registryPath:e.registryPath,registryDisplayPath:Ie(e,e.registryPath),frameworks:e.getFrameworks(),dependencies:Tr(f),publicApiKey:d.envValue??void 0,devToolsVersion:e.version};if(a)return h.components=await Si(e,h.components),h;let g=!1,y=c.sourceFile,D=Array.isArray(r)?r:typeof r=="string"?[r]:[];if(D.length>0){let C=D.map(E=>{let T=u.find(O=>O.cmpInfo.id===E);if(!T)throw new Error(`Component ${E} not found`);return T}),x=Array.from(new Set(C.map(E=>E.cmpInfo.filePath))),b=await at(e,x);for(let E of C){let T=h.components.find(U=>U.id===E.cmpInfo.id),O=await wi(e,E,b,e.registryPath===E.cmpInfo.filePath||pt(E.cmpInfo.filePath));Wt(T,O);let L=f.findIndex(U=>U.id===E.cmpInfo.id);f[L].inputs=O;let N=Ir(E.cmpInfo.id,f,m,t,n,i,s);if(e.sdkVersion===ne.gen2){let{elements:U,elmIndex:oe,statementIndex:G,statement:P,variableDeclaration:B}=await kS(e,y,E);if(N.addCmpToRegistry)U.push(OS(e,N.addCmpToRegistry)),g=!0;else if(N.removeCmpFromRegistry)U.splice(oe,1),g=!0;else if(N.updateRegisteredCmp){let re=lt(e,U[oe],N.updateRegisteredCmp),F=e.ts.factory.createIdentifier(N.updateRegisteredCmp.importName);U[oe]=e.ts.factory.updateObjectLiteralExpression(re,[e.ts.factory.createPropertyAssignment("component",F),...re.properties.slice(1)]),g=!0}if(g&&o){let re=[...y.statements];re[G]=e.ts.factory.updateVariableStatement(P,P.modifiers,e.ts.factory.updateVariableDeclarationList(P.declarationList,[e.ts.factory.updateVariableDeclaration(B,B.name,B.exclamationToken,B.type,e.ts.factory.createArrayLiteralExpression(vr(e,U)))])),y=e.ts.factory.updateSourceFile(y,re),y=pm(e,N,y),y=Ce(e,y,{namedImports:["RegisteredComponent"],importPath:"@builder.io/sdk-react",isTypeOnly:!0}),y=Nr(e,y,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),h.components=N.components,m=N.components.filter(F=>F.isRegistered)}}else{let U=[...y.statements];N.addCmpToRegistry?(U.push(um(e,N.addCmpToRegistry)),g=!0):N.removeCmpFromRegistry?(U.splice(N.nodeIndex,1),g=!0):N.updateRegisteredCmp&&(U[N.nodeIndex]=cu(e,U[N.nodeIndex],N.updateRegisteredCmp),g=!0),g&&o&&(y=e.ts.factory.updateSourceFile(y,U),y=Ce(e,y,{namedImports:["Builder","builder"],importPath:"@builder.io/react"}),y=pm(e,N,y),T?.acceptsChildren&&(y=Ce(e,y,{namedImports:["withChildren"],importPath:"@builder.io/react"})),h.components=N.components,m=N.components.filter(oe=>oe.isRegistered))}}}if(g&&o){y=Pr(e,y),y=Ar(e,y);let C=ct(e,y);C=lr(C),C=await e.formatCode(e.registryPath,C),await e.writeFile(e.registryPath,C)}return h}async function kS(e,r,t){let n=it(e,r,"CUSTOM_COMPONENTS");if(!n)throw new Error(`Exported name of the Builder registry must be "CUSTOM_COMPONENTS". Please update your Builder registry file: ${e.registryPath}`);let i=n.arrayLiteralExp.elements.filter(o=>e.ts.isObjectLiteralExpression(o)),s=-1;for(let o=0;o<i.length;o++)if((await du(e,r,i[o]))?.id===t.cmpInfo.id){s=o;break}return{...n,elements:i,elmIndex:s}}function OS(e,r){let t=e.ts.factory.createIdentifier(r.importName);return lt(e,e.ts.factory.createObjectLiteralExpression([e.ts.factory.createPropertyAssignment("component",t),...r.acceptsChildren?[e.ts.factory.createPropertyAssignment("canHaveChildren",e.ts.factory.createTrue())]:[]],!0),r)}function pm(e,r,t){let n=r.addCmpToRegistry||r.updateRegisteredCmp;if(n){let i=n.externalImportPath?n.externalImportPath:Se(e,e.registryPath,n.filePath);n.exportType==="default"?t=Ce(e,t,{defaultImport:n.importName,importPath:i}):n.exportType==="named"&&(t=Ce(e,t,{namedImports:[n.importName],importPath:i}))}return t}async function dm(e){let r=[],t=await RS(e,r);if(await hm(e,r,t),!await e.exists(e.builderComponentPath)){let n=await e.formatCode(e.builderComponentPath,mm(e,e.builderComponentPath));await e.writeFile(e.builderComponentPath,n),r.push({filePath:e.builderComponentPath,modifiedType:"create"})}return r}async function fm(e){let r=[];await hm(e,r);let t=`figma-imports.${e.typescriptEnabled?"tsx":"jsx"}`,n=e.join(e.componentsDir,t);if(!await e.exists(n)){let i=await e.formatCode(n,mm(e,n,"figma-imports"));await e.writeFile(n,i),r.push({filePath:n,modifiedType:"create"})}return r}function mm(e,r,t="page"){let n=e.typescriptEnabled;return e.sdkVersion===ne.gen2?`
|
|
657
657
|
import React from "react";
|
|
658
658
|
import {
|
|
659
659
|
Content,
|
|
@@ -837,7 +837,7 @@ export const CUSTOM_COMPONENTS: RegisteredComponent[] = [
|
|
|
837
837
|
production: false,
|
|
838
838
|
builderApiKey: "${n}",
|
|
839
839
|
};
|
|
840
|
-
`.trimStart(),o=await e.formatCode(r,s);return await e.writeFile(r,o),"create"}return null}var Vo="builderApiKey";async function bm(e,r){let t=[],n=r.getSourceFiles(),i=r.getTypeChecker();return await Promise.all(n.map(async s=>{let o=e.basename(s.fileName);if(GS(e,s.fileName)||o.startsWith(".")||o==="node_modules"||qS.has(o))return;let a=e.normalize(s.fileName);if(a===e.registryPath)return;let l=await zo(e,i,a,s);t.push(...l)})),t.sort((s,o)=>s.cmpInfo.name.localeCompare(o.cmpInfo.name))}var qS=new Set([]),WS=new Set(["node_modules"]);function GS(e,r){for(let t of WS)if(e.dirname(r).includes(t))return!0;return!1}async function xm(e,r){let t=e.extname(r).toLowerCase();if(t===".tsx"||t===".jsx"||t===".ts"||t===".js"){let n=await e.readFile(r);if(n)return HS(e,r,n)}return null}function HS(e,r,t){let n=Ee(e,t);return zo(e,null,r,n)}async function zo(e,r,t,n){let i=[],s={};t=e.normalize(t);let o=n.statements.filter(c=>e.ts.isClassDeclaration(c)&&ZS(e,c)),a=n.statements.find(c=>e.ts.isImportDeclaration(c)&&e.ts.isStringLiteral(c.moduleSpecifier)&&c.moduleSpecifier.text==="@angular/core");if(a&&e.ts.isImportDeclaration(a)){let c=a.importClause?.namedBindings;if(c&&e.ts.isNamedImports(c)){let p=c.elements.find(d=>(d.propertyName??d.name).text==="input");p&&(s.inputSignalImportName=p.name.text)}}let l=await YS(e,r,t,n),u=ew(e,n);return await Promise.all(o.map(async c=>{let p=await JS(e,r,t,c,u,s);i.push(...p)})),i.push(...l),i}async function fu(e,r,t){if(r.node.fnNode){let{sourceFile:n,typeChecker:i}=await Di(e,r.cmpInfo.filePath,t),o=(await zo(e,i,r.cmpInfo.filePath,n)).find(a=>a.cmpInfo.id===r.cmpInfo.id);if(!o)throw new Error(`Could not find component ${r.cmpInfo.name} in ${r.cmpInfo.filePath}`);return o.cmpInfo.inputs}return[]}async function Em(e,r,t){if(!t.some(a=>!a.isRegistered))return t;let i=await at(e,t.map(a=>a.filePath)),s=i.getTypeChecker();return await Promise.all(t.filter(a=>!(a.name.endsWith("Page")||a.name.endsWith("Module")||a.name==="AppComponent")).map(async a=>{if(!a.isRegistered){let l=i.getSourceFile(a.filePath);if(l){let c=(await zo(e,s,a.filePath,l)).find(p=>p.cmpInfo.id===a.id);if(c){a.inputs=Kn(e,s,c.node.fnNode);let p=r.find(d=>d.cmpInfo.id===a.id);if(p){let d=await fu(e,p,i);Wt(a,d)}}}}return a}))}async function JS(e,r,t,n,i,s){let o=[],a=e.relative(e.getAppRootDir(),t),l=Le(e,t),u=n.name?.text;if(!u)return o;let c=!1;n.modifiers&&(c=n.modifiers.some(m=>m.kind===e.ts.SyntaxKind.DefaultKeyword));let p=c?"default":u,d=c?"default":"named",f=[];return n.members.forEach(m=>{if(e.ts.isPropertyDeclaration(m)||e.ts.isGetAccessor(m)||e.ts.isSetAccessor(m)){let y=(e.ts.getDecorators(m)??[]).find(C=>XS(e,C))!==void 0&&e.ts.isIdentifier(m.name),D=s?.inputSignalImportName!==void 0&&e.ts.isIdentifier(m.name)&&QS(e,m,s.inputSignalImportName);if(y||D){let C="any";if(e.ts.isSetAccessor(m))C=Dm(e,m.parameters[0].type);else if(m.type&&r){let b=r.getTypeAtLocation(m.type);C=r.typeToString(b)}else C=Dm(e,m.type);let x={name:m.name.text,type:i[C]?"string":C};i[C]&&(x.enum=i[C]),f.push(x)}}}),o.push({cmpInfo:{id:await Be(e,t,u),displayFilePath:Ie(e,t),name:$e(u),inputs:f,exportName:p,exportType:d,importName:u,filePath:t,relFilePath:a,importPath:l,meta:{...rw(e,n)}},node:{name:u,fnNode:n,deps:void 0}}),o}async function YS(e,r,t,n){let i=[],s=e.relative(e.getAppRootDir(),t),o=Le(e,t);for(let a of n.statements)if(e.ts.isExportDeclaration(a)&&a.exportClause&&e.ts.isNamedExports(a.exportClause))for(let l of a.exportClause.elements){let u=l.name?.text;if(!u)continue;let c=u,p="named",d=[];if(r){let h=r.getSymbolAtLocation(l.name);if(h){let g=r.getDeclaredTypeOfSymbol(h);r.getPropertiesOfType(g).forEach(D=>{let C=D.getDeclarations();C&&C.forEach(x=>{if(e.ts.isPropertyDeclaration(x)){let b=r.getTypeAtLocation(x),E={name:D.getName(),type:tw(e,r,b)};d.push(E)}})})}}let f=e.ts.isExportSpecifier(l)&&l.parent?l.parent.parent:void 0,m;if(f){let h=f.moduleSpecifier;if(h&&e.ts.isStringLiteral(h)){let g=r?.getSymbolAtLocation(h);if(g&&g.declarations&&g.declarations.length>0){let y=g.declarations[0];(!e.ts.isSourceFile(y)||e.ts.isSourceFile(y)&&y.fileName.includes("node_modules"))&&(m=h.text)}}}i.push({cmpInfo:{id:await Be(e,t,u,m),displayFilePath:Ie(e,t),name:$e(u),inputs:d,exportName:c,exportType:p,importName:u,filePath:t,relFilePath:s,importPath:m||o,externalImportPath:m},node:{name:u,fnNode:l,deps:void 0}})}return i}function XS(e,r){return Cm(e,r,"Input")}function QS(e,r,t){return e.ts.isPropertyDeclaration(r)&&r.initializer!==void 0&&e.ts.isCallExpression(r.initializer)&&e.ts.isIdentifier(r.initializer.expression)&&r.initializer.expression.text===t}function Cm(e,r,t){if(e.ts.isCallExpression(r.expression)){let n=r.expression;if(e.ts.isIdentifier(n.expression))return n.expression?.text===t}return!1}function ZS(e,r){return!!e.ts.getDecorators(r)?.some(i=>e.ts.isCallExpression(i.expression)&&e.ts.isIdentifier(i.expression.expression)&&i.expression.expression.text==="Component")}function Dm(e,r){if(!r)return"any";let t="any";switch(r.kind){case e.ts.SyntaxKind.StringKeyword:t="string";break;case e.ts.SyntaxKind.NumberKeyword:t="number";break;case e.ts.SyntaxKind.BooleanKeyword:t="boolean";break;case e.ts.SyntaxKind.TypeReference:e.ts.isTypeReferenceNode(r)&&e.ts.isIdentifier(r.typeName)&&(t=r.typeName.text);break}return t.includes("|")?"string":t}function ew(e,r){let t={};return e.ts.forEachChild(r,n=>{e.ts.isTypeAliasDeclaration(n)&&e.ts.isUnionTypeNode(n.type)&&n.type.types.every(i=>e.ts.isLiteralTypeNode(i)&&e.ts.isStringLiteral(i.literal))&&(t[n.name.text]=n.type.types.map(i=>i.literal.text))}),t}function tw(e,r,t){let n=r.typeToString(t);if(n==="any"){let i=t.getSymbol();if(i){let s=i.getDeclarations();if(s&&s.length>0){let o=s[0];if(e.ts.isVariableDeclaration(o)){let a=o.type;a&&(n=r.typeToString(r.getTypeAtLocation(a)))}}}}return n}function rw(e,r){let{getDecorators:t,isCallExpression:n,isIdentifier:i,isObjectLiteralExpression:s,isPropertyAssignment:o,isStringLiteral:a,SyntaxKind:l}=e.ts,u,c;return t(r)?.forEach(d=>{if(Cm(e,d,"Component")){let{expression:f}=d;if(n(f)){let[m]=f.arguments;s(m)&&m.properties.forEach(h=>{o(h)&&i(h.name)&&(h.name.escapedText==="selector"&&a(h.initializer)&&(u=h.initializer.text),h.name.escapedText==="standalone"&&(c=h.initializer.kind===l.TrueKeyword))})}}}),{selector:u,standalone:c}}async function qo(e,r,t){let n=e.typescriptEnabled?".ts":".js",i=`app.module${n}`,s=e.join(e.appDir,i),o=await e.readFile(s);if(!o){console.error(`Unable to read app.module.${n} at ${s}`);return}let a=await nw(e,s,r,t,o);if(!a){console.error(`Unable to update app.module.${n} at ${s}`);return}return await e.writeFile(s,a),s}async function nw(e,r,t,n,i){let s=i,o=Ee(e,i),a=Se(e,r,n);o=Ce(e,o,{namedImports:[t],importPath:a}),o=Ce(e,o,{namedImports:["Content"],importPath:"@builder.io/sdk-angular"});let l=[];for(let u of o.statements)if(e.ts.isClassDeclaration(u)&&u.name?.text==="AppModule"){let c=iw(e,t,u);l.push(c)}else l.push(u);return o=e.ts.factory.updateSourceFile(o,l),s=ct(e,o),s}function iw(e,r,t){let n=e.ts.getDecorators(t);if(n){for(let i of n)if(e.ts.isCallExpression(i.expression)&&e.ts.isIdentifier(i.expression.expression)&&i.expression.expression.text==="NgModule"){let s=i.expression.arguments;if(s.length===1&&e.ts.isObjectLiteralExpression(s[0])){let o=Sm(e,s[0],"declarations",r);if(o){let a=Sm(e,o,"imports","Content");if(a&&(o=a),o){let l=e.ts.factory.updateDecorator(i,e.ts.factory.updateCallExpression(i.expression,i.expression.expression,i.expression.typeArguments,[o])),c=[...n.map(p=>p===i?l:p),...e.ts.getModifiers(t)||[]];return e.ts.factory.updateClassDeclaration(t,c,t.name,t.typeParameters,t.heritageClauses,t.members)}}}}}return t}function Sm(e,r,t,n){let i=[...r.properties],s=i.findIndex(a=>Ne(e,a)===t);if(s>-1){let a=i[s];if(e.ts.isPropertyAssignment(a)&&a.initializer&&e.ts.isArrayLiteralExpression(a.initializer)){let l=wm(e,a.initializer,n);return l?(i[s]=e.ts.factory.updatePropertyAssignment(a,a.name,l),e.ts.factory.updateObjectLiteralExpression(r,i)):null}return null}let o=wm(e,e.ts.factory.createArrayLiteralExpression([],!0),n);return o?e.ts.factory.updateObjectLiteralExpression(r,[...i,e.ts.factory.createPropertyAssignment(t,o)]):null}function wm(e,r,t){return r.elements.some(i=>e.ts.isIdentifier(i)?i.text===t:!1)?null:e.ts.factory.updateArrayLiteralExpression(r,[...r.elements,e.ts.factory.createIdentifier(t)])}async function mu(e,r,t,n){try{if(e.magicast){let s=`app.routes${e.typescriptEnabled?".ts":".js"}`,o=e.join(e.appDir,s),a=await e.magicast.loadFile(o);Object.keys(a.exports).length===0&&(a.exports.routes=[]);let u=Object.keys(a.exports)[0],c=a.exports[u];if(c.find(d=>d.path===r))return;let p=e.magicast.builders.raw("{}");if(p.path=r,p.component=e.magicast.builders.raw(t),c.push(p),a.imports.$items.find(d=>d.imported===t))return;a.imports.$append({imported:t,from:n}),await e.magicast.writeFile(a,o)}}catch(i){console.error(i)}}var Lm=V(Rm(),1);async function Bm(e){let r=e.ts.findConfigFile(e.getAppRootDir(),e.existsSync);if(r){let t=await e.readFile(r);if(!t)return;let n=Lm.default.parse(t);if(!n||typeof n!="object"||Array.isArray(n))return;let i=n.compilerOptions;if(!i||typeof i!="object"||Array.isArray(i))return;let s=i.paths;(!s||typeof s!="object"||Array.isArray(s))&&(i.paths={},s=i.paths),Object.assign(i.paths,{"~/*":["./src/*"]}),await e.writeFile(r,JSON.stringify(n,null,2))}}async function Mm(e){let r=[],t=await hw(e,r);r.push(...await Yo(e)),await fw(e,t);let n="BuilderPage";if(!await e.exists(e.builderPageComponentPath)){let i=await e.formatCode(e.builderPageComponentPath,Um(e,n,e.builderPageComponentPath,"builder-page","page",!0));await e.writeFile(e.builderPageComponentPath,i),r.push({filePath:e.builderPageComponentPath,modifiedType:"create"})}if(e.hasAppModule){await qo(e,"Counter",t);let i=await qo(e,n,e.builderPageComponentPath);i&&r.push({filePath:i,modifiedType:"update"})}return await mu(e,"**",n,"./components/builder-page.component"),r}async function $m(e){let r=[];r.push(...await Yo(e));let t="FigmaImportsPage",n="figma-imports.component",i=e.join(e.componentsDir,`${n}.${e.typescriptEnabled?"ts":"js"}`);if(!await e.exists(i)){let s=await e.formatCode(i,Um(e,t,i,"figma-imports","figma-imports",!1));await e.writeFile(i,s),r.push({filePath:i,modifiedType:"create"})}if(e.hasAppModule){let s=await qo(e,t,i);s&&r.push({filePath:s,modifiedType:"update"})}return await mu(e,"figma-imports",t,`./components/${n}`),await Bm(e),r}async function Yo(e){let r=[];return await e.exists(e.registryPath)||(await e.writeFile(e.registryPath,mw(e)),r.push({filePath:e.registryPath,modifiedType:"create"})),r}async function fw(e,r){let n=(await Or(e,null,!1,!1,null,null,!1,!1)).components.find(i=>i.filePath===r);n&&await Or(e,n.id,!0,!1,null,null,!0,!1)}function Um(e,r,t,n,i,s){let o=!e.hasAppModule,a=Se(e,t,e.registryPath),l=e.join(e.getAppRootDir(),"src","environments","environment.ts"),u=Se(e,t,l),c=s?` <ng-container *ngIf="content || isPreviewing; else notFound">
|
|
840
|
+
`.trimStart(),o=await e.formatCode(r,s);return await e.writeFile(r,o),"create"}return null}var Vo="builderApiKey";async function bm(e,r){let t=[],n=r.getSourceFiles(),i=r.getTypeChecker();return await Promise.all(n.map(async s=>{let o=e.basename(s.fileName);if(GS(e,s.fileName)||o.startsWith(".")||o==="node_modules"||qS.has(o))return;let a=e.normalize(s.fileName);if(a===e.registryPath)return;let l=await zo(e,i,a,s);t.push(...l)})),t.sort((s,o)=>s.cmpInfo.name.localeCompare(o.cmpInfo.name))}var qS=new Set([]),WS=new Set(["node_modules"]);function GS(e,r){for(let t of WS)if(e.dirname(r).includes(t))return!0;return!1}async function xm(e,r){let t=e.extname(r).toLowerCase();if(t===".tsx"||t===".jsx"||t===".ts"||t===".js"){let n=await e.readFile(r);if(n)return HS(e,r,n)}return null}function HS(e,r,t){let n=Ee(e,t);return zo(e,null,r,n)}async function zo(e,r,t,n){let i=[],s={};t=e.normalize(t);let o=n.statements.filter(c=>e.ts.isClassDeclaration(c)&&ZS(e,c)),a=n.statements.find(c=>e.ts.isImportDeclaration(c)&&e.ts.isStringLiteral(c.moduleSpecifier)&&c.moduleSpecifier.text==="@angular/core");if(a&&e.ts.isImportDeclaration(a)){let c=a.importClause?.namedBindings;if(c&&e.ts.isNamedImports(c)){let p=c.elements.find(d=>(d.propertyName??d.name).text==="input");p&&(s.inputSignalImportName=p.name.text)}}let l=await YS(e,r,t,n),u=ew(e,n);return await Promise.all(o.map(async c=>{let p=await JS(e,r,t,c,u,s);i.push(...p)})),i.push(...l),i}async function fu(e,r,t){if(r.node.fnNode){let{sourceFile:n,typeChecker:i}=await Di(e,r.cmpInfo.filePath,t),o=(await zo(e,i,r.cmpInfo.filePath,n)).find(a=>a.cmpInfo.id===r.cmpInfo.id);if(!o)throw new Error(`Could not find component ${r.cmpInfo.name} in ${r.cmpInfo.filePath}`);return o.cmpInfo.inputs}return[]}async function Em(e,r,t){if(!t.some(a=>!a.isRegistered))return t;let i=await at(e,t.map(a=>a.filePath)),s=i.getTypeChecker();return await Promise.all(t.filter(a=>!(a.name.endsWith("Page")||a.name.endsWith("Module")||a.name==="AppComponent")).map(async a=>{if(!a.isRegistered){let l=i.getSourceFile(a.filePath);if(l){let c=(await zo(e,s,a.filePath,l)).find(p=>p.cmpInfo.id===a.id);if(c){a.inputs=Kn(e,s,c.node.fnNode);let p=r.find(d=>d.cmpInfo.id===a.id);if(p){let d=await fu(e,p,i);Wt(a,d)}}}}return a}))}async function JS(e,r,t,n,i,s){let o=[],a=e.relative(e.getAppRootDir(),t),l=Re(e,t),u=n.name?.text;if(!u)return o;let c=!1;n.modifiers&&(c=n.modifiers.some(m=>m.kind===e.ts.SyntaxKind.DefaultKeyword));let p=c?"default":u,d=c?"default":"named",f=[];return n.members.forEach(m=>{if(e.ts.isPropertyDeclaration(m)||e.ts.isGetAccessor(m)||e.ts.isSetAccessor(m)){let y=(e.ts.getDecorators(m)??[]).find(C=>XS(e,C))!==void 0&&e.ts.isIdentifier(m.name),D=s?.inputSignalImportName!==void 0&&e.ts.isIdentifier(m.name)&&QS(e,m,s.inputSignalImportName);if(y||D){let C="any";if(e.ts.isSetAccessor(m))C=Dm(e,m.parameters[0].type);else if(m.type&&r){let b=r.getTypeAtLocation(m.type);C=r.typeToString(b)}else C=Dm(e,m.type);let x={name:m.name.text,type:i[C]?"string":C};i[C]&&(x.enum=i[C]),f.push(x)}}}),o.push({cmpInfo:{id:await Le(e,t,u),displayFilePath:Ie(e,t),name:$e(u),inputs:f,exportName:p,exportType:d,importName:u,filePath:t,relFilePath:a,importPath:l,meta:{...rw(e,n)}},node:{name:u,fnNode:n,deps:void 0}}),o}async function YS(e,r,t,n){let i=[],s=e.relative(e.getAppRootDir(),t),o=Re(e,t);for(let a of n.statements)if(e.ts.isExportDeclaration(a)&&a.exportClause&&e.ts.isNamedExports(a.exportClause))for(let l of a.exportClause.elements){let u=l.name?.text;if(!u)continue;let c=u,p="named",d=[];if(r){let h=r.getSymbolAtLocation(l.name);if(h){let g=r.getDeclaredTypeOfSymbol(h);r.getPropertiesOfType(g).forEach(D=>{let C=D.getDeclarations();C&&C.forEach(x=>{if(e.ts.isPropertyDeclaration(x)){let b=r.getTypeAtLocation(x),E={name:D.getName(),type:tw(e,r,b)};d.push(E)}})})}}let f=e.ts.isExportSpecifier(l)&&l.parent?l.parent.parent:void 0,m;if(f){let h=f.moduleSpecifier;if(h&&e.ts.isStringLiteral(h)){let g=r?.getSymbolAtLocation(h);if(g&&g.declarations&&g.declarations.length>0){let y=g.declarations[0];(!e.ts.isSourceFile(y)||e.ts.isSourceFile(y)&&y.fileName.includes("node_modules"))&&(m=h.text)}}}i.push({cmpInfo:{id:await Le(e,t,u,m),displayFilePath:Ie(e,t),name:$e(u),inputs:d,exportName:c,exportType:p,importName:u,filePath:t,relFilePath:s,importPath:m||o,externalImportPath:m},node:{name:u,fnNode:l,deps:void 0}})}return i}function XS(e,r){return Cm(e,r,"Input")}function QS(e,r,t){return e.ts.isPropertyDeclaration(r)&&r.initializer!==void 0&&e.ts.isCallExpression(r.initializer)&&e.ts.isIdentifier(r.initializer.expression)&&r.initializer.expression.text===t}function Cm(e,r,t){if(e.ts.isCallExpression(r.expression)){let n=r.expression;if(e.ts.isIdentifier(n.expression))return n.expression?.text===t}return!1}function ZS(e,r){return!!e.ts.getDecorators(r)?.some(i=>e.ts.isCallExpression(i.expression)&&e.ts.isIdentifier(i.expression.expression)&&i.expression.expression.text==="Component")}function Dm(e,r){if(!r)return"any";let t="any";switch(r.kind){case e.ts.SyntaxKind.StringKeyword:t="string";break;case e.ts.SyntaxKind.NumberKeyword:t="number";break;case e.ts.SyntaxKind.BooleanKeyword:t="boolean";break;case e.ts.SyntaxKind.TypeReference:e.ts.isTypeReferenceNode(r)&&e.ts.isIdentifier(r.typeName)&&(t=r.typeName.text);break}return t.includes("|")?"string":t}function ew(e,r){let t={};return e.ts.forEachChild(r,n=>{e.ts.isTypeAliasDeclaration(n)&&e.ts.isUnionTypeNode(n.type)&&n.type.types.every(i=>e.ts.isLiteralTypeNode(i)&&e.ts.isStringLiteral(i.literal))&&(t[n.name.text]=n.type.types.map(i=>i.literal.text))}),t}function tw(e,r,t){let n=r.typeToString(t);if(n==="any"){let i=t.getSymbol();if(i){let s=i.getDeclarations();if(s&&s.length>0){let o=s[0];if(e.ts.isVariableDeclaration(o)){let a=o.type;a&&(n=r.typeToString(r.getTypeAtLocation(a)))}}}}return n}function rw(e,r){let{getDecorators:t,isCallExpression:n,isIdentifier:i,isObjectLiteralExpression:s,isPropertyAssignment:o,isStringLiteral:a,SyntaxKind:l}=e.ts,u,c;return t(r)?.forEach(d=>{if(Cm(e,d,"Component")){let{expression:f}=d;if(n(f)){let[m]=f.arguments;s(m)&&m.properties.forEach(h=>{o(h)&&i(h.name)&&(h.name.escapedText==="selector"&&a(h.initializer)&&(u=h.initializer.text),h.name.escapedText==="standalone"&&(c=h.initializer.kind===l.TrueKeyword))})}}}),{selector:u,standalone:c}}async function qo(e,r,t){let n=e.typescriptEnabled?".ts":".js",i=`app.module${n}`,s=e.join(e.appDir,i),o=await e.readFile(s);if(!o){console.error(`Unable to read app.module.${n} at ${s}`);return}let a=await nw(e,s,r,t,o);if(!a){console.error(`Unable to update app.module.${n} at ${s}`);return}return await e.writeFile(s,a),s}async function nw(e,r,t,n,i){let s=i,o=Ee(e,i),a=Se(e,r,n);o=Ce(e,o,{namedImports:[t],importPath:a}),o=Ce(e,o,{namedImports:["Content"],importPath:"@builder.io/sdk-angular"});let l=[];for(let u of o.statements)if(e.ts.isClassDeclaration(u)&&u.name?.text==="AppModule"){let c=iw(e,t,u);l.push(c)}else l.push(u);return o=e.ts.factory.updateSourceFile(o,l),s=ct(e,o),s}function iw(e,r,t){let n=e.ts.getDecorators(t);if(n){for(let i of n)if(e.ts.isCallExpression(i.expression)&&e.ts.isIdentifier(i.expression.expression)&&i.expression.expression.text==="NgModule"){let s=i.expression.arguments;if(s.length===1&&e.ts.isObjectLiteralExpression(s[0])){let o=Sm(e,s[0],"declarations",r);if(o){let a=Sm(e,o,"imports","Content");if(a&&(o=a),o){let l=e.ts.factory.updateDecorator(i,e.ts.factory.updateCallExpression(i.expression,i.expression.expression,i.expression.typeArguments,[o])),c=[...n.map(p=>p===i?l:p),...e.ts.getModifiers(t)||[]];return e.ts.factory.updateClassDeclaration(t,c,t.name,t.typeParameters,t.heritageClauses,t.members)}}}}}return t}function Sm(e,r,t,n){let i=[...r.properties],s=i.findIndex(a=>Ne(e,a)===t);if(s>-1){let a=i[s];if(e.ts.isPropertyAssignment(a)&&a.initializer&&e.ts.isArrayLiteralExpression(a.initializer)){let l=wm(e,a.initializer,n);return l?(i[s]=e.ts.factory.updatePropertyAssignment(a,a.name,l),e.ts.factory.updateObjectLiteralExpression(r,i)):null}return null}let o=wm(e,e.ts.factory.createArrayLiteralExpression([],!0),n);return o?e.ts.factory.updateObjectLiteralExpression(r,[...i,e.ts.factory.createPropertyAssignment(t,o)]):null}function wm(e,r,t){return r.elements.some(i=>e.ts.isIdentifier(i)?i.text===t:!1)?null:e.ts.factory.updateArrayLiteralExpression(r,[...r.elements,e.ts.factory.createIdentifier(t)])}async function mu(e,r,t,n){try{if(e.magicast){let s=`app.routes${e.typescriptEnabled?".ts":".js"}`,o=e.join(e.appDir,s),a=await e.magicast.loadFile(o);Object.keys(a.exports).length===0&&(a.exports.routes=[]);let u=Object.keys(a.exports)[0],c=a.exports[u];if(c.find(d=>d.path===r))return;let p=e.magicast.builders.raw("{}");if(p.path=r,p.component=e.magicast.builders.raw(t),c.push(p),a.imports.$items.find(d=>d.imported===t))return;a.imports.$append({imported:t,from:n}),await e.magicast.writeFile(a,o)}}catch(i){console.error(i)}}var Lm=V(Rm(),1);async function Bm(e){let r=e.ts.findConfigFile(e.getAppRootDir(),e.existsSync);if(r){let t=await e.readFile(r);if(!t)return;let n=Lm.default.parse(t);if(!n||typeof n!="object"||Array.isArray(n))return;let i=n.compilerOptions;if(!i||typeof i!="object"||Array.isArray(i))return;let s=i.paths;(!s||typeof s!="object"||Array.isArray(s))&&(i.paths={},s=i.paths),Object.assign(i.paths,{"~/*":["./src/*"]}),await e.writeFile(r,JSON.stringify(n,null,2))}}async function Mm(e){let r=[],t=await hw(e,r);r.push(...await Yo(e)),await fw(e,t);let n="BuilderPage";if(!await e.exists(e.builderPageComponentPath)){let i=await e.formatCode(e.builderPageComponentPath,Um(e,n,e.builderPageComponentPath,"builder-page","page",!0));await e.writeFile(e.builderPageComponentPath,i),r.push({filePath:e.builderPageComponentPath,modifiedType:"create"})}if(e.hasAppModule){await qo(e,"Counter",t);let i=await qo(e,n,e.builderPageComponentPath);i&&r.push({filePath:i,modifiedType:"update"})}return await mu(e,"**",n,"./components/builder-page.component"),r}async function $m(e){let r=[];r.push(...await Yo(e));let t="FigmaImportsPage",n="figma-imports.component",i=e.join(e.componentsDir,`${n}.${e.typescriptEnabled?"ts":"js"}`);if(!await e.exists(i)){let s=await e.formatCode(i,Um(e,t,i,"figma-imports","figma-imports",!1));await e.writeFile(i,s),r.push({filePath:i,modifiedType:"create"})}if(e.hasAppModule){let s=await qo(e,t,i);s&&r.push({filePath:s,modifiedType:"update"})}return await mu(e,"figma-imports",t,`./components/${n}`),await Bm(e),r}async function Yo(e){let r=[];return await e.exists(e.registryPath)||(await e.writeFile(e.registryPath,mw(e)),r.push({filePath:e.registryPath,modifiedType:"create"})),r}async function fw(e,r){let n=(await Or(e,null,!1,!1,null,null,!1,!1)).components.find(i=>i.filePath===r);n&&await Or(e,n.id,!0,!1,null,null,!0,!1)}function Um(e,r,t,n,i,s){let o=!e.hasAppModule,a=Se(e,t,e.registryPath),l=e.join(e.getAppRootDir(),"src","environments","environment.ts"),u=Se(e,t,l),c=s?` <ng-container *ngIf="content || isPreviewing; else notFound">
|
|
841
841
|
<builder-content
|
|
842
842
|
[model]="model"
|
|
843
843
|
[content]="content"
|
|
@@ -976,7 +976,7 @@ export class Counter {
|
|
|
976
976
|
}
|
|
977
977
|
}
|
|
978
978
|
|
|
979
|
-
`.trimStart()}async function jm(e){await Yo(e);let r=await e.readFile(e.registryPath);return r?yw(e,r):{components:[],sourceFile:Ee(e,"")}}async function yw(e,r){let t=Ee(e,r);return Dw(e,t)}async function Dw(e,r){let t=[],n=it(e,r,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(i,s)=>{let o=await Su(e,r,i);o&&(o.nodeIndex=s,t.push(o))})),{sourceFile:r,components:$t(t)}}async function Su(e,r,t){if(!e.ts.isObjectLiteralExpression(t))return null;let n={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[]};for(let i of t.properties){if(!e.ts.isPropertyAssignment(i)||!e.ts.isIdentifier(i.name))continue;if(Ne(e,i)==="component"){let o,{initializer:a}=i;if(e.ts.isIdentifier(a))o=a.text;else if(e.ts.isCallExpression(a)){let u=a.arguments[0];e.ts.isIdentifier(u)&&(o=u.text)}if(!o)continue;n.name===""&&(n.name=$e(o)),n.importName=o;let l=await wr(e,e.registryPath,r,o);if(!l)continue;if(n.filePath=l.filePath,n.relFilePath=l.relFilePath,await e.exists(l.filePath)?n.importPath=
|
|
979
|
+
`.trimStart()}async function jm(e){await Yo(e);let r=await e.readFile(e.registryPath);return r?yw(e,r):{components:[],sourceFile:Ee(e,"")}}async function yw(e,r){let t=Ee(e,r);return Dw(e,t)}async function Dw(e,r){let t=[],n=it(e,r,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(i,s)=>{let o=await Su(e,r,i);o&&(o.nodeIndex=s,t.push(o))})),{sourceFile:r,components:$t(t)}}async function Su(e,r,t){if(!e.ts.isObjectLiteralExpression(t))return null;let n={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[]};for(let i of t.properties){if(!e.ts.isPropertyAssignment(i)||!e.ts.isIdentifier(i.name))continue;if(Ne(e,i)==="component"){let o,{initializer:a}=i;if(e.ts.isIdentifier(a))o=a.text;else if(e.ts.isCallExpression(a)){let u=a.arguments[0];e.ts.isIdentifier(u)&&(o=u.text)}if(!o)continue;n.name===""&&(n.name=$e(o)),n.importName=o;let l=await wr(e,e.registryPath,r,o);if(!l)continue;if(n.filePath=l.filePath,n.relFilePath=l.relFilePath,await e.exists(l.filePath)?n.importPath=Re(e,l.filePath):(n.externalImportPath=l.importPath,n.importPath=n.externalImportPath),n.displayFilePath=l.displayFilePath,n.exportType=l.exportType,n.externalImportPath)n.exportName=o;else{let u=await xm(e,l.filePath);if(u&&u.length>0)if(u.length===1)n.exportName=u[0].cmpInfo.exportName;else{let c=u.find(p=>p.cmpInfo.exportName===o);c&&(n.exportName=c.cmpInfo.exportName)}}continue}}return n=Ut(e,n,t),n.filePath&&n.exportName&&(n.id=await Le(e,n.filePath,n.exportName,n.externalImportPath)),n}async function Or(e,r,t,n,i,s,o,a){let l=await En(e),[u,c,p]=await Promise.all([bm(e,l),jm(e),vs(e)]),d=u.map(D=>D.cmpInfo),f=c.components,m={components:ur(d,f),registryPath:e.registryPath,registryDisplayPath:Ie(e,e.registryPath),frameworks:e.getFrameworks(),dependencies:Tr(d),publicApiKey:p.envValue??void 0,devToolsVersion:e.version};if(a)return m.components=await Em(e,u,m.components),m;let h=!1,g=c.sourceFile,y=Array.isArray(r)?r:typeof r=="string"?[r]:[];if(y.length>0){let D=y.map(b=>{let E=u.find(T=>T.cmpInfo.id===b);if(!E)throw new Error(`Component ${b} not found`);return E}),C=Array.from(new Set(D.map(b=>b.cmpInfo.filePath))),x=await at(e,C);for(let b of D){let E=m.components.find(B=>B.id===b.cmpInfo.id),T=await fu(e,b,x);Wt(E,T);let O=d.findIndex(B=>B.id===b.cmpInfo.id);d[O].inputs=T;let L=Ir(b.cmpInfo.id,d,f,t,n,i,s),{elements:N,elmIndex:U,statementIndex:oe,statement:G,variableDeclaration:P}=await xw(e,g,b);if(L.addCmpToRegistry)N.push(bw(e,L.addCmpToRegistry)),h=!0;else if(L.removeCmpFromRegistry)N.splice(U,1),h=!0;else if(L.updateRegisteredCmp){let B=lt(e,N[U],L.updateRegisteredCmp);N[U]=e.ts.factory.updateObjectLiteralExpression(B,[Km(e,L.updateRegisteredCmp),...B.properties.slice(1)]),h=!0}if(h&&o){let B=[...g.statements];B[oe]=e.ts.factory.updateVariableStatement(G,G.modifiers,e.ts.factory.updateVariableDeclarationList(G.declarationList,[e.ts.factory.updateVariableDeclaration(P,P.name,P.exclamationToken,P.type,e.ts.factory.createArrayLiteralExpression(vr(e,N)))])),g=e.ts.factory.updateSourceFile(g,B),E.exportType==="named"?g=Ce(e,g,{namedImports:[E.importName],importPath:E.externalImportPath?E.externalImportPath:Se(e,e.registryPath,E.filePath)}):g=Ce(e,g,{defaultImport:E.importName,importPath:E.externalImportPath?E.externalImportPath:Se(e,e.registryPath,E.filePath)}),g=Ce(e,g,{namedImports:["RegisteredComponent"],importPath:"@builder.io/sdk-angular",isTypeOnly:!0}),g=Nr(e,g,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),m.components=L.components,f=L.components.filter(re=>re.isRegistered)}}}if(h&&o){g=Pr(e,g),g=Ar(e,g);let D=ct(e,g);D=lr(D),D=await e.formatCode(e.registryPath,D),await e.writeFile(e.registryPath,D)}return m}function Km(e,r){let t=e.ts.factory.createIdentifier(r.importName);return e.ts.factory.createPropertyAssignment("component",t)}function bw(e,r){return lt(e,e.ts.factory.createObjectLiteralExpression([Km(e,r)],!0),r)}async function xw(e,r,t){let n=it(e,r,"CUSTOM_COMPONENTS");if(!n)throw new Error(`Exported name of the Builder registry must be "CUSTOM_COMPONENTS". Please update your Builder registry file: ${e.registryPath}`);let i=n.arrayLiteralExp.elements.filter(o=>e.ts.isObjectLiteralExpression(o)),s=-1;for(let o=0;o<i.length;o++)if((await Su(e,r,i[o]))?.id===t.cmpInfo.id){s=o;break}return{...n,elements:i,elmIndex:s}}async function Vm(e){let r=await Ew(e),t={};return{builderPageOptions:async()=>({templateContentId:"f0b8016ac92e474699293211a268ebaa",pathname:"/builder-demo",title:"Builder + Angular Demo Page"}),ensureBuilderSetup:()=>Mm(r),ensureFigmaImportPage:()=>$m(r),getRegistryPath:()=>r.registryPath,getRegistry:i=>Or(r,null,!1,!1,null,null,!1,!!i?.readAllInputTypes),addExternalPackage:async i=>{t[i]||(t[i]=`export * from "${i}";`)},loadComponent:async i=>{let s=await Or(r,i.cmpId,!1,!1,null,null,!1,!1);return{...s,component:s.components.find(o=>o.id===i.cmpId)}},registerComponent:i=>Or(r,i.cmpId,!0,!1,null,null,!0,!1),setRegisteredComponentInfo:i=>Or(r,i.cmpId,!1,!1,i,null,!0,!1),setRegisteredComponentInput:i=>Or(r,i.cmpId,!1,!1,null,i,!0,!1),unregisterComponent:i=>Or(r,i.cmpId,!1,!0,null,null,!0,!1),getPublicApiKey:()=>vs(r),setPublicApiKey:i=>ym(r,i.publicApiKey),getDependencies:i=>[{name:"@builder.io/dev-tools"},{name:"@builder.io/sdk-angular"},{name:"concurrently"}],getDevRunCommand:()=>"builder-dev",getCache:()=>Er(r),setCache:i=>Cr(r,i)}}async function Ew(e){let r=await Cw(e),t=e.getAppRootDir(),n=e.join(t,"src"),i=await qt(e),s=e.join(n,"app"),o=await tr(e,s),a={...e,srcDir:"",appDir:"",componentsDir:"",registryPath:o,angularConfigPath:r,typescriptEnabled:i,builderPageComponentPath:"",hasAppModule:!1};if(!await e.exists(n))throw new Error(`Could not find src directory. Searched for src in "${e.getAppRootDir()}".`);a.srcDir=n,a.appDir=s,a.componentsDir=e.join(a.appDir,"components"),a.builderPageComponentPath=e.join(a.componentsDir,`builder-page.component.${i?"ts":"js"}`);let l=`app.module.${i?"ts":"js"}`,u=e.join(a.appDir,l);return await e.exists(u)&&(a.hasAppModule=!0),a}async function Cw(e){let r=e.join(e.getAppRootDir(),"angular.json");if(await e.exists(r))return r;let t=e.join(e.getAppRootDir(),"project.json");if(await e.exists(t))return t;throw new Error(`Could not find Angular config file. Searched for angular.json & project.json in "${e.getAppRootDir()}".`)}var ra=V(rh(),1);async function nh(e,r){let n={components:(await r.getRegistry()).components.filter(s=>s.isRegistered).map(s=>{let o={filePath:ar(e.relative(e.getAppRootDir(),s.filePath)),name:s.name,image:s.image,description:s.description,exportName:s.exportName,inputs:zt(s.inputs)};return zt(o)}),version:1};e.debug("exporting registry components:",n.components.length);let i=(0,ra.compress)(n);return btoa(JSON.stringify(i))}async function ih(e,r,t){if(typeof t!="string")throw new Error("Invalid registry to import");let n=await r.getRegistry(),i=JSON.parse(atob(t)),s=(0,ra.decompress)(i),o=zt(n);e.debug("importing registry components:",s.components.length);for(let a of s.components){let l=ar(e.normalize(a.filePath)),u=n.components.find(p=>ar(p.filePath).endsWith(l)&&p.exportName===a.exportName);if(!u){console.error(`Could not find component to register: ${a.filePath}, ${a.exportName}`);continue}e.debug(`register (${u.id})`,u.filePath),await r.registerComponent({cmpId:u.id});for(let p of a.inputs)e.debug(`set input (${u.id})`),await r.setRegisteredComponentInput({cmpId:u.id,name:p.name,type:p.type,required:p.required,defaultValue:p.defaultValue,friendlyName:p.friendlyName,helperText:p.helperText});e.debug(`set input (${u.id}) info`);let c=await r.setRegisteredComponentInfo({cmpId:u.id,name:a.name,image:a.image,description:a.description});o=zt(c)}return o}var pr={react:"react",remix:"remix",angular:"angular",next:"next",qwik:"qwik"},$L={[pr.react]:[{version:ne.gen1,recommended:!0},{version:ne.gen2,recommended:!1}],[pr.remix]:[{version:ne.gen1,recommended:!1},{version:ne.gen2,recommended:!0}],[pr.angular]:[{version:ne.gen2,recommended:!0}],[pr.next]:[{version:ne.gen1,recommended:!0},{version:ne.gen2,recommended:!1}],[pr.qwik]:[{version:ne.gen2,recommended:!0}]};async function sh(e,r){let t=[],n=new Set;async function i(s){let o=e.join(s,"package.json");try{if(!await e.exists(o))return null;let l=await e.readFile(o);if(l===null)throw new Error(`Failed to read package.json at ${o}`);let u=JSON.parse(l);if(n.has(u.name))return null;n.add(u.name);let c={name:u.name,subPackages:[]},p=await e.readdir(s);for(let d of p)d!=="node_modules"&&(await e.stat(e.join(s,d))).isDirectory()&&c.subPackages.push(d);return t.push(c),c}catch(a){return e.Sentry?.captureException(a),null}}try{let s=e.join(r,"package.json");if(await e.exists(s)){let a=await e.readFile(s);if(a!==null){let l=JSON.parse(a),u={...l.dependencies,...l.devDependencies};for(let c of Object.keys(u)){let p=e.join(r,"node_modules",c);await i(p)}if(l.workspaces)for(let c of l.workspaces){let p=await e.readdir(e.join(r,c));for(let d of p){let f=e.join(r,c,d);await i(f)}}}}}catch(s){e.Sentry?.captureException(s)}return t}var Ww={"@builder.io/qwik-city":Zf,next:Kf,"@remix-run/react":am,react:gm,"@angular/core":Vm},Gw={"@builder.io/qwik-city":pr.qwik,next:pr.next,"@remix-run/react":pr.remix,react:pr.react,"@angular/core":pr.angular};async function wn(e){if(!e.ts)throw new Error("createDevTools() requires a TypeScript instance passed to the 'ts' option");if((!e.frameworks||e.frameworks.length===0)&&(e.frameworks=await jn(e)),e.frameworks.length===0)throw new Error("Supported Devtools framework for not found");for(let r of e.frameworks){let t=Ww[r.name];if(t){let n=await t(e);return{...n,exportRegistry:()=>nh(e,n),importRegistry:s=>ih(e,n,s),framework:Gw[r.name],findAllDependencies:async()=>await sh(e,e.getRepoRootDir())}}}throw new Error(`Devtools framework not found for ${e.getAppRootDir()}, ${JSON.stringify(e.frameworks,null,2)}`)}var RB=`
|
|
980
980
|
/** @type {import('next').NextConfig} */
|
|
981
981
|
const nextConfig = {
|
|
982
982
|
}
|
|
@@ -984,11 +984,11 @@ const nextConfig = {
|
|
|
984
984
|
module.exports = nextConfig
|
|
985
985
|
`.trimStart();function Hw(e){let r=e.regex,t=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),n="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="(?!struct)("+n+"|"+r.optional(i)+"[a-zA-Z_]\\w*"+r.optional("<[^<>]+>")+")",a={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},c={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},p={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},t,e.C_BLOCK_COMMENT_MODE]},d={className:"title",begin:r.optional(i)+e.IDENT_RE,relevance:0},f=r.optional(i)+e.IDENT_RE+"\\s*\\(",m=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],h=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],g=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],x={type:h,keyword:m,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:g},b={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:r.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,r.lookahead(/(<[^<>]+>|)\s*\(/))},E=[b,p,a,t,e.C_BLOCK_COMMENT_MODE,c,u],T={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:x,contains:E.concat([{begin:/\(/,end:/\)/,keywords:x,contains:E.concat(["self"]),relevance:0}]),relevance:0},O={className:"function",begin:"("+o+"[\\*&\\s]+)+"+f,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:x,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:n,keywords:x,relevance:0},{begin:f,returnBegin:!0,contains:[d],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,c]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:x,relevance:0,contains:[t,e.C_BLOCK_COMMENT_MODE,u,c,a,{begin:/\(/,end:/\)/,keywords:x,relevance:0,contains:["self",t,e.C_BLOCK_COMMENT_MODE,u,c,a]}]},a,t,e.C_BLOCK_COMMENT_MODE,p]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:x,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(T,O,b,E,[p,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function)\\s*<(?!<)",end:">",keywords:x,contains:["self",a]},{begin:e.IDENT_RE+"::",keywords:x},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function oh(e){let r={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},t=Hw(e),n=t.keywords;return n.type=[...n.type,...r.type],n.literal=[...n.literal,...r.literal],n.built_in=[...n.built_in,...r.built_in],n._hints=r._hints,t.name="Arduino",t.aliases=["ino"],t.supersetOf="cpp",t}function ah(e){let r=e.regex,t={},n={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[t]}]};Object.assign(t,{className:"variable",variants:[{begin:r.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},n]});let i={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},s={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},o={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t,i]};i.contains.push(o);let a={match:/\\"/},l={className:"string",begin:/'/,end:/'/},u={match:/\\'/},c={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,t]},p=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],d=e.SHEBANG({binary:`(${p.join("|")})`,relevance:10}),f={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=["if","then","else","elif","fi","for","while","until","in","do","done","case","esac","function","select"],h=["true","false"],g={match:/(\/[a-z._-]+)+/},y=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],D=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","type","typeset","ulimit","unalias"],C=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],x=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:m,literal:h,built_in:[...y,...D,"set","shopt",...C,...x]},contains:[d,e.SHEBANG(),f,c,e.HASH_COMMENT_MODE,s,g,o,a,l,u,t]}}function lh(e){let r=e.regex,t=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),n="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="("+n+"|"+r.optional(i)+"[a-zA-Z_]\\w*"+r.optional("<[^<>]+>")+")",a={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},c={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},p={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},t,e.C_BLOCK_COMMENT_MODE]},d={className:"title",begin:r.optional(i)+e.IDENT_RE,relevance:0},f=r.optional(i)+e.IDENT_RE+"\\s*\\(",g={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal128","const","static","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},y=[p,a,t,e.C_BLOCK_COMMENT_MODE,c,u],D={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:g,contains:y.concat([{begin:/\(/,end:/\)/,keywords:g,contains:y.concat(["self"]),relevance:0}]),relevance:0},C={begin:"("+o+"[\\*&\\s]+)+"+f,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:g,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:n,keywords:g,relevance:0},{begin:f,returnBegin:!0,contains:[e.inherit(d,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:g,relevance:0,contains:[t,e.C_BLOCK_COMMENT_MODE,u,c,a,{begin:/\(/,end:/\)/,keywords:g,relevance:0,contains:["self",t,e.C_BLOCK_COMMENT_MODE,u,c,a]}]},a,t,e.C_BLOCK_COMMENT_MODE,p]};return{name:"C",aliases:["h"],keywords:g,disableAutodetect:!0,illegal:"</",contains:[].concat(D,C,y,[p,{begin:e.IDENT_RE+"::",keywords:g},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:p,strings:u,keywords:g}}}function uh(e){let r=e.regex,t=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),n="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="(?!struct)("+n+"|"+r.optional(i)+"[a-zA-Z_]\\w*"+r.optional("<[^<>]+>")+")",a={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},u={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},c={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},p={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},t,e.C_BLOCK_COMMENT_MODE]},d={className:"title",begin:r.optional(i)+e.IDENT_RE,relevance:0},f=r.optional(i)+e.IDENT_RE+"\\s*\\(",m=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],h=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],g=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],y=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],x={type:h,keyword:m,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:g},b={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:r.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,r.lookahead(/(<[^<>]+>|)\s*\(/))},E=[b,p,a,t,e.C_BLOCK_COMMENT_MODE,c,u],T={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:x,contains:E.concat([{begin:/\(/,end:/\)/,keywords:x,contains:E.concat(["self"]),relevance:0}]),relevance:0},O={className:"function",begin:"("+o+"[\\*&\\s]+)+"+f,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:x,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:n,keywords:x,relevance:0},{begin:f,returnBegin:!0,contains:[d],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,c]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:x,relevance:0,contains:[t,e.C_BLOCK_COMMENT_MODE,u,c,a,{begin:/\(/,end:/\)/,keywords:x,relevance:0,contains:["self",t,e.C_BLOCK_COMMENT_MODE,u,c,a]}]},a,t,e.C_BLOCK_COMMENT_MODE,p]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:x,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(T,O,b,E,[p,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function)\\s*<(?!<)",end:">",keywords:x,contains:["self",a]},{begin:e.IDENT_RE+"::",keywords:x},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function ch(e){let r=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],t=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],n=["default","false","null","true"],i=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],s=["add","alias","and","ascending","async","await","by","descending","equals","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","remove","select","set","unmanaged","value|0","var","when","where","with","yield"],o={keyword:i.concat(s),built_in:r,literal:n},a=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),l={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},u={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},c=e.inherit(u,{illegal:/\n/}),p={className:"subst",begin:/\{/,end:/\}/,keywords:o},d=e.inherit(p,{illegal:/\n/}),f={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,d]},m={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},p]},h=e.inherit(m,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},d]});p.contains=[m,f,u,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,l,e.C_BLOCK_COMMENT_MODE],d.contains=[h,f,c,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,l,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];let g={variants:[m,f,u,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},y={begin:"<",end:">",contains:[{beginKeywords:"in out"},a]},D=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",C={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:o,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},g,l,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},a,y,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[a,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[a,y,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+D+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:o,contains:[{beginKeywords:t.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,y],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,relevance:0,contains:[g,l,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},C]}}var Jw=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Yw=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Xw=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],Qw=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],Zw=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],eT=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse();function ph(e){let r=e.regex,t=Jw(e),n={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",s=/@-?\w[\w]*(-\w+)*/,o="[a-zA-Z-][a-zA-Z0-9_-]*",a=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[t.BLOCK_COMMENT,n,t.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+o,relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+Qw.join("|")+")"},{begin:":(:)?("+Zw.join("|")+")"}]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+eT.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[t.BLOCK_COMMENT,t.HEXCOLOR,t.IMPORTANT,t.CSS_NUMBER_MODE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...a,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},t.FUNCTION_DISPATCH]},{begin:r.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:s},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:Xw.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...a,t.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Yw.join("|")+")\\b"}]}}function dh(e){let r=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:r.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:r.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function fh(e){let s={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:s,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{begin:e.C_NUMBER_RE+"[i]",relevance:1},e.C_NUMBER_MODE]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:s,illegal:/["']/}]}]}}function mh(e){let r=e.regex,t=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:r.concat(t,r.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function hh(e){let r=e.regex,t={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},n=e.COMMENT();n.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];let i={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},s={className:"literal",begin:/\bon|off|true|false|yes|no\b/},o={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},a={begin:/\[/,end:/\]/,contains:[n,s,i,o,t,"self"],relevance:0},l=/[A-Za-z0-9_-]+/,u=/"(\\"|[^"])*"/,c=/'[^']*'/,p=r.either(l,u,c),d=r.concat(p,"(\\s*\\.\\s*",p,")*",r.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[n,{className:"section",begin:/\[+/,end:/\]+/},{begin:d,className:"attr",starts:{end:/$/,contains:[n,a,s,i,o,t]}}]}}var Pi="[0-9](_*[0-9])*",na=`\\.(${Pi})`,ia="[0-9a-fA-F](_*[0-9a-fA-F])*",gh={className:"number",variants:[{begin:`(\\b(${Pi})((${na})|\\.)?|(${na}))[eE][+-]?(${Pi})[fFdD]?\\b`},{begin:`\\b(${Pi})((${na})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${na})[fFdD]?\\b`},{begin:`\\b(${Pi})[fFdD]\\b`},{begin:`\\b0[xX]((${ia})\\.?|(${ia})?\\.(${ia}))[pP][+-]?(${Pi})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${ia})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function yh(e,r,t){return t===-1?"":e.replace(r,n=>yh(e,r,t-1))}function Dh(e){let r=e.regex,t="[\xC0-\u02B8a-zA-Z_$][\xC0-\u02B8a-zA-Z_$0-9]*",n=t+yh("(?:<"+t+"~~~(?:\\s*,\\s*"+t+"~~~)*>)?",/~~~/g,2),l={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},u={className:"meta",begin:"@"+t,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},c={className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:l,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,t],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[r.concat(/(?!else)/,t),/\s+/,t,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,t],className:{1:"keyword",3:"title.class"},contains:[c,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+n+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:l,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[u,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,gh,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},gh,u]}}var bh="[A-Za-z$_][0-9A-Za-z$_]*",tT=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],rT=["true","false","null","undefined","NaN","Infinity"],xh=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Eh=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Ch=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],nT=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],iT=[].concat(Ch,xh,Eh);function Sh(e){let r=e.regex,t=(M,{after:X})=>{let v="</"+M[0].slice(1);return M.input.indexOf(v,X)!==-1},n=bh,i={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(M,X)=>{let v=M[0].length+M.index,I=M.input[v];if(I==="<"||I===","){X.ignoreMatch();return}I===">"&&(t(M,{after:v})||X.ignoreMatch());let $,H=M.input.substring(v);if($=H.match(/^\s*=/)){X.ignoreMatch();return}if(($=H.match(/^\s+extends\s+/))&&$.index===0){X.ignoreMatch();return}}},a={$pattern:bh,keyword:tT,literal:rT,built_in:iT,"variable.language":nT},l="[0-9](_?[0-9])*",u=`\\.(${l})`,c="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${c})((${u})|\\.)?|(${u}))[eE][+-]?(${l})\\b`},{begin:`\\b(${c})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},d={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},f={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"xml"}},m={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"css"}},h={begin:"gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"graphql"}},g={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,d]},D={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:n+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},C=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,m,h,g,{match:/\$\d+/},p];d.contains=C.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(C)});let x=[].concat(D,d.contains),b=x.concat([{begin:/\(/,end:/\)/,keywords:a,contains:["self"].concat(x)}]),E={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:b},T={variants:[{match:[/class/,/\s+/,n,/\s+/,/extends/,/\s+/,r.concat(n,"(",r.concat(/\./,n),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,n],scope:{1:"keyword",3:"title.class"}}]},O={relevance:0,match:r.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...xh,...Eh]}},L={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},N={variants:[{match:[/function/,/\s+/,n,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[E],illegal:/%/},U={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function oe(M){return r.concat("(?!",M.join("|"),")")}let G={match:r.concat(/\b/,oe([...Ch,"super","import"]),n,r.lookahead(/\(/)),className:"title.function",relevance:0},P={begin:r.concat(/\./,r.lookahead(r.concat(n,/(?![0-9A-Za-z$_(])/))),end:n,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},B={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},E]},re="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",F={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,r.lookahead(re)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[E]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:O},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),L,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,m,h,g,D,{match:/\$\d+/},p,O,{className:"attr",begin:n+r.lookahead(":"),relevance:0},F,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[D,e.REGEXP_MODE,{className:"function",begin:re,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:s},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},N,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[E,e.inherit(e.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},P,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[E]},G,U,T,B,{match:/\$[(.]/}]}}function wh(e){let r={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},t={match:/[{}[\],:]/,className:"punctuation",relevance:0},n=["true","false","null"],i={scope:"literal",beginKeywords:n.join(" ")};return{name:"JSON",keywords:{literal:n},contains:[r,t,e.QUOTE_STRING_MODE,i,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var Ii="[0-9](_*[0-9])*",sa=`\\.(${Ii})`,oa="[0-9a-fA-F](_*[0-9a-fA-F])*",sT={className:"number",variants:[{begin:`(\\b(${Ii})((${sa})|\\.)?|(${sa}))[eE][+-]?(${Ii})[fFdD]?\\b`},{begin:`\\b(${Ii})((${sa})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${sa})[fFdD]?\\b`},{begin:`\\b(${Ii})[fFdD]\\b`},{begin:`\\b0[xX]((${oa})\\.?|(${oa})?\\.(${oa}))[pP][+-]?(${Ii})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${oa})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Th(e){let r={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},t={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},n={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},i={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},s={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},o={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[s,i]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,s,i]}]};i.contains.push(o);let a={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},l={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(o,{className:"string"}),"self"]}]},u=sT,c=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),p={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},d=p;return d.variants[1].contains=[p],p.variants[1].contains=[d],{name:"Kotlin",aliases:["kt","kts"],keywords:r,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,c,t,n,a,l,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:r,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:r,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[p,e.C_LINE_COMMENT_MODE,c],relevance:0},e.C_LINE_COMMENT_MODE,c,a,l,o,e.C_NUMBER_MODE]},c]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},a,l]},o,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
|
|
986
986
|
`},u]}}var oT=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),aT=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],lT=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],Ah=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],vh=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],uT=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse(),cT=Ah.concat(vh);function Ph(e){let r=oT(e),t=cT,n="and or not only",i="[\\w-]+",s="("+i+"|@\\{"+i+"\\})",o=[],a=[],l=function(C){return{className:"string",begin:"~?"+C+".*?"+C}},u=function(C,x,b){return{className:C,begin:x,relevance:b}},c={$pattern:/[a-z-]+/,keyword:n,attribute:lT.join(" ")},p={begin:"\\(",end:"\\)",contains:a,keywords:c,relevance:0};a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,l("'"),l('"'),r.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},r.HEXCOLOR,p,u("variable","@@?"+i,10),u("variable","@\\{"+i+"\\}"),u("built_in","~?`[^`]*?`"),{className:"attribute",begin:i+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},r.IMPORTANT,{beginKeywords:"and not"},r.FUNCTION_DISPATCH);let d=a.concat({begin:/\{/,end:/\}/,contains:o}),f={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(a)},m={begin:s+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},r.CSS_VARIABLE,{className:"attribute",begin:"\\b("+uT.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:a}}]},h={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:c,returnEnd:!0,contains:a,relevance:0}},g={className:"variable",variants:[{begin:"@"+i+"\\s*:",relevance:15},{begin:"@"+i}],starts:{end:"[;}]",returnEnd:!0,contains:d}},y={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:s,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,f,u("keyword","all\\b"),u("variable","@\\{"+i+"\\}"),{begin:"\\b("+aT.join("|")+")\\b",className:"selector-tag"},r.CSS_NUMBER_MODE,u("selector-tag",s,0),u("selector-id","#"+s),u("selector-class","\\."+s,0),u("selector-tag","&",0),r.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+Ah.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+vh.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:d},{begin:"!important"},r.FUNCTION_DISPATCH]},D={begin:i+`:(:)?(${t.join("|")})`,returnBegin:!0,contains:[y]};return o.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,h,g,D,m,y,f,r.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:o}}function Ih(e){let r="\\[=*\\[",t="\\]=*\\]",n={begin:r,end:t,contains:["self"]},i=[e.COMMENT("--(?!"+r+")","$"),e.COMMENT("--"+r,t,{contains:[n],relevance:10})];return{name:"Lua",keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:i.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:i}].concat(i)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:r,end:t,contains:[n],relevance:5}])}}function Nh(e){let r={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},t={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,r]},n={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[r]},i={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},s={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},o={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[r]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[e.HASH_COMMENT_MODE,r,t,n,i,s,o]}}function Fh(e){let r=e.regex,t={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},n={begin:"^[-\\*]{3,}",end:"$"},i={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},s={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},o={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},a=/[A-Za-z][A-Za-z0-9+.-]*/,l={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:r.concat(/\[.+?\]\(/,a,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},u={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},c={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},p=e.inherit(u,{contains:[]}),d=e.inherit(c,{contains:[]});u.contains.push(d),c.contains.push(p);let f=[t,l];return[u,c,p,d].forEach(g=>{g.contains=g.contains.concat(f)}),f=f.concat(u,c),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:f},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:f}]}]},t,s,u,c,{className:"quote",begin:"^>\\s+",contains:f,end:"$"},i,n,l,o]}}function _h(e){let r={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},t=/[a-zA-Z@][a-zA-Z0-9_]*/,a={"variable.language":["this","super"],$pattern:t,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},l={$pattern:t,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:a,illegal:"</",contains:[r,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+l.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:l,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function kh(e){let r=e.regex,t=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],n=/[dualxmsipngr]{0,12}/,i={$pattern:/[\w.]+/,keyword:t.join(" ")},s={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:i},o={begin:/->\{/,end:/\}/},a={variants:[{begin:/\$\d/},{begin:r.concat(/[$%@](\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@][^\s\w{]/,relevance:0}]},l=[e.BACKSLASH_ESCAPE,s,a],u=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],c=(f,m,h="\\1")=>{let g=h==="\\1"?h:r.concat(h,m);return r.concat(r.concat("(?:",f,")"),m,/(?:\\.|[^\\\/])*?/,g,/(?:\\.|[^\\\/])*?/,h,n)},p=(f,m,h)=>r.concat(r.concat("(?:",f,")"),m,/(?:\\.|[^\\\/])*?/,h,n),d=[a,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),o,{className:"string",contains:l,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},{className:"number",begin:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",relevance:0},{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:c("s|tr|y",r.either(...u,{capture:!0}))},{begin:c("s|tr|y","\\(","\\)")},{begin:c("s|tr|y","\\[","\\]")},{begin:c("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:p("(?:m|qr)?",/\//,/\//)},{begin:p("m|qr",r.either(...u,{capture:!0}),/\1/)},{begin:p("m|qr",/\(/,/\)/)},{begin:p("m|qr",/\[/,/\]/)},{begin:p("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return s.contains=d,o.contains=d,{name:"Perl",aliases:["pl","pm"],keywords:i,contains:d}}function Oh(e){let r=e.regex,t=/(?![A-Za-z0-9])(?![$])/,n=r.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,t),i=r.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,t),s={scope:"variable",match:"\\$+"+n},o={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},a={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},l=e.inherit(e.APOS_STRING_MODE,{illegal:null}),u=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(a)}),c={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(a),"on:begin":(G,P)=>{P.data._beginMatch=G[1]||G[2]},"on:end":(G,P)=>{P.data._beginMatch!==G[1]&&P.ignoreMatch()}},p=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),d=`[
|
|
987
|
-
]`,f={scope:"string",variants:[u,l,c,p]},m={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},h=["false","null","true"],g=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],y=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],C={keyword:g,literal:(G=>{let P=[];return G.forEach(B=>{P.push(B),B.toLowerCase()===B?P.push(B.toUpperCase()):P.push(B.toLowerCase())}),P})(h),built_in:y},x=G=>G.map(P=>P.replace(/\|\d+$/,"")),b={variants:[{match:[/new/,r.concat(d,"+"),r.concat("(?!",x(y).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},E=r.concat(n,"\\b(?!\\()"),T={variants:[{match:[r.concat(/::/,r.lookahead(/(?!class\b)/)),E],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,r.concat(/::/,r.lookahead(/(?!class\b)/)),E],scope:{1:"title.class",3:"variable.constant"}},{match:[i,r.concat("::",r.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},O={scope:"attr",match:r.concat(n,r.lookahead(":"),r.lookahead(/(?!::)/))},L={relevance:0,begin:/\(/,end:/\)/,keywords:C,contains:[O,s,T,e.C_BLOCK_COMMENT_MODE,f,m,b]},N={relevance:0,match:[/\b/,r.concat("(?!fn\\b|function\\b|",x(g).join("\\b|"),"|",x(y).join("\\b|"),"\\b)"),n,r.concat(d,"*"),r.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[L]};L.contains.push(N);let U=[O,T,e.C_BLOCK_COMMENT_MODE,f,m,b],oe={begin:r.concat(/#\[\s*/,i),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:h,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:h,keyword:["new","array"]},contains:["self",...U]},...U,{scope:"meta",match:i}]};return{case_insensitive:!1,keywords:C,contains:[oe,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},o,{scope:"variable.language",match:/\$this\b/},s,N,T,{match:[/const/,/\s/,n],scope:{1:"keyword",3:"variable.constant"}},b,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:C,contains:["self",s,T,e.C_BLOCK_COMMENT_MODE,f,m]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},f,m]}}function Rh(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function Lh(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function Bh(e){let r=e.regex,t=/[\p{XID_Start}_]\p{XID_Continue}*/u,n=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],a={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:n,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},l={className:"meta",begin:/^(>>>|\.\.\.) /},u={className:"subst",begin:/\{/,end:/\}/,keywords:a,illegal:/#/},c={begin:/\{\{/,relevance:0},p={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l,c,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l,c,u]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,c,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,c,u]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},d="[0-9](_?[0-9])*",f=`(\\b(${d}))?\\.(${d})|\\b(${d})\\.`,m=`\\b|${n.join("|")}`,h={className:"number",relevance:0,variants:[{begin:`(\\b(${d})|(${f}))[eE][+-]?(${d})[jJ]?(?=${m})`},{begin:`(${f})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${m})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${m})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${m})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${m})`},{begin:`\\b(${d})[jJ](?=${m})`}]},g={className:"comment",begin:r.lookahead(/# type:/),end:/$/,keywords:a,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},y={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:["self",l,h,p,e.HASH_COMMENT_MODE]}]};return u.contains=[p,h,l],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:a,illegal:/(<\/|\?)|=>/,contains:[l,h,{begin:/\bself\b/},{beginKeywords:"if",relevance:0},p,g,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,t],scope:{1:"keyword",3:"title.function"},contains:[y]},{variants:[{match:[/\bclass/,/\s+/,t,/\s*/,/\(\s*/,t,/\s*\)/]},{match:[/\bclass/,/\s+/,t]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[h,y,p]}]}}function Mh(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function $h(e){let r=e.regex,t=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,n=r.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,s=r.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:t,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:r.lookahead(r.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:t},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[i,n]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,n]},{scope:{1:"punctuation",2:"number"},match:[s,n]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,n]}]},{scope:{3:"operator"},match:[t,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:s},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function Uh(e){let r=e.regex,t="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",n=r.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=r.concat(n,/(::\w+)*/),o={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},a={className:"doctag",begin:"@[A-Za-z]+"},l={begin:"#<",end:">"},u=[e.COMMENT("#","$",{contains:[a]}),e.COMMENT("^=begin","^=end",{contains:[a],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],c={className:"subst",begin:/#\{/,end:/\}/,keywords:o},p={className:"string",contains:[e.BACKSLASH_ESCAPE,c],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:r.concat(/<<[-~]?'?/,r.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,c]})]}]},d="[1-9](_?[0-9])*|0",f="[0-9](_?[0-9])*",m={className:"number",relevance:0,variants:[{begin:`\\b(${d})(\\.(${f}))?([eE][+-]?(${f})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},h={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:o}]},E=[p,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:o},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:o},{relevance:0,match:[i,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:n,scope:"title.class"},{match:[/def/,/\s+/,t],scope:{1:"keyword",3:"title.function"},contains:[h]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[p,{begin:t}],relevance:0},m,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:o},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,c],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(l,u),relevance:0}].concat(l,u);c.contains=E,h.contains=E;let N=[{begin:/^\s*=>/,starts:{end:"$",contains:E}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:o,contains:E}}];return u.unshift(l),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:o,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(N).concat(u).concat(E)}}function jh(e){let r=e.regex,t={className:"title.function.invoke",relevance:0,begin:r.concat(/\b/,/(?!let|for|while|if|else|match\b)/,e.IDENT_RE,r.lookahead(/\s*\(/))},n="([ui](8|16|32|64|128|size)|f(32|64))?",i=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","unsafe","unsized","use","virtual","where","while","yield"],s=["true","false","Some","None","Ok","Err"],o=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],a=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:a,keyword:i,literal:s,built_in:o},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'\\?(x\w{2}|u\w{4}|U\w{8}|.)'/}]},{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*/},{className:"number",variants:[{begin:"\\b0b([01_]+)"+n},{begin:"\\b0o([0-7_]+)"+n},{begin:"\\b0x([A-Fa-f0-9_]+)"+n},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+n}],relevance:0},{begin:[/fn/,/\s+/,e.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,e.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,e.UNDERSCORE_IDENT_RE,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,e.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,e.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:o,type:a}},{className:"punctuation",begin:"->"},t]}}var pT=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),dT=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],fT=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],mT=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],hT=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],gT=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse();function Kh(e){let r=pT(e),t=hT,n=mT,i="@[a-z-]+",s="and or not only",a={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,r.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},r.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+dT.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+n.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+t.join("|")+")"},a,{begin:/\(/,end:/\)/,contains:[r.CSS_NUMBER_MODE]},r.CSS_VARIABLE,{className:"attribute",begin:"\\b("+gT.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[r.BLOCK_COMMENT,a,r.HEXCOLOR,r.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,r.IMPORTANT,r.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:i,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:s,attribute:fT.join(" ")},contains:[{begin:i,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},a,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,r.HEXCOLOR,r.CSS_NUMBER_MODE]},r.FUNCTION_DISPATCH]}}function Vh(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function zh(e){let r=e.regex,t=e.COMMENT("--","$"),n={className:"string",variants:[{begin:/'/,end:/'/,contains:[{begin:/''/}]}]},i={begin:/"/,end:/"/,contains:[{begin:/""/}]},s=["true","false","unknown"],o=["double precision","large object","with timezone","without timezone"],a=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],l=["add","asc","collation","desc","final","first","last","view"],u=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],c=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],p=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],d=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],f=c,m=[...u,...l].filter(C=>!c.includes(C)),h={className:"variable",begin:/@[a-z0-9][a-z0-9_]*/},g={className:"operator",begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},y={begin:r.concat(/\b/,r.either(...f),/\s*\(/),relevance:0,keywords:{built_in:f}};function D(C,{exceptions:x,when:b}={}){let E=b;return x=x||[],C.map(T=>T.match(/\|\d+$/)||x.includes(T)?T:E(T)?`${T}|0`:T)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:D(m,{when:C=>C.length<3}),literal:s,type:a,built_in:p},contains:[{begin:r.either(...d),relevance:0,keywords:{$pattern:/[\w\.]+/,keyword:m.concat(d),literal:s,type:a}},{className:"type",begin:r.either(...o)},y,h,n,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,t,g]}}function Hh(e){return e?typeof e=="string"?e:e.source:null}function aa(e){return ke("(?=",e,")")}function ke(...e){return e.map(t=>Hh(t)).join("")}function yT(e){let r=e[e.length-1];return typeof r=="object"&&r.constructor===Object?(e.splice(e.length-1,1),r):{}}function jt(...e){return"("+(yT(e).capture?"":"?:")+e.map(n=>Hh(n)).join("|")+")"}var Uu=e=>ke(/\b/,e,/\w$/.test(e)?/\b/:/\B/),DT=["Protocol","Type"].map(Uu),qh=["init","self"].map(Uu),bT=["Any","Self"],Bu=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],Wh=["false","nil","true"],xT=["assignment","associativity","higherThan","left","lowerThan","none","right"],ET=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],Gh=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],Jh=jt(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),Yh=jt(Jh,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Mu=ke(Jh,Yh,"*"),Xh=jt(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),la=jt(Xh,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),en=ke(Xh,la,"*"),$u=ke(/[A-Z]/,la,"*"),CT=["attached","autoclosure",ke(/convention\(/,jt("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",ke(/objc\(/,en,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],ST=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function Qh(e){let r={match:/\s+/,relevance:0},t=e.COMMENT("/\\*","\\*/",{contains:["self"]}),n=[e.C_LINE_COMMENT_MODE,t],i={match:[/\./,jt(...DT,...qh)],className:{2:"keyword"}},s={match:ke(/\./,jt(...Bu)),relevance:0},o=Bu.filter(ve=>typeof ve=="string").concat(["_|0"]),a=Bu.filter(ve=>typeof ve!="string").concat(bT).map(Uu),l={variants:[{className:"keyword",match:jt(...a,...qh)}]},u={$pattern:jt(/\b\w+/,/#\w+/),keyword:o.concat(ET),literal:Wh},c=[i,s,l],p={match:ke(/\./,jt(...Gh)),relevance:0},d={className:"built_in",match:ke(/\b/,jt(...Gh),/(?=\()/)},f=[p,d],m={match:/->/,relevance:0},h={className:"operator",relevance:0,variants:[{match:Mu},{match:`\\.(\\.|${Yh})+`}]},g=[m,h],y="([0-9]_*)+",D="([0-9a-fA-F]_*)+",C={className:"number",relevance:0,variants:[{match:`\\b(${y})(\\.(${y}))?([eE][+-]?(${y}))?\\b`},{match:`\\b0x(${D})(\\.(${D}))?([pP][+-]?(${y}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},x=(ve="")=>({className:"subst",variants:[{match:ke(/\\/,ve,/[0\\tnr"']/)},{match:ke(/\\/,ve,/u\{[0-9a-fA-F]{1,8}\}/)}]}),b=(ve="")=>({className:"subst",match:ke(/\\/,ve,/[\t ]*(?:[\r\n]|\r\n)/)}),E=(ve="")=>({className:"subst",label:"interpol",begin:ke(/\\/,ve,/\(/),end:/\)/}),T=(ve="")=>({begin:ke(ve,/"""/),end:ke(/"""/,ve),contains:[x(ve),b(ve),E(ve)]}),O=(ve="")=>({begin:ke(ve,/"/),end:ke(/"/,ve),contains:[x(ve),E(ve)]}),L={className:"string",variants:[T(),T("#"),T("##"),T("###"),O(),O("#"),O("##"),O("###")]},N=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],U={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:N},oe=ve=>{let zr=ke(ve,/\//),hn=ke(/\//,ve);return{begin:zr,end:hn,contains:[...N,{scope:"comment",begin:`#(?!.*${hn})`,end:/$/}]}},G={scope:"regexp",variants:[oe("###"),oe("##"),oe("#"),U]},P={match:ke(/`/,en,/`/)},B={className:"variable",match:/\$\d+/},re={className:"variable",match:`\\$${la}+`},F=[P,B,re],M={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:ST,contains:[...g,C,L]}]}},X={scope:"keyword",match:ke(/@/,jt(...CT))},v={scope:"meta",match:ke(/@/,en)},I=[M,X,v],$={match:aa(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:ke(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,la,"+")},{className:"type",match:$u,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:ke(/\s+&\s+/,aa($u)),relevance:0}]},H={begin:/</,end:/>/,keywords:u,contains:[...n,...c,...I,m,$]};$.contains.push(H);let xe={match:ke(en,/\s*:/),keywords:"_|0",relevance:0},ae={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",xe,...n,G,...c,...f,...g,C,L,...F,...I,$]},he={begin:/</,end:/>/,keywords:"repeat each",contains:[...n,$]},yt={begin:jt(aa(ke(en,/\s*:/)),aa(ke(en,/\s+/,en,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:en}]},Pt={begin:/\(/,end:/\)/,keywords:u,contains:[yt,...n,...c,...g,C,L,...I,$,ae],endsParent:!0,illegal:/["']/},Kr={match:[/(func|macro)/,/\s+/,jt(P.match,en,Mu)],className:{1:"keyword",3:"title.function"},contains:[he,Pt,r],illegal:[/\[/,/%/]},cs={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[he,Pt,r],illegal:/\[|%/},Vr={match:[/operator/,/\s+/,Mu],className:{1:"keyword",3:"title"}},ps={begin:[/precedencegroup/,/\s+/,$u],className:{1:"keyword",3:"title"},contains:[$],keywords:[...xT,...Wh],end:/}/};for(let ve of L.variants){let zr=ve.contains.find(Xt=>Xt.label==="interpol");zr.keywords=u;let hn=[...c,...f,...g,C,L,...F];zr.contains=[...hn,{begin:/\(/,end:/\)/,contains:["self",...hn]}]}return{name:"Swift",keywords:u,contains:[...n,Kr,cs,{beginKeywords:"struct protocol class extension enum actor",end:"\\{",excludeEnd:!0,keywords:u,contains:[e.inherit(e.TITLE_MODE,{className:"title.class",begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/}),...c]},Vr,ps,{beginKeywords:"import",end:/$/,contains:[...n],relevance:0},G,...c,...f,...g,C,L,...F,...I,$,ae]}}var ua="[A-Za-z$_][0-9A-Za-z$_]*",Zh=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],eg=["true","false","null","undefined","NaN","Infinity"],tg=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],rg=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],ng=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],ig=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],sg=[].concat(ng,tg,rg);function wT(e){let r=e.regex,t=(M,{after:X})=>{let v="</"+M[0].slice(1);return M.input.indexOf(v,X)!==-1},n=ua,i={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(M,X)=>{let v=M[0].length+M.index,I=M.input[v];if(I==="<"||I===","){X.ignoreMatch();return}I===">"&&(t(M,{after:v})||X.ignoreMatch());let $,H=M.input.substring(v);if($=H.match(/^\s*=/)){X.ignoreMatch();return}if(($=H.match(/^\s+extends\s+/))&&$.index===0){X.ignoreMatch();return}}},a={$pattern:ua,keyword:Zh,literal:eg,built_in:sg,"variable.language":ig},l="[0-9](_?[0-9])*",u=`\\.(${l})`,c="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${c})((${u})|\\.)?|(${u}))[eE][+-]?(${l})\\b`},{begin:`\\b(${c})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},d={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},f={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"xml"}},m={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"css"}},h={begin:"gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"graphql"}},g={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,d]},D={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:n+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},C=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,m,h,g,{match:/\$\d+/},p];d.contains=C.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(C)});let x=[].concat(D,d.contains),b=x.concat([{begin:/\(/,end:/\)/,keywords:a,contains:["self"].concat(x)}]),E={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:b},T={variants:[{match:[/class/,/\s+/,n,/\s+/,/extends/,/\s+/,r.concat(n,"(",r.concat(/\./,n),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,n],scope:{1:"keyword",3:"title.class"}}]},O={relevance:0,match:r.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...tg,...rg]}},L={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},N={variants:[{match:[/function/,/\s+/,n,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[E],illegal:/%/},U={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function oe(M){return r.concat("(?!",M.join("|"),")")}let G={match:r.concat(/\b/,oe([...ng,"super","import"]),n,r.lookahead(/\(/)),className:"title.function",relevance:0},P={begin:r.concat(/\./,r.lookahead(r.concat(n,/(?![0-9A-Za-z$_(])/))),end:n,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},B={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},E]},re="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",F={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,r.lookahead(re)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[E]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:O},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),L,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,m,h,g,D,{match:/\$\d+/},p,O,{className:"attr",begin:n+r.lookahead(":"),relevance:0},F,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[D,e.REGEXP_MODE,{className:"function",begin:re,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:s},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},N,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[E,e.inherit(e.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},P,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[E]},G,U,T,B,{match:/\$[(.]/}]}}function og(e){let r=wT(e),t=ua,n=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],i={beginKeywords:"namespace",end:/\{/,excludeEnd:!0,contains:[r.exports.CLASS_REFERENCE]},s={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:n},contains:[r.exports.CLASS_REFERENCE]},o={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},a=["type","namespace","interface","public","private","protected","implements","declare","abstract","readonly","enum","override"],l={$pattern:ua,keyword:Zh.concat(a),literal:eg,built_in:sg.concat(n),"variable.language":ig},u={className:"meta",begin:"@"+t},c=(d,f,m)=>{let h=d.contains.findIndex(g=>g.label===f);if(h===-1)throw new Error("can not find mode to replace");d.contains.splice(h,1,m)};Object.assign(r.keywords,l),r.exports.PARAMS_CONTAINS.push(u),r.contains=r.contains.concat([u,i,s]),c(r,"shebang",e.SHEBANG()),c(r,"use_strict",o);let p=r.contains.find(d=>d.label==="func.def");return p.relevance=0,Object.assign(r,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),r}function ag(e){let r=e.regex,t={className:"string",begin:/"(""|[^/n])"C\b/},n={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,s=/\d{4}-\d{1,2}-\d{1,2}/,o=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,a=/\d{1,2}(:\d{1,2}){1,2}/,l={className:"literal",variants:[{begin:r.concat(/# */,r.either(s,i),/ *#/)},{begin:r.concat(/# */,a,/ *#/)},{begin:r.concat(/# */,o,/ *#/)},{begin:r.concat(/# */,r.either(s,i),/ +/,r.either(o,a),/ *#/)}]},u={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},c={className:"label",begin:/^\w+:/},p=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),d=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[t,n,l,u,c,p,d,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[d]}]}}function lg(e){e.regex;let r=e.COMMENT(/\(;/,/;\)/);r.contains.push("self");let t=e.COMMENT(/;;/,/$/),n=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],i={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},s={className:"variable",begin:/\$[\w_]+/},o={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},a={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},l={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},u={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:n},contains:[t,r,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},s,o,i,e.QUOTE_STRING_MODE,l,u,a]}}function ug(e){let r=e.regex,t=r.concat(/[\p{L}_]/u,r.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),n=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},s={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(s,{begin:/\(/,end:/\)/}),a=e.inherit(e.APOS_STRING_MODE,{className:"string"}),l=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),u={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:n,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[s,l,a,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[s,o,l,a]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[l]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[u],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[u],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:r.concat(/</,r.lookahead(r.concat(t,r.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:t,relevance:0,starts:u}]},{className:"tag",begin:r.concat(/<\//,r.lookahead(r.concat(t,/>/))),contains:[{className:"name",begin:t,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function cg(e){let r="true false yes no null",t="[\\w#;/?:@&=+$,.~*'()[\\]]+",n={className:"attr",variants:[{begin:"\\w[\\w :\\/.-]*:(?=[ ]|$)"},{begin:'"\\w[\\w :\\/.-]*":(?=[ ]|$)'},{begin:"'\\w[\\w :\\/.-]*':(?=[ ]|$)"}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,i]},o=e.inherit(s,{variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),p={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},d={end:",",endsWithParent:!0,excludeEnd:!0,keywords:r,relevance:0},f={begin:/\{/,end:/\}/,contains:[d],illegal:"\\n",relevance:0},m={begin:"\\[",end:"\\]",contains:[d],illegal:"\\n",relevance:0},h=[n,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+t},{className:"type",begin:"!<"+t+">"},{className:"type",begin:"!"+t},{className:"type",begin:"!!"+t},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:r,keywords:{literal:r}},p,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},f,m,s],g=[...h];return g.pop(),g.push(o),d.contains=g,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:h}}var Tn={arduino:oh,bash:ah,c:lh,cpp:uh,csharp:ch,css:ph,diff:dh,go:fh,graphql:mh,ini:hh,java:Dh,javascript:Sh,json:wh,kotlin:Th,less:Ph,lua:Ih,makefile:Nh,markdown:Fh,objectivec:_h,perl:kh,php:Oh,"php-template":Rh,plaintext:Lh,python:Bh,"python-repl":Mh,r:$h,ruby:Uh,rust:jh,scss:Kh,shell:Vh,sql:zh,swift:Qh,typescript:og,vbnet:ag,wasm:lg,xml:ug,yaml:cg};var Fg=V(Ng(),1);var _g=Fg.default;var kg={},mA="hljs-";function Yu(e){let r=_g.newInstance();return e&&s(e),{highlight:t,highlightAuto:n,listLanguages:i,register:s,registerAlias:o,registered:a};function t(l,u,c){let p=c||kg,d=typeof p.prefix=="string"?p.prefix:mA;if(!r.getLanguage(l))throw new Error("Unknown language: `"+l+"` is not registered");r.configure({__emitter:Ju,classPrefix:d});let f=r.highlight(u,{ignoreIllegals:!0,language:l});if(f.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:f.errorRaised});let m=f._emitter.root,h=m.data;return h.language=f.language,h.relevance=f.relevance,m}function n(l,u){let p=(u||kg).subset||i(),d=-1,f=0,m;for(;++d<p.length;){let h=p[d];if(!r.getLanguage(h))continue;let g=t(h,l,u);g.data&&g.data.relevance!==void 0&&g.data.relevance>f&&(f=g.data.relevance,m=g)}return m||{type:"root",children:[],data:{language:void 0,relevance:f}}}function i(){return r.listLanguages()}function s(l,u){if(typeof l=="string")r.registerLanguage(l,u);else{let c;for(c in l)Object.hasOwn(l,c)&&r.registerLanguage(c,l[c])}}function o(l,u){if(typeof l=="string")r.registerAliases(typeof u=="string"?u:[...u],{languageName:l});else{let c;for(c in l)if(Object.hasOwn(l,c)){let p=l[c];r.registerAliases(typeof p=="string"?p:[...p],{languageName:c})}}}function a(l){return!!r.getLanguage(l)}}var Ju=class{constructor(r){this.options=r,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(r){if(r==="")return;let t=this.stack[this.stack.length-1],n=t.children[t.children.length-1];n&&n.type==="text"?n.value+=r:t.children.push({type:"text",value:r})}startScope(r){this.openNode(String(r))}endScope(){this.closeNode()}__addSublanguage(r,t){let n=this.stack[this.stack.length-1],i=r.root.children;t?n.children.push({type:"element",tagName:"span",properties:{className:[t]},children:i}):n.children.push(...i)}openNode(r){let t=this,n=r.split(".").map(function(o,a){return a?o+"_".repeat(a):t.options.classPrefix+o}),i=this.stack[this.stack.length-1],s={type:"element",tagName:"span",properties:{className:n},children:[]};i.children.push(s),this.stack.push(s)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}};var Og=(e=0)=>r=>`\x1B[${r+e}m`,Rg=(e=0)=>r=>`\x1B[${38+e};5;${r}m`,Lg=(e=0)=>(r,t,n)=>`\x1B[${38+e};2;${r};${t};${n}m`,qe={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},A3=Object.keys(qe.modifier),hA=Object.keys(qe.color),gA=Object.keys(qe.bgColor),v3=[...hA,...gA];function yA(){let e=new Map;for(let[r,t]of Object.entries(qe)){for(let[n,i]of Object.entries(t))qe[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},t[n]=qe[n],e.set(i[0],i[1]);Object.defineProperty(qe,r,{value:t,enumerable:!1})}return Object.defineProperty(qe,"codes",{value:e,enumerable:!1}),qe.color.close="\x1B[39m",qe.bgColor.close="\x1B[49m",qe.color.ansi=Og(),qe.color.ansi256=Rg(),qe.color.ansi16m=Lg(),qe.bgColor.ansi=Og(10),qe.bgColor.ansi256=Rg(10),qe.bgColor.ansi16m=Lg(10),Object.defineProperties(qe,{rgbToAnsi256:{value(r,t,n){return r===t&&t===n?r<8?16:r>248?231:Math.round((r-8)/247*24)+232:16+36*Math.round(r/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(r){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(r.toString(16));if(!t)return[0,0,0];let[n]=t;n.length===3&&(n=[...n].map(s=>s+s).join(""));let i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:r=>qe.rgbToAnsi256(...qe.hexToRgb(r)),enumerable:!1},ansi256ToAnsi:{value(r){if(r<8)return 30+r;if(r<16)return 90+(r-8);let t,n,i;if(r>=232)t=((r-232)*10+8)/255,n=t,i=t;else{r-=16;let a=r%36;t=Math.floor(r/36)/5,n=Math.floor(a/6)/5,i=a%6/5}let s=Math.max(t,n,i)*2;if(s===0)return 30;let o=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(t));return s===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(r,t,n)=>qe.ansi256ToAnsi(qe.rgbToAnsi256(r,t,n)),enumerable:!1},hexToAnsi:{value:r=>qe.ansi256ToAnsi(qe.hexToAnsi256(r)),enumerable:!1}}),qe}var DA=yA(),dr=DA;var ha=V(require("node:process"),1),Mg=V(require("node:os"),1),Xu=V(require("node:tty"),1);function rr(e,r=globalThis.Deno?globalThis.Deno.args:ha.default.argv){let t=e.startsWith("-")?"":e.length===1?"-":"--",n=r.indexOf(t+e),i=r.indexOf("--");return n!==-1&&(i===-1||n<i)}var{env:Je}=ha.default,ma;rr("no-color")||rr("no-colors")||rr("color=false")||rr("color=never")?ma=0:(rr("color")||rr("colors")||rr("color=true")||rr("color=always"))&&(ma=1);function bA(){if("FORCE_COLOR"in Je)return Je.FORCE_COLOR==="true"?1:Je.FORCE_COLOR==="false"?0:Je.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(Je.FORCE_COLOR,10),3)}function xA(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function EA(e,{streamIsTTY:r,sniffFlags:t=!0}={}){let n=bA();n!==void 0&&(ma=n);let i=t?ma:n;if(i===0)return 0;if(t){if(rr("color=16m")||rr("color=full")||rr("color=truecolor"))return 3;if(rr("color=256"))return 2}if("TF_BUILD"in Je&&"AGENT_NAME"in Je)return 1;if(e&&!r&&i===void 0)return 0;let s=i||0;if(Je.TERM==="dumb")return s;if(ha.default.platform==="win32"){let o=Mg.default.release().split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if("CI"in Je)return"GITHUB_ACTIONS"in Je||"GITEA_ACTIONS"in Je?3:["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(o=>o in Je)||Je.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in Je)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Je.TEAMCITY_VERSION)?1:0;if(Je.COLORTERM==="truecolor"||Je.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in Je){let o=Number.parseInt((Je.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Je.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Je.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Je.TERM)||"COLORTERM"in Je?1:s}function Bg(e,r={}){let t=EA(e,{streamIsTTY:e&&e.isTTY,...r});return xA(t)}var CA={stdout:Bg({isTTY:Xu.default.isatty(1)}),stderr:Bg({isTTY:Xu.default.isatty(2)})},$g=CA;function Ug(e,r,t){let n=e.indexOf(r);if(n===-1)return e;let i=r.length,s=0,o="";do o+=e.slice(s,n)+r+t,s=n+i,n=e.indexOf(r,s);while(n!==-1);return o+=e.slice(s),o}function jg(e,r,t,n){let i=0,s="";do{let o=e[n-1]==="\r";s+=e.slice(i,o?n-1:n)+r+(o?`\r
|
|
987
|
+
]`,f={scope:"string",variants:[u,l,c,p]},m={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},h=["false","null","true"],g=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],y=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],C={keyword:g,literal:(G=>{let P=[];return G.forEach(B=>{P.push(B),B.toLowerCase()===B?P.push(B.toUpperCase()):P.push(B.toLowerCase())}),P})(h),built_in:y},x=G=>G.map(P=>P.replace(/\|\d+$/,"")),b={variants:[{match:[/new/,r.concat(d,"+"),r.concat("(?!",x(y).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},E=r.concat(n,"\\b(?!\\()"),T={variants:[{match:[r.concat(/::/,r.lookahead(/(?!class\b)/)),E],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,r.concat(/::/,r.lookahead(/(?!class\b)/)),E],scope:{1:"title.class",3:"variable.constant"}},{match:[i,r.concat("::",r.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},O={scope:"attr",match:r.concat(n,r.lookahead(":"),r.lookahead(/(?!::)/))},L={relevance:0,begin:/\(/,end:/\)/,keywords:C,contains:[O,s,T,e.C_BLOCK_COMMENT_MODE,f,m,b]},N={relevance:0,match:[/\b/,r.concat("(?!fn\\b|function\\b|",x(g).join("\\b|"),"|",x(y).join("\\b|"),"\\b)"),n,r.concat(d,"*"),r.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[L]};L.contains.push(N);let U=[O,T,e.C_BLOCK_COMMENT_MODE,f,m,b],oe={begin:r.concat(/#\[\s*/,i),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:h,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:h,keyword:["new","array"]},contains:["self",...U]},...U,{scope:"meta",match:i}]};return{case_insensitive:!1,keywords:C,contains:[oe,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},o,{scope:"variable.language",match:/\$this\b/},s,N,T,{match:[/const/,/\s/,n],scope:{1:"keyword",3:"variable.constant"}},b,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:C,contains:["self",s,T,e.C_BLOCK_COMMENT_MODE,f,m]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},f,m]}}function Rh(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function Lh(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function Bh(e){let r=e.regex,t=/[\p{XID_Start}_]\p{XID_Continue}*/u,n=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],a={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:n,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},l={className:"meta",begin:/^(>>>|\.\.\.) /},u={className:"subst",begin:/\{/,end:/\}/,keywords:a,illegal:/#/},c={begin:/\{\{/,relevance:0},p={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l,c,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l,c,u]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,c,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,c,u]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},d="[0-9](_?[0-9])*",f=`(\\b(${d}))?\\.(${d})|\\b(${d})\\.`,m=`\\b|${n.join("|")}`,h={className:"number",relevance:0,variants:[{begin:`(\\b(${d})|(${f}))[eE][+-]?(${d})[jJ]?(?=${m})`},{begin:`(${f})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${m})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${m})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${m})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${m})`},{begin:`\\b(${d})[jJ](?=${m})`}]},g={className:"comment",begin:r.lookahead(/# type:/),end:/$/,keywords:a,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},y={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:["self",l,h,p,e.HASH_COMMENT_MODE]}]};return u.contains=[p,h,l],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:a,illegal:/(<\/|\?)|=>/,contains:[l,h,{begin:/\bself\b/},{beginKeywords:"if",relevance:0},p,g,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,t],scope:{1:"keyword",3:"title.function"},contains:[y]},{variants:[{match:[/\bclass/,/\s+/,t,/\s*/,/\(\s*/,t,/\s*\)/]},{match:[/\bclass/,/\s+/,t]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[h,y,p]}]}}function Mh(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function $h(e){let r=e.regex,t=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,n=r.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,s=r.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:t,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:r.lookahead(r.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:t},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[i,n]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,n]},{scope:{1:"punctuation",2:"number"},match:[s,n]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,n]}]},{scope:{3:"operator"},match:[t,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:s},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function Uh(e){let r=e.regex,t="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",n=r.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=r.concat(n,/(::\w+)*/),o={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},a={className:"doctag",begin:"@[A-Za-z]+"},l={begin:"#<",end:">"},u=[e.COMMENT("#","$",{contains:[a]}),e.COMMENT("^=begin","^=end",{contains:[a],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],c={className:"subst",begin:/#\{/,end:/\}/,keywords:o},p={className:"string",contains:[e.BACKSLASH_ESCAPE,c],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:r.concat(/<<[-~]?'?/,r.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,c]})]}]},d="[1-9](_?[0-9])*|0",f="[0-9](_?[0-9])*",m={className:"number",relevance:0,variants:[{begin:`\\b(${d})(\\.(${f}))?([eE][+-]?(${f})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},h={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:o}]},E=[p,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:o},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:o},{relevance:0,match:[i,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:n,scope:"title.class"},{match:[/def/,/\s+/,t],scope:{1:"keyword",3:"title.function"},contains:[h]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[p,{begin:t}],relevance:0},m,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:o},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,c],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(l,u),relevance:0}].concat(l,u);c.contains=E,h.contains=E;let N=[{begin:/^\s*=>/,starts:{end:"$",contains:E}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:o,contains:E}}];return u.unshift(l),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:o,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(N).concat(u).concat(E)}}function jh(e){let r=e.regex,t={className:"title.function.invoke",relevance:0,begin:r.concat(/\b/,/(?!let|for|while|if|else|match\b)/,e.IDENT_RE,r.lookahead(/\s*\(/))},n="([ui](8|16|32|64|128|size)|f(32|64))?",i=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","unsafe","unsized","use","virtual","where","while","yield"],s=["true","false","Some","None","Ok","Err"],o=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],a=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:a,keyword:i,literal:s,built_in:o},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'\\?(x\w{2}|u\w{4}|U\w{8}|.)'/}]},{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*/},{className:"number",variants:[{begin:"\\b0b([01_]+)"+n},{begin:"\\b0o([0-7_]+)"+n},{begin:"\\b0x([A-Fa-f0-9_]+)"+n},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+n}],relevance:0},{begin:[/fn/,/\s+/,e.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,e.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,e.UNDERSCORE_IDENT_RE,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,e.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,e.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:o,type:a}},{className:"punctuation",begin:"->"},t]}}var pT=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),dT=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],fT=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],mT=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],hT=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],gT=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse();function Kh(e){let r=pT(e),t=hT,n=mT,i="@[a-z-]+",s="and or not only",a={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,r.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},r.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+dT.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+n.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+t.join("|")+")"},a,{begin:/\(/,end:/\)/,contains:[r.CSS_NUMBER_MODE]},r.CSS_VARIABLE,{className:"attribute",begin:"\\b("+gT.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[r.BLOCK_COMMENT,a,r.HEXCOLOR,r.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,r.IMPORTANT,r.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:i,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:s,attribute:fT.join(" ")},contains:[{begin:i,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},a,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,r.HEXCOLOR,r.CSS_NUMBER_MODE]},r.FUNCTION_DISPATCH]}}function Vh(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function zh(e){let r=e.regex,t=e.COMMENT("--","$"),n={className:"string",variants:[{begin:/'/,end:/'/,contains:[{begin:/''/}]}]},i={begin:/"/,end:/"/,contains:[{begin:/""/}]},s=["true","false","unknown"],o=["double precision","large object","with timezone","without timezone"],a=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],l=["add","asc","collation","desc","final","first","last","view"],u=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],c=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],p=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],d=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],f=c,m=[...u,...l].filter(C=>!c.includes(C)),h={className:"variable",begin:/@[a-z0-9][a-z0-9_]*/},g={className:"operator",begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},y={begin:r.concat(/\b/,r.either(...f),/\s*\(/),relevance:0,keywords:{built_in:f}};function D(C,{exceptions:x,when:b}={}){let E=b;return x=x||[],C.map(T=>T.match(/\|\d+$/)||x.includes(T)?T:E(T)?`${T}|0`:T)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:D(m,{when:C=>C.length<3}),literal:s,type:a,built_in:p},contains:[{begin:r.either(...d),relevance:0,keywords:{$pattern:/[\w\.]+/,keyword:m.concat(d),literal:s,type:a}},{className:"type",begin:r.either(...o)},y,h,n,i,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,t,g]}}function Hh(e){return e?typeof e=="string"?e:e.source:null}function aa(e){return ke("(?=",e,")")}function ke(...e){return e.map(t=>Hh(t)).join("")}function yT(e){let r=e[e.length-1];return typeof r=="object"&&r.constructor===Object?(e.splice(e.length-1,1),r):{}}function jt(...e){return"("+(yT(e).capture?"":"?:")+e.map(n=>Hh(n)).join("|")+")"}var Uu=e=>ke(/\b/,e,/\w$/.test(e)?/\b/:/\B/),DT=["Protocol","Type"].map(Uu),qh=["init","self"].map(Uu),bT=["Any","Self"],Bu=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],Wh=["false","nil","true"],xT=["assignment","associativity","higherThan","left","lowerThan","none","right"],ET=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],Gh=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],Jh=jt(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),Yh=jt(Jh,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Mu=ke(Jh,Yh,"*"),Xh=jt(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),la=jt(Xh,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),en=ke(Xh,la,"*"),$u=ke(/[A-Z]/,la,"*"),CT=["attached","autoclosure",ke(/convention\(/,jt("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",ke(/objc\(/,en,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],ST=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function Qh(e){let r={match:/\s+/,relevance:0},t=e.COMMENT("/\\*","\\*/",{contains:["self"]}),n=[e.C_LINE_COMMENT_MODE,t],i={match:[/\./,jt(...DT,...qh)],className:{2:"keyword"}},s={match:ke(/\./,jt(...Bu)),relevance:0},o=Bu.filter(ve=>typeof ve=="string").concat(["_|0"]),a=Bu.filter(ve=>typeof ve!="string").concat(bT).map(Uu),l={variants:[{className:"keyword",match:jt(...a,...qh)}]},u={$pattern:jt(/\b\w+/,/#\w+/),keyword:o.concat(ET),literal:Wh},c=[i,s,l],p={match:ke(/\./,jt(...Gh)),relevance:0},d={className:"built_in",match:ke(/\b/,jt(...Gh),/(?=\()/)},f=[p,d],m={match:/->/,relevance:0},h={className:"operator",relevance:0,variants:[{match:Mu},{match:`\\.(\\.|${Yh})+`}]},g=[m,h],y="([0-9]_*)+",D="([0-9a-fA-F]_*)+",C={className:"number",relevance:0,variants:[{match:`\\b(${y})(\\.(${y}))?([eE][+-]?(${y}))?\\b`},{match:`\\b0x(${D})(\\.(${D}))?([pP][+-]?(${y}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},x=(ve="")=>({className:"subst",variants:[{match:ke(/\\/,ve,/[0\\tnr"']/)},{match:ke(/\\/,ve,/u\{[0-9a-fA-F]{1,8}\}/)}]}),b=(ve="")=>({className:"subst",match:ke(/\\/,ve,/[\t ]*(?:[\r\n]|\r\n)/)}),E=(ve="")=>({className:"subst",label:"interpol",begin:ke(/\\/,ve,/\(/),end:/\)/}),T=(ve="")=>({begin:ke(ve,/"""/),end:ke(/"""/,ve),contains:[x(ve),b(ve),E(ve)]}),O=(ve="")=>({begin:ke(ve,/"/),end:ke(/"/,ve),contains:[x(ve),E(ve)]}),L={className:"string",variants:[T(),T("#"),T("##"),T("###"),O(),O("#"),O("##"),O("###")]},N=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],U={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:N},oe=ve=>{let zr=ke(ve,/\//),hn=ke(/\//,ve);return{begin:zr,end:hn,contains:[...N,{scope:"comment",begin:`#(?!.*${hn})`,end:/$/}]}},G={scope:"regexp",variants:[oe("###"),oe("##"),oe("#"),U]},P={match:ke(/`/,en,/`/)},B={className:"variable",match:/\$\d+/},re={className:"variable",match:`\\$${la}+`},F=[P,B,re],M={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:ST,contains:[...g,C,L]}]}},X={scope:"keyword",match:ke(/@/,jt(...CT))},v={scope:"meta",match:ke(/@/,en)},I=[M,X,v],$={match:aa(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:ke(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,la,"+")},{className:"type",match:$u,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:ke(/\s+&\s+/,aa($u)),relevance:0}]},H={begin:/</,end:/>/,keywords:u,contains:[...n,...c,...I,m,$]};$.contains.push(H);let xe={match:ke(en,/\s*:/),keywords:"_|0",relevance:0},ae={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",xe,...n,G,...c,...f,...g,C,L,...F,...I,$]},me={begin:/</,end:/>/,keywords:"repeat each",contains:[...n,$]},yt={begin:jt(aa(ke(en,/\s*:/)),aa(ke(en,/\s+/,en,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:en}]},Pt={begin:/\(/,end:/\)/,keywords:u,contains:[yt,...n,...c,...g,C,L,...I,$,ae],endsParent:!0,illegal:/["']/},Kr={match:[/(func|macro)/,/\s+/,jt(P.match,en,Mu)],className:{1:"keyword",3:"title.function"},contains:[me,Pt,r],illegal:[/\[/,/%/]},cs={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[me,Pt,r],illegal:/\[|%/},Vr={match:[/operator/,/\s+/,Mu],className:{1:"keyword",3:"title"}},ps={begin:[/precedencegroup/,/\s+/,$u],className:{1:"keyword",3:"title"},contains:[$],keywords:[...xT,...Wh],end:/}/};for(let ve of L.variants){let zr=ve.contains.find(Xt=>Xt.label==="interpol");zr.keywords=u;let hn=[...c,...f,...g,C,L,...F];zr.contains=[...hn,{begin:/\(/,end:/\)/,contains:["self",...hn]}]}return{name:"Swift",keywords:u,contains:[...n,Kr,cs,{beginKeywords:"struct protocol class extension enum actor",end:"\\{",excludeEnd:!0,keywords:u,contains:[e.inherit(e.TITLE_MODE,{className:"title.class",begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/}),...c]},Vr,ps,{beginKeywords:"import",end:/$/,contains:[...n],relevance:0},G,...c,...f,...g,C,L,...F,...I,$,ae]}}var ua="[A-Za-z$_][0-9A-Za-z$_]*",Zh=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],eg=["true","false","null","undefined","NaN","Infinity"],tg=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],rg=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],ng=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],ig=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],sg=[].concat(ng,tg,rg);function wT(e){let r=e.regex,t=(M,{after:X})=>{let v="</"+M[0].slice(1);return M.input.indexOf(v,X)!==-1},n=ua,i={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(M,X)=>{let v=M[0].length+M.index,I=M.input[v];if(I==="<"||I===","){X.ignoreMatch();return}I===">"&&(t(M,{after:v})||X.ignoreMatch());let $,H=M.input.substring(v);if($=H.match(/^\s*=/)){X.ignoreMatch();return}if(($=H.match(/^\s+extends\s+/))&&$.index===0){X.ignoreMatch();return}}},a={$pattern:ua,keyword:Zh,literal:eg,built_in:sg,"variable.language":ig},l="[0-9](_?[0-9])*",u=`\\.(${l})`,c="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${c})((${u})|\\.)?|(${u}))[eE][+-]?(${l})\\b`},{begin:`\\b(${c})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},d={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},f={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"xml"}},m={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"css"}},h={begin:"gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,d],subLanguage:"graphql"}},g={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,d]},D={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:n+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},C=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,m,h,g,{match:/\$\d+/},p];d.contains=C.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(C)});let x=[].concat(D,d.contains),b=x.concat([{begin:/\(/,end:/\)/,keywords:a,contains:["self"].concat(x)}]),E={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:b},T={variants:[{match:[/class/,/\s+/,n,/\s+/,/extends/,/\s+/,r.concat(n,"(",r.concat(/\./,n),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,n],scope:{1:"keyword",3:"title.class"}}]},O={relevance:0,match:r.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...tg,...rg]}},L={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},N={variants:[{match:[/function/,/\s+/,n,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[E],illegal:/%/},U={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function oe(M){return r.concat("(?!",M.join("|"),")")}let G={match:r.concat(/\b/,oe([...ng,"super","import"]),n,r.lookahead(/\(/)),className:"title.function",relevance:0},P={begin:r.concat(/\./,r.lookahead(r.concat(n,/(?![0-9A-Za-z$_(])/))),end:n,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},B={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},E]},re="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",F={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,r.lookahead(re)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[E]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:b,CLASS_REFERENCE:O},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),L,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,m,h,g,D,{match:/\$\d+/},p,O,{className:"attr",begin:n+r.lookahead(":"),relevance:0},F,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[D,e.REGEXP_MODE,{className:"function",begin:re,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:b}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:s},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},N,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[E,e.inherit(e.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},P,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[E]},G,U,T,B,{match:/\$[(.]/}]}}function og(e){let r=wT(e),t=ua,n=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],i={beginKeywords:"namespace",end:/\{/,excludeEnd:!0,contains:[r.exports.CLASS_REFERENCE]},s={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:n},contains:[r.exports.CLASS_REFERENCE]},o={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},a=["type","namespace","interface","public","private","protected","implements","declare","abstract","readonly","enum","override"],l={$pattern:ua,keyword:Zh.concat(a),literal:eg,built_in:sg.concat(n),"variable.language":ig},u={className:"meta",begin:"@"+t},c=(d,f,m)=>{let h=d.contains.findIndex(g=>g.label===f);if(h===-1)throw new Error("can not find mode to replace");d.contains.splice(h,1,m)};Object.assign(r.keywords,l),r.exports.PARAMS_CONTAINS.push(u),r.contains=r.contains.concat([u,i,s]),c(r,"shebang",e.SHEBANG()),c(r,"use_strict",o);let p=r.contains.find(d=>d.label==="func.def");return p.relevance=0,Object.assign(r,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),r}function ag(e){let r=e.regex,t={className:"string",begin:/"(""|[^/n])"C\b/},n={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},i=/\d{1,2}\/\d{1,2}\/\d{4}/,s=/\d{4}-\d{1,2}-\d{1,2}/,o=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,a=/\d{1,2}(:\d{1,2}){1,2}/,l={className:"literal",variants:[{begin:r.concat(/# */,r.either(s,i),/ *#/)},{begin:r.concat(/# */,a,/ *#/)},{begin:r.concat(/# */,o,/ *#/)},{begin:r.concat(/# */,r.either(s,i),/ +/,r.either(o,a),/ *#/)}]},u={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},c={className:"label",begin:/^\w+:/},p=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),d=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[t,n,l,u,c,p,d,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[d]}]}}function lg(e){e.regex;let r=e.COMMENT(/\(;/,/;\)/);r.contains.push("self");let t=e.COMMENT(/;;/,/$/),n=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],i={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},s={className:"variable",begin:/\$[\w_]+/},o={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},a={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},l={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},u={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:n},contains:[t,r,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},s,o,i,e.QUOTE_STRING_MODE,l,u,a]}}function ug(e){let r=e.regex,t=r.concat(/[\p{L}_]/u,r.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),n=/[\p{L}0-9._:-]+/u,i={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},s={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(s,{begin:/\(/,end:/\)/}),a=e.inherit(e.APOS_STRING_MODE,{className:"string"}),l=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),u={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:n,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[i]},{begin:/'/,end:/'/,contains:[i]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[s,l,a,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[s,o,l,a]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},i,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[l]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[u],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[u],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:r.concat(/</,r.lookahead(r.concat(t,r.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:t,relevance:0,starts:u}]},{className:"tag",begin:r.concat(/<\//,r.lookahead(r.concat(t,/>/))),contains:[{className:"name",begin:t,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function cg(e){let r="true false yes no null",t="[\\w#;/?:@&=+$,.~*'()[\\]]+",n={className:"attr",variants:[{begin:"\\w[\\w :\\/.-]*:(?=[ ]|$)"},{begin:'"\\w[\\w :\\/.-]*":(?=[ ]|$)'},{begin:"'\\w[\\w :\\/.-]*':(?=[ ]|$)"}]},i={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,i]},o=e.inherit(s,{variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),p={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},d={end:",",endsWithParent:!0,excludeEnd:!0,keywords:r,relevance:0},f={begin:/\{/,end:/\}/,contains:[d],illegal:"\\n",relevance:0},m={begin:"\\[",end:"\\]",contains:[d],illegal:"\\n",relevance:0},h=[n,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+t},{className:"type",begin:"!<"+t+">"},{className:"type",begin:"!"+t},{className:"type",begin:"!!"+t},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:r,keywords:{literal:r}},p,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},f,m,s],g=[...h];return g.pop(),g.push(o),d.contains=g,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:h}}var Tn={arduino:oh,bash:ah,c:lh,cpp:uh,csharp:ch,css:ph,diff:dh,go:fh,graphql:mh,ini:hh,java:Dh,javascript:Sh,json:wh,kotlin:Th,less:Ph,lua:Ih,makefile:Nh,markdown:Fh,objectivec:_h,perl:kh,php:Oh,"php-template":Rh,plaintext:Lh,python:Bh,"python-repl":Mh,r:$h,ruby:Uh,rust:jh,scss:Kh,shell:Vh,sql:zh,swift:Qh,typescript:og,vbnet:ag,wasm:lg,xml:ug,yaml:cg};var Fg=V(Ng(),1);var _g=Fg.default;var kg={},mA="hljs-";function Yu(e){let r=_g.newInstance();return e&&s(e),{highlight:t,highlightAuto:n,listLanguages:i,register:s,registerAlias:o,registered:a};function t(l,u,c){let p=c||kg,d=typeof p.prefix=="string"?p.prefix:mA;if(!r.getLanguage(l))throw new Error("Unknown language: `"+l+"` is not registered");r.configure({__emitter:Ju,classPrefix:d});let f=r.highlight(u,{ignoreIllegals:!0,language:l});if(f.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:f.errorRaised});let m=f._emitter.root,h=m.data;return h.language=f.language,h.relevance=f.relevance,m}function n(l,u){let p=(u||kg).subset||i(),d=-1,f=0,m;for(;++d<p.length;){let h=p[d];if(!r.getLanguage(h))continue;let g=t(h,l,u);g.data&&g.data.relevance!==void 0&&g.data.relevance>f&&(f=g.data.relevance,m=g)}return m||{type:"root",children:[],data:{language:void 0,relevance:f}}}function i(){return r.listLanguages()}function s(l,u){if(typeof l=="string")r.registerLanguage(l,u);else{let c;for(c in l)Object.hasOwn(l,c)&&r.registerLanguage(c,l[c])}}function o(l,u){if(typeof l=="string")r.registerAliases(typeof u=="string"?u:[...u],{languageName:l});else{let c;for(c in l)if(Object.hasOwn(l,c)){let p=l[c];r.registerAliases(typeof p=="string"?p:[...p],{languageName:c})}}}function a(l){return!!r.getLanguage(l)}}var Ju=class{constructor(r){this.options=r,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(r){if(r==="")return;let t=this.stack[this.stack.length-1],n=t.children[t.children.length-1];n&&n.type==="text"?n.value+=r:t.children.push({type:"text",value:r})}startScope(r){this.openNode(String(r))}endScope(){this.closeNode()}__addSublanguage(r,t){let n=this.stack[this.stack.length-1],i=r.root.children;t?n.children.push({type:"element",tagName:"span",properties:{className:[t]},children:i}):n.children.push(...i)}openNode(r){let t=this,n=r.split(".").map(function(o,a){return a?o+"_".repeat(a):t.options.classPrefix+o}),i=this.stack[this.stack.length-1],s={type:"element",tagName:"span",properties:{className:n},children:[]};i.children.push(s),this.stack.push(s)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}};var Og=(e=0)=>r=>`\x1B[${r+e}m`,Rg=(e=0)=>r=>`\x1B[${38+e};5;${r}m`,Lg=(e=0)=>(r,t,n)=>`\x1B[${38+e};2;${r};${t};${n}m`,qe={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},A3=Object.keys(qe.modifier),hA=Object.keys(qe.color),gA=Object.keys(qe.bgColor),v3=[...hA,...gA];function yA(){let e=new Map;for(let[r,t]of Object.entries(qe)){for(let[n,i]of Object.entries(t))qe[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},t[n]=qe[n],e.set(i[0],i[1]);Object.defineProperty(qe,r,{value:t,enumerable:!1})}return Object.defineProperty(qe,"codes",{value:e,enumerable:!1}),qe.color.close="\x1B[39m",qe.bgColor.close="\x1B[49m",qe.color.ansi=Og(),qe.color.ansi256=Rg(),qe.color.ansi16m=Lg(),qe.bgColor.ansi=Og(10),qe.bgColor.ansi256=Rg(10),qe.bgColor.ansi16m=Lg(10),Object.defineProperties(qe,{rgbToAnsi256:{value(r,t,n){return r===t&&t===n?r<8?16:r>248?231:Math.round((r-8)/247*24)+232:16+36*Math.round(r/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(r){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(r.toString(16));if(!t)return[0,0,0];let[n]=t;n.length===3&&(n=[...n].map(s=>s+s).join(""));let i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:r=>qe.rgbToAnsi256(...qe.hexToRgb(r)),enumerable:!1},ansi256ToAnsi:{value(r){if(r<8)return 30+r;if(r<16)return 90+(r-8);let t,n,i;if(r>=232)t=((r-232)*10+8)/255,n=t,i=t;else{r-=16;let a=r%36;t=Math.floor(r/36)/5,n=Math.floor(a/6)/5,i=a%6/5}let s=Math.max(t,n,i)*2;if(s===0)return 30;let o=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(t));return s===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(r,t,n)=>qe.ansi256ToAnsi(qe.rgbToAnsi256(r,t,n)),enumerable:!1},hexToAnsi:{value:r=>qe.ansi256ToAnsi(qe.hexToAnsi256(r)),enumerable:!1}}),qe}var DA=yA(),dr=DA;var ha=V(require("node:process"),1),Mg=V(require("node:os"),1),Xu=V(require("node:tty"),1);function rr(e,r=globalThis.Deno?globalThis.Deno.args:ha.default.argv){let t=e.startsWith("-")?"":e.length===1?"-":"--",n=r.indexOf(t+e),i=r.indexOf("--");return n!==-1&&(i===-1||n<i)}var{env:Je}=ha.default,ma;rr("no-color")||rr("no-colors")||rr("color=false")||rr("color=never")?ma=0:(rr("color")||rr("colors")||rr("color=true")||rr("color=always"))&&(ma=1);function bA(){if("FORCE_COLOR"in Je)return Je.FORCE_COLOR==="true"?1:Je.FORCE_COLOR==="false"?0:Je.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(Je.FORCE_COLOR,10),3)}function xA(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function EA(e,{streamIsTTY:r,sniffFlags:t=!0}={}){let n=bA();n!==void 0&&(ma=n);let i=t?ma:n;if(i===0)return 0;if(t){if(rr("color=16m")||rr("color=full")||rr("color=truecolor"))return 3;if(rr("color=256"))return 2}if("TF_BUILD"in Je&&"AGENT_NAME"in Je)return 1;if(e&&!r&&i===void 0)return 0;let s=i||0;if(Je.TERM==="dumb")return s;if(ha.default.platform==="win32"){let o=Mg.default.release().split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if("CI"in Je)return"GITHUB_ACTIONS"in Je||"GITEA_ACTIONS"in Je?3:["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(o=>o in Je)||Je.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in Je)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Je.TEAMCITY_VERSION)?1:0;if(Je.COLORTERM==="truecolor"||Je.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in Je){let o=Number.parseInt((Je.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Je.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Je.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Je.TERM)||"COLORTERM"in Je?1:s}function Bg(e,r={}){let t=EA(e,{streamIsTTY:e&&e.isTTY,...r});return xA(t)}var CA={stdout:Bg({isTTY:Xu.default.isatty(1)}),stderr:Bg({isTTY:Xu.default.isatty(2)})},$g=CA;function Ug(e,r,t){let n=e.indexOf(r);if(n===-1)return e;let i=r.length,s=0,o="";do o+=e.slice(s,n)+r+t,s=n+i,n=e.indexOf(r,s);while(n!==-1);return o+=e.slice(s),o}function jg(e,r,t,n){let i=0,s="";do{let o=e[n-1]==="\r";s+=e.slice(i,o?n-1:n)+r+(o?`\r
|
|
988
988
|
`:`
|
|
989
989
|
`)+t,i=n+1,n=e.indexOf(`
|
|
990
990
|
`,i)}while(n!==-1);return s+=e.slice(i),s}var{stdout:Kg,stderr:Vg}=$g,Qu=Symbol("GENERATOR"),_i=Symbol("STYLER"),Rs=Symbol("IS_EMPTY"),zg=["ansi","ansi","ansi256","ansi16m"],ki=Object.create(null),SA=(e,r={})=>{if(r.level&&!(Number.isInteger(r.level)&&r.level>=0&&r.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let t=Kg?Kg.level:0;e.level=r.level===void 0?t:r.level},ga=class{constructor(r){return qg(r)}},qg=e=>{let r=(...t)=>t.join(" ");return SA(r,e),Object.setPrototypeOf(r,Ls.prototype),r};function Ls(e){return qg(e)}Object.setPrototypeOf(Ls.prototype,Function.prototype);for(let[e,r]of Object.entries(dr))ki[e]={get(){let t=ya(this,ec(r.open,r.close,this[_i]),this[Rs]);return Object.defineProperty(this,e,{value:t}),t}};ki.visible={get(){let e=ya(this,this[_i],!0);return Object.defineProperty(this,"visible",{value:e}),e}};var Zu=(e,r,t,...n)=>e==="rgb"?r==="ansi16m"?dr[t].ansi16m(...n):r==="ansi256"?dr[t].ansi256(dr.rgbToAnsi256(...n)):dr[t].ansi(dr.rgbToAnsi(...n)):e==="hex"?Zu("rgb",r,t,...dr.hexToRgb(...n)):dr[t][e](...n),wA=["rgb","hex","ansi256"];for(let e of wA){ki[e]={get(){let{level:t}=this;return function(...n){let i=ec(Zu(e,zg[t],"color",...n),dr.color.close,this[_i]);return ya(this,i,this[Rs])}}};let r="bg"+e[0].toUpperCase()+e.slice(1);ki[r]={get(){let{level:t}=this;return function(...n){let i=ec(Zu(e,zg[t],"bgColor",...n),dr.bgColor.close,this[_i]);return ya(this,i,this[Rs])}}}}var TA=Object.defineProperties(()=>{},{...ki,level:{enumerable:!0,get(){return this[Qu].level},set(e){this[Qu].level=e}}}),ec=(e,r,t)=>{let n,i;return t===void 0?(n=e,i=r):(n=t.openAll+e,i=r+t.closeAll),{open:e,close:r,openAll:n,closeAll:i,parent:t}},ya=(e,r,t)=>{let n=(...i)=>AA(n,i.length===1?""+i[0]:i.join(" "));return Object.setPrototypeOf(n,TA),n[Qu]=e,n[_i]=r,n[Rs]=t,n},AA=(e,r)=>{if(e.level<=0||!r)return e[Rs]?"":r;let t=e[_i];if(t===void 0)return r;let{openAll:n,closeAll:i}=t;if(r.includes("\x1B"))for(;t!==void 0;)r=Ug(r,t.close,t.open),t=t.parent;let s=r.indexOf(`
|
|
991
|
-
`);return s!==-1&&(r=jg(r,i,n,s)),n+r+i};Object.defineProperties(Ls.prototype,ki);var O3=Ls(),R3=Ls({level:Vg?Vg.level:0});var De=new ga({level:2}),Wg={comment:De.gray,quote:De.gray,keyword:De.green,"selector-tag":De.green,addition:De.green,number:De.cyan,string:De.cyan,"meta meta-string":De.cyan,literal:De.cyan,doctag:De.cyan,regexp:De.cyan,title:De.blue,section:De.blue,name:De.blue,"selector-id":De.blue,"selector-class":De.blue,attribute:De.yellow,attr:De.yellow,variable:De.yellow,"template-variable":De.yellow,"class title":De.yellow,type:De.yellow,symbol:De.magenta,bullet:De.magenta,subst:De.magenta,meta:De.magenta,"meta keyword":De.magenta,"selector-attr":De.magenta,"selector-pseudo":De.magenta,link:De.magenta,built_in:De.red,deletion:De.red,emphasis:De.italic,strong:De.bold,formula:De.inverse};function Xn(e){let r=Yu(e);return{highlight:t,highlightAuto:n,listLanguages:r.listLanguages,register:r.register,registerAlias:r.registerAlias,registered:r.registered};function t(i,s,o){let a=r.highlight(i,s),l=a.data;return{language:l.language,relevance:l.relevance,value:tc(o||Wg,a)}}function n(i,s){let o,a;if(s&&("subset"in s||"sheet"in s)){let c=s;a={subset:c.subset},o=c.sheet}else o=s;let l=r.highlightAuto(i,a),u=l.data;return{language:u.language,relevance:u.relevance,value:tc(o||Wg,l)}}}function tc(e,r){let t=new Set(r.type==="element"&&Array.isArray(r.properties.className)?r.properties.className.map(function(a){return String(a).replace(/^hljs-/,"")}):[]),n={},i,s="",o;for(o in e)if(Object.hasOwn(e,o)){let a=o.split(" "),l=e[o];t.has(a[0])?a.length===1?i=l:n[a.slice(1).join(" ")]=l:n[o]=l}return"value"in r?s=r.value:"children"in r&&(s=vA(n,r.children)),i&&(s=i(s)),s}function vA(e,r){let t=[],n=-1;for(;++n<r.length;)t.push(tc(e,r[n]));return t.join("")}var Gg=V(require("@sentry/node"),1),Hg=V(require("@amplitude/analytics-node"),1);async function ee(e){if(process.env.NODE_ENV!=="test")try{await Promise.allSettled([Gg.flush(2e3),Hg.flush().promise])}catch(r){console.error(r)}process.exit(e)}var fr=process.env.AIR_HOST||"https://air-layout-v2-tk43uighdq-uc.a.run.app";var Mr=V(require("@amplitude/analytics-node"),1),_n=V(require("@sentry/node"),1);var Jg="1.5.13";var ht=require("node:fs/promises"),YD=require("node:crypto"),Ye=require("node:fs"),uo=require("node:os"),Ae=V(require("node:path"),1),hp=V(require("prettier"),1),XD=V(require("typescript"),1),QD=V(require("launch-editor"),1);var Zi=require("node:child_process");var mp={};YE(mp,{MagicastError:()=>Tt,builders:()=>W1,detectCodeFormat:()=>GD,generateCode:()=>fp,loadFile:()=>z1,parseExpression:()=>JD,parseModule:()=>HD,writeFile:()=>q1});var ja=require("node:fs");var Ja=V(Ey(),1),fD=V(Qy(),1);function Jt(e){var r=e.use(Qe),t=r.Type,n=r.builtInTypes,i=n.number;function s(u){return t.from(c=>i.check(c)&&c>=u,i+" >= "+u)}let o={null:function(){return null},emptyArray:function(){return[]},false:function(){return!1},true:function(){return!0},undefined:function(){},"use strict":function(){return"use strict"}};var a=t.or(n.string,n.number,n.boolean,n.null,n.undefined);let l=t.from(u=>{if(u===null)return!0;var c=typeof u;return!(c==="object"||c==="function")},a.toString());return{geq:s,defaults:o,isPrimitive:l}}function Oe(e){try{var r=e(),t=r.exports,n=t.default}catch{return}n&&n!==t&&typeof t=="object"&&(Object.assign(n,t,{default:n}),t.__esModule&&Object.defineProperty(n,"__esModule",{value:!0}),r.exports=n)}var yP=Object.defineProperty,DP=(e,r,t)=>r in e?yP(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,kt=(e,r,t)=>(DP(e,typeof r!="symbol"?r+"":r,t),t),mD=Object.prototype,Ka=mD.toString,ir=mD.hasOwnProperty,si=class{assert(r,t){if(!this.check(r,t)){var n=lp(r);throw new Error(n+" does not match type "+this)}return!0}arrayOf(){let r=this;return new io(r)}},io=class extends si{constructor(r){super(),this.elemType=r,kt(this,"kind","ArrayType")}toString(){return"["+this.elemType+"]"}check(r,t){return Array.isArray(r)&&r.every(n=>this.elemType.check(n,t))}},Va=class extends si{constructor(r){super(),this.value=r,kt(this,"kind","IdentityType")}toString(){return String(this.value)}check(r,t){let n=r===this.value;return!n&&typeof t=="function"&&t(this,r),n}},za=class extends si{constructor(r){super(),this.fields=r,kt(this,"kind","ObjectType")}toString(){return"{ "+this.fields.join(", ")+" }"}check(r,t){return Ka.call(r)===Ka.call({})&&this.fields.every(n=>n.type.check(r[n.name],t))}},qa=class extends si{constructor(r){super(),this.types=r,kt(this,"kind","OrType")}toString(){return this.types.join(" | ")}check(r,t){return this.types.some(n=>n.check(r,!!t))?!0:(typeof t=="function"&&t(this,r),!1)}},ii=class extends si{constructor(r,t){super(),this.name=r,this.predicate=t,kt(this,"kind","PredicateType")}toString(){return this.name}check(r,t){let n=this.predicate(r,t);return!n&&typeof t=="function"&&t(this,r),n}},ro=class e{constructor(r,t){this.type=r,this.typeName=t,kt(this,"baseNames",[]),kt(this,"ownFields",Object.create(null)),kt(this,"allSupertypes",Object.create(null)),kt(this,"supertypeList",[]),kt(this,"allFields",Object.create(null)),kt(this,"fieldNames",[]),kt(this,"finalized",!1),kt(this,"buildable",!1),kt(this,"buildParams",[])}isSupertypeOf(r){if(r instanceof e){if(this.finalized!==!0||r.finalized!==!0)throw new Error("");return ir.call(r.allSupertypes,this.typeName)}else throw new Error(r+" is not a Def")}checkAllFields(r,t){var n=this.allFields;if(this.finalized!==!0)throw new Error(""+this.typeName);function i(s){var o=n[s],a=o.type,l=o.getValue(r);return a.check(l,t)}return r!==null&&typeof r=="object"&&Object.keys(n).every(i)}bases(...r){var t=this.baseNames;if(this.finalized){if(r.length!==t.length)throw new Error("");for(var n=0;n<r.length;n++)if(r[n]!==t[n])throw new Error("");return this}return r.forEach(i=>{t.indexOf(i)<0&&t.push(i)}),this}},Wa=class{constructor(r,t,n,i){this.name=r,this.type=t,this.defaultFn=n,kt(this,"hidden"),this.hidden=!!i}toString(){return JSON.stringify(this.name)+": "+this.type}getValue(r){var t=r[this.name];return typeof t<"u"||typeof this.defaultFn=="function"&&(t=this.defaultFn.call(r)),t}};function lp(e){return Array.isArray(e)?"["+e.map(lp).join(", ")+"]":e&&typeof e=="object"?"{ "+Object.keys(e).map(function(r){return r+": "+e[r]}).join(", ")+" }":JSON.stringify(e)}function Qe(e){let r={or(...v){return new qa(v.map(I=>r.from(I)))},from(v,I){if(v instanceof io||v instanceof Va||v instanceof za||v instanceof qa||v instanceof ii)return v;if(v instanceof ro)return v.type;if(a.check(v)){if(v.length!==1)throw new Error("only one element type is permitted for typed arrays");return new io(r.from(v[0]))}if(l.check(v))return new za(Object.keys(v).map(H=>new Wa(H,r.from(v[H],H))));if(typeof v=="function"){var $=t.indexOf(v);if($>=0)return n[$];if(typeof I!="string")throw new Error("missing name");return new ii(I,v)}return new Va(v)},def(v){return ir.call(y,v)?y[v]:y[v]=new C(v)},hasDef(v){return ir.call(y,v)}};var t=[],n=[];function i(v,I){let $=Ka.call(I),H=new ii(v,xe=>Ka.call(xe)===$);return I&&typeof I.constructor=="function"&&(t.push(I.constructor),n.push(H)),H}let s=i("string","truthy"),o=i("function",function(){}),a=i("array",[]),l=i("object",{}),u=i("RegExp",/./),c=i("Date",new Date),p=i("number",3),d=i("boolean",!0),f=i("null",null),m=i("undefined",void 0),h=typeof BigInt=="function"?i("BigInt",BigInt(1234)):new ii("BigInt",()=>!1),g={string:s,function:o,array:a,object:l,RegExp:u,Date:c,number:p,boolean:d,null:f,undefined:m,BigInt:h};var y=Object.create(null);function D(v){if(v&&typeof v=="object"){var I=v.type;if(typeof I=="string"&&ir.call(y,I)){var $=y[I];if($.finalized)return $}}return null}class C extends ro{constructor(I){super(new ii(I,($,H)=>this.check($,H)),I)}check(I,$){if(this.finalized!==!0)throw new Error("prematurely checking unfinalized type "+this.typeName);if(I===null||typeof I!="object")return!1;var H=D(I);return H?$&&H===this?this.checkAllFields(I,$):this.isSupertypeOf(H)?$?H.checkAllFields(I,$)&&this.checkAllFields(I,!1):!0:!1:this.typeName==="SourceLocation"||this.typeName==="Position"?this.checkAllFields(I,$):!1}build(...I){if(this.buildParams=I,this.buildable)return this;this.field("type",String,()=>this.typeName),this.buildable=!0;let $=(xe,ae,he,yt)=>{if(!ir.call(xe,ae)){var Pt=this.allFields;if(!ir.call(Pt,ae))throw new Error(""+ae);var Kr=Pt[ae],cs=Kr.type,Vr;if(yt)Vr=he;else if(Kr.defaultFn)Vr=Kr.defaultFn.call(xe);else{var ps="no value or default function given for field "+JSON.stringify(ae)+" of "+this.typeName+"("+this.buildParams.map(function(ve){return Pt[ve]}).join(", ")+")";throw new Error(ps)}if(!cs.check(Vr))throw new Error(lp(Vr)+" does not match field "+Kr+" of type "+this.typeName);xe[ae]=Vr}},H=(...xe)=>{var ae=xe.length;if(!this.finalized)throw new Error("attempting to instantiate unfinalized type "+this.typeName);var he=Object.create(T);if(this.buildParams.forEach(function(yt,Pt){Pt<ae?$(he,yt,xe[Pt],!0):$(he,yt,null,!1)}),Object.keys(this.allFields).forEach(function(yt){$(he,yt,null,!1)}),he.type!==this.typeName)throw new Error("");return he};return H.from=xe=>{if(!this.finalized)throw new Error("attempting to instantiate unfinalized type "+this.typeName);var ae=Object.create(T);if(Object.keys(this.allFields).forEach(function(he){ir.call(xe,he)?$(ae,he,xe[he],!0):$(ae,he,null,!1)}),ae.type!==this.typeName)throw new Error("");return ae},Object.defineProperty(E,L(this.typeName),{enumerable:!0,value:H}),this}field(I,$,H,xe){return this.finalized?(console.error("Ignoring attempt to redefine field "+JSON.stringify(I)+" of finalized type "+JSON.stringify(this.typeName)),this):(this.ownFields[I]=new Wa(I,r.from($),H,xe),this)}finalize(){if(!this.finalized){var I=this.allFields,$=this.allSupertypes;this.baseNames.forEach(xe=>{var ae=y[xe];if(ae instanceof ro)ae.finalize(),M(I,ae.allFields),M($,ae.allSupertypes);else{var he="unknown supertype name "+JSON.stringify(xe)+" for subtype "+JSON.stringify(this.typeName);throw new Error(he)}}),M(I,this.ownFields),$[this.typeName]=this,this.fieldNames.length=0;for(var H in I)ir.call(I,H)&&!I[H].hidden&&this.fieldNames.push(H);Object.defineProperty(U,this.typeName,{enumerable:!0,value:this.type}),this.finalized=!0,F(this.typeName,this.supertypeList),this.buildable&&this.supertypeList.lastIndexOf("Expression")>=0&&re(this.typeName)}}}function x(v){if(!ir.call(y,v))throw new Error("");var I=y[v];if(I.finalized!==!0)throw new Error("");return I.supertypeList.slice(1)}function b(v){for(var I={},$=Object.keys(y),H=$.length,xe=0;xe<H;++xe){var ae=$[xe],he=y[ae];if(he.finalized!==!0)throw new Error(""+ae);for(var yt=0;yt<he.supertypeList.length;++yt){var Pt=he.supertypeList[yt];if(ir.call(v,Pt)){I[ae]=Pt;break}}}return I}var E=Object.create(null),T={};function O(v,I){var $=T[v];return m.check(I)?delete T[v]:(o.assert(I),Object.defineProperty(T,v,{enumerable:!0,configurable:!0,value:I})),$}function L(v){return v.replace(/^[A-Z]+/,function(I){var $=I.length;switch($){case 0:return"";case 1:return I.toLowerCase();default:return I.slice(0,$-1).toLowerCase()+I.charAt($-1)}})}function N(v){return v=L(v),v.replace(/(Expression)?$/,"Statement")}var U={};function oe(v){var I=D(v);if(I)return I.fieldNames.slice(0);if("type"in v)throw new Error("did not recognize object of type "+JSON.stringify(v.type));return Object.keys(v)}function G(v,I){var $=D(v);if($){var H=$.allFields[I];if(H)return H.getValue(v)}return v&&v[I]}function P(v,I,$){oe(v).forEach(function(H){I.call(this,H,G(v,H))},$)}function B(v,I,$){return oe(v).some(function(H){return I.call(this,H,G(v,H))},$)}function re(v){var I=N(v);if(E[I])return;var $=E[L(v)];if(!$)return;let H=function(...xe){return E.expressionStatement($.apply(E,xe))};H.from=function(...xe){return E.expressionStatement($.from.apply(E,xe))},E[I]=H}function F(v,I){I.length=0,I.push(v);for(var $=Object.create(null),H=0;H<I.length;++H){v=I[H];var xe=y[v];if(xe.finalized!==!0)throw new Error("");ir.call($,v)&&delete I[$[v]],$[v]=H,I.push.apply(I,xe.baseNames)}for(var ae=0,he=ae,yt=I.length;he<yt;++he)ir.call(I,he)&&(I[ae++]=I[he]);I.length=ae}function M(v,I){return Object.keys(I).forEach(function($){v[$]=I[$]}),v}function X(){Object.keys(y).forEach(function(v){y[v].finalize()})}return{Type:r,builtInTypes:g,getSupertypeNames:x,computeSupertypeLookupTable:b,builders:E,defineMethod:O,getBuilderName:L,getStatementBuilderName:N,namedTypes:U,getFieldNames:oe,getFieldValue:G,eachField:P,someField:B,finalize:X}}Oe(()=>module);var bP=Object.prototype,_a=bP.hasOwnProperty;function hD(e){var r=e.use(Qe),t=r.builtInTypes.array,n=r.builtInTypes.number;let i=function p(d,f,m){if(!(this instanceof p))throw new Error("Path constructor cannot be invoked without 'new'");if(f){if(!(f instanceof p))throw new Error("")}else f=null,m=null;this.value=d,this.parentPath=f,this.name=m,this.__childCache=null};var s=i.prototype;function o(p){return p.__childCache||(p.__childCache=Object.create(null))}function a(p,d){var f=o(p),m=p.getValueProperty(d),h=f[d];return(!_a.call(f,d)||h.value!==m)&&(h=f[d]=new p.constructor(m,p,d)),h}s.getValueProperty=function(d){return this.value[d]},s.get=function(...d){for(var f=this,m=d.length,h=0;h<m;++h)f=a(f,d[h]);return f},s.each=function(d,f){for(var m=[],h=this.value.length,g=0,g=0;g<h;++g)_a.call(this.value,g)&&(m[g]=this.get(g));for(f=f||this,g=0;g<h;++g)_a.call(m,g)&&d.call(f,m[g])},s.map=function(d,f){var m=[];return this.each(function(h){m.push(d.call(this,h))},f),m},s.filter=function(d,f){var m=[];return this.each(function(h){d.call(this,h)&&m.push(h)},f),m};function l(){}function u(p,d,f,m){if(t.assert(p.value),d===0)return l;var h=p.value.length;if(h<1)return l;var g=arguments.length;g===2?(f=0,m=h):g===3?(f=Math.max(f,0),m=h):(f=Math.max(f,0),m=Math.min(m,h)),n.assert(f),n.assert(m);for(var y=Object.create(null),D=o(p),C=f;C<m;++C)if(_a.call(p.value,C)){var x=p.get(C);if(x.name!==C)throw new Error("");var b=C+d;x.name=b,y[b]=x,delete D[C]}return delete D.length,function(){for(var E in y){var T=y[E];if(T.name!==+E)throw new Error("");D[E]=T,p.value[E]=T.value}}}s.shift=function(){var d=u(this,-1),f=this.value.shift();return d(),f},s.unshift=function(...d){var f=u(this,d.length),m=this.value.unshift.apply(this.value,d);return f(),m},s.push=function(...d){return t.assert(this.value),delete o(this).length,this.value.push.apply(this.value,d)},s.pop=function(){t.assert(this.value);var d=o(this);return delete d[this.value.length-1],delete d.length,this.value.pop()},s.insertAt=function(d){var f=arguments.length,m=u(this,f-1,d);if(m===l&&f<=1)return this;d=Math.max(d,0);for(var h=1;h<f;++h)this.value[d+h-1]=arguments[h];return m(),this},s.insertBefore=function(...d){for(var f=this.parentPath,m=d.length,h=[this.name],g=0;g<m;++g)h.push(d[g]);return f.insertAt.apply(f,h)},s.insertAfter=function(...d){for(var f=this.parentPath,m=d.length,h=[this.name+1],g=0;g<m;++g)h.push(d[g]);return f.insertAt.apply(f,h)};function c(p){if(!(p instanceof i))throw new Error("");var d=p.parentPath;if(!d)return p;var f=d.value,m=o(d);if(f[p.name]===p.value)m[p.name]=p;else if(t.check(f)){var h=f.indexOf(p.value);h>=0&&(m[p.name=h]=p)}else f[p.name]=p.value,m[p.name]=p;if(f[p.name]!==p.value)throw new Error("");if(p.parentPath.get(p.name)!==p)throw new Error("");return p}return s.replace=function(d){var f=[],m=this.parentPath.value,h=o(this.parentPath),g=arguments.length;if(c(this),t.check(m)){for(var y=m.length,D=u(this.parentPath,g-1,this.name+1),C=[this.name,1],x=0;x<g;++x)C.push(arguments[x]);var b=m.splice.apply(m,C);if(b[0]!==this.value)throw new Error("");if(m.length!==y-1+g)throw new Error("");if(D(),g===0)delete this.value,delete h[this.name],this.__childCache=null;else{if(m[this.name]!==d)throw new Error("");for(this.value!==d&&(this.value=d,this.__childCache=null),x=0;x<g;++x)f.push(this.parentPath.get(this.name+x));if(f[0]!==this)throw new Error("")}}else if(g===1)this.value!==d&&(this.__childCache=null),this.value=m[this.name]=d,f.push(this);else if(g===0)delete m[this.name],delete this.value,this.__childCache=null;else throw new Error("Could not replace path");return f},i}Oe(()=>module);var qi=Object.prototype.hasOwnProperty;function xP(e){var r=e.use(Qe),t=r.Type,n=r.namedTypes,i=n.Node,s=n.Expression,o=r.builtInTypes.array,a=r.builders;let l=function x(b,E){if(!(this instanceof x))throw new Error("Scope constructor cannot be invoked without 'new'");c.check(b.value)||u.assert(b.value);var T;if(E){if(!(E instanceof x))throw new Error("");T=E.depth+1}else E=null,T=0;Object.defineProperties(this,{path:{value:b},node:{value:b.value},isGlobal:{value:!E,enumerable:!0},depth:{value:T},parent:{value:E},bindings:{value:{}},types:{value:{}}})};var u=t.or(n.Program,n.Function,n.CatchClause),c=t.or(n.Function,n.ClassDeclaration,n.ClassExpression,n.InterfaceDeclaration,n.TSInterfaceDeclaration,n.TypeAlias,n.TSTypeAliasDeclaration),p=t.or(n.TypeParameter,n.TSTypeParameter);l.isEstablishedBy=function(x){return u.check(x)||c.check(x)};var d=l.prototype;d.didScan=!1,d.declares=function(x){return this.scan(),qi.call(this.bindings,x)},d.declaresType=function(x){return this.scan(),qi.call(this.types,x)},d.declareTemporary=function(x){if(x){if(!/^[a-z$_]/i.test(x))throw new Error("")}else x="t$";x+=this.depth.toString(36)+"$",this.scan();for(var b=0;this.declares(x+b);)++b;var E=x+b;return this.bindings[E]=r.builders.identifier(E)},d.injectTemporary=function(x,b){x||(x=this.declareTemporary());var E=this.path.get("body");return n.BlockStatement.check(E.value)&&(E=E.get("body")),E.unshift(a.variableDeclaration("var",[a.variableDeclarator(x,b||null)])),x},d.scan=function(x){if(x||!this.didScan){for(var b in this.bindings)delete this.bindings[b];for(var b in this.types)delete this.types[b];f(this.path,this.bindings,this.types),this.didScan=!0}},d.getBindings=function(){return this.scan(),this.bindings},d.getTypes=function(){return this.scan(),this.types};function f(x,b,E){var T=x.value;if(c.check(T)){let O=x.get("typeParameters","params");o.check(O.value)&&O.each(L=>{C(L,E)})}u.check(T)&&(n.CatchClause.check(T)?y(x.get("param"),b):m(x,b,E))}function m(x,b,E){var T=x.value;x.parent&&n.FunctionExpression.check(x.parent.node)&&x.parent.node.id&&y(x.parent.get("id"),b),T&&(o.check(T)?x.each(O=>{g(O,b,E)}):n.Function.check(T)?(x.get("params").each(O=>{y(O,b)}),g(x.get("body"),b,E),m(x.get("typeParameters"),b,E)):n.TypeAlias&&n.TypeAlias.check(T)||n.InterfaceDeclaration&&n.InterfaceDeclaration.check(T)||n.TSTypeAliasDeclaration&&n.TSTypeAliasDeclaration.check(T)||n.TSInterfaceDeclaration&&n.TSInterfaceDeclaration.check(T)?D(x.get("id"),E):n.VariableDeclarator.check(T)?(y(x.get("id"),b),g(x.get("init"),b,E)):T.type==="ImportSpecifier"||T.type==="ImportNamespaceSpecifier"||T.type==="ImportDefaultSpecifier"?y(x.get(T.local?"local":T.name?"name":"id"),b):i.check(T)&&!s.check(T)&&r.eachField(T,function(O,L){var N=x.get(O);if(!h(N,L))throw new Error("");g(N,b,E)}))}function h(x,b){return!!(x.value===b||Array.isArray(x.value)&&x.value.length===0&&Array.isArray(b)&&b.length===0)}function g(x,b,E){var T=x.value;if(!(!T||s.check(T)))if(n.FunctionDeclaration.check(T)&&T.id!==null)y(x.get("id"),b);else if(n.ClassDeclaration&&n.ClassDeclaration.check(T)&&T.id!==null)y(x.get("id"),b),m(x.get("typeParameters"),b,E);else if(n.InterfaceDeclaration&&n.InterfaceDeclaration.check(T)||n.TSInterfaceDeclaration&&n.TSInterfaceDeclaration.check(T))D(x.get("id"),E);else if(u.check(T)){if(n.CatchClause.check(T)&&n.Identifier.check(T.param)){var O=T.param.name,L=qi.call(b,O);m(x.get("body"),b,E),L||delete b[O]}}else m(x,b,E)}function y(x,b){var E=x.value;n.Pattern.assert(E),n.Identifier.check(E)?qi.call(b,E.name)?b[E.name].push(x):b[E.name]=[x]:n.AssignmentPattern&&n.AssignmentPattern.check(E)?y(x.get("left"),b):n.ObjectPattern&&n.ObjectPattern.check(E)?x.get("properties").each(function(T){var O=T.value;n.Pattern.check(O)?y(T,b):n.Property.check(O)||n.ObjectProperty&&n.ObjectProperty.check(O)?y(T.get("value"),b):n.SpreadProperty&&n.SpreadProperty.check(O)&&y(T.get("argument"),b)}):n.ArrayPattern&&n.ArrayPattern.check(E)?x.get("elements").each(function(T){var O=T.value;n.Pattern.check(O)?y(T,b):n.SpreadElement&&n.SpreadElement.check(O)&&y(T.get("argument"),b)}):n.PropertyPattern&&n.PropertyPattern.check(E)?y(x.get("pattern"),b):(n.SpreadElementPattern&&n.SpreadElementPattern.check(E)||n.RestElement&&n.RestElement.check(E)||n.SpreadPropertyPattern&&n.SpreadPropertyPattern.check(E))&&y(x.get("argument"),b)}function D(x,b){var E=x.value;n.Pattern.assert(E),n.Identifier.check(E)&&(qi.call(b,E.name)?b[E.name].push(x):b[E.name]=[x])}function C(x,b){var E=x.value;p.assert(E),qi.call(b,E.name)?b[E.name].push(x):b[E.name]=[x]}return d.lookup=function(x){for(var b=this;b&&!b.declares(x);b=b.parent);return b},d.lookupType=function(x){for(var b=this;b&&!b.declaresType(x);b=b.parent);return b},d.getGlobalScope=function(){for(var x=this;!x.isGlobal;)x=x.parent;return x},l}Oe(()=>module);function gD(e){var r=e.use(Qe),t=r.namedTypes,n=r.builders,i=r.builtInTypes.number,s=r.builtInTypes.array,o=e.use(hD),a=e.use(xP);let l=function g(y,D,C){if(!(this instanceof g))throw new Error("NodePath constructor cannot be invoked without 'new'");o.call(this,y,D,C)};var u=l.prototype=Object.create(o.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}});Object.defineProperties(u,{node:{get:function(){return Object.defineProperty(this,"node",{configurable:!0,value:this._computeNode()}),this.node}},parent:{get:function(){return Object.defineProperty(this,"parent",{configurable:!0,value:this._computeParent()}),this.parent}},scope:{get:function(){return Object.defineProperty(this,"scope",{configurable:!0,value:this._computeScope()}),this.scope}}}),u.replace=function(){return delete this.node,delete this.parent,delete this.scope,o.prototype.replace.apply(this,arguments)},u.prune=function(){var g=this.parent;return this.replace(),m(g)},u._computeNode=function(){var g=this.value;if(t.Node.check(g))return g;var y=this.parentPath;return y&&y.node||null},u._computeParent=function(){var g=this.value,y=this.parentPath;if(!t.Node.check(g)){for(;y&&!t.Node.check(y.value);)y=y.parentPath;y&&(y=y.parentPath)}for(;y&&!t.Node.check(y.value);)y=y.parentPath;return y||null},u._computeScope=function(){var g=this.value,y=this.parentPath,D=y&&y.scope;return t.Node.check(g)&&a.isEstablishedBy(g)&&(D=new a(this,D)),D||null},u.getValueProperty=function(g){return r.getFieldValue(this.value,g)},u.needsParens=function(g){var y=this.parentPath;if(!y)return!1;var D=this.value;if(!t.Expression.check(D)||D.type==="Identifier")return!1;for(;!t.Node.check(y.value);)if(y=y.parentPath,!y)return!1;var C=y.value;switch(D.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return C.type==="MemberExpression"&&this.name==="object"&&C.object===D;case"BinaryExpression":case"LogicalExpression":switch(C.type){case"CallExpression":return this.name==="callee"&&C.callee===D;case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return!0;case"MemberExpression":return this.name==="object"&&C.object===D;case"BinaryExpression":case"LogicalExpression":{let x=D,b=C.operator,E=p[b],T=x.operator,O=p[T];if(E>O)return!0;if(E===O&&this.name==="right"){if(C.right!==x)throw new Error("Nodes must be equal");return!0}}default:return!1}case"SequenceExpression":switch(C.type){case"ForStatement":return!1;case"ExpressionStatement":return this.name!=="expression";default:return!0}case"YieldExpression":switch(C.type){case"BinaryExpression":case"LogicalExpression":case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"CallExpression":case"MemberExpression":case"NewExpression":case"ConditionalExpression":case"YieldExpression":return!0;default:return!1}case"Literal":return C.type==="MemberExpression"&&i.check(D.value)&&this.name==="object"&&C.object===D;case"AssignmentExpression":case"ConditionalExpression":switch(C.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"BinaryExpression":case"LogicalExpression":return!0;case"CallExpression":return this.name==="callee"&&C.callee===D;case"ConditionalExpression":return this.name==="test"&&C.test===D;case"MemberExpression":return this.name==="object"&&C.object===D;default:return!1}default:if(C.type==="NewExpression"&&this.name==="callee"&&C.callee===D)return d(D)}return!!(g!==!0&&!this.canBeFirstInStatement()&&this.firstInStatement())};function c(g){return t.BinaryExpression.check(g)||t.LogicalExpression.check(g)}var p={};[["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"]].forEach(function(g,y){g.forEach(function(D){p[D]=y})});function d(g){return t.CallExpression.check(g)?!0:s.check(g)?g.some(d):t.Node.check(g)?r.someField(g,function(y,D){return d(D)}):!1}u.canBeFirstInStatement=function(){var g=this.node;return!t.FunctionExpression.check(g)&&!t.ObjectExpression.check(g)},u.firstInStatement=function(){return f(this)};function f(g){for(var y,D;g.parent;g=g.parent){if(y=g.node,D=g.parent.node,t.BlockStatement.check(D)&&g.parent.name==="body"&&g.name===0){if(D.body[0]!==y)throw new Error("Nodes must be equal");return!0}if(t.ExpressionStatement.check(D)&&g.name==="expression"){if(D.expression!==y)throw new Error("Nodes must be equal");return!0}if(t.SequenceExpression.check(D)&&g.parent.name==="expressions"&&g.name===0){if(D.expressions[0]!==y)throw new Error("Nodes must be equal");continue}if(t.CallExpression.check(D)&&g.name==="callee"){if(D.callee!==y)throw new Error("Nodes must be equal");continue}if(t.MemberExpression.check(D)&&g.name==="object"){if(D.object!==y)throw new Error("Nodes must be equal");continue}if(t.ConditionalExpression.check(D)&&g.name==="test"){if(D.test!==y)throw new Error("Nodes must be equal");continue}if(c(D)&&g.name==="left"){if(D.left!==y)throw new Error("Nodes must be equal");continue}if(t.UnaryExpression.check(D)&&!D.prefix&&g.name==="argument"){if(D.argument!==y)throw new Error("Nodes must be equal");continue}return!1}return!0}function m(g){if(t.VariableDeclaration.check(g.node)){var y=g.get("declarations").value;if(!y||y.length===0)return g.prune()}else if(t.ExpressionStatement.check(g.node)){if(!g.get("expression").value)return g.prune()}else t.IfStatement.check(g.node)&&h(g);return g}function h(g){var y=g.get("test").value,D=g.get("alternate").value,C=g.get("consequent").value;if(!C&&!D){var x=n.expressionStatement(y);g.replace(x)}else if(!C&&D){var b=n.unaryExpression("!",y,!0);t.UnaryExpression.check(y)&&y.operator==="!"&&(b=y.argument),g.get("test").replace(b),g.get("consequent").replace(D),g.get("alternate").replace()}}return l}Oe(()=>module);var ka=Object.prototype.hasOwnProperty;function EP(e){var r=e.use(Qe),t=e.use(gD),n=r.builtInTypes.array,i=r.builtInTypes.object,s=r.builtInTypes.function,o;let a=function m(){if(!(this instanceof m))throw new Error("PathVisitor constructor cannot be invoked without 'new'");this._reusableContextStack=[],this._methodNameTable=l(this),this._shouldVisitComments=ka.call(this._methodNameTable,"Block")||ka.call(this._methodNameTable,"Line"),this.Context=d(this),this._visiting=!1,this._changeReported=!1};function l(m){var h=Object.create(null);for(var g in m)/^visit[A-Z]/.test(g)&&(h[g.slice(5)]=!0);for(var y=r.computeSupertypeLookupTable(h),D=Object.create(null),C=Object.keys(y),x=C.length,b=0;b<x;++b){var E=C[b];g="visit"+y[E],s.check(m[g])&&(D[E]=g)}return D}a.fromMethodsObject=function(h){if(h instanceof a)return h;if(!i.check(h))return new a;let g=function D(){if(!(this instanceof D))throw new Error("Visitor constructor cannot be invoked without 'new'");a.call(this)};var y=g.prototype=Object.create(c);return y.constructor=g,u(y,h),u(g,a),s.assert(g.fromMethodsObject),s.assert(g.visit),new g};function u(m,h){for(var g in h)ka.call(h,g)&&(m[g]=h[g]);return m}a.visit=function(h,g){return a.fromMethodsObject(g).visit(h)};var c=a.prototype;c.visit=function(){if(this._visiting)throw new Error("Recursively calling visitor.visit(path) resets visitor state. Try this.visit(path) or this.traverse(path) instead.");this._visiting=!0,this._changeReported=!1,this._abortRequested=!1;for(var m=arguments.length,h=new Array(m),g=0;g<m;++g)h[g]=arguments[g];h[0]instanceof t||(h[0]=new t({root:h[0]}).get("root")),this.reset.apply(this,h);var y;try{var D=this.visitWithoutReset(h[0]);y=!0}finally{if(this._visiting=!1,!y&&this._abortRequested)return h[0].value}return D},c.AbortRequest=function(){},c.abort=function(){var m=this;m._abortRequested=!0;var h=new m.AbortRequest;throw h.cancel=function(){m._abortRequested=!1},h},c.reset=function(m){},c.visitWithoutReset=function(m){if(this instanceof this.Context)return this.visitor.visitWithoutReset(m);if(!(m instanceof t))throw new Error("");var h=m.value,g=h&&typeof h=="object"&&typeof h.type=="string"&&this._methodNameTable[h.type];if(g){var y=this.acquireContext(m);try{return y.invokeVisitorMethod(g)}finally{this.releaseContext(y)}}else return p(m,this)};function p(m,h){if(!(m instanceof t))throw new Error("");if(!(h instanceof a))throw new Error("");var g=m.value;if(n.check(g))m.each(h.visitWithoutReset,h);else if(i.check(g)){var y=r.getFieldNames(g);h._shouldVisitComments&&g.comments&&y.indexOf("comments")<0&&y.push("comments");for(var D=y.length,C=[],x=0;x<D;++x){var b=y[x];ka.call(g,b)||(g[b]=r.getFieldValue(g,b)),C.push(m.get(b))}for(var x=0;x<D;++x)h.visitWithoutReset(C[x])}return m.value}c.acquireContext=function(m){return this._reusableContextStack.length===0?new this.Context(m):this._reusableContextStack.pop().reset(m)},c.releaseContext=function(m){if(!(m instanceof this.Context))throw new Error("");this._reusableContextStack.push(m),m.currentPath=null},c.reportChanged=function(){this._changeReported=!0},c.wasChangeReported=function(){return this._changeReported};function d(m){function h(y){if(!(this instanceof h))throw new Error("");if(!(this instanceof a))throw new Error("");if(!(y instanceof t))throw new Error("");Object.defineProperty(this,"visitor",{value:m,writable:!1,enumerable:!0,configurable:!1}),this.currentPath=y,this.needToCallTraverse=!0,Object.seal(this)}if(!(m instanceof a))throw new Error("");var g=h.prototype=Object.create(m);return g.constructor=h,u(g,f),h}var f=Object.create(null);return f.reset=function(h){if(!(this instanceof this.Context))throw new Error("");if(!(h instanceof t))throw new Error("");return this.currentPath=h,this.needToCallTraverse=!0,this},f.invokeVisitorMethod=function(h){if(!(this instanceof this.Context))throw new Error("");if(!(this.currentPath instanceof t))throw new Error("");var g=this.visitor[h].call(this,this.currentPath);if(g===!1?this.needToCallTraverse=!1:g!==o&&(this.currentPath=this.currentPath.replace(g)[0],this.needToCallTraverse&&this.traverse(this.currentPath)),this.needToCallTraverse!==!1)throw new Error("Must either call this.traverse or return false in "+h);var y=this.currentPath;return y&&y.value},f.traverse=function(h,g){if(!(this instanceof this.Context))throw new Error("");if(!(h instanceof t))throw new Error("");if(!(this.currentPath instanceof t))throw new Error("");return this.needToCallTraverse=!1,p(h,a.fromMethodsObject(g||this.visitor))},f.visit=function(h,g){if(!(this instanceof this.Context))throw new Error("");if(!(h instanceof t))throw new Error("");if(!(this.currentPath instanceof t))throw new Error("");return this.needToCallTraverse=!1,a.fromMethodsObject(g||this.visitor).visitWithoutReset(h)},f.reportChanged=function(){this.visitor.reportChanged()},f.abort=function(){this.needToCallTraverse=!1,this.visitor.abort()},a}Oe(()=>module);function CP(e){var r=e.use(Qe),t=r.getFieldNames,n=r.getFieldValue,i=r.builtInTypes.array,s=r.builtInTypes.object,o=r.builtInTypes.Date,a=r.builtInTypes.RegExp,l=Object.prototype.hasOwnProperty;function u(m,h,g){return i.check(g)?g.length=0:g=null,p(m,h,g)}u.assert=function(m,h){var g=[];if(!u(m,h,g))if(g.length===0){if(m!==h)throw new Error("Nodes must be equal")}else throw new Error("Nodes differ in the following path: "+g.map(c).join(""))};function c(m){return/[_$a-z][_$a-z0-9]*/i.test(m)?"."+m:"["+JSON.stringify(m)+"]"}function p(m,h,g){return m===h?!0:i.check(m)?d(m,h,g):s.check(m)?f(m,h,g):o.check(m)?o.check(h)&&+m==+h:a.check(m)?a.check(h)&&m.source===h.source&&m.global===h.global&&m.multiline===h.multiline&&m.ignoreCase===h.ignoreCase:m==h}function d(m,h,g){i.assert(m);var y=m.length;if(!i.check(h)||h.length!==y)return g&&g.push("length"),!1;for(var D=0;D<y;++D){if(g&&g.push(D),D in m!=D in h||!p(m[D],h[D],g))return!1;if(g){var C=g.pop();if(C!==D)throw new Error(""+C)}}return!0}function f(m,h,g){if(s.assert(m),!s.check(h))return!1;if(m.type!==h.type)return g&&g.push("type"),!1;var y=t(m),D=y.length,C=t(h),x=C.length;if(D===x){for(var b=0;b<D;++b){var E=y[b],T=n(m,E),O=n(h,E);if(g&&g.push(E),!p(T,O,g))return!1;if(g){var L=g.pop();if(L!==E)throw new Error(""+L)}}return!0}if(!g)return!1;var N=Object.create(null);for(b=0;b<D;++b)N[y[b]]=!0;for(b=0;b<x;++b){if(E=C[b],!l.call(N,E))return g.push(E),!1;delete N[E]}for(E in N){g.push(E);break}return!1}return u}Oe(()=>module);function SP(e){let r=wP(),t=r.use(Qe);e.forEach(r.use),t.finalize();let n=r.use(EP);return{Type:t.Type,builtInTypes:t.builtInTypes,namedTypes:t.namedTypes,builders:t.builders,defineMethod:t.defineMethod,getFieldNames:t.getFieldNames,getFieldValue:t.getFieldValue,eachField:t.eachField,someField:t.someField,getSupertypeNames:t.getSupertypeNames,getBuilderName:t.getBuilderName,astNodesAreEquivalent:r.use(CP),finalize:t.finalize,Path:r.use(hD),NodePath:r.use(gD),PathVisitor:n,use:r.use,visit:n.visit}}function wP(){let e=[],r=[];function t(i){var s=e.indexOf(i);return s===-1&&(s=e.length,e.push(i),r[s]=i(n)),r[s]}var n={use:t};return n}Oe(()=>module);function yD(){return{BinaryOperators:["==","!=","===","!==","<","<=",">",">=","<<",">>",">>>","+","-","*","/","%","&","|","^","in","instanceof"],AssignmentOperators:["=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","|=","^=","&="],LogicalOperators:["||","&&"]}}Oe(()=>module);function DD(e){let r=e.use(yD);return r.BinaryOperators.indexOf("**")<0&&r.BinaryOperators.push("**"),r.AssignmentOperators.indexOf("**=")<0&&r.AssignmentOperators.push("**="),r}Oe(()=>module);function bD(e){let r=e.use(DD);return r.LogicalOperators.indexOf("??")<0&&r.LogicalOperators.push("??"),r}Oe(()=>module);function TP(e){let r=e.use(bD);return r.LogicalOperators.forEach(t=>{let n=t+"=";r.AssignmentOperators.indexOf(n)<0&&r.AssignmentOperators.push(n)}),r}Oe(()=>module);function AP(e){var r=e.use(Qe),t=r.Type,n=t.def,i=t.or,s=e.use(Jt),o=s.defaults,a=s.geq;let{BinaryOperators:l,AssignmentOperators:u,LogicalOperators:c}=e.use(yD);n("Printable").field("loc",i(n("SourceLocation"),null),o.null,!0),n("Node").bases("Printable").field("type",String).field("comments",i([n("Comment")],null),o.null,!0),n("SourceLocation").field("start",n("Position")).field("end",n("Position")).field("source",i(String,null),o.null),n("Position").field("line",a(1)).field("column",a(0)),n("File").bases("Node").build("program","name").field("program",n("Program")).field("name",i(String,null),o.null),n("Program").bases("Node").build("body").field("body",[n("Statement")]),n("Function").bases("Node").field("id",i(n("Identifier"),null),o.null).field("params",[n("Pattern")]).field("body",n("BlockStatement")).field("generator",Boolean,o.false).field("async",Boolean,o.false),n("Statement").bases("Node"),n("EmptyStatement").bases("Statement").build(),n("BlockStatement").bases("Statement").build("body").field("body",[n("Statement")]),n("ExpressionStatement").bases("Statement").build("expression").field("expression",n("Expression")),n("IfStatement").bases("Statement").build("test","consequent","alternate").field("test",n("Expression")).field("consequent",n("Statement")).field("alternate",i(n("Statement"),null),o.null),n("LabeledStatement").bases("Statement").build("label","body").field("label",n("Identifier")).field("body",n("Statement")),n("BreakStatement").bases("Statement").build("label").field("label",i(n("Identifier"),null),o.null),n("ContinueStatement").bases("Statement").build("label").field("label",i(n("Identifier"),null),o.null),n("WithStatement").bases("Statement").build("object","body").field("object",n("Expression")).field("body",n("Statement")),n("SwitchStatement").bases("Statement").build("discriminant","cases","lexical").field("discriminant",n("Expression")).field("cases",[n("SwitchCase")]).field("lexical",Boolean,o.false),n("ReturnStatement").bases("Statement").build("argument").field("argument",i(n("Expression"),null)),n("ThrowStatement").bases("Statement").build("argument").field("argument",n("Expression")),n("TryStatement").bases("Statement").build("block","handler","finalizer").field("block",n("BlockStatement")).field("handler",i(n("CatchClause"),null),function(){return this.handlers&&this.handlers[0]||null}).field("handlers",[n("CatchClause")],function(){return this.handler?[this.handler]:[]},!0).field("guardedHandlers",[n("CatchClause")],o.emptyArray).field("finalizer",i(n("BlockStatement"),null),o.null),n("CatchClause").bases("Node").build("param","guard","body").field("param",n("Pattern")).field("guard",i(n("Expression"),null),o.null).field("body",n("BlockStatement")),n("WhileStatement").bases("Statement").build("test","body").field("test",n("Expression")).field("body",n("Statement")),n("DoWhileStatement").bases("Statement").build("body","test").field("body",n("Statement")).field("test",n("Expression")),n("ForStatement").bases("Statement").build("init","test","update","body").field("init",i(n("VariableDeclaration"),n("Expression"),null)).field("test",i(n("Expression"),null)).field("update",i(n("Expression"),null)).field("body",n("Statement")),n("ForInStatement").bases("Statement").build("left","right","body").field("left",i(n("VariableDeclaration"),n("Expression"))).field("right",n("Expression")).field("body",n("Statement")),n("DebuggerStatement").bases("Statement").build(),n("Declaration").bases("Statement"),n("FunctionDeclaration").bases("Function","Declaration").build("id","params","body").field("id",n("Identifier")),n("FunctionExpression").bases("Function","Expression").build("id","params","body"),n("VariableDeclaration").bases("Declaration").build("kind","declarations").field("kind",i("var","let","const")).field("declarations",[n("VariableDeclarator")]),n("VariableDeclarator").bases("Node").build("id","init").field("id",n("Pattern")).field("init",i(n("Expression"),null),o.null),n("Expression").bases("Node"),n("ThisExpression").bases("Expression").build(),n("ArrayExpression").bases("Expression").build("elements").field("elements",[i(n("Expression"),null)]),n("ObjectExpression").bases("Expression").build("properties").field("properties",[n("Property")]),n("Property").bases("Node").build("kind","key","value").field("kind",i("init","get","set")).field("key",i(n("Literal"),n("Identifier"))).field("value",n("Expression")),n("SequenceExpression").bases("Expression").build("expressions").field("expressions",[n("Expression")]);var p=i("-","+","!","~","typeof","void","delete");n("UnaryExpression").bases("Expression").build("operator","argument","prefix").field("operator",p).field("argument",n("Expression")).field("prefix",Boolean,o.true);let d=i(...l);n("BinaryExpression").bases("Expression").build("operator","left","right").field("operator",d).field("left",n("Expression")).field("right",n("Expression"));let f=i(...u);n("AssignmentExpression").bases("Expression").build("operator","left","right").field("operator",f).field("left",i(n("Pattern"),n("MemberExpression"))).field("right",n("Expression"));var m=i("++","--");n("UpdateExpression").bases("Expression").build("operator","argument","prefix").field("operator",m).field("argument",n("Expression")).field("prefix",Boolean);var h=i(...c);n("LogicalExpression").bases("Expression").build("operator","left","right").field("operator",h).field("left",n("Expression")).field("right",n("Expression")),n("ConditionalExpression").bases("Expression").build("test","consequent","alternate").field("test",n("Expression")).field("consequent",n("Expression")).field("alternate",n("Expression")),n("NewExpression").bases("Expression").build("callee","arguments").field("callee",n("Expression")).field("arguments",[n("Expression")]),n("CallExpression").bases("Expression").build("callee","arguments").field("callee",n("Expression")).field("arguments",[n("Expression")]),n("MemberExpression").bases("Expression").build("object","property","computed").field("object",n("Expression")).field("property",i(n("Identifier"),n("Expression"))).field("computed",Boolean,function(){var g=this.property.type;return g==="Literal"||g==="MemberExpression"||g==="BinaryExpression"}),n("Pattern").bases("Node"),n("SwitchCase").bases("Node").build("test","consequent").field("test",i(n("Expression"),null)).field("consequent",[n("Statement")]),n("Identifier").bases("Expression","Pattern").build("name").field("name",String).field("optional",Boolean,o.false),n("Literal").bases("Expression").build("value").field("value",i(String,Boolean,null,Number,RegExp,BigInt)),n("Comment").bases("Printable").field("value",String).field("leading",Boolean,o.true).field("trailing",Boolean,o.false)}Oe(()=>module);function vP(e){e.use(AP);let r=e.use(Qe),t=r.Type.def,n=r.Type.or,i=e.use(Jt).defaults;t("Function").field("generator",Boolean,i.false).field("expression",Boolean,i.false).field("defaults",[n(t("Expression"),null)],i.emptyArray).field("rest",n(t("Identifier"),null),i.null),t("RestElement").bases("Pattern").build("argument").field("argument",t("Pattern")).field("typeAnnotation",n(t("TypeAnnotation"),t("TSTypeAnnotation"),null),i.null),t("SpreadElementPattern").bases("Pattern").build("argument").field("argument",t("Pattern")),t("FunctionDeclaration").build("id","params","body","generator","expression").field("id",n(t("Identifier"),null)),t("FunctionExpression").build("id","params","body","generator","expression"),t("ArrowFunctionExpression").bases("Function","Expression").build("params","body","expression").field("id",null,i.null).field("body",n(t("BlockStatement"),t("Expression"))).field("generator",!1,i.false),t("ForOfStatement").bases("Statement").build("left","right","body").field("left",n(t("VariableDeclaration"),t("Pattern"))).field("right",t("Expression")).field("body",t("Statement")),t("YieldExpression").bases("Expression").build("argument","delegate").field("argument",n(t("Expression"),null)).field("delegate",Boolean,i.false),t("GeneratorExpression").bases("Expression").build("body","blocks","filter").field("body",t("Expression")).field("blocks",[t("ComprehensionBlock")]).field("filter",n(t("Expression"),null)),t("ComprehensionExpression").bases("Expression").build("body","blocks","filter").field("body",t("Expression")).field("blocks",[t("ComprehensionBlock")]).field("filter",n(t("Expression"),null)),t("ComprehensionBlock").bases("Node").build("left","right","each").field("left",t("Pattern")).field("right",t("Expression")).field("each",Boolean),t("Property").field("key",n(t("Literal"),t("Identifier"),t("Expression"))).field("value",n(t("Expression"),t("Pattern"))).field("method",Boolean,i.false).field("shorthand",Boolean,i.false).field("computed",Boolean,i.false),t("ObjectProperty").field("shorthand",Boolean,i.false),t("PropertyPattern").bases("Pattern").build("key","pattern").field("key",n(t("Literal"),t("Identifier"),t("Expression"))).field("pattern",t("Pattern")).field("computed",Boolean,i.false),t("ObjectPattern").bases("Pattern").build("properties").field("properties",[n(t("PropertyPattern"),t("Property"))]),t("ArrayPattern").bases("Pattern").build("elements").field("elements",[n(t("Pattern"),null)]),t("SpreadElement").bases("Node").build("argument").field("argument",t("Expression")),t("ArrayExpression").field("elements",[n(t("Expression"),t("SpreadElement"),t("RestElement"),null)]),t("NewExpression").field("arguments",[n(t("Expression"),t("SpreadElement"))]),t("CallExpression").field("arguments",[n(t("Expression"),t("SpreadElement"))]),t("AssignmentPattern").bases("Pattern").build("left","right").field("left",t("Pattern")).field("right",t("Expression")),t("MethodDefinition").bases("Declaration").build("kind","key","value","static").field("kind",n("constructor","method","get","set")).field("key",t("Expression")).field("value",t("Function")).field("computed",Boolean,i.false).field("static",Boolean,i.false);let s=n(t("MethodDefinition"),t("VariableDeclarator"),t("ClassPropertyDefinition"),t("ClassProperty"),t("StaticBlock"));t("ClassProperty").bases("Declaration").build("key").field("key",n(t("Literal"),t("Identifier"),t("Expression"))).field("computed",Boolean,i.false),t("ClassPropertyDefinition").bases("Declaration").build("definition").field("definition",s),t("ClassBody").bases("Declaration").build("body").field("body",[s]),t("ClassDeclaration").bases("Declaration").build("id","body","superClass").field("id",n(t("Identifier"),null)).field("body",t("ClassBody")).field("superClass",n(t("Expression"),null),i.null),t("ClassExpression").bases("Expression").build("id","body","superClass").field("id",n(t("Identifier"),null),i.null).field("body",t("ClassBody")).field("superClass",n(t("Expression"),null),i.null),t("Super").bases("Expression").build(),t("Specifier").bases("Node"),t("ModuleSpecifier").bases("Specifier").field("local",n(t("Identifier"),null),i.null).field("id",n(t("Identifier"),null),i.null).field("name",n(t("Identifier"),null),i.null),t("ImportSpecifier").bases("ModuleSpecifier").build("imported","local").field("imported",t("Identifier")),t("ImportDefaultSpecifier").bases("ModuleSpecifier").build("local"),t("ImportNamespaceSpecifier").bases("ModuleSpecifier").build("local"),t("ImportDeclaration").bases("Declaration").build("specifiers","source","importKind").field("specifiers",[n(t("ImportSpecifier"),t("ImportNamespaceSpecifier"),t("ImportDefaultSpecifier"))],i.emptyArray).field("source",t("Literal")).field("importKind",n("value","type"),function(){return"value"}),t("ExportNamedDeclaration").bases("Declaration").build("declaration","specifiers","source").field("declaration",n(t("Declaration"),null)).field("specifiers",[t("ExportSpecifier")],i.emptyArray).field("source",n(t("Literal"),null),i.null),t("ExportSpecifier").bases("ModuleSpecifier").build("local","exported").field("exported",t("Identifier")),t("ExportDefaultDeclaration").bases("Declaration").build("declaration").field("declaration",n(t("Declaration"),t("Expression"))),t("ExportAllDeclaration").bases("Declaration").build("source").field("source",t("Literal")),t("TaggedTemplateExpression").bases("Expression").build("tag","quasi").field("tag",t("Expression")).field("quasi",t("TemplateLiteral")),t("TemplateLiteral").bases("Expression").build("quasis","expressions").field("quasis",[t("TemplateElement")]).field("expressions",[t("Expression")]),t("TemplateElement").bases("Node").build("value","tail").field("value",{cooked:String,raw:String}).field("tail",Boolean),t("MetaProperty").bases("Expression").build("meta","property").field("meta",t("Identifier")).field("property",t("Identifier"))}Oe(()=>module);function PP(e){e.use(DD),e.use(vP)}Oe(()=>module);function IP(e){e.use(PP);let t=e.use(Qe).Type.def,n=e.use(Jt).defaults;t("Function").field("async",Boolean,n.false),t("AwaitExpression").bases("Expression").build("argument").field("argument",t("Expression"))}Oe(()=>module);function NP(e){e.use(IP);let r=e.use(Qe),t=r.Type.def,n=r.Type.or,i=e.use(Jt).defaults;t("ForOfStatement").field("await",Boolean,i.false),t("SpreadProperty").bases("Node").build("argument").field("argument",t("Expression")),t("ObjectExpression").field("properties",[n(t("Property"),t("SpreadProperty"),t("SpreadElement"))]),t("TemplateElement").field("value",{cooked:n(String,null),raw:String}),t("SpreadPropertyPattern").bases("Pattern").build("argument").field("argument",t("Pattern")),t("ObjectPattern").field("properties",[n(t("PropertyPattern"),t("Property"),t("RestElement"),t("SpreadPropertyPattern"))])}Oe(()=>module);function FP(e){e.use(NP);let r=e.use(Qe),t=r.Type.def,n=r.Type.or,i=e.use(Jt).defaults;t("CatchClause").field("param",n(t("Pattern"),null),i.null)}Oe(()=>module);function _P(e){e.use(bD),e.use(FP);let r=e.use(Qe),t=r.Type.def,n=r.Type.or,s=e.use(Jt).defaults;t("ImportExpression").bases("Expression").build("source").field("source",t("Expression")),t("ExportAllDeclaration").bases("Declaration").build("source","exported").field("source",t("Literal")).field("exported",n(t("Identifier"),null,void 0),s.null),t("ChainElement").bases("Node").field("optional",Boolean,s.false),t("CallExpression").bases("Expression","ChainElement"),t("MemberExpression").bases("Expression","ChainElement"),t("ChainExpression").bases("Expression").build("expression").field("expression",t("ChainElement")),t("OptionalCallExpression").bases("CallExpression").build("callee","arguments","optional").field("optional",Boolean,s.true),t("OptionalMemberExpression").bases("MemberExpression").build("object","property","computed","optional").field("optional",Boolean,s.true)}Oe(()=>module);function kP(e){e.use(TP),e.use(_P)}Oe(()=>module);function OP(e){e.use(kP);let t=e.use(Qe).Type.def;t("StaticBlock").bases("Declaration").build("body").field("body",[t("Statement")])}Oe(()=>module);function lo(e){e.use(OP);let r=e.use(Qe),t=r.Type,n=r.Type.def,i=t.or,o=e.use(Jt).defaults;n("AwaitExpression").build("argument","all").field("argument",i(n("Expression"),null)).field("all",Boolean,o.false),n("Decorator").bases("Node").build("expression").field("expression",n("Expression")),n("Property").field("decorators",i([n("Decorator")],null),o.null),n("MethodDefinition").field("decorators",i([n("Decorator")],null),o.null),n("PrivateName").bases("Expression","Pattern").build("id").field("id",n("Identifier")),n("ClassPrivateProperty").bases("ClassProperty").build("key","value").field("key",n("PrivateName")).field("value",i(n("Expression"),null),o.null),n("ImportAttribute").bases("Node").build("key","value").field("key",i(n("Identifier"),n("Literal"))).field("value",n("Expression")),["ImportDeclaration","ExportAllDeclaration","ExportNamedDeclaration"].forEach(a=>{n(a).field("assertions",[n("ImportAttribute")],o.emptyArray)}),n("RecordExpression").bases("Expression").build("properties").field("properties",[i(n("ObjectProperty"),n("ObjectMethod"),n("SpreadElement"))]),n("TupleExpression").bases("Expression").build("elements").field("elements",[i(n("Expression"),n("SpreadElement"),null)]),n("ModuleExpression").bases("Node").build("body").field("body",n("Program"))}Oe(()=>module);function RP(e){e.use(lo);let r=e.use(Qe),t=r.Type.def,n=r.Type.or,i=e.use(Jt).defaults;t("JSXAttribute").bases("Node").build("name","value").field("name",n(t("JSXIdentifier"),t("JSXNamespacedName"))).field("value",n(t("Literal"),t("JSXExpressionContainer"),t("JSXElement"),t("JSXFragment"),null),i.null),t("JSXIdentifier").bases("Identifier").build("name").field("name",String),t("JSXNamespacedName").bases("Node").build("namespace","name").field("namespace",t("JSXIdentifier")).field("name",t("JSXIdentifier")),t("JSXMemberExpression").bases("MemberExpression").build("object","property").field("object",n(t("JSXIdentifier"),t("JSXMemberExpression"))).field("property",t("JSXIdentifier")).field("computed",Boolean,i.false);let s=n(t("JSXIdentifier"),t("JSXNamespacedName"),t("JSXMemberExpression"));t("JSXSpreadAttribute").bases("Node").build("argument").field("argument",t("Expression"));let o=[n(t("JSXAttribute"),t("JSXSpreadAttribute"))];t("JSXExpressionContainer").bases("Expression").build("expression").field("expression",n(t("Expression"),t("JSXEmptyExpression")));let a=[n(t("JSXText"),t("JSXExpressionContainer"),t("JSXSpreadChild"),t("JSXElement"),t("JSXFragment"),t("Literal"))];t("JSXElement").bases("Expression").build("openingElement","closingElement","children").field("openingElement",t("JSXOpeningElement")).field("closingElement",n(t("JSXClosingElement"),null),i.null).field("children",a,i.emptyArray).field("name",s,function(){return this.openingElement.name},!0).field("selfClosing",Boolean,function(){return this.openingElement.selfClosing},!0).field("attributes",o,function(){return this.openingElement.attributes},!0),t("JSXOpeningElement").bases("Node").build("name","attributes","selfClosing").field("name",s).field("attributes",o,i.emptyArray).field("selfClosing",Boolean,i.false),t("JSXClosingElement").bases("Node").build("name").field("name",s),t("JSXFragment").bases("Expression").build("openingFragment","closingFragment","children").field("openingFragment",t("JSXOpeningFragment")).field("closingFragment",t("JSXClosingFragment")).field("children",a,i.emptyArray),t("JSXOpeningFragment").bases("Node").build(),t("JSXClosingFragment").bases("Node").build(),t("JSXText").bases("Literal").build("value","raw").field("value",String).field("raw",String,function(){return this.value}),t("JSXEmptyExpression").bases("Node").build(),t("JSXSpreadChild").bases("Node").build("expression").field("expression",t("Expression"))}Oe(()=>module);function xD(e){var r=e.use(Qe),t=r.Type.def,n=r.Type.or,i=e.use(Jt).defaults,s=n(t("TypeAnnotation"),t("TSTypeAnnotation"),null),o=n(t("TypeParameterDeclaration"),t("TSTypeParameterDeclaration"),null);t("Identifier").field("typeAnnotation",s,i.null),t("ObjectPattern").field("typeAnnotation",s,i.null),t("Function").field("returnType",s,i.null).field("typeParameters",o,i.null),t("ClassProperty").build("key","value","typeAnnotation","static").field("value",n(t("Expression"),null)).field("static",Boolean,i.false).field("typeAnnotation",s,i.null),["ClassDeclaration","ClassExpression"].forEach(a=>{t(a).field("typeParameters",o,i.null).field("superTypeParameters",n(t("TypeParameterInstantiation"),t("TSTypeParameterInstantiation"),null),i.null).field("implements",n([t("ClassImplements")],[t("TSExpressionWithTypeArguments")]),i.emptyArray)})}Oe(()=>module);function ED(e){e.use(lo),e.use(xD);let r=e.use(Qe),t=r.Type.def,n=r.Type.or,i=e.use(Jt).defaults;t("Flow").bases("Node"),t("FlowType").bases("Flow"),t("AnyTypeAnnotation").bases("FlowType").build(),t("EmptyTypeAnnotation").bases("FlowType").build(),t("MixedTypeAnnotation").bases("FlowType").build(),t("VoidTypeAnnotation").bases("FlowType").build(),t("SymbolTypeAnnotation").bases("FlowType").build(),t("NumberTypeAnnotation").bases("FlowType").build(),t("BigIntTypeAnnotation").bases("FlowType").build(),t("NumberLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",Number).field("raw",String),t("NumericLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",Number).field("raw",String),t("BigIntLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",null).field("raw",String),t("StringTypeAnnotation").bases("FlowType").build(),t("StringLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",String).field("raw",String),t("BooleanTypeAnnotation").bases("FlowType").build(),t("BooleanLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",Boolean).field("raw",String),t("TypeAnnotation").bases("Node").build("typeAnnotation").field("typeAnnotation",t("FlowType")),t("NullableTypeAnnotation").bases("FlowType").build("typeAnnotation").field("typeAnnotation",t("FlowType")),t("NullLiteralTypeAnnotation").bases("FlowType").build(),t("NullTypeAnnotation").bases("FlowType").build(),t("ThisTypeAnnotation").bases("FlowType").build(),t("ExistsTypeAnnotation").bases("FlowType").build(),t("ExistentialTypeParam").bases("FlowType").build(),t("FunctionTypeAnnotation").bases("FlowType").build("params","returnType","rest","typeParameters").field("params",[t("FunctionTypeParam")]).field("returnType",t("FlowType")).field("rest",n(t("FunctionTypeParam"),null)).field("typeParameters",n(t("TypeParameterDeclaration"),null)),t("FunctionTypeParam").bases("Node").build("name","typeAnnotation","optional").field("name",n(t("Identifier"),null)).field("typeAnnotation",t("FlowType")).field("optional",Boolean),t("ArrayTypeAnnotation").bases("FlowType").build("elementType").field("elementType",t("FlowType")),t("ObjectTypeAnnotation").bases("FlowType").build("properties","indexers","callProperties").field("properties",[n(t("ObjectTypeProperty"),t("ObjectTypeSpreadProperty"))]).field("indexers",[t("ObjectTypeIndexer")],i.emptyArray).field("callProperties",[t("ObjectTypeCallProperty")],i.emptyArray).field("inexact",n(Boolean,void 0),i.undefined).field("exact",Boolean,i.false).field("internalSlots",[t("ObjectTypeInternalSlot")],i.emptyArray),t("Variance").bases("Node").build("kind").field("kind",n("plus","minus"));let s=n(t("Variance"),"plus","minus",null);t("ObjectTypeProperty").bases("Node").build("key","value","optional").field("key",n(t("Literal"),t("Identifier"))).field("value",t("FlowType")).field("optional",Boolean).field("variance",s,i.null),t("ObjectTypeIndexer").bases("Node").build("id","key","value").field("id",t("Identifier")).field("key",t("FlowType")).field("value",t("FlowType")).field("variance",s,i.null).field("static",Boolean,i.false),t("ObjectTypeCallProperty").bases("Node").build("value").field("value",t("FunctionTypeAnnotation")).field("static",Boolean,i.false),t("QualifiedTypeIdentifier").bases("Node").build("qualification","id").field("qualification",n(t("Identifier"),t("QualifiedTypeIdentifier"))).field("id",t("Identifier")),t("GenericTypeAnnotation").bases("FlowType").build("id","typeParameters").field("id",n(t("Identifier"),t("QualifiedTypeIdentifier"))).field("typeParameters",n(t("TypeParameterInstantiation"),null)),t("MemberTypeAnnotation").bases("FlowType").build("object","property").field("object",t("Identifier")).field("property",n(t("MemberTypeAnnotation"),t("GenericTypeAnnotation"))),t("IndexedAccessType").bases("FlowType").build("objectType","indexType").field("objectType",t("FlowType")).field("indexType",t("FlowType")),t("OptionalIndexedAccessType").bases("FlowType").build("objectType","indexType","optional").field("objectType",t("FlowType")).field("indexType",t("FlowType")).field("optional",Boolean),t("UnionTypeAnnotation").bases("FlowType").build("types").field("types",[t("FlowType")]),t("IntersectionTypeAnnotation").bases("FlowType").build("types").field("types",[t("FlowType")]),t("TypeofTypeAnnotation").bases("FlowType").build("argument").field("argument",t("FlowType")),t("ObjectTypeSpreadProperty").bases("Node").build("argument").field("argument",t("FlowType")),t("ObjectTypeInternalSlot").bases("Node").build("id","value","optional","static","method").field("id",t("Identifier")).field("value",t("FlowType")).field("optional",Boolean).field("static",Boolean).field("method",Boolean),t("TypeParameterDeclaration").bases("Node").build("params").field("params",[t("TypeParameter")]),t("TypeParameterInstantiation").bases("Node").build("params").field("params",[t("FlowType")]),t("TypeParameter").bases("FlowType").build("name","variance","bound","default").field("name",String).field("variance",s,i.null).field("bound",n(t("TypeAnnotation"),null),i.null).field("default",n(t("FlowType"),null),i.null),t("ClassProperty").field("variance",s,i.null),t("ClassImplements").bases("Node").build("id").field("id",t("Identifier")).field("superClass",n(t("Expression"),null),i.null).field("typeParameters",n(t("TypeParameterInstantiation"),null),i.null),t("InterfaceTypeAnnotation").bases("FlowType").build("body","extends").field("body",t("ObjectTypeAnnotation")).field("extends",n([t("InterfaceExtends")],null),i.null),t("InterfaceDeclaration").bases("Declaration").build("id","body","extends").field("id",t("Identifier")).field("typeParameters",n(t("TypeParameterDeclaration"),null),i.null).field("body",t("ObjectTypeAnnotation")).field("extends",[t("InterfaceExtends")]),t("DeclareInterface").bases("InterfaceDeclaration").build("id","body","extends"),t("InterfaceExtends").bases("Node").build("id").field("id",t("Identifier")).field("typeParameters",n(t("TypeParameterInstantiation"),null),i.null),t("TypeAlias").bases("Declaration").build("id","typeParameters","right").field("id",t("Identifier")).field("typeParameters",n(t("TypeParameterDeclaration"),null)).field("right",t("FlowType")),t("DeclareTypeAlias").bases("TypeAlias").build("id","typeParameters","right"),t("OpaqueType").bases("Declaration").build("id","typeParameters","impltype","supertype").field("id",t("Identifier")).field("typeParameters",n(t("TypeParameterDeclaration"),null)).field("impltype",t("FlowType")).field("supertype",n(t("FlowType"),null)),t("DeclareOpaqueType").bases("OpaqueType").build("id","typeParameters","supertype").field("impltype",n(t("FlowType"),null)),t("TypeCastExpression").bases("Expression").build("expression","typeAnnotation").field("expression",t("Expression")).field("typeAnnotation",t("TypeAnnotation")),t("TupleTypeAnnotation").bases("FlowType").build("types").field("types",[t("FlowType")]),t("DeclareVariable").bases("Statement").build("id").field("id",t("Identifier")),t("DeclareFunction").bases("Statement").build("id").field("id",t("Identifier")).field("predicate",n(t("FlowPredicate"),null),i.null),t("DeclareClass").bases("InterfaceDeclaration").build("id"),t("DeclareModule").bases("Statement").build("id","body").field("id",n(t("Identifier"),t("Literal"))).field("body",t("BlockStatement")),t("DeclareModuleExports").bases("Statement").build("typeAnnotation").field("typeAnnotation",t("TypeAnnotation")),t("DeclareExportDeclaration").bases("Declaration").build("default","declaration","specifiers","source").field("default",Boolean).field("declaration",n(t("DeclareVariable"),t("DeclareFunction"),t("DeclareClass"),t("FlowType"),t("TypeAlias"),t("DeclareOpaqueType"),t("InterfaceDeclaration"),null)).field("specifiers",[n(t("ExportSpecifier"),t("ExportBatchSpecifier"))],i.emptyArray).field("source",n(t("Literal"),null),i.null),t("DeclareExportAllDeclaration").bases("Declaration").build("source").field("source",n(t("Literal"),null),i.null),t("ImportDeclaration").field("importKind",n("value","type","typeof"),()=>"value"),t("FlowPredicate").bases("Flow"),t("InferredPredicate").bases("FlowPredicate").build(),t("DeclaredPredicate").bases("FlowPredicate").build("value").field("value",t("Expression")),t("Function").field("predicate",n(t("FlowPredicate"),null),i.null),t("CallExpression").field("typeArguments",n(null,t("TypeParameterInstantiation")),i.null),t("NewExpression").field("typeArguments",n(null,t("TypeParameterInstantiation")),i.null),t("EnumDeclaration").bases("Declaration").build("id","body").field("id",t("Identifier")).field("body",n(t("EnumBooleanBody"),t("EnumNumberBody"),t("EnumStringBody"),t("EnumSymbolBody"))),t("EnumBooleanBody").build("members","explicitType").field("members",[t("EnumBooleanMember")]).field("explicitType",Boolean),t("EnumNumberBody").build("members","explicitType").field("members",[t("EnumNumberMember")]).field("explicitType",Boolean),t("EnumStringBody").build("members","explicitType").field("members",n([t("EnumStringMember")],[t("EnumDefaultedMember")])).field("explicitType",Boolean),t("EnumSymbolBody").build("members").field("members",[t("EnumDefaultedMember")]),t("EnumBooleanMember").build("id","init").field("id",t("Identifier")).field("init",n(t("Literal"),Boolean)),t("EnumNumberMember").build("id","init").field("id",t("Identifier")).field("init",t("Literal")),t("EnumStringMember").build("id","init").field("id",t("Identifier")).field("init",t("Literal")),t("EnumDefaultedMember").build("id").field("id",t("Identifier"))}Oe(()=>module);function LP(e){e.use(lo);var r=e.use(Qe),t=e.use(Jt).defaults,n=r.Type.def,i=r.Type.or;n("VariableDeclaration").field("declarations",[i(n("VariableDeclarator"),n("Identifier"))]),n("Property").field("value",i(n("Expression"),n("Pattern"))),n("ArrayPattern").field("elements",[i(n("Pattern"),n("SpreadElement"),null)]),n("ObjectPattern").field("properties",[i(n("Property"),n("PropertyPattern"),n("SpreadPropertyPattern"),n("SpreadProperty"))]),n("ExportSpecifier").bases("ModuleSpecifier").build("id","name"),n("ExportBatchSpecifier").bases("Specifier").build(),n("ExportDeclaration").bases("Declaration").build("default","declaration","specifiers","source").field("default",Boolean).field("declaration",i(n("Declaration"),n("Expression"),null)).field("specifiers",[i(n("ExportSpecifier"),n("ExportBatchSpecifier"))],t.emptyArray).field("source",i(n("Literal"),null),t.null),n("Block").bases("Comment").build("value","leading","trailing"),n("Line").bases("Comment").build("value","leading","trailing")}Oe(()=>module);function CD(e){e.use(lo);let r=e.use(Qe),t=e.use(Jt).defaults,n=r.Type.def,i=r.Type.or,{undefined:s}=r.builtInTypes;n("Noop").bases("Statement").build(),n("DoExpression").bases("Expression").build("body").field("body",[n("Statement")]),n("BindExpression").bases("Expression").build("object","callee").field("object",i(n("Expression"),null)).field("callee",n("Expression")),n("ParenthesizedExpression").bases("Expression").build("expression").field("expression",n("Expression")),n("ExportNamespaceSpecifier").bases("Specifier").build("exported").field("exported",n("Identifier")),n("ExportDefaultSpecifier").bases("Specifier").build("exported").field("exported",n("Identifier")),n("CommentBlock").bases("Comment").build("value","leading","trailing"),n("CommentLine").bases("Comment").build("value","leading","trailing"),n("Directive").bases("Node").build("value").field("value",n("DirectiveLiteral")),n("DirectiveLiteral").bases("Node","Expression").build("value").field("value",String,t["use strict"]),n("InterpreterDirective").bases("Node").build("value").field("value",String),n("BlockStatement").bases("Statement").build("body").field("body",[n("Statement")]).field("directives",[n("Directive")],t.emptyArray),n("Program").bases("Node").build("body").field("body",[n("Statement")]).field("directives",[n("Directive")],t.emptyArray).field("interpreter",i(n("InterpreterDirective"),null),t.null);function o(c=String,p){return["extra",{rawValue:c,raw:String},function(){let f=r.getFieldValue(this,"value");return{rawValue:f,raw:p?p(f):String(f)}}]}n("StringLiteral").bases("Literal").build("value").field("value",String).field(...o(String,c=>JSON.stringify(c))),n("NumericLiteral").bases("Literal").build("value").field("value",Number).field("raw",i(String,null),t.null).field(...o(Number)),n("BigIntLiteral").bases("Literal").build("value").field("value",i(String,Number)).field(...o(String,c=>c+"n")),n("DecimalLiteral").bases("Literal").build("value").field("value",String).field(...o(String,c=>c+"m")),n("NullLiteral").bases("Literal").build().field("value",null,t.null),n("BooleanLiteral").bases("Literal").build("value").field("value",Boolean),n("RegExpLiteral").bases("Literal").build("pattern","flags").field("pattern",String).field("flags",String).field("value",RegExp,function(){return new RegExp(this.pattern,this.flags)}).field(...o(i(RegExp,s),c=>`/${c.pattern}/${c.flags||""}`)).field("regex",{pattern:String,flags:String},function(){return{pattern:this.pattern,flags:this.flags}});var a=i(n("Property"),n("ObjectMethod"),n("ObjectProperty"),n("SpreadProperty"),n("SpreadElement"));n("ObjectExpression").bases("Expression").build("properties").field("properties",[a]),n("ObjectMethod").bases("Node","Function").build("kind","key","params","body","computed").field("kind",i("method","get","set")).field("key",i(n("Literal"),n("Identifier"),n("Expression"))).field("params",[n("Pattern")]).field("body",n("BlockStatement")).field("computed",Boolean,t.false).field("generator",Boolean,t.false).field("async",Boolean,t.false).field("accessibility",i(n("Literal"),null),t.null).field("decorators",i([n("Decorator")],null),t.null),n("ObjectProperty").bases("Node").build("key","value").field("key",i(n("Literal"),n("Identifier"),n("Expression"))).field("value",i(n("Expression"),n("Pattern"))).field("accessibility",i(n("Literal"),null),t.null).field("computed",Boolean,t.false);var l=i(n("MethodDefinition"),n("VariableDeclarator"),n("ClassPropertyDefinition"),n("ClassProperty"),n("ClassPrivateProperty"),n("ClassMethod"),n("ClassPrivateMethod"),n("ClassAccessorProperty"),n("StaticBlock"));n("ClassBody").bases("Declaration").build("body").field("body",[l]),n("ClassMethod").bases("Declaration","Function").build("kind","key","params","body","computed","static").field("key",i(n("Literal"),n("Identifier"),n("Expression"))),n("ClassPrivateMethod").bases("Declaration","Function").build("key","params","body","kind","computed","static").field("key",n("PrivateName")),n("ClassAccessorProperty").bases("Declaration").build("key","value","decorators","computed","static").field("key",i(n("Literal"),n("Identifier"),n("PrivateName"),n("Expression"))).field("value",i(n("Expression"),null),t.null),["ClassMethod","ClassPrivateMethod"].forEach(c=>{n(c).field("kind",i("get","set","method","constructor"),()=>"method").field("body",n("BlockStatement")).field("access",i("public","private","protected",null),t.null)}),["ClassMethod","ClassPrivateMethod","ClassAccessorProperty"].forEach(c=>{n(c).field("computed",Boolean,t.false).field("static",Boolean,t.false).field("abstract",Boolean,t.false).field("accessibility",i("public","private","protected",null),t.null).field("decorators",i([n("Decorator")],null),t.null).field("definite",Boolean,t.false).field("optional",Boolean,t.false).field("override",Boolean,t.false).field("readonly",Boolean,t.false)});var u=i(n("Property"),n("PropertyPattern"),n("SpreadPropertyPattern"),n("SpreadProperty"),n("ObjectProperty"),n("RestProperty"),n("RestElement"));n("ObjectPattern").bases("Pattern").build("properties").field("properties",[u]).field("decorators",i([n("Decorator")],null),t.null),n("SpreadProperty").bases("Node").build("argument").field("argument",n("Expression")),n("RestProperty").bases("Node").build("argument").field("argument",n("Expression")),n("ForAwaitStatement").bases("Statement").build("left","right","body").field("left",i(n("VariableDeclaration"),n("Expression"))).field("right",n("Expression")).field("body",n("Statement")),n("Import").bases("Expression").build()}Oe(()=>module);function BP(e){let t=e.use(Qe).Type.def;e.use(CD),e.use(ED),t("V8IntrinsicIdentifier").bases("Expression").build("name").field("name",String),t("TopicReference").bases("Expression").build()}Oe(()=>module);function MP(e){e.use(CD),e.use(xD);var r=e.use(Qe),t=r.namedTypes,n=r.Type.def,i=r.Type.or,s=e.use(Jt).defaults,o=r.Type.from(function(c,p){return!!(t.StringLiteral&&t.StringLiteral.check(c,p)||t.Literal&&t.Literal.check(c,p)&&typeof c.value=="string")},"StringLiteral");n("TSType").bases("Node");var a=i(n("Identifier"),n("TSQualifiedName"));n("TSTypeReference").bases("TSType","TSHasOptionalTypeParameterInstantiation").build("typeName","typeParameters").field("typeName",a),n("TSHasOptionalTypeParameterInstantiation").field("typeParameters",i(n("TSTypeParameterInstantiation"),null),s.null),n("TSHasOptionalTypeParameters").field("typeParameters",i(n("TSTypeParameterDeclaration"),null,void 0),s.null),n("TSHasOptionalTypeAnnotation").field("typeAnnotation",i(n("TSTypeAnnotation"),null),s.null),n("TSQualifiedName").bases("Node").build("left","right").field("left",a).field("right",a),n("TSAsExpression").bases("Expression","Pattern").build("expression","typeAnnotation").field("expression",n("Expression")).field("typeAnnotation",n("TSType")).field("extra",i({parenthesized:Boolean},null),s.null),n("TSTypeCastExpression").bases("Expression").build("expression","typeAnnotation").field("expression",n("Expression")).field("typeAnnotation",n("TSType")),n("TSSatisfiesExpression").bases("Expression","Pattern").build("expression","typeAnnotation").field("expression",n("Expression")).field("typeAnnotation",n("TSType")),n("TSNonNullExpression").bases("Expression","Pattern").build("expression").field("expression",n("Expression")),["TSAnyKeyword","TSBigIntKeyword","TSBooleanKeyword","TSNeverKeyword","TSNullKeyword","TSNumberKeyword","TSObjectKeyword","TSStringKeyword","TSSymbolKeyword","TSUndefinedKeyword","TSUnknownKeyword","TSVoidKeyword","TSIntrinsicKeyword","TSThisType"].forEach(c=>{n(c).bases("TSType").build()}),n("TSArrayType").bases("TSType").build("elementType").field("elementType",n("TSType")),n("TSLiteralType").bases("TSType").build("literal").field("literal",i(n("NumericLiteral"),n("StringLiteral"),n("BooleanLiteral"),n("TemplateLiteral"),n("UnaryExpression"),n("BigIntLiteral"))),n("TemplateLiteral").field("expressions",i([n("Expression")],[n("TSType")])),["TSUnionType","TSIntersectionType"].forEach(c=>{n(c).bases("TSType").build("types").field("types",[n("TSType")])}),n("TSConditionalType").bases("TSType").build("checkType","extendsType","trueType","falseType").field("checkType",n("TSType")).field("extendsType",n("TSType")).field("trueType",n("TSType")).field("falseType",n("TSType")),n("TSInferType").bases("TSType").build("typeParameter").field("typeParameter",n("TSTypeParameter")),n("TSParenthesizedType").bases("TSType").build("typeAnnotation").field("typeAnnotation",n("TSType"));var l=[i(n("Identifier"),n("RestElement"),n("ArrayPattern"),n("ObjectPattern"))];["TSFunctionType","TSConstructorType"].forEach(c=>{n(c).bases("TSType","TSHasOptionalTypeParameters","TSHasOptionalTypeAnnotation").build("parameters").field("parameters",l)}),n("TSDeclareFunction").bases("Declaration","TSHasOptionalTypeParameters").build("id","params","returnType").field("declare",Boolean,s.false).field("async",Boolean,s.false).field("generator",Boolean,s.false).field("id",i(n("Identifier"),null),s.null).field("params",[n("Pattern")]).field("returnType",i(n("TSTypeAnnotation"),n("Noop"),null),s.null),n("TSDeclareMethod").bases("Declaration","TSHasOptionalTypeParameters").build("key","params","returnType").field("async",Boolean,s.false).field("generator",Boolean,s.false).field("params",[n("Pattern")]).field("abstract",Boolean,s.false).field("accessibility",i("public","private","protected",void 0),s.undefined).field("static",Boolean,s.false).field("computed",Boolean,s.false).field("optional",Boolean,s.false).field("key",i(n("Identifier"),n("StringLiteral"),n("NumericLiteral"),n("Expression"))).field("kind",i("get","set","method","constructor"),function(){return"method"}).field("access",i("public","private","protected",void 0),s.undefined).field("decorators",i([n("Decorator")],null),s.null).field("returnType",i(n("TSTypeAnnotation"),n("Noop"),null),s.null),n("TSMappedType").bases("TSType").build("typeParameter","typeAnnotation").field("readonly",i(Boolean,"+","-"),s.false).field("typeParameter",n("TSTypeParameter")).field("optional",i(Boolean,"+","-"),s.false).field("typeAnnotation",i(n("TSType"),null),s.null),n("TSTupleType").bases("TSType").build("elementTypes").field("elementTypes",[i(n("TSType"),n("TSNamedTupleMember"))]),n("TSNamedTupleMember").bases("TSType").build("label","elementType","optional").field("label",n("Identifier")).field("optional",Boolean,s.false).field("elementType",n("TSType")),n("TSRestType").bases("TSType").build("typeAnnotation").field("typeAnnotation",n("TSType")),n("TSOptionalType").bases("TSType").build("typeAnnotation").field("typeAnnotation",n("TSType")),n("TSIndexedAccessType").bases("TSType").build("objectType","indexType").field("objectType",n("TSType")).field("indexType",n("TSType")),n("TSTypeOperator").bases("TSType").build("operator").field("operator",String).field("typeAnnotation",n("TSType")),n("TSTypeAnnotation").bases("Node").build("typeAnnotation").field("typeAnnotation",i(n("TSType"),n("TSTypeAnnotation"))),n("TSIndexSignature").bases("Declaration","TSHasOptionalTypeAnnotation").build("parameters","typeAnnotation").field("parameters",[n("Identifier")]).field("readonly",Boolean,s.false),n("TSPropertySignature").bases("Declaration","TSHasOptionalTypeAnnotation").build("key","typeAnnotation","optional").field("key",n("Expression")).field("computed",Boolean,s.false).field("readonly",Boolean,s.false).field("optional",Boolean,s.false).field("initializer",i(n("Expression"),null),s.null),n("TSMethodSignature").bases("Declaration","TSHasOptionalTypeParameters","TSHasOptionalTypeAnnotation").build("key","parameters","typeAnnotation").field("key",n("Expression")).field("computed",Boolean,s.false).field("optional",Boolean,s.false).field("parameters",l),n("TSTypePredicate").bases("TSTypeAnnotation","TSType").build("parameterName","typeAnnotation","asserts").field("parameterName",i(n("Identifier"),n("TSThisType"))).field("typeAnnotation",i(n("TSTypeAnnotation"),null),s.null).field("asserts",Boolean,s.false),["TSCallSignatureDeclaration","TSConstructSignatureDeclaration"].forEach(c=>{n(c).bases("Declaration","TSHasOptionalTypeParameters","TSHasOptionalTypeAnnotation").build("parameters","typeAnnotation").field("parameters",l)}),n("TSEnumMember").bases("Node").build("id","initializer").field("id",i(n("Identifier"),o)).field("initializer",i(n("Expression"),null),s.null),n("TSTypeQuery").bases("TSType").build("exprName").field("exprName",i(a,n("TSImportType")));var u=i(n("TSCallSignatureDeclaration"),n("TSConstructSignatureDeclaration"),n("TSIndexSignature"),n("TSMethodSignature"),n("TSPropertySignature"));n("TSTypeLiteral").bases("TSType").build("members").field("members",[u]),n("TSTypeParameter").bases("Identifier").build("name","constraint","default").field("name",i(n("Identifier"),String)).field("constraint",i(n("TSType"),void 0),s.undefined).field("default",i(n("TSType"),void 0),s.undefined),n("TSTypeAssertion").bases("Expression","Pattern").build("typeAnnotation","expression").field("typeAnnotation",n("TSType")).field("expression",n("Expression")).field("extra",i({parenthesized:Boolean},null),s.null),n("TSTypeParameterDeclaration").bases("Declaration").build("params").field("params",[n("TSTypeParameter")]),n("TSInstantiationExpression").bases("Expression","TSHasOptionalTypeParameterInstantiation").build("expression","typeParameters").field("expression",n("Expression")),n("TSTypeParameterInstantiation").bases("Node").build("params").field("params",[n("TSType")]),n("TSEnumDeclaration").bases("Declaration").build("id","members").field("id",n("Identifier")).field("const",Boolean,s.false).field("declare",Boolean,s.false).field("members",[n("TSEnumMember")]).field("initializer",i(n("Expression"),null),s.null),n("TSTypeAliasDeclaration").bases("Declaration","TSHasOptionalTypeParameters").build("id","typeAnnotation").field("id",n("Identifier")).field("declare",Boolean,s.false).field("typeAnnotation",n("TSType")),n("TSModuleBlock").bases("Node").build("body").field("body",[n("Statement")]),n("TSModuleDeclaration").bases("Declaration").build("id","body").field("id",i(o,a)).field("declare",Boolean,s.false).field("global",Boolean,s.false).field("body",i(n("TSModuleBlock"),n("TSModuleDeclaration"),null),s.null),n("TSImportType").bases("TSType","TSHasOptionalTypeParameterInstantiation").build("argument","qualifier","typeParameters").field("argument",o).field("qualifier",i(a,void 0),s.undefined),n("TSImportEqualsDeclaration").bases("Declaration").build("id","moduleReference").field("id",n("Identifier")).field("isExport",Boolean,s.false).field("moduleReference",i(a,n("TSExternalModuleReference"))),n("TSExternalModuleReference").bases("Declaration").build("expression").field("expression",o),n("TSExportAssignment").bases("Statement").build("expression").field("expression",n("Expression")),n("TSNamespaceExportDeclaration").bases("Declaration").build("id").field("id",n("Identifier")),n("TSInterfaceBody").bases("Node").build("body").field("body",[u]),n("TSExpressionWithTypeArguments").bases("TSType","TSHasOptionalTypeParameterInstantiation").build("expression","typeParameters").field("expression",a),n("TSInterfaceDeclaration").bases("Declaration","TSHasOptionalTypeParameters").build("id","body").field("id",a).field("declare",Boolean,s.false).field("extends",i([n("TSExpressionWithTypeArguments")],null),s.null).field("body",n("TSInterfaceBody")),n("TSParameterProperty").bases("Pattern").build("parameter").field("accessibility",i("public","private","protected",void 0),s.undefined).field("readonly",Boolean,s.false).field("parameter",i(n("Identifier"),n("AssignmentPattern"))),n("ClassProperty").field("access",i("public","private","protected",void 0),s.undefined),n("ClassAccessorProperty").bases("Declaration","TSHasOptionalTypeAnnotation"),n("ClassBody").field("body",[i(n("MethodDefinition"),n("VariableDeclarator"),n("ClassPropertyDefinition"),n("ClassProperty"),n("ClassPrivateProperty"),n("ClassAccessorProperty"),n("ClassMethod"),n("ClassPrivateMethod"),n("StaticBlock"),n("TSDeclareMethod"),u)])}Oe(()=>module);var yr;yr||(yr={});var{astNodesAreEquivalent:p8,builders:Qi,builtInTypes:Dr,defineMethod:d8,eachField:f8,finalize:m8,getBuilderName:h8,getFieldNames:$P,getFieldValue:un,getSupertypeNames:g8,namedTypes:UP,NodePath:jP,Path:y8,PathVisitor:D8,someField:KP,Type:b8,use:x8,visit:E8}=SP([lo,RP,ED,LP,BP,MP]);Object.assign(yr,UP);var Oa=yr,Zy=Ja.default.SourceMapConsumer,VP=Ja.default.SourceMapGenerator,SD=Object.prototype.hasOwnProperty;function zP(){return`
|
|
991
|
+
`);return s!==-1&&(r=jg(r,i,n,s)),n+r+i};Object.defineProperties(Ls.prototype,ki);var O3=Ls(),R3=Ls({level:Vg?Vg.level:0});var De=new ga({level:2}),Wg={comment:De.gray,quote:De.gray,keyword:De.green,"selector-tag":De.green,addition:De.green,number:De.cyan,string:De.cyan,"meta meta-string":De.cyan,literal:De.cyan,doctag:De.cyan,regexp:De.cyan,title:De.blue,section:De.blue,name:De.blue,"selector-id":De.blue,"selector-class":De.blue,attribute:De.yellow,attr:De.yellow,variable:De.yellow,"template-variable":De.yellow,"class title":De.yellow,type:De.yellow,symbol:De.magenta,bullet:De.magenta,subst:De.magenta,meta:De.magenta,"meta keyword":De.magenta,"selector-attr":De.magenta,"selector-pseudo":De.magenta,link:De.magenta,built_in:De.red,deletion:De.red,emphasis:De.italic,strong:De.bold,formula:De.inverse};function Xn(e){let r=Yu(e);return{highlight:t,highlightAuto:n,listLanguages:r.listLanguages,register:r.register,registerAlias:r.registerAlias,registered:r.registered};function t(i,s,o){let a=r.highlight(i,s),l=a.data;return{language:l.language,relevance:l.relevance,value:tc(o||Wg,a)}}function n(i,s){let o,a;if(s&&("subset"in s||"sheet"in s)){let c=s;a={subset:c.subset},o=c.sheet}else o=s;let l=r.highlightAuto(i,a),u=l.data;return{language:u.language,relevance:u.relevance,value:tc(o||Wg,l)}}}function tc(e,r){let t=new Set(r.type==="element"&&Array.isArray(r.properties.className)?r.properties.className.map(function(a){return String(a).replace(/^hljs-/,"")}):[]),n={},i,s="",o;for(o in e)if(Object.hasOwn(e,o)){let a=o.split(" "),l=e[o];t.has(a[0])?a.length===1?i=l:n[a.slice(1).join(" ")]=l:n[o]=l}return"value"in r?s=r.value:"children"in r&&(s=vA(n,r.children)),i&&(s=i(s)),s}function vA(e,r){let t=[],n=-1;for(;++n<r.length;)t.push(tc(e,r[n]));return t.join("")}var Gg=V(require("@sentry/node"),1),Hg=V(require("@amplitude/analytics-node"),1);async function ee(e){if(process.env.NODE_ENV!=="test")try{await Promise.allSettled([Gg.flush(2e3),Hg.flush().promise])}catch(r){console.error(r)}process.exit(e)}var fr=process.env.AIR_HOST||"https://air-layout-v2-tk43uighdq-uc.a.run.app";var Mr=V(require("@amplitude/analytics-node"),1),_n=V(require("@sentry/node"),1);var Jg="1.5.14";var ht=require("node:fs/promises"),YD=require("node:crypto"),Ye=require("node:fs"),uo=require("node:os"),Ae=V(require("node:path"),1),hp=V(require("prettier"),1),XD=V(require("typescript"),1),QD=V(require("launch-editor"),1);var Zi=require("node:child_process");var mp={};YE(mp,{MagicastError:()=>Tt,builders:()=>W1,detectCodeFormat:()=>GD,generateCode:()=>fp,loadFile:()=>z1,parseExpression:()=>JD,parseModule:()=>HD,writeFile:()=>q1});var ja=require("node:fs");var Ja=V(Ey(),1),fD=V(Qy(),1);function Jt(e){var r=e.use(Qe),t=r.Type,n=r.builtInTypes,i=n.number;function s(u){return t.from(c=>i.check(c)&&c>=u,i+" >= "+u)}let o={null:function(){return null},emptyArray:function(){return[]},false:function(){return!1},true:function(){return!0},undefined:function(){},"use strict":function(){return"use strict"}};var a=t.or(n.string,n.number,n.boolean,n.null,n.undefined);let l=t.from(u=>{if(u===null)return!0;var c=typeof u;return!(c==="object"||c==="function")},a.toString());return{geq:s,defaults:o,isPrimitive:l}}function Oe(e){try{var r=e(),t=r.exports,n=t.default}catch{return}n&&n!==t&&typeof t=="object"&&(Object.assign(n,t,{default:n}),t.__esModule&&Object.defineProperty(n,"__esModule",{value:!0}),r.exports=n)}var yP=Object.defineProperty,DP=(e,r,t)=>r in e?yP(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,kt=(e,r,t)=>(DP(e,typeof r!="symbol"?r+"":r,t),t),mD=Object.prototype,Ka=mD.toString,ir=mD.hasOwnProperty,si=class{assert(r,t){if(!this.check(r,t)){var n=lp(r);throw new Error(n+" does not match type "+this)}return!0}arrayOf(){let r=this;return new io(r)}},io=class extends si{constructor(r){super(),this.elemType=r,kt(this,"kind","ArrayType")}toString(){return"["+this.elemType+"]"}check(r,t){return Array.isArray(r)&&r.every(n=>this.elemType.check(n,t))}},Va=class extends si{constructor(r){super(),this.value=r,kt(this,"kind","IdentityType")}toString(){return String(this.value)}check(r,t){let n=r===this.value;return!n&&typeof t=="function"&&t(this,r),n}},za=class extends si{constructor(r){super(),this.fields=r,kt(this,"kind","ObjectType")}toString(){return"{ "+this.fields.join(", ")+" }"}check(r,t){return Ka.call(r)===Ka.call({})&&this.fields.every(n=>n.type.check(r[n.name],t))}},qa=class extends si{constructor(r){super(),this.types=r,kt(this,"kind","OrType")}toString(){return this.types.join(" | ")}check(r,t){return this.types.some(n=>n.check(r,!!t))?!0:(typeof t=="function"&&t(this,r),!1)}},ii=class extends si{constructor(r,t){super(),this.name=r,this.predicate=t,kt(this,"kind","PredicateType")}toString(){return this.name}check(r,t){let n=this.predicate(r,t);return!n&&typeof t=="function"&&t(this,r),n}},ro=class e{constructor(r,t){this.type=r,this.typeName=t,kt(this,"baseNames",[]),kt(this,"ownFields",Object.create(null)),kt(this,"allSupertypes",Object.create(null)),kt(this,"supertypeList",[]),kt(this,"allFields",Object.create(null)),kt(this,"fieldNames",[]),kt(this,"finalized",!1),kt(this,"buildable",!1),kt(this,"buildParams",[])}isSupertypeOf(r){if(r instanceof e){if(this.finalized!==!0||r.finalized!==!0)throw new Error("");return ir.call(r.allSupertypes,this.typeName)}else throw new Error(r+" is not a Def")}checkAllFields(r,t){var n=this.allFields;if(this.finalized!==!0)throw new Error(""+this.typeName);function i(s){var o=n[s],a=o.type,l=o.getValue(r);return a.check(l,t)}return r!==null&&typeof r=="object"&&Object.keys(n).every(i)}bases(...r){var t=this.baseNames;if(this.finalized){if(r.length!==t.length)throw new Error("");for(var n=0;n<r.length;n++)if(r[n]!==t[n])throw new Error("");return this}return r.forEach(i=>{t.indexOf(i)<0&&t.push(i)}),this}},Wa=class{constructor(r,t,n,i){this.name=r,this.type=t,this.defaultFn=n,kt(this,"hidden"),this.hidden=!!i}toString(){return JSON.stringify(this.name)+": "+this.type}getValue(r){var t=r[this.name];return typeof t<"u"||typeof this.defaultFn=="function"&&(t=this.defaultFn.call(r)),t}};function lp(e){return Array.isArray(e)?"["+e.map(lp).join(", ")+"]":e&&typeof e=="object"?"{ "+Object.keys(e).map(function(r){return r+": "+e[r]}).join(", ")+" }":JSON.stringify(e)}function Qe(e){let r={or(...v){return new qa(v.map(I=>r.from(I)))},from(v,I){if(v instanceof io||v instanceof Va||v instanceof za||v instanceof qa||v instanceof ii)return v;if(v instanceof ro)return v.type;if(a.check(v)){if(v.length!==1)throw new Error("only one element type is permitted for typed arrays");return new io(r.from(v[0]))}if(l.check(v))return new za(Object.keys(v).map(H=>new Wa(H,r.from(v[H],H))));if(typeof v=="function"){var $=t.indexOf(v);if($>=0)return n[$];if(typeof I!="string")throw new Error("missing name");return new ii(I,v)}return new Va(v)},def(v){return ir.call(y,v)?y[v]:y[v]=new C(v)},hasDef(v){return ir.call(y,v)}};var t=[],n=[];function i(v,I){let $=Ka.call(I),H=new ii(v,xe=>Ka.call(xe)===$);return I&&typeof I.constructor=="function"&&(t.push(I.constructor),n.push(H)),H}let s=i("string","truthy"),o=i("function",function(){}),a=i("array",[]),l=i("object",{}),u=i("RegExp",/./),c=i("Date",new Date),p=i("number",3),d=i("boolean",!0),f=i("null",null),m=i("undefined",void 0),h=typeof BigInt=="function"?i("BigInt",BigInt(1234)):new ii("BigInt",()=>!1),g={string:s,function:o,array:a,object:l,RegExp:u,Date:c,number:p,boolean:d,null:f,undefined:m,BigInt:h};var y=Object.create(null);function D(v){if(v&&typeof v=="object"){var I=v.type;if(typeof I=="string"&&ir.call(y,I)){var $=y[I];if($.finalized)return $}}return null}class C extends ro{constructor(I){super(new ii(I,($,H)=>this.check($,H)),I)}check(I,$){if(this.finalized!==!0)throw new Error("prematurely checking unfinalized type "+this.typeName);if(I===null||typeof I!="object")return!1;var H=D(I);return H?$&&H===this?this.checkAllFields(I,$):this.isSupertypeOf(H)?$?H.checkAllFields(I,$)&&this.checkAllFields(I,!1):!0:!1:this.typeName==="SourceLocation"||this.typeName==="Position"?this.checkAllFields(I,$):!1}build(...I){if(this.buildParams=I,this.buildable)return this;this.field("type",String,()=>this.typeName),this.buildable=!0;let $=(xe,ae,me,yt)=>{if(!ir.call(xe,ae)){var Pt=this.allFields;if(!ir.call(Pt,ae))throw new Error(""+ae);var Kr=Pt[ae],cs=Kr.type,Vr;if(yt)Vr=me;else if(Kr.defaultFn)Vr=Kr.defaultFn.call(xe);else{var ps="no value or default function given for field "+JSON.stringify(ae)+" of "+this.typeName+"("+this.buildParams.map(function(ve){return Pt[ve]}).join(", ")+")";throw new Error(ps)}if(!cs.check(Vr))throw new Error(lp(Vr)+" does not match field "+Kr+" of type "+this.typeName);xe[ae]=Vr}},H=(...xe)=>{var ae=xe.length;if(!this.finalized)throw new Error("attempting to instantiate unfinalized type "+this.typeName);var me=Object.create(T);if(this.buildParams.forEach(function(yt,Pt){Pt<ae?$(me,yt,xe[Pt],!0):$(me,yt,null,!1)}),Object.keys(this.allFields).forEach(function(yt){$(me,yt,null,!1)}),me.type!==this.typeName)throw new Error("");return me};return H.from=xe=>{if(!this.finalized)throw new Error("attempting to instantiate unfinalized type "+this.typeName);var ae=Object.create(T);if(Object.keys(this.allFields).forEach(function(me){ir.call(xe,me)?$(ae,me,xe[me],!0):$(ae,me,null,!1)}),ae.type!==this.typeName)throw new Error("");return ae},Object.defineProperty(E,L(this.typeName),{enumerable:!0,value:H}),this}field(I,$,H,xe){return this.finalized?(console.error("Ignoring attempt to redefine field "+JSON.stringify(I)+" of finalized type "+JSON.stringify(this.typeName)),this):(this.ownFields[I]=new Wa(I,r.from($),H,xe),this)}finalize(){if(!this.finalized){var I=this.allFields,$=this.allSupertypes;this.baseNames.forEach(xe=>{var ae=y[xe];if(ae instanceof ro)ae.finalize(),M(I,ae.allFields),M($,ae.allSupertypes);else{var me="unknown supertype name "+JSON.stringify(xe)+" for subtype "+JSON.stringify(this.typeName);throw new Error(me)}}),M(I,this.ownFields),$[this.typeName]=this,this.fieldNames.length=0;for(var H in I)ir.call(I,H)&&!I[H].hidden&&this.fieldNames.push(H);Object.defineProperty(U,this.typeName,{enumerable:!0,value:this.type}),this.finalized=!0,F(this.typeName,this.supertypeList),this.buildable&&this.supertypeList.lastIndexOf("Expression")>=0&&re(this.typeName)}}}function x(v){if(!ir.call(y,v))throw new Error("");var I=y[v];if(I.finalized!==!0)throw new Error("");return I.supertypeList.slice(1)}function b(v){for(var I={},$=Object.keys(y),H=$.length,xe=0;xe<H;++xe){var ae=$[xe],me=y[ae];if(me.finalized!==!0)throw new Error(""+ae);for(var yt=0;yt<me.supertypeList.length;++yt){var Pt=me.supertypeList[yt];if(ir.call(v,Pt)){I[ae]=Pt;break}}}return I}var E=Object.create(null),T={};function O(v,I){var $=T[v];return m.check(I)?delete T[v]:(o.assert(I),Object.defineProperty(T,v,{enumerable:!0,configurable:!0,value:I})),$}function L(v){return v.replace(/^[A-Z]+/,function(I){var $=I.length;switch($){case 0:return"";case 1:return I.toLowerCase();default:return I.slice(0,$-1).toLowerCase()+I.charAt($-1)}})}function N(v){return v=L(v),v.replace(/(Expression)?$/,"Statement")}var U={};function oe(v){var I=D(v);if(I)return I.fieldNames.slice(0);if("type"in v)throw new Error("did not recognize object of type "+JSON.stringify(v.type));return Object.keys(v)}function G(v,I){var $=D(v);if($){var H=$.allFields[I];if(H)return H.getValue(v)}return v&&v[I]}function P(v,I,$){oe(v).forEach(function(H){I.call(this,H,G(v,H))},$)}function B(v,I,$){return oe(v).some(function(H){return I.call(this,H,G(v,H))},$)}function re(v){var I=N(v);if(E[I])return;var $=E[L(v)];if(!$)return;let H=function(...xe){return E.expressionStatement($.apply(E,xe))};H.from=function(...xe){return E.expressionStatement($.from.apply(E,xe))},E[I]=H}function F(v,I){I.length=0,I.push(v);for(var $=Object.create(null),H=0;H<I.length;++H){v=I[H];var xe=y[v];if(xe.finalized!==!0)throw new Error("");ir.call($,v)&&delete I[$[v]],$[v]=H,I.push.apply(I,xe.baseNames)}for(var ae=0,me=ae,yt=I.length;me<yt;++me)ir.call(I,me)&&(I[ae++]=I[me]);I.length=ae}function M(v,I){return Object.keys(I).forEach(function($){v[$]=I[$]}),v}function X(){Object.keys(y).forEach(function(v){y[v].finalize()})}return{Type:r,builtInTypes:g,getSupertypeNames:x,computeSupertypeLookupTable:b,builders:E,defineMethod:O,getBuilderName:L,getStatementBuilderName:N,namedTypes:U,getFieldNames:oe,getFieldValue:G,eachField:P,someField:B,finalize:X}}Oe(()=>module);var bP=Object.prototype,_a=bP.hasOwnProperty;function hD(e){var r=e.use(Qe),t=r.builtInTypes.array,n=r.builtInTypes.number;let i=function p(d,f,m){if(!(this instanceof p))throw new Error("Path constructor cannot be invoked without 'new'");if(f){if(!(f instanceof p))throw new Error("")}else f=null,m=null;this.value=d,this.parentPath=f,this.name=m,this.__childCache=null};var s=i.prototype;function o(p){return p.__childCache||(p.__childCache=Object.create(null))}function a(p,d){var f=o(p),m=p.getValueProperty(d),h=f[d];return(!_a.call(f,d)||h.value!==m)&&(h=f[d]=new p.constructor(m,p,d)),h}s.getValueProperty=function(d){return this.value[d]},s.get=function(...d){for(var f=this,m=d.length,h=0;h<m;++h)f=a(f,d[h]);return f},s.each=function(d,f){for(var m=[],h=this.value.length,g=0,g=0;g<h;++g)_a.call(this.value,g)&&(m[g]=this.get(g));for(f=f||this,g=0;g<h;++g)_a.call(m,g)&&d.call(f,m[g])},s.map=function(d,f){var m=[];return this.each(function(h){m.push(d.call(this,h))},f),m},s.filter=function(d,f){var m=[];return this.each(function(h){d.call(this,h)&&m.push(h)},f),m};function l(){}function u(p,d,f,m){if(t.assert(p.value),d===0)return l;var h=p.value.length;if(h<1)return l;var g=arguments.length;g===2?(f=0,m=h):g===3?(f=Math.max(f,0),m=h):(f=Math.max(f,0),m=Math.min(m,h)),n.assert(f),n.assert(m);for(var y=Object.create(null),D=o(p),C=f;C<m;++C)if(_a.call(p.value,C)){var x=p.get(C);if(x.name!==C)throw new Error("");var b=C+d;x.name=b,y[b]=x,delete D[C]}return delete D.length,function(){for(var E in y){var T=y[E];if(T.name!==+E)throw new Error("");D[E]=T,p.value[E]=T.value}}}s.shift=function(){var d=u(this,-1),f=this.value.shift();return d(),f},s.unshift=function(...d){var f=u(this,d.length),m=this.value.unshift.apply(this.value,d);return f(),m},s.push=function(...d){return t.assert(this.value),delete o(this).length,this.value.push.apply(this.value,d)},s.pop=function(){t.assert(this.value);var d=o(this);return delete d[this.value.length-1],delete d.length,this.value.pop()},s.insertAt=function(d){var f=arguments.length,m=u(this,f-1,d);if(m===l&&f<=1)return this;d=Math.max(d,0);for(var h=1;h<f;++h)this.value[d+h-1]=arguments[h];return m(),this},s.insertBefore=function(...d){for(var f=this.parentPath,m=d.length,h=[this.name],g=0;g<m;++g)h.push(d[g]);return f.insertAt.apply(f,h)},s.insertAfter=function(...d){for(var f=this.parentPath,m=d.length,h=[this.name+1],g=0;g<m;++g)h.push(d[g]);return f.insertAt.apply(f,h)};function c(p){if(!(p instanceof i))throw new Error("");var d=p.parentPath;if(!d)return p;var f=d.value,m=o(d);if(f[p.name]===p.value)m[p.name]=p;else if(t.check(f)){var h=f.indexOf(p.value);h>=0&&(m[p.name=h]=p)}else f[p.name]=p.value,m[p.name]=p;if(f[p.name]!==p.value)throw new Error("");if(p.parentPath.get(p.name)!==p)throw new Error("");return p}return s.replace=function(d){var f=[],m=this.parentPath.value,h=o(this.parentPath),g=arguments.length;if(c(this),t.check(m)){for(var y=m.length,D=u(this.parentPath,g-1,this.name+1),C=[this.name,1],x=0;x<g;++x)C.push(arguments[x]);var b=m.splice.apply(m,C);if(b[0]!==this.value)throw new Error("");if(m.length!==y-1+g)throw new Error("");if(D(),g===0)delete this.value,delete h[this.name],this.__childCache=null;else{if(m[this.name]!==d)throw new Error("");for(this.value!==d&&(this.value=d,this.__childCache=null),x=0;x<g;++x)f.push(this.parentPath.get(this.name+x));if(f[0]!==this)throw new Error("")}}else if(g===1)this.value!==d&&(this.__childCache=null),this.value=m[this.name]=d,f.push(this);else if(g===0)delete m[this.name],delete this.value,this.__childCache=null;else throw new Error("Could not replace path");return f},i}Oe(()=>module);var qi=Object.prototype.hasOwnProperty;function xP(e){var r=e.use(Qe),t=r.Type,n=r.namedTypes,i=n.Node,s=n.Expression,o=r.builtInTypes.array,a=r.builders;let l=function x(b,E){if(!(this instanceof x))throw new Error("Scope constructor cannot be invoked without 'new'");c.check(b.value)||u.assert(b.value);var T;if(E){if(!(E instanceof x))throw new Error("");T=E.depth+1}else E=null,T=0;Object.defineProperties(this,{path:{value:b},node:{value:b.value},isGlobal:{value:!E,enumerable:!0},depth:{value:T},parent:{value:E},bindings:{value:{}},types:{value:{}}})};var u=t.or(n.Program,n.Function,n.CatchClause),c=t.or(n.Function,n.ClassDeclaration,n.ClassExpression,n.InterfaceDeclaration,n.TSInterfaceDeclaration,n.TypeAlias,n.TSTypeAliasDeclaration),p=t.or(n.TypeParameter,n.TSTypeParameter);l.isEstablishedBy=function(x){return u.check(x)||c.check(x)};var d=l.prototype;d.didScan=!1,d.declares=function(x){return this.scan(),qi.call(this.bindings,x)},d.declaresType=function(x){return this.scan(),qi.call(this.types,x)},d.declareTemporary=function(x){if(x){if(!/^[a-z$_]/i.test(x))throw new Error("")}else x="t$";x+=this.depth.toString(36)+"$",this.scan();for(var b=0;this.declares(x+b);)++b;var E=x+b;return this.bindings[E]=r.builders.identifier(E)},d.injectTemporary=function(x,b){x||(x=this.declareTemporary());var E=this.path.get("body");return n.BlockStatement.check(E.value)&&(E=E.get("body")),E.unshift(a.variableDeclaration("var",[a.variableDeclarator(x,b||null)])),x},d.scan=function(x){if(x||!this.didScan){for(var b in this.bindings)delete this.bindings[b];for(var b in this.types)delete this.types[b];f(this.path,this.bindings,this.types),this.didScan=!0}},d.getBindings=function(){return this.scan(),this.bindings},d.getTypes=function(){return this.scan(),this.types};function f(x,b,E){var T=x.value;if(c.check(T)){let O=x.get("typeParameters","params");o.check(O.value)&&O.each(L=>{C(L,E)})}u.check(T)&&(n.CatchClause.check(T)?y(x.get("param"),b):m(x,b,E))}function m(x,b,E){var T=x.value;x.parent&&n.FunctionExpression.check(x.parent.node)&&x.parent.node.id&&y(x.parent.get("id"),b),T&&(o.check(T)?x.each(O=>{g(O,b,E)}):n.Function.check(T)?(x.get("params").each(O=>{y(O,b)}),g(x.get("body"),b,E),m(x.get("typeParameters"),b,E)):n.TypeAlias&&n.TypeAlias.check(T)||n.InterfaceDeclaration&&n.InterfaceDeclaration.check(T)||n.TSTypeAliasDeclaration&&n.TSTypeAliasDeclaration.check(T)||n.TSInterfaceDeclaration&&n.TSInterfaceDeclaration.check(T)?D(x.get("id"),E):n.VariableDeclarator.check(T)?(y(x.get("id"),b),g(x.get("init"),b,E)):T.type==="ImportSpecifier"||T.type==="ImportNamespaceSpecifier"||T.type==="ImportDefaultSpecifier"?y(x.get(T.local?"local":T.name?"name":"id"),b):i.check(T)&&!s.check(T)&&r.eachField(T,function(O,L){var N=x.get(O);if(!h(N,L))throw new Error("");g(N,b,E)}))}function h(x,b){return!!(x.value===b||Array.isArray(x.value)&&x.value.length===0&&Array.isArray(b)&&b.length===0)}function g(x,b,E){var T=x.value;if(!(!T||s.check(T)))if(n.FunctionDeclaration.check(T)&&T.id!==null)y(x.get("id"),b);else if(n.ClassDeclaration&&n.ClassDeclaration.check(T)&&T.id!==null)y(x.get("id"),b),m(x.get("typeParameters"),b,E);else if(n.InterfaceDeclaration&&n.InterfaceDeclaration.check(T)||n.TSInterfaceDeclaration&&n.TSInterfaceDeclaration.check(T))D(x.get("id"),E);else if(u.check(T)){if(n.CatchClause.check(T)&&n.Identifier.check(T.param)){var O=T.param.name,L=qi.call(b,O);m(x.get("body"),b,E),L||delete b[O]}}else m(x,b,E)}function y(x,b){var E=x.value;n.Pattern.assert(E),n.Identifier.check(E)?qi.call(b,E.name)?b[E.name].push(x):b[E.name]=[x]:n.AssignmentPattern&&n.AssignmentPattern.check(E)?y(x.get("left"),b):n.ObjectPattern&&n.ObjectPattern.check(E)?x.get("properties").each(function(T){var O=T.value;n.Pattern.check(O)?y(T,b):n.Property.check(O)||n.ObjectProperty&&n.ObjectProperty.check(O)?y(T.get("value"),b):n.SpreadProperty&&n.SpreadProperty.check(O)&&y(T.get("argument"),b)}):n.ArrayPattern&&n.ArrayPattern.check(E)?x.get("elements").each(function(T){var O=T.value;n.Pattern.check(O)?y(T,b):n.SpreadElement&&n.SpreadElement.check(O)&&y(T.get("argument"),b)}):n.PropertyPattern&&n.PropertyPattern.check(E)?y(x.get("pattern"),b):(n.SpreadElementPattern&&n.SpreadElementPattern.check(E)||n.RestElement&&n.RestElement.check(E)||n.SpreadPropertyPattern&&n.SpreadPropertyPattern.check(E))&&y(x.get("argument"),b)}function D(x,b){var E=x.value;n.Pattern.assert(E),n.Identifier.check(E)&&(qi.call(b,E.name)?b[E.name].push(x):b[E.name]=[x])}function C(x,b){var E=x.value;p.assert(E),qi.call(b,E.name)?b[E.name].push(x):b[E.name]=[x]}return d.lookup=function(x){for(var b=this;b&&!b.declares(x);b=b.parent);return b},d.lookupType=function(x){for(var b=this;b&&!b.declaresType(x);b=b.parent);return b},d.getGlobalScope=function(){for(var x=this;!x.isGlobal;)x=x.parent;return x},l}Oe(()=>module);function gD(e){var r=e.use(Qe),t=r.namedTypes,n=r.builders,i=r.builtInTypes.number,s=r.builtInTypes.array,o=e.use(hD),a=e.use(xP);let l=function g(y,D,C){if(!(this instanceof g))throw new Error("NodePath constructor cannot be invoked without 'new'");o.call(this,y,D,C)};var u=l.prototype=Object.create(o.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}});Object.defineProperties(u,{node:{get:function(){return Object.defineProperty(this,"node",{configurable:!0,value:this._computeNode()}),this.node}},parent:{get:function(){return Object.defineProperty(this,"parent",{configurable:!0,value:this._computeParent()}),this.parent}},scope:{get:function(){return Object.defineProperty(this,"scope",{configurable:!0,value:this._computeScope()}),this.scope}}}),u.replace=function(){return delete this.node,delete this.parent,delete this.scope,o.prototype.replace.apply(this,arguments)},u.prune=function(){var g=this.parent;return this.replace(),m(g)},u._computeNode=function(){var g=this.value;if(t.Node.check(g))return g;var y=this.parentPath;return y&&y.node||null},u._computeParent=function(){var g=this.value,y=this.parentPath;if(!t.Node.check(g)){for(;y&&!t.Node.check(y.value);)y=y.parentPath;y&&(y=y.parentPath)}for(;y&&!t.Node.check(y.value);)y=y.parentPath;return y||null},u._computeScope=function(){var g=this.value,y=this.parentPath,D=y&&y.scope;return t.Node.check(g)&&a.isEstablishedBy(g)&&(D=new a(this,D)),D||null},u.getValueProperty=function(g){return r.getFieldValue(this.value,g)},u.needsParens=function(g){var y=this.parentPath;if(!y)return!1;var D=this.value;if(!t.Expression.check(D)||D.type==="Identifier")return!1;for(;!t.Node.check(y.value);)if(y=y.parentPath,!y)return!1;var C=y.value;switch(D.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return C.type==="MemberExpression"&&this.name==="object"&&C.object===D;case"BinaryExpression":case"LogicalExpression":switch(C.type){case"CallExpression":return this.name==="callee"&&C.callee===D;case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return!0;case"MemberExpression":return this.name==="object"&&C.object===D;case"BinaryExpression":case"LogicalExpression":{let x=D,b=C.operator,E=p[b],T=x.operator,O=p[T];if(E>O)return!0;if(E===O&&this.name==="right"){if(C.right!==x)throw new Error("Nodes must be equal");return!0}}default:return!1}case"SequenceExpression":switch(C.type){case"ForStatement":return!1;case"ExpressionStatement":return this.name!=="expression";default:return!0}case"YieldExpression":switch(C.type){case"BinaryExpression":case"LogicalExpression":case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"CallExpression":case"MemberExpression":case"NewExpression":case"ConditionalExpression":case"YieldExpression":return!0;default:return!1}case"Literal":return C.type==="MemberExpression"&&i.check(D.value)&&this.name==="object"&&C.object===D;case"AssignmentExpression":case"ConditionalExpression":switch(C.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"BinaryExpression":case"LogicalExpression":return!0;case"CallExpression":return this.name==="callee"&&C.callee===D;case"ConditionalExpression":return this.name==="test"&&C.test===D;case"MemberExpression":return this.name==="object"&&C.object===D;default:return!1}default:if(C.type==="NewExpression"&&this.name==="callee"&&C.callee===D)return d(D)}return!!(g!==!0&&!this.canBeFirstInStatement()&&this.firstInStatement())};function c(g){return t.BinaryExpression.check(g)||t.LogicalExpression.check(g)}var p={};[["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"]].forEach(function(g,y){g.forEach(function(D){p[D]=y})});function d(g){return t.CallExpression.check(g)?!0:s.check(g)?g.some(d):t.Node.check(g)?r.someField(g,function(y,D){return d(D)}):!1}u.canBeFirstInStatement=function(){var g=this.node;return!t.FunctionExpression.check(g)&&!t.ObjectExpression.check(g)},u.firstInStatement=function(){return f(this)};function f(g){for(var y,D;g.parent;g=g.parent){if(y=g.node,D=g.parent.node,t.BlockStatement.check(D)&&g.parent.name==="body"&&g.name===0){if(D.body[0]!==y)throw new Error("Nodes must be equal");return!0}if(t.ExpressionStatement.check(D)&&g.name==="expression"){if(D.expression!==y)throw new Error("Nodes must be equal");return!0}if(t.SequenceExpression.check(D)&&g.parent.name==="expressions"&&g.name===0){if(D.expressions[0]!==y)throw new Error("Nodes must be equal");continue}if(t.CallExpression.check(D)&&g.name==="callee"){if(D.callee!==y)throw new Error("Nodes must be equal");continue}if(t.MemberExpression.check(D)&&g.name==="object"){if(D.object!==y)throw new Error("Nodes must be equal");continue}if(t.ConditionalExpression.check(D)&&g.name==="test"){if(D.test!==y)throw new Error("Nodes must be equal");continue}if(c(D)&&g.name==="left"){if(D.left!==y)throw new Error("Nodes must be equal");continue}if(t.UnaryExpression.check(D)&&!D.prefix&&g.name==="argument"){if(D.argument!==y)throw new Error("Nodes must be equal");continue}return!1}return!0}function m(g){if(t.VariableDeclaration.check(g.node)){var y=g.get("declarations").value;if(!y||y.length===0)return g.prune()}else if(t.ExpressionStatement.check(g.node)){if(!g.get("expression").value)return g.prune()}else t.IfStatement.check(g.node)&&h(g);return g}function h(g){var y=g.get("test").value,D=g.get("alternate").value,C=g.get("consequent").value;if(!C&&!D){var x=n.expressionStatement(y);g.replace(x)}else if(!C&&D){var b=n.unaryExpression("!",y,!0);t.UnaryExpression.check(y)&&y.operator==="!"&&(b=y.argument),g.get("test").replace(b),g.get("consequent").replace(D),g.get("alternate").replace()}}return l}Oe(()=>module);var ka=Object.prototype.hasOwnProperty;function EP(e){var r=e.use(Qe),t=e.use(gD),n=r.builtInTypes.array,i=r.builtInTypes.object,s=r.builtInTypes.function,o;let a=function m(){if(!(this instanceof m))throw new Error("PathVisitor constructor cannot be invoked without 'new'");this._reusableContextStack=[],this._methodNameTable=l(this),this._shouldVisitComments=ka.call(this._methodNameTable,"Block")||ka.call(this._methodNameTable,"Line"),this.Context=d(this),this._visiting=!1,this._changeReported=!1};function l(m){var h=Object.create(null);for(var g in m)/^visit[A-Z]/.test(g)&&(h[g.slice(5)]=!0);for(var y=r.computeSupertypeLookupTable(h),D=Object.create(null),C=Object.keys(y),x=C.length,b=0;b<x;++b){var E=C[b];g="visit"+y[E],s.check(m[g])&&(D[E]=g)}return D}a.fromMethodsObject=function(h){if(h instanceof a)return h;if(!i.check(h))return new a;let g=function D(){if(!(this instanceof D))throw new Error("Visitor constructor cannot be invoked without 'new'");a.call(this)};var y=g.prototype=Object.create(c);return y.constructor=g,u(y,h),u(g,a),s.assert(g.fromMethodsObject),s.assert(g.visit),new g};function u(m,h){for(var g in h)ka.call(h,g)&&(m[g]=h[g]);return m}a.visit=function(h,g){return a.fromMethodsObject(g).visit(h)};var c=a.prototype;c.visit=function(){if(this._visiting)throw new Error("Recursively calling visitor.visit(path) resets visitor state. Try this.visit(path) or this.traverse(path) instead.");this._visiting=!0,this._changeReported=!1,this._abortRequested=!1;for(var m=arguments.length,h=new Array(m),g=0;g<m;++g)h[g]=arguments[g];h[0]instanceof t||(h[0]=new t({root:h[0]}).get("root")),this.reset.apply(this,h);var y;try{var D=this.visitWithoutReset(h[0]);y=!0}finally{if(this._visiting=!1,!y&&this._abortRequested)return h[0].value}return D},c.AbortRequest=function(){},c.abort=function(){var m=this;m._abortRequested=!0;var h=new m.AbortRequest;throw h.cancel=function(){m._abortRequested=!1},h},c.reset=function(m){},c.visitWithoutReset=function(m){if(this instanceof this.Context)return this.visitor.visitWithoutReset(m);if(!(m instanceof t))throw new Error("");var h=m.value,g=h&&typeof h=="object"&&typeof h.type=="string"&&this._methodNameTable[h.type];if(g){var y=this.acquireContext(m);try{return y.invokeVisitorMethod(g)}finally{this.releaseContext(y)}}else return p(m,this)};function p(m,h){if(!(m instanceof t))throw new Error("");if(!(h instanceof a))throw new Error("");var g=m.value;if(n.check(g))m.each(h.visitWithoutReset,h);else if(i.check(g)){var y=r.getFieldNames(g);h._shouldVisitComments&&g.comments&&y.indexOf("comments")<0&&y.push("comments");for(var D=y.length,C=[],x=0;x<D;++x){var b=y[x];ka.call(g,b)||(g[b]=r.getFieldValue(g,b)),C.push(m.get(b))}for(var x=0;x<D;++x)h.visitWithoutReset(C[x])}return m.value}c.acquireContext=function(m){return this._reusableContextStack.length===0?new this.Context(m):this._reusableContextStack.pop().reset(m)},c.releaseContext=function(m){if(!(m instanceof this.Context))throw new Error("");this._reusableContextStack.push(m),m.currentPath=null},c.reportChanged=function(){this._changeReported=!0},c.wasChangeReported=function(){return this._changeReported};function d(m){function h(y){if(!(this instanceof h))throw new Error("");if(!(this instanceof a))throw new Error("");if(!(y instanceof t))throw new Error("");Object.defineProperty(this,"visitor",{value:m,writable:!1,enumerable:!0,configurable:!1}),this.currentPath=y,this.needToCallTraverse=!0,Object.seal(this)}if(!(m instanceof a))throw new Error("");var g=h.prototype=Object.create(m);return g.constructor=h,u(g,f),h}var f=Object.create(null);return f.reset=function(h){if(!(this instanceof this.Context))throw new Error("");if(!(h instanceof t))throw new Error("");return this.currentPath=h,this.needToCallTraverse=!0,this},f.invokeVisitorMethod=function(h){if(!(this instanceof this.Context))throw new Error("");if(!(this.currentPath instanceof t))throw new Error("");var g=this.visitor[h].call(this,this.currentPath);if(g===!1?this.needToCallTraverse=!1:g!==o&&(this.currentPath=this.currentPath.replace(g)[0],this.needToCallTraverse&&this.traverse(this.currentPath)),this.needToCallTraverse!==!1)throw new Error("Must either call this.traverse or return false in "+h);var y=this.currentPath;return y&&y.value},f.traverse=function(h,g){if(!(this instanceof this.Context))throw new Error("");if(!(h instanceof t))throw new Error("");if(!(this.currentPath instanceof t))throw new Error("");return this.needToCallTraverse=!1,p(h,a.fromMethodsObject(g||this.visitor))},f.visit=function(h,g){if(!(this instanceof this.Context))throw new Error("");if(!(h instanceof t))throw new Error("");if(!(this.currentPath instanceof t))throw new Error("");return this.needToCallTraverse=!1,a.fromMethodsObject(g||this.visitor).visitWithoutReset(h)},f.reportChanged=function(){this.visitor.reportChanged()},f.abort=function(){this.needToCallTraverse=!1,this.visitor.abort()},a}Oe(()=>module);function CP(e){var r=e.use(Qe),t=r.getFieldNames,n=r.getFieldValue,i=r.builtInTypes.array,s=r.builtInTypes.object,o=r.builtInTypes.Date,a=r.builtInTypes.RegExp,l=Object.prototype.hasOwnProperty;function u(m,h,g){return i.check(g)?g.length=0:g=null,p(m,h,g)}u.assert=function(m,h){var g=[];if(!u(m,h,g))if(g.length===0){if(m!==h)throw new Error("Nodes must be equal")}else throw new Error("Nodes differ in the following path: "+g.map(c).join(""))};function c(m){return/[_$a-z][_$a-z0-9]*/i.test(m)?"."+m:"["+JSON.stringify(m)+"]"}function p(m,h,g){return m===h?!0:i.check(m)?d(m,h,g):s.check(m)?f(m,h,g):o.check(m)?o.check(h)&&+m==+h:a.check(m)?a.check(h)&&m.source===h.source&&m.global===h.global&&m.multiline===h.multiline&&m.ignoreCase===h.ignoreCase:m==h}function d(m,h,g){i.assert(m);var y=m.length;if(!i.check(h)||h.length!==y)return g&&g.push("length"),!1;for(var D=0;D<y;++D){if(g&&g.push(D),D in m!=D in h||!p(m[D],h[D],g))return!1;if(g){var C=g.pop();if(C!==D)throw new Error(""+C)}}return!0}function f(m,h,g){if(s.assert(m),!s.check(h))return!1;if(m.type!==h.type)return g&&g.push("type"),!1;var y=t(m),D=y.length,C=t(h),x=C.length;if(D===x){for(var b=0;b<D;++b){var E=y[b],T=n(m,E),O=n(h,E);if(g&&g.push(E),!p(T,O,g))return!1;if(g){var L=g.pop();if(L!==E)throw new Error(""+L)}}return!0}if(!g)return!1;var N=Object.create(null);for(b=0;b<D;++b)N[y[b]]=!0;for(b=0;b<x;++b){if(E=C[b],!l.call(N,E))return g.push(E),!1;delete N[E]}for(E in N){g.push(E);break}return!1}return u}Oe(()=>module);function SP(e){let r=wP(),t=r.use(Qe);e.forEach(r.use),t.finalize();let n=r.use(EP);return{Type:t.Type,builtInTypes:t.builtInTypes,namedTypes:t.namedTypes,builders:t.builders,defineMethod:t.defineMethod,getFieldNames:t.getFieldNames,getFieldValue:t.getFieldValue,eachField:t.eachField,someField:t.someField,getSupertypeNames:t.getSupertypeNames,getBuilderName:t.getBuilderName,astNodesAreEquivalent:r.use(CP),finalize:t.finalize,Path:r.use(hD),NodePath:r.use(gD),PathVisitor:n,use:r.use,visit:n.visit}}function wP(){let e=[],r=[];function t(i){var s=e.indexOf(i);return s===-1&&(s=e.length,e.push(i),r[s]=i(n)),r[s]}var n={use:t};return n}Oe(()=>module);function yD(){return{BinaryOperators:["==","!=","===","!==","<","<=",">",">=","<<",">>",">>>","+","-","*","/","%","&","|","^","in","instanceof"],AssignmentOperators:["=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","|=","^=","&="],LogicalOperators:["||","&&"]}}Oe(()=>module);function DD(e){let r=e.use(yD);return r.BinaryOperators.indexOf("**")<0&&r.BinaryOperators.push("**"),r.AssignmentOperators.indexOf("**=")<0&&r.AssignmentOperators.push("**="),r}Oe(()=>module);function bD(e){let r=e.use(DD);return r.LogicalOperators.indexOf("??")<0&&r.LogicalOperators.push("??"),r}Oe(()=>module);function TP(e){let r=e.use(bD);return r.LogicalOperators.forEach(t=>{let n=t+"=";r.AssignmentOperators.indexOf(n)<0&&r.AssignmentOperators.push(n)}),r}Oe(()=>module);function AP(e){var r=e.use(Qe),t=r.Type,n=t.def,i=t.or,s=e.use(Jt),o=s.defaults,a=s.geq;let{BinaryOperators:l,AssignmentOperators:u,LogicalOperators:c}=e.use(yD);n("Printable").field("loc",i(n("SourceLocation"),null),o.null,!0),n("Node").bases("Printable").field("type",String).field("comments",i([n("Comment")],null),o.null,!0),n("SourceLocation").field("start",n("Position")).field("end",n("Position")).field("source",i(String,null),o.null),n("Position").field("line",a(1)).field("column",a(0)),n("File").bases("Node").build("program","name").field("program",n("Program")).field("name",i(String,null),o.null),n("Program").bases("Node").build("body").field("body",[n("Statement")]),n("Function").bases("Node").field("id",i(n("Identifier"),null),o.null).field("params",[n("Pattern")]).field("body",n("BlockStatement")).field("generator",Boolean,o.false).field("async",Boolean,o.false),n("Statement").bases("Node"),n("EmptyStatement").bases("Statement").build(),n("BlockStatement").bases("Statement").build("body").field("body",[n("Statement")]),n("ExpressionStatement").bases("Statement").build("expression").field("expression",n("Expression")),n("IfStatement").bases("Statement").build("test","consequent","alternate").field("test",n("Expression")).field("consequent",n("Statement")).field("alternate",i(n("Statement"),null),o.null),n("LabeledStatement").bases("Statement").build("label","body").field("label",n("Identifier")).field("body",n("Statement")),n("BreakStatement").bases("Statement").build("label").field("label",i(n("Identifier"),null),o.null),n("ContinueStatement").bases("Statement").build("label").field("label",i(n("Identifier"),null),o.null),n("WithStatement").bases("Statement").build("object","body").field("object",n("Expression")).field("body",n("Statement")),n("SwitchStatement").bases("Statement").build("discriminant","cases","lexical").field("discriminant",n("Expression")).field("cases",[n("SwitchCase")]).field("lexical",Boolean,o.false),n("ReturnStatement").bases("Statement").build("argument").field("argument",i(n("Expression"),null)),n("ThrowStatement").bases("Statement").build("argument").field("argument",n("Expression")),n("TryStatement").bases("Statement").build("block","handler","finalizer").field("block",n("BlockStatement")).field("handler",i(n("CatchClause"),null),function(){return this.handlers&&this.handlers[0]||null}).field("handlers",[n("CatchClause")],function(){return this.handler?[this.handler]:[]},!0).field("guardedHandlers",[n("CatchClause")],o.emptyArray).field("finalizer",i(n("BlockStatement"),null),o.null),n("CatchClause").bases("Node").build("param","guard","body").field("param",n("Pattern")).field("guard",i(n("Expression"),null),o.null).field("body",n("BlockStatement")),n("WhileStatement").bases("Statement").build("test","body").field("test",n("Expression")).field("body",n("Statement")),n("DoWhileStatement").bases("Statement").build("body","test").field("body",n("Statement")).field("test",n("Expression")),n("ForStatement").bases("Statement").build("init","test","update","body").field("init",i(n("VariableDeclaration"),n("Expression"),null)).field("test",i(n("Expression"),null)).field("update",i(n("Expression"),null)).field("body",n("Statement")),n("ForInStatement").bases("Statement").build("left","right","body").field("left",i(n("VariableDeclaration"),n("Expression"))).field("right",n("Expression")).field("body",n("Statement")),n("DebuggerStatement").bases("Statement").build(),n("Declaration").bases("Statement"),n("FunctionDeclaration").bases("Function","Declaration").build("id","params","body").field("id",n("Identifier")),n("FunctionExpression").bases("Function","Expression").build("id","params","body"),n("VariableDeclaration").bases("Declaration").build("kind","declarations").field("kind",i("var","let","const")).field("declarations",[n("VariableDeclarator")]),n("VariableDeclarator").bases("Node").build("id","init").field("id",n("Pattern")).field("init",i(n("Expression"),null),o.null),n("Expression").bases("Node"),n("ThisExpression").bases("Expression").build(),n("ArrayExpression").bases("Expression").build("elements").field("elements",[i(n("Expression"),null)]),n("ObjectExpression").bases("Expression").build("properties").field("properties",[n("Property")]),n("Property").bases("Node").build("kind","key","value").field("kind",i("init","get","set")).field("key",i(n("Literal"),n("Identifier"))).field("value",n("Expression")),n("SequenceExpression").bases("Expression").build("expressions").field("expressions",[n("Expression")]);var p=i("-","+","!","~","typeof","void","delete");n("UnaryExpression").bases("Expression").build("operator","argument","prefix").field("operator",p).field("argument",n("Expression")).field("prefix",Boolean,o.true);let d=i(...l);n("BinaryExpression").bases("Expression").build("operator","left","right").field("operator",d).field("left",n("Expression")).field("right",n("Expression"));let f=i(...u);n("AssignmentExpression").bases("Expression").build("operator","left","right").field("operator",f).field("left",i(n("Pattern"),n("MemberExpression"))).field("right",n("Expression"));var m=i("++","--");n("UpdateExpression").bases("Expression").build("operator","argument","prefix").field("operator",m).field("argument",n("Expression")).field("prefix",Boolean);var h=i(...c);n("LogicalExpression").bases("Expression").build("operator","left","right").field("operator",h).field("left",n("Expression")).field("right",n("Expression")),n("ConditionalExpression").bases("Expression").build("test","consequent","alternate").field("test",n("Expression")).field("consequent",n("Expression")).field("alternate",n("Expression")),n("NewExpression").bases("Expression").build("callee","arguments").field("callee",n("Expression")).field("arguments",[n("Expression")]),n("CallExpression").bases("Expression").build("callee","arguments").field("callee",n("Expression")).field("arguments",[n("Expression")]),n("MemberExpression").bases("Expression").build("object","property","computed").field("object",n("Expression")).field("property",i(n("Identifier"),n("Expression"))).field("computed",Boolean,function(){var g=this.property.type;return g==="Literal"||g==="MemberExpression"||g==="BinaryExpression"}),n("Pattern").bases("Node"),n("SwitchCase").bases("Node").build("test","consequent").field("test",i(n("Expression"),null)).field("consequent",[n("Statement")]),n("Identifier").bases("Expression","Pattern").build("name").field("name",String).field("optional",Boolean,o.false),n("Literal").bases("Expression").build("value").field("value",i(String,Boolean,null,Number,RegExp,BigInt)),n("Comment").bases("Printable").field("value",String).field("leading",Boolean,o.true).field("trailing",Boolean,o.false)}Oe(()=>module);function vP(e){e.use(AP);let r=e.use(Qe),t=r.Type.def,n=r.Type.or,i=e.use(Jt).defaults;t("Function").field("generator",Boolean,i.false).field("expression",Boolean,i.false).field("defaults",[n(t("Expression"),null)],i.emptyArray).field("rest",n(t("Identifier"),null),i.null),t("RestElement").bases("Pattern").build("argument").field("argument",t("Pattern")).field("typeAnnotation",n(t("TypeAnnotation"),t("TSTypeAnnotation"),null),i.null),t("SpreadElementPattern").bases("Pattern").build("argument").field("argument",t("Pattern")),t("FunctionDeclaration").build("id","params","body","generator","expression").field("id",n(t("Identifier"),null)),t("FunctionExpression").build("id","params","body","generator","expression"),t("ArrowFunctionExpression").bases("Function","Expression").build("params","body","expression").field("id",null,i.null).field("body",n(t("BlockStatement"),t("Expression"))).field("generator",!1,i.false),t("ForOfStatement").bases("Statement").build("left","right","body").field("left",n(t("VariableDeclaration"),t("Pattern"))).field("right",t("Expression")).field("body",t("Statement")),t("YieldExpression").bases("Expression").build("argument","delegate").field("argument",n(t("Expression"),null)).field("delegate",Boolean,i.false),t("GeneratorExpression").bases("Expression").build("body","blocks","filter").field("body",t("Expression")).field("blocks",[t("ComprehensionBlock")]).field("filter",n(t("Expression"),null)),t("ComprehensionExpression").bases("Expression").build("body","blocks","filter").field("body",t("Expression")).field("blocks",[t("ComprehensionBlock")]).field("filter",n(t("Expression"),null)),t("ComprehensionBlock").bases("Node").build("left","right","each").field("left",t("Pattern")).field("right",t("Expression")).field("each",Boolean),t("Property").field("key",n(t("Literal"),t("Identifier"),t("Expression"))).field("value",n(t("Expression"),t("Pattern"))).field("method",Boolean,i.false).field("shorthand",Boolean,i.false).field("computed",Boolean,i.false),t("ObjectProperty").field("shorthand",Boolean,i.false),t("PropertyPattern").bases("Pattern").build("key","pattern").field("key",n(t("Literal"),t("Identifier"),t("Expression"))).field("pattern",t("Pattern")).field("computed",Boolean,i.false),t("ObjectPattern").bases("Pattern").build("properties").field("properties",[n(t("PropertyPattern"),t("Property"))]),t("ArrayPattern").bases("Pattern").build("elements").field("elements",[n(t("Pattern"),null)]),t("SpreadElement").bases("Node").build("argument").field("argument",t("Expression")),t("ArrayExpression").field("elements",[n(t("Expression"),t("SpreadElement"),t("RestElement"),null)]),t("NewExpression").field("arguments",[n(t("Expression"),t("SpreadElement"))]),t("CallExpression").field("arguments",[n(t("Expression"),t("SpreadElement"))]),t("AssignmentPattern").bases("Pattern").build("left","right").field("left",t("Pattern")).field("right",t("Expression")),t("MethodDefinition").bases("Declaration").build("kind","key","value","static").field("kind",n("constructor","method","get","set")).field("key",t("Expression")).field("value",t("Function")).field("computed",Boolean,i.false).field("static",Boolean,i.false);let s=n(t("MethodDefinition"),t("VariableDeclarator"),t("ClassPropertyDefinition"),t("ClassProperty"),t("StaticBlock"));t("ClassProperty").bases("Declaration").build("key").field("key",n(t("Literal"),t("Identifier"),t("Expression"))).field("computed",Boolean,i.false),t("ClassPropertyDefinition").bases("Declaration").build("definition").field("definition",s),t("ClassBody").bases("Declaration").build("body").field("body",[s]),t("ClassDeclaration").bases("Declaration").build("id","body","superClass").field("id",n(t("Identifier"),null)).field("body",t("ClassBody")).field("superClass",n(t("Expression"),null),i.null),t("ClassExpression").bases("Expression").build("id","body","superClass").field("id",n(t("Identifier"),null),i.null).field("body",t("ClassBody")).field("superClass",n(t("Expression"),null),i.null),t("Super").bases("Expression").build(),t("Specifier").bases("Node"),t("ModuleSpecifier").bases("Specifier").field("local",n(t("Identifier"),null),i.null).field("id",n(t("Identifier"),null),i.null).field("name",n(t("Identifier"),null),i.null),t("ImportSpecifier").bases("ModuleSpecifier").build("imported","local").field("imported",t("Identifier")),t("ImportDefaultSpecifier").bases("ModuleSpecifier").build("local"),t("ImportNamespaceSpecifier").bases("ModuleSpecifier").build("local"),t("ImportDeclaration").bases("Declaration").build("specifiers","source","importKind").field("specifiers",[n(t("ImportSpecifier"),t("ImportNamespaceSpecifier"),t("ImportDefaultSpecifier"))],i.emptyArray).field("source",t("Literal")).field("importKind",n("value","type"),function(){return"value"}),t("ExportNamedDeclaration").bases("Declaration").build("declaration","specifiers","source").field("declaration",n(t("Declaration"),null)).field("specifiers",[t("ExportSpecifier")],i.emptyArray).field("source",n(t("Literal"),null),i.null),t("ExportSpecifier").bases("ModuleSpecifier").build("local","exported").field("exported",t("Identifier")),t("ExportDefaultDeclaration").bases("Declaration").build("declaration").field("declaration",n(t("Declaration"),t("Expression"))),t("ExportAllDeclaration").bases("Declaration").build("source").field("source",t("Literal")),t("TaggedTemplateExpression").bases("Expression").build("tag","quasi").field("tag",t("Expression")).field("quasi",t("TemplateLiteral")),t("TemplateLiteral").bases("Expression").build("quasis","expressions").field("quasis",[t("TemplateElement")]).field("expressions",[t("Expression")]),t("TemplateElement").bases("Node").build("value","tail").field("value",{cooked:String,raw:String}).field("tail",Boolean),t("MetaProperty").bases("Expression").build("meta","property").field("meta",t("Identifier")).field("property",t("Identifier"))}Oe(()=>module);function PP(e){e.use(DD),e.use(vP)}Oe(()=>module);function IP(e){e.use(PP);let t=e.use(Qe).Type.def,n=e.use(Jt).defaults;t("Function").field("async",Boolean,n.false),t("AwaitExpression").bases("Expression").build("argument").field("argument",t("Expression"))}Oe(()=>module);function NP(e){e.use(IP);let r=e.use(Qe),t=r.Type.def,n=r.Type.or,i=e.use(Jt).defaults;t("ForOfStatement").field("await",Boolean,i.false),t("SpreadProperty").bases("Node").build("argument").field("argument",t("Expression")),t("ObjectExpression").field("properties",[n(t("Property"),t("SpreadProperty"),t("SpreadElement"))]),t("TemplateElement").field("value",{cooked:n(String,null),raw:String}),t("SpreadPropertyPattern").bases("Pattern").build("argument").field("argument",t("Pattern")),t("ObjectPattern").field("properties",[n(t("PropertyPattern"),t("Property"),t("RestElement"),t("SpreadPropertyPattern"))])}Oe(()=>module);function FP(e){e.use(NP);let r=e.use(Qe),t=r.Type.def,n=r.Type.or,i=e.use(Jt).defaults;t("CatchClause").field("param",n(t("Pattern"),null),i.null)}Oe(()=>module);function _P(e){e.use(bD),e.use(FP);let r=e.use(Qe),t=r.Type.def,n=r.Type.or,s=e.use(Jt).defaults;t("ImportExpression").bases("Expression").build("source").field("source",t("Expression")),t("ExportAllDeclaration").bases("Declaration").build("source","exported").field("source",t("Literal")).field("exported",n(t("Identifier"),null,void 0),s.null),t("ChainElement").bases("Node").field("optional",Boolean,s.false),t("CallExpression").bases("Expression","ChainElement"),t("MemberExpression").bases("Expression","ChainElement"),t("ChainExpression").bases("Expression").build("expression").field("expression",t("ChainElement")),t("OptionalCallExpression").bases("CallExpression").build("callee","arguments","optional").field("optional",Boolean,s.true),t("OptionalMemberExpression").bases("MemberExpression").build("object","property","computed","optional").field("optional",Boolean,s.true)}Oe(()=>module);function kP(e){e.use(TP),e.use(_P)}Oe(()=>module);function OP(e){e.use(kP);let t=e.use(Qe).Type.def;t("StaticBlock").bases("Declaration").build("body").field("body",[t("Statement")])}Oe(()=>module);function lo(e){e.use(OP);let r=e.use(Qe),t=r.Type,n=r.Type.def,i=t.or,o=e.use(Jt).defaults;n("AwaitExpression").build("argument","all").field("argument",i(n("Expression"),null)).field("all",Boolean,o.false),n("Decorator").bases("Node").build("expression").field("expression",n("Expression")),n("Property").field("decorators",i([n("Decorator")],null),o.null),n("MethodDefinition").field("decorators",i([n("Decorator")],null),o.null),n("PrivateName").bases("Expression","Pattern").build("id").field("id",n("Identifier")),n("ClassPrivateProperty").bases("ClassProperty").build("key","value").field("key",n("PrivateName")).field("value",i(n("Expression"),null),o.null),n("ImportAttribute").bases("Node").build("key","value").field("key",i(n("Identifier"),n("Literal"))).field("value",n("Expression")),["ImportDeclaration","ExportAllDeclaration","ExportNamedDeclaration"].forEach(a=>{n(a).field("assertions",[n("ImportAttribute")],o.emptyArray)}),n("RecordExpression").bases("Expression").build("properties").field("properties",[i(n("ObjectProperty"),n("ObjectMethod"),n("SpreadElement"))]),n("TupleExpression").bases("Expression").build("elements").field("elements",[i(n("Expression"),n("SpreadElement"),null)]),n("ModuleExpression").bases("Node").build("body").field("body",n("Program"))}Oe(()=>module);function RP(e){e.use(lo);let r=e.use(Qe),t=r.Type.def,n=r.Type.or,i=e.use(Jt).defaults;t("JSXAttribute").bases("Node").build("name","value").field("name",n(t("JSXIdentifier"),t("JSXNamespacedName"))).field("value",n(t("Literal"),t("JSXExpressionContainer"),t("JSXElement"),t("JSXFragment"),null),i.null),t("JSXIdentifier").bases("Identifier").build("name").field("name",String),t("JSXNamespacedName").bases("Node").build("namespace","name").field("namespace",t("JSXIdentifier")).field("name",t("JSXIdentifier")),t("JSXMemberExpression").bases("MemberExpression").build("object","property").field("object",n(t("JSXIdentifier"),t("JSXMemberExpression"))).field("property",t("JSXIdentifier")).field("computed",Boolean,i.false);let s=n(t("JSXIdentifier"),t("JSXNamespacedName"),t("JSXMemberExpression"));t("JSXSpreadAttribute").bases("Node").build("argument").field("argument",t("Expression"));let o=[n(t("JSXAttribute"),t("JSXSpreadAttribute"))];t("JSXExpressionContainer").bases("Expression").build("expression").field("expression",n(t("Expression"),t("JSXEmptyExpression")));let a=[n(t("JSXText"),t("JSXExpressionContainer"),t("JSXSpreadChild"),t("JSXElement"),t("JSXFragment"),t("Literal"))];t("JSXElement").bases("Expression").build("openingElement","closingElement","children").field("openingElement",t("JSXOpeningElement")).field("closingElement",n(t("JSXClosingElement"),null),i.null).field("children",a,i.emptyArray).field("name",s,function(){return this.openingElement.name},!0).field("selfClosing",Boolean,function(){return this.openingElement.selfClosing},!0).field("attributes",o,function(){return this.openingElement.attributes},!0),t("JSXOpeningElement").bases("Node").build("name","attributes","selfClosing").field("name",s).field("attributes",o,i.emptyArray).field("selfClosing",Boolean,i.false),t("JSXClosingElement").bases("Node").build("name").field("name",s),t("JSXFragment").bases("Expression").build("openingFragment","closingFragment","children").field("openingFragment",t("JSXOpeningFragment")).field("closingFragment",t("JSXClosingFragment")).field("children",a,i.emptyArray),t("JSXOpeningFragment").bases("Node").build(),t("JSXClosingFragment").bases("Node").build(),t("JSXText").bases("Literal").build("value","raw").field("value",String).field("raw",String,function(){return this.value}),t("JSXEmptyExpression").bases("Node").build(),t("JSXSpreadChild").bases("Node").build("expression").field("expression",t("Expression"))}Oe(()=>module);function xD(e){var r=e.use(Qe),t=r.Type.def,n=r.Type.or,i=e.use(Jt).defaults,s=n(t("TypeAnnotation"),t("TSTypeAnnotation"),null),o=n(t("TypeParameterDeclaration"),t("TSTypeParameterDeclaration"),null);t("Identifier").field("typeAnnotation",s,i.null),t("ObjectPattern").field("typeAnnotation",s,i.null),t("Function").field("returnType",s,i.null).field("typeParameters",o,i.null),t("ClassProperty").build("key","value","typeAnnotation","static").field("value",n(t("Expression"),null)).field("static",Boolean,i.false).field("typeAnnotation",s,i.null),["ClassDeclaration","ClassExpression"].forEach(a=>{t(a).field("typeParameters",o,i.null).field("superTypeParameters",n(t("TypeParameterInstantiation"),t("TSTypeParameterInstantiation"),null),i.null).field("implements",n([t("ClassImplements")],[t("TSExpressionWithTypeArguments")]),i.emptyArray)})}Oe(()=>module);function ED(e){e.use(lo),e.use(xD);let r=e.use(Qe),t=r.Type.def,n=r.Type.or,i=e.use(Jt).defaults;t("Flow").bases("Node"),t("FlowType").bases("Flow"),t("AnyTypeAnnotation").bases("FlowType").build(),t("EmptyTypeAnnotation").bases("FlowType").build(),t("MixedTypeAnnotation").bases("FlowType").build(),t("VoidTypeAnnotation").bases("FlowType").build(),t("SymbolTypeAnnotation").bases("FlowType").build(),t("NumberTypeAnnotation").bases("FlowType").build(),t("BigIntTypeAnnotation").bases("FlowType").build(),t("NumberLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",Number).field("raw",String),t("NumericLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",Number).field("raw",String),t("BigIntLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",null).field("raw",String),t("StringTypeAnnotation").bases("FlowType").build(),t("StringLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",String).field("raw",String),t("BooleanTypeAnnotation").bases("FlowType").build(),t("BooleanLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",Boolean).field("raw",String),t("TypeAnnotation").bases("Node").build("typeAnnotation").field("typeAnnotation",t("FlowType")),t("NullableTypeAnnotation").bases("FlowType").build("typeAnnotation").field("typeAnnotation",t("FlowType")),t("NullLiteralTypeAnnotation").bases("FlowType").build(),t("NullTypeAnnotation").bases("FlowType").build(),t("ThisTypeAnnotation").bases("FlowType").build(),t("ExistsTypeAnnotation").bases("FlowType").build(),t("ExistentialTypeParam").bases("FlowType").build(),t("FunctionTypeAnnotation").bases("FlowType").build("params","returnType","rest","typeParameters").field("params",[t("FunctionTypeParam")]).field("returnType",t("FlowType")).field("rest",n(t("FunctionTypeParam"),null)).field("typeParameters",n(t("TypeParameterDeclaration"),null)),t("FunctionTypeParam").bases("Node").build("name","typeAnnotation","optional").field("name",n(t("Identifier"),null)).field("typeAnnotation",t("FlowType")).field("optional",Boolean),t("ArrayTypeAnnotation").bases("FlowType").build("elementType").field("elementType",t("FlowType")),t("ObjectTypeAnnotation").bases("FlowType").build("properties","indexers","callProperties").field("properties",[n(t("ObjectTypeProperty"),t("ObjectTypeSpreadProperty"))]).field("indexers",[t("ObjectTypeIndexer")],i.emptyArray).field("callProperties",[t("ObjectTypeCallProperty")],i.emptyArray).field("inexact",n(Boolean,void 0),i.undefined).field("exact",Boolean,i.false).field("internalSlots",[t("ObjectTypeInternalSlot")],i.emptyArray),t("Variance").bases("Node").build("kind").field("kind",n("plus","minus"));let s=n(t("Variance"),"plus","minus",null);t("ObjectTypeProperty").bases("Node").build("key","value","optional").field("key",n(t("Literal"),t("Identifier"))).field("value",t("FlowType")).field("optional",Boolean).field("variance",s,i.null),t("ObjectTypeIndexer").bases("Node").build("id","key","value").field("id",t("Identifier")).field("key",t("FlowType")).field("value",t("FlowType")).field("variance",s,i.null).field("static",Boolean,i.false),t("ObjectTypeCallProperty").bases("Node").build("value").field("value",t("FunctionTypeAnnotation")).field("static",Boolean,i.false),t("QualifiedTypeIdentifier").bases("Node").build("qualification","id").field("qualification",n(t("Identifier"),t("QualifiedTypeIdentifier"))).field("id",t("Identifier")),t("GenericTypeAnnotation").bases("FlowType").build("id","typeParameters").field("id",n(t("Identifier"),t("QualifiedTypeIdentifier"))).field("typeParameters",n(t("TypeParameterInstantiation"),null)),t("MemberTypeAnnotation").bases("FlowType").build("object","property").field("object",t("Identifier")).field("property",n(t("MemberTypeAnnotation"),t("GenericTypeAnnotation"))),t("IndexedAccessType").bases("FlowType").build("objectType","indexType").field("objectType",t("FlowType")).field("indexType",t("FlowType")),t("OptionalIndexedAccessType").bases("FlowType").build("objectType","indexType","optional").field("objectType",t("FlowType")).field("indexType",t("FlowType")).field("optional",Boolean),t("UnionTypeAnnotation").bases("FlowType").build("types").field("types",[t("FlowType")]),t("IntersectionTypeAnnotation").bases("FlowType").build("types").field("types",[t("FlowType")]),t("TypeofTypeAnnotation").bases("FlowType").build("argument").field("argument",t("FlowType")),t("ObjectTypeSpreadProperty").bases("Node").build("argument").field("argument",t("FlowType")),t("ObjectTypeInternalSlot").bases("Node").build("id","value","optional","static","method").field("id",t("Identifier")).field("value",t("FlowType")).field("optional",Boolean).field("static",Boolean).field("method",Boolean),t("TypeParameterDeclaration").bases("Node").build("params").field("params",[t("TypeParameter")]),t("TypeParameterInstantiation").bases("Node").build("params").field("params",[t("FlowType")]),t("TypeParameter").bases("FlowType").build("name","variance","bound","default").field("name",String).field("variance",s,i.null).field("bound",n(t("TypeAnnotation"),null),i.null).field("default",n(t("FlowType"),null),i.null),t("ClassProperty").field("variance",s,i.null),t("ClassImplements").bases("Node").build("id").field("id",t("Identifier")).field("superClass",n(t("Expression"),null),i.null).field("typeParameters",n(t("TypeParameterInstantiation"),null),i.null),t("InterfaceTypeAnnotation").bases("FlowType").build("body","extends").field("body",t("ObjectTypeAnnotation")).field("extends",n([t("InterfaceExtends")],null),i.null),t("InterfaceDeclaration").bases("Declaration").build("id","body","extends").field("id",t("Identifier")).field("typeParameters",n(t("TypeParameterDeclaration"),null),i.null).field("body",t("ObjectTypeAnnotation")).field("extends",[t("InterfaceExtends")]),t("DeclareInterface").bases("InterfaceDeclaration").build("id","body","extends"),t("InterfaceExtends").bases("Node").build("id").field("id",t("Identifier")).field("typeParameters",n(t("TypeParameterInstantiation"),null),i.null),t("TypeAlias").bases("Declaration").build("id","typeParameters","right").field("id",t("Identifier")).field("typeParameters",n(t("TypeParameterDeclaration"),null)).field("right",t("FlowType")),t("DeclareTypeAlias").bases("TypeAlias").build("id","typeParameters","right"),t("OpaqueType").bases("Declaration").build("id","typeParameters","impltype","supertype").field("id",t("Identifier")).field("typeParameters",n(t("TypeParameterDeclaration"),null)).field("impltype",t("FlowType")).field("supertype",n(t("FlowType"),null)),t("DeclareOpaqueType").bases("OpaqueType").build("id","typeParameters","supertype").field("impltype",n(t("FlowType"),null)),t("TypeCastExpression").bases("Expression").build("expression","typeAnnotation").field("expression",t("Expression")).field("typeAnnotation",t("TypeAnnotation")),t("TupleTypeAnnotation").bases("FlowType").build("types").field("types",[t("FlowType")]),t("DeclareVariable").bases("Statement").build("id").field("id",t("Identifier")),t("DeclareFunction").bases("Statement").build("id").field("id",t("Identifier")).field("predicate",n(t("FlowPredicate"),null),i.null),t("DeclareClass").bases("InterfaceDeclaration").build("id"),t("DeclareModule").bases("Statement").build("id","body").field("id",n(t("Identifier"),t("Literal"))).field("body",t("BlockStatement")),t("DeclareModuleExports").bases("Statement").build("typeAnnotation").field("typeAnnotation",t("TypeAnnotation")),t("DeclareExportDeclaration").bases("Declaration").build("default","declaration","specifiers","source").field("default",Boolean).field("declaration",n(t("DeclareVariable"),t("DeclareFunction"),t("DeclareClass"),t("FlowType"),t("TypeAlias"),t("DeclareOpaqueType"),t("InterfaceDeclaration"),null)).field("specifiers",[n(t("ExportSpecifier"),t("ExportBatchSpecifier"))],i.emptyArray).field("source",n(t("Literal"),null),i.null),t("DeclareExportAllDeclaration").bases("Declaration").build("source").field("source",n(t("Literal"),null),i.null),t("ImportDeclaration").field("importKind",n("value","type","typeof"),()=>"value"),t("FlowPredicate").bases("Flow"),t("InferredPredicate").bases("FlowPredicate").build(),t("DeclaredPredicate").bases("FlowPredicate").build("value").field("value",t("Expression")),t("Function").field("predicate",n(t("FlowPredicate"),null),i.null),t("CallExpression").field("typeArguments",n(null,t("TypeParameterInstantiation")),i.null),t("NewExpression").field("typeArguments",n(null,t("TypeParameterInstantiation")),i.null),t("EnumDeclaration").bases("Declaration").build("id","body").field("id",t("Identifier")).field("body",n(t("EnumBooleanBody"),t("EnumNumberBody"),t("EnumStringBody"),t("EnumSymbolBody"))),t("EnumBooleanBody").build("members","explicitType").field("members",[t("EnumBooleanMember")]).field("explicitType",Boolean),t("EnumNumberBody").build("members","explicitType").field("members",[t("EnumNumberMember")]).field("explicitType",Boolean),t("EnumStringBody").build("members","explicitType").field("members",n([t("EnumStringMember")],[t("EnumDefaultedMember")])).field("explicitType",Boolean),t("EnumSymbolBody").build("members").field("members",[t("EnumDefaultedMember")]),t("EnumBooleanMember").build("id","init").field("id",t("Identifier")).field("init",n(t("Literal"),Boolean)),t("EnumNumberMember").build("id","init").field("id",t("Identifier")).field("init",t("Literal")),t("EnumStringMember").build("id","init").field("id",t("Identifier")).field("init",t("Literal")),t("EnumDefaultedMember").build("id").field("id",t("Identifier"))}Oe(()=>module);function LP(e){e.use(lo);var r=e.use(Qe),t=e.use(Jt).defaults,n=r.Type.def,i=r.Type.or;n("VariableDeclaration").field("declarations",[i(n("VariableDeclarator"),n("Identifier"))]),n("Property").field("value",i(n("Expression"),n("Pattern"))),n("ArrayPattern").field("elements",[i(n("Pattern"),n("SpreadElement"),null)]),n("ObjectPattern").field("properties",[i(n("Property"),n("PropertyPattern"),n("SpreadPropertyPattern"),n("SpreadProperty"))]),n("ExportSpecifier").bases("ModuleSpecifier").build("id","name"),n("ExportBatchSpecifier").bases("Specifier").build(),n("ExportDeclaration").bases("Declaration").build("default","declaration","specifiers","source").field("default",Boolean).field("declaration",i(n("Declaration"),n("Expression"),null)).field("specifiers",[i(n("ExportSpecifier"),n("ExportBatchSpecifier"))],t.emptyArray).field("source",i(n("Literal"),null),t.null),n("Block").bases("Comment").build("value","leading","trailing"),n("Line").bases("Comment").build("value","leading","trailing")}Oe(()=>module);function CD(e){e.use(lo);let r=e.use(Qe),t=e.use(Jt).defaults,n=r.Type.def,i=r.Type.or,{undefined:s}=r.builtInTypes;n("Noop").bases("Statement").build(),n("DoExpression").bases("Expression").build("body").field("body",[n("Statement")]),n("BindExpression").bases("Expression").build("object","callee").field("object",i(n("Expression"),null)).field("callee",n("Expression")),n("ParenthesizedExpression").bases("Expression").build("expression").field("expression",n("Expression")),n("ExportNamespaceSpecifier").bases("Specifier").build("exported").field("exported",n("Identifier")),n("ExportDefaultSpecifier").bases("Specifier").build("exported").field("exported",n("Identifier")),n("CommentBlock").bases("Comment").build("value","leading","trailing"),n("CommentLine").bases("Comment").build("value","leading","trailing"),n("Directive").bases("Node").build("value").field("value",n("DirectiveLiteral")),n("DirectiveLiteral").bases("Node","Expression").build("value").field("value",String,t["use strict"]),n("InterpreterDirective").bases("Node").build("value").field("value",String),n("BlockStatement").bases("Statement").build("body").field("body",[n("Statement")]).field("directives",[n("Directive")],t.emptyArray),n("Program").bases("Node").build("body").field("body",[n("Statement")]).field("directives",[n("Directive")],t.emptyArray).field("interpreter",i(n("InterpreterDirective"),null),t.null);function o(c=String,p){return["extra",{rawValue:c,raw:String},function(){let f=r.getFieldValue(this,"value");return{rawValue:f,raw:p?p(f):String(f)}}]}n("StringLiteral").bases("Literal").build("value").field("value",String).field(...o(String,c=>JSON.stringify(c))),n("NumericLiteral").bases("Literal").build("value").field("value",Number).field("raw",i(String,null),t.null).field(...o(Number)),n("BigIntLiteral").bases("Literal").build("value").field("value",i(String,Number)).field(...o(String,c=>c+"n")),n("DecimalLiteral").bases("Literal").build("value").field("value",String).field(...o(String,c=>c+"m")),n("NullLiteral").bases("Literal").build().field("value",null,t.null),n("BooleanLiteral").bases("Literal").build("value").field("value",Boolean),n("RegExpLiteral").bases("Literal").build("pattern","flags").field("pattern",String).field("flags",String).field("value",RegExp,function(){return new RegExp(this.pattern,this.flags)}).field(...o(i(RegExp,s),c=>`/${c.pattern}/${c.flags||""}`)).field("regex",{pattern:String,flags:String},function(){return{pattern:this.pattern,flags:this.flags}});var a=i(n("Property"),n("ObjectMethod"),n("ObjectProperty"),n("SpreadProperty"),n("SpreadElement"));n("ObjectExpression").bases("Expression").build("properties").field("properties",[a]),n("ObjectMethod").bases("Node","Function").build("kind","key","params","body","computed").field("kind",i("method","get","set")).field("key",i(n("Literal"),n("Identifier"),n("Expression"))).field("params",[n("Pattern")]).field("body",n("BlockStatement")).field("computed",Boolean,t.false).field("generator",Boolean,t.false).field("async",Boolean,t.false).field("accessibility",i(n("Literal"),null),t.null).field("decorators",i([n("Decorator")],null),t.null),n("ObjectProperty").bases("Node").build("key","value").field("key",i(n("Literal"),n("Identifier"),n("Expression"))).field("value",i(n("Expression"),n("Pattern"))).field("accessibility",i(n("Literal"),null),t.null).field("computed",Boolean,t.false);var l=i(n("MethodDefinition"),n("VariableDeclarator"),n("ClassPropertyDefinition"),n("ClassProperty"),n("ClassPrivateProperty"),n("ClassMethod"),n("ClassPrivateMethod"),n("ClassAccessorProperty"),n("StaticBlock"));n("ClassBody").bases("Declaration").build("body").field("body",[l]),n("ClassMethod").bases("Declaration","Function").build("kind","key","params","body","computed","static").field("key",i(n("Literal"),n("Identifier"),n("Expression"))),n("ClassPrivateMethod").bases("Declaration","Function").build("key","params","body","kind","computed","static").field("key",n("PrivateName")),n("ClassAccessorProperty").bases("Declaration").build("key","value","decorators","computed","static").field("key",i(n("Literal"),n("Identifier"),n("PrivateName"),n("Expression"))).field("value",i(n("Expression"),null),t.null),["ClassMethod","ClassPrivateMethod"].forEach(c=>{n(c).field("kind",i("get","set","method","constructor"),()=>"method").field("body",n("BlockStatement")).field("access",i("public","private","protected",null),t.null)}),["ClassMethod","ClassPrivateMethod","ClassAccessorProperty"].forEach(c=>{n(c).field("computed",Boolean,t.false).field("static",Boolean,t.false).field("abstract",Boolean,t.false).field("accessibility",i("public","private","protected",null),t.null).field("decorators",i([n("Decorator")],null),t.null).field("definite",Boolean,t.false).field("optional",Boolean,t.false).field("override",Boolean,t.false).field("readonly",Boolean,t.false)});var u=i(n("Property"),n("PropertyPattern"),n("SpreadPropertyPattern"),n("SpreadProperty"),n("ObjectProperty"),n("RestProperty"),n("RestElement"));n("ObjectPattern").bases("Pattern").build("properties").field("properties",[u]).field("decorators",i([n("Decorator")],null),t.null),n("SpreadProperty").bases("Node").build("argument").field("argument",n("Expression")),n("RestProperty").bases("Node").build("argument").field("argument",n("Expression")),n("ForAwaitStatement").bases("Statement").build("left","right","body").field("left",i(n("VariableDeclaration"),n("Expression"))).field("right",n("Expression")).field("body",n("Statement")),n("Import").bases("Expression").build()}Oe(()=>module);function BP(e){let t=e.use(Qe).Type.def;e.use(CD),e.use(ED),t("V8IntrinsicIdentifier").bases("Expression").build("name").field("name",String),t("TopicReference").bases("Expression").build()}Oe(()=>module);function MP(e){e.use(CD),e.use(xD);var r=e.use(Qe),t=r.namedTypes,n=r.Type.def,i=r.Type.or,s=e.use(Jt).defaults,o=r.Type.from(function(c,p){return!!(t.StringLiteral&&t.StringLiteral.check(c,p)||t.Literal&&t.Literal.check(c,p)&&typeof c.value=="string")},"StringLiteral");n("TSType").bases("Node");var a=i(n("Identifier"),n("TSQualifiedName"));n("TSTypeReference").bases("TSType","TSHasOptionalTypeParameterInstantiation").build("typeName","typeParameters").field("typeName",a),n("TSHasOptionalTypeParameterInstantiation").field("typeParameters",i(n("TSTypeParameterInstantiation"),null),s.null),n("TSHasOptionalTypeParameters").field("typeParameters",i(n("TSTypeParameterDeclaration"),null,void 0),s.null),n("TSHasOptionalTypeAnnotation").field("typeAnnotation",i(n("TSTypeAnnotation"),null),s.null),n("TSQualifiedName").bases("Node").build("left","right").field("left",a).field("right",a),n("TSAsExpression").bases("Expression","Pattern").build("expression","typeAnnotation").field("expression",n("Expression")).field("typeAnnotation",n("TSType")).field("extra",i({parenthesized:Boolean},null),s.null),n("TSTypeCastExpression").bases("Expression").build("expression","typeAnnotation").field("expression",n("Expression")).field("typeAnnotation",n("TSType")),n("TSSatisfiesExpression").bases("Expression","Pattern").build("expression","typeAnnotation").field("expression",n("Expression")).field("typeAnnotation",n("TSType")),n("TSNonNullExpression").bases("Expression","Pattern").build("expression").field("expression",n("Expression")),["TSAnyKeyword","TSBigIntKeyword","TSBooleanKeyword","TSNeverKeyword","TSNullKeyword","TSNumberKeyword","TSObjectKeyword","TSStringKeyword","TSSymbolKeyword","TSUndefinedKeyword","TSUnknownKeyword","TSVoidKeyword","TSIntrinsicKeyword","TSThisType"].forEach(c=>{n(c).bases("TSType").build()}),n("TSArrayType").bases("TSType").build("elementType").field("elementType",n("TSType")),n("TSLiteralType").bases("TSType").build("literal").field("literal",i(n("NumericLiteral"),n("StringLiteral"),n("BooleanLiteral"),n("TemplateLiteral"),n("UnaryExpression"),n("BigIntLiteral"))),n("TemplateLiteral").field("expressions",i([n("Expression")],[n("TSType")])),["TSUnionType","TSIntersectionType"].forEach(c=>{n(c).bases("TSType").build("types").field("types",[n("TSType")])}),n("TSConditionalType").bases("TSType").build("checkType","extendsType","trueType","falseType").field("checkType",n("TSType")).field("extendsType",n("TSType")).field("trueType",n("TSType")).field("falseType",n("TSType")),n("TSInferType").bases("TSType").build("typeParameter").field("typeParameter",n("TSTypeParameter")),n("TSParenthesizedType").bases("TSType").build("typeAnnotation").field("typeAnnotation",n("TSType"));var l=[i(n("Identifier"),n("RestElement"),n("ArrayPattern"),n("ObjectPattern"))];["TSFunctionType","TSConstructorType"].forEach(c=>{n(c).bases("TSType","TSHasOptionalTypeParameters","TSHasOptionalTypeAnnotation").build("parameters").field("parameters",l)}),n("TSDeclareFunction").bases("Declaration","TSHasOptionalTypeParameters").build("id","params","returnType").field("declare",Boolean,s.false).field("async",Boolean,s.false).field("generator",Boolean,s.false).field("id",i(n("Identifier"),null),s.null).field("params",[n("Pattern")]).field("returnType",i(n("TSTypeAnnotation"),n("Noop"),null),s.null),n("TSDeclareMethod").bases("Declaration","TSHasOptionalTypeParameters").build("key","params","returnType").field("async",Boolean,s.false).field("generator",Boolean,s.false).field("params",[n("Pattern")]).field("abstract",Boolean,s.false).field("accessibility",i("public","private","protected",void 0),s.undefined).field("static",Boolean,s.false).field("computed",Boolean,s.false).field("optional",Boolean,s.false).field("key",i(n("Identifier"),n("StringLiteral"),n("NumericLiteral"),n("Expression"))).field("kind",i("get","set","method","constructor"),function(){return"method"}).field("access",i("public","private","protected",void 0),s.undefined).field("decorators",i([n("Decorator")],null),s.null).field("returnType",i(n("TSTypeAnnotation"),n("Noop"),null),s.null),n("TSMappedType").bases("TSType").build("typeParameter","typeAnnotation").field("readonly",i(Boolean,"+","-"),s.false).field("typeParameter",n("TSTypeParameter")).field("optional",i(Boolean,"+","-"),s.false).field("typeAnnotation",i(n("TSType"),null),s.null),n("TSTupleType").bases("TSType").build("elementTypes").field("elementTypes",[i(n("TSType"),n("TSNamedTupleMember"))]),n("TSNamedTupleMember").bases("TSType").build("label","elementType","optional").field("label",n("Identifier")).field("optional",Boolean,s.false).field("elementType",n("TSType")),n("TSRestType").bases("TSType").build("typeAnnotation").field("typeAnnotation",n("TSType")),n("TSOptionalType").bases("TSType").build("typeAnnotation").field("typeAnnotation",n("TSType")),n("TSIndexedAccessType").bases("TSType").build("objectType","indexType").field("objectType",n("TSType")).field("indexType",n("TSType")),n("TSTypeOperator").bases("TSType").build("operator").field("operator",String).field("typeAnnotation",n("TSType")),n("TSTypeAnnotation").bases("Node").build("typeAnnotation").field("typeAnnotation",i(n("TSType"),n("TSTypeAnnotation"))),n("TSIndexSignature").bases("Declaration","TSHasOptionalTypeAnnotation").build("parameters","typeAnnotation").field("parameters",[n("Identifier")]).field("readonly",Boolean,s.false),n("TSPropertySignature").bases("Declaration","TSHasOptionalTypeAnnotation").build("key","typeAnnotation","optional").field("key",n("Expression")).field("computed",Boolean,s.false).field("readonly",Boolean,s.false).field("optional",Boolean,s.false).field("initializer",i(n("Expression"),null),s.null),n("TSMethodSignature").bases("Declaration","TSHasOptionalTypeParameters","TSHasOptionalTypeAnnotation").build("key","parameters","typeAnnotation").field("key",n("Expression")).field("computed",Boolean,s.false).field("optional",Boolean,s.false).field("parameters",l),n("TSTypePredicate").bases("TSTypeAnnotation","TSType").build("parameterName","typeAnnotation","asserts").field("parameterName",i(n("Identifier"),n("TSThisType"))).field("typeAnnotation",i(n("TSTypeAnnotation"),null),s.null).field("asserts",Boolean,s.false),["TSCallSignatureDeclaration","TSConstructSignatureDeclaration"].forEach(c=>{n(c).bases("Declaration","TSHasOptionalTypeParameters","TSHasOptionalTypeAnnotation").build("parameters","typeAnnotation").field("parameters",l)}),n("TSEnumMember").bases("Node").build("id","initializer").field("id",i(n("Identifier"),o)).field("initializer",i(n("Expression"),null),s.null),n("TSTypeQuery").bases("TSType").build("exprName").field("exprName",i(a,n("TSImportType")));var u=i(n("TSCallSignatureDeclaration"),n("TSConstructSignatureDeclaration"),n("TSIndexSignature"),n("TSMethodSignature"),n("TSPropertySignature"));n("TSTypeLiteral").bases("TSType").build("members").field("members",[u]),n("TSTypeParameter").bases("Identifier").build("name","constraint","default").field("name",i(n("Identifier"),String)).field("constraint",i(n("TSType"),void 0),s.undefined).field("default",i(n("TSType"),void 0),s.undefined),n("TSTypeAssertion").bases("Expression","Pattern").build("typeAnnotation","expression").field("typeAnnotation",n("TSType")).field("expression",n("Expression")).field("extra",i({parenthesized:Boolean},null),s.null),n("TSTypeParameterDeclaration").bases("Declaration").build("params").field("params",[n("TSTypeParameter")]),n("TSInstantiationExpression").bases("Expression","TSHasOptionalTypeParameterInstantiation").build("expression","typeParameters").field("expression",n("Expression")),n("TSTypeParameterInstantiation").bases("Node").build("params").field("params",[n("TSType")]),n("TSEnumDeclaration").bases("Declaration").build("id","members").field("id",n("Identifier")).field("const",Boolean,s.false).field("declare",Boolean,s.false).field("members",[n("TSEnumMember")]).field("initializer",i(n("Expression"),null),s.null),n("TSTypeAliasDeclaration").bases("Declaration","TSHasOptionalTypeParameters").build("id","typeAnnotation").field("id",n("Identifier")).field("declare",Boolean,s.false).field("typeAnnotation",n("TSType")),n("TSModuleBlock").bases("Node").build("body").field("body",[n("Statement")]),n("TSModuleDeclaration").bases("Declaration").build("id","body").field("id",i(o,a)).field("declare",Boolean,s.false).field("global",Boolean,s.false).field("body",i(n("TSModuleBlock"),n("TSModuleDeclaration"),null),s.null),n("TSImportType").bases("TSType","TSHasOptionalTypeParameterInstantiation").build("argument","qualifier","typeParameters").field("argument",o).field("qualifier",i(a,void 0),s.undefined),n("TSImportEqualsDeclaration").bases("Declaration").build("id","moduleReference").field("id",n("Identifier")).field("isExport",Boolean,s.false).field("moduleReference",i(a,n("TSExternalModuleReference"))),n("TSExternalModuleReference").bases("Declaration").build("expression").field("expression",o),n("TSExportAssignment").bases("Statement").build("expression").field("expression",n("Expression")),n("TSNamespaceExportDeclaration").bases("Declaration").build("id").field("id",n("Identifier")),n("TSInterfaceBody").bases("Node").build("body").field("body",[u]),n("TSExpressionWithTypeArguments").bases("TSType","TSHasOptionalTypeParameterInstantiation").build("expression","typeParameters").field("expression",a),n("TSInterfaceDeclaration").bases("Declaration","TSHasOptionalTypeParameters").build("id","body").field("id",a).field("declare",Boolean,s.false).field("extends",i([n("TSExpressionWithTypeArguments")],null),s.null).field("body",n("TSInterfaceBody")),n("TSParameterProperty").bases("Pattern").build("parameter").field("accessibility",i("public","private","protected",void 0),s.undefined).field("readonly",Boolean,s.false).field("parameter",i(n("Identifier"),n("AssignmentPattern"))),n("ClassProperty").field("access",i("public","private","protected",void 0),s.undefined),n("ClassAccessorProperty").bases("Declaration","TSHasOptionalTypeAnnotation"),n("ClassBody").field("body",[i(n("MethodDefinition"),n("VariableDeclarator"),n("ClassPropertyDefinition"),n("ClassProperty"),n("ClassPrivateProperty"),n("ClassAccessorProperty"),n("ClassMethod"),n("ClassPrivateMethod"),n("StaticBlock"),n("TSDeclareMethod"),u)])}Oe(()=>module);var yr;yr||(yr={});var{astNodesAreEquivalent:p8,builders:Qi,builtInTypes:Dr,defineMethod:d8,eachField:f8,finalize:m8,getBuilderName:h8,getFieldNames:$P,getFieldValue:un,getSupertypeNames:g8,namedTypes:UP,NodePath:jP,Path:y8,PathVisitor:D8,someField:KP,Type:b8,use:x8,visit:E8}=SP([lo,RP,ED,LP,BP,MP]);Object.assign(yr,UP);var Oa=yr,Zy=Ja.default.SourceMapConsumer,VP=Ja.default.SourceMapGenerator,SD=Object.prototype.hasOwnProperty;function zP(){return`
|
|
992
992
|
`}function eD(e,r,t){return e&&SD.call(e,r)?e[r]:t}function qP(...e){let r={},t=e.length;for(let n=0;n<t;++n){let i=Object.keys(e[n]),s=i.length;for(let o=0;o<s;++o)r[i[o]]=!0}return r}function Te(e,r){return e.line-r.line||e.column-r.column}function Fn(e){return{line:e.line,column:e.column}}function WP(e,r){if(e){if(!r)return e}else return r||null;let t=new Zy(e),n=new Zy(r),i=new VP({file:r.file,sourceRoot:r.sourceRoot}),s={};return n.eachMapping(function(o){let a=t.originalPositionFor({line:o.originalLine,column:o.originalColumn}),l=a.source;if(l===null)return;i.addMapping({source:l,original:Fn(a),generated:{line:o.generatedLine,column:o.generatedColumn},name:o.name});let u=t.sourceContentFor(l);u&&!SD.call(s,l)&&(s[l]=u,i.setSourceContent(l,u))}),i.toJSON()}function wD(e,r){if(!e.loc)return null;let t={start:e.loc.start,end:e.loc.end};function n(i){Zc(t,i.loc)}return e.declaration&&e.declaration.decorators&&Ya(e)&&e.declaration.decorators.forEach(n),Te(t.start,t.end)<0&&(t.start=Fn(t.start),r.skipSpaces(t.start,!1,!0),Te(t.start,t.end)<0&&(t.end=Fn(t.end),r.skipSpaces(t.end,!0,!0))),e.comments&&e.comments.forEach(n),t}function Zc(e,r){e&&r&&(Te(r.start,e.start)<0&&(e.start=r.start),Te(e.end,r.end)<0&&(e.end=r.end))}function up(e,r){let t=e.loc;if(t&&(t.start.line<1&&(t.start.line=1),t.end.line<1&&(t.end.line=1)),e.type==="File"&&(t.start=r.firstPos(),t.end=r.lastPos()),GP(e,r),HP(e,r),t&&e.decorators)e.decorators.forEach(function(n){Zc(t,n.loc)});else if(e.declaration&&Ya(e)){e.declaration.loc=null;let n=e.declaration.decorators;n&&n.forEach(function(i){Zc(t,i.loc)})}else if(Oa.MethodDefinition&&Oa.MethodDefinition.check(e)||Oa.Property.check(e)&&(e.method||e.shorthand))e.value.loc=null,Oa.FunctionExpression.check(e.value)&&(e.value.id=null);else if(e.type==="ObjectTypeProperty"){let n=e.loc,i=n&&n.end;i&&(i=Fn(i),r.prevPos(i)&&r.charAt(i)===","&&(i=r.skipSpaces(i,!0,!0))&&(n.end=i))}}function GP(e,r){if(e.type!=="ForStatement")return;function t(n){let i=n&&n.loc,s=i&&i.start,o=i&&Fn(i.end);for(;s&&o&&Te(s,o)<0&&(r.prevPos(o),r.charAt(o)===";");)i.end.line=o.line,i.end.column=o.column}t(e.init),t(e.test),t(e.update)}function HP(e,r){if(e.type==="TemplateLiteral"&&e.quasis.length!==0){if(e.loc){let t=Fn(e.loc.start),n=e.quasis[0];Te(n.loc.start,t)<0&&(n.loc.start=t);let i=Fn(e.loc.end),s=e.quasis[e.quasis.length-1];Te(i,s.loc.end)<0&&(s.loc.end=i)}e.expressions.forEach(function(t,n){let i=r.skipSpaces(t.loc.start,!0,!1);if(r.prevPos(i)&&r.charAt(i)==="{"&&r.prevPos(i)&&r.charAt(i)==="$"){let o=e.quasis[n];Te(i,o.loc.end)<0&&(o.loc.end=i)}let s=r.skipSpaces(t.loc.end,!1,!1);if(r.charAt(s)==="}"){let o=e.quasis[n+1];Te(o.loc.start,s)<0&&(o.loc.start=s)}})}}function Ya(e){if(e)switch(e.type){case"ExportDeclaration":case"ExportDefaultDeclaration":case"ExportDefaultSpecifier":case"DeclareExportDeclaration":case"ExportNamedDeclaration":case"ExportAllDeclaration":return!0}return!1}function TD(e){let r=e.getParentNode();return e.getName()==="declaration"&&Ya(r)?r:null}function no(e,r){let t=e.trailingComma;return typeof t=="object"?!!t[r]:!!t}var ep={tabWidth:4,useTabs:!1,reuseWhitespace:!0,lineTerminator:zP(),wrapColumn:74,sourceFileName:null,sourceMapName:null,sourceRoot:null,inputSourceMap:null,range:!1,tolerant:!0,quote:null,trailingComma:!1,arrayBracketSpacing:!1,objectCurlySpacing:!0,arrowParensAlways:!1,flowObjectCommas:!0,tokens:!0},JP=ep.hasOwnProperty;function Xa(e){let r=e||ep;function t(n){return JP.call(r,n)?r[n]:ep[n]}return{tabWidth:+t("tabWidth"),useTabs:!!t("useTabs"),reuseWhitespace:!!t("reuseWhitespace"),lineTerminator:t("lineTerminator"),wrapColumn:Math.max(t("wrapColumn"),0),sourceFileName:t("sourceFileName"),sourceMapName:t("sourceMapName"),sourceRoot:t("sourceRoot"),inputSourceMap:t("inputSourceMap"),parser:t("esprima")||t("parser"),range:t("range"),tolerant:t("tolerant"),quote:t("quote"),trailingComma:t("trailingComma"),arrayBracketSpacing:t("arrayBracketSpacing"),objectCurlySpacing:t("objectCurlySpacing"),arrowParensAlways:t("arrowParensAlways"),flowObjectCommas:t("flowObjectCommas"),tokens:!!t("tokens")}}var tp=class e{constructor(r,t,n=t){this.sourceLines=r,this.sourceLoc=t,this.targetLoc=n}slice(r,t,n=r.lastPos()){let i=this.sourceLines,s=this.sourceLoc,o=this.targetLoc;function a(l){let u=s[l],c=o[l],p=t;return l==="end"&&(p=n),YP(i,u,r,c,p)}if(Te(t,o.start)<=0)if(Te(o.end,n)<=0)o={start:Nn(o.start,t.line,t.column),end:Nn(o.end,t.line,t.column)};else{if(Te(n,o.start)<=0)return null;s={start:s.start,end:a("end")},o={start:Nn(o.start,t.line,t.column),end:Nn(n,t.line,t.column)}}else{if(Te(o.end,t)<=0)return null;Te(o.end,n)<=0?(s={start:a("start"),end:s.end},o={start:{line:1,column:0},end:Nn(o.end,t.line,t.column)}):(s={start:a("start"),end:a("end")},o={start:{line:1,column:0},end:Nn(n,t.line,t.column)})}return new e(this.sourceLines,s,o)}add(r,t){return new e(this.sourceLines,this.sourceLoc,{start:tD(this.targetLoc.start,r,t),end:tD(this.targetLoc.end,r,t)})}subtract(r,t){return new e(this.sourceLines,this.sourceLoc,{start:Nn(this.targetLoc.start,r,t),end:Nn(this.targetLoc.end,r,t)})}indent(r,t=!1,n=!1){if(r===0)return this;let i=this.targetLoc,s=i.start.line,o=i.end.line;if(t&&s===1&&o===1)return this;if(i={start:i.start,end:i.end},!t||s>1){let a=i.start.column+r;i.start={line:s,column:n?Math.max(0,a):a}}if(!t||o>1){let a=i.end.column+r;i.end={line:o,column:n?Math.max(0,a):a}}return new e(this.sourceLines,this.sourceLoc,i)}};function tD(e,r,t){return{line:e.line+r-1,column:e.line===1?e.column+t:e.column}}function Nn(e,r,t){return{line:e.line-r+1,column:e.line===r?e.column-t:e.column}}function YP(e,r,t,n,i){let s=Te(n,i);if(s===0)return r;let o,a;if(s<0){o=e.skipSpaces(r)||e.lastPos(),a=t.skipSpaces(n)||t.lastPos();let l=i.line-a.line;for(o.line+=l,a.line+=l,l>0&&(o.column=0,a.column=0);Te(a,i)<0&&t.nextPos(a,!0););}else{o=e.skipSpaces(r,!0)||e.firstPos(),a=t.skipSpaces(n,!0)||t.firstPos();let l=i.line-a.line;for(o.line+=l,a.line+=l,l<0&&(o.column=e.getLineLength(o.line),a.column=t.getLineLength(a.line));Te(i,a)<0&&t.prevPos(a,!0););}return o}var XP=Object.defineProperty,QP=(e,r,t)=>r in e?XP(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,Ys=(e,r,t)=>(QP(e,typeof r!="symbol"?r+"":r,t),t),Yi=class e{constructor(r,t=null){this.infos=r,Ys(this,"length"),Ys(this,"name"),Ys(this,"mappings",[]),Ys(this,"cachedSourceMap",null),Ys(this,"cachedTabWidth"),this.length=r.length,this.name=t||null,this.name&&this.mappings.push(new tp(this,{start:this.firstPos(),end:this.lastPos()}))}toString(r){return this.sliceString(this.firstPos(),this.lastPos(),r)}getSourceMap(r,t){if(!r)return null;let n=this;function i(a){return a=a||{},a.file=r,t&&(a.sourceRoot=t),a}if(n.cachedSourceMap)return i(n.cachedSourceMap.toJSON());let s=new Ja.default.SourceMapGenerator(i()),o={};return n.mappings.forEach(function(a){let l=a.sourceLines.skipSpaces(a.sourceLoc.start)||a.sourceLines.lastPos(),u=n.skipSpaces(a.targetLoc.start)||n.lastPos();for(;Te(l,a.sourceLoc.end)<0&&Te(u,a.targetLoc.end)<0;){a.sourceLines.charAt(l),n.charAt(u);let c=a.sourceLines.name;if(s.addMapping({source:c,original:{line:l.line,column:l.column},generated:{line:u.line,column:u.column}}),!rp.call(o,c)){let p=a.sourceLines.toString();s.setSourceContent(c,p),o[c]=p}n.nextPos(u,!0),a.sourceLines.nextPos(l,!0)}}),n.cachedSourceMap=s,s.toJSON()}bootstrapCharAt(r){let t=r.line,n=r.column,i=this.toString().split(np),s=i[t-1];return typeof s>"u"?"":n===s.length&&t<i.length?`
|
|
993
993
|
`:n>=s.length?"":s.charAt(n)}charAt(r){let t=r.line,n=r.column,i=this,s=i.infos,o=s[t-1],a=n;if(typeof o>"u"||a<0)return"";let l=this.getIndentAt(t);return a<l?" ":(a+=o.sliceStart-l,a===o.sliceEnd&&t<this.length?`
|
|
994
994
|
`:a>=o.sliceEnd?"":o.line.charAt(a))}stripMargin(r,t){if(r===0)return this;if(t&&this.length===1)return this;let n=new e(this.infos.map(function(i,s){return i.line&&(s>0||!t)&&(i={...i,indent:Math.max(0,i.indent-r)}),i}));if(this.mappings.length>0){let i=n.mappings;this.mappings.forEach(function(s){i.push(s.indent(r,t,!0))})}return n}indent(r){if(r===0)return this;let t=new e(this.infos.map(function(n){return n.line&&!n.locked&&(n={...n,indent:n.indent+r}),n}));if(this.mappings.length>0){let n=t.mappings;this.mappings.forEach(function(i){n.push(i.indent(r))})}return t}indentTail(r){if(r===0)return this;if(this.length<2)return this;let t=new e(this.infos.map(function(n,i){return i>0&&n.line&&!n.locked&&(n={...n,indent:n.indent+r}),n}));if(this.mappings.length>0){let n=t.mappings;this.mappings.forEach(function(i){n.push(i.indent(r,!0))})}return t}lockIndentTail(){return this.length<2?this:new e(this.infos.map((r,t)=>({...r,locked:t>0})))}getIndentAt(r){return Math.max(this.infos[r-1].indent,0)}guessTabWidth(){if(typeof this.cachedTabWidth=="number")return this.cachedTabWidth;let r=[],t=0;for(let s=1,o=this.length;s<=o;++s){let a=this.infos[s-1],l=a.line.slice(a.sliceStart,a.sliceEnd);if(Wi(l))continue;let u=Math.abs(a.indent-t);r[u]=~~r[u]+1,t=a.indent}let n=-1,i=2;for(let s=1;s<r.length;s+=1)rp.call(r,s)&&r[s]>n&&(n=r[s],i=s);return this.cachedTabWidth=i}startsWithComment(){if(this.infos.length===0)return!1;let r=this.infos[0],t=r.sliceStart,n=r.sliceEnd,i=r.line.slice(t,n).trim();return i.length===0||i.slice(0,2)==="//"||i.slice(0,2)==="/*"}isOnlyWhitespace(){return Wi(this.toString())}isPrecededOnlyByWhitespace(r){let t=this.infos[r.line-1],n=Math.max(t.indent,0),i=r.column-n;if(i<=0)return!0;let s=t.sliceStart,o=Math.min(s+i,t.sliceEnd),a=t.line.slice(s,o);return Wi(a)}getLineLength(r){let t=this.infos[r-1];return this.getIndentAt(r)+t.sliceEnd-t.sliceStart}nextPos(r,t=!1){let n=Math.max(r.line,0);return Math.max(r.column,0)<this.getLineLength(n)?(r.column+=1,t?!!this.skipSpaces(r,!1,!0):!0):n<this.length?(r.line+=1,r.column=0,t?!!this.skipSpaces(r,!1,!0):!0):!1}prevPos(r,t=!1){let n=r.line,i=r.column;if(i<1){if(n-=1,n<1)return!1;i=this.getLineLength(n)}else i=Math.min(i-1,this.getLineLength(n));return r.line=n,r.column=i,t?!!this.skipSpaces(r,!0,!0):!0}firstPos(){return{line:1,column:0}}lastPos(){return{line:this.length,column:this.getLineLength(this.length)}}skipSpaces(r,t=!1,n=!1){if(r?r=n?r:{line:r.line,column:r.column}:t?r=this.lastPos():r=this.firstPos(),t){for(;this.prevPos(r);)if(!Wi(this.charAt(r))&&this.nextPos(r))return r;return null}else{for(;Wi(this.charAt(r));)if(!this.nextPos(r))return null;return r}}trimLeft(){let r=this.skipSpaces(this.firstPos(),!1,!0);return r?this.slice(r):ni}trimRight(){let r=this.skipSpaces(this.lastPos(),!0,!0);return r?this.slice(this.firstPos(),r):ni}trim(){let r=this.skipSpaces(this.firstPos(),!1,!0);if(r===null)return ni;let t=this.skipSpaces(this.lastPos(),!0,!0);return t===null?ni:this.slice(r,t)}eachPos(r,t=this.firstPos(),n=!1){let i=this.firstPos();if(t&&(i.line=t.line,i.column=t.column),!(n&&!this.skipSpaces(i,!1,!0)))do r.call(this,i);while(this.nextPos(i,n))}bootstrapSlice(r,t){let n=this.toString().split(np).slice(r.line-1,t.line);return n.length>0&&(n.push(n.pop().slice(0,t.column)),n[0]=n[0].slice(r.column)),A(n.join(`
|
|
@@ -1084,17 +1084,17 @@ ${" ".repeat(6+i)}^`),u));r+=`
|
|
|
1084
1084
|
${l.join(`
|
|
1085
1085
|
`)}
|
|
1086
1086
|
`}this.message=r}},I1=new Set(["Literal","StringLiteral","NumericLiteral","BooleanLiteral","NullLiteral","RegExpLiteral","BigIntLiteral"]),zD=new Set(["string","number","boolean","bigint","symbol","undefined"]),st=Qi;function N1(e){return/^[$A-Z_a-z][\w$]*$/.test(e)}var dp="__magicast_proxy";function Rt(e,r=new Set){if(e===void 0)return st.identifier("undefined");if(e===null)return st.literal(null);if(zD.has(typeof e))return st.literal(e);if(r.has(e))throw new Tt("Can not serialize circular reference");if(r.add(e),e[dp])return e.$ast;if(e instanceof RegExp){let t=st.regExpLiteral(e.source,e.flags);return delete t.extra.raw,t}return e instanceof Set?st.newExpression(st.identifier("Set"),[st.arrayExpression([...e].map(t=>Rt(t,r)))]):e instanceof Date?st.newExpression(st.identifier("Date"),[st.literal(e.toISOString())]):e instanceof Map?st.newExpression(st.identifier("Map"),[st.arrayExpression([...e].map(([t,n])=>st.arrayExpression([Rt(t,r),Rt(n,r)])))]):Array.isArray(e)?st.arrayExpression(e.map(t=>Rt(t,r))):typeof e=="object"?st.objectExpression(Object.entries(e).map(([t,n])=>st.property("init",/^[$A-Z_a-z][\w$]*$/g.test(t)?st.identifier(t):st.literal(t),Rt(n,r)))):st.literal(e)}function F1(e,r={}){let t=r;return t[dp]=!0,t.$ast=e,t.$type||(t.$type="object"),t}var _1={enumerable:!0,configurable:!0};function sr(e,r,t){let n=F1(e,r);return new Proxy({},{ownKeys(){return Object.keys(n).filter(i=>i!==dp&&!i.startsWith("$"))},getOwnPropertyDescriptor(){return _1},has(i,s){return s in n},...t,get(i,s,o){if(s in n)return n[s];if(t.get)return t.get(i,s,o)},set(i,s,o,a){return s in n?(n[s]=o,!0):t.set?t.set(i,s,o,a):!1}})}var Ht=Qi,Xc=new WeakMap;function k1(e,r,t){if(Xc.has(r))return Xc.get(r);let n=sr(r,{get $declaration(){return e},get imported(){return r.type==="ImportDefaultSpecifier"?"default":r.type==="ImportNamespaceSpecifier"?"*":r.imported.type==="Identifier"?r.imported.name:r.imported.value},set imported(i){if(r.type!=="ImportSpecifier")throw new Tt("Changing import name is not yet implemented");r.imported.type==="Identifier"?r.imported.name=i:r.imported.value=i},get local(){return r.local.name},set local(i){r.local.name=i},get from(){return e.source.value},set from(i){if(i===e.source.value)return;e.specifiers=e.specifiers.filter(o=>o!==r),e.specifiers.length===0&&(t.body=t.body.filter(o=>o!==e));let s=t.body.find(o=>o.type==="ImportDeclaration"&&o.source.value===i);s?s.specifiers.push(r):t.body.unshift(Ht.importDeclaration([r],Ht.stringLiteral(i)))},toJSON(){return{imported:this.imported,local:this.local,from:this.from}}},{ownKeys(){return["imported","local","from","toJSON"]}});return Xc.set(r,n),n}function O1(e,r){let t=()=>{let o=[];for(let a of e.body)if(a.type==="ImportDeclaration")for(let l of a.specifiers)o.push(k1(a,l,e));return o},n=(o,a,l)=>{let u=t(),c=u.find(m=>m.local===o),p=a.local||o;if(c)return c.imported=a.imported,c.local=p,c.from=a.from,!0;let d=a.imported==="default"?Ht.importDefaultSpecifier(Ht.identifier(p)):a.imported==="*"?Ht.importNamespaceSpecifier(Ht.identifier(p)):Ht.importSpecifier(Ht.identifier(a.imported),Ht.identifier(p)),f=u.find(m=>m.from===a.from)?.$declaration;if(f)f.specifiers.push(d);else if(l==="prepend"||u.length===0)e.body.unshift(Ht.importDeclaration([d],Ht.stringLiteral(a.from)));else{let m=u.at(-1).$declaration,h=e.body.indexOf(m);e.body.splice(h+1,0,Ht.importDeclaration([d],Ht.stringLiteral(a.from)))}return!0},i=o=>{let a=t().find(c=>c.local===o);if(!a)return!1;let l=a.$declaration,u=a.$ast;return l.specifiers=l.specifiers.filter(c=>c!==u),l.specifiers.length===0&&(e.body=e.body.filter(c=>c!==l)),!0};return sr(e,{$type:"imports",$add(o){n(o.local||o.imported,o,"prepend")},$prepend(o){n(o.local||o.imported,o,"prepend")},$append(o){n(o.local||o.imported,o,"append")},get $items(){return t()},toJSON(){return t().reduce((o,a)=>(o[a.local]=a,o),{})}},{get(o,a){return t().find(l=>l.local===a)},set(o,a,l){return n(a,l,"prepend")},deleteProperty(o,a){return i(a)},ownKeys(){return t().map(o=>o.local)},has(o,a){return t().some(l=>l.local===a)}})}function Qa(e,r,t){let n=s=>r[s],i=(s,o)=>{r[s]=o};return sr(e,{$type:"array",push(s){r.push(Rt(s))},pop(){return Ot(r.pop(),t)},unshift(s){r.unshift(Rt(s))},shift(){return Ot(r.shift(),t)},splice(s,o,...a){return r.splice(s,o,...a.map(u=>Rt(u))).map(u=>Ot(u,t))},find(s){return r.map(o=>Ot(o,t)).find(s)},findIndex(s){return r.map(o=>Ot(o,t)).findIndex(s)},includes(s){return r.map(o=>Ot(o,t)).includes(s)},toJSON(){return r.map(s=>Ot(s,t))}},{get(s,o){if(o==="length")return r.length;if(o===Symbol.iterator)return function*(){for(let u of r)yield Ot(u,t)};if(typeof o=="symbol")return;let a=+o;if(Number.isNaN(a))return;let l=n(a);if(l)return Ot(l,t)},set(s,o,a){if(typeof o=="symbol")return!1;let l=+o;return Number.isNaN(l)?!1:(i(l,Rt(a)),!0)},deleteProperty(s,o){if(typeof o=="symbol")return!1;let a=+o;return Number.isNaN(a)?!1:(r[a]=Rt(void 0),!0)},ownKeys(){return["length",...r.map((s,o)=>o.toString())]}})}function R1(e,r){if("elements"in e)return Qa(e,e.elements,r)}function qD(e,r){if(e.type!=="CallExpression")throw new Tt("Not a function call");function t(i){if(i.type==="Identifier")return i.name;if(i.type==="MemberExpression")return`${t(i.object)}.${t(i.property)}`;throw new Tt("Not implemented")}let n=Qa(e,e.arguments,r);return sr(e,{$type:"function-call",$callee:t(e.callee),$args:n},{})}function L1(e,r){if(e.type!=="ArrowFunctionExpression")throw new Tt("Not an arrow function expression");let t=Qa(e,e.params,r);return sr(e,{$type:"arrow-function-expression",$params:t,$body:Ot(e.body,r)},{})}var B1=Qi;function M1(e,r){if(!("properties"in e))return;let t=s=>{for(let o of e.properties){if("key"in o&&"name"in o.key&&o.key.name===s)return o.value;if(o.type==="ObjectProperty"&&(o.key.type==="StringLiteral"||o.key.type==="NumericLiteral"||o.key.type==="BooleanLiteral")&&o.key.value.toString()===s)return o.value.value??o.value}},n=(s,o=!1)=>{if("key"in s&&"name"in s.key)return s.key.name;if(s.type==="ObjectProperty"&&(s.key.type==="StringLiteral"||s.key.type==="NumericLiteral"||s.key.type==="BooleanLiteral"))return s.key.value.toString();if(o)throw new Tt(`Casting "${s.type}" is not supported`,{ast:s,code:r?.$code})},i=(s,o)=>{let a=e.properties.find(l=>n(l)===s);a?a.value=o:N1(s)?e.properties.push({type:"Property",key:{type:"Identifier",name:s},value:o}):e.properties.push({type:"ObjectProperty",key:B1.stringLiteral(s),value:o})};return sr(e,{$type:"object",toJSON(){return e.properties.reduce((s,o)=>("key"in o&&"name"in o.key&&(s[o.key.name]=Ot(o.value,r)),s),{})}},{get(s,o){let a=t(o);if(a)return Ot(a,r)},set(s,o,a){return typeof o!="string"&&(o=String(o)),i(o,Rt(a)),!0},deleteProperty(s,o){typeof o!="string"&&(o=String(o));let a=e.properties.findIndex(l=>"key"in l&&"name"in l.key&&l.key.name===o);return a!==-1&&e.properties.splice(a,1),!0},ownKeys(){return e.properties.map(s=>n(s,!0)).filter(Boolean)}})}function WD(e,r){if(e.type!=="NewExpression")throw new Tt("Not a new expression");function t(i){if(i.type==="Identifier")return i.name;if(i.type==="MemberExpression")return`${t(i.object)}.${t(i.property)}`;throw new Tt("Not implemented")}let n=Qa(e,e.arguments,r);return sr(e,{$type:"new-expression",$callee:t(e.callee),$args:n},{})}function $1(e){if(e.type!=="Identifier")throw new Tt("Not an identifier");return sr(e,{$type:"identifier",$name:e.name},{})}function U1(e){if(e.type!=="LogicalExpression")throw new Tt("Not a logical expression");return sr(e,{$type:"logicalExpression"},{})}function j1(e){if(e.type!=="MemberExpression")throw new Tt("Not a member expression");return sr(e,{$type:"memberExpression"},{})}var Qc=new WeakMap;function Ot(e,r){if(zD.has(typeof e))return e;if(I1.has(e.type))return e.value;if(Qc.has(e))return Qc.get(e);let t;switch(e.type){case"ObjectExpression":{t=M1(e,r);break}case"ArrayExpression":{t=R1(e,r);break}case"CallExpression":{t=qD(e,r);break}case"ArrowFunctionExpression":{t=L1(e,r);break}case"NewExpression":{t=WD(e,r);break}case"Identifier":{t=$1(e);break}case"LogicalExpression":{t=U1(e);break}case"MemberExpression":{t=j1(e);break}case"TSAsExpression":case"TSSatisfiesExpression":{t=Ot(e.expression,r);break}default:throw new Tt(`Casting "${e.type}" is not supported`,{ast:e,code:r?.$code})}return Qc.set(e,t),t}var to=Qi;function K1(e,r){let t=i=>{let s=i==="default"?"ExportDefaultDeclaration":"ExportNamedDeclaration";for(let o of e.body)if(o.type===s){if(i==="default")return o.declaration;if(o.declaration&&"declarations"in o.declaration){let a=o.declaration.declarations[0];if("name"in a.id&&a.id.name===i)return a.init}}},n=(i,s)=>{let o=i==="default"?"ExportDefaultDeclaration":"ExportNamedDeclaration",a=Rt(s);for(let l of e.body)if(l.type===o){if(i==="default"){l.declaration=a;return}if(l.declaration&&"declarations"in l.declaration){let u=l.declaration.declarations[0];if("name"in u.id&&u.id.name===i){u.init=a;return}}}e.body.push(i==="default"?to.exportDefaultDeclaration(a):to.exportNamedDeclaration(to.variableDeclaration("const",[to.variableDeclarator(to.identifier(i),a)])))};return sr(e,{$type:"exports"},{get(i,s){let o=t(s);if(o)return Ot(o,r)},set(i,s,o){return n(s,o),!0},ownKeys(){return e.body.flatMap(i=>i.type==="ExportDefaultDeclaration"?["default"]:i.type==="ExportNamedDeclaration"&&i.declaration&&"declarations"in i.declaration?i.declaration.declarations.map(s=>"name"in s.id?s.id.name:""):[]).filter(Boolean)},deleteProperty(i,s){let o=s==="default"?"ExportDefaultDeclaration":"ExportNamedDeclaration";for(let a=0;a<e.body.length;a++){let l=e.body[a];if(l.type===o){if(s==="default")return e.body.splice(a,1),!0;if(l.declaration&&"declarations"in l.declaration){let u=l.declaration.declarations[0];if("name"in u.id&&u.id.name===s)return e.body.splice(a,1),!0}}}return!1}})}function V1(e,r){let t=e.program;if(t.type!=="Program")throw new Tt(`Cannot proxify ${e.type} as module`);let n={$code:r,$type:"module"},i=sr(t,n,{ownKeys(){return["imports","exports","generate"]}});return n.exports=K1(t,i),n.imports=O1(t),n.generate=s=>fp(i,s),i}function GD(e,r={}){let t={wrapColumn:r.wrapColumn===void 0,indent:r.tabWidth===void 0||r.useTabs===void 0,quote:r.quote===void 0,arrowParens:r.arrowParensAlways===void 0,trailingComma:r.trailingComma===void 0},n=2,i=0,s=0,o=0,a=0,l=/(?<doubleQuote>"[^"]+")|(?<singleQuote>'[^']+')|(?<singleParam>\([^),]+\)\s*=>)|(?<trailingComma>,\s*[\]}])/g,u={doubleQuote:0,singleQuote:0,singleParam:0,trailingComma:0},c=(e||"").split(`
|
|
1087
|
-
`),p=!1;for(let d of c){let f=d.trim();if(f.length!==0){if(t.wrapColumn&&d.length>o&&(o=d.length),t.indent){let m=d.match(/^\s+/)?.[0]||"";m.length>0&&(m.length>0&&m.length<n&&(n=m.length),m[0]===" "?i++:m.length>0&&i--)}if(f.at(-1)===";"?s++:f.length>0&&s--,t.quote||t.arrowParens){let m=f.matchAll(l);for(let h of m)if(h.groups)for(let g in u)h.groups[g]&&u[g]++}t.trailingComma&&((d.startsWith("}")||d.startsWith("]"))&&(p?a++:a--),p=f.endsWith(","))}}return{wrapColumn:o,useTabs:i>0,tabWidth:n,quote:u.singleQuote>u.doubleQuote?"single":"double",arrowParensAlways:u.singleParam>0,trailingComma:a>0||u.trailingComma>0,useSemi:s>0,arrayBracketSpacing:void 0,objectCurlySpacing:void 0,...r}}function HD(e,r){let t=_D(e,{parser:r?.parser||VD(),...r});return V1(t,e)}function JD(e,r){let t=_D("("+e+")",{parser:r?.parser||VD(),...r}),n=t.program.body[0];n.type==="ExpressionStatement"&&(n=n.expression),n.extra?.parenthesized&&(n.extra.parenthesized=!1);let i={$ast:t,$code:" "+e+" ",$type:"module"};return Ot(n,i)}function fp(e,r={}){let t=e.$ast||e,n=r.format===!1||!("$code"in e)?{}:GD(e.$code,r.format),{code:i,map:s}=T1(t,{...r,...n});return{code:i,map:s}}async function z1(e,r={}){let t=await ja.promises.readFile(e,"utf8");return r.sourceFileName=r.sourceFileName??e,HD(t,r)}async function q1(e,r,t){let n="$ast"in e?e.$ast:e,{code:i,map:s}=fp(n,t);await ja.promises.writeFile(r,i),s&&await ja.promises.writeFile(r+".map",s)}var Ma=Qi,W1={functionCall(e,...r){let t=Ma.callExpression(Ma.identifier(e),r.map(n=>Rt(n)));return qD(t)},newExpression(e,...r){let t=Ma.newExpression(Ma.identifier(e),r.map(n=>Rt(n)));return WD(t)},literal(e){return Rt(e)},raw(e){return JD(e)}};var G1=V(require("@sentry/node"),1);async function ZD(e,r){let t=await(0,ht.readdir)(e,{withFileTypes:!0}),n=[];for(let i of t){let s=Ae.default.join(e,i.name);if(i.isDirectory()){if(!r.has(i.name)){let o=await ZD(s,r);n.push(...o)}}else n.push(s)}return n}async function eb(e){let r=new Set,t=(...u)=>{if(process.env.DEBUG){let c=new Date,p=`${String(c.getMinutes()).padStart(2,"0")}:${String(c.getSeconds()).padStart(2,"0")}.${String(c.getMilliseconds()).padStart(3,"0")}`;console.debug(p,"[builder-dev-tools]",...u)}},n=async u=>{let c=(0,YD.createHash)("md5");return c.update(u),c.digest("hex")},i=Ae.default.normalize(e.cwd),s=Dp(Ae.default.normalize(e.cwd))??i,o=co(Ae.default.normalize(e.cwd))??s,a={...Ae.default,getCwdDir:()=>i,getRepoRootDir:()=>s,getAppRootDir:()=>o,cwd:()=>process.cwd(),exists:async u=>{try{return await(0,ht.access)(u),!0}catch{return!1}},magicast:mp,existsSync:u=>(0,Ye.existsSync)(u),readdir:async(u,c)=>{let p=await(0,ht.readdir)(u);return c?p.map(d=>Ae.default.join(u,d)):p},readdirRecursive:async(u,c)=>ZD(u,new Set(c)),readdirSync:u=>(0,Ye.readdirSync)(u),readFile:async u=>{try{return await(0,ht.readFile)(u,"utf-8")}catch(c){if(c.code==="ENOENT")return null;throw t(c,u),c}},readFileSync(u){try{return(0,Ye.readFileSync)(u,"utf-8")}catch(c){if(c.code==="ENOENT")return null;throw t(c,u),c}},spawnSync:Zi.spawnSync,stat:async u=>await(0,ht.stat)(u),statSync:u=>(0,Ye.statSync)(u),unlinkSync:u=>{(0,Ye.unlinkSync)(u)},unlink:async u=>{await(0,ht.unlink)(u)},writeFile:async(u,c)=>{u=Ae.default.normalize(u);let p={path:u,basename:Ae.default.basename(u),dirname:Ae.default.dirname(u),extname:Ae.default.extname(u)};await(0,ht.mkdir)(Ae.default.dirname(u),{recursive:!0}),await(0,ht.writeFile)(u,c);for(let d of r)await d(p)},hash:n,getDeviceId:()=>n(`${(0,uo.hostname)()}:${(0,uo.homedir)()}`),formatCode:async(u,c)=>{let p=null;try{p=await hp.default.resolveConfig(u)}catch{}try{return hp.default.format(c,{...p,filepath:u})}catch{}return c},on:(u,c)=>{u==="change"&&r.add(c)},off:(u,c)=>{u==="change"&&r.delete(c)},debug:t,launchEditor:async u=>{try{let c=u.filePath;typeof u.line=="number"&&(c+=`:${u.line}`,typeof u.column=="number"&&(c+=`:${u.column}`)),(0,QD.default)(c,"code",(p,d)=>{console.error(`Failed to launch editor for ${p}`),d&&console.error(d)})}catch(c){console.error(`Failed to launch editor for ${String(c.message||c)}`)}},platform:()=>({runtime:"node",os:process.platform}),getRepoInfo:async()=>{let u=Ae.default.normalize(e.cwd);return{remoteUrl:H1(u),defaultBranch:J1(u),commit:Y1(u),currentBranch:X1(u)}},getFrameworks:()=>[],ts:XD.default,Sentry:G1,version:"1.5.
|
|
1087
|
+
`),p=!1;for(let d of c){let f=d.trim();if(f.length!==0){if(t.wrapColumn&&d.length>o&&(o=d.length),t.indent){let m=d.match(/^\s+/)?.[0]||"";m.length>0&&(m.length>0&&m.length<n&&(n=m.length),m[0]===" "?i++:m.length>0&&i--)}if(f.at(-1)===";"?s++:f.length>0&&s--,t.quote||t.arrowParens){let m=f.matchAll(l);for(let h of m)if(h.groups)for(let g in u)h.groups[g]&&u[g]++}t.trailingComma&&((d.startsWith("}")||d.startsWith("]"))&&(p?a++:a--),p=f.endsWith(","))}}return{wrapColumn:o,useTabs:i>0,tabWidth:n,quote:u.singleQuote>u.doubleQuote?"single":"double",arrowParensAlways:u.singleParam>0,trailingComma:a>0||u.trailingComma>0,useSemi:s>0,arrayBracketSpacing:void 0,objectCurlySpacing:void 0,...r}}function HD(e,r){let t=_D(e,{parser:r?.parser||VD(),...r});return V1(t,e)}function JD(e,r){let t=_D("("+e+")",{parser:r?.parser||VD(),...r}),n=t.program.body[0];n.type==="ExpressionStatement"&&(n=n.expression),n.extra?.parenthesized&&(n.extra.parenthesized=!1);let i={$ast:t,$code:" "+e+" ",$type:"module"};return Ot(n,i)}function fp(e,r={}){let t=e.$ast||e,n=r.format===!1||!("$code"in e)?{}:GD(e.$code,r.format),{code:i,map:s}=T1(t,{...r,...n});return{code:i,map:s}}async function z1(e,r={}){let t=await ja.promises.readFile(e,"utf8");return r.sourceFileName=r.sourceFileName??e,HD(t,r)}async function q1(e,r,t){let n="$ast"in e?e.$ast:e,{code:i,map:s}=fp(n,t);await ja.promises.writeFile(r,i),s&&await ja.promises.writeFile(r+".map",s)}var Ma=Qi,W1={functionCall(e,...r){let t=Ma.callExpression(Ma.identifier(e),r.map(n=>Rt(n)));return qD(t)},newExpression(e,...r){let t=Ma.newExpression(Ma.identifier(e),r.map(n=>Rt(n)));return WD(t)},literal(e){return Rt(e)},raw(e){return JD(e)}};var G1=V(require("@sentry/node"),1);async function ZD(e,r){let t=await(0,ht.readdir)(e,{withFileTypes:!0}),n=[];for(let i of t){let s=Ae.default.join(e,i.name);if(i.isDirectory()){if(!r.has(i.name)){let o=await ZD(s,r);n.push(...o)}}else n.push(s)}return n}async function eb(e){let r=new Set,t=(...u)=>{if(process.env.DEBUG){let c=new Date,p=`${String(c.getMinutes()).padStart(2,"0")}:${String(c.getSeconds()).padStart(2,"0")}.${String(c.getMilliseconds()).padStart(3,"0")}`;console.debug(p,"[builder-dev-tools]",...u)}},n=async u=>{let c=(0,YD.createHash)("md5");return c.update(u),c.digest("hex")},i=Ae.default.normalize(e.cwd),s=Dp(Ae.default.normalize(e.cwd))??i,o=co(Ae.default.normalize(e.cwd))??s,a={...Ae.default,getCwdDir:()=>i,getRepoRootDir:()=>s,getAppRootDir:()=>o,cwd:()=>process.cwd(),exists:async u=>{try{return await(0,ht.access)(u),!0}catch{return!1}},magicast:mp,existsSync:u=>(0,Ye.existsSync)(u),readdir:async(u,c)=>{let p=await(0,ht.readdir)(u);return c?p.map(d=>Ae.default.join(u,d)):p},readdirRecursive:async(u,c)=>ZD(u,new Set(c)),readdirSync:u=>(0,Ye.readdirSync)(u),readFile:async u=>{try{return await(0,ht.readFile)(u,"utf-8")}catch(c){if(c.code==="ENOENT")return null;throw t(c,u),c}},readFileSync(u){try{return(0,Ye.readFileSync)(u,"utf-8")}catch(c){if(c.code==="ENOENT")return null;throw t(c,u),c}},spawnSync:Zi.spawnSync,stat:async u=>await(0,ht.stat)(u),statSync:u=>(0,Ye.statSync)(u),unlinkSync:u=>{(0,Ye.unlinkSync)(u)},unlink:async u=>{await(0,ht.unlink)(u)},writeFile:async(u,c)=>{u=Ae.default.normalize(u);let p={path:u,basename:Ae.default.basename(u),dirname:Ae.default.dirname(u),extname:Ae.default.extname(u)};await(0,ht.mkdir)(Ae.default.dirname(u),{recursive:!0}),await(0,ht.writeFile)(u,c);for(let d of r)await d(p)},hash:n,getDeviceId:()=>n(`${(0,uo.hostname)()}:${(0,uo.homedir)()}`),formatCode:async(u,c)=>{let p=null;try{p=await hp.default.resolveConfig(u)}catch{}try{return hp.default.format(c,{...p,filepath:u})}catch{}return c},on:(u,c)=>{u==="change"&&r.add(c)},off:(u,c)=>{u==="change"&&r.delete(c)},debug:t,launchEditor:async u=>{try{let c=u.filePath;typeof u.line=="number"&&(c+=`:${u.line}`,typeof u.column=="number"&&(c+=`:${u.column}`)),(0,QD.default)(c,"code",(p,d)=>{console.error(`Failed to launch editor for ${p}`),d&&console.error(d)})}catch(c){console.error(`Failed to launch editor for ${String(c.message||c)}`)}},platform:()=>({runtime:"node",os:process.platform}),getRepoInfo:async()=>{let u=Ae.default.normalize(e.cwd);return{remoteUrl:H1(u),defaultBranch:J1(u),commit:Y1(u),currentBranch:X1(u)}},getFrameworks:()=>[],ts:XD.default,Sentry:G1,version:"1.5.14",sdkVersion:null,ignoreMissingConfig:e.ignoreMissingConfig,kind:null},l=await jn(a);return a.getFrameworks=()=>l,a}function tb(){let e=(0,uo.homedir)();return Ae.default.join(e,".config","builder","dev-tools.json")}function gp(e,r){return typeof e=="object"&&e!=null&&r in e}async function es(){let e=tb();try{let r=await(0,ht.readFile)(e,"utf-8");if(typeof r=="string")return JSON.parse(r)}catch(r){if(r.code==="ENOENT")return null}return null}async function yp(e){let r=tb();e=typeof e=="object"&&e!=null?e:{},await(0,ht.mkdir)(Ae.default.dirname(r),{recursive:!0}),await(0,ht.writeFile)(r,JSON.stringify(e??{},null,2))}function H1(e){try{return((0,Zi.spawnSync)("git",["config","--get","remote.origin.url"],{cwd:e}).stdout||"").toString().trim()}catch(r){return console.error("Error getting git remote URL:",r),""}}function J1(e){let r="master";try{let t=(0,Zi.spawnSync)("git",["branch","-r"],{cwd:e});return t.stdout&&t.stdout.toString().trim().split(`
|
|
1088
1088
|
`).map(i=>i.trim()).includes("origin/main")?"main":r}catch(t){return console.error("Error getting git default branch name:",t.toString().split(`
|
|
1089
1089
|
`)[0]),r}}function Y1(e){try{return((0,Zi.spawnSync)("git",["rev-parse","HEAD"],{cwd:e}).stdout||"").toString().trim()}catch(r){return console.error("Error getting git commit:",r),""}}function X1(e){try{return((0,Zi.spawnSync)("git",["branch","--show-current"],{cwd:e}).stdout||"").toString().trim()}catch(r){return console.error("Error getting current branch name:",r),""}}function Dp(e){let r=Ae.default.resolve("/");for(let t=0;t<20;t++){let n=Ae.default.join(e,"package.json");if((0,Ye.existsSync)(n))return e;if(e===r)break;e=Ae.default.dirname(e)}return null}function co(e){let r=Ae.default.resolve("/");for(let t=0;t<20;t++){if((0,Ye.existsSync)(Ae.default.join(e,"package.json"))||(0,Ye.existsSync)(Ae.default.join(e,"remix.config.js"))||(0,Ye.existsSync)(Ae.default.join(e,"remix.config.mjs"))||(0,Ye.existsSync)(Ae.default.join(e,"remix.config.ts"))||(0,Ye.existsSync)(Ae.default.join(e,"vite.config.js"))||(0,Ye.existsSync)(Ae.default.join(e,"vite.config.ts"))||(0,Ye.existsSync)(Ae.default.join(e,"vite.config.mjs"))||(0,Ye.existsSync)(Ae.default.join(e,"next.config.js"))||(0,Ye.existsSync)(Ae.default.join(e,"next.config.ts"))||(0,Ye.existsSync)(Ae.default.join(e,"angular.json"))||(0,Ye.existsSync)(Ae.default.join(e,"project.json"))||(0,Ye.existsSync)(Ae.default.join(e,"tsconfig.json")))return e;if(e===r)break;e=Ae.default.dirname(e)}return null}var rb=V(require("crypto")),el=new Uint8Array(256),Za=el.length;function bp(){return Za>el.length-16&&(rb.default.randomFillSync(el),Za=0),el.slice(Za,Za+=16)}var xt=[];for(let e=0;e<256;++e)xt.push((e+256).toString(16).slice(1));function nb(e,r=0){return xt[e[r+0]]+xt[e[r+1]]+xt[e[r+2]]+xt[e[r+3]]+"-"+xt[e[r+4]]+xt[e[r+5]]+"-"+xt[e[r+6]]+xt[e[r+7]]+"-"+xt[e[r+8]]+xt[e[r+9]]+"-"+xt[e[r+10]]+xt[e[r+11]]+xt[e[r+12]]+xt[e[r+13]]+xt[e[r+14]]+xt[e[r+15]]}var ib=V(require("crypto")),xp={randomUUID:ib.default.randomUUID};function Q1(e,r,t){if(xp.randomUUID&&!r&&!e)return xp.randomUUID();e=e||{};let n=e.random||(e.rng||bp)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,r){t=t||0;for(let i=0;i<16;++i)r[t+i]=n[i];return r}return nb(n)}var Ep=Q1;var Sp=V(require("os"),1);async function sb(){let e=!0==="true"&&process.env.NODE_ENV!=="test",r=await lb(),t=await ab();Mr.init(e?"2532be1b0436a18cb938b21fc7fa9faf":"",{logLevel:Mr.Types.LogLevel.None,flushIntervalMillis:500});let n=new Mr.Identify;await Mr.identify(n,{device_id:r,user_id:t,platform:Sp.default.type(),os_name:process.platform,os_version:Sp.default.release()}).promise,_n.init({dsn:"https://3252dddc08dbb5bf406dc33bf3c13633@o117565.ingest.us.sentry.io/4505630794448896",tracesSampleRate:1,release:Jg,environment:process.env.NODE_ENV,enabled:e,integrations:[new _n.Integrations.Http({tracing:!0}),..._n.autoDiscoverNodePerformanceMonitoringIntegrations()]}),_n.setUser({username:process.env.USER||process.env.USERNAME||"unknown"})}async function We(e,r,t){let n={...r,app:"dev-tools-cli",package:"cli"};return Mr.track(e,n,{...t,user_id:await ab(),device_id:await lb()})}var tl,Cp;async function ob(e){tl=e;let r=await es();await yp({...r,userId:e})}async function ab(){if(tl)return tl;let e=await es(),r;return gp(e,"userId")&&(r=e.userId),tl=r,r}async function lb(){if(Cp)return Cp;let e=await es(),r=Ep();return gp(e,"deviceId")?r=e.deviceId:await yp({...e,deviceId:r}),Cp=r,r}var ub=V(Ze(),1),cb=require("undici");var pb=V(Ze(),1),nt=async(e,r)=>{let t="fetch"in globalThis?globalThis.fetch:cb.fetch;try{let n=await t(e,r);if(!n.ok)if(n.status===429){let i=await n.json(),s=i.severity??"high",o=i.message??"Rate limit exceeded. Please try again later.";return console.log(),s==="high"?n.error((0,ub.red)(`${n.status} ${o}
|
|
1090
1090
|
|
|
1091
1091
|
`)):n.warn((0,pb.yellow)(`${n.status} ${o}
|
|
1092
1092
|
|
|
1093
1093
|
`)),await ee(1)}else throw new Error(`Failed to generate completion:
|
|
1094
|
-
`+await n.text());return n}catch(n){let i=typeof e=="string"?e:e instanceof URL?e.toString():e.url,s=r?.method||"GET",o=n instanceof Error?n.message:String(n),a=new Error(`Fetch failed for ${s} ${i}: ${o}`);throw n instanceof Error&&(a.cause=n),a.requestContext={url:i,method:s,headers:r?.headers},a}};var gt=process.env.OVERRIDE_VERSION??"1.5.
|
|
1095
|
-
`+await o.text());let a=await o.json();if(!Array.isArray(a.figmaComponents))throw new Error("Invalid response from Figma API");return a.figmaComponents.map(l=>["",l])}function bb(e){return e.some(r=>!!Ap(r))}async function xb(e,r,t){return(await Promise.all(t.map(async i=>{let s,o;if(i.match(rI))try{let c=await wp({...r,docId:i});if(c)return[[i,c]];if(e){let p;try{p=await gb(`components/${i}`,{auth:e}),s=p.meta.file_key,o=p.meta.node_id}catch{K.warning("Failed to fetch component from Figma API.")}}}catch(c){throw mb.captureException(c),c}if(!s||!o){let c=Ap(i);if(!c)return
|
|
1094
|
+
`+await n.text());return n}catch(n){let i=typeof e=="string"?e:e instanceof URL?e.toString():e.url,s=r?.method||"GET",o=n instanceof Error?n.message:String(n),a=new Error(`Fetch failed for ${s} ${i}: ${o}`);throw n instanceof Error&&(a.cause=n),a.requestContext={url:i,method:s,headers:r?.headers},a}};var gt=process.env.OVERRIDE_VERSION??"1.5.14";var rl=V(require("@sentry/node"),1);var Z1="https://cdn.builder.io";async function wp(e){try{let r=await nt(`${Z1}/api/internal/kv/${e.spaceId}/${e.docId}?apiKey=${e.spaceId}`,{headers:{Authorization:`Bearer ${e.privateKey}`}});if(r.status===404)return rl.captureMessage("getBuilderSpaceKv 404"),console.warn("GET 404",r.url),null;if(!r.ok)throw new Error(`HTTP ${r.status} ${r.statusText}`);return r.json()}catch(r){rl.captureException(r),console.error("GET failed",r);return}}var mb=V(require("@sentry/node"),1);var hb=/[^\x00-\x7F]/g,Ap=e=>{try{let r=new URL(e);if(!e.startsWith("https://www.figma.com/design/"))return null;let t=r.searchParams.get("node-id")?.replaceAll("-",":"),n=r.pathname.split("/")[2];return t&&n?{fileID:n,nodeId:t}:null}catch{return null}},eI="https://api.figma.com/v1/",gb=async(e,{auth:r,params:t})=>{let n=new URL(`${eI}${e}`),i={};if(r.oauth?i.Authorization=`Bearer ${r.access_token}`:i["X-FIGMA-TOKEN"]=r.access_token,t)for(let o in t)t[o]!=null&&n.searchParams.set(o,t[o].toString());let s=await nt(n,{headers:i});if(!s.ok)throw new Error(`Figma REST ${s.statusText}: ${await s.text()}`);return s.json()},yb=async(e,r,t,n)=>(await gb(`files/${r}/nodes`,{auth:e,params:{ids:t,depth:n}})).nodes;function oi(e){return e=e.replace(hb,""),e=e.replace(/[\W\d]/g," "),e=e.trim(),e=tI(e),e=e.charAt(0).toUpperCase()+e.slice(1),e}function tI(e){return e.replace(/(?:^\w|[A-Z]|\b\w)/g,function(r,t){return t===0?r.toLowerCase():r.toUpperCase()}).replace(/\s+/g,"")}var rI=/^[a-f0-9]{40}$/;async function Db(e,r,t){let n=JSON.stringify({token:r}),i=new URL(`${fr}/mappings/figma-components/get`);e.builderPublicKey&&i.searchParams.set("apiKey",e.builderPublicKey),e.userId&&i.searchParams.set("userId",e.userId),t&&console.log("FETCH",i,n);let s={"Content-Type":"application/json"};e.builderPrivateKey&&(s.Authorization=`Bearer ${e.builderPrivateKey}`);let o=await nt(i,{method:"POST",body:n,headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.builderPrivateKey}`}});if(!o.ok)throw new Error(`Failed to generate completion:
|
|
1095
|
+
`+await o.text());let a=await o.json();if(!Array.isArray(a.figmaComponents))throw new Error("Invalid response from Figma API");return a.figmaComponents.map(l=>["",l])}function bb(e){return e.some(r=>!!Ap(r))}async function xb(e,r,t){return(await Promise.all(t.map(async i=>{let s,o;if(i.match(rI))try{let c=await wp({...r,docId:i});if(c)return[[i,c]];if(e){let p;try{p=await gb(`components/${i}`,{auth:e}),s=p.meta.file_key,o=p.meta.node_id}catch{K.warning("Failed to fetch component from Figma API.")}}}catch(c){throw mb.captureException(c),c}if(!s||!o){let c=Ap(i);if(!c)return he(`Invalid Figma URL, use Cmd+L while selecting a figma component to get a link to selection.
|
|
1096
1096
|
Or make sure the command is copied correctly from the Figma plugin and the same builder space is being used.`),await ee(1);c&&({fileID:s,nodeId:o}=c)}if(!e)return[];let a=await yb(e,s,o),l=Eb(a[o].document,a[o].components);if(l){let c=(await Promise.all(Array.from(l).map(async([,p])=>await wp({...r,docId:p.key})))).filter(fb);if(c.length)return c.map(p=>[i,p])}let u=await nI(a[o],o);return u?[[i,u]]:[]}))).flat().filter(fb)}function Eb(e,r,t=new Map){debugger;if(e.componentId&&t.set(e.componentId,r[e.componentId]),e.children)for(let n of e.children)Eb(n,r,t);return t}async function nI(e,r){let t=e.document;if(t.type!=="COMPONENT"&&t.type!=="COMPONENT_SET"){let i=`Seems like the pasted URL points to a ${t.type} node, not a COMPONENT or COMPONENT_SET.`;return t.type==="INSTANCE"&&(i+=`
|
|
1097
|
-
Double click and select "Go to main component", then copy the URL to the figma COMPONENT`),
|
|
1097
|
+
Double click and select "Go to main component", then copy the URL to the figma COMPONENT`),he(i),await ee(1)}let n=e.components[r]?.key??e.componentSets[r]?.key;return n?(e.document.key=n,iI(r,t)):(he("Pasted URL does not correspond to a component or component set"),await ee(1))}function iI(e,r){let{inputs:t,nameMap:n}=sI(r);return{name:r.name,jsx:r.type==="COMPONENT_SET"?Tp(r.children[0],n,0,0):Tp(r,n,0,0),inputs:t,key:r.key,description:r.description,documentationLinks:[],instanceId:e.includes(":")?e:r.id,documentName:"",tree:""}}var Tp=(e,r,t,n,i=-1)=>{let s=" ".repeat(Math.max(i+1,0)),o="",a=e.type,l=a==="GROUP"||a==="FRAME"||i<0&&"children"in e,u="",c=i>=0;if(c){let p="";if(e.type==="INSTANCE"){if(e.componentPropertyReferences&&e.componentPropertyReferences.mainComponent)return o+=`${s}{figma["${r(e.componentPropertyReferences.mainComponent)}"]}
|
|
1098
1098
|
`,o;u=e.type}u===""&&(u=e.type),(e.type!=="TEXT"||!e.autoRename)&&(p+=` name="${e.name}"`),e.componentPropertyReferences&&e.componentPropertyReferences.visible&&(p+=` visible={figma["${r(e.componentPropertyReferences.visible)}"]}`),o+=`${s}<${u}${p}`}if(e.type==="TEXT")c&&(o+=`>
|
|
1099
1099
|
`),e.componentPropertyReferences&&e.componentPropertyReferences.characters?o+=`${s} {figma["${r(e.componentPropertyReferences.characters)}"]}
|
|
1100
1100
|
`:o+=`${s} ${e.characters}
|
|
@@ -1127,7 +1127,7 @@ Visit https://www.docs.developers.amplitude.com/data/sdks/browser-2/#tracking-de
|
|
|
1127
1127
|
<h3>How's Devtools working for you?</h3>
|
|
1128
1128
|
<p>We'd love your feedback!</p>
|
|
1129
1129
|
</div>
|
|
1130
|
-
\`,t.appendChild(e),setTimeout(()=>{e.classList.add("menu-toggle-tooltip-show"),e.addEventListener("click",()=>{e.classList.remove("menu-toggle-tooltip-show")})},1e3)};function Br(t){t.getElementById("go-to-builder").addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),ue(t,!1),window.open(mn(),"builder")}),t.getElementById("components-link").addEventListener("click",s=>{s.preventDefault(),s.stopPropagation();let u=t.querySelector(".nav-cmp-list .section-content");u.scrollTop=0,W(t,"nav-cmp-list"),Mr(t)}),t.getElementById("settings-link").addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),W(t,"nav-settings")}),t.getElementById("add-page-link").addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),ue(t,!1),window.open(Ee(),"builder")}),t.getElementById("import-from-figma").addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),ue(t,!1),window.open("https://www.figma.com/community/plugin/747985167520967365/builder-io-ai-powered-figma-to-code-react-vue-tailwind-more")})}function Fr(t){let e=t.getElementById("enable-edit");e.addEventListener("change",n=>{n.stopPropagation(),bt(e.checked)}),e.checked=ke(),bt(e.checked)}var lt=class extends HTMLElement{constructor(){super()}connectedCallback(){let e=this.attachShadow({mode:"open"});e.innerHTML=\`<style>*,*:before,*:after{box-sizing:border-box}:host{--background-color: rgba(40, 40, 40, 1);--primary-color: rgba(72, 161, 255, 1);--primary-color-subdued: rgb(72, 161, 255, .6);--primary-color-highlight: rgb(126, 188, 255);--primary-contrast-color: white;--edit-color: #1d74e2;--edit-color-highlight: #1c6bd1;--edit-color-alpha: rgb(72, 161, 255, .15);--error-color: #ff2b55;--text-color: white;--text-color-highlight: white;--border-color: #454545;--button-background-color-hover: rgba(255, 255, 255, .1);--menu-width: 320px;--transition-time: .15s;--font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";font-family:var(--font-family);line-height:1.6}button{cursor:pointer;color:var(--text-color);-webkit-tap-highlight-color:transparent}input,select,button{font-family:var(--font-family)}.menu-toggle{position:absolute;right:0;bottom:0;pointer-events:auto;padding:8px;background:transparent;border:none;appearance:none}.menu-toggle div{position:relative;width:64px;height:64px;pointer-events:none;border-radius:50%;background:#000;border:1px solid white;box-shadow:#00000054 0 0 8px}.menu-toggle:hover div{background-color:var(--background-color);border:1px solid rgb(220,220,220)}.menu-toggle svg{position:absolute;top:15px;left:15px;width:33px;height:32px}div.highlight-bg{position:absolute;top:-1px;left:-1px;background-color:#1a1a1a;pointer-events:none;transition:all .4s ease-out;opacity:0}.menu-toggle-highlight-no-transition div.highlight-bg{transition:none}.menu-toggle-highlight div.highlight-bg{opacity:1}.menu-toggle-tooltip{position:absolute;bottom:0;right:0;width:382px;height:72px;padding:0;text-align:left;appearance:none;background-color:transparent;border:none;pointer-events:none;transform:translate3d(320px,0,0);opacity:0;transition:all .15s ease-in-out;color:#fff}.menu-toggle-tooltip.menu-toggle-tooltip-show{pointer-events:auto;opacity:1;transform:translateZ(0)}.menu-toggle-tooltip-content{position:absolute;inset:0 95px 10px 0;padding:8px 12px;background-color:var(--primary-color);box-shadow:#00000054 0 0 20px;border-radius:2px}.menu-toggle-tooltip-content:before{content:"";position:absolute;bottom:15px;right:-6px;width:30px;height:30px;background-color:var(--primary-color);transform:rotate(45deg)}.menu-toggle-tooltip:hover .menu-toggle-tooltip-content,.menu-toggle-tooltip:hover .menu-toggle-tooltip-content:before{background-color:var(--primary-color-highlight)}.menu-toggle-tooltip-content h3{margin:0;font-size:16px}.menu-toggle-tooltip-content p{margin:0;font-size:12px}section{position:absolute;display:grid;grid-template-rows:64px auto 64px;top:0;left:0;width:100%;height:100%;padding:0;pointer-events:none}.section-content{margin:0;padding:0 0 10px;font-weight:300;transform:translate3d(105%,0,0);transition:transform var(--transition-time) ease-in-out;overflow-y:auto}.section-content .error{color:var(--error-color);font-weight:700}section a{text-decoration:none;color:var(--text-color)}section h3,section p{margin-left:16px;margin-right:16px}.info{font-size:12px}ul.list{list-style:none;padding:0;margin:0}ul.list li{display:block;padding:0;margin:0}ul.list a,ul.list button{display:grid;grid-template-columns:24px auto;grid-gap:16px;padding:12px;margin:8px 0;border:none;background:transparent;appearance:none;width:100%;font-weight:300;text-align:left;text-decoration:none;color:var(--text-color)}ul.list a:hover,ul.list button:hover{text-decoration:none;color:var(--text-color);background-color:var(--button-background-color-hover)}ul.list a span,ul.list button span{display:block;font-size:16px;font-weight:500;line-height:1.5;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}header{position:relative;display:grid;grid-template-columns:44px 1fr;gap:8px;padding-left:8px;border-bottom:1px solid var(--border-color);transition:opacity var(--transition-time) ease-in-out;opacity:0;pointer-events:none}header>div{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.nav-home header>div{margin-right:56px}header h2{margin:7px 0 0;font-size:18px;font-weight:500;line-height:1.5;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}header p{margin:2px 0 0;font-size:12px;font-weight:300;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}header p button{display:block;margin:0;padding:0;width:100%;font-size:12px;font-weight:300;text-decoration:none;appearance:none;text-align:left;background-color:transparent;border:none;color:var(--primary-color);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}header p button:hover{text-decoration:underline;color:var(--primary-color)}.builder-logo{margin:12px 0 0 8px}#close{display:block;position:absolute;appearance:none;background:transparent;border:none;border-radius:50%;margin:0;padding:0;right:4px;top:8px;width:48px;height:48px;z-index:1;opacity:.7}#close:hover{opacity:1;background-color:var(--button-background-color-hover)}#close svg{position:absolute;top:12px;left:12px;width:24px;height:24px;fill:currentColor;pointer-events:none}.back-button{position:relative;display:block;margin:7px 0 0 -2px;width:48px;height:48px;background:transparent;border:none;appearance:none;border-radius:50%}.back-button:hover{background-color:var(--button-background-color-hover)}.back-button svg{position:absolute;top:12px;left:12px;width:24px;height:24px;fill:currentColor;pointer-events:none}footer{border-top:1px solid var(--border-color);transition:opacity var(--transition-time) ease-in-out;opacity:0;pointer-events:none}section.nav-cmp-list{grid-template-rows:64px auto 120px}footer a{text-decoration:underline;color:var(--primary-color)}footer a:hover{color:var(--primary-color);text-decoration:none}.nav-list{padding:2px 0}.nav-loading{pointer-events:none}.nav-loading-icon{position:absolute;display:inline-block;top:170px;left:0;width:100%;transform:translateZ(0);pointer-events:auto;opacity:0;transition:all 50ms ease-in-out;transition-delay:50ms;pointer-events:none}.nav-loading .nav-loading-icon{opacity:.5}.nav-list h4{margin:8px 8px 8px 10px;font-size:14px;font-weight:600}.nav-list .nav-list-item+h4{margin-top:30px}.nav-list-item{display:grid;grid-template-columns:1fr 1fr;gap:8px;position:relative;margin:2px 0;padding:8px 28px 8px 46px;width:100%;font-size:14px;font-weight:300;text-align:left;border:none;background:transparent;appearance:none}.nav-list-item:hover{background-color:var(--button-background-color-hover)}.nav-list-item-icon{position:absolute;top:4px;left:10px;width:24px;height:24px;object-fit:contain;filter:invert(100%);background-size:24px 24px;background-repeat:no-repeat;background-position:center center}.nav-list-item span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;pointer-events:none}.nav-list-item:after{display:block;position:absolute;content:"";background-image:url('data:image/svg+xml,<svg width="8" height="14" viewBox="0 0 8 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 1L7 7L1 13" stroke="%23F2F2F2" stroke-opacity="0.5" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/></svg>');background-repeat:no-repeat;background-position:12px 9px;top:0;right:0;width:32px;height:32px;pointer-events:none}.nav-list-item-note{opacity:0;font-size:12px;padding-top:1px;text-align:right}.nav-list-item:hover .nav-list-item-note{opacity:.5}.ui-select{display:block;margin:8px 0 16px;padding:8px 16px;cursor:pointer}.ui-select h3{margin:0;font-size:14px;font-weight:500}.ui-select p{margin:8px 0;font-size:12px;font-weight:300}.ui-select .select{position:relative;margin:8px 0;border-radius:4px;padding:0;line-height:1.1;overflow:hidden;border:1px solid var(--border-color)}.ui-select select{appearance:none;background-color:transparent;border:none;outline:none;padding:8px 32px 8px 8px;margin:0;width:100%;font-size:14px;cursor:pointer;text-overflow:ellipsis;opacity:.6;color:var(--text-color)}.ui-select .select:after{content:"";top:6px;right:5px;width:24px;height:24px;position:absolute;background-image:url('data:image/svg+xml,<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill="%23F2F2F2" d="M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"/></svg>');background-repeat:no-repeat;background-position:center;pointer-events:none;opacity:.6}.ui-select .select:hover{border-color:var(--primary-color-subdued)}.ui-text-input .select:focus-within{border-color:var(--primary-color)}.ui-text-input .select:focus-within select{opacity:1}.spinner:after{content:" ";display:block;width:32px;height:32px;margin:0 auto;pointer-events:auto;border-radius:50%;border:3px solid var(--text-color);border-color:var(--text-color) transparent var(--text-color) transparent;animation:spinner .75s linear infinite}@keyframes spinner{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.ui-switch{display:grid;grid-template-columns:auto 48px;grid-gap:20px;margin:8px 0 16px;padding:8px 0 8px 16px;cursor:pointer}.ui-switch>*{pointer-events:none}.ui-switch input{display:none;visibility:hidden}.ui-switch .switcher{display:inline-block;border-radius:100px;width:35px;height:14px;background-color:#ccc;position:relative;top:6px;vertical-align:middle;cursor:pointer}.ui-switch input[type=checkbox]:checked+.switcher{background-color:var(--primary-color-subdued)}.ui-switch .switcher:before{content:"";display:block;width:20px;height:20px;background-color:var(--text-color);box-shadow:0 1px 3px #0009;border-radius:50%;position:absolute;top:-3px;left:0;margin-right:0;transition:all .15s}.ui-switch input[type=checkbox]:checked+.switcher:before{left:100%;margin-left:-20px;background-color:var(--primary-color)}.ui-switch h3{margin:0;font-size:14px;font-weight:500}.ui-switch p{margin:4px 0 0;font-size:12px;font-weight:300}.ui-text-input{display:block;margin:8px 0 16px;padding:8px 16px;cursor:pointer}.ui-text-input h3{margin:0;font-size:14px;font-weight:500}.ui-text-input p{margin:8px 0;font-size:12px;font-weight:300}.ui-text-input .input{position:relative;margin:8px 0;border:1px solid var(--border-color);border-radius:4px;background:transparent;padding:2px;overflow:hidden}.ui-text-input input{display:block;width:235px;font-size:14px;border:none;background:transparent;padding:6px;appearance:none;color:var(--text-color);opacity:.6;outline:none}.ui-text-input .input:hover{border-color:var(--primary-color-subdued)}.ui-text-input .input:focus-within{border-color:var(--primary-color)}.ui-text-input .input:focus-within input{opacity:1}.ui-text-input .input:after{content:"";position:absolute;top:5px;right:14px;width:8px;height:17px;border:2px solid rgba(51,181,51,1);border-top:none;border-left:none;transform:rotate(45deg);opacity:0;transition:opacity 80ms ease-in-out;pointer-events:none}.ui-text-input.saved .input:after{opacity:1}.ui-toast{position:fixed;bottom:8px;left:8px;right:8px;padding:6px 12px;font-size:14px;border-radius:4px;transform:translate3d(0,150%,0);opacity:0;transition:all var(--transition-time) ease-in-out;background-color:var(--primary-color-subdued);color:var(--text-color);pointer-events:none}.ui-toast.ui-toast-show{transform:translateZ(0);opacity:1;pointer-events:auto}[data-view=nav-home] .nav-home .section-content,[data-view=nav-cmp-list] .nav-cmp-list .section-content,[data-view=nav-cmp-detail] .nav-cmp-detail .section-content,[data-view=nav-cmp-input] .nav-cmp-input .section-content,[data-view=nav-settings] .nav-settings .section-content{transform:translateZ(0);pointer-events:auto}[data-view=nav-home] .nav-home header,[data-view=nav-home] .nav-home footer,[data-view=nav-cmp-list] .nav-cmp-list header,[data-view=nav-cmp-list] .nav-cmp-list footer,[data-view=nav-cmp-detail] .nav-cmp-detail header,[data-view=nav-cmp-detail] .nav-cmp-detail footer,[data-view=nav-cmp-input] .nav-cmp-input header,[data-view=nav-cmp-input] .nav-cmp-input footer,[data-view=nav-settings] .nav-settings header,[data-view=nav-settings] .nav-settings footer{opacity:1;pointer-events:auto}[data-view=nav-cmp-list] .nav-home .section-content,[data-view=nav-cmp-detail] .nav-home .section-content,[data-view=nav-cmp-detail] .nav-cmp-list .section-content,[data-view=nav-cmp-input] .nav-home .section-content,[data-view=nav-cmp-input] .nav-cmp-list .section-content,[data-view=nav-cmp-input] .nav-cmp-detail .section-content,[data-view=nav-settings] .nav-home .section-content{transform:translate3d(-105%,0,0)}.cmp-item .nav-list-item-icon{background-image:url('data:image/svg+xml,<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M20.83 16.809C20.94 16.561 21 16.289 21 16.008V7.99001C20.9994 7.64108 20.9066 7.29851 20.731 6.99699C20.5554 6.69547 20.3032 6.44571 20 6.27301L13 2.26501C12.6954 2.09103 12.3508 1.99951 12 1.99951C11.6492 1.99951 11.3046 2.09103 11 2.26501L7.988 3.99001M5.441 5.44801L4 6.27301C3.381 6.62801 3 7.28301 3 7.99101V16.009C3 16.718 3.381 17.372 4 17.726L11 21.734C11.3046 21.908 11.6492 21.9995 12 21.9995C12.3508 21.9995 12.6954 21.908 13 21.734L18.544 18.56" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/><path d="M12 22V12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/><path d="M14.532 10.538L20.73 6.95996" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/><path d="M3.27002 6.95996L12 12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/><path d="M3 3L21 21" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/></svg>');opacity:.3}.cmp-item.registered .nav-list-item-icon{background-image:url('data:image/svg+xml,<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M21 16.008V7.99001C20.9994 7.64108 20.9066 7.29851 20.731 6.99699C20.5554 6.69547 20.3032 6.44571 20 6.27301L13 2.26501C12.6954 2.09103 12.3508 1.99951 12 1.99951C11.6492 1.99951 11.3046 2.09103 11 2.26501L4 6.27301C3.381 6.62801 3 7.28301 3 7.99101V16.009C3 16.718 3.381 17.372 4 17.726L11 21.734C11.3046 21.908 11.6492 21.9995 12 21.9995C12.3508 21.9995 12.6954 21.908 13 21.734L20 17.726C20.619 17.371 21 16.716 21 16.008Z" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M12 22V12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M12 12L20.73 6.95996" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M3.26999 6.95996L12 12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /></svg>');opacity:.8}.search-highlight{background-color:var(--primary-color-alpha);padding:0 2px;border-radius:2px;font-weight:500}.search-container{position:sticky;top:0;z-index:10;padding:12px 16px;background:var(--background-color);border-bottom:1px solid var(--border-color)}.search-input-wrapper{position:relative;display:flex;align-items:center}.search-icon{position:absolute;left:12px;color:var(--text-color-secondary);pointer-events:none}.component-search-input{width:100%;height:36px;padding:8px 36px;border:1px solid var(--border-color);border-radius:6px;background:var(--input-background);color:var(--text-color);font-size:14px;transition:border-color .2s,box-shadow .2s}.component-search-input:focus{outline:none;border-color:var(--primary-color);box-shadow:0 0 0 2px var(--primary-color-alpha)}.component-search-input::placeholder{color:var(--text-color-tertiary)}.clear-search-button{position:absolute;right:8px;padding:4px;color:var(--text-color-secondary);border:none;background:transparent;border-radius:4px;cursor:pointer;opacity:0;transition:opacity .2s,background-color .2s;display:flex;align-items:center;justify-content:center}.clear-search-button:hover{background-color:var(--hover-color)}.component-search-input:not(:placeholder-shown)+.clear-search-button{opacity:1}.no-results{padding:32px 16px;text-align:center;color:var(--text-color-secondary);font-size:14px}#cmp-detail{position:relative}.cmp-loading{pointer-events:none!important}.cmp-loading-icon{position:absolute;display:inline-block;top:170px;left:0;width:100%;transform:translateZ(0);pointer-events:auto;opacity:0;transition:all 50ms ease-in-out;transition-delay:50ms;pointer-events:none}.cmp-loading .cmp-loading-icon{opacity:.5}.cmp-cover{position:absolute;top:160px;left:0;width:100%;height:100vh;background:var(--background-color);transform:translateZ(0);pointer-events:none;display:none}[data-view=nav-cmp-detail] .cmp-cover{display:block;pointer-events:auto}.cmp-enabled .cmp-cover{transform:translate3d(0,105%,0);pointer-events:none}.section-ready .cmp-cover{transition:all var(--transition-time) ease-in-out}.cmp-detail-inputs-container{margin:8px 0 16px;padding:0}.cmp-detail-inputs-container h3{margin:0 0 6px;padding-left:16px;padding-right:8px;font-size:14px;font-weight:500;display:flex;justify-content:space-between;align-items:center}.cmp-detail-inputs-reload{font-weight:300;font-size:.9em;text-decoration:none;appearance:none;text-align:left;background-color:transparent;border:none;color:var(--primary-color);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cmp-detail-inputs-reload:hover{text-decoration:underline;color:var(--primary-color)}.cmp-detail-inputs-container .cmp-inputs-empty{padding:0;margin-top:12px;font-size:12px;font-weight:300;opacity:.5;font-style:italic}.cmp-detail-inputs-container .nav-list-item-icon{opacity:.8;background-size:20px 20px;background-position:4px center}.input-icon{background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path></svg>')}.input-icon-array{background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M10 16v-6a2 2 0 1 1 4 0v6"></path> <path d="M10 13h4"></path></svg>')}.input-icon-boolean{background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M10 16h2a2 2 0 1 0 0 -4h-2h2a2 2 0 1 0 0 -4h-2v8z"></path></svg>')}.input-icon-number{background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M10 16v-8l4 8v-8"></path></svg>')}.input-icon-object{background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M12 8a2 2 0 0 1 2 2v4a2 2 0 1 1 -4 0v-4a2 2 0 0 1 2 -2z"></path></svg>')}.input-icon-string{background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M10 15a1 1 0 0 0 1 1h2a1 1 0 0 0 1 -1v-2a1 1 0 0 0 -1 -1h-2a1 1 0 0 1 -1 -1v-2a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1"></path></svg>')}.cmp-input-item-unregistered{opacity:.4}.cmp-input-item-unregistered .input-icon:after{content:"";position:absolute;top:11px;left:4px;width:20px;height:2px;background-color:#000;transform:rotate(-45deg)}.cmp-prop-info{border-bottom:1px solid var(--border-color)}.cmp-input-readonly{margin:16px 0;padding:0 16px;display:grid;grid-template-columns:50% 50%;gap:12px}.cmp-input-readonly h3{margin:0;font-size:14px;font-weight:500}.cmp-input-readonly span{margin-top:2px;font-size:12px;font-weight:300;opacity:.8}.cmp-input-detail{margin:16px 0}.cmp-input-detail a{color:var(--primary-color);text-decoration:none}.cmp-input-detail a:hover{text-decoration:underline}.input-cover{position:absolute;top:175px;left:0;width:100%;height:100%;background:var(--background-color);transform:translateZ(0);transition:all var(--transition-time) ease-in-out;pointer-events:auto}.input-enabled .input-cover{transform:translate3d(0,105%,0);pointer-events:none}.input-loading-icon{position:absolute;display:inline-block;top:190px;left:0;width:100%;transform:translateZ(0);pointer-events:auto;opacity:0;transition:all 50ms ease-in-out;transition-delay:50ms;pointer-events:none}.input-loading .input-loading-icon{opacity:.5}:host{position:fixed;inset:0;z-index:2147483646;user-select:none;pointer-events:none;color:var(--text-color)}aside{position:absolute;top:0;right:0;width:var(--menu-width);height:100%;transform:translate3d(105%,0,0);transition:transform var(--transition-time) ease-in-out;background:var(--background-color);box-shadow:#000000c9 5px 0 20px;overflow:hidden;z-index:1}:host(.show-builder-menu) aside{pointer-events:auto;transform:translateZ(0)}#hit{position:absolute;inset:0;display:none}:host(.show-builder-menu) #hit{display:block;pointer-events:auto}#version{position:absolute;bottom:6px;right:6px;font-size:8px;color:#9b9b9b}</style><div id="hit"></div> <aside data-view="nav-home"> <section class="nav-home"> <header> <svg class="builder-logo" viewBox="0 0 31 36" fill="none" xmlns="http://www.w3.org/2000/svg" > <path d="M31 9.96854C31.0016 11.4553 30.6701 12.9236 30.03 14.2654C29.3898 15.6072 28.4572 16.7884 27.3007 17.7221L0.702841 2.61812C0.601104 2.56012 0.506714 2.49008 0.421705 2.40951C0.288323 2.27871 0.182333 2.12263 0.109928 1.95039C0.0375215 1.77814 0.000151253 1.59319 0 1.40633C0 1.03335 0.148098 0.675643 0.411715 0.411905C0.675332 0.148167 1.03287 0 1.40568 0L21.036 0C23.6786 0 26.213 1.05025 28.0816 2.91972C29.9502 4.78918 31 7.32472 31 9.96854Z" fill="#18B4F4" /> <path d="M31 25.4757C31.0004 26.7849 30.7429 28.0815 30.2423 29.2912C29.7417 30.5009 29.0078 31.6001 28.0825 32.526C27.1572 33.4519 26.0587 34.1864 24.8497 34.6875C23.6406 35.1886 22.3448 35.4465 21.0361 35.4465H1.40573C1.12766 35.4436 0.856725 35.3581 0.627199 35.201C0.397672 35.044 0.219871 34.8223 0.116289 34.5641C0.0127078 34.3059 -0.011999 34.0228 0.0452946 33.7505C0.102588 33.4783 0.239308 33.2292 0.438156 33.0347C0.517415 32.9551 0.606358 32.8858 0.702893 32.8284L11.1705 26.8843L27.2984 17.7244C28.4548 18.6579 29.3874 19.8387 30.028 21.18C30.6685 22.5213 31.0007 23.9891 31 25.4757Z" fill="#FD6B3C" /> <path d="M27.3011 17.7221L11.1709 26.8843L0.703209 32.8284C0.602697 32.8843 0.509784 32.9528 0.426758 33.0323C4.41799 28.9369 6.6496 23.442 6.64456 17.7221C6.65208 12.0015 4.42111 6.50517 0.429101 2.40948C0.51411 2.49005 0.6085 2.56009 0.710237 2.61809L27.3011 17.7221Z" fill="#A97FF2" /> </svg> <div> <h2 class="builder-home-title">Builder Devtools</h2> <p><button id="go-to-builder">Go to Builder</button></p> </div> <button id="close" aria-label="Close Menu"> <svg viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" > <path stroke="none" d="M0 0h24v24H0z" fill="none" /> <path d="M18 6l-12 12" /> <path d="M6 6l12 12" /> </svg> </button> </header> <div class="section-content"> <ul class="list"> <li> <button id="components-link"> <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" > <path d="M21 16.008V7.99001C20.9994 7.64108 20.9066 7.29851 20.731 6.99699C20.5554 6.69547 20.3032 6.44571 20 6.27301L13 2.26501C12.6954 2.09103 12.3508 1.99951 12 1.99951C11.6492 1.99951 11.3046 2.09103 11 2.26501L4 6.27301C3.381 6.62801 3 7.28301 3 7.99101V16.009C3 16.718 3.381 17.372 4 17.726L11 21.734C11.3046 21.908 11.6492 21.9995 12 21.9995C12.3508 21.9995 12.6954 21.908 13 21.734L20 17.726C20.619 17.371 21 16.716 21 16.008Z" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M12 22V12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M12 12L20.73 6.95996" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M3.26999 6.95996L12 12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> </svg> <span>Components</span> </button> </li> <li> <button id="settings-link"> <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" > <path d="M10.325 4.317C10.751 2.561 13.249 2.561 13.675 4.317C13.7389 4.5808 13.8642 4.82578 14.0407 5.032C14.2172 5.23822 14.4399 5.39985 14.6907 5.50375C14.9414 5.60764 15.2132 5.65085 15.4838 5.62987C15.7544 5.60889 16.0162 5.5243 16.248 5.383C17.791 4.443 19.558 6.209 18.618 7.753C18.4769 7.98466 18.3924 8.24634 18.3715 8.51677C18.3506 8.78721 18.3938 9.05877 18.4975 9.30938C18.6013 9.55999 18.7627 9.78258 18.9687 9.95905C19.1747 10.1355 19.4194 10.2609 19.683 10.325C21.439 10.751 21.439 13.249 19.683 13.675C19.4192 13.7389 19.1742 13.8642 18.968 14.0407C18.7618 14.2172 18.6001 14.4399 18.4963 14.6907C18.3924 14.9414 18.3491 15.2132 18.3701 15.4838C18.3911 15.7544 18.4757 16.0162 18.617 16.248C19.557 17.791 17.791 19.558 16.247 18.618C16.0153 18.4769 15.7537 18.3924 15.4832 18.3715C15.2128 18.3506 14.9412 18.3938 14.6906 18.4975C14.44 18.6013 14.2174 18.7627 14.0409 18.9687C13.8645 19.1747 13.7391 19.4194 13.675 19.683C13.249 21.439 10.751 21.439 10.325 19.683C10.2611 19.4192 10.1358 19.1742 9.95929 18.968C9.7828 18.7618 9.56011 18.6001 9.30935 18.4963C9.05859 18.3924 8.78683 18.3491 8.51621 18.3701C8.24559 18.3911 7.98375 18.4757 7.752 18.617C6.209 19.557 4.442 17.791 5.382 16.247C5.5231 16.0153 5.60755 15.7537 5.62848 15.4832C5.64942 15.2128 5.60624 14.9412 5.50247 14.6906C5.3987 14.44 5.23726 14.2174 5.03127 14.0409C4.82529 13.8645 4.58056 13.7391 4.317 13.675C2.561 13.249 2.561 10.751 4.317 10.325C4.5808 10.2611 4.82578 10.1358 5.032 9.95929C5.23822 9.7828 5.39985 9.56011 5.50375 9.30935C5.60764 9.05859 5.65085 8.78683 5.62987 8.51621C5.60889 8.24559 5.5243 7.98375 5.383 7.752C4.443 6.209 6.209 4.442 7.753 5.382C8.753 5.99 10.049 5.452 10.325 4.317Z" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M9 12C9 12.7956 9.31607 13.5587 9.87868 14.1213C10.4413 14.6839 11.2044 15 12 15C12.7956 15 13.5587 14.6839 14.1213 14.1213C14.6839 13.5587 15 12.7956 15 12C15 11.2044 14.6839 10.4413 14.1213 9.87868C13.5587 9.31607 12.7956 9 12 9C11.2044 9 10.4413 9.31607 9.87868 9.87868C9.31607 10.4413 9 11.2044 9 12Z" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> </svg> <span>Settings</span> </button> </li> <li> <button id="add-page-link"> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" > <path stroke="none" d="M0 0h24v24H0z" fill="none" /> <path d="M14 3v4a1 1 0 0 0 1 1h4" /> <path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z" /> <path d="M12 11l0 6" /> <path d="M9 14l6 0" /> </svg> <span>Add Builder Page</span> </button> </li> <li> <button id="import-from-figma"> <svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-brand-figma" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" > <path stroke="none" d="M0 0h24v24H0z" fill="none" /> <path d="M15 12m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0" /> <path d="M6 3m0 3a3 3 0 0 1 3 -3h6a3 3 0 0 1 3 3v0a3 3 0 0 1 -3 3h-6a3 3 0 0 1 -3 -3z" /> <path d="M9 9a3 3 0 0 0 0 6h3m-3 0a3 3 0 1 0 3 3v-15" /> </svg> <span>Import From Figma</span> </button> </li> </ul> </div> <footer> <ul class="list"> <li> <a href="https://docs.google.com/forms/d/e/1FAIpQLSdqZcJpRtm_Ia5DTHP6SDY9Xa6LID3KiTjRWkjMzWyJRUtSHw/viewform" target="_blank" > <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" > <path d="M11.013 17.0114L10.013 18.0114L2.513 10.5834C2.0183 10.102 1.62864 9.52342 1.36854 8.88404C1.10845 8.24466 0.983558 7.55836 1.00173 6.86834C1.01991 6.17832 1.18076 5.49954 1.47415 4.87474C1.76755 4.24994 2.18713 3.69266 2.70648 3.23799C3.22583 2.78331 3.8337 2.4411 4.49181 2.23289C5.14991 2.02468 5.844 1.95499 6.53036 2.02821C7.21673 2.10143 7.8805 2.31596 8.47987 2.65831C9.07925 3.00066 9.60124 3.46341 10.013 4.01741C10.8086 2.95654 11.9931 2.2552 13.3059 2.06766C14.6186 1.88012 15.9521 2.22176 17.013 3.01741C18.0739 3.81306 18.7752 4.99755 18.9627 6.3103C19.1503 7.62305 18.8086 8.95654 18.013 10.0174" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /> <path d="M18.2006 19.8175L16.0286 20.9555C15.9642 20.989 15.8917 21.004 15.8192 20.9987C15.7467 20.9934 15.6771 20.9681 15.6182 20.9256C15.5593 20.8831 15.5134 20.825 15.4855 20.7579C15.4577 20.6907 15.4491 20.6172 15.4606 20.5455L15.8756 18.1345L14.1186 16.4275C14.0662 16.3768 14.0291 16.3123 14.0115 16.2416C13.9939 16.1708 13.9966 16.0965 14.0192 16.0271C14.0418 15.9578 14.0835 15.8962 14.1394 15.8494C14.1954 15.8026 14.2634 15.7725 14.3356 15.7625L16.7636 15.4105L17.8496 13.2175C17.8821 13.1521 17.9322 13.0972 17.9942 13.0588C18.0562 13.0204 18.1277 13 18.2006 13C18.2736 13 18.3451 13.0204 18.4071 13.0588C18.4691 13.0972 18.5191 13.1521 18.5516 13.2175L19.6376 15.4105L22.0656 15.7625C22.1377 15.7728 22.2054 15.8031 22.2611 15.85C22.3168 15.8968 22.3583 15.9583 22.3809 16.0275C22.4034 16.0967 22.4062 16.1708 22.3888 16.2415C22.3715 16.3122 22.3347 16.3766 22.2826 16.4275L20.5256 18.1345L20.9396 20.5445C20.9521 20.6163 20.9441 20.6902 20.9166 20.7578C20.8891 20.8254 20.8433 20.8839 20.7842 20.9267C20.7252 20.9695 20.6553 20.9949 20.5825 21C20.5098 21.005 20.4371 20.9896 20.3726 20.9555L18.2006 19.8175Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /> </svg> <span>Give Feedback</span> </a> </li> </ul> <div id="version"></div> </footer> </section> <section class="nav-cmp-list"> <header> <button class="back-button"> <svg viewBox="0 0 24 24"> <path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" /> </svg> </button> <div class="search-container"> <div class="search-input-wrapper"> <svg class="search-icon" viewBox="0 0 24 24" width="16" height="16"> <path fill="none" stroke="currentColor" stroke-width="2" d="M15.5 15.5L20 20M10 17C6.13401 17 3 13.866 3 10C3 6.13401 6.13401 3 10 3C13.866 3 17 6.13401 17 10C17 13.866 13.866 17 10 17Z" /> </svg> <input type="text" id="component-search" class="component-search-input" placeholder="Search components..." autocomplete="off" spellcheck="false" /> <button id="clear-search" class="clear-search-button" type="button" aria-label="Clear search" > <svg viewBox="0 0 24 24" width="16" height="16"> <path fill="none" stroke="currentColor" stroke-width="2" d="M6 6l12 12M6 18L18 6" /> </svg> </button> </div> </div> <div> <h2>Custom Components</h2> <p> <button id="open-builder-registry"></button> </p> </div> </header> <div class="section-content"> <div id="cmp-list" class="cmp-list nav-list"></div> </div> <div class="nav-loading-icon spinner"></div> <footer> <p class="info"> Expand on Builder's selection of built-in blocks by <a target="_blank" href="https://www.builder.io/c/docs/custom-components-intro" >registering components</a > from your codebase. This way, teammates can drag and drop your components within Builder's Visual Editor just like any other block. </p> </footer> </section> <section class="nav-cmp-detail"> <header> <button class="back-button" data-back="nav-cmp-list"> <svg viewBox="0 0 24 24"> <path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" /> </svg> </button> <div> <h2 id="cmp-detail-title"></h2> <p> <button id="cmp-open-source"></button> </p> </div> </header> <div class="section-content"> <div id="cmp-error"></div> <label class="ui-switch"> <div> <h3>Register Component</h3> <p> Registers this component so it can be used within Builder Visual CMS </p> </div> <input type="checkbox" role="switch" id="cmp-register" /> <span class="switcher"></span> </label> <div id="cmp-detail"> <label class="ui-text-input"> <h3>Component Name</h3> <div class="input"> <input type="text" id="cmp-name" autocapitalize="off" autocorrect="off" spellcheck="false" autocomplete="off" minlength="2" maxlength="30" required placeholder="e.g. My Counter" /> </div> <p> Unique name to identify this custom component within Builder. Press ESC to cancel </p> </label> <div class="cmp-detail-inputs-container"> <h3> <span>Builder Inputs (Props)</span> <button class="cmp-detail-inputs-reload" id="btn-inputs-reload"> Reload </button> </h3> <div id="cmp-detail-inputs"></div> </div> </div> </div> <div class="cmp-cover"></div> <div class="cmp-loading-icon spinner"></div> </section> <section class="nav-cmp-input"> <header> <button class="back-button" data-back="nav-cmp-detail"> <svg viewBox="0 0 24 24"> <path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" /> </svg> </button> <div> <h2 id="cmp-input-title"></h2> <p> <button id="input-open-source"></button> </p> </div> </header> <div class="section-content"> <label class="ui-switch"> <div> <h3>Enable Input</h3> <p>Add this component prop as a Builder input</p> </div> <input type="checkbox" role="switch" id="input-register" /> <span class="switcher"></span> </label> <div class="cmp-prop-info"> <div class="cmp-input-readonly"> <h3>Prop Name</h3> <span id="cmp-prop-name"></span> </div> <div class="cmp-input-readonly"> <h3>Prop Type</h3> <span id="cmp-prop-type"></span> </div> </div> <div class="cmp-input-detail"> <label class="ui-text-input"> <h3>Builder Input Name</h3> <div class="input"> <input type="text" id="input-name" autocapitalize="off" autocorrect="off" spellcheck="false" autocomplete="off" minlength="1" maxlength="30" required placeholder="e.g. Text" /> </div> <p> Friendly name to identify this component prop as a Builder input. Press ESC to cancel </p> </label> <label class="ui-select"> <h3>Builder Input Type</h3> <div class="select"> <select id="input-type"></select> </div> <p> Correlate to what editing UI is appropriate for this Builder input. <a href="https://www.builder.io/c/docs/custom-components-input-types" target="_blank" >Read more about input types.</a > </p> </label> </div> <div class="input-cover"></div> <div class="input-loading-icon spinner"></div> </div> </section> <section class="nav-settings"> <header> <button class="back-button"> <svg viewBox="0 0 24 24"> <path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" /> </svg> </button> <div> <h2>Settings</h2> <p>Configure Builder's Devtools</p> </div> </header> <div class="section-content"> <label class="ui-switch"> <div> <h3>Enable edit button in UI</h3> <p>Enables the edit button so you can edit content in Builder</p> </div> <input type="checkbox" role="switch" id="enable-edit" /> <span class="switcher"></span> </label> </div> </section> <div class="ui-toast" id="toast"></div> </aside> <button class="menu-toggle" aria-label="Toggle Builder Devtools"> <div> <div class="highlight-bg"></div> <svg viewBox="0 0 31 36" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M31 9.96854C31.0016 11.4553 30.6701 12.9236 30.03 14.2654C29.3898 15.6072 28.4572 16.7884 27.3007 17.7221L0.702841 2.61812C0.601104 2.56012 0.506714 2.49008 0.421705 2.40951C0.288323 2.27871 0.182333 2.12263 0.109928 1.95039C0.0375215 1.77814 0.000151253 1.59319 0 1.40633C0 1.03335 0.148098 0.675643 0.411715 0.411905C0.675332 0.148167 1.03287 0 1.40568 0L21.036 0C23.6786 0 26.213 1.05025 28.0816 2.91972C29.9502 4.78918 31 7.32472 31 9.96854Z" fill="#18B4F4" /> <path d="M31 25.4757C31.0004 26.7849 30.7429 28.0815 30.2423 29.2912C29.7417 30.5009 29.0078 31.6001 28.0825 32.526C27.1572 33.4519 26.0587 34.1864 24.8497 34.6875C23.6406 35.1886 22.3448 35.4465 21.0361 35.4465H1.40573C1.12766 35.4436 0.856725 35.3581 0.627199 35.201C0.397672 35.044 0.219871 34.8223 0.116289 34.5641C0.0127078 34.3059 -0.011999 34.0228 0.0452946 33.7505C0.102588 33.4783 0.239308 33.2292 0.438156 33.0347C0.517415 32.9551 0.606358 32.8858 0.702893 32.8284L11.1705 26.8843L27.2984 17.7244C28.4548 18.6579 29.3874 19.8387 30.028 21.18C30.6685 22.5213 31.0007 23.9891 31 25.4757Z" fill="#FD6B3C" /> <path d="M27.3011 17.7221L11.1709 26.8843L0.703209 32.8284C0.602697 32.8843 0.509784 32.9528 0.426758 33.0323C4.41799 28.9369 6.6496 23.442 6.64456 17.7221C6.65208 12.0015 4.42111 6.50517 0.429101 2.40948C0.51411 2.49005 0.6085 2.56009 0.710237 2.61809L27.3011 17.7221Z" fill="#A97FF2" /> </svg> </div> </button>\`,Nr(e),Br(e),Ur(e),Ar(e),Dr(e),Fr(e),this.setAttribute("aria-hidden","true"),e.getElementById("version").textContent="v1.5.13"}highlightOpener(){let e=this.shadowRoot.querySelector(".menu-toggle");e.classList.add("menu-toggle-highlight"),e.classList.add("menu-toggle-highlight-no-transition"),setTimeout(()=>{e.classList.remove("menu-toggle-highlight-no-transition"),setTimeout(()=>{e.classList.remove("menu-toggle-highlight")},20)},20)}};var ki=\`<style>*,*:before,*:after{box-sizing:border-box}html,body,:host{position:fixed;top:0;left:0;width:100%;height:100vh;z-index:2147483646;margin:0;padding:0;line-height:1.8;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";background-color:#252525;color:#fff;transition:opacity .25s ease-in-out}:host([aria-hidden="true"]){opacity:0;pointer-events:none}main{position:absolute;top:0;left:0;width:100%;height:100vh}h1{margin-top:0;font-size:24px;font-weight:300;line-height:1.4}p{margin:20px 0;font-weight:300}button{cursor:pointer}aside{position:absolute;top:0;left:0;width:350px;height:100vh;padding:60px 0 0 50px;background-color:#121212}aside ul{margin:30px 0 0;padding:0;list-style:none}aside li{position:relative;margin:0;padding:20px 10px;font-weight:300}aside li.highlight{color:#48a1ff}aside li.active{font-weight:700}aside li .circle{position:absolute;top:20px;left:10px;width:24px;height:24px;border:3px solid white;border-radius:50%;font-size:14px}aside li.highlight .circle{border-color:#48a1ff}aside li.active .circle:after{content:"";position:absolute;top:3px;left:3px;width:12px;height:12px;border-radius:50%;background-color:#48a1ff}aside li.completed .circle{background-color:#48a1ff}aside li.completed .circle:after{content:"";position:absolute;top:2px;left:6px;width:6px;height:13px;border:3px solid black;border-top:none;border-left:none;transform:rotate(45deg)}aside li .line{position:absolute;top:44px;left:21px;width:3px;height:45px;background-color:#fff}aside li.completed .line{background-color:#48a1ff}aside li span{display:block;margin-left:44px}nav{margin-top:30px}section{position:absolute;top:135px;left:350px;padding:0 80px 0 140px;transition:opacity .15s ease-in-out}section[aria-hidden=true]{pointer-events:none;opacity:0}section h1,section p{min-width:300px;max-width:600px}.button{position:relative;display:inline-block;color:#fff;background-color:#48a1ff;border-radius:4px;text-decoration:none;padding:10px 40px 10px 20px;white-space:nowrap}.button:hover{background-color:#48a1ffd9}#button-icon{position:absolute;top:1px;right:5px;bottom:0;width:30px;background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="none" stroke="white" stroke-linecap="square" stroke-miterlimit="10" stroke-width="48" d="M184 112l144 144-144 144"/></svg>');background-repeat:no-repeat;background-position:center;background-size:24px 24px}.button[aria-disabled=true]{opacity:.9;background-color:#ffffff4d;pointer-events:none;padding-right:60px}.button[aria-disabled=true] #button-icon{top:21px;right:29px;width:8px;height:8px;border-radius:4px;background:#fff;color:#fff;animation:dot-flashing .5s infinite linear alternate;animation-delay:.25s}.button[aria-disabled=true] #button-icon:before,.button[aria-disabled=true] #button-icon:after{content:"";display:inline-block;position:absolute;top:0}.button[aria-disabled=true] #button-icon:before{left:-12px;width:8px;height:8px;border-radius:4px;background-color:#fff;color:#fff;animation:dot-flashing .5s infinite alternate;animation-delay:0s}.button[aria-disabled=true] #button-icon:after{left:12px;width:8px;height:8px;border-radius:4px;background-color:#fff;color:#fff;animation:dot-flashing .5s infinite alternate;animation-delay:.5s}@keyframes dot-flashing{0%{background-color:#fff}50%,to{background-color:#ffffff4d}}.logo{margin-left:9px;background:url('data:image/svg+xml,<svg viewBox="0 0 150 32" fill="none" xmlns="http://www.w3.org/2000/svg" > <g clip-path="url(%23clip0_4_304)"> <path d="M27.9858 8.99927C27.9872 10.3415 27.688 11.667 27.1101 12.8783C26.5321 14.0896 25.6902 15.156 24.6462 15.9989V15.9989L0.634502 2.36355C0.542657 2.31119 0.457444 2.24796 0.380701 2.17523C0.260289 2.05715 0.164605 1.91624 0.0992389 1.76075C0.0338732 1.60525 0.000136546 1.43828 0 1.26959C0 0.932873 0.133698 0.609948 0.371683 0.371854C0.609667 0.13376 0.932443 0 1.269 0L18.9906 0C21.3763 0 23.6642 0.948135 25.3512 2.63583C27.0381 4.32352 27.9858 6.61252 27.9858 8.99927V8.99927Z" fill="%2318B4F4" /> <path d="M27.9858 22.9986C27.9861 24.1806 27.7536 25.351 27.3017 26.4431C26.8498 27.5352 26.1873 28.5275 25.352 29.3634C24.5167 30.1993 23.5249 30.8624 22.4335 31.3147C21.342 31.7671 20.1721 32 18.9907 32H1.26906C1.01802 31.9973 0.77343 31.9202 0.566221 31.7784C0.359012 31.6366 0.198499 31.4364 0.104989 31.2034C0.0114791 30.9703 -0.0108254 30.7147 0.0408974 30.4689C0.0926201 30.2231 0.216046 29.9982 0.395559 29.8226V29.8226C0.467112 29.7508 0.547407 29.6882 0.634555 29.6364L10.0844 24.2703L24.6441 16.001C25.688 16.8438 26.53 17.9097 27.1083 19.1206C27.6866 20.3315 27.9864 21.6566 27.9858 22.9986V22.9986Z" fill="%23FD6B3C" /> <path d="M24.6461 15.9989L10.0843 24.2703L0.634458 29.6365C0.54372 29.6868 0.459841 29.7487 0.384888 29.8205C3.98804 26.1233 6.00266 21.1627 5.99812 15.9989C6.0049 10.8346 3.99085 5.87268 0.387003 2.17523C0.463746 2.24796 0.548959 2.31119 0.640803 2.36355L24.6461 15.9989Z" fill="%23A97FF2" /> <path d="M47.6659 11.7352C51.8177 11.7352 54.1632 15.0531 54.1632 19.0714C54.1632 23.0896 51.8177 26.3821 47.6659 26.3821C45.5086 26.3821 43.8589 25.5188 42.9473 24.0545L42.5709 26.052H39.9736V6.77115H43.1884V13.8914C43.971 12.6959 45.5086 11.7352 47.6659 11.7352ZM47.0187 23.5488C49.4446 23.5488 50.9547 21.5809 50.9547 19.0714C50.9547 16.5089 49.4446 14.5664 47.0187 14.5664C44.5928 14.5664 43.0806 16.5047 43.0806 19.0714C43.0806 21.583 44.5653 23.5488 47.0187 23.5488V23.5488Z" fill="white" /> <path d="M65.4595 20.2859V12.0611H68.668V20.123C68.668 23.7202 67.0246 26.3821 62.4943 26.3821C57.9639 26.3821 56.3206 23.7117 56.3206 20.123V12.0611H59.529V20.2859C59.529 22.4696 60.5527 23.5488 62.49 23.5488C64.4274 23.5488 65.4595 22.4696 65.4595 20.2859Z" fill="white" /> <path d="M71.2355 7.74451C71.2247 7.46284 71.2724 7.18199 71.3755 6.91968C71.4787 6.65737 71.6351 6.41929 71.8348 6.22047C72.0345 6.02165 72.2732 5.8664 72.5359 5.76452C72.7986 5.66264 73.0796 5.61633 73.3611 5.62853C74.5793 5.62853 75.4571 6.50666 75.4571 7.75509C75.4571 9.00352 74.5793 9.8224 73.3611 9.8224C72.1428 9.8224 71.2355 8.9612 71.2355 7.74451Z" fill="white" /> <path d="M128.476 7.74451C128.465 7.46376 128.513 7.18383 128.615 6.92227C128.718 6.66071 128.873 6.42315 129.072 6.22449C129.27 6.02583 129.508 5.87035 129.769 5.7678C130.031 5.66524 130.31 5.61783 130.591 5.62852C131.809 5.62852 132.687 6.50666 132.687 7.75509C132.687 9.00352 131.809 9.8224 130.591 9.8224C129.373 9.8224 128.476 8.9612 128.476 7.74451Z" fill="white" /> <path d="M122.302 24.1031C122.291 23.8223 122.339 23.5422 122.441 23.2805C122.543 23.0188 122.699 22.7811 122.897 22.5824C123.096 22.3837 123.334 22.2282 123.595 22.1258C123.857 22.0233 124.137 21.9761 124.417 21.9872C125.636 21.9872 126.513 22.8653 126.513 24.1031C126.513 25.341 125.636 26.1726 124.417 26.1726C123.199 26.1726 122.302 25.3219 122.302 24.1031Z" fill="white" /> <path d="M74.9516 12.059H71.7432V26.0583H74.9516V12.059Z" fill="white" /> <path d="M78.16 26.0583V6.77115H81.3685V26.0626L78.16 26.0583Z" fill="white" /> <path d="M94.6063 6.77115H97.8148V26.0626H95.2239L94.8474 24.0651C93.9591 25.523 92.3094 26.3927 90.131 26.3927C86.0046 26.3927 83.6591 23.0748 83.6591 19.0819C83.6591 15.0891 86.0046 11.7458 90.131 11.7458C92.3137 11.7458 93.8238 12.7149 94.6063 13.902V6.77115ZM90.7993 14.5707C88.3734 14.5707 86.8633 16.5131 86.8633 19.0756C86.8633 21.5851 88.3734 23.553 90.7993 23.553C93.2252 23.553 94.7354 21.5851 94.7354 19.0756C94.7396 16.5047 93.257 14.5664 90.8036 14.5664L90.7993 14.5707Z" fill="white" /> <path d="M113.479 22.2284C112.482 24.7359 110.162 26.3821 107.117 26.3821C102.887 26.3821 100.137 23.225 100.137 19.0439C100.137 14.9706 102.942 11.7353 107.093 11.7353C111.245 11.7353 113.969 14.8902 113.969 18.991C113.982 19.3255 113.953 19.6604 113.883 19.9876H103.288C103.53 22.2009 104.959 23.6292 107.197 23.6292C108.735 23.6292 110.001 22.8738 110.594 21.473L113.479 22.2284ZM103.341 17.6156H110.784C110.513 15.6731 109.166 14.3506 107.089 14.3506C105.012 14.3506 103.665 15.7006 103.341 17.6156V17.6156Z" fill="white" /> <path d="M123.779 14.9452C123.538 14.9117 123.295 14.8933 123.051 14.8902C120.786 14.8902 119.439 16.0772 119.439 18.7751V26.0583H116.23V12.0611H118.821L119.195 14.0014C119.707 13.1127 120.887 11.9257 123.322 11.9257C123.455 11.9257 123.779 11.9532 123.779 11.9532V14.9452Z" fill="white" /> <path d="M132.192 12.059H128.984V26.0583H132.192V12.059Z" fill="white" /> <path d="M134.483 19.0714C134.483 15.1335 137.287 11.7353 141.735 11.7353C146.183 11.7353 149.015 15.1335 149.015 19.0714C149.015 23.0092 146.213 26.3821 141.735 26.3821C137.258 26.3821 134.483 23.0092 134.483 19.0714ZM141.735 23.5488C144.083 23.5488 145.806 21.7692 145.806 19.0714C145.806 16.3735 144.083 14.5664 141.735 14.5664C139.387 14.5664 137.687 16.346 137.687 19.0714C137.687 21.7968 139.417 23.5488 141.735 23.5488V23.5488Z" fill="white" /> </g> <defs> <clipPath id="clip0_4_304"> <rect width="149.015" height="32" fill="white" /> </clipPath> </defs> </svg>');background-repeat:no-repeat;width:150px;height:32px}@media (max-width: 840px){aside{width:250px;padding:60px 0 0 20px}section{left:250px;padding:0 80px}}@media (max-width: 590px){aside{width:230px;padding:60px 0 0 10px}section{left:230px;padding:0 40px}}#modified-files-message a{color:#cbcbcb;font-weight:300;text-decoration:underline}#modified-files-message a:hover{color:#fff;text-decoration:none}#restart-warning{border-radius:4px;padding:8px 16px;border:1px solid #fd6b3c;background:#fd6b3c1a}#react-router-steps{margin:0 0 5px;padding:0 20px}#need-help{color:#48a1ff;text-decoration:none}#router-message{border-radius:4px;padding:16px;border:1px solid #48a1ff}#router-finish-button{margin-top:12px}#router-checkbox-div{display:flex;align-items:center}#router-checkbox{margin-right:10px;width:15px;height:15px}#success-title{display:flex;align-items:center;gap:10px}#success-title .check-icon{display:inline-block;width:24px;height:24px;border:2px solid #28a745;border-radius:50%;position:relative}#success-title .check-icon:before{content:"";position:absolute;top:50%;left:50%;width:6px;height:12px;border:solid #28a745;border-width:0 2px 2px 0;transform:translate(-50%,-60%) rotate(45deg)}
|
|
1130
|
+
\`,t.appendChild(e),setTimeout(()=>{e.classList.add("menu-toggle-tooltip-show"),e.addEventListener("click",()=>{e.classList.remove("menu-toggle-tooltip-show")})},1e3)};function Br(t){t.getElementById("go-to-builder").addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),ue(t,!1),window.open(mn(),"builder")}),t.getElementById("components-link").addEventListener("click",s=>{s.preventDefault(),s.stopPropagation();let u=t.querySelector(".nav-cmp-list .section-content");u.scrollTop=0,W(t,"nav-cmp-list"),Mr(t)}),t.getElementById("settings-link").addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),W(t,"nav-settings")}),t.getElementById("add-page-link").addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),ue(t,!1),window.open(Ee(),"builder")}),t.getElementById("import-from-figma").addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),ue(t,!1),window.open("https://www.figma.com/community/plugin/747985167520967365/builder-io-ai-powered-figma-to-code-react-vue-tailwind-more")})}function Fr(t){let e=t.getElementById("enable-edit");e.addEventListener("change",n=>{n.stopPropagation(),bt(e.checked)}),e.checked=ke(),bt(e.checked)}var lt=class extends HTMLElement{constructor(){super()}connectedCallback(){let e=this.attachShadow({mode:"open"});e.innerHTML=\`<style>*,*:before,*:after{box-sizing:border-box}:host{--background-color: rgba(40, 40, 40, 1);--primary-color: rgba(72, 161, 255, 1);--primary-color-subdued: rgb(72, 161, 255, .6);--primary-color-highlight: rgb(126, 188, 255);--primary-contrast-color: white;--edit-color: #1d74e2;--edit-color-highlight: #1c6bd1;--edit-color-alpha: rgb(72, 161, 255, .15);--error-color: #ff2b55;--text-color: white;--text-color-highlight: white;--border-color: #454545;--button-background-color-hover: rgba(255, 255, 255, .1);--menu-width: 320px;--transition-time: .15s;--font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";font-family:var(--font-family);line-height:1.6}button{cursor:pointer;color:var(--text-color);-webkit-tap-highlight-color:transparent}input,select,button{font-family:var(--font-family)}.menu-toggle{position:absolute;right:0;bottom:0;pointer-events:auto;padding:8px;background:transparent;border:none;appearance:none}.menu-toggle div{position:relative;width:64px;height:64px;pointer-events:none;border-radius:50%;background:#000;border:1px solid white;box-shadow:#00000054 0 0 8px}.menu-toggle:hover div{background-color:var(--background-color);border:1px solid rgb(220,220,220)}.menu-toggle svg{position:absolute;top:15px;left:15px;width:33px;height:32px}div.highlight-bg{position:absolute;top:-1px;left:-1px;background-color:#1a1a1a;pointer-events:none;transition:all .4s ease-out;opacity:0}.menu-toggle-highlight-no-transition div.highlight-bg{transition:none}.menu-toggle-highlight div.highlight-bg{opacity:1}.menu-toggle-tooltip{position:absolute;bottom:0;right:0;width:382px;height:72px;padding:0;text-align:left;appearance:none;background-color:transparent;border:none;pointer-events:none;transform:translate3d(320px,0,0);opacity:0;transition:all .15s ease-in-out;color:#fff}.menu-toggle-tooltip.menu-toggle-tooltip-show{pointer-events:auto;opacity:1;transform:translateZ(0)}.menu-toggle-tooltip-content{position:absolute;inset:0 95px 10px 0;padding:8px 12px;background-color:var(--primary-color);box-shadow:#00000054 0 0 20px;border-radius:2px}.menu-toggle-tooltip-content:before{content:"";position:absolute;bottom:15px;right:-6px;width:30px;height:30px;background-color:var(--primary-color);transform:rotate(45deg)}.menu-toggle-tooltip:hover .menu-toggle-tooltip-content,.menu-toggle-tooltip:hover .menu-toggle-tooltip-content:before{background-color:var(--primary-color-highlight)}.menu-toggle-tooltip-content h3{margin:0;font-size:16px}.menu-toggle-tooltip-content p{margin:0;font-size:12px}section{position:absolute;display:grid;grid-template-rows:64px auto 64px;top:0;left:0;width:100%;height:100%;padding:0;pointer-events:none}.section-content{margin:0;padding:0 0 10px;font-weight:300;transform:translate3d(105%,0,0);transition:transform var(--transition-time) ease-in-out;overflow-y:auto}.section-content .error{color:var(--error-color);font-weight:700}section a{text-decoration:none;color:var(--text-color)}section h3,section p{margin-left:16px;margin-right:16px}.info{font-size:12px}ul.list{list-style:none;padding:0;margin:0}ul.list li{display:block;padding:0;margin:0}ul.list a,ul.list button{display:grid;grid-template-columns:24px auto;grid-gap:16px;padding:12px;margin:8px 0;border:none;background:transparent;appearance:none;width:100%;font-weight:300;text-align:left;text-decoration:none;color:var(--text-color)}ul.list a:hover,ul.list button:hover{text-decoration:none;color:var(--text-color);background-color:var(--button-background-color-hover)}ul.list a span,ul.list button span{display:block;font-size:16px;font-weight:500;line-height:1.5;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}header{position:relative;display:grid;grid-template-columns:44px 1fr;gap:8px;padding-left:8px;border-bottom:1px solid var(--border-color);transition:opacity var(--transition-time) ease-in-out;opacity:0;pointer-events:none}header>div{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.nav-home header>div{margin-right:56px}header h2{margin:7px 0 0;font-size:18px;font-weight:500;line-height:1.5;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}header p{margin:2px 0 0;font-size:12px;font-weight:300;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}header p button{display:block;margin:0;padding:0;width:100%;font-size:12px;font-weight:300;text-decoration:none;appearance:none;text-align:left;background-color:transparent;border:none;color:var(--primary-color);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}header p button:hover{text-decoration:underline;color:var(--primary-color)}.builder-logo{margin:12px 0 0 8px}#close{display:block;position:absolute;appearance:none;background:transparent;border:none;border-radius:50%;margin:0;padding:0;right:4px;top:8px;width:48px;height:48px;z-index:1;opacity:.7}#close:hover{opacity:1;background-color:var(--button-background-color-hover)}#close svg{position:absolute;top:12px;left:12px;width:24px;height:24px;fill:currentColor;pointer-events:none}.back-button{position:relative;display:block;margin:7px 0 0 -2px;width:48px;height:48px;background:transparent;border:none;appearance:none;border-radius:50%}.back-button:hover{background-color:var(--button-background-color-hover)}.back-button svg{position:absolute;top:12px;left:12px;width:24px;height:24px;fill:currentColor;pointer-events:none}footer{border-top:1px solid var(--border-color);transition:opacity var(--transition-time) ease-in-out;opacity:0;pointer-events:none}section.nav-cmp-list{grid-template-rows:64px auto 120px}footer a{text-decoration:underline;color:var(--primary-color)}footer a:hover{color:var(--primary-color);text-decoration:none}.nav-list{padding:2px 0}.nav-loading{pointer-events:none}.nav-loading-icon{position:absolute;display:inline-block;top:170px;left:0;width:100%;transform:translateZ(0);pointer-events:auto;opacity:0;transition:all 50ms ease-in-out;transition-delay:50ms;pointer-events:none}.nav-loading .nav-loading-icon{opacity:.5}.nav-list h4{margin:8px 8px 8px 10px;font-size:14px;font-weight:600}.nav-list .nav-list-item+h4{margin-top:30px}.nav-list-item{display:grid;grid-template-columns:1fr 1fr;gap:8px;position:relative;margin:2px 0;padding:8px 28px 8px 46px;width:100%;font-size:14px;font-weight:300;text-align:left;border:none;background:transparent;appearance:none}.nav-list-item:hover{background-color:var(--button-background-color-hover)}.nav-list-item-icon{position:absolute;top:4px;left:10px;width:24px;height:24px;object-fit:contain;filter:invert(100%);background-size:24px 24px;background-repeat:no-repeat;background-position:center center}.nav-list-item span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;pointer-events:none}.nav-list-item:after{display:block;position:absolute;content:"";background-image:url('data:image/svg+xml,<svg width="8" height="14" viewBox="0 0 8 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 1L7 7L1 13" stroke="%23F2F2F2" stroke-opacity="0.5" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/></svg>');background-repeat:no-repeat;background-position:12px 9px;top:0;right:0;width:32px;height:32px;pointer-events:none}.nav-list-item-note{opacity:0;font-size:12px;padding-top:1px;text-align:right}.nav-list-item:hover .nav-list-item-note{opacity:.5}.ui-select{display:block;margin:8px 0 16px;padding:8px 16px;cursor:pointer}.ui-select h3{margin:0;font-size:14px;font-weight:500}.ui-select p{margin:8px 0;font-size:12px;font-weight:300}.ui-select .select{position:relative;margin:8px 0;border-radius:4px;padding:0;line-height:1.1;overflow:hidden;border:1px solid var(--border-color)}.ui-select select{appearance:none;background-color:transparent;border:none;outline:none;padding:8px 32px 8px 8px;margin:0;width:100%;font-size:14px;cursor:pointer;text-overflow:ellipsis;opacity:.6;color:var(--text-color)}.ui-select .select:after{content:"";top:6px;right:5px;width:24px;height:24px;position:absolute;background-image:url('data:image/svg+xml,<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill="%23F2F2F2" d="M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"/></svg>');background-repeat:no-repeat;background-position:center;pointer-events:none;opacity:.6}.ui-select .select:hover{border-color:var(--primary-color-subdued)}.ui-text-input .select:focus-within{border-color:var(--primary-color)}.ui-text-input .select:focus-within select{opacity:1}.spinner:after{content:" ";display:block;width:32px;height:32px;margin:0 auto;pointer-events:auto;border-radius:50%;border:3px solid var(--text-color);border-color:var(--text-color) transparent var(--text-color) transparent;animation:spinner .75s linear infinite}@keyframes spinner{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.ui-switch{display:grid;grid-template-columns:auto 48px;grid-gap:20px;margin:8px 0 16px;padding:8px 0 8px 16px;cursor:pointer}.ui-switch>*{pointer-events:none}.ui-switch input{display:none;visibility:hidden}.ui-switch .switcher{display:inline-block;border-radius:100px;width:35px;height:14px;background-color:#ccc;position:relative;top:6px;vertical-align:middle;cursor:pointer}.ui-switch input[type=checkbox]:checked+.switcher{background-color:var(--primary-color-subdued)}.ui-switch .switcher:before{content:"";display:block;width:20px;height:20px;background-color:var(--text-color);box-shadow:0 1px 3px #0009;border-radius:50%;position:absolute;top:-3px;left:0;margin-right:0;transition:all .15s}.ui-switch input[type=checkbox]:checked+.switcher:before{left:100%;margin-left:-20px;background-color:var(--primary-color)}.ui-switch h3{margin:0;font-size:14px;font-weight:500}.ui-switch p{margin:4px 0 0;font-size:12px;font-weight:300}.ui-text-input{display:block;margin:8px 0 16px;padding:8px 16px;cursor:pointer}.ui-text-input h3{margin:0;font-size:14px;font-weight:500}.ui-text-input p{margin:8px 0;font-size:12px;font-weight:300}.ui-text-input .input{position:relative;margin:8px 0;border:1px solid var(--border-color);border-radius:4px;background:transparent;padding:2px;overflow:hidden}.ui-text-input input{display:block;width:235px;font-size:14px;border:none;background:transparent;padding:6px;appearance:none;color:var(--text-color);opacity:.6;outline:none}.ui-text-input .input:hover{border-color:var(--primary-color-subdued)}.ui-text-input .input:focus-within{border-color:var(--primary-color)}.ui-text-input .input:focus-within input{opacity:1}.ui-text-input .input:after{content:"";position:absolute;top:5px;right:14px;width:8px;height:17px;border:2px solid rgba(51,181,51,1);border-top:none;border-left:none;transform:rotate(45deg);opacity:0;transition:opacity 80ms ease-in-out;pointer-events:none}.ui-text-input.saved .input:after{opacity:1}.ui-toast{position:fixed;bottom:8px;left:8px;right:8px;padding:6px 12px;font-size:14px;border-radius:4px;transform:translate3d(0,150%,0);opacity:0;transition:all var(--transition-time) ease-in-out;background-color:var(--primary-color-subdued);color:var(--text-color);pointer-events:none}.ui-toast.ui-toast-show{transform:translateZ(0);opacity:1;pointer-events:auto}[data-view=nav-home] .nav-home .section-content,[data-view=nav-cmp-list] .nav-cmp-list .section-content,[data-view=nav-cmp-detail] .nav-cmp-detail .section-content,[data-view=nav-cmp-input] .nav-cmp-input .section-content,[data-view=nav-settings] .nav-settings .section-content{transform:translateZ(0);pointer-events:auto}[data-view=nav-home] .nav-home header,[data-view=nav-home] .nav-home footer,[data-view=nav-cmp-list] .nav-cmp-list header,[data-view=nav-cmp-list] .nav-cmp-list footer,[data-view=nav-cmp-detail] .nav-cmp-detail header,[data-view=nav-cmp-detail] .nav-cmp-detail footer,[data-view=nav-cmp-input] .nav-cmp-input header,[data-view=nav-cmp-input] .nav-cmp-input footer,[data-view=nav-settings] .nav-settings header,[data-view=nav-settings] .nav-settings footer{opacity:1;pointer-events:auto}[data-view=nav-cmp-list] .nav-home .section-content,[data-view=nav-cmp-detail] .nav-home .section-content,[data-view=nav-cmp-detail] .nav-cmp-list .section-content,[data-view=nav-cmp-input] .nav-home .section-content,[data-view=nav-cmp-input] .nav-cmp-list .section-content,[data-view=nav-cmp-input] .nav-cmp-detail .section-content,[data-view=nav-settings] .nav-home .section-content{transform:translate3d(-105%,0,0)}.cmp-item .nav-list-item-icon{background-image:url('data:image/svg+xml,<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M20.83 16.809C20.94 16.561 21 16.289 21 16.008V7.99001C20.9994 7.64108 20.9066 7.29851 20.731 6.99699C20.5554 6.69547 20.3032 6.44571 20 6.27301L13 2.26501C12.6954 2.09103 12.3508 1.99951 12 1.99951C11.6492 1.99951 11.3046 2.09103 11 2.26501L7.988 3.99001M5.441 5.44801L4 6.27301C3.381 6.62801 3 7.28301 3 7.99101V16.009C3 16.718 3.381 17.372 4 17.726L11 21.734C11.3046 21.908 11.6492 21.9995 12 21.9995C12.3508 21.9995 12.6954 21.908 13 21.734L18.544 18.56" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/><path d="M12 22V12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/><path d="M14.532 10.538L20.73 6.95996" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/><path d="M3.27002 6.95996L12 12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/><path d="M3 3L21 21" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"/></svg>');opacity:.3}.cmp-item.registered .nav-list-item-icon{background-image:url('data:image/svg+xml,<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M21 16.008V7.99001C20.9994 7.64108 20.9066 7.29851 20.731 6.99699C20.5554 6.69547 20.3032 6.44571 20 6.27301L13 2.26501C12.6954 2.09103 12.3508 1.99951 12 1.99951C11.6492 1.99951 11.3046 2.09103 11 2.26501L4 6.27301C3.381 6.62801 3 7.28301 3 7.99101V16.009C3 16.718 3.381 17.372 4 17.726L11 21.734C11.3046 21.908 11.6492 21.9995 12 21.9995C12.3508 21.9995 12.6954 21.908 13 21.734L20 17.726C20.619 17.371 21 16.716 21 16.008Z" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M12 22V12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M12 12L20.73 6.95996" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M3.26999 6.95996L12 12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /></svg>');opacity:.8}.search-highlight{background-color:var(--primary-color-alpha);padding:0 2px;border-radius:2px;font-weight:500}.search-container{position:sticky;top:0;z-index:10;padding:12px 16px;background:var(--background-color);border-bottom:1px solid var(--border-color)}.search-input-wrapper{position:relative;display:flex;align-items:center}.search-icon{position:absolute;left:12px;color:var(--text-color-secondary);pointer-events:none}.component-search-input{width:100%;height:36px;padding:8px 36px;border:1px solid var(--border-color);border-radius:6px;background:var(--input-background);color:var(--text-color);font-size:14px;transition:border-color .2s,box-shadow .2s}.component-search-input:focus{outline:none;border-color:var(--primary-color);box-shadow:0 0 0 2px var(--primary-color-alpha)}.component-search-input::placeholder{color:var(--text-color-tertiary)}.clear-search-button{position:absolute;right:8px;padding:4px;color:var(--text-color-secondary);border:none;background:transparent;border-radius:4px;cursor:pointer;opacity:0;transition:opacity .2s,background-color .2s;display:flex;align-items:center;justify-content:center}.clear-search-button:hover{background-color:var(--hover-color)}.component-search-input:not(:placeholder-shown)+.clear-search-button{opacity:1}.no-results{padding:32px 16px;text-align:center;color:var(--text-color-secondary);font-size:14px}#cmp-detail{position:relative}.cmp-loading{pointer-events:none!important}.cmp-loading-icon{position:absolute;display:inline-block;top:170px;left:0;width:100%;transform:translateZ(0);pointer-events:auto;opacity:0;transition:all 50ms ease-in-out;transition-delay:50ms;pointer-events:none}.cmp-loading .cmp-loading-icon{opacity:.5}.cmp-cover{position:absolute;top:160px;left:0;width:100%;height:100vh;background:var(--background-color);transform:translateZ(0);pointer-events:none;display:none}[data-view=nav-cmp-detail] .cmp-cover{display:block;pointer-events:auto}.cmp-enabled .cmp-cover{transform:translate3d(0,105%,0);pointer-events:none}.section-ready .cmp-cover{transition:all var(--transition-time) ease-in-out}.cmp-detail-inputs-container{margin:8px 0 16px;padding:0}.cmp-detail-inputs-container h3{margin:0 0 6px;padding-left:16px;padding-right:8px;font-size:14px;font-weight:500;display:flex;justify-content:space-between;align-items:center}.cmp-detail-inputs-reload{font-weight:300;font-size:.9em;text-decoration:none;appearance:none;text-align:left;background-color:transparent;border:none;color:var(--primary-color);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cmp-detail-inputs-reload:hover{text-decoration:underline;color:var(--primary-color)}.cmp-detail-inputs-container .cmp-inputs-empty{padding:0;margin-top:12px;font-size:12px;font-weight:300;opacity:.5;font-style:italic}.cmp-detail-inputs-container .nav-list-item-icon{opacity:.8;background-size:20px 20px;background-position:4px center}.input-icon{background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path></svg>')}.input-icon-array{background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M10 16v-6a2 2 0 1 1 4 0v6"></path> <path d="M10 13h4"></path></svg>')}.input-icon-boolean{background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M10 16h2a2 2 0 1 0 0 -4h-2h2a2 2 0 1 0 0 -4h-2v8z"></path></svg>')}.input-icon-number{background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M10 16v-8l4 8v-8"></path></svg>')}.input-icon-object{background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M12 8a2 2 0 0 1 2 2v4a2 2 0 1 1 -4 0v-4a2 2 0 0 1 2 -2z"></path></svg>')}.input-icon-string{background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> <path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0"></path> <path d="M10 15a1 1 0 0 0 1 1h2a1 1 0 0 0 1 -1v-2a1 1 0 0 0 -1 -1h-2a1 1 0 0 1 -1 -1v-2a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1"></path></svg>')}.cmp-input-item-unregistered{opacity:.4}.cmp-input-item-unregistered .input-icon:after{content:"";position:absolute;top:11px;left:4px;width:20px;height:2px;background-color:#000;transform:rotate(-45deg)}.cmp-prop-info{border-bottom:1px solid var(--border-color)}.cmp-input-readonly{margin:16px 0;padding:0 16px;display:grid;grid-template-columns:50% 50%;gap:12px}.cmp-input-readonly h3{margin:0;font-size:14px;font-weight:500}.cmp-input-readonly span{margin-top:2px;font-size:12px;font-weight:300;opacity:.8}.cmp-input-detail{margin:16px 0}.cmp-input-detail a{color:var(--primary-color);text-decoration:none}.cmp-input-detail a:hover{text-decoration:underline}.input-cover{position:absolute;top:175px;left:0;width:100%;height:100%;background:var(--background-color);transform:translateZ(0);transition:all var(--transition-time) ease-in-out;pointer-events:auto}.input-enabled .input-cover{transform:translate3d(0,105%,0);pointer-events:none}.input-loading-icon{position:absolute;display:inline-block;top:190px;left:0;width:100%;transform:translateZ(0);pointer-events:auto;opacity:0;transition:all 50ms ease-in-out;transition-delay:50ms;pointer-events:none}.input-loading .input-loading-icon{opacity:.5}:host{position:fixed;inset:0;z-index:2147483646;user-select:none;pointer-events:none;color:var(--text-color)}aside{position:absolute;top:0;right:0;width:var(--menu-width);height:100%;transform:translate3d(105%,0,0);transition:transform var(--transition-time) ease-in-out;background:var(--background-color);box-shadow:#000000c9 5px 0 20px;overflow:hidden;z-index:1}:host(.show-builder-menu) aside{pointer-events:auto;transform:translateZ(0)}#hit{position:absolute;inset:0;display:none}:host(.show-builder-menu) #hit{display:block;pointer-events:auto}#version{position:absolute;bottom:6px;right:6px;font-size:8px;color:#9b9b9b}</style><div id="hit"></div> <aside data-view="nav-home"> <section class="nav-home"> <header> <svg class="builder-logo" viewBox="0 0 31 36" fill="none" xmlns="http://www.w3.org/2000/svg" > <path d="M31 9.96854C31.0016 11.4553 30.6701 12.9236 30.03 14.2654C29.3898 15.6072 28.4572 16.7884 27.3007 17.7221L0.702841 2.61812C0.601104 2.56012 0.506714 2.49008 0.421705 2.40951C0.288323 2.27871 0.182333 2.12263 0.109928 1.95039C0.0375215 1.77814 0.000151253 1.59319 0 1.40633C0 1.03335 0.148098 0.675643 0.411715 0.411905C0.675332 0.148167 1.03287 0 1.40568 0L21.036 0C23.6786 0 26.213 1.05025 28.0816 2.91972C29.9502 4.78918 31 7.32472 31 9.96854Z" fill="#18B4F4" /> <path d="M31 25.4757C31.0004 26.7849 30.7429 28.0815 30.2423 29.2912C29.7417 30.5009 29.0078 31.6001 28.0825 32.526C27.1572 33.4519 26.0587 34.1864 24.8497 34.6875C23.6406 35.1886 22.3448 35.4465 21.0361 35.4465H1.40573C1.12766 35.4436 0.856725 35.3581 0.627199 35.201C0.397672 35.044 0.219871 34.8223 0.116289 34.5641C0.0127078 34.3059 -0.011999 34.0228 0.0452946 33.7505C0.102588 33.4783 0.239308 33.2292 0.438156 33.0347C0.517415 32.9551 0.606358 32.8858 0.702893 32.8284L11.1705 26.8843L27.2984 17.7244C28.4548 18.6579 29.3874 19.8387 30.028 21.18C30.6685 22.5213 31.0007 23.9891 31 25.4757Z" fill="#FD6B3C" /> <path d="M27.3011 17.7221L11.1709 26.8843L0.703209 32.8284C0.602697 32.8843 0.509784 32.9528 0.426758 33.0323C4.41799 28.9369 6.6496 23.442 6.64456 17.7221C6.65208 12.0015 4.42111 6.50517 0.429101 2.40948C0.51411 2.49005 0.6085 2.56009 0.710237 2.61809L27.3011 17.7221Z" fill="#A97FF2" /> </svg> <div> <h2 class="builder-home-title">Builder Devtools</h2> <p><button id="go-to-builder">Go to Builder</button></p> </div> <button id="close" aria-label="Close Menu"> <svg viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" > <path stroke="none" d="M0 0h24v24H0z" fill="none" /> <path d="M18 6l-12 12" /> <path d="M6 6l12 12" /> </svg> </button> </header> <div class="section-content"> <ul class="list"> <li> <button id="components-link"> <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" > <path d="M21 16.008V7.99001C20.9994 7.64108 20.9066 7.29851 20.731 6.99699C20.5554 6.69547 20.3032 6.44571 20 6.27301L13 2.26501C12.6954 2.09103 12.3508 1.99951 12 1.99951C11.6492 1.99951 11.3046 2.09103 11 2.26501L4 6.27301C3.381 6.62801 3 7.28301 3 7.99101V16.009C3 16.718 3.381 17.372 4 17.726L11 21.734C11.3046 21.908 11.6492 21.9995 12 21.9995C12.3508 21.9995 12.6954 21.908 13 21.734L20 17.726C20.619 17.371 21 16.716 21 16.008Z" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M12 22V12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M12 12L20.73 6.95996" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M3.26999 6.95996L12 12" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> </svg> <span>Components</span> </button> </li> <li> <button id="settings-link"> <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" > <path d="M10.325 4.317C10.751 2.561 13.249 2.561 13.675 4.317C13.7389 4.5808 13.8642 4.82578 14.0407 5.032C14.2172 5.23822 14.4399 5.39985 14.6907 5.50375C14.9414 5.60764 15.2132 5.65085 15.4838 5.62987C15.7544 5.60889 16.0162 5.5243 16.248 5.383C17.791 4.443 19.558 6.209 18.618 7.753C18.4769 7.98466 18.3924 8.24634 18.3715 8.51677C18.3506 8.78721 18.3938 9.05877 18.4975 9.30938C18.6013 9.55999 18.7627 9.78258 18.9687 9.95905C19.1747 10.1355 19.4194 10.2609 19.683 10.325C21.439 10.751 21.439 13.249 19.683 13.675C19.4192 13.7389 19.1742 13.8642 18.968 14.0407C18.7618 14.2172 18.6001 14.4399 18.4963 14.6907C18.3924 14.9414 18.3491 15.2132 18.3701 15.4838C18.3911 15.7544 18.4757 16.0162 18.617 16.248C19.557 17.791 17.791 19.558 16.247 18.618C16.0153 18.4769 15.7537 18.3924 15.4832 18.3715C15.2128 18.3506 14.9412 18.3938 14.6906 18.4975C14.44 18.6013 14.2174 18.7627 14.0409 18.9687C13.8645 19.1747 13.7391 19.4194 13.675 19.683C13.249 21.439 10.751 21.439 10.325 19.683C10.2611 19.4192 10.1358 19.1742 9.95929 18.968C9.7828 18.7618 9.56011 18.6001 9.30935 18.4963C9.05859 18.3924 8.78683 18.3491 8.51621 18.3701C8.24559 18.3911 7.98375 18.4757 7.752 18.617C6.209 19.557 4.442 17.791 5.382 16.247C5.5231 16.0153 5.60755 15.7537 5.62848 15.4832C5.64942 15.2128 5.60624 14.9412 5.50247 14.6906C5.3987 14.44 5.23726 14.2174 5.03127 14.0409C4.82529 13.8645 4.58056 13.7391 4.317 13.675C2.561 13.249 2.561 10.751 4.317 10.325C4.5808 10.2611 4.82578 10.1358 5.032 9.95929C5.23822 9.7828 5.39985 9.56011 5.50375 9.30935C5.60764 9.05859 5.65085 8.78683 5.62987 8.51621C5.60889 8.24559 5.5243 7.98375 5.383 7.752C4.443 6.209 6.209 4.442 7.753 5.382C8.753 5.99 10.049 5.452 10.325 4.317Z" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> <path d="M9 12C9 12.7956 9.31607 13.5587 9.87868 14.1213C10.4413 14.6839 11.2044 15 12 15C12.7956 15 13.5587 14.6839 14.1213 14.1213C14.6839 13.5587 15 12.7956 15 12C15 11.2044 14.6839 10.4413 14.1213 9.87868C13.5587 9.31607 12.7956 9 12 9C11.2044 9 10.4413 9.31607 9.87868 9.87868C9.31607 10.4413 9 11.2044 9 12Z" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" /> </svg> <span>Settings</span> </button> </li> <li> <button id="add-page-link"> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" > <path stroke="none" d="M0 0h24v24H0z" fill="none" /> <path d="M14 3v4a1 1 0 0 0 1 1h4" /> <path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z" /> <path d="M12 11l0 6" /> <path d="M9 14l6 0" /> </svg> <span>Add Builder Page</span> </button> </li> <li> <button id="import-from-figma"> <svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-brand-figma" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round" > <path stroke="none" d="M0 0h24v24H0z" fill="none" /> <path d="M15 12m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0" /> <path d="M6 3m0 3a3 3 0 0 1 3 -3h6a3 3 0 0 1 3 3v0a3 3 0 0 1 -3 3h-6a3 3 0 0 1 -3 -3z" /> <path d="M9 9a3 3 0 0 0 0 6h3m-3 0a3 3 0 1 0 3 3v-15" /> </svg> <span>Import From Figma</span> </button> </li> </ul> </div> <footer> <ul class="list"> <li> <a href="https://docs.google.com/forms/d/e/1FAIpQLSdqZcJpRtm_Ia5DTHP6SDY9Xa6LID3KiTjRWkjMzWyJRUtSHw/viewform" target="_blank" > <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" > <path d="M11.013 17.0114L10.013 18.0114L2.513 10.5834C2.0183 10.102 1.62864 9.52342 1.36854 8.88404C1.10845 8.24466 0.983558 7.55836 1.00173 6.86834C1.01991 6.17832 1.18076 5.49954 1.47415 4.87474C1.76755 4.24994 2.18713 3.69266 2.70648 3.23799C3.22583 2.78331 3.8337 2.4411 4.49181 2.23289C5.14991 2.02468 5.844 1.95499 6.53036 2.02821C7.21673 2.10143 7.8805 2.31596 8.47987 2.65831C9.07925 3.00066 9.60124 3.46341 10.013 4.01741C10.8086 2.95654 11.9931 2.2552 13.3059 2.06766C14.6186 1.88012 15.9521 2.22176 17.013 3.01741C18.0739 3.81306 18.7752 4.99755 18.9627 6.3103C19.1503 7.62305 18.8086 8.95654 18.013 10.0174" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /> <path d="M18.2006 19.8175L16.0286 20.9555C15.9642 20.989 15.8917 21.004 15.8192 20.9987C15.7467 20.9934 15.6771 20.9681 15.6182 20.9256C15.5593 20.8831 15.5134 20.825 15.4855 20.7579C15.4577 20.6907 15.4491 20.6172 15.4606 20.5455L15.8756 18.1345L14.1186 16.4275C14.0662 16.3768 14.0291 16.3123 14.0115 16.2416C13.9939 16.1708 13.9966 16.0965 14.0192 16.0271C14.0418 15.9578 14.0835 15.8962 14.1394 15.8494C14.1954 15.8026 14.2634 15.7725 14.3356 15.7625L16.7636 15.4105L17.8496 13.2175C17.8821 13.1521 17.9322 13.0972 17.9942 13.0588C18.0562 13.0204 18.1277 13 18.2006 13C18.2736 13 18.3451 13.0204 18.4071 13.0588C18.4691 13.0972 18.5191 13.1521 18.5516 13.2175L19.6376 15.4105L22.0656 15.7625C22.1377 15.7728 22.2054 15.8031 22.2611 15.85C22.3168 15.8968 22.3583 15.9583 22.3809 16.0275C22.4034 16.0967 22.4062 16.1708 22.3888 16.2415C22.3715 16.3122 22.3347 16.3766 22.2826 16.4275L20.5256 18.1345L20.9396 20.5445C20.9521 20.6163 20.9441 20.6902 20.9166 20.7578C20.8891 20.8254 20.8433 20.8839 20.7842 20.9267C20.7252 20.9695 20.6553 20.9949 20.5825 21C20.5098 21.005 20.4371 20.9896 20.3726 20.9555L18.2006 19.8175Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" /> </svg> <span>Give Feedback</span> </a> </li> </ul> <div id="version"></div> </footer> </section> <section class="nav-cmp-list"> <header> <button class="back-button"> <svg viewBox="0 0 24 24"> <path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" /> </svg> </button> <div class="search-container"> <div class="search-input-wrapper"> <svg class="search-icon" viewBox="0 0 24 24" width="16" height="16"> <path fill="none" stroke="currentColor" stroke-width="2" d="M15.5 15.5L20 20M10 17C6.13401 17 3 13.866 3 10C3 6.13401 6.13401 3 10 3C13.866 3 17 6.13401 17 10C17 13.866 13.866 17 10 17Z" /> </svg> <input type="text" id="component-search" class="component-search-input" placeholder="Search components..." autocomplete="off" spellcheck="false" /> <button id="clear-search" class="clear-search-button" type="button" aria-label="Clear search" > <svg viewBox="0 0 24 24" width="16" height="16"> <path fill="none" stroke="currentColor" stroke-width="2" d="M6 6l12 12M6 18L18 6" /> </svg> </button> </div> </div> <div> <h2>Custom Components</h2> <p> <button id="open-builder-registry"></button> </p> </div> </header> <div class="section-content"> <div id="cmp-list" class="cmp-list nav-list"></div> </div> <div class="nav-loading-icon spinner"></div> <footer> <p class="info"> Expand on Builder's selection of built-in blocks by <a target="_blank" href="https://www.builder.io/c/docs/custom-components-intro" >registering components</a > from your codebase. This way, teammates can drag and drop your components within Builder's Visual Editor just like any other block. </p> </footer> </section> <section class="nav-cmp-detail"> <header> <button class="back-button" data-back="nav-cmp-list"> <svg viewBox="0 0 24 24"> <path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" /> </svg> </button> <div> <h2 id="cmp-detail-title"></h2> <p> <button id="cmp-open-source"></button> </p> </div> </header> <div class="section-content"> <div id="cmp-error"></div> <label class="ui-switch"> <div> <h3>Register Component</h3> <p> Registers this component so it can be used within Builder Visual CMS </p> </div> <input type="checkbox" role="switch" id="cmp-register" /> <span class="switcher"></span> </label> <div id="cmp-detail"> <label class="ui-text-input"> <h3>Component Name</h3> <div class="input"> <input type="text" id="cmp-name" autocapitalize="off" autocorrect="off" spellcheck="false" autocomplete="off" minlength="2" maxlength="30" required placeholder="e.g. My Counter" /> </div> <p> Unique name to identify this custom component within Builder. Press ESC to cancel </p> </label> <div class="cmp-detail-inputs-container"> <h3> <span>Builder Inputs (Props)</span> <button class="cmp-detail-inputs-reload" id="btn-inputs-reload"> Reload </button> </h3> <div id="cmp-detail-inputs"></div> </div> </div> </div> <div class="cmp-cover"></div> <div class="cmp-loading-icon spinner"></div> </section> <section class="nav-cmp-input"> <header> <button class="back-button" data-back="nav-cmp-detail"> <svg viewBox="0 0 24 24"> <path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" /> </svg> </button> <div> <h2 id="cmp-input-title"></h2> <p> <button id="input-open-source"></button> </p> </div> </header> <div class="section-content"> <label class="ui-switch"> <div> <h3>Enable Input</h3> <p>Add this component prop as a Builder input</p> </div> <input type="checkbox" role="switch" id="input-register" /> <span class="switcher"></span> </label> <div class="cmp-prop-info"> <div class="cmp-input-readonly"> <h3>Prop Name</h3> <span id="cmp-prop-name"></span> </div> <div class="cmp-input-readonly"> <h3>Prop Type</h3> <span id="cmp-prop-type"></span> </div> </div> <div class="cmp-input-detail"> <label class="ui-text-input"> <h3>Builder Input Name</h3> <div class="input"> <input type="text" id="input-name" autocapitalize="off" autocorrect="off" spellcheck="false" autocomplete="off" minlength="1" maxlength="30" required placeholder="e.g. Text" /> </div> <p> Friendly name to identify this component prop as a Builder input. Press ESC to cancel </p> </label> <label class="ui-select"> <h3>Builder Input Type</h3> <div class="select"> <select id="input-type"></select> </div> <p> Correlate to what editing UI is appropriate for this Builder input. <a href="https://www.builder.io/c/docs/custom-components-input-types" target="_blank" >Read more about input types.</a > </p> </label> </div> <div class="input-cover"></div> <div class="input-loading-icon spinner"></div> </div> </section> <section class="nav-settings"> <header> <button class="back-button"> <svg viewBox="0 0 24 24"> <path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" /> </svg> </button> <div> <h2>Settings</h2> <p>Configure Builder's Devtools</p> </div> </header> <div class="section-content"> <label class="ui-switch"> <div> <h3>Enable edit button in UI</h3> <p>Enables the edit button so you can edit content in Builder</p> </div> <input type="checkbox" role="switch" id="enable-edit" /> <span class="switcher"></span> </label> </div> </section> <div class="ui-toast" id="toast"></div> </aside> <button class="menu-toggle" aria-label="Toggle Builder Devtools"> <div> <div class="highlight-bg"></div> <svg viewBox="0 0 31 36" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M31 9.96854C31.0016 11.4553 30.6701 12.9236 30.03 14.2654C29.3898 15.6072 28.4572 16.7884 27.3007 17.7221L0.702841 2.61812C0.601104 2.56012 0.506714 2.49008 0.421705 2.40951C0.288323 2.27871 0.182333 2.12263 0.109928 1.95039C0.0375215 1.77814 0.000151253 1.59319 0 1.40633C0 1.03335 0.148098 0.675643 0.411715 0.411905C0.675332 0.148167 1.03287 0 1.40568 0L21.036 0C23.6786 0 26.213 1.05025 28.0816 2.91972C29.9502 4.78918 31 7.32472 31 9.96854Z" fill="#18B4F4" /> <path d="M31 25.4757C31.0004 26.7849 30.7429 28.0815 30.2423 29.2912C29.7417 30.5009 29.0078 31.6001 28.0825 32.526C27.1572 33.4519 26.0587 34.1864 24.8497 34.6875C23.6406 35.1886 22.3448 35.4465 21.0361 35.4465H1.40573C1.12766 35.4436 0.856725 35.3581 0.627199 35.201C0.397672 35.044 0.219871 34.8223 0.116289 34.5641C0.0127078 34.3059 -0.011999 34.0228 0.0452946 33.7505C0.102588 33.4783 0.239308 33.2292 0.438156 33.0347C0.517415 32.9551 0.606358 32.8858 0.702893 32.8284L11.1705 26.8843L27.2984 17.7244C28.4548 18.6579 29.3874 19.8387 30.028 21.18C30.6685 22.5213 31.0007 23.9891 31 25.4757Z" fill="#FD6B3C" /> <path d="M27.3011 17.7221L11.1709 26.8843L0.703209 32.8284C0.602697 32.8843 0.509784 32.9528 0.426758 33.0323C4.41799 28.9369 6.6496 23.442 6.64456 17.7221C6.65208 12.0015 4.42111 6.50517 0.429101 2.40948C0.51411 2.49005 0.6085 2.56009 0.710237 2.61809L27.3011 17.7221Z" fill="#A97FF2" /> </svg> </div> </button>\`,Nr(e),Br(e),Ur(e),Ar(e),Dr(e),Fr(e),this.setAttribute("aria-hidden","true"),e.getElementById("version").textContent="v1.5.14"}highlightOpener(){let e=this.shadowRoot.querySelector(".menu-toggle");e.classList.add("menu-toggle-highlight"),e.classList.add("menu-toggle-highlight-no-transition"),setTimeout(()=>{e.classList.remove("menu-toggle-highlight-no-transition"),setTimeout(()=>{e.classList.remove("menu-toggle-highlight")},20)},20)}};var ki=\`<style>*,*:before,*:after{box-sizing:border-box}html,body,:host{position:fixed;top:0;left:0;width:100%;height:100vh;z-index:2147483646;margin:0;padding:0;line-height:1.8;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";background-color:#252525;color:#fff;transition:opacity .25s ease-in-out}:host([aria-hidden="true"]){opacity:0;pointer-events:none}main{position:absolute;top:0;left:0;width:100%;height:100vh}h1{margin-top:0;font-size:24px;font-weight:300;line-height:1.4}p{margin:20px 0;font-weight:300}button{cursor:pointer}aside{position:absolute;top:0;left:0;width:350px;height:100vh;padding:60px 0 0 50px;background-color:#121212}aside ul{margin:30px 0 0;padding:0;list-style:none}aside li{position:relative;margin:0;padding:20px 10px;font-weight:300}aside li.highlight{color:#48a1ff}aside li.active{font-weight:700}aside li .circle{position:absolute;top:20px;left:10px;width:24px;height:24px;border:3px solid white;border-radius:50%;font-size:14px}aside li.highlight .circle{border-color:#48a1ff}aside li.active .circle:after{content:"";position:absolute;top:3px;left:3px;width:12px;height:12px;border-radius:50%;background-color:#48a1ff}aside li.completed .circle{background-color:#48a1ff}aside li.completed .circle:after{content:"";position:absolute;top:2px;left:6px;width:6px;height:13px;border:3px solid black;border-top:none;border-left:none;transform:rotate(45deg)}aside li .line{position:absolute;top:44px;left:21px;width:3px;height:45px;background-color:#fff}aside li.completed .line{background-color:#48a1ff}aside li span{display:block;margin-left:44px}nav{margin-top:30px}section{position:absolute;top:135px;left:350px;padding:0 80px 0 140px;transition:opacity .15s ease-in-out}section[aria-hidden=true]{pointer-events:none;opacity:0}section h1,section p{min-width:300px;max-width:600px}.button{position:relative;display:inline-block;color:#fff;background-color:#48a1ff;border-radius:4px;text-decoration:none;padding:10px 40px 10px 20px;white-space:nowrap}.button:hover{background-color:#48a1ffd9}#button-icon{position:absolute;top:1px;right:5px;bottom:0;width:30px;background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="none" stroke="white" stroke-linecap="square" stroke-miterlimit="10" stroke-width="48" d="M184 112l144 144-144 144"/></svg>');background-repeat:no-repeat;background-position:center;background-size:24px 24px}.button[aria-disabled=true]{opacity:.9;background-color:#ffffff4d;pointer-events:none;padding-right:60px}.button[aria-disabled=true] #button-icon{top:21px;right:29px;width:8px;height:8px;border-radius:4px;background:#fff;color:#fff;animation:dot-flashing .5s infinite linear alternate;animation-delay:.25s}.button[aria-disabled=true] #button-icon:before,.button[aria-disabled=true] #button-icon:after{content:"";display:inline-block;position:absolute;top:0}.button[aria-disabled=true] #button-icon:before{left:-12px;width:8px;height:8px;border-radius:4px;background-color:#fff;color:#fff;animation:dot-flashing .5s infinite alternate;animation-delay:0s}.button[aria-disabled=true] #button-icon:after{left:12px;width:8px;height:8px;border-radius:4px;background-color:#fff;color:#fff;animation:dot-flashing .5s infinite alternate;animation-delay:.5s}@keyframes dot-flashing{0%{background-color:#fff}50%,to{background-color:#ffffff4d}}.logo{margin-left:9px;background:url('data:image/svg+xml,<svg viewBox="0 0 150 32" fill="none" xmlns="http://www.w3.org/2000/svg" > <g clip-path="url(%23clip0_4_304)"> <path d="M27.9858 8.99927C27.9872 10.3415 27.688 11.667 27.1101 12.8783C26.5321 14.0896 25.6902 15.156 24.6462 15.9989V15.9989L0.634502 2.36355C0.542657 2.31119 0.457444 2.24796 0.380701 2.17523C0.260289 2.05715 0.164605 1.91624 0.0992389 1.76075C0.0338732 1.60525 0.000136546 1.43828 0 1.26959C0 0.932873 0.133698 0.609948 0.371683 0.371854C0.609667 0.13376 0.932443 0 1.269 0L18.9906 0C21.3763 0 23.6642 0.948135 25.3512 2.63583C27.0381 4.32352 27.9858 6.61252 27.9858 8.99927V8.99927Z" fill="%2318B4F4" /> <path d="M27.9858 22.9986C27.9861 24.1806 27.7536 25.351 27.3017 26.4431C26.8498 27.5352 26.1873 28.5275 25.352 29.3634C24.5167 30.1993 23.5249 30.8624 22.4335 31.3147C21.342 31.7671 20.1721 32 18.9907 32H1.26906C1.01802 31.9973 0.77343 31.9202 0.566221 31.7784C0.359012 31.6366 0.198499 31.4364 0.104989 31.2034C0.0114791 30.9703 -0.0108254 30.7147 0.0408974 30.4689C0.0926201 30.2231 0.216046 29.9982 0.395559 29.8226V29.8226C0.467112 29.7508 0.547407 29.6882 0.634555 29.6364L10.0844 24.2703L24.6441 16.001C25.688 16.8438 26.53 17.9097 27.1083 19.1206C27.6866 20.3315 27.9864 21.6566 27.9858 22.9986V22.9986Z" fill="%23FD6B3C" /> <path d="M24.6461 15.9989L10.0843 24.2703L0.634458 29.6365C0.54372 29.6868 0.459841 29.7487 0.384888 29.8205C3.98804 26.1233 6.00266 21.1627 5.99812 15.9989C6.0049 10.8346 3.99085 5.87268 0.387003 2.17523C0.463746 2.24796 0.548959 2.31119 0.640803 2.36355L24.6461 15.9989Z" fill="%23A97FF2" /> <path d="M47.6659 11.7352C51.8177 11.7352 54.1632 15.0531 54.1632 19.0714C54.1632 23.0896 51.8177 26.3821 47.6659 26.3821C45.5086 26.3821 43.8589 25.5188 42.9473 24.0545L42.5709 26.052H39.9736V6.77115H43.1884V13.8914C43.971 12.6959 45.5086 11.7352 47.6659 11.7352ZM47.0187 23.5488C49.4446 23.5488 50.9547 21.5809 50.9547 19.0714C50.9547 16.5089 49.4446 14.5664 47.0187 14.5664C44.5928 14.5664 43.0806 16.5047 43.0806 19.0714C43.0806 21.583 44.5653 23.5488 47.0187 23.5488V23.5488Z" fill="white" /> <path d="M65.4595 20.2859V12.0611H68.668V20.123C68.668 23.7202 67.0246 26.3821 62.4943 26.3821C57.9639 26.3821 56.3206 23.7117 56.3206 20.123V12.0611H59.529V20.2859C59.529 22.4696 60.5527 23.5488 62.49 23.5488C64.4274 23.5488 65.4595 22.4696 65.4595 20.2859Z" fill="white" /> <path d="M71.2355 7.74451C71.2247 7.46284 71.2724 7.18199 71.3755 6.91968C71.4787 6.65737 71.6351 6.41929 71.8348 6.22047C72.0345 6.02165 72.2732 5.8664 72.5359 5.76452C72.7986 5.66264 73.0796 5.61633 73.3611 5.62853C74.5793 5.62853 75.4571 6.50666 75.4571 7.75509C75.4571 9.00352 74.5793 9.8224 73.3611 9.8224C72.1428 9.8224 71.2355 8.9612 71.2355 7.74451Z" fill="white" /> <path d="M128.476 7.74451C128.465 7.46376 128.513 7.18383 128.615 6.92227C128.718 6.66071 128.873 6.42315 129.072 6.22449C129.27 6.02583 129.508 5.87035 129.769 5.7678C130.031 5.66524 130.31 5.61783 130.591 5.62852C131.809 5.62852 132.687 6.50666 132.687 7.75509C132.687 9.00352 131.809 9.8224 130.591 9.8224C129.373 9.8224 128.476 8.9612 128.476 7.74451Z" fill="white" /> <path d="M122.302 24.1031C122.291 23.8223 122.339 23.5422 122.441 23.2805C122.543 23.0188 122.699 22.7811 122.897 22.5824C123.096 22.3837 123.334 22.2282 123.595 22.1258C123.857 22.0233 124.137 21.9761 124.417 21.9872C125.636 21.9872 126.513 22.8653 126.513 24.1031C126.513 25.341 125.636 26.1726 124.417 26.1726C123.199 26.1726 122.302 25.3219 122.302 24.1031Z" fill="white" /> <path d="M74.9516 12.059H71.7432V26.0583H74.9516V12.059Z" fill="white" /> <path d="M78.16 26.0583V6.77115H81.3685V26.0626L78.16 26.0583Z" fill="white" /> <path d="M94.6063 6.77115H97.8148V26.0626H95.2239L94.8474 24.0651C93.9591 25.523 92.3094 26.3927 90.131 26.3927C86.0046 26.3927 83.6591 23.0748 83.6591 19.0819C83.6591 15.0891 86.0046 11.7458 90.131 11.7458C92.3137 11.7458 93.8238 12.7149 94.6063 13.902V6.77115ZM90.7993 14.5707C88.3734 14.5707 86.8633 16.5131 86.8633 19.0756C86.8633 21.5851 88.3734 23.553 90.7993 23.553C93.2252 23.553 94.7354 21.5851 94.7354 19.0756C94.7396 16.5047 93.257 14.5664 90.8036 14.5664L90.7993 14.5707Z" fill="white" /> <path d="M113.479 22.2284C112.482 24.7359 110.162 26.3821 107.117 26.3821C102.887 26.3821 100.137 23.225 100.137 19.0439C100.137 14.9706 102.942 11.7353 107.093 11.7353C111.245 11.7353 113.969 14.8902 113.969 18.991C113.982 19.3255 113.953 19.6604 113.883 19.9876H103.288C103.53 22.2009 104.959 23.6292 107.197 23.6292C108.735 23.6292 110.001 22.8738 110.594 21.473L113.479 22.2284ZM103.341 17.6156H110.784C110.513 15.6731 109.166 14.3506 107.089 14.3506C105.012 14.3506 103.665 15.7006 103.341 17.6156V17.6156Z" fill="white" /> <path d="M123.779 14.9452C123.538 14.9117 123.295 14.8933 123.051 14.8902C120.786 14.8902 119.439 16.0772 119.439 18.7751V26.0583H116.23V12.0611H118.821L119.195 14.0014C119.707 13.1127 120.887 11.9257 123.322 11.9257C123.455 11.9257 123.779 11.9532 123.779 11.9532V14.9452Z" fill="white" /> <path d="M132.192 12.059H128.984V26.0583H132.192V12.059Z" fill="white" /> <path d="M134.483 19.0714C134.483 15.1335 137.287 11.7353 141.735 11.7353C146.183 11.7353 149.015 15.1335 149.015 19.0714C149.015 23.0092 146.213 26.3821 141.735 26.3821C137.258 26.3821 134.483 23.0092 134.483 19.0714ZM141.735 23.5488C144.083 23.5488 145.806 21.7692 145.806 19.0714C145.806 16.3735 144.083 14.5664 141.735 14.5664C139.387 14.5664 137.687 16.346 137.687 19.0714C137.687 21.7968 139.417 23.5488 141.735 23.5488V23.5488Z" fill="white" /> </g> <defs> <clipPath id="clip0_4_304"> <rect width="149.015" height="32" fill="white" /> </clipPath> </defs> </svg>');background-repeat:no-repeat;width:150px;height:32px}@media (max-width: 840px){aside{width:250px;padding:60px 0 0 20px}section{left:250px;padding:0 80px}}@media (max-width: 590px){aside{width:230px;padding:60px 0 0 10px}section{left:230px;padding:0 40px}}#modified-files-message a{color:#cbcbcb;font-weight:300;text-decoration:underline}#modified-files-message a:hover{color:#fff;text-decoration:none}#restart-warning{border-radius:4px;padding:8px 16px;border:1px solid #fd6b3c;background:#fd6b3c1a}#react-router-steps{margin:0 0 5px;padding:0 20px}#need-help{color:#48a1ff;text-decoration:none}#router-message{border-radius:4px;padding:16px;border:1px solid #48a1ff}#router-finish-button{margin-top:12px}#router-checkbox-div{display:flex;align-items:center}#router-checkbox{margin-right:10px;width:15px;height:15px}#success-title{display:flex;align-items:center;gap:10px}#success-title .check-icon{display:inline-block;width:24px;height:24px;border:2px solid #28a745;border-radius:50%;position:relative}#success-title .check-icon:before{content:"";position:absolute;top:50%;left:50%;width:6px;height:12px;border:solid #28a745;border-width:0 2px 2px 0;transform:translate(-50%,-60%) rotate(45deg)}
|
|
1131
1131
|
</style>\`,dt=class extends HTMLElement{constructor(){super()}connectedCallback(){let e=this.attachShadow({mode:"open"});e.innerHTML=ki+\`<main>
|
|
1132
1132
|
<aside>
|
|
1133
1133
|
<div class="logo"></div>
|
|
@@ -1166,7 +1166,7 @@ Visit https://www.docs.developers.amplitude.com/data/sdks/browser-2/#tracking-de
|
|
|
1166
1166
|
</nav>
|
|
1167
1167
|
</section>
|
|
1168
1168
|
</main>
|
|
1169
|
-
\`,Oi();let n=new URL(yn,Oe);n.searchParams.set(gn,location.href);let r=e.querySelectorAll(".next-step");for(let i of r)i.setAttribute("href",n.href);se("overview step viewed")}},Oi=()=>{let t=document.head.querySelector("link[rel='icon'], link[rel='icon shortcut']");t?(t.href="https://cdn.builder.io/favicon.ico",t.removeAttribute("type")):(t=document.createElement("link"),t.rel="icon",t.href="https://cdn.builder.io/favicon.ico",document.head.appendChild(t))};var Vr=async()=>{(await Tn()).isValid||Ui()},Ui=()=>{customElements.get("builder-dev-tools-overview")||customElements.define("builder-dev-tools-overview",dt);let t=document.querySelector("builder-dev-tools-overview");t||(t=document.createElement("builder-dev-tools-overview"),t.setAttribute("aria-hidden","true"),document.body.appendChild(t)),setTimeout(()=>{t.removeAttribute("aria-hidden")},32)};var Mi=()=>{try{customElements.get("builder-dev-tools-edit")||customElements.define("builder-dev-tools-edit",Ue),customElements.get("builder-dev-tools-menu")||customElements.define("builder-dev-tools-menu",lt);let t=document.querySelector("builder-dev-tools-menu");t||(t=document.createElement("builder-dev-tools-menu"),t.setAttribute("data-version","1.5.
|
|
1169
|
+
\`,Oi();let n=new URL(yn,Oe);n.searchParams.set(gn,location.href);let r=e.querySelectorAll(".next-step");for(let i of r)i.setAttribute("href",n.href);se("overview step viewed")}},Oi=()=>{let t=document.head.querySelector("link[rel='icon'], link[rel='icon shortcut']");t?(t.href="https://cdn.builder.io/favicon.ico",t.removeAttribute("type")):(t=document.createElement("link"),t.rel="icon",t.href="https://cdn.builder.io/favicon.ico",document.head.appendChild(t))};var Vr=async()=>{(await Tn()).isValid||Ui()},Ui=()=>{customElements.get("builder-dev-tools-overview")||customElements.define("builder-dev-tools-overview",dt);let t=document.querySelector("builder-dev-tools-overview");t||(t=document.createElement("builder-dev-tools-overview"),t.setAttribute("aria-hidden","true"),document.body.appendChild(t)),setTimeout(()=>{t.removeAttribute("aria-hidden")},32)};var Mi=()=>{try{customElements.get("builder-dev-tools-edit")||customElements.define("builder-dev-tools-edit",Ue),customElements.get("builder-dev-tools-menu")||customElements.define("builder-dev-tools-menu",lt);let t=document.querySelector("builder-dev-tools-menu");t||(t=document.createElement("builder-dev-tools-menu"),t.setAttribute("data-version","1.5.14"),document.body.appendChild(t));let e=document.querySelector("builder-dev-tools-edit");e||(e=document.createElement("builder-dev-tools-edit"),document.body.appendChild(e));let n=document.getElementById("builder-dev-tools-style");n||(n=document.createElement("style"),n.id="builder-dev-tools-style",n.innerHTML=".builder-no-scroll{overflow:hidden !important}",document.head.appendChild(n)),Vr(),Pr()}catch(t){console.error("Builder Devtools:",t)}};window.location===window.parent.location&&(console.debug("Builder.io Devtools v1.5.14"),Mi());})();`)}async function Bb(e){return Mb(e,`<!DOCTYPE html>
|
|
1170
1170
|
<html lang="en" dir="ltr">
|
|
1171
1171
|
<head>
|
|
1172
1172
|
<meta charset="utf-8" />
|
|
@@ -1332,12 +1332,12 @@ Visit https://www.docs.developers.amplitude.com/data/sdks/browser-2/#tracking-de
|
|
|
1332
1332
|
</script>
|
|
1333
1333
|
</body>
|
|
1334
1334
|
</html>
|
|
1335
|
-
`)}async function Mb(e,r){let t=await ef(e),n=e.getFrameworks();return r.replace(/__LOCAL_APP_ID__/g,t).replace(/__DEV_TOOLS_URL__/g,e.devToolsServerUrl).replace(/__CLIENT_ID__/g,e.getClientId()).replace(/__FRAMEWORK__/g,n.length?n[0].name:"")}var $b=require("node:os");async function Ub(e,r){let t=new URL("/cli-auth","https://builder.io");t.searchParams.set("client_id",e.getClientId()),t.searchParams.set("host",await e.getDeviceId()),t.searchParams.set("response_type","code"),t.searchParams.set("cli","true");let n=new URL(Mn,e.devToolsServerUrl);n.searchParams.set(wo,(0,$b.platform)()),n.searchParams.set(To,process.versions.node);let i=e.getFrameworks();return i.length>0&&(t.searchParams.set(pi,i[0].name),n.searchParams.set(pi,i[0].name)),t.searchParams.set("redirect_url",n.href),t.searchParams.set("preview_url",r),t.href}async function Kb(e,r,t,n){try{if(!e)return ns(t,n,400,"Builder context closed");let i=yI(t);if(i.pathname===_l){if(t.method==="POST"){let s=await gI(t);if(s)try{let o=await Rb(e,JSON.parse(s));return jb(t,n,200,o)}catch(o){e.debug("Dev API Error",o.stack||o.message||o);let a={errors:[String(o.message||o)]};return jb(t,n,500,a)}}else if(t.method==="OPTIONS"){let s={"Access-Control-Allow-Methods":"POST, OPTIONS","Access-Control-Allow-Headers":"Content-Type, Cache-Control, X-Builder-Devtools-Version"},o=t.headers.origin;o&&o!=="null"?Vb(new URL(o))&&(s["Access-Control-Allow-Origin"]=o):s["Access-Control-Allow-Origin"]="*",n.writeHead(200,s),n.end();return}return ns(t,n,405,`${_l} is an API endpoint used only during development by the Builder.io Devtools client-side script`)}if(i.pathname===kl)return fI(t,n,200,await Lb(e));if(i.pathname===Cd){let s=i.searchParams.get(Fl);return s?hI(n,302,await Ub(e,s)):ns(t,n,400,`Missing ${Fl} querystring`)}if(i.pathname===Mn)return mI(t,n,200,await Bb(e));if(i.pathname===Sd){await Lt(e,{_:[]},{});let s=await ai(e),{figmaBuilderLinks:o,foundErrors:a}=await fo({force:!0,mappingFiles:s,sys:e,print:!1});return po(t,n,200,"application/json",JSON.stringify({figmaBuilderLinks:o,foundErrors:a,version:2,local:!0},null,2))}return i.pathname===$n?(e.debug(`Close Dev Tools Server Requested: ${i.href}`),setTimeout(()=>{try{r.close(s=>{e.debug(`Dev Tools Server Closed Error: ${s}`)})}catch(s){e.debug(`Error closing devtools server: ${s}`)}},20),ns(t,n,200,"Closing Dev Tools Server")):ns(t,n,404,"Not found")}catch(i){return console.error("Dev Server Error",i),ns(t,n,500,`Dev Server Error: ${i}`)}}function jb(e,r,t,n){po(e,r,t,"application/json",JSON.stringify(n))}function fI(e,r,t,n){po(e,r,t,"application/javascript",n)}function mI(e,r,t,n){po(e,r,t,"text/html",n)}function ns(e,r,t,n){po(e,r,t,"text/plain",n)}function po(e,r,t,n,i){let s={"Content-Type":`${n}; charset=utf-8`,"Cache-Control":"no-cache, no-store, must-revalidate","X-Builder-Devtools-Version":"1.5.
|
|
1335
|
+
`)}async function Mb(e,r){let t=await ef(e),n=e.getFrameworks();return r.replace(/__LOCAL_APP_ID__/g,t).replace(/__DEV_TOOLS_URL__/g,e.devToolsServerUrl).replace(/__CLIENT_ID__/g,e.getClientId()).replace(/__FRAMEWORK__/g,n.length?n[0].name:"")}var $b=require("node:os");async function Ub(e,r){let t=new URL("/cli-auth","https://builder.io");t.searchParams.set("client_id",e.getClientId()),t.searchParams.set("host",await e.getDeviceId()),t.searchParams.set("response_type","code"),t.searchParams.set("cli","true");let n=new URL(Mn,e.devToolsServerUrl);n.searchParams.set(wo,(0,$b.platform)()),n.searchParams.set(To,process.versions.node);let i=e.getFrameworks();return i.length>0&&(t.searchParams.set(pi,i[0].name),n.searchParams.set(pi,i[0].name)),t.searchParams.set("redirect_url",n.href),t.searchParams.set("preview_url",r),t.href}async function Kb(e,r,t,n){try{if(!e)return ns(t,n,400,"Builder context closed");let i=yI(t);if(i.pathname===_l){if(t.method==="POST"){let s=await gI(t);if(s)try{let o=await Rb(e,JSON.parse(s));return jb(t,n,200,o)}catch(o){e.debug("Dev API Error",o.stack||o.message||o);let a={errors:[String(o.message||o)]};return jb(t,n,500,a)}}else if(t.method==="OPTIONS"){let s={"Access-Control-Allow-Methods":"POST, OPTIONS","Access-Control-Allow-Headers":"Content-Type, Cache-Control, X-Builder-Devtools-Version"},o=t.headers.origin;o&&o!=="null"?Vb(new URL(o))&&(s["Access-Control-Allow-Origin"]=o):s["Access-Control-Allow-Origin"]="*",n.writeHead(200,s),n.end();return}return ns(t,n,405,`${_l} is an API endpoint used only during development by the Builder.io Devtools client-side script`)}if(i.pathname===kl)return fI(t,n,200,await Lb(e));if(i.pathname===Cd){let s=i.searchParams.get(Fl);return s?hI(n,302,await Ub(e,s)):ns(t,n,400,`Missing ${Fl} querystring`)}if(i.pathname===Mn)return mI(t,n,200,await Bb(e));if(i.pathname===Sd){await Lt(e,{_:[]},{});let s=await ai(e),{figmaBuilderLinks:o,foundErrors:a}=await fo({force:!0,mappingFiles:s,sys:e,print:!1});return po(t,n,200,"application/json",JSON.stringify({figmaBuilderLinks:o,foundErrors:a,version:2,local:!0},null,2))}return i.pathname===$n?(e.debug(`Close Dev Tools Server Requested: ${i.href}`),setTimeout(()=>{try{r.close(s=>{e.debug(`Dev Tools Server Closed Error: ${s}`)})}catch(s){e.debug(`Error closing devtools server: ${s}`)}},20),ns(t,n,200,"Closing Dev Tools Server")):ns(t,n,404,"Not found")}catch(i){return console.error("Dev Server Error",i),ns(t,n,500,`Dev Server Error: ${i}`)}}function jb(e,r,t,n){po(e,r,t,"application/json",JSON.stringify(n))}function fI(e,r,t,n){po(e,r,t,"application/javascript",n)}function mI(e,r,t,n){po(e,r,t,"text/html",n)}function ns(e,r,t,n){po(e,r,t,"text/plain",n)}function po(e,r,t,n,i){let s={"Content-Type":`${n}; charset=utf-8`,"Cache-Control":"no-cache, no-store, must-revalidate","X-Builder-Devtools-Version":"1.5.14"},o=e.headers.origin;o&&o!=="null"?Vb(new URL(o))&&(s["Access-Control-Allow-Origin"]=o):s["Access-Control-Allow-Origin"]="*",r.writeHead(t,s),r.end(i)}function Vb(e){return e.hostname==="localhost"||e.origin==="https://builder.io"||e.origin==="https://www.builder.io"||e.origin.endsWith(".builder.io")?!0:e.port===""?!1:e.port!=="80"&&e.port!=="443"}function hI(e,r,t){e.writeHead(r,{Location:t}),e.end()}async function gI(e){let r="";for await(let t of e)r+=t;return r}function yI(e){let r=e.url||"/";return new URL(r,`http://${e.headers.host}`)}async function zb(e){if(globalThis.__builderDevToolsServer)return e.debug("reusing existing devtools server"),globalThis.__builderDevToolsServer.setContext(e),globalThis.__builderDevToolsServer;let r=await DI(e),t=(0,il.createServer)((i,s)=>{Kb(e,t,i,s)}),n=()=>new Promise((i,s)=>{t.listening?(e.debug(`closing devtools server on port ${r}`),t.close(o=>{e=null,o?(e.debug(`error closing devtools server on port ${r}`),s(o)):(e&&e.debug(`closed devtools server on port ${r}`),i())})):(e.debug(`devtools server on port ${r} not listening`),i())});return process.once("SIGTERM",n),process.once("SIGINT",n),process.env.CI!=="true"&&process.stdin.on("end",n),globalThis.__builderDevToolsServer={url:new URL(`http://localhost:${r}`).href,port:r,setContext:i=>{e.debug(`set devtools context on server ${r}`),e=i},close:async()=>{globalThis.__builderDevToolsServer=null,await n()}},new Promise(i=>{t.listen(r,()=>{e.debug(`started devtools server on port ${r}`),i(globalThis.__builderDevToolsServer)})})}function DI(e){return new Promise(r=>{let t=e.port;try{(0,il.request)({hostname:"localhost",port:t,path:$n,method:"GET"},i=>{i.on("end",()=>{e.debug(`${$n} - Response ended`),r(t)})}).on("error",i=>{e.debug(`${$n} - No response ${i}`),r(t)}).end()}catch(n){e.debug(`${$n} - Error ${n}`),r(t)}})}async function Pp(e){let r={getPastSyncInfo:()=>null,resyncSnippet:()=>null,...e,devToolsServerUrl:"",isValid:!1,publicApiKey:"",serverShouldRestart:!1,port:e.port||5273,ignoreMissingConfig:!1},t=e.getFrameworks().map(s=>s.name).join(", ");r.debug(`create devtools ${qb} [${t}]`);let n=await zb(r);return r.devToolsServerUrl=n.url,r.port=n.port,{getUrl:()=>r.devToolsServerUrl}}var qb="1.5.14";var br=require("node:path"),vt=require("node:fs");var kn=V(Ze(),1);async function Wb(e){console.log(""),ot((0,kn.bgCyan)((0,kn.bold)((0,kn.white)(" add ")))+" "+(0,kn.dim)(gt));let r=e.snippetId;if(!r&&!e.snippet)return he("SnippetId expected. npx builder.io add <snippetId>"),await ee(1);let t=hi(),n=e.snippet||null;if(!n&&r&&(t.start(`Fetching snippet ${r}`),n=await Ip(r),t.stop(`Fetched snippet ${r}`)),!n)return he(`No snippet found for id ${r}`),await ee(1);let i=process.cwd(),s=co(i)??i;if(n.files?.length>0){let o=Np(s,n.framework||"react"),a=e.path||await Mt({message:"Where should we copy the files?",initialValue:o,validate(u){if(u.length===0)return"File path is required!";if(u[0]!==".")return"Please enter a relative path."}});if(Me(a))return he("Cancelled sync"),await ee(0);let l=await sl(s,n,n.files,a,!1);return K.success("All files have been written successfully."),{snippet:n,pathInput:a,writtenFiles:l,timeStamp:Date.now()}}else{let{code:o,suggestedName:a,framework:l}=n;l&&(a=await xI(s,l,o)),a??(a="./src/components/MyComponent.jsx");let u=Gb(n,bI(n.code),n.framework);try{n.framework==="html"?u=await or(u,"html"):n.framework==="angular"?u=await or(u,"angular"):n.framework==="vue"?u=await or(u,"vue"):n.framework==="svelte"?u=await or(u,"html"):u=await or(u,"typescript")}catch{}let c=e.path;if(!c){try{let f=(await eb({cwd:process.cwd()})).getFrameworks();if(f.length>0){let m;if(f.some(h=>h.name.includes("qwik"))?m="qwik":f.some(h=>h.name.includes("react"))?m="react":m=f[0].name,n.framework&&n.framework!==m){let h=await wt({message:`This snippet is for ${n.framework}, but you are using ${m}. Continue?`,initialValue:!1});if(Me(h)||!h)return console.log("Please go back to builder and change the output framework to match your project."),console.log(),await ee(0)}}}catch{}if(c=await Mt({message:"Where should we copy the code?",initialValue:a?.startsWith("./")?a:`./${a}`,validate(d){if(d.length===0)return"File path is required!";if(d[0]!==".")return"Please enter a relative path."}}),Me(c))return console.log(""),await ee(0)}let p=(0,br.resolve)(s,c);K.info(`Writing code to ${p}`),(0,vt.mkdirSync)((0,br.dirname)(p),{recursive:!0}),(0,vt.writeFileSync)(p,u)}}function Ip(e){return nt(`https://cdn.builder.io/api/v1/snippet/${e}`).then(r=>r.status===404?null:r.json())}function bI(e){return e.replace(/^```jsx\s?|\s?```$/g,"").trim()}function Gb(e,r,t,n=!1){if(!t)return r;let i="This code was generated by Builder.io",s=n?`https://builder.io/content/${e.contentId}?codeSession=${e.sessionKey}&sid=${e.id}`:"",o=["vue","html","svelte"].includes(t.toLowerCase()),a=[i,s].filter(Boolean);return`${o?a.map(u=>`<!-- ${u} -->`).join(`
|
|
1336
1336
|
`):`/**
|
|
1337
1337
|
${a.map(u=>` * ${u}`).join(`
|
|
1338
1338
|
`)}
|
|
1339
1339
|
*/`}
|
|
1340
|
-
${r}`}async function xI(e,r,t){let n,i=CI(t,r.toLowerCase());switch(r.toLowerCase()){case"react":let s=await EI(e);n=`components/${i||"MyComponent"}.${s?"tsx":"jsx"}`;break;case"angular":n=`app/components/${i||"my-component"}.component.ts`;break;case"vue":n=`components/${i||"MyComponent"}.vue`;break;case"svelte":n=`components/${i||"MyComponent"}.svelte`;break;case"html":n=`${i||"my-design"}.html`;break;case"qwik":n=`components/${i||"MyComponent"}.tsx`;break;default:n=`components/${i||"MyComponent"}.tsx`}return n=(0,vt.existsSync)("./src")?`./src/${n}`:`./${n}`,n}async function EI(e){if((0,vt.existsSync)((0,br.join)(e,"./tsconfig.json")))return!0;let r=Dp(e);return r&&(0,vt.existsSync)((0,br.join)(r,"./package.json"))?(0,vt.readFileSync)((0,br.join)(r,"./package.json"),"utf-8").includes("typescript"):!1}function CI(e,r){let t={vue:/name:\s*'([^']+)'/,react:/function (\w+)\([\w\W]+\)/,qwik:/export const (\w+) = component\$/,angular:/selector:\s*'([^']+)'/};if(!t[r])return null;let n=e.match(t[r]);return r==="react"&&!n?.[1]?e.match(/const (\w+)[\w\W]+=\s*\(/)?.[1]||null:n?.[1]||null}async function sl(e,r,t,n,i){let s=[];for(let o of t){let a=SI(n,o.path),l=(0,br.resolve)(e,a);if("code"in o){let u=await TI(r,o.code,wI(o.path),i);(0,vt.mkdirSync)((0,br.dirname)(l),{recursive:!0}),(0,vt.writeFileSync)(l,u),s.push({...o,path:a,code:u,timestamp:(0,vt.statSync)(l).mtime.getTime()}),K.info(`Writing file to ${l}`)}else(0,vt.mkdirSync)(l,{recursive:!0}),s=s.concat(await sl(e,r,o.files,a,i))}return s}function SI(e,r){let t=e.replace(/^\.?\/+|\/+$/g,""),n=r.replace(/^\.?\/+|\/+$/g,""),i=t.split("/").filter(Boolean),s=n.split("/").filter(Boolean),o=-1;for(let l=0;l<i.length;l++){let u=s.indexOf(i[l]);u!==-1&&(o=u)}return[...i,...s.slice(o+1)].join("/")}function wI(e){switch(e.split(".").pop()?.toLowerCase()){case"html":case"svelte":return"html";case"vue":return"vue";case"ts":case"tsx":case"js":case"jsx":return"typescript";case"css":return"css";case"json":return"json";default:return"typescript"}}async function TI(e,r,t,n){let i=r;try{i=await or(r,t)}catch{}return n?Gb(e,i,t,n):i}function Np(e,r){let n=(0,vt.existsSync)((0,br.join)(e,"src"))?"src/":"";switch(r.toLowerCase()){case"angular":return`./${n}app/components/`;case"html":return"./";default:return`./${n}components/`}}var Yb=V(require("chokidar"),1),Xb=V(require("ignore"),1);function Qb(e){let r=e.match(/builder\.io\/content\/([^?]+)\?codeSession=([^&]+)&sid=([^\s]+)/);return r?{contentId:r[1],sessionKey:r[2],snippetId:r[3]}:{}}async function al(e){let r=Zb(e);return await(0,Fp.glob)("**/*",{cwd:e,ignore:{ignored(n){return r(n.relative())}},nodir:!0})}async function AI(e,r,t){let n=await(0,Fp.glob)("**/*",{cwd:e,ignore:["node_modules/**"],nodir:!0}),i=[];for(let s of n){let o=(0,Bt.resolve)(e,s);try{let a=(0,Kt.readFileSync)(o,"utf-8");if(a.includes("This code was generated by Builder.io")){let l=Qb(a);if(r&&t&&(l.contentId!==r||l.sessionKey!==t))continue;i.push({path:s,code:ol(a),name:s.split("/").pop()||"",timestamp:(0,Kt.statSync)(o).mtime.getTime(),snippetId:l.snippetId})}}catch(a){console.error(`Error reading file ${o}:`,a)}}return i}function vI(e,r){let t=Qb(e);return t.contentId===r.contentId&&t.sessionKey===r.sessionKey}function Zb(e){let r=["*.png","*.jpg","*.jpeg","*.gif","*.webp","*.yml","*.yaml","*.snap","*.liquid",".git",".DS_Store",".vscode","node_modules",".next","coverage","example","public","yarn.lock","pnpm-lock.yaml","__snapshots__","package-lock.json"],t=(0,Xb.default)().add(r);function n(i){try{let s=(0,Bt.resolve)(e,i);if((0,Kt.existsSync)(s)){let o=(0,Kt.readFileSync)(s,"utf8");t.add(o)}}catch(s){console.debug(`No ${i} found or error reading it:`,s)}}return n(".gitignore"),n(".prettierignore"),n(".builderignore"),i=>{let s=(0,Bt.relative)(e,i);if(!s)return!1;let o=s.split(Bt.sep).join("/");return t.ignores(o)}}function Hb(e,r,t){let n=Zb(e),i=Yb.default.watch(e,{ignored:n,ignoreInitial:!0,awaitWriteFinish:{stabilityThreshold:500,pollInterval:600},ignorePermissionErrors:!0,followSymlinks:!1,atomic:600}),s=async a=>{let l=(0,Bt.relative)(e,a);try{let u=(0,Kt.readFileSync)(a,"utf-8");if(vI(u,r.snippet)){let c=r.writtenFiles.find(p=>p.path===l);c?(c.code=ol(u),c.timestamp=Date.now()):r.writtenFiles.push({path:l,code:ol(u),timestamp:Date.now(),name:l.split("/").pop()||""}),r.timeStamp=Date.now(),t(r)}}catch(u){console.debug(`Error reading file ${a}:`,u)}};i.on("add",async a=>{K.info(`File added: ${a}`),await s(a)}).on("change",async a=>{K.info(`File changed: ${a}`),await s(a)}).on("unlink",a=>{K.info(`File deleted: ${a}`);let l=(0,Bt.relative)(e,a);r.writtenFiles=r.writtenFiles.filter(u=>u.path!==l),r.timeStamp=Date.now(),t(r)}).on("unlinkDir",a=>{K.info(`Folder deleted: ${a}`);let l=(0,Bt.relative)(e,a);r.writtenFiles=r.writtenFiles.filter(u=>!u.path.startsWith(l)),r.timeStamp=Date.now(),t(r)}).on("ready",()=>{console.debug("Initial scan complete. Ready for changes.")}).on("error",a=>{console.error(`Watcher error: ${a}`)}),i.on("raw",async(a,l,u)=>{if(a==="renamed"){K.info(`File renamed: ${u.oldPath} -> ${l}`);let c=u.oldPath?(0,Bt.relative)(e,u.oldPath):void 0,p=l?(0,Bt.relative)(e,l):void 0;if(c&&p){let d=r.writtenFiles.find(f=>f.path===c);d&&(d.path=p,r.timeStamp=Date.now(),t(r))}}});let o=async()=>{await i.close()};return process.on("SIGINT",o),process.on("SIGTERM",o),o}async function ex(e,r){e.debug("builder sync server init");let t=await wn(e),n=r,i=()=>Promise.resolve();n&&setTimeout(()=>{i=Hb(e.getAppRootDir(),n,s=>{n=s})},1e3),await Pp({...t,ensureFigmaImportPage:()=>Promise.reject("Not supported"),getPastSyncInfo:({sessionKey:s,since:o})=>!n||s!==n.snippet.sessionKey?null:{...n,hasChanged:n.timeStamp>o},resyncSnippet:async s=>{await i();let o=await _p({path:n?.pathInput,snippet:s.snippet,cwd:e.getAppRootDir()});return o&&(n=o,i=Hb(e.getAppRootDir(),n,a=>{n=a})),n},getClientId:()=>"builder-sync-cli",closeAppServer:async()=>{await i()},restartAppServer:async()=>{e.debug("restart server")},enableAppWatch:async s=>s,...e})}async function _p(e){let r=e.snippetId,t=e.snippet||null;if(!t&&r&&(t=await Ip(r)),!t)return
|
|
1340
|
+
${r}`}async function xI(e,r,t){let n,i=CI(t,r.toLowerCase());switch(r.toLowerCase()){case"react":let s=await EI(e);n=`components/${i||"MyComponent"}.${s?"tsx":"jsx"}`;break;case"angular":n=`app/components/${i||"my-component"}.component.ts`;break;case"vue":n=`components/${i||"MyComponent"}.vue`;break;case"svelte":n=`components/${i||"MyComponent"}.svelte`;break;case"html":n=`${i||"my-design"}.html`;break;case"qwik":n=`components/${i||"MyComponent"}.tsx`;break;default:n=`components/${i||"MyComponent"}.tsx`}return n=(0,vt.existsSync)("./src")?`./src/${n}`:`./${n}`,n}async function EI(e){if((0,vt.existsSync)((0,br.join)(e,"./tsconfig.json")))return!0;let r=Dp(e);return r&&(0,vt.existsSync)((0,br.join)(r,"./package.json"))?(0,vt.readFileSync)((0,br.join)(r,"./package.json"),"utf-8").includes("typescript"):!1}function CI(e,r){let t={vue:/name:\s*'([^']+)'/,react:/function (\w+)\([\w\W]+\)/,qwik:/export const (\w+) = component\$/,angular:/selector:\s*'([^']+)'/};if(!t[r])return null;let n=e.match(t[r]);return r==="react"&&!n?.[1]?e.match(/const (\w+)[\w\W]+=\s*\(/)?.[1]||null:n?.[1]||null}async function sl(e,r,t,n,i){let s=[];for(let o of t){let a=SI(n,o.path),l=(0,br.resolve)(e,a);if("code"in o){let u=await TI(r,o.code,wI(o.path),i);(0,vt.mkdirSync)((0,br.dirname)(l),{recursive:!0}),(0,vt.writeFileSync)(l,u),s.push({...o,path:a,code:u,timestamp:(0,vt.statSync)(l).mtime.getTime()}),K.info(`Writing file to ${l}`)}else(0,vt.mkdirSync)(l,{recursive:!0}),s=s.concat(await sl(e,r,o.files,a,i))}return s}function SI(e,r){let t=e.replace(/^\.?\/+|\/+$/g,""),n=r.replace(/^\.?\/+|\/+$/g,""),i=t.split("/").filter(Boolean),s=n.split("/").filter(Boolean),o=-1;for(let l=0;l<i.length;l++){let u=s.indexOf(i[l]);u!==-1&&(o=u)}return[...i,...s.slice(o+1)].join("/")}function wI(e){switch(e.split(".").pop()?.toLowerCase()){case"html":case"svelte":return"html";case"vue":return"vue";case"ts":case"tsx":case"js":case"jsx":return"typescript";case"css":return"css";case"json":return"json";default:return"typescript"}}async function TI(e,r,t,n){let i=r;try{i=await or(r,t)}catch{}return n?Gb(e,i,t,n):i}function Np(e,r){let n=(0,vt.existsSync)((0,br.join)(e,"src"))?"src/":"";switch(r.toLowerCase()){case"angular":return`./${n}app/components/`;case"html":return"./";default:return`./${n}components/`}}var Yb=V(require("chokidar"),1),Xb=V(require("ignore"),1);function Qb(e){let r=e.match(/builder\.io\/content\/([^?]+)\?codeSession=([^&]+)&sid=([^\s]+)/);return r?{contentId:r[1],sessionKey:r[2],snippetId:r[3]}:{}}async function al(e){let r=Zb(e);return await(0,Fp.glob)("**/*",{cwd:e,ignore:{ignored(n){return r(n.relative())}},nodir:!0})}async function AI(e,r,t){let n=await(0,Fp.glob)("**/*",{cwd:e,ignore:["node_modules/**"],nodir:!0}),i=[];for(let s of n){let o=(0,Bt.resolve)(e,s);try{let a=(0,Kt.readFileSync)(o,"utf-8");if(a.includes("This code was generated by Builder.io")){let l=Qb(a);if(r&&t&&(l.contentId!==r||l.sessionKey!==t))continue;i.push({path:s,code:ol(a),name:s.split("/").pop()||"",timestamp:(0,Kt.statSync)(o).mtime.getTime(),snippetId:l.snippetId})}}catch(a){console.error(`Error reading file ${o}:`,a)}}return i}function vI(e,r){let t=Qb(e);return t.contentId===r.contentId&&t.sessionKey===r.sessionKey}function Zb(e){let r=["*.png","*.jpg","*.jpeg","*.gif","*.webp","*.yml","*.yaml","*.snap","*.liquid",".git",".DS_Store",".vscode","node_modules",".next","coverage","example","public","yarn.lock","pnpm-lock.yaml","__snapshots__","package-lock.json"],t=(0,Xb.default)().add(r);function n(i){try{let s=(0,Bt.resolve)(e,i);if((0,Kt.existsSync)(s)){let o=(0,Kt.readFileSync)(s,"utf8");t.add(o)}}catch(s){console.debug(`No ${i} found or error reading it:`,s)}}return n(".gitignore"),n(".prettierignore"),n(".builderignore"),i=>{let s=(0,Bt.relative)(e,i);if(!s)return!1;let o=s.split(Bt.sep).join("/");return t.ignores(o)}}function Hb(e,r,t){let n=Zb(e),i=Yb.default.watch(e,{ignored:n,ignoreInitial:!0,awaitWriteFinish:{stabilityThreshold:500,pollInterval:600},ignorePermissionErrors:!0,followSymlinks:!1,atomic:600}),s=async a=>{let l=(0,Bt.relative)(e,a);try{let u=(0,Kt.readFileSync)(a,"utf-8");if(vI(u,r.snippet)){let c=r.writtenFiles.find(p=>p.path===l);c?(c.code=ol(u),c.timestamp=Date.now()):r.writtenFiles.push({path:l,code:ol(u),timestamp:Date.now(),name:l.split("/").pop()||""}),r.timeStamp=Date.now(),t(r)}}catch(u){console.debug(`Error reading file ${a}:`,u)}};i.on("add",async a=>{K.info(`File added: ${a}`),await s(a)}).on("change",async a=>{K.info(`File changed: ${a}`),await s(a)}).on("unlink",a=>{K.info(`File deleted: ${a}`);let l=(0,Bt.relative)(e,a);r.writtenFiles=r.writtenFiles.filter(u=>u.path!==l),r.timeStamp=Date.now(),t(r)}).on("unlinkDir",a=>{K.info(`Folder deleted: ${a}`);let l=(0,Bt.relative)(e,a);r.writtenFiles=r.writtenFiles.filter(u=>!u.path.startsWith(l)),r.timeStamp=Date.now(),t(r)}).on("ready",()=>{console.debug("Initial scan complete. Ready for changes.")}).on("error",a=>{console.error(`Watcher error: ${a}`)}),i.on("raw",async(a,l,u)=>{if(a==="renamed"){K.info(`File renamed: ${u.oldPath} -> ${l}`);let c=u.oldPath?(0,Bt.relative)(e,u.oldPath):void 0,p=l?(0,Bt.relative)(e,l):void 0;if(c&&p){let d=r.writtenFiles.find(f=>f.path===c);d&&(d.path=p,r.timeStamp=Date.now(),t(r))}}});let o=async()=>{await i.close()};return process.on("SIGINT",o),process.on("SIGTERM",o),o}async function ex(e,r){e.debug("builder sync server init");let t=await wn(e),n=r,i=()=>Promise.resolve();n&&setTimeout(()=>{i=Hb(e.getAppRootDir(),n,s=>{n=s})},1e3),await Pp({...t,ensureFigmaImportPage:()=>Promise.reject("Not supported"),getPastSyncInfo:({sessionKey:s,since:o})=>!n||s!==n.snippet.sessionKey?null:{...n,hasChanged:n.timeStamp>o},resyncSnippet:async s=>{await i();let o=await _p({path:n?.pathInput,snippet:s.snippet,cwd:e.getAppRootDir()});return o&&(n=o,i=Hb(e.getAppRootDir(),n,a=>{n=a})),n},getClientId:()=>"builder-sync-cli",closeAppServer:async()=>{await i()},restartAppServer:async()=>{e.debug("restart server")},enableAppWatch:async s=>s,...e})}async function _p(e){let r=e.snippetId,t=e.snippet||null;if(!t&&r&&(t=await Ip(r)),!t)return he(`No snippet found for id ${r}`),await ee(1);let n=process.cwd(),i=co(n)??n,s=await AI(i,t.contentId,t.sessionKey),o=s.filter(p=>p.snippetId===t.id);if(K.info(`Found ${o.length} matching files for snippet ${t.id} in existing files ${s.length}`),o.length>0){let p=Math.max(...o.map(d=>d.timestamp||0));return{snippet:t,writtenFiles:o,pathInput:Jb(o.map(d=>d.path)),timeStamp:p}}let a=Np(i,t.framework||"react"),l=e.path||Jb(s.map(p=>p.path))||await Mt({message:"Where should we copy the files?",initialValue:a,validate(p){if(p.length===0)return"File path is required!";if(p[0]!==".")return"Please enter a relative path."}});Me(l)&&(he("Cancelled sync"),process.exit(0));for(let p of s){let d=(0,Bt.resolve)(i,p.path);try{(0,Kt.unlinkSync)(d),K.info(`Deleted old file: ${d}`);let f=(0,Bt.dirname)(d);(0,Kt.readdirSync)(f).length===0&&((0,Kt.rmdirSync)(f),K.info(`Deleted empty folder: ${f}`))}catch(f){K.error(`Error cleaning up file ${d}: ${f}`)}}let u=await sl(i,t,t.files,l,!0);K.success("All files have been written successfully.");let c=Math.max(...u.map(p=>p.timestamp||0));return{snippet:t,writtenFiles:u.map(p=>({...p,code:ol(p.code)})),pathInput:l,timeStamp:c||Date.now()}}function ol(e){if(!e)return e;let r=/<!--\s*This code was generated by Builder\.io\s*-->\s*(?:<!--\s*https:\/\/builder\.io\/content\/[a-f0-9]+\?codeSession=[a-f0-9]+&sid=[a-f0-9]+\s*-->\s*)?/,t=/\/\*\*\s*\n\s*\* This code was generated by Builder\.io\s*\n\s*\* https:\/\/builder\.io\/content\/[a-f0-9]+\?codeSession=[a-f0-9]+&sid=[a-f0-9]+\s*\n\s*\*\/\s*/,n=e.replace(r,"").replace(t,"");return n=n.replace(/^\n+/,""),n}function Jb(e){if(e.length===0)return"";if(e.length===1)return`./${e[0].slice(0,e[0].lastIndexOf("/")+1)}`;let r=e.map(i=>i.split("/")),t=Math.min(...r.map(i=>i.length)),n=[];for(let i=0;i<t;i++){let s=r[0][i];if(r.every(o=>o[i]===s))n.push(s);else break}return`./${n.join("/")}`}var pE=require("node:child_process");var El=require("child_process");var kp=V(require("node:process"),1);function Op(){let{env:e}=kp.default,{TERM:r,TERM_PROGRAM:t}=e;return kp.default.platform!=="win32"?r!=="linux":!!e.WT_SESSION||!!e.TERMINUS_SUBLIME||e.ConEmuTask==="{cmd::Cmder}"||t==="Terminus-Sublime"||t==="vscode"||r==="xterm-256color"||r==="alacritty"||r==="rxvt-unicode"||r==="rxvt-unicode-256color"||e.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Rp=V(Ze(),1),cn=V(Ao(),1),ll=require("node:process"),On=V(require("node:readline"),1),mo=V(Ze(),1),Et=()=>{let e=Lp?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],r=Lp?80:120,t,n,i=!1,s="",o="",a="",l=y=>{let D=y>1?"Something went wrong":"Canceled";i&&m(D,y)},u=(y,D)=>{console.error(D,y),l(2)},c=()=>l(1),p=()=>{process.on("uncaughtExceptionMonitor",u),process.on("unhandledRejection",u),process.on("SIGINT",c),process.on("SIGTERM",c),process.on("exit",l)},d=()=>{process.removeListener("uncaughtExceptionMonitor",u),process.removeListener("unhandledRejection",u),process.removeListener("SIGINT",c),process.removeListener("SIGTERM",c),process.removeListener("exit",l)},f=(y="")=>{i=!0,t=kI(),s=y.replace(/\.+$/,""),process.stdout.write(`${Rp.default.gray(PI)}
|
|
1341
1341
|
`);let D=0,C=0;p(),process.env.CI||(n=setInterval(()=>{let x=Rp.default.magenta(e[D]),b=".".repeat(Math.floor(C)).slice(0,3);process.stdout.write(cn.cursor.move(-999,-a.split(`
|
|
1342
1342
|
`).length+1)),process.stdout.write(cn.erase.down(a.split(`
|
|
1343
1343
|
`).length));let E=`${x} ${s}${b}${o}`;process.stdout.write(E),D=D+1<e.length?D+1:0,C=C<e.length?C+.125:0,a=E},r))},m=(y,D=0)=>{s=y??s,i=!1,clearInterval(n);let C=D===0?(0,mo.green)(FI):D===1?(0,mo.red)(II):(0,mo.red)(NI);process.stdout.write(cn.cursor.move(-999,-a.split(`
|
|
@@ -1355,7 +1355,6 @@ ${(0,R.yellow)("Usage:")}
|
|
|
1355
1355
|
|
|
1356
1356
|
${(0,R.yellow)("Arguments:")}
|
|
1357
1357
|
${(0,R.cyan)("--figmaToken")} Figma access token for authentication
|
|
1358
|
-
${(0,R.cyan)("--privateKey")} Builder.io private API key
|
|
1359
1358
|
${(0,R.cyan)("--spaceId")} Builder.io space ID to use
|
|
1360
1359
|
${(0,R.cyan)("--ci")} Run in CI mode without interactive prompts
|
|
1361
1360
|
${(0,R.cyan)("--force")} Force operation even if there are warnings
|
|
@@ -1382,7 +1381,6 @@ ${(0,R.yellow)("Non-Interactive Authentication:")}
|
|
|
1382
1381
|
|
|
1383
1382
|
${(0,R.yellow)("Arguments:")}
|
|
1384
1383
|
${(0,R.cyan)("--figmaToken")} Figma access token for authentication
|
|
1385
|
-
${(0,R.cyan)("--privateKey")} Builder.io private API key
|
|
1386
1384
|
${(0,R.cyan)("--spaceId")} Builder.io space ID to use
|
|
1387
1385
|
${(0,R.cyan)("--force")} Force re-authentication even if already authenticated
|
|
1388
1386
|
|
|
@@ -1396,7 +1394,6 @@ ${(0,R.bgGreen)((0,R.white)(" npx builder.io figma publish "))}
|
|
|
1396
1394
|
Publish your Figma Mappings to Builder.io.
|
|
1397
1395
|
|
|
1398
1396
|
${(0,R.yellow)("Arguments:")}
|
|
1399
|
-
${(0,R.cyan)("--privateKey")} Builder.io private API key
|
|
1400
1397
|
${(0,R.cyan)("--spaceId")} Builder.io space ID to use
|
|
1401
1398
|
${(0,R.cyan)("--ci")} Run in CI mode without interactive prompts
|
|
1402
1399
|
${(0,R.cyan)("--force")} Force publish even if there are warnings
|
|
@@ -1412,7 +1409,6 @@ ${(0,R.yellow)("Description:")}
|
|
|
1412
1409
|
Downloads existing Figma Mappings from Builder.io and saves them locally.
|
|
1413
1410
|
|
|
1414
1411
|
${(0,R.yellow)("Arguments:")}
|
|
1415
|
-
${(0,R.cyan)("--privateKey")} Builder.io private API key
|
|
1416
1412
|
${(0,R.cyan)("--spaceId")} Builder.io space ID to use
|
|
1417
1413
|
${(0,R.cyan)("--force")} Force migration even if there are warnings
|
|
1418
1414
|
${(0,R.cyan)("--yes")} Auto-confirm all prompts`);break;case"code":K.info(`${(0,R.cyan)("\u2192")} ${(0,R.bold)("Code Generation")}
|
|
@@ -1423,7 +1419,6 @@ Generate or modify code based on Figma designs.
|
|
|
1423
1419
|
|
|
1424
1420
|
${(0,R.yellow)("Arguments:")}
|
|
1425
1421
|
${(0,R.cyan)("--url")} URL to start completion from
|
|
1426
|
-
${(0,R.cyan)("--privateKey")} Builder.io private API key
|
|
1427
1422
|
${(0,R.cyan)("--spaceId")} Builder.io space ID to use
|
|
1428
1423
|
${(0,R.cyan)("--prompt")} Prompt text for non-interactive mode
|
|
1429
1424
|
${(0,R.cyan)("--mode")} Generation mode - either 'exact' for precise matches or 'creative' for more flexibility
|
|
@@ -1439,18 +1434,17 @@ ${(0,R.bgGreen)((0,R.white)(" npx builder.io code indexing "))}
|
|
|
1439
1434
|
Index your codebase to improve code generation results.
|
|
1440
1435
|
|
|
1441
1436
|
${(0,R.yellow)("Arguments:")}
|
|
1442
|
-
${(0,R.cyan)("--privateKey")} Builder.io private API key
|
|
1443
1437
|
${(0,R.cyan)("--spaceId")} Builder.io space ID to use
|
|
1444
1438
|
${(0,R.cyan)("--cwd")} Working directory to run commands from`);break;default:K.info(`${(0,R.bold)("Available Commands:")}
|
|
1445
1439
|
`),[{command:"generate URL [URL ...]",description:"Start the auto-mapping wizard for Figma Component URLs"},{command:"publish",description:"Publish your Figma Mappings to Builder.io"},{command:"migrate",description:"Migrate existing Figma Mappings into the repo as local files"},{command:"auth",description:"Re-authenticate with Figma and Builder.io"},{command:"code",description:"Generate or modify code based on Figma designs"},{command:"indexing",description:"Index your codebase to improve code generation results"}].forEach(({command:t,description:n})=>{K.info(`${(0,R.cyan)("\u2192")} ${(0,R.bgGreen)((0,R.white)(` npx builder.io figma ${t} `))}
|
|
1446
1440
|
${(0,R.dim)(n)}
|
|
1447
1441
|
`)}),K.info(`
|
|
1448
|
-
Use ${(0,R.cyan)("npx builder.io figma help <command>")} for detailed help about a command`)}ut("bye \u{1F44B}")}var dE=V(require("crypto"),1);var oN=V(Gl()),zx=V(Vx()),ho=V(require("@sentry/node"));function dl(e,r,t){let n,i=new Promise(o=>{try{n=(0,zx.default)(e,r,{stdio:"inherit",...t}),n.on("error",a=>{ho.captureException(a),o(!1)}),n.on("close",a=>{a===0?o(!0):(ho.captureMessage(`cmd "${e} ${r.join(" ")}", exit code: ${a}`,"error"),o(!1))})}catch(a){ho.captureException(a),o(!1)}});return{abort:async()=>{n&&n.kill("SIGINT")},command:i}}var ld=V(require("node:path"),1),Cl=V(require("node:os"),1);var aN="NORabcdefghilnopqrstuvy",lN=`"#%)*+56789<>?@Z[\\]^|\xA7\xAB\xE4\xE7'`,uN="-.ABDEFGIKWY_\r z{\xFC",cN=",01234:~\xDC\xDF",pN="",dN="!$&(/;=JX`j\n}\xF6",fN="CHLMPQSTUVfkmspwx ",qx=[aN,lN,uN,cN,pN,dN,fN],mN={C4:.08086208692099685,C0:.2020182639633662,C6:.2372744211422125,C2:.3042805747355606,C5:.4157646363858563,C1:.4790556468110302,C3:.6581971122770317,CX:.980083857442348};function hN(e,r){let t=e[r];if(t===" ")return r>0&&e[r-1]===" "?"C4":"C0";if(t.charCodeAt(0)>255)return"C3";for(let n=0;n<qx.length;n++)if(qx[n].indexOf(t)!==-1)return"C"+n;return"CX"}function go(e){if(e){let r=0;for(let t=0;t<e.length;t++)r+=mN[hN(e,t)];return Math.round(r)}else return 0}var nE=V(require("prompts"),1);function pn(e){return Array.isArray?Array.isArray(e):Zx(e)==="[object Array]"}var gN=1/0;function yN(e){if(typeof e=="string")return e;let r=e+"";return r=="0"&&1/e==-gN?"-0":r}function DN(e){return e==null?"":yN(e)}function $r(e){return typeof e=="string"}function Xx(e){return typeof e=="number"}function bN(e){return e===!0||e===!1||xN(e)&&Zx(e)=="[object Boolean]"}function Qx(e){return typeof e=="object"}function xN(e){return Qx(e)&&e!==null}function Yt(e){return e!=null}function Wp(e){return!e.trim().length}function Zx(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}var EN="Incorrect 'index' type",CN=e=>`Invalid value for key ${e}`,SN=e=>`Pattern length exceeds max of ${e}.`,wN=e=>`Missing ${e} property in key`,TN=e=>`Property 'weight' in key '${e}' must be a positive integer`,Wx=Object.prototype.hasOwnProperty,Gp=class{constructor(r){this._keys=[],this._keyMap={};let t=0;r.forEach(n=>{let i=eE(n);this._keys.push(i),this._keyMap[i.id]=i,t+=i.weight}),this._keys.forEach(n=>{n.weight/=t})}get(r){return this._keyMap[r]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}};function eE(e){let r=null,t=null,n=null,i=1,s=null;if($r(e)||pn(e))n=e,r=Gx(e),t=Hp(e);else{if(!Wx.call(e,"name"))throw new Error(wN("name"));let o=e.name;if(n=o,Wx.call(e,"weight")&&(i=e.weight,i<=0))throw new Error(TN(o));r=Gx(o),t=Hp(o),s=e.getFn}return{path:r,id:t,weight:i,src:n,getFn:s}}function Gx(e){return pn(e)?e:e.split(".")}function Hp(e){return pn(e)?e.join("."):e}function AN(e,r){let t=[],n=!1,i=(s,o,a)=>{if(Yt(s))if(!o[a])t.push(s);else{let l=o[a],u=s[l];if(!Yt(u))return;if(a===o.length-1&&($r(u)||Xx(u)||bN(u)))t.push(DN(u));else if(pn(u)){n=!0;for(let c=0,p=u.length;c<p;c+=1)i(u[c],o,a+1)}else o.length&&i(u,o,a+1)}};return i(e,$r(r)?r.split("."):r,0),n?t:t[0]}var vN={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},PN={isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,r)=>e.score===r.score?e.idx<r.idx?-1:1:e.score<r.score?-1:1},IN={location:0,threshold:.6,distance:100},NN={useExtendedSearch:!1,getFn:AN,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},ie={...PN,...vN,...IN,...NN},FN=/[^ ]+/g;function _N(e=1,r=3){let t=new Map,n=Math.pow(10,r);return{get(i){let s=i.match(FN).length;if(t.has(s))return t.get(s);let o=1/Math.pow(s,.5*e),a=parseFloat(Math.round(o*n)/n);return t.set(s,a),a},clear(){t.clear()}}}var yo=class{constructor({getFn:r=ie.getFn,fieldNormWeight:t=ie.fieldNormWeight}={}){this.norm=_N(t,3),this.getFn=r,this.isCreated=!1,this.setIndexRecords()}setSources(r=[]){this.docs=r}setIndexRecords(r=[]){this.records=r}setKeys(r=[]){this.keys=r,this._keysMap={},r.forEach((t,n)=>{this._keysMap[t.id]=n})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,$r(this.docs[0])?this.docs.forEach((r,t)=>{this._addString(r,t)}):this.docs.forEach((r,t)=>{this._addObject(r,t)}),this.norm.clear())}add(r){let t=this.size();$r(r)?this._addString(r,t):this._addObject(r,t)}removeAt(r){this.records.splice(r,1);for(let t=r,n=this.size();t<n;t+=1)this.records[t].i-=1}getValueForItemAtKeyId(r,t){return r[this._keysMap[t]]}size(){return this.records.length}_addString(r,t){if(!Yt(r)||Wp(r))return;let n={v:r,i:t,n:this.norm.get(r)};this.records.push(n)}_addObject(r,t){let n={i:t,$:{}};this.keys.forEach((i,s)=>{let o=i.getFn?i.getFn(r):this.getFn(r,i.path);if(Yt(o)){if(pn(o)){let a=[],l=[{nestedArrIndex:-1,value:o}];for(;l.length;){let{nestedArrIndex:u,value:c}=l.pop();if(Yt(c))if($r(c)&&!Wp(c)){let p={v:c,i:u,n:this.norm.get(c)};a.push(p)}else pn(c)&&c.forEach((p,d)=>{l.push({nestedArrIndex:d,value:p})})}n.$[s]=a}else if($r(o)&&!Wp(o)){let a={v:o,n:this.norm.get(o)};n.$[s]=a}}}),this.records.push(n)}toJSON(){return{keys:this.keys,records:this.records}}};function tE(e,r,{getFn:t=ie.getFn,fieldNormWeight:n=ie.fieldNormWeight}={}){let i=new yo({getFn:t,fieldNormWeight:n});return i.setKeys(e.map(eE)),i.setSources(r),i.create(),i}function kN(e,{getFn:r=ie.getFn,fieldNormWeight:t=ie.fieldNormWeight}={}){let{keys:n,records:i}=e,s=new yo({getFn:r,fieldNormWeight:t});return s.setKeys(n),s.setIndexRecords(i),s}function fl(e,{errors:r=0,currentLocation:t=0,expectedLocation:n=0,distance:i=ie.distance,ignoreLocation:s=ie.ignoreLocation}={}){let o=r/e.length;if(s)return o;let a=Math.abs(n-t);return i?o+a/i:a?1:o}function ON(e=[],r=ie.minMatchCharLength){let t=[],n=-1,i=-1,s=0;for(let o=e.length;s<o;s+=1){let a=e[s];a&&n===-1?n=s:!a&&n!==-1&&(i=s-1,i-n+1>=r&&t.push([n,i]),n=-1)}return e[s-1]&&s-n>=r&&t.push([n,s-1]),t}var li=32;function RN(e,r,t,{location:n=ie.location,distance:i=ie.distance,threshold:s=ie.threshold,findAllMatches:o=ie.findAllMatches,minMatchCharLength:a=ie.minMatchCharLength,includeMatches:l=ie.includeMatches,ignoreLocation:u=ie.ignoreLocation}={}){if(r.length>li)throw new Error(SN(li));let c=r.length,p=e.length,d=Math.max(0,Math.min(n,p)),f=s,m=d,h=a>1||l,g=h?Array(p):[],y;for(;(y=e.indexOf(r,m))>-1;){let T=fl(r,{currentLocation:y,expectedLocation:d,distance:i,ignoreLocation:u});if(f=Math.min(T,f),m=y+c,h){let O=0;for(;O<c;)g[y+O]=1,O+=1}}m=-1;let D=[],C=1,x=c+p,b=1<<c-1;for(let T=0;T<c;T+=1){let O=0,L=x;for(;O<L;)fl(r,{errors:T,currentLocation:d+L,expectedLocation:d,distance:i,ignoreLocation:u})<=f?O=L:x=L,L=Math.floor((x-O)/2+O);x=L;let N=Math.max(1,d-L+1),U=o?p:Math.min(d+L,p)+c,oe=Array(U+2);oe[U+1]=(1<<T)-1;for(let P=U;P>=N;P-=1){let B=P-1,re=t[e.charAt(B)];if(h&&(g[B]=+!!re),oe[P]=(oe[P+1]<<1|1)&re,T&&(oe[P]|=(D[P+1]|D[P])<<1|1|D[P+1]),oe[P]&b&&(C=fl(r,{errors:T,currentLocation:B,expectedLocation:d,distance:i,ignoreLocation:u}),C<=f)){if(f=C,m=B,m<=d)break;N=Math.max(1,2*d-m)}}if(fl(r,{errors:T+1,currentLocation:d,expectedLocation:d,distance:i,ignoreLocation:u})>f)break;D=oe}let E={isMatch:m>=0,score:Math.max(.001,C)};if(h){let T=ON(g,a);T.length?l&&(E.indices=T):E.isMatch=!1}return E}function LN(e){let r={};for(let t=0,n=e.length;t<n;t+=1){let i=e.charAt(t);r[i]=(r[i]||0)|1<<n-t-1}return r}var ml=class{constructor(r,{location:t=ie.location,threshold:n=ie.threshold,distance:i=ie.distance,includeMatches:s=ie.includeMatches,findAllMatches:o=ie.findAllMatches,minMatchCharLength:a=ie.minMatchCharLength,isCaseSensitive:l=ie.isCaseSensitive,ignoreLocation:u=ie.ignoreLocation}={}){if(this.options={location:t,threshold:n,distance:i,includeMatches:s,findAllMatches:o,minMatchCharLength:a,isCaseSensitive:l,ignoreLocation:u},this.pattern=l?r:r.toLowerCase(),this.chunks=[],!this.pattern.length)return;let c=(d,f)=>{this.chunks.push({pattern:d,alphabet:LN(d),startIndex:f})},p=this.pattern.length;if(p>li){let d=0,f=p%li,m=p-f;for(;d<m;)c(this.pattern.substr(d,li),d),d+=li;if(f){let h=p-li;c(this.pattern.substr(h),h)}}else c(this.pattern,0)}searchIn(r){let{isCaseSensitive:t,includeMatches:n}=this.options;if(t||(r=r.toLowerCase()),this.pattern===r){let m={isMatch:!0,score:0};return n&&(m.indices=[[0,r.length-1]]),m}let{location:i,distance:s,threshold:o,findAllMatches:a,minMatchCharLength:l,ignoreLocation:u}=this.options,c=[],p=0,d=!1;this.chunks.forEach(({pattern:m,alphabet:h,startIndex:g})=>{let{isMatch:y,score:D,indices:C}=RN(r,m,h,{location:i+g,distance:s,threshold:o,findAllMatches:a,minMatchCharLength:l,includeMatches:n,ignoreLocation:u});y&&(d=!0),p+=D,y&&C&&(c=[...c,...C])});let f={isMatch:d,score:d?p/this.chunks.length:1};return d&&n&&(f.indices=c),f}},Ur=class{constructor(r){this.pattern=r}static isMultiMatch(r){return Hx(r,this.multiRegex)}static isSingleMatch(r){return Hx(r,this.singleRegex)}search(){}};function Hx(e,r){let t=e.match(r);return t?t[1]:null}var Jp=class extends Ur{constructor(r){super(r)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(r){let t=r===this.pattern;return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}},Yp=class extends Ur{constructor(r){super(r)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(r){let n=r.indexOf(this.pattern)===-1;return{isMatch:n,score:n?0:1,indices:[0,r.length-1]}}},Xp=class extends Ur{constructor(r){super(r)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(r){let t=r.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}},Qp=class extends Ur{constructor(r){super(r)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(r){let t=!r.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,r.length-1]}}},Zp=class extends Ur{constructor(r){super(r)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(r){let t=r.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[r.length-this.pattern.length,r.length-1]}}},ed=class extends Ur{constructor(r){super(r)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(r){let t=!r.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,r.length-1]}}},hl=class extends Ur{constructor(r,{location:t=ie.location,threshold:n=ie.threshold,distance:i=ie.distance,includeMatches:s=ie.includeMatches,findAllMatches:o=ie.findAllMatches,minMatchCharLength:a=ie.minMatchCharLength,isCaseSensitive:l=ie.isCaseSensitive,ignoreLocation:u=ie.ignoreLocation}={}){super(r),this._bitapSearch=new ml(r,{location:t,threshold:n,distance:i,includeMatches:s,findAllMatches:o,minMatchCharLength:a,isCaseSensitive:l,ignoreLocation:u})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(r){return this._bitapSearch.searchIn(r)}},gl=class extends Ur{constructor(r){super(r)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(r){let t=0,n,i=[],s=this.pattern.length;for(;(n=r.indexOf(this.pattern,t))>-1;)t=n+s,i.push([n,t-1]);let o=!!i.length;return{isMatch:o,score:o?0:1,indices:i}}},td=[Jp,gl,Xp,Qp,ed,Zp,Yp,hl],Jx=td.length,BN=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,MN="|";function $N(e,r={}){return e.split(MN).map(t=>{let n=t.trim().split(BN).filter(s=>s&&!!s.trim()),i=[];for(let s=0,o=n.length;s<o;s+=1){let a=n[s],l=!1,u=-1;for(;!l&&++u<Jx;){let c=td[u],p=c.isMultiMatch(a);p&&(i.push(new c(p,r)),l=!0)}if(!l)for(u=-1;++u<Jx;){let c=td[u],p=c.isSingleMatch(a);if(p){i.push(new c(p,r));break}}}return i})}var UN=new Set([hl.type,gl.type]),rd=class{constructor(r,{isCaseSensitive:t=ie.isCaseSensitive,includeMatches:n=ie.includeMatches,minMatchCharLength:i=ie.minMatchCharLength,ignoreLocation:s=ie.ignoreLocation,findAllMatches:o=ie.findAllMatches,location:a=ie.location,threshold:l=ie.threshold,distance:u=ie.distance}={}){this.query=null,this.options={isCaseSensitive:t,includeMatches:n,minMatchCharLength:i,findAllMatches:o,ignoreLocation:s,location:a,threshold:l,distance:u},this.pattern=t?r:r.toLowerCase(),this.query=$N(this.pattern,this.options)}static condition(r,t){return t.useExtendedSearch}searchIn(r){let t=this.query;if(!t)return{isMatch:!1,score:1};let{includeMatches:n,isCaseSensitive:i}=this.options;r=i?r:r.toLowerCase();let s=0,o=[],a=0;for(let l=0,u=t.length;l<u;l+=1){let c=t[l];o.length=0,s=0;for(let p=0,d=c.length;p<d;p+=1){let f=c[p],{isMatch:m,indices:h,score:g}=f.search(r);if(m){if(s+=1,a+=g,n){let y=f.constructor.type;UN.has(y)?o=[...o,...h]:o.push(h)}}else{a=0,s=0,o.length=0;break}}if(s){let p={isMatch:!0,score:a/s};return n&&(p.indices=o),p}}return{isMatch:!1,score:1}}},nd=[];function jN(...e){nd.push(...e)}function id(e,r){for(let t=0,n=nd.length;t<n;t+=1){let i=nd[t];if(i.condition(e,r))return new i(e,r)}return new ml(e,r)}var yl={AND:"$and",OR:"$or"},sd={PATH:"$path",PATTERN:"$val"},od=e=>!!(e[yl.AND]||e[yl.OR]),KN=e=>!!e[sd.PATH],VN=e=>!pn(e)&&Qx(e)&&!od(e),Yx=e=>({[yl.AND]:Object.keys(e).map(r=>({[r]:e[r]}))});function rE(e,r,{auto:t=!0}={}){let n=i=>{let s=Object.keys(i),o=KN(i);if(!o&&s.length>1&&!od(i))return n(Yx(i));if(VN(i)){let l=o?i[sd.PATH]:s[0],u=o?i[sd.PATTERN]:i[l];if(!$r(u))throw new Error(CN(l));let c={keyId:Hp(l),pattern:u};return t&&(c.searcher=id(u,r)),c}let a={children:[],operator:s[0]};return s.forEach(l=>{let u=i[l];pn(u)&&u.forEach(c=>{a.children.push(n(c))})}),a};return od(e)||(e=Yx(e)),n(e)}function zN(e,{ignoreFieldNorm:r=ie.ignoreFieldNorm}){e.forEach(t=>{let n=1;t.matches.forEach(({key:i,norm:s,score:o})=>{let a=i?i.weight:null;n*=Math.pow(o===0&&a?Number.EPSILON:o,(a||1)*(r?1:s))}),t.score=n})}function qN(e,r){let t=e.matches;r.matches=[],Yt(t)&&t.forEach(n=>{if(!Yt(n.indices)||!n.indices.length)return;let{indices:i,value:s}=n,o={indices:i,value:s};n.key&&(o.key=n.key.src),n.idx>-1&&(o.refIndex=n.idx),r.matches.push(o)})}function WN(e,r){r.score=e.score}function GN(e,r,{includeMatches:t=ie.includeMatches,includeScore:n=ie.includeScore}={}){let i=[];return t&&i.push(qN),n&&i.push(WN),e.map(s=>{let{idx:o}=s,a={item:r[o],refIndex:o};return i.length&&i.forEach(l=>{l(s,a)}),a})}var dn=class{constructor(r,t={},n){this.options={...ie,...t},this.options.useExtendedSearch,this._keyStore=new Gp(this.options.keys),this.setCollection(r,n)}setCollection(r,t){if(this._docs=r,t&&!(t instanceof yo))throw new Error(EN);this._myIndex=t||tE(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(r){Yt(r)&&(this._docs.push(r),this._myIndex.add(r))}remove(r=()=>!1){let t=[];for(let n=0,i=this._docs.length;n<i;n+=1){let s=this._docs[n];r(s,n)&&(this.removeAt(n),n-=1,i-=1,t.push(s))}return t}removeAt(r){this._docs.splice(r,1),this._myIndex.removeAt(r)}getIndex(){return this._myIndex}search(r,{limit:t=-1}={}){let{includeMatches:n,includeScore:i,shouldSort:s,sortFn:o,ignoreFieldNorm:a}=this.options,l=$r(r)?$r(this._docs[0])?this._searchStringList(r):this._searchObjectList(r):this._searchLogical(r);return zN(l,{ignoreFieldNorm:a}),s&&l.sort(o),Xx(t)&&t>-1&&(l=l.slice(0,t)),GN(l,this._docs,{includeMatches:n,includeScore:i})}_searchStringList(r){let t=id(r,this.options),{records:n}=this._myIndex,i=[];return n.forEach(({v:s,i:o,n:a})=>{if(!Yt(s))return;let{isMatch:l,score:u,indices:c}=t.searchIn(s);l&&i.push({item:s,idx:o,matches:[{score:u,value:s,norm:a,indices:c}]})}),i}_searchLogical(r){let t=rE(r,this.options),n=(a,l,u)=>{if(!a.children){let{keyId:p,searcher:d}=a,f=this._findMatches({key:this._keyStore.get(p),value:this._myIndex.getValueForItemAtKeyId(l,p),searcher:d});return f&&f.length?[{idx:u,item:l,matches:f}]:[]}let c=[];for(let p=0,d=a.children.length;p<d;p+=1){let f=a.children[p],m=n(f,l,u);if(m.length)c.push(...m);else if(a.operator===yl.AND)return[]}return c},i=this._myIndex.records,s={},o=[];return i.forEach(({$:a,i:l})=>{if(Yt(a)){let u=n(t,a,l);u.length&&(s[l]||(s[l]={idx:l,item:a,matches:[]},o.push(s[l])),u.forEach(({matches:c})=>{s[l].matches.push(...c)}))}}),o}_searchObjectList(r){let t=id(r,this.options),{keys:n,records:i}=this._myIndex,s=[];return i.forEach(({$:o,i:a})=>{if(!Yt(o))return;let l=[];n.forEach((u,c)=>{l.push(...this._findMatches({key:u,value:o[c],searcher:t}))}),l.length&&s.push({idx:a,item:o,matches:l})}),s}_findMatches({key:r,value:t,searcher:n}){if(!Yt(t))return[];let i=[];if(pn(t))t.forEach(({v:s,i:o,n:a})=>{if(!Yt(s))return;let{isMatch:l,score:u,indices:c}=n.searchIn(s);l&&i.push({score:u,key:r,value:s,idx:o,norm:a,indices:c})});else{let{v:s,n:o}=t,{isMatch:a,score:l,indices:u}=n.searchIn(s);a&&i.push({score:l,key:r,value:s,norm:o,indices:u})}return i}};dn.version="7.0.0";dn.createIndex=tE;dn.parseIndex=kN;dn.config=ie;dn.parseQuery=rE;jN(rd);var iE=V(Ze(),1);var ad=class{constructor(r,t){this.sys=r;this.appRootDir=t;bd(this,"tokenCache",new Map)}get(r){if(!this.tokenCache.has(r)){let t=this.sys.readFileSync(this.sys.join(this.appRootDir,r))??"";this.tokenCache.set(r,go(t))}return this.tokenCache.get(r)}getForVisible(r,t){return t?this.get(r):0}calculateTotal(r){return r.reduce((t,n)=>t+this.get(n.value),0)}};async function sE(e,r,t,n,i){let s=new ad(e,t),o=c=>({title:(0,iE.dim)(c),value:c});if(r.length<4)return null;let a=r.map(o),l=new dn(a,{keys:["value"]});K.message("");let u=await(0,nE.default)({type:"autocomplete",name:"file",message:" Add context file (Ctrl+C to skip)",choices:r.map(o),suggest:async(c,p)=>{let d;c?d=l.search(c).map(m=>m.item):d=p.sort((m,h)=>{let g=n.get(m.value)??0;return(n.get(h.value)??0)-g}).slice(0,10);let f=[];for(let m of d)s.get(m.value)<=i&&f.push(m);return f.length===0?[{title:"No valid matching files",value:"",disabled:!0}]:f},validate:c=>{if(!c)return"Please select a file";let p=s.get(c);return p>i?`File exceeds token limit of ${i} (has ${p} tokens)`:!0}});return u.file?(n.set(u.file,4),u.file):null}var ud=V(require("prettier"),1);function HN(e){return Math.min(3,Math.max(0,e))}var fE=async(e,r,t)=>{r==="indexing"?await tx(e,t):r==="generate"||r==="gen"||r==="g"?await oE(e,t):r==="gen"?xr("code"):await oE(e,t)},oE=async(e,r)=>{console.log(""),ot((0,te.bgCyan)((0,te.bold)((0,te.white)(" code ")))+" "+(0,te.dim)(gt));let t=await Lt(e,r,{forceSpaceId:r.spaceId,builderPrivateKey:!0,builderPublicKey:!0}),n={history:[],undoStates:[],sessionId:dE.default.randomUUID(),selectedFilePaths:new Map};We("figma code started",{spaceId:t.builderPublicKey});let i=r.url;if(await Do(e),r.prompt){let l={userPrompt:r.prompt,mode:r.mode||"precise"};await aE(e,t,r,n,l.userPrompt,i,null),ut(`${(0,te.bgGreen)((0,te.bold)((0,te.white)(" Done! \u{1F389} ")))} ${(0,te.dim)("session "+n.sessionId)}`),pd(n.sessionId,t.builderPublicKey),We("figma code accepted",{spaceId:t.builderPublicKey,userPrompt:l.userPrompt});let u=n.history[n.history.length-1]?.id;u&&await cd(e,t,u,!!r.verbose,"positive");return}if(!process.stdout.isTTY&&process.env.FORCE_TTY!=="1")return de(`This command requires a TTY-enabled terminal.
|
|
1449
|
-
If you are using Windows Git Bash, try a different terminal or wrap the command with winpty.`),await ee(1);let s=e.getAppRootDir(),o=await e.getRepoInfo();for(!await Wr(e,s)&&!o.remoteUrl&&await wt({message:"Looks like this is an empty project. Would you like to set up a new Builder.io project?",active:"Yes, create new project",inactive:"Skip for now"})&&(await dl("npm",["init","builder.io@latest","--","--skip-question"],{stdio:"inherit",cwd:s}).command||(
|
|
1450
|
-
${(0,te.bold)("npm init builder.io@latest")}`),await ee(1)));;){let l=await JN(e,t,r,n,!!i);if(l.command==="exit")break;let u=l.userPrompt;u&&await aE(e,t,r,n,u,i,void 0)}};async function JN(e,r,t,n,i){let{isNextPage:s}=hE(n.nextUrl);if(s){K.warn("Large generation in progress.");let u=await wt({message:"Do you want to continue generating?",active:"Continue",inactive:"Stop"});return
|
|
1442
|
+
Use ${(0,R.cyan)("npx builder.io figma help <command>")} for detailed help about a command`)}ut("bye \u{1F44B}")}var dE=V(require("crypto"),1);var oN=V(Gl()),zx=V(Vx()),ho=V(require("@sentry/node"));function dl(e,r,t){let n,i=new Promise(o=>{try{n=(0,zx.default)(e,r,{stdio:"inherit",...t}),n.on("error",a=>{ho.captureException(a),o(!1)}),n.on("close",a=>{a===0?o(!0):(ho.captureMessage(`cmd "${e} ${r.join(" ")}", exit code: ${a}`,"error"),o(!1))})}catch(a){ho.captureException(a),o(!1)}});return{abort:async()=>{n&&n.kill("SIGINT")},command:i}}var ld=V(require("node:path"),1),Cl=V(require("node:os"),1);var aN="NORabcdefghilnopqrstuvy",lN=`"#%)*+56789<>?@Z[\\]^|\xA7\xAB\xE4\xE7'`,uN="-.ABDEFGIKWY_\r z{\xFC",cN=",01234:~\xDC\xDF",pN="",dN="!$&(/;=JX`j\n}\xF6",fN="CHLMPQSTUVfkmspwx ",qx=[aN,lN,uN,cN,pN,dN,fN],mN={C4:.08086208692099685,C0:.2020182639633662,C6:.2372744211422125,C2:.3042805747355606,C5:.4157646363858563,C1:.4790556468110302,C3:.6581971122770317,CX:.980083857442348};function hN(e,r){let t=e[r];if(t===" ")return r>0&&e[r-1]===" "?"C4":"C0";if(t.charCodeAt(0)>255)return"C3";for(let n=0;n<qx.length;n++)if(qx[n].indexOf(t)!==-1)return"C"+n;return"CX"}function go(e){if(e){let r=0;for(let t=0;t<e.length;t++)r+=mN[hN(e,t)];return Math.round(r)}else return 0}var nE=V(require("prompts"),1);function pn(e){return Array.isArray?Array.isArray(e):Zx(e)==="[object Array]"}var gN=1/0;function yN(e){if(typeof e=="string")return e;let r=e+"";return r=="0"&&1/e==-gN?"-0":r}function DN(e){return e==null?"":yN(e)}function $r(e){return typeof e=="string"}function Xx(e){return typeof e=="number"}function bN(e){return e===!0||e===!1||xN(e)&&Zx(e)=="[object Boolean]"}function Qx(e){return typeof e=="object"}function xN(e){return Qx(e)&&e!==null}function Yt(e){return e!=null}function Wp(e){return!e.trim().length}function Zx(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}var EN="Incorrect 'index' type",CN=e=>`Invalid value for key ${e}`,SN=e=>`Pattern length exceeds max of ${e}.`,wN=e=>`Missing ${e} property in key`,TN=e=>`Property 'weight' in key '${e}' must be a positive integer`,Wx=Object.prototype.hasOwnProperty,Gp=class{constructor(r){this._keys=[],this._keyMap={};let t=0;r.forEach(n=>{let i=eE(n);this._keys.push(i),this._keyMap[i.id]=i,t+=i.weight}),this._keys.forEach(n=>{n.weight/=t})}get(r){return this._keyMap[r]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}};function eE(e){let r=null,t=null,n=null,i=1,s=null;if($r(e)||pn(e))n=e,r=Gx(e),t=Hp(e);else{if(!Wx.call(e,"name"))throw new Error(wN("name"));let o=e.name;if(n=o,Wx.call(e,"weight")&&(i=e.weight,i<=0))throw new Error(TN(o));r=Gx(o),t=Hp(o),s=e.getFn}return{path:r,id:t,weight:i,src:n,getFn:s}}function Gx(e){return pn(e)?e:e.split(".")}function Hp(e){return pn(e)?e.join("."):e}function AN(e,r){let t=[],n=!1,i=(s,o,a)=>{if(Yt(s))if(!o[a])t.push(s);else{let l=o[a],u=s[l];if(!Yt(u))return;if(a===o.length-1&&($r(u)||Xx(u)||bN(u)))t.push(DN(u));else if(pn(u)){n=!0;for(let c=0,p=u.length;c<p;c+=1)i(u[c],o,a+1)}else o.length&&i(u,o,a+1)}};return i(e,$r(r)?r.split("."):r,0),n?t:t[0]}var vN={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},PN={isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,r)=>e.score===r.score?e.idx<r.idx?-1:1:e.score<r.score?-1:1},IN={location:0,threshold:.6,distance:100},NN={useExtendedSearch:!1,getFn:AN,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},ie={...PN,...vN,...IN,...NN},FN=/[^ ]+/g;function _N(e=1,r=3){let t=new Map,n=Math.pow(10,r);return{get(i){let s=i.match(FN).length;if(t.has(s))return t.get(s);let o=1/Math.pow(s,.5*e),a=parseFloat(Math.round(o*n)/n);return t.set(s,a),a},clear(){t.clear()}}}var yo=class{constructor({getFn:r=ie.getFn,fieldNormWeight:t=ie.fieldNormWeight}={}){this.norm=_N(t,3),this.getFn=r,this.isCreated=!1,this.setIndexRecords()}setSources(r=[]){this.docs=r}setIndexRecords(r=[]){this.records=r}setKeys(r=[]){this.keys=r,this._keysMap={},r.forEach((t,n)=>{this._keysMap[t.id]=n})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,$r(this.docs[0])?this.docs.forEach((r,t)=>{this._addString(r,t)}):this.docs.forEach((r,t)=>{this._addObject(r,t)}),this.norm.clear())}add(r){let t=this.size();$r(r)?this._addString(r,t):this._addObject(r,t)}removeAt(r){this.records.splice(r,1);for(let t=r,n=this.size();t<n;t+=1)this.records[t].i-=1}getValueForItemAtKeyId(r,t){return r[this._keysMap[t]]}size(){return this.records.length}_addString(r,t){if(!Yt(r)||Wp(r))return;let n={v:r,i:t,n:this.norm.get(r)};this.records.push(n)}_addObject(r,t){let n={i:t,$:{}};this.keys.forEach((i,s)=>{let o=i.getFn?i.getFn(r):this.getFn(r,i.path);if(Yt(o)){if(pn(o)){let a=[],l=[{nestedArrIndex:-1,value:o}];for(;l.length;){let{nestedArrIndex:u,value:c}=l.pop();if(Yt(c))if($r(c)&&!Wp(c)){let p={v:c,i:u,n:this.norm.get(c)};a.push(p)}else pn(c)&&c.forEach((p,d)=>{l.push({nestedArrIndex:d,value:p})})}n.$[s]=a}else if($r(o)&&!Wp(o)){let a={v:o,n:this.norm.get(o)};n.$[s]=a}}}),this.records.push(n)}toJSON(){return{keys:this.keys,records:this.records}}};function tE(e,r,{getFn:t=ie.getFn,fieldNormWeight:n=ie.fieldNormWeight}={}){let i=new yo({getFn:t,fieldNormWeight:n});return i.setKeys(e.map(eE)),i.setSources(r),i.create(),i}function kN(e,{getFn:r=ie.getFn,fieldNormWeight:t=ie.fieldNormWeight}={}){let{keys:n,records:i}=e,s=new yo({getFn:r,fieldNormWeight:t});return s.setKeys(n),s.setIndexRecords(i),s}function fl(e,{errors:r=0,currentLocation:t=0,expectedLocation:n=0,distance:i=ie.distance,ignoreLocation:s=ie.ignoreLocation}={}){let o=r/e.length;if(s)return o;let a=Math.abs(n-t);return i?o+a/i:a?1:o}function ON(e=[],r=ie.minMatchCharLength){let t=[],n=-1,i=-1,s=0;for(let o=e.length;s<o;s+=1){let a=e[s];a&&n===-1?n=s:!a&&n!==-1&&(i=s-1,i-n+1>=r&&t.push([n,i]),n=-1)}return e[s-1]&&s-n>=r&&t.push([n,s-1]),t}var li=32;function RN(e,r,t,{location:n=ie.location,distance:i=ie.distance,threshold:s=ie.threshold,findAllMatches:o=ie.findAllMatches,minMatchCharLength:a=ie.minMatchCharLength,includeMatches:l=ie.includeMatches,ignoreLocation:u=ie.ignoreLocation}={}){if(r.length>li)throw new Error(SN(li));let c=r.length,p=e.length,d=Math.max(0,Math.min(n,p)),f=s,m=d,h=a>1||l,g=h?Array(p):[],y;for(;(y=e.indexOf(r,m))>-1;){let T=fl(r,{currentLocation:y,expectedLocation:d,distance:i,ignoreLocation:u});if(f=Math.min(T,f),m=y+c,h){let O=0;for(;O<c;)g[y+O]=1,O+=1}}m=-1;let D=[],C=1,x=c+p,b=1<<c-1;for(let T=0;T<c;T+=1){let O=0,L=x;for(;O<L;)fl(r,{errors:T,currentLocation:d+L,expectedLocation:d,distance:i,ignoreLocation:u})<=f?O=L:x=L,L=Math.floor((x-O)/2+O);x=L;let N=Math.max(1,d-L+1),U=o?p:Math.min(d+L,p)+c,oe=Array(U+2);oe[U+1]=(1<<T)-1;for(let P=U;P>=N;P-=1){let B=P-1,re=t[e.charAt(B)];if(h&&(g[B]=+!!re),oe[P]=(oe[P+1]<<1|1)&re,T&&(oe[P]|=(D[P+1]|D[P])<<1|1|D[P+1]),oe[P]&b&&(C=fl(r,{errors:T,currentLocation:B,expectedLocation:d,distance:i,ignoreLocation:u}),C<=f)){if(f=C,m=B,m<=d)break;N=Math.max(1,2*d-m)}}if(fl(r,{errors:T+1,currentLocation:d,expectedLocation:d,distance:i,ignoreLocation:u})>f)break;D=oe}let E={isMatch:m>=0,score:Math.max(.001,C)};if(h){let T=ON(g,a);T.length?l&&(E.indices=T):E.isMatch=!1}return E}function LN(e){let r={};for(let t=0,n=e.length;t<n;t+=1){let i=e.charAt(t);r[i]=(r[i]||0)|1<<n-t-1}return r}var ml=class{constructor(r,{location:t=ie.location,threshold:n=ie.threshold,distance:i=ie.distance,includeMatches:s=ie.includeMatches,findAllMatches:o=ie.findAllMatches,minMatchCharLength:a=ie.minMatchCharLength,isCaseSensitive:l=ie.isCaseSensitive,ignoreLocation:u=ie.ignoreLocation}={}){if(this.options={location:t,threshold:n,distance:i,includeMatches:s,findAllMatches:o,minMatchCharLength:a,isCaseSensitive:l,ignoreLocation:u},this.pattern=l?r:r.toLowerCase(),this.chunks=[],!this.pattern.length)return;let c=(d,f)=>{this.chunks.push({pattern:d,alphabet:LN(d),startIndex:f})},p=this.pattern.length;if(p>li){let d=0,f=p%li,m=p-f;for(;d<m;)c(this.pattern.substr(d,li),d),d+=li;if(f){let h=p-li;c(this.pattern.substr(h),h)}}else c(this.pattern,0)}searchIn(r){let{isCaseSensitive:t,includeMatches:n}=this.options;if(t||(r=r.toLowerCase()),this.pattern===r){let m={isMatch:!0,score:0};return n&&(m.indices=[[0,r.length-1]]),m}let{location:i,distance:s,threshold:o,findAllMatches:a,minMatchCharLength:l,ignoreLocation:u}=this.options,c=[],p=0,d=!1;this.chunks.forEach(({pattern:m,alphabet:h,startIndex:g})=>{let{isMatch:y,score:D,indices:C}=RN(r,m,h,{location:i+g,distance:s,threshold:o,findAllMatches:a,minMatchCharLength:l,includeMatches:n,ignoreLocation:u});y&&(d=!0),p+=D,y&&C&&(c=[...c,...C])});let f={isMatch:d,score:d?p/this.chunks.length:1};return d&&n&&(f.indices=c),f}},Ur=class{constructor(r){this.pattern=r}static isMultiMatch(r){return Hx(r,this.multiRegex)}static isSingleMatch(r){return Hx(r,this.singleRegex)}search(){}};function Hx(e,r){let t=e.match(r);return t?t[1]:null}var Jp=class extends Ur{constructor(r){super(r)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(r){let t=r===this.pattern;return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}},Yp=class extends Ur{constructor(r){super(r)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(r){let n=r.indexOf(this.pattern)===-1;return{isMatch:n,score:n?0:1,indices:[0,r.length-1]}}},Xp=class extends Ur{constructor(r){super(r)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(r){let t=r.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,this.pattern.length-1]}}},Qp=class extends Ur{constructor(r){super(r)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(r){let t=!r.startsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,r.length-1]}}},Zp=class extends Ur{constructor(r){super(r)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(r){let t=r.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[r.length-this.pattern.length,r.length-1]}}},ed=class extends Ur{constructor(r){super(r)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(r){let t=!r.endsWith(this.pattern);return{isMatch:t,score:t?0:1,indices:[0,r.length-1]}}},hl=class extends Ur{constructor(r,{location:t=ie.location,threshold:n=ie.threshold,distance:i=ie.distance,includeMatches:s=ie.includeMatches,findAllMatches:o=ie.findAllMatches,minMatchCharLength:a=ie.minMatchCharLength,isCaseSensitive:l=ie.isCaseSensitive,ignoreLocation:u=ie.ignoreLocation}={}){super(r),this._bitapSearch=new ml(r,{location:t,threshold:n,distance:i,includeMatches:s,findAllMatches:o,minMatchCharLength:a,isCaseSensitive:l,ignoreLocation:u})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(r){return this._bitapSearch.searchIn(r)}},gl=class extends Ur{constructor(r){super(r)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(r){let t=0,n,i=[],s=this.pattern.length;for(;(n=r.indexOf(this.pattern,t))>-1;)t=n+s,i.push([n,t-1]);let o=!!i.length;return{isMatch:o,score:o?0:1,indices:i}}},td=[Jp,gl,Xp,Qp,ed,Zp,Yp,hl],Jx=td.length,BN=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,MN="|";function $N(e,r={}){return e.split(MN).map(t=>{let n=t.trim().split(BN).filter(s=>s&&!!s.trim()),i=[];for(let s=0,o=n.length;s<o;s+=1){let a=n[s],l=!1,u=-1;for(;!l&&++u<Jx;){let c=td[u],p=c.isMultiMatch(a);p&&(i.push(new c(p,r)),l=!0)}if(!l)for(u=-1;++u<Jx;){let c=td[u],p=c.isSingleMatch(a);if(p){i.push(new c(p,r));break}}}return i})}var UN=new Set([hl.type,gl.type]),rd=class{constructor(r,{isCaseSensitive:t=ie.isCaseSensitive,includeMatches:n=ie.includeMatches,minMatchCharLength:i=ie.minMatchCharLength,ignoreLocation:s=ie.ignoreLocation,findAllMatches:o=ie.findAllMatches,location:a=ie.location,threshold:l=ie.threshold,distance:u=ie.distance}={}){this.query=null,this.options={isCaseSensitive:t,includeMatches:n,minMatchCharLength:i,findAllMatches:o,ignoreLocation:s,location:a,threshold:l,distance:u},this.pattern=t?r:r.toLowerCase(),this.query=$N(this.pattern,this.options)}static condition(r,t){return t.useExtendedSearch}searchIn(r){let t=this.query;if(!t)return{isMatch:!1,score:1};let{includeMatches:n,isCaseSensitive:i}=this.options;r=i?r:r.toLowerCase();let s=0,o=[],a=0;for(let l=0,u=t.length;l<u;l+=1){let c=t[l];o.length=0,s=0;for(let p=0,d=c.length;p<d;p+=1){let f=c[p],{isMatch:m,indices:h,score:g}=f.search(r);if(m){if(s+=1,a+=g,n){let y=f.constructor.type;UN.has(y)?o=[...o,...h]:o.push(h)}}else{a=0,s=0,o.length=0;break}}if(s){let p={isMatch:!0,score:a/s};return n&&(p.indices=o),p}}return{isMatch:!1,score:1}}},nd=[];function jN(...e){nd.push(...e)}function id(e,r){for(let t=0,n=nd.length;t<n;t+=1){let i=nd[t];if(i.condition(e,r))return new i(e,r)}return new ml(e,r)}var yl={AND:"$and",OR:"$or"},sd={PATH:"$path",PATTERN:"$val"},od=e=>!!(e[yl.AND]||e[yl.OR]),KN=e=>!!e[sd.PATH],VN=e=>!pn(e)&&Qx(e)&&!od(e),Yx=e=>({[yl.AND]:Object.keys(e).map(r=>({[r]:e[r]}))});function rE(e,r,{auto:t=!0}={}){let n=i=>{let s=Object.keys(i),o=KN(i);if(!o&&s.length>1&&!od(i))return n(Yx(i));if(VN(i)){let l=o?i[sd.PATH]:s[0],u=o?i[sd.PATTERN]:i[l];if(!$r(u))throw new Error(CN(l));let c={keyId:Hp(l),pattern:u};return t&&(c.searcher=id(u,r)),c}let a={children:[],operator:s[0]};return s.forEach(l=>{let u=i[l];pn(u)&&u.forEach(c=>{a.children.push(n(c))})}),a};return od(e)||(e=Yx(e)),n(e)}function zN(e,{ignoreFieldNorm:r=ie.ignoreFieldNorm}){e.forEach(t=>{let n=1;t.matches.forEach(({key:i,norm:s,score:o})=>{let a=i?i.weight:null;n*=Math.pow(o===0&&a?Number.EPSILON:o,(a||1)*(r?1:s))}),t.score=n})}function qN(e,r){let t=e.matches;r.matches=[],Yt(t)&&t.forEach(n=>{if(!Yt(n.indices)||!n.indices.length)return;let{indices:i,value:s}=n,o={indices:i,value:s};n.key&&(o.key=n.key.src),n.idx>-1&&(o.refIndex=n.idx),r.matches.push(o)})}function WN(e,r){r.score=e.score}function GN(e,r,{includeMatches:t=ie.includeMatches,includeScore:n=ie.includeScore}={}){let i=[];return t&&i.push(qN),n&&i.push(WN),e.map(s=>{let{idx:o}=s,a={item:r[o],refIndex:o};return i.length&&i.forEach(l=>{l(s,a)}),a})}var dn=class{constructor(r,t={},n){this.options={...ie,...t},this.options.useExtendedSearch,this._keyStore=new Gp(this.options.keys),this.setCollection(r,n)}setCollection(r,t){if(this._docs=r,t&&!(t instanceof yo))throw new Error(EN);this._myIndex=t||tE(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(r){Yt(r)&&(this._docs.push(r),this._myIndex.add(r))}remove(r=()=>!1){let t=[];for(let n=0,i=this._docs.length;n<i;n+=1){let s=this._docs[n];r(s,n)&&(this.removeAt(n),n-=1,i-=1,t.push(s))}return t}removeAt(r){this._docs.splice(r,1),this._myIndex.removeAt(r)}getIndex(){return this._myIndex}search(r,{limit:t=-1}={}){let{includeMatches:n,includeScore:i,shouldSort:s,sortFn:o,ignoreFieldNorm:a}=this.options,l=$r(r)?$r(this._docs[0])?this._searchStringList(r):this._searchObjectList(r):this._searchLogical(r);return zN(l,{ignoreFieldNorm:a}),s&&l.sort(o),Xx(t)&&t>-1&&(l=l.slice(0,t)),GN(l,this._docs,{includeMatches:n,includeScore:i})}_searchStringList(r){let t=id(r,this.options),{records:n}=this._myIndex,i=[];return n.forEach(({v:s,i:o,n:a})=>{if(!Yt(s))return;let{isMatch:l,score:u,indices:c}=t.searchIn(s);l&&i.push({item:s,idx:o,matches:[{score:u,value:s,norm:a,indices:c}]})}),i}_searchLogical(r){let t=rE(r,this.options),n=(a,l,u)=>{if(!a.children){let{keyId:p,searcher:d}=a,f=this._findMatches({key:this._keyStore.get(p),value:this._myIndex.getValueForItemAtKeyId(l,p),searcher:d});return f&&f.length?[{idx:u,item:l,matches:f}]:[]}let c=[];for(let p=0,d=a.children.length;p<d;p+=1){let f=a.children[p],m=n(f,l,u);if(m.length)c.push(...m);else if(a.operator===yl.AND)return[]}return c},i=this._myIndex.records,s={},o=[];return i.forEach(({$:a,i:l})=>{if(Yt(a)){let u=n(t,a,l);u.length&&(s[l]||(s[l]={idx:l,item:a,matches:[]},o.push(s[l])),u.forEach(({matches:c})=>{s[l].matches.push(...c)}))}}),o}_searchObjectList(r){let t=id(r,this.options),{keys:n,records:i}=this._myIndex,s=[];return i.forEach(({$:o,i:a})=>{if(!Yt(o))return;let l=[];n.forEach((u,c)=>{l.push(...this._findMatches({key:u,value:o[c],searcher:t}))}),l.length&&s.push({idx:a,item:o,matches:l})}),s}_findMatches({key:r,value:t,searcher:n}){if(!Yt(t))return[];let i=[];if(pn(t))t.forEach(({v:s,i:o,n:a})=>{if(!Yt(s))return;let{isMatch:l,score:u,indices:c}=n.searchIn(s);l&&i.push({score:u,key:r,value:s,idx:o,norm:a,indices:c})});else{let{v:s,n:o}=t,{isMatch:a,score:l,indices:u}=n.searchIn(s);a&&i.push({score:l,key:r,value:s,norm:o,indices:u})}return i}};dn.version="7.0.0";dn.createIndex=tE;dn.parseIndex=kN;dn.config=ie;dn.parseQuery=rE;jN(rd);var iE=V(Ze(),1);var ad=class{constructor(r,t){this.sys=r;this.appRootDir=t;bd(this,"tokenCache",new Map)}get(r){if(!this.tokenCache.has(r)){let t=this.sys.readFileSync(this.sys.join(this.appRootDir,r))??"";this.tokenCache.set(r,go(t))}return this.tokenCache.get(r)}getForVisible(r,t){return t?this.get(r):0}calculateTotal(r){return r.reduce((t,n)=>t+this.get(n.value),0)}};async function sE(e,r,t,n,i){let s=new ad(e,t),o=c=>({title:(0,iE.dim)(c),value:c});if(r.length<4)return null;let a=r.map(o),l=new dn(a,{keys:["value"]});K.message("");let u=await(0,nE.default)({type:"autocomplete",name:"file",message:" Add context file (Ctrl+C to skip)",choices:r.map(o),suggest:async(c,p)=>{let d;c?d=l.search(c).map(m=>m.item):d=p.sort((m,h)=>{let g=n.get(m.value)??0;return(n.get(h.value)??0)-g}).slice(0,10);let f=[];for(let m of d)s.get(m.value)<=i&&f.push(m);return f.length===0?[{title:"No valid matching files",value:"",disabled:!0}]:f},validate:c=>{if(!c)return"Please select a file";let p=s.get(c);return p>i?`File exceeds token limit of ${i} (has ${p} tokens)`:!0}});return u.file?(n.set(u.file,4),u.file):null}var ud=V(require("prettier"),1);function HN(e){return Math.min(3,Math.max(0,e))}var fE=async(e,r,t)=>{r==="indexing"?await tx(e,t):r==="generate"||r==="gen"||r==="g"?await oE(e,t):r==="gen"?xr("code"):await oE(e,t)},oE=async(e,r)=>{console.log(""),ot((0,te.bgCyan)((0,te.bold)((0,te.white)(" code ")))+" "+(0,te.dim)(gt));let t=await Lt(e,r,{forceSpaceId:r.spaceId,builderPrivateKey:!0,builderPublicKey:!0}),n={history:[],undoStates:[],sessionId:dE.default.randomUUID(),selectedFilePaths:new Map};We("figma code started",{spaceId:t.builderPublicKey});let i=r.url;if(await Do(e),r.prompt){let l={userPrompt:r.prompt,mode:r.mode||"precise"};await aE(e,t,r,n,l.userPrompt,i,null),ut(`${(0,te.bgGreen)((0,te.bold)((0,te.white)(" Done! \u{1F389} ")))} ${(0,te.dim)("session "+n.sessionId)}`),pd(n.sessionId,t.builderPublicKey),We("figma code accepted",{spaceId:t.builderPublicKey,userPrompt:l.userPrompt});let u=n.history[n.history.length-1]?.id;u&&await cd(e,t,u,!!r.verbose,"positive");return}if(!process.stdout.isTTY&&process.env.FORCE_TTY!=="1")return he(`This command requires a TTY-enabled terminal.
|
|
1443
|
+
If you are using Windows Git Bash, try a different terminal or wrap the command with winpty.`),await ee(1);let s=e.getAppRootDir(),o=await e.getRepoInfo();for(!await Wr(e,s)&&!o.remoteUrl&&await wt({message:"Looks like this is an empty project. Would you like to set up a new Builder.io project?",active:"Yes, create new project",inactive:"Skip for now"})&&(await dl("npm",["init","builder.io@latest","--","--skip-question"],{stdio:"inherit",cwd:s}).command||(he(`Project creation failed. To create a new project manually, run:
|
|
1444
|
+
${(0,te.bold)("npm init builder.io@latest")}`),await ee(1)));;){let l=await JN(e,t,r,n,!!i);if(l.command==="exit")break;let u=l.userPrompt;u&&await aE(e,t,r,n,u,i,void 0)}};async function JN(e,r,t,n,i){let{isNextPage:s}=hE(n.nextUrl);if(s){K.warn("Large generation in progress.");let u=await wt({message:"Do you want to continue generating?",active:"Continue",inactive:"Stop"});return Me(u)||!u?(K.info("Generation stopped by user"),{command:"exit"}):{command:void 0,userPrompt:"continue"}}let o=e.getAppRootDir(),a="",l="precise";if(n.history.length===0){let p=await Mt({message:i?"How does the design integrate into the project? (be detailed)":"What do you want to do?",placeholder:i?'some examples: "add a header to the layout of the app", "add a new contact page", "update the card component"':'some examples: "add a new page", "add a new component", "update the button component"',validate(d){if(i){if(d.length===0)return"please, enter a detailed instruction";if(d.length<10)return"a more detailed instruction is needed"}else if(d.length===0)return"please, provide some prompt"}});if(Me(p))return he("See you later! \u{1F44B}"),pd(n.sessionId,r.builderPublicKey),{command:"exit"};if(a=p??"integrate design into the app, might be a new page/component/layout depending on the design",i){let d=l??await Jd({message:"How do you want to apply the changes?",options:[{value:"precise",label:"Precise",hint:"imports exactly as designed, might include artifacts"},{value:"creative",label:"Match-my-style",hint:"design might be slighly changed to match the codebase, but looks better"}]});if(Me(d))return he("Command cancelled"),{command:"exit"};l=d}else l="creative"}else{let u=n.history[n.history.length-1]?.id;K.message(`What do you want to do next?
|
|
1451
1445
|
|
|
1452
1446
|
${(0,te.bgBlack)(" Ctrl+C ")} ${(0,te.dim)("to accept changes and exit")}
|
|
1453
|
-
${(0,te.bgBlack)(' "undo" ')} ${(0,te.dim)("to undo last changes and try again")}`,{symbol:(0,te.green)("\u2714")});let c=await Mt({message:`${(0,te.bgBlack)(" Follow up ")} with more instructions:`,placeholder:' Reply "accept", "undo", or provide follow-up feedback (Ctrl+C to exit)',validate(f){if(!f)return"Please enter a value (Ctrl+C & exit)"}});if(
|
|
1447
|
+
${(0,te.bgBlack)(' "undo" ')} ${(0,te.dim)("to undo last changes and try again")}`,{symbol:(0,te.green)("\u2714")});let c=await Mt({message:`${(0,te.bgBlack)(" Follow up ")} with more instructions:`,placeholder:' Reply "accept", "undo", or provide follow-up feedback (Ctrl+C to exit)',validate(f){if(!f)return"Please enter a value (Ctrl+C & exit)"}});if(Me(c)||c.trim().toLowerCase()==="accept")return ut(`${(0,te.bgGreen)((0,te.bold)((0,te.white)(" Done! \u{1F389} ")))} ${(0,te.dim)("session "+n.sessionId)}`),pd(n.sessionId,r.builderPublicKey),We("figma code accepted",{spaceId:r.builderPublicKey,userPrompt:a}),u&&await cd(e,r,u,!!t.verbose,"positive"),{command:"exit"};let d=c.trim().toLowerCase().replace(/"|'/g,"");if(d.startsWith("undo")){u&&await cd(e,r,u,!!t.verbose,"negative"),n.history.pop();let f=n.history.pop(),m=n.undoStates.pop();if(m){for(let g of m.files)g.content?await e.writeFile(e.join(o,g.path),g.content):await e.unlink(e.join(o,g.path));K.warn(`Restored files to previous state:
|
|
1454
1448
|
${m.files.map(g=>(0,te.dim)(" - "+g.path)).join(`
|
|
1455
1449
|
`)}
|
|
1456
1450
|
`)}return{command:"undo",userPrompt:d!=="undo"&&f?.content?`${f}
|
|
@@ -1462,7 +1456,7 @@ ${c.highlightAuto(P.content).value.split(`
|
|
|
1462
1456
|
`).slice(-10).map(re=>re.length>process.stdout.columns?re.slice(0,process.stdout.columns-5):re).join(`
|
|
1463
1457
|
`)}`)};var m=G;async function U(P){if(D&&(process.stdout.write(`
|
|
1464
1458
|
`),D=!1),P.type==="user"&&(f=Et(),f.start(P.content)),P.type==="thinking"&&(f=Et(),f.start("Planning")),P.type==="file"&&!P.synthetic&&(f=Et(),f.start(`${P.actionTitle??P.artifactTitle}`)),P.type==="diff"&&(f=Et(),f.start(`${P.actionTitle??P.artifactTitle}`)),P.type==="done"){if(Array.isArray(P.actions))for(let B of P.actions){let re=B.filePath;if(B.type==="file"&&re&&!B.incomplete){let F=e.join(a,re),X=e.existsSync(F)?e.readFileSync(F):null;n.undoStates[n.undoStates.length-1].files.push({path:re,content:X}),await e.writeFile(F,B.content),n.selectedFilePaths.set(re,3),g.includes(re)||g.push(re)}}if(n.history.push({role:"user",content:i}),n.history.push({role:"assistant",content:P.content,id:P.id}),P.usage&&P.usage.total/P.usage.limits.aiGeneration>.5&&K.info(oF(P.usage.total,P.usage.limits.aiGeneration)),P.stopReason==="limit"){K.error((0,te.red)("\u{1F6A8} The request was cancelled because it reached the account limits."));let B=new URL("https://builder.io/account/subscription");if(B.searchParams.set("space_id",r.builderPublicKey),await wt({message:(0,te.dim)(B.href),active:"Open subscription page",inactive:"Exit"})){let{default:F}=await import("open");await F(B.href)}return await ee(1),!0}else f&&(f.stop(),f=void 0),f=Et(),f.start("Applying changes...")}return P.type==="continue"?(f&&(f.stop((0,te.green)("Changes are applied")),f=void 0),n.nextUrl=P.nextUrl,!0):!1}async function oe(P){if(P.type==="done"&&f&&(f.stop((0,te.green)("Changes are applied")),f=void 0),P.type==="thinking"&&f&&(f.stop("Implementation plan generated"),f=void 0),P.type==="user"&&f&&(f.stop(),f=void 0),P.type==="diff"&&f&&(f.stop(`${P.actionTitle??P.artifactTitle}: ${(0,te.dim)(P.filePath)}`),f=void 0),P.type==="file"&&P.filePath&&f&&!P.synthetic&&(f.stop(`${P.actionTitle??P.artifactTitle??"Created"}: ${(0,te.dim)(P.filePath)}`),f=void 0),P.type==="shell"){K.message(`Requested to run command:
|
|
1465
|
-
${(0,te.bgBlack)(" "+P.content.trim()+" ")}`,{symbol:(0,te.magenta)("~")});let B=await wt({message:"Do you want to execute and continue?",active:`Execute ${(0,te.dim)("(recommended)")}`,inactive:"Skip"});if(
|
|
1459
|
+
${(0,te.bgBlack)(" "+P.content.trim()+" ")}`,{symbol:(0,te.magenta)("~")});let B=await wt({message:"Do you want to execute and continue?",active:`Execute ${(0,te.dim)("(recommended)")}`,inactive:"Skip"});if(Me(B)||!B){K.warn(`Command skipped. Run it manually:
|
|
1466
1460
|
${(0,te.bgBlack)(" "+P.content+" ")}.`);return}f=Et(),f.start(`Running \`${P.content}\``),await nF(P.content,{shell:!0,stdio:"inherit"})?f.stop(`Command \`${P.content}\` completed`):f.stop(`Command \`${P.content}\` failed`,2),f=void 0}}if(f&&!C&&(f.stop("\u{1F4A1}"),f=void 0,C=!0),N.type==="delta"){let P=N.content,B=T[T.length-1];B&&(B.content+=P),await G(B,P)}else{let P=T[T.length-1];if(P&&(P.incomplete=!1,await oe(P)),T.push(N),await U(N))break}}catch{}D&&(process.stdout.write(`
|
|
1467
1461
|
`),D=!1);return}finally{f&&(f.stop(),f=void 0)}}async function*QN(e,r,t){let n=JSON.stringify(r),i=new URL(`${fr}/codegen/completion`);i.searchParams.set("apiKey",e.builderPublicKey),i.searchParams.set("userId",e.userId),t&&console.log("FETCH",i,n);let s=await nt(i,{method:"POST",body:n,headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.builderPrivateKey}`}});if(!s.ok)throw new Error(`Failed to generate completion:
|
|
1468
1462
|
`+await s.text());let o=cl(s.body);for await(let a of o){if(a.length===0)continue;yield JSON.parse(a)}}async function cd(e,r,t,n,i,s){try{let o=JSON.stringify({id:t,feedbackText:s,feedbackSentiment:i}),a=new URL(`${fr}/codegen/feedback`);a.searchParams.set("apiKey",r.builderPublicKey),a.searchParams.set("userId",r.userId),n&&console.log("FETCH",a,o),await nt(a,{method:"POST",body:o,headers:{"Content-Type":"application/json",Authorization:`Bearer ${r.builderPrivateKey}`}})}catch(o){e.Sentry?.captureException(o)}}async function ZN(e,r,t,n){try{let i=new URL(`${fr}/codegen/search`);i.searchParams.set("apiKey",r.builderPublicKey),i.searchParams.set("userId",r.userId),i.searchParams.set("v2","true"),t.verbose&&console.log("FETCH",i,JSON.stringify(n));let s=await nt(i,{method:"POST",body:JSON.stringify(n),headers:{"Content-Type":"application/json",Authorization:`Bearer ${r.builderPrivateKey}`}});if(!s.ok)throw new Error(`Failed to search codebase:
|
|
@@ -1479,8 +1473,8 @@ ${(0,te.dim)(n.join(`
|
|
|
1479
1473
|
`))}`);else{let i=t.filter(s=>s.endsWith("/tsconfig.json"));i.length>0&&K.warn(`This command works best when executed at the root of a single project.
|
|
1480
1474
|
Found several ${(0,te.bold)("tsconfig.json")} files (${i.length}) instead:
|
|
1481
1475
|
${(0,te.dim)(i.join(`
|
|
1482
|
-
`))}`)}}async function bo(e){let r=await e.getRepoInfo(),t={client:"@builder.io/dev-tools",clientVersion:e.version,nodeVersion:process.version,frameworks:e.getFrameworks().map(n=>n.name),systemPlatform:process.platform,systemEOL:Cl.default.EOL,systemArch:Cl.default.arch(),inGitRepo:!!r.remoteUrl};try{let n=Cl.default.userInfo();t.systemShell=n.shell}catch{}return t}var yE=async(e,r)=>{let t=Sl(r);console.log(""),ot((0,ge.bgCyan)((0,ge.bold)((0,ge.white)(" figma publish ")))+" "+(0,ge.dim)(gt)),await Do(e);let n=await ai(e),{figmaBuilderLinks:i,foundErrors:s,figmaLinksToResolve:o}=await fo({force:r.force,mappingFiles:n,sys:e,print:!0}),{builderPrivateKey:a,builderPublicKey:l,userId:u,spaceName:c,figmaAuth:p}=await Lt(e,r,{forceSpaceId:r.spaceId,builderPrivateKey:!0,builderPublicKey:!0,figmaAuth:o.length>0});p&&o.length>0&&await nl(p,i,o);let d;if(d||(d=await wn(e)),We("figma publish started",{spaceId:l,mappingFiles:n.length}),s){if(We("figma publish user error",{spaceId:l,mappingFiles:n.length,figmaBuilderLinks:i.length}),r.force!==!0)return K.message(""),
|
|
1483
|
-
${(0,ge.dim)("Existing mappings will be overwritten")}`,active:"Publish",inactive:"Cancel"});if(
|
|
1476
|
+
`))}`)}}async function bo(e){let r=await e.getRepoInfo(),t={client:"@builder.io/dev-tools",clientVersion:e.version,nodeVersion:process.version,frameworks:e.getFrameworks().map(n=>n.name),systemPlatform:process.platform,systemEOL:Cl.default.EOL,systemArch:Cl.default.arch(),inGitRepo:!!r.remoteUrl};try{let n=Cl.default.userInfo();t.systemShell=n.shell}catch{}return t}var yE=async(e,r)=>{let t=Sl(r);console.log(""),ot((0,ge.bgCyan)((0,ge.bold)((0,ge.white)(" figma publish ")))+" "+(0,ge.dim)(gt)),await Do(e);let n=await ai(e),{figmaBuilderLinks:i,foundErrors:s,figmaLinksToResolve:o}=await fo({force:r.force,mappingFiles:n,sys:e,print:!0}),{builderPrivateKey:a,builderPublicKey:l,userId:u,spaceName:c,figmaAuth:p}=await Lt(e,r,{forceSpaceId:r.spaceId,builderPrivateKey:!0,builderPublicKey:!0,figmaAuth:o.length>0});p&&o.length>0&&await nl(p,i,o);let d;if(d||(d=await wn(e)),We("figma publish started",{spaceId:l,mappingFiles:n.length}),s){if(We("figma publish user error",{spaceId:l,mappingFiles:n.length,figmaBuilderLinks:i.length}),r.force!==!0)return K.message(""),he(`Please fix the issues and try again, or use the ${(0,ge.bold)("--force")} flag to publish regardless.`),await ee(1);K.warn("Local mappings contain some errors, but --force flag was used, skipping.")}let f=c?`${(0,ge.bold)(c)} ${(0,ge.dim)("("+l+")")}`:`space id "${(0,ge.bold)(l)}"`;if(n.length===0){K.warning(`No mappings found. Publishing will remove all existing mapping in space: ${f}.`);let y=t||r.yes||await wt({message:"Do you want to continue?",active:"Publish",inactive:"Cancel"});if(Me(y)||!y)return he("Publish cancelled"),await ee(1)}else{let y=t||r.yes||await wt({message:`Do you want to publish the found mappings to ${f}?
|
|
1477
|
+
${(0,ge.dim)("Existing mappings will be overwritten")}`,active:"Publish",inactive:"Cancel"});if(Me(y)||!y)return he("Publish cancelled"),await ee(1)}let m=hi(),h=await e.getRepoInfo();if(r.dryrun||(m.start("Publishing Figma Mappings"),await fF(e,{spaceId:l,userId:u,privateKey:a,figmaBuilderLinks:i,repoInfo:h}),m.stop(i.length>0?`${i.length} mappings uploaded`:"All mappings removed from the Builder space")),r.verbose||r.dryrun){let y=Xn(Tn);K.info(y.highlight("json",JSON.stringify(i,null,2)).value)}await xo(e,l,d,!0),K.success((0,ge.bgGreen)((0,ge.bold)((0,ge.white)(" Done! \u{1F389} "))));let g={react:"npm run start",angular:"npm run start",vue:"npm run dev",svelte:"npm run dev",next:"npm run dev",remix:"npm run dev"}[d.framework]??"npm run start";ut((0,ge.dim)(`You can now start the dev server:
|
|
1484
1478
|
|
|
1485
1479
|
`)+(0,ge.bgBlack)((0,ge.white)((0,ge.bold)(` ${g} `)))+`
|
|
1486
1480
|
|
|
@@ -1490,11 +1484,11 @@ ${(0,ge.dim)("Existing mappings will be overwritten")}`,active:"Publish",inactiv
|
|
|
1490
1484
|
`+m.map(y=>{let D=!1;y.figmaKey?(D||(D=l.has(y.figmaKey)),l.add(y.figmaKey)):y.figmaUrl&&(D||(D=l.has(y.figmaUrl)),l.add(y.figmaUrl));let C="";switch(y.figmaKey){case"design-tokens":C=" "+(0,ge.cyan)("\u2747\uFE0E Design tokens mapper");break;case"*":C=" "+(0,ge.yellow)("\u25CF Generic mapper");break;default:C=` ${(0,ge.magenta)("\u2756 "+oi(y.figmaName))} ${(0,ge.dim)("\u2192")} ${y.builderName==="-"?"-":"<"+y.builderName+">"}`;break}return D&&(h=!0,C=(0,ge.bgRed)(C+(0,ge.bold)(" <= duplicated"))),C}).join(`
|
|
1491
1485
|
`);h?(u=!0,K.error(g)):K.info(g)}}catch(d){return fd.captureException(d),console.error(d),await ee(1)}let c=i.filter(p=>p.figmaUrl&&!p.figmaKey).map(p=>p.figmaUrl);return{figmaBuilderLinks:i,figmaLinksToResolve:c,foundErrors:u}}function mF(e){let{messageText:r}=e;if(typeof r=="string")return r;let{next:t}=r,n=[r.messageText];return t&&n.push(t.map(i=>i.messageText).join(`
|
|
1492
1486
|
`)),n.join(`
|
|
1493
|
-
`)}var EE=require("crypto");var Sl=e=>!!(process.env.CI||e.ci),Lt=async(e,r,t)=>{let n=Sl(r)?{}:DF(e),i=n.spaceName,s=n.userId,o,a=process.env.BUILDER_PUBLIC_KEY??
|
|
1494
|
-
|
|
1487
|
+
`)}var EE=require("crypto");var Sl=e=>!!(process.env.CI||e.ci),Lt=async(e,r,t)=>{let n=Sl(r)?{}:DF(e),i=n.spaceName,s=n.userId,o,a=process.env.BUILDER_PUBLIC_KEY??n.builderPublicKey,l=process.env.BUILDER_PRIVATE_KEY??n.builderPrivateKey,u=process.env.FIGMA_PERSONAL_TOKEN??r.figmaToken;if(u?o={access_token:u,oauth:!1}:o=n.figmaAuth,t.forceSpaceId&&!r.yes&&a&&a!==t.forceSpaceId&&(K.warning(`CLI is currently logged in space ${(0,Ln.yellow)(a)},
|
|
1488
|
+
However the command required --spaceId=${(0,Ln.green)(t.forceSpaceId)}`),await wt({message:"Do you wanna switch spaces?",active:"Yes",inactive:`Stay in current ${i} space`})?(a=t.forceSpaceId,l=void 0,i=void 0,s=void 0):K.warning("Staying in the current space. Some other auth issues might occur.")),Sl(r)){if(!o&&t.figmaAuth)throw new Error(`No Figma personal token found.
|
|
1495
1489
|
Please set the FIGMA_PERSONAL_TOKEN environment variable.`);if(!l&&t.builderPrivateKey)throw new Error(`No Builder private key found.
|
|
1496
1490
|
Please set the BUILDER_PRIVATE_KEY environment variable.`);if(!a&&t.builderPublicKey)throw new Error(`No Builder public key found.
|
|
1497
|
-
Please set the BUILDER_PUBLIC_KEY environment variable.`);return{figmaAuth:o,builderPublicKey:a,builderPrivateKey:l}}if((t.force||!o&&t.figmaAuth)&&(o=await gF(),DE(e,{figmaAuth:o})),t.force||!l&&t.builderPrivateKey||!a&&t.builderPublicKey){let{privateKey:c,spaceId:p,spaceName:d,userId:f}=await yF(e,t.forceSpaceId);if(t.forceSpaceId&&p!==t.forceSpaceId)throw new Error(`OAuth flow returned space ${(0,Ln.yellow)(p)}, however the command
|
|
1491
|
+
Please set the BUILDER_PUBLIC_KEY environment variable.`);return{figmaAuth:o,builderPublicKey:a,builderPrivateKey:l}}if((t.force||!o&&t.figmaAuth)&&(o=await gF(),DE(e,{figmaAuth:o})),t.force||!l&&t.builderPrivateKey||!a&&t.builderPublicKey){let{privateKey:c,spaceId:p,spaceName:d,userId:f}=await yF(e,t.forceSpaceId);if(t.forceSpaceId&&p!==t.forceSpaceId)throw new Error(`OAuth flow returned space ${(0,Ln.yellow)(p)}, however the command specified --spaceId=${(0,Ln.green)(t.forceSpaceId)}`);a=p,l=c,i=d,s=f,await ob(s),await xo(e,p,void 0,!1),DE(e,{builderPublicKey:a,builderPrivateKey:l,spaceName:i,userId:s})}return s&&fn.setUser({id:s,username:process.env.USER||process.env.USERNAME||"unknown"}),(i||a)&&fn.setContext("builder",{spaceId:a,spaceName:i}),{figmaAuth:o,builderPublicKey:a,builderPrivateKey:l,spaceName:i,userId:s}},hF="RHr2ed743waC2g2ZHMEJSn6O0NQ08L";async function gF(){let e=(0,EE.randomUUID)();return SE({name:"Figma",port:5283,requestListener:async(r,t,n,i,s)=>{let o=new URL(t.url||"",`http://localhost:${r}`);if(o.pathname==="/figma-connect"){let a=o.searchParams.get("code"),l=o.searchParams.get("state");if(a&&e===l){let u=await nt("https://www.figma.com/api/oauth/token",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({client_id:"nrGCqw6TLl95QJhVDi097A",client_secret:hF,redirect_uri:"http://localhost:5283/figma-connect",code:a,grant_type:"authorization_code"}).toString()});u.ok||s(new Error("Failed to get figma access token"));let c=await u.json();n.end(`<!DOCTYPE html>
|
|
1498
1492
|
<html lang="en" dir="ltr">
|
|
1499
1493
|
<head>
|
|
1500
1494
|
<meta charset="utf-8" />
|
|
@@ -1718,8 +1712,8 @@ OPEN: ${(0,Ln.dim)(c)}`),i=Et(),i.start(`Waiting for ${e.name} authentication`),
|
|
|
1718
1712
|
${i.map(u=>` - ${(0,os.relative)(e.getAppRootDir(),u)}`).join(`
|
|
1719
1713
|
`)}
|
|
1720
1714
|
|
|
1721
|
-
Migration is going to create new files, possibly duplicates.`);let l=await wt({message:"Do you want to continue?",initialValue:!1});if(!l||
|
|
1722
|
-
`));let a=await Mt({message:`Where do you want to save the figma mappings? ${(0,Ge.dim)("(Ctrl+C to exit)")}`,initialValue:"./src/mappings",defaultValue:"./src/mappings",placeholder:"./src/mappings",validate:l=>{if((0,os.extname)(l)!=="")return"It must be a valid directory path, not a file";if((0,os.isAbsolute)(l))return"It must be a relative path"}});if(
|
|
1715
|
+
Migration is going to create new files, possibly duplicates.`);let l=await wt({message:"Do you want to continue?",initialValue:!1});if(!l||Me(l))return he("Migration cancelled"),await ee(1)}K.message("We are about to import your existing figma mappings into this local repo.");let s=hi();s.start("Fetching figma mappings");let o=await md({privateKey:t,spaceId:n});s.stop(`Fetched ${o.length} figma mappings:`),K.message(o.map(l=>{switch(l.figmaKey){case"design-tokens":return(0,Ge.cyan)("\u2747\uFE0E Design tokens mapper");case"*":return(0,Ge.yellow)("\u25CF Generic mapper");default:return`${(0,Ge.magenta)("\u2756 "+oi(l.figmaName))} ${(0,Ge.dim)("\u2192")} ${l.builderName}`}}).join(`
|
|
1716
|
+
`));let a=await Mt({message:`Where do you want to save the figma mappings? ${(0,Ge.dim)("(Ctrl+C to exit)")}`,initialValue:"./src/mappings",defaultValue:"./src/mappings",placeholder:"./src/mappings",validate:l=>{if((0,os.extname)(l)!=="")return"It must be a valid directory path, not a file";if((0,os.isAbsolute)(l))return"It must be a relative path"}});if(Me(a))return he("Migration cancelled"),await ee(1);await(0,Tl.mkdir)(a,{recursive:!0}),await Promise.all(o.map(async l=>{let u=await xF(l),c;switch(l.figmaKey){case"design-tokens":c="design-tokens";break;case"*":c="generic";break;default:c=oi(l.figmaName)}let p=a+"/"+c+".mapper.tsx";return K.info((0,Ge.green)("created ")+(0,Ge.dim)(p)),(0,Tl.writeFile)(p,u)})),K.info("Check out the docs for following steps: https://builder.io/docs/figma/figma-mappings"),ut((0,Ge.bgGreen)((0,Ge.bold)((0,Ge.white)(" Done! \u{1F389} ")))+` ${o.length} mappings imported`),We("figma migrate success",{spaceId:n,mappingFiles:o.length})};async function md(e){let r=await nt(`${bF}/api/internal/kv/${e.spaceId}/figma-builder?apiKey=${e.spaceId}`,{headers:{Authorization:`Bearer ${e.privateKey}`}});if(!r.ok)throw new Error(`Failed to fetch figma-builder links: ${r.statusText}`);let t=await r.json();if(!(t instanceof Object&&"figmaBuilderLinks"in t))throw new Error("Invalid response");return t.figmaBuilderLinks}async function xF(e){let r="figmaMapping",t=e.originalInputMapper?.match(/function Mapper\(\s*([a-zA-Z0-9_$]+)\s*(?::[^)])?\s*\)/)?.[1],n=e.originalInputMapper?.match(/function Mapper\([^)]*\)(\s*{([^]*))$/)?.[1],i;switch(e.figmaKey){case"design-tokens":i=`${r}({
|
|
1723
1717
|
designTokenMapper(${t||"designToken"})${n}
|
|
1724
1718
|
})`;break;case"*":i=`${r}({
|
|
1725
1719
|
genericMapper(${t||"figma"})${n}
|
|
@@ -1732,17 +1726,17 @@ ${EF(e)}
|
|
|
1732
1726
|
|
|
1733
1727
|
${i}`,"typescript",void 0)}function EF(e){let{exportType:r,importName:t,importPath:n}=e;if(t&&n){let i=JSON.stringify(n);return r==="named"?`import { ${t} } from ${i};`:`import ${t} from ${i};`}return""}var Al=V(require("prompts"),1),ls=V(require("fs"),1);var Z=V(Ze(),1),PE=require("path");var IE=V(require("@sentry/node"),1),Eo=V(AE(),1);var NE=async(e,r)=>{if(console.log(""),ot((0,Z.bgMagenta)((0,Z.bold)((0,Z.white)(" figma generate ")))+" "+(0,Z.dim)(gt)),K.message((0,Z.dim)(`This command will help you create new mapper files to connect Figma components to your code components.
|
|
1734
1728
|
Check out `)+(0,Z.bold)((0,Z.cyan)("https://www.builder.io/c/docs/cli-mapping"))+(0,Z.dim)(" for more details.")),r.componentName&&!r.mappingOutput)return K.error("Mapping output must be provided when mapping a single component"),await ee(1);if(typeof r.mappingOutput=="string"&&!pt(r.mappingOutput))return K.error("Mapping output must end with .mapper.{tsx, ts, jsx, js, mjs}, e.g. my-component.mapper.tsx"),await ee(1);await Do(e);let t;t=Et(),t.start("Loading type information");let n;try{n=await wn(e),t.stop("Repo's framework detected")}catch{return t.stop("Repo's framework is not supported"),We("figma generate, framework not supported",{frameworks:e.getFrameworks().map(g=>g.name)}),t.message(`We can not generate mappers automatically, but it's possible to do it manually:
|
|
1735
|
-
https://www.builder.io/c/docs/mapping-functions`),await ee(1)}let i=[],s;if(r.token)K.message(),s=await Lt(e,r,{}),i=await Db(s,r.token,!!r.verbose);else{let h=r._.slice(2);if(!h.length)return
|
|
1736
|
-
npx builder.io figma generate "https://..."`),xr(),await ee(1);if(s=await Lt(e,r,{builderPrivateKey:!0,builderPublicKey:!0,figmaAuth:bb(h),forceSpaceId:r.spaceId}),!s.builderPrivateKey||!s.builderPublicKey)return
|
|
1729
|
+
https://www.builder.io/c/docs/mapping-functions`),await ee(1)}let i=[],s;if(r.token)K.message(),s=await Lt(e,r,{}),i=await Db(s,r.token,!!r.verbose);else{let h=r._.slice(2);if(!h.length)return he(`No Figma URL provided, use:
|
|
1730
|
+
npx builder.io figma generate "https://..."`),xr(),await ee(1);if(s=await Lt(e,r,{builderPrivateKey:!0,builderPublicKey:!0,figmaAuth:bb(h),forceSpaceId:r.spaceId}),!s.builderPrivateKey||!s.builderPublicKey)return he("Missing builder.io credentials"),await ee(1);let g=await CE(s.builderPublicKey,s.builderPrivateKey),y=await md({privateKey:s.builderPrivateKey,spaceId:s.builderPublicKey});if(!g.features?.includes("component-mapping")&&y.length===0)return he("Component mapping is an enterprise feature. Please visit "+(0,Z.bold)((0,Z.cyan)("https://www.builder.io/unlock-enterprise"))+" to start your trial."),await ee(1);t&&t.stop(),t=Et(),t.start("Gathering Figma component info"),i=await xb(s.figmaAuth,{privateKey:s.builderPrivateKey,spaceId:s.builderPublicKey},h)}We("figma generate started",{spaceId:s.builderPublicKey,mode:r.componentName?"non-interactive":"interactive"});let o=Xn(Tn),a,l,u=await n.getRegistry({readAllInputTypes:!0});t.stop("Figma's component metadata loaded"),t=void 0,K.message();let c=await ai(e),{figmaBuilderLinks:p,figmaLinksToResolve:d}=await fo({force:!0,print:!1,mappingFiles:c,sys:e});d.length>0&&s.figmaAuth&&await nl(s.figmaAuth,p,d);let f=await AF(i,p);i=i.filter(([,h])=>f.includes(h.key));let m=[];for(let h=0;h<i.length;h++){let[g,y]=i[h];h>0&&K.info(`Mapped ${h} / ${i.length} components:
|
|
1737
1731
|
|
|
1738
1732
|
${i.map(([,G],P)=>h>P?G.documentName==="-"?(0,Z.dim)(` \u2756 ${G.name}`)+" "+(0,Z.yellow)("(skipped)"):(0,Z.green)(` \u2714 ${G.name} \u2192 <${G.documentName} />`):h===P?(0,Z.underline)(` \u2192 ${G.name}`):(0,Z.dim)(` \u2756 ${G.name}`)).filter(Boolean).join(`
|
|
1739
1733
|
`)}
|
|
1740
|
-
`);let D,C,x,b,T=(await n.findAllDependencies()).filter(G=>!FF(G.name)),O=r.componentName?u.components.find(G=>G.name===r.componentName):await vE(u.components,y.name,T.length>0);if(O==="external package"){let G=await NF(T);n.addExternalPackage(G);let P=await n.getRegistry({readAllInputTypes:!0});P&&(u=P);let B=await vE(u?.components.filter(re=>re.importPath===G),y.name,!0);B==="skip"?D=void 0:D=B}else O==="skip"?D=void 0:D=O;if(!D){y.documentName="-",K.warning("Skipping mapping for "+y.name);continue}let L=await PF(D),N,U={componentNames:u.components.map(G=>G.name),figmaNode:y,figmaUrl:g,registeredCmp:D,token:r.token,docsUrl:L,userContext:await bo(e)};try{for(;;){U.previousCompletion=x,U.userPrompt=N;let G=_F(s,U,!!r.verbose);for await(let B of G)B.type==="step"&&(t&&t.stop(),t=Et(),t.start(B.title)),B.type==="done"&&(C=B.code,x=B.completion,b=B.fileName);if(C)t&&t.stop("Generated mapping"),K.message(o.highlight("typescript",C).value);else return t&&t.stop("Failed to generate mapping",1),We("figma generate, LLM failed",{spaceId:s.builderPublicKey,componentName:y.name}),await ee(1);if(r.componentName)break;let P=await vF();if(P.trim()==="good")break;We("figma add follow up prompt",{spaceId:s.builderPublicKey,prompt:P}),N=P}}catch(G){return IE.captureException(G),
|
|
1734
|
+
`);let D,C,x,b,T=(await n.findAllDependencies()).filter(G=>!FF(G.name)),O=r.componentName?u.components.find(G=>G.name===r.componentName):await vE(u.components,y.name,T.length>0);if(O==="external package"){let G=await NF(T);n.addExternalPackage(G);let P=await n.getRegistry({readAllInputTypes:!0});P&&(u=P);let B=await vE(u?.components.filter(re=>re.importPath===G),y.name,!0);B==="skip"?D=void 0:D=B}else O==="skip"?D=void 0:D=O;if(!D){y.documentName="-",K.warning("Skipping mapping for "+y.name);continue}let L=await PF(D),N,U={componentNames:u.components.map(G=>G.name),figmaNode:y,figmaUrl:g,registeredCmp:D,token:r.token,docsUrl:L,userContext:await bo(e)};try{for(;;){U.previousCompletion=x,U.userPrompt=N;let G=_F(s,U,!!r.verbose);for await(let B of G)B.type==="step"&&(t&&t.stop(),t=Et(),t.start(B.title)),B.type==="done"&&(C=B.code,x=B.completion,b=B.fileName);if(C)t&&t.stop("Generated mapping"),K.message(o.highlight("typescript",C).value);else return t&&t.stop("Failed to generate mapping",1),We("figma generate, LLM failed",{spaceId:s.builderPublicKey,componentName:y.name}),await ee(1);if(r.componentName)break;let P=await vF();if(P.trim()==="good")break;We("figma add follow up prompt",{spaceId:s.builderPublicKey,prompt:P}),N=P}}catch(G){return IE.captureException(G),he("LLM failed:"+String(G)),await ee(1)}let oe=b??`${oi(y.name)}.mapper.tsx`;y.documentName=D.importName,C&&(r.mappingOutput?(l=r.mappingOutput,a=e.dirname(l),ls.default.mkdirSync(a,{recursive:!0})):a?l=e.join(a,oe):(l=await TF(oe),a=e.dirname(l),ls.default.mkdirSync(a,{recursive:!0})),ls.default.writeFileSync(l,await or(C,void 0,l)),m.push(l)),!D.isRegistered&&D.id&&(t&&t.stop(),t=Et(),t.start("Registering builder component in registry"),await n.registerComponent({cmpId:D.id}),t.stop(`<${D.importName}> added to the builder registry`))}s.builderPublicKey&&await xo(e,s.builderPublicKey,n,!0),a?(m.length===1?K.success(`${(0,Z.bgGreen)((0,Z.bold)((0,Z.white)(" Done! \u{1F389} ")))} New mapper file saved in: ${(0,Z.dim)(m[0])}`):K.success(`${(0,Z.bgGreen)((0,Z.bold)((0,Z.white)(" Done! \u{1F389} ")))} Created ${m.length} new mapping files:
|
|
1741
1735
|
${m.map(h=>` - ${h}`).join(`
|
|
1742
1736
|
`)}`),ut((0,Z.dim)(`Figma mappings need to be published to come into effect. You can do this by running:
|
|
1743
1737
|
|
|
1744
1738
|
`)+(0,Z.bgBlack)((0,Z.white)((0,Z.bold)(" npx builder.io figma publish ")))+`
|
|
1745
1739
|
|
|
1746
|
-
`+(0,Z.dim)("Read more: https://www.builder.io/c/docs/cli-mapping#publishing-a-new-mapping")),We("figma add success",{spaceId:s.builderPublicKey,mappingPath:a,mode:r.componentName?"non-interactive":"interactive"})):ut("No new mappings were created.")};async function TF(e){let t=`${ls.default.existsSync("src")?"src/":""}mappings/${e}`,n=await Mt({message:`Where do you want to save the new mapping? ${(0,Z.dim)("(Ctrl+C to exit)")}`,defaultValue:t,placeholder:t,initialValue:t,validate(i){if((0,PE.isAbsolute)(i))return"Please enter a relative path, not absolute";if(!pt(i))return"Please enter a path that ends with '.mapper.{tsx,jsx,ts,js,mjs}'";if(ls.default.existsSync(i))return"File already exists, please choose a different name"}});return
|
|
1747
|
-
`+await o.text());let a=cl(o.body);for await(let l of a){if(l.length===0)continue;yield JSON.parse(l)}}var Vt=V(Ze(),1);var _E=async(e,r,t)=>{if(!t.skipInstallation&&await kF(e)&&(t.yes||await wt({message:"Welcome to Builder.io! Would you like to set up your integration now?",active:"Yes, let's integrate!",inactive:"No, I'll do it later"})?await dl("npm",["init","builder.io@latest","--","--skip-question"],{stdio:"inherit",cwd:e.getAppRootDir()}).command||(
|
|
1740
|
+
`+(0,Z.dim)("Read more: https://www.builder.io/c/docs/cli-mapping#publishing-a-new-mapping")),We("figma add success",{spaceId:s.builderPublicKey,mappingPath:a,mode:r.componentName?"non-interactive":"interactive"})):ut("No new mappings were created.")};async function TF(e){let t=`${ls.default.existsSync("src")?"src/":""}mappings/${e}`,n=await Mt({message:`Where do you want to save the new mapping? ${(0,Z.dim)("(Ctrl+C to exit)")}`,defaultValue:t,placeholder:t,initialValue:t,validate(i){if((0,PE.isAbsolute)(i))return"Please enter a relative path, not absolute";if(!pt(i))return"Please enter a path that ends with '.mapper.{tsx,jsx,ts,js,mjs}'";if(ls.default.existsSync(i))return"File already exists, please choose a different name"}});return Me(n)?(he("Mapping not saved, goodbye!"),await ee(1)):n}async function AF(e,r){return e.length<=1?e.map(([,t])=>t.key):await IF(e,r)}async function vF(){let e=await Mt({message:`How does the mapping look? ${(0,Z.dim)('Reply "good", or provide feedback (Ctrl+C to exit)')}`,defaultValue:"good",placeholder:"good"});return Me(e)?(he("Mapping not saved, goodbye!"),await ee(1)):e}async function PF(e){let r=await Mt({message:`Providing a docs URL for ${e.name} can drastically improve results: ${(0,Z.dim)("(Ctrl+C to skip)")}`,placeholder:"https://",validate(t){if(t=t.trim(),t&&!t.startsWith("https://"))return"Please enter a valid URL"}});return Me(r)?"":r}async function IF(e,r){let t=await Yd({message:`Pick which ${(0,Z.magenta)("\u2756")} Figma components you want to connect to code:`,required:!0,options:e.map(([,n])=>({label:`${n.name}${r.some(i=>i.figmaKey===n.key)?(0,Z.dim)(" (already mapped)"):""}`,value:n.key})),initialValues:e.map(([,n])=>n.key).filter(n=>!r.some(i=>i.figmaKey===n))});return Me(t)?(he("Mapping not saved, goodbye!"),await ee(1)):t}async function NF(e){if(!e||e.length===0||e.length===0)return null;let r=e.map(o=>({title:o.name,value:o.name})),t=await(0,Al.default)({type:"autocomplete",name:"package",message:"Select an installed external package:",hint:"Type or use arrow keys. Press Enter to select",choices:r,async suggest(o,a){return o=o.toLowerCase(),a.map(u=>{let c=u.value.trim().toLowerCase(),p=0;return o.length===0?p=0:p=(0,Eo.distance)(o,c),{...u,distance:p}}).sort((u,c)=>u.distance-c.distance).filter(u=>u.title.toLowerCase().includes(o))}});if(!t.package)return he("Package selection cancelled"),await ee(1);let n=t.package,i=e.find(o=>o.name===t.package);function s(o){return/^[A-Z]/.test(o)}if(i&&i.subPackages.length>0){let o=i.subPackages.filter(a=>!FE.has(a)&&s(a));if(o.length>0){let a=[{title:`${i.name} ${(0,Z.dim)("(Ctrl+C)")}`,value:null},...o.map(u=>({title:`${(0,Z.dim)(i.name)}/${u}`,value:u}))],l=await(0,Al.default)({type:"autocomplete",name:"subPackage",message:"Select a component subpackage (optional):",hint:"Type or use arrow keys. Press Enter to select",async suggest(u,c){return u=u.toLowerCase().replace(i.name,""),c.map(d=>{if(d.value===null)return{...d,distance:0};let f=d.value?d.value.trim().toLowerCase():i.name,m=0;return u.length===0?m=0:m=(0,Eo.distance)(u,f),{...d,distance:m}}).sort((d,f)=>d.distance-f.distance).filter(d=>d.title.toLowerCase().includes(u))},choices:a});l.subPackage!==`${i.name} ${(0,Z.dim)("(Ctrl+C)")}`&&(n=`${t.package}/${l.subPackage}`)}}return n}var FE=new Set(["react","react-dom","next","nextjs","typescript","babel","webpack","eslint","prettier","jest","lodash","axios","express","moment","redux","react-redux","styled-components","emotion","@types/react","@types/node","utils","helpers","date-fns","constants","types","interfaces","hooks","gray-matter","context","providers","store","reducers","actions","services","api","clsx","class-variance-authority","lucide-react","dotenv","classnames"]),FF=e=>e.startsWith("@types")||e.startsWith("@emotion")||e.startsWith("@builder.io")||e.startsWith("eslint")||e.startsWith("prettier")||e.startsWith("jest")||e.startsWith("lodash")||e.startsWith("remark")||e.includes("autoprefixer")||e.includes("tailwind")||e.includes("postcss")||e.includes("webpack")||e.includes("babel")||e.includes("typescript")||e.includes("types")||e.includes("rollup")||e.includes("vite")||e.includes("esbuild")||e.includes("storybook")||e.includes("testing-library")||e.includes("cypress")?!0:FE.has(e);async function vE(e,r,t){let n="",i=r.toLowerCase();function s(l){let u=l.importName.toLowerCase(),c=(0,Eo.distance)(u,i);return u.includes(i)&&(c-=i.length),c}let o=e.slice().sort((l,u)=>{let c=s(l),p=s(u);return c===p?l.importName.localeCompare(u.importName):c-p}).map(l=>{let u=`${l.importName}`;return s(l)<3?u=(0,Z.bold)((0,Z.yellow)("\u2605 ")+u):u=u,{title:n+u+(0,Z.dim)(` from '${l.importPath}'`),value:l}});return o.push({title:n+"\u23ED\uFE0F Skip "+(0,Z.dim)("(Ctrl+C)"),value:"skip"}),t&&o.push({title:n+"\u{1F4E6} External npm package",value:"external package"}),(await(0,Al.default)({type:"autocomplete",name:"component",message:` Select a code component to map ${(0,Z.bold)((0,Z.magenta)(`\u2756 ${r}`))}`,hint:"Type or use arrow keys. Press Enter to select",async suggest(l,u){l=l.toLowerCase();let c=l.length===0?i:l;return u.map(d=>{let f=(typeof d.value=="string"?d.value:d.value.importName).trim().toLowerCase(),m=0;return l.length===0&&typeof d.value=="string"?m=2:(m=(0,Eo.distance)(c,f),f.includes(i)&&(m-=i.length),typeof d.value=="string"&&(m+=1e3)),{...d,distance:m}}).sort((d,f)=>d.distance-f.distance).filter(d=>d.value==="external package"||d.value==="skip"?!0:d.title.toLowerCase().includes(l))},choices:o})).component}async function*_F(e,r,t){let n=JSON.stringify(r),i=new URL(`${fr}/mappings/completions/v3`);e.builderPublicKey&&i.searchParams.set("apiKey",e.builderPublicKey),e.userId&&i.searchParams.set("userId",e.userId),t&&console.log("FETCH",i,n);let s={"Content-Type":"application/json"};e.builderPrivateKey&&(s.Authorization=`Bearer ${e.builderPrivateKey}`);let o=await nt(i,{method:"POST",body:n,headers:s});if(!o.ok)throw new Error(`Failed to generate completion:
|
|
1741
|
+
`+await o.text());let a=cl(o.body);for await(let l of a){if(l.length===0)continue;yield JSON.parse(l)}}var Vt=V(Ze(),1);var _E=async(e,r,t)=>{if(!t.skipInstallation&&await kF(e)&&(t.yes||await wt({message:"Welcome to Builder.io! Would you like to set up your integration now?",active:"Yes, let's integrate!",inactive:"No, I'll do it later"})?await dl("npm",["init","builder.io@latest","--","--skip-question"],{stdio:"inherit",cwd:e.getAppRootDir()}).command||(he(`Auto-install failed. You can install it manually by running ${(0,Vt.bold)("npm init builder.io@latest")}`),await ee(1)):he(`Ok, you can install it later. By running ${(0,Vt.bold)("npm init builder.io@latest")}`)),r==="migrate")await wE(e,t);else if(r==="publish"||r==="p")await yE(e,t);else if(r==="add"||r==="generate"||r==="gen"||r==="g")await NE(e,t);else if(r==="auth"){console.log(""),ot((0,Vt.bgCyan)((0,Vt.bold)((0,Vt.white)(" figma auth ")))+" "+(0,Vt.dim)(gt));let{builderPublicKey:n}=await Lt(e,t,{figmaAuth:!0,builderPrivateKey:!0,builderPublicKey:!0,force:!0});We("figma auth",{spaceId:n}),ut((0,Vt.bgGreen)((0,Vt.bold)((0,Vt.white)(" Done! \u{1F389} "))))}else r==="help"&&xr(t._[2])};async function kF(e){let r=e.getFrameworks(),t=["next","angular","@angular/core"];if(!r.some(n=>t.includes(n.name)))return!1;try{let n=await Wr(e,e.getRepoRootDir());if(!n||!!n.devDependencies?.["@builder.io/dev-tools"]||!!n.dependencies?.["@builder.io/dev-tools"])return!1}catch{return!1}return!0}var BE=V(require("@amplitude/analytics-node"),1);function hd(e,r){return{cwd:e,command:r[0],snippetId:r[1],path:r[2]}}var us=V(require("@sentry/node"),1);var ME=V(Ze(),1),$E=V(Ze(),1),gd=V(Ze(),1),Co=V(Ze(),1);async function OF(e){e.debug("builder dev tools cli init");let r=await(0,kE.createDevTools)(e);await(0,RE.createDevToolsServer)({...r,getClientId:()=>"builder-dev-tools-cli",closeAppServer:async()=>{},restartAppServer:async()=>{e.debug("restart server")},enableAppWatch:async t=>t,...e})}var UE=async()=>{await BE.flush().promise,process.exit(0)};process.on("SIGINT",UE);process.on("SIGTERM",UE);async function RF(){await sb();try{let e=(0,LE.default)(process.argv.slice(2),{string:["figmaToken","privateKey","spaceId","cwd","prompt","mode","token","url"],boolean:["help","ci","force","verbose","dryrun","yes","skipInstallation"]});if(e.help)return xr(e._[e._.length-1]),await ee(0);let r=e._[0];e.cwd&&(console.log("changing cwd",e.cwd),process.chdir(e.cwd));let t=await(0,OE.createDevToolsNodeSys)({cwd:process.cwd(),ignoreMissingConfig:!0});if(r==="figma"){let n=e._[1];try{await _E(t,n,e)}catch(i){return us.captureException(i),console.error(i),await ee(1)}}else if(r==="code"){let n=e._[1];try{await fE(t,n,e)}catch(i){return us.captureException(i),console.error(i),await ee(1)}}else if(r==="add"){let n=hd(t.getAppRootDir(),process.argv.slice(2));await Wb(n)}else if(r==="sync"){let n=hd(t.getAppRootDir(),process.argv.slice(2)),i=await _p(n);ex(t,i).then(()=>{console.info("Builder dev tools is running")}).catch(s=>{us.captureException(s),console.error("Cannot start builder dev tools",s)})}else if(r==="auth"){console.log(""),ot((0,Co.bgCyan)((0,gd.bold)((0,Co.white)(" figma auth ")))+" "+(0,ME.dim)(gt));let{builderPublicKey:n}=await Lt(t,e,{builderPrivateKey:!0,builderPublicKey:!0,force:!0});We("auth",{spaceId:n}),ut((0,$E.bgGreen)((0,gd.bold)((0,Co.white)(" Done! \u{1F389} "))))}else{if(r==="help")return xr(e._[1]),await ee(0);if(r==="publish"||r==="migrate"||r==="generate")return he("Command not found, do you mean `npx builder.io figma "+r+"`?"),await ee(1);OF(t).then(()=>{console.info("Builder dev tools is running")}).catch(n=>{us.captureException(n),console.error("Cannot start builder dev tools",n)})}}catch(e){return us.captureException(e),console.error(e),await ee(1)}}RF();
|
|
1748
1742
|
//# sourceMappingURL=index.cjs.map
|