builder.io 1.3.6 → 1.3.7
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 +57 -57
- 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 +3 -3
- package/server/index.mjs +3 -3
package/cli/index.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";var mP=Object.create;var qa=Object.defineProperty;var gP=Object.getOwnPropertyDescriptor;var yP=Object.getOwnPropertyNames;var bP=Object.getPrototypeOf,DP=Object.prototype.hasOwnProperty;var Pm=(t,r)=>()=>(t&&(r=t(t=0)),r);var A=(t,r)=>()=>(r||t((r={exports:{}}).exports,r),r.exports),Sc=(t,r)=>{for(var e in r)qa(t,e,{get:r[e],enumerable:!0})},Im=(t,r,e,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of yP(r))!DP.call(t,n)&&n!==e&&qa(t,n,{get:()=>r[n],enumerable:!(i=gP(r,n))||i.enumerable});return t};var K=(t,r,e)=>(e=t!=null?mP(bP(t)):{},Im(r||!t||!t.__esModule?qa(e,"default",{value:t,enumerable:!0}):e,t)),Wt=t=>Im(qa({},"__esModule",{value:!0}),t);var Nm=A((d4,_m)=>{function vc(t){return t==null?[]:Array.isArray(t)?t:[t]}function xP(t,r,e,i){var n,s=t[r],o=~i.string.indexOf(r)?e==null||e===!0?"":String(e):typeof e=="boolean"?e:~i.boolean.indexOf(r)?e==="false"?!1:e==="true"||(t._.push((n=+e,n*0===0?n:e)),!!e):(n=+e,n*0===0?n:e);t[r]=s==null?o:Array.isArray(s)?s.concat(o):[s,o]}_m.exports=function(t,r){t=t||[],r=r||{};var e,i,n,s,o,a={_:[]},l=0,u=0,c=0,p=t.length;let d=r.alias!==void 0,h=r.unknown!==void 0,f=r.default!==void 0;if(r.alias=r.alias||{},r.string=vc(r.string),r.boolean=vc(r.boolean),d)for(e in r.alias)for(i=r.alias[e]=vc(r.alias[e]),l=0;l<i.length;l++)(r.alias[i[l]]=i.concat(e)).splice(l,1);for(l=r.boolean.length;l-- >0;)for(i=r.alias[r.boolean[l]]||[],u=i.length;u-- >0;)r.boolean.push(i[u]);for(l=r.string.length;l-- >0;)for(i=r.alias[r.string[l]]||[],u=i.length;u-- >0;)r.string.push(i[u]);if(f){for(e in r.default)if(s=typeof r.default[e],i=r.alias[e]=r.alias[e]||[],r[s]!==void 0)for(r[s].push(e),l=0;l<i.length;l++)r[s].push(i[l])}let g=h?Object.keys(r.alias):[];for(l=0;l<p;l++){if(n=t[l],n==="--"){a._=a._.concat(t.slice(++l));break}for(u=0;u<n.length&&n.charCodeAt(u)===45;u++);if(u===0)a._.push(n);else if(n.substring(u,u+3)==="no-"){if(s=n.substring(u+3),h&&!~g.indexOf(s))return r.unknown(n);a[s]=!1}else{for(c=u+1;c<n.length&&n.charCodeAt(c)!==61;c++);for(s=n.substring(u,c),o=n.substring(++c)||l+1===p||(""+t[l+1]).charCodeAt(0)===45||t[++l],i=u===2?[s]:s,c=0;c<i.length;c++){if(s=i[c],h&&!~g.indexOf(s))return r.unknown("-".repeat(u)+s);xP(a,s,c+1<i.length||o,r)}}}if(f)for(e in r.default)a[e]===void 0&&(a[e]=r.default[e]);if(d)for(e in a)for(i=r.alias[e]||[];i.length>0;)a[i.shift()]=a[e];return a}});var $e=A((m4,km)=>{"use strict";var Pc="\x1B",Qe=`${Pc}[`,EP="\x07",Ic={to(t,r){return r?`${Qe}${r+1};${t+1}H`:`${Qe}${t+1}G`},move(t,r){let e="";return t<0?e+=`${Qe}${-t}D`:t>0&&(e+=`${Qe}${t}C`),r<0?e+=`${Qe}${-r}A`:r>0&&(e+=`${Qe}${r}B`),e},up:(t=1)=>`${Qe}${t}A`,down:(t=1)=>`${Qe}${t}B`,forward:(t=1)=>`${Qe}${t}C`,backward:(t=1)=>`${Qe}${t}D`,nextLine:(t=1)=>`${Qe}E`.repeat(t),prevLine:(t=1)=>`${Qe}F`.repeat(t),left:`${Qe}G`,hide:`${Qe}?25l`,show:`${Qe}?25h`,save:`${Pc}7`,restore:`${Pc}8`},CP={up:(t=1)=>`${Qe}S`.repeat(t),down:(t=1)=>`${Qe}T`.repeat(t)},SP={screen:`${Qe}2J`,up:(t=1)=>`${Qe}1J`.repeat(t),down:(t=1)=>`${Qe}J`.repeat(t),line:`${Qe}2K`,lineEnd:`${Qe}K`,lineStart:`${Qe}1K`,lines(t){let r="";for(let e=0;e<t;e++)r+=this.line+(e<t-1?Ic.up():"");return t&&(r+=Ic.left),r}};km.exports={cursor:Ic,scroll:CP,erase:SP,beep:EP}});var Gt=A((g4,_c)=>{var Wa=process||{},Om=Wa.argv||[],za=Wa.env||{},vP=!(za.NO_COLOR||Om.includes("--no-color"))&&(!!za.FORCE_COLOR||Om.includes("--color")||Wa.platform==="win32"||(Wa.stdout||{}).isTTY&&za.TERM!=="dumb"||!!za.CI),wP=(t,r,e=t)=>i=>{let n=""+i,s=n.indexOf(r,t.length);return~s?t+TP(n,r,e,s)+r:t+n+r},TP=(t,r,e,i)=>{let n="",s=0;do n+=t.substring(s,i)+e,s=i+r.length,i=t.indexOf(r,s);while(~i);return n+t.substring(s)},Rm=(t=vP)=>{let r=t?wP:()=>String;return{isColorSupported:t,reset:r("\x1B[0m","\x1B[0m"),bold:r("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:r("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:r("\x1B[3m","\x1B[23m"),underline:r("\x1B[4m","\x1B[24m"),inverse:r("\x1B[7m","\x1B[27m"),hidden:r("\x1B[8m","\x1B[28m"),strikethrough:r("\x1B[9m","\x1B[29m"),black:r("\x1B[30m","\x1B[39m"),red:r("\x1B[31m","\x1B[39m"),green:r("\x1B[32m","\x1B[39m"),yellow:r("\x1B[33m","\x1B[39m"),blue:r("\x1B[34m","\x1B[39m"),magenta:r("\x1B[35m","\x1B[39m"),cyan:r("\x1B[36m","\x1B[39m"),white:r("\x1B[37m","\x1B[39m"),gray:r("\x1B[90m","\x1B[39m"),bgBlack:r("\x1B[40m","\x1B[49m"),bgRed:r("\x1B[41m","\x1B[49m"),bgGreen:r("\x1B[42m","\x1B[49m"),bgYellow:r("\x1B[43m","\x1B[49m"),bgBlue:r("\x1B[44m","\x1B[49m"),bgMagenta:r("\x1B[45m","\x1B[49m"),bgCyan:r("\x1B[46m","\x1B[49m"),bgWhite:r("\x1B[47m","\x1B[49m"),blackBright:r("\x1B[90m","\x1B[39m"),redBright:r("\x1B[91m","\x1B[39m"),greenBright:r("\x1B[92m","\x1B[39m"),yellowBright:r("\x1B[93m","\x1B[39m"),blueBright:r("\x1B[94m","\x1B[39m"),magentaBright:r("\x1B[95m","\x1B[39m"),cyanBright:r("\x1B[96m","\x1B[39m"),whiteBright:r("\x1B[97m","\x1B[39m"),bgBlackBright:r("\x1B[100m","\x1B[49m"),bgRedBright:r("\x1B[101m","\x1B[49m"),bgGreenBright:r("\x1B[102m","\x1B[49m"),bgYellowBright:r("\x1B[103m","\x1B[49m"),bgBlueBright:r("\x1B[104m","\x1B[49m"),bgMagentaBright:r("\x1B[105m","\x1B[49m"),bgCyanBright:r("\x1B[106m","\x1B[49m"),bgWhiteBright:r("\x1B[107m","\x1B[49m")}};_c.exports=Rm();_c.exports.createColors=Rm});var jc=A((F4,og)=>{"use strict";og.exports=function(){if(process.env.npm_config_user_agent)return c1(process.env.npm_config_user_agent)};function c1(t){let r=t.split(" ")[0],e=r.lastIndexOf("/"),i=r.substring(0,e);return{name:i==="npminstall"?"cnpm":i,version:r.substring(e+1)}}});var ky=A((dU,pl)=>{pl.exports.Space_Separator=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/;pl.exports.ID_Start=/[\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\u0561-\u0587\u05D0-\u05EA\u05F0-\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\u08A0-\u08B4\u08B6-\u08BD\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\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\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\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\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-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\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\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\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\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\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-\uAB65\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]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/;pl.exports.ID_Continue=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\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\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/});var cp=A((fU,Oy)=>{var up=ky();Oy.exports={isSpaceSeparator(t){return typeof t=="string"&&up.Space_Separator.test(t)},isIdStartChar(t){return typeof t=="string"&&(t>="a"&&t<="z"||t>="A"&&t<="Z"||t==="$"||t==="_"||up.ID_Start.test(t))},isIdContinueChar(t){return typeof t=="string"&&(t>="a"&&t<="z"||t>="A"&&t<="Z"||t>="0"&&t<="9"||t==="$"||t==="_"||t==="\u200C"||t==="\u200D"||up.ID_Continue.test(t))},isDigit(t){return typeof t=="string"&&/[0-9]/.test(t)},isHexDigit(t){return typeof t=="string"&&/[0-9A-Fa-f]/.test(t)}}});var $y=A((hU,By)=>{var yt=cp(),dp,$t,wi,fl,on,Ir,bt,mp,Ao;By.exports=function(r,e){dp=String(r),$t="start",wi=[],fl=0,on=1,Ir=0,bt=void 0,mp=void 0,Ao=void 0;do bt=A_(),__[$t]();while(bt.type!=="eof");return typeof e=="function"?fp({"":Ao},"",e):Ao};function fp(t,r,e){let i=t[r];if(i!=null&&typeof i=="object")if(Array.isArray(i))for(let n=0;n<i.length;n++){let s=String(n),o=fp(i,s,e);o===void 0?delete i[s]:Object.defineProperty(i,s,{value:o,writable:!0,enumerable:!0,configurable:!0})}else for(let n in i){let s=fp(i,n,e);s===void 0?delete i[n]:Object.defineProperty(i,n,{value:s,writable:!0,enumerable:!0,configurable:!0})}return e.call(t,r,i)}var le,se,To,vi,ge;function A_(){for(le="default",se="",To=!1,vi=1;;){ge=Ti();let t=Ly[le]();if(t)return t}}function Ti(){if(dp[fl])return String.fromCodePoint(dp.codePointAt(fl))}function F(){let t=Ti();return t===`
|
|
1
|
+
"use strict";var mP=Object.create;var qa=Object.defineProperty;var gP=Object.getOwnPropertyDescriptor;var yP=Object.getOwnPropertyNames;var bP=Object.getPrototypeOf,DP=Object.prototype.hasOwnProperty;var Pm=(t,r)=>()=>(t&&(r=t(t=0)),r);var A=(t,r)=>()=>(r||t((r={exports:{}}).exports,r),r.exports),Sc=(t,r)=>{for(var e in r)qa(t,e,{get:r[e],enumerable:!0})},Im=(t,r,e,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of yP(r))!DP.call(t,n)&&n!==e&&qa(t,n,{get:()=>r[n],enumerable:!(i=gP(r,n))||i.enumerable});return t};var K=(t,r,e)=>(e=t!=null?mP(bP(t)):{},Im(r||!t||!t.__esModule?qa(e,"default",{value:t,enumerable:!0}):e,t)),Wt=t=>Im(qa({},"__esModule",{value:!0}),t);var Nm=A((d4,_m)=>{function vc(t){return t==null?[]:Array.isArray(t)?t:[t]}function xP(t,r,e,i){var n,s=t[r],o=~i.string.indexOf(r)?e==null||e===!0?"":String(e):typeof e=="boolean"?e:~i.boolean.indexOf(r)?e==="false"?!1:e==="true"||(t._.push((n=+e,n*0===0?n:e)),!!e):(n=+e,n*0===0?n:e);t[r]=s==null?o:Array.isArray(s)?s.concat(o):[s,o]}_m.exports=function(t,r){t=t||[],r=r||{};var e,i,n,s,o,a={_:[]},l=0,u=0,c=0,p=t.length;let d=r.alias!==void 0,h=r.unknown!==void 0,f=r.default!==void 0;if(r.alias=r.alias||{},r.string=vc(r.string),r.boolean=vc(r.boolean),d)for(e in r.alias)for(i=r.alias[e]=vc(r.alias[e]),l=0;l<i.length;l++)(r.alias[i[l]]=i.concat(e)).splice(l,1);for(l=r.boolean.length;l-- >0;)for(i=r.alias[r.boolean[l]]||[],u=i.length;u-- >0;)r.boolean.push(i[u]);for(l=r.string.length;l-- >0;)for(i=r.alias[r.string[l]]||[],u=i.length;u-- >0;)r.string.push(i[u]);if(f){for(e in r.default)if(s=typeof r.default[e],i=r.alias[e]=r.alias[e]||[],r[s]!==void 0)for(r[s].push(e),l=0;l<i.length;l++)r[s].push(i[l])}let g=h?Object.keys(r.alias):[];for(l=0;l<p;l++){if(n=t[l],n==="--"){a._=a._.concat(t.slice(++l));break}for(u=0;u<n.length&&n.charCodeAt(u)===45;u++);if(u===0)a._.push(n);else if(n.substring(u,u+3)==="no-"){if(s=n.substring(u+3),h&&!~g.indexOf(s))return r.unknown(n);a[s]=!1}else{for(c=u+1;c<n.length&&n.charCodeAt(c)!==61;c++);for(s=n.substring(u,c),o=n.substring(++c)||l+1===p||(""+t[l+1]).charCodeAt(0)===45||t[++l],i=u===2?[s]:s,c=0;c<i.length;c++){if(s=i[c],h&&!~g.indexOf(s))return r.unknown("-".repeat(u)+s);xP(a,s,c+1<i.length||o,r)}}}if(f)for(e in r.default)a[e]===void 0&&(a[e]=r.default[e]);if(d)for(e in a)for(i=r.alias[e]||[];i.length>0;)a[i.shift()]=a[e];return a}});var $e=A((m4,km)=>{"use strict";var Pc="\x1B",Qe=`${Pc}[`,EP="\x07",Ic={to(t,r){return r?`${Qe}${r+1};${t+1}H`:`${Qe}${t+1}G`},move(t,r){let e="";return t<0?e+=`${Qe}${-t}D`:t>0&&(e+=`${Qe}${t}C`),r<0?e+=`${Qe}${-r}A`:r>0&&(e+=`${Qe}${r}B`),e},up:(t=1)=>`${Qe}${t}A`,down:(t=1)=>`${Qe}${t}B`,forward:(t=1)=>`${Qe}${t}C`,backward:(t=1)=>`${Qe}${t}D`,nextLine:(t=1)=>`${Qe}E`.repeat(t),prevLine:(t=1)=>`${Qe}F`.repeat(t),left:`${Qe}G`,hide:`${Qe}?25l`,show:`${Qe}?25h`,save:`${Pc}7`,restore:`${Pc}8`},CP={up:(t=1)=>`${Qe}S`.repeat(t),down:(t=1)=>`${Qe}T`.repeat(t)},SP={screen:`${Qe}2J`,up:(t=1)=>`${Qe}1J`.repeat(t),down:(t=1)=>`${Qe}J`.repeat(t),line:`${Qe}2K`,lineEnd:`${Qe}K`,lineStart:`${Qe}1K`,lines(t){let r="";for(let e=0;e<t;e++)r+=this.line+(e<t-1?Ic.up():"");return t&&(r+=Ic.left),r}};km.exports={cursor:Ic,scroll:CP,erase:SP,beep:EP}});var Gt=A((g4,_c)=>{var Wa=process||{},Om=Wa.argv||[],za=Wa.env||{},vP=!(za.NO_COLOR||Om.includes("--no-color"))&&(!!za.FORCE_COLOR||Om.includes("--color")||Wa.platform==="win32"||(Wa.stdout||{}).isTTY&&za.TERM!=="dumb"||!!za.CI),wP=(t,r,e=t)=>i=>{let n=""+i,s=n.indexOf(r,t.length);return~s?t+TP(n,r,e,s)+r:t+n+r},TP=(t,r,e,i)=>{let n="",s=0;do n+=t.substring(s,i)+e,s=i+r.length,i=t.indexOf(r,s);while(~i);return n+t.substring(s)},Rm=(t=vP)=>{let r=t?wP:()=>String;return{isColorSupported:t,reset:r("\x1B[0m","\x1B[0m"),bold:r("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:r("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:r("\x1B[3m","\x1B[23m"),underline:r("\x1B[4m","\x1B[24m"),inverse:r("\x1B[7m","\x1B[27m"),hidden:r("\x1B[8m","\x1B[28m"),strikethrough:r("\x1B[9m","\x1B[29m"),black:r("\x1B[30m","\x1B[39m"),red:r("\x1B[31m","\x1B[39m"),green:r("\x1B[32m","\x1B[39m"),yellow:r("\x1B[33m","\x1B[39m"),blue:r("\x1B[34m","\x1B[39m"),magenta:r("\x1B[35m","\x1B[39m"),cyan:r("\x1B[36m","\x1B[39m"),white:r("\x1B[37m","\x1B[39m"),gray:r("\x1B[90m","\x1B[39m"),bgBlack:r("\x1B[40m","\x1B[49m"),bgRed:r("\x1B[41m","\x1B[49m"),bgGreen:r("\x1B[42m","\x1B[49m"),bgYellow:r("\x1B[43m","\x1B[49m"),bgBlue:r("\x1B[44m","\x1B[49m"),bgMagenta:r("\x1B[45m","\x1B[49m"),bgCyan:r("\x1B[46m","\x1B[49m"),bgWhite:r("\x1B[47m","\x1B[49m"),blackBright:r("\x1B[90m","\x1B[39m"),redBright:r("\x1B[91m","\x1B[39m"),greenBright:r("\x1B[92m","\x1B[39m"),yellowBright:r("\x1B[93m","\x1B[39m"),blueBright:r("\x1B[94m","\x1B[39m"),magentaBright:r("\x1B[95m","\x1B[39m"),cyanBright:r("\x1B[96m","\x1B[39m"),whiteBright:r("\x1B[97m","\x1B[39m"),bgBlackBright:r("\x1B[100m","\x1B[49m"),bgRedBright:r("\x1B[101m","\x1B[49m"),bgGreenBright:r("\x1B[102m","\x1B[49m"),bgYellowBright:r("\x1B[103m","\x1B[49m"),bgBlueBright:r("\x1B[104m","\x1B[49m"),bgMagentaBright:r("\x1B[105m","\x1B[49m"),bgCyanBright:r("\x1B[106m","\x1B[49m"),bgWhiteBright:r("\x1B[107m","\x1B[49m")}};_c.exports=Rm();_c.exports.createColors=Rm});var jc=A((F4,og)=>{"use strict";og.exports=function(){if(process.env.npm_config_user_agent)return c1(process.env.npm_config_user_agent)};function c1(t){let r=t.split(" ")[0],e=r.lastIndexOf("/"),i=r.substring(0,e);return{name:i==="npminstall"?"cnpm":i,version:r.substring(e+1)}}});var ky=A((dU,pl)=>{pl.exports.Space_Separator=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/;pl.exports.ID_Start=/[\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\u0561-\u0587\u05D0-\u05EA\u05F0-\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\u08A0-\u08B4\u08B6-\u08BD\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\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\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\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\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-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\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\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\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\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\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-\uAB65\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]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/;pl.exports.ID_Continue=/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\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\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/});var cp=A((fU,Oy)=>{var up=ky();Oy.exports={isSpaceSeparator(t){return typeof t=="string"&&up.Space_Separator.test(t)},isIdStartChar(t){return typeof t=="string"&&(t>="a"&&t<="z"||t>="A"&&t<="Z"||t==="$"||t==="_"||up.ID_Start.test(t))},isIdContinueChar(t){return typeof t=="string"&&(t>="a"&&t<="z"||t>="A"&&t<="Z"||t>="0"&&t<="9"||t==="$"||t==="_"||t==="\u200C"||t==="\u200D"||up.ID_Continue.test(t))},isDigit(t){return typeof t=="string"&&/[0-9]/.test(t)},isHexDigit(t){return typeof t=="string"&&/[0-9A-Fa-f]/.test(t)}}});var $y=A((hU,By)=>{var bt=cp(),dp,$t,wi,fl,on,Ir,Dt,mp,Ao;By.exports=function(r,e){dp=String(r),$t="start",wi=[],fl=0,on=1,Ir=0,Dt=void 0,mp=void 0,Ao=void 0;do Dt=A_(),__[$t]();while(Dt.type!=="eof");return typeof e=="function"?fp({"":Ao},"",e):Ao};function fp(t,r,e){let i=t[r];if(i!=null&&typeof i=="object")if(Array.isArray(i))for(let n=0;n<i.length;n++){let s=String(n),o=fp(i,s,e);o===void 0?delete i[s]:Object.defineProperty(i,s,{value:o,writable:!0,enumerable:!0,configurable:!0})}else for(let n in i){let s=fp(i,n,e);s===void 0?delete i[n]:Object.defineProperty(i,n,{value:s,writable:!0,enumerable:!0,configurable:!0})}return e.call(t,r,i)}var le,se,To,vi,ge;function A_(){for(le="default",se="",To=!1,vi=1;;){ge=Ti();let t=Ly[le]();if(t)return t}}function Ti(){if(dp[fl])return String.fromCodePoint(dp.codePointAt(fl))}function F(){let t=Ti();return t===`
|
|
2
2
|
`?(on++,Ir=0):t?Ir+=t.length:Ir++,t&&(fl+=t.length),t}var Ly={default(){switch(ge){case" ":case"\v":case"\f":case" ":case"\xA0":case"\uFEFF":case`
|
|
3
|
-
`:case"\r":case"\u2028":case"\u2029":F();return;case"/":F(),le="comment";return;case void 0:return F(),ze("eof")}if(
|
|
4
|
-
`:case"\r":case"\u2028":case"\u2029":F(),le="default";return;case void 0:return F(),ze("eof")}F()},value(){switch(ge){case"{":case"[":return ze("punctuator",F());case"n":return F(),Rn("ull"),ze("null",null);case"t":return F(),Rn("rue"),ze("boolean",!0);case"f":return F(),Rn("alse"),ze("boolean",!1);case"-":case"+":F()==="-"&&(vi=-1),le="sign";return;case".":se=F(),le="decimalPointLeading";return;case"0":se=F(),le="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":se=F(),le="decimalInteger";return;case"I":return F(),Rn("nfinity"),ze("numeric",1/0);case"N":return F(),Rn("aN"),ze("numeric",NaN);case'"':case"'":To=F()==='"',se="",le="string";return}throw We(F())},identifierNameStartEscape(){if(ge!=="u")throw We(F());F();let t=hp();switch(t){case"$":case"_":break;default:if(!
|
|
5
|
-
`:case"\r":throw We(F());case"\u2028":case"\u2029":N_(ge);break;case void 0:throw We(F())}se+=F()},start(){switch(ge){case"{":case"[":return ze("punctuator",F())}le="value"},beforePropertyName(){switch(ge){case"$":case"_":se=F(),le="identifierName";return;case"\\":F(),le="identifierNameStartEscape";return;case"}":return ze("punctuator",F());case'"':case"'":To=F()==='"',le="string";return}if(
|
|
6
|
-
`;case"r":return F(),"\r";case"t":return F()," ";case"v":return F(),"\v";case"0":if(F(),
|
|
3
|
+
`:case"\r":case"\u2028":case"\u2029":F();return;case"/":F(),le="comment";return;case void 0:return F(),ze("eof")}if(bt.isSpaceSeparator(ge)){F();return}return Ly[$t]()},comment(){switch(ge){case"*":F(),le="multiLineComment";return;case"/":F(),le="singleLineComment";return}throw We(F())},multiLineComment(){switch(ge){case"*":F(),le="multiLineCommentAsterisk";return;case void 0:throw We(F())}F()},multiLineCommentAsterisk(){switch(ge){case"*":F();return;case"/":F(),le="default";return;case void 0:throw We(F())}F(),le="multiLineComment"},singleLineComment(){switch(ge){case`
|
|
4
|
+
`:case"\r":case"\u2028":case"\u2029":F(),le="default";return;case void 0:return F(),ze("eof")}F()},value(){switch(ge){case"{":case"[":return ze("punctuator",F());case"n":return F(),Rn("ull"),ze("null",null);case"t":return F(),Rn("rue"),ze("boolean",!0);case"f":return F(),Rn("alse"),ze("boolean",!1);case"-":case"+":F()==="-"&&(vi=-1),le="sign";return;case".":se=F(),le="decimalPointLeading";return;case"0":se=F(),le="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":se=F(),le="decimalInteger";return;case"I":return F(),Rn("nfinity"),ze("numeric",1/0);case"N":return F(),Rn("aN"),ze("numeric",NaN);case'"':case"'":To=F()==='"',se="",le="string";return}throw We(F())},identifierNameStartEscape(){if(ge!=="u")throw We(F());F();let t=hp();switch(t){case"$":case"_":break;default:if(!bt.isIdStartChar(t))throw Ry();break}se+=t,le="identifierName"},identifierName(){switch(ge){case"$":case"_":case"\u200C":case"\u200D":se+=F();return;case"\\":F(),le="identifierNameEscape";return}if(bt.isIdContinueChar(ge)){se+=F();return}return ze("identifier",se)},identifierNameEscape(){if(ge!=="u")throw We(F());F();let t=hp();switch(t){case"$":case"_":case"\u200C":case"\u200D":break;default:if(!bt.isIdContinueChar(t))throw Ry();break}se+=t,le="identifierName"},sign(){switch(ge){case".":se=F(),le="decimalPointLeading";return;case"0":se=F(),le="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":se=F(),le="decimalInteger";return;case"I":return F(),Rn("nfinity"),ze("numeric",vi*(1/0));case"N":return F(),Rn("aN"),ze("numeric",NaN)}throw We(F())},zero(){switch(ge){case".":se+=F(),le="decimalPoint";return;case"e":case"E":se+=F(),le="decimalExponent";return;case"x":case"X":se+=F(),le="hexadecimal";return}return ze("numeric",vi*0)},decimalInteger(){switch(ge){case".":se+=F(),le="decimalPoint";return;case"e":case"E":se+=F(),le="decimalExponent";return}if(bt.isDigit(ge)){se+=F();return}return ze("numeric",vi*Number(se))},decimalPointLeading(){if(bt.isDigit(ge)){se+=F(),le="decimalFraction";return}throw We(F())},decimalPoint(){switch(ge){case"e":case"E":se+=F(),le="decimalExponent";return}if(bt.isDigit(ge)){se+=F(),le="decimalFraction";return}return ze("numeric",vi*Number(se))},decimalFraction(){switch(ge){case"e":case"E":se+=F(),le="decimalExponent";return}if(bt.isDigit(ge)){se+=F();return}return ze("numeric",vi*Number(se))},decimalExponent(){switch(ge){case"+":case"-":se+=F(),le="decimalExponentSign";return}if(bt.isDigit(ge)){se+=F(),le="decimalExponentInteger";return}throw We(F())},decimalExponentSign(){if(bt.isDigit(ge)){se+=F(),le="decimalExponentInteger";return}throw We(F())},decimalExponentInteger(){if(bt.isDigit(ge)){se+=F();return}return ze("numeric",vi*Number(se))},hexadecimal(){if(bt.isHexDigit(ge)){se+=F(),le="hexadecimalInteger";return}throw We(F())},hexadecimalInteger(){if(bt.isHexDigit(ge)){se+=F();return}return ze("numeric",vi*Number(se))},string(){switch(ge){case"\\":F(),se+=P_();return;case'"':if(To)return F(),ze("string",se);se+=F();return;case"'":if(!To)return F(),ze("string",se);se+=F();return;case`
|
|
5
|
+
`:case"\r":throw We(F());case"\u2028":case"\u2029":N_(ge);break;case void 0:throw We(F())}se+=F()},start(){switch(ge){case"{":case"[":return ze("punctuator",F())}le="value"},beforePropertyName(){switch(ge){case"$":case"_":se=F(),le="identifierName";return;case"\\":F(),le="identifierNameStartEscape";return;case"}":return ze("punctuator",F());case'"':case"'":To=F()==='"',le="string";return}if(bt.isIdStartChar(ge)){se+=F(),le="identifierName";return}throw We(F())},afterPropertyName(){if(ge===":")return ze("punctuator",F());throw We(F())},beforePropertyValue(){le="value"},afterPropertyValue(){switch(ge){case",":case"}":return ze("punctuator",F())}throw We(F())},beforeArrayValue(){if(ge==="]")return ze("punctuator",F());le="value"},afterArrayValue(){switch(ge){case",":case"]":return ze("punctuator",F())}throw We(F())},end(){throw We(F())}};function ze(t,r){return{type:t,value:r,line:on,column:Ir}}function Rn(t){for(let r of t){if(Ti()!==r)throw We(F());F()}}function P_(){switch(Ti()){case"b":return F(),"\b";case"f":return F(),"\f";case"n":return F(),`
|
|
6
|
+
`;case"r":return F(),"\r";case"t":return F()," ";case"v":return F(),"\v";case"0":if(F(),bt.isDigit(Ti()))throw We(F());return"\0";case"x":return F(),I_();case"u":return F(),hp();case`
|
|
7
7
|
`:case"\u2028":case"\u2029":return F(),"";case"\r":return F(),Ti()===`
|
|
8
|
-
`&&F(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":throw We(F());case void 0:throw We(F())}return F()}function I_(){let t="",r=Ti();if(!
|
|
8
|
+
`&&F(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":throw We(F());case void 0:throw We(F())}return F()}function I_(){let t="",r=Ti();if(!bt.isHexDigit(r)||(t+=F(),r=Ti(),!bt.isHexDigit(r)))throw We(F());return t+=F(),String.fromCodePoint(parseInt(t,16))}function hp(){let t="",r=4;for(;r-- >0;){let e=Ti();if(!bt.isHexDigit(e))throw We(F());t+=F()}return String.fromCodePoint(parseInt(t,16))}var __={start(){if(Dt.type==="eof")throw Ln();pp()},beforePropertyName(){switch(Dt.type){case"identifier":case"string":mp=Dt.value,$t="afterPropertyName";return;case"punctuator":dl();return;case"eof":throw Ln()}},afterPropertyName(){if(Dt.type==="eof")throw Ln();$t="beforePropertyValue"},beforePropertyValue(){if(Dt.type==="eof")throw Ln();pp()},beforeArrayValue(){if(Dt.type==="eof")throw Ln();if(Dt.type==="punctuator"&&Dt.value==="]"){dl();return}pp()},afterPropertyValue(){if(Dt.type==="eof")throw Ln();switch(Dt.value){case",":$t="beforePropertyName";return;case"}":dl()}},afterArrayValue(){if(Dt.type==="eof")throw Ln();switch(Dt.value){case",":$t="beforeArrayValue";return;case"]":dl()}},end(){}};function pp(){let t;switch(Dt.type){case"punctuator":switch(Dt.value){case"{":t={};break;case"[":t=[];break}break;case"null":case"boolean":case"numeric":case"string":t=Dt.value;break}if(Ao===void 0)Ao=t;else{let r=wi[wi.length-1];Array.isArray(r)?r.push(t):Object.defineProperty(r,mp,{value:t,writable:!0,enumerable:!0,configurable:!0})}if(t!==null&&typeof t=="object")wi.push(t),Array.isArray(t)?$t="beforeArrayValue":$t="beforePropertyName";else{let r=wi[wi.length-1];r==null?$t="end":Array.isArray(r)?$t="afterArrayValue":$t="afterPropertyValue"}}function dl(){wi.pop();let t=wi[wi.length-1];t==null?$t="end":Array.isArray(t)?$t="afterArrayValue":$t="afterPropertyValue"}function We(t){return hl(t===void 0?`JSON5: invalid end of input at ${on}:${Ir}`:`JSON5: invalid character '${My(t)}' at ${on}:${Ir}`)}function Ln(){return hl(`JSON5: invalid end of input at ${on}:${Ir}`)}function Ry(){return Ir-=5,hl(`JSON5: invalid identifier character at ${on}:${Ir}`)}function N_(t){console.warn(`JSON5: '${My(t)}' in strings is not valid ECMAScript; consider escaping`)}function My(t){let r={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(r[t])return r[t];if(t<" "){let e=t.charCodeAt(0).toString(16);return"\\x"+("00"+e).substring(e.length)}return t}function hl(t){let r=new SyntaxError(t);return r.lineNumber=on,r.columnNumber=Ir,r}});var jy=A((mU,Uy)=>{var gp=cp();Uy.exports=function(r,e,i){let n=[],s="",o,a,l="",u;if(e!=null&&typeof e=="object"&&!Array.isArray(e)&&(i=e.space,u=e.quote,e=e.replacer),typeof e=="function")a=e;else if(Array.isArray(e)){o=[];for(let g of e){let m;typeof g=="string"?m=g:(typeof g=="number"||g instanceof String||g instanceof Number)&&(m=String(g)),m!==void 0&&o.indexOf(m)<0&&o.push(m)}}return i instanceof Number?i=Number(i):i instanceof String&&(i=String(i)),typeof i=="number"?i>0&&(i=Math.min(10,Math.floor(i)),l=" ".substr(0,i)):typeof i=="string"&&(l=i.substr(0,10)),c("",{"":r});function c(g,m){let y=m[g];switch(y!=null&&(typeof y.toJSON5=="function"?y=y.toJSON5(g):typeof y.toJSON=="function"&&(y=y.toJSON(g))),a&&(y=a.call(m,g,y)),y instanceof Number?y=Number(y):y instanceof String?y=String(y):y instanceof Boolean&&(y=y.valueOf()),y){case null:return"null";case!0:return"true";case!1:return"false"}if(typeof y=="string")return p(y,!1);if(typeof y=="number")return String(y);if(typeof y=="object")return Array.isArray(y)?f(y):d(y)}function p(g){let m={"'":.1,'"':.2},y={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"},b="";for(let D=0;D<g.length;D++){let x=g[D];switch(x){case"'":case'"':m[x]++,b+=x;continue;case"\0":if(gp.isDigit(g[D+1])){b+="\\x00";continue}}if(y[x]){b+=y[x];continue}if(x<" "){let E=x.charCodeAt(0).toString(16);b+="\\x"+("00"+E).substring(E.length);continue}b+=x}let C=u||Object.keys(m).reduce((D,x)=>m[D]<m[x]?D:x);return b=b.replace(new RegExp(C,"g"),y[C]),C+b+C}function d(g){if(n.indexOf(g)>=0)throw TypeError("Converting circular structure to JSON5");n.push(g);let m=s;s=s+l;let y=o||Object.keys(g),b=[];for(let D of y){let x=c(D,g);if(x!==void 0){let E=h(D)+":";l!==""&&(E+=" "),E+=x,b.push(E)}}let C;if(b.length===0)C="{}";else{let D;if(l==="")D=b.join(","),C="{"+D+"}";else{let x=`,
|
|
9
9
|
`+s;D=b.join(x),C=`{
|
|
10
10
|
`+s+D+`,
|
|
11
11
|
`+m+"}"}}return n.pop(),s=m,C}function h(g){if(g.length===0)return p(g,!0);let m=String.fromCodePoint(g.codePointAt(0));if(!gp.isIdStartChar(m))return p(g,!0);for(let y=m.length;y<g.length;y++)if(!gp.isIdContinueChar(String.fromCodePoint(g.codePointAt(y))))return p(g,!0);return g}function f(g){if(n.indexOf(g)>=0)throw TypeError("Converting circular structure to JSON5");n.push(g);let m=s;s=s+l;let y=[];for(let C=0;C<g.length;C++){let D=c(String(C),g);y.push(D!==void 0?D:"null")}let b;if(y.length===0)b="[]";else if(l==="")b="["+y.join(",")+"]";else{let C=`,
|
|
@@ -108,15 +108,15 @@ Filtered results for: ${this.inputValue?this.inputValue:Li.gray("Enter something
|
|
|
108
108
|
`}renderOption(r,e,i){let n;return e.disabled?n=r===i?Li.gray().underline(e.title):Li.strikethrough().gray(e.title):n=r===i?Li.cyan().underline(e.title):e.title,(e.selected?Li.green(bs.radioOn):bs.radioOff)+" "+n}renderDoneOrInstructions(){if(this.done)return this.value.filter(e=>e.selected).map(e=>e.title).join(", ");let r=[Li.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&r.push(Li.yellow(this.warn)),r.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(s2.hide),super.render();let r=[TE.symbol(this.done,this.aborted),Li.bold(this.msg),TE.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(r+=Li.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),r+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+r),this.clear=wE(r,this.out.columns)}};AE.exports=Md});var kE=A((NK,FE)=>{var IE=Ze(),a2=Oi(),{style:_E,clear:l2}=Fr(),{erase:u2,cursor:NE}=$e(),Bd=class extends a2{constructor(r={}){super(r),this.msg=r.message,this.value=r.initial,this.initialValue=!!r.initial,this.yesMsg=r.yes||"yes",this.yesOption=r.yesOption||"(Y/n)",this.noMsg=r.no||"no",this.noOption=r.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
|
|
109
109
|
`),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
|
|
110
110
|
`),this.close()}_(r,e){return r.toLowerCase()==="y"?(this.value=!0,this.submit()):r.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(NE.hide):this.out.write(l2(this.outputText,this.out.columns)),super.render(),this.outputText=[_E.symbol(this.done,this.aborted),IE.bold(this.msg),_E.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:IE.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(u2.line+NE.to(0)+this.outputText))}};FE.exports=Bd});var RE=A((FK,OE)=>{"use strict";OE.exports={TextPrompt:Fx(),SelectPrompt:Lx(),TogglePrompt:Ux(),DatePrompt:dE(),NumberPrompt:gE(),MultiselectPrompt:kd(),AutocompletePrompt:vE(),AutocompleteMultiselectPrompt:PE(),ConfirmPrompt:kE()}});var ME=A(LE=>{"use strict";var Xt=LE,c2=RE(),Ml=t=>t;function li(t,r,e={}){return new Promise((i,n)=>{let s=new c2[t](r),o=e.onAbort||Ml,a=e.onSubmit||Ml,l=e.onExit||Ml;s.on("state",r.onState||Ml),s.on("submit",u=>i(a(u))),s.on("exit",u=>i(l(u))),s.on("abort",u=>n(o(u)))})}Xt.text=t=>li("TextPrompt",t);Xt.password=t=>(t.style="password",Xt.text(t));Xt.invisible=t=>(t.style="invisible",Xt.text(t));Xt.number=t=>li("NumberPrompt",t);Xt.date=t=>li("DatePrompt",t);Xt.confirm=t=>li("ConfirmPrompt",t);Xt.list=t=>{let r=t.separator||",";return li("TextPrompt",t,{onSubmit:e=>e.split(r).map(i=>i.trim())})};Xt.toggle=t=>li("TogglePrompt",t);Xt.select=t=>li("SelectPrompt",t);Xt.multiselect=t=>{t.choices=[].concat(t.choices||[]);let r=e=>e.filter(i=>i.selected).map(i=>i.value);return li("MultiselectPrompt",t,{onAbort:r,onSubmit:r})};Xt.autocompleteMultiselect=t=>{t.choices=[].concat(t.choices||[]);let r=e=>e.filter(i=>i.selected).map(i=>i.value);return li("AutocompleteMultiselectPrompt",t,{onAbort:r,onSubmit:r})};var p2=(t,r)=>Promise.resolve(r.filter(e=>e.title.slice(0,t.length).toLowerCase()===t.toLowerCase()));Xt.autocomplete=t=>(t.suggest=t.suggest||p2,t.choices=[].concat(t.choices||[]),li("AutocompletePrompt",t))});var UE=A((OK,$E)=>{"use strict";var $d=ME(),d2=["suggest","format","onState","validate","onRender","type"],BE=()=>{};async function dn(t=[],{onSubmit:r=BE,onCancel:e=BE}={}){let i={},n=dn._override||{};t=[].concat(t);let s,o,a,l,u,c,p=async(d,h,f=!1)=>{if(!(!f&&d.validate&&d.validate(h)!==!0))return d.format?await d.format(h,i):h};for(o of t)if({name:l,type:u}=o,typeof u=="function"&&(u=await u(s,{...i},o),o.type=u),!!u){for(let d in o){if(d2.includes(d))continue;let h=o[d];o[d]=typeof h=="function"?await h(s,{...i},c):h}if(c=o,typeof o.message!="string")throw new Error("prompt message is required");if({name:l,type:u}=o,$d[u]===void 0)throw new Error(`prompt type (${u}) is not defined`);if(n[o.name]!==void 0&&(s=await p(o,n[o.name]),s!==void 0)){i[l]=s;continue}try{s=dn._injected?f2(dn._injected,o.initial):await $d[u](o),i[l]=s=await p(o,s,!0),a=await r(o,s,i)}catch{a=!await e(o,i)}if(a)return i}return i}function f2(t,r){let e=t.shift();if(e instanceof Error)throw e;return e===void 0?r:e}function h2(t){dn._injected=(dn._injected||[]).concat(t)}function m2(t){dn._override=Object.assign({},t)}$E.exports=Object.assign(dn,{prompt:dn,prompts:$d,inject:h2,override:m2})});var qE=A((RK,jE)=>{function g2(t){t=(Array.isArray(t)?t:t.split(".")).map(Number);let r=0,e=process.versions.node.split(".").map(Number);for(;r<t.length;r++){if(e[r]>t[r])return!1;if(t[r]>e[r])return!0}return!1}jE.exports=g2("8.6.0")?dx():UE()});var fC=A((iz,dC)=>{function eC(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(r=>{let e=t[r],i=typeof e;(i==="object"||i==="function")&&!Object.isFrozen(e)&&eC(e)}),t}var Wl=class{constructor(r){r.data===void 0&&(r.data={}),this.data=r.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function tC(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function hn(t,...r){let e=Object.create(null);for(let i in t)e[i]=t[i];return r.forEach(function(i){for(let n in i)e[n]=i[n]}),e}var H2="</span>",H0=t=>!!t.scope,J2=(t,{prefix:r})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){let e=t.split(".");return[`${r}${e.shift()}`,...e.map((i,n)=>`${i}${"_".repeat(n+1)}`)].join(" ")}return`${r}${t}`},zd=class{constructor(r,e){this.buffer="",this.classPrefix=e.classPrefix,r.walk(this)}addText(r){this.buffer+=tC(r)}openNode(r){if(!H0(r))return;let e=J2(r.scope,{prefix:this.classPrefix});this.span(e)}closeNode(r){H0(r)&&(this.buffer+=H2)}value(){return this.buffer}span(r){this.buffer+=`<span class="${r}">`}},J0=(t={})=>{let r={children:[]};return Object.assign(r,t),r},Wd=class t{constructor(){this.rootNode=J0(),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 e=J0({scope:r});this.add(e),this.stack.push(e)}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,e){return typeof e=="string"?r.addText(e):e.children&&(r.openNode(e),e.children.forEach(i=>this._walk(r,i)),r.closeNode(e)),r}static _collapse(r){typeof r!="string"&&r.children&&(r.children.every(e=>typeof e=="string")?r.children=[r.children.join("")]:r.children.forEach(e=>{t._collapse(e)}))}},Gd=class extends Wd{constructor(r){super(),this.options=r}addText(r){r!==""&&this.add(r)}startScope(r){this.openNode(r)}endScope(){this.closeNode()}__addSublanguage(r,e){let i=r.root;e&&(i.scope=`language:${e}`),this.add(i)}toHTML(){return new zd(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function qo(t){return t?typeof t=="string"?t:t.source:null}function rC(t){return qn("(?=",t,")")}function Y2(t){return qn("(?:",t,")*")}function X2(t){return qn("(?:",t,")?")}function qn(...t){return t.map(e=>qo(e)).join("")}function Q2(t){let r=t[t.length-1];return typeof r=="object"&&r.constructor===Object?(t.splice(t.length-1,1),r):{}}function Jd(...t){return"("+(Q2(t).capture?"":"?:")+t.map(i=>qo(i)).join("|")+")"}function iC(t){return new RegExp(t.toString()+"|").exec("").length-1}function Z2(t,r){let e=t&&t.exec(r);return e&&e.index===0}var eO=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Yd(t,{joinWith:r}){let e=0;return t.map(i=>{e+=1;let n=e,s=qo(i),o="";for(;s.length>0;){let a=eO.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])+n):(o+=a[0],a[0]==="("&&e++)}return o}).map(i=>`(${i})`).join(r)}var tO=/\b\B/,nC="[a-zA-Z]\\w*",Xd="[a-zA-Z_]\\w*",sC="\\b\\d+(\\.\\d+)?",oC="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",aC="\\b(0b[01]+)",rO="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",iO=(t={})=>{let r=/^#![ ]*\//;return t.binary&&(t.begin=qn(r,/.*\b/,t.binary,/\b.*/)),hn({scope:"meta",begin:r,end:/$/,relevance:0,"on:begin":(e,i)=>{e.index!==0&&i.ignoreMatch()}},t)},Ko={begin:"\\\\[\\s\\S]",relevance:0},nO={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Ko]},sO={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Ko]},oO={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/},Hl=function(t,r,e={}){let i=hn({scope:"comment",begin:t,end:r,contains:[]},e);i.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 n=Jd("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 i.contains.push({begin:qn(/[ ]+/,"(",n,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),i},aO=Hl("//","$"),lO=Hl("/\\*","\\*/"),uO=Hl("#","$"),cO={scope:"number",begin:sC,relevance:0},pO={scope:"number",begin:oC,relevance:0},dO={scope:"number",begin:aC,relevance:0},fO={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Ko,{begin:/\[/,end:/\]/,relevance:0,contains:[Ko]}]},hO={scope:"title",begin:nC,relevance:0},mO={scope:"title",begin:Xd,relevance:0},gO={begin:"\\.\\s*"+Xd,relevance:0},yO=function(t){return Object.assign(t,{"on:begin":(r,e)=>{e.data._beginMatch=r[1]},"on:end":(r,e)=>{e.data._beginMatch!==r[1]&&e.ignoreMatch()}})},zl=Object.freeze({__proto__:null,APOS_STRING_MODE:nO,BACKSLASH_ESCAPE:Ko,BINARY_NUMBER_MODE:dO,BINARY_NUMBER_RE:aC,COMMENT:Hl,C_BLOCK_COMMENT_MODE:lO,C_LINE_COMMENT_MODE:aO,C_NUMBER_MODE:pO,C_NUMBER_RE:oC,END_SAME_AS_BEGIN:yO,HASH_COMMENT_MODE:uO,IDENT_RE:nC,MATCH_NOTHING_RE:tO,METHOD_GUARD:gO,NUMBER_MODE:cO,NUMBER_RE:sC,PHRASAL_WORDS_MODE:oO,QUOTE_STRING_MODE:sO,REGEXP_MODE:fO,RE_STARTERS_RE:rO,SHEBANG:iO,TITLE_MODE:hO,UNDERSCORE_IDENT_RE:Xd,UNDERSCORE_TITLE_MODE:mO});function bO(t,r){t.input[t.index-1]==="."&&r.ignoreMatch()}function DO(t,r){t.className!==void 0&&(t.scope=t.className,delete t.className)}function xO(t,r){r&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=bO,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,t.relevance===void 0&&(t.relevance=0))}function EO(t,r){Array.isArray(t.illegal)&&(t.illegal=Jd(...t.illegal))}function CO(t,r){if(t.match){if(t.begin||t.end)throw new Error("begin & end are not supported with match");t.begin=t.match,delete t.match}}function SO(t,r){t.relevance===void 0&&(t.relevance=1)}var vO=(t,r)=>{if(!t.beforeMatch)return;if(t.starts)throw new Error("beforeMatch cannot be used with starts");let e=Object.assign({},t);Object.keys(t).forEach(i=>{delete t[i]}),t.keywords=e.keywords,t.begin=qn(e.beforeMatch,rC(e.begin)),t.starts={relevance:0,contains:[Object.assign(e,{endsParent:!0})]},t.relevance=0,delete e.beforeMatch},wO=["of","and","for","in","not","or","if","then","parent","list","value"],TO="keyword";function lC(t,r,e=TO){let i=Object.create(null);return typeof t=="string"?n(e,t.split(" ")):Array.isArray(t)?n(e,t):Object.keys(t).forEach(function(s){Object.assign(i,lC(t[s],r,s))}),i;function n(s,o){r&&(o=o.map(a=>a.toLowerCase())),o.forEach(function(a){let l=a.split("|");i[l[0]]=[s,AO(l[0],l[1])]})}}function AO(t,r){return r?Number(r):PO(t)?0:1}function PO(t){return wO.includes(t.toLowerCase())}var Y0={},jn=t=>{console.error(t)},X0=(t,...r)=>{console.log(`WARN: ${t}`,...r)},Es=(t,r)=>{Y0[`${t}/${r}`]||(console.log(`Deprecated as of ${t}. ${r}`),Y0[`${t}/${r}`]=!0)},Gl=new Error;function uC(t,r,{key:e}){let i=0,n=t[e],s={},o={};for(let a=1;a<=r.length;a++)o[a+i]=n[a],s[a+i]=!0,i+=iC(r[a-1]);t[e]=o,t[e]._emit=s,t[e]._multi=!0}function IO(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw jn("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Gl;if(typeof t.beginScope!="object"||t.beginScope===null)throw jn("beginScope must be object"),Gl;uC(t,t.begin,{key:"beginScope"}),t.begin=Yd(t.begin,{joinWith:""})}}function _O(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw jn("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Gl;if(typeof t.endScope!="object"||t.endScope===null)throw jn("endScope must be object"),Gl;uC(t,t.end,{key:"endScope"}),t.end=Yd(t.end,{joinWith:""})}}function NO(t){t.scope&&typeof t.scope=="object"&&t.scope!==null&&(t.beginScope=t.scope,delete t.scope)}function FO(t){NO(t),typeof t.beginScope=="string"&&(t.beginScope={_wrap:t.beginScope}),typeof t.endScope=="string"&&(t.endScope={_wrap:t.endScope}),IO(t),_O(t)}function kO(t){function r(o,a){return new RegExp(qo(o),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(a?"g":""))}class e{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+=iC(a)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let a=this.regexes.map(l=>l[1]);this.matcherRe=r(Yd(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 i{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 e;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 n(o){let a=new i;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;[DO,CO,FO,vO].forEach(c=>c(o,a)),t.compilerExtensions.forEach(c=>c(o,a)),o.__beforeBegin=null,[xO,EO,SO].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=lC(o.keywords,t.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=qo(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 OO(c==="self"?o:c)})),o.contains.forEach(function(c){s(c,l)}),o.starts&&s(o.starts,a),l.matcher=n(l),l}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=hn(t.classNameAliases||{}),s(t)}function cC(t){return t?t.endsWithParent||cC(t.starts):!1}function OO(t){return t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(r){return hn(t,{variants:null},r)})),t.cachedVariants?t.cachedVariants:cC(t)?hn(t,{starts:t.starts?hn(t.starts):null}):Object.isFrozen(t)?hn(t):t}var RO="11.9.0",Hd=class extends Error{constructor(r,e){super(r),this.name="HTMLInjectionError",this.html=e}},Vd=tC,Q0=hn,Z0=Symbol("nomatch"),LO=7,pC=function(t){let r=Object.create(null),e=Object.create(null),i=[],n=!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:Gd};function l(_){return a.noHighlightRe.test(_)}function u(_){let B=_.className+" ";B+=_.parentNode?_.parentNode.className:"";let G=a.languageDetectRe.exec(B);if(G){let P=M(G[1]);return P||(X0(s.replace("{}",G[1])),X0("Falling back to no-highlight mode for this block.",_)),P?G[1]:"no-highlight"}return B.split(/\s+/).find(P=>l(P)||M(P))}function c(_,B,G){let P="",N="";typeof B=="object"?(P=_,G=B.ignoreIllegals,N=B.language):(Es("10.7.0","highlight(lang, code, ...args) has been deprecated."),Es("10.7.0",`Please use highlight(code, options) instead.
|
|
111
|
-
https://github.com/highlightjs/highlight.js/issues/2277`),N=_,P=B),G===void 0&&(G=!0);let O={code:P,language:N};Z("before:highlight",O);let V=O.result?O.result:p(O.language,O.code,G);return V.code=O.code,Z("after:highlight",V),V}function p(_,B,G,P){let N=Object.create(null);function O(j,Y){return j.keywords[Y]}function V(){if(!ne.keywords){Ct.addText(Ke);return}let j=0;ne.keywordPatternRe.lastIndex=0;let Y=ne.keywordPatternRe.exec(Ke),ce="";for(;Y;){ce+=Ke.substring(j,Y.index);let ke=dr.case_insensitive?Y[0].toLowerCase():Y[0],Tt=O(ne,ke);if(Tt){let[Ci,fP]=Tt;if(Ct.addText(ce),ce="",N[ke]=(N[ke]||0)+1,N[ke]<=LO&&(ja+=fP),Ci.startsWith("_"))ce+=Y[0];else{let hP=dr.classNameAliases[Ci]||Ci;ae(Y[0],hP)}}else ce+=Y[0];j=ne.keywordPatternRe.lastIndex,Y=ne.keywordPatternRe.exec(Ke)}ce+=Ke.substring(j),Ct.addText(ce)}function ue(){if(Ke==="")return;let j=null;if(typeof ne.subLanguage=="string"){if(!r[ne.subLanguage]){Ct.addText(Ke);return}j=p(ne.subLanguage,Ke,!0,Am[ne.subLanguage]),Am[ne.subLanguage]=j._top}else j=h(Ke,ne.subLanguage.length?ne.subLanguage:null);ne.relevance>0&&(ja+=j.relevance),Ct.__addSublanguage(j._emitter,j.language)}function ee(){ne.subLanguage!=null?ue():V(),Ke=""}function ae(j,Y){j!==""&&(Ct.startScope(Y),Ct.addText(j),Ct.endScope())}function ct(j,Y){let ce=1,ke=Y.length-1;for(;ce<=ke;){if(!j._emit[ce]){ce++;continue}let Tt=dr.classNameAliases[j[ce]]||j[ce],Ci=Y[ce];Tt?ae(Ci,Tt):(Ke=Ci,V(),Ke=""),ce++}}function ht(j,Y){return j.scope&&typeof j.scope=="string"&&Ct.openNode(dr.classNameAliases[j.scope]||j.scope),j.beginScope&&(j.beginScope._wrap?(ae(Ke,dr.classNameAliases[j.beginScope._wrap]||j.beginScope._wrap),Ke=""):j.beginScope._multi&&(ct(j.beginScope,Y),Ke="")),ne=Object.create(j,{parent:{value:ne}}),ne}function Di(j,Y,ce){let ke=Z2(j.endRe,ce);if(ke){if(j["on:end"]){let Tt=new Wl(j);j["on:end"](Y,Tt),Tt.isMatchIgnored&&(ke=!1)}if(ke){for(;j.endsParent&&j.parent;)j=j.parent;return j}}if(j.endsWithParent)return Di(j.parent,Y,ce)}function ao(j){return ne.matcher.regexIndex===0?(Ke+=j[0],1):(Cc=!0,0)}function xi(j){let Y=j[0],ce=j.rule,ke=new Wl(ce),Tt=[ce.__beforeBegin,ce["on:begin"]];for(let Ci of Tt)if(Ci&&(Ci(j,ke),ke.isMatchIgnored))return ao(Y);return ce.skip?Ke+=Y:(ce.excludeBegin&&(Ke+=Y),ee(),!ce.returnBegin&&!ce.excludeBegin&&(Ke=Y)),ht(ce,j),ce.returnBegin?0:Y.length}function lo(j){let Y=j[0],ce=B.substring(j.index),ke=Di(ne,j,ce);if(!ke)return Z0;let Tt=ne;ne.endScope&&ne.endScope._wrap?(ee(),ae(Y,ne.endScope._wrap)):ne.endScope&&ne.endScope._multi?(ee(),ct(ne.endScope,j)):Tt.skip?Ke+=Y:(Tt.returnEnd||Tt.excludeEnd||(Ke+=Y),ee(),Tt.excludeEnd&&(Ke=Y));do ne.scope&&Ct.closeNode(),!ne.skip&&!ne.subLanguage&&(ja+=ne.relevance),ne=ne.parent;while(ne!==ke.parent);return ke.starts&&ht(ke.starts,j),Tt.returnEnd?0:Y.length}function Ie(){let j=[];for(let Y=ne;Y!==dr;Y=Y.parent)Y.scope&&j.unshift(Y.scope);j.forEach(Y=>Ct.openNode(Y))}let Ei={};function Qi(j,Y){let ce=Y&&Y[0];if(Ke+=j,ce==null)return ee(),0;if(Ei.type==="begin"&&Y.type==="end"&&Ei.index===Y.index&&ce===""){if(Ke+=B.slice(Y.index,Y.index+1),!n){let ke=new Error(`0 width match regex (${_})`);throw ke.languageName=_,ke.badRule=Ei.rule,ke}return 1}if(Ei=Y,Y.type==="begin")return xi(Y);if(Y.type==="illegal"&&!G){let ke=new Error('Illegal lexeme "'+ce+'" for mode "'+(ne.scope||"<unnamed>")+'"');throw ke.mode=ne,ke}else if(Y.type==="end"){let ke=lo(Y);if(ke!==Z0)return ke}if(Y.type==="illegal"&&ce==="")return 1;if(Ec>1e5&&Ec>Y.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Ke+=ce,ce.length}let dr=M(_);if(!dr)throw jn(s.replace("{}",_)),new Error('Unknown language: "'+_+'"');let dP=kO(dr),xc="",ne=P||dP,Am={},Ct=new a.__emitter(a);Ie();let Ke="",ja=0,Tn=0,Ec=0,Cc=!1;try{if(dr.__emitTokens)dr.__emitTokens(B,Ct);else{for(ne.matcher.considerAll();;){Ec++,Cc?Cc=!1:ne.matcher.considerAll(),ne.matcher.lastIndex=Tn;let j=ne.matcher.exec(B);if(!j)break;let Y=B.substring(Tn,j.index),ce=Qi(Y,j);Tn=j.index+ce}Qi(B.substring(Tn))}return Ct.finalize(),xc=Ct.toHTML(),{language:_,value:xc,relevance:ja,illegal:!1,_emitter:Ct,_top:ne}}catch(j){if(j.message&&j.message.includes("Illegal"))return{language:_,value:Vd(B),illegal:!0,relevance:0,_illegalBy:{message:j.message,index:Tn,context:B.slice(Tn-100,Tn+100),mode:j.mode,resultSoFar:xc},_emitter:Ct};if(n)return{language:_,value:Vd(B),illegal:!1,relevance:0,errorRaised:j,_emitter:Ct,_top:ne};throw j}}function d(_){let B={value:Vd(_),illegal:!1,relevance:0,_top:o,_emitter:new a.__emitter(a)};return B._emitter.addText(_),B}function h(_,B){B=B||a.languages||Object.keys(r);let G=d(_),P=B.filter(M).filter(L).map(ee=>p(ee,_,!1));P.unshift(G);let N=P.sort((ee,ae)=>{if(ee.relevance!==ae.relevance)return ae.relevance-ee.relevance;if(ee.language&&ae.language){if(M(ee.language).supersetOf===ae.language)return 1;if(M(ae.language).supersetOf===ee.language)return-1}return 0}),[O,V]=N,ue=O;return ue.secondBest=V,ue}function f(_,B,G){let P=B&&e[B]||G;_.classList.add("hljs"),_.classList.add(`language-${P}`)}function g(_){let B=null,G=u(_);if(l(G))return;if(Z("before:highlightElement",{el:_,language:G}),_.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",_);return}if(_.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(_)),a.throwUnescapedHTML))throw new Hd("One of your code blocks includes unescaped HTML.",_.innerHTML);B=_;let P=B.textContent,N=G?c(P,{language:G,ignoreIllegals:!0}):h(P);_.innerHTML=N.value,_.dataset.highlighted="yes",f(_,G,N.language),_.result={language:N.language,re:N.relevance,relevance:N.relevance},N.secondBest&&(_.secondBest={language:N.secondBest.language,relevance:N.secondBest.relevance}),Z("after:highlightElement",{el:_,result:N,text:P})}function m(_){a=Q0(a,_)}let y=()=>{D(),Es("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function b(){D(),Es("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let C=!1;function D(){if(document.readyState==="loading"){C=!0;return}document.querySelectorAll(a.cssSelector).forEach(g)}function x(){C&&D()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",x,!1);function E(_,B){let G=null;try{G=B(t)}catch(P){if(jn("Language definition for '{}' could not be registered.".replace("{}",_)),n)jn(P);else throw P;G=o}G.name||(G.name=_),r[_]=G,G.rawDefinition=B.bind(null,t),G.aliases&&T(G.aliases,{languageName:_})}function w(_){delete r[_];for(let B of Object.keys(e))e[B]===_&&delete e[B]}function R(){return Object.keys(r)}function M(_){return _=(_||"").toLowerCase(),r[_]||r[e[_]]}function T(_,{languageName:B}){typeof _=="string"&&(_=[_]),_.forEach(G=>{e[G.toLowerCase()]=B})}function L(_){let B=M(_);return B&&!B.disableAutodetect}function Q(_){_["before:highlightBlock"]&&!_["before:highlightElement"]&&(_["before:highlightElement"]=B=>{_["before:highlightBlock"](Object.assign({block:B.el},B))}),_["after:highlightBlock"]&&!_["after:highlightElement"]&&(_["after:highlightElement"]=B=>{_["after:highlightBlock"](Object.assign({block:B.el},B))})}function ie(_){Q(_),i.push(_)}function re(_){let B=i.indexOf(_);B!==-1&&i.splice(B,1)}function Z(_,B){let G=_;i.forEach(function(P){P[G]&&P[G](B)})}function Pe(_){return Es("10.7.0","highlightBlock will be removed entirely in v12.0"),Es("10.7.0","Please use highlightElement now."),g(_)}Object.assign(t,{highlight:c,highlightAuto:h,highlightAll:D,highlightElement:g,highlightBlock:Pe,configure:m,initHighlighting:y,initHighlightingOnLoad:b,registerLanguage:E,unregisterLanguage:w,listLanguages:R,getLanguage:M,registerAliases:T,autoDetection:L,inherit:Q0,addPlugin:ie,removePlugin:re}),t.debugMode=function(){n=!1},t.safeMode=function(){n=!0},t.versionString=RO,t.regex={concat:qn,lookahead:rC,either:Jd,optional:X2,anyNumberOfTimes:Y2};for(let _ in zl)typeof zl[_]=="object"&&eC(zl[_]);return Object.assign(t,zl),t},Cs=pC({});Cs.newInstance=()=>pC({});dC.exports=Cs;Cs.HighlightJS=Cs;Cs.default=Cs});var Wo={};Sc(Wo,{__addDisposableResource:()=>YC,__assign:()=>Zl,__asyncDelegator:()=>qC,__asyncGenerator:()=>jC,__asyncValues:()=>KC,__await:()=>ws,__awaiter:()=>RC,__classPrivateFieldGet:()=>GC,__classPrivateFieldIn:()=>JC,__classPrivateFieldSet:()=>HC,__createBinding:()=>tu,__decorate:()=>FC,__disposeResources:()=>XC,__esDecorate:()=>XO,__exportStar:()=>MC,__extends:()=>_C,__generator:()=>LC,__importDefault:()=>WC,__importStar:()=>zC,__makeTemplateObject:()=>VC,__metadata:()=>OC,__param:()=>kC,__propKey:()=>ZO,__read:()=>af,__rest:()=>NC,__runInitializers:()=>QO,__setFunctionName:()=>eR,__spread:()=>BC,__spreadArray:()=>UC,__spreadArrays:()=>$C,__values:()=>eu,default:()=>iR});function _C(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");of(t,r);function e(){this.constructor=t}t.prototype=r===null?Object.create(r):(e.prototype=r.prototype,new e)}function NC(t,r){var e={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&r.indexOf(i)<0&&(e[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(t);n<i.length;n++)r.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(e[i[n]]=t[i[n]]);return e}function FC(t,r,e,i){var n=arguments.length,s=n<3?r:i===null?i=Object.getOwnPropertyDescriptor(r,e):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,r,e,i);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(n<3?o(s):n>3?o(r,e,s):o(r,e))||s);return n>3&&s&&Object.defineProperty(r,e,s),s}function kC(t,r){return function(e,i){r(e,i,t)}}function XO(t,r,e,i,n,s){function o(y){if(y!==void 0&&typeof y!="function")throw new TypeError("Function expected");return y}for(var a=i.kind,l=a==="getter"?"get":a==="setter"?"set":"value",u=!r&&t?i.static?t:t.prototype:null,c=r||(u?Object.getOwnPropertyDescriptor(u,i.name):{}),p,d=!1,h=e.length-1;h>=0;h--){var f={};for(var g in i)f[g]=g==="access"?{}:i[g];for(var g in i.access)f.access[g]=i.access[g];f.addInitializer=function(y){if(d)throw new TypeError("Cannot add initializers after decoration has completed");s.push(o(y||null))};var m=(0,e[h])(a==="accessor"?{get:c.get,set:c.set}:c[l],f);if(a==="accessor"){if(m===void 0)continue;if(m===null||typeof m!="object")throw new TypeError("Object expected");(p=o(m.get))&&(c.get=p),(p=o(m.set))&&(c.set=p),(p=o(m.init))&&n.unshift(p)}else(p=o(m))&&(a==="field"?n.unshift(p):c[l]=p)}u&&Object.defineProperty(u,i.name,c),d=!0}function QO(t,r,e){for(var i=arguments.length>2,n=0;n<r.length;n++)e=i?r[n].call(t,e):r[n].call(t);return i?e:void 0}function ZO(t){return typeof t=="symbol"?t:"".concat(t)}function eR(t,r,e){return typeof r=="symbol"&&(r=r.description?"[".concat(r.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:e?"".concat(e," ",r):r})}function OC(t,r){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,r)}function RC(t,r,e,i){function n(s){return s instanceof e?s:new e(function(o){o(s)})}return new(e||(e=Promise))(function(s,o){function a(c){try{u(i.next(c))}catch(p){o(p)}}function l(c){try{u(i.throw(c))}catch(p){o(p)}}function u(c){c.done?s(c.value):n(c.value).then(a,l)}u((i=i.apply(t,r||[])).next())})}function LC(t,r){var e={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(c){return l([u,c])}}function l(u){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(e=0)),e;)try{if(i=1,n&&(s=u[0]&2?n.return:u[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,u[1])).done)return s;switch(n=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return e.label++,{value:u[1],done:!1};case 5:e.label++,n=u[1],u=[0];continue;case 7:u=e.ops.pop(),e.trys.pop();continue;default:if(s=e.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){e.label=u[1];break}if(u[0]===6&&e.label<s[1]){e.label=s[1],s=u;break}if(s&&e.label<s[2]){e.label=s[2],e.ops.push(u);break}s[2]&&e.ops.pop(),e.trys.pop();continue}u=r.call(t,e)}catch(c){u=[6,c],n=0}finally{i=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function MC(t,r){for(var e in t)e!=="default"&&!Object.prototype.hasOwnProperty.call(r,e)&&tu(r,t,e)}function eu(t){var r=typeof Symbol=="function"&&Symbol.iterator,e=r&&t[r],i=0;if(e)return e.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")}function af(t,r){var e=typeof Symbol=="function"&&t[Symbol.iterator];if(!e)return t;var i=e.call(t),n,s=[],o;try{for(;(r===void 0||r-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(a){o={error:a}}finally{try{n&&!n.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return s}function BC(){for(var t=[],r=0;r<arguments.length;r++)t=t.concat(af(arguments[r]));return t}function $C(){for(var t=0,r=0,e=arguments.length;r<e;r++)t+=arguments[r].length;for(var i=Array(t),n=0,r=0;r<e;r++)for(var s=arguments[r],o=0,a=s.length;o<a;o++,n++)i[n]=s[o];return i}function UC(t,r,e){if(e||arguments.length===2)for(var i=0,n=r.length,s;i<n;i++)(s||!(i in r))&&(s||(s=Array.prototype.slice.call(r,0,i)),s[i]=r[i]);return t.concat(s||Array.prototype.slice.call(r))}function ws(t){return this instanceof ws?(this.v=t,this):new ws(t)}function jC(t,r,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=e.apply(t,r||[]),n,s=[];return n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n;function o(d){i[d]&&(n[d]=function(h){return new Promise(function(f,g){s.push([d,h,f,g])>1||a(d,h)})})}function a(d,h){try{l(i[d](h))}catch(f){p(s[0][3],f)}}function l(d){d.value instanceof ws?Promise.resolve(d.value.v).then(u,c):p(s[0][2],d)}function u(d){a("next",d)}function c(d){a("throw",d)}function p(d,h){d(h),s.shift(),s.length&&a(s[0][0],s[0][1])}}function qC(t){var r,e;return r={},i("next"),i("throw",function(n){throw n}),i("return"),r[Symbol.iterator]=function(){return this},r;function i(n,s){r[n]=t[n]?function(o){return(e=!e)?{value:ws(t[n](o)),done:!1}:s?s(o):o}:s}}function KC(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=t[Symbol.asyncIterator],e;return r?r.call(t):(t=typeof eu=="function"?eu(t):t[Symbol.iterator](),e={},i("next"),i("throw"),i("return"),e[Symbol.asyncIterator]=function(){return this},e);function i(s){e[s]=t[s]&&function(o){return new Promise(function(a,l){o=t[s](o),n(a,l,o.done,o.value)})}}function n(s,o,a,l){Promise.resolve(l).then(function(u){s({value:u,done:a})},o)}}function VC(t,r){return Object.defineProperty?Object.defineProperty(t,"raw",{value:r}):t.raw=r,t}function zC(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var e in t)e!=="default"&&Object.prototype.hasOwnProperty.call(t,e)&&tu(r,t,e);return tR(r,t),r}function WC(t){return t&&t.__esModule?t:{default:t}}function GC(t,r,e,i){if(e==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof r=="function"?t!==r||!i:!r.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?i:e==="a"?i.call(t):i?i.value:r.get(t)}function HC(t,r,e,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof r=="function"?t!==r||!n:!r.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,e):n?n.value=e:r.set(t,e),e}function JC(t,r){if(r===null||typeof r!="object"&&typeof r!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?r===t:t.has(r)}function YC(t,r,e){if(r!=null){if(typeof r!="object"&&typeof r!="function")throw new TypeError("Object expected.");var i;if(e){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=r[Symbol.asyncDispose]}if(i===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=r[Symbol.dispose]}if(typeof i!="function")throw new TypeError("Object not disposable.");t.stack.push({value:r,dispose:i,async:e})}else e&&t.stack.push({async:!0});return r}function XC(t){function r(i){t.error=t.hasError?new rR(i,t.error,"An error was suppressed during disposal."):i,t.hasError=!0}function e(){for(;t.stack.length;){var i=t.stack.pop();try{var n=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(n).then(e,function(s){return r(s),e()})}catch(s){r(s)}}if(t.hasError)throw t.error}return e()}var of,Zl,tu,tR,rR,iR,Go=Pm(()=>{of=function(t,r){return of=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},of(t,r)};Zl=function(){return Zl=Object.assign||function(r){for(var e,i=1,n=arguments.length;i<n;i++){e=arguments[i];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=e[s])}return r},Zl.apply(this,arguments)};tu=Object.create?function(t,r,e,i){i===void 0&&(i=e);var n=Object.getOwnPropertyDescriptor(r,e);(!n||("get"in n?!r.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return r[e]}}),Object.defineProperty(t,i,n)}:function(t,r,e,i){i===void 0&&(i=e),t[i]=r[e]};tR=Object.create?function(t,r){Object.defineProperty(t,"default",{enumerable:!0,value:r})}:function(t,r){t.default=r};rR=typeof SuppressedError=="function"?SuppressedError:function(t,r,e){var i=new Error(e);return i.name="SuppressedError",i.error=t,i.suppressed=r,i};iR={__extends:_C,__assign:Zl,__rest:NC,__decorate:FC,__param:kC,__metadata:OC,__awaiter:RC,__generator:LC,__createBinding:tu,__exportStar:MC,__values:eu,__read:af,__spread:BC,__spreadArrays:$C,__spreadArray:UC,__await:ws,__asyncGenerator:jC,__asyncDelegator:qC,__asyncValues:KC,__makeTemplateObject:VC,__importStar:zC,__importDefault:WC,__classPrivateFieldGet:GC,__classPrivateFieldSet:HC,__classPrivateFieldIn:JC,__addDisposableResource:YC,__disposeResources:XC}});var ui={};Sc(ui,{__addDisposableResource:()=>bS,__assign:()=>ru,__asyncDelegator:()=>cS,__asyncGenerator:()=>uS,__asyncValues:()=>pS,__await:()=>Ts,__awaiter:()=>iS,__classPrivateFieldGet:()=>mS,__classPrivateFieldIn:()=>yS,__classPrivateFieldSet:()=>gS,__createBinding:()=>nu,__decorate:()=>eS,__disposeResources:()=>DS,__esDecorate:()=>nR,__exportStar:()=>sS,__extends:()=>QC,__generator:()=>nS,__importDefault:()=>hS,__importStar:()=>fS,__makeTemplateObject:()=>dS,__metadata:()=>rS,__param:()=>tS,__propKey:()=>oR,__read:()=>uf,__rest:()=>ZC,__runInitializers:()=>sR,__setFunctionName:()=>aR,__spread:()=>oS,__spreadArray:()=>lS,__spreadArrays:()=>aS,__values:()=>iu,default:()=>cR});function QC(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");lf(t,r);function e(){this.constructor=t}t.prototype=r===null?Object.create(r):(e.prototype=r.prototype,new e)}function ZC(t,r){var e={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&r.indexOf(i)<0&&(e[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(t);n<i.length;n++)r.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(e[i[n]]=t[i[n]]);return e}function eS(t,r,e,i){var n=arguments.length,s=n<3?r:i===null?i=Object.getOwnPropertyDescriptor(r,e):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,r,e,i);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(n<3?o(s):n>3?o(r,e,s):o(r,e))||s);return n>3&&s&&Object.defineProperty(r,e,s),s}function tS(t,r){return function(e,i){r(e,i,t)}}function nR(t,r,e,i,n,s){function o(y){if(y!==void 0&&typeof y!="function")throw new TypeError("Function expected");return y}for(var a=i.kind,l=a==="getter"?"get":a==="setter"?"set":"value",u=!r&&t?i.static?t:t.prototype:null,c=r||(u?Object.getOwnPropertyDescriptor(u,i.name):{}),p,d=!1,h=e.length-1;h>=0;h--){var f={};for(var g in i)f[g]=g==="access"?{}:i[g];for(var g in i.access)f.access[g]=i.access[g];f.addInitializer=function(y){if(d)throw new TypeError("Cannot add initializers after decoration has completed");s.push(o(y||null))};var m=(0,e[h])(a==="accessor"?{get:c.get,set:c.set}:c[l],f);if(a==="accessor"){if(m===void 0)continue;if(m===null||typeof m!="object")throw new TypeError("Object expected");(p=o(m.get))&&(c.get=p),(p=o(m.set))&&(c.set=p),(p=o(m.init))&&n.unshift(p)}else(p=o(m))&&(a==="field"?n.unshift(p):c[l]=p)}u&&Object.defineProperty(u,i.name,c),d=!0}function sR(t,r,e){for(var i=arguments.length>2,n=0;n<r.length;n++)e=i?r[n].call(t,e):r[n].call(t);return i?e:void 0}function oR(t){return typeof t=="symbol"?t:"".concat(t)}function aR(t,r,e){return typeof r=="symbol"&&(r=r.description?"[".concat(r.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:e?"".concat(e," ",r):r})}function rS(t,r){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,r)}function iS(t,r,e,i){function n(s){return s instanceof e?s:new e(function(o){o(s)})}return new(e||(e=Promise))(function(s,o){function a(c){try{u(i.next(c))}catch(p){o(p)}}function l(c){try{u(i.throw(c))}catch(p){o(p)}}function u(c){c.done?s(c.value):n(c.value).then(a,l)}u((i=i.apply(t,r||[])).next())})}function nS(t,r){var e={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(c){return l([u,c])}}function l(u){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(e=0)),e;)try{if(i=1,n&&(s=u[0]&2?n.return:u[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,u[1])).done)return s;switch(n=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return e.label++,{value:u[1],done:!1};case 5:e.label++,n=u[1],u=[0];continue;case 7:u=e.ops.pop(),e.trys.pop();continue;default:if(s=e.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){e.label=u[1];break}if(u[0]===6&&e.label<s[1]){e.label=s[1],s=u;break}if(s&&e.label<s[2]){e.label=s[2],e.ops.push(u);break}s[2]&&e.ops.pop(),e.trys.pop();continue}u=r.call(t,e)}catch(c){u=[6,c],n=0}finally{i=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function sS(t,r){for(var e in t)e!=="default"&&!Object.prototype.hasOwnProperty.call(r,e)&&nu(r,t,e)}function iu(t){var r=typeof Symbol=="function"&&Symbol.iterator,e=r&&t[r],i=0;if(e)return e.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")}function uf(t,r){var e=typeof Symbol=="function"&&t[Symbol.iterator];if(!e)return t;var i=e.call(t),n,s=[],o;try{for(;(r===void 0||r-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(a){o={error:a}}finally{try{n&&!n.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return s}function oS(){for(var t=[],r=0;r<arguments.length;r++)t=t.concat(uf(arguments[r]));return t}function aS(){for(var t=0,r=0,e=arguments.length;r<e;r++)t+=arguments[r].length;for(var i=Array(t),n=0,r=0;r<e;r++)for(var s=arguments[r],o=0,a=s.length;o<a;o++,n++)i[n]=s[o];return i}function lS(t,r,e){if(e||arguments.length===2)for(var i=0,n=r.length,s;i<n;i++)(s||!(i in r))&&(s||(s=Array.prototype.slice.call(r,0,i)),s[i]=r[i]);return t.concat(s||Array.prototype.slice.call(r))}function Ts(t){return this instanceof Ts?(this.v=t,this):new Ts(t)}function uS(t,r,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=e.apply(t,r||[]),n,s=[];return n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n;function o(d){i[d]&&(n[d]=function(h){return new Promise(function(f,g){s.push([d,h,f,g])>1||a(d,h)})})}function a(d,h){try{l(i[d](h))}catch(f){p(s[0][3],f)}}function l(d){d.value instanceof Ts?Promise.resolve(d.value.v).then(u,c):p(s[0][2],d)}function u(d){a("next",d)}function c(d){a("throw",d)}function p(d,h){d(h),s.shift(),s.length&&a(s[0][0],s[0][1])}}function cS(t){var r,e;return r={},i("next"),i("throw",function(n){throw n}),i("return"),r[Symbol.iterator]=function(){return this},r;function i(n,s){r[n]=t[n]?function(o){return(e=!e)?{value:Ts(t[n](o)),done:!1}:s?s(o):o}:s}}function pS(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=t[Symbol.asyncIterator],e;return r?r.call(t):(t=typeof iu=="function"?iu(t):t[Symbol.iterator](),e={},i("next"),i("throw"),i("return"),e[Symbol.asyncIterator]=function(){return this},e);function i(s){e[s]=t[s]&&function(o){return new Promise(function(a,l){o=t[s](o),n(a,l,o.done,o.value)})}}function n(s,o,a,l){Promise.resolve(l).then(function(u){s({value:u,done:a})},o)}}function dS(t,r){return Object.defineProperty?Object.defineProperty(t,"raw",{value:r}):t.raw=r,t}function fS(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var e in t)e!=="default"&&Object.prototype.hasOwnProperty.call(t,e)&&nu(r,t,e);return lR(r,t),r}function hS(t){return t&&t.__esModule?t:{default:t}}function mS(t,r,e,i){if(e==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof r=="function"?t!==r||!i:!r.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?i:e==="a"?i.call(t):i?i.value:r.get(t)}function gS(t,r,e,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof r=="function"?t!==r||!n:!r.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,e):n?n.value=e:r.set(t,e),e}function yS(t,r){if(r===null||typeof r!="object"&&typeof r!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?r===t:t.has(r)}function bS(t,r,e){if(r!=null){if(typeof r!="object"&&typeof r!="function")throw new TypeError("Object expected.");var i;if(e){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=r[Symbol.asyncDispose]}if(i===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=r[Symbol.dispose]}if(typeof i!="function")throw new TypeError("Object not disposable.");t.stack.push({value:r,dispose:i,async:e})}else e&&t.stack.push({async:!0});return r}function DS(t){function r(i){t.error=t.hasError?new uR(i,t.error,"An error was suppressed during disposal."):i,t.hasError=!0}function e(){for(;t.stack.length;){var i=t.stack.pop();try{var n=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(n).then(e,function(s){return r(s),e()})}catch(s){r(s)}}if(t.hasError)throw t.error}return e()}var lf,ru,nu,lR,uR,cR,ci=Pm(()=>{lf=function(t,r){return lf=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},lf(t,r)};ru=function(){return ru=Object.assign||function(r){for(var e,i=1,n=arguments.length;i<n;i++){e=arguments[i];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=e[s])}return r},ru.apply(this,arguments)};nu=Object.create?function(t,r,e,i){i===void 0&&(i=e);var n=Object.getOwnPropertyDescriptor(r,e);(!n||("get"in n?!r.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return r[e]}}),Object.defineProperty(t,i,n)}:function(t,r,e,i){i===void 0&&(i=e),t[i]=r[e]};lR=Object.create?function(t,r){Object.defineProperty(t,"default",{enumerable:!0,value:r})}:function(t,r){t.default=r};uR=typeof SuppressedError=="function"?SuppressedError:function(t,r,e){var i=new Error(e);return i.name="SuppressedError",i.error=t,i.suppressed=r,i};cR={__extends:QC,__assign:ru,__rest:ZC,__decorate:eS,__param:tS,__metadata:rS,__awaiter:iS,__generator:nS,__createBinding:nu,__exportStar:sS,__values:iu,__read:uf,__spread:oS,__spreadArrays:aS,__spreadArray:lS,__await:Ts,__asyncGenerator:uS,__asyncDelegator:cS,__asyncValues:pS,__makeTemplateObject:dS,__importStar:fS,__importDefault:hS,__classPrivateFieldGet:mS,__classPrivateFieldSet:gS,__classPrivateFieldIn:yS,__addDisposableResource:bS,__disposeResources:DS}});var xS=A(Or=>{Object.defineProperty(Or,"__esModule",{value:!0});Or.SpecialEventType=Or.RevenueProperty=Or.IdentifyOperation=void 0;var pR;(function(t){t.SET="$set",t.SET_ONCE="$setOnce",t.ADD="$add",t.APPEND="$append",t.PREPEND="$prepend",t.REMOVE="$remove",t.PREINSERT="$preInsert",t.POSTINSERT="$postInsert",t.UNSET="$unset",t.CLEAR_ALL="$clearAll"})(pR=Or.IdentifyOperation||(Or.IdentifyOperation={}));var dR;(function(t){t.REVENUE_PRODUCT_ID="$productId",t.REVENUE_QUANTITY="$quantity",t.REVENUE_PRICE="$price",t.REVENUE_TYPE="$revenueType",t.REVENUE="$revenue"})(dR=Or.RevenueProperty||(Or.RevenueProperty={}));var fR;(function(t){t.IDENTIFY="$identify",t.GROUP_IDENTIFY="$groupidentify",t.REVENUE="revenue_amount"})(fR=Or.SpecialEventType||(Or.SpecialEventType={}))});var ES=A(Ho=>{Object.defineProperty(Ho,"__esModule",{value:!0});Ho.LogLevel=void 0;var hR;(function(t){t[t.None=0]="None",t[t.Error=1]="Error",t[t.Warn=2]="Warn",t[t.Verbose=3]="Verbose",t[t.Debug=4]="Debug"})(hR=Ho.LogLevel||(Ho.LogLevel={}))});var CS=A(Jo=>{Object.defineProperty(Jo,"__esModule",{value:!0});Jo.PluginType=void 0;var mR;(function(t){t.BEFORE="before",t.ENRICHMENT="enrichment",t.DESTINATION="destination"})(mR=Jo.PluginType||(Jo.PluginType={}))});var SS=A(Yo=>{Object.defineProperty(Yo,"__esModule",{value:!0});Yo.ServerZone=void 0;var gR;(function(t){t.US="US",t.EU="EU",t.STAGING="STAGING"})(gR=Yo.ServerZone||(Yo.ServerZone={}))});var vS=A(Xo=>{Object.defineProperty(Xo,"__esModule",{value:!0});Xo.Status=void 0;var yR;(function(t){t.Unknown="unknown",t.Skipped="skipped",t.Success="success",t.RateLimit="rate_limit",t.PayloadTooLarge="payload_too_large",t.Invalid="invalid",t.Failed="failed",t.Timeout="Timeout",t.SystemError="SystemError"})(yR=Xo.Status||(Xo.Status={}))});var wS=A(Qo=>{Object.defineProperty(Qo,"__esModule",{value:!0});Qo.TransportType=void 0;var bR;(function(t){t.XHR="xhr",t.SendBeacon="beacon",t.Fetch="fetch"})(bR=Qo.TransportType||(Qo.TransportType={}))});var lr=A(Dt=>{Object.defineProperty(Dt,"__esModule",{value:!0});Dt.TransportType=Dt.Status=Dt.ServerZone=Dt.PluginType=Dt.LogLevel=Dt.RevenueProperty=Dt.IdentifyOperation=Dt.SpecialEventType=void 0;var cf=xS();Object.defineProperty(Dt,"SpecialEventType",{enumerable:!0,get:function(){return cf.SpecialEventType}});Object.defineProperty(Dt,"IdentifyOperation",{enumerable:!0,get:function(){return cf.IdentifyOperation}});Object.defineProperty(Dt,"RevenueProperty",{enumerable:!0,get:function(){return cf.RevenueProperty}});var DR=ES();Object.defineProperty(Dt,"LogLevel",{enumerable:!0,get:function(){return DR.LogLevel}});var xR=CS();Object.defineProperty(Dt,"PluginType",{enumerable:!0,get:function(){return xR.PluginType}});var ER=SS();Object.defineProperty(Dt,"ServerZone",{enumerable:!0,get:function(){return ER.ServerZone}});var CR=vS();Object.defineProperty(Dt,"Status",{enumerable:!0,get:function(){return CR.Status}});var SR=wS();Object.defineProperty(Dt,"TransportType",{enumerable:!0,get:function(){return SR.TransportType}})});var Zo=A(St=>{Object.defineProperty(St,"__esModule",{value:!0});St.EU_AMPLITUDE_BATCH_SERVER_URL=St.AMPLITUDE_BATCH_SERVER_URL=St.EU_AMPLITUDE_SERVER_URL=St.AMPLITUDE_SERVER_URL=St.STORAGE_PREFIX=St.AMPLITUDE_PREFIX=St.UNSET_VALUE=void 0;St.UNSET_VALUE="-";St.AMPLITUDE_PREFIX="AMP";St.STORAGE_PREFIX="".concat(St.AMPLITUDE_PREFIX,"_unsent");St.AMPLITUDE_SERVER_URL="https://api2.amplitude.com/2/httpapi";St.EU_AMPLITUDE_SERVER_URL="https://api.eu.amplitude.com/2/httpapi";St.AMPLITUDE_BATCH_SERVER_URL="https://api2.amplitude.com/batch";St.EU_AMPLITUDE_BATCH_SERVER_URL="https://api.eu.amplitude.com/batch"});var pf=A(Bi=>{Object.defineProperty(Bi,"__esModule",{value:!0});Bi.isValidProperties=Bi.isValidObject=void 0;var vR=(ci(),Wt(ui)),wR=1e3,TR=function(t){if(Object.keys(t).length>wR)return!1;for(var r in t){var e=t[r];if(!(0,Bi.isValidProperties)(r,e))return!1}return!0};Bi.isValidObject=TR;var AR=function(t,r){var e,i;if(typeof t!="string")return!1;if(Array.isArray(r)){var n=!0;try{for(var s=vR.__values(r),o=s.next();!o.done;o=s.next()){var a=o.value;if(Array.isArray(a))return!1;if(typeof a=="object")n=n&&(0,Bi.isValidObject)(a);else if(!["number","string"].includes(typeof a))return!1;if(!n)return!1}}catch(l){e={error:l}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(e)throw e.error}}}else{if(r==null)return!1;if(typeof r=="object")return(0,Bi.isValidObject)(r);if(!["number","string","boolean"].includes(typeof r))return!1}return!0};Bi.isValidProperties=AR});var df=A(su=>{Object.defineProperty(su,"__esModule",{value:!0});su.Identify=void 0;var PR=(ci(),Wt(ui)),Zt=lr(),TS=Zo(),IR=pf(),_R=function(){function t(){this._propertySet=new Set,this._properties={}}return t.prototype.getUserProperties=function(){return PR.__assign({},this._properties)},t.prototype.set=function(r,e){return this._safeSet(Zt.IdentifyOperation.SET,r,e),this},t.prototype.setOnce=function(r,e){return this._safeSet(Zt.IdentifyOperation.SET_ONCE,r,e),this},t.prototype.append=function(r,e){return this._safeSet(Zt.IdentifyOperation.APPEND,r,e),this},t.prototype.prepend=function(r,e){return this._safeSet(Zt.IdentifyOperation.PREPEND,r,e),this},t.prototype.postInsert=function(r,e){return this._safeSet(Zt.IdentifyOperation.POSTINSERT,r,e),this},t.prototype.preInsert=function(r,e){return this._safeSet(Zt.IdentifyOperation.PREINSERT,r,e),this},t.prototype.remove=function(r,e){return this._safeSet(Zt.IdentifyOperation.REMOVE,r,e),this},t.prototype.add=function(r,e){return this._safeSet(Zt.IdentifyOperation.ADD,r,e),this},t.prototype.unset=function(r){return this._safeSet(Zt.IdentifyOperation.UNSET,r,TS.UNSET_VALUE),this},t.prototype.clearAll=function(){return this._properties={},this._properties[Zt.IdentifyOperation.CLEAR_ALL]=TS.UNSET_VALUE,this},t.prototype._safeSet=function(r,e,i){if(this._validate(r,e,i)){var n=this._properties[r];return n===void 0&&(n={},this._properties[r]=n),n[e]=i,this._propertySet.add(e),!0}return!1},t.prototype._validate=function(r,e,i){return this._properties[Zt.IdentifyOperation.CLEAR_ALL]!==void 0||this._propertySet.has(e)?!1:r===Zt.IdentifyOperation.ADD?typeof i=="number":r!==Zt.IdentifyOperation.UNSET&&r!==Zt.IdentifyOperation.REMOVE?(0,IR.isValidProperties)(e,i):!0},t}();su.Identify=_R});var ff=A(Dr=>{Object.defineProperty(Dr,"__esModule",{value:!0});Dr.createRevenueEvent=Dr.createGroupEvent=Dr.createGroupIdentifyEvent=Dr.createIdentifyEvent=Dr.createTrackEvent=void 0;var Rr=(ci(),Wt(ui)),ou=lr(),NR=df(),FR=function(t,r,e){var i=typeof t=="string"?{event_type:t}:t;return Rr.__assign(Rr.__assign(Rr.__assign({},i),e),r&&{event_properties:r})};Dr.createTrackEvent=FR;var kR=function(t,r){var e=Rr.__assign(Rr.__assign({},r),{event_type:ou.SpecialEventType.IDENTIFY,user_properties:t.getUserProperties()});return e};Dr.createIdentifyEvent=kR;var OR=function(t,r,e,i){var n,s=Rr.__assign(Rr.__assign({},i),{event_type:ou.SpecialEventType.GROUP_IDENTIFY,group_properties:e.getUserProperties(),groups:(n={},n[t]=r,n)});return s};Dr.createGroupIdentifyEvent=OR;var RR=function(t,r,e){var i,n=new NR.Identify;n.set(t,r);var s=Rr.__assign(Rr.__assign({},e),{event_type:ou.SpecialEventType.IDENTIFY,user_properties:n.getUserProperties(),groups:(i={},i[t]=r,i)});return s};Dr.createGroupEvent=RR;var LR=function(t,r){return Rr.__assign(Rr.__assign({},r),{event_type:ou.SpecialEventType.REVENUE,event_properties:t.getEventProperties()})};Dr.createRevenueEvent=LR});var lu=A(au=>{Object.defineProperty(au,"__esModule",{value:!0});au.buildResult=void 0;var MR=lr(),BR=function(t,r,e){return r===void 0&&(r=0),e===void 0&&(e=MR.Status.Unknown),{event:t,code:r,message:e}};au.buildResult=BR});var AS=A(cu=>{Object.defineProperty(cu,"__esModule",{value:!0});cu.Timeline=void 0;var It=(ci(),Wt(ui)),uu=lr(),$R=lu(),UR=function(){function t(r){this.client=r,this.queue=[],this.applying=!1,this.plugins=[]}return t.prototype.register=function(r,e){return It.__awaiter(this,void 0,void 0,function(){return It.__generator(this,function(i){switch(i.label){case 0:return[4,r.setup(e,this.client)];case 1:return i.sent(),this.plugins.push(r),[2]}})})},t.prototype.deregister=function(r){var e;return It.__awaiter(this,void 0,void 0,function(){var i,n;return It.__generator(this,function(s){switch(s.label){case 0:return i=this.plugins.findIndex(function(o){return o.name===r}),n=this.plugins[i],this.plugins.splice(i,1),[4,(e=n.teardown)===null||e===void 0?void 0:e.call(n)];case 1:return s.sent(),[2]}})})},t.prototype.reset=function(r){this.applying=!1;var e=this.plugins;e.map(function(i){var n;return(n=i.teardown)===null||n===void 0?void 0:n.call(i)}),this.plugins=[],this.client=r},t.prototype.push=function(r){var e=this;return new Promise(function(i){e.queue.push([r,i]),e.scheduleApply(0)})},t.prototype.scheduleApply=function(r){var e=this;this.applying||(this.applying=!0,setTimeout(function(){e.apply(e.queue.shift()).then(function(){e.applying=!1,e.queue.length>0&&e.scheduleApply(0)})},r))},t.prototype.apply=function(r){return It.__awaiter(this,void 0,void 0,function(){var e,i,n,s,o,a,l,h,f,u,c,p,d,h,f,g,m,y,b,C,D,x;return It.__generator(this,function(E){switch(E.label){case 0:if(!r)return[2];e=It.__read(r,1),i=e[0],n=It.__read(r,2),s=n[1],o=this.plugins.filter(function(w){return w.type===uu.PluginType.BEFORE}),E.label=1;case 1:E.trys.push([1,6,7,8]),a=It.__values(o),l=a.next(),E.label=2;case 2:return l.done?[3,5]:(h=l.value,[4,h.execute(It.__assign({},i))]);case 3:if(f=E.sent(),f===null)return s({event:i,code:0,message:""}),[2];i=f,E.label=4;case 4:return l=a.next(),[3,2];case 5:return[3,8];case 6:return u=E.sent(),b={error:u},[3,8];case 7:try{l&&!l.done&&(C=a.return)&&C.call(a)}finally{if(b)throw b.error}return[7];case 8:c=this.plugins.filter(function(w){return w.type===uu.PluginType.ENRICHMENT}),E.label=9;case 9:E.trys.push([9,14,15,16]),p=It.__values(c),d=p.next(),E.label=10;case 10:return d.done?[3,13]:(h=d.value,[4,h.execute(It.__assign({},i))]);case 11:if(f=E.sent(),f===null)return s({event:i,code:0,message:""}),[2];i=f,E.label=12;case 12:return d=p.next(),[3,10];case 13:return[3,16];case 14:return g=E.sent(),D={error:g},[3,16];case 15:try{d&&!d.done&&(x=p.return)&&x.call(p)}finally{if(D)throw D.error}return[7];case 16:return m=this.plugins.filter(function(w){return w.type===uu.PluginType.DESTINATION}),y=m.map(function(w){var R=It.__assign({},i);return w.execute(R).catch(function(M){return(0,$R.buildResult)(R,0,String(M))})}),Promise.all(y).then(function(w){var R=It.__read(w,1),M=R[0];s(M)}),[2]}})})},t.prototype.flush=function(){return It.__awaiter(this,void 0,void 0,function(){var r,e,i,n=this;return It.__generator(this,function(s){switch(s.label){case 0:return r=this.queue,this.queue=[],[4,Promise.all(r.map(function(o){return n.apply(o)}))];case 1:return s.sent(),e=this.plugins.filter(function(o){return o.type===uu.PluginType.DESTINATION}),i=e.map(function(o){return o.flush&&o.flush()}),[4,Promise.all(i)];case 2:return s.sent(),[2]}})})},t}();cu.Timeline=UR});var hf=A(_t=>{Object.defineProperty(_t,"__esModule",{value:!0});_t.CLIENT_NOT_INITIALIZED=_t.INVALID_API_KEY=_t.MISSING_API_KEY_MESSAGE=_t.OPT_OUT_MESSAGE=_t.MAX_RETRIES_EXCEEDED_MESSAGE=_t.UNEXPECTED_ERROR_MESSAGE=_t.SUCCESS_MESSAGE=void 0;_t.SUCCESS_MESSAGE="Event tracked successfully";_t.UNEXPECTED_ERROR_MESSAGE="Unexpected error occurred";_t.MAX_RETRIES_EXCEEDED_MESSAGE="Event rejected due to exceeded retry count";_t.OPT_OUT_MESSAGE="Event skipped due to optOut config";_t.MISSING_API_KEY_MESSAGE="Event rejected due to missing API key";_t.INVALID_API_KEY="Invalid API key";_t.CLIENT_NOT_INITIALIZED="Client not initialized"});var mf=A(pu=>{Object.defineProperty(pu,"__esModule",{value:!0});pu.returnWrapper=void 0;var jR=function(t){return{promise:t||Promise.resolve()}};pu.returnWrapper=jR});var IS=A(du=>{Object.defineProperty(du,"__esModule",{value:!0});du.AmplitudeCore=void 0;var $i=(ci(),Wt(ui)),ea=ff(),qR=AS(),gf=lu(),PS=hf(),pi=mf(),KR=function(){function t(r){r===void 0&&(r="$default"),this.initializing=!1,this.q=[],this.dispatchQ=[],this.logEvent=this.track.bind(this),this.timeline=new qR.Timeline(this),this.name=r}return t.prototype._init=function(r){return $i.__awaiter(this,void 0,void 0,function(){return $i.__generator(this,function(e){switch(e.label){case 0:return this.config=r,this.timeline.reset(this),[4,this.runQueuedFunctions("q")];case 1:return e.sent(),[2]}})})},t.prototype.runQueuedFunctions=function(r){return $i.__awaiter(this,void 0,void 0,function(){var e,i,n,s,o,a,l;return $i.__generator(this,function(u){switch(u.label){case 0:e=this[r],this[r]=[],u.label=1;case 1:u.trys.push([1,6,7,8]),i=$i.__values(e),n=i.next(),u.label=2;case 2:return n.done?[3,5]:(s=n.value,[4,s()]);case 3:u.sent(),u.label=4;case 4:return n=i.next(),[3,2];case 5:return[3,8];case 6:return o=u.sent(),a={error:o},[3,8];case 7:try{n&&!n.done&&(l=i.return)&&l.call(i)}finally{if(a)throw a.error}return[7];case 8:return[2]}})})},t.prototype.track=function(r,e,i){var n=(0,ea.createTrackEvent)(r,e,i);return(0,pi.returnWrapper)(this.dispatch(n))},t.prototype.identify=function(r,e){var i=(0,ea.createIdentifyEvent)(r,e);return(0,pi.returnWrapper)(this.dispatch(i))},t.prototype.groupIdentify=function(r,e,i,n){var s=(0,ea.createGroupIdentifyEvent)(r,e,i,n);return(0,pi.returnWrapper)(this.dispatch(s))},t.prototype.setGroup=function(r,e,i){var n=(0,ea.createGroupEvent)(r,e,i);return(0,pi.returnWrapper)(this.dispatch(n))},t.prototype.revenue=function(r,e){var i=(0,ea.createRevenueEvent)(r,e);return(0,pi.returnWrapper)(this.dispatch(i))},t.prototype.add=function(r){return this.config?(0,pi.returnWrapper)(this.timeline.register(r,this.config)):(this.q.push(this.add.bind(this,r)),(0,pi.returnWrapper)())},t.prototype.remove=function(r){return this.config?(0,pi.returnWrapper)(this.timeline.deregister(r)):(this.q.push(this.remove.bind(this,r)),(0,pi.returnWrapper)())},t.prototype.dispatchWithCallback=function(r,e){if(!this.config)return e((0,gf.buildResult)(r,0,PS.CLIENT_NOT_INITIALIZED));this.process(r).then(e)},t.prototype.dispatch=function(r){return $i.__awaiter(this,void 0,void 0,function(){var e=this;return $i.__generator(this,function(i){return this.config?[2,this.process(r)]:[2,new Promise(function(n){e.dispatchQ.push(e.dispatchWithCallback.bind(e,r,n))})]})})},t.prototype.process=function(r){return $i.__awaiter(this,void 0,void 0,function(){var n,e,i,n;return $i.__generator(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),this.config.optOut?[2,(0,gf.buildResult)(r,0,PS.OPT_OUT_MESSAGE)]:[4,this.timeline.push(r)];case 1:return n=s.sent(),n.code===200?this.config.loggerProvider.log(n.message):this.config.loggerProvider.error(n.message),[2,n];case 2:return e=s.sent(),this.config.loggerProvider.error(e),i=String(e),n=(0,gf.buildResult)(r,0,i),[2,n];case 3:return[2]}})})},t.prototype.setOptOut=function(r){if(!this.config){this.q.push(this.setOptOut.bind(this,!!r));return}this.config.optOut=!!r},t.prototype.flush=function(){return(0,pi.returnWrapper)(this.timeline.flush())},t}();du.AmplitudeCore=KR});var _S=A(fu=>{Object.defineProperty(fu,"__esModule",{value:!0});fu.Revenue=void 0;var VR=(ci(),Wt(ui)),ta=lr(),zR=pf(),WR=function(){function t(){this.productId="",this.quantity=1,this.price=0}return t.prototype.setProductId=function(r){return this.productId=r,this},t.prototype.setQuantity=function(r){return r>0&&(this.quantity=r),this},t.prototype.setPrice=function(r){return this.price=r,this},t.prototype.setRevenueType=function(r){return this.revenueType=r,this},t.prototype.setRevenue=function(r){return this.revenue=r,this},t.prototype.setEventProperties=function(r){return(0,zR.isValidObject)(r)&&(this.properties=r),this},t.prototype.getEventProperties=function(){var r=this.properties?VR.__assign({},this.properties):{};return r[ta.RevenueProperty.REVENUE_PRODUCT_ID]=this.productId,r[ta.RevenueProperty.REVENUE_QUANTITY]=this.quantity,r[ta.RevenueProperty.REVENUE_PRICE]=this.price,r[ta.RevenueProperty.REVENUE_TYPE]=this.revenueType,r[ta.RevenueProperty.REVENUE]=this.revenue,r},t}();fu.Revenue=WR});var NS=A(hu=>{Object.defineProperty(hu,"__esModule",{value:!0});hu.chunk=void 0;var GR=function(t,r){var e=Math.max(r,1);return t.reduce(function(i,n,s){var o=Math.floor(s/e);return i[o]||(i[o]=[]),i[o].push(n),i},[])};hu.chunk=GR});var yf=A(gu=>{Object.defineProperty(gu,"__esModule",{value:!0});gu.Logger=void 0;var Vn=lr(),mu="Amplitude Logger ",HR=function(){function t(){this.logLevel=Vn.LogLevel.None}return t.prototype.disable=function(){this.logLevel=Vn.LogLevel.None},t.prototype.enable=function(r){r===void 0&&(r=Vn.LogLevel.Warn),this.logLevel=r},t.prototype.log=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];this.logLevel<Vn.LogLevel.Verbose||console.log("".concat(mu,"[Log]: ").concat(r.join(" ")))},t.prototype.warn=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];this.logLevel<Vn.LogLevel.Warn||console.warn("".concat(mu,"[Warn]: ").concat(r.join(" ")))},t.prototype.error=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];this.logLevel<Vn.LogLevel.Error||console.error("".concat(mu,"[Error]: ").concat(r.join(" ")))},t.prototype.debug=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];this.logLevel<Vn.LogLevel.Debug||console.log("".concat(mu,"[Debug]: ").concat(r.join(" ")))},t}();gu.Logger=HR});var Df=A(Nt=>{Object.defineProperty(Nt,"__esModule",{value:!0});Nt.createServerConfig=Nt.getServerUrl=Nt.Config=Nt.getDefaultConfig=void 0;var bf=lr(),ra=Zo(),JR=yf(),YR=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:"$default_instance",logLevel:bf.LogLevel.Warn,loggerProvider:new JR.Logger,optOut:!1,serverUrl:ra.AMPLITUDE_SERVER_URL,serverZone:bf.ServerZone.US,useBatch:!1}};Nt.getDefaultConfig=YR;var XR=function(){function t(r){var e,i,n,s;this._optOut=!1;var o=(0,Nt.getDefaultConfig)();this.apiKey=r.apiKey,this.flushIntervalMillis=(e=r.flushIntervalMillis)!==null&&e!==void 0?e:o.flushIntervalMillis,this.flushMaxRetries=r.flushMaxRetries||o.flushMaxRetries,this.flushQueueSize=r.flushQueueSize||o.flushQueueSize,this.instanceName=r.instanceName||o.instanceName,this.loggerProvider=r.loggerProvider||o.loggerProvider,this.logLevel=(i=r.logLevel)!==null&&i!==void 0?i:o.logLevel,this.minIdLength=r.minIdLength,this.plan=r.plan,this.ingestionMetadata=r.ingestionMetadata,this.optOut=(n=r.optOut)!==null&&n!==void 0?n:o.optOut,this.serverUrl=r.serverUrl,this.serverZone=r.serverZone||o.serverZone,this.storageProvider=r.storageProvider,this.transportProvider=r.transportProvider,this.useBatch=(s=r.useBatch)!==null&&s!==void 0?s:o.useBatch,this.loggerProvider.enable(this.logLevel);var a=(0,Nt.createServerConfig)(r.serverUrl,r.serverZone,r.useBatch);this.serverZone=a.serverZone,this.serverUrl=a.serverUrl}return Object.defineProperty(t.prototype,"optOut",{get:function(){return this._optOut},set:function(r){this._optOut=r},enumerable:!1,configurable:!0}),t}();Nt.Config=XR;var QR=function(t,r){return t===bf.ServerZone.EU?r?ra.EU_AMPLITUDE_BATCH_SERVER_URL:ra.EU_AMPLITUDE_SERVER_URL:r?ra.AMPLITUDE_BATCH_SERVER_URL:ra.AMPLITUDE_SERVER_URL};Nt.getServerUrl=QR;var ZR=function(t,r,e){if(t===void 0&&(t=""),r===void 0&&(r=(0,Nt.getDefaultConfig)().serverZone),e===void 0&&(e=(0,Nt.getDefaultConfig)().useBatch),t)return{serverUrl:t,serverZone:void 0};var i=["US","EU"].includes(r)?r:(0,Nt.getDefaultConfig)().serverZone;return{serverZone:i,serverUrl:(0,Nt.getServerUrl)(i,e)}};Nt.createServerConfig=ZR});var FS=A(As=>{Object.defineProperty(As,"__esModule",{value:!0});As.Destination=As.getResponseBodyString=void 0;var tt=(ci(),Wt(ui)),ia=lr(),na=hf(),eL=Zo(),tL=NS(),rL=lu(),iL=Df();function nL(t){return t instanceof Error?t.message:String(t)}function sa(t){var r="";try{"body"in t&&(r=JSON.stringify(t.body))}catch{}return r}As.getResponseBodyString=sa;var sL=function(){function t(){this.name="amplitude",this.type=ia.PluginType.DESTINATION,this.retryTimeout=1e3,this.throttleTimeout=3e4,this.storageKey="",this.scheduled=null,this.queue=[]}return t.prototype.setup=function(r){var e;return tt.__awaiter(this,void 0,void 0,function(){var i,n=this;return tt.__generator(this,function(s){switch(s.label){case 0:return this.config=r,this.storageKey="".concat(eL.STORAGE_PREFIX,"_").concat(this.config.apiKey.substring(0,10)),[4,(e=this.config.storageProvider)===null||e===void 0?void 0:e.get(this.storageKey)];case 1:return i=s.sent(),this.saveEvents(),i&&i.length>0&&Promise.all(i.map(function(o){return n.execute(o)})).catch(),[2,Promise.resolve(void 0)]}})})},t.prototype.execute=function(r){var e=this;return new Promise(function(i){var n={event:r,attempts:0,callback:function(s){return i(s)},timeout:0};e.addToQueue(n)})},t.prototype.addToQueue=function(){for(var r=this,e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];var n=e.filter(function(s){return s.attempts<r.config.flushMaxRetries?(s.attempts+=1,!0):(r.fulfillRequest([s],500,na.MAX_RETRIES_EXCEEDED_MESSAGE),!1)});n.forEach(function(s){if(r.queue=r.queue.concat(s),s.timeout===0){r.schedule(r.config.flushIntervalMillis);return}setTimeout(function(){s.timeout=0,r.schedule(0)},s.timeout)}),this.saveEvents()},t.prototype.schedule=function(r){var e=this;this.scheduled||(this.scheduled=setTimeout(function(){e.flush(!0).then(function(){e.queue.length>0&&e.schedule(r)})},r))},t.prototype.flush=function(r){return r===void 0&&(r=!1),tt.__awaiter(this,void 0,void 0,function(){var e,i,n,s=this;return tt.__generator(this,function(o){switch(o.label){case 0:return e=[],i=[],this.queue.forEach(function(a){return a.timeout===0?e.push(a):i.push(a)}),this.queue=i,this.scheduled&&(clearTimeout(this.scheduled),this.scheduled=null),n=(0,tL.chunk)(e,this.config.flushQueueSize),[4,Promise.all(n.map(function(a){return s.send(a,r)}))];case 1:return o.sent(),[2]}})})},t.prototype.send=function(r,e){return e===void 0&&(e=!0),tt.__awaiter(this,void 0,void 0,function(){var i,n,s,o,a;return tt.__generator(this,function(l){switch(l.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(r,400,na.MISSING_API_KEY_MESSAGE)];i={api_key:this.config.apiKey,events:r.map(function(u){var c=u.event,p=c.extra,d=tt.__rest(c,["extra"]);return d}),options:{min_id_length:this.config.minIdLength}},l.label=1;case 1:return l.trys.push([1,3,,4]),n=(0,iL.createServerConfig)(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,[4,this.config.transportProvider.send(n,i)];case 2:return s=l.sent(),s===null?(this.fulfillRequest(r,0,na.UNEXPECTED_ERROR_MESSAGE),[2]):e?(this.handleResponse(s,r),[3,4]):("body"in s?this.fulfillRequest(r,s.statusCode,"".concat(s.status,": ").concat(sa(s))):this.fulfillRequest(r,s.statusCode,s.status),[2]);case 3:return o=l.sent(),this.config.loggerProvider.error(o),a=nL(o),this.fulfillRequest(r,0,a),[3,4];case 4:return[2]}})})},t.prototype.handleResponse=function(r,e){var i=r.status;switch(i){case ia.Status.Success:{this.handleSuccessResponse(r,e);break}case ia.Status.Invalid:{this.handleInvalidResponse(r,e);break}case ia.Status.PayloadTooLarge:{this.handlePayloadTooLargeResponse(r,e);break}case ia.Status.RateLimit:{this.handleRateLimitResponse(r,e);break}default:{this.config.loggerProvider.warn(`{code: 0, error: "Status '`.concat(i,"' provided for ").concat(e.length,' events"}')),this.handleOtherResponse(e);break}}},t.prototype.handleSuccessResponse=function(r,e){this.fulfillRequest(e,r.statusCode,na.SUCCESS_MESSAGE)},t.prototype.handleInvalidResponse=function(r,e){var i=this;if(r.body.missingField||r.body.error.startsWith(na.INVALID_API_KEY)){this.fulfillRequest(e,r.statusCode,r.body.error);return}var n=tt.__spreadArray(tt.__spreadArray(tt.__spreadArray(tt.__spreadArray([],tt.__read(Object.values(r.body.eventsWithInvalidFields)),!1),tt.__read(Object.values(r.body.eventsWithMissingFields)),!1),tt.__read(Object.values(r.body.eventsWithInvalidIdLengths)),!1),tt.__read(r.body.silencedEvents),!1).flat(),s=new Set(n),o=e.filter(function(a,l){if(s.has(l)){i.fulfillRequest([a],r.statusCode,r.body.error);return}return!0});o.length>0&&this.config.loggerProvider.warn(sa(r)),this.addToQueue.apply(this,tt.__spreadArray([],tt.__read(o),!1))},t.prototype.handlePayloadTooLargeResponse=function(r,e){if(e.length===1){this.fulfillRequest(e,r.statusCode,r.body.error);return}this.config.loggerProvider.warn(sa(r)),this.config.flushQueueSize/=2,this.addToQueue.apply(this,tt.__spreadArray([],tt.__read(e),!1))},t.prototype.handleRateLimitResponse=function(r,e){var i=this,n=Object.keys(r.body.exceededDailyQuotaUsers),s=Object.keys(r.body.exceededDailyQuotaDevices),o=r.body.throttledEvents,a=new Set(n),l=new Set(s),u=new Set(o),c=e.filter(function(p,d){if(p.event.user_id&&a.has(p.event.user_id)||p.event.device_id&&l.has(p.event.device_id)){i.fulfillRequest([p],r.statusCode,r.body.error);return}return u.has(d)&&(p.timeout=i.throttleTimeout),!0});c.length>0&&this.config.loggerProvider.warn(sa(r)),this.addToQueue.apply(this,tt.__spreadArray([],tt.__read(c),!1))},t.prototype.handleOtherResponse=function(r){var e=this;this.addToQueue.apply(this,tt.__spreadArray([],tt.__read(r.map(function(i){return i.timeout=i.attempts*e.retryTimeout,i})),!1))},t.prototype.fulfillRequest=function(r,e,i){this.saveEvents(),r.forEach(function(n){return n.callback((0,rL.buildResult)(n.event,e,i))})},t.prototype.saveEvents=function(){if(this.config.storageProvider){var r=Array.from(this.queue.map(function(e){return e.event}));this.config.storageProvider.set(this.storageKey,r)}},t}();As.Destination=sL});var kS=A(er=>{Object.defineProperty(er,"__esModule",{value:!0});er.debugWrapper=er.getClientStates=er.getValueByStringPath=er.getClientLogConfig=er.getStacktrace=void 0;var xf=(ci(),Wt(ui)),oL=lr(),aL=function(t){t===void 0&&(t=0);var r=new Error().stack||"";return r.split(`
|
|
112
|
-
`).slice(2+t).map(function(e){return e.trim()})};er.getStacktrace=aL;var lL=function(t){return function(){var r=xf.__assign({},t.config),e=r.loggerProvider,i=r.logLevel;return{logger:e,logLevel:i}}};er.getClientLogConfig=lL;var uL=function(t,r){var e,i;r=r.replace(/\[(\w+)\]/g,".$1"),r=r.replace(/^\./,"");try{for(var n=xf.__values(r.split(".")),s=n.next();!s.done;s=n.next()){var o=s.value;if(o in t)t=t[o];else return}}catch(a){e={error:a}}finally{try{s&&!s.done&&(i=n.return)&&i.call(n)}finally{if(e)throw e.error}}return t};er.getValueByStringPath=uL;var cL=function(t,r){return function(){var e,i,n={};try{for(var s=xf.__values(r),o=s.next();!o.done;o=s.next()){var a=o.value;n[a]=(0,er.getValueByStringPath)(t,a)}}catch(l){e={error:l}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(e)throw e.error}}return n}};er.getClientStates=cL;var pL=function(t,r,e,i,n){return n===void 0&&(n=null),function(){for(var s=[],o=0;o<arguments.length;o++)s[o]=arguments[o];var a=e(),l=a.logger,u=a.logLevel;if(u&&u<oL.LogLevel.Debug||!u||!l)return t.apply(n,s);var c={type:"invoke public method",name:r,args:s,stacktrace:(0,er.getStacktrace)(1),time:{start:new Date().toISOString()},states:{}};i&&c.states&&(c.states.before=i());var p=t.apply(n,s);return p&&p.promise?p.promise.then(function(){i&&c.states&&(c.states.after=i()),c.time&&(c.time.end=new Date().toISOString()),l.debug(JSON.stringify(c,null,2))}):(i&&c.states&&(c.states.after=i()),c.time&&(c.time.end=new Date().toISOString()),l.debug(JSON.stringify(c,null,2))),p}};er.debugWrapper=pL});var OS=A(oa=>{Object.defineProperty(oa,"__esModule",{value:!0});oa.UUID=void 0;var dL=function(t){return t?(t^Math.random()*16>>t/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,oa.UUID)};oa.UUID=dL});var RS=A(yu=>{Object.defineProperty(yu,"__esModule",{value:!0});yu.MemoryStorage=void 0;var xr=(ci(),Wt(ui)),fL=function(){function t(){this.memoryStorage=new Map}return t.prototype.isEnabled=function(){return xr.__awaiter(this,void 0,void 0,function(){return xr.__generator(this,function(r){return[2,!0]})})},t.prototype.get=function(r){return xr.__awaiter(this,void 0,void 0,function(){return xr.__generator(this,function(e){return[2,this.memoryStorage.get(r)]})})},t.prototype.getRaw=function(r){return xr.__awaiter(this,void 0,void 0,function(){var e;return xr.__generator(this,function(i){switch(i.label){case 0:return[4,this.get(r)];case 1:return e=i.sent(),[2,e?JSON.stringify(e):void 0]}})})},t.prototype.set=function(r,e){return xr.__awaiter(this,void 0,void 0,function(){return xr.__generator(this,function(i){return this.memoryStorage.set(r,e),[2]})})},t.prototype.remove=function(r){return xr.__awaiter(this,void 0,void 0,function(){return xr.__generator(this,function(e){return this.memoryStorage.delete(r),[2]})})},t.prototype.reset=function(){return xr.__awaiter(this,void 0,void 0,function(){return xr.__generator(this,function(r){return this.memoryStorage.clear(),[2]})})},t}();yu.MemoryStorage=fL});var LS=A(bu=>{Object.defineProperty(bu,"__esModule",{value:!0});bu.BaseTransport=void 0;var Er=lr(),hL=function(){function t(){}return t.prototype.send=function(r,e){return Promise.resolve(null)},t.prototype.buildResponse=function(r){var e,i,n,s,o,a,l,u,c,p,d,h,f,g,m,y,b,C,D,x,E,w;if(typeof r!="object")return null;var R=r.code||0,M=this.buildStatus(R);switch(M){case Er.Status.Success:return{status:M,statusCode:R,body:{eventsIngested:(e=r.events_ingested)!==null&&e!==void 0?e:0,payloadSizeBytes:(i=r.payload_size_bytes)!==null&&i!==void 0?i:0,serverUploadTime:(n=r.server_upload_time)!==null&&n!==void 0?n:0}};case Er.Status.Invalid:return{status:M,statusCode:R,body:{error:(s=r.error)!==null&&s!==void 0?s:"",missingField:(o=r.missing_field)!==null&&o!==void 0?o:"",eventsWithInvalidFields:(a=r.events_with_invalid_fields)!==null&&a!==void 0?a:{},eventsWithMissingFields:(l=r.events_with_missing_fields)!==null&&l!==void 0?l:{},eventsWithInvalidIdLengths:(u=r.events_with_invalid_id_lengths)!==null&&u!==void 0?u:{},epsThreshold:(c=r.eps_threshold)!==null&&c!==void 0?c:0,exceededDailyQuotaDevices:(p=r.exceeded_daily_quota_devices)!==null&&p!==void 0?p:{},silencedDevices:(d=r.silenced_devices)!==null&&d!==void 0?d:[],silencedEvents:(h=r.silenced_events)!==null&&h!==void 0?h:[],throttledDevices:(f=r.throttled_devices)!==null&&f!==void 0?f:{},throttledEvents:(g=r.throttled_events)!==null&&g!==void 0?g:[]}};case Er.Status.PayloadTooLarge:return{status:M,statusCode:R,body:{error:(m=r.error)!==null&&m!==void 0?m:""}};case Er.Status.RateLimit:return{status:M,statusCode:R,body:{error:(y=r.error)!==null&&y!==void 0?y:"",epsThreshold:(b=r.eps_threshold)!==null&&b!==void 0?b:0,throttledDevices:(C=r.throttled_devices)!==null&&C!==void 0?C:{},throttledUsers:(D=r.throttled_users)!==null&&D!==void 0?D:{},exceededDailyQuotaDevices:(x=r.exceeded_daily_quota_devices)!==null&&x!==void 0?x:{},exceededDailyQuotaUsers:(E=r.exceeded_daily_quota_users)!==null&&E!==void 0?E:{},throttledEvents:(w=r.throttled_events)!==null&&w!==void 0?w:[]}};case Er.Status.Timeout:default:return{status:M,statusCode:R}}},t.prototype.buildStatus=function(r){return r>=200&&r<300?Er.Status.Success:r===429?Er.Status.RateLimit:r===413?Er.Status.PayloadTooLarge:r===408?Er.Status.Timeout:r>=400&&r<500?Er.Status.Invalid:r>=500?Er.Status.Failed:Er.Status.Unknown},t}();bu.BaseTransport=hL});var Ps=A(Ee=>{Object.defineProperty(Ee,"__esModule",{value:!0});Ee.createIdentifyEvent=Ee.BaseTransport=Ee.MemoryStorage=Ee.UUID=Ee.getClientStates=Ee.getClientLogConfig=Ee.debugWrapper=Ee.returnWrapper=Ee.STORAGE_PREFIX=Ee.AMPLITUDE_PREFIX=Ee.Logger=Ee.Config=Ee.Destination=Ee.Revenue=Ee.Identify=Ee.AmplitudeCore=void 0;var mL=IS();Object.defineProperty(Ee,"AmplitudeCore",{enumerable:!0,get:function(){return mL.AmplitudeCore}});var gL=df();Object.defineProperty(Ee,"Identify",{enumerable:!0,get:function(){return gL.Identify}});var yL=_S();Object.defineProperty(Ee,"Revenue",{enumerable:!0,get:function(){return yL.Revenue}});var bL=FS();Object.defineProperty(Ee,"Destination",{enumerable:!0,get:function(){return bL.Destination}});var DL=Df();Object.defineProperty(Ee,"Config",{enumerable:!0,get:function(){return DL.Config}});var xL=yf();Object.defineProperty(Ee,"Logger",{enumerable:!0,get:function(){return xL.Logger}});var MS=Zo();Object.defineProperty(Ee,"AMPLITUDE_PREFIX",{enumerable:!0,get:function(){return MS.AMPLITUDE_PREFIX}});Object.defineProperty(Ee,"STORAGE_PREFIX",{enumerable:!0,get:function(){return MS.STORAGE_PREFIX}});var EL=mf();Object.defineProperty(Ee,"returnWrapper",{enumerable:!0,get:function(){return EL.returnWrapper}});var Ef=kS();Object.defineProperty(Ee,"debugWrapper",{enumerable:!0,get:function(){return Ef.debugWrapper}});Object.defineProperty(Ee,"getClientLogConfig",{enumerable:!0,get:function(){return Ef.getClientLogConfig}});Object.defineProperty(Ee,"getClientStates",{enumerable:!0,get:function(){return Ef.getClientStates}});var CL=OS();Object.defineProperty(Ee,"UUID",{enumerable:!0,get:function(){return CL.UUID}});var SL=RS();Object.defineProperty(Ee,"MemoryStorage",{enumerable:!0,get:function(){return SL.MemoryStorage}});var vL=LS();Object.defineProperty(Ee,"BaseTransport",{enumerable:!0,get:function(){return vL.BaseTransport}});var wL=ff();Object.defineProperty(Ee,"createIdentifyEvent",{enumerable:!0,get:function(){return wL.createIdentifyEvent}})});var BS=A(Du=>{Object.defineProperty(Du,"__esModule",{value:!0});Du.VERSION=void 0;Du.VERSION="1.3.5"});var $S=A(xu=>{Object.defineProperty(xu,"__esModule",{value:!0});xu.Context=void 0;var Cf=(Go(),Wt(Wo)),TL=lr(),AL=Ps(),PL=BS(),IL=function(){function t(){this.name="context",this.type=TL.PluginType.BEFORE,this.eventId=0,this.library="amplitude-node-ts/".concat(PL.VERSION)}return t.prototype.setup=function(r){return this.config=r,Promise.resolve(void 0)},t.prototype.execute=function(r){var e=this;return new Promise(function(i){var n=new Date().getTime(),s=Cf.__assign(Cf.__assign(Cf.__assign({time:n,insert_id:(0,AL.UUID)(),plan:e.config.plan},e.config.ingestionMetadata&&{ingestion_metadata:{source_name:e.config.ingestionMetadata.sourceName,source_version:e.config.ingestionMetadata.sourceVersion}}),r),{event_id:e.eventId++,library:e.library});return i(s)})},t}();xu.Context=IL});var US=A(Eu=>{Object.defineProperty(Eu,"__esModule",{value:!0});Eu.Http=void 0;var _L=(Go(),Wt(Wo)),NL=Ps(),FL=require("http"),kL=require("https"),OL=function(t){_L.__extends(r,t);function r(){return t!==null&&t.apply(this,arguments)||this}return r.prototype.send=function(e,i){var n=this,s;if(e.startsWith("http://"))s=FL;else if(e.startsWith("https://"))s=kL;else throw new Error("Invalid server url");var o=new URL(e),a=JSON.stringify(i),l={headers:{"Content-Type":"application/json","Content-Length":Buffer.byteLength(a)},hostname:o.hostname,method:"POST",path:o.pathname,port:o.port,protocol:o.protocol};return new Promise(function(u){var c=s.request(l,function(p){p.setEncoding("utf8");var d="";p.on("data",function(h){d+=h}),p.on("end",function(){if(p.complete&&d.length>0)try{var h=JSON.parse(d),f=n.buildResponse(h);u(f);return}catch{u(null)}})});c.on("error",function(){return u(null)}),c.end(a)})},r}(NL.BaseTransport);Eu.Http=OL});var qS=A(Is=>{Object.defineProperty(Is,"__esModule",{value:!0});Is.useNodeConfig=Is.NodeConfig=void 0;var Sf=(Go(),Wt(Wo)),RL=Ps(),LL=US(),jS=function(t){Sf.__extends(r,t);function r(e,i){return t.call(this,Sf.__assign(Sf.__assign({transportProvider:new LL.Http},i),{apiKey:e}))||this}return r}(RL.Config);Is.NodeConfig=jS;var ML=function(t,r){return new jS(t,r)};Is.useNodeConfig=ML});var vf=A(mn=>{Object.defineProperty(mn,"__esModule",{value:!0});mn.createInstance=mn.AmplitudeNode=void 0;var _s=(Go(),Wt(Wo)),ye=Ps(),BL=$S(),$L=qS(),KS=function(t){_s.__extends(r,t);function r(){return t!==null&&t.apply(this,arguments)||this}return r.prototype.init=function(e,i){return e===void 0&&(e=""),(0,ye.returnWrapper)(this._init(_s.__assign(_s.__assign({},i),{apiKey:e})))},r.prototype._init=function(e){return _s.__awaiter(this,void 0,void 0,function(){var i;return _s.__generator(this,function(n){switch(n.label){case 0:return this.initializing?[2]:(this.initializing=!0,i=(0,$L.useNodeConfig)(e.apiKey,_s.__assign({},e)),[4,t.prototype._init.call(this,i)]);case 1:return n.sent(),[4,this.add(new ye.Destination).promise];case 2:return n.sent(),[4,this.add(new BL.Context).promise];case 3:return n.sent(),this.initializing=!1,[4,this.runQueuedFunctions("dispatchQ")];case 4:return n.sent(),[2]}})})},r}(ye.AmplitudeCore);mn.AmplitudeNode=KS;var UL=function(){var t=new KS;return{init:(0,ye.debugWrapper)(t.init.bind(t),"init",(0,ye.getClientLogConfig)(t),(0,ye.getClientStates)(t,["config"])),add:(0,ye.debugWrapper)(t.add.bind(t),"add",(0,ye.getClientLogConfig)(t),(0,ye.getClientStates)(t,["config.apiKey","timeline.plugins"])),remove:(0,ye.debugWrapper)(t.remove.bind(t),"remove",(0,ye.getClientLogConfig)(t),(0,ye.getClientStates)(t,["config.apiKey","timeline.plugins"])),track:(0,ye.debugWrapper)(t.track.bind(t),"track",(0,ye.getClientLogConfig)(t),(0,ye.getClientStates)(t,["config.apiKey","timeline.queue.length"])),logEvent:(0,ye.debugWrapper)(t.logEvent.bind(t),"logEvent",(0,ye.getClientLogConfig)(t),(0,ye.getClientStates)(t,["config.apiKey","timeline.queue.length"])),identify:(0,ye.debugWrapper)(t.identify.bind(t),"identify",(0,ye.getClientLogConfig)(t),(0,ye.getClientStates)(t,["config.apiKey","timeline.queue.length"])),groupIdentify:(0,ye.debugWrapper)(t.groupIdentify.bind(t),"groupIdentify",(0,ye.getClientLogConfig)(t),(0,ye.getClientStates)(t,["config.apiKey","timeline.queue.length"])),setGroup:(0,ye.debugWrapper)(t.setGroup.bind(t),"setGroup",(0,ye.getClientLogConfig)(t),(0,ye.getClientStates)(t,["config.apiKey","timeline.queue.length"])),revenue:(0,ye.debugWrapper)(t.revenue.bind(t),"revenue",(0,ye.getClientLogConfig)(t),(0,ye.getClientStates)(t,["config.apiKey","timeline.queue.length"])),flush:(0,ye.debugWrapper)(t.flush.bind(t),"flush",(0,ye.getClientLogConfig)(t),(0,ye.getClientStates)(t,["config.apiKey","timeline.queue.length"])),setOptOut:(0,ye.debugWrapper)(t.setOptOut.bind(t),"setOptOut",(0,ye.getClientLogConfig)(t),(0,ye.getClientStates)(t,["config"]))}};mn.createInstance=UL;mn.default=(0,mn.createInstance)()});var Cu=A(ve=>{Object.defineProperty(ve,"__esModule",{value:!0});ve.Types=ve.Identify=ve.Revenue=ve.flush=ve.track=ve.setOptOut=ve.setGroup=ve.revenue=ve.remove=ve.logEvent=ve.init=ve.identify=ve.groupIdentify=ve.add=ve.createInstance=void 0;var Lr=vf(),jL=vf();Object.defineProperty(ve,"createInstance",{enumerable:!0,get:function(){return jL.createInstance}});ve.add=Lr.default.add,ve.groupIdentify=Lr.default.groupIdentify,ve.identify=Lr.default.identify,ve.init=Lr.default.init,ve.logEvent=Lr.default.logEvent,ve.remove=Lr.default.remove,ve.revenue=Lr.default.revenue,ve.setGroup=Lr.default.setGroup,ve.setOptOut=Lr.default.setOptOut,ve.track=Lr.default.track,ve.flush=Lr.default.flush;var VS=Ps();Object.defineProperty(ve,"Revenue",{enumerable:!0,get:function(){return VS.Revenue}});Object.defineProperty(ve,"Identify",{enumerable:!0,get:function(){return VS.Identify}});ve.Types=lr()});var GS=A(wf=>{var WS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");wf.encode=function(t){if(0<=t&&t<WS.length)return WS[t];throw new TypeError("Must be between 0 and 63: "+t)};wf.decode=function(t){var r=65,e=90,i=97,n=122,s=48,o=57,a=43,l=47,u=26,c=52;return r<=t&&t<=e?t-r:i<=t&&t<=n?t-i+u:s<=t&&t<=o?t-s+c:t==a?62:t==l?63:-1}});var Pf=A(Af=>{var HS=GS(),Tf=5,JS=1<<Tf,YS=JS-1,XS=JS;function KL(t){return t<0?(-t<<1)+1:(t<<1)+0}function VL(t){var r=(t&1)===1,e=t>>1;return r?-e:e}Af.encode=function(r){var e="",i,n=KL(r);do i=n&YS,n>>>=Tf,n>0&&(i|=XS),e+=HS.encode(i);while(n>0);return e};Af.decode=function(r,e,i){var n=r.length,s=0,o=0,a,l;do{if(e>=n)throw new Error("Expected more digits in base 64 VLQ value.");if(l=HS.decode(r.charCodeAt(e++)),l===-1)throw new Error("Invalid base64 digit: "+r.charAt(e-1));a=!!(l&XS),l&=YS,s=s+(l<<o),o+=Tf}while(a);i.value=VL(s),i.rest=e}});var Fs=A(xt=>{function zL(t,r,e){if(r in t)return t[r];if(arguments.length===3)return e;throw new Error('"'+r+'" is a required argument.')}xt.getArg=zL;var QS=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,WL=/^data:.+\,.+$/;function aa(t){var r=t.match(QS);return r?{scheme:r[1],auth:r[2],host:r[3],port:r[4],path:r[5]}:null}xt.urlParse=aa;function Ns(t){var r="";return t.scheme&&(r+=t.scheme+":"),r+="//",t.auth&&(r+=t.auth+"@"),t.host&&(r+=t.host),t.port&&(r+=":"+t.port),t.path&&(r+=t.path),r}xt.urlGenerate=Ns;var GL=32;function HL(t){var r=[];return function(e){for(var i=0;i<r.length;i++)if(r[i].input===e){var n=r[0];return r[0]=r[i],r[i]=n,r[0].result}var s=t(e);return r.unshift({input:e,result:s}),r.length>GL&&r.pop(),s}}var If=HL(function(r){var e=r,i=aa(r);if(i){if(!i.path)return r;e=i.path}for(var n=xt.isAbsolute(e),s=[],o=0,a=0;;)if(o=a,a=e.indexOf("/",o),a===-1){s.push(e.slice(o));break}else for(s.push(e.slice(o,a));a<e.length&&e[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 e=s.join("/"),e===""&&(e=n?"/":"."),i?(i.path=e,Ns(i)):e});xt.normalize=If;function ZS(t,r){t===""&&(t="."),r===""&&(r=".");var e=aa(r),i=aa(t);if(i&&(t=i.path||"/"),e&&!e.scheme)return i&&(e.scheme=i.scheme),Ns(e);if(e||r.match(WL))return r;if(i&&!i.host&&!i.path)return i.host=r,Ns(i);var n=r.charAt(0)==="/"?r:If(t.replace(/\/+$/,"")+"/"+r);return i?(i.path=n,Ns(i)):n}xt.join=ZS;xt.isAbsolute=function(t){return t.charAt(0)==="/"||QS.test(t)};function JL(t,r){t===""&&(t="."),t=t.replace(/\/$/,"");for(var e=0;r.indexOf(t+"/")!==0;){var i=t.lastIndexOf("/");if(i<0||(t=t.slice(0,i),t.match(/^([^\/]+:\/)?\/*$/)))return r;++e}return Array(e+1).join("../")+r.substr(t.length+1)}xt.relative=JL;var ev=function(){var t=Object.create(null);return!("__proto__"in t)}();function tv(t){return t}function YL(t){return rv(t)?"$"+t:t}xt.toSetString=ev?tv:YL;function XL(t){return rv(t)?t.slice(1):t}xt.fromSetString=ev?tv:XL;function rv(t){if(!t)return!1;var r=t.length;if(r<9||t.charCodeAt(r-1)!==95||t.charCodeAt(r-2)!==95||t.charCodeAt(r-3)!==111||t.charCodeAt(r-4)!==116||t.charCodeAt(r-5)!==111||t.charCodeAt(r-6)!==114||t.charCodeAt(r-7)!==112||t.charCodeAt(r-8)!==95||t.charCodeAt(r-9)!==95)return!1;for(var e=r-10;e>=0;e--)if(t.charCodeAt(e)!==36)return!1;return!0}function QL(t,r,e){var i=Ui(t.source,r.source);return i!==0||(i=t.originalLine-r.originalLine,i!==0)||(i=t.originalColumn-r.originalColumn,i!==0||e)||(i=t.generatedColumn-r.generatedColumn,i!==0)||(i=t.generatedLine-r.generatedLine,i!==0)?i:Ui(t.name,r.name)}xt.compareByOriginalPositions=QL;function ZL(t,r,e){var i;return i=t.originalLine-r.originalLine,i!==0||(i=t.originalColumn-r.originalColumn,i!==0||e)||(i=t.generatedColumn-r.generatedColumn,i!==0)||(i=t.generatedLine-r.generatedLine,i!==0)?i:Ui(t.name,r.name)}xt.compareByOriginalPositionsNoSource=ZL;function eM(t,r,e){var i=t.generatedLine-r.generatedLine;return i!==0||(i=t.generatedColumn-r.generatedColumn,i!==0||e)||(i=Ui(t.source,r.source),i!==0)||(i=t.originalLine-r.originalLine,i!==0)||(i=t.originalColumn-r.originalColumn,i!==0)?i:Ui(t.name,r.name)}xt.compareByGeneratedPositionsDeflated=eM;function tM(t,r,e){var i=t.generatedColumn-r.generatedColumn;return i!==0||e||(i=Ui(t.source,r.source),i!==0)||(i=t.originalLine-r.originalLine,i!==0)||(i=t.originalColumn-r.originalColumn,i!==0)?i:Ui(t.name,r.name)}xt.compareByGeneratedPositionsDeflatedNoLine=tM;function Ui(t,r){return t===r?0:t===null?1:r===null?-1:t>r?1:-1}function rM(t,r){var e=t.generatedLine-r.generatedLine;return e!==0||(e=t.generatedColumn-r.generatedColumn,e!==0)||(e=Ui(t.source,r.source),e!==0)||(e=t.originalLine-r.originalLine,e!==0)||(e=t.originalColumn-r.originalColumn,e!==0)?e:Ui(t.name,r.name)}xt.compareByGeneratedPositionsInflated=rM;function iM(t){return JSON.parse(t.replace(/^\)]}'[^\n]*\n/,""))}xt.parseSourceMapInput=iM;function nM(t,r,e){if(r=r||"",t&&(t[t.length-1]!=="/"&&r[0]!=="/"&&(t+="/"),r=t+r),e){var i=aa(e);if(!i)throw new Error("sourceMapURL could not be parsed");if(i.path){var n=i.path.lastIndexOf("/");n>=0&&(i.path=i.path.substring(0,n+1))}r=ZS(Ns(i),r)}return If(r)}xt.computeSourceURL=nM});var Ff=A(iv=>{var _f=Fs(),Nf=Object.prototype.hasOwnProperty,zn=typeof Map<"u";function ji(){this._array=[],this._set=zn?new Map:Object.create(null)}ji.fromArray=function(r,e){for(var i=new ji,n=0,s=r.length;n<s;n++)i.add(r[n],e);return i};ji.prototype.size=function(){return zn?this._set.size:Object.getOwnPropertyNames(this._set).length};ji.prototype.add=function(r,e){var i=zn?r:_f.toSetString(r),n=zn?this.has(r):Nf.call(this._set,i),s=this._array.length;(!n||e)&&this._array.push(r),n||(zn?this._set.set(r,s):this._set[i]=s)};ji.prototype.has=function(r){if(zn)return this._set.has(r);var e=_f.toSetString(r);return Nf.call(this._set,e)};ji.prototype.indexOf=function(r){if(zn){var e=this._set.get(r);if(e>=0)return e}else{var i=_f.toSetString(r);if(Nf.call(this._set,i))return this._set[i]}throw new Error('"'+r+'" is not in the set.')};ji.prototype.at=function(r){if(r>=0&&r<this._array.length)return this._array[r];throw new Error("No element indexed by "+r)};ji.prototype.toArray=function(){return this._array.slice()};iv.ArraySet=ji});var ov=A(sv=>{var nv=Fs();function sM(t,r){var e=t.generatedLine,i=r.generatedLine,n=t.generatedColumn,s=r.generatedColumn;return i>e||i==e&&s>=n||nv.compareByGeneratedPositionsInflated(t,r)<=0}function Su(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}Su.prototype.unsortedForEach=function(r,e){this._array.forEach(r,e)};Su.prototype.add=function(r){sM(this._last,r)?(this._last=r,this._array.push(r)):(this._sorted=!1,this._array.push(r))};Su.prototype.toArray=function(){return this._sorted||(this._array.sort(nv.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};sv.MappingList=Su});var kf=A(av=>{var la=Pf(),st=Fs(),vu=Ff().ArraySet,oM=ov().MappingList;function Cr(t){t||(t={}),this._file=st.getArg(t,"file",null),this._sourceRoot=st.getArg(t,"sourceRoot",null),this._skipValidation=st.getArg(t,"skipValidation",!1),this._ignoreInvalidMapping=st.getArg(t,"ignoreInvalidMapping",!1),this._sources=new vu,this._names=new vu,this._mappings=new oM,this._sourcesContents=null}Cr.prototype._version=3;Cr.fromSourceMap=function(r,e){var i=r.sourceRoot,n=new Cr(Object.assign(e||{},{file:r.file,sourceRoot:i}));return r.eachMapping(function(s){var o={generated:{line:s.generatedLine,column:s.generatedColumn}};s.source!=null&&(o.source=s.source,i!=null&&(o.source=st.relative(i,o.source)),o.original={line:s.originalLine,column:s.originalColumn},s.name!=null&&(o.name=s.name)),n.addMapping(o)}),r.sources.forEach(function(s){var o=s;i!==null&&(o=st.relative(i,s)),n._sources.has(o)||n._sources.add(o);var a=r.sourceContentFor(s);a!=null&&n.setSourceContent(s,a)}),n};Cr.prototype.addMapping=function(r){var e=st.getArg(r,"generated"),i=st.getArg(r,"original",null),n=st.getArg(r,"source",null),s=st.getArg(r,"name",null);!this._skipValidation&&this._validateMapping(e,i,n,s)===!1||(n!=null&&(n=String(n),this._sources.has(n)||this._sources.add(n)),s!=null&&(s=String(s),this._names.has(s)||this._names.add(s)),this._mappings.add({generatedLine:e.line,generatedColumn:e.column,originalLine:i!=null&&i.line,originalColumn:i!=null&&i.column,source:n,name:s}))};Cr.prototype.setSourceContent=function(r,e){var i=r;this._sourceRoot!=null&&(i=st.relative(this._sourceRoot,i)),e!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[st.toSetString(i)]=e):this._sourcesContents&&(delete this._sourcesContents[st.toSetString(i)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};Cr.prototype.applySourceMap=function(r,e,i){var n=e;if(e==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.`);n=r.file}var s=this._sourceRoot;s!=null&&(n=st.relative(s,n));var o=new vu,a=new vu;this._mappings.unsortedForEach(function(l){if(l.source===n&&l.originalLine!=null){var u=r.originalPositionFor({line:l.originalLine,column:l.originalColumn});u.source!=null&&(l.source=u.source,i!=null&&(l.source=st.join(i,l.source)),s!=null&&(l.source=st.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&&(i!=null&&(l=st.join(i,l)),s!=null&&(l=st.relative(s,l)),this.setSourceContent(l,u))},this)};Cr.prototype._validateMapping=function(r,e,i,n){if(e&&typeof e.line!="number"&&typeof e.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&&!e&&!i&&!n)){if(r&&"line"in r&&"column"in r&&e&&"line"in e&&"column"in e&&r.line>0&&r.column>=0&&e.line>0&&e.column>=0&&i)return;var s="Invalid mapping: "+JSON.stringify({generated:r,source:i,original:e,name:n});if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(s),!1;throw new Error(s)}};Cr.prototype._serializeMappings=function(){for(var r=0,e=1,i=0,n=0,s=0,o=0,a="",l,u,c,p,d=this._mappings.toArray(),h=0,f=d.length;h<f;h++){if(u=d[h],l="",u.generatedLine!==e)for(r=0;u.generatedLine!==e;)l+=";",e++;else if(h>0){if(!st.compareByGeneratedPositionsInflated(u,d[h-1]))continue;l+=","}l+=la.encode(u.generatedColumn-r),r=u.generatedColumn,u.source!=null&&(p=this._sources.indexOf(u.source),l+=la.encode(p-o),o=p,l+=la.encode(u.originalLine-1-n),n=u.originalLine-1,l+=la.encode(u.originalColumn-i),i=u.originalColumn,u.name!=null&&(c=this._names.indexOf(u.name),l+=la.encode(c-s),s=c)),a+=l}return a};Cr.prototype._generateSourcesContent=function(r,e){return r.map(function(i){if(!this._sourcesContents)return null;e!=null&&(i=st.relative(e,i));var n=st.toSetString(i);return Object.prototype.hasOwnProperty.call(this._sourcesContents,n)?this._sourcesContents[n]:null},this)};Cr.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};Cr.prototype.toString=function(){return JSON.stringify(this.toJSON())};av.SourceMapGenerator=Cr});var lv=A(Wn=>{Wn.GREATEST_LOWER_BOUND=1;Wn.LEAST_UPPER_BOUND=2;function Of(t,r,e,i,n,s){var o=Math.floor((r-t)/2)+t,a=n(e,i[o],!0);return a===0?o:a>0?r-o>1?Of(o,r,e,i,n,s):s==Wn.LEAST_UPPER_BOUND?r<i.length?r:-1:o:o-t>1?Of(t,o,e,i,n,s):s==Wn.LEAST_UPPER_BOUND?o:t<0?-1:t}Wn.search=function(r,e,i,n){if(e.length===0)return-1;var s=Of(-1,e.length,r,e,i,n||Wn.GREATEST_LOWER_BOUND);if(s<0)return-1;for(;s-1>=0&&i(e[s],e[s-1],!0)===0;)--s;return s}});var pv=A(cv=>{function aM(t){function r(n,s,o){var a=n[s];n[s]=n[o],n[o]=a}function e(n,s){return Math.round(n+Math.random()*(s-n))}function i(n,s,o,a){if(o<a){var l=e(o,a),u=o-1;r(n,l,a);for(var c=n[a],p=o;p<a;p++)s(n[p],c,!1)<=0&&(u+=1,r(n,u,p));r(n,u+1,p);var d=u+1;i(n,s,o,d-1),i(n,s,d+1,a)}}return i}function lM(t){let r=aM.toString();return new Function(`return ${r}`)()(t)}var uv=new WeakMap;cv.quickSort=function(t,r,e=0){let i=uv.get(r);i===void 0&&(i=lM(r),uv.set(r,i)),i(t,r,e,t.length-1)}});var hv=A(wu=>{var W=Fs(),Lf=lv(),ks=Ff().ArraySet,uM=Pf(),ua=pv().quickSort;function Ge(t,r){var e=t;return typeof t=="string"&&(e=W.parseSourceMapInput(t)),e.sections!=null?new Mr(e,r):new vt(e,r)}Ge.fromSourceMap=function(t,r){return vt.fromSourceMap(t,r)};Ge.prototype._version=3;Ge.prototype.__generatedMappings=null;Object.defineProperty(Ge.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}});Ge.prototype.__originalMappings=null;Object.defineProperty(Ge.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}});Ge.prototype._charIsMappingSeparator=function(r,e){var i=r.charAt(e);return i===";"||i===","};Ge.prototype._parseMappings=function(r,e){throw new Error("Subclasses must implement _parseMappings")};Ge.GENERATED_ORDER=1;Ge.ORIGINAL_ORDER=2;Ge.GREATEST_LOWER_BOUND=1;Ge.LEAST_UPPER_BOUND=2;Ge.prototype.eachMapping=function(r,e,i){var n=e||null,s=i||Ge.GENERATED_ORDER,o;switch(s){case Ge.GENERATED_ORDER:o=this._generatedMappings;break;case Ge.ORIGINAL_ORDER:o=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}for(var a=this.sourceRoot,l=r.bind(n),u=this._names,c=this._sources,p=this._sourceMapURL,d=0,h=o.length;d<h;d++){var f=o[d],g=f.source===null?null:c.at(f.source);g!==null&&(g=W.computeSourceURL(a,g,p)),l({source:g,generatedLine:f.generatedLine,generatedColumn:f.generatedColumn,originalLine:f.originalLine,originalColumn:f.originalColumn,name:f.name===null?null:u.at(f.name)})}};Ge.prototype.allGeneratedPositionsFor=function(r){var e=W.getArg(r,"line"),i={source:W.getArg(r,"source"),originalLine:e,originalColumn:W.getArg(r,"column",0)};if(i.source=this._findSourceIndex(i.source),i.source<0)return[];var n=[],s=this._findMapping(i,this._originalMappings,"originalLine","originalColumn",W.compareByOriginalPositions,Lf.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;)n.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===e&&o.originalColumn==l;)n.push({line:W.getArg(o,"generatedLine",null),column:W.getArg(o,"generatedColumn",null),lastColumn:W.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++s]}return n};wu.SourceMapConsumer=Ge;function vt(t,r){var e=t;typeof t=="string"&&(e=W.parseSourceMapInput(t));var i=W.getArg(e,"version"),n=W.getArg(e,"sources"),s=W.getArg(e,"names",[]),o=W.getArg(e,"sourceRoot",null),a=W.getArg(e,"sourcesContent",null),l=W.getArg(e,"mappings"),u=W.getArg(e,"file",null);if(i!=this._version)throw new Error("Unsupported version: "+i);o&&(o=W.normalize(o)),n=n.map(String).map(W.normalize).map(function(c){return o&&W.isAbsolute(o)&&W.isAbsolute(c)?W.relative(o,c):c}),this._names=ks.fromArray(s.map(String),!0),this._sources=ks.fromArray(n,!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}vt.prototype=Object.create(Ge.prototype);vt.prototype.consumer=Ge;vt.prototype._findSourceIndex=function(t){var r=t;if(this.sourceRoot!=null&&(r=W.relative(this.sourceRoot,r)),this._sources.has(r))return this._sources.indexOf(r);var e;for(e=0;e<this._absoluteSources.length;++e)if(this._absoluteSources[e]==t)return e;return-1};vt.fromSourceMap=function(r,e){var i=Object.create(vt.prototype),n=i._names=ks.fromArray(r._names.toArray(),!0),s=i._sources=ks.fromArray(r._sources.toArray(),!0);i.sourceRoot=r._sourceRoot,i.sourcesContent=r._generateSourcesContent(i._sources.toArray(),i.sourceRoot),i.file=r._file,i._sourceMapURL=e,i._absoluteSources=i._sources.toArray().map(function(h){return W.computeSourceURL(i.sourceRoot,h,e)});for(var o=r._mappings.toArray().slice(),a=i.__generatedMappings=[],l=i.__originalMappings=[],u=0,c=o.length;u<c;u++){var p=o[u],d=new fv;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=n.indexOf(p.name)),l.push(d)),a.push(d)}return ua(i.__originalMappings,W.compareByOriginalPositions),i};vt.prototype._version=3;Object.defineProperty(vt.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function fv(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}var Rf=W.compareByGeneratedPositionsDeflatedNoLine;function dv(t,r){let e=t.length,i=t.length-r;if(!(i<=1))if(i==2){let n=t[r],s=t[r+1];Rf(n,s)>0&&(t[r]=s,t[r+1]=n)}else if(i<20)for(let n=r;n<e;n++)for(let s=n;s>r;s--){let o=t[s-1],a=t[s];if(Rf(o,a)<=0)break;t[s-1]=a,t[s]=o}else ua(t,Rf,r)}vt.prototype._parseMappings=function(r,e){var i=1,n=0,s=0,o=0,a=0,l=0,u=r.length,c=0,p={},d={},h=[],f=[],g,m,y,b,C;let D=0;for(;c<u;)if(r.charAt(c)===";")i++,c++,n=0,dv(f,D),D=f.length;else if(r.charAt(c)===",")c++;else{for(g=new fv,g.generatedLine=i,b=c;b<u&&!this._charIsMappingSeparator(r,b);b++);for(m=r.slice(c,b),y=[];c<b;)uM.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(g.generatedColumn=n+y[0],n=g.generatedColumn,y.length>1&&(g.source=a+y[1],a+=y[1],g.originalLine=s+y[2],s=g.originalLine,g.originalLine+=1,g.originalColumn=o+y[3],o=g.originalColumn,y.length>4&&(g.name=l+y[4],l+=y[4])),f.push(g),typeof g.originalLine=="number"){let E=g.source;for(;h.length<=E;)h.push(null);h[E]===null&&(h[E]=[]),h[E].push(g)}}dv(f,D),this.__generatedMappings=f;for(var x=0;x<h.length;x++)h[x]!=null&&ua(h[x],W.compareByOriginalPositionsNoSource);this.__originalMappings=[].concat(...h)};vt.prototype._findMapping=function(r,e,i,n,s,o){if(r[i]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+r[i]);if(r[n]<0)throw new TypeError("Column must be greater than or equal to 0, got "+r[n]);return Lf.search(r,e,s,o)};vt.prototype.computeColumnSpans=function(){for(var r=0;r<this._generatedMappings.length;++r){var e=this._generatedMappings[r];if(r+1<this._generatedMappings.length){var i=this._generatedMappings[r+1];if(e.generatedLine===i.generatedLine){e.lastGeneratedColumn=i.generatedColumn-1;continue}}e.lastGeneratedColumn=1/0}};vt.prototype.originalPositionFor=function(r){var e={generatedLine:W.getArg(r,"line"),generatedColumn:W.getArg(r,"column")},i=this._findMapping(e,this._generatedMappings,"generatedLine","generatedColumn",W.compareByGeneratedPositionsDeflated,W.getArg(r,"bias",Ge.GREATEST_LOWER_BOUND));if(i>=0){var n=this._generatedMappings[i];if(n.generatedLine===e.generatedLine){var s=W.getArg(n,"source",null);s!==null&&(s=this._sources.at(s),s=W.computeSourceURL(this.sourceRoot,s,this._sourceMapURL));var o=W.getArg(n,"name",null);return o!==null&&(o=this._names.at(o)),{source:s,line:W.getArg(n,"originalLine",null),column:W.getArg(n,"originalColumn",null),name:o}}}return{source:null,line:null,column:null,name:null}};vt.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(r){return r==null}):!1};vt.prototype.sourceContentFor=function(r,e){if(!this.sourcesContent)return null;var i=this._findSourceIndex(r);if(i>=0)return this.sourcesContent[i];var n=r;this.sourceRoot!=null&&(n=W.relative(this.sourceRoot,n));var s;if(this.sourceRoot!=null&&(s=W.urlParse(this.sourceRoot))){var o=n.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("/"+n))return this.sourcesContent[this._sources.indexOf("/"+n)]}if(e)return null;throw new Error('"'+n+'" is not in the SourceMap.')};vt.prototype.generatedPositionFor=function(r){var e=W.getArg(r,"source");if(e=this._findSourceIndex(e),e<0)return{line:null,column:null,lastColumn:null};var i={source:e,originalLine:W.getArg(r,"line"),originalColumn:W.getArg(r,"column")},n=this._findMapping(i,this._originalMappings,"originalLine","originalColumn",W.compareByOriginalPositions,W.getArg(r,"bias",Ge.GREATEST_LOWER_BOUND));if(n>=0){var s=this._originalMappings[n];if(s.source===i.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}};wu.BasicSourceMapConsumer=vt;function Mr(t,r){var e=t;typeof t=="string"&&(e=W.parseSourceMapInput(t));var i=W.getArg(e,"version"),n=W.getArg(e,"sections");if(i!=this._version)throw new Error("Unsupported version: "+i);this._sources=new ks,this._names=new ks;var s={line:-1,column:0};this._sections=n.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 Ge(W.getArg(o,"map"),r)}})}Mr.prototype=Object.create(Ge.prototype);Mr.prototype.constructor=Ge;Mr.prototype._version=3;Object.defineProperty(Mr.prototype,"sources",{get:function(){for(var t=[],r=0;r<this._sections.length;r++)for(var e=0;e<this._sections[r].consumer.sources.length;e++)t.push(this._sections[r].consumer.sources[e]);return t}});Mr.prototype.originalPositionFor=function(r){var e={generatedLine:W.getArg(r,"line"),generatedColumn:W.getArg(r,"column")},i=Lf.search(e,this._sections,function(s,o){var a=s.generatedLine-o.generatedOffset.generatedLine;return a||s.generatedColumn-o.generatedOffset.generatedColumn}),n=this._sections[i];return n?n.consumer.originalPositionFor({line:e.generatedLine-(n.generatedOffset.generatedLine-1),column:e.generatedColumn-(n.generatedOffset.generatedLine===e.generatedLine?n.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,e){for(var i=0;i<this._sections.length;i++){var n=this._sections[i],s=n.consumer.sourceContentFor(r,!0);if(s||s==="")return s}if(e)return null;throw new Error('"'+r+'" is not in the SourceMap.')};Mr.prototype.generatedPositionFor=function(r){for(var e=0;e<this._sections.length;e++){var i=this._sections[e];if(i.consumer._findSourceIndex(W.getArg(r,"source"))!==-1){var n=i.consumer.generatedPositionFor(r);if(n){var s={line:n.line+(i.generatedOffset.generatedLine-1),column:n.column+(i.generatedOffset.generatedLine===n.line?i.generatedOffset.generatedColumn-1:0)};return s}}}return{line:null,column:null}};Mr.prototype._parseMappings=function(r,e){this.__generatedMappings=[],this.__originalMappings=[];for(var i=0;i<this._sections.length;i++)for(var n=this._sections[i],s=n.consumer._generatedMappings,o=0;o<s.length;o++){var a=s[o],l=n.consumer._sources.at(a.source);l!==null&&(l=W.computeSourceURL(n.consumer.sourceRoot,l,this._sourceMapURL)),this._sources.add(l),l=this._sources.indexOf(l);var u=null;a.name&&(u=n.consumer._names.at(a.name),this._names.add(u),u=this._names.indexOf(u));var c={source:l,generatedLine:a.generatedLine+(n.generatedOffset.generatedLine-1),generatedColumn:a.generatedColumn+(n.generatedOffset.generatedLine===a.generatedLine?n.generatedOffset.generatedColumn-1:0),originalLine:a.originalLine,originalColumn:a.originalColumn,name:u};this.__generatedMappings.push(c),typeof c.originalLine=="number"&&this.__originalMappings.push(c)}ua(this.__generatedMappings,W.compareByGeneratedPositionsDeflated),ua(this.__originalMappings,W.compareByOriginalPositions)};wu.IndexedSourceMapConsumer=Mr});var gv=A(mv=>{var cM=kf().SourceMapGenerator,Tu=Fs(),pM=/(\r?\n)/,dM=10,Os="$$$isSourceNode$$$";function ur(t,r,e,i,n){this.children=[],this.sourceContents={},this.line=t??null,this.column=r??null,this.source=e??null,this.name=n??null,this[Os]=!0,i!=null&&this.add(i)}ur.fromStringWithSourceMap=function(r,e,i){var n=new ur,s=r.split(pM),o=0,a=function(){var d=f(),h=f()||"";return d+h;function f(){return o<s.length?s[o++]:void 0}},l=1,u=0,c=null;return e.eachMapping(function(d){if(c!==null)if(l<d.generatedLine)p(c,a()),l++,u=0;else{var h=s[o]||"",f=h.substr(0,d.generatedColumn-u);s[o]=h.substr(d.generatedColumn-u),u=d.generatedColumn,p(c,f),c=d;return}for(;l<d.generatedLine;)n.add(a()),l++;if(u<d.generatedColumn){var h=s[o]||"";n.add(h.substr(0,d.generatedColumn)),s[o]=h.substr(d.generatedColumn),u=d.generatedColumn}c=d},this),o<s.length&&(c&&p(c,a()),n.add(s.splice(o).join(""))),e.sources.forEach(function(d){var h=e.sourceContentFor(d);h!=null&&(i!=null&&(d=Tu.join(i,d)),n.setSourceContent(d,h))}),n;function p(d,h){if(d===null||d.source===void 0)n.add(h);else{var f=i?Tu.join(i,d.source):d.source;n.add(new ur(d.originalLine,d.originalColumn,f,h,d.name))}}};ur.prototype.add=function(r){if(Array.isArray(r))r.forEach(function(e){this.add(e)},this);else if(r[Os]||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};ur.prototype.prepend=function(r){if(Array.isArray(r))for(var e=r.length-1;e>=0;e--)this.prepend(r[e]);else if(r[Os]||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};ur.prototype.walk=function(r){for(var e,i=0,n=this.children.length;i<n;i++)e=this.children[i],e[Os]?e.walk(r):e!==""&&r(e,{source:this.source,line:this.line,column:this.column,name:this.name})};ur.prototype.join=function(r){var e,i,n=this.children.length;if(n>0){for(e=[],i=0;i<n-1;i++)e.push(this.children[i]),e.push(r);e.push(this.children[i]),this.children=e}return this};ur.prototype.replaceRight=function(r,e){var i=this.children[this.children.length-1];return i[Os]?i.replaceRight(r,e):typeof i=="string"?this.children[this.children.length-1]=i.replace(r,e):this.children.push("".replace(r,e)),this};ur.prototype.setSourceContent=function(r,e){this.sourceContents[Tu.toSetString(r)]=e};ur.prototype.walkSourceContents=function(r){for(var e=0,i=this.children.length;e<i;e++)this.children[e][Os]&&this.children[e].walkSourceContents(r);for(var n=Object.keys(this.sourceContents),e=0,i=n.length;e<i;e++)r(Tu.fromSetString(n[e]),this.sourceContents[n[e]])};ur.prototype.toString=function(){var r="";return this.walk(function(e){r+=e}),r};ur.prototype.toStringWithSourceMap=function(r){var e={code:"",line:1,column:0},i=new cM(r),n=!1,s=null,o=null,a=null,l=null;return this.walk(function(u,c){e.code+=u,c.source!==null&&c.line!==null&&c.column!==null?((s!==c.source||o!==c.line||a!==c.column||l!==c.name)&&i.addMapping({source:c.source,original:{line:c.line,column:c.column},generated:{line:e.line,column:e.column},name:c.name}),s=c.source,o=c.line,a=c.column,l=c.name,n=!0):n&&(i.addMapping({generated:{line:e.line,column:e.column}}),s=null,n=!1);for(var p=0,d=u.length;p<d;p++)u.charCodeAt(p)===dM?(e.line++,e.column=0,p+1===d?(s=null,n=!1):n&&i.addMapping({source:c.source,original:{line:c.line,column:c.column},generated:{line:e.line,column:e.column},name:c.name})):e.column++}),this.walkSourceContents(function(u,c){i.setSourceContent(u,c)}),{code:e.code,map:i}};mv.SourceNode=ur});var yv=A(Au=>{Au.SourceMapGenerator=kf().SourceMapGenerator;Au.SourceMapConsumer=hv().SourceMapConsumer;Au.SourceNode=gv().SourceNode});var Hv=A(Da=>{"use strict";Object.defineProperty(Da,"__esModule",{value:!0});function fM(t,r){if(t==null)return{};var e={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(r.includes(i))continue;e[i]=t[i]}return e}var fi=class{constructor(r,e,i){this.line=void 0,this.column=void 0,this.index=void 0,this.line=r,this.column=e,this.index=i}},$s=class{constructor(r,e){this.start=void 0,this.end=void 0,this.filename=void 0,this.identifierName=void 0,this.start=r,this.end=e}};function jt(t,r){let{line:e,column:i,index:n}=t;return new fi(e,i+r,n+r)}var bv="BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED",hM={ImportMetaOutsideModule:{message:`import.meta may appear only with 'sourceType: "module"'`,code:bv},ImportOutsideModule:{message:`'import' and 'export' may appear only with 'sourceType: "module"'`,code:bv}},Dv={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"},_u=t=>t.type==="UpdateExpression"?Dv.UpdateExpression[`${t.prefix}`]:Dv[t.type],mM={AccessorIsGenerator:({kind:t})=>`A ${t}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:t})=>`Missing initializer in ${t} 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:t})=>`\`${t}\` has already been exported. Exported identifiers must be unique.`,DuplicateProto:"Redefinition of __proto__ property.",DuplicateRegExpFlags:"Duplicate regular expression flag.",DynamicImportPhaseRequiresImportExpressions:({phase:t})=>`'import.${t}(...)' can only be parsed when using the 'createImportExpressions' option.`,ElementAfterRest:"Rest element must be last element.",EscapedCharNotAnIdentifier:"Invalid Unicode escape.",ExportBindingIsString:({localName:t,exportName:r})=>`A string literal cannot be used as an exported binding without \`from\`.
|
|
111
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),N=_,P=B),G===void 0&&(G=!0);let O={code:P,language:N};Z("before:highlight",O);let V=O.result?O.result:p(O.language,O.code,G);return V.code=O.code,Z("after:highlight",V),V}function p(_,B,G,P){let N=Object.create(null);function O(j,Y){return j.keywords[Y]}function V(){if(!ne.keywords){St.addText(Ke);return}let j=0;ne.keywordPatternRe.lastIndex=0;let Y=ne.keywordPatternRe.exec(Ke),ce="";for(;Y;){ce+=Ke.substring(j,Y.index);let ke=dr.case_insensitive?Y[0].toLowerCase():Y[0],At=O(ne,ke);if(At){let[Ci,fP]=At;if(St.addText(ce),ce="",N[ke]=(N[ke]||0)+1,N[ke]<=LO&&(ja+=fP),Ci.startsWith("_"))ce+=Y[0];else{let hP=dr.classNameAliases[Ci]||Ci;ae(Y[0],hP)}}else ce+=Y[0];j=ne.keywordPatternRe.lastIndex,Y=ne.keywordPatternRe.exec(Ke)}ce+=Ke.substring(j),St.addText(ce)}function ue(){if(Ke==="")return;let j=null;if(typeof ne.subLanguage=="string"){if(!r[ne.subLanguage]){St.addText(Ke);return}j=p(ne.subLanguage,Ke,!0,Am[ne.subLanguage]),Am[ne.subLanguage]=j._top}else j=h(Ke,ne.subLanguage.length?ne.subLanguage:null);ne.relevance>0&&(ja+=j.relevance),St.__addSublanguage(j._emitter,j.language)}function ee(){ne.subLanguage!=null?ue():V(),Ke=""}function ae(j,Y){j!==""&&(St.startScope(Y),St.addText(j),St.endScope())}function ct(j,Y){let ce=1,ke=Y.length-1;for(;ce<=ke;){if(!j._emit[ce]){ce++;continue}let At=dr.classNameAliases[j[ce]]||j[ce],Ci=Y[ce];At?ae(Ci,At):(Ke=Ci,V(),Ke=""),ce++}}function mt(j,Y){return j.scope&&typeof j.scope=="string"&&St.openNode(dr.classNameAliases[j.scope]||j.scope),j.beginScope&&(j.beginScope._wrap?(ae(Ke,dr.classNameAliases[j.beginScope._wrap]||j.beginScope._wrap),Ke=""):j.beginScope._multi&&(ct(j.beginScope,Y),Ke="")),ne=Object.create(j,{parent:{value:ne}}),ne}function Di(j,Y,ce){let ke=Z2(j.endRe,ce);if(ke){if(j["on:end"]){let At=new Wl(j);j["on:end"](Y,At),At.isMatchIgnored&&(ke=!1)}if(ke){for(;j.endsParent&&j.parent;)j=j.parent;return j}}if(j.endsWithParent)return Di(j.parent,Y,ce)}function ao(j){return ne.matcher.regexIndex===0?(Ke+=j[0],1):(Cc=!0,0)}function xi(j){let Y=j[0],ce=j.rule,ke=new Wl(ce),At=[ce.__beforeBegin,ce["on:begin"]];for(let Ci of At)if(Ci&&(Ci(j,ke),ke.isMatchIgnored))return ao(Y);return ce.skip?Ke+=Y:(ce.excludeBegin&&(Ke+=Y),ee(),!ce.returnBegin&&!ce.excludeBegin&&(Ke=Y)),mt(ce,j),ce.returnBegin?0:Y.length}function lo(j){let Y=j[0],ce=B.substring(j.index),ke=Di(ne,j,ce);if(!ke)return Z0;let At=ne;ne.endScope&&ne.endScope._wrap?(ee(),ae(Y,ne.endScope._wrap)):ne.endScope&&ne.endScope._multi?(ee(),ct(ne.endScope,j)):At.skip?Ke+=Y:(At.returnEnd||At.excludeEnd||(Ke+=Y),ee(),At.excludeEnd&&(Ke=Y));do ne.scope&&St.closeNode(),!ne.skip&&!ne.subLanguage&&(ja+=ne.relevance),ne=ne.parent;while(ne!==ke.parent);return ke.starts&&mt(ke.starts,j),At.returnEnd?0:Y.length}function Ie(){let j=[];for(let Y=ne;Y!==dr;Y=Y.parent)Y.scope&&j.unshift(Y.scope);j.forEach(Y=>St.openNode(Y))}let Ei={};function Qi(j,Y){let ce=Y&&Y[0];if(Ke+=j,ce==null)return ee(),0;if(Ei.type==="begin"&&Y.type==="end"&&Ei.index===Y.index&&ce===""){if(Ke+=B.slice(Y.index,Y.index+1),!n){let ke=new Error(`0 width match regex (${_})`);throw ke.languageName=_,ke.badRule=Ei.rule,ke}return 1}if(Ei=Y,Y.type==="begin")return xi(Y);if(Y.type==="illegal"&&!G){let ke=new Error('Illegal lexeme "'+ce+'" for mode "'+(ne.scope||"<unnamed>")+'"');throw ke.mode=ne,ke}else if(Y.type==="end"){let ke=lo(Y);if(ke!==Z0)return ke}if(Y.type==="illegal"&&ce==="")return 1;if(Ec>1e5&&Ec>Y.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Ke+=ce,ce.length}let dr=M(_);if(!dr)throw jn(s.replace("{}",_)),new Error('Unknown language: "'+_+'"');let dP=kO(dr),xc="",ne=P||dP,Am={},St=new a.__emitter(a);Ie();let Ke="",ja=0,Tn=0,Ec=0,Cc=!1;try{if(dr.__emitTokens)dr.__emitTokens(B,St);else{for(ne.matcher.considerAll();;){Ec++,Cc?Cc=!1:ne.matcher.considerAll(),ne.matcher.lastIndex=Tn;let j=ne.matcher.exec(B);if(!j)break;let Y=B.substring(Tn,j.index),ce=Qi(Y,j);Tn=j.index+ce}Qi(B.substring(Tn))}return St.finalize(),xc=St.toHTML(),{language:_,value:xc,relevance:ja,illegal:!1,_emitter:St,_top:ne}}catch(j){if(j.message&&j.message.includes("Illegal"))return{language:_,value:Vd(B),illegal:!0,relevance:0,_illegalBy:{message:j.message,index:Tn,context:B.slice(Tn-100,Tn+100),mode:j.mode,resultSoFar:xc},_emitter:St};if(n)return{language:_,value:Vd(B),illegal:!1,relevance:0,errorRaised:j,_emitter:St,_top:ne};throw j}}function d(_){let B={value:Vd(_),illegal:!1,relevance:0,_top:o,_emitter:new a.__emitter(a)};return B._emitter.addText(_),B}function h(_,B){B=B||a.languages||Object.keys(r);let G=d(_),P=B.filter(M).filter(L).map(ee=>p(ee,_,!1));P.unshift(G);let N=P.sort((ee,ae)=>{if(ee.relevance!==ae.relevance)return ae.relevance-ee.relevance;if(ee.language&&ae.language){if(M(ee.language).supersetOf===ae.language)return 1;if(M(ae.language).supersetOf===ee.language)return-1}return 0}),[O,V]=N,ue=O;return ue.secondBest=V,ue}function f(_,B,G){let P=B&&e[B]||G;_.classList.add("hljs"),_.classList.add(`language-${P}`)}function g(_){let B=null,G=u(_);if(l(G))return;if(Z("before:highlightElement",{el:_,language:G}),_.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",_);return}if(_.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(_)),a.throwUnescapedHTML))throw new Hd("One of your code blocks includes unescaped HTML.",_.innerHTML);B=_;let P=B.textContent,N=G?c(P,{language:G,ignoreIllegals:!0}):h(P);_.innerHTML=N.value,_.dataset.highlighted="yes",f(_,G,N.language),_.result={language:N.language,re:N.relevance,relevance:N.relevance},N.secondBest&&(_.secondBest={language:N.secondBest.language,relevance:N.secondBest.relevance}),Z("after:highlightElement",{el:_,result:N,text:P})}function m(_){a=Q0(a,_)}let y=()=>{D(),Es("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function b(){D(),Es("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let C=!1;function D(){if(document.readyState==="loading"){C=!0;return}document.querySelectorAll(a.cssSelector).forEach(g)}function x(){C&&D()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",x,!1);function E(_,B){let G=null;try{G=B(t)}catch(P){if(jn("Language definition for '{}' could not be registered.".replace("{}",_)),n)jn(P);else throw P;G=o}G.name||(G.name=_),r[_]=G,G.rawDefinition=B.bind(null,t),G.aliases&&T(G.aliases,{languageName:_})}function w(_){delete r[_];for(let B of Object.keys(e))e[B]===_&&delete e[B]}function R(){return Object.keys(r)}function M(_){return _=(_||"").toLowerCase(),r[_]||r[e[_]]}function T(_,{languageName:B}){typeof _=="string"&&(_=[_]),_.forEach(G=>{e[G.toLowerCase()]=B})}function L(_){let B=M(_);return B&&!B.disableAutodetect}function Q(_){_["before:highlightBlock"]&&!_["before:highlightElement"]&&(_["before:highlightElement"]=B=>{_["before:highlightBlock"](Object.assign({block:B.el},B))}),_["after:highlightBlock"]&&!_["after:highlightElement"]&&(_["after:highlightElement"]=B=>{_["after:highlightBlock"](Object.assign({block:B.el},B))})}function ie(_){Q(_),i.push(_)}function re(_){let B=i.indexOf(_);B!==-1&&i.splice(B,1)}function Z(_,B){let G=_;i.forEach(function(P){P[G]&&P[G](B)})}function Pe(_){return Es("10.7.0","highlightBlock will be removed entirely in v12.0"),Es("10.7.0","Please use highlightElement now."),g(_)}Object.assign(t,{highlight:c,highlightAuto:h,highlightAll:D,highlightElement:g,highlightBlock:Pe,configure:m,initHighlighting:y,initHighlightingOnLoad:b,registerLanguage:E,unregisterLanguage:w,listLanguages:R,getLanguage:M,registerAliases:T,autoDetection:L,inherit:Q0,addPlugin:ie,removePlugin:re}),t.debugMode=function(){n=!1},t.safeMode=function(){n=!0},t.versionString=RO,t.regex={concat:qn,lookahead:rC,either:Jd,optional:X2,anyNumberOfTimes:Y2};for(let _ in zl)typeof zl[_]=="object"&&eC(zl[_]);return Object.assign(t,zl),t},Cs=pC({});Cs.newInstance=()=>pC({});dC.exports=Cs;Cs.HighlightJS=Cs;Cs.default=Cs});var Wo={};Sc(Wo,{__addDisposableResource:()=>YC,__assign:()=>Zl,__asyncDelegator:()=>qC,__asyncGenerator:()=>jC,__asyncValues:()=>KC,__await:()=>ws,__awaiter:()=>RC,__classPrivateFieldGet:()=>GC,__classPrivateFieldIn:()=>JC,__classPrivateFieldSet:()=>HC,__createBinding:()=>tu,__decorate:()=>FC,__disposeResources:()=>XC,__esDecorate:()=>XO,__exportStar:()=>MC,__extends:()=>_C,__generator:()=>LC,__importDefault:()=>WC,__importStar:()=>zC,__makeTemplateObject:()=>VC,__metadata:()=>OC,__param:()=>kC,__propKey:()=>ZO,__read:()=>af,__rest:()=>NC,__runInitializers:()=>QO,__setFunctionName:()=>eR,__spread:()=>BC,__spreadArray:()=>UC,__spreadArrays:()=>$C,__values:()=>eu,default:()=>iR});function _C(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");of(t,r);function e(){this.constructor=t}t.prototype=r===null?Object.create(r):(e.prototype=r.prototype,new e)}function NC(t,r){var e={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&r.indexOf(i)<0&&(e[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(t);n<i.length;n++)r.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(e[i[n]]=t[i[n]]);return e}function FC(t,r,e,i){var n=arguments.length,s=n<3?r:i===null?i=Object.getOwnPropertyDescriptor(r,e):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,r,e,i);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(n<3?o(s):n>3?o(r,e,s):o(r,e))||s);return n>3&&s&&Object.defineProperty(r,e,s),s}function kC(t,r){return function(e,i){r(e,i,t)}}function XO(t,r,e,i,n,s){function o(y){if(y!==void 0&&typeof y!="function")throw new TypeError("Function expected");return y}for(var a=i.kind,l=a==="getter"?"get":a==="setter"?"set":"value",u=!r&&t?i.static?t:t.prototype:null,c=r||(u?Object.getOwnPropertyDescriptor(u,i.name):{}),p,d=!1,h=e.length-1;h>=0;h--){var f={};for(var g in i)f[g]=g==="access"?{}:i[g];for(var g in i.access)f.access[g]=i.access[g];f.addInitializer=function(y){if(d)throw new TypeError("Cannot add initializers after decoration has completed");s.push(o(y||null))};var m=(0,e[h])(a==="accessor"?{get:c.get,set:c.set}:c[l],f);if(a==="accessor"){if(m===void 0)continue;if(m===null||typeof m!="object")throw new TypeError("Object expected");(p=o(m.get))&&(c.get=p),(p=o(m.set))&&(c.set=p),(p=o(m.init))&&n.unshift(p)}else(p=o(m))&&(a==="field"?n.unshift(p):c[l]=p)}u&&Object.defineProperty(u,i.name,c),d=!0}function QO(t,r,e){for(var i=arguments.length>2,n=0;n<r.length;n++)e=i?r[n].call(t,e):r[n].call(t);return i?e:void 0}function ZO(t){return typeof t=="symbol"?t:"".concat(t)}function eR(t,r,e){return typeof r=="symbol"&&(r=r.description?"[".concat(r.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:e?"".concat(e," ",r):r})}function OC(t,r){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,r)}function RC(t,r,e,i){function n(s){return s instanceof e?s:new e(function(o){o(s)})}return new(e||(e=Promise))(function(s,o){function a(c){try{u(i.next(c))}catch(p){o(p)}}function l(c){try{u(i.throw(c))}catch(p){o(p)}}function u(c){c.done?s(c.value):n(c.value).then(a,l)}u((i=i.apply(t,r||[])).next())})}function LC(t,r){var e={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(c){return l([u,c])}}function l(u){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(e=0)),e;)try{if(i=1,n&&(s=u[0]&2?n.return:u[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,u[1])).done)return s;switch(n=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return e.label++,{value:u[1],done:!1};case 5:e.label++,n=u[1],u=[0];continue;case 7:u=e.ops.pop(),e.trys.pop();continue;default:if(s=e.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){e.label=u[1];break}if(u[0]===6&&e.label<s[1]){e.label=s[1],s=u;break}if(s&&e.label<s[2]){e.label=s[2],e.ops.push(u);break}s[2]&&e.ops.pop(),e.trys.pop();continue}u=r.call(t,e)}catch(c){u=[6,c],n=0}finally{i=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function MC(t,r){for(var e in t)e!=="default"&&!Object.prototype.hasOwnProperty.call(r,e)&&tu(r,t,e)}function eu(t){var r=typeof Symbol=="function"&&Symbol.iterator,e=r&&t[r],i=0;if(e)return e.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")}function af(t,r){var e=typeof Symbol=="function"&&t[Symbol.iterator];if(!e)return t;var i=e.call(t),n,s=[],o;try{for(;(r===void 0||r-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(a){o={error:a}}finally{try{n&&!n.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return s}function BC(){for(var t=[],r=0;r<arguments.length;r++)t=t.concat(af(arguments[r]));return t}function $C(){for(var t=0,r=0,e=arguments.length;r<e;r++)t+=arguments[r].length;for(var i=Array(t),n=0,r=0;r<e;r++)for(var s=arguments[r],o=0,a=s.length;o<a;o++,n++)i[n]=s[o];return i}function UC(t,r,e){if(e||arguments.length===2)for(var i=0,n=r.length,s;i<n;i++)(s||!(i in r))&&(s||(s=Array.prototype.slice.call(r,0,i)),s[i]=r[i]);return t.concat(s||Array.prototype.slice.call(r))}function ws(t){return this instanceof ws?(this.v=t,this):new ws(t)}function jC(t,r,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=e.apply(t,r||[]),n,s=[];return n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n;function o(d){i[d]&&(n[d]=function(h){return new Promise(function(f,g){s.push([d,h,f,g])>1||a(d,h)})})}function a(d,h){try{l(i[d](h))}catch(f){p(s[0][3],f)}}function l(d){d.value instanceof ws?Promise.resolve(d.value.v).then(u,c):p(s[0][2],d)}function u(d){a("next",d)}function c(d){a("throw",d)}function p(d,h){d(h),s.shift(),s.length&&a(s[0][0],s[0][1])}}function qC(t){var r,e;return r={},i("next"),i("throw",function(n){throw n}),i("return"),r[Symbol.iterator]=function(){return this},r;function i(n,s){r[n]=t[n]?function(o){return(e=!e)?{value:ws(t[n](o)),done:!1}:s?s(o):o}:s}}function KC(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=t[Symbol.asyncIterator],e;return r?r.call(t):(t=typeof eu=="function"?eu(t):t[Symbol.iterator](),e={},i("next"),i("throw"),i("return"),e[Symbol.asyncIterator]=function(){return this},e);function i(s){e[s]=t[s]&&function(o){return new Promise(function(a,l){o=t[s](o),n(a,l,o.done,o.value)})}}function n(s,o,a,l){Promise.resolve(l).then(function(u){s({value:u,done:a})},o)}}function VC(t,r){return Object.defineProperty?Object.defineProperty(t,"raw",{value:r}):t.raw=r,t}function zC(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var e in t)e!=="default"&&Object.prototype.hasOwnProperty.call(t,e)&&tu(r,t,e);return tR(r,t),r}function WC(t){return t&&t.__esModule?t:{default:t}}function GC(t,r,e,i){if(e==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof r=="function"?t!==r||!i:!r.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?i:e==="a"?i.call(t):i?i.value:r.get(t)}function HC(t,r,e,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof r=="function"?t!==r||!n:!r.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,e):n?n.value=e:r.set(t,e),e}function JC(t,r){if(r===null||typeof r!="object"&&typeof r!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?r===t:t.has(r)}function YC(t,r,e){if(r!=null){if(typeof r!="object"&&typeof r!="function")throw new TypeError("Object expected.");var i;if(e){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=r[Symbol.asyncDispose]}if(i===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=r[Symbol.dispose]}if(typeof i!="function")throw new TypeError("Object not disposable.");t.stack.push({value:r,dispose:i,async:e})}else e&&t.stack.push({async:!0});return r}function XC(t){function r(i){t.error=t.hasError?new rR(i,t.error,"An error was suppressed during disposal."):i,t.hasError=!0}function e(){for(;t.stack.length;){var i=t.stack.pop();try{var n=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(n).then(e,function(s){return r(s),e()})}catch(s){r(s)}}if(t.hasError)throw t.error}return e()}var of,Zl,tu,tR,rR,iR,Go=Pm(()=>{of=function(t,r){return of=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},of(t,r)};Zl=function(){return Zl=Object.assign||function(r){for(var e,i=1,n=arguments.length;i<n;i++){e=arguments[i];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=e[s])}return r},Zl.apply(this,arguments)};tu=Object.create?function(t,r,e,i){i===void 0&&(i=e);var n=Object.getOwnPropertyDescriptor(r,e);(!n||("get"in n?!r.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return r[e]}}),Object.defineProperty(t,i,n)}:function(t,r,e,i){i===void 0&&(i=e),t[i]=r[e]};tR=Object.create?function(t,r){Object.defineProperty(t,"default",{enumerable:!0,value:r})}:function(t,r){t.default=r};rR=typeof SuppressedError=="function"?SuppressedError:function(t,r,e){var i=new Error(e);return i.name="SuppressedError",i.error=t,i.suppressed=r,i};iR={__extends:_C,__assign:Zl,__rest:NC,__decorate:FC,__param:kC,__metadata:OC,__awaiter:RC,__generator:LC,__createBinding:tu,__exportStar:MC,__values:eu,__read:af,__spread:BC,__spreadArrays:$C,__spreadArray:UC,__await:ws,__asyncGenerator:jC,__asyncDelegator:qC,__asyncValues:KC,__makeTemplateObject:VC,__importStar:zC,__importDefault:WC,__classPrivateFieldGet:GC,__classPrivateFieldSet:HC,__classPrivateFieldIn:JC,__addDisposableResource:YC,__disposeResources:XC}});var ui={};Sc(ui,{__addDisposableResource:()=>bS,__assign:()=>ru,__asyncDelegator:()=>cS,__asyncGenerator:()=>uS,__asyncValues:()=>pS,__await:()=>Ts,__awaiter:()=>iS,__classPrivateFieldGet:()=>mS,__classPrivateFieldIn:()=>yS,__classPrivateFieldSet:()=>gS,__createBinding:()=>nu,__decorate:()=>eS,__disposeResources:()=>DS,__esDecorate:()=>nR,__exportStar:()=>sS,__extends:()=>QC,__generator:()=>nS,__importDefault:()=>hS,__importStar:()=>fS,__makeTemplateObject:()=>dS,__metadata:()=>rS,__param:()=>tS,__propKey:()=>oR,__read:()=>uf,__rest:()=>ZC,__runInitializers:()=>sR,__setFunctionName:()=>aR,__spread:()=>oS,__spreadArray:()=>lS,__spreadArrays:()=>aS,__values:()=>iu,default:()=>cR});function QC(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");lf(t,r);function e(){this.constructor=t}t.prototype=r===null?Object.create(r):(e.prototype=r.prototype,new e)}function ZC(t,r){var e={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&r.indexOf(i)<0&&(e[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(t);n<i.length;n++)r.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(e[i[n]]=t[i[n]]);return e}function eS(t,r,e,i){var n=arguments.length,s=n<3?r:i===null?i=Object.getOwnPropertyDescriptor(r,e):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,r,e,i);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(n<3?o(s):n>3?o(r,e,s):o(r,e))||s);return n>3&&s&&Object.defineProperty(r,e,s),s}function tS(t,r){return function(e,i){r(e,i,t)}}function nR(t,r,e,i,n,s){function o(y){if(y!==void 0&&typeof y!="function")throw new TypeError("Function expected");return y}for(var a=i.kind,l=a==="getter"?"get":a==="setter"?"set":"value",u=!r&&t?i.static?t:t.prototype:null,c=r||(u?Object.getOwnPropertyDescriptor(u,i.name):{}),p,d=!1,h=e.length-1;h>=0;h--){var f={};for(var g in i)f[g]=g==="access"?{}:i[g];for(var g in i.access)f.access[g]=i.access[g];f.addInitializer=function(y){if(d)throw new TypeError("Cannot add initializers after decoration has completed");s.push(o(y||null))};var m=(0,e[h])(a==="accessor"?{get:c.get,set:c.set}:c[l],f);if(a==="accessor"){if(m===void 0)continue;if(m===null||typeof m!="object")throw new TypeError("Object expected");(p=o(m.get))&&(c.get=p),(p=o(m.set))&&(c.set=p),(p=o(m.init))&&n.unshift(p)}else(p=o(m))&&(a==="field"?n.unshift(p):c[l]=p)}u&&Object.defineProperty(u,i.name,c),d=!0}function sR(t,r,e){for(var i=arguments.length>2,n=0;n<r.length;n++)e=i?r[n].call(t,e):r[n].call(t);return i?e:void 0}function oR(t){return typeof t=="symbol"?t:"".concat(t)}function aR(t,r,e){return typeof r=="symbol"&&(r=r.description?"[".concat(r.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:e?"".concat(e," ",r):r})}function rS(t,r){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,r)}function iS(t,r,e,i){function n(s){return s instanceof e?s:new e(function(o){o(s)})}return new(e||(e=Promise))(function(s,o){function a(c){try{u(i.next(c))}catch(p){o(p)}}function l(c){try{u(i.throw(c))}catch(p){o(p)}}function u(c){c.done?s(c.value):n(c.value).then(a,l)}u((i=i.apply(t,r||[])).next())})}function nS(t,r){var e={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(c){return l([u,c])}}function l(u){if(i)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(e=0)),e;)try{if(i=1,n&&(s=u[0]&2?n.return:u[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,u[1])).done)return s;switch(n=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return e.label++,{value:u[1],done:!1};case 5:e.label++,n=u[1],u=[0];continue;case 7:u=e.ops.pop(),e.trys.pop();continue;default:if(s=e.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){e.label=u[1];break}if(u[0]===6&&e.label<s[1]){e.label=s[1],s=u;break}if(s&&e.label<s[2]){e.label=s[2],e.ops.push(u);break}s[2]&&e.ops.pop(),e.trys.pop();continue}u=r.call(t,e)}catch(c){u=[6,c],n=0}finally{i=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function sS(t,r){for(var e in t)e!=="default"&&!Object.prototype.hasOwnProperty.call(r,e)&&nu(r,t,e)}function iu(t){var r=typeof Symbol=="function"&&Symbol.iterator,e=r&&t[r],i=0;if(e)return e.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")}function uf(t,r){var e=typeof Symbol=="function"&&t[Symbol.iterator];if(!e)return t;var i=e.call(t),n,s=[],o;try{for(;(r===void 0||r-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(a){o={error:a}}finally{try{n&&!n.done&&(e=i.return)&&e.call(i)}finally{if(o)throw o.error}}return s}function oS(){for(var t=[],r=0;r<arguments.length;r++)t=t.concat(uf(arguments[r]));return t}function aS(){for(var t=0,r=0,e=arguments.length;r<e;r++)t+=arguments[r].length;for(var i=Array(t),n=0,r=0;r<e;r++)for(var s=arguments[r],o=0,a=s.length;o<a;o++,n++)i[n]=s[o];return i}function lS(t,r,e){if(e||arguments.length===2)for(var i=0,n=r.length,s;i<n;i++)(s||!(i in r))&&(s||(s=Array.prototype.slice.call(r,0,i)),s[i]=r[i]);return t.concat(s||Array.prototype.slice.call(r))}function Ts(t){return this instanceof Ts?(this.v=t,this):new Ts(t)}function uS(t,r,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=e.apply(t,r||[]),n,s=[];return n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n;function o(d){i[d]&&(n[d]=function(h){return new Promise(function(f,g){s.push([d,h,f,g])>1||a(d,h)})})}function a(d,h){try{l(i[d](h))}catch(f){p(s[0][3],f)}}function l(d){d.value instanceof Ts?Promise.resolve(d.value.v).then(u,c):p(s[0][2],d)}function u(d){a("next",d)}function c(d){a("throw",d)}function p(d,h){d(h),s.shift(),s.length&&a(s[0][0],s[0][1])}}function cS(t){var r,e;return r={},i("next"),i("throw",function(n){throw n}),i("return"),r[Symbol.iterator]=function(){return this},r;function i(n,s){r[n]=t[n]?function(o){return(e=!e)?{value:Ts(t[n](o)),done:!1}:s?s(o):o}:s}}function pS(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=t[Symbol.asyncIterator],e;return r?r.call(t):(t=typeof iu=="function"?iu(t):t[Symbol.iterator](),e={},i("next"),i("throw"),i("return"),e[Symbol.asyncIterator]=function(){return this},e);function i(s){e[s]=t[s]&&function(o){return new Promise(function(a,l){o=t[s](o),n(a,l,o.done,o.value)})}}function n(s,o,a,l){Promise.resolve(l).then(function(u){s({value:u,done:a})},o)}}function dS(t,r){return Object.defineProperty?Object.defineProperty(t,"raw",{value:r}):t.raw=r,t}function fS(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var e in t)e!=="default"&&Object.prototype.hasOwnProperty.call(t,e)&&nu(r,t,e);return lR(r,t),r}function hS(t){return t&&t.__esModule?t:{default:t}}function mS(t,r,e,i){if(e==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof r=="function"?t!==r||!i:!r.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?i:e==="a"?i.call(t):i?i.value:r.get(t)}function gS(t,r,e,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof r=="function"?t!==r||!n:!r.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,e):n?n.value=e:r.set(t,e),e}function yS(t,r){if(r===null||typeof r!="object"&&typeof r!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?r===t:t.has(r)}function bS(t,r,e){if(r!=null){if(typeof r!="object"&&typeof r!="function")throw new TypeError("Object expected.");var i;if(e){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=r[Symbol.asyncDispose]}if(i===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=r[Symbol.dispose]}if(typeof i!="function")throw new TypeError("Object not disposable.");t.stack.push({value:r,dispose:i,async:e})}else e&&t.stack.push({async:!0});return r}function DS(t){function r(i){t.error=t.hasError?new uR(i,t.error,"An error was suppressed during disposal."):i,t.hasError=!0}function e(){for(;t.stack.length;){var i=t.stack.pop();try{var n=i.dispose&&i.dispose.call(i.value);if(i.async)return Promise.resolve(n).then(e,function(s){return r(s),e()})}catch(s){r(s)}}if(t.hasError)throw t.error}return e()}var lf,ru,nu,lR,uR,cR,ci=Pm(()=>{lf=function(t,r){return lf=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])},lf(t,r)};ru=function(){return ru=Object.assign||function(r){for(var e,i=1,n=arguments.length;i<n;i++){e=arguments[i];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=e[s])}return r},ru.apply(this,arguments)};nu=Object.create?function(t,r,e,i){i===void 0&&(i=e);var n=Object.getOwnPropertyDescriptor(r,e);(!n||("get"in n?!r.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return r[e]}}),Object.defineProperty(t,i,n)}:function(t,r,e,i){i===void 0&&(i=e),t[i]=r[e]};lR=Object.create?function(t,r){Object.defineProperty(t,"default",{enumerable:!0,value:r})}:function(t,r){t.default=r};uR=typeof SuppressedError=="function"?SuppressedError:function(t,r,e){var i=new Error(e);return i.name="SuppressedError",i.error=t,i.suppressed=r,i};cR={__extends:QC,__assign:ru,__rest:ZC,__decorate:eS,__param:tS,__metadata:rS,__awaiter:iS,__generator:nS,__createBinding:nu,__exportStar:sS,__values:iu,__read:uf,__spread:oS,__spreadArrays:aS,__spreadArray:lS,__await:Ts,__asyncGenerator:uS,__asyncDelegator:cS,__asyncValues:pS,__makeTemplateObject:dS,__importStar:fS,__importDefault:hS,__classPrivateFieldGet:mS,__classPrivateFieldSet:gS,__classPrivateFieldIn:yS,__addDisposableResource:bS,__disposeResources:DS}});var xS=A(Or=>{Object.defineProperty(Or,"__esModule",{value:!0});Or.SpecialEventType=Or.RevenueProperty=Or.IdentifyOperation=void 0;var pR;(function(t){t.SET="$set",t.SET_ONCE="$setOnce",t.ADD="$add",t.APPEND="$append",t.PREPEND="$prepend",t.REMOVE="$remove",t.PREINSERT="$preInsert",t.POSTINSERT="$postInsert",t.UNSET="$unset",t.CLEAR_ALL="$clearAll"})(pR=Or.IdentifyOperation||(Or.IdentifyOperation={}));var dR;(function(t){t.REVENUE_PRODUCT_ID="$productId",t.REVENUE_QUANTITY="$quantity",t.REVENUE_PRICE="$price",t.REVENUE_TYPE="$revenueType",t.REVENUE="$revenue"})(dR=Or.RevenueProperty||(Or.RevenueProperty={}));var fR;(function(t){t.IDENTIFY="$identify",t.GROUP_IDENTIFY="$groupidentify",t.REVENUE="revenue_amount"})(fR=Or.SpecialEventType||(Or.SpecialEventType={}))});var ES=A(Ho=>{Object.defineProperty(Ho,"__esModule",{value:!0});Ho.LogLevel=void 0;var hR;(function(t){t[t.None=0]="None",t[t.Error=1]="Error",t[t.Warn=2]="Warn",t[t.Verbose=3]="Verbose",t[t.Debug=4]="Debug"})(hR=Ho.LogLevel||(Ho.LogLevel={}))});var CS=A(Jo=>{Object.defineProperty(Jo,"__esModule",{value:!0});Jo.PluginType=void 0;var mR;(function(t){t.BEFORE="before",t.ENRICHMENT="enrichment",t.DESTINATION="destination"})(mR=Jo.PluginType||(Jo.PluginType={}))});var SS=A(Yo=>{Object.defineProperty(Yo,"__esModule",{value:!0});Yo.ServerZone=void 0;var gR;(function(t){t.US="US",t.EU="EU",t.STAGING="STAGING"})(gR=Yo.ServerZone||(Yo.ServerZone={}))});var vS=A(Xo=>{Object.defineProperty(Xo,"__esModule",{value:!0});Xo.Status=void 0;var yR;(function(t){t.Unknown="unknown",t.Skipped="skipped",t.Success="success",t.RateLimit="rate_limit",t.PayloadTooLarge="payload_too_large",t.Invalid="invalid",t.Failed="failed",t.Timeout="Timeout",t.SystemError="SystemError"})(yR=Xo.Status||(Xo.Status={}))});var wS=A(Qo=>{Object.defineProperty(Qo,"__esModule",{value:!0});Qo.TransportType=void 0;var bR;(function(t){t.XHR="xhr",t.SendBeacon="beacon",t.Fetch="fetch"})(bR=Qo.TransportType||(Qo.TransportType={}))});var lr=A(xt=>{Object.defineProperty(xt,"__esModule",{value:!0});xt.TransportType=xt.Status=xt.ServerZone=xt.PluginType=xt.LogLevel=xt.RevenueProperty=xt.IdentifyOperation=xt.SpecialEventType=void 0;var cf=xS();Object.defineProperty(xt,"SpecialEventType",{enumerable:!0,get:function(){return cf.SpecialEventType}});Object.defineProperty(xt,"IdentifyOperation",{enumerable:!0,get:function(){return cf.IdentifyOperation}});Object.defineProperty(xt,"RevenueProperty",{enumerable:!0,get:function(){return cf.RevenueProperty}});var DR=ES();Object.defineProperty(xt,"LogLevel",{enumerable:!0,get:function(){return DR.LogLevel}});var xR=CS();Object.defineProperty(xt,"PluginType",{enumerable:!0,get:function(){return xR.PluginType}});var ER=SS();Object.defineProperty(xt,"ServerZone",{enumerable:!0,get:function(){return ER.ServerZone}});var CR=vS();Object.defineProperty(xt,"Status",{enumerable:!0,get:function(){return CR.Status}});var SR=wS();Object.defineProperty(xt,"TransportType",{enumerable:!0,get:function(){return SR.TransportType}})});var Zo=A(vt=>{Object.defineProperty(vt,"__esModule",{value:!0});vt.EU_AMPLITUDE_BATCH_SERVER_URL=vt.AMPLITUDE_BATCH_SERVER_URL=vt.EU_AMPLITUDE_SERVER_URL=vt.AMPLITUDE_SERVER_URL=vt.STORAGE_PREFIX=vt.AMPLITUDE_PREFIX=vt.UNSET_VALUE=void 0;vt.UNSET_VALUE="-";vt.AMPLITUDE_PREFIX="AMP";vt.STORAGE_PREFIX="".concat(vt.AMPLITUDE_PREFIX,"_unsent");vt.AMPLITUDE_SERVER_URL="https://api2.amplitude.com/2/httpapi";vt.EU_AMPLITUDE_SERVER_URL="https://api.eu.amplitude.com/2/httpapi";vt.AMPLITUDE_BATCH_SERVER_URL="https://api2.amplitude.com/batch";vt.EU_AMPLITUDE_BATCH_SERVER_URL="https://api.eu.amplitude.com/batch"});var pf=A(Bi=>{Object.defineProperty(Bi,"__esModule",{value:!0});Bi.isValidProperties=Bi.isValidObject=void 0;var vR=(ci(),Wt(ui)),wR=1e3,TR=function(t){if(Object.keys(t).length>wR)return!1;for(var r in t){var e=t[r];if(!(0,Bi.isValidProperties)(r,e))return!1}return!0};Bi.isValidObject=TR;var AR=function(t,r){var e,i;if(typeof t!="string")return!1;if(Array.isArray(r)){var n=!0;try{for(var s=vR.__values(r),o=s.next();!o.done;o=s.next()){var a=o.value;if(Array.isArray(a))return!1;if(typeof a=="object")n=n&&(0,Bi.isValidObject)(a);else if(!["number","string"].includes(typeof a))return!1;if(!n)return!1}}catch(l){e={error:l}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(e)throw e.error}}}else{if(r==null)return!1;if(typeof r=="object")return(0,Bi.isValidObject)(r);if(!["number","string","boolean"].includes(typeof r))return!1}return!0};Bi.isValidProperties=AR});var df=A(su=>{Object.defineProperty(su,"__esModule",{value:!0});su.Identify=void 0;var PR=(ci(),Wt(ui)),Zt=lr(),TS=Zo(),IR=pf(),_R=function(){function t(){this._propertySet=new Set,this._properties={}}return t.prototype.getUserProperties=function(){return PR.__assign({},this._properties)},t.prototype.set=function(r,e){return this._safeSet(Zt.IdentifyOperation.SET,r,e),this},t.prototype.setOnce=function(r,e){return this._safeSet(Zt.IdentifyOperation.SET_ONCE,r,e),this},t.prototype.append=function(r,e){return this._safeSet(Zt.IdentifyOperation.APPEND,r,e),this},t.prototype.prepend=function(r,e){return this._safeSet(Zt.IdentifyOperation.PREPEND,r,e),this},t.prototype.postInsert=function(r,e){return this._safeSet(Zt.IdentifyOperation.POSTINSERT,r,e),this},t.prototype.preInsert=function(r,e){return this._safeSet(Zt.IdentifyOperation.PREINSERT,r,e),this},t.prototype.remove=function(r,e){return this._safeSet(Zt.IdentifyOperation.REMOVE,r,e),this},t.prototype.add=function(r,e){return this._safeSet(Zt.IdentifyOperation.ADD,r,e),this},t.prototype.unset=function(r){return this._safeSet(Zt.IdentifyOperation.UNSET,r,TS.UNSET_VALUE),this},t.prototype.clearAll=function(){return this._properties={},this._properties[Zt.IdentifyOperation.CLEAR_ALL]=TS.UNSET_VALUE,this},t.prototype._safeSet=function(r,e,i){if(this._validate(r,e,i)){var n=this._properties[r];return n===void 0&&(n={},this._properties[r]=n),n[e]=i,this._propertySet.add(e),!0}return!1},t.prototype._validate=function(r,e,i){return this._properties[Zt.IdentifyOperation.CLEAR_ALL]!==void 0||this._propertySet.has(e)?!1:r===Zt.IdentifyOperation.ADD?typeof i=="number":r!==Zt.IdentifyOperation.UNSET&&r!==Zt.IdentifyOperation.REMOVE?(0,IR.isValidProperties)(e,i):!0},t}();su.Identify=_R});var ff=A(Dr=>{Object.defineProperty(Dr,"__esModule",{value:!0});Dr.createRevenueEvent=Dr.createGroupEvent=Dr.createGroupIdentifyEvent=Dr.createIdentifyEvent=Dr.createTrackEvent=void 0;var Rr=(ci(),Wt(ui)),ou=lr(),NR=df(),FR=function(t,r,e){var i=typeof t=="string"?{event_type:t}:t;return Rr.__assign(Rr.__assign(Rr.__assign({},i),e),r&&{event_properties:r})};Dr.createTrackEvent=FR;var kR=function(t,r){var e=Rr.__assign(Rr.__assign({},r),{event_type:ou.SpecialEventType.IDENTIFY,user_properties:t.getUserProperties()});return e};Dr.createIdentifyEvent=kR;var OR=function(t,r,e,i){var n,s=Rr.__assign(Rr.__assign({},i),{event_type:ou.SpecialEventType.GROUP_IDENTIFY,group_properties:e.getUserProperties(),groups:(n={},n[t]=r,n)});return s};Dr.createGroupIdentifyEvent=OR;var RR=function(t,r,e){var i,n=new NR.Identify;n.set(t,r);var s=Rr.__assign(Rr.__assign({},e),{event_type:ou.SpecialEventType.IDENTIFY,user_properties:n.getUserProperties(),groups:(i={},i[t]=r,i)});return s};Dr.createGroupEvent=RR;var LR=function(t,r){return Rr.__assign(Rr.__assign({},r),{event_type:ou.SpecialEventType.REVENUE,event_properties:t.getEventProperties()})};Dr.createRevenueEvent=LR});var lu=A(au=>{Object.defineProperty(au,"__esModule",{value:!0});au.buildResult=void 0;var MR=lr(),BR=function(t,r,e){return r===void 0&&(r=0),e===void 0&&(e=MR.Status.Unknown),{event:t,code:r,message:e}};au.buildResult=BR});var AS=A(cu=>{Object.defineProperty(cu,"__esModule",{value:!0});cu.Timeline=void 0;var _t=(ci(),Wt(ui)),uu=lr(),$R=lu(),UR=function(){function t(r){this.client=r,this.queue=[],this.applying=!1,this.plugins=[]}return t.prototype.register=function(r,e){return _t.__awaiter(this,void 0,void 0,function(){return _t.__generator(this,function(i){switch(i.label){case 0:return[4,r.setup(e,this.client)];case 1:return i.sent(),this.plugins.push(r),[2]}})})},t.prototype.deregister=function(r){var e;return _t.__awaiter(this,void 0,void 0,function(){var i,n;return _t.__generator(this,function(s){switch(s.label){case 0:return i=this.plugins.findIndex(function(o){return o.name===r}),n=this.plugins[i],this.plugins.splice(i,1),[4,(e=n.teardown)===null||e===void 0?void 0:e.call(n)];case 1:return s.sent(),[2]}})})},t.prototype.reset=function(r){this.applying=!1;var e=this.plugins;e.map(function(i){var n;return(n=i.teardown)===null||n===void 0?void 0:n.call(i)}),this.plugins=[],this.client=r},t.prototype.push=function(r){var e=this;return new Promise(function(i){e.queue.push([r,i]),e.scheduleApply(0)})},t.prototype.scheduleApply=function(r){var e=this;this.applying||(this.applying=!0,setTimeout(function(){e.apply(e.queue.shift()).then(function(){e.applying=!1,e.queue.length>0&&e.scheduleApply(0)})},r))},t.prototype.apply=function(r){return _t.__awaiter(this,void 0,void 0,function(){var e,i,n,s,o,a,l,h,f,u,c,p,d,h,f,g,m,y,b,C,D,x;return _t.__generator(this,function(E){switch(E.label){case 0:if(!r)return[2];e=_t.__read(r,1),i=e[0],n=_t.__read(r,2),s=n[1],o=this.plugins.filter(function(w){return w.type===uu.PluginType.BEFORE}),E.label=1;case 1:E.trys.push([1,6,7,8]),a=_t.__values(o),l=a.next(),E.label=2;case 2:return l.done?[3,5]:(h=l.value,[4,h.execute(_t.__assign({},i))]);case 3:if(f=E.sent(),f===null)return s({event:i,code:0,message:""}),[2];i=f,E.label=4;case 4:return l=a.next(),[3,2];case 5:return[3,8];case 6:return u=E.sent(),b={error:u},[3,8];case 7:try{l&&!l.done&&(C=a.return)&&C.call(a)}finally{if(b)throw b.error}return[7];case 8:c=this.plugins.filter(function(w){return w.type===uu.PluginType.ENRICHMENT}),E.label=9;case 9:E.trys.push([9,14,15,16]),p=_t.__values(c),d=p.next(),E.label=10;case 10:return d.done?[3,13]:(h=d.value,[4,h.execute(_t.__assign({},i))]);case 11:if(f=E.sent(),f===null)return s({event:i,code:0,message:""}),[2];i=f,E.label=12;case 12:return d=p.next(),[3,10];case 13:return[3,16];case 14:return g=E.sent(),D={error:g},[3,16];case 15:try{d&&!d.done&&(x=p.return)&&x.call(p)}finally{if(D)throw D.error}return[7];case 16:return m=this.plugins.filter(function(w){return w.type===uu.PluginType.DESTINATION}),y=m.map(function(w){var R=_t.__assign({},i);return w.execute(R).catch(function(M){return(0,$R.buildResult)(R,0,String(M))})}),Promise.all(y).then(function(w){var R=_t.__read(w,1),M=R[0];s(M)}),[2]}})})},t.prototype.flush=function(){return _t.__awaiter(this,void 0,void 0,function(){var r,e,i,n=this;return _t.__generator(this,function(s){switch(s.label){case 0:return r=this.queue,this.queue=[],[4,Promise.all(r.map(function(o){return n.apply(o)}))];case 1:return s.sent(),e=this.plugins.filter(function(o){return o.type===uu.PluginType.DESTINATION}),i=e.map(function(o){return o.flush&&o.flush()}),[4,Promise.all(i)];case 2:return s.sent(),[2]}})})},t}();cu.Timeline=UR});var hf=A(Nt=>{Object.defineProperty(Nt,"__esModule",{value:!0});Nt.CLIENT_NOT_INITIALIZED=Nt.INVALID_API_KEY=Nt.MISSING_API_KEY_MESSAGE=Nt.OPT_OUT_MESSAGE=Nt.MAX_RETRIES_EXCEEDED_MESSAGE=Nt.UNEXPECTED_ERROR_MESSAGE=Nt.SUCCESS_MESSAGE=void 0;Nt.SUCCESS_MESSAGE="Event tracked successfully";Nt.UNEXPECTED_ERROR_MESSAGE="Unexpected error occurred";Nt.MAX_RETRIES_EXCEEDED_MESSAGE="Event rejected due to exceeded retry count";Nt.OPT_OUT_MESSAGE="Event skipped due to optOut config";Nt.MISSING_API_KEY_MESSAGE="Event rejected due to missing API key";Nt.INVALID_API_KEY="Invalid API key";Nt.CLIENT_NOT_INITIALIZED="Client not initialized"});var mf=A(pu=>{Object.defineProperty(pu,"__esModule",{value:!0});pu.returnWrapper=void 0;var jR=function(t){return{promise:t||Promise.resolve()}};pu.returnWrapper=jR});var IS=A(du=>{Object.defineProperty(du,"__esModule",{value:!0});du.AmplitudeCore=void 0;var $i=(ci(),Wt(ui)),ea=ff(),qR=AS(),gf=lu(),PS=hf(),pi=mf(),KR=function(){function t(r){r===void 0&&(r="$default"),this.initializing=!1,this.q=[],this.dispatchQ=[],this.logEvent=this.track.bind(this),this.timeline=new qR.Timeline(this),this.name=r}return t.prototype._init=function(r){return $i.__awaiter(this,void 0,void 0,function(){return $i.__generator(this,function(e){switch(e.label){case 0:return this.config=r,this.timeline.reset(this),[4,this.runQueuedFunctions("q")];case 1:return e.sent(),[2]}})})},t.prototype.runQueuedFunctions=function(r){return $i.__awaiter(this,void 0,void 0,function(){var e,i,n,s,o,a,l;return $i.__generator(this,function(u){switch(u.label){case 0:e=this[r],this[r]=[],u.label=1;case 1:u.trys.push([1,6,7,8]),i=$i.__values(e),n=i.next(),u.label=2;case 2:return n.done?[3,5]:(s=n.value,[4,s()]);case 3:u.sent(),u.label=4;case 4:return n=i.next(),[3,2];case 5:return[3,8];case 6:return o=u.sent(),a={error:o},[3,8];case 7:try{n&&!n.done&&(l=i.return)&&l.call(i)}finally{if(a)throw a.error}return[7];case 8:return[2]}})})},t.prototype.track=function(r,e,i){var n=(0,ea.createTrackEvent)(r,e,i);return(0,pi.returnWrapper)(this.dispatch(n))},t.prototype.identify=function(r,e){var i=(0,ea.createIdentifyEvent)(r,e);return(0,pi.returnWrapper)(this.dispatch(i))},t.prototype.groupIdentify=function(r,e,i,n){var s=(0,ea.createGroupIdentifyEvent)(r,e,i,n);return(0,pi.returnWrapper)(this.dispatch(s))},t.prototype.setGroup=function(r,e,i){var n=(0,ea.createGroupEvent)(r,e,i);return(0,pi.returnWrapper)(this.dispatch(n))},t.prototype.revenue=function(r,e){var i=(0,ea.createRevenueEvent)(r,e);return(0,pi.returnWrapper)(this.dispatch(i))},t.prototype.add=function(r){return this.config?(0,pi.returnWrapper)(this.timeline.register(r,this.config)):(this.q.push(this.add.bind(this,r)),(0,pi.returnWrapper)())},t.prototype.remove=function(r){return this.config?(0,pi.returnWrapper)(this.timeline.deregister(r)):(this.q.push(this.remove.bind(this,r)),(0,pi.returnWrapper)())},t.prototype.dispatchWithCallback=function(r,e){if(!this.config)return e((0,gf.buildResult)(r,0,PS.CLIENT_NOT_INITIALIZED));this.process(r).then(e)},t.prototype.dispatch=function(r){return $i.__awaiter(this,void 0,void 0,function(){var e=this;return $i.__generator(this,function(i){return this.config?[2,this.process(r)]:[2,new Promise(function(n){e.dispatchQ.push(e.dispatchWithCallback.bind(e,r,n))})]})})},t.prototype.process=function(r){return $i.__awaiter(this,void 0,void 0,function(){var n,e,i,n;return $i.__generator(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),this.config.optOut?[2,(0,gf.buildResult)(r,0,PS.OPT_OUT_MESSAGE)]:[4,this.timeline.push(r)];case 1:return n=s.sent(),n.code===200?this.config.loggerProvider.log(n.message):this.config.loggerProvider.error(n.message),[2,n];case 2:return e=s.sent(),this.config.loggerProvider.error(e),i=String(e),n=(0,gf.buildResult)(r,0,i),[2,n];case 3:return[2]}})})},t.prototype.setOptOut=function(r){if(!this.config){this.q.push(this.setOptOut.bind(this,!!r));return}this.config.optOut=!!r},t.prototype.flush=function(){return(0,pi.returnWrapper)(this.timeline.flush())},t}();du.AmplitudeCore=KR});var _S=A(fu=>{Object.defineProperty(fu,"__esModule",{value:!0});fu.Revenue=void 0;var VR=(ci(),Wt(ui)),ta=lr(),zR=pf(),WR=function(){function t(){this.productId="",this.quantity=1,this.price=0}return t.prototype.setProductId=function(r){return this.productId=r,this},t.prototype.setQuantity=function(r){return r>0&&(this.quantity=r),this},t.prototype.setPrice=function(r){return this.price=r,this},t.prototype.setRevenueType=function(r){return this.revenueType=r,this},t.prototype.setRevenue=function(r){return this.revenue=r,this},t.prototype.setEventProperties=function(r){return(0,zR.isValidObject)(r)&&(this.properties=r),this},t.prototype.getEventProperties=function(){var r=this.properties?VR.__assign({},this.properties):{};return r[ta.RevenueProperty.REVENUE_PRODUCT_ID]=this.productId,r[ta.RevenueProperty.REVENUE_QUANTITY]=this.quantity,r[ta.RevenueProperty.REVENUE_PRICE]=this.price,r[ta.RevenueProperty.REVENUE_TYPE]=this.revenueType,r[ta.RevenueProperty.REVENUE]=this.revenue,r},t}();fu.Revenue=WR});var NS=A(hu=>{Object.defineProperty(hu,"__esModule",{value:!0});hu.chunk=void 0;var GR=function(t,r){var e=Math.max(r,1);return t.reduce(function(i,n,s){var o=Math.floor(s/e);return i[o]||(i[o]=[]),i[o].push(n),i},[])};hu.chunk=GR});var yf=A(gu=>{Object.defineProperty(gu,"__esModule",{value:!0});gu.Logger=void 0;var Vn=lr(),mu="Amplitude Logger ",HR=function(){function t(){this.logLevel=Vn.LogLevel.None}return t.prototype.disable=function(){this.logLevel=Vn.LogLevel.None},t.prototype.enable=function(r){r===void 0&&(r=Vn.LogLevel.Warn),this.logLevel=r},t.prototype.log=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];this.logLevel<Vn.LogLevel.Verbose||console.log("".concat(mu,"[Log]: ").concat(r.join(" ")))},t.prototype.warn=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];this.logLevel<Vn.LogLevel.Warn||console.warn("".concat(mu,"[Warn]: ").concat(r.join(" ")))},t.prototype.error=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];this.logLevel<Vn.LogLevel.Error||console.error("".concat(mu,"[Error]: ").concat(r.join(" ")))},t.prototype.debug=function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];this.logLevel<Vn.LogLevel.Debug||console.log("".concat(mu,"[Debug]: ").concat(r.join(" ")))},t}();gu.Logger=HR});var Df=A(Ft=>{Object.defineProperty(Ft,"__esModule",{value:!0});Ft.createServerConfig=Ft.getServerUrl=Ft.Config=Ft.getDefaultConfig=void 0;var bf=lr(),ra=Zo(),JR=yf(),YR=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:"$default_instance",logLevel:bf.LogLevel.Warn,loggerProvider:new JR.Logger,optOut:!1,serverUrl:ra.AMPLITUDE_SERVER_URL,serverZone:bf.ServerZone.US,useBatch:!1}};Ft.getDefaultConfig=YR;var XR=function(){function t(r){var e,i,n,s;this._optOut=!1;var o=(0,Ft.getDefaultConfig)();this.apiKey=r.apiKey,this.flushIntervalMillis=(e=r.flushIntervalMillis)!==null&&e!==void 0?e:o.flushIntervalMillis,this.flushMaxRetries=r.flushMaxRetries||o.flushMaxRetries,this.flushQueueSize=r.flushQueueSize||o.flushQueueSize,this.instanceName=r.instanceName||o.instanceName,this.loggerProvider=r.loggerProvider||o.loggerProvider,this.logLevel=(i=r.logLevel)!==null&&i!==void 0?i:o.logLevel,this.minIdLength=r.minIdLength,this.plan=r.plan,this.ingestionMetadata=r.ingestionMetadata,this.optOut=(n=r.optOut)!==null&&n!==void 0?n:o.optOut,this.serverUrl=r.serverUrl,this.serverZone=r.serverZone||o.serverZone,this.storageProvider=r.storageProvider,this.transportProvider=r.transportProvider,this.useBatch=(s=r.useBatch)!==null&&s!==void 0?s:o.useBatch,this.loggerProvider.enable(this.logLevel);var a=(0,Ft.createServerConfig)(r.serverUrl,r.serverZone,r.useBatch);this.serverZone=a.serverZone,this.serverUrl=a.serverUrl}return Object.defineProperty(t.prototype,"optOut",{get:function(){return this._optOut},set:function(r){this._optOut=r},enumerable:!1,configurable:!0}),t}();Ft.Config=XR;var QR=function(t,r){return t===bf.ServerZone.EU?r?ra.EU_AMPLITUDE_BATCH_SERVER_URL:ra.EU_AMPLITUDE_SERVER_URL:r?ra.AMPLITUDE_BATCH_SERVER_URL:ra.AMPLITUDE_SERVER_URL};Ft.getServerUrl=QR;var ZR=function(t,r,e){if(t===void 0&&(t=""),r===void 0&&(r=(0,Ft.getDefaultConfig)().serverZone),e===void 0&&(e=(0,Ft.getDefaultConfig)().useBatch),t)return{serverUrl:t,serverZone:void 0};var i=["US","EU"].includes(r)?r:(0,Ft.getDefaultConfig)().serverZone;return{serverZone:i,serverUrl:(0,Ft.getServerUrl)(i,e)}};Ft.createServerConfig=ZR});var FS=A(As=>{Object.defineProperty(As,"__esModule",{value:!0});As.Destination=As.getResponseBodyString=void 0;var tt=(ci(),Wt(ui)),ia=lr(),na=hf(),eL=Zo(),tL=NS(),rL=lu(),iL=Df();function nL(t){return t instanceof Error?t.message:String(t)}function sa(t){var r="";try{"body"in t&&(r=JSON.stringify(t.body))}catch{}return r}As.getResponseBodyString=sa;var sL=function(){function t(){this.name="amplitude",this.type=ia.PluginType.DESTINATION,this.retryTimeout=1e3,this.throttleTimeout=3e4,this.storageKey="",this.scheduled=null,this.queue=[]}return t.prototype.setup=function(r){var e;return tt.__awaiter(this,void 0,void 0,function(){var i,n=this;return tt.__generator(this,function(s){switch(s.label){case 0:return this.config=r,this.storageKey="".concat(eL.STORAGE_PREFIX,"_").concat(this.config.apiKey.substring(0,10)),[4,(e=this.config.storageProvider)===null||e===void 0?void 0:e.get(this.storageKey)];case 1:return i=s.sent(),this.saveEvents(),i&&i.length>0&&Promise.all(i.map(function(o){return n.execute(o)})).catch(),[2,Promise.resolve(void 0)]}})})},t.prototype.execute=function(r){var e=this;return new Promise(function(i){var n={event:r,attempts:0,callback:function(s){return i(s)},timeout:0};e.addToQueue(n)})},t.prototype.addToQueue=function(){for(var r=this,e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];var n=e.filter(function(s){return s.attempts<r.config.flushMaxRetries?(s.attempts+=1,!0):(r.fulfillRequest([s],500,na.MAX_RETRIES_EXCEEDED_MESSAGE),!1)});n.forEach(function(s){if(r.queue=r.queue.concat(s),s.timeout===0){r.schedule(r.config.flushIntervalMillis);return}setTimeout(function(){s.timeout=0,r.schedule(0)},s.timeout)}),this.saveEvents()},t.prototype.schedule=function(r){var e=this;this.scheduled||(this.scheduled=setTimeout(function(){e.flush(!0).then(function(){e.queue.length>0&&e.schedule(r)})},r))},t.prototype.flush=function(r){return r===void 0&&(r=!1),tt.__awaiter(this,void 0,void 0,function(){var e,i,n,s=this;return tt.__generator(this,function(o){switch(o.label){case 0:return e=[],i=[],this.queue.forEach(function(a){return a.timeout===0?e.push(a):i.push(a)}),this.queue=i,this.scheduled&&(clearTimeout(this.scheduled),this.scheduled=null),n=(0,tL.chunk)(e,this.config.flushQueueSize),[4,Promise.all(n.map(function(a){return s.send(a,r)}))];case 1:return o.sent(),[2]}})})},t.prototype.send=function(r,e){return e===void 0&&(e=!0),tt.__awaiter(this,void 0,void 0,function(){var i,n,s,o,a;return tt.__generator(this,function(l){switch(l.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(r,400,na.MISSING_API_KEY_MESSAGE)];i={api_key:this.config.apiKey,events:r.map(function(u){var c=u.event,p=c.extra,d=tt.__rest(c,["extra"]);return d}),options:{min_id_length:this.config.minIdLength}},l.label=1;case 1:return l.trys.push([1,3,,4]),n=(0,iL.createServerConfig)(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,[4,this.config.transportProvider.send(n,i)];case 2:return s=l.sent(),s===null?(this.fulfillRequest(r,0,na.UNEXPECTED_ERROR_MESSAGE),[2]):e?(this.handleResponse(s,r),[3,4]):("body"in s?this.fulfillRequest(r,s.statusCode,"".concat(s.status,": ").concat(sa(s))):this.fulfillRequest(r,s.statusCode,s.status),[2]);case 3:return o=l.sent(),this.config.loggerProvider.error(o),a=nL(o),this.fulfillRequest(r,0,a),[3,4];case 4:return[2]}})})},t.prototype.handleResponse=function(r,e){var i=r.status;switch(i){case ia.Status.Success:{this.handleSuccessResponse(r,e);break}case ia.Status.Invalid:{this.handleInvalidResponse(r,e);break}case ia.Status.PayloadTooLarge:{this.handlePayloadTooLargeResponse(r,e);break}case ia.Status.RateLimit:{this.handleRateLimitResponse(r,e);break}default:{this.config.loggerProvider.warn(`{code: 0, error: "Status '`.concat(i,"' provided for ").concat(e.length,' events"}')),this.handleOtherResponse(e);break}}},t.prototype.handleSuccessResponse=function(r,e){this.fulfillRequest(e,r.statusCode,na.SUCCESS_MESSAGE)},t.prototype.handleInvalidResponse=function(r,e){var i=this;if(r.body.missingField||r.body.error.startsWith(na.INVALID_API_KEY)){this.fulfillRequest(e,r.statusCode,r.body.error);return}var n=tt.__spreadArray(tt.__spreadArray(tt.__spreadArray(tt.__spreadArray([],tt.__read(Object.values(r.body.eventsWithInvalidFields)),!1),tt.__read(Object.values(r.body.eventsWithMissingFields)),!1),tt.__read(Object.values(r.body.eventsWithInvalidIdLengths)),!1),tt.__read(r.body.silencedEvents),!1).flat(),s=new Set(n),o=e.filter(function(a,l){if(s.has(l)){i.fulfillRequest([a],r.statusCode,r.body.error);return}return!0});o.length>0&&this.config.loggerProvider.warn(sa(r)),this.addToQueue.apply(this,tt.__spreadArray([],tt.__read(o),!1))},t.prototype.handlePayloadTooLargeResponse=function(r,e){if(e.length===1){this.fulfillRequest(e,r.statusCode,r.body.error);return}this.config.loggerProvider.warn(sa(r)),this.config.flushQueueSize/=2,this.addToQueue.apply(this,tt.__spreadArray([],tt.__read(e),!1))},t.prototype.handleRateLimitResponse=function(r,e){var i=this,n=Object.keys(r.body.exceededDailyQuotaUsers),s=Object.keys(r.body.exceededDailyQuotaDevices),o=r.body.throttledEvents,a=new Set(n),l=new Set(s),u=new Set(o),c=e.filter(function(p,d){if(p.event.user_id&&a.has(p.event.user_id)||p.event.device_id&&l.has(p.event.device_id)){i.fulfillRequest([p],r.statusCode,r.body.error);return}return u.has(d)&&(p.timeout=i.throttleTimeout),!0});c.length>0&&this.config.loggerProvider.warn(sa(r)),this.addToQueue.apply(this,tt.__spreadArray([],tt.__read(c),!1))},t.prototype.handleOtherResponse=function(r){var e=this;this.addToQueue.apply(this,tt.__spreadArray([],tt.__read(r.map(function(i){return i.timeout=i.attempts*e.retryTimeout,i})),!1))},t.prototype.fulfillRequest=function(r,e,i){this.saveEvents(),r.forEach(function(n){return n.callback((0,rL.buildResult)(n.event,e,i))})},t.prototype.saveEvents=function(){if(this.config.storageProvider){var r=Array.from(this.queue.map(function(e){return e.event}));this.config.storageProvider.set(this.storageKey,r)}},t}();As.Destination=sL});var kS=A(er=>{Object.defineProperty(er,"__esModule",{value:!0});er.debugWrapper=er.getClientStates=er.getValueByStringPath=er.getClientLogConfig=er.getStacktrace=void 0;var xf=(ci(),Wt(ui)),oL=lr(),aL=function(t){t===void 0&&(t=0);var r=new Error().stack||"";return r.split(`
|
|
112
|
+
`).slice(2+t).map(function(e){return e.trim()})};er.getStacktrace=aL;var lL=function(t){return function(){var r=xf.__assign({},t.config),e=r.loggerProvider,i=r.logLevel;return{logger:e,logLevel:i}}};er.getClientLogConfig=lL;var uL=function(t,r){var e,i;r=r.replace(/\[(\w+)\]/g,".$1"),r=r.replace(/^\./,"");try{for(var n=xf.__values(r.split(".")),s=n.next();!s.done;s=n.next()){var o=s.value;if(o in t)t=t[o];else return}}catch(a){e={error:a}}finally{try{s&&!s.done&&(i=n.return)&&i.call(n)}finally{if(e)throw e.error}}return t};er.getValueByStringPath=uL;var cL=function(t,r){return function(){var e,i,n={};try{for(var s=xf.__values(r),o=s.next();!o.done;o=s.next()){var a=o.value;n[a]=(0,er.getValueByStringPath)(t,a)}}catch(l){e={error:l}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(e)throw e.error}}return n}};er.getClientStates=cL;var pL=function(t,r,e,i,n){return n===void 0&&(n=null),function(){for(var s=[],o=0;o<arguments.length;o++)s[o]=arguments[o];var a=e(),l=a.logger,u=a.logLevel;if(u&&u<oL.LogLevel.Debug||!u||!l)return t.apply(n,s);var c={type:"invoke public method",name:r,args:s,stacktrace:(0,er.getStacktrace)(1),time:{start:new Date().toISOString()},states:{}};i&&c.states&&(c.states.before=i());var p=t.apply(n,s);return p&&p.promise?p.promise.then(function(){i&&c.states&&(c.states.after=i()),c.time&&(c.time.end=new Date().toISOString()),l.debug(JSON.stringify(c,null,2))}):(i&&c.states&&(c.states.after=i()),c.time&&(c.time.end=new Date().toISOString()),l.debug(JSON.stringify(c,null,2))),p}};er.debugWrapper=pL});var OS=A(oa=>{Object.defineProperty(oa,"__esModule",{value:!0});oa.UUID=void 0;var dL=function(t){return t?(t^Math.random()*16>>t/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,oa.UUID)};oa.UUID=dL});var RS=A(yu=>{Object.defineProperty(yu,"__esModule",{value:!0});yu.MemoryStorage=void 0;var xr=(ci(),Wt(ui)),fL=function(){function t(){this.memoryStorage=new Map}return t.prototype.isEnabled=function(){return xr.__awaiter(this,void 0,void 0,function(){return xr.__generator(this,function(r){return[2,!0]})})},t.prototype.get=function(r){return xr.__awaiter(this,void 0,void 0,function(){return xr.__generator(this,function(e){return[2,this.memoryStorage.get(r)]})})},t.prototype.getRaw=function(r){return xr.__awaiter(this,void 0,void 0,function(){var e;return xr.__generator(this,function(i){switch(i.label){case 0:return[4,this.get(r)];case 1:return e=i.sent(),[2,e?JSON.stringify(e):void 0]}})})},t.prototype.set=function(r,e){return xr.__awaiter(this,void 0,void 0,function(){return xr.__generator(this,function(i){return this.memoryStorage.set(r,e),[2]})})},t.prototype.remove=function(r){return xr.__awaiter(this,void 0,void 0,function(){return xr.__generator(this,function(e){return this.memoryStorage.delete(r),[2]})})},t.prototype.reset=function(){return xr.__awaiter(this,void 0,void 0,function(){return xr.__generator(this,function(r){return this.memoryStorage.clear(),[2]})})},t}();yu.MemoryStorage=fL});var LS=A(bu=>{Object.defineProperty(bu,"__esModule",{value:!0});bu.BaseTransport=void 0;var Er=lr(),hL=function(){function t(){}return t.prototype.send=function(r,e){return Promise.resolve(null)},t.prototype.buildResponse=function(r){var e,i,n,s,o,a,l,u,c,p,d,h,f,g,m,y,b,C,D,x,E,w;if(typeof r!="object")return null;var R=r.code||0,M=this.buildStatus(R);switch(M){case Er.Status.Success:return{status:M,statusCode:R,body:{eventsIngested:(e=r.events_ingested)!==null&&e!==void 0?e:0,payloadSizeBytes:(i=r.payload_size_bytes)!==null&&i!==void 0?i:0,serverUploadTime:(n=r.server_upload_time)!==null&&n!==void 0?n:0}};case Er.Status.Invalid:return{status:M,statusCode:R,body:{error:(s=r.error)!==null&&s!==void 0?s:"",missingField:(o=r.missing_field)!==null&&o!==void 0?o:"",eventsWithInvalidFields:(a=r.events_with_invalid_fields)!==null&&a!==void 0?a:{},eventsWithMissingFields:(l=r.events_with_missing_fields)!==null&&l!==void 0?l:{},eventsWithInvalidIdLengths:(u=r.events_with_invalid_id_lengths)!==null&&u!==void 0?u:{},epsThreshold:(c=r.eps_threshold)!==null&&c!==void 0?c:0,exceededDailyQuotaDevices:(p=r.exceeded_daily_quota_devices)!==null&&p!==void 0?p:{},silencedDevices:(d=r.silenced_devices)!==null&&d!==void 0?d:[],silencedEvents:(h=r.silenced_events)!==null&&h!==void 0?h:[],throttledDevices:(f=r.throttled_devices)!==null&&f!==void 0?f:{},throttledEvents:(g=r.throttled_events)!==null&&g!==void 0?g:[]}};case Er.Status.PayloadTooLarge:return{status:M,statusCode:R,body:{error:(m=r.error)!==null&&m!==void 0?m:""}};case Er.Status.RateLimit:return{status:M,statusCode:R,body:{error:(y=r.error)!==null&&y!==void 0?y:"",epsThreshold:(b=r.eps_threshold)!==null&&b!==void 0?b:0,throttledDevices:(C=r.throttled_devices)!==null&&C!==void 0?C:{},throttledUsers:(D=r.throttled_users)!==null&&D!==void 0?D:{},exceededDailyQuotaDevices:(x=r.exceeded_daily_quota_devices)!==null&&x!==void 0?x:{},exceededDailyQuotaUsers:(E=r.exceeded_daily_quota_users)!==null&&E!==void 0?E:{},throttledEvents:(w=r.throttled_events)!==null&&w!==void 0?w:[]}};case Er.Status.Timeout:default:return{status:M,statusCode:R}}},t.prototype.buildStatus=function(r){return r>=200&&r<300?Er.Status.Success:r===429?Er.Status.RateLimit:r===413?Er.Status.PayloadTooLarge:r===408?Er.Status.Timeout:r>=400&&r<500?Er.Status.Invalid:r>=500?Er.Status.Failed:Er.Status.Unknown},t}();bu.BaseTransport=hL});var Ps=A(Ee=>{Object.defineProperty(Ee,"__esModule",{value:!0});Ee.createIdentifyEvent=Ee.BaseTransport=Ee.MemoryStorage=Ee.UUID=Ee.getClientStates=Ee.getClientLogConfig=Ee.debugWrapper=Ee.returnWrapper=Ee.STORAGE_PREFIX=Ee.AMPLITUDE_PREFIX=Ee.Logger=Ee.Config=Ee.Destination=Ee.Revenue=Ee.Identify=Ee.AmplitudeCore=void 0;var mL=IS();Object.defineProperty(Ee,"AmplitudeCore",{enumerable:!0,get:function(){return mL.AmplitudeCore}});var gL=df();Object.defineProperty(Ee,"Identify",{enumerable:!0,get:function(){return gL.Identify}});var yL=_S();Object.defineProperty(Ee,"Revenue",{enumerable:!0,get:function(){return yL.Revenue}});var bL=FS();Object.defineProperty(Ee,"Destination",{enumerable:!0,get:function(){return bL.Destination}});var DL=Df();Object.defineProperty(Ee,"Config",{enumerable:!0,get:function(){return DL.Config}});var xL=yf();Object.defineProperty(Ee,"Logger",{enumerable:!0,get:function(){return xL.Logger}});var MS=Zo();Object.defineProperty(Ee,"AMPLITUDE_PREFIX",{enumerable:!0,get:function(){return MS.AMPLITUDE_PREFIX}});Object.defineProperty(Ee,"STORAGE_PREFIX",{enumerable:!0,get:function(){return MS.STORAGE_PREFIX}});var EL=mf();Object.defineProperty(Ee,"returnWrapper",{enumerable:!0,get:function(){return EL.returnWrapper}});var Ef=kS();Object.defineProperty(Ee,"debugWrapper",{enumerable:!0,get:function(){return Ef.debugWrapper}});Object.defineProperty(Ee,"getClientLogConfig",{enumerable:!0,get:function(){return Ef.getClientLogConfig}});Object.defineProperty(Ee,"getClientStates",{enumerable:!0,get:function(){return Ef.getClientStates}});var CL=OS();Object.defineProperty(Ee,"UUID",{enumerable:!0,get:function(){return CL.UUID}});var SL=RS();Object.defineProperty(Ee,"MemoryStorage",{enumerable:!0,get:function(){return SL.MemoryStorage}});var vL=LS();Object.defineProperty(Ee,"BaseTransport",{enumerable:!0,get:function(){return vL.BaseTransport}});var wL=ff();Object.defineProperty(Ee,"createIdentifyEvent",{enumerable:!0,get:function(){return wL.createIdentifyEvent}})});var BS=A(Du=>{Object.defineProperty(Du,"__esModule",{value:!0});Du.VERSION=void 0;Du.VERSION="1.3.5"});var $S=A(xu=>{Object.defineProperty(xu,"__esModule",{value:!0});xu.Context=void 0;var Cf=(Go(),Wt(Wo)),TL=lr(),AL=Ps(),PL=BS(),IL=function(){function t(){this.name="context",this.type=TL.PluginType.BEFORE,this.eventId=0,this.library="amplitude-node-ts/".concat(PL.VERSION)}return t.prototype.setup=function(r){return this.config=r,Promise.resolve(void 0)},t.prototype.execute=function(r){var e=this;return new Promise(function(i){var n=new Date().getTime(),s=Cf.__assign(Cf.__assign(Cf.__assign({time:n,insert_id:(0,AL.UUID)(),plan:e.config.plan},e.config.ingestionMetadata&&{ingestion_metadata:{source_name:e.config.ingestionMetadata.sourceName,source_version:e.config.ingestionMetadata.sourceVersion}}),r),{event_id:e.eventId++,library:e.library});return i(s)})},t}();xu.Context=IL});var US=A(Eu=>{Object.defineProperty(Eu,"__esModule",{value:!0});Eu.Http=void 0;var _L=(Go(),Wt(Wo)),NL=Ps(),FL=require("http"),kL=require("https"),OL=function(t){_L.__extends(r,t);function r(){return t!==null&&t.apply(this,arguments)||this}return r.prototype.send=function(e,i){var n=this,s;if(e.startsWith("http://"))s=FL;else if(e.startsWith("https://"))s=kL;else throw new Error("Invalid server url");var o=new URL(e),a=JSON.stringify(i),l={headers:{"Content-Type":"application/json","Content-Length":Buffer.byteLength(a)},hostname:o.hostname,method:"POST",path:o.pathname,port:o.port,protocol:o.protocol};return new Promise(function(u){var c=s.request(l,function(p){p.setEncoding("utf8");var d="";p.on("data",function(h){d+=h}),p.on("end",function(){if(p.complete&&d.length>0)try{var h=JSON.parse(d),f=n.buildResponse(h);u(f);return}catch{u(null)}})});c.on("error",function(){return u(null)}),c.end(a)})},r}(NL.BaseTransport);Eu.Http=OL});var qS=A(Is=>{Object.defineProperty(Is,"__esModule",{value:!0});Is.useNodeConfig=Is.NodeConfig=void 0;var Sf=(Go(),Wt(Wo)),RL=Ps(),LL=US(),jS=function(t){Sf.__extends(r,t);function r(e,i){return t.call(this,Sf.__assign(Sf.__assign({transportProvider:new LL.Http},i),{apiKey:e}))||this}return r}(RL.Config);Is.NodeConfig=jS;var ML=function(t,r){return new jS(t,r)};Is.useNodeConfig=ML});var vf=A(mn=>{Object.defineProperty(mn,"__esModule",{value:!0});mn.createInstance=mn.AmplitudeNode=void 0;var _s=(Go(),Wt(Wo)),ye=Ps(),BL=$S(),$L=qS(),KS=function(t){_s.__extends(r,t);function r(){return t!==null&&t.apply(this,arguments)||this}return r.prototype.init=function(e,i){return e===void 0&&(e=""),(0,ye.returnWrapper)(this._init(_s.__assign(_s.__assign({},i),{apiKey:e})))},r.prototype._init=function(e){return _s.__awaiter(this,void 0,void 0,function(){var i;return _s.__generator(this,function(n){switch(n.label){case 0:return this.initializing?[2]:(this.initializing=!0,i=(0,$L.useNodeConfig)(e.apiKey,_s.__assign({},e)),[4,t.prototype._init.call(this,i)]);case 1:return n.sent(),[4,this.add(new ye.Destination).promise];case 2:return n.sent(),[4,this.add(new BL.Context).promise];case 3:return n.sent(),this.initializing=!1,[4,this.runQueuedFunctions("dispatchQ")];case 4:return n.sent(),[2]}})})},r}(ye.AmplitudeCore);mn.AmplitudeNode=KS;var UL=function(){var t=new KS;return{init:(0,ye.debugWrapper)(t.init.bind(t),"init",(0,ye.getClientLogConfig)(t),(0,ye.getClientStates)(t,["config"])),add:(0,ye.debugWrapper)(t.add.bind(t),"add",(0,ye.getClientLogConfig)(t),(0,ye.getClientStates)(t,["config.apiKey","timeline.plugins"])),remove:(0,ye.debugWrapper)(t.remove.bind(t),"remove",(0,ye.getClientLogConfig)(t),(0,ye.getClientStates)(t,["config.apiKey","timeline.plugins"])),track:(0,ye.debugWrapper)(t.track.bind(t),"track",(0,ye.getClientLogConfig)(t),(0,ye.getClientStates)(t,["config.apiKey","timeline.queue.length"])),logEvent:(0,ye.debugWrapper)(t.logEvent.bind(t),"logEvent",(0,ye.getClientLogConfig)(t),(0,ye.getClientStates)(t,["config.apiKey","timeline.queue.length"])),identify:(0,ye.debugWrapper)(t.identify.bind(t),"identify",(0,ye.getClientLogConfig)(t),(0,ye.getClientStates)(t,["config.apiKey","timeline.queue.length"])),groupIdentify:(0,ye.debugWrapper)(t.groupIdentify.bind(t),"groupIdentify",(0,ye.getClientLogConfig)(t),(0,ye.getClientStates)(t,["config.apiKey","timeline.queue.length"])),setGroup:(0,ye.debugWrapper)(t.setGroup.bind(t),"setGroup",(0,ye.getClientLogConfig)(t),(0,ye.getClientStates)(t,["config.apiKey","timeline.queue.length"])),revenue:(0,ye.debugWrapper)(t.revenue.bind(t),"revenue",(0,ye.getClientLogConfig)(t),(0,ye.getClientStates)(t,["config.apiKey","timeline.queue.length"])),flush:(0,ye.debugWrapper)(t.flush.bind(t),"flush",(0,ye.getClientLogConfig)(t),(0,ye.getClientStates)(t,["config.apiKey","timeline.queue.length"])),setOptOut:(0,ye.debugWrapper)(t.setOptOut.bind(t),"setOptOut",(0,ye.getClientLogConfig)(t),(0,ye.getClientStates)(t,["config"]))}};mn.createInstance=UL;mn.default=(0,mn.createInstance)()});var Cu=A(ve=>{Object.defineProperty(ve,"__esModule",{value:!0});ve.Types=ve.Identify=ve.Revenue=ve.flush=ve.track=ve.setOptOut=ve.setGroup=ve.revenue=ve.remove=ve.logEvent=ve.init=ve.identify=ve.groupIdentify=ve.add=ve.createInstance=void 0;var Lr=vf(),jL=vf();Object.defineProperty(ve,"createInstance",{enumerable:!0,get:function(){return jL.createInstance}});ve.add=Lr.default.add,ve.groupIdentify=Lr.default.groupIdentify,ve.identify=Lr.default.identify,ve.init=Lr.default.init,ve.logEvent=Lr.default.logEvent,ve.remove=Lr.default.remove,ve.revenue=Lr.default.revenue,ve.setGroup=Lr.default.setGroup,ve.setOptOut=Lr.default.setOptOut,ve.track=Lr.default.track,ve.flush=Lr.default.flush;var VS=Ps();Object.defineProperty(ve,"Revenue",{enumerable:!0,get:function(){return VS.Revenue}});Object.defineProperty(ve,"Identify",{enumerable:!0,get:function(){return VS.Identify}});ve.Types=lr()});var GS=A(wf=>{var WS="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");wf.encode=function(t){if(0<=t&&t<WS.length)return WS[t];throw new TypeError("Must be between 0 and 63: "+t)};wf.decode=function(t){var r=65,e=90,i=97,n=122,s=48,o=57,a=43,l=47,u=26,c=52;return r<=t&&t<=e?t-r:i<=t&&t<=n?t-i+u:s<=t&&t<=o?t-s+c:t==a?62:t==l?63:-1}});var Pf=A(Af=>{var HS=GS(),Tf=5,JS=1<<Tf,YS=JS-1,XS=JS;function KL(t){return t<0?(-t<<1)+1:(t<<1)+0}function VL(t){var r=(t&1)===1,e=t>>1;return r?-e:e}Af.encode=function(r){var e="",i,n=KL(r);do i=n&YS,n>>>=Tf,n>0&&(i|=XS),e+=HS.encode(i);while(n>0);return e};Af.decode=function(r,e,i){var n=r.length,s=0,o=0,a,l;do{if(e>=n)throw new Error("Expected more digits in base 64 VLQ value.");if(l=HS.decode(r.charCodeAt(e++)),l===-1)throw new Error("Invalid base64 digit: "+r.charAt(e-1));a=!!(l&XS),l&=YS,s=s+(l<<o),o+=Tf}while(a);i.value=VL(s),i.rest=e}});var Fs=A(Et=>{function zL(t,r,e){if(r in t)return t[r];if(arguments.length===3)return e;throw new Error('"'+r+'" is a required argument.')}Et.getArg=zL;var QS=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,WL=/^data:.+\,.+$/;function aa(t){var r=t.match(QS);return r?{scheme:r[1],auth:r[2],host:r[3],port:r[4],path:r[5]}:null}Et.urlParse=aa;function Ns(t){var r="";return t.scheme&&(r+=t.scheme+":"),r+="//",t.auth&&(r+=t.auth+"@"),t.host&&(r+=t.host),t.port&&(r+=":"+t.port),t.path&&(r+=t.path),r}Et.urlGenerate=Ns;var GL=32;function HL(t){var r=[];return function(e){for(var i=0;i<r.length;i++)if(r[i].input===e){var n=r[0];return r[0]=r[i],r[i]=n,r[0].result}var s=t(e);return r.unshift({input:e,result:s}),r.length>GL&&r.pop(),s}}var If=HL(function(r){var e=r,i=aa(r);if(i){if(!i.path)return r;e=i.path}for(var n=Et.isAbsolute(e),s=[],o=0,a=0;;)if(o=a,a=e.indexOf("/",o),a===-1){s.push(e.slice(o));break}else for(s.push(e.slice(o,a));a<e.length&&e[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 e=s.join("/"),e===""&&(e=n?"/":"."),i?(i.path=e,Ns(i)):e});Et.normalize=If;function ZS(t,r){t===""&&(t="."),r===""&&(r=".");var e=aa(r),i=aa(t);if(i&&(t=i.path||"/"),e&&!e.scheme)return i&&(e.scheme=i.scheme),Ns(e);if(e||r.match(WL))return r;if(i&&!i.host&&!i.path)return i.host=r,Ns(i);var n=r.charAt(0)==="/"?r:If(t.replace(/\/+$/,"")+"/"+r);return i?(i.path=n,Ns(i)):n}Et.join=ZS;Et.isAbsolute=function(t){return t.charAt(0)==="/"||QS.test(t)};function JL(t,r){t===""&&(t="."),t=t.replace(/\/$/,"");for(var e=0;r.indexOf(t+"/")!==0;){var i=t.lastIndexOf("/");if(i<0||(t=t.slice(0,i),t.match(/^([^\/]+:\/)?\/*$/)))return r;++e}return Array(e+1).join("../")+r.substr(t.length+1)}Et.relative=JL;var ev=function(){var t=Object.create(null);return!("__proto__"in t)}();function tv(t){return t}function YL(t){return rv(t)?"$"+t:t}Et.toSetString=ev?tv:YL;function XL(t){return rv(t)?t.slice(1):t}Et.fromSetString=ev?tv:XL;function rv(t){if(!t)return!1;var r=t.length;if(r<9||t.charCodeAt(r-1)!==95||t.charCodeAt(r-2)!==95||t.charCodeAt(r-3)!==111||t.charCodeAt(r-4)!==116||t.charCodeAt(r-5)!==111||t.charCodeAt(r-6)!==114||t.charCodeAt(r-7)!==112||t.charCodeAt(r-8)!==95||t.charCodeAt(r-9)!==95)return!1;for(var e=r-10;e>=0;e--)if(t.charCodeAt(e)!==36)return!1;return!0}function QL(t,r,e){var i=Ui(t.source,r.source);return i!==0||(i=t.originalLine-r.originalLine,i!==0)||(i=t.originalColumn-r.originalColumn,i!==0||e)||(i=t.generatedColumn-r.generatedColumn,i!==0)||(i=t.generatedLine-r.generatedLine,i!==0)?i:Ui(t.name,r.name)}Et.compareByOriginalPositions=QL;function ZL(t,r,e){var i;return i=t.originalLine-r.originalLine,i!==0||(i=t.originalColumn-r.originalColumn,i!==0||e)||(i=t.generatedColumn-r.generatedColumn,i!==0)||(i=t.generatedLine-r.generatedLine,i!==0)?i:Ui(t.name,r.name)}Et.compareByOriginalPositionsNoSource=ZL;function eM(t,r,e){var i=t.generatedLine-r.generatedLine;return i!==0||(i=t.generatedColumn-r.generatedColumn,i!==0||e)||(i=Ui(t.source,r.source),i!==0)||(i=t.originalLine-r.originalLine,i!==0)||(i=t.originalColumn-r.originalColumn,i!==0)?i:Ui(t.name,r.name)}Et.compareByGeneratedPositionsDeflated=eM;function tM(t,r,e){var i=t.generatedColumn-r.generatedColumn;return i!==0||e||(i=Ui(t.source,r.source),i!==0)||(i=t.originalLine-r.originalLine,i!==0)||(i=t.originalColumn-r.originalColumn,i!==0)?i:Ui(t.name,r.name)}Et.compareByGeneratedPositionsDeflatedNoLine=tM;function Ui(t,r){return t===r?0:t===null?1:r===null?-1:t>r?1:-1}function rM(t,r){var e=t.generatedLine-r.generatedLine;return e!==0||(e=t.generatedColumn-r.generatedColumn,e!==0)||(e=Ui(t.source,r.source),e!==0)||(e=t.originalLine-r.originalLine,e!==0)||(e=t.originalColumn-r.originalColumn,e!==0)?e:Ui(t.name,r.name)}Et.compareByGeneratedPositionsInflated=rM;function iM(t){return JSON.parse(t.replace(/^\)]}'[^\n]*\n/,""))}Et.parseSourceMapInput=iM;function nM(t,r,e){if(r=r||"",t&&(t[t.length-1]!=="/"&&r[0]!=="/"&&(t+="/"),r=t+r),e){var i=aa(e);if(!i)throw new Error("sourceMapURL could not be parsed");if(i.path){var n=i.path.lastIndexOf("/");n>=0&&(i.path=i.path.substring(0,n+1))}r=ZS(Ns(i),r)}return If(r)}Et.computeSourceURL=nM});var Ff=A(iv=>{var _f=Fs(),Nf=Object.prototype.hasOwnProperty,zn=typeof Map<"u";function ji(){this._array=[],this._set=zn?new Map:Object.create(null)}ji.fromArray=function(r,e){for(var i=new ji,n=0,s=r.length;n<s;n++)i.add(r[n],e);return i};ji.prototype.size=function(){return zn?this._set.size:Object.getOwnPropertyNames(this._set).length};ji.prototype.add=function(r,e){var i=zn?r:_f.toSetString(r),n=zn?this.has(r):Nf.call(this._set,i),s=this._array.length;(!n||e)&&this._array.push(r),n||(zn?this._set.set(r,s):this._set[i]=s)};ji.prototype.has=function(r){if(zn)return this._set.has(r);var e=_f.toSetString(r);return Nf.call(this._set,e)};ji.prototype.indexOf=function(r){if(zn){var e=this._set.get(r);if(e>=0)return e}else{var i=_f.toSetString(r);if(Nf.call(this._set,i))return this._set[i]}throw new Error('"'+r+'" is not in the set.')};ji.prototype.at=function(r){if(r>=0&&r<this._array.length)return this._array[r];throw new Error("No element indexed by "+r)};ji.prototype.toArray=function(){return this._array.slice()};iv.ArraySet=ji});var ov=A(sv=>{var nv=Fs();function sM(t,r){var e=t.generatedLine,i=r.generatedLine,n=t.generatedColumn,s=r.generatedColumn;return i>e||i==e&&s>=n||nv.compareByGeneratedPositionsInflated(t,r)<=0}function Su(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}Su.prototype.unsortedForEach=function(r,e){this._array.forEach(r,e)};Su.prototype.add=function(r){sM(this._last,r)?(this._last=r,this._array.push(r)):(this._sorted=!1,this._array.push(r))};Su.prototype.toArray=function(){return this._sorted||(this._array.sort(nv.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};sv.MappingList=Su});var kf=A(av=>{var la=Pf(),st=Fs(),vu=Ff().ArraySet,oM=ov().MappingList;function Cr(t){t||(t={}),this._file=st.getArg(t,"file",null),this._sourceRoot=st.getArg(t,"sourceRoot",null),this._skipValidation=st.getArg(t,"skipValidation",!1),this._ignoreInvalidMapping=st.getArg(t,"ignoreInvalidMapping",!1),this._sources=new vu,this._names=new vu,this._mappings=new oM,this._sourcesContents=null}Cr.prototype._version=3;Cr.fromSourceMap=function(r,e){var i=r.sourceRoot,n=new Cr(Object.assign(e||{},{file:r.file,sourceRoot:i}));return r.eachMapping(function(s){var o={generated:{line:s.generatedLine,column:s.generatedColumn}};s.source!=null&&(o.source=s.source,i!=null&&(o.source=st.relative(i,o.source)),o.original={line:s.originalLine,column:s.originalColumn},s.name!=null&&(o.name=s.name)),n.addMapping(o)}),r.sources.forEach(function(s){var o=s;i!==null&&(o=st.relative(i,s)),n._sources.has(o)||n._sources.add(o);var a=r.sourceContentFor(s);a!=null&&n.setSourceContent(s,a)}),n};Cr.prototype.addMapping=function(r){var e=st.getArg(r,"generated"),i=st.getArg(r,"original",null),n=st.getArg(r,"source",null),s=st.getArg(r,"name",null);!this._skipValidation&&this._validateMapping(e,i,n,s)===!1||(n!=null&&(n=String(n),this._sources.has(n)||this._sources.add(n)),s!=null&&(s=String(s),this._names.has(s)||this._names.add(s)),this._mappings.add({generatedLine:e.line,generatedColumn:e.column,originalLine:i!=null&&i.line,originalColumn:i!=null&&i.column,source:n,name:s}))};Cr.prototype.setSourceContent=function(r,e){var i=r;this._sourceRoot!=null&&(i=st.relative(this._sourceRoot,i)),e!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[st.toSetString(i)]=e):this._sourcesContents&&(delete this._sourcesContents[st.toSetString(i)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};Cr.prototype.applySourceMap=function(r,e,i){var n=e;if(e==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.`);n=r.file}var s=this._sourceRoot;s!=null&&(n=st.relative(s,n));var o=new vu,a=new vu;this._mappings.unsortedForEach(function(l){if(l.source===n&&l.originalLine!=null){var u=r.originalPositionFor({line:l.originalLine,column:l.originalColumn});u.source!=null&&(l.source=u.source,i!=null&&(l.source=st.join(i,l.source)),s!=null&&(l.source=st.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&&(i!=null&&(l=st.join(i,l)),s!=null&&(l=st.relative(s,l)),this.setSourceContent(l,u))},this)};Cr.prototype._validateMapping=function(r,e,i,n){if(e&&typeof e.line!="number"&&typeof e.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&&!e&&!i&&!n)){if(r&&"line"in r&&"column"in r&&e&&"line"in e&&"column"in e&&r.line>0&&r.column>=0&&e.line>0&&e.column>=0&&i)return;var s="Invalid mapping: "+JSON.stringify({generated:r,source:i,original:e,name:n});if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(s),!1;throw new Error(s)}};Cr.prototype._serializeMappings=function(){for(var r=0,e=1,i=0,n=0,s=0,o=0,a="",l,u,c,p,d=this._mappings.toArray(),h=0,f=d.length;h<f;h++){if(u=d[h],l="",u.generatedLine!==e)for(r=0;u.generatedLine!==e;)l+=";",e++;else if(h>0){if(!st.compareByGeneratedPositionsInflated(u,d[h-1]))continue;l+=","}l+=la.encode(u.generatedColumn-r),r=u.generatedColumn,u.source!=null&&(p=this._sources.indexOf(u.source),l+=la.encode(p-o),o=p,l+=la.encode(u.originalLine-1-n),n=u.originalLine-1,l+=la.encode(u.originalColumn-i),i=u.originalColumn,u.name!=null&&(c=this._names.indexOf(u.name),l+=la.encode(c-s),s=c)),a+=l}return a};Cr.prototype._generateSourcesContent=function(r,e){return r.map(function(i){if(!this._sourcesContents)return null;e!=null&&(i=st.relative(e,i));var n=st.toSetString(i);return Object.prototype.hasOwnProperty.call(this._sourcesContents,n)?this._sourcesContents[n]:null},this)};Cr.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};Cr.prototype.toString=function(){return JSON.stringify(this.toJSON())};av.SourceMapGenerator=Cr});var lv=A(Wn=>{Wn.GREATEST_LOWER_BOUND=1;Wn.LEAST_UPPER_BOUND=2;function Of(t,r,e,i,n,s){var o=Math.floor((r-t)/2)+t,a=n(e,i[o],!0);return a===0?o:a>0?r-o>1?Of(o,r,e,i,n,s):s==Wn.LEAST_UPPER_BOUND?r<i.length?r:-1:o:o-t>1?Of(t,o,e,i,n,s):s==Wn.LEAST_UPPER_BOUND?o:t<0?-1:t}Wn.search=function(r,e,i,n){if(e.length===0)return-1;var s=Of(-1,e.length,r,e,i,n||Wn.GREATEST_LOWER_BOUND);if(s<0)return-1;for(;s-1>=0&&i(e[s],e[s-1],!0)===0;)--s;return s}});var pv=A(cv=>{function aM(t){function r(n,s,o){var a=n[s];n[s]=n[o],n[o]=a}function e(n,s){return Math.round(n+Math.random()*(s-n))}function i(n,s,o,a){if(o<a){var l=e(o,a),u=o-1;r(n,l,a);for(var c=n[a],p=o;p<a;p++)s(n[p],c,!1)<=0&&(u+=1,r(n,u,p));r(n,u+1,p);var d=u+1;i(n,s,o,d-1),i(n,s,d+1,a)}}return i}function lM(t){let r=aM.toString();return new Function(`return ${r}`)()(t)}var uv=new WeakMap;cv.quickSort=function(t,r,e=0){let i=uv.get(r);i===void 0&&(i=lM(r),uv.set(r,i)),i(t,r,e,t.length-1)}});var hv=A(wu=>{var W=Fs(),Lf=lv(),ks=Ff().ArraySet,uM=Pf(),ua=pv().quickSort;function Ge(t,r){var e=t;return typeof t=="string"&&(e=W.parseSourceMapInput(t)),e.sections!=null?new Mr(e,r):new wt(e,r)}Ge.fromSourceMap=function(t,r){return wt.fromSourceMap(t,r)};Ge.prototype._version=3;Ge.prototype.__generatedMappings=null;Object.defineProperty(Ge.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}});Ge.prototype.__originalMappings=null;Object.defineProperty(Ge.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}});Ge.prototype._charIsMappingSeparator=function(r,e){var i=r.charAt(e);return i===";"||i===","};Ge.prototype._parseMappings=function(r,e){throw new Error("Subclasses must implement _parseMappings")};Ge.GENERATED_ORDER=1;Ge.ORIGINAL_ORDER=2;Ge.GREATEST_LOWER_BOUND=1;Ge.LEAST_UPPER_BOUND=2;Ge.prototype.eachMapping=function(r,e,i){var n=e||null,s=i||Ge.GENERATED_ORDER,o;switch(s){case Ge.GENERATED_ORDER:o=this._generatedMappings;break;case Ge.ORIGINAL_ORDER:o=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}for(var a=this.sourceRoot,l=r.bind(n),u=this._names,c=this._sources,p=this._sourceMapURL,d=0,h=o.length;d<h;d++){var f=o[d],g=f.source===null?null:c.at(f.source);g!==null&&(g=W.computeSourceURL(a,g,p)),l({source:g,generatedLine:f.generatedLine,generatedColumn:f.generatedColumn,originalLine:f.originalLine,originalColumn:f.originalColumn,name:f.name===null?null:u.at(f.name)})}};Ge.prototype.allGeneratedPositionsFor=function(r){var e=W.getArg(r,"line"),i={source:W.getArg(r,"source"),originalLine:e,originalColumn:W.getArg(r,"column",0)};if(i.source=this._findSourceIndex(i.source),i.source<0)return[];var n=[],s=this._findMapping(i,this._originalMappings,"originalLine","originalColumn",W.compareByOriginalPositions,Lf.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;)n.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===e&&o.originalColumn==l;)n.push({line:W.getArg(o,"generatedLine",null),column:W.getArg(o,"generatedColumn",null),lastColumn:W.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++s]}return n};wu.SourceMapConsumer=Ge;function wt(t,r){var e=t;typeof t=="string"&&(e=W.parseSourceMapInput(t));var i=W.getArg(e,"version"),n=W.getArg(e,"sources"),s=W.getArg(e,"names",[]),o=W.getArg(e,"sourceRoot",null),a=W.getArg(e,"sourcesContent",null),l=W.getArg(e,"mappings"),u=W.getArg(e,"file",null);if(i!=this._version)throw new Error("Unsupported version: "+i);o&&(o=W.normalize(o)),n=n.map(String).map(W.normalize).map(function(c){return o&&W.isAbsolute(o)&&W.isAbsolute(c)?W.relative(o,c):c}),this._names=ks.fromArray(s.map(String),!0),this._sources=ks.fromArray(n,!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}wt.prototype=Object.create(Ge.prototype);wt.prototype.consumer=Ge;wt.prototype._findSourceIndex=function(t){var r=t;if(this.sourceRoot!=null&&(r=W.relative(this.sourceRoot,r)),this._sources.has(r))return this._sources.indexOf(r);var e;for(e=0;e<this._absoluteSources.length;++e)if(this._absoluteSources[e]==t)return e;return-1};wt.fromSourceMap=function(r,e){var i=Object.create(wt.prototype),n=i._names=ks.fromArray(r._names.toArray(),!0),s=i._sources=ks.fromArray(r._sources.toArray(),!0);i.sourceRoot=r._sourceRoot,i.sourcesContent=r._generateSourcesContent(i._sources.toArray(),i.sourceRoot),i.file=r._file,i._sourceMapURL=e,i._absoluteSources=i._sources.toArray().map(function(h){return W.computeSourceURL(i.sourceRoot,h,e)});for(var o=r._mappings.toArray().slice(),a=i.__generatedMappings=[],l=i.__originalMappings=[],u=0,c=o.length;u<c;u++){var p=o[u],d=new fv;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=n.indexOf(p.name)),l.push(d)),a.push(d)}return ua(i.__originalMappings,W.compareByOriginalPositions),i};wt.prototype._version=3;Object.defineProperty(wt.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function fv(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}var Rf=W.compareByGeneratedPositionsDeflatedNoLine;function dv(t,r){let e=t.length,i=t.length-r;if(!(i<=1))if(i==2){let n=t[r],s=t[r+1];Rf(n,s)>0&&(t[r]=s,t[r+1]=n)}else if(i<20)for(let n=r;n<e;n++)for(let s=n;s>r;s--){let o=t[s-1],a=t[s];if(Rf(o,a)<=0)break;t[s-1]=a,t[s]=o}else ua(t,Rf,r)}wt.prototype._parseMappings=function(r,e){var i=1,n=0,s=0,o=0,a=0,l=0,u=r.length,c=0,p={},d={},h=[],f=[],g,m,y,b,C;let D=0;for(;c<u;)if(r.charAt(c)===";")i++,c++,n=0,dv(f,D),D=f.length;else if(r.charAt(c)===",")c++;else{for(g=new fv,g.generatedLine=i,b=c;b<u&&!this._charIsMappingSeparator(r,b);b++);for(m=r.slice(c,b),y=[];c<b;)uM.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(g.generatedColumn=n+y[0],n=g.generatedColumn,y.length>1&&(g.source=a+y[1],a+=y[1],g.originalLine=s+y[2],s=g.originalLine,g.originalLine+=1,g.originalColumn=o+y[3],o=g.originalColumn,y.length>4&&(g.name=l+y[4],l+=y[4])),f.push(g),typeof g.originalLine=="number"){let E=g.source;for(;h.length<=E;)h.push(null);h[E]===null&&(h[E]=[]),h[E].push(g)}}dv(f,D),this.__generatedMappings=f;for(var x=0;x<h.length;x++)h[x]!=null&&ua(h[x],W.compareByOriginalPositionsNoSource);this.__originalMappings=[].concat(...h)};wt.prototype._findMapping=function(r,e,i,n,s,o){if(r[i]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+r[i]);if(r[n]<0)throw new TypeError("Column must be greater than or equal to 0, got "+r[n]);return Lf.search(r,e,s,o)};wt.prototype.computeColumnSpans=function(){for(var r=0;r<this._generatedMappings.length;++r){var e=this._generatedMappings[r];if(r+1<this._generatedMappings.length){var i=this._generatedMappings[r+1];if(e.generatedLine===i.generatedLine){e.lastGeneratedColumn=i.generatedColumn-1;continue}}e.lastGeneratedColumn=1/0}};wt.prototype.originalPositionFor=function(r){var e={generatedLine:W.getArg(r,"line"),generatedColumn:W.getArg(r,"column")},i=this._findMapping(e,this._generatedMappings,"generatedLine","generatedColumn",W.compareByGeneratedPositionsDeflated,W.getArg(r,"bias",Ge.GREATEST_LOWER_BOUND));if(i>=0){var n=this._generatedMappings[i];if(n.generatedLine===e.generatedLine){var s=W.getArg(n,"source",null);s!==null&&(s=this._sources.at(s),s=W.computeSourceURL(this.sourceRoot,s,this._sourceMapURL));var o=W.getArg(n,"name",null);return o!==null&&(o=this._names.at(o)),{source:s,line:W.getArg(n,"originalLine",null),column:W.getArg(n,"originalColumn",null),name:o}}}return{source:null,line:null,column:null,name:null}};wt.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(r){return r==null}):!1};wt.prototype.sourceContentFor=function(r,e){if(!this.sourcesContent)return null;var i=this._findSourceIndex(r);if(i>=0)return this.sourcesContent[i];var n=r;this.sourceRoot!=null&&(n=W.relative(this.sourceRoot,n));var s;if(this.sourceRoot!=null&&(s=W.urlParse(this.sourceRoot))){var o=n.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("/"+n))return this.sourcesContent[this._sources.indexOf("/"+n)]}if(e)return null;throw new Error('"'+n+'" is not in the SourceMap.')};wt.prototype.generatedPositionFor=function(r){var e=W.getArg(r,"source");if(e=this._findSourceIndex(e),e<0)return{line:null,column:null,lastColumn:null};var i={source:e,originalLine:W.getArg(r,"line"),originalColumn:W.getArg(r,"column")},n=this._findMapping(i,this._originalMappings,"originalLine","originalColumn",W.compareByOriginalPositions,W.getArg(r,"bias",Ge.GREATEST_LOWER_BOUND));if(n>=0){var s=this._originalMappings[n];if(s.source===i.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}};wu.BasicSourceMapConsumer=wt;function Mr(t,r){var e=t;typeof t=="string"&&(e=W.parseSourceMapInput(t));var i=W.getArg(e,"version"),n=W.getArg(e,"sections");if(i!=this._version)throw new Error("Unsupported version: "+i);this._sources=new ks,this._names=new ks;var s={line:-1,column:0};this._sections=n.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 Ge(W.getArg(o,"map"),r)}})}Mr.prototype=Object.create(Ge.prototype);Mr.prototype.constructor=Ge;Mr.prototype._version=3;Object.defineProperty(Mr.prototype,"sources",{get:function(){for(var t=[],r=0;r<this._sections.length;r++)for(var e=0;e<this._sections[r].consumer.sources.length;e++)t.push(this._sections[r].consumer.sources[e]);return t}});Mr.prototype.originalPositionFor=function(r){var e={generatedLine:W.getArg(r,"line"),generatedColumn:W.getArg(r,"column")},i=Lf.search(e,this._sections,function(s,o){var a=s.generatedLine-o.generatedOffset.generatedLine;return a||s.generatedColumn-o.generatedOffset.generatedColumn}),n=this._sections[i];return n?n.consumer.originalPositionFor({line:e.generatedLine-(n.generatedOffset.generatedLine-1),column:e.generatedColumn-(n.generatedOffset.generatedLine===e.generatedLine?n.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,e){for(var i=0;i<this._sections.length;i++){var n=this._sections[i],s=n.consumer.sourceContentFor(r,!0);if(s||s==="")return s}if(e)return null;throw new Error('"'+r+'" is not in the SourceMap.')};Mr.prototype.generatedPositionFor=function(r){for(var e=0;e<this._sections.length;e++){var i=this._sections[e];if(i.consumer._findSourceIndex(W.getArg(r,"source"))!==-1){var n=i.consumer.generatedPositionFor(r);if(n){var s={line:n.line+(i.generatedOffset.generatedLine-1),column:n.column+(i.generatedOffset.generatedLine===n.line?i.generatedOffset.generatedColumn-1:0)};return s}}}return{line:null,column:null}};Mr.prototype._parseMappings=function(r,e){this.__generatedMappings=[],this.__originalMappings=[];for(var i=0;i<this._sections.length;i++)for(var n=this._sections[i],s=n.consumer._generatedMappings,o=0;o<s.length;o++){var a=s[o],l=n.consumer._sources.at(a.source);l!==null&&(l=W.computeSourceURL(n.consumer.sourceRoot,l,this._sourceMapURL)),this._sources.add(l),l=this._sources.indexOf(l);var u=null;a.name&&(u=n.consumer._names.at(a.name),this._names.add(u),u=this._names.indexOf(u));var c={source:l,generatedLine:a.generatedLine+(n.generatedOffset.generatedLine-1),generatedColumn:a.generatedColumn+(n.generatedOffset.generatedLine===a.generatedLine?n.generatedOffset.generatedColumn-1:0),originalLine:a.originalLine,originalColumn:a.originalColumn,name:u};this.__generatedMappings.push(c),typeof c.originalLine=="number"&&this.__originalMappings.push(c)}ua(this.__generatedMappings,W.compareByGeneratedPositionsDeflated),ua(this.__originalMappings,W.compareByOriginalPositions)};wu.IndexedSourceMapConsumer=Mr});var gv=A(mv=>{var cM=kf().SourceMapGenerator,Tu=Fs(),pM=/(\r?\n)/,dM=10,Os="$$$isSourceNode$$$";function ur(t,r,e,i,n){this.children=[],this.sourceContents={},this.line=t??null,this.column=r??null,this.source=e??null,this.name=n??null,this[Os]=!0,i!=null&&this.add(i)}ur.fromStringWithSourceMap=function(r,e,i){var n=new ur,s=r.split(pM),o=0,a=function(){var d=f(),h=f()||"";return d+h;function f(){return o<s.length?s[o++]:void 0}},l=1,u=0,c=null;return e.eachMapping(function(d){if(c!==null)if(l<d.generatedLine)p(c,a()),l++,u=0;else{var h=s[o]||"",f=h.substr(0,d.generatedColumn-u);s[o]=h.substr(d.generatedColumn-u),u=d.generatedColumn,p(c,f),c=d;return}for(;l<d.generatedLine;)n.add(a()),l++;if(u<d.generatedColumn){var h=s[o]||"";n.add(h.substr(0,d.generatedColumn)),s[o]=h.substr(d.generatedColumn),u=d.generatedColumn}c=d},this),o<s.length&&(c&&p(c,a()),n.add(s.splice(o).join(""))),e.sources.forEach(function(d){var h=e.sourceContentFor(d);h!=null&&(i!=null&&(d=Tu.join(i,d)),n.setSourceContent(d,h))}),n;function p(d,h){if(d===null||d.source===void 0)n.add(h);else{var f=i?Tu.join(i,d.source):d.source;n.add(new ur(d.originalLine,d.originalColumn,f,h,d.name))}}};ur.prototype.add=function(r){if(Array.isArray(r))r.forEach(function(e){this.add(e)},this);else if(r[Os]||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};ur.prototype.prepend=function(r){if(Array.isArray(r))for(var e=r.length-1;e>=0;e--)this.prepend(r[e]);else if(r[Os]||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};ur.prototype.walk=function(r){for(var e,i=0,n=this.children.length;i<n;i++)e=this.children[i],e[Os]?e.walk(r):e!==""&&r(e,{source:this.source,line:this.line,column:this.column,name:this.name})};ur.prototype.join=function(r){var e,i,n=this.children.length;if(n>0){for(e=[],i=0;i<n-1;i++)e.push(this.children[i]),e.push(r);e.push(this.children[i]),this.children=e}return this};ur.prototype.replaceRight=function(r,e){var i=this.children[this.children.length-1];return i[Os]?i.replaceRight(r,e):typeof i=="string"?this.children[this.children.length-1]=i.replace(r,e):this.children.push("".replace(r,e)),this};ur.prototype.setSourceContent=function(r,e){this.sourceContents[Tu.toSetString(r)]=e};ur.prototype.walkSourceContents=function(r){for(var e=0,i=this.children.length;e<i;e++)this.children[e][Os]&&this.children[e].walkSourceContents(r);for(var n=Object.keys(this.sourceContents),e=0,i=n.length;e<i;e++)r(Tu.fromSetString(n[e]),this.sourceContents[n[e]])};ur.prototype.toString=function(){var r="";return this.walk(function(e){r+=e}),r};ur.prototype.toStringWithSourceMap=function(r){var e={code:"",line:1,column:0},i=new cM(r),n=!1,s=null,o=null,a=null,l=null;return this.walk(function(u,c){e.code+=u,c.source!==null&&c.line!==null&&c.column!==null?((s!==c.source||o!==c.line||a!==c.column||l!==c.name)&&i.addMapping({source:c.source,original:{line:c.line,column:c.column},generated:{line:e.line,column:e.column},name:c.name}),s=c.source,o=c.line,a=c.column,l=c.name,n=!0):n&&(i.addMapping({generated:{line:e.line,column:e.column}}),s=null,n=!1);for(var p=0,d=u.length;p<d;p++)u.charCodeAt(p)===dM?(e.line++,e.column=0,p+1===d?(s=null,n=!1):n&&i.addMapping({source:c.source,original:{line:c.line,column:c.column},generated:{line:e.line,column:e.column},name:c.name})):e.column++}),this.walkSourceContents(function(u,c){i.setSourceContent(u,c)}),{code:e.code,map:i}};mv.SourceNode=ur});var yv=A(Au=>{Au.SourceMapGenerator=kf().SourceMapGenerator;Au.SourceMapConsumer=hv().SourceMapConsumer;Au.SourceNode=gv().SourceNode});var Hv=A(Da=>{"use strict";Object.defineProperty(Da,"__esModule",{value:!0});function fM(t,r){if(t==null)return{};var e={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(r.includes(i))continue;e[i]=t[i]}return e}var fi=class{constructor(r,e,i){this.line=void 0,this.column=void 0,this.index=void 0,this.line=r,this.column=e,this.index=i}},$s=class{constructor(r,e){this.start=void 0,this.end=void 0,this.filename=void 0,this.identifierName=void 0,this.start=r,this.end=e}};function jt(t,r){let{line:e,column:i,index:n}=t;return new fi(e,i+r,n+r)}var bv="BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED",hM={ImportMetaOutsideModule:{message:`import.meta may appear only with 'sourceType: "module"'`,code:bv},ImportOutsideModule:{message:`'import' and 'export' may appear only with 'sourceType: "module"'`,code:bv}},Dv={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"},_u=t=>t.type==="UpdateExpression"?Dv.UpdateExpression[`${t.prefix}`]:Dv[t.type],mM={AccessorIsGenerator:({kind:t})=>`A ${t}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:t})=>`Missing initializer in ${t} 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:t})=>`\`${t}\` has already been exported. Exported identifiers must be unique.`,DuplicateProto:"Redefinition of __proto__ property.",DuplicateRegExpFlags:"Duplicate regular expression flag.",DynamicImportPhaseRequiresImportExpressions:({phase:t})=>`'import.${t}(...)' can only be parsed when using the 'createImportExpressions' option.`,ElementAfterRest:"Rest element must be last element.",EscapedCharNotAnIdentifier:"Invalid Unicode escape.",ExportBindingIsString:({localName:t,exportName:r})=>`A string literal cannot be used as an exported binding without \`from\`.
|
|
113
113
|
- Did you mean \`export { '${t}' as '${r}' } from 'some-module'\`?`,ExportDefaultFromAsIdentifier:"'from' is not allowed as an identifier after 'export default'.",ForInOfLoopInitializer:({type:t})=>`'${t==="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:t})=>`Unsyntactic ${t==="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:t})=>`A string literal cannot be used as an imported binding.
|
|
114
114
|
- Did you mean \`import { "${t}" as foo }\`?`,ImportCallArgumentTrailingComma:"Trailing comma is disallowed inside import(...) arguments.",ImportCallArity:({maxArgumentCount:t})=>`\`import()\` requires exactly ${t===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:t})=>`Expected number in radix ${t}.`,InvalidEscapeSequence:"Bad character escape sequence.",InvalidEscapeSequenceTemplate:"Invalid escape sequence in template.",InvalidEscapedReservedWord:({reservedWord:t})=>`Escape sequence in keyword ${t}.`,InvalidIdentifier:({identifierName:t})=>`Invalid identifier ${t}.`,InvalidLhs:({ancestor:t})=>`Invalid left-hand side in ${_u(t)}.`,InvalidLhsBinding:({ancestor:t})=>`Binding invalid left-hand side in ${_u(t)}.`,InvalidLhsOptionalChaining:({ancestor:t})=>`Invalid optional chaining in the left-hand side of ${_u(t)}.`,InvalidNumber:"Invalid number.",InvalidOrMissingExponent:"Floating-point numbers require a valid exponent after the 'e'.",InvalidOrUnexpectedToken:({unexpected:t})=>`Unexpected character '${t}'.`,InvalidParenthesizedAssignment:"Invalid parenthesized assignment pattern.",InvalidPrivateFieldResolution:({identifierName:t})=>`Private name #${t} 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:t})=>`Label '${t}' 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:t})=>`This experimental syntax requires enabling the parser plugin: ${t.map(r=>JSON.stringify(r)).join(", ")}.`,MissingOneOfPlugins:({missingPlugin:t})=>`This experimental syntax requires enabling one of the following parser plugin(s): ${t.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:t})=>`Duplicate key "${t}" is not allowed in module attributes.`,ModuleExportNameHasLoneSurrogate:({surrogateCharCode:t})=>`An export name cannot include a lone surrogate, found '\\u${t.toString(16)}'.`,ModuleExportUndefined:({localName:t})=>`Export '${t}' 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:t})=>`Private names are only allowed in property accesses (\`obj.#${t}\`) or in \`in\` expressions (\`#${t} in obj\`).`,PrivateNameRedeclaration:({identifierName:t})=>`Duplicate private name #${t}.`,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:t})=>`Unexpected keyword '${t}'.`,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:t})=>`Unexpected reserved word '${t}'.`,UnexpectedSuper:"'super' is only allowed in object methods and classes.",UnexpectedToken:({expected:t,unexpected:r})=>`Unexpected token${r?` '${r}'.`:""}${t?`, expected "${t}"`:""}`,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:t,onlyValidPropertyName:r})=>`The only valid meta property for ${t} is ${t}.${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:t})=>`Identifier '${t}' 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."},gM={StrictDelete:"Deleting local variable in strict mode.",StrictEvalArguments:({referenceName:t})=>`Assigning to '${t}' in strict mode.`,StrictEvalArgumentsBinding:({bindingName:t})=>`Binding '${t}' 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."},yM=new Set(["ArrowFunctionExpression","AssignmentExpression","ConditionalExpression","YieldExpression"]),bM={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:t})=>`Invalid topic token ${t}. In order to use ${t} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${t}" }.`,PipeTopicUnused:"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.",PipeUnparenthesizedBody:({type:t})=>`Hack-style pipe body cannot be an unparenthesized ${_u({type:t})}; 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.'},DM=["message"];function xv(t,r,e){Object.defineProperty(t,r,{enumerable:!1,configurable:!0,value:e})}function xM({toMessage:t,code:r,reasonCode:e,syntaxPlugin:i}){let n=e==="MissingPlugin"||e==="MissingOneOfPlugins";{let s={AccessorCannotDeclareThisParameter:"AccesorCannotDeclareThisParameter",AccessorCannotHaveTypeParameters:"AccesorCannotHaveTypeParameters",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference",SetAccessorCannotHaveOptionalParameter:"SetAccesorCannotHaveOptionalParameter",SetAccessorCannotHaveRestParameter:"SetAccesorCannotHaveRestParameter",SetAccessorCannotHaveReturnType:"SetAccesorCannotHaveReturnType"};s[e]&&(e=s[e])}return function s(o,a){let l=new SyntaxError;return l.code=r,l.reasonCode=e,l.loc=o,l.pos=o.index,l.syntaxPlugin=i,n&&(l.missingPlugin=a.missingPlugin),xv(l,"clone",function(c={}){var p;let{line:d,column:h,index:f}=(p=c.loc)!=null?p:o;return s(new fi(d,h,f),Object.assign({},a,c.details))}),xv(l,"details",a),Object.defineProperty(l,"message",{configurable:!0,get(){let u=`${t(a)} (${o.line}:${o.column})`;return this.message=u,u},set(u){Object.defineProperty(this,"message",{value:u,writable:!0})}}),l}}function zi(t,r){if(Array.isArray(t))return i=>zi(i,t[0]);let e={};for(let i of Object.keys(t)){let n=t[i],s=typeof n=="string"?{message:()=>n}:typeof n=="function"?{message:n}:n,{message:o}=s,a=fM(s,DM),l=typeof o=="string"?()=>o:o;e[i]=xM(Object.assign({code:"BABEL_PARSER_SYNTAX_ERROR",reasonCode:i,toMessage:l},r?{syntaxPlugin:r}:{},a))}return e}var S=Object.assign({},zi(hM),zi(mM),zi(gM),zi`pipelineOperator`(bM)),{defineProperty:EM}=Object,Ev=(t,r)=>{t&&EM(t,r,{enumerable:!1,value:t[r]})};function ca(t){return Ev(t.loc.start,"index"),Ev(t.loc.end,"index"),t}var CM=t=>class extends t{parse(){let e=ca(super.parse());return this.options.tokens&&(e.tokens=e.tokens.map(ca)),e}parseRegExpLiteral({pattern:e,flags:i}){let n=null;try{n=new RegExp(e,i)}catch{}let s=this.estreeParseLiteral(n);return s.regex={pattern:e,flags:i},s}parseBigIntLiteral(e){let i;try{i=BigInt(e)}catch{i=null}let n=this.estreeParseLiteral(i);return n.bigint=String(n.value||e),n}parseDecimalLiteral(e){let n=this.estreeParseLiteral(null);return n.decimal=String(n.value||e),n}estreeParseLiteral(e){return this.parseLiteral(e,"Literal")}parseStringLiteral(e){return this.estreeParseLiteral(e)}parseNumericLiteral(e){return this.estreeParseLiteral(e)}parseNullLiteral(){return this.estreeParseLiteral(null)}parseBooleanLiteral(e){return this.estreeParseLiteral(e)}directiveToStmt(e){let i=e.value;delete e.value,i.type="Literal",i.raw=i.extra.raw,i.value=i.extra.expressionValue;let n=e;return n.type="ExpressionStatement",n.expression=i,n.directive=i.extra.rawValue,delete i.extra,n}initFunction(e,i){super.initFunction(e,i),e.expression=!1}checkDeclaration(e){e!=null&&this.isObjectProperty(e)?this.checkDeclaration(e.value):super.checkDeclaration(e)}getObjectOrClassMethodParams(e){return e.value.params}isValidDirective(e){var i;return e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&!((i=e.expression.extra)!=null&&i.parenthesized)}parseBlockBody(e,i,n,s,o){super.parseBlockBody(e,i,n,s,o);let a=e.directives.map(l=>this.directiveToStmt(l));e.body=a.concat(e.body),delete e.directives}pushClassMethod(e,i,n,s,o,a){this.parseMethod(i,n,s,o,a,"ClassMethod",!0),i.typeParameters&&(i.value.typeParameters=i.typeParameters,delete i.typeParameters),e.body.push(i)}parsePrivateName(){let e=super.parsePrivateName();return this.getPluginOption("estree","classFeatures")?this.convertPrivateNameToPrivateIdentifier(e):e}convertPrivateNameToPrivateIdentifier(e){let i=super.getPrivateNameSV(e);return e=e,delete e.id,e.name=i,e.type="PrivateIdentifier",e}isPrivateName(e){return this.getPluginOption("estree","classFeatures")?e.type==="PrivateIdentifier":super.isPrivateName(e)}getPrivateNameSV(e){return this.getPluginOption("estree","classFeatures")?e.name:super.getPrivateNameSV(e)}parseLiteral(e,i){let n=super.parseLiteral(e,i);return n.raw=n.extra.raw,delete n.extra,n}parseFunctionBody(e,i,n=!1){super.parseFunctionBody(e,i,n),e.expression=e.body.type!=="BlockStatement"}parseMethod(e,i,n,s,o,a,l=!1){let u=this.startNode();return u.kind=e.kind,u=super.parseMethod(u,i,n,s,o,a,l),u.type="FunctionExpression",delete u.kind,e.value=u,a==="ClassPrivateMethod"&&(e.computed=!1),this.finishNode(e,"MethodDefinition")}nameIsConstructor(e){return e.type==="Literal"?e.value==="constructor":super.nameIsConstructor(e)}parseClassProperty(...e){let i=super.parseClassProperty(...e);return this.getPluginOption("estree","classFeatures")&&(i.type="PropertyDefinition"),i}parseClassPrivateProperty(...e){let i=super.parseClassPrivateProperty(...e);return this.getPluginOption("estree","classFeatures")&&(i.type="PropertyDefinition",i.computed=!1),i}parseObjectMethod(e,i,n,s,o){let a=super.parseObjectMethod(e,i,n,s,o);return a&&(a.type="Property",a.kind==="method"&&(a.kind="init"),a.shorthand=!1),a}parseObjectProperty(e,i,n,s){let o=super.parseObjectProperty(e,i,n,s);return o&&(o.kind="init",o.type="Property"),o}isValidLVal(e,i,n){return e==="Property"?"value":super.isValidLVal(e,i,n)}isAssignable(e,i){return e!=null&&this.isObjectProperty(e)?this.isAssignable(e.value,i):super.isAssignable(e,i)}toAssignable(e,i=!1){if(e!=null&&this.isObjectProperty(e)){let{key:n,value:s}=e;this.isPrivateName(n)&&this.classScope.usePrivateName(this.getPrivateNameSV(n),n.loc.start),this.toAssignable(s,i)}else super.toAssignable(e,i)}toAssignableObjectExpressionProp(e,i,n){e.type==="Property"&&(e.kind==="get"||e.kind==="set")?this.raise(S.PatternHasAccessor,e.key):e.type==="Property"&&e.method?this.raise(S.PatternHasMethod,e.key):super.toAssignableObjectExpressionProp(e,i,n)}finishCallExpression(e,i){let n=super.finishCallExpression(e,i);if(n.callee.type==="Import"){if(n.type="ImportExpression",n.source=n.arguments[0],this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions")){var s,o;n.options=(s=n.arguments[1])!=null?s:null,n.attributes=(o=n.arguments[1])!=null?o:null}delete n.arguments,delete n.callee}return n}toReferencedArguments(e){e.type!=="ImportExpression"&&super.toReferencedArguments(e)}parseExport(e,i){let n=this.state.lastTokStartLoc,s=super.parseExport(e,i);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,n)}break}return s}parseSubscript(e,i,n,s){let o=super.parseSubscript(e,i,n,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(e){return e.type==="ChainExpression"?e.expression.type==="MemberExpression":super.isOptionalMemberExpression(e)}hasPropertyAsPrivateName(e){return e.type==="ChainExpression"&&(e=e.expression),super.hasPropertyAsPrivateName(e)}isObjectProperty(e){return e.type==="Property"&&e.kind==="init"&&!e.method}isObjectMethod(e){return e.type==="Property"&&(e.method||e.kind==="get"||e.kind==="set")}finishNodeAt(e,i,n){return ca(super.finishNodeAt(e,i,n))}resetStartLocation(e,i){super.resetStartLocation(e,i),ca(e)}resetEndLocation(e,i=this.state.lastTokEndLoc){super.resetEndLocation(e,i),ca(e)}},Hn=class{constructor(r,e){this.token=void 0,this.preserveSpace=void 0,this.token=r,this.preserveSpace=!!e}},Le={brace:new Hn("{"),j_oTag:new Hn("<tag"),j_cTag:new Hn("</tag"),j_expr:new Hn("<tag>...</tag>",!0)};Le.template=new Hn("`",!0);var fe=!0,U=!0,Mf=!0,pa=!0,gn=!0,SM=!0,ku=class{constructor(r,e={}){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=e.keyword,this.beforeExpr=!!e.beforeExpr,this.startsExpr=!!e.startsExpr,this.rightAssociative=!!e.rightAssociative,this.isLoop=!!e.isLoop,this.isAssign=!!e.isAssign,this.prefix=!!e.prefix,this.postfix=!!e.postfix,this.binop=e.binop!=null?e.binop:null,this.updateContext=null}},uh=new Map;function De(t,r={}){r.keyword=t;let e=J(t,r);return uh.set(t,e),e}function Ut(t,r){return J(t,{beforeExpr:fe,binop:r})}var ma=-1,Ki=[],ch=[],ph=[],dh=[],fh=[],hh=[];function J(t,r={}){var e,i,n,s;return++ma,ch.push(t),ph.push((e=r.binop)!=null?e:-1),dh.push((i=r.beforeExpr)!=null?i:!1),fh.push((n=r.startsExpr)!=null?n:!1),hh.push((s=r.prefix)!=null?s:!1),Ki.push(new ku(t,r)),ma}function de(t,r={}){var e,i,n,s;return++ma,uh.set(t,ma),ch.push(t),ph.push((e=r.binop)!=null?e:-1),dh.push((i=r.beforeExpr)!=null?i:!1),fh.push((n=r.startsExpr)!=null?n:!1),hh.push((s=r.prefix)!=null?s:!1),Ki.push(new ku("name",r)),ma}var vM={bracketL:J("[",{beforeExpr:fe,startsExpr:U}),bracketHashL:J("#[",{beforeExpr:fe,startsExpr:U}),bracketBarL:J("[|",{beforeExpr:fe,startsExpr:U}),bracketR:J("]"),bracketBarR:J("|]"),braceL:J("{",{beforeExpr:fe,startsExpr:U}),braceBarL:J("{|",{beforeExpr:fe,startsExpr:U}),braceHashL:J("#{",{beforeExpr:fe,startsExpr:U}),braceR:J("}"),braceBarR:J("|}"),parenL:J("(",{beforeExpr:fe,startsExpr:U}),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:U}),dollarBraceL:J("${",{beforeExpr:fe,startsExpr:U}),templateTail:J("...`",{startsExpr:U}),templateNonTail:J("...${",{beforeExpr:fe,startsExpr:U}),at:J("@"),hash:J("#",{startsExpr:U}),interpreterDirective:J("#!..."),eq:J("=",{beforeExpr:fe,isAssign:pa}),assign:J("_=",{beforeExpr:fe,isAssign:pa}),slashAssign:J("_=",{beforeExpr:fe,isAssign:pa}),xorAssign:J("_=",{beforeExpr:fe,isAssign:pa}),moduloAssign:J("_=",{beforeExpr:fe,isAssign:pa}),incDec:J("++/--",{prefix:gn,postfix:SM,startsExpr:U}),bang:J("!",{beforeExpr:fe,prefix:gn,startsExpr:U}),tilde:J("~",{beforeExpr:fe,prefix:gn,startsExpr:U}),doubleCaret:J("^^",{startsExpr:U}),doubleAt:J("@@",{startsExpr:U}),pipeline:Ut("|>",0),nullishCoalescing:Ut("??",1),logicalOR:Ut("||",1),logicalAND:Ut("&&",2),bitwiseOR:Ut("|",3),bitwiseXOR:Ut("^",4),bitwiseAND:Ut("&",5),equality:Ut("==/!=/===/!==",6),lt:Ut("</>/<=/>=",7),gt:Ut("</>/<=/>=",7),relational:Ut("</>/<=/>=",7),bitShift:Ut("<</>>/>>>",8),bitShiftL:Ut("<</>>/>>>",8),bitShiftR:Ut("<</>>/>>>",8),plusMin:J("+/-",{beforeExpr:fe,binop:9,prefix:gn,startsExpr:U}),modulo:J("%",{binop:10,startsExpr:U}),star:J("*",{binop:10}),slash:Ut("/",10),exponent:J("**",{beforeExpr:fe,binop:11,rightAssociative:!0}),_in:De("in",{beforeExpr:fe,binop:7}),_instanceof:De("instanceof",{beforeExpr:fe,binop:7}),_break:De("break"),_case:De("case",{beforeExpr:fe}),_catch:De("catch"),_continue:De("continue"),_debugger:De("debugger"),_default:De("default",{beforeExpr:fe}),_else:De("else",{beforeExpr:fe}),_finally:De("finally"),_function:De("function",{startsExpr:U}),_if:De("if"),_return:De("return",{beforeExpr:fe}),_switch:De("switch"),_throw:De("throw",{beforeExpr:fe,prefix:gn,startsExpr:U}),_try:De("try"),_var:De("var"),_const:De("const"),_with:De("with"),_new:De("new",{beforeExpr:fe,startsExpr:U}),_this:De("this",{startsExpr:U}),_super:De("super",{startsExpr:U}),_class:De("class",{startsExpr:U}),_extends:De("extends",{beforeExpr:fe}),_export:De("export"),_import:De("import",{startsExpr:U}),_null:De("null",{startsExpr:U}),_true:De("true",{startsExpr:U}),_false:De("false",{startsExpr:U}),_typeof:De("typeof",{beforeExpr:fe,prefix:gn,startsExpr:U}),_void:De("void",{beforeExpr:fe,prefix:gn,startsExpr:U}),_delete:De("delete",{beforeExpr:fe,prefix:gn,startsExpr:U}),_do:De("do",{isLoop:Mf,beforeExpr:fe}),_for:De("for",{isLoop:Mf}),_while:De("while",{isLoop:Mf}),_as:de("as",{startsExpr:U}),_assert:de("assert",{startsExpr:U}),_async:de("async",{startsExpr:U}),_await:de("await",{startsExpr:U}),_defer:de("defer",{startsExpr:U}),_from:de("from",{startsExpr:U}),_get:de("get",{startsExpr:U}),_let:de("let",{startsExpr:U}),_meta:de("meta",{startsExpr:U}),_of:de("of",{startsExpr:U}),_sent:de("sent",{startsExpr:U}),_set:de("set",{startsExpr:U}),_source:de("source",{startsExpr:U}),_static:de("static",{startsExpr:U}),_using:de("using",{startsExpr:U}),_yield:de("yield",{startsExpr:U}),_asserts:de("asserts",{startsExpr:U}),_checks:de("checks",{startsExpr:U}),_exports:de("exports",{startsExpr:U}),_global:de("global",{startsExpr:U}),_implements:de("implements",{startsExpr:U}),_intrinsic:de("intrinsic",{startsExpr:U}),_infer:de("infer",{startsExpr:U}),_is:de("is",{startsExpr:U}),_mixins:de("mixins",{startsExpr:U}),_proto:de("proto",{startsExpr:U}),_require:de("require",{startsExpr:U}),_satisfies:de("satisfies",{startsExpr:U}),_keyof:de("keyof",{startsExpr:U}),_readonly:de("readonly",{startsExpr:U}),_unique:de("unique",{startsExpr:U}),_abstract:de("abstract",{startsExpr:U}),_declare:de("declare",{startsExpr:U}),_enum:de("enum",{startsExpr:U}),_module:de("module",{startsExpr:U}),_namespace:de("namespace",{startsExpr:U}),_interface:de("interface",{startsExpr:U}),_type:de("type",{startsExpr:U}),_opaque:de("opaque",{startsExpr:U}),name:J("name",{startsExpr:U}),string:J("string",{startsExpr:U}),num:J("num",{startsExpr:U}),bigint:J("bigint",{startsExpr:U}),decimal:J("decimal",{startsExpr:U}),regexp:J("regexp",{startsExpr:U}),privateName:J("#name",{startsExpr:U}),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(t){return t>=93&&t<=132}function wM(t){return t<=92}function Br(t){return t>=58&&t<=132}function kv(t){return t>=58&&t<=136}function TM(t){return dh[t]}function Kf(t){return fh[t]}function AM(t){return t>=29&&t<=33}function Cv(t){return t>=129&&t<=131}function PM(t){return t>=90&&t<=92}function mh(t){return t>=58&&t<=92}function IM(t){return t>=39&&t<=59}function _M(t){return t===34}function NM(t){return hh[t]}function FM(t){return t>=121&&t<=123}function kM(t){return t>=124&&t<=130}function bn(t){return ch[t]}function Nu(t){return ph[t]}function OM(t){return t===57}function Ou(t){return t>=24&&t<=25}function qi(t){return Ki[t]}Ki[8].updateContext=t=>{t.pop()},Ki[5].updateContext=Ki[7].updateContext=Ki[23].updateContext=t=>{t.push(Le.brace)},Ki[22].updateContext=t=>{t[t.length-1]===Le.template?t.pop():t.push(Le.template)},Ki[142].updateContext=t=>{t.push(Le.j_expr,Le.j_oTag)};var gh="\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",Ov="\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",RM=new RegExp("["+gh+"]"),LM=new RegExp("["+gh+Ov+"]");gh=Ov=null;var Rv=[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],MM=[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 Vf(t,r){let e=65536;for(let i=0,n=r.length;i<n;i+=2){if(e+=r[i],e>t)return!1;if(e+=r[i+1],e>=t)return!0}return!1}function Vi(t){return t<65?t===36:t<=90?!0:t<97?t===95:t<=122?!0:t<=65535?t>=170&&RM.test(String.fromCharCode(t)):Vf(t,Rv)}function Ls(t){return t<48?t===36:t<58?!0:t<65?!1:t<=90?!0:t<97?t===95:t<=122?!0:t<=65535?t>=170&&LM.test(String.fromCharCode(t)):Vf(t,Rv)||Vf(t,MM)}var yh={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"]},BM=new Set(yh.keyword),$M=new Set(yh.strict),UM=new Set(yh.strictBind);function Lv(t,r){return r&&t==="await"||t==="enum"}function Mv(t,r){return Lv(t,r)||$M.has(t)}function Bv(t){return UM.has(t)}function $v(t,r){return Mv(t,r)||Bv(t)}function jM(t){return BM.has(t)}function qM(t,r,e){return t===64&&r===64&&Vi(e)}var KM=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 VM(t){return KM.has(t)}var ga=class{constructor(r){this.flags=0,this.names=new Map,this.firstLexicalName="",this.flags=r}},ya=class{constructor(r,e){this.parser=void 0,this.scopeStack=[],this.inModule=void 0,this.undefinedExports=new Map,this.parser=r,this.inModule=e}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:e}=this.scopeStack[r];if(e&128)return!0;if(e&451)return!1}}get inNonArrowFunction(){return(this.currentThisScopeFlags()&2)>0}get treatFunctionsAsVar(){return this.treatFunctionsAsVarInScope(this.currentScope())}createScope(r){return new ga(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,e,i){let n=this.currentScope();if(e&8||e&16){this.checkRedeclarationInScope(n,r,e,i);let s=n.names.get(r)||0;e&16?s=s|4:(n.firstLexicalName||(n.firstLexicalName=r),s=s|2),n.names.set(r,s),e&8&&this.maybeExportDefined(n,r)}else if(e&4)for(let s=this.scopeStack.length-1;s>=0&&(n=this.scopeStack[s],this.checkRedeclarationInScope(n,r,e,i),n.names.set(r,(n.names.get(r)||0)|1),this.maybeExportDefined(n,r),!(n.flags&387));--s);this.parser.inModule&&n.flags&1&&this.undefinedExports.delete(r)}maybeExportDefined(r,e){this.parser.inModule&&r.flags&1&&this.undefinedExports.delete(e)}checkRedeclarationInScope(r,e,i,n){this.isRedeclaredInScope(r,e,i)&&this.parser.raise(S.VarRedeclaration,n,{identifierName:e})}isRedeclaredInScope(r,e,i){if(!(i&1))return!1;if(i&8)return r.names.has(e);let n=r.names.get(e);return i&16?(n&2)>0||!this.treatFunctionsAsVarInScope(r)&&(n&1)>0:(n&2)>0&&!(r.flags&8&&r.firstLexicalName===e)||!this.treatFunctionsAsVarInScope(r)&&(n&4)>0}checkLocalExport(r){let{name:e}=r;this.scopeStack[0].names.has(e)||this.undefinedExports.set(e,r.loc.start)}currentScope(){return this.scopeStack[this.scopeStack.length-1]}currentVarScopeFlags(){for(let r=this.scopeStack.length-1;;r--){let{flags:e}=this.scopeStack[r];if(e&387)return e}}currentThisScopeFlags(){for(let r=this.scopeStack.length-1;;r--){let{flags:e}=this.scopeStack[r];if(e&451&&!(e&4))return e}}},zf=class extends ga{constructor(...r){super(...r),this.declareFunctions=new Set}},Wf=class extends ya{createScope(r){return new zf(r)}declareName(r,e,i){let n=this.currentScope();if(e&2048){this.checkRedeclarationInScope(n,r,e,i),this.maybeExportDefined(n,r),n.declareFunctions.add(r);return}super.declareName(r,e,i)}isRedeclaredInScope(r,e,i){if(super.isRedeclaredInScope(r,e,i))return!0;if(i&2048&&!r.declareFunctions.has(e)){let n=r.names.get(e);return(n&4)>0||(n&2)>0}return!1}checkLocalExport(r){this.scopeStack[0].declareFunctions.has(r.name)||super.checkLocalExport(r)}},Gf=class{constructor(){this.sawUnambiguousESM=!1,this.ambiguousScriptDifferentAst=!1}hasPlugin(r){if(typeof r=="string")return this.plugins.has(r);{let[e,i]=r;if(!this.hasPlugin(e))return!1;let n=this.plugins.get(e);for(let s of Object.keys(i))if(n?.[s]!==i[s])return!1;return!0}}getPluginOption(r,e){var i;return(i=this.plugins.get(r))==null?void 0:i[e]}};function Uv(t,r){t.trailingComments===void 0?t.trailingComments=r:t.trailingComments.unshift(...r)}function zM(t,r){t.leadingComments===void 0?t.leadingComments=r:t.leadingComments.unshift(...r)}function ba(t,r){t.innerComments===void 0?t.innerComments=r:t.innerComments.unshift(...r)}function da(t,r,e){let i=null,n=r.length;for(;i===null&&n>0;)i=r[--n];i===null||i.start>e.start?ba(t,e.comments):Uv(i,e.comments)}var Hf=class extends Gf{addComment(r){this.filename&&(r.loc.filename=this.filename);let{commentsLen:e}=this.state;this.comments.length!==e&&(this.comments.length=e),this.comments.push(r),this.state.commentsLen++}processComment(r){let{commentStack:e}=this.state,i=e.length;if(i===0)return;let n=i-1,s=e[n];s.start===r.end&&(s.leadingNode=r,n--);let{start:o}=r;for(;n>=0;n--){let a=e[n],l=a.end;if(l>o)a.containingNode=r,this.finalizeComment(a),e.splice(n,1);else{l===o&&(a.trailingNode=r);break}}}finalizeComment(r){let{comments:e}=r;if(r.leadingNode!==null||r.trailingNode!==null)r.leadingNode!==null&&Uv(r.leadingNode,e),r.trailingNode!==null&&zM(r.trailingNode,e);else{let{containingNode:i,start:n}=r;if(this.input.charCodeAt(n-1)===44)switch(i.type){case"ObjectExpression":case"ObjectPattern":case"RecordExpression":da(i,i.properties,r);break;case"CallExpression":case"OptionalCallExpression":da(i,i.arguments,r);break;case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":case"ObjectMethod":case"ClassMethod":case"ClassPrivateMethod":da(i,i.params,r);break;case"ArrayExpression":case"ArrayPattern":case"TupleExpression":da(i,i.elements,r);break;case"ExportNamedDeclaration":case"ImportDeclaration":da(i,i.specifiers,r);break;default:ba(i,e)}else ba(i,e)}}finalizeRemainingComments(){let{commentStack:r}=this.state;for(let e=r.length-1;e>=0;e--)this.finalizeComment(r[e]);this.state.commentStack=[]}resetPreviousNodeTrailingComments(r){let{commentStack:e}=this.state,{length:i}=e;if(i===0)return;let n=e[i-1];n.leadingNode===r&&(n.leadingNode=null)}resetPreviousIdentifierLeadingComments(r){let{commentStack:e}=this.state,{length:i}=e;i!==0&&(e[i-1].trailingNode===r?e[i-1].trailingNode=null:i>=2&&e[i-2].trailingNode===r&&(e[i-2].trailingNode=null))}takeSurroundingComments(r,e,i){let{commentStack:n}=this.state,s=n.length;if(s===0)return;let o=s-1;for(;o>=0;o--){let a=n[o],l=a.end;if(a.start===i)a.leadingNode=r;else if(l===e)a.trailingNode=r;else if(l<e)break}}},WM=/\r\n|[\r\n\u2028\u2029]/,Pu=new RegExp(WM.source,"g");function Ms(t){switch(t){case 10:case 13:case 8232:case 8233:return!0;default:return!1}}function Sv(t,r,e){for(let i=r;i<e;i++)if(Ms(t.charCodeAt(i)))return!0;return!1}var Bf=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,$f=/(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g;function GM(t){switch(t){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 Jf=class t{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=[Le.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:e,startLine:i,startColumn:n}){this.strict=r===!1?!1:r===!0?!0:e==="module",this.curLine=i,this.lineStart=-n,this.startLoc=this.endLoc=new fi(i,n,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 fi(this.curLine,this.pos-this.lineStart,this.pos)}clone(){let r=new t;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}},HM=function(r){return r>=48&&r<=57},vv={decBinOct:new Set([46,66,69,79,95,98,101,111]),hex:new Set([46,88,95,120])},Iu={bin:t=>t===48||t===49,oct:t=>t>=48&&t<=55,dec:t=>t>=48&&t<=57,hex:t=>t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102};function wv(t,r,e,i,n,s){let o=e,a=i,l=n,u="",c=null,p=e,{length:d}=r;for(;;){if(e>=d){s.unterminated(o,a,l),u+=r.slice(p,e);break}let h=r.charCodeAt(e);if(JM(t,h,r,e)){u+=r.slice(p,e);break}if(h===92){u+=r.slice(p,e);let f=YM(r,e,i,n,t==="template",s);f.ch===null&&!c?c={pos:e,lineStart:i,curLine:n}:u+=f.ch,{pos:e,lineStart:i,curLine:n}=f,p=e}else h===8232||h===8233?(++e,++n,i=e):h===10||h===13?t==="template"?(u+=r.slice(p,e)+`
|
|
115
115
|
`,++e,h===13&&r.charCodeAt(e)===10&&++e,++n,p=i=e):s.unterminated(o,a,l):++e}return{pos:e,str:u,firstInvalidLoc:c,lineStart:i,curLine:n,containsInvalid:!!c}}function JM(t,r,e,i){return t==="template"?r===96||r===36&&e.charCodeAt(i+1)===123:r===(t==="double"?34:39)}function YM(t,r,e,i,n,s){let o=!n;r++;let a=u=>({pos:r,ch:u,lineStart:e,curLine:i}),l=t.charCodeAt(r++);switch(l){case 110:return a(`
|
|
116
116
|
`);case 114:return a("\r");case 120:{let u;return{code:u,pos:r}=Yf(t,r,e,i,2,!1,o,s),a(u===null?null:String.fromCharCode(u))}case 117:{let u;return{code:u,pos:r}=qv(t,r,e,i,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:t.charCodeAt(r)===10&&++r;case 10:e=r,++i;case 8232:case 8233:return a("");case 56:case 57:if(n)return a(null);s.strictNumericEscape(r-1,e,i);default:if(l>=48&&l<=55){let u=r-1,p=/^[0-7]+/.exec(t.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 h=t.charCodeAt(r);if(p!=="0"||h===56||h===57){if(n)return a(null);s.strictNumericEscape(u,e,i)}return a(String.fromCharCode(d))}return a(String.fromCharCode(l))}}function Yf(t,r,e,i,n,s,o,a){let l=r,u;return{n:u,pos:r}=jv(t,r,e,i,16,n,s,!1,a,!o),u===null&&(o?a.invalidEscapeSequence(l,e,i):r=l-1),{code:u,pos:r}}function jv(t,r,e,i,n,s,o,a,l,u){let c=r,p=n===16?vv.hex:vv.decBinOct,d=n===16?Iu.hex:n===10?Iu.dec:n===8?Iu.oct:Iu.bin,h=!1,f=0;for(let g=0,m=s??1/0;g<m;++g){let y=t.charCodeAt(r),b;if(y===95&&a!=="bail"){let C=t.charCodeAt(r-1),D=t.charCodeAt(r+1);if(a){if(Number.isNaN(D)||!d(D)||p.has(C)||p.has(D)){if(u)return{n:null,pos:r};l.unexpectedNumericSeparator(r,e,i)}}else{if(u)return{n:null,pos:r};l.numericSeparatorInEscapeSequence(r,e,i)}++r;continue}if(y>=97?b=y-97+10:y>=65?b=y-65+10:HM(y)?b=y-48:b=1/0,b>=n){if(b<=9&&u)return{n:null,pos:r};if(b<=9&&l.invalidDigit(r,e,i,n))b=0;else if(o)b=0,h=!0;else break}++r,f=f*n+b}return r===c||s!=null&&r-c!==s||h?{n:null,pos:r}:{n:f,pos:r}}function qv(t,r,e,i,n,s){let o=t.charCodeAt(r),a;if(o===123){if(++r,{code:a,pos:r}=Yf(t,r,e,i,t.indexOf("}",r)-r,!0,n,s),++r,a!==null&&a>1114111)if(n)s.invalidCodePoint(r,e,i);else return{code:null,pos:r}}else({code:a,pos:r}=Yf(t,r,e,i,4,!1,n,s));return{code:a,pos:r}}function fa(t,r,e){return new fi(e,t-r,t)}var XM=new Set([103,109,115,105,121,117,100,118]),di=class{constructor(r){this.type=r.type,this.value=r.value,this.start=r.start,this.end=r.end,this.loc=new $s(r.startLoc,r.endLoc)}},Xf=class extends Hf{constructor(r,e){super(),this.isLookahead=void 0,this.tokens=[],this.errorHandlers_readInt={invalidDigit:(i,n,s,o)=>this.options.errorRecovery?(this.raise(S.InvalidDigit,fa(i,n,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:(i,n,s)=>{this.recordStrictModeErrors(S.StrictNumericEscape,fa(i,n,s))},unterminated:(i,n,s)=>{throw this.raise(S.UnterminatedString,fa(i-1,n,s))}}),this.errorHandlers_readStringContents_template=Object.assign({},this.errorHandlers_readCodePoint,{strictNumericEscape:this.errorBuilder(S.StrictNumericEscape),unterminated:(i,n,s)=>{throw this.raise(S.UnterminatedTemplate,fa(i,n,s))}}),this.state=new Jf,this.state.init(r),this.input=e,this.length=e.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 di(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 e=this.state;return this.state=r,e}nextTokenStart(){return this.nextTokenStartSince(this.state.pos)}nextTokenStartSince(r){return Bf.lastIndex=r,Bf.test(this.input)?Bf.lastIndex:r}lookaheadCharCode(){return this.input.charCodeAt(this.nextTokenStart())}nextTokenInLineStart(){return this.nextTokenInLineStartSince(this.state.pos)}nextTokenInLineStartSince(r){return $f.lastIndex=r,$f.test(this.input)?$f.lastIndex:r}lookaheadInLineCharCode(){return this.input.charCodeAt(this.nextTokenInLineStart())}codePointAtPos(r){let e=this.input.charCodeAt(r);if((e&64512)===55296&&++r<this.input.length){let i=this.input.charCodeAt(r);(i&64512)===56320&&(e=65536+((e&1023)<<10)+(i&1023))}return e}setStrict(r){this.state.strict=r,r&&(this.state.strictErrors.forEach(([e,i])=>this.raise(e,i)),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 e;this.isLookahead||(e=this.state.curPosition());let i=this.state.pos,n=this.input.indexOf(r,i+2);if(n===-1)throw this.raise(S.UnterminatedComment,this.state.curPosition());for(this.state.pos=n+r.length,Pu.lastIndex=i+2;Pu.test(this.input)&&Pu.lastIndex<=n;)++this.state.curLine,this.state.lineStart=Pu.lastIndex;if(this.isLookahead)return;let s={type:"CommentBlock",value:this.input.slice(i+2,n),start:i,end:n+r.length,loc:new $s(e,this.state.curPosition())};return this.options.tokens&&this.pushToken(s),s}skipLineComment(r){let e=this.state.pos,i;this.isLookahead||(i=this.state.curPosition());let n=this.input.charCodeAt(this.state.pos+=r);if(this.state.pos<this.length)for(;!Ms(n)&&++this.state.pos<this.length;)n=this.input.charCodeAt(this.state.pos);if(this.isLookahead)return;let s=this.state.pos,a={type:"CommentLine",value:this.input.slice(e+r,s),start:e,end:s,loc:new $s(i,this.state.curPosition())};return this.options.tokens&&this.pushToken(a),a}skipSpace(){let r=this.state.pos,e=[];e:for(;this.state.pos<this.length;){let i=this.input.charCodeAt(this.state.pos);switch(i){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 n=this.skipBlockComment("*/");n!==void 0&&(this.addComment(n),this.options.attachComment&&e.push(n));break}case 47:{let n=this.skipLineComment(2);n!==void 0&&(this.addComment(n),this.options.attachComment&&e.push(n));break}default:break e}break;default:if(GM(i))++this.state.pos;else if(i===45&&!this.inModule&&this.options.annexB){let n=this.state.pos;if(this.input.charCodeAt(n+1)===45&&this.input.charCodeAt(n+2)===62&&(r===0||this.state.lineStart>r)){let s=this.skipLineComment(3);s!==void 0&&(this.addComment(s),this.options.attachComment&&e.push(s))}else break e}else if(i===60&&!this.inModule&&this.options.annexB){let n=this.state.pos;if(this.input.charCodeAt(n+1)===33&&this.input.charCodeAt(n+2)===45&&this.input.charCodeAt(n+3)===45){let s=this.skipLineComment(4);s!==void 0&&(this.addComment(s),this.options.attachComment&&e.push(s))}else break e}else break e}}if(e.length>0){let i=this.state.pos,n={start:r,end:i,comments:e,leadingNode:null,trailingNode:null,containingNode:null};this.state.commentStack.push(n)}}finishToken(r,e){this.state.end=this.state.pos,this.state.endLoc=this.state.curPosition();let i=this.state.type;this.state.type=r,this.state.value=e,this.isLookahead||this.updateContext(i)}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,e=this.codePointAtPos(r);if(e>=48&&e<=57)throw this.raise(S.UnexpectedDigitAfterHash,this.state.curPosition());if(e===123||e===91&&this.hasPlugin("recordAndTuple")){if(this.expectPlugin("recordAndTuple"),this.getPluginOption("recordAndTuple","syntaxType")==="bar")throw this.raise(e===123?S.RecordExpressionHashIncorrectStartSyntaxType:S.TupleExpressionHashIncorrectStartSyntaxType,this.state.curPosition());this.state.pos+=2,e===123?this.finishToken(7):this.finishToken(1)}else Vi(e)?(++this.state.pos,this.finishToken(138,this.readWord1(e))):e===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 e=this.state.pos;for(this.state.pos+=1;!Ms(r)&&++this.state.pos<this.length;)r=this.input.charCodeAt(this.state.pos);let i=this.input.slice(e+2,this.state.pos);return this.finishToken(28,i),!0}readToken_mult_modulo(r){let e=r===42?55:54,i=1,n=this.input.charCodeAt(this.state.pos+1);r===42&&n===42&&(i++,n=this.input.charCodeAt(this.state.pos+2),e=57),n===61&&!this.state.inType&&(i++,e=r===37?33:30),this.finishOp(e,i)}readToken_pipe_amp(r){let e=this.input.charCodeAt(this.state.pos+1);if(e===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(e===62){this.finishOp(39,2);return}if(this.hasPlugin("recordAndTuple")&&e===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")&&e===93){if(this.getPluginOption("recordAndTuple","syntaxType")!=="bar")throw this.raise(S.TupleExpressionBarIncorrectEndSyntaxType,this.state.curPosition());this.state.pos+=2,this.finishToken(4);return}}if(e===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 e=this.input.charCodeAt(this.state.pos+1);if(e===r){this.finishOp(34,2);return}e===61?this.finishOp(30,2):this.finishOp(53,1)}readToken_lt(){let{pos:r}=this.state,e=this.input.charCodeAt(r+1);if(e===60){if(this.input.charCodeAt(r+2)===61){this.finishOp(30,3);return}this.finishOp(51,2);return}if(e===61){this.finishOp(49,2);return}this.finishOp(47,1)}readToken_gt(){let{pos:r}=this.state,e=this.input.charCodeAt(r+1);if(e===62){let i=this.input.charCodeAt(r+2)===62?3:2;if(this.input.charCodeAt(r+i)===61){this.finishOp(30,i+1);return}this.finishOp(52,i);return}if(e===61){this.finishOp(49,2);return}this.finishOp(48,1)}readToken_eq_excl(r){let e=this.input.charCodeAt(this.state.pos+1);if(e===61){this.finishOp(46,this.input.charCodeAt(this.state.pos+2)===61?3:2);return}if(r===61&&e===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),e=this.input.charCodeAt(this.state.pos+2);r===63?e===61?this.finishOp(30,3):this.finishOp(40,2):r===46&&!(e>=48&&e<=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 e=this.input.charCodeAt(this.state.pos+1);if(e===120||e===88){this.readRadixNumber(16);return}if(e===111||e===79){this.readRadixNumber(8);return}if(e===98||e===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(Vi(r)){this.readWord(r);return}}throw this.raise(S.InvalidOrUnexpectedToken,this.state.curPosition(),{unexpected:String.fromCodePoint(r)})}finishOp(r,e){let i=this.input.slice(this.state.pos,this.state.pos+e);this.state.pos+=e,this.finishToken(r,i)}readRegexp(){let r=this.state.startLoc,e=this.state.start+1,i,n,{pos:s}=this.state;for(;;++s){if(s>=this.length)throw this.raise(S.UnterminatedRegExp,jt(r,1));let u=this.input.charCodeAt(s);if(Ms(u))throw this.raise(S.UnterminatedRegExp,jt(r,1));if(i)i=!1;else{if(u===91)n=!0;else if(u===93&&n)n=!1;else if(u===47&&!n)break;i=u===92}}let o=this.input.slice(e,s);++s;let a="",l=()=>jt(r,s+2-e);for(;s<this.length;){let u=this.codePointAtPos(s),c=String.fromCharCode(u);if(XM.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(Ls(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,e,i=!1,n=!0){let{n:s,pos:o}=jv(this.input,this.state.pos,this.state.lineStart,this.state.curLine,r,e,i,n,this.errorHandlers_readInt,!1);return this.state.pos=o,s}readRadixNumber(r){let e=this.state.curPosition(),i=!1;this.state.pos+=2;let n=this.readInt(r);n==null&&this.raise(S.InvalidDigit,jt(e,2),{radix:r});let s=this.input.charCodeAt(this.state.pos);if(s===110)++this.state.pos,i=!0;else if(s===109)throw this.raise(S.InvalidDecimal,e);if(Vi(this.codePointAtPos(this.state.pos)))throw this.raise(S.NumberIdentifier,this.state.curPosition());if(i){let o=this.input.slice(e.index,this.state.pos).replace(/[_n]/g,"");this.finishToken(135,o);return}this.finishToken(134,n)}readNumber(r){let e=this.state.pos,i=this.state.curPosition(),n=!1,s=!1,o=!1,a=!1;!r&&this.readInt(10)===null&&this.raise(S.InvalidNumber,this.state.curPosition());let l=this.state.pos-e>=2&&this.input.charCodeAt(e)===48;if(l){let h=this.input.slice(e,this.state.pos);if(this.recordStrictModeErrors(S.StrictOctalLiteral,i),!this.state.strict){let f=h.indexOf("_");f>0&&this.raise(S.ZeroDigitNumericSeparator,jt(i,f))}a=l&&!/[89]/.test(h)}let u=this.input.charCodeAt(this.state.pos);if(u===46&&!a&&(++this.state.pos,this.readInt(10),n=!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,i),n=!0,o=!0,u=this.input.charCodeAt(this.state.pos)),u===110&&((n||l)&&this.raise(S.InvalidBigIntLiteral,i),++this.state.pos,s=!0),u===109){this.expectPlugin("decimal",this.state.curPosition()),(o||l)&&this.raise(S.InvalidDecimal,i),++this.state.pos;var c=!0}if(Vi(this.codePointAtPos(this.state.pos)))throw this.raise(S.NumberIdentifier,this.state.curPosition());let p=this.input.slice(e,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:e,pos:i}=qv(this.input,this.state.pos,this.state.lineStart,this.state.curLine,r,this.errorHandlers_readCodePoint);return this.state.pos=i,e}readString(r){let{str:e,pos:i,curLine:n,lineStart:s}=wv(r===34?"double":"single",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_string);this.state.pos=i+1,this.state.lineStart=s,this.state.curLine=n,this.finishToken(133,e)}readTemplateContinuation(){this.match(8)||this.unexpected(null,8),this.state.pos--,this.readTemplateToken()}readTemplateToken(){let r=this.input[this.state.pos],{str:e,firstInvalidLoc:i,pos:n,curLine:s,lineStart:o}=wv("template",this.input,this.state.pos+1,this.state.lineStart,this.state.curLine,this.errorHandlers_readStringContents_template);this.state.pos=n+1,this.state.lineStart=o,this.state.curLine=s,i&&(this.state.firstInvalidTemplateEscapePos=new fi(i.curLine,i.pos-i.lineStart,i.pos)),this.input.codePointAt(n)===96?this.finishToken(24,i?null:r+e+"`"):(this.state.pos++,this.finishToken(25,i?null:r+e+"${"))}recordStrictModeErrors(r,e){let i=e.index;this.state.strict&&!this.state.strictErrors.has(i)?this.raise(r,e):this.state.strictErrors.set(i,[r,e])}readWord1(r){this.state.containsEsc=!1;let e="",i=this.state.pos,n=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(Ls(s))this.state.pos+=s<=65535?1:2;else if(s===92){this.state.containsEsc=!0,e+=this.input.slice(n,this.state.pos);let o=this.state.curPosition(),a=this.state.pos===i?Vi:Ls;if(this.input.charCodeAt(++this.state.pos)!==117){this.raise(S.MissingUnicodeEscape,this.state.curPosition()),n=this.state.pos-1;continue}++this.state.pos;let l=this.readCodePoint(!0);l!==null&&(a(l)||this.raise(S.EscapedCharNotAnIdentifier,o),e+=String.fromCodePoint(l)),n=this.state.pos}else break}return e+this.input.slice(n,this.state.pos)}readWord(r){let e=this.readWord1(r),i=uh.get(e);i!==void 0?this.finishToken(i,bn(i)):this.finishToken(132,e)}checkKeywordEscapes(){let{type:r}=this.state;mh(r)&&this.state.containsEsc&&this.raise(S.InvalidEscapedReservedWord,this.state.startLoc,{reservedWord:bn(r)})}raise(r,e,i={}){let n=e instanceof fi?e:e.loc.start,s=r(n,i);if(!this.options.errorRecovery)throw s;return this.isLookahead||this.state.errors.push(s),s}raiseOverwrite(r,e,i={}){let n=e instanceof fi?e:e.loc.start,s=n.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(n,i);if(l.loc.index<s)break}return this.raise(r,e,i)}updateContext(r){}unexpected(r,e){throw this.raise(S.UnexpectedToken,r??this.state.startLoc,{expected:e?bn(e):null})}expectPlugin(r,e){if(this.hasPlugin(r))return!0;throw this.raise(S.MissingPlugin,e??this.state.startLoc,{missingPlugin:[r]})}expectOnePlugin(r){if(!r.some(e=>this.hasPlugin(e)))throw this.raise(S.MissingOneOfPlugins,this.state.startLoc,{missingPlugin:r})}errorBuilder(r){return(e,i,n)=>{this.raise(r,fa(e,i,n))}}},Qf=class{constructor(){this.privateNames=new Set,this.loneAccessors=new Map,this.undefinedPrivateNames=new Map}},Zf=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 Qf)}exit(){let r=this.stack.pop(),e=this.current();for(let[i,n]of Array.from(r.undefinedPrivateNames))e?e.undefinedPrivateNames.has(i)||e.undefinedPrivateNames.set(i,n):this.parser.raise(S.InvalidPrivateFieldResolution,n,{identifierName:i})}declarePrivateName(r,e,i){let{privateNames:n,loneAccessors:s,undefinedPrivateNames:o}=this.current(),a=n.has(r);if(e&3){let l=a&&s.get(r);if(l){let u=l&4,c=e&4,p=l&3,d=e&3;a=p===d||u!==c,a||s.delete(r)}else a||s.set(r,e)}a&&this.parser.raise(S.PrivateNameRedeclaration,i,{identifierName:r}),n.add(r),o.delete(r)}usePrivateName(r,e){let i;for(i of this.stack)if(i.privateNames.has(r))return;i?i.undefinedPrivateNames.set(r,e):this.parser.raise(S.InvalidPrivateFieldResolution,e,{identifierName:r})}},Us=class{constructor(r=0){this.type=r}canBeArrowParameterDeclaration(){return this.type===2||this.type===1}isCertainlyParameterDeclaration(){return this.type===3}},Ru=class extends Us{constructor(r){super(r),this.declarationErrors=new Map}recordDeclarationError(r,e){let i=e.index;this.declarationErrors.set(i,[r,e])}clearDeclarationError(r){this.declarationErrors.delete(r)}iterateErrors(r){this.declarationErrors.forEach(r)}},eh=class{constructor(r){this.parser=void 0,this.stack=[new Us],this.parser=r}enter(r){this.stack.push(r)}exit(){this.stack.pop()}recordParameterInitializerError(r,e){let i=e.loc.start,{stack:n}=this,s=n.length-1,o=n[s];for(;!o.isCertainlyParameterDeclaration();){if(o.canBeArrowParameterDeclaration())o.recordDeclarationError(r,i);else return;o=n[--s]}this.parser.raise(r,i)}recordArrowParameterBindingError(r,e){let{stack:i}=this,n=i[i.length-1],s=e.loc.start;if(n.isCertainlyParameterDeclaration())this.parser.raise(r,s);else if(n.canBeArrowParameterDeclaration())n.recordDeclarationError(r,s);else return}recordAsyncArrowParametersError(r){let{stack:e}=this,i=e.length-1,n=e[i];for(;n.canBeArrowParameterDeclaration();)n.type===2&&n.recordDeclarationError(S.AwaitBindingIdentifier,r),n=e[--i]}validateAsPattern(){let{stack:r}=this,e=r[r.length-1];e.canBeArrowParameterDeclaration()&&e.iterateErrors(([i,n])=>{this.parser.raise(i,n);let s=r.length-2,o=r[s];for(;o.canBeArrowParameterDeclaration();)o.clearDeclarationError(n.index),o=r[--s]})}};function QM(){return new Us(3)}function ZM(){return new Ru(1)}function eB(){return new Ru(2)}function Kv(){return new Us}var th=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 Fu(t,r){return(t?2:0)|(r?1:0)}var rh=class extends Xf{addExtra(r,e,i,n=!0){if(!r)return;let{extra:s}=r;s==null&&(s={},r.extra=s),n?s[e]=i:Object.defineProperty(s,e,{enumerable:n,value:i})}isContextual(r){return this.state.type===r&&!this.state.containsEsc}isUnparsedContextual(r,e){let i=r+e.length;if(this.input.slice(r,i)===e){let n=this.input.charCodeAt(i);return!(Ls(n)||(n&64512)===55296)}return!1}isLookaheadContextual(r){let e=this.nextTokenStart();return this.isUnparsedContextual(e,r)}eatContextual(r){return this.isContextual(r)?(this.next(),!0):!1}expectContextual(r,e){if(!this.eatContextual(r)){if(e!=null)throw this.raise(e,this.state.startLoc);this.unexpected(null,r)}}canInsertSemicolon(){return this.match(139)||this.match(8)||this.hasPrecedingLineBreak()}hasPrecedingLineBreak(){return Sv(this.input,this.state.lastTokEndLoc.index,this.state.start)}hasFollowingLineBreak(){return Sv(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,e){this.eat(r)||this.unexpected(e,r)}tryParse(r,e=this.state.clone()){let i={node:null};try{let n=r((s=null)=>{throw i.node=s,i});if(this.state.errors.length>e.errors.length){let s=this.state;return this.state=e,this.state.tokensLength=s.tokensLength,{node:n,error:s.errors[e.errors.length],thrown:!1,aborted:!1,failState:s}}return{node:n,error:null,thrown:!1,aborted:!1,failState:null}}catch(n){let s=this.state;if(this.state=e,n instanceof SyntaxError)return{node:null,error:n,thrown:!0,aborted:!1,failState:s};if(n===i)return{node:i.node,error:null,thrown:!1,aborted:!0,failState:s};throw n}}checkExpressionErrors(r,e){if(!r)return!1;let{shorthandAssignLoc:i,doubleProtoLoc:n,privateKeyLoc:s,optionalParametersLoc:o}=r,a=!!i||!!n||!!o||!!s;if(!e)return a;i!=null&&this.raise(S.InvalidCoverInitializedName,i),n!=null&&this.raise(S.DuplicateProto,n),s!=null&&this.raise(S.UnexpectedPrivateField,s),o!=null&&this.unexpected(o)}isLiteralPropertyName(){return kv(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 e=this.state.labels;this.state.labels=[];let i=this.exportedIdentifiers;this.exportedIdentifiers=new Set;let n=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 th;let l=this.classScope;this.classScope=new Zf(this);let u=this.expressionScope;return this.expressionScope=new eh(this),()=>{this.state.labels=e,this.exportedIdentifiers=i,this.inModule=n,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:e}=r;e!==null&&this.expectPlugin("destructuringPrivate",e)}},Bs=class{constructor(){this.shorthandAssignLoc=null,this.doubleProtoLoc=null,this.privateKeyLoc=null,this.optionalParametersLoc=null}},js=class{constructor(r,e,i){this.type="",this.start=e,this.end=0,this.loc=new $s(i),r!=null&&r.options.ranges&&(this.range=[e,0]),r!=null&&r.filename&&(this.loc.filename=r.filename)}},bh=js.prototype;bh.__clone=function(){let t=new js(void 0,this.start,this.loc.start),r=Object.keys(this);for(let e=0,i=r.length;e<i;e++){let n=r[e];n!=="leadingComments"&&n!=="trailingComments"&&n!=="innerComments"&&(t[n]=this[n])}return t};function tB(t){return Wi(t)}function Wi(t){let{type:r,start:e,end:i,loc:n,range:s,extra:o,name:a}=t,l=Object.create(bh);return l.type=r,l.start=e,l.end=i,l.loc=n,l.range=s,l.extra=o,l.name=a,r==="Placeholder"&&(l.expectedNode=t.expectedNode),l}function rB(t){let{type:r,start:e,end:i,loc:n,range:s,extra:o}=t;if(r==="Placeholder")return tB(t);let a=Object.create(bh);return a.type=r,a.start=e,a.end=i,a.loc=n,a.range=s,t.raw!==void 0?a.raw=t.raw:a.extra=o,a.value=t.value,a}var ih=class extends rh{startNode(){let r=this.state.startLoc;return new js(this,r.index,r)}startNodeAt(r){return new js(this,r.index,r)}startNodeAtNode(r){return this.startNodeAt(r.loc.start)}finishNode(r,e){return this.finishNodeAt(r,e,this.state.lastTokEndLoc)}finishNodeAt(r,e,i){return r.type=e,r.end=i.index,r.loc.end=i,this.options.ranges&&(r.range[1]=i.index),this.options.attachComment&&this.processComment(r),r}resetStartLocation(r,e){r.start=e.index,r.loc.start=e,this.options.ranges&&(r.range[0]=e.index)}resetEndLocation(r,e=this.state.lastTokEndLoc){r.end=e.index,r.loc.end=e,this.options.ranges&&(r.range[1]=e.index)}resetStartLocationFromNode(r,e){this.resetStartLocation(r,e.loc.start)}},iB=new Set(["_","any","bool","boolean","empty","extends","false","interface","mixed","null","number","static","string","true","typeof","void"]),X=zi`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:t})=>`Cannot overwrite reserved type ${t}.`,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:t,enumName:r})=>`Boolean enum members need to be initialized. Use either \`${t} = true,\` or \`${t} = false,\` in enum \`${r}\`.`,EnumDuplicateMemberName:({memberName:t,enumName:r})=>`Enum member names need to be unique, but the name \`${t}\` has already been used before in enum \`${r}\`.`,EnumInconsistentMemberValues:({enumName:t})=>`Enum \`${t}\` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers.`,EnumInvalidExplicitType:({invalidEnumType:t,enumName:r})=>`Enum type \`${t}\` is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${r}\`.`,EnumInvalidExplicitTypeUnknownSupplied:({enumName:t})=>`Supplied enum type is not valid. Use one of \`boolean\`, \`number\`, \`string\`, or \`symbol\` in enum \`${t}\`.`,EnumInvalidMemberInitializerPrimaryType:({enumName:t,memberName:r,explicitType:e})=>`Enum \`${t}\` has type \`${e}\`, so the initializer of \`${r}\` needs to be a ${e} literal.`,EnumInvalidMemberInitializerSymbolType:({enumName:t,memberName:r})=>`Symbol enum members cannot be initialized. Use \`${r},\` in enum \`${t}\`.`,EnumInvalidMemberInitializerUnknownType:({enumName:t,memberName:r})=>`The enum member initializer for \`${r}\` needs to be a literal (either a boolean, number, or string) in enum \`${t}\`.`,EnumInvalidMemberName:({enumName:t,memberName:r,suggestion:e})=>`Enum member names cannot start with lowercase 'a' through 'z'. Instead of using \`${r}\`, consider using \`${e}\`, in enum \`${t}\`.`,EnumNumberMemberNotInitialized:({enumName:t,memberName:r})=>`Number enum members need to be initialized, e.g. \`${r} = 1\` in enum \`${t}\`.`,EnumStringMemberInconsistentlyInitialized:({enumName:t})=>`String enum members need to consistently either all use initializers, or use no initializers, in enum \`${t}\`.`,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:t})=>`Unexpected reserved type ${t}.`,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:t,suggestion:r})=>`\`declare export ${t}\` is not supported. Use \`${r}\` instead.`,UnsupportedStatementInDeclareModule:"Only declares and type imports are allowed inside declare module.",UnterminatedFlowComment:"Unterminated flow-comment."});function nB(t){return t.type==="DeclareExportAllDeclaration"||t.type==="DeclareExportDeclaration"&&(!t.declaration||t.declaration.type!=="TypeAlias"&&t.declaration.type!=="InterfaceDeclaration")}function Tv(t){return t.importKind==="type"||t.importKind==="typeof"}var sB={const:"declare export var",let:"declare export var",type:"export type",interface:"export interface"};function oB(t,r){let e=[],i=[];for(let n=0;n<t.length;n++)(r(t[n],n,t)?e:i).push(t[n]);return[e,i]}var aB=/\*?\s*@((?:no)?flow)\b/,lB=t=>class extends t{constructor(...e){super(...e),this.flowPragma=void 0}getScopeHandler(){return Wf}shouldParseTypes(){return this.getPluginOption("flow","all")||this.flowPragma==="flow"}finishToken(e,i){e!==133&&e!==13&&e!==28&&this.flowPragma===void 0&&(this.flowPragma=null),super.finishToken(e,i)}addComment(e){if(this.flowPragma===void 0){let i=aB.exec(e.value);if(i)if(i[1]==="flow")this.flowPragma="flow";else if(i[1]==="noflow")this.flowPragma="noflow";else throw new Error("Unexpected flow pragma")}super.addComment(e)}flowParseTypeInitialiser(e){let i=this.state.inType;this.state.inType=!0,this.expect(e||14);let n=this.flowParseType();return this.state.inType=i,n}flowParsePredicate(){let e=this.startNode(),i=this.state.startLoc;return this.next(),this.expectContextual(110),this.state.lastTokStartLoc.index>i.index+1&&this.raise(X.UnexpectedSpaceBetweenModuloChecks,i),this.eat(10)?(e.value=super.parseExpression(),this.expect(11),this.finishNode(e,"DeclaredPredicate")):this.finishNode(e,"InferredPredicate")}flowParseTypeAndPredicateInitialiser(){let e=this.state.inType;this.state.inType=!0,this.expect(14);let i=null,n=null;return this.match(54)?(this.state.inType=e,n=this.flowParsePredicate()):(i=this.flowParseType(),this.state.inType=e,this.match(54)&&(n=this.flowParsePredicate())),[i,n]}flowParseDeclareClass(e){return this.next(),this.flowParseInterfaceish(e,!0),this.finishNode(e,"DeclareClass")}flowParseDeclareFunction(e){this.next();let i=e.id=this.parseIdentifier(),n=this.startNode(),s=this.startNode();this.match(47)?n.typeParameters=this.flowParseTypeParameterDeclaration():n.typeParameters=null,this.expect(10);let o=this.flowParseFunctionTypeParams();return n.params=o.params,n.rest=o.rest,n.this=o._this,this.expect(11),[n.returnType,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),s.typeAnnotation=this.finishNode(n,"FunctionTypeAnnotation"),i.typeAnnotation=this.finishNode(s,"TypeAnnotation"),this.resetEndLocation(i),this.semicolon(),this.scope.declareName(e.id.name,2048,e.id.loc.start),this.finishNode(e,"DeclareFunction")}flowParseDeclare(e,i){if(this.match(80))return this.flowParseDeclareClass(e);if(this.match(68))return this.flowParseDeclareFunction(e);if(this.match(74))return this.flowParseDeclareVariable(e);if(this.eatContextual(127))return this.match(16)?this.flowParseDeclareModuleExports(e):(i&&this.raise(X.NestedDeclareModule,this.state.lastTokStartLoc),this.flowParseDeclareModule(e));if(this.isContextual(130))return this.flowParseDeclareTypeAlias(e);if(this.isContextual(131))return this.flowParseDeclareOpaqueType(e);if(this.isContextual(129))return this.flowParseDeclareInterface(e);if(this.match(82))return this.flowParseDeclareExportDeclaration(e,i);this.unexpected()}flowParseDeclareVariable(e){return this.next(),e.id=this.flowParseTypeAnnotatableIdentifier(!0),this.scope.declareName(e.id.name,5,e.id.loc.start),this.semicolon(),this.finishNode(e,"DeclareVariable")}flowParseDeclareModule(e){this.scope.enter(0),this.match(133)?e.id=super.parseExprAtom():e.id=this.parseIdentifier();let i=e.body=this.startNode(),n=i.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(X.InvalidNonTypeImportInDeclareModule,this.state.lastTokStartLoc),super.parseImport(a)):(this.expectContextual(125,X.UnsupportedStatementInDeclareModule),a=this.flowParseDeclare(a,!0)),n.push(a)}this.scope.exit(),this.expect(8),this.finishNode(i,"BlockStatement");let s=null,o=!1;return n.forEach(a=>{nB(a)?(s==="CommonJS"&&this.raise(X.AmbiguousDeclareModuleKind,a),s="ES"):a.type==="DeclareModuleExports"&&(o&&this.raise(X.DuplicateDeclareModuleExports,a),s==="ES"&&this.raise(X.AmbiguousDeclareModuleKind,a),s="CommonJS",o=!0)}),e.kind=s||"CommonJS",this.finishNode(e,"DeclareModule")}flowParseDeclareExportDeclaration(e,i){if(this.expect(82),this.eat(65))return this.match(68)||this.match(80)?e.declaration=this.flowParseDeclare(this.startNode()):(e.declaration=this.flowParseType(),this.semicolon()),e.default=!0,this.finishNode(e,"DeclareExportDeclaration");if(this.match(75)||this.isLet()||(this.isContextual(130)||this.isContextual(129))&&!i){let n=this.state.value;throw this.raise(X.UnsupportedDeclareExportKind,this.state.startLoc,{unsupportedExportKind:n,suggestion:sB[n]})}if(this.match(74)||this.match(68)||this.match(80)||this.isContextual(131))return e.declaration=this.flowParseDeclare(this.startNode()),e.default=!1,this.finishNode(e,"DeclareExportDeclaration");if(this.match(55)||this.match(5)||this.isContextual(129)||this.isContextual(130)||this.isContextual(131))return e=this.parseExport(e,null),e.type==="ExportNamedDeclaration"&&(e.type="ExportDeclaration",e.default=!1,delete e.exportKind),e.type="Declare"+e.type,e;this.unexpected()}flowParseDeclareModuleExports(e){return this.next(),this.expectContextual(111),e.typeAnnotation=this.flowParseTypeAnnotation(),this.semicolon(),this.finishNode(e,"DeclareModuleExports")}flowParseDeclareTypeAlias(e){this.next();let i=this.flowParseTypeAlias(e);return i.type="DeclareTypeAlias",i}flowParseDeclareOpaqueType(e){this.next();let i=this.flowParseOpaqueType(e,!0);return i.type="DeclareOpaqueType",i}flowParseDeclareInterface(e){return this.next(),this.flowParseInterfaceish(e,!1),this.finishNode(e,"DeclareInterface")}flowParseInterfaceish(e,i){if(e.id=this.flowParseRestrictedIdentifier(!i,!0),this.scope.declareName(e.id.name,i?17:8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.extends=[],this.eat(81))do e.extends.push(this.flowParseInterfaceExtends());while(!i&&this.eat(12));if(i){if(e.implements=[],e.mixins=[],this.eatContextual(117))do e.mixins.push(this.flowParseInterfaceExtends());while(this.eat(12));if(this.eatContextual(113))do e.implements.push(this.flowParseInterfaceExtends());while(this.eat(12))}e.body=this.flowParseObjectType({allowStatic:i,allowExact:!1,allowSpread:!1,allowProto:i,allowInexact:!1})}flowParseInterfaceExtends(){let e=this.startNode();return e.id=this.flowParseQualifiedTypeIdentifier(),this.match(47)?e.typeParameters=this.flowParseTypeParameterInstantiation():e.typeParameters=null,this.finishNode(e,"InterfaceExtends")}flowParseInterface(e){return this.flowParseInterfaceish(e,!1),this.finishNode(e,"InterfaceDeclaration")}checkNotUnderscore(e){e==="_"&&this.raise(X.UnexpectedReservedUnderscore,this.state.startLoc)}checkReservedType(e,i,n){iB.has(e)&&this.raise(n?X.AssignReservedType:X.UnexpectedReservedType,i,{reservedType:e})}flowParseRestrictedIdentifier(e,i){return this.checkReservedType(this.state.value,this.state.startLoc,i),this.parseIdentifier(e)}flowParseTypeAlias(e){return e.id=this.flowParseRestrictedIdentifier(!1,!0),this.scope.declareName(e.id.name,8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.right=this.flowParseTypeInitialiser(29),this.semicolon(),this.finishNode(e,"TypeAlias")}flowParseOpaqueType(e,i){return this.expectContextual(130),e.id=this.flowParseRestrictedIdentifier(!0,!0),this.scope.declareName(e.id.name,8201,e.id.loc.start),this.match(47)?e.typeParameters=this.flowParseTypeParameterDeclaration():e.typeParameters=null,e.supertype=null,this.match(14)&&(e.supertype=this.flowParseTypeInitialiser(14)),e.impltype=null,i||(e.impltype=this.flowParseTypeInitialiser(29)),this.semicolon(),this.finishNode(e,"OpaqueType")}flowParseTypeParameter(e=!1){let i=this.state.startLoc,n=this.startNode(),s=this.flowParseVariance(),o=this.flowParseTypeAnnotatableIdentifier();return n.name=o.name,n.variance=s,n.bound=o.typeAnnotation,this.match(29)?(this.eat(29),n.default=this.flowParseType()):e&&this.raise(X.MissingTypeParamDefault,i),this.finishNode(n,"TypeParameter")}flowParseTypeParameterDeclaration(){let e=this.state.inType,i=this.startNode();i.params=[],this.state.inType=!0,this.match(47)||this.match(142)?this.next():this.unexpected();let n=!1;do{let s=this.flowParseTypeParameter(n);i.params.push(s),s.default&&(n=!0),this.match(48)||this.expect(12)}while(!this.match(48));return this.expect(48),this.state.inType=e,this.finishNode(i,"TypeParameterDeclaration")}flowParseTypeParameterInstantiation(){let e=this.startNode(),i=this.state.inType;e.params=[],this.state.inType=!0,this.expect(47);let n=this.state.noAnonFunctionType;for(this.state.noAnonFunctionType=!1;!this.match(48);)e.params.push(this.flowParseType()),this.match(48)||this.expect(12);return this.state.noAnonFunctionType=n,this.expect(48),this.state.inType=i,this.finishNode(e,"TypeParameterInstantiation")}flowParseTypeParameterInstantiationCallOrNew(){let e=this.startNode(),i=this.state.inType;for(e.params=[],this.state.inType=!0,this.expect(47);!this.match(48);)e.params.push(this.flowParseTypeOrImplicitInstantiation()),this.match(48)||this.expect(12);return this.expect(48),this.state.inType=i,this.finishNode(e,"TypeParameterInstantiation")}flowParseInterfaceType(){let e=this.startNode();if(this.expectContextual(129),e.extends=[],this.eat(81))do e.extends.push(this.flowParseInterfaceExtends());while(this.eat(12));return e.body=this.flowParseObjectType({allowStatic:!1,allowExact:!1,allowSpread:!1,allowProto:!1,allowInexact:!1}),this.finishNode(e,"InterfaceTypeAnnotation")}flowParseObjectPropertyKey(){return this.match(134)||this.match(133)?super.parseExprAtom():this.parseIdentifier(!0)}flowParseObjectTypeIndexer(e,i,n){return e.static=i,this.lookahead().type===14?(e.id=this.flowParseObjectPropertyKey(),e.key=this.flowParseTypeInitialiser()):(e.id=null,e.key=this.flowParseType()),this.expect(3),e.value=this.flowParseTypeInitialiser(),e.variance=n,this.finishNode(e,"ObjectTypeIndexer")}flowParseObjectTypeInternalSlot(e,i){return e.static=i,e.id=this.flowParseObjectPropertyKey(),this.expect(3),this.expect(3),this.match(47)||this.match(10)?(e.method=!0,e.optional=!1,e.value=this.flowParseObjectTypeMethodish(this.startNodeAt(e.loc.start))):(e.method=!1,this.eat(17)&&(e.optional=!0),e.value=this.flowParseTypeInitialiser()),this.finishNode(e,"ObjectTypeInternalSlot")}flowParseObjectTypeMethodish(e){for(e.params=[],e.rest=null,e.typeParameters=null,e.this=null,this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),this.expect(10),this.match(78)&&(e.this=this.flowParseFunctionTypeParam(!0),e.this.name=null,this.match(11)||this.expect(12));!this.match(11)&&!this.match(21);)e.params.push(this.flowParseFunctionTypeParam(!1)),this.match(11)||this.expect(12);return this.eat(21)&&(e.rest=this.flowParseFunctionTypeParam(!1)),this.expect(11),e.returnType=this.flowParseTypeInitialiser(),this.finishNode(e,"FunctionTypeAnnotation")}flowParseObjectTypeCallProperty(e,i){let n=this.startNode();return e.static=i,e.value=this.flowParseObjectTypeMethodish(n),this.finishNode(e,"ObjectTypeCallProperty")}flowParseObjectType({allowStatic:e,allowExact:i,allowSpread:n,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(i&&this.match(6)?(this.expect(6),u=9,c=!0):(this.expect(5),u=8,c=!1),l.exact=c;!this.match(u);){let h=!1,f=null,g=null,m=this.startNode();if(s&&this.isContextual(118)){let b=this.lookahead();b.type!==14&&b.type!==17&&(this.next(),f=this.state.startLoc,e=!1)}if(e&&this.isContextual(106)){let b=this.lookahead();b.type!==14&&b.type!==17&&(this.next(),h=!0)}let y=this.flowParseVariance();if(this.eat(0))f!=null&&this.unexpected(f),this.eat(0)?(y&&this.unexpected(y.loc.start),l.internalSlots.push(this.flowParseObjectTypeInternalSlot(m,h))):l.indexers.push(this.flowParseObjectTypeIndexer(m,h,y));else if(this.match(10)||this.match(47))f!=null&&this.unexpected(f),y&&this.unexpected(y.loc.start),l.callProperties.push(this.flowParseObjectTypeCallProperty(m,h));else{let b="init";if(this.isContextual(99)||this.isContextual(104)){let D=this.lookahead();kv(D.type)&&(b=this.state.value,this.next())}let C=this.flowParseObjectTypeProperty(m,h,f,y,b,n,o??!c);C===null?(p=!0,g=this.state.lastTokStartLoc):l.properties.push(C)}this.flowObjectTypeSemicolon(),g&&!this.match(8)&&!this.match(9)&&this.raise(X.UnexpectedExplicitInexactInObject,g)}this.expect(u),n&&(l.inexact=p);let d=this.finishNode(l,"ObjectTypeAnnotation");return this.state.inType=a,d}flowParseObjectTypeProperty(e,i,n,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(X.InexactInsideExact,this.state.lastTokStartLoc):this.raise(X.InexactInsideNonObject,this.state.lastTokStartLoc),s&&this.raise(X.InexactVariance,s),null):(a||this.raise(X.UnexpectedSpreadType,this.state.lastTokStartLoc),n!=null&&this.unexpected(n),s&&this.raise(X.SpreadVariance,s),e.argument=this.flowParseType(),this.finishNode(e,"ObjectTypeSpreadProperty"));{e.key=this.flowParseObjectPropertyKey(),e.static=i,e.proto=n!=null,e.kind=o;let u=!1;return this.match(47)||this.match(10)?(e.method=!0,n!=null&&this.unexpected(n),s&&this.unexpected(s.loc.start),e.value=this.flowParseObjectTypeMethodish(this.startNodeAt(e.loc.start)),(o==="get"||o==="set")&&this.flowCheckGetterSetterParams(e),!a&&e.key.name==="constructor"&&e.value.this&&this.raise(X.ThisParamBannedInConstructor,e.value.this)):(o!=="init"&&this.unexpected(),e.method=!1,this.eat(17)&&(u=!0),e.value=this.flowParseTypeInitialiser(),e.variance=s),e.optional=u,this.finishNode(e,"ObjectTypeProperty")}}flowCheckGetterSetterParams(e){let i=e.kind==="get"?0:1,n=e.value.params.length+(e.value.rest?1:0);e.value.this&&this.raise(e.kind==="get"?X.GetterMayNotHaveThisParam:X.SetterMayNotHaveThisParam,e.value.this),n!==i&&this.raise(e.kind==="get"?S.BadGetterArity:S.BadSetterArity,e),e.kind==="set"&&e.value.rest&&this.raise(S.BadSetterRestParameter,e)}flowObjectTypeSemicolon(){!this.eat(13)&&!this.eat(12)&&!this.match(8)&&!this.match(9)&&this.unexpected()}flowParseQualifiedTypeIdentifier(e,i){var n;(n=e)!=null||(e=this.state.startLoc);let s=i||this.flowParseRestrictedIdentifier(!0);for(;this.eat(16);){let o=this.startNodeAt(e);o.qualification=s,o.id=this.flowParseRestrictedIdentifier(!0),s=this.finishNode(o,"QualifiedTypeIdentifier")}return s}flowParseGenericType(e,i){let n=this.startNodeAt(e);return n.typeParameters=null,n.id=this.flowParseQualifiedTypeIdentifier(e,i),this.match(47)&&(n.typeParameters=this.flowParseTypeParameterInstantiation()),this.finishNode(n,"GenericTypeAnnotation")}flowParseTypeofType(){let e=this.startNode();return this.expect(87),e.argument=this.flowParsePrimaryType(),this.finishNode(e,"TypeofTypeAnnotation")}flowParseTupleType(){let e=this.startNode();for(e.types=[],this.expect(0);this.state.pos<this.length&&!this.match(3)&&(e.types.push(this.flowParseType()),!this.match(3));)this.expect(12);return this.expect(3),this.finishNode(e,"TupleTypeAnnotation")}flowParseFunctionTypeParam(e){let i=null,n=!1,s=null,o=this.startNode(),a=this.lookahead(),l=this.state.type===78;return a.type===14||a.type===17?(l&&!e&&this.raise(X.ThisParamMustBeFirst,o),i=this.parseIdentifier(l),this.eat(17)&&(n=!0,l&&this.raise(X.ThisParamMayNotBeOptional,o)),s=this.flowParseTypeInitialiser()):s=this.flowParseType(),o.name=i,o.optional=n,o.typeAnnotation=s,this.finishNode(o,"FunctionTypeParam")}reinterpretTypeAsFunctionTypeParam(e){let i=this.startNodeAt(e.loc.start);return i.name=null,i.optional=!1,i.typeAnnotation=e,this.finishNode(i,"FunctionTypeParam")}flowParseFunctionTypeParams(e=[]){let i=null,n=null;for(this.match(78)&&(n=this.flowParseFunctionTypeParam(!0),n.name=null,this.match(11)||this.expect(12));!this.match(11)&&!this.match(21);)e.push(this.flowParseFunctionTypeParam(!1)),this.match(11)||this.expect(12);return this.eat(21)&&(i=this.flowParseFunctionTypeParam(!1)),{params:e,rest:i,_this:n}}flowIdentToTypeAnnotation(e,i,n){switch(n.name){case"any":return this.finishNode(i,"AnyTypeAnnotation");case"bool":case"boolean":return this.finishNode(i,"BooleanTypeAnnotation");case"mixed":return this.finishNode(i,"MixedTypeAnnotation");case"empty":return this.finishNode(i,"EmptyTypeAnnotation");case"number":return this.finishNode(i,"NumberTypeAnnotation");case"string":return this.finishNode(i,"StringTypeAnnotation");case"symbol":return this.finishNode(i,"SymbolTypeAnnotation");default:return this.checkNotUnderscore(n.name),this.flowParseGenericType(e,n)}}flowParsePrimaryType(){let e=this.state.startLoc,i=this.startNode(),n,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),n=this.flowParseFunctionTypeParams(),l.params=n.params,l.rest=n.rest,l.this=n._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?n=this.flowParseFunctionTypeParams([this.reinterpretTypeAsFunctionTypeParam(s)]):n=this.flowParseFunctionTypeParams(),l.params=n.params,l.rest=n.rest,l.this=n._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 i.value=this.match(85),this.next(),this.finishNode(i,"BooleanLiteralTypeAnnotation");case 53:if(this.state.value==="-"){if(this.next(),this.match(134))return this.parseLiteralAtNode(-this.state.value,"NumberLiteralTypeAnnotation",i);if(this.match(135))return this.parseLiteralAtNode(-this.state.value,"BigIntLiteralTypeAnnotation",i);throw this.raise(X.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(i,"VoidTypeAnnotation");case 84:return this.next(),this.finishNode(i,"NullLiteralTypeAnnotation");case 78:return this.next(),this.finishNode(i,"ThisTypeAnnotation");case 55:return this.next(),this.finishNode(i,"ExistsTypeAnnotation");case 87:return this.flowParseTypeofType();default:if(mh(this.state.type)){let l=bn(this.state.type);return this.next(),super.createIdentifier(i,l)}else if(we(this.state.type))return this.isContextual(129)?this.flowParseInterfaceType():this.flowIdentToTypeAnnotation(e,i,this.parseIdentifier())}this.unexpected()}flowParsePostfixType(){let e=this.state.startLoc,i=this.flowParsePrimaryType(),n=!1;for(;(this.match(0)||this.match(18))&&!this.canInsertSemicolon();){let s=this.startNodeAt(e),o=this.eat(18);n=n||o,this.expect(0),!o&&this.match(3)?(s.elementType=i,this.next(),i=this.finishNode(s,"ArrayTypeAnnotation")):(s.objectType=i,s.indexType=this.flowParseType(),this.expect(3),n?(s.optional=o,i=this.finishNode(s,"OptionalIndexedAccessType")):i=this.finishNode(s,"IndexedAccessType"))}return i}flowParsePrefixType(){let e=this.startNode();return this.eat(17)?(e.typeAnnotation=this.flowParsePrefixType(),this.finishNode(e,"NullableTypeAnnotation")):this.flowParsePostfixType()}flowParseAnonFunctionWithoutParens(){let e=this.flowParsePrefixType();if(!this.state.noAnonFunctionType&&this.eat(19)){let i=this.startNodeAt(e.loc.start);return i.params=[this.reinterpretTypeAsFunctionTypeParam(e)],i.rest=null,i.this=null,i.returnType=this.flowParseType(),i.typeParameters=null,this.finishNode(i,"FunctionTypeAnnotation")}return e}flowParseIntersectionType(){let e=this.startNode();this.eat(45);let i=this.flowParseAnonFunctionWithoutParens();for(e.types=[i];this.eat(45);)e.types.push(this.flowParseAnonFunctionWithoutParens());return e.types.length===1?i:this.finishNode(e,"IntersectionTypeAnnotation")}flowParseUnionType(){let e=this.startNode();this.eat(43);let i=this.flowParseIntersectionType();for(e.types=[i];this.eat(43);)e.types.push(this.flowParseIntersectionType());return e.types.length===1?i:this.finishNode(e,"UnionTypeAnnotation")}flowParseType(){let e=this.state.inType;this.state.inType=!0;let i=this.flowParseUnionType();return this.state.inType=e,i}flowParseTypeOrImplicitInstantiation(){if(this.state.type===132&&this.state.value==="_"){let e=this.state.startLoc,i=this.parseIdentifier();return this.flowParseGenericType(e,i)}else return this.flowParseType()}flowParseTypeAnnotation(){let e=this.startNode();return e.typeAnnotation=this.flowParseTypeInitialiser(),this.finishNode(e,"TypeAnnotation")}flowParseTypeAnnotatableIdentifier(e){let i=e?this.parseIdentifier():this.flowParseRestrictedIdentifier();return this.match(14)&&(i.typeAnnotation=this.flowParseTypeAnnotation(),this.resetEndLocation(i)),i}typeCastToParameter(e){return e.expression.typeAnnotation=e.typeAnnotation,this.resetEndLocation(e.expression,e.typeAnnotation.loc.end),e.expression}flowParseVariance(){let e=null;return this.match(53)?(e=this.startNode(),this.state.value==="+"?e.kind="plus":e.kind="minus",this.next(),this.finishNode(e,"Variance")):e}parseFunctionBody(e,i,n=!1){if(i){this.forwardNoArrowParamsConversionAt(e,()=>super.parseFunctionBody(e,!0,n));return}super.parseFunctionBody(e,!1,n)}parseFunctionBodyAndFinish(e,i,n=!1){if(this.match(14)){let s=this.startNode();[s.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),e.returnType=s.typeAnnotation?this.finishNode(s,"TypeAnnotation"):null}return super.parseFunctionBodyAndFinish(e,i,n)}parseStatementLike(e){if(this.state.strict&&this.isContextual(129)){let n=this.lookahead();if(Br(n.type)){let s=this.startNode();return this.next(),this.flowParseInterface(s)}}else if(this.plugins.get("flow").enums&&this.isContextual(126)){let n=this.startNode();return this.next(),this.flowParseEnumDeclaration(n)}let i=super.parseStatementLike(e);return this.flowPragma===void 0&&!this.isValidDirective(i)&&(this.flowPragma=null),i}parseExpressionStatement(e,i,n){if(i.type==="Identifier"){if(i.name==="declare"){if(this.match(80)||we(this.state.type)||this.match(68)||this.match(74)||this.match(82))return this.flowParseDeclare(e)}else if(we(this.state.type)){if(i.name==="interface")return this.flowParseInterface(e);if(i.name==="type")return this.flowParseTypeAlias(e);if(i.name==="opaque")return this.flowParseOpaqueType(e,!1)}}return super.parseExpressionStatement(e,i,n)}shouldParseExportDeclaration(){let{type:e}=this.state;return Cv(e)||this.plugins.get("flow").enums&&e===126?!this.state.containsEsc:super.shouldParseExportDeclaration()}isExportDefaultSpecifier(){let{type:e}=this.state;return Cv(e)||this.plugins.get("flow").enums&&e===126?this.state.containsEsc:super.isExportDefaultSpecifier()}parseExportDefaultExpression(){if(this.plugins.get("flow").enums&&this.isContextual(126)){let e=this.startNode();return this.next(),this.flowParseEnumDeclaration(e)}return super.parseExportDefaultExpression()}parseConditional(e,i,n){if(!this.match(17))return e;if(this.state.maybeInArrowParameters){let d=this.lookaheadCharCode();if(d===44||d===61||d===58||d===41)return this.setOptionalParametersError(n),e}this.expect(17);let s=this.state.clone(),o=this.state.noArrowAt,a=this.startNodeAt(i),{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 h=0;h<p.length;h++)d.push(p[h].start);({consequent:l,failed:u}=this.tryParseConditionalConsequent()),[c,p]=this.getArrowLikeExpressions(l)}u&&c.length>1&&this.raise(X.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=e,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 e=this.parseMaybeAssignAllowIn(),i=!this.match(14);return this.state.noArrowParamsConversionAt.pop(),{consequent:e,failed:i}}getArrowLikeExpressions(e,i){let n=[e],s=[];for(;n.length!==0;){let o=n.pop();o.type==="ArrowFunctionExpression"&&o.body.type!=="BlockStatement"?(o.typeParameters||!o.returnType?this.finishArrowValidation(o):s.push(o),n.push(o.body)):o.type==="ConditionalExpression"&&(n.push(o.consequent),n.push(o.alternate))}return i?(s.forEach(o=>this.finishArrowValidation(o)),[s,[]]):oB(s,o=>o.params.every(a=>this.isAssignable(a,!0)))}finishArrowValidation(e){var i;this.toAssignableList(e.params,(i=e.extra)==null?void 0:i.trailingCommaLoc,!1),this.scope.enter(6),super.checkParams(e,!1,!0),this.scope.exit()}forwardNoArrowParamsConversionAt(e,i){let n;return this.state.noArrowParamsConversionAt.includes(e.start)?(this.state.noArrowParamsConversionAt.push(this.state.start),n=i(),this.state.noArrowParamsConversionAt.pop()):n=i(),n}parseParenItem(e,i){let n=super.parseParenItem(e,i);if(this.eat(17)&&(n.optional=!0,this.resetEndLocation(e)),this.match(14)){let s=this.startNodeAt(i);return s.expression=n,s.typeAnnotation=this.flowParseTypeAnnotation(),this.finishNode(s,"TypeCastExpression")}return n}assertModuleNodeAllowed(e){e.type==="ImportDeclaration"&&(e.importKind==="type"||e.importKind==="typeof")||e.type==="ExportNamedDeclaration"&&e.exportKind==="type"||e.type==="ExportAllDeclaration"&&e.exportKind==="type"||super.assertModuleNodeAllowed(e)}parseExportDeclaration(e){if(this.isContextual(130)){e.exportKind="type";let i=this.startNode();return this.next(),this.match(5)?(e.specifiers=this.parseExportSpecifiers(!0),super.parseExportFrom(e),null):this.flowParseTypeAlias(i)}else if(this.isContextual(131)){e.exportKind="type";let i=this.startNode();return this.next(),this.flowParseOpaqueType(i,!1)}else if(this.isContextual(129)){e.exportKind="type";let i=this.startNode();return this.next(),this.flowParseInterface(i)}else if(this.plugins.get("flow").enums&&this.isContextual(126)){e.exportKind="value";let i=this.startNode();return this.next(),this.flowParseEnumDeclaration(i)}else return super.parseExportDeclaration(e)}eatExportStar(e){return super.eatExportStar(e)?!0:this.isContextual(130)&&this.lookahead().type===55?(e.exportKind="type",this.next(),this.next(),!0):!1}maybeParseExportNamespaceSpecifier(e){let{startLoc:i}=this.state,n=super.maybeParseExportNamespaceSpecifier(e);return n&&e.exportKind==="type"&&this.unexpected(i),n}parseClassId(e,i,n){super.parseClassId(e,i,n),this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration())}parseClassMember(e,i,n){let{startLoc:s}=this.state;if(this.isContextual(125)){if(super.parseClassMemberFromModifier(e,i))return;i.declare=!0}super.parseClassMember(e,i,n),i.declare&&(i.type!=="ClassProperty"&&i.type!=="ClassPrivateProperty"&&i.type!=="PropertyDefinition"?this.raise(X.DeclareClassElement,s):i.value&&this.raise(X.DeclareClassFieldInitializer,i.value))}isIterator(e){return e==="iterator"||e==="asyncIterator"}readIterator(){let e=super.readWord1(),i="@@"+e;(!this.isIterator(e)||!this.state.inType)&&this.raise(S.InvalidIdentifier,this.state.curPosition(),{identifierName:i}),this.finishToken(132,i)}getTokenFromCode(e){let i=this.input.charCodeAt(this.state.pos+1);e===123&&i===124?this.finishOp(6,2):this.state.inType&&(e===62||e===60)?this.finishOp(e===62?48:47,1):this.state.inType&&e===63?i===46?this.finishOp(18,2):this.finishOp(17,1):qM(e,i,this.input.charCodeAt(this.state.pos+2))?(this.state.pos+=2,this.readIterator()):super.getTokenFromCode(e)}isAssignable(e,i){return e.type==="TypeCastExpression"?this.isAssignable(e.expression,i):super.isAssignable(e,i)}toAssignable(e,i=!1){!i&&e.type==="AssignmentExpression"&&e.left.type==="TypeCastExpression"&&(e.left=this.typeCastToParameter(e.left)),super.toAssignable(e,i)}toAssignableList(e,i,n){for(let s=0;s<e.length;s++){let o=e[s];o?.type==="TypeCastExpression"&&(e[s]=this.typeCastToParameter(o))}super.toAssignableList(e,i,n)}toReferencedList(e,i){for(let s=0;s<e.length;s++){var n;let o=e[s];o&&o.type==="TypeCastExpression"&&!((n=o.extra)!=null&&n.parenthesized)&&(e.length>1||!i)&&this.raise(X.TypeCastInPattern,o.typeAnnotation)}return e}parseArrayLike(e,i,n,s){let o=super.parseArrayLike(e,i,n,s);return i&&!this.state.maybeInArrowParameters&&this.toReferencedList(o.elements),o}isValidLVal(e,i,n){return e==="TypeCastExpression"||super.isValidLVal(e,i,n)}parseClassProperty(e){return this.match(14)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassProperty(e)}parseClassPrivateProperty(e){return this.match(14)&&(e.typeAnnotation=this.flowParseTypeAnnotation()),super.parseClassPrivateProperty(e)}isClassMethod(){return this.match(47)||super.isClassMethod()}isClassProperty(){return this.match(14)||super.isClassProperty()}isNonstaticConstructor(e){return!this.match(14)&&super.isNonstaticConstructor(e)}pushClassMethod(e,i,n,s,o,a){if(i.variance&&this.unexpected(i.variance.loc.start),delete i.variance,this.match(47)&&(i.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassMethod(e,i,n,s,o,a),i.params&&o){let l=i.params;l.length>0&&this.isThisParam(l[0])&&this.raise(X.ThisParamBannedInConstructor,i)}else if(i.type==="MethodDefinition"&&o&&i.value.params){let l=i.value.params;l.length>0&&this.isThisParam(l[0])&&this.raise(X.ThisParamBannedInConstructor,i)}}pushClassPrivateMethod(e,i,n,s){i.variance&&this.unexpected(i.variance.loc.start),delete i.variance,this.match(47)&&(i.typeParameters=this.flowParseTypeParameterDeclaration()),super.pushClassPrivateMethod(e,i,n,s)}parseClassSuper(e){if(super.parseClassSuper(e),e.superClass&&this.match(47)&&(e.superTypeParameters=this.flowParseTypeParameterInstantiation()),this.isContextual(113)){this.next();let i=e.implements=[];do{let n=this.startNode();n.id=this.flowParseRestrictedIdentifier(!0),this.match(47)?n.typeParameters=this.flowParseTypeParameterInstantiation():n.typeParameters=null,i.push(this.finishNode(n,"ClassImplements"))}while(this.eat(12))}}checkGetterSetterParams(e){super.checkGetterSetterParams(e);let i=this.getObjectOrClassMethodParams(e);if(i.length>0){let n=i[0];this.isThisParam(n)&&e.kind==="get"?this.raise(X.GetterMayNotHaveThisParam,n):this.isThisParam(n)&&this.raise(X.SetterMayNotHaveThisParam,n)}}parsePropertyNamePrefixOperator(e){e.variance=this.flowParseVariance()}parseObjPropValue(e,i,n,s,o,a,l){e.variance&&this.unexpected(e.variance.loc.start),delete e.variance;let u;this.match(47)&&!a&&(u=this.flowParseTypeParameterDeclaration(),this.match(10)||this.unexpected());let c=super.parseObjPropValue(e,i,n,s,o,a,l);return u&&((c.value||c).typeParameters=u),c}parseFunctionParamType(e){return this.eat(17)&&(e.type!=="Identifier"&&this.raise(X.PatternIsOptional,e),this.isThisParam(e)&&this.raise(X.ThisParamMayNotBeOptional,e),e.optional=!0),this.match(14)?e.typeAnnotation=this.flowParseTypeAnnotation():this.isThisParam(e)&&this.raise(X.ThisParamAnnotationRequired,e),this.match(29)&&this.isThisParam(e)&&this.raise(X.ThisParamNoDefault,e),this.resetEndLocation(e),e}parseMaybeDefault(e,i){let n=super.parseMaybeDefault(e,i);return n.type==="AssignmentPattern"&&n.typeAnnotation&&n.right.start<n.typeAnnotation.start&&this.raise(X.TypeBeforeInitializer,n.typeAnnotation),n}checkImportReflection(e){super.checkImportReflection(e),e.module&&e.importKind!=="value"&&this.raise(X.ImportReflectionHasImportType,e.specifiers[0].loc.start)}parseImportSpecifierLocal(e,i,n){i.local=Tv(e)?this.flowParseRestrictedIdentifier(!0,!0):this.parseIdentifier(),e.specifiers.push(this.finishImportSpecifier(i,n))}isPotentialImportPhase(e){if(super.isPotentialImportPhase(e))return!0;if(this.isContextual(130)){if(!e)return!0;let i=this.lookaheadCharCode();return i===123||i===42}return!e&&this.isContextual(87)}applyImportPhase(e,i,n,s){if(super.applyImportPhase(e,i,n,s),i){if(!n&&this.match(65))return;e.exportKind=n==="type"?n:"value"}else n==="type"&&this.match(55)&&this.unexpected(),e.importKind=n==="type"||n==="typeof"?n:"value"}parseImportSpecifier(e,i,n,s,o){let a=e.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&&!Br(this.state.type)?(e.imported=p,e.importKind=l,e.local=Wi(p)):(e.imported=a,e.importKind=null,e.local=this.parseIdentifier())}else{if(l!==null&&Br(this.state.type))e.imported=this.parseIdentifier(!0),e.importKind=l;else{if(i)throw this.raise(S.ImportBindingIsString,e,{importName:a.value});e.imported=a,e.importKind=null}this.eatContextual(93)?e.local=this.parseIdentifier():(u=!0,e.local=Wi(e.imported))}let c=Tv(e);return n&&c&&this.raise(X.ImportTypeShorthandOnlyInPureImport,e),(n||c)&&this.checkReservedType(e.local.name,e.local.loc.start,!0),u&&!n&&!c&&this.checkReservedWord(e.local.name,e.loc.start,!0,!0),this.finishImportSpecifier(e,"ImportSpecifier")}parseBindingAtom(){switch(this.state.type){case 78:return this.parseIdentifier(!0);default:return super.parseBindingAtom()}}parseFunctionParams(e,i){let n=e.kind;n!=="get"&&n!=="set"&&this.match(47)&&(e.typeParameters=this.flowParseTypeParameterDeclaration()),super.parseFunctionParams(e,i)}parseVarId(e,i){super.parseVarId(e,i),this.match(14)&&(e.id.typeAnnotation=this.flowParseTypeAnnotation(),this.resetEndLocation(e.id))}parseAsyncArrowFromCallExpression(e,i){if(this.match(14)){let n=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0,e.returnType=this.flowParseTypeAnnotation(),this.state.noAnonFunctionType=n}return super.parseAsyncArrowFromCallExpression(e,i)}shouldParseAsyncArrow(){return this.match(14)||super.shouldParseAsyncArrow()}parseMaybeAssign(e,i){var n;let s=null,o;if(this.hasPlugin("jsx")&&(this.match(142)||this.match(47))){if(s=this.state.clone(),o=this.tryParse(()=>super.parseMaybeAssign(e,i),s),!o.error)return o.node;let{context:u}=this.state,c=u[u.length-1];(c===Le.j_oTag||c===Le.j_expr)&&u.pop()}if((n=o)!=null&&n.error||this.match(47)){var a,l;s=s||this.state.clone();let u,c=this.tryParse(d=>{var h;u=this.flowParseTypeParameterDeclaration();let f=this.forwardNoArrowParamsConversionAt(u,()=>{let m=super.parseMaybeAssign(e,i);return this.resetStartLocationFromNode(m,u),m});(h=f.extra)!=null&&h.parenthesized&&d();let g=this.maybeUnwrapTypeCastExpression(f);return g.type!=="ArrowFunctionExpression"&&d(),g.typeParameters=u,this.resetStartLocationFromNode(g,u),f},s),p=null;if(c.node&&this.maybeUnwrapTypeCastExpression(c.node).type==="ArrowFunctionExpression"){if(!c.error&&!c.aborted)return c.node.async&&this.raise(X.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(X.UnexpectedTokenAfterTypeParameter,u)}return super.parseMaybeAssign(e,i)}parseArrow(e){if(this.match(14)){let i=this.tryParse(()=>{let n=this.state.noAnonFunctionType;this.state.noAnonFunctionType=!0;let s=this.startNode();return[s.typeAnnotation,e.predicate]=this.flowParseTypeAndPredicateInitialiser(),this.state.noAnonFunctionType=n,this.canInsertSemicolon()&&this.unexpected(),this.match(19)||this.unexpected(),s});if(i.thrown)return null;i.error&&(this.state=i.failState),e.returnType=i.node.typeAnnotation?this.finishNode(i.node,"TypeAnnotation"):null}return super.parseArrow(e)}shouldParseArrow(e){return this.match(14)||super.shouldParseArrow(e)}setArrowFunctionParameters(e,i){this.state.noArrowParamsConversionAt.includes(e.start)?e.params=i:super.setArrowFunctionParameters(e,i)}checkParams(e,i,n,s=!0){if(!(n&&this.state.noArrowParamsConversionAt.includes(e.start))){for(let o=0;o<e.params.length;o++)this.isThisParam(e.params[o])&&o>0&&this.raise(X.ThisParamMustBeFirst,e.params[o]);super.checkParams(e,i,n,s)}}parseParenAndDistinguishExpression(e){return super.parseParenAndDistinguishExpression(e&&!this.state.noArrowAt.includes(this.state.start))}parseSubscripts(e,i,n){if(e.type==="Identifier"&&e.name==="async"&&this.state.noArrowAt.includes(i.index)){this.next();let s=this.startNodeAt(i);s.callee=e,s.arguments=super.parseCallExpressionArguments(11,!1),e=this.finishNode(s,"CallExpression")}else if(e.type==="Identifier"&&e.name==="async"&&this.match(47)){let s=this.state.clone(),o=this.tryParse(l=>this.parseAsyncArrowWithTypeParameters(i)||l(),s);if(!o.error&&!o.aborted)return o.node;let a=this.tryParse(()=>super.parseSubscripts(e,i,n),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(e,i,n)}parseSubscript(e,i,n,s){if(this.match(18)&&this.isLookaheadToken_lt()){if(s.optionalChainMember=!0,n)return s.stop=!0,e;this.next();let o=this.startNodeAt(i);return o.callee=e,o.typeArguments=this.flowParseTypeParameterInstantiation(),this.expect(10),o.arguments=this.parseCallExpressionArguments(11,!1),o.optional=!0,this.finishCallExpression(o,!0)}else if(!n&&this.shouldParseTypes()&&this.match(47)){let o=this.startNodeAt(i);o.callee=e;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(e,i,n,s)}parseNewCallee(e){super.parseNewCallee(e);let i=null;this.shouldParseTypes()&&this.match(47)&&(i=this.tryParse(()=>this.flowParseTypeParameterInstantiationCallOrNew()).node),e.typeArguments=i}parseAsyncArrowWithTypeParameters(e){let i=this.startNodeAt(e);if(this.parseFunctionParams(i,!1),!!this.parseArrow(i))return super.parseArrowExpression(i,void 0,!0)}readToken_mult_modulo(e){let i=this.input.charCodeAt(this.state.pos+1);if(e===42&&i===47&&this.state.hasFlowComment){this.state.hasFlowComment=!1,this.state.pos+=2,this.nextToken();return}super.readToken_mult_modulo(e)}readToken_pipe_amp(e){let i=this.input.charCodeAt(this.state.pos+1);if(e===124&&i===125){this.finishOp(9,2);return}super.readToken_pipe_amp(e)}parseTopLevel(e,i){let n=super.parseTopLevel(e,i);return this.state.hasFlowComment&&this.raise(X.UnterminatedFlowComment,this.state.curPosition()),n}skipBlockComment(){if(this.hasPlugin("flowComments")&&this.skipFlowComment()){if(this.state.hasFlowComment)throw this.raise(X.NestedFlowComment,this.state.startLoc);this.hasFlowCommentCompletion();let e=this.skipFlowComment();e&&(this.state.pos+=e,this.state.hasFlowComment=!0);return}return super.skipBlockComment(this.state.hasFlowComment?"*-/":"*/")}skipFlowComment(){let{pos:e}=this.state,i=2;for(;[32,9].includes(this.input.charCodeAt(e+i));)i++;let n=this.input.charCodeAt(i+e),s=this.input.charCodeAt(i+e+1);return n===58&&s===58?i+2:this.input.slice(i+e,i+e+12)==="flow-include"?i+12:n===58&&s!==58?i:!1}hasFlowCommentCompletion(){if(this.input.indexOf("*/",this.state.pos)===-1)throw this.raise(S.UnterminatedComment,this.state.curPosition())}flowEnumErrorBooleanMemberNotInitialized(e,{enumName:i,memberName:n}){this.raise(X.EnumBooleanMemberNotInitialized,e,{memberName:n,enumName:i})}flowEnumErrorInvalidMemberInitializer(e,i){return this.raise(i.explicitType?i.explicitType==="symbol"?X.EnumInvalidMemberInitializerSymbolType:X.EnumInvalidMemberInitializerPrimaryType:X.EnumInvalidMemberInitializerUnknownType,e,i)}flowEnumErrorNumberMemberNotInitialized(e,i){this.raise(X.EnumNumberMemberNotInitialized,e,i)}flowEnumErrorStringMemberInconsistentlyInitialized(e,i){this.raise(X.EnumStringMemberInconsistentlyInitialized,e,i)}flowEnumMemberInit(){let e=this.state.startLoc,i=()=>this.match(12)||this.match(8);switch(this.state.type){case 134:{let n=this.parseNumericLiteral(this.state.value);return i()?{type:"number",loc:n.loc.start,value:n}:{type:"invalid",loc:e}}case 133:{let n=this.parseStringLiteral(this.state.value);return i()?{type:"string",loc:n.loc.start,value:n}:{type:"invalid",loc:e}}case 85:case 86:{let n=this.parseBooleanLiteral(this.match(85));return i()?{type:"boolean",loc:n.loc.start,value:n}:{type:"invalid",loc:e}}default:return{type:"invalid",loc:e}}}flowEnumMemberRaw(){let e=this.state.startLoc,i=this.parseIdentifier(!0),n=this.eat(29)?this.flowEnumMemberInit():{type:"none",loc:e};return{id:i,init:n}}flowEnumCheckExplicitTypeMismatch(e,i,n){let{explicitType:s}=i;s!==null&&s!==n&&this.flowEnumErrorInvalidMemberInitializer(e,i)}flowEnumMembers({enumName:e,explicitType:i}){let n=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(X.EnumInvalidMemberName,l,{memberName:c,suggestion:c[0].toUpperCase()+c.slice(1),enumName:e}),n.has(c)&&this.raise(X.EnumDuplicateMemberName,l,{memberName:c,enumName:e}),n.add(c);let p={enumName:e,explicitType:i,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(i){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(e,i,{enumName:n}){if(e.length===0)return i;if(i.length===0)return e;if(i.length>e.length){for(let s of e)this.flowEnumErrorStringMemberInconsistentlyInitialized(s,{enumName:n});return i}else{for(let s of i)this.flowEnumErrorStringMemberInconsistentlyInitialized(s,{enumName:n});return e}}flowEnumParseExplicitType({enumName:e}){if(!this.eatContextual(102))return null;if(!we(this.state.type))throw this.raise(X.EnumInvalidExplicitTypeUnknownSupplied,this.state.startLoc,{enumName:e});let{value:i}=this.state;return this.next(),i!=="boolean"&&i!=="number"&&i!=="string"&&i!=="symbol"&&this.raise(X.EnumInvalidExplicitType,this.state.startLoc,{enumName:e,invalidEnumType:i}),i}flowEnumBody(e,i){let n=i.name,s=i.loc.start,o=this.flowEnumParseExplicitType({enumName:n});this.expect(5);let{members:a,hasUnknownMembers:l}=this.flowEnumMembers({enumName:n,explicitType:o});switch(e.hasUnknownMembers=l,o){case"boolean":return e.explicitType=!0,e.members=a.booleanMembers,this.expect(8),this.finishNode(e,"EnumBooleanBody");case"number":return e.explicitType=!0,e.members=a.numberMembers,this.expect(8),this.finishNode(e,"EnumNumberBody");case"string":return e.explicitType=!0,e.members=this.flowEnumStringMembers(a.stringMembers,a.defaultedMembers,{enumName:n}),this.expect(8),this.finishNode(e,"EnumStringBody");case"symbol":return e.members=a.defaultedMembers,this.expect(8),this.finishNode(e,"EnumSymbolBody");default:{let u=()=>(e.members=[],this.expect(8),this.finishNode(e,"EnumStringBody"));e.explicitType=!1;let c=a.booleanMembers.length,p=a.numberMembers.length,d=a.stringMembers.length,h=a.defaultedMembers.length;if(!c&&!p&&!d&&!h)return u();if(!c&&!p)return e.members=this.flowEnumStringMembers(a.stringMembers,a.defaultedMembers,{enumName:n}),this.expect(8),this.finishNode(e,"EnumStringBody");if(!p&&!d&&c>=h){for(let f of a.defaultedMembers)this.flowEnumErrorBooleanMemberNotInitialized(f.loc.start,{enumName:n,memberName:f.id.name});return e.members=a.booleanMembers,this.expect(8),this.finishNode(e,"EnumBooleanBody")}else if(!c&&!d&&p>=h){for(let f of a.defaultedMembers)this.flowEnumErrorNumberMemberNotInitialized(f.loc.start,{enumName:n,memberName:f.id.name});return e.members=a.numberMembers,this.expect(8),this.finishNode(e,"EnumNumberBody")}else return this.raise(X.EnumInconsistentMemberValues,s,{enumName:n}),u()}}}flowParseEnumDeclaration(e){let i=this.parseIdentifier();return e.id=i,e.body=this.flowEnumBody(this.startNode(),i),this.finishNode(e,"EnumDeclaration")}isLookaheadToken_lt(){let e=this.nextTokenStart();if(this.input.charCodeAt(e)===60){let i=this.input.charCodeAt(e+1);return i!==60&&i!==61}return!1}maybeUnwrapTypeCastExpression(e){return e.type==="TypeCastExpression"?e.expression:e}},uB={__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"},Gn=zi`jsx`({AttributeIsEmpty:"JSX attributes must only be assigned a non-empty expression.",MissingClosingTagElement:({openingTagName:t})=>`Expected corresponding JSX closing tag for <${t}>.`,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:t,HTMLEntity:r})=>`Unexpected token \`${t}\`. Did you mean \`${r}\` or \`{'${t}'}\`?`,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 yn(t){return t?t.type==="JSXOpeningFragment"||t.type==="JSXClosingFragment":!1}function Rs(t){if(t.type==="JSXIdentifier")return t.name;if(t.type==="JSXNamespacedName")return t.namespace.name+":"+t.name.name;if(t.type==="JSXMemberExpression")return Rs(t.object)+"."+Rs(t.property);throw new Error("Node had unexpected type: "+t.type)}var cB=t=>class extends t{jsxReadToken(){let e="",i=this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(Gn.UnterminatedJsxContent,this.state.startLoc);let n=this.input.charCodeAt(this.state.pos);switch(n){case 60:case 123:if(this.state.pos===this.state.start){n===60&&this.state.canStartJSXElement?(++this.state.pos,this.finishToken(142)):super.getTokenFromCode(n);return}e+=this.input.slice(i,this.state.pos),this.finishToken(141,e);return;case 38:e+=this.input.slice(i,this.state.pos),e+=this.jsxReadEntity(),i=this.state.pos;break;case 62:case 125:default:Ms(n)?(e+=this.input.slice(i,this.state.pos),e+=this.jsxReadNewLine(!0),i=this.state.pos):++this.state.pos}}}jsxReadNewLine(e){let i=this.input.charCodeAt(this.state.pos),n;return++this.state.pos,i===13&&this.input.charCodeAt(this.state.pos)===10?(++this.state.pos,n=e?`
|
|
117
117
|
`:`\r
|
|
118
118
|
`):n=String.fromCharCode(i),++this.state.curLine,this.state.lineStart=this.state.pos,n}jsxReadString(e){let i="",n=++this.state.pos;for(;;){if(this.state.pos>=this.length)throw this.raise(S.UnterminatedString,this.state.startLoc);let s=this.input.charCodeAt(this.state.pos);if(s===e)break;s===38?(i+=this.input.slice(n,this.state.pos),i+=this.jsxReadEntity(),n=this.state.pos):Ms(s)?(i+=this.input.slice(n,this.state.pos),i+=this.jsxReadNewLine(!1),n=this.state.pos):++this.state.pos}i+=this.input.slice(n,this.state.pos++),this.finishToken(133,i)}jsxReadEntity(){let e=++this.state.pos;if(this.codePointAtPos(this.state.pos)===35){++this.state.pos;let i=10;this.codePointAtPos(this.state.pos)===120&&(i=16,++this.state.pos);let n=this.readInt(i,void 0,!1,"bail");if(n!==null&&this.codePointAtPos(this.state.pos)===59)return++this.state.pos,String.fromCodePoint(n)}else{let i=0,n=!1;for(;i++<10&&this.state.pos<this.length&&!(n=this.codePointAtPos(this.state.pos)===59);)++this.state.pos;if(n){let s=this.input.slice(e,this.state.pos),o=uB[s];if(++this.state.pos,o)return o}}return this.state.pos=e,"&"}jsxReadWord(){let e,i=this.state.pos;do e=this.input.charCodeAt(++this.state.pos);while(Ls(e)||e===45);this.finishToken(140,this.input.slice(i,this.state.pos))}jsxParseIdentifier(){let e=this.startNode();return this.match(140)?e.name=this.state.value:mh(this.state.type)?e.name=bn(this.state.type):this.unexpected(),this.next(),this.finishNode(e,"JSXIdentifier")}jsxParseNamespacedName(){let e=this.state.startLoc,i=this.jsxParseIdentifier();if(!this.eat(14))return i;let n=this.startNodeAt(e);return n.namespace=i,n.name=this.jsxParseIdentifier(),this.finishNode(n,"JSXNamespacedName")}jsxParseElementName(){let e=this.state.startLoc,i=this.jsxParseNamespacedName();if(i.type==="JSXNamespacedName")return i;for(;this.eat(16);){let n=this.startNodeAt(e);n.object=i,n.property=this.jsxParseIdentifier(),i=this.finishNode(n,"JSXMemberExpression")}return i}jsxParseAttributeValue(){let e;switch(this.state.type){case 5:return e=this.startNode(),this.setContext(Le.brace),this.next(),e=this.jsxParseExpressionContainer(e,Le.j_oTag),e.expression.type==="JSXEmptyExpression"&&this.raise(Gn.AttributeIsEmpty,e),e;case 142:case 133:return this.parseExprAtom();default:throw this.raise(Gn.UnsupportedJsxValue,this.state.startLoc)}}jsxParseEmptyExpression(){let e=this.startNodeAt(this.state.lastTokEndLoc);return this.finishNodeAt(e,"JSXEmptyExpression",this.state.startLoc)}jsxParseSpreadChild(e){return this.next(),e.expression=this.parseExpression(),this.setContext(Le.j_expr),this.state.canStartJSXElement=!0,this.expect(8),this.finishNode(e,"JSXSpreadChild")}jsxParseExpressionContainer(e,i){if(this.match(8))e.expression=this.jsxParseEmptyExpression();else{let n=this.parseExpression();e.expression=n}return this.setContext(i),this.state.canStartJSXElement=!0,this.expect(8),this.finishNode(e,"JSXExpressionContainer")}jsxParseAttribute(){let e=this.startNode();return this.match(5)?(this.setContext(Le.brace),this.next(),this.expect(21),e.argument=this.parseMaybeAssignAllowIn(),this.setContext(Le.j_oTag),this.state.canStartJSXElement=!0,this.expect(8),this.finishNode(e,"JSXSpreadAttribute")):(e.name=this.jsxParseNamespacedName(),e.value=this.eat(29)?this.jsxParseAttributeValue():null,this.finishNode(e,"JSXAttribute"))}jsxParseOpeningElementAt(e){let i=this.startNodeAt(e);return this.eat(143)?this.finishNode(i,"JSXOpeningFragment"):(i.name=this.jsxParseElementName(),this.jsxParseOpeningElementAfterName(i))}jsxParseOpeningElementAfterName(e){let i=[];for(;!this.match(56)&&!this.match(143);)i.push(this.jsxParseAttribute());return e.attributes=i,e.selfClosing=this.eat(56),this.expect(143),this.finishNode(e,"JSXOpeningElement")}jsxParseClosingElementAt(e){let i=this.startNodeAt(e);return this.eat(143)?this.finishNode(i,"JSXClosingFragment"):(i.name=this.jsxParseElementName(),this.expect(143),this.finishNode(i,"JSXClosingElement"))}jsxParseElementAt(e){let i=this.startNodeAt(e),n=[],s=this.jsxParseOpeningElementAt(e),o=null;if(!s.selfClosing){e:for(;;)switch(this.state.type){case 142:if(e=this.state.startLoc,this.next(),this.eat(56)){o=this.jsxParseClosingElementAt(e);break e}n.push(this.jsxParseElementAt(e));break;case 141:n.push(this.parseLiteral(this.state.value,"JSXText"));break;case 5:{let a=this.startNode();this.setContext(Le.brace),this.next(),this.match(21)?n.push(this.jsxParseSpreadChild(a)):n.push(this.jsxParseExpressionContainer(a,Le.j_expr));break}default:this.unexpected()}yn(s)&&!yn(o)&&o!==null?this.raise(Gn.MissingClosingTagFragment,o):!yn(s)&&yn(o)?this.raise(Gn.MissingClosingTagElement,o,{openingTagName:Rs(s.name)}):!yn(s)&&!yn(o)&&Rs(o.name)!==Rs(s.name)&&this.raise(Gn.MissingClosingTagElement,o,{openingTagName:Rs(s.name)})}if(yn(s)?(i.openingFragment=s,i.closingFragment=o):(i.openingElement=s,i.closingElement=o),i.children=n,this.match(47))throw this.raise(Gn.UnwrappedAdjacentJSXElements,this.state.startLoc);return yn(s)?this.finishNode(i,"JSXFragment"):this.finishNode(i,"JSXElement")}jsxParseElement(){let e=this.state.startLoc;return this.next(),this.jsxParseElementAt(e)}setContext(e){let{context:i}=this.state;i[i.length-1]=e}parseExprAtom(e){return this.match(142)?this.jsxParseElement():this.match(47)&&this.input.charCodeAt(this.state.pos)!==33?(this.replaceToken(142),this.jsxParseElement()):super.parseExprAtom(e)}skipSpace(){this.curContext().preserveSpace||super.skipSpace()}getTokenFromCode(e){let i=this.curContext();if(i===Le.j_expr){this.jsxReadToken();return}if(i===Le.j_oTag||i===Le.j_cTag){if(Vi(e)){this.jsxReadWord();return}if(e===62){++this.state.pos,this.finishToken(143);return}if((e===34||e===39)&&i===Le.j_oTag){this.jsxReadString(e);return}}if(e===60&&this.state.canStartJSXElement&&this.input.charCodeAt(this.state.pos+1)!==33){++this.state.pos,this.finishToken(142);return}super.getTokenFromCode(e)}updateContext(e){let{context:i,type:n}=this.state;if(n===56&&e===142)i.splice(-2,2,Le.j_cTag),this.state.canStartJSXElement=!1;else if(n===142)i.push(Le.j_oTag);else if(n===143){let s=i[i.length-1];s===Le.j_oTag&&e===56||s===Le.j_cTag?(i.pop(),this.state.canStartJSXElement=i[i.length-1]===Le.j_expr):(this.setContext(Le.j_expr),this.state.canStartJSXElement=!0)}else this.state.canStartJSXElement=TM(n)}},nh=class extends ga{constructor(...r){super(...r),this.tsNames=new Map}},sh=class extends ya{constructor(...r){super(...r),this.importsStack=[]}createScope(r){return this.importsStack.push(new Set),new nh(r)}enter(r){r===256&&this.importsStack.push(new Set),super.enter(r)}exit(){let r=super.exit();return r===256&&this.importsStack.pop(),r}hasImport(r,e){let i=this.importsStack.length;if(this.importsStack[i-1].has(r))return!0;if(!e&&i>1){for(let n=0;n<i-1;n++)if(this.importsStack[n].has(r))return!0}return!1}declareName(r,e,i){if(e&4096){this.hasImport(r,!0)&&this.parser.raise(S.VarRedeclaration,i,{identifierName:r}),this.importsStack[this.importsStack.length-1].add(r);return}let n=this.currentScope(),s=n.tsNames.get(r)||0;if(e&1024){this.maybeExportDefined(n,r),n.tsNames.set(r,s|16);return}super.declareName(r,e,i),e&2&&(e&1||(this.checkRedeclarationInScope(n,r,e,i),this.maybeExportDefined(n,r)),s=s|1),e&256&&(s=s|2),e&512&&(s=s|4),e&128&&(s=s|8),s&&n.tsNames.set(r,s)}isRedeclaredInScope(r,e,i){let n=r.tsNames.get(e);if((n&2)>0){if(i&256){let s=!!(i&512),o=(n&4)>0;return s!==o}return!0}return i&128&&(n&8)>0?r.names.get(e)&2?!!(i&1):!1:i&2&&(n&1)>0?!0:super.isRedeclaredInScope(r,e,i)}checkLocalExport(r){let{name:e}=r;if(this.hasImport(e))return;let i=this.scopeStack.length;for(let n=i-1;n>=0;n--){let o=this.scopeStack[n].tsNames.get(e);if((o&1)>0||(o&16)>0)return}super.checkLocalExport(r)}},Vv=t=>t.type==="ParenthesizedExpression"?Vv(t.expression):t,oh=class extends ih{toAssignable(r,e=!1){var i,n;let s;switch((r.type==="ParenthesizedExpression"||(i=r.extra)!=null&&i.parenthesized)&&(s=Vv(r),e?s.type==="Identifier"?this.expressionScope.recordArrowParameterBindingError(S.InvalidParenthesizedAssignment,r):s.type!=="MemberExpression"&&!this.isOptionalMemberExpression(s)&&this.raise(S.InvalidParenthesizedAssignment,r):this.raise(S.InvalidParenthesizedAssignment,r)),r.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":r.type="ObjectPattern";for(let a=0,l=r.properties.length,u=l-1;a<l;a++){var o;let c=r.properties[a],p=a===u;this.toAssignableObjectExpressionProp(c,p,e),p&&c.type==="RestElement"&&(o=r.extra)!=null&&o.trailingCommaLoc&&this.raise(S.RestTrailingComma,r.extra.trailingCommaLoc)}break;case"ObjectProperty":{let{key:a,value:l}=r;this.isPrivateName(a)&&this.classScope.usePrivateName(this.getPrivateNameSV(a),a.loc.start),this.toAssignable(l,e);break}case"SpreadElement":throw new Error("Internal @babel/parser error (this is a bug, please report it). SpreadElement should be converted by .toAssignable's caller.");case"ArrayExpression":r.type="ArrayPattern",this.toAssignableList(r.elements,(n=r.extra)==null?void 0:n.trailingCommaLoc,e);break;case"AssignmentExpression":r.operator!=="="&&this.raise(S.MissingEqInAssignment,r.left.loc.end),r.type="AssignmentPattern",delete r.operator,this.toAssignable(r.left,e);break;case"ParenthesizedExpression":this.toAssignable(s,e);break}}toAssignableObjectExpressionProp(r,e,i){if(r.type==="ObjectMethod")this.raise(r.kind==="get"||r.kind==="set"?S.PatternHasAccessor:S.PatternHasMethod,r.key);else if(r.type==="SpreadElement"){r.type="RestElement";let n=r.argument;this.checkToRestConversion(n,!1),this.toAssignable(n,i),e||this.raise(S.RestTrailingComma,r)}else this.toAssignable(r,i)}toAssignableList(r,e,i){let n=r.length-1;for(let s=0;s<=n;s++){let o=r[s];if(o){if(o.type==="SpreadElement"){o.type="RestElement";let a=o.argument;this.checkToRestConversion(a,!0),this.toAssignable(a,i)}else this.toAssignable(o,i);o.type==="RestElement"&&(s<n?this.raise(S.RestTrailingComma,o):e&&this.raise(S.RestTrailingComma,e))}}}isAssignable(r,e){switch(r.type){case"Identifier":case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":return!0;case"ObjectExpression":{let i=r.properties.length-1;return r.properties.every((n,s)=>n.type!=="ObjectMethod"&&(s===i||n.type!=="SpreadElement")&&this.isAssignable(n))}case"ObjectProperty":return this.isAssignable(r.value);case"SpreadElement":return this.isAssignable(r.argument);case"ArrayExpression":return r.elements.every(i=>i===null||this.isAssignable(i));case"AssignmentExpression":return r.operator==="=";case"ParenthesizedExpression":return this.isAssignable(r.expression);case"MemberExpression":case"OptionalMemberExpression":return!e;default:return!1}}toReferencedList(r,e){return r}toReferencedListDeep(r,e){this.toReferencedList(r,e);for(let i of r)i?.type==="ArrayExpression"&&this.toReferencedListDeep(i.elements)}parseSpread(r){let e=this.startNode();return this.next(),e.argument=this.parseMaybeAssignAllowIn(r,void 0),this.finishNode(e,"SpreadElement")}parseRestBinding(){let r=this.startNode();return this.next(),r.argument=this.parseBindingAtom(),this.finishNode(r,"RestElement")}parseBindingAtom(){switch(this.state.type){case 0:{let r=this.startNode();return this.next(),r.elements=this.parseBindingList(3,93,1),this.finishNode(r,"ArrayPattern")}case 5:return this.parseObjectLike(8,!0)}return this.parseIdentifier()}parseBindingList(r,e,i){let n=i&1,s=[],o=!0;for(;!this.eat(r);)if(o?o=!1:this.expect(12),n&&this.match(12))s.push(null);else{if(this.eat(r))break;if(this.match(21)){let a=this.parseRestBinding();if((this.hasPlugin("flow")||i&2)&&(a=this.parseFunctionParamType(a)),s.push(a),!this.checkCommaAfterRest(e)){this.expect(r);break}}else{let a=[];for(this.match(26)&&this.hasPlugin("decorators")&&this.raise(S.UnsupportedParameterDecorator,this.state.startLoc);this.match(26);)a.push(this.parseDecorator());s.push(this.parseAssignableListItem(i,a))}}return s}parseBindingRestProperty(r){return this.next(),r.argument=this.parseIdentifier(),this.checkCommaAfterRest(125),this.finishNode(r,"RestElement")}parseBindingProperty(){let{type:r,startLoc:e}=this.state;if(r===21)return this.parseBindingRestProperty(this.startNode());let i=this.startNode();return r===138?(this.expectPlugin("destructuringPrivate",e),this.classScope.usePrivateName(this.state.value,e),i.key=this.parsePrivateName()):this.parsePropertyName(i),i.method=!1,this.parseObjPropValue(i,e,!1,!1,!0,!1)}parseAssignableListItem(r,e){let i=this.parseMaybeDefault();(this.hasPlugin("flow")||r&2)&&this.parseFunctionParamType(i);let n=this.parseMaybeDefault(i.loc.start,i);return e.length&&(i.decorators=e),n}parseFunctionParamType(r){return r}parseMaybeDefault(r,e){var i,n;if((i=r)!=null||(r=this.state.startLoc),e=(n=e)!=null?n:this.parseBindingAtom(),!this.eat(29))return e;let s=this.startNodeAt(r);return s.left=e,s.right=this.parseMaybeAssignAllowIn(),this.finishNode(s,"AssignmentPattern")}isValidLVal(r,e,i){switch(r){case"AssignmentPattern":return"left";case"RestElement":return"argument";case"ObjectProperty":return"value";case"ParenthesizedExpression":return"expression";case"ArrayPattern":return"elements";case"ObjectPattern":return"properties"}return!1}isOptionalMemberExpression(r){return r.type==="OptionalMemberExpression"}checkLVal(r,e,i=64,n=!1,s=!1,o=!1){var a;let l=r.type;if(this.isObjectMethod(r))return;let u=this.isOptionalMemberExpression(r);if(u||l==="MemberExpression"){u&&(this.expectPlugin("optionalChainingAssign",r.loc.start),e.type!=="AssignmentExpression"&&this.raise(S.InvalidLhsOptionalChaining,r,{ancestor:e})),i!==64&&this.raise(S.InvalidPropertyBindingPattern,r);return}if(l==="Identifier"){this.checkIdentifier(r,i,s);let{name:g}=r;n&&(n.has(g)?this.raise(S.ParamDupe,r):n.add(g));return}let c=this.isValidLVal(l,!(o||(a=r.extra)!=null&&a.parenthesized)&&e.type==="AssignmentExpression",i);if(c===!0)return;if(c===!1){let g=i===64?S.InvalidLhs:S.InvalidLhsBinding;this.raise(g,r,{ancestor:e});return}let p,d;typeof c=="string"?(p=c,d=l==="ParenthesizedExpression"):[p,d]=c;let h=l==="ArrayPattern"||l==="ObjectPattern"?{type:l}:e,f=r[p];if(Array.isArray(f))for(let g of f)g&&this.checkLVal(g,h,i,n,s,d);else f&&this.checkLVal(f,h,i,n,s,d)}checkIdentifier(r,e,i=!1){this.state.strict&&(i?$v(r.name,this.inModule):Bv(r.name))&&(e===64?this.raise(S.StrictEvalArguments,r,{referenceName:r.name}):this.raise(S.StrictEvalArgumentsBinding,r,{bindingName:r.name})),e&8192&&r.name==="let"&&this.raise(S.LetInLexicalBinding,r),e&64||this.declareNameFromIdentifier(r,e)}declareNameFromIdentifier(r,e){this.scope.declareName(r.name,e,r.loc.start)}checkToRestConversion(r,e){switch(r.type){case"ParenthesizedExpression":this.checkToRestConversion(r.expression,e);break;case"Identifier":case"MemberExpression":break;case"ArrayExpression":case"ObjectExpression":if(e)break;default:this.raise(S.InvalidRestAssignmentPattern,r)}}checkCommaAfterRest(r){return this.match(12)?(this.raise(this.lookaheadCharCode()===r?S.RestTrailingComma:S.ElementAfterRest,this.state.startLoc),!0):!1}};function pB(t){if(t==null)throw new Error(`Unexpected ${t} value.`);return t}function Av(t){if(!t)throw new Error("Assert fail")}var z=zi`typescript`({AbstractMethodHasImplementation:({methodName:t})=>`Method '${t}' cannot have an implementation because it is marked abstract.`,AbstractPropertyHasInitializer:({propertyName:t})=>`Property '${t}' cannot have an initializer because it is marked abstract.`,AccessorCannotBeOptional:"An 'accessor' property cannot be declared optional.",AccessorCannotDeclareThisParameter:"'get' and 'set' accessors cannot declare 'this' parameters.",AccessorCannotHaveTypeParameters:"An accessor cannot have type parameters.",ClassMethodHasDeclare:"Class methods cannot have the 'declare' modifier.",ClassMethodHasReadonly:"Class methods cannot have the 'readonly' modifier.",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"A 'const' initializer in an ambient context must be a string or numeric literal or literal enum reference.",ConstructorHasTypeParameters:"Type parameters cannot appear on a constructor declaration.",DeclareAccessor:({kind:t})=>`'declare' is not allowed in ${t}ters.`,DeclareClassFieldHasInitializer:"Initializers are not allowed in ambient contexts.",DeclareFunctionHasImplementation:"An implementation cannot be declared in ambient contexts.",DuplicateAccessibilityModifier:({modifier:t})=>"Accessibility modifier already seen.",DuplicateModifier:({modifier:t})=>`Duplicate modifier: '${t}'.`,EmptyHeritageClauseType:({token:t})=>`'${t}' list cannot be empty.`,EmptyTypeArguments:"Type argument list cannot be empty.",EmptyTypeParameters:"Type parameter list cannot be empty.",ExpectedAmbientAfterExportDeclare:"'export declare' must be followed by an ambient declaration.",ImportAliasHasImportType:"An import alias can not use 'import type'.",ImportReflectionHasImportType:"An `import module` declaration can not use `type` modifier",IncompatibleModifiers:({modifiers:t})=>`'${t[0]}' modifier cannot be used with '${t[1]}' modifier.`,IndexSignatureHasAbstract:"Index signatures cannot have the 'abstract' modifier.",IndexSignatureHasAccessibility:({modifier:t})=>`Index signatures cannot have an accessibility modifier ('${t}').`,IndexSignatureHasDeclare:"Index signatures cannot have the 'declare' modifier.",IndexSignatureHasOverride:"'override' modifier cannot appear on an index signature.",IndexSignatureHasStatic:"Index signatures cannot have the 'static' modifier.",InitializerNotAllowedInAmbientContext:"Initializers are not allowed in ambient contexts.",InvalidModifierOnTypeMember:({modifier:t})=>`'${t}' modifier cannot appear on a type member.`,InvalidModifierOnTypeParameter:({modifier:t})=>`'${t}' modifier cannot appear on a type parameter.`,InvalidModifierOnTypeParameterPositions:({modifier:t})=>`'${t}' modifier can only appear on a type parameter of a class, interface or type alias.`,InvalidModifiersOrder:({orderedModifiers:t})=>`'${t[0]}' modifier must precede '${t[1]}' modifier.`,InvalidPropertyAccessAfterInstantiationExpression:"Invalid property access after an instantiation expression. You can either wrap the instantiation expression in parentheses, or delete the type arguments.",InvalidTupleMemberLabel:"Tuple members must be labeled with a simple identifier.",MissingInterfaceName:"'interface' declarations must be followed by an identifier.",NonAbstractClassHasAbstractMethod:"Abstract methods can only appear within an abstract class.",NonClassMethodPropertyHasAbstractModifer:"'abstract' modifier can only appear on a class, method, or property declaration.",OptionalTypeBeforeRequired:"A required element cannot follow an optional element.",OverrideNotInSubClass:"This member cannot have an 'override' modifier because its containing class does not extend another class.",PatternIsOptional:"A binding pattern parameter cannot be optional in an implementation signature.",PrivateElementHasAbstract:"Private elements cannot have the 'abstract' modifier.",PrivateElementHasAccessibility:({modifier:t})=>`Private elements cannot have an accessibility modifier ('${t}').`,ReadonlyForMethodSignature:"'readonly' modifier can only appear on a property declaration or index signature.",ReservedArrowTypeParam:"This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma, as in `<T,>() => ...`.",ReservedTypeAssertion:"This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead.",SetAccessorCannotHaveOptionalParameter:"A 'set' accessor cannot have an optional parameter.",SetAccessorCannotHaveRestParameter:"A 'set' accessor cannot have rest parameter.",SetAccessorCannotHaveReturnType:"A 'set' accessor cannot have a return type annotation.",SingleTypeParameterWithoutTrailingComma:({typeParameterName:t})=>`Single type parameter ${t} should have a trailing comma. Example usage: <${t},>.`,StaticBlockCannotHaveModifier:"Static class blocks cannot have any modifier.",TupleOptionalAfterType:"A labeled tuple optional element must be declared using a question mark after the name and before the colon (`name?: type`), rather than after the type (`name: type?`).",TypeAnnotationAfterAssign:"Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.",TypeImportCannotSpecifyDefaultAndNamed:"A type-only import can specify a default import or named bindings, but not both.",TypeModifierIsUsedInTypeExports:"The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.",TypeModifierIsUsedInTypeImports:"The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.",UnexpectedParameterModifier:"A parameter property is only allowed in a constructor implementation.",UnexpectedReadonly:"'readonly' type modifier is only permitted on array and tuple literal types.",UnexpectedTypeAnnotation:"Did not expect a type annotation here.",UnexpectedTypeCastInParameter:"Unexpected type cast in parameter position.",UnsupportedImportTypeArgument:"Argument in a type import must be a string literal.",UnsupportedParameterPropertyKind:"A parameter property may not be declared using a binding pattern.",UnsupportedSignatureParameterKind:({type:t})=>`Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${t}.`});function dB(t){switch(t){case"any":return"TSAnyKeyword";case"boolean":return"TSBooleanKeyword";case"bigint":return"TSBigIntKeyword";case"never":return"TSNeverKeyword";case"number":return"TSNumberKeyword";case"object":return"TSObjectKeyword";case"string":return"TSStringKeyword";case"symbol":return"TSSymbolKeyword";case"undefined":return"TSUndefinedKeyword";case"unknown":return"TSUnknownKeyword";default:return}}function Pv(t){return t==="private"||t==="public"||t==="protected"}function fB(t){return t==="in"||t==="out"}var hB=t=>class extends t{constructor(...e){super(...e),this.tsParseInOutModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out"],disallowedModifiers:["const","public","private","protected","readonly","declare","abstract","override"],errorTemplate:z.InvalidModifierOnTypeParameter}),this.tsParseConstModifier=this.tsParseModifiers.bind(this,{allowedModifiers:["const"],disallowedModifiers:["in","out"],errorTemplate:z.InvalidModifierOnTypeParameterPositions}),this.tsParseInOutConstModifiers=this.tsParseModifiers.bind(this,{allowedModifiers:["in","out","const"],disallowedModifiers:["public","private","protected","readonly","declare","abstract","override"],errorTemplate:z.InvalidModifierOnTypeParameter})}getScopeHandler(){return sh}tsIsIdentifier(){return we(this.state.type)}tsTokenCanFollowModifier(){return this.match(0)||this.match(5)||this.match(55)||this.match(21)||this.match(138)||this.isLiteralPropertyName()}tsNextTokenOnSameLineAndCanFollowModifier(){return this.next(),this.hasPrecedingLineBreak()?!1:this.tsTokenCanFollowModifier()}tsNextTokenCanFollowModifier(){return this.match(106)?(this.next(),this.tsTokenCanFollowModifier()):this.tsNextTokenOnSameLineAndCanFollowModifier()}tsParseModifier(e,i){if(!we(this.state.type)&&this.state.type!==58&&this.state.type!==75)return;let n=this.state.value;if(e.includes(n)){if(i&&this.tsIsStartOfStaticBlocks())return;if(this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this)))return n}}tsParseModifiers({allowedModifiers:e,disallowedModifiers:i,stopOnStartOfClassStaticBlock:n,errorTemplate:s=z.InvalidModifierOnTypeMember},o){let a=(u,c,p,d)=>{c===p&&o[d]&&this.raise(z.InvalidModifiersOrder,u,{orderedModifiers:[p,d]})},l=(u,c,p,d)=>{(o[p]&&c===d||o[d]&&c===p)&&this.raise(z.IncompatibleModifiers,u,{modifiers:[p,d]})};for(;;){let{startLoc:u}=this.state,c=this.tsParseModifier(e.concat(i??[]),n);if(!c)break;Pv(c)?o.accessibility?this.raise(z.DuplicateAccessibilityModifier,u,{modifier:c}):(a(u,c,c,"override"),a(u,c,c,"static"),a(u,c,c,"readonly"),o.accessibility=c):fB(c)?(o[c]&&this.raise(z.DuplicateModifier,u,{modifier:c}),o[c]=!0,a(u,c,"in","out")):(hasOwnProperty.call(o,c)?this.raise(z.DuplicateModifier,u,{modifier:c}):(a(u,c,"static","readonly"),a(u,c,"static","override"),a(u,c,"override","readonly"),a(u,c,"abstract","override"),l(u,c,"declare","override"),l(u,c,"static","abstract")),o[c]=!0),i!=null&&i.includes(c)&&this.raise(s,u,{modifier:c})}}tsIsListTerminator(e){switch(e){case"EnumMembers":case"TypeMembers":return this.match(8);case"HeritageClauseElement":return this.match(5);case"TupleElementTypes":return this.match(3);case"TypeParametersOrArguments":return this.match(48)}}tsParseList(e,i){let n=[];for(;!this.tsIsListTerminator(e);)n.push(i());return n}tsParseDelimitedList(e,i,n){return pB(this.tsParseDelimitedListWorker(e,i,!0,n))}tsParseDelimitedListWorker(e,i,n,s){let o=[],a=-1;for(;!this.tsIsListTerminator(e);){a=-1;let l=i();if(l==null)return;if(o.push(l),this.eat(12)){a=this.state.lastTokStartLoc.index;continue}if(this.tsIsListTerminator(e))break;n&&this.expect(12);return}return s&&(s.value=a),o}tsParseBracketedList(e,i,n,s,o){s||(n?this.expect(0):this.expect(47));let a=this.tsParseDelimitedList(e,i,o);return n?this.expect(3):this.expect(48),a}tsParseImportType(){let e=this.startNode();return this.expect(83),this.expect(10),this.match(133)||this.raise(z.UnsupportedImportTypeArgument,this.state.startLoc),e.argument=super.parseExprAtom(),(this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions"))&&(e.options=null),this.eat(12)&&(this.hasPlugin("importAssertions")||this.expectPlugin("importAttributes"),this.match(11)||(e.options=super.parseMaybeAssignAllowIn(),this.eat(12))),this.expect(11),this.eat(16)&&(e.qualifier=this.tsParseEntityName()),this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSImportType")}tsParseEntityName(e=!0){let i=this.parseIdentifier(e);for(;this.eat(16);){let n=this.startNodeAtNode(i);n.left=i,n.right=this.parseIdentifier(e),i=this.finishNode(n,"TSQualifiedName")}return i}tsParseTypeReference(){let e=this.startNode();return e.typeName=this.tsParseEntityName(),!this.hasPrecedingLineBreak()&&this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSTypeReference")}tsParseThisTypePredicate(e){this.next();let i=this.startNodeAtNode(e);return i.parameterName=e,i.typeAnnotation=this.tsParseTypeAnnotation(!1),i.asserts=!1,this.finishNode(i,"TSTypePredicate")}tsParseThisTypeNode(){let e=this.startNode();return this.next(),this.finishNode(e,"TSThisType")}tsParseTypeQuery(){let e=this.startNode();return this.expect(87),this.match(83)?e.exprName=this.tsParseImportType():e.exprName=this.tsParseEntityName(),!this.hasPrecedingLineBreak()&&this.match(47)&&(e.typeParameters=this.tsParseTypeArguments()),this.finishNode(e,"TSTypeQuery")}tsParseTypeParameter(e){let i=this.startNode();return e(i),i.name=this.tsParseTypeParameterName(),i.constraint=this.tsEatThenParseType(81),i.default=this.tsEatThenParseType(29),this.finishNode(i,"TSTypeParameter")}tsTryParseTypeParameters(e){if(this.match(47))return this.tsParseTypeParameters(e)}tsParseTypeParameters(e){let i=this.startNode();this.match(47)||this.match(142)?this.next():this.unexpected();let n={value:-1};return i.params=this.tsParseBracketedList("TypeParametersOrArguments",this.tsParseTypeParameter.bind(this,e),!1,!0,n),i.params.length===0&&this.raise(z.EmptyTypeParameters,i),n.value!==-1&&this.addExtra(i,"trailingComma",n.value),this.finishNode(i,"TSTypeParameterDeclaration")}tsFillSignature(e,i){let n=e===19,s="parameters",o="typeAnnotation";i.typeParameters=this.tsTryParseTypeParameters(this.tsParseConstModifier),this.expect(10),i[s]=this.tsParseBindingListForSignature(),n?i[o]=this.tsParseTypeOrTypePredicateAnnotation(e):this.match(e)&&(i[o]=this.tsParseTypeOrTypePredicateAnnotation(e))}tsParseBindingListForSignature(){let e=super.parseBindingList(11,41,2);for(let i of e){let{type:n}=i;(n==="AssignmentPattern"||n==="TSParameterProperty")&&this.raise(z.UnsupportedSignatureParameterKind,i,{type:n})}return e}tsParseTypeMemberSemicolon(){!this.eat(12)&&!this.isLineTerminator()&&this.expect(13)}tsParseSignatureMember(e,i){return this.tsFillSignature(14,i),this.tsParseTypeMemberSemicolon(),this.finishNode(i,e)}tsIsUnambiguouslyIndexSignature(){return this.next(),we(this.state.type)?(this.next(),this.match(14)):!1}tsTryParseIndexSignature(e){if(!(this.match(0)&&this.tsLookAhead(this.tsIsUnambiguouslyIndexSignature.bind(this))))return;this.expect(0);let i=this.parseIdentifier();i.typeAnnotation=this.tsParseTypeAnnotation(),this.resetEndLocation(i),this.expect(3),e.parameters=[i];let n=this.tsTryParseTypeAnnotation();return n&&(e.typeAnnotation=n),this.tsParseTypeMemberSemicolon(),this.finishNode(e,"TSIndexSignature")}tsParsePropertyOrMethodSignature(e,i){this.eat(17)&&(e.optional=!0);let n=e;if(this.match(10)||this.match(47)){i&&this.raise(z.ReadonlyForMethodSignature,e);let s=n;s.kind&&this.match(47)&&this.raise(z.AccessorCannotHaveTypeParameters,this.state.curPosition()),this.tsFillSignature(14,s),this.tsParseTypeMemberSemicolon();let o="parameters",a="typeAnnotation";if(s.kind==="get")s[o].length>0&&(this.raise(S.BadGetterArity,this.state.curPosition()),this.isThisParam(s[o][0])&&this.raise(z.AccessorCannotDeclareThisParameter,this.state.curPosition()));else if(s.kind==="set"){if(s[o].length!==1)this.raise(S.BadSetterArity,this.state.curPosition());else{let l=s[o][0];this.isThisParam(l)&&this.raise(z.AccessorCannotDeclareThisParameter,this.state.curPosition()),l.type==="Identifier"&&l.optional&&this.raise(z.SetAccessorCannotHaveOptionalParameter,this.state.curPosition()),l.type==="RestElement"&&this.raise(z.SetAccessorCannotHaveRestParameter,this.state.curPosition())}s[a]&&this.raise(z.SetAccessorCannotHaveReturnType,s[a])}else s.kind="method";return this.finishNode(s,"TSMethodSignature")}else{let s=n;i&&(s.readonly=!0);let o=this.tsTryParseTypeAnnotation();return o&&(s.typeAnnotation=o),this.tsParseTypeMemberSemicolon(),this.finishNode(s,"TSPropertySignature")}}tsParseTypeMember(){let e=this.startNode();if(this.match(10)||this.match(47))return this.tsParseSignatureMember("TSCallSignatureDeclaration",e);if(this.match(77)){let n=this.startNode();return this.next(),this.match(10)||this.match(47)?this.tsParseSignatureMember("TSConstructSignatureDeclaration",e):(e.key=this.createIdentifier(n,"new"),this.tsParsePropertyOrMethodSignature(e,!1))}this.tsParseModifiers({allowedModifiers:["readonly"],disallowedModifiers:["declare","abstract","private","protected","public","static","override"]},e);let i=this.tsTryParseIndexSignature(e);return i||(super.parsePropertyName(e),!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.tsTokenCanFollowModifier()&&(e.kind=e.key.name,super.parsePropertyName(e)),this.tsParsePropertyOrMethodSignature(e,!!e.readonly))}tsParseTypeLiteral(){let e=this.startNode();return e.members=this.tsParseObjectTypeMembers(),this.finishNode(e,"TSTypeLiteral")}tsParseObjectTypeMembers(){this.expect(5);let e=this.tsParseList("TypeMembers",this.tsParseTypeMember.bind(this));return this.expect(8),e}tsIsStartOfMappedType(){return this.next(),this.eat(53)?this.isContextual(122):(this.isContextual(122)&&this.next(),!this.match(0)||(this.next(),!this.tsIsIdentifier())?!1:(this.next(),this.match(58)))}tsParseMappedType(){let e=this.startNode();this.expect(5),this.match(53)?(e.readonly=this.state.value,this.next(),this.expectContextual(122)):this.eatContextual(122)&&(e.readonly=!0),this.expect(0);{let i=this.startNode();i.name=this.tsParseTypeParameterName(),i.constraint=this.tsExpectThenParseType(58),e.typeParameter=this.finishNode(i,"TSTypeParameter")}return e.nameType=this.eatContextual(93)?this.tsParseType():null,this.expect(3),this.match(53)?(e.optional=this.state.value,this.next(),this.expect(17)):this.eat(17)&&(e.optional=!0),e.typeAnnotation=this.tsTryParseType(),this.semicolon(),this.expect(8),this.finishNode(e,"TSMappedType")}tsParseTupleType(){let e=this.startNode();e.elementTypes=this.tsParseBracketedList("TupleElementTypes",this.tsParseTupleElementType.bind(this),!0,!1);let i=!1;return e.elementTypes.forEach(n=>{let{type:s}=n;i&&s!=="TSRestType"&&s!=="TSOptionalType"&&!(s==="TSNamedTupleMember"&&n.optional)&&this.raise(z.OptionalTypeBeforeRequired,n),i||(i=s==="TSNamedTupleMember"&&n.optional||s==="TSOptionalType")}),this.finishNode(e,"TSTupleType")}tsParseTupleElementType(){let{startLoc:e}=this.state,i=this.eat(21),n,s,o,a,u=Br(this.state.type)?this.lookaheadCharCode():null;if(u===58)n=!0,o=!1,s=this.parseIdentifier(!0),this.expect(14),a=this.tsParseType();else if(u===63){o=!0;let c=this.state.startLoc,p=this.state.value,d=this.tsParseNonArrayType();this.lookaheadCharCode()===58?(n=!0,s=this.createIdentifier(this.startNodeAt(c),p),this.expect(17),this.expect(14),a=this.tsParseType()):(n=!1,a=d,this.expect(17))}else a=this.tsParseType(),o=this.eat(17),n=this.eat(14);if(n){let c;s?(c=this.startNodeAtNode(s),c.optional=o,c.label=s,c.elementType=a,this.eat(17)&&(c.optional=!0,this.raise(z.TupleOptionalAfterType,this.state.lastTokStartLoc))):(c=this.startNodeAtNode(a),c.optional=o,this.raise(z.InvalidTupleMemberLabel,a),c.label=a,c.elementType=this.tsParseType()),a=this.finishNode(c,"TSNamedTupleMember")}else if(o){let c=this.startNodeAtNode(a);c.typeAnnotation=a,a=this.finishNode(c,"TSOptionalType")}if(i){let c=this.startNodeAt(e);c.typeAnnotation=a,a=this.finishNode(c,"TSRestType")}return a}tsParseParenthesizedType(){let e=this.startNode();return this.expect(10),e.typeAnnotation=this.tsParseType(),this.expect(11),this.finishNode(e,"TSParenthesizedType")}tsParseFunctionOrConstructorType(e,i){let n=this.startNode();return e==="TSConstructorType"&&(n.abstract=!!i,i&&this.next(),this.next()),this.tsInAllowConditionalTypesContext(()=>this.tsFillSignature(19,n)),this.finishNode(n,e)}tsParseLiteralTypeNode(){let e=this.startNode();switch(this.state.type){case 134:case 135:case 133:case 85:case 86:e.literal=super.parseExprAtom();break;default:this.unexpected()}return this.finishNode(e,"TSLiteralType")}tsParseTemplateLiteralType(){let e=this.startNode();return e.literal=super.parseTemplate(!1),this.finishNode(e,"TSLiteralType")}parseTemplateSubstitution(){return this.state.inType?this.tsParseType():super.parseTemplateSubstitution()}tsParseThisTypeOrThisTypePredicate(){let e=this.tsParseThisTypeNode();return this.isContextual(116)&&!this.hasPrecedingLineBreak()?this.tsParseThisTypePredicate(e):e}tsParseNonArrayType(){switch(this.state.type){case 133:case 134:case 135:case 85:case 86:return this.tsParseLiteralTypeNode();case 53:if(this.state.value==="-"){let e=this.startNode(),i=this.lookahead();return i.type!==134&&i.type!==135&&this.unexpected(),e.literal=this.parseMaybeUnary(),this.finishNode(e,"TSLiteralType")}break;case 78:return this.tsParseThisTypeOrThisTypePredicate();case 87:return this.tsParseTypeQuery();case 83:return this.tsParseImportType();case 5:return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this))?this.tsParseMappedType():this.tsParseTypeLiteral();case 0:return this.tsParseTupleType();case 10:return this.tsParseParenthesizedType();case 25:case 24:return this.tsParseTemplateLiteralType();default:{let{type:e}=this.state;if(we(e)||e===88||e===84){let i=e===88?"TSVoidKeyword":e===84?"TSNullKeyword":dB(this.state.value);if(i!==void 0&&this.lookaheadCharCode()!==46){let n=this.startNode();return this.next(),this.finishNode(n,i)}return this.tsParseTypeReference()}}}this.unexpected()}tsParseArrayTypeOrHigher(){let e=this.tsParseNonArrayType();for(;!this.hasPrecedingLineBreak()&&this.eat(0);)if(this.match(3)){let i=this.startNodeAtNode(e);i.elementType=e,this.expect(3),e=this.finishNode(i,"TSArrayType")}else{let i=this.startNodeAtNode(e);i.objectType=e,i.indexType=this.tsParseType(),this.expect(3),e=this.finishNode(i,"TSIndexedAccessType")}return e}tsParseTypeOperator(){let e=this.startNode(),i=this.state.value;return this.next(),e.operator=i,e.typeAnnotation=this.tsParseTypeOperatorOrHigher(),i==="readonly"&&this.tsCheckTypeAnnotationForReadOnly(e),this.finishNode(e,"TSTypeOperator")}tsCheckTypeAnnotationForReadOnly(e){switch(e.typeAnnotation.type){case"TSTupleType":case"TSArrayType":return;default:this.raise(z.UnexpectedReadonly,e)}}tsParseInferType(){let e=this.startNode();this.expectContextual(115);let i=this.startNode();return i.name=this.tsParseTypeParameterName(),i.constraint=this.tsTryParse(()=>this.tsParseConstraintForInferType()),e.typeParameter=this.finishNode(i,"TSTypeParameter"),this.finishNode(e,"TSInferType")}tsParseConstraintForInferType(){if(this.eat(81)){let e=this.tsInDisallowConditionalTypesContext(()=>this.tsParseType());if(this.state.inDisallowConditionalTypesContext||!this.match(17))return e}}tsParseTypeOperatorOrHigher(){return FM(this.state.type)&&!this.state.containsEsc?this.tsParseTypeOperator():this.isContextual(115)?this.tsParseInferType():this.tsInAllowConditionalTypesContext(()=>this.tsParseArrayTypeOrHigher())}tsParseUnionOrIntersectionType(e,i,n){let s=this.startNode(),o=this.eat(n),a=[];do a.push(i());while(this.eat(n));return a.length===1&&!o?a[0]:(s.types=a,this.finishNode(s,e))}tsParseIntersectionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSIntersectionType",this.tsParseTypeOperatorOrHigher.bind(this),45)}tsParseUnionTypeOrHigher(){return this.tsParseUnionOrIntersectionType("TSUnionType",this.tsParseIntersectionTypeOrHigher.bind(this),43)}tsIsStartOfFunctionType(){return this.match(47)?!0:this.match(10)&&this.tsLookAhead(this.tsIsUnambiguouslyStartOfFunctionType.bind(this))}tsSkipParameterStart(){if(we(this.state.type)||this.match(78))return this.next(),!0;if(this.match(5)){let{errors:e}=this.state,i=e.length;try{return this.parseObjectLike(8,!0),e.length===i}catch{return!1}}if(this.match(0)){this.next();let{errors:e}=this.state,i=e.length;try{return super.parseBindingList(3,93,1),e.length===i}catch{return!1}}return!1}tsIsUnambiguouslyStartOfFunctionType(){return this.next(),!!(this.match(11)||this.match(21)||this.tsSkipParameterStart()&&(this.match(14)||this.match(12)||this.match(17)||this.match(29)||this.match(11)&&(this.next(),this.match(19))))}tsParseTypeOrTypePredicateAnnotation(e){return this.tsInType(()=>{let i=this.startNode();this.expect(e);let n=this.startNode(),s=!!this.tsTryParse(this.tsParseTypePredicateAsserts.bind(this));if(s&&this.match(78)){let l=this.tsParseThisTypeOrThisTypePredicate();return l.type==="TSThisType"?(n.parameterName=l,n.asserts=!0,n.typeAnnotation=null,l=this.finishNode(n,"TSTypePredicate")):(this.resetStartLocationFromNode(l,n),l.asserts=!0),i.typeAnnotation=l,this.finishNode(i,"TSTypeAnnotation")}let o=this.tsIsIdentifier()&&this.tsTryParse(this.tsParseTypePredicatePrefix.bind(this));if(!o)return s?(n.parameterName=this.parseIdentifier(),n.asserts=s,n.typeAnnotation=null,i.typeAnnotation=this.finishNode(n,"TSTypePredicate"),this.finishNode(i,"TSTypeAnnotation")):this.tsParseTypeAnnotation(!1,i);let a=this.tsParseTypeAnnotation(!1);return n.parameterName=o,n.typeAnnotation=a,n.asserts=s,i.typeAnnotation=this.finishNode(n,"TSTypePredicate"),this.finishNode(i,"TSTypeAnnotation")})}tsTryParseTypeOrTypePredicateAnnotation(){if(this.match(14))return this.tsParseTypeOrTypePredicateAnnotation(14)}tsTryParseTypeAnnotation(){if(this.match(14))return this.tsParseTypeAnnotation()}tsTryParseType(){return this.tsEatThenParseType(14)}tsParseTypePredicatePrefix(){let e=this.parseIdentifier();if(this.isContextual(116)&&!this.hasPrecedingLineBreak())return this.next(),e}tsParseTypePredicateAsserts(){if(this.state.type!==109)return!1;let e=this.state.containsEsc;return this.next(),!we(this.state.type)&&!this.match(78)?!1:(e&&this.raise(S.InvalidEscapedReservedWord,this.state.lastTokStartLoc,{reservedWord:"asserts"}),!0)}tsParseTypeAnnotation(e=!0,i=this.startNode()){return this.tsInType(()=>{e&&this.expect(14),i.typeAnnotation=this.tsParseType()}),this.finishNode(i,"TSTypeAnnotation")}tsParseType(){Av(this.state.inType);let e=this.tsParseNonConditionalType();if(this.state.inDisallowConditionalTypesContext||this.hasPrecedingLineBreak()||!this.eat(81))return e;let i=this.startNodeAtNode(e);return i.checkType=e,i.extendsType=this.tsInDisallowConditionalTypesContext(()=>this.tsParseNonConditionalType()),this.expect(17),i.trueType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.expect(14),i.falseType=this.tsInAllowConditionalTypesContext(()=>this.tsParseType()),this.finishNode(i,"TSConditionalType")}isAbstractConstructorSignature(){return this.isContextual(124)&&this.lookahead().type===77}tsParseNonConditionalType(){return this.tsIsStartOfFunctionType()?this.tsParseFunctionOrConstructorType("TSFunctionType"):this.match(77)?this.tsParseFunctionOrConstructorType("TSConstructorType"):this.isAbstractConstructorSignature()?this.tsParseFunctionOrConstructorType("TSConstructorType",!0):this.tsParseUnionTypeOrHigher()}tsParseTypeAssertion(){this.getPluginOption("typescript","disallowAmbiguousJSXLike")&&this.raise(z.ReservedTypeAssertion,this.state.startLoc);let e=this.startNode();return e.typeAnnotation=this.tsInType(()=>(this.next(),this.match(75)?this.tsParseTypeReference():this.tsParseType())),this.expect(48),e.expression=this.parseMaybeUnary(),this.finishNode(e,"TSTypeAssertion")}tsParseHeritageClause(e){let i=this.state.startLoc,n=this.tsParseDelimitedList("HeritageClauseElement",()=>{let s=this.startNode();return s.expression=this.tsParseEntityName(),this.match(47)&&(s.typeParameters=this.tsParseTypeArguments()),this.finishNode(s,"TSExpressionWithTypeArguments")});return n.length||this.raise(z.EmptyHeritageClauseType,i,{token:e}),n}tsParseInterfaceDeclaration(e,i={}){if(this.hasFollowingLineBreak())return null;this.expectContextual(129),i.declare&&(e.declare=!0),we(this.state.type)?(e.id=this.parseIdentifier(),this.checkIdentifier(e.id,130)):(e.id=null,this.raise(z.MissingInterfaceName,this.state.startLoc)),e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers),this.eat(81)&&(e.extends=this.tsParseHeritageClause("extends"));let n=this.startNode();return n.body=this.tsInType(this.tsParseObjectTypeMembers.bind(this)),e.body=this.finishNode(n,"TSInterfaceBody"),this.finishNode(e,"TSInterfaceDeclaration")}tsParseTypeAliasDeclaration(e){return e.id=this.parseIdentifier(),this.checkIdentifier(e.id,2),e.typeAnnotation=this.tsInType(()=>{if(e.typeParameters=this.tsTryParseTypeParameters(this.tsParseInOutModifiers),this.expect(29),this.isContextual(114)&&this.lookahead().type!==16){let i=this.startNode();return this.next(),this.finishNode(i,"TSIntrinsicKeyword")}return this.tsParseType()}),this.semicolon(),this.finishNode(e,"TSTypeAliasDeclaration")}tsInNoContext(e){let i=this.state.context;this.state.context=[i[0]];try{return e()}finally{this.state.context=i}}tsInType(e){let i=this.state.inType;this.state.inType=!0;try{return e()}finally{this.state.inType=i}}tsInDisallowConditionalTypesContext(e){let i=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!0;try{return e()}finally{this.state.inDisallowConditionalTypesContext=i}}tsInAllowConditionalTypesContext(e){let i=this.state.inDisallowConditionalTypesContext;this.state.inDisallowConditionalTypesContext=!1;try{return e()}finally{this.state.inDisallowConditionalTypesContext=i}}tsEatThenParseType(e){if(this.match(e))return this.tsNextThenParseType()}tsExpectThenParseType(e){return this.tsInType(()=>(this.expect(e),this.tsParseType()))}tsNextThenParseType(){return this.tsInType(()=>(this.next(),this.tsParseType()))}tsParseEnumMember(){let e=this.startNode();return e.id=this.match(133)?super.parseStringLiteral(this.state.value):this.parseIdentifier(!0),this.eat(29)&&(e.initializer=super.parseMaybeAssignAllowIn()),this.finishNode(e,"TSEnumMember")}tsParseEnumDeclaration(e,i={}){return i.const&&(e.const=!0),i.declare&&(e.declare=!0),this.expectContextual(126),e.id=this.parseIdentifier(),this.checkIdentifier(e.id,e.const?8971:8459),this.expect(5),e.members=this.tsParseDelimitedList("EnumMembers",this.tsParseEnumMember.bind(this)),this.expect(8),this.finishNode(e,"TSEnumDeclaration")}tsParseModuleBlock(){let e=this.startNode();return this.scope.enter(0),this.expect(5),super.parseBlockOrModuleBlockBody(e.body=[],void 0,!0,8),this.scope.exit(),this.finishNode(e,"TSModuleBlock")}tsParseModuleOrNamespaceDeclaration(e,i=!1){if(e.id=this.parseIdentifier(),i||this.checkIdentifier(e.id,1024),this.eat(16)){let n=this.startNode();this.tsParseModuleOrNamespaceDeclaration(n,!0),e.body=n}else this.scope.enter(256),this.prodParam.enter(0),e.body=this.tsParseModuleBlock(),this.prodParam.exit(),this.scope.exit();return this.finishNode(e,"TSModuleDeclaration")}tsParseAmbientExternalModuleDeclaration(e){return this.isContextual(112)?(e.global=!0,e.id=this.parseIdentifier()):this.match(133)?e.id=super.parseStringLiteral(this.state.value):this.unexpected(),this.match(5)?(this.scope.enter(256),this.prodParam.enter(0),e.body=this.tsParseModuleBlock(),this.prodParam.exit(),this.scope.exit()):this.semicolon(),this.finishNode(e,"TSModuleDeclaration")}tsParseImportEqualsDeclaration(e,i,n){e.isExport=n||!1,e.id=i||this.parseIdentifier(),this.checkIdentifier(e.id,4096),this.expect(29);let s=this.tsParseModuleReference();return e.importKind==="type"&&s.type!=="TSExternalModuleReference"&&this.raise(z.ImportAliasHasImportType,s),e.moduleReference=s,this.semicolon(),this.finishNode(e,"TSImportEqualsDeclaration")}tsIsExternalModuleReference(){return this.isContextual(119)&&this.lookaheadCharCode()===40}tsParseModuleReference(){return this.tsIsExternalModuleReference()?this.tsParseExternalModuleReference():this.tsParseEntityName(!1)}tsParseExternalModuleReference(){let e=this.startNode();return this.expectContextual(119),this.expect(10),this.match(133)||this.unexpected(),e.expression=super.parseExprAtom(),this.expect(11),this.sawUnambiguousESM=!0,this.finishNode(e,"TSExternalModuleReference")}tsLookAhead(e){let i=this.state.clone(),n=e();return this.state=i,n}tsTryParseAndCatch(e){let i=this.tryParse(n=>e()||n());if(!(i.aborted||!i.node))return i.error&&(this.state=i.failState),i.node}tsTryParse(e){let i=this.state.clone(),n=e();if(n!==void 0&&n!==!1)return n;this.state=i}tsTryParseDeclare(e){if(this.isLineTerminator())return;let i=this.state.type,n;return this.isContextual(100)&&(i=74,n="let"),this.tsInAmbientContext(()=>{switch(i){case 68:return e.declare=!0,super.parseFunctionStatement(e,!1,!1);case 80:return e.declare=!0,this.parseClass(e,!0,!1);case 126:return this.tsParseEnumDeclaration(e,{declare:!0});case 112:return this.tsParseAmbientExternalModuleDeclaration(e);case 75:case 74:return!this.match(75)||!this.isLookaheadContextual("enum")?(e.declare=!0,this.parseVarStatement(e,n||this.state.value,!0)):(this.expect(75),this.tsParseEnumDeclaration(e,{const:!0,declare:!0}));case 129:{let s=this.tsParseInterfaceDeclaration(e,{declare:!0});if(s)return s}default:if(we(i))return this.tsParseDeclaration(e,this.state.value,!0,null)}})}tsTryParseExportDeclaration(){return this.tsParseDeclaration(this.startNode(),this.state.value,!0,null)}tsParseExpressionStatement(e,i,n){switch(i.name){case"declare":{let s=this.tsTryParseDeclare(e);return s&&(s.declare=!0),s}case"global":if(this.match(5)){this.scope.enter(256),this.prodParam.enter(0);let s=e;return s.global=!0,s.id=i,s.body=this.tsParseModuleBlock(),this.scope.exit(),this.prodParam.exit(),this.finishNode(s,"TSModuleDeclaration")}break;default:return this.tsParseDeclaration(e,i.name,!1,n)}}tsParseDeclaration(e,i,n,s){switch(i){case"abstract":if(this.tsCheckLineTerminator(n)&&(this.match(80)||we(this.state.type)))return this.tsParseAbstractDeclaration(e,s);break;case"module":if(this.tsCheckLineTerminator(n)){if(this.match(133))return this.tsParseAmbientExternalModuleDeclaration(e);if(we(this.state.type))return this.tsParseModuleOrNamespaceDeclaration(e)}break;case"namespace":if(this.tsCheckLineTerminator(n)&&we(this.state.type))return this.tsParseModuleOrNamespaceDeclaration(e);break;case"type":if(this.tsCheckLineTerminator(n)&&we(this.state.type))return this.tsParseTypeAliasDeclaration(e);break}}tsCheckLineTerminator(e){return e?this.hasFollowingLineBreak()?!1:(this.next(),!0):!this.isLineTerminator()}tsTryParseGenericAsyncArrowFunction(e){if(!this.match(47))return;let i=this.state.maybeInArrowParameters;this.state.maybeInArrowParameters=!0;let n=this.tsTryParseAndCatch(()=>{let s=this.startNodeAt(e);return s.typeParameters=this.tsParseTypeParameters(this.tsParseConstModifier),super.parseFunctionParams(s),s.returnType=this.tsTryParseTypeOrTypePredicateAnnotation(),this.expect(19),s});if(this.state.maybeInArrowParameters=i,!!n)return super.parseArrowExpression(n,null,!0)}tsParseTypeArgumentsInExpression(){if(this.reScan_lt()===47)return this.tsParseTypeArguments()}tsParseTypeArguments(){let e=this.startNode();return e.params=this.tsInType(()=>this.tsInNoContext(()=>(this.expect(47),this.tsParseDelimitedList("TypeParametersOrArguments",this.tsParseType.bind(this))))),e.params.length===0?this.raise(z.EmptyTypeArguments,e):!this.state.inType&&this.curContext()===Le.brace&&this.reScan_lt_gt(),this.expect(48),this.finishNode(e,"TSTypeParameterInstantiation")}tsIsDeclarationStart(){return kM(this.state.type)}isExportDefaultSpecifier(){return this.tsIsDeclarationStart()?!1:super.isExportDefaultSpecifier()}parseAssignableListItem(e,i){let n=this.state.startLoc,s={};this.tsParseModifiers({allowedModifiers:["public","private","protected","override","readonly"]},s);let o=s.accessibility,a=s.override,l=s.readonly;!(e&4)&&(o||l||a)&&this.raise(z.UnexpectedParameterModifier,n);let u=this.parseMaybeDefault();e&2&&this.parseFunctionParamType(u);let c=this.parseMaybeDefault(u.loc.start,u);if(o||l||a){let p=this.startNodeAt(n);return i.length&&(p.decorators=i),o&&(p.accessibility=o),l&&(p.readonly=l),a&&(p.override=a),c.type!=="Identifier"&&c.type!=="AssignmentPattern"&&this.raise(z.UnsupportedParameterPropertyKind,p),p.parameter=c,this.finishNode(p,"TSParameterProperty")}return i.length&&(u.decorators=i),c}isSimpleParameter(e){return e.type==="TSParameterProperty"&&super.isSimpleParameter(e.parameter)||super.isSimpleParameter(e)}tsDisallowOptionalPattern(e){for(let i of e.params)i.type!=="Identifier"&&i.optional&&!this.state.isAmbientContext&&this.raise(z.PatternIsOptional,i)}setArrowFunctionParameters(e,i,n){super.setArrowFunctionParameters(e,i,n),this.tsDisallowOptionalPattern(e)}parseFunctionBodyAndFinish(e,i,n=!1){this.match(14)&&(e.returnType=this.tsParseTypeOrTypePredicateAnnotation(14));let s=i==="FunctionDeclaration"?"TSDeclareFunction":i==="ClassMethod"||i==="ClassPrivateMethod"?"TSDeclareMethod":void 0;return s&&!this.match(5)&&this.isLineTerminator()?this.finishNode(e,s):s==="TSDeclareFunction"&&this.state.isAmbientContext&&(this.raise(z.DeclareFunctionHasImplementation,e),e.declare)?super.parseFunctionBodyAndFinish(e,s,n):(this.tsDisallowOptionalPattern(e),super.parseFunctionBodyAndFinish(e,i,n))}registerFunctionStatementId(e){!e.body&&e.id?this.checkIdentifier(e.id,1024):super.registerFunctionStatementId(e)}tsCheckForInvalidTypeCasts(e){e.forEach(i=>{i?.type==="TSTypeCastExpression"&&this.raise(z.UnexpectedTypeAnnotation,i.typeAnnotation)})}toReferencedList(e,i){return this.tsCheckForInvalidTypeCasts(e),e}parseArrayLike(e,i,n,s){let o=super.parseArrayLike(e,i,n,s);return o.type==="ArrayExpression"&&this.tsCheckForInvalidTypeCasts(o.elements),o}parseSubscript(e,i,n,s){if(!this.hasPrecedingLineBreak()&&this.match(35)){this.state.canStartJSXElement=!1,this.next();let a=this.startNodeAt(i);return a.expression=e,this.finishNode(a,"TSNonNullExpression")}let o=!1;if(this.match(18)&&this.lookaheadCharCode()===60){if(n)return s.stop=!0,e;s.optionalChainMember=o=!0,this.next()}if(this.match(47)||this.match(51)){let a,l=this.tsTryParseAndCatch(()=>{if(!n&&this.atPossibleAsyncArrow(e)){let d=this.tsTryParseGenericAsyncArrowFunction(i);if(d)return d}let u=this.tsParseTypeArgumentsInExpression();if(!u)return;if(o&&!this.match(10)){a=this.state.curPosition();return}if(Ou(this.state.type)){let d=super.parseTaggedTemplateExpression(e,i,s);return d.typeParameters=u,d}if(!n&&this.eat(10)){let d=this.startNodeAt(i);return d.callee=e,d.arguments=this.parseCallExpressionArguments(11,!1),this.tsCheckForInvalidTypeCasts(d.arguments),d.typeParameters=u,s.optionalChainMember&&(d.optional=o),this.finishCallExpression(d,s.optionalChainMember)}let c=this.state.type;if(c===48||c===52||c!==10&&Kf(c)&&!this.hasPrecedingLineBreak())return;let p=this.startNodeAt(i);return p.expression=e,p.typeParameters=u,this.finishNode(p,"TSInstantiationExpression")});if(a&&this.unexpected(a,10),l)return l.type==="TSInstantiationExpression"&&(this.match(16)||this.match(18)&&this.lookaheadCharCode()!==40)&&this.raise(z.InvalidPropertyAccessAfterInstantiationExpression,this.state.startLoc),l}return super.parseSubscript(e,i,n,s)}parseNewCallee(e){var i;super.parseNewCallee(e);let{callee:n}=e;n.type==="TSInstantiationExpression"&&!((i=n.extra)!=null&&i.parenthesized)&&(e.typeParameters=n.typeParameters,e.callee=n.expression)}parseExprOp(e,i,n){let s;if(Nu(58)>n&&!this.hasPrecedingLineBreak()&&(this.isContextual(93)||(s=this.isContextual(120)))){let o=this.startNodeAt(i);return o.expression=e,o.typeAnnotation=this.tsInType(()=>(this.next(),this.match(75)?(s&&this.raise(S.UnexpectedKeyword,this.state.startLoc,{keyword:"const"}),this.tsParseTypeReference()):this.tsParseType())),this.finishNode(o,s?"TSSatisfiesExpression":"TSAsExpression"),this.reScan_lt_gt(),this.parseExprOp(o,i,n)}return super.parseExprOp(e,i,n)}checkReservedWord(e,i,n,s){this.state.isAmbientContext||super.checkReservedWord(e,i,n,s)}checkImportReflection(e){super.checkImportReflection(e),e.module&&e.importKind!=="value"&&this.raise(z.ImportReflectionHasImportType,e.specifiers[0].loc.start)}checkDuplicateExports(){}isPotentialImportPhase(e){if(super.isPotentialImportPhase(e))return!0;if(this.isContextual(130)){let i=this.lookaheadCharCode();return e?i===123||i===42:i!==61}return!e&&this.isContextual(87)}applyImportPhase(e,i,n,s){super.applyImportPhase(e,i,n,s),i?e.exportKind=n==="type"?"type":"value":e.importKind=n==="type"||n==="typeof"?n:"value"}parseImport(e){if(this.match(133))return e.importKind="value",super.parseImport(e);let i;if(we(this.state.type)&&this.lookaheadCharCode()===61)return e.importKind="value",this.tsParseImportEqualsDeclaration(e);if(this.isContextual(130)){let n=this.parseMaybeImportPhase(e,!1);if(this.lookaheadCharCode()===61)return this.tsParseImportEqualsDeclaration(e,n);i=super.parseImportSpecifiersAndAfter(e,n)}else i=super.parseImport(e);return i.importKind==="type"&&i.specifiers.length>1&&i.specifiers[0].type==="ImportDefaultSpecifier"&&this.raise(z.TypeImportCannotSpecifyDefaultAndNamed,i),i}parseExport(e,i){if(this.match(83)){this.next();let n=e,s=null;return this.isContextual(130)&&this.isPotentialImportPhase(!1)?s=this.parseMaybeImportPhase(n,!1):n.importKind="value",this.tsParseImportEqualsDeclaration(n,s,!0)}else if(this.eat(29)){let n=e;return n.expression=super.parseExpression(),this.semicolon(),this.sawUnambiguousESM=!0,this.finishNode(n,"TSExportAssignment")}else if(this.eatContextual(93)){let n=e;return this.expectContextual(128),n.id=this.parseIdentifier(),this.semicolon(),this.finishNode(n,"TSNamespaceExportDeclaration")}else return super.parseExport(e,i)}isAbstractClass(){return this.isContextual(124)&&this.lookahead().type===80}parseExportDefaultExpression(){if(this.isAbstractClass()){let e=this.startNode();return this.next(),e.abstract=!0,this.parseClass(e,!0,!0)}if(this.match(129)){let e=this.tsParseInterfaceDeclaration(this.startNode());if(e)return e}return super.parseExportDefaultExpression()}parseVarStatement(e,i,n=!1){let{isAmbientContext:s}=this.state,o=super.parseVarStatement(e,i,n||s);if(!s)return o;for(let{id:a,init:l}of o.declarations)l&&(i!=="const"||a.typeAnnotation?this.raise(z.InitializerNotAllowedInAmbientContext,l):gB(l,this.hasPlugin("estree"))||this.raise(z.ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference,l));return o}parseStatementContent(e,i){if(this.match(75)&&this.isLookaheadContextual("enum")){let n=this.startNode();return this.expect(75),this.tsParseEnumDeclaration(n,{const:!0})}if(this.isContextual(126))return this.tsParseEnumDeclaration(this.startNode());if(this.isContextual(129)){let n=this.tsParseInterfaceDeclaration(this.startNode());if(n)return n}return super.parseStatementContent(e,i)}parseAccessModifier(){return this.tsParseModifier(["public","protected","private"])}tsHasSomeModifiers(e,i){return i.some(n=>Pv(n)?e.accessibility===n:!!e[n])}tsIsStartOfStaticBlocks(){return this.isContextual(106)&&this.lookaheadCharCode()===123}parseClassMember(e,i,n){let s=["declare","private","public","protected","override","abstract","readonly","static"];this.tsParseModifiers({allowedModifiers:s,disallowedModifiers:["in","out"],stopOnStartOfClassStaticBlock:!0,errorTemplate:z.InvalidModifierOnTypeParameterPositions},i);let o=()=>{this.tsIsStartOfStaticBlocks()?(this.next(),this.next(),this.tsHasSomeModifiers(i,s)&&this.raise(z.StaticBlockCannotHaveModifier,this.state.curPosition()),super.parseClassStaticBlock(e,i)):this.parseClassMemberWithIsStatic(e,i,n,!!i.static)};i.declare?this.tsInAmbientContext(o):o()}parseClassMemberWithIsStatic(e,i,n,s){let o=this.tsTryParseIndexSignature(i);if(o){e.body.push(o),i.abstract&&this.raise(z.IndexSignatureHasAbstract,i),i.accessibility&&this.raise(z.IndexSignatureHasAccessibility,i,{modifier:i.accessibility}),i.declare&&this.raise(z.IndexSignatureHasDeclare,i),i.override&&this.raise(z.IndexSignatureHasOverride,i);return}!this.state.inAbstractClass&&i.abstract&&this.raise(z.NonAbstractClassHasAbstractMethod,i),i.override&&(n.hadSuperClass||this.raise(z.OverrideNotInSubClass,i)),super.parseClassMemberWithIsStatic(e,i,n,s)}parsePostMemberNameModifiers(e){this.eat(17)&&(e.optional=!0),e.readonly&&this.match(10)&&this.raise(z.ClassMethodHasReadonly,e),e.declare&&this.match(10)&&this.raise(z.ClassMethodHasDeclare,e)}parseExpressionStatement(e,i,n){return(i.type==="Identifier"?this.tsParseExpressionStatement(e,i,n):void 0)||super.parseExpressionStatement(e,i,n)}shouldParseExportDeclaration(){return this.tsIsDeclarationStart()?!0:super.shouldParseExportDeclaration()}parseConditional(e,i,n){if(!this.state.maybeInArrowParameters||!this.match(17))return super.parseConditional(e,i,n);let s=this.tryParse(()=>super.parseConditional(e,i));return s.node?(s.error&&(this.state=s.failState),s.node):(s.error&&super.setOptionalParametersError(n,s.error),e)}parseParenItem(e,i){let n=super.parseParenItem(e,i);if(this.eat(17)&&(n.optional=!0,this.resetEndLocation(e)),this.match(14)){let s=this.startNodeAt(i);return s.expression=e,s.typeAnnotation=this.tsParseTypeAnnotation(),this.finishNode(s,"TSTypeCastExpression")}return e}parseExportDeclaration(e){if(!this.state.isAmbientContext&&this.isContextual(125))return this.tsInAmbientContext(()=>this.parseExportDeclaration(e));let i=this.state.startLoc,n=this.eatContextual(125);if(n&&(this.isContextual(125)||!this.shouldParseExportDeclaration()))throw this.raise(z.ExpectedAmbientAfterExportDeclare,this.state.startLoc);let o=we(this.state.type)&&this.tsTryParseExportDeclaration()||super.parseExportDeclaration(e);return o?((o.type==="TSInterfaceDeclaration"||o.type==="TSTypeAliasDeclaration"||n)&&(e.exportKind="type"),n&&(this.resetStartLocation(o,i),o.declare=!0),o):null}parseClassId(e,i,n,s){if((!i||n)&&this.isContextual(113))return;super.parseClassId(e,i,n,e.declare?1024:8331);let o=this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers);o&&(e.typeParameters=o)}parseClassPropertyAnnotation(e){e.optional||(this.eat(35)?e.definite=!0:this.eat(17)&&(e.optional=!0));let i=this.tsTryParseTypeAnnotation();i&&(e.typeAnnotation=i)}parseClassProperty(e){if(this.parseClassPropertyAnnotation(e),this.state.isAmbientContext&&!(e.readonly&&!e.typeAnnotation)&&this.match(29)&&this.raise(z.DeclareClassFieldHasInitializer,this.state.startLoc),e.abstract&&this.match(29)){let{key:i}=e;this.raise(z.AbstractPropertyHasInitializer,this.state.startLoc,{propertyName:i.type==="Identifier"&&!e.computed?i.name:`[${this.input.slice(i.start,i.end)}]`})}return super.parseClassProperty(e)}parseClassPrivateProperty(e){return e.abstract&&this.raise(z.PrivateElementHasAbstract,e),e.accessibility&&this.raise(z.PrivateElementHasAccessibility,e,{modifier:e.accessibility}),this.parseClassPropertyAnnotation(e),super.parseClassPrivateProperty(e)}parseClassAccessorProperty(e){return this.parseClassPropertyAnnotation(e),e.optional&&this.raise(z.AccessorCannotBeOptional,e),super.parseClassAccessorProperty(e)}pushClassMethod(e,i,n,s,o,a){let l=this.tsTryParseTypeParameters(this.tsParseConstModifier);l&&o&&this.raise(z.ConstructorHasTypeParameters,l);let{declare:u=!1,kind:c}=i;u&&(c==="get"||c==="set")&&this.raise(z.DeclareAccessor,i,{kind:c}),l&&(i.typeParameters=l),super.pushClassMethod(e,i,n,s,o,a)}pushClassPrivateMethod(e,i,n,s){let o=this.tsTryParseTypeParameters(this.tsParseConstModifier);o&&(i.typeParameters=o),super.pushClassPrivateMethod(e,i,n,s)}declareClassPrivateMethodInScope(e,i){e.type!=="TSDeclareMethod"&&(e.type==="MethodDefinition"&&!hasOwnProperty.call(e.value,"body")||super.declareClassPrivateMethodInScope(e,i))}parseClassSuper(e){super.parseClassSuper(e),e.superClass&&(this.match(47)||this.match(51))&&(e.superTypeParameters=this.tsParseTypeArgumentsInExpression()),this.eatContextual(113)&&(e.implements=this.tsParseHeritageClause("implements"))}parseObjPropValue(e,i,n,s,o,a,l){let u=this.tsTryParseTypeParameters(this.tsParseConstModifier);return u&&(e.typeParameters=u),super.parseObjPropValue(e,i,n,s,o,a,l)}parseFunctionParams(e,i){let n=this.tsTryParseTypeParameters(this.tsParseConstModifier);n&&(e.typeParameters=n),super.parseFunctionParams(e,i)}parseVarId(e,i){super.parseVarId(e,i),e.id.type==="Identifier"&&!this.hasPrecedingLineBreak()&&this.eat(35)&&(e.definite=!0);let n=this.tsTryParseTypeAnnotation();n&&(e.id.typeAnnotation=n,this.resetEndLocation(e.id))}parseAsyncArrowFromCallExpression(e,i){return this.match(14)&&(e.returnType=this.tsParseTypeAnnotation()),super.parseAsyncArrowFromCallExpression(e,i)}parseMaybeAssign(e,i){var n,s,o,a,l;let u,c,p;if(this.hasPlugin("jsx")&&(this.match(142)||this.match(47))){if(u=this.state.clone(),c=this.tryParse(()=>super.parseMaybeAssign(e,i),u),!c.error)return c.node;let{context:f}=this.state,g=f[f.length-1];(g===Le.j_oTag||g===Le.j_expr)&&f.pop()}if(!((n=c)!=null&&n.error)&&!this.match(47))return super.parseMaybeAssign(e,i);(!u||u===this.state)&&(u=this.state.clone());let d,h=this.tryParse(f=>{var g,m;d=this.tsParseTypeParameters(this.tsParseConstModifier);let y=super.parseMaybeAssign(e,i);return(y.type!=="ArrowFunctionExpression"||(g=y.extra)!=null&&g.parenthesized)&&f(),((m=d)==null?void 0:m.params.length)!==0&&this.resetStartLocationFromNode(y,d),y.typeParameters=d,y},u);if(!h.error&&!h.aborted)return d&&this.reportReservedArrowTypeParam(d),h.node;if(!c&&(Av(!this.hasPlugin("jsx")),p=this.tryParse(()=>super.parseMaybeAssign(e,i),u),!p.error))return p.node;if((s=c)!=null&&s.node)return this.state=c.failState,c.node;if(h.node)return this.state=h.failState,d&&this.reportReservedArrowTypeParam(d),h.node;if((o=p)!=null&&o.node)return this.state=p.failState,p.node;throw((a=c)==null?void 0:a.error)||h.error||((l=p)==null?void 0:l.error)}reportReservedArrowTypeParam(e){var i;e.params.length===1&&!e.params[0].constraint&&!((i=e.extra)!=null&&i.trailingComma)&&this.getPluginOption("typescript","disallowAmbiguousJSXLike")&&this.raise(z.ReservedArrowTypeParam,e)}parseMaybeUnary(e,i){return!this.hasPlugin("jsx")&&this.match(47)?this.tsParseTypeAssertion():super.parseMaybeUnary(e,i)}parseArrow(e){if(this.match(14)){let i=this.tryParse(n=>{let s=this.tsParseTypeOrTypePredicateAnnotation(14);return(this.canInsertSemicolon()||!this.match(19))&&n(),s});if(i.aborted)return;i.thrown||(i.error&&(this.state=i.failState),e.returnType=i.node)}return super.parseArrow(e)}parseFunctionParamType(e){this.eat(17)&&(e.optional=!0);let i=this.tsTryParseTypeAnnotation();return i&&(e.typeAnnotation=i),this.resetEndLocation(e),e}isAssignable(e,i){switch(e.type){case"TSTypeCastExpression":return this.isAssignable(e.expression,i);case"TSParameterProperty":return!0;default:return super.isAssignable(e,i)}}toAssignable(e,i=!1){switch(e.type){case"ParenthesizedExpression":this.toAssignableParenthesizedExpression(e,i);break;case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":i?this.expressionScope.recordArrowParameterBindingError(z.UnexpectedTypeCastInParameter,e):this.raise(z.UnexpectedTypeCastInParameter,e),this.toAssignable(e.expression,i);break;case"AssignmentExpression":!i&&e.left.type==="TSTypeCastExpression"&&(e.left=this.typeCastToParameter(e.left));default:super.toAssignable(e,i)}}toAssignableParenthesizedExpression(e,i){switch(e.expression.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSNonNullExpression":case"TSTypeAssertion":case"ParenthesizedExpression":this.toAssignable(e.expression,i);break;default:super.toAssignable(e,i)}}checkToRestConversion(e,i){switch(e.type){case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":case"TSNonNullExpression":this.checkToRestConversion(e.expression,!1);break;default:super.checkToRestConversion(e,i)}}isValidLVal(e,i,n){switch(e){case"TSTypeCastExpression":return!0;case"TSParameterProperty":return"parameter";case"TSNonNullExpression":case"TSInstantiationExpression":return"expression";case"TSAsExpression":case"TSSatisfiesExpression":case"TSTypeAssertion":return(n!==64||!i)&&["expression",!0];default:return super.isValidLVal(e,i,n)}}parseBindingAtom(){return this.state.type===78?this.parseIdentifier(!0):super.parseBindingAtom()}parseMaybeDecoratorArguments(e){if(this.match(47)||this.match(51)){let i=this.tsParseTypeArgumentsInExpression();if(this.match(10)){let n=super.parseMaybeDecoratorArguments(e);return n.typeParameters=i,n}this.unexpected(null,10)}return super.parseMaybeDecoratorArguments(e)}checkCommaAfterRest(e){return this.state.isAmbientContext&&this.match(12)&&this.lookaheadCharCode()===e?(this.next(),!1):super.checkCommaAfterRest(e)}isClassMethod(){return this.match(47)||super.isClassMethod()}isClassProperty(){return this.match(35)||this.match(14)||super.isClassProperty()}parseMaybeDefault(e,i){let n=super.parseMaybeDefault(e,i);return n.type==="AssignmentPattern"&&n.typeAnnotation&&n.right.start<n.typeAnnotation.start&&this.raise(z.TypeAnnotationAfterAssign,n.typeAnnotation),n}getTokenFromCode(e){if(this.state.inType){if(e===62){this.finishOp(48,1);return}if(e===60){this.finishOp(47,1);return}}super.getTokenFromCode(e)}reScan_lt_gt(){let{type:e}=this.state;e===47?(this.state.pos-=1,this.readToken_lt()):e===48&&(this.state.pos-=1,this.readToken_gt())}reScan_lt(){let{type:e}=this.state;return e===51?(this.state.pos-=2,this.finishOp(47,1),47):e}toAssignableList(e,i,n){for(let s=0;s<e.length;s++){let o=e[s];o?.type==="TSTypeCastExpression"&&(e[s]=this.typeCastToParameter(o))}super.toAssignableList(e,i,n)}typeCastToParameter(e){return e.expression.typeAnnotation=e.typeAnnotation,this.resetEndLocation(e.expression,e.typeAnnotation.loc.end),e.expression}shouldParseArrow(e){return this.match(14)?e.every(i=>this.isAssignable(i,!0)):super.shouldParseArrow(e)}shouldParseAsyncArrow(){return this.match(14)||super.shouldParseAsyncArrow()}canHaveLeadingDecorator(){return super.canHaveLeadingDecorator()||this.isAbstractClass()}jsxParseOpeningElementAfterName(e){if(this.match(47)||this.match(51)){let i=this.tsTryParseAndCatch(()=>this.tsParseTypeArgumentsInExpression());i&&(e.typeParameters=i)}return super.jsxParseOpeningElementAfterName(e)}getGetterSetterExpectedParamCount(e){let i=super.getGetterSetterExpectedParamCount(e),s=this.getObjectOrClassMethodParams(e)[0];return s&&this.isThisParam(s)?i+1:i}parseCatchClauseParam(){let e=super.parseCatchClauseParam(),i=this.tsTryParseTypeAnnotation();return i&&(e.typeAnnotation=i,this.resetEndLocation(e)),e}tsInAmbientContext(e){let{isAmbientContext:i,strict:n}=this.state;this.state.isAmbientContext=!0,this.state.strict=!1;try{return e()}finally{this.state.isAmbientContext=i,this.state.strict=n}}parseClass(e,i,n){let s=this.state.inAbstractClass;this.state.inAbstractClass=!!e.abstract;try{return super.parseClass(e,i,n)}finally{this.state.inAbstractClass=s}}tsParseAbstractDeclaration(e,i){if(this.match(80))return e.abstract=!0,this.maybeTakeDecorators(i,this.parseClass(e,!0,!1));if(this.isContextual(129)){if(!this.hasFollowingLineBreak())return e.abstract=!0,this.raise(z.NonClassMethodPropertyHasAbstractModifer,e),this.tsParseInterfaceDeclaration(e)}else this.unexpected(null,80)}parseMethod(e,i,n,s,o,a,l){let u=super.parseMethod(e,i,n,s,o,a,l);if(u.abstract&&(this.hasPlugin("estree")?!!u.value.body:!!u.body)){let{key:p}=u;this.raise(z.AbstractMethodHasImplementation,u,{methodName:p.type==="Identifier"&&!u.computed?p.name:`[${this.input.slice(p.start,p.end)}]`})}return u}tsParseTypeParameterName(){return this.parseIdentifier().name}shouldParseAsAmbientContext(){return!!this.getPluginOption("typescript","dts")}parse(){return this.shouldParseAsAmbientContext()&&(this.state.isAmbientContext=!0),super.parse()}getExpression(){return this.shouldParseAsAmbientContext()&&(this.state.isAmbientContext=!0),super.getExpression()}parseExportSpecifier(e,i,n,s){return!i&&s?(this.parseTypeOnlyImportExportSpecifier(e,!1,n),this.finishNode(e,"ExportSpecifier")):(e.exportKind="value",super.parseExportSpecifier(e,i,n,s))}parseImportSpecifier(e,i,n,s,o){return!i&&s?(this.parseTypeOnlyImportExportSpecifier(e,!0,n),this.finishNode(e,"ImportSpecifier")):(e.importKind="value",super.parseImportSpecifier(e,i,n,s,n?4098:4096))}parseTypeOnlyImportExportSpecifier(e,i,n){let s=i?"imported":"local",o=i?"local":"exported",a=e[s],l,u=!1,c=!0,p=a.loc.start;if(this.isContextual(93)){let h=this.parseIdentifier();if(this.isContextual(93)){let f=this.parseIdentifier();Br(this.state.type)?(u=!0,a=h,l=i?this.parseIdentifier():this.parseModuleExportName(),c=!1):(l=f,c=!1)}else Br(this.state.type)?(c=!1,l=i?this.parseIdentifier():this.parseModuleExportName()):(u=!0,a=h)}else Br(this.state.type)&&(u=!0,i?(a=this.parseIdentifier(!0),this.isContextual(93)||this.checkReservedWord(a.name,a.loc.start,!0,!0)):a=this.parseModuleExportName());u&&n&&this.raise(i?z.TypeModifierIsUsedInTypeImports:z.TypeModifierIsUsedInTypeExports,p),e[s]=a,e[o]=l;let d=i?"importKind":"exportKind";e[d]=u?"type":"value",c&&this.eatContextual(93)&&(e[o]=i?this.parseIdentifier():this.parseModuleExportName()),e[o]||(e[o]=Wi(e[s])),i&&this.checkIdentifier(e[o],u?4098:4096)}};function mB(t){if(t.type!=="MemberExpression")return!1;let{computed:r,property:e}=t;return r&&e.type!=="StringLiteral"&&(e.type!=="TemplateLiteral"||e.expressions.length>0)?!1:Wv(t.object)}function gB(t,r){var e;let{type:i}=t;if((e=t.extra)!=null&&e.parenthesized)return!1;if(r){if(i==="Literal"){let{value:n}=t;if(typeof n=="string"||typeof n=="boolean")return!0}}else if(i==="StringLiteral"||i==="BooleanLiteral")return!0;return!!(zv(t,r)||yB(t,r)||i==="TemplateLiteral"&&t.expressions.length===0||mB(t))}function zv(t,r){return r?t.type==="Literal"&&(typeof t.value=="number"||"bigint"in t):t.type==="NumericLiteral"||t.type==="BigIntLiteral"}function yB(t,r){if(t.type==="UnaryExpression"){let{operator:e,argument:i}=t;if(e==="-"&&zv(i,r))return!0}return!1}function Wv(t){return t.type==="Identifier"?!0:t.type!=="MemberExpression"||t.computed?!1:Wv(t.object)}var Iv=zi`placeholders`({ClassNameIsRequired:"A class name is required.",UnexpectedSpace:"Unexpected space in placeholder."}),bB=t=>class extends t{parsePlaceholder(e){if(this.match(144)){let i=this.startNode();return this.next(),this.assertNoSpace(),i.name=super.parseIdentifier(!0),this.assertNoSpace(),this.expect(144),this.finishPlaceholder(i,e)}}finishPlaceholder(e,i){let n=e;return(!n.expectedNode||!n.type)&&(n=this.finishNode(n,"Placeholder")),n.expectedNode=i,n}getTokenFromCode(e){e===37&&this.input.charCodeAt(this.state.pos+1)===37?this.finishOp(144,2):super.getTokenFromCode(e)}parseExprAtom(e){return this.parsePlaceholder("Expression")||super.parseExprAtom(e)}parseIdentifier(e){return this.parsePlaceholder("Identifier")||super.parseIdentifier(e)}checkReservedWord(e,i,n,s){e!==void 0&&super.checkReservedWord(e,i,n,s)}parseBindingAtom(){return this.parsePlaceholder("Pattern")||super.parseBindingAtom()}isValidLVal(e,i,n){return e==="Placeholder"||super.isValidLVal(e,i,n)}toAssignable(e,i){e&&e.type==="Placeholder"&&e.expectedNode==="Expression"?e.expectedNode="Pattern":super.toAssignable(e,i)}chStartsBindingIdentifier(e,i){return!!(super.chStartsBindingIdentifier(e,i)||this.lookahead().type===144)}verifyBreakContinue(e,i){e.label&&e.label.type==="Placeholder"||super.verifyBreakContinue(e,i)}parseExpressionStatement(e,i){var n;if(i.type!=="Placeholder"||(n=i.extra)!=null&&n.parenthesized)return super.parseExpressionStatement(e,i);if(this.match(14)){let o=e;return o.label=this.finishPlaceholder(i,"Identifier"),this.next(),o.body=super.parseStatementOrSloppyAnnexBFunctionDeclaration(),this.finishNode(o,"LabeledStatement")}this.semicolon();let s=e;return s.name=i.name,this.finishPlaceholder(s,"Statement")}parseBlock(e,i,n){return this.parsePlaceholder("BlockStatement")||super.parseBlock(e,i,n)}parseFunctionId(e){return this.parsePlaceholder("Identifier")||super.parseFunctionId(e)}parseClass(e,i,n){let s=i?"ClassDeclaration":"ClassExpression";this.next();let o=this.state.strict,a=this.parsePlaceholder("Identifier");if(a)if(this.match(81)||this.match(144)||this.match(5))e.id=a;else{if(n||!i)return e.id=null,e.body=this.finishPlaceholder(a,"ClassBody"),this.finishNode(e,s);throw this.raise(Iv.ClassNameIsRequired,this.state.startLoc)}else this.parseClassId(e,i,n);return super.parseClassSuper(e),e.body=this.parsePlaceholder("ClassBody")||super.parseClassBody(!!e.superClass,o),this.finishNode(e,s)}parseExport(e,i){let n=this.parsePlaceholder("Identifier");if(!n)return super.parseExport(e,i);let s=e;if(!this.isContextual(98)&&!this.match(12))return s.specifiers=[],s.source=null,s.declaration=this.finishPlaceholder(n,"Declaration"),this.finishNode(s,"ExportNamedDeclaration");this.expectPlugin("exportDefaultFrom");let o=this.startNode();return o.exported=n,s.specifiers=[this.finishNode(o,"ExportDefaultSpecifier")],super.parseExport(s,i)}isExportDefaultSpecifier(){if(this.match(65)){let e=this.nextTokenStart();if(this.isUnparsedContextual(e,"from")&&this.input.startsWith(bn(144),this.nextTokenStartSince(e+4)))return!0}return super.isExportDefaultSpecifier()}maybeParseExportDefaultSpecifier(e,i){var n;return(n=e.specifiers)!=null&&n.length?!0:super.maybeParseExportDefaultSpecifier(e,i)}checkExport(e){let{specifiers:i}=e;i!=null&&i.length&&(e.specifiers=i.filter(n=>n.exported.type==="Placeholder")),super.checkExport(e),e.specifiers=i}parseImport(e){let i=this.parsePlaceholder("Identifier");if(!i)return super.parseImport(e);if(e.specifiers=[],!this.isContextual(98)&&!this.match(12))return e.source=this.finishPlaceholder(i,"StringLiteral"),this.semicolon(),this.finishNode(e,"ImportDeclaration");let n=this.startNodeAtNode(i);return n.local=i,e.specifiers.push(this.finishNode(n,"ImportDefaultSpecifier")),this.eat(12)&&(this.maybeParseStarImportSpecifier(e)||this.parseNamedImportSpecifiers(e)),this.expectContextual(98),e.source=this.parseImportSource(),this.semicolon(),this.finishNode(e,"ImportDeclaration")}parseImportSource(){return this.parsePlaceholder("StringLiteral")||super.parseImportSource()}assertNoSpace(){this.state.start>this.state.lastTokEndLoc.index&&this.raise(Iv.UnexpectedSpace,this.state.lastTokEndLoc)}},DB=t=>class extends t{parseV8Intrinsic(){if(this.match(54)){let e=this.state.startLoc,i=this.startNode();if(this.next(),we(this.state.type)){let n=this.parseIdentifierName(),s=this.createIdentifier(i,n);if(s.type="V8IntrinsicIdentifier",this.match(10))return s}this.unexpected(e)}}parseExprAtom(e){return this.parseV8Intrinsic()||super.parseExprAtom(e)}},_v=["minimal","fsharp","hack","smart"],Nv=["^^","@@","^","%","#"];function xB(t){if(t.has("decorators")){if(t.has("decorators-legacy"))throw new Error("Cannot use the decorators and decorators-legacy plugin together");let e=t.get("decorators").decoratorsBeforeExport;if(e!=null&&typeof e!="boolean")throw new Error("'decoratorsBeforeExport' must be a boolean, if specified.");let i=t.get("decorators").allowCallParenthesized;if(i!=null&&typeof i!="boolean")throw new Error("'allowCallParenthesized' must be a boolean.")}if(t.has("flow")&&t.has("typescript"))throw new Error("Cannot combine flow and typescript plugins.");if(t.has("placeholders")&&t.has("v8intrinsic"))throw new Error("Cannot combine placeholders and v8intrinsic plugins.");if(t.has("pipelineOperator")){var r;let e=t.get("pipelineOperator").proposal;if(!_v.includes(e)){let n=_v.map(s=>`"${s}"`).join(", ");throw new Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${n}.`)}let i=((r=t.get("recordAndTuple"))==null?void 0:r.syntaxType)==="hash";if(e==="hack"){if(t.has("placeholders"))throw new Error("Cannot combine placeholders plugin and Hack-style pipes.");if(t.has("v8intrinsic"))throw new Error("Cannot combine v8intrinsic plugin and Hack-style pipes.");let n=t.get("pipelineOperator").topicToken;if(!Nv.includes(n)){let s=Nv.map(o=>`"${o}"`).join(", ");throw new Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${s}.`)}if(n==="#"&&i)throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "hack", topicToken: "#" }]\` and \`${JSON.stringify(["recordAndTuple",t.get("recordAndTuple")])}\`.`)}else if(e==="smart"&&i)throw new Error(`Plugin conflict between \`["pipelineOperator", { proposal: "smart" }]\` and \`${JSON.stringify(["recordAndTuple",t.get("recordAndTuple")])}\`.`)}if(t.has("moduleAttributes")){if(t.has("importAttributes")||t.has("importAssertions"))throw new Error("Cannot combine importAssertions, importAttributes and moduleAttributes plugins.");if(t.get("moduleAttributes").version!=="may-2020")throw new Error("The 'moduleAttributes' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is 'may-2020'.")}if(t.has("importAssertions")&&t.has("importAttributes"))throw new Error("Cannot combine importAssertions and importAttributes plugins.");if(t.has("recordAndTuple")){let e=t.get("recordAndTuple").syntaxType;if(e!=null){let i=["hash","bar"];if(!i.includes(e))throw new Error("The 'syntaxType' option of the 'recordAndTuple' plugin must be one of: "+i.map(n=>`'${n}'`).join(", "))}}if(t.has("asyncDoExpressions")&&!t.has("doExpressions")){let e=new Error("'asyncDoExpressions' requires 'doExpressions', please add 'doExpressions' to parser plugins.");throw e.missingPlugins="doExpressions",e}if(t.has("optionalChainingAssign")&&t.get("optionalChainingAssign").version!=="2023-07")throw new Error("The 'optionalChainingAssign' plugin requires a 'version' option, representing the last proposal update. Currently, the only supported value is '2023-07'.")}var Gv={estree:CM,jsx:cB,flow:lB,typescript:hB,v8intrinsic:DB,placeholders:bB},EB=Object.keys(Gv),Uf={sourceType:"script",sourceFilename:void 0,startColumn:0,startLine:1,allowAwaitOutsideFunction:!1,allowReturnOutsideFunction:!1,allowNewTargetOutsideFunction:!1,allowImportExportEverywhere:!1,allowSuperOutsideMethod:!1,allowUndeclaredExports:!1,plugins:[],strictMode:null,ranges:!1,tokens:!1,createImportExpressions:!1,createParenthesizedExpressions:!1,errorRecovery:!1,attachComment:!0,annexB:!0};function CB(t){if(t==null)return Object.assign({},Uf);if(t.annexB!=null&&t.annexB!==!1)throw new Error("The `annexB` option can only be set to `false`.");let r={};for(let i of Object.keys(Uf)){var e;r[i]=(e=t[i])!=null?e:Uf[i]}return r}var ah=class extends oh{checkProto(r,e,i,n){if(r.type==="SpreadElement"||this.isObjectMethod(r)||r.computed||r.shorthand)return;let s=r.key;if((s.type==="Identifier"?s.name:s.value)==="__proto__"){if(e){this.raise(S.RecordNoProto,s);return}i.used&&(n?n.doubleProtoLoc===null&&(n.doubleProtoLoc=s.loc.start):this.raise(S.DuplicateProto,s)),i.used=!0}}shouldExitDescending(r,e){return r.type==="ArrowFunctionExpression"&&r.start===e}getExpression(){this.enterInitialScopes(),this.nextToken();let r=this.parseExpression();return this.match(139)||this.unexpected(),this.finalizeRemainingComments(),r.comments=this.comments,r.errors=this.state.errors,this.options.tokens&&(r.tokens=this.tokens),r}parseExpression(r,e){return r?this.disallowInAnd(()=>this.parseExpressionBase(e)):this.allowInAnd(()=>this.parseExpressionBase(e))}parseExpressionBase(r){let e=this.state.startLoc,i=this.parseMaybeAssign(r);if(this.match(12)){let n=this.startNodeAt(e);for(n.expressions=[i];this.eat(12);)n.expressions.push(this.parseMaybeAssign(r));return this.toReferencedList(n.expressions),this.finishNode(n,"SequenceExpression")}return i}parseMaybeAssignDisallowIn(r,e){return this.disallowInAnd(()=>this.parseMaybeAssign(r,e))}parseMaybeAssignAllowIn(r,e){return this.allowInAnd(()=>this.parseMaybeAssign(r,e))}setOptionalParametersError(r,e){var i;r.optionalParametersLoc=(i=e?.loc)!=null?i:this.state.startLoc}parseMaybeAssign(r,e){let i=this.state.startLoc;if(this.isContextual(108)&&this.prodParam.hasYield){let a=this.parseYield();return e&&(a=e.call(this,a,i)),a}let n;r?n=!1:(r=new Bs,n=!0);let{type:s}=this.state;(s===10||we(s))&&(this.state.potentialArrowAt=this.state.start);let o=this.parseMaybeConditional(r);if(e&&(o=e.call(this,o,i)),AM(this.state.type)){let a=this.startNodeAt(i),l=this.state.value;if(a.operator=l,this.match(29)){this.toAssignable(o,!0),a.left=o;let u=i.index;r.doubleProtoLoc!=null&&r.doubleProtoLoc.index>=u&&(r.doubleProtoLoc=null),r.shorthandAssignLoc!=null&&r.shorthandAssignLoc.index>=u&&(r.shorthandAssignLoc=null),r.privateKeyLoc!=null&&r.privateKeyLoc.index>=u&&(this.checkDestructuringPrivate(r),r.privateKeyLoc=null)}else a.left=o;return this.next(),a.right=this.parseMaybeAssign(),this.checkLVal(o,this.finishNode(a,"AssignmentExpression")),a}else n&&this.checkExpressionErrors(r,!0);return o}parseMaybeConditional(r){let e=this.state.startLoc,i=this.state.potentialArrowAt,n=this.parseExprOps(r);return this.shouldExitDescending(n,i)?n:this.parseConditional(n,e,r)}parseConditional(r,e,i){if(this.eat(17)){let n=this.startNodeAt(e);return n.test=r,n.consequent=this.parseMaybeAssignAllowIn(),this.expect(14),n.alternate=this.parseMaybeAssign(),this.finishNode(n,"ConditionalExpression")}return r}parseMaybeUnaryOrPrivate(r){return this.match(138)?this.parsePrivateName():this.parseMaybeUnary(r)}parseExprOps(r){let e=this.state.startLoc,i=this.state.potentialArrowAt,n=this.parseMaybeUnaryOrPrivate(r);return this.shouldExitDescending(n,i)?n:this.parseExprOp(n,e,-1)}parseExprOp(r,e,i){if(this.isPrivateName(r)){let s=this.getPrivateNameSV(r);(i>=Nu(58)||!this.prodParam.hasIn||!this.match(58))&&this.raise(S.PrivateInExpectedIn,r,{identifierName:s}),this.classScope.usePrivateName(s,r.loc.start)}let n=this.state.type;if(IM(n)&&(this.prodParam.hasIn||!this.match(58))){let s=Nu(n);if(s>i){if(n===39){if(this.expectPlugin("pipelineOperator"),this.state.inFSharpPipelineDirectBody)return r;this.checkPipelineAtInfixOperator(r,e)}let o=this.startNodeAt(e);o.left=r,o.operator=this.state.value;let a=n===41||n===42,l=n===40;if(l&&(s=Nu(42)),this.next(),n===39&&this.hasPlugin(["pipelineOperator",{proposal:"minimal"}])&&this.state.type===96&&this.prodParam.hasAwait)throw this.raise(S.UnexpectedAwaitAfterPipelineBody,this.state.startLoc);o.right=this.parseExprOpRightExpr(n,s);let u=this.finishNode(o,a||l?"LogicalExpression":"BinaryExpression"),c=this.state.type;if(l&&(c===41||c===42)||a&&c===40)throw this.raise(S.MixingCoalesceWithLogical,this.state.startLoc);return this.parseExprOp(u,e,i)}}return r}parseExprOpRightExpr(r,e){let i=this.state.startLoc;switch(r){case 39:switch(this.getPluginOption("pipelineOperator","proposal")){case"hack":return this.withTopicBindingContext(()=>this.parseHackPipeBody());case"smart":return this.withTopicBindingContext(()=>{if(this.prodParam.hasYield&&this.isContextual(108))throw this.raise(S.PipeBodyIsTighter,this.state.startLoc);return this.parseSmartPipelineBodyInStyle(this.parseExprOpBaseRightExpr(r,e),i)});case"fsharp":return this.withSoloAwaitPermittingContext(()=>this.parseFSharpPipelineBody(e))}default:return this.parseExprOpBaseRightExpr(r,e)}}parseExprOpBaseRightExpr(r,e){let i=this.state.startLoc;return this.parseExprOp(this.parseMaybeUnaryOrPrivate(),i,OM(r)?e-1:e)}parseHackPipeBody(){var r;let{startLoc:e}=this.state,i=this.parseMaybeAssign();return yM.has(i.type)&&!((r=i.extra)!=null&&r.parenthesized)&&this.raise(S.PipeUnparenthesizedBody,e,{type:i.type}),this.topicReferenceWasUsedInCurrentContext()||this.raise(S.PipeTopicUnused,e),i}checkExponentialAfterUnary(r){this.match(57)&&this.raise(S.UnexpectedTokenUnaryExponentiation,r.argument)}parseMaybeUnary(r,e){let i=this.state.startLoc,n=this.isContextual(96);if(n&&this.recordAwaitIfAllowed()){this.next();let l=this.parseAwait(i);return e||this.checkExponentialAfterUnary(l),l}let s=this.match(34),o=this.startNode();if(NM(this.state.type)){o.operator=this.state.value,o.prefix=!0,this.match(72)&&this.expectPlugin("throwExpressions");let l=this.match(89);if(this.next(),o.argument=this.parseMaybeUnary(null,!0),this.checkExpressionErrors(r,!0),this.state.strict&&l){let u=o.argument;u.type==="Identifier"?this.raise(S.StrictDelete,o):this.hasPropertyAsPrivateName(u)&&this.raise(S.DeletePrivateField,o)}if(!s)return e||this.checkExponentialAfterUnary(o),this.finishNode(o,"UnaryExpression")}let a=this.parseUpdate(o,s,r);if(n){let{type:l}=this.state;if((this.hasPlugin("v8intrinsic")?Kf(l):Kf(l)&&!this.match(54))&&!this.isAmbiguousAwait())return this.raiseOverwrite(S.AwaitNotInAsyncContext,i),this.parseAwait(i)}return a}parseUpdate(r,e,i){if(e){let o=r;return this.checkLVal(o.argument,this.finishNode(o,"UpdateExpression")),r}let n=this.state.startLoc,s=this.parseExprSubscripts(i);if(this.checkExpressionErrors(i,!1))return s;for(;_M(this.state.type)&&!this.canInsertSemicolon();){let o=this.startNodeAt(n);o.operator=this.state.value,o.prefix=!1,o.argument=s,this.next(),this.checkLVal(s,s=this.finishNode(o,"UpdateExpression"))}return s}parseExprSubscripts(r){let e=this.state.startLoc,i=this.state.potentialArrowAt,n=this.parseExprAtom(r);return this.shouldExitDescending(n,i)?n:this.parseSubscripts(n,e)}parseSubscripts(r,e,i){let n={optionalChainMember:!1,maybeAsyncArrow:this.atPossibleAsyncArrow(r),stop:!1};do r=this.parseSubscript(r,e,i,n),n.maybeAsyncArrow=!1;while(!n.stop);return r}parseSubscript(r,e,i,n){let{type:s}=this.state;if(!i&&s===15)return this.parseBind(r,e,i,n);if(Ou(s))return this.parseTaggedTemplateExpression(r,e,n);let o=!1;if(s===18){if(i&&(this.raise(S.OptionalChainingNoNew,this.state.startLoc),this.lookaheadCharCode()===40))return n.stop=!0,r;n.optionalChainMember=o=!0,this.next()}if(!i&&this.match(10))return this.parseCoverCallAndAsyncArrowHead(r,e,n,o);{let a=this.eat(0);return a||o||this.eat(16)?this.parseMember(r,e,n,a,o):(n.stop=!0,r)}}parseMember(r,e,i,n,s){let o=this.startNodeAt(e);return o.object=r,o.computed=n,n?(o.property=this.parseExpression(),this.expect(3)):this.match(138)?(r.type==="Super"&&this.raise(S.SuperPrivateField,e),this.classScope.usePrivateName(this.state.value,this.state.startLoc),o.property=this.parsePrivateName()):o.property=this.parseIdentifier(!0),i.optionalChainMember?(o.optional=s,this.finishNode(o,"OptionalMemberExpression")):this.finishNode(o,"MemberExpression")}parseBind(r,e,i,n){let s=this.startNodeAt(e);return s.object=r,this.next(),s.callee=this.parseNoCallExpr(),n.stop=!0,this.parseSubscripts(this.finishNode(s,"BindExpression"),e,i)}parseCoverCallAndAsyncArrowHead(r,e,i,n){let s=this.state.maybeInArrowParameters,o=null;this.state.maybeInArrowParameters=!0,this.next();let a=this.startNodeAt(e);a.callee=r;let{maybeAsyncArrow:l,optionalChainMember:u}=i;l&&(this.expressionScope.enter(eB()),o=new Bs),u&&(a.optional=n),n?a.arguments=this.parseCallExpressionArguments(11):a.arguments=this.parseCallExpressionArguments(11,r.type==="Import",r.type!=="Super",a,o);let c=this.finishCallExpression(a,u);return l&&this.shouldParseAsyncArrow()&&!n?(i.stop=!0,this.checkDestructuringPrivate(o),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),c=this.parseAsyncArrowFromCallExpression(this.startNodeAt(e),c)):(l&&(this.checkExpressionErrors(o,!0),this.expressionScope.exit()),this.toReferencedArguments(c)),this.state.maybeInArrowParameters=s,c}toReferencedArguments(r,e){this.toReferencedListDeep(r.arguments,e)}parseTaggedTemplateExpression(r,e,i){let n=this.startNodeAt(e);return n.tag=r,n.quasi=this.parseTemplate(!0),i.optionalChainMember&&this.raise(S.OptionalChainingNoTemplate,e),this.finishNode(n,"TaggedTemplateExpression")}atPossibleAsyncArrow(r){return r.type==="Identifier"&&r.name==="async"&&this.state.lastTokEndLoc.index===r.end&&!this.canInsertSemicolon()&&r.end-r.start===5&&r.start===this.state.potentialArrowAt}finishCallExpression(r,e){if(r.callee.type==="Import")if(r.arguments.length===2&&(this.hasPlugin("moduleAttributes")||this.hasPlugin("importAssertions")||this.expectPlugin("importAttributes")),r.arguments.length===0||r.arguments.length>2)this.raise(S.ImportCallArity,r,{maxArgumentCount:this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions")||this.hasPlugin("moduleAttributes")?2:1});else for(let i of r.arguments)i.type==="SpreadElement"&&this.raise(S.ImportCallSpreadArgument,i);return this.finishNode(r,e?"OptionalCallExpression":"CallExpression")}parseCallExpressionArguments(r,e,i,n,s){let o=[],a=!0,l=this.state.inFSharpPipelineDirectBody;for(this.state.inFSharpPipelineDirectBody=!1;!this.eat(r);){if(a)a=!1;else if(this.expect(12),this.match(r)){e&&!this.hasPlugin("importAttributes")&&!this.hasPlugin("importAssertions")&&!this.hasPlugin("moduleAttributes")&&this.raise(S.ImportCallArgumentTrailingComma,this.state.lastTokStartLoc),n&&this.addTrailingCommaExtraToNode(n),this.next();break}o.push(this.parseExprListItem(!1,s,i))}return this.state.inFSharpPipelineDirectBody=l,o}shouldParseAsyncArrow(){return this.match(19)&&!this.canInsertSemicolon()}parseAsyncArrowFromCallExpression(r,e){var i;return this.resetPreviousNodeTrailingComments(e),this.expect(19),this.parseArrowExpression(r,e.arguments,!0,(i=e.extra)==null?void 0:i.trailingCommaLoc),e.innerComments&&ba(r,e.innerComments),e.callee.trailingComments&&ba(r,e.callee.trailingComments),r}parseNoCallExpr(){let r=this.state.startLoc;return this.parseSubscripts(this.parseExprAtom(),r,!0)}parseExprAtom(r){let e,i=null,{type:n}=this.state;switch(n){case 79:return this.parseSuper();case 83:return e=this.startNode(),this.next(),this.match(16)?this.parseImportMetaProperty(e):this.match(10)?this.options.createImportExpressions?this.parseImportCall(e):this.finishNode(e,"Import"):(this.raise(S.UnsupportedImport,this.state.lastTokStartLoc),this.finishNode(e,"Import"));case 78:return e=this.startNode(),this.next(),this.finishNode(e,"ThisExpression");case 90:return this.parseDo(this.startNode(),!1);case 56:case 31:return this.readRegexp(),this.parseRegExpLiteral(this.state.value);case 134:return this.parseNumericLiteral(this.state.value);case 135:return this.parseBigIntLiteral(this.state.value);case 133:return this.parseStringLiteral(this.state.value);case 84:return this.parseNullLiteral();case 85:return this.parseBooleanLiteral(!0);case 86:return this.parseBooleanLiteral(!1);case 10:{let s=this.state.potentialArrowAt===this.state.start;return this.parseParenAndDistinguishExpression(s)}case 2:case 1:return this.parseArrayLike(this.state.type===2?4:3,!1,!0);case 0:return this.parseArrayLike(3,!0,!1,r);case 6:case 7:return this.parseObjectLike(this.state.type===6?9:8,!1,!0);case 5:return this.parseObjectLike(8,!1,!1,r);case 68:return this.parseFunctionOrFunctionSent();case 26:i=this.parseDecorators();case 80:return this.parseClass(this.maybeTakeDecorators(i,this.startNode()),!1);case 77:return this.parseNewOrNewTarget();case 25:case 24:return this.parseTemplate(!1);case 15:{e=this.startNode(),this.next(),e.object=null;let s=e.callee=this.parseNoCallExpr();if(s.type==="MemberExpression")return this.finishNode(e,"BindExpression");throw this.raise(S.UnsupportedBind,s)}case 138:return this.raise(S.PrivateInExpectedIn,this.state.startLoc,{identifierName:this.state.value}),this.parsePrivateName();case 33:return this.parseTopicReferenceThenEqualsSign(54,"%");case 32:return this.parseTopicReferenceThenEqualsSign(44,"^");case 37:case 38:return this.parseTopicReference("hack");case 44:case 54:case 27:{let s=this.getPluginOption("pipelineOperator","proposal");if(s)return this.parseTopicReference(s);this.unexpected();break}case 47:{let s=this.input.codePointAt(this.nextTokenStart());Vi(s)||s===62?this.expectOnePlugin(["jsx","flow","typescript"]):this.unexpected();break}default:if(n===136)return this.parseDecimalLiteral(this.state.value);if(we(n)){if(this.isContextual(127)&&this.lookaheadInLineCharCode()===123)return this.parseModuleExpression();let s=this.state.potentialArrowAt===this.state.start,o=this.state.containsEsc,a=this.parseIdentifier();if(!o&&a.name==="async"&&!this.canInsertSemicolon()){let{type:l}=this.state;if(l===68)return this.resetPreviousNodeTrailingComments(a),this.next(),this.parseAsyncFunctionExpression(this.startNodeAtNode(a));if(we(l))return this.lookaheadCharCode()===61?this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(a)):a;if(l===90)return this.resetPreviousNodeTrailingComments(a),this.parseDo(this.startNodeAtNode(a),!0)}return s&&this.match(19)&&!this.canInsertSemicolon()?(this.next(),this.parseArrowExpression(this.startNodeAtNode(a),[a],!1)):a}else this.unexpected()}}parseTopicReferenceThenEqualsSign(r,e){let i=this.getPluginOption("pipelineOperator","proposal");if(i)return this.state.type=r,this.state.value=e,this.state.pos--,this.state.end--,this.state.endLoc=jt(this.state.endLoc,-1),this.parseTopicReference(i);this.unexpected()}parseTopicReference(r){let e=this.startNode(),i=this.state.startLoc,n=this.state.type;return this.next(),this.finishTopicReference(e,i,r,n)}finishTopicReference(r,e,i,n){if(this.testTopicReferenceConfiguration(i,e,n)){let s=i==="smart"?"PipelinePrimaryTopicReference":"TopicReference";return this.topicReferenceIsAllowedInCurrentContext()||this.raise(i==="smart"?S.PrimaryTopicNotAllowed:S.PipeTopicUnbound,e),this.registerTopicReference(),this.finishNode(r,s)}else throw this.raise(S.PipeTopicUnconfiguredToken,e,{token:bn(n)})}testTopicReferenceConfiguration(r,e,i){switch(r){case"hack":return this.hasPlugin(["pipelineOperator",{topicToken:bn(i)}]);case"smart":return i===27;default:throw this.raise(S.PipeTopicRequiresHackPipes,e)}}parseAsyncArrowUnaryFunction(r){this.prodParam.enter(Fu(!0,this.prodParam.hasYield));let e=[this.parseIdentifier()];return this.prodParam.exit(),this.hasPrecedingLineBreak()&&this.raise(S.LineTerminatorBeforeArrow,this.state.curPosition()),this.expect(19),this.parseArrowExpression(r,e,!0)}parseDo(r,e){this.expectPlugin("doExpressions"),e&&this.expectPlugin("asyncDoExpressions"),r.async=e,this.next();let i=this.state.labels;return this.state.labels=[],e?(this.prodParam.enter(2),r.body=this.parseBlock(),this.prodParam.exit()):r.body=this.parseBlock(),this.state.labels=i,this.finishNode(r,"DoExpression")}parseSuper(){let r=this.startNode();return this.next(),this.match(10)&&!this.scope.allowDirectSuper&&!this.options.allowSuperOutsideMethod?this.raise(S.SuperNotAllowed,r):!this.scope.allowSuper&&!this.options.allowSuperOutsideMethod&&this.raise(S.UnexpectedSuper,r),!this.match(10)&&!this.match(0)&&!this.match(16)&&this.raise(S.UnsupportedSuper,r),this.finishNode(r,"Super")}parsePrivateName(){let r=this.startNode(),e=this.startNodeAt(jt(this.state.startLoc,1)),i=this.state.value;return this.next(),r.id=this.createIdentifier(e,i),this.finishNode(r,"PrivateName")}parseFunctionOrFunctionSent(){let r=this.startNode();if(this.next(),this.prodParam.hasYield&&this.match(16)){let e=this.createIdentifier(this.startNodeAtNode(r),"function");return this.next(),this.match(103)?this.expectPlugin("functionSent"):this.hasPlugin("functionSent")||this.unexpected(),this.parseMetaProperty(r,e,"sent")}return this.parseFunction(r)}parseMetaProperty(r,e,i){r.meta=e;let n=this.state.containsEsc;return r.property=this.parseIdentifier(!0),(r.property.name!==i||n)&&this.raise(S.UnsupportedMetaProperty,r.property,{target:e.name,onlyValidPropertyName:i}),this.finishNode(r,"MetaProperty")}parseImportMetaProperty(r){let e=this.createIdentifier(this.startNodeAtNode(r),"import");if(this.next(),this.isContextual(101))this.inModule||this.raise(S.ImportMetaOutsideModule,e),this.sawUnambiguousESM=!0;else if(this.isContextual(105)||this.isContextual(97)){let i=this.isContextual(105);if(i||this.unexpected(),this.expectPlugin(i?"sourcePhaseImports":"deferredImportEvaluation"),!this.options.createImportExpressions)throw this.raise(S.DynamicImportPhaseRequiresImportExpressions,this.state.startLoc,{phase:this.state.value});return this.next(),r.phase=i?"source":"defer",this.parseImportCall(r)}return this.parseMetaProperty(r,e,"meta")}parseLiteralAtNode(r,e,i){return this.addExtra(i,"rawValue",r),this.addExtra(i,"raw",this.input.slice(i.start,this.state.end)),i.value=r,this.next(),this.finishNode(i,e)}parseLiteral(r,e){let i=this.startNode();return this.parseLiteralAtNode(r,e,i)}parseStringLiteral(r){return this.parseLiteral(r,"StringLiteral")}parseNumericLiteral(r){return this.parseLiteral(r,"NumericLiteral")}parseBigIntLiteral(r){return this.parseLiteral(r,"BigIntLiteral")}parseDecimalLiteral(r){return this.parseLiteral(r,"DecimalLiteral")}parseRegExpLiteral(r){let e=this.startNode();return this.addExtra(e,"raw",this.input.slice(e.start,this.state.end)),e.pattern=r.pattern,e.flags=r.flags,this.next(),this.finishNode(e,"RegExpLiteral")}parseBooleanLiteral(r){let e=this.startNode();return e.value=r,this.next(),this.finishNode(e,"BooleanLiteral")}parseNullLiteral(){let r=this.startNode();return this.next(),this.finishNode(r,"NullLiteral")}parseParenAndDistinguishExpression(r){let e=this.state.startLoc,i;this.next(),this.expressionScope.enter(ZM());let n=this.state.maybeInArrowParameters,s=this.state.inFSharpPipelineDirectBody;this.state.maybeInArrowParameters=!0,this.state.inFSharpPipelineDirectBody=!1;let o=this.state.startLoc,a=[],l=new Bs,u=!0,c,p;for(;!this.match(11);){if(u)u=!1;else if(this.expect(12,l.optionalParametersLoc===null?null:l.optionalParametersLoc),this.match(11)){p=this.state.startLoc;break}if(this.match(21)){let f=this.state.startLoc;if(c=this.state.startLoc,a.push(this.parseParenItem(this.parseRestBinding(),f)),!this.checkCommaAfterRest(41))break}else a.push(this.parseMaybeAssignAllowIn(l,this.parseParenItem))}let d=this.state.lastTokEndLoc;this.expect(11),this.state.maybeInArrowParameters=n,this.state.inFSharpPipelineDirectBody=s;let h=this.startNodeAt(e);return r&&this.shouldParseArrow(a)&&(h=this.parseArrow(h))?(this.checkDestructuringPrivate(l),this.expressionScope.validateAsPattern(),this.expressionScope.exit(),this.parseArrowExpression(h,a,!1),h):(this.expressionScope.exit(),a.length||this.unexpected(this.state.lastTokStartLoc),p&&this.unexpected(p),c&&this.unexpected(c),this.checkExpressionErrors(l,!0),this.toReferencedListDeep(a,!0),a.length>1?(i=this.startNodeAt(o),i.expressions=a,this.finishNode(i,"SequenceExpression"),this.resetEndLocation(i,d)):i=a[0],this.wrapParenthesis(e,i))}wrapParenthesis(r,e){if(!this.options.createParenthesizedExpressions)return this.addExtra(e,"parenthesized",!0),this.addExtra(e,"parenStart",r.index),this.takeSurroundingComments(e,r.index,this.state.lastTokEndLoc.index),e;let i=this.startNodeAt(r);return i.expression=e,this.finishNode(i,"ParenthesizedExpression")}shouldParseArrow(r){return!this.canInsertSemicolon()}parseArrow(r){if(this.eat(19))return r}parseParenItem(r,e){return r}parseNewOrNewTarget(){let r=this.startNode();if(this.next(),this.match(16)){let e=this.createIdentifier(this.startNodeAtNode(r),"new");this.next();let i=this.parseMetaProperty(r,e,"target");return!this.scope.inNonArrowFunction&&!this.scope.inClass&&!this.options.allowNewTargetOutsideFunction&&this.raise(S.UnexpectedNewTarget,i),i}return this.parseNew(r)}parseNew(r){if(this.parseNewCallee(r),this.eat(10)){let e=this.parseExprList(11);this.toReferencedList(e),r.arguments=e}else r.arguments=[];return this.finishNode(r,"NewExpression")}parseNewCallee(r){let e=this.match(83),i=this.parseNoCallExpr();r.callee=i,e&&(i.type==="Import"||i.type==="ImportExpression")&&this.raise(S.ImportCallNotNewExpression,i)}parseTemplateElement(r){let{start:e,startLoc:i,end:n,value:s}=this.state,o=e+1,a=this.startNodeAt(jt(i,1));s===null&&(r||this.raise(S.InvalidEscapeSequenceTemplate,jt(this.state.firstInvalidTemplateEscapePos,1)));let l=this.match(24),u=l?-1:-2,c=n+u;a.value={raw:this.input.slice(o,c).replace(/\r\n?/g,`
|
|
119
|
-
`),cooked:s===null?null:s.slice(1,u)},a.tail=l,this.next();let p=this.finishNode(a,"TemplateElement");return this.resetEndLocation(p,jt(this.state.lastTokEndLoc,u)),p}parseTemplate(r){let e=this.startNode(),i=this.parseTemplateElement(r),n=[i],s=[];for(;!i.tail;)s.push(this.parseTemplateSubstitution()),this.readTemplateContinuation(),n.push(i=this.parseTemplateElement(r));return e.expressions=s,e.quasis=n,this.finishNode(e,"TemplateLiteral")}parseTemplateSubstitution(){return this.parseExpression()}parseObjectLike(r,e,i,n){i&&this.expectPlugin("recordAndTuple");let s=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let o=Object.create(null),a=!0,l=this.startNode();for(l.properties=[],this.next();!this.match(r);){if(a)a=!1;else if(this.expect(12),this.match(r)){this.addTrailingCommaExtraToNode(l);break}let c;e?c=this.parseBindingProperty():(c=this.parsePropertyDefinition(n),this.checkProto(c,i,o,n)),i&&!this.isObjectProperty(c)&&c.type!=="SpreadElement"&&this.raise(S.InvalidRecordProperty,c),c.shorthand&&this.addExtra(c,"shorthand",!0),l.properties.push(c)}this.next(),this.state.inFSharpPipelineDirectBody=s;let u="ObjectExpression";return e?u="ObjectPattern":i&&(u="RecordExpression"),this.finishNode(l,u)}addTrailingCommaExtraToNode(r){this.addExtra(r,"trailingComma",this.state.lastTokStartLoc.index),this.addExtra(r,"trailingCommaLoc",this.state.lastTokStartLoc,!1)}maybeAsyncOrAccessorProp(r){return!r.computed&&r.key.type==="Identifier"&&(this.isLiteralPropertyName()||this.match(0)||this.match(55))}parsePropertyDefinition(r){let e=[];if(this.match(26))for(this.hasPlugin("decorators")&&this.raise(S.UnsupportedPropertyDecorator,this.state.startLoc);this.match(26);)e.push(this.parseDecorator());let i=this.startNode(),n=!1,s=!1,o;if(this.match(21))return e.length&&this.unexpected(),this.parseSpread();e.length&&(i.decorators=e,e=[]),i.method=!1,r&&(o=this.state.startLoc);let a=this.eat(55);this.parsePropertyNamePrefixOperator(i);let l=this.state.containsEsc;if(this.parsePropertyName(i,r),!a&&!l&&this.maybeAsyncOrAccessorProp(i)){let{key:u}=i,c=u.name;c==="async"&&!this.hasPrecedingLineBreak()&&(n=!0,this.resetPreviousNodeTrailingComments(u),a=this.eat(55),this.parsePropertyName(i)),(c==="get"||c==="set")&&(s=!0,this.resetPreviousNodeTrailingComments(u),i.kind=c,this.match(55)&&(a=!0,this.raise(S.AccessorIsGenerator,this.state.curPosition(),{kind:c}),this.next()),this.parsePropertyName(i))}return this.parseObjPropValue(i,o,a,n,!1,s,r)}getGetterSetterExpectedParamCount(r){return r.kind==="get"?0:1}getObjectOrClassMethodParams(r){return r.params}checkGetterSetterParams(r){var e;let i=this.getGetterSetterExpectedParamCount(r),n=this.getObjectOrClassMethodParams(r);n.length!==i&&this.raise(r.kind==="get"?S.BadGetterArity:S.BadSetterArity,r),r.kind==="set"&&((e=n[n.length-1])==null?void 0:e.type)==="RestElement"&&this.raise(S.BadSetterRestParameter,r)}parseObjectMethod(r,e,i,n,s){if(s){let o=this.parseMethod(r,e,!1,!1,!1,"ObjectMethod");return this.checkGetterSetterParams(o),o}if(i||e||this.match(10))return n&&this.unexpected(),r.kind="method",r.method=!0,this.parseMethod(r,e,i,!1,!1,"ObjectMethod")}parseObjectProperty(r,e,i,n){if(r.shorthand=!1,this.eat(14))return r.value=i?this.parseMaybeDefault(this.state.startLoc):this.parseMaybeAssignAllowIn(n),this.finishNode(r,"ObjectProperty");if(!r.computed&&r.key.type==="Identifier"){if(this.checkReservedWord(r.key.name,r.key.loc.start,!0,!1),i)r.value=this.parseMaybeDefault(e,Wi(r.key));else if(this.match(29)){let s=this.state.startLoc;n!=null?n.shorthandAssignLoc===null&&(n.shorthandAssignLoc=s):this.raise(S.InvalidCoverInitializedName,s),r.value=this.parseMaybeDefault(e,Wi(r.key))}else r.value=Wi(r.key);return r.shorthand=!0,this.finishNode(r,"ObjectProperty")}}parseObjPropValue(r,e,i,n,s,o,a){let l=this.parseObjectMethod(r,i,n,s,o)||this.parseObjectProperty(r,e,s,a);return l||this.unexpected(),l}parsePropertyName(r,e){if(this.eat(0))r.computed=!0,r.key=this.parseMaybeAssignAllowIn(),this.expect(3);else{let{type:i,value:n}=this.state,s;if(Br(i))s=this.parseIdentifier(!0);else switch(i){case 134:s=this.parseNumericLiteral(n);break;case 133:s=this.parseStringLiteral(n);break;case 135:s=this.parseBigIntLiteral(n);break;case 138:{let o=this.state.startLoc;e!=null?e.privateKeyLoc===null&&(e.privateKeyLoc=o):this.raise(S.UnexpectedPrivateField,o),s=this.parsePrivateName();break}default:if(i===136){s=this.parseDecimalLiteral(n);break}this.unexpected()}r.key=s,i!==138&&(r.computed=!1)}}initFunction(r,e){r.id=null,r.generator=!1,r.async=e}parseMethod(r,e,i,n,s,o,a=!1){this.initFunction(r,i),r.generator=e,this.scope.enter(18|(a?64:0)|(s?32:0)),this.prodParam.enter(Fu(i,r.generator)),this.parseFunctionParams(r,n);let l=this.parseFunctionBodyAndFinish(r,o,!0);return this.prodParam.exit(),this.scope.exit(),l}parseArrayLike(r,e,i,n){i&&this.expectPlugin("recordAndTuple");let s=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let o=this.startNode();return this.next(),o.elements=this.parseExprList(r,!i,n,o),this.state.inFSharpPipelineDirectBody=s,this.finishNode(o,i?"TupleExpression":"ArrayExpression")}parseArrowExpression(r,e,i,n){this.scope.enter(6);let s=Fu(i,!1);!this.match(5)&&this.prodParam.hasIn&&(s|=8),this.prodParam.enter(s),this.initFunction(r,i);let o=this.state.maybeInArrowParameters;return e&&(this.state.maybeInArrowParameters=!0,this.setArrowFunctionParameters(r,e,n)),this.state.maybeInArrowParameters=!1,this.parseFunctionBody(r,!0),this.prodParam.exit(),this.scope.exit(),this.state.maybeInArrowParameters=o,this.finishNode(r,"ArrowFunctionExpression")}setArrowFunctionParameters(r,e,i){this.toAssignableList(e,i,!1),r.params=e}parseFunctionBodyAndFinish(r,e,i=!1){return this.parseFunctionBody(r,!1,i),this.finishNode(r,e)}parseFunctionBody(r,e,i=!1){let n=e&&!this.match(5);if(this.expressionScope.enter(Kv()),n)r.body=this.parseMaybeAssign(),this.checkParams(r,!1,e,!1);else{let s=this.state.strict,o=this.state.labels;this.state.labels=[],this.prodParam.enter(this.prodParam.currentFlags()|4),r.body=this.parseBlock(!0,!1,a=>{let l=!this.isSimpleParamList(r.params);a&&l&&this.raise(S.IllegalLanguageModeDirective,(r.kind==="method"||r.kind==="constructor")&&r.key?r.key.loc.end:r);let u=!s&&this.state.strict;this.checkParams(r,!this.state.strict&&!e&&!i&&!l,e,u),this.state.strict&&r.id&&this.checkIdentifier(r.id,65,u)}),this.prodParam.exit(),this.state.labels=o}this.expressionScope.exit()}isSimpleParameter(r){return r.type==="Identifier"}isSimpleParamList(r){for(let e=0,i=r.length;e<i;e++)if(!this.isSimpleParameter(r[e]))return!1;return!0}checkParams(r,e,i,n=!0){let s=!e&&new Set,o={type:"FormalParameters"};for(let a of r.params)this.checkLVal(a,o,5,s,n)}parseExprList(r,e,i,n){let s=[],o=!0;for(;!this.eat(r);){if(o)o=!1;else if(this.expect(12),this.match(r)){n&&this.addTrailingCommaExtraToNode(n),this.next();break}s.push(this.parseExprListItem(e,i))}return s}parseExprListItem(r,e,i){let n;if(this.match(12))r||this.raise(S.UnexpectedToken,this.state.curPosition(),{unexpected:","}),n=null;else if(this.match(21)){let s=this.state.startLoc;n=this.parseParenItem(this.parseSpread(e),s)}else if(this.match(17)){this.expectPlugin("partialApplication"),i||this.raise(S.UnexpectedArgumentPlaceholder,this.state.startLoc);let s=this.startNode();this.next(),n=this.finishNode(s,"ArgumentPlaceholder")}else n=this.parseMaybeAssignAllowIn(e,this.parseParenItem);return n}parseIdentifier(r){let e=this.startNode(),i=this.parseIdentifierName(r);return this.createIdentifier(e,i)}createIdentifier(r,e){return r.name=e,r.loc.identifierName=e,this.finishNode(r,"Identifier")}parseIdentifierName(r){let e,{startLoc:i,type:n}=this.state;Br(n)?e=this.state.value:this.unexpected();let s=wM(n);return r?s&&this.replaceToken(132):this.checkReservedWord(e,i,s,!1),this.next(),e}checkReservedWord(r,e,i,n){if(r.length>10||!VM(r))return;if(i&&jM(r)){this.raise(S.UnexpectedKeyword,e,{keyword:r});return}if((this.state.strict?n?$v:Mv:Lv)(r,this.inModule)){this.raise(S.UnexpectedReservedWord,e,{reservedWord:r});return}else if(r==="yield"){if(this.prodParam.hasYield){this.raise(S.YieldBindingIdentifier,e);return}}else if(r==="await"){if(this.prodParam.hasAwait){this.raise(S.AwaitBindingIdentifier,e);return}if(this.scope.inStaticBlock){this.raise(S.AwaitBindingIdentifierInStaticBlock,e);return}this.expressionScope.recordAsyncArrowParametersError(e)}else if(r==="arguments"&&this.scope.inClassAndNotInNonArrowFunction){this.raise(S.ArgumentsInClass,e);return}}recordAwaitIfAllowed(){let r=this.prodParam.hasAwait||this.options.allowAwaitOutsideFunction&&!this.scope.inFunction;return r&&!this.scope.inFunction&&(this.state.hasTopLevelAwait=!0),r}parseAwait(r){let e=this.startNodeAt(r);return this.expressionScope.recordParameterInitializerError(S.AwaitExpressionFormalParameter,e),this.eat(55)&&this.raise(S.ObsoleteAwaitStar,e),!this.scope.inFunction&&!this.options.allowAwaitOutsideFunction&&(this.isAmbiguousAwait()?this.ambiguousScriptDifferentAst=!0:this.sawUnambiguousESM=!0),this.state.soloAwait||(e.argument=this.parseMaybeUnary(null,!0)),this.finishNode(e,"AwaitExpression")}isAmbiguousAwait(){if(this.hasPrecedingLineBreak())return!0;let{type:r}=this.state;return r===53||r===10||r===0||Ou(r)||r===102&&!this.state.containsEsc||r===137||r===56||this.hasPlugin("v8intrinsic")&&r===54}parseYield(){let r=this.startNode();this.expressionScope.recordParameterInitializerError(S.YieldInParameter,r),this.next();let e=!1,i=null;if(!this.hasPrecedingLineBreak())switch(e=this.eat(55),this.state.type){case 13:case 139:case 8:case 11:case 3:case 9:case 14:case 12:if(!e)break;default:i=this.parseMaybeAssign()}return r.delegate=e,r.argument=i,this.finishNode(r,"YieldExpression")}parseImportCall(r){return this.next(),r.source=this.parseMaybeAssignAllowIn(),(this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions"))&&(r.options=null),this.eat(12)&&(this.hasPlugin("moduleAttributes")||this.hasPlugin("importAssertions")||this.expectPlugin("importAttributes"),this.match(11)||(r.options=this.parseMaybeAssignAllowIn(),this.eat(12))),this.expect(11),this.finishNode(r,"ImportExpression")}checkPipelineAtInfixOperator(r,e){this.hasPlugin(["pipelineOperator",{proposal:"smart"}])&&r.type==="SequenceExpression"&&this.raise(S.PipelineHeadSequenceExpression,e)}parseSmartPipelineBodyInStyle(r,e){if(this.isSimpleReference(r)){let i=this.startNodeAt(e);return i.callee=r,this.finishNode(i,"PipelineBareFunction")}else{let i=this.startNodeAt(e);return this.checkSmartPipeTopicBodyEarlyErrors(e),i.expression=r,this.finishNode(i,"PipelineTopicExpression")}}isSimpleReference(r){switch(r.type){case"MemberExpression":return!r.computed&&this.isSimpleReference(r.object);case"Identifier":return!0;default:return!1}}checkSmartPipeTopicBodyEarlyErrors(r){if(this.match(19))throw this.raise(S.PipelineBodyNoArrow,this.state.startLoc);this.topicReferenceWasUsedInCurrentContext()||this.raise(S.PipelineTopicUnused,r)}withTopicBindingContext(r){let e=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:1,maxTopicIndex:null};try{return r()}finally{this.state.topicContext=e}}withSmartMixTopicForbiddingContext(r){if(this.hasPlugin(["pipelineOperator",{proposal:"smart"}])){let e=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:0,maxTopicIndex:null};try{return r()}finally{this.state.topicContext=e}}else return r()}withSoloAwaitPermittingContext(r){let e=this.state.soloAwait;this.state.soloAwait=!0;try{return r()}finally{this.state.soloAwait=e}}allowInAnd(r){let e=this.prodParam.currentFlags();if(8&~e){this.prodParam.enter(e|8);try{return r()}finally{this.prodParam.exit()}}return r()}disallowInAnd(r){let e=this.prodParam.currentFlags();if(8&e){this.prodParam.enter(e&-9);try{return r()}finally{this.prodParam.exit()}}return r()}registerTopicReference(){this.state.topicContext.maxTopicIndex=0}topicReferenceIsAllowedInCurrentContext(){return this.state.topicContext.maxNumOfResolvableTopics>=1}topicReferenceWasUsedInCurrentContext(){return this.state.topicContext.maxTopicIndex!=null&&this.state.topicContext.maxTopicIndex>=0}parseFSharpPipelineBody(r){let e=this.state.startLoc;this.state.potentialArrowAt=this.state.start;let i=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!0;let n=this.parseExprOp(this.parseMaybeUnaryOrPrivate(),e,r);return this.state.inFSharpPipelineDirectBody=i,n}parseModuleExpression(){this.expectPlugin("moduleBlocks");let r=this.startNode();this.next(),this.match(5)||this.unexpected(null,5);let e=this.startNodeAt(this.state.endLoc);this.next();let i=this.initializeScopes(!0);this.enterInitialScopes();try{r.body=this.parseProgram(e,8,"module")}finally{i()}return this.finishNode(r,"ModuleExpression")}parsePropertyNamePrefixOperator(r){}},jf={kind:1},SB={kind:2},vB=/[\uD800-\uDFFF]/u,qf=/in(?:stanceof)?/y;function wB(t,r){for(let e=0;e<t.length;e++){let i=t[e],{type:n}=i;if(typeof n=="number"){{if(n===138){let{loc:s,start:o,value:a,end:l}=i,u=o+1,c=jt(s.start,1);t.splice(e,1,new di({type:qi(27),value:"#",start:o,end:u,startLoc:s.start,endLoc:c}),new di({type:qi(132),value:a,start:u,end:l,startLoc:c,endLoc:s.end})),e++;continue}if(Ou(n)){let{loc:s,start:o,value:a,end:l}=i,u=o+1,c=jt(s.start,1),p;r.charCodeAt(o)===96?p=new di({type:qi(22),value:"`",start:o,end:u,startLoc:s.start,endLoc:c}):p=new di({type:qi(8),value:"}",start:o,end:u,startLoc:s.start,endLoc:c});let d,h,f,g;n===24?(h=l-1,f=jt(s.end,-1),d=a===null?null:a.slice(1,-1),g=new di({type:qi(22),value:"`",start:h,end:l,startLoc:f,endLoc:s.end})):(h=l-2,f=jt(s.end,-2),d=a===null?null:a.slice(1,-2),g=new di({type:qi(23),value:"${",start:h,end:l,startLoc:f,endLoc:s.end})),t.splice(e,1,p,new di({type:qi(20),value:d,start:u,end:h,startLoc:c,endLoc:f}),g),e+=2;continue}}i.type=qi(n)}}return t}var lh=class extends ah{parseTopLevel(r,e){return r.program=this.parseProgram(e),r.comments=this.comments,this.options.tokens&&(r.tokens=wB(this.tokens,this.input)),this.finishNode(r,"File")}parseProgram(r,e=139,i=this.options.sourceType){if(r.sourceType=i,r.interpreter=this.parseInterpreterDirective(),this.parseBlockBody(r,!0,!0,e),this.inModule){if(!this.options.allowUndeclaredExports&&this.scope.undefinedExports.size>0)for(let[s,o]of Array.from(this.scope.undefinedExports))this.raise(S.ModuleExportUndefined,o,{localName:s});this.addExtra(r,"topLevelAwait",this.state.hasTopLevelAwait)}let n;return e===139?n=this.finishNode(r,"Program"):n=this.finishNodeAt(r,"Program",jt(this.state.startLoc,-1)),n}stmtToDirective(r){let e=r;e.type="Directive",e.value=e.expression,delete e.expression;let i=e.value,n=i.value,s=this.input.slice(i.start,i.end),o=i.value=s.slice(1,-1);return this.addExtra(i,"raw",s),this.addExtra(i,"rawValue",o),this.addExtra(i,"expressionValue",n),i.type="DirectiveLiteral",e}parseInterpreterDirective(){if(!this.match(28))return null;let r=this.startNode();return r.value=this.state.value,this.next(),this.finishNode(r,"InterpreterDirective")}isLet(){return this.isContextual(100)?this.hasFollowingBindingAtom():!1}chStartsBindingIdentifier(r,e){if(Vi(r)){if(qf.lastIndex=e,qf.test(this.input)){let i=this.codePointAtPos(qf.lastIndex);if(!Ls(i)&&i!==92)return!1}return!0}else return r===92}chStartsBindingPattern(r){return r===91||r===123}hasFollowingBindingAtom(){let r=this.nextTokenStart(),e=this.codePointAtPos(r);return this.chStartsBindingPattern(e)||this.chStartsBindingIdentifier(e,r)}hasInLineFollowingBindingIdentifierOrBrace(){let r=this.nextTokenInLineStart(),e=this.codePointAtPos(r);return e===123||this.chStartsBindingIdentifier(e,r)}startsUsingForOf(){let{type:r,containsEsc:e}=this.lookahead();if(r===102&&!e)return!1;if(we(r)&&!this.hasFollowingLineBreak())return this.expectPlugin("explicitResourceManagement"),!0}startsAwaitUsing(){let r=this.nextTokenInLineStart();if(this.isUnparsedContextual(r,"using")){r=this.nextTokenInLineStartSince(r+5);let e=this.codePointAtPos(r);if(this.chStartsBindingIdentifier(e,r))return this.expectPlugin("explicitResourceManagement"),!0}return!1}parseModuleItem(){return this.parseStatementLike(15)}parseStatementListItem(){return this.parseStatementLike(6|(!this.options.annexB||this.state.strict?0:8))}parseStatementOrSloppyAnnexBFunctionDeclaration(r=!1){let e=0;return this.options.annexB&&!this.state.strict&&(e|=4,r&&(e|=8)),this.parseStatementLike(e)}parseStatement(){return this.parseStatementLike(0)}parseStatementLike(r){let e=null;return this.match(26)&&(e=this.parseDecorators(!0)),this.parseStatementContent(r,e)}parseStatementContent(r,e){let i=this.state.type,n=this.startNode(),s=!!(r&2),o=!!(r&4),a=r&1;switch(i){case 60:return this.parseBreakContinueStatement(n,!0);case 63:return this.parseBreakContinueStatement(n,!1);case 64:return this.parseDebuggerStatement(n);case 90:return this.parseDoWhileStatement(n);case 91:return this.parseForStatement(n);case 68:if(this.lookaheadCharCode()===46)break;return o||this.raise(this.state.strict?S.StrictFunction:this.options.annexB?S.SloppyFunctionAnnexB:S.SloppyFunction,this.state.startLoc),this.parseFunctionStatement(n,!1,!s&&o);case 80:return s||this.unexpected(),this.parseClass(this.maybeTakeDecorators(e,n),!0);case 69:return this.parseIfStatement(n);case 70:return this.parseReturnStatement(n);case 71:return this.parseSwitchStatement(n);case 72:return this.parseThrowStatement(n);case 73:return this.parseTryStatement(n);case 96:if(!this.state.containsEsc&&this.startsAwaitUsing())return this.recordAwaitIfAllowed()?s||this.raise(S.UnexpectedLexicalDeclaration,n):this.raise(S.AwaitUsingNotInAsyncContext,n),this.next(),this.parseVarStatement(n,"await using");break;case 107:if(this.state.containsEsc||!this.hasInLineFollowingBindingIdentifierOrBrace())break;return this.expectPlugin("explicitResourceManagement"),!this.scope.inModule&&this.scope.inTopLevel?this.raise(S.UnexpectedUsingDeclaration,this.state.startLoc):s||this.raise(S.UnexpectedLexicalDeclaration,this.state.startLoc),this.parseVarStatement(n,"using");case 100:{if(this.state.containsEsc)break;let c=this.nextTokenStart(),p=this.codePointAtPos(c);if(p!==91&&(!s&&this.hasFollowingLineBreak()||!this.chStartsBindingIdentifier(p,c)&&p!==123))break}case 75:s||this.raise(S.UnexpectedLexicalDeclaration,this.state.startLoc);case 74:{let c=this.state.value;return this.parseVarStatement(n,c)}case 92:return this.parseWhileStatement(n);case 76:return this.parseWithStatement(n);case 5:return this.parseBlock();case 13:return this.parseEmptyStatement(n);case 83:{let c=this.lookaheadCharCode();if(c===40||c===46)break}case 82:{!this.options.allowImportExportEverywhere&&!a&&this.raise(S.UnexpectedImportExport,this.state.startLoc),this.next();let c;return i===83?(c=this.parseImport(n),c.type==="ImportDeclaration"&&(!c.importKind||c.importKind==="value")&&(this.sawUnambiguousESM=!0)):(c=this.parseExport(n,e),(c.type==="ExportNamedDeclaration"&&(!c.exportKind||c.exportKind==="value")||c.type==="ExportAllDeclaration"&&(!c.exportKind||c.exportKind==="value")||c.type==="ExportDefaultDeclaration")&&(this.sawUnambiguousESM=!0)),this.assertModuleNodeAllowed(c),c}default:if(this.isAsyncFunction())return s||this.raise(S.AsyncFunctionInSingleStatementContext,this.state.startLoc),this.next(),this.parseFunctionStatement(n,!0,!s&&o)}let l=this.state.value,u=this.parseExpression();return we(i)&&u.type==="Identifier"&&this.eat(14)?this.parseLabeledStatement(n,l,u,r):this.parseExpressionStatement(n,u,e)}assertModuleNodeAllowed(r){!this.options.allowImportExportEverywhere&&!this.inModule&&this.raise(S.ImportOutsideModule,r)}decoratorsEnabledBeforeExport(){return this.hasPlugin("decorators-legacy")?!0:this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")!==!1}maybeTakeDecorators(r,e,i){return r&&(e.decorators&&e.decorators.length>0?(typeof this.getPluginOption("decorators","decoratorsBeforeExport")!="boolean"&&this.raise(S.DecoratorsBeforeAfterExport,e.decorators[0]),e.decorators.unshift(...r)):e.decorators=r,this.resetStartLocationFromNode(e,r[0]),i&&this.resetStartLocationFromNode(i,e)),e}canHaveLeadingDecorator(){return this.match(80)}parseDecorators(r){let e=[];do e.push(this.parseDecorator());while(this.match(26));if(this.match(82))r||this.unexpected(),this.decoratorsEnabledBeforeExport()||this.raise(S.DecoratorExportClass,this.state.startLoc);else if(!this.canHaveLeadingDecorator())throw this.raise(S.UnexpectedLeadingDecorator,this.state.startLoc);return e}parseDecorator(){this.expectOnePlugin(["decorators","decorators-legacy"]);let r=this.startNode();if(this.next(),this.hasPlugin("decorators")){let e=this.state.startLoc,i;if(this.match(10)){let n=this.state.startLoc;this.next(),i=this.parseExpression(),this.expect(11),i=this.wrapParenthesis(n,i);let s=this.state.startLoc;r.expression=this.parseMaybeDecoratorArguments(i),this.getPluginOption("decorators","allowCallParenthesized")===!1&&r.expression!==i&&this.raise(S.DecoratorArgumentsOutsideParentheses,s)}else{for(i=this.parseIdentifier(!1);this.eat(16);){let n=this.startNodeAt(e);n.object=i,this.match(138)?(this.classScope.usePrivateName(this.state.value,this.state.startLoc),n.property=this.parsePrivateName()):n.property=this.parseIdentifier(!0),n.computed=!1,i=this.finishNode(n,"MemberExpression")}r.expression=this.parseMaybeDecoratorArguments(i)}}else r.expression=this.parseExprSubscripts();return this.finishNode(r,"Decorator")}parseMaybeDecoratorArguments(r){if(this.eat(10)){let e=this.startNodeAtNode(r);return e.callee=r,e.arguments=this.parseCallExpressionArguments(11,!1),this.toReferencedList(e.arguments),this.finishNode(e,"CallExpression")}return r}parseBreakContinueStatement(r,e){return this.next(),this.isLineTerminator()?r.label=null:(r.label=this.parseIdentifier(),this.semicolon()),this.verifyBreakContinue(r,e),this.finishNode(r,e?"BreakStatement":"ContinueStatement")}verifyBreakContinue(r,e){let i;for(i=0;i<this.state.labels.length;++i){let n=this.state.labels[i];if((r.label==null||n.name===r.label.name)&&(n.kind!=null&&(e||n.kind===1)||r.label&&e))break}if(i===this.state.labels.length){let n=e?"BreakStatement":"ContinueStatement";this.raise(S.IllegalBreakContinue,r,{type:n})}}parseDebuggerStatement(r){return this.next(),this.semicolon(),this.finishNode(r,"DebuggerStatement")}parseHeaderExpression(){this.expect(10);let r=this.parseExpression();return this.expect(11),r}parseDoWhileStatement(r){return this.next(),this.state.labels.push(jf),r.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.expect(92),r.test=this.parseHeaderExpression(),this.eat(13),this.finishNode(r,"DoWhileStatement")}parseForStatement(r){this.next(),this.state.labels.push(jf);let e=null;if(this.isContextual(96)&&this.recordAwaitIfAllowed()&&(e=this.state.startLoc,this.next()),this.scope.enter(0),this.expect(10),this.match(13))return e!==null&&this.unexpected(e),this.parseFor(r,null);let i=this.isContextual(100);{let l=this.isContextual(96)&&this.startsAwaitUsing(),u=l||this.isContextual(107)&&this.startsUsingForOf(),c=i&&this.hasFollowingBindingAtom()||u;if(this.match(74)||this.match(75)||c){let p=this.startNode(),d;l?(d="await using",this.recordAwaitIfAllowed()||this.raise(S.AwaitUsingNotInAsyncContext,this.state.startLoc),this.next()):d=this.state.value,this.next(),this.parseVar(p,!0,d);let h=this.finishNode(p,"VariableDeclaration"),f=this.match(58);return f&&u&&this.raise(S.ForInUsing,h),(f||this.isContextual(102))&&h.declarations.length===1?this.parseForIn(r,h,e):(e!==null&&this.unexpected(e),this.parseFor(r,h))}}let n=this.isContextual(95),s=new Bs,o=this.parseExpression(!0,s),a=this.isContextual(102);if(a&&(i&&this.raise(S.ForOfLet,o),e===null&&n&&o.type==="Identifier"&&this.raise(S.ForOfAsync,o)),a||this.match(58)){this.checkDestructuringPrivate(s),this.toAssignable(o,!0);let l=a?"ForOfStatement":"ForInStatement";return this.checkLVal(o,{type:l}),this.parseForIn(r,o,e)}else this.checkExpressionErrors(s,!0);return e!==null&&this.unexpected(e),this.parseFor(r,o)}parseFunctionStatement(r,e,i){return this.next(),this.parseFunction(r,1|(i?2:0)|(e?8:0))}parseIfStatement(r){return this.next(),r.test=this.parseHeaderExpression(),r.consequent=this.parseStatementOrSloppyAnnexBFunctionDeclaration(),r.alternate=this.eat(66)?this.parseStatementOrSloppyAnnexBFunctionDeclaration():null,this.finishNode(r,"IfStatement")}parseReturnStatement(r){return!this.prodParam.hasReturn&&!this.options.allowReturnOutsideFunction&&this.raise(S.IllegalReturn,this.state.startLoc),this.next(),this.isLineTerminator()?r.argument=null:(r.argument=this.parseExpression(),this.semicolon()),this.finishNode(r,"ReturnStatement")}parseSwitchStatement(r){this.next(),r.discriminant=this.parseHeaderExpression();let e=r.cases=[];this.expect(5),this.state.labels.push(SB),this.scope.enter(0);let i;for(let n;!this.match(8);)if(this.match(61)||this.match(65)){let s=this.match(61);i&&this.finishNode(i,"SwitchCase"),e.push(i=this.startNode()),i.consequent=[],this.next(),s?i.test=this.parseExpression():(n&&this.raise(S.MultipleDefaultsInSwitch,this.state.lastTokStartLoc),n=!0,i.test=null),this.expect(14)}else i?i.consequent.push(this.parseStatementListItem()):this.unexpected();return this.scope.exit(),i&&this.finishNode(i,"SwitchCase"),this.next(),this.state.labels.pop(),this.finishNode(r,"SwitchStatement")}parseThrowStatement(r){return this.next(),this.hasPrecedingLineBreak()&&this.raise(S.NewlineAfterThrow,this.state.lastTokEndLoc),r.argument=this.parseExpression(),this.semicolon(),this.finishNode(r,"ThrowStatement")}parseCatchClauseParam(){let r=this.parseBindingAtom();return this.scope.enter(this.options.annexB&&r.type==="Identifier"?8:0),this.checkLVal(r,{type:"CatchClause"},9),r}parseTryStatement(r){if(this.next(),r.block=this.parseBlock(),r.handler=null,this.match(62)){let e=this.startNode();this.next(),this.match(10)?(this.expect(10),e.param=this.parseCatchClauseParam(),this.expect(11)):(e.param=null,this.scope.enter(0)),e.body=this.withSmartMixTopicForbiddingContext(()=>this.parseBlock(!1,!1)),this.scope.exit(),r.handler=this.finishNode(e,"CatchClause")}return r.finalizer=this.eat(67)?this.parseBlock():null,!r.handler&&!r.finalizer&&this.raise(S.NoCatchOrFinally,r),this.finishNode(r,"TryStatement")}parseVarStatement(r,e,i=!1){return this.next(),this.parseVar(r,!1,e,i),this.semicolon(),this.finishNode(r,"VariableDeclaration")}parseWhileStatement(r){return this.next(),r.test=this.parseHeaderExpression(),this.state.labels.push(jf),r.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.finishNode(r,"WhileStatement")}parseWithStatement(r){return this.state.strict&&this.raise(S.StrictWith,this.state.startLoc),this.next(),r.object=this.parseHeaderExpression(),r.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.finishNode(r,"WithStatement")}parseEmptyStatement(r){return this.next(),this.finishNode(r,"EmptyStatement")}parseLabeledStatement(r,e,i,n){for(let o of this.state.labels)o.name===e&&this.raise(S.LabelRedeclaration,i,{labelName:e});let s=PM(this.state.type)?1:this.match(71)?2:null;for(let o=this.state.labels.length-1;o>=0;o--){let a=this.state.labels[o];if(a.statementStart===r.start)a.statementStart=this.state.start,a.kind=s;else break}return this.state.labels.push({name:e,kind:s,statementStart:this.state.start}),r.body=n&8?this.parseStatementOrSloppyAnnexBFunctionDeclaration(!0):this.parseStatement(),this.state.labels.pop(),r.label=i,this.finishNode(r,"LabeledStatement")}parseExpressionStatement(r,e,i){return r.expression=e,this.semicolon(),this.finishNode(r,"ExpressionStatement")}parseBlock(r=!1,e=!0,i){let n=this.startNode();return r&&this.state.strictErrors.clear(),this.expect(5),e&&this.scope.enter(0),this.parseBlockBody(n,r,!1,8,i),e&&this.scope.exit(),this.finishNode(n,"BlockStatement")}isValidDirective(r){return r.type==="ExpressionStatement"&&r.expression.type==="StringLiteral"&&!r.expression.extra.parenthesized}parseBlockBody(r,e,i,n,s){let o=r.body=[],a=r.directives=[];this.parseBlockOrModuleBlockBody(o,e?a:void 0,i,n,s)}parseBlockOrModuleBlockBody(r,e,i,n,s){let o=this.state.strict,a=!1,l=!1;for(;!this.match(n);){let u=i?this.parseModuleItem():this.parseStatementListItem();if(e&&!l){if(this.isValidDirective(u)){let c=this.stmtToDirective(u);e.push(c),!a&&c.value.value==="use strict"&&(a=!0,this.setStrict(!0));continue}l=!0,this.state.strictErrors.clear()}r.push(u)}s?.call(this,a),o||this.setStrict(!1),this.next()}parseFor(r,e){return r.init=e,this.semicolon(!1),r.test=this.match(13)?null:this.parseExpression(),this.semicolon(!1),r.update=this.match(11)?null:this.parseExpression(),this.expect(11),r.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(r,"ForStatement")}parseForIn(r,e,i){let n=this.match(58);return this.next(),n?i!==null&&this.unexpected(i):r.await=i!==null,e.type==="VariableDeclaration"&&e.declarations[0].init!=null&&(!n||!this.options.annexB||this.state.strict||e.kind!=="var"||e.declarations[0].id.type!=="Identifier")&&this.raise(S.ForInOfLoopInitializer,e,{type:n?"ForInStatement":"ForOfStatement"}),e.type==="AssignmentPattern"&&this.raise(S.InvalidLhs,e,{ancestor:{type:"ForStatement"}}),r.left=e,r.right=n?this.parseExpression():this.parseMaybeAssignAllowIn(),this.expect(11),r.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(r,n?"ForInStatement":"ForOfStatement")}parseVar(r,e,i,n=!1){let s=r.declarations=[];for(r.kind=i;;){let o=this.startNode();if(this.parseVarId(o,i),o.init=this.eat(29)?e?this.parseMaybeAssignDisallowIn():this.parseMaybeAssignAllowIn():null,o.init===null&&!n&&(o.id.type!=="Identifier"&&!(e&&(this.match(58)||this.isContextual(102)))?this.raise(S.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:"destructuring"}):(i==="const"||i==="using"||i==="await using")&&!(this.match(58)||this.isContextual(102))&&this.raise(S.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:i})),s.push(this.finishNode(o,"VariableDeclarator")),!this.eat(12))break}return r}parseVarId(r,e){let i=this.parseBindingAtom();(e==="using"||e==="await using")&&(i.type==="ArrayPattern"||i.type==="ObjectPattern")&&this.raise(S.UsingDeclarationHasBindingPattern,i.loc.start),this.checkLVal(i,{type:"VariableDeclarator"},e==="var"?5:8201),r.id=i}parseAsyncFunctionExpression(r){return this.parseFunction(r,8)}parseFunction(r,e=0){let i=e&2,n=!!(e&1),s=n&&!(e&4),o=!!(e&8);this.initFunction(r,o),this.match(55)&&(i&&this.raise(S.GeneratorInSingleStatementContext,this.state.startLoc),this.next(),r.generator=!0),n&&(r.id=this.parseFunctionId(s));let a=this.state.maybeInArrowParameters;return this.state.maybeInArrowParameters=!1,this.scope.enter(2),this.prodParam.enter(Fu(o,r.generator)),n||(r.id=this.parseFunctionId()),this.parseFunctionParams(r,!1),this.withSmartMixTopicForbiddingContext(()=>{this.parseFunctionBodyAndFinish(r,n?"FunctionDeclaration":"FunctionExpression")}),this.prodParam.exit(),this.scope.exit(),n&&!i&&this.registerFunctionStatementId(r),this.state.maybeInArrowParameters=a,r}parseFunctionId(r){return r||we(this.state.type)?this.parseIdentifier():null}parseFunctionParams(r,e){this.expect(10),this.expressionScope.enter(QM()),r.params=this.parseBindingList(11,41,2|(e?4:0)),this.expressionScope.exit()}registerFunctionStatementId(r){r.id&&this.scope.declareName(r.id.name,!this.options.annexB||this.state.strict||r.generator||r.async?this.scope.treatFunctionsAsVar?5:8201:17,r.id.loc.start)}parseClass(r,e,i){this.next();let n=this.state.strict;return this.state.strict=!0,this.parseClassId(r,e,i),this.parseClassSuper(r),r.body=this.parseClassBody(!!r.superClass,n),this.finishNode(r,e?"ClassDeclaration":"ClassExpression")}isClassProperty(){return this.match(29)||this.match(13)||this.match(8)}isClassMethod(){return this.match(10)}nameIsConstructor(r){return r.type==="Identifier"&&r.name==="constructor"||r.type==="StringLiteral"&&r.value==="constructor"}isNonstaticConstructor(r){return!r.computed&&!r.static&&this.nameIsConstructor(r.key)}parseClassBody(r,e){this.classScope.enter();let i={hadConstructor:!1,hadSuperClass:r},n=[],s=this.startNode();if(s.body=[],this.expect(5),this.withSmartMixTopicForbiddingContext(()=>{for(;!this.match(8);){if(this.eat(13)){if(n.length>0)throw this.raise(S.DecoratorSemicolon,this.state.lastTokEndLoc);continue}if(this.match(26)){n.push(this.parseDecorator());continue}let o=this.startNode();n.length&&(o.decorators=n,this.resetStartLocationFromNode(o,n[0]),n=[]),this.parseClassMember(s,o,i),o.kind==="constructor"&&o.decorators&&o.decorators.length>0&&this.raise(S.DecoratorConstructor,o)}}),this.state.strict=e,this.next(),n.length)throw this.raise(S.TrailingDecorator,this.state.startLoc);return this.classScope.exit(),this.finishNode(s,"ClassBody")}parseClassMemberFromModifier(r,e){let i=this.parseIdentifier(!0);if(this.isClassMethod()){let n=e;return n.kind="method",n.computed=!1,n.key=i,n.static=!1,this.pushClassMethod(r,n,!1,!1,!1,!1),!0}else if(this.isClassProperty()){let n=e;return n.computed=!1,n.key=i,n.static=!1,r.body.push(this.parseClassProperty(n)),!0}return this.resetPreviousNodeTrailingComments(i),!1}parseClassMember(r,e,i){let n=this.isContextual(106);if(n){if(this.parseClassMemberFromModifier(r,e))return;if(this.eat(5)){this.parseClassStaticBlock(r,e);return}}this.parseClassMemberWithIsStatic(r,e,i,n)}parseClassMemberWithIsStatic(r,e,i,n){let s=e,o=e,a=e,l=e,u=e,c=s,p=s;if(e.static=n,this.parsePropertyNamePrefixOperator(e),this.eat(55)){c.kind="method";let y=this.match(138);if(this.parseClassElementName(c),y){this.pushClassPrivateMethod(r,o,!0,!1);return}this.isNonstaticConstructor(s)&&this.raise(S.ConstructorIsGenerator,s.key),this.pushClassMethod(r,s,!0,!1,!1,!1);return}let d=!this.state.containsEsc&&we(this.state.type),h=this.parseClassElementName(e),f=d?h.name:null,g=this.isPrivateName(h),m=this.state.startLoc;if(this.parsePostMemberNameModifiers(p),this.isClassMethod()){if(c.kind="method",g){this.pushClassPrivateMethod(r,o,!1,!1);return}let y=this.isNonstaticConstructor(s),b=!1;y&&(s.kind="constructor",i.hadConstructor&&!this.hasPlugin("typescript")&&this.raise(S.DuplicateConstructor,h),y&&this.hasPlugin("typescript")&&e.override&&this.raise(S.OverrideOnConstructor,h),i.hadConstructor=!0,b=i.hadSuperClass),this.pushClassMethod(r,s,!1,!1,y,b)}else if(this.isClassProperty())g?this.pushClassPrivateProperty(r,l):this.pushClassProperty(r,a);else if(f==="async"&&!this.isLineTerminator()){this.resetPreviousNodeTrailingComments(h);let y=this.eat(55);p.optional&&this.unexpected(m),c.kind="method";let b=this.match(138);this.parseClassElementName(c),this.parsePostMemberNameModifiers(p),b?this.pushClassPrivateMethod(r,o,y,!0):(this.isNonstaticConstructor(s)&&this.raise(S.ConstructorIsAsync,s.key),this.pushClassMethod(r,s,y,!0,!1,!1))}else if((f==="get"||f==="set")&&!(this.match(55)&&this.isLineTerminator())){this.resetPreviousNodeTrailingComments(h),c.kind=f;let y=this.match(138);this.parseClassElementName(s),y?this.pushClassPrivateMethod(r,o,!1,!1):(this.isNonstaticConstructor(s)&&this.raise(S.ConstructorIsAccessor,s.key),this.pushClassMethod(r,s,!1,!1,!1,!1)),this.checkGetterSetterParams(s)}else if(f==="accessor"&&!this.isLineTerminator()){this.expectPlugin("decoratorAutoAccessors"),this.resetPreviousNodeTrailingComments(h);let y=this.match(138);this.parseClassElementName(a),this.pushClassAccessorProperty(r,u,y)}else this.isLineTerminator()?g?this.pushClassPrivateProperty(r,l):this.pushClassProperty(r,a):this.unexpected()}parseClassElementName(r){let{type:e,value:i}=this.state;if((e===132||e===133)&&r.static&&i==="prototype"&&this.raise(S.StaticPrototype,this.state.startLoc),e===138){i==="constructor"&&this.raise(S.ConstructorClassPrivateField,this.state.startLoc);let n=this.parsePrivateName();return r.key=n,n}return this.parsePropertyName(r),r.key}parseClassStaticBlock(r,e){var i;this.scope.enter(208);let n=this.state.labels;this.state.labels=[],this.prodParam.enter(0);let s=e.body=[];this.parseBlockOrModuleBlockBody(s,void 0,!1,8),this.prodParam.exit(),this.scope.exit(),this.state.labels=n,r.body.push(this.finishNode(e,"StaticBlock")),(i=e.decorators)!=null&&i.length&&this.raise(S.DecoratorStaticBlock,e)}pushClassProperty(r,e){!e.computed&&this.nameIsConstructor(e.key)&&this.raise(S.ConstructorClassField,e.key),r.body.push(this.parseClassProperty(e))}pushClassPrivateProperty(r,e){let i=this.parseClassPrivateProperty(e);r.body.push(i),this.classScope.declarePrivateName(this.getPrivateNameSV(i.key),0,i.key.loc.start)}pushClassAccessorProperty(r,e,i){!i&&!e.computed&&this.nameIsConstructor(e.key)&&this.raise(S.ConstructorClassField,e.key);let n=this.parseClassAccessorProperty(e);r.body.push(n),i&&this.classScope.declarePrivateName(this.getPrivateNameSV(n.key),0,n.key.loc.start)}pushClassMethod(r,e,i,n,s,o){r.body.push(this.parseMethod(e,i,n,s,o,"ClassMethod",!0))}pushClassPrivateMethod(r,e,i,n){let s=this.parseMethod(e,i,n,!1,!1,"ClassPrivateMethod",!0);r.body.push(s);let o=s.kind==="get"?s.static?6:2:s.kind==="set"?s.static?5:1:0;this.declareClassPrivateMethodInScope(s,o)}declareClassPrivateMethodInScope(r,e){this.classScope.declarePrivateName(this.getPrivateNameSV(r.key),e,r.key.loc.start)}parsePostMemberNameModifiers(r){}parseClassPrivateProperty(r){return this.parseInitializer(r),this.semicolon(),this.finishNode(r,"ClassPrivateProperty")}parseClassProperty(r){return this.parseInitializer(r),this.semicolon(),this.finishNode(r,"ClassProperty")}parseClassAccessorProperty(r){return this.parseInitializer(r),this.semicolon(),this.finishNode(r,"ClassAccessorProperty")}parseInitializer(r){this.scope.enter(80),this.expressionScope.enter(Kv()),this.prodParam.enter(0),r.value=this.eat(29)?this.parseMaybeAssignAllowIn():null,this.expressionScope.exit(),this.prodParam.exit(),this.scope.exit()}parseClassId(r,e,i,n=8331){if(we(this.state.type))r.id=this.parseIdentifier(),e&&this.declareNameFromIdentifier(r.id,n);else if(i||!e)r.id=null;else throw this.raise(S.MissingClassName,this.state.startLoc)}parseClassSuper(r){r.superClass=this.eat(81)?this.parseExprSubscripts():null}parseExport(r,e){let i=this.parseMaybeImportPhase(r,!0),n=this.maybeParseExportDefaultSpecifier(r,i),s=!n||this.eat(12),o=s&&this.eatExportStar(r),a=o&&this.maybeParseExportNamespaceSpecifier(r),l=s&&(!a||this.eat(12)),u=n||o;if(o&&!a){if(n&&this.unexpected(),e)throw this.raise(S.UnsupportedDecoratorExport,r);return this.parseExportFrom(r,!0),this.finishNode(r,"ExportAllDeclaration")}let c=this.maybeParseExportNamedSpecifiers(r);n&&s&&!o&&!c&&this.unexpected(null,5),a&&l&&this.unexpected(null,98);let p;if(u||c){if(p=!1,e)throw this.raise(S.UnsupportedDecoratorExport,r);this.parseExportFrom(r,u)}else p=this.maybeParseExportDeclaration(r);if(u||c||p){var d;let h=r;if(this.checkExport(h,!0,!1,!!h.source),((d=h.declaration)==null?void 0:d.type)==="ClassDeclaration")this.maybeTakeDecorators(e,h.declaration,h);else if(e)throw this.raise(S.UnsupportedDecoratorExport,r);return this.finishNode(h,"ExportNamedDeclaration")}if(this.eat(65)){let h=r,f=this.parseExportDefaultExpression();if(h.declaration=f,f.type==="ClassDeclaration")this.maybeTakeDecorators(e,f,h);else if(e)throw this.raise(S.UnsupportedDecoratorExport,r);return this.checkExport(h,!0,!0),this.finishNode(h,"ExportDefaultDeclaration")}this.unexpected(null,5)}eatExportStar(r){return this.eat(55)}maybeParseExportDefaultSpecifier(r,e){if(e||this.isExportDefaultSpecifier()){this.expectPlugin("exportDefaultFrom",e?.loc.start);let i=e||this.parseIdentifier(!0),n=this.startNodeAtNode(i);return n.exported=i,r.specifiers=[this.finishNode(n,"ExportDefaultSpecifier")],!0}return!1}maybeParseExportNamespaceSpecifier(r){if(this.isContextual(93)){var e,i;(i=(e=r).specifiers)!=null||(e.specifiers=[]);let n=this.startNodeAt(this.state.lastTokStartLoc);return this.next(),n.exported=this.parseModuleExportName(),r.specifiers.push(this.finishNode(n,"ExportNamespaceSpecifier")),!0}return!1}maybeParseExportNamedSpecifiers(r){if(this.match(5)){let e=r;e.specifiers||(e.specifiers=[]);let i=e.exportKind==="type";return e.specifiers.push(...this.parseExportSpecifiers(i)),e.source=null,e.declaration=null,this.hasPlugin("importAssertions")&&(e.assertions=[]),!0}return!1}maybeParseExportDeclaration(r){return this.shouldParseExportDeclaration()?(r.specifiers=[],r.source=null,this.hasPlugin("importAssertions")&&(r.assertions=[]),r.declaration=this.parseExportDeclaration(r),!0):!1}isAsyncFunction(){if(!this.isContextual(95))return!1;let r=this.nextTokenInLineStart();return this.isUnparsedContextual(r,"function")}parseExportDefaultExpression(){let r=this.startNode();if(this.match(68))return this.next(),this.parseFunction(r,5);if(this.isAsyncFunction())return this.next(),this.next(),this.parseFunction(r,13);if(this.match(80))return this.parseClass(r,!0,!0);if(this.match(26))return this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")===!0&&this.raise(S.DecoratorBeforeExport,this.state.startLoc),this.parseClass(this.maybeTakeDecorators(this.parseDecorators(!1),this.startNode()),!0,!0);if(this.match(75)||this.match(74)||this.isLet())throw this.raise(S.UnsupportedDefaultExport,this.state.startLoc);let e=this.parseMaybeAssignAllowIn();return this.semicolon(),e}parseExportDeclaration(r){return this.match(80)?this.parseClass(this.startNode(),!0,!1):this.parseStatementListItem()}isExportDefaultSpecifier(){let{type:r}=this.state;if(we(r)){if(r===95&&!this.state.containsEsc||r===100)return!1;if((r===130||r===129)&&!this.state.containsEsc){let{type:n}=this.lookahead();if(we(n)&&n!==98||n===5)return this.expectOnePlugin(["flow","typescript"]),!1}}else if(!this.match(65))return!1;let e=this.nextTokenStart(),i=this.isUnparsedContextual(e,"from");if(this.input.charCodeAt(e)===44||we(this.state.type)&&i)return!0;if(this.match(65)&&i){let n=this.input.charCodeAt(this.nextTokenStartSince(e+4));return n===34||n===39}return!1}parseExportFrom(r,e){this.eatContextual(98)?(r.source=this.parseImportSource(),this.checkExport(r),this.maybeParseImportAttributes(r),this.checkJSONModuleImport(r)):e&&this.unexpected(),this.semicolon()}shouldParseExportDeclaration(){let{type:r}=this.state;return r===26&&(this.expectOnePlugin(["decorators","decorators-legacy"]),this.hasPlugin("decorators"))?(this.getPluginOption("decorators","decoratorsBeforeExport")===!0&&this.raise(S.DecoratorBeforeExport,this.state.startLoc),!0):this.isContextual(107)?(this.raise(S.UsingDeclarationExport,this.state.startLoc),!0):this.isContextual(96)&&this.startsAwaitUsing()?(this.raise(S.UsingDeclarationExport,this.state.startLoc),!0):r===74||r===75||r===68||r===80||this.isLet()||this.isAsyncFunction()}checkExport(r,e,i,n){if(e){var s;if(i){if(this.checkDuplicateExports(r,"default"),this.hasPlugin("exportDefaultFrom")){var o;let a=r.declaration;a.type==="Identifier"&&a.name==="from"&&a.end-a.start===4&&!((o=a.extra)!=null&&o.parenthesized)&&this.raise(S.ExportDefaultFromAsIdentifier,a)}}else if((s=r.specifiers)!=null&&s.length)for(let a of r.specifiers){let{exported:l}=a,u=l.type==="Identifier"?l.name:l.value;if(this.checkDuplicateExports(a,u),!n&&a.local){let{local:c}=a;c.type!=="Identifier"?this.raise(S.ExportBindingIsString,a,{localName:c.value,exportName:u}):(this.checkReservedWord(c.name,c.loc.start,!0,!1),this.scope.checkLocalExport(c))}}else if(r.declaration){let a=r.declaration;if(a.type==="FunctionDeclaration"||a.type==="ClassDeclaration"){let{id:l}=a;if(!l)throw new Error("Assertion failure");this.checkDuplicateExports(r,l.name)}else if(a.type==="VariableDeclaration")for(let l of a.declarations)this.checkDeclaration(l.id)}}}checkDeclaration(r){if(r.type==="Identifier")this.checkDuplicateExports(r,r.name);else if(r.type==="ObjectPattern")for(let e of r.properties)this.checkDeclaration(e);else if(r.type==="ArrayPattern")for(let e of r.elements)e&&this.checkDeclaration(e);else r.type==="ObjectProperty"?this.checkDeclaration(r.value):r.type==="RestElement"?this.checkDeclaration(r.argument):r.type==="AssignmentPattern"&&this.checkDeclaration(r.left)}checkDuplicateExports(r,e){this.exportedIdentifiers.has(e)&&(e==="default"?this.raise(S.DuplicateDefaultExport,r):this.raise(S.DuplicateExport,r,{exportName:e})),this.exportedIdentifiers.add(e)}parseExportSpecifiers(r){let e=[],i=!0;for(this.expect(5);!this.eat(8);){if(i)i=!1;else if(this.expect(12),this.eat(8))break;let n=this.isContextual(130),s=this.match(133),o=this.startNode();o.local=this.parseModuleExportName(),e.push(this.parseExportSpecifier(o,s,r,n))}return e}parseExportSpecifier(r,e,i,n){return this.eatContextual(93)?r.exported=this.parseModuleExportName():e?r.exported=rB(r.local):r.exported||(r.exported=Wi(r.local)),this.finishNode(r,"ExportSpecifier")}parseModuleExportName(){if(this.match(133)){let r=this.parseStringLiteral(this.state.value),e=vB.exec(r.value);return e&&this.raise(S.ModuleExportNameHasLoneSurrogate,r,{surrogateCharCode:e[0].charCodeAt(0)}),r}return this.parseIdentifier(!0)}isJSONModuleImport(r){return r.assertions!=null?r.assertions.some(({key:e,value:i})=>i.value==="json"&&(e.type==="Identifier"?e.name==="type":e.value==="type")):!1}checkImportReflection(r){let{specifiers:e}=r,i=e.length===1?e[0].type:null;if(r.phase==="source")i!=="ImportDefaultSpecifier"&&this.raise(S.SourcePhaseImportRequiresDefault,e[0].loc.start);else if(r.phase==="defer")i!=="ImportNamespaceSpecifier"&&this.raise(S.DeferImportRequiresNamespace,e[0].loc.start);else if(r.module){var n;i!=="ImportDefaultSpecifier"&&this.raise(S.ImportReflectionNotBinding,e[0].loc.start),((n=r.assertions)==null?void 0:n.length)>0&&this.raise(S.ImportReflectionHasAssertion,e[0].loc.start)}}checkJSONModuleImport(r){if(this.isJSONModuleImport(r)&&r.type!=="ExportAllDeclaration"){let{specifiers:e}=r;if(e!=null){let i=e.find(n=>{let s;if(n.type==="ExportSpecifier"?s=n.local:n.type==="ImportSpecifier"&&(s=n.imported),s!==void 0)return s.type==="Identifier"?s.name!=="default":s.value!=="default"});i!==void 0&&this.raise(S.ImportJSONBindingNotDefault,i.loc.start)}}}isPotentialImportPhase(r){return r?!1:this.isContextual(105)||this.isContextual(97)||this.isContextual(127)}applyImportPhase(r,e,i,n){e||(i==="module"?(this.expectPlugin("importReflection",n),r.module=!0):this.hasPlugin("importReflection")&&(r.module=!1),i==="source"?(this.expectPlugin("sourcePhaseImports",n),r.phase="source"):i==="defer"?(this.expectPlugin("deferredImportEvaluation",n),r.phase="defer"):this.hasPlugin("sourcePhaseImports")&&(r.phase=null))}parseMaybeImportPhase(r,e){if(!this.isPotentialImportPhase(e))return this.applyImportPhase(r,e,null),null;let i=this.parseIdentifier(!0),{type:n}=this.state;return(Br(n)?n!==98||this.lookaheadCharCode()===102:n!==12)?(this.resetPreviousIdentifierLeadingComments(i),this.applyImportPhase(r,e,i.name,i.loc.start),null):(this.applyImportPhase(r,e,null),i)}isPrecedingIdImportPhase(r){let{type:e}=this.state;return we(e)?e!==98||this.lookaheadCharCode()===102:e!==12}parseImport(r){return this.match(133)?this.parseImportSourceAndAttributes(r):this.parseImportSpecifiersAndAfter(r,this.parseMaybeImportPhase(r,!1))}parseImportSpecifiersAndAfter(r,e){r.specifiers=[];let n=!this.maybeParseDefaultImportSpecifier(r,e)||this.eat(12),s=n&&this.maybeParseStarImportSpecifier(r);return n&&!s&&this.parseNamedImportSpecifiers(r),this.expectContextual(98),this.parseImportSourceAndAttributes(r)}parseImportSourceAndAttributes(r){var e;return(e=r.specifiers)!=null||(r.specifiers=[]),r.source=this.parseImportSource(),this.maybeParseImportAttributes(r),this.checkImportReflection(r),this.checkJSONModuleImport(r),this.semicolon(),this.finishNode(r,"ImportDeclaration")}parseImportSource(){return this.match(133)||this.unexpected(),this.parseExprAtom()}parseImportSpecifierLocal(r,e,i){e.local=this.parseIdentifier(),r.specifiers.push(this.finishImportSpecifier(e,i))}finishImportSpecifier(r,e,i=8201){return this.checkLVal(r.local,{type:e},i),this.finishNode(r,e)}parseImportAttributes(){this.expect(5);let r=[],e=new Set;do{if(this.match(8))break;let i=this.startNode(),n=this.state.value;if(e.has(n)&&this.raise(S.ModuleAttributesWithDuplicateKeys,this.state.startLoc,{key:n}),e.add(n),this.match(133)?i.key=this.parseStringLiteral(n):i.key=this.parseIdentifier(!0),this.expect(14),!this.match(133))throw this.raise(S.ModuleAttributeInvalidValue,this.state.startLoc);i.value=this.parseStringLiteral(this.state.value),r.push(this.finishNode(i,"ImportAttribute"))}while(this.eat(12));return this.expect(8),r}parseModuleAttributes(){let r=[],e=new Set;do{let i=this.startNode();if(i.key=this.parseIdentifier(!0),i.key.name!=="type"&&this.raise(S.ModuleAttributeDifferentFromType,i.key),e.has(i.key.name)&&this.raise(S.ModuleAttributesWithDuplicateKeys,i.key,{key:i.key.name}),e.add(i.key.name),this.expect(14),!this.match(133))throw this.raise(S.ModuleAttributeInvalidValue,this.state.startLoc);i.value=this.parseStringLiteral(this.state.value),r.push(this.finishNode(i,"ImportAttribute"))}while(this.eat(12));return r}maybeParseImportAttributes(r){let e;var i=!1;if(this.match(76)){if(this.hasPrecedingLineBreak()&&this.lookaheadCharCode()===40)return;this.next(),this.hasPlugin("moduleAttributes")?e=this.parseModuleAttributes():(this.hasPlugin("importAssertions")||this.expectPlugin("importAttributes"),e=this.parseImportAttributes()),i=!0}else if(this.isContextual(94)&&!this.hasPrecedingLineBreak())this.hasPlugin("importAttributes")?(this.getPluginOption("importAttributes","deprecatedAssertSyntax")!==!0&&this.raise(S.ImportAttributesUseAssert,this.state.startLoc),this.addExtra(r,"deprecatedAssertSyntax",!0)):this.expectOnePlugin(["importAttributes","importAssertions"]),this.next(),e=this.parseImportAttributes();else if(this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions"))e=[];else if(this.hasPlugin("moduleAttributes"))e=[];else return;!i&&this.hasPlugin("importAssertions")?r.assertions=e:r.attributes=e}maybeParseDefaultImportSpecifier(r,e){if(e){let i=this.startNodeAtNode(e);return i.local=e,r.specifiers.push(this.finishImportSpecifier(i,"ImportDefaultSpecifier")),!0}else if(Br(this.state.type))return this.parseImportSpecifierLocal(r,this.startNode(),"ImportDefaultSpecifier"),!0;return!1}maybeParseStarImportSpecifier(r){if(this.match(55)){let e=this.startNode();return this.next(),this.expectContextual(93),this.parseImportSpecifierLocal(r,e,"ImportNamespaceSpecifier"),!0}return!1}parseNamedImportSpecifiers(r){let e=!0;for(this.expect(5);!this.eat(8);){if(e)e=!1;else{if(this.eat(14))throw this.raise(S.DestructureNamedImport,this.state.startLoc);if(this.expect(12),this.eat(8))break}let i=this.startNode(),n=this.match(133),s=this.isContextual(130);i.imported=this.parseModuleExportName();let o=this.parseImportSpecifier(i,n,r.importKind==="type"||r.importKind==="typeof",s,void 0);r.specifiers.push(o)}}parseImportSpecifier(r,e,i,n,s){if(this.eatContextual(93))r.local=this.parseIdentifier();else{let{imported:o}=r;if(e)throw this.raise(S.ImportBindingIsString,r,{importName:o.value});this.checkReservedWord(o.name,r.loc.start,!0,!0),r.local||(r.local=Wi(o))}return this.finishImportSpecifier(r,"ImportSpecifier",s)}isThisParam(r){return r.type==="Identifier"&&r.name==="this"}},Lu=class extends lh{constructor(r,e,i){r=CB(r),super(r,e),this.options=r,this.initializeScopes(),this.plugins=i,this.filename=r.sourceFilename}getScopeHandler(){return ya}parse(){this.enterInitialScopes();let r=this.startNode(),e=this.startNode();return this.nextToken(),r.errors=null,this.parseTopLevel(r,e),r.errors=this.state.errors,r.comments.length=this.state.commentsLen,r}};function TB(t,r){var e;if(((e=r)==null?void 0:e.sourceType)==="unambiguous"){r=Object.assign({},r);try{r.sourceType="module";let i=ha(r,t),n=i.parse();if(i.sawUnambiguousESM)return n;if(i.ambiguousScriptDifferentAst)try{return r.sourceType="script",ha(r,t).parse()}catch{}else n.program.sourceType="script";return n}catch(i){try{return r.sourceType="script",ha(r,t).parse()}catch{}throw i}}else return ha(r,t).parse()}function AB(t,r){let e=ha(r,t);return e.options.strictMode&&(e.state.strict=!0),e.getExpression()}function PB(t){let r={};for(let e of Object.keys(t))r[e]=qi(t[e]);return r}var IB=PB(vM);function ha(t,r){let e=Lu,i=new Map;if(t!=null&&t.plugins){for(let n of t.plugins){let s,o;typeof n=="string"?s=n:[s,o]=n,i.has(s)||i.set(s,o||{})}xB(i),e=_B(i)}return new e(t,r,i)}var Fv=new Map;function _B(t){let r=[];for(let n of EB)t.has(n)&&r.push(n);let e=r.join("|"),i=Fv.get(e);if(!i){i=Lu;for(let n of r)i=Gv[n](i);Fv.set(e,i)}return i}Da.parse=TB;Da.parseExpression=AB;Da.tokTypes=IB});var aT=A(Qs=>{"use strict";Qs.__esModule=!0;Qs.distance=Qs.closest=void 0;var Ji=new Uint32Array(65536),h8=function(t,r){for(var e=t.length,i=r.length,n=1<<e-1,s=-1,o=0,a=e,l=e;l--;)Ji[t.charCodeAt(l)]|=1<<l;for(l=0;l<i;l++){var u=Ji[r.charCodeAt(l)],c=u|o;u|=(u&s)+s^s,o|=~(u|s),s&=u,o&n&&a++,s&n&&a--,o=o<<1|1,s=s<<1|~(c|o),o&=c}for(l=e;l--;)Ji[t.charCodeAt(l)]=0;return a},m8=function(t,r){for(var e=r.length,i=t.length,n=[],s=[],o=Math.ceil(e/32),a=Math.ceil(i/32),l=0;l<o;l++)s[l]=-1,n[l]=0;for(var u=0;u<a-1;u++){for(var c=0,p=-1,d=u*32,h=Math.min(32,i)+d,f=d;f<h;f++)Ji[t.charCodeAt(f)]|=1<<f;for(var l=0;l<e;l++){var g=Ji[r.charCodeAt(l)],m=s[l/32|0]>>>l&1,y=n[l/32|0]>>>l&1,b=g|c,C=((g|y)&p)+p^p|g|y,D=c|~(C|p),x=p&C;D>>>31^m&&(s[l/32|0]^=1<<l),x>>>31^y&&(n[l/32|0]^=1<<l),D=D<<1|m,x=x<<1|y,p=x|~(b|D),c=D&b}for(var f=d;f<h;f++)Ji[t.charCodeAt(f)]=0}for(var E=0,w=-1,R=u*32,M=Math.min(32,i-R)+R,f=R;f<M;f++)Ji[t.charCodeAt(f)]|=1<<f;for(var T=i,l=0;l<e;l++){var g=Ji[r.charCodeAt(l)],m=s[l/32|0]>>>l&1,y=n[l/32|0]>>>l&1,b=g|E,C=((g|y)&w)+w^w|g|y,D=E|~(C|w),x=w&C;T+=D>>>i-1&1,T-=x>>>i-1&1,D>>>31^m&&(s[l/32|0]^=1<<l),x>>>31^y&&(n[l/32|0]^=1<<l),D=D<<1|m,x=x<<1|y,w=x|~(b|D),E=D&b}for(var f=R;f<M;f++)Ji[t.charCodeAt(f)]=0;return T},oT=function(t,r){if(t.length<r.length){var e=r;r=t,t=e}return r.length===0?t.length:t.length<=32?h8(t,r):m8(t,r)};Qs.distance=oT;var g8=function(t,r){for(var e=1/0,i=0,n=0;n<r.length;n++){var s=oT(t,r[n]);s<e&&(e=s,i=n)}return r[i]};Qs.closest=g8});var NT=A((GG,_T)=>{_T.exports=IT;IT.sync=Y8;var AT=require("fs");function J8(t,r){var e=r.pathExt!==void 0?r.pathExt:process.env.PATHEXT;if(!e||(e=e.split(";"),e.indexOf("")!==-1))return!0;for(var i=0;i<e.length;i++){var n=e[i].toLowerCase();if(n&&t.substr(-n.length).toLowerCase()===n)return!0}return!1}function PT(t,r,e){return!t.isSymbolicLink()&&!t.isFile()?!1:J8(r,e)}function IT(t,r,e){AT.stat(t,function(i,n){e(i,i?!1:PT(n,t,r))})}function Y8(t,r){return PT(AT.statSync(t),t,r)}});var LT=A((HG,RT)=>{RT.exports=kT;kT.sync=X8;var FT=require("fs");function kT(t,r,e){FT.stat(t,function(i,n){e(i,i?!1:OT(n,r))})}function X8(t,r){return OT(FT.statSync(t),r)}function OT(t,r){return t.isFile()&&Q8(t,r)}function Q8(t,r){var e=t.mode,i=t.uid,n=t.gid,s=r.uid!==void 0?r.uid:process.getuid&&process.getuid(),o=r.gid!==void 0?r.gid:process.getgid&&process.getgid(),a=parseInt("100",8),l=parseInt("010",8),u=parseInt("001",8),c=a|l,p=e&u||e&l&&n===o||e&a&&i===s||e&c&&s===0;return p}});var BT=A((YG,MT)=>{var JG=require("fs"),dc;process.platform==="win32"||global.TESTING_WINDOWS?dc=NT():dc=LT();MT.exports=nm;nm.sync=Z8;function nm(t,r,e){if(typeof r=="function"&&(e=r,r={}),!e){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(i,n){nm(t,r||{},function(s,o){s?n(s):i(o)})})}dc(t,r||{},function(i,n){i&&(i.code==="EACCES"||r&&r.ignoreErrors)&&(i=null,n=!1),e(i,n)})}function Z8(t,r){try{return dc.sync(t,r||{})}catch(e){if(r&&r.ignoreErrors||e.code==="EACCES")return!1;throw e}}});var zT=A((XG,VT)=>{var to=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",$T=require("path"),e6=to?";":":",UT=BT(),jT=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),qT=(t,r)=>{let e=r.colon||e6,i=t.match(/\//)||to&&t.match(/\\/)?[""]:[...to?[process.cwd()]:[],...(r.path||process.env.PATH||"").split(e)],n=to?r.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=to?n.split(e):[""];return to&&t.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:i,pathExt:s,pathExtExe:n}},KT=(t,r,e)=>{typeof r=="function"&&(e=r,r={}),r||(r={});let{pathEnv:i,pathExt:n,pathExtExe:s}=qT(t,r),o=[],a=u=>new Promise((c,p)=>{if(u===i.length)return r.all&&o.length?c(o):p(jT(t));let d=i[u],h=/^".*"$/.test(d)?d.slice(1,-1):d,f=$T.join(h,t),g=!h&&/^\.[\\\/]/.test(t)?t.slice(0,2)+f:f;c(l(g,u,0))}),l=(u,c,p)=>new Promise((d,h)=>{if(p===n.length)return d(a(c+1));let f=n[p];UT(u+f,{pathExt:s},(g,m)=>{if(!g&&m)if(r.all)o.push(u+f);else return d(u+f);return d(l(u,c,p+1))})});return e?a(0).then(u=>e(null,u),e):a(0)},t6=(t,r)=>{r=r||{};let{pathEnv:e,pathExt:i,pathExtExe:n}=qT(t,r),s=[];for(let o=0;o<e.length;o++){let a=e[o],l=/^".*"$/.test(a)?a.slice(1,-1):a,u=$T.join(l,t),c=!l&&/^\.[\\\/]/.test(t)?t.slice(0,2)+u:u;for(let p=0;p<i.length;p++){let d=c+i[p];try{if(UT.sync(d,{pathExt:n}))if(r.all)s.push(d);else return d}catch{}}}if(r.all&&s.length)return s;if(r.nothrow)return null;throw jT(t)};VT.exports=KT;KT.sync=t6});var GT=A((QG,sm)=>{"use strict";var WT=(t={})=>{let r=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(r).reverse().find(i=>i.toUpperCase()==="PATH")||"Path"};sm.exports=WT;sm.exports.default=WT});var XT=A((ZG,YT)=>{"use strict";var HT=require("path"),r6=zT(),i6=GT();function JT(t,r){let e=t.options.env||process.env,i=process.cwd(),n=t.options.cwd!=null,s=n&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(t.options.cwd)}catch{}let o;try{o=r6.sync(t.command,{path:e[i6({env:e})],pathExt:r?HT.delimiter:void 0})}catch{}finally{s&&process.chdir(i)}return o&&(o=HT.resolve(n?t.options.cwd:"",o)),o}function n6(t){return JT(t)||JT(t,!0)}YT.exports=n6});var QT=A((eH,am)=>{"use strict";var om=/([()\][%!^"`<>&|;, *?])/g;function s6(t){return t=t.replace(om,"^$1"),t}function o6(t,r){return t=`${t}`,t=t.replace(/(\\*)"/g,'$1$1\\"'),t=t.replace(/(\\*)$/,"$1$1"),t=`"${t}"`,t=t.replace(om,"^$1"),r&&(t=t.replace(om,"^$1")),t}am.exports.command=s6;am.exports.argument=o6});var eA=A((tH,ZT)=>{"use strict";ZT.exports=/^#!(.*)/});var rA=A((rH,tA)=>{"use strict";var a6=eA();tA.exports=(t="")=>{let r=t.match(a6);if(!r)return null;let[e,i]=r[0].replace(/#! ?/,"").split(" "),n=e.split("/").pop();return n==="env"?i:i?`${n} ${i}`:n}});var nA=A((iH,iA)=>{"use strict";var lm=require("fs"),l6=rA();function u6(t){let e=Buffer.alloc(150),i;try{i=lm.openSync(t,"r"),lm.readSync(i,e,0,150,0),lm.closeSync(i)}catch{}return l6(e.toString())}iA.exports=u6});var lA=A((nH,aA)=>{"use strict";var c6=require("path"),sA=XT(),oA=QT(),p6=nA(),d6=process.platform==="win32",f6=/\.(?:com|exe)$/i,h6=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function m6(t){t.file=sA(t);let r=t.file&&p6(t.file);return r?(t.args.unshift(t.file),t.command=r,sA(t)):t.file}function g6(t){if(!d6)return t;let r=m6(t),e=!f6.test(r);if(t.options.forceShell||e){let i=h6.test(r);t.command=c6.normalize(t.command),t.command=oA.command(t.command),t.args=t.args.map(s=>oA.argument(s,i));let n=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${n}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}function y6(t,r,e){r&&!Array.isArray(r)&&(e=r,r=null),r=r?r.slice(0):[],e=Object.assign({},e);let i={command:t,args:r,options:e,file:void 0,original:{command:t,args:r}};return e.shell?i:g6(i)}aA.exports=y6});var pA=A((sH,cA)=>{"use strict";var um=process.platform==="win32";function cm(t,r){return Object.assign(new Error(`${r} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${r} ${t.command}`,path:t.command,spawnargs:t.args})}function b6(t,r){if(!um)return;let e=t.emit;t.emit=function(i,n){if(i==="exit"){let s=uA(n,r,"spawn");if(s)return e.call(t,"error",s)}return e.apply(t,arguments)}}function uA(t,r){return um&&t===1&&!r.file?cm(r.original,"spawn"):null}function D6(t,r){return um&&t===1&&!r.file?cm(r.original,"spawnSync"):null}cA.exports={hookChildProcess:b6,verifyENOENT:uA,verifyENOENTSync:D6,notFoundError:cm}});var hA=A((oH,ro)=>{"use strict";var dA=require("child_process"),pm=lA(),dm=pA();function fA(t,r,e){let i=pm(t,r,e),n=dA.spawn(i.command,i.args,i.options);return dm.hookChildProcess(n,i),n}function x6(t,r,e){let i=pm(t,r,e),n=dA.spawnSync(i.command,i.args,i.options);return n.error=n.error||dm.verifyENOENTSync(n.status,i),n}ro.exports=fA;ro.exports.spawn=fA;ro.exports.sync=x6;ro.exports._parse=pm;ro.exports._enoent=dm});var c4={};module.exports=Wt(c4);var oP=require("../core/index.cjs"),aP=require("../node/index.cjs"),lP=require("../server/index.cjs"),uP=K(Nm(),1);var pc=require("fs/promises");var uo=K(require("prettier"),1);async function ir(t,r,e){try{let i=await uo.default.resolveConfigFile(process.cwd());if(i){let n=await uo.default.resolveConfig(i);return await uo.default.format(t,{...n,filepath:e,parser:r})}else return await uo.default.format(t,{filepath:e,parser:r})}catch(i){return console.warn("Error formatting code",i),t}}var im=require("http");var wc="preview-url";var Zn="framework",Ka="platform",Va="node",Fm="/~builder-connect",An="/~builder-connected",Tc="/~builder-dev-tools",Ac="/~builder-dev-tools.js",Pn="/~builder-dev-tools-close";var vT=require("os"),cc=require("path"),bi=require("fs");var At=K($e(),1),ts=require("node:process"),Zi=K(require("node:readline"),1),kc=K(require("node:readline"),1),zm=require("node:tty"),Ha=K(Gt(),1);function AP({onlyFirst:t=!1}={}){let r=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(r,t?void 0:"g")}var PP=AP();function Wm(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(PP,"")}function Gm(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Hm={exports:{}};(function(t){var r={};t.exports=r,r.eastAsianWidth=function(i){var n=i.charCodeAt(0),s=i.length==2?i.charCodeAt(1):0,o=n;return 55296<=n&&n<=56319&&56320<=s&&s<=57343&&(n&=1023,s&=1023,o=n<<10|s,o+=65536),o==12288||65281<=o&&o<=65376||65504<=o&&o<=65510?"F":o==8361||65377<=o&&o<=65470||65474<=o&&o<=65479||65482<=o&&o<=65487||65490<=o&&o<=65495||65498<=o&&o<=65500||65512<=o&&o<=65518?"H":4352<=o&&o<=4447||4515<=o&&o<=4519||4602<=o&&o<=4607||9001<=o&&o<=9002||11904<=o&&o<=11929||11931<=o&&o<=12019||12032<=o&&o<=12245||12272<=o&&o<=12283||12289<=o&&o<=12350||12353<=o&&o<=12438||12441<=o&&o<=12543||12549<=o&&o<=12589||12593<=o&&o<=12686||12688<=o&&o<=12730||12736<=o&&o<=12771||12784<=o&&o<=12830||12832<=o&&o<=12871||12880<=o&&o<=13054||13056<=o&&o<=19903||19968<=o&&o<=42124||42128<=o&&o<=42182||43360<=o&&o<=43388||44032<=o&&o<=55203||55216<=o&&o<=55238||55243<=o&&o<=55291||63744<=o&&o<=64255||65040<=o&&o<=65049||65072<=o&&o<=65106||65108<=o&&o<=65126||65128<=o&&o<=65131||110592<=o&&o<=110593||127488<=o&&o<=127490||127504<=o&&o<=127546||127552<=o&&o<=127560||127568<=o&&o<=127569||131072<=o&&o<=194367||177984<=o&&o<=196605||196608<=o&&o<=262141?"W":32<=o&&o<=126||162<=o&&o<=163||165<=o&&o<=166||o==172||o==175||10214<=o&&o<=10221||10629<=o&&o<=10630?"Na":o==161||o==164||167<=o&&o<=168||o==170||173<=o&&o<=174||176<=o&&o<=180||182<=o&&o<=186||188<=o&&o<=191||o==198||o==208||215<=o&&o<=216||222<=o&&o<=225||o==230||232<=o&&o<=234||236<=o&&o<=237||o==240||242<=o&&o<=243||247<=o&&o<=250||o==252||o==254||o==257||o==273||o==275||o==283||294<=o&&o<=295||o==299||305<=o&&o<=307||o==312||319<=o&&o<=322||o==324||328<=o&&o<=331||o==333||338<=o&&o<=339||358<=o&&o<=359||o==363||o==462||o==464||o==466||o==468||o==470||o==472||o==474||o==476||o==593||o==609||o==708||o==711||713<=o&&o<=715||o==717||o==720||728<=o&&o<=731||o==733||o==735||768<=o&&o<=879||913<=o&&o<=929||931<=o&&o<=937||945<=o&&o<=961||963<=o&&o<=969||o==1025||1040<=o&&o<=1103||o==1105||o==8208||8211<=o&&o<=8214||8216<=o&&o<=8217||8220<=o&&o<=8221||8224<=o&&o<=8226||8228<=o&&o<=8231||o==8240||8242<=o&&o<=8243||o==8245||o==8251||o==8254||o==8308||o==8319||8321<=o&&o<=8324||o==8364||o==8451||o==8453||o==8457||o==8467||o==8470||8481<=o&&o<=8482||o==8486||o==8491||8531<=o&&o<=8532||8539<=o&&o<=8542||8544<=o&&o<=8555||8560<=o&&o<=8569||o==8585||8592<=o&&o<=8601||8632<=o&&o<=8633||o==8658||o==8660||o==8679||o==8704||8706<=o&&o<=8707||8711<=o&&o<=8712||o==8715||o==8719||o==8721||o==8725||o==8730||8733<=o&&o<=8736||o==8739||o==8741||8743<=o&&o<=8748||o==8750||8756<=o&&o<=8759||8764<=o&&o<=8765||o==8776||o==8780||o==8786||8800<=o&&o<=8801||8804<=o&&o<=8807||8810<=o&&o<=8811||8814<=o&&o<=8815||8834<=o&&o<=8835||8838<=o&&o<=8839||o==8853||o==8857||o==8869||o==8895||o==8978||9312<=o&&o<=9449||9451<=o&&o<=9547||9552<=o&&o<=9587||9600<=o&&o<=9615||9618<=o&&o<=9621||9632<=o&&o<=9633||9635<=o&&o<=9641||9650<=o&&o<=9651||9654<=o&&o<=9655||9660<=o&&o<=9661||9664<=o&&o<=9665||9670<=o&&o<=9672||o==9675||9678<=o&&o<=9681||9698<=o&&o<=9701||o==9711||9733<=o&&o<=9734||o==9737||9742<=o&&o<=9743||9748<=o&&o<=9749||o==9756||o==9758||o==9792||o==9794||9824<=o&&o<=9825||9827<=o&&o<=9829||9831<=o&&o<=9834||9836<=o&&o<=9837||o==9839||9886<=o&&o<=9887||9918<=o&&o<=9919||9924<=o&&o<=9933||9935<=o&&o<=9953||o==9955||9960<=o&&o<=9983||o==10045||o==10071||10102<=o&&o<=10111||11093<=o&&o<=11097||12872<=o&&o<=12879||57344<=o&&o<=63743||65024<=o&&o<=65039||o==65533||127232<=o&&o<=127242||127248<=o&&o<=127277||127280<=o&&o<=127337||127344<=o&&o<=127386||917760<=o&&o<=917999||983040<=o&&o<=1048573||1048576<=o&&o<=1114109?"A":"N"},r.characterLength=function(i){var n=this.eastAsianWidth(i);return n=="F"||n=="W"||n=="A"?2:1};function e(i){return i.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}r.length=function(i){for(var n=e(i),s=0,o=0;o<n.length;o++)s=s+this.characterLength(n[o]);return s},r.slice=function(i,n,s){textLen=r.length(i),n=n||0,s=s||1,n<0&&(n=textLen+n),s<0&&(s=textLen+s);for(var o="",a=0,l=e(i),u=0;u<l.length;u++){var c=l[u],p=r.length(c);if(a>=n-(p==2?1:0))if(a+p<=s)o+=c;else break;a+=p}return o}})(Hm);var IP=Hm.exports,_P=Gm(IP),NP=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g},FP=Gm(NP);function co(t,r={}){if(typeof t!="string"||t.length===0||(r={ambiguousIsNarrow:!0,...r},t=Wm(t),t.length===0))return 0;t=t.replace(FP()," ");let e=r.ambiguousIsNarrow?1:2,i=0;for(let n of t){let s=n.codePointAt(0);if(!(s<=31||s>=127&&s<=159||s>=768&&s<=879))switch(_P.eastAsianWidth(n)){case"F":case"W":i+=2;break;case"A":i+=e;break;default:i+=1}}return i}var Nc=10,Lm=(t=0)=>r=>`\x1B[${r+t}m`,Mm=(t=0)=>r=>`\x1B[${38+t};5;${r}m`,Bm=(t=0)=>(r,e,i)=>`\x1B[${38+t};2;${r};${e};${i}m`,Je={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]}};Object.keys(Je.modifier);var kP=Object.keys(Je.color),OP=Object.keys(Je.bgColor);[...kP,...OP];function RP(){let t=new Map;for(let[r,e]of Object.entries(Je)){for(let[i,n]of Object.entries(e))Je[i]={open:`\x1B[${n[0]}m`,close:`\x1B[${n[1]}m`},e[i]=Je[i],t.set(n[0],n[1]);Object.defineProperty(Je,r,{value:e,enumerable:!1})}return Object.defineProperty(Je,"codes",{value:t,enumerable:!1}),Je.color.close="\x1B[39m",Je.bgColor.close="\x1B[49m",Je.color.ansi=Lm(),Je.color.ansi256=Mm(),Je.color.ansi16m=Bm(),Je.bgColor.ansi=Lm(Nc),Je.bgColor.ansi256=Mm(Nc),Je.bgColor.ansi16m=Bm(Nc),Object.defineProperties(Je,{rgbToAnsi256:{value:(r,e,i)=>r===e&&e===i?r<8?16:r>248?231:Math.round((r-8)/247*24)+232:16+36*Math.round(r/255*5)+6*Math.round(e/255*5)+Math.round(i/255*5),enumerable:!1},hexToRgb:{value:r=>{let e=/[a-f\d]{6}|[a-f\d]{3}/i.exec(r.toString(16));if(!e)return[0,0,0];let[i]=e;i.length===3&&(i=[...i].map(s=>s+s).join(""));let n=Number.parseInt(i,16);return[n>>16&255,n>>8&255,n&255]},enumerable:!1},hexToAnsi256:{value:r=>Je.rgbToAnsi256(...Je.hexToRgb(r)),enumerable:!1},ansi256ToAnsi:{value:r=>{if(r<8)return 30+r;if(r<16)return 90+(r-8);let e,i,n;if(r>=232)e=((r-232)*10+8)/255,i=e,n=e;else{r-=16;let a=r%36;e=Math.floor(r/36)/5,i=Math.floor(a/6)/5,n=a%6/5}let s=Math.max(e,i,n)*2;if(s===0)return 30;let o=30+(Math.round(n)<<2|Math.round(i)<<1|Math.round(e));return s===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(r,e,i)=>Je.ansi256ToAnsi(Je.rgbToAnsi256(r,e,i)),enumerable:!1},hexToAnsi:{value:r=>Je.ansi256ToAnsi(Je.hexToAnsi256(r)),enumerable:!1}}),Je}var LP=RP(),Xa=new Set(["\x1B","\x9B"]),MP=39,Oc="\x07",Jm="[",BP="]",Ym="m",Rc=`${BP}8;;`,$m=t=>`${Xa.values().next().value}${Jm}${t}${Ym}`,Um=t=>`${Xa.values().next().value}${Rc}${t}${Oc}`,$P=t=>t.split(" ").map(r=>co(r)),Fc=(t,r,e)=>{let i=[...r],n=!1,s=!1,o=co(Wm(t[t.length-1]));for(let[a,l]of i.entries()){let u=co(l);if(o+u<=e?t[t.length-1]+=l:(t.push(l),o=0),Xa.has(l)&&(n=!0,s=i.slice(a+1).join("").startsWith(Rc)),n){s?l===Oc&&(n=!1,s=!1):l===Ym&&(n=!1);continue}o+=u,o===e&&a<i.length-1&&(t.push(""),o=0)}!o&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},UP=t=>{let r=t.split(" "),e=r.length;for(;e>0&&!(co(r[e-1])>0);)e--;return e===r.length?t:r.slice(0,e).join(" ")+r.slice(e).join("")},jP=(t,r,e={})=>{if(e.trim!==!1&&t.trim()==="")return"";let i="",n,s,o=$P(t),a=[""];for(let[u,c]of t.split(" ").entries()){e.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let p=co(a[a.length-1]);if(u!==0&&(p>=r&&(e.wordWrap===!1||e.trim===!1)&&(a.push(""),p=0),(p>0||e.trim===!1)&&(a[a.length-1]+=" ",p++)),e.hard&&o[u]>r){let d=r-p,h=1+Math.floor((o[u]-d-1)/r);Math.floor((o[u]-1)/r)<h&&a.push(""),Fc(a,c,r);continue}if(p+o[u]>r&&p>0&&o[u]>0){if(e.wordWrap===!1&&p<r){Fc(a,c,r);continue}a.push("")}if(p+o[u]>r&&e.wordWrap===!1){Fc(a,c,r);continue}a[a.length-1]+=c}e.trim!==!1&&(a=a.map(u=>UP(u)));let l=[...a.join(`
|
|
119
|
+
`),cooked:s===null?null:s.slice(1,u)},a.tail=l,this.next();let p=this.finishNode(a,"TemplateElement");return this.resetEndLocation(p,jt(this.state.lastTokEndLoc,u)),p}parseTemplate(r){let e=this.startNode(),i=this.parseTemplateElement(r),n=[i],s=[];for(;!i.tail;)s.push(this.parseTemplateSubstitution()),this.readTemplateContinuation(),n.push(i=this.parseTemplateElement(r));return e.expressions=s,e.quasis=n,this.finishNode(e,"TemplateLiteral")}parseTemplateSubstitution(){return this.parseExpression()}parseObjectLike(r,e,i,n){i&&this.expectPlugin("recordAndTuple");let s=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let o=Object.create(null),a=!0,l=this.startNode();for(l.properties=[],this.next();!this.match(r);){if(a)a=!1;else if(this.expect(12),this.match(r)){this.addTrailingCommaExtraToNode(l);break}let c;e?c=this.parseBindingProperty():(c=this.parsePropertyDefinition(n),this.checkProto(c,i,o,n)),i&&!this.isObjectProperty(c)&&c.type!=="SpreadElement"&&this.raise(S.InvalidRecordProperty,c),c.shorthand&&this.addExtra(c,"shorthand",!0),l.properties.push(c)}this.next(),this.state.inFSharpPipelineDirectBody=s;let u="ObjectExpression";return e?u="ObjectPattern":i&&(u="RecordExpression"),this.finishNode(l,u)}addTrailingCommaExtraToNode(r){this.addExtra(r,"trailingComma",this.state.lastTokStartLoc.index),this.addExtra(r,"trailingCommaLoc",this.state.lastTokStartLoc,!1)}maybeAsyncOrAccessorProp(r){return!r.computed&&r.key.type==="Identifier"&&(this.isLiteralPropertyName()||this.match(0)||this.match(55))}parsePropertyDefinition(r){let e=[];if(this.match(26))for(this.hasPlugin("decorators")&&this.raise(S.UnsupportedPropertyDecorator,this.state.startLoc);this.match(26);)e.push(this.parseDecorator());let i=this.startNode(),n=!1,s=!1,o;if(this.match(21))return e.length&&this.unexpected(),this.parseSpread();e.length&&(i.decorators=e,e=[]),i.method=!1,r&&(o=this.state.startLoc);let a=this.eat(55);this.parsePropertyNamePrefixOperator(i);let l=this.state.containsEsc;if(this.parsePropertyName(i,r),!a&&!l&&this.maybeAsyncOrAccessorProp(i)){let{key:u}=i,c=u.name;c==="async"&&!this.hasPrecedingLineBreak()&&(n=!0,this.resetPreviousNodeTrailingComments(u),a=this.eat(55),this.parsePropertyName(i)),(c==="get"||c==="set")&&(s=!0,this.resetPreviousNodeTrailingComments(u),i.kind=c,this.match(55)&&(a=!0,this.raise(S.AccessorIsGenerator,this.state.curPosition(),{kind:c}),this.next()),this.parsePropertyName(i))}return this.parseObjPropValue(i,o,a,n,!1,s,r)}getGetterSetterExpectedParamCount(r){return r.kind==="get"?0:1}getObjectOrClassMethodParams(r){return r.params}checkGetterSetterParams(r){var e;let i=this.getGetterSetterExpectedParamCount(r),n=this.getObjectOrClassMethodParams(r);n.length!==i&&this.raise(r.kind==="get"?S.BadGetterArity:S.BadSetterArity,r),r.kind==="set"&&((e=n[n.length-1])==null?void 0:e.type)==="RestElement"&&this.raise(S.BadSetterRestParameter,r)}parseObjectMethod(r,e,i,n,s){if(s){let o=this.parseMethod(r,e,!1,!1,!1,"ObjectMethod");return this.checkGetterSetterParams(o),o}if(i||e||this.match(10))return n&&this.unexpected(),r.kind="method",r.method=!0,this.parseMethod(r,e,i,!1,!1,"ObjectMethod")}parseObjectProperty(r,e,i,n){if(r.shorthand=!1,this.eat(14))return r.value=i?this.parseMaybeDefault(this.state.startLoc):this.parseMaybeAssignAllowIn(n),this.finishNode(r,"ObjectProperty");if(!r.computed&&r.key.type==="Identifier"){if(this.checkReservedWord(r.key.name,r.key.loc.start,!0,!1),i)r.value=this.parseMaybeDefault(e,Wi(r.key));else if(this.match(29)){let s=this.state.startLoc;n!=null?n.shorthandAssignLoc===null&&(n.shorthandAssignLoc=s):this.raise(S.InvalidCoverInitializedName,s),r.value=this.parseMaybeDefault(e,Wi(r.key))}else r.value=Wi(r.key);return r.shorthand=!0,this.finishNode(r,"ObjectProperty")}}parseObjPropValue(r,e,i,n,s,o,a){let l=this.parseObjectMethod(r,i,n,s,o)||this.parseObjectProperty(r,e,s,a);return l||this.unexpected(),l}parsePropertyName(r,e){if(this.eat(0))r.computed=!0,r.key=this.parseMaybeAssignAllowIn(),this.expect(3);else{let{type:i,value:n}=this.state,s;if(Br(i))s=this.parseIdentifier(!0);else switch(i){case 134:s=this.parseNumericLiteral(n);break;case 133:s=this.parseStringLiteral(n);break;case 135:s=this.parseBigIntLiteral(n);break;case 138:{let o=this.state.startLoc;e!=null?e.privateKeyLoc===null&&(e.privateKeyLoc=o):this.raise(S.UnexpectedPrivateField,o),s=this.parsePrivateName();break}default:if(i===136){s=this.parseDecimalLiteral(n);break}this.unexpected()}r.key=s,i!==138&&(r.computed=!1)}}initFunction(r,e){r.id=null,r.generator=!1,r.async=e}parseMethod(r,e,i,n,s,o,a=!1){this.initFunction(r,i),r.generator=e,this.scope.enter(18|(a?64:0)|(s?32:0)),this.prodParam.enter(Fu(i,r.generator)),this.parseFunctionParams(r,n);let l=this.parseFunctionBodyAndFinish(r,o,!0);return this.prodParam.exit(),this.scope.exit(),l}parseArrayLike(r,e,i,n){i&&this.expectPlugin("recordAndTuple");let s=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!1;let o=this.startNode();return this.next(),o.elements=this.parseExprList(r,!i,n,o),this.state.inFSharpPipelineDirectBody=s,this.finishNode(o,i?"TupleExpression":"ArrayExpression")}parseArrowExpression(r,e,i,n){this.scope.enter(6);let s=Fu(i,!1);!this.match(5)&&this.prodParam.hasIn&&(s|=8),this.prodParam.enter(s),this.initFunction(r,i);let o=this.state.maybeInArrowParameters;return e&&(this.state.maybeInArrowParameters=!0,this.setArrowFunctionParameters(r,e,n)),this.state.maybeInArrowParameters=!1,this.parseFunctionBody(r,!0),this.prodParam.exit(),this.scope.exit(),this.state.maybeInArrowParameters=o,this.finishNode(r,"ArrowFunctionExpression")}setArrowFunctionParameters(r,e,i){this.toAssignableList(e,i,!1),r.params=e}parseFunctionBodyAndFinish(r,e,i=!1){return this.parseFunctionBody(r,!1,i),this.finishNode(r,e)}parseFunctionBody(r,e,i=!1){let n=e&&!this.match(5);if(this.expressionScope.enter(Kv()),n)r.body=this.parseMaybeAssign(),this.checkParams(r,!1,e,!1);else{let s=this.state.strict,o=this.state.labels;this.state.labels=[],this.prodParam.enter(this.prodParam.currentFlags()|4),r.body=this.parseBlock(!0,!1,a=>{let l=!this.isSimpleParamList(r.params);a&&l&&this.raise(S.IllegalLanguageModeDirective,(r.kind==="method"||r.kind==="constructor")&&r.key?r.key.loc.end:r);let u=!s&&this.state.strict;this.checkParams(r,!this.state.strict&&!e&&!i&&!l,e,u),this.state.strict&&r.id&&this.checkIdentifier(r.id,65,u)}),this.prodParam.exit(),this.state.labels=o}this.expressionScope.exit()}isSimpleParameter(r){return r.type==="Identifier"}isSimpleParamList(r){for(let e=0,i=r.length;e<i;e++)if(!this.isSimpleParameter(r[e]))return!1;return!0}checkParams(r,e,i,n=!0){let s=!e&&new Set,o={type:"FormalParameters"};for(let a of r.params)this.checkLVal(a,o,5,s,n)}parseExprList(r,e,i,n){let s=[],o=!0;for(;!this.eat(r);){if(o)o=!1;else if(this.expect(12),this.match(r)){n&&this.addTrailingCommaExtraToNode(n),this.next();break}s.push(this.parseExprListItem(e,i))}return s}parseExprListItem(r,e,i){let n;if(this.match(12))r||this.raise(S.UnexpectedToken,this.state.curPosition(),{unexpected:","}),n=null;else if(this.match(21)){let s=this.state.startLoc;n=this.parseParenItem(this.parseSpread(e),s)}else if(this.match(17)){this.expectPlugin("partialApplication"),i||this.raise(S.UnexpectedArgumentPlaceholder,this.state.startLoc);let s=this.startNode();this.next(),n=this.finishNode(s,"ArgumentPlaceholder")}else n=this.parseMaybeAssignAllowIn(e,this.parseParenItem);return n}parseIdentifier(r){let e=this.startNode(),i=this.parseIdentifierName(r);return this.createIdentifier(e,i)}createIdentifier(r,e){return r.name=e,r.loc.identifierName=e,this.finishNode(r,"Identifier")}parseIdentifierName(r){let e,{startLoc:i,type:n}=this.state;Br(n)?e=this.state.value:this.unexpected();let s=wM(n);return r?s&&this.replaceToken(132):this.checkReservedWord(e,i,s,!1),this.next(),e}checkReservedWord(r,e,i,n){if(r.length>10||!VM(r))return;if(i&&jM(r)){this.raise(S.UnexpectedKeyword,e,{keyword:r});return}if((this.state.strict?n?$v:Mv:Lv)(r,this.inModule)){this.raise(S.UnexpectedReservedWord,e,{reservedWord:r});return}else if(r==="yield"){if(this.prodParam.hasYield){this.raise(S.YieldBindingIdentifier,e);return}}else if(r==="await"){if(this.prodParam.hasAwait){this.raise(S.AwaitBindingIdentifier,e);return}if(this.scope.inStaticBlock){this.raise(S.AwaitBindingIdentifierInStaticBlock,e);return}this.expressionScope.recordAsyncArrowParametersError(e)}else if(r==="arguments"&&this.scope.inClassAndNotInNonArrowFunction){this.raise(S.ArgumentsInClass,e);return}}recordAwaitIfAllowed(){let r=this.prodParam.hasAwait||this.options.allowAwaitOutsideFunction&&!this.scope.inFunction;return r&&!this.scope.inFunction&&(this.state.hasTopLevelAwait=!0),r}parseAwait(r){let e=this.startNodeAt(r);return this.expressionScope.recordParameterInitializerError(S.AwaitExpressionFormalParameter,e),this.eat(55)&&this.raise(S.ObsoleteAwaitStar,e),!this.scope.inFunction&&!this.options.allowAwaitOutsideFunction&&(this.isAmbiguousAwait()?this.ambiguousScriptDifferentAst=!0:this.sawUnambiguousESM=!0),this.state.soloAwait||(e.argument=this.parseMaybeUnary(null,!0)),this.finishNode(e,"AwaitExpression")}isAmbiguousAwait(){if(this.hasPrecedingLineBreak())return!0;let{type:r}=this.state;return r===53||r===10||r===0||Ou(r)||r===102&&!this.state.containsEsc||r===137||r===56||this.hasPlugin("v8intrinsic")&&r===54}parseYield(){let r=this.startNode();this.expressionScope.recordParameterInitializerError(S.YieldInParameter,r),this.next();let e=!1,i=null;if(!this.hasPrecedingLineBreak())switch(e=this.eat(55),this.state.type){case 13:case 139:case 8:case 11:case 3:case 9:case 14:case 12:if(!e)break;default:i=this.parseMaybeAssign()}return r.delegate=e,r.argument=i,this.finishNode(r,"YieldExpression")}parseImportCall(r){return this.next(),r.source=this.parseMaybeAssignAllowIn(),(this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions"))&&(r.options=null),this.eat(12)&&(this.hasPlugin("moduleAttributes")||this.hasPlugin("importAssertions")||this.expectPlugin("importAttributes"),this.match(11)||(r.options=this.parseMaybeAssignAllowIn(),this.eat(12))),this.expect(11),this.finishNode(r,"ImportExpression")}checkPipelineAtInfixOperator(r,e){this.hasPlugin(["pipelineOperator",{proposal:"smart"}])&&r.type==="SequenceExpression"&&this.raise(S.PipelineHeadSequenceExpression,e)}parseSmartPipelineBodyInStyle(r,e){if(this.isSimpleReference(r)){let i=this.startNodeAt(e);return i.callee=r,this.finishNode(i,"PipelineBareFunction")}else{let i=this.startNodeAt(e);return this.checkSmartPipeTopicBodyEarlyErrors(e),i.expression=r,this.finishNode(i,"PipelineTopicExpression")}}isSimpleReference(r){switch(r.type){case"MemberExpression":return!r.computed&&this.isSimpleReference(r.object);case"Identifier":return!0;default:return!1}}checkSmartPipeTopicBodyEarlyErrors(r){if(this.match(19))throw this.raise(S.PipelineBodyNoArrow,this.state.startLoc);this.topicReferenceWasUsedInCurrentContext()||this.raise(S.PipelineTopicUnused,r)}withTopicBindingContext(r){let e=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:1,maxTopicIndex:null};try{return r()}finally{this.state.topicContext=e}}withSmartMixTopicForbiddingContext(r){if(this.hasPlugin(["pipelineOperator",{proposal:"smart"}])){let e=this.state.topicContext;this.state.topicContext={maxNumOfResolvableTopics:0,maxTopicIndex:null};try{return r()}finally{this.state.topicContext=e}}else return r()}withSoloAwaitPermittingContext(r){let e=this.state.soloAwait;this.state.soloAwait=!0;try{return r()}finally{this.state.soloAwait=e}}allowInAnd(r){let e=this.prodParam.currentFlags();if(8&~e){this.prodParam.enter(e|8);try{return r()}finally{this.prodParam.exit()}}return r()}disallowInAnd(r){let e=this.prodParam.currentFlags();if(8&e){this.prodParam.enter(e&-9);try{return r()}finally{this.prodParam.exit()}}return r()}registerTopicReference(){this.state.topicContext.maxTopicIndex=0}topicReferenceIsAllowedInCurrentContext(){return this.state.topicContext.maxNumOfResolvableTopics>=1}topicReferenceWasUsedInCurrentContext(){return this.state.topicContext.maxTopicIndex!=null&&this.state.topicContext.maxTopicIndex>=0}parseFSharpPipelineBody(r){let e=this.state.startLoc;this.state.potentialArrowAt=this.state.start;let i=this.state.inFSharpPipelineDirectBody;this.state.inFSharpPipelineDirectBody=!0;let n=this.parseExprOp(this.parseMaybeUnaryOrPrivate(),e,r);return this.state.inFSharpPipelineDirectBody=i,n}parseModuleExpression(){this.expectPlugin("moduleBlocks");let r=this.startNode();this.next(),this.match(5)||this.unexpected(null,5);let e=this.startNodeAt(this.state.endLoc);this.next();let i=this.initializeScopes(!0);this.enterInitialScopes();try{r.body=this.parseProgram(e,8,"module")}finally{i()}return this.finishNode(r,"ModuleExpression")}parsePropertyNamePrefixOperator(r){}},jf={kind:1},SB={kind:2},vB=/[\uD800-\uDFFF]/u,qf=/in(?:stanceof)?/y;function wB(t,r){for(let e=0;e<t.length;e++){let i=t[e],{type:n}=i;if(typeof n=="number"){{if(n===138){let{loc:s,start:o,value:a,end:l}=i,u=o+1,c=jt(s.start,1);t.splice(e,1,new di({type:qi(27),value:"#",start:o,end:u,startLoc:s.start,endLoc:c}),new di({type:qi(132),value:a,start:u,end:l,startLoc:c,endLoc:s.end})),e++;continue}if(Ou(n)){let{loc:s,start:o,value:a,end:l}=i,u=o+1,c=jt(s.start,1),p;r.charCodeAt(o)===96?p=new di({type:qi(22),value:"`",start:o,end:u,startLoc:s.start,endLoc:c}):p=new di({type:qi(8),value:"}",start:o,end:u,startLoc:s.start,endLoc:c});let d,h,f,g;n===24?(h=l-1,f=jt(s.end,-1),d=a===null?null:a.slice(1,-1),g=new di({type:qi(22),value:"`",start:h,end:l,startLoc:f,endLoc:s.end})):(h=l-2,f=jt(s.end,-2),d=a===null?null:a.slice(1,-2),g=new di({type:qi(23),value:"${",start:h,end:l,startLoc:f,endLoc:s.end})),t.splice(e,1,p,new di({type:qi(20),value:d,start:u,end:h,startLoc:c,endLoc:f}),g),e+=2;continue}}i.type=qi(n)}}return t}var lh=class extends ah{parseTopLevel(r,e){return r.program=this.parseProgram(e),r.comments=this.comments,this.options.tokens&&(r.tokens=wB(this.tokens,this.input)),this.finishNode(r,"File")}parseProgram(r,e=139,i=this.options.sourceType){if(r.sourceType=i,r.interpreter=this.parseInterpreterDirective(),this.parseBlockBody(r,!0,!0,e),this.inModule){if(!this.options.allowUndeclaredExports&&this.scope.undefinedExports.size>0)for(let[s,o]of Array.from(this.scope.undefinedExports))this.raise(S.ModuleExportUndefined,o,{localName:s});this.addExtra(r,"topLevelAwait",this.state.hasTopLevelAwait)}let n;return e===139?n=this.finishNode(r,"Program"):n=this.finishNodeAt(r,"Program",jt(this.state.startLoc,-1)),n}stmtToDirective(r){let e=r;e.type="Directive",e.value=e.expression,delete e.expression;let i=e.value,n=i.value,s=this.input.slice(i.start,i.end),o=i.value=s.slice(1,-1);return this.addExtra(i,"raw",s),this.addExtra(i,"rawValue",o),this.addExtra(i,"expressionValue",n),i.type="DirectiveLiteral",e}parseInterpreterDirective(){if(!this.match(28))return null;let r=this.startNode();return r.value=this.state.value,this.next(),this.finishNode(r,"InterpreterDirective")}isLet(){return this.isContextual(100)?this.hasFollowingBindingAtom():!1}chStartsBindingIdentifier(r,e){if(Vi(r)){if(qf.lastIndex=e,qf.test(this.input)){let i=this.codePointAtPos(qf.lastIndex);if(!Ls(i)&&i!==92)return!1}return!0}else return r===92}chStartsBindingPattern(r){return r===91||r===123}hasFollowingBindingAtom(){let r=this.nextTokenStart(),e=this.codePointAtPos(r);return this.chStartsBindingPattern(e)||this.chStartsBindingIdentifier(e,r)}hasInLineFollowingBindingIdentifierOrBrace(){let r=this.nextTokenInLineStart(),e=this.codePointAtPos(r);return e===123||this.chStartsBindingIdentifier(e,r)}startsUsingForOf(){let{type:r,containsEsc:e}=this.lookahead();if(r===102&&!e)return!1;if(we(r)&&!this.hasFollowingLineBreak())return this.expectPlugin("explicitResourceManagement"),!0}startsAwaitUsing(){let r=this.nextTokenInLineStart();if(this.isUnparsedContextual(r,"using")){r=this.nextTokenInLineStartSince(r+5);let e=this.codePointAtPos(r);if(this.chStartsBindingIdentifier(e,r))return this.expectPlugin("explicitResourceManagement"),!0}return!1}parseModuleItem(){return this.parseStatementLike(15)}parseStatementListItem(){return this.parseStatementLike(6|(!this.options.annexB||this.state.strict?0:8))}parseStatementOrSloppyAnnexBFunctionDeclaration(r=!1){let e=0;return this.options.annexB&&!this.state.strict&&(e|=4,r&&(e|=8)),this.parseStatementLike(e)}parseStatement(){return this.parseStatementLike(0)}parseStatementLike(r){let e=null;return this.match(26)&&(e=this.parseDecorators(!0)),this.parseStatementContent(r,e)}parseStatementContent(r,e){let i=this.state.type,n=this.startNode(),s=!!(r&2),o=!!(r&4),a=r&1;switch(i){case 60:return this.parseBreakContinueStatement(n,!0);case 63:return this.parseBreakContinueStatement(n,!1);case 64:return this.parseDebuggerStatement(n);case 90:return this.parseDoWhileStatement(n);case 91:return this.parseForStatement(n);case 68:if(this.lookaheadCharCode()===46)break;return o||this.raise(this.state.strict?S.StrictFunction:this.options.annexB?S.SloppyFunctionAnnexB:S.SloppyFunction,this.state.startLoc),this.parseFunctionStatement(n,!1,!s&&o);case 80:return s||this.unexpected(),this.parseClass(this.maybeTakeDecorators(e,n),!0);case 69:return this.parseIfStatement(n);case 70:return this.parseReturnStatement(n);case 71:return this.parseSwitchStatement(n);case 72:return this.parseThrowStatement(n);case 73:return this.parseTryStatement(n);case 96:if(!this.state.containsEsc&&this.startsAwaitUsing())return this.recordAwaitIfAllowed()?s||this.raise(S.UnexpectedLexicalDeclaration,n):this.raise(S.AwaitUsingNotInAsyncContext,n),this.next(),this.parseVarStatement(n,"await using");break;case 107:if(this.state.containsEsc||!this.hasInLineFollowingBindingIdentifierOrBrace())break;return this.expectPlugin("explicitResourceManagement"),!this.scope.inModule&&this.scope.inTopLevel?this.raise(S.UnexpectedUsingDeclaration,this.state.startLoc):s||this.raise(S.UnexpectedLexicalDeclaration,this.state.startLoc),this.parseVarStatement(n,"using");case 100:{if(this.state.containsEsc)break;let c=this.nextTokenStart(),p=this.codePointAtPos(c);if(p!==91&&(!s&&this.hasFollowingLineBreak()||!this.chStartsBindingIdentifier(p,c)&&p!==123))break}case 75:s||this.raise(S.UnexpectedLexicalDeclaration,this.state.startLoc);case 74:{let c=this.state.value;return this.parseVarStatement(n,c)}case 92:return this.parseWhileStatement(n);case 76:return this.parseWithStatement(n);case 5:return this.parseBlock();case 13:return this.parseEmptyStatement(n);case 83:{let c=this.lookaheadCharCode();if(c===40||c===46)break}case 82:{!this.options.allowImportExportEverywhere&&!a&&this.raise(S.UnexpectedImportExport,this.state.startLoc),this.next();let c;return i===83?(c=this.parseImport(n),c.type==="ImportDeclaration"&&(!c.importKind||c.importKind==="value")&&(this.sawUnambiguousESM=!0)):(c=this.parseExport(n,e),(c.type==="ExportNamedDeclaration"&&(!c.exportKind||c.exportKind==="value")||c.type==="ExportAllDeclaration"&&(!c.exportKind||c.exportKind==="value")||c.type==="ExportDefaultDeclaration")&&(this.sawUnambiguousESM=!0)),this.assertModuleNodeAllowed(c),c}default:if(this.isAsyncFunction())return s||this.raise(S.AsyncFunctionInSingleStatementContext,this.state.startLoc),this.next(),this.parseFunctionStatement(n,!0,!s&&o)}let l=this.state.value,u=this.parseExpression();return we(i)&&u.type==="Identifier"&&this.eat(14)?this.parseLabeledStatement(n,l,u,r):this.parseExpressionStatement(n,u,e)}assertModuleNodeAllowed(r){!this.options.allowImportExportEverywhere&&!this.inModule&&this.raise(S.ImportOutsideModule,r)}decoratorsEnabledBeforeExport(){return this.hasPlugin("decorators-legacy")?!0:this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")!==!1}maybeTakeDecorators(r,e,i){return r&&(e.decorators&&e.decorators.length>0?(typeof this.getPluginOption("decorators","decoratorsBeforeExport")!="boolean"&&this.raise(S.DecoratorsBeforeAfterExport,e.decorators[0]),e.decorators.unshift(...r)):e.decorators=r,this.resetStartLocationFromNode(e,r[0]),i&&this.resetStartLocationFromNode(i,e)),e}canHaveLeadingDecorator(){return this.match(80)}parseDecorators(r){let e=[];do e.push(this.parseDecorator());while(this.match(26));if(this.match(82))r||this.unexpected(),this.decoratorsEnabledBeforeExport()||this.raise(S.DecoratorExportClass,this.state.startLoc);else if(!this.canHaveLeadingDecorator())throw this.raise(S.UnexpectedLeadingDecorator,this.state.startLoc);return e}parseDecorator(){this.expectOnePlugin(["decorators","decorators-legacy"]);let r=this.startNode();if(this.next(),this.hasPlugin("decorators")){let e=this.state.startLoc,i;if(this.match(10)){let n=this.state.startLoc;this.next(),i=this.parseExpression(),this.expect(11),i=this.wrapParenthesis(n,i);let s=this.state.startLoc;r.expression=this.parseMaybeDecoratorArguments(i),this.getPluginOption("decorators","allowCallParenthesized")===!1&&r.expression!==i&&this.raise(S.DecoratorArgumentsOutsideParentheses,s)}else{for(i=this.parseIdentifier(!1);this.eat(16);){let n=this.startNodeAt(e);n.object=i,this.match(138)?(this.classScope.usePrivateName(this.state.value,this.state.startLoc),n.property=this.parsePrivateName()):n.property=this.parseIdentifier(!0),n.computed=!1,i=this.finishNode(n,"MemberExpression")}r.expression=this.parseMaybeDecoratorArguments(i)}}else r.expression=this.parseExprSubscripts();return this.finishNode(r,"Decorator")}parseMaybeDecoratorArguments(r){if(this.eat(10)){let e=this.startNodeAtNode(r);return e.callee=r,e.arguments=this.parseCallExpressionArguments(11,!1),this.toReferencedList(e.arguments),this.finishNode(e,"CallExpression")}return r}parseBreakContinueStatement(r,e){return this.next(),this.isLineTerminator()?r.label=null:(r.label=this.parseIdentifier(),this.semicolon()),this.verifyBreakContinue(r,e),this.finishNode(r,e?"BreakStatement":"ContinueStatement")}verifyBreakContinue(r,e){let i;for(i=0;i<this.state.labels.length;++i){let n=this.state.labels[i];if((r.label==null||n.name===r.label.name)&&(n.kind!=null&&(e||n.kind===1)||r.label&&e))break}if(i===this.state.labels.length){let n=e?"BreakStatement":"ContinueStatement";this.raise(S.IllegalBreakContinue,r,{type:n})}}parseDebuggerStatement(r){return this.next(),this.semicolon(),this.finishNode(r,"DebuggerStatement")}parseHeaderExpression(){this.expect(10);let r=this.parseExpression();return this.expect(11),r}parseDoWhileStatement(r){return this.next(),this.state.labels.push(jf),r.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.expect(92),r.test=this.parseHeaderExpression(),this.eat(13),this.finishNode(r,"DoWhileStatement")}parseForStatement(r){this.next(),this.state.labels.push(jf);let e=null;if(this.isContextual(96)&&this.recordAwaitIfAllowed()&&(e=this.state.startLoc,this.next()),this.scope.enter(0),this.expect(10),this.match(13))return e!==null&&this.unexpected(e),this.parseFor(r,null);let i=this.isContextual(100);{let l=this.isContextual(96)&&this.startsAwaitUsing(),u=l||this.isContextual(107)&&this.startsUsingForOf(),c=i&&this.hasFollowingBindingAtom()||u;if(this.match(74)||this.match(75)||c){let p=this.startNode(),d;l?(d="await using",this.recordAwaitIfAllowed()||this.raise(S.AwaitUsingNotInAsyncContext,this.state.startLoc),this.next()):d=this.state.value,this.next(),this.parseVar(p,!0,d);let h=this.finishNode(p,"VariableDeclaration"),f=this.match(58);return f&&u&&this.raise(S.ForInUsing,h),(f||this.isContextual(102))&&h.declarations.length===1?this.parseForIn(r,h,e):(e!==null&&this.unexpected(e),this.parseFor(r,h))}}let n=this.isContextual(95),s=new Bs,o=this.parseExpression(!0,s),a=this.isContextual(102);if(a&&(i&&this.raise(S.ForOfLet,o),e===null&&n&&o.type==="Identifier"&&this.raise(S.ForOfAsync,o)),a||this.match(58)){this.checkDestructuringPrivate(s),this.toAssignable(o,!0);let l=a?"ForOfStatement":"ForInStatement";return this.checkLVal(o,{type:l}),this.parseForIn(r,o,e)}else this.checkExpressionErrors(s,!0);return e!==null&&this.unexpected(e),this.parseFor(r,o)}parseFunctionStatement(r,e,i){return this.next(),this.parseFunction(r,1|(i?2:0)|(e?8:0))}parseIfStatement(r){return this.next(),r.test=this.parseHeaderExpression(),r.consequent=this.parseStatementOrSloppyAnnexBFunctionDeclaration(),r.alternate=this.eat(66)?this.parseStatementOrSloppyAnnexBFunctionDeclaration():null,this.finishNode(r,"IfStatement")}parseReturnStatement(r){return!this.prodParam.hasReturn&&!this.options.allowReturnOutsideFunction&&this.raise(S.IllegalReturn,this.state.startLoc),this.next(),this.isLineTerminator()?r.argument=null:(r.argument=this.parseExpression(),this.semicolon()),this.finishNode(r,"ReturnStatement")}parseSwitchStatement(r){this.next(),r.discriminant=this.parseHeaderExpression();let e=r.cases=[];this.expect(5),this.state.labels.push(SB),this.scope.enter(0);let i;for(let n;!this.match(8);)if(this.match(61)||this.match(65)){let s=this.match(61);i&&this.finishNode(i,"SwitchCase"),e.push(i=this.startNode()),i.consequent=[],this.next(),s?i.test=this.parseExpression():(n&&this.raise(S.MultipleDefaultsInSwitch,this.state.lastTokStartLoc),n=!0,i.test=null),this.expect(14)}else i?i.consequent.push(this.parseStatementListItem()):this.unexpected();return this.scope.exit(),i&&this.finishNode(i,"SwitchCase"),this.next(),this.state.labels.pop(),this.finishNode(r,"SwitchStatement")}parseThrowStatement(r){return this.next(),this.hasPrecedingLineBreak()&&this.raise(S.NewlineAfterThrow,this.state.lastTokEndLoc),r.argument=this.parseExpression(),this.semicolon(),this.finishNode(r,"ThrowStatement")}parseCatchClauseParam(){let r=this.parseBindingAtom();return this.scope.enter(this.options.annexB&&r.type==="Identifier"?8:0),this.checkLVal(r,{type:"CatchClause"},9),r}parseTryStatement(r){if(this.next(),r.block=this.parseBlock(),r.handler=null,this.match(62)){let e=this.startNode();this.next(),this.match(10)?(this.expect(10),e.param=this.parseCatchClauseParam(),this.expect(11)):(e.param=null,this.scope.enter(0)),e.body=this.withSmartMixTopicForbiddingContext(()=>this.parseBlock(!1,!1)),this.scope.exit(),r.handler=this.finishNode(e,"CatchClause")}return r.finalizer=this.eat(67)?this.parseBlock():null,!r.handler&&!r.finalizer&&this.raise(S.NoCatchOrFinally,r),this.finishNode(r,"TryStatement")}parseVarStatement(r,e,i=!1){return this.next(),this.parseVar(r,!1,e,i),this.semicolon(),this.finishNode(r,"VariableDeclaration")}parseWhileStatement(r){return this.next(),r.test=this.parseHeaderExpression(),this.state.labels.push(jf),r.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.state.labels.pop(),this.finishNode(r,"WhileStatement")}parseWithStatement(r){return this.state.strict&&this.raise(S.StrictWith,this.state.startLoc),this.next(),r.object=this.parseHeaderExpression(),r.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.finishNode(r,"WithStatement")}parseEmptyStatement(r){return this.next(),this.finishNode(r,"EmptyStatement")}parseLabeledStatement(r,e,i,n){for(let o of this.state.labels)o.name===e&&this.raise(S.LabelRedeclaration,i,{labelName:e});let s=PM(this.state.type)?1:this.match(71)?2:null;for(let o=this.state.labels.length-1;o>=0;o--){let a=this.state.labels[o];if(a.statementStart===r.start)a.statementStart=this.state.start,a.kind=s;else break}return this.state.labels.push({name:e,kind:s,statementStart:this.state.start}),r.body=n&8?this.parseStatementOrSloppyAnnexBFunctionDeclaration(!0):this.parseStatement(),this.state.labels.pop(),r.label=i,this.finishNode(r,"LabeledStatement")}parseExpressionStatement(r,e,i){return r.expression=e,this.semicolon(),this.finishNode(r,"ExpressionStatement")}parseBlock(r=!1,e=!0,i){let n=this.startNode();return r&&this.state.strictErrors.clear(),this.expect(5),e&&this.scope.enter(0),this.parseBlockBody(n,r,!1,8,i),e&&this.scope.exit(),this.finishNode(n,"BlockStatement")}isValidDirective(r){return r.type==="ExpressionStatement"&&r.expression.type==="StringLiteral"&&!r.expression.extra.parenthesized}parseBlockBody(r,e,i,n,s){let o=r.body=[],a=r.directives=[];this.parseBlockOrModuleBlockBody(o,e?a:void 0,i,n,s)}parseBlockOrModuleBlockBody(r,e,i,n,s){let o=this.state.strict,a=!1,l=!1;for(;!this.match(n);){let u=i?this.parseModuleItem():this.parseStatementListItem();if(e&&!l){if(this.isValidDirective(u)){let c=this.stmtToDirective(u);e.push(c),!a&&c.value.value==="use strict"&&(a=!0,this.setStrict(!0));continue}l=!0,this.state.strictErrors.clear()}r.push(u)}s?.call(this,a),o||this.setStrict(!1),this.next()}parseFor(r,e){return r.init=e,this.semicolon(!1),r.test=this.match(13)?null:this.parseExpression(),this.semicolon(!1),r.update=this.match(11)?null:this.parseExpression(),this.expect(11),r.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(r,"ForStatement")}parseForIn(r,e,i){let n=this.match(58);return this.next(),n?i!==null&&this.unexpected(i):r.await=i!==null,e.type==="VariableDeclaration"&&e.declarations[0].init!=null&&(!n||!this.options.annexB||this.state.strict||e.kind!=="var"||e.declarations[0].id.type!=="Identifier")&&this.raise(S.ForInOfLoopInitializer,e,{type:n?"ForInStatement":"ForOfStatement"}),e.type==="AssignmentPattern"&&this.raise(S.InvalidLhs,e,{ancestor:{type:"ForStatement"}}),r.left=e,r.right=n?this.parseExpression():this.parseMaybeAssignAllowIn(),this.expect(11),r.body=this.withSmartMixTopicForbiddingContext(()=>this.parseStatement()),this.scope.exit(),this.state.labels.pop(),this.finishNode(r,n?"ForInStatement":"ForOfStatement")}parseVar(r,e,i,n=!1){let s=r.declarations=[];for(r.kind=i;;){let o=this.startNode();if(this.parseVarId(o,i),o.init=this.eat(29)?e?this.parseMaybeAssignDisallowIn():this.parseMaybeAssignAllowIn():null,o.init===null&&!n&&(o.id.type!=="Identifier"&&!(e&&(this.match(58)||this.isContextual(102)))?this.raise(S.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:"destructuring"}):(i==="const"||i==="using"||i==="await using")&&!(this.match(58)||this.isContextual(102))&&this.raise(S.DeclarationMissingInitializer,this.state.lastTokEndLoc,{kind:i})),s.push(this.finishNode(o,"VariableDeclarator")),!this.eat(12))break}return r}parseVarId(r,e){let i=this.parseBindingAtom();(e==="using"||e==="await using")&&(i.type==="ArrayPattern"||i.type==="ObjectPattern")&&this.raise(S.UsingDeclarationHasBindingPattern,i.loc.start),this.checkLVal(i,{type:"VariableDeclarator"},e==="var"?5:8201),r.id=i}parseAsyncFunctionExpression(r){return this.parseFunction(r,8)}parseFunction(r,e=0){let i=e&2,n=!!(e&1),s=n&&!(e&4),o=!!(e&8);this.initFunction(r,o),this.match(55)&&(i&&this.raise(S.GeneratorInSingleStatementContext,this.state.startLoc),this.next(),r.generator=!0),n&&(r.id=this.parseFunctionId(s));let a=this.state.maybeInArrowParameters;return this.state.maybeInArrowParameters=!1,this.scope.enter(2),this.prodParam.enter(Fu(o,r.generator)),n||(r.id=this.parseFunctionId()),this.parseFunctionParams(r,!1),this.withSmartMixTopicForbiddingContext(()=>{this.parseFunctionBodyAndFinish(r,n?"FunctionDeclaration":"FunctionExpression")}),this.prodParam.exit(),this.scope.exit(),n&&!i&&this.registerFunctionStatementId(r),this.state.maybeInArrowParameters=a,r}parseFunctionId(r){return r||we(this.state.type)?this.parseIdentifier():null}parseFunctionParams(r,e){this.expect(10),this.expressionScope.enter(QM()),r.params=this.parseBindingList(11,41,2|(e?4:0)),this.expressionScope.exit()}registerFunctionStatementId(r){r.id&&this.scope.declareName(r.id.name,!this.options.annexB||this.state.strict||r.generator||r.async?this.scope.treatFunctionsAsVar?5:8201:17,r.id.loc.start)}parseClass(r,e,i){this.next();let n=this.state.strict;return this.state.strict=!0,this.parseClassId(r,e,i),this.parseClassSuper(r),r.body=this.parseClassBody(!!r.superClass,n),this.finishNode(r,e?"ClassDeclaration":"ClassExpression")}isClassProperty(){return this.match(29)||this.match(13)||this.match(8)}isClassMethod(){return this.match(10)}nameIsConstructor(r){return r.type==="Identifier"&&r.name==="constructor"||r.type==="StringLiteral"&&r.value==="constructor"}isNonstaticConstructor(r){return!r.computed&&!r.static&&this.nameIsConstructor(r.key)}parseClassBody(r,e){this.classScope.enter();let i={hadConstructor:!1,hadSuperClass:r},n=[],s=this.startNode();if(s.body=[],this.expect(5),this.withSmartMixTopicForbiddingContext(()=>{for(;!this.match(8);){if(this.eat(13)){if(n.length>0)throw this.raise(S.DecoratorSemicolon,this.state.lastTokEndLoc);continue}if(this.match(26)){n.push(this.parseDecorator());continue}let o=this.startNode();n.length&&(o.decorators=n,this.resetStartLocationFromNode(o,n[0]),n=[]),this.parseClassMember(s,o,i),o.kind==="constructor"&&o.decorators&&o.decorators.length>0&&this.raise(S.DecoratorConstructor,o)}}),this.state.strict=e,this.next(),n.length)throw this.raise(S.TrailingDecorator,this.state.startLoc);return this.classScope.exit(),this.finishNode(s,"ClassBody")}parseClassMemberFromModifier(r,e){let i=this.parseIdentifier(!0);if(this.isClassMethod()){let n=e;return n.kind="method",n.computed=!1,n.key=i,n.static=!1,this.pushClassMethod(r,n,!1,!1,!1,!1),!0}else if(this.isClassProperty()){let n=e;return n.computed=!1,n.key=i,n.static=!1,r.body.push(this.parseClassProperty(n)),!0}return this.resetPreviousNodeTrailingComments(i),!1}parseClassMember(r,e,i){let n=this.isContextual(106);if(n){if(this.parseClassMemberFromModifier(r,e))return;if(this.eat(5)){this.parseClassStaticBlock(r,e);return}}this.parseClassMemberWithIsStatic(r,e,i,n)}parseClassMemberWithIsStatic(r,e,i,n){let s=e,o=e,a=e,l=e,u=e,c=s,p=s;if(e.static=n,this.parsePropertyNamePrefixOperator(e),this.eat(55)){c.kind="method";let y=this.match(138);if(this.parseClassElementName(c),y){this.pushClassPrivateMethod(r,o,!0,!1);return}this.isNonstaticConstructor(s)&&this.raise(S.ConstructorIsGenerator,s.key),this.pushClassMethod(r,s,!0,!1,!1,!1);return}let d=!this.state.containsEsc&&we(this.state.type),h=this.parseClassElementName(e),f=d?h.name:null,g=this.isPrivateName(h),m=this.state.startLoc;if(this.parsePostMemberNameModifiers(p),this.isClassMethod()){if(c.kind="method",g){this.pushClassPrivateMethod(r,o,!1,!1);return}let y=this.isNonstaticConstructor(s),b=!1;y&&(s.kind="constructor",i.hadConstructor&&!this.hasPlugin("typescript")&&this.raise(S.DuplicateConstructor,h),y&&this.hasPlugin("typescript")&&e.override&&this.raise(S.OverrideOnConstructor,h),i.hadConstructor=!0,b=i.hadSuperClass),this.pushClassMethod(r,s,!1,!1,y,b)}else if(this.isClassProperty())g?this.pushClassPrivateProperty(r,l):this.pushClassProperty(r,a);else if(f==="async"&&!this.isLineTerminator()){this.resetPreviousNodeTrailingComments(h);let y=this.eat(55);p.optional&&this.unexpected(m),c.kind="method";let b=this.match(138);this.parseClassElementName(c),this.parsePostMemberNameModifiers(p),b?this.pushClassPrivateMethod(r,o,y,!0):(this.isNonstaticConstructor(s)&&this.raise(S.ConstructorIsAsync,s.key),this.pushClassMethod(r,s,y,!0,!1,!1))}else if((f==="get"||f==="set")&&!(this.match(55)&&this.isLineTerminator())){this.resetPreviousNodeTrailingComments(h),c.kind=f;let y=this.match(138);this.parseClassElementName(s),y?this.pushClassPrivateMethod(r,o,!1,!1):(this.isNonstaticConstructor(s)&&this.raise(S.ConstructorIsAccessor,s.key),this.pushClassMethod(r,s,!1,!1,!1,!1)),this.checkGetterSetterParams(s)}else if(f==="accessor"&&!this.isLineTerminator()){this.expectPlugin("decoratorAutoAccessors"),this.resetPreviousNodeTrailingComments(h);let y=this.match(138);this.parseClassElementName(a),this.pushClassAccessorProperty(r,u,y)}else this.isLineTerminator()?g?this.pushClassPrivateProperty(r,l):this.pushClassProperty(r,a):this.unexpected()}parseClassElementName(r){let{type:e,value:i}=this.state;if((e===132||e===133)&&r.static&&i==="prototype"&&this.raise(S.StaticPrototype,this.state.startLoc),e===138){i==="constructor"&&this.raise(S.ConstructorClassPrivateField,this.state.startLoc);let n=this.parsePrivateName();return r.key=n,n}return this.parsePropertyName(r),r.key}parseClassStaticBlock(r,e){var i;this.scope.enter(208);let n=this.state.labels;this.state.labels=[],this.prodParam.enter(0);let s=e.body=[];this.parseBlockOrModuleBlockBody(s,void 0,!1,8),this.prodParam.exit(),this.scope.exit(),this.state.labels=n,r.body.push(this.finishNode(e,"StaticBlock")),(i=e.decorators)!=null&&i.length&&this.raise(S.DecoratorStaticBlock,e)}pushClassProperty(r,e){!e.computed&&this.nameIsConstructor(e.key)&&this.raise(S.ConstructorClassField,e.key),r.body.push(this.parseClassProperty(e))}pushClassPrivateProperty(r,e){let i=this.parseClassPrivateProperty(e);r.body.push(i),this.classScope.declarePrivateName(this.getPrivateNameSV(i.key),0,i.key.loc.start)}pushClassAccessorProperty(r,e,i){!i&&!e.computed&&this.nameIsConstructor(e.key)&&this.raise(S.ConstructorClassField,e.key);let n=this.parseClassAccessorProperty(e);r.body.push(n),i&&this.classScope.declarePrivateName(this.getPrivateNameSV(n.key),0,n.key.loc.start)}pushClassMethod(r,e,i,n,s,o){r.body.push(this.parseMethod(e,i,n,s,o,"ClassMethod",!0))}pushClassPrivateMethod(r,e,i,n){let s=this.parseMethod(e,i,n,!1,!1,"ClassPrivateMethod",!0);r.body.push(s);let o=s.kind==="get"?s.static?6:2:s.kind==="set"?s.static?5:1:0;this.declareClassPrivateMethodInScope(s,o)}declareClassPrivateMethodInScope(r,e){this.classScope.declarePrivateName(this.getPrivateNameSV(r.key),e,r.key.loc.start)}parsePostMemberNameModifiers(r){}parseClassPrivateProperty(r){return this.parseInitializer(r),this.semicolon(),this.finishNode(r,"ClassPrivateProperty")}parseClassProperty(r){return this.parseInitializer(r),this.semicolon(),this.finishNode(r,"ClassProperty")}parseClassAccessorProperty(r){return this.parseInitializer(r),this.semicolon(),this.finishNode(r,"ClassAccessorProperty")}parseInitializer(r){this.scope.enter(80),this.expressionScope.enter(Kv()),this.prodParam.enter(0),r.value=this.eat(29)?this.parseMaybeAssignAllowIn():null,this.expressionScope.exit(),this.prodParam.exit(),this.scope.exit()}parseClassId(r,e,i,n=8331){if(we(this.state.type))r.id=this.parseIdentifier(),e&&this.declareNameFromIdentifier(r.id,n);else if(i||!e)r.id=null;else throw this.raise(S.MissingClassName,this.state.startLoc)}parseClassSuper(r){r.superClass=this.eat(81)?this.parseExprSubscripts():null}parseExport(r,e){let i=this.parseMaybeImportPhase(r,!0),n=this.maybeParseExportDefaultSpecifier(r,i),s=!n||this.eat(12),o=s&&this.eatExportStar(r),a=o&&this.maybeParseExportNamespaceSpecifier(r),l=s&&(!a||this.eat(12)),u=n||o;if(o&&!a){if(n&&this.unexpected(),e)throw this.raise(S.UnsupportedDecoratorExport,r);return this.parseExportFrom(r,!0),this.finishNode(r,"ExportAllDeclaration")}let c=this.maybeParseExportNamedSpecifiers(r);n&&s&&!o&&!c&&this.unexpected(null,5),a&&l&&this.unexpected(null,98);let p;if(u||c){if(p=!1,e)throw this.raise(S.UnsupportedDecoratorExport,r);this.parseExportFrom(r,u)}else p=this.maybeParseExportDeclaration(r);if(u||c||p){var d;let h=r;if(this.checkExport(h,!0,!1,!!h.source),((d=h.declaration)==null?void 0:d.type)==="ClassDeclaration")this.maybeTakeDecorators(e,h.declaration,h);else if(e)throw this.raise(S.UnsupportedDecoratorExport,r);return this.finishNode(h,"ExportNamedDeclaration")}if(this.eat(65)){let h=r,f=this.parseExportDefaultExpression();if(h.declaration=f,f.type==="ClassDeclaration")this.maybeTakeDecorators(e,f,h);else if(e)throw this.raise(S.UnsupportedDecoratorExport,r);return this.checkExport(h,!0,!0),this.finishNode(h,"ExportDefaultDeclaration")}this.unexpected(null,5)}eatExportStar(r){return this.eat(55)}maybeParseExportDefaultSpecifier(r,e){if(e||this.isExportDefaultSpecifier()){this.expectPlugin("exportDefaultFrom",e?.loc.start);let i=e||this.parseIdentifier(!0),n=this.startNodeAtNode(i);return n.exported=i,r.specifiers=[this.finishNode(n,"ExportDefaultSpecifier")],!0}return!1}maybeParseExportNamespaceSpecifier(r){if(this.isContextual(93)){var e,i;(i=(e=r).specifiers)!=null||(e.specifiers=[]);let n=this.startNodeAt(this.state.lastTokStartLoc);return this.next(),n.exported=this.parseModuleExportName(),r.specifiers.push(this.finishNode(n,"ExportNamespaceSpecifier")),!0}return!1}maybeParseExportNamedSpecifiers(r){if(this.match(5)){let e=r;e.specifiers||(e.specifiers=[]);let i=e.exportKind==="type";return e.specifiers.push(...this.parseExportSpecifiers(i)),e.source=null,e.declaration=null,this.hasPlugin("importAssertions")&&(e.assertions=[]),!0}return!1}maybeParseExportDeclaration(r){return this.shouldParseExportDeclaration()?(r.specifiers=[],r.source=null,this.hasPlugin("importAssertions")&&(r.assertions=[]),r.declaration=this.parseExportDeclaration(r),!0):!1}isAsyncFunction(){if(!this.isContextual(95))return!1;let r=this.nextTokenInLineStart();return this.isUnparsedContextual(r,"function")}parseExportDefaultExpression(){let r=this.startNode();if(this.match(68))return this.next(),this.parseFunction(r,5);if(this.isAsyncFunction())return this.next(),this.next(),this.parseFunction(r,13);if(this.match(80))return this.parseClass(r,!0,!0);if(this.match(26))return this.hasPlugin("decorators")&&this.getPluginOption("decorators","decoratorsBeforeExport")===!0&&this.raise(S.DecoratorBeforeExport,this.state.startLoc),this.parseClass(this.maybeTakeDecorators(this.parseDecorators(!1),this.startNode()),!0,!0);if(this.match(75)||this.match(74)||this.isLet())throw this.raise(S.UnsupportedDefaultExport,this.state.startLoc);let e=this.parseMaybeAssignAllowIn();return this.semicolon(),e}parseExportDeclaration(r){return this.match(80)?this.parseClass(this.startNode(),!0,!1):this.parseStatementListItem()}isExportDefaultSpecifier(){let{type:r}=this.state;if(we(r)){if(r===95&&!this.state.containsEsc||r===100)return!1;if((r===130||r===129)&&!this.state.containsEsc){let{type:n}=this.lookahead();if(we(n)&&n!==98||n===5)return this.expectOnePlugin(["flow","typescript"]),!1}}else if(!this.match(65))return!1;let e=this.nextTokenStart(),i=this.isUnparsedContextual(e,"from");if(this.input.charCodeAt(e)===44||we(this.state.type)&&i)return!0;if(this.match(65)&&i){let n=this.input.charCodeAt(this.nextTokenStartSince(e+4));return n===34||n===39}return!1}parseExportFrom(r,e){this.eatContextual(98)?(r.source=this.parseImportSource(),this.checkExport(r),this.maybeParseImportAttributes(r),this.checkJSONModuleImport(r)):e&&this.unexpected(),this.semicolon()}shouldParseExportDeclaration(){let{type:r}=this.state;return r===26&&(this.expectOnePlugin(["decorators","decorators-legacy"]),this.hasPlugin("decorators"))?(this.getPluginOption("decorators","decoratorsBeforeExport")===!0&&this.raise(S.DecoratorBeforeExport,this.state.startLoc),!0):this.isContextual(107)?(this.raise(S.UsingDeclarationExport,this.state.startLoc),!0):this.isContextual(96)&&this.startsAwaitUsing()?(this.raise(S.UsingDeclarationExport,this.state.startLoc),!0):r===74||r===75||r===68||r===80||this.isLet()||this.isAsyncFunction()}checkExport(r,e,i,n){if(e){var s;if(i){if(this.checkDuplicateExports(r,"default"),this.hasPlugin("exportDefaultFrom")){var o;let a=r.declaration;a.type==="Identifier"&&a.name==="from"&&a.end-a.start===4&&!((o=a.extra)!=null&&o.parenthesized)&&this.raise(S.ExportDefaultFromAsIdentifier,a)}}else if((s=r.specifiers)!=null&&s.length)for(let a of r.specifiers){let{exported:l}=a,u=l.type==="Identifier"?l.name:l.value;if(this.checkDuplicateExports(a,u),!n&&a.local){let{local:c}=a;c.type!=="Identifier"?this.raise(S.ExportBindingIsString,a,{localName:c.value,exportName:u}):(this.checkReservedWord(c.name,c.loc.start,!0,!1),this.scope.checkLocalExport(c))}}else if(r.declaration){let a=r.declaration;if(a.type==="FunctionDeclaration"||a.type==="ClassDeclaration"){let{id:l}=a;if(!l)throw new Error("Assertion failure");this.checkDuplicateExports(r,l.name)}else if(a.type==="VariableDeclaration")for(let l of a.declarations)this.checkDeclaration(l.id)}}}checkDeclaration(r){if(r.type==="Identifier")this.checkDuplicateExports(r,r.name);else if(r.type==="ObjectPattern")for(let e of r.properties)this.checkDeclaration(e);else if(r.type==="ArrayPattern")for(let e of r.elements)e&&this.checkDeclaration(e);else r.type==="ObjectProperty"?this.checkDeclaration(r.value):r.type==="RestElement"?this.checkDeclaration(r.argument):r.type==="AssignmentPattern"&&this.checkDeclaration(r.left)}checkDuplicateExports(r,e){this.exportedIdentifiers.has(e)&&(e==="default"?this.raise(S.DuplicateDefaultExport,r):this.raise(S.DuplicateExport,r,{exportName:e})),this.exportedIdentifiers.add(e)}parseExportSpecifiers(r){let e=[],i=!0;for(this.expect(5);!this.eat(8);){if(i)i=!1;else if(this.expect(12),this.eat(8))break;let n=this.isContextual(130),s=this.match(133),o=this.startNode();o.local=this.parseModuleExportName(),e.push(this.parseExportSpecifier(o,s,r,n))}return e}parseExportSpecifier(r,e,i,n){return this.eatContextual(93)?r.exported=this.parseModuleExportName():e?r.exported=rB(r.local):r.exported||(r.exported=Wi(r.local)),this.finishNode(r,"ExportSpecifier")}parseModuleExportName(){if(this.match(133)){let r=this.parseStringLiteral(this.state.value),e=vB.exec(r.value);return e&&this.raise(S.ModuleExportNameHasLoneSurrogate,r,{surrogateCharCode:e[0].charCodeAt(0)}),r}return this.parseIdentifier(!0)}isJSONModuleImport(r){return r.assertions!=null?r.assertions.some(({key:e,value:i})=>i.value==="json"&&(e.type==="Identifier"?e.name==="type":e.value==="type")):!1}checkImportReflection(r){let{specifiers:e}=r,i=e.length===1?e[0].type:null;if(r.phase==="source")i!=="ImportDefaultSpecifier"&&this.raise(S.SourcePhaseImportRequiresDefault,e[0].loc.start);else if(r.phase==="defer")i!=="ImportNamespaceSpecifier"&&this.raise(S.DeferImportRequiresNamespace,e[0].loc.start);else if(r.module){var n;i!=="ImportDefaultSpecifier"&&this.raise(S.ImportReflectionNotBinding,e[0].loc.start),((n=r.assertions)==null?void 0:n.length)>0&&this.raise(S.ImportReflectionHasAssertion,e[0].loc.start)}}checkJSONModuleImport(r){if(this.isJSONModuleImport(r)&&r.type!=="ExportAllDeclaration"){let{specifiers:e}=r;if(e!=null){let i=e.find(n=>{let s;if(n.type==="ExportSpecifier"?s=n.local:n.type==="ImportSpecifier"&&(s=n.imported),s!==void 0)return s.type==="Identifier"?s.name!=="default":s.value!=="default"});i!==void 0&&this.raise(S.ImportJSONBindingNotDefault,i.loc.start)}}}isPotentialImportPhase(r){return r?!1:this.isContextual(105)||this.isContextual(97)||this.isContextual(127)}applyImportPhase(r,e,i,n){e||(i==="module"?(this.expectPlugin("importReflection",n),r.module=!0):this.hasPlugin("importReflection")&&(r.module=!1),i==="source"?(this.expectPlugin("sourcePhaseImports",n),r.phase="source"):i==="defer"?(this.expectPlugin("deferredImportEvaluation",n),r.phase="defer"):this.hasPlugin("sourcePhaseImports")&&(r.phase=null))}parseMaybeImportPhase(r,e){if(!this.isPotentialImportPhase(e))return this.applyImportPhase(r,e,null),null;let i=this.parseIdentifier(!0),{type:n}=this.state;return(Br(n)?n!==98||this.lookaheadCharCode()===102:n!==12)?(this.resetPreviousIdentifierLeadingComments(i),this.applyImportPhase(r,e,i.name,i.loc.start),null):(this.applyImportPhase(r,e,null),i)}isPrecedingIdImportPhase(r){let{type:e}=this.state;return we(e)?e!==98||this.lookaheadCharCode()===102:e!==12}parseImport(r){return this.match(133)?this.parseImportSourceAndAttributes(r):this.parseImportSpecifiersAndAfter(r,this.parseMaybeImportPhase(r,!1))}parseImportSpecifiersAndAfter(r,e){r.specifiers=[];let n=!this.maybeParseDefaultImportSpecifier(r,e)||this.eat(12),s=n&&this.maybeParseStarImportSpecifier(r);return n&&!s&&this.parseNamedImportSpecifiers(r),this.expectContextual(98),this.parseImportSourceAndAttributes(r)}parseImportSourceAndAttributes(r){var e;return(e=r.specifiers)!=null||(r.specifiers=[]),r.source=this.parseImportSource(),this.maybeParseImportAttributes(r),this.checkImportReflection(r),this.checkJSONModuleImport(r),this.semicolon(),this.finishNode(r,"ImportDeclaration")}parseImportSource(){return this.match(133)||this.unexpected(),this.parseExprAtom()}parseImportSpecifierLocal(r,e,i){e.local=this.parseIdentifier(),r.specifiers.push(this.finishImportSpecifier(e,i))}finishImportSpecifier(r,e,i=8201){return this.checkLVal(r.local,{type:e},i),this.finishNode(r,e)}parseImportAttributes(){this.expect(5);let r=[],e=new Set;do{if(this.match(8))break;let i=this.startNode(),n=this.state.value;if(e.has(n)&&this.raise(S.ModuleAttributesWithDuplicateKeys,this.state.startLoc,{key:n}),e.add(n),this.match(133)?i.key=this.parseStringLiteral(n):i.key=this.parseIdentifier(!0),this.expect(14),!this.match(133))throw this.raise(S.ModuleAttributeInvalidValue,this.state.startLoc);i.value=this.parseStringLiteral(this.state.value),r.push(this.finishNode(i,"ImportAttribute"))}while(this.eat(12));return this.expect(8),r}parseModuleAttributes(){let r=[],e=new Set;do{let i=this.startNode();if(i.key=this.parseIdentifier(!0),i.key.name!=="type"&&this.raise(S.ModuleAttributeDifferentFromType,i.key),e.has(i.key.name)&&this.raise(S.ModuleAttributesWithDuplicateKeys,i.key,{key:i.key.name}),e.add(i.key.name),this.expect(14),!this.match(133))throw this.raise(S.ModuleAttributeInvalidValue,this.state.startLoc);i.value=this.parseStringLiteral(this.state.value),r.push(this.finishNode(i,"ImportAttribute"))}while(this.eat(12));return r}maybeParseImportAttributes(r){let e;var i=!1;if(this.match(76)){if(this.hasPrecedingLineBreak()&&this.lookaheadCharCode()===40)return;this.next(),this.hasPlugin("moduleAttributes")?e=this.parseModuleAttributes():(this.hasPlugin("importAssertions")||this.expectPlugin("importAttributes"),e=this.parseImportAttributes()),i=!0}else if(this.isContextual(94)&&!this.hasPrecedingLineBreak())this.hasPlugin("importAttributes")?(this.getPluginOption("importAttributes","deprecatedAssertSyntax")!==!0&&this.raise(S.ImportAttributesUseAssert,this.state.startLoc),this.addExtra(r,"deprecatedAssertSyntax",!0)):this.expectOnePlugin(["importAttributes","importAssertions"]),this.next(),e=this.parseImportAttributes();else if(this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions"))e=[];else if(this.hasPlugin("moduleAttributes"))e=[];else return;!i&&this.hasPlugin("importAssertions")?r.assertions=e:r.attributes=e}maybeParseDefaultImportSpecifier(r,e){if(e){let i=this.startNodeAtNode(e);return i.local=e,r.specifiers.push(this.finishImportSpecifier(i,"ImportDefaultSpecifier")),!0}else if(Br(this.state.type))return this.parseImportSpecifierLocal(r,this.startNode(),"ImportDefaultSpecifier"),!0;return!1}maybeParseStarImportSpecifier(r){if(this.match(55)){let e=this.startNode();return this.next(),this.expectContextual(93),this.parseImportSpecifierLocal(r,e,"ImportNamespaceSpecifier"),!0}return!1}parseNamedImportSpecifiers(r){let e=!0;for(this.expect(5);!this.eat(8);){if(e)e=!1;else{if(this.eat(14))throw this.raise(S.DestructureNamedImport,this.state.startLoc);if(this.expect(12),this.eat(8))break}let i=this.startNode(),n=this.match(133),s=this.isContextual(130);i.imported=this.parseModuleExportName();let o=this.parseImportSpecifier(i,n,r.importKind==="type"||r.importKind==="typeof",s,void 0);r.specifiers.push(o)}}parseImportSpecifier(r,e,i,n,s){if(this.eatContextual(93))r.local=this.parseIdentifier();else{let{imported:o}=r;if(e)throw this.raise(S.ImportBindingIsString,r,{importName:o.value});this.checkReservedWord(o.name,r.loc.start,!0,!0),r.local||(r.local=Wi(o))}return this.finishImportSpecifier(r,"ImportSpecifier",s)}isThisParam(r){return r.type==="Identifier"&&r.name==="this"}},Lu=class extends lh{constructor(r,e,i){r=CB(r),super(r,e),this.options=r,this.initializeScopes(),this.plugins=i,this.filename=r.sourceFilename}getScopeHandler(){return ya}parse(){this.enterInitialScopes();let r=this.startNode(),e=this.startNode();return this.nextToken(),r.errors=null,this.parseTopLevel(r,e),r.errors=this.state.errors,r.comments.length=this.state.commentsLen,r}};function TB(t,r){var e;if(((e=r)==null?void 0:e.sourceType)==="unambiguous"){r=Object.assign({},r);try{r.sourceType="module";let i=ha(r,t),n=i.parse();if(i.sawUnambiguousESM)return n;if(i.ambiguousScriptDifferentAst)try{return r.sourceType="script",ha(r,t).parse()}catch{}else n.program.sourceType="script";return n}catch(i){try{return r.sourceType="script",ha(r,t).parse()}catch{}throw i}}else return ha(r,t).parse()}function AB(t,r){let e=ha(r,t);return e.options.strictMode&&(e.state.strict=!0),e.getExpression()}function PB(t){let r={};for(let e of Object.keys(t))r[e]=qi(t[e]);return r}var IB=PB(vM);function ha(t,r){let e=Lu,i=new Map;if(t!=null&&t.plugins){for(let n of t.plugins){let s,o;typeof n=="string"?s=n:[s,o]=n,i.has(s)||i.set(s,o||{})}xB(i),e=_B(i)}return new e(t,r,i)}var Fv=new Map;function _B(t){let r=[];for(let n of EB)t.has(n)&&r.push(n);let e=r.join("|"),i=Fv.get(e);if(!i){i=Lu;for(let n of r)i=Gv[n](i);Fv.set(e,i)}return i}Da.parse=TB;Da.parseExpression=AB;Da.tokTypes=IB});var aT=A(Qs=>{"use strict";Qs.__esModule=!0;Qs.distance=Qs.closest=void 0;var Ji=new Uint32Array(65536),h8=function(t,r){for(var e=t.length,i=r.length,n=1<<e-1,s=-1,o=0,a=e,l=e;l--;)Ji[t.charCodeAt(l)]|=1<<l;for(l=0;l<i;l++){var u=Ji[r.charCodeAt(l)],c=u|o;u|=(u&s)+s^s,o|=~(u|s),s&=u,o&n&&a++,s&n&&a--,o=o<<1|1,s=s<<1|~(c|o),o&=c}for(l=e;l--;)Ji[t.charCodeAt(l)]=0;return a},m8=function(t,r){for(var e=r.length,i=t.length,n=[],s=[],o=Math.ceil(e/32),a=Math.ceil(i/32),l=0;l<o;l++)s[l]=-1,n[l]=0;for(var u=0;u<a-1;u++){for(var c=0,p=-1,d=u*32,h=Math.min(32,i)+d,f=d;f<h;f++)Ji[t.charCodeAt(f)]|=1<<f;for(var l=0;l<e;l++){var g=Ji[r.charCodeAt(l)],m=s[l/32|0]>>>l&1,y=n[l/32|0]>>>l&1,b=g|c,C=((g|y)&p)+p^p|g|y,D=c|~(C|p),x=p&C;D>>>31^m&&(s[l/32|0]^=1<<l),x>>>31^y&&(n[l/32|0]^=1<<l),D=D<<1|m,x=x<<1|y,p=x|~(b|D),c=D&b}for(var f=d;f<h;f++)Ji[t.charCodeAt(f)]=0}for(var E=0,w=-1,R=u*32,M=Math.min(32,i-R)+R,f=R;f<M;f++)Ji[t.charCodeAt(f)]|=1<<f;for(var T=i,l=0;l<e;l++){var g=Ji[r.charCodeAt(l)],m=s[l/32|0]>>>l&1,y=n[l/32|0]>>>l&1,b=g|E,C=((g|y)&w)+w^w|g|y,D=E|~(C|w),x=w&C;T+=D>>>i-1&1,T-=x>>>i-1&1,D>>>31^m&&(s[l/32|0]^=1<<l),x>>>31^y&&(n[l/32|0]^=1<<l),D=D<<1|m,x=x<<1|y,w=x|~(b|D),E=D&b}for(var f=R;f<M;f++)Ji[t.charCodeAt(f)]=0;return T},oT=function(t,r){if(t.length<r.length){var e=r;r=t,t=e}return r.length===0?t.length:t.length<=32?h8(t,r):m8(t,r)};Qs.distance=oT;var g8=function(t,r){for(var e=1/0,i=0,n=0;n<r.length;n++){var s=oT(t,r[n]);s<e&&(e=s,i=n)}return r[i]};Qs.closest=g8});var NT=A((GG,_T)=>{_T.exports=IT;IT.sync=Y8;var AT=require("fs");function J8(t,r){var e=r.pathExt!==void 0?r.pathExt:process.env.PATHEXT;if(!e||(e=e.split(";"),e.indexOf("")!==-1))return!0;for(var i=0;i<e.length;i++){var n=e[i].toLowerCase();if(n&&t.substr(-n.length).toLowerCase()===n)return!0}return!1}function PT(t,r,e){return!t.isSymbolicLink()&&!t.isFile()?!1:J8(r,e)}function IT(t,r,e){AT.stat(t,function(i,n){e(i,i?!1:PT(n,t,r))})}function Y8(t,r){return PT(AT.statSync(t),t,r)}});var LT=A((HG,RT)=>{RT.exports=kT;kT.sync=X8;var FT=require("fs");function kT(t,r,e){FT.stat(t,function(i,n){e(i,i?!1:OT(n,r))})}function X8(t,r){return OT(FT.statSync(t),r)}function OT(t,r){return t.isFile()&&Q8(t,r)}function Q8(t,r){var e=t.mode,i=t.uid,n=t.gid,s=r.uid!==void 0?r.uid:process.getuid&&process.getuid(),o=r.gid!==void 0?r.gid:process.getgid&&process.getgid(),a=parseInt("100",8),l=parseInt("010",8),u=parseInt("001",8),c=a|l,p=e&u||e&l&&n===o||e&a&&i===s||e&c&&s===0;return p}});var BT=A((YG,MT)=>{var JG=require("fs"),dc;process.platform==="win32"||global.TESTING_WINDOWS?dc=NT():dc=LT();MT.exports=nm;nm.sync=Z8;function nm(t,r,e){if(typeof r=="function"&&(e=r,r={}),!e){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(i,n){nm(t,r||{},function(s,o){s?n(s):i(o)})})}dc(t,r||{},function(i,n){i&&(i.code==="EACCES"||r&&r.ignoreErrors)&&(i=null,n=!1),e(i,n)})}function Z8(t,r){try{return dc.sync(t,r||{})}catch(e){if(r&&r.ignoreErrors||e.code==="EACCES")return!1;throw e}}});var zT=A((XG,VT)=>{var to=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",$T=require("path"),e6=to?";":":",UT=BT(),jT=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),qT=(t,r)=>{let e=r.colon||e6,i=t.match(/\//)||to&&t.match(/\\/)?[""]:[...to?[process.cwd()]:[],...(r.path||process.env.PATH||"").split(e)],n=to?r.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",s=to?n.split(e):[""];return to&&t.indexOf(".")!==-1&&s[0]!==""&&s.unshift(""),{pathEnv:i,pathExt:s,pathExtExe:n}},KT=(t,r,e)=>{typeof r=="function"&&(e=r,r={}),r||(r={});let{pathEnv:i,pathExt:n,pathExtExe:s}=qT(t,r),o=[],a=u=>new Promise((c,p)=>{if(u===i.length)return r.all&&o.length?c(o):p(jT(t));let d=i[u],h=/^".*"$/.test(d)?d.slice(1,-1):d,f=$T.join(h,t),g=!h&&/^\.[\\\/]/.test(t)?t.slice(0,2)+f:f;c(l(g,u,0))}),l=(u,c,p)=>new Promise((d,h)=>{if(p===n.length)return d(a(c+1));let f=n[p];UT(u+f,{pathExt:s},(g,m)=>{if(!g&&m)if(r.all)o.push(u+f);else return d(u+f);return d(l(u,c,p+1))})});return e?a(0).then(u=>e(null,u),e):a(0)},t6=(t,r)=>{r=r||{};let{pathEnv:e,pathExt:i,pathExtExe:n}=qT(t,r),s=[];for(let o=0;o<e.length;o++){let a=e[o],l=/^".*"$/.test(a)?a.slice(1,-1):a,u=$T.join(l,t),c=!l&&/^\.[\\\/]/.test(t)?t.slice(0,2)+u:u;for(let p=0;p<i.length;p++){let d=c+i[p];try{if(UT.sync(d,{pathExt:n}))if(r.all)s.push(d);else return d}catch{}}}if(r.all&&s.length)return s;if(r.nothrow)return null;throw jT(t)};VT.exports=KT;KT.sync=t6});var GT=A((QG,sm)=>{"use strict";var WT=(t={})=>{let r=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(r).reverse().find(i=>i.toUpperCase()==="PATH")||"Path"};sm.exports=WT;sm.exports.default=WT});var XT=A((ZG,YT)=>{"use strict";var HT=require("path"),r6=zT(),i6=GT();function JT(t,r){let e=t.options.env||process.env,i=process.cwd(),n=t.options.cwd!=null,s=n&&process.chdir!==void 0&&!process.chdir.disabled;if(s)try{process.chdir(t.options.cwd)}catch{}let o;try{o=r6.sync(t.command,{path:e[i6({env:e})],pathExt:r?HT.delimiter:void 0})}catch{}finally{s&&process.chdir(i)}return o&&(o=HT.resolve(n?t.options.cwd:"",o)),o}function n6(t){return JT(t)||JT(t,!0)}YT.exports=n6});var QT=A((eH,am)=>{"use strict";var om=/([()\][%!^"`<>&|;, *?])/g;function s6(t){return t=t.replace(om,"^$1"),t}function o6(t,r){return t=`${t}`,t=t.replace(/(\\*)"/g,'$1$1\\"'),t=t.replace(/(\\*)$/,"$1$1"),t=`"${t}"`,t=t.replace(om,"^$1"),r&&(t=t.replace(om,"^$1")),t}am.exports.command=s6;am.exports.argument=o6});var eA=A((tH,ZT)=>{"use strict";ZT.exports=/^#!(.*)/});var rA=A((rH,tA)=>{"use strict";var a6=eA();tA.exports=(t="")=>{let r=t.match(a6);if(!r)return null;let[e,i]=r[0].replace(/#! ?/,"").split(" "),n=e.split("/").pop();return n==="env"?i:i?`${n} ${i}`:n}});var nA=A((iH,iA)=>{"use strict";var lm=require("fs"),l6=rA();function u6(t){let e=Buffer.alloc(150),i;try{i=lm.openSync(t,"r"),lm.readSync(i,e,0,150,0),lm.closeSync(i)}catch{}return l6(e.toString())}iA.exports=u6});var lA=A((nH,aA)=>{"use strict";var c6=require("path"),sA=XT(),oA=QT(),p6=nA(),d6=process.platform==="win32",f6=/\.(?:com|exe)$/i,h6=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function m6(t){t.file=sA(t);let r=t.file&&p6(t.file);return r?(t.args.unshift(t.file),t.command=r,sA(t)):t.file}function g6(t){if(!d6)return t;let r=m6(t),e=!f6.test(r);if(t.options.forceShell||e){let i=h6.test(r);t.command=c6.normalize(t.command),t.command=oA.command(t.command),t.args=t.args.map(s=>oA.argument(s,i));let n=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${n}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}function y6(t,r,e){r&&!Array.isArray(r)&&(e=r,r=null),r=r?r.slice(0):[],e=Object.assign({},e);let i={command:t,args:r,options:e,file:void 0,original:{command:t,args:r}};return e.shell?i:g6(i)}aA.exports=y6});var pA=A((sH,cA)=>{"use strict";var um=process.platform==="win32";function cm(t,r){return Object.assign(new Error(`${r} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${r} ${t.command}`,path:t.command,spawnargs:t.args})}function b6(t,r){if(!um)return;let e=t.emit;t.emit=function(i,n){if(i==="exit"){let s=uA(n,r,"spawn");if(s)return e.call(t,"error",s)}return e.apply(t,arguments)}}function uA(t,r){return um&&t===1&&!r.file?cm(r.original,"spawn"):null}function D6(t,r){return um&&t===1&&!r.file?cm(r.original,"spawnSync"):null}cA.exports={hookChildProcess:b6,verifyENOENT:uA,verifyENOENTSync:D6,notFoundError:cm}});var hA=A((oH,ro)=>{"use strict";var dA=require("child_process"),pm=lA(),dm=pA();function fA(t,r,e){let i=pm(t,r,e),n=dA.spawn(i.command,i.args,i.options);return dm.hookChildProcess(n,i),n}function x6(t,r,e){let i=pm(t,r,e),n=dA.spawnSync(i.command,i.args,i.options);return n.error=n.error||dm.verifyENOENTSync(n.status,i),n}ro.exports=fA;ro.exports.spawn=fA;ro.exports.sync=x6;ro.exports._parse=pm;ro.exports._enoent=dm});var c4={};module.exports=Wt(c4);var oP=require("../core/index.cjs"),aP=require("../node/index.cjs"),lP=require("../server/index.cjs"),uP=K(Nm(),1);var pc=require("fs/promises");var uo=K(require("prettier"),1);async function ir(t,r,e){try{let i=await uo.default.resolveConfigFile(process.cwd());if(i){let n=await uo.default.resolveConfig(i);return await uo.default.format(t,{...n,filepath:e,parser:r})}else return await uo.default.format(t,{filepath:e,parser:r})}catch(i){return console.warn("Error formatting code",i),t}}var im=require("http");var wc="preview-url";var Zn="framework",Ka="platform",Va="node",Fm="/~builder-connect",An="/~builder-connected",Tc="/~builder-dev-tools",Ac="/~builder-dev-tools.js",Pn="/~builder-dev-tools-close";var vT=require("os"),cc=require("path"),bi=require("fs");var Pt=K($e(),1),ts=require("node:process"),Zi=K(require("node:readline"),1),kc=K(require("node:readline"),1),zm=require("node:tty"),Ha=K(Gt(),1);function AP({onlyFirst:t=!1}={}){let r=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(r,t?void 0:"g")}var PP=AP();function Wm(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(PP,"")}function Gm(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Hm={exports:{}};(function(t){var r={};t.exports=r,r.eastAsianWidth=function(i){var n=i.charCodeAt(0),s=i.length==2?i.charCodeAt(1):0,o=n;return 55296<=n&&n<=56319&&56320<=s&&s<=57343&&(n&=1023,s&=1023,o=n<<10|s,o+=65536),o==12288||65281<=o&&o<=65376||65504<=o&&o<=65510?"F":o==8361||65377<=o&&o<=65470||65474<=o&&o<=65479||65482<=o&&o<=65487||65490<=o&&o<=65495||65498<=o&&o<=65500||65512<=o&&o<=65518?"H":4352<=o&&o<=4447||4515<=o&&o<=4519||4602<=o&&o<=4607||9001<=o&&o<=9002||11904<=o&&o<=11929||11931<=o&&o<=12019||12032<=o&&o<=12245||12272<=o&&o<=12283||12289<=o&&o<=12350||12353<=o&&o<=12438||12441<=o&&o<=12543||12549<=o&&o<=12589||12593<=o&&o<=12686||12688<=o&&o<=12730||12736<=o&&o<=12771||12784<=o&&o<=12830||12832<=o&&o<=12871||12880<=o&&o<=13054||13056<=o&&o<=19903||19968<=o&&o<=42124||42128<=o&&o<=42182||43360<=o&&o<=43388||44032<=o&&o<=55203||55216<=o&&o<=55238||55243<=o&&o<=55291||63744<=o&&o<=64255||65040<=o&&o<=65049||65072<=o&&o<=65106||65108<=o&&o<=65126||65128<=o&&o<=65131||110592<=o&&o<=110593||127488<=o&&o<=127490||127504<=o&&o<=127546||127552<=o&&o<=127560||127568<=o&&o<=127569||131072<=o&&o<=194367||177984<=o&&o<=196605||196608<=o&&o<=262141?"W":32<=o&&o<=126||162<=o&&o<=163||165<=o&&o<=166||o==172||o==175||10214<=o&&o<=10221||10629<=o&&o<=10630?"Na":o==161||o==164||167<=o&&o<=168||o==170||173<=o&&o<=174||176<=o&&o<=180||182<=o&&o<=186||188<=o&&o<=191||o==198||o==208||215<=o&&o<=216||222<=o&&o<=225||o==230||232<=o&&o<=234||236<=o&&o<=237||o==240||242<=o&&o<=243||247<=o&&o<=250||o==252||o==254||o==257||o==273||o==275||o==283||294<=o&&o<=295||o==299||305<=o&&o<=307||o==312||319<=o&&o<=322||o==324||328<=o&&o<=331||o==333||338<=o&&o<=339||358<=o&&o<=359||o==363||o==462||o==464||o==466||o==468||o==470||o==472||o==474||o==476||o==593||o==609||o==708||o==711||713<=o&&o<=715||o==717||o==720||728<=o&&o<=731||o==733||o==735||768<=o&&o<=879||913<=o&&o<=929||931<=o&&o<=937||945<=o&&o<=961||963<=o&&o<=969||o==1025||1040<=o&&o<=1103||o==1105||o==8208||8211<=o&&o<=8214||8216<=o&&o<=8217||8220<=o&&o<=8221||8224<=o&&o<=8226||8228<=o&&o<=8231||o==8240||8242<=o&&o<=8243||o==8245||o==8251||o==8254||o==8308||o==8319||8321<=o&&o<=8324||o==8364||o==8451||o==8453||o==8457||o==8467||o==8470||8481<=o&&o<=8482||o==8486||o==8491||8531<=o&&o<=8532||8539<=o&&o<=8542||8544<=o&&o<=8555||8560<=o&&o<=8569||o==8585||8592<=o&&o<=8601||8632<=o&&o<=8633||o==8658||o==8660||o==8679||o==8704||8706<=o&&o<=8707||8711<=o&&o<=8712||o==8715||o==8719||o==8721||o==8725||o==8730||8733<=o&&o<=8736||o==8739||o==8741||8743<=o&&o<=8748||o==8750||8756<=o&&o<=8759||8764<=o&&o<=8765||o==8776||o==8780||o==8786||8800<=o&&o<=8801||8804<=o&&o<=8807||8810<=o&&o<=8811||8814<=o&&o<=8815||8834<=o&&o<=8835||8838<=o&&o<=8839||o==8853||o==8857||o==8869||o==8895||o==8978||9312<=o&&o<=9449||9451<=o&&o<=9547||9552<=o&&o<=9587||9600<=o&&o<=9615||9618<=o&&o<=9621||9632<=o&&o<=9633||9635<=o&&o<=9641||9650<=o&&o<=9651||9654<=o&&o<=9655||9660<=o&&o<=9661||9664<=o&&o<=9665||9670<=o&&o<=9672||o==9675||9678<=o&&o<=9681||9698<=o&&o<=9701||o==9711||9733<=o&&o<=9734||o==9737||9742<=o&&o<=9743||9748<=o&&o<=9749||o==9756||o==9758||o==9792||o==9794||9824<=o&&o<=9825||9827<=o&&o<=9829||9831<=o&&o<=9834||9836<=o&&o<=9837||o==9839||9886<=o&&o<=9887||9918<=o&&o<=9919||9924<=o&&o<=9933||9935<=o&&o<=9953||o==9955||9960<=o&&o<=9983||o==10045||o==10071||10102<=o&&o<=10111||11093<=o&&o<=11097||12872<=o&&o<=12879||57344<=o&&o<=63743||65024<=o&&o<=65039||o==65533||127232<=o&&o<=127242||127248<=o&&o<=127277||127280<=o&&o<=127337||127344<=o&&o<=127386||917760<=o&&o<=917999||983040<=o&&o<=1048573||1048576<=o&&o<=1114109?"A":"N"},r.characterLength=function(i){var n=this.eastAsianWidth(i);return n=="F"||n=="W"||n=="A"?2:1};function e(i){return i.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}r.length=function(i){for(var n=e(i),s=0,o=0;o<n.length;o++)s=s+this.characterLength(n[o]);return s},r.slice=function(i,n,s){textLen=r.length(i),n=n||0,s=s||1,n<0&&(n=textLen+n),s<0&&(s=textLen+s);for(var o="",a=0,l=e(i),u=0;u<l.length;u++){var c=l[u],p=r.length(c);if(a>=n-(p==2?1:0))if(a+p<=s)o+=c;else break;a+=p}return o}})(Hm);var IP=Hm.exports,_P=Gm(IP),NP=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g},FP=Gm(NP);function co(t,r={}){if(typeof t!="string"||t.length===0||(r={ambiguousIsNarrow:!0,...r},t=Wm(t),t.length===0))return 0;t=t.replace(FP()," ");let e=r.ambiguousIsNarrow?1:2,i=0;for(let n of t){let s=n.codePointAt(0);if(!(s<=31||s>=127&&s<=159||s>=768&&s<=879))switch(_P.eastAsianWidth(n)){case"F":case"W":i+=2;break;case"A":i+=e;break;default:i+=1}}return i}var Nc=10,Lm=(t=0)=>r=>`\x1B[${r+t}m`,Mm=(t=0)=>r=>`\x1B[${38+t};5;${r}m`,Bm=(t=0)=>(r,e,i)=>`\x1B[${38+t};2;${r};${e};${i}m`,Je={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]}};Object.keys(Je.modifier);var kP=Object.keys(Je.color),OP=Object.keys(Je.bgColor);[...kP,...OP];function RP(){let t=new Map;for(let[r,e]of Object.entries(Je)){for(let[i,n]of Object.entries(e))Je[i]={open:`\x1B[${n[0]}m`,close:`\x1B[${n[1]}m`},e[i]=Je[i],t.set(n[0],n[1]);Object.defineProperty(Je,r,{value:e,enumerable:!1})}return Object.defineProperty(Je,"codes",{value:t,enumerable:!1}),Je.color.close="\x1B[39m",Je.bgColor.close="\x1B[49m",Je.color.ansi=Lm(),Je.color.ansi256=Mm(),Je.color.ansi16m=Bm(),Je.bgColor.ansi=Lm(Nc),Je.bgColor.ansi256=Mm(Nc),Je.bgColor.ansi16m=Bm(Nc),Object.defineProperties(Je,{rgbToAnsi256:{value:(r,e,i)=>r===e&&e===i?r<8?16:r>248?231:Math.round((r-8)/247*24)+232:16+36*Math.round(r/255*5)+6*Math.round(e/255*5)+Math.round(i/255*5),enumerable:!1},hexToRgb:{value:r=>{let e=/[a-f\d]{6}|[a-f\d]{3}/i.exec(r.toString(16));if(!e)return[0,0,0];let[i]=e;i.length===3&&(i=[...i].map(s=>s+s).join(""));let n=Number.parseInt(i,16);return[n>>16&255,n>>8&255,n&255]},enumerable:!1},hexToAnsi256:{value:r=>Je.rgbToAnsi256(...Je.hexToRgb(r)),enumerable:!1},ansi256ToAnsi:{value:r=>{if(r<8)return 30+r;if(r<16)return 90+(r-8);let e,i,n;if(r>=232)e=((r-232)*10+8)/255,i=e,n=e;else{r-=16;let a=r%36;e=Math.floor(r/36)/5,i=Math.floor(a/6)/5,n=a%6/5}let s=Math.max(e,i,n)*2;if(s===0)return 30;let o=30+(Math.round(n)<<2|Math.round(i)<<1|Math.round(e));return s===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(r,e,i)=>Je.ansi256ToAnsi(Je.rgbToAnsi256(r,e,i)),enumerable:!1},hexToAnsi:{value:r=>Je.ansi256ToAnsi(Je.hexToAnsi256(r)),enumerable:!1}}),Je}var LP=RP(),Xa=new Set(["\x1B","\x9B"]),MP=39,Oc="\x07",Jm="[",BP="]",Ym="m",Rc=`${BP}8;;`,$m=t=>`${Xa.values().next().value}${Jm}${t}${Ym}`,Um=t=>`${Xa.values().next().value}${Rc}${t}${Oc}`,$P=t=>t.split(" ").map(r=>co(r)),Fc=(t,r,e)=>{let i=[...r],n=!1,s=!1,o=co(Wm(t[t.length-1]));for(let[a,l]of i.entries()){let u=co(l);if(o+u<=e?t[t.length-1]+=l:(t.push(l),o=0),Xa.has(l)&&(n=!0,s=i.slice(a+1).join("").startsWith(Rc)),n){s?l===Oc&&(n=!1,s=!1):l===Ym&&(n=!1);continue}o+=u,o===e&&a<i.length-1&&(t.push(""),o=0)}!o&&t[t.length-1].length>0&&t.length>1&&(t[t.length-2]+=t.pop())},UP=t=>{let r=t.split(" "),e=r.length;for(;e>0&&!(co(r[e-1])>0);)e--;return e===r.length?t:r.slice(0,e).join(" ")+r.slice(e).join("")},jP=(t,r,e={})=>{if(e.trim!==!1&&t.trim()==="")return"";let i="",n,s,o=$P(t),a=[""];for(let[u,c]of t.split(" ").entries()){e.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let p=co(a[a.length-1]);if(u!==0&&(p>=r&&(e.wordWrap===!1||e.trim===!1)&&(a.push(""),p=0),(p>0||e.trim===!1)&&(a[a.length-1]+=" ",p++)),e.hard&&o[u]>r){let d=r-p,h=1+Math.floor((o[u]-d-1)/r);Math.floor((o[u]-1)/r)<h&&a.push(""),Fc(a,c,r);continue}if(p+o[u]>r&&p>0&&o[u]>0){if(e.wordWrap===!1&&p<r){Fc(a,c,r);continue}a.push("")}if(p+o[u]>r&&e.wordWrap===!1){Fc(a,c,r);continue}a[a.length-1]+=c}e.trim!==!1&&(a=a.map(u=>UP(u)));let l=[...a.join(`
|
|
120
120
|
`)];for(let[u,c]of l.entries()){if(i+=c,Xa.has(c)){let{groups:d}=new RegExp(`(?:\\${Jm}(?<code>\\d+)m|\\${Rc}(?<uri>.*)${Oc})`).exec(l.slice(u).join(""))||{groups:{}};if(d.code!==void 0){let h=Number.parseFloat(d.code);n=h===MP?void 0:h}else d.uri!==void 0&&(s=d.uri.length===0?void 0:d.uri)}let p=LP.codes.get(Number(n));l[u+1]===`
|
|
121
121
|
`?(s&&(i+=Um("")),n&&p&&(i+=$m(p))):c===`
|
|
122
122
|
`&&(n&&p&&(i+=$m(n)),s&&(i+=Um(s)))}return i};function jm(t,r,e){return String(t).normalize().replace(/\r\n/g,`
|
|
@@ -124,12 +124,12 @@ https://github.com/highlightjs/highlight.js/issues/2277`),N=_,P=B),G===void 0&&(
|
|
|
124
124
|
`).map(i=>jP(i,r,e)).join(`
|
|
125
125
|
`)}var qP=Object.defineProperty,KP=(t,r,e)=>r in t?qP(t,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[r]=e,fr=(t,r,e)=>(KP(t,typeof r!="symbol"?r+"":r,e),e);function VP(t,r){if(t===r)return;let e=t.split(`
|
|
126
126
|
`),i=r.split(`
|
|
127
|
-
`),n=[];for(let s=0;s<Math.max(e.length,i.length);s++)e[s]!==i[s]&&n.push(s);return n}var Xm=Symbol("clack:cancel");function Oe(t){return t===Xm}function Ga(t,r){t.isTTY&&t.setRawMode(r)}var qm=new Map([["k","up"],["j","down"],["h","left"],["l","right"]]),zP=new Set(["up","down","left","right","space","enter"]),es=class{constructor({render:r,input:e=ts.stdin,output:i=ts.stdout,...n},s=!0){fr(this,"input"),fr(this,"output"),fr(this,"rl"),fr(this,"opts"),fr(this,"_track",!1),fr(this,"_render"),fr(this,"_cursor",0),fr(this,"state","initial"),fr(this,"value"),fr(this,"error",""),fr(this,"subscribers",new Map),fr(this,"_prevFrame",""),this.opts=n,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=e,this.output=i}prompt(){let r=new zm.WriteStream(0);return r._write=(e,i,n)=>{this._track&&(this.value=this.rl.line.replace(/\t/g,""),this._cursor=this.rl.cursor,this.emit("value",this.value)),n()},this.input.pipe(r),this.rl=kc.default.createInterface({input:this.input,output:r,tabSize:2,prompt:"",escapeCodeTimeout:50}),kc.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),Ga(this.input,!0),this.output.on("resize",this.render),this.render(),new Promise((e,i)=>{this.once("submit",()=>{this.output.write(
|
|
127
|
+
`),n=[];for(let s=0;s<Math.max(e.length,i.length);s++)e[s]!==i[s]&&n.push(s);return n}var Xm=Symbol("clack:cancel");function Oe(t){return t===Xm}function Ga(t,r){t.isTTY&&t.setRawMode(r)}var qm=new Map([["k","up"],["j","down"],["h","left"],["l","right"]]),zP=new Set(["up","down","left","right","space","enter"]),es=class{constructor({render:r,input:e=ts.stdin,output:i=ts.stdout,...n},s=!0){fr(this,"input"),fr(this,"output"),fr(this,"rl"),fr(this,"opts"),fr(this,"_track",!1),fr(this,"_render"),fr(this,"_cursor",0),fr(this,"state","initial"),fr(this,"value"),fr(this,"error",""),fr(this,"subscribers",new Map),fr(this,"_prevFrame",""),this.opts=n,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=e,this.output=i}prompt(){let r=new zm.WriteStream(0);return r._write=(e,i,n)=>{this._track&&(this.value=this.rl.line.replace(/\t/g,""),this._cursor=this.rl.cursor,this.emit("value",this.value)),n()},this.input.pipe(r),this.rl=kc.default.createInterface({input:this.input,output:r,tabSize:2,prompt:"",escapeCodeTimeout:50}),kc.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),Ga(this.input,!0),this.output.on("resize",this.render),this.render(),new Promise((e,i)=>{this.once("submit",()=>{this.output.write(Pt.cursor.show),this.output.off("resize",this.render),Ga(this.input,!1),e(this.value)}),this.once("cancel",()=>{this.output.write(Pt.cursor.show),this.output.off("resize",this.render),Ga(this.input,!1),e(Xm)})})}on(r,e){let i=this.subscribers.get(r)??[];i.push({cb:e}),this.subscribers.set(r,i)}once(r,e){let i=this.subscribers.get(r)??[];i.push({cb:e,once:!0}),this.subscribers.set(r,i)}emit(r,...e){let i=this.subscribers.get(r)??[],n=[];for(let s of i)s.cb(...e),s.once&&n.push(()=>i.splice(i.indexOf(s),1));for(let s of n)s()}unsubscribe(){this.subscribers.clear()}onKeypress(r,e){if(this.state==="error"&&(this.state="active"),e?.name&&!this._track&&qm.has(e.name)&&this.emit("cursor",qm.get(e.name)),e?.name&&zP.has(e.name)&&this.emit("cursor",e.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()),e?.name==="return"){if(this.opts.validate){let i=this.opts.validate(this.value);i&&(this.error=i,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(`
|
|
128
128
|
`),Ga(this.input,!1),this.rl.close(),this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let r=jm(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
|
|
129
|
-
`).length-1;this.output.write(
|
|
130
|
-
`);this.output.write(n[i]),this._prevFrame=r,this.output.write(
|
|
129
|
+
`).length-1;this.output.write(Pt.cursor.move(-999,r*-1))}render(){let r=jm(this._render(this)??"",process.stdout.columns,{hard:!0});if(r!==this._prevFrame){if(this.state==="initial")this.output.write(Pt.cursor.hide);else{let e=VP(this._prevFrame,r);if(this.restoreCursor(),e&&e?.length===1){let i=e[0];this.output.write(Pt.cursor.move(0,i)),this.output.write(Pt.erase.lines(1));let n=r.split(`
|
|
130
|
+
`);this.output.write(n[i]),this._prevFrame=r,this.output.write(Pt.cursor.move(0,n.length-i-1));return}else if(e&&e?.length>1){let i=e[0];this.output.write(Pt.cursor.move(0,i)),this.output.write(Pt.erase.down());let n=r.split(`
|
|
131
131
|
`).slice(i);this.output.write(n.join(`
|
|
132
|
-
`)),this._prevFrame=r;return}this.output.write(
|
|
132
|
+
`)),this._prevFrame=r;return}this.output.write(Pt.erase.down())}this.output.write(r),this.state==="initial"&&(this.state="active"),this._prevFrame=r}}},Ja=class extends es{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(r){super(r,!1),this.value=!!r.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",e=>{this.output.write(Pt.cursor.move(0,-1)),this.value=e,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};var WP=Object.defineProperty,GP=(t,r,e)=>r in t?WP(t,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[r]=e,Km=(t,r,e)=>(GP(t,typeof r!="symbol"?r+"":r,e),e),Qm=class extends es{constructor(t){super(t,!1),Km(this,"options"),Km(this,"cursor",0),this.options=t.options,this.value=[...t.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:r})=>r===t.cursorAt),0),this.on("key",r=>{r==="a"&&this.toggleAll()}),this.on("cursor",r=>{switch(r){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case"space":this.toggleValue();break}})}get _value(){return this.options[this.cursor].value}toggleAll(){let t=this.value.length===this.options.length;this.value=t?[]:this.options.map(r=>r.value)}toggleValue(){let t=this.value.includes(this._value);this.value=t?this.value.filter(r=>r!==this._value):[...this.value,this._value]}};var HP=Object.defineProperty,JP=(t,r,e)=>r in t?HP(t,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[r]=e,Vm=(t,r,e)=>(JP(t,typeof r!="symbol"?r+"":r,e),e),Zm=class extends es{constructor(t){super(t,!1),Vm(this,"options"),Vm(this,"cursor",0),this.options=t.options,this.cursor=this.options.findIndex(({value:r})=>r===t.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",r=>{switch(r){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}};var YP=Object.defineProperty,XP=(t,r,e)=>r in t?YP(t,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[r]=e,QP=(t,r,e)=>(XP(t,typeof r!="symbol"?r+"":r,e),e),Ya=class extends es{constructor(r){super(r),QP(this,"valueWithCursor",""),this.on("finalize",()=>{this.value||(this.value=r.defaultValue),this.valueWithCursor=this.value}),this.on("value",()=>{if(this.cursor>=this.value.length)this.valueWithCursor=`${this.value}${Ha.default.inverse(Ha.default.hidden("_"))}`;else{let e=this.value.slice(0,this.cursor),i=this.value.slice(this.cursor);this.valueWithCursor=`${e}${Ha.default.inverse(i[0])}${i.slice(1)}`}})}get cursor(){return this._cursor}},ZP=globalThis.process.platform.startsWith("win");function eg({input:t=ts.stdin,output:r=ts.stdout,overwrite:e=!0,hideCursor:i=!0}={}){let n=Zi.createInterface({input:t,output:r,prompt:"",tabSize:1});Zi.emitKeypressEvents(t,n),t.isTTY&&t.setRawMode(!0);let s=(o,{name:a})=>{if(String(o)===""){i&&r.write(Pt.cursor.show),process.exit(0);return}if(!e)return;Zi.moveCursor(r,a==="return"?0:-1,a==="return"?-1:0,()=>{Zi.clearLine(r,1,()=>{t.once("keypress",s)})})};return i&&r.write(Pt.cursor.hide),t.once("keypress",s),()=>{t.off("keypress",s),i&&r.write(Pt.cursor.show),t.isTTY&&!ZP&&t.setRawMode(!1),n.terminal=!1,n.close()}}var hr=K(require("node:process"),1),k=K(Gt(),1),rs=K($e(),1);function e1(){return hr.default.platform!=="win32"?hr.default.env.TERM!=="linux":!!hr.default.env.CI||!!hr.default.env.WT_SESSION||!!hr.default.env.TERMINUS_SUBLIME||hr.default.env.ConEmuTask==="{cmd::Cmder}"||hr.default.env.TERM_PROGRAM==="Terminus-Sublime"||hr.default.env.TERM_PROGRAM==="vscode"||hr.default.env.TERM==="xterm-256color"||hr.default.env.TERM==="alacritty"||hr.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Lc=e1(),nt=(t,r)=>Lc?t:r,t1=nt("\u25C6","*"),rg=nt("\u25A0","x"),ig=nt("\u25B2","x"),Uc=nt("\u25C7","o"),r1=nt("\u250C","T"),_e=nt("\u2502","|"),en=nt("\u2514","\u2014"),Mc=nt("\u25CF",">"),Bc=nt("\u25CB"," "),i1=nt("\u25FB","[\u2022]"),tg=nt("\u25FC","[+]"),n1=nt("\u25FB","[ ]"),v4=nt("\u25AA","\u2022"),w4=nt("\u2500","-"),T4=nt("\u256E","+"),A4=nt("\u251C","+"),P4=nt("\u256F","+"),s1=nt("\u25CF","\u2022"),o1=nt("\u25C6","*"),a1=nt("\u25B2","!"),l1=nt("\u25A0","x"),Qa=t=>{switch(t){case"initial":case"active":return k.default.cyan(t1);case"cancel":return k.default.red(rg);case"error":return k.default.yellow(ig);case"submit":return k.default.green(Uc)}},$c=t=>{let{cursor:r,options:e,style:i}=t,n=t.maxItems??1/0,s=Math.max(process.stdout.rows-4,0),o=Math.min(s,Math.max(n,5)),a=0;r>=a+o-3?a=Math.max(Math.min(r-o+3,e.length-o),0):r<a+2&&(a=Math.max(r-2,0));let l=o<e.length&&a>0,u=o<e.length&&a+o<e.length;return e.slice(a,a+o).map((c,p,d)=>{let h=p===0&&l,f=p===d.length-1&&u;return h||f?k.default.dim("..."):i(c,p+a===r)})},Lt=t=>new Ya({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,render(){let r=`${k.default.gray(_e)}
|
|
133
133
|
${Qa(this.state)} ${t.message}
|
|
134
134
|
`,e=t.placeholder?k.default.inverse(t.placeholder[0])+k.default.dim(t.placeholder.slice(1)):k.default.inverse(k.default.hidden("_")),i=this.value?this.valueWithCursor:e;switch(this.state){case"error":return`${r.trim()}
|
|
135
135
|
${k.default.yellow(_e)} ${i}
|
|
@@ -137,7 +137,7 @@ ${k.default.yellow(en)} ${k.default.yellow(this.error)}
|
|
|
137
137
|
`;case"submit":return`${r}${k.default.gray(_e)} ${k.default.dim(this.value||t.placeholder)}`;case"cancel":return`${r}${k.default.gray(_e)} ${k.default.strikethrough(k.default.dim(this.value??""))}${this.value?.trim()?`
|
|
138
138
|
`+k.default.gray(_e):""}`;default:return`${r}${k.default.cyan(_e)} ${i}
|
|
139
139
|
${k.default.cyan(en)}
|
|
140
|
-
`}}}).prompt();var
|
|
140
|
+
`}}}).prompt();var gt=t=>{let r=t.active??"Yes",e=t.inactive??"No";return new Ja({active:r,inactive:e,initialValue:t.initialValue??!0,render(){let i=`${k.default.gray(_e)}
|
|
141
141
|
${Qa(this.state)} ${t.message}
|
|
142
142
|
`,n=this.value?r:e;switch(this.state){case"submit":return`${i}${k.default.gray(_e)} ${k.default.dim(n)}`;case"cancel":return`${i}${k.default.gray(_e)} ${k.default.strikethrough(k.default.dim(n))}
|
|
143
143
|
${k.default.gray(_e)}`;default:return`${i}${k.default.cyan(_e)} ${this.value?`${k.default.green(Mc)} ${r}`:`${k.default.dim(Bc)} ${k.default.dim(r)}`} ${k.default.dim("/")} ${this.value?`${k.default.dim(Bc)} ${k.default.dim(e)}`:`${k.default.green(Mc)} ${e}`}
|
|
@@ -162,7 +162,7 @@ ${k.default.cyan(_e)} `)}
|
|
|
162
162
|
${k.default.cyan(en)}
|
|
163
163
|
`}}}).prompt()};var pe=(t="")=>{process.stdout.write(`${k.default.gray(en)} ${k.default.red(t)}
|
|
164
164
|
|
|
165
|
-
`)},
|
|
165
|
+
`)},It=(t="")=>{process.stdout.write(`${k.default.gray(r1)} ${t}
|
|
166
166
|
`)},Mt=(t="")=>{process.stdout.write(`${k.default.gray(_e)}
|
|
167
167
|
${k.default.gray(en)} ${t}
|
|
168
168
|
|
|
@@ -179,7 +179,7 @@ ${n}
|
|
|
179
179
|
${e}=${i}
|
|
180
180
|
|
|
181
181
|
`,await t.writeFile(r,s),"update";else return t.debug(`Creating new .env file with "${e}" at ${r}`),s=[n,`${e}=${i}`,""].join(`
|
|
182
|
-
`),await t.writeFile(r,s),"create";return null}async function ho(t){return await tn(t,[".env.local",".env.development.local",".env.production.local",".env.development",".env.production",".env"],zr)}async function gg(t,r){let e=await ho(t),i=await rn(t,e.file,e.envKey,r);return{...e,modifiedType:i}}var zr="NEXT_PUBLIC_BUILDER_API_KEY";var te={gen1:"Gen 1",gen2:"Gen 2"},mo={CMS:"cms",VCP:"vcp",HYBRID:"hybrid"};function xe(t,r=""){return t.ts.createSourceFile("module.tsx",typeof r=="string"?r:"",t.ts.ScriptTarget.Latest,void 0)}function tl(t,r=""){let e=xe(t,r?.trim());if(e.statements.length===0)throw new Error(`No statements found in code: ${r}`);return e.statements[0]}function
|
|
182
|
+
`),await t.writeFile(r,s),"create";return null}async function ho(t){return await tn(t,[".env.local",".env.development.local",".env.production.local",".env.development",".env.production",".env"],zr)}async function gg(t,r){let e=await ho(t),i=await rn(t,e.file,e.envKey,r);return{...e,modifiedType:i}}var zr="NEXT_PUBLIC_BUILDER_API_KEY";var te={gen1:"Gen 1",gen2:"Gen 2"},mo={CMS:"cms",VCP:"vcp",HYBRID:"hybrid"};function xe(t,r=""){return t.ts.createSourceFile("module.tsx",typeof r=="string"?r:"",t.ts.ScriptTarget.Latest,void 0)}function tl(t,r=""){let e=xe(t,r?.trim());if(e.statements.length===0)throw new Error(`No statements found in code: ${r}`);return e.statements[0]}function yt(t,r,e){if(r){let i=t.ts.createPrinter({newLine:t.ts.NewLineKind.LineFeed,removeComments:e});return t.ts.isSourceFile(r)?i.printFile(r).trim()+`
|
|
183
183
|
`:i.printNode(t.ts.EmitHint.Unspecified,r,t.ts.createSourceFile("module.tsx","",t.ts.ScriptTarget.Latest)).trim()+`
|
|
184
184
|
`}return""}function ss(t,r,e,i,n=!0){let s=r.properties.filter(a=>t.ts.isPropertyAssignment(a)),o=h1(t,r,e);return o>-1?i==null&&n?t.ts.factory.updateObjectLiteralExpression(r,s.filter((a,l)=>l!==o)):(s[o]=t.ts.factory.updatePropertyAssignment(s[o],s[o].name,go(t,i)),t.ts.factory.updateObjectLiteralExpression(r,s)):(i!=null&&s.push(t.ts.factory.createPropertyAssignment(e,go(t,i))),t.ts.factory.updateObjectLiteralExpression(r,s))}function h1(t,r,e){return r.properties.findIndex(i=>Fe(t,i)===e)}function yo(t,r){switch(r.kind){case t.ts.SyntaxKind.ArrayLiteralExpression:return g1(t,r);case t.ts.SyntaxKind.ObjectLiteralExpression:return m1(t,r);case t.ts.SyntaxKind.StringLiteral:return r.text;case t.ts.SyntaxKind.NumericLiteral:return Number(r.text);case t.ts.SyntaxKind.NoSubstitutionTemplateLiteral:return r.text;case t.ts.SyntaxKind.TrueKeyword:return!0;case t.ts.SyntaxKind.FalseKeyword:return!1;case t.ts.SyntaxKind.Identifier:switch(r.escapedText){case"undefined":return;case"null":return null;case"String":return String;case"Number":return Number;case"Boolean":return Boolean;case"NaN":return NaN}}}function m1(t,r){let e={};if(r&&t.ts.isObjectLiteralExpression(r)){for(let i of r.properties)if(t.ts.isPropertyAssignment(i)){let n=Fe(t,i);n&&(e[n]=yo(t,i.initializer))}}return e}function g1(t,r){return r&&t.ts.isArrayLiteralExpression(r)?r.elements.map(e=>yo(t,e)):[]}function Fe(t,r){if(r&&t.ts.isPropertyAssignment(r)){let e=r.name;switch(e.kind){case t.ts.SyntaxKind.Identifier:return e.text;case t.ts.SyntaxKind.StringLiteral:case t.ts.SyntaxKind.NumericLiteral:return e.text;case t.ts.SyntaxKind.ComputedPropertyName:let i=e.expression;if(t.ts.isStringLiteral(i)||t.ts.isNumericLiteral(i))return e.expression.text}}}function go(t,r){return Kc(t,r,new WeakSet)}function Kc(t,r,e){return r===void 0?t.ts.factory.createIdentifier("undefined"):r===null?t.ts.factory.createIdentifier("null"):typeof r=="string"?t.ts.factory.createStringLiteral(r):typeof r=="number"?isNaN(r)?t.ts.factory.createIdentifier("NaN"):t.ts.factory.createNumericLiteral(r):r===!0?t.ts.factory.createTrue():r===!1?t.ts.factory.createFalse():r===String?t.ts.factory.createIdentifier("String"):r===Number?t.ts.factory.createIdentifier("Number"):r===Boolean?t.ts.factory.createIdentifier("Boolean"):Array.isArray(r)?y1(t,r,e):typeof r=="object"?b1(t,r,e):t.ts.factory.createIdentifier(r)}function y1(t,r,e){let i=r.map(n=>Kc(t,n,e));return t.ts.factory.createArrayLiteralExpression(i,!0)}function b1(t,r,e){if(e.has(r))return t.ts.factory.createIdentifier("undefined");e.add(r);let i=Object.keys(r).map(n=>t.ts.factory.createPropertyAssignment(n,Kc(t,r[n],e)));return t.ts.factory.createObjectLiteralExpression(i,!0)}function Fn(t,r,e){let i=[];if(!e)return i;let n=null;if(t.ts.isArrowFunction(e)||t.ts.isFunctionExpression(e)||t.ts.isFunctionDeclaration(e)){let s=e.parameters;if(s.length>0){let o=s[0],a=r.getTypeAtLocation(o);a.aliasTypeArguments&&a.aliasTypeArguments.length>0?n=a.aliasTypeArguments[0].getProperties():n=a.getProperties()}}else if(t.ts.isIdentifier(e)){let s=r.getTypeAtLocation(e),o=s.symbol?.valueDeclaration;if(o&&t.ts.isClassDeclaration(o)){let l=o.heritageClauses?.find(u=>u.token===t.ts.SyntaxKind.ExtendsKeyword)?.types;if(l){for(let u of l)if(r.getSymbolAtLocation(u.expression)?.name==="Component"){if(t.ts.isExpressionWithTypeArguments(u)){let p=u.typeArguments;if(p){let d=p[0];n=r.getTypeFromTypeNode(d).getProperties()}}break}}}if(!n){let a=s.getCallSignatures();if(a.length>0){let l=a[0].getParameters();l.length>0&&(n=r.getTypeOfSymbolAtLocation(l[0],e).getProperties())}}}else if(t.ts.isExportSpecifier(e)){let s=r.getSymbolAtLocation(e.name);if(s){let a=r.getTypeOfSymbolAtLocation(s,e).getCallSignatures();if(a.length>0){let l=a[0].getParameters();l.length>0&&(n=r.getTypeOfSymbolAtLocation(l[0],e).getProperties())}}}if(n)for(let s of n){let o=D1(t,r,s);o&&i.push(o)}return i=i.filter(bg),i.length>0?i:x1(t,e)}function D1(t,r,e){let i=e.valueDeclaration,n=e.getName();if(i||(i=e.getDeclarations()?.[0]),i&&t.ts.isPropertySignature(i)){if(n!=="children"&&i.getSourceFile().fileName.includes("node_modules/@types/"))return null;let s="string",o;if(i?.type){let l=r.getTypeFromTypeNode(i.type),u=r.typeToString(l),c=Vc(u);c.knownType?s=c.builderType:C1(u)||l.flags&t.ts.TypeFlags.StringLike?s="string":l.flags&t.ts.TypeFlags.NumberLike?s="number":l.flags&t.ts.TypeFlags.IndexedAccess?s="list":l.flags&t.ts.TypeFlags.Object||l.isUnion()&&l.types.every(p=>p.flags&t.ts.TypeFlags.Object)||l.isIntersection()&&l.types.some(p=>p.flags&t.ts.TypeFlags.Object)?s="object":s="string",u!==s&&(o=u)}let a={name:n,type:s,isRegistered:!1};if(o&&i.type){let l=T1(t,r,r.getTypeFromTypeNode(i.type));a.meta=a.meta||{},l&&l.length>0&&a.type==="string"&&l.every(v1)?a.enum=l.map(w1):a.meta.ts=o}return i.questionToken||(a.required=!0),a}return null}function x1(t,r){let e=[],i=t.ts.getJSDocCommentsAndTags(r);for(let n of i)if(!(!t.ts.isJSDoc(n)||!n.tags))for(let s of n.tags){if(!t.ts.isJSDocParameterTag(s)||s.tagName.text!=="param")continue;let a=s.typeExpression?.type;if(!a||!t.ts.isJSDocTypeLiteral(a))continue;let l=a.jsDocPropertyTags;if(l)for(let u of l){if(!t.ts.isJSDocPropertyLikeTag(u))continue;let c=u.name;if(!t.ts.isQualifiedName(c))continue;let p=u.typeExpression;if(!p)continue;let d="";switch(p.type.kind){case t.ts.SyntaxKind.StringKeyword:{d="string";break}case t.ts.SyntaxKind.NumberKeyword:{d="number";break}case t.ts.SyntaxKind.BooleanKeyword:{d="boolean";break}default:continue}let f={name:c.right.text,type:d,isRegistered:!1};e.push(f)}}return e.filter(bg)}var E1=["ClassicComponent","FunctionComponent","IntrinsicElements","JSX","ReactNode","ReactElement","ReactPortal"];function C1(t){return typeof t!="string"?!1:!!E1.some(r=>t.includes(r))}function Vc(t){return typeof t=="string"&&(t=t.trim(),S1.some(r=>r.value===t))?{builderType:t,knownType:!0}:{builderType:"string",knownType:!1}}var S1=[{value:"boolean",text:"boolean"},{value:"color",text:"color (provides a color in hex or rgb)"},{value:"date",text:"date (same format as the Date constructor)"},{value:"email",text:"email"},{value:"file",text:"file (uploads a file and provides a url)"},{value:"list",text:"list (collection of items)"},{value:"longText",text:"longText (multiline text editor)"},{value:"number",text:"number"},{value:"object",text:"object (set of specific names and values)"},{value:"richText",text:"richText (provides value as html)"},{value:"string",text:"string"}];function v1(t){return/^['"].*['"]$/.test(t)}function w1(t){return(t.startsWith('"')||t.startsWith("'"))&&(t.endsWith('"')||t.endsWith("'"))?t.slice(1,-1):t}var T1=(t,r,e)=>{let i=new Set;yg(t,r,e,i);let n=i.delete("true"),s=i.delete("false");(n||s)&&i.add("boolean");let o=Array.from(i.keys()).sort();if(o.length>1&&(o=o.map(a=>a.indexOf("=>")>=0?`(${a})`:a)),!(o.length>20))return o},A1=(t,r,e)=>{let i=t.ts.TypeFormatFlags.InElementType|t.ts.TypeFormatFlags.NoTruncation;return r.typeToString(e,void 0,i)},yg=(t,r,e,i)=>{if(e.isUnion())e.types.forEach(n=>{yg(t,r,n,i)});else if(e.isLiteral()){let n=A1(t,r,e);i.add(n)}};function bg(t){let r=t?.name;if(typeof r!="string"||r===""||r.startsWith("aria")||r.startsWith("data-"))return!1;if(r.startsWith("on")&&r.length>2){let e=r.charAt(2);if(e.toUpperCase()===e)return!1}return!P1.has(r.toLowerCase())}var P1=new Set(["about","accessKey","accessKeyLabel","asChild","autoCapitalize","autoCorrect","autoFocus","autoSave","blur","contentEditable","contextMenu","dangerouslySetInnerHTML","datatype","defaultChecked","defaultValue","dir","draggable","enterKeyHint","focus","form","formAction","formEncType","formMethod","formNoValidate","formTarget","inlist","innerText","inputMode","is","isContentEditable","itemID","itemProp","itemRef","itemScope","itemType","lang","nonce","offsetHeight","offsetLeft","offsetTop","offsetWidth","outerText","prefix","property","radioGroup","rel","resource","results","rev","role","security","slot","spellCheck","suppressContentEditableWarning","suppressHydrationWarning","tabIndex","translate","typeof","unselectable","vocab"].map(t=>t.toLowerCase()));function Jt(t,r,e){for(let i of e.properties){if(!t.ts.isPropertyAssignment(i))continue;let n=Fe(t,i);if(n==="name"&&t.ts.isStringLiteral(i.initializer)){r.name=i.initializer.text;continue}if(n==="description"&&t.ts.isStringLiteral(i.initializer)){r.description=i.initializer.text;continue}if(n==="image"&&t.ts.isStringLiteral(i.initializer)){r.image=i.initializer.text;continue}if(n==="inputs"&&t.ts.isArrayLiteralExpression(i.initializer)){let s=I1(t,i.initializer);ar(r,s);continue}if(n==="meta"&&t.ts.isObjectLiteralExpression(i.initializer)){let s=yo(t,i.initializer);s&&typeof s=="object"&&(r.meta=s);continue}}return r}function I1(t,r){let e=[];for(let i of r.elements)t.ts.isObjectLiteralExpression(i)&&e.push(_1(t,i));return e}function _1(t,r){let e=yo(t,r),i=M1(e);return i.isRegistered=!0,i}function pt(t,r,e){let i=F1(e);return r=ss(t,r,"name",i.name,!1),r=ss(t,r,"description",i.description),r=ss(t,r,"image",i.image),r=ss(t,r,"meta",i.meta),r=N1(t,r,i),B1(t,r)}function N1(t,r,e){let i=null,n=r.properties.filter(a=>t.ts.isPropertyAssignment(a)&&t.ts.isIdentifier(a.name)),s=n.findIndex(a=>t.ts.isIdentifier(a.name)&&a.name.text==="inputs"),o=[...e.inputs??[]];if(s>-1){if(o.length===0)return ss(t,r,"inputs",null);let a=n[s];t.ts.isPropertyAssignment(a)&&t.ts.isArrayLiteralExpression(a.initializer)&&(i=a.initializer)}return o.length===0?r:(i=O1(t,i||t.ts.factory.createArrayLiteralExpression(),o),s>-1?n[s]=t.ts.factory.updatePropertyAssignment(n[s],n[s].name,i):n.push(t.ts.factory.createPropertyAssignment("inputs",i)),t.ts.factory.updateObjectLiteralExpression(r,n))}function F1(t){return{name:t.name,description:t.description,image:t.image,inputs:(t.inputs||[]).filter(e=>e.isRegistered).map(k1),...t.meta?{meta:{...t.meta}}:{}}}function k1(t){let r={name:t.name,type:t.type};return(Bt(t.defaultValue)||fo(t.defaultValue)||is(t.defaultValue))&&(r.defaultValue=t.defaultValue),Bt(t.friendlyName)&&(r.friendlyName=t.friendlyName),Bt(t.helperText)&&(r.helperText=t.helperText),t.required===!0&&(r.required=!0),Array.isArray(t.enum)&&(r.enum=t.enum),t.hideFromUI===!0&&(r.hideFromUI=!0),typeof t.meta=="object"&&t.meta!=null&&Object.keys(t.meta).length>0&&(r.meta=t.meta),r}function O1(t,r,e){let i=r.elements.filter(n=>{if(!t.ts.isObjectLiteralExpression(n))return!1;let s=n.properties.find(a=>Fe(t,a)==="name");if(!s)return!1;let o=s.initializer;return t.ts.isStringLiteral(o)?e.some(a=>a.name===o.text):!1});for(let n of e)i=R1(t,i,n);return i.sort((n,s)=>{let o=n.properties.find(d=>Fe(t,d)==="name"),a=s.properties.find(d=>Fe(t,d)==="name"),l=o?.initializer,u=a?.initializer,c=l&&t.ts.isStringLiteral(l)?l.text:"zz",p=u&&t.ts.isStringLiteral(u)?u.text:"zz";return c.toLowerCase().localeCompare(p.toLowerCase())}),t.ts.factory.updateArrayLiteralExpression(r,i)}function R1(t,r,e){let i=r.findIndex(n=>n.properties.some(s=>{let o=Fe(t,s);return t.ts.isPropertyAssignment(s)&&o==="name"&&t.ts.isStringLiteral(s.initializer)&&s.initializer.text===e.name}));if(i>-1)r[i]=Dg(t,r[i],e);else{let n=Dg(t,t.ts.factory.createObjectLiteralExpression([t.ts.factory.createPropertyAssignment("name",t.ts.factory.createStringLiteral(e.name))],!0),e);r.push(n)}return r}function Dg(t,r,e){let i=r.properties.filter(s=>t.ts.isPropertyAssignment(s)),n=Object.keys(e).filter(s=>s!=="isRegistered");for(let s of n)i=L1(t,i,e,s);return i=$1(t,i.filter(s=>{let o=Fe(t,s);return n.includes(o)})),t.ts.factory.updateObjectLiteralExpression(r,i)}function L1(t,r,e,i){let n=r.findIndex(s=>t.ts.isIdentifier(s.name)&&s.name.text===i);return n>-1?r[n]=t.ts.factory.updatePropertyAssignment(r[n],r[n].name,go(t,e[i])):r.push(t.ts.factory.createPropertyAssignment(i,go(t,e[i]))),r}function ar(t,r){for(let e of r){let i=t.inputs.findIndex(n=>n.name===e.name);i>-1?(e.isRegistered||!t.inputs[i].isRegistered)&&(t.inputs[i]=e):t.inputs.push(e)}t.acceptsChildren=zc(t)}function M1(t){let r=Vc(t.type),e={name:t.name.trim(),type:r.builderType};return Bt(t.friendlyName)&&t.friendlyName.trim()!==t.name.trim()&&(e.friendlyName=t.friendlyName),(Bt(t.defaultValue)||fo(t.defaultValue)||is(t.defaultValue))&&(e.defaultValue=t.defaultValue),Bt(t.helperText)&&(e.helperText=t.helperText),is(t.required)&&(e.required=t.required),typeof t.meta=="object"&&t.meta!=null&&Object.keys(t.meta).length>0&&(e.meta=t.meta),Array.isArray(t.enum)&&t.enum.length>0&&(e.enum=t.enum),t.hideFromUI===!0&&(e.hideFromUI=!0),Wc(e)}function zc(t){let r=t.inputs.some(i=>i.name==="children"),e=t.inputs.some(i=>i.meta?.ts==="ReactNode");return!!(r||e||t.acceptsChildren===!0)}function Wc(t){if(t.name==="children"&&(t.hideFromUI=!0,delete t.required),t.type==="object"&&t.defaultValue==null&&(t.hideFromUI=!0),t.type==="list"&&t.defaultValue==null&&(t.hideFromUI=!0),t.meta){let r=t.meta.ts;typeof r=="string"&&(r=r.trim(),r.endsWith("ReactNode")&&(r="ReactNode"),t.meta.ts=r,r==="ReactNode"&&(t.hideFromUI=!0))}return t}function B1(t,r){let e=[...r.properties].sort((i,n)=>{let s=Fe(t,i)||"zz",o=Fe(t,n)||"zz";if(s==="inputs")return 1;let a=xg.indexOf(s),l=xg.indexOf(o);return a>-1?l>-1&&a>l?1:-1:l>-1?a>-1&&l<a?-1:1:s.localeCompare(o)});return t.ts.factory.updateObjectLiteralExpression(r,e)}var xg=["component","name","description"];function $1(t,r){return[...r].sort((i,n)=>{let s=Fe(t,i)||"zz",o=Fe(t,n)||"zz",a=Eg.indexOf(s),l=Eg.indexOf(o);return a>-1?l>-1&&a>l?1:-1:l>-1?a>-1&&l<a?-1:1:s.localeCompare(o)})}var Eg=["name","type"];function os(t,r){for(let e of r.properties){if(!t.ts.isPropertyAssignment(e)||!t.ts.isIdentifier(e.name))continue;if(Fe(t,e)==="canHaveChildren"){let{initializer:n}=e;return n.kind===t.ts.SyntaxKind.TrueKeyword}}return!1}function Cg(t,r){let e=`Builder.registerComponent(
|
|
185
185
|
`;if(t.appDir)r.acceptsChildren?e+=` withChildren(${r.importName}),
|
|
@@ -202,7 +202,7 @@ ${e}=${i}
|
|
|
202
202
|
`+n)),t=n+`
|
|
203
203
|
`+t}return t.trim()+`
|
|
204
204
|
`}function Yc(t,r){return r.sort((e,i)=>{let n=Og(t,e),s=Og(t,i);return n.toLocaleLowerCase().localeCompare(s.toLocaleLowerCase())})}function Og(t,r){let e=r.importClause;if(e){let i=e.namedBindings;if(i&&t.ts.isNamedImports(i)&&i.elements.length>0)return i.elements[0].name.text;if(e.name)return e.name.text}return r.moduleSpecifier&&t.ts.isStringLiteral(r.moduleSpecifier)?r.moduleSpecifier.text:""}function Lg(t){return typeof t=="string"&&!t.includes("'use client'")&&!t.includes(`"use client"'`)&&(t=`"use client"
|
|
205
|
-
${t}`),t}function Mg(t,r){let e=r.statements.filter(i=>!(t.ts.isExpressionStatement(i)&&t.ts.isStringLiteral(i.expression)&&t.ts.isStringLiteral(i.expression)&&i.expression.text==="use client"));return t.ts.factory.updateSourceFile(r,e)}function Jr(t,r){return r.sort((e,i)=>{if(t.ts.isObjectLiteralExpression(e)&&t.ts.isObjectLiteralExpression(i)){let n=Rg(t,e),s=Rg(t,i);return n.toLocaleLowerCase().localeCompare(s.toLocaleLowerCase())}return 1})}function Rg(t,r){let e=r.properties.find(i=>Fe(t,i)==="name");return e&&t.ts.isPropertyAssignment(e)&&t.ts.isStringLiteral(e.initializer)?e.initializer.text:"zzzz"}async function Bg(t){let r=await t.readFile(t.registryPath);return r?sI(t,r):{components:[],sourceFile:xe(t,"")}}async function sI(t,r){let e=xe(t,r);return t.sdkVersion===te.gen2?aI(t,e):oI(t,e)}async function oI(t,r){let e=[];for(let i=0;i<r.statements.length;i++){let n=r.statements[i];if(!t.ts.isExpressionStatement(n))continue;let s=n.expression;if(!t.ts.isCallExpression(s))continue;let o=s.expression;if(!t.ts.isPropertyAccessExpression(o))continue;let a=o.expression;if(!t.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(!t.ts.isObjectLiteralExpression(c))continue;let p=u[0];if(t.ts.isCallExpression(p)){let d=t.ts.isIdentifier(p.expression)&&p.expression.text;if(d==="withChildren"){let f=Zc(t,p.arguments[0]);if(t.ts.isCallExpression(f)){let g=await Xc(t,i,f,c,!0);g&&e.push(g)}else{let g=f;if(t.ts.isIdentifier(g)){let m=await Qc(t,r,i,g,c,!0);m&&e.push(m)}}continue}if(d==="dynamic"){let f=await Xc(t,i,p,c,!1);f&&e.push(f);continue}let h=Zc(t,p.arguments[0]);if(t.ts.isCallExpression(h)&&t.ts.isIdentifier(h.expression)&&h.expression.text==="dynamic"){let f=await Xc(t,i,h,c,!1);f&&e.push(f);continue}if(t.ts.isIdentifier(h)){let f=await Qc(t,r,i,h,c,!1);f&&e.push(f);continue}continue}if(t.ts.isIdentifier(p)){let d=await Qc(t,r,i,p,c,!1);d&&e.push(d);continue}}return{sourceFile:r,components:Ht(e)}}function Zc(t,r){return t.ts.isCallExpression(r)?(t.ts.isIdentifier(r.expression)&&r.expression.text)==="dynamic"?r:Zc(t,r.arguments[0]):r}async function Xc(t,r,e,i,n){let s={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],nodeIndex:r,acceptsChildren:n},o=e.arguments;if(o.length===0)return null;let a=o[0];if(!t.ts.isArrowFunction(a))return null;let l=a.body;if(t.ts.isCallExpression(l)){if(l.expression.kind!==t.ts.SyntaxKind.ImportKeyword||l.arguments.length!==1)return null;let c=l.arguments[0];if(!t.ts.isStringLiteral(c))return null;let p=c.text,d=await ds(t,p);s.filePath=d,s.relFilePath=t.relative(t.getAppRootDir(),s.filePath),await t.exists(d)?s.importPath=Ue(t,s.filePath):(s.externalImportPath=p,s.importPath=s.externalImportPath),s.name=yr(t,s.filePath),s.importName="default",s.exportName="default",s.exportType="default"}else if(t.ts.isPropertyAccessExpression(l)){let u=l.expression;if(!t.ts.isParenthesizedExpression(u))return null;let c=u.expression;if(!t.ts.isAwaitExpression(c))return null;let p=c.expression;if(!t.ts.isCallExpression(p)||p.expression.kind!==t.ts.SyntaxKind.ImportKeyword||p.arguments.length!==1)return null;let h=p.arguments[0];if(!t.ts.isStringLiteral(h)||!t.ts.isIdentifier(l.name))return null;let f=h.text,g=await ds(t,f);s.filePath=g,s.relFilePath=t.relative(t.getAppRootDir(),s.filePath),await t.exists(g)?s.importPath=Ue(t,s.filePath):(s.externalImportPath=f,s.importPath=s.externalImportPath),s.name=Ve(l.name.text),s.importName=l.name.text,s.exportName=l.name.text,s.exportType="named"}else return null;return s=Jt(t,s,i),s.displayFilePath=Ne(t,s.filePath),s.filePath&&s.exportName&&(s.id=await je(t,s.filePath,s.exportName,s.externalImportPath)),s}async function Qc(t,r,e,i,n,s){let o={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],nodeIndex:e,acceptsChildren:s},a=r.statements.filter(u=>t.ts.isImportDeclaration(u)),l=a.find(u=>u.importClause&&u.importClause.name?.text===i.text);if(l){let u=l.moduleSpecifier;if(!t.ts.isStringLiteral(u))return null;let c=await ds(t,u.text);o.filePath=c,o.relFilePath=t.relative(t.getAppRootDir(),o.filePath),await t.exists(c)?o.importPath=Ue(t,o.filePath):(o.externalImportPath=u.text,o.importPath=o.externalImportPath),o.name=yr(t,o.filePath),o.importName=i.text,o.exportName="default",o.exportType="default"}else{let u=a.find(d=>!d.importClause||!d.importClause.namedBindings||!t.ts.isNamedImports(d.importClause.namedBindings)?!1:d.importClause.namedBindings.elements.some(h=>h.name.text===i.text));if(!u)return null;let c=u.moduleSpecifier;if(!t.ts.isStringLiteral(c))return null;let p=await ds(t,c.text);o.filePath=p,o.relFilePath=t.relative(t.getAppRootDir(),o.filePath),await t.exists(p)?o.importPath=Ue(t,o.filePath):(o.externalImportPath=c.text,o.importPath=o.externalImportPath),o.name=Ve(i.text),o.importName=i.text,o.exportName=i.text,o.exportType="named"}return o=Jt(t,o,n),o.displayFilePath=Ne(t,o.filePath),o.filePath&&o.exportName&&(o.id=await je(t,o.filePath,o.exportName,o.externalImportPath)),o}function ds(t,r){return Do(t,t.normalize(t.resolve(t.dirname(t.registryPath),r)))}function $g(t,r,e){let i=!1,n=0,s=[...r.statements];for(let u=0;u<s.length;u++){let c=s[u];if(t.ts.isImportDeclaration(c)){n=u;continue}if(!t.ts.isExpressionStatement(c))continue;let p=c.expression;if(!t.ts.isCallExpression(p))continue;let d=p.expression;if(!t.ts.isPropertyAccessExpression(d))continue;let h=d.expression;if(!t.ts.isIdentifier(h)||h.text!=="builder")continue;if(d.name.text=="init"){i=!0;break}else continue}if(i)return r;let o=t.ts.factory.createPropertyAccessExpression(t.ts.factory.createPropertyAccessExpression(t.ts.factory.createIdentifier("process"),t.ts.factory.createIdentifier("env")),t.ts.factory.createIdentifier(zr)),a=e?t.ts.factory.createNonNullExpression(o):o,l=t.ts.factory.createExpressionStatement(t.ts.factory.createCallExpression(t.ts.factory.createPropertyAccessExpression(t.ts.factory.createIdentifier("builder"),t.ts.factory.createIdentifier("init")),void 0,[a]));return s.splice(n+1,0,l),t.ts.factory.updateSourceFile(r,s)}async function aI(t,r){let e=[],i=lt(t,r,"CUSTOM_COMPONENTS");return i&&await Promise.all(i.arrayLiteralExp.elements.map(async(n,s)=>{let o=await ep(t,r,n);o&&(o.nodeIndex=s,e.push(o))})),{sourceFile:r,components:Ht(e)}}async function ep(t,r,e){if(!t.ts.isObjectLiteralExpression(e))return null;let i={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],acceptsChildren:!1};os(t,e)&&(i.acceptsChildren=!0);for(let s of e.properties){if(!t.ts.isPropertyAssignment(s)||!t.ts.isIdentifier(s.name))continue;if(Fe(t,s)==="component"){let a,{initializer:l}=s;if(t.ts.isCallExpression(l)&&(t.ts.isIdentifier(l.expression)&&l.expression.text)==="dynamic"){let h=l.arguments;if(h.length===0)return null;let f=h[0];if(!t.ts.isArrowFunction(f))return null;let g=f.body;if(t.ts.isCallExpression(g)){if(g.expression.kind!==t.ts.SyntaxKind.ImportKeyword||g.arguments.length!==1)return null;let y=g.arguments[0];if(!t.ts.isStringLiteral(y))return null;let b=y.text,C=await ds(t,b);i.filePath=C,i.relFilePath=t.relative(t.getAppRootDir(),i.filePath),await t.exists(C)?i.importPath=Ue(t,i.filePath):(i.externalImportPath=b,i.importPath=i.externalImportPath),i.name=yr(t,i.filePath),i.importName="default",i.exportName="default",i.exportType="default"}else if(t.ts.isPropertyAccessExpression(g)){let m=g.expression;if(!t.ts.isParenthesizedExpression(m))return null;let y=m.expression;if(!t.ts.isAwaitExpression(y))return null;let b=y.expression;if(!t.ts.isCallExpression(b)||b.expression.kind!==t.ts.SyntaxKind.ImportKeyword||b.arguments.length!==1)return null;let D=b.arguments[0];if(!t.ts.isStringLiteral(D)||!t.ts.isIdentifier(g.name))return null;let x=D.text,E=await ds(t,x);i.filePath=E,i.relFilePath=t.relative(t.getAppRootDir(),i.filePath),await t.exists(E)?i.importPath=Ue(t,i.filePath):(i.externalImportPath=x,i.importPath=i.externalImportPath),i.name=Ve(g.name.text),i.importName=g.name.text,i.exportName=g.name.text,i.exportType="named"}else return null;return i=Jt(t,i,e),i.displayFilePath=Ne(t,i.filePath),i.filePath&&i.exportName&&(i.id=await je(t,i.filePath,i.exportName,i.externalImportPath)),i}if(t.ts.isIdentifier(l)&&(a=l.text),!a)continue;i.name===""&&(i.name=Ve(a)),i.importName=a;let u=await Wr(t,t.registryPath,r,a);if(!u)continue;i.filePath=u.filePath,i.relFilePath=u.relFilePath,await t.exists(u.filePath)?i.importPath=Ue(t,u.filePath):(i.externalImportPath=u.importPath,i.importPath=i.externalImportPath),i.importPath=Ue(t,u.filePath),i.displayFilePath=u.displayFilePath,i.exportType=u.exportType;let c=r.statements.filter(d=>t.ts.isImportDeclaration(d)),p=c.find(d=>d.importClause&&d.importClause.name?.text===a);if(p){let d=p.moduleSpecifier;if(!t.ts.isStringLiteral(d))return null;i.exportName="default"}else{let d=c.find(f=>!f.importClause||!f.importClause.namedBindings||!t.ts.isNamedImports(f.importClause.namedBindings)?!1:f.importClause.namedBindings.elements.some(g=>g.name.text===a));if(!d)return null;let h=d.moduleSpecifier;if(!t.ts.isStringLiteral(h))return null;i.exportName=a}continue}}return i=Jt(t,i,e),i.filePath&&i.exportName&&(i.id=await je(t,i.filePath,i.exportName,i.externalImportPath)),i}function Yr(t,r){let e=[...r.statements],i=!1;for(let n=r.statements.length-1;n>=0;n--){let s=r.statements[n];if(t.ts.isImportDeclaration(s)&&s.importClause){let o=!1,a=s.importClause.namedBindings;if(a&&t.ts.isNamedImports(a)&&a.elements){let l=[...a.elements];for(let u=l.length-1;u>=0;u--){let c=l[u];if(t.ts.isImportSpecifier(c)){let p=c.name;if(p&&t.ts.isIdentifier(p)){let d=p.text;Ug(t,r,d)||l.splice(u,1)}}}if(l.length===0)o=!0;else if(a.elements.length!==l.length){let u=t.ts.factory.updateImportClause(s.importClause,!1,s.importClause.name,t.ts.factory.createNamedImports(l)),c=t.ts.factory.updateImportDeclaration(s,void 0,u,s.moduleSpecifier,void 0);e[n]=c,i=!0}}else if(s.importClause.name&&t.ts.isIdentifier(s.importClause.name)){let l=s.importClause.name.text;Ug(t,r,l)||(o=!0)}o&&(e.splice(n,1),i=!0)}}return i?t.ts.factory.updateSourceFile(r,e):r}function Ug(t,r,e){let i=!1;function n(s){if(!t.ts.isImportDeclaration(s)){if(t.ts.isIdentifier(s)&&s.text===e){i=!0;return}t.ts.forEachChild(s,n)}}return t.ts.forEachChild(r,n),i}function Xr(t,r,e,i,n,s,o){let a=null,l=null,u=null,c=-1;r=or(r),e=or(e);let p=r.find(h=>h.id===t),d=e.find(h=>h.id===t);if(i)d||(a={...or(p),inputs:or(p.inputs).map(h=>(h.isRegistered=!0,h))},c=e.length,e.push(a));else if(typeof d?.nodeIndex=="number"&&d.nodeIndex>-1){if(n)c=d.nodeIndex,l=or(d),e=e.filter(h=>h.id!==t);else if(s!=null)lI(d,s),c=d.nodeIndex,u=d;else if(o!=null){let h=d.inputs.find(f=>f.name===o.name);h&&(o.registerInput===!1?h.isRegistered=!1:(uI(h,o),h.isRegistered=!0),u=d,c=d.nodeIndex)}}return{addCmpToRegistry:a,removeCmpFromRegistry:l,updateRegisteredCmp:u,nodeIndex:c,components:Pr(r,e)}}function Pr(t,r){let e=Ht([...r.map(i=>(i.isRegistered=!0,i)),...t.filter(i=>!r.some(n=>n.id===i.id)).map(i=>(i.isRegistered=!1,i))]);return e.forEach(i=>{i.inputs=i.inputs.map(Wc),i.inputs.sort((o,a)=>o.name.toLowerCase().localeCompare(a.name.toLowerCase()));let n=r.find(o=>o.id===i.id);n&&(n.acceptsChildren=zc(i));let s=t.find(o=>o.id===i.id&&o.externalImportPath);s&&(i.filePath=s.filePath,i.relFilePath=s.relFilePath)}),e}function lI(t,r){Bt(r.name)?t.name=r.name:r.name===null&&(t.name=t.importName),Bt(r.description)?t.description=r.description:r.description===null&&delete t.description,Bt(r.image)?t.image=r.image:r.image===null&&delete t.image}function uI(t,r){Bt(r.type)&&(t.type=r.type),Bt(r.friendlyName)?t.friendlyName=r.friendlyName:r.friendlyName===null&&delete t.friendlyName,Bt(r.defaultValue)||fo(r.defaultValue)||is(r.defaultValue)?t.defaultValue=r.defaultValue:r.defaultValue===null&&delete t.defaultValue,Bt(r.helperText)?t.helperText=r.helperText:r.helperText===null&&delete t.helperText,r.required===!0?t.required=r.required:(r.required===null||r.required===!1)&&delete t.required}async function sn(t){let r=new Set,e=async n=>{let s=await t.readdir(n);await Promise.all(s.map(async o=>{if(o.startsWith(".")||o==="node_modules")return;let a=t.join(n,o),l=t.extname(o).toLowerCase();if(l===".tsx"||l===".jsx"||l===".ts"||l===".js"){r.add(a);return}(await t.stat(a)).isDirectory()&&await e(a)}))};return await e(t.getAppRootDir()),await dt(t,[...r])}function Qr(t,r,e){return ls(t,r,e.variableName)?r:cI(t,r,e)}function cI(t,r,e){let i=typeof e.arrayType=="string"?t.ts.factory.createArrayTypeNode(t.ts.factory.createTypeReferenceNode(e.arrayType,void 0)):void 0,n=t.ts.factory.createArrayLiteralExpression([]),s=t.ts.factory.createVariableDeclaration(e.variableName,void 0,i,n),o=t.ts.factory.createVariableDeclarationList([s],t.ts.NodeFlags.Const),a=t.ts.factory.createModifier(t.ts.SyntaxKind.ExportKeyword),l=t.ts.factory.createVariableStatement([a],o),u=[...r.statements,l];return t.ts.factory.updateSourceFile(r,u)}async function Zr(t,r,e,i,n,s,o,a){let l=await sn(t),[u,c,p,d]=await Promise.all([kg(t,l),Bg(t),sr(t),ho(t)]),h=u.map(C=>C.cmpInfo),f=c.components,g={components:Pr(h,f),registryPath:t.registryPath,registryDisplayPath:Ne(t,t.registryPath),frameworks:t.getFrameworks(),dependencies:Gr(h),publicApiKey:d.envValue??void 0,devToolsVersion:t.version};if(a)return g.components=await cs(t,g.components),g;let m=!1,y=c.sourceFile,b=Array.isArray(r)?r:typeof r=="string"?[r]:[];if(b.length>0){let C=b.map(E=>{let w=u.find(R=>R.cmpInfo.id===E);if(!w)throw new Error(`Component ${E} not found`);return w}),D=Array.from(new Set(C.map(E=>E.cmpInfo.filePath))),x=await dt(t,D);for(let E of C){let w=g.components.find(L=>L.id===E.cmpInfo.id),R=await ps(t,E,x,t.registryPath===E.cmpInfo.filePath||gr(E.cmpInfo.filePath));ar(w,R);let M=h.findIndex(L=>L.id===E.cmpInfo.id);h[M].inputs=R;let T=Xr(E.cmpInfo.id,h,f,e,i,n,s);if(t.sdkVersion===te.gen2){let{elements:L,elmIndex:Q,statementIndex:ie,statement:re,variableDeclaration:Z}=await fI(t,y,E);if(T.addCmpToRegistry)L.push(dI(t,T.addCmpToRegistry)),m=!0;else if(T.removeCmpFromRegistry)L.splice(Q,1),m=!0;else if(T.updateRegisteredCmp){let Pe=pt(t,L[Q],T.updateRegisteredCmp);L[Q]=t.ts.factory.updateObjectLiteralExpression(Pe,[qg(t,T.updateRegisteredCmp),...Pe.properties.slice(1)]),m=!0}if(m&&o){let Pe=[...y.statements];Pe[ie]=t.ts.factory.updateVariableStatement(re,re.modifiers,t.ts.factory.updateVariableDeclarationList(re.declarationList,[t.ts.factory.updateVariableDeclaration(Z,Z.name,Z.exclamationToken,Z.type,t.ts.factory.createArrayLiteralExpression(Jr(t,L)))])),y=t.ts.factory.updateSourceFile(y,Pe),y=jg(t,T,y),y=Ce(t,y,{namedImports:["RegisteredComponent"],importPath:"@builder.io/sdk-react",isTypeOnly:!0}),y=Qr(t,y,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),g.components=T.components,f=T.components.filter(_=>_.isRegistered)}}else{let L=[...y.statements];T.addCmpToRegistry?(L.push(Cg(t,T.addCmpToRegistry)),m=!0):T.removeCmpFromRegistry?(L.splice(T.nodeIndex,1),m=!0):T.updateRegisteredCmp&&(L[T.nodeIndex]=Gc(t,L[T.nodeIndex],T.updateRegisteredCmp),m=!0),m&&o&&(y=t.ts.factory.updateSourceFile(y,L),y=Ce(t,y,{namedImports:["Builder","builder"],importPath:"@builder.io/react"}),y=$g(t,y,p),y=jg(t,T,y),w?.acceptsChildren&&(y=Ce(t,y,{namedImports:["withChildren"],importPath:"@builder.io/react"})),g.components=T.components,f=T.components.filter(Q=>Q.isRegistered))}}}if(m&&o){y=Yr(t,y),y=Hr(t,y),t.appDir&&(y=Mg(t,y));let C=gt(t,y);C=Ar(C),t.appDir&&(C=Lg(C)),C=await t.formatCode(t.registryPath,C),await t.writeFile(t.registryPath,C)}return g}function qg(t,r){let e=t.ts.factory.createIdentifier(r.importName);return t.appDir?t.ts.factory.createPropertyAssignment("component",e):t.ts.factory.createPropertyAssignment("component",hI(t,r))}function pI(t){return t.ts.factory.createPropertyAssignment("canHaveChildren",t.ts.factory.createTrue())}function dI(t,r){return pt(t,t.ts.factory.createObjectLiteralExpression([qg(t,r),...r.acceptsChildren?[pI(t)]:[]],!0),r)}async function fI(t,r,e){let i=lt(t,r,"CUSTOM_COMPONENTS");if(!i)throw new Error(`Exported name of the Builder registry must be "CUSTOM_COMPONENTS". Please update your Builder registry file: ${t.registryPath}`);let n=i.arrayLiteralExp.elements.filter(o=>t.ts.isObjectLiteralExpression(o)),s=-1;for(let o=0;o<n.length;o++)if((await ep(t,r,n[o]))?.id===e.cmpInfo.id){s=o;break}return{...i,elements:n,elmIndex:s}}function jg(t,r,e){if(t.appDir){let i=r.addCmpToRegistry||r.updateRegisteredCmp;if(i){let n=i.externalImportPath?i.externalImportPath:Se(t,t.registryPath,i.filePath);i.exportType==="default"?e=Ce(t,e,{defaultImport:i.importName,importPath:n}):i.exportType==="named"&&(e=Ce(t,e,{namedImports:[i.importName],importPath:n}))}}else e=Ce(t,e,{defaultImport:"dynamic",importPath:"next/dynamic"});return e}function hI(t,r){let e=r.externalImportPath?r.externalImportPath:Se(t,t.registryPath,r.filePath),i=r.exportName!=="default",n;i?n=t.ts.factory.createPropertyAccessExpression(t.ts.factory.createAwaitExpression(t.ts.factory.createCallExpression(t.ts.factory.createIdentifier("import"),void 0,[t.ts.factory.createStringLiteral(e)])),t.ts.factory.createIdentifier(r.exportName)):n=t.ts.factory.createCallExpression(t.ts.factory.createIdentifier("import"),void 0,[t.ts.factory.createStringLiteral(e)]);let s=t.ts.factory.createArrowFunction(i?[t.ts.factory.createModifier(t.ts.SyntaxKind.AsyncKeyword)]:void 0,void 0,[],void 0,t.ts.factory.createToken(t.ts.SyntaxKind.EqualsGreaterThanToken),n);return t.ts.factory.createCallExpression(t.ts.factory.createIdentifier("dynamic"),void 0,[s])}async function Vg(t){let r=[],e=await DI(t,r);return await Jg(t,r,e),t.appDir?(t.debug(`ensure builder setup for next.js app ${t.appDir}`),await gI(t,t.appDir,r)):t.pagesDir&&(t.debug(`ensure builder setup for next.js pages ${t.pagesDir}`),await yI(t,t.pagesDir,r)),r}async function zg(t){let r=[];return await Jg(t,r),t.appDir?(t.debug(`ensure figma-imports setup for next.js app ${t.appDir}`),await mI(t,t.appDir,r)):t.pagesDir&&(t.debug(`ensure figma-imports setup for next.js pages ${t.pagesDir}`),await bI(t,t.pagesDir,r)),r}async function mI(t,r,e){let i=`page.${t.typescriptEnabled?"tsx":"jsx"}`,n=t.join(r,"figma-imports",i);if(!await t.exists(n)){let s=await t.formatCode(n,Gg({sys:t,routePath:n,modelName:"figma-imports"}));await t.writeFile(n,s),e.push({filePath:n,modifiedType:"create"})}if(!await t.exists(t.builderComponentPath)){let s=await t.formatCode(t.builderComponentPath,Wg(t));await t.writeFile(t.builderComponentPath,s),e.push({filePath:t.builderComponentPath,modifiedType:"create"})}}async function gI(t,r,e){let i=`page.${t.typescriptEnabled?"tsx":"jsx"}`,n=t.join(r,"[...page]",i);if(!await t.exists(n)){let s=await t.formatCode(n,Gg({sys:t,routePath:n,modelName:"page"}));await t.writeFile(n,s),e.push({filePath:n,modifiedType:"create"})}if(!await t.exists(t.builderComponentPath)){let s=await t.formatCode(t.builderComponentPath,Wg(t));await t.writeFile(t.builderComponentPath,s),e.push({filePath:t.builderComponentPath,modifiedType:"create"})}}function Wg(t){let r=t.typescriptEnabled;return t.sdkVersion===te.gen2?`
|
|
205
|
+
${t}`),t}function Mg(t,r){let e=r.statements.filter(i=>!(t.ts.isExpressionStatement(i)&&t.ts.isStringLiteral(i.expression)&&t.ts.isStringLiteral(i.expression)&&i.expression.text==="use client"));return t.ts.factory.updateSourceFile(r,e)}function Jr(t,r){return r.sort((e,i)=>{if(t.ts.isObjectLiteralExpression(e)&&t.ts.isObjectLiteralExpression(i)){let n=Rg(t,e),s=Rg(t,i);return n.toLocaleLowerCase().localeCompare(s.toLocaleLowerCase())}return 1})}function Rg(t,r){let e=r.properties.find(i=>Fe(t,i)==="name");return e&&t.ts.isPropertyAssignment(e)&&t.ts.isStringLiteral(e.initializer)?e.initializer.text:"zzzz"}async function Bg(t){let r=await t.readFile(t.registryPath);return r?sI(t,r):{components:[],sourceFile:xe(t,"")}}async function sI(t,r){let e=xe(t,r);return t.sdkVersion===te.gen2?aI(t,e):oI(t,e)}async function oI(t,r){let e=[];for(let i=0;i<r.statements.length;i++){let n=r.statements[i];if(!t.ts.isExpressionStatement(n))continue;let s=n.expression;if(!t.ts.isCallExpression(s))continue;let o=s.expression;if(!t.ts.isPropertyAccessExpression(o))continue;let a=o.expression;if(!t.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(!t.ts.isObjectLiteralExpression(c))continue;let p=u[0];if(t.ts.isCallExpression(p)){let d=t.ts.isIdentifier(p.expression)&&p.expression.text;if(d==="withChildren"){let f=Zc(t,p.arguments[0]);if(t.ts.isCallExpression(f)){let g=await Xc(t,i,f,c,!0);g&&e.push(g)}else{let g=f;if(t.ts.isIdentifier(g)){let m=await Qc(t,r,i,g,c,!0);m&&e.push(m)}}continue}if(d==="dynamic"){let f=await Xc(t,i,p,c,!1);f&&e.push(f);continue}let h=Zc(t,p.arguments[0]);if(t.ts.isCallExpression(h)&&t.ts.isIdentifier(h.expression)&&h.expression.text==="dynamic"){let f=await Xc(t,i,h,c,!1);f&&e.push(f);continue}if(t.ts.isIdentifier(h)){let f=await Qc(t,r,i,h,c,!1);f&&e.push(f);continue}continue}if(t.ts.isIdentifier(p)){let d=await Qc(t,r,i,p,c,!1);d&&e.push(d);continue}}return{sourceFile:r,components:Ht(e)}}function Zc(t,r){return t.ts.isCallExpression(r)?(t.ts.isIdentifier(r.expression)&&r.expression.text)==="dynamic"?r:Zc(t,r.arguments[0]):r}async function Xc(t,r,e,i,n){let s={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],nodeIndex:r,acceptsChildren:n},o=e.arguments;if(o.length===0)return null;let a=o[0];if(!t.ts.isArrowFunction(a))return null;let l=a.body;if(t.ts.isCallExpression(l)){if(l.expression.kind!==t.ts.SyntaxKind.ImportKeyword||l.arguments.length!==1)return null;let c=l.arguments[0];if(!t.ts.isStringLiteral(c))return null;let p=c.text,d=await ds(t,p);s.filePath=d,s.relFilePath=t.relative(t.getAppRootDir(),s.filePath),await t.exists(d)?s.importPath=Ue(t,s.filePath):(s.externalImportPath=p,s.importPath=s.externalImportPath),s.name=yr(t,s.filePath),s.importName="default",s.exportName="default",s.exportType="default"}else if(t.ts.isPropertyAccessExpression(l)){let u=l.expression;if(!t.ts.isParenthesizedExpression(u))return null;let c=u.expression;if(!t.ts.isAwaitExpression(c))return null;let p=c.expression;if(!t.ts.isCallExpression(p)||p.expression.kind!==t.ts.SyntaxKind.ImportKeyword||p.arguments.length!==1)return null;let h=p.arguments[0];if(!t.ts.isStringLiteral(h)||!t.ts.isIdentifier(l.name))return null;let f=h.text,g=await ds(t,f);s.filePath=g,s.relFilePath=t.relative(t.getAppRootDir(),s.filePath),await t.exists(g)?s.importPath=Ue(t,s.filePath):(s.externalImportPath=f,s.importPath=s.externalImportPath),s.name=Ve(l.name.text),s.importName=l.name.text,s.exportName=l.name.text,s.exportType="named"}else return null;return s=Jt(t,s,i),s.displayFilePath=Ne(t,s.filePath),s.filePath&&s.exportName&&(s.id=await je(t,s.filePath,s.exportName,s.externalImportPath)),s}async function Qc(t,r,e,i,n,s){let o={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],nodeIndex:e,acceptsChildren:s},a=r.statements.filter(u=>t.ts.isImportDeclaration(u)),l=a.find(u=>u.importClause&&u.importClause.name?.text===i.text);if(l){let u=l.moduleSpecifier;if(!t.ts.isStringLiteral(u))return null;let c=await ds(t,u.text);o.filePath=c,o.relFilePath=t.relative(t.getAppRootDir(),o.filePath),await t.exists(c)?o.importPath=Ue(t,o.filePath):(o.externalImportPath=u.text,o.importPath=o.externalImportPath),o.name=yr(t,o.filePath),o.importName=i.text,o.exportName="default",o.exportType="default"}else{let u=a.find(d=>!d.importClause||!d.importClause.namedBindings||!t.ts.isNamedImports(d.importClause.namedBindings)?!1:d.importClause.namedBindings.elements.some(h=>h.name.text===i.text));if(!u)return null;let c=u.moduleSpecifier;if(!t.ts.isStringLiteral(c))return null;let p=await ds(t,c.text);o.filePath=p,o.relFilePath=t.relative(t.getAppRootDir(),o.filePath),await t.exists(p)?o.importPath=Ue(t,o.filePath):(o.externalImportPath=c.text,o.importPath=o.externalImportPath),o.name=Ve(i.text),o.importName=i.text,o.exportName=i.text,o.exportType="named"}return o=Jt(t,o,n),o.displayFilePath=Ne(t,o.filePath),o.filePath&&o.exportName&&(o.id=await je(t,o.filePath,o.exportName,o.externalImportPath)),o}function ds(t,r){return Do(t,t.normalize(t.resolve(t.dirname(t.registryPath),r)))}function $g(t,r,e){let i=!1,n=0,s=[...r.statements];for(let u=0;u<s.length;u++){let c=s[u];if(t.ts.isImportDeclaration(c)){n=u;continue}if(!t.ts.isExpressionStatement(c))continue;let p=c.expression;if(!t.ts.isCallExpression(p))continue;let d=p.expression;if(!t.ts.isPropertyAccessExpression(d))continue;let h=d.expression;if(!t.ts.isIdentifier(h)||h.text!=="builder")continue;if(d.name.text=="init"){i=!0;break}else continue}if(i)return r;let o=t.ts.factory.createPropertyAccessExpression(t.ts.factory.createPropertyAccessExpression(t.ts.factory.createIdentifier("process"),t.ts.factory.createIdentifier("env")),t.ts.factory.createIdentifier(zr)),a=e?t.ts.factory.createNonNullExpression(o):o,l=t.ts.factory.createExpressionStatement(t.ts.factory.createCallExpression(t.ts.factory.createPropertyAccessExpression(t.ts.factory.createIdentifier("builder"),t.ts.factory.createIdentifier("init")),void 0,[a]));return s.splice(n+1,0,l),t.ts.factory.updateSourceFile(r,s)}async function aI(t,r){let e=[],i=lt(t,r,"CUSTOM_COMPONENTS");return i&&await Promise.all(i.arrayLiteralExp.elements.map(async(n,s)=>{let o=await ep(t,r,n);o&&(o.nodeIndex=s,e.push(o))})),{sourceFile:r,components:Ht(e)}}async function ep(t,r,e){if(!t.ts.isObjectLiteralExpression(e))return null;let i={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],acceptsChildren:!1};os(t,e)&&(i.acceptsChildren=!0);for(let s of e.properties){if(!t.ts.isPropertyAssignment(s)||!t.ts.isIdentifier(s.name))continue;if(Fe(t,s)==="component"){let a,{initializer:l}=s;if(t.ts.isCallExpression(l)&&(t.ts.isIdentifier(l.expression)&&l.expression.text)==="dynamic"){let h=l.arguments;if(h.length===0)return null;let f=h[0];if(!t.ts.isArrowFunction(f))return null;let g=f.body;if(t.ts.isCallExpression(g)){if(g.expression.kind!==t.ts.SyntaxKind.ImportKeyword||g.arguments.length!==1)return null;let y=g.arguments[0];if(!t.ts.isStringLiteral(y))return null;let b=y.text,C=await ds(t,b);i.filePath=C,i.relFilePath=t.relative(t.getAppRootDir(),i.filePath),await t.exists(C)?i.importPath=Ue(t,i.filePath):(i.externalImportPath=b,i.importPath=i.externalImportPath),i.name=yr(t,i.filePath),i.importName="default",i.exportName="default",i.exportType="default"}else if(t.ts.isPropertyAccessExpression(g)){let m=g.expression;if(!t.ts.isParenthesizedExpression(m))return null;let y=m.expression;if(!t.ts.isAwaitExpression(y))return null;let b=y.expression;if(!t.ts.isCallExpression(b)||b.expression.kind!==t.ts.SyntaxKind.ImportKeyword||b.arguments.length!==1)return null;let D=b.arguments[0];if(!t.ts.isStringLiteral(D)||!t.ts.isIdentifier(g.name))return null;let x=D.text,E=await ds(t,x);i.filePath=E,i.relFilePath=t.relative(t.getAppRootDir(),i.filePath),await t.exists(E)?i.importPath=Ue(t,i.filePath):(i.externalImportPath=x,i.importPath=i.externalImportPath),i.name=Ve(g.name.text),i.importName=g.name.text,i.exportName=g.name.text,i.exportType="named"}else return null;return i=Jt(t,i,e),i.displayFilePath=Ne(t,i.filePath),i.filePath&&i.exportName&&(i.id=await je(t,i.filePath,i.exportName,i.externalImportPath)),i}if(t.ts.isIdentifier(l)&&(a=l.text),!a)continue;i.name===""&&(i.name=Ve(a)),i.importName=a;let u=await Wr(t,t.registryPath,r,a);if(!u)continue;i.filePath=u.filePath,i.relFilePath=u.relFilePath,await t.exists(u.filePath)?i.importPath=Ue(t,u.filePath):(i.externalImportPath=u.importPath,i.importPath=i.externalImportPath),i.importPath=Ue(t,u.filePath),i.displayFilePath=u.displayFilePath,i.exportType=u.exportType;let c=r.statements.filter(d=>t.ts.isImportDeclaration(d)),p=c.find(d=>d.importClause&&d.importClause.name?.text===a);if(p){let d=p.moduleSpecifier;if(!t.ts.isStringLiteral(d))return null;i.exportName="default"}else{let d=c.find(f=>!f.importClause||!f.importClause.namedBindings||!t.ts.isNamedImports(f.importClause.namedBindings)?!1:f.importClause.namedBindings.elements.some(g=>g.name.text===a));if(!d)return null;let h=d.moduleSpecifier;if(!t.ts.isStringLiteral(h))return null;i.exportName=a}continue}}return i=Jt(t,i,e),i.filePath&&i.exportName&&(i.id=await je(t,i.filePath,i.exportName,i.externalImportPath)),i}function Yr(t,r){let e=[...r.statements],i=!1;for(let n=r.statements.length-1;n>=0;n--){let s=r.statements[n];if(t.ts.isImportDeclaration(s)&&s.importClause){let o=!1,a=s.importClause.namedBindings;if(a&&t.ts.isNamedImports(a)&&a.elements){let l=[...a.elements];for(let u=l.length-1;u>=0;u--){let c=l[u];if(t.ts.isImportSpecifier(c)){let p=c.name;if(p&&t.ts.isIdentifier(p)){let d=p.text;Ug(t,r,d)||l.splice(u,1)}}}if(l.length===0)o=!0;else if(a.elements.length!==l.length){let u=t.ts.factory.updateImportClause(s.importClause,!1,s.importClause.name,t.ts.factory.createNamedImports(l)),c=t.ts.factory.updateImportDeclaration(s,void 0,u,s.moduleSpecifier,void 0);e[n]=c,i=!0}}else if(s.importClause.name&&t.ts.isIdentifier(s.importClause.name)){let l=s.importClause.name.text;Ug(t,r,l)||(o=!0)}o&&(e.splice(n,1),i=!0)}}return i?t.ts.factory.updateSourceFile(r,e):r}function Ug(t,r,e){let i=!1;function n(s){if(!t.ts.isImportDeclaration(s)){if(t.ts.isIdentifier(s)&&s.text===e){i=!0;return}t.ts.forEachChild(s,n)}}return t.ts.forEachChild(r,n),i}function Xr(t,r,e,i,n,s,o){let a=null,l=null,u=null,c=-1;r=or(r),e=or(e);let p=r.find(h=>h.id===t),d=e.find(h=>h.id===t);if(i)d||(a={...or(p),inputs:or(p.inputs).map(h=>(h.isRegistered=!0,h))},c=e.length,e.push(a));else if(typeof d?.nodeIndex=="number"&&d.nodeIndex>-1){if(n)c=d.nodeIndex,l=or(d),e=e.filter(h=>h.id!==t);else if(s!=null)lI(d,s),c=d.nodeIndex,u=d;else if(o!=null){let h=d.inputs.find(f=>f.name===o.name);h&&(o.registerInput===!1?h.isRegistered=!1:(uI(h,o),h.isRegistered=!0),u=d,c=d.nodeIndex)}}return{addCmpToRegistry:a,removeCmpFromRegistry:l,updateRegisteredCmp:u,nodeIndex:c,components:Pr(r,e)}}function Pr(t,r){let e=Ht([...r.map(i=>(i.isRegistered=!0,i)),...t.filter(i=>!r.some(n=>n.id===i.id)).map(i=>(i.isRegistered=!1,i))]);return e.forEach(i=>{i.inputs=i.inputs.map(Wc),i.inputs.sort((o,a)=>o.name.toLowerCase().localeCompare(a.name.toLowerCase()));let n=r.find(o=>o.id===i.id);n&&(n.acceptsChildren=zc(i));let s=t.find(o=>o.id===i.id&&o.externalImportPath);s&&(i.filePath=s.filePath,i.relFilePath=s.relFilePath)}),e}function lI(t,r){Bt(r.name)?t.name=r.name:r.name===null&&(t.name=t.importName),Bt(r.description)?t.description=r.description:r.description===null&&delete t.description,Bt(r.image)?t.image=r.image:r.image===null&&delete t.image}function uI(t,r){Bt(r.type)&&(t.type=r.type),Bt(r.friendlyName)?t.friendlyName=r.friendlyName:r.friendlyName===null&&delete t.friendlyName,Bt(r.defaultValue)||fo(r.defaultValue)||is(r.defaultValue)?t.defaultValue=r.defaultValue:r.defaultValue===null&&delete t.defaultValue,Bt(r.helperText)?t.helperText=r.helperText:r.helperText===null&&delete t.helperText,r.required===!0?t.required=r.required:(r.required===null||r.required===!1)&&delete t.required}async function sn(t){let r=new Set,e=async n=>{let s=await t.readdir(n);await Promise.all(s.map(async o=>{if(o.startsWith(".")||o==="node_modules")return;let a=t.join(n,o),l=t.extname(o).toLowerCase();if(l===".tsx"||l===".jsx"||l===".ts"||l===".js"){r.add(a);return}(await t.stat(a)).isDirectory()&&await e(a)}))};return await e(t.getAppRootDir()),await dt(t,[...r])}function Qr(t,r,e){return ls(t,r,e.variableName)?r:cI(t,r,e)}function cI(t,r,e){let i=typeof e.arrayType=="string"?t.ts.factory.createArrayTypeNode(t.ts.factory.createTypeReferenceNode(e.arrayType,void 0)):void 0,n=t.ts.factory.createArrayLiteralExpression([]),s=t.ts.factory.createVariableDeclaration(e.variableName,void 0,i,n),o=t.ts.factory.createVariableDeclarationList([s],t.ts.NodeFlags.Const),a=t.ts.factory.createModifier(t.ts.SyntaxKind.ExportKeyword),l=t.ts.factory.createVariableStatement([a],o),u=[...r.statements,l];return t.ts.factory.updateSourceFile(r,u)}async function Zr(t,r,e,i,n,s,o,a){let l=await sn(t),[u,c,p,d]=await Promise.all([kg(t,l),Bg(t),sr(t),ho(t)]),h=u.map(C=>C.cmpInfo),f=c.components,g={components:Pr(h,f),registryPath:t.registryPath,registryDisplayPath:Ne(t,t.registryPath),frameworks:t.getFrameworks(),dependencies:Gr(h),publicApiKey:d.envValue??void 0,devToolsVersion:t.version};if(a)return g.components=await cs(t,g.components),g;let m=!1,y=c.sourceFile,b=Array.isArray(r)?r:typeof r=="string"?[r]:[];if(b.length>0){let C=b.map(E=>{let w=u.find(R=>R.cmpInfo.id===E);if(!w)throw new Error(`Component ${E} not found`);return w}),D=Array.from(new Set(C.map(E=>E.cmpInfo.filePath))),x=await dt(t,D);for(let E of C){let w=g.components.find(L=>L.id===E.cmpInfo.id),R=await ps(t,E,x,t.registryPath===E.cmpInfo.filePath||gr(E.cmpInfo.filePath));ar(w,R);let M=h.findIndex(L=>L.id===E.cmpInfo.id);h[M].inputs=R;let T=Xr(E.cmpInfo.id,h,f,e,i,n,s);if(t.sdkVersion===te.gen2){let{elements:L,elmIndex:Q,statementIndex:ie,statement:re,variableDeclaration:Z}=await fI(t,y,E);if(T.addCmpToRegistry)L.push(dI(t,T.addCmpToRegistry)),m=!0;else if(T.removeCmpFromRegistry)L.splice(Q,1),m=!0;else if(T.updateRegisteredCmp){let Pe=pt(t,L[Q],T.updateRegisteredCmp);L[Q]=t.ts.factory.updateObjectLiteralExpression(Pe,[qg(t,T.updateRegisteredCmp),...Pe.properties.slice(1)]),m=!0}if(m&&o){let Pe=[...y.statements];Pe[ie]=t.ts.factory.updateVariableStatement(re,re.modifiers,t.ts.factory.updateVariableDeclarationList(re.declarationList,[t.ts.factory.updateVariableDeclaration(Z,Z.name,Z.exclamationToken,Z.type,t.ts.factory.createArrayLiteralExpression(Jr(t,L)))])),y=t.ts.factory.updateSourceFile(y,Pe),y=jg(t,T,y),y=Ce(t,y,{namedImports:["RegisteredComponent"],importPath:"@builder.io/sdk-react",isTypeOnly:!0}),y=Qr(t,y,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),g.components=T.components,f=T.components.filter(_=>_.isRegistered)}}else{let L=[...y.statements];T.addCmpToRegistry?(L.push(Cg(t,T.addCmpToRegistry)),m=!0):T.removeCmpFromRegistry?(L.splice(T.nodeIndex,1),m=!0):T.updateRegisteredCmp&&(L[T.nodeIndex]=Gc(t,L[T.nodeIndex],T.updateRegisteredCmp),m=!0),m&&o&&(y=t.ts.factory.updateSourceFile(y,L),y=Ce(t,y,{namedImports:["Builder","builder"],importPath:"@builder.io/react"}),y=$g(t,y,p),y=jg(t,T,y),w?.acceptsChildren&&(y=Ce(t,y,{namedImports:["withChildren"],importPath:"@builder.io/react"})),g.components=T.components,f=T.components.filter(Q=>Q.isRegistered))}}}if(m&&o){y=Yr(t,y),y=Hr(t,y),t.appDir&&(y=Mg(t,y));let C=yt(t,y);C=Ar(C),t.appDir&&(C=Lg(C)),C=await t.formatCode(t.registryPath,C),await t.writeFile(t.registryPath,C)}return g}function qg(t,r){let e=t.ts.factory.createIdentifier(r.importName);return t.appDir?t.ts.factory.createPropertyAssignment("component",e):t.ts.factory.createPropertyAssignment("component",hI(t,r))}function pI(t){return t.ts.factory.createPropertyAssignment("canHaveChildren",t.ts.factory.createTrue())}function dI(t,r){return pt(t,t.ts.factory.createObjectLiteralExpression([qg(t,r),...r.acceptsChildren?[pI(t)]:[]],!0),r)}async function fI(t,r,e){let i=lt(t,r,"CUSTOM_COMPONENTS");if(!i)throw new Error(`Exported name of the Builder registry must be "CUSTOM_COMPONENTS". Please update your Builder registry file: ${t.registryPath}`);let n=i.arrayLiteralExp.elements.filter(o=>t.ts.isObjectLiteralExpression(o)),s=-1;for(let o=0;o<n.length;o++)if((await ep(t,r,n[o]))?.id===e.cmpInfo.id){s=o;break}return{...i,elements:n,elmIndex:s}}function jg(t,r,e){if(t.appDir){let i=r.addCmpToRegistry||r.updateRegisteredCmp;if(i){let n=i.externalImportPath?i.externalImportPath:Se(t,t.registryPath,i.filePath);i.exportType==="default"?e=Ce(t,e,{defaultImport:i.importName,importPath:n}):i.exportType==="named"&&(e=Ce(t,e,{namedImports:[i.importName],importPath:n}))}}else e=Ce(t,e,{defaultImport:"dynamic",importPath:"next/dynamic"});return e}function hI(t,r){let e=r.externalImportPath?r.externalImportPath:Se(t,t.registryPath,r.filePath),i=r.exportName!=="default",n;i?n=t.ts.factory.createPropertyAccessExpression(t.ts.factory.createAwaitExpression(t.ts.factory.createCallExpression(t.ts.factory.createIdentifier("import"),void 0,[t.ts.factory.createStringLiteral(e)])),t.ts.factory.createIdentifier(r.exportName)):n=t.ts.factory.createCallExpression(t.ts.factory.createIdentifier("import"),void 0,[t.ts.factory.createStringLiteral(e)]);let s=t.ts.factory.createArrowFunction(i?[t.ts.factory.createModifier(t.ts.SyntaxKind.AsyncKeyword)]:void 0,void 0,[],void 0,t.ts.factory.createToken(t.ts.SyntaxKind.EqualsGreaterThanToken),n);return t.ts.factory.createCallExpression(t.ts.factory.createIdentifier("dynamic"),void 0,[s])}async function Vg(t){let r=[],e=await DI(t,r);return await Jg(t,r,e),t.appDir?(t.debug(`ensure builder setup for next.js app ${t.appDir}`),await gI(t,t.appDir,r)):t.pagesDir&&(t.debug(`ensure builder setup for next.js pages ${t.pagesDir}`),await yI(t,t.pagesDir,r)),r}async function zg(t){let r=[];return await Jg(t,r),t.appDir?(t.debug(`ensure figma-imports setup for next.js app ${t.appDir}`),await mI(t,t.appDir,r)):t.pagesDir&&(t.debug(`ensure figma-imports setup for next.js pages ${t.pagesDir}`),await bI(t,t.pagesDir,r)),r}async function mI(t,r,e){let i=`page.${t.typescriptEnabled?"tsx":"jsx"}`,n=t.join(r,"figma-imports",i);if(!await t.exists(n)){let s=await t.formatCode(n,Gg({sys:t,routePath:n,modelName:"figma-imports"}));await t.writeFile(n,s),e.push({filePath:n,modifiedType:"create"})}if(!await t.exists(t.builderComponentPath)){let s=await t.formatCode(t.builderComponentPath,Wg(t));await t.writeFile(t.builderComponentPath,s),e.push({filePath:t.builderComponentPath,modifiedType:"create"})}}async function gI(t,r,e){let i=`page.${t.typescriptEnabled?"tsx":"jsx"}`,n=t.join(r,"[...page]",i);if(!await t.exists(n)){let s=await t.formatCode(n,Gg({sys:t,routePath:n,modelName:"page"}));await t.writeFile(n,s),e.push({filePath:n,modifiedType:"create"})}if(!await t.exists(t.builderComponentPath)){let s=await t.formatCode(t.builderComponentPath,Wg(t));await t.writeFile(t.builderComponentPath,s),e.push({filePath:t.builderComponentPath,modifiedType:"create"})}}function Wg(t){let r=t.typescriptEnabled;return t.sdkVersion===te.gen2?`
|
|
206
206
|
"use client";
|
|
207
207
|
import { ${r?"BuilderContent, ":""} isPreviewing, Content } from "@builder.io/sdk-react";
|
|
208
208
|
import DefaultErrorPage from "next/error";
|
|
@@ -567,7 +567,7 @@ export const CUSTOM_COMPONENTS: RegisteredComponent[] = [
|
|
|
567
567
|
|
|
568
568
|
export const CUSTOM_COMPONENTS: RegisteredComponent[] = [
|
|
569
569
|
];
|
|
570
|
-
`;async function sy(t){await tp(t);let r=await t.readFile(t.registryPath);return r?II(t,r):{components:[],sourceFile:xe(t,"")}}async function II(t,r){let e=xe(t,r);return _I(t,e)}async function _I(t,r){let e=[],i=lt(t,r,"CUSTOM_COMPONENTS");return i&&await Promise.all(i.arrayLiteralExp.elements.map(async(n,s)=>{let o=await rp(t,r,n);o&&(o.nodeIndex=s,e.push(o))})),{sourceFile:r,components:Ht(e)}}async function rp(t,r,e){if(!t.ts.isObjectLiteralExpression(e))return null;let i={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[]};for(let n of e.properties){if(!t.ts.isPropertyAssignment(n)||!t.ts.isIdentifier(n.name))continue;if(Fe(t,n)==="component"&&t.ts.isIdentifier(n.initializer)){let o=n.initializer.text;i.name===""&&(i.name=Ve(o)),i.importName=o;let a=await Wr(t,t.registryPath,r,o);if(!a)continue;i.filePath=a.filePath,i.relFilePath=a.relFilePath,i.importPath=Ue(t,a.filePath),i.displayFilePath=a.displayFilePath,i.exportType=a.exportType;let l=await ry(t,a.filePath);if(l&&l.length>0)if(l.length===1)i.exportName=l[0].cmpInfo.exportName;else{let u=l.find(c=>c.cmpInfo.exportName===o);u&&(i.exportName=u.cmpInfo.exportName)}continue}}return i=Jt(t,i,e),i.filePath&&i.exportName&&(i.id=await je(t,i.filePath,i.exportName)),i}async function oy(t){let r=new Set,e=async n=>{let s=await t.readdir(n);await Promise.all(s.map(async o=>{if(o.startsWith(".")||o==="node_modules")return;let a=t.join(n,o),l=t.extname(o).toLowerCase();if(l===".tsx"||l===".ts"){r.add(a);return}(await t.stat(a)).isDirectory()&&await e(a)}))};return await e(t.getAppRootDir()),await dt(t,[...r])}async function On(t,r,e,i,n,s,o,a){let l=await oy(t),[u,c,p]=await Promise.all([ty(t,l),sy(t),xo(t)]),d=u.map(g=>g.cmpInfo),h=c.components,f={components:Pr(d,h),registryPath:t.registryPath,registryDisplayPath:Ne(t,t.registryPath),frameworks:t.getFrameworks(),dependencies:Gr(d),publicApiKey:p.envValue??void 0,devToolsVersion:t.version};if(a)return f;if(r!=null){let g=u.find(T=>T.cmpInfo.id===r);if(!g)throw new Error(`Component ${r} not found`);let m=c.sourceFile,y=f.components.find(T=>T.id===r),b=await iy(t,g);ar(y,b),r=Array.isArray(r)?r[0]:r;let C=Xr(r,d,h,e,i,n,s),{elements:D,elmIndex:x,statementIndex:E,statement:w,variableDeclaration:R}=await FI(t,m,g),M=!1;if(C.addCmpToRegistry?(D.push(NI(t,C.addCmpToRegistry)),M=!0):C.removeCmpFromRegistry?(D.splice(x,1),M=!0):C.updateRegisteredCmp&&(D[x]=pt(t,D[x],C.updateRegisteredCmp),M=!0),M&&o){let T=[...m.statements];T[E]=t.ts.factory.updateVariableStatement(w,w.modifiers,t.ts.factory.updateVariableDeclarationList(w.declarationList,[t.ts.factory.updateVariableDeclaration(R,R.name,R.exclamationToken,R.type,t.ts.factory.createArrayLiteralExpression(Jr(t,D)))])),m=t.ts.factory.updateSourceFile(m,T),y.exportType==="named"?m=Ce(t,m,{namedImports:[y.importName],importPath:Se(t,t.registryPath,y.filePath)}):m=Ce(t,m,{defaultImport:y.importName,importPath:Se(t,t.registryPath,y.filePath)}),m=Ce(t,m,{namedImports:["RegisteredComponent"],importPath:"@builder.io/sdk-qwik",isTypeOnly:!0}),m=Qr(t,m,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),m=Yr(t,m),m=Hr(t,m);let L=gt(t,m);L=Ar(L),L=Zg(L,kI,"CUSTOM_COMPONENTS"),L=await t.formatCode(t.registryPath,L),await t.writeFile(t.registryPath,L)}f.components=C.components}return f}function NI(t,r){return pt(t,t.ts.factory.createObjectLiteralExpression([t.ts.factory.createPropertyAssignment("component",t.ts.factory.createIdentifier(r.importName))],!0),r)}async function FI(t,r,e){let i=lt(t,r,"CUSTOM_COMPONENTS");if(!i)throw new Error(`Exported name of the Builder registry must be "CUSTOM_COMPONENTS". Please update your Builder registry file: ${t.registryPath}`);let n=i.arrayLiteralExp.elements.filter(o=>t.ts.isObjectLiteralExpression(o)),s=-1;for(let o=0;o<n.length;o++)if((await rp(t,r,n[o]))?.id===e.cmpInfo.id){s=o;break}return{...i,elements:n,elmIndex:s}}var kI=["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 ay(t){let r=await OI(t);return{builderPageOptions:async()=>({templateContentId:"dc70f1d979ad416d8fd357137eb9ddfb",pathname:"/",title:"Builder + Qwik Demo Page"}),ensureBuilderSetup:()=>ny(r),ensureFigmaImportPage:async()=>[],getRegistryPath:()=>r.registryPath,getRegistry:i=>On(r,null,!1,!1,null,null,!1,!!i?.readAllInputTypes),addExternalPackage:async i=>{},loadComponent:async i=>{let n=await On(r,i.cmpId,!1,!1,null,null,!1,!1);return{...n,component:n.components.find(s=>s.id===i.cmpId)}},registerComponent:i=>On(r,i.cmpId,!0,!1,null,null,!0,!1),setRegisteredComponentInfo:i=>On(r,i.cmpId,!1,!1,i,null,!0,!1),setRegisteredComponentInput:i=>On(r,i.cmpId,!1,!1,null,i,!0,!1),unregisterComponent:i=>On(r,i.cmpId,!1,!0,null,null,!0,!1),getPublicApiKey:()=>xo(r),setPublicApiKey:i=>Xg(r,i.publicApiKey),getDependencies:i=>[{name:"@builder.io/dev-tools"},{name:"@builder.io/sdk-qwik"}],getDevRunCommand:()=>"dev",getCache:()=>Kr(r),setCache:i=>Vr(r,i)}}async function OI(t){let r=await po(t,t.getAppRootDir(),"components");if(!r)throw new Error(`Could not find components directory within project: ${t.getAppRootDir()}`);let e=await mr(t,r),i=t.join(t.getAppRootDir(),".env");return{...t,componentsDir:r,registryPath:e,envPath:i}}async function Eo(t){return await tn(t,[".env"],Co)}async function ly(t,r){let e=await Eo(t),i=await rn(t,e.file,e.envKey,r);return{...e,modifiedType:i}}var Co="PUBLIC_BUILDER_KEY";var RI=new Set(["dist","node_modules"]);async function uy(t,r){let e=[],i=r.getSourceFiles(),n=r.getTypeChecker(),s=t.join(t.getAppRootDir(),"build");return await Promise.all(i.map(async o=>{let a=t.basename(o.fileName);if(a.startsWith(".")||a==="node_modules"||el(t,RI,o.fileName)||LI.has(a)||a.includes("$."))return;let l=t.normalize(o.fileName);if(l===t.remixConfigPath||l===s)return;let u=await nn(t,n,l,o,l===t.registryPath);e.push(...u)})),e}var LI=new Set(["root.tsx","root.ts","root.jsx","root.js","_index.tsx","_index.jsx","_index.ts","_index.js"]);async function cy(t){await ol(t);let r=await t.readFile(t.registryPath);return r?MI(t,r):{components:[],sourceFile:xe(t,"")}}async function MI(t,r){let e=xe(t,r);return BI(t,e)}async function BI(t,r){let e=[],i=lt(t,r,"CUSTOM_COMPONENTS");return i&&await Promise.all(i.arrayLiteralExp.elements.map(async(n,s)=>{let o=await ip(t,r,n);o&&(o.nodeIndex=s,e.push(o))})),{sourceFile:r,components:Ht(e)}}async function ip(t,r,e){if(!t.ts.isObjectLiteralExpression(e))return null;let i={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],acceptsChildren:!1};t.sdkVersion===te.gen2&&os(t,e)&&(i.acceptsChildren=!0);for(let n of e.properties){if(!t.ts.isPropertyAssignment(n)||!t.ts.isIdentifier(n.name))continue;if(Fe(t,n)==="component"){let o,{initializer:a}=n;if(t.ts.isIdentifier(a))o=a.text;else if(t.ts.isCallExpression(a)){(t.ts.isIdentifier(a.expression)&&a.expression.text)==="withChildren"&&(i.acceptsChildren=!0);let c=a.arguments[0];t.ts.isIdentifier(c)&&(o=c.text)}if(!o)continue;i.name===""&&(i.name=Ve(o)),i.importName=o;let l=await Wr(t,t.registryPath,r,o);if(!l)continue;if(i.filePath=l.filePath,i.relFilePath=l.relFilePath,await t.exists(l.filePath)?i.importPath=Ue(t,l.filePath):(i.externalImportPath=l.importPath,i.importPath=i.externalImportPath),i.displayFilePath=l.displayFilePath,i.exportType=l.exportType,i.externalImportPath)i.exportName=o;else{let u=await _g(t,l.filePath,t.registryPath===l.filePath||gr(l.filePath));if(u&&u.length>0)if(u.length===1)i.exportName=u[0].cmpInfo.exportName;else{let c=u.find(p=>p.cmpInfo.exportName===o);c&&(i.exportName=c.cmpInfo.exportName)}}continue}}return i=Jt(t,i,e),i.filePath&&i.exportName&&(i.id=await je(t,i.filePath,i.exportName,i.externalImportPath)),i}async function ei(t,r,e,i,n,s,o,a){let l=await sn(t),[u,c,p]=await Promise.all([uy(t,l),cy(t),Eo(t)]),d=u.map(b=>b.cmpInfo),h=c.components,f={components:Pr(d,h),registryPath:t.registryPath,registryDisplayPath:Ne(t,t.registryPath),frameworks:t.getFrameworks(),dependencies:Gr(d),publicApiKey:p.envValue??void 0,devToolsVersion:t.version};if(a)return f.components=await cs(t,f.components),f;let g=!1,m=c.sourceFile,y=Array.isArray(r)?r:typeof r=="string"?[r]:[];if(y.length>0){let b=y.map(x=>{let E=u.find(w=>w.cmpInfo.id===x);if(!E)throw new Error(`Component ${x} not found`);return E}),C=Array.from(new Set(b.map(x=>x.cmpInfo.filePath))),D=await dt(t,C);for(let x of b){let E=f.components.find(Z=>Z.id===x.cmpInfo.id),w=await ps(t,x,D,t.registryPath===x.cmpInfo.filePath||gr(x.cmpInfo.filePath));ar(E,w);let R=d.findIndex(Z=>Z.id===x.cmpInfo.id);d[R].inputs=w;let M=Xr(x.cmpInfo.id,d,h,e,i,n,s),{elements:T,elmIndex:L,statementIndex:Q,statement:ie,variableDeclaration:re}=await UI(t,m,x);if(M.addCmpToRegistry)T.push($I(t,M.addCmpToRegistry)),g=!0;else if(M.removeCmpFromRegistry)T.splice(L,1),g=!0;else if(M.updateRegisteredCmp){let Z=pt(t,T[L],M.updateRegisteredCmp);T[L]=t.ts.factory.updateObjectLiteralExpression(Z,[py(t,M.updateRegisteredCmp),...Z.properties.slice(1)]),g=!0}if(g&&o){let Z=[...m.statements];Z[Q]=t.ts.factory.updateVariableStatement(ie,ie.modifiers,t.ts.factory.updateVariableDeclarationList(ie.declarationList,[t.ts.factory.updateVariableDeclaration(re,re.name,re.exclamationToken,re.type,t.ts.factory.createArrayLiteralExpression(Jr(t,T)))])),m=t.ts.factory.updateSourceFile(m,Z),E.exportType==="named"?m=Ce(t,m,{namedImports:[E.importName],importPath:E.externalImportPath?E.externalImportPath:Se(t,t.registryPath,E.filePath)}):m=Ce(t,m,{defaultImport:E.importName,importPath:E.externalImportPath?E.externalImportPath:Se(t,t.registryPath,E.filePath)});let Pe=t.sdkVersion===te.gen2?"@builder.io/sdk-react":"@builder.io/react";m=Ce(t,m,{namedImports:["RegisteredComponent"],importPath:Pe,isTypeOnly:!0}),E.acceptsChildren&&t.sdkVersion!==te.gen2&&(m=Ce(t,m,{namedImports:["withChildren"],importPath:"@builder.io/react"})),m=Qr(t,m,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),f.components=M.components,h=M.components.filter(_=>_.isRegistered)}}}if(g&&o){m=Yr(t,m),m=Hr(t,m);let b=gt(t,m);b=Ar(b),b=await t.formatCode(t.registryPath,b),await t.writeFile(t.registryPath,b)}return f}function py(t,r){if(t.sdkVersion===te.gen2)return t.ts.factory.createPropertyAssignment("component",t.ts.factory.createIdentifier(r.importName));let e=t.ts.factory.createIdentifier(r.importName),i=r.acceptsChildren?t.ts.factory.createCallExpression(t.ts.factory.createIdentifier("withChildren"),void 0,[e]):e;return t.ts.factory.createPropertyAssignment("component",i)}function $I(t,r){return pt(t,t.ts.factory.createObjectLiteralExpression([py(t,r),...r.acceptsChildren&&t.sdkVersion===te.gen2?[t.ts.factory.createPropertyAssignment("canHaveChildren",t.ts.factory.createTrue())]:[]],!0),r)}async function UI(t,r,e){let i=lt(t,r,"CUSTOM_COMPONENTS");if(!i)throw new Error(`Exported name of the Builder registry must be "CUSTOM_COMPONENTS". Please update your Builder registry file: ${t.registryPath}`);let n=i.arrayLiteralExp.elements.filter(o=>t.ts.isObjectLiteralExpression(o)),s=-1;for(let o=0;o<n.length;o++)if((await ip(t,r,n[o]))?.id===e.cmpInfo.id){s=o;break}return{...i,elements:n,elmIndex:s}}async function dy(t){let r=[],e=await KI(t,r);return r.push(...await ol(t)),await zI(t,e),await qI(t,r),r}async function fy(t){let r=[];return r.push(...await ol(t)),await jI(t,r),r}async function jI(t,r){let e=`figma-imports.${t.typescriptEnabled?"tsx":"jsx"}`;t.hasLocaleParam&&(t.debug("remixEnsureFigmaImportRoute, hasLocaleParam"),e=`($locale).${e}`);let i=t.join(t.routesDir,e),n=await t.exists(i);t.debug(`remixEnsureFigmaImportRoute, hasRoute: ${n}`);let s=await t.formatCode(i,hy({sys:t,routePath:i,modelName:"figma-imports"}));await t.writeFile(i,s),r.push({filePath:i,modifiedType:n?"update":"create"})}async function qI(t,r){let e=`$.${t.typescriptEnabled?"tsx":"jsx"}`;t.hasLocaleParam&&(t.debug("remixEnsureAppRoute, hasLocaleParam"),e=`($locale).${e}`),t.sdkVersion===te.gen2&&(e=`($slug)._index.${t.typescriptEnabled?"tsx":"jsx"}`);let i=t.join(t.routesDir,e),n=await t.exists(i);t.debug(`remixEnsureAppRoute, hasRoute: ${n}`);let s=await t.formatCode(i,hy({sys:t,routePath:i,modelName:"page"}));await t.writeFile(i,s),r.push({filePath:i,modifiedType:n?"update":"create"})}function hy({sys:t,routePath:r,modelName:e}){let i=t.typescriptEnabled,n=Se(t,r,t.registryPath),s="",o="";i&&(s="import type { LoaderArgs } from '@remix-run/server-runtime';",o=": LoaderArgs");let a=`process.env.${Co}`;return t.getFrameworks().some(l=>l.name==="@shopify/remix-oxygen")&&(a=`context.env.${Co}`),i&&(a+="!"),t.sdkVersion===te.gen2?`
|
|
570
|
+
`;async function sy(t){await tp(t);let r=await t.readFile(t.registryPath);return r?II(t,r):{components:[],sourceFile:xe(t,"")}}async function II(t,r){let e=xe(t,r);return _I(t,e)}async function _I(t,r){let e=[],i=lt(t,r,"CUSTOM_COMPONENTS");return i&&await Promise.all(i.arrayLiteralExp.elements.map(async(n,s)=>{let o=await rp(t,r,n);o&&(o.nodeIndex=s,e.push(o))})),{sourceFile:r,components:Ht(e)}}async function rp(t,r,e){if(!t.ts.isObjectLiteralExpression(e))return null;let i={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[]};for(let n of e.properties){if(!t.ts.isPropertyAssignment(n)||!t.ts.isIdentifier(n.name))continue;if(Fe(t,n)==="component"&&t.ts.isIdentifier(n.initializer)){let o=n.initializer.text;i.name===""&&(i.name=Ve(o)),i.importName=o;let a=await Wr(t,t.registryPath,r,o);if(!a)continue;i.filePath=a.filePath,i.relFilePath=a.relFilePath,i.importPath=Ue(t,a.filePath),i.displayFilePath=a.displayFilePath,i.exportType=a.exportType;let l=await ry(t,a.filePath);if(l&&l.length>0)if(l.length===1)i.exportName=l[0].cmpInfo.exportName;else{let u=l.find(c=>c.cmpInfo.exportName===o);u&&(i.exportName=u.cmpInfo.exportName)}continue}}return i=Jt(t,i,e),i.filePath&&i.exportName&&(i.id=await je(t,i.filePath,i.exportName)),i}async function oy(t){let r=new Set,e=async n=>{let s=await t.readdir(n);await Promise.all(s.map(async o=>{if(o.startsWith(".")||o==="node_modules")return;let a=t.join(n,o),l=t.extname(o).toLowerCase();if(l===".tsx"||l===".ts"){r.add(a);return}(await t.stat(a)).isDirectory()&&await e(a)}))};return await e(t.getAppRootDir()),await dt(t,[...r])}async function On(t,r,e,i,n,s,o,a){let l=await oy(t),[u,c,p]=await Promise.all([ty(t,l),sy(t),xo(t)]),d=u.map(g=>g.cmpInfo),h=c.components,f={components:Pr(d,h),registryPath:t.registryPath,registryDisplayPath:Ne(t,t.registryPath),frameworks:t.getFrameworks(),dependencies:Gr(d),publicApiKey:p.envValue??void 0,devToolsVersion:t.version};if(a)return f;if(r!=null){let g=u.find(T=>T.cmpInfo.id===r);if(!g)throw new Error(`Component ${r} not found`);let m=c.sourceFile,y=f.components.find(T=>T.id===r),b=await iy(t,g);ar(y,b),r=Array.isArray(r)?r[0]:r;let C=Xr(r,d,h,e,i,n,s),{elements:D,elmIndex:x,statementIndex:E,statement:w,variableDeclaration:R}=await FI(t,m,g),M=!1;if(C.addCmpToRegistry?(D.push(NI(t,C.addCmpToRegistry)),M=!0):C.removeCmpFromRegistry?(D.splice(x,1),M=!0):C.updateRegisteredCmp&&(D[x]=pt(t,D[x],C.updateRegisteredCmp),M=!0),M&&o){let T=[...m.statements];T[E]=t.ts.factory.updateVariableStatement(w,w.modifiers,t.ts.factory.updateVariableDeclarationList(w.declarationList,[t.ts.factory.updateVariableDeclaration(R,R.name,R.exclamationToken,R.type,t.ts.factory.createArrayLiteralExpression(Jr(t,D)))])),m=t.ts.factory.updateSourceFile(m,T),y.exportType==="named"?m=Ce(t,m,{namedImports:[y.importName],importPath:Se(t,t.registryPath,y.filePath)}):m=Ce(t,m,{defaultImport:y.importName,importPath:Se(t,t.registryPath,y.filePath)}),m=Ce(t,m,{namedImports:["RegisteredComponent"],importPath:"@builder.io/sdk-qwik",isTypeOnly:!0}),m=Qr(t,m,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),m=Yr(t,m),m=Hr(t,m);let L=yt(t,m);L=Ar(L),L=Zg(L,kI,"CUSTOM_COMPONENTS"),L=await t.formatCode(t.registryPath,L),await t.writeFile(t.registryPath,L)}f.components=C.components}return f}function NI(t,r){return pt(t,t.ts.factory.createObjectLiteralExpression([t.ts.factory.createPropertyAssignment("component",t.ts.factory.createIdentifier(r.importName))],!0),r)}async function FI(t,r,e){let i=lt(t,r,"CUSTOM_COMPONENTS");if(!i)throw new Error(`Exported name of the Builder registry must be "CUSTOM_COMPONENTS". Please update your Builder registry file: ${t.registryPath}`);let n=i.arrayLiteralExp.elements.filter(o=>t.ts.isObjectLiteralExpression(o)),s=-1;for(let o=0;o<n.length;o++)if((await rp(t,r,n[o]))?.id===e.cmpInfo.id){s=o;break}return{...i,elements:n,elmIndex:s}}var kI=["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 ay(t){let r=await OI(t);return{builderPageOptions:async()=>({templateContentId:"dc70f1d979ad416d8fd357137eb9ddfb",pathname:"/",title:"Builder + Qwik Demo Page"}),ensureBuilderSetup:()=>ny(r),ensureFigmaImportPage:async()=>[],getRegistryPath:()=>r.registryPath,getRegistry:i=>On(r,null,!1,!1,null,null,!1,!!i?.readAllInputTypes),addExternalPackage:async i=>{},loadComponent:async i=>{let n=await On(r,i.cmpId,!1,!1,null,null,!1,!1);return{...n,component:n.components.find(s=>s.id===i.cmpId)}},registerComponent:i=>On(r,i.cmpId,!0,!1,null,null,!0,!1),setRegisteredComponentInfo:i=>On(r,i.cmpId,!1,!1,i,null,!0,!1),setRegisteredComponentInput:i=>On(r,i.cmpId,!1,!1,null,i,!0,!1),unregisterComponent:i=>On(r,i.cmpId,!1,!0,null,null,!0,!1),getPublicApiKey:()=>xo(r),setPublicApiKey:i=>Xg(r,i.publicApiKey),getDependencies:i=>[{name:"@builder.io/dev-tools"},{name:"@builder.io/sdk-qwik"}],getDevRunCommand:()=>"dev",getCache:()=>Kr(r),setCache:i=>Vr(r,i)}}async function OI(t){let r=await po(t,t.getAppRootDir(),"components");if(!r)throw new Error(`Could not find components directory within project: ${t.getAppRootDir()}`);let e=await mr(t,r),i=t.join(t.getAppRootDir(),".env");return{...t,componentsDir:r,registryPath:e,envPath:i}}async function Eo(t){return await tn(t,[".env"],Co)}async function ly(t,r){let e=await Eo(t),i=await rn(t,e.file,e.envKey,r);return{...e,modifiedType:i}}var Co="PUBLIC_BUILDER_KEY";var RI=new Set(["dist","node_modules"]);async function uy(t,r){let e=[],i=r.getSourceFiles(),n=r.getTypeChecker(),s=t.join(t.getAppRootDir(),"build");return await Promise.all(i.map(async o=>{let a=t.basename(o.fileName);if(a.startsWith(".")||a==="node_modules"||el(t,RI,o.fileName)||LI.has(a)||a.includes("$."))return;let l=t.normalize(o.fileName);if(l===t.remixConfigPath||l===s)return;let u=await nn(t,n,l,o,l===t.registryPath);e.push(...u)})),e}var LI=new Set(["root.tsx","root.ts","root.jsx","root.js","_index.tsx","_index.jsx","_index.ts","_index.js"]);async function cy(t){await ol(t);let r=await t.readFile(t.registryPath);return r?MI(t,r):{components:[],sourceFile:xe(t,"")}}async function MI(t,r){let e=xe(t,r);return BI(t,e)}async function BI(t,r){let e=[],i=lt(t,r,"CUSTOM_COMPONENTS");return i&&await Promise.all(i.arrayLiteralExp.elements.map(async(n,s)=>{let o=await ip(t,r,n);o&&(o.nodeIndex=s,e.push(o))})),{sourceFile:r,components:Ht(e)}}async function ip(t,r,e){if(!t.ts.isObjectLiteralExpression(e))return null;let i={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],acceptsChildren:!1};t.sdkVersion===te.gen2&&os(t,e)&&(i.acceptsChildren=!0);for(let n of e.properties){if(!t.ts.isPropertyAssignment(n)||!t.ts.isIdentifier(n.name))continue;if(Fe(t,n)==="component"){let o,{initializer:a}=n;if(t.ts.isIdentifier(a))o=a.text;else if(t.ts.isCallExpression(a)){(t.ts.isIdentifier(a.expression)&&a.expression.text)==="withChildren"&&(i.acceptsChildren=!0);let c=a.arguments[0];t.ts.isIdentifier(c)&&(o=c.text)}if(!o)continue;i.name===""&&(i.name=Ve(o)),i.importName=o;let l=await Wr(t,t.registryPath,r,o);if(!l)continue;if(i.filePath=l.filePath,i.relFilePath=l.relFilePath,await t.exists(l.filePath)?i.importPath=Ue(t,l.filePath):(i.externalImportPath=l.importPath,i.importPath=i.externalImportPath),i.displayFilePath=l.displayFilePath,i.exportType=l.exportType,i.externalImportPath)i.exportName=o;else{let u=await _g(t,l.filePath,t.registryPath===l.filePath||gr(l.filePath));if(u&&u.length>0)if(u.length===1)i.exportName=u[0].cmpInfo.exportName;else{let c=u.find(p=>p.cmpInfo.exportName===o);c&&(i.exportName=c.cmpInfo.exportName)}}continue}}return i=Jt(t,i,e),i.filePath&&i.exportName&&(i.id=await je(t,i.filePath,i.exportName,i.externalImportPath)),i}async function ei(t,r,e,i,n,s,o,a){let l=await sn(t),[u,c,p]=await Promise.all([uy(t,l),cy(t),Eo(t)]),d=u.map(b=>b.cmpInfo),h=c.components,f={components:Pr(d,h),registryPath:t.registryPath,registryDisplayPath:Ne(t,t.registryPath),frameworks:t.getFrameworks(),dependencies:Gr(d),publicApiKey:p.envValue??void 0,devToolsVersion:t.version};if(a)return f.components=await cs(t,f.components),f;let g=!1,m=c.sourceFile,y=Array.isArray(r)?r:typeof r=="string"?[r]:[];if(y.length>0){let b=y.map(x=>{let E=u.find(w=>w.cmpInfo.id===x);if(!E)throw new Error(`Component ${x} not found`);return E}),C=Array.from(new Set(b.map(x=>x.cmpInfo.filePath))),D=await dt(t,C);for(let x of b){let E=f.components.find(Z=>Z.id===x.cmpInfo.id),w=await ps(t,x,D,t.registryPath===x.cmpInfo.filePath||gr(x.cmpInfo.filePath));ar(E,w);let R=d.findIndex(Z=>Z.id===x.cmpInfo.id);d[R].inputs=w;let M=Xr(x.cmpInfo.id,d,h,e,i,n,s),{elements:T,elmIndex:L,statementIndex:Q,statement:ie,variableDeclaration:re}=await UI(t,m,x);if(M.addCmpToRegistry)T.push($I(t,M.addCmpToRegistry)),g=!0;else if(M.removeCmpFromRegistry)T.splice(L,1),g=!0;else if(M.updateRegisteredCmp){let Z=pt(t,T[L],M.updateRegisteredCmp);T[L]=t.ts.factory.updateObjectLiteralExpression(Z,[py(t,M.updateRegisteredCmp),...Z.properties.slice(1)]),g=!0}if(g&&o){let Z=[...m.statements];Z[Q]=t.ts.factory.updateVariableStatement(ie,ie.modifiers,t.ts.factory.updateVariableDeclarationList(ie.declarationList,[t.ts.factory.updateVariableDeclaration(re,re.name,re.exclamationToken,re.type,t.ts.factory.createArrayLiteralExpression(Jr(t,T)))])),m=t.ts.factory.updateSourceFile(m,Z),E.exportType==="named"?m=Ce(t,m,{namedImports:[E.importName],importPath:E.externalImportPath?E.externalImportPath:Se(t,t.registryPath,E.filePath)}):m=Ce(t,m,{defaultImport:E.importName,importPath:E.externalImportPath?E.externalImportPath:Se(t,t.registryPath,E.filePath)});let Pe=t.sdkVersion===te.gen2?"@builder.io/sdk-react":"@builder.io/react";m=Ce(t,m,{namedImports:["RegisteredComponent"],importPath:Pe,isTypeOnly:!0}),E.acceptsChildren&&t.sdkVersion!==te.gen2&&(m=Ce(t,m,{namedImports:["withChildren"],importPath:"@builder.io/react"})),m=Qr(t,m,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),f.components=M.components,h=M.components.filter(_=>_.isRegistered)}}}if(g&&o){m=Yr(t,m),m=Hr(t,m);let b=yt(t,m);b=Ar(b),b=await t.formatCode(t.registryPath,b),await t.writeFile(t.registryPath,b)}return f}function py(t,r){if(t.sdkVersion===te.gen2)return t.ts.factory.createPropertyAssignment("component",t.ts.factory.createIdentifier(r.importName));let e=t.ts.factory.createIdentifier(r.importName),i=r.acceptsChildren?t.ts.factory.createCallExpression(t.ts.factory.createIdentifier("withChildren"),void 0,[e]):e;return t.ts.factory.createPropertyAssignment("component",i)}function $I(t,r){return pt(t,t.ts.factory.createObjectLiteralExpression([py(t,r),...r.acceptsChildren&&t.sdkVersion===te.gen2?[t.ts.factory.createPropertyAssignment("canHaveChildren",t.ts.factory.createTrue())]:[]],!0),r)}async function UI(t,r,e){let i=lt(t,r,"CUSTOM_COMPONENTS");if(!i)throw new Error(`Exported name of the Builder registry must be "CUSTOM_COMPONENTS". Please update your Builder registry file: ${t.registryPath}`);let n=i.arrayLiteralExp.elements.filter(o=>t.ts.isObjectLiteralExpression(o)),s=-1;for(let o=0;o<n.length;o++)if((await ip(t,r,n[o]))?.id===e.cmpInfo.id){s=o;break}return{...i,elements:n,elmIndex:s}}async function dy(t){let r=[],e=await KI(t,r);return r.push(...await ol(t)),await zI(t,e),await qI(t,r),r}async function fy(t){let r=[];return r.push(...await ol(t)),await jI(t,r),r}async function jI(t,r){let e=`figma-imports.${t.typescriptEnabled?"tsx":"jsx"}`;t.hasLocaleParam&&(t.debug("remixEnsureFigmaImportRoute, hasLocaleParam"),e=`($locale).${e}`);let i=t.join(t.routesDir,e),n=await t.exists(i);t.debug(`remixEnsureFigmaImportRoute, hasRoute: ${n}`);let s=await t.formatCode(i,hy({sys:t,routePath:i,modelName:"figma-imports"}));await t.writeFile(i,s),r.push({filePath:i,modifiedType:n?"update":"create"})}async function qI(t,r){let e=`$.${t.typescriptEnabled?"tsx":"jsx"}`;t.hasLocaleParam&&(t.debug("remixEnsureAppRoute, hasLocaleParam"),e=`($locale).${e}`),t.sdkVersion===te.gen2&&(e=`($slug)._index.${t.typescriptEnabled?"tsx":"jsx"}`);let i=t.join(t.routesDir,e),n=await t.exists(i);t.debug(`remixEnsureAppRoute, hasRoute: ${n}`);let s=await t.formatCode(i,hy({sys:t,routePath:i,modelName:"page"}));await t.writeFile(i,s),r.push({filePath:i,modifiedType:n?"update":"create"})}function hy({sys:t,routePath:r,modelName:e}){let i=t.typescriptEnabled,n=Se(t,r,t.registryPath),s="",o="";i&&(s="import type { LoaderArgs } from '@remix-run/server-runtime';",o=": LoaderArgs");let a=`process.env.${Co}`;return t.getFrameworks().some(l=>l.name==="@shopify/remix-oxygen")&&(a=`context.env.${Co}`),i&&(a+="!"),t.sdkVersion===te.gen2?`
|
|
571
571
|
|
|
572
572
|
import {
|
|
573
573
|
Content,
|
|
@@ -750,7 +750,7 @@ export const CUSTOM_COMPONENTS: RegisteredComponent[] = [
|
|
|
750
750
|
`,e+=` {
|
|
751
751
|
name: "${r.name}",
|
|
752
752
|
}
|
|
753
|
-
`,e+=");";let i=tl(t,e);return np(t,i,r)}function np(t,r,e){if(!t.ts.isExpressionStatement(r))return r;let i=r.expression;if(!t.ts.isCallExpression(i))return r;let n=[...i.arguments];if(n.length<2)return r;let s=n[1];return t.ts.isObjectLiteralExpression(s)?(n[1]=pt(t,s,e),t.ts.factory.updateExpressionStatement(r,t.ts.factory.updateCallExpression(i,i.expression,i.typeArguments,n))):r}async function by(t){let r=await t.readFile(t.registryPath);return r?XI(t,r):{components:[],sourceFile:xe(t,"")}}async function XI(t,r){let e=xe(t,r);return t.sdkVersion===te.gen2?e_(t,e):QI(t,e)}async function QI(t,r){let e=[];for(let i=0;i<r.statements.length;i++){let n=r.statements[i];if(!t.ts.isExpressionStatement(n))continue;let s=n.expression;if(!t.ts.isCallExpression(s))continue;let o=s.expression;if(!t.ts.isPropertyAccessExpression(o))continue;let a=o.expression;if(!t.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(!t.ts.isObjectLiteralExpression(c))continue;let p=u[0];if(t.ts.isIdentifier(p)){let d=await ZI(t,r,i,p,c,!1);d&&e.push(d);continue}}return{sourceFile:r,components:Ht(e)}}async function ZI(t,r,e,i,n,s){let o={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],nodeIndex:e,acceptsChildren:s},a=r.statements.filter(u=>t.ts.isImportDeclaration(u)),l=a.find(u=>u.importClause&&u.importClause.name?.text===i.text);if(l){let u=l.moduleSpecifier;if(!t.ts.isStringLiteral(u))return null;o.filePath=await sp(t,u.text),o.relFilePath=t.relative(t.getAppRootDir(),o.filePath),o.importPath=Ue(t,o.filePath),o.name=yr(t,o.filePath),o.importName=i.text,o.exportName="default",o.exportType="default"}else{let u=a.find(d=>!d.importClause||!d.importClause.namedBindings||!t.ts.isNamedImports(d.importClause.namedBindings)?!1:d.importClause.namedBindings.elements.some(h=>h.name.text===i.text));if(!u)return null;let c=u.moduleSpecifier;if(!t.ts.isStringLiteral(c))return null;let p=await sp(t,c.text);o.filePath=await sp(t,c.text),o.relFilePath=t.relative(t.getAppRootDir(),o.filePath),await t.exists(p)?o.importPath=Ue(t,o.filePath):(o.externalImportPath=c.text,o.importPath=o.externalImportPath),o.name=Ve(i.text),o.importName=i.text,o.exportName=i.text,o.exportType="named"}return o=Jt(t,o,n),o.displayFilePath=Ne(t,o.filePath),o.filePath&&o.exportName&&(o.id=await je(t,o.filePath,o.exportName,o.externalImportPath)),o}function sp(t,r){return Do(t,t.normalize(t.resolve(t.dirname(t.registryPath),r)))}async function e_(t,r){let e=[],i=lt(t,r,"CUSTOM_COMPONENTS");return i&&await Promise.all(i.arrayLiteralExp.elements.map(async(n,s)=>{let o=await op(t,r,n);o&&(o.nodeIndex=s,e.push(o))})),{sourceFile:r,components:Ht(e)}}async function op(t,r,e){if(!t.ts.isObjectLiteralExpression(e))return null;let i={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],acceptsChildren:!1};os(t,e)&&(i.acceptsChildren=!0);for(let s of e.properties){if(!t.ts.isPropertyAssignment(s)||!t.ts.isIdentifier(s.name))continue;if(Fe(t,s)==="component"){let a,{initializer:l}=s;if(t.ts.isIdentifier(l)&&(a=l.text),!a)continue;i.name===""&&(i.name=Ve(a)),i.importName=a;let u=await Wr(t,t.registryPath,r,a);if(!u)continue;i.filePath=u.filePath,i.relFilePath=u.relFilePath,await t.exists(u.filePath)?i.importPath=Ue(t,u.filePath):(i.externalImportPath=u.importPath,i.importPath=i.externalImportPath),i.displayFilePath=u.displayFilePath,i.exportType=u.exportType;let c=r.statements.filter(d=>t.ts.isImportDeclaration(d)),p=c.find(d=>d.importClause&&d.importClause.name?.text===a);if(p){let d=p.moduleSpecifier;if(!t.ts.isStringLiteral(d))return null;i.exportName="default"}else{let d=c.find(f=>!f.importClause||!f.importClause.namedBindings||!t.ts.isNamedImports(f.importClause.namedBindings)?!1:f.importClause.namedBindings.elements.some(g=>g.name.text===a));if(!d)return null;let h=d.moduleSpecifier;if(!t.ts.isStringLiteral(h))return null;i.exportName=a}continue}}return i=Jt(t,i,e),i.filePath&&i.exportName&&(i.id=await je(t,i.filePath,i.exportName,i.externalImportPath)),i}async function ti(t,r,e,i,n,s,o,a){let l=await sn(t),[u,c,p,d]=await Promise.all([Ng(t,l),by(t),sr(t),So(t)]),h=u.map(C=>C.cmpInfo),f=c.components,g={components:Pr(h,f),registryPath:t.registryPath,registryDisplayPath:Ne(t,t.registryPath),frameworks:t.getFrameworks(),dependencies:Gr(h),publicApiKey:d.envValue??void 0,devToolsVersion:t.version};if(a)return g.components=await cs(t,g.components),g;let m=!1,y=c.sourceFile,b=Array.isArray(r)?r:typeof r=="string"?[r]:[];if(b.length>0){let C=b.map(E=>{let w=u.find(R=>R.cmpInfo.id===E);if(!w)throw new Error(`Component ${E} not found`);return w}),D=Array.from(new Set(C.map(E=>E.cmpInfo.filePath))),x=await dt(t,D);for(let E of C){let w=g.components.find(L=>L.id===E.cmpInfo.id),R=await ps(t,E,x,t.registryPath===E.cmpInfo.filePath||gr(E.cmpInfo.filePath));ar(w,R);let M=h.findIndex(L=>L.id===E.cmpInfo.id);h[M].inputs=R;let T=Xr(E.cmpInfo.id,h,f,e,i,n,s);if(t.sdkVersion===te.gen2){let{elements:L,elmIndex:Q,statementIndex:ie,statement:re,variableDeclaration:Z}=await t_(t,y,E);if(T.addCmpToRegistry)L.push(r_(t,T.addCmpToRegistry)),m=!0;else if(T.removeCmpFromRegistry)L.splice(Q,1),m=!0;else if(T.updateRegisteredCmp){let Pe=pt(t,L[Q],T.updateRegisteredCmp),_=t.ts.factory.createIdentifier(T.updateRegisteredCmp.importName);L[Q]=t.ts.factory.updateObjectLiteralExpression(Pe,[t.ts.factory.createPropertyAssignment("component",_),...Pe.properties.slice(1)]),m=!0}if(m&&o){let Pe=[...y.statements];Pe[ie]=t.ts.factory.updateVariableStatement(re,re.modifiers,t.ts.factory.updateVariableDeclarationList(re.declarationList,[t.ts.factory.updateVariableDeclaration(Z,Z.name,Z.exclamationToken,Z.type,t.ts.factory.createArrayLiteralExpression(Jr(t,L)))])),y=t.ts.factory.updateSourceFile(y,Pe),y=Dy(t,T,y),y=Ce(t,y,{namedImports:["RegisteredComponent"],importPath:"@builder.io/sdk-react",isTypeOnly:!0}),y=Qr(t,y,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),g.components=T.components,f=T.components.filter(_=>_.isRegistered)}}else{let L=[...y.statements];T.addCmpToRegistry?(L.push(yy(t,T.addCmpToRegistry)),m=!0):T.removeCmpFromRegistry?(L.splice(T.nodeIndex,1),m=!0):T.updateRegisteredCmp&&(L[T.nodeIndex]=np(t,L[T.nodeIndex],T.updateRegisteredCmp),m=!0),m&&o&&(y=t.ts.factory.updateSourceFile(y,L),y=Ce(t,y,{namedImports:["Builder","builder"],importPath:"@builder.io/react"}),y=Dy(t,T,y),w?.acceptsChildren&&(y=Ce(t,y,{namedImports:["withChildren"],importPath:"@builder.io/react"})),g.components=T.components,f=T.components.filter(Q=>Q.isRegistered))}}}if(m&&o){y=Yr(t,y),y=Hr(t,y);let C=
|
|
753
|
+
`,e+=");";let i=tl(t,e);return np(t,i,r)}function np(t,r,e){if(!t.ts.isExpressionStatement(r))return r;let i=r.expression;if(!t.ts.isCallExpression(i))return r;let n=[...i.arguments];if(n.length<2)return r;let s=n[1];return t.ts.isObjectLiteralExpression(s)?(n[1]=pt(t,s,e),t.ts.factory.updateExpressionStatement(r,t.ts.factory.updateCallExpression(i,i.expression,i.typeArguments,n))):r}async function by(t){let r=await t.readFile(t.registryPath);return r?XI(t,r):{components:[],sourceFile:xe(t,"")}}async function XI(t,r){let e=xe(t,r);return t.sdkVersion===te.gen2?e_(t,e):QI(t,e)}async function QI(t,r){let e=[];for(let i=0;i<r.statements.length;i++){let n=r.statements[i];if(!t.ts.isExpressionStatement(n))continue;let s=n.expression;if(!t.ts.isCallExpression(s))continue;let o=s.expression;if(!t.ts.isPropertyAccessExpression(o))continue;let a=o.expression;if(!t.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(!t.ts.isObjectLiteralExpression(c))continue;let p=u[0];if(t.ts.isIdentifier(p)){let d=await ZI(t,r,i,p,c,!1);d&&e.push(d);continue}}return{sourceFile:r,components:Ht(e)}}async function ZI(t,r,e,i,n,s){let o={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],nodeIndex:e,acceptsChildren:s},a=r.statements.filter(u=>t.ts.isImportDeclaration(u)),l=a.find(u=>u.importClause&&u.importClause.name?.text===i.text);if(l){let u=l.moduleSpecifier;if(!t.ts.isStringLiteral(u))return null;o.filePath=await sp(t,u.text),o.relFilePath=t.relative(t.getAppRootDir(),o.filePath),o.importPath=Ue(t,o.filePath),o.name=yr(t,o.filePath),o.importName=i.text,o.exportName="default",o.exportType="default"}else{let u=a.find(d=>!d.importClause||!d.importClause.namedBindings||!t.ts.isNamedImports(d.importClause.namedBindings)?!1:d.importClause.namedBindings.elements.some(h=>h.name.text===i.text));if(!u)return null;let c=u.moduleSpecifier;if(!t.ts.isStringLiteral(c))return null;let p=await sp(t,c.text);o.filePath=await sp(t,c.text),o.relFilePath=t.relative(t.getAppRootDir(),o.filePath),await t.exists(p)?o.importPath=Ue(t,o.filePath):(o.externalImportPath=c.text,o.importPath=o.externalImportPath),o.name=Ve(i.text),o.importName=i.text,o.exportName=i.text,o.exportType="named"}return o=Jt(t,o,n),o.displayFilePath=Ne(t,o.filePath),o.filePath&&o.exportName&&(o.id=await je(t,o.filePath,o.exportName,o.externalImportPath)),o}function sp(t,r){return Do(t,t.normalize(t.resolve(t.dirname(t.registryPath),r)))}async function e_(t,r){let e=[],i=lt(t,r,"CUSTOM_COMPONENTS");return i&&await Promise.all(i.arrayLiteralExp.elements.map(async(n,s)=>{let o=await op(t,r,n);o&&(o.nodeIndex=s,e.push(o))})),{sourceFile:r,components:Ht(e)}}async function op(t,r,e){if(!t.ts.isObjectLiteralExpression(e))return null;let i={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],acceptsChildren:!1};os(t,e)&&(i.acceptsChildren=!0);for(let s of e.properties){if(!t.ts.isPropertyAssignment(s)||!t.ts.isIdentifier(s.name))continue;if(Fe(t,s)==="component"){let a,{initializer:l}=s;if(t.ts.isIdentifier(l)&&(a=l.text),!a)continue;i.name===""&&(i.name=Ve(a)),i.importName=a;let u=await Wr(t,t.registryPath,r,a);if(!u)continue;i.filePath=u.filePath,i.relFilePath=u.relFilePath,await t.exists(u.filePath)?i.importPath=Ue(t,u.filePath):(i.externalImportPath=u.importPath,i.importPath=i.externalImportPath),i.displayFilePath=u.displayFilePath,i.exportType=u.exportType;let c=r.statements.filter(d=>t.ts.isImportDeclaration(d)),p=c.find(d=>d.importClause&&d.importClause.name?.text===a);if(p){let d=p.moduleSpecifier;if(!t.ts.isStringLiteral(d))return null;i.exportName="default"}else{let d=c.find(f=>!f.importClause||!f.importClause.namedBindings||!t.ts.isNamedImports(f.importClause.namedBindings)?!1:f.importClause.namedBindings.elements.some(g=>g.name.text===a));if(!d)return null;let h=d.moduleSpecifier;if(!t.ts.isStringLiteral(h))return null;i.exportName=a}continue}}return i=Jt(t,i,e),i.filePath&&i.exportName&&(i.id=await je(t,i.filePath,i.exportName,i.externalImportPath)),i}async function ti(t,r,e,i,n,s,o,a){let l=await sn(t),[u,c,p,d]=await Promise.all([Ng(t,l),by(t),sr(t),So(t)]),h=u.map(C=>C.cmpInfo),f=c.components,g={components:Pr(h,f),registryPath:t.registryPath,registryDisplayPath:Ne(t,t.registryPath),frameworks:t.getFrameworks(),dependencies:Gr(h),publicApiKey:d.envValue??void 0,devToolsVersion:t.version};if(a)return g.components=await cs(t,g.components),g;let m=!1,y=c.sourceFile,b=Array.isArray(r)?r:typeof r=="string"?[r]:[];if(b.length>0){let C=b.map(E=>{let w=u.find(R=>R.cmpInfo.id===E);if(!w)throw new Error(`Component ${E} not found`);return w}),D=Array.from(new Set(C.map(E=>E.cmpInfo.filePath))),x=await dt(t,D);for(let E of C){let w=g.components.find(L=>L.id===E.cmpInfo.id),R=await ps(t,E,x,t.registryPath===E.cmpInfo.filePath||gr(E.cmpInfo.filePath));ar(w,R);let M=h.findIndex(L=>L.id===E.cmpInfo.id);h[M].inputs=R;let T=Xr(E.cmpInfo.id,h,f,e,i,n,s);if(t.sdkVersion===te.gen2){let{elements:L,elmIndex:Q,statementIndex:ie,statement:re,variableDeclaration:Z}=await t_(t,y,E);if(T.addCmpToRegistry)L.push(r_(t,T.addCmpToRegistry)),m=!0;else if(T.removeCmpFromRegistry)L.splice(Q,1),m=!0;else if(T.updateRegisteredCmp){let Pe=pt(t,L[Q],T.updateRegisteredCmp),_=t.ts.factory.createIdentifier(T.updateRegisteredCmp.importName);L[Q]=t.ts.factory.updateObjectLiteralExpression(Pe,[t.ts.factory.createPropertyAssignment("component",_),...Pe.properties.slice(1)]),m=!0}if(m&&o){let Pe=[...y.statements];Pe[ie]=t.ts.factory.updateVariableStatement(re,re.modifiers,t.ts.factory.updateVariableDeclarationList(re.declarationList,[t.ts.factory.updateVariableDeclaration(Z,Z.name,Z.exclamationToken,Z.type,t.ts.factory.createArrayLiteralExpression(Jr(t,L)))])),y=t.ts.factory.updateSourceFile(y,Pe),y=Dy(t,T,y),y=Ce(t,y,{namedImports:["RegisteredComponent"],importPath:"@builder.io/sdk-react",isTypeOnly:!0}),y=Qr(t,y,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),g.components=T.components,f=T.components.filter(_=>_.isRegistered)}}else{let L=[...y.statements];T.addCmpToRegistry?(L.push(yy(t,T.addCmpToRegistry)),m=!0):T.removeCmpFromRegistry?(L.splice(T.nodeIndex,1),m=!0):T.updateRegisteredCmp&&(L[T.nodeIndex]=np(t,L[T.nodeIndex],T.updateRegisteredCmp),m=!0),m&&o&&(y=t.ts.factory.updateSourceFile(y,L),y=Ce(t,y,{namedImports:["Builder","builder"],importPath:"@builder.io/react"}),y=Dy(t,T,y),w?.acceptsChildren&&(y=Ce(t,y,{namedImports:["withChildren"],importPath:"@builder.io/react"})),g.components=T.components,f=T.components.filter(Q=>Q.isRegistered))}}}if(m&&o){y=Yr(t,y),y=Hr(t,y);let C=yt(t,y);C=Ar(C),C=await t.formatCode(t.registryPath,C),await t.writeFile(t.registryPath,C)}return g}async function t_(t,r,e){let i=lt(t,r,"CUSTOM_COMPONENTS");if(!i)throw new Error(`Exported name of the Builder registry must be "CUSTOM_COMPONENTS". Please update your Builder registry file: ${t.registryPath}`);let n=i.arrayLiteralExp.elements.filter(o=>t.ts.isObjectLiteralExpression(o)),s=-1;for(let o=0;o<n.length;o++)if((await op(t,r,n[o]))?.id===e.cmpInfo.id){s=o;break}return{...i,elements:n,elmIndex:s}}function r_(t,r){let e=t.ts.factory.createIdentifier(r.importName);return pt(t,t.ts.factory.createObjectLiteralExpression([t.ts.factory.createPropertyAssignment("component",e),...r.acceptsChildren?[t.ts.factory.createPropertyAssignment("canHaveChildren",t.ts.factory.createTrue())]:[]],!0),r)}function Dy(t,r,e){let i=r.addCmpToRegistry||r.updateRegisteredCmp;if(i){let n=i.externalImportPath?i.externalImportPath:Se(t,t.registryPath,i.filePath);i.exportType==="default"?e=Ce(t,e,{defaultImport:i.importName,importPath:n}):i.exportType==="named"&&(e=Ce(t,e,{namedImports:[i.importName],importPath:n}))}return e}async function xy(t){let r=[],e=await i_(t,r);if(await Sy(t,r,e),!await t.exists(t.builderComponentPath)){let i=await t.formatCode(t.builderComponentPath,Cy(t,t.builderComponentPath));await t.writeFile(t.builderComponentPath,i),r.push({filePath:t.builderComponentPath,modifiedType:"create"})}return r}async function Ey(t){let r=[];await Sy(t,r);let e=`figma-imports.${t.typescriptEnabled?"tsx":"jsx"}`,i=t.join(t.componentsDir,e);if(!await t.exists(i)){let n=await t.formatCode(i,Cy(t,i,"figma-imports"));await t.writeFile(i,n),r.push({filePath:i,modifiedType:"create"})}return r}function Cy(t,r,e="page"){let i=t.typescriptEnabled;return t.sdkVersion===te.gen2?`
|
|
754
754
|
import React from "react";
|
|
755
755
|
import {
|
|
756
756
|
Content,
|
|
@@ -928,13 +928,13 @@ export default Counter;
|
|
|
928
928
|
export const CUSTOM_COMPONENTS: RegisteredComponent[] = [
|
|
929
929
|
];`:`export const CUSTOM_COMPONENTS = [
|
|
930
930
|
];
|
|
931
|
-
`}async function vy(t){let r=await o_(t);return{builderPageOptions:async()=>({templateContentId:"2e36438034894a8abf279ea9e6d3596f",pathname:"/builder-demo",title:"Builder + React Demo Page"}),ensureBuilderSetup:()=>xy(r),ensureFigmaImportPage:()=>Ey(r),getRegistryPath:()=>r.registryPath,getRegistry:i=>ti(r,null,!1,!1,null,null,!1,!!i?.readAllInputTypes),addExternalPackage:i=>{r.addExternalPackage(i)},loadComponent:async i=>{let n=await ti(r,i.cmpId,!1,!1,null,null,!1,!1);return{...n,component:n.components.find(s=>s.id===i.cmpId)}},registerComponent:i=>ti(r,i.cmpId,!0,!1,null,null,!0,!1),setRegisteredComponentInfo:i=>ti(r,i.cmpId,!1,!1,i,null,!0,!1),setRegisteredComponentInput:i=>ti(r,i.cmpId,!1,!1,null,i,!0,!1),unregisterComponent:i=>ti(r,i.cmpId,!1,!0,null,null,!0,!1),getPublicApiKey:()=>So(r),setPublicApiKey:i=>gy(r,i.publicApiKey),getDependencies:i=>i.sdkVersion===te.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:()=>Kr(r),setCache:i=>Vr(r,i)}}async function o_(t){let r=await a_(t),e=t.getAppRootDir(),i=t.join(e,"src"),n=await sr(t),s={},o={...t,srcDir:null,builderComponentPath:"",componentsDir:"",registryPath:"",reactConfigPath:r,typescriptEnabled:n,configType:"",addExternalPackage:a=>{s[t.join(e,a,"index.ts")]=`export * from "${a}";`},readFileSync:a=>s[a]??t.readFileSync(a),existsSync:a=>!!s[a]||t.existsSync(a),readdirSync:a=>{let l=t.readdirSync(a);return a===e?[...l,...Object.keys(s).map(u=>u.slice(e.length+1))]:l},readdir:async a=>{let l=await t.readdir(a);return a===e?[...l,...Object.keys(s).map(u=>u.slice(e.length+1))]:l}};return t.sdkVersion?o.sdkVersion=t.sdkVersion:o.sdkVersion=await fs(o),r.includes("webpack.config")&&(o.configType="webpack"),r.includes("vite.config")&&(o.configType="vite"),await t.exists(i)?(o.srcDir=i,o.componentsDir=t.join(i,"components"),o.registryPath=await mr(t,i),o.builderComponentPath=t.join(o.srcDir,`builder-page.${n?"tsx":"jsx"}`)):(o.componentsDir=t.join(e,"components"),o.registryPath=await mr(t,e),o.builderComponentPath=t.join(e,`builder-page.${n?"tsx":"jsx"}`)),o}async function a_(t){let r=["vite.config.ts","vite.config.js","webpack.config.js","webpack.config.ts"];for(let e of r){let i=t.join(t.getAppRootDir(),e);if(await t.exists(i))return i}if(t.ignoreMissingConfig)return"";throw new Error(`Could not find React config file. Searched for ${r.join(", ")} in "${t.getAppRootDir()}".`)}async function wo(t){return await l_(t,["environment.ts"],ll)}async function wy(t,r){let e=await wo(t),i=await d_(t,e.file,e.envKey,r);return{...e,modifiedType:i}}async function l_(t,r,e){let i={envKey:e,envValue:null,file:""};for(let n of r){let s=t.join(t.getAppRootDir(),"src","environments",n),o=await u_(t,s);if(typeof o=="string"&&o.length>0&&o!=="YOUR_API_KEY")return i.envValue=o,i.file=s,i}return i.file=t.join(t.getAppRootDir(),"src","environments",r[r.length-1]),i}async function u_(t,r){let e=await t.readFile(r);return e?c_(t,e):""}function c_(t,r){let e=xe(t,r),i="",s=ls(t,e,"environment");if(s&&s.statement.declarationList.declarations.length>0){let a=s.statement.declarationList.declarations[0].initializer;a&&t.ts.isObjectLiteralExpression(a)&&a.properties.forEach(l=>{t.ts.isPropertyAssignment(l)&&t.ts.isIdentifier(l.name)&&l.name.text===ll&&t.ts.isStringLiteral(l.initializer)&&(i=l.initializer.text)})}return i}async function p_(t,r,e,i){let n=xe(t,r),o=ls(t,n,"environment");if(o&&o.statement.declarationList.declarations.length>0){let a=o.statement.declarationList,l=a.declarations[0],u=l.initializer;if(u&&t.ts.isObjectLiteralExpression(u)){let c=t.ts.factory.createPropertyAssignment(t.ts.factory.createIdentifier(e),t.ts.factory.createStringLiteral(i)),p=t.ts.factory.createNodeArray([...u.properties,c]),d=t.ts.factory.updateObjectLiteralExpression(u,p),h=t.ts.factory.updateVariableDeclaration(l,l.name,l.exclamationToken,l.type,d),f=t.ts.factory.updateVariableDeclarationList(a,[h]);return t.ts.factory.updateVariableStatement(o.statement,o.statement.modifiers,f)}return null}return null}async function d_(t,r,e,i){let n=await t.readFile(r);if(n)if(n.includes(e))t.debug(`"${e}" already set in ${r}`);else{t.debug(`Add "${e}" to ${r}`);let s=await p_(t,n,e,i);if(s){let o=
|
|
931
|
+
`}async function vy(t){let r=await o_(t);return{builderPageOptions:async()=>({templateContentId:"2e36438034894a8abf279ea9e6d3596f",pathname:"/builder-demo",title:"Builder + React Demo Page"}),ensureBuilderSetup:()=>xy(r),ensureFigmaImportPage:()=>Ey(r),getRegistryPath:()=>r.registryPath,getRegistry:i=>ti(r,null,!1,!1,null,null,!1,!!i?.readAllInputTypes),addExternalPackage:i=>{r.addExternalPackage(i)},loadComponent:async i=>{let n=await ti(r,i.cmpId,!1,!1,null,null,!1,!1);return{...n,component:n.components.find(s=>s.id===i.cmpId)}},registerComponent:i=>ti(r,i.cmpId,!0,!1,null,null,!0,!1),setRegisteredComponentInfo:i=>ti(r,i.cmpId,!1,!1,i,null,!0,!1),setRegisteredComponentInput:i=>ti(r,i.cmpId,!1,!1,null,i,!0,!1),unregisterComponent:i=>ti(r,i.cmpId,!1,!0,null,null,!0,!1),getPublicApiKey:()=>So(r),setPublicApiKey:i=>gy(r,i.publicApiKey),getDependencies:i=>i.sdkVersion===te.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:()=>Kr(r),setCache:i=>Vr(r,i)}}async function o_(t){let r=await a_(t),e=t.getAppRootDir(),i=t.join(e,"src"),n=await sr(t),s={},o={...t,srcDir:null,builderComponentPath:"",componentsDir:"",registryPath:"",reactConfigPath:r,typescriptEnabled:n,configType:"",addExternalPackage:a=>{s[t.join(e,a,"index.ts")]=`export * from "${a}";`},readFileSync:a=>s[a]??t.readFileSync(a),existsSync:a=>!!s[a]||t.existsSync(a),readdirSync:a=>{let l=t.readdirSync(a);return a===e?[...l,...Object.keys(s).map(u=>u.slice(e.length+1))]:l},readdir:async a=>{let l=await t.readdir(a);return a===e?[...l,...Object.keys(s).map(u=>u.slice(e.length+1))]:l}};return t.sdkVersion?o.sdkVersion=t.sdkVersion:o.sdkVersion=await fs(o),r.includes("webpack.config")&&(o.configType="webpack"),r.includes("vite.config")&&(o.configType="vite"),await t.exists(i)?(o.srcDir=i,o.componentsDir=t.join(i,"components"),o.registryPath=await mr(t,i),o.builderComponentPath=t.join(o.srcDir,`builder-page.${n?"tsx":"jsx"}`)):(o.componentsDir=t.join(e,"components"),o.registryPath=await mr(t,e),o.builderComponentPath=t.join(e,`builder-page.${n?"tsx":"jsx"}`)),o}async function a_(t){let r=["vite.config.ts","vite.config.js","webpack.config.js","webpack.config.ts"];for(let e of r){let i=t.join(t.getAppRootDir(),e);if(await t.exists(i))return i}if(t.ignoreMissingConfig)return"";throw new Error(`Could not find React config file. Searched for ${r.join(", ")} in "${t.getAppRootDir()}".`)}async function wo(t){return await l_(t,["environment.ts"],ll)}async function wy(t,r){let e=await wo(t),i=await d_(t,e.file,e.envKey,r);return{...e,modifiedType:i}}async function l_(t,r,e){let i={envKey:e,envValue:null,file:""};for(let n of r){let s=t.join(t.getAppRootDir(),"src","environments",n),o=await u_(t,s);if(typeof o=="string"&&o.length>0&&o!=="YOUR_API_KEY")return i.envValue=o,i.file=s,i}return i.file=t.join(t.getAppRootDir(),"src","environments",r[r.length-1]),i}async function u_(t,r){let e=await t.readFile(r);return e?c_(t,e):""}function c_(t,r){let e=xe(t,r),i="",s=ls(t,e,"environment");if(s&&s.statement.declarationList.declarations.length>0){let a=s.statement.declarationList.declarations[0].initializer;a&&t.ts.isObjectLiteralExpression(a)&&a.properties.forEach(l=>{t.ts.isPropertyAssignment(l)&&t.ts.isIdentifier(l.name)&&l.name.text===ll&&t.ts.isStringLiteral(l.initializer)&&(i=l.initializer.text)})}return i}async function p_(t,r,e,i){let n=xe(t,r),o=ls(t,n,"environment");if(o&&o.statement.declarationList.declarations.length>0){let a=o.statement.declarationList,l=a.declarations[0],u=l.initializer;if(u&&t.ts.isObjectLiteralExpression(u)){let c=t.ts.factory.createPropertyAssignment(t.ts.factory.createIdentifier(e),t.ts.factory.createStringLiteral(i)),p=t.ts.factory.createNodeArray([...u.properties,c]),d=t.ts.factory.updateObjectLiteralExpression(u,p),h=t.ts.factory.updateVariableDeclaration(l,l.name,l.exclamationToken,l.type,d),f=t.ts.factory.updateVariableDeclarationList(a,[h]);return t.ts.factory.updateVariableStatement(o.statement,o.statement.modifiers,f)}return null}return null}async function d_(t,r,e,i){let n=await t.readFile(r);if(n)if(n.includes(e))t.debug(`"${e}" already set in ${r}`);else{t.debug(`Add "${e}" to ${r}`);let s=await p_(t,n,e,i);if(s){let o=yt(t,s),a=await t.formatCode(r,o);await t.writeFile(r,a)}return"update"}else{t.debug(`Creating new env file with "${e}" at ${r}`);let s=`
|
|
932
932
|
// https://www.builder.io/c/docs/using-your-api-key
|
|
933
933
|
export const environment = {
|
|
934
934
|
production: false,
|
|
935
935
|
builderApiKey: "${i}",
|
|
936
936
|
};
|
|
937
|
-
`.trimStart(),o=await t.formatCode(r,s);return await t.writeFile(r,o),"create"}return null}var ll="builderApiKey";async function Ay(t,r){let e=[],i=r.getSourceFiles(),n=r.getTypeChecker();return await Promise.all(i.map(async s=>{let o=t.basename(s.fileName);if(m_(t,s.fileName)||o.startsWith(".")||o==="node_modules"||f_.has(o))return;let a=t.normalize(s.fileName);if(a===t.registryPath)return;let l=await ul(t,n,a,s);e.push(...l)})),e.sort((s,o)=>s.cmpInfo.name.localeCompare(o.cmpInfo.name))}var f_=new Set([]),h_=new Set(["node_modules"]);function m_(t,r){for(let e of h_)if(t.dirname(r).includes(e))return!0;return!1}async function Py(t,r){let e=t.extname(r).toLowerCase();if(e===".tsx"||e===".jsx"||e===".ts"||e===".js"){let i=await t.readFile(r);if(i)return g_(t,r,i)}return null}function g_(t,r,e){let i=xe(t,e);return ul(t,null,r,i)}async function ul(t,r,e,i){let n=[],s={};e=t.normalize(e);let o=i.statements.filter(c=>t.ts.isClassDeclaration(c)&&E_(t,c)),a=i.statements.find(c=>t.ts.isImportDeclaration(c)&&t.ts.isStringLiteral(c.moduleSpecifier)&&c.moduleSpecifier.text==="@angular/core");if(a&&t.ts.isImportDeclaration(a)){let c=a.importClause?.namedBindings;if(c&&t.ts.isNamedImports(c)){let p=c.elements.find(d=>(d.propertyName??d.name).text==="input");p&&(s.inputSignalImportName=p.name.text)}}let l=await b_(t,r,e,i),u=C_(t,i);return await Promise.all(o.map(async c=>{let p=await y_(t,r,e,c,u,s);n.push(...p)})),n.push(...l),n}async function ap(t,r,e){if(r.node.fnNode){let{sourceFile:i,typeChecker:n}=await as(t,r.cmpInfo.filePath,e),o=(await ul(t,n,r.cmpInfo.filePath,i)).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 Iy(t,r,e){if(!e.some(a=>!a.isRegistered))return e;let n=await dt(t,e.map(a=>a.filePath)),s=n.getTypeChecker();return await Promise.all(e.filter(a=>!(a.name.endsWith("Page")||a.name.endsWith("Module")||a.name==="AppComponent")).map(async a=>{if(!a.isRegistered){let l=n.getSourceFile(a.filePath);if(l){let c=(await ul(t,s,a.filePath,l)).find(p=>p.cmpInfo.id===a.id);if(c){a.inputs=Fn(t,s,c.node.fnNode);let p=r.find(d=>d.cmpInfo.id===a.id);if(p){let d=await ap(t,p,n);ar(a,d)}}}}return a}))}async function y_(t,r,e,i,n,s){let o=[],a=t.relative(t.getAppRootDir(),e),l=Ue(t,e),u=i.name?.text;if(!u)return o;let c=!1;i.modifiers&&(c=i.modifiers.some(f=>f.kind===t.ts.SyntaxKind.DefaultKeyword));let p=c?"default":u,d=c?"default":"named",h=[];return i.members.forEach(f=>{if(t.ts.isPropertyDeclaration(f)||t.ts.isGetAccessor(f)||t.ts.isSetAccessor(f)){let y=(t.ts.getDecorators(f)??[]).find(C=>D_(t,C))!==void 0&&t.ts.isIdentifier(f.name),b=s?.inputSignalImportName!==void 0&&t.ts.isIdentifier(f.name)&&x_(t,f,s.inputSignalImportName);if(y||b){let C="any";if(t.ts.isSetAccessor(f))C=Ty(t,f.parameters[0].type);else if(f.type&&r){let x=r.getTypeAtLocation(f.type);C=r.typeToString(x)}else C=Ty(t,f.type);let D={name:f.name.text,type:n[C]?"string":C};n[C]&&(D.enum=n[C]),h.push(D)}}}),o.push({cmpInfo:{id:await je(t,e,u),displayFilePath:Ne(t,e),name:Ve(u),inputs:h,exportName:p,exportType:d,importName:u,filePath:e,relFilePath:a,importPath:l,meta:{...v_(t,i)}},node:{name:u,fnNode:i,deps:void 0}}),o}async function b_(t,r,e,i){let n=[],s=t.relative(t.getAppRootDir(),e),o=Ue(t,e);for(let a of i.statements)if(t.ts.isExportDeclaration(a)&&a.exportClause&&t.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 g=r.getSymbolAtLocation(l.name);if(g){let m=r.getDeclaredTypeOfSymbol(g);r.getPropertiesOfType(m).forEach(b=>{let C=b.getDeclarations();C&&C.forEach(D=>{if(t.ts.isPropertyDeclaration(D)){let x=r.getTypeAtLocation(D),E={name:b.getName(),type:S_(t,r,x)};d.push(E)}})})}}let h=t.ts.isExportSpecifier(l)&&l.parent?l.parent.parent:void 0,f;if(h){let g=h.moduleSpecifier;if(g&&t.ts.isStringLiteral(g)){let m=r?.getSymbolAtLocation(g);if(m&&m.declarations&&m.declarations.length>0){let y=m.declarations[0];(!t.ts.isSourceFile(y)||t.ts.isSourceFile(y)&&y.fileName.includes("node_modules"))&&(f=g.text)}}}n.push({cmpInfo:{id:await je(t,e,u,f),displayFilePath:Ne(t,e),name:Ve(u),inputs:d,exportName:c,exportType:p,importName:u,filePath:e,relFilePath:s,importPath:f||o,externalImportPath:f},node:{name:u,fnNode:l,deps:void 0}})}return n}function D_(t,r){return _y(t,r,"Input")}function x_(t,r,e){return t.ts.isPropertyDeclaration(r)&&r.initializer!==void 0&&t.ts.isCallExpression(r.initializer)&&t.ts.isIdentifier(r.initializer.expression)&&r.initializer.expression.text===e}function _y(t,r,e){if(t.ts.isCallExpression(r.expression)){let i=r.expression;if(t.ts.isIdentifier(i.expression))return i.expression?.text===e}return!1}function E_(t,r){return!!t.ts.getDecorators(r)?.some(n=>t.ts.isCallExpression(n.expression)&&t.ts.isIdentifier(n.expression.expression)&&n.expression.expression.text==="Component")}function Ty(t,r){if(!r)return"any";let e="any";switch(r.kind){case t.ts.SyntaxKind.StringKeyword:e="string";break;case t.ts.SyntaxKind.NumberKeyword:e="number";break;case t.ts.SyntaxKind.BooleanKeyword:e="boolean";break;case t.ts.SyntaxKind.TypeReference:t.ts.isTypeReferenceNode(r)&&t.ts.isIdentifier(r.typeName)&&(e=r.typeName.text);break}return e.includes("|")?"string":e}function C_(t,r){let e={};return t.ts.forEachChild(r,i=>{t.ts.isTypeAliasDeclaration(i)&&t.ts.isUnionTypeNode(i.type)&&i.type.types.every(n=>t.ts.isLiteralTypeNode(n)&&t.ts.isStringLiteral(n.literal))&&(e[i.name.text]=i.type.types.map(n=>n.literal.text))}),e}function S_(t,r,e){let i=r.typeToString(e);if(i==="any"){let n=e.getSymbol();if(n){let s=n.getDeclarations();if(s&&s.length>0){let o=s[0];if(t.ts.isVariableDeclaration(o)){let a=o.type;a&&(i=r.typeToString(r.getTypeAtLocation(a)))}}}}return i}function v_(t,r){let{getDecorators:e,isCallExpression:i,isIdentifier:n,isObjectLiteralExpression:s,isPropertyAssignment:o,isStringLiteral:a,SyntaxKind:l}=t.ts,u,c;return e(r)?.forEach(d=>{if(_y(t,d,"Component")){let{expression:h}=d;if(i(h)){let[f]=h.arguments;s(f)&&f.properties.forEach(g=>{o(g)&&n(g.name)&&(g.name.escapedText==="selector"&&a(g.initializer)&&(u=g.initializer.text),g.name.escapedText==="standalone"&&(c=g.initializer.kind===l.TrueKeyword))})}}}),{selector:u,standalone:c}}async function cl(t,r,e){let i=t.typescriptEnabled?".ts":".js",n=`app.module${i}`,s=t.join(t.appDir,n),o=await t.readFile(s);if(!o){console.error(`Unable to read app.module.${i} at ${s}`);return}let a=await w_(t,s,r,e,o);if(!a){console.error(`Unable to update app.module.${i} at ${s}`);return}return await t.writeFile(s,a),s}async function w_(t,r,e,i,n){let s=n,o=xe(t,n),a=Se(t,r,i);o=Ce(t,o,{namedImports:[e],importPath:a}),o=Ce(t,o,{namedImports:["Content"],importPath:"@builder.io/sdk-angular"});let l=[];for(let u of o.statements)if(t.ts.isClassDeclaration(u)&&u.name?.text==="AppModule"){let c=T_(t,e,u);l.push(c)}else l.push(u);return o=t.ts.factory.updateSourceFile(o,l),s=gt(t,o),s}function T_(t,r,e){let i=t.ts.getDecorators(e);if(i){for(let n of i)if(t.ts.isCallExpression(n.expression)&&t.ts.isIdentifier(n.expression.expression)&&n.expression.expression.text==="NgModule"){let s=n.expression.arguments;if(s.length===1&&t.ts.isObjectLiteralExpression(s[0])){let o=Ny(t,s[0],"declarations",r);if(o){let a=Ny(t,o,"imports","Content");if(a&&(o=a),o){let l=t.ts.factory.updateDecorator(n,t.ts.factory.updateCallExpression(n.expression,n.expression.expression,n.expression.typeArguments,[o])),c=[...i.map(p=>p===n?l:p),...t.ts.getModifiers(e)||[]];return t.ts.factory.updateClassDeclaration(e,c,e.name,e.typeParameters,e.heritageClauses,e.members)}}}}}return e}function Ny(t,r,e,i){let n=[...r.properties],s=n.findIndex(a=>Fe(t,a)===e);if(s>-1){let a=n[s];if(t.ts.isPropertyAssignment(a)&&a.initializer&&t.ts.isArrayLiteralExpression(a.initializer)){let l=Fy(t,a.initializer,i);return l?(n[s]=t.ts.factory.updatePropertyAssignment(a,a.name,l),t.ts.factory.updateObjectLiteralExpression(r,n)):null}return null}let o=Fy(t,t.ts.factory.createArrayLiteralExpression([],!0),i);return o?t.ts.factory.updateObjectLiteralExpression(r,[...n,t.ts.factory.createPropertyAssignment(e,o)]):null}function Fy(t,r,e){return r.elements.some(n=>t.ts.isIdentifier(n)?n.text===e:!1)?null:t.ts.factory.updateArrayLiteralExpression(r,[...r.elements,t.ts.factory.createIdentifier(e)])}async function lp(t,r,e,i){try{if(t.magicast){let s=`app.routes${t.typescriptEnabled?".ts":".js"}`,o=t.join(t.appDir,s),a=await t.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=t.magicast.builders.raw("{}");if(p.path=r,p.component=t.magicast.builders.raw(e),c.push(p),a.imports.$items.find(d=>d.imported===e))return;a.imports.$append({imported:e,from:i}),await t.magicast.writeFile(a,o)}}catch(n){console.error(n)}}var Vy=K(Ky(),1);async function zy(t){let r=t.ts.findConfigFile(t.getAppRootDir(),t.existsSync);if(r){let e=await t.readFile(r);if(!e)return;let i=Vy.default.parse(e);if(!i||typeof i!="object"||Array.isArray(i))return;let n=i.compilerOptions;if(!n||typeof n!="object"||Array.isArray(n))return;let s=n.paths;(!s||typeof s!="object"||Array.isArray(s))&&(n.paths={},s=n.paths),Object.assign(n.paths,{"~/*":["./src/*"]}),await t.writeFile(r,JSON.stringify(i,null,2))}}async function Wy(t){let r=[],e=await M_(t,r);r.push(...await ml(t)),await R_(t,e);let i="BuilderPage";if(!await t.exists(t.builderPageComponentPath)){let n=await t.formatCode(t.builderPageComponentPath,Hy(t,i,t.builderPageComponentPath,"builder-page","page",!0));await t.writeFile(t.builderPageComponentPath,n),r.push({filePath:t.builderPageComponentPath,modifiedType:"create"})}if(t.hasAppModule){await cl(t,"Counter",e);let n=await cl(t,i,t.builderPageComponentPath);n&&r.push({filePath:n,modifiedType:"update"})}return await lp(t,"**",i,"./components/builder-page.component"),r}async function Gy(t){let r=[];r.push(...await ml(t));let e="FigmaImportsPage",i="figma-imports.component",n=t.join(t.componentsDir,`${i}.${t.typescriptEnabled?"ts":"js"}`);if(!await t.exists(n)){let s=await t.formatCode(n,Hy(t,e,n,"figma-imports","figma-imports",!1));await t.writeFile(n,s),r.push({filePath:n,modifiedType:"create"})}if(t.hasAppModule){let s=await cl(t,e,n);s&&r.push({filePath:s,modifiedType:"update"})}return await lp(t,"figma-imports",e,`./components/${i}`),await zy(t),r}async function ml(t){let r=[];return await t.exists(t.registryPath)||(await t.writeFile(t.registryPath,L_(t)),r.push({filePath:t.registryPath,modifiedType:"create"})),r}async function R_(t,r){let i=(await ri(t,null,!1,!1,null,null,!1,!1)).components.find(n=>n.filePath===r);i&&await ri(t,i.id,!0,!1,null,null,!0,!1)}function Hy(t,r,e,i,n,s){let o=!t.hasAppModule,a=Se(t,e,t.registryPath),l=t.join(t.getAppRootDir(),"src","environments","environment.ts"),u=Se(t,e,l),c=s?` <ng-container *ngIf="content || isPreviewing; else notFound">
|
|
937
|
+
`.trimStart(),o=await t.formatCode(r,s);return await t.writeFile(r,o),"create"}return null}var ll="builderApiKey";async function Ay(t,r){let e=[],i=r.getSourceFiles(),n=r.getTypeChecker();return await Promise.all(i.map(async s=>{let o=t.basename(s.fileName);if(m_(t,s.fileName)||o.startsWith(".")||o==="node_modules"||f_.has(o))return;let a=t.normalize(s.fileName);if(a===t.registryPath)return;let l=await ul(t,n,a,s);e.push(...l)})),e.sort((s,o)=>s.cmpInfo.name.localeCompare(o.cmpInfo.name))}var f_=new Set([]),h_=new Set(["node_modules"]);function m_(t,r){for(let e of h_)if(t.dirname(r).includes(e))return!0;return!1}async function Py(t,r){let e=t.extname(r).toLowerCase();if(e===".tsx"||e===".jsx"||e===".ts"||e===".js"){let i=await t.readFile(r);if(i)return g_(t,r,i)}return null}function g_(t,r,e){let i=xe(t,e);return ul(t,null,r,i)}async function ul(t,r,e,i){let n=[],s={};e=t.normalize(e);let o=i.statements.filter(c=>t.ts.isClassDeclaration(c)&&E_(t,c)),a=i.statements.find(c=>t.ts.isImportDeclaration(c)&&t.ts.isStringLiteral(c.moduleSpecifier)&&c.moduleSpecifier.text==="@angular/core");if(a&&t.ts.isImportDeclaration(a)){let c=a.importClause?.namedBindings;if(c&&t.ts.isNamedImports(c)){let p=c.elements.find(d=>(d.propertyName??d.name).text==="input");p&&(s.inputSignalImportName=p.name.text)}}let l=await b_(t,r,e,i),u=C_(t,i);return await Promise.all(o.map(async c=>{let p=await y_(t,r,e,c,u,s);n.push(...p)})),n.push(...l),n}async function ap(t,r,e){if(r.node.fnNode){let{sourceFile:i,typeChecker:n}=await as(t,r.cmpInfo.filePath,e),o=(await ul(t,n,r.cmpInfo.filePath,i)).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 Iy(t,r,e){if(!e.some(a=>!a.isRegistered))return e;let n=await dt(t,e.map(a=>a.filePath)),s=n.getTypeChecker();return await Promise.all(e.filter(a=>!(a.name.endsWith("Page")||a.name.endsWith("Module")||a.name==="AppComponent")).map(async a=>{if(!a.isRegistered){let l=n.getSourceFile(a.filePath);if(l){let c=(await ul(t,s,a.filePath,l)).find(p=>p.cmpInfo.id===a.id);if(c){a.inputs=Fn(t,s,c.node.fnNode);let p=r.find(d=>d.cmpInfo.id===a.id);if(p){let d=await ap(t,p,n);ar(a,d)}}}}return a}))}async function y_(t,r,e,i,n,s){let o=[],a=t.relative(t.getAppRootDir(),e),l=Ue(t,e),u=i.name?.text;if(!u)return o;let c=!1;i.modifiers&&(c=i.modifiers.some(f=>f.kind===t.ts.SyntaxKind.DefaultKeyword));let p=c?"default":u,d=c?"default":"named",h=[];return i.members.forEach(f=>{if(t.ts.isPropertyDeclaration(f)||t.ts.isGetAccessor(f)||t.ts.isSetAccessor(f)){let y=(t.ts.getDecorators(f)??[]).find(C=>D_(t,C))!==void 0&&t.ts.isIdentifier(f.name),b=s?.inputSignalImportName!==void 0&&t.ts.isIdentifier(f.name)&&x_(t,f,s.inputSignalImportName);if(y||b){let C="any";if(t.ts.isSetAccessor(f))C=Ty(t,f.parameters[0].type);else if(f.type&&r){let x=r.getTypeAtLocation(f.type);C=r.typeToString(x)}else C=Ty(t,f.type);let D={name:f.name.text,type:n[C]?"string":C};n[C]&&(D.enum=n[C]),h.push(D)}}}),o.push({cmpInfo:{id:await je(t,e,u),displayFilePath:Ne(t,e),name:Ve(u),inputs:h,exportName:p,exportType:d,importName:u,filePath:e,relFilePath:a,importPath:l,meta:{...v_(t,i)}},node:{name:u,fnNode:i,deps:void 0}}),o}async function b_(t,r,e,i){let n=[],s=t.relative(t.getAppRootDir(),e),o=Ue(t,e);for(let a of i.statements)if(t.ts.isExportDeclaration(a)&&a.exportClause&&t.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 g=r.getSymbolAtLocation(l.name);if(g){let m=r.getDeclaredTypeOfSymbol(g);r.getPropertiesOfType(m).forEach(b=>{let C=b.getDeclarations();C&&C.forEach(D=>{if(t.ts.isPropertyDeclaration(D)){let x=r.getTypeAtLocation(D),E={name:b.getName(),type:S_(t,r,x)};d.push(E)}})})}}let h=t.ts.isExportSpecifier(l)&&l.parent?l.parent.parent:void 0,f;if(h){let g=h.moduleSpecifier;if(g&&t.ts.isStringLiteral(g)){let m=r?.getSymbolAtLocation(g);if(m&&m.declarations&&m.declarations.length>0){let y=m.declarations[0];(!t.ts.isSourceFile(y)||t.ts.isSourceFile(y)&&y.fileName.includes("node_modules"))&&(f=g.text)}}}n.push({cmpInfo:{id:await je(t,e,u,f),displayFilePath:Ne(t,e),name:Ve(u),inputs:d,exportName:c,exportType:p,importName:u,filePath:e,relFilePath:s,importPath:f||o,externalImportPath:f},node:{name:u,fnNode:l,deps:void 0}})}return n}function D_(t,r){return _y(t,r,"Input")}function x_(t,r,e){return t.ts.isPropertyDeclaration(r)&&r.initializer!==void 0&&t.ts.isCallExpression(r.initializer)&&t.ts.isIdentifier(r.initializer.expression)&&r.initializer.expression.text===e}function _y(t,r,e){if(t.ts.isCallExpression(r.expression)){let i=r.expression;if(t.ts.isIdentifier(i.expression))return i.expression?.text===e}return!1}function E_(t,r){return!!t.ts.getDecorators(r)?.some(n=>t.ts.isCallExpression(n.expression)&&t.ts.isIdentifier(n.expression.expression)&&n.expression.expression.text==="Component")}function Ty(t,r){if(!r)return"any";let e="any";switch(r.kind){case t.ts.SyntaxKind.StringKeyword:e="string";break;case t.ts.SyntaxKind.NumberKeyword:e="number";break;case t.ts.SyntaxKind.BooleanKeyword:e="boolean";break;case t.ts.SyntaxKind.TypeReference:t.ts.isTypeReferenceNode(r)&&t.ts.isIdentifier(r.typeName)&&(e=r.typeName.text);break}return e.includes("|")?"string":e}function C_(t,r){let e={};return t.ts.forEachChild(r,i=>{t.ts.isTypeAliasDeclaration(i)&&t.ts.isUnionTypeNode(i.type)&&i.type.types.every(n=>t.ts.isLiteralTypeNode(n)&&t.ts.isStringLiteral(n.literal))&&(e[i.name.text]=i.type.types.map(n=>n.literal.text))}),e}function S_(t,r,e){let i=r.typeToString(e);if(i==="any"){let n=e.getSymbol();if(n){let s=n.getDeclarations();if(s&&s.length>0){let o=s[0];if(t.ts.isVariableDeclaration(o)){let a=o.type;a&&(i=r.typeToString(r.getTypeAtLocation(a)))}}}}return i}function v_(t,r){let{getDecorators:e,isCallExpression:i,isIdentifier:n,isObjectLiteralExpression:s,isPropertyAssignment:o,isStringLiteral:a,SyntaxKind:l}=t.ts,u,c;return e(r)?.forEach(d=>{if(_y(t,d,"Component")){let{expression:h}=d;if(i(h)){let[f]=h.arguments;s(f)&&f.properties.forEach(g=>{o(g)&&n(g.name)&&(g.name.escapedText==="selector"&&a(g.initializer)&&(u=g.initializer.text),g.name.escapedText==="standalone"&&(c=g.initializer.kind===l.TrueKeyword))})}}}),{selector:u,standalone:c}}async function cl(t,r,e){let i=t.typescriptEnabled?".ts":".js",n=`app.module${i}`,s=t.join(t.appDir,n),o=await t.readFile(s);if(!o){console.error(`Unable to read app.module.${i} at ${s}`);return}let a=await w_(t,s,r,e,o);if(!a){console.error(`Unable to update app.module.${i} at ${s}`);return}return await t.writeFile(s,a),s}async function w_(t,r,e,i,n){let s=n,o=xe(t,n),a=Se(t,r,i);o=Ce(t,o,{namedImports:[e],importPath:a}),o=Ce(t,o,{namedImports:["Content"],importPath:"@builder.io/sdk-angular"});let l=[];for(let u of o.statements)if(t.ts.isClassDeclaration(u)&&u.name?.text==="AppModule"){let c=T_(t,e,u);l.push(c)}else l.push(u);return o=t.ts.factory.updateSourceFile(o,l),s=yt(t,o),s}function T_(t,r,e){let i=t.ts.getDecorators(e);if(i){for(let n of i)if(t.ts.isCallExpression(n.expression)&&t.ts.isIdentifier(n.expression.expression)&&n.expression.expression.text==="NgModule"){let s=n.expression.arguments;if(s.length===1&&t.ts.isObjectLiteralExpression(s[0])){let o=Ny(t,s[0],"declarations",r);if(o){let a=Ny(t,o,"imports","Content");if(a&&(o=a),o){let l=t.ts.factory.updateDecorator(n,t.ts.factory.updateCallExpression(n.expression,n.expression.expression,n.expression.typeArguments,[o])),c=[...i.map(p=>p===n?l:p),...t.ts.getModifiers(e)||[]];return t.ts.factory.updateClassDeclaration(e,c,e.name,e.typeParameters,e.heritageClauses,e.members)}}}}}return e}function Ny(t,r,e,i){let n=[...r.properties],s=n.findIndex(a=>Fe(t,a)===e);if(s>-1){let a=n[s];if(t.ts.isPropertyAssignment(a)&&a.initializer&&t.ts.isArrayLiteralExpression(a.initializer)){let l=Fy(t,a.initializer,i);return l?(n[s]=t.ts.factory.updatePropertyAssignment(a,a.name,l),t.ts.factory.updateObjectLiteralExpression(r,n)):null}return null}let o=Fy(t,t.ts.factory.createArrayLiteralExpression([],!0),i);return o?t.ts.factory.updateObjectLiteralExpression(r,[...n,t.ts.factory.createPropertyAssignment(e,o)]):null}function Fy(t,r,e){return r.elements.some(n=>t.ts.isIdentifier(n)?n.text===e:!1)?null:t.ts.factory.updateArrayLiteralExpression(r,[...r.elements,t.ts.factory.createIdentifier(e)])}async function lp(t,r,e,i){try{if(t.magicast){let s=`app.routes${t.typescriptEnabled?".ts":".js"}`,o=t.join(t.appDir,s),a=await t.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=t.magicast.builders.raw("{}");if(p.path=r,p.component=t.magicast.builders.raw(e),c.push(p),a.imports.$items.find(d=>d.imported===e))return;a.imports.$append({imported:e,from:i}),await t.magicast.writeFile(a,o)}}catch(n){console.error(n)}}var Vy=K(Ky(),1);async function zy(t){let r=t.ts.findConfigFile(t.getAppRootDir(),t.existsSync);if(r){let e=await t.readFile(r);if(!e)return;let i=Vy.default.parse(e);if(!i||typeof i!="object"||Array.isArray(i))return;let n=i.compilerOptions;if(!n||typeof n!="object"||Array.isArray(n))return;let s=n.paths;(!s||typeof s!="object"||Array.isArray(s))&&(n.paths={},s=n.paths),Object.assign(n.paths,{"~/*":["./src/*"]}),await t.writeFile(r,JSON.stringify(i,null,2))}}async function Wy(t){let r=[],e=await M_(t,r);r.push(...await ml(t)),await R_(t,e);let i="BuilderPage";if(!await t.exists(t.builderPageComponentPath)){let n=await t.formatCode(t.builderPageComponentPath,Hy(t,i,t.builderPageComponentPath,"builder-page","page",!0));await t.writeFile(t.builderPageComponentPath,n),r.push({filePath:t.builderPageComponentPath,modifiedType:"create"})}if(t.hasAppModule){await cl(t,"Counter",e);let n=await cl(t,i,t.builderPageComponentPath);n&&r.push({filePath:n,modifiedType:"update"})}return await lp(t,"**",i,"./components/builder-page.component"),r}async function Gy(t){let r=[];r.push(...await ml(t));let e="FigmaImportsPage",i="figma-imports.component",n=t.join(t.componentsDir,`${i}.${t.typescriptEnabled?"ts":"js"}`);if(!await t.exists(n)){let s=await t.formatCode(n,Hy(t,e,n,"figma-imports","figma-imports",!1));await t.writeFile(n,s),r.push({filePath:n,modifiedType:"create"})}if(t.hasAppModule){let s=await cl(t,e,n);s&&r.push({filePath:s,modifiedType:"update"})}return await lp(t,"figma-imports",e,`./components/${i}`),await zy(t),r}async function ml(t){let r=[];return await t.exists(t.registryPath)||(await t.writeFile(t.registryPath,L_(t)),r.push({filePath:t.registryPath,modifiedType:"create"})),r}async function R_(t,r){let i=(await ri(t,null,!1,!1,null,null,!1,!1)).components.find(n=>n.filePath===r);i&&await ri(t,i.id,!0,!1,null,null,!0,!1)}function Hy(t,r,e,i,n,s){let o=!t.hasAppModule,a=Se(t,e,t.registryPath),l=t.join(t.getAppRootDir(),"src","environments","environment.ts"),u=Se(t,e,l),c=s?` <ng-container *ngIf="content || isPreviewing; else notFound">
|
|
938
938
|
<builder-content
|
|
939
939
|
[model]="model"
|
|
940
940
|
[content]="content"
|
|
@@ -1073,7 +1073,7 @@ export class Counter {
|
|
|
1073
1073
|
}
|
|
1074
1074
|
}
|
|
1075
1075
|
|
|
1076
|
-
`.trimStart()}async function Jy(t){await ml(t);let r=await t.readFile(t.registryPath);return r?$_(t,r):{components:[],sourceFile:xe(t,"")}}async function $_(t,r){let e=xe(t,r);return U_(t,e)}async function U_(t,r){let e=[],i=lt(t,r,"CUSTOM_COMPONENTS");return i&&await Promise.all(i.arrayLiteralExp.elements.map(async(n,s)=>{let o=await yp(t,r,n);o&&(o.nodeIndex=s,e.push(o))})),{sourceFile:r,components:Ht(e)}}async function yp(t,r,e){if(!t.ts.isObjectLiteralExpression(e))return null;let i={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[]};for(let n of e.properties){if(!t.ts.isPropertyAssignment(n)||!t.ts.isIdentifier(n.name))continue;if(Fe(t,n)==="component"){let o,{initializer:a}=n;if(t.ts.isIdentifier(a))o=a.text;else if(t.ts.isCallExpression(a)){let u=a.arguments[0];t.ts.isIdentifier(u)&&(o=u.text)}if(!o)continue;i.name===""&&(i.name=Ve(o)),i.importName=o;let l=await Wr(t,t.registryPath,r,o);if(!l)continue;if(i.filePath=l.filePath,i.relFilePath=l.relFilePath,await t.exists(l.filePath)?i.importPath=Ue(t,l.filePath):(i.externalImportPath=l.importPath,i.importPath=i.externalImportPath),i.displayFilePath=l.displayFilePath,i.exportType=l.exportType,i.externalImportPath)i.exportName=o;else{let u=await Py(t,l.filePath);if(u&&u.length>0)if(u.length===1)i.exportName=u[0].cmpInfo.exportName;else{let c=u.find(p=>p.cmpInfo.exportName===o);c&&(i.exportName=c.cmpInfo.exportName)}}continue}}return i=Jt(t,i,e),i.filePath&&i.exportName&&(i.id=await je(t,i.filePath,i.exportName,i.externalImportPath)),i}async function ri(t,r,e,i,n,s,o,a){let l=await sn(t),[u,c,p]=await Promise.all([Ay(t,l),Jy(t),wo(t)]),d=u.map(b=>b.cmpInfo),h=c.components,f={components:Pr(d,h),registryPath:t.registryPath,registryDisplayPath:Ne(t,t.registryPath),frameworks:t.getFrameworks(),dependencies:Gr(d),publicApiKey:p.envValue??void 0,devToolsVersion:t.version};if(a)return f.components=await Iy(t,u,f.components),f;let g=!1,m=c.sourceFile,y=Array.isArray(r)?r:typeof r=="string"?[r]:[];if(y.length>0){let b=y.map(x=>{let E=u.find(w=>w.cmpInfo.id===x);if(!E)throw new Error(`Component ${x} not found`);return E}),C=Array.from(new Set(b.map(x=>x.cmpInfo.filePath))),D=await dt(t,C);for(let x of b){let E=f.components.find(Z=>Z.id===x.cmpInfo.id),w=await ap(t,x,D);ar(E,w);let R=d.findIndex(Z=>Z.id===x.cmpInfo.id);d[R].inputs=w;let M=Xr(x.cmpInfo.id,d,h,e,i,n,s),{elements:T,elmIndex:L,statementIndex:Q,statement:ie,variableDeclaration:re}=await q_(t,m,x);if(M.addCmpToRegistry)T.push(j_(t,M.addCmpToRegistry)),g=!0;else if(M.removeCmpFromRegistry)T.splice(L,1),g=!0;else if(M.updateRegisteredCmp){let Z=pt(t,T[L],M.updateRegisteredCmp);T[L]=t.ts.factory.updateObjectLiteralExpression(Z,[Yy(t,M.updateRegisteredCmp),...Z.properties.slice(1)]),g=!0}if(g&&o){let Z=[...m.statements];Z[Q]=t.ts.factory.updateVariableStatement(ie,ie.modifiers,t.ts.factory.updateVariableDeclarationList(ie.declarationList,[t.ts.factory.updateVariableDeclaration(re,re.name,re.exclamationToken,re.type,t.ts.factory.createArrayLiteralExpression(Jr(t,T)))])),m=t.ts.factory.updateSourceFile(m,Z),E.exportType==="named"?m=Ce(t,m,{namedImports:[E.importName],importPath:E.externalImportPath?E.externalImportPath:Se(t,t.registryPath,E.filePath)}):m=Ce(t,m,{defaultImport:E.importName,importPath:E.externalImportPath?E.externalImportPath:Se(t,t.registryPath,E.filePath)}),m=Ce(t,m,{namedImports:["RegisteredComponent"],importPath:"@builder.io/sdk-angular",isTypeOnly:!0}),m=Qr(t,m,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),f.components=M.components,h=M.components.filter(Pe=>Pe.isRegistered)}}}if(g&&o){m=Yr(t,m),m=Hr(t,m);let b=gt(t,m);b=Ar(b),b=await t.formatCode(t.registryPath,b),await t.writeFile(t.registryPath,b)}return f}function Yy(t,r){let e=t.ts.factory.createIdentifier(r.importName);return t.ts.factory.createPropertyAssignment("component",e)}function j_(t,r){return pt(t,t.ts.factory.createObjectLiteralExpression([Yy(t,r)],!0),r)}async function q_(t,r,e){let i=lt(t,r,"CUSTOM_COMPONENTS");if(!i)throw new Error(`Exported name of the Builder registry must be "CUSTOM_COMPONENTS". Please update your Builder registry file: ${t.registryPath}`);let n=i.arrayLiteralExp.elements.filter(o=>t.ts.isObjectLiteralExpression(o)),s=-1;for(let o=0;o<n.length;o++)if((await yp(t,r,n[o]))?.id===e.cmpInfo.id){s=o;break}return{...i,elements:n,elmIndex:s}}async function Xy(t){let r=await K_(t),e={};return{builderPageOptions:async()=>({templateContentId:"f0b8016ac92e474699293211a268ebaa",pathname:"/builder-demo",title:"Builder + Angular Demo Page"}),ensureBuilderSetup:()=>Wy(r),ensureFigmaImportPage:()=>Gy(r),getRegistryPath:()=>r.registryPath,getRegistry:n=>ri(r,null,!1,!1,null,null,!1,!!n?.readAllInputTypes),addExternalPackage:async n=>{e[n]||(e[n]=`export * from "${n}";`)},loadComponent:async n=>{let s=await ri(r,n.cmpId,!1,!1,null,null,!1,!1);return{...s,component:s.components.find(o=>o.id===n.cmpId)}},registerComponent:n=>ri(r,n.cmpId,!0,!1,null,null,!0,!1),setRegisteredComponentInfo:n=>ri(r,n.cmpId,!1,!1,n,null,!0,!1),setRegisteredComponentInput:n=>ri(r,n.cmpId,!1,!1,null,n,!0,!1),unregisterComponent:n=>ri(r,n.cmpId,!1,!0,null,null,!0,!1),getPublicApiKey:()=>wo(r),setPublicApiKey:n=>wy(r,n.publicApiKey),getDependencies:n=>[{name:"@builder.io/dev-tools"},{name:"@builder.io/sdk-angular"},{name:"concurrently"}],getDevRunCommand:()=>"builder-dev",getCache:()=>Kr(r),setCache:n=>Vr(r,n)}}async function K_(t){let r=await V_(t),e=t.getAppRootDir(),i=t.join(e,"src"),n=await sr(t),s=t.join(i,"app"),o=await mr(t,s),a={...t,srcDir:"",appDir:"",componentsDir:"",registryPath:o,angularConfigPath:r,typescriptEnabled:n,builderPageComponentPath:"",hasAppModule:!1};if(!await t.exists(i))throw new Error(`Could not find src directory. Searched for src in "${t.getAppRootDir()}".`);a.srcDir=i,a.appDir=s,a.componentsDir=t.join(a.appDir,"components"),a.builderPageComponentPath=t.join(a.componentsDir,`builder-page.component.${n?"ts":"js"}`);let l=`app.module.${n?"ts":"js"}`,u=t.join(a.appDir,l);return await t.exists(u)&&(a.hasAppModule=!0),a}async function V_(t){let r=t.join(t.getAppRootDir(),"angular.json");if(await t.exists(r))return r;let e=t.join(t.getAppRootDir(),"project.json");if(await t.exists(e))return e;throw new Error(`Could not find Angular config file. Searched for angular.json & project.json in "${t.getAppRootDir()}".`)}var El=K(cb(),1);async function pb(t,r){let i={components:(await r.getRegistry()).components.filter(s=>s.isRegistered).map(s=>{let o={filePath:Tr(t.relative(t.getAppRootDir(),s.filePath)),name:s.name,image:s.image,description:s.description,exportName:s.exportName,inputs:or(s.inputs)};return or(o)}),version:1};t.debug("exporting registry components:",i.components.length);let n=(0,El.compress)(i);return btoa(JSON.stringify(n))}async function db(t,r,e){if(typeof e!="string")throw new Error("Invalid registry to import");let i=await r.getRegistry(),n=JSON.parse(atob(e)),s=(0,El.decompress)(n),o=or(i);t.debug("importing registry components:",s.components.length);for(let a of s.components){let l=Tr(t.normalize(a.filePath)),u=i.components.find(p=>Tr(p.filePath).endsWith(l)&&p.exportName===a.exportName);if(!u){console.error(`Could not find component to register: ${a.filePath}, ${a.exportName}`);continue}t.debug(`register (${u.id})`,u.filePath),await r.registerComponent({cmpId:u.id});for(let p of a.inputs)t.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});t.debug(`set input (${u.id}) info`);let c=await r.setRegisteredComponentInfo({cmpId:u.id,name:a.name,image:a.image,description:a.description});o=or(c)}return o}var _r={react:"react",remix:"remix",angular:"angular",next:"next",qwik:"qwik"},fj={[_r.react]:[{version:te.gen1,recommended:!0},{version:te.gen2,recommended:!1}],[_r.remix]:[{version:te.gen1,recommended:!1},{version:te.gen2,recommended:!0}],[_r.angular]:[{version:te.gen2,recommended:!0}],[_r.next]:[{version:te.gen1,recommended:!0},{version:te.gen2,recommended:!1}],[_r.qwik]:[{version:te.gen2,recommended:!0}]};async function fb(t,r){let e=[],i=new Set;async function n(a){let l=t.join(a,"package.json");try{let u=await t.readFile(l);if(u===null)throw new Error(`Failed to read package.json at ${l}`);let c=JSON.parse(u);if(i.has(c.name))return null;i.add(c.name);let p={name:c.name,subPackages:[]},d=await t.readdir(a);for(let h of d)h!=="node_modules"&&(await t.stat(t.join(a,h))).isDirectory()&&p.subPackages.push(h);return e.push(p),p}catch(u){return console.error(`Error reading package.json at ${a}:`,u),null}}let s=t.join(r,"package.json"),o=await t.readFile(s);if(o!==null){let a=JSON.parse(o),l={...a.dependencies,...a.devDependencies};for(let u of Object.keys(l)){let c=t.join(r,"node_modules",u);await n(c)}if(a.workspaces)for(let u of a.workspaces){let c=await t.readdir(t.join(r,u));for(let p of c){let d=t.join(r,u,p);await n(d)}}}return e}var hN={"@builder.io/qwik-city":ay,next:Yg,"@remix-run/react":my,react:vy,"@angular/core":Xy},mN={"@builder.io/qwik-city":_r.qwik,next:_r.next,"@remix-run/react":_r.remix,react:_r.react,"@angular/core":_r.angular};async function ln(t){if(!t.ts)throw new Error("createDevTools() requires a TypeScript instance passed to the 'ts' option");if((!t.frameworks||t.frameworks.length===0)&&(t.frameworks=await Nn(t)),t.frameworks.length===0)throw new Error("Supported Devtools framework for not found");for(let r of t.frameworks){let e=hN[r.name];if(e){if(r.name==="next"&&await dg(t))throw new Error("Turbopack does not support the Builder.io devtools cli. Please disable Turbopack or manually integrate Builder.io into your Next.js project.");let i=await e(t);return{...i,exportRegistry:()=>pb(t,i),importRegistry:s=>db(t,i,s),framework:mN[r.name],findAllDependencies:async()=>await fb(t,t.getRepoRootDir())}}}throw new Error(`Devtools framework not found for ${t.getAppRootDir()}, ${JSON.stringify(t.frameworks,null,2)}`)}var aq=`
|
|
1076
|
+
`.trimStart()}async function Jy(t){await ml(t);let r=await t.readFile(t.registryPath);return r?$_(t,r):{components:[],sourceFile:xe(t,"")}}async function $_(t,r){let e=xe(t,r);return U_(t,e)}async function U_(t,r){let e=[],i=lt(t,r,"CUSTOM_COMPONENTS");return i&&await Promise.all(i.arrayLiteralExp.elements.map(async(n,s)=>{let o=await yp(t,r,n);o&&(o.nodeIndex=s,e.push(o))})),{sourceFile:r,components:Ht(e)}}async function yp(t,r,e){if(!t.ts.isObjectLiteralExpression(e))return null;let i={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[]};for(let n of e.properties){if(!t.ts.isPropertyAssignment(n)||!t.ts.isIdentifier(n.name))continue;if(Fe(t,n)==="component"){let o,{initializer:a}=n;if(t.ts.isIdentifier(a))o=a.text;else if(t.ts.isCallExpression(a)){let u=a.arguments[0];t.ts.isIdentifier(u)&&(o=u.text)}if(!o)continue;i.name===""&&(i.name=Ve(o)),i.importName=o;let l=await Wr(t,t.registryPath,r,o);if(!l)continue;if(i.filePath=l.filePath,i.relFilePath=l.relFilePath,await t.exists(l.filePath)?i.importPath=Ue(t,l.filePath):(i.externalImportPath=l.importPath,i.importPath=i.externalImportPath),i.displayFilePath=l.displayFilePath,i.exportType=l.exportType,i.externalImportPath)i.exportName=o;else{let u=await Py(t,l.filePath);if(u&&u.length>0)if(u.length===1)i.exportName=u[0].cmpInfo.exportName;else{let c=u.find(p=>p.cmpInfo.exportName===o);c&&(i.exportName=c.cmpInfo.exportName)}}continue}}return i=Jt(t,i,e),i.filePath&&i.exportName&&(i.id=await je(t,i.filePath,i.exportName,i.externalImportPath)),i}async function ri(t,r,e,i,n,s,o,a){let l=await sn(t),[u,c,p]=await Promise.all([Ay(t,l),Jy(t),wo(t)]),d=u.map(b=>b.cmpInfo),h=c.components,f={components:Pr(d,h),registryPath:t.registryPath,registryDisplayPath:Ne(t,t.registryPath),frameworks:t.getFrameworks(),dependencies:Gr(d),publicApiKey:p.envValue??void 0,devToolsVersion:t.version};if(a)return f.components=await Iy(t,u,f.components),f;let g=!1,m=c.sourceFile,y=Array.isArray(r)?r:typeof r=="string"?[r]:[];if(y.length>0){let b=y.map(x=>{let E=u.find(w=>w.cmpInfo.id===x);if(!E)throw new Error(`Component ${x} not found`);return E}),C=Array.from(new Set(b.map(x=>x.cmpInfo.filePath))),D=await dt(t,C);for(let x of b){let E=f.components.find(Z=>Z.id===x.cmpInfo.id),w=await ap(t,x,D);ar(E,w);let R=d.findIndex(Z=>Z.id===x.cmpInfo.id);d[R].inputs=w;let M=Xr(x.cmpInfo.id,d,h,e,i,n,s),{elements:T,elmIndex:L,statementIndex:Q,statement:ie,variableDeclaration:re}=await q_(t,m,x);if(M.addCmpToRegistry)T.push(j_(t,M.addCmpToRegistry)),g=!0;else if(M.removeCmpFromRegistry)T.splice(L,1),g=!0;else if(M.updateRegisteredCmp){let Z=pt(t,T[L],M.updateRegisteredCmp);T[L]=t.ts.factory.updateObjectLiteralExpression(Z,[Yy(t,M.updateRegisteredCmp),...Z.properties.slice(1)]),g=!0}if(g&&o){let Z=[...m.statements];Z[Q]=t.ts.factory.updateVariableStatement(ie,ie.modifiers,t.ts.factory.updateVariableDeclarationList(ie.declarationList,[t.ts.factory.updateVariableDeclaration(re,re.name,re.exclamationToken,re.type,t.ts.factory.createArrayLiteralExpression(Jr(t,T)))])),m=t.ts.factory.updateSourceFile(m,Z),E.exportType==="named"?m=Ce(t,m,{namedImports:[E.importName],importPath:E.externalImportPath?E.externalImportPath:Se(t,t.registryPath,E.filePath)}):m=Ce(t,m,{defaultImport:E.importName,importPath:E.externalImportPath?E.externalImportPath:Se(t,t.registryPath,E.filePath)}),m=Ce(t,m,{namedImports:["RegisteredComponent"],importPath:"@builder.io/sdk-angular",isTypeOnly:!0}),m=Qr(t,m,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),f.components=M.components,h=M.components.filter(Pe=>Pe.isRegistered)}}}if(g&&o){m=Yr(t,m),m=Hr(t,m);let b=yt(t,m);b=Ar(b),b=await t.formatCode(t.registryPath,b),await t.writeFile(t.registryPath,b)}return f}function Yy(t,r){let e=t.ts.factory.createIdentifier(r.importName);return t.ts.factory.createPropertyAssignment("component",e)}function j_(t,r){return pt(t,t.ts.factory.createObjectLiteralExpression([Yy(t,r)],!0),r)}async function q_(t,r,e){let i=lt(t,r,"CUSTOM_COMPONENTS");if(!i)throw new Error(`Exported name of the Builder registry must be "CUSTOM_COMPONENTS". Please update your Builder registry file: ${t.registryPath}`);let n=i.arrayLiteralExp.elements.filter(o=>t.ts.isObjectLiteralExpression(o)),s=-1;for(let o=0;o<n.length;o++)if((await yp(t,r,n[o]))?.id===e.cmpInfo.id){s=o;break}return{...i,elements:n,elmIndex:s}}async function Xy(t){let r=await K_(t),e={};return{builderPageOptions:async()=>({templateContentId:"f0b8016ac92e474699293211a268ebaa",pathname:"/builder-demo",title:"Builder + Angular Demo Page"}),ensureBuilderSetup:()=>Wy(r),ensureFigmaImportPage:()=>Gy(r),getRegistryPath:()=>r.registryPath,getRegistry:n=>ri(r,null,!1,!1,null,null,!1,!!n?.readAllInputTypes),addExternalPackage:async n=>{e[n]||(e[n]=`export * from "${n}";`)},loadComponent:async n=>{let s=await ri(r,n.cmpId,!1,!1,null,null,!1,!1);return{...s,component:s.components.find(o=>o.id===n.cmpId)}},registerComponent:n=>ri(r,n.cmpId,!0,!1,null,null,!0,!1),setRegisteredComponentInfo:n=>ri(r,n.cmpId,!1,!1,n,null,!0,!1),setRegisteredComponentInput:n=>ri(r,n.cmpId,!1,!1,null,n,!0,!1),unregisterComponent:n=>ri(r,n.cmpId,!1,!0,null,null,!0,!1),getPublicApiKey:()=>wo(r),setPublicApiKey:n=>wy(r,n.publicApiKey),getDependencies:n=>[{name:"@builder.io/dev-tools"},{name:"@builder.io/sdk-angular"},{name:"concurrently"}],getDevRunCommand:()=>"builder-dev",getCache:()=>Kr(r),setCache:n=>Vr(r,n)}}async function K_(t){let r=await V_(t),e=t.getAppRootDir(),i=t.join(e,"src"),n=await sr(t),s=t.join(i,"app"),o=await mr(t,s),a={...t,srcDir:"",appDir:"",componentsDir:"",registryPath:o,angularConfigPath:r,typescriptEnabled:n,builderPageComponentPath:"",hasAppModule:!1};if(!await t.exists(i))throw new Error(`Could not find src directory. Searched for src in "${t.getAppRootDir()}".`);a.srcDir=i,a.appDir=s,a.componentsDir=t.join(a.appDir,"components"),a.builderPageComponentPath=t.join(a.componentsDir,`builder-page.component.${n?"ts":"js"}`);let l=`app.module.${n?"ts":"js"}`,u=t.join(a.appDir,l);return await t.exists(u)&&(a.hasAppModule=!0),a}async function V_(t){let r=t.join(t.getAppRootDir(),"angular.json");if(await t.exists(r))return r;let e=t.join(t.getAppRootDir(),"project.json");if(await t.exists(e))return e;throw new Error(`Could not find Angular config file. Searched for angular.json & project.json in "${t.getAppRootDir()}".`)}var El=K(cb(),1);async function pb(t,r){let i={components:(await r.getRegistry()).components.filter(s=>s.isRegistered).map(s=>{let o={filePath:Tr(t.relative(t.getAppRootDir(),s.filePath)),name:s.name,image:s.image,description:s.description,exportName:s.exportName,inputs:or(s.inputs)};return or(o)}),version:1};t.debug("exporting registry components:",i.components.length);let n=(0,El.compress)(i);return btoa(JSON.stringify(n))}async function db(t,r,e){if(typeof e!="string")throw new Error("Invalid registry to import");let i=await r.getRegistry(),n=JSON.parse(atob(e)),s=(0,El.decompress)(n),o=or(i);t.debug("importing registry components:",s.components.length);for(let a of s.components){let l=Tr(t.normalize(a.filePath)),u=i.components.find(p=>Tr(p.filePath).endsWith(l)&&p.exportName===a.exportName);if(!u){console.error(`Could not find component to register: ${a.filePath}, ${a.exportName}`);continue}t.debug(`register (${u.id})`,u.filePath),await r.registerComponent({cmpId:u.id});for(let p of a.inputs)t.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});t.debug(`set input (${u.id}) info`);let c=await r.setRegisteredComponentInfo({cmpId:u.id,name:a.name,image:a.image,description:a.description});o=or(c)}return o}var _r={react:"react",remix:"remix",angular:"angular",next:"next",qwik:"qwik"},fj={[_r.react]:[{version:te.gen1,recommended:!0},{version:te.gen2,recommended:!1}],[_r.remix]:[{version:te.gen1,recommended:!1},{version:te.gen2,recommended:!0}],[_r.angular]:[{version:te.gen2,recommended:!0}],[_r.next]:[{version:te.gen1,recommended:!0},{version:te.gen2,recommended:!1}],[_r.qwik]:[{version:te.gen2,recommended:!0}]};async function fb(t,r){let e=[],i=new Set;async function n(a){let l=t.join(a,"package.json");try{let u=await t.readFile(l);if(u===null)throw new Error(`Failed to read package.json at ${l}`);let c=JSON.parse(u);if(i.has(c.name))return null;i.add(c.name);let p={name:c.name,subPackages:[]},d=await t.readdir(a);for(let h of d)h!=="node_modules"&&(await t.stat(t.join(a,h))).isDirectory()&&p.subPackages.push(h);return e.push(p),p}catch(u){return console.error(`Error reading package.json at ${a}:`,u),null}}let s=t.join(r,"package.json"),o=await t.readFile(s);if(o!==null){let a=JSON.parse(o),l={...a.dependencies,...a.devDependencies};for(let u of Object.keys(l)){let c=t.join(r,"node_modules",u);await n(c)}if(a.workspaces)for(let u of a.workspaces){let c=await t.readdir(t.join(r,u));for(let p of c){let d=t.join(r,u,p);await n(d)}}}return e}var hN={"@builder.io/qwik-city":ay,next:Yg,"@remix-run/react":my,react:vy,"@angular/core":Xy},mN={"@builder.io/qwik-city":_r.qwik,next:_r.next,"@remix-run/react":_r.remix,react:_r.react,"@angular/core":_r.angular};async function ln(t){if(!t.ts)throw new Error("createDevTools() requires a TypeScript instance passed to the 'ts' option");if((!t.frameworks||t.frameworks.length===0)&&(t.frameworks=await Nn(t)),t.frameworks.length===0)throw new Error("Supported Devtools framework for not found");for(let r of t.frameworks){let e=hN[r.name];if(e){if(r.name==="next"&&await dg(t))throw new Error("Turbopack does not support the Builder.io devtools cli. Please disable Turbopack or manually integrate Builder.io into your Next.js project.");let i=await e(t);return{...i,exportRegistry:()=>pb(t,i),importRegistry:s=>db(t,i,s),framework:mN[r.name],findAllDependencies:async()=>await fb(t,t.getRepoRootDir())}}}throw new Error(`Devtools framework not found for ${t.getAppRootDir()}, ${JSON.stringify(t.frameworks,null,2)}`)}var aq=`
|
|
1077
1077
|
/** @type {import('next').NextConfig} */
|
|
1078
1078
|
const nextConfig = {
|
|
1079
1079
|
}
|
|
@@ -1081,11 +1081,11 @@ const nextConfig = {
|
|
|
1081
1081
|
module.exports = nextConfig
|
|
1082
1082
|
`.trimStart();var lc=K(qE(),1),Ra=K(require("fs"),1);function y2(t){let r=t.regex,e=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",n="[a-zA-Z_]\\w*::",o="(?!struct)("+i+"|"+r.optional(n)+"[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:[t.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:"."},t.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},t.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},e,t.C_BLOCK_COMMENT_MODE]},d={className:"title",begin:r.optional(n)+t.IDENT_RE,relevance:0},h=r.optional(n)+t.IDENT_RE+"\\s*\\(",f=["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"],g=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],m=["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"],D={type:g,keyword:f,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:m},x={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:r.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,r.lookahead(/(<[^<>]+>|)\s*\(/))},E=[x,p,a,e,t.C_BLOCK_COMMENT_MODE,c,u],w={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:D,contains:E.concat([{begin:/\(/,end:/\)/,keywords:D,contains:E.concat(["self"]),relevance:0}]),relevance:0},R={className:"function",begin:"("+o+"[\\*&\\s]+)+"+h,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:D,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:D,relevance:0},{begin:h,returnBegin:!0,contains:[d],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,c]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:D,relevance:0,contains:[e,t.C_BLOCK_COMMENT_MODE,u,c,a,{begin:/\(/,end:/\)/,keywords:D,relevance:0,contains:["self",e,t.C_BLOCK_COMMENT_MODE,u,c,a]}]},a,e,t.C_BLOCK_COMMENT_MODE,p]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:D,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(w,R,x,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:D,contains:["self",a]},{begin:t.IDENT_RE+"::",keywords:D},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function KE(t){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"]},e=y2(t),i=e.keywords;return i.type=[...i.type,...r.type],i.literal=[...i.literal,...r.literal],i.built_in=[...i.built_in,...r.built_in],i._hints=r._hints,e.name="Arduino",e.aliases=["ino"],e.supersetOf="cpp",e}function VE(t){let r=t.regex,e={},i={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[e]}]};Object.assign(e,{className:"variable",variants:[{begin:r.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},i]});let n={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},s={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},o={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,e,n]};n.contains.push(o);let a={match:/\\"/},l={className:"string",begin:/'/,end:/'/},u={match:/\\'/},c={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,e]},p=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],d=t.SHEBANG({binary:`(${p.join("|")})`,relevance:10}),h={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[t.inherit(t.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},f=["if","then","else","elif","fi","for","while","until","in","do","done","case","esac","function","select"],g=["true","false"],m={match:/(\/[a-z._-]+)+/},y=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],b=["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"],D=["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:f,literal:g,built_in:[...y,...b,"set","shopt",...C,...D]},contains:[d,t.SHEBANG(),h,c,t.HASH_COMMENT_MODE,s,m,o,a,l,u,e]}}function zE(t){let r=t.regex,e=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",n="[a-zA-Z_]\\w*::",o="("+i+"|"+r.optional(n)+"[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:[t.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:"."},t.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},t.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},e,t.C_BLOCK_COMMENT_MODE]},d={className:"title",begin:r.optional(n)+t.IDENT_RE,relevance:0},h=r.optional(n)+t.IDENT_RE+"\\s*\\(",m={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,e,t.C_BLOCK_COMMENT_MODE,c,u],b={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:m,contains:y.concat([{begin:/\(/,end:/\)/,keywords:m,contains:y.concat(["self"]),relevance:0}]),relevance:0},C={begin:"("+o+"[\\*&\\s]+)+"+h,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:m,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:m,relevance:0},{begin:h,returnBegin:!0,contains:[t.inherit(d,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:m,relevance:0,contains:[e,t.C_BLOCK_COMMENT_MODE,u,c,a,{begin:/\(/,end:/\)/,keywords:m,relevance:0,contains:["self",e,t.C_BLOCK_COMMENT_MODE,u,c,a]}]},a,e,t.C_BLOCK_COMMENT_MODE,p]};return{name:"C",aliases:["h"],keywords:m,disableAutodetect:!0,illegal:"</",contains:[].concat(b,C,y,[p,{begin:t.IDENT_RE+"::",keywords:m},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{preprocessor:p,strings:u,keywords:m}}}function WE(t){let r=t.regex,e=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",n="[a-zA-Z_]\\w*::",o="(?!struct)("+i+"|"+r.optional(n)+"[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:[t.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:"."},t.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},t.inherit(u,{className:"string"}),{className:"string",begin:/<.*?>/},e,t.C_BLOCK_COMMENT_MODE]},d={className:"title",begin:r.optional(n)+t.IDENT_RE,relevance:0},h=r.optional(n)+t.IDENT_RE+"\\s*\\(",f=["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"],g=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],m=["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"],D={type:g,keyword:f,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:m},x={className:"function.dispatch",relevance:0,keywords:{_hint:y},begin:r.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,r.lookahead(/(<[^<>]+>|)\s*\(/))},E=[x,p,a,e,t.C_BLOCK_COMMENT_MODE,c,u],w={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:D,contains:E.concat([{begin:/\(/,end:/\)/,keywords:D,contains:E.concat(["self"]),relevance:0}]),relevance:0},R={className:"function",begin:"("+o+"[\\*&\\s]+)+"+h,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:D,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:D,relevance:0},{begin:h,returnBegin:!0,contains:[d],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[u,c]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:D,relevance:0,contains:[e,t.C_BLOCK_COMMENT_MODE,u,c,a,{begin:/\(/,end:/\)/,keywords:D,relevance:0,contains:["self",e,t.C_BLOCK_COMMENT_MODE,u,c,a]}]},a,e,t.C_BLOCK_COMMENT_MODE,p]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:D,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(w,R,x,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:D,contains:["self",a]},{begin:t.IDENT_RE+"::",keywords:D},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function GE(t){let r=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],e=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],i=["default","false","null","true"],n=["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:n.concat(s),built_in:r,literal:i},a=t.inherit(t.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=t.inherit(u,{illegal:/\n/}),p={className:"subst",begin:/\{/,end:/\}/,keywords:o},d=t.inherit(p,{illegal:/\n/}),h={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},t.BACKSLASH_ESCAPE,d]},f={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},p]},g=t.inherit(f,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},d]});p.contains=[f,h,u,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,l,t.C_BLOCK_COMMENT_MODE],d.contains=[g,h,c,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,l,t.inherit(t.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];let m={variants:[f,h,u,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},y={begin:"<",end:">",contains:[{beginKeywords:"in out"},a]},b=t.IDENT_RE+"(<"+t.IDENT_RE+"(\\s*,\\s*"+t.IDENT_RE+")*>)?(\\[\\])?",C={begin:"@"+t.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:o,illegal:/::/,contains:[t.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},m,l,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},a,y,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[a,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[a,y,t.C_LINE_COMMENT_MODE,t.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:"("+b+"\\s+)+"+t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:o,contains:[{beginKeywords:e.join(" "),relevance:0},{begin:t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[t.TITLE_MODE,y],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,relevance:0,contains:[m,l,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},C]}}var b2=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.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:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.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_-]*/}}),D2=["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"],x2=["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"],E2=["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"],C2=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],S2=["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 HE(t){let r=t.regex,e=b2(t),i={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},n="and or not only",s=/@-?\w[\w]*(-\w+)*/,o="[a-zA-Z-][a-zA-Z0-9_-]*",a=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[e.BLOCK_COMMENT,i,e.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+o,relevance:0},e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+E2.join("|")+")"},{begin:":(:)?("+C2.join("|")+")"}]},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+S2.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[e.BLOCK_COMMENT,e.HEXCOLOR,e.IMPORTANT,e.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}]},e.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:n,attribute:x2.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...a,e.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+D2.join("|")+")\\b"}]}}function JE(t){let r=t.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 YE(t){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:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"string",variants:[t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{begin:t.C_NUMBER_RE+"[i]",relevance:1},t.C_NUMBER_MODE]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[t.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:s,illegal:/["']/}]}]}}function XE(t){let r=t.regex,e=/[_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:[t.HASH_COMMENT_MODE,t.QUOTE_STRING_MODE,t.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(e,r.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function QE(t){let r=t.regex,e={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:t.NUMBER_RE}]},i=t.COMMENT();i.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];let n={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},s={className:"literal",begin:/\bon|off|true|false|yes|no\b/},o={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},a={begin:/\[/,end:/\]/,contains:[i,s,n,o,e,"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:[i,{className:"section",begin:/\[+/,end:/\]+/},{begin:d,className:"attr",starts:{end:/$/,contains:[i,a,s,n,o,e]}}]}}var Ds="[0-9](_*[0-9])*",Bl=`\\.(${Ds})`,$l="[0-9a-fA-F](_*[0-9a-fA-F])*",ZE={className:"number",variants:[{begin:`(\\b(${Ds})((${Bl})|\\.)?|(${Bl}))[eE][+-]?(${Ds})[fFdD]?\\b`},{begin:`\\b(${Ds})((${Bl})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Bl})[fFdD]?\\b`},{begin:`\\b(${Ds})[fFdD]\\b`},{begin:`\\b0[xX]((${$l})\\.?|(${$l})?\\.(${$l}))[pP][+-]?(${Ds})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${$l})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function e0(t,r,e){return e===-1?"":t.replace(r,i=>e0(t,r,e-1))}function t0(t){let r=t.regex,e="[\xC0-\u02B8a-zA-Z_$][\xC0-\u02B8a-zA-Z_$0-9]*",i=e+e0("(?:<"+e+"~~~(?:\\s*,\\s*"+e+"~~~)*>)?",/~~~/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:"@"+e,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},c={className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[t.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:l,illegal:/<\/|#/,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[t.BACKSLASH_ESCAPE]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,e],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[r.concat(/(?!else)/,e),/\s+/,e,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,e],className:{1:"keyword",3:"title.class"},contains:[c,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+i+"\\s+)",t.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:l,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[u,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,ZE,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},ZE,u]}}var r0="[A-Za-z$_][0-9A-Za-z$_]*",v2=["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"],w2=["true","false","null","undefined","NaN","Infinity"],i0=["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"],n0=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],s0=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],T2=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],A2=[].concat(s0,i0,n0);function o0(t){let r=t.regex,e=(B,{after:G})=>{let P="</"+B[0].slice(1);return B.input.indexOf(P,G)!==-1},i=r0,n={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(B,G)=>{let P=B[0].length+B.index,N=B.input[P];if(N==="<"||N===","){G.ignoreMatch();return}N===">"&&(e(B,{after:P})||G.ignoreMatch());let O,V=B.input.substring(P);if(O=V.match(/^\s*=/)){G.ignoreMatch();return}if((O=V.match(/^\s+extends\s+/))&&O.index===0){G.ignoreMatch();return}}},a={$pattern:r0,keyword:v2,literal:w2,built_in:A2,"variable.language":T2},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:[]},h={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,d],subLanguage:"xml"}},f={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,d],subLanguage:"css"}},g={begin:"gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,d],subLanguage:"graphql"}},m={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,d]},b={className:"comment",variants:[t.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:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},C=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,h,f,g,m,{match:/\$\d+/},p];d.contains=C.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(C)});let D=[].concat(b,d.contains),x=D.concat([{begin:/\(/,end:/\)/,keywords:a,contains:["self"].concat(D)}]),E={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:x},w={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,r.concat(i,"(",r.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},R={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:{_:[...i0,...n0]}},M={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[E],illegal:/%/},L={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Q(B){return r.concat("(?!",B.join("|"),")")}let ie={match:r.concat(/\b/,Q([...s0,"super","import"]),i,r.lookahead(/\(/)),className:"title.function",relevance:0},re={begin:r.concat(/\./,r.lookahead(r.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},Z={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},E]},Pe="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",_={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,r.lookahead(Pe)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[E]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:x,CLASS_REFERENCE:R},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),M,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,h,f,g,m,b,{match:/\$\d+/},p,R,{className:"attr",begin:i+r.lookahead(":"),relevance:0},_,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[b,t.REGEXP_MODE,{className:"function",begin:Pe,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:x}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:n.begin,end:n.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"]}]}]},T,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[E,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},re,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[E]},ie,L,w,Z,{match:/\$[(.]/}]}}function a0(t){let r={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},e={match:/[{}[\],:]/,className:"punctuation",relevance:0},i=["true","false","null"],n={scope:"literal",beginKeywords:i.join(" ")};return{name:"JSON",keywords:{literal:i},contains:[r,e,t.QUOTE_STRING_MODE,n,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var xs="[0-9](_*[0-9])*",Ul=`\\.(${xs})`,jl="[0-9a-fA-F](_*[0-9a-fA-F])*",P2={className:"number",variants:[{begin:`(\\b(${xs})((${Ul})|\\.)?|(${Ul}))[eE][+-]?(${xs})[fFdD]?\\b`},{begin:`\\b(${xs})((${Ul})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Ul})[fFdD]?\\b`},{begin:`\\b(${xs})[fFdD]\\b`},{begin:`\\b0[xX]((${jl})\\.?|(${jl})?\\.(${jl}))[pP][+-]?(${xs})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${jl})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function l0(t){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"},e={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},i={className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"@"},n={className:"subst",begin:/\$\{/,end:/\}/,contains:[t.C_NUMBER_MODE]},s={className:"variable",begin:"\\$"+t.UNDERSCORE_IDENT_RE},o={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[s,n]},{begin:"'",end:"'",illegal:/\n/,contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[t.BACKSLASH_ESCAPE,s,n]}]};n.contains.push(o);let a={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+t.UNDERSCORE_IDENT_RE+")?"},l={className:"meta",begin:"@"+t.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[t.inherit(o,{className:"string"}),"self"]}]},u=P2,c=t.COMMENT("/\\*","\\*/",{contains:[t.C_BLOCK_COMMENT_MODE]}),p={variants:[{className:"type",begin:t.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:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),t.C_LINE_COMMENT_MODE,c,e,i,a,l,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:r,relevance:5,contains:[{begin:t.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[t.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,t.C_LINE_COMMENT_MODE,c],relevance:0},t.C_LINE_COMMENT_MODE,c,a,l,o,t.C_NUMBER_MODE]},c]},{begin:[/class|interface|trait/,/\s+/,t.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},t.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:`
|
|
1083
1083
|
`},u]}}var I2=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.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:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.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_-]*/}}),_2=["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"],N2=["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"],u0=["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"],c0=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],F2=["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(),k2=u0.concat(c0);function p0(t){let r=I2(t),e=k2,i="and or not only",n="[\\w-]+",s="("+n+"|@\\{"+n+"\\})",o=[],a=[],l=function(C){return{className:"string",begin:"~?"+C+".*?"+C}},u=function(C,D,x){return{className:C,begin:D,relevance:x}},c={$pattern:/[a-z-]+/,keyword:i,attribute:N2.join(" ")},p={begin:"\\(",end:"\\)",contains:a,keywords:c,relevance:0};a.push(t.C_LINE_COMMENT_MODE,t.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","@@?"+n,10),u("variable","@\\{"+n+"\\}"),u("built_in","~?`[^`]*?`"),{className:"attribute",begin:n+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},r.IMPORTANT,{beginKeywords:"and not"},r.FUNCTION_DISPATCH);let d=a.concat({begin:/\{/,end:/\}/,contains:o}),h={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(a)},f={begin:s+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},r.CSS_VARIABLE,{className:"attribute",begin:"\\b("+F2.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:a}}]},g={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}},m={className:"variable",variants:[{begin:"@"+n+"\\s*:",relevance:15},{begin:"@"+n}],starts:{end:"[;}]",returnEnd:!0,contains:d}},y={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:s,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,h,u("keyword","all\\b"),u("variable","@\\{"+n+"\\}"),{begin:"\\b("+_2.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:":("+u0.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+c0.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:d},{begin:"!important"},r.FUNCTION_DISPATCH]},b={begin:n+`:(:)?(${e.join("|")})`,returnBegin:!0,contains:[y]};return o.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,g,m,b,f,y,h,r.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:o}}function d0(t){let r="\\[=*\\[",e="\\]=*\\]",i={begin:r,end:e,contains:["self"]},n=[t.COMMENT("--(?!"+r+")","$"),t.COMMENT("--"+r,e,{contains:[i],relevance:10})];return{name:"Lua",keywords:{$pattern:t.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:n.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[t.inherit(t.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:n}].concat(n)},t.C_NUMBER_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{className:"string",begin:r,end:e,contains:[i],relevance:5}])}}function f0(t){let r={className:"variable",variants:[{begin:"\\$\\("+t.UNDERSCORE_IDENT_RE+"\\)",contains:[t.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},e={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,r]},i={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]},n={begin:"^"+t.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:[t.HASH_COMMENT_MODE,r,e,i,n,s,o]}}function h0(t){let r=t.regex,e={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},i={begin:"^[-\\*]{3,}",end:"$"},n={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=t.inherit(u,{contains:[]}),d=t.inherit(c,{contains:[]});u.contains.push(d),c.contains.push(p);let h=[e,l];return[u,c,p,d].forEach(m=>{m.contains=m.contains.concat(h)}),h=h.concat(u,c),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:h},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:h}]}]},e,s,u,c,{className:"quote",begin:"^>\\s+",contains:h,end:"$"},n,i,l,o]}}function m0(t){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+"},e=/[a-zA-Z@][a-zA-Z0-9_]*/,a={"variable.language":["this","super"],$pattern:e,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:e,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:a,illegal:"</",contains:[r,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.C_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[t.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},t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+l.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:l,contains:[t.UNDERSCORE_TITLE_MODE]},{begin:"\\."+t.UNDERSCORE_IDENT_RE,relevance:0}]}}function g0(t){let r=t.regex,e=["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"],i=/[dualxmsipngr]{0,12}/,n={$pattern:/[\w.]+/,keyword:e.join(" ")},s={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:n},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=[t.BACKSLASH_ESCAPE,s,a],u=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],c=(h,f,g="\\1")=>{let m=g==="\\1"?g:r.concat(g,f);return r.concat(r.concat("(?:",h,")"),f,/(?:\\.|[^\\\/])*?/,m,/(?:\\.|[^\\\/])*?/,g,i)},p=(h,f,g)=>r.concat(r.concat("(?:",h,")"),f,/(?:\\.|[^\\\/])*?/,g,i),d=[a,t.HASH_COMMENT_MODE,t.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:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[t.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:"(\\/\\/|"+t.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[t.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:[t.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:n,contains:d}}function y0(t){let r=t.regex,e=/(?![A-Za-z0-9])(?![$])/,i=r.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,e),n=r.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,e),s={scope:"variable",match:"\\$+"+i},o={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},a={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},l=t.inherit(t.APOS_STRING_MODE,{illegal:null}),u=t.inherit(t.QUOTE_STRING_MODE,{illegal:null,contains:t.QUOTE_STRING_MODE.contains.concat(a)}),c={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:t.QUOTE_STRING_MODE.contains.concat(a),"on:begin":(ie,re)=>{re.data._beginMatch=ie[1]||ie[2]},"on:end":(ie,re)=>{re.data._beginMatch!==ie[1]&&re.ignoreMatch()}},p=t.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),d=`[
|
|
1084
|
-
]`,h={scope:"string",variants:[u,l,c,p]},f={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},g=["false","null","true"],m=["__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:m,literal:(ie=>{let re=[];return ie.forEach(Z=>{re.push(Z),Z.toLowerCase()===Z?re.push(Z.toUpperCase()):re.push(Z.toLowerCase())}),re})(g),built_in:y},D=ie=>ie.map(re=>re.replace(/\|\d+$/,"")),x={variants:[{match:[/new/,r.concat(d,"+"),r.concat("(?!",D(y).join("\\b|"),"\\b)"),n],scope:{1:"keyword",4:"title.class"}}]},E=r.concat(i,"\\b(?!\\()"),w={variants:[{match:[r.concat(/::/,r.lookahead(/(?!class\b)/)),E],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[n,r.concat(/::/,r.lookahead(/(?!class\b)/)),E],scope:{1:"title.class",3:"variable.constant"}},{match:[n,r.concat("::",r.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[n,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},R={scope:"attr",match:r.concat(i,r.lookahead(":"),r.lookahead(/(?!::)/))},M={relevance:0,begin:/\(/,end:/\)/,keywords:C,contains:[R,s,w,t.C_BLOCK_COMMENT_MODE,h,f,x]},T={relevance:0,match:[/\b/,r.concat("(?!fn\\b|function\\b|",D(m).join("\\b|"),"|",D(y).join("\\b|"),"\\b)"),i,r.concat(d,"*"),r.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[M]};M.contains.push(T);let L=[R,w,t.C_BLOCK_COMMENT_MODE,h,f,x],Q={begin:r.concat(/#\[\s*/,n),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:g,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:g,keyword:["new","array"]},contains:["self",...L]},...L,{scope:"meta",match:n}]};return{case_insensitive:!1,keywords:C,contains:[Q,t.HASH_COMMENT_MODE,t.COMMENT("//","$"),t.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:t.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},o,{scope:"variable.language",match:/\$this\b/},s,T,w,{match:[/const/,/\s/,i],scope:{1:"keyword",3:"variable.constant"}},x,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},t.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:C,contains:["self",s,w,t.C_BLOCK_COMMENT_MODE,h,f]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[t.inherit(t.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},t.UNDERSCORE_TITLE_MODE]},h,f]}}function b0(t){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},t.inherit(t.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function D0(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function x0(t){let r=t.regex,e=/[\p{XID_Start}_]\p{XID_Continue}*/u,i=["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:i,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:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,l,c,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.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:[t.BACKSLASH_ESCAPE,c,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,c,u]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},d="[0-9](_?[0-9])*",h=`(\\b(${d}))?\\.(${d})|\\b(${d})\\.`,f=`\\b|${i.join("|")}`,g={className:"number",relevance:0,variants:[{begin:`(\\b(${d})|(${h}))[eE][+-]?(${d})[jJ]?(?=${f})`},{begin:`(${h})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${f})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${f})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${f})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${f})`},{begin:`\\b(${d})[jJ](?=${f})`}]},m={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,g,p,t.HASH_COMMENT_MODE]}]};return u.contains=[p,g,l],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:a,illegal:/(<\/|\?)|=>/,contains:[l,g,{begin:/\bself\b/},{beginKeywords:"if",relevance:0},p,m,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,e],scope:{1:"keyword",3:"title.function"},contains:[y]},{variants:[{match:[/\bclass/,/\s+/,e,/\s*/,/\(\s*/,e,/\s*\)/]},{match:[/\bclass/,/\s+/,e]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[g,y,p]}]}}function E0(t){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function C0(t){let r=t.regex,e=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,i=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]?/),n=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,s=r.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:e,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:[t.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:e},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),t.HASH_COMMENT_MODE,{scope:"string",contains:[t.BACKSLASH_ESCAPE],variants:[t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[n,i]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,i]},{scope:{1:"punctuation",2:"number"},match:[s,i]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,i]}]},{scope:{3:"operator"},match:[e,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:n},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:s},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function S0(t){let r=t.regex,e="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",i=r.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),n=r.concat(i,/(::\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=[t.COMMENT("#","$",{contains:[a]}),t.COMMENT("^=begin","^=end",{contains:[a],relevance:10}),t.COMMENT("^__END__",t.MATCH_NOTHING_RE)],c={className:"subst",begin:/#\{/,end:/\}/,keywords:o},p={className:"string",contains:[t.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:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[t.BACKSLASH_ESCAPE,c]})]}]},d="[1-9](_?[0-9])*|0",h="[0-9](_?[0-9])*",f={className:"number",relevance:0,variants:[{begin:`\\b(${d})(\\.(${h}))?([eE][+-]?(${h})|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"}]},g={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:o}]},E=[p,{variants:[{match:[/class\s+/,n,/\s+<\s+/,n]},{match:[/\b(class|module)\s+/,n]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:o},{match:[/(include|extend)\s+/,n],scope:{2:"title.class"},keywords:o},{relevance:0,match:[n,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:i,scope:"title.class"},{match:[/def/,/\s+/,e],scope:{1:"keyword",3:"title.function"},contains:[g]},{begin:t.IDENT_RE+"::"},{className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[p,{begin:e}],relevance:0},f,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:o},{begin:"("+t.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[t.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,g.contains=E;let T=[{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:[t.SHEBANG({binary:"ruby"})].concat(T).concat(u).concat(E)}}function v0(t){let r=t.regex,e={className:"title.function.invoke",relevance:0,begin:r.concat(/\b/,/(?!let|for|while|if|else|match\b)/,t.IDENT_RE,r.lookahead(/\s*\(/))},i="([ui](8|16|32|64|128|size)|f(32|64))?",n=["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:t.IDENT_RE+"!?",type:a,keyword:n,literal:s,built_in:o},illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*","\\*/",{contains:["self"]}),t.inherit(t.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_]+)"+i},{begin:"\\b0o([0-7_]+)"+i},{begin:"\\b0x([A-Fa-f0-9_]+)"+i},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+i}],relevance:0},{begin:[/fn/,/\s+/,t.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,t.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,t.UNDERSCORE_IDENT_RE,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,t.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,t.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.class"}},{begin:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:o,type:a}},{className:"punctuation",begin:"->"},e]}}var O2=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.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:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.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_-]*/}}),R2=["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"],L2=["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"],M2=["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"],B2=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],$2=["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 w0(t){let r=O2(t),e=B2,i=M2,n="@[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:[t.C_LINE_COMMENT_MODE,t.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("+R2.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+i.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+e.join("|")+")"},a,{begin:/\(/,end:/\)/,contains:[r.CSS_NUMBER_MODE]},r.CSS_VARIABLE,{className:"attribute",begin:"\\b("+$2.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,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,r.IMPORTANT,r.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:n,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:s,attribute:L2.join(" ")},contains:[{begin:n,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},a,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,r.HEXCOLOR,r.CSS_NUMBER_MODE]},r.FUNCTION_DISPATCH]}}function T0(t){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function A0(t){let r=t.regex,e=t.COMMENT("--","$"),i={className:"string",variants:[{begin:/'/,end:/'/,contains:[{begin:/''/}]}]},n={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"],h=c,f=[...u,...l].filter(C=>!c.includes(C)),g={className:"variable",begin:/@[a-z0-9][a-z0-9_]*/},m={className:"operator",begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},y={begin:r.concat(/\b/,r.either(...h),/\s*\(/),relevance:0,keywords:{built_in:h}};function b(C,{exceptions:D,when:x}={}){let E=x;return D=D||[],C.map(w=>w.match(/\|\d+$/)||D.includes(w)?w:E(w)?`${w}|0`:w)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:b(f,{when:C=>C.length<3}),literal:s,type:a,built_in:p},contains:[{begin:r.either(...d),relevance:0,keywords:{$pattern:/[\w\.]+/,keyword:f.concat(d),literal:s,type:a}},{className:"type",begin:r.either(...o)},y,g,i,n,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,e,m]}}function N0(t){return t?typeof t=="string"?t:t.source:null}function ql(t){return Me("(?=",t,")")}function Me(...t){return t.map(e=>N0(e)).join("")}function U2(t){let r=t[t.length-1];return typeof r=="object"&&r.constructor===Object?(t.splice(t.length-1,1),r):{}}function Qt(...t){return"("+(U2(t).capture?"":"?:")+t.map(i=>N0(i)).join("|")+")"}var Kd=t=>Me(/\b/,t,/\w$/.test(t)?/\b/:/\B/),j2=["Protocol","Type"].map(Kd),P0=["init","self"].map(Kd),q2=["Any","Self"],Ud=["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"],I0=["false","nil","true"],K2=["assignment","associativity","higherThan","left","lowerThan","none","right"],V2=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],_0=["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"],F0=Qt(/[/=\-+!*%<>&|^~?]/,/[\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]/),k0=Qt(F0,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),jd=Me(F0,k0,"*"),O0=Qt(/[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]/),Kl=Qt(O0,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Mi=Me(O0,Kl,"*"),qd=Me(/[A-Z]/,Kl,"*"),z2=["attached","autoclosure",Me(/convention\(/,Qt("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Me(/objc\(/,Mi,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],W2=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function R0(t){let r={match:/\s+/,relevance:0},e=t.COMMENT("/\\*","\\*/",{contains:["self"]}),i=[t.C_LINE_COMMENT_MODE,e],n={match:[/\./,Qt(...j2,...P0)],className:{2:"keyword"}},s={match:Me(/\./,Qt(...Ud)),relevance:0},o=Ud.filter(Ie=>typeof Ie=="string").concat(["_|0"]),a=Ud.filter(Ie=>typeof Ie!="string").concat(q2).map(Kd),l={variants:[{className:"keyword",match:Qt(...a,...P0)}]},u={$pattern:Qt(/\b\w+/,/#\w+/),keyword:o.concat(V2),literal:I0},c=[n,s,l],p={match:Me(/\./,Qt(..._0)),relevance:0},d={className:"built_in",match:Me(/\b/,Qt(..._0),/(?=\()/)},h=[p,d],f={match:/->/,relevance:0},g={className:"operator",relevance:0,variants:[{match:jd},{match:`\\.(\\.|${k0})+`}]},m=[f,g],y="([0-9]_*)+",b="([0-9a-fA-F]_*)+",C={className:"number",relevance:0,variants:[{match:`\\b(${y})(\\.(${y}))?([eE][+-]?(${y}))?\\b`},{match:`\\b0x(${b})(\\.(${b}))?([pP][+-]?(${y}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},D=(Ie="")=>({className:"subst",variants:[{match:Me(/\\/,Ie,/[0\\tnr"']/)},{match:Me(/\\/,Ie,/u\{[0-9a-fA-F]{1,8}\}/)}]}),x=(Ie="")=>({className:"subst",match:Me(/\\/,Ie,/[\t ]*(?:[\r\n]|\r\n)/)}),E=(Ie="")=>({className:"subst",label:"interpol",begin:Me(/\\/,Ie,/\(/),end:/\)/}),w=(Ie="")=>({begin:Me(Ie,/"""/),end:Me(/"""/,Ie),contains:[D(Ie),x(Ie),E(Ie)]}),R=(Ie="")=>({begin:Me(Ie,/"/),end:Me(/"/,Ie),contains:[D(Ie),E(Ie)]}),M={className:"string",variants:[w(),w("#"),w("##"),w("###"),R(),R("#"),R("##"),R("###")]},T=[t.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[t.BACKSLASH_ESCAPE]}],L={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:T},Q=Ie=>{let Ei=Me(Ie,/\//),Qi=Me(/\//,Ie);return{begin:Ei,end:Qi,contains:[...T,{scope:"comment",begin:`#(?!.*${Qi})`,end:/$/}]}},ie={scope:"regexp",variants:[Q("###"),Q("##"),Q("#"),L]},re={match:Me(/`/,Mi,/`/)},Z={className:"variable",match:/\$\d+/},Pe={className:"variable",match:`\\$${Kl}+`},_=[re,Z,Pe],B={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:W2,contains:[...m,C,M]}]}},G={scope:"keyword",match:Me(/@/,Qt(...z2))},P={scope:"meta",match:Me(/@/,Mi)},N=[B,G,P],O={match:ql(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:Me(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Kl,"+")},{className:"type",match:qd,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Me(/\s+&\s+/,ql(qd)),relevance:0}]},V={begin:/</,end:/>/,keywords:u,contains:[...i,...c,...N,f,O]};O.contains.push(V);let ue={match:Me(Mi,/\s*:/),keywords:"_|0",relevance:0},ee={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",ue,...i,ie,...c,...h,...m,C,M,..._,...N,O]},ae={begin:/</,end:/>/,keywords:"repeat each",contains:[...i,O]},ct={begin:Qt(ql(Me(Mi,/\s*:/)),ql(Me(Mi,/\s+/,Mi,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Mi}]},ht={begin:/\(/,end:/\)/,keywords:u,contains:[ct,...i,...c,...m,C,M,...N,O,ee],endsParent:!0,illegal:/["']/},Di={match:[/(func|macro)/,/\s+/,Qt(re.match,Mi,jd)],className:{1:"keyword",3:"title.function"},contains:[ae,ht,r],illegal:[/\[/,/%/]},ao={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[ae,ht,r],illegal:/\[|%/},xi={match:[/operator/,/\s+/,jd],className:{1:"keyword",3:"title"}},lo={begin:[/precedencegroup/,/\s+/,qd],className:{1:"keyword",3:"title"},contains:[O],keywords:[...K2,...I0],end:/}/};for(let Ie of M.variants){let Ei=Ie.contains.find(dr=>dr.label==="interpol");Ei.keywords=u;let Qi=[...c,...h,...m,C,M,..._];Ei.contains=[...Qi,{begin:/\(/,end:/\)/,contains:["self",...Qi]}]}return{name:"Swift",keywords:u,contains:[...i,Di,ao,{beginKeywords:"struct protocol class extension enum actor",end:"\\{",excludeEnd:!0,keywords:u,contains:[t.inherit(t.TITLE_MODE,{className:"title.class",begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/}),...c]},xi,lo,{beginKeywords:"import",end:/$/,contains:[...i],relevance:0},ie,...c,...h,...m,C,M,..._,...N,O,ee]}}var Vl="[A-Za-z$_][0-9A-Za-z$_]*",L0=["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"],M0=["true","false","null","undefined","NaN","Infinity"],B0=["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"],$0=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],U0=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],j0=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],q0=[].concat(U0,B0,$0);function G2(t){let r=t.regex,e=(B,{after:G})=>{let P="</"+B[0].slice(1);return B.input.indexOf(P,G)!==-1},i=Vl,n={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(B,G)=>{let P=B[0].length+B.index,N=B.input[P];if(N==="<"||N===","){G.ignoreMatch();return}N===">"&&(e(B,{after:P})||G.ignoreMatch());let O,V=B.input.substring(P);if(O=V.match(/^\s*=/)){G.ignoreMatch();return}if((O=V.match(/^\s+extends\s+/))&&O.index===0){G.ignoreMatch();return}}},a={$pattern:Vl,keyword:L0,literal:M0,built_in:q0,"variable.language":j0},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:[]},h={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,d],subLanguage:"xml"}},f={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,d],subLanguage:"css"}},g={begin:"gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,d],subLanguage:"graphql"}},m={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,d]},b={className:"comment",variants:[t.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:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},C=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,h,f,g,m,{match:/\$\d+/},p];d.contains=C.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(C)});let D=[].concat(b,d.contains),x=D.concat([{begin:/\(/,end:/\)/,keywords:a,contains:["self"].concat(D)}]),E={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:x},w={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,r.concat(i,"(",r.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},R={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:{_:[...B0,...$0]}},M={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[E],illegal:/%/},L={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Q(B){return r.concat("(?!",B.join("|"),")")}let ie={match:r.concat(/\b/,Q([...U0,"super","import"]),i,r.lookahead(/\(/)),className:"title.function",relevance:0},re={begin:r.concat(/\./,r.lookahead(r.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},Z={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},E]},Pe="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",_={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,r.lookahead(Pe)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[E]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:x,CLASS_REFERENCE:R},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),M,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,h,f,g,m,b,{match:/\$\d+/},p,R,{className:"attr",begin:i+r.lookahead(":"),relevance:0},_,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[b,t.REGEXP_MODE,{className:"function",begin:Pe,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:x}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:n.begin,end:n.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"]}]}]},T,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[E,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},re,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[E]},ie,L,w,Z,{match:/\$[(.]/}]}}function K0(t){let r=G2(t),e=Vl,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],n={beginKeywords:"namespace",end:/\{/,excludeEnd:!0,contains:[r.exports.CLASS_REFERENCE]},s={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:i},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:Vl,keyword:L0.concat(a),literal:M0,built_in:q0.concat(i),"variable.language":j0},u={className:"meta",begin:"@"+e},c=(d,h,f)=>{let g=d.contains.findIndex(m=>m.label===h);if(g===-1)throw new Error("can not find mode to replace");d.contains.splice(g,1,f)};Object.assign(r.keywords,l),r.exports.PARAMS_CONTAINS.push(u),r.contains=r.contains.concat([u,n,s]),c(r,"shebang",t.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 V0(t){let r=t.regex,e={className:"string",begin:/"(""|[^/n])"C\b/},i={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},n=/\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,n),/ *#/)},{begin:r.concat(/# */,a,/ *#/)},{begin:r.concat(/# */,o,/ *#/)},{begin:r.concat(/# */,r.either(s,n),/ +/,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=t.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),d=t.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:[e,i,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 z0(t){t.regex;let r=t.COMMENT(/\(;/,/;\)/);r.contains.push("self");let e=t.COMMENT(/;;/,/$/),i=["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"],n={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:i},contains:[e,r,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},s,o,n,t.QUOTE_STRING_MODE,l,u,a]}}function W0(t){let r=t.regex,e=r.concat(/[\p{L}_]/u,r.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),i=/[\p{L}0-9._:-]+/u,n={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=t.inherit(s,{begin:/\(/,end:/\)/}),a=t.inherit(t.APOS_STRING_MODE,{className:"string"}),l=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),u={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:i,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[n]},{begin:/'/,end:/'/,contains:[n]},{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]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},n,{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(e,r.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:e,relevance:0,starts:u}]},{className:"tag",begin:r.concat(/<\//,r.lookahead(r.concat(e,/>/))),contains:[{className:"name",begin:e,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function G0(t){let r="true false yes no null",e="[\\w#;/?:@&=+$,.~*'()[\\]]+",i={className:"attr",variants:[{begin:"\\w[\\w :\\/.-]*:(?=[ ]|$)"},{begin:'"\\w[\\w :\\/.-]*":(?=[ ]|$)'},{begin:"'\\w[\\w :\\/.-]*':(?=[ ]|$)"}]},n={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,n]},o=t.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},h={begin:/\{/,end:/\}/,contains:[d],illegal:"\\n",relevance:0},f={begin:"\\[",end:"\\]",contains:[d],illegal:"\\n",relevance:0},g=[i,{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+!"+e},{className:"type",begin:"!<"+e+">"},{className:"type",begin:"!"+e},{className:"type",begin:"!!"+e},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:r,keywords:{literal:r}},p,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},h,f,s],m=[...g];return m.pop(),m.push(o),d.contains=m,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:g}}var fn={arduino:KE,bash:VE,c:zE,cpp:WE,csharp:GE,css:HE,diff:JE,go:YE,graphql:XE,ini:QE,java:t0,javascript:o0,json:a0,kotlin:l0,less:p0,lua:d0,makefile:f0,markdown:h0,objectivec:m0,perl:g0,php:y0,"php-template":b0,plaintext:D0,python:x0,"python-repl":E0,r:C0,ruby:S0,rust:v0,scss:w0,shell:T0,sql:A0,swift:R0,typescript:K0,vbnet:V0,wasm:z0,xml:W0,yaml:G0};var hC=K(fC(),1);var mC=hC.default;var gC={},MO="hljs-";function Zd(t){let r=mC.newInstance();return t&&s(t),{highlight:e,highlightAuto:i,listLanguages:n,register:s,registerAlias:o,registered:a};function e(l,u,c){let p=c||gC,d=typeof p.prefix=="string"?p.prefix:MO;if(!r.getLanguage(l))throw new Error("Unknown language: `"+l+"` is not registered");r.configure({__emitter:Qd,classPrefix:d});let h=r.highlight(u,{ignoreIllegals:!0,language:l});if(h.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:h.errorRaised});let f=h._emitter.root,g=f.data;return g.language=h.language,g.relevance=h.relevance,f}function i(l,u){let p=(u||gC).subset||n(),d=-1,h=0,f;for(;++d<p.length;){let g=p[d];if(!r.getLanguage(g))continue;let m=e(g,l,u);m.data&&m.data.relevance!==void 0&&m.data.relevance>h&&(h=m.data.relevance,f=m)}return f||{type:"root",children:[],data:{language:void 0,relevance:h}}}function n(){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 Qd=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 e=this.stack[this.stack.length-1],i=e.children[e.children.length-1];i&&i.type==="text"?i.value+=r:e.children.push({type:"text",value:r})}startScope(r){this.openNode(String(r))}endScope(){this.closeNode()}__addSublanguage(r,e){let i=this.stack[this.stack.length-1],n=r.root.children;e?i.children.push({type:"element",tagName:"span",properties:{className:[e]},children:n}):i.children.push(...n)}openNode(r){let e=this,i=r.split(".").map(function(o,a){return a?o+"_".repeat(a):e.options.classPrefix+o}),n=this.stack[this.stack.length-1],s={type:"element",tagName:"span",properties:{className:i},children:[]};n.children.push(s),this.stack.push(s)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}};var yC=(t=0)=>r=>`\x1B[${r+t}m`,bC=(t=0)=>r=>`\x1B[${38+t};5;${r}m`,DC=(t=0)=>(r,e,i)=>`\x1B[${38+t};2;${r};${e};${i}m`,Ye={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]}},cz=Object.keys(Ye.modifier),BO=Object.keys(Ye.color),$O=Object.keys(Ye.bgColor),pz=[...BO,...$O];function UO(){let t=new Map;for(let[r,e]of Object.entries(Ye)){for(let[i,n]of Object.entries(e))Ye[i]={open:`\x1B[${n[0]}m`,close:`\x1B[${n[1]}m`},e[i]=Ye[i],t.set(n[0],n[1]);Object.defineProperty(Ye,r,{value:e,enumerable:!1})}return Object.defineProperty(Ye,"codes",{value:t,enumerable:!1}),Ye.color.close="\x1B[39m",Ye.bgColor.close="\x1B[49m",Ye.color.ansi=yC(),Ye.color.ansi256=bC(),Ye.color.ansi16m=DC(),Ye.bgColor.ansi=yC(10),Ye.bgColor.ansi256=bC(10),Ye.bgColor.ansi16m=DC(10),Object.defineProperties(Ye,{rgbToAnsi256:{value(r,e,i){return r===e&&e===i?r<8?16:r>248?231:Math.round((r-8)/247*24)+232:16+36*Math.round(r/255*5)+6*Math.round(e/255*5)+Math.round(i/255*5)},enumerable:!1},hexToRgb:{value(r){let e=/[a-f\d]{6}|[a-f\d]{3}/i.exec(r.toString(16));if(!e)return[0,0,0];let[i]=e;i.length===3&&(i=[...i].map(s=>s+s).join(""));let n=Number.parseInt(i,16);return[n>>16&255,n>>8&255,n&255]},enumerable:!1},hexToAnsi256:{value:r=>Ye.rgbToAnsi256(...Ye.hexToRgb(r)),enumerable:!1},ansi256ToAnsi:{value(r){if(r<8)return 30+r;if(r<16)return 90+(r-8);let e,i,n;if(r>=232)e=((r-232)*10+8)/255,i=e,n=e;else{r-=16;let a=r%36;e=Math.floor(r/36)/5,i=Math.floor(a/6)/5,n=a%6/5}let s=Math.max(e,i,n)*2;if(s===0)return 30;let o=30+(Math.round(n)<<2|Math.round(i)<<1|Math.round(e));return s===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(r,e,i)=>Ye.ansi256ToAnsi(Ye.rgbToAnsi256(r,e,i)),enumerable:!1},hexToAnsi:{value:r=>Ye.ansi256ToAnsi(Ye.hexToAnsi256(r)),enumerable:!1}}),Ye}var jO=UO(),kr=jO;var Yl=K(require("node:process"),1),EC=K(require("node:os"),1),ef=K(require("node:tty"),1);function br(t,r=globalThis.Deno?globalThis.Deno.args:Yl.default.argv){let e=t.startsWith("-")?"":t.length===1?"-":"--",i=r.indexOf(e+t),n=r.indexOf("--");return i!==-1&&(n===-1||i<n)}var{env:et}=Yl.default,Jl;br("no-color")||br("no-colors")||br("color=false")||br("color=never")?Jl=0:(br("color")||br("colors")||br("color=true")||br("color=always"))&&(Jl=1);function qO(){if("FORCE_COLOR"in et)return et.FORCE_COLOR==="true"?1:et.FORCE_COLOR==="false"?0:et.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(et.FORCE_COLOR,10),3)}function KO(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function VO(t,{streamIsTTY:r,sniffFlags:e=!0}={}){let i=qO();i!==void 0&&(Jl=i);let n=e?Jl:i;if(n===0)return 0;if(e){if(br("color=16m")||br("color=full")||br("color=truecolor"))return 3;if(br("color=256"))return 2}if("TF_BUILD"in et&&"AGENT_NAME"in et)return 1;if(t&&!r&&n===void 0)return 0;let s=n||0;if(et.TERM==="dumb")return s;if(Yl.default.platform==="win32"){let o=EC.default.release().split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if("CI"in et)return"GITHUB_ACTIONS"in et||"GITEA_ACTIONS"in et?3:["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(o=>o in et)||et.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in et)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(et.TEAMCITY_VERSION)?1:0;if(et.COLORTERM==="truecolor"||et.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in et){let o=Number.parseInt((et.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(et.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(et.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(et.TERM)||"COLORTERM"in et?1:s}function xC(t,r={}){let e=VO(t,{streamIsTTY:t&&t.isTTY,...r});return KO(e)}var zO={stdout:xC({isTTY:ef.default.isatty(1)}),stderr:xC({isTTY:ef.default.isatty(2)})},CC=zO;function SC(t,r,e){let i=t.indexOf(r);if(i===-1)return t;let n=r.length,s=0,o="";do o+=t.slice(s,i)+r+e,s=i+n,i=t.indexOf(r,s);while(i!==-1);return o+=t.slice(s),o}function vC(t,r,e,i){let n=0,s="";do{let o=t[i-1]==="\r";s+=t.slice(n,o?i-1:i)+r+(o?`\r
|
|
1084
|
+
]`,h={scope:"string",variants:[u,l,c,p]},f={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},g=["false","null","true"],m=["__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:m,literal:(ie=>{let re=[];return ie.forEach(Z=>{re.push(Z),Z.toLowerCase()===Z?re.push(Z.toUpperCase()):re.push(Z.toLowerCase())}),re})(g),built_in:y},D=ie=>ie.map(re=>re.replace(/\|\d+$/,"")),x={variants:[{match:[/new/,r.concat(d,"+"),r.concat("(?!",D(y).join("\\b|"),"\\b)"),n],scope:{1:"keyword",4:"title.class"}}]},E=r.concat(i,"\\b(?!\\()"),w={variants:[{match:[r.concat(/::/,r.lookahead(/(?!class\b)/)),E],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[n,r.concat(/::/,r.lookahead(/(?!class\b)/)),E],scope:{1:"title.class",3:"variable.constant"}},{match:[n,r.concat("::",r.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[n,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},R={scope:"attr",match:r.concat(i,r.lookahead(":"),r.lookahead(/(?!::)/))},M={relevance:0,begin:/\(/,end:/\)/,keywords:C,contains:[R,s,w,t.C_BLOCK_COMMENT_MODE,h,f,x]},T={relevance:0,match:[/\b/,r.concat("(?!fn\\b|function\\b|",D(m).join("\\b|"),"|",D(y).join("\\b|"),"\\b)"),i,r.concat(d,"*"),r.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[M]};M.contains.push(T);let L=[R,w,t.C_BLOCK_COMMENT_MODE,h,f,x],Q={begin:r.concat(/#\[\s*/,n),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:g,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:g,keyword:["new","array"]},contains:["self",...L]},...L,{scope:"meta",match:n}]};return{case_insensitive:!1,keywords:C,contains:[Q,t.HASH_COMMENT_MODE,t.COMMENT("//","$"),t.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:t.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},o,{scope:"variable.language",match:/\$this\b/},s,T,w,{match:[/const/,/\s/,i],scope:{1:"keyword",3:"variable.constant"}},x,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},t.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:C,contains:["self",s,w,t.C_BLOCK_COMMENT_MODE,h,f]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},t.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[t.inherit(t.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},t.UNDERSCORE_TITLE_MODE]},h,f]}}function b0(t){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},t.inherit(t.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function D0(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function x0(t){let r=t.regex,e=/[\p{XID_Start}_]\p{XID_Continue}*/u,i=["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:i,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:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,l,c,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.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:[t.BACKSLASH_ESCAPE,c,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,c,u]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},d="[0-9](_?[0-9])*",h=`(\\b(${d}))?\\.(${d})|\\b(${d})\\.`,f=`\\b|${i.join("|")}`,g={className:"number",relevance:0,variants:[{begin:`(\\b(${d})|(${h}))[eE][+-]?(${d})[jJ]?(?=${f})`},{begin:`(${h})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${f})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${f})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${f})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${f})`},{begin:`\\b(${d})[jJ](?=${f})`}]},m={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,g,p,t.HASH_COMMENT_MODE]}]};return u.contains=[p,g,l],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:a,illegal:/(<\/|\?)|=>/,contains:[l,g,{begin:/\bself\b/},{beginKeywords:"if",relevance:0},p,m,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,e],scope:{1:"keyword",3:"title.function"},contains:[y]},{variants:[{match:[/\bclass/,/\s+/,e,/\s*/,/\(\s*/,e,/\s*\)/]},{match:[/\bclass/,/\s+/,e]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[g,y,p]}]}}function E0(t){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function C0(t){let r=t.regex,e=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,i=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]?/),n=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,s=r.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:e,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:[t.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:e},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),t.HASH_COMMENT_MODE,{scope:"string",contains:[t.BACKSLASH_ESCAPE],variants:[t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[n,i]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,i]},{scope:{1:"punctuation",2:"number"},match:[s,i]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,i]}]},{scope:{3:"operator"},match:[e,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:n},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:s},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function S0(t){let r=t.regex,e="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",i=r.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),n=r.concat(i,/(::\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=[t.COMMENT("#","$",{contains:[a]}),t.COMMENT("^=begin","^=end",{contains:[a],relevance:10}),t.COMMENT("^__END__",t.MATCH_NOTHING_RE)],c={className:"subst",begin:/#\{/,end:/\}/,keywords:o},p={className:"string",contains:[t.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:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[t.BACKSLASH_ESCAPE,c]})]}]},d="[1-9](_?[0-9])*|0",h="[0-9](_?[0-9])*",f={className:"number",relevance:0,variants:[{begin:`\\b(${d})(\\.(${h}))?([eE][+-]?(${h})|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"}]},g={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:o}]},E=[p,{variants:[{match:[/class\s+/,n,/\s+<\s+/,n]},{match:[/\b(class|module)\s+/,n]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:o},{match:[/(include|extend)\s+/,n],scope:{2:"title.class"},keywords:o},{relevance:0,match:[n,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:i,scope:"title.class"},{match:[/def/,/\s+/,e],scope:{1:"keyword",3:"title.function"},contains:[g]},{begin:t.IDENT_RE+"::"},{className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[p,{begin:e}],relevance:0},f,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:o},{begin:"("+t.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[t.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,g.contains=E;let T=[{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:[t.SHEBANG({binary:"ruby"})].concat(T).concat(u).concat(E)}}function v0(t){let r=t.regex,e={className:"title.function.invoke",relevance:0,begin:r.concat(/\b/,/(?!let|for|while|if|else|match\b)/,t.IDENT_RE,r.lookahead(/\s*\(/))},i="([ui](8|16|32|64|128|size)|f(32|64))?",n=["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:t.IDENT_RE+"!?",type:a,keyword:n,literal:s,built_in:o},illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*","\\*/",{contains:["self"]}),t.inherit(t.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_]+)"+i},{begin:"\\b0o([0-7_]+)"+i},{begin:"\\b0x([A-Fa-f0-9_]+)"+i},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+i}],relevance:0},{begin:[/fn/,/\s+/,t.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,t.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,t.UNDERSCORE_IDENT_RE,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,t.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,t.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.class"}},{begin:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:o,type:a}},{className:"punctuation",begin:"->"},e]}}var O2=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.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:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.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_-]*/}}),R2=["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"],L2=["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"],M2=["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"],B2=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],$2=["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 w0(t){let r=O2(t),e=B2,i=M2,n="@[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:[t.C_LINE_COMMENT_MODE,t.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("+R2.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+i.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+e.join("|")+")"},a,{begin:/\(/,end:/\)/,contains:[r.CSS_NUMBER_MODE]},r.CSS_VARIABLE,{className:"attribute",begin:"\\b("+$2.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,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,r.IMPORTANT,r.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:n,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:s,attribute:L2.join(" ")},contains:[{begin:n,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},a,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,r.HEXCOLOR,r.CSS_NUMBER_MODE]},r.FUNCTION_DISPATCH]}}function T0(t){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function A0(t){let r=t.regex,e=t.COMMENT("--","$"),i={className:"string",variants:[{begin:/'/,end:/'/,contains:[{begin:/''/}]}]},n={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"],h=c,f=[...u,...l].filter(C=>!c.includes(C)),g={className:"variable",begin:/@[a-z0-9][a-z0-9_]*/},m={className:"operator",begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},y={begin:r.concat(/\b/,r.either(...h),/\s*\(/),relevance:0,keywords:{built_in:h}};function b(C,{exceptions:D,when:x}={}){let E=x;return D=D||[],C.map(w=>w.match(/\|\d+$/)||D.includes(w)?w:E(w)?`${w}|0`:w)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:b(f,{when:C=>C.length<3}),literal:s,type:a,built_in:p},contains:[{begin:r.either(...d),relevance:0,keywords:{$pattern:/[\w\.]+/,keyword:f.concat(d),literal:s,type:a}},{className:"type",begin:r.either(...o)},y,g,i,n,t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,e,m]}}function N0(t){return t?typeof t=="string"?t:t.source:null}function ql(t){return Me("(?=",t,")")}function Me(...t){return t.map(e=>N0(e)).join("")}function U2(t){let r=t[t.length-1];return typeof r=="object"&&r.constructor===Object?(t.splice(t.length-1,1),r):{}}function Qt(...t){return"("+(U2(t).capture?"":"?:")+t.map(i=>N0(i)).join("|")+")"}var Kd=t=>Me(/\b/,t,/\w$/.test(t)?/\b/:/\B/),j2=["Protocol","Type"].map(Kd),P0=["init","self"].map(Kd),q2=["Any","Self"],Ud=["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"],I0=["false","nil","true"],K2=["assignment","associativity","higherThan","left","lowerThan","none","right"],V2=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],_0=["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"],F0=Qt(/[/=\-+!*%<>&|^~?]/,/[\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]/),k0=Qt(F0,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),jd=Me(F0,k0,"*"),O0=Qt(/[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]/),Kl=Qt(O0,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Mi=Me(O0,Kl,"*"),qd=Me(/[A-Z]/,Kl,"*"),z2=["attached","autoclosure",Me(/convention\(/,Qt("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Me(/objc\(/,Mi,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],W2=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function R0(t){let r={match:/\s+/,relevance:0},e=t.COMMENT("/\\*","\\*/",{contains:["self"]}),i=[t.C_LINE_COMMENT_MODE,e],n={match:[/\./,Qt(...j2,...P0)],className:{2:"keyword"}},s={match:Me(/\./,Qt(...Ud)),relevance:0},o=Ud.filter(Ie=>typeof Ie=="string").concat(["_|0"]),a=Ud.filter(Ie=>typeof Ie!="string").concat(q2).map(Kd),l={variants:[{className:"keyword",match:Qt(...a,...P0)}]},u={$pattern:Qt(/\b\w+/,/#\w+/),keyword:o.concat(V2),literal:I0},c=[n,s,l],p={match:Me(/\./,Qt(..._0)),relevance:0},d={className:"built_in",match:Me(/\b/,Qt(..._0),/(?=\()/)},h=[p,d],f={match:/->/,relevance:0},g={className:"operator",relevance:0,variants:[{match:jd},{match:`\\.(\\.|${k0})+`}]},m=[f,g],y="([0-9]_*)+",b="([0-9a-fA-F]_*)+",C={className:"number",relevance:0,variants:[{match:`\\b(${y})(\\.(${y}))?([eE][+-]?(${y}))?\\b`},{match:`\\b0x(${b})(\\.(${b}))?([pP][+-]?(${y}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},D=(Ie="")=>({className:"subst",variants:[{match:Me(/\\/,Ie,/[0\\tnr"']/)},{match:Me(/\\/,Ie,/u\{[0-9a-fA-F]{1,8}\}/)}]}),x=(Ie="")=>({className:"subst",match:Me(/\\/,Ie,/[\t ]*(?:[\r\n]|\r\n)/)}),E=(Ie="")=>({className:"subst",label:"interpol",begin:Me(/\\/,Ie,/\(/),end:/\)/}),w=(Ie="")=>({begin:Me(Ie,/"""/),end:Me(/"""/,Ie),contains:[D(Ie),x(Ie),E(Ie)]}),R=(Ie="")=>({begin:Me(Ie,/"/),end:Me(/"/,Ie),contains:[D(Ie),E(Ie)]}),M={className:"string",variants:[w(),w("#"),w("##"),w("###"),R(),R("#"),R("##"),R("###")]},T=[t.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[t.BACKSLASH_ESCAPE]}],L={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:T},Q=Ie=>{let Ei=Me(Ie,/\//),Qi=Me(/\//,Ie);return{begin:Ei,end:Qi,contains:[...T,{scope:"comment",begin:`#(?!.*${Qi})`,end:/$/}]}},ie={scope:"regexp",variants:[Q("###"),Q("##"),Q("#"),L]},re={match:Me(/`/,Mi,/`/)},Z={className:"variable",match:/\$\d+/},Pe={className:"variable",match:`\\$${Kl}+`},_=[re,Z,Pe],B={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:W2,contains:[...m,C,M]}]}},G={scope:"keyword",match:Me(/@/,Qt(...z2))},P={scope:"meta",match:Me(/@/,Mi)},N=[B,G,P],O={match:ql(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:Me(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Kl,"+")},{className:"type",match:qd,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Me(/\s+&\s+/,ql(qd)),relevance:0}]},V={begin:/</,end:/>/,keywords:u,contains:[...i,...c,...N,f,O]};O.contains.push(V);let ue={match:Me(Mi,/\s*:/),keywords:"_|0",relevance:0},ee={begin:/\(/,end:/\)/,relevance:0,keywords:u,contains:["self",ue,...i,ie,...c,...h,...m,C,M,..._,...N,O]},ae={begin:/</,end:/>/,keywords:"repeat each",contains:[...i,O]},ct={begin:Qt(ql(Me(Mi,/\s*:/)),ql(Me(Mi,/\s+/,Mi,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Mi}]},mt={begin:/\(/,end:/\)/,keywords:u,contains:[ct,...i,...c,...m,C,M,...N,O,ee],endsParent:!0,illegal:/["']/},Di={match:[/(func|macro)/,/\s+/,Qt(re.match,Mi,jd)],className:{1:"keyword",3:"title.function"},contains:[ae,mt,r],illegal:[/\[/,/%/]},ao={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[ae,mt,r],illegal:/\[|%/},xi={match:[/operator/,/\s+/,jd],className:{1:"keyword",3:"title"}},lo={begin:[/precedencegroup/,/\s+/,qd],className:{1:"keyword",3:"title"},contains:[O],keywords:[...K2,...I0],end:/}/};for(let Ie of M.variants){let Ei=Ie.contains.find(dr=>dr.label==="interpol");Ei.keywords=u;let Qi=[...c,...h,...m,C,M,..._];Ei.contains=[...Qi,{begin:/\(/,end:/\)/,contains:["self",...Qi]}]}return{name:"Swift",keywords:u,contains:[...i,Di,ao,{beginKeywords:"struct protocol class extension enum actor",end:"\\{",excludeEnd:!0,keywords:u,contains:[t.inherit(t.TITLE_MODE,{className:"title.class",begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/}),...c]},xi,lo,{beginKeywords:"import",end:/$/,contains:[...i],relevance:0},ie,...c,...h,...m,C,M,..._,...N,O,ee]}}var Vl="[A-Za-z$_][0-9A-Za-z$_]*",L0=["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"],M0=["true","false","null","undefined","NaN","Infinity"],B0=["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"],$0=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],U0=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],j0=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],q0=[].concat(U0,B0,$0);function G2(t){let r=t.regex,e=(B,{after:G})=>{let P="</"+B[0].slice(1);return B.input.indexOf(P,G)!==-1},i=Vl,n={begin:"<>",end:"</>"},s=/<[A-Za-z0-9\\._:-]+\s*\/>/,o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(B,G)=>{let P=B[0].length+B.index,N=B.input[P];if(N==="<"||N===","){G.ignoreMatch();return}N===">"&&(e(B,{after:P})||G.ignoreMatch());let O,V=B.input.substring(P);if(O=V.match(/^\s*=/)){G.ignoreMatch();return}if((O=V.match(/^\s+extends\s+/))&&O.index===0){G.ignoreMatch();return}}},a={$pattern:Vl,keyword:L0,literal:M0,built_in:q0,"variable.language":j0},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:[]},h={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,d],subLanguage:"xml"}},f={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,d],subLanguage:"css"}},g={begin:"gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,d],subLanguage:"graphql"}},m={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,d]},b={className:"comment",variants:[t.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:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},C=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,h,f,g,m,{match:/\$\d+/},p];d.contains=C.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(C)});let D=[].concat(b,d.contains),x=D.concat([{begin:/\(/,end:/\)/,keywords:a,contains:["self"].concat(D)}]),E={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:x},w={variants:[{match:[/class/,/\s+/,i,/\s+/,/extends/,/\s+/,r.concat(i,"(",r.concat(/\./,i),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,i],scope:{1:"keyword",3:"title.class"}}]},R={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:{_:[...B0,...$0]}},M={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,i,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[E],illegal:/%/},L={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Q(B){return r.concat("(?!",B.join("|"),")")}let ie={match:r.concat(/\b/,Q([...U0,"super","import"]),i,r.lookahead(/\(/)),className:"title.function",relevance:0},re={begin:r.concat(/\./,r.lookahead(r.concat(i,/(?![0-9A-Za-z$_(])/))),end:i,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},Z={match:[/get|set/,/\s+/,i,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},E]},Pe="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",_={match:[/const|var|let/,/\s+/,i,/\s*/,/=\s*/,/(async\s*)?/,r.lookahead(Pe)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[E]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:x,CLASS_REFERENCE:R},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),M,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,h,f,g,m,b,{match:/\$\d+/},p,R,{className:"attr",begin:i+r.lookahead(":"),relevance:0},_,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[b,t.REGEXP_MODE,{className:"function",begin:Pe,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:x}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:n.begin,end:n.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"]}]}]},T,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[E,t.inherit(t.TITLE_MODE,{begin:i,className:"title.function"})]},{match:/\.\.\./,relevance:0},re,{match:"\\$"+i,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[E]},ie,L,w,Z,{match:/\$[(.]/}]}}function K0(t){let r=G2(t),e=Vl,i=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],n={beginKeywords:"namespace",end:/\{/,excludeEnd:!0,contains:[r.exports.CLASS_REFERENCE]},s={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:i},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:Vl,keyword:L0.concat(a),literal:M0,built_in:q0.concat(i),"variable.language":j0},u={className:"meta",begin:"@"+e},c=(d,h,f)=>{let g=d.contains.findIndex(m=>m.label===h);if(g===-1)throw new Error("can not find mode to replace");d.contains.splice(g,1,f)};Object.assign(r.keywords,l),r.exports.PARAMS_CONTAINS.push(u),r.contains=r.contains.concat([u,n,s]),c(r,"shebang",t.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 V0(t){let r=t.regex,e={className:"string",begin:/"(""|[^/n])"C\b/},i={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},n=/\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,n),/ *#/)},{begin:r.concat(/# */,a,/ *#/)},{begin:r.concat(/# */,o,/ *#/)},{begin:r.concat(/# */,r.either(s,n),/ +/,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=t.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),d=t.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:[e,i,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 z0(t){t.regex;let r=t.COMMENT(/\(;/,/;\)/);r.contains.push("self");let e=t.COMMENT(/;;/,/$/),i=["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"],n={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:i},contains:[e,r,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},s,o,n,t.QUOTE_STRING_MODE,l,u,a]}}function W0(t){let r=t.regex,e=r.concat(/[\p{L}_]/u,r.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),i=/[\p{L}0-9._:-]+/u,n={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=t.inherit(s,{begin:/\(/,end:/\)/}),a=t.inherit(t.APOS_STRING_MODE,{className:"string"}),l=t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),u={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:i,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[n]},{begin:/'/,end:/'/,contains:[n]},{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]}]}]},t.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},n,{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(e,r.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:e,relevance:0,starts:u}]},{className:"tag",begin:r.concat(/<\//,r.lookahead(r.concat(e,/>/))),contains:[{className:"name",begin:e,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function G0(t){let r="true false yes no null",e="[\\w#;/?:@&=+$,.~*'()[\\]]+",i={className:"attr",variants:[{begin:"\\w[\\w :\\/.-]*:(?=[ ]|$)"},{begin:'"\\w[\\w :\\/.-]*":(?=[ ]|$)'},{begin:"'\\w[\\w :\\/.-]*':(?=[ ]|$)"}]},n={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},s={className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,n]},o=t.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},h={begin:/\{/,end:/\}/,contains:[d],illegal:"\\n",relevance:0},f={begin:"\\[",end:"\\]",contains:[d],illegal:"\\n",relevance:0},g=[i,{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+!"+e},{className:"type",begin:"!<"+e+">"},{className:"type",begin:"!"+e},{className:"type",begin:"!!"+e},{className:"meta",begin:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:r,keywords:{literal:r}},p,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},h,f,s],m=[...g];return m.pop(),m.push(o),d.contains=m,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:g}}var fn={arduino:KE,bash:VE,c:zE,cpp:WE,csharp:GE,css:HE,diff:JE,go:YE,graphql:XE,ini:QE,java:t0,javascript:o0,json:a0,kotlin:l0,less:p0,lua:d0,makefile:f0,markdown:h0,objectivec:m0,perl:g0,php:y0,"php-template":b0,plaintext:D0,python:x0,"python-repl":E0,r:C0,ruby:S0,rust:v0,scss:w0,shell:T0,sql:A0,swift:R0,typescript:K0,vbnet:V0,wasm:z0,xml:W0,yaml:G0};var hC=K(fC(),1);var mC=hC.default;var gC={},MO="hljs-";function Zd(t){let r=mC.newInstance();return t&&s(t),{highlight:e,highlightAuto:i,listLanguages:n,register:s,registerAlias:o,registered:a};function e(l,u,c){let p=c||gC,d=typeof p.prefix=="string"?p.prefix:MO;if(!r.getLanguage(l))throw new Error("Unknown language: `"+l+"` is not registered");r.configure({__emitter:Qd,classPrefix:d});let h=r.highlight(u,{ignoreIllegals:!0,language:l});if(h.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:h.errorRaised});let f=h._emitter.root,g=f.data;return g.language=h.language,g.relevance=h.relevance,f}function i(l,u){let p=(u||gC).subset||n(),d=-1,h=0,f;for(;++d<p.length;){let g=p[d];if(!r.getLanguage(g))continue;let m=e(g,l,u);m.data&&m.data.relevance!==void 0&&m.data.relevance>h&&(h=m.data.relevance,f=m)}return f||{type:"root",children:[],data:{language:void 0,relevance:h}}}function n(){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 Qd=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 e=this.stack[this.stack.length-1],i=e.children[e.children.length-1];i&&i.type==="text"?i.value+=r:e.children.push({type:"text",value:r})}startScope(r){this.openNode(String(r))}endScope(){this.closeNode()}__addSublanguage(r,e){let i=this.stack[this.stack.length-1],n=r.root.children;e?i.children.push({type:"element",tagName:"span",properties:{className:[e]},children:n}):i.children.push(...n)}openNode(r){let e=this,i=r.split(".").map(function(o,a){return a?o+"_".repeat(a):e.options.classPrefix+o}),n=this.stack[this.stack.length-1],s={type:"element",tagName:"span",properties:{className:i},children:[]};n.children.push(s),this.stack.push(s)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}};var yC=(t=0)=>r=>`\x1B[${r+t}m`,bC=(t=0)=>r=>`\x1B[${38+t};5;${r}m`,DC=(t=0)=>(r,e,i)=>`\x1B[${38+t};2;${r};${e};${i}m`,Ye={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]}},cz=Object.keys(Ye.modifier),BO=Object.keys(Ye.color),$O=Object.keys(Ye.bgColor),pz=[...BO,...$O];function UO(){let t=new Map;for(let[r,e]of Object.entries(Ye)){for(let[i,n]of Object.entries(e))Ye[i]={open:`\x1B[${n[0]}m`,close:`\x1B[${n[1]}m`},e[i]=Ye[i],t.set(n[0],n[1]);Object.defineProperty(Ye,r,{value:e,enumerable:!1})}return Object.defineProperty(Ye,"codes",{value:t,enumerable:!1}),Ye.color.close="\x1B[39m",Ye.bgColor.close="\x1B[49m",Ye.color.ansi=yC(),Ye.color.ansi256=bC(),Ye.color.ansi16m=DC(),Ye.bgColor.ansi=yC(10),Ye.bgColor.ansi256=bC(10),Ye.bgColor.ansi16m=DC(10),Object.defineProperties(Ye,{rgbToAnsi256:{value(r,e,i){return r===e&&e===i?r<8?16:r>248?231:Math.round((r-8)/247*24)+232:16+36*Math.round(r/255*5)+6*Math.round(e/255*5)+Math.round(i/255*5)},enumerable:!1},hexToRgb:{value(r){let e=/[a-f\d]{6}|[a-f\d]{3}/i.exec(r.toString(16));if(!e)return[0,0,0];let[i]=e;i.length===3&&(i=[...i].map(s=>s+s).join(""));let n=Number.parseInt(i,16);return[n>>16&255,n>>8&255,n&255]},enumerable:!1},hexToAnsi256:{value:r=>Ye.rgbToAnsi256(...Ye.hexToRgb(r)),enumerable:!1},ansi256ToAnsi:{value(r){if(r<8)return 30+r;if(r<16)return 90+(r-8);let e,i,n;if(r>=232)e=((r-232)*10+8)/255,i=e,n=e;else{r-=16;let a=r%36;e=Math.floor(r/36)/5,i=Math.floor(a/6)/5,n=a%6/5}let s=Math.max(e,i,n)*2;if(s===0)return 30;let o=30+(Math.round(n)<<2|Math.round(i)<<1|Math.round(e));return s===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(r,e,i)=>Ye.ansi256ToAnsi(Ye.rgbToAnsi256(r,e,i)),enumerable:!1},hexToAnsi:{value:r=>Ye.ansi256ToAnsi(Ye.hexToAnsi256(r)),enumerable:!1}}),Ye}var jO=UO(),kr=jO;var Yl=K(require("node:process"),1),EC=K(require("node:os"),1),ef=K(require("node:tty"),1);function br(t,r=globalThis.Deno?globalThis.Deno.args:Yl.default.argv){let e=t.startsWith("-")?"":t.length===1?"-":"--",i=r.indexOf(e+t),n=r.indexOf("--");return i!==-1&&(n===-1||i<n)}var{env:et}=Yl.default,Jl;br("no-color")||br("no-colors")||br("color=false")||br("color=never")?Jl=0:(br("color")||br("colors")||br("color=true")||br("color=always"))&&(Jl=1);function qO(){if("FORCE_COLOR"in et)return et.FORCE_COLOR==="true"?1:et.FORCE_COLOR==="false"?0:et.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(et.FORCE_COLOR,10),3)}function KO(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function VO(t,{streamIsTTY:r,sniffFlags:e=!0}={}){let i=qO();i!==void 0&&(Jl=i);let n=e?Jl:i;if(n===0)return 0;if(e){if(br("color=16m")||br("color=full")||br("color=truecolor"))return 3;if(br("color=256"))return 2}if("TF_BUILD"in et&&"AGENT_NAME"in et)return 1;if(t&&!r&&n===void 0)return 0;let s=n||0;if(et.TERM==="dumb")return s;if(Yl.default.platform==="win32"){let o=EC.default.release().split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if("CI"in et)return"GITHUB_ACTIONS"in et||"GITEA_ACTIONS"in et?3:["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(o=>o in et)||et.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in et)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(et.TEAMCITY_VERSION)?1:0;if(et.COLORTERM==="truecolor"||et.TERM==="xterm-kitty")return 3;if("TERM_PROGRAM"in et){let o=Number.parseInt((et.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(et.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(et.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(et.TERM)||"COLORTERM"in et?1:s}function xC(t,r={}){let e=VO(t,{streamIsTTY:t&&t.isTTY,...r});return KO(e)}var zO={stdout:xC({isTTY:ef.default.isatty(1)}),stderr:xC({isTTY:ef.default.isatty(2)})},CC=zO;function SC(t,r,e){let i=t.indexOf(r);if(i===-1)return t;let n=r.length,s=0,o="";do o+=t.slice(s,i)+r+e,s=i+n,i=t.indexOf(r,s);while(i!==-1);return o+=t.slice(s),o}function vC(t,r,e,i){let n=0,s="";do{let o=t[i-1]==="\r";s+=t.slice(n,o?i-1:i)+r+(o?`\r
|
|
1085
1085
|
`:`
|
|
1086
1086
|
`)+e,n=i+1,i=t.indexOf(`
|
|
1087
1087
|
`,n)}while(i!==-1);return s+=t.slice(n),s}var{stdout:wC,stderr:TC}=CC,tf=Symbol("GENERATOR"),Ss=Symbol("STYLER"),Vo=Symbol("IS_EMPTY"),AC=["ansi","ansi","ansi256","ansi16m"],vs=Object.create(null),WO=(t,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 e=wC?wC.level:0;t.level=r.level===void 0?e:r.level},Xl=class{constructor(r){return PC(r)}},PC=t=>{let r=(...e)=>e.join(" ");return WO(r,t),Object.setPrototypeOf(r,zo.prototype),r};function zo(t){return PC(t)}Object.setPrototypeOf(zo.prototype,Function.prototype);for(let[t,r]of Object.entries(kr))vs[t]={get(){let e=Ql(this,nf(r.open,r.close,this[Ss]),this[Vo]);return Object.defineProperty(this,t,{value:e}),e}};vs.visible={get(){let t=Ql(this,this[Ss],!0);return Object.defineProperty(this,"visible",{value:t}),t}};var rf=(t,r,e,...i)=>t==="rgb"?r==="ansi16m"?kr[e].ansi16m(...i):r==="ansi256"?kr[e].ansi256(kr.rgbToAnsi256(...i)):kr[e].ansi(kr.rgbToAnsi(...i)):t==="hex"?rf("rgb",r,e,...kr.hexToRgb(...i)):kr[e][t](...i),GO=["rgb","hex","ansi256"];for(let t of GO){vs[t]={get(){let{level:e}=this;return function(...i){let n=nf(rf(t,AC[e],"color",...i),kr.color.close,this[Ss]);return Ql(this,n,this[Vo])}}};let r="bg"+t[0].toUpperCase()+t.slice(1);vs[r]={get(){let{level:e}=this;return function(...i){let n=nf(rf(t,AC[e],"bgColor",...i),kr.bgColor.close,this[Ss]);return Ql(this,n,this[Vo])}}}}var HO=Object.defineProperties(()=>{},{...vs,level:{enumerable:!0,get(){return this[tf].level},set(t){this[tf].level=t}}}),nf=(t,r,e)=>{let i,n;return e===void 0?(i=t,n=r):(i=e.openAll+t,n=r+e.closeAll),{open:t,close:r,openAll:i,closeAll:n,parent:e}},Ql=(t,r,e)=>{let i=(...n)=>JO(i,n.length===1?""+n[0]:n.join(" "));return Object.setPrototypeOf(i,HO),i[tf]=t,i[Ss]=r,i[Vo]=e,i},JO=(t,r)=>{if(t.level<=0||!r)return t[Vo]?"":r;let e=t[Ss];if(e===void 0)return r;let{openAll:i,closeAll:n}=e;if(r.includes("\x1B"))for(;e!==void 0;)r=SC(r,e.close,e.open),e=e.parent;let s=r.indexOf(`
|
|
1088
|
-
`);return s!==-1&&(r=vC(r,n,i,s)),i+r+n};Object.defineProperties(zo.prototype,vs);var bz=zo(),Dz=zo({level:TC?TC.level:0});var be=new Xl({level:2}),IC={comment:be.gray,quote:be.gray,keyword:be.green,"selector-tag":be.green,addition:be.green,number:be.cyan,string:be.cyan,"meta meta-string":be.cyan,literal:be.cyan,doctag:be.cyan,regexp:be.cyan,title:be.blue,section:be.blue,name:be.blue,"selector-id":be.blue,"selector-class":be.blue,attribute:be.yellow,attr:be.yellow,variable:be.yellow,"template-variable":be.yellow,"class title":be.yellow,type:be.yellow,symbol:be.magenta,bullet:be.magenta,subst:be.magenta,meta:be.magenta,"meta keyword":be.magenta,"selector-attr":be.magenta,"selector-pseudo":be.magenta,link:be.magenta,built_in:be.red,deletion:be.red,emphasis:be.italic,strong:be.bold,formula:be.inverse};function Kn(t){let r=Zd(t);return{highlight:e,highlightAuto:i,listLanguages:r.listLanguages,register:r.register,registerAlias:r.registerAlias,registered:r.registered};function e(n,s,o){let a=r.highlight(n,s),l=a.data;return{language:l.language,relevance:l.relevance,value:sf(o||IC,a)}}function i(n,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(n,a),u=l.data;return{language:u.language,relevance:u.relevance,value:sf(o||IC,l)}}}function sf(t,r){let e=new Set(r.type==="element"&&Array.isArray(r.properties.className)?r.properties.className.map(function(a){return String(a).replace(/^hljs-/,"")}):[]),i={},n,s="",o;for(o in t)if(Object.hasOwn(t,o)){let a=o.split(" "),l=t[o];e.has(a[0])?a.length===1?n=l:i[a.slice(1).join(" ")]=l:i[o]=l}return"value"in r?s=r.value:"children"in r&&(s=YO(i,r.children)),n&&(s=n(s)),s}function YO(t,r){let e=[],i=-1;for(;++i<r.length;)e.push(sf(t,r[i]));return e.join("")}var Hh=K(require("readline"),1);var H=K(Gt(),1),fT=require("path");var $=K(Gt(),1);var mi=K(Cu(),1),En=K(require("@sentry/node"),1);var zS="1.3.6";var Et=require("node:fs/promises"),Ww=require("node:crypto"),rt=require("node:fs"),ka=require("node:os"),Ae=K(require("node:path"),1),Bh=K(require("prettier"),1),Gw=K(require("typescript"),1),Hw=K(require("launch-editor"),1);var Ys=require("node:child_process");var Mh={};Sc(Mh,{MagicastError:()=>Ft,builders:()=>o8,detectCodeFormat:()=>Kw,generateCode:()=>Lh,loadFile:()=>n8,parseExpression:()=>zw,parseModule:()=>Vw,writeFile:()=>s8});var Wu=require("node:fs");var ec=K(yv(),1),uw=K(Hv(),1);function pr(t){var r=t.use(it),e=r.Type,i=r.builtInTypes,n=i.number;function s(u){return e.from(c=>n.check(c)&&c>=u,n+" >= "+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=e.or(i.string,i.number,i.boolean,i.null,i.undefined);let l=e.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 Be(t){try{var r=t(),e=r.exports,i=e.default}catch{return}i&&i!==e&&typeof e=="object"&&(Object.assign(i,e,{default:i}),e.__esModule&&Object.defineProperty(i,"__esModule",{value:!0}),r.exports=i)}var NB=Object.defineProperty,FB=(t,r,e)=>r in t?NB(t,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[r]=e,qt=(t,r,e)=>(FB(t,typeof r!="symbol"?r+"":r,e),e),cw=Object.prototype,Gu=cw.toString,Sr=cw.hasOwnProperty,Qn=class{assert(r,e){if(!this.check(r,e)){var i=Nh(r);throw new Error(i+" does not match type "+this)}return!0}arrayOf(){let r=this;return new Pa(r)}},Pa=class extends Qn{constructor(r){super(),this.elemType=r,qt(this,"kind","ArrayType")}toString(){return"["+this.elemType+"]"}check(r,e){return Array.isArray(r)&&r.every(i=>this.elemType.check(i,e))}},Hu=class extends Qn{constructor(r){super(),this.value=r,qt(this,"kind","IdentityType")}toString(){return String(this.value)}check(r,e){let i=r===this.value;return!i&&typeof e=="function"&&e(this,r),i}},Ju=class extends Qn{constructor(r){super(),this.fields=r,qt(this,"kind","ObjectType")}toString(){return"{ "+this.fields.join(", ")+" }"}check(r,e){return Gu.call(r)===Gu.call({})&&this.fields.every(i=>i.type.check(r[i.name],e))}},Yu=class extends Qn{constructor(r){super(),this.types=r,qt(this,"kind","OrType")}toString(){return this.types.join(" | ")}check(r,e){return this.types.some(i=>i.check(r,!!e))?!0:(typeof e=="function"&&e(this,r),!1)}},Xn=class extends Qn{constructor(r,e){super(),this.name=r,this.predicate=e,qt(this,"kind","PredicateType")}toString(){return this.name}check(r,e){let i=this.predicate(r,e);return!i&&typeof e=="function"&&e(this,r),i}},Ta=class t{constructor(r,e){this.type=r,this.typeName=e,qt(this,"baseNames",[]),qt(this,"ownFields",Object.create(null)),qt(this,"allSupertypes",Object.create(null)),qt(this,"supertypeList",[]),qt(this,"allFields",Object.create(null)),qt(this,"fieldNames",[]),qt(this,"finalized",!1),qt(this,"buildable",!1),qt(this,"buildParams",[])}isSupertypeOf(r){if(r instanceof t){if(this.finalized!==!0||r.finalized!==!0)throw new Error("");return Sr.call(r.allSupertypes,this.typeName)}else throw new Error(r+" is not a Def")}checkAllFields(r,e){var i=this.allFields;if(this.finalized!==!0)throw new Error(""+this.typeName);function n(s){var o=i[s],a=o.type,l=o.getValue(r);return a.check(l,e)}return r!==null&&typeof r=="object"&&Object.keys(i).every(n)}bases(...r){var e=this.baseNames;if(this.finalized){if(r.length!==e.length)throw new Error("");for(var i=0;i<r.length;i++)if(r[i]!==e[i])throw new Error("");return this}return r.forEach(n=>{e.indexOf(n)<0&&e.push(n)}),this}},Xu=class{constructor(r,e,i,n){this.name=r,this.type=e,this.defaultFn=i,qt(this,"hidden"),this.hidden=!!n}toString(){return JSON.stringify(this.name)+": "+this.type}getValue(r){var e=r[this.name];return typeof e<"u"||typeof this.defaultFn=="function"&&(e=this.defaultFn.call(r)),e}};function Nh(t){return Array.isArray(t)?"["+t.map(Nh).join(", ")+"]":t&&typeof t=="object"?"{ "+Object.keys(t).map(function(r){return r+": "+t[r]}).join(", ")+" }":JSON.stringify(t)}function it(t){let r={or(...P){return new Yu(P.map(N=>r.from(N)))},from(P,N){if(P instanceof Pa||P instanceof Hu||P instanceof Ju||P instanceof Yu||P instanceof Xn)return P;if(P instanceof Ta)return P.type;if(a.check(P)){if(P.length!==1)throw new Error("only one element type is permitted for typed arrays");return new Pa(r.from(P[0]))}if(l.check(P))return new Ju(Object.keys(P).map(V=>new Xu(V,r.from(P[V],V))));if(typeof P=="function"){var O=e.indexOf(P);if(O>=0)return i[O];if(typeof N!="string")throw new Error("missing name");return new Xn(N,P)}return new Hu(P)},def(P){return Sr.call(y,P)?y[P]:y[P]=new C(P)},hasDef(P){return Sr.call(y,P)}};var e=[],i=[];function n(P,N){let O=Gu.call(N),V=new Xn(P,ue=>Gu.call(ue)===O);return N&&typeof N.constructor=="function"&&(e.push(N.constructor),i.push(V)),V}let s=n("string","truthy"),o=n("function",function(){}),a=n("array",[]),l=n("object",{}),u=n("RegExp",/./),c=n("Date",new Date),p=n("number",3),d=n("boolean",!0),h=n("null",null),f=n("undefined",void 0),g=typeof BigInt=="function"?n("BigInt",BigInt(1234)):new Xn("BigInt",()=>!1),m={string:s,function:o,array:a,object:l,RegExp:u,Date:c,number:p,boolean:d,null:h,undefined:f,BigInt:g};var y=Object.create(null);function b(P){if(P&&typeof P=="object"){var N=P.type;if(typeof N=="string"&&Sr.call(y,N)){var O=y[N];if(O.finalized)return O}}return null}class C extends Ta{constructor(N){super(new Xn(N,(O,V)=>this.check(O,V)),N)}check(N,O){if(this.finalized!==!0)throw new Error("prematurely checking unfinalized type "+this.typeName);if(N===null||typeof N!="object")return!1;var V=b(N);return V?O&&V===this?this.checkAllFields(N,O):this.isSupertypeOf(V)?O?V.checkAllFields(N,O)&&this.checkAllFields(N,!1):!0:!1:this.typeName==="SourceLocation"||this.typeName==="Position"?this.checkAllFields(N,O):!1}build(...N){if(this.buildParams=N,this.buildable)return this;this.field("type",String,()=>this.typeName),this.buildable=!0;let O=(ue,ee,ae,ct)=>{if(!Sr.call(ue,ee)){var ht=this.allFields;if(!Sr.call(ht,ee))throw new Error(""+ee);var Di=ht[ee],ao=Di.type,xi;if(ct)xi=ae;else if(Di.defaultFn)xi=Di.defaultFn.call(ue);else{var lo="no value or default function given for field "+JSON.stringify(ee)+" of "+this.typeName+"("+this.buildParams.map(function(Ie){return ht[Ie]}).join(", ")+")";throw new Error(lo)}if(!ao.check(xi))throw new Error(Nh(xi)+" does not match field "+Di+" of type "+this.typeName);ue[ee]=xi}},V=(...ue)=>{var ee=ue.length;if(!this.finalized)throw new Error("attempting to instantiate unfinalized type "+this.typeName);var ae=Object.create(w);if(this.buildParams.forEach(function(ct,ht){ht<ee?O(ae,ct,ue[ht],!0):O(ae,ct,null,!1)}),Object.keys(this.allFields).forEach(function(ct){O(ae,ct,null,!1)}),ae.type!==this.typeName)throw new Error("");return ae};return V.from=ue=>{if(!this.finalized)throw new Error("attempting to instantiate unfinalized type "+this.typeName);var ee=Object.create(w);if(Object.keys(this.allFields).forEach(function(ae){Sr.call(ue,ae)?O(ee,ae,ue[ae],!0):O(ee,ae,null,!1)}),ee.type!==this.typeName)throw new Error("");return ee},Object.defineProperty(E,M(this.typeName),{enumerable:!0,value:V}),this}field(N,O,V,ue){return this.finalized?(console.error("Ignoring attempt to redefine field "+JSON.stringify(N)+" of finalized type "+JSON.stringify(this.typeName)),this):(this.ownFields[N]=new Xu(N,r.from(O),V,ue),this)}finalize(){if(!this.finalized){var N=this.allFields,O=this.allSupertypes;this.baseNames.forEach(ue=>{var ee=y[ue];if(ee instanceof Ta)ee.finalize(),B(N,ee.allFields),B(O,ee.allSupertypes);else{var ae="unknown supertype name "+JSON.stringify(ue)+" for subtype "+JSON.stringify(this.typeName);throw new Error(ae)}}),B(N,this.ownFields),O[this.typeName]=this,this.fieldNames.length=0;for(var V in N)Sr.call(N,V)&&!N[V].hidden&&this.fieldNames.push(V);Object.defineProperty(L,this.typeName,{enumerable:!0,value:this.type}),this.finalized=!0,_(this.typeName,this.supertypeList),this.buildable&&this.supertypeList.lastIndexOf("Expression")>=0&&Pe(this.typeName)}}}function D(P){if(!Sr.call(y,P))throw new Error("");var N=y[P];if(N.finalized!==!0)throw new Error("");return N.supertypeList.slice(1)}function x(P){for(var N={},O=Object.keys(y),V=O.length,ue=0;ue<V;++ue){var ee=O[ue],ae=y[ee];if(ae.finalized!==!0)throw new Error(""+ee);for(var ct=0;ct<ae.supertypeList.length;++ct){var ht=ae.supertypeList[ct];if(Sr.call(P,ht)){N[ee]=ht;break}}}return N}var E=Object.create(null),w={};function R(P,N){var O=w[P];return f.check(N)?delete w[P]:(o.assert(N),Object.defineProperty(w,P,{enumerable:!0,configurable:!0,value:N})),O}function M(P){return P.replace(/^[A-Z]+/,function(N){var O=N.length;switch(O){case 0:return"";case 1:return N.toLowerCase();default:return N.slice(0,O-1).toLowerCase()+N.charAt(O-1)}})}function T(P){return P=M(P),P.replace(/(Expression)?$/,"Statement")}var L={};function Q(P){var N=b(P);if(N)return N.fieldNames.slice(0);if("type"in P)throw new Error("did not recognize object of type "+JSON.stringify(P.type));return Object.keys(P)}function ie(P,N){var O=b(P);if(O){var V=O.allFields[N];if(V)return V.getValue(P)}return P&&P[N]}function re(P,N,O){Q(P).forEach(function(V){N.call(this,V,ie(P,V))},O)}function Z(P,N,O){return Q(P).some(function(V){return N.call(this,V,ie(P,V))},O)}function Pe(P){var N=T(P);if(E[N])return;var O=E[M(P)];if(!O)return;let V=function(...ue){return E.expressionStatement(O.apply(E,ue))};V.from=function(...ue){return E.expressionStatement(O.from.apply(E,ue))},E[N]=V}function _(P,N){N.length=0,N.push(P);for(var O=Object.create(null),V=0;V<N.length;++V){P=N[V];var ue=y[P];if(ue.finalized!==!0)throw new Error("");Sr.call(O,P)&&delete N[O[P]],O[P]=V,N.push.apply(N,ue.baseNames)}for(var ee=0,ae=ee,ct=N.length;ae<ct;++ae)Sr.call(N,ae)&&(N[ee++]=N[ae]);N.length=ee}function B(P,N){return Object.keys(N).forEach(function(O){P[O]=N[O]}),P}function G(){Object.keys(y).forEach(function(P){y[P].finalize()})}return{Type:r,builtInTypes:m,getSupertypeNames:D,computeSupertypeLookupTable:x,builders:E,defineMethod:R,getBuilderName:M,getStatementBuilderName:T,namedTypes:L,getFieldNames:Q,getFieldValue:ie,eachField:re,someField:Z,finalize:G}}Be(()=>module);var kB=Object.prototype,Mu=kB.hasOwnProperty;function pw(t){var r=t.use(it),e=r.builtInTypes.array,i=r.builtInTypes.number;let n=function p(d,h,f){if(!(this instanceof p))throw new Error("Path constructor cannot be invoked without 'new'");if(h){if(!(h instanceof p))throw new Error("")}else h=null,f=null;this.value=d,this.parentPath=h,this.name=f,this.__childCache=null};var s=n.prototype;function o(p){return p.__childCache||(p.__childCache=Object.create(null))}function a(p,d){var h=o(p),f=p.getValueProperty(d),g=h[d];return(!Mu.call(h,d)||g.value!==f)&&(g=h[d]=new p.constructor(f,p,d)),g}s.getValueProperty=function(d){return this.value[d]},s.get=function(...d){for(var h=this,f=d.length,g=0;g<f;++g)h=a(h,d[g]);return h},s.each=function(d,h){for(var f=[],g=this.value.length,m=0,m=0;m<g;++m)Mu.call(this.value,m)&&(f[m]=this.get(m));for(h=h||this,m=0;m<g;++m)Mu.call(f,m)&&d.call(h,f[m])},s.map=function(d,h){var f=[];return this.each(function(g){f.push(d.call(this,g))},h),f},s.filter=function(d,h){var f=[];return this.each(function(g){d.call(this,g)&&f.push(g)},h),f};function l(){}function u(p,d,h,f){if(e.assert(p.value),d===0)return l;var g=p.value.length;if(g<1)return l;var m=arguments.length;m===2?(h=0,f=g):m===3?(h=Math.max(h,0),f=g):(h=Math.max(h,0),f=Math.min(f,g)),i.assert(h),i.assert(f);for(var y=Object.create(null),b=o(p),C=h;C<f;++C)if(Mu.call(p.value,C)){var D=p.get(C);if(D.name!==C)throw new Error("");var x=C+d;D.name=x,y[x]=D,delete b[C]}return delete b.length,function(){for(var E in y){var w=y[E];if(w.name!==+E)throw new Error("");b[E]=w,p.value[E]=w.value}}}s.shift=function(){var d=u(this,-1),h=this.value.shift();return d(),h},s.unshift=function(...d){var h=u(this,d.length),f=this.value.unshift.apply(this.value,d);return h(),f},s.push=function(...d){return e.assert(this.value),delete o(this).length,this.value.push.apply(this.value,d)},s.pop=function(){e.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 h=arguments.length,f=u(this,h-1,d);if(f===l&&h<=1)return this;d=Math.max(d,0);for(var g=1;g<h;++g)this.value[d+g-1]=arguments[g];return f(),this},s.insertBefore=function(...d){for(var h=this.parentPath,f=d.length,g=[this.name],m=0;m<f;++m)g.push(d[m]);return h.insertAt.apply(h,g)},s.insertAfter=function(...d){for(var h=this.parentPath,f=d.length,g=[this.name+1],m=0;m<f;++m)g.push(d[m]);return h.insertAt.apply(h,g)};function c(p){if(!(p instanceof n))throw new Error("");var d=p.parentPath;if(!d)return p;var h=d.value,f=o(d);if(h[p.name]===p.value)f[p.name]=p;else if(e.check(h)){var g=h.indexOf(p.value);g>=0&&(f[p.name=g]=p)}else h[p.name]=p.value,f[p.name]=p;if(h[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 h=[],f=this.parentPath.value,g=o(this.parentPath),m=arguments.length;if(c(this),e.check(f)){for(var y=f.length,b=u(this.parentPath,m-1,this.name+1),C=[this.name,1],D=0;D<m;++D)C.push(arguments[D]);var x=f.splice.apply(f,C);if(x[0]!==this.value)throw new Error("");if(f.length!==y-1+m)throw new Error("");if(b(),m===0)delete this.value,delete g[this.name],this.__childCache=null;else{if(f[this.name]!==d)throw new Error("");for(this.value!==d&&(this.value=d,this.__childCache=null),D=0;D<m;++D)h.push(this.parentPath.get(this.name+D));if(h[0]!==this)throw new Error("")}}else if(m===1)this.value!==d&&(this.__childCache=null),this.value=f[this.name]=d,h.push(this);else if(m===0)delete f[this.name],delete this.value,this.__childCache=null;else throw new Error("Could not replace path");return h},n}Be(()=>module);var qs=Object.prototype.hasOwnProperty;function OB(t){var r=t.use(it),e=r.Type,i=r.namedTypes,n=i.Node,s=i.Expression,o=r.builtInTypes.array,a=r.builders;let l=function D(x,E){if(!(this instanceof D))throw new Error("Scope constructor cannot be invoked without 'new'");c.check(x.value)||u.assert(x.value);var w;if(E){if(!(E instanceof D))throw new Error("");w=E.depth+1}else E=null,w=0;Object.defineProperties(this,{path:{value:x},node:{value:x.value},isGlobal:{value:!E,enumerable:!0},depth:{value:w},parent:{value:E},bindings:{value:{}},types:{value:{}}})};var u=e.or(i.Program,i.Function,i.CatchClause),c=e.or(i.Function,i.ClassDeclaration,i.ClassExpression,i.InterfaceDeclaration,i.TSInterfaceDeclaration,i.TypeAlias,i.TSTypeAliasDeclaration),p=e.or(i.TypeParameter,i.TSTypeParameter);l.isEstablishedBy=function(D){return u.check(D)||c.check(D)};var d=l.prototype;d.didScan=!1,d.declares=function(D){return this.scan(),qs.call(this.bindings,D)},d.declaresType=function(D){return this.scan(),qs.call(this.types,D)},d.declareTemporary=function(D){if(D){if(!/^[a-z$_]/i.test(D))throw new Error("")}else D="t$";D+=this.depth.toString(36)+"$",this.scan();for(var x=0;this.declares(D+x);)++x;var E=D+x;return this.bindings[E]=r.builders.identifier(E)},d.injectTemporary=function(D,x){D||(D=this.declareTemporary());var E=this.path.get("body");return i.BlockStatement.check(E.value)&&(E=E.get("body")),E.unshift(a.variableDeclaration("var",[a.variableDeclarator(D,x||null)])),D},d.scan=function(D){if(D||!this.didScan){for(var x in this.bindings)delete this.bindings[x];for(var x in this.types)delete this.types[x];h(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 h(D,x,E){var w=D.value;if(c.check(w)){let R=D.get("typeParameters","params");o.check(R.value)&&R.each(M=>{C(M,E)})}u.check(w)&&(i.CatchClause.check(w)?y(D.get("param"),x):f(D,x,E))}function f(D,x,E){var w=D.value;D.parent&&i.FunctionExpression.check(D.parent.node)&&D.parent.node.id&&y(D.parent.get("id"),x),w&&(o.check(w)?D.each(R=>{m(R,x,E)}):i.Function.check(w)?(D.get("params").each(R=>{y(R,x)}),m(D.get("body"),x,E),f(D.get("typeParameters"),x,E)):i.TypeAlias&&i.TypeAlias.check(w)||i.InterfaceDeclaration&&i.InterfaceDeclaration.check(w)||i.TSTypeAliasDeclaration&&i.TSTypeAliasDeclaration.check(w)||i.TSInterfaceDeclaration&&i.TSInterfaceDeclaration.check(w)?b(D.get("id"),E):i.VariableDeclarator.check(w)?(y(D.get("id"),x),m(D.get("init"),x,E)):w.type==="ImportSpecifier"||w.type==="ImportNamespaceSpecifier"||w.type==="ImportDefaultSpecifier"?y(D.get(w.local?"local":w.name?"name":"id"),x):n.check(w)&&!s.check(w)&&r.eachField(w,function(R,M){var T=D.get(R);if(!g(T,M))throw new Error("");m(T,x,E)}))}function g(D,x){return!!(D.value===x||Array.isArray(D.value)&&D.value.length===0&&Array.isArray(x)&&x.length===0)}function m(D,x,E){var w=D.value;if(!(!w||s.check(w)))if(i.FunctionDeclaration.check(w)&&w.id!==null)y(D.get("id"),x);else if(i.ClassDeclaration&&i.ClassDeclaration.check(w)&&w.id!==null)y(D.get("id"),x),f(D.get("typeParameters"),x,E);else if(i.InterfaceDeclaration&&i.InterfaceDeclaration.check(w)||i.TSInterfaceDeclaration&&i.TSInterfaceDeclaration.check(w))b(D.get("id"),E);else if(u.check(w)){if(i.CatchClause.check(w)&&i.Identifier.check(w.param)){var R=w.param.name,M=qs.call(x,R);f(D.get("body"),x,E),M||delete x[R]}}else f(D,x,E)}function y(D,x){var E=D.value;i.Pattern.assert(E),i.Identifier.check(E)?qs.call(x,E.name)?x[E.name].push(D):x[E.name]=[D]:i.AssignmentPattern&&i.AssignmentPattern.check(E)?y(D.get("left"),x):i.ObjectPattern&&i.ObjectPattern.check(E)?D.get("properties").each(function(w){var R=w.value;i.Pattern.check(R)?y(w,x):i.Property.check(R)||i.ObjectProperty&&i.ObjectProperty.check(R)?y(w.get("value"),x):i.SpreadProperty&&i.SpreadProperty.check(R)&&y(w.get("argument"),x)}):i.ArrayPattern&&i.ArrayPattern.check(E)?D.get("elements").each(function(w){var R=w.value;i.Pattern.check(R)?y(w,x):i.SpreadElement&&i.SpreadElement.check(R)&&y(w.get("argument"),x)}):i.PropertyPattern&&i.PropertyPattern.check(E)?y(D.get("pattern"),x):(i.SpreadElementPattern&&i.SpreadElementPattern.check(E)||i.RestElement&&i.RestElement.check(E)||i.SpreadPropertyPattern&&i.SpreadPropertyPattern.check(E))&&y(D.get("argument"),x)}function b(D,x){var E=D.value;i.Pattern.assert(E),i.Identifier.check(E)&&(qs.call(x,E.name)?x[E.name].push(D):x[E.name]=[D])}function C(D,x){var E=D.value;p.assert(E),qs.call(x,E.name)?x[E.name].push(D):x[E.name]=[D]}return d.lookup=function(D){for(var x=this;x&&!x.declares(D);x=x.parent);return x},d.lookupType=function(D){for(var x=this;x&&!x.declaresType(D);x=x.parent);return x},d.getGlobalScope=function(){for(var D=this;!D.isGlobal;)D=D.parent;return D},l}Be(()=>module);function dw(t){var r=t.use(it),e=r.namedTypes,i=r.builders,n=r.builtInTypes.number,s=r.builtInTypes.array,o=t.use(pw),a=t.use(OB);let l=function m(y,b,C){if(!(this instanceof m))throw new Error("NodePath constructor cannot be invoked without 'new'");o.call(this,y,b,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 m=this.parent;return this.replace(),f(m)},u._computeNode=function(){var m=this.value;if(e.Node.check(m))return m;var y=this.parentPath;return y&&y.node||null},u._computeParent=function(){var m=this.value,y=this.parentPath;if(!e.Node.check(m)){for(;y&&!e.Node.check(y.value);)y=y.parentPath;y&&(y=y.parentPath)}for(;y&&!e.Node.check(y.value);)y=y.parentPath;return y||null},u._computeScope=function(){var m=this.value,y=this.parentPath,b=y&&y.scope;return e.Node.check(m)&&a.isEstablishedBy(m)&&(b=new a(this,b)),b||null},u.getValueProperty=function(m){return r.getFieldValue(this.value,m)},u.needsParens=function(m){var y=this.parentPath;if(!y)return!1;var b=this.value;if(!e.Expression.check(b)||b.type==="Identifier")return!1;for(;!e.Node.check(y.value);)if(y=y.parentPath,!y)return!1;var C=y.value;switch(b.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return C.type==="MemberExpression"&&this.name==="object"&&C.object===b;case"BinaryExpression":case"LogicalExpression":switch(C.type){case"CallExpression":return this.name==="callee"&&C.callee===b;case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return!0;case"MemberExpression":return this.name==="object"&&C.object===b;case"BinaryExpression":case"LogicalExpression":{let D=b,x=C.operator,E=p[x],w=D.operator,R=p[w];if(E>R)return!0;if(E===R&&this.name==="right"){if(C.right!==D)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"&&n.check(b.value)&&this.name==="object"&&C.object===b;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===b;case"ConditionalExpression":return this.name==="test"&&C.test===b;case"MemberExpression":return this.name==="object"&&C.object===b;default:return!1}default:if(C.type==="NewExpression"&&this.name==="callee"&&C.callee===b)return d(b)}return!!(m!==!0&&!this.canBeFirstInStatement()&&this.firstInStatement())};function c(m){return e.BinaryExpression.check(m)||e.LogicalExpression.check(m)}var p={};[["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"]].forEach(function(m,y){m.forEach(function(b){p[b]=y})});function d(m){return e.CallExpression.check(m)?!0:s.check(m)?m.some(d):e.Node.check(m)?r.someField(m,function(y,b){return d(b)}):!1}u.canBeFirstInStatement=function(){var m=this.node;return!e.FunctionExpression.check(m)&&!e.ObjectExpression.check(m)},u.firstInStatement=function(){return h(this)};function h(m){for(var y,b;m.parent;m=m.parent){if(y=m.node,b=m.parent.node,e.BlockStatement.check(b)&&m.parent.name==="body"&&m.name===0){if(b.body[0]!==y)throw new Error("Nodes must be equal");return!0}if(e.ExpressionStatement.check(b)&&m.name==="expression"){if(b.expression!==y)throw new Error("Nodes must be equal");return!0}if(e.SequenceExpression.check(b)&&m.parent.name==="expressions"&&m.name===0){if(b.expressions[0]!==y)throw new Error("Nodes must be equal");continue}if(e.CallExpression.check(b)&&m.name==="callee"){if(b.callee!==y)throw new Error("Nodes must be equal");continue}if(e.MemberExpression.check(b)&&m.name==="object"){if(b.object!==y)throw new Error("Nodes must be equal");continue}if(e.ConditionalExpression.check(b)&&m.name==="test"){if(b.test!==y)throw new Error("Nodes must be equal");continue}if(c(b)&&m.name==="left"){if(b.left!==y)throw new Error("Nodes must be equal");continue}if(e.UnaryExpression.check(b)&&!b.prefix&&m.name==="argument"){if(b.argument!==y)throw new Error("Nodes must be equal");continue}return!1}return!0}function f(m){if(e.VariableDeclaration.check(m.node)){var y=m.get("declarations").value;if(!y||y.length===0)return m.prune()}else if(e.ExpressionStatement.check(m.node)){if(!m.get("expression").value)return m.prune()}else e.IfStatement.check(m.node)&&g(m);return m}function g(m){var y=m.get("test").value,b=m.get("alternate").value,C=m.get("consequent").value;if(!C&&!b){var D=i.expressionStatement(y);m.replace(D)}else if(!C&&b){var x=i.unaryExpression("!",y,!0);e.UnaryExpression.check(y)&&y.operator==="!"&&(x=y.argument),m.get("test").replace(x),m.get("consequent").replace(b),m.get("alternate").replace()}}return l}Be(()=>module);var Bu=Object.prototype.hasOwnProperty;function RB(t){var r=t.use(it),e=t.use(dw),i=r.builtInTypes.array,n=r.builtInTypes.object,s=r.builtInTypes.function,o;let a=function f(){if(!(this instanceof f))throw new Error("PathVisitor constructor cannot be invoked without 'new'");this._reusableContextStack=[],this._methodNameTable=l(this),this._shouldVisitComments=Bu.call(this._methodNameTable,"Block")||Bu.call(this._methodNameTable,"Line"),this.Context=d(this),this._visiting=!1,this._changeReported=!1};function l(f){var g=Object.create(null);for(var m in f)/^visit[A-Z]/.test(m)&&(g[m.slice(5)]=!0);for(var y=r.computeSupertypeLookupTable(g),b=Object.create(null),C=Object.keys(y),D=C.length,x=0;x<D;++x){var E=C[x];m="visit"+y[E],s.check(f[m])&&(b[E]=m)}return b}a.fromMethodsObject=function(g){if(g instanceof a)return g;if(!n.check(g))return new a;let m=function b(){if(!(this instanceof b))throw new Error("Visitor constructor cannot be invoked without 'new'");a.call(this)};var y=m.prototype=Object.create(c);return y.constructor=m,u(y,g),u(m,a),s.assert(m.fromMethodsObject),s.assert(m.visit),new m};function u(f,g){for(var m in g)Bu.call(g,m)&&(f[m]=g[m]);return f}a.visit=function(g,m){return a.fromMethodsObject(m).visit(g)};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 f=arguments.length,g=new Array(f),m=0;m<f;++m)g[m]=arguments[m];g[0]instanceof e||(g[0]=new e({root:g[0]}).get("root")),this.reset.apply(this,g);var y;try{var b=this.visitWithoutReset(g[0]);y=!0}finally{if(this._visiting=!1,!y&&this._abortRequested)return g[0].value}return b},c.AbortRequest=function(){},c.abort=function(){var f=this;f._abortRequested=!0;var g=new f.AbortRequest;throw g.cancel=function(){f._abortRequested=!1},g},c.reset=function(f){},c.visitWithoutReset=function(f){if(this instanceof this.Context)return this.visitor.visitWithoutReset(f);if(!(f instanceof e))throw new Error("");var g=f.value,m=g&&typeof g=="object"&&typeof g.type=="string"&&this._methodNameTable[g.type];if(m){var y=this.acquireContext(f);try{return y.invokeVisitorMethod(m)}finally{this.releaseContext(y)}}else return p(f,this)};function p(f,g){if(!(f instanceof e))throw new Error("");if(!(g instanceof a))throw new Error("");var m=f.value;if(i.check(m))f.each(g.visitWithoutReset,g);else if(n.check(m)){var y=r.getFieldNames(m);g._shouldVisitComments&&m.comments&&y.indexOf("comments")<0&&y.push("comments");for(var b=y.length,C=[],D=0;D<b;++D){var x=y[D];Bu.call(m,x)||(m[x]=r.getFieldValue(m,x)),C.push(f.get(x))}for(var D=0;D<b;++D)g.visitWithoutReset(C[D])}return f.value}c.acquireContext=function(f){return this._reusableContextStack.length===0?new this.Context(f):this._reusableContextStack.pop().reset(f)},c.releaseContext=function(f){if(!(f instanceof this.Context))throw new Error("");this._reusableContextStack.push(f),f.currentPath=null},c.reportChanged=function(){this._changeReported=!0},c.wasChangeReported=function(){return this._changeReported};function d(f){function g(y){if(!(this instanceof g))throw new Error("");if(!(this instanceof a))throw new Error("");if(!(y instanceof e))throw new Error("");Object.defineProperty(this,"visitor",{value:f,writable:!1,enumerable:!0,configurable:!1}),this.currentPath=y,this.needToCallTraverse=!0,Object.seal(this)}if(!(f instanceof a))throw new Error("");var m=g.prototype=Object.create(f);return m.constructor=g,u(m,h),g}var h=Object.create(null);return h.reset=function(g){if(!(this instanceof this.Context))throw new Error("");if(!(g instanceof e))throw new Error("");return this.currentPath=g,this.needToCallTraverse=!0,this},h.invokeVisitorMethod=function(g){if(!(this instanceof this.Context))throw new Error("");if(!(this.currentPath instanceof e))throw new Error("");var m=this.visitor[g].call(this,this.currentPath);if(m===!1?this.needToCallTraverse=!1:m!==o&&(this.currentPath=this.currentPath.replace(m)[0],this.needToCallTraverse&&this.traverse(this.currentPath)),this.needToCallTraverse!==!1)throw new Error("Must either call this.traverse or return false in "+g);var y=this.currentPath;return y&&y.value},h.traverse=function(g,m){if(!(this instanceof this.Context))throw new Error("");if(!(g instanceof e))throw new Error("");if(!(this.currentPath instanceof e))throw new Error("");return this.needToCallTraverse=!1,p(g,a.fromMethodsObject(m||this.visitor))},h.visit=function(g,m){if(!(this instanceof this.Context))throw new Error("");if(!(g instanceof e))throw new Error("");if(!(this.currentPath instanceof e))throw new Error("");return this.needToCallTraverse=!1,a.fromMethodsObject(m||this.visitor).visitWithoutReset(g)},h.reportChanged=function(){this.visitor.reportChanged()},h.abort=function(){this.needToCallTraverse=!1,this.visitor.abort()},a}Be(()=>module);function LB(t){var r=t.use(it),e=r.getFieldNames,i=r.getFieldValue,n=r.builtInTypes.array,s=r.builtInTypes.object,o=r.builtInTypes.Date,a=r.builtInTypes.RegExp,l=Object.prototype.hasOwnProperty;function u(f,g,m){return n.check(m)?m.length=0:m=null,p(f,g,m)}u.assert=function(f,g){var m=[];if(!u(f,g,m))if(m.length===0){if(f!==g)throw new Error("Nodes must be equal")}else throw new Error("Nodes differ in the following path: "+m.map(c).join(""))};function c(f){return/[_$a-z][_$a-z0-9]*/i.test(f)?"."+f:"["+JSON.stringify(f)+"]"}function p(f,g,m){return f===g?!0:n.check(f)?d(f,g,m):s.check(f)?h(f,g,m):o.check(f)?o.check(g)&&+f==+g:a.check(f)?a.check(g)&&f.source===g.source&&f.global===g.global&&f.multiline===g.multiline&&f.ignoreCase===g.ignoreCase:f==g}function d(f,g,m){n.assert(f);var y=f.length;if(!n.check(g)||g.length!==y)return m&&m.push("length"),!1;for(var b=0;b<y;++b){if(m&&m.push(b),b in f!=b in g||!p(f[b],g[b],m))return!1;if(m){var C=m.pop();if(C!==b)throw new Error(""+C)}}return!0}function h(f,g,m){if(s.assert(f),!s.check(g))return!1;if(f.type!==g.type)return m&&m.push("type"),!1;var y=e(f),b=y.length,C=e(g),D=C.length;if(b===D){for(var x=0;x<b;++x){var E=y[x],w=i(f,E),R=i(g,E);if(m&&m.push(E),!p(w,R,m))return!1;if(m){var M=m.pop();if(M!==E)throw new Error(""+M)}}return!0}if(!m)return!1;var T=Object.create(null);for(x=0;x<b;++x)T[y[x]]=!0;for(x=0;x<D;++x){if(E=C[x],!l.call(T,E))return m.push(E),!1;delete T[E]}for(E in T){m.push(E);break}return!1}return u}Be(()=>module);function MB(t){let r=BB(),e=r.use(it);t.forEach(r.use),e.finalize();let i=r.use(RB);return{Type:e.Type,builtInTypes:e.builtInTypes,namedTypes:e.namedTypes,builders:e.builders,defineMethod:e.defineMethod,getFieldNames:e.getFieldNames,getFieldValue:e.getFieldValue,eachField:e.eachField,someField:e.someField,getSupertypeNames:e.getSupertypeNames,getBuilderName:e.getBuilderName,astNodesAreEquivalent:r.use(LB),finalize:e.finalize,Path:r.use(pw),NodePath:r.use(dw),PathVisitor:i,use:r.use,visit:i.visit}}function BB(){let t=[],r=[];function e(n){var s=t.indexOf(n);return s===-1&&(s=t.length,t.push(n),r[s]=n(i)),r[s]}var i={use:e};return i}Be(()=>module);function fw(){return{BinaryOperators:["==","!=","===","!==","<","<=",">",">=","<<",">>",">>>","+","-","*","/","%","&","|","^","in","instanceof"],AssignmentOperators:["=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","|=","^=","&="],LogicalOperators:["||","&&"]}}Be(()=>module);function hw(t){let r=t.use(fw);return r.BinaryOperators.indexOf("**")<0&&r.BinaryOperators.push("**"),r.AssignmentOperators.indexOf("**=")<0&&r.AssignmentOperators.push("**="),r}Be(()=>module);function mw(t){let r=t.use(hw);return r.LogicalOperators.indexOf("??")<0&&r.LogicalOperators.push("??"),r}Be(()=>module);function $B(t){let r=t.use(mw);return r.LogicalOperators.forEach(e=>{let i=e+"=";r.AssignmentOperators.indexOf(i)<0&&r.AssignmentOperators.push(i)}),r}Be(()=>module);function UB(t){var r=t.use(it),e=r.Type,i=e.def,n=e.or,s=t.use(pr),o=s.defaults,a=s.geq;let{BinaryOperators:l,AssignmentOperators:u,LogicalOperators:c}=t.use(fw);i("Printable").field("loc",n(i("SourceLocation"),null),o.null,!0),i("Node").bases("Printable").field("type",String).field("comments",n([i("Comment")],null),o.null,!0),i("SourceLocation").field("start",i("Position")).field("end",i("Position")).field("source",n(String,null),o.null),i("Position").field("line",a(1)).field("column",a(0)),i("File").bases("Node").build("program","name").field("program",i("Program")).field("name",n(String,null),o.null),i("Program").bases("Node").build("body").field("body",[i("Statement")]),i("Function").bases("Node").field("id",n(i("Identifier"),null),o.null).field("params",[i("Pattern")]).field("body",i("BlockStatement")).field("generator",Boolean,o.false).field("async",Boolean,o.false),i("Statement").bases("Node"),i("EmptyStatement").bases("Statement").build(),i("BlockStatement").bases("Statement").build("body").field("body",[i("Statement")]),i("ExpressionStatement").bases("Statement").build("expression").field("expression",i("Expression")),i("IfStatement").bases("Statement").build("test","consequent","alternate").field("test",i("Expression")).field("consequent",i("Statement")).field("alternate",n(i("Statement"),null),o.null),i("LabeledStatement").bases("Statement").build("label","body").field("label",i("Identifier")).field("body",i("Statement")),i("BreakStatement").bases("Statement").build("label").field("label",n(i("Identifier"),null),o.null),i("ContinueStatement").bases("Statement").build("label").field("label",n(i("Identifier"),null),o.null),i("WithStatement").bases("Statement").build("object","body").field("object",i("Expression")).field("body",i("Statement")),i("SwitchStatement").bases("Statement").build("discriminant","cases","lexical").field("discriminant",i("Expression")).field("cases",[i("SwitchCase")]).field("lexical",Boolean,o.false),i("ReturnStatement").bases("Statement").build("argument").field("argument",n(i("Expression"),null)),i("ThrowStatement").bases("Statement").build("argument").field("argument",i("Expression")),i("TryStatement").bases("Statement").build("block","handler","finalizer").field("block",i("BlockStatement")).field("handler",n(i("CatchClause"),null),function(){return this.handlers&&this.handlers[0]||null}).field("handlers",[i("CatchClause")],function(){return this.handler?[this.handler]:[]},!0).field("guardedHandlers",[i("CatchClause")],o.emptyArray).field("finalizer",n(i("BlockStatement"),null),o.null),i("CatchClause").bases("Node").build("param","guard","body").field("param",i("Pattern")).field("guard",n(i("Expression"),null),o.null).field("body",i("BlockStatement")),i("WhileStatement").bases("Statement").build("test","body").field("test",i("Expression")).field("body",i("Statement")),i("DoWhileStatement").bases("Statement").build("body","test").field("body",i("Statement")).field("test",i("Expression")),i("ForStatement").bases("Statement").build("init","test","update","body").field("init",n(i("VariableDeclaration"),i("Expression"),null)).field("test",n(i("Expression"),null)).field("update",n(i("Expression"),null)).field("body",i("Statement")),i("ForInStatement").bases("Statement").build("left","right","body").field("left",n(i("VariableDeclaration"),i("Expression"))).field("right",i("Expression")).field("body",i("Statement")),i("DebuggerStatement").bases("Statement").build(),i("Declaration").bases("Statement"),i("FunctionDeclaration").bases("Function","Declaration").build("id","params","body").field("id",i("Identifier")),i("FunctionExpression").bases("Function","Expression").build("id","params","body"),i("VariableDeclaration").bases("Declaration").build("kind","declarations").field("kind",n("var","let","const")).field("declarations",[i("VariableDeclarator")]),i("VariableDeclarator").bases("Node").build("id","init").field("id",i("Pattern")).field("init",n(i("Expression"),null),o.null),i("Expression").bases("Node"),i("ThisExpression").bases("Expression").build(),i("ArrayExpression").bases("Expression").build("elements").field("elements",[n(i("Expression"),null)]),i("ObjectExpression").bases("Expression").build("properties").field("properties",[i("Property")]),i("Property").bases("Node").build("kind","key","value").field("kind",n("init","get","set")).field("key",n(i("Literal"),i("Identifier"))).field("value",i("Expression")),i("SequenceExpression").bases("Expression").build("expressions").field("expressions",[i("Expression")]);var p=n("-","+","!","~","typeof","void","delete");i("UnaryExpression").bases("Expression").build("operator","argument","prefix").field("operator",p).field("argument",i("Expression")).field("prefix",Boolean,o.true);let d=n(...l);i("BinaryExpression").bases("Expression").build("operator","left","right").field("operator",d).field("left",i("Expression")).field("right",i("Expression"));let h=n(...u);i("AssignmentExpression").bases("Expression").build("operator","left","right").field("operator",h).field("left",n(i("Pattern"),i("MemberExpression"))).field("right",i("Expression"));var f=n("++","--");i("UpdateExpression").bases("Expression").build("operator","argument","prefix").field("operator",f).field("argument",i("Expression")).field("prefix",Boolean);var g=n(...c);i("LogicalExpression").bases("Expression").build("operator","left","right").field("operator",g).field("left",i("Expression")).field("right",i("Expression")),i("ConditionalExpression").bases("Expression").build("test","consequent","alternate").field("test",i("Expression")).field("consequent",i("Expression")).field("alternate",i("Expression")),i("NewExpression").bases("Expression").build("callee","arguments").field("callee",i("Expression")).field("arguments",[i("Expression")]),i("CallExpression").bases("Expression").build("callee","arguments").field("callee",i("Expression")).field("arguments",[i("Expression")]),i("MemberExpression").bases("Expression").build("object","property","computed").field("object",i("Expression")).field("property",n(i("Identifier"),i("Expression"))).field("computed",Boolean,function(){var m=this.property.type;return m==="Literal"||m==="MemberExpression"||m==="BinaryExpression"}),i("Pattern").bases("Node"),i("SwitchCase").bases("Node").build("test","consequent").field("test",n(i("Expression"),null)).field("consequent",[i("Statement")]),i("Identifier").bases("Expression","Pattern").build("name").field("name",String).field("optional",Boolean,o.false),i("Literal").bases("Expression").build("value").field("value",n(String,Boolean,null,Number,RegExp,BigInt)),i("Comment").bases("Printable").field("value",String).field("leading",Boolean,o.true).field("trailing",Boolean,o.false)}Be(()=>module);function jB(t){t.use(UB);let r=t.use(it),e=r.Type.def,i=r.Type.or,n=t.use(pr).defaults;e("Function").field("generator",Boolean,n.false).field("expression",Boolean,n.false).field("defaults",[i(e("Expression"),null)],n.emptyArray).field("rest",i(e("Identifier"),null),n.null),e("RestElement").bases("Pattern").build("argument").field("argument",e("Pattern")).field("typeAnnotation",i(e("TypeAnnotation"),e("TSTypeAnnotation"),null),n.null),e("SpreadElementPattern").bases("Pattern").build("argument").field("argument",e("Pattern")),e("FunctionDeclaration").build("id","params","body","generator","expression").field("id",i(e("Identifier"),null)),e("FunctionExpression").build("id","params","body","generator","expression"),e("ArrowFunctionExpression").bases("Function","Expression").build("params","body","expression").field("id",null,n.null).field("body",i(e("BlockStatement"),e("Expression"))).field("generator",!1,n.false),e("ForOfStatement").bases("Statement").build("left","right","body").field("left",i(e("VariableDeclaration"),e("Pattern"))).field("right",e("Expression")).field("body",e("Statement")),e("YieldExpression").bases("Expression").build("argument","delegate").field("argument",i(e("Expression"),null)).field("delegate",Boolean,n.false),e("GeneratorExpression").bases("Expression").build("body","blocks","filter").field("body",e("Expression")).field("blocks",[e("ComprehensionBlock")]).field("filter",i(e("Expression"),null)),e("ComprehensionExpression").bases("Expression").build("body","blocks","filter").field("body",e("Expression")).field("blocks",[e("ComprehensionBlock")]).field("filter",i(e("Expression"),null)),e("ComprehensionBlock").bases("Node").build("left","right","each").field("left",e("Pattern")).field("right",e("Expression")).field("each",Boolean),e("Property").field("key",i(e("Literal"),e("Identifier"),e("Expression"))).field("value",i(e("Expression"),e("Pattern"))).field("method",Boolean,n.false).field("shorthand",Boolean,n.false).field("computed",Boolean,n.false),e("ObjectProperty").field("shorthand",Boolean,n.false),e("PropertyPattern").bases("Pattern").build("key","pattern").field("key",i(e("Literal"),e("Identifier"),e("Expression"))).field("pattern",e("Pattern")).field("computed",Boolean,n.false),e("ObjectPattern").bases("Pattern").build("properties").field("properties",[i(e("PropertyPattern"),e("Property"))]),e("ArrayPattern").bases("Pattern").build("elements").field("elements",[i(e("Pattern"),null)]),e("SpreadElement").bases("Node").build("argument").field("argument",e("Expression")),e("ArrayExpression").field("elements",[i(e("Expression"),e("SpreadElement"),e("RestElement"),null)]),e("NewExpression").field("arguments",[i(e("Expression"),e("SpreadElement"))]),e("CallExpression").field("arguments",[i(e("Expression"),e("SpreadElement"))]),e("AssignmentPattern").bases("Pattern").build("left","right").field("left",e("Pattern")).field("right",e("Expression")),e("MethodDefinition").bases("Declaration").build("kind","key","value","static").field("kind",i("constructor","method","get","set")).field("key",e("Expression")).field("value",e("Function")).field("computed",Boolean,n.false).field("static",Boolean,n.false);let s=i(e("MethodDefinition"),e("VariableDeclarator"),e("ClassPropertyDefinition"),e("ClassProperty"),e("StaticBlock"));e("ClassProperty").bases("Declaration").build("key").field("key",i(e("Literal"),e("Identifier"),e("Expression"))).field("computed",Boolean,n.false),e("ClassPropertyDefinition").bases("Declaration").build("definition").field("definition",s),e("ClassBody").bases("Declaration").build("body").field("body",[s]),e("ClassDeclaration").bases("Declaration").build("id","body","superClass").field("id",i(e("Identifier"),null)).field("body",e("ClassBody")).field("superClass",i(e("Expression"),null),n.null),e("ClassExpression").bases("Expression").build("id","body","superClass").field("id",i(e("Identifier"),null),n.null).field("body",e("ClassBody")).field("superClass",i(e("Expression"),null),n.null),e("Super").bases("Expression").build(),e("Specifier").bases("Node"),e("ModuleSpecifier").bases("Specifier").field("local",i(e("Identifier"),null),n.null).field("id",i(e("Identifier"),null),n.null).field("name",i(e("Identifier"),null),n.null),e("ImportSpecifier").bases("ModuleSpecifier").build("imported","local").field("imported",e("Identifier")),e("ImportDefaultSpecifier").bases("ModuleSpecifier").build("local"),e("ImportNamespaceSpecifier").bases("ModuleSpecifier").build("local"),e("ImportDeclaration").bases("Declaration").build("specifiers","source","importKind").field("specifiers",[i(e("ImportSpecifier"),e("ImportNamespaceSpecifier"),e("ImportDefaultSpecifier"))],n.emptyArray).field("source",e("Literal")).field("importKind",i("value","type"),function(){return"value"}),e("ExportNamedDeclaration").bases("Declaration").build("declaration","specifiers","source").field("declaration",i(e("Declaration"),null)).field("specifiers",[e("ExportSpecifier")],n.emptyArray).field("source",i(e("Literal"),null),n.null),e("ExportSpecifier").bases("ModuleSpecifier").build("local","exported").field("exported",e("Identifier")),e("ExportDefaultDeclaration").bases("Declaration").build("declaration").field("declaration",i(e("Declaration"),e("Expression"))),e("ExportAllDeclaration").bases("Declaration").build("source").field("source",e("Literal")),e("TaggedTemplateExpression").bases("Expression").build("tag","quasi").field("tag",e("Expression")).field("quasi",e("TemplateLiteral")),e("TemplateLiteral").bases("Expression").build("quasis","expressions").field("quasis",[e("TemplateElement")]).field("expressions",[e("Expression")]),e("TemplateElement").bases("Node").build("value","tail").field("value",{cooked:String,raw:String}).field("tail",Boolean),e("MetaProperty").bases("Expression").build("meta","property").field("meta",e("Identifier")).field("property",e("Identifier"))}Be(()=>module);function qB(t){t.use(hw),t.use(jB)}Be(()=>module);function KB(t){t.use(qB);let e=t.use(it).Type.def,i=t.use(pr).defaults;e("Function").field("async",Boolean,i.false),e("AwaitExpression").bases("Expression").build("argument").field("argument",e("Expression"))}Be(()=>module);function VB(t){t.use(KB);let r=t.use(it),e=r.Type.def,i=r.Type.or,n=t.use(pr).defaults;e("ForOfStatement").field("await",Boolean,n.false),e("SpreadProperty").bases("Node").build("argument").field("argument",e("Expression")),e("ObjectExpression").field("properties",[i(e("Property"),e("SpreadProperty"),e("SpreadElement"))]),e("TemplateElement").field("value",{cooked:i(String,null),raw:String}),e("SpreadPropertyPattern").bases("Pattern").build("argument").field("argument",e("Pattern")),e("ObjectPattern").field("properties",[i(e("PropertyPattern"),e("Property"),e("RestElement"),e("SpreadPropertyPattern"))])}Be(()=>module);function zB(t){t.use(VB);let r=t.use(it),e=r.Type.def,i=r.Type.or,n=t.use(pr).defaults;e("CatchClause").field("param",i(e("Pattern"),null),n.null)}Be(()=>module);function WB(t){t.use(mw),t.use(zB);let r=t.use(it),e=r.Type.def,i=r.Type.or,s=t.use(pr).defaults;e("ImportExpression").bases("Expression").build("source").field("source",e("Expression")),e("ExportAllDeclaration").bases("Declaration").build("source","exported").field("source",e("Literal")).field("exported",i(e("Identifier"),null,void 0),s.null),e("ChainElement").bases("Node").field("optional",Boolean,s.false),e("CallExpression").bases("Expression","ChainElement"),e("MemberExpression").bases("Expression","ChainElement"),e("ChainExpression").bases("Expression").build("expression").field("expression",e("ChainElement")),e("OptionalCallExpression").bases("CallExpression").build("callee","arguments","optional").field("optional",Boolean,s.true),e("OptionalMemberExpression").bases("MemberExpression").build("object","property","computed","optional").field("optional",Boolean,s.true)}Be(()=>module);function GB(t){t.use($B),t.use(WB)}Be(()=>module);function HB(t){t.use(GB);let e=t.use(it).Type.def;e("StaticBlock").bases("Declaration").build("body").field("body",[e("Statement")])}Be(()=>module);function Fa(t){t.use(HB);let r=t.use(it),e=r.Type,i=r.Type.def,n=e.or,o=t.use(pr).defaults;i("AwaitExpression").build("argument","all").field("argument",n(i("Expression"),null)).field("all",Boolean,o.false),i("Decorator").bases("Node").build("expression").field("expression",i("Expression")),i("Property").field("decorators",n([i("Decorator")],null),o.null),i("MethodDefinition").field("decorators",n([i("Decorator")],null),o.null),i("PrivateName").bases("Expression","Pattern").build("id").field("id",i("Identifier")),i("ClassPrivateProperty").bases("ClassProperty").build("key","value").field("key",i("PrivateName")).field("value",n(i("Expression"),null),o.null),i("ImportAttribute").bases("Node").build("key","value").field("key",n(i("Identifier"),i("Literal"))).field("value",i("Expression")),["ImportDeclaration","ExportAllDeclaration","ExportNamedDeclaration"].forEach(a=>{i(a).field("assertions",[i("ImportAttribute")],o.emptyArray)}),i("RecordExpression").bases("Expression").build("properties").field("properties",[n(i("ObjectProperty"),i("ObjectMethod"),i("SpreadElement"))]),i("TupleExpression").bases("Expression").build("elements").field("elements",[n(i("Expression"),i("SpreadElement"),null)]),i("ModuleExpression").bases("Node").build("body").field("body",i("Program"))}Be(()=>module);function JB(t){t.use(Fa);let r=t.use(it),e=r.Type.def,i=r.Type.or,n=t.use(pr).defaults;e("JSXAttribute").bases("Node").build("name","value").field("name",i(e("JSXIdentifier"),e("JSXNamespacedName"))).field("value",i(e("Literal"),e("JSXExpressionContainer"),e("JSXElement"),e("JSXFragment"),null),n.null),e("JSXIdentifier").bases("Identifier").build("name").field("name",String),e("JSXNamespacedName").bases("Node").build("namespace","name").field("namespace",e("JSXIdentifier")).field("name",e("JSXIdentifier")),e("JSXMemberExpression").bases("MemberExpression").build("object","property").field("object",i(e("JSXIdentifier"),e("JSXMemberExpression"))).field("property",e("JSXIdentifier")).field("computed",Boolean,n.false);let s=i(e("JSXIdentifier"),e("JSXNamespacedName"),e("JSXMemberExpression"));e("JSXSpreadAttribute").bases("Node").build("argument").field("argument",e("Expression"));let o=[i(e("JSXAttribute"),e("JSXSpreadAttribute"))];e("JSXExpressionContainer").bases("Expression").build("expression").field("expression",i(e("Expression"),e("JSXEmptyExpression")));let a=[i(e("JSXText"),e("JSXExpressionContainer"),e("JSXSpreadChild"),e("JSXElement"),e("JSXFragment"),e("Literal"))];e("JSXElement").bases("Expression").build("openingElement","closingElement","children").field("openingElement",e("JSXOpeningElement")).field("closingElement",i(e("JSXClosingElement"),null),n.null).field("children",a,n.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),e("JSXOpeningElement").bases("Node").build("name","attributes","selfClosing").field("name",s).field("attributes",o,n.emptyArray).field("selfClosing",Boolean,n.false),e("JSXClosingElement").bases("Node").build("name").field("name",s),e("JSXFragment").bases("Expression").build("openingFragment","closingFragment","children").field("openingFragment",e("JSXOpeningFragment")).field("closingFragment",e("JSXClosingFragment")).field("children",a,n.emptyArray),e("JSXOpeningFragment").bases("Node").build(),e("JSXClosingFragment").bases("Node").build(),e("JSXText").bases("Literal").build("value","raw").field("value",String).field("raw",String,function(){return this.value}),e("JSXEmptyExpression").bases("Node").build(),e("JSXSpreadChild").bases("Node").build("expression").field("expression",e("Expression"))}Be(()=>module);function gw(t){var r=t.use(it),e=r.Type.def,i=r.Type.or,n=t.use(pr).defaults,s=i(e("TypeAnnotation"),e("TSTypeAnnotation"),null),o=i(e("TypeParameterDeclaration"),e("TSTypeParameterDeclaration"),null);e("Identifier").field("typeAnnotation",s,n.null),e("ObjectPattern").field("typeAnnotation",s,n.null),e("Function").field("returnType",s,n.null).field("typeParameters",o,n.null),e("ClassProperty").build("key","value","typeAnnotation","static").field("value",i(e("Expression"),null)).field("static",Boolean,n.false).field("typeAnnotation",s,n.null),["ClassDeclaration","ClassExpression"].forEach(a=>{e(a).field("typeParameters",o,n.null).field("superTypeParameters",i(e("TypeParameterInstantiation"),e("TSTypeParameterInstantiation"),null),n.null).field("implements",i([e("ClassImplements")],[e("TSExpressionWithTypeArguments")]),n.emptyArray)})}Be(()=>module);function yw(t){t.use(Fa),t.use(gw);let r=t.use(it),e=r.Type.def,i=r.Type.or,n=t.use(pr).defaults;e("Flow").bases("Node"),e("FlowType").bases("Flow"),e("AnyTypeAnnotation").bases("FlowType").build(),e("EmptyTypeAnnotation").bases("FlowType").build(),e("MixedTypeAnnotation").bases("FlowType").build(),e("VoidTypeAnnotation").bases("FlowType").build(),e("SymbolTypeAnnotation").bases("FlowType").build(),e("NumberTypeAnnotation").bases("FlowType").build(),e("BigIntTypeAnnotation").bases("FlowType").build(),e("NumberLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",Number).field("raw",String),e("NumericLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",Number).field("raw",String),e("BigIntLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",null).field("raw",String),e("StringTypeAnnotation").bases("FlowType").build(),e("StringLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",String).field("raw",String),e("BooleanTypeAnnotation").bases("FlowType").build(),e("BooleanLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",Boolean).field("raw",String),e("TypeAnnotation").bases("Node").build("typeAnnotation").field("typeAnnotation",e("FlowType")),e("NullableTypeAnnotation").bases("FlowType").build("typeAnnotation").field("typeAnnotation",e("FlowType")),e("NullLiteralTypeAnnotation").bases("FlowType").build(),e("NullTypeAnnotation").bases("FlowType").build(),e("ThisTypeAnnotation").bases("FlowType").build(),e("ExistsTypeAnnotation").bases("FlowType").build(),e("ExistentialTypeParam").bases("FlowType").build(),e("FunctionTypeAnnotation").bases("FlowType").build("params","returnType","rest","typeParameters").field("params",[e("FunctionTypeParam")]).field("returnType",e("FlowType")).field("rest",i(e("FunctionTypeParam"),null)).field("typeParameters",i(e("TypeParameterDeclaration"),null)),e("FunctionTypeParam").bases("Node").build("name","typeAnnotation","optional").field("name",i(e("Identifier"),null)).field("typeAnnotation",e("FlowType")).field("optional",Boolean),e("ArrayTypeAnnotation").bases("FlowType").build("elementType").field("elementType",e("FlowType")),e("ObjectTypeAnnotation").bases("FlowType").build("properties","indexers","callProperties").field("properties",[i(e("ObjectTypeProperty"),e("ObjectTypeSpreadProperty"))]).field("indexers",[e("ObjectTypeIndexer")],n.emptyArray).field("callProperties",[e("ObjectTypeCallProperty")],n.emptyArray).field("inexact",i(Boolean,void 0),n.undefined).field("exact",Boolean,n.false).field("internalSlots",[e("ObjectTypeInternalSlot")],n.emptyArray),e("Variance").bases("Node").build("kind").field("kind",i("plus","minus"));let s=i(e("Variance"),"plus","minus",null);e("ObjectTypeProperty").bases("Node").build("key","value","optional").field("key",i(e("Literal"),e("Identifier"))).field("value",e("FlowType")).field("optional",Boolean).field("variance",s,n.null),e("ObjectTypeIndexer").bases("Node").build("id","key","value").field("id",e("Identifier")).field("key",e("FlowType")).field("value",e("FlowType")).field("variance",s,n.null).field("static",Boolean,n.false),e("ObjectTypeCallProperty").bases("Node").build("value").field("value",e("FunctionTypeAnnotation")).field("static",Boolean,n.false),e("QualifiedTypeIdentifier").bases("Node").build("qualification","id").field("qualification",i(e("Identifier"),e("QualifiedTypeIdentifier"))).field("id",e("Identifier")),e("GenericTypeAnnotation").bases("FlowType").build("id","typeParameters").field("id",i(e("Identifier"),e("QualifiedTypeIdentifier"))).field("typeParameters",i(e("TypeParameterInstantiation"),null)),e("MemberTypeAnnotation").bases("FlowType").build("object","property").field("object",e("Identifier")).field("property",i(e("MemberTypeAnnotation"),e("GenericTypeAnnotation"))),e("IndexedAccessType").bases("FlowType").build("objectType","indexType").field("objectType",e("FlowType")).field("indexType",e("FlowType")),e("OptionalIndexedAccessType").bases("FlowType").build("objectType","indexType","optional").field("objectType",e("FlowType")).field("indexType",e("FlowType")).field("optional",Boolean),e("UnionTypeAnnotation").bases("FlowType").build("types").field("types",[e("FlowType")]),e("IntersectionTypeAnnotation").bases("FlowType").build("types").field("types",[e("FlowType")]),e("TypeofTypeAnnotation").bases("FlowType").build("argument").field("argument",e("FlowType")),e("ObjectTypeSpreadProperty").bases("Node").build("argument").field("argument",e("FlowType")),e("ObjectTypeInternalSlot").bases("Node").build("id","value","optional","static","method").field("id",e("Identifier")).field("value",e("FlowType")).field("optional",Boolean).field("static",Boolean).field("method",Boolean),e("TypeParameterDeclaration").bases("Node").build("params").field("params",[e("TypeParameter")]),e("TypeParameterInstantiation").bases("Node").build("params").field("params",[e("FlowType")]),e("TypeParameter").bases("FlowType").build("name","variance","bound","default").field("name",String).field("variance",s,n.null).field("bound",i(e("TypeAnnotation"),null),n.null).field("default",i(e("FlowType"),null),n.null),e("ClassProperty").field("variance",s,n.null),e("ClassImplements").bases("Node").build("id").field("id",e("Identifier")).field("superClass",i(e("Expression"),null),n.null).field("typeParameters",i(e("TypeParameterInstantiation"),null),n.null),e("InterfaceTypeAnnotation").bases("FlowType").build("body","extends").field("body",e("ObjectTypeAnnotation")).field("extends",i([e("InterfaceExtends")],null),n.null),e("InterfaceDeclaration").bases("Declaration").build("id","body","extends").field("id",e("Identifier")).field("typeParameters",i(e("TypeParameterDeclaration"),null),n.null).field("body",e("ObjectTypeAnnotation")).field("extends",[e("InterfaceExtends")]),e("DeclareInterface").bases("InterfaceDeclaration").build("id","body","extends"),e("InterfaceExtends").bases("Node").build("id").field("id",e("Identifier")).field("typeParameters",i(e("TypeParameterInstantiation"),null),n.null),e("TypeAlias").bases("Declaration").build("id","typeParameters","right").field("id",e("Identifier")).field("typeParameters",i(e("TypeParameterDeclaration"),null)).field("right",e("FlowType")),e("DeclareTypeAlias").bases("TypeAlias").build("id","typeParameters","right"),e("OpaqueType").bases("Declaration").build("id","typeParameters","impltype","supertype").field("id",e("Identifier")).field("typeParameters",i(e("TypeParameterDeclaration"),null)).field("impltype",e("FlowType")).field("supertype",i(e("FlowType"),null)),e("DeclareOpaqueType").bases("OpaqueType").build("id","typeParameters","supertype").field("impltype",i(e("FlowType"),null)),e("TypeCastExpression").bases("Expression").build("expression","typeAnnotation").field("expression",e("Expression")).field("typeAnnotation",e("TypeAnnotation")),e("TupleTypeAnnotation").bases("FlowType").build("types").field("types",[e("FlowType")]),e("DeclareVariable").bases("Statement").build("id").field("id",e("Identifier")),e("DeclareFunction").bases("Statement").build("id").field("id",e("Identifier")).field("predicate",i(e("FlowPredicate"),null),n.null),e("DeclareClass").bases("InterfaceDeclaration").build("id"),e("DeclareModule").bases("Statement").build("id","body").field("id",i(e("Identifier"),e("Literal"))).field("body",e("BlockStatement")),e("DeclareModuleExports").bases("Statement").build("typeAnnotation").field("typeAnnotation",e("TypeAnnotation")),e("DeclareExportDeclaration").bases("Declaration").build("default","declaration","specifiers","source").field("default",Boolean).field("declaration",i(e("DeclareVariable"),e("DeclareFunction"),e("DeclareClass"),e("FlowType"),e("TypeAlias"),e("DeclareOpaqueType"),e("InterfaceDeclaration"),null)).field("specifiers",[i(e("ExportSpecifier"),e("ExportBatchSpecifier"))],n.emptyArray).field("source",i(e("Literal"),null),n.null),e("DeclareExportAllDeclaration").bases("Declaration").build("source").field("source",i(e("Literal"),null),n.null),e("ImportDeclaration").field("importKind",i("value","type","typeof"),()=>"value"),e("FlowPredicate").bases("Flow"),e("InferredPredicate").bases("FlowPredicate").build(),e("DeclaredPredicate").bases("FlowPredicate").build("value").field("value",e("Expression")),e("Function").field("predicate",i(e("FlowPredicate"),null),n.null),e("CallExpression").field("typeArguments",i(null,e("TypeParameterInstantiation")),n.null),e("NewExpression").field("typeArguments",i(null,e("TypeParameterInstantiation")),n.null),e("EnumDeclaration").bases("Declaration").build("id","body").field("id",e("Identifier")).field("body",i(e("EnumBooleanBody"),e("EnumNumberBody"),e("EnumStringBody"),e("EnumSymbolBody"))),e("EnumBooleanBody").build("members","explicitType").field("members",[e("EnumBooleanMember")]).field("explicitType",Boolean),e("EnumNumberBody").build("members","explicitType").field("members",[e("EnumNumberMember")]).field("explicitType",Boolean),e("EnumStringBody").build("members","explicitType").field("members",i([e("EnumStringMember")],[e("EnumDefaultedMember")])).field("explicitType",Boolean),e("EnumSymbolBody").build("members").field("members",[e("EnumDefaultedMember")]),e("EnumBooleanMember").build("id","init").field("id",e("Identifier")).field("init",i(e("Literal"),Boolean)),e("EnumNumberMember").build("id","init").field("id",e("Identifier")).field("init",e("Literal")),e("EnumStringMember").build("id","init").field("id",e("Identifier")).field("init",e("Literal")),e("EnumDefaultedMember").build("id").field("id",e("Identifier"))}Be(()=>module);function YB(t){t.use(Fa);var r=t.use(it),e=t.use(pr).defaults,i=r.Type.def,n=r.Type.or;i("VariableDeclaration").field("declarations",[n(i("VariableDeclarator"),i("Identifier"))]),i("Property").field("value",n(i("Expression"),i("Pattern"))),i("ArrayPattern").field("elements",[n(i("Pattern"),i("SpreadElement"),null)]),i("ObjectPattern").field("properties",[n(i("Property"),i("PropertyPattern"),i("SpreadPropertyPattern"),i("SpreadProperty"))]),i("ExportSpecifier").bases("ModuleSpecifier").build("id","name"),i("ExportBatchSpecifier").bases("Specifier").build(),i("ExportDeclaration").bases("Declaration").build("default","declaration","specifiers","source").field("default",Boolean).field("declaration",n(i("Declaration"),i("Expression"),null)).field("specifiers",[n(i("ExportSpecifier"),i("ExportBatchSpecifier"))],e.emptyArray).field("source",n(i("Literal"),null),e.null),i("Block").bases("Comment").build("value","leading","trailing"),i("Line").bases("Comment").build("value","leading","trailing")}Be(()=>module);function bw(t){t.use(Fa);let r=t.use(it),e=t.use(pr).defaults,i=r.Type.def,n=r.Type.or,{undefined:s}=r.builtInTypes;i("Noop").bases("Statement").build(),i("DoExpression").bases("Expression").build("body").field("body",[i("Statement")]),i("BindExpression").bases("Expression").build("object","callee").field("object",n(i("Expression"),null)).field("callee",i("Expression")),i("ParenthesizedExpression").bases("Expression").build("expression").field("expression",i("Expression")),i("ExportNamespaceSpecifier").bases("Specifier").build("exported").field("exported",i("Identifier")),i("ExportDefaultSpecifier").bases("Specifier").build("exported").field("exported",i("Identifier")),i("CommentBlock").bases("Comment").build("value","leading","trailing"),i("CommentLine").bases("Comment").build("value","leading","trailing"),i("Directive").bases("Node").build("value").field("value",i("DirectiveLiteral")),i("DirectiveLiteral").bases("Node","Expression").build("value").field("value",String,e["use strict"]),i("InterpreterDirective").bases("Node").build("value").field("value",String),i("BlockStatement").bases("Statement").build("body").field("body",[i("Statement")]).field("directives",[i("Directive")],e.emptyArray),i("Program").bases("Node").build("body").field("body",[i("Statement")]).field("directives",[i("Directive")],e.emptyArray).field("interpreter",n(i("InterpreterDirective"),null),e.null);function o(c=String,p){return["extra",{rawValue:c,raw:String},function(){let h=r.getFieldValue(this,"value");return{rawValue:h,raw:p?p(h):String(h)}}]}i("StringLiteral").bases("Literal").build("value").field("value",String).field(...o(String,c=>JSON.stringify(c))),i("NumericLiteral").bases("Literal").build("value").field("value",Number).field("raw",n(String,null),e.null).field(...o(Number)),i("BigIntLiteral").bases("Literal").build("value").field("value",n(String,Number)).field(...o(String,c=>c+"n")),i("DecimalLiteral").bases("Literal").build("value").field("value",String).field(...o(String,c=>c+"m")),i("NullLiteral").bases("Literal").build().field("value",null,e.null),i("BooleanLiteral").bases("Literal").build("value").field("value",Boolean),i("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(n(RegExp,s),c=>`/${c.pattern}/${c.flags||""}`)).field("regex",{pattern:String,flags:String},function(){return{pattern:this.pattern,flags:this.flags}});var a=n(i("Property"),i("ObjectMethod"),i("ObjectProperty"),i("SpreadProperty"),i("SpreadElement"));i("ObjectExpression").bases("Expression").build("properties").field("properties",[a]),i("ObjectMethod").bases("Node","Function").build("kind","key","params","body","computed").field("kind",n("method","get","set")).field("key",n(i("Literal"),i("Identifier"),i("Expression"))).field("params",[i("Pattern")]).field("body",i("BlockStatement")).field("computed",Boolean,e.false).field("generator",Boolean,e.false).field("async",Boolean,e.false).field("accessibility",n(i("Literal"),null),e.null).field("decorators",n([i("Decorator")],null),e.null),i("ObjectProperty").bases("Node").build("key","value").field("key",n(i("Literal"),i("Identifier"),i("Expression"))).field("value",n(i("Expression"),i("Pattern"))).field("accessibility",n(i("Literal"),null),e.null).field("computed",Boolean,e.false);var l=n(i("MethodDefinition"),i("VariableDeclarator"),i("ClassPropertyDefinition"),i("ClassProperty"),i("ClassPrivateProperty"),i("ClassMethod"),i("ClassPrivateMethod"),i("ClassAccessorProperty"),i("StaticBlock"));i("ClassBody").bases("Declaration").build("body").field("body",[l]),i("ClassMethod").bases("Declaration","Function").build("kind","key","params","body","computed","static").field("key",n(i("Literal"),i("Identifier"),i("Expression"))),i("ClassPrivateMethod").bases("Declaration","Function").build("key","params","body","kind","computed","static").field("key",i("PrivateName")),i("ClassAccessorProperty").bases("Declaration").build("key","value","decorators","computed","static").field("key",n(i("Literal"),i("Identifier"),i("PrivateName"),i("Expression"))).field("value",n(i("Expression"),null),e.null),["ClassMethod","ClassPrivateMethod"].forEach(c=>{i(c).field("kind",n("get","set","method","constructor"),()=>"method").field("body",i("BlockStatement")).field("access",n("public","private","protected",null),e.null)}),["ClassMethod","ClassPrivateMethod","ClassAccessorProperty"].forEach(c=>{i(c).field("computed",Boolean,e.false).field("static",Boolean,e.false).field("abstract",Boolean,e.false).field("accessibility",n("public","private","protected",null),e.null).field("decorators",n([i("Decorator")],null),e.null).field("definite",Boolean,e.false).field("optional",Boolean,e.false).field("override",Boolean,e.false).field("readonly",Boolean,e.false)});var u=n(i("Property"),i("PropertyPattern"),i("SpreadPropertyPattern"),i("SpreadProperty"),i("ObjectProperty"),i("RestProperty"),i("RestElement"));i("ObjectPattern").bases("Pattern").build("properties").field("properties",[u]).field("decorators",n([i("Decorator")],null),e.null),i("SpreadProperty").bases("Node").build("argument").field("argument",i("Expression")),i("RestProperty").bases("Node").build("argument").field("argument",i("Expression")),i("ForAwaitStatement").bases("Statement").build("left","right","body").field("left",n(i("VariableDeclaration"),i("Expression"))).field("right",i("Expression")).field("body",i("Statement")),i("Import").bases("Expression").build()}Be(()=>module);function XB(t){let e=t.use(it).Type.def;t.use(bw),t.use(yw),e("V8IntrinsicIdentifier").bases("Expression").build("name").field("name",String),e("TopicReference").bases("Expression").build()}Be(()=>module);function QB(t){t.use(bw),t.use(gw);var r=t.use(it),e=r.namedTypes,i=r.Type.def,n=r.Type.or,s=t.use(pr).defaults,o=r.Type.from(function(c,p){return!!(e.StringLiteral&&e.StringLiteral.check(c,p)||e.Literal&&e.Literal.check(c,p)&&typeof c.value=="string")},"StringLiteral");i("TSType").bases("Node");var a=n(i("Identifier"),i("TSQualifiedName"));i("TSTypeReference").bases("TSType","TSHasOptionalTypeParameterInstantiation").build("typeName","typeParameters").field("typeName",a),i("TSHasOptionalTypeParameterInstantiation").field("typeParameters",n(i("TSTypeParameterInstantiation"),null),s.null),i("TSHasOptionalTypeParameters").field("typeParameters",n(i("TSTypeParameterDeclaration"),null,void 0),s.null),i("TSHasOptionalTypeAnnotation").field("typeAnnotation",n(i("TSTypeAnnotation"),null),s.null),i("TSQualifiedName").bases("Node").build("left","right").field("left",a).field("right",a),i("TSAsExpression").bases("Expression","Pattern").build("expression","typeAnnotation").field("expression",i("Expression")).field("typeAnnotation",i("TSType")).field("extra",n({parenthesized:Boolean},null),s.null),i("TSTypeCastExpression").bases("Expression").build("expression","typeAnnotation").field("expression",i("Expression")).field("typeAnnotation",i("TSType")),i("TSSatisfiesExpression").bases("Expression","Pattern").build("expression","typeAnnotation").field("expression",i("Expression")).field("typeAnnotation",i("TSType")),i("TSNonNullExpression").bases("Expression","Pattern").build("expression").field("expression",i("Expression")),["TSAnyKeyword","TSBigIntKeyword","TSBooleanKeyword","TSNeverKeyword","TSNullKeyword","TSNumberKeyword","TSObjectKeyword","TSStringKeyword","TSSymbolKeyword","TSUndefinedKeyword","TSUnknownKeyword","TSVoidKeyword","TSIntrinsicKeyword","TSThisType"].forEach(c=>{i(c).bases("TSType").build()}),i("TSArrayType").bases("TSType").build("elementType").field("elementType",i("TSType")),i("TSLiteralType").bases("TSType").build("literal").field("literal",n(i("NumericLiteral"),i("StringLiteral"),i("BooleanLiteral"),i("TemplateLiteral"),i("UnaryExpression"),i("BigIntLiteral"))),i("TemplateLiteral").field("expressions",n([i("Expression")],[i("TSType")])),["TSUnionType","TSIntersectionType"].forEach(c=>{i(c).bases("TSType").build("types").field("types",[i("TSType")])}),i("TSConditionalType").bases("TSType").build("checkType","extendsType","trueType","falseType").field("checkType",i("TSType")).field("extendsType",i("TSType")).field("trueType",i("TSType")).field("falseType",i("TSType")),i("TSInferType").bases("TSType").build("typeParameter").field("typeParameter",i("TSTypeParameter")),i("TSParenthesizedType").bases("TSType").build("typeAnnotation").field("typeAnnotation",i("TSType"));var l=[n(i("Identifier"),i("RestElement"),i("ArrayPattern"),i("ObjectPattern"))];["TSFunctionType","TSConstructorType"].forEach(c=>{i(c).bases("TSType","TSHasOptionalTypeParameters","TSHasOptionalTypeAnnotation").build("parameters").field("parameters",l)}),i("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",n(i("Identifier"),null),s.null).field("params",[i("Pattern")]).field("returnType",n(i("TSTypeAnnotation"),i("Noop"),null),s.null),i("TSDeclareMethod").bases("Declaration","TSHasOptionalTypeParameters").build("key","params","returnType").field("async",Boolean,s.false).field("generator",Boolean,s.false).field("params",[i("Pattern")]).field("abstract",Boolean,s.false).field("accessibility",n("public","private","protected",void 0),s.undefined).field("static",Boolean,s.false).field("computed",Boolean,s.false).field("optional",Boolean,s.false).field("key",n(i("Identifier"),i("StringLiteral"),i("NumericLiteral"),i("Expression"))).field("kind",n("get","set","method","constructor"),function(){return"method"}).field("access",n("public","private","protected",void 0),s.undefined).field("decorators",n([i("Decorator")],null),s.null).field("returnType",n(i("TSTypeAnnotation"),i("Noop"),null),s.null),i("TSMappedType").bases("TSType").build("typeParameter","typeAnnotation").field("readonly",n(Boolean,"+","-"),s.false).field("typeParameter",i("TSTypeParameter")).field("optional",n(Boolean,"+","-"),s.false).field("typeAnnotation",n(i("TSType"),null),s.null),i("TSTupleType").bases("TSType").build("elementTypes").field("elementTypes",[n(i("TSType"),i("TSNamedTupleMember"))]),i("TSNamedTupleMember").bases("TSType").build("label","elementType","optional").field("label",i("Identifier")).field("optional",Boolean,s.false).field("elementType",i("TSType")),i("TSRestType").bases("TSType").build("typeAnnotation").field("typeAnnotation",i("TSType")),i("TSOptionalType").bases("TSType").build("typeAnnotation").field("typeAnnotation",i("TSType")),i("TSIndexedAccessType").bases("TSType").build("objectType","indexType").field("objectType",i("TSType")).field("indexType",i("TSType")),i("TSTypeOperator").bases("TSType").build("operator").field("operator",String).field("typeAnnotation",i("TSType")),i("TSTypeAnnotation").bases("Node").build("typeAnnotation").field("typeAnnotation",n(i("TSType"),i("TSTypeAnnotation"))),i("TSIndexSignature").bases("Declaration","TSHasOptionalTypeAnnotation").build("parameters","typeAnnotation").field("parameters",[i("Identifier")]).field("readonly",Boolean,s.false),i("TSPropertySignature").bases("Declaration","TSHasOptionalTypeAnnotation").build("key","typeAnnotation","optional").field("key",i("Expression")).field("computed",Boolean,s.false).field("readonly",Boolean,s.false).field("optional",Boolean,s.false).field("initializer",n(i("Expression"),null),s.null),i("TSMethodSignature").bases("Declaration","TSHasOptionalTypeParameters","TSHasOptionalTypeAnnotation").build("key","parameters","typeAnnotation").field("key",i("Expression")).field("computed",Boolean,s.false).field("optional",Boolean,s.false).field("parameters",l),i("TSTypePredicate").bases("TSTypeAnnotation","TSType").build("parameterName","typeAnnotation","asserts").field("parameterName",n(i("Identifier"),i("TSThisType"))).field("typeAnnotation",n(i("TSTypeAnnotation"),null),s.null).field("asserts",Boolean,s.false),["TSCallSignatureDeclaration","TSConstructSignatureDeclaration"].forEach(c=>{i(c).bases("Declaration","TSHasOptionalTypeParameters","TSHasOptionalTypeAnnotation").build("parameters","typeAnnotation").field("parameters",l)}),i("TSEnumMember").bases("Node").build("id","initializer").field("id",n(i("Identifier"),o)).field("initializer",n(i("Expression"),null),s.null),i("TSTypeQuery").bases("TSType").build("exprName").field("exprName",n(a,i("TSImportType")));var u=n(i("TSCallSignatureDeclaration"),i("TSConstructSignatureDeclaration"),i("TSIndexSignature"),i("TSMethodSignature"),i("TSPropertySignature"));i("TSTypeLiteral").bases("TSType").build("members").field("members",[u]),i("TSTypeParameter").bases("Identifier").build("name","constraint","default").field("name",n(i("Identifier"),String)).field("constraint",n(i("TSType"),void 0),s.undefined).field("default",n(i("TSType"),void 0),s.undefined),i("TSTypeAssertion").bases("Expression","Pattern").build("typeAnnotation","expression").field("typeAnnotation",i("TSType")).field("expression",i("Expression")).field("extra",n({parenthesized:Boolean},null),s.null),i("TSTypeParameterDeclaration").bases("Declaration").build("params").field("params",[i("TSTypeParameter")]),i("TSInstantiationExpression").bases("Expression","TSHasOptionalTypeParameterInstantiation").build("expression","typeParameters").field("expression",i("Expression")),i("TSTypeParameterInstantiation").bases("Node").build("params").field("params",[i("TSType")]),i("TSEnumDeclaration").bases("Declaration").build("id","members").field("id",i("Identifier")).field("const",Boolean,s.false).field("declare",Boolean,s.false).field("members",[i("TSEnumMember")]).field("initializer",n(i("Expression"),null),s.null),i("TSTypeAliasDeclaration").bases("Declaration","TSHasOptionalTypeParameters").build("id","typeAnnotation").field("id",i("Identifier")).field("declare",Boolean,s.false).field("typeAnnotation",i("TSType")),i("TSModuleBlock").bases("Node").build("body").field("body",[i("Statement")]),i("TSModuleDeclaration").bases("Declaration").build("id","body").field("id",n(o,a)).field("declare",Boolean,s.false).field("global",Boolean,s.false).field("body",n(i("TSModuleBlock"),i("TSModuleDeclaration"),null),s.null),i("TSImportType").bases("TSType","TSHasOptionalTypeParameterInstantiation").build("argument","qualifier","typeParameters").field("argument",o).field("qualifier",n(a,void 0),s.undefined),i("TSImportEqualsDeclaration").bases("Declaration").build("id","moduleReference").field("id",i("Identifier")).field("isExport",Boolean,s.false).field("moduleReference",n(a,i("TSExternalModuleReference"))),i("TSExternalModuleReference").bases("Declaration").build("expression").field("expression",o),i("TSExportAssignment").bases("Statement").build("expression").field("expression",i("Expression")),i("TSNamespaceExportDeclaration").bases("Declaration").build("id").field("id",i("Identifier")),i("TSInterfaceBody").bases("Node").build("body").field("body",[u]),i("TSExpressionWithTypeArguments").bases("TSType","TSHasOptionalTypeParameterInstantiation").build("expression","typeParameters").field("expression",a),i("TSInterfaceDeclaration").bases("Declaration","TSHasOptionalTypeParameters").build("id","body").field("id",a).field("declare",Boolean,s.false).field("extends",n([i("TSExpressionWithTypeArguments")],null),s.null).field("body",i("TSInterfaceBody")),i("TSParameterProperty").bases("Pattern").build("parameter").field("accessibility",n("public","private","protected",void 0),s.undefined).field("readonly",Boolean,s.false).field("parameter",n(i("Identifier"),i("AssignmentPattern"))),i("ClassProperty").field("access",n("public","private","protected",void 0),s.undefined),i("ClassAccessorProperty").bases("Declaration","TSHasOptionalTypeAnnotation"),i("ClassBody").field("body",[n(i("MethodDefinition"),i("VariableDeclarator"),i("ClassPropertyDefinition"),i("ClassProperty"),i("ClassPrivateProperty"),i("ClassAccessorProperty"),i("ClassMethod"),i("ClassPrivateMethod"),i("StaticBlock"),i("TSDeclareMethod"),u)])}Be(()=>module);var Ur;Ur||(Ur={});var{astNodesAreEquivalent:wW,builders:Js,builtInTypes:jr,defineMethod:TW,eachField:AW,finalize:PW,getBuilderName:IW,getFieldNames:ZB,getFieldValue:Gi,getSupertypeNames:_W,namedTypes:e3,NodePath:t3,Path:NW,PathVisitor:FW,someField:r3,Type:kW,use:OW,visit:RW}=MB([Fa,JB,yw,YB,XB,QB]);Object.assign(Ur,e3);var $u=Ur,Jv=ec.default.SourceMapConsumer,i3=ec.default.SourceMapGenerator,Dw=Object.prototype.hasOwnProperty;function n3(){return`
|
|
1088
|
+
`);return s!==-1&&(r=vC(r,n,i,s)),i+r+n};Object.defineProperties(zo.prototype,vs);var bz=zo(),Dz=zo({level:TC?TC.level:0});var be=new Xl({level:2}),IC={comment:be.gray,quote:be.gray,keyword:be.green,"selector-tag":be.green,addition:be.green,number:be.cyan,string:be.cyan,"meta meta-string":be.cyan,literal:be.cyan,doctag:be.cyan,regexp:be.cyan,title:be.blue,section:be.blue,name:be.blue,"selector-id":be.blue,"selector-class":be.blue,attribute:be.yellow,attr:be.yellow,variable:be.yellow,"template-variable":be.yellow,"class title":be.yellow,type:be.yellow,symbol:be.magenta,bullet:be.magenta,subst:be.magenta,meta:be.magenta,"meta keyword":be.magenta,"selector-attr":be.magenta,"selector-pseudo":be.magenta,link:be.magenta,built_in:be.red,deletion:be.red,emphasis:be.italic,strong:be.bold,formula:be.inverse};function Kn(t){let r=Zd(t);return{highlight:e,highlightAuto:i,listLanguages:r.listLanguages,register:r.register,registerAlias:r.registerAlias,registered:r.registered};function e(n,s,o){let a=r.highlight(n,s),l=a.data;return{language:l.language,relevance:l.relevance,value:sf(o||IC,a)}}function i(n,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(n,a),u=l.data;return{language:u.language,relevance:u.relevance,value:sf(o||IC,l)}}}function sf(t,r){let e=new Set(r.type==="element"&&Array.isArray(r.properties.className)?r.properties.className.map(function(a){return String(a).replace(/^hljs-/,"")}):[]),i={},n,s="",o;for(o in t)if(Object.hasOwn(t,o)){let a=o.split(" "),l=t[o];e.has(a[0])?a.length===1?n=l:i[a.slice(1).join(" ")]=l:i[o]=l}return"value"in r?s=r.value:"children"in r&&(s=YO(i,r.children)),n&&(s=n(s)),s}function YO(t,r){let e=[],i=-1;for(;++i<r.length;)e.push(sf(t,r[i]));return e.join("")}var Hh=K(require("readline"),1);var H=K(Gt(),1),fT=require("path");var $=K(Gt(),1);var mi=K(Cu(),1),En=K(require("@sentry/node"),1);var zS="1.3.7";var Ct=require("node:fs/promises"),Ww=require("node:crypto"),rt=require("node:fs"),ka=require("node:os"),Ae=K(require("node:path"),1),Bh=K(require("prettier"),1),Gw=K(require("typescript"),1),Hw=K(require("launch-editor"),1);var Ys=require("node:child_process");var Mh={};Sc(Mh,{MagicastError:()=>kt,builders:()=>o8,detectCodeFormat:()=>Kw,generateCode:()=>Lh,loadFile:()=>n8,parseExpression:()=>zw,parseModule:()=>Vw,writeFile:()=>s8});var Wu=require("node:fs");var ec=K(yv(),1),uw=K(Hv(),1);function pr(t){var r=t.use(it),e=r.Type,i=r.builtInTypes,n=i.number;function s(u){return e.from(c=>n.check(c)&&c>=u,n+" >= "+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=e.or(i.string,i.number,i.boolean,i.null,i.undefined);let l=e.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 Be(t){try{var r=t(),e=r.exports,i=e.default}catch{return}i&&i!==e&&typeof e=="object"&&(Object.assign(i,e,{default:i}),e.__esModule&&Object.defineProperty(i,"__esModule",{value:!0}),r.exports=i)}var NB=Object.defineProperty,FB=(t,r,e)=>r in t?NB(t,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[r]=e,qt=(t,r,e)=>(FB(t,typeof r!="symbol"?r+"":r,e),e),cw=Object.prototype,Gu=cw.toString,Sr=cw.hasOwnProperty,Qn=class{assert(r,e){if(!this.check(r,e)){var i=Nh(r);throw new Error(i+" does not match type "+this)}return!0}arrayOf(){let r=this;return new Pa(r)}},Pa=class extends Qn{constructor(r){super(),this.elemType=r,qt(this,"kind","ArrayType")}toString(){return"["+this.elemType+"]"}check(r,e){return Array.isArray(r)&&r.every(i=>this.elemType.check(i,e))}},Hu=class extends Qn{constructor(r){super(),this.value=r,qt(this,"kind","IdentityType")}toString(){return String(this.value)}check(r,e){let i=r===this.value;return!i&&typeof e=="function"&&e(this,r),i}},Ju=class extends Qn{constructor(r){super(),this.fields=r,qt(this,"kind","ObjectType")}toString(){return"{ "+this.fields.join(", ")+" }"}check(r,e){return Gu.call(r)===Gu.call({})&&this.fields.every(i=>i.type.check(r[i.name],e))}},Yu=class extends Qn{constructor(r){super(),this.types=r,qt(this,"kind","OrType")}toString(){return this.types.join(" | ")}check(r,e){return this.types.some(i=>i.check(r,!!e))?!0:(typeof e=="function"&&e(this,r),!1)}},Xn=class extends Qn{constructor(r,e){super(),this.name=r,this.predicate=e,qt(this,"kind","PredicateType")}toString(){return this.name}check(r,e){let i=this.predicate(r,e);return!i&&typeof e=="function"&&e(this,r),i}},Ta=class t{constructor(r,e){this.type=r,this.typeName=e,qt(this,"baseNames",[]),qt(this,"ownFields",Object.create(null)),qt(this,"allSupertypes",Object.create(null)),qt(this,"supertypeList",[]),qt(this,"allFields",Object.create(null)),qt(this,"fieldNames",[]),qt(this,"finalized",!1),qt(this,"buildable",!1),qt(this,"buildParams",[])}isSupertypeOf(r){if(r instanceof t){if(this.finalized!==!0||r.finalized!==!0)throw new Error("");return Sr.call(r.allSupertypes,this.typeName)}else throw new Error(r+" is not a Def")}checkAllFields(r,e){var i=this.allFields;if(this.finalized!==!0)throw new Error(""+this.typeName);function n(s){var o=i[s],a=o.type,l=o.getValue(r);return a.check(l,e)}return r!==null&&typeof r=="object"&&Object.keys(i).every(n)}bases(...r){var e=this.baseNames;if(this.finalized){if(r.length!==e.length)throw new Error("");for(var i=0;i<r.length;i++)if(r[i]!==e[i])throw new Error("");return this}return r.forEach(n=>{e.indexOf(n)<0&&e.push(n)}),this}},Xu=class{constructor(r,e,i,n){this.name=r,this.type=e,this.defaultFn=i,qt(this,"hidden"),this.hidden=!!n}toString(){return JSON.stringify(this.name)+": "+this.type}getValue(r){var e=r[this.name];return typeof e<"u"||typeof this.defaultFn=="function"&&(e=this.defaultFn.call(r)),e}};function Nh(t){return Array.isArray(t)?"["+t.map(Nh).join(", ")+"]":t&&typeof t=="object"?"{ "+Object.keys(t).map(function(r){return r+": "+t[r]}).join(", ")+" }":JSON.stringify(t)}function it(t){let r={or(...P){return new Yu(P.map(N=>r.from(N)))},from(P,N){if(P instanceof Pa||P instanceof Hu||P instanceof Ju||P instanceof Yu||P instanceof Xn)return P;if(P instanceof Ta)return P.type;if(a.check(P)){if(P.length!==1)throw new Error("only one element type is permitted for typed arrays");return new Pa(r.from(P[0]))}if(l.check(P))return new Ju(Object.keys(P).map(V=>new Xu(V,r.from(P[V],V))));if(typeof P=="function"){var O=e.indexOf(P);if(O>=0)return i[O];if(typeof N!="string")throw new Error("missing name");return new Xn(N,P)}return new Hu(P)},def(P){return Sr.call(y,P)?y[P]:y[P]=new C(P)},hasDef(P){return Sr.call(y,P)}};var e=[],i=[];function n(P,N){let O=Gu.call(N),V=new Xn(P,ue=>Gu.call(ue)===O);return N&&typeof N.constructor=="function"&&(e.push(N.constructor),i.push(V)),V}let s=n("string","truthy"),o=n("function",function(){}),a=n("array",[]),l=n("object",{}),u=n("RegExp",/./),c=n("Date",new Date),p=n("number",3),d=n("boolean",!0),h=n("null",null),f=n("undefined",void 0),g=typeof BigInt=="function"?n("BigInt",BigInt(1234)):new Xn("BigInt",()=>!1),m={string:s,function:o,array:a,object:l,RegExp:u,Date:c,number:p,boolean:d,null:h,undefined:f,BigInt:g};var y=Object.create(null);function b(P){if(P&&typeof P=="object"){var N=P.type;if(typeof N=="string"&&Sr.call(y,N)){var O=y[N];if(O.finalized)return O}}return null}class C extends Ta{constructor(N){super(new Xn(N,(O,V)=>this.check(O,V)),N)}check(N,O){if(this.finalized!==!0)throw new Error("prematurely checking unfinalized type "+this.typeName);if(N===null||typeof N!="object")return!1;var V=b(N);return V?O&&V===this?this.checkAllFields(N,O):this.isSupertypeOf(V)?O?V.checkAllFields(N,O)&&this.checkAllFields(N,!1):!0:!1:this.typeName==="SourceLocation"||this.typeName==="Position"?this.checkAllFields(N,O):!1}build(...N){if(this.buildParams=N,this.buildable)return this;this.field("type",String,()=>this.typeName),this.buildable=!0;let O=(ue,ee,ae,ct)=>{if(!Sr.call(ue,ee)){var mt=this.allFields;if(!Sr.call(mt,ee))throw new Error(""+ee);var Di=mt[ee],ao=Di.type,xi;if(ct)xi=ae;else if(Di.defaultFn)xi=Di.defaultFn.call(ue);else{var lo="no value or default function given for field "+JSON.stringify(ee)+" of "+this.typeName+"("+this.buildParams.map(function(Ie){return mt[Ie]}).join(", ")+")";throw new Error(lo)}if(!ao.check(xi))throw new Error(Nh(xi)+" does not match field "+Di+" of type "+this.typeName);ue[ee]=xi}},V=(...ue)=>{var ee=ue.length;if(!this.finalized)throw new Error("attempting to instantiate unfinalized type "+this.typeName);var ae=Object.create(w);if(this.buildParams.forEach(function(ct,mt){mt<ee?O(ae,ct,ue[mt],!0):O(ae,ct,null,!1)}),Object.keys(this.allFields).forEach(function(ct){O(ae,ct,null,!1)}),ae.type!==this.typeName)throw new Error("");return ae};return V.from=ue=>{if(!this.finalized)throw new Error("attempting to instantiate unfinalized type "+this.typeName);var ee=Object.create(w);if(Object.keys(this.allFields).forEach(function(ae){Sr.call(ue,ae)?O(ee,ae,ue[ae],!0):O(ee,ae,null,!1)}),ee.type!==this.typeName)throw new Error("");return ee},Object.defineProperty(E,M(this.typeName),{enumerable:!0,value:V}),this}field(N,O,V,ue){return this.finalized?(console.error("Ignoring attempt to redefine field "+JSON.stringify(N)+" of finalized type "+JSON.stringify(this.typeName)),this):(this.ownFields[N]=new Xu(N,r.from(O),V,ue),this)}finalize(){if(!this.finalized){var N=this.allFields,O=this.allSupertypes;this.baseNames.forEach(ue=>{var ee=y[ue];if(ee instanceof Ta)ee.finalize(),B(N,ee.allFields),B(O,ee.allSupertypes);else{var ae="unknown supertype name "+JSON.stringify(ue)+" for subtype "+JSON.stringify(this.typeName);throw new Error(ae)}}),B(N,this.ownFields),O[this.typeName]=this,this.fieldNames.length=0;for(var V in N)Sr.call(N,V)&&!N[V].hidden&&this.fieldNames.push(V);Object.defineProperty(L,this.typeName,{enumerable:!0,value:this.type}),this.finalized=!0,_(this.typeName,this.supertypeList),this.buildable&&this.supertypeList.lastIndexOf("Expression")>=0&&Pe(this.typeName)}}}function D(P){if(!Sr.call(y,P))throw new Error("");var N=y[P];if(N.finalized!==!0)throw new Error("");return N.supertypeList.slice(1)}function x(P){for(var N={},O=Object.keys(y),V=O.length,ue=0;ue<V;++ue){var ee=O[ue],ae=y[ee];if(ae.finalized!==!0)throw new Error(""+ee);for(var ct=0;ct<ae.supertypeList.length;++ct){var mt=ae.supertypeList[ct];if(Sr.call(P,mt)){N[ee]=mt;break}}}return N}var E=Object.create(null),w={};function R(P,N){var O=w[P];return f.check(N)?delete w[P]:(o.assert(N),Object.defineProperty(w,P,{enumerable:!0,configurable:!0,value:N})),O}function M(P){return P.replace(/^[A-Z]+/,function(N){var O=N.length;switch(O){case 0:return"";case 1:return N.toLowerCase();default:return N.slice(0,O-1).toLowerCase()+N.charAt(O-1)}})}function T(P){return P=M(P),P.replace(/(Expression)?$/,"Statement")}var L={};function Q(P){var N=b(P);if(N)return N.fieldNames.slice(0);if("type"in P)throw new Error("did not recognize object of type "+JSON.stringify(P.type));return Object.keys(P)}function ie(P,N){var O=b(P);if(O){var V=O.allFields[N];if(V)return V.getValue(P)}return P&&P[N]}function re(P,N,O){Q(P).forEach(function(V){N.call(this,V,ie(P,V))},O)}function Z(P,N,O){return Q(P).some(function(V){return N.call(this,V,ie(P,V))},O)}function Pe(P){var N=T(P);if(E[N])return;var O=E[M(P)];if(!O)return;let V=function(...ue){return E.expressionStatement(O.apply(E,ue))};V.from=function(...ue){return E.expressionStatement(O.from.apply(E,ue))},E[N]=V}function _(P,N){N.length=0,N.push(P);for(var O=Object.create(null),V=0;V<N.length;++V){P=N[V];var ue=y[P];if(ue.finalized!==!0)throw new Error("");Sr.call(O,P)&&delete N[O[P]],O[P]=V,N.push.apply(N,ue.baseNames)}for(var ee=0,ae=ee,ct=N.length;ae<ct;++ae)Sr.call(N,ae)&&(N[ee++]=N[ae]);N.length=ee}function B(P,N){return Object.keys(N).forEach(function(O){P[O]=N[O]}),P}function G(){Object.keys(y).forEach(function(P){y[P].finalize()})}return{Type:r,builtInTypes:m,getSupertypeNames:D,computeSupertypeLookupTable:x,builders:E,defineMethod:R,getBuilderName:M,getStatementBuilderName:T,namedTypes:L,getFieldNames:Q,getFieldValue:ie,eachField:re,someField:Z,finalize:G}}Be(()=>module);var kB=Object.prototype,Mu=kB.hasOwnProperty;function pw(t){var r=t.use(it),e=r.builtInTypes.array,i=r.builtInTypes.number;let n=function p(d,h,f){if(!(this instanceof p))throw new Error("Path constructor cannot be invoked without 'new'");if(h){if(!(h instanceof p))throw new Error("")}else h=null,f=null;this.value=d,this.parentPath=h,this.name=f,this.__childCache=null};var s=n.prototype;function o(p){return p.__childCache||(p.__childCache=Object.create(null))}function a(p,d){var h=o(p),f=p.getValueProperty(d),g=h[d];return(!Mu.call(h,d)||g.value!==f)&&(g=h[d]=new p.constructor(f,p,d)),g}s.getValueProperty=function(d){return this.value[d]},s.get=function(...d){for(var h=this,f=d.length,g=0;g<f;++g)h=a(h,d[g]);return h},s.each=function(d,h){for(var f=[],g=this.value.length,m=0,m=0;m<g;++m)Mu.call(this.value,m)&&(f[m]=this.get(m));for(h=h||this,m=0;m<g;++m)Mu.call(f,m)&&d.call(h,f[m])},s.map=function(d,h){var f=[];return this.each(function(g){f.push(d.call(this,g))},h),f},s.filter=function(d,h){var f=[];return this.each(function(g){d.call(this,g)&&f.push(g)},h),f};function l(){}function u(p,d,h,f){if(e.assert(p.value),d===0)return l;var g=p.value.length;if(g<1)return l;var m=arguments.length;m===2?(h=0,f=g):m===3?(h=Math.max(h,0),f=g):(h=Math.max(h,0),f=Math.min(f,g)),i.assert(h),i.assert(f);for(var y=Object.create(null),b=o(p),C=h;C<f;++C)if(Mu.call(p.value,C)){var D=p.get(C);if(D.name!==C)throw new Error("");var x=C+d;D.name=x,y[x]=D,delete b[C]}return delete b.length,function(){for(var E in y){var w=y[E];if(w.name!==+E)throw new Error("");b[E]=w,p.value[E]=w.value}}}s.shift=function(){var d=u(this,-1),h=this.value.shift();return d(),h},s.unshift=function(...d){var h=u(this,d.length),f=this.value.unshift.apply(this.value,d);return h(),f},s.push=function(...d){return e.assert(this.value),delete o(this).length,this.value.push.apply(this.value,d)},s.pop=function(){e.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 h=arguments.length,f=u(this,h-1,d);if(f===l&&h<=1)return this;d=Math.max(d,0);for(var g=1;g<h;++g)this.value[d+g-1]=arguments[g];return f(),this},s.insertBefore=function(...d){for(var h=this.parentPath,f=d.length,g=[this.name],m=0;m<f;++m)g.push(d[m]);return h.insertAt.apply(h,g)},s.insertAfter=function(...d){for(var h=this.parentPath,f=d.length,g=[this.name+1],m=0;m<f;++m)g.push(d[m]);return h.insertAt.apply(h,g)};function c(p){if(!(p instanceof n))throw new Error("");var d=p.parentPath;if(!d)return p;var h=d.value,f=o(d);if(h[p.name]===p.value)f[p.name]=p;else if(e.check(h)){var g=h.indexOf(p.value);g>=0&&(f[p.name=g]=p)}else h[p.name]=p.value,f[p.name]=p;if(h[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 h=[],f=this.parentPath.value,g=o(this.parentPath),m=arguments.length;if(c(this),e.check(f)){for(var y=f.length,b=u(this.parentPath,m-1,this.name+1),C=[this.name,1],D=0;D<m;++D)C.push(arguments[D]);var x=f.splice.apply(f,C);if(x[0]!==this.value)throw new Error("");if(f.length!==y-1+m)throw new Error("");if(b(),m===0)delete this.value,delete g[this.name],this.__childCache=null;else{if(f[this.name]!==d)throw new Error("");for(this.value!==d&&(this.value=d,this.__childCache=null),D=0;D<m;++D)h.push(this.parentPath.get(this.name+D));if(h[0]!==this)throw new Error("")}}else if(m===1)this.value!==d&&(this.__childCache=null),this.value=f[this.name]=d,h.push(this);else if(m===0)delete f[this.name],delete this.value,this.__childCache=null;else throw new Error("Could not replace path");return h},n}Be(()=>module);var qs=Object.prototype.hasOwnProperty;function OB(t){var r=t.use(it),e=r.Type,i=r.namedTypes,n=i.Node,s=i.Expression,o=r.builtInTypes.array,a=r.builders;let l=function D(x,E){if(!(this instanceof D))throw new Error("Scope constructor cannot be invoked without 'new'");c.check(x.value)||u.assert(x.value);var w;if(E){if(!(E instanceof D))throw new Error("");w=E.depth+1}else E=null,w=0;Object.defineProperties(this,{path:{value:x},node:{value:x.value},isGlobal:{value:!E,enumerable:!0},depth:{value:w},parent:{value:E},bindings:{value:{}},types:{value:{}}})};var u=e.or(i.Program,i.Function,i.CatchClause),c=e.or(i.Function,i.ClassDeclaration,i.ClassExpression,i.InterfaceDeclaration,i.TSInterfaceDeclaration,i.TypeAlias,i.TSTypeAliasDeclaration),p=e.or(i.TypeParameter,i.TSTypeParameter);l.isEstablishedBy=function(D){return u.check(D)||c.check(D)};var d=l.prototype;d.didScan=!1,d.declares=function(D){return this.scan(),qs.call(this.bindings,D)},d.declaresType=function(D){return this.scan(),qs.call(this.types,D)},d.declareTemporary=function(D){if(D){if(!/^[a-z$_]/i.test(D))throw new Error("")}else D="t$";D+=this.depth.toString(36)+"$",this.scan();for(var x=0;this.declares(D+x);)++x;var E=D+x;return this.bindings[E]=r.builders.identifier(E)},d.injectTemporary=function(D,x){D||(D=this.declareTemporary());var E=this.path.get("body");return i.BlockStatement.check(E.value)&&(E=E.get("body")),E.unshift(a.variableDeclaration("var",[a.variableDeclarator(D,x||null)])),D},d.scan=function(D){if(D||!this.didScan){for(var x in this.bindings)delete this.bindings[x];for(var x in this.types)delete this.types[x];h(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 h(D,x,E){var w=D.value;if(c.check(w)){let R=D.get("typeParameters","params");o.check(R.value)&&R.each(M=>{C(M,E)})}u.check(w)&&(i.CatchClause.check(w)?y(D.get("param"),x):f(D,x,E))}function f(D,x,E){var w=D.value;D.parent&&i.FunctionExpression.check(D.parent.node)&&D.parent.node.id&&y(D.parent.get("id"),x),w&&(o.check(w)?D.each(R=>{m(R,x,E)}):i.Function.check(w)?(D.get("params").each(R=>{y(R,x)}),m(D.get("body"),x,E),f(D.get("typeParameters"),x,E)):i.TypeAlias&&i.TypeAlias.check(w)||i.InterfaceDeclaration&&i.InterfaceDeclaration.check(w)||i.TSTypeAliasDeclaration&&i.TSTypeAliasDeclaration.check(w)||i.TSInterfaceDeclaration&&i.TSInterfaceDeclaration.check(w)?b(D.get("id"),E):i.VariableDeclarator.check(w)?(y(D.get("id"),x),m(D.get("init"),x,E)):w.type==="ImportSpecifier"||w.type==="ImportNamespaceSpecifier"||w.type==="ImportDefaultSpecifier"?y(D.get(w.local?"local":w.name?"name":"id"),x):n.check(w)&&!s.check(w)&&r.eachField(w,function(R,M){var T=D.get(R);if(!g(T,M))throw new Error("");m(T,x,E)}))}function g(D,x){return!!(D.value===x||Array.isArray(D.value)&&D.value.length===0&&Array.isArray(x)&&x.length===0)}function m(D,x,E){var w=D.value;if(!(!w||s.check(w)))if(i.FunctionDeclaration.check(w)&&w.id!==null)y(D.get("id"),x);else if(i.ClassDeclaration&&i.ClassDeclaration.check(w)&&w.id!==null)y(D.get("id"),x),f(D.get("typeParameters"),x,E);else if(i.InterfaceDeclaration&&i.InterfaceDeclaration.check(w)||i.TSInterfaceDeclaration&&i.TSInterfaceDeclaration.check(w))b(D.get("id"),E);else if(u.check(w)){if(i.CatchClause.check(w)&&i.Identifier.check(w.param)){var R=w.param.name,M=qs.call(x,R);f(D.get("body"),x,E),M||delete x[R]}}else f(D,x,E)}function y(D,x){var E=D.value;i.Pattern.assert(E),i.Identifier.check(E)?qs.call(x,E.name)?x[E.name].push(D):x[E.name]=[D]:i.AssignmentPattern&&i.AssignmentPattern.check(E)?y(D.get("left"),x):i.ObjectPattern&&i.ObjectPattern.check(E)?D.get("properties").each(function(w){var R=w.value;i.Pattern.check(R)?y(w,x):i.Property.check(R)||i.ObjectProperty&&i.ObjectProperty.check(R)?y(w.get("value"),x):i.SpreadProperty&&i.SpreadProperty.check(R)&&y(w.get("argument"),x)}):i.ArrayPattern&&i.ArrayPattern.check(E)?D.get("elements").each(function(w){var R=w.value;i.Pattern.check(R)?y(w,x):i.SpreadElement&&i.SpreadElement.check(R)&&y(w.get("argument"),x)}):i.PropertyPattern&&i.PropertyPattern.check(E)?y(D.get("pattern"),x):(i.SpreadElementPattern&&i.SpreadElementPattern.check(E)||i.RestElement&&i.RestElement.check(E)||i.SpreadPropertyPattern&&i.SpreadPropertyPattern.check(E))&&y(D.get("argument"),x)}function b(D,x){var E=D.value;i.Pattern.assert(E),i.Identifier.check(E)&&(qs.call(x,E.name)?x[E.name].push(D):x[E.name]=[D])}function C(D,x){var E=D.value;p.assert(E),qs.call(x,E.name)?x[E.name].push(D):x[E.name]=[D]}return d.lookup=function(D){for(var x=this;x&&!x.declares(D);x=x.parent);return x},d.lookupType=function(D){for(var x=this;x&&!x.declaresType(D);x=x.parent);return x},d.getGlobalScope=function(){for(var D=this;!D.isGlobal;)D=D.parent;return D},l}Be(()=>module);function dw(t){var r=t.use(it),e=r.namedTypes,i=r.builders,n=r.builtInTypes.number,s=r.builtInTypes.array,o=t.use(pw),a=t.use(OB);let l=function m(y,b,C){if(!(this instanceof m))throw new Error("NodePath constructor cannot be invoked without 'new'");o.call(this,y,b,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 m=this.parent;return this.replace(),f(m)},u._computeNode=function(){var m=this.value;if(e.Node.check(m))return m;var y=this.parentPath;return y&&y.node||null},u._computeParent=function(){var m=this.value,y=this.parentPath;if(!e.Node.check(m)){for(;y&&!e.Node.check(y.value);)y=y.parentPath;y&&(y=y.parentPath)}for(;y&&!e.Node.check(y.value);)y=y.parentPath;return y||null},u._computeScope=function(){var m=this.value,y=this.parentPath,b=y&&y.scope;return e.Node.check(m)&&a.isEstablishedBy(m)&&(b=new a(this,b)),b||null},u.getValueProperty=function(m){return r.getFieldValue(this.value,m)},u.needsParens=function(m){var y=this.parentPath;if(!y)return!1;var b=this.value;if(!e.Expression.check(b)||b.type==="Identifier")return!1;for(;!e.Node.check(y.value);)if(y=y.parentPath,!y)return!1;var C=y.value;switch(b.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return C.type==="MemberExpression"&&this.name==="object"&&C.object===b;case"BinaryExpression":case"LogicalExpression":switch(C.type){case"CallExpression":return this.name==="callee"&&C.callee===b;case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return!0;case"MemberExpression":return this.name==="object"&&C.object===b;case"BinaryExpression":case"LogicalExpression":{let D=b,x=C.operator,E=p[x],w=D.operator,R=p[w];if(E>R)return!0;if(E===R&&this.name==="right"){if(C.right!==D)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"&&n.check(b.value)&&this.name==="object"&&C.object===b;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===b;case"ConditionalExpression":return this.name==="test"&&C.test===b;case"MemberExpression":return this.name==="object"&&C.object===b;default:return!1}default:if(C.type==="NewExpression"&&this.name==="callee"&&C.callee===b)return d(b)}return!!(m!==!0&&!this.canBeFirstInStatement()&&this.firstInStatement())};function c(m){return e.BinaryExpression.check(m)||e.LogicalExpression.check(m)}var p={};[["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"]].forEach(function(m,y){m.forEach(function(b){p[b]=y})});function d(m){return e.CallExpression.check(m)?!0:s.check(m)?m.some(d):e.Node.check(m)?r.someField(m,function(y,b){return d(b)}):!1}u.canBeFirstInStatement=function(){var m=this.node;return!e.FunctionExpression.check(m)&&!e.ObjectExpression.check(m)},u.firstInStatement=function(){return h(this)};function h(m){for(var y,b;m.parent;m=m.parent){if(y=m.node,b=m.parent.node,e.BlockStatement.check(b)&&m.parent.name==="body"&&m.name===0){if(b.body[0]!==y)throw new Error("Nodes must be equal");return!0}if(e.ExpressionStatement.check(b)&&m.name==="expression"){if(b.expression!==y)throw new Error("Nodes must be equal");return!0}if(e.SequenceExpression.check(b)&&m.parent.name==="expressions"&&m.name===0){if(b.expressions[0]!==y)throw new Error("Nodes must be equal");continue}if(e.CallExpression.check(b)&&m.name==="callee"){if(b.callee!==y)throw new Error("Nodes must be equal");continue}if(e.MemberExpression.check(b)&&m.name==="object"){if(b.object!==y)throw new Error("Nodes must be equal");continue}if(e.ConditionalExpression.check(b)&&m.name==="test"){if(b.test!==y)throw new Error("Nodes must be equal");continue}if(c(b)&&m.name==="left"){if(b.left!==y)throw new Error("Nodes must be equal");continue}if(e.UnaryExpression.check(b)&&!b.prefix&&m.name==="argument"){if(b.argument!==y)throw new Error("Nodes must be equal");continue}return!1}return!0}function f(m){if(e.VariableDeclaration.check(m.node)){var y=m.get("declarations").value;if(!y||y.length===0)return m.prune()}else if(e.ExpressionStatement.check(m.node)){if(!m.get("expression").value)return m.prune()}else e.IfStatement.check(m.node)&&g(m);return m}function g(m){var y=m.get("test").value,b=m.get("alternate").value,C=m.get("consequent").value;if(!C&&!b){var D=i.expressionStatement(y);m.replace(D)}else if(!C&&b){var x=i.unaryExpression("!",y,!0);e.UnaryExpression.check(y)&&y.operator==="!"&&(x=y.argument),m.get("test").replace(x),m.get("consequent").replace(b),m.get("alternate").replace()}}return l}Be(()=>module);var Bu=Object.prototype.hasOwnProperty;function RB(t){var r=t.use(it),e=t.use(dw),i=r.builtInTypes.array,n=r.builtInTypes.object,s=r.builtInTypes.function,o;let a=function f(){if(!(this instanceof f))throw new Error("PathVisitor constructor cannot be invoked without 'new'");this._reusableContextStack=[],this._methodNameTable=l(this),this._shouldVisitComments=Bu.call(this._methodNameTable,"Block")||Bu.call(this._methodNameTable,"Line"),this.Context=d(this),this._visiting=!1,this._changeReported=!1};function l(f){var g=Object.create(null);for(var m in f)/^visit[A-Z]/.test(m)&&(g[m.slice(5)]=!0);for(var y=r.computeSupertypeLookupTable(g),b=Object.create(null),C=Object.keys(y),D=C.length,x=0;x<D;++x){var E=C[x];m="visit"+y[E],s.check(f[m])&&(b[E]=m)}return b}a.fromMethodsObject=function(g){if(g instanceof a)return g;if(!n.check(g))return new a;let m=function b(){if(!(this instanceof b))throw new Error("Visitor constructor cannot be invoked without 'new'");a.call(this)};var y=m.prototype=Object.create(c);return y.constructor=m,u(y,g),u(m,a),s.assert(m.fromMethodsObject),s.assert(m.visit),new m};function u(f,g){for(var m in g)Bu.call(g,m)&&(f[m]=g[m]);return f}a.visit=function(g,m){return a.fromMethodsObject(m).visit(g)};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 f=arguments.length,g=new Array(f),m=0;m<f;++m)g[m]=arguments[m];g[0]instanceof e||(g[0]=new e({root:g[0]}).get("root")),this.reset.apply(this,g);var y;try{var b=this.visitWithoutReset(g[0]);y=!0}finally{if(this._visiting=!1,!y&&this._abortRequested)return g[0].value}return b},c.AbortRequest=function(){},c.abort=function(){var f=this;f._abortRequested=!0;var g=new f.AbortRequest;throw g.cancel=function(){f._abortRequested=!1},g},c.reset=function(f){},c.visitWithoutReset=function(f){if(this instanceof this.Context)return this.visitor.visitWithoutReset(f);if(!(f instanceof e))throw new Error("");var g=f.value,m=g&&typeof g=="object"&&typeof g.type=="string"&&this._methodNameTable[g.type];if(m){var y=this.acquireContext(f);try{return y.invokeVisitorMethod(m)}finally{this.releaseContext(y)}}else return p(f,this)};function p(f,g){if(!(f instanceof e))throw new Error("");if(!(g instanceof a))throw new Error("");var m=f.value;if(i.check(m))f.each(g.visitWithoutReset,g);else if(n.check(m)){var y=r.getFieldNames(m);g._shouldVisitComments&&m.comments&&y.indexOf("comments")<0&&y.push("comments");for(var b=y.length,C=[],D=0;D<b;++D){var x=y[D];Bu.call(m,x)||(m[x]=r.getFieldValue(m,x)),C.push(f.get(x))}for(var D=0;D<b;++D)g.visitWithoutReset(C[D])}return f.value}c.acquireContext=function(f){return this._reusableContextStack.length===0?new this.Context(f):this._reusableContextStack.pop().reset(f)},c.releaseContext=function(f){if(!(f instanceof this.Context))throw new Error("");this._reusableContextStack.push(f),f.currentPath=null},c.reportChanged=function(){this._changeReported=!0},c.wasChangeReported=function(){return this._changeReported};function d(f){function g(y){if(!(this instanceof g))throw new Error("");if(!(this instanceof a))throw new Error("");if(!(y instanceof e))throw new Error("");Object.defineProperty(this,"visitor",{value:f,writable:!1,enumerable:!0,configurable:!1}),this.currentPath=y,this.needToCallTraverse=!0,Object.seal(this)}if(!(f instanceof a))throw new Error("");var m=g.prototype=Object.create(f);return m.constructor=g,u(m,h),g}var h=Object.create(null);return h.reset=function(g){if(!(this instanceof this.Context))throw new Error("");if(!(g instanceof e))throw new Error("");return this.currentPath=g,this.needToCallTraverse=!0,this},h.invokeVisitorMethod=function(g){if(!(this instanceof this.Context))throw new Error("");if(!(this.currentPath instanceof e))throw new Error("");var m=this.visitor[g].call(this,this.currentPath);if(m===!1?this.needToCallTraverse=!1:m!==o&&(this.currentPath=this.currentPath.replace(m)[0],this.needToCallTraverse&&this.traverse(this.currentPath)),this.needToCallTraverse!==!1)throw new Error("Must either call this.traverse or return false in "+g);var y=this.currentPath;return y&&y.value},h.traverse=function(g,m){if(!(this instanceof this.Context))throw new Error("");if(!(g instanceof e))throw new Error("");if(!(this.currentPath instanceof e))throw new Error("");return this.needToCallTraverse=!1,p(g,a.fromMethodsObject(m||this.visitor))},h.visit=function(g,m){if(!(this instanceof this.Context))throw new Error("");if(!(g instanceof e))throw new Error("");if(!(this.currentPath instanceof e))throw new Error("");return this.needToCallTraverse=!1,a.fromMethodsObject(m||this.visitor).visitWithoutReset(g)},h.reportChanged=function(){this.visitor.reportChanged()},h.abort=function(){this.needToCallTraverse=!1,this.visitor.abort()},a}Be(()=>module);function LB(t){var r=t.use(it),e=r.getFieldNames,i=r.getFieldValue,n=r.builtInTypes.array,s=r.builtInTypes.object,o=r.builtInTypes.Date,a=r.builtInTypes.RegExp,l=Object.prototype.hasOwnProperty;function u(f,g,m){return n.check(m)?m.length=0:m=null,p(f,g,m)}u.assert=function(f,g){var m=[];if(!u(f,g,m))if(m.length===0){if(f!==g)throw new Error("Nodes must be equal")}else throw new Error("Nodes differ in the following path: "+m.map(c).join(""))};function c(f){return/[_$a-z][_$a-z0-9]*/i.test(f)?"."+f:"["+JSON.stringify(f)+"]"}function p(f,g,m){return f===g?!0:n.check(f)?d(f,g,m):s.check(f)?h(f,g,m):o.check(f)?o.check(g)&&+f==+g:a.check(f)?a.check(g)&&f.source===g.source&&f.global===g.global&&f.multiline===g.multiline&&f.ignoreCase===g.ignoreCase:f==g}function d(f,g,m){n.assert(f);var y=f.length;if(!n.check(g)||g.length!==y)return m&&m.push("length"),!1;for(var b=0;b<y;++b){if(m&&m.push(b),b in f!=b in g||!p(f[b],g[b],m))return!1;if(m){var C=m.pop();if(C!==b)throw new Error(""+C)}}return!0}function h(f,g,m){if(s.assert(f),!s.check(g))return!1;if(f.type!==g.type)return m&&m.push("type"),!1;var y=e(f),b=y.length,C=e(g),D=C.length;if(b===D){for(var x=0;x<b;++x){var E=y[x],w=i(f,E),R=i(g,E);if(m&&m.push(E),!p(w,R,m))return!1;if(m){var M=m.pop();if(M!==E)throw new Error(""+M)}}return!0}if(!m)return!1;var T=Object.create(null);for(x=0;x<b;++x)T[y[x]]=!0;for(x=0;x<D;++x){if(E=C[x],!l.call(T,E))return m.push(E),!1;delete T[E]}for(E in T){m.push(E);break}return!1}return u}Be(()=>module);function MB(t){let r=BB(),e=r.use(it);t.forEach(r.use),e.finalize();let i=r.use(RB);return{Type:e.Type,builtInTypes:e.builtInTypes,namedTypes:e.namedTypes,builders:e.builders,defineMethod:e.defineMethod,getFieldNames:e.getFieldNames,getFieldValue:e.getFieldValue,eachField:e.eachField,someField:e.someField,getSupertypeNames:e.getSupertypeNames,getBuilderName:e.getBuilderName,astNodesAreEquivalent:r.use(LB),finalize:e.finalize,Path:r.use(pw),NodePath:r.use(dw),PathVisitor:i,use:r.use,visit:i.visit}}function BB(){let t=[],r=[];function e(n){var s=t.indexOf(n);return s===-1&&(s=t.length,t.push(n),r[s]=n(i)),r[s]}var i={use:e};return i}Be(()=>module);function fw(){return{BinaryOperators:["==","!=","===","!==","<","<=",">",">=","<<",">>",">>>","+","-","*","/","%","&","|","^","in","instanceof"],AssignmentOperators:["=","+=","-=","*=","/=","%=","<<=",">>=",">>>=","|=","^=","&="],LogicalOperators:["||","&&"]}}Be(()=>module);function hw(t){let r=t.use(fw);return r.BinaryOperators.indexOf("**")<0&&r.BinaryOperators.push("**"),r.AssignmentOperators.indexOf("**=")<0&&r.AssignmentOperators.push("**="),r}Be(()=>module);function mw(t){let r=t.use(hw);return r.LogicalOperators.indexOf("??")<0&&r.LogicalOperators.push("??"),r}Be(()=>module);function $B(t){let r=t.use(mw);return r.LogicalOperators.forEach(e=>{let i=e+"=";r.AssignmentOperators.indexOf(i)<0&&r.AssignmentOperators.push(i)}),r}Be(()=>module);function UB(t){var r=t.use(it),e=r.Type,i=e.def,n=e.or,s=t.use(pr),o=s.defaults,a=s.geq;let{BinaryOperators:l,AssignmentOperators:u,LogicalOperators:c}=t.use(fw);i("Printable").field("loc",n(i("SourceLocation"),null),o.null,!0),i("Node").bases("Printable").field("type",String).field("comments",n([i("Comment")],null),o.null,!0),i("SourceLocation").field("start",i("Position")).field("end",i("Position")).field("source",n(String,null),o.null),i("Position").field("line",a(1)).field("column",a(0)),i("File").bases("Node").build("program","name").field("program",i("Program")).field("name",n(String,null),o.null),i("Program").bases("Node").build("body").field("body",[i("Statement")]),i("Function").bases("Node").field("id",n(i("Identifier"),null),o.null).field("params",[i("Pattern")]).field("body",i("BlockStatement")).field("generator",Boolean,o.false).field("async",Boolean,o.false),i("Statement").bases("Node"),i("EmptyStatement").bases("Statement").build(),i("BlockStatement").bases("Statement").build("body").field("body",[i("Statement")]),i("ExpressionStatement").bases("Statement").build("expression").field("expression",i("Expression")),i("IfStatement").bases("Statement").build("test","consequent","alternate").field("test",i("Expression")).field("consequent",i("Statement")).field("alternate",n(i("Statement"),null),o.null),i("LabeledStatement").bases("Statement").build("label","body").field("label",i("Identifier")).field("body",i("Statement")),i("BreakStatement").bases("Statement").build("label").field("label",n(i("Identifier"),null),o.null),i("ContinueStatement").bases("Statement").build("label").field("label",n(i("Identifier"),null),o.null),i("WithStatement").bases("Statement").build("object","body").field("object",i("Expression")).field("body",i("Statement")),i("SwitchStatement").bases("Statement").build("discriminant","cases","lexical").field("discriminant",i("Expression")).field("cases",[i("SwitchCase")]).field("lexical",Boolean,o.false),i("ReturnStatement").bases("Statement").build("argument").field("argument",n(i("Expression"),null)),i("ThrowStatement").bases("Statement").build("argument").field("argument",i("Expression")),i("TryStatement").bases("Statement").build("block","handler","finalizer").field("block",i("BlockStatement")).field("handler",n(i("CatchClause"),null),function(){return this.handlers&&this.handlers[0]||null}).field("handlers",[i("CatchClause")],function(){return this.handler?[this.handler]:[]},!0).field("guardedHandlers",[i("CatchClause")],o.emptyArray).field("finalizer",n(i("BlockStatement"),null),o.null),i("CatchClause").bases("Node").build("param","guard","body").field("param",i("Pattern")).field("guard",n(i("Expression"),null),o.null).field("body",i("BlockStatement")),i("WhileStatement").bases("Statement").build("test","body").field("test",i("Expression")).field("body",i("Statement")),i("DoWhileStatement").bases("Statement").build("body","test").field("body",i("Statement")).field("test",i("Expression")),i("ForStatement").bases("Statement").build("init","test","update","body").field("init",n(i("VariableDeclaration"),i("Expression"),null)).field("test",n(i("Expression"),null)).field("update",n(i("Expression"),null)).field("body",i("Statement")),i("ForInStatement").bases("Statement").build("left","right","body").field("left",n(i("VariableDeclaration"),i("Expression"))).field("right",i("Expression")).field("body",i("Statement")),i("DebuggerStatement").bases("Statement").build(),i("Declaration").bases("Statement"),i("FunctionDeclaration").bases("Function","Declaration").build("id","params","body").field("id",i("Identifier")),i("FunctionExpression").bases("Function","Expression").build("id","params","body"),i("VariableDeclaration").bases("Declaration").build("kind","declarations").field("kind",n("var","let","const")).field("declarations",[i("VariableDeclarator")]),i("VariableDeclarator").bases("Node").build("id","init").field("id",i("Pattern")).field("init",n(i("Expression"),null),o.null),i("Expression").bases("Node"),i("ThisExpression").bases("Expression").build(),i("ArrayExpression").bases("Expression").build("elements").field("elements",[n(i("Expression"),null)]),i("ObjectExpression").bases("Expression").build("properties").field("properties",[i("Property")]),i("Property").bases("Node").build("kind","key","value").field("kind",n("init","get","set")).field("key",n(i("Literal"),i("Identifier"))).field("value",i("Expression")),i("SequenceExpression").bases("Expression").build("expressions").field("expressions",[i("Expression")]);var p=n("-","+","!","~","typeof","void","delete");i("UnaryExpression").bases("Expression").build("operator","argument","prefix").field("operator",p).field("argument",i("Expression")).field("prefix",Boolean,o.true);let d=n(...l);i("BinaryExpression").bases("Expression").build("operator","left","right").field("operator",d).field("left",i("Expression")).field("right",i("Expression"));let h=n(...u);i("AssignmentExpression").bases("Expression").build("operator","left","right").field("operator",h).field("left",n(i("Pattern"),i("MemberExpression"))).field("right",i("Expression"));var f=n("++","--");i("UpdateExpression").bases("Expression").build("operator","argument","prefix").field("operator",f).field("argument",i("Expression")).field("prefix",Boolean);var g=n(...c);i("LogicalExpression").bases("Expression").build("operator","left","right").field("operator",g).field("left",i("Expression")).field("right",i("Expression")),i("ConditionalExpression").bases("Expression").build("test","consequent","alternate").field("test",i("Expression")).field("consequent",i("Expression")).field("alternate",i("Expression")),i("NewExpression").bases("Expression").build("callee","arguments").field("callee",i("Expression")).field("arguments",[i("Expression")]),i("CallExpression").bases("Expression").build("callee","arguments").field("callee",i("Expression")).field("arguments",[i("Expression")]),i("MemberExpression").bases("Expression").build("object","property","computed").field("object",i("Expression")).field("property",n(i("Identifier"),i("Expression"))).field("computed",Boolean,function(){var m=this.property.type;return m==="Literal"||m==="MemberExpression"||m==="BinaryExpression"}),i("Pattern").bases("Node"),i("SwitchCase").bases("Node").build("test","consequent").field("test",n(i("Expression"),null)).field("consequent",[i("Statement")]),i("Identifier").bases("Expression","Pattern").build("name").field("name",String).field("optional",Boolean,o.false),i("Literal").bases("Expression").build("value").field("value",n(String,Boolean,null,Number,RegExp,BigInt)),i("Comment").bases("Printable").field("value",String).field("leading",Boolean,o.true).field("trailing",Boolean,o.false)}Be(()=>module);function jB(t){t.use(UB);let r=t.use(it),e=r.Type.def,i=r.Type.or,n=t.use(pr).defaults;e("Function").field("generator",Boolean,n.false).field("expression",Boolean,n.false).field("defaults",[i(e("Expression"),null)],n.emptyArray).field("rest",i(e("Identifier"),null),n.null),e("RestElement").bases("Pattern").build("argument").field("argument",e("Pattern")).field("typeAnnotation",i(e("TypeAnnotation"),e("TSTypeAnnotation"),null),n.null),e("SpreadElementPattern").bases("Pattern").build("argument").field("argument",e("Pattern")),e("FunctionDeclaration").build("id","params","body","generator","expression").field("id",i(e("Identifier"),null)),e("FunctionExpression").build("id","params","body","generator","expression"),e("ArrowFunctionExpression").bases("Function","Expression").build("params","body","expression").field("id",null,n.null).field("body",i(e("BlockStatement"),e("Expression"))).field("generator",!1,n.false),e("ForOfStatement").bases("Statement").build("left","right","body").field("left",i(e("VariableDeclaration"),e("Pattern"))).field("right",e("Expression")).field("body",e("Statement")),e("YieldExpression").bases("Expression").build("argument","delegate").field("argument",i(e("Expression"),null)).field("delegate",Boolean,n.false),e("GeneratorExpression").bases("Expression").build("body","blocks","filter").field("body",e("Expression")).field("blocks",[e("ComprehensionBlock")]).field("filter",i(e("Expression"),null)),e("ComprehensionExpression").bases("Expression").build("body","blocks","filter").field("body",e("Expression")).field("blocks",[e("ComprehensionBlock")]).field("filter",i(e("Expression"),null)),e("ComprehensionBlock").bases("Node").build("left","right","each").field("left",e("Pattern")).field("right",e("Expression")).field("each",Boolean),e("Property").field("key",i(e("Literal"),e("Identifier"),e("Expression"))).field("value",i(e("Expression"),e("Pattern"))).field("method",Boolean,n.false).field("shorthand",Boolean,n.false).field("computed",Boolean,n.false),e("ObjectProperty").field("shorthand",Boolean,n.false),e("PropertyPattern").bases("Pattern").build("key","pattern").field("key",i(e("Literal"),e("Identifier"),e("Expression"))).field("pattern",e("Pattern")).field("computed",Boolean,n.false),e("ObjectPattern").bases("Pattern").build("properties").field("properties",[i(e("PropertyPattern"),e("Property"))]),e("ArrayPattern").bases("Pattern").build("elements").field("elements",[i(e("Pattern"),null)]),e("SpreadElement").bases("Node").build("argument").field("argument",e("Expression")),e("ArrayExpression").field("elements",[i(e("Expression"),e("SpreadElement"),e("RestElement"),null)]),e("NewExpression").field("arguments",[i(e("Expression"),e("SpreadElement"))]),e("CallExpression").field("arguments",[i(e("Expression"),e("SpreadElement"))]),e("AssignmentPattern").bases("Pattern").build("left","right").field("left",e("Pattern")).field("right",e("Expression")),e("MethodDefinition").bases("Declaration").build("kind","key","value","static").field("kind",i("constructor","method","get","set")).field("key",e("Expression")).field("value",e("Function")).field("computed",Boolean,n.false).field("static",Boolean,n.false);let s=i(e("MethodDefinition"),e("VariableDeclarator"),e("ClassPropertyDefinition"),e("ClassProperty"),e("StaticBlock"));e("ClassProperty").bases("Declaration").build("key").field("key",i(e("Literal"),e("Identifier"),e("Expression"))).field("computed",Boolean,n.false),e("ClassPropertyDefinition").bases("Declaration").build("definition").field("definition",s),e("ClassBody").bases("Declaration").build("body").field("body",[s]),e("ClassDeclaration").bases("Declaration").build("id","body","superClass").field("id",i(e("Identifier"),null)).field("body",e("ClassBody")).field("superClass",i(e("Expression"),null),n.null),e("ClassExpression").bases("Expression").build("id","body","superClass").field("id",i(e("Identifier"),null),n.null).field("body",e("ClassBody")).field("superClass",i(e("Expression"),null),n.null),e("Super").bases("Expression").build(),e("Specifier").bases("Node"),e("ModuleSpecifier").bases("Specifier").field("local",i(e("Identifier"),null),n.null).field("id",i(e("Identifier"),null),n.null).field("name",i(e("Identifier"),null),n.null),e("ImportSpecifier").bases("ModuleSpecifier").build("imported","local").field("imported",e("Identifier")),e("ImportDefaultSpecifier").bases("ModuleSpecifier").build("local"),e("ImportNamespaceSpecifier").bases("ModuleSpecifier").build("local"),e("ImportDeclaration").bases("Declaration").build("specifiers","source","importKind").field("specifiers",[i(e("ImportSpecifier"),e("ImportNamespaceSpecifier"),e("ImportDefaultSpecifier"))],n.emptyArray).field("source",e("Literal")).field("importKind",i("value","type"),function(){return"value"}),e("ExportNamedDeclaration").bases("Declaration").build("declaration","specifiers","source").field("declaration",i(e("Declaration"),null)).field("specifiers",[e("ExportSpecifier")],n.emptyArray).field("source",i(e("Literal"),null),n.null),e("ExportSpecifier").bases("ModuleSpecifier").build("local","exported").field("exported",e("Identifier")),e("ExportDefaultDeclaration").bases("Declaration").build("declaration").field("declaration",i(e("Declaration"),e("Expression"))),e("ExportAllDeclaration").bases("Declaration").build("source").field("source",e("Literal")),e("TaggedTemplateExpression").bases("Expression").build("tag","quasi").field("tag",e("Expression")).field("quasi",e("TemplateLiteral")),e("TemplateLiteral").bases("Expression").build("quasis","expressions").field("quasis",[e("TemplateElement")]).field("expressions",[e("Expression")]),e("TemplateElement").bases("Node").build("value","tail").field("value",{cooked:String,raw:String}).field("tail",Boolean),e("MetaProperty").bases("Expression").build("meta","property").field("meta",e("Identifier")).field("property",e("Identifier"))}Be(()=>module);function qB(t){t.use(hw),t.use(jB)}Be(()=>module);function KB(t){t.use(qB);let e=t.use(it).Type.def,i=t.use(pr).defaults;e("Function").field("async",Boolean,i.false),e("AwaitExpression").bases("Expression").build("argument").field("argument",e("Expression"))}Be(()=>module);function VB(t){t.use(KB);let r=t.use(it),e=r.Type.def,i=r.Type.or,n=t.use(pr).defaults;e("ForOfStatement").field("await",Boolean,n.false),e("SpreadProperty").bases("Node").build("argument").field("argument",e("Expression")),e("ObjectExpression").field("properties",[i(e("Property"),e("SpreadProperty"),e("SpreadElement"))]),e("TemplateElement").field("value",{cooked:i(String,null),raw:String}),e("SpreadPropertyPattern").bases("Pattern").build("argument").field("argument",e("Pattern")),e("ObjectPattern").field("properties",[i(e("PropertyPattern"),e("Property"),e("RestElement"),e("SpreadPropertyPattern"))])}Be(()=>module);function zB(t){t.use(VB);let r=t.use(it),e=r.Type.def,i=r.Type.or,n=t.use(pr).defaults;e("CatchClause").field("param",i(e("Pattern"),null),n.null)}Be(()=>module);function WB(t){t.use(mw),t.use(zB);let r=t.use(it),e=r.Type.def,i=r.Type.or,s=t.use(pr).defaults;e("ImportExpression").bases("Expression").build("source").field("source",e("Expression")),e("ExportAllDeclaration").bases("Declaration").build("source","exported").field("source",e("Literal")).field("exported",i(e("Identifier"),null,void 0),s.null),e("ChainElement").bases("Node").field("optional",Boolean,s.false),e("CallExpression").bases("Expression","ChainElement"),e("MemberExpression").bases("Expression","ChainElement"),e("ChainExpression").bases("Expression").build("expression").field("expression",e("ChainElement")),e("OptionalCallExpression").bases("CallExpression").build("callee","arguments","optional").field("optional",Boolean,s.true),e("OptionalMemberExpression").bases("MemberExpression").build("object","property","computed","optional").field("optional",Boolean,s.true)}Be(()=>module);function GB(t){t.use($B),t.use(WB)}Be(()=>module);function HB(t){t.use(GB);let e=t.use(it).Type.def;e("StaticBlock").bases("Declaration").build("body").field("body",[e("Statement")])}Be(()=>module);function Fa(t){t.use(HB);let r=t.use(it),e=r.Type,i=r.Type.def,n=e.or,o=t.use(pr).defaults;i("AwaitExpression").build("argument","all").field("argument",n(i("Expression"),null)).field("all",Boolean,o.false),i("Decorator").bases("Node").build("expression").field("expression",i("Expression")),i("Property").field("decorators",n([i("Decorator")],null),o.null),i("MethodDefinition").field("decorators",n([i("Decorator")],null),o.null),i("PrivateName").bases("Expression","Pattern").build("id").field("id",i("Identifier")),i("ClassPrivateProperty").bases("ClassProperty").build("key","value").field("key",i("PrivateName")).field("value",n(i("Expression"),null),o.null),i("ImportAttribute").bases("Node").build("key","value").field("key",n(i("Identifier"),i("Literal"))).field("value",i("Expression")),["ImportDeclaration","ExportAllDeclaration","ExportNamedDeclaration"].forEach(a=>{i(a).field("assertions",[i("ImportAttribute")],o.emptyArray)}),i("RecordExpression").bases("Expression").build("properties").field("properties",[n(i("ObjectProperty"),i("ObjectMethod"),i("SpreadElement"))]),i("TupleExpression").bases("Expression").build("elements").field("elements",[n(i("Expression"),i("SpreadElement"),null)]),i("ModuleExpression").bases("Node").build("body").field("body",i("Program"))}Be(()=>module);function JB(t){t.use(Fa);let r=t.use(it),e=r.Type.def,i=r.Type.or,n=t.use(pr).defaults;e("JSXAttribute").bases("Node").build("name","value").field("name",i(e("JSXIdentifier"),e("JSXNamespacedName"))).field("value",i(e("Literal"),e("JSXExpressionContainer"),e("JSXElement"),e("JSXFragment"),null),n.null),e("JSXIdentifier").bases("Identifier").build("name").field("name",String),e("JSXNamespacedName").bases("Node").build("namespace","name").field("namespace",e("JSXIdentifier")).field("name",e("JSXIdentifier")),e("JSXMemberExpression").bases("MemberExpression").build("object","property").field("object",i(e("JSXIdentifier"),e("JSXMemberExpression"))).field("property",e("JSXIdentifier")).field("computed",Boolean,n.false);let s=i(e("JSXIdentifier"),e("JSXNamespacedName"),e("JSXMemberExpression"));e("JSXSpreadAttribute").bases("Node").build("argument").field("argument",e("Expression"));let o=[i(e("JSXAttribute"),e("JSXSpreadAttribute"))];e("JSXExpressionContainer").bases("Expression").build("expression").field("expression",i(e("Expression"),e("JSXEmptyExpression")));let a=[i(e("JSXText"),e("JSXExpressionContainer"),e("JSXSpreadChild"),e("JSXElement"),e("JSXFragment"),e("Literal"))];e("JSXElement").bases("Expression").build("openingElement","closingElement","children").field("openingElement",e("JSXOpeningElement")).field("closingElement",i(e("JSXClosingElement"),null),n.null).field("children",a,n.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),e("JSXOpeningElement").bases("Node").build("name","attributes","selfClosing").field("name",s).field("attributes",o,n.emptyArray).field("selfClosing",Boolean,n.false),e("JSXClosingElement").bases("Node").build("name").field("name",s),e("JSXFragment").bases("Expression").build("openingFragment","closingFragment","children").field("openingFragment",e("JSXOpeningFragment")).field("closingFragment",e("JSXClosingFragment")).field("children",a,n.emptyArray),e("JSXOpeningFragment").bases("Node").build(),e("JSXClosingFragment").bases("Node").build(),e("JSXText").bases("Literal").build("value","raw").field("value",String).field("raw",String,function(){return this.value}),e("JSXEmptyExpression").bases("Node").build(),e("JSXSpreadChild").bases("Node").build("expression").field("expression",e("Expression"))}Be(()=>module);function gw(t){var r=t.use(it),e=r.Type.def,i=r.Type.or,n=t.use(pr).defaults,s=i(e("TypeAnnotation"),e("TSTypeAnnotation"),null),o=i(e("TypeParameterDeclaration"),e("TSTypeParameterDeclaration"),null);e("Identifier").field("typeAnnotation",s,n.null),e("ObjectPattern").field("typeAnnotation",s,n.null),e("Function").field("returnType",s,n.null).field("typeParameters",o,n.null),e("ClassProperty").build("key","value","typeAnnotation","static").field("value",i(e("Expression"),null)).field("static",Boolean,n.false).field("typeAnnotation",s,n.null),["ClassDeclaration","ClassExpression"].forEach(a=>{e(a).field("typeParameters",o,n.null).field("superTypeParameters",i(e("TypeParameterInstantiation"),e("TSTypeParameterInstantiation"),null),n.null).field("implements",i([e("ClassImplements")],[e("TSExpressionWithTypeArguments")]),n.emptyArray)})}Be(()=>module);function yw(t){t.use(Fa),t.use(gw);let r=t.use(it),e=r.Type.def,i=r.Type.or,n=t.use(pr).defaults;e("Flow").bases("Node"),e("FlowType").bases("Flow"),e("AnyTypeAnnotation").bases("FlowType").build(),e("EmptyTypeAnnotation").bases("FlowType").build(),e("MixedTypeAnnotation").bases("FlowType").build(),e("VoidTypeAnnotation").bases("FlowType").build(),e("SymbolTypeAnnotation").bases("FlowType").build(),e("NumberTypeAnnotation").bases("FlowType").build(),e("BigIntTypeAnnotation").bases("FlowType").build(),e("NumberLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",Number).field("raw",String),e("NumericLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",Number).field("raw",String),e("BigIntLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",null).field("raw",String),e("StringTypeAnnotation").bases("FlowType").build(),e("StringLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",String).field("raw",String),e("BooleanTypeAnnotation").bases("FlowType").build(),e("BooleanLiteralTypeAnnotation").bases("FlowType").build("value","raw").field("value",Boolean).field("raw",String),e("TypeAnnotation").bases("Node").build("typeAnnotation").field("typeAnnotation",e("FlowType")),e("NullableTypeAnnotation").bases("FlowType").build("typeAnnotation").field("typeAnnotation",e("FlowType")),e("NullLiteralTypeAnnotation").bases("FlowType").build(),e("NullTypeAnnotation").bases("FlowType").build(),e("ThisTypeAnnotation").bases("FlowType").build(),e("ExistsTypeAnnotation").bases("FlowType").build(),e("ExistentialTypeParam").bases("FlowType").build(),e("FunctionTypeAnnotation").bases("FlowType").build("params","returnType","rest","typeParameters").field("params",[e("FunctionTypeParam")]).field("returnType",e("FlowType")).field("rest",i(e("FunctionTypeParam"),null)).field("typeParameters",i(e("TypeParameterDeclaration"),null)),e("FunctionTypeParam").bases("Node").build("name","typeAnnotation","optional").field("name",i(e("Identifier"),null)).field("typeAnnotation",e("FlowType")).field("optional",Boolean),e("ArrayTypeAnnotation").bases("FlowType").build("elementType").field("elementType",e("FlowType")),e("ObjectTypeAnnotation").bases("FlowType").build("properties","indexers","callProperties").field("properties",[i(e("ObjectTypeProperty"),e("ObjectTypeSpreadProperty"))]).field("indexers",[e("ObjectTypeIndexer")],n.emptyArray).field("callProperties",[e("ObjectTypeCallProperty")],n.emptyArray).field("inexact",i(Boolean,void 0),n.undefined).field("exact",Boolean,n.false).field("internalSlots",[e("ObjectTypeInternalSlot")],n.emptyArray),e("Variance").bases("Node").build("kind").field("kind",i("plus","minus"));let s=i(e("Variance"),"plus","minus",null);e("ObjectTypeProperty").bases("Node").build("key","value","optional").field("key",i(e("Literal"),e("Identifier"))).field("value",e("FlowType")).field("optional",Boolean).field("variance",s,n.null),e("ObjectTypeIndexer").bases("Node").build("id","key","value").field("id",e("Identifier")).field("key",e("FlowType")).field("value",e("FlowType")).field("variance",s,n.null).field("static",Boolean,n.false),e("ObjectTypeCallProperty").bases("Node").build("value").field("value",e("FunctionTypeAnnotation")).field("static",Boolean,n.false),e("QualifiedTypeIdentifier").bases("Node").build("qualification","id").field("qualification",i(e("Identifier"),e("QualifiedTypeIdentifier"))).field("id",e("Identifier")),e("GenericTypeAnnotation").bases("FlowType").build("id","typeParameters").field("id",i(e("Identifier"),e("QualifiedTypeIdentifier"))).field("typeParameters",i(e("TypeParameterInstantiation"),null)),e("MemberTypeAnnotation").bases("FlowType").build("object","property").field("object",e("Identifier")).field("property",i(e("MemberTypeAnnotation"),e("GenericTypeAnnotation"))),e("IndexedAccessType").bases("FlowType").build("objectType","indexType").field("objectType",e("FlowType")).field("indexType",e("FlowType")),e("OptionalIndexedAccessType").bases("FlowType").build("objectType","indexType","optional").field("objectType",e("FlowType")).field("indexType",e("FlowType")).field("optional",Boolean),e("UnionTypeAnnotation").bases("FlowType").build("types").field("types",[e("FlowType")]),e("IntersectionTypeAnnotation").bases("FlowType").build("types").field("types",[e("FlowType")]),e("TypeofTypeAnnotation").bases("FlowType").build("argument").field("argument",e("FlowType")),e("ObjectTypeSpreadProperty").bases("Node").build("argument").field("argument",e("FlowType")),e("ObjectTypeInternalSlot").bases("Node").build("id","value","optional","static","method").field("id",e("Identifier")).field("value",e("FlowType")).field("optional",Boolean).field("static",Boolean).field("method",Boolean),e("TypeParameterDeclaration").bases("Node").build("params").field("params",[e("TypeParameter")]),e("TypeParameterInstantiation").bases("Node").build("params").field("params",[e("FlowType")]),e("TypeParameter").bases("FlowType").build("name","variance","bound","default").field("name",String).field("variance",s,n.null).field("bound",i(e("TypeAnnotation"),null),n.null).field("default",i(e("FlowType"),null),n.null),e("ClassProperty").field("variance",s,n.null),e("ClassImplements").bases("Node").build("id").field("id",e("Identifier")).field("superClass",i(e("Expression"),null),n.null).field("typeParameters",i(e("TypeParameterInstantiation"),null),n.null),e("InterfaceTypeAnnotation").bases("FlowType").build("body","extends").field("body",e("ObjectTypeAnnotation")).field("extends",i([e("InterfaceExtends")],null),n.null),e("InterfaceDeclaration").bases("Declaration").build("id","body","extends").field("id",e("Identifier")).field("typeParameters",i(e("TypeParameterDeclaration"),null),n.null).field("body",e("ObjectTypeAnnotation")).field("extends",[e("InterfaceExtends")]),e("DeclareInterface").bases("InterfaceDeclaration").build("id","body","extends"),e("InterfaceExtends").bases("Node").build("id").field("id",e("Identifier")).field("typeParameters",i(e("TypeParameterInstantiation"),null),n.null),e("TypeAlias").bases("Declaration").build("id","typeParameters","right").field("id",e("Identifier")).field("typeParameters",i(e("TypeParameterDeclaration"),null)).field("right",e("FlowType")),e("DeclareTypeAlias").bases("TypeAlias").build("id","typeParameters","right"),e("OpaqueType").bases("Declaration").build("id","typeParameters","impltype","supertype").field("id",e("Identifier")).field("typeParameters",i(e("TypeParameterDeclaration"),null)).field("impltype",e("FlowType")).field("supertype",i(e("FlowType"),null)),e("DeclareOpaqueType").bases("OpaqueType").build("id","typeParameters","supertype").field("impltype",i(e("FlowType"),null)),e("TypeCastExpression").bases("Expression").build("expression","typeAnnotation").field("expression",e("Expression")).field("typeAnnotation",e("TypeAnnotation")),e("TupleTypeAnnotation").bases("FlowType").build("types").field("types",[e("FlowType")]),e("DeclareVariable").bases("Statement").build("id").field("id",e("Identifier")),e("DeclareFunction").bases("Statement").build("id").field("id",e("Identifier")).field("predicate",i(e("FlowPredicate"),null),n.null),e("DeclareClass").bases("InterfaceDeclaration").build("id"),e("DeclareModule").bases("Statement").build("id","body").field("id",i(e("Identifier"),e("Literal"))).field("body",e("BlockStatement")),e("DeclareModuleExports").bases("Statement").build("typeAnnotation").field("typeAnnotation",e("TypeAnnotation")),e("DeclareExportDeclaration").bases("Declaration").build("default","declaration","specifiers","source").field("default",Boolean).field("declaration",i(e("DeclareVariable"),e("DeclareFunction"),e("DeclareClass"),e("FlowType"),e("TypeAlias"),e("DeclareOpaqueType"),e("InterfaceDeclaration"),null)).field("specifiers",[i(e("ExportSpecifier"),e("ExportBatchSpecifier"))],n.emptyArray).field("source",i(e("Literal"),null),n.null),e("DeclareExportAllDeclaration").bases("Declaration").build("source").field("source",i(e("Literal"),null),n.null),e("ImportDeclaration").field("importKind",i("value","type","typeof"),()=>"value"),e("FlowPredicate").bases("Flow"),e("InferredPredicate").bases("FlowPredicate").build(),e("DeclaredPredicate").bases("FlowPredicate").build("value").field("value",e("Expression")),e("Function").field("predicate",i(e("FlowPredicate"),null),n.null),e("CallExpression").field("typeArguments",i(null,e("TypeParameterInstantiation")),n.null),e("NewExpression").field("typeArguments",i(null,e("TypeParameterInstantiation")),n.null),e("EnumDeclaration").bases("Declaration").build("id","body").field("id",e("Identifier")).field("body",i(e("EnumBooleanBody"),e("EnumNumberBody"),e("EnumStringBody"),e("EnumSymbolBody"))),e("EnumBooleanBody").build("members","explicitType").field("members",[e("EnumBooleanMember")]).field("explicitType",Boolean),e("EnumNumberBody").build("members","explicitType").field("members",[e("EnumNumberMember")]).field("explicitType",Boolean),e("EnumStringBody").build("members","explicitType").field("members",i([e("EnumStringMember")],[e("EnumDefaultedMember")])).field("explicitType",Boolean),e("EnumSymbolBody").build("members").field("members",[e("EnumDefaultedMember")]),e("EnumBooleanMember").build("id","init").field("id",e("Identifier")).field("init",i(e("Literal"),Boolean)),e("EnumNumberMember").build("id","init").field("id",e("Identifier")).field("init",e("Literal")),e("EnumStringMember").build("id","init").field("id",e("Identifier")).field("init",e("Literal")),e("EnumDefaultedMember").build("id").field("id",e("Identifier"))}Be(()=>module);function YB(t){t.use(Fa);var r=t.use(it),e=t.use(pr).defaults,i=r.Type.def,n=r.Type.or;i("VariableDeclaration").field("declarations",[n(i("VariableDeclarator"),i("Identifier"))]),i("Property").field("value",n(i("Expression"),i("Pattern"))),i("ArrayPattern").field("elements",[n(i("Pattern"),i("SpreadElement"),null)]),i("ObjectPattern").field("properties",[n(i("Property"),i("PropertyPattern"),i("SpreadPropertyPattern"),i("SpreadProperty"))]),i("ExportSpecifier").bases("ModuleSpecifier").build("id","name"),i("ExportBatchSpecifier").bases("Specifier").build(),i("ExportDeclaration").bases("Declaration").build("default","declaration","specifiers","source").field("default",Boolean).field("declaration",n(i("Declaration"),i("Expression"),null)).field("specifiers",[n(i("ExportSpecifier"),i("ExportBatchSpecifier"))],e.emptyArray).field("source",n(i("Literal"),null),e.null),i("Block").bases("Comment").build("value","leading","trailing"),i("Line").bases("Comment").build("value","leading","trailing")}Be(()=>module);function bw(t){t.use(Fa);let r=t.use(it),e=t.use(pr).defaults,i=r.Type.def,n=r.Type.or,{undefined:s}=r.builtInTypes;i("Noop").bases("Statement").build(),i("DoExpression").bases("Expression").build("body").field("body",[i("Statement")]),i("BindExpression").bases("Expression").build("object","callee").field("object",n(i("Expression"),null)).field("callee",i("Expression")),i("ParenthesizedExpression").bases("Expression").build("expression").field("expression",i("Expression")),i("ExportNamespaceSpecifier").bases("Specifier").build("exported").field("exported",i("Identifier")),i("ExportDefaultSpecifier").bases("Specifier").build("exported").field("exported",i("Identifier")),i("CommentBlock").bases("Comment").build("value","leading","trailing"),i("CommentLine").bases("Comment").build("value","leading","trailing"),i("Directive").bases("Node").build("value").field("value",i("DirectiveLiteral")),i("DirectiveLiteral").bases("Node","Expression").build("value").field("value",String,e["use strict"]),i("InterpreterDirective").bases("Node").build("value").field("value",String),i("BlockStatement").bases("Statement").build("body").field("body",[i("Statement")]).field("directives",[i("Directive")],e.emptyArray),i("Program").bases("Node").build("body").field("body",[i("Statement")]).field("directives",[i("Directive")],e.emptyArray).field("interpreter",n(i("InterpreterDirective"),null),e.null);function o(c=String,p){return["extra",{rawValue:c,raw:String},function(){let h=r.getFieldValue(this,"value");return{rawValue:h,raw:p?p(h):String(h)}}]}i("StringLiteral").bases("Literal").build("value").field("value",String).field(...o(String,c=>JSON.stringify(c))),i("NumericLiteral").bases("Literal").build("value").field("value",Number).field("raw",n(String,null),e.null).field(...o(Number)),i("BigIntLiteral").bases("Literal").build("value").field("value",n(String,Number)).field(...o(String,c=>c+"n")),i("DecimalLiteral").bases("Literal").build("value").field("value",String).field(...o(String,c=>c+"m")),i("NullLiteral").bases("Literal").build().field("value",null,e.null),i("BooleanLiteral").bases("Literal").build("value").field("value",Boolean),i("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(n(RegExp,s),c=>`/${c.pattern}/${c.flags||""}`)).field("regex",{pattern:String,flags:String},function(){return{pattern:this.pattern,flags:this.flags}});var a=n(i("Property"),i("ObjectMethod"),i("ObjectProperty"),i("SpreadProperty"),i("SpreadElement"));i("ObjectExpression").bases("Expression").build("properties").field("properties",[a]),i("ObjectMethod").bases("Node","Function").build("kind","key","params","body","computed").field("kind",n("method","get","set")).field("key",n(i("Literal"),i("Identifier"),i("Expression"))).field("params",[i("Pattern")]).field("body",i("BlockStatement")).field("computed",Boolean,e.false).field("generator",Boolean,e.false).field("async",Boolean,e.false).field("accessibility",n(i("Literal"),null),e.null).field("decorators",n([i("Decorator")],null),e.null),i("ObjectProperty").bases("Node").build("key","value").field("key",n(i("Literal"),i("Identifier"),i("Expression"))).field("value",n(i("Expression"),i("Pattern"))).field("accessibility",n(i("Literal"),null),e.null).field("computed",Boolean,e.false);var l=n(i("MethodDefinition"),i("VariableDeclarator"),i("ClassPropertyDefinition"),i("ClassProperty"),i("ClassPrivateProperty"),i("ClassMethod"),i("ClassPrivateMethod"),i("ClassAccessorProperty"),i("StaticBlock"));i("ClassBody").bases("Declaration").build("body").field("body",[l]),i("ClassMethod").bases("Declaration","Function").build("kind","key","params","body","computed","static").field("key",n(i("Literal"),i("Identifier"),i("Expression"))),i("ClassPrivateMethod").bases("Declaration","Function").build("key","params","body","kind","computed","static").field("key",i("PrivateName")),i("ClassAccessorProperty").bases("Declaration").build("key","value","decorators","computed","static").field("key",n(i("Literal"),i("Identifier"),i("PrivateName"),i("Expression"))).field("value",n(i("Expression"),null),e.null),["ClassMethod","ClassPrivateMethod"].forEach(c=>{i(c).field("kind",n("get","set","method","constructor"),()=>"method").field("body",i("BlockStatement")).field("access",n("public","private","protected",null),e.null)}),["ClassMethod","ClassPrivateMethod","ClassAccessorProperty"].forEach(c=>{i(c).field("computed",Boolean,e.false).field("static",Boolean,e.false).field("abstract",Boolean,e.false).field("accessibility",n("public","private","protected",null),e.null).field("decorators",n([i("Decorator")],null),e.null).field("definite",Boolean,e.false).field("optional",Boolean,e.false).field("override",Boolean,e.false).field("readonly",Boolean,e.false)});var u=n(i("Property"),i("PropertyPattern"),i("SpreadPropertyPattern"),i("SpreadProperty"),i("ObjectProperty"),i("RestProperty"),i("RestElement"));i("ObjectPattern").bases("Pattern").build("properties").field("properties",[u]).field("decorators",n([i("Decorator")],null),e.null),i("SpreadProperty").bases("Node").build("argument").field("argument",i("Expression")),i("RestProperty").bases("Node").build("argument").field("argument",i("Expression")),i("ForAwaitStatement").bases("Statement").build("left","right","body").field("left",n(i("VariableDeclaration"),i("Expression"))).field("right",i("Expression")).field("body",i("Statement")),i("Import").bases("Expression").build()}Be(()=>module);function XB(t){let e=t.use(it).Type.def;t.use(bw),t.use(yw),e("V8IntrinsicIdentifier").bases("Expression").build("name").field("name",String),e("TopicReference").bases("Expression").build()}Be(()=>module);function QB(t){t.use(bw),t.use(gw);var r=t.use(it),e=r.namedTypes,i=r.Type.def,n=r.Type.or,s=t.use(pr).defaults,o=r.Type.from(function(c,p){return!!(e.StringLiteral&&e.StringLiteral.check(c,p)||e.Literal&&e.Literal.check(c,p)&&typeof c.value=="string")},"StringLiteral");i("TSType").bases("Node");var a=n(i("Identifier"),i("TSQualifiedName"));i("TSTypeReference").bases("TSType","TSHasOptionalTypeParameterInstantiation").build("typeName","typeParameters").field("typeName",a),i("TSHasOptionalTypeParameterInstantiation").field("typeParameters",n(i("TSTypeParameterInstantiation"),null),s.null),i("TSHasOptionalTypeParameters").field("typeParameters",n(i("TSTypeParameterDeclaration"),null,void 0),s.null),i("TSHasOptionalTypeAnnotation").field("typeAnnotation",n(i("TSTypeAnnotation"),null),s.null),i("TSQualifiedName").bases("Node").build("left","right").field("left",a).field("right",a),i("TSAsExpression").bases("Expression","Pattern").build("expression","typeAnnotation").field("expression",i("Expression")).field("typeAnnotation",i("TSType")).field("extra",n({parenthesized:Boolean},null),s.null),i("TSTypeCastExpression").bases("Expression").build("expression","typeAnnotation").field("expression",i("Expression")).field("typeAnnotation",i("TSType")),i("TSSatisfiesExpression").bases("Expression","Pattern").build("expression","typeAnnotation").field("expression",i("Expression")).field("typeAnnotation",i("TSType")),i("TSNonNullExpression").bases("Expression","Pattern").build("expression").field("expression",i("Expression")),["TSAnyKeyword","TSBigIntKeyword","TSBooleanKeyword","TSNeverKeyword","TSNullKeyword","TSNumberKeyword","TSObjectKeyword","TSStringKeyword","TSSymbolKeyword","TSUndefinedKeyword","TSUnknownKeyword","TSVoidKeyword","TSIntrinsicKeyword","TSThisType"].forEach(c=>{i(c).bases("TSType").build()}),i("TSArrayType").bases("TSType").build("elementType").field("elementType",i("TSType")),i("TSLiteralType").bases("TSType").build("literal").field("literal",n(i("NumericLiteral"),i("StringLiteral"),i("BooleanLiteral"),i("TemplateLiteral"),i("UnaryExpression"),i("BigIntLiteral"))),i("TemplateLiteral").field("expressions",n([i("Expression")],[i("TSType")])),["TSUnionType","TSIntersectionType"].forEach(c=>{i(c).bases("TSType").build("types").field("types",[i("TSType")])}),i("TSConditionalType").bases("TSType").build("checkType","extendsType","trueType","falseType").field("checkType",i("TSType")).field("extendsType",i("TSType")).field("trueType",i("TSType")).field("falseType",i("TSType")),i("TSInferType").bases("TSType").build("typeParameter").field("typeParameter",i("TSTypeParameter")),i("TSParenthesizedType").bases("TSType").build("typeAnnotation").field("typeAnnotation",i("TSType"));var l=[n(i("Identifier"),i("RestElement"),i("ArrayPattern"),i("ObjectPattern"))];["TSFunctionType","TSConstructorType"].forEach(c=>{i(c).bases("TSType","TSHasOptionalTypeParameters","TSHasOptionalTypeAnnotation").build("parameters").field("parameters",l)}),i("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",n(i("Identifier"),null),s.null).field("params",[i("Pattern")]).field("returnType",n(i("TSTypeAnnotation"),i("Noop"),null),s.null),i("TSDeclareMethod").bases("Declaration","TSHasOptionalTypeParameters").build("key","params","returnType").field("async",Boolean,s.false).field("generator",Boolean,s.false).field("params",[i("Pattern")]).field("abstract",Boolean,s.false).field("accessibility",n("public","private","protected",void 0),s.undefined).field("static",Boolean,s.false).field("computed",Boolean,s.false).field("optional",Boolean,s.false).field("key",n(i("Identifier"),i("StringLiteral"),i("NumericLiteral"),i("Expression"))).field("kind",n("get","set","method","constructor"),function(){return"method"}).field("access",n("public","private","protected",void 0),s.undefined).field("decorators",n([i("Decorator")],null),s.null).field("returnType",n(i("TSTypeAnnotation"),i("Noop"),null),s.null),i("TSMappedType").bases("TSType").build("typeParameter","typeAnnotation").field("readonly",n(Boolean,"+","-"),s.false).field("typeParameter",i("TSTypeParameter")).field("optional",n(Boolean,"+","-"),s.false).field("typeAnnotation",n(i("TSType"),null),s.null),i("TSTupleType").bases("TSType").build("elementTypes").field("elementTypes",[n(i("TSType"),i("TSNamedTupleMember"))]),i("TSNamedTupleMember").bases("TSType").build("label","elementType","optional").field("label",i("Identifier")).field("optional",Boolean,s.false).field("elementType",i("TSType")),i("TSRestType").bases("TSType").build("typeAnnotation").field("typeAnnotation",i("TSType")),i("TSOptionalType").bases("TSType").build("typeAnnotation").field("typeAnnotation",i("TSType")),i("TSIndexedAccessType").bases("TSType").build("objectType","indexType").field("objectType",i("TSType")).field("indexType",i("TSType")),i("TSTypeOperator").bases("TSType").build("operator").field("operator",String).field("typeAnnotation",i("TSType")),i("TSTypeAnnotation").bases("Node").build("typeAnnotation").field("typeAnnotation",n(i("TSType"),i("TSTypeAnnotation"))),i("TSIndexSignature").bases("Declaration","TSHasOptionalTypeAnnotation").build("parameters","typeAnnotation").field("parameters",[i("Identifier")]).field("readonly",Boolean,s.false),i("TSPropertySignature").bases("Declaration","TSHasOptionalTypeAnnotation").build("key","typeAnnotation","optional").field("key",i("Expression")).field("computed",Boolean,s.false).field("readonly",Boolean,s.false).field("optional",Boolean,s.false).field("initializer",n(i("Expression"),null),s.null),i("TSMethodSignature").bases("Declaration","TSHasOptionalTypeParameters","TSHasOptionalTypeAnnotation").build("key","parameters","typeAnnotation").field("key",i("Expression")).field("computed",Boolean,s.false).field("optional",Boolean,s.false).field("parameters",l),i("TSTypePredicate").bases("TSTypeAnnotation","TSType").build("parameterName","typeAnnotation","asserts").field("parameterName",n(i("Identifier"),i("TSThisType"))).field("typeAnnotation",n(i("TSTypeAnnotation"),null),s.null).field("asserts",Boolean,s.false),["TSCallSignatureDeclaration","TSConstructSignatureDeclaration"].forEach(c=>{i(c).bases("Declaration","TSHasOptionalTypeParameters","TSHasOptionalTypeAnnotation").build("parameters","typeAnnotation").field("parameters",l)}),i("TSEnumMember").bases("Node").build("id","initializer").field("id",n(i("Identifier"),o)).field("initializer",n(i("Expression"),null),s.null),i("TSTypeQuery").bases("TSType").build("exprName").field("exprName",n(a,i("TSImportType")));var u=n(i("TSCallSignatureDeclaration"),i("TSConstructSignatureDeclaration"),i("TSIndexSignature"),i("TSMethodSignature"),i("TSPropertySignature"));i("TSTypeLiteral").bases("TSType").build("members").field("members",[u]),i("TSTypeParameter").bases("Identifier").build("name","constraint","default").field("name",n(i("Identifier"),String)).field("constraint",n(i("TSType"),void 0),s.undefined).field("default",n(i("TSType"),void 0),s.undefined),i("TSTypeAssertion").bases("Expression","Pattern").build("typeAnnotation","expression").field("typeAnnotation",i("TSType")).field("expression",i("Expression")).field("extra",n({parenthesized:Boolean},null),s.null),i("TSTypeParameterDeclaration").bases("Declaration").build("params").field("params",[i("TSTypeParameter")]),i("TSInstantiationExpression").bases("Expression","TSHasOptionalTypeParameterInstantiation").build("expression","typeParameters").field("expression",i("Expression")),i("TSTypeParameterInstantiation").bases("Node").build("params").field("params",[i("TSType")]),i("TSEnumDeclaration").bases("Declaration").build("id","members").field("id",i("Identifier")).field("const",Boolean,s.false).field("declare",Boolean,s.false).field("members",[i("TSEnumMember")]).field("initializer",n(i("Expression"),null),s.null),i("TSTypeAliasDeclaration").bases("Declaration","TSHasOptionalTypeParameters").build("id","typeAnnotation").field("id",i("Identifier")).field("declare",Boolean,s.false).field("typeAnnotation",i("TSType")),i("TSModuleBlock").bases("Node").build("body").field("body",[i("Statement")]),i("TSModuleDeclaration").bases("Declaration").build("id","body").field("id",n(o,a)).field("declare",Boolean,s.false).field("global",Boolean,s.false).field("body",n(i("TSModuleBlock"),i("TSModuleDeclaration"),null),s.null),i("TSImportType").bases("TSType","TSHasOptionalTypeParameterInstantiation").build("argument","qualifier","typeParameters").field("argument",o).field("qualifier",n(a,void 0),s.undefined),i("TSImportEqualsDeclaration").bases("Declaration").build("id","moduleReference").field("id",i("Identifier")).field("isExport",Boolean,s.false).field("moduleReference",n(a,i("TSExternalModuleReference"))),i("TSExternalModuleReference").bases("Declaration").build("expression").field("expression",o),i("TSExportAssignment").bases("Statement").build("expression").field("expression",i("Expression")),i("TSNamespaceExportDeclaration").bases("Declaration").build("id").field("id",i("Identifier")),i("TSInterfaceBody").bases("Node").build("body").field("body",[u]),i("TSExpressionWithTypeArguments").bases("TSType","TSHasOptionalTypeParameterInstantiation").build("expression","typeParameters").field("expression",a),i("TSInterfaceDeclaration").bases("Declaration","TSHasOptionalTypeParameters").build("id","body").field("id",a).field("declare",Boolean,s.false).field("extends",n([i("TSExpressionWithTypeArguments")],null),s.null).field("body",i("TSInterfaceBody")),i("TSParameterProperty").bases("Pattern").build("parameter").field("accessibility",n("public","private","protected",void 0),s.undefined).field("readonly",Boolean,s.false).field("parameter",n(i("Identifier"),i("AssignmentPattern"))),i("ClassProperty").field("access",n("public","private","protected",void 0),s.undefined),i("ClassAccessorProperty").bases("Declaration","TSHasOptionalTypeAnnotation"),i("ClassBody").field("body",[n(i("MethodDefinition"),i("VariableDeclarator"),i("ClassPropertyDefinition"),i("ClassProperty"),i("ClassPrivateProperty"),i("ClassAccessorProperty"),i("ClassMethod"),i("ClassPrivateMethod"),i("StaticBlock"),i("TSDeclareMethod"),u)])}Be(()=>module);var Ur;Ur||(Ur={});var{astNodesAreEquivalent:wW,builders:Js,builtInTypes:jr,defineMethod:TW,eachField:AW,finalize:PW,getBuilderName:IW,getFieldNames:ZB,getFieldValue:Gi,getSupertypeNames:_W,namedTypes:e3,NodePath:t3,Path:NW,PathVisitor:FW,someField:r3,Type:kW,use:OW,visit:RW}=MB([Fa,JB,yw,YB,XB,QB]);Object.assign(Ur,e3);var $u=Ur,Jv=ec.default.SourceMapConsumer,i3=ec.default.SourceMapGenerator,Dw=Object.prototype.hasOwnProperty;function n3(){return`
|
|
1089
1089
|
`}function Yv(t,r,e){return t&&Dw.call(t,r)?t[r]:e}function s3(...t){let r={},e=t.length;for(let i=0;i<e;++i){let n=Object.keys(t[i]),s=n.length;for(let o=0;o<s;++o)r[n[o]]=!0}return r}function Te(t,r){return t.line-r.line||t.column-r.column}function xn(t){return{line:t.line,column:t.column}}function o3(t,r){if(t){if(!r)return t}else return r||null;let e=new Jv(t),i=new Jv(r),n=new i3({file:r.file,sourceRoot:r.sourceRoot}),s={};return i.eachMapping(function(o){let a=e.originalPositionFor({line:o.originalLine,column:o.originalColumn}),l=a.source;if(l===null)return;n.addMapping({source:l,original:xn(a),generated:{line:o.generatedLine,column:o.generatedColumn},name:o.name});let u=e.sourceContentFor(l);u&&!Dw.call(s,l)&&(s[l]=u,n.setSourceContent(l,u))}),n.toJSON()}function xw(t,r){if(!t.loc)return null;let e={start:t.loc.start,end:t.loc.end};function i(n){Ch(e,n.loc)}return t.declaration&&t.declaration.decorators&&tc(t)&&t.declaration.decorators.forEach(i),Te(e.start,e.end)<0&&(e.start=xn(e.start),r.skipSpaces(e.start,!1,!0),Te(e.start,e.end)<0&&(e.end=xn(e.end),r.skipSpaces(e.end,!0,!0))),t.comments&&t.comments.forEach(i),e}function Ch(t,r){t&&r&&(Te(r.start,t.start)<0&&(t.start=r.start),Te(t.end,r.end)<0&&(t.end=r.end))}function Fh(t,r){let e=t.loc;if(e&&(e.start.line<1&&(e.start.line=1),e.end.line<1&&(e.end.line=1)),t.type==="File"&&(e.start=r.firstPos(),e.end=r.lastPos()),a3(t,r),l3(t,r),e&&t.decorators)t.decorators.forEach(function(i){Ch(e,i.loc)});else if(t.declaration&&tc(t)){t.declaration.loc=null;let i=t.declaration.decorators;i&&i.forEach(function(n){Ch(e,n.loc)})}else if($u.MethodDefinition&&$u.MethodDefinition.check(t)||$u.Property.check(t)&&(t.method||t.shorthand))t.value.loc=null,$u.FunctionExpression.check(t.value)&&(t.value.id=null);else if(t.type==="ObjectTypeProperty"){let i=t.loc,n=i&&i.end;n&&(n=xn(n),r.prevPos(n)&&r.charAt(n)===","&&(n=r.skipSpaces(n,!0,!0))&&(i.end=n))}}function a3(t,r){if(t.type!=="ForStatement")return;function e(i){let n=i&&i.loc,s=n&&n.start,o=n&&xn(n.end);for(;s&&o&&Te(s,o)<0&&(r.prevPos(o),r.charAt(o)===";");)n.end.line=o.line,n.end.column=o.column}e(t.init),e(t.test),e(t.update)}function l3(t,r){if(t.type==="TemplateLiteral"&&t.quasis.length!==0){if(t.loc){let e=xn(t.loc.start),i=t.quasis[0];Te(i.loc.start,e)<0&&(i.loc.start=e);let n=xn(t.loc.end),s=t.quasis[t.quasis.length-1];Te(n,s.loc.end)<0&&(s.loc.end=n)}t.expressions.forEach(function(e,i){let n=r.skipSpaces(e.loc.start,!0,!1);if(r.prevPos(n)&&r.charAt(n)==="{"&&r.prevPos(n)&&r.charAt(n)==="$"){let o=t.quasis[i];Te(n,o.loc.end)<0&&(o.loc.end=n)}let s=r.skipSpaces(e.loc.end,!1,!1);if(r.charAt(s)==="}"){let o=t.quasis[i+1];Te(o.loc.start,s)<0&&(o.loc.start=s)}})}}function tc(t){if(t)switch(t.type){case"ExportDeclaration":case"ExportDefaultDeclaration":case"ExportDefaultSpecifier":case"DeclareExportDeclaration":case"ExportNamedDeclaration":case"ExportAllDeclaration":return!0}return!1}function Ew(t){let r=t.getParentNode();return t.getName()==="declaration"&&tc(r)?r:null}function Aa(t,r){let e=t.trailingComma;return typeof e=="object"?!!e[r]:!!e}var Sh={tabWidth:4,useTabs:!1,reuseWhitespace:!0,lineTerminator:n3(),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},u3=Sh.hasOwnProperty;function rc(t){let r=t||Sh;function e(i){return u3.call(r,i)?r[i]:Sh[i]}return{tabWidth:+e("tabWidth"),useTabs:!!e("useTabs"),reuseWhitespace:!!e("reuseWhitespace"),lineTerminator:e("lineTerminator"),wrapColumn:Math.max(e("wrapColumn"),0),sourceFileName:e("sourceFileName"),sourceMapName:e("sourceMapName"),sourceRoot:e("sourceRoot"),inputSourceMap:e("inputSourceMap"),parser:e("esprima")||e("parser"),range:e("range"),tolerant:e("tolerant"),quote:e("quote"),trailingComma:e("trailingComma"),arrayBracketSpacing:e("arrayBracketSpacing"),objectCurlySpacing:e("objectCurlySpacing"),arrowParensAlways:e("arrowParensAlways"),flowObjectCommas:e("flowObjectCommas"),tokens:!!e("tokens")}}var vh=class t{constructor(r,e,i=e){this.sourceLines=r,this.sourceLoc=e,this.targetLoc=i}slice(r,e,i=r.lastPos()){let n=this.sourceLines,s=this.sourceLoc,o=this.targetLoc;function a(l){let u=s[l],c=o[l],p=e;return l==="end"&&(p=i),c3(n,u,r,c,p)}if(Te(e,o.start)<=0)if(Te(o.end,i)<=0)o={start:Dn(o.start,e.line,e.column),end:Dn(o.end,e.line,e.column)};else{if(Te(i,o.start)<=0)return null;s={start:s.start,end:a("end")},o={start:Dn(o.start,e.line,e.column),end:Dn(i,e.line,e.column)}}else{if(Te(o.end,e)<=0)return null;Te(o.end,i)<=0?(s={start:a("start"),end:s.end},o={start:{line:1,column:0},end:Dn(o.end,e.line,e.column)}):(s={start:a("start"),end:a("end")},o={start:{line:1,column:0},end:Dn(i,e.line,e.column)})}return new t(this.sourceLines,s,o)}add(r,e){return new t(this.sourceLines,this.sourceLoc,{start:Xv(this.targetLoc.start,r,e),end:Xv(this.targetLoc.end,r,e)})}subtract(r,e){return new t(this.sourceLines,this.sourceLoc,{start:Dn(this.targetLoc.start,r,e),end:Dn(this.targetLoc.end,r,e)})}indent(r,e=!1,i=!1){if(r===0)return this;let n=this.targetLoc,s=n.start.line,o=n.end.line;if(e&&s===1&&o===1)return this;if(n={start:n.start,end:n.end},!e||s>1){let a=n.start.column+r;n.start={line:s,column:i?Math.max(0,a):a}}if(!e||o>1){let a=n.end.column+r;n.end={line:o,column:i?Math.max(0,a):a}}return new t(this.sourceLines,this.sourceLoc,n)}};function Xv(t,r,e){return{line:t.line+r-1,column:t.line===1?t.column+e:t.column}}function Dn(t,r,e){return{line:t.line-r+1,column:t.line===r?t.column-e:t.column}}function c3(t,r,e,i,n){let s=Te(i,n);if(s===0)return r;let o,a;if(s<0){o=t.skipSpaces(r)||t.lastPos(),a=e.skipSpaces(i)||e.lastPos();let l=n.line-a.line;for(o.line+=l,a.line+=l,l>0&&(o.column=0,a.column=0);Te(a,n)<0&&e.nextPos(a,!0););}else{o=t.skipSpaces(r,!0)||t.firstPos(),a=e.skipSpaces(i,!0)||e.firstPos();let l=n.line-a.line;for(o.line+=l,a.line+=l,l<0&&(o.column=t.getLineLength(o.line),a.column=e.getLineLength(a.line));Te(n,a)<0&&e.prevPos(a,!0););}return o}var p3=Object.defineProperty,d3=(t,r,e)=>r in t?p3(t,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[r]=e,xa=(t,r,e)=>(d3(t,typeof r!="symbol"?r+"":r,e),e),Gs=class t{constructor(r,e=null){this.infos=r,xa(this,"length"),xa(this,"name"),xa(this,"mappings",[]),xa(this,"cachedSourceMap",null),xa(this,"cachedTabWidth"),this.length=r.length,this.name=e||null,this.name&&this.mappings.push(new vh(this,{start:this.firstPos(),end:this.lastPos()}))}toString(r){return this.sliceString(this.firstPos(),this.lastPos(),r)}getSourceMap(r,e){if(!r)return null;let i=this;function n(a){return a=a||{},a.file=r,e&&(a.sourceRoot=e),a}if(i.cachedSourceMap)return n(i.cachedSourceMap.toJSON());let s=new ec.default.SourceMapGenerator(n()),o={};return i.mappings.forEach(function(a){let l=a.sourceLines.skipSpaces(a.sourceLoc.start)||a.sourceLines.lastPos(),u=i.skipSpaces(a.targetLoc.start)||i.lastPos();for(;Te(l,a.sourceLoc.end)<0&&Te(u,a.targetLoc.end)<0;){a.sourceLines.charAt(l),i.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}}),!wh.call(o,c)){let p=a.sourceLines.toString();s.setSourceContent(c,p),o[c]=p}i.nextPos(u,!0),a.sourceLines.nextPos(l,!0)}}),i.cachedSourceMap=s,s.toJSON()}bootstrapCharAt(r){let e=r.line,i=r.column,n=this.toString().split(Th),s=n[e-1];return typeof s>"u"?"":i===s.length&&e<n.length?`
|
|
1090
1090
|
`:i>=s.length?"":s.charAt(i)}charAt(r){let e=r.line,i=r.column,n=this,s=n.infos,o=s[e-1],a=i;if(typeof o>"u"||a<0)return"";let l=this.getIndentAt(e);return a<l?" ":(a+=o.sliceStart-l,a===o.sliceEnd&&e<this.length?`
|
|
1091
1091
|
`:a>=o.sliceEnd?"":o.line.charAt(a))}stripMargin(r,e){if(r===0)return this;if(e&&this.length===1)return this;let i=new t(this.infos.map(function(n,s){return n.line&&(s>0||!e)&&(n={...n,indent:Math.max(0,n.indent-r)}),n}));if(this.mappings.length>0){let n=i.mappings;this.mappings.forEach(function(s){n.push(s.indent(r,e,!0))})}return i}indent(r){if(r===0)return this;let e=new t(this.infos.map(function(i){return i.line&&!i.locked&&(i={...i,indent:i.indent+r}),i}));if(this.mappings.length>0){let i=e.mappings;this.mappings.forEach(function(n){i.push(n.indent(r))})}return e}indentTail(r){if(r===0)return this;if(this.length<2)return this;let e=new t(this.infos.map(function(i,n){return n>0&&i.line&&!i.locked&&(i={...i,indent:i.indent+r}),i}));if(this.mappings.length>0){let i=e.mappings;this.mappings.forEach(function(n){i.push(n.indent(r,!0))})}return e}lockIndentTail(){return this.length<2?this:new t(this.infos.map((r,e)=>({...r,locked:e>0})))}getIndentAt(r){return Math.max(this.infos[r-1].indent,0)}guessTabWidth(){if(typeof this.cachedTabWidth=="number")return this.cachedTabWidth;let r=[],e=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(Ks(l))continue;let u=Math.abs(a.indent-e);r[u]=~~r[u]+1,e=a.indent}let i=-1,n=2;for(let s=1;s<r.length;s+=1)wh.call(r,s)&&r[s]>i&&(i=r[s],n=s);return this.cachedTabWidth=n}startsWithComment(){if(this.infos.length===0)return!1;let r=this.infos[0],e=r.sliceStart,i=r.sliceEnd,n=r.line.slice(e,i).trim();return n.length===0||n.slice(0,2)==="//"||n.slice(0,2)==="/*"}isOnlyWhitespace(){return Ks(this.toString())}isPrecededOnlyByWhitespace(r){let e=this.infos[r.line-1],i=Math.max(e.indent,0),n=r.column-i;if(n<=0)return!0;let s=e.sliceStart,o=Math.min(s+n,e.sliceEnd),a=e.line.slice(s,o);return Ks(a)}getLineLength(r){let e=this.infos[r-1];return this.getIndentAt(r)+e.sliceEnd-e.sliceStart}nextPos(r,e=!1){let i=Math.max(r.line,0);return Math.max(r.column,0)<this.getLineLength(i)?(r.column+=1,e?!!this.skipSpaces(r,!1,!0):!0):i<this.length?(r.line+=1,r.column=0,e?!!this.skipSpaces(r,!1,!0):!0):!1}prevPos(r,e=!1){let i=r.line,n=r.column;if(n<1){if(i-=1,i<1)return!1;n=this.getLineLength(i)}else n=Math.min(n-1,this.getLineLength(i));return r.line=i,r.column=n,e?!!this.skipSpaces(r,!0,!0):!0}firstPos(){return{line:1,column:0}}lastPos(){return{line:this.length,column:this.getLineLength(this.length)}}skipSpaces(r,e=!1,i=!1){if(r?r=i?r:{line:r.line,column:r.column}:e?r=this.lastPos():r=this.firstPos(),e){for(;this.prevPos(r);)if(!Ks(this.charAt(r))&&this.nextPos(r))return r;return null}else{for(;Ks(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):Yn}trimRight(){let r=this.skipSpaces(this.lastPos(),!0,!0);return r?this.slice(this.firstPos(),r):Yn}trim(){let r=this.skipSpaces(this.firstPos(),!1,!0);if(r===null)return Yn;let e=this.skipSpaces(this.lastPos(),!0,!0);return e===null?Yn:this.slice(r,e)}eachPos(r,e=this.firstPos(),i=!1){let n=this.firstPos();if(e&&(n.line=e.line,n.column=e.column),!(i&&!this.skipSpaces(n,!1,!0)))do r.call(this,n);while(this.nextPos(n,i))}bootstrapSlice(r,e){let i=this.toString().split(Th).slice(r.line-1,e.line);return i.length>0&&(i.push(i.pop().slice(0,e.column)),i[0]=i[0].slice(r.column)),I(i.join(`
|
|
@@ -1093,7 +1093,7 @@ module.exports = nextConfig
|
|
|
1093
1093
|
`);else if(n instanceof Gs){let o=n.slice(i.end,n.skipSpaces(i.end)||n.lastPos());o.length===1?s.push(o):s.push(new Array(o.length).join(`
|
|
1094
1094
|
`))}else s.push(`
|
|
1095
1095
|
`);return v(s)}function D3(t,r){let e=t.getValue(t);Hs.Comment.assert(e);let i=e.loc,n=i&&i.lines,s=[];if(n instanceof Gs){let o=n.skipSpaces(i.start,!0)||n.firstPos(),a=n.slice(o,i.start);a.length===1?s.push(a):s.push(new Array(a.length).join(`
|
|
1096
|
-
`))}return s.push(r(t)),v(s)}function Zv(t,r){let e=t.getValue(),i=r(t),n=Hs.Node.check(e)&&Gi(e,"comments");if(!n||n.length===0)return i;let s=[],o=[i];return t.each(function(a){let l=a.getValue(),u=Gi(l,"leading"),c=Gi(l,"trailing");u||c&&!(Hs.Statement.check(e)||l.type==="Block"||l.type==="CommentBlock")?s.push(b3(a,r)):c&&o.push(D3(a,r))},"comments"),s.push.apply(s,o),v(s)}var x3=Js,E3=jr.object,C3=jr.array;function Pw(t,r){r=rc(r);let e=I(t,r),i=e.toString({tabWidth:r.tabWidth,reuseWhitespace:!1,useTabs:!1}),n=[],s=r.parser.parse(i,{jsx:!0,loc:!0,locations:!0,range:r.range,comment:!0,onComment:n,tolerant:Yv(r,"tolerant",!0),ecmaVersion:6,sourceType:Yv(r,"sourceType","module")}),o=Array.isArray(s.tokens)?s.tokens:!1;delete s.tokens,o.forEach(function(c){typeof c.value!="string"&&(c.value=e.sliceString(c.loc.start,c.loc.end))}),Array.isArray(s.comments)&&(n=s.comments,delete s.comments),s.loc?Fh(s,e):s.loc={start:e.firstPos(),end:e.lastPos()},s.loc.lines=e,s.loc.indent=0;let a,l;s.type==="Program"?(l=s,a=x3.file(s,r.sourceFileName||null),a.loc={start:e.firstPos(),end:e.lastPos(),lines:e,indent:0}):s.type==="File"&&(a=s,l=a.program),r.tokens&&(a.tokens=o);let u=xw({type:l.type,loc:l.loc,body:[],comments:n},e);return l.loc.start=u.start,l.loc.end=u.end,g3(n,l.body.length?a.program:a,e),new Iw(e,o).copy(a)}var Iw=function(r,e){this.lines=r,this.tokens=e,this.startTokenIndex=0,this.endTokenIndex=e.length,this.indent=0,this.seen=new Map},_w=Iw.prototype;_w.copy=function(t){if(this.seen.has(t))return this.seen.get(t);if(C3.check(t)){let u=new Array(t.length);return this.seen.set(t,u),t.forEach(function(c,p){u[p]=this.copy(c)},this),u}if(!E3.check(t))return t;Fh(t,this.lines);let r=Object.create(Object.getPrototypeOf(t),{original:{value:t,configurable:!1,enumerable:!1,writable:!0}});this.seen.set(t,r);let e=t.loc,i=this.indent,n=i,s=this.startTokenIndex,o=this.endTokenIndex;e&&((t.type==="Block"||t.type==="Line"||t.type==="CommentBlock"||t.type==="CommentLine"||this.lines.isPrecededOnlyByWhitespace(e.start))&&(n=this.indent=e.start.column),e.lines=this.lines,e.tokens=this.tokens,e.indent=n,this.findTokenRange(e));let a=Object.keys(t),l=a.length;for(let u=0;u<l;++u){let c=a[u];c==="loc"||c==="tokens"&&t.type==="File"?r[c]=t[c]:r[c]=this.copy(t[c])}return this.indent=i,this.startTokenIndex=s,this.endTokenIndex=o,r};_w.findTokenRange=function(t){for(;this.startTokenIndex>0;){let r=t.tokens[this.startTokenIndex];if(Te(t.start,r.loc.start)<0)--this.startTokenIndex;else break}for(;this.endTokenIndex<t.tokens.length;){let r=t.tokens[this.endTokenIndex];if(Te(r.loc.end,t.end)<0)++this.endTokenIndex;else break}for(;this.startTokenIndex<this.endTokenIndex;){let r=t.tokens[this.startTokenIndex];if(Te(r.loc.start,t.start)<0)++this.startTokenIndex;else break}for(t.start.token=this.startTokenIndex;this.endTokenIndex>this.startTokenIndex;){let r=t.tokens[this.endTokenIndex-1];if(Te(t.end,r.loc.end)<0)--this.endTokenIndex;else break}t.end.token=this.endTokenIndex};var He=Ur,S3=jr.array,v3=jr.number,Ah={};[["??"],["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"],["**"]].forEach(function(t,r){t.forEach(function(e){Ah[e]=r})});var $r=function(r){this.stack=[r]},kt=$r.prototype;$r.from=function(t){if(t instanceof $r)return t.copy();if(t instanceof t3){let r=Object.create($r.prototype),e=[t.value];for(let i;i=t.parentPath;t=i)e.push(t.name,i.value);return r.stack=e.reverse(),r}return new $r(t)};kt.copy=function(){let r=Object.create($r.prototype);return r.stack=this.stack.slice(0),r};kt.getName=function(){let r=this.stack,e=r.length;return e>1?r[e-2]:null};kt.getValue=function(){let r=this.stack;return r[r.length-1]};kt.valueIsDuplicate=function(){let t=this.stack,r=t.length-1;return t.lastIndexOf(t[r],r-1)>=0};function Nw(t,r){let e=t.stack;for(let i=e.length-1;i>=0;i-=2){let n=e[i];if(He.Node.check(n)&&--r<0)return n}return null}kt.getNode=function(r=0){return Nw(this,~~r)};kt.getParentNode=function(r=0){return Nw(this,~~r+1)};kt.getRootValue=function(){let r=this.stack;return r.length%2===0?r[1]:r[0]};kt.call=function(r){let e=this.stack,i=e.length,n=e[i-1],s=arguments.length;for(let a=1;a<s;++a){let l=arguments[a];n=n[l],e.push(l,n)}let o=r(this);return e.length=i,o};kt.each=function(r){let e=this.stack,i=e.length,n=e[i-1],s=arguments.length;for(let o=1;o<s;++o){let a=arguments[o];n=n[a],e.push(a,n)}for(let o=0;o<n.length;++o)o in n&&(e.push(o,n[o]),r(this),e.length-=2);e.length=i};kt.map=function(r){let e=this.stack,i=e.length,n=e[i-1],s=arguments.length;for(let a=1;a<s;++a){let l=arguments[a];n=n[l],e.push(l,n)}let o=new Array(n.length);for(let a=0;a<n.length;++a)a in n&&(e.push(a,n[a]),o[a]=r(this,a),e.length-=2);return e.length=i,o};kt.hasParens=function(){let t=this.getNode(),r=this.getPrevToken(t);if(!r)return!1;let e=this.getNextToken(t);return e?!!(r.value==="("&&(e.value===")"||!this.canBeFirstInStatement()&&this.firstInStatement()&&!this.needsParens(!0))):!1};kt.getPrevToken=function(t){t=t||this.getNode();let r=t&&t.loc,e=r&&r.tokens;if(e&&r.start.token>0){let i=e[r.start.token-1];if(i){let n=this.getRootValue().loc;if(Te(n.start,i.loc.start)<=0)return i}}return null};kt.getNextToken=function(t){t=t||this.getNode();let r=t&&t.loc,e=r&&r.tokens;if(e&&r.end.token<e.length){let i=e[r.end.token];if(i){let n=this.getRootValue().loc;if(Te(i.loc.end,n.end)<=0)return i}}return null};kt.needsParens=function(t){let r=this.getNode();if(r.type==="AssignmentExpression"&&r.left.type==="ObjectPattern")return!0;let e=this.getParentNode(),i=this.getName();if(this.getValue()!==r||He.Statement.check(r)||r.type==="Identifier"||e&&e.type==="ParenthesizedExpression")return!1;if(r.extra&&r.extra.parenthesized)return!0;if(!e)return!1;if(r.type==="UnaryExpression"&&e.type==="BinaryExpression"&&i==="left"&&e.left===r&&e.operator==="**")return!0;switch(r.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return e.type==="MemberExpression"&&i==="object"&&e.object===r;case"BinaryExpression":case"LogicalExpression":switch(e.type){case"CallExpression":return i==="callee"&&e.callee===r;case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return!0;case"MemberExpression":return i==="object"&&e.object===r;case"BinaryExpression":case"LogicalExpression":{let n=e.operator,s=Ah[n],o=r.operator,a=Ah[o];if(s>a||s===a&&i==="right")return!0;break}default:return!1}break;case"SequenceExpression":switch(e.type){case"ReturnStatement":return!1;case"ForStatement":return!1;case"ExpressionStatement":return i!=="expression";default:return!0}case"OptionalIndexedAccessType":return r.optional&&e.type==="IndexedAccessType";case"IntersectionTypeAnnotation":case"UnionTypeAnnotation":return e.type==="NullableTypeAnnotation";case"Literal":return e.type==="MemberExpression"&&v3.check(r.value)&&i==="object"&&e.object===r;case"NumericLiteral":return e.type==="MemberExpression"&&i==="object"&&e.object===r;case"YieldExpression":case"AwaitExpression":case"AssignmentExpression":case"ConditionalExpression":switch(e.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"BinaryExpression":case"LogicalExpression":return!0;case"CallExpression":case"NewExpression":return i==="callee"&&e.callee===r;case"ConditionalExpression":return i==="test"&&e.test===r;case"MemberExpression":return i==="object"&&e.object===r;default:return!1}case"ArrowFunctionExpression":return He.CallExpression.check(e)&&i==="callee"&&e.callee===r||He.MemberExpression.check(e)&&i==="object"&&e.object===r||He.TSAsExpression&&He.TSAsExpression.check(e)&&i==="expression"&&e.expression===r?!0:Fw(e);case"ObjectExpression":if(e.type==="ArrowFunctionExpression"&&i==="body"&&e.body===r)return!0;break;case"TSAsExpression":if(e.type==="ArrowFunctionExpression"&&i==="body"&&e.body===r&&r.expression.type==="ObjectExpression")return!0;break;case"CallExpression":if(i==="declaration"&&He.ExportDefaultDeclaration.check(e)&&He.FunctionExpression.check(r.callee))return!0}return e.type==="NewExpression"&&i==="callee"&&e.callee===r?Ph(r):!!(t!==!0&&!this.canBeFirstInStatement()&&this.firstInStatement())};function Fw(t){return He.BinaryExpression.check(t)||He.LogicalExpression.check(t)}function Ph(t){return He.CallExpression.check(t)?!0:S3.check(t)?t.some(Ph):He.Node.check(t)?r3(t,(r,e)=>Ph(e)):!1}kt.canBeFirstInStatement=function(){let t=this.getNode();return!(He.FunctionExpression.check(t)||He.ObjectExpression.check(t)||He.ClassExpression.check(t))};kt.firstInStatement=function(){let t=this.stack,r,e,i,n;for(let s=t.length-1;s>=0;s-=2)if(He.Node.check(t[s])&&(i=r,n=e,r=t[s-1],e=t[s]),!(!e||!n)){if(He.BlockStatement.check(e)&&r==="body"&&i===0||He.ExpressionStatement.check(e)&&i==="expression"||He.AssignmentExpression.check(e)&&i==="left"||He.ArrowFunctionExpression.check(e)&&i==="body")return!0;if(!(He.SequenceExpression.check(e)&&t[s+1]==="expressions"&&i===0)&&!(He.CallExpression.check(e)&&i==="callee")&&!(He.MemberExpression.check(e)&&i==="object")&&!(He.ConditionalExpression.check(e)&&i==="test")&&!(Fw(e)&&i==="left")&&!(He.UnaryExpression.check(e)&&!e.prefix&&i==="argument"))return!1}return!0};var Ia=Ur.Printable,ew=Ur.Expression,w3=Ur.ReturnStatement,T3=Ur.SourceLocation,_a=jr.object,Ih=jr.array,A3=jr.string,Qu=/[0-9a-z_$]/i,kw=function(r){let e=this,i=[];e.replace=function(n,s){A3.check(s)&&(s=I(s)),i.push({lines:s,start:n.start,end:n.end})},e.get=function(n){n=n||{start:{line:1,column:0},end:{line:r.length,column:r.getLineLength(r.length)}};let s=n.start,o=[];function a(l,u){o.push(r.slice(l,u))}return i.sort((l,u)=>Te(l.start,u.start)).forEach(function(l){Te(s,l.start)>0||(a(s,l.start),o.push(l.lines),s=l.end)}),a(s,n.end),v(o)}},Ow=kw.prototype;Ow.tryToReprintComments=function(t,r,e){let i=this;if(!t.comments&&!r.comments)return!0;let n=$r.from(t),s=$r.from(r);n.stack.push("comments",tw(t)),s.stack.push("comments",tw(r));let o=[],a=Lw(n,s,o);return a&&o.length>0&&o.forEach(function(l){let u=l.oldPath.getValue();i.replace(u.loc,e(l.newPath).indentTail(u.loc.indent))}),a};function tw(t){let r=[];return t.comments&&t.comments.length>0&&t.comments.forEach(function(e){(e.leading||e.trailing)&&r.push(e)}),r}Ow.deleteComments=function(t){if(!t.comments)return;let r=this;t.comments.forEach(function(e){e.leading?r.replace({start:e.loc.start,end:t.loc.lines.skipSpaces(e.loc.end,!1,!1)},""):e.trailing&&r.replace({start:t.loc.lines.skipSpaces(e.loc.start,!0,!1),end:e.loc.end},"")})};function P3(t){let r=t.getValue();if(!Ia.check(r))return;let e=r.original,i=e&&e.loc,n=i&&i.lines,s=[];if(!(!n||!N3(t,s)))return function(o){let a=new kw(n);s.forEach(function(u){let c=u.newPath.getValue(),p=u.oldPath.getValue();T3.assert(p.loc,!0);let d=!a.tryToReprintComments(c,p,o);d&&a.deleteComments(p);let h=o(u.newPath,{includeComments:d,avoidRootParens:p.type===c.type&&u.oldPath.hasParens()}).indentTail(p.loc.indent),f=I3(n,p.loc,h),g=_3(n,p.loc,h);if(f||g){let m=[];f&&m.push(" "),m.push(h),g&&m.push(" "),h=v(m)}a.replace(p.loc,h)});let l=a.get(i).indentTail(-e.loc.indent);return t.needsParens()?v(["(",l,")"]):l}}function I3(t,r,e){let i=xn(r.start),n=t.prevPos(i)&&t.charAt(i),s=e.charAt(e.firstPos());return n&&Qu.test(n)&&s&&Qu.test(s)}function _3(t,r,e){let i=t.charAt(r.end),n=e.lastPos(),s=e.prevPos(n)&&e.charAt(n);return s&&Qu.test(s)&&i&&Qu.test(i)}function N3(t,r){let e=t.getValue();Ia.assert(e);let i=e.original;if(Ia.assert(i),e.type!==i.type)return!1;let n=new $r(i),s=_h(t,n,r);return s||(r.length=0),s}function Rw(t,r,e){let i=t.getValue(),n=r.getValue();return i===n?!0:Ih.check(i)?Lw(t,r,e):_a.check(i)?F3(t,r,e):!1}function Lw(t,r,e){let i=t.getValue(),n=r.getValue();if(i===n||t.valueIsDuplicate()||r.valueIsDuplicate())return!0;Ih.assert(i);let s=i.length;if(!(Ih.check(n)&&n.length===s))return!1;for(let o=0;o<s;++o){t.stack.push(o,i[o]),r.stack.push(o,n[o]);let a=Rw(t,r,e);if(t.stack.length-=2,r.stack.length-=2,!a)return!1}return!0}function F3(t,r,e){let i=t.getValue();if(_a.assert(i),i.original===null)return!1;let n=r.getValue();if(!_a.check(n))return!1;if(i===n||t.valueIsDuplicate()||r.valueIsDuplicate())return!0;if(Ia.check(i)){if(!Ia.check(n))return!1;let s=t.getParentNode(),o=r.getParentNode();if(o!==null&&o.type==="FunctionTypeAnnotation"&&s!==null&&s.type==="FunctionTypeAnnotation"){let a=o.params.length!==1||!!o.params[0].name,l=s.params.length!==1||!!s.params[0].name;if(!a&&l)return!1}if(i.type===n.type){let a=[];if(_h(t,r,a))e.push.apply(e,a);else if(n.loc)e.push({oldPath:r.copy(),newPath:t.copy()});else return!1;return!0}return ew.check(i)&&ew.check(n)&&n.loc?(e.push({oldPath:r.copy(),newPath:t.copy()}),!0):!1}return _h(t,r,e)}function _h(t,r,e){let i=t.getValue(),n=r.getValue();if(_a.assert(i),_a.assert(n),i.original===null||t.needsParens()&&!r.hasParens())return!1;let s=s3(n,i);(n.type==="File"||i.type==="File")&&delete s.tokens,delete s.loc;let o=e.length;for(let a in s){if(a.charAt(0)==="_")continue;t.stack.push(a,Gi(i,a)),r.stack.push(a,Gi(n,a));let l=Rw(t,r,e);if(t.stack.length-=2,r.stack.length-=2,!l)return!1}return!(w3.check(t.getNode())&&e.length>o)}var ot=Ur,Oh=jr.string,k3=jr.object,Zu=function(r,e){Oh.assert(r),this.code=r,e&&(k3.assert(e),this.map=e)},O3=Zu.prototype,rw=!1;O3.toString=function(){return rw||(console.warn("Deprecation warning: recast.print now returns an object with a .code property. You appear to be treating the object as a string, which might still work but is strongly discouraged."),rw=!0),this.code};var iw=new Zu(""),R3=function(r){let e=r&&r.tabWidth;r=rc(r),r.sourceFileName=null;function i(s,o){return s=Object.assign({},s,o),a=>n(a,s)}function n(s,o){if(o=o||{},o.includeComments)return Zv(s,i(o,{includeComments:!1}));let a=r.tabWidth;if(!e){let c=s.getNode().loc;c&&c.lines&&c.lines.guessTabWidth&&(r.tabWidth=c.lines.guessTabWidth())}let l=P3(s),u=l?l(n):nw(s,r,o,i(o,{includeComments:!0,avoidRootParens:!1}));return r.tabWidth=a,u}this.print=function(s){if(!s)return iw;let o=n($r.from(s),{includeComments:!0,avoidRootParens:!1});return new Zu(o.toString(r),o3(r.inputSourceMap,o.getSourceMap(r.sourceMapName,r.sourceRoot)))},this.printGenerically=function(s){if(!s)return iw;function o(c){return Zv(c,p=>nw(p,r,{includeComments:!0,avoidRootParens:!1},o))}let a=$r.from(s),l=r.reuseWhitespace;r.reuseWhitespace=!1;let u=new Zu(o(a).toString(r));return r.reuseWhitespace=l,u}};function nw(t,r,e,i){let n=t.getValue(),s=[],o=L3(t,r,i);if(!n||o.isEmpty())return o;let a=!1,l=M3(t,i);return l.isEmpty()?e.avoidRootParens||(a=t.needsParens()):s.push(l),a&&s.unshift("("),s.push(o),a&&s.push(")"),v(s)}function L3(t,r,e){let i=t.getValue();if(!i)return I("");if(typeof i=="string")return I(i,r);ot.Printable.assert(i);let n=[];switch(i.type){case"File":return t.call(e,"program");case"Program":return i.directives&&t.each(function(s){n.push(e(s),`;
|
|
1096
|
+
`))}return s.push(r(t)),v(s)}function Zv(t,r){let e=t.getValue(),i=r(t),n=Hs.Node.check(e)&&Gi(e,"comments");if(!n||n.length===0)return i;let s=[],o=[i];return t.each(function(a){let l=a.getValue(),u=Gi(l,"leading"),c=Gi(l,"trailing");u||c&&!(Hs.Statement.check(e)||l.type==="Block"||l.type==="CommentBlock")?s.push(b3(a,r)):c&&o.push(D3(a,r))},"comments"),s.push.apply(s,o),v(s)}var x3=Js,E3=jr.object,C3=jr.array;function Pw(t,r){r=rc(r);let e=I(t,r),i=e.toString({tabWidth:r.tabWidth,reuseWhitespace:!1,useTabs:!1}),n=[],s=r.parser.parse(i,{jsx:!0,loc:!0,locations:!0,range:r.range,comment:!0,onComment:n,tolerant:Yv(r,"tolerant",!0),ecmaVersion:6,sourceType:Yv(r,"sourceType","module")}),o=Array.isArray(s.tokens)?s.tokens:!1;delete s.tokens,o.forEach(function(c){typeof c.value!="string"&&(c.value=e.sliceString(c.loc.start,c.loc.end))}),Array.isArray(s.comments)&&(n=s.comments,delete s.comments),s.loc?Fh(s,e):s.loc={start:e.firstPos(),end:e.lastPos()},s.loc.lines=e,s.loc.indent=0;let a,l;s.type==="Program"?(l=s,a=x3.file(s,r.sourceFileName||null),a.loc={start:e.firstPos(),end:e.lastPos(),lines:e,indent:0}):s.type==="File"&&(a=s,l=a.program),r.tokens&&(a.tokens=o);let u=xw({type:l.type,loc:l.loc,body:[],comments:n},e);return l.loc.start=u.start,l.loc.end=u.end,g3(n,l.body.length?a.program:a,e),new Iw(e,o).copy(a)}var Iw=function(r,e){this.lines=r,this.tokens=e,this.startTokenIndex=0,this.endTokenIndex=e.length,this.indent=0,this.seen=new Map},_w=Iw.prototype;_w.copy=function(t){if(this.seen.has(t))return this.seen.get(t);if(C3.check(t)){let u=new Array(t.length);return this.seen.set(t,u),t.forEach(function(c,p){u[p]=this.copy(c)},this),u}if(!E3.check(t))return t;Fh(t,this.lines);let r=Object.create(Object.getPrototypeOf(t),{original:{value:t,configurable:!1,enumerable:!1,writable:!0}});this.seen.set(t,r);let e=t.loc,i=this.indent,n=i,s=this.startTokenIndex,o=this.endTokenIndex;e&&((t.type==="Block"||t.type==="Line"||t.type==="CommentBlock"||t.type==="CommentLine"||this.lines.isPrecededOnlyByWhitespace(e.start))&&(n=this.indent=e.start.column),e.lines=this.lines,e.tokens=this.tokens,e.indent=n,this.findTokenRange(e));let a=Object.keys(t),l=a.length;for(let u=0;u<l;++u){let c=a[u];c==="loc"||c==="tokens"&&t.type==="File"?r[c]=t[c]:r[c]=this.copy(t[c])}return this.indent=i,this.startTokenIndex=s,this.endTokenIndex=o,r};_w.findTokenRange=function(t){for(;this.startTokenIndex>0;){let r=t.tokens[this.startTokenIndex];if(Te(t.start,r.loc.start)<0)--this.startTokenIndex;else break}for(;this.endTokenIndex<t.tokens.length;){let r=t.tokens[this.endTokenIndex];if(Te(r.loc.end,t.end)<0)++this.endTokenIndex;else break}for(;this.startTokenIndex<this.endTokenIndex;){let r=t.tokens[this.startTokenIndex];if(Te(r.loc.start,t.start)<0)++this.startTokenIndex;else break}for(t.start.token=this.startTokenIndex;this.endTokenIndex>this.startTokenIndex;){let r=t.tokens[this.endTokenIndex-1];if(Te(t.end,r.loc.end)<0)--this.endTokenIndex;else break}t.end.token=this.endTokenIndex};var He=Ur,S3=jr.array,v3=jr.number,Ah={};[["??"],["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"],["**"]].forEach(function(t,r){t.forEach(function(e){Ah[e]=r})});var $r=function(r){this.stack=[r]},Ot=$r.prototype;$r.from=function(t){if(t instanceof $r)return t.copy();if(t instanceof t3){let r=Object.create($r.prototype),e=[t.value];for(let i;i=t.parentPath;t=i)e.push(t.name,i.value);return r.stack=e.reverse(),r}return new $r(t)};Ot.copy=function(){let r=Object.create($r.prototype);return r.stack=this.stack.slice(0),r};Ot.getName=function(){let r=this.stack,e=r.length;return e>1?r[e-2]:null};Ot.getValue=function(){let r=this.stack;return r[r.length-1]};Ot.valueIsDuplicate=function(){let t=this.stack,r=t.length-1;return t.lastIndexOf(t[r],r-1)>=0};function Nw(t,r){let e=t.stack;for(let i=e.length-1;i>=0;i-=2){let n=e[i];if(He.Node.check(n)&&--r<0)return n}return null}Ot.getNode=function(r=0){return Nw(this,~~r)};Ot.getParentNode=function(r=0){return Nw(this,~~r+1)};Ot.getRootValue=function(){let r=this.stack;return r.length%2===0?r[1]:r[0]};Ot.call=function(r){let e=this.stack,i=e.length,n=e[i-1],s=arguments.length;for(let a=1;a<s;++a){let l=arguments[a];n=n[l],e.push(l,n)}let o=r(this);return e.length=i,o};Ot.each=function(r){let e=this.stack,i=e.length,n=e[i-1],s=arguments.length;for(let o=1;o<s;++o){let a=arguments[o];n=n[a],e.push(a,n)}for(let o=0;o<n.length;++o)o in n&&(e.push(o,n[o]),r(this),e.length-=2);e.length=i};Ot.map=function(r){let e=this.stack,i=e.length,n=e[i-1],s=arguments.length;for(let a=1;a<s;++a){let l=arguments[a];n=n[l],e.push(l,n)}let o=new Array(n.length);for(let a=0;a<n.length;++a)a in n&&(e.push(a,n[a]),o[a]=r(this,a),e.length-=2);return e.length=i,o};Ot.hasParens=function(){let t=this.getNode(),r=this.getPrevToken(t);if(!r)return!1;let e=this.getNextToken(t);return e?!!(r.value==="("&&(e.value===")"||!this.canBeFirstInStatement()&&this.firstInStatement()&&!this.needsParens(!0))):!1};Ot.getPrevToken=function(t){t=t||this.getNode();let r=t&&t.loc,e=r&&r.tokens;if(e&&r.start.token>0){let i=e[r.start.token-1];if(i){let n=this.getRootValue().loc;if(Te(n.start,i.loc.start)<=0)return i}}return null};Ot.getNextToken=function(t){t=t||this.getNode();let r=t&&t.loc,e=r&&r.tokens;if(e&&r.end.token<e.length){let i=e[r.end.token];if(i){let n=this.getRootValue().loc;if(Te(i.loc.end,n.end)<=0)return i}}return null};Ot.needsParens=function(t){let r=this.getNode();if(r.type==="AssignmentExpression"&&r.left.type==="ObjectPattern")return!0;let e=this.getParentNode(),i=this.getName();if(this.getValue()!==r||He.Statement.check(r)||r.type==="Identifier"||e&&e.type==="ParenthesizedExpression")return!1;if(r.extra&&r.extra.parenthesized)return!0;if(!e)return!1;if(r.type==="UnaryExpression"&&e.type==="BinaryExpression"&&i==="left"&&e.left===r&&e.operator==="**")return!0;switch(r.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return e.type==="MemberExpression"&&i==="object"&&e.object===r;case"BinaryExpression":case"LogicalExpression":switch(e.type){case"CallExpression":return i==="callee"&&e.callee===r;case"UnaryExpression":case"SpreadElement":case"SpreadProperty":return!0;case"MemberExpression":return i==="object"&&e.object===r;case"BinaryExpression":case"LogicalExpression":{let n=e.operator,s=Ah[n],o=r.operator,a=Ah[o];if(s>a||s===a&&i==="right")return!0;break}default:return!1}break;case"SequenceExpression":switch(e.type){case"ReturnStatement":return!1;case"ForStatement":return!1;case"ExpressionStatement":return i!=="expression";default:return!0}case"OptionalIndexedAccessType":return r.optional&&e.type==="IndexedAccessType";case"IntersectionTypeAnnotation":case"UnionTypeAnnotation":return e.type==="NullableTypeAnnotation";case"Literal":return e.type==="MemberExpression"&&v3.check(r.value)&&i==="object"&&e.object===r;case"NumericLiteral":return e.type==="MemberExpression"&&i==="object"&&e.object===r;case"YieldExpression":case"AwaitExpression":case"AssignmentExpression":case"ConditionalExpression":switch(e.type){case"UnaryExpression":case"SpreadElement":case"SpreadProperty":case"BinaryExpression":case"LogicalExpression":return!0;case"CallExpression":case"NewExpression":return i==="callee"&&e.callee===r;case"ConditionalExpression":return i==="test"&&e.test===r;case"MemberExpression":return i==="object"&&e.object===r;default:return!1}case"ArrowFunctionExpression":return He.CallExpression.check(e)&&i==="callee"&&e.callee===r||He.MemberExpression.check(e)&&i==="object"&&e.object===r||He.TSAsExpression&&He.TSAsExpression.check(e)&&i==="expression"&&e.expression===r?!0:Fw(e);case"ObjectExpression":if(e.type==="ArrowFunctionExpression"&&i==="body"&&e.body===r)return!0;break;case"TSAsExpression":if(e.type==="ArrowFunctionExpression"&&i==="body"&&e.body===r&&r.expression.type==="ObjectExpression")return!0;break;case"CallExpression":if(i==="declaration"&&He.ExportDefaultDeclaration.check(e)&&He.FunctionExpression.check(r.callee))return!0}return e.type==="NewExpression"&&i==="callee"&&e.callee===r?Ph(r):!!(t!==!0&&!this.canBeFirstInStatement()&&this.firstInStatement())};function Fw(t){return He.BinaryExpression.check(t)||He.LogicalExpression.check(t)}function Ph(t){return He.CallExpression.check(t)?!0:S3.check(t)?t.some(Ph):He.Node.check(t)?r3(t,(r,e)=>Ph(e)):!1}Ot.canBeFirstInStatement=function(){let t=this.getNode();return!(He.FunctionExpression.check(t)||He.ObjectExpression.check(t)||He.ClassExpression.check(t))};Ot.firstInStatement=function(){let t=this.stack,r,e,i,n;for(let s=t.length-1;s>=0;s-=2)if(He.Node.check(t[s])&&(i=r,n=e,r=t[s-1],e=t[s]),!(!e||!n)){if(He.BlockStatement.check(e)&&r==="body"&&i===0||He.ExpressionStatement.check(e)&&i==="expression"||He.AssignmentExpression.check(e)&&i==="left"||He.ArrowFunctionExpression.check(e)&&i==="body")return!0;if(!(He.SequenceExpression.check(e)&&t[s+1]==="expressions"&&i===0)&&!(He.CallExpression.check(e)&&i==="callee")&&!(He.MemberExpression.check(e)&&i==="object")&&!(He.ConditionalExpression.check(e)&&i==="test")&&!(Fw(e)&&i==="left")&&!(He.UnaryExpression.check(e)&&!e.prefix&&i==="argument"))return!1}return!0};var Ia=Ur.Printable,ew=Ur.Expression,w3=Ur.ReturnStatement,T3=Ur.SourceLocation,_a=jr.object,Ih=jr.array,A3=jr.string,Qu=/[0-9a-z_$]/i,kw=function(r){let e=this,i=[];e.replace=function(n,s){A3.check(s)&&(s=I(s)),i.push({lines:s,start:n.start,end:n.end})},e.get=function(n){n=n||{start:{line:1,column:0},end:{line:r.length,column:r.getLineLength(r.length)}};let s=n.start,o=[];function a(l,u){o.push(r.slice(l,u))}return i.sort((l,u)=>Te(l.start,u.start)).forEach(function(l){Te(s,l.start)>0||(a(s,l.start),o.push(l.lines),s=l.end)}),a(s,n.end),v(o)}},Ow=kw.prototype;Ow.tryToReprintComments=function(t,r,e){let i=this;if(!t.comments&&!r.comments)return!0;let n=$r.from(t),s=$r.from(r);n.stack.push("comments",tw(t)),s.stack.push("comments",tw(r));let o=[],a=Lw(n,s,o);return a&&o.length>0&&o.forEach(function(l){let u=l.oldPath.getValue();i.replace(u.loc,e(l.newPath).indentTail(u.loc.indent))}),a};function tw(t){let r=[];return t.comments&&t.comments.length>0&&t.comments.forEach(function(e){(e.leading||e.trailing)&&r.push(e)}),r}Ow.deleteComments=function(t){if(!t.comments)return;let r=this;t.comments.forEach(function(e){e.leading?r.replace({start:e.loc.start,end:t.loc.lines.skipSpaces(e.loc.end,!1,!1)},""):e.trailing&&r.replace({start:t.loc.lines.skipSpaces(e.loc.start,!0,!1),end:e.loc.end},"")})};function P3(t){let r=t.getValue();if(!Ia.check(r))return;let e=r.original,i=e&&e.loc,n=i&&i.lines,s=[];if(!(!n||!N3(t,s)))return function(o){let a=new kw(n);s.forEach(function(u){let c=u.newPath.getValue(),p=u.oldPath.getValue();T3.assert(p.loc,!0);let d=!a.tryToReprintComments(c,p,o);d&&a.deleteComments(p);let h=o(u.newPath,{includeComments:d,avoidRootParens:p.type===c.type&&u.oldPath.hasParens()}).indentTail(p.loc.indent),f=I3(n,p.loc,h),g=_3(n,p.loc,h);if(f||g){let m=[];f&&m.push(" "),m.push(h),g&&m.push(" "),h=v(m)}a.replace(p.loc,h)});let l=a.get(i).indentTail(-e.loc.indent);return t.needsParens()?v(["(",l,")"]):l}}function I3(t,r,e){let i=xn(r.start),n=t.prevPos(i)&&t.charAt(i),s=e.charAt(e.firstPos());return n&&Qu.test(n)&&s&&Qu.test(s)}function _3(t,r,e){let i=t.charAt(r.end),n=e.lastPos(),s=e.prevPos(n)&&e.charAt(n);return s&&Qu.test(s)&&i&&Qu.test(i)}function N3(t,r){let e=t.getValue();Ia.assert(e);let i=e.original;if(Ia.assert(i),e.type!==i.type)return!1;let n=new $r(i),s=_h(t,n,r);return s||(r.length=0),s}function Rw(t,r,e){let i=t.getValue(),n=r.getValue();return i===n?!0:Ih.check(i)?Lw(t,r,e):_a.check(i)?F3(t,r,e):!1}function Lw(t,r,e){let i=t.getValue(),n=r.getValue();if(i===n||t.valueIsDuplicate()||r.valueIsDuplicate())return!0;Ih.assert(i);let s=i.length;if(!(Ih.check(n)&&n.length===s))return!1;for(let o=0;o<s;++o){t.stack.push(o,i[o]),r.stack.push(o,n[o]);let a=Rw(t,r,e);if(t.stack.length-=2,r.stack.length-=2,!a)return!1}return!0}function F3(t,r,e){let i=t.getValue();if(_a.assert(i),i.original===null)return!1;let n=r.getValue();if(!_a.check(n))return!1;if(i===n||t.valueIsDuplicate()||r.valueIsDuplicate())return!0;if(Ia.check(i)){if(!Ia.check(n))return!1;let s=t.getParentNode(),o=r.getParentNode();if(o!==null&&o.type==="FunctionTypeAnnotation"&&s!==null&&s.type==="FunctionTypeAnnotation"){let a=o.params.length!==1||!!o.params[0].name,l=s.params.length!==1||!!s.params[0].name;if(!a&&l)return!1}if(i.type===n.type){let a=[];if(_h(t,r,a))e.push.apply(e,a);else if(n.loc)e.push({oldPath:r.copy(),newPath:t.copy()});else return!1;return!0}return ew.check(i)&&ew.check(n)&&n.loc?(e.push({oldPath:r.copy(),newPath:t.copy()}),!0):!1}return _h(t,r,e)}function _h(t,r,e){let i=t.getValue(),n=r.getValue();if(_a.assert(i),_a.assert(n),i.original===null||t.needsParens()&&!r.hasParens())return!1;let s=s3(n,i);(n.type==="File"||i.type==="File")&&delete s.tokens,delete s.loc;let o=e.length;for(let a in s){if(a.charAt(0)==="_")continue;t.stack.push(a,Gi(i,a)),r.stack.push(a,Gi(n,a));let l=Rw(t,r,e);if(t.stack.length-=2,r.stack.length-=2,!l)return!1}return!(w3.check(t.getNode())&&e.length>o)}var ot=Ur,Oh=jr.string,k3=jr.object,Zu=function(r,e){Oh.assert(r),this.code=r,e&&(k3.assert(e),this.map=e)},O3=Zu.prototype,rw=!1;O3.toString=function(){return rw||(console.warn("Deprecation warning: recast.print now returns an object with a .code property. You appear to be treating the object as a string, which might still work but is strongly discouraged."),rw=!0),this.code};var iw=new Zu(""),R3=function(r){let e=r&&r.tabWidth;r=rc(r),r.sourceFileName=null;function i(s,o){return s=Object.assign({},s,o),a=>n(a,s)}function n(s,o){if(o=o||{},o.includeComments)return Zv(s,i(o,{includeComments:!1}));let a=r.tabWidth;if(!e){let c=s.getNode().loc;c&&c.lines&&c.lines.guessTabWidth&&(r.tabWidth=c.lines.guessTabWidth())}let l=P3(s),u=l?l(n):nw(s,r,o,i(o,{includeComments:!0,avoidRootParens:!1}));return r.tabWidth=a,u}this.print=function(s){if(!s)return iw;let o=n($r.from(s),{includeComments:!0,avoidRootParens:!1});return new Zu(o.toString(r),o3(r.inputSourceMap,o.getSourceMap(r.sourceMapName,r.sourceRoot)))},this.printGenerically=function(s){if(!s)return iw;function o(c){return Zv(c,p=>nw(p,r,{includeComments:!0,avoidRootParens:!1},o))}let a=$r.from(s),l=r.reuseWhitespace;r.reuseWhitespace=!1;let u=new Zu(o(a).toString(r));return r.reuseWhitespace=l,u}};function nw(t,r,e,i){let n=t.getValue(),s=[],o=L3(t,r,i);if(!n||o.isEmpty())return o;let a=!1,l=M3(t,i);return l.isEmpty()?e.avoidRootParens||(a=t.needsParens()):s.push(l),a&&s.unshift("("),s.push(o),a&&s.push(")"),v(s)}function L3(t,r,e){let i=t.getValue();if(!i)return I("");if(typeof i=="string")return I(i,r);ot.Printable.assert(i);let n=[];switch(i.type){case"File":return t.call(e,"program");case"Program":return i.directives&&t.each(function(s){n.push(e(s),`;
|
|
1097
1097
|
`)},"directives"),i.interpreter&&n.push(t.call(e,"interpreter")),n.push(t.call(s=>zs(s,r,e),"body")),v(n);case"Noop":case"EmptyStatement":return I("");case"ExpressionStatement":return v([t.call(e,"expression"),";"]);case"ParenthesizedExpression":return v(["(",t.call(e,"expression"),")"]);case"BinaryExpression":case"LogicalExpression":case"AssignmentExpression":return I(" ").join([t.call(e,"left"),i.operator,t.call(e,"right")]);case"AssignmentPattern":return v([t.call(e,"left")," = ",t.call(e,"right")]);case"MemberExpression":case"OptionalMemberExpression":{n.push(t.call(e,"object"));let s=t.call(e,"property"),o=Gi(i,"optional");return i.computed?n.push(o?"?.[":"[",s,"]"):n.push(o?"?.":".",s),v(n)}case"ChainExpression":return t.call(e,"expression");case"MetaProperty":return v([t.call(e,"meta"),".",t.call(e,"property")]);case"BindExpression":return i.object&&n.push(t.call(e,"object")),n.push("::",t.call(e,"callee")),v(n);case"Path":return I(".").join(i.body);case"Identifier":return v([I(i.name,r),i.optional?"?":"",t.call(e,"typeAnnotation")]);case"SpreadElement":case"SpreadElementPattern":case"RestProperty":case"SpreadProperty":case"SpreadPropertyPattern":case"ObjectTypeSpreadProperty":case"RestElement":return v(["...",t.call(e,"argument"),t.call(e,"typeAnnotation")]);case"FunctionDeclaration":case"FunctionExpression":case"TSDeclareFunction":return i.declare&&n.push("declare "),i.async&&n.push("async "),n.push("function"),i.generator&&n.push("*"),i.id?n.push(" ",t.call(e,"id"),t.call(e,"typeParameters")):i.typeParameters&&n.push(t.call(e,"typeParameters")),n.push("(",hi(t,r,e),")",t.call(e,"returnType")),i.body&&n.push(" ",t.call(e,"body")),v(n);case"ArrowFunctionExpression":return i.async&&n.push("async "),i.typeParameters&&n.push(t.call(e,"typeParameters")),!r.arrowParensAlways&&i.params.length===1&&!i.rest&&i.params[0].type==="Identifier"&&!i.params[0].typeAnnotation&&!i.returnType?n.push(t.call(e,"params",0)):n.push("(",hi(t,r,e),")",t.call(e,"returnType")),n.push(" => ",t.call(e,"body")),v(n);case"MethodDefinition":return Dh(t,r,e);case"YieldExpression":return n.push("yield"),i.delegate&&n.push("*"),i.argument&&n.push(" ",t.call(e,"argument")),v(n);case"AwaitExpression":return n.push("await"),i.all&&n.push("*"),i.argument&&n.push(" ",t.call(e,"argument")),v(n);case"ModuleExpression":return v([`module {
|
|
1098
1098
|
`,t.call(e,"body").indent(r.tabWidth),`
|
|
1099
1099
|
}`]);case"ModuleDeclaration":return n.push("module",t.call(e,"id")),i.source?n.push("from",t.call(e,"source")):n.push(t.call(e,"body")),I(" ").join(n);case"ImportSpecifier":return i.importKind&&i.importKind!=="value"&&n.push(i.importKind+" "),i.imported?(n.push(t.call(e,"imported")),i.local&&i.local.name!==i.imported.name&&n.push(" as ",t.call(e,"local"))):i.id&&(n.push(t.call(e,"id")),i.name&&n.push(" as ",t.call(e,"name"))),v(n);case"ExportSpecifier":return i.exportKind&&i.exportKind!=="value"&&n.push(i.exportKind+" "),i.local?(n.push(t.call(e,"local")),i.exported&&i.exported.name!==i.local.name&&n.push(" as ",t.call(e,"exported"))):i.id&&(n.push(t.call(e,"id")),i.name&&n.push(" as ",t.call(e,"name"))),v(n);case"ExportBatchSpecifier":return I("*");case"ImportNamespaceSpecifier":return n.push("* as "),i.local?n.push(t.call(e,"local")):i.id&&n.push(t.call(e,"id")),v(n);case"ImportDefaultSpecifier":return i.local?t.call(e,"local"):t.call(e,"id");case"TSExportAssignment":return v(["export = ",t.call(e,"expression")]);case"ExportDeclaration":case"ExportDefaultDeclaration":case"ExportNamedDeclaration":return ow(t,r,e);case"ExportAllDeclaration":return n.push("export *"),i.exported&&n.push(" as ",t.call(e,"exported")),n.push(" from ",t.call(e,"source"),";"),v(n);case"TSNamespaceExportDeclaration":return n.push("export as namespace ",t.call(e,"id")),zu(v(n));case"ExportNamespaceSpecifier":return v(["* as ",t.call(e,"exported")]);case"ExportDefaultSpecifier":return t.call(e,"exported");case"Import":return I("import",r);case"ImportExpression":return v(["import(",t.call(e,"source"),")"]);case"ImportDeclaration":{if(n.push("import "),i.importKind&&i.importKind!=="value"&&n.push(i.importKind+" "),i.specifiers&&i.specifiers.length>0){let s=[],o=[];if(t.each(function(a){let l=a.getValue();l.type==="ImportSpecifier"?o.push(e(a)):(l.type==="ImportDefaultSpecifier"||l.type==="ImportNamespaceSpecifier")&&s.push(e(a))},"specifiers"),s.forEach((a,l)=>{l>0&&n.push(", "),n.push(a)}),o.length>0){let a=I(", ").join(o);a.getLineLength(1)>r.wrapColumn&&(a=v([I(`,
|
|
@@ -1174,16 +1174,16 @@ while`),n.push(" (",t.call(e,"test"),");"),v(n)}case"DoExpression":{let s=t.call
|
|
|
1174
1174
|
`,u,`
|
|
1175
1175
|
}`):r.objectCurlySpacing?n.push("{ ",u," }"):n.push("{",u,"}")}}else n.push(s?"{ ":"{",I(", ").join(t.map(e,"specifiers")),s?" }":"}");i.source&&n.push(" from ",t.call(e,"source"),Bw(t,r,e))}let o=v(n);return Na(o)!==";"&&!(i.declaration&&(i.declaration.type==="FunctionDeclaration"||i.declaration.type==="ClassDeclaration"||i.declaration.type==="TSModuleDeclaration"||i.declaration.type==="TSInterfaceDeclaration"||i.declaration.type==="TSEnumDeclaration"))&&(o=v([o,";"])),o}function Ca(t,r){return Ew(t)||r.unshift("declare "),v(r)}function Sa(t,r){return t.call(function(e){let i=e.getValue();return i?i==="plus"?I("+"):i==="minus"?I("-"):r(e):I("")},"variance")}function Jn(t,r){return t.length>1?v([" ",t]):v([`
|
|
1176
1176
|
`,zu(t).indent(r.tabWidth)])}function Na(t){let r=t.lastPos();do{let e=t.charAt(r);if(/\S/.test(e))return e}while(t.prevPos(r))}function aw(t){return Na(t)==="}"}function Uu(t){return t.replace(/['"]/g,r=>r==='"'?"'":'"')}function Ws(t){let r=Gi(t,"value"),e=Gi(t,"extra");if(e&&typeof e.raw=="string"&&r==e.rawValue)return e.raw;if(t.type==="Literal"){let i=t.raw;if(typeof i=="string"&&r==i)return i}}function ju(t){return JSON.stringify(t).replace(/[\u2028\u2029]/g,function(r){return"\\u"+r.charCodeAt(0).toString(16)})}function va(t,r){switch(Oh.assert(t),r.quote){case"auto":{let e=ju(t),i=Uu(ju(Uu(t)));return e.length>i.length?i:e}case"single":return Uu(ju(Uu(t)));case"double":default:return ju(t)}}function zu(t){let r=Na(t);return!r||`
|
|
1177
|
-
};`.indexOf(r)<0?v([t,";"]):t}function $3(t,r){return new R3(r).print(t)}var qu;function $w(){if(qu)return qu;let t=U3();return qu={parse(r,e){return uw.parse(r,{...t,...e})}},qu}function U3(){return{sourceType:"module",strictMode:!1,allowImportExportEverywhere:!0,allowReturnOutsideFunction:!0,startLine:1,tokens:!0,plugins:["asyncGenerators","bigInt","classPrivateMethods","classPrivateProperties","classProperties","classStaticBlock","decimal","decorators-legacy","doExpressions","dynamicImport","exportDefaultFrom","exportExtensions","exportNamespaceFrom","functionBind","functionSent","importAssertions","importMeta","nullishCoalescingOperator","numericSeparator","objectRestSpread","optionalCatchBinding","optionalChaining",["pipelineOperator",{proposal:"minimal"}],["recordAndTuple",{syntaxType:"hash"}],"throwExpressions","topLevelAwait","v8intrinsic","jsx","typescript"]}}var j3=Object.defineProperty,q3=(t,r,e)=>r in t?j3(t,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[r]=e,lw=(t,r,e)=>(q3(t,typeof r!="symbol"?r+"":r,e),e),
|
|
1177
|
+
};`.indexOf(r)<0?v([t,";"]):t}function $3(t,r){return new R3(r).print(t)}var qu;function $w(){if(qu)return qu;let t=U3();return qu={parse(r,e){return uw.parse(r,{...t,...e})}},qu}function U3(){return{sourceType:"module",strictMode:!1,allowImportExportEverywhere:!0,allowReturnOutsideFunction:!0,startLine:1,tokens:!0,plugins:["asyncGenerators","bigInt","classPrivateMethods","classPrivateProperties","classProperties","classStaticBlock","decimal","decorators-legacy","doExpressions","dynamicImport","exportDefaultFrom","exportExtensions","exportNamespaceFrom","functionBind","functionSent","importAssertions","importMeta","nullishCoalescingOperator","numericSeparator","objectRestSpread","optionalCatchBinding","optionalChaining",["pipelineOperator",{proposal:"minimal"}],["recordAndTuple",{syntaxType:"hash"}],"throwExpressions","topLevelAwait","v8intrinsic","jsx","typescript"]}}var j3=Object.defineProperty,q3=(t,r,e)=>r in t?j3(t,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[r]=e,lw=(t,r,e)=>(q3(t,typeof r!="symbol"?r+"":r,e),e),kt=class extends Error{constructor(r,e){if(super(""),lw(this,"rawMessage"),lw(this,"options"),this.name="MagicastError",this.rawMessage=r,this.options=e,e?.ast&&e?.code&&e.ast.loc){let{line:i,column:n}=e.ast.loc.start,s=e.code.split(`
|
|
1178
1178
|
`),o=Math.max(0,i-3),a=Math.min(s.length,i+3),l=s.slice(o,a).map((u,c)=>(u=`${(o+c+1).toString().padStart(3," ")} | ${u}`,o+c===i-1&&(u+=`
|
|
1179
1179
|
${" ".repeat(6+n)}^`),u));r+=`
|
|
1180
1180
|
|
|
1181
1181
|
${l.join(`
|
|
1182
1182
|
`)}
|
|
1183
|
-
`}this.message=r}},K3=new Set(["Literal","StringLiteral","NumericLiteral","BooleanLiteral","NullLiteral","RegExpLiteral","BigIntLiteral"]),Uw=new Set(["string","number","boolean","bigint","symbol","undefined"]),ut=Js;function V3(t){return/^[$A-Z_a-z][\w$]*$/.test(t)}var Rh="__magicast_proxy";function Vt(t,r=new Set){if(t===void 0)return ut.identifier("undefined");if(t===null)return ut.literal(null);if(Uw.has(typeof t))return ut.literal(t);if(r.has(t))throw new Ft("Can not serialize circular reference");if(r.add(t),t[Rh])return t.$ast;if(t instanceof RegExp){let e=ut.regExpLiteral(t.source,t.flags);return delete e.extra.raw,e}return t instanceof Set?ut.newExpression(ut.identifier("Set"),[ut.arrayExpression([...t].map(e=>Vt(e,r)))]):t instanceof Date?ut.newExpression(ut.identifier("Date"),[ut.literal(t.toISOString())]):t instanceof Map?ut.newExpression(ut.identifier("Map"),[ut.arrayExpression([...t].map(([e,i])=>ut.arrayExpression([Vt(e,r),Vt(i,r)])))]):Array.isArray(t)?ut.arrayExpression(t.map(e=>Vt(e,r))):typeof t=="object"?ut.objectExpression(Object.entries(t).map(([e,i])=>ut.property("init",/^[$A-Z_a-z][\w$]*$/g.test(e)?ut.identifier(e):ut.literal(e),Vt(i,r)))):ut.literal(t)}function z3(t,r={}){let e=r;return e[Rh]=!0,e.$ast=t,e.$type||(e.$type="object"),e}var W3={enumerable:!0,configurable:!0};function vr(t,r,e){let i=z3(t,r);return new Proxy({},{ownKeys(){return Object.keys(i).filter(n=>n!==Rh&&!n.startsWith("$"))},getOwnPropertyDescriptor(){return W3},has(n,s){return s in i},...e,get(n,s,o){if(s in i)return i[s];if(e.get)return e.get(n,s,o)},set(n,s,o,a){return s in i?(i[s]=o,!0):e.set?e.set(n,s,o,a):!1}})}var cr=Js,xh=new WeakMap;function G3(t,r,e){if(xh.has(r))return xh.get(r);let i=vr(r,{get $declaration(){return t},get imported(){return r.type==="ImportDefaultSpecifier"?"default":r.type==="ImportNamespaceSpecifier"?"*":r.imported.type==="Identifier"?r.imported.name:r.imported.value},set imported(n){if(r.type!=="ImportSpecifier")throw new Ft("Changing import name is not yet implemented");r.imported.type==="Identifier"?r.imported.name=n:r.imported.value=n},get local(){return r.local.name},set local(n){r.local.name=n},get from(){return t.source.value},set from(n){if(n===t.source.value)return;t.specifiers=t.specifiers.filter(o=>o!==r),t.specifiers.length===0&&(e.body=e.body.filter(o=>o!==t));let s=e.body.find(o=>o.type==="ImportDeclaration"&&o.source.value===n);s?s.specifiers.push(r):e.body.unshift(cr.importDeclaration([r],cr.stringLiteral(n)))},toJSON(){return{imported:this.imported,local:this.local,from:this.from}}},{ownKeys(){return["imported","local","from","toJSON"]}});return xh.set(r,i),i}function H3(t,r){let e=()=>{let o=[];for(let a of t.body)if(a.type==="ImportDeclaration")for(let l of a.specifiers)o.push(G3(a,l,t));return o},i=(o,a,l)=>{let u=e(),c=u.find(f=>f.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"?cr.importDefaultSpecifier(cr.identifier(p)):a.imported==="*"?cr.importNamespaceSpecifier(cr.identifier(p)):cr.importSpecifier(cr.identifier(a.imported),cr.identifier(p)),h=u.find(f=>f.from===a.from)?.$declaration;if(h)h.specifiers.push(d);else if(l==="prepend"||u.length===0)t.body.unshift(cr.importDeclaration([d],cr.stringLiteral(a.from)));else{let f=u.at(-1).$declaration,g=t.body.indexOf(f);t.body.splice(g+1,0,cr.importDeclaration([d],cr.stringLiteral(a.from)))}return!0},n=o=>{let a=e().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&&(t.body=t.body.filter(c=>c!==l)),!0};return vr(t,{$type:"imports",$add(o){i(o.local||o.imported,o,"prepend")},$prepend(o){i(o.local||o.imported,o,"prepend")},$append(o){i(o.local||o.imported,o,"append")},get $items(){return e()},toJSON(){return e().reduce((o,a)=>(o[a.local]=a,o),{})}},{get(o,a){return e().find(l=>l.local===a)},set(o,a,l){return i(a,l,"prepend")},deleteProperty(o,a){return n(a)},ownKeys(){return e().map(o=>o.local)},has(o,a){return e().some(l=>l.local===a)}})}function ic(t,r,e){let i=s=>r[s],n=(s,o)=>{r[s]=o};return vr(t,{$type:"array",push(s){r.push(Vt(s))},pop(){return Kt(r.pop(),e)},unshift(s){r.unshift(Vt(s))},shift(){return Kt(r.shift(),e)},splice(s,o,...a){return r.splice(s,o,...a.map(u=>Vt(u))).map(u=>Kt(u,e))},find(s){return r.map(o=>Kt(o,e)).find(s)},findIndex(s){return r.map(o=>Kt(o,e)).findIndex(s)},includes(s){return r.map(o=>Kt(o,e)).includes(s)},toJSON(){return r.map(s=>Kt(s,e))}},{get(s,o){if(o==="length")return r.length;if(o===Symbol.iterator)return function*(){for(let u of r)yield Kt(u,e)};if(typeof o=="symbol")return;let a=+o;if(Number.isNaN(a))return;let l=i(a);if(l)return Kt(l,e)},set(s,o,a){if(typeof o=="symbol")return!1;let l=+o;return Number.isNaN(l)?!1:(n(l,Vt(a)),!0)},deleteProperty(s,o){if(typeof o=="symbol")return!1;let a=+o;return Number.isNaN(a)?!1:(r[a]=Vt(void 0),!0)},ownKeys(){return["length",...r.map((s,o)=>o.toString())]}})}function J3(t,r){if("elements"in t)return ic(t,t.elements,r)}function jw(t,r){if(t.type!=="CallExpression")throw new Ft("Not a function call");function e(n){if(n.type==="Identifier")return n.name;if(n.type==="MemberExpression")return`${e(n.object)}.${e(n.property)}`;throw new Ft("Not implemented")}let i=ic(t,t.arguments,r);return vr(t,{$type:"function-call",$callee:e(t.callee),$args:i},{})}function Y3(t,r){if(t.type!=="ArrowFunctionExpression")throw new Ft("Not an arrow function expression");let e=ic(t,t.params,r);return vr(t,{$type:"arrow-function-expression",$params:e,$body:Kt(t.body,r)},{})}var X3=Js;function Q3(t,r){if(!("properties"in t))return;let e=s=>{for(let o of t.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}},i=(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 Ft(`Casting "${s.type}" is not supported`,{ast:s,code:r?.$code})},n=(s,o)=>{let a=t.properties.find(l=>i(l)===s);a?a.value=o:V3(s)?t.properties.push({type:"Property",key:{type:"Identifier",name:s},value:o}):t.properties.push({type:"ObjectProperty",key:X3.stringLiteral(s),value:o})};return vr(t,{$type:"object",toJSON(){return t.properties.reduce((s,o)=>("key"in o&&"name"in o.key&&(s[o.key.name]=Kt(o.value,r)),s),{})}},{get(s,o){let a=e(o);if(a)return Kt(a,r)},set(s,o,a){return typeof o!="string"&&(o=String(o)),n(o,Vt(a)),!0},deleteProperty(s,o){typeof o!="string"&&(o=String(o));let a=t.properties.findIndex(l=>"key"in l&&"name"in l.key&&l.key.name===o);return a!==-1&&t.properties.splice(a,1),!0},ownKeys(){return t.properties.map(s=>i(s,!0)).filter(Boolean)}})}function qw(t,r){if(t.type!=="NewExpression")throw new Ft("Not a new expression");function e(n){if(n.type==="Identifier")return n.name;if(n.type==="MemberExpression")return`${e(n.object)}.${e(n.property)}`;throw new Ft("Not implemented")}let i=ic(t,t.arguments,r);return vr(t,{$type:"new-expression",$callee:e(t.callee),$args:i},{})}function Z3(t){if(t.type!=="Identifier")throw new Ft("Not an identifier");return vr(t,{$type:"identifier",$name:t.name},{})}function e8(t){if(t.type!=="LogicalExpression")throw new Ft("Not a logical expression");return vr(t,{$type:"logicalExpression"},{})}function t8(t){if(t.type!=="MemberExpression")throw new Ft("Not a member expression");return vr(t,{$type:"memberExpression"},{})}var Eh=new WeakMap;function Kt(t,r){if(Uw.has(typeof t))return t;if(K3.has(t.type))return t.value;if(Eh.has(t))return Eh.get(t);let e;switch(t.type){case"ObjectExpression":{e=Q3(t,r);break}case"ArrayExpression":{e=J3(t,r);break}case"CallExpression":{e=jw(t,r);break}case"ArrowFunctionExpression":{e=Y3(t,r);break}case"NewExpression":{e=qw(t,r);break}case"Identifier":{e=Z3(t);break}case"LogicalExpression":{e=e8(t);break}case"MemberExpression":{e=t8(t);break}case"TSAsExpression":case"TSSatisfiesExpression":{e=Kt(t.expression,r);break}default:throw new Ft(`Casting "${t.type}" is not supported`,{ast:t,code:r?.$code})}return Eh.set(t,e),e}var wa=Js;function r8(t,r){let e=n=>{let s=n==="default"?"ExportDefaultDeclaration":"ExportNamedDeclaration";for(let o of t.body)if(o.type===s){if(n==="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===n)return a.init}}},i=(n,s)=>{let o=n==="default"?"ExportDefaultDeclaration":"ExportNamedDeclaration",a=Vt(s);for(let l of t.body)if(l.type===o){if(n==="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===n){u.init=a;return}}}t.body.push(n==="default"?wa.exportDefaultDeclaration(a):wa.exportNamedDeclaration(wa.variableDeclaration("const",[wa.variableDeclarator(wa.identifier(n),a)])))};return vr(t,{$type:"exports"},{get(n,s){let o=e(s);if(o)return Kt(o,r)},set(n,s,o){return i(s,o),!0},ownKeys(){return t.body.flatMap(n=>n.type==="ExportDefaultDeclaration"?["default"]:n.type==="ExportNamedDeclaration"&&n.declaration&&"declarations"in n.declaration?n.declaration.declarations.map(s=>"name"in s.id?s.id.name:""):[]).filter(Boolean)},deleteProperty(n,s){let o=s==="default"?"ExportDefaultDeclaration":"ExportNamedDeclaration";for(let a=0;a<t.body.length;a++){let l=t.body[a];if(l.type===o){if(s==="default")return t.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 t.body.splice(a,1),!0}}}return!1}})}function i8(t,r){let e=t.program;if(e.type!=="Program")throw new Ft(`Cannot proxify ${t.type} as module`);let i={$code:r,$type:"module"},n=vr(e,i,{ownKeys(){return["imports","exports","generate"]}});return i.exports=r8(e,n),i.imports=H3(e),i.generate=s=>Lh(n,s),n}function Kw(t,r={}){let e={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},i=2,n=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=(t||"").split(`
|
|
1184
|
-
`),p=!1;for(let d of c){let h=d.trim();if(h.length!==0){if(e.wrapColumn&&d.length>o&&(o=d.length),e.indent){let f=d.match(/^\s+/)?.[0]||"";f.length>0&&(f.length>0&&f.length<i&&(i=f.length),f[0]===" "?n++:f.length>0&&n--)}if(h.at(-1)===";"?s++:h.length>0&&s--,e.quote||e.arrowParens){let f=h.matchAll(l);for(let g of f)if(g.groups)for(let m in u)g.groups[m]&&u[m]++}e.trailingComma&&((d.startsWith("}")||d.startsWith("]"))&&(p?a++:a--),p=h.endsWith(","))}}return{wrapColumn:o,useTabs:n>0,tabWidth:i,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 Vw(t,r){let e=Pw(t,{parser:r?.parser||$w(),...r});return i8(e,t)}function zw(t,r){let e=Pw("("+t+")",{parser:r?.parser||$w(),...r}),i=e.program.body[0];i.type==="ExpressionStatement"&&(i=i.expression),i.extra?.parenthesized&&(i.extra.parenthesized=!1);let n={$ast:e,$code:" "+t+" ",$type:"module"};return Kt(i,n)}function Lh(t,r={}){let e=t.$ast||t,i=r.format===!1||!("$code"in t)?{}:Kw(t.$code,r.format),{code:n,map:s}=$3(e,{...r,...i});return{code:n,map:s}}async function n8(t,r={}){let e=await Wu.promises.readFile(t,"utf8");return r.sourceFileName=r.sourceFileName??t,Vw(e,r)}async function s8(t,r,e){let i="$ast"in t?t.$ast:t,{code:n,map:s}=Lh(i,e);await Wu.promises.writeFile(r,n),s&&await Wu.promises.writeFile(r+".map",s)}var Ku=Js,o8={functionCall(t,...r){let e=Ku.callExpression(Ku.identifier(t),r.map(i=>Vt(i)));return jw(e)},newExpression(t,...r){let e=Ku.newExpression(Ku.identifier(t),r.map(i=>Vt(i)));return qw(e)},literal(t){return Vt(t)},raw(t){return zw(t)}};var a8=K(require("@sentry/node"),1);async function Jw(t,r){let e=await(0,
|
|
1183
|
+
`}this.message=r}},K3=new Set(["Literal","StringLiteral","NumericLiteral","BooleanLiteral","NullLiteral","RegExpLiteral","BigIntLiteral"]),Uw=new Set(["string","number","boolean","bigint","symbol","undefined"]),ut=Js;function V3(t){return/^[$A-Z_a-z][\w$]*$/.test(t)}var Rh="__magicast_proxy";function Vt(t,r=new Set){if(t===void 0)return ut.identifier("undefined");if(t===null)return ut.literal(null);if(Uw.has(typeof t))return ut.literal(t);if(r.has(t))throw new kt("Can not serialize circular reference");if(r.add(t),t[Rh])return t.$ast;if(t instanceof RegExp){let e=ut.regExpLiteral(t.source,t.flags);return delete e.extra.raw,e}return t instanceof Set?ut.newExpression(ut.identifier("Set"),[ut.arrayExpression([...t].map(e=>Vt(e,r)))]):t instanceof Date?ut.newExpression(ut.identifier("Date"),[ut.literal(t.toISOString())]):t instanceof Map?ut.newExpression(ut.identifier("Map"),[ut.arrayExpression([...t].map(([e,i])=>ut.arrayExpression([Vt(e,r),Vt(i,r)])))]):Array.isArray(t)?ut.arrayExpression(t.map(e=>Vt(e,r))):typeof t=="object"?ut.objectExpression(Object.entries(t).map(([e,i])=>ut.property("init",/^[$A-Z_a-z][\w$]*$/g.test(e)?ut.identifier(e):ut.literal(e),Vt(i,r)))):ut.literal(t)}function z3(t,r={}){let e=r;return e[Rh]=!0,e.$ast=t,e.$type||(e.$type="object"),e}var W3={enumerable:!0,configurable:!0};function vr(t,r,e){let i=z3(t,r);return new Proxy({},{ownKeys(){return Object.keys(i).filter(n=>n!==Rh&&!n.startsWith("$"))},getOwnPropertyDescriptor(){return W3},has(n,s){return s in i},...e,get(n,s,o){if(s in i)return i[s];if(e.get)return e.get(n,s,o)},set(n,s,o,a){return s in i?(i[s]=o,!0):e.set?e.set(n,s,o,a):!1}})}var cr=Js,xh=new WeakMap;function G3(t,r,e){if(xh.has(r))return xh.get(r);let i=vr(r,{get $declaration(){return t},get imported(){return r.type==="ImportDefaultSpecifier"?"default":r.type==="ImportNamespaceSpecifier"?"*":r.imported.type==="Identifier"?r.imported.name:r.imported.value},set imported(n){if(r.type!=="ImportSpecifier")throw new kt("Changing import name is not yet implemented");r.imported.type==="Identifier"?r.imported.name=n:r.imported.value=n},get local(){return r.local.name},set local(n){r.local.name=n},get from(){return t.source.value},set from(n){if(n===t.source.value)return;t.specifiers=t.specifiers.filter(o=>o!==r),t.specifiers.length===0&&(e.body=e.body.filter(o=>o!==t));let s=e.body.find(o=>o.type==="ImportDeclaration"&&o.source.value===n);s?s.specifiers.push(r):e.body.unshift(cr.importDeclaration([r],cr.stringLiteral(n)))},toJSON(){return{imported:this.imported,local:this.local,from:this.from}}},{ownKeys(){return["imported","local","from","toJSON"]}});return xh.set(r,i),i}function H3(t,r){let e=()=>{let o=[];for(let a of t.body)if(a.type==="ImportDeclaration")for(let l of a.specifiers)o.push(G3(a,l,t));return o},i=(o,a,l)=>{let u=e(),c=u.find(f=>f.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"?cr.importDefaultSpecifier(cr.identifier(p)):a.imported==="*"?cr.importNamespaceSpecifier(cr.identifier(p)):cr.importSpecifier(cr.identifier(a.imported),cr.identifier(p)),h=u.find(f=>f.from===a.from)?.$declaration;if(h)h.specifiers.push(d);else if(l==="prepend"||u.length===0)t.body.unshift(cr.importDeclaration([d],cr.stringLiteral(a.from)));else{let f=u.at(-1).$declaration,g=t.body.indexOf(f);t.body.splice(g+1,0,cr.importDeclaration([d],cr.stringLiteral(a.from)))}return!0},n=o=>{let a=e().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&&(t.body=t.body.filter(c=>c!==l)),!0};return vr(t,{$type:"imports",$add(o){i(o.local||o.imported,o,"prepend")},$prepend(o){i(o.local||o.imported,o,"prepend")},$append(o){i(o.local||o.imported,o,"append")},get $items(){return e()},toJSON(){return e().reduce((o,a)=>(o[a.local]=a,o),{})}},{get(o,a){return e().find(l=>l.local===a)},set(o,a,l){return i(a,l,"prepend")},deleteProperty(o,a){return n(a)},ownKeys(){return e().map(o=>o.local)},has(o,a){return e().some(l=>l.local===a)}})}function ic(t,r,e){let i=s=>r[s],n=(s,o)=>{r[s]=o};return vr(t,{$type:"array",push(s){r.push(Vt(s))},pop(){return Kt(r.pop(),e)},unshift(s){r.unshift(Vt(s))},shift(){return Kt(r.shift(),e)},splice(s,o,...a){return r.splice(s,o,...a.map(u=>Vt(u))).map(u=>Kt(u,e))},find(s){return r.map(o=>Kt(o,e)).find(s)},findIndex(s){return r.map(o=>Kt(o,e)).findIndex(s)},includes(s){return r.map(o=>Kt(o,e)).includes(s)},toJSON(){return r.map(s=>Kt(s,e))}},{get(s,o){if(o==="length")return r.length;if(o===Symbol.iterator)return function*(){for(let u of r)yield Kt(u,e)};if(typeof o=="symbol")return;let a=+o;if(Number.isNaN(a))return;let l=i(a);if(l)return Kt(l,e)},set(s,o,a){if(typeof o=="symbol")return!1;let l=+o;return Number.isNaN(l)?!1:(n(l,Vt(a)),!0)},deleteProperty(s,o){if(typeof o=="symbol")return!1;let a=+o;return Number.isNaN(a)?!1:(r[a]=Vt(void 0),!0)},ownKeys(){return["length",...r.map((s,o)=>o.toString())]}})}function J3(t,r){if("elements"in t)return ic(t,t.elements,r)}function jw(t,r){if(t.type!=="CallExpression")throw new kt("Not a function call");function e(n){if(n.type==="Identifier")return n.name;if(n.type==="MemberExpression")return`${e(n.object)}.${e(n.property)}`;throw new kt("Not implemented")}let i=ic(t,t.arguments,r);return vr(t,{$type:"function-call",$callee:e(t.callee),$args:i},{})}function Y3(t,r){if(t.type!=="ArrowFunctionExpression")throw new kt("Not an arrow function expression");let e=ic(t,t.params,r);return vr(t,{$type:"arrow-function-expression",$params:e,$body:Kt(t.body,r)},{})}var X3=Js;function Q3(t,r){if(!("properties"in t))return;let e=s=>{for(let o of t.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}},i=(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 kt(`Casting "${s.type}" is not supported`,{ast:s,code:r?.$code})},n=(s,o)=>{let a=t.properties.find(l=>i(l)===s);a?a.value=o:V3(s)?t.properties.push({type:"Property",key:{type:"Identifier",name:s},value:o}):t.properties.push({type:"ObjectProperty",key:X3.stringLiteral(s),value:o})};return vr(t,{$type:"object",toJSON(){return t.properties.reduce((s,o)=>("key"in o&&"name"in o.key&&(s[o.key.name]=Kt(o.value,r)),s),{})}},{get(s,o){let a=e(o);if(a)return Kt(a,r)},set(s,o,a){return typeof o!="string"&&(o=String(o)),n(o,Vt(a)),!0},deleteProperty(s,o){typeof o!="string"&&(o=String(o));let a=t.properties.findIndex(l=>"key"in l&&"name"in l.key&&l.key.name===o);return a!==-1&&t.properties.splice(a,1),!0},ownKeys(){return t.properties.map(s=>i(s,!0)).filter(Boolean)}})}function qw(t,r){if(t.type!=="NewExpression")throw new kt("Not a new expression");function e(n){if(n.type==="Identifier")return n.name;if(n.type==="MemberExpression")return`${e(n.object)}.${e(n.property)}`;throw new kt("Not implemented")}let i=ic(t,t.arguments,r);return vr(t,{$type:"new-expression",$callee:e(t.callee),$args:i},{})}function Z3(t){if(t.type!=="Identifier")throw new kt("Not an identifier");return vr(t,{$type:"identifier",$name:t.name},{})}function e8(t){if(t.type!=="LogicalExpression")throw new kt("Not a logical expression");return vr(t,{$type:"logicalExpression"},{})}function t8(t){if(t.type!=="MemberExpression")throw new kt("Not a member expression");return vr(t,{$type:"memberExpression"},{})}var Eh=new WeakMap;function Kt(t,r){if(Uw.has(typeof t))return t;if(K3.has(t.type))return t.value;if(Eh.has(t))return Eh.get(t);let e;switch(t.type){case"ObjectExpression":{e=Q3(t,r);break}case"ArrayExpression":{e=J3(t,r);break}case"CallExpression":{e=jw(t,r);break}case"ArrowFunctionExpression":{e=Y3(t,r);break}case"NewExpression":{e=qw(t,r);break}case"Identifier":{e=Z3(t);break}case"LogicalExpression":{e=e8(t);break}case"MemberExpression":{e=t8(t);break}case"TSAsExpression":case"TSSatisfiesExpression":{e=Kt(t.expression,r);break}default:throw new kt(`Casting "${t.type}" is not supported`,{ast:t,code:r?.$code})}return Eh.set(t,e),e}var wa=Js;function r8(t,r){let e=n=>{let s=n==="default"?"ExportDefaultDeclaration":"ExportNamedDeclaration";for(let o of t.body)if(o.type===s){if(n==="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===n)return a.init}}},i=(n,s)=>{let o=n==="default"?"ExportDefaultDeclaration":"ExportNamedDeclaration",a=Vt(s);for(let l of t.body)if(l.type===o){if(n==="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===n){u.init=a;return}}}t.body.push(n==="default"?wa.exportDefaultDeclaration(a):wa.exportNamedDeclaration(wa.variableDeclaration("const",[wa.variableDeclarator(wa.identifier(n),a)])))};return vr(t,{$type:"exports"},{get(n,s){let o=e(s);if(o)return Kt(o,r)},set(n,s,o){return i(s,o),!0},ownKeys(){return t.body.flatMap(n=>n.type==="ExportDefaultDeclaration"?["default"]:n.type==="ExportNamedDeclaration"&&n.declaration&&"declarations"in n.declaration?n.declaration.declarations.map(s=>"name"in s.id?s.id.name:""):[]).filter(Boolean)},deleteProperty(n,s){let o=s==="default"?"ExportDefaultDeclaration":"ExportNamedDeclaration";for(let a=0;a<t.body.length;a++){let l=t.body[a];if(l.type===o){if(s==="default")return t.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 t.body.splice(a,1),!0}}}return!1}})}function i8(t,r){let e=t.program;if(e.type!=="Program")throw new kt(`Cannot proxify ${t.type} as module`);let i={$code:r,$type:"module"},n=vr(e,i,{ownKeys(){return["imports","exports","generate"]}});return i.exports=r8(e,n),i.imports=H3(e),i.generate=s=>Lh(n,s),n}function Kw(t,r={}){let e={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},i=2,n=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=(t||"").split(`
|
|
1184
|
+
`),p=!1;for(let d of c){let h=d.trim();if(h.length!==0){if(e.wrapColumn&&d.length>o&&(o=d.length),e.indent){let f=d.match(/^\s+/)?.[0]||"";f.length>0&&(f.length>0&&f.length<i&&(i=f.length),f[0]===" "?n++:f.length>0&&n--)}if(h.at(-1)===";"?s++:h.length>0&&s--,e.quote||e.arrowParens){let f=h.matchAll(l);for(let g of f)if(g.groups)for(let m in u)g.groups[m]&&u[m]++}e.trailingComma&&((d.startsWith("}")||d.startsWith("]"))&&(p?a++:a--),p=h.endsWith(","))}}return{wrapColumn:o,useTabs:n>0,tabWidth:i,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 Vw(t,r){let e=Pw(t,{parser:r?.parser||$w(),...r});return i8(e,t)}function zw(t,r){let e=Pw("("+t+")",{parser:r?.parser||$w(),...r}),i=e.program.body[0];i.type==="ExpressionStatement"&&(i=i.expression),i.extra?.parenthesized&&(i.extra.parenthesized=!1);let n={$ast:e,$code:" "+t+" ",$type:"module"};return Kt(i,n)}function Lh(t,r={}){let e=t.$ast||t,i=r.format===!1||!("$code"in t)?{}:Kw(t.$code,r.format),{code:n,map:s}=$3(e,{...r,...i});return{code:n,map:s}}async function n8(t,r={}){let e=await Wu.promises.readFile(t,"utf8");return r.sourceFileName=r.sourceFileName??t,Vw(e,r)}async function s8(t,r,e){let i="$ast"in t?t.$ast:t,{code:n,map:s}=Lh(i,e);await Wu.promises.writeFile(r,n),s&&await Wu.promises.writeFile(r+".map",s)}var Ku=Js,o8={functionCall(t,...r){let e=Ku.callExpression(Ku.identifier(t),r.map(i=>Vt(i)));return jw(e)},newExpression(t,...r){let e=Ku.newExpression(Ku.identifier(t),r.map(i=>Vt(i)));return qw(e)},literal(t){return Vt(t)},raw(t){return zw(t)}};var a8=K(require("@sentry/node"),1);async function Jw(t,r){let e=await(0,Ct.readdir)(t,{withFileTypes:!0}),i=[];for(let n of e){let s=Ae.default.join(t,n.name);if(n.isDirectory()){if(!r.has(n.name)){let o=await Jw(s,r);i.push(...o)}}else i.push(s)}return i}async function Yw(t){let r=new Set,e=(...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)}},i=async u=>{let c=(0,Ww.createHash)("md5");return c.update(u),c.digest("hex")},n=Ae.default.normalize(t.cwd),s=jh(Ae.default.normalize(t.cwd))??n,o=Oa(Ae.default.normalize(t.cwd))??s,a={...Ae.default,getCwdDir:()=>n,getRepoRootDir:()=>s,getAppRootDir:()=>o,cwd:()=>process.cwd(),exists:async u=>{try{return await(0,Ct.access)(u),!0}catch{return!1}},magicast:Mh,existsSync:u=>(0,rt.existsSync)(u),readdir:async(u,c)=>{let p=await(0,Ct.readdir)(u);return c?p.map(d=>Ae.default.join(u,d)):p},readdirRecursive:async(u,c)=>Jw(u,new Set(c)),readdirSync:u=>(0,rt.readdirSync)(u),readFile:async u=>{try{return await(0,Ct.readFile)(u,"utf-8")}catch(c){if(c.code==="ENOENT")return null;throw e(c,u),c}},readFileSync(u){try{return(0,rt.readFileSync)(u,"utf-8")}catch(c){if(c.code==="ENOENT")return null;throw e(c,u),c}},spawnSync:Ys.spawnSync,stat:async u=>await(0,Ct.stat)(u),statSync:u=>(0,rt.statSync)(u),unlinkSync:u=>{(0,rt.unlinkSync)(u)},unlink:async u=>{await(0,Ct.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,Ct.mkdir)(Ae.default.dirname(u),{recursive:!0}),await(0,Ct.writeFile)(u,c);for(let d of r)await d(p)},hash:i,getDeviceId:()=>i(`${(0,ka.hostname)()}:${(0,ka.homedir)()}`),formatCode:async(u,c)=>{let p=null;try{p=await Bh.default.resolveConfig(u)}catch{}try{return Bh.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:e,launchEditor:async u=>{try{let c=u.filePath;typeof u.line=="number"&&(c+=`:${u.line}`,typeof u.column=="number"&&(c+=`:${u.column}`)),(0,Hw.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(t.cwd);return{remoteUrl:l8(u),defaultBranch:u8(u),commit:c8(u),currentBranch:p8(u)}},getFrameworks:()=>[],ts:Gw.default,Sentry:a8,version:"1.3.7",sdkVersion:null,ignoreMissingConfig:t.ignoreMissingConfig,kind:null},l=await Nn(a);return a.getFrameworks=()=>l,a}function Xw(){let t=(0,ka.homedir)();return Ae.default.join(t,".config","builder","dev-tools.json")}function $h(t,r){return typeof t=="object"&&t!=null&&r in t}async function Xs(){let t=Xw();try{let r=await(0,Ct.readFile)(t,"utf-8");if(typeof r=="string")return JSON.parse(r)}catch(r){if(r.code==="ENOENT")return null}return null}async function Uh(t){let r=Xw();t=typeof t=="object"&&t!=null?t:{},await(0,Ct.mkdir)(Ae.default.dirname(r),{recursive:!0}),await(0,Ct.writeFile)(r,JSON.stringify(t??{},null,2))}function l8(t){try{return((0,Ys.spawnSync)("git",["config","--get","remote.origin.url"],{cwd:t}).stdout||"").toString().trim()}catch(r){return console.error("Error getting git remote URL:",r),""}}function u8(t){let r="master";try{let e=(0,Ys.spawnSync)("git",["branch","-r"],{cwd:t});return e.stdout&&e.stdout.toString().trim().split(`
|
|
1185
1185
|
`).map(n=>n.trim()).includes("origin/main")?"main":r}catch(e){return console.error("Error getting git default branch name:",e.toString().split(`
|
|
1186
|
-
`)[0]),r}}function c8(t){try{return((0,Ys.spawnSync)("git",["rev-parse","HEAD"],{cwd:t}).stdout||"").toString().trim()}catch(r){return console.error("Error getting git commit:",r),""}}function p8(t){try{return((0,Ys.spawnSync)("git",["branch","--show-current"],{cwd:t}).stdout||"").toString().trim()}catch(r){return console.error("Error getting current branch name:",r),""}}function jh(t){let r=Ae.default.resolve("/");for(let e=0;e<20;e++){let i=Ae.default.join(t,"package.json");if((0,rt.existsSync)(i))return t;if(t===r)break;t=Ae.default.dirname(t)}return null}function Oa(t){let r=Ae.default.resolve("/");for(let e=0;e<20;e++){if((0,rt.existsSync)(Ae.default.join(t,"package.json"))||(0,rt.existsSync)(Ae.default.join(t,"remix.config.js"))||(0,rt.existsSync)(Ae.default.join(t,"remix.config.mjs"))||(0,rt.existsSync)(Ae.default.join(t,"remix.config.ts"))||(0,rt.existsSync)(Ae.default.join(t,"vite.config.js"))||(0,rt.existsSync)(Ae.default.join(t,"vite.config.ts"))||(0,rt.existsSync)(Ae.default.join(t,"vite.config.mjs"))||(0,rt.existsSync)(Ae.default.join(t,"next.config.js"))||(0,rt.existsSync)(Ae.default.join(t,"next.config.ts"))||(0,rt.existsSync)(Ae.default.join(t,"angular.json"))||(0,rt.existsSync)(Ae.default.join(t,"project.json"))||(0,rt.existsSync)(Ae.default.join(t,"tsconfig.json")))return t;if(t===r)break;t=Ae.default.dirname(t)}return null}var Qw=K(require("crypto")),sc=new Uint8Array(256),nc=sc.length;function qh(){return nc>sc.length-16&&(Qw.default.randomFillSync(sc),nc=0),sc.slice(nc,nc+=16)}var
|
|
1186
|
+
`)[0]),r}}function c8(t){try{return((0,Ys.spawnSync)("git",["rev-parse","HEAD"],{cwd:t}).stdout||"").toString().trim()}catch(r){return console.error("Error getting git commit:",r),""}}function p8(t){try{return((0,Ys.spawnSync)("git",["branch","--show-current"],{cwd:t}).stdout||"").toString().trim()}catch(r){return console.error("Error getting current branch name:",r),""}}function jh(t){let r=Ae.default.resolve("/");for(let e=0;e<20;e++){let i=Ae.default.join(t,"package.json");if((0,rt.existsSync)(i))return t;if(t===r)break;t=Ae.default.dirname(t)}return null}function Oa(t){let r=Ae.default.resolve("/");for(let e=0;e<20;e++){if((0,rt.existsSync)(Ae.default.join(t,"package.json"))||(0,rt.existsSync)(Ae.default.join(t,"remix.config.js"))||(0,rt.existsSync)(Ae.default.join(t,"remix.config.mjs"))||(0,rt.existsSync)(Ae.default.join(t,"remix.config.ts"))||(0,rt.existsSync)(Ae.default.join(t,"vite.config.js"))||(0,rt.existsSync)(Ae.default.join(t,"vite.config.ts"))||(0,rt.existsSync)(Ae.default.join(t,"vite.config.mjs"))||(0,rt.existsSync)(Ae.default.join(t,"next.config.js"))||(0,rt.existsSync)(Ae.default.join(t,"next.config.ts"))||(0,rt.existsSync)(Ae.default.join(t,"angular.json"))||(0,rt.existsSync)(Ae.default.join(t,"project.json"))||(0,rt.existsSync)(Ae.default.join(t,"tsconfig.json")))return t;if(t===r)break;t=Ae.default.dirname(t)}return null}var Qw=K(require("crypto")),sc=new Uint8Array(256),nc=sc.length;function qh(){return nc>sc.length-16&&(Qw.default.randomFillSync(sc),nc=0),sc.slice(nc,nc+=16)}var Tt=[];for(let t=0;t<256;++t)Tt.push((t+256).toString(16).slice(1));function Zw(t,r=0){return Tt[t[r+0]]+Tt[t[r+1]]+Tt[t[r+2]]+Tt[t[r+3]]+"-"+Tt[t[r+4]]+Tt[t[r+5]]+"-"+Tt[t[r+6]]+Tt[t[r+7]]+"-"+Tt[t[r+8]]+Tt[t[r+9]]+"-"+Tt[t[r+10]]+Tt[t[r+11]]+Tt[t[r+12]]+Tt[t[r+13]]+Tt[t[r+14]]+Tt[t[r+15]]}var eT=K(require("crypto")),Kh={randomUUID:eT.default.randomUUID};function d8(t,r,e){if(Kh.randomUUID&&!r&&!t)return Kh.randomUUID();t=t||{};let i=t.random||(t.rng||qh)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,r){e=e||0;for(let n=0;n<16;++n)r[e+n]=i[n];return r}return Zw(i)}var Vh=d8;var Wh=K(require("os"),1);async function tT(){let t=!0==="true"&&process.env.NODE_ENV!=="test",r=await nT(),e=await iT();mi.init(t?"2532be1b0436a18cb938b21fc7fa9faf":"",{logLevel:mi.Types.LogLevel.None,flushIntervalMillis:500});let i=new mi.Identify;await mi.identify(i,{device_id:r,user_id:e,platform:Wh.default.type(),os_name:process.platform,os_version:Wh.default.release()}).promise,En.init({dsn:"https://3252dddc08dbb5bf406dc33bf3c13633@o117565.ingest.us.sentry.io/4505630794448896",tracesSampleRate:1,release:zS,environment:process.env.NODE_ENV,enabled:t,integrations:[new En.Integrations.Http({tracing:!0}),...En.autoDiscoverNodePerformanceMonitoringIntegrations()]}),En.setUser({username:process.env.USER||process.env.USERNAME||"unknown"})}async function ft(t,r,e){let i={...r,app:"dev-tools-cli",package:"cli"};return mi.track(t,i,{...e,user_id:await iT(),device_id:await nT()})}var oc,zh;async function rT(t){oc=t;let r=await Xs();await Uh({...r,userId:t})}async function iT(){if(oc)return oc;let t=await Xs(),r;return $h(t,"userId")&&(r=t.userId),oc=r,r}async function nT(){if(zh)return zh;let t=await Xs(),r=Vh();return $h(t,"deviceId")?r=t.deviceId:await Uh({...t,deviceId:r}),zh=r,r}function Hi(t){switch(ft("cli help",{subcommand:t}),console.log(""),It((0,$.bgCyan)((0,$.bold)((0,$.white)(" builder.io figma ")))+" "+(0,$.dim)("1.3.7")),t){case"add":case"generate":case"gen":case"g":q.info(`${(0,$.cyan)("\u2192")} ${(0,$.bold)("Generate Figma Components")}
|
|
1187
1187
|
|
|
1188
1188
|
${(0,$.bgGreen)((0,$.white)(" npx builder.io figma generate URL [URL ...] "))}
|
|
1189
1189
|
|
|
@@ -1266,8 +1266,8 @@ ${(0,$.yellow)("Arguments:")}
|
|
|
1266
1266
|
`),[{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:e,description:i})=>{q.info(`${(0,$.cyan)("\u2192")} ${(0,$.bgGreen)((0,$.white)(` npx builder.io figma ${e} `))}
|
|
1267
1267
|
${(0,$.dim)(i)}
|
|
1268
1268
|
`)}),q.info(`
|
|
1269
|
-
Use ${(0,$.cyan)("npx builder.io figma help <command>")} for detailed help about a command`)}Mt("bye \u{1F44B}")}var Yh=K(require("@sentry/node"),1);var ac=K(require("@sentry/node"),1);var sT=require("undici"),
|
|
1270
|
-
npx builder.io figma generate "https://..."`),Hi(),await oe(1);console.log(""),
|
|
1269
|
+
Use ${(0,$.cyan)("npx builder.io figma help <command>")} for detailed help about a command`)}Mt("bye \u{1F44B}")}var Yh=K(require("@sentry/node"),1);var ac=K(require("@sentry/node"),1);var sT=require("undici"),ht=async(t,r)=>{let e="fetch"in globalThis?globalThis.fetch:sT.fetch;try{return await e(t,r)}catch(i){let n=typeof t=="string"?t:t instanceof URL?t.toString():t.url,s=r?.method||"GET",o=i instanceof Error?i.message:String(i),a=new Error(`Fetch failed for ${s} ${n}: ${o}`);throw i instanceof Error&&(a.cause=i),a.requestContext={url:n,method:s,headers:r?.headers},a}};var f8="https://cdn.builder.io";async function Gh(t){try{let r=await ht(`${f8}/api/internal/kv/${t.spaceId}/${t.docId}?apiKey=${t.spaceId}`,{headers:{Authorization:`Bearer ${t.privateKey}`}});if(r.status===404)return ac.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){ac.captureException(r),console.error("GET failed",r);return}}var La=K(aT(),1);var lT=K(require("@sentry/node"),1),uT=K(Cu(),1);async function oe(t){if(process.env.NODE_ENV!=="test")try{await Promise.allSettled([lT.flush(2e3),uT.flush().promise])}catch(r){console.error(r)}process.exit(t)}var gi=process.env.AIR_HOST||"https://air-layout-v2-tk43uighdq-uc.a.run.app";var hT=async(t,r)=>{let e=r._.slice(2);if(!e.length)return pe(`No Figma URL provided, use:
|
|
1270
|
+
npx builder.io figma generate "https://..."`),Hi(),await oe(1);console.log(""),It((0,H.bgMagenta)((0,H.bold)((0,H.white)(" figma generate ")))+" "+(0,H.dim)("1.3.7")),q.message((0,H.dim)(`This command will help you create new ".mapper.tsx" files to connect Figma components to your code components.
|
|
1271
1271
|
Check out `)+(0,H.bold)((0,H.cyan)("https://www.builder.io/c/docs/cli-mapping"))+(0,H.dim)(" for more details."));let{figmaAuth:i,builderPublicKey:n,builderPrivateKey:s,userId:o}=await wr(t,r,{forceSpaceId:r.spaceId,figmaAuth:!0,builderPublicKey:!0,builderPrivateKey:!0});if(!s||!n)return pe("Missing builder.io credentials"),await oe(1);if(!i?.access_token)return pe("Figma Auth failed, try again."),await oe(1);ft("figma generate started",{spaceId:n});let l=Kn(fn),u=nr();u.start("Loading local repo");let c;try{c=await ln(t),u.stop("Local repo loaded")}catch{u.stop("Repo's framework is not supported")}let p,d;u=nr(),u.start("Gathering Figma component info");let h=await D8(i,{privateKey:s,spaceId:n},e),f=await c?.getRegistry({readAllInputTypes:!0});u.stop("Figma component info loaded");let g=await Ma(t),{figmaBuilderLinks:m}=await em({figmaAuth:i,force:!0,print:!1,mappingFiles:g,sys:t});if(h.length>1){let b=await ng({message:`Pick which ${(0,H.magenta)("\u2756")} Figma components you want to connect to code:`,required:!0,options:h.map(([,C])=>({label:`${C.name}${m.some(D=>D.figmaKey===C.key)?(0,H.dim)(" (already mapped)"):""}`,value:C.key})),initialValues:h.map(([,C])=>C.key).filter(C=>!m.some(D=>D.figmaKey===C))});if(Oe(b))return pe("Mapping not saved, goodbye!"),await oe(1);h=h.filter(([,C])=>b.includes(C.key))}let y=[];for(let b=0;b<h.length;b++){let[C,D]=h[b];b>0&&q.info(`Mapped ${b} / ${h.length} components:
|
|
1272
1272
|
|
|
1273
1273
|
${h.map(([,_],B)=>b>B?_.documentName==="-"?(0,H.dim)(` \u2756 ${_.name}`)+" "+(0,H.yellow)("(skipped)"):(0,H.green)(` \u2714 ${_.name} \u2192 <${_.documentName} />`):b===B?(0,H.underline)(` \u2192 ${_.name}`):(0,H.dim)(` \u2756 ${_.name}`)).filter(Boolean).join(`
|
|
@@ -1277,10 +1277,10 @@ ${h.map(([,_],B)=>b>B?_.documentName==="-"?(0,H.dim)(` \u2756 ${_.name}`)+" "+(0
|
|
|
1277
1277
|
|
|
1278
1278
|
// \u2756 ${D.name}
|
|
1279
1279
|
`+G.figmaInterface).value),q.message((0,H.bgCyan)((0,H.bold)((0,H.white)(" Streaming >> ")))),console.log("");let N=(0,H.bgCyan)((0,H.bold)((0,H.white)(" << ")));w=await I8(G,n,o,s,(V,ue)=>{let ee=l.highlight("typescript",ue).value.split(`
|
|
1280
|
-
`).map(ae=>(0,H.dim)("\u2502 ")+ae);if(P>0){let ae=Math.max(0,P-1),ct=ee.slice(Math.max(0,ae)),
|
|
1280
|
+
`).map(ae=>(0,H.dim)("\u2502 ")+ae);if(P>0){let ae=Math.max(0,P-1),ct=ee.slice(Math.max(0,ae)),mt=Math.min(P,1);mt>0&&(Hh.default.moveCursor(process.stdout,0,-mt),Hh.default.clearScreenDown(process.stdout)),process.stdout.write(ct.join(`
|
|
1281
1281
|
`)+N+`
|
|
1282
1282
|
`)}else process.stdout.write(ee.join(`
|
|
1283
|
-
`));P=ee.length});let O=await Lt({message:`How does the mapping look? ${(0,H.dim)('Reply "good", or provide feedback (Ctrl+C to exit)')}`,defaultValue:"good",placeholder:"good"});if(Oe(O))return pe("Mapping not saved, goodbye!"),await oe(1);if(O.trim()==="good")break;ft("figma add follow up prompt",{spaceId:n,prompt:O}),B=O}}catch(P){return Yh.captureException(P),pe("LLM failed:"+String(P)),await oe(1)}}else{let _=await
|
|
1283
|
+
`));P=ee.length});let O=await Lt({message:`How does the mapping look? ${(0,H.dim)('Reply "good", or provide feedback (Ctrl+C to exit)')}`,defaultValue:"good",placeholder:"good"});if(Oe(O))return pe("Mapping not saved, goodbye!"),await oe(1);if(O.trim()==="good")break;ft("figma add follow up prompt",{spaceId:n,prompt:O}),B=O}}catch(P){return Yh.captureException(P),pe("LLM failed:"+String(P)),await oe(1)}}else{let _=await gt({message:`Create placeholder mapper for ${(0,H.magenta)(`\u2756 ${D.name}`)}?`,initialValue:!0,active:"Yes",inactive:"Skip"});if(!_||Oe(_)){D.documentName="-",q.warning(`Skipping mapping for ${(0,H.magenta)(`\u2756 ${D.name}`)}`);continue}E="",x={id:D.key,exportName:yi(D.name),importPath:"@components",importName:yi(D.name),exportType:"named",isRegistered:!0,name:yi(D.name),filePath:"./placeholder",inputs:[],relFilePath:"./placeholder.tsx"},w=`function Mapper(figma: BaseFigmaProps) {
|
|
1284
1284
|
return (
|
|
1285
1285
|
<${x.importName} />
|
|
1286
1286
|
);
|
|
@@ -1306,7 +1306,7 @@ ${y.map(b=>` - ${b}`).join(`
|
|
|
1306
1306
|
`)+(0,H.bgBlack)((0,H.white)((0,H.bold)(" npx builder.io figma publish ")))+`
|
|
1307
1307
|
|
|
1308
1308
|
`+(0,H.dim)("Read more: https://www.builder.io/c/docs/cli-mapping#publishing-a-new-mapping")),ft("figma add success",{spaceId:n,mappingPath:p})):Mt("No new mappings were created.")},Xh=t=>{let r=new URL(t);if(!t.startsWith("https://www.figma.com/design/"))return null;let e=r.searchParams.get("node-id")?.replaceAll("-",":"),i=r.pathname.split("/")[2];return e&&i?{fileID:i,nodeId:e}:null};async function y8(t){let r=await Lt({message:`Where do you want to save the new mapping? ${(0,H.dim)("(Ctrl+C to exit)")}`,defaultValue:t,placeholder:t,initialValue:t,validate(e){if((0,fT.isAbsolute)(e))return"Please enter a relative path, not absolute";if(!e.endsWith(".mapper.tsx")&&!e.endsWith(".mapper.jsx"))return"Please enter a path that ends with '.mapper.tsx'";if(Ra.default.existsSync(e))return"File already exists, please choose a different name"}});return Oe(r)?(pe("Mapping not saved, goodbye!"),await oe(1)):r}var b8=/^[a-f0-9]{40}$/;async function D8(t,r,e){return(await Promise.all(e.map(async n=>{let s,o;if(n.match(b8))try{let c=await Gh({...r,docId:n});if(c)return[[n,c]];let p;try{p=await mT(`components/${n}`,{auth:t}),s=p.meta.file_key,o=p.meta.node_id}catch{q.warning("Failed to fetch component from Figma API.")}}catch(c){throw Yh.captureException(c),c}if(!s||!o){let c;try{c=Xh(n)}catch{}if(!c)return pe(`Invalid Figma URL, use Cmd+L while selecting a figma component to get a link to selection.
|
|
1309
|
-
Or make sure the command is copied correctly from the Figma plugin and the same builder space is being used.`),await oe(1);c&&({fileID:s,nodeId:o}=c)}let a=await Qh(t,s,o),l=DT(a[o].document,a[o].components);if(l){let c=(await Promise.all(Array.from(l).map(async([,p])=>await Gh({...r,docId:p.key})))).filter(pT);if(c.length)return c.map(p=>[n,p])}let u=await _8(a[o],o);return u?[[n,u]]:[]}))).flat().filter(pT)}var Qh=async(t,r,e,i)=>(await mT(`files/${r}/nodes`,{auth:t,params:{ids:e,depth:i}})).nodes,x8="https://api.figma.com/v1/",mT=async(t,{auth:r,params:e})=>{let i=new URL(`${x8}${t}`),n={};if(r.oauth?n.Authorization=`Bearer ${r.access_token}`:n["X-FIGMA-TOKEN"]=r.access_token,e)for(let o in e)e[o]!=null&&i.searchParams.set(o,e[o].toString());let s=await
|
|
1309
|
+
Or make sure the command is copied correctly from the Figma plugin and the same builder space is being used.`),await oe(1);c&&({fileID:s,nodeId:o}=c)}let a=await Qh(t,s,o),l=DT(a[o].document,a[o].components);if(l){let c=(await Promise.all(Array.from(l).map(async([,p])=>await Gh({...r,docId:p.key})))).filter(pT);if(c.length)return c.map(p=>[n,p])}let u=await _8(a[o],o);return u?[[n,u]]:[]}))).flat().filter(pT)}var Qh=async(t,r,e,i)=>(await mT(`files/${r}/nodes`,{auth:t,params:{ids:e,depth:i}})).nodes,x8="https://api.figma.com/v1/",mT=async(t,{auth:r,params:e})=>{let i=new URL(`${x8}${t}`),n={};if(r.oauth?n.Authorization=`Bearer ${r.access_token}`:n["X-FIGMA-TOKEN"]=r.access_token,e)for(let o in e)e[o]!=null&&i.searchParams.set(o,e[o].toString());let s=await ht(i,{headers:n});if(!s.ok)throw new Error(`Figma REST ${s.statusText}: ${await s.text()}`);return s.json()};function gT(t,r){let e=r.types,i=[];return e.includes(t.type)&&i.push(t),"children"in t&&i.push(...t.children.flatMap(n=>gT(n,r))),i}function E8(t){let r=[],e={};try{e=t.componentPropertyDefinitions??{}}catch(l){console.error("Invalid Component Property Definitions",l)}let i=t.type==="COMPONENT_SET"?t.children:[t],n=new Map,s=[],o=Object.keys(e),a=S8(o);for(let l of i){let u=gT(l,{types:["INSTANCE","TEXT"]});for(let c of u){s.push(c);let p=c.componentPropertyReferences;p&&p.visible&&(p.characters&&n.set(p.characters,a(p.visible)),p.mainComponent&&n.set(p.mainComponent,a(p.visible)))}}for(let l of o){let u=e[l];switch(u.type){case"TEXT":{r.push({id:l,name:a(l),value:u.defaultValue,type:"string",baseType:"text",isDefault:!0,ref:n.get(l)});break}case"BOOLEAN":{r.push({id:l,name:a(l),value:!!u.defaultValue,baseType:"boolean",isDefault:!0,type:"boolean"});break}case"VARIANT":{r.push({id:l,name:a(l),value:u.defaultValue,type:u.variantOptions?.map(c=>`'${c}'`).join(" | ")??"string",baseType:"variant",variantOptions:u.variantOptions??[],isDefault:!0,ref:n.get(l)});break}case"INSTANCE_SWAP":{r.push({id:l,name:a(l),value:String(u.defaultValue),type:"React.ReactNode",baseType:"slot",isDefault:!0,ref:n.get(l)});break}}}return{inputs:r,nameMap:a}}function C8(t,r){let{inputs:e,nameMap:i}=E8(r);return{name:r.name,jsx:r.type==="COMPONENT_SET"?Jh(r.children[0],i,0,0):Jh(r,i,0,0),inputs:e,key:r.key,description:r.description,documentationLinks:[],instanceId:t.includes(":")?t:r.id,documentName:"",tree:""}}var yT=/[^\x00-\x7F]/g;function cT(t){return typeof t=="string"?t.replace(/#\d+:\d+$/,"").replace(yT,"").trim():""}function S8(t){let r=new Map,e=new Map;return t.forEach(i=>{let n=cT(i);e.has(n)?(r.has(i)&&(r.set(e.get(n),e.get(n)),r.delete(n)),r.set(i,i)):(r.set(i,n),e.set(n,i))}),i=>{let n=r.get(i)??cT(i);if(!n)throw new Error("No value for key "+i);return n}}var Jh=(t,r,e,i,n=-1)=>{let s=" ".repeat(Math.max(n+1,0)),o="",a=t.type,l=a==="GROUP"||a==="FRAME"||n<0&&"children"in t,u="",c=n>=0;if(c){let p="";if(t.type==="INSTANCE"){if(t.componentPropertyReferences&&t.componentPropertyReferences.mainComponent)return o+=`${s}{figma["${r(t.componentPropertyReferences.mainComponent)}"]}
|
|
1310
1310
|
`,o;u=t.type}u===""&&(u=t.type),(t.type!=="TEXT"||!t.autoRename)&&(p+=` name="${t.name}"`),t.componentPropertyReferences&&t.componentPropertyReferences.visible&&(p+=` visible={figma["${r(t.componentPropertyReferences.visible)}"]}`),o+=`${s}<${u}${p}`}if(t.type==="TEXT")c&&(o+=`>
|
|
1311
1311
|
`),t.componentPropertyReferences&&t.componentPropertyReferences.characters?o+=`${s} {figma["${r(t.componentPropertyReferences.characters)}"]}
|
|
1312
1312
|
`:o+=`${s} ${t.characters}
|
|
@@ -1321,23 +1321,23 @@ ${(t.inputs||[]).filter(s=>P8(s)).map(s=>` ${bT(s.name)}${s.required?"":"?"}: $
|
|
|
1321
1321
|
${w8(r,e,n)}`,u=`interface Figma${o}Props extends BaseFigmaProps {
|
|
1322
1322
|
${t.inputs.map(p=>` ${bT(p.name)}?: ${Zh(p)};${p.ref?` // when "${p.ref}" is true`:""}`).join(`
|
|
1323
1323
|
`)}
|
|
1324
|
-
}`,c=`${i?t.jsx:t.tree}`;return{figmaInterface:u,figmaTree:c,componentRegistry:a,figmaComponentName:o,reactInterface:l}}var A8=new Set(["id","class","className","key","hidden","style","styles","css","ref"]),P8=t=>!(A8.has(t.name)||t.type==="object"||/^[A-Z_]/.test(t.name)||/^on[A-Z]/.test(t.name)||Zh(t)==="null"),Zh=t=>t.type==="reference"?"ReactNode":t.type==="file"||t.type==="richText"?"string":t.enum?t.enum.map(r=>`'${r}'`).join(" | "):t.meta?.ts?t.meta.ts:t.type,bT=t=>/^[a-zA-Z_]\w*$/.test(t)?t:`"${t}"`;async function I8(t,r,e,i,n){let s=new URL(`${gi}/mappings/completions`);r&&s.searchParams.set("apiKey",r),e&&s.searchParams.set("userId",e);let o=await
|
|
1325
|
-
Double click and select "Go to main component", then copy the URL to the figma COMPONENT`),pe(n),await oe(1)}let i=t.components[r]?.key??t.componentSets[r]?.key;return i?(t.document.key=i,C8(r,e)):(pe("Pasted URL does not correspond to a component or component set"),await oe(1))}function pT(t){return t!=null}function DT(t,r,e=new Map){debugger;if(t.componentId&&e.set(t.componentId,r[t.componentId]),t.children)for(let i of t.children)DT(i,r,e);return e}async function N8(t){if(!t){let l=await Lt({message:"Enter the import path to the component you want to map to:",placeholder:"@mui/material",validate(u){if(!u)return"Import path cannot be empty";if(!/^(@[a-z0-9-~][a-z0-9-._~]*\/)?[a-z0-9-~][a-z0-9-._~]*(\/.+)?$/i.test(u))return"Invalid import path format. Please use a valid ESM import path."}});return Oe(l)?(pe("Mapping not saved, goodbye!"),await oe(1)):l}let r=await t.findAllDependencies();if(!r||r.length===0)return null;let e=r.filter(l=>!F8(l.name));if(e.length===0)return null;let i=e.map(l=>({title:l.name,value:l.name})),n=await(0,lc.default)({type:"autocomplete",name:"package",message:"Select an installed external package:",hint:"Type or use arrow keys. Press Enter to select",choices:i,async suggest(l,u){return l=l.toLowerCase(),u.map(p=>{let d=p.value.trim().toLowerCase(),h=0;return l.length===0?h=0:h=(0,La.distance)(l,d),{...p,distance:h}}).sort((p,d)=>p.distance-d.distance).filter(p=>p.title.toLowerCase().includes(l))}});if(!n.package)return pe("Package selection cancelled"),await oe(1);let s=n.package,o=e.find(l=>l.name===n.package);function a(l){return/^[A-Z]/.test(l)}if(o&&o.subPackages.length>0){let l=o.subPackages.filter(u=>!xT.has(u)&&a(u));if(l.length>0){let u=[{title:`${o.name} ${(0,H.dim)("(Ctrl+C)")}`,value:null},...l.map(p=>({title:`${(0,H.dim)(o.name)}/${p}`,value:p}))],c=await(0,lc.default)({type:"autocomplete",name:"subPackage",message:"Select a component subpackage (optional):",hint:"Type or use arrow keys. Press Enter to select",async suggest(p,d){return p=p.toLowerCase().replace(o.name,""),d.map(f=>{if(f.value===null)return{...f,distance:0};let g=f.value?f.value.trim().toLowerCase():o.name,m=0;return p.length===0?m=0:m=(0,La.distance)(p,g),{...f,distance:m}}).sort((f,g)=>f.distance-g.distance).filter(f=>f.title.toLowerCase().includes(p))},choices:u});c.subPackage!==`${o.name} ${(0,H.dim)("(Ctrl+C)")}`&&(s=`${n.package}/${c.subPackage}`)}}return s}var xT=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","constants","types","interfaces","hooks","context","providers","store","reducers","actions","services","api","clsx","class-variance-authority","lucide-react","dotenv"]),F8=t=>t.startsWith("@types")||t.startsWith("@emotion")||t.startsWith("@builder.io")||t.startsWith("eslint")||t.startsWith("prettier")||t.startsWith("jest")||t.startsWith("lodash")||t.includes("autoprefixer")||t.includes("tailwind")||t.includes("postcss")||t.includes("webpack")||t.includes("babel")||t.includes("typescript")||t.includes("rollup")||t.includes("vite")||t.includes("esbuild")||t.includes("storybook")||t.includes("testing-library")||t.includes("cypress")?!0:xT.has(t);async function dT(t,r,e){let i="",n=r.toLowerCase();function s(l){let u=l.importName.toLowerCase(),c=(0,La.distance)(u,n);return u.includes(n)&&(c-=n.length),c}let o=t.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,H.bold)((0,H.yellow)("\u2605 ")+u):u=u,{title:i+u+(0,H.dim)(` from '${l.importPath}'`),value:l}});return o.push({title:i+"\u23ED\uFE0F Skip "+(0,H.dim)("(Ctrl+C)"),value:"skip"}),e&&o.push({title:i+"\u{1F4E6} External npm package",value:"external package"}),(await(0,lc.default)({type:"autocomplete",name:"component",message:`Select a code component to map ${(0,H.bold)((0,H.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?n:l;return u.map(d=>{let h=(typeof d.value=="string"?d.value:d.value.importName).trim().toLowerCase(),f=0;return l.length===0&&typeof d.value=="string"?f=2:(f=(0,La.distance)(c,h),h.includes(n)&&(f-=n.length),typeof d.value=="string"&&(f+=1e3)),{...d,distance:f}}).sort((d,h)=>d.distance-h.distance).filter(d=>d.value==="external package"||d.value==="skip"?!0:d.title.toLowerCase().includes(l))},choices:o})).component}var CT=async(t,r)=>{let e=uc(r);console.log(""),
|
|
1324
|
+
}`,c=`${i?t.jsx:t.tree}`;return{figmaInterface:u,figmaTree:c,componentRegistry:a,figmaComponentName:o,reactInterface:l}}var A8=new Set(["id","class","className","key","hidden","style","styles","css","ref"]),P8=t=>!(A8.has(t.name)||t.type==="object"||/^[A-Z_]/.test(t.name)||/^on[A-Z]/.test(t.name)||Zh(t)==="null"),Zh=t=>t.type==="reference"?"ReactNode":t.type==="file"||t.type==="richText"?"string":t.enum?t.enum.map(r=>`'${r}'`).join(" | "):t.meta?.ts?t.meta.ts:t.type,bT=t=>/^[a-zA-Z_]\w*$/.test(t)?t:`"${t}"`;async function I8(t,r,e,i,n){let s=new URL(`${gi}/mappings/completions`);r&&s.searchParams.set("apiKey",r),e&&s.searchParams.set("userId",e);let o=await ht(s,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${i}`},body:JSON.stringify(t)});if(!o.ok)throw new Error("Fetch to server failed");if(o.body){let a="",l=o.body.getReader(),u,c;for(;!u;){if({value:c,done:u}=await l.read(),u)return a;let p=new TextDecoder().decode(c);a+=p,n(p,a)}return a}}async function _8(t,r){let e=t.document;if(e.type!=="COMPONENT"&&e.type!=="COMPONENT_SET"){let n=`Seems like the pasted URL points to a ${e.type} node, not a COMPONENT or COMPONENT_SET.`;return e.type==="INSTANCE"&&(n+=`
|
|
1325
|
+
Double click and select "Go to main component", then copy the URL to the figma COMPONENT`),pe(n),await oe(1)}let i=t.components[r]?.key??t.componentSets[r]?.key;return i?(t.document.key=i,C8(r,e)):(pe("Pasted URL does not correspond to a component or component set"),await oe(1))}function pT(t){return t!=null}function DT(t,r,e=new Map){debugger;if(t.componentId&&e.set(t.componentId,r[t.componentId]),t.children)for(let i of t.children)DT(i,r,e);return e}async function N8(t){if(!t){let l=await Lt({message:"Enter the import path to the component you want to map to:",placeholder:"@mui/material",validate(u){if(!u)return"Import path cannot be empty";if(!/^(@[a-z0-9-~][a-z0-9-._~]*\/)?[a-z0-9-~][a-z0-9-._~]*(\/.+)?$/i.test(u))return"Invalid import path format. Please use a valid ESM import path."}});return Oe(l)?(pe("Mapping not saved, goodbye!"),await oe(1)):l}let r=await t.findAllDependencies();if(!r||r.length===0)return null;let e=r.filter(l=>!F8(l.name));if(e.length===0)return null;let i=e.map(l=>({title:l.name,value:l.name})),n=await(0,lc.default)({type:"autocomplete",name:"package",message:"Select an installed external package:",hint:"Type or use arrow keys. Press Enter to select",choices:i,async suggest(l,u){return l=l.toLowerCase(),u.map(p=>{let d=p.value.trim().toLowerCase(),h=0;return l.length===0?h=0:h=(0,La.distance)(l,d),{...p,distance:h}}).sort((p,d)=>p.distance-d.distance).filter(p=>p.title.toLowerCase().includes(l))}});if(!n.package)return pe("Package selection cancelled"),await oe(1);let s=n.package,o=e.find(l=>l.name===n.package);function a(l){return/^[A-Z]/.test(l)}if(o&&o.subPackages.length>0){let l=o.subPackages.filter(u=>!xT.has(u)&&a(u));if(l.length>0){let u=[{title:`${o.name} ${(0,H.dim)("(Ctrl+C)")}`,value:null},...l.map(p=>({title:`${(0,H.dim)(o.name)}/${p}`,value:p}))],c=await(0,lc.default)({type:"autocomplete",name:"subPackage",message:"Select a component subpackage (optional):",hint:"Type or use arrow keys. Press Enter to select",async suggest(p,d){return p=p.toLowerCase().replace(o.name,""),d.map(f=>{if(f.value===null)return{...f,distance:0};let g=f.value?f.value.trim().toLowerCase():o.name,m=0;return p.length===0?m=0:m=(0,La.distance)(p,g),{...f,distance:m}}).sort((f,g)=>f.distance-g.distance).filter(f=>f.title.toLowerCase().includes(p))},choices:u});c.subPackage!==`${o.name} ${(0,H.dim)("(Ctrl+C)")}`&&(s=`${n.package}/${c.subPackage}`)}}return s}var xT=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","constants","types","interfaces","hooks","context","providers","store","reducers","actions","services","api","clsx","class-variance-authority","lucide-react","dotenv"]),F8=t=>t.startsWith("@types")||t.startsWith("@emotion")||t.startsWith("@builder.io")||t.startsWith("eslint")||t.startsWith("prettier")||t.startsWith("jest")||t.startsWith("lodash")||t.includes("autoprefixer")||t.includes("tailwind")||t.includes("postcss")||t.includes("webpack")||t.includes("babel")||t.includes("typescript")||t.includes("rollup")||t.includes("vite")||t.includes("esbuild")||t.includes("storybook")||t.includes("testing-library")||t.includes("cypress")?!0:xT.has(t);async function dT(t,r,e){let i="",n=r.toLowerCase();function s(l){let u=l.importName.toLowerCase(),c=(0,La.distance)(u,n);return u.includes(n)&&(c-=n.length),c}let o=t.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,H.bold)((0,H.yellow)("\u2605 ")+u):u=u,{title:i+u+(0,H.dim)(` from '${l.importPath}'`),value:l}});return o.push({title:i+"\u23ED\uFE0F Skip "+(0,H.dim)("(Ctrl+C)"),value:"skip"}),e&&o.push({title:i+"\u{1F4E6} External npm package",value:"external package"}),(await(0,lc.default)({type:"autocomplete",name:"component",message:`Select a code component to map ${(0,H.bold)((0,H.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?n:l;return u.map(d=>{let h=(typeof d.value=="string"?d.value:d.value.importName).trim().toLowerCase(),f=0;return l.length===0&&typeof d.value=="string"?f=2:(f=(0,La.distance)(c,h),h.includes(n)&&(f-=n.length),typeof d.value=="string"&&(f+=1e3)),{...d,distance:f}}).sort((d,h)=>d.distance-h.distance).filter(d=>d.value==="external package"||d.value==="skip"?!0:d.title.toLowerCase().includes(l))},choices:o})).component}var CT=async(t,r)=>{let e=uc(r);console.log(""),It((0,he.bgCyan)((0,he.bold)((0,he.white)(" figma publish ")))+" "+(0,he.dim)("1.3.7"));let{builderPrivateKey:i,builderPublicKey:n,userId:s,spaceName:o,figmaAuth:a}=await wr(t,r,{forceSpaceId:r.spaceId,builderPrivateKey:!0,builderPublicKey:!0,figmaAuth:!0}),l;l||(l=await ln(t));let u=await Ma(t);ft("figma publish started",{spaceId:n,mappingFiles:u.length});let{figmaBuilderLinks:c,foundErrors:p}=await em({figmaAuth:a,force:r.force,mappingFiles:u,sys:t,print:!0});if(p){if(ft("figma publish user error",{spaceId:n,mappingFiles:u.length,figmaBuilderLinks:c.length}),r.force!==!0)return q.message(""),pe(`Please fix the issues and try again, or use the ${(0,he.bold)("--force")} flag to publish regardless.`),await oe(1);q.warn("Local mappings contain some errors, but --force flag was used, skipping.")}let d=o?`${(0,he.bold)(o)} ${(0,he.dim)("("+n+")")}`:`space id "${(0,he.bold)(n)}"`;if(u.length===0){q.warning(`No mappings found. Publishing will remove all existing mapping in space: ${d}.`);let m=e||r.yes||await gt({message:"Do you want to continue?",active:"Publish",inactive:"Cancel"});if(Oe(m)||!m)return pe("Publish cancelled"),await oe(1)}else{let m=e||r.yes||await gt({message:`Do you want to publish the found mappings to ${d}?
|
|
1326
1326
|
${(0,he.dim)("Existing mappings will be overwritten")}`,active:"Publish",inactive:"Cancel"});if(Oe(m)||!m)return pe("Publish cancelled"),await oe(1)}let h=nr(),f=await t.getRepoInfo();if(r.dryrun||(h.start("Publishing Figma Mappings"),await $8(t,{spaceId:n,userId:s,privateKey:i,figmaBuilderLinks:c,repoInfo:f}),h.stop(c.length>0?`${c.length} mappings uploaded`:"All mappings removed from the Builder space")),r.printJson||r.dryrun){let m=Kn(fn);q.info(m.highlight("json",JSON.stringify(c,null,2)).value)}await Ba(t,n,l,!0),q.success((0,he.bgGreen)((0,he.bold)((0,he.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"}[l.framework]??"npm run start";Mt((0,he.dim)(`You can now start the dev server:
|
|
1327
1327
|
|
|
1328
1328
|
`)+(0,he.bgBlack)((0,he.white)((0,he.bold)(` ${g} `)))+`
|
|
1329
1329
|
|
|
1330
|
-
`+(0,he.dim)("Then, go back to Figma and generate code again to see your mapped components.")),ft("figma publish success",{spaceId:n,mappingFiles:u.length,figmaBuilderLinks:c.length})};async function k8(t,r,e){let i=[],n=[r],s=t.relative(t.getAppRootDir(),r.fileName);for(;n.length>0;){let o=n.shift();if(M8(o,r)){let a=R8(t,o,r,e),{line:l,character:u}=r.getLineAndCharacterOfPosition(o.getStart());a&&(a.loc=`${s}:${l+1}:${u+1}`,i.push(a))}n.push(...o.getChildren(r))}return i}var O8="figmaMapping";function R8(t,r,e,i){let[n]=r.arguments;if(!n)throw new Error("Invalid figmaMapping call, no arguments found");if(!at.default.isObjectLiteralExpression(n))throw new Error("Invalid figmaMapping call, argument is not an object literal");let s=n.properties;if(!s)throw new Error("Invalid figmaMapping call, argument has no properties");let o="",a,l,u="-",c=t.basename(e.fileName,".mapper.tsx"),p,d,h,f;if(r.typeArguments&&r.typeArguments.length>0){let m=ET(r.typeArguments[0].getText(e));m&&(c=m)}for(let m of s){let y=m.name?.getText(e);if(!y)throw new Error("Invalid figmaMapping call, property has no name");switch(y){case"url":{if(!("initializer"in m))throw new Error("Invalid figmaMapping call, url has no initializer");let b=m.initializer;if(!at.default.isStringLiteral(b))throw new Error("Invalid figmaMapping call, componentKey is not a string literal");f=b.text;break}case"componentKey":{if(!("initializer"in m))throw new Error("Invalid figmaMapping call, componentKey has no initializer");let b=m.initializer;if(!at.default.isStringLiteral(b))throw new Error("Invalid figmaMapping call, componentKey is not a string literal");o=b.text;break}case"mapper":if(at.default.isMethodDeclaration(m)){let b=function(C){if((at.default.isJsxOpeningElement(C)||at.default.isJsxSelfClosingElement(C))&&at.default.isIdentifier(C.tagName)){u=C.tagName.getText(e);let x=i.getSymbolAtLocation(C.tagName)?.getDeclarations()?.[0];if(x){let E=L8(x);E?.importClause&&(E.importClause.name?.getText(e)===u?p="default":E.importClause.namedBindings&&(p="named"),d=u,at.default.isStringLiteral(E.moduleSpecifier)&&(h=E.moduleSpecifier.text))}return u}else at.default.forEachChild(C,b)};var g=b;if(m.parameters[0].type){let C=m.parameters[0].type.getText(e),D=ET(C);D&&(c=D)}at.default.forEachChild(m,b),l=m.getText(e).replace(/^mapper/,"function Mapper"),a=tm(l);break}case"designTokenMapper":if(at.default.isMethodDeclaration(m)){l=m.getText(e).replace(/^designTokenMapper/,"function Mapper"),a=tm(l),o="design-tokens";break}case"genericMapper":if(at.default.isMethodDeclaration(m)){l=m.getText(e).replace(/^genericMapper/,"function Mapper"),a=tm(l),o="*";break}}}if(!o&&!f)throw new Error("Invalid figmaMapping call, no componentKey or url found");if(!o&&!a)throw new Error("Invalid figmaMapping call, no mapper found");if(!o&&!l)throw new Error("Invalid figmaMapping call, no original mapper found");return{builderName:u,figmaName:c,figmaKey:o,figmaUrl:f,inputMapper:a,exportType:p,importName:d,importPath:h,originalInputMapper:l,source:"cli"}}function tm(t){return at.default.transpile(t,{target:at.default.ScriptTarget.Latest,allowNonTsExtensions:!0,moduleResolution:at.default.ModuleResolutionKind.NodeJs,module:at.default.ModuleKind.CommonJS,noImplicitAny:!1,esModuleInterop:!0,noUnusedLocals:!1,noUnusedParameters:!1,jsx:at.default.JsxEmit.React,jsxFactory:"React.createElement",jsxFragmentFactory:"React.Fragment",allowJs:!0,checkJs:!0,strict:!0,suppressImplicitAnyIndexErrors:!0,typeRoots:["node_modules/@types"],inlineSources:!0,inlineSourceMap:!0})}function L8(t){let r=t;for(;r;){if(at.default.isImportDeclaration(r))return r;r=r.parent}}function M8(t,r){return at.default.isCallExpression(t)&&t.expression.getText(r).includes(O8)}async function Ma(t){let r=["node_modules","dist","build","public"];return(await t.readdirRecursive(t.getAppRootDir(),r)).filter(i=>gr(i))}function ET(t){let r=t.match(/^Figma(\w+)Props$/);if(r&&typeof r[1]=="string")return r[1]}var B8=async(t,r)=>{let e=new Map,i={};return r.forEach(n=>{let s=Xh(n);if(!s)throw new Error("Invalid Figma URL, use Cmd+L while selecting a figma component to get a link to selection");let o=e.get(s.fileID);o||(o=[],e.set(s.fileID,o)),o.includes(s.nodeId)||o.push(s.nodeId),i[n]=`${s.fileID}/${s.nodeId}`}),await Promise.all(Array.from(e.entries()).map(async([n,s])=>{let o=await Qh(t,n,s.join(","),0);for(let a of s){let l=o[a],u=l.components[a]?.key??l.componentSets[a]?.key;if(!u)throw new Error(`Cannot resolve figma component key for ${a} in file ${n}`);let c=`${n}/${a}`;for(let p of r)i[p]===c&&(i[p]=u)}})),i};async function Ba(t,r,e,i=!1){try{return e||(e=await ln(t)),await e.setPublicApiKey({publicApiKey:r}),i&&await e.ensureFigmaImportPage(),!0}catch(n){return rm.captureException(n),!1}}var $8=async(t,r)=>{let e=new URL(`${gi}/mappings/publish`);if(e.searchParams.set("apiKey",r.spaceId),e.searchParams.set("userId",r.userId),!(await
|
|
1330
|
+
`+(0,he.dim)("Then, go back to Figma and generate code again to see your mapped components.")),ft("figma publish success",{spaceId:n,mappingFiles:u.length,figmaBuilderLinks:c.length})};async function k8(t,r,e){let i=[],n=[r],s=t.relative(t.getAppRootDir(),r.fileName);for(;n.length>0;){let o=n.shift();if(M8(o,r)){let a=R8(t,o,r,e),{line:l,character:u}=r.getLineAndCharacterOfPosition(o.getStart());a&&(a.loc=`${s}:${l+1}:${u+1}`,i.push(a))}n.push(...o.getChildren(r))}return i}var O8="figmaMapping";function R8(t,r,e,i){let[n]=r.arguments;if(!n)throw new Error("Invalid figmaMapping call, no arguments found");if(!at.default.isObjectLiteralExpression(n))throw new Error("Invalid figmaMapping call, argument is not an object literal");let s=n.properties;if(!s)throw new Error("Invalid figmaMapping call, argument has no properties");let o="",a,l,u="-",c=t.basename(e.fileName,".mapper.tsx"),p,d,h,f;if(r.typeArguments&&r.typeArguments.length>0){let m=ET(r.typeArguments[0].getText(e));m&&(c=m)}for(let m of s){let y=m.name?.getText(e);if(!y)throw new Error("Invalid figmaMapping call, property has no name");switch(y){case"url":{if(!("initializer"in m))throw new Error("Invalid figmaMapping call, url has no initializer");let b=m.initializer;if(!at.default.isStringLiteral(b))throw new Error("Invalid figmaMapping call, componentKey is not a string literal");f=b.text;break}case"componentKey":{if(!("initializer"in m))throw new Error("Invalid figmaMapping call, componentKey has no initializer");let b=m.initializer;if(!at.default.isStringLiteral(b))throw new Error("Invalid figmaMapping call, componentKey is not a string literal");o=b.text;break}case"mapper":if(at.default.isMethodDeclaration(m)){let b=function(C){if((at.default.isJsxOpeningElement(C)||at.default.isJsxSelfClosingElement(C))&&at.default.isIdentifier(C.tagName)){u=C.tagName.getText(e);let x=i.getSymbolAtLocation(C.tagName)?.getDeclarations()?.[0];if(x){let E=L8(x);E?.importClause&&(E.importClause.name?.getText(e)===u?p="default":E.importClause.namedBindings&&(p="named"),d=u,at.default.isStringLiteral(E.moduleSpecifier)&&(h=E.moduleSpecifier.text))}return u}else at.default.forEachChild(C,b)};var g=b;if(m.parameters[0].type){let C=m.parameters[0].type.getText(e),D=ET(C);D&&(c=D)}at.default.forEachChild(m,b),l=m.getText(e).replace(/^mapper/,"function Mapper"),a=tm(l);break}case"designTokenMapper":if(at.default.isMethodDeclaration(m)){l=m.getText(e).replace(/^designTokenMapper/,"function Mapper"),a=tm(l),o="design-tokens";break}case"genericMapper":if(at.default.isMethodDeclaration(m)){l=m.getText(e).replace(/^genericMapper/,"function Mapper"),a=tm(l),o="*";break}}}if(!o&&!f)throw new Error("Invalid figmaMapping call, no componentKey or url found");if(!o&&!a)throw new Error("Invalid figmaMapping call, no mapper found");if(!o&&!l)throw new Error("Invalid figmaMapping call, no original mapper found");return{builderName:u,figmaName:c,figmaKey:o,figmaUrl:f,inputMapper:a,exportType:p,importName:d,importPath:h,originalInputMapper:l,source:"cli"}}function tm(t){return at.default.transpile(t,{target:at.default.ScriptTarget.Latest,allowNonTsExtensions:!0,moduleResolution:at.default.ModuleResolutionKind.NodeJs,module:at.default.ModuleKind.CommonJS,noImplicitAny:!1,esModuleInterop:!0,noUnusedLocals:!1,noUnusedParameters:!1,jsx:at.default.JsxEmit.React,jsxFactory:"React.createElement",jsxFragmentFactory:"React.Fragment",allowJs:!0,checkJs:!0,strict:!0,suppressImplicitAnyIndexErrors:!0,typeRoots:["node_modules/@types"],inlineSources:!0,inlineSourceMap:!0})}function L8(t){let r=t;for(;r;){if(at.default.isImportDeclaration(r))return r;r=r.parent}}function M8(t,r){return at.default.isCallExpression(t)&&t.expression.getText(r).includes(O8)}async function Ma(t){let r=["node_modules","dist","build","public"];return(await t.readdirRecursive(t.getAppRootDir(),r)).filter(i=>gr(i))}function ET(t){let r=t.match(/^Figma(\w+)Props$/);if(r&&typeof r[1]=="string")return r[1]}var B8=async(t,r)=>{let e=new Map,i={};return r.forEach(n=>{let s=Xh(n);if(!s)throw new Error("Invalid Figma URL, use Cmd+L while selecting a figma component to get a link to selection");let o=e.get(s.fileID);o||(o=[],e.set(s.fileID,o)),o.includes(s.nodeId)||o.push(s.nodeId),i[n]=`${s.fileID}/${s.nodeId}`}),await Promise.all(Array.from(e.entries()).map(async([n,s])=>{let o=await Qh(t,n,s.join(","),0);for(let a of s){let l=o[a],u=l.components[a]?.key??l.componentSets[a]?.key;if(!u)throw new Error(`Cannot resolve figma component key for ${a} in file ${n}`);let c=`${n}/${a}`;for(let p of r)i[p]===c&&(i[p]=u)}})),i};async function Ba(t,r,e,i=!1){try{return e||(e=await ln(t)),await e.setPublicApiKey({publicApiKey:r}),i&&await e.ensureFigmaImportPage(),!0}catch(n){return rm.captureException(n),!1}}var $8=async(t,r)=>{let e=new URL(`${gi}/mappings/publish`);if(e.searchParams.set("apiKey",r.spaceId),e.searchParams.set("userId",r.userId),!(await ht(e,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${r.privateKey}`},body:JSON.stringify({remoteUrl:r.repoInfo?.remoteUrl,defaultBranch:r.repoInfo?.defaultBranch,currentBranch:r.repoInfo?.currentBranch,commit:r.repoInfo?.commit,figmaBuilderLinks:r.figmaBuilderLinks,sdkVersion:t.sdkVersion,spaceKind:t.kind,cliVersion:t.version,cliFrameworks:t.getFrameworks().map(n=>n.name),cliPlatform:t.platform(),cliDeviceId:await t.getDeviceId()})})).ok)throw new Error("Failed to publish Figma mappings");return!0};async function em({figmaAuth:t,force:r,mappingFiles:e,print:i,sys:n}){if(!e.length)return{figmaBuilderLinks:[],foundErrors:!1};let s=[],o=await dt(n,e),a=o.getTypeChecker(),l=[...o.getSyntacticDiagnostics(),...o.getGlobalDiagnostics(),...o.getSemanticDiagnostics(),...o.getDeclarationDiagnostics()].filter(d=>!(d.category!==at.default.DiagnosticCategory.Error||d.code===6133||d.code===6138||d.code===6196||d.code===6192||d.code===6198||d.code===6199||d.code===6205||d.code===1449||d.code===2578||d.code===2695||d.code===2322)),u=new Set,c=!1;for(let d of e)try{let h=o.getSourceFile(d);if(!h)throw new Error(`Could not find source file for ${d}`);let f=h?.fileName;if(f){let m=l.filter(y=>y.file?.fileName===f);if(m.length>0&&(c=!0,r!==!0)){q.error((0,he.red)(`TypeScript errors in ${(0,he.dim)(n.relative(n.getAppRootDir(),d))}:
|
|
1331
1331
|
`)+m.map(y=>` \u2022 ${U8(y)}`).join(`
|
|
1332
1332
|
`));continue}}let g=await k8(n,h,a);if(s.push(...g),i){let m=!1,y=`${(0,he.dim)(n.relative(n.getAppRootDir(),d))}:
|
|
1333
1333
|
`+g.map(b=>{let C=!1;b.figmaKey?(C||(C=u.has(b.figmaKey)),u.add(b.figmaKey)):b.figmaUrl&&(C||(C=u.has(b.figmaUrl)),u.add(b.figmaUrl));let D="";switch(b.figmaKey){case"design-tokens":D=" "+(0,he.cyan)("\u2747\uFE0E Design tokens mapper");break;case"*":D=" "+(0,he.yellow)("\u25CF Generic mapper");break;default:D=` ${(0,he.magenta)("\u2756 "+yi(b.figmaName))} ${(0,he.dim)("\u2192")} ${b.builderName==="-"?"-":"<"+b.builderName+">"}`;break}return C&&(m=!0,D=(0,he.bgRed)(D+(0,he.bold)(" <= duplicated"))),D}).join(`
|
|
1334
1334
|
`);m?(c=!0,q.error(y)):q.info(y)}}catch(h){return rm.captureException(h),console.error(h),await oe(1)}let p=s.filter(d=>d.figmaUrl&&!d.figmaKey).map(d=>d.figmaUrl);if(p.length>0){let d=await B8(t,p);for(let h of s)if(h.figmaUrl&&!h.figmaKey){let f=d[h.figmaUrl];if(!f)throw new Error("bad internal state");h.figmaKey=f}}return{figmaBuilderLinks:s,foundErrors:c}}function U8(t){let{messageText:r}=t;if(typeof r=="string")return r;let{next:e}=r,i=[r.messageText];return e&&i.push(e.map(n=>n.messageText).join(`
|
|
1335
1335
|
`)),i.join(`
|
|
1336
1336
|
`)}var wT=require("crypto");var uc=t=>!!(process.env.CI||t.ci),wr=async(t,r,e)=>{let i=uc(r)?{}:V8(t),n=i.spaceName,s=i.userId,o,a=process.env.BUILDER_PUBLIC_KEY??r.spaceId??i.builderPublicKey,l=process.env.BUILDER_PRIVATE_KEY??r.privateKey??i.builderPrivateKey,u=process.env.FIGMA_PERSONAL_TOKEN??r.figmaToken;if(u?o={access_token:u,oauth:!1}:o=i.figmaAuth,e.forceSpaceId&&a&&a!==e.forceSpaceId){q.warning(`CLI is currently logged in space ${(0,Zs.yellow)(a)},
|
|
1337
|
-
however the command required --spaceId=${(0,Zs.green)(e.forceSpaceId)}`);let c=r.yes||await
|
|
1337
|
+
however the command required --spaceId=${(0,Zs.green)(e.forceSpaceId)}`);let c=r.yes||await gt({message:"Do you wanna switch spaces?",active:"Yes",inactive:`Stay in current ${n} space`});if(Oe(c)||!c)throw pe(`Aborting. Another way to fix this conflict is making sure the figma plugin is logged in "${n}" instead.`),new Error("Exiting");a=e.forceSpaceId,l=void 0,n=void 0,s=void 0}if(uc(r)){if(!o&&e.figmaAuth)throw new Error(`No Figma personal token found.
|
|
1338
1338
|
Please set the FIGMA_PERSONAL_TOKEN environment variable.`);if(!l&&e.builderPrivateKey)throw new Error(`No Builder private key found.
|
|
1339
1339
|
Please set the BUILDER_PRIVATE_KEY environment variable.`);if(!a&&e.builderPublicKey)throw new Error(`No Builder public key found.
|
|
1340
|
-
Please set the BUILDER_PUBLIC_KEY environment variable.`);return{figmaAuth:o,builderPublicKey:a,builderPrivateKey:l}}if((e.force||!o&&e.figmaAuth)&&(o=await q8(),ST(t,{figmaAuth:o})),e.force||!l&&e.builderPrivateKey||!a&&e.builderPublicKey){let{privateKey:c,spaceId:p,spaceName:d,userId:h}=await K8(t,e.forceSpaceId);if(e.forceSpaceId&&p!==e.forceSpaceId)throw new Error(`OAuth flow returned space ${(0,Zs.yellow)(p)}, however the command required --spaceId=${(0,Zs.green)(e.forceSpaceId)}`);a=p,l=c,n=d,s=h,await rT(s),await Ba(t,p,void 0,!1),ST(t,{builderPublicKey:a,builderPrivateKey:l,spaceName:n,userId:s})}return s&&Yi.setUser({id:s,username:process.env.USER||process.env.USERNAME||"unknown"}),(n||a)&&Yi.setContext("builder",{spaceId:a,spaceName:n}),{figmaAuth:o,builderPublicKey:a,builderPrivateKey:l,spaceName:n,userId:s}},j8="RHr2ed743waC2g2ZHMEJSn6O0NQ08L";async function q8(){let t=nr(),{default:r}=await import("open");t.start("Waiting for Figma auth");let e=(0,wT.randomUUID)(),i=new URL("https://www.figma.com/oauth");i.searchParams.set("client_id","nrGCqw6TLl95QJhVDi097A"),i.searchParams.set("redirect_uri","http://localhost:5283/figma-connect"),i.searchParams.set("scope","files:read,file_dev_resources:read,file_variables:read"),i.searchParams.set("state",e),i.searchParams.set("response_type","code");let n,s=new Promise((o,a)=>{n=(0,im.createServer)(async(l,u)=>{let c=new URL(l.url||"","http://localhost:5283");if(c.pathname==="/figma-connect"){let p=c.searchParams.get("code"),d=c.searchParams.get("state");if(p&&e===d){let h=await
|
|
1340
|
+
Please set the BUILDER_PUBLIC_KEY environment variable.`);return{figmaAuth:o,builderPublicKey:a,builderPrivateKey:l}}if((e.force||!o&&e.figmaAuth)&&(o=await q8(),ST(t,{figmaAuth:o})),e.force||!l&&e.builderPrivateKey||!a&&e.builderPublicKey){let{privateKey:c,spaceId:p,spaceName:d,userId:h}=await K8(t,e.forceSpaceId);if(e.forceSpaceId&&p!==e.forceSpaceId)throw new Error(`OAuth flow returned space ${(0,Zs.yellow)(p)}, however the command required --spaceId=${(0,Zs.green)(e.forceSpaceId)}`);a=p,l=c,n=d,s=h,await rT(s),await Ba(t,p,void 0,!1),ST(t,{builderPublicKey:a,builderPrivateKey:l,spaceName:n,userId:s})}return s&&Yi.setUser({id:s,username:process.env.USER||process.env.USERNAME||"unknown"}),(n||a)&&Yi.setContext("builder",{spaceId:a,spaceName:n}),{figmaAuth:o,builderPublicKey:a,builderPrivateKey:l,spaceName:n,userId:s}},j8="RHr2ed743waC2g2ZHMEJSn6O0NQ08L";async function q8(){let t=nr(),{default:r}=await import("open");t.start("Waiting for Figma auth");let e=(0,wT.randomUUID)(),i=new URL("https://www.figma.com/oauth");i.searchParams.set("client_id","nrGCqw6TLl95QJhVDi097A"),i.searchParams.set("redirect_uri","http://localhost:5283/figma-connect"),i.searchParams.set("scope","files:read,file_dev_resources:read,file_variables:read"),i.searchParams.set("state",e),i.searchParams.set("response_type","code");let n,s=new Promise((o,a)=>{n=(0,im.createServer)(async(l,u)=>{let c=new URL(l.url||"","http://localhost:5283");if(c.pathname==="/figma-connect"){let p=c.searchParams.get("code"),d=c.searchParams.get("state");if(p&&e===d){let h=await ht("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:j8,redirect_uri:"http://localhost:5283/figma-connect",code:p,grant_type:"authorization_code"}).toString()});h.ok||a(new Error("Failed to get figma access token"));let f=await h.json();u.end(`<!DOCTYPE html>
|
|
1341
1341
|
<html lang="en" dir="ltr">
|
|
1342
1342
|
<head>
|
|
1343
1343
|
<meta charset="utf-8" />
|
|
@@ -1555,13 +1555,13 @@ Please set the BUILDER_PUBLIC_KEY environment variable.`);return{figmaAuth:o,bui
|
|
|
1555
1555
|
<!--SCRIPT_PLACEHOLDER-->
|
|
1556
1556
|
</body>
|
|
1557
1557
|
</html>
|
|
1558
|
-
`.replace("{{MESSAGE}}","The CLI has authenticated correctly with Builder.io"),()=>{u({privateKey:d.searchParams.get("p-key")||"",spaceId:d.searchParams.get("api-key")||"",spaceName:d.searchParams.get("org-name")||"",userId:d.searchParams.get("user-id")||""})})}),s.listen(5283,()=>{i(n.href,{wait:!1})})});try{return await l}finally{e.stop("Authenticated with Builder.io"),s&&("closeAllConnections"in s&&s.closeAllConnections(),s.close(u=>{u&&(Yi.captureException(u),console.error(u))}))}}function ST(t,r){let e=t.getAppRootDir(),i=(0,cc.join)(e,"node_modules",".builder"),n=(0,cc.join)(i,"data.json");if((0,bi.existsSync)(n))try{let s=(0,bi.readFileSync)(n,"utf8"),o=JSON.parse(s);r=Object.assign(o.credentials,r)}catch(s){Yi.captureException(s),console.error("Failed to store credentials",s)}else(0,bi.mkdirSync)(i,{recursive:!0});(0,bi.writeFileSync)(n,JSON.stringify({credentials:r},null,2))}function V8(t){let r=t.getAppRootDir(),e=(0,cc.join)(r,"node_modules",".builder","data.json");if((0,bi.existsSync)(e))try{let i=(0,bi.readFileSync)(e,"utf8");return JSON.parse(i).credentials}catch(i){Yi.captureException(i),console.error("Failed to load credentials",i)}return{}}var Xe=K(Gt(),1),eo=require("path");var z8="https://cdn.builder.io",TT=async(t,r)=>{console.log(""),
|
|
1558
|
+
`.replace("{{MESSAGE}}","The CLI has authenticated correctly with Builder.io"),()=>{u({privateKey:d.searchParams.get("p-key")||"",spaceId:d.searchParams.get("api-key")||"",spaceName:d.searchParams.get("org-name")||"",userId:d.searchParams.get("user-id")||""})})}),s.listen(5283,()=>{i(n.href,{wait:!1})})});try{return await l}finally{e.stop("Authenticated with Builder.io"),s&&("closeAllConnections"in s&&s.closeAllConnections(),s.close(u=>{u&&(Yi.captureException(u),console.error(u))}))}}function ST(t,r){let e=t.getAppRootDir(),i=(0,cc.join)(e,"node_modules",".builder"),n=(0,cc.join)(i,"data.json");if((0,bi.existsSync)(n))try{let s=(0,bi.readFileSync)(n,"utf8"),o=JSON.parse(s);r=Object.assign(o.credentials,r)}catch(s){Yi.captureException(s),console.error("Failed to store credentials",s)}else(0,bi.mkdirSync)(i,{recursive:!0});(0,bi.writeFileSync)(n,JSON.stringify({credentials:r},null,2))}function V8(t){let r=t.getAppRootDir(),e=(0,cc.join)(r,"node_modules",".builder","data.json");if((0,bi.existsSync)(e))try{let i=(0,bi.readFileSync)(e,"utf8");return JSON.parse(i).credentials}catch(i){Yi.captureException(i),console.error("Failed to load credentials",i)}return{}}var Xe=K(Gt(),1),eo=require("path");var z8="https://cdn.builder.io",TT=async(t,r)=>{console.log(""),It((0,Xe.bgCyan)((0,Xe.bold)((0,Xe.white)(" figma migrate ")))+" "+(0,Xe.dim)("1.3.7"));let{builderPrivateKey:e,builderPublicKey:i}=await wr(t,r,{forceSpaceId:r.spaceId,builderPrivateKey:!0,builderPublicKey:!0});ft("figma publish started",{spaceId:i});let n=await Ma(t);if(n.length>0){ft("figma migrate with existing files",{spaceId:i}),q.warning(`${(0,Xe.yellow)("This repo already has figma mappings in:")}
|
|
1559
1559
|
|
|
1560
1560
|
${n.map(u=>` - ${(0,eo.relative)(t.getAppRootDir(),u)}`).join(`
|
|
1561
1561
|
`)}
|
|
1562
1562
|
|
|
1563
|
-
Migration is going to create new files, possibly duplicates.`);let l=await
|
|
1564
|
-
`));let a=await Lt({message:`Where do you want to save the figma mappings? ${(0,Xe.dim)("(Ctrl+C to exit)")}`,initialValue:"./src/mappings",defaultValue:"./src/mappings",placeholder:"./src/mappings",validate:l=>{if((0,eo.extname)(l)!=="")return"It must be a valid directory path, not a file";if((0,eo.isAbsolute)(l))return"It must be a relative path"}});if(Oe(a))return pe("Migration cancelled"),await oe(1);await(0,pc.mkdir)(a,{recursive:!0}),await Promise.all(o.map(async l=>{let u=await G8(l),c;switch(l.figmaKey){case"design-tokens":c="design-tokens";break;case"*":c="generic";break;default:c=yi(l.figmaName)}let p=a+"/"+c+".mapper.tsx";return q.info((0,Xe.green)("created ")+(0,Xe.dim)(p)),(0,pc.writeFile)(p,u)})),q.info("Check out the docs for following steps: https://builder.io/docs/figma/figma-mappings"),Mt((0,Xe.bgGreen)((0,Xe.bold)((0,Xe.white)(" Done! \u{1F389} ")))+` ${o.length} mappings imported`),ft("figma migrate success",{spaceId:i,mappingFiles:o.length})};async function W8(t){let r=await
|
|
1563
|
+
Migration is going to create new files, possibly duplicates.`);let l=await gt({message:"Do you want to continue?",initialValue:!1});if(!l||Oe(l))return pe("Migration cancelled"),await oe(1)}q.message("We are about to import your existing figma mappings into this local repo.");let s=nr();s.start("Fetching figma mappings");let o=await W8({privateKey:e,spaceId:i});s.stop(`Fetched ${o.length} figma mappings:`),q.message(o.map(l=>{switch(l.figmaKey){case"design-tokens":return(0,Xe.cyan)("\u2747\uFE0E Design tokens mapper");case"*":return(0,Xe.yellow)("\u25CF Generic mapper");default:return`${(0,Xe.magenta)("\u2756 "+yi(l.figmaName))} ${(0,Xe.dim)("\u2192")} ${l.builderName}`}}).join(`
|
|
1564
|
+
`));let a=await Lt({message:`Where do you want to save the figma mappings? ${(0,Xe.dim)("(Ctrl+C to exit)")}`,initialValue:"./src/mappings",defaultValue:"./src/mappings",placeholder:"./src/mappings",validate:l=>{if((0,eo.extname)(l)!=="")return"It must be a valid directory path, not a file";if((0,eo.isAbsolute)(l))return"It must be a relative path"}});if(Oe(a))return pe("Migration cancelled"),await oe(1);await(0,pc.mkdir)(a,{recursive:!0}),await Promise.all(o.map(async l=>{let u=await G8(l),c;switch(l.figmaKey){case"design-tokens":c="design-tokens";break;case"*":c="generic";break;default:c=yi(l.figmaName)}let p=a+"/"+c+".mapper.tsx";return q.info((0,Xe.green)("created ")+(0,Xe.dim)(p)),(0,pc.writeFile)(p,u)})),q.info("Check out the docs for following steps: https://builder.io/docs/figma/figma-mappings"),Mt((0,Xe.bgGreen)((0,Xe.bold)((0,Xe.white)(" Done! \u{1F389} ")))+` ${o.length} mappings imported`),ft("figma migrate success",{spaceId:i,mappingFiles:o.length})};async function W8(t){let r=await ht(`${z8}/api/internal/kv/${t.spaceId}/figma-builder?apiKey=${t.spaceId}`,{headers:{Authorization:`Bearer ${t.privateKey}`}});if(!r.ok)throw new Error(`Failed to fetch figma-builder links: ${r.statusText}`);let e=await r.json();if(!(e instanceof Object&&"figmaBuilderLinks"in e))throw new Error("Invalid response");return e.figmaBuilderLinks}async function G8(t){let r="figmaMapping",e=t.originalInputMapper?.match(/function Mapper\(\s*([a-zA-Z0-9_$]+)\s*(?::[^)])?\s*\)/)?.[1],i=t.originalInputMapper?.match(/function Mapper\([^)]*\)(\s*{([^]*))$/)?.[1],n;switch(t.figmaKey){case"design-tokens":n=`${r}({
|
|
1565
1565
|
designTokenMapper(${e||"designToken"})${i}
|
|
1566
1566
|
})`;break;case"*":n=`${r}({
|
|
1567
1567
|
genericMapper(${e||"figma"})${i}
|
|
@@ -1572,7 +1572,7 @@ Migration is going to create new files, possibly duplicates.`);let l=await mt({m
|
|
|
1572
1572
|
})`}return ir(`import { figmaMapping } from '@builder.io/dev-tools/figma';
|
|
1573
1573
|
${H8(t)}
|
|
1574
1574
|
|
|
1575
|
-
${n}`,"typescript",void 0)}function H8(t){let{exportType:r,importName:e,importPath:i}=t;if(e&&i){let n=JSON.stringify(i);return r==="named"?`import { ${e} } from ${n};`:`import ${e} from ${n};`}return""}var tr=K(Gt(),1);var E6=K(jc()),mA=K(hA()),$a=K(require("@sentry/node"));function gA(t,r,e){let i,n=new Promise(o=>{try{i=(0,mA.default)(t,r,{stdio:"inherit",...e}),i.on("error",a=>{$a.captureException(a),o(!1)}),i.on("close",a=>{a===0?o(!0):($a.captureMessage(`cmd "${t} ${r.join(" ")}", exit code: ${a}`,"error"),o(!1))})}catch(a){$a.captureException(a),o(!1)}});return{abort:async()=>{i&&i.kill("SIGINT")},command:n}}var yA=async(t,r,e)=>{if(!e.skipInstallation&&await C6(t)&&(e.yes||await
|
|
1575
|
+
${n}`,"typescript",void 0)}function H8(t){let{exportType:r,importName:e,importPath:i}=t;if(e&&i){let n=JSON.stringify(i);return r==="named"?`import { ${e} } from ${n};`:`import ${e} from ${n};`}return""}var tr=K(Gt(),1);var E6=K(jc()),mA=K(hA()),$a=K(require("@sentry/node"));function gA(t,r,e){let i,n=new Promise(o=>{try{i=(0,mA.default)(t,r,{stdio:"inherit",...e}),i.on("error",a=>{$a.captureException(a),o(!1)}),i.on("close",a=>{a===0?o(!0):($a.captureMessage(`cmd "${t} ${r.join(" ")}", exit code: ${a}`,"error"),o(!1))})}catch(a){$a.captureException(a),o(!1)}});return{abort:async()=>{i&&i.kill("SIGINT")},command:n}}var yA=async(t,r,e)=>{if(!e.skipInstallation&&await C6(t)&&(e.yes||await gt({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 gA("npm",["init","builder.io@latest","--","--skip-question"],{stdio:"inherit",cwd:t.getAppRootDir()}).command||(pe(`Auto-install failed. You can install it manually by running ${(0,tr.bold)("npm init builder.io@latest")}`),await oe(1)):pe(`Ok, you can install it later. By running ${(0,tr.bold)("npm init builder.io@latest")}`)),r==="migrate")await TT(t,e);else if(r==="publish"||r==="p")await CT(t,e);else if(r==="add"||r==="generate"||r==="gen"||r==="g")await hT(t,e);else if(r==="auth"){console.log(""),It((0,tr.bgCyan)((0,tr.bold)((0,tr.white)(" figma auth ")))+" "+(0,tr.dim)("1.3.7"));let{builderPublicKey:i}=await wr(t,e,{figmaAuth:!0,builderPrivateKey:!0,builderPublicKey:!0,force:!0});ft("figma auth",{spaceId:i}),Mt((0,tr.bgGreen)((0,tr.bold)((0,tr.white)(" Done! \u{1F389} "))))}else r==="help"&&Hi(e._[2])};async function C6(t){let r=t.getFrameworks(),e=["next","angular","@angular/core"];if(!r.some(i=>e.includes(i.name)))return!1;try{let i=await In(t,t.getRepoRootDir());if(!i||!!i.devDependencies?.["@builder.io/dev-tools"]||!!i.dependencies?.["@builder.io/dev-tools"])return!1}catch{return!1}return!0}var cP=K(Cu(),1);var qr=require("node:path"),Rt=require("node:fs");var Cn=K(Gt(),1);async function bA(t){console.log(""),It((0,Cn.bgCyan)((0,Cn.bold)((0,Cn.white)(" add ")))+" "+(0,Cn.dim)("1.3.7"));let r=t.snippetId;if(!r&&!t.snippet)return pe("SnippetId expected. npx builder.io add <snippetId>"),await oe(1);let e=nr(),i=t.snippet||null;if(!i&&r&&(e.start(`Fetching snippet ${r}`),i=await fm(r),e.stop(`Fetched snippet ${r}`)),!i)return pe(`No snippet found for id ${r}`),await oe(1);let n=process.cwd(),s=Oa(n)??n;if(i.files?.length>0){let o=hm(s,i.framework||"react"),a=t.path||await Lt({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(Oe(a))return pe("Cancelled sync"),await oe(0);let l=await fc(s,i,i.files,a,!1);return q.success("All files have been written successfully."),{snippet:i,pathInput:a,writtenFiles:l,timeStamp:Date.now()}}else{let{code:o,suggestedName:a,framework:l}=i;l&&(a=await v6(s,l,o)),a??(a="./src/components/MyComponent.jsx");let u=DA(i,S6(i.code),i.framework);try{i.framework==="html"?u=await ir(u,"html"):i.framework==="angular"?u=await ir(u,"angular"):i.framework==="vue"?u=await ir(u,"vue"):i.framework==="svelte"?u=await ir(u,"html"):u=await ir(u,"typescript")}catch{}let c=t.path;if(!c){try{let h=(await Yw({cwd:process.cwd()})).getFrameworks();if(h.length>0){let f;if(h.some(g=>g.name.includes("qwik"))?f="qwik":h.some(g=>g.name.includes("react"))?f="react":f=h[0].name,i.framework&&i.framework!==f){let g=await gt({message:`This snippet is for ${i.framework}, but you are using ${f}. Continue?`,initialValue:!1});if(Oe(g)||!g)return console.log("Please go back to builder and change the output framework to match your project."),console.log(),await oe(0)}}}catch{}if(c=await Lt({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."}}),Oe(c))return console.log(""),await oe(0)}let p=(0,qr.resolve)(s,c);q.info(`Writing code to ${p}`),(0,Rt.mkdirSync)((0,qr.dirname)(p),{recursive:!0}),(0,Rt.writeFileSync)(p,u)}}function fm(t){return ht(`https://cdn.builder.io/api/v1/snippet/${t}`).then(r=>r.status===404?null:r.json())}function S6(t){return t.replace(/^```jsx\s?|\s?```$/g,"").trim()}function DA(t,r,e,i=!1){if(!e)return r;let n="This code was generated by Builder.io",s=i?`https://builder.io/content/${t.contentId}?codeSession=${t.sessionKey}&sid=${t.id}`:"",o=["vue","html","svelte"].includes(e.toLowerCase()),a=[n,s].filter(Boolean);return`${o?a.map(u=>`<!-- ${u} -->`).join(`
|
|
1576
1576
|
`):`/**
|
|
1577
1577
|
${a.map(u=>` * ${u}`).join(`
|
|
1578
1578
|
`)}
|
|
@@ -1602,7 +1602,7 @@ Visit https://www.docs.developers.amplitude.com/data/sdks/browser-2/#tracking-de
|
|
|
1602
1602
|
<h3>How's Devtools working for you?</h3>
|
|
1603
1603
|
<p>We'd love your feedback!</p>
|
|
1604
1604
|
</div>
|
|
1605
|
-
\`,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(),It(e.checked)}),e.checked=ke(),It(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.3.6"}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)}
|
|
1605
|
+
\`,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(),It(e.checked)}),e.checked=ke(),It(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.3.7"}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)}
|
|
1606
1606
|
</style>\`,dt=class extends HTMLElement{constructor(){super()}connectedCallback(){let e=this.attachShadow({mode:"open"});e.innerHTML=ki+\`<main>
|
|
1607
1607
|
<aside>
|
|
1608
1608
|
<div class="logo"></div>
|
|
@@ -1641,7 +1641,7 @@ Visit https://www.docs.developers.amplitude.com/data/sdks/browser-2/#tracking-de
|
|
|
1641
1641
|
</nav>
|
|
1642
1642
|
</section>
|
|
1643
1643
|
</main>
|
|
1644
|
-
\`,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.3.
|
|
1644
|
+
\`,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.3.7"),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.3.7"),Mi());})();`)}async function OA(t){return RA(t,`<!DOCTYPE html>
|
|
1645
1645
|
<html lang="en" dir="ltr">
|
|
1646
1646
|
<head>
|
|
1647
1647
|
<meta charset="utf-8" />
|
|
@@ -1807,39 +1807,39 @@ Visit https://www.docs.developers.amplitude.com/data/sdks/browser-2/#tracking-de
|
|
|
1807
1807
|
</script>
|
|
1808
1808
|
</body>
|
|
1809
1809
|
</html>
|
|
1810
|
-
`)}async function RA(t,r){let e=await ug(t),i=t.getFrameworks();return r.replace(/__LOCAL_APP_ID__/g,e).replace(/__DEV_TOOLS_URL__/g,t.devToolsServerUrl).replace(/__CLIENT_ID__/g,t.getClientId()).replace(/__FRAMEWORK__/g,i.length?i[0].name:"")}var LA=require("node:os");async function MA(t,r){let e=new URL("/cli-auth","https://builder.io");e.searchParams.set("client_id",t.getClientId()),e.searchParams.set("host",await t.getDeviceId()),e.searchParams.set("response_type","code"),e.searchParams.set("cli","true");let i=new URL(An,t.devToolsServerUrl);i.searchParams.set(Ka,(0,LA.platform)()),i.searchParams.set(Va,process.versions.node);let n=t.getFrameworks();return n.length>0&&(e.searchParams.set(Zn,n[0].name),i.searchParams.set(Zn,n[0].name)),e.searchParams.set("redirect_url",i.href),e.searchParams.set("preview_url",r),e.href}async function $A(t,r,e,i){try{if(!t)return so(e,i,400,"Builder context closed");let n=$6(e);if(n.pathname===Tc){if(e.method==="POST"){let s=await B6(e);if(s)try{let o=await FA(t,JSON.parse(s));return BA(e,i,200,o)}catch(o){t.debug("Dev API Error",o.stack||o.message||o);let a={errors:[String(o.message||o)]};return BA(e,i,500,a)}}else if(e.method==="OPTIONS"){let s={"Access-Control-Allow-Methods":"POST, OPTIONS","Access-Control-Allow-Headers":"Content-Type, Cache-Control, X-Builder-Devtools-Version"},o=e.headers.origin;o&&o!=="null"?UA(new URL(o))&&(s["Access-Control-Allow-Origin"]=o):s["Access-Control-Allow-Origin"]="*",i.writeHead(200,s),i.end();return}return so(e,i,405,`${Tc} is an API endpoint used only during development by the Builder.io Devtools client-side script`)}if(n.pathname===Ac)return R6(e,i,200,await kA(t));if(n.pathname===Fm){let s=n.searchParams.get(wc);return s?M6(i,302,await MA(t,s)):so(e,i,400,`Missing ${wc} querystring`)}return n.pathname===An?L6(e,i,200,await OA(t)):n.pathname===Pn?(t.debug(`Close Dev Tools Server Requested: ${n.href}`),setTimeout(()=>{try{r.close(s=>{t.debug(`Dev Tools Server Closed Error: ${s}`)})}catch(s){t.debug(`Error closing devtools server: ${s}`)}},20),so(e,i,200,"Closing Dev Tools Server")):so(e,i,404,"Not found")}catch(n){return console.error("Dev Server Error",n),so(e,i,500,`Dev Server Error: ${n}`)}}function BA(t,r,e,i){hc(t,r,e,"application/json",JSON.stringify(i))}function R6(t,r,e,i){hc(t,r,e,"application/javascript",i)}function L6(t,r,e,i){hc(t,r,e,"text/html",i)}function so(t,r,e,i){hc(t,r,e,"text/plain",i)}function hc(t,r,e,i,n){let s={"Content-Type":`${i}; charset=utf-8`,"Cache-Control":"no-cache, no-store, must-revalidate","X-Builder-Devtools-Version":"1.3.6"},o=t.headers.origin;o&&o!=="null"?UA(new URL(o))&&(s["Access-Control-Allow-Origin"]=o):s["Access-Control-Allow-Origin"]="*",r.writeHead(e,s),r.end(n)}function UA(t){return t.hostname==="localhost"||t.origin==="https://builder.io"||t.origin==="https://www.builder.io"||t.origin.endsWith(".builder.io")?!0:t.port===""?!1:t.port!=="80"&&t.port!=="443"}function M6(t,r,e){t.writeHead(r,{Location:e}),t.end()}async function B6(t){let r="";for await(let e of t)r+=e;return r}function $6(t){let r=t.url||"/";return new URL(r,`http://${t.headers.host}`)}async function jA(t){if(globalThis.__builderDevToolsServer)return t.debug("reusing existing devtools server"),globalThis.__builderDevToolsServer.setContext(t),globalThis.__builderDevToolsServer;let r=await U6(t),e=(0,mc.createServer)((n,s)=>{$A(t,e,n,s)}),i=()=>new Promise((n,s)=>{e.listening?(t.debug(`closing devtools server on port ${r}`),e.close(o=>{t=null,o?(t.debug(`error closing devtools server on port ${r}`),s(o)):(t&&t.debug(`closed devtools server on port ${r}`),n())})):(t.debug(`devtools server on port ${r} not listening`),n())});return process.once("SIGTERM",i),process.once("SIGINT",i),process.env.CI!=="true"&&process.stdin.on("end",i),globalThis.__builderDevToolsServer={url:new URL(`http://localhost:${r}`).href,port:r,setContext:n=>{t.debug(`set devtools context on server ${r}`),t=n},close:async()=>{globalThis.__builderDevToolsServer=null,await i()}},new Promise(n=>{e.listen(r,()=>{t.debug(`started devtools server on port ${r}`),n(globalThis.__builderDevToolsServer)})})}function U6(t){return new Promise(r=>{let e=t.port;try{(0,mc.request)({hostname:"localhost",port:e,path:Pn,method:"GET"},n=>{n.on("end",()=>{t.debug(`${Pn} - Response ended`),r(e)})}).on("error",n=>{t.debug(`${Pn} - No response ${n}`),r(e)}).end()}catch(i){t.debug(`${Pn} - Error ${i}`),r(e)}})}async function ym(t){let r={getPastSyncInfo:()=>null,resyncSnippet:()=>null,...t,devToolsServerUrl:"",isValid:!1,publicApiKey:"",serverShouldRestart:!1,port:t.port||5273,ignoreMissingConfig:!1},e=t.getFrameworks().map(s=>s.name).join(", ");r.debug(`create devtools ${qA} [${e}]`);let i=await jA(r);return r.devToolsServerUrl=i.url,r.port=i.port,{getUrl:()=>r.devToolsServerUrl}}var qA="1.3.6";var zA=K(require("chokidar"),1),WA=K(require("ignore"),1);function GA(t){let r=t.match(/builder\.io\/content\/([^?]+)\?codeSession=([^&]+)&sid=([^\s]+)/);return r?{contentId:r[1],sessionKey:r[2],snippetId:r[3]}:{}}async function yc(t){let r=HA(t);return await(0,bm.glob)("**/*",{cwd:t,ignore:{ignored(i){return r(i.relative())}},nodir:!0})}async function j6(t,r,e){let i=await(0,bm.glob)("**/*",{cwd:t,ignore:["node_modules/**"],nodir:!0}),n=[];for(let s of i){let o=(0,zt.resolve)(t,s);try{let a=(0,rr.readFileSync)(o,"utf-8");if(a.includes("This code was generated by Builder.io")){let l=GA(a);if(r&&e&&(l.contentId!==r||l.sessionKey!==e))continue;n.push({path:s,code:gc(a),name:s.split("/").pop()||"",timestamp:(0,rr.statSync)(o).mtime.getTime(),snippetId:l.snippetId})}}catch(a){console.error(`Error reading file ${o}:`,a)}}return n}function q6(t,r){let e=GA(t);return e.contentId===r.contentId&&e.sessionKey===r.sessionKey}function HA(t){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"],e=(0,WA.default)().add(r);function i(n){try{let s=(0,zt.resolve)(t,n);if((0,rr.existsSync)(s)){let o=(0,rr.readFileSync)(s,"utf8");e.add(o)}}catch(s){console.debug(`No ${n} found or error reading it:`,s)}}return i(".gitignore"),i(".prettierignore"),i(".builderignore"),n=>{let s=(0,zt.relative)(t,n);if(!s)return!1;let o=s.split(zt.sep).join("/");return e.ignores(o)}}function KA(t,r,e){let i=HA(t),n=zA.default.watch(t,{ignored:i,ignoreInitial:!0,awaitWriteFinish:{stabilityThreshold:500,pollInterval:600},ignorePermissionErrors:!0,followSymlinks:!1,atomic:600}),s=async a=>{let l=(0,zt.relative)(t,a);try{let u=(0,rr.readFileSync)(a,"utf-8");if(q6(u,r.snippet)){let c=r.writtenFiles.find(p=>p.path===l);c?(c.code=gc(u),c.timestamp=Date.now()):r.writtenFiles.push({path:l,code:gc(u),timestamp:Date.now(),name:l.split("/").pop()||""}),r.timeStamp=Date.now(),e(r)}}catch(u){console.debug(`Error reading file ${a}:`,u)}};n.on("add",async a=>{q.info(`File added: ${a}`),await s(a)}).on("change",async a=>{q.info(`File changed: ${a}`),await s(a)}).on("unlink",a=>{q.info(`File deleted: ${a}`);let l=(0,zt.relative)(t,a);r.writtenFiles=r.writtenFiles.filter(u=>u.path!==l),r.timeStamp=Date.now(),e(r)}).on("unlinkDir",a=>{q.info(`Folder deleted: ${a}`);let l=(0,zt.relative)(t,a);r.writtenFiles=r.writtenFiles.filter(u=>!u.path.startsWith(l)),r.timeStamp=Date.now(),e(r)}).on("ready",()=>{console.debug("Initial scan complete. Ready for changes.")}).on("error",a=>{console.error(`Watcher error: ${a}`)}),n.on("raw",async(a,l,u)=>{if(a==="renamed"){q.info(`File renamed: ${u.oldPath} -> ${l}`);let c=u.oldPath?(0,zt.relative)(t,u.oldPath):void 0,p=l?(0,zt.relative)(t,l):void 0;if(c&&p){let d=r.writtenFiles.find(h=>h.path===c);d&&(d.path=p,r.timeStamp=Date.now(),e(r))}}});let o=async()=>{await n.close()};return process.on("SIGINT",o),process.on("SIGTERM",o),o}async function JA(t,r){t.debug("builder sync server init");let e=await ln(t),i=r,n=()=>Promise.resolve();i&&setTimeout(()=>{n=KA(t.getAppRootDir(),i,s=>{i=s})},1e3),await ym({...e,ensureFigmaImportPage:()=>Promise.reject("Not supported"),getPastSyncInfo:({sessionKey:s,since:o})=>!i||s!==i.snippet.sessionKey?null:{...i,hasChanged:i.timeStamp>o},resyncSnippet:async s=>{await n();let o=await Dm({path:i?.pathInput,snippet:s.snippet,cwd:t.getAppRootDir()});return o&&(i=o,n=KA(t.getAppRootDir(),i,a=>{i=a})),i},getClientId:()=>"builder-sync-cli",closeAppServer:async()=>{await n()},restartAppServer:async()=>{t.debug("restart server")},enableAppWatch:async s=>s,...t})}async function Dm(t){let r=t.snippetId,e=t.snippet||null;if(!e&&r&&(e=await fm(r)),!e)return pe(`No snippet found for id ${r}`),await oe(1);let i=process.cwd(),n=Oa(i)??i,s=await j6(n,e.contentId,e.sessionKey),o=s.filter(p=>p.snippetId===e.id);if(q.info(`Found ${o.length} matching files for snippet ${e.id} in existing files ${s.length}`),o.length>0){let p=Math.max(...o.map(d=>d.timestamp||0));return{snippet:e,writtenFiles:o,pathInput:VA(o.map(d=>d.path)),timeStamp:p}}let a=hm(n,e.framework||"react"),l=t.path||VA(s.map(p=>p.path))||await Lt({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."}});Oe(l)&&(pe("Cancelled sync"),process.exit(0));for(let p of s){let d=(0,zt.resolve)(n,p.path);try{(0,rr.unlinkSync)(d),q.info(`Deleted old file: ${d}`);let h=(0,zt.dirname)(d);(0,rr.readdirSync)(h).length===0&&((0,rr.rmdirSync)(h),q.info(`Deleted empty folder: ${h}`))}catch(h){q.error(`Error cleaning up file ${d}: ${h}`)}}let u=await fc(n,e,e.files,l,!0);q.success("All files have been written successfully.");let c=Math.max(...u.map(p=>p.timestamp||0));return{snippet:e,writtenFiles:u.map(p=>({...p,code:gc(p.code)})),pathInput:l,timeStamp:c||Date.now()}}function gc(t){if(!t)return t;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*)?/,e=/\/\*\*\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*/,i=t.replace(r,"").replace(e,"");return i=i.replace(/^\n+/,""),i}function VA(t){if(t.length===0)return"";if(t.length===1)return`./${t[0].slice(0,t[0].lastIndexOf("/")+1)}`;let r=t.map(n=>n.split("/")),e=Math.min(...r.map(n=>n.length)),i=[];for(let n=0;n<e;n++){let s=r[0][n];if(r.every(o=>o[n]===s))i.push(s);else break}return`./${i.join("/")}`}var oo=K(require("@sentry/node"),1);var me=K(Gt(),1);var iP=require("node:child_process");var xm=K(require("node:process"),1);function Em(){let{env:t}=xm.default,{TERM:r,TERM_PROGRAM:e}=t;return xm.default.platform!=="win32"?r!=="linux":!!t.WT_SESSION||!!t.TERMINUS_SUBLIME||t.ConEmuTask==="{cmd::Cmder}"||e==="Terminus-Sublime"||e==="vscode"||r==="xterm-256color"||r==="alacritty"||r==="rxvt-unicode"||r==="rxvt-unicode-256color"||t.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Cm=K(Gt(),1),Xi=K($e(),1),bc=require("node:process"),Sn=K(require("node:readline"),1),Ua=K(Gt(),1),vn=()=>{let t=Sm?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],r=Sm?80:120,e,i,n=!1,s="",o="",a="",l=y=>{let b=y>1?"Something went wrong":"Canceled";n&&f(b,y)},u=()=>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)},h=(y="")=>{n=!0,e=H6(),s=y.replace(/\.+$/,""),process.stdout.write(`${Cm.default.gray(K6)}
|
|
1810
|
+
`)}async function RA(t,r){let e=await ug(t),i=t.getFrameworks();return r.replace(/__LOCAL_APP_ID__/g,e).replace(/__DEV_TOOLS_URL__/g,t.devToolsServerUrl).replace(/__CLIENT_ID__/g,t.getClientId()).replace(/__FRAMEWORK__/g,i.length?i[0].name:"")}var LA=require("node:os");async function MA(t,r){let e=new URL("/cli-auth","https://builder.io");e.searchParams.set("client_id",t.getClientId()),e.searchParams.set("host",await t.getDeviceId()),e.searchParams.set("response_type","code"),e.searchParams.set("cli","true");let i=new URL(An,t.devToolsServerUrl);i.searchParams.set(Ka,(0,LA.platform)()),i.searchParams.set(Va,process.versions.node);let n=t.getFrameworks();return n.length>0&&(e.searchParams.set(Zn,n[0].name),i.searchParams.set(Zn,n[0].name)),e.searchParams.set("redirect_url",i.href),e.searchParams.set("preview_url",r),e.href}async function $A(t,r,e,i){try{if(!t)return so(e,i,400,"Builder context closed");let n=$6(e);if(n.pathname===Tc){if(e.method==="POST"){let s=await B6(e);if(s)try{let o=await FA(t,JSON.parse(s));return BA(e,i,200,o)}catch(o){t.debug("Dev API Error",o.stack||o.message||o);let a={errors:[String(o.message||o)]};return BA(e,i,500,a)}}else if(e.method==="OPTIONS"){let s={"Access-Control-Allow-Methods":"POST, OPTIONS","Access-Control-Allow-Headers":"Content-Type, Cache-Control, X-Builder-Devtools-Version"},o=e.headers.origin;o&&o!=="null"?UA(new URL(o))&&(s["Access-Control-Allow-Origin"]=o):s["Access-Control-Allow-Origin"]="*",i.writeHead(200,s),i.end();return}return so(e,i,405,`${Tc} is an API endpoint used only during development by the Builder.io Devtools client-side script`)}if(n.pathname===Ac)return R6(e,i,200,await kA(t));if(n.pathname===Fm){let s=n.searchParams.get(wc);return s?M6(i,302,await MA(t,s)):so(e,i,400,`Missing ${wc} querystring`)}return n.pathname===An?L6(e,i,200,await OA(t)):n.pathname===Pn?(t.debug(`Close Dev Tools Server Requested: ${n.href}`),setTimeout(()=>{try{r.close(s=>{t.debug(`Dev Tools Server Closed Error: ${s}`)})}catch(s){t.debug(`Error closing devtools server: ${s}`)}},20),so(e,i,200,"Closing Dev Tools Server")):so(e,i,404,"Not found")}catch(n){return console.error("Dev Server Error",n),so(e,i,500,`Dev Server Error: ${n}`)}}function BA(t,r,e,i){hc(t,r,e,"application/json",JSON.stringify(i))}function R6(t,r,e,i){hc(t,r,e,"application/javascript",i)}function L6(t,r,e,i){hc(t,r,e,"text/html",i)}function so(t,r,e,i){hc(t,r,e,"text/plain",i)}function hc(t,r,e,i,n){let s={"Content-Type":`${i}; charset=utf-8`,"Cache-Control":"no-cache, no-store, must-revalidate","X-Builder-Devtools-Version":"1.3.7"},o=t.headers.origin;o&&o!=="null"?UA(new URL(o))&&(s["Access-Control-Allow-Origin"]=o):s["Access-Control-Allow-Origin"]="*",r.writeHead(e,s),r.end(n)}function UA(t){return t.hostname==="localhost"||t.origin==="https://builder.io"||t.origin==="https://www.builder.io"||t.origin.endsWith(".builder.io")?!0:t.port===""?!1:t.port!=="80"&&t.port!=="443"}function M6(t,r,e){t.writeHead(r,{Location:e}),t.end()}async function B6(t){let r="";for await(let e of t)r+=e;return r}function $6(t){let r=t.url||"/";return new URL(r,`http://${t.headers.host}`)}async function jA(t){if(globalThis.__builderDevToolsServer)return t.debug("reusing existing devtools server"),globalThis.__builderDevToolsServer.setContext(t),globalThis.__builderDevToolsServer;let r=await U6(t),e=(0,mc.createServer)((n,s)=>{$A(t,e,n,s)}),i=()=>new Promise((n,s)=>{e.listening?(t.debug(`closing devtools server on port ${r}`),e.close(o=>{t=null,o?(t.debug(`error closing devtools server on port ${r}`),s(o)):(t&&t.debug(`closed devtools server on port ${r}`),n())})):(t.debug(`devtools server on port ${r} not listening`),n())});return process.once("SIGTERM",i),process.once("SIGINT",i),process.env.CI!=="true"&&process.stdin.on("end",i),globalThis.__builderDevToolsServer={url:new URL(`http://localhost:${r}`).href,port:r,setContext:n=>{t.debug(`set devtools context on server ${r}`),t=n},close:async()=>{globalThis.__builderDevToolsServer=null,await i()}},new Promise(n=>{e.listen(r,()=>{t.debug(`started devtools server on port ${r}`),n(globalThis.__builderDevToolsServer)})})}function U6(t){return new Promise(r=>{let e=t.port;try{(0,mc.request)({hostname:"localhost",port:e,path:Pn,method:"GET"},n=>{n.on("end",()=>{t.debug(`${Pn} - Response ended`),r(e)})}).on("error",n=>{t.debug(`${Pn} - No response ${n}`),r(e)}).end()}catch(i){t.debug(`${Pn} - Error ${i}`),r(e)}})}async function ym(t){let r={getPastSyncInfo:()=>null,resyncSnippet:()=>null,...t,devToolsServerUrl:"",isValid:!1,publicApiKey:"",serverShouldRestart:!1,port:t.port||5273,ignoreMissingConfig:!1},e=t.getFrameworks().map(s=>s.name).join(", ");r.debug(`create devtools ${qA} [${e}]`);let i=await jA(r);return r.devToolsServerUrl=i.url,r.port=i.port,{getUrl:()=>r.devToolsServerUrl}}var qA="1.3.7";var zA=K(require("chokidar"),1),WA=K(require("ignore"),1);function GA(t){let r=t.match(/builder\.io\/content\/([^?]+)\?codeSession=([^&]+)&sid=([^\s]+)/);return r?{contentId:r[1],sessionKey:r[2],snippetId:r[3]}:{}}async function yc(t){let r=HA(t);return await(0,bm.glob)("**/*",{cwd:t,ignore:{ignored(i){return r(i.relative())}},nodir:!0})}async function j6(t,r,e){let i=await(0,bm.glob)("**/*",{cwd:t,ignore:["node_modules/**"],nodir:!0}),n=[];for(let s of i){let o=(0,zt.resolve)(t,s);try{let a=(0,rr.readFileSync)(o,"utf-8");if(a.includes("This code was generated by Builder.io")){let l=GA(a);if(r&&e&&(l.contentId!==r||l.sessionKey!==e))continue;n.push({path:s,code:gc(a),name:s.split("/").pop()||"",timestamp:(0,rr.statSync)(o).mtime.getTime(),snippetId:l.snippetId})}}catch(a){console.error(`Error reading file ${o}:`,a)}}return n}function q6(t,r){let e=GA(t);return e.contentId===r.contentId&&e.sessionKey===r.sessionKey}function HA(t){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"],e=(0,WA.default)().add(r);function i(n){try{let s=(0,zt.resolve)(t,n);if((0,rr.existsSync)(s)){let o=(0,rr.readFileSync)(s,"utf8");e.add(o)}}catch(s){console.debug(`No ${n} found or error reading it:`,s)}}return i(".gitignore"),i(".prettierignore"),i(".builderignore"),n=>{let s=(0,zt.relative)(t,n);if(!s)return!1;let o=s.split(zt.sep).join("/");return e.ignores(o)}}function KA(t,r,e){let i=HA(t),n=zA.default.watch(t,{ignored:i,ignoreInitial:!0,awaitWriteFinish:{stabilityThreshold:500,pollInterval:600},ignorePermissionErrors:!0,followSymlinks:!1,atomic:600}),s=async a=>{let l=(0,zt.relative)(t,a);try{let u=(0,rr.readFileSync)(a,"utf-8");if(q6(u,r.snippet)){let c=r.writtenFiles.find(p=>p.path===l);c?(c.code=gc(u),c.timestamp=Date.now()):r.writtenFiles.push({path:l,code:gc(u),timestamp:Date.now(),name:l.split("/").pop()||""}),r.timeStamp=Date.now(),e(r)}}catch(u){console.debug(`Error reading file ${a}:`,u)}};n.on("add",async a=>{q.info(`File added: ${a}`),await s(a)}).on("change",async a=>{q.info(`File changed: ${a}`),await s(a)}).on("unlink",a=>{q.info(`File deleted: ${a}`);let l=(0,zt.relative)(t,a);r.writtenFiles=r.writtenFiles.filter(u=>u.path!==l),r.timeStamp=Date.now(),e(r)}).on("unlinkDir",a=>{q.info(`Folder deleted: ${a}`);let l=(0,zt.relative)(t,a);r.writtenFiles=r.writtenFiles.filter(u=>!u.path.startsWith(l)),r.timeStamp=Date.now(),e(r)}).on("ready",()=>{console.debug("Initial scan complete. Ready for changes.")}).on("error",a=>{console.error(`Watcher error: ${a}`)}),n.on("raw",async(a,l,u)=>{if(a==="renamed"){q.info(`File renamed: ${u.oldPath} -> ${l}`);let c=u.oldPath?(0,zt.relative)(t,u.oldPath):void 0,p=l?(0,zt.relative)(t,l):void 0;if(c&&p){let d=r.writtenFiles.find(h=>h.path===c);d&&(d.path=p,r.timeStamp=Date.now(),e(r))}}});let o=async()=>{await n.close()};return process.on("SIGINT",o),process.on("SIGTERM",o),o}async function JA(t,r){t.debug("builder sync server init");let e=await ln(t),i=r,n=()=>Promise.resolve();i&&setTimeout(()=>{n=KA(t.getAppRootDir(),i,s=>{i=s})},1e3),await ym({...e,ensureFigmaImportPage:()=>Promise.reject("Not supported"),getPastSyncInfo:({sessionKey:s,since:o})=>!i||s!==i.snippet.sessionKey?null:{...i,hasChanged:i.timeStamp>o},resyncSnippet:async s=>{await n();let o=await Dm({path:i?.pathInput,snippet:s.snippet,cwd:t.getAppRootDir()});return o&&(i=o,n=KA(t.getAppRootDir(),i,a=>{i=a})),i},getClientId:()=>"builder-sync-cli",closeAppServer:async()=>{await n()},restartAppServer:async()=>{t.debug("restart server")},enableAppWatch:async s=>s,...t})}async function Dm(t){let r=t.snippetId,e=t.snippet||null;if(!e&&r&&(e=await fm(r)),!e)return pe(`No snippet found for id ${r}`),await oe(1);let i=process.cwd(),n=Oa(i)??i,s=await j6(n,e.contentId,e.sessionKey),o=s.filter(p=>p.snippetId===e.id);if(q.info(`Found ${o.length} matching files for snippet ${e.id} in existing files ${s.length}`),o.length>0){let p=Math.max(...o.map(d=>d.timestamp||0));return{snippet:e,writtenFiles:o,pathInput:VA(o.map(d=>d.path)),timeStamp:p}}let a=hm(n,e.framework||"react"),l=t.path||VA(s.map(p=>p.path))||await Lt({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."}});Oe(l)&&(pe("Cancelled sync"),process.exit(0));for(let p of s){let d=(0,zt.resolve)(n,p.path);try{(0,rr.unlinkSync)(d),q.info(`Deleted old file: ${d}`);let h=(0,zt.dirname)(d);(0,rr.readdirSync)(h).length===0&&((0,rr.rmdirSync)(h),q.info(`Deleted empty folder: ${h}`))}catch(h){q.error(`Error cleaning up file ${d}: ${h}`)}}let u=await fc(n,e,e.files,l,!0);q.success("All files have been written successfully.");let c=Math.max(...u.map(p=>p.timestamp||0));return{snippet:e,writtenFiles:u.map(p=>({...p,code:gc(p.code)})),pathInput:l,timeStamp:c||Date.now()}}function gc(t){if(!t)return t;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*)?/,e=/\/\*\*\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*/,i=t.replace(r,"").replace(e,"");return i=i.replace(/^\n+/,""),i}function VA(t){if(t.length===0)return"";if(t.length===1)return`./${t[0].slice(0,t[0].lastIndexOf("/")+1)}`;let r=t.map(n=>n.split("/")),e=Math.min(...r.map(n=>n.length)),i=[];for(let n=0;n<e;n++){let s=r[0][n];if(r.every(o=>o[n]===s))i.push(s);else break}return`./${i.join("/")}`}var oo=K(require("@sentry/node"),1);var me=K(Gt(),1);var iP=require("node:child_process");var xm=K(require("node:process"),1);function Em(){let{env:t}=xm.default,{TERM:r,TERM_PROGRAM:e}=t;return xm.default.platform!=="win32"?r!=="linux":!!t.WT_SESSION||!!t.TERMINUS_SUBLIME||t.ConEmuTask==="{cmd::Cmder}"||e==="Terminus-Sublime"||e==="vscode"||r==="xterm-256color"||r==="alacritty"||r==="rxvt-unicode"||r==="rxvt-unicode-256color"||t.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Cm=K(Gt(),1),Xi=K($e(),1),bc=require("node:process"),Sn=K(require("node:readline"),1),Ua=K(Gt(),1),vn=()=>{let t=Sm?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],r=Sm?80:120,e,i,n=!1,s="",o="",a="",l=y=>{let b=y>1?"Something went wrong":"Canceled";n&&f(b,y)},u=()=>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)},h=(y="")=>{n=!0,e=H6(),s=y.replace(/\.+$/,""),process.stdout.write(`${Cm.default.gray(K6)}
|
|
1811
1811
|
`);let b=0,C=0;p(),i=setInterval(()=>{let D=Cm.default.magenta(t[b]),x=".".repeat(Math.floor(C)).slice(0,3);process.stdout.write(Xi.cursor.move(-999,-a.split(`
|
|
1812
1812
|
`).length+1)),process.stdout.write(Xi.erase.down(a.split(`
|
|
1813
1813
|
`).length));let E=`${D} ${s}${x}${o}`;process.stdout.write(E),b=b+1<t.length?b+1:0,C=C<t.length?C+.125:0,a=E},r)},f=(y,b=0)=>{s=y??s,n=!1,clearInterval(i);let C=b===0?(0,Ua.green)(W6):b===1?(0,Ua.red)(V6):(0,Ua.red)(z6);process.stdout.write(Xi.cursor.move(-999,-a.split(`
|
|
1814
1814
|
`).length+1)),process.stdout.write(Xi.erase.down(a.split(`
|
|
1815
1815
|
`).length)),process.stdout.write(`${C} ${s}
|
|
1816
|
-
`),a=s,d(),e()};return{start:h,stop:f,message:(y="")=>{s=y??s},extra:(y="")=>{o=y}}},Sm=Em(),Dc=(t,r)=>Sm?t:r,K6=Dc("\u2502","|"),V6=Dc("\u25A0","x"),z6=Dc("\u25B2","x"),W6=Dc("\u25C7","o"),G6=globalThis.process.platform.startsWith("win");function H6({input:t=bc.stdin,output:r=bc.stdout,overwrite:e=!0,hideCursor:i=!0}={}){let n=Sn.createInterface({input:t,output:r,prompt:"",tabSize:1});Sn.emitKeypressEvents(t,n),t.isTTY&&t.setRawMode(!0);let s=(o,{name:a})=>{if(String(o)===""){i&&r.write(Xi.cursor.show),process.exit(0);return}if(!e)return;Sn.moveCursor(r,a==="return"?0:-1,a==="return"?-1:0,()=>{Sn.clearLine(r,1,()=>{t.once("keypress",s)})})};return i&&r.write(Xi.cursor.hide),t.once("keypress",s),()=>{t.off("keypress",s),i&&r.write(Xi.cursor.show),t.isTTY&&!G6&&t.setRawMode(!1),n.terminal=!1,n.close()}}var wn=K(Gt(),1);var YA=K(require("crypto"),1)
|
|
1816
|
+
`),a=s,d(),e()};return{start:h,stop:f,message:(y="")=>{s=y??s},extra:(y="")=>{o=y}}},Sm=Em(),Dc=(t,r)=>Sm?t:r,K6=Dc("\u2502","|"),V6=Dc("\u25A0","x"),z6=Dc("\u25B2","x"),W6=Dc("\u25C7","o"),G6=globalThis.process.platform.startsWith("win");function H6({input:t=bc.stdin,output:r=bc.stdout,overwrite:e=!0,hideCursor:i=!0}={}){let n=Sn.createInterface({input:t,output:r,prompt:"",tabSize:1});Sn.emitKeypressEvents(t,n),t.isTTY&&t.setRawMode(!0);let s=(o,{name:a})=>{if(String(o)===""){i&&r.write(Xi.cursor.show),process.exit(0);return}if(!e)return;Sn.moveCursor(r,a==="return"?0:-1,a==="return"?-1:0,()=>{Sn.clearLine(r,1,()=>{t.once("keypress",s)})})};return i&&r.write(Xi.cursor.hide),t.once("keypress",s),()=>{t.off("keypress",s),i&&r.write(Xi.cursor.show),t.isTTY&&!G6&&t.setRawMode(!1),n.terminal=!1,n.close()}}var wn=K(Gt(),1);var YA=K(require("crypto"),1);var J6=16,Y6=2e5,X6=3e5,XA=async(t,r)=>{console.log(""),It((0,wn.bgCyan)((0,wn.bold)((0,wn.white)(" code indexing ")))+" "+(0,wn.dim)("1.3.7"));let e=await wr(t,r,{forceSpaceId:r.spaceId,builderPrivateKey:!0,builderPublicKey:!0});await vm(t,e),Mt("DONE")},vm=async(t,r)=>{let e=vn();e.start("Indexing files...");let i=t.getAppRootDir(),s=(await yc(i)).filter(Q6).map(g=>({filePath:g,content:t.readFileSync(t.join(i,g))})).filter(g=>g.content.length<X6),o=[],a=[];o.push(a);let l=0;for(let g of s)l+g.content.length>Y6&&(a=[],o.push(a),l=0),a.push(g),l+=g.content.length;let u=0,c=o.length,p=Date.now();function d(g){u+=g;let m="\u2591",y=60,b=u/c,C=m.repeat(Math.floor(b*y)),D=" ".repeat(y-C.length),x=`${Math.round(b*100)}%`,E=Date.now()-p,w=b>0?E/b:0,R=Math.max(0,w-E),M=new Date(R).toISOString().substr(11,8);e.extra(`
|
|
1817
1817
|
|
|
1818
|
-
[${C}${D}] ${x} (${M} remaining)`)}d(0);let h=YA.default.randomUUID(),f=await t.getRepoInfo();await Promise.all(Array.from({length:J6}).map(async()=>{for(;;){let g=o.shift();if(!g)break;let m=new URL(`${gi}/codegen/indexing`);m.searchParams.set("apiKey",r.builderPublicKey),m.searchParams.set("userId",r.userId);let y=await
|
|
1818
|
+
[${C}${D}] ${x} (${M} remaining)`)}d(0);let h=YA.default.randomUUID(),f=await t.getRepoInfo();await Promise.all(Array.from({length:J6}).map(async()=>{for(;;){let g=o.shift();if(!g)break;let m=new URL(`${gi}/codegen/indexing`);m.searchParams.set("apiKey",r.builderPublicKey),m.searchParams.set("userId",r.userId);let y=await ht(m,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${r.builderPrivateKey}`},body:JSON.stringify({repoInfo:f,files:g,sessionId:h,addExtraContext:!0})});if(!y.ok)throw new Error("Failed to index codebase");let b=wm(y.body),C=0;for await(let D of b){if(D.length===0)continue;let x=JSON.parse(D);if(x.type==="progress"){let E=x.chunksProcessed/x.totalChunks;d(E-C),C=E}}}})),e.stop("Codebase indexed")};function Q6(t){return t.endsWith("package.json")?!0:!(!t.endsWith(".ts")&&!t.endsWith(".tsx")&&!t.endsWith(".js")&&!t.endsWith(".jsx")&&!t.endsWith(".html")||t.includes(".mapper.ts")||t.includes(".mapper.js")||t.endsWith("package-lock.json"))}var nP=K(require("crypto"),1),Z6=5,sP=async(t,r,e)=>{r==="indexing"?await XA(t,e):r==="generate"||r==="gen"||r==="g"?await QA(t,e):r==="gen"?Hi("code"):await QA(t,e)},QA=async(t,r)=>{console.log(""),It((0,me.bgCyan)((0,me.bold)((0,me.white)(" code ")))+" "+(0,me.dim)("1.3.7"));let e=await wr(t,r,{forceSpaceId:r.spaceId,builderPrivateKey:!0,builderPublicKey:!0}),i=r.url,n={history:[],undoStates:[],sessionId:nP.default.randomUUID(),selectedFilePaths:new Map};if(ft("figma code started",{spaceId:e.builderPublicKey}),r.prompt){let s=r.mode||"exact",o={userPrompt:r.prompt,mode:s};await ZA(t,e,n,o.userPrompt,o.mode,i);return}for(;;){let s=await e4(t,e,n,!!i);if(s==="exit")break;if(s==="undo")continue;let o=s.userPrompt,a=s.mode;await ZA(t,e,n,o,a,i)}};async function e4(t,r,e,i){let n=t.getAppRootDir(),s="",o;if(e.history.length===0){let u=await Lt({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(c){if(i){if(c.length===0)return"please, enter a detailed instruction";if(c.length<10)return"a more detailed instruction is needed"}else if(c.length===0)return"please, provide some prompt"}});if(Oe(u))return pe("See you later! \u{1F44B}"),rP(e.sessionId,r.builderPublicKey),"exit";if(s=u??"integrate design into the app, might be a new page/component/layout depending on the design",i){let c=o??await Za({message:"How do you want to apply the changes?",options:[{value:"exact",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(Oe(c))return pe("Command cancelled"),"exit";o=c}else o="creative"}else{let a=e.history[e.history.length-1]?.id;q.message(`${(0,me.green)("Changes are applied.")} What do you want to do next?
|
|
1819
1819
|
|
|
1820
1820
|
${(0,me.bgBlack)(" Ctrl+C ")} ${(0,me.dim)("to accept changes and exit")}
|
|
1821
|
-
${(0,me.bgBlack)(' "undo" ')} ${(0,me.dim)("to undo last changes and try again")}`,{symbol:(0,me.green)("\u2714")});let l=await Lt({message:`${(0,me.bgBlack)(" Follow up ")} with more instructions:`,placeholder:' Reply "accept", "undo", or provide follow-up feedback (Ctrl+C to exit)',validate(c){if(!c)return"Please enter a value (Ctrl+C & exit)"}});if(Oe(l)||l.trim().toLowerCase()==="accept")return Mt(`${(0,me.bgGreen)((0,me.bold)((0,me.white)(" Done! \u{1F389} ")))} ${(0,me.dim)("session "+a)}`),rP(e.sessionId),ft("figma code accepted",{spaceId:r.builderPublicKey,userPrompt:s}),a&&await eP(r,a,"positive"),"exit";if(l.trim().toLowerCase()==="undo"){a&&await eP(r,a,"negative"),e.history.pop(),e.history.pop();let c=e.undoStates.pop();if(c){for(let p of c.files)p.content?await t.writeFile(t.join(n,p.path),p.content):await t.unlink(t.join(n,p.path));q.warn(`Restored files to previous state:
|
|
1821
|
+
${(0,me.bgBlack)(' "undo" ')} ${(0,me.dim)("to undo last changes and try again")}`,{symbol:(0,me.green)("\u2714")});let l=await Lt({message:`${(0,me.bgBlack)(" Follow up ")} with more instructions:`,placeholder:' Reply "accept", "undo", or provide follow-up feedback (Ctrl+C to exit)',validate(c){if(!c)return"Please enter a value (Ctrl+C & exit)"}});if(Oe(l)||l.trim().toLowerCase()==="accept")return Mt(`${(0,me.bgGreen)((0,me.bold)((0,me.white)(" Done! \u{1F389} ")))} ${(0,me.dim)("session "+a)}`),rP(e.sessionId,r.builderPublicKey),ft("figma code accepted",{spaceId:r.builderPublicKey,userPrompt:s}),a&&await eP(r,a,"positive"),"exit";if(l.trim().toLowerCase()==="undo"){a&&await eP(r,a,"negative"),e.history.pop(),e.history.pop();let c=e.undoStates.pop();if(c){for(let p of c.files)p.content?await t.writeFile(t.join(n,p.path),p.content):await t.unlink(t.join(n,p.path));q.warn(`Restored files to previous state:
|
|
1822
1822
|
${c.files.map(p=>(0,me.dim)(" - "+p.path)).join(`
|
|
1823
1823
|
`)}
|
|
1824
|
-
`)}return"undo"}s=l}return{userPrompt:s,mode:o}}var t4=!1;async function ZA(t,r,e,i,n,s){let o=Kn(fn),a=t.getAppRootDir(),l=await t.getRepoInfo(),u=vn();u.start("Analyzing relevant files");let c=[],p=[],d=!1,h=!1,f;for(let D=0;D<2;D++){let x=await i4(r.userId,r.builderPublicKey,r.builderPrivateKey,{query:i,repoInfo:l,limit:10});if(D===0&&x.length===0&&t4&&(u&&(u.stop("Codebase index not found. Indexing allows the CLI to automatically find relevant files."),u=void 0),await
|
|
1824
|
+
`)}return"undo"}s=l}return{userPrompt:s,mode:o}}var t4=!1;async function ZA(t,r,e,i,n,s){let o=Kn(fn),a=t.getAppRootDir(),l=await t.getRepoInfo(),u=vn();u.start("Analyzing relevant files");let c=[],p=[],d=!1,h=!1,f;for(let D=0;D<2;D++){let x=await i4(r.userId,r.builderPublicKey,r.builderPrivateKey,{query:i,repoInfo:l,limit:10});if(D===0&&x.length===0&&t4&&(u&&(u.stop("Codebase index not found. Indexing allows the CLI to automatically find relevant files."),u=void 0),await gt({message:"Do you want to index the codebase?",active:"Yes",inactive:"Skip"})===!0)){await vm(t,r);continue}let E=await yc(a);if(x.length>0){for(let w of E){let R=Tm(w,x,e.selectedFilePaths);R!==0?(c.push(w),e.selectedFilePaths.set(w,R)):tP(t,w)&&p.push(w)}u?(u.stop(`Found relevant files of the project:
|
|
1825
1825
|
${(0,me.dim)("\u2502")}
|
|
1826
1826
|
${c.map(w=>(0,me.dim)("\u2502 "+w)).join(`
|
|
1827
1827
|
`)}`),u=void 0):q.info(`Found relevant files of the project:
|
|
1828
1828
|
|
|
1829
1829
|
${c.map(w=>(0,me.dim)(w)).join(`
|
|
1830
|
-
`)}`),f=void 0}else{let w=E.filter(L=>{let Q=Tm(L,x,e.selectedFilePaths);return Q===1||Q===2});f=10;let R=Math.min(40,w.length),M=[],T=0;for(;M.length<R&&T<w.length*2;){T++;let L=w[Math.floor(Math.random()*w.length)];M.includes(L)||M.push(L)}for(let L of E){let Q=Tm(L,M,e.selectedFilePaths);Q!==0?(c.push(L),e.selectedFilePaths.set(L,Q)):tP(t,L)&&p.push(L)}}break}u&&(u.stop(void 0),u=void 0);let g=await o4(t,a);u=vn(),u.start("Thinking"),e.undoStates.push({files:[]});let m=!0,y=0,b=[];for(;m;){if(y>0&&y%Z6===0&&(q.warn(`Large generation in progress: ${y} pages generated so far.`),!await
|
|
1830
|
+
`)}`),f=void 0}else{let w=E.filter(L=>{let Q=Tm(L,x,e.selectedFilePaths);return Q===1||Q===2});f=10;let R=Math.min(40,w.length),M=[],T=0;for(;M.length<R&&T<w.length*2;){T++;let L=w[Math.floor(Math.random()*w.length)];M.includes(L)||M.push(L)}for(let L of E){let Q=Tm(L,M,e.selectedFilePaths);Q!==0?(c.push(L),e.selectedFilePaths.set(L,Q)):tP(t,L)&&p.push(L)}}break}u&&(u.stop(void 0),u=void 0);let g=await o4(t,a);u=vn(),u.start("Thinking"),e.undoStates.push({files:[]});let m=!0,y=0,b=[];for(;m;){if(y>0&&y%Z6===0&&(q.warn(`Large generation in progress: ${y} pages generated so far.`),!await gt({message:"Do you want to continue generating?",active:"Continue",inactive:"Stop"}))){q.info("Generation stopped by user");break}let D={url:s,files:c.map(E=>({filePath:E,content:t.readFileSync(t.join(a,E)),importance:e.selectedFilePaths.get(E)??1})),customInstructions:g,hiddenFiles:p,sessionId:e.sessionId,history:e.history,mode:n,userPrompt:i,reranker:f,prevId:e.history[e.history.length-1]?.id,nextPage:!!e.hasNextPage},x=r4(r,D);for await(let E of x)try{let M=function(T,L){T.type==="text"&&(d||(process.stdout.write((0,me.dim)(`\u2502
|
|
1831
1831
|
`)+(0,me.magenta)("~ ")),d=!0),process.stdout.write(L.replace(/\n/g,`
|
|
1832
1832
|
`+(0,me.magenta)("\u2502 ")))),!T.synthetic&&(T.type==="file"||T.type==="diff")&&u&&u.extra(`
|
|
1833
1833
|
|
|
1834
1834
|
${o.highlightAuto(T.content).value.split(`
|
|
1835
1835
|
`).slice(-10).map(Q=>Q.length>process.stdout.columns?Q.slice(0,process.stdout.columns-5):Q).join(`
|
|
1836
1836
|
`)}`)};var C=M;async function w(T){if(e.hasNextPage=!1,d&&(process.stdout.write(`
|
|
1837
|
-
`),d=!1),T.type==="file"&&!T.synthetic&&(u=vn(),u.start(`${T.actionTitle??T.artifactTitle}`)),T.type==="diff"&&(u=vn(),u.start(`${T.actionTitle??T.artifactTitle}`)),T.type==="done"){if(e.history.push({role:"user",content:i}),e.history.push({role:"assistant",content:T.content,id:T.id}),T.stopReason==="limit"){q.error("\u{1F6A8} The request was cancelled because it reached the account limits.");let L=new URL("https://builder.io/account/subscription");if(L.searchParams.set("space_id",r.builderPublicKey),await
|
|
1838
|
-
${(0,me.bgBlack)(" "+T.content.trim()+" ")}`,{symbol:(0,me.magenta)("~")});let L=await
|
|
1837
|
+
`),d=!1),T.type==="file"&&!T.synthetic&&(u=vn(),u.start(`${T.actionTitle??T.artifactTitle}`)),T.type==="diff"&&(u=vn(),u.start(`${T.actionTitle??T.artifactTitle}`)),T.type==="done"){if(e.history.push({role:"user",content:i}),e.history.push({role:"assistant",content:T.content,id:T.id}),T.stopReason==="limit"){q.error("\u{1F6A8} The request was cancelled because it reached the account limits.");let L=new URL("https://builder.io/account/subscription");if(L.searchParams.set("space_id",r.builderPublicKey),await gt({message:`Open: ${L.href}`,active:"Open",inactive:"Exit"})){let{default:ie}=await import("open");await ie(L.href)}await oe(1);return}T.stopReason==="max_tokens"&&(e.hasNextPage=!0)}}async function R(T){if(T.type==="diff"&&u&&(u.stop(`${T.actionTitle??T.artifactTitle}: ${(0,me.dim)(T.filePath)}`),u=void 0),T.type==="file"&&T.filePath){let L=t.join(a,T.filePath),ie=t.existsSync(L)?t.readFileSync(L):null;e.undoStates[e.undoStates.length-1].files.push({path:T.filePath,content:ie});let re=await ir(T.content,void 0,L);await t.writeFile(L,re),e.selectedFilePaths.set(T.filePath,3),u&&!T.synthetic&&(u.stop(`${T.actionTitle??T.artifactTitle??"Created"}: ${(0,me.dim)(T.filePath)}`),u=void 0)}if(T.type==="shell"){q.message(`Requested to run command:
|
|
1838
|
+
${(0,me.bgBlack)(" "+T.content.trim()+" ")}`,{symbol:(0,me.magenta)("~")});let L=await gt({message:"Do you want to execute and continue?",active:`Execute ${(0,me.dim)("(recommended)")}`,inactive:"Skip"});if(Oe(L)||!L){q.warn(`Command skipped. Run it manually:
|
|
1839
1839
|
${(0,me.bgBlack)(" "+T.content+" ")}.`);return}u=vn(),u.start(`Running \`${T.content}\``),await s4(T.content,{shell:!0,stdio:"inherit"})?u.stop(`Command \`${T.content}\` completed`):u.stop(`Command \`${T.content}\` failed`,2),u=void 0}}if(u&&!h&&(u.stop("\u{1F4A1}"),u=void 0,h=!0),E.type==="delta"){let T=E.content,L=b[b.length-1];L&&(L.content+=T),await M(L,T)}else{let T=b[b.length-1];T&&(T.incomplete=!1,await R(T)),b.push(E),await w(E)}if(E.type==="done")break}catch{}m=!!e.hasNextPage,y++}d&&(process.stdout.write(`
|
|
1840
|
-
`),d=!1)}async function*r4(t,r){let e=new URL(`${gi}/codegen/completion`);e.searchParams.set("apiKey",t.builderPublicKey),e.searchParams.set("userId",t.userId);let i=await
|
|
1841
|
-
`);for(let a=0;a<o.length-1;a++)yield o[a];r=o[o.length-1]}}function s4(t,r){let e;return new Promise(n=>{try{e=(0,iP.spawn)(t,{shell:!0,...r}),e.on("error",()=>{n(!1)}),e.on("close",s=>{n(s===0)})}catch{n(!1)}})}async function o4(t,r){let e=[];async function i(n){try{let s=t.resolve(r,n);if(await t.exists(s)){let o=await t.readFile(s);if(o){let a="hash-"+await t.hash(o);e.push({id:a,name:n,content:o})}}}catch(s){console.debug(`No ${n} found or error reading it:`,s)}}return await i(".cursorrules"),await i(".builderrules"),e}function a4(t){let
|
|
1842
|
-
\u{1F4DD} We'd love your feedback on the code generation!
|
|
1843
|
-
${(0,me.dim)(
|
|
1840
|
+
`),d=!1)}async function*r4(t,r){let e=new URL(`${gi}/codegen/completion`);e.searchParams.set("apiKey",t.builderPublicKey),e.searchParams.set("userId",t.userId);let i=await ht(e,{method:"POST",body:JSON.stringify(r),headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.builderPrivateKey}`}}),n=wm(i.body);for await(let s of n){if(s.length===0)continue;yield JSON.parse(s)}}async function eP(t,r,e,i){let n=new URL(`${gi}/codegen/feedback`);n.searchParams.set("apiKey",t.builderPublicKey),n.searchParams.set("userId",t.userId),await ht(n,{method:"POST",body:JSON.stringify({id:r,feedbackText:i,feedbackSentiment:e}),headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.builderPrivateKey}`}})}async function i4(t,r,e,i){let n=new URL(`${gi}/codegen/search`);n.searchParams.set("apiKey",r),n.searchParams.set("userId",t);let o=await(await ht(n,{method:"POST",body:JSON.stringify(i),headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`}})).json(),a=new Set;for(let l of o)a.add(l.filePath);return Array.from(a)}function tP(t,r){return!(r.includes(".test.")||r.includes(".spec.")||r.includes(".unit.")||r.includes(".e2e.")||r.includes("test")||r.includes("tests")||t.basename(r).startsWith("."))}function Tm(t,r,e){let i=e.get(t)??0;if(t.endsWith("package.json")||t.endsWith("tsconfig.json")||t.includes("tailwind.config")||t.endsWith("components.json"))return 3;if(t.includes("components/ui/")||t.endsWith(".mapper.tsx")||t.endsWith(".mapper.jsx")||t.endsWith("package-lock.json")||t.endsWith("builder-registry.ts"))return i;if(t.includes("layout")||n4(t)<2&&(t.endsWith(".css")||t.endsWith(".scss")))return Math.max(i,2);if(r.length>0){if(r.some(n=>t.includes(n)))return Math.max(i,2)}else if(t.includes("components/ui/"))return i;return!t.endsWith(".ts")&&!t.endsWith(".tsx")&&!t.endsWith(".js")&&!t.endsWith(".jsx")&&!t.endsWith(".html")&&!t.endsWith(".html.erb")?i:Math.max(i,1)}function n4(t){return(t.match(/\//g)||[]).length}async function*wm(t){if(!t)return;let r="",e=t.getReader(),i,n;for(;!i&&({value:n,done:i}=await e.read(),!i);){let s=new TextDecoder().decode(n);r+=s;let o=r.split(`
|
|
1841
|
+
`);for(let a=0;a<o.length-1;a++)yield o[a];r=o[o.length-1]}}function s4(t,r){let e;return new Promise(n=>{try{e=(0,iP.spawn)(t,{shell:!0,...r}),e.on("error",()=>{n(!1)}),e.on("close",s=>{n(s===0)})}catch{n(!1)}})}async function o4(t,r){let e=[];async function i(n){try{let s=t.resolve(r,n);if(await t.exists(s)){let o=await t.readFile(s);if(o){let a="hash-"+await t.hash(o);e.push({id:a,name:n,content:o})}}}catch(s){console.debug(`No ${n} found or error reading it:`,s)}}return await i(".cursorrules"),await i(".builderrules"),e}function a4(t,r){let e="https://docs.google.com/forms/d/e/1FAIpQLSdHUIxeNZCAeMTgAWehxBtZplgcqXqyPbGf9Z1Advnf2ARxGw/viewform",i="entry.986969459",n="entry.1867678972",s=new URL(e);return s.searchParams.set("usp","pp_url"),s.searchParams.set(i,t),r&&s.searchParams.set(n,r),s.toString()}function rP(t,r){let e=a4(t,r);console.log(`
|
|
1842
|
+
\u{1F4DD} We'd love your feedback on the code generation!
|
|
1843
|
+
${(0,me.dim)(e)}
|
|
1844
1844
|
`)}async function l4(t){t.debug("builder dev tools cli init");let r=await(0,oP.createDevTools)(t);await(0,lP.createDevToolsServer)({...r,getClientId:()=>"builder-dev-tools-cli",closeAppServer:async()=>{},restartAppServer:async()=>{t.debug("restart server")},enableAppWatch:async e=>e,...t})}var pP=async()=>{await cP.flush().promise,process.exit(0)};process.on("SIGINT",pP);process.on("SIGTERM",pP);async function u4(){await tT();try{let t=(0,uP.default)(process.argv.slice(2),{string:["figmaToken","privateKey","spaceId","cwd","prompt","mode","url"],boolean:["help","ci","force","printJson","dryrun","yes","skipInstallation"]});if(t.help)return Hi(t._[t._.length-1]),await oe(0);let r=t._[0];t.cwd&&(console.log("changing cwd",t.cwd),process.chdir(t.cwd));let e=await(0,aP.createDevToolsNodeSys)({cwd:process.cwd(),ignoreMissingConfig:!0});if(r==="figma"){let i=t._[1];try{await yA(e,i,t)}catch(n){return oo.captureException(n),console.error(n),await oe(1)}}else if(r==="code"){let i=t._[1];try{await sP(e,i,t)}catch(n){return oo.captureException(n),console.error(n),await oe(1)}}else if(r==="add"){let i=mm(e.getAppRootDir(),process.argv.slice(2));await bA(i)}else if(r==="sync"){let i=mm(e.getAppRootDir(),process.argv.slice(2)),n=await Dm(i);JA(e,n).then(()=>{console.info("Builder dev tools is running")}).catch(s=>{oo.captureException(s),console.error("Cannot start builder dev tools",s)})}else{if(r==="help")return Hi(t._[1]),await oe(0);if(r==="publish"||r==="migrate"||r==="generate")return pe("Command not found, do you mean `npx builder.io figma "+r+"`?"),await oe(1);l4(e).then(()=>{console.info("Builder dev tools is running")}).catch(i=>{oo.captureException(i),console.error("Cannot start builder dev tools",i)})}}catch(t){return oo.captureException(t),console.error(t),await oe(1)}}u4();
|
|
1845
1845
|
//# sourceMappingURL=index.cjs.map
|