builder.io 1.11.39 → 1.11.41
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 +415 -451
- package/cli/index.cjs.map +4 -4
- 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 +2 -3
- package/server/index.cjs +115 -169
- package/server/index.mjs +125 -179
- package/types/cli/backup.d.ts +3 -1
- package/types/cli/credentials.d.ts +1 -1
- package/types/cli/launch/InitStateMachine.d.ts +1 -0
- package/types/cli/launch/dev-server-orchestrator.d.ts +2 -2
- package/types/cli/launch/proxy.d.ts +2 -2
- package/types/cli/utils/git.d.ts +11 -0
- package/types/tsconfig.tsbuildinfo +1 -1
- package/types/types/codegen-server.d.ts +14 -0
- package/types/types/connection-tracker.d.ts +24 -0
- package/types/types/proxy-middleware.d.ts +31 -0
- package/types/types/websocket-types.d.ts +17 -0
package/server/index.mjs
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
|
-
var Wf=Object.create;var ri=Object.defineProperty;var zf=Object.getOwnPropertyDescriptor;var qf=Object.getOwnPropertyNames;var Jf=Object.getPrototypeOf,Yf=Object.prototype.hasOwnProperty;var Qf=(e,t,r)=>t in e?ri(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var z=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var B=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Xf=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of qf(t))!Yf.call(e,i)&&i!==r&&ri(e,i,{get:()=>t[i],enumerable:!(n=zf(t,i))||n.enumerable});return e};var De=(e,t,r)=>(r=e!=null?Wf(Jf(e)):{},Xf(t||!e||!e.__esModule?ri(r,"default",{value:e,enumerable:!0}):r,e));var je=(e,t,r)=>Qf(e,typeof t!="symbol"?t+"":t,r);var Ea=B((cw,va)=>{"use strict";va.exports=function(){if(process.env.npm_config_user_agent)return em(process.env.npm_config_user_agent)};function em(e){let t=e.split(" ")[0],r=t.lastIndexOf("/"),n=t.substring(0,r);return{name:n==="npminstall"?"cnpm":n,version:t.substring(r+1)}}});var Qn=B((cv,Qa)=>{"use strict";var pi="\x1B",le=`${pi}[`,xm="\x07",di={to(e,t){return t?`${le}${t+1};${e+1}H`:`${le}${e+1}G`},move(e,t){let r="";return e<0?r+=`${le}${-e}D`:e>0&&(r+=`${le}${e}C`),t<0?r+=`${le}${-t}A`:t>0&&(r+=`${le}${t}B`),r},up:(e=1)=>`${le}${e}A`,down:(e=1)=>`${le}${e}B`,forward:(e=1)=>`${le}${e}C`,backward:(e=1)=>`${le}${e}D`,nextLine:(e=1)=>`${le}E`.repeat(e),prevLine:(e=1)=>`${le}F`.repeat(e),left:`${le}G`,hide:`${le}?25l`,show:`${le}?25h`,save:`${pi}7`,restore:`${pi}8`},bm={up:(e=1)=>`${le}S`.repeat(e),down:(e=1)=>`${le}T`.repeat(e)},wm={screen:`${le}2J`,up:(e=1)=>`${le}1J`.repeat(e),down:(e=1)=>`${le}J`.repeat(e),line:`${le}2K`,lineEnd:`${le}K`,lineStart:`${le}1K`,lines(e){let t="";for(let r=0;r<e;r++)t+=this.line+(r<e-1?di.up():"");return e&&(t+=di.left),t}};Qa.exports={cursor:di,scroll:bm,erase:wm,beep:xm}});var tr=B((lv,fi)=>{var Zn=process||{},Xa=Zn.argv||[],Xn=Zn.env||{},vm=!(Xn.NO_COLOR||Xa.includes("--no-color"))&&(!!Xn.FORCE_COLOR||Xa.includes("--color")||Zn.platform==="win32"||(Zn.stdout||{}).isTTY&&Xn.TERM!=="dumb"||!!Xn.CI),Em=(e,t,r=e)=>n=>{let i=""+n,s=i.indexOf(t,e.length);return~s?e+Sm(i,t,r,s)+t:e+i+t},Sm=(e,t,r,n)=>{let i="",s=0;do i+=e.substring(s,n)+r,s=n+t.length,n=e.indexOf(t,s);while(~n);return i+e.substring(s)},Za=(e=vm)=>{let t=e?Em:()=>String;return{isColorSupported:e,reset:t("\x1B[0m","\x1B[0m"),bold:t("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:t("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:t("\x1B[3m","\x1B[23m"),underline:t("\x1B[4m","\x1B[24m"),inverse:t("\x1B[7m","\x1B[27m"),hidden:t("\x1B[8m","\x1B[28m"),strikethrough:t("\x1B[9m","\x1B[29m"),black:t("\x1B[30m","\x1B[39m"),red:t("\x1B[31m","\x1B[39m"),green:t("\x1B[32m","\x1B[39m"),yellow:t("\x1B[33m","\x1B[39m"),blue:t("\x1B[34m","\x1B[39m"),magenta:t("\x1B[35m","\x1B[39m"),cyan:t("\x1B[36m","\x1B[39m"),white:t("\x1B[37m","\x1B[39m"),gray:t("\x1B[90m","\x1B[39m"),bgBlack:t("\x1B[40m","\x1B[49m"),bgRed:t("\x1B[41m","\x1B[49m"),bgGreen:t("\x1B[42m","\x1B[49m"),bgYellow:t("\x1B[43m","\x1B[49m"),bgBlue:t("\x1B[44m","\x1B[49m"),bgMagenta:t("\x1B[45m","\x1B[49m"),bgCyan:t("\x1B[46m","\x1B[49m"),bgWhite:t("\x1B[47m","\x1B[49m"),blackBright:t("\x1B[90m","\x1B[39m"),redBright:t("\x1B[91m","\x1B[39m"),greenBright:t("\x1B[92m","\x1B[39m"),yellowBright:t("\x1B[93m","\x1B[39m"),blueBright:t("\x1B[94m","\x1B[39m"),magentaBright:t("\x1B[95m","\x1B[39m"),cyanBright:t("\x1B[96m","\x1B[39m"),whiteBright:t("\x1B[97m","\x1B[39m"),bgBlackBright:t("\x1B[100m","\x1B[49m"),bgRedBright:t("\x1B[101m","\x1B[49m"),bgGreenBright:t("\x1B[102m","\x1B[49m"),bgYellowBright:t("\x1B[103m","\x1B[49m"),bgBlueBright:t("\x1B[104m","\x1B[49m"),bgMagentaBright:t("\x1B[105m","\x1B[49m"),bgCyanBright:t("\x1B[106m","\x1B[49m"),bgWhiteBright:t("\x1B[107m","\x1B[49m")}};fi.exports=Za();fi.exports.createColors=Za});var _c=B((sP,po)=>{po.exports.Space_Separator=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/;po.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]/;po.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 Mi=B((aP,$c)=>{var Li=_c();$c.exports={isSpaceSeparator(e){return typeof e=="string"&&Li.Space_Separator.test(e)},isIdStartChar(e){return typeof e=="string"&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="$"||e==="_"||Li.ID_Start.test(e))},isIdContinueChar(e){return typeof e=="string"&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||e==="$"||e==="_"||e==="\u200C"||e==="\u200D"||Li.ID_Continue.test(e))},isDigit(e){return typeof e=="string"&&/[0-9]/.test(e)},isHexDigit(e){return typeof e=="string"&&/[0-9A-Fa-f]/.test(e)}}});var jc=B((uP,Mc)=>{var ye=Mi(),Ui,Ie,Bt,mo,Wt,pt,xe,Ki,Dn;Mc.exports=function(t,r){Ui=String(t),Ie="start",Bt=[],mo=0,Wt=1,pt=0,xe=void 0,Ki=void 0,Dn=void 0;do xe=ED(),AD[Ie]();while(xe.type!=="eof");return typeof r=="function"?Hi({"":Dn},"",r):Dn};function Hi(e,t,r){let n=e[t];if(n!=null&&typeof n=="object")if(Array.isArray(n))for(let i=0;i<n.length;i++){let s=String(i),o=Hi(n,s,r);o===void 0?delete n[s]:Object.defineProperty(n,s,{value:o,writable:!0,enumerable:!0,configurable:!0})}else for(let i in n){let s=Hi(n,i,r);s===void 0?delete n[i]:Object.defineProperty(n,i,{value:s,writable:!0,enumerable:!0,configurable:!0})}return r.call(e,t,n)}var U,M,hn,kt,K;function ED(){for(U="default",M="",hn=!1,kt=1;;){K=_t();let e=Oc[U]();if(e)return e}}function _t(){if(Ui[mo])return String.fromCodePoint(Ui.codePointAt(mo))}function w(){let e=_t();return e===`
|
|
3
|
-
`?(
|
|
4
|
-
`:case"\r":case"\u2028":case"\u2029":w();return;case"/":w(),U="comment";return;case void 0:return w(),
|
|
5
|
-
`:case"\r":case"\u2028":case"\u2029":w(),U="default";return;case void 0:return w(),
|
|
6
|
-
`:case"\r":throw
|
|
7
|
-
`;case"r":return w(),"\r";case"t":return w()," ";case"v":return w(),"\v";case"0":if(w(),
|
|
8
|
-
`:case"\u2028":case"\u2029":return w(),"";case"\r":return w(),
|
|
9
|
-
`&&w(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":throw
|
|
10
|
-
`+s;P=
|
|
2
|
+
var Jd=Object.create;var Uo=Object.defineProperty;var Yd=Object.getOwnPropertyDescriptor;var Qd=Object.getOwnPropertyNames;var Xd=Object.getPrototypeOf,Zd=Object.prototype.hasOwnProperty;var ef=(e,t,r)=>t in e?Uo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var se=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var _=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var tf=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Qd(t))!Zd.call(e,i)&&i!==r&&Uo(e,i,{get:()=>t[i],enumerable:!(n=Yd(t,i))||n.enumerable});return e};var we=(e,t,r)=>(r=e!=null?Jd(Xd(e)):{},tf(t||!e||!e.__esModule?Uo(r,"default",{value:e,enumerable:!0}):r,e));var ve=(e,t,r)=>ef(e,typeof t!="symbol"?t+"":t,r);var aa=_((L0,sa)=>{"use strict";sa.exports=function(){if(process.env.npm_config_user_agent)return nf(process.env.npm_config_user_agent)};function nf(e){let t=e.split(" ")[0],r=t.lastIndexOf("/"),n=t.substring(0,r);return{name:n==="npminstall"?"cnpm":n,version:t.substring(r+1)}}});var Kn=_((Lb,$a)=>{"use strict";var Yo="\x1B",le=`${Yo}[`,vf="\x07",Qo={to(e,t){return t?`${le}${t+1};${e+1}H`:`${le}${e+1}G`},move(e,t){let r="";return e<0?r+=`${le}${-e}D`:e>0&&(r+=`${le}${e}C`),t<0?r+=`${le}${-t}A`:t>0&&(r+=`${le}${t}B`),r},up:(e=1)=>`${le}${e}A`,down:(e=1)=>`${le}${e}B`,forward:(e=1)=>`${le}${e}C`,backward:(e=1)=>`${le}${e}D`,nextLine:(e=1)=>`${le}E`.repeat(e),prevLine:(e=1)=>`${le}F`.repeat(e),left:`${le}G`,hide:`${le}?25l`,show:`${le}?25h`,save:`${Yo}7`,restore:`${Yo}8`},Sf={up:(e=1)=>`${le}S`.repeat(e),down:(e=1)=>`${le}T`.repeat(e)},Ff={screen:`${le}2J`,up:(e=1)=>`${le}1J`.repeat(e),down:(e=1)=>`${le}J`.repeat(e),line:`${le}2K`,lineEnd:`${le}K`,lineStart:`${le}1K`,lines(e){let t="";for(let r=0;r<e;r++)t+=this.line+(r<e-1?Qo.up():"");return e&&(t+=Qo.left),t}};$a.exports={cursor:Qo,scroll:Sf,erase:Ff,beep:vf}});var nr=_((Mb,Xo)=>{var Wn=process||{},_a=Wn.argv||[],Gn=Wn.env||{},Af=!(Gn.NO_COLOR||_a.includes("--no-color"))&&(!!Gn.FORCE_COLOR||_a.includes("--color")||Wn.platform==="win32"||(Wn.stdout||{}).isTTY&&Gn.TERM!=="dumb"||!!Gn.CI),Pf=(e,t,r=e)=>n=>{let i=""+n,s=i.indexOf(t,e.length);return~s?e+Tf(i,t,r,s)+t:e+i+t},Tf=(e,t,r,n)=>{let i="",s=0;do i+=e.substring(s,n)+r,s=n+t.length,n=e.indexOf(t,s);while(~n);return i+e.substring(s)},Na=(e=Af)=>{let t=e?Pf:()=>String;return{isColorSupported:e,reset:t("\x1B[0m","\x1B[0m"),bold:t("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:t("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:t("\x1B[3m","\x1B[23m"),underline:t("\x1B[4m","\x1B[24m"),inverse:t("\x1B[7m","\x1B[27m"),hidden:t("\x1B[8m","\x1B[28m"),strikethrough:t("\x1B[9m","\x1B[29m"),black:t("\x1B[30m","\x1B[39m"),red:t("\x1B[31m","\x1B[39m"),green:t("\x1B[32m","\x1B[39m"),yellow:t("\x1B[33m","\x1B[39m"),blue:t("\x1B[34m","\x1B[39m"),magenta:t("\x1B[35m","\x1B[39m"),cyan:t("\x1B[36m","\x1B[39m"),white:t("\x1B[37m","\x1B[39m"),gray:t("\x1B[90m","\x1B[39m"),bgBlack:t("\x1B[40m","\x1B[49m"),bgRed:t("\x1B[41m","\x1B[49m"),bgGreen:t("\x1B[42m","\x1B[49m"),bgYellow:t("\x1B[43m","\x1B[49m"),bgBlue:t("\x1B[44m","\x1B[49m"),bgMagenta:t("\x1B[45m","\x1B[49m"),bgCyan:t("\x1B[46m","\x1B[49m"),bgWhite:t("\x1B[47m","\x1B[49m"),blackBright:t("\x1B[90m","\x1B[39m"),redBright:t("\x1B[91m","\x1B[39m"),greenBright:t("\x1B[92m","\x1B[39m"),yellowBright:t("\x1B[93m","\x1B[39m"),blueBright:t("\x1B[94m","\x1B[39m"),magentaBright:t("\x1B[95m","\x1B[39m"),cyanBright:t("\x1B[96m","\x1B[39m"),whiteBright:t("\x1B[97m","\x1B[39m"),bgBlackBright:t("\x1B[100m","\x1B[49m"),bgRedBright:t("\x1B[101m","\x1B[49m"),bgGreenBright:t("\x1B[102m","\x1B[49m"),bgYellowBright:t("\x1B[103m","\x1B[49m"),bgBlueBright:t("\x1B[104m","\x1B[49m"),bgMagentaBright:t("\x1B[105m","\x1B[49m"),bgCyanBright:t("\x1B[106m","\x1B[49m"),bgWhiteBright:t("\x1B[107m","\x1B[49m")}};Xo.exports=Na();Xo.exports.createColors=Na});var Dc=_((_F,oo)=>{oo.exports.Space_Separator=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/;oo.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]/;oo.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 vi=_((NF,Cc)=>{var Ei=Dc();Cc.exports={isSpaceSeparator(e){return typeof e=="string"&&Ei.Space_Separator.test(e)},isIdStartChar(e){return typeof e=="string"&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="$"||e==="_"||Ei.ID_Start.test(e))},isIdContinueChar(e){return typeof e=="string"&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e>="0"&&e<="9"||e==="$"||e==="_"||e==="\u200C"||e==="\u200D"||Ei.ID_Continue.test(e))},isDigit(e){return typeof e=="string"&&/[0-9]/.test(e)},isHexDigit(e){return typeof e=="string"&&/[0-9A-Fa-f]/.test(e)}}});var Ec=_((OF,wc)=>{var Ce=vi(),Fi,ke,Lt,so,qt,mt,ye,Ti,fn;wc.exports=function(t,r){Fi=String(t),ke="start",Lt=[],so=0,qt=1,mt=0,ye=void 0,Ti=void 0,fn=void 0;do ye=Ph(),Ih[ke]();while(ye.type!=="eof");return typeof r=="function"?Ai({"":fn},"",r):fn};function Ai(e,t,r){let n=e[t];if(n!=null&&typeof n=="object")if(Array.isArray(n))for(let i=0;i<n.length;i++){let s=String(i),o=Ai(n,s,r);o===void 0?delete n[s]:Object.defineProperty(n,s,{value:o,writable:!0,enumerable:!0,configurable:!0})}else for(let i in n){let s=Ai(n,i,r);s===void 0?delete n[i]:Object.defineProperty(n,i,{value:s,writable:!0,enumerable:!0,configurable:!0})}return r.call(e,t,n)}var U,M,dn,Ot,K;function Ph(){for(U="default",M="",dn=!1,Ot=1;;){K=Mt();let e=xc[U]();if(e)return e}}function Mt(){if(Fi[so])return String.fromCodePoint(Fi.codePointAt(so))}function w(){let e=Mt();return e===`
|
|
3
|
+
`?(qt++,mt=0):e?mt+=e.length:mt++,e&&(so+=e.length),e}var xc={default(){switch(K){case" ":case"\v":case"\f":case" ":case"\xA0":case"\uFEFF":case`
|
|
4
|
+
`:case"\r":case"\u2028":case"\u2029":w();return;case"/":w(),U="comment";return;case void 0:return w(),ne("eof")}if(Ce.isSpaceSeparator(K)){w();return}return xc[ke]()},comment(){switch(K){case"*":w(),U="multiLineComment";return;case"/":w(),U="singleLineComment";return}throw oe(w())},multiLineComment(){switch(K){case"*":w(),U="multiLineCommentAsterisk";return;case void 0:throw oe(w())}w()},multiLineCommentAsterisk(){switch(K){case"*":w();return;case"/":w(),U="default";return;case void 0:throw oe(w())}w(),U="multiLineComment"},singleLineComment(){switch(K){case`
|
|
5
|
+
`:case"\r":case"\u2028":case"\u2029":w(),U="default";return;case void 0:return w(),ne("eof")}w()},value(){switch(K){case"{":case"[":return ne("punctuator",w());case"n":return w(),ur("ull"),ne("null",null);case"t":return w(),ur("rue"),ne("boolean",!0);case"f":return w(),ur("alse"),ne("boolean",!1);case"-":case"+":w()==="-"&&(Ot=-1),U="sign";return;case".":M=w(),U="decimalPointLeading";return;case"0":M=w(),U="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":M=w(),U="decimalInteger";return;case"I":return w(),ur("nfinity"),ne("numeric",1/0);case"N":return w(),ur("aN"),ne("numeric",NaN);case'"':case"'":dn=w()==='"',M="",U="string";return}throw oe(w())},identifierNameStartEscape(){if(K!=="u")throw oe(w());w();let e=Pi();switch(e){case"$":case"_":break;default:if(!Ce.isIdStartChar(e))throw yc();break}M+=e,U="identifierName"},identifierName(){switch(K){case"$":case"_":case"\u200C":case"\u200D":M+=w();return;case"\\":w(),U="identifierNameEscape";return}if(Ce.isIdContinueChar(K)){M+=w();return}return ne("identifier",M)},identifierNameEscape(){if(K!=="u")throw oe(w());w();let e=Pi();switch(e){case"$":case"_":case"\u200C":case"\u200D":break;default:if(!Ce.isIdContinueChar(e))throw yc();break}M+=e,U="identifierName"},sign(){switch(K){case".":M=w(),U="decimalPointLeading";return;case"0":M=w(),U="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":M=w(),U="decimalInteger";return;case"I":return w(),ur("nfinity"),ne("numeric",Ot*(1/0));case"N":return w(),ur("aN"),ne("numeric",NaN)}throw oe(w())},zero(){switch(K){case".":M+=w(),U="decimalPoint";return;case"e":case"E":M+=w(),U="decimalExponent";return;case"x":case"X":M+=w(),U="hexadecimal";return}return ne("numeric",Ot*0)},decimalInteger(){switch(K){case".":M+=w(),U="decimalPoint";return;case"e":case"E":M+=w(),U="decimalExponent";return}if(Ce.isDigit(K)){M+=w();return}return ne("numeric",Ot*Number(M))},decimalPointLeading(){if(Ce.isDigit(K)){M+=w(),U="decimalFraction";return}throw oe(w())},decimalPoint(){switch(K){case"e":case"E":M+=w(),U="decimalExponent";return}if(Ce.isDigit(K)){M+=w(),U="decimalFraction";return}return ne("numeric",Ot*Number(M))},decimalFraction(){switch(K){case"e":case"E":M+=w(),U="decimalExponent";return}if(Ce.isDigit(K)){M+=w();return}return ne("numeric",Ot*Number(M))},decimalExponent(){switch(K){case"+":case"-":M+=w(),U="decimalExponentSign";return}if(Ce.isDigit(K)){M+=w(),U="decimalExponentInteger";return}throw oe(w())},decimalExponentSign(){if(Ce.isDigit(K)){M+=w(),U="decimalExponentInteger";return}throw oe(w())},decimalExponentInteger(){if(Ce.isDigit(K)){M+=w();return}return ne("numeric",Ot*Number(M))},hexadecimal(){if(Ce.isHexDigit(K)){M+=w(),U="hexadecimalInteger";return}throw oe(w())},hexadecimalInteger(){if(Ce.isHexDigit(K)){M+=w();return}return ne("numeric",Ot*Number(M))},string(){switch(K){case"\\":w(),M+=Th();return;case'"':if(dn)return w(),ne("string",M);M+=w();return;case"'":if(!dn)return w(),ne("string",M);M+=w();return;case`
|
|
6
|
+
`:case"\r":throw oe(w());case"\u2028":case"\u2029":kh(K);break;case void 0:throw oe(w())}M+=w()},start(){switch(K){case"{":case"[":return ne("punctuator",w())}U="value"},beforePropertyName(){switch(K){case"$":case"_":M=w(),U="identifierName";return;case"\\":w(),U="identifierNameStartEscape";return;case"}":return ne("punctuator",w());case'"':case"'":dn=w()==='"',U="string";return}if(Ce.isIdStartChar(K)){M+=w(),U="identifierName";return}throw oe(w())},afterPropertyName(){if(K===":")return ne("punctuator",w());throw oe(w())},beforePropertyValue(){U="value"},afterPropertyValue(){switch(K){case",":case"}":return ne("punctuator",w())}throw oe(w())},beforeArrayValue(){if(K==="]")return ne("punctuator",w());U="value"},afterArrayValue(){switch(K){case",":case"]":return ne("punctuator",w())}throw oe(w())},end(){throw oe(w())}};function ne(e,t){return{type:e,value:t,line:qt,column:mt}}function ur(e){for(let t of e){if(Mt()!==t)throw oe(w());w()}}function Th(){switch(Mt()){case"b":return w(),"\b";case"f":return w(),"\f";case"n":return w(),`
|
|
7
|
+
`;case"r":return w(),"\r";case"t":return w()," ";case"v":return w(),"\v";case"0":if(w(),Ce.isDigit(Mt()))throw oe(w());return"\0";case"x":return w(),Rh();case"u":return w(),Pi();case`
|
|
8
|
+
`:case"\u2028":case"\u2029":return w(),"";case"\r":return w(),Mt()===`
|
|
9
|
+
`&&w(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":throw oe(w());case void 0:throw oe(w())}return w()}function Rh(){let e="",t=Mt();if(!Ce.isHexDigit(t)||(e+=w(),t=Mt(),!Ce.isHexDigit(t)))throw oe(w());return e+=w(),String.fromCodePoint(parseInt(e,16))}function Pi(){let e="",t=4;for(;t-- >0;){let r=Mt();if(!Ce.isHexDigit(r))throw oe(w());e+=w()}return String.fromCodePoint(parseInt(e,16))}var Ih={start(){if(ye.type==="eof")throw cr();Si()},beforePropertyName(){switch(ye.type){case"identifier":case"string":Ti=ye.value,ke="afterPropertyName";return;case"punctuator":io();return;case"eof":throw cr()}},afterPropertyName(){if(ye.type==="eof")throw cr();ke="beforePropertyValue"},beforePropertyValue(){if(ye.type==="eof")throw cr();Si()},beforeArrayValue(){if(ye.type==="eof")throw cr();if(ye.type==="punctuator"&&ye.value==="]"){io();return}Si()},afterPropertyValue(){if(ye.type==="eof")throw cr();switch(ye.value){case",":ke="beforePropertyName";return;case"}":io()}},afterArrayValue(){if(ye.type==="eof")throw cr();switch(ye.value){case",":ke="beforeArrayValue";return;case"]":io()}},end(){}};function Si(){let e;switch(ye.type){case"punctuator":switch(ye.value){case"{":e={};break;case"[":e=[];break}break;case"null":case"boolean":case"numeric":case"string":e=ye.value;break}if(fn===void 0)fn=e;else{let t=Lt[Lt.length-1];Array.isArray(t)?t.push(e):Object.defineProperty(t,Ti,{value:e,writable:!0,enumerable:!0,configurable:!0})}if(e!==null&&typeof e=="object")Lt.push(e),Array.isArray(e)?ke="beforeArrayValue":ke="beforePropertyName";else{let t=Lt[Lt.length-1];t==null?ke="end":Array.isArray(t)?ke="afterArrayValue":ke="afterPropertyValue"}}function io(){Lt.pop();let e=Lt[Lt.length-1];e==null?ke="end":Array.isArray(e)?ke="afterArrayValue":ke="afterPropertyValue"}function oe(e){return ao(e===void 0?`JSON5: invalid end of input at ${qt}:${mt}`:`JSON5: invalid character '${bc(e)}' at ${qt}:${mt}`)}function cr(){return ao(`JSON5: invalid end of input at ${qt}:${mt}`)}function yc(){return mt-=5,ao(`JSON5: invalid identifier character at ${qt}:${mt}`)}function kh(e){console.warn(`JSON5: '${bc(e)}' in strings is not valid ECMAScript; consider escaping`)}function bc(e){let t={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"};if(t[e])return t[e];if(e<" "){let r=e.charCodeAt(0).toString(16);return"\\x"+("00"+r).substring(r.length)}return e}function ao(e){let t=new SyntaxError(e);return t.lineNumber=qt,t.columnNumber=mt,t}});var Sc=_((LF,vc)=>{var Ri=vi();vc.exports=function(t,r,n){let i=[],s="",o,a,u="",c;if(r!=null&&typeof r=="object"&&!Array.isArray(r)&&(n=r.space,c=r.quote,r=r.replacer),typeof r=="function")a=r;else if(Array.isArray(r)){o=[];for(let f of r){let g;typeof f=="string"?g=f:(typeof f=="number"||f instanceof String||f instanceof Number)&&(g=String(f)),g!==void 0&&o.indexOf(g)<0&&o.push(g)}}return n instanceof Number?n=Number(n):n instanceof String&&(n=String(n)),typeof n=="number"?n>0&&(n=Math.min(10,Math.floor(n)),u=" ".substr(0,n)):typeof n=="string"&&(u=n.substr(0,10)),l("",{"":t});function l(f,g){let h=g[f];switch(h!=null&&(typeof h.toJSON5=="function"?h=h.toJSON5(f):typeof h.toJSON=="function"&&(h=h.toJSON(f))),a&&(h=a.call(g,f,h)),h instanceof Number?h=Number(h):h instanceof String?h=String(h):h instanceof Boolean&&(h=h.valueOf()),h){case null:return"null";case!0:return"true";case!1:return"false"}if(typeof h=="string")return p(h,!1);if(typeof h=="number")return String(h);if(typeof h=="object")return Array.isArray(h)?m(h):d(h)}function p(f){let g={"'":.1,'"':.2},h={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"},E="";for(let P=0;P<f.length;P++){let A=f[P];switch(A){case"'":case'"':g[A]++,E+=A;continue;case"\0":if(Ri.isDigit(f[P+1])){E+="\\x00";continue}}if(h[A]){E+=h[A];continue}if(A<" "){let F=A.charCodeAt(0).toString(16);E+="\\x"+("00"+F).substring(F.length);continue}E+=A}let v=c||Object.keys(g).reduce((P,A)=>g[P]<g[A]?P:A);return E=E.replace(new RegExp(v,"g"),h[v]),v+E+v}function d(f){if(i.indexOf(f)>=0)throw TypeError("Converting circular structure to JSON5");i.push(f);let g=s;s=s+u;let h=o||Object.keys(f),E=[];for(let P of h){let A=l(P,f);if(A!==void 0){let F=D(P)+":";u!==""&&(F+=" "),F+=A,E.push(F)}}let v;if(E.length===0)v="{}";else{let P;if(u==="")P=E.join(","),v="{"+P+"}";else{let A=`,
|
|
10
|
+
`+s;P=E.join(A),v=`{
|
|
11
11
|
`+s+P+`,
|
|
12
|
-
`+
|
|
13
|
-
`+s,P=
|
|
12
|
+
`+g+"}"}}return i.pop(),s=g,v}function D(f){if(f.length===0)return p(f,!0);let g=String.fromCodePoint(f.codePointAt(0));if(!Ri.isIdStartChar(g))return p(f,!0);for(let h=g.length;h<f.length;h++)if(!Ri.isIdContinueChar(String.fromCodePoint(f.codePointAt(h))))return p(f,!0);return f}function m(f){if(i.indexOf(f)>=0)throw TypeError("Converting circular structure to JSON5");i.push(f);let g=s;s=s+u;let h=[];for(let v=0;v<f.length;v++){let P=l(String(v),f);h.push(P!==void 0?P:"null")}let E;if(h.length===0)E="[]";else if(u==="")E="["+h.join(",")+"]";else{let v=`,
|
|
13
|
+
`+s,P=h.join(v);E=`[
|
|
14
14
|
`+s+P+`,
|
|
15
|
-
`+h+"]"}return i.pop(),s=h,v}}});var Kc=B((lP,Vc)=>{var TD=jc(),RD=Hc(),ID={parse:TD,stringify:RD};Vc.exports=ID});var Ji=B(zt=>{"use strict";Object.defineProperty(zt,"__esModule",{value:!0});zt.throwUnsupportedData=zt.throwUnknownDataType=zt.getType=void 0;function sl(e){return Object.prototype.toString.call(e)}zt.getType=sl;function nC(e){throw new TypeError("unsupported data type: "+sl(e))}zt.throwUnknownDataType=nC;function oC(e){throw new TypeError("unsupported data type: "+e)}zt.throwUnsupportedData=oC});var es=B(Ee=>{"use strict";Object.defineProperty(Ee,"__esModule",{value:!0});Ee.s_to_num=Ee.int_str_to_s=Ee.num_to_s=Ee.big_int_to_s=Ee.int_to_s=Ee.s_to_big_int=Ee.s_to_int=void 0;var $t="";for(let e=0;e<10;e++){let t=String.fromCharCode(48+e);$t+=t}for(let e=0;e<26;e++){let t=String.fromCharCode(65+e);$t+=t}for(let e=0;e<26;e++){let t=String.fromCharCode(97+e);$t+=t}var $r=$t.length,Qi={};for(let e=0;e<$r;e++){let t=$t[e];Qi[t]=e}function Xi(e){let t=0,r=1;for(let n=e.length-1;n>=0;n--){let i=e[n],s=Qi[i];s*=r,t+=s,r*=$r}return t}Ee.s_to_int=Xi;function al(e){let t=BigInt(0),r=BigInt(1),n=BigInt($r);for(let i=e.length-1;i>=0;i--){let s=e[i],o=BigInt(Qi[s]);o*=r,t+=o,r*=n}return t}Ee.s_to_big_int=al;function Zi(e){if(e===0)return $t[0];let t=[];for(;e!==0;){let r=e%$r,n=$t[r];t.push(n),e-=r,e/=$r}return t.reverse().join("")}Ee.int_to_s=Zi;function ul(e){let t=BigInt(0),r=BigInt($r);if(e===t)return $t[0];let n=[];for(;e!==t;){let i=e%r,s=$t[Number(i)];n.push(s),e/=r}return n.reverse().join("")}Ee.big_int_to_s=ul;function cl(e){return e.split("").reverse().join("")}function ll(e){if(e<0)return"-"+ll(-e);let[t,r]=e.toString().split(".");if(!r)if(t.includes("e")){let[s,o]=t.split("e");t=s,r="0e"+o}else return Zi(e);let n;r&&([r,n]=r.split("e")),t=Do(t),r=cl(r),r=Do(r);let i=t+"."+r;if(n){switch(i+=".",n[0]){case"+":n=n.slice(1);break;case"-":i+="-",n=n.slice(1);break}n=Do(n),i+=n}return i}Ee.num_to_s=ll;function Do(e){let t=+e;return t.toString()===e&&t+1!==t&&t-1!==t?Zi(t):":"+ul(BigInt(e))}Ee.int_str_to_s=Do;function Yi(e){return e[0]===":"?al(e.substring(1)).toString():Xi(e).toString()}function pl(e){if(e[0]==="-")return-pl(e.substr(1));let[t,r,n]=e.split(".");if(!r)return Xi(t);t=Yi(t),r=Yi(r),r=cl(r);let i=t+"."+r;if(n){i+="e";let s=!1;n[0]==="-"&&(s=!0,n=n.slice(1)),n=Yi(n),i+=s?-n:+n}return+i}Ee.s_to_num=pl});var rs=B(Se=>{"use strict";Object.defineProperty(Se,"__esModule",{value:!0});Se.decodeStr=Se.encodeStr=Se.decodeBool=Se.encodeBool=Se.decodeKey=Se.decodeNum=Se.encodeNum=void 0;var ts=es();function iC(e){return"n|"+(0,ts.num_to_s)(e)}Se.encodeNum=iC;function sC(e){return e=e.replace("n|",""),(0,ts.s_to_num)(e)}Se.decodeNum=sC;function aC(e){return typeof e=="number"?e:(0,ts.s_to_int)(e)}Se.decodeKey=aC;function uC(e){return e?"b|T":"b|F"}Se.encodeBool=uC;function cC(e){switch(e){case"b|T":return!0;case"b|F":return!1}return!!e}Se.decodeBool=cC;function lC(e){switch(e[0]+e[1]){case"b|":case"o|":case"n|":case"a|":case"s|":e="s|"+e}return e}Se.encodeStr=lC;function pC(e){return e[0]+e[1]==="s|"?e.substr(2):e}Se.decodeStr=pC});var ns=B(Co=>{"use strict";Object.defineProperty(Co,"__esModule",{value:!0});Co.config=void 0;Co.config={sort_key:!1,error_on_nan:!1,error_on_infinite:!1}});var as=B(tt=>{"use strict";Object.defineProperty(tt,"__esModule",{value:!0});tt.addValue=tt.makeInMemoryMemory=tt.makeInMemoryCache=tt.makeInMemoryStore=tt.memToValues=void 0;var ss=ns(),os=Ji(),is=rs(),dC=es();function fC(e){return e.store.toArray()}tt.memToValues=fC;function dl(){let e=[];return{forEach(t){for(let r=0;r<e.length;r++)if(t(e[r])==="break")return},add(t){e.push(t)},toArray(){return e}}}tt.makeInMemoryStore=dl;function fl(){let e=Object.create(null),t=Object.create(null);return{getValue(r){return e[r]},getSchema(r){return t[r]},forEachValue(r){for(let[n,i]of Object.entries(e))if(r(n,i)==="break")return},forEachSchema(r){for(let[n,i]of Object.entries(t))if(r(n,i)==="break")return},setValue(r,n){e[r]=n},setSchema(r,n){t[r]=n},hasValue(r){return r in e},hasSchema(r){return r in t}}}tt.makeInMemoryCache=fl;function mC(){return{store:dl(),cache:fl(),keyCount:0}}tt.makeInMemoryMemory=mC;function cr(e,t){if(e.cache.hasValue(t))return e.cache.getValue(t);let r=e.keyCount++,n=(0,dC.num_to_s)(r);return e.store.add(t),e.cache.setValue(t,n),n}function gC(e,t){ss.config.sort_key&&t.sort();let r=t.join(",");if(e.cache.hasSchema(r))return e.cache.getSchema(r);let n=yn(e,t,void 0);return e.cache.setSchema(r,n),n}function yn(e,t,r){if(t===null)return"";switch(typeof t){case"undefined":if(Array.isArray(r))return yn(e,null,r);break;case"object":if(t===null)return cr(e,null);if(Array.isArray(t)){let n="a";for(let i=0;i<t.length;i++){let s=t[i],o=s===null?"_":yn(e,s,t);n+="|"+o}return n==="a"&&(n="a|"),cr(e,n)}else{let n=Object.keys(t);if(n.length===0)return cr(e,"o|");let i="o",s=gC(e,n);i+="|"+s;for(let o of n){let a=t[o],u=yn(e,a,t);i+="|"+u}return cr(e,i)}case"boolean":return cr(e,(0,is.encodeBool)(t));case"number":return Number.isNaN(t)?(ss.config.error_on_nan&&(0,os.throwUnsupportedData)("[number NaN]"),""):Number.POSITIVE_INFINITY===t||Number.NEGATIVE_INFINITY===t?(ss.config.error_on_infinite&&(0,os.throwUnsupportedData)("[number Infinity]"),""):cr(e,(0,is.encodeNum)(t));case"string":return cr(e,(0,is.encodeStr)(t))}return(0,os.throwUnknownDataType)(t)}tt.addValue=yn});var cs=B(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.decompress=qt.decode=qt.compress=void 0;var hC=Ji(),yo=rs(),us=as();function DC(e){let t=(0,us.makeInMemoryMemory)(),r=(0,us.addValue)(t,e,void 0);return[(0,us.memToValues)(t),r]}qt.compress=DC;function CC(e,t){if(t==="o|")return{};let r={},n=t.split("|"),i=n[1],s=xn(e,i),o=n.length;o-2===1&&!Array.isArray(s)&&(s=[s]);for(let a=2;a<o;a++){let u=s[a-2],c=n[a];c=xn(e,c),r[u]=c}return r}function yC(e,t){if(t==="a|")return[];let r=t.split("|"),n=r.length-1,i=new Array(n);for(let s=0;s<n;s++){let o=r[s+1];o=xn(e,o),i[s]=o}return i}function xn(e,t){if(t===""||t==="_")return null;let r=(0,yo.decodeKey)(t),n=e[r];if(n===null)return n;switch(typeof n){case"undefined":return n;case"number":return n;case"string":switch(n[0]+n[1]){case"b|":return(0,yo.decodeBool)(n);case"o|":return CC(e,n);case"n|":return(0,yo.decodeNum)(n);case"a|":return yC(e,n);default:return(0,yo.decodeStr)(n)}}return(0,hC.throwUnknownDataType)(n)}qt.decode=xn;function xC(e){let[t,r]=e;return xn(t,r)}qt.decompress=xC});var gl=B(Nr=>{"use strict";Object.defineProperty(Nr,"__esModule",{value:!0});Nr.trimUndefinedRecursively=Nr.trimUndefined=void 0;function bC(e){for(let t in e)e[t]===void 0&&delete e[t]}Nr.trimUndefined=bC;function wC(e){ml(e,new Set)}Nr.trimUndefinedRecursively=wC;function ml(e,t){t.add(e);for(let r in e)if(e[r]===void 0)delete e[r];else{let n=e[r];n&&typeof n=="object"&&!t.has(n)&&ml(n,t)}}});var Cl=B(Fe=>{"use strict";Object.defineProperty(Fe,"__esModule",{value:!0});Fe.config=Fe.trimUndefinedRecursively=Fe.trimUndefined=Fe.addValue=Fe.decode=Fe.decompress=Fe.compress=void 0;var hl=cs();Object.defineProperty(Fe,"compress",{enumerable:!0,get:function(){return hl.compress}});Object.defineProperty(Fe,"decompress",{enumerable:!0,get:function(){return hl.decompress}});var vC=cs();Object.defineProperty(Fe,"decode",{enumerable:!0,get:function(){return vC.decode}});var EC=as();Object.defineProperty(Fe,"addValue",{enumerable:!0,get:function(){return EC.addValue}});var Dl=gl();Object.defineProperty(Fe,"trimUndefined",{enumerable:!0,get:function(){return Dl.trimUndefined}});Object.defineProperty(Fe,"trimUndefinedRecursively",{enumerable:!0,get:function(){return Dl.trimUndefinedRecursively}});var SC=ns();Object.defineProperty(Fe,"config",{enumerable:!0,get:function(){return SC.config}})});var Ll=B((kI,vs)=>{"use strict";var QC=Object.prototype.hasOwnProperty,ke="~";function An(){}Object.create&&(An.prototype=Object.create(null),new An().__proto__||(ke=!1));function XC(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function Ol(e,t,r,n,i){if(typeof r!="function")throw new TypeError("The listener must be a function");var s=new XC(r,n||e,i),o=ke?ke+t:t;return e._events[o]?e._events[o].fn?e._events[o]=[e._events[o],s]:e._events[o].push(s):(e._events[o]=s,e._eventsCount++),e}function Po(e,t){--e._eventsCount===0?e._events=new An:delete e._events[t]}function Ae(){this._events=new An,this._eventsCount=0}Ae.prototype.eventNames=function(){var t=[],r,n;if(this._eventsCount===0)return t;for(n in r=this._events)QC.call(r,n)&&t.push(ke?n.slice(1):n);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(r)):t};Ae.prototype.listeners=function(t){var r=ke?ke+t:t,n=this._events[r];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,s=n.length,o=new Array(s);i<s;i++)o[i]=n[i].fn;return o};Ae.prototype.listenerCount=function(t){var r=ke?ke+t:t,n=this._events[r];return n?n.fn?1:n.length:0};Ae.prototype.emit=function(t,r,n,i,s,o){var a=ke?ke+t:t;if(!this._events[a])return!1;var u=this._events[a],c=arguments.length,l,p;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),c){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,r),!0;case 3:return u.fn.call(u.context,r,n),!0;case 4:return u.fn.call(u.context,r,n,i),!0;case 5:return u.fn.call(u.context,r,n,i,s),!0;case 6:return u.fn.call(u.context,r,n,i,s,o),!0}for(p=1,l=new Array(c-1);p<c;p++)l[p-1]=arguments[p];u.fn.apply(u.context,l)}else{var d=u.length,g;for(p=0;p<d;p++)switch(u[p].once&&this.removeListener(t,u[p].fn,void 0,!0),c){case 1:u[p].fn.call(u[p].context);break;case 2:u[p].fn.call(u[p].context,r);break;case 3:u[p].fn.call(u[p].context,r,n);break;case 4:u[p].fn.call(u[p].context,r,n,i);break;default:if(!l)for(g=1,l=new Array(c-1);g<c;g++)l[g-1]=arguments[g];u[p].fn.apply(u[p].context,l)}}return!0};Ae.prototype.on=function(t,r,n){return Ol(this,t,r,n,!1)};Ae.prototype.once=function(t,r,n){return Ol(this,t,r,n,!0)};Ae.prototype.removeListener=function(t,r,n,i){var s=ke?ke+t:t;if(!this._events[s])return this;if(!r)return Po(this,s),this;var o=this._events[s];if(o.fn)o.fn===r&&(!i||o.once)&&(!n||o.context===n)&&Po(this,s);else{for(var a=0,u=[],c=o.length;a<c;a++)(o[a].fn!==r||i&&!o[a].once||n&&o[a].context!==n)&&u.push(o[a]);u.length?this._events[s]=u.length===1?u[0]:u:Po(this,s)}return this};Ae.prototype.removeAllListeners=function(t){var r;return t?(r=ke?ke+t:t,this._events[r]&&Po(this,r)):(this._events=new An,this._eventsCount=0),this};Ae.prototype.off=Ae.prototype.removeListener;Ae.prototype.addListener=Ae.prototype.on;Ae.prefixed=ke;Ae.EventEmitter=Ae;typeof vs<"u"&&(vs.exports=Ae)});var jl=B((BI,Ml)=>{"use strict";Ml.exports=function(t,r){if(r=r.split(":")[0],t=+t,!t)return!1;switch(r){case"http":case"ws":return t!==80;case"https":case"wss":return t!==443;case"ftp":return t!==21;case"gopher":return t!==70;case"file":return!1}return t!==0}});var To=B(Hl=>{var Mt=Hl,ZC=z("url"),Ul=z("util")._extend,ey=jl(),ty=/(^|,)\s*upgrade\s*($|,)/i,Es=/^https|wss/;Mt.isSSL=Es;Mt.setupOutgoing=function(e,t,r,n){e.port=t[n||"target"].port||(Es.test(t[n||"target"].protocol)?443:80),["host","hostname","socketPath","pfx","key","passphrase","cert","ca","ciphers","secureProtocol"].forEach(function(a){e[a]=t[n||"target"][a]}),e.method=t.method||r.method,e.headers=Ul({},r.headers),t.headers&&Ul(e.headers,t.headers),t.auth&&(e.auth=t.auth),t.ca&&(e.ca=t.ca),Es.test(t[n||"target"].protocol)&&(e.rejectUnauthorized=typeof t.secure>"u"?!0:t.secure),e.agent=t.agent||!1,e.localAddress=t.localAddress,e.agent||(e.headers=e.headers||{},(typeof e.headers.connection!="string"||!ty.test(e.headers.connection))&&(e.headers.connection="close"));var i=t[n||"target"],s=i&&t.prependPath!==!1&&i.path||"",o=t.toProxy?r.url:ZC.parse(r.url).path||"";return o=t.ignorePath?"":o,e.path=Mt.urlJoin(s,o),t.changeOrigin&&(e.headers.host=ey(e.port,t[n||"target"].protocol)&&!ry(e.host)?e.host+":"+e.port:e.host),e};Mt.setupSocket=function(e){return e.setTimeout(0),e.setNoDelay(!0),e.setKeepAlive(!0,0),e};Mt.getPort=function(e){var t=e.headers.host?e.headers.host.match(/:(\d+)/):"";return t?t[1]:Mt.hasEncryptedConnection(e)?"443":"80"};Mt.hasEncryptedConnection=function(e){return!!(e.connection.encrypted||e.connection.pair)};Mt.urlJoin=function(){var e=Array.prototype.slice.call(arguments),t=e.length-1,r=e[t],n=r.split("?"),i;return e[t]=n.shift(),i=[e.filter(Boolean).join("/").replace(/\/+/g,"/").replace("http:/","http://").replace("https:/","https://")],i.push.apply(i,n),i.join("?")};Mt.rewriteCookieProperty=function e(t,r,n){return Array.isArray(t)?t.map(function(i){return e(i,r,n)}):t.replace(new RegExp("(;\\s*"+n+"=)([^;]+)","i"),function(i,s,o){var a;if(o in r)a=r[o];else if("*"in r)a=r["*"];else return i;return a?s+a:""})};function ry(e){return!!~e.indexOf(":")}});var Wl=B(($I,Gl)=>{var Vl=z("url"),Kl=To(),ny=/^201|30(1|2|7|8)$/;Gl.exports={removeChunked:function(t,r,n){t.httpVersion==="1.0"&&delete n.headers["transfer-encoding"]},setConnection:function(t,r,n){t.httpVersion==="1.0"?n.headers.connection=t.headers.connection||"close":t.httpVersion!=="2.0"&&!n.headers.connection&&(n.headers.connection=t.headers.connection||"keep-alive")},setRedirectHostRewrite:function(t,r,n,i){if((i.hostRewrite||i.autoRewrite||i.protocolRewrite)&&n.headers.location&&ny.test(n.statusCode)){var s=Vl.parse(i.target),o=Vl.parse(n.headers.location);if(s.host!=o.host)return;i.hostRewrite?o.host=i.hostRewrite:i.autoRewrite&&(o.host=t.headers.host),i.protocolRewrite&&(o.protocol=i.protocolRewrite),n.headers.location=o.format()}},writeHeaders:function(t,r,n,i){var s=i.cookieDomainRewrite,o=i.cookiePathRewrite,a=i.preserveHeaderKeyCase,u,c=function(d,g){g!=null&&(s&&d.toLowerCase()==="set-cookie"&&(g=Kl.rewriteCookieProperty(g,s,"domain")),o&&d.toLowerCase()==="set-cookie"&&(g=Kl.rewriteCookieProperty(g,o,"path")),r.setHeader(String(d).trim(),g))};if(typeof s=="string"&&(s={"*":s}),typeof o=="string"&&(o={"*":o}),a&&n.rawHeaders!=null){u={};for(var l=0;l<n.rawHeaders.length;l+=2){var p=n.rawHeaders[l];u[p.toLowerCase()]=p}}Object.keys(n.headers).forEach(function(d){var g=n.headers[d];a&&u&&(d=u[d]||d),c(d,g)})},writeStatusCode:function(t,r,n){n.statusMessage?(r.statusCode=n.statusCode,r.statusMessage=n.statusMessage):r.statusCode=n.statusCode}}});var ql=B((NI,zl)=>{var jr=1e3,Ur=jr*60,Hr=Ur*60,dr=Hr*24,oy=dr*7,iy=dr*365.25;zl.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return sy(e);if(r==="number"&&isFinite(e))return t.long?uy(e):ay(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function sy(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*iy;case"weeks":case"week":case"w":return r*oy;case"days":case"day":case"d":return r*dr;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Hr;case"minutes":case"minute":case"mins":case"min":case"m":return r*Ur;case"seconds":case"second":case"secs":case"sec":case"s":return r*jr;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function ay(e){var t=Math.abs(e);return t>=dr?Math.round(e/dr)+"d":t>=Hr?Math.round(e/Hr)+"h":t>=Ur?Math.round(e/Ur)+"m":t>=jr?Math.round(e/jr)+"s":e+"ms"}function uy(e){var t=Math.abs(e);return t>=dr?Ro(e,t,dr,"day"):t>=Hr?Ro(e,t,Hr,"hour"):t>=Ur?Ro(e,t,Ur,"minute"):t>=jr?Ro(e,t,jr,"second"):e+" ms"}function Ro(e,t,r,n){var i=t>=r*1.5;return Math.round(e/r)+" "+n+(i?"s":"")}});var Ss=B((OI,Jl)=>{function cy(e){r.debug=r,r.default=r,r.coerce=u,r.disable=o,r.enable=i,r.enabled=a,r.humanize=ql(),r.destroy=c,Object.keys(e).forEach(l=>{r[l]=e[l]}),r.names=[],r.skips=[],r.formatters={};function t(l){let p=0;for(let d=0;d<l.length;d++)p=(p<<5)-p+l.charCodeAt(d),p|=0;return r.colors[Math.abs(p)%r.colors.length]}r.selectColor=t;function r(l){let p,d=null,g,m;function f(...h){if(!f.enabled)return;let D=f,v=Number(new Date),E=v-(p||v);D.diff=E,D.prev=p,D.curr=v,p=v,h[0]=r.coerce(h[0]),typeof h[0]!="string"&&h.unshift("%O");let P=0;h[0]=h[0].replace(/%([a-zA-Z%])/g,(F,T)=>{if(F==="%%")return"%";P++;let k=r.formatters[T];if(typeof k=="function"){let I=h[P];F=k.call(D,I),h.splice(P,1),P--}return F}),r.formatArgs.call(D,h),(D.log||r.log).apply(D,h)}return f.namespace=l,f.useColors=r.useColors(),f.color=r.selectColor(l),f.extend=n,f.destroy=r.destroy,Object.defineProperty(f,"enabled",{enumerable:!0,configurable:!1,get:()=>d!==null?d:(g!==r.namespaces&&(g=r.namespaces,m=r.enabled(l)),m),set:h=>{d=h}}),typeof r.init=="function"&&r.init(f),f}function n(l,p){let d=r(this.namespace+(typeof p>"u"?":":p)+l);return d.log=this.log,d}function i(l){r.save(l),r.namespaces=l,r.names=[],r.skips=[];let p=(typeof l=="string"?l:"").trim().replace(" ",",").split(",").filter(Boolean);for(let d of p)d[0]==="-"?r.skips.push(d.slice(1)):r.names.push(d)}function s(l,p){let d=0,g=0,m=-1,f=0;for(;d<l.length;)if(g<p.length&&(p[g]===l[d]||p[g]==="*"))p[g]==="*"?(m=g,f=d,g++):(d++,g++);else if(m!==-1)g=m+1,f++,d=f;else return!1;for(;g<p.length&&p[g]==="*";)g++;return g===p.length}function o(){let l=[...r.names,...r.skips.map(p=>"-"+p)].join(",");return r.enable(""),l}function a(l){for(let p of r.skips)if(s(l,p))return!1;for(let p of r.names)if(s(l,p))return!0;return!1}function u(l){return l instanceof Error?l.stack||l.message:l}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}Jl.exports=cy});var Yl=B((ze,Io)=>{ze.formatArgs=py;ze.save=dy;ze.load=fy;ze.useColors=ly;ze.storage=my();ze.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();ze.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function ly(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function py(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+Io.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let r=0,n=0;e[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),e.splice(n,0,t)}ze.log=console.debug||console.log||(()=>{});function dy(e){try{e?ze.storage.setItem("debug",e):ze.storage.removeItem("debug")}catch{}}function fy(){let e;try{e=ze.storage.getItem("debug")}catch{}return!e&&typeof process<"u"&&"env"in process&&(e=process.env.DEBUG),e}function my(){try{return localStorage}catch{}}Io.exports=Ss()(ze);var{formatters:gy}=Io.exports;gy.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var Xl=B((LI,Ql)=>{"use strict";Ql.exports=(e,t=process.argv)=>{let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),i=t.indexOf("--");return n!==-1&&(i===-1||n<i)}});var tp=B((MI,ep)=>{"use strict";var hy=z("os"),Zl=z("tty"),nt=Xl(),{env:be}=process,Jt;nt("no-color")||nt("no-colors")||nt("color=false")||nt("color=never")?Jt=0:(nt("color")||nt("colors")||nt("color=true")||nt("color=always"))&&(Jt=1);"FORCE_COLOR"in be&&(be.FORCE_COLOR==="true"?Jt=1:be.FORCE_COLOR==="false"?Jt=0:Jt=be.FORCE_COLOR.length===0?1:Math.min(parseInt(be.FORCE_COLOR,10),3));function Fs(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function As(e,t){if(Jt===0)return 0;if(nt("color=16m")||nt("color=full")||nt("color=truecolor"))return 3;if(nt("color=256"))return 2;if(e&&!t&&Jt===void 0)return 0;let r=Jt||0;if(be.TERM==="dumb")return r;if(process.platform==="win32"){let n=hy.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in be)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in be)||be.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in be)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(be.TEAMCITY_VERSION)?1:0;if(be.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in be){let n=parseInt((be.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(be.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(be.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(be.TERM)||"COLORTERM"in be?1:r}function Dy(e){let t=As(e,e&&e.isTTY);return Fs(t)}ep.exports={supportsColor:Dy,stdout:Fs(As(!0,Zl.isatty(1))),stderr:Fs(As(!0,Zl.isatty(2)))}});var np=B((we,Bo)=>{var Cy=z("tty"),ko=z("util");we.init=Sy;we.log=wy;we.formatArgs=xy;we.save=vy;we.load=Ey;we.useColors=yy;we.destroy=ko.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");we.colors=[6,2,3,4,5,1];try{let e=tp();e&&(e.stderr||e).level>=2&&(we.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}we.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let r=t.substring(6).toLowerCase().replace(/_([a-z])/g,(i,s)=>s.toUpperCase()),n=process.env[t];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),e[r]=n,e},{});function yy(){return"colors"in we.inspectOpts?!!we.inspectOpts.colors:Cy.isatty(process.stderr.fd)}function xy(e){let{namespace:t,useColors:r}=this;if(r){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${i};1m${t} \x1B[0m`;e[0]=s+e[0].split(`
|
|
15
|
+
`+g+"]"}return i.pop(),s=g,E}}});var Ac=_((MF,Fc)=>{var Bh=Ec(),$h=Sc(),_h={parse:Bh,stringify:$h};Fc.exports=_h});var $i=_(Jt=>{"use strict";Object.defineProperty(Jt,"__esModule",{value:!0});Jt.throwUnsupportedData=Jt.throwUnknownDataType=Jt.getType=void 0;function Hc(e){return Object.prototype.toString.call(e)}Jt.getType=Hc;function aD(e){throw new TypeError("unsupported data type: "+Hc(e))}Jt.throwUnknownDataType=aD;function uD(e){throw new TypeError("unsupported data type: "+e)}Jt.throwUnsupportedData=uD});var Mi=_(Se=>{"use strict";Object.defineProperty(Se,"__esModule",{value:!0});Se.s_to_num=Se.int_str_to_s=Se.num_to_s=Se.big_int_to_s=Se.int_to_s=Se.s_to_big_int=Se.s_to_int=void 0;var jt="";for(let e=0;e<10;e++){let t=String.fromCharCode(48+e);jt+=t}for(let e=0;e<26;e++){let t=String.fromCharCode(65+e);jt+=t}for(let e=0;e<26;e++){let t=String.fromCharCode(97+e);jt+=t}var Nr=jt.length,Ni={};for(let e=0;e<Nr;e++){let t=jt[e];Ni[t]=e}function Oi(e){let t=0,r=1;for(let n=e.length-1;n>=0;n--){let i=e[n],s=Ni[i];s*=r,t+=s,r*=Nr}return t}Se.s_to_int=Oi;function Kc(e){let t=BigInt(0),r=BigInt(1),n=BigInt(Nr);for(let i=e.length-1;i>=0;i--){let s=e[i],o=BigInt(Ni[s]);o*=r,t+=o,r*=n}return t}Se.s_to_big_int=Kc;function Li(e){if(e===0)return jt[0];let t=[];for(;e!==0;){let r=e%Nr,n=jt[r];t.push(n),e-=r,e/=Nr}return t.reverse().join("")}Se.int_to_s=Li;function Gc(e){let t=BigInt(0),r=BigInt(Nr);if(e===t)return jt[0];let n=[];for(;e!==t;){let i=e%r,s=jt[Number(i)];n.push(s),e/=r}return n.reverse().join("")}Se.big_int_to_s=Gc;function Wc(e){return e.split("").reverse().join("")}function zc(e){if(e<0)return"-"+zc(-e);let[t,r]=e.toString().split(".");if(!r)if(t.includes("e")){let[s,o]=t.split("e");t=s,r="0e"+o}else return Li(e);let n;r&&([r,n]=r.split("e")),t=co(t),r=Wc(r),r=co(r);let i=t+"."+r;if(n){switch(i+=".",n[0]){case"+":n=n.slice(1);break;case"-":i+="-",n=n.slice(1);break}n=co(n),i+=n}return i}Se.num_to_s=zc;function co(e){let t=+e;return t.toString()===e&&t+1!==t&&t-1!==t?Li(t):":"+Gc(BigInt(e))}Se.int_str_to_s=co;function _i(e){return e[0]===":"?Kc(e.substring(1)).toString():Oi(e).toString()}function qc(e){if(e[0]==="-")return-qc(e.substr(1));let[t,r,n]=e.split(".");if(!r)return Oi(t);t=_i(t),r=_i(r),r=Wc(r);let i=t+"."+r;if(n){i+="e";let s=!1;n[0]==="-"&&(s=!0,n=n.slice(1)),n=_i(n),i+=s?-n:+n}return+i}Se.s_to_num=qc});var Ui=_(Fe=>{"use strict";Object.defineProperty(Fe,"__esModule",{value:!0});Fe.decodeStr=Fe.encodeStr=Fe.decodeBool=Fe.encodeBool=Fe.decodeKey=Fe.decodeNum=Fe.encodeNum=void 0;var ji=Mi();function cD(e){return"n|"+(0,ji.num_to_s)(e)}Fe.encodeNum=cD;function lD(e){return e=e.replace("n|",""),(0,ji.s_to_num)(e)}Fe.decodeNum=lD;function pD(e){return typeof e=="number"?e:(0,ji.s_to_int)(e)}Fe.decodeKey=pD;function dD(e){return e?"b|T":"b|F"}Fe.encodeBool=dD;function fD(e){switch(e){case"b|T":return!0;case"b|F":return!1}return!!e}Fe.decodeBool=fD;function mD(e){switch(e[0]+e[1]){case"b|":case"o|":case"n|":case"a|":case"s|":e="s|"+e}return e}Fe.encodeStr=mD;function gD(e){return e[0]+e[1]==="s|"?e.substr(2):e}Fe.decodeStr=gD});var Vi=_(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.config=void 0;lo.config={sort_key:!1,error_on_nan:!1,error_on_infinite:!1}});var Wi=_(nt=>{"use strict";Object.defineProperty(nt,"__esModule",{value:!0});nt.addValue=nt.makeInMemoryMemory=nt.makeInMemoryCache=nt.makeInMemoryStore=nt.memToValues=void 0;var Gi=Vi(),Hi=$i(),Ki=Ui(),hD=Mi();function DD(e){return e.store.toArray()}nt.memToValues=DD;function Jc(){let e=[];return{forEach(t){for(let r=0;r<e.length;r++)if(t(e[r])==="break")return},add(t){e.push(t)},toArray(){return e}}}nt.makeInMemoryStore=Jc;function Yc(){let e=Object.create(null),t=Object.create(null);return{getValue(r){return e[r]},getSchema(r){return t[r]},forEachValue(r){for(let[n,i]of Object.entries(e))if(r(n,i)==="break")return},forEachSchema(r){for(let[n,i]of Object.entries(t))if(r(n,i)==="break")return},setValue(r,n){e[r]=n},setSchema(r,n){t[r]=n},hasValue(r){return r in e},hasSchema(r){return r in t}}}nt.makeInMemoryCache=Yc;function CD(){return{store:Jc(),cache:Yc(),keyCount:0}}nt.makeInMemoryMemory=CD;function pr(e,t){if(e.cache.hasValue(t))return e.cache.getValue(t);let r=e.keyCount++,n=(0,hD.num_to_s)(r);return e.store.add(t),e.cache.setValue(t,n),n}function yD(e,t){Gi.config.sort_key&&t.sort();let r=t.join(",");if(e.cache.hasSchema(r))return e.cache.getSchema(r);let n=gn(e,t,void 0);return e.cache.setSchema(r,n),n}function gn(e,t,r){if(t===null)return"";switch(typeof t){case"undefined":if(Array.isArray(r))return gn(e,null,r);break;case"object":if(t===null)return pr(e,null);if(Array.isArray(t)){let n="a";for(let i=0;i<t.length;i++){let s=t[i],o=s===null?"_":gn(e,s,t);n+="|"+o}return n==="a"&&(n="a|"),pr(e,n)}else{let n=Object.keys(t);if(n.length===0)return pr(e,"o|");let i="o",s=yD(e,n);i+="|"+s;for(let o of n){let a=t[o],u=gn(e,a,t);i+="|"+u}return pr(e,i)}case"boolean":return pr(e,(0,Ki.encodeBool)(t));case"number":return Number.isNaN(t)?(Gi.config.error_on_nan&&(0,Hi.throwUnsupportedData)("[number NaN]"),""):Number.POSITIVE_INFINITY===t||Number.NEGATIVE_INFINITY===t?(Gi.config.error_on_infinite&&(0,Hi.throwUnsupportedData)("[number Infinity]"),""):pr(e,(0,Ki.encodeNum)(t));case"string":return pr(e,(0,Ki.encodeStr)(t))}return(0,Hi.throwUnknownDataType)(t)}nt.addValue=gn});var qi=_(Yt=>{"use strict";Object.defineProperty(Yt,"__esModule",{value:!0});Yt.decompress=Yt.decode=Yt.compress=void 0;var xD=$i(),po=Ui(),zi=Wi();function bD(e){let t=(0,zi.makeInMemoryMemory)(),r=(0,zi.addValue)(t,e,void 0);return[(0,zi.memToValues)(t),r]}Yt.compress=bD;function wD(e,t){if(t==="o|")return{};let r={},n=t.split("|"),i=n[1],s=hn(e,i),o=n.length;o-2===1&&!Array.isArray(s)&&(s=[s]);for(let a=2;a<o;a++){let u=s[a-2],c=n[a];c=hn(e,c),r[u]=c}return r}function ED(e,t){if(t==="a|")return[];let r=t.split("|"),n=r.length-1,i=new Array(n);for(let s=0;s<n;s++){let o=r[s+1];o=hn(e,o),i[s]=o}return i}function hn(e,t){if(t===""||t==="_")return null;let r=(0,po.decodeKey)(t),n=e[r];if(n===null)return n;switch(typeof n){case"undefined":return n;case"number":return n;case"string":switch(n[0]+n[1]){case"b|":return(0,po.decodeBool)(n);case"o|":return wD(e,n);case"n|":return(0,po.decodeNum)(n);case"a|":return ED(e,n);default:return(0,po.decodeStr)(n)}}return(0,xD.throwUnknownDataType)(n)}Yt.decode=hn;function vD(e){let[t,r]=e;return hn(t,r)}Yt.decompress=vD});var Xc=_(Or=>{"use strict";Object.defineProperty(Or,"__esModule",{value:!0});Or.trimUndefinedRecursively=Or.trimUndefined=void 0;function SD(e){for(let t in e)e[t]===void 0&&delete e[t]}Or.trimUndefined=SD;function FD(e){Qc(e,new Set)}Or.trimUndefinedRecursively=FD;function Qc(e,t){t.add(e);for(let r in e)if(e[r]===void 0)delete e[r];else{let n=e[r];n&&typeof n=="object"&&!t.has(n)&&Qc(n,t)}}});var tl=_(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.config=Ae.trimUndefinedRecursively=Ae.trimUndefined=Ae.addValue=Ae.decode=Ae.decompress=Ae.compress=void 0;var Zc=qi();Object.defineProperty(Ae,"compress",{enumerable:!0,get:function(){return Zc.compress}});Object.defineProperty(Ae,"decompress",{enumerable:!0,get:function(){return Zc.decompress}});var AD=qi();Object.defineProperty(Ae,"decode",{enumerable:!0,get:function(){return AD.decode}});var PD=Wi();Object.defineProperty(Ae,"addValue",{enumerable:!0,get:function(){return PD.addValue}});var el=Xc();Object.defineProperty(Ae,"trimUndefined",{enumerable:!0,get:function(){return el.trimUndefined}});Object.defineProperty(Ae,"trimUndefinedRecursively",{enumerable:!0,get:function(){return el.trimUndefinedRecursively}});var TD=Vi();Object.defineProperty(Ae,"config",{enumerable:!0,get:function(){return TD.config}})});var Sl=_((cR,vl)=>{"use strict";var El=se("child_process"),xl=El.spawn,rC=El.exec;vl.exports=function(e,t,r){if(typeof t=="function"&&r===void 0&&(r=t,t=void 0),e=parseInt(e),Number.isNaN(e)){if(r)return r(new Error("pid must be a number"));throw new Error("pid must be a number")}var n={},i={};switch(n[e]=[],i[e]=1,process.platform){case"win32":rC("taskkill /pid "+e+" /T /F",r);break;case"darwin":us(e,n,i,function(s){return xl("pgrep",["-P",s])},function(){bl(n,t,r)});break;default:us(e,n,i,function(s){return xl("ps",["-o","pid","--no-headers","--ppid",s])},function(){bl(n,t,r)});break}};function bl(e,t,r){var n={};try{Object.keys(e).forEach(function(i){e[i].forEach(function(s){n[s]||(wl(s,t),n[s]=1)}),n[i]||(wl(i,t),n[i]=1)})}catch(i){if(r)return r(i);throw i}if(r)return r()}function wl(e,t){try{process.kill(parseInt(e,10),t)}catch(r){if(r.code!=="ESRCH")throw r}}function us(e,t,r,n,i){var s=n(e),o="";s.stdout.on("data",function(c){var c=c.toString("ascii");o+=c});var a=function(u){if(delete r[e],u!=0){Object.keys(r).length==0&&i();return}o.match(/\d+/g).forEach(function(c){c=parseInt(c,10),t[e].push(c),t[c]=[],r[c]=1,us(c,t,r,n,i)})};s.on("close",a)}});var En=_(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});qe.isSSL=void 0;qe.setupOutgoing=sC;qe.setupSocket=aC;qe.getPort=uC;qe.hasEncryptedConnection=Al;qe.urlJoin=Pl;qe.rewriteCookieProperty=Tl;qe.toURL=Rl;var nC=se("tls"),oC=/(^|,)\s*upgrade\s*($|,)/i;qe.isSSL=/^https|wss/;var iC="trailer";function sC(e,t,r,n){let i=t[n||"target"];e.port=+(i.port??(i.protocol!==void 0&&qe.isSSL.test(i.protocol)?443:80));for(let a of["host","hostname","socketPath","pfx","key","passphrase","cert","ca","ciphers","secureProtocol"])e[a]=i[a];e.method=t.method||r.method,e.headers={...r.headers},t.headers&&(e.headers={...e.headers,...t.headers});for(let a in e.headers)if(iC==a.toLowerCase()){delete e.headers[a];break}t.auth&&(delete e.headers.authorization,e.auth=t.auth),t.ca&&(e.ca=t.ca),i.protocol!==void 0&&qe.isSSL.test(i.protocol)&&(e.rejectUnauthorized=typeof t.secure>"u"?!0:t.secure),e.agent=t.agent||!1,e.localAddress=t.localAddress,e.agent||(e.headers=e.headers||{},(typeof e.headers.connection!="string"||!oC.test(e.headers.connection))&&(e.headers.connection="close"));let s=i&&t.prependPath!==!1&&"pathname"in i?Fl(`${i.pathname}${i.search??""}`):"/",o=t.toProxy?r.url:Fl(r.url);return o=t.ignorePath?"":o,e.path=Pl(s,o??""),t.changeOrigin&&(e.headers.host=i.protocol!==void 0&&lC(e.port,i.protocol)&&!cC(e.host)?e.host+":"+e.port:e.host),e}function aC(e){return e.setTimeout(0),e.setNoDelay(!0),e.setKeepAlive(!0,0),e}function uC(e){let t=e.headers.host?e.headers.host.match(/:(\d+)/):"";return t?t[1]:Al(e)?"443":"80"}function Al(e){let t=e.connection;return t instanceof nC.TLSSocket&&t.encrypted||!!t.pair}function Pl(...e){let t=[],r="";e.forEach((i,s)=>{let o=i.indexOf("?");o!==-1&&(t.push(i.substring(o+1)),e[s]=i.substring(0,o))}),r=t.filter(Boolean).join("&");let n="";for(let i of e)i&&(n.endsWith("/")?i.startsWith("/")?n+=i.slice(1):n+=i:i.startsWith("/")?n+=i:n+="/"+i);return r?n+"?"+r:n}function Tl(e,t,r){return Array.isArray(e)?e.map(n=>Tl(n,t,r)):e.replace(new RegExp("(;\\s*"+r+"=)([^;]+)","i"),(n,i,s)=>{let o;if(s in t)o=t[s];else if("*"in t)o=t["*"];else return n;return o?i+o:""})}function cC(e){return!!~e.indexOf(":")}function Fl(e){if(e===""||e?.startsWith("?"))return e;let t=Rl(e);return`${t.pathname??""}${t.search??""}`}function Rl(e){return e instanceof URL?e:(typeof e=="object"&&"href"in e&&typeof e.href=="string"&&(e=e.href),e||(e=""),typeof e!="string"&&(e=`${e}`),e.startsWith("//")&&(e=`http://dummy.org${e}`),new URL(e,"http://dummy.org"))}function lC(e,t){if(t=t.split(":")[0],e=+e,!e)return!1;switch(t){case"http":case"ws":return e!==80;case"https":case"wss":return e!==443}return e!==0}});var Nl=_(Be=>{"use strict";var pC=Be&&Be.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),dC=Be&&Be.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),fC=Be&&Be.__importStar||function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),i=0;i<n.length;i++)n[i]!=="default"&&pC(r,t,n[i]);return dC(r,t),r}}();Object.defineProperty(Be,"__esModule",{value:!0});Be.OUTGOING_PASSES=void 0;Be.removeChunked=Il;Be.setConnection=kl;Be.setRedirectHostRewrite=Bl;Be.writeHeaders=$l;Be.writeStatusCode=_l;var bo=fC(En()),mC=/^201|30(1|2|7|8)$/;function Il(e,t,r){e.httpVersion==="1.0"&&delete r.headers["transfer-encoding"]}function kl(e,t,r){e.httpVersion==="1.0"?r.headers.connection=e.headers.connection||"close":e.httpVersion!=="2.0"&&!r.headers.connection&&(r.headers.connection=e.headers.connection||"keep-alive")}function Bl(e,t,r,n){if((n.hostRewrite||n.autoRewrite||n.protocolRewrite)&&r.headers.location&&mC.test(`${r.statusCode}`)){let i=bo.toURL(n.target),s=r.headers.location;if(typeof s!="string")return;let o=bo.toURL(s);if(i.host!=o.host)return;n.hostRewrite?o.host=n.hostRewrite:n.autoRewrite&&(o.host=e.headers.host??""),n.protocolRewrite&&(o.protocol=n.protocolRewrite),r.headers.location=o.toString()}}function $l(e,t,r,n){let i=typeof n.cookieDomainRewrite=="string"?{"*":n.cookieDomainRewrite}:n.cookieDomainRewrite,s=typeof n.cookiePathRewrite=="string"?{"*":n.cookiePathRewrite}:n.cookiePathRewrite,o=n.preserveHeaderKeyCase,a=(c,l)=>{l!=null&&(i&&c.toLowerCase()==="set-cookie"&&(l=bo.rewriteCookieProperty(l,i,"domain")),s&&c.toLowerCase()==="set-cookie"&&(l=bo.rewriteCookieProperty(l,s,"path")),t.setHeader(String(c).trim(),l))},u;if(o&&r.rawHeaders!=null){u={};for(let c=0;c<r.rawHeaders.length;c+=2){let l=r.rawHeaders[c];u[l.toLowerCase()]=l}}for(let c in r.headers){let l=c,p=r.headers[l];o&&u&&(l=u[l]??l),a(l,p)}}function _l(e,t,r){r.statusMessage?(t.statusCode=r.statusCode,t.statusMessage=r.statusMessage):t.statusCode=r.statusCode}Be.OUTGOING_PASSES={removeChunked:Il,setConnection:kl,setRedirectHostRewrite:Bl,writeHeaders:$l,writeStatusCode:_l}});var Ll=_((mR,Ol)=>{var jr=1e3,Ur=jr*60,Vr=Ur*60,gr=Vr*24,gC=gr*7,hC=gr*365.25;Ol.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return DC(e);if(r==="number"&&isFinite(e))return t.long?yC(e):CC(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function DC(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*hC;case"weeks":case"week":case"w":return r*gC;case"days":case"day":case"d":return r*gr;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Vr;case"minutes":case"minute":case"mins":case"min":case"m":return r*Ur;case"seconds":case"second":case"secs":case"sec":case"s":return r*jr;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function CC(e){var t=Math.abs(e);return t>=gr?Math.round(e/gr)+"d":t>=Vr?Math.round(e/Vr)+"h":t>=Ur?Math.round(e/Ur)+"m":t>=jr?Math.round(e/jr)+"s":e+"ms"}function yC(e){var t=Math.abs(e);return t>=gr?wo(e,t,gr,"day"):t>=Vr?wo(e,t,Vr,"hour"):t>=Ur?wo(e,t,Ur,"minute"):t>=jr?wo(e,t,jr,"second"):e+" ms"}function wo(e,t,r,n){var i=t>=r*1.5;return Math.round(e/r)+" "+n+(i?"s":"")}});var cs=_((gR,Ml)=>{function xC(e){r.debug=r,r.default=r,r.coerce=u,r.disable=o,r.enable=i,r.enabled=a,r.humanize=Ll(),r.destroy=c,Object.keys(e).forEach(l=>{r[l]=e[l]}),r.names=[],r.skips=[],r.formatters={};function t(l){let p=0;for(let d=0;d<l.length;d++)p=(p<<5)-p+l.charCodeAt(d),p|=0;return r.colors[Math.abs(p)%r.colors.length]}r.selectColor=t;function r(l){let p,d=null,D,m;function f(...g){if(!f.enabled)return;let h=f,E=Number(new Date),v=E-(p||E);h.diff=v,h.prev=p,h.curr=E,p=E,g[0]=r.coerce(g[0]),typeof g[0]!="string"&&g.unshift("%O");let P=0;g[0]=g[0].replace(/%([a-zA-Z%])/g,(F,T)=>{if(F==="%%")return"%";P++;let k=r.formatters[T];if(typeof k=="function"){let I=g[P];F=k.call(h,I),g.splice(P,1),P--}return F}),r.formatArgs.call(h,g),(h.log||r.log).apply(h,g)}return f.namespace=l,f.useColors=r.useColors(),f.color=r.selectColor(l),f.extend=n,f.destroy=r.destroy,Object.defineProperty(f,"enabled",{enumerable:!0,configurable:!1,get:()=>d!==null?d:(D!==r.namespaces&&(D=r.namespaces,m=r.enabled(l)),m),set:g=>{d=g}}),typeof r.init=="function"&&r.init(f),f}function n(l,p){let d=r(this.namespace+(typeof p>"u"?":":p)+l);return d.log=this.log,d}function i(l){r.save(l),r.namespaces=l,r.names=[],r.skips=[];let p=(typeof l=="string"?l:"").trim().replace(" ",",").split(",").filter(Boolean);for(let d of p)d[0]==="-"?r.skips.push(d.slice(1)):r.names.push(d)}function s(l,p){let d=0,D=0,m=-1,f=0;for(;d<l.length;)if(D<p.length&&(p[D]===l[d]||p[D]==="*"))p[D]==="*"?(m=D,f=d,D++):(d++,D++);else if(m!==-1)D=m+1,f++,d=f;else return!1;for(;D<p.length&&p[D]==="*";)D++;return D===p.length}function o(){let l=[...r.names,...r.skips.map(p=>"-"+p)].join(",");return r.enable(""),l}function a(l){for(let p of r.skips)if(s(l,p))return!1;for(let p of r.names)if(s(l,p))return!0;return!1}function u(l){return l instanceof Error?l.stack||l.message:l}function c(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}Ml.exports=xC});var jl=_((Je,Eo)=>{Je.formatArgs=wC;Je.save=EC;Je.load=vC;Je.useColors=bC;Je.storage=SC();Je.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();Je.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function bC(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function wC(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+Eo.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let r=0,n=0;e[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),e.splice(n,0,t)}Je.log=console.debug||console.log||(()=>{});function EC(e){try{e?Je.storage.setItem("debug",e):Je.storage.removeItem("debug")}catch{}}function vC(){let e;try{e=Je.storage.getItem("debug")}catch{}return!e&&typeof process<"u"&&"env"in process&&(e=process.env.DEBUG),e}function SC(){try{return localStorage}catch{}}Eo.exports=cs()(Je);var{formatters:FC}=Eo.exports;FC.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var Vl=_((hR,Ul)=>{"use strict";Ul.exports=(e,t=process.argv)=>{let r=e.startsWith("-")?"":e.length===1?"-":"--",n=t.indexOf(r+e),i=t.indexOf("--");return n!==-1&&(i===-1||n<i)}});var Gl=_((DR,Kl)=>{"use strict";var AC=se("os"),Hl=se("tty"),it=Vl(),{env:xe}=process,Qt;it("no-color")||it("no-colors")||it("color=false")||it("color=never")?Qt=0:(it("color")||it("colors")||it("color=true")||it("color=always"))&&(Qt=1);"FORCE_COLOR"in xe&&(xe.FORCE_COLOR==="true"?Qt=1:xe.FORCE_COLOR==="false"?Qt=0:Qt=xe.FORCE_COLOR.length===0?1:Math.min(parseInt(xe.FORCE_COLOR,10),3));function ls(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function ps(e,t){if(Qt===0)return 0;if(it("color=16m")||it("color=full")||it("color=truecolor"))return 3;if(it("color=256"))return 2;if(e&&!t&&Qt===void 0)return 0;let r=Qt||0;if(xe.TERM==="dumb")return r;if(process.platform==="win32"){let n=AC.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in xe)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in xe)||xe.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in xe)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(xe.TEAMCITY_VERSION)?1:0;if(xe.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in xe){let n=parseInt((xe.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(xe.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(xe.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(xe.TERM)||"COLORTERM"in xe?1:r}function PC(e){let t=ps(e,e&&e.isTTY);return ls(t)}Kl.exports={supportsColor:PC,stdout:ls(ps(!0,Hl.isatty(1))),stderr:ls(ps(!0,Hl.isatty(2)))}});var zl=_((be,So)=>{var TC=se("tty"),vo=se("util");be.init=NC;be.log=BC;be.formatArgs=IC;be.save=$C;be.load=_C;be.useColors=RC;be.destroy=vo.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");be.colors=[6,2,3,4,5,1];try{let e=Gl();e&&(e.stderr||e).level>=2&&(be.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}be.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let r=t.substring(6).toLowerCase().replace(/_([a-z])/g,(i,s)=>s.toUpperCase()),n=process.env[t];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),e[r]=n,e},{});function RC(){return"colors"in be.inspectOpts?!!be.inspectOpts.colors:TC.isatty(process.stderr.fd)}function IC(e){let{namespace:t,useColors:r}=this;if(r){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${i};1m${t} \x1B[0m`;e[0]=s+e[0].split(`
|
|
16
16
|
`).join(`
|
|
17
|
-
`+s),e.push(i+"m+"+
|
|
18
|
-
`)}function
|
|
19
|
-
`).map(t=>t.trim()).join(" ")};rp.O=function(e){return this.inspectOpts.colors=this.useColors,ko.inspect(e,this.inspectOpts)}});var op=B((jI,Ps)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Ps.exports=Yl():Ps.exports=np()});var sp=B((UI,ip)=>{var Pn;ip.exports=function(){if(!Pn){try{Pn=op()("follow-redirects")}catch{}typeof Pn!="function"&&(Pn=function(){})}Pn.apply(null,arguments)}});var pp=B((HI,js)=>{var Rn=z("url"),Tn=Rn.URL,Fy=z("http"),Ay=z("https"),Bs=z("stream").Writable,_s=z("assert"),ap=sp();(function(){var t=typeof process<"u",r=typeof window<"u"&&typeof document<"u",n=mr(Error.captureStackTrace);!t&&(r||!n)&&console.warn("The follow-redirects package should be excluded from browser builds.")})();var $s=!1;try{_s(new Tn(""))}catch(e){$s=e.code==="ERR_INVALID_URL"}var Py=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],Ns=["abort","aborted","connect","error","socket","timeout"],Os=Object.create(null);Ns.forEach(function(e){Os[e]=function(t,r,n){this._redirectable.emit(e,t,r,n)}});var Rs=In("ERR_INVALID_URL","Invalid URL",TypeError),Is=In("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),Ty=In("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",Is),Ry=In("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),Iy=In("ERR_STREAM_WRITE_AFTER_END","write after end"),ky=Bs.prototype.destroy||cp;function Oe(e,t){Bs.call(this),this._sanitizeOptions(e),this._options=e,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],t&&this.on("response",t);var r=this;this._onNativeResponse=function(n){try{r._processResponse(n)}catch(i){r.emit("error",i instanceof Is?i:new Is({cause:i}))}},this._performRequest()}Oe.prototype=Object.create(Bs.prototype);Oe.prototype.abort=function(){Ms(this._currentRequest),this._currentRequest.abort(),this.emit("abort")};Oe.prototype.destroy=function(e){return Ms(this._currentRequest,e),ky.call(this,e),this};Oe.prototype.write=function(e,t,r){if(this._ending)throw new Iy;if(!fr(e)&&!$y(e))throw new TypeError("data should be a string, Buffer or Uint8Array");if(mr(t)&&(r=t,t=null),e.length===0){r&&r();return}this._requestBodyLength+e.length<=this._options.maxBodyLength?(this._requestBodyLength+=e.length,this._requestBodyBuffers.push({data:e,encoding:t}),this._currentRequest.write(e,t,r)):(this.emit("error",new Ry),this.abort())};Oe.prototype.end=function(e,t,r){if(mr(e)?(r=e,e=t=null):mr(t)&&(r=t,t=null),!e)this._ended=this._ending=!0,this._currentRequest.end(null,null,r);else{var n=this,i=this._currentRequest;this.write(e,t,function(){n._ended=!0,i.end(null,null,r)}),this._ending=!0}};Oe.prototype.setHeader=function(e,t){this._options.headers[e]=t,this._currentRequest.setHeader(e,t)};Oe.prototype.removeHeader=function(e){delete this._options.headers[e],this._currentRequest.removeHeader(e)};Oe.prototype.setTimeout=function(e,t){var r=this;function n(o){o.setTimeout(e),o.removeListener("timeout",o.destroy),o.addListener("timeout",o.destroy)}function i(o){r._timeout&&clearTimeout(r._timeout),r._timeout=setTimeout(function(){r.emit("timeout"),s()},e),n(o)}function s(){r._timeout&&(clearTimeout(r._timeout),r._timeout=null),r.removeListener("abort",s),r.removeListener("error",s),r.removeListener("response",s),r.removeListener("close",s),t&&r.removeListener("timeout",t),r.socket||r._currentRequest.removeListener("socket",i)}return t&&this.on("timeout",t),this.socket?i(this.socket):this._currentRequest.once("socket",i),this.on("socket",n),this.on("abort",s),this.on("error",s),this.on("response",s),this.on("close",s),this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(e){Oe.prototype[e]=function(t,r){return this._currentRequest[e](t,r)}});["aborted","connection","socket"].forEach(function(e){Object.defineProperty(Oe.prototype,e,{get:function(){return this._currentRequest[e]}})});Oe.prototype._sanitizeOptions=function(e){if(e.headers||(e.headers={}),e.host&&(e.hostname||(e.hostname=e.host),delete e.host),!e.pathname&&e.path){var t=e.path.indexOf("?");t<0?e.pathname=e.path:(e.pathname=e.path.substring(0,t),e.search=e.path.substring(t))}};Oe.prototype._performRequest=function(){var e=this._options.protocol,t=this._options.nativeProtocols[e];if(!t)throw new TypeError("Unsupported protocol "+e);if(this._options.agents){var r=e.slice(0,-1);this._options.agent=this._options.agents[r]}var n=this._currentRequest=t.request(this._options,this._onNativeResponse);n._redirectable=this;for(var i of Ns)n.on(i,Os[i]);if(this._currentUrl=/^\//.test(this._options.path)?Rn.format(this._options):this._options.path,this._isRedirect){var s=0,o=this,a=this._requestBodyBuffers;(function u(c){if(n===o._currentRequest)if(c)o.emit("error",c);else if(s<a.length){var l=a[s++];n.finished||n.write(l.data,l.encoding,u)}else o._ended&&n.end()})()}};Oe.prototype._processResponse=function(e){var t=e.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:e.headers,statusCode:t});var r=e.headers.location;if(!r||this._options.followRedirects===!1||t<300||t>=400){e.responseUrl=this._currentUrl,e.redirects=this._redirects,this.emit("response",e),this._requestBodyBuffers=[];return}if(Ms(this._currentRequest),e.destroy(),++this._redirectCount>this._options.maxRedirects)throw new Ty;var n,i=this._options.beforeRedirect;i&&(n=Object.assign({Host:e.req.getHeader("host")},this._options.headers));var s=this._options.method;((t===301||t===302)&&this._options.method==="POST"||t===303&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],Ts(/^content-/i,this._options.headers));var o=Ts(/^host$/i,this._options.headers),a=Ls(this._currentUrl),u=o||a.host,c=/^\w+:/.test(r)?this._currentUrl:Rn.format(Object.assign(a,{host:u})),l=By(r,c);if(ap("redirecting to",l.href),this._isRedirect=!0,ks(l,this._options),(l.protocol!==a.protocol&&l.protocol!=="https:"||l.host!==u&&!_y(l.host,u))&&Ts(/^(?:(?:proxy-)?authorization|cookie)$/i,this._options.headers),mr(i)){var p={headers:e.headers,statusCode:t},d={url:c,method:s,headers:n};i(this._options,p,d),this._sanitizeOptions(this._options)}this._performRequest()};function up(e){var t={maxRedirects:21,maxBodyLength:10485760},r={};return Object.keys(e).forEach(function(n){var i=n+":",s=r[i]=e[n],o=t[n]=Object.create(s);function a(c,l,p){return Ny(c)?c=ks(c):fr(c)?c=ks(Ls(c)):(p=l,l=lp(c),c={protocol:i}),mr(l)&&(p=l,l=null),l=Object.assign({maxRedirects:t.maxRedirects,maxBodyLength:t.maxBodyLength},c,l),l.nativeProtocols=r,!fr(l.host)&&!fr(l.hostname)&&(l.hostname="::1"),_s.equal(l.protocol,i,"protocol mismatch"),ap("options",l),new Oe(l,p)}function u(c,l,p){var d=o.request(c,l,p);return d.end(),d}Object.defineProperties(o,{request:{value:a,configurable:!0,enumerable:!0,writable:!0},get:{value:u,configurable:!0,enumerable:!0,writable:!0}})}),t}function cp(){}function Ls(e){var t;if($s)t=new Tn(e);else if(t=lp(Rn.parse(e)),!fr(t.protocol))throw new Rs({input:e});return t}function By(e,t){return $s?new Tn(e,t):Ls(Rn.resolve(t,e))}function lp(e){if(/^\[/.test(e.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(e.hostname))throw new Rs({input:e.href||e});if(/^\[/.test(e.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(e.host))throw new Rs({input:e.href||e});return e}function ks(e,t){var r=t||{};for(var n of Py)r[n]=e[n];return r.hostname.startsWith("[")&&(r.hostname=r.hostname.slice(1,-1)),r.port!==""&&(r.port=Number(r.port)),r.path=r.search?r.pathname+r.search:r.pathname,r}function Ts(e,t){var r;for(var n in t)e.test(n)&&(r=t[n],delete t[n]);return r===null||typeof r>"u"?void 0:String(r).trim()}function In(e,t,r){function n(i){mr(Error.captureStackTrace)&&Error.captureStackTrace(this,this.constructor),Object.assign(this,i||{}),this.code=e,this.message=this.cause?t+": "+this.cause.message:t}return n.prototype=new(r||Error),Object.defineProperties(n.prototype,{constructor:{value:n,enumerable:!1},name:{value:"Error ["+e+"]",enumerable:!1}}),n}function Ms(e,t){for(var r of Ns)e.removeListener(r,Os[r]);e.on("error",cp),e.destroy(t)}function _y(e,t){_s(fr(e)&&fr(t));var r=e.length-t.length-1;return r>0&&e[r]==="."&&e.endsWith(t)}function fr(e){return typeof e=="string"||e instanceof String}function mr(e){return typeof e=="function"}function $y(e){return typeof e=="object"&&"length"in e}function Ny(e){return Tn&&e instanceof Tn}js.exports=up({http:Fy,https:Ay});js.exports.wrap=up});var fp=B((VI,dp)=>{var Oy=z("http"),Ly=z("https"),kn=Wl(),_o=To(),My=pp();kn=Object.keys(kn).map(function(e){return kn[e]});var jy={http:Oy,https:Ly};dp.exports={deleteLength:function(t,r,n){(t.method==="DELETE"||t.method==="OPTIONS")&&!t.headers["content-length"]&&(t.headers["content-length"]="0",delete t.headers["transfer-encoding"])},timeout:function(t,r,n){n.timeout&&t.socket.setTimeout(n.timeout)},XHeaders:function(t,r,n){if(n.xfwd){var i=t.isSpdy||_o.hasEncryptedConnection(t),s={for:t.connection.remoteAddress||t.socket.remoteAddress,port:_o.getPort(t),proto:i?"https":"http"};["for","port","proto"].forEach(function(o){t.headers["x-forwarded-"+o]=(t.headers["x-forwarded-"+o]||"")+(t.headers["x-forwarded-"+o]?",":"")+s[o]}),t.headers["x-forwarded-host"]=t.headers["x-forwarded-host"]||t.headers.host||""}},stream:function(t,r,n,i,s,o){s.emit("start",t,r,n.target||n.forward);var a=n.followRedirects?My:jy,u=a.http,c=a.https;if(n.forward){var l=(n.forward.protocol==="https:"?c:u).request(_o.setupOutgoing(n.ssl||{},n,t,"forward")),p=m(l,n.forward);if(t.on("error",p),l.on("error",p),(n.buffer||t).pipe(l),!n.target)return r.end()}var d=(n.target.protocol==="https:"?c:u).request(_o.setupOutgoing(n.ssl||{},n,t));d.on("socket",function(f){s&&!d.getHeader("expect")&&s.emit("proxyReq",d,t,r,n)}),n.proxyTimeout&&d.setTimeout(n.proxyTimeout,function(){d.abort()}),t.on("aborted",function(){d.abort()});var g=m(d,n.target);t.on("error",g),d.on("error",g);function m(f,h){return function(v){if(t.socket.destroyed&&v.code==="ECONNRESET")return s.emit("econnreset",v,t,r,h),f.abort();o?o(v,t,r,h):s.emit("error",v,t,r,h)}}(n.buffer||t).pipe(d),d.on("response",function(f){if(s&&s.emit("proxyRes",f,t,r),!r.headersSent&&!n.selfHandleResponse)for(var h=0;h<kn.length&&!kn[h](t,r,f,n);h++);r.finished?s&&s.emit("end",t,r,f):(f.on("end",function(){s&&s.emit("end",t,r,f)}),n.selfHandleResponse||f.pipe(r))})}}});var gp=B((KI,mp)=>{var Uy=z("http"),Hy=z("https"),Vr=To();mp.exports={checkMethodAndHeader:function(t,r){if(t.method!=="GET"||!t.headers.upgrade||t.headers.upgrade.toLowerCase()!=="websocket")return r.destroy(),!0},XHeaders:function(t,r,n){if(n.xfwd){var i={for:t.connection.remoteAddress||t.socket.remoteAddress,port:Vr.getPort(t),proto:Vr.hasEncryptedConnection(t)?"wss":"ws"};["for","port","proto"].forEach(function(s){t.headers["x-forwarded-"+s]=(t.headers["x-forwarded-"+s]||"")+(t.headers["x-forwarded-"+s]?",":"")+i[s]})}},stream:function(t,r,n,i,s,o){var a=function(l,p){return Object.keys(p).reduce(function(d,g){var m=p[g];if(!Array.isArray(m))return d.push(g+": "+m),d;for(var f=0;f<m.length;f++)d.push(g+": "+m[f]);return d},[l]).join(`\r
|
|
17
|
+
`+s),e.push(i+"m+"+So.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=kC()+t+" "+e[0]}function kC(){return be.inspectOpts.hideDate?"":new Date().toISOString()+" "}function BC(...e){return process.stderr.write(vo.formatWithOptions(be.inspectOpts,...e)+`
|
|
18
|
+
`)}function $C(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function _C(){return process.env.DEBUG}function NC(e){e.inspectOpts={};let t=Object.keys(be.inspectOpts);for(let r=0;r<t.length;r++)e.inspectOpts[t[r]]=be.inspectOpts[t[r]]}So.exports=cs()(be);var{formatters:Wl}=So.exports;Wl.o=function(e){return this.inspectOpts.colors=this.useColors,vo.inspect(e,this.inspectOpts).split(`
|
|
19
|
+
`).map(t=>t.trim()).join(" ")};Wl.O=function(e){return this.inspectOpts.colors=this.useColors,vo.inspect(e,this.inspectOpts)}});var Fo=_((CR,ds)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?ds.exports=jl():ds.exports=zl()});var Jl=_((yR,ql)=>{var vn;ql.exports=function(){if(!vn){try{vn=Fo()("follow-redirects")}catch{}typeof vn!="function"&&(vn=function(){})}vn.apply(null,arguments)}});var ep=_((xR,vs)=>{var Fn=se("url"),Sn=Fn.URL,OC=se("http"),LC=se("https"),Ds=se("stream").Writable,Cs=se("assert"),Yl=Jl();(function(){var t=typeof process<"u",r=typeof window<"u"&&typeof document<"u",n=Dr(Error.captureStackTrace);!t&&(r||!n)&&console.warn("The follow-redirects package should be excluded from browser builds.")})();var ys=!1;try{Cs(new Sn(""))}catch(e){ys=e.code==="ERR_INVALID_URL"}var MC=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],xs=["abort","aborted","connect","error","socket","timeout"],bs=Object.create(null);xs.forEach(function(e){bs[e]=function(t,r,n){this._redirectable.emit(e,t,r,n)}});var ms=An("ERR_INVALID_URL","Invalid URL",TypeError),gs=An("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),jC=An("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",gs),UC=An("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),VC=An("ERR_STREAM_WRITE_AFTER_END","write after end"),HC=Ds.prototype.destroy||Xl;function Le(e,t){Ds.call(this),this._sanitizeOptions(e),this._options=e,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],t&&this.on("response",t);var r=this;this._onNativeResponse=function(n){try{r._processResponse(n)}catch(i){r.emit("error",i instanceof gs?i:new gs({cause:i}))}},this._performRequest()}Le.prototype=Object.create(Ds.prototype);Le.prototype.abort=function(){Es(this._currentRequest),this._currentRequest.abort(),this.emit("abort")};Le.prototype.destroy=function(e){return Es(this._currentRequest,e),HC.call(this,e),this};Le.prototype.write=function(e,t,r){if(this._ending)throw new VC;if(!hr(e)&&!WC(e))throw new TypeError("data should be a string, Buffer or Uint8Array");if(Dr(t)&&(r=t,t=null),e.length===0){r&&r();return}this._requestBodyLength+e.length<=this._options.maxBodyLength?(this._requestBodyLength+=e.length,this._requestBodyBuffers.push({data:e,encoding:t}),this._currentRequest.write(e,t,r)):(this.emit("error",new UC),this.abort())};Le.prototype.end=function(e,t,r){if(Dr(e)?(r=e,e=t=null):Dr(t)&&(r=t,t=null),!e)this._ended=this._ending=!0,this._currentRequest.end(null,null,r);else{var n=this,i=this._currentRequest;this.write(e,t,function(){n._ended=!0,i.end(null,null,r)}),this._ending=!0}};Le.prototype.setHeader=function(e,t){this._options.headers[e]=t,this._currentRequest.setHeader(e,t)};Le.prototype.removeHeader=function(e){delete this._options.headers[e],this._currentRequest.removeHeader(e)};Le.prototype.setTimeout=function(e,t){var r=this;function n(o){o.setTimeout(e),o.removeListener("timeout",o.destroy),o.addListener("timeout",o.destroy)}function i(o){r._timeout&&clearTimeout(r._timeout),r._timeout=setTimeout(function(){r.emit("timeout"),s()},e),n(o)}function s(){r._timeout&&(clearTimeout(r._timeout),r._timeout=null),r.removeListener("abort",s),r.removeListener("error",s),r.removeListener("response",s),r.removeListener("close",s),t&&r.removeListener("timeout",t),r.socket||r._currentRequest.removeListener("socket",i)}return t&&this.on("timeout",t),this.socket?i(this.socket):this._currentRequest.once("socket",i),this.on("socket",n),this.on("abort",s),this.on("error",s),this.on("response",s),this.on("close",s),this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(e){Le.prototype[e]=function(t,r){return this._currentRequest[e](t,r)}});["aborted","connection","socket"].forEach(function(e){Object.defineProperty(Le.prototype,e,{get:function(){return this._currentRequest[e]}})});Le.prototype._sanitizeOptions=function(e){if(e.headers||(e.headers={}),e.host&&(e.hostname||(e.hostname=e.host),delete e.host),!e.pathname&&e.path){var t=e.path.indexOf("?");t<0?e.pathname=e.path:(e.pathname=e.path.substring(0,t),e.search=e.path.substring(t))}};Le.prototype._performRequest=function(){var e=this._options.protocol,t=this._options.nativeProtocols[e];if(!t)throw new TypeError("Unsupported protocol "+e);if(this._options.agents){var r=e.slice(0,-1);this._options.agent=this._options.agents[r]}var n=this._currentRequest=t.request(this._options,this._onNativeResponse);n._redirectable=this;for(var i of xs)n.on(i,bs[i]);if(this._currentUrl=/^\//.test(this._options.path)?Fn.format(this._options):this._options.path,this._isRedirect){var s=0,o=this,a=this._requestBodyBuffers;(function u(c){if(n===o._currentRequest)if(c)o.emit("error",c);else if(s<a.length){var l=a[s++];n.finished||n.write(l.data,l.encoding,u)}else o._ended&&n.end()})()}};Le.prototype._processResponse=function(e){var t=e.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:e.headers,statusCode:t});var r=e.headers.location;if(!r||this._options.followRedirects===!1||t<300||t>=400){e.responseUrl=this._currentUrl,e.redirects=this._redirects,this.emit("response",e),this._requestBodyBuffers=[];return}if(Es(this._currentRequest),e.destroy(),++this._redirectCount>this._options.maxRedirects)throw new jC;var n,i=this._options.beforeRedirect;i&&(n=Object.assign({Host:e.req.getHeader("host")},this._options.headers));var s=this._options.method;((t===301||t===302)&&this._options.method==="POST"||t===303&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],fs(/^content-/i,this._options.headers));var o=fs(/^host$/i,this._options.headers),a=ws(this._currentUrl),u=o||a.host,c=/^\w+:/.test(r)?this._currentUrl:Fn.format(Object.assign(a,{host:u})),l=KC(r,c);if(Yl("redirecting to",l.href),this._isRedirect=!0,hs(l,this._options),(l.protocol!==a.protocol&&l.protocol!=="https:"||l.host!==u&&!GC(l.host,u))&&fs(/^(?:(?:proxy-)?authorization|cookie)$/i,this._options.headers),Dr(i)){var p={headers:e.headers,statusCode:t},d={url:c,method:s,headers:n};i(this._options,p,d),this._sanitizeOptions(this._options)}this._performRequest()};function Ql(e){var t={maxRedirects:21,maxBodyLength:10485760},r={};return Object.keys(e).forEach(function(n){var i=n+":",s=r[i]=e[n],o=t[n]=Object.create(s);function a(c,l,p){return zC(c)?c=hs(c):hr(c)?c=hs(ws(c)):(p=l,l=Zl(c),c={protocol:i}),Dr(l)&&(p=l,l=null),l=Object.assign({maxRedirects:t.maxRedirects,maxBodyLength:t.maxBodyLength},c,l),l.nativeProtocols=r,!hr(l.host)&&!hr(l.hostname)&&(l.hostname="::1"),Cs.equal(l.protocol,i,"protocol mismatch"),Yl("options",l),new Le(l,p)}function u(c,l,p){var d=o.request(c,l,p);return d.end(),d}Object.defineProperties(o,{request:{value:a,configurable:!0,enumerable:!0,writable:!0},get:{value:u,configurable:!0,enumerable:!0,writable:!0}})}),t}function Xl(){}function ws(e){var t;if(ys)t=new Sn(e);else if(t=Zl(Fn.parse(e)),!hr(t.protocol))throw new ms({input:e});return t}function KC(e,t){return ys?new Sn(e,t):ws(Fn.resolve(t,e))}function Zl(e){if(/^\[/.test(e.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(e.hostname))throw new ms({input:e.href||e});if(/^\[/.test(e.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(e.host))throw new ms({input:e.href||e});return e}function hs(e,t){var r=t||{};for(var n of MC)r[n]=e[n];return r.hostname.startsWith("[")&&(r.hostname=r.hostname.slice(1,-1)),r.port!==""&&(r.port=Number(r.port)),r.path=r.search?r.pathname+r.search:r.pathname,r}function fs(e,t){var r;for(var n in t)e.test(n)&&(r=t[n],delete t[n]);return r===null||typeof r>"u"?void 0:String(r).trim()}function An(e,t,r){function n(i){Dr(Error.captureStackTrace)&&Error.captureStackTrace(this,this.constructor),Object.assign(this,i||{}),this.code=e,this.message=this.cause?t+": "+this.cause.message:t}return n.prototype=new(r||Error),Object.defineProperties(n.prototype,{constructor:{value:n,enumerable:!1},name:{value:"Error ["+e+"]",enumerable:!1}}),n}function Es(e,t){for(var r of xs)e.removeListener(r,bs[r]);e.on("error",Xl),e.destroy(t)}function GC(e,t){Cs(hr(e)&&hr(t));var r=e.length-t.length-1;return r>0&&e[r]==="."&&e.endsWith(t)}function hr(e){return typeof e=="string"||e instanceof String}function Dr(e){return typeof e=="function"}function WC(e){return typeof e=="object"&&"length"in e}function zC(e){return Sn&&e instanceof Sn}vs.exports=Ql({http:OC,https:LC});vs.exports.wrap=Ql});var ip=_(Me=>{"use strict";var qC=Me&&Me.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),JC=Me&&Me.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Po=Me&&Me.__importStar||function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),i=0;i<n.length;i++)n[i]!=="default"&&qC(r,t,n[i]);return JC(r,t),r}}();Object.defineProperty(Me,"__esModule",{value:!0});Me.WEB_PASSES=void 0;Me.deleteLength=tp;Me.timeout=rp;Me.XHeaders=np;Me.stream=op;var YC=Po(se("http")),QC=Po(se("https")),XC=Nl(),Ao=Po(En()),ZC=Po(ep()),ey=Object.values(XC.OUTGOING_PASSES),ty={http:YC,https:QC};function tp(e){(e.method==="DELETE"||e.method==="OPTIONS")&&!e.headers["content-length"]&&(e.headers["content-length"]="0",delete e.headers["transfer-encoding"])}function rp(e,t,r){r.timeout&&e.socket.setTimeout(r.timeout)}function np(e,t,r){if(!r.xfwd)return;let n=Ao.hasEncryptedConnection(e),i={for:e.connection.remoteAddress||e.socket.remoteAddress,port:Ao.getPort(e),proto:n?"https":"http"};for(let s of["for","port","proto"])e.headers["x-forwarded-"+s]=(e.headers["x-forwarded-"+s]||"")+(e.headers["x-forwarded-"+s]?",":"")+i[s];e.headers["x-forwarded-host"]=e.headers["x-forwarded-host"]||e.headers.host||""}function op(e,t,r,n,i,s){i.emit("start",e,t,r.target||r.forward);let o=r.followRedirects?ZC:ty,a=o.http,u=o.https;if(r.forward){let m=r.forward.protocol==="https:"?u:a,f=Ao.setupOutgoing(r.ssl||{},r,e,"forward"),g=m.request(f),h=D(g,r.forward);if(e.on("error",h),g.on("error",h),(r.buffer||e).pipe(g),!r.target)return t.end()}let c=r.target.protocol==="https:"?u:a,l=Ao.setupOutgoing(r.ssl||{},r,e),p=c.request(l);p.on("socket",m=>{i&&!p.getHeader("expect")&&i.emit("proxyReq",p,e,t,r,m)}),r.proxyTimeout&&p.setTimeout(r.proxyTimeout,()=>{p.destroy()}),t.on("close",()=>{!t.writableFinished&&p.destroy()});let d=D(p,r.target);e.on("error",d),p.on("error",d);function D(m,f){return g=>{if(e.socket.destroyed&&g.code==="ECONNRESET"){i.emit("econnreset",g,e,t,f),m.destroy();return}s?s(g,e,t,f):i.emit("error",g,e,t,f)}}(r.buffer||e).pipe(p),p.on("response",m=>{if(i?.emit("proxyRes",m,e,t),!t.headersSent&&!r.selfHandleResponse)for(let f of ey)f(e,t,m,r);t.finished?i?.emit("end",e,t,m):(m.on("end",()=>{i?.emit("end",e,t,m)}),r.selfHandleResponse||m.pipe(t))})}Me.WEB_PASSES={deleteLength:tp,timeout:rp,XHeaders:np,stream:op}});var Ps=_(Pe=>{"use strict";var ry=Pe&&Pe.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),ny=Pe&&Pe.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),As=Pe&&Pe.__importStar||function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),i=0;i<n.length;i++)n[i]!=="default"&&ry(r,t,n[i]);return ny(r,t),r}}(),oy=Pe&&Pe.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Pe,"__esModule",{value:!0});Pe.WS_PASSES=void 0;Pe.numOpenSockets=uy;Pe.checkMethodAndHeader=ap;Pe.XHeaders=up;Pe.stream=cp;var iy=As(se("http")),sy=As(se("https")),Hr=As(En()),ay=oy(Fo()),Pn=(0,ay.default)("http-proxy-3:ws-incoming");function sp(e){let t=new Set;return({add:r,rm:n}={})=>(r&&(r.id||(r.id=Math.random()),t.has(r.id)||t.add(r.id)),n&&(n.id||(n.id=Math.random()),t.has(n.id)&&t.delete(n.id)),Pn("socket counter:",{[e]:t.size},r?"add":n?"rm":""),t.size)}var Ss=sp("socket"),Fs=sp("proxySocket");function uy(){return Ss()+Fs()}function ap(e,t){if(Pn("websocket: checkMethodAndHeader"),e.method!=="GET"||!e.headers.upgrade||e.headers.upgrade.toLowerCase()!=="websocket")return t.destroy(),!0}function up(e,t,r){if(!r.xfwd)return;Pn("websocket: XHeaders");let n={for:e.connection.remoteAddress||e.socket.remoteAddress,port:Hr.getPort(e),proto:Hr.hasEncryptedConnection(e)?"wss":"ws"};for(let i of["for","port","proto"])e.headers["x-forwarded-"+i]=(e.headers["x-forwarded-"+i]||"")+(e.headers["x-forwarded-"+i]?",":"")+n[i]}function cp(e,t,r,n,i,s){Pn("websocket: new stream");let o=[];Ss({add:t});let a=()=>{for(let D of o)D.end()};t.on("close",()=>{Ss({rm:t}),a()}),t.on("error",a);let u=(D,m)=>Object.keys(m).reduce((f,g)=>{let h=m[g];if(!Array.isArray(h))return f.push(g+": "+h),f;for(let E=0;E<h.length;E++)f.push(g+": "+h[E]);return f},[D]).join(`\r
|
|
20
20
|
`)+`\r
|
|
21
21
|
\r
|
|
22
|
-
`};Vr.setupSocket(r),i&&i.length&&r.unshift(i);var u=(Vr.isSSL.test(n.target.protocol)?Hy:Uy).request(Vr.setupOutgoing(n.ssl||{},n,t));return s&&s.emit("proxyReqWs",u,t,r,n,i),u.on("error",c),u.on("response",function(l){l.upgrade||(r.write(a("HTTP/"+l.httpVersion+" "+l.statusCode+" "+l.statusMessage,l.headers)),l.pipe(r))}),u.on("upgrade",function(l,p,d){p.on("error",c),p.on("end",function(){s.emit("close",l,p,d)}),r.on("error",function(){p.end()}),Vr.setupSocket(p),d&&d.length&&p.unshift(d),r.write(a("HTTP/1.1 101 Switching Protocols",l.headers)),p.pipe(r).pipe(p),s.emit("open",p),s.emit("proxySocket",p)}),u.end();function c(l){o?o(l,t,r):s.emit("error",l,t,r),r.end()}}}});var wp=B((GI,bp)=>{var yp=bp.exports,hp=z("util")._extend,Vy=z("url").parse,xp=Ll(),Ky=z("http"),Gy=z("https"),Dp=fp(),Cp=gp();yp.Server=gr;function Us(e){return function(t){return function(r,n){var i=e==="ws"?this.wsPasses:this.webPasses,s=[].slice.call(arguments),o=s.length-1,a,u;typeof s[o]=="function"&&(u=s[o],o--);var c=t;if(!(s[o]instanceof Buffer)&&s[o]!==n&&(c=hp({},t),hp(c,s[o]),o--),s[o]instanceof Buffer&&(a=s[o]),["target","forward"].forEach(function(p){typeof c[p]=="string"&&(c[p]=Vy(c[p]))}),!c.target&&!c.forward)return this.emit("error",new Error("Must provide a proper URL as target"));for(var l=0;l<i.length&&!i[l](r,n,c,a,this,u);l++);}}}yp.createRightProxy=Us;function gr(e){xp.call(this),e=e||{},e.prependPath=e.prependPath!==!1,this.web=this.proxyRequest=Us("web")(e),this.ws=this.proxyWebsocketRequest=Us("ws")(e),this.options=e,this.webPasses=Object.keys(Dp).map(function(t){return Dp[t]}),this.wsPasses=Object.keys(Cp).map(function(t){return Cp[t]}),this.on("error",this.onError,this)}z("util").inherits(gr,xp);gr.prototype.onError=function(e){if(this.listeners("error").length===1)throw e};gr.prototype.listen=function(e,t){var r=this,n=function(i,s){r.web(i,s)};return this._server=this.options.ssl?Gy.createServer(this.options.ssl,n):Ky.createServer(n),this.options.ws&&this._server.on("upgrade",function(i,s,o){r.ws(i,s,o)}),this._server.listen(e,t),this};gr.prototype.close=function(e){var t=this;this._server&&this._server.close(r);function r(){t._server=null,e&&e.apply(null,arguments)}};gr.prototype.before=function(e,t,r){if(e!=="ws"&&e!=="web")throw new Error("type must be `web` or `ws`");var n=e==="ws"?this.wsPasses:this.webPasses,i=!1;if(n.forEach(function(s,o){s.name===t&&(i=o)}),i===!1)throw new Error("No such pass");n.splice(i,0,r)};gr.prototype.after=function(e,t,r){if(e!=="ws"&&e!=="web")throw new Error("type must be `web` or `ws`");var n=e==="ws"?this.wsPasses:this.webPasses,i=!1;if(n.forEach(function(s,o){s.name===t&&(i=o)}),i===!1)throw new Error("No such pass");n.splice(i++,0,r)}});var Ep=B((WI,vp)=>{var Bn=wp().Server;function Hs(e){return new Bn(e)}Bn.createProxyServer=Hs;Bn.createServer=Hs;Bn.createProxy=Hs;vp.exports=Bn});var Fp=B((zI,Sp)=>{Sp.exports=Ep()});var $o=B((qI,Ap)=>{"use strict";Ap.exports=e=>{if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}});var No=B(_n=>{"use strict";Object.defineProperty(_n,"__esModule",{value:!0});_n.ERRORS=void 0;var Wy;(function(e){e.ERR_CONFIG_FACTORY_TARGET_MISSING='[HPM] Missing "target" option. Example: {target: "http://www.example.org"}',e.ERR_CONTEXT_MATCHER_GENERIC='[HPM] Invalid context. Expecting something like: "/api" or ["/api", "/ajax"]',e.ERR_CONTEXT_MATCHER_INVALID_ARRAY='[HPM] Invalid context. Expecting something like: ["/api", "/ajax"] or ["/api/**", "!**.html"]',e.ERR_PATH_REWRITER_CONFIG="[HPM] Invalid pathRewrite config. Expecting object with pathRewrite config or a rewrite function"})(Wy=_n.ERRORS||(_n.ERRORS={}))});var Gr=B(Kr=>{"use strict";Object.defineProperty(Kr,"__esModule",{value:!0});Kr.getArrow=Kr.getInstance=void 0;var zy=z("util"),Vs,Pp={log:console.log,debug:console.log,info:console.info,warn:console.warn,error:console.error},$n;(function(e){e[e.debug=10]="debug",e[e.info=20]="info",e[e.warn=30]="warn",e[e.error=50]="error",e[e.silent=80]="silent"})($n||($n={}));function qy(){return Vs||(Vs=new Ks),Vs}Kr.getInstance=qy;var Ks=class{constructor(){this.setLevel("info"),this.setProvider(()=>Pp)}log(){this.provider.log(this._interpolate.apply(null,arguments))}debug(){this._showLevel("debug")&&this.provider.debug(this._interpolate.apply(null,arguments))}info(){this._showLevel("info")&&this.provider.info(this._interpolate.apply(null,arguments))}warn(){this._showLevel("warn")&&this.provider.warn(this._interpolate.apply(null,arguments))}error(){this._showLevel("error")&&this.provider.error(this._interpolate.apply(null,arguments))}setLevel(t){this.isValidLevel(t)&&(this.logLevel=t)}setProvider(t){t&&this.isValidProvider(t)&&(this.provider=t(Pp))}isValidProvider(t){if(t&&typeof t!="function")throw new Error("[HPM] Log provider config error. Expecting a function.");return!0}isValidLevel(t){let n=Object.keys($n).includes(t);if(!n)throw new Error("[HPM] Log level error. Invalid logLevel.");return n}_showLevel(t){let r=!1,n=$n[this.logLevel];return n&&n<=$n[t]&&(r=!0),r}_interpolate(t,...r){return zy.format(t,...r)}};function Jy(e,t,r,n){let i=[">"],s=r!==n,o=e!==t;return o&&!s?i.unshift("~"):!o&&s?i.unshift("="):o&&s?i.unshift("\u2248"):i.unshift("-"),i.join("")}Kr.getArrow=Jy});var Ip=B(Oo=>{"use strict";Object.defineProperty(Oo,"__esModule",{value:!0});Oo.createConfig=void 0;var Yy=$o(),Rp=z("url"),Qy=No(),Xy=Gr(),Tp=(0,Xy.getInstance)();function Zy(e,t){let r={context:void 0,options:{}};if(tx(e,t))r.context="/",r.options=Object.assign(r.options,e);else if(ex(e)){let n=Rp.parse(e),i=[n.protocol,"//",n.host].join("");r.context=n.pathname||"/",r.options=Object.assign(r.options,{target:i},t),(n.protocol==="ws:"||n.protocol==="wss:")&&(r.options.ws=!0)}else r.context=e,r.options=Object.assign(r.options,t);if(rx(r.options),!r.options.target&&!r.options.router)throw new Error(Qy.ERRORS.ERR_CONFIG_FACTORY_TARGET_MISSING);return r}Oo.createConfig=Zy;function ex(e){if(typeof e=="string")return!!Rp.parse(e).host}function tx(e,t){return Yy(e)&&(t==null||Object.keys(t).length===0)}function rx(e){e.logLevel&&Tp.setLevel(e.logLevel),e.logProvider&&Tp.setProvider(e.logProvider)}});var Bp=B((XI,kp)=>{kp.exports=function(t){if(typeof t!="string"||t==="")return!1;for(var r;r=/(\\).|([@?!+*]\(.*\))/g.exec(t);){if(r[2])return!0;t=t.slice(r.index+r[0].length)}return!1}});var Np=B((ZI,$p)=>{var nx=Bp(),_p={"{":"}","(":")","[":"]"},ox=function(e){if(e[0]==="!")return!0;for(var t=0,r=-2,n=-2,i=-2,s=-2,o=-2;t<e.length;){if(e[t]==="*"||e[t+1]==="?"&&/[\].+)]/.test(e[t])||n!==-1&&e[t]==="["&&e[t+1]!=="]"&&(n<t&&(n=e.indexOf("]",t)),n>t&&(o===-1||o>n||(o=e.indexOf("\\",t),o===-1||o>n)))||i!==-1&&e[t]==="{"&&e[t+1]!=="}"&&(i=e.indexOf("}",t),i>t&&(o=e.indexOf("\\",t),o===-1||o>i))||s!==-1&&e[t]==="("&&e[t+1]==="?"&&/[:!=]/.test(e[t+2])&&e[t+3]!==")"&&(s=e.indexOf(")",t),s>t&&(o=e.indexOf("\\",t),o===-1||o>s))||r!==-1&&e[t]==="("&&e[t+1]!=="|"&&(r<t&&(r=e.indexOf("|",t)),r!==-1&&e[r+1]!==")"&&(s=e.indexOf(")",r),s>r&&(o=e.indexOf("\\",r),o===-1||o>s))))return!0;if(e[t]==="\\"){var a=e[t+1];t+=2;var u=_p[a];if(u){var c=e.indexOf(u,t);c!==-1&&(t=c+1)}if(e[t]==="!")return!0}else t++}return!1},ix=function(e){if(e[0]==="!")return!0;for(var t=0;t<e.length;){if(/[*?{}()[\]]/.test(e[t]))return!0;if(e[t]==="\\"){var r=e[t+1];t+=2;var n=_p[r];if(n){var i=e.indexOf(n,t);i!==-1&&(t=i+1)}if(e[t]==="!")return!0}else t++}return!1};$p.exports=function(t,r){if(typeof t!="string"||t==="")return!1;if(nx(t))return!0;var n=ox;return r&&r.strict===!1&&(n=ix),n(t)}});var Lo=B(ot=>{"use strict";ot.isInteger=e=>typeof e=="number"?Number.isInteger(e):typeof e=="string"&&e.trim()!==""?Number.isInteger(Number(e)):!1;ot.find=(e,t)=>e.nodes.find(r=>r.type===t);ot.exceedsLimit=(e,t,r=1,n)=>n===!1||!ot.isInteger(e)||!ot.isInteger(t)?!1:(Number(t)-Number(e))/Number(r)>=n;ot.escapeNode=(e,t=0,r)=>{let n=e.nodes[t];n&&(r&&n.type===r||n.type==="open"||n.type==="close")&&n.escaped!==!0&&(n.value="\\"+n.value,n.escaped=!0)};ot.encloseBrace=e=>e.type!=="brace"||e.commas>>0+e.ranges>>0?!1:(e.invalid=!0,!0);ot.isInvalidBrace=e=>e.type!=="brace"?!1:e.invalid===!0||e.dollar?!0:!(e.commas>>0+e.ranges>>0)||e.open!==!0||e.close!==!0?(e.invalid=!0,!0):!1;ot.isOpenOrClose=e=>e.type==="open"||e.type==="close"?!0:e.open===!0||e.close===!0;ot.reduce=e=>e.reduce((t,r)=>(r.type==="text"&&t.push(r.value),r.type==="range"&&(r.type="text"),t),[]);ot.flatten=(...e)=>{let t=[],r=n=>{for(let i=0;i<n.length;i++){let s=n[i];if(Array.isArray(s)){r(s);continue}s!==void 0&&t.push(s)}return t};return r(e),t}});var Mo=B((t2,Lp)=>{"use strict";var Op=Lo();Lp.exports=(e,t={})=>{let r=(n,i={})=>{let s=t.escapeInvalid&&Op.isInvalidBrace(i),o=n.invalid===!0&&t.escapeInvalid===!0,a="";if(n.value)return(s||o)&&Op.isOpenOrClose(n)?"\\"+n.value:n.value;if(n.value)return n.value;if(n.nodes)for(let u of n.nodes)a+=r(u);return a};return r(e)}});var jp=B((r2,Mp)=>{"use strict";Mp.exports=function(e){return typeof e=="number"?e-e===0:typeof e=="string"&&e.trim()!==""?Number.isFinite?Number.isFinite(+e):isFinite(+e):!1}});var Jp=B((n2,qp)=>{"use strict";var Up=jp(),hr=(e,t,r)=>{if(Up(e)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(t===void 0||e===t)return String(e);if(Up(t)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let n={relaxZeros:!0,...r};typeof n.strictZeros=="boolean"&&(n.relaxZeros=n.strictZeros===!1);let i=String(n.relaxZeros),s=String(n.shorthand),o=String(n.capture),a=String(n.wrap),u=e+":"+t+"="+i+s+o+a;if(hr.cache.hasOwnProperty(u))return hr.cache[u].result;let c=Math.min(e,t),l=Math.max(e,t);if(Math.abs(c-l)===1){let f=e+"|"+t;return n.capture?`(${f})`:n.wrap===!1?f:`(?:${f})`}let p=zp(e)||zp(t),d={min:e,max:t,a:c,b:l},g=[],m=[];if(p&&(d.isPadded=p,d.maxLen=String(d.max).length),c<0){let f=l<0?Math.abs(l):1;m=Hp(f,Math.abs(c),d,n),c=d.a=0}return l>=0&&(g=Hp(c,l,d,n)),d.negatives=m,d.positives=g,d.result=sx(m,g,n),n.capture===!0?d.result=`(${d.result})`:n.wrap!==!1&&g.length+m.length>1&&(d.result=`(?:${d.result})`),hr.cache[u]=d,d.result};function sx(e,t,r){let n=Gs(e,t,"-",!1,r)||[],i=Gs(t,e,"",!1,r)||[],s=Gs(e,t,"-?",!0,r)||[];return n.concat(s).concat(i).join("|")}function ax(e,t){let r=1,n=1,i=Kp(e,r),s=new Set([t]);for(;e<=i&&i<=t;)s.add(i),r+=1,i=Kp(e,r);for(i=Gp(t+1,n)-1;e<i&&i<=t;)s.add(i),n+=1,i=Gp(t+1,n)-1;return s=[...s],s.sort(lx),s}function ux(e,t,r){if(e===t)return{pattern:e,count:[],digits:0};let n=cx(e,t),i=n.length,s="",o=0;for(let a=0;a<i;a++){let[u,c]=n[a];u===c?s+=u:u!=="0"||c!=="9"?s+=px(u,c,r):o++}return o&&(s+=r.shorthand===!0?"\\d":"[0-9]"),{pattern:s,count:[o],digits:i}}function Hp(e,t,r,n){let i=ax(e,t),s=[],o=e,a;for(let u=0;u<i.length;u++){let c=i[u],l=ux(String(o),String(c),n),p="";if(!r.isPadded&&a&&a.pattern===l.pattern){a.count.length>1&&a.count.pop(),a.count.push(l.count[0]),a.string=a.pattern+Wp(a.count),o=c+1;continue}r.isPadded&&(p=dx(c,r,n)),l.string=p+l.pattern+Wp(l.count),s.push(l),o=c+1,a=l}return s}function Gs(e,t,r,n,i){let s=[];for(let o of e){let{string:a}=o;!n&&!Vp(t,"string",a)&&s.push(r+a),n&&Vp(t,"string",a)&&s.push(r+a)}return s}function cx(e,t){let r=[];for(let n=0;n<e.length;n++)r.push([e[n],t[n]]);return r}function lx(e,t){return e>t?1:t>e?-1:0}function Vp(e,t,r){return e.some(n=>n[t]===r)}function Kp(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function Gp(e,t){return e-e%Math.pow(10,t)}function Wp(e){let[t=0,r=""]=e;return r||t>1?`{${t+(r?","+r:"")}}`:""}function px(e,t,r){return`[${e}${t-e===1?"":"-"}${t}]`}function zp(e){return/^-?(0+)\d/.test(e)}function dx(e,t,r){if(!t.isPadded)return e;let n=Math.abs(t.maxLen-String(e).length),i=r.relaxZeros!==!1;switch(n){case 0:return"";case 1:return i?"0?":"0";case 2:return i?"0{0,2}":"00";default:return i?`0{0,${n}}`:`0{${n}}`}}hr.cache={};hr.clearCache=()=>hr.cache={};qp.exports=hr});var qs=B((o2,rd)=>{"use strict";var fx=z("util"),Qp=Jp(),Yp=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),mx=e=>t=>e===!0?Number(t):String(t),Ws=e=>typeof e=="number"||typeof e=="string"&&e!=="",Nn=e=>Number.isInteger(+e),zs=e=>{let t=`${e}`,r=-1;if(t[0]==="-"&&(t=t.slice(1)),t==="0")return!1;for(;t[++r]==="0";);return r>0},gx=(e,t,r)=>typeof e=="string"||typeof t=="string"?!0:r.stringify===!0,hx=(e,t,r)=>{if(t>0){let n=e[0]==="-"?"-":"";n&&(e=e.slice(1)),e=n+e.padStart(n?t-1:t,"0")}return r===!1?String(e):e},Uo=(e,t)=>{let r=e[0]==="-"?"-":"";for(r&&(e=e.slice(1),t--);e.length<t;)e="0"+e;return r?"-"+e:e},Dx=(e,t,r)=>{e.negatives.sort((a,u)=>a<u?-1:a>u?1:0),e.positives.sort((a,u)=>a<u?-1:a>u?1:0);let n=t.capture?"":"?:",i="",s="",o;return e.positives.length&&(i=e.positives.map(a=>Uo(String(a),r)).join("|")),e.negatives.length&&(s=`-(${n}${e.negatives.map(a=>Uo(String(a),r)).join("|")})`),i&&s?o=`${i}|${s}`:o=i||s,t.wrap?`(${n}${o})`:o},Xp=(e,t,r,n)=>{if(r)return Qp(e,t,{wrap:!1,...n});let i=String.fromCharCode(e);if(e===t)return i;let s=String.fromCharCode(t);return`[${i}-${s}]`},Zp=(e,t,r)=>{if(Array.isArray(e)){let n=r.wrap===!0,i=r.capture?"":"?:";return n?`(${i}${e.join("|")})`:e.join("|")}return Qp(e,t,r)},ed=(...e)=>new RangeError("Invalid range arguments: "+fx.inspect(...e)),td=(e,t,r)=>{if(r.strictRanges===!0)throw ed([e,t]);return[]},Cx=(e,t)=>{if(t.strictRanges===!0)throw new TypeError(`Expected step "${e}" to be a number`);return[]},yx=(e,t,r=1,n={})=>{let i=Number(e),s=Number(t);if(!Number.isInteger(i)||!Number.isInteger(s)){if(n.strictRanges===!0)throw ed([e,t]);return[]}i===0&&(i=0),s===0&&(s=0);let o=i>s,a=String(e),u=String(t),c=String(r);r=Math.max(Math.abs(r),1);let l=zs(a)||zs(u)||zs(c),p=l?Math.max(a.length,u.length,c.length):0,d=l===!1&&gx(e,t,n)===!1,g=n.transform||mx(d);if(n.toRegex&&r===1)return Xp(Uo(e,p),Uo(t,p),!0,n);let m={negatives:[],positives:[]},f=v=>m[v<0?"negatives":"positives"].push(Math.abs(v)),h=[],D=0;for(;o?i>=s:i<=s;)n.toRegex===!0&&r>1?f(i):h.push(hx(g(i,D),p,d)),i=o?i-r:i+r,D++;return n.toRegex===!0?r>1?Dx(m,n,p):Zp(h,null,{wrap:!1,...n}):h},xx=(e,t,r=1,n={})=>{if(!Nn(e)&&e.length>1||!Nn(t)&&t.length>1)return td(e,t,n);let i=n.transform||(d=>String.fromCharCode(d)),s=`${e}`.charCodeAt(0),o=`${t}`.charCodeAt(0),a=s>o,u=Math.min(s,o),c=Math.max(s,o);if(n.toRegex&&r===1)return Xp(u,c,!1,n);let l=[],p=0;for(;a?s>=o:s<=o;)l.push(i(s,p)),s=a?s-r:s+r,p++;return n.toRegex===!0?Zp(l,null,{wrap:!1,options:n}):l},jo=(e,t,r,n={})=>{if(t==null&&Ws(e))return[e];if(!Ws(e)||!Ws(t))return td(e,t,n);if(typeof r=="function")return jo(e,t,1,{transform:r});if(Yp(r))return jo(e,t,0,r);let i={...n};return i.capture===!0&&(i.wrap=!0),r=r||i.step||1,Nn(r)?Nn(e)&&Nn(t)?yx(e,t,r,i):xx(e,t,Math.max(Math.abs(r),1),i):r!=null&&!Yp(r)?Cx(r,i):jo(e,t,1,r)};rd.exports=jo});var id=B((i2,od)=>{"use strict";var bx=qs(),nd=Lo(),wx=(e,t={})=>{let r=(n,i={})=>{let s=nd.isInvalidBrace(i),o=n.invalid===!0&&t.escapeInvalid===!0,a=s===!0||o===!0,u=t.escapeInvalid===!0?"\\":"",c="";if(n.isOpen===!0)return u+n.value;if(n.isClose===!0)return console.log("node.isClose",u,n.value),u+n.value;if(n.type==="open")return a?u+n.value:"(";if(n.type==="close")return a?u+n.value:")";if(n.type==="comma")return n.prev.type==="comma"?"":a?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let l=nd.reduce(n.nodes),p=bx(...l,{...t,wrap:!1,toRegex:!0,strictZeros:!0});if(p.length!==0)return l.length>1&&p.length>1?`(${p})`:p}if(n.nodes)for(let l of n.nodes)c+=r(l,n);return c};return r(e)};od.exports=wx});var ud=B((s2,ad)=>{"use strict";var vx=qs(),sd=Mo(),Wr=Lo(),Dr=(e="",t="",r=!1)=>{let n=[];if(e=[].concat(e),t=[].concat(t),!t.length)return e;if(!e.length)return r?Wr.flatten(t).map(i=>`{${i}}`):t;for(let i of e)if(Array.isArray(i))for(let s of i)n.push(Dr(s,t,r));else for(let s of t)r===!0&&typeof s=="string"&&(s=`{${s}}`),n.push(Array.isArray(s)?Dr(i,s,r):i+s);return Wr.flatten(n)},Ex=(e,t={})=>{let r=t.rangeLimit===void 0?1e3:t.rangeLimit,n=(i,s={})=>{i.queue=[];let o=s,a=s.queue;for(;o.type!=="brace"&&o.type!=="root"&&o.parent;)o=o.parent,a=o.queue;if(i.invalid||i.dollar){a.push(Dr(a.pop(),sd(i,t)));return}if(i.type==="brace"&&i.invalid!==!0&&i.nodes.length===2){a.push(Dr(a.pop(),["{}"]));return}if(i.nodes&&i.ranges>0){let p=Wr.reduce(i.nodes);if(Wr.exceedsLimit(...p,t.step,r))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let d=vx(...p,t);d.length===0&&(d=sd(i,t)),a.push(Dr(a.pop(),d)),i.nodes=[];return}let u=Wr.encloseBrace(i),c=i.queue,l=i;for(;l.type!=="brace"&&l.type!=="root"&&l.parent;)l=l.parent,c=l.queue;for(let p=0;p<i.nodes.length;p++){let d=i.nodes[p];if(d.type==="comma"&&i.type==="brace"){p===1&&c.push(""),c.push("");continue}if(d.type==="close"){a.push(Dr(a.pop(),c,u));continue}if(d.value&&d.type!=="open"){c.push(Dr(c.pop(),d.value));continue}d.nodes&&n(d,i)}return c};return Wr.flatten(n(e))};ad.exports=Ex});var ld=B((a2,cd)=>{"use strict";cd.exports={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
|
|
23
|
-
`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var gd=B((u2,md)=>{"use strict";var Sx=Mo(),{MAX_LENGTH:pd,CHAR_BACKSLASH:Js,CHAR_BACKTICK:Fx,CHAR_COMMA:Ax,CHAR_DOT:Px,CHAR_LEFT_PARENTHESES:Tx,CHAR_RIGHT_PARENTHESES:Rx,CHAR_LEFT_CURLY_BRACE:Ix,CHAR_RIGHT_CURLY_BRACE:kx,CHAR_LEFT_SQUARE_BRACKET:dd,CHAR_RIGHT_SQUARE_BRACKET:fd,CHAR_DOUBLE_QUOTE:Bx,CHAR_SINGLE_QUOTE:_x,CHAR_NO_BREAK_SPACE:$x,CHAR_ZERO_WIDTH_NOBREAK_SPACE:Nx}=ld(),Ox=(e,t={})=>{if(typeof e!="string")throw new TypeError("Expected a string");let r=t||{},n=typeof r.maxLength=="number"?Math.min(pd,r.maxLength):pd;if(e.length>n)throw new SyntaxError(`Input length (${e.length}), exceeds max characters (${n})`);let i={type:"root",input:e,nodes:[]},s=[i],o=i,a=i,u=0,c=e.length,l=0,p=0,d,g=()=>e[l++],m=f=>{if(f.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&f.type==="text"){a.value+=f.value;return}return o.nodes.push(f),f.parent=o,f.prev=a,a=f,f};for(m({type:"bos"});l<c;)if(o=s[s.length-1],d=g(),!(d===Nx||d===$x)){if(d===Js){m({type:"text",value:(t.keepEscaping?d:"")+g()});continue}if(d===fd){m({type:"text",value:"\\"+d});continue}if(d===dd){u++;let f;for(;l<c&&(f=g());){if(d+=f,f===dd){u++;continue}if(f===Js){d+=g();continue}if(f===fd&&(u--,u===0))break}m({type:"text",value:d});continue}if(d===Tx){o=m({type:"paren",nodes:[]}),s.push(o),m({type:"text",value:d});continue}if(d===Rx){if(o.type!=="paren"){m({type:"text",value:d});continue}o=s.pop(),m({type:"text",value:d}),o=s[s.length-1];continue}if(d===Bx||d===_x||d===Fx){let f=d,h;for(t.keepQuotes!==!0&&(d="");l<c&&(h=g());){if(h===Js){d+=h+g();continue}if(h===f){t.keepQuotes===!0&&(d+=h);break}d+=h}m({type:"text",value:d});continue}if(d===Ix){p++;let h={type:"brace",open:!0,close:!1,dollar:a.value&&a.value.slice(-1)==="$"||o.dollar===!0,depth:p,commas:0,ranges:0,nodes:[]};o=m(h),s.push(o),m({type:"open",value:d});continue}if(d===kx){if(o.type!=="brace"){m({type:"text",value:d});continue}let f="close";o=s.pop(),o.close=!0,m({type:f,value:d}),p--,o=s[s.length-1];continue}if(d===Ax&&p>0){if(o.ranges>0){o.ranges=0;let f=o.nodes.shift();o.nodes=[f,{type:"text",value:Sx(o)}]}m({type:"comma",value:d}),o.commas++;continue}if(d===Px&&p>0&&o.commas===0){let f=o.nodes;if(p===0||f.length===0){m({type:"text",value:d});continue}if(a.type==="dot"){if(o.range=[],a.value+=d,a.type="range",o.nodes.length!==3&&o.nodes.length!==5){o.invalid=!0,o.ranges=0,a.type="text";continue}o.ranges++,o.args=[];continue}if(a.type==="range"){f.pop();let h=f[f.length-1];h.value+=a.value+d,a=h,o.ranges--;continue}m({type:"dot",value:d});continue}m({type:"text",value:d})}do if(o=s.pop(),o.type!=="root"){o.nodes.forEach(D=>{D.nodes||(D.type==="open"&&(D.isOpen=!0),D.type==="close"&&(D.isClose=!0),D.nodes||(D.type="text"),D.invalid=!0)});let f=s[s.length-1],h=f.nodes.indexOf(o);f.nodes.splice(h,1,...o.nodes)}while(s.length>0);return m({type:"eos"}),i};md.exports=Ox});var Cd=B((c2,Dd)=>{"use strict";var hd=Mo(),Lx=id(),Mx=ud(),jx=gd(),qe=(e,t={})=>{let r=[];if(Array.isArray(e))for(let n of e){let i=qe.create(n,t);Array.isArray(i)?r.push(...i):r.push(i)}else r=[].concat(qe.create(e,t));return t&&t.expand===!0&&t.nodupes===!0&&(r=[...new Set(r)]),r};qe.parse=(e,t={})=>jx(e,t);qe.stringify=(e,t={})=>hd(typeof e=="string"?qe.parse(e,t):e,t);qe.compile=(e,t={})=>(typeof e=="string"&&(e=qe.parse(e,t)),Lx(e,t));qe.expand=(e,t={})=>{typeof e=="string"&&(e=qe.parse(e,t));let r=Mx(e,t);return t.noempty===!0&&(r=r.filter(Boolean)),t.nodupes===!0&&(r=[...new Set(r)]),r};qe.create=(e,t={})=>e===""||e.length<3?[e]:t.expand!==!0?qe.compile(e,t):qe.expand(e,t);Dd.exports=qe});var On=B((l2,vd)=>{"use strict";var Ux=z("path"),At="\\\\/",yd=`[^${At}]`,jt="\\.",Hx="\\+",Vx="\\?",Ho="\\/",Kx="(?=.)",xd="[^/]",Ys=`(?:${Ho}|$)`,bd=`(?:^|${Ho})`,Qs=`${jt}{1,2}${Ys}`,Gx=`(?!${jt})`,Wx=`(?!${bd}${Qs})`,zx=`(?!${jt}{0,1}${Ys})`,qx=`(?!${Qs})`,Jx=`[^.${Ho}]`,Yx=`${xd}*?`,wd={DOT_LITERAL:jt,PLUS_LITERAL:Hx,QMARK_LITERAL:Vx,SLASH_LITERAL:Ho,ONE_CHAR:Kx,QMARK:xd,END_ANCHOR:Ys,DOTS_SLASH:Qs,NO_DOT:Gx,NO_DOTS:Wx,NO_DOT_SLASH:zx,NO_DOTS_SLASH:qx,QMARK_NO_DOT:Jx,STAR:Yx,START_ANCHOR:bd},Qx={...wd,SLASH_LITERAL:`[${At}]`,QMARK:yd,STAR:`${yd}*?`,DOTS_SLASH:`${jt}{1,2}(?:[${At}]|$)`,NO_DOT:`(?!${jt})`,NO_DOTS:`(?!(?:^|[${At}])${jt}{1,2}(?:[${At}]|$))`,NO_DOT_SLASH:`(?!${jt}{0,1}(?:[${At}]|$))`,NO_DOTS_SLASH:`(?!${jt}{1,2}(?:[${At}]|$))`,QMARK_NO_DOT:`[^.${At}]`,START_ANCHOR:`(?:^|[${At}])`,END_ANCHOR:`(?:[${At}]|$)`},Xx={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};vd.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:Xx,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:Ux.sep,extglobChars(e){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(e){return e===!0?Qx:wd}}});var Ln=B(Le=>{"use strict";var Zx=z("path"),e0=process.platform==="win32",{REGEX_BACKSLASH:t0,REGEX_REMOVE_BACKSLASH:r0,REGEX_SPECIAL_CHARS:n0,REGEX_SPECIAL_CHARS_GLOBAL:o0}=On();Le.isObject=e=>e!==null&&typeof e=="object"&&!Array.isArray(e);Le.hasRegexChars=e=>n0.test(e);Le.isRegexChar=e=>e.length===1&&Le.hasRegexChars(e);Le.escapeRegex=e=>e.replace(o0,"\\$1");Le.toPosixSlashes=e=>e.replace(t0,"/");Le.removeBackslashes=e=>e.replace(r0,t=>t==="\\"?"":t);Le.supportsLookbehinds=()=>{let e=process.version.slice(1).split(".").map(Number);return e.length===3&&e[0]>=9||e[0]===8&&e[1]>=10};Le.isWindows=e=>e&&typeof e.windows=="boolean"?e.windows:e0===!0||Zx.sep==="\\";Le.escapeLast=(e,t,r)=>{let n=e.lastIndexOf(t,r);return n===-1?e:e[n-1]==="\\"?Le.escapeLast(e,t,n-1):`${e.slice(0,n)}\\${e.slice(n)}`};Le.removePrefix=(e,t={})=>{let r=e;return r.startsWith("./")&&(r=r.slice(2),t.prefix="./"),r};Le.wrapOutput=(e,t={},r={})=>{let n=r.contains?"":"^",i=r.contains?"":"$",s=`${n}(?:${e})${i}`;return t.negated===!0&&(s=`(?:^(?!${s}).*$)`),s}});var Id=B((d2,Rd)=>{"use strict";var Ed=Ln(),{CHAR_ASTERISK:Xs,CHAR_AT:i0,CHAR_BACKWARD_SLASH:Mn,CHAR_COMMA:s0,CHAR_DOT:Zs,CHAR_EXCLAMATION_MARK:ea,CHAR_FORWARD_SLASH:Td,CHAR_LEFT_CURLY_BRACE:ta,CHAR_LEFT_PARENTHESES:ra,CHAR_LEFT_SQUARE_BRACKET:a0,CHAR_PLUS:u0,CHAR_QUESTION_MARK:Sd,CHAR_RIGHT_CURLY_BRACE:c0,CHAR_RIGHT_PARENTHESES:Fd,CHAR_RIGHT_SQUARE_BRACKET:l0}=On(),Ad=e=>e===Td||e===Mn,Pd=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)},p0=(e,t)=>{let r=t||{},n=e.length-1,i=r.parts===!0||r.scanToEnd===!0,s=[],o=[],a=[],u=e,c=-1,l=0,p=0,d=!1,g=!1,m=!1,f=!1,h=!1,D=!1,v=!1,E=!1,P=!1,A=!1,F=0,T,k,I={value:"",depth:0,isGlob:!1},S=()=>c>=n,C=()=>u.charCodeAt(c+1),$=()=>(T=k,u.charCodeAt(++c));for(;c<n;){k=$();let ue;if(k===Mn){v=I.backslashes=!0,k=$(),k===ta&&(D=!0);continue}if(D===!0||k===ta){for(F++;S()!==!0&&(k=$());){if(k===Mn){v=I.backslashes=!0,$();continue}if(k===ta){F++;continue}if(D!==!0&&k===Zs&&(k=$())===Zs){if(d=I.isBrace=!0,m=I.isGlob=!0,A=!0,i===!0)continue;break}if(D!==!0&&k===s0){if(d=I.isBrace=!0,m=I.isGlob=!0,A=!0,i===!0)continue;break}if(k===c0&&(F--,F===0)){D=!1,d=I.isBrace=!0,A=!0;break}}if(i===!0)continue;break}if(k===Td){if(s.push(c),o.push(I),I={value:"",depth:0,isGlob:!1},A===!0)continue;if(T===Zs&&c===l+1){l+=2;continue}p=c+1;continue}if(r.noext!==!0&&(k===u0||k===i0||k===Xs||k===Sd||k===ea)===!0&&C()===ra){if(m=I.isGlob=!0,f=I.isExtglob=!0,A=!0,k===ea&&c===l&&(P=!0),i===!0){for(;S()!==!0&&(k=$());){if(k===Mn){v=I.backslashes=!0,k=$();continue}if(k===Fd){m=I.isGlob=!0,A=!0;break}}continue}break}if(k===Xs){if(T===Xs&&(h=I.isGlobstar=!0),m=I.isGlob=!0,A=!0,i===!0)continue;break}if(k===Sd){if(m=I.isGlob=!0,A=!0,i===!0)continue;break}if(k===a0){for(;S()!==!0&&(ue=$());){if(ue===Mn){v=I.backslashes=!0,$();continue}if(ue===l0){g=I.isBracket=!0,m=I.isGlob=!0,A=!0;break}}if(i===!0)continue;break}if(r.nonegate!==!0&&k===ea&&c===l){E=I.negated=!0,l++;continue}if(r.noparen!==!0&&k===ra){if(m=I.isGlob=!0,i===!0){for(;S()!==!0&&(k=$());){if(k===ra){v=I.backslashes=!0,k=$();continue}if(k===Fd){A=!0;break}}continue}break}if(m===!0){if(A=!0,i===!0)continue;break}}r.noext===!0&&(f=!1,m=!1);let O=u,L="",y="";l>0&&(L=u.slice(0,l),u=u.slice(l),p-=l),O&&m===!0&&p>0?(O=u.slice(0,p),y=u.slice(p)):m===!0?(O="",y=u):O=u,O&&O!==""&&O!=="/"&&O!==u&&Ad(O.charCodeAt(O.length-1))&&(O=O.slice(0,-1)),r.unescape===!0&&(y&&(y=Ed.removeBackslashes(y)),O&&v===!0&&(O=Ed.removeBackslashes(O)));let x={prefix:L,input:e,start:l,base:O,glob:y,isBrace:d,isBracket:g,isGlob:m,isExtglob:f,isGlobstar:h,negated:E,negatedExtglob:P};if(r.tokens===!0&&(x.maxDepth=0,Ad(k)||o.push(I),x.tokens=o),r.parts===!0||r.tokens===!0){let ue;for(let J=0;J<s.length;J++){let dt=ue?ue+1:l,ft=s[J],Me=e.slice(dt,ft);r.tokens&&(J===0&&l!==0?(o[J].isPrefix=!0,o[J].value=L):o[J].value=Me,Pd(o[J]),x.maxDepth+=o[J].depth),(J!==0||Me!=="")&&a.push(Me),ue=ft}if(ue&&ue+1<e.length){let J=e.slice(ue+1);a.push(J),r.tokens&&(o[o.length-1].value=J,Pd(o[o.length-1]),x.maxDepth+=o[o.length-1].depth)}x.slashes=s,x.parts=a}return x};Rd.exports=p0});var _d=B((f2,Bd)=>{"use strict";var Vo=On(),Je=Ln(),{MAX_LENGTH:Ko,POSIX_REGEX_SOURCE:d0,REGEX_NON_SPECIAL_CHARS:f0,REGEX_SPECIAL_CHARS_BACKREF:m0,REPLACEMENTS:kd}=Vo,g0=(e,t)=>{if(typeof t.expandRange=="function")return t.expandRange(...e,t);e.sort();let r=`[${e.join("-")}]`;try{new RegExp(r)}catch{return e.map(i=>Je.escapeRegex(i)).join("..")}return r},zr=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,na=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");e=kd[e]||e;let r={...t},n=typeof r.maxLength=="number"?Math.min(Ko,r.maxLength):Ko,i=e.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);let s={type:"bos",value:"",output:r.prepend||""},o=[s],a=r.capture?"":"?:",u=Je.isWindows(t),c=Vo.globChars(u),l=Vo.extglobChars(c),{DOT_LITERAL:p,PLUS_LITERAL:d,SLASH_LITERAL:g,ONE_CHAR:m,DOTS_SLASH:f,NO_DOT:h,NO_DOT_SLASH:D,NO_DOTS_SLASH:v,QMARK:E,QMARK_NO_DOT:P,STAR:A,START_ANCHOR:F}=c,T=_=>`(${a}(?:(?!${F}${_.dot?f:p}).)*?)`,k=r.dot?"":h,I=r.dot?E:P,S=r.bash===!0?T(r):A;r.capture&&(S=`(${S})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let C={input:e,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:o};e=Je.removePrefix(e,C),i=e.length;let $=[],O=[],L=[],y=s,x,ue=()=>C.index===i-1,J=C.peek=(_=1)=>e[C.index+_],dt=C.advance=()=>e[++C.index]||"",ft=()=>e.slice(C.index+1),Me=(_="",ne=0)=>{C.consumed+=_,C.index+=ne},Un=_=>{C.output+=_.output!=null?_.output:_.value,Me(_.value)},Kf=()=>{let _=1;for(;J()==="!"&&(J(2)!=="("||J(3)==="?");)dt(),C.start++,_++;return _%2===0?!1:(C.negated=!0,C.start++,!0)},Hn=_=>{C[_]++,L.push(_)},Qt=_=>{C[_]--,L.pop()},V=_=>{if(y.type==="globstar"){let ne=C.braces>0&&(_.type==="comma"||_.type==="brace"),R=_.extglob===!0||$.length&&(_.type==="pipe"||_.type==="paren");_.type!=="slash"&&_.type!=="paren"&&!ne&&!R&&(C.output=C.output.slice(0,-y.output.length),y.type="star",y.value="*",y.output=S,C.output+=y.output)}if($.length&&_.type!=="paren"&&($[$.length-1].inner+=_.value),(_.value||_.output)&&Un(_),y&&y.type==="text"&&_.type==="text"){y.value+=_.value,y.output=(y.output||"")+_.value;return}_.prev=y,o.push(_),y=_},Vn=(_,ne)=>{let R={...l[ne],conditions:1,inner:""};R.prev=y,R.parens=C.parens,R.output=C.output;let H=(r.capture?"(":"")+R.open;Hn("parens"),V({type:_,value:ne,output:C.output?"":m}),V({type:"paren",extglob:!0,value:dt(),output:H}),$.push(R)},Gf=_=>{let ne=_.close+(r.capture?")":""),R;if(_.type==="negate"){let H=S;if(_.inner&&_.inner.length>1&&_.inner.includes("/")&&(H=T(r)),(H!==S||ue()||/^\)+$/.test(ft()))&&(ne=_.close=`)$))${H}`),_.inner.includes("*")&&(R=ft())&&/^\.[^\\/.]+$/.test(R)){let ce=na(R,{...t,fastpaths:!1}).output;ne=_.close=`)${ce})${H})`}_.prev.type==="bos"&&(C.negatedExtglob=!0)}V({type:"paren",extglob:!0,value:x,output:ne}),Qt("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let _=!1,ne=e.replace(m0,(R,H,ce,Pe,me,ti)=>Pe==="\\"?(_=!0,R):Pe==="?"?H?H+Pe+(me?E.repeat(me.length):""):ti===0?I+(me?E.repeat(me.length):""):E.repeat(ce.length):Pe==="."?p.repeat(ce.length):Pe==="*"?H?H+Pe+(me?S:""):S:H?R:`\\${R}`);return _===!0&&(r.unescape===!0?ne=ne.replace(/\\/g,""):ne=ne.replace(/\\+/g,R=>R.length%2===0?"\\\\":R?"\\":"")),ne===e&&r.contains===!0?(C.output=e,C):(C.output=Je.wrapOutput(ne,C,t),C)}for(;!ue();){if(x=dt(),x==="\0")continue;if(x==="\\"){let R=J();if(R==="/"&&r.bash!==!0||R==="."||R===";")continue;if(!R){x+="\\",V({type:"text",value:x});continue}let H=/^\\+/.exec(ft()),ce=0;if(H&&H[0].length>2&&(ce=H[0].length,C.index+=ce,ce%2!==0&&(x+="\\")),r.unescape===!0?x=dt():x+=dt(),C.brackets===0){V({type:"text",value:x});continue}}if(C.brackets>0&&(x!=="]"||y.value==="["||y.value==="[^")){if(r.posix!==!1&&x===":"){let R=y.value.slice(1);if(R.includes("[")&&(y.posix=!0,R.includes(":"))){let H=y.value.lastIndexOf("["),ce=y.value.slice(0,H),Pe=y.value.slice(H+2),me=d0[Pe];if(me){y.value=ce+me,C.backtrack=!0,dt(),!s.output&&o.indexOf(y)===1&&(s.output=m);continue}}}(x==="["&&J()!==":"||x==="-"&&J()==="]")&&(x=`\\${x}`),x==="]"&&(y.value==="["||y.value==="[^")&&(x=`\\${x}`),r.posix===!0&&x==="!"&&y.value==="["&&(x="^"),y.value+=x,Un({value:x});continue}if(C.quotes===1&&x!=='"'){x=Je.escapeRegex(x),y.value+=x,Un({value:x});continue}if(x==='"'){C.quotes=C.quotes===1?0:1,r.keepQuotes===!0&&V({type:"text",value:x});continue}if(x==="("){Hn("parens"),V({type:"paren",value:x});continue}if(x===")"){if(C.parens===0&&r.strictBrackets===!0)throw new SyntaxError(zr("opening","("));let R=$[$.length-1];if(R&&C.parens===R.parens+1){Gf($.pop());continue}V({type:"paren",value:x,output:C.parens?")":"\\)"}),Qt("parens");continue}if(x==="["){if(r.nobracket===!0||!ft().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(zr("closing","]"));x=`\\${x}`}else Hn("brackets");V({type:"bracket",value:x});continue}if(x==="]"){if(r.nobracket===!0||y&&y.type==="bracket"&&y.value.length===1){V({type:"text",value:x,output:`\\${x}`});continue}if(C.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(zr("opening","["));V({type:"text",value:x,output:`\\${x}`});continue}Qt("brackets");let R=y.value.slice(1);if(y.posix!==!0&&R[0]==="^"&&!R.includes("/")&&(x=`/${x}`),y.value+=x,Un({value:x}),r.literalBrackets===!1||Je.hasRegexChars(R))continue;let H=Je.escapeRegex(y.value);if(C.output=C.output.slice(0,-y.value.length),r.literalBrackets===!0){C.output+=H,y.value=H;continue}y.value=`(${a}${H}|${y.value})`,C.output+=y.value;continue}if(x==="{"&&r.nobrace!==!0){Hn("braces");let R={type:"brace",value:x,output:"(",outputIndex:C.output.length,tokensIndex:C.tokens.length};O.push(R),V(R);continue}if(x==="}"){let R=O[O.length-1];if(r.nobrace===!0||!R){V({type:"text",value:x,output:x});continue}let H=")";if(R.dots===!0){let ce=o.slice(),Pe=[];for(let me=ce.length-1;me>=0&&(o.pop(),ce[me].type!=="brace");me--)ce[me].type!=="dots"&&Pe.unshift(ce[me].value);H=g0(Pe,r),C.backtrack=!0}if(R.comma!==!0&&R.dots!==!0){let ce=C.output.slice(0,R.outputIndex),Pe=C.tokens.slice(R.tokensIndex);R.value=R.output="\\{",x=H="\\}",C.output=ce;for(let me of Pe)C.output+=me.output||me.value}V({type:"brace",value:x,output:H}),Qt("braces"),O.pop();continue}if(x==="|"){$.length>0&&$[$.length-1].conditions++,V({type:"text",value:x});continue}if(x===","){let R=x,H=O[O.length-1];H&&L[L.length-1]==="braces"&&(H.comma=!0,R="|"),V({type:"comma",value:x,output:R});continue}if(x==="/"){if(y.type==="dot"&&C.index===C.start+1){C.start=C.index+1,C.consumed="",C.output="",o.pop(),y=s;continue}V({type:"slash",value:x,output:g});continue}if(x==="."){if(C.braces>0&&y.type==="dot"){y.value==="."&&(y.output=p);let R=O[O.length-1];y.type="dots",y.output+=x,y.value+=x,R.dots=!0;continue}if(C.braces+C.parens===0&&y.type!=="bos"&&y.type!=="slash"){V({type:"text",value:x,output:p});continue}V({type:"dot",value:x,output:p});continue}if(x==="?"){if(!(y&&y.value==="(")&&r.noextglob!==!0&&J()==="("&&J(2)!=="?"){Vn("qmark",x);continue}if(y&&y.type==="paren"){let H=J(),ce=x;if(H==="<"&&!Je.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(y.value==="("&&!/[!=<:]/.test(H)||H==="<"&&!/<([!=]|\w+>)/.test(ft()))&&(ce=`\\${x}`),V({type:"text",value:x,output:ce});continue}if(r.dot!==!0&&(y.type==="slash"||y.type==="bos")){V({type:"qmark",value:x,output:P});continue}V({type:"qmark",value:x,output:E});continue}if(x==="!"){if(r.noextglob!==!0&&J()==="("&&(J(2)!=="?"||!/[!=<:]/.test(J(3)))){Vn("negate",x);continue}if(r.nonegate!==!0&&C.index===0){Kf();continue}}if(x==="+"){if(r.noextglob!==!0&&J()==="("&&J(2)!=="?"){Vn("plus",x);continue}if(y&&y.value==="("||r.regex===!1){V({type:"plus",value:x,output:d});continue}if(y&&(y.type==="bracket"||y.type==="paren"||y.type==="brace")||C.parens>0){V({type:"plus",value:x});continue}V({type:"plus",value:d});continue}if(x==="@"){if(r.noextglob!==!0&&J()==="("&&J(2)!=="?"){V({type:"at",extglob:!0,value:x,output:""});continue}V({type:"text",value:x});continue}if(x!=="*"){(x==="$"||x==="^")&&(x=`\\${x}`);let R=f0.exec(ft());R&&(x+=R[0],C.index+=R[0].length),V({type:"text",value:x});continue}if(y&&(y.type==="globstar"||y.star===!0)){y.type="star",y.star=!0,y.value+=x,y.output=S,C.backtrack=!0,C.globstar=!0,Me(x);continue}let _=ft();if(r.noextglob!==!0&&/^\([^?]/.test(_)){Vn("star",x);continue}if(y.type==="star"){if(r.noglobstar===!0){Me(x);continue}let R=y.prev,H=R.prev,ce=R.type==="slash"||R.type==="bos",Pe=H&&(H.type==="star"||H.type==="globstar");if(r.bash===!0&&(!ce||_[0]&&_[0]!=="/")){V({type:"star",value:x,output:""});continue}let me=C.braces>0&&(R.type==="comma"||R.type==="brace"),ti=$.length&&(R.type==="pipe"||R.type==="paren");if(!ce&&R.type!=="paren"&&!me&&!ti){V({type:"star",value:x,output:""});continue}for(;_.slice(0,3)==="/**";){let Kn=e[C.index+4];if(Kn&&Kn!=="/")break;_=_.slice(3),Me("/**",3)}if(R.type==="bos"&&ue()){y.type="globstar",y.value+=x,y.output=T(r),C.output=y.output,C.globstar=!0,Me(x);continue}if(R.type==="slash"&&R.prev.type!=="bos"&&!Pe&&ue()){C.output=C.output.slice(0,-(R.output+y.output).length),R.output=`(?:${R.output}`,y.type="globstar",y.output=T(r)+(r.strictSlashes?")":"|$)"),y.value+=x,C.globstar=!0,C.output+=R.output+y.output,Me(x);continue}if(R.type==="slash"&&R.prev.type!=="bos"&&_[0]==="/"){let Kn=_[1]!==void 0?"|$":"";C.output=C.output.slice(0,-(R.output+y.output).length),R.output=`(?:${R.output}`,y.type="globstar",y.output=`${T(r)}${g}|${g}${Kn})`,y.value+=x,C.output+=R.output+y.output,C.globstar=!0,Me(x+dt()),V({type:"slash",value:"/",output:""});continue}if(R.type==="bos"&&_[0]==="/"){y.type="globstar",y.value+=x,y.output=`(?:^|${g}|${T(r)}${g})`,C.output=y.output,C.globstar=!0,Me(x+dt()),V({type:"slash",value:"/",output:""});continue}C.output=C.output.slice(0,-y.output.length),y.type="globstar",y.output=T(r),y.value+=x,C.output+=y.output,C.globstar=!0,Me(x);continue}let ne={type:"star",value:x,output:S};if(r.bash===!0){ne.output=".*?",(y.type==="bos"||y.type==="slash")&&(ne.output=k+ne.output),V(ne);continue}if(y&&(y.type==="bracket"||y.type==="paren")&&r.regex===!0){ne.output=x,V(ne);continue}(C.index===C.start||y.type==="slash"||y.type==="dot")&&(y.type==="dot"?(C.output+=D,y.output+=D):r.dot===!0?(C.output+=v,y.output+=v):(C.output+=k,y.output+=k),J()!=="*"&&(C.output+=m,y.output+=m)),V(ne)}for(;C.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(zr("closing","]"));C.output=Je.escapeLast(C.output,"["),Qt("brackets")}for(;C.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(zr("closing",")"));C.output=Je.escapeLast(C.output,"("),Qt("parens")}for(;C.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(zr("closing","}"));C.output=Je.escapeLast(C.output,"{"),Qt("braces")}if(r.strictSlashes!==!0&&(y.type==="star"||y.type==="bracket")&&V({type:"maybe_slash",value:"",output:`${g}?`}),C.backtrack===!0){C.output="";for(let _ of C.tokens)C.output+=_.output!=null?_.output:_.value,_.suffix&&(C.output+=_.suffix)}return C};na.fastpaths=(e,t)=>{let r={...t},n=typeof r.maxLength=="number"?Math.min(Ko,r.maxLength):Ko,i=e.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);e=kd[e]||e;let s=Je.isWindows(t),{DOT_LITERAL:o,SLASH_LITERAL:a,ONE_CHAR:u,DOTS_SLASH:c,NO_DOT:l,NO_DOTS:p,NO_DOTS_SLASH:d,STAR:g,START_ANCHOR:m}=Vo.globChars(s),f=r.dot?p:l,h=r.dot?d:l,D=r.capture?"":"?:",v={negated:!1,prefix:""},E=r.bash===!0?".*?":g;r.capture&&(E=`(${E})`);let P=k=>k.noglobstar===!0?E:`(${D}(?:(?!${m}${k.dot?c:o}).)*?)`,A=k=>{switch(k){case"*":return`${f}${u}${E}`;case".*":return`${o}${u}${E}`;case"*.*":return`${f}${E}${o}${u}${E}`;case"*/*":return`${f}${E}${a}${u}${h}${E}`;case"**":return f+P(r);case"**/*":return`(?:${f}${P(r)}${a})?${h}${u}${E}`;case"**/*.*":return`(?:${f}${P(r)}${a})?${h}${E}${o}${u}${E}`;case"**/.*":return`(?:${f}${P(r)}${a})?${o}${u}${E}`;default:{let I=/^(.*?)\.(\w+)$/.exec(k);if(!I)return;let S=A(I[1]);return S?S+o+I[2]:void 0}}},F=Je.removePrefix(e,v),T=A(F);return T&&r.strictSlashes!==!0&&(T+=`${a}?`),T};Bd.exports=na});var Nd=B((m2,$d)=>{"use strict";var h0=z("path"),D0=Id(),oa=_d(),ia=Ln(),C0=On(),y0=e=>e&&typeof e=="object"&&!Array.isArray(e),de=(e,t,r=!1)=>{if(Array.isArray(e)){let l=e.map(d=>de(d,t,r));return d=>{for(let g of l){let m=g(d);if(m)return m}return!1}}let n=y0(e)&&e.tokens&&e.input;if(e===""||typeof e!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let i=t||{},s=ia.isWindows(t),o=n?de.compileRe(e,t):de.makeRe(e,t,!1,!0),a=o.state;delete o.state;let u=()=>!1;if(i.ignore){let l={...t,ignore:null,onMatch:null,onResult:null};u=de(i.ignore,l,r)}let c=(l,p=!1)=>{let{isMatch:d,match:g,output:m}=de.test(l,o,t,{glob:e,posix:s}),f={glob:e,state:a,regex:o,posix:s,input:l,output:m,match:g,isMatch:d};return typeof i.onResult=="function"&&i.onResult(f),d===!1?(f.isMatch=!1,p?f:!1):u(l)?(typeof i.onIgnore=="function"&&i.onIgnore(f),f.isMatch=!1,p?f:!1):(typeof i.onMatch=="function"&&i.onMatch(f),p?f:!0)};return r&&(c.state=a),c};de.test=(e,t,r,{glob:n,posix:i}={})=>{if(typeof e!="string")throw new TypeError("Expected input to be a string");if(e==="")return{isMatch:!1,output:""};let s=r||{},o=s.format||(i?ia.toPosixSlashes:null),a=e===n,u=a&&o?o(e):e;return a===!1&&(u=o?o(e):e,a=u===n),(a===!1||s.capture===!0)&&(s.matchBase===!0||s.basename===!0?a=de.matchBase(e,t,r,i):a=t.exec(u)),{isMatch:!!a,match:a,output:u}};de.matchBase=(e,t,r,n=ia.isWindows(r))=>(t instanceof RegExp?t:de.makeRe(t,r)).test(h0.basename(e));de.isMatch=(e,t,r)=>de(t,r)(e);de.parse=(e,t)=>Array.isArray(e)?e.map(r=>de.parse(r,t)):oa(e,{...t,fastpaths:!1});de.scan=(e,t)=>D0(e,t);de.compileRe=(e,t,r=!1,n=!1)=>{if(r===!0)return e.output;let i=t||{},s=i.contains?"":"^",o=i.contains?"":"$",a=`${s}(?:${e.output})${o}`;e&&e.negated===!0&&(a=`^(?!${a}).*$`);let u=de.toRegex(a,t);return n===!0&&(u.state=e),u};de.makeRe=(e,t={},r=!1,n=!1)=>{if(!e||typeof e!="string")throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]==="."||e[0]==="*")&&(i.output=oa.fastpaths(e,t)),i.output||(i=oa(e,t)),de.compileRe(i,t,r,n)};de.toRegex=(e,t)=>{try{let r=t||{};return new RegExp(e,r.flags||(r.nocase?"i":""))}catch(r){if(t&&t.debug===!0)throw r;return/$^/}};de.constants=C0;$d.exports=de});var Ld=B((g2,Od)=>{"use strict";Od.exports=Nd()});var Go=B((h2,Vd)=>{"use strict";var jd=z("util"),Ud=Cd(),Pt=Ld(),sa=Ln(),Md=e=>e===""||e==="./",Hd=e=>{let t=e.indexOf("{");return t>-1&&e.indexOf("}",t)>-1},se=(e,t,r)=>{t=[].concat(t),e=[].concat(e);let n=new Set,i=new Set,s=new Set,o=0,a=l=>{s.add(l.output),r&&r.onResult&&r.onResult(l)};for(let l=0;l<t.length;l++){let p=Pt(String(t[l]),{...r,onResult:a},!0),d=p.state.negated||p.state.negatedExtglob;d&&o++;for(let g of e){let m=p(g,!0);(d?!m.isMatch:m.isMatch)&&(d?n.add(m.output):(n.delete(m.output),i.add(m.output)))}}let c=(o===t.length?[...s]:[...i]).filter(l=>!n.has(l));if(r&&c.length===0){if(r.failglob===!0)throw new Error(`No matches found for "${t.join(", ")}"`);if(r.nonull===!0||r.nullglob===!0)return r.unescape?t.map(l=>l.replace(/\\/g,"")):t}return c};se.match=se;se.matcher=(e,t)=>Pt(e,t);se.isMatch=(e,t,r)=>Pt(t,r)(e);se.any=se.isMatch;se.not=(e,t,r={})=>{t=[].concat(t).map(String);let n=new Set,i=[],s=a=>{r.onResult&&r.onResult(a),i.push(a.output)},o=new Set(se(e,t,{...r,onResult:s}));for(let a of i)o.has(a)||n.add(a);return[...n]};se.contains=(e,t,r)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${jd.inspect(e)}"`);if(Array.isArray(t))return t.some(n=>se.contains(e,n,r));if(typeof t=="string"){if(Md(e)||Md(t))return!1;if(e.includes(t)||e.startsWith("./")&&e.slice(2).includes(t))return!0}return se.isMatch(e,t,{...r,contains:!0})};se.matchKeys=(e,t,r)=>{if(!sa.isObject(e))throw new TypeError("Expected the first argument to be an object");let n=se(Object.keys(e),t,r),i={};for(let s of n)i[s]=e[s];return i};se.some=(e,t,r)=>{let n=[].concat(e);for(let i of[].concat(t)){let s=Pt(String(i),r);if(n.some(o=>s(o)))return!0}return!1};se.every=(e,t,r)=>{let n=[].concat(e);for(let i of[].concat(t)){let s=Pt(String(i),r);if(!n.every(o=>s(o)))return!1}return!0};se.all=(e,t,r)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${jd.inspect(e)}"`);return[].concat(t).every(n=>Pt(n,r)(e))};se.capture=(e,t,r)=>{let n=sa.isWindows(r),s=Pt.makeRe(String(e),{...r,capture:!0}).exec(n?sa.toPosixSlashes(t):t);if(s)return s.slice(1).map(o=>o===void 0?"":o)};se.makeRe=(...e)=>Pt.makeRe(...e);se.scan=(...e)=>Pt.scan(...e);se.parse=(e,t)=>{let r=[];for(let n of[].concat(e||[]))for(let i of Ud(String(n),t))r.push(Pt.parse(i,t));return r};se.braces=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return t&&t.nobrace===!0||!Hd(e)?[e]:Ud(e,t)};se.braceExpand=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return se.braces(e,{...t,expand:!0})};se.hasBraces=Hd;Vd.exports=se});var Yd=B(Wo=>{"use strict";Object.defineProperty(Wo,"__esModule",{value:!0});Wo.match=void 0;var zd=Np(),x0=Go(),b0=z("url"),Kd=No();function w0(e,t,r){if(Gd(e))return qd(e,t);if(Wd(e))return Jd(e,t);if(Array.isArray(e)){if(e.every(Gd))return E0(e,t);if(e.every(Wd))return v0(e,t);throw new Error(Kd.ERRORS.ERR_CONTEXT_MATCHER_INVALID_ARRAY)}if(typeof e=="function"){let n=aa(t);return e(n,r)}throw new Error(Kd.ERRORS.ERR_CONTEXT_MATCHER_GENERIC)}Wo.match=w0;function qd(e,t){return aa(t).indexOf(e)===0}function Jd(e,t){let r=aa(t),n=x0([r],e);return n&&n.length>0}function v0(e,t){return Jd(e,t)}function E0(e,t){let r=!1;for(let n of e)if(qd(n,t)){r=!0;break}return r}function aa(e){return e&&b0.parse(e).pathname}function Gd(e){return typeof e=="string"&&!zd(e)}function Wd(e){return zd(e)}});var Xd=B(qr=>{"use strict";Object.defineProperty(qr,"__esModule",{value:!0});qr.getHandlers=qr.init=void 0;var S0=Gr(),zo=(0,S0.getInstance)();function F0(e,t){let r=Qd(t);for(let n of Object.keys(r))e.on(n,r[n]);e.on("econnreset",(n,i,s,o)=>{zo.error("[HPM] ECONNRESET: %O",n)}),e.on("proxyReqWs",(n,i,s,o,a)=>{s.on("error",u=>{zo.error("[HPM] WebSocket error: %O",u)})}),zo.debug("[HPM] Subscribed to http-proxy events:",Object.keys(r))}qr.init=F0;function Qd(e){let t={error:"onError",proxyReq:"onProxyReq",proxyReqWs:"onProxyReqWs",proxyRes:"onProxyRes",open:"onOpen",close:"onClose"},r={};for(let[n,i]of Object.entries(t)){let s=e?e[i]:null;typeof s=="function"&&(r[n]=s)}return typeof r.error!="function"&&(r.error=A0),typeof r.close!="function"&&(r.close=P0),r}qr.getHandlers=Qd;function A0(e,t,r){if(!t&&!r)throw e;let n=t.headers&&t.headers.host,i=e.code;if(r.writeHead&&!r.headersSent)if(/HPE_INVALID/.test(i))r.writeHead(502);else switch(i){case"ECONNRESET":case"ENOTFOUND":case"ECONNREFUSED":case"ETIMEDOUT":r.writeHead(504);break;default:r.writeHead(500)}r.end(`Error occurred while trying to proxy: ${n}${t.url}`)}function P0(e,t,r){zo.info("[HPM] Client disconnected")}});var tf=B(qo=>{"use strict";Object.defineProperty(qo,"__esModule",{value:!0});qo.createPathRewriter=void 0;var Zd=$o(),T0=No(),R0=Gr(),ef=(0,R0.getInstance)();function I0(e){let t;if(!k0(e))return;if(typeof e=="function")return e;return t=B0(e),r;function r(n){let i=n;for(let s of t)if(s.regex.test(n)){i=i.replace(s.regex,s.value),ef.debug('[HPM] Rewriting path from "%s" to "%s"',n,i);break}return i}}qo.createPathRewriter=I0;function k0(e){if(typeof e=="function")return!0;if(Zd(e))return Object.keys(e).length!==0;if(e==null)return!1;throw new Error(T0.ERRORS.ERR_PATH_REWRITER_CONFIG)}function B0(e){let t=[];if(Zd(e))for(let[r]of Object.entries(e))t.push({regex:new RegExp(r),value:e[r]}),ef.info('[HPM] Proxy rewrite rule created: "%s" ~> "%s"',r,e[r]);return t}});var nf=B(Jo=>{"use strict";Object.defineProperty(Jo,"__esModule",{value:!0});Jo.getTarget=void 0;var _0=$o(),$0=Gr(),rf=(0,$0.getInstance)();async function N0(e,t){let r,n=t.router;return _0(n)?r=O0(e,n):typeof n=="function"&&(r=await n(e)),r}Jo.getTarget=N0;function O0(e,t){let r,n=e.headers.host,i=e.url,s=n+i;for(let[o]of Object.entries(t))if(L0(o)){if(s.indexOf(o)>-1){r=t[o],rf.debug('[HPM] Router table match: "%s"',o);break}}else if(o===n){r=t[o],rf.debug('[HPM] Router table match: "%s"',n);break}return r}function L0(e){return e.indexOf("/")>-1}});var sf=B(Yo=>{"use strict";Object.defineProperty(Yo,"__esModule",{value:!0});Yo.HttpProxyMiddleware=void 0;var M0=Fp(),j0=Ip(),U0=Yd(),H0=Xd(),of=Gr(),V0=tf(),K0=nf(),ua=class{constructor(t,r){this.logger=(0,of.getInstance)(),this.wsInternalSubscribed=!1,this.serverOnCloseSubscribed=!1,this.middleware=async(n,i,s)=>{var o,a;if(this.shouldProxy(this.config.context,n))try{let c=await this.prepareProxyRequest(n);this.proxy.web(n,i,c)}catch(c){s(c)}else s();let u=(a=(o=n.socket)!==null&&o!==void 0?o:n.connection)===null||a===void 0?void 0:a.server;u&&!this.serverOnCloseSubscribed&&(u.on("close",()=>{this.logger.info("[HPM] server close signal received: closing proxy server"),this.proxy.close()}),this.serverOnCloseSubscribed=!0),this.proxyOptions.ws===!0&&this.catchUpgradeRequest(u)},this.catchUpgradeRequest=n=>{this.wsInternalSubscribed||(n.on("upgrade",this.handleUpgrade),this.wsInternalSubscribed=!0)},this.handleUpgrade=async(n,i,s)=>{if(this.shouldProxy(this.config.context,n)){let o=await this.prepareProxyRequest(n);this.proxy.ws(n,i,s,o),this.logger.info("[HPM] Upgrading to WebSocket")}},this.shouldProxy=(n,i)=>{try{let s=i.originalUrl||i.url;return U0.match(n,s,i)}catch(s){return this.logger.error(s),!1}},this.prepareProxyRequest=async n=>{n.url=n.originalUrl||n.url;let i=n.url,s=Object.assign({},this.proxyOptions);if(await this.applyRouter(n,s),await this.applyPathRewrite(n,this.pathRewriter),this.proxyOptions.logLevel==="debug"){let o=(0,of.getArrow)(i,n.url,this.proxyOptions.target,s.target);this.logger.debug("[HPM] %s %s %s %s",n.method,i,o,s.target)}return s},this.applyRouter=async(n,i)=>{let s;i.router&&(s=await K0.getTarget(n,i),s&&(this.logger.debug('[HPM] Router new target: %s -> "%s"',i.target,s),i.target=s))},this.applyPathRewrite=async(n,i)=>{if(i){let s=await i(n.url,n);typeof s=="string"?n.url=s:this.logger.info("[HPM] pathRewrite: No rewritten path found. (%s)",n.url)}},this.logError=(n,i,s,o)=>{var a;let c=`${((a=i.headers)===null||a===void 0?void 0:a.host)||i.hostname||i.host}${i.url}`,l=`${o?.href}`;this.logger.error("[HPM] Error occurred while proxying request %s to %s [%s] (%s)",c,l,n.code||n,"https://nodejs.org/api/errors.html#errors_common_system_errors")},this.config=(0,j0.createConfig)(t,r),this.proxyOptions=this.config.options,this.proxy=M0.createProxyServer({}),this.logger.info(`[HPM] Proxy created: ${this.config.context} -> ${this.proxyOptions.target}`),this.pathRewriter=V0.createPathRewriter(this.proxyOptions.pathRewrite),H0.init(this.proxy,this.proxyOptions),this.proxy.on("error",this.logError),this.middleware.upgrade=(n,i,s)=>{this.wsInternalSubscribed||this.handleUpgrade(n,i,s)}}};Yo.HttpProxyMiddleware=ua});var af=B(Qo=>{"use strict";Object.defineProperty(Qo,"__esModule",{value:!0});Qo.responseInterceptor=void 0;var ca=z("zlib");function G0(e){return async function(t,r,n){let i=t,s=Buffer.from("","utf8"),o=W0(t,t.headers["content-encoding"]);o.on("data",a=>s=Buffer.concat([s,a])),o.on("end",async()=>{z0(t,n);let a=Buffer.from(await e(s,i,r,n));n.setHeader("content-length",Buffer.byteLength(a,"utf8")),n.write(a),n.end()}),o.on("error",a=>{n.end(`Error fetching proxied request: ${a.message}`)})}}Qo.responseInterceptor=G0;function W0(e,t){let r=e,n;switch(t){case"gzip":n=ca.createGunzip();break;case"br":n=ca.createBrotliDecompress();break;case"deflate":n=ca.createInflate();break;default:break}return n&&(r.pipe(n),r=n),r}function z0(e,t){if(t.statusCode=e.statusCode,t.statusMessage=e.statusMessage,t.setHeader){let r=Object.keys(e.headers);r=r.filter(n=>!["content-encoding","transfer-encoding"].includes(n)),r.forEach(n=>{let i=e.headers[n];n==="set-cookie"&&(i=Array.isArray(i)?i:[i],i=i.map(s=>s.replace(/Domain=[^;]+?/i,""))),t.setHeader(n,i)})}else t.headers=e.headers}});var uf=B(Xo=>{"use strict";Object.defineProperty(Xo,"__esModule",{value:!0});Xo.fixRequestBody=void 0;var q0=z("querystring");function J0(e,t){let r=t.body;if(!r)return;let n=e.getHeader("Content-Type"),i=s=>{e.setHeader("Content-Length",Buffer.byteLength(s)),e.write(s)};n&&n.includes("application/json")&&i(JSON.stringify(r)),n&&n.includes("application/x-www-form-urlencoded")&&i(q0.stringify(r))}Xo.fixRequestBody=J0});var cf=B(Jr=>{"use strict";Object.defineProperty(Jr,"__esModule",{value:!0});Jr.fixRequestBody=Jr.responseInterceptor=void 0;var Y0=af();Object.defineProperty(Jr,"responseInterceptor",{enumerable:!0,get:function(){return Y0.responseInterceptor}});var Q0=uf();Object.defineProperty(Jr,"fixRequestBody",{enumerable:!0,get:function(){return Q0.fixRequestBody}})});var lf=B(Cr=>{"use strict";var X0=Cr&&Cr.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),Z0=Cr&&Cr.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&X0(t,e,r)};Object.defineProperty(Cr,"__esModule",{value:!0});Z0(cf(),Cr)});var la=B(Ut=>{"use strict";var eb=Ut&&Ut.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),tb=Ut&&Ut.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&eb(t,e,r)};Object.defineProperty(Ut,"__esModule",{value:!0});Ut.createProxyMiddleware=void 0;var rb=sf();function nb(e,t){let{middleware:r}=new rb.HttpProxyMiddleware(e,t);return r}Ut.createProxyMiddleware=nb;tb(lf(),Ut)});var hf=B((P2,gf)=>{"use strict";var mf=z("child_process"),pf=mf.spawn,ib=mf.exec;gf.exports=function(e,t,r){if(typeof t=="function"&&r===void 0&&(r=t,t=void 0),e=parseInt(e),Number.isNaN(e)){if(r)return r(new Error("pid must be a number"));throw new Error("pid must be a number")}var n={},i={};switch(n[e]=[],i[e]=1,process.platform){case"win32":ib("taskkill /pid "+e+" /T /F",r);break;case"darwin":pa(e,n,i,function(s){return pf("pgrep",["-P",s])},function(){df(n,t,r)});break;default:pa(e,n,i,function(s){return pf("ps",["-o","pid","--no-headers","--ppid",s])},function(){df(n,t,r)});break}};function df(e,t,r){var n={};try{Object.keys(e).forEach(function(i){e[i].forEach(function(s){n[s]||(ff(s,t),n[s]=1)}),n[i]||(ff(i,t),n[i]=1)})}catch(i){if(r)return r(i);throw i}if(r)return r()}function ff(e,t){try{process.kill(parseInt(e,10),t)}catch(r){if(r.code!=="ESRCH")throw r}}function pa(e,t,r,n,i){var s=n(e),o="";s.stdout.on("data",function(c){var c=c.toString("ascii");o+=c});var a=function(u){if(delete r[e],u!=0){Object.keys(r).length==0&&i();return}o.match(/\d+/g).forEach(function(c){c=parseInt(c,10),t[e].push(c),t[c]=[],r[c]=1,pa(c,t,r,n,i)})};s.on("close",a)}});var yf=B(da=>{"use strict";da.parse=db;da.serialize=fb;var sb=Object.prototype.toString,ab=Object.prototype.hasOwnProperty,ub=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,cb=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,lb=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,pb=/^[\u0020-\u003A\u003D-\u007E]*$/;function db(e,t){if(typeof e!="string")throw new TypeError("argument str must be a string");var r={},n=e.length;if(n<2)return r;var i=t&&t.decode||mb,s=0,o=0,a=0;do{if(o=e.indexOf("=",s),o===-1)break;if(a=e.indexOf(";",s),a===-1)a=n;else if(o>a){s=e.lastIndexOf(";",o-1)+1;continue}var u=Df(e,s,o),c=Cf(e,o,u),l=e.slice(u,c);if(!ab.call(r,l)){var p=Df(e,o+1,a),d=Cf(e,a,p);e.charCodeAt(p)===34&&e.charCodeAt(d-1)===34&&(p++,d--);var g=e.slice(p,d);r[l]=hb(g,i)}s=a+1}while(s<n);return r}function Df(e,t,r){do{var n=e.charCodeAt(t);if(n!==32&&n!==9)return t}while(++t<r);return r}function Cf(e,t,r){for(;t>r;){var n=e.charCodeAt(--t);if(n!==32&&n!==9)return t+1}return r}function fb(e,t,r){var n=r&&r.encode||encodeURIComponent;if(typeof n!="function")throw new TypeError("option encode is invalid");if(!ub.test(e))throw new TypeError("argument name is invalid");var i=n(t);if(!cb.test(i))throw new TypeError("argument val is invalid");var s=e+"="+i;if(!r)return s;if(r.maxAge!=null){var o=Math.floor(r.maxAge);if(!isFinite(o))throw new TypeError("option maxAge is invalid");s+="; Max-Age="+o}if(r.domain){if(!lb.test(r.domain))throw new TypeError("option domain is invalid");s+="; Domain="+r.domain}if(r.path){if(!pb.test(r.path))throw new TypeError("option path is invalid");s+="; Path="+r.path}if(r.expires){var a=r.expires;if(!gb(a)||isNaN(a.valueOf()))throw new TypeError("option expires is invalid");s+="; Expires="+a.toUTCString()}if(r.httpOnly&&(s+="; HttpOnly"),r.secure&&(s+="; Secure"),r.partitioned&&(s+="; Partitioned"),r.priority){var u=typeof r.priority=="string"?r.priority.toLowerCase():r.priority;switch(u){case"low":s+="; Priority=Low";break;case"medium":s+="; Priority=Medium";break;case"high":s+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(r.sameSite){var c=typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite;switch(c){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return s}function mb(e){return e.indexOf("%")!==-1?decodeURIComponent(e):e}function gb(e){return sb.call(e)==="[object Date]"}function hb(e,t){try{return t(e)}catch{return e}}});var wf=B(Zo=>{var bf=z("crypto");Zo.sign=function(e,t){if(typeof e!="string")throw new TypeError("Cookie value must be provided as a string.");if(typeof t!="string")throw new TypeError("Secret string must be provided.");return e+"."+bf.createHmac("sha256",t).update(e).digest("base64").replace(/\=+$/,"")};Zo.unsign=function(e,t){if(typeof e!="string")throw new TypeError("Signed cookie string must be provided.");if(typeof t!="string")throw new TypeError("Secret string must be provided.");var r=e.slice(0,e.lastIndexOf(".")),n=Zo.sign(r,t);return xf(n)==xf(e)?r:!1};function xf(e){return bf.createHash("sha1").update(e).digest("hex")}});var Ff=B((B2,Yr)=>{"use strict";var Db=yf(),Cb=wf();Yr.exports=yb;Yr.exports.JSONCookie=vf;Yr.exports.JSONCookies=fa;Yr.exports.signedCookie=Ef;Yr.exports.signedCookies=Sf;function yb(e,t){var r=!e||Array.isArray(e)?e||[]:[e];return function(i,s,o){if(i.cookies)return o();var a=i.headers.cookie;if(i.secret=r[0],i.cookies=Object.create(null),i.signedCookies=Object.create(null),!a)return o();i.cookies=Db.parse(a,t),r.length!==0&&(i.signedCookies=Sf(i.cookies,r),i.signedCookies=fa(i.signedCookies)),i.cookies=fa(i.cookies),o()}}function vf(e){if(!(typeof e!="string"||e.substr(0,2)!=="j:"))try{return JSON.parse(e.slice(2))}catch{return}}function fa(e){for(var t=Object.keys(e),r,n,i=0;i<t.length;i++)r=t[i],n=vf(e[r]),n&&(e[r]=n);return e}function Ef(e,t){if(typeof e=="string"){if(e.substr(0,2)!=="s:")return e;for(var r=!t||Array.isArray(t)?t||[]:[t],n=0;n<r.length;n++){var i=Cb.unsign(e.slice(2),r[n]);if(i!==!1)return i}return!1}}function Sf(e,t){for(var r=Object.keys(e),n,i,s=Object.create(null),o,a=0;a<r.length;a++)i=r[a],o=e[i],n=Ef(o,t),o!==n&&(s[i]=n,delete e[i]);return s}});var Zf="1.11.39",Ue=process.env.OVERRIDE_VERSION??Zf;import{createServer as rw,request as nw}from"http";var ni="preview-url";var yr="framework",Gn="platform",Wn="node",ba="/~builder-connect",Xt="/~builder-connected",oi="/~builder-dev-tools",ii="/~builder-dev-tools.js",Zt="/~builder-dev-tools-close",wa="/mappings";function G(e,t=""){return e.ts.createSourceFile("module.tsx",typeof t=="string"?t:"",e.ts.ScriptTarget.Latest,void 0)}function zn(e,t=""){let r=G(e,t?.trim());if(r.statements.length===0)throw new Error(`No statements found in code: ${t}`);return r.statements[0]}function Ce(e,t,r){if(t){let n=e.ts.createPrinter({newLine:e.ts.NewLineKind.LineFeed,removeComments:r});return e.ts.isSourceFile(t)?n.printFile(t).trim()+`
|
|
22
|
+
`;Hr.setupSocket(t),n&&n.length&&t.unshift(n);let c=Hr.isSSL.test(r.target.protocol)?sy:iy,l=Hr.setupOutgoing(r.ssl||{},r,e),p=c.request(l);i&&i.emit("proxyReqWs",p,e,t,r,n),p.on("error",d),p.on("upgrade",(D,m,f)=>{Pn("upgrade"),Fs({add:m}),o.push(m),m.on("close",()=>{Fs({rm:m})}),m.on("error",d),m.on("end",()=>{i.emit("close",D,m,f)}),m.on("close",()=>{t.end()}),Hr.setupSocket(m),f&&f.length&&m.unshift(f),t.write(u("HTTP/1.1 101 Switching Protocols",D.headers)),m.pipe(t).pipe(m),i.emit("open",m)});function d(D){s?s(D,e,t):i.emit("error",D,e,t),t.destroySoon()}p.end()}Pe.WS_PASSES={checkMethodAndHeader:ap,XHeaders:up,stream:cp}});var pp=_(st=>{"use strict";var cy=st&&st.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),ly=st&&st.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),lp=st&&st.__importStar||function(){var e=function(t){return e=Object.getOwnPropertyNames||function(r){var n=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[n.length]=i);return n},e(t)};return function(t){if(t&&t.__esModule)return t;var r={};if(t!=null)for(var n=e(t),i=0;i<n.length;i++)n[i]!=="default"&&cy(r,t,n[i]);return ly(r,t),r}}(),py=st&&st.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(st,"__esModule",{value:!0});st.ProxyServer=void 0;var dy=lp(se("http")),fy=lp(se("https")),my=ip(),gy=Ps(),hy=se("events"),Dy=py(Fo()),Cy=En(),To=(0,Dy.default)("http-proxy-3"),Ts=class e extends hy.EventEmitter{constructor(t={}){super(),this.createRightProxy=r=>(To("createRightProxy",{type:r}),n=>(...i)=>{let s=i[0];To("proxy: ",{type:r,path:s.url});let o=i[1],a=r==="ws"?this.wsPasses:this.webPasses;r=="ws"&&o.on("error",d=>{this.emit("error",d,s,o)});let u=i.length-1,c,l;typeof i[u]=="function"&&(l=i[u],u--);let p;!(i[u]instanceof Buffer)&&i[u]!==o?(p={...n,...i[u]},u--):p={...n},i[u]instanceof Buffer&&(c=i[u]);for(let d of["target","forward"])typeof p[d]=="string"&&(p[d]=(0,Cy.toURL)(p[d]));if(!p.target&&!p.forward){this.emit("error",new Error("Must set target or forward"),s,o);return}for(let d of a)if(d(s,o,p,c,this,l))break}),this.onError=r=>{if(this.listeners("error").length===1)throw r},this.listen=(r,n)=>{To("listen",{port:r,hostname:n});let i=(s,o)=>{this.web(s,o)};return this._server=this.options.ssl?fy.createServer(this.options.ssl,i):dy.createServer(i),this.options.ws&&this._server.on("upgrade",(s,o,a)=>{this.ws(s,o,a)}),this._server.listen(r,n),this},this.address=()=>this._server?.address(),this.close=r=>{if(this._server==null){r?.();return}this._server.close(n=>{this._server=null,r?.(n)})},this.before=(r,n,i)=>{if(r!=="ws"&&r!=="web")throw new Error("type must be `web` or `ws`");let s=r==="ws"?this.wsPasses:this.webPasses,o=!1;if(s.forEach((a,u)=>{a.name===n&&(o=u)}),o===!1)throw new Error("No such pass");s.splice(o,0,i)},this.after=(r,n,i)=>{if(r!=="ws"&&r!=="web")throw new Error("type must be `web` or `ws`");let s=r==="ws"?this.wsPasses:this.webPasses,o=!1;if(s.forEach((a,u)=>{a.name===n&&(o=u)}),o===!1)throw new Error("No such pass");s.splice(o++,0,i)},To("creating a ProxyServer",t),t.prependPath=t.prependPath!==!1,this.options=t,this.web=this.createRightProxy("web")(t),this.ws=this.createRightProxy("ws")(t),this.webPasses=Object.values(my.WEB_PASSES),this.wsPasses=Object.values(gy.WS_PASSES),this.on("error",this.onError)}static createProxyServer(t){return new e(t)}static createServer(t){return new e(t)}static createProxy(t){return new e(t)}};st.ProxyServer=Ts});var dp=_(It=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.numOpenSockets=It.ProxyServer=void 0;It.createProxyServer=Is;It.createServer=Is;It.createProxy=Is;var Rs=pp();Object.defineProperty(It,"ProxyServer",{enumerable:!0,get:function(){return Rs.ProxyServer}});var yy=Ps();Object.defineProperty(It,"numOpenSockets",{enumerable:!0,get:function(){return yy.numOpenSockets}});function Is(e={}){return new Rs.ProxyServer(e)}It.default=Rs.ProxyServer});var gp=_(ks=>{"use strict";ks.parse=Fy;ks.serialize=Ay;var xy=Object.prototype.toString,by=Object.prototype.hasOwnProperty,wy=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,Ey=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,vy=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,Sy=/^[\u0020-\u003A\u003D-\u007E]*$/;function Fy(e,t){if(typeof e!="string")throw new TypeError("argument str must be a string");var r={},n=e.length;if(n<2)return r;var i=t&&t.decode||Py,s=0,o=0,a=0;do{if(o=e.indexOf("=",s),o===-1)break;if(a=e.indexOf(";",s),a===-1)a=n;else if(o>a){s=e.lastIndexOf(";",o-1)+1;continue}var u=fp(e,s,o),c=mp(e,o,u),l=e.slice(u,c);if(!by.call(r,l)){var p=fp(e,o+1,a),d=mp(e,a,p);e.charCodeAt(p)===34&&e.charCodeAt(d-1)===34&&(p++,d--);var D=e.slice(p,d);r[l]=Ry(D,i)}s=a+1}while(s<n);return r}function fp(e,t,r){do{var n=e.charCodeAt(t);if(n!==32&&n!==9)return t}while(++t<r);return r}function mp(e,t,r){for(;t>r;){var n=e.charCodeAt(--t);if(n!==32&&n!==9)return t+1}return r}function Ay(e,t,r){var n=r&&r.encode||encodeURIComponent;if(typeof n!="function")throw new TypeError("option encode is invalid");if(!wy.test(e))throw new TypeError("argument name is invalid");var i=n(t);if(!Ey.test(i))throw new TypeError("argument val is invalid");var s=e+"="+i;if(!r)return s;if(r.maxAge!=null){var o=Math.floor(r.maxAge);if(!isFinite(o))throw new TypeError("option maxAge is invalid");s+="; Max-Age="+o}if(r.domain){if(!vy.test(r.domain))throw new TypeError("option domain is invalid");s+="; Domain="+r.domain}if(r.path){if(!Sy.test(r.path))throw new TypeError("option path is invalid");s+="; Path="+r.path}if(r.expires){var a=r.expires;if(!Ty(a)||isNaN(a.valueOf()))throw new TypeError("option expires is invalid");s+="; Expires="+a.toUTCString()}if(r.httpOnly&&(s+="; HttpOnly"),r.secure&&(s+="; Secure"),r.partitioned&&(s+="; Partitioned"),r.priority){var u=typeof r.priority=="string"?r.priority.toLowerCase():r.priority;switch(u){case"low":s+="; Priority=Low";break;case"medium":s+="; Priority=Medium";break;case"high":s+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(r.sameSite){var c=typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite;switch(c){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return s}function Py(e){return e.indexOf("%")!==-1?decodeURIComponent(e):e}function Ty(e){return xy.call(e)==="[object Date]"}function Ry(e,t){try{return t(e)}catch{return e}}});var Cp=_(Ro=>{var Dp=se("crypto");Ro.sign=function(e,t){if(typeof e!="string")throw new TypeError("Cookie value must be provided as a string.");if(typeof t!="string")throw new TypeError("Secret string must be provided.");return e+"."+Dp.createHmac("sha256",t).update(e).digest("base64").replace(/\=+$/,"")};Ro.unsign=function(e,t){if(typeof e!="string")throw new TypeError("Signed cookie string must be provided.");if(typeof t!="string")throw new TypeError("Secret string must be provided.");var r=e.slice(0,e.lastIndexOf(".")),n=Ro.sign(r,t);return hp(n)==hp(e)?r:!1};function hp(e){return Dp.createHash("sha1").update(e).digest("hex")}});var wp=_((AR,Kr)=>{"use strict";var Iy=gp(),ky=Cp();Kr.exports=By;Kr.exports.JSONCookie=yp;Kr.exports.JSONCookies=Bs;Kr.exports.signedCookie=xp;Kr.exports.signedCookies=bp;function By(e,t){var r=!e||Array.isArray(e)?e||[]:[e];return function(i,s,o){if(i.cookies)return o();var a=i.headers.cookie;if(i.secret=r[0],i.cookies=Object.create(null),i.signedCookies=Object.create(null),!a)return o();i.cookies=Iy.parse(a,t),r.length!==0&&(i.signedCookies=bp(i.cookies,r),i.signedCookies=Bs(i.signedCookies)),i.cookies=Bs(i.cookies),o()}}function yp(e){if(!(typeof e!="string"||e.substr(0,2)!=="j:"))try{return JSON.parse(e.slice(2))}catch{return}}function Bs(e){for(var t=Object.keys(e),r,n,i=0;i<t.length;i++)r=t[i],n=yp(e[r]),n&&(e[r]=n);return e}function xp(e,t){if(typeof e=="string"){if(e.substr(0,2)!=="s:")return e;for(var r=!t||Array.isArray(t)?t||[]:[t],n=0;n<r.length;n++){var i=ky.unsign(e.slice(2),r[n]);if(i!==!1)return i}return!1}}function bp(e,t){for(var r=Object.keys(e),n,i,s=Object.create(null),o,a=0;a<r.length;a++)i=r[a],o=e[i],n=xp(o,t),o!==n&&(s[i]=n,delete e[i]);return s}});var ko=_(at=>{"use strict";at.isInteger=e=>typeof e=="number"?Number.isInteger(e):typeof e=="string"&&e.trim()!==""?Number.isInteger(Number(e)):!1;at.find=(e,t)=>e.nodes.find(r=>r.type===t);at.exceedsLimit=(e,t,r=1,n)=>n===!1||!at.isInteger(e)||!at.isInteger(t)?!1:(Number(t)-Number(e))/Number(r)>=n;at.escapeNode=(e,t=0,r)=>{let n=e.nodes[t];n&&(r&&n.type===r||n.type==="open"||n.type==="close")&&n.escaped!==!0&&(n.value="\\"+n.value,n.escaped=!0)};at.encloseBrace=e=>e.type!=="brace"||e.commas>>0+e.ranges>>0?!1:(e.invalid=!0,!0);at.isInvalidBrace=e=>e.type!=="brace"?!1:e.invalid===!0||e.dollar?!0:!(e.commas>>0+e.ranges>>0)||e.open!==!0||e.close!==!0?(e.invalid=!0,!0):!1;at.isOpenOrClose=e=>e.type==="open"||e.type==="close"?!0:e.open===!0||e.close===!0;at.reduce=e=>e.reduce((t,r)=>(r.type==="text"&&t.push(r.value),r.type==="range"&&(r.type="text"),t),[]);at.flatten=(...e)=>{let t=[],r=n=>{for(let i=0;i<n.length;i++){let s=n[i];if(Array.isArray(s)){r(s);continue}s!==void 0&&t.push(s)}return t};return r(e),t}});var Bo=_((aI,Fp)=>{"use strict";var Sp=ko();Fp.exports=(e,t={})=>{let r=(n,i={})=>{let s=t.escapeInvalid&&Sp.isInvalidBrace(i),o=n.invalid===!0&&t.escapeInvalid===!0,a="";if(n.value)return(s||o)&&Sp.isOpenOrClose(n)?"\\"+n.value:n.value;if(n.value)return n.value;if(n.nodes)for(let u of n.nodes)a+=r(u);return a};return r(e)}});var Pp=_((uI,Ap)=>{"use strict";Ap.exports=function(e){return typeof e=="number"?e-e===0:typeof e=="string"&&e.trim()!==""?Number.isFinite?Number.isFinite(+e):isFinite(+e):!1}});var Op=_((cI,Np)=>{"use strict";var Tp=Pp(),Cr=(e,t,r)=>{if(Tp(e)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(t===void 0||e===t)return String(e);if(Tp(t)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let n={relaxZeros:!0,...r};typeof n.strictZeros=="boolean"&&(n.relaxZeros=n.strictZeros===!1);let i=String(n.relaxZeros),s=String(n.shorthand),o=String(n.capture),a=String(n.wrap),u=e+":"+t+"="+i+s+o+a;if(Cr.cache.hasOwnProperty(u))return Cr.cache[u].result;let c=Math.min(e,t),l=Math.max(e,t);if(Math.abs(c-l)===1){let f=e+"|"+t;return n.capture?`(${f})`:n.wrap===!1?f:`(?:${f})`}let p=_p(e)||_p(t),d={min:e,max:t,a:c,b:l},D=[],m=[];if(p&&(d.isPadded=p,d.maxLen=String(d.max).length),c<0){let f=l<0?Math.abs(l):1;m=Rp(f,Math.abs(c),d,n),c=d.a=0}return l>=0&&(D=Rp(c,l,d,n)),d.negatives=m,d.positives=D,d.result=Vy(m,D,n),n.capture===!0?d.result=`(${d.result})`:n.wrap!==!1&&D.length+m.length>1&&(d.result=`(?:${d.result})`),Cr.cache[u]=d,d.result};function Vy(e,t,r){let n=$s(e,t,"-",!1,r)||[],i=$s(t,e,"",!1,r)||[],s=$s(e,t,"-?",!0,r)||[];return n.concat(s).concat(i).join("|")}function Hy(e,t){let r=1,n=1,i=kp(e,r),s=new Set([t]);for(;e<=i&&i<=t;)s.add(i),r+=1,i=kp(e,r);for(i=Bp(t+1,n)-1;e<i&&i<=t;)s.add(i),n+=1,i=Bp(t+1,n)-1;return s=[...s],s.sort(Wy),s}function Ky(e,t,r){if(e===t)return{pattern:e,count:[],digits:0};let n=Gy(e,t),i=n.length,s="",o=0;for(let a=0;a<i;a++){let[u,c]=n[a];u===c?s+=u:u!=="0"||c!=="9"?s+=zy(u,c,r):o++}return o&&(s+=r.shorthand===!0?"\\d":"[0-9]"),{pattern:s,count:[o],digits:i}}function Rp(e,t,r,n){let i=Hy(e,t),s=[],o=e,a;for(let u=0;u<i.length;u++){let c=i[u],l=Ky(String(o),String(c),n),p="";if(!r.isPadded&&a&&a.pattern===l.pattern){a.count.length>1&&a.count.pop(),a.count.push(l.count[0]),a.string=a.pattern+$p(a.count),o=c+1;continue}r.isPadded&&(p=qy(c,r,n)),l.string=p+l.pattern+$p(l.count),s.push(l),o=c+1,a=l}return s}function $s(e,t,r,n,i){let s=[];for(let o of e){let{string:a}=o;!n&&!Ip(t,"string",a)&&s.push(r+a),n&&Ip(t,"string",a)&&s.push(r+a)}return s}function Gy(e,t){let r=[];for(let n=0;n<e.length;n++)r.push([e[n],t[n]]);return r}function Wy(e,t){return e>t?1:t>e?-1:0}function Ip(e,t,r){return e.some(n=>n[t]===r)}function kp(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function Bp(e,t){return e-e%Math.pow(10,t)}function $p(e){let[t=0,r=""]=e;return r||t>1?`{${t+(r?","+r:"")}}`:""}function zy(e,t,r){return`[${e}${t-e===1?"":"-"}${t}]`}function _p(e){return/^-?(0+)\d/.test(e)}function qy(e,t,r){if(!t.isPadded)return e;let n=Math.abs(t.maxLen-String(e).length),i=r.relaxZeros!==!1;switch(n){case 0:return"";case 1:return i?"0?":"0";case 2:return i?"0{0,2}":"00";default:return i?`0{0,${n}}`:`0{${n}}`}}Cr.cache={};Cr.clearCache=()=>Cr.cache={};Np.exports=Cr});var Os=_((lI,Kp)=>{"use strict";var Jy=se("util"),Mp=Op(),Lp=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),Yy=e=>t=>e===!0?Number(t):String(t),_s=e=>typeof e=="number"||typeof e=="string"&&e!=="",Tn=e=>Number.isInteger(+e),Ns=e=>{let t=`${e}`,r=-1;if(t[0]==="-"&&(t=t.slice(1)),t==="0")return!1;for(;t[++r]==="0";);return r>0},Qy=(e,t,r)=>typeof e=="string"||typeof t=="string"?!0:r.stringify===!0,Xy=(e,t,r)=>{if(t>0){let n=e[0]==="-"?"-":"";n&&(e=e.slice(1)),e=n+e.padStart(n?t-1:t,"0")}return r===!1?String(e):e},_o=(e,t)=>{let r=e[0]==="-"?"-":"";for(r&&(e=e.slice(1),t--);e.length<t;)e="0"+e;return r?"-"+e:e},Zy=(e,t,r)=>{e.negatives.sort((a,u)=>a<u?-1:a>u?1:0),e.positives.sort((a,u)=>a<u?-1:a>u?1:0);let n=t.capture?"":"?:",i="",s="",o;return e.positives.length&&(i=e.positives.map(a=>_o(String(a),r)).join("|")),e.negatives.length&&(s=`-(${n}${e.negatives.map(a=>_o(String(a),r)).join("|")})`),i&&s?o=`${i}|${s}`:o=i||s,t.wrap?`(${n}${o})`:o},jp=(e,t,r,n)=>{if(r)return Mp(e,t,{wrap:!1,...n});let i=String.fromCharCode(e);if(e===t)return i;let s=String.fromCharCode(t);return`[${i}-${s}]`},Up=(e,t,r)=>{if(Array.isArray(e)){let n=r.wrap===!0,i=r.capture?"":"?:";return n?`(${i}${e.join("|")})`:e.join("|")}return Mp(e,t,r)},Vp=(...e)=>new RangeError("Invalid range arguments: "+Jy.inspect(...e)),Hp=(e,t,r)=>{if(r.strictRanges===!0)throw Vp([e,t]);return[]},ex=(e,t)=>{if(t.strictRanges===!0)throw new TypeError(`Expected step "${e}" to be a number`);return[]},tx=(e,t,r=1,n={})=>{let i=Number(e),s=Number(t);if(!Number.isInteger(i)||!Number.isInteger(s)){if(n.strictRanges===!0)throw Vp([e,t]);return[]}i===0&&(i=0),s===0&&(s=0);let o=i>s,a=String(e),u=String(t),c=String(r);r=Math.max(Math.abs(r),1);let l=Ns(a)||Ns(u)||Ns(c),p=l?Math.max(a.length,u.length,c.length):0,d=l===!1&&Qy(e,t,n)===!1,D=n.transform||Yy(d);if(n.toRegex&&r===1)return jp(_o(e,p),_o(t,p),!0,n);let m={negatives:[],positives:[]},f=E=>m[E<0?"negatives":"positives"].push(Math.abs(E)),g=[],h=0;for(;o?i>=s:i<=s;)n.toRegex===!0&&r>1?f(i):g.push(Xy(D(i,h),p,d)),i=o?i-r:i+r,h++;return n.toRegex===!0?r>1?Zy(m,n,p):Up(g,null,{wrap:!1,...n}):g},rx=(e,t,r=1,n={})=>{if(!Tn(e)&&e.length>1||!Tn(t)&&t.length>1)return Hp(e,t,n);let i=n.transform||(d=>String.fromCharCode(d)),s=`${e}`.charCodeAt(0),o=`${t}`.charCodeAt(0),a=s>o,u=Math.min(s,o),c=Math.max(s,o);if(n.toRegex&&r===1)return jp(u,c,!1,n);let l=[],p=0;for(;a?s>=o:s<=o;)l.push(i(s,p)),s=a?s-r:s+r,p++;return n.toRegex===!0?Up(l,null,{wrap:!1,options:n}):l},$o=(e,t,r,n={})=>{if(t==null&&_s(e))return[e];if(!_s(e)||!_s(t))return Hp(e,t,n);if(typeof r=="function")return $o(e,t,1,{transform:r});if(Lp(r))return $o(e,t,0,r);let i={...n};return i.capture===!0&&(i.wrap=!0),r=r||i.step||1,Tn(r)?Tn(e)&&Tn(t)?tx(e,t,r,i):rx(e,t,Math.max(Math.abs(r),1),i):r!=null&&!Lp(r)?ex(r,i):$o(e,t,1,r)};Kp.exports=$o});var zp=_((pI,Wp)=>{"use strict";var nx=Os(),Gp=ko(),ox=(e,t={})=>{let r=(n,i={})=>{let s=Gp.isInvalidBrace(i),o=n.invalid===!0&&t.escapeInvalid===!0,a=s===!0||o===!0,u=t.escapeInvalid===!0?"\\":"",c="";if(n.isOpen===!0)return u+n.value;if(n.isClose===!0)return console.log("node.isClose",u,n.value),u+n.value;if(n.type==="open")return a?u+n.value:"(";if(n.type==="close")return a?u+n.value:")";if(n.type==="comma")return n.prev.type==="comma"?"":a?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let l=Gp.reduce(n.nodes),p=nx(...l,{...t,wrap:!1,toRegex:!0,strictZeros:!0});if(p.length!==0)return l.length>1&&p.length>1?`(${p})`:p}if(n.nodes)for(let l of n.nodes)c+=r(l,n);return c};return r(e)};Wp.exports=ox});var Yp=_((dI,Jp)=>{"use strict";var ix=Os(),qp=Bo(),Gr=ko(),yr=(e="",t="",r=!1)=>{let n=[];if(e=[].concat(e),t=[].concat(t),!t.length)return e;if(!e.length)return r?Gr.flatten(t).map(i=>`{${i}}`):t;for(let i of e)if(Array.isArray(i))for(let s of i)n.push(yr(s,t,r));else for(let s of t)r===!0&&typeof s=="string"&&(s=`{${s}}`),n.push(Array.isArray(s)?yr(i,s,r):i+s);return Gr.flatten(n)},sx=(e,t={})=>{let r=t.rangeLimit===void 0?1e3:t.rangeLimit,n=(i,s={})=>{i.queue=[];let o=s,a=s.queue;for(;o.type!=="brace"&&o.type!=="root"&&o.parent;)o=o.parent,a=o.queue;if(i.invalid||i.dollar){a.push(yr(a.pop(),qp(i,t)));return}if(i.type==="brace"&&i.invalid!==!0&&i.nodes.length===2){a.push(yr(a.pop(),["{}"]));return}if(i.nodes&&i.ranges>0){let p=Gr.reduce(i.nodes);if(Gr.exceedsLimit(...p,t.step,r))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let d=ix(...p,t);d.length===0&&(d=qp(i,t)),a.push(yr(a.pop(),d)),i.nodes=[];return}let u=Gr.encloseBrace(i),c=i.queue,l=i;for(;l.type!=="brace"&&l.type!=="root"&&l.parent;)l=l.parent,c=l.queue;for(let p=0;p<i.nodes.length;p++){let d=i.nodes[p];if(d.type==="comma"&&i.type==="brace"){p===1&&c.push(""),c.push("");continue}if(d.type==="close"){a.push(yr(a.pop(),c,u));continue}if(d.value&&d.type!=="open"){c.push(yr(c.pop(),d.value));continue}d.nodes&&n(d,i)}return c};return Gr.flatten(n(e))};Jp.exports=sx});var Xp=_((fI,Qp)=>{"use strict";Qp.exports={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
|
|
23
|
+
`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var nd=_((mI,rd)=>{"use strict";var ax=Bo(),{MAX_LENGTH:Zp,CHAR_BACKSLASH:Ls,CHAR_BACKTICK:ux,CHAR_COMMA:cx,CHAR_DOT:lx,CHAR_LEFT_PARENTHESES:px,CHAR_RIGHT_PARENTHESES:dx,CHAR_LEFT_CURLY_BRACE:fx,CHAR_RIGHT_CURLY_BRACE:mx,CHAR_LEFT_SQUARE_BRACKET:ed,CHAR_RIGHT_SQUARE_BRACKET:td,CHAR_DOUBLE_QUOTE:gx,CHAR_SINGLE_QUOTE:hx,CHAR_NO_BREAK_SPACE:Dx,CHAR_ZERO_WIDTH_NOBREAK_SPACE:Cx}=Xp(),yx=(e,t={})=>{if(typeof e!="string")throw new TypeError("Expected a string");let r=t||{},n=typeof r.maxLength=="number"?Math.min(Zp,r.maxLength):Zp;if(e.length>n)throw new SyntaxError(`Input length (${e.length}), exceeds max characters (${n})`);let i={type:"root",input:e,nodes:[]},s=[i],o=i,a=i,u=0,c=e.length,l=0,p=0,d,D=()=>e[l++],m=f=>{if(f.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&f.type==="text"){a.value+=f.value;return}return o.nodes.push(f),f.parent=o,f.prev=a,a=f,f};for(m({type:"bos"});l<c;)if(o=s[s.length-1],d=D(),!(d===Cx||d===Dx)){if(d===Ls){m({type:"text",value:(t.keepEscaping?d:"")+D()});continue}if(d===td){m({type:"text",value:"\\"+d});continue}if(d===ed){u++;let f;for(;l<c&&(f=D());){if(d+=f,f===ed){u++;continue}if(f===Ls){d+=D();continue}if(f===td&&(u--,u===0))break}m({type:"text",value:d});continue}if(d===px){o=m({type:"paren",nodes:[]}),s.push(o),m({type:"text",value:d});continue}if(d===dx){if(o.type!=="paren"){m({type:"text",value:d});continue}o=s.pop(),m({type:"text",value:d}),o=s[s.length-1];continue}if(d===gx||d===hx||d===ux){let f=d,g;for(t.keepQuotes!==!0&&(d="");l<c&&(g=D());){if(g===Ls){d+=g+D();continue}if(g===f){t.keepQuotes===!0&&(d+=g);break}d+=g}m({type:"text",value:d});continue}if(d===fx){p++;let g={type:"brace",open:!0,close:!1,dollar:a.value&&a.value.slice(-1)==="$"||o.dollar===!0,depth:p,commas:0,ranges:0,nodes:[]};o=m(g),s.push(o),m({type:"open",value:d});continue}if(d===mx){if(o.type!=="brace"){m({type:"text",value:d});continue}let f="close";o=s.pop(),o.close=!0,m({type:f,value:d}),p--,o=s[s.length-1];continue}if(d===cx&&p>0){if(o.ranges>0){o.ranges=0;let f=o.nodes.shift();o.nodes=[f,{type:"text",value:ax(o)}]}m({type:"comma",value:d}),o.commas++;continue}if(d===lx&&p>0&&o.commas===0){let f=o.nodes;if(p===0||f.length===0){m({type:"text",value:d});continue}if(a.type==="dot"){if(o.range=[],a.value+=d,a.type="range",o.nodes.length!==3&&o.nodes.length!==5){o.invalid=!0,o.ranges=0,a.type="text";continue}o.ranges++,o.args=[];continue}if(a.type==="range"){f.pop();let g=f[f.length-1];g.value+=a.value+d,a=g,o.ranges--;continue}m({type:"dot",value:d});continue}m({type:"text",value:d})}do if(o=s.pop(),o.type!=="root"){o.nodes.forEach(h=>{h.nodes||(h.type==="open"&&(h.isOpen=!0),h.type==="close"&&(h.isClose=!0),h.nodes||(h.type="text"),h.invalid=!0)});let f=s[s.length-1],g=f.nodes.indexOf(o);f.nodes.splice(g,1,...o.nodes)}while(s.length>0);return m({type:"eos"}),i};rd.exports=yx});var sd=_((gI,id)=>{"use strict";var od=Bo(),xx=zp(),bx=Yp(),wx=nd(),Ye=(e,t={})=>{let r=[];if(Array.isArray(e))for(let n of e){let i=Ye.create(n,t);Array.isArray(i)?r.push(...i):r.push(i)}else r=[].concat(Ye.create(e,t));return t&&t.expand===!0&&t.nodupes===!0&&(r=[...new Set(r)]),r};Ye.parse=(e,t={})=>wx(e,t);Ye.stringify=(e,t={})=>od(typeof e=="string"?Ye.parse(e,t):e,t);Ye.compile=(e,t={})=>(typeof e=="string"&&(e=Ye.parse(e,t)),xx(e,t));Ye.expand=(e,t={})=>{typeof e=="string"&&(e=Ye.parse(e,t));let r=bx(e,t);return t.noempty===!0&&(r=r.filter(Boolean)),t.nodupes===!0&&(r=[...new Set(r)]),r};Ye.create=(e,t={})=>e===""||e.length<3?[e]:t.expand!==!0?Ye.compile(e,t):Ye.expand(e,t);id.exports=Ye});var Rn=_((hI,pd)=>{"use strict";var Ex=se("path"),kt="\\\\/",ad=`[^${kt}]`,Ht="\\.",vx="\\+",Sx="\\?",No="\\/",Fx="(?=.)",ud="[^/]",Ms=`(?:${No}|$)`,cd=`(?:^|${No})`,js=`${Ht}{1,2}${Ms}`,Ax=`(?!${Ht})`,Px=`(?!${cd}${js})`,Tx=`(?!${Ht}{0,1}${Ms})`,Rx=`(?!${js})`,Ix=`[^.${No}]`,kx=`${ud}*?`,ld={DOT_LITERAL:Ht,PLUS_LITERAL:vx,QMARK_LITERAL:Sx,SLASH_LITERAL:No,ONE_CHAR:Fx,QMARK:ud,END_ANCHOR:Ms,DOTS_SLASH:js,NO_DOT:Ax,NO_DOTS:Px,NO_DOT_SLASH:Tx,NO_DOTS_SLASH:Rx,QMARK_NO_DOT:Ix,STAR:kx,START_ANCHOR:cd},Bx={...ld,SLASH_LITERAL:`[${kt}]`,QMARK:ad,STAR:`${ad}*?`,DOTS_SLASH:`${Ht}{1,2}(?:[${kt}]|$)`,NO_DOT:`(?!${Ht})`,NO_DOTS:`(?!(?:^|[${kt}])${Ht}{1,2}(?:[${kt}]|$))`,NO_DOT_SLASH:`(?!${Ht}{0,1}(?:[${kt}]|$))`,NO_DOTS_SLASH:`(?!${Ht}{1,2}(?:[${kt}]|$))`,QMARK_NO_DOT:`[^.${kt}]`,START_ANCHOR:`(?:^|[${kt}])`,END_ANCHOR:`(?:[${kt}]|$)`},$x={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};pd.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:$x,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:Ex.sep,extglobChars(e){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(e){return e===!0?Bx:ld}}});var In=_(je=>{"use strict";var _x=se("path"),Nx=process.platform==="win32",{REGEX_BACKSLASH:Ox,REGEX_REMOVE_BACKSLASH:Lx,REGEX_SPECIAL_CHARS:Mx,REGEX_SPECIAL_CHARS_GLOBAL:jx}=Rn();je.isObject=e=>e!==null&&typeof e=="object"&&!Array.isArray(e);je.hasRegexChars=e=>Mx.test(e);je.isRegexChar=e=>e.length===1&&je.hasRegexChars(e);je.escapeRegex=e=>e.replace(jx,"\\$1");je.toPosixSlashes=e=>e.replace(Ox,"/");je.removeBackslashes=e=>e.replace(Lx,t=>t==="\\"?"":t);je.supportsLookbehinds=()=>{let e=process.version.slice(1).split(".").map(Number);return e.length===3&&e[0]>=9||e[0]===8&&e[1]>=10};je.isWindows=e=>e&&typeof e.windows=="boolean"?e.windows:Nx===!0||_x.sep==="\\";je.escapeLast=(e,t,r)=>{let n=e.lastIndexOf(t,r);return n===-1?e:e[n-1]==="\\"?je.escapeLast(e,t,n-1):`${e.slice(0,n)}\\${e.slice(n)}`};je.removePrefix=(e,t={})=>{let r=e;return r.startsWith("./")&&(r=r.slice(2),t.prefix="./"),r};je.wrapOutput=(e,t={},r={})=>{let n=r.contains?"":"^",i=r.contains?"":"$",s=`${n}(?:${e})${i}`;return t.negated===!0&&(s=`(?:^(?!${s}).*$)`),s}});var yd=_((CI,Cd)=>{"use strict";var dd=In(),{CHAR_ASTERISK:Us,CHAR_AT:Ux,CHAR_BACKWARD_SLASH:kn,CHAR_COMMA:Vx,CHAR_DOT:Vs,CHAR_EXCLAMATION_MARK:Hs,CHAR_FORWARD_SLASH:Dd,CHAR_LEFT_CURLY_BRACE:Ks,CHAR_LEFT_PARENTHESES:Gs,CHAR_LEFT_SQUARE_BRACKET:Hx,CHAR_PLUS:Kx,CHAR_QUESTION_MARK:fd,CHAR_RIGHT_CURLY_BRACE:Gx,CHAR_RIGHT_PARENTHESES:md,CHAR_RIGHT_SQUARE_BRACKET:Wx}=Rn(),gd=e=>e===Dd||e===kn,hd=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)},zx=(e,t)=>{let r=t||{},n=e.length-1,i=r.parts===!0||r.scanToEnd===!0,s=[],o=[],a=[],u=e,c=-1,l=0,p=0,d=!1,D=!1,m=!1,f=!1,g=!1,h=!1,E=!1,v=!1,P=!1,A=!1,F=0,T,k,I={value:"",depth:0,isGlob:!1},S=()=>c>=n,C=()=>u.charCodeAt(c+1),$=()=>(T=k,u.charCodeAt(++c));for(;c<n;){k=$();let ue;if(k===kn){E=I.backslashes=!0,k=$(),k===Ks&&(h=!0);continue}if(h===!0||k===Ks){for(F++;S()!==!0&&(k=$());){if(k===kn){E=I.backslashes=!0,$();continue}if(k===Ks){F++;continue}if(h!==!0&&k===Vs&&(k=$())===Vs){if(d=I.isBrace=!0,m=I.isGlob=!0,A=!0,i===!0)continue;break}if(h!==!0&&k===Vx){if(d=I.isBrace=!0,m=I.isGlob=!0,A=!0,i===!0)continue;break}if(k===Gx&&(F--,F===0)){h=!1,d=I.isBrace=!0,A=!0;break}}if(i===!0)continue;break}if(k===Dd){if(s.push(c),o.push(I),I={value:"",depth:0,isGlob:!1},A===!0)continue;if(T===Vs&&c===l+1){l+=2;continue}p=c+1;continue}if(r.noext!==!0&&(k===Kx||k===Ux||k===Us||k===fd||k===Hs)===!0&&C()===Gs){if(m=I.isGlob=!0,f=I.isExtglob=!0,A=!0,k===Hs&&c===l&&(P=!0),i===!0){for(;S()!==!0&&(k=$());){if(k===kn){E=I.backslashes=!0,k=$();continue}if(k===md){m=I.isGlob=!0,A=!0;break}}continue}break}if(k===Us){if(T===Us&&(g=I.isGlobstar=!0),m=I.isGlob=!0,A=!0,i===!0)continue;break}if(k===fd){if(m=I.isGlob=!0,A=!0,i===!0)continue;break}if(k===Hx){for(;S()!==!0&&(ue=$());){if(ue===kn){E=I.backslashes=!0,$();continue}if(ue===Wx){D=I.isBracket=!0,m=I.isGlob=!0,A=!0;break}}if(i===!0)continue;break}if(r.nonegate!==!0&&k===Hs&&c===l){v=I.negated=!0,l++;continue}if(r.noparen!==!0&&k===Gs){if(m=I.isGlob=!0,i===!0){for(;S()!==!0&&(k=$());){if(k===Gs){E=I.backslashes=!0,k=$();continue}if(k===md){A=!0;break}}continue}break}if(m===!0){if(A=!0,i===!0)continue;break}}r.noext===!0&&(f=!1,m=!1);let O=u,L="",y="";l>0&&(L=u.slice(0,l),u=u.slice(l),p-=l),O&&m===!0&&p>0?(O=u.slice(0,p),y=u.slice(p)):m===!0?(O="",y=u):O=u,O&&O!==""&&O!=="/"&&O!==u&&gd(O.charCodeAt(O.length-1))&&(O=O.slice(0,-1)),r.unescape===!0&&(y&&(y=dd.removeBackslashes(y)),O&&E===!0&&(O=dd.removeBackslashes(O)));let x={prefix:L,input:e,start:l,base:O,glob:y,isBrace:d,isBracket:D,isGlob:m,isExtglob:f,isGlobstar:g,negated:v,negatedExtglob:P};if(r.tokens===!0&&(x.maxDepth=0,gd(k)||o.push(I),x.tokens=o),r.parts===!0||r.tokens===!0){let ue;for(let q=0;q<s.length;q++){let gt=ue?ue+1:l,ht=s[q],Ue=e.slice(gt,ht);r.tokens&&(q===0&&l!==0?(o[q].isPrefix=!0,o[q].value=L):o[q].value=Ue,hd(o[q]),x.maxDepth+=o[q].depth),(q!==0||Ue!=="")&&a.push(Ue),ue=ht}if(ue&&ue+1<e.length){let q=e.slice(ue+1);a.push(q),r.tokens&&(o[o.length-1].value=q,hd(o[o.length-1]),x.maxDepth+=o[o.length-1].depth)}x.slashes=s,x.parts=a}return x};Cd.exports=zx});var wd=_((yI,bd)=>{"use strict";var Oo=Rn(),Qe=In(),{MAX_LENGTH:Lo,POSIX_REGEX_SOURCE:qx,REGEX_NON_SPECIAL_CHARS:Jx,REGEX_SPECIAL_CHARS_BACKREF:Yx,REPLACEMENTS:xd}=Oo,Qx=(e,t)=>{if(typeof t.expandRange=="function")return t.expandRange(...e,t);e.sort();let r=`[${e.join("-")}]`;try{new RegExp(r)}catch{return e.map(i=>Qe.escapeRegex(i)).join("..")}return r},Wr=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,Ws=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");e=xd[e]||e;let r={...t},n=typeof r.maxLength=="number"?Math.min(Lo,r.maxLength):Lo,i=e.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);let s={type:"bos",value:"",output:r.prepend||""},o=[s],a=r.capture?"":"?:",u=Qe.isWindows(t),c=Oo.globChars(u),l=Oo.extglobChars(c),{DOT_LITERAL:p,PLUS_LITERAL:d,SLASH_LITERAL:D,ONE_CHAR:m,DOTS_SLASH:f,NO_DOT:g,NO_DOT_SLASH:h,NO_DOTS_SLASH:E,QMARK:v,QMARK_NO_DOT:P,STAR:A,START_ANCHOR:F}=c,T=B=>`(${a}(?:(?!${F}${B.dot?f:p}).)*?)`,k=r.dot?"":g,I=r.dot?v:P,S=r.bash===!0?T(r):A;r.capture&&(S=`(${S})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let C={input:e,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:o};e=Qe.removePrefix(e,C),i=e.length;let $=[],O=[],L=[],y=s,x,ue=()=>C.index===i-1,q=C.peek=(B=1)=>e[C.index+B],gt=C.advance=()=>e[++C.index]||"",ht=()=>e.slice(C.index+1),Ue=(B="",re=0)=>{C.consumed+=B,C.index+=re},$n=B=>{C.output+=B.output!=null?B.output:B.value,Ue(B.value)},zd=()=>{let B=1;for(;q()==="!"&&(q(2)!=="("||q(3)==="?");)gt(),C.start++,B++;return B%2===0?!1:(C.negated=!0,C.start++,!0)},_n=B=>{C[B]++,L.push(B)},Zt=B=>{C[B]--,L.pop()},H=B=>{if(y.type==="globstar"){let re=C.braces>0&&(B.type==="comma"||B.type==="brace"),R=B.extglob===!0||$.length&&(B.type==="pipe"||B.type==="paren");B.type!=="slash"&&B.type!=="paren"&&!re&&!R&&(C.output=C.output.slice(0,-y.output.length),y.type="star",y.value="*",y.output=S,C.output+=y.output)}if($.length&&B.type!=="paren"&&($[$.length-1].inner+=B.value),(B.value||B.output)&&$n(B),y&&y.type==="text"&&B.type==="text"){y.value+=B.value,y.output=(y.output||"")+B.value;return}B.prev=y,o.push(B),y=B},Nn=(B,re)=>{let R={...l[re],conditions:1,inner:""};R.prev=y,R.parens=C.parens,R.output=C.output;let V=(r.capture?"(":"")+R.open;_n("parens"),H({type:B,value:re,output:C.output?"":m}),H({type:"paren",extglob:!0,value:gt(),output:V}),$.push(R)},qd=B=>{let re=B.close+(r.capture?")":""),R;if(B.type==="negate"){let V=S;if(B.inner&&B.inner.length>1&&B.inner.includes("/")&&(V=T(r)),(V!==S||ue()||/^\)+$/.test(ht()))&&(re=B.close=`)$))${V}`),B.inner.includes("*")&&(R=ht())&&/^\.[^\\/.]+$/.test(R)){let ce=Ws(R,{...t,fastpaths:!1}).output;re=B.close=`)${ce})${V})`}B.prev.type==="bos"&&(C.negatedExtglob=!0)}H({type:"paren",extglob:!0,value:x,output:re}),Zt("parens")};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let B=!1,re=e.replace(Yx,(R,V,ce,Te,me,jo)=>Te==="\\"?(B=!0,R):Te==="?"?V?V+Te+(me?v.repeat(me.length):""):jo===0?I+(me?v.repeat(me.length):""):v.repeat(ce.length):Te==="."?p.repeat(ce.length):Te==="*"?V?V+Te+(me?S:""):S:V?R:`\\${R}`);return B===!0&&(r.unescape===!0?re=re.replace(/\\/g,""):re=re.replace(/\\+/g,R=>R.length%2===0?"\\\\":R?"\\":"")),re===e&&r.contains===!0?(C.output=e,C):(C.output=Qe.wrapOutput(re,C,t),C)}for(;!ue();){if(x=gt(),x==="\0")continue;if(x==="\\"){let R=q();if(R==="/"&&r.bash!==!0||R==="."||R===";")continue;if(!R){x+="\\",H({type:"text",value:x});continue}let V=/^\\+/.exec(ht()),ce=0;if(V&&V[0].length>2&&(ce=V[0].length,C.index+=ce,ce%2!==0&&(x+="\\")),r.unescape===!0?x=gt():x+=gt(),C.brackets===0){H({type:"text",value:x});continue}}if(C.brackets>0&&(x!=="]"||y.value==="["||y.value==="[^")){if(r.posix!==!1&&x===":"){let R=y.value.slice(1);if(R.includes("[")&&(y.posix=!0,R.includes(":"))){let V=y.value.lastIndexOf("["),ce=y.value.slice(0,V),Te=y.value.slice(V+2),me=qx[Te];if(me){y.value=ce+me,C.backtrack=!0,gt(),!s.output&&o.indexOf(y)===1&&(s.output=m);continue}}}(x==="["&&q()!==":"||x==="-"&&q()==="]")&&(x=`\\${x}`),x==="]"&&(y.value==="["||y.value==="[^")&&(x=`\\${x}`),r.posix===!0&&x==="!"&&y.value==="["&&(x="^"),y.value+=x,$n({value:x});continue}if(C.quotes===1&&x!=='"'){x=Qe.escapeRegex(x),y.value+=x,$n({value:x});continue}if(x==='"'){C.quotes=C.quotes===1?0:1,r.keepQuotes===!0&&H({type:"text",value:x});continue}if(x==="("){_n("parens"),H({type:"paren",value:x});continue}if(x===")"){if(C.parens===0&&r.strictBrackets===!0)throw new SyntaxError(Wr("opening","("));let R=$[$.length-1];if(R&&C.parens===R.parens+1){qd($.pop());continue}H({type:"paren",value:x,output:C.parens?")":"\\)"}),Zt("parens");continue}if(x==="["){if(r.nobracket===!0||!ht().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(Wr("closing","]"));x=`\\${x}`}else _n("brackets");H({type:"bracket",value:x});continue}if(x==="]"){if(r.nobracket===!0||y&&y.type==="bracket"&&y.value.length===1){H({type:"text",value:x,output:`\\${x}`});continue}if(C.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(Wr("opening","["));H({type:"text",value:x,output:`\\${x}`});continue}Zt("brackets");let R=y.value.slice(1);if(y.posix!==!0&&R[0]==="^"&&!R.includes("/")&&(x=`/${x}`),y.value+=x,$n({value:x}),r.literalBrackets===!1||Qe.hasRegexChars(R))continue;let V=Qe.escapeRegex(y.value);if(C.output=C.output.slice(0,-y.value.length),r.literalBrackets===!0){C.output+=V,y.value=V;continue}y.value=`(${a}${V}|${y.value})`,C.output+=y.value;continue}if(x==="{"&&r.nobrace!==!0){_n("braces");let R={type:"brace",value:x,output:"(",outputIndex:C.output.length,tokensIndex:C.tokens.length};O.push(R),H(R);continue}if(x==="}"){let R=O[O.length-1];if(r.nobrace===!0||!R){H({type:"text",value:x,output:x});continue}let V=")";if(R.dots===!0){let ce=o.slice(),Te=[];for(let me=ce.length-1;me>=0&&(o.pop(),ce[me].type!=="brace");me--)ce[me].type!=="dots"&&Te.unshift(ce[me].value);V=Qx(Te,r),C.backtrack=!0}if(R.comma!==!0&&R.dots!==!0){let ce=C.output.slice(0,R.outputIndex),Te=C.tokens.slice(R.tokensIndex);R.value=R.output="\\{",x=V="\\}",C.output=ce;for(let me of Te)C.output+=me.output||me.value}H({type:"brace",value:x,output:V}),Zt("braces"),O.pop();continue}if(x==="|"){$.length>0&&$[$.length-1].conditions++,H({type:"text",value:x});continue}if(x===","){let R=x,V=O[O.length-1];V&&L[L.length-1]==="braces"&&(V.comma=!0,R="|"),H({type:"comma",value:x,output:R});continue}if(x==="/"){if(y.type==="dot"&&C.index===C.start+1){C.start=C.index+1,C.consumed="",C.output="",o.pop(),y=s;continue}H({type:"slash",value:x,output:D});continue}if(x==="."){if(C.braces>0&&y.type==="dot"){y.value==="."&&(y.output=p);let R=O[O.length-1];y.type="dots",y.output+=x,y.value+=x,R.dots=!0;continue}if(C.braces+C.parens===0&&y.type!=="bos"&&y.type!=="slash"){H({type:"text",value:x,output:p});continue}H({type:"dot",value:x,output:p});continue}if(x==="?"){if(!(y&&y.value==="(")&&r.noextglob!==!0&&q()==="("&&q(2)!=="?"){Nn("qmark",x);continue}if(y&&y.type==="paren"){let V=q(),ce=x;if(V==="<"&&!Qe.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(y.value==="("&&!/[!=<:]/.test(V)||V==="<"&&!/<([!=]|\w+>)/.test(ht()))&&(ce=`\\${x}`),H({type:"text",value:x,output:ce});continue}if(r.dot!==!0&&(y.type==="slash"||y.type==="bos")){H({type:"qmark",value:x,output:P});continue}H({type:"qmark",value:x,output:v});continue}if(x==="!"){if(r.noextglob!==!0&&q()==="("&&(q(2)!=="?"||!/[!=<:]/.test(q(3)))){Nn("negate",x);continue}if(r.nonegate!==!0&&C.index===0){zd();continue}}if(x==="+"){if(r.noextglob!==!0&&q()==="("&&q(2)!=="?"){Nn("plus",x);continue}if(y&&y.value==="("||r.regex===!1){H({type:"plus",value:x,output:d});continue}if(y&&(y.type==="bracket"||y.type==="paren"||y.type==="brace")||C.parens>0){H({type:"plus",value:x});continue}H({type:"plus",value:d});continue}if(x==="@"){if(r.noextglob!==!0&&q()==="("&&q(2)!=="?"){H({type:"at",extglob:!0,value:x,output:""});continue}H({type:"text",value:x});continue}if(x!=="*"){(x==="$"||x==="^")&&(x=`\\${x}`);let R=Jx.exec(ht());R&&(x+=R[0],C.index+=R[0].length),H({type:"text",value:x});continue}if(y&&(y.type==="globstar"||y.star===!0)){y.type="star",y.star=!0,y.value+=x,y.output=S,C.backtrack=!0,C.globstar=!0,Ue(x);continue}let B=ht();if(r.noextglob!==!0&&/^\([^?]/.test(B)){Nn("star",x);continue}if(y.type==="star"){if(r.noglobstar===!0){Ue(x);continue}let R=y.prev,V=R.prev,ce=R.type==="slash"||R.type==="bos",Te=V&&(V.type==="star"||V.type==="globstar");if(r.bash===!0&&(!ce||B[0]&&B[0]!=="/")){H({type:"star",value:x,output:""});continue}let me=C.braces>0&&(R.type==="comma"||R.type==="brace"),jo=$.length&&(R.type==="pipe"||R.type==="paren");if(!ce&&R.type!=="paren"&&!me&&!jo){H({type:"star",value:x,output:""});continue}for(;B.slice(0,3)==="/**";){let On=e[C.index+4];if(On&&On!=="/")break;B=B.slice(3),Ue("/**",3)}if(R.type==="bos"&&ue()){y.type="globstar",y.value+=x,y.output=T(r),C.output=y.output,C.globstar=!0,Ue(x);continue}if(R.type==="slash"&&R.prev.type!=="bos"&&!Te&&ue()){C.output=C.output.slice(0,-(R.output+y.output).length),R.output=`(?:${R.output}`,y.type="globstar",y.output=T(r)+(r.strictSlashes?")":"|$)"),y.value+=x,C.globstar=!0,C.output+=R.output+y.output,Ue(x);continue}if(R.type==="slash"&&R.prev.type!=="bos"&&B[0]==="/"){let On=B[1]!==void 0?"|$":"";C.output=C.output.slice(0,-(R.output+y.output).length),R.output=`(?:${R.output}`,y.type="globstar",y.output=`${T(r)}${D}|${D}${On})`,y.value+=x,C.output+=R.output+y.output,C.globstar=!0,Ue(x+gt()),H({type:"slash",value:"/",output:""});continue}if(R.type==="bos"&&B[0]==="/"){y.type="globstar",y.value+=x,y.output=`(?:^|${D}|${T(r)}${D})`,C.output=y.output,C.globstar=!0,Ue(x+gt()),H({type:"slash",value:"/",output:""});continue}C.output=C.output.slice(0,-y.output.length),y.type="globstar",y.output=T(r),y.value+=x,C.output+=y.output,C.globstar=!0,Ue(x);continue}let re={type:"star",value:x,output:S};if(r.bash===!0){re.output=".*?",(y.type==="bos"||y.type==="slash")&&(re.output=k+re.output),H(re);continue}if(y&&(y.type==="bracket"||y.type==="paren")&&r.regex===!0){re.output=x,H(re);continue}(C.index===C.start||y.type==="slash"||y.type==="dot")&&(y.type==="dot"?(C.output+=h,y.output+=h):r.dot===!0?(C.output+=E,y.output+=E):(C.output+=k,y.output+=k),q()!=="*"&&(C.output+=m,y.output+=m)),H(re)}for(;C.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(Wr("closing","]"));C.output=Qe.escapeLast(C.output,"["),Zt("brackets")}for(;C.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(Wr("closing",")"));C.output=Qe.escapeLast(C.output,"("),Zt("parens")}for(;C.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(Wr("closing","}"));C.output=Qe.escapeLast(C.output,"{"),Zt("braces")}if(r.strictSlashes!==!0&&(y.type==="star"||y.type==="bracket")&&H({type:"maybe_slash",value:"",output:`${D}?`}),C.backtrack===!0){C.output="";for(let B of C.tokens)C.output+=B.output!=null?B.output:B.value,B.suffix&&(C.output+=B.suffix)}return C};Ws.fastpaths=(e,t)=>{let r={...t},n=typeof r.maxLength=="number"?Math.min(Lo,r.maxLength):Lo,i=e.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);e=xd[e]||e;let s=Qe.isWindows(t),{DOT_LITERAL:o,SLASH_LITERAL:a,ONE_CHAR:u,DOTS_SLASH:c,NO_DOT:l,NO_DOTS:p,NO_DOTS_SLASH:d,STAR:D,START_ANCHOR:m}=Oo.globChars(s),f=r.dot?p:l,g=r.dot?d:l,h=r.capture?"":"?:",E={negated:!1,prefix:""},v=r.bash===!0?".*?":D;r.capture&&(v=`(${v})`);let P=k=>k.noglobstar===!0?v:`(${h}(?:(?!${m}${k.dot?c:o}).)*?)`,A=k=>{switch(k){case"*":return`${f}${u}${v}`;case".*":return`${o}${u}${v}`;case"*.*":return`${f}${v}${o}${u}${v}`;case"*/*":return`${f}${v}${a}${u}${g}${v}`;case"**":return f+P(r);case"**/*":return`(?:${f}${P(r)}${a})?${g}${u}${v}`;case"**/*.*":return`(?:${f}${P(r)}${a})?${g}${v}${o}${u}${v}`;case"**/.*":return`(?:${f}${P(r)}${a})?${o}${u}${v}`;default:{let I=/^(.*?)\.(\w+)$/.exec(k);if(!I)return;let S=A(I[1]);return S?S+o+I[2]:void 0}}},F=Qe.removePrefix(e,E),T=A(F);return T&&r.strictSlashes!==!0&&(T+=`${a}?`),T};bd.exports=Ws});var vd=_((xI,Ed)=>{"use strict";var Xx=se("path"),Zx=yd(),zs=wd(),qs=In(),e0=Rn(),t0=e=>e&&typeof e=="object"&&!Array.isArray(e),de=(e,t,r=!1)=>{if(Array.isArray(e)){let l=e.map(d=>de(d,t,r));return d=>{for(let D of l){let m=D(d);if(m)return m}return!1}}let n=t0(e)&&e.tokens&&e.input;if(e===""||typeof e!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let i=t||{},s=qs.isWindows(t),o=n?de.compileRe(e,t):de.makeRe(e,t,!1,!0),a=o.state;delete o.state;let u=()=>!1;if(i.ignore){let l={...t,ignore:null,onMatch:null,onResult:null};u=de(i.ignore,l,r)}let c=(l,p=!1)=>{let{isMatch:d,match:D,output:m}=de.test(l,o,t,{glob:e,posix:s}),f={glob:e,state:a,regex:o,posix:s,input:l,output:m,match:D,isMatch:d};return typeof i.onResult=="function"&&i.onResult(f),d===!1?(f.isMatch=!1,p?f:!1):u(l)?(typeof i.onIgnore=="function"&&i.onIgnore(f),f.isMatch=!1,p?f:!1):(typeof i.onMatch=="function"&&i.onMatch(f),p?f:!0)};return r&&(c.state=a),c};de.test=(e,t,r,{glob:n,posix:i}={})=>{if(typeof e!="string")throw new TypeError("Expected input to be a string");if(e==="")return{isMatch:!1,output:""};let s=r||{},o=s.format||(i?qs.toPosixSlashes:null),a=e===n,u=a&&o?o(e):e;return a===!1&&(u=o?o(e):e,a=u===n),(a===!1||s.capture===!0)&&(s.matchBase===!0||s.basename===!0?a=de.matchBase(e,t,r,i):a=t.exec(u)),{isMatch:!!a,match:a,output:u}};de.matchBase=(e,t,r,n=qs.isWindows(r))=>(t instanceof RegExp?t:de.makeRe(t,r)).test(Xx.basename(e));de.isMatch=(e,t,r)=>de(t,r)(e);de.parse=(e,t)=>Array.isArray(e)?e.map(r=>de.parse(r,t)):zs(e,{...t,fastpaths:!1});de.scan=(e,t)=>Zx(e,t);de.compileRe=(e,t,r=!1,n=!1)=>{if(r===!0)return e.output;let i=t||{},s=i.contains?"":"^",o=i.contains?"":"$",a=`${s}(?:${e.output})${o}`;e&&e.negated===!0&&(a=`^(?!${a}).*$`);let u=de.toRegex(a,t);return n===!0&&(u.state=e),u};de.makeRe=(e,t={},r=!1,n=!1)=>{if(!e||typeof e!="string")throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]==="."||e[0]==="*")&&(i.output=zs.fastpaths(e,t)),i.output||(i=zs(e,t)),de.compileRe(i,t,r,n)};de.toRegex=(e,t)=>{try{let r=t||{};return new RegExp(e,r.flags||(r.nocase?"i":""))}catch(r){if(t&&t.debug===!0)throw r;return/$^/}};de.constants=e0;Ed.exports=de});var Fd=_((bI,Sd)=>{"use strict";Sd.exports=vd()});var Ys=_((wI,Id)=>{"use strict";var Pd=se("util"),Td=sd(),Bt=Fd(),Js=In(),Ad=e=>e===""||e==="./",Rd=e=>{let t=e.indexOf("{");return t>-1&&e.indexOf("}",t)>-1},ie=(e,t,r)=>{t=[].concat(t),e=[].concat(e);let n=new Set,i=new Set,s=new Set,o=0,a=l=>{s.add(l.output),r&&r.onResult&&r.onResult(l)};for(let l=0;l<t.length;l++){let p=Bt(String(t[l]),{...r,onResult:a},!0),d=p.state.negated||p.state.negatedExtglob;d&&o++;for(let D of e){let m=p(D,!0);(d?!m.isMatch:m.isMatch)&&(d?n.add(m.output):(n.delete(m.output),i.add(m.output)))}}let c=(o===t.length?[...s]:[...i]).filter(l=>!n.has(l));if(r&&c.length===0){if(r.failglob===!0)throw new Error(`No matches found for "${t.join(", ")}"`);if(r.nonull===!0||r.nullglob===!0)return r.unescape?t.map(l=>l.replace(/\\/g,"")):t}return c};ie.match=ie;ie.matcher=(e,t)=>Bt(e,t);ie.isMatch=(e,t,r)=>Bt(t,r)(e);ie.any=ie.isMatch;ie.not=(e,t,r={})=>{t=[].concat(t).map(String);let n=new Set,i=[],s=a=>{r.onResult&&r.onResult(a),i.push(a.output)},o=new Set(ie(e,t,{...r,onResult:s}));for(let a of i)o.has(a)||n.add(a);return[...n]};ie.contains=(e,t,r)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${Pd.inspect(e)}"`);if(Array.isArray(t))return t.some(n=>ie.contains(e,n,r));if(typeof t=="string"){if(Ad(e)||Ad(t))return!1;if(e.includes(t)||e.startsWith("./")&&e.slice(2).includes(t))return!0}return ie.isMatch(e,t,{...r,contains:!0})};ie.matchKeys=(e,t,r)=>{if(!Js.isObject(e))throw new TypeError("Expected the first argument to be an object");let n=ie(Object.keys(e),t,r),i={};for(let s of n)i[s]=e[s];return i};ie.some=(e,t,r)=>{let n=[].concat(e);for(let i of[].concat(t)){let s=Bt(String(i),r);if(n.some(o=>s(o)))return!0}return!1};ie.every=(e,t,r)=>{let n=[].concat(e);for(let i of[].concat(t)){let s=Bt(String(i),r);if(!n.every(o=>s(o)))return!1}return!0};ie.all=(e,t,r)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${Pd.inspect(e)}"`);return[].concat(t).every(n=>Bt(n,r)(e))};ie.capture=(e,t,r)=>{let n=Js.isWindows(r),s=Bt.makeRe(String(e),{...r,capture:!0}).exec(n?Js.toPosixSlashes(t):t);if(s)return s.slice(1).map(o=>o===void 0?"":o)};ie.makeRe=(...e)=>Bt.makeRe(...e);ie.scan=(...e)=>Bt.scan(...e);ie.parse=(e,t)=>{let r=[];for(let n of[].concat(e||[]))for(let i of Td(String(n),t))r.push(Bt.parse(i,t));return r};ie.braces=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return t&&t.nobrace===!0||!Rd(e)?[e]:Td(e,t)};ie.braceExpand=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return ie.braces(e,{...t,expand:!0})};ie.hasBraces=Rd;Id.exports=ie});var rf="1.11.41",Ve=process.env.OVERRIDE_VERSION??rf;import{createServer as I0,request as k0}from"http";var Vo="preview-url";var xr="framework",Ln="platform",Mn="node",oa="/~builder-connect",er="/~builder-connected",Ho="/~builder-dev-tools",Ko="/~builder-dev-tools.js",tr="/~builder-dev-tools-close",ia="/mappings";function G(e,t=""){return e.ts.createSourceFile("module.tsx",typeof t=="string"?t:"",e.ts.ScriptTarget.Latest,void 0)}function jn(e,t=""){let r=G(e,t?.trim());if(r.statements.length===0)throw new Error(`No statements found in code: ${t}`);return r.statements[0]}function De(e,t,r){if(t){let n=e.ts.createPrinter({newLine:e.ts.NewLineKind.LineFeed,removeComments:r});return e.ts.isSourceFile(t)?n.printFile(t).trim()+`
|
|
24
24
|
`:n.printNode(e.ts.EmitHint.Unspecified,t,e.ts.createSourceFile("module.tsx","",e.ts.ScriptTarget.Latest)).trim()+`
|
|
25
|
-
`}return""}var
|
|
26
|
-
`,getSourceFile:a=>{if(a=e.normalize(a),a.includes("node_modules")){let c=
|
|
27
|
-
${u}`)}else n(`Request to ${e.url.href} failed with status ${o.statusCode}: ${a}`)})}).on("error",o=>{n(`Error fetching ${e.url.href}, ${o}`)});e.body&&(s.setHeader("Content-Type","application/json"),s.write(e.body)),s.end()})}function
|
|
25
|
+
`}return""}var ca=we(aa(),1);function He(e){return e.endsWith(".mapper.tsx")||e.endsWith(".mapper.jsx")||e.endsWith(".mapper.ts")||e.endsWith(".mapper.js")||e.endsWith(".mapper.mjs")}function W(e,t,r){t=ct(t),r=ct(r),t=e.dirname(t);let n=e.basename(r,e.extname(r));r=e.dirname(r);let i;return n==="index"?i=e.relative(t,r):i=e.relative(t,e.join(r,n)),i=ct(e.normalize(i)),i.startsWith(".")||(i="./"+i),i}function ct(e){return e.startsWith("\\\\?\\")?e:e.replace(/\\/g,"/")}function rr(e,t){let r=e.extname(t),n=e.basename(t,r).split(/[\/\\]/),i=n[n.length-1];return ua(i==="index"?e.basename(e.dirname(t)):i)}function ua(e){return ee(e).replace(/ /g,"")}function Xe(e,t){let r=e.extname(t),n=ct(e.basename(t,r)).split("/").pop();return ee(n==="index"?e.basename(e.dirname(t)):n)}function te(e,t){let r=ct(e.relative(e.getAppRootDir(),t));r=r.split("/").filter(i=>i!=="."&&i!==".."&&i!=="").join("/"),r.endsWith(".tsx")||r.endsWith(".jsx")?r=r.slice(0,-4):(r.endsWith(".ts")||r.endsWith(".js"))&&(r=r.slice(0,-3));let n=e.getFrameworks();return r.startsWith("src/")&&(r=r.slice(4)),n.some(i=>i.name.includes("next"))?"@/"+r:"~/"+r}function Y(e,t){let r=t,n=[];for(let i=0;i<2;i++){let s=e.basename(r);if(!s||s==="components")break;n.unshift(s),r=e.dirname(r)}return n.join("/")}function ee(e){for(e=e.replace(/([A-Z])/g," $1").replace(/\./g," ").replace(/_/g," ").replace(/-/g," ").replace(/\s/g," ").trim();e.includes(" ");)e=e.replace(/ /g," ");return e.split(" ").map(t=>t.length>2?t[0].toUpperCase()+t.slice(1):t).join("").trim()}function $e(e){return e.sort((t,r)=>t.name.toLocaleLowerCase().localeCompare(r.name.toLocaleLowerCase()))}async function Z(e,t,r,n){if(typeof r!="string"||r==="")throw new Error(`getComponentId(), exportName must be a non-empty string, received: ${r}, ${t}`);return n&&(t=n),t=e.normalize(t),(await e.hash(t+"#"+r)).substring(0,8)}async function la(e){return(await e.hash(e.getAppRootDir())).substring(0,8)}function qr(e){return typeof e=="number"}function br(e){return typeof e=="boolean"}function Re(e){return typeof e=="string"}function wr(e){return typeof e=="string"?/^[A-Z][A-Za-z0-9]*$/.test(e):!1}function Ke(e){return JSON.parse(JSON.stringify(e))}function Un(e,t,r){for(let n of t)if(e.dirname(r).includes(n))return!0;return!1}function pa(){try{let e=(0,ca.default)();if(e?.name)return e.name}catch{}return"npm"}function of(){return process.platform.startsWith("win")}function _e(){return of()?'"@builder.io/dev-tools"':"builder.io"}function Ie(e){let t=e.join(e.getAppRootDir(),"tsconfig.json");return e.exists(t)}var sf=["node_modules","dist","build","public"];async function Ne(e,t){async function r(i,s){if(s>10)return;let o=await e.readdir(i);for(let a of o){if(sf.includes(a))continue;let u=e.join(i,a),c=await e.stat(u);if(c){if(c.isFile()&&a.startsWith("builder-registry."))return u;if(c.isDirectory()){let l=await r(u,s+1);if(l)return l}}}}let n=await r(e.getAppRootDir(),0);if(!n){let s=`builder-registry.${await Ie(e)?"ts":"js"}`;return e.join(t,s)}return n}async function Gt(e,t){let r=e.resolve("/");for(let n=0;n<20;n++){let i=e.join(t,"package.json"),s=await e.readFile(i);if(s)return JSON.parse(s);if(t===r)break;t=e.dirname(t)}return null}async function da(e,t){for(let r=0;r<20;r++){let n=e.dirname(t),i=e.join(n,"node_modules");if(await e.exists(i))return i;if(t===e.getAppRootDir())break;t=e.dirname(t)}return e.join(e.getAppRootDir(),"node_modules")}async function Jr(e,t,r){let n=await e.readdir(t);return n.includes(r)?e.join(t,r):(await Promise.all(n.map(async s=>{if(s.startsWith(".")||s==="node_modules")return;let o=e.join(t,s);if((await e.stat(o)).isDirectory()){let u=await Jr(e,o,r);if(u)return u}}))).find(s=>typeof s=="string")}async function ge(e,t,r){if(!Array.isArray(t)||t.length===0)throw new Error(`createTsProgram() Invalid filePaths: ${t}`);let n=await da(e,t[0]),i=e.join(n,"typescript","lib"),s=new Map,o={fileExists:a=>{if(a=e.normalize(a),a.includes("node_modules")){let u=Yr.get(a);if(!u){try{e.statSync(a).isFile()?u={exists:!0,content:e.readFileSync(a)}:u={exists:!1}}catch{u={exists:!1}}Yr.set(a,u)}return u.exists}if(!s.has(a))if(e.existsSync(a)){let c=e.statSync(a);s.set(a,c.isFile())}else s.set(a,!1);return s.get(a)},getCanonicalFileName:a=>e.normalize(a),getCurrentDirectory:()=>e.cwd(),getDefaultLibFileName:()=>e.join(i,"lib.d.ts"),getDefaultLibLocation:()=>i,getNewLine:()=>`
|
|
26
|
+
`,getSourceFile:a=>{if(a=e.normalize(a),a.includes("node_modules")){let c=Yr.get(a);if(c)return G(e,c.content)}let u;try{u=e.readFileSync(a)}catch{console.error(`Could not read: ${a}`),u==null}if(u==null){let c=e.basename(a),l=e.extname(c).toLowerCase();if(a.startsWith(i)&&l===".ts"&&(u=ma.get(c),u==null&&typeof self<"u"&&typeof fetch=="function"))throw new Hn(c)}return a.includes("node_modules")&&(u?Yr.set(a,{exists:!0,content:u}):Yr.set(a,{exists:!1})),G(e,u)},readFile:a=>{let u=e.readFileSync(a);return typeof u=="string"?u:void 0},useCaseSensitiveFileNames:()=>!1,writeFile:()=>{}};for(;;)try{return af(e,o,t,r)}catch(a){if(a instanceof Hn){await uf(e,a.libName);continue}throw e.Sentry?.captureException(a),new Error(`createTsProgram() Could not create program for: ${t[0]}`,{cause:a})}}function af(e,t,r,n){let i={rootNames:[...r],host:t,options:{}},s=e.ts.findConfigFile(e.dirname(r[0]),o=>e.existsSync(o));if(s){let o=fa.get(s);if(!o){let a=e.ts.readConfigFile(s,u=>{let c=e.readFileSync(u);return typeof c=="string"?c:void 0});a.error?e.Sentry?.captureException(new Error("Error reading tsconfig for createTsProgram"),{extra:{error:a.error,tsConfigPath:s}}):(o=e.ts.parseJsonConfigFileContent(a.config,e.ts.sys||{useCaseSensitiveFileNames:!1,readDirectory:(c,l)=>e.readdirSync(c),fileExists:c=>e.existsSync(c),readFile:c=>e.readFileSync(c)||void 0},e.dirname(s),void 0,s).options,fa.set(s,o))}o&&(i.options=Ke(o))}return i.options.noEmit=!0,i.options.isolatedModules=!1,i.options.strict=!1,i.options.jsx=e.ts.JsxEmit.Preserve,i.options.allowJs=!0,Object.assign(i.options,n),e.ts.createProgram(i)}async function Er(e,t,r){r||(r=await ge(e,[t]));let n=r.getSourceFile(t);if(!n)throw new Error(`getTypeChecker() Could not find source file: ${t}`);return{typeChecker:r.getTypeChecker(),sourceFile:n}}var Hn=class{constructor(t){ve(this,"libName");this.libName=t}};async function uf(e,t){let r=`https://cdn.jsdelivr.net/npm/typescript@${e.ts.version}/lib/${t}`;Vn.has(t)||Vn.set(t,fetch(r).then(n=>n.text()).then(n=>{ma.set(t,n)})),await Vn.get(t),Vn.delete(t)}var ma=new Map,Vn=new Map,Yr=new Map,fa=new Map;async function ga(e,t){let r=await e.readFile(t.filePath);return r==null?{diagnostics:[{messageText:`Error reading: ${t.filePath}`}],code:null,output:null}:Go(e,{code:r,filePath:t.filePath,compilerOptions:t.compilerOptions})}function Go(e,t){let r={diagnostics:[],code:t.code,output:null};try{let n=e.ts.transpileModule(t.code,{compilerOptions:t.compilerOptions,fileName:t.filePath??"module.tsx",reportDiagnostics:!0});n.diagnostics?.forEach(i=>{r.diagnostics.push({messageText:String(i.messageText)})}),r.output=n.outputText}catch(n){console.error("transpileModule",n),r.diagnostics.push({messageText:String(n)})}return r}import{access as Y0,mkdir as lf,readdir as Q0,readFile as pf,stat as X0,unlink as Z0,writeFile as df}from"fs/promises";import{homedir as ff,hostname as tb}from"os";import Ca from"path";import ob from"typescript";import sb from"launch-editor";async function vr(e){let t=[],r=await Gt(e,e.getRepoRootDir());if(r){let n=await Da(r,e);t.push(...n)}return t}async function Da(e,t){let r=[];if(e&&typeof e=="object"){let n=new Set(Object.keys({...e.dependencies,...e.devDependencies}));for(let i of cf)if(n.has(i)&&!r.some(s=>s.name===i)){let s={name:i};ha.has(i)&&(s.version=await ha.get(i)(t)),r.push(s)}}return r}function Wo(e){let t=parseInt(e);return Number.isNaN(t)?void 0:t}var ha=new Map([["next",async e=>{if(!e.spawnSync)return;let t=pa(),r=t==="npm"?"npx":t,{stdout:n}=e.spawnSync(r,["next","-v"],{encoding:"utf8"});if(!n)return;let i=n.match(/(Next.js v)([\d.]+)/g);if(!i)return;let s=i[0].split("Next.js v")[1],[o,a,u]=s.split(".");return{major:Wo(o),minor:Wo(a),patch:Wo(u)}}]]),cf=["@shopify/remix-oxygen","@shopify/hydrogen","@builder.io/qwik-city","@remix-run/react","@sveltejs/kit","astro","gatsby","next","nuxt","@builder.io/qwik","@angular/core","react","solid-js","svelte","vue"];import*as mf from"@sentry/node";import lb from"prettier";function ya(){let e=ff();return Ca.join(e,".config","builder","dev-tools.json")}function zo(e,t){return typeof e=="object"&&e!=null&&t in e}async function Sr(){let e=ya();try{let t=await pf(e,"utf-8");if(typeof t=="string")return JSON.parse(t)}catch(t){if(t.code==="ENOENT")return null}return null}async function qo(e){let t=ya();e=typeof e=="object"&&e!=null?e:{},await lf(Ca.dirname(t),{recursive:!0}),await df(t,JSON.stringify(e??{},null,2))}var N={gen1:"Gen 1",gen2:"Gen 2"},Qr={CMS:"cms",VCP:"vcp",HYBRID:"hybrid"};import{debug as gf}from"console";import{request as hf}from"http";import{request as Df}from"https";function Fr(e){let t=Date.now();return new Promise((r,n)=>{let s=Cf(e.url)({protocol:e.url.protocol,host:e.url.host,port:e.url.port,path:e.url.pathname+e.url.search,method:e.method,headers:e.headers},o=>{let a="";o.on("data",u=>{a+=u}),o.on("end",()=>{if(gf(`${e.method} ${e.url.href}, duration: ${Date.now()-t}ms`),typeof o.statusCode=="number"&&o.statusCode>=200&&o.statusCode<300)if(typeof o.headers["content-type"]!="string"||!o.headers["content-type"].includes("application/json"))n(`Response from ${e.url.href} content-type is ${o.headers["content-type"]}`);else try{r(JSON.parse(a))}catch(u){n(`Response from ${e.url.href} is not valid JSON: ${a}
|
|
27
|
+
${u}`)}else n(`Request to ${e.url.href} failed with status ${o.statusCode}: ${a}`)})}).on("error",o=>{n(`Error fetching ${e.url.href}, ${o}`)});e.body&&(s.setHeader("Content-Type","application/json"),s.write(e.body)),s.end()})}function Cf(e){if(e.protocol==="https:")return Df;if(e.protocol==="http:")return hf;throw new Error(`Unsupported protocol ${e.protocol}`)}async function xa(e){let t=new URL(`https://cdn.builder.io/api/v3/query/${e.publicApiKey}/${e.model}`);return t.searchParams.set("omit","meta.componentsUsed"),t.searchParams.set("apiKey",e.publicApiKey),t.searchParams.set("userAttributes.urlPath",e.pageUrl),t.searchParams.set("options.page.model",`"${e.model}"`),t.searchParams.set("cachebust","true"),(await Fr({url:t,method:"GET"}))[e.model]}async function ba(e,t){if(t.kind===Qr.VCP)return!0;let r=new URL("https://cdn.builder.io/api/v2/admin"),n={query:`query {
|
|
28
28
|
models {
|
|
29
29
|
id
|
|
30
30
|
name
|
|
31
31
|
}
|
|
32
|
-
}`};e.debug(`Get model id for model name "${t.model}"`);let s=(await
|
|
32
|
+
}`};e.debug(`Get model id for model name "${t.model}"`);let s=(await Fr({url:r,method:"POST",headers:{Authorization:`Bearer ${t.privateAuthKey}`,"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(n)})).data.models.find(u=>u.name===t.model);if(!s)return e.debug(`No model found for model name "${t.model}"`),!1;e.debug(`Data query, modelId: "${s.id}", urlPath: "${t.pageUrl}"`);let o=new URL("https://cdn.builder.io/api/v3/data");o.searchParams.set("limit","1"),o.searchParams.set("cachebust","true"),o.searchParams.set("collection","content"),o.searchParams.set("query.published.$ne","archived"),o.searchParams.set("query.query.$elemMatch.$and[0].property","urlPath"),o.searchParams.set("query.query.$elemMatch.$and[0].operator","is"),o.searchParams.set("query.query.$elemMatch.$and[0].value",t.pageUrl),o.searchParams.set("query.modelId",s.id),o.searchParams.set("apiKey",t.publicApiKey);let a=await Fr({url:o,method:"GET"});return e.debug(`Data results (${a.results.length}): ${o.href}`),a.results.length>0}async function wa(e,t){let r=new URL(`https://cdn.builder.io/api/v3/content/${t.model}`);r.searchParams.set("apiKey",t.publicApiKey),r.searchParams.set("cachebust","true"),r.searchParams.set("cb",Date.now().toString()),t.pageUrl&&(r.searchParams.set("url",t.pageUrl),e.debug(`get model: "${t.model}", pageUrl: "${t.pageUrl}":`,r.href)),t.id&&(r.searchParams.set("query.id",t.id),e.debug(`get model: "${t.model}", id: "${t.id}":`,r.href));let n=await Fr({url:r,method:"GET"});return e.debug(`get content results: ${n.results.length}`),n}async function Ea(e,t){let r=new URL(`https://cdn.builder.io/api/v1/write/${t.model}`);e.debug(`writing "${t.model}" content:`,r.href),await Fr({url:r,method:"POST",headers:{Authorization:`Bearer ${t.privateAuthKey}`},body:t.body})}var Ar="page",va="integration-welcome-screens",Sa="8d9ee72a33344b4b867918b442ebd0af";async function Fa(e,t){let r=await wa(e,{model:va,publicApiKey:Sa,id:t.templateContentId});if(!Array.isArray(r?.results)||r.results.length===0||!r.results[0].data?.blocks)throw new Error(`No Builder content found for id ${t.templateContentId}`);let n=JSON.stringify(r.results[0].data.blocks),i=yf(t.publicApiKey,t.pathname,t.title,n);await Ea(e,{privateAuthKey:t.privateAuthKey,model:Ar,body:i})}function yf(e,t,r,n){return JSON.stringify({name:r,ownerId:e,published:"published",query:[{property:"urlPath",value:[t],operator:"is"}],data:{title:r,blocksString:n}})}async function Aa(e,t,r,n){e.debug(`connect builder with public key: ${t}`),e.publicApiKey=t;let i=e.closeAppServer(),s=await e.setPublicApiKey({publicApiKey:t});if(s.modifiedType==="permission-error")return e.debug("permission error, failed to set public api key"),{success:!1,pathname:""};e.debug(`set public key: process.env.${s.envKey}=${t}`),process.env[s.envKey]=t;let o=await e.builderPageOptions();e.debug(`builder model: ${Ar}, path: ${o.pathname}, template: ${o.templateContentId}`);let a=await ba(e,{model:Ar,pageUrl:o.pathname,publicApiKey:t,privateAuthKey:r,kind:n});if(!a){await Fa(e,{templateContentId:o.templateContentId,pathname:o.pathname,title:o.title,publicApiKey:t,privateAuthKey:r});let l=5,p=0;for(;!a&&p<l;){await new Promise(D=>setTimeout(D,1e3));let d=await xa({model:Ar,pageUrl:o.pathname,publicApiKey:t,privateAuthKey:r});p++,d&&d.length>0&&(a=!0)}}await i,e.debug("ensure builder setup");let u=[];n===Qr.VCP?u=await e.ensureFigmaImportPage():u=await e.ensureBuilderSetup(),s.modifiedType&&u.push({filePath:s.file,modifiedType:s.modifiedType}),u.forEach(l=>{l.displayFilePath=e.relative(e.getAppRootDir(),l.filePath)}),u.sort((l,p)=>l.filePath.localeCompare(p.filePath)),u.length>0?(e.debug(`modified files: ${u.map(l=>l.displayFilePath).join(", ")}`),await e.restartAppServer(),await new Promise(l=>setTimeout(l,500))):e.debug("no modified files");let c={success:!0,pathname:o.localePathname||o.pathname,modifiedFiles:u,platform:e.platform(),kind:n};return n===Qr.VCP&&(c.pathname="/"),e.debug(`connected builder: ${c.pathname}`),c}async function Pa(e){let t=await e.builderPageOptions();e.debug(`validateBuilder, pathname: ${t.pathname}, localePathname: ${t.localePathname}, isValid: ${e.isValid}`);let r={isValid:e.isValid,pathname:t.localePathname||t.pathname,platform:e.platform()};if(e.isValid)return r;let n=await e.getPublicApiKey();return n.envValue?(e.debug(`public api key: ${n.envValue}, ${n.file}`),e.publicApiKey=n.envValue,e.debug("builder connection is valid"),r.isValid=!0,e.isValid=!0,r):(e.debug("missing public api key"),r)}async function Ta(e,t){let r={type:t.type};switch(t.type){case"getCache":{r.data=await e.getCache();break}case"setCache":{await e.setCache(t.data);break}case"connectBuilder":{r.data=await Aa(e,t.data.publicApiKey,t.data.privateAuthKey,t.data.kind);break}case"enableDevTools":{r.data=wf(e,t.data.enabled);break}case"getRegistry":{r.data=await e.getRegistry(t.data);break}case"launchEditor":{r.data=await e.launchEditor(t.data);break}case"validateBuilder":{r.data=await Pa(e);break}case"loadComponent":{r.data=await e.loadComponent(t.data);break}case"getAllProjectFiles":{e.getAllProjectFiles?r.data=await e.getAllProjectFiles():r.errors=["getAllProjectFiles not implemented"];break}case"registerComponent":{r.data=await e.registerComponent(t.data),e.serverShouldRestart=!0;break}case"setComponentInfo":{r.data=await e.setRegisteredComponentInfo(t.data),e.serverShouldRestart=!0;break}case"setComponentInput":{r.data=await e.setRegisteredComponentInput(t.data),e.serverShouldRestart=!0;break}case"unregisterComponent":{r.data=await e.unregisterComponent(t.data),e.serverShouldRestart=!0;break}case"getFrameworks":{r.data=e.getFrameworks();break}case"readdir":{Jo(e,t.path)?r.data=await e.readdir(t.path,!0):r.errors=[`Invalid file request: ${t.path}`];break}case"readFile":{Jo(e,t.path)?r.data=await e.readFile(t.path):r.errors=[`Invalid file request: ${t.path}`];break}case"writeFile":{Jo(e,t.path)?await e.writeFile(t.path,t.content):r.errors=[`Invalid file request: ${t.path}`];break}case"ensureFigmaImportPage":{r.data=await e.ensureFigmaImportPage();break}case"transileFile":{r.data=await ga(e,t);break}case"transileModule":{r.data=Go(e,t);break}case"getPastSyncInfo":{r.data=await e.getPastSyncInfo?.(t.data);break}case"resyncSnippet":{r.data=await e.resyncSnippet?.(t.data);break}case"localConfig":{r.data=await Sr();break}default:{r.errors=[`Unknown request type: ${JSON.stringify(t)}`];let n=t}}return r}function Jo(e,t){if(!t||t.includes(".."))return!1;t=t.replace(/\\/g,"/");let r=t.split("/"),n=r[r.length-1];if(n.length>0){let i=n.split(".").pop();if(i&&(i=`.${i}`.toLocaleLowerCase(),i=i.split("?")[0],!bf.includes(i)))return!1}return xf(e,t),!1}function xf(e,t){if(!t)return!1;t=e.normalize(e.resolve(t));let r=e.getAppRootDir();return!(!t.startsWith(r)&&!t.includes("node_modules"))}var bf=[".js",".jsx",".ts",".tsx",".json",".css",".scss",".sass",".less",".html",".htm",".xml",".svg",".png",".jpg",".jpeg",".gif",".ico",".webp",".woff",".woff2",".ttf",".eot",".mp4",".webm",".ogg",".md",".txt",".csv",".pdf"];function wf(e,t){return!t&&e.serverShouldRestart&&setTimeout(()=>{console.log(`
|
|
33
33
|
Restarting server after Builder Devtools update...
|
|
34
|
-
`),e.restartAppServer()},10),e.enableAppWatch(!t),{enabled:t,platform:e.platform()}}async function za(e){return Ja(e,`"use strict";(()=>{var fi=Object.create;var Mt=Object.defineProperty;var mi=Object.getOwnPropertyDescriptor;var vi=Object.getOwnPropertyNames;var gi=Object.getPrototypeOf,hi=Object.prototype.hasOwnProperty;var yi=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),bi=(t,e)=>{for(var r in e)Mt(t,r,{get:e[r],enumerable:!0})},Ei=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of vi(e))!hi.call(t,i)&&i!==r&&Mt(t,i,{get:()=>e[i],enumerable:!(n=mi(e,i))||n.enumerable});return t};var _i=(t,e,r)=>(r=t!=null?fi(gi(t)):{},Ei(e||!t||!t.__esModule?Mt(r,"default",{value:t,enumerable:!0}):r,t));var jn=yi((Qe,Ct)=>{(function(t,e){"use strict";var r="0.7.33",n="",i="?",o="function",s="undefined",u="object",d="string",p="major",a="model",c="name",l="type",f="vendor",m="version",_="architecture",b="console",v="mobile",y="tablet",T="smarttv",L="wearable",k="embedded",w=350,C="Amazon",R="Apple",K="ASUS",z="BlackBerry",Q="Browser",P="Chrome",Ce="Edge",ce="Firefox",_e="Google",Me="Huawei",Re="LG",Oe="Microsoft",Be="Motorola",Te="Opera",we="Samsung",ke="Sharp",fe="Sony",me="Xiaomi",Ve="Zebra",U="Facebook",et=function(S,O){var I={};for(var q in S)O[q]&&O[q].length%2===0?I[q]=O[q].concat(S[q]):I[q]=S[q];return I},tt=function(S){for(var O={},I=0;I<S.length;I++)O[S[I].toUpperCase()]=S[I];return O},Pr=function(S,O){return typeof S===d?Fe(O).indexOf(Fe(S))!==-1:!1},Fe=function(S){return S.toLowerCase()},di=function(S){return typeof S===d?S.replace(/[^\\d\\.]/g,n).split(".")[0]:e},Nt=function(S,O){if(typeof S===d)return S=S.replace(/^\\s\\s*/,n),typeof O===s?S:S.substring(0,w)},He=function(S,O){for(var I=0,q,x,nt,D,qe,ie;I<O.length&&!qe;){var Or=O[I],kr=O[I+1];for(q=x=0;q<Or.length&&!qe;)if(qe=Or[q++].exec(S),qe)for(nt=0;nt<kr.length;nt++)ie=qe[++x],D=kr[nt],typeof D===u&&D.length>0?D.length===2?typeof D[1]==o?this[D[0]]=D[1].call(this,ie):this[D[0]]=D[1]:D.length===3?typeof D[1]===o&&!(D[1].exec&&D[1].test)?this[D[0]]=ie?D[1].call(this,ie,D[2]):e:this[D[0]]=ie?ie.replace(D[1],D[2]):e:D.length===4&&(this[D[0]]=ie?D[3].call(this,ie.replace(D[1],D[2])):e):this[D]=ie||e;I+=2}},Ut=function(S,O){for(var I in O)if(typeof O[I]===u&&O[I].length>0){for(var q=0;q<O[I].length;q++)if(Pr(O[I][q],S))return I===i?e:I}else if(Pr(O[I],S))return I===i?e:I;return S},pi={"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},Cr={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Rr={browser:[[/\\b(?:crmo|crios)\\/([\\w\\.]+)/i],[m,[c,"Chrome"]],[/edg(?:e|ios|a)?\\/([\\w\\.]+)/i],[m,[c,"Edge"]],[/(opera mini)\\/([-\\w\\.]+)/i,/(opera [mobiletab]{3,6})\\b.+version\\/([-\\w\\.]+)/i,/(opera)(?:.+version\\/|[\\/ ]+)([\\w\\.]+)/i],[c,m],[/opios[\\/ ]+([\\w\\.]+)/i],[m,[c,Te+" Mini"]],[/\\bopr\\/([\\w\\.]+)/i],[m,[c,Te]],[/(kindle)\\/([\\w\\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\\/ ]?([\\w\\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\\/ ]?([\\w\\.]*)/i,/(ba?idubrowser)[\\/ ]?([\\w\\.]+)/i,/(?:ms|\\()(ie) ([\\w\\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq|duckduckgo)\\/([-\\w\\.]+)/i,/(weibo)__([\\d\\.]+)/i],[c,m],[/(?:\\buc? ?browser|(?:juc.+)ucweb)[\\/ ]?([\\w\\.]+)/i],[m,[c,"UC"+Q]],[/microm.+\\bqbcore\\/([\\w\\.]+)/i,/\\bqbcore\\/([\\w\\.]+).+microm/i],[m,[c,"WeChat(Win) Desktop"]],[/micromessenger\\/([\\w\\.]+)/i],[m,[c,"WeChat"]],[/konqueror\\/([\\w\\.]+)/i],[m,[c,"Konqueror"]],[/trident.+rv[: ]([\\w\\.]{1,9})\\b.+like gecko/i],[m,[c,"IE"]],[/yabrowser\\/([\\w\\.]+)/i],[m,[c,"Yandex"]],[/(avast|avg)\\/([\\w\\.]+)/i],[[c,/(.+)/,"$1 Secure "+Q],m],[/\\bfocus\\/([\\w\\.]+)/i],[m,[c,ce+" Focus"]],[/\\bopt\\/([\\w\\.]+)/i],[m,[c,Te+" Touch"]],[/coc_coc\\w+\\/([\\w\\.]+)/i],[m,[c,"Coc Coc"]],[/dolfin\\/([\\w\\.]+)/i],[m,[c,"Dolphin"]],[/coast\\/([\\w\\.]+)/i],[m,[c,Te+" Coast"]],[/miuibrowser\\/([\\w\\.]+)/i],[m,[c,"MIUI "+Q]],[/fxios\\/([-\\w\\.]+)/i],[m,[c,ce]],[/\\bqihu|(qi?ho?o?|360)browser/i],[[c,"360 "+Q]],[/(oculus|samsung|sailfish|huawei)browser\\/([\\w\\.]+)/i],[[c,/(.+)/,"$1 "+Q],m],[/(comodo_dragon)\\/([\\w\\.]+)/i],[[c,/_/g," "],m],[/(electron)\\/([\\w\\.]+) safari/i,/(tesla)(?: qtcarbrowser|\\/(20\\d\\d\\.[-\\w\\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\\/ ]?([\\w\\.]+)/i],[c,m],[/(metasr)[\\/ ]?([\\w\\.]+)/i,/(lbbrowser)/i,/\\[(linkedin)app\\]/i],[c],[/((?:fban\\/fbios|fb_iab\\/fb4a)(?!.+fbav)|;fbav\\/([\\w\\.]+);)/i],[[c,U],m],[/safari (line)\\/([\\w\\.]+)/i,/\\b(line)\\/([\\w\\.]+)\\/iab/i,/(chromium|instagram)[\\/ ]([-\\w\\.]+)/i],[c,m],[/\\bgsa\\/([\\w\\.]+) .*safari\\//i],[m,[c,"GSA"]],[/headlesschrome(?:\\/([\\w\\.]+)| )/i],[m,[c,P+" Headless"]],[/ wv\\).+(chrome)\\/([\\w\\.]+)/i],[[c,P+" WebView"],m],[/droid.+ version\\/([\\w\\.]+)\\b.+(?:mobile safari|safari)/i],[m,[c,"Android "+Q]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\\/v?([\\w\\.]+)/i],[c,m],[/version\\/([\\w\\.\\,]+) .*mobile\\/\\w+ (safari)/i],[m,[c,"Mobile Safari"]],[/version\\/([\\w(\\.|\\,)]+) .*(mobile ?safari|safari)/i],[m,c],[/webkit.+?(mobile ?safari|safari)(\\/[\\w\\.]+)/i],[c,[m,Ut,pi]],[/(webkit|khtml)\\/([\\w\\.]+)/i],[c,m],[/(navigator|netscape\\d?)\\/([-\\w\\.]+)/i],[[c,"Netscape"],m],[/mobile vr; rv:([\\w\\.]+)\\).+firefox/i],[m,[c,ce+" Reality"]],[/ekiohf.+(flow)\\/([\\w\\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\\/ ]?([\\w\\.\\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\\/([-\\w\\.]+)$/i,/(firefox)\\/([\\w\\.]+)/i,/(mozilla)\\/([\\w\\.]+) .+rv\\:.+gecko\\/\\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\\. ]?browser)[-\\/ ]?v?([\\w\\.]+)/i,/(links) \\(([\\w\\.]+)/i],[c,m],[/(cobalt)\\/([\\w\\.]+)/i],[c,[m,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\\)]/i],[[_,"amd64"]],[/(ia32(?=;))/i],[[_,Fe]],[/((?:i[346]|x)86)[;\\)]/i],[[_,"ia32"]],[/\\b(aarch64|arm(v?8e?l?|_?64))\\b/i],[[_,"arm64"]],[/\\b(arm(?:v[67])?ht?n?[fl]p?)\\b/i],[[_,"armhf"]],[/windows (ce|mobile); ppc;/i],[[_,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\\))/i],[[_,/ower/,n,Fe]],[/(sun4\\w)[;\\)]/i],[[_,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\\))|\\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\\b|pa-risc)/i],[[_,Fe]]],device:[[/\\b(sch-i[89]0\\d|shw-m380s|sm-[ptx]\\w{2,4}|gt-[pn]\\d{2,4}|sgh-t8[56]9|nexus 10)/i],[a,[f,we],[l,y]],[/\\b((?:s[cgp]h|gt|sm)-\\w+|galaxy nexus)/i,/samsung[- ]([-\\w]+)/i,/sec-(sgh\\w+)/i],[a,[f,we],[l,v]],[/((ipod|iphone)\\d+,\\d+)/i],[a,[f,R],[l,v]],[/(ipad\\d+,\\d+)/i],[a,[f,R],[l,y]],[/\\((ip(?:hone|od)[\\w ]*);/i],[a,[f,R],[l,v]],[/\\((ipad);[-\\w\\),; ]+apple/i,/applecoremedia\\/[\\w\\.]+ \\((ipad)/i,/\\b(ipad)\\d\\d?,\\d\\d?[;\\]].+ios/i],[a,[f,R],[l,y]],[/(macintosh);/i],[a,[f,R]],[/\\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\\d{2})\\b(?!.+d\\/s)/i],[a,[f,Me],[l,y]],[/(?:huawei|honor)([-\\w ]+)[;\\)]/i,/\\b(nexus 6p|\\w{2,4}e?-[atu]?[ln][\\dx][012359c][adn]?)\\b(?!.+d\\/s)/i],[a,[f,Me],[l,v]],[/\\b(poco[\\w ]+)(?: bui|\\))/i,/\\b; (\\w+) build\\/hm\\1/i,/\\b(hm[-_ ]?note?[_ ]?(?:\\d\\w)?) bui/i,/\\b(redmi[\\-_ ]?(?:note|k)?[\\w_ ]+)(?: bui|\\))/i,/\\b(mi[-_ ]?(?:a\\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\\d?\\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\\))/i],[[a,/_/g," "],[f,me],[l,v]],[/\\b(mi[-_ ]?(?:pad)(?:[\\w_ ]+))(?: bui|\\))/i],[[a,/_/g," "],[f,me],[l,y]],[/; (\\w+) bui.+ oppo/i,/\\b(cph[12]\\d{3}|p(?:af|c[al]|d\\w|e[ar])[mt]\\d0|x9007|a101op)\\b/i],[a,[f,"OPPO"],[l,v]],[/vivo (\\w+)(?: bui|\\))/i,/\\b(v[12]\\d{3}\\w?[at])(?: bui|;)/i],[a,[f,"Vivo"],[l,v]],[/\\b(rmx[12]\\d{3})(?: bui|;|\\))/i],[a,[f,"Realme"],[l,v]],[/\\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\\b[\\w ]+build\\//i,/\\bmot(?:orola)?[- ](\\w*)/i,/((?:moto[\\w\\(\\) ]+|xt\\d{3,4}|nexus 6)(?= bui|\\)))/i],[a,[f,Be],[l,v]],[/\\b(mz60\\d|xoom[2 ]{0,2}) build\\//i],[a,[f,Be],[l,y]],[/((?=lg)?[vl]k\\-?\\d{3}) bui| 3\\.[-\\w; ]{10}lg?-([06cv9]{3,4})/i],[a,[f,Re],[l,y]],[/(lm(?:-?f100[nv]?|-[\\w\\.]+)(?= bui|\\))|nexus [45])/i,/\\blg[-e;\\/ ]+((?!browser|netcast|android tv)\\w+)/i,/\\blg-?([\\d\\w]+) bui/i],[a,[f,Re],[l,v]],[/(ideatab[-\\w ]+)/i,/lenovo ?(s[56]000[-\\w]+|tab(?:[\\w ]+)|yt[-\\d\\w]{6}|tb[-\\d\\w]{6})/i],[a,[f,"Lenovo"],[l,y]],[/(?:maemo|nokia).*(n900|lumia \\d+)/i,/nokia[-_ ]?([-\\w\\.]*)/i],[[a,/_/g," "],[f,"Nokia"],[l,v]],[/(pixel c)\\b/i],[a,[f,_e],[l,y]],[/droid.+; (pixel[\\daxl ]{0,6})(?: bui|\\))/i],[a,[f,_e],[l,v]],[/droid.+ (a?\\d[0-2]{2}so|[c-g]\\d{4}|so[-gl]\\w+|xq-a\\w[4-7][12])(?= bui|\\).+chrome\\/(?![1-6]{0,1}\\d\\.))/i],[a,[f,fe],[l,v]],[/sony tablet [ps]/i,/\\b(?:sony)?sgp\\w+(?: bui|\\))/i],[[a,"Xperia Tablet"],[f,fe],[l,y]],[/ (kb2005|in20[12]5|be20[12][59])\\b/i,/(?:one)?(?:plus)? (a\\d0\\d\\d)(?: b|\\))/i],[a,[f,"OnePlus"],[l,v]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\\))/i,/(kf[a-z]+)( bui|\\)).+silk\\//i],[a,[f,C],[l,y]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\\)).+silk\\//i],[[a,/(.+)/g,"Fire Phone $1"],[f,C],[l,v]],[/(playbook);[-\\w\\),; ]+(rim)/i],[a,f,[l,y]],[/\\b((?:bb[a-f]|st[hv])100-\\d)/i,/\\(bb10; (\\w+)/i],[a,[f,z],[l,v]],[/(?:\\b|asus_)(transfo[prime ]{4,10} \\w+|eeepc|slider \\w+|nexus 7|padfone|p00[cj])/i],[a,[f,K],[l,y]],[/ (z[bes]6[027][012][km][ls]|zenfone \\d\\w?)\\b/i],[a,[f,K],[l,v]],[/(nexus 9)/i],[a,[f,"HTC"],[l,y]],[/(htc)[-;_ ]{1,2}([\\w ]+(?=\\)| bui)|\\w+)/i,/(zte)[- ]([\\w ]+?)(?: bui|\\/|\\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\\w]*)/i],[f,[a,/_/g," "],[l,v]],[/droid.+; ([ab][1-7]-?[0178a]\\d\\d?)/i],[a,[f,"Acer"],[l,y]],[/droid.+; (m[1-5] note) bui/i,/\\bmz-([-\\w]{2,})/i],[a,[f,"Meizu"],[l,v]],[/\\b(sh-?[altvz]?\\d\\d[a-ekm]?)/i],[a,[f,ke],[l,v]],[/(blackberry|benq|palm(?=\\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\\w]*)/i,/(hp) ([\\w ]+\\w)/i,/(asus)-?(\\w+)/i,/(microsoft); (lumia[\\w ]+)/i,/(lenovo)[-_ ]?([-\\w]+)/i,/(jolla)/i,/(oppo) ?([\\w ]+) bui/i],[f,a,[l,v]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\\/([\\w\\.]+)/i,/(nook)[\\w ]+build\\/(\\w+)/i,/(dell) (strea[kpr\\d ]*[\\dko])/i,/(le[- ]+pan)[- ]+(\\w{1,9}) bui/i,/(trinity)[- ]*(t\\d{3}) bui/i,/(gigaset)[- ]+(q\\w{1,9}) bui/i,/(vodafone) ([\\w ]+)(?:\\)| bui)/i],[f,a,[l,y]],[/(surface duo)/i],[a,[f,Oe],[l,y]],[/droid [\\d\\.]+; (fp\\du?)(?: b|\\))/i],[a,[f,"Fairphone"],[l,v]],[/(u304aa)/i],[a,[f,"AT&T"],[l,v]],[/\\bsie-(\\w*)/i],[a,[f,"Siemens"],[l,v]],[/\\b(rct\\w+) b/i],[a,[f,"RCA"],[l,y]],[/\\b(venue[\\d ]{2,7}) b/i],[a,[f,"Dell"],[l,y]],[/\\b(q(?:mv|ta)\\w+) b/i],[a,[f,"Verizon"],[l,y]],[/\\b(?:barnes[& ]+noble |bn[rt])([\\w\\+ ]*) b/i],[a,[f,"Barnes & Noble"],[l,y]],[/\\b(tm\\d{3}\\w+) b/i],[a,[f,"NuVision"],[l,y]],[/\\b(k88) b/i],[a,[f,"ZTE"],[l,y]],[/\\b(nx\\d{3}j) b/i],[a,[f,"ZTE"],[l,v]],[/\\b(gen\\d{3}) b.+49h/i],[a,[f,"Swiss"],[l,v]],[/\\b(zur\\d{3}) b/i],[a,[f,"Swiss"],[l,y]],[/\\b((zeki)?tb.*\\b) b/i],[a,[f,"Zeki"],[l,y]],[/\\b([yr]\\d{2}) b/i,/\\b(dragon[- ]+touch |dt)(\\w{5}) b/i],[[f,"Dragon Touch"],a,[l,y]],[/\\b(ns-?\\w{0,9}) b/i],[a,[f,"Insignia"],[l,y]],[/\\b((nxa|next)-?\\w{0,9}) b/i],[a,[f,"NextBook"],[l,y]],[/\\b(xtreme\\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[f,"Voice"],a,[l,v]],[/\\b(lvtel\\-)?(v1[12]) b/i],[[f,"LvTel"],a,[l,v]],[/\\b(ph-1) /i],[a,[f,"Essential"],[l,v]],[/\\b(v(100md|700na|7011|917g).*\\b) b/i],[a,[f,"Envizen"],[l,y]],[/\\b(trio[-\\w\\. ]+) b/i],[a,[f,"MachSpeed"],[l,y]],[/\\btu_(1491) b/i],[a,[f,"Rotor"],[l,y]],[/(shield[\\w ]+) b/i],[a,[f,"Nvidia"],[l,y]],[/(sprint) (\\w+)/i],[f,a,[l,v]],[/(kin\\.[onetw]{3})/i],[[a,/\\./g," "],[f,Oe],[l,v]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\\)/i],[a,[f,Ve],[l,y]],[/droid.+; (ec30|ps20|tc[2-8]\\d[kx])\\)/i],[a,[f,Ve],[l,v]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[f,a,[l,b]],[/droid.+; (shield) bui/i],[a,[f,"Nvidia"],[l,b]],[/(playstation [345portablevi]+)/i],[a,[f,fe],[l,b]],[/\\b(xbox(?: one)?(?!; xbox))[\\); ]/i],[a,[f,Oe],[l,b]],[/smart-tv.+(samsung)/i],[f,[l,T]],[/hbbtv.+maple;(\\d+)/i],[[a,/^/,"SmartTV"],[f,we],[l,T]],[/(nux; netcast.+smarttv|lg (netcast\\.tv-201\\d|android tv))/i],[[f,Re],[l,T]],[/(apple) ?tv/i],[f,[a,R+" TV"],[l,T]],[/crkey/i],[[a,P+"cast"],[f,_e],[l,T]],[/droid.+aft(\\w)( bui|\\))/i],[a,[f,C],[l,T]],[/\\(dtv[\\);].+(aquos)/i,/(aquos-tv[\\w ]+)\\)/i],[a,[f,ke],[l,T]],[/(bravia[\\w ]+)( bui|\\))/i],[a,[f,fe],[l,T]],[/(mitv-\\w{5}) bui/i],[a,[f,me],[l,T]],[/\\b(roku)[\\dx]*[\\)\\/]((?:dvp-)?[\\d\\.]*)/i,/hbbtv\\/\\d+\\.\\d+\\.\\d+ +\\([\\w ]*; *(\\w[^;]*);([^;]*)/i],[[f,Nt],[a,Nt],[l,T]],[/\\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\\b/i],[[l,T]],[/((pebble))app/i],[f,a,[l,L]],[/droid.+; (glass) \\d/i],[a,[f,_e],[l,L]],[/droid.+; (wt63?0{2,3})\\)/i],[a,[f,Ve],[l,L]],[/(quest( 2)?)/i],[a,[f,U],[l,L]],[/(tesla)(?: qtcarbrowser|\\/[-\\w\\.]+)/i],[f,[l,k]],[/droid .+?; ([^;]+?)(?: bui|\\) applew).+? mobile safari/i],[a,[l,v]],[/droid .+?; ([^;]+?)(?: bui|\\) applew).+?(?! mobile) safari/i],[a,[l,y]],[/\\b((tablet|tab)[;\\/]|focus\\/\\d(?!.+mobile))/i],[[l,y]],[/(phone|mobile(?:[;\\/]| [ \\w\\/\\.]*safari)|pda(?=.+windows ce))/i],[[l,v]],[/(android[-\\w\\. ]{0,9});.+buil/i],[a,[f,"Generic"]]],engine:[[/windows.+ edge\\/([\\w\\.]+)/i],[m,[c,Ce+"HTML"]],[/webkit\\/537\\.36.+chrome\\/(?!27)([\\w\\.]+)/i],[m,[c,"Blink"]],[/(presto)\\/([\\w\\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\\/([\\w\\.]+)/i,/ekioh(flow)\\/([\\w\\.]+)/i,/(khtml|tasman|links)[\\/ ]\\(?([\\w\\.]+)/i,/(icab)[\\/ ]([23]\\.[\\d\\.]+)/i],[c,m],[/rv\\:([\\w\\.]{1,9})\\b.+(gecko)/i],[m,c]],os:[[/microsoft (windows) (vista|xp)/i],[c,m],[/(windows) nt 6\\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\\/ ]?([\\d\\.\\w ]*)/i,/(windows)[\\/ ]?([ntce\\d\\. ]+\\w)(?!.+xbox)/i],[c,[m,Ut,Cr]],[/(win(?=3|9|n)|win 9x )([nt\\d\\.]+)/i],[[c,"Windows"],[m,Ut,Cr]],[/ip[honead]{2,4}\\b(?:.*os ([\\w]+) like mac|; opera)/i,/cfnetwork\\/.+darwin/i],[[m,/_/g,"."],[c,"iOS"]],[/(mac os x) ?([\\w\\. ]*)/i,/(macintosh|mac_powerpc\\b)(?!.+haiku)/i],[[c,"Mac OS"],[m,/_/g,"."]],[/droid ([\\w\\.]+)\\b.+(android[- ]x86|harmonyos)/i],[m,c],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\\/ ]?([\\w\\.]*)/i,/(blackberry)\\w*\\/([\\w\\.]*)/i,/(tizen|kaios)[\\/ ]([\\w\\.]+)/i,/\\((series40);/i],[c,m],[/\\(bb(10);/i],[m,[c,z]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\\/ ]?([\\w\\.]*)/i],[m,[c,"Symbian"]],[/mozilla\\/[\\d\\.]+ \\((?:mobile|tablet|tv|mobile; [\\w ]+); rv:.+ gecko\\/([\\w\\.]+)/i],[m,[c,ce+" OS"]],[/web0s;.+rt(tv)/i,/\\b(?:hp)?wos(?:browser)?\\/([\\w\\.]+)/i],[m,[c,"webOS"]],[/crkey\\/([\\d\\.]+)/i],[m,[c,P+"cast"]],[/(cros) [\\w]+ ([\\w\\.]+\\w)/i],[[c,"Chromium OS"],m],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\\);]+)/i,/\\b(joli|palm)\\b ?(?:os)?\\/?([\\w\\.]*)/i,/(mint)[\\/\\(\\) ]?(\\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\\/ ]?(?!chrom|package)([-\\w\\.]*)/i,/(hurd|linux) ?([\\w\\.]*)/i,/(gnu) ?([\\w\\.]*)/i,/\\b([-frentopcghs]{0,5}bsd|dragonfly)[\\/ ]?(?!amd|[ix346]{1,2}86)([\\w\\.]*)/i,/(haiku) (\\w+)/i],[c,m],[/(sunos) ?([\\w\\.\\d]*)/i],[[c,"Solaris"],m],[/((?:open)?solaris)[-\\/ ]?([\\w\\.]*)/i,/(aix) ((\\d)(?=\\.|\\)| )[\\w\\.])*/i,/\\b(beos|os\\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\\w\\.]*)/i],[c,m]]},Z=function(S,O){if(typeof S===u&&(O=S,S=e),!(this instanceof Z))return new Z(S,O).getResult();var I=S||(typeof t!==s&&t.navigator&&t.navigator.userAgent?t.navigator.userAgent:n),q=O?et(Rr,O):Rr;return this.getBrowser=function(){var x={};return x[c]=e,x[m]=e,He.call(x,I,q.browser),x.major=di(x.version),x},this.getCPU=function(){var x={};return x[_]=e,He.call(x,I,q.cpu),x},this.getDevice=function(){var x={};return x[f]=e,x[a]=e,x[l]=e,He.call(x,I,q.device),x},this.getEngine=function(){var x={};return x[c]=e,x[m]=e,He.call(x,I,q.engine),x},this.getOS=function(){var x={};return x[c]=e,x[m]=e,He.call(x,I,q.os),x},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return I},this.setUA=function(x){return I=typeof x===d&&x.length>w?Nt(x,w):x,this},this.setUA(I),this};Z.VERSION=r,Z.BROWSER=tt([c,m,p]),Z.CPU=tt([_]),Z.DEVICE=tt([a,f,l,b,v,T,y,L,k]),Z.ENGINE=Z.OS=tt([c,m]),typeof Qe!==s?(typeof Ct!==s&&Ct.exports&&(Qe=Ct.exports=Z),Qe.UAParser=Z):typeof define===o&&define.amd?define(function(){return Z}):typeof t!==s&&(t.UAParser=Z);var Ae=typeof t!==s&&(t.jQuery||t.Zepto);if(Ae&&!Ae.ua){var rt=new Z;Ae.ua=rt.getResult(),Ae.ua.get=function(){return rt.getUA()},Ae.ua.set=function(S){rt.setUA(S);var O=rt.getResult();for(var I in O)Ae.ua[I]=O[I]}}})(typeof window=="object"?window:Qe)});var oe=(t,e)=>{Vt(t);let r=t.querySelector("aside");r.dataset.view=e,r.classList.remove("section-ready"),setTimeout(()=>{r.classList.add("section-ready")},200)},Ar=t=>{Array.from(t.querySelectorAll(".back-button")).forEach(e=>{e.addEventListener("click",r=>{Vt(t),r.preventDefault(),r.stopPropagation();let n=r.target;oe(t,n?.dataset.back||"nav-home")})})},Bt=(t,e)=>{Vt(t);let r=t.querySelector("aside"),n=document.createElement("div");n.className="ui-toast",n.innerHTML=e,r.appendChild(n),setTimeout(()=>{n.classList.add("ui-toast-show"),setTimeout(()=>{n.classList.remove("ui-toast-show"),setTimeout(()=>{n.remove()},500)},4e3)},30)},Vt=t=>{let e=t.querySelector("aside");Array.from(e.querySelectorAll(".ui-toast")).forEach(n=>{n.classList.remove("ui-toast-show")})},it=()=>{let t=Dr();return localStorage.getItem(t)!=="true"},Ft=t=>{let e=Dr();t?localStorage.removeItem(e):localStorage.setItem(e,"true")},Dr=()=>Ti("disableEdit"),Ti=t=>\`builder.__LOCAL_APP_ID__.\${t}\`,Nr=()=>{let e=document.body.querySelector("[builder-content-id]")?.getAttribute("builder-content-id");return je(e)},je=(t,e)=>{let r="/content";t&&(r+="/"+t+"/edit");let n=new URL(r,"https://builder.io");t&&e&&n.searchParams.set("selectedBlock",e);let i=new URL(location.pathname,location.href);return n.searchParams.set("overridePreviewUrl",i.href),n.href},ot="__DEV_TOOLS_URL__",G={components:[],registryPath:"",registryDisplayPath:"",frameworks:[],dependencies:[],publicApiKey:void 0,devToolsVersion:""},le=t=>{G.components=t.components,G.registryPath=t.registryPath,G.registryDisplayPath=t.registryDisplayPath,G.dependencies=t.dependencies,G.publicApiKey=t.publicApiKey};function Ur(t){let e=null,r=document.querySelector("builder-dev-tools-menu"),n=()=>{t.hide()},i=u=>{let d=u.target;if(!d){n();return}if(d.closest("builder-dev-tools-edit"))return;let p=d.closest("[builder-content-id]"),a=d.closest("[builder-id]");if(!p||!a){t.hide();return}let c=t.show(p,a);!c||c===e||(r.highlightOpener(),e=c)};document.addEventListener("pointerover",i,{passive:!0}),document.addEventListener("pointerleave",n,{passive:!0}),document.addEventListener("pointercancel",n,{passive:!0}),document.addEventListener("visibilitychange",n,{passive:!0}),window.addEventListener("popstate",n,{passive:!0});let o=history.pushState;history.pushState=function(...u){t.hide(),o.apply(this,u)};let s=history.replaceState;history.replaceState=function(...u){t.hide(),s.apply(this,u)}}var st=class extends HTMLElement{openInBuilder=null;block=null;constructor(){super()}connectedCallback(){this.setAttribute("aria-hidden","true");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)}:host{display:none;position:absolute;top:0;left:0;width:100%;height:100%;z-index:2147483646;user-select:none;pointer-events:none;color:var(--text-color)}#content-highlight,#block{position:absolute}#content-highlight{border:3px solid var(--primary-color);background-color:var(--primary-color-alpha)}a{position:absolute;top:-33px;left:0;display:block;padding:5px 10px 8px;pointer-events:auto;z-index:100;text-decoration:none}a:hover{text-decoration:none}a span{display:block;padding:3px 6px;font-size:10px;font-weight:300;border-radius:3px;text-align:center;text-decoration:none;pointer-events:none;background-color:var(--edit-color);color:var(--text-color);white-space:nowrap}a:hover span{background-color:var(--edit-color-highlight)}a:hover~.outline{border-color:var(--edit-color-highlight)}#open-in-editor{display:none}.outline{position:absolute;top:0;left:0;width:100%;height:100%;border:1px solid var(--edit-color);background-color:var(--edit-color-alpha)}</style><div id="block"> <a id="open-in-builder" target="builder"><span>Open In Builder</span></a> <a id="open-in-editor" href="#open-in-editor"><span>Open In Editor</span></a> <div class="outline"></div> </div>',this.openInBuilder=e.getElementById("open-in-builder"),this.block=e.getElementById("block"),Ur(this)}show(e,r){if(!it())return this.hide(),null;let n=e.getAttribute("builder-content-id"),i=r.getAttribute("builder-id");if(!n||!i)return this.hide(),null;let o=this.block,s=this.openInBuilder,u=r.getBoundingClientRect();o.style.top=u.top+window.scrollY-1+"px",o.style.left=u.left+window.scrollX+"px",o.style.width=u.width+"px",o.style.height=u.height+1+"px";let d=s.getBoundingClientRect();if(d.width>u.width){let p=d.width-u.width;s.style.left=p/2*-1+"px"}else s.style.left="";return s.href=je(n,i),this.style.display="block",i}hide(){this.style.display=""}};var Mr="preview-url";var Br="_b-uid";var Vr="/~builder-connect";var Fr="/~builder-dev-tools";var Hr="https://cdn.builder.io/api/v1/proxy-api?url=https://api2.amplitude.com/2/httpapi";var qr=()=>se({type:"validateBuilder"}),De=t=>se({type:"launchEditor",data:t}),jr=t=>se({type:"getRegistry",data:t}),Gr=t=>se({type:"loadComponent",data:t}),Kr=t=>se({type:"registerComponent",data:t}),Wr=t=>se({type:"setComponentInfo",data:t}),at=t=>se({type:"setComponentInput",data:t}),$r=t=>se({type:"unregisterComponent",data:t}),Yr=t=>se({type:"enableDevTools",data:{enabled:t}}),zr=()=>se({type:"localConfig"}),se=async t=>{let e=new URL(Fr,ot),r;try{r=await fetch(e,{method:"POST",body:JSON.stringify(t)})}catch(i){throw console.error(\`Devtools Fetch Error, \${e.href}\`,i),new Error("Builder Devtools Fetch Error")}if((r.headers.get("content-type")||"").includes("application/json")){let i=await r.json();if(r.ok)return i.data;if(Array.isArray(i.errors)&&i.errors.length>0)throw i.errors.forEach(o=>console.error(o)),new Error(\`Builder Devtools Fetch Error: \${i.errors[0]}\`)}throw new Error(\`Builder Devtools Fetch Error: \${r.status}, \${await r.text()}\`)};var Qr=[{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"}],ut=["color","date","email","file","longText","richText","string"],ct=["number"],lt=["boolean"],dt=["list"],pt=["object"];function ft(t){return ut.includes(t)?"string":ct.includes(t)?"number":lt.includes(t)?"boolean":dt.includes(t)?"array":pt.includes(t)?"object":"string"}var Io=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()));var Ht=function(t,e){return Ht=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},Ht(t,e)};function ae(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Ht(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var E=function(){return E=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},E.apply(this,arguments)};function Ge(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function g(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function u(a){try{p(n.next(a))}catch(c){s(c)}}function d(a){try{p(n.throw(a))}catch(c){s(c)}}function p(a){a.done?o(a.value):i(a.value).then(u,d)}p((n=n.apply(t,e||[])).next())})}function h(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=u(0),s.throw=u(1),s.return=u(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(p){return function(a){return d([p,a])}}function d(p){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,p[0]&&(r=0)),r;)try{if(n=1,i&&(o=p[0]&2?i.return:p[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,p[1])).done)return o;switch(i=0,o&&(p=[p[0]&2,o.value]),p[0]){case 0:case 1:o=p;break;case 4:return r.label++,{value:p[1],done:!1};case 5:r.label++,i=p[1],p=[0];continue;case 7:p=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(p[0]===6||p[0]===2)){r=0;continue}if(p[0]===3&&(!o||p[1]>o[0]&&p[1]<o[3])){r.label=p[1];break}if(p[0]===6&&r.label<o[1]){r.label=o[1],o=p;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(p);break}o[2]&&r.ops.pop(),r.trys.pop();continue}p=e.call(t,r)}catch(a){p=[6,a],i=0}finally{n=o=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}}function J(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function A(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(u){s={error:u}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o}function ee(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))}var mt={};bi(mt,{IdentifyOperation:()=>B,LogLevel:()=>Y,PluginType:()=>N,RevenueProperty:()=>re,ServerZone:()=>Se,SpecialEventType:()=>de,Status:()=>M,TransportType:()=>Ie});var B;(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"})(B||(B={}));var re;(function(t){t.REVENUE_PRODUCT_ID="$productId",t.REVENUE_QUANTITY="$quantity",t.REVENUE_PRICE="$price",t.REVENUE_TYPE="$revenueType",t.REVENUE_CURRENCY="$currency",t.REVENUE="$revenue"})(re||(re={}));var de;(function(t){t.IDENTIFY="$identify",t.GROUP_IDENTIFY="$groupidentify",t.REVENUE="revenue_amount"})(de||(de={}));var Y;(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"})(Y||(Y={}));var N;(function(t){t.BEFORE="before",t.ENRICHMENT="enrichment",t.DESTINATION="destination"})(N||(N={}));var Se;(function(t){t.US="US",t.EU="EU",t.STAGING="STAGING"})(Se||(Se={}));var M;(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"})(M||(M={}));var Ie;(function(t){t.XHR="xhr",t.SendBeacon="beacon",t.Fetch="fetch"})(Ie||(Ie={}));var qt="-",xe="AMP",jt="".concat(xe,"_unsent"),Gt="https://api2.amplitude.com/2/httpapi",Xr="https://api.eu.amplitude.com/2/httpapi",Zr="https://api2.amplitude.com/batch",Jr="https://api.eu.amplitude.com/batch";var wi=1e3,vt=function(t){if(Object.keys(t).length>wi)return!1;for(var e in t){var r=t[e];if(!Kt(e,r))return!1}return!0},Kt=function(t,e){var r,n;if(typeof t!="string")return!1;if(Array.isArray(e)){var i=!0;try{for(var o=J(e),s=o.next();!s.done;s=o.next()){var u=s.value;if(Array.isArray(u))return!1;if(typeof u=="object")i=i&&vt(u);else if(!["number","string"].includes(typeof u))return!1;if(!i)return!1}}catch(d){r={error:d}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}}else{if(e==null)return!1;if(typeof e=="object")return vt(e);if(!["number","string","boolean"].includes(typeof e))return!1}return!0};var ne=function(){function t(){this._propertySet=new Set,this._properties={}}return t.prototype.getUserProperties=function(){return E({},this._properties)},t.prototype.set=function(e,r){return this._safeSet(B.SET,e,r),this},t.prototype.setOnce=function(e,r){return this._safeSet(B.SET_ONCE,e,r),this},t.prototype.append=function(e,r){return this._safeSet(B.APPEND,e,r),this},t.prototype.prepend=function(e,r){return this._safeSet(B.PREPEND,e,r),this},t.prototype.postInsert=function(e,r){return this._safeSet(B.POSTINSERT,e,r),this},t.prototype.preInsert=function(e,r){return this._safeSet(B.PREINSERT,e,r),this},t.prototype.remove=function(e,r){return this._safeSet(B.REMOVE,e,r),this},t.prototype.add=function(e,r){return this._safeSet(B.ADD,e,r),this},t.prototype.unset=function(e){return this._safeSet(B.UNSET,e,qt),this},t.prototype.clearAll=function(){return this._properties={},this._properties[B.CLEAR_ALL]=qt,this},t.prototype._safeSet=function(e,r,n){if(this._validate(e,r,n)){var i=this._properties[e];return i===void 0&&(i={},this._properties[e]=i),i[r]=n,this._propertySet.add(r),!0}return!1},t.prototype._validate=function(e,r,n){return this._properties[B.CLEAR_ALL]!==void 0||this._propertySet.has(r)?!1:e===B.ADD?typeof n=="number":e!==B.UNSET&&e!==B.REMOVE?Kt(r,n):!0},t}();var en=function(t,e,r){var n=typeof t=="string"?{event_type:t}:t;return E(E(E({},n),r),e&&{event_properties:e})},Ke=function(t,e){var r=E(E({},e),{event_type:de.IDENTIFY,user_properties:t.getUserProperties()});return r},tn=function(t,e,r,n){var i,o=E(E({},n),{event_type:de.GROUP_IDENTIFY,group_properties:r.getUserProperties(),groups:(i={},i[t]=e,i)});return o},rn=function(t,e,r){var n,i=new ne;i.set(t,e);var o=E(E({},r),{event_type:de.IDENTIFY,user_properties:i.getUserProperties(),groups:(n={},n[t]=e,n)});return o},nn=function(t,e){return E(E({},e),{event_type:de.REVENUE,event_properties:t.getEventProperties()})};var ve=function(t,e,r){return e===void 0&&(e=0),r===void 0&&(r=M.Unknown),{event:t,code:e,message:r}};var on=function(){function t(e){this.client=e,this.queue=[],this.applying=!1,this.plugins=[]}return t.prototype.register=function(e,r){return g(this,void 0,void 0,function(){return h(this,function(n){switch(n.label){case 0:return[4,e.setup(r,this.client)];case 1:return n.sent(),this.plugins.push(e),[2]}})})},t.prototype.deregister=function(e,r){var n;return g(this,void 0,void 0,function(){var i,o;return h(this,function(s){switch(s.label){case 0:return i=this.plugins.findIndex(function(u){return u.name===e}),i===-1?(r.loggerProvider.warn("Plugin with name ".concat(e," does not exist, skipping deregistration")),[2]):(o=this.plugins[i],this.plugins.splice(i,1),[4,(n=o.teardown)===null||n===void 0?void 0:n.call(o)]);case 1:return s.sent(),[2]}})})},t.prototype.reset=function(e){this.applying=!1;var r=this.plugins;r.map(function(n){var i;return(i=n.teardown)===null||i===void 0?void 0:i.call(n)}),this.plugins=[],this.client=e},t.prototype.push=function(e){var r=this;return new Promise(function(n){r.queue.push([e,n]),r.scheduleApply(0)})},t.prototype.scheduleApply=function(e){var r=this;this.applying||(this.applying=!0,setTimeout(function(){r.apply(r.queue.shift()).then(function(){r.applying=!1,r.queue.length>0&&r.scheduleApply(0)})},e))},t.prototype.apply=function(e){return g(this,void 0,void 0,function(){var r,n,i,o,s,u,d,f,m,p,a,c,l,f,m,_,b,v,y,T,L,k;return h(this,function(w){switch(w.label){case 0:if(!e)return[2];r=A(e,1),n=r[0],i=A(e,2),o=i[1],s=this.plugins.filter(function(C){return C.type===N.BEFORE}),w.label=1;case 1:w.trys.push([1,6,7,8]),u=J(s),d=u.next(),w.label=2;case 2:return d.done?[3,5]:(f=d.value,[4,f.execute(E({},n))]);case 3:if(m=w.sent(),m===null)return o({event:n,code:0,message:""}),[2];n=m,w.label=4;case 4:return d=u.next(),[3,2];case 5:return[3,8];case 6:return p=w.sent(),y={error:p},[3,8];case 7:try{d&&!d.done&&(T=u.return)&&T.call(u)}finally{if(y)throw y.error}return[7];case 8:a=this.plugins.filter(function(C){return C.type===N.ENRICHMENT}),w.label=9;case 9:w.trys.push([9,14,15,16]),c=J(a),l=c.next(),w.label=10;case 10:return l.done?[3,13]:(f=l.value,[4,f.execute(E({},n))]);case 11:if(m=w.sent(),m===null)return o({event:n,code:0,message:""}),[2];n=m,w.label=12;case 12:return l=c.next(),[3,10];case 13:return[3,16];case 14:return _=w.sent(),L={error:_},[3,16];case 15:try{l&&!l.done&&(k=c.return)&&k.call(c)}finally{if(L)throw L.error}return[7];case 16:return b=this.plugins.filter(function(C){return C.type===N.DESTINATION}),v=b.map(function(C){var R=E({},n);return C.execute(R).catch(function(K){return ve(R,0,String(K))})}),Promise.all(v).then(function(C){var R=A(C,1),K=R[0];o(K)}),[2]}})})},t.prototype.flush=function(){return g(this,void 0,void 0,function(){var e,r,n,i=this;return h(this,function(o){switch(o.label){case 0:return e=this.queue,this.queue=[],[4,Promise.all(e.map(function(s){return i.apply(s)}))];case 1:return o.sent(),r=this.plugins.filter(function(s){return s.type===N.DESTINATION}),n=r.map(function(s){return s.flush&&s.flush()}),[4,Promise.all(n)];case 2:return o.sent(),[2]}})})},t}();var sn="Event tracked successfully",an="Unexpected error occurred",un="Event rejected due to exceeded retry count",cn="Event skipped due to optOut config",ln="Event rejected due to missing API key",dn="Invalid API key",pn="Client not initialized";var X=function(t){return{promise:t||Promise.resolve()}};var Wt=function(){function t(e){e===void 0&&(e="$default"),this.initializing=!1,this.q=[],this.dispatchQ=[],this.logEvent=this.track.bind(this),this.timeline=new on(this),this.name=e}return t.prototype._init=function(e){return g(this,void 0,void 0,function(){return h(this,function(r){switch(r.label){case 0:return this.config=e,this.timeline.reset(this),[4,this.runQueuedFunctions("q")];case 1:return r.sent(),[2]}})})},t.prototype.runQueuedFunctions=function(e){return g(this,void 0,void 0,function(){var r,n,i,o,s,u,d;return h(this,function(p){switch(p.label){case 0:r=this[e],this[e]=[],p.label=1;case 1:p.trys.push([1,6,7,8]),n=J(r),i=n.next(),p.label=2;case 2:return i.done?[3,5]:(o=i.value,[4,o()]);case 3:p.sent(),p.label=4;case 4:return i=n.next(),[3,2];case 5:return[3,8];case 6:return s=p.sent(),u={error:s},[3,8];case 7:try{i&&!i.done&&(d=n.return)&&d.call(n)}finally{if(u)throw u.error}return[7];case 8:return[2]}})})},t.prototype.track=function(e,r,n){var i=en(e,r,n);return X(this.dispatch(i))},t.prototype.identify=function(e,r){var n=Ke(e,r);return X(this.dispatch(n))},t.prototype.groupIdentify=function(e,r,n,i){var o=tn(e,r,n,i);return X(this.dispatch(o))},t.prototype.setGroup=function(e,r,n){var i=rn(e,r,n);return X(this.dispatch(i))},t.prototype.revenue=function(e,r){var n=nn(e,r);return X(this.dispatch(n))},t.prototype.add=function(e){return this.config?X(this.timeline.register(e,this.config)):(this.q.push(this.add.bind(this,e)),X())},t.prototype.remove=function(e){return this.config?X(this.timeline.deregister(e,this.config)):(this.q.push(this.remove.bind(this,e)),X())},t.prototype.dispatchWithCallback=function(e,r){if(!this.config)return r(ve(e,0,pn));this.process(e).then(r)},t.prototype.dispatch=function(e){return g(this,void 0,void 0,function(){var r=this;return h(this,function(n){return this.config?[2,this.process(e)]:[2,new Promise(function(i){r.dispatchQ.push(r.dispatchWithCallback.bind(r,e,i))})]})})},t.prototype.process=function(e){return g(this,void 0,void 0,function(){var i,r,n,i;return h(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),this.config.optOut?[2,ve(e,0,cn)]:[4,this.timeline.push(e)];case 1:return i=o.sent(),i.code===200?this.config.loggerProvider.log(i.message):this.config.loggerProvider.error(i.message),[2,i];case 2:return r=o.sent(),this.config.loggerProvider.error(r),n=String(r),i=ve(e,0,n),[2,i];case 3:return[2]}})})},t.prototype.setOptOut=function(e){if(!this.config){this.q.push(this.setOptOut.bind(this,!!e));return}this.config.optOut=!!e},t.prototype.flush=function(){return X(this.timeline.flush())},t}();var gt=function(){function t(){this.productId="",this.quantity=1,this.price=0}return t.prototype.setProductId=function(e){return this.productId=e,this},t.prototype.setQuantity=function(e){return e>0&&(this.quantity=e),this},t.prototype.setPrice=function(e){return this.price=e,this},t.prototype.setRevenueType=function(e){return this.revenueType=e,this},t.prototype.setCurrency=function(e){return this.currency=e,this},t.prototype.setRevenue=function(e){return this.revenue=e,this},t.prototype.setEventProperties=function(e){return vt(e)&&(this.properties=e),this},t.prototype.getEventProperties=function(){var e=this.properties?E({},this.properties):{};return e[re.REVENUE_PRODUCT_ID]=this.productId,e[re.REVENUE_QUANTITY]=this.quantity,e[re.REVENUE_PRICE]=this.price,e[re.REVENUE_TYPE]=this.revenueType,e[re.REVENUE_CURRENCY]=this.currency,e[re.REVENUE]=this.revenue,e},t}();var fn=function(t,e){var r=Math.max(e,1);return t.reduce(function(n,i,o){var s=Math.floor(o/r);return n[s]||(n[s]=[]),n[s].push(i),n},[])};var ht="Amplitude Logger ",mn=function(){function t(){this.logLevel=Y.None}return t.prototype.disable=function(){this.logLevel=Y.None},t.prototype.enable=function(e){e===void 0&&(e=Y.Warn),this.logLevel=e},t.prototype.log=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];this.logLevel<Y.Verbose||console.log("".concat(ht,"[Log]: ").concat(e.join(" ")))},t.prototype.warn=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];this.logLevel<Y.Warn||console.warn("".concat(ht,"[Warn]: ").concat(e.join(" ")))},t.prototype.error=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];this.logLevel<Y.Error||console.error("".concat(ht,"[Error]: ").concat(e.join(" ")))},t.prototype.debug=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];this.logLevel<Y.Debug||console.log("".concat(ht,"[Debug]: ").concat(e.join(" ")))},t}();var yt=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:"$default_instance",logLevel:Y.Warn,loggerProvider:new mn,optOut:!1,serverUrl:Gt,serverZone:Se.US,useBatch:!1}},$t=function(){function t(e){var r,n,i,o;this._optOut=!1;var s=yt();this.apiKey=e.apiKey,this.flushIntervalMillis=(r=e.flushIntervalMillis)!==null&&r!==void 0?r:s.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||s.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||s.flushQueueSize,this.instanceName=e.instanceName||s.instanceName,this.loggerProvider=e.loggerProvider||s.loggerProvider,this.logLevel=(n=e.logLevel)!==null&&n!==void 0?n:s.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.optOut=(i=e.optOut)!==null&&i!==void 0?i:s.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||s.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=(o=e.useBatch)!==null&&o!==void 0?o:s.useBatch,this.loggerProvider.enable(this.logLevel);var u=Yt(e.serverUrl,e.serverZone,e.useBatch);this.serverZone=u.serverZone,this.serverUrl=u.serverUrl}return Object.defineProperty(t.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut=e},enumerable:!1,configurable:!0}),t}();var Si=function(t,e){return t===Se.EU?e?Jr:Xr:e?Zr:Gt},Yt=function(t,e,r){if(t===void 0&&(t=""),e===void 0&&(e=yt().serverZone),r===void 0&&(r=yt().useBatch),t)return{serverUrl:t,serverZone:void 0};var n=["US","EU"].includes(e)?e:yt().serverZone;return{serverZone:n,serverUrl:Si(n,r)}};function Ii(t){return t instanceof Error?t.message:String(t)}function bt(t){var e="";try{"body"in t&&(e=JSON.stringify(t.body))}catch{}return e}var zt=function(){function t(){this.name="amplitude",this.type=N.DESTINATION,this.retryTimeout=1e3,this.throttleTimeout=3e4,this.storageKey="",this.scheduled=null,this.queue=[]}return t.prototype.setup=function(e){var r;return g(this,void 0,void 0,function(){var n,i=this;return h(this,function(o){switch(o.label){case 0:return this.config=e,this.storageKey="".concat(jt,"_").concat(this.config.apiKey.substring(0,10)),[4,(r=this.config.storageProvider)===null||r===void 0?void 0:r.get(this.storageKey)];case 1:return n=o.sent(),this.saveEvents(),n&&n.length>0&&Promise.all(n.map(function(s){return i.execute(s)})).catch(),[2,Promise.resolve(void 0)]}})})},t.prototype.execute=function(e){var r=this;return new Promise(function(n){var i={event:e,attempts:0,callback:function(o){return n(o)},timeout:0};r.addToQueue(i)})},t.prototype.addToQueue=function(){for(var e=this,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=r.filter(function(o){return o.attempts<e.config.flushMaxRetries?(o.attempts+=1,!0):(e.fulfillRequest([o],500,un),!1)});i.forEach(function(o){if(e.queue=e.queue.concat(o),o.timeout===0){e.schedule(e.config.flushIntervalMillis);return}setTimeout(function(){o.timeout=0,e.schedule(0)},o.timeout)}),this.saveEvents()},t.prototype.schedule=function(e){var r=this;this.scheduled||(this.scheduled=setTimeout(function(){r.flush(!0).then(function(){r.queue.length>0&&r.schedule(e)})},e))},t.prototype.flush=function(e){return e===void 0&&(e=!1),g(this,void 0,void 0,function(){var r,n,i,o=this;return h(this,function(s){switch(s.label){case 0:return r=[],n=[],this.queue.forEach(function(u){return u.timeout===0?r.push(u):n.push(u)}),this.queue=n,this.scheduled&&(clearTimeout(this.scheduled),this.scheduled=null),i=fn(r,this.config.flushQueueSize),[4,Promise.all(i.map(function(u){return o.send(u,e)}))];case 1:return s.sent(),[2]}})})},t.prototype.send=function(e,r){return r===void 0&&(r=!0),g(this,void 0,void 0,function(){var n,i,o,s,u;return h(this,function(d){switch(d.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(e,400,ln)];n={api_key:this.config.apiKey,events:e.map(function(p){var a=p.event,c=a.extra,l=Ge(a,["extra"]);return l}),options:{min_id_length:this.config.minIdLength}},d.label=1;case 1:return d.trys.push([1,3,,4]),i=Yt(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,[4,this.config.transportProvider.send(i,n)];case 2:return o=d.sent(),o===null?(this.fulfillRequest(e,0,an),[2]):r?(this.handleResponse(o,e),[3,4]):("body"in o?this.fulfillRequest(e,o.statusCode,"".concat(o.status,": ").concat(bt(o))):this.fulfillRequest(e,o.statusCode,o.status),[2]);case 3:return s=d.sent(),this.config.loggerProvider.error(s),u=Ii(s),this.fulfillRequest(e,0,u),[3,4];case 4:return[2]}})})},t.prototype.handleResponse=function(e,r){var n=e.status;switch(n){case M.Success:{this.handleSuccessResponse(e,r);break}case M.Invalid:{this.handleInvalidResponse(e,r);break}case M.PayloadTooLarge:{this.handlePayloadTooLargeResponse(e,r);break}case M.RateLimit:{this.handleRateLimitResponse(e,r);break}default:{this.config.loggerProvider.warn(\`{code: 0, error: "Status '\`.concat(n,"' provided for ").concat(r.length,' events"}')),this.handleOtherResponse(r);break}}},t.prototype.handleSuccessResponse=function(e,r){this.fulfillRequest(r,e.statusCode,sn)},t.prototype.handleInvalidResponse=function(e,r){var n=this;if(e.body.missingField||e.body.error.startsWith(dn)){this.fulfillRequest(r,e.statusCode,e.body.error);return}var i=ee(ee(ee(ee([],A(Object.values(e.body.eventsWithInvalidFields)),!1),A(Object.values(e.body.eventsWithMissingFields)),!1),A(Object.values(e.body.eventsWithInvalidIdLengths)),!1),A(e.body.silencedEvents),!1).flat(),o=new Set(i),s=r.filter(function(u,d){if(o.has(d)){n.fulfillRequest([u],e.statusCode,e.body.error);return}return!0});s.length>0&&this.config.loggerProvider.warn(bt(e)),this.addToQueue.apply(this,ee([],A(s),!1))},t.prototype.handlePayloadTooLargeResponse=function(e,r){if(r.length===1){this.fulfillRequest(r,e.statusCode,e.body.error);return}this.config.loggerProvider.warn(bt(e)),this.config.flushQueueSize/=2,this.addToQueue.apply(this,ee([],A(r),!1))},t.prototype.handleRateLimitResponse=function(e,r){var n=this,i=Object.keys(e.body.exceededDailyQuotaUsers),o=Object.keys(e.body.exceededDailyQuotaDevices),s=e.body.throttledEvents,u=new Set(i),d=new Set(o),p=new Set(s),a=r.filter(function(c,l){if(c.event.user_id&&u.has(c.event.user_id)||c.event.device_id&&d.has(c.event.device_id)){n.fulfillRequest([c],e.statusCode,e.body.error);return}return p.has(l)&&(c.timeout=n.throttleTimeout),!0});a.length>0&&this.config.loggerProvider.warn(bt(e)),this.addToQueue.apply(this,ee([],A(a),!1))},t.prototype.handleOtherResponse=function(e){var r=this;this.addToQueue.apply(this,ee([],A(e.map(function(n){return n.timeout=n.attempts*r.retryTimeout,n})),!1))},t.prototype.fulfillRequest=function(e,r,n){this.saveEvents(),e.forEach(function(i){return i.callback(ve(i.event,r,n))})},t.prototype.saveEvents=function(){if(this.config.storageProvider){var e=Array.from(this.queue.map(function(r){return r.event}));this.config.storageProvider.set(this.storageKey,e)}},t}();var xi=function(t){t===void 0&&(t=0);var e=new Error().stack||"";return e.split(\`
|
|
34
|
+
`),e.restartAppServer()},10),e.enableAppWatch(!t),{enabled:t,platform:e.platform()}}async function Ra(e){return ka(e,`"use strict";(()=>{var fi=Object.create;var Mt=Object.defineProperty;var mi=Object.getOwnPropertyDescriptor;var vi=Object.getOwnPropertyNames;var gi=Object.getPrototypeOf,hi=Object.prototype.hasOwnProperty;var yi=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),bi=(t,e)=>{for(var r in e)Mt(t,r,{get:e[r],enumerable:!0})},Ei=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of vi(e))!hi.call(t,i)&&i!==r&&Mt(t,i,{get:()=>e[i],enumerable:!(n=mi(e,i))||n.enumerable});return t};var _i=(t,e,r)=>(r=t!=null?fi(gi(t)):{},Ei(e||!t||!t.__esModule?Mt(r,"default",{value:t,enumerable:!0}):r,t));var jn=yi((Qe,Ct)=>{(function(t,e){"use strict";var r="0.7.33",n="",i="?",o="function",s="undefined",u="object",d="string",p="major",a="model",c="name",l="type",f="vendor",m="version",_="architecture",b="console",v="mobile",y="tablet",T="smarttv",L="wearable",k="embedded",w=350,C="Amazon",R="Apple",K="ASUS",z="BlackBerry",Q="Browser",P="Chrome",Ce="Edge",ce="Firefox",_e="Google",Me="Huawei",Re="LG",Oe="Microsoft",Be="Motorola",Te="Opera",we="Samsung",ke="Sharp",fe="Sony",me="Xiaomi",Ve="Zebra",U="Facebook",et=function(S,O){var I={};for(var q in S)O[q]&&O[q].length%2===0?I[q]=O[q].concat(S[q]):I[q]=S[q];return I},tt=function(S){for(var O={},I=0;I<S.length;I++)O[S[I].toUpperCase()]=S[I];return O},Pr=function(S,O){return typeof S===d?Fe(O).indexOf(Fe(S))!==-1:!1},Fe=function(S){return S.toLowerCase()},di=function(S){return typeof S===d?S.replace(/[^\\d\\.]/g,n).split(".")[0]:e},Nt=function(S,O){if(typeof S===d)return S=S.replace(/^\\s\\s*/,n),typeof O===s?S:S.substring(0,w)},He=function(S,O){for(var I=0,q,x,nt,D,qe,ie;I<O.length&&!qe;){var Or=O[I],kr=O[I+1];for(q=x=0;q<Or.length&&!qe;)if(qe=Or[q++].exec(S),qe)for(nt=0;nt<kr.length;nt++)ie=qe[++x],D=kr[nt],typeof D===u&&D.length>0?D.length===2?typeof D[1]==o?this[D[0]]=D[1].call(this,ie):this[D[0]]=D[1]:D.length===3?typeof D[1]===o&&!(D[1].exec&&D[1].test)?this[D[0]]=ie?D[1].call(this,ie,D[2]):e:this[D[0]]=ie?ie.replace(D[1],D[2]):e:D.length===4&&(this[D[0]]=ie?D[3].call(this,ie.replace(D[1],D[2])):e):this[D]=ie||e;I+=2}},Ut=function(S,O){for(var I in O)if(typeof O[I]===u&&O[I].length>0){for(var q=0;q<O[I].length;q++)if(Pr(O[I][q],S))return I===i?e:I}else if(Pr(O[I],S))return I===i?e:I;return S},pi={"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},Cr={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},Rr={browser:[[/\\b(?:crmo|crios)\\/([\\w\\.]+)/i],[m,[c,"Chrome"]],[/edg(?:e|ios|a)?\\/([\\w\\.]+)/i],[m,[c,"Edge"]],[/(opera mini)\\/([-\\w\\.]+)/i,/(opera [mobiletab]{3,6})\\b.+version\\/([-\\w\\.]+)/i,/(opera)(?:.+version\\/|[\\/ ]+)([\\w\\.]+)/i],[c,m],[/opios[\\/ ]+([\\w\\.]+)/i],[m,[c,Te+" Mini"]],[/\\bopr\\/([\\w\\.]+)/i],[m,[c,Te]],[/(kindle)\\/([\\w\\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\\/ ]?([\\w\\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\\/ ]?([\\w\\.]*)/i,/(ba?idubrowser)[\\/ ]?([\\w\\.]+)/i,/(?:ms|\\()(ie) ([\\w\\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq|duckduckgo)\\/([-\\w\\.]+)/i,/(weibo)__([\\d\\.]+)/i],[c,m],[/(?:\\buc? ?browser|(?:juc.+)ucweb)[\\/ ]?([\\w\\.]+)/i],[m,[c,"UC"+Q]],[/microm.+\\bqbcore\\/([\\w\\.]+)/i,/\\bqbcore\\/([\\w\\.]+).+microm/i],[m,[c,"WeChat(Win) Desktop"]],[/micromessenger\\/([\\w\\.]+)/i],[m,[c,"WeChat"]],[/konqueror\\/([\\w\\.]+)/i],[m,[c,"Konqueror"]],[/trident.+rv[: ]([\\w\\.]{1,9})\\b.+like gecko/i],[m,[c,"IE"]],[/yabrowser\\/([\\w\\.]+)/i],[m,[c,"Yandex"]],[/(avast|avg)\\/([\\w\\.]+)/i],[[c,/(.+)/,"$1 Secure "+Q],m],[/\\bfocus\\/([\\w\\.]+)/i],[m,[c,ce+" Focus"]],[/\\bopt\\/([\\w\\.]+)/i],[m,[c,Te+" Touch"]],[/coc_coc\\w+\\/([\\w\\.]+)/i],[m,[c,"Coc Coc"]],[/dolfin\\/([\\w\\.]+)/i],[m,[c,"Dolphin"]],[/coast\\/([\\w\\.]+)/i],[m,[c,Te+" Coast"]],[/miuibrowser\\/([\\w\\.]+)/i],[m,[c,"MIUI "+Q]],[/fxios\\/([-\\w\\.]+)/i],[m,[c,ce]],[/\\bqihu|(qi?ho?o?|360)browser/i],[[c,"360 "+Q]],[/(oculus|samsung|sailfish|huawei)browser\\/([\\w\\.]+)/i],[[c,/(.+)/,"$1 "+Q],m],[/(comodo_dragon)\\/([\\w\\.]+)/i],[[c,/_/g," "],m],[/(electron)\\/([\\w\\.]+) safari/i,/(tesla)(?: qtcarbrowser|\\/(20\\d\\d\\.[-\\w\\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\\/ ]?([\\w\\.]+)/i],[c,m],[/(metasr)[\\/ ]?([\\w\\.]+)/i,/(lbbrowser)/i,/\\[(linkedin)app\\]/i],[c],[/((?:fban\\/fbios|fb_iab\\/fb4a)(?!.+fbav)|;fbav\\/([\\w\\.]+);)/i],[[c,U],m],[/safari (line)\\/([\\w\\.]+)/i,/\\b(line)\\/([\\w\\.]+)\\/iab/i,/(chromium|instagram)[\\/ ]([-\\w\\.]+)/i],[c,m],[/\\bgsa\\/([\\w\\.]+) .*safari\\//i],[m,[c,"GSA"]],[/headlesschrome(?:\\/([\\w\\.]+)| )/i],[m,[c,P+" Headless"]],[/ wv\\).+(chrome)\\/([\\w\\.]+)/i],[[c,P+" WebView"],m],[/droid.+ version\\/([\\w\\.]+)\\b.+(?:mobile safari|safari)/i],[m,[c,"Android "+Q]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\\/v?([\\w\\.]+)/i],[c,m],[/version\\/([\\w\\.\\,]+) .*mobile\\/\\w+ (safari)/i],[m,[c,"Mobile Safari"]],[/version\\/([\\w(\\.|\\,)]+) .*(mobile ?safari|safari)/i],[m,c],[/webkit.+?(mobile ?safari|safari)(\\/[\\w\\.]+)/i],[c,[m,Ut,pi]],[/(webkit|khtml)\\/([\\w\\.]+)/i],[c,m],[/(navigator|netscape\\d?)\\/([-\\w\\.]+)/i],[[c,"Netscape"],m],[/mobile vr; rv:([\\w\\.]+)\\).+firefox/i],[m,[c,ce+" Reality"]],[/ekiohf.+(flow)\\/([\\w\\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\\/ ]?([\\w\\.\\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\\/([-\\w\\.]+)$/i,/(firefox)\\/([\\w\\.]+)/i,/(mozilla)\\/([\\w\\.]+) .+rv\\:.+gecko\\/\\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\\. ]?browser)[-\\/ ]?v?([\\w\\.]+)/i,/(links) \\(([\\w\\.]+)/i],[c,m],[/(cobalt)\\/([\\w\\.]+)/i],[c,[m,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\\)]/i],[[_,"amd64"]],[/(ia32(?=;))/i],[[_,Fe]],[/((?:i[346]|x)86)[;\\)]/i],[[_,"ia32"]],[/\\b(aarch64|arm(v?8e?l?|_?64))\\b/i],[[_,"arm64"]],[/\\b(arm(?:v[67])?ht?n?[fl]p?)\\b/i],[[_,"armhf"]],[/windows (ce|mobile); ppc;/i],[[_,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\\))/i],[[_,/ower/,n,Fe]],[/(sun4\\w)[;\\)]/i],[[_,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\\))|\\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\\b|pa-risc)/i],[[_,Fe]]],device:[[/\\b(sch-i[89]0\\d|shw-m380s|sm-[ptx]\\w{2,4}|gt-[pn]\\d{2,4}|sgh-t8[56]9|nexus 10)/i],[a,[f,we],[l,y]],[/\\b((?:s[cgp]h|gt|sm)-\\w+|galaxy nexus)/i,/samsung[- ]([-\\w]+)/i,/sec-(sgh\\w+)/i],[a,[f,we],[l,v]],[/((ipod|iphone)\\d+,\\d+)/i],[a,[f,R],[l,v]],[/(ipad\\d+,\\d+)/i],[a,[f,R],[l,y]],[/\\((ip(?:hone|od)[\\w ]*);/i],[a,[f,R],[l,v]],[/\\((ipad);[-\\w\\),; ]+apple/i,/applecoremedia\\/[\\w\\.]+ \\((ipad)/i,/\\b(ipad)\\d\\d?,\\d\\d?[;\\]].+ios/i],[a,[f,R],[l,y]],[/(macintosh);/i],[a,[f,R]],[/\\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\\d{2})\\b(?!.+d\\/s)/i],[a,[f,Me],[l,y]],[/(?:huawei|honor)([-\\w ]+)[;\\)]/i,/\\b(nexus 6p|\\w{2,4}e?-[atu]?[ln][\\dx][012359c][adn]?)\\b(?!.+d\\/s)/i],[a,[f,Me],[l,v]],[/\\b(poco[\\w ]+)(?: bui|\\))/i,/\\b; (\\w+) build\\/hm\\1/i,/\\b(hm[-_ ]?note?[_ ]?(?:\\d\\w)?) bui/i,/\\b(redmi[\\-_ ]?(?:note|k)?[\\w_ ]+)(?: bui|\\))/i,/\\b(mi[-_ ]?(?:a\\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\\d?\\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\\))/i],[[a,/_/g," "],[f,me],[l,v]],[/\\b(mi[-_ ]?(?:pad)(?:[\\w_ ]+))(?: bui|\\))/i],[[a,/_/g," "],[f,me],[l,y]],[/; (\\w+) bui.+ oppo/i,/\\b(cph[12]\\d{3}|p(?:af|c[al]|d\\w|e[ar])[mt]\\d0|x9007|a101op)\\b/i],[a,[f,"OPPO"],[l,v]],[/vivo (\\w+)(?: bui|\\))/i,/\\b(v[12]\\d{3}\\w?[at])(?: bui|;)/i],[a,[f,"Vivo"],[l,v]],[/\\b(rmx[12]\\d{3})(?: bui|;|\\))/i],[a,[f,"Realme"],[l,v]],[/\\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\\b[\\w ]+build\\//i,/\\bmot(?:orola)?[- ](\\w*)/i,/((?:moto[\\w\\(\\) ]+|xt\\d{3,4}|nexus 6)(?= bui|\\)))/i],[a,[f,Be],[l,v]],[/\\b(mz60\\d|xoom[2 ]{0,2}) build\\//i],[a,[f,Be],[l,y]],[/((?=lg)?[vl]k\\-?\\d{3}) bui| 3\\.[-\\w; ]{10}lg?-([06cv9]{3,4})/i],[a,[f,Re],[l,y]],[/(lm(?:-?f100[nv]?|-[\\w\\.]+)(?= bui|\\))|nexus [45])/i,/\\blg[-e;\\/ ]+((?!browser|netcast|android tv)\\w+)/i,/\\blg-?([\\d\\w]+) bui/i],[a,[f,Re],[l,v]],[/(ideatab[-\\w ]+)/i,/lenovo ?(s[56]000[-\\w]+|tab(?:[\\w ]+)|yt[-\\d\\w]{6}|tb[-\\d\\w]{6})/i],[a,[f,"Lenovo"],[l,y]],[/(?:maemo|nokia).*(n900|lumia \\d+)/i,/nokia[-_ ]?([-\\w\\.]*)/i],[[a,/_/g," "],[f,"Nokia"],[l,v]],[/(pixel c)\\b/i],[a,[f,_e],[l,y]],[/droid.+; (pixel[\\daxl ]{0,6})(?: bui|\\))/i],[a,[f,_e],[l,v]],[/droid.+ (a?\\d[0-2]{2}so|[c-g]\\d{4}|so[-gl]\\w+|xq-a\\w[4-7][12])(?= bui|\\).+chrome\\/(?![1-6]{0,1}\\d\\.))/i],[a,[f,fe],[l,v]],[/sony tablet [ps]/i,/\\b(?:sony)?sgp\\w+(?: bui|\\))/i],[[a,"Xperia Tablet"],[f,fe],[l,y]],[/ (kb2005|in20[12]5|be20[12][59])\\b/i,/(?:one)?(?:plus)? (a\\d0\\d\\d)(?: b|\\))/i],[a,[f,"OnePlus"],[l,v]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\\))/i,/(kf[a-z]+)( bui|\\)).+silk\\//i],[a,[f,C],[l,y]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\\)).+silk\\//i],[[a,/(.+)/g,"Fire Phone $1"],[f,C],[l,v]],[/(playbook);[-\\w\\),; ]+(rim)/i],[a,f,[l,y]],[/\\b((?:bb[a-f]|st[hv])100-\\d)/i,/\\(bb10; (\\w+)/i],[a,[f,z],[l,v]],[/(?:\\b|asus_)(transfo[prime ]{4,10} \\w+|eeepc|slider \\w+|nexus 7|padfone|p00[cj])/i],[a,[f,K],[l,y]],[/ (z[bes]6[027][012][km][ls]|zenfone \\d\\w?)\\b/i],[a,[f,K],[l,v]],[/(nexus 9)/i],[a,[f,"HTC"],[l,y]],[/(htc)[-;_ ]{1,2}([\\w ]+(?=\\)| bui)|\\w+)/i,/(zte)[- ]([\\w ]+?)(?: bui|\\/|\\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\\w]*)/i],[f,[a,/_/g," "],[l,v]],[/droid.+; ([ab][1-7]-?[0178a]\\d\\d?)/i],[a,[f,"Acer"],[l,y]],[/droid.+; (m[1-5] note) bui/i,/\\bmz-([-\\w]{2,})/i],[a,[f,"Meizu"],[l,v]],[/\\b(sh-?[altvz]?\\d\\d[a-ekm]?)/i],[a,[f,ke],[l,v]],[/(blackberry|benq|palm(?=\\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\\w]*)/i,/(hp) ([\\w ]+\\w)/i,/(asus)-?(\\w+)/i,/(microsoft); (lumia[\\w ]+)/i,/(lenovo)[-_ ]?([-\\w]+)/i,/(jolla)/i,/(oppo) ?([\\w ]+) bui/i],[f,a,[l,v]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\\/([\\w\\.]+)/i,/(nook)[\\w ]+build\\/(\\w+)/i,/(dell) (strea[kpr\\d ]*[\\dko])/i,/(le[- ]+pan)[- ]+(\\w{1,9}) bui/i,/(trinity)[- ]*(t\\d{3}) bui/i,/(gigaset)[- ]+(q\\w{1,9}) bui/i,/(vodafone) ([\\w ]+)(?:\\)| bui)/i],[f,a,[l,y]],[/(surface duo)/i],[a,[f,Oe],[l,y]],[/droid [\\d\\.]+; (fp\\du?)(?: b|\\))/i],[a,[f,"Fairphone"],[l,v]],[/(u304aa)/i],[a,[f,"AT&T"],[l,v]],[/\\bsie-(\\w*)/i],[a,[f,"Siemens"],[l,v]],[/\\b(rct\\w+) b/i],[a,[f,"RCA"],[l,y]],[/\\b(venue[\\d ]{2,7}) b/i],[a,[f,"Dell"],[l,y]],[/\\b(q(?:mv|ta)\\w+) b/i],[a,[f,"Verizon"],[l,y]],[/\\b(?:barnes[& ]+noble |bn[rt])([\\w\\+ ]*) b/i],[a,[f,"Barnes & Noble"],[l,y]],[/\\b(tm\\d{3}\\w+) b/i],[a,[f,"NuVision"],[l,y]],[/\\b(k88) b/i],[a,[f,"ZTE"],[l,y]],[/\\b(nx\\d{3}j) b/i],[a,[f,"ZTE"],[l,v]],[/\\b(gen\\d{3}) b.+49h/i],[a,[f,"Swiss"],[l,v]],[/\\b(zur\\d{3}) b/i],[a,[f,"Swiss"],[l,y]],[/\\b((zeki)?tb.*\\b) b/i],[a,[f,"Zeki"],[l,y]],[/\\b([yr]\\d{2}) b/i,/\\b(dragon[- ]+touch |dt)(\\w{5}) b/i],[[f,"Dragon Touch"],a,[l,y]],[/\\b(ns-?\\w{0,9}) b/i],[a,[f,"Insignia"],[l,y]],[/\\b((nxa|next)-?\\w{0,9}) b/i],[a,[f,"NextBook"],[l,y]],[/\\b(xtreme\\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[f,"Voice"],a,[l,v]],[/\\b(lvtel\\-)?(v1[12]) b/i],[[f,"LvTel"],a,[l,v]],[/\\b(ph-1) /i],[a,[f,"Essential"],[l,v]],[/\\b(v(100md|700na|7011|917g).*\\b) b/i],[a,[f,"Envizen"],[l,y]],[/\\b(trio[-\\w\\. ]+) b/i],[a,[f,"MachSpeed"],[l,y]],[/\\btu_(1491) b/i],[a,[f,"Rotor"],[l,y]],[/(shield[\\w ]+) b/i],[a,[f,"Nvidia"],[l,y]],[/(sprint) (\\w+)/i],[f,a,[l,v]],[/(kin\\.[onetw]{3})/i],[[a,/\\./g," "],[f,Oe],[l,v]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\\)/i],[a,[f,Ve],[l,y]],[/droid.+; (ec30|ps20|tc[2-8]\\d[kx])\\)/i],[a,[f,Ve],[l,v]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[f,a,[l,b]],[/droid.+; (shield) bui/i],[a,[f,"Nvidia"],[l,b]],[/(playstation [345portablevi]+)/i],[a,[f,fe],[l,b]],[/\\b(xbox(?: one)?(?!; xbox))[\\); ]/i],[a,[f,Oe],[l,b]],[/smart-tv.+(samsung)/i],[f,[l,T]],[/hbbtv.+maple;(\\d+)/i],[[a,/^/,"SmartTV"],[f,we],[l,T]],[/(nux; netcast.+smarttv|lg (netcast\\.tv-201\\d|android tv))/i],[[f,Re],[l,T]],[/(apple) ?tv/i],[f,[a,R+" TV"],[l,T]],[/crkey/i],[[a,P+"cast"],[f,_e],[l,T]],[/droid.+aft(\\w)( bui|\\))/i],[a,[f,C],[l,T]],[/\\(dtv[\\);].+(aquos)/i,/(aquos-tv[\\w ]+)\\)/i],[a,[f,ke],[l,T]],[/(bravia[\\w ]+)( bui|\\))/i],[a,[f,fe],[l,T]],[/(mitv-\\w{5}) bui/i],[a,[f,me],[l,T]],[/\\b(roku)[\\dx]*[\\)\\/]((?:dvp-)?[\\d\\.]*)/i,/hbbtv\\/\\d+\\.\\d+\\.\\d+ +\\([\\w ]*; *(\\w[^;]*);([^;]*)/i],[[f,Nt],[a,Nt],[l,T]],[/\\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\\b/i],[[l,T]],[/((pebble))app/i],[f,a,[l,L]],[/droid.+; (glass) \\d/i],[a,[f,_e],[l,L]],[/droid.+; (wt63?0{2,3})\\)/i],[a,[f,Ve],[l,L]],[/(quest( 2)?)/i],[a,[f,U],[l,L]],[/(tesla)(?: qtcarbrowser|\\/[-\\w\\.]+)/i],[f,[l,k]],[/droid .+?; ([^;]+?)(?: bui|\\) applew).+? mobile safari/i],[a,[l,v]],[/droid .+?; ([^;]+?)(?: bui|\\) applew).+?(?! mobile) safari/i],[a,[l,y]],[/\\b((tablet|tab)[;\\/]|focus\\/\\d(?!.+mobile))/i],[[l,y]],[/(phone|mobile(?:[;\\/]| [ \\w\\/\\.]*safari)|pda(?=.+windows ce))/i],[[l,v]],[/(android[-\\w\\. ]{0,9});.+buil/i],[a,[f,"Generic"]]],engine:[[/windows.+ edge\\/([\\w\\.]+)/i],[m,[c,Ce+"HTML"]],[/webkit\\/537\\.36.+chrome\\/(?!27)([\\w\\.]+)/i],[m,[c,"Blink"]],[/(presto)\\/([\\w\\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\\/([\\w\\.]+)/i,/ekioh(flow)\\/([\\w\\.]+)/i,/(khtml|tasman|links)[\\/ ]\\(?([\\w\\.]+)/i,/(icab)[\\/ ]([23]\\.[\\d\\.]+)/i],[c,m],[/rv\\:([\\w\\.]{1,9})\\b.+(gecko)/i],[m,c]],os:[[/microsoft (windows) (vista|xp)/i],[c,m],[/(windows) nt 6\\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\\/ ]?([\\d\\.\\w ]*)/i,/(windows)[\\/ ]?([ntce\\d\\. ]+\\w)(?!.+xbox)/i],[c,[m,Ut,Cr]],[/(win(?=3|9|n)|win 9x )([nt\\d\\.]+)/i],[[c,"Windows"],[m,Ut,Cr]],[/ip[honead]{2,4}\\b(?:.*os ([\\w]+) like mac|; opera)/i,/cfnetwork\\/.+darwin/i],[[m,/_/g,"."],[c,"iOS"]],[/(mac os x) ?([\\w\\. ]*)/i,/(macintosh|mac_powerpc\\b)(?!.+haiku)/i],[[c,"Mac OS"],[m,/_/g,"."]],[/droid ([\\w\\.]+)\\b.+(android[- ]x86|harmonyos)/i],[m,c],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\\/ ]?([\\w\\.]*)/i,/(blackberry)\\w*\\/([\\w\\.]*)/i,/(tizen|kaios)[\\/ ]([\\w\\.]+)/i,/\\((series40);/i],[c,m],[/\\(bb(10);/i],[m,[c,z]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\\/ ]?([\\w\\.]*)/i],[m,[c,"Symbian"]],[/mozilla\\/[\\d\\.]+ \\((?:mobile|tablet|tv|mobile; [\\w ]+); rv:.+ gecko\\/([\\w\\.]+)/i],[m,[c,ce+" OS"]],[/web0s;.+rt(tv)/i,/\\b(?:hp)?wos(?:browser)?\\/([\\w\\.]+)/i],[m,[c,"webOS"]],[/crkey\\/([\\d\\.]+)/i],[m,[c,P+"cast"]],[/(cros) [\\w]+ ([\\w\\.]+\\w)/i],[[c,"Chromium OS"],m],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\\);]+)/i,/\\b(joli|palm)\\b ?(?:os)?\\/?([\\w\\.]*)/i,/(mint)[\\/\\(\\) ]?(\\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\\/ ]?(?!chrom|package)([-\\w\\.]*)/i,/(hurd|linux) ?([\\w\\.]*)/i,/(gnu) ?([\\w\\.]*)/i,/\\b([-frentopcghs]{0,5}bsd|dragonfly)[\\/ ]?(?!amd|[ix346]{1,2}86)([\\w\\.]*)/i,/(haiku) (\\w+)/i],[c,m],[/(sunos) ?([\\w\\.\\d]*)/i],[[c,"Solaris"],m],[/((?:open)?solaris)[-\\/ ]?([\\w\\.]*)/i,/(aix) ((\\d)(?=\\.|\\)| )[\\w\\.])*/i,/\\b(beos|os\\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\\w\\.]*)/i],[c,m]]},Z=function(S,O){if(typeof S===u&&(O=S,S=e),!(this instanceof Z))return new Z(S,O).getResult();var I=S||(typeof t!==s&&t.navigator&&t.navigator.userAgent?t.navigator.userAgent:n),q=O?et(Rr,O):Rr;return this.getBrowser=function(){var x={};return x[c]=e,x[m]=e,He.call(x,I,q.browser),x.major=di(x.version),x},this.getCPU=function(){var x={};return x[_]=e,He.call(x,I,q.cpu),x},this.getDevice=function(){var x={};return x[f]=e,x[a]=e,x[l]=e,He.call(x,I,q.device),x},this.getEngine=function(){var x={};return x[c]=e,x[m]=e,He.call(x,I,q.engine),x},this.getOS=function(){var x={};return x[c]=e,x[m]=e,He.call(x,I,q.os),x},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return I},this.setUA=function(x){return I=typeof x===d&&x.length>w?Nt(x,w):x,this},this.setUA(I),this};Z.VERSION=r,Z.BROWSER=tt([c,m,p]),Z.CPU=tt([_]),Z.DEVICE=tt([a,f,l,b,v,T,y,L,k]),Z.ENGINE=Z.OS=tt([c,m]),typeof Qe!==s?(typeof Ct!==s&&Ct.exports&&(Qe=Ct.exports=Z),Qe.UAParser=Z):typeof define===o&&define.amd?define(function(){return Z}):typeof t!==s&&(t.UAParser=Z);var Ae=typeof t!==s&&(t.jQuery||t.Zepto);if(Ae&&!Ae.ua){var rt=new Z;Ae.ua=rt.getResult(),Ae.ua.get=function(){return rt.getUA()},Ae.ua.set=function(S){rt.setUA(S);var O=rt.getResult();for(var I in O)Ae.ua[I]=O[I]}}})(typeof window=="object"?window:Qe)});var oe=(t,e)=>{Vt(t);let r=t.querySelector("aside");r.dataset.view=e,r.classList.remove("section-ready"),setTimeout(()=>{r.classList.add("section-ready")},200)},Ar=t=>{Array.from(t.querySelectorAll(".back-button")).forEach(e=>{e.addEventListener("click",r=>{Vt(t),r.preventDefault(),r.stopPropagation();let n=r.target;oe(t,n?.dataset.back||"nav-home")})})},Bt=(t,e)=>{Vt(t);let r=t.querySelector("aside"),n=document.createElement("div");n.className="ui-toast",n.innerHTML=e,r.appendChild(n),setTimeout(()=>{n.classList.add("ui-toast-show"),setTimeout(()=>{n.classList.remove("ui-toast-show"),setTimeout(()=>{n.remove()},500)},4e3)},30)},Vt=t=>{let e=t.querySelector("aside");Array.from(e.querySelectorAll(".ui-toast")).forEach(n=>{n.classList.remove("ui-toast-show")})},it=()=>{let t=Dr();return localStorage.getItem(t)!=="true"},Ft=t=>{let e=Dr();t?localStorage.removeItem(e):localStorage.setItem(e,"true")},Dr=()=>Ti("disableEdit"),Ti=t=>\`builder.__LOCAL_APP_ID__.\${t}\`,Nr=()=>{let e=document.body.querySelector("[builder-content-id]")?.getAttribute("builder-content-id");return je(e)},je=(t,e)=>{let r="/content";t&&(r+="/"+t+"/edit");let n=new URL(r,"https://builder.io");t&&e&&n.searchParams.set("selectedBlock",e);let i=new URL(location.pathname,location.href);return n.searchParams.set("overridePreviewUrl",i.href),n.href},ot="__DEV_TOOLS_URL__",G={components:[],registryPath:"",registryDisplayPath:"",frameworks:[],dependencies:[],publicApiKey:void 0,devToolsVersion:""},le=t=>{G.components=t.components,G.registryPath=t.registryPath,G.registryDisplayPath=t.registryDisplayPath,G.dependencies=t.dependencies,G.publicApiKey=t.publicApiKey};function Ur(t){let e=null,r=document.querySelector("builder-dev-tools-menu"),n=()=>{t.hide()},i=u=>{let d=u.target;if(!d){n();return}if(d.closest("builder-dev-tools-edit"))return;let p=d.closest("[builder-content-id]"),a=d.closest("[builder-id]");if(!p||!a){t.hide();return}let c=t.show(p,a);!c||c===e||(r.highlightOpener(),e=c)};document.addEventListener("pointerover",i,{passive:!0}),document.addEventListener("pointerleave",n,{passive:!0}),document.addEventListener("pointercancel",n,{passive:!0}),document.addEventListener("visibilitychange",n,{passive:!0}),window.addEventListener("popstate",n,{passive:!0});let o=history.pushState;history.pushState=function(...u){t.hide(),o.apply(this,u)};let s=history.replaceState;history.replaceState=function(...u){t.hide(),s.apply(this,u)}}var st=class extends HTMLElement{openInBuilder=null;block=null;constructor(){super()}connectedCallback(){this.setAttribute("aria-hidden","true");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)}:host{display:none;position:absolute;top:0;left:0;width:100%;height:100%;z-index:2147483646;user-select:none;pointer-events:none;color:var(--text-color)}#content-highlight,#block{position:absolute}#content-highlight{border:3px solid var(--primary-color);background-color:var(--primary-color-alpha)}a{position:absolute;top:-33px;left:0;display:block;padding:5px 10px 8px;pointer-events:auto;z-index:100;text-decoration:none}a:hover{text-decoration:none}a span{display:block;padding:3px 6px;font-size:10px;font-weight:300;border-radius:3px;text-align:center;text-decoration:none;pointer-events:none;background-color:var(--edit-color);color:var(--text-color);white-space:nowrap}a:hover span{background-color:var(--edit-color-highlight)}a:hover~.outline{border-color:var(--edit-color-highlight)}#open-in-editor{display:none}.outline{position:absolute;top:0;left:0;width:100%;height:100%;border:1px solid var(--edit-color);background-color:var(--edit-color-alpha)}</style><div id="block"> <a id="open-in-builder" target="builder"><span>Open In Builder</span></a> <a id="open-in-editor" href="#open-in-editor"><span>Open In Editor</span></a> <div class="outline"></div> </div>',this.openInBuilder=e.getElementById("open-in-builder"),this.block=e.getElementById("block"),Ur(this)}show(e,r){if(!it())return this.hide(),null;let n=e.getAttribute("builder-content-id"),i=r.getAttribute("builder-id");if(!n||!i)return this.hide(),null;let o=this.block,s=this.openInBuilder,u=r.getBoundingClientRect();o.style.top=u.top+window.scrollY-1+"px",o.style.left=u.left+window.scrollX+"px",o.style.width=u.width+"px",o.style.height=u.height+1+"px";let d=s.getBoundingClientRect();if(d.width>u.width){let p=d.width-u.width;s.style.left=p/2*-1+"px"}else s.style.left="";return s.href=je(n,i),this.style.display="block",i}hide(){this.style.display=""}};var Mr="preview-url";var Br="_b-uid";var Vr="/~builder-connect";var Fr="/~builder-dev-tools";var Hr="https://cdn.builder.io/api/v1/proxy-api?url=https://api2.amplitude.com/2/httpapi";var qr=()=>se({type:"validateBuilder"}),De=t=>se({type:"launchEditor",data:t}),jr=t=>se({type:"getRegistry",data:t}),Gr=t=>se({type:"loadComponent",data:t}),Kr=t=>se({type:"registerComponent",data:t}),Wr=t=>se({type:"setComponentInfo",data:t}),at=t=>se({type:"setComponentInput",data:t}),$r=t=>se({type:"unregisterComponent",data:t}),Yr=t=>se({type:"enableDevTools",data:{enabled:t}}),zr=()=>se({type:"localConfig"}),se=async t=>{let e=new URL(Fr,ot),r;try{r=await fetch(e,{method:"POST",body:JSON.stringify(t)})}catch(i){throw console.error(\`Devtools Fetch Error, \${e.href}\`,i),new Error("Builder Devtools Fetch Error")}if((r.headers.get("content-type")||"").includes("application/json")){let i=await r.json();if(r.ok)return i.data;if(Array.isArray(i.errors)&&i.errors.length>0)throw i.errors.forEach(o=>console.error(o)),new Error(\`Builder Devtools Fetch Error: \${i.errors[0]}\`)}throw new Error(\`Builder Devtools Fetch Error: \${r.status}, \${await r.text()}\`)};var Qr=[{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"}],ut=["color","date","email","file","longText","richText","string"],ct=["number"],lt=["boolean"],dt=["list"],pt=["object"];function ft(t){return ut.includes(t)?"string":ct.includes(t)?"number":lt.includes(t)?"boolean":dt.includes(t)?"array":pt.includes(t)?"object":"string"}var Io=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()));var Ht=function(t,e){return Ht=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},Ht(t,e)};function ae(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Ht(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var E=function(){return E=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},E.apply(this,arguments)};function Ge(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function g(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function u(a){try{p(n.next(a))}catch(c){s(c)}}function d(a){try{p(n.throw(a))}catch(c){s(c)}}function p(a){a.done?o(a.value):i(a.value).then(u,d)}p((n=n.apply(t,e||[])).next())})}function h(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=u(0),s.throw=u(1),s.return=u(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(p){return function(a){return d([p,a])}}function d(p){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,p[0]&&(r=0)),r;)try{if(n=1,i&&(o=p[0]&2?i.return:p[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,p[1])).done)return o;switch(i=0,o&&(p=[p[0]&2,o.value]),p[0]){case 0:case 1:o=p;break;case 4:return r.label++,{value:p[1],done:!1};case 5:r.label++,i=p[1],p=[0];continue;case 7:p=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(p[0]===6||p[0]===2)){r=0;continue}if(p[0]===3&&(!o||p[1]>o[0]&&p[1]<o[3])){r.label=p[1];break}if(p[0]===6&&r.label<o[1]){r.label=o[1],o=p;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(p);break}o[2]&&r.ops.pop(),r.trys.pop();continue}p=e.call(t,r)}catch(a){p=[6,a],i=0}finally{n=o=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}}function J(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function A(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(u){s={error:u}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o}function ee(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))}var mt={};bi(mt,{IdentifyOperation:()=>B,LogLevel:()=>Y,PluginType:()=>N,RevenueProperty:()=>re,ServerZone:()=>Se,SpecialEventType:()=>de,Status:()=>M,TransportType:()=>Ie});var B;(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"})(B||(B={}));var re;(function(t){t.REVENUE_PRODUCT_ID="$productId",t.REVENUE_QUANTITY="$quantity",t.REVENUE_PRICE="$price",t.REVENUE_TYPE="$revenueType",t.REVENUE_CURRENCY="$currency",t.REVENUE="$revenue"})(re||(re={}));var de;(function(t){t.IDENTIFY="$identify",t.GROUP_IDENTIFY="$groupidentify",t.REVENUE="revenue_amount"})(de||(de={}));var Y;(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"})(Y||(Y={}));var N;(function(t){t.BEFORE="before",t.ENRICHMENT="enrichment",t.DESTINATION="destination"})(N||(N={}));var Se;(function(t){t.US="US",t.EU="EU",t.STAGING="STAGING"})(Se||(Se={}));var M;(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"})(M||(M={}));var Ie;(function(t){t.XHR="xhr",t.SendBeacon="beacon",t.Fetch="fetch"})(Ie||(Ie={}));var qt="-",xe="AMP",jt="".concat(xe,"_unsent"),Gt="https://api2.amplitude.com/2/httpapi",Xr="https://api.eu.amplitude.com/2/httpapi",Zr="https://api2.amplitude.com/batch",Jr="https://api.eu.amplitude.com/batch";var wi=1e3,vt=function(t){if(Object.keys(t).length>wi)return!1;for(var e in t){var r=t[e];if(!Kt(e,r))return!1}return!0},Kt=function(t,e){var r,n;if(typeof t!="string")return!1;if(Array.isArray(e)){var i=!0;try{for(var o=J(e),s=o.next();!s.done;s=o.next()){var u=s.value;if(Array.isArray(u))return!1;if(typeof u=="object")i=i&&vt(u);else if(!["number","string"].includes(typeof u))return!1;if(!i)return!1}}catch(d){r={error:d}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}}else{if(e==null)return!1;if(typeof e=="object")return vt(e);if(!["number","string","boolean"].includes(typeof e))return!1}return!0};var ne=function(){function t(){this._propertySet=new Set,this._properties={}}return t.prototype.getUserProperties=function(){return E({},this._properties)},t.prototype.set=function(e,r){return this._safeSet(B.SET,e,r),this},t.prototype.setOnce=function(e,r){return this._safeSet(B.SET_ONCE,e,r),this},t.prototype.append=function(e,r){return this._safeSet(B.APPEND,e,r),this},t.prototype.prepend=function(e,r){return this._safeSet(B.PREPEND,e,r),this},t.prototype.postInsert=function(e,r){return this._safeSet(B.POSTINSERT,e,r),this},t.prototype.preInsert=function(e,r){return this._safeSet(B.PREINSERT,e,r),this},t.prototype.remove=function(e,r){return this._safeSet(B.REMOVE,e,r),this},t.prototype.add=function(e,r){return this._safeSet(B.ADD,e,r),this},t.prototype.unset=function(e){return this._safeSet(B.UNSET,e,qt),this},t.prototype.clearAll=function(){return this._properties={},this._properties[B.CLEAR_ALL]=qt,this},t.prototype._safeSet=function(e,r,n){if(this._validate(e,r,n)){var i=this._properties[e];return i===void 0&&(i={},this._properties[e]=i),i[r]=n,this._propertySet.add(r),!0}return!1},t.prototype._validate=function(e,r,n){return this._properties[B.CLEAR_ALL]!==void 0||this._propertySet.has(r)?!1:e===B.ADD?typeof n=="number":e!==B.UNSET&&e!==B.REMOVE?Kt(r,n):!0},t}();var en=function(t,e,r){var n=typeof t=="string"?{event_type:t}:t;return E(E(E({},n),r),e&&{event_properties:e})},Ke=function(t,e){var r=E(E({},e),{event_type:de.IDENTIFY,user_properties:t.getUserProperties()});return r},tn=function(t,e,r,n){var i,o=E(E({},n),{event_type:de.GROUP_IDENTIFY,group_properties:r.getUserProperties(),groups:(i={},i[t]=e,i)});return o},rn=function(t,e,r){var n,i=new ne;i.set(t,e);var o=E(E({},r),{event_type:de.IDENTIFY,user_properties:i.getUserProperties(),groups:(n={},n[t]=e,n)});return o},nn=function(t,e){return E(E({},e),{event_type:de.REVENUE,event_properties:t.getEventProperties()})};var ve=function(t,e,r){return e===void 0&&(e=0),r===void 0&&(r=M.Unknown),{event:t,code:e,message:r}};var on=function(){function t(e){this.client=e,this.queue=[],this.applying=!1,this.plugins=[]}return t.prototype.register=function(e,r){return g(this,void 0,void 0,function(){return h(this,function(n){switch(n.label){case 0:return[4,e.setup(r,this.client)];case 1:return n.sent(),this.plugins.push(e),[2]}})})},t.prototype.deregister=function(e,r){var n;return g(this,void 0,void 0,function(){var i,o;return h(this,function(s){switch(s.label){case 0:return i=this.plugins.findIndex(function(u){return u.name===e}),i===-1?(r.loggerProvider.warn("Plugin with name ".concat(e," does not exist, skipping deregistration")),[2]):(o=this.plugins[i],this.plugins.splice(i,1),[4,(n=o.teardown)===null||n===void 0?void 0:n.call(o)]);case 1:return s.sent(),[2]}})})},t.prototype.reset=function(e){this.applying=!1;var r=this.plugins;r.map(function(n){var i;return(i=n.teardown)===null||i===void 0?void 0:i.call(n)}),this.plugins=[],this.client=e},t.prototype.push=function(e){var r=this;return new Promise(function(n){r.queue.push([e,n]),r.scheduleApply(0)})},t.prototype.scheduleApply=function(e){var r=this;this.applying||(this.applying=!0,setTimeout(function(){r.apply(r.queue.shift()).then(function(){r.applying=!1,r.queue.length>0&&r.scheduleApply(0)})},e))},t.prototype.apply=function(e){return g(this,void 0,void 0,function(){var r,n,i,o,s,u,d,f,m,p,a,c,l,f,m,_,b,v,y,T,L,k;return h(this,function(w){switch(w.label){case 0:if(!e)return[2];r=A(e,1),n=r[0],i=A(e,2),o=i[1],s=this.plugins.filter(function(C){return C.type===N.BEFORE}),w.label=1;case 1:w.trys.push([1,6,7,8]),u=J(s),d=u.next(),w.label=2;case 2:return d.done?[3,5]:(f=d.value,[4,f.execute(E({},n))]);case 3:if(m=w.sent(),m===null)return o({event:n,code:0,message:""}),[2];n=m,w.label=4;case 4:return d=u.next(),[3,2];case 5:return[3,8];case 6:return p=w.sent(),y={error:p},[3,8];case 7:try{d&&!d.done&&(T=u.return)&&T.call(u)}finally{if(y)throw y.error}return[7];case 8:a=this.plugins.filter(function(C){return C.type===N.ENRICHMENT}),w.label=9;case 9:w.trys.push([9,14,15,16]),c=J(a),l=c.next(),w.label=10;case 10:return l.done?[3,13]:(f=l.value,[4,f.execute(E({},n))]);case 11:if(m=w.sent(),m===null)return o({event:n,code:0,message:""}),[2];n=m,w.label=12;case 12:return l=c.next(),[3,10];case 13:return[3,16];case 14:return _=w.sent(),L={error:_},[3,16];case 15:try{l&&!l.done&&(k=c.return)&&k.call(c)}finally{if(L)throw L.error}return[7];case 16:return b=this.plugins.filter(function(C){return C.type===N.DESTINATION}),v=b.map(function(C){var R=E({},n);return C.execute(R).catch(function(K){return ve(R,0,String(K))})}),Promise.all(v).then(function(C){var R=A(C,1),K=R[0];o(K)}),[2]}})})},t.prototype.flush=function(){return g(this,void 0,void 0,function(){var e,r,n,i=this;return h(this,function(o){switch(o.label){case 0:return e=this.queue,this.queue=[],[4,Promise.all(e.map(function(s){return i.apply(s)}))];case 1:return o.sent(),r=this.plugins.filter(function(s){return s.type===N.DESTINATION}),n=r.map(function(s){return s.flush&&s.flush()}),[4,Promise.all(n)];case 2:return o.sent(),[2]}})})},t}();var sn="Event tracked successfully",an="Unexpected error occurred",un="Event rejected due to exceeded retry count",cn="Event skipped due to optOut config",ln="Event rejected due to missing API key",dn="Invalid API key",pn="Client not initialized";var X=function(t){return{promise:t||Promise.resolve()}};var Wt=function(){function t(e){e===void 0&&(e="$default"),this.initializing=!1,this.q=[],this.dispatchQ=[],this.logEvent=this.track.bind(this),this.timeline=new on(this),this.name=e}return t.prototype._init=function(e){return g(this,void 0,void 0,function(){return h(this,function(r){switch(r.label){case 0:return this.config=e,this.timeline.reset(this),[4,this.runQueuedFunctions("q")];case 1:return r.sent(),[2]}})})},t.prototype.runQueuedFunctions=function(e){return g(this,void 0,void 0,function(){var r,n,i,o,s,u,d;return h(this,function(p){switch(p.label){case 0:r=this[e],this[e]=[],p.label=1;case 1:p.trys.push([1,6,7,8]),n=J(r),i=n.next(),p.label=2;case 2:return i.done?[3,5]:(o=i.value,[4,o()]);case 3:p.sent(),p.label=4;case 4:return i=n.next(),[3,2];case 5:return[3,8];case 6:return s=p.sent(),u={error:s},[3,8];case 7:try{i&&!i.done&&(d=n.return)&&d.call(n)}finally{if(u)throw u.error}return[7];case 8:return[2]}})})},t.prototype.track=function(e,r,n){var i=en(e,r,n);return X(this.dispatch(i))},t.prototype.identify=function(e,r){var n=Ke(e,r);return X(this.dispatch(n))},t.prototype.groupIdentify=function(e,r,n,i){var o=tn(e,r,n,i);return X(this.dispatch(o))},t.prototype.setGroup=function(e,r,n){var i=rn(e,r,n);return X(this.dispatch(i))},t.prototype.revenue=function(e,r){var n=nn(e,r);return X(this.dispatch(n))},t.prototype.add=function(e){return this.config?X(this.timeline.register(e,this.config)):(this.q.push(this.add.bind(this,e)),X())},t.prototype.remove=function(e){return this.config?X(this.timeline.deregister(e,this.config)):(this.q.push(this.remove.bind(this,e)),X())},t.prototype.dispatchWithCallback=function(e,r){if(!this.config)return r(ve(e,0,pn));this.process(e).then(r)},t.prototype.dispatch=function(e){return g(this,void 0,void 0,function(){var r=this;return h(this,function(n){return this.config?[2,this.process(e)]:[2,new Promise(function(i){r.dispatchQ.push(r.dispatchWithCallback.bind(r,e,i))})]})})},t.prototype.process=function(e){return g(this,void 0,void 0,function(){var i,r,n,i;return h(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),this.config.optOut?[2,ve(e,0,cn)]:[4,this.timeline.push(e)];case 1:return i=o.sent(),i.code===200?this.config.loggerProvider.log(i.message):this.config.loggerProvider.error(i.message),[2,i];case 2:return r=o.sent(),this.config.loggerProvider.error(r),n=String(r),i=ve(e,0,n),[2,i];case 3:return[2]}})})},t.prototype.setOptOut=function(e){if(!this.config){this.q.push(this.setOptOut.bind(this,!!e));return}this.config.optOut=!!e},t.prototype.flush=function(){return X(this.timeline.flush())},t}();var gt=function(){function t(){this.productId="",this.quantity=1,this.price=0}return t.prototype.setProductId=function(e){return this.productId=e,this},t.prototype.setQuantity=function(e){return e>0&&(this.quantity=e),this},t.prototype.setPrice=function(e){return this.price=e,this},t.prototype.setRevenueType=function(e){return this.revenueType=e,this},t.prototype.setCurrency=function(e){return this.currency=e,this},t.prototype.setRevenue=function(e){return this.revenue=e,this},t.prototype.setEventProperties=function(e){return vt(e)&&(this.properties=e),this},t.prototype.getEventProperties=function(){var e=this.properties?E({},this.properties):{};return e[re.REVENUE_PRODUCT_ID]=this.productId,e[re.REVENUE_QUANTITY]=this.quantity,e[re.REVENUE_PRICE]=this.price,e[re.REVENUE_TYPE]=this.revenueType,e[re.REVENUE_CURRENCY]=this.currency,e[re.REVENUE]=this.revenue,e},t}();var fn=function(t,e){var r=Math.max(e,1);return t.reduce(function(n,i,o){var s=Math.floor(o/r);return n[s]||(n[s]=[]),n[s].push(i),n},[])};var ht="Amplitude Logger ",mn=function(){function t(){this.logLevel=Y.None}return t.prototype.disable=function(){this.logLevel=Y.None},t.prototype.enable=function(e){e===void 0&&(e=Y.Warn),this.logLevel=e},t.prototype.log=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];this.logLevel<Y.Verbose||console.log("".concat(ht,"[Log]: ").concat(e.join(" ")))},t.prototype.warn=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];this.logLevel<Y.Warn||console.warn("".concat(ht,"[Warn]: ").concat(e.join(" ")))},t.prototype.error=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];this.logLevel<Y.Error||console.error("".concat(ht,"[Error]: ").concat(e.join(" ")))},t.prototype.debug=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];this.logLevel<Y.Debug||console.log("".concat(ht,"[Debug]: ").concat(e.join(" ")))},t}();var yt=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:"$default_instance",logLevel:Y.Warn,loggerProvider:new mn,optOut:!1,serverUrl:Gt,serverZone:Se.US,useBatch:!1}},$t=function(){function t(e){var r,n,i,o;this._optOut=!1;var s=yt();this.apiKey=e.apiKey,this.flushIntervalMillis=(r=e.flushIntervalMillis)!==null&&r!==void 0?r:s.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||s.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||s.flushQueueSize,this.instanceName=e.instanceName||s.instanceName,this.loggerProvider=e.loggerProvider||s.loggerProvider,this.logLevel=(n=e.logLevel)!==null&&n!==void 0?n:s.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.optOut=(i=e.optOut)!==null&&i!==void 0?i:s.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||s.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=(o=e.useBatch)!==null&&o!==void 0?o:s.useBatch,this.loggerProvider.enable(this.logLevel);var u=Yt(e.serverUrl,e.serverZone,e.useBatch);this.serverZone=u.serverZone,this.serverUrl=u.serverUrl}return Object.defineProperty(t.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut=e},enumerable:!1,configurable:!0}),t}();var Si=function(t,e){return t===Se.EU?e?Jr:Xr:e?Zr:Gt},Yt=function(t,e,r){if(t===void 0&&(t=""),e===void 0&&(e=yt().serverZone),r===void 0&&(r=yt().useBatch),t)return{serverUrl:t,serverZone:void 0};var n=["US","EU"].includes(e)?e:yt().serverZone;return{serverZone:n,serverUrl:Si(n,r)}};function Ii(t){return t instanceof Error?t.message:String(t)}function bt(t){var e="";try{"body"in t&&(e=JSON.stringify(t.body))}catch{}return e}var zt=function(){function t(){this.name="amplitude",this.type=N.DESTINATION,this.retryTimeout=1e3,this.throttleTimeout=3e4,this.storageKey="",this.scheduled=null,this.queue=[]}return t.prototype.setup=function(e){var r;return g(this,void 0,void 0,function(){var n,i=this;return h(this,function(o){switch(o.label){case 0:return this.config=e,this.storageKey="".concat(jt,"_").concat(this.config.apiKey.substring(0,10)),[4,(r=this.config.storageProvider)===null||r===void 0?void 0:r.get(this.storageKey)];case 1:return n=o.sent(),this.saveEvents(),n&&n.length>0&&Promise.all(n.map(function(s){return i.execute(s)})).catch(),[2,Promise.resolve(void 0)]}})})},t.prototype.execute=function(e){var r=this;return new Promise(function(n){var i={event:e,attempts:0,callback:function(o){return n(o)},timeout:0};r.addToQueue(i)})},t.prototype.addToQueue=function(){for(var e=this,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=r.filter(function(o){return o.attempts<e.config.flushMaxRetries?(o.attempts+=1,!0):(e.fulfillRequest([o],500,un),!1)});i.forEach(function(o){if(e.queue=e.queue.concat(o),o.timeout===0){e.schedule(e.config.flushIntervalMillis);return}setTimeout(function(){o.timeout=0,e.schedule(0)},o.timeout)}),this.saveEvents()},t.prototype.schedule=function(e){var r=this;this.scheduled||(this.scheduled=setTimeout(function(){r.flush(!0).then(function(){r.queue.length>0&&r.schedule(e)})},e))},t.prototype.flush=function(e){return e===void 0&&(e=!1),g(this,void 0,void 0,function(){var r,n,i,o=this;return h(this,function(s){switch(s.label){case 0:return r=[],n=[],this.queue.forEach(function(u){return u.timeout===0?r.push(u):n.push(u)}),this.queue=n,this.scheduled&&(clearTimeout(this.scheduled),this.scheduled=null),i=fn(r,this.config.flushQueueSize),[4,Promise.all(i.map(function(u){return o.send(u,e)}))];case 1:return s.sent(),[2]}})})},t.prototype.send=function(e,r){return r===void 0&&(r=!0),g(this,void 0,void 0,function(){var n,i,o,s,u;return h(this,function(d){switch(d.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(e,400,ln)];n={api_key:this.config.apiKey,events:e.map(function(p){var a=p.event,c=a.extra,l=Ge(a,["extra"]);return l}),options:{min_id_length:this.config.minIdLength}},d.label=1;case 1:return d.trys.push([1,3,,4]),i=Yt(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,[4,this.config.transportProvider.send(i,n)];case 2:return o=d.sent(),o===null?(this.fulfillRequest(e,0,an),[2]):r?(this.handleResponse(o,e),[3,4]):("body"in o?this.fulfillRequest(e,o.statusCode,"".concat(o.status,": ").concat(bt(o))):this.fulfillRequest(e,o.statusCode,o.status),[2]);case 3:return s=d.sent(),this.config.loggerProvider.error(s),u=Ii(s),this.fulfillRequest(e,0,u),[3,4];case 4:return[2]}})})},t.prototype.handleResponse=function(e,r){var n=e.status;switch(n){case M.Success:{this.handleSuccessResponse(e,r);break}case M.Invalid:{this.handleInvalidResponse(e,r);break}case M.PayloadTooLarge:{this.handlePayloadTooLargeResponse(e,r);break}case M.RateLimit:{this.handleRateLimitResponse(e,r);break}default:{this.config.loggerProvider.warn(\`{code: 0, error: "Status '\`.concat(n,"' provided for ").concat(r.length,' events"}')),this.handleOtherResponse(r);break}}},t.prototype.handleSuccessResponse=function(e,r){this.fulfillRequest(r,e.statusCode,sn)},t.prototype.handleInvalidResponse=function(e,r){var n=this;if(e.body.missingField||e.body.error.startsWith(dn)){this.fulfillRequest(r,e.statusCode,e.body.error);return}var i=ee(ee(ee(ee([],A(Object.values(e.body.eventsWithInvalidFields)),!1),A(Object.values(e.body.eventsWithMissingFields)),!1),A(Object.values(e.body.eventsWithInvalidIdLengths)),!1),A(e.body.silencedEvents),!1).flat(),o=new Set(i),s=r.filter(function(u,d){if(o.has(d)){n.fulfillRequest([u],e.statusCode,e.body.error);return}return!0});s.length>0&&this.config.loggerProvider.warn(bt(e)),this.addToQueue.apply(this,ee([],A(s),!1))},t.prototype.handlePayloadTooLargeResponse=function(e,r){if(r.length===1){this.fulfillRequest(r,e.statusCode,e.body.error);return}this.config.loggerProvider.warn(bt(e)),this.config.flushQueueSize/=2,this.addToQueue.apply(this,ee([],A(r),!1))},t.prototype.handleRateLimitResponse=function(e,r){var n=this,i=Object.keys(e.body.exceededDailyQuotaUsers),o=Object.keys(e.body.exceededDailyQuotaDevices),s=e.body.throttledEvents,u=new Set(i),d=new Set(o),p=new Set(s),a=r.filter(function(c,l){if(c.event.user_id&&u.has(c.event.user_id)||c.event.device_id&&d.has(c.event.device_id)){n.fulfillRequest([c],e.statusCode,e.body.error);return}return p.has(l)&&(c.timeout=n.throttleTimeout),!0});a.length>0&&this.config.loggerProvider.warn(bt(e)),this.addToQueue.apply(this,ee([],A(a),!1))},t.prototype.handleOtherResponse=function(e){var r=this;this.addToQueue.apply(this,ee([],A(e.map(function(n){return n.timeout=n.attempts*r.retryTimeout,n})),!1))},t.prototype.fulfillRequest=function(e,r,n){this.saveEvents(),e.forEach(function(i){return i.callback(ve(i.event,r,n))})},t.prototype.saveEvents=function(){if(this.config.storageProvider){var e=Array.from(this.queue.map(function(r){return r.event}));this.config.storageProvider.set(this.storageKey,e)}},t}();var xi=function(t){t===void 0&&(t=0);var e=new Error().stack||"";return e.split(\`
|
|
35
35
|
\`).slice(2+t).map(function(r){return r.trim()})},V=function(t){return function(){var e=E({},t.config),r=e.loggerProvider,n=e.logLevel;return{logger:r,logLevel:n}}},Li=function(t,e){var r,n;e=e.replace(/\\[(\\w+)\\]/g,".$1"),e=e.replace(/^\\./,"");try{for(var i=J(e.split(".")),o=i.next();!o.done;o=i.next()){var s=o.value;if(s in t)t=t[s];else return}}catch(u){r={error:u}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return t},F=function(t,e){return function(){var r,n,i={};try{for(var o=J(e),s=o.next();!s.done;s=o.next()){var u=s.value;i[u]=Li(t,u)}}catch(d){r={error:d}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return i}},H=function(t,e,r,n,i){return i===void 0&&(i=null),function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];var u=r(),d=u.logger,p=u.logLevel;if(p&&p<Y.Debug||!p||!d)return t.apply(i,o);var a={type:"invoke public method",name:e,args:o,stacktrace:xi(1),time:{start:new Date().toISOString()},states:{}};n&&a.states&&(a.states.before=n());var c=t.apply(i,o);return c&&c.promise?c.promise.then(function(){n&&a.states&&(a.states.after=n()),a.time&&(a.time.end=new Date().toISOString()),d.debug(JSON.stringify(a,null,2))}):(n&&a.states&&(a.states.after=n()),a.time&&(a.time.end=new Date().toISOString()),d.debug(JSON.stringify(a,null,2))),c}};var ge=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,ge)};var Et=function(){function t(){this.memoryStorage=new Map}return t.prototype.isEnabled=function(){return g(this,void 0,void 0,function(){return h(this,function(e){return[2,!0]})})},t.prototype.get=function(e){return g(this,void 0,void 0,function(){return h(this,function(r){return[2,this.memoryStorage.get(e)]})})},t.prototype.getRaw=function(e){return g(this,void 0,void 0,function(){var r;return h(this,function(n){switch(n.label){case 0:return[4,this.get(e)];case 1:return r=n.sent(),[2,r?JSON.stringify(r):void 0]}})})},t.prototype.set=function(e,r){return g(this,void 0,void 0,function(){return h(this,function(n){return this.memoryStorage.set(e,r),[2]})})},t.prototype.remove=function(e){return g(this,void 0,void 0,function(){return h(this,function(r){return this.memoryStorage.delete(e),[2]})})},t.prototype.reset=function(){return g(this,void 0,void 0,function(){return h(this,function(e){return this.memoryStorage.clear(),[2]})})},t}();var Le=function(){function t(){}return t.prototype.send=function(e,r){return Promise.resolve(null)},t.prototype.buildResponse=function(e){var r,n,i,o,s,u,d,p,a,c,l,f,m,_,b,v,y,T,L,k,w,C;if(typeof e!="object")return null;var R=e.code||0,K=this.buildStatus(R);switch(K){case M.Success:return{status:K,statusCode:R,body:{eventsIngested:(r=e.events_ingested)!==null&&r!==void 0?r:0,payloadSizeBytes:(n=e.payload_size_bytes)!==null&&n!==void 0?n:0,serverUploadTime:(i=e.server_upload_time)!==null&&i!==void 0?i:0}};case M.Invalid:return{status:K,statusCode:R,body:{error:(o=e.error)!==null&&o!==void 0?o:"",missingField:(s=e.missing_field)!==null&&s!==void 0?s:"",eventsWithInvalidFields:(u=e.events_with_invalid_fields)!==null&&u!==void 0?u:{},eventsWithMissingFields:(d=e.events_with_missing_fields)!==null&&d!==void 0?d:{},eventsWithInvalidIdLengths:(p=e.events_with_invalid_id_lengths)!==null&&p!==void 0?p:{},epsThreshold:(a=e.eps_threshold)!==null&&a!==void 0?a:0,exceededDailyQuotaDevices:(c=e.exceeded_daily_quota_devices)!==null&&c!==void 0?c:{},silencedDevices:(l=e.silenced_devices)!==null&&l!==void 0?l:[],silencedEvents:(f=e.silenced_events)!==null&&f!==void 0?f:[],throttledDevices:(m=e.throttled_devices)!==null&&m!==void 0?m:{},throttledEvents:(_=e.throttled_events)!==null&&_!==void 0?_:[]}};case M.PayloadTooLarge:return{status:K,statusCode:R,body:{error:(b=e.error)!==null&&b!==void 0?b:""}};case M.RateLimit:return{status:K,statusCode:R,body:{error:(v=e.error)!==null&&v!==void 0?v:"",epsThreshold:(y=e.eps_threshold)!==null&&y!==void 0?y:0,throttledDevices:(T=e.throttled_devices)!==null&&T!==void 0?T:{},throttledUsers:(L=e.throttled_users)!==null&&L!==void 0?L:{},exceededDailyQuotaDevices:(k=e.exceeded_daily_quota_devices)!==null&&k!==void 0?k:{},exceededDailyQuotaUsers:(w=e.exceeded_daily_quota_users)!==null&&w!==void 0?w:{},throttledEvents:(C=e.throttled_events)!==null&&C!==void 0?C:[]}};case M.Timeout:default:return{status:K,statusCode:R}}},t.prototype.buildStatus=function(e){return e>=200&&e<300?M.Success:e===429?M.RateLimit:e===413?M.PayloadTooLarge:e===408?M.Timeout:e>=400&&e<500?M.Invalid:e>=500?M.Failed:M.Unknown},t}();var Pi=function(){function t(){}return t.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:Ci(),platform:"Web",os:void 0,deviceModel:void 0}},t}(),Ci=function(){return typeof navigator<"u"&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},Ri=function(){function t(){this.queue=[]}return t.prototype.logEvent=function(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)},t.prototype.setEventReceiver=function(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach(function(r){e(r)}),this.queue=[])},t}(),he=function(){return he=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},he.apply(this,arguments)};function _t(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function vn(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,o=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(u){s={error:u}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o}var Tt=function(t,e){var r,n,i=["string","number","boolean","undefined"],o=typeof t,s=typeof e;if(o!==s)return!1;try{for(var u=_t(i),d=u.next();!d.done;d=u.next()){var p=d.value;if(p===o)return t===e}}catch(b){r={error:b}}finally{try{d&&!d.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}if(t==null&&e==null)return!0;if(t==null||e==null||t.length!==e.length)return!1;var a=Array.isArray(t),c=Array.isArray(e);if(a!==c)return!1;if(a&&c){for(var l=0;l<t.length;l++)if(!Tt(t[l],e[l]))return!1}else{var f=Object.keys(t).sort(),m=Object.keys(e).sort();if(!Tt(f,m))return!1;var _=!0;return Object.keys(t).forEach(function(b){Tt(t[b],e[b])||(_=!1)}),_}return!0},Oi="$set",ki="$unset",Ai="$clearAll";Object.entries||(Object.entries=function(t){for(var e=Object.keys(t),r=e.length,n=new Array(r);r--;)n[r]=[e[r],t[e[r]]];return n});var Di=function(){function t(){this.identity={userProperties:{}},this.listeners=new Set}return t.prototype.editIdentity=function(){var e=this,r=he({},this.identity.userProperties),n=he(he({},this.identity),{userProperties:r});return{setUserId:function(i){return n.userId=i,this},setDeviceId:function(i){return n.deviceId=i,this},setUserProperties:function(i){return n.userProperties=i,this},setOptOut:function(i){return n.optOut=i,this},updateUserProperties:function(i){var o,s,u,d,p,a,c=n.userProperties||{};try{for(var l=_t(Object.entries(i)),f=l.next();!f.done;f=l.next()){var m=vn(f.value,2),_=m[0],b=m[1];switch(_){case Oi:try{for(var v=(u=void 0,_t(Object.entries(b))),y=v.next();!y.done;y=v.next()){var T=vn(y.value,2),L=T[0],k=T[1];c[L]=k}}catch(R){u={error:R}}finally{try{y&&!y.done&&(d=v.return)&&d.call(v)}finally{if(u)throw u.error}}break;case ki:try{for(var w=(p=void 0,_t(Object.keys(b))),C=w.next();!C.done;C=w.next()){var L=C.value;delete c[L]}}catch(R){p={error:R}}finally{try{C&&!C.done&&(a=w.return)&&a.call(w)}finally{if(p)throw p.error}}break;case Ai:c={};break}}}catch(R){o={error:R}}finally{try{f&&!f.done&&(s=l.return)&&s.call(l)}finally{if(o)throw o.error}}return n.userProperties=c,this},commit:function(){return e.setIdentity(n),this}}},t.prototype.getIdentity=function(){return he({},this.identity)},t.prototype.setIdentity=function(e){var r=he({},this.identity);this.identity=he({},e),Tt(r,this.identity)||this.listeners.forEach(function(n){n(e)})},t.prototype.addIdentityListener=function(e){this.listeners.add(e)},t.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},t}(),We=typeof globalThis<"u"?globalThis:typeof global<"u"?global:self,gn=function(){function t(){this.identityStore=new Di,this.eventBridge=new Ri,this.applicationContextProvider=new Pi}return t.getInstance=function(e){return We.analyticsConnectorInstances||(We.analyticsConnectorInstances={}),We.analyticsConnectorInstances[e]||(We.analyticsConnectorInstances[e]=new t),We.analyticsConnectorInstances[e]},t}();var pe=function(t){return t===void 0&&(t="$default_instance"),gn.getInstance(t)},Qt=function(t,e){pe(e).identityStore.editIdentity().setUserId(t).commit()},Xt=function(t,e){pe(e).identityStore.editIdentity().setDeviceId(t).commit()},Zt=function(t,e){pe(e).identityStore.editIdentity().setOptOut(t).commit()};var $=function(){if(typeof globalThis<"u")return globalThis;if(typeof window<"u")return window;if(typeof self<"u")return self;if(typeof global<"u")return global};var Ne=function(){var t,e=$();if(!(!((t=e?.location)===null||t===void 0)&&t.search))return{};var r=e.location.search.substring(1).split("&").filter(Boolean),n=r.reduce(function(i,o){var s=o.split("=",2),u=hn(s[0]),d=hn(s[1]);return d&&(i[u]=d),i},{});return n},hn=function(t){t===void 0&&(t="");try{return decodeURIComponent(t)}catch{return""}};var yn="utm_campaign",bn="utm_content",En="utm_id",_n="utm_medium",Tn="utm_source",wn="utm_term",Jt="dclid",er="fbclid",tr="gbraid",rr="gclid",nr="ko_click_id",ir="li_fat_id",or="msclkid",sr="rtd_cid",ar="ttclid",ur="twclid",cr="wbraid";var Pe={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rtd_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0};var $e=function(){function t(){}return t.prototype.parse=function(){return g(this,void 0,void 0,function(){return h(this,function(e){return[2,E(E(E(E({},Pe),this.getUtmParam()),this.getReferrer()),this.getClickIds())]})})},t.prototype.getUtmParam=function(){var e=Ne(),r=e[yn],n=e[bn],i=e[En],o=e[_n],s=e[Tn],u=e[wn];return{utm_campaign:r,utm_content:n,utm_id:i,utm_medium:o,utm_source:s,utm_term:u}},t.prototype.getReferrer=function(){var e,r,n={referrer:void 0,referring_domain:void 0};try{n.referrer=document.referrer||void 0,n.referring_domain=(r=(e=n.referrer)===null||e===void 0?void 0:e.split("/")[2])!==null&&r!==void 0?r:void 0}catch{}return n},t.prototype.getClickIds=function(){var e,r=Ne();return e={},e[Jt]=r[Jt],e[er]=r[er],e[tr]=r[tr],e[rr]=r[rr],e[nr]=r[nr],e[ir]=r[ir],e[or]=r[or],e[sr]=r[sr],e[ar]=r[ar],e[ur]=r[ur],e[cr]=r[cr],e},t}();var Ye=function(t,e,r){return e===void 0&&(e=""),r===void 0&&(r=10),[xe,e,t.substring(0,r)].filter(Boolean).join("_")},lr=function(t){return"".concat(xe.toLowerCase(),"_").concat(t.substring(0,6))};var dr=function(t){return typeof t=="boolean"?t:!!t?.fileDownloads},pr=function(t){return typeof t=="boolean"?t:!!t?.formInteractions},Sn=function(t){return typeof t=="boolean"?t:!!(t?.pageViews===!0||t?.pageViews&&typeof t.pageViews=="object")},fr=function(t){return typeof t=="boolean"?t:!!t?.sessions},mr=function(t){var e,r=!((e=t.attribution)===null||e===void 0)&&e.trackPageViews?"attribution":function(){return!1},n=void 0,i="Page View",o=Sn(t.defaultTracking);return o&&(r=void 0,i=void 0,t.defaultTracking&&typeof t.defaultTracking=="object"&&t.defaultTracking.pageViews&&typeof t.defaultTracking.pageViews=="object"&&("trackOn"in t.defaultTracking.pageViews&&(r=t.defaultTracking.pageViews.trackOn),"trackHistoryChanges"in t.defaultTracking.pageViews&&(n=t.defaultTracking.pageViews.trackHistoryChanges),"eventType"in t.defaultTracking.pageViews&&t.defaultTracking.pageViews.eventType&&(i=t.defaultTracking.pageViews.eventType))),{trackOn:r,trackHistoryChanges:n,eventType:i}};var vr=function(){var t,e,r,n;if(typeof navigator>"u")return"";var i=navigator.userLanguage;return(n=(r=(e=(t=navigator.languages)===null||t===void 0?void 0:t[0])!==null&&e!==void 0?e:navigator.language)!==null&&r!==void 0?r:i)!==null&&n!==void 0?n:""};var gr=function(){function t(){this.name="identity",this.type=N.BEFORE,this.identityStore=pe().identityStore}return t.prototype.execute=function(e){return g(this,void 0,void 0,function(){var r;return h(this,function(n){return r=e.user_properties,r&&this.identityStore.editIdentity().updateUserProperties(r).commit(),[2,e]})})},t.prototype.setup=function(e){return g(this,void 0,void 0,function(){return h(this,function(r){return e.instanceName&&(this.identityStore=pe(e.instanceName).identityStore),[2]})})},t}();var ze=function(){function t(e){this.options=E({},e)}return t.prototype.isEnabled=function(){return g(this,void 0,void 0,function(){var e,r,n,i;return h(this,function(o){switch(o.label){case 0:if(!$())return[2,!1];t.testValue=String(Date.now()),e=new t(this.options),r="AMP_TEST",o.label=1;case 1:return o.trys.push([1,4,5,7]),[4,e.set(r,t.testValue)];case 2:return o.sent(),[4,e.get(r)];case 3:return n=o.sent(),[2,n===t.testValue];case 4:return i=o.sent(),[2,!1];case 5:return[4,e.remove(r)];case 6:return o.sent(),[7];case 7:return[2]}})})},t.prototype.get=function(e){return g(this,void 0,void 0,function(){var r;return h(this,function(n){switch(n.label){case 0:return[4,this.getRaw(e)];case 1:if(r=n.sent(),!r)return[2,void 0];try{try{r=decodeURIComponent(atob(r))}catch{}return[2,JSON.parse(r)]}catch{return[2,void 0]}return[2]}})})},t.prototype.getRaw=function(e){var r;return g(this,void 0,void 0,function(){var n,i,o;return h(this,function(s){return n=$(),i=(r=n?.document.cookie.split("; "))!==null&&r!==void 0?r:[],o=i.find(function(u){return u.indexOf(e+"=")===0}),o?[2,o.substring(e.length+1)]:[2,void 0]})})},t.prototype.set=function(e,r){var n;return g(this,void 0,void 0,function(){var i,o,s,u,d,p;return h(this,function(a){try{i=(n=this.options.expirationDays)!==null&&n!==void 0?n:0,o=r!==null?i:-1,s=void 0,o&&(u=new Date,u.setTime(u.getTime()+o*24*60*60*1e3),s=u),d="".concat(e,"=").concat(btoa(encodeURIComponent(JSON.stringify(r)))),s&&(d+="; expires=".concat(s.toUTCString())),d+="; path=/",this.options.domain&&(d+="; domain=".concat(this.options.domain)),this.options.secure&&(d+="; Secure"),this.options.sameSite&&(d+="; SameSite=".concat(this.options.sameSite)),p=$(),p&&(p.document.cookie=d)}catch{}return[2]})})},t.prototype.remove=function(e){return g(this,void 0,void 0,function(){return h(this,function(r){switch(r.label){case 0:return[4,this.set(e,null)];case 1:return r.sent(),[2]}})})},t.prototype.reset=function(){return g(this,void 0,void 0,function(){return h(this,function(e){return[2]})})},t}();var hr=function(t){ae(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.send=function(r,n){return g(this,void 0,void 0,function(){var i,o,s;return h(this,function(u){switch(u.label){case 0:if(typeof fetch>"u")throw new Error("FetchTransport is not supported");return i={headers:{"Content-Type":"application/json",Accept:"*/*"},body:JSON.stringify(n),method:"POST"},[4,fetch(r,i)];case 1:return o=u.sent(),[4,o.text()];case 2:s=u.sent();try{return[2,this.buildResponse(JSON.parse(s))]}catch{return[2,this.buildResponse({code:o.status})]}return[2]}})})},e}(Le);var In=function(t){var e={};for(var r in t){var n=t[r];n&&(e[r]=n)}return e};var yr=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r,n={},i=$(),o=void 0,s,u=A(t,2),d=u[0],p=u[1];d&&"init"in d?(r=d,p&&(n=p)):d&&(n=d);var a=function(){return g(void 0,void 0,void 0,function(){var b,v,y;return h(this,function(T){switch(T.label){case 0:return v={event_type:(y=n.eventType)!==null&&y!==void 0?y:"Page View"},b=[{}],[4,Ni()];case 1:return[2,(v.event_properties=E.apply(void 0,[E.apply(void 0,b.concat([T.sent()])),{page_domain:typeof location<"u"&&location.hostname||"",page_location:typeof location<"u"&&location.href||"",page_path:typeof location<"u"&&location.pathname||"",page_title:typeof document<"u"&&document.title||"",page_url:typeof location<"u"&&location.href.split("?")[0]||""}]),v)]}})})},c=function(){return typeof n.trackOn>"u"||typeof n.trackOn=="function"&&n.trackOn()},l=typeof location<"u"?location.href:null,f=function(){return g(void 0,void 0,void 0,function(){var b,v,y,T,L;return h(this,function(k){switch(k.label){case 0:return b=location.href,v=Mi(n.trackHistoryChanges,b,l||"")&&c(),l=b,v?(o?.log("Tracking page view event"),r!=null?[3,1]:(y=void 0,[3,3])):[3,4];case 1:return L=(T=r).track,[4,a()];case 2:y=L.apply(T,[k.sent()]),k.label=3;case 3:k.label=4;case 4:return[2]}})})},m=function(){f()},_={name:"page-view-tracking",type:N.ENRICHMENT,setup:function(b,v){return g(void 0,void 0,void 0,function(){var y,T,L,k,w;return h(this,function(C){switch(C.label){case 0:return r=r??v,r?(o=b.loggerProvider,o.log("Installing @amplitude/plugin-page-view-tracking-browser"),n.trackOn=!((k=b.attribution)===null||k===void 0)&&k.trackPageViews?"attribution":n.trackOn,!v&&(!((w=b.attribution)===null||w===void 0)&&w.trackPageViews)&&(o.warn("@amplitude/plugin-page-view-tracking-browser overrides page view tracking behavior defined in @amplitude/analytics-browser. Resolve by disabling page view tracking in @amplitude/analytics-browser."),b.attribution.trackPageViews=!1),n.trackHistoryChanges&&i&&(i.addEventListener("popstate",m),s=i.history.pushState,i.history.pushState=new Proxy(i.history.pushState,{apply:function(R,K,z){var Q=A(z,3),P=Q[0],Ce=Q[1],ce=Q[2];R.apply(K,[P,Ce,ce]),f()}})),c()?(o.log("Tracking page view event"),L=(T=r).track,[4,a()]):[3,2]):(y=d?"Options":"undefined",b.loggerProvider.error("Argument of type '".concat(y,"' is not assignable to parameter of type 'BrowserClient'.")),[2]);case 1:L.apply(T,[C.sent()]),C.label=2;case 2:return[2]}})})},execute:function(b){return g(void 0,void 0,void 0,function(){var v;return h(this,function(y){switch(y.label){case 0:return n.trackOn==="attribution"&&Ui(b)?(o?.log("Enriching campaign event to page view event with campaign parameters"),[4,a()]):[3,2];case 1:v=y.sent(),b.event_type=v.event_type,b.event_properties=E(E({},b.event_properties),v.event_properties),y.label=2;case 2:return[2,b]}})})},teardown:function(){return g(void 0,void 0,void 0,function(){return h(this,function(b){return i&&(i.removeEventListener("popstate",m),s&&(i.history.pushState=s)),[2]})})}};return _.__trackHistoryPageView=f,_},Ni=function(){return g(void 0,void 0,void 0,function(){var t;return h(this,function(e){switch(e.label){case 0:return t=In,[4,new $e().parse()];case 1:return[2,t.apply(void 0,[e.sent()])]}})})},Ui=function(t){if(t.event_type==="$identify"&&t.user_properties){var e=t.user_properties,r=e[B.SET]||{},n=e[B.UNSET]||{},i=ee(ee([],A(Object.keys(r)),!1),A(Object.keys(n)),!1);return Object.keys(Pe).every(function(o){return i.includes(o)})}return!1},Mi=function(t,e,r){switch(t){case"pathOnly":return e.split("?")[0]!==r.split("?")[0];default:return e!==r}};var Ln=function(t,e,r){return e===void 0&&(e=""),r===void 0&&(r=10),[xe,e,t.substring(0,r)].filter(Boolean).join("_")},xn=function(t){var e=t.split(".");return e.length<=2?t:e.slice(e.length-2,e.length).join(".")},Pn=function(t,e,r){var n,i=t.referrer,o=t.referring_domain,s=Ge(t,["referrer","referring_domain"]),u=e||{},d=u.referrer,p=u.referring_domain,a=Ge(u,["referrer","referring_domain"]);if(t.referring_domain&&(!((n=r.excludeReferrers)===null||n===void 0)&&n.includes(t.referring_domain)))return!1;var c=JSON.stringify(s)!==JSON.stringify(a),l=xn(o||"")!==xn(p||"");return!e||c||l},Cn=function(t,e){var r=E(E({},Pe),t),n=Object.entries(r).reduce(function(i,o){var s,u=A(o,2),d=u[0],p=u[1];return i.setOnce("initial_".concat(d),(s=p??e.initialEmptyValue)!==null&&s!==void 0?s:"EMPTY"),p?i.set(d,p):i.unset(d)},new ne);return Ke(n)};var br=function(){for(var t=this,e,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i,o={},s=A(r,2),u=s[0],d=s[1];u&&"init"in u?(i=u,d&&(o=d)):u&&(o=u);var p=(e=o.excludeReferrers)!==null&&e!==void 0?e:[];typeof location<"u"&&p.unshift(location.hostname),o=E(E({disabled:!1,initialEmptyValue:"EMPTY",resetSessionOnNewCampaign:!1},o),{excludeReferrers:p});var a={name:"web-attribution",type:N.BEFORE,setup:function(c,l){var f;return g(this,void 0,void 0,function(){var m,_,b,v,y,T,L,k;return h(this,function(w){switch(w.label){case 0:return i=i??l,i?o.disabled?(c.loggerProvider.log("@amplitude/plugin-web-attribution-browser is disabled. Attribution is not tracked."),[2]):(c.loggerProvider.log("Installing @amplitude/plugin-web-attribution-browser."),!l&&!(!((f=c.attribution)===null||f===void 0)&&f.disabled)&&(c.loggerProvider.warn("@amplitude/plugin-web-attribution-browser overrides web attribution behavior defined in @amplitude/analytics-browser. Resolve by disabling web attribution tracking in @amplitude/analytics-browser."),c.attribution={disabled:!0}),_=c.cookieStorage,b=Ln(c.apiKey,"MKTG"),[4,Promise.all([new $e().parse(),_.get(b)])]):(m=u?"Options":"undefined",c.loggerProvider.error("Argument of type '".concat(m,"' is not assignable to parameter of type 'BrowserClient'.")),[2]);case 1:return v=A.apply(void 0,[w.sent(),2]),y=v[0],T=v[1],L=this.__pluginEnabledOverride,(L??Pn(y,T,o))&&(o.resetSessionOnNewCampaign&&(i.setSessionId(Date.now()),c.loggerProvider.log("Created a new session for new campaign.")),c.loggerProvider.log("Tracking attribution."),k=Cn(y,o),i.track(k),_.set(b,y)),[2]}})})},execute:function(c){return g(t,void 0,void 0,function(){return h(this,function(l){return[2,c]})})}};return a.__pluginEnabledOverride=void 0,a};var wt=1e3,Er=function(){function t(e){this.loggerProvider=e?.loggerProvider}return t.prototype.isEnabled=function(){return g(this,void 0,void 0,function(){var e,r,n,i,o;return h(this,function(s){switch(s.label){case 0:if(!$())return[2,!1];e=String(Date.now()),r=new t,n="AMP_TEST",s.label=1;case 1:return s.trys.push([1,4,5,7]),[4,r.set(n,e)];case 2:return s.sent(),[4,r.get(n)];case 3:return i=s.sent(),[2,i===e];case 4:return o=s.sent(),[2,!1];case 5:return[4,r.remove(n)];case 6:return s.sent(),[7];case 7:return[2]}})})},t.prototype.get=function(e){return g(this,void 0,void 0,function(){var r,n;return h(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.getRaw(e)];case 1:return r=i.sent(),r?[2,JSON.parse(r)]:[2,void 0];case 2:return n=i.sent(),[2,void 0];case 3:return[2]}})})},t.prototype.getRaw=function(e){var r;return g(this,void 0,void 0,function(){return h(this,function(n){return[2,((r=$())===null||r===void 0?void 0:r.localStorage.getItem(e))||void 0]})})},t.prototype.set=function(e,r){var n,i;return g(this,void 0,void 0,function(){var o,s,u;return h(this,function(d){o=Array.isArray(r)&&r.length>wt;try{s=JSON.stringify(o?r.slice(0,wt):r),(n=$())===null||n===void 0||n.localStorage.setItem(e,s)}catch{}return o&&(u=r.length-wt,(i=this.loggerProvider)===null||i===void 0||i.error("Failed to save ".concat(u," events because the queue length exceeded ").concat(wt,"."))),[2]})})},t.prototype.remove=function(e){var r;return g(this,void 0,void 0,function(){return h(this,function(n){try{(r=$())===null||r===void 0||r.localStorage.removeItem(e)}catch{}return[2]})})},t.prototype.reset=function(){var e;return g(this,void 0,void 0,function(){return h(this,function(r){try{(e=$())===null||e===void 0||e.localStorage.clear()}catch{}return[2]})})},t}();var Rn=function(t){ae(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.state={done:4},r}return e.prototype.send=function(r,n){return g(this,void 0,void 0,function(){var i=this;return h(this,function(o){return[2,new Promise(function(s,u){typeof XMLHttpRequest>"u"&&u(new Error("XHRTransport is not supported."));var d=new XMLHttpRequest;d.open("POST",r,!0),d.onreadystatechange=function(){if(d.readyState===i.state.done)try{var p=d.responseText,a=JSON.parse(p),c=i.buildResponse(a);s(c)}catch(l){u(l)}},d.setRequestHeader("Content-Type","application/json"),d.setRequestHeader("Accept","*/*"),d.send(JSON.stringify(n))})]})})},e}(Le);var On=function(t){ae(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.send=function(r,n){return g(this,void 0,void 0,function(){var i=this;return h(this,function(o){return[2,new Promise(function(s,u){var d=$();if(!d?.navigator.sendBeacon)throw new Error("SendBeaconTransport is not supported");try{var p=JSON.stringify(n),a=d.navigator.sendBeacon(r,JSON.stringify(n));return s(a?i.buildResponse({code:200,events_ingested:n.events.length,payload_size_bytes:p.length,server_upload_time:Date.now()}):i.buildResponse({code:500}))}catch(c){u(c)}})]})})},e}(Le);var Ue=function(){var t=new Et,e={deviceManufacturer:!0,deviceModel:!0,ipAddress:!0,language:!0,osName:!0,osVersion:!0,platform:!0};return{cookieExpiration:365,cookieSameSite:"Lax",cookieSecure:!1,cookieStorage:t,cookieUpgrade:!0,disableCookies:!1,domain:"",sessionTimeout:30*60*1e3,trackingOptions:e,transportProvider:new hr}},kn=function(t){ae(e,t);function e(r,n){var i=this,o,s,u,d,p,a,c,l,f,m=Ue();return i=t.call(this,E(E({flushIntervalMillis:1e3,flushMaxRetries:5,flushQueueSize:30,transportProvider:m.transportProvider},n),{apiKey:r}))||this,i._optOut=!1,i.cookieStorage=(o=n?.cookieStorage)!==null&&o!==void 0?o:m.cookieStorage,i.deviceId=n?.deviceId,i.lastEventId=n?.lastEventId,i.lastEventTime=n?.lastEventTime,i.optOut=!!n?.optOut,i.sessionId=n?.sessionId,i.userId=n?.userId,i.appVersion=n?.appVersion,i.attribution=n?.attribution,i.cookieExpiration=(s=n?.cookieExpiration)!==null&&s!==void 0?s:m.cookieExpiration,i.cookieSameSite=(u=n?.cookieSameSite)!==null&&u!==void 0?u:m.cookieSameSite,i.cookieSecure=(d=n?.cookieSecure)!==null&&d!==void 0?d:m.cookieSecure,i.cookieUpgrade=(p=n?.cookieUpgrade)!==null&&p!==void 0?p:m.cookieUpgrade,i.defaultTracking=n?.defaultTracking,i.disableCookies=(a=n?.disableCookies)!==null&&a!==void 0?a:m.disableCookies,i.defaultTracking=n?.defaultTracking,i.domain=(c=n?.domain)!==null&&c!==void 0?c:m.domain,i.partnerId=n?.partnerId,i.sessionTimeout=(l=n?.sessionTimeout)!==null&&l!==void 0?l:m.sessionTimeout,i.trackingOptions=(f=n?.trackingOptions)!==null&&f!==void 0?f:m.trackingOptions,i}return Object.defineProperty(e.prototype,"deviceId",{get:function(){return this._deviceId},set:function(r){this._deviceId!==r&&(this._deviceId=r,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"userId",{get:function(){return this._userId},set:function(r){this._userId!==r&&(this._userId=r,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"sessionId",{get:function(){return this._sessionId},set:function(r){this._sessionId!==r&&(this._sessionId=r,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(r){this._optOut!==r&&(this._optOut=r,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastEventTime",{get:function(){return this._lastEventTime},set:function(r){this._lastEventTime!==r&&(this._lastEventTime=r,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lastEventId",{get:function(){return this._lastEventId},set:function(r){this._lastEventId!==r&&(this._lastEventId=r,this.updateStorage())},enumerable:!1,configurable:!0}),e.prototype.updateStorage=function(){var r,n={deviceId:this._deviceId,userId:this._userId,sessionId:this._sessionId,optOut:this._optOut,lastEventTime:this._lastEventTime,lastEventId:this._lastEventId};(r=this.cookieStorage)===null||r===void 0||r.set(Ye(this.apiKey),n)},e}($t);var An=function(t,e){return g(void 0,void 0,void 0,function(){var r,n,i,o,s,u,d,p,a,c,l,f,m,_,b;return h(this,function(v){switch(v.label){case 0:return r=Ue(),n=(_=e?.deviceId)!==null&&_!==void 0?_:ge(),i=e?.lastEventId,o=e?.lastEventTime,s=e?.optOut,u=e?.sessionId,d=e?.userId,p=e?.cookieStorage,a=e?.domain,c=kn.bind,l=[void 0,t],f=[E({},e)],m={cookieStorage:p,deviceId:n,domain:a,lastEventId:i,lastEventTime:o,optOut:s,sessionId:u},[4,Vi(e)];case 1:return[2,new(c.apply(kn,l.concat([E.apply(void 0,f.concat([(m.storageProvider=v.sent(),m.trackingOptions=E(E({},r.trackingOptions),e?.trackingOptions),m.transportProvider=(b=e?.transportProvider)!==null&&b!==void 0?b:_r(e?.transport),m.userId=d,m)]))])))]}})})},St=function(t,e){return e===void 0&&(e=Ue()),g(void 0,void 0,void 0,function(){var r,n,i;return h(this,function(o){switch(o.label){case 0:return r=E(E({},e),t),n=t?.cookieStorage,i=!n,i?[3,2]:[4,n.isEnabled()];case 1:i=!o.sent(),o.label=2;case 2:return i?[2,Bi(r)]:[2,n]}})})},Bi=function(t){return g(void 0,void 0,void 0,function(){var e,r;return h(this,function(n){switch(n.label){case 0:return e=new ze({domain:t.domain,expirationDays:t.cookieExpiration,sameSite:t.cookieSameSite,secure:t.cookieSecure}),r=t.disableCookies,r?[3,2]:[4,e.isEnabled()];case 1:r=!n.sent(),n.label=2;case 2:return r?(e=new Er,[4,e.isEnabled()]):[3,4];case 3:n.sent()||(e=new Et),n.label=4;case 4:return[2,e]}})})},Vi=function(t){return g(void 0,void 0,void 0,function(){var e,r,n,i,o,s,u,d,p;return h(this,function(a){switch(a.label){case 0:if(e=t&&Object.prototype.hasOwnProperty.call(t,"storageProvider"),r=t&&t.loggerProvider,!(!e||t.storageProvider))return[3,9];a.label=1;case 1:a.trys.push([1,7,8,9]),n=J([t?.storageProvider,new Er({loggerProvider:r})]),i=n.next(),a.label=2;case 2:return i.done?[3,6]:(o=i.value,s=o,s?[4,o.isEnabled()]:[3,4]);case 3:s=a.sent(),a.label=4;case 4:if(s)return[2,o];a.label=5;case 5:return i=n.next(),[3,2];case 6:return[3,9];case 7:return u=a.sent(),d={error:u},[3,9];case 8:try{i&&!i.done&&(p=n.return)&&p.call(n)}finally{if(d)throw d.error}return[7];case 9:return[2,void 0]}})})},_r=function(t){return t===Ie.XHR?new Rn:t===Ie.SendBeacon?new On:Ue().transportProvider},Dn=function(t){return g(void 0,void 0,void 0,function(){var e,r,n,i,o,o,s,u,d,p;return h(this,function(a){switch(a.label){case 0:return[4,new ze().isEnabled()];case 1:if(!a.sent()||!t&&typeof location>"u")return[2,""];for(e=t??location.hostname,r=e.split("."),n=[],i="AMP_TLDTEST",o=r.length-2;o>=0;--o)n.push(r.slice(o).join("."));o=0,a.label=2;case 2:return o<n.length?(s=n[o],u={domain:"."+s},d=new ze(u),[4,d.set(i,1)]):[3,7];case 3:return a.sent(),[4,d.get(i)];case 4:return p=a.sent(),p?[4,d.remove(i)]:[3,6];case 5:return a.sent(),[2,"."+s];case 6:return o++,[3,2];case 7:return[2,""]}})})};var W="[Amplitude]",It="".concat(W," Page Viewed"),Tr="".concat(W," Form Started"),Nn="".concat(W," Form Submitted"),Un="".concat(W," File Downloaded"),wr="session_start",Sr="session_end",Mn="".concat(W," File Extension"),Bn="".concat(W," File Name"),Vn="".concat(W," Link ID"),Fn="".concat(W," Link Text"),Hn="".concat(W," Link URL"),xt="".concat(W," Form ID"),Lt="".concat(W," Form Name"),Pt="".concat(W," Form Destination");var qn=function(t,e){return g(void 0,void 0,void 0,function(){var r,n,i,o,s,u,d,p,a,c,l;return h(this,function(f){switch(f.label){case 0:return[4,St(e)];case 1:return r=f.sent(),n=lr(t),[4,r.getRaw(n)];case 2:return i=f.sent(),i?((l=e.cookieUpgrade)!==null&&l!==void 0?l:Ue().cookieUpgrade)?[4,r.remove(n)]:[3,4]:[2,{optOut:!1}];case 3:f.sent(),f.label=4;case 4:return o=A(i.split("."),6),s=o[0],u=o[1],d=o[2],p=o[3],a=o[4],c=o[5],[2,{deviceId:s,userId:Fi(u),sessionId:Ir(p),lastEventId:Ir(c),lastEventTime:Ir(a),optOut:!!d}]}})})},Ir=function(t){var e=parseInt(t,32);if(!isNaN(e))return e},Fi=function(t){if(!(!atob||!escape||!t))try{return decodeURIComponent(escape(atob(t)))}catch{return}};var Kn=_i(jn());var Gn="1.13.4";var Hi="Web",qi="$remote",Wn=function(){function t(){this.name="context",this.type=N.BEFORE,this.library="amplitude-ts/".concat(Gn),typeof navigator<"u"&&(this.userAgent=navigator.userAgent),this.uaResult=new Kn.default(this.userAgent).getResult()}return t.prototype.setup=function(e){return this.config=e,Promise.resolve(void 0)},t.prototype.execute=function(e){var r,n;return g(this,void 0,void 0,function(){var i,o,s,u,d,p,a,c;return h(this,function(l){return i=new Date().getTime(),o=this.uaResult.browser.name,s=this.uaResult.browser.version,u=this.uaResult.device.model||this.uaResult.os.name,d=this.uaResult.device.vendor,p=(r=this.config.lastEventId)!==null&&r!==void 0?r:-1,a=(n=e.event_id)!==null&&n!==void 0?n:p+1,this.config.lastEventId=a,e.time||(this.config.lastEventTime=i),c=E(E(E(E(E(E(E(E(E(E(E(E({user_id:this.config.userId,device_id:this.config.deviceId,session_id:this.config.sessionId,time:i},this.config.appVersion&&{app_version:this.config.appVersion}),this.config.trackingOptions.platform&&{platform:Hi}),this.config.trackingOptions.osName&&{os_name:o}),this.config.trackingOptions.osVersion&&{os_version:s}),this.config.trackingOptions.deviceManufacturer&&{device_manufacturer:d}),this.config.trackingOptions.deviceModel&&{device_model:u}),this.config.trackingOptions.language&&{language:vr()}),this.config.trackingOptions.ipAddress&&{ip:qi}),{insert_id:ge(),partner_id:this.config.partnerId,plan:this.config.plan}),this.config.ingestionMetadata&&{ingestion_metadata:{source_name:this.config.ingestionMetadata.sourceName,source_version:this.config.ingestionMetadata.sourceVersion}}),e),{event_id:a,library:this.library,user_agent:this.userAgent}),[2,c]})})},t}();var ji={page_domain:"".concat(W," Page Domain"),page_location:"".concat(W," Page Location"),page_path:"".concat(W," Page Path"),page_title:"".concat(W," Page Title"),page_url:"".concat(W," Page URL")},$n=function(){var t="@amplitude/plugin-default-page-view-event-enrichment-browser",e=N.ENRICHMENT,r=function(){return g(void 0,void 0,void 0,function(){return h(this,function(i){return[2,void 0]})})},n=function(i){return g(void 0,void 0,void 0,function(){return h(this,function(o){return i.event_type===It&&i.event_properties&&(i.event_properties=Object.entries(i.event_properties).reduce(function(s,u){var d=A(u,2),p=d[0],a=d[1],c=ji[p];return c?s[c]=a:s[p]=a,s},{})),[2,i]})})};return{name:t,type:e,setup:r,execute:n}};var Yn=function(){var t,e=[],r=function(p,a,c){p.addEventListener(a,c),e.push({element:p,type:a,handler:c})},n=function(){e.forEach(function(p){var a=p.element,c=p.type,l=p.handler;a?.removeEventListener(c,l)}),e=[]},i="@amplitude/plugin-file-download-tracking-browser",o=N.ENRICHMENT,s=function(p,a){return g(void 0,void 0,void 0,function(){var c,l,f;return h(this,function(m){return a?typeof document>"u"?[2]:(c=function(_){var b;try{b=new URL(_.href,window.location.href)}catch{return}var v=l.exec(b.href),y=v?.[1];y&&r(_,"click",function(){var T;y&&a.track(Un,(T={},T[Mn]=y,T[Bn]=b.pathname,T[Vn]=_.id,T[Fn]=_.text,T[Hn]=_.href,T))})},l=/\\.(pdf|xlsx?|docx?|txt|rtf|csv|exe|key|pp(s|t|tx)|7z|pkg|rar|gz|zip|avi|mov|mp4|mpe?g|wmv|midi?|mp3|wav|wma)$/,f=Array.from(document.getElementsByTagName("a")),f.forEach(c),typeof MutationObserver<"u"&&(t=new MutationObserver(function(_){_.forEach(function(b){b.addedNodes.forEach(function(v){v.nodeName==="A"&&c(v),"querySelectorAll"in v&&typeof v.querySelectorAll=="function"&&Array.from(v.querySelectorAll("a")).map(c)})})}),t.observe(document.body,{subtree:!0,childList:!0})),[2]):(p.loggerProvider.warn("File download tracking requires a later version of @amplitude/analytics-browser. File download events are not tracked."),[2])})})},u=function(p){return g(void 0,void 0,void 0,function(){return h(this,function(a){return[2,p]})})},d=function(){return g(void 0,void 0,void 0,function(){return h(this,function(p){return t?.disconnect(),n(),[2]})})};return{name:i,type:o,setup:s,execute:u,teardown:d}};var zn=function(){var t,e=[],r=function(p,a,c){p.addEventListener(a,c),e.push({element:p,type:a,handler:c})},n=function(){e.forEach(function(p){var a=p.element,c=p.type,l=p.handler;a?.removeEventListener(c,l)}),e=[]},i="@amplitude/plugin-form-interaction-tracking-browser",o=N.ENRICHMENT,s=function(p,a){return g(void 0,void 0,void 0,function(){var c,l;return h(this,function(f){return a?typeof document>"u"?[2]:(c=function(m){var _=!1;r(m,"change",function(){var b;_||a.track(Tr,(b={},b[xt]=m.id,b[Lt]=m.name,b[Pt]=m.action,b)),_=!0}),r(m,"submit",function(){var b,v;_||a.track(Tr,(b={},b[xt]=m.id,b[Lt]=m.name,b[Pt]=m.action,b)),a.track(Nn,(v={},v[xt]=m.id,v[Lt]=m.name,v[Pt]=m.action,v)),_=!1})},l=Array.from(document.getElementsByTagName("form")),l.forEach(c),typeof MutationObserver<"u"&&(t=new MutationObserver(function(m){m.forEach(function(_){_.addedNodes.forEach(function(b){b.nodeName==="FORM"&&c(b),"querySelectorAll"in b&&typeof b.querySelectorAll=="function"&&Array.from(b.querySelectorAll("form")).map(c)})})}),t.observe(document.body,{subtree:!0,childList:!0})),[2]):(p.loggerProvider.warn("Form interaction tracking requires a later version of @amplitude/analytics-browser. Form interaction events are not tracked."),[2])})})},u=function(p){return g(void 0,void 0,void 0,function(){return h(this,function(a){return[2,p]})})},d=function(){return g(void 0,void 0,void 0,function(){return h(this,function(p){return t?.disconnect(),n(),[2]})})};return{name:i,type:o,setup:s,execute:u,teardown:d}};var Rt=function(t,e){for(var r=0;r<e.length;r++){var n=e[r],i=n.name,o=n.args,s=n.resolve,u=t&&t[i];if(typeof u=="function"){var d=u.apply(t,o);typeof s=="function"&&s(d?.promise)}}return t},Ot=function(t){var e=t;return e&&e._q!==void 0};var Qn=function(t){ae(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.init=function(r,n,i){return r===void 0&&(r=""),X(this._init(E(E({},i),{userId:n,apiKey:r})))},e.prototype._init=function(r){var n,i,o,s,u,d,p,a,c,l,f,m,_,b,v,y,T,L,k,w;return g(this,void 0,void 0,function(){var C,R,K,z,Q,P,Ce,ce,_e,Me,Re,Oe,Be,Te,we,ke,fe,me,Ve=this;return h(this,function(U){switch(U.label){case 0:return this.initializing?[2]:(this.initializing=!0,C=r,r.disableCookies?(R="",[3,5]):[3,1]);case 1:return(n=r.domain)!==null&&n!==void 0?(K=n,[3,4]):[3,2];case 2:return[4,Dn()];case 3:K=U.sent(),U.label=4;case 4:R=K,U.label=5;case 5:return C.domain=R,[4,qn(r.apiKey,r)];case 6:return z=U.sent(),[4,St(r)];case 7:return Q=U.sent(),[4,Q.get(Ye(r.apiKey))];case 8:return P=U.sent(),Ce=Ne(),ce=(s=(o=(i=r.deviceId)!==null&&i!==void 0?i:Ce.deviceId)!==null&&o!==void 0?o:P?.deviceId)!==null&&s!==void 0?s:z.deviceId,_e=(u=P?.sessionId)!==null&&u!==void 0?u:z.sessionId,Me=(p=(d=r.optOut)!==null&&d!==void 0?d:P?.optOut)!==null&&p!==void 0?p:z.optOut,Re=(a=P?.lastEventId)!==null&&a!==void 0?a:z.lastEventId,Oe=(c=P?.lastEventTime)!==null&&c!==void 0?c:z.lastEventTime,Be=(f=(l=r.userId)!==null&&l!==void 0?l:P?.userId)!==null&&f!==void 0?f:z.userId,this.previousSessionDeviceId=(m=P?.deviceId)!==null&&m!==void 0?m:z.deviceId,this.previousSessionUserId=(_=P?.userId)!==null&&_!==void 0?_:z.userId,[4,An(r.apiKey,E(E({},r),{deviceId:ce,sessionId:_e,optOut:Me,lastEventId:Re,lastEventTime:Oe,userId:Be,cookieStorage:Q}))];case 9:return Te=U.sent(),[4,t.prototype._init.call(this,Te)];case 10:return U.sent(),we=!1,(!this.config.lastEventTime||!this.config.sessionId||this.config.lastEventTime&&Date.now()-this.config.lastEventTime>this.config.sessionTimeout)&&(this.setSessionId((v=(b=r.sessionId)!==null&&b!==void 0?b:this.config.sessionId)!==null&&v!==void 0?v:Date.now()),we=!0),ke=pe(r.instanceName),ke.identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),[4,this.add(new zt).promise];case 11:return U.sent(),[4,this.add(new Wn).promise];case 12:return U.sent(),[4,this.add(new gr).promise];case 13:return U.sent(),dr(this.config.defaultTracking)?[4,this.add(Yn()).promise]:[3,15];case 14:U.sent(),U.label=15;case 15:return pr(this.config.defaultTracking)?[4,this.add(zn()).promise]:[3,17];case 16:U.sent(),U.label=17;case 17:return!((y=this.config.attribution)===null||y===void 0)&&y.disabled?[3,19]:(fe=br({excludeReferrers:(T=this.config.attribution)===null||T===void 0?void 0:T.excludeReferrers,initialEmptyValue:(L=this.config.attribution)===null||L===void 0?void 0:L.initialEmptyValue,resetSessionOnNewCampaign:(k=this.config.attribution)===null||k===void 0?void 0:k.resetSessionOnNewCampaign}),fe.__pluginEnabledOverride=we||!((w=this.config.attribution)===null||w===void 0)&&w.trackNewCampaigns?void 0:!1,[4,this.add(fe).promise]);case 18:U.sent(),U.label=19;case 19:return me=mr(this.config),me.eventType=me.eventType||It,[4,this.add(yr(me)).promise];case 20:return U.sent(),[4,this.add($n()).promise];case 21:return U.sent(),this.initializing=!1,[4,this.runQueuedFunctions("dispatchQ")];case 22:return U.sent(),ke.eventBridge.setEventReceiver(function(et){Ve.track(et.eventType,et.eventProperties)}),[2]}})})},e.prototype.getUserId=function(){var r;return(r=this.config)===null||r===void 0?void 0:r.userId},e.prototype.setUserId=function(r){if(!this.config){this.q.push(this.setUserId.bind(this,r));return}(r!==this.config.userId||r===void 0)&&(this.config.userId=r,Qt(r,this.config.instanceName))},e.prototype.getDeviceId=function(){var r;return(r=this.config)===null||r===void 0?void 0:r.deviceId},e.prototype.setDeviceId=function(r){if(!this.config){this.q.push(this.setDeviceId.bind(this,r));return}this.config.deviceId=r,Xt(r,this.config.instanceName)},e.prototype.setOptOut=function(r){Zt(r,this.config.instanceName),t.prototype.setOptOut.call(this,r)},e.prototype.reset=function(){this.setDeviceId(ge()),this.setUserId(void 0)},e.prototype.getSessionId=function(){var r;return(r=this.config)===null||r===void 0?void 0:r.sessionId},e.prototype.setSessionId=function(r){var n;if(!this.config){this.q.push(this.setSessionId.bind(this,r));return}if(r!==this.config.sessionId){var i=this.getSessionId(),o=this.config.lastEventTime,s=(n=this.config.lastEventId)!==null&&n!==void 0?n:-1;this.config.sessionId=r,this.config.lastEventTime=void 0,fr(this.config.defaultTracking)&&(i&&o&&this.track(Sr,void 0,{device_id:this.previousSessionDeviceId,event_id:++s,session_id:i,time:o+1,user_id:this.previousSessionUserId}),this.config.lastEventTime=this.config.sessionId,this.track(wr,void 0,{event_id:++s,session_id:this.config.sessionId,time:this.config.lastEventTime})),this.previousSessionDeviceId=this.config.deviceId,this.previousSessionUserId=this.config.userId}},e.prototype.extendSession=function(){if(!this.config){this.q.push(this.extendSession.bind(this));return}this.config.lastEventTime=Date.now()},e.prototype.setTransport=function(r){if(!this.config){this.q.push(this.setTransport.bind(this,r));return}this.config.transportProvider=_r(r)},e.prototype.identify=function(r,n){if(Ot(r)){var i=r._q;r._q=[],r=Rt(new ne,i)}return n?.user_id&&this.setUserId(n.user_id),n?.device_id&&this.setDeviceId(n.device_id),t.prototype.identify.call(this,r,n)},e.prototype.groupIdentify=function(r,n,i,o){if(Ot(i)){var s=i._q;i._q=[],i=Rt(new ne,s)}return t.prototype.groupIdentify.call(this,r,n,i,o)},e.prototype.revenue=function(r,n){if(Ot(r)){var i=r._q;r._q=[],r=Rt(new gt,i)}return t.prototype.revenue.call(this,r,n)},e.prototype.process=function(r){return g(this,void 0,void 0,function(){var n,i,o;return h(this,function(s){return n=Date.now(),i=this.config.lastEventTime||Date.now(),o=n-i,r.event_type!==wr&&r.event_type!==Sr&&(!r.session_id||r.session_id===this.getSessionId())&&o>this.config.sessionTimeout&&this.setSessionId(n),[2,t.prototype.process.call(this,r)]})})},e}(Wt);var Gi=function(){var t=new Qn;return{init:H(t.init.bind(t),"init",V(t),F(t,["config"])),add:H(t.add.bind(t),"add",V(t),F(t,["config.apiKey","timeline.plugins"])),remove:H(t.remove.bind(t),"remove",V(t),F(t,["config.apiKey","timeline.plugins"])),track:H(t.track.bind(t),"track",V(t),F(t,["config.apiKey","timeline.queue.length"])),logEvent:H(t.logEvent.bind(t),"logEvent",V(t),F(t,["config.apiKey","timeline.queue.length"])),identify:H(t.identify.bind(t),"identify",V(t),F(t,["config.apiKey","timeline.queue.length"])),groupIdentify:H(t.groupIdentify.bind(t),"groupIdentify",V(t),F(t,["config.apiKey","timeline.queue.length"])),setGroup:H(t.setGroup.bind(t),"setGroup",V(t),F(t,["config.apiKey","timeline.queue.length"])),revenue:H(t.revenue.bind(t),"revenue",V(t),F(t,["config.apiKey","timeline.queue.length"])),flush:H(t.flush.bind(t),"flush",V(t),F(t,["config.apiKey","timeline.queue.length"])),getUserId:H(t.getUserId.bind(t),"getUserId",V(t),F(t,["config","config.userId"])),setUserId:H(t.setUserId.bind(t),"setUserId",V(t),F(t,["config","config.userId"])),getDeviceId:H(t.getDeviceId.bind(t),"getDeviceId",V(t),F(t,["config","config.deviceId"])),setDeviceId:H(t.setDeviceId.bind(t),"setDeviceId",V(t),F(t,["config","config.deviceId"])),reset:H(t.reset.bind(t),"reset",V(t),F(t,["config","config.userId","config.deviceId"])),getSessionId:H(t.getSessionId.bind(t),"getSessionId",V(t),F(t,["config"])),setSessionId:H(t.setSessionId.bind(t),"setSessionId",V(t),F(t,["config"])),extendSession:H(t.extendSession.bind(t),"extendSession",V(t),F(t,["config"])),setOptOut:H(t.setOptOut.bind(t),"setOptOut",V(t),F(t,["config"])),setTransport:H(t.setTransport.bind(t),"setTransport",V(t),F(t,["config"]))}},j=Gi();var cc=j.add,lc=j.extendSession,dc=j.flush,pc=j.getDeviceId,fc=j.getSessionId,mc=j.getUserId,vc=j.groupIdentify,Xn=j.identify,Zn=j.init,gc=j.logEvent,hc=j.remove,yc=j.reset,bc=j.revenue,Ec=j.setDeviceId,_c=j.setGroup,Tc=j.setOptOut,wc=j.setSessionId,Sc=j.setTransport,Ic=j.setUserId,ye=j.track;var te=t=>{window.dispatchEvent(new CustomEvent("builderdevtools",{detail:{eventName:t}}))};async function Ki(){return zr()}var Jn=async()=>{let t=new URL(window.location.href),e=t.hash,r=\`#\${Br}=\`,n=Math.random().toString(36).substring(2,15),i=await Ki();Zn("f1d2eb79aecd01b28c8a371ea5d1751c",i?.userId||n,{logLevel:mt.LogLevel.None,serverUrl:Hr,flushIntervalMillis:500});let o=new ne;Xn(o,{device_id:i?.deviceId,user_id:i?.userId||n});let s="anonymous";e.startsWith(r)&&(s=e.slice(r.length),s&&(Wi(s),t.hash="",window.history.replaceState({},"",t.href))),te("init")};var Wi=t=>{if(typeof t=="string"&&t.length>0){let e=Ze();Xe({...e,builderUserId:t})}},Ze=()=>{let t=localStorage.getItem(ei);if(t)try{let e=JSON.parse(t);return(!e.ctas||typeof e.ctas!="object")&&(e=Xe({...e,ctas:{}})),e.menuOpenedTs&&(e=Xe({...e,ctas:{...e.ctas,menuOpened:e.menuOpenedTs}}),delete e.menuOpenedTs),e}catch(e){console.error(e)}return Xe({firstVisitTs:Date.now(),ctas:{},builderUserId:""})},Xe=t=>{try{localStorage.setItem(ei,JSON.stringify(t))}catch(e){console.error(e)}return t},xr=t=>!!Ze().ctas[t],Lr=t=>{let e=Ze();return Xe({...e,ctas:{...e.ctas,[t]:Date.now()}})},ei="builderDevtools";function ti(t){$i(t),Yi(t),zi(t),Qi(t)}function $i(t){let e=t.getElementById("input-register");e.addEventListener("change",async r=>{r.stopPropagation();let n=t.getElementById("input-name"),i=t.querySelector(".nav-cmp-input");i.classList.add("input-loading"),i.classList.remove("input-enabled");let o=n.dataset.id,s=n.dataset.prop,u=await at({cmpId:o,name:s,registerInput:e.checked});te("registryUpdate"),le(u),Je(t,o,s),be(t,o),i.classList.remove("input-loading")})}function Yi(t){t.getElementById("input-open-source").addEventListener("click",r=>{r.preventDefault(),r.stopPropagation();let n=r.target,i=G.components.find(o=>o.id===n?.dataset.id);i&&De({filePath:i.filePath})})}function zi(t){let e=t.getElementById("input-name"),r=e.closest(".ui-text-input"),n="",i;e.addEventListener("focus",o=>{clearTimeout(i),r.classList.remove("saved"),o.stopPropagation(),n=e.value}),e.addEventListener("blur",async o=>{if(o.stopPropagation(),clearTimeout(i),r.classList.remove("saved"),e.value!==n){if(e.value.trim().length<3){e.value=n;return}r.classList.add("saved"),i=setTimeout(()=>{r.classList.remove("saved")},3e3);let s=e.dataset.id,u=e.dataset.prop,d=await at({cmpId:s,name:u,friendlyName:e.value});te("registryUpdate"),le(d),ue(t),be(t,s),Je(t,s,u)}}),e.addEventListener("keyup",o=>{o.stopPropagation(),clearTimeout(i),r.classList.remove("saved"),o.key==="Escape"?(e.value=n,e.blur()):o.key==="Enter"&&e.blur()})}function Qi(t){let e=t.getElementById("input-type");e.addEventListener("change",async r=>{r.stopPropagation();let n=e.dataset.id,i=e.dataset.prop,o=await at({cmpId:n,name:i,type:e.value});te("registryUpdate"),le(o),ue(t),be(t,n),Je(t,n,i)})}function Je(t,e,r){let n=G.components.find(l=>l.id===e);if(!n)return null;let i=n.inputs.find(l=>l.name===r);if(!i)return null;let o=t.querySelector(".nav-cmp-input");i.isRegistered?o.classList.add("input-enabled"):o.classList.remove("input-enabled");let s=t.getElementById("input-register");s.checked=!!i.isRegistered;let u=t.getElementById("cmp-input-title");u.innerText=n.name+": "+(i.friendlyName||i.name);let d=t.getElementById("input-open-source");d.innerText=\`Open \${n.displayFilePath}\`,d.dataset.id=n.id;let p=t.getElementById("cmp-prop-name");p.innerText=i.name;let a=t.getElementById("cmp-prop-type");a.innerText=ft(i.type);let c=t.getElementById("input-name");return c.dataset.id=n.id,c.dataset.prop=i.name,c.value=i.friendlyName||i.name,Xi(t,n,i),i}function Xi(t,e,r){let n=t.getElementById("input-type");n.dataset.id=e.id,n.dataset.prop=r.name,n.innerHTML="";let i=r.type,o=ut.includes(i),s=ct.includes(i),u=lt.includes(i),d=dt.includes(i),p=pt.includes(i);Qr.forEach(a=>{let c=document.createElement("option");c.value=a.value,c.innerText=a.text,c.disabled=ut.includes(a.value)&&!o||ct.includes(a.value)&&!s||lt.includes(a.value)&&!u||dt.includes(a.value)&&!d||pt.includes(a.value)&&!p,n.appendChild(c)}),n.value=i}function ri(t){Zi(t),Ji(t),eo(t),ro(t),to(t)}function Zi(t){t.getElementById("cmp-register").addEventListener("change",r=>{r.stopPropagation(),kt(t,"update")})}async function kt(t,e){let r=t.querySelector(".nav-cmp-detail"),n=t.getElementById("cmp-error"),i=t.getElementById("cmp-register"),o=i.closest(".ui-switch");r.classList.remove("cmp-enabled"),i.checked&&r.classList.add("cmp-loading");try{let s=i.dataset.id,u;e==="load"?u=await Gr({cmpId:s}):i.checked?(u=await Kr({cmpId:s}),te("registryUpdate"),ye("interaction",{type:"click",name:"register component",detail:s})):(u=await $r({cmpId:s}),te("registryUpdate"),ye("interaction",{type:"click",name:"unregister component",detail:s})),le(u),ue(t);let d=be(t,s);e==="update"&&d&&(i.checked?(r.classList.add("cmp-enabled"),Bt(t,\`<strong>\${d.name}</strong> is now registered in <strong>\${G.registryDisplayPath}</strong> and available for use in the Builder Visual Editor\`)):Bt(t,\`<strong>\${d.name}</strong> has been unregistered from <strong>\${G.registryDisplayPath}</strong> and removed from the Builder Visual Editor\`))}catch(s){console.error(s),n.innerHTML=\`<p class="error">Error loading components</p><p class="error">\${s.message||s}</p>\`,o.style.display="none"}r.classList.remove("cmp-loading")}function Ji(t){let e=t.getElementById("cmp-name"),r=e.closest(".ui-text-input"),n="",i;e.addEventListener("focus",o=>{clearTimeout(i),r.classList.remove("saved"),o.stopPropagation(),n=e.value}),e.addEventListener("blur",async o=>{if(o.stopPropagation(),clearTimeout(i),r.classList.remove("saved"),e.value!==n){if(e.value.trim().length<3){e.value=n;return}r.classList.add("saved"),i=setTimeout(()=>{r.classList.remove("saved")},3e3);let s=e.dataset.id,u=await Wr({cmpId:s,name:e.value});te("registryUpdate"),le(u),ue(t),be(t,s)}}),e.addEventListener("keyup",o=>{o.stopPropagation(),clearTimeout(i),r.classList.remove("saved"),o.key==="Escape"?(e.value=n,e.blur()):o.key==="Enter"&&e.blur()})}function be(t,e){let r=G.components.find(a=>a.id===e);if(!r)return null;let n=t.getElementById("cmp-register"),i=t.getElementById("cmp-error"),o=n.closest(".ui-switch");o.style.display="",i.innerHTML="",n.dataset.id=r.id,n.checked=!!r.isRegistered;let s=t.querySelector(".nav-cmp-detail");r.isRegistered?s.classList.add("cmp-enabled"):s.classList.remove("cmp-enabled");let u=t.getElementById("cmp-name");u.dataset.id=r.id,u.value=r.name;let d=t.getElementById("cmp-open-source");d.innerText=\`Open \${r.displayFilePath}\`,d.dataset.id=r.id;let p=t.getElementById("cmp-detail-title");return p.innerText=\`\${r.name} Component\`,no(t,r),r}function eo(t){t.getElementById("cmp-open-source").addEventListener("click",r=>{r.preventDefault(),r.stopPropagation();let n=r.target,i=G.components.find(o=>o.id===n?.dataset.id);i&&(De({filePath:i.filePath}),ye("interaction",{type:"click",name:"open component source file",detail:i.filePath}))})}function to(t){t.getElementById("btn-inputs-reload").addEventListener("click",r=>{r.preventDefault(),r.stopPropagation(),kt(t,"load")})}function ro(t){t.getElementById("cmp-detail-inputs").addEventListener("click",r=>{r.preventDefault(),r.stopPropagation();let i=r.target?.closest("button"),o=i?.dataset.id,s=i?.dataset.propName;Je(t,o,s)&&oe(t,"nav-cmp-input")})}function no(t,e){let r=t.getElementById("cmp-detail-inputs"),n=e.inputs.filter(i=>!i.hideFromUI);n.length>0?(r.innerHTML="",n.forEach(i=>{r.appendChild(io(e,i))})):r.innerHTML=\`<p class="cmp-inputs-empty">\${e.name} component does not have any props</p>\`}function io(t,e){let r=document.createElement("button");r.dataset.id=t.id,r.dataset.propName=e.name,r.className="cmp-input-item nav-list-item",e.isRegistered||r.classList.add("cmp-input-item-unregistered");let n=document.createElement("span"),i=ft(e.type);n.className=\`nav-list-item-icon input-icon input-icon-\${i}\`,r.appendChild(n);let o=document.createElement("span");o.innerText=e.friendlyName||e.name,r.appendChild(o);let s=document.createElement("span");return s.className="nav-list-item-note",s.innerText=e.type,r.appendChild(s),r}function oi(t){t.getElementById("open-builder-registry").addEventListener("click",o=>{o.preventDefault(),o.stopPropagation(),De({filePath:G.registryPath,line:1,column:1})}),t.getElementById("cmp-list").addEventListener("click",o=>{o.preventDefault(),o.stopPropagation();let u=o.target?.dataset.id,d=G.components.find(p=>p.id===u);if(d){let p=t.querySelector(".nav-cmp-detail .section-content");p.scrollTop=0,be(t,d.id),oe(t,"nav-cmp-detail"),d.isRegistered&&kt(t,"load")}});let n=t.getElementById("component-search"),i=t.getElementById("clear-search");n?.addEventListener("input",o=>{let s=o.target.value.toLowerCase(),u=s?G.components.filter(d=>d.name.toLowerCase().includes(s)||d.displayFilePath?.toLowerCase().includes(s)):G.components;ue(t,u),i.style.display=s?"flex":"none"}),i?.addEventListener("click",()=>{n.value="",ue(t),i.style.display="none"}),n?.addEventListener("keydown",o=>{o.key==="Escape"&&(n.value="",ue(t),i.style.display="none")})}function si(t){let e=jr();oo(t,e)}async function oo(t,e){let r=t.getElementById("cmp-list"),n=t.querySelector(".nav-cmp-list");n.classList.add("nav-loading");let i=t.getElementById("open-builder-registry");try{let o=await e;le(o),ue(t),G.registryDisplayPath?i.innerText="Open "+o.registryDisplayPath:i.innerText=""}catch(o){r.innerHTML=\`<p class="error">Error loading components</p><p class="error">\${o.message||o}</p>\`,console.error(o)}n.classList.remove("nav-loading")}function ue(t,e){let r=t.getElementById("cmp-list");r.innerHTML="";let n=e||G.components,i=n.filter(s=>s.isRegistered),o=n.filter(s=>!s.isRegistered);if(e&&e.length===0){let s=document.createElement("p");s.className="no-results",s.innerText="No matching components found",r.appendChild(s);return}ni(r,"Registered Components",i),ni(r,"Unregistered Components",o)}function ni(t,e,r){if(r.length>0){let n=document.createElement("h4");n.innerText=e,t.appendChild(n),r.forEach(i=>{t.appendChild(so(i))})}}function so(t){let e=document.getElementById("component-search")?.value.toLowerCase(),r=document.createElement("button");r.dataset.id=t.id,r.className="cmp-item nav-list-item",t.isRegistered&&r.classList.add("registered");let n=document.createElement("span");n.className="nav-list-item-icon",t.image&&(n.style.backgroundImage=\`url(\${t.image})\`),r.appendChild(n);let i=document.createElement("span");i.className="nav-list-item-name",i.innerHTML=ii(t.name,e),r.appendChild(i);let o=document.createElement("span");return o.className="nav-list-item-note",o.innerHTML=ii(t.displayFilePath||"",e),r.appendChild(o),r}function ii(t,e){if(!e)return t;let r=new RegExp(\`(\${e})\`,"gi");return t.replace(r,'<span class="search-highlight">$1</span>')}var ai=t=>{t.querySelector(".menu-toggle").addEventListener("click",e=>{e.preventDefault(),e.stopPropagation(),Ee(t,!0)}),t.getElementById("close").addEventListener("click",e=>{e.preventDefault(),e.stopPropagation(),Ee(t,!1)}),t.getElementById("hit").addEventListener("click",e=>{e.preventDefault(),e.stopPropagation(),Ee(t,!1)}),Ar(t),t.addEventListener("click",e=>e.stopPropagation()),ao(t)},Ee=(t,e)=>{e?(document.body.classList.add("builder-no-scroll"),t.host.classList.add("show-builder-menu"),te("menuOpen"),Lr("menuOpened"),ye("interaction",{type:"click",name:"open dev-tools menu"})):(document.body.classList.remove("builder-no-scroll"),t.host.classList.remove("show-builder-menu"),te("menuClose"),setTimeout(()=>{oe(t,"nav-home")},300)),Yr(e)},ao=t=>{if(!xr("menuOpened")){uo(t);return}let e=Ze();if(!((Date.now()-e.firstVisitTs)/1e3/60<10)&&!xr("feedback")){Lr("feedback"),co(t);return}},uo=t=>{let e=document.createElement("a");e.classList.add("menu-toggle-tooltip"),e.href="#open-dev-tools",e.innerHTML=\`
|
|
36
36
|
<div class="menu-toggle-tooltip-content">
|
|
37
37
|
<h3>Open Builder Devtools</h3>
|
|
@@ -42,7 +42,7 @@ Restarting server after Builder Devtools update...
|
|
|
42
42
|
<h3>How's Devtools working for you?</h3>
|
|
43
43
|
<p>We'd love your feedback!</p>
|
|
44
44
|
</div>
|
|
45
|
-
\`,t.appendChild(e),setTimeout(()=>{e.classList.add("menu-toggle-tooltip-show"),e.addEventListener("click",()=>{e.classList.remove("menu-toggle-tooltip-show")})},1e3)};function ui(t){t.getElementById("go-to-builder").addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),Ee(t,!1),window.open(Nr(),"builder")}),t.getElementById("components-link").addEventListener("click",s=>{s.preventDefault(),s.stopPropagation();let u=t.querySelector(".nav-cmp-list .section-content");u.scrollTop=0,oe(t,"nav-cmp-list"),si(t)}),t.getElementById("settings-link").addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),oe(t,"nav-settings")}),t.getElementById("add-page-link").addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),Ee(t,!1),window.open(je(),"builder")}),t.getElementById("import-from-figma").addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),Ee(t,!1),window.open("https://www.figma.com/community/plugin/747985167520967365/builder-io-ai-powered-figma-to-code-react-vue-tailwind-more")})}function ci(t){let e=t.getElementById("enable-edit");e.addEventListener("change",r=>{r.stopPropagation(),Ft(e.checked)}),e.checked=it(),Ft(e.checked)}var At=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>\`,ai(e),ui(e),oi(e),ri(e),ti(e),ci(e),this.setAttribute("aria-hidden","true"),e.getElementById("version").textContent="v1.11.39"}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 lo=\`<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)}
|
|
45
|
+
\`,t.appendChild(e),setTimeout(()=>{e.classList.add("menu-toggle-tooltip-show"),e.addEventListener("click",()=>{e.classList.remove("menu-toggle-tooltip-show")})},1e3)};function ui(t){t.getElementById("go-to-builder").addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),Ee(t,!1),window.open(Nr(),"builder")}),t.getElementById("components-link").addEventListener("click",s=>{s.preventDefault(),s.stopPropagation();let u=t.querySelector(".nav-cmp-list .section-content");u.scrollTop=0,oe(t,"nav-cmp-list"),si(t)}),t.getElementById("settings-link").addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),oe(t,"nav-settings")}),t.getElementById("add-page-link").addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),Ee(t,!1),window.open(je(),"builder")}),t.getElementById("import-from-figma").addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),Ee(t,!1),window.open("https://www.figma.com/community/plugin/747985167520967365/builder-io-ai-powered-figma-to-code-react-vue-tailwind-more")})}function ci(t){let e=t.getElementById("enable-edit");e.addEventListener("change",r=>{r.stopPropagation(),Ft(e.checked)}),e.checked=it(),Ft(e.checked)}var At=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>\`,ai(e),ui(e),oi(e),ri(e),ti(e),ci(e),this.setAttribute("aria-hidden","true"),e.getElementById("version").textContent="v1.11.41"}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 lo=\`<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)}
|
|
46
46
|
</style>\`,Dt=class extends HTMLElement{constructor(){super()}connectedCallback(){let e=this.attachShadow({mode:"open"});e.innerHTML=lo+\`<main>
|
|
47
47
|
<aside>
|
|
48
48
|
<div class="logo"></div>
|
|
@@ -81,7 +81,7 @@ Restarting server after Builder Devtools update...
|
|
|
81
81
|
</nav>
|
|
82
82
|
</section>
|
|
83
83
|
</main>
|
|
84
|
-
\`,po();let r=new URL(Vr,ot);r.searchParams.set(Mr,location.href);let n=e.querySelectorAll(".next-step");for(let i of n)i.setAttribute("href",r.href);ye("overview step viewed")}},po=()=>{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 li=async()=>{(await qr()).isValid||fo()},fo=()=>{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 mo=()=>{try{customElements.get("builder-dev-tools-edit")||customElements.define("builder-dev-tools-edit",st),customElements.get("builder-dev-tools-menu")||customElements.define("builder-dev-tools-menu",At);let t=document.querySelector("builder-dev-tools-menu");t||(t=document.createElement("builder-dev-tools-menu"),t.setAttribute("data-version","1.11.
|
|
84
|
+
\`,po();let r=new URL(Vr,ot);r.searchParams.set(Mr,location.href);let n=e.querySelectorAll(".next-step");for(let i of n)i.setAttribute("href",r.href);ye("overview step viewed")}},po=()=>{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 li=async()=>{(await qr()).isValid||fo()},fo=()=>{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 mo=()=>{try{customElements.get("builder-dev-tools-edit")||customElements.define("builder-dev-tools-edit",st),customElements.get("builder-dev-tools-menu")||customElements.define("builder-dev-tools-menu",At);let t=document.querySelector("builder-dev-tools-menu");t||(t=document.createElement("builder-dev-tools-menu"),t.setAttribute("data-version","1.11.41"),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 r=document.getElementById("builder-dev-tools-style");r||(r=document.createElement("style"),r.id="builder-dev-tools-style",r.innerHTML=".builder-no-scroll{overflow:hidden !important}",document.head.appendChild(r)),li(),Jn()}catch(t){console.error("Builder Devtools:",t)}};window.location===window.parent.location&&(console.debug("Builder.io Devtools v1.11.41"),mo());})();`)}async function Ia(e){return ka(e,`<!doctype html>
|
|
85
85
|
<html lang="en" dir="ltr">
|
|
86
86
|
<head>
|
|
87
87
|
<meta charset="utf-8" />
|
|
@@ -247,41 +247,41 @@ Restarting server after Builder Devtools update...
|
|
|
247
247
|
</script>
|
|
248
248
|
</body>
|
|
249
249
|
</html>
|
|
250
|
-
`)}async function Ja(e,t){let r=await Aa(e),n=e.getFrameworks();return t.replace(/__LOCAL_APP_ID__/g,r).replace(/__DEV_TOOLS_URL__/g,e.devToolsServerUrl).replace(/__CLIENT_ID__/g,e.getClientId()).replace(/__FRAMEWORK__/g,n.length?n[0].name:"")}import{platform as ym}from"os";async function Ya(e,t){let r=new URL("/cli-auth","https://builder.io");r.searchParams.set("client_id",e.getClientId()),r.searchParams.set("host",await e.getDeviceId()),r.searchParams.set("response_type","code"),r.searchParams.set("cli","true");let n=new URL(Xt,e.devToolsServerUrl);n.searchParams.set(Gn,ym()),n.searchParams.set(Wn,process.versions.node);let i=e.getFrameworks();return i.length>0&&(r.searchParams.set(yr,i[0].name),n.searchParams.set(yr,i[0].name)),r.searchParams.set("redirect_url",n.href),r.searchParams.set("preview_url",t),r.href}import{createServer as Hb}from"http";import{platform as Vb}from"os";import{dirname as _f,join as Ht}from"path";import{existsSync as ya,mkdirSync as $f,readFileSync as Of,writeFileSync as ei}from"fs";var Qe=De(Qn(),1);import{stdin as Fm,stdout as Am}from"process";import eu from"readline";import{Writable as Pm}from"stream";function Tm({onlyFirst:e=!1}={}){let t=["[\\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(t,e?void 0:"g")}var Rm=Tm();function cu(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(Rm,"")}function lu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var pu={exports:{}};(function(e){var t={};e.exports=t,t.eastAsianWidth=function(n){var i=n.charCodeAt(0),s=n.length==2?n.charCodeAt(1):0,o=i;return 55296<=i&&i<=56319&&56320<=s&&s<=57343&&(i&=1023,s&=1023,o=i<<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"},t.characterLength=function(n){var i=this.eastAsianWidth(n);return i=="F"||i=="W"||i=="A"?2:1};function r(n){return n.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}t.length=function(n){for(var i=r(n),s=0,o=0;o<i.length;o++)s=s+this.characterLength(i[o]);return s},t.slice=function(n,i,s){textLen=t.length(n),i=i||0,s=s||1,i<0&&(i=textLen+i),s<0&&(s=textLen+s);for(var o="",a=0,u=r(n),c=0;c<u.length;c++){var l=u[c],p=t.length(l);if(a>=i-(p==2?1:0))if(a+p<=s)o+=l;else break;a+=p}return o}})(pu);var Im=pu.exports,km=lu(Im),Bm=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},_m=lu(Bm);function rn(e,t={}){if(typeof e!="string"||e.length===0||(t={ambiguousIsNarrow:!0,...t},e=cu(e),e.length===0))return 0;e=e.replace(_m()," ");let r=t.ambiguousIsNarrow?1:2,n=0;for(let i of e){let s=i.codePointAt(0);if(!(s<=31||s>=127&&s<=159||s>=768&&s<=879))switch(km.eastAsianWidth(i)){case"F":case"W":n+=2;break;case"A":n+=r;break;default:n+=1}}return n}var mi=10,tu=(e=0)=>t=>`\x1B[${t+e}m`,ru=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,nu=(e=0)=>(t,r,n)=>`\x1B[${38+e};2;${t};${r};${n}m`,ae={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(ae.modifier);var $m=Object.keys(ae.color),Nm=Object.keys(ae.bgColor);[...$m,...Nm];function Om(){let e=new Map;for(let[t,r]of Object.entries(ae)){for(let[n,i]of Object.entries(r))ae[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},r[n]=ae[n],e.set(i[0],i[1]);Object.defineProperty(ae,t,{value:r,enumerable:!1})}return Object.defineProperty(ae,"codes",{value:e,enumerable:!1}),ae.color.close="\x1B[39m",ae.bgColor.close="\x1B[49m",ae.color.ansi=tu(),ae.color.ansi256=ru(),ae.color.ansi16m=nu(),ae.bgColor.ansi=tu(mi),ae.bgColor.ansi256=ru(mi),ae.bgColor.ansi16m=nu(mi),Object.defineProperties(ae,{rgbToAnsi256:{value:(t,r,n)=>t===r&&r===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:t=>{let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(s=>s+s).join(""));let i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:t=>ae.rgbToAnsi256(...ae.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value:t=>{if(t<8)return 30+t;if(t<16)return 90+(t-8);let r,n,i;if(t>=232)r=((t-232)*10+8)/255,n=r,i=r;else{t-=16;let a=t%36;r=Math.floor(t/36)/5,n=Math.floor(a/6)/5,i=a%6/5}let s=Math.max(r,n,i)*2;if(s===0)return 30;let o=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(r));return s===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(t,r,n)=>ae.ansi256ToAnsi(ae.rgbToAnsi256(t,r,n)),enumerable:!1},hexToAnsi:{value:t=>ae.ansi256ToAnsi(ae.hexToAnsi256(t)),enumerable:!1}}),ae}var Lm=Om(),no=new Set(["\x1B","\x9B"]),Mm=39,Di="\x07",du="[",jm="]",fu="m",Ci=`${jm}8;;`,ou=e=>`${no.values().next().value}${du}${e}${fu}`,iu=e=>`${no.values().next().value}${Ci}${e}${Di}`,Um=e=>e.split(" ").map(t=>rn(t)),gi=(e,t,r)=>{let n=[...t],i=!1,s=!1,o=rn(cu(e[e.length-1]));for(let[a,u]of n.entries()){let c=rn(u);if(o+c<=r?e[e.length-1]+=u:(e.push(u),o=0),no.has(u)&&(i=!0,s=n.slice(a+1).join("").startsWith(Ci)),i){s?u===Di&&(i=!1,s=!1):u===fu&&(i=!1);continue}o+=c,o===r&&a<n.length-1&&(e.push(""),o=0)}!o&&e[e.length-1].length>0&&e.length>1&&(e[e.length-2]+=e.pop())},Hm=e=>{let t=e.split(" "),r=t.length;for(;r>0&&!(rn(t[r-1])>0);)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")},Vm=(e,t,r={})=>{if(r.trim!==!1&&e.trim()==="")return"";let n="",i,s,o=Um(e),a=[""];for(let[c,l]of e.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let p=rn(a[a.length-1]);if(c!==0&&(p>=t&&(r.wordWrap===!1||r.trim===!1)&&(a.push(""),p=0),(p>0||r.trim===!1)&&(a[a.length-1]+=" ",p++)),r.hard&&o[c]>t){let d=t-p,g=1+Math.floor((o[c]-d-1)/t);Math.floor((o[c]-1)/t)<g&&a.push(""),gi(a,l,t);continue}if(p+o[c]>t&&p>0&&o[c]>0){if(r.wordWrap===!1&&p<t){gi(a,l,t);continue}a.push("")}if(p+o[c]>t&&r.wordWrap===!1){gi(a,l,t);continue}a[a.length-1]+=l}r.trim!==!1&&(a=a.map(c=>Hm(c)));let u=[...a.join(`
|
|
251
|
-
`)];for(let[c,l]of u.entries()){if(n+=l,
|
|
252
|
-
`?(s&&(n+=
|
|
253
|
-
`&&(i&&p&&(n+=
|
|
250
|
+
`)}async function ka(e,t){let r=await la(e),n=e.getFrameworks();return t.replace(/__LOCAL_APP_ID__/g,r).replace(/__DEV_TOOLS_URL__/g,e.devToolsServerUrl).replace(/__CLIENT_ID__/g,e.getClientId()).replace(/__FRAMEWORK__/g,n.length?n[0].name:"")}import{platform as Ef}from"os";async function Ba(e,t){let r=new URL("/cli-auth","https://builder.io");r.searchParams.set("client_id",e.getClientId()),r.searchParams.set("host",await e.getDeviceId()),r.searchParams.set("response_type","code"),r.searchParams.set("cli","true");let n=new URL(er,e.devToolsServerUrl);n.searchParams.set(Ln,Ef()),n.searchParams.set(Mn,process.versions.node);let i=e.getFrameworks();return i.length>0&&(r.searchParams.set(xr,i[0].name),n.searchParams.set(xr,i[0].name)),r.searchParams.set("redirect_url",n.href),r.searchParams.set("preview_url",t),r.href}import{createServer as D0}from"http";import{platform as C0}from"os";import{dirname as Od,join as Kt}from"path";import{existsSync as ra,mkdirSync as Ld,readFileSync as jd,writeFileSync as Mo}from"fs";var Ze=we(Kn(),1);import{stdin as Rf,stdout as If}from"process";import Oa from"readline";import{Writable as kf}from"stream";function Bf({onlyFirst:e=!1}={}){let t=["[\\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(t,e?void 0:"g")}var $f=Bf();function Wa(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace($f,"")}function za(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var qa={exports:{}};(function(e){var t={};e.exports=t,t.eastAsianWidth=function(n){var i=n.charCodeAt(0),s=n.length==2?n.charCodeAt(1):0,o=i;return 55296<=i&&i<=56319&&56320<=s&&s<=57343&&(i&=1023,s&=1023,o=i<<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"},t.characterLength=function(n){var i=this.eastAsianWidth(n);return i=="F"||i=="W"||i=="A"?2:1};function r(n){return n.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}t.length=function(n){for(var i=r(n),s=0,o=0;o<i.length;o++)s=s+this.characterLength(i[o]);return s},t.slice=function(n,i,s){textLen=t.length(n),i=i||0,s=s||1,i<0&&(i=textLen+i),s<0&&(s=textLen+s);for(var o="",a=0,u=r(n),c=0;c<u.length;c++){var l=u[c],p=t.length(l);if(a>=i-(p==2?1:0))if(a+p<=s)o+=l;else break;a+=p}return o}})(qa);var _f=qa.exports,Nf=za(_f),Of=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},Lf=za(Of);function Xr(e,t={}){if(typeof e!="string"||e.length===0||(t={ambiguousIsNarrow:!0,...t},e=Wa(e),e.length===0))return 0;e=e.replace(Lf()," ");let r=t.ambiguousIsNarrow?1:2,n=0;for(let i of e){let s=i.codePointAt(0);if(!(s<=31||s>=127&&s<=159||s>=768&&s<=879))switch(Nf.eastAsianWidth(i)){case"F":case"W":n+=2;break;case"A":n+=r;break;default:n+=1}}return n}var Zo=10,La=(e=0)=>t=>`\x1B[${t+e}m`,Ma=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,ja=(e=0)=>(t,r,n)=>`\x1B[${38+e};2;${t};${r};${n}m`,ae={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(ae.modifier);var Mf=Object.keys(ae.color),jf=Object.keys(ae.bgColor);[...Mf,...jf];function Uf(){let e=new Map;for(let[t,r]of Object.entries(ae)){for(let[n,i]of Object.entries(r))ae[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},r[n]=ae[n],e.set(i[0],i[1]);Object.defineProperty(ae,t,{value:r,enumerable:!1})}return Object.defineProperty(ae,"codes",{value:e,enumerable:!1}),ae.color.close="\x1B[39m",ae.bgColor.close="\x1B[49m",ae.color.ansi=La(),ae.color.ansi256=Ma(),ae.color.ansi16m=ja(),ae.bgColor.ansi=La(Zo),ae.bgColor.ansi256=Ma(Zo),ae.bgColor.ansi16m=ja(Zo),Object.defineProperties(ae,{rgbToAnsi256:{value:(t,r,n)=>t===r&&r===n?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:t=>{let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(s=>s+s).join(""));let i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:t=>ae.rgbToAnsi256(...ae.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value:t=>{if(t<8)return 30+t;if(t<16)return 90+(t-8);let r,n,i;if(t>=232)r=((t-232)*10+8)/255,n=r,i=r;else{t-=16;let a=t%36;r=Math.floor(t/36)/5,n=Math.floor(a/6)/5,i=a%6/5}let s=Math.max(r,n,i)*2;if(s===0)return 30;let o=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(r));return s===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(t,r,n)=>ae.ansi256ToAnsi(ae.rgbToAnsi256(t,r,n)),enumerable:!1},hexToAnsi:{value:t=>ae.ansi256ToAnsi(ae.hexToAnsi256(t)),enumerable:!1}}),ae}var Vf=Uf(),Yn=new Set(["\x1B","\x9B"]),Hf=39,ri="\x07",Ja="[",Kf="]",Ya="m",ni=`${Kf}8;;`,Ua=e=>`${Yn.values().next().value}${Ja}${e}${Ya}`,Va=e=>`${Yn.values().next().value}${ni}${e}${ri}`,Gf=e=>e.split(" ").map(t=>Xr(t)),ei=(e,t,r)=>{let n=[...t],i=!1,s=!1,o=Xr(Wa(e[e.length-1]));for(let[a,u]of n.entries()){let c=Xr(u);if(o+c<=r?e[e.length-1]+=u:(e.push(u),o=0),Yn.has(u)&&(i=!0,s=n.slice(a+1).join("").startsWith(ni)),i){s?u===ri&&(i=!1,s=!1):u===Ya&&(i=!1);continue}o+=c,o===r&&a<n.length-1&&(e.push(""),o=0)}!o&&e[e.length-1].length>0&&e.length>1&&(e[e.length-2]+=e.pop())},Wf=e=>{let t=e.split(" "),r=t.length;for(;r>0&&!(Xr(t[r-1])>0);)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")},zf=(e,t,r={})=>{if(r.trim!==!1&&e.trim()==="")return"";let n="",i,s,o=Gf(e),a=[""];for(let[c,l]of e.split(" ").entries()){r.trim!==!1&&(a[a.length-1]=a[a.length-1].trimStart());let p=Xr(a[a.length-1]);if(c!==0&&(p>=t&&(r.wordWrap===!1||r.trim===!1)&&(a.push(""),p=0),(p>0||r.trim===!1)&&(a[a.length-1]+=" ",p++)),r.hard&&o[c]>t){let d=t-p,D=1+Math.floor((o[c]-d-1)/t);Math.floor((o[c]-1)/t)<D&&a.push(""),ei(a,l,t);continue}if(p+o[c]>t&&p>0&&o[c]>0){if(r.wordWrap===!1&&p<t){ei(a,l,t);continue}a.push("")}if(p+o[c]>t&&r.wordWrap===!1){ei(a,l,t);continue}a[a.length-1]+=l}r.trim!==!1&&(a=a.map(c=>Wf(c)));let u=[...a.join(`
|
|
251
|
+
`)];for(let[c,l]of u.entries()){if(n+=l,Yn.has(l)){let{groups:d}=new RegExp(`(?:\\${Ja}(?<code>\\d+)m|\\${ni}(?<uri>.*)${ri})`).exec(u.slice(c).join(""))||{groups:{}};if(d.code!==void 0){let D=Number.parseFloat(d.code);i=D===Hf?void 0:D}else d.uri!==void 0&&(s=d.uri.length===0?void 0:d.uri)}let p=Vf.codes.get(Number(i));u[c+1]===`
|
|
252
|
+
`?(s&&(n+=Va("")),i&&p&&(n+=Ua(p))):l===`
|
|
253
|
+
`&&(i&&p&&(n+=Ua(i)),s&&(n+=Va(s)))}return n};function Ha(e,t,r){return String(e).normalize().replace(/\r\n/g,`
|
|
254
254
|
`).split(`
|
|
255
|
-
`).map(n=>
|
|
256
|
-
`)}var
|
|
255
|
+
`).map(n=>zf(n,t,r)).join(`
|
|
256
|
+
`)}var qf=["up","down","left","right","space","enter","cancel"],qn={actions:new Set(qf),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]])};function Qa(e,t){if(typeof e=="string")return qn.aliases.get(e)===t;for(let r of e)if(r!==void 0&&Qa(r,t))return!0;return!1}function Jf(e,t){if(e===t)return;let r=e.split(`
|
|
257
257
|
`),n=t.split(`
|
|
258
|
-
`),i=[];for(let s=0;s<Math.max(r.length,n.length);s++)r[s]!==n[s]&&i.push(s);return i}var
|
|
259
|
-
`),
|
|
260
|
-
`).length-1;this.output.write(
|
|
261
|
-
`);this.output.write(i[n]),this._prevFrame=t,this.output.write(
|
|
258
|
+
`),i=[];for(let s=0;s<Math.max(r.length,n.length);s++)r[s]!==n[s]&&i.push(s);return i}var Hb=globalThis.process.platform.startsWith("win"),Ka=Symbol("clack:cancel");function zn(e,t){let r=e;r.isTTY&&r.setRawMode(t)}var Yf=Object.defineProperty,Qf=(e,t,r)=>t in e?Yf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ge=(e,t,r)=>(Qf(e,typeof t!="symbol"?t+"":t,r),r),ti=class{constructor(t,r=!0){Ge(this,"input"),Ge(this,"output"),Ge(this,"_abortSignal"),Ge(this,"rl"),Ge(this,"opts"),Ge(this,"_render"),Ge(this,"_track",!1),Ge(this,"_prevFrame",""),Ge(this,"_subscribers",new Map),Ge(this,"_cursor",0),Ge(this,"state","initial"),Ge(this,"error",""),Ge(this,"value");let{input:n=Rf,output:i=If,render:s,signal:o,...a}=t;this.opts=a,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=s.bind(this),this._track=r,this._abortSignal=o,this.input=n,this.output=i}unsubscribe(){this._subscribers.clear()}setSubscriber(t,r){let n=this._subscribers.get(t)??[];n.push(r),this._subscribers.set(t,n)}on(t,r){this.setSubscriber(t,{cb:r})}once(t,r){this.setSubscriber(t,{cb:r,once:!0})}emit(t,...r){let n=this._subscribers.get(t)??[],i=[];for(let s of n)s.cb(...r),s.once&&i.push(()=>n.splice(n.indexOf(s),1));for(let s of i)s()}prompt(){return new Promise((t,r)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),t(Ka);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let n=new kf;n._write=(i,s,o)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),o()},this.input.pipe(n),this.rl=Oa.createInterface({input:this.input,output:n,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),Oa.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),zn(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(Ze.cursor.show),this.output.off("resize",this.render),zn(this.input,!1),t(this.value)}),this.once("cancel",()=>{this.output.write(Ze.cursor.show),this.output.off("resize",this.render),zn(this.input,!1),t(Ka)})})}onKeypress(t,r){if(this.state==="error"&&(this.state="active"),r?.name&&(!this._track&&qn.aliases.has(r.name)&&this.emit("cursor",qn.aliases.get(r.name)),qn.actions.has(r.name)&&this.emit("cursor",r.name)),t&&(t.toLowerCase()==="y"||t.toLowerCase()==="n")&&this.emit("confirm",t.toLowerCase()==="y"),t===" "&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),t&&this.emit("key",t.toLowerCase()),r?.name==="return"){if(!this.value&&this.opts.placeholder&&(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder)),this.opts.validate){let n=this.opts.validate(this.value);n&&(this.error=n instanceof Error?n.message:n,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}Qa([t,r?.name,r?.sequence],"cancel")&&(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(`
|
|
259
|
+
`),zn(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let t=Ha(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
|
|
260
|
+
`).length-1;this.output.write(Ze.cursor.move(-999,t*-1))}render(){let t=Ha(this._render(this)??"",process.stdout.columns,{hard:!0});if(t!==this._prevFrame){if(this.state==="initial")this.output.write(Ze.cursor.hide);else{let r=Jf(this._prevFrame,t);if(this.restoreCursor(),r&&r?.length===1){let n=r[0];this.output.write(Ze.cursor.move(0,n)),this.output.write(Ze.erase.lines(1));let i=t.split(`
|
|
261
|
+
`);this.output.write(i[n]),this._prevFrame=t,this.output.write(Ze.cursor.move(0,i.length-n-1));return}if(r&&r?.length>1){let n=r[0];this.output.write(Ze.cursor.move(0,n)),this.output.write(Ze.erase.down());let i=t.split(`
|
|
262
262
|
`).slice(n);this.output.write(i.join(`
|
|
263
|
-
`)),this._prevFrame=t;return}this.output.write(
|
|
264
|
-
${
|
|
265
|
-
`;switch(this.state){case"submit":return`${r}${
|
|
266
|
-
${
|
|
267
|
-
${
|
|
268
|
-
${
|
|
269
|
-
`}}}).prompt()};var
|
|
270
|
-
`)},
|
|
271
|
-
${
|
|
272
|
-
|
|
273
|
-
`)},
|
|
274
|
-
`);r.push(`${t} ${n}`,...i.map(s=>`${
|
|
263
|
+
`)),this._prevFrame=t;return}this.output.write(Ze.erase.down())}this.output.write(t),this.state==="initial"&&(this.state="active"),this._prevFrame=t}}};var Xf;Xf=new WeakMap;var Zf=Object.defineProperty,em=(e,t,r)=>t in e?Zf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ga=(e,t,r)=>(em(e,typeof t!="symbol"?t+"":t,r),r),Jn=class extends ti{constructor(t){super(t,!1),Ga(this,"options"),Ga(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 J=we(nr(),1),Xa=we(Kn(),1);import lt from"process";function tm(){return lt.platform!=="win32"?lt.env.TERM!=="linux":!!lt.env.CI||!!lt.env.WT_SESSION||!!lt.env.TERMINUS_SUBLIME||lt.env.ConEmuTask==="{cmd::Cmder}"||lt.env.TERM_PROGRAM==="Terminus-Sublime"||lt.env.TERM_PROGRAM==="vscode"||lt.env.TERM==="xterm-256color"||lt.env.TERM==="alacritty"||lt.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var rm=tm(),pe=(e,t)=>rm?e:t,nm=pe("\u25C6","*"),om=pe("\u25A0","x"),im=pe("\u25B2","x"),Za=pe("\u25C7","o"),sm=pe("\u250C","T"),pt=pe("\u2502","|"),eu=pe("\u2514","\u2014"),am=pe("\u25CF",">"),um=pe("\u25CB"," "),tw=pe("\u25FB","[\u2022]"),rw=pe("\u25FC","[+]"),nw=pe("\u25FB","[ ]"),ow=pe("\u25AA","\u2022"),iw=pe("\u2500","-"),sw=pe("\u256E","+"),aw=pe("\u251C","+"),uw=pe("\u256F","+"),cm=pe("\u25CF","\u2022"),lm=pe("\u25C6","*"),pm=pe("\u25B2","!"),dm=pe("\u25A0","x"),fm=e=>{switch(e){case"initial":case"active":return J.default.cyan(nm);case"cancel":return J.default.red(om);case"error":return J.default.yellow(im);case"submit":return J.default.green(Za)}},mm=e=>{let{cursor:t,options:r,style:n}=e,i=e.maxItems??Number.POSITIVE_INFINITY,s=Math.max(process.stdout.rows-4,0),o=Math.min(s,Math.max(i,5)),a=0;t>=a+o-3?a=Math.max(Math.min(t-o+3,r.length-o),0):t<a+2&&(a=Math.max(t-2,0));let u=o<r.length&&a>0,c=o<r.length&&a+o<r.length;return r.slice(a,a+o).map((l,p,d)=>{let D=p===0&&u,m=p===d.length-1&&c;return D||m?J.default.dim("..."):n(l,p+a===t)})};var Zr=e=>{let t=(r,n)=>{let i=r.label??String(r.value);switch(n){case"selected":return`${J.default.dim(i)}`;case"active":return`${J.default.green(am)} ${i} ${r.hint?J.default.dim(`(${r.hint})`):""}`;case"cancelled":return`${J.default.strikethrough(J.default.dim(i))}`;default:return`${J.default.dim(um)} ${J.default.dim(i)}`}};return new Jn({options:e.options,initialValue:e.initialValue,render(){let r=`${J.default.gray(pt)}
|
|
264
|
+
${fm(this.state)} ${e.message}
|
|
265
|
+
`;switch(this.state){case"submit":return`${r}${J.default.gray(pt)} ${t(this.options[this.cursor],"selected")}`;case"cancel":return`${r}${J.default.gray(pt)} ${t(this.options[this.cursor],"cancelled")}
|
|
266
|
+
${J.default.gray(pt)}`;default:return`${r}${J.default.cyan(pt)} ${mm({cursor:this.cursor,options:this.options,maxItems:e.maxItems,style:(n,i)=>t(n,i?"active":"inactive")}).join(`
|
|
267
|
+
${J.default.cyan(pt)} `)}
|
|
268
|
+
${J.default.cyan(eu)}
|
|
269
|
+
`}}}).prompt()};var _t=(e="")=>{process.stdout.write(`${J.default.gray(sm)} ${e}
|
|
270
|
+
`)},en=(e="")=>{process.stdout.write(`${J.default.gray(pt)}
|
|
271
|
+
${J.default.gray(eu)} ${e}
|
|
272
|
+
|
|
273
|
+
`)},Q={message:(e="",{symbol:t=J.default.gray(pt)}={})=>{let r=[`${J.default.gray(pt)}`];if(e){let[n,...i]=e.split(`
|
|
274
|
+
`);r.push(`${t} ${n}`,...i.map(s=>`${J.default.gray(pt)} ${s}`))}process.stdout.write(`${r.join(`
|
|
275
275
|
`)}
|
|
276
|
-
`)},info:e=>{
|
|
277
|
-
`),n;for(;(n=
|
|
278
|
-
`),s=s.replace(/\\r/g,"\r")),t[i]=s}return t}var
|
|
276
|
+
`)},info:e=>{Q.message(e,{symbol:J.default.blue(cm)})},success:e=>{Q.message(e,{symbol:J.default.green(lm)})},step:e=>{Q.message(e,{symbol:J.default.green(Za)})},warn:e=>{Q.message(e,{symbol:J.default.yellow(pm)})},warning:e=>{Q.warn(e)},error:e=>{Q.message(e,{symbol:J.default.red(dm)})}},cw=`${J.default.gray(pt)} `;var Xt=we(nr(),1);import j from"typescript";async function et(e){let t=tu(e),r=await e.readFile(t);return typeof r=="string"?JSON.parse(r):{}}async function tt(e,t){t=typeof t=="object"&&t!=null?t:{};let r=tu(e);await e.writeFile(r,JSON.stringify(t??{},null,2))}function tu(e){let t=e.getAppRootDir();return e.join(t,"node_modules",".builder","builder-cache.json")}async function Dt(e,t,r){let n={envKey:r,envValue:null,file:""};for(let i of t){let s=e.join(e.getAppRootDir(),i),o=await gm(e,s);if(o){let a=o[r];if(typeof a=="string"&&a.length>0&&a!=="YOUR_API_KEY")return n.envValue=a,n.file=s,n}}return n.file=e.join(e.getAppRootDir(),t[t.length-1]),n}async function gm(e,t){let r=await e.readFile(t);return typeof r=="string"?ru(r):null}function ru(e){let t={},r=e.replace(/\r\n?/gm,`
|
|
277
|
+
`),n;for(;(n=hm.exec(r))!=null;){let i=n[1],s=n[2]||"";s=s.trim();let o=s[0];s=s.replace(/^(['"`])([\s\S]*)\1$/gm,"$2"),o==='"'&&(s=s.replace(/\\n/g,`
|
|
278
|
+
`),s=s.replace(/\\r/g,"\r")),t[i]=s}return t}var hm=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm;async function Ct(e,t,r,n){let i="# https://www.builder.io/c/docs/using-your-api-key",s=await e.readFile(t);try{if(s)if(s.includes(r))if(s.includes(n))e.debug(`"${r}" with "${n}" already set in ${t}`);else return e.debug(`Replace "${r}" in ${t}`),s=s.replace(new RegExp(`${r}=.*`),`${r}=${n}`),await e.writeFile(t,s),"update";else return e.debug(`Append "${r}" to ${t}`),s+=`
|
|
279
279
|
|
|
280
280
|
${i}
|
|
281
281
|
${r}=${n}
|
|
282
282
|
|
|
283
283
|
`,await e.writeFile(t,s),"update";else return e.debug(`Creating new .env file with "${r}" at ${t}`),s=[i,`${r}=${n}`,""].join(`
|
|
284
|
-
`),await e.writeFile(t,s),"create"}catch(o){if(o&&String(o).includes("EACCES"))return e.debug(`Permssion denied, failed to create or modify .env file with "${r}=${n}" at ${t}`),"permission-error";e.Sentry?.captureException(o)}return null}async function sn(e){return await mt(e,[".env.local",".env.development.local",".env.production.local",".env.development",".env.production",".env"],ht)}async function xu(e,t){let r=await sn(e),n=await gt(e,r.file,r.envKey,t);return{...r,modifiedType:n}}var ht="NEXT_PUBLIC_BUILDER_API_KEY";function Ar(e,t,r,n,i=!0){let s=t.properties.filter(a=>e.ts.isPropertyAssignment(a)),o=fg(e,t,r);return o>-1?n==null&&i?e.ts.factory.updateObjectLiteralExpression(t,s.filter((a,u)=>u!==o)):(s[o]=e.ts.factory.updatePropertyAssignment(s[o],s[o].name,an(e,n)),e.ts.factory.updateObjectLiteralExpression(t,s)):(n!=null&&s.push(e.ts.factory.createPropertyAssignment(r,an(e,n))),e.ts.factory.updateObjectLiteralExpression(t,s))}function fg(e,t,r){return t.properties.findIndex(n=>Z(e,n)===r)}function un(e,t){switch(t.kind){case e.ts.SyntaxKind.ArrayLiteralExpression:return gg(e,t);case e.ts.SyntaxKind.ObjectLiteralExpression:return mg(e,t);case e.ts.SyntaxKind.StringLiteral:return t.text;case e.ts.SyntaxKind.NumericLiteral:return Number(t.text);case e.ts.SyntaxKind.NoSubstitutionTemplateLiteral:return t.text;case e.ts.SyntaxKind.TrueKeyword:return!0;case e.ts.SyntaxKind.FalseKeyword:return!1;case e.ts.SyntaxKind.Identifier:switch(t.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 mg(e,t){let r={};if(t&&e.ts.isObjectLiteralExpression(t)){for(let n of t.properties)if(e.ts.isPropertyAssignment(n)){let i=Z(e,n);i&&(r[i]=un(e,n.initializer))}}return r}function gg(e,t){return t&&e.ts.isArrayLiteralExpression(t)?t.elements.map(r=>un(e,r)):[]}function Z(e,t){if(t&&e.ts.isPropertyAssignment(t)){let r=t.name;switch(r.kind){case e.ts.SyntaxKind.Identifier:return r.text;case e.ts.SyntaxKind.StringLiteral:case e.ts.SyntaxKind.NumericLiteral:return r.text;case e.ts.SyntaxKind.ComputedPropertyName:let n=r.expression;if(e.ts.isStringLiteral(n)||e.ts.isNumericLiteral(n))return r.expression.text}}}function an(e,t){return yi(e,t,new WeakSet)}function yi(e,t,r){return t===void 0?e.ts.factory.createIdentifier("undefined"):t===null?e.ts.factory.createIdentifier("null"):typeof t=="string"?e.ts.factory.createStringLiteral(t):typeof t=="number"?isNaN(t)?e.ts.factory.createIdentifier("NaN"):e.ts.factory.createNumericLiteral(t):t===!0?e.ts.factory.createTrue():t===!1?e.ts.factory.createFalse():t===String?e.ts.factory.createIdentifier("String"):t===Number?e.ts.factory.createIdentifier("Number"):t===Boolean?e.ts.factory.createIdentifier("Boolean"):Array.isArray(t)?hg(e,t,r):typeof t=="object"?Dg(e,t,r):e.ts.factory.createIdentifier(t)}function hg(e,t,r){let n=t.map(i=>yi(e,i,r));return e.ts.factory.createArrayLiteralExpression(n,!0)}function Dg(e,t,r){if(r.has(t))return e.ts.factory.createIdentifier("undefined");r.add(t);let n=Object.keys(t).map(i=>e.ts.factory.createPropertyAssignment(i,yi(e,t[i],r)));return e.ts.factory.createObjectLiteralExpression(n,!0)}function nr(e,t,r){let n=[];if(!r)return n;let i=null;if(e.ts.isArrowFunction(r)||e.ts.isFunctionExpression(r)||e.ts.isFunctionDeclaration(r)){let s=r.parameters;if(s.length>0){let o=s[0],a=t.getTypeAtLocation(o);a.aliasTypeArguments&&a.aliasTypeArguments.length>0&&(a=a.aliasTypeArguments[0]),!!(a.flags&e.ts.TypeFlags.Object)&&(i=a.getProperties())}}else if(e.ts.isIdentifier(r)){let s=t.getTypeAtLocation(r),o=s.symbol?.valueDeclaration;if(o&&e.ts.isClassDeclaration(o)){let u=o.heritageClauses?.find(c=>c.token===e.ts.SyntaxKind.ExtendsKeyword)?.types;if(u){for(let c of u)if(t.getSymbolAtLocation(c.expression)?.name==="Component"){if(e.ts.isExpressionWithTypeArguments(c)){let p=c.typeArguments;if(p){let d=p[0];i=t.getTypeFromTypeNode(d).getProperties()}}break}}}if(!i){let a=s.getCallSignatures();if(a.length>0){let u=a[0].getParameters();u.length>0&&(i=t.getTypeOfSymbolAtLocation(u[0],r).getProperties())}}}else if(e.ts.isExportSpecifier(r)){let s=t.getSymbolAtLocation(r.name);if(s){let a=t.getTypeOfSymbolAtLocation(s,r).getCallSignatures();if(a.length>0){let u=a[0].getParameters();u.length>0&&(i=t.getTypeOfSymbolAtLocation(u[0],r).getProperties())}}}if(i)for(let s of i){let o=Cg(e,t,s);o&&n.push(o)}return n=n.filter(wu),n.length>0?n:yg(e,r)}function Cg(e,t,r){let n=r.valueDeclaration,i=r.getName();if(n||(n=r.getDeclarations()?.[0]),n&&e.ts.isPropertySignature(n)){if(i!=="children"&&n.getSourceFile().fileName.includes("node_modules/@types/"))return null;let s="string",o;if(n?.type){let u=t.getTypeFromTypeNode(n.type),c=t.typeToString(u),l=xi(c);l.knownType?s=l.builderType:bg(c)||u.flags&e.ts.TypeFlags.StringLike?s="string":u.flags&e.ts.TypeFlags.NumberLike?s="number":u.flags&e.ts.TypeFlags.IndexedAccess?s="list":u.flags&e.ts.TypeFlags.Object||u.isUnion()&&u.types.every(p=>p.flags&e.ts.TypeFlags.Object)||u.isIntersection()&&u.types.some(p=>p.flags&e.ts.TypeFlags.Object)?s="object":s="string",c!==s&&(o=c)}let a={name:i,type:s,isRegistered:!1};if(o&&n.type){let u=Sg(e,t,t.getTypeFromTypeNode(n.type));a.meta=a.meta||{},u&&u.length>0&&a.type==="string"&&u.every(vg)?a.enum=u.map(Eg):a.meta.ts=o}return n.questionToken||(a.required=!0),a}return null}function yg(e,t){let r=[],n=e.ts.getJSDocCommentsAndTags(t);for(let i of n)if(!(!e.ts.isJSDoc(i)||!i.tags))for(let s of i.tags){if(!e.ts.isJSDocParameterTag(s)||s.tagName.text!=="param")continue;let a=s.typeExpression?.type;if(!a||!e.ts.isJSDocTypeLiteral(a))continue;let u=a.jsDocPropertyTags;if(u)for(let c of u){if(!e.ts.isJSDocPropertyLikeTag(c))continue;let l=c.name;if(!e.ts.isQualifiedName(l))continue;let p=c.typeExpression;if(!p)continue;let d="";switch(p.type.kind){case e.ts.SyntaxKind.StringKeyword:{d="string";break}case e.ts.SyntaxKind.NumberKeyword:{d="number";break}case e.ts.SyntaxKind.BooleanKeyword:{d="boolean";break}default:continue}let m={name:l.right.text,type:d,isRegistered:!1};r.push(m)}}return r.filter(wu)}var xg=["ClassicComponent","FunctionComponent","IntrinsicElements","JSX","ReactNode","ReactElement","ReactPortal"];function bg(e){return typeof e!="string"?!1:!!xg.some(t=>e.includes(t))}function xi(e){return typeof e=="string"&&(e=e.trim(),wg.some(t=>t.value===e))?{builderType:e,knownType:!0}:{builderType:"string",knownType:!1}}var wg=[{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 vg(e){return/^['"].*['"]$/.test(e)}function Eg(e){return(e.startsWith('"')||e.startsWith("'"))&&(e.endsWith('"')||e.endsWith("'"))?e.slice(1,-1):e}var Sg=(e,t,r)=>{let n=new Set;bu(e,t,r,n);let i=n.delete("true"),s=n.delete("false");(i||s)&&n.add("boolean");let o=Array.from(n.keys()).sort();if(o.length>1&&(o=o.map(a=>a.indexOf("=>")>=0?`(${a})`:a)),!(o.length>20))return o},Fg=(e,t,r)=>{let n=e.ts.TypeFormatFlags.InElementType|e.ts.TypeFormatFlags.NoTruncation;return t.typeToString(r,void 0,n)},bu=(e,t,r,n)=>{if(r.isUnion())r.types.forEach(i=>{bu(e,t,i,n)});else if(r.isLiteral()){let i=Fg(e,t,r);n.add(i)}};function wu(e){let t=e?.name;if(typeof t!="string"||t===""||t.startsWith("aria")||t.startsWith("data-"))return!1;if(t.startsWith("on")&&t.length>2){let r=t.charAt(2);if(r.toUpperCase()===r)return!1}return!Ag.has(t.toLowerCase())}var Ag=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(e=>e.toLowerCase()));function Ne(e,t,r){for(let n of r.properties){if(!e.ts.isPropertyAssignment(n))continue;let i=Z(e,n);if(i==="name"&&e.ts.isStringLiteral(n.initializer)){t.name=n.initializer.text;continue}if(i==="description"&&e.ts.isStringLiteral(n.initializer)){t.description=n.initializer.text;continue}if(i==="image"&&e.ts.isStringLiteral(n.initializer)){t.image=n.initializer.text;continue}if(i==="inputs"&&e.ts.isArrayLiteralExpression(n.initializer)){let s=Pg(e,n.initializer);Ge(t,s);continue}if(i==="meta"&&e.ts.isObjectLiteralExpression(n.initializer)){let s=un(e,n.initializer);s&&typeof s=="object"&&(t.meta=s);continue}}return t}function Pg(e,t){let r=[];for(let n of t.elements)e.ts.isObjectLiteralExpression(n)&&r.push(Tg(e,n));return r}function Tg(e,t){let r=un(e,t),n=Ng(r);return n.isRegistered=!0,n}function he(e,t,r){let n=Ig(r);return t=Ar(e,t,"name",n.name,!1),t=Ar(e,t,"description",n.description),t=Ar(e,t,"image",n.image),t=Ar(e,t,"meta",n.meta),t=Rg(e,t,n),Og(e,t)}function Rg(e,t,r){let n=null,i=t.properties.filter(a=>e.ts.isPropertyAssignment(a)&&e.ts.isIdentifier(a.name)),s=i.findIndex(a=>e.ts.isIdentifier(a.name)&&a.name.text==="inputs"),o=[...r.inputs??[]];if(s>-1){if(o.length===0)return Ar(e,t,"inputs",null);let a=i[s];e.ts.isPropertyAssignment(a)&&e.ts.isArrayLiteralExpression(a.initializer)&&(n=a.initializer)}return o.length===0?t:(n=Bg(e,n||e.ts.factory.createArrayLiteralExpression(),o),s>-1?i[s]=e.ts.factory.updatePropertyAssignment(i[s],i[s].name,n):i.push(e.ts.factory.createPropertyAssignment("inputs",n)),e.ts.factory.updateObjectLiteralExpression(t,i))}function Ig(e){return{name:e.name,description:e.description,image:e.image,inputs:(e.inputs||[]).filter(r=>r.isRegistered).map(kg),...e.meta?{meta:{...e.meta}}:{}}}function kg(e){let t={name:e.name,type:e.type};return(Te(e.defaultValue)||Xr(e.defaultValue)||xr(e.defaultValue))&&(t.defaultValue=e.defaultValue),Te(e.friendlyName)&&(t.friendlyName=e.friendlyName),Te(e.helperText)&&(t.helperText=e.helperText),e.required===!0&&(t.required=!0),Array.isArray(e.enum)&&(t.enum=e.enum),e.hideFromUI===!0&&(t.hideFromUI=!0),typeof e.meta=="object"&&e.meta!=null&&Object.keys(e.meta).length>0&&(t.meta=e.meta),t}function Bg(e,t,r){let n=t.elements.filter(i=>{if(!e.ts.isObjectLiteralExpression(i))return!1;let s=i.properties.find(a=>Z(e,a)==="name");if(!s)return!1;let o=s.initializer;return e.ts.isStringLiteral(o)?r.some(a=>a.name===o.text):!1});for(let i of r)n=_g(e,n,i);return n.sort((i,s)=>{let o=i.properties.find(d=>Z(e,d)==="name"),a=s.properties.find(d=>Z(e,d)==="name"),u=o?.initializer,c=a?.initializer,l=u&&e.ts.isStringLiteral(u)?u.text:"zz",p=c&&e.ts.isStringLiteral(c)?c.text:"zz";return l.toLowerCase().localeCompare(p.toLowerCase())}),e.ts.factory.updateArrayLiteralExpression(t,n)}function _g(e,t,r){let n=t.findIndex(i=>i.properties.some(s=>{let o=Z(e,s);return e.ts.isPropertyAssignment(s)&&o==="name"&&e.ts.isStringLiteral(s.initializer)&&s.initializer.text===r.name}));if(n>-1)t[n]=vu(e,t[n],r);else{let i=vu(e,e.ts.factory.createObjectLiteralExpression([e.ts.factory.createPropertyAssignment("name",e.ts.factory.createStringLiteral(r.name))],!0),r);t.push(i)}return t}function vu(e,t,r){let n=t.properties.filter(s=>e.ts.isPropertyAssignment(s)),i=Object.keys(r).filter(s=>s!=="isRegistered");for(let s of i)n=$g(e,n,r,s);return n=Lg(e,n.filter(s=>{let o=Z(e,s);return i.includes(o)})),e.ts.factory.updateObjectLiteralExpression(t,n)}function $g(e,t,r,n){let i=t.findIndex(s=>e.ts.isIdentifier(s.name)&&s.name.text===n);return i>-1?t[i]=e.ts.factory.updatePropertyAssignment(t[i],t[i].name,an(e,r[n])):t.push(e.ts.factory.createPropertyAssignment(n,an(e,r[n]))),t}function Ge(e,t){for(let r of t){let n=e.inputs.findIndex(i=>i.name===r.name);n>-1?(r.isRegistered||!e.inputs[n].isRegistered)&&(e.inputs[n]=r):e.inputs.push(r)}e.acceptsChildren=bi(e)}function Ng(e){let t=xi(e.type),r={name:e.name.trim(),type:t.builderType};return Te(e.friendlyName)&&e.friendlyName.trim()!==e.name.trim()&&(r.friendlyName=e.friendlyName),(Te(e.defaultValue)||Xr(e.defaultValue)||xr(e.defaultValue))&&(r.defaultValue=e.defaultValue),Te(e.helperText)&&(r.helperText=e.helperText),xr(e.required)&&(r.required=e.required),typeof e.meta=="object"&&e.meta!=null&&Object.keys(e.meta).length>0&&(r.meta=e.meta),Array.isArray(e.enum)&&e.enum.length>0&&(r.enum=e.enum),e.hideFromUI===!0&&(r.hideFromUI=!0),wi(r)}function bi(e){let t=e.inputs.some(n=>n.name==="children"),r=e.inputs.some(n=>n.meta?.ts==="ReactNode");return!!(t||r||e.acceptsChildren===!0)}function wi(e){if(e.name==="children"&&(e.hideFromUI=!0,delete e.required),e.type==="object"&&e.defaultValue==null&&(e.hideFromUI=!0),e.type==="list"&&e.defaultValue==null&&(e.hideFromUI=!0),e.meta){let t=e.meta.ts;typeof t=="string"&&(t=t.trim(),t.endsWith("ReactNode")&&(t="ReactNode"),e.meta.ts=t,t==="ReactNode"&&(e.hideFromUI=!0))}return e}function Og(e,t){let r=[...t.properties].sort((n,i)=>{let s=Z(e,n)||"zz",o=Z(e,i)||"zz";if(s==="inputs")return 1;let a=Eu.indexOf(s),u=Eu.indexOf(o);return a>-1?u>-1&&a>u?1:-1:u>-1?a>-1&&u<a?-1:1:s.localeCompare(o)});return e.ts.factory.updateObjectLiteralExpression(t,r)}var Eu=["component","name","description"];function Lg(e,t){return[...t].sort((n,i)=>{let s=Z(e,n)||"zz",o=Z(e,i)||"zz",a=Su.indexOf(s),u=Su.indexOf(o);return a>-1?u>-1&&a>u?1:-1:u>-1?a>-1&&u<a?-1:1:s.localeCompare(o)})}var Su=["name","type"];function Pr(e,t){for(let r of t.properties){if(!e.ts.isPropertyAssignment(r)||!e.ts.isIdentifier(r.name))continue;if(Z(e,r)==="canHaveChildren"){let{initializer:i}=r;return i.kind===e.ts.SyntaxKind.TrueKeyword}}return!1}function Fu(e,t){let r=`Builder.registerComponent(
|
|
284
|
+
`),await e.writeFile(t,s),"create"}catch(o){if(o&&String(o).includes("EACCES"))return e.debug(`Permssion denied, failed to create or modify .env file with "${r}=${n}" at ${t}`),"permission-error";e.Sentry?.captureException(o)}return null}async function tn(e){return await Dt(e,[".env.local",".env.development.local",".env.production.local",".env.development",".env.production",".env"],yt)}async function nu(e,t){let r=await tn(e),n=await Ct(e,r.file,r.envKey,t);return{...r,modifiedType:n}}var yt="NEXT_PUBLIC_BUILDER_API_KEY";function Pr(e,t,r,n,i=!0){let s=t.properties.filter(a=>e.ts.isPropertyAssignment(a)),o=Dm(e,t,r);return o>-1?n==null&&i?e.ts.factory.updateObjectLiteralExpression(t,s.filter((a,u)=>u!==o)):(s[o]=e.ts.factory.updatePropertyAssignment(s[o],s[o].name,rn(e,n)),e.ts.factory.updateObjectLiteralExpression(t,s)):(n!=null&&s.push(e.ts.factory.createPropertyAssignment(r,rn(e,n))),e.ts.factory.updateObjectLiteralExpression(t,s))}function Dm(e,t,r){return t.properties.findIndex(n=>X(e,n)===r)}function nn(e,t){switch(t.kind){case e.ts.SyntaxKind.ArrayLiteralExpression:return ym(e,t);case e.ts.SyntaxKind.ObjectLiteralExpression:return Cm(e,t);case e.ts.SyntaxKind.StringLiteral:return t.text;case e.ts.SyntaxKind.NumericLiteral:return Number(t.text);case e.ts.SyntaxKind.NoSubstitutionTemplateLiteral:return t.text;case e.ts.SyntaxKind.TrueKeyword:return!0;case e.ts.SyntaxKind.FalseKeyword:return!1;case e.ts.SyntaxKind.Identifier:switch(t.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 Cm(e,t){let r={};if(t&&e.ts.isObjectLiteralExpression(t)){for(let n of t.properties)if(e.ts.isPropertyAssignment(n)){let i=X(e,n);i&&(r[i]=nn(e,n.initializer))}}return r}function ym(e,t){return t&&e.ts.isArrayLiteralExpression(t)?t.elements.map(r=>nn(e,r)):[]}function X(e,t){if(t&&e.ts.isPropertyAssignment(t)){let r=t.name;switch(r.kind){case e.ts.SyntaxKind.Identifier:return r.text;case e.ts.SyntaxKind.StringLiteral:case e.ts.SyntaxKind.NumericLiteral:return r.text;case e.ts.SyntaxKind.ComputedPropertyName:let n=r.expression;if(e.ts.isStringLiteral(n)||e.ts.isNumericLiteral(n))return r.expression.text}}}function rn(e,t){return oi(e,t,new WeakSet)}function oi(e,t,r){return t===void 0?e.ts.factory.createIdentifier("undefined"):t===null?e.ts.factory.createIdentifier("null"):typeof t=="string"?e.ts.factory.createStringLiteral(t):typeof t=="number"?isNaN(t)?e.ts.factory.createIdentifier("NaN"):e.ts.factory.createNumericLiteral(t):t===!0?e.ts.factory.createTrue():t===!1?e.ts.factory.createFalse():t===String?e.ts.factory.createIdentifier("String"):t===Number?e.ts.factory.createIdentifier("Number"):t===Boolean?e.ts.factory.createIdentifier("Boolean"):Array.isArray(t)?xm(e,t,r):typeof t=="object"?bm(e,t,r):e.ts.factory.createIdentifier(t)}function xm(e,t,r){let n=t.map(i=>oi(e,i,r));return e.ts.factory.createArrayLiteralExpression(n,!0)}function bm(e,t,r){if(r.has(t))return e.ts.factory.createIdentifier("undefined");r.add(t);let n=Object.keys(t).map(i=>e.ts.factory.createPropertyAssignment(i,oi(e,t[i],r)));return e.ts.factory.createObjectLiteralExpression(n,!0)}function ir(e,t,r){let n=[];if(!r)return n;let i=null;if(e.ts.isArrowFunction(r)||e.ts.isFunctionExpression(r)||e.ts.isFunctionDeclaration(r)){let s=r.parameters;if(s.length>0){let o=s[0],a=t.getTypeAtLocation(o);a.aliasTypeArguments&&a.aliasTypeArguments.length>0&&(a=a.aliasTypeArguments[0]),!!(a.flags&e.ts.TypeFlags.Object)&&(i=a.getProperties())}}else if(e.ts.isIdentifier(r)){let s=t.getTypeAtLocation(r),o=s.symbol?.valueDeclaration;if(o&&e.ts.isClassDeclaration(o)){let u=o.heritageClauses?.find(c=>c.token===e.ts.SyntaxKind.ExtendsKeyword)?.types;if(u){for(let c of u)if(t.getSymbolAtLocation(c.expression)?.name==="Component"){if(e.ts.isExpressionWithTypeArguments(c)){let p=c.typeArguments;if(p){let d=p[0];i=t.getTypeFromTypeNode(d).getProperties()}}break}}}if(!i){let a=s.getCallSignatures();if(a.length>0){let u=a[0].getParameters();u.length>0&&(i=t.getTypeOfSymbolAtLocation(u[0],r).getProperties())}}}else if(e.ts.isExportSpecifier(r)){let s=t.getSymbolAtLocation(r.name);if(s){let a=t.getTypeOfSymbolAtLocation(s,r).getCallSignatures();if(a.length>0){let u=a[0].getParameters();u.length>0&&(i=t.getTypeOfSymbolAtLocation(u[0],r).getProperties())}}}if(i)for(let s of i){let o=wm(e,t,s);o&&n.push(o)}return n=n.filter(iu),n.length>0?n:Em(e,r)}function wm(e,t,r){let n=r.valueDeclaration,i=r.getName();if(n||(n=r.getDeclarations()?.[0]),n&&e.ts.isPropertySignature(n)){if(i!=="children"&&n.getSourceFile().fileName.includes("node_modules/@types/"))return null;let s="string",o;if(n?.type){let u=t.getTypeFromTypeNode(n.type),c=t.typeToString(u),l=ii(c);l.knownType?s=l.builderType:Sm(c)||u.flags&e.ts.TypeFlags.StringLike?s="string":u.flags&e.ts.TypeFlags.NumberLike?s="number":u.flags&e.ts.TypeFlags.IndexedAccess?s="list":u.flags&e.ts.TypeFlags.Object||u.isUnion()&&u.types.every(p=>p.flags&e.ts.TypeFlags.Object)||u.isIntersection()&&u.types.some(p=>p.flags&e.ts.TypeFlags.Object)?s="object":s="string",c!==s&&(o=c)}let a={name:i,type:s,isRegistered:!1};if(o&&n.type){let u=Tm(e,t,t.getTypeFromTypeNode(n.type));a.meta=a.meta||{},u&&u.length>0&&a.type==="string"&&u.every(Am)?a.enum=u.map(Pm):a.meta.ts=o}return n.questionToken||(a.required=!0),a}return null}function Em(e,t){let r=[],n=e.ts.getJSDocCommentsAndTags(t);for(let i of n)if(!(!e.ts.isJSDoc(i)||!i.tags))for(let s of i.tags){if(!e.ts.isJSDocParameterTag(s)||s.tagName.text!=="param")continue;let a=s.typeExpression?.type;if(!a||!e.ts.isJSDocTypeLiteral(a))continue;let u=a.jsDocPropertyTags;if(u)for(let c of u){if(!e.ts.isJSDocPropertyLikeTag(c))continue;let l=c.name;if(!e.ts.isQualifiedName(l))continue;let p=c.typeExpression;if(!p)continue;let d="";switch(p.type.kind){case e.ts.SyntaxKind.StringKeyword:{d="string";break}case e.ts.SyntaxKind.NumberKeyword:{d="number";break}case e.ts.SyntaxKind.BooleanKeyword:{d="boolean";break}default:continue}let m={name:l.right.text,type:d,isRegistered:!1};r.push(m)}}return r.filter(iu)}var vm=["ClassicComponent","FunctionComponent","IntrinsicElements","JSX","ReactNode","ReactElement","ReactPortal"];function Sm(e){return typeof e!="string"?!1:!!vm.some(t=>e.includes(t))}function ii(e){return typeof e=="string"&&(e=e.trim(),Fm.some(t=>t.value===e))?{builderType:e,knownType:!0}:{builderType:"string",knownType:!1}}var Fm=[{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 Am(e){return/^['"].*['"]$/.test(e)}function Pm(e){return(e.startsWith('"')||e.startsWith("'"))&&(e.endsWith('"')||e.endsWith("'"))?e.slice(1,-1):e}var Tm=(e,t,r)=>{let n=new Set;ou(e,t,r,n);let i=n.delete("true"),s=n.delete("false");(i||s)&&n.add("boolean");let o=Array.from(n.keys()).sort();if(o.length>1&&(o=o.map(a=>a.indexOf("=>")>=0?`(${a})`:a)),!(o.length>20))return o},Rm=(e,t,r)=>{let n=e.ts.TypeFormatFlags.InElementType|e.ts.TypeFormatFlags.NoTruncation;return t.typeToString(r,void 0,n)},ou=(e,t,r,n)=>{if(r.isUnion())r.types.forEach(i=>{ou(e,t,i,n)});else if(r.isLiteral()){let i=Rm(e,t,r);n.add(i)}};function iu(e){let t=e?.name;if(typeof t!="string"||t===""||t.startsWith("aria")||t.startsWith("data-"))return!1;if(t.startsWith("on")&&t.length>2){let r=t.charAt(2);if(r.toUpperCase()===r)return!1}return!Im.has(t.toLowerCase())}var Im=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(e=>e.toLowerCase()));function Oe(e,t,r){for(let n of r.properties){if(!e.ts.isPropertyAssignment(n))continue;let i=X(e,n);if(i==="name"&&e.ts.isStringLiteral(n.initializer)){t.name=n.initializer.text;continue}if(i==="description"&&e.ts.isStringLiteral(n.initializer)){t.description=n.initializer.text;continue}if(i==="image"&&e.ts.isStringLiteral(n.initializer)){t.image=n.initializer.text;continue}if(i==="inputs"&&e.ts.isArrayLiteralExpression(n.initializer)){let s=km(e,n.initializer);We(t,s);continue}if(i==="meta"&&e.ts.isObjectLiteralExpression(n.initializer)){let s=nn(e,n.initializer);s&&typeof s=="object"&&(t.meta=s);continue}}return t}function km(e,t){let r=[];for(let n of t.elements)e.ts.isObjectLiteralExpression(n)&&r.push(Bm(e,n));return r}function Bm(e,t){let r=nn(e,t),n=jm(r);return n.isRegistered=!0,n}function he(e,t,r){let n=_m(r);return t=Pr(e,t,"name",n.name,!1),t=Pr(e,t,"description",n.description),t=Pr(e,t,"image",n.image),t=Pr(e,t,"meta",n.meta),t=$m(e,t,n),Um(e,t)}function $m(e,t,r){let n=null,i=t.properties.filter(a=>e.ts.isPropertyAssignment(a)&&e.ts.isIdentifier(a.name)),s=i.findIndex(a=>e.ts.isIdentifier(a.name)&&a.name.text==="inputs"),o=[...r.inputs??[]];if(s>-1){if(o.length===0)return Pr(e,t,"inputs",null);let a=i[s];e.ts.isPropertyAssignment(a)&&e.ts.isArrayLiteralExpression(a.initializer)&&(n=a.initializer)}return o.length===0?t:(n=Om(e,n||e.ts.factory.createArrayLiteralExpression(),o),s>-1?i[s]=e.ts.factory.updatePropertyAssignment(i[s],i[s].name,n):i.push(e.ts.factory.createPropertyAssignment("inputs",n)),e.ts.factory.updateObjectLiteralExpression(t,i))}function _m(e){return{name:e.name,description:e.description,image:e.image,inputs:(e.inputs||[]).filter(r=>r.isRegistered).map(Nm),...e.meta?{meta:{...e.meta}}:{}}}function Nm(e){let t={name:e.name,type:e.type};return(Re(e.defaultValue)||qr(e.defaultValue)||br(e.defaultValue))&&(t.defaultValue=e.defaultValue),Re(e.friendlyName)&&(t.friendlyName=e.friendlyName),Re(e.helperText)&&(t.helperText=e.helperText),e.required===!0&&(t.required=!0),Array.isArray(e.enum)&&(t.enum=e.enum),e.hideFromUI===!0&&(t.hideFromUI=!0),typeof e.meta=="object"&&e.meta!=null&&Object.keys(e.meta).length>0&&(t.meta=e.meta),t}function Om(e,t,r){let n=t.elements.filter(i=>{if(!e.ts.isObjectLiteralExpression(i))return!1;let s=i.properties.find(a=>X(e,a)==="name");if(!s)return!1;let o=s.initializer;return e.ts.isStringLiteral(o)?r.some(a=>a.name===o.text):!1});for(let i of r)n=Lm(e,n,i);return n.sort((i,s)=>{let o=i.properties.find(d=>X(e,d)==="name"),a=s.properties.find(d=>X(e,d)==="name"),u=o?.initializer,c=a?.initializer,l=u&&e.ts.isStringLiteral(u)?u.text:"zz",p=c&&e.ts.isStringLiteral(c)?c.text:"zz";return l.toLowerCase().localeCompare(p.toLowerCase())}),e.ts.factory.updateArrayLiteralExpression(t,n)}function Lm(e,t,r){let n=t.findIndex(i=>i.properties.some(s=>{let o=X(e,s);return e.ts.isPropertyAssignment(s)&&o==="name"&&e.ts.isStringLiteral(s.initializer)&&s.initializer.text===r.name}));if(n>-1)t[n]=su(e,t[n],r);else{let i=su(e,e.ts.factory.createObjectLiteralExpression([e.ts.factory.createPropertyAssignment("name",e.ts.factory.createStringLiteral(r.name))],!0),r);t.push(i)}return t}function su(e,t,r){let n=t.properties.filter(s=>e.ts.isPropertyAssignment(s)),i=Object.keys(r).filter(s=>s!=="isRegistered");for(let s of i)n=Mm(e,n,r,s);return n=Vm(e,n.filter(s=>{let o=X(e,s);return i.includes(o)})),e.ts.factory.updateObjectLiteralExpression(t,n)}function Mm(e,t,r,n){let i=t.findIndex(s=>e.ts.isIdentifier(s.name)&&s.name.text===n);return i>-1?t[i]=e.ts.factory.updatePropertyAssignment(t[i],t[i].name,rn(e,r[n])):t.push(e.ts.factory.createPropertyAssignment(n,rn(e,r[n]))),t}function We(e,t){for(let r of t){let n=e.inputs.findIndex(i=>i.name===r.name);n>-1?(r.isRegistered||!e.inputs[n].isRegistered)&&(e.inputs[n]=r):e.inputs.push(r)}e.acceptsChildren=si(e)}function jm(e){let t=ii(e.type),r={name:e.name.trim(),type:t.builderType};return Re(e.friendlyName)&&e.friendlyName.trim()!==e.name.trim()&&(r.friendlyName=e.friendlyName),(Re(e.defaultValue)||qr(e.defaultValue)||br(e.defaultValue))&&(r.defaultValue=e.defaultValue),Re(e.helperText)&&(r.helperText=e.helperText),br(e.required)&&(r.required=e.required),typeof e.meta=="object"&&e.meta!=null&&Object.keys(e.meta).length>0&&(r.meta=e.meta),Array.isArray(e.enum)&&e.enum.length>0&&(r.enum=e.enum),e.hideFromUI===!0&&(r.hideFromUI=!0),ai(r)}function si(e){let t=e.inputs.some(n=>n.name==="children"),r=e.inputs.some(n=>n.meta?.ts==="ReactNode");return!!(t||r||e.acceptsChildren===!0)}function ai(e){if(e.name==="children"&&(e.hideFromUI=!0,delete e.required),e.type==="object"&&e.defaultValue==null&&(e.hideFromUI=!0),e.type==="list"&&e.defaultValue==null&&(e.hideFromUI=!0),e.meta){let t=e.meta.ts;typeof t=="string"&&(t=t.trim(),t.endsWith("ReactNode")&&(t="ReactNode"),e.meta.ts=t,t==="ReactNode"&&(e.hideFromUI=!0))}return e}function Um(e,t){let r=[...t.properties].sort((n,i)=>{let s=X(e,n)||"zz",o=X(e,i)||"zz";if(s==="inputs")return 1;let a=au.indexOf(s),u=au.indexOf(o);return a>-1?u>-1&&a>u?1:-1:u>-1?a>-1&&u<a?-1:1:s.localeCompare(o)});return e.ts.factory.updateObjectLiteralExpression(t,r)}var au=["component","name","description"];function Vm(e,t){return[...t].sort((n,i)=>{let s=X(e,n)||"zz",o=X(e,i)||"zz",a=uu.indexOf(s),u=uu.indexOf(o);return a>-1?u>-1&&a>u?1:-1:u>-1?a>-1&&u<a?-1:1:s.localeCompare(o)})}var uu=["name","type"];function Tr(e,t){for(let r of t.properties){if(!e.ts.isPropertyAssignment(r)||!e.ts.isIdentifier(r.name))continue;if(X(e,r)==="canHaveChildren"){let{initializer:i}=r;return i.kind===e.ts.SyntaxKind.TrueKeyword}}return!1}function cu(e,t){let r=`Builder.registerComponent(
|
|
285
285
|
`;if(e.appDir)t.acceptsChildren?r+=` withChildren(${t.importName}),
|
|
286
286
|
`:r+=` ${t.importName},
|
|
287
287
|
`;else{let i=t.externalImportPath?t.externalImportPath:W(e,e.registryPath,t.filePath);t.exportName==="default"?t.acceptsChildren?r+=` withChildren(dynamic(() => import(${JSON.stringify(i)}))),
|
|
@@ -291,7 +291,7 @@ ${r}=${n}
|
|
|
291
291
|
`}r+=` {
|
|
292
292
|
name: "${t.name}",
|
|
293
293
|
}
|
|
294
|
-
`,r+=");";let n=zn(e,r);return vi(e,n,t)}function vi(e,t,r){if(!e.ts.isExpressionStatement(t))return t;let n=t.expression;if(!e.ts.isCallExpression(n))return t;let i=[...n.arguments];if(i.length<2)return t;r.acceptsChildren?e.ts.isCallExpression(i[0])&&e.ts.isIdentifier(i[0].expression)&&i[0].expression.text==="withChildren"||(i[0]=e.ts.factory.createCallExpression(e.ts.factory.createIdentifier("withChildren"),void 0,[i[0]])):e.ts.isCallExpression(i[0])&&e.ts.isIdentifier(i[0].expression)&&i[0].expression.text==="withChildren"&&(i[0]=i[0].arguments[0]);let s=i[1];return e.ts.isObjectLiteralExpression(s)?(i[1]=he(e,s,r),e.ts.factory.updateExpressionStatement(t,e.ts.factory.updateCallExpression(n,n.expression,n.typeArguments,i))):t}function q(e,t,r,n="esm"){return Array.isArray(r.namedImports)&&r.namedImports.forEach(i=>{t=Mg(e,t,i,r.importPath,!!r.isTypeOnly,n)}),typeof r.defaultImport=="string"&&(t=jg(e,t,r.defaultImport,r.importPath,n)),t}function Mg(e,t,r,n,i,s){return s==="cjs"?Pu(e,t,null,r,n):Au(e,t,null,r,n,i)}function jg(e,t,r,n,i){return i==="cjs"?Pu(e,t,r,null,n):Au(e,t,r,null,n,!1)}function Au(e,t,r,n,i,s){let o=[...t.statements],a=0,u=!1,c=!1;for(let g=0;g<o.length;g++){let m=o[g];if(!e.ts.isImportDeclaration(m)||(a=g,!m.moduleSpecifier||!e.ts.isStringLiteral(m.moduleSpecifier))||m.moduleSpecifier.text!==i||!!m.importClause?.isTypeOnly!==s)continue;let f=[],h=m.importClause?.namedBindings;if(h&&e.ts.isNamedImports(h)&&h.elements&&f.push(...h.elements),typeof n=="string"){if(f.some(v=>v.name.text===n))return t;f.push(e.ts.factory.createImportSpecifier(!1,void 0,e.ts.factory.createIdentifier(n))),f.sort((v,E)=>v.name.text.localeCompare(E.name.text)),u=!0}let D=m.importClause?m.importClause.name:void 0;if(typeof r=="string"){if(D&&D.text===r)return t;D=e.ts.factory.createIdentifier(r),c=!0}if(u||c)return o[g]=e.ts.factory.updateImportDeclaration(m,void 0,e.ts.factory.createImportClause(s,D,e.ts.factory.createNamedImports(f)),m.moduleSpecifier,void 0),e.ts.factory.updateSourceFile(t,o)}let l,p;typeof r=="string"&&(l=e.ts.factory.createIdentifier(r)),typeof n=="string"&&(p=e.ts.factory.createNamedImports([e.ts.factory.createImportSpecifier(!1,void 0,e.ts.factory.createIdentifier(n))]));let d=e.ts.factory.createImportDeclaration(void 0,e.ts.factory.createImportClause(s,l,p),e.ts.factory.createStringLiteral(i));return o.splice(a,0,d),e.ts.factory.updateSourceFile(t,o)}function Pu(e,t,r,n,i){let s=[...t.statements],o=0;for(let a=0;a<s.length;a++){let u=s[a];if(e.ts.isVariableStatement(u))for(let c=0;c<u.declarationList.declarations.length;c++){let l=[...u.declarationList.declarations],p=l[c],d=p.initializer;if(!d||!e.ts.isCallExpression(d))continue;let g=d.expression;if(!e.ts.isIdentifier(g)||g.text!=="require"||d.arguments.length!==1)continue;let m=d.arguments[0];if(e.ts.isStringLiteral(m)&&(o=a,m.text===i)){if(e.ts.isIdentifier(p.name)&&typeof r=="string")return p.name.text===r?t:(l[c]=e.ts.factory.updateVariableDeclaration(p,e.ts.factory.createIdentifier(r),p.exclamationToken,p.type,p.initializer),s[a]=e.ts.factory.updateVariableStatement(u,u.modifiers,e.ts.factory.updateVariableDeclarationList(u.declarationList,l)),e.ts.factory.updateSourceFile(t,s));if(e.ts.isObjectBindingPattern(p.name)&&typeof n=="string"){let f=[...p.name.elements];return f.some(D=>!e.ts.isBindingElement(D)||!e.ts.isIdentifier(D.name)?!1:D.name.text===n)?t:(f.push(e.ts.factory.createBindingElement(void 0,void 0,n)),f.sort((D,v)=>!e.ts.isBindingElement(D)||!e.ts.isIdentifier(D.name)||!e.ts.isBindingElement(v)||!e.ts.isIdentifier(v.name)?0:D.name.text.localeCompare(v.name.text)),l[c]=e.ts.factory.updateVariableDeclaration(p,e.ts.factory.createObjectBindingPattern(f),p.exclamationToken,p.type,p.initializer),s[a]=e.ts.factory.updateVariableStatement(u,u.modifiers,e.ts.factory.updateVariableDeclarationList(u.declarationList,l)),e.ts.factory.updateSourceFile(t,s))}}}}if(typeof r=="string"){let a=e.ts.factory.createVariableStatement(void 0,e.ts.factory.createVariableDeclarationList([e.ts.factory.createVariableDeclaration(r,void 0,void 0,e.ts.factory.createCallExpression(e.ts.factory.createIdentifier("require"),void 0,[e.ts.factory.createStringLiteral(i)]))],e.ts.NodeFlags.Const));return s.splice(o,0,a),e.ts.factory.updateSourceFile(t,s)}if(typeof n=="string"){let a=e.ts.factory.createVariableStatement(void 0,e.ts.factory.createVariableDeclarationList([e.ts.factory.createVariableDeclaration(e.ts.factory.createObjectBindingPattern([e.ts.factory.createBindingElement(void 0,void 0,n)]),void 0,void 0,e.ts.factory.createCallExpression(e.ts.factory.createIdentifier("require"),void 0,[e.ts.factory.createStringLiteral(i)]))],e.ts.NodeFlags.Const));return s.splice(o,0,a),e.ts.factory.updateSourceFile(t,s)}return t}function or(e,t,r="esm"){return r==="cjs"?Hg(e,t):Ug(e,t)}function Ug(e,t){let r=[];for(let n of t.statements){if(e.ts.isExportDeclaration(n)){if(n.exportClause&&e.ts.isNamedExports(n.exportClause)){for(let i of n.exportClause.elements)if(n.moduleSpecifier&&r.push({isDefaultExport:!1,statement:n,node:i}),e.ts.isIdentifier(i.name)){let s=i.name.text;for(let o of t.statements)if(e.ts.isVariableStatement(o))for(let a of o.declarationList.declarations)e.ts.isIdentifier(a.name)&&a.name.text===s&&r.push({isDefaultExport:!1,statement:o,node:o});else e.ts.isFunctionDeclaration(o)&&o.name&&o.name.text===s&&r.push({isDefaultExport:!1,statement:o,node:o})}}else!n.exportClause&&n.moduleSpecifier&&r.push({isDefaultExport:!1,statement:n,node:n});continue}if(e.ts.isExportAssignment(n)){let i=n.flags===e.ts.NodeFlags.None,s=n.expression;if(e.ts.isIdentifier(s)){let o=s.text;for(let a of t.statements){if(e.ts.isVariableStatement(a))for(let u of a.declarationList.declarations)e.ts.isIdentifier(u.name)&&u.name.text===o&&r.push({isDefaultExport:i,statement:a,node:a});e.ts.isFunctionDeclaration(a)&&a.name?.text===o&&r.push({isDefaultExport:i,statement:a,node:a})}}else(e.ts.isArrowFunction(s)||e.ts.isCallExpression(s)||e.ts.isFunctionDeclaration(s)||e.ts.isObjectLiteralExpression(s))&&r.push({isDefaultExport:i,statement:n,node:s});continue}if((e.ts.isVariableStatement(n)||e.ts.isFunctionDeclaration(n))&&n.modifiers&&n.modifiers.some(i=>i.kind===e.ts.SyntaxKind.ExportKeyword)){r.push({isDefaultExport:n.modifiers.some(i=>i.kind===e.ts.SyntaxKind.DefaultKeyword),statement:n,node:n});continue}}return r}function Hg(e,t){let r=[];for(let n of t.statements)if(e.ts.isExpressionStatement(n)&&e.ts.isBinaryExpression(n.expression)&&e.ts.isPropertyAccessExpression(n.expression.left)){let i=n.expression.left,s=n.expression.right;if(!e.ts.isIdentifier(i.expression))continue;if(i.expression.text==="module"&&i.name.text==="exports"){if(e.ts.isIdentifier(s)){let o=s.text;for(let a of t.statements)if(e.ts.isVariableStatement(a))for(let u of a.declarationList.declarations)e.ts.isIdentifier(u.name)&&u.name.text===o&&r.push({isDefaultExport:!0,statement:a,node:a});else e.ts.isFunctionDeclaration(a)&&a.name&&a.name.text===o&&r.push({isDefaultExport:!0,statement:a,node:a})}else r.push({isDefaultExport:!0,statement:n,node:s});continue}}return r}function Vg(e,t,r){for(let n of t.statements)if(e.ts.isImportDeclaration(n)&&n.importClause){if(n.importClause.namedBindings&&e.ts.isNamedImports(n.importClause.namedBindings)){for(let i of n.importClause.namedBindings.elements)if(e.ts.isIdentifier(i.name)&&i.name.text===r&&e.ts.isStringLiteral(n.moduleSpecifier))return{importPath:n.moduleSpecifier.text,exportType:"named"}}if(n.importClause.name&&n.importClause.name.text===r&&e.ts.isStringLiteral(n.moduleSpecifier))return{importPath:n.moduleSpecifier.text,exportType:"default"}}return null}async function Dt(e,t,r,n){let i=Vg(e,r,n);if(i){let s=await cn(e,e.normalize(e.resolve(e.dirname(t),i.importPath))),o=e.relative(e.getAppRootDir(),s);return{displayFilePath:Q(e,s),filePath:s,relFilePath:o,importPath:i.importPath,exportType:i.exportType}}return null}function Tr(e,t,r){for(let n=0;n<t.statements.length;n++){let i=t.statements[n];if(e.ts.isVariableStatement(i)){for(let s of i.declarationList.declarations)if(e.ts.isIdentifier(s.name)&&s.name.text===r)return{statement:i,statementIndex:n}}}return null}function fe(e,t,r){let n=Tr(e,t,r);if(n&&n.statement.declarationList.declarations.length>0){let i=n.statement.declarationList.declarations[0];if(i.initializer&&e.ts.isArrayLiteralExpression(i.initializer))return{statement:n.statement,statementIndex:n.statementIndex,variableDeclaration:i,arrayLiteralExp:i.initializer}}return null}function oo(e,t){if(t){if(Kg(e,t))return!0;let r=!1;if(t.forEachChild(n=>{oo(e,n)&&(r=!0)}),r)return!0}return!1}function Kg(e,t){return e.ts.isJsxElement(t)||e.ts.isJsxOpeningElement(t)||e.ts.isJsxOpeningFragment(t)||e.ts.isJsxSelfClosingElement(t)||e.ts.isJsxFragment(t)||e.ts.isJsxChild(t)}async function cn(e,t){let r=e.extname(t).toLowerCase();if(r===""||!Ei.includes(r)){for(let n of Ei){let i=t+n;if(await e.exists(i))return i}for(let n of Ei){let i=e.join(t,"index"+n);if(await e.exists(i))return i}}return t}var Ei=[".tsx",".jsx",".ts",".js"];function Rr(e,t,r){if(!r||!t)return;let n=t.getSymbolAtLocation(r);if(!n)return;let i=n.valueDeclaration;if(!i)return;let s=i.getSourceFile().fileName,o=Gg(e,s);return o?[{name:o}]:void 0}function Gg(e,t){if(typeof t=="string"){t=e.normalize(st(t));let r=t.split("/"),n=r.lastIndexOf("node_modules");if(n>-1){let i=r.slice(n+1),s=i[0];if(s)return s.startsWith("@")&&i[1]&&(s+="/"+i[1]),s}}}function et(e){let t=[];for(let r of e)if(r.dependencies)for(let n of r.dependencies)t.some(i=>i.name===n.name)||t.push({...n});return t.sort((r,n)=>r.name.localeCompare(n.name))}function Tu(e,t,r="esm"){return r==="cjs"?qg(e,t):zg(e,t)}var Wg=/^(@\w|\w)/;function zg(e,t){let r=[];for(let n of t.statements)if(e.ts.isImportDeclaration(n)&&e.ts.isLiteralExpression(n.moduleSpecifier)){if(!Wg.test(n.moduleSpecifier.text)||n.importClause?.isTypeOnly)continue;if(n.importClause&&n.importClause.namedBindings&&e.ts.isNamedImports(n.importClause.namedBindings))for(let i of n.importClause.namedBindings.elements)i.isTypeOnly||r.push({isDefaultExport:!1,statement:n,node:i.name});n.importClause&&n.importClause.name&&r.push({isDefaultExport:!0,statement:n,node:n.importClause.name})}return r}function qg(e,t){return[]}async function Ir(e,t){if(!t.some(o=>!o.isRegistered))return t;let n=await ge(e,t.map(o=>o.filePath)),i=n.getTypeChecker();return await Promise.all(t.map(async o=>{let a=n.getSourceFile(o.filePath);if(a){let c=(await Kt(e,i,o.filePath,a,!1)).find(l=>l.cmpInfo.id===o.id);c&&(o.inputs=nr(e,i,c.node.fnNode))}return o}))}async function kr(e,t,r,n){if(t.node.fnNode){let{sourceFile:i,typeChecker:s}=await wr(e,t.cmpInfo.filePath,r),a=(await Kt(e,s,t.cmpInfo.filePath,i,n)).find(u=>u.cmpInfo.id===t.cmpInfo.id);if(!a)throw new Error(`createComponentInputs() Could not find component ${t.cmpInfo.name} in ${t.cmpInfo.filePath}`);return nr(e,s,a.node.fnNode)}return[]}async function Iu(e,t,r){let n=e.extname(t).toLowerCase();if(n===".tsx"||n===".jsx"||n===".ts"||n===".js"){let i=await e.readFile(t);if(i)return Jg(e,t,i,r)}return null}function Jg(e,t,r,n=!1){let i=G(e,r);return Kt(e,null,t,i,n)}async function Kt(e,t,r,n,i){let s=[];for(let a of n.statements)if(e.ts.isExpressionStatement(a)&&e.ts.isStringLiteral(a.expression)&&a.expression.text==="use server")return s;let o=or(e,n);return i&&o.push(...Tu(e,n)),r=e.normalize(r),await Promise.all(o.map(async a=>{let u=await Yg(e,t,r,a);s.push(...u)})),s}async function Yg(e,t,r,n){let i=[],s=e.relative(e.getAppRootDir(),r),o=re(e,r);if(e.ts.isVariableStatement(n.node)){for(let a of n.node.declarationList.declarations){if(!e.ts.isIdentifier(a.name)||!br(a.name.text))continue;let u=It(e,t,a.initializer);if(u){let c=u.name||a.name.text,l=n.isDefaultExport?"default":c,p=n.isDefaultExport?"default":"named";i.push({cmpInfo:{id:await ee(e,r,l),displayFilePath:Q(e,r),name:te(c),inputs:[],exportName:l,exportType:p,importName:c,filePath:r,relFilePath:s,importPath:o,dependencies:u.deps,framework:"react"},node:u})}}return i}if(e.ts.isArrowFunction(n.node)){let a=It(e,t,n.node);if(a){let u=Ye(e,r),c=n.isDefaultExport?"default":u,l=n.isDefaultExport?"default":"named";i.push({cmpInfo:{id:await ee(e,r,c),displayFilePath:Q(e,r),name:u,inputs:[],exportName:c,exportType:l,importName:er(e,r),filePath:r,relFilePath:s,importPath:o,dependencies:a.deps,framework:"react"},node:a})}return i}if(e.ts.isFunctionExpression(n.node)||e.ts.isFunctionDeclaration(n.node)){let a=n.node.name?.text;if(a&&!br(a))return i;let u=It(e,t,n.node);if(u){let c=u.name||Ye(e,r),l=n.isDefaultExport||!u.name?"default":u.name,p=n.isDefaultExport?"default":"named";i.push({cmpInfo:{id:await ee(e,r,l),displayFilePath:Q(e,r),name:c,inputs:[],exportName:l,exportType:p,importName:u.name||er(e,r),filePath:r,relFilePath:s,importPath:o,dependencies:u.deps,framework:"react"},node:u})}return i}if((e.ts.isExportSpecifier(n.node)||e.ts.isIdentifier(n.node))&&br(n.node.getText())){let a,u=It(e,t,n.node);if(u){let c=u.name||Ye(e,r),l=n.isDefaultExport||!u.name?"default":u.name,p=n.isDefaultExport?"default":"named",d=Qg(e,n.node)?.moduleSpecifier??Xg(e,n.node)?.moduleSpecifier;if(d&&e.ts.isStringLiteral(d)){let g=t?.getSymbolAtLocation(d);if(g&&g.declarations&&g.declarations.length>0){let m=g.declarations[0];(!e.ts.isSourceFile(m)||e.ts.isSourceFile(m)&&m.fileName.includes("node_modules"))&&(a=d.text)}}i.push({cmpInfo:{id:await ee(e,r,l,a),displayFilePath:Q(e,r),name:c,inputs:[],exportName:l,exportType:p,importName:u.name||er(e,r),filePath:r,relFilePath:s,importPath:a||o,externalImportPath:a,dependencies:u.deps,framework:"react"},node:u})}return i}if(e.ts.isExportDeclaration(n.node)&&n.node.exportClause===void 0){let a=n.node.moduleSpecifier;if(a&&e.ts.isStringLiteral(a)){let u=await eh(e,t,r,a);i.push(...u)}return i}return i}function Qg(e,t){for(;t;){if(e.ts.isExportDeclaration(t))return t;t=t.parent}return null}function Xg(e,t){for(;t;){if(e.ts.isImportDeclaration(t))return t;t=t.parent}return null}function It(e,t,r){if(!r)return null;if(e.ts.isArrowFunction(r))return oo(e,r.body)?{name:"",fnNode:r,deps:Rr(e,t,r)}:null;if(e.ts.isFunctionExpression(r)||e.ts.isFunctionDeclaration(r))return oo(e,r.body)?{name:r.name?.text||"",fnNode:r,deps:Rr(e,t,r)}:null;if(e.ts.isCallExpression(r)){let n=r.expression;if(e.ts.isPropertyAccessExpression(n)){let i=r.arguments;if(i.length===0)return null;let s=n.expression;if(!e.ts.isIdentifier(s)||s.text!=="React")return null;let o=n.name;return!e.ts.isIdentifier(o)||o.text!=="forwardRef"?null:It(e,t,i[0])}else if(e.ts.isIdentifier(n)&&(n.text==="observer"||n.text==="forwardRef")){let i=r.arguments;return i.length===0?null:It(e,t,i[0])}return null}if(!t)return null;if(e.ts.isPropertyAccessExpression(r)){let n=r.expression,i=r.name;if(!e.ts.isIdentifier(n)||!e.ts.isIdentifier(i)||!br(i.text))return null;let o=t.getTypeAtLocation(i).getCallSignatures();if(o.length>0&&o[0].getParameters().length>0)return{name:"",fnNode:i,deps:Rr(e,t,i)}}if(e.ts.isExportSpecifier(r)){let n=r.name;return{name:n.text||"",fnNode:n,deps:Rr(e,t,n)}}if(e.ts.isIdentifier(r))return{name:r.text||"",fnNode:r,deps:Rr(e,t,r)};if(e.ts.isExpressionStatement(r)){let n=r.expression;if(e.ts.isAsExpression(n)&&e.ts.isIdentifier(n.type)&&n.type.text==="default")return It(e,t,n.expression)}if(e.ts.isVariableStatement(r)){for(let n of r.declarationList.declarations)if(n.initializer&&e.ts.isAsExpression(n.initializer)){let i=n.initializer;if(e.ts.isIdentifier(i.type)&&i.type.text==="default"){let s=It(e,t,i.expression);if(s&&e.ts.isIdentifier(n.name))return{name:n.name.text,fnNode:s.fnNode,deps:s.deps}}}}return null}async function ku(e,t){let r=[],n=t.getSourceFiles(),i=t.getTypeChecker();return await Promise.all(n.map(async s=>{let o=e.normalize(s.fileName);if(qn(e,Zg,s.fileName)||o===e.reactConfigPath||o===e.builderComponentPath)return;let a=await Kt(e,i,o,s,o===e.registryPath);r.push(...a)})),r.sort((s,o)=>s.cmpInfo.name.localeCompare(o.cmpInfo.name))}var Zg=new Set(["node_modules","dist"]);async function eh(e,t,r,n){let i=[],s=n.text;if(!t)return i;try{let o=t.getSymbolAtLocation(n);if(!o)return i;let a=t.getExportsOfModule(o);for(let u of a){let c=u.valueDeclaration||u.declarations?.[0];if(!c)continue;let l=u.name;if(!br(l)&&l!=="default"||!Bu(e,t,c))continue;let p=It(e,t,c);if(p){let d=u.name,g=d==="default"?"default":"named",m=te(d),f=d==="default"?er(e,r):d;i.push({cmpInfo:{id:await ee(e,r,d,s),displayFilePath:Q(e,r),name:m,inputs:[],exportName:d,exportType:g,importName:f,filePath:r,relFilePath:e.relative(e.getAppRootDir(),r),importPath:s,externalImportPath:s,dependencies:p.deps,framework:"react"},node:p})}}}catch(o){e.Sentry?.captureException(new Error(`Error processing module ${s}:`,{cause:o}),{extra:{modulePath:s,filePath:r}})}return i}function Bu(e,t,r){if(e.ts.isInterfaceDeclaration(r)||e.ts.isTypeAliasDeclaration(r))return!1;if(e.ts.isExportSpecifier(r)){let n=t.getSymbolAtLocation(r.name);if(n){let s=t.getAliasedSymbol(n).declarations?.[0];if(s)return Bu(e,t,s)}return!1}if(e.ts.isFunctionDeclaration(r)||e.ts.isArrowFunction(r)||e.ts.isFunctionExpression(r)){let n=t.getSignatureFromDeclaration(r);if(n){let i=t.getReturnTypeOfSignature(n);return Ru(i,t)}}return e.ts.isClassDeclaration(r)?r.heritageClauses?.some(i=>i.types.some(s=>s.expression.getText()==="React.Component"||s.expression.getText()==="Component"))??!1:e.ts.isVariableDeclaration(r)?t.getTypeAtLocation(r).getCallSignatures().some(s=>Ru(t.getReturnTypeOfSignature(s),t)):!1}function Ru(e,t){let r=t.typeToString(e);return r==="JSX.Element"||r==="Element"||r.includes("ReactElement")||r.includes("React.ReactElement")||r.includes("ReactNode")}async function _u(e,t){let r=[],n=t.getSourceFiles(),i=t.getTypeChecker();return await Promise.all(n.map(async s=>{let o=e.basename(s.fileName);if(e.appDir&&th.has(o)||e.dirname(s.fileName).includes("node_modules"))return;let a=e.normalize(s.fileName);if(a===e.nextConfigPath||a===e.builderComponentPath)return;let u=await Kt(e,i,a,s,a===e.registryPath||He(a));r.push(...u)})),r.sort((s,o)=>s.cmpInfo.name.localeCompare(o.cmpInfo.name))}var th=new Set(["default.tsx","default.ts","default.jsx","default.js","error.tsx","error.ts","error.jsx","error.js","layout.tsx","layout.ts","layout.jsx","layout.js","loading.tsx","loading.ts","loading.jsx","loading.js","not-found.tsx","not-found.ts","not-found.jsx","not-found.js","page.tsx","page.ts","page.jsx","page.js","route.tsx","route.ts","route.jsx","route.js","template.tsx","template.ts","template.jsx","template.js"]);function Ct(e,t){let r=[],n=[],i=[],s=[];for(let o of t.statements){if(e.ts.isImportDeclaration(o)){if(e.ts.isStringLiteral(o.moduleSpecifier)){let u=o.moduleSpecifier.text;if(!u.startsWith(".")&&!u.startsWith("/")){r.push(o);continue}}let a=o.importClause;if(a){if(a.namedBindings){n.push(o);continue}if(a.name){n.push(o);continue}}i.push(o);continue}s.push(o)}return e.ts.factory.updateSourceFile(t,[...Si(e,r),...Si(e,n),...Si(e,i),...s])}function ct(e){let t=e.split(`
|
|
294
|
+
`,r+=");";let n=jn(e,r);return ui(e,n,t)}function ui(e,t,r){if(!e.ts.isExpressionStatement(t))return t;let n=t.expression;if(!e.ts.isCallExpression(n))return t;let i=[...n.arguments];if(i.length<2)return t;r.acceptsChildren?e.ts.isCallExpression(i[0])&&e.ts.isIdentifier(i[0].expression)&&i[0].expression.text==="withChildren"||(i[0]=e.ts.factory.createCallExpression(e.ts.factory.createIdentifier("withChildren"),void 0,[i[0]])):e.ts.isCallExpression(i[0])&&e.ts.isIdentifier(i[0].expression)&&i[0].expression.text==="withChildren"&&(i[0]=i[0].arguments[0]);let s=i[1];return e.ts.isObjectLiteralExpression(s)?(i[1]=he(e,s,r),e.ts.factory.updateExpressionStatement(t,e.ts.factory.updateCallExpression(n,n.expression,n.typeArguments,i))):t}function z(e,t,r,n="esm"){return Array.isArray(r.namedImports)&&r.namedImports.forEach(i=>{t=Hm(e,t,i,r.importPath,!!r.isTypeOnly,n)}),typeof r.defaultImport=="string"&&(t=Km(e,t,r.defaultImport,r.importPath,n)),t}function Hm(e,t,r,n,i,s){return s==="cjs"?pu(e,t,null,r,n):lu(e,t,null,r,n,i)}function Km(e,t,r,n,i){return i==="cjs"?pu(e,t,r,null,n):lu(e,t,r,null,n,!1)}function lu(e,t,r,n,i,s){let o=[...t.statements],a=0,u=!1,c=!1;for(let D=0;D<o.length;D++){let m=o[D];if(!e.ts.isImportDeclaration(m)||(a=D,!m.moduleSpecifier||!e.ts.isStringLiteral(m.moduleSpecifier))||m.moduleSpecifier.text!==i||!!m.importClause?.isTypeOnly!==s)continue;let f=[],g=m.importClause?.namedBindings;if(g&&e.ts.isNamedImports(g)&&g.elements&&f.push(...g.elements),typeof n=="string"){if(f.some(E=>E.name.text===n))return t;f.push(e.ts.factory.createImportSpecifier(!1,void 0,e.ts.factory.createIdentifier(n))),f.sort((E,v)=>E.name.text.localeCompare(v.name.text)),u=!0}let h=m.importClause?m.importClause.name:void 0;if(typeof r=="string"){if(h&&h.text===r)return t;h=e.ts.factory.createIdentifier(r),c=!0}if(u||c)return o[D]=e.ts.factory.updateImportDeclaration(m,void 0,e.ts.factory.createImportClause(s,h,e.ts.factory.createNamedImports(f)),m.moduleSpecifier,void 0),e.ts.factory.updateSourceFile(t,o)}let l,p;typeof r=="string"&&(l=e.ts.factory.createIdentifier(r)),typeof n=="string"&&(p=e.ts.factory.createNamedImports([e.ts.factory.createImportSpecifier(!1,void 0,e.ts.factory.createIdentifier(n))]));let d=e.ts.factory.createImportDeclaration(void 0,e.ts.factory.createImportClause(s,l,p),e.ts.factory.createStringLiteral(i));return o.splice(a,0,d),e.ts.factory.updateSourceFile(t,o)}function pu(e,t,r,n,i){let s=[...t.statements],o=0;for(let a=0;a<s.length;a++){let u=s[a];if(e.ts.isVariableStatement(u))for(let c=0;c<u.declarationList.declarations.length;c++){let l=[...u.declarationList.declarations],p=l[c],d=p.initializer;if(!d||!e.ts.isCallExpression(d))continue;let D=d.expression;if(!e.ts.isIdentifier(D)||D.text!=="require"||d.arguments.length!==1)continue;let m=d.arguments[0];if(e.ts.isStringLiteral(m)&&(o=a,m.text===i)){if(e.ts.isIdentifier(p.name)&&typeof r=="string")return p.name.text===r?t:(l[c]=e.ts.factory.updateVariableDeclaration(p,e.ts.factory.createIdentifier(r),p.exclamationToken,p.type,p.initializer),s[a]=e.ts.factory.updateVariableStatement(u,u.modifiers,e.ts.factory.updateVariableDeclarationList(u.declarationList,l)),e.ts.factory.updateSourceFile(t,s));if(e.ts.isObjectBindingPattern(p.name)&&typeof n=="string"){let f=[...p.name.elements];return f.some(h=>!e.ts.isBindingElement(h)||!e.ts.isIdentifier(h.name)?!1:h.name.text===n)?t:(f.push(e.ts.factory.createBindingElement(void 0,void 0,n)),f.sort((h,E)=>!e.ts.isBindingElement(h)||!e.ts.isIdentifier(h.name)||!e.ts.isBindingElement(E)||!e.ts.isIdentifier(E.name)?0:h.name.text.localeCompare(E.name.text)),l[c]=e.ts.factory.updateVariableDeclaration(p,e.ts.factory.createObjectBindingPattern(f),p.exclamationToken,p.type,p.initializer),s[a]=e.ts.factory.updateVariableStatement(u,u.modifiers,e.ts.factory.updateVariableDeclarationList(u.declarationList,l)),e.ts.factory.updateSourceFile(t,s))}}}}if(typeof r=="string"){let a=e.ts.factory.createVariableStatement(void 0,e.ts.factory.createVariableDeclarationList([e.ts.factory.createVariableDeclaration(r,void 0,void 0,e.ts.factory.createCallExpression(e.ts.factory.createIdentifier("require"),void 0,[e.ts.factory.createStringLiteral(i)]))],e.ts.NodeFlags.Const));return s.splice(o,0,a),e.ts.factory.updateSourceFile(t,s)}if(typeof n=="string"){let a=e.ts.factory.createVariableStatement(void 0,e.ts.factory.createVariableDeclarationList([e.ts.factory.createVariableDeclaration(e.ts.factory.createObjectBindingPattern([e.ts.factory.createBindingElement(void 0,void 0,n)]),void 0,void 0,e.ts.factory.createCallExpression(e.ts.factory.createIdentifier("require"),void 0,[e.ts.factory.createStringLiteral(i)]))],e.ts.NodeFlags.Const));return s.splice(o,0,a),e.ts.factory.updateSourceFile(t,s)}return t}function sr(e,t,r="esm"){return r==="cjs"?Wm(e,t):Gm(e,t)}function Gm(e,t){let r=[];for(let n of t.statements){if(e.ts.isExportDeclaration(n)){if(n.exportClause&&e.ts.isNamedExports(n.exportClause)){for(let i of n.exportClause.elements)if(n.moduleSpecifier&&r.push({isDefaultExport:!1,statement:n,node:i}),e.ts.isIdentifier(i.name)){let s=i.name.text;for(let o of t.statements)if(e.ts.isVariableStatement(o))for(let a of o.declarationList.declarations)e.ts.isIdentifier(a.name)&&a.name.text===s&&r.push({isDefaultExport:!1,statement:o,node:o});else e.ts.isFunctionDeclaration(o)&&o.name&&o.name.text===s&&r.push({isDefaultExport:!1,statement:o,node:o})}}else!n.exportClause&&n.moduleSpecifier&&r.push({isDefaultExport:!1,statement:n,node:n});continue}if(e.ts.isExportAssignment(n)){let i=n.flags===e.ts.NodeFlags.None,s=n.expression;if(e.ts.isIdentifier(s)){let o=s.text;for(let a of t.statements){if(e.ts.isVariableStatement(a))for(let u of a.declarationList.declarations)e.ts.isIdentifier(u.name)&&u.name.text===o&&r.push({isDefaultExport:i,statement:a,node:a});e.ts.isFunctionDeclaration(a)&&a.name?.text===o&&r.push({isDefaultExport:i,statement:a,node:a})}}else(e.ts.isArrowFunction(s)||e.ts.isCallExpression(s)||e.ts.isFunctionDeclaration(s)||e.ts.isObjectLiteralExpression(s))&&r.push({isDefaultExport:i,statement:n,node:s});continue}if((e.ts.isVariableStatement(n)||e.ts.isFunctionDeclaration(n))&&n.modifiers&&n.modifiers.some(i=>i.kind===e.ts.SyntaxKind.ExportKeyword)){r.push({isDefaultExport:n.modifiers.some(i=>i.kind===e.ts.SyntaxKind.DefaultKeyword),statement:n,node:n});continue}}return r}function Wm(e,t){let r=[];for(let n of t.statements)if(e.ts.isExpressionStatement(n)&&e.ts.isBinaryExpression(n.expression)&&e.ts.isPropertyAccessExpression(n.expression.left)){let i=n.expression.left,s=n.expression.right;if(!e.ts.isIdentifier(i.expression))continue;if(i.expression.text==="module"&&i.name.text==="exports"){if(e.ts.isIdentifier(s)){let o=s.text;for(let a of t.statements)if(e.ts.isVariableStatement(a))for(let u of a.declarationList.declarations)e.ts.isIdentifier(u.name)&&u.name.text===o&&r.push({isDefaultExport:!0,statement:a,node:a});else e.ts.isFunctionDeclaration(a)&&a.name&&a.name.text===o&&r.push({isDefaultExport:!0,statement:a,node:a})}else r.push({isDefaultExport:!0,statement:n,node:s});continue}}return r}function zm(e,t,r){for(let n of t.statements)if(e.ts.isImportDeclaration(n)&&n.importClause){if(n.importClause.namedBindings&&e.ts.isNamedImports(n.importClause.namedBindings)){for(let i of n.importClause.namedBindings.elements)if(e.ts.isIdentifier(i.name)&&i.name.text===r&&e.ts.isStringLiteral(n.moduleSpecifier))return{importPath:n.moduleSpecifier.text,exportType:"named"}}if(n.importClause.name&&n.importClause.name.text===r&&e.ts.isStringLiteral(n.moduleSpecifier))return{importPath:n.moduleSpecifier.text,exportType:"default"}}return null}async function xt(e,t,r,n){let i=zm(e,r,n);if(i){let s=await on(e,e.normalize(e.resolve(e.dirname(t),i.importPath))),o=e.relative(e.getAppRootDir(),s);return{displayFilePath:Y(e,s),filePath:s,relFilePath:o,importPath:i.importPath,exportType:i.exportType}}return null}function Rr(e,t,r){for(let n=0;n<t.statements.length;n++){let i=t.statements[n];if(e.ts.isVariableStatement(i)){for(let s of i.declarationList.declarations)if(e.ts.isIdentifier(s.name)&&s.name.text===r)return{statement:i,statementIndex:n}}}return null}function fe(e,t,r){let n=Rr(e,t,r);if(n&&n.statement.declarationList.declarations.length>0){let i=n.statement.declarationList.declarations[0];if(i.initializer&&e.ts.isArrayLiteralExpression(i.initializer))return{statement:n.statement,statementIndex:n.statementIndex,variableDeclaration:i,arrayLiteralExp:i.initializer}}return null}function Qn(e,t){if(t){if(qm(e,t))return!0;let r=!1;if(t.forEachChild(n=>{Qn(e,n)&&(r=!0)}),r)return!0}return!1}function qm(e,t){return e.ts.isJsxElement(t)||e.ts.isJsxOpeningElement(t)||e.ts.isJsxOpeningFragment(t)||e.ts.isJsxSelfClosingElement(t)||e.ts.isJsxFragment(t)||e.ts.isJsxChild(t)}async function on(e,t){let r=e.extname(t).toLowerCase();if(r===""||!ci.includes(r)){for(let n of ci){let i=t+n;if(await e.exists(i))return i}for(let n of ci){let i=e.join(t,"index"+n);if(await e.exists(i))return i}}return t}var ci=[".tsx",".jsx",".ts",".js"];function Ir(e,t,r){if(!r||!t)return;let n=t.getSymbolAtLocation(r);if(!n)return;let i=n.valueDeclaration;if(!i)return;let s=i.getSourceFile().fileName,o=Jm(e,s);return o?[{name:o}]:void 0}function Jm(e,t){if(typeof t=="string"){t=e.normalize(ct(t));let r=t.split("/"),n=r.lastIndexOf("node_modules");if(n>-1){let i=r.slice(n+1),s=i[0];if(s)return s.startsWith("@")&&i[1]&&(s+="/"+i[1]),s}}}function rt(e){let t=[];for(let r of e)if(r.dependencies)for(let n of r.dependencies)t.some(i=>i.name===n.name)||t.push({...n});return t.sort((r,n)=>r.name.localeCompare(n.name))}function du(e,t,r="esm"){return r==="cjs"?Xm(e,t):Qm(e,t)}var Ym=/^(@\w|\w)/;function Qm(e,t){let r=[];for(let n of t.statements)if(e.ts.isImportDeclaration(n)&&e.ts.isLiteralExpression(n.moduleSpecifier)){if(!Ym.test(n.moduleSpecifier.text)||n.importClause?.isTypeOnly)continue;if(n.importClause&&n.importClause.namedBindings&&e.ts.isNamedImports(n.importClause.namedBindings))for(let i of n.importClause.namedBindings.elements)i.isTypeOnly||r.push({isDefaultExport:!1,statement:n,node:i.name});n.importClause&&n.importClause.name&&r.push({isDefaultExport:!0,statement:n,node:n.importClause.name})}return r}function Xm(e,t){return[]}async function kr(e,t){if(!t.some(o=>!o.isRegistered))return t;let n=await ge(e,t.map(o=>o.filePath)),i=n.getTypeChecker();return await Promise.all(t.map(async o=>{let a=n.getSourceFile(o.filePath);if(a){let c=(await Wt(e,i,o.filePath,a,!1)).find(l=>l.cmpInfo.id===o.id);c&&(o.inputs=ir(e,i,c.node.fnNode))}return o}))}async function Br(e,t,r,n){if(t.node.fnNode){let{sourceFile:i,typeChecker:s}=await Er(e,t.cmpInfo.filePath,r),a=(await Wt(e,s,t.cmpInfo.filePath,i,n)).find(u=>u.cmpInfo.id===t.cmpInfo.id);if(!a)throw new Error(`createComponentInputs() Could not find component ${t.cmpInfo.name} in ${t.cmpInfo.filePath}`);return ir(e,s,a.node.fnNode)}return[]}async function mu(e,t,r){let n=e.extname(t).toLowerCase();if(n===".tsx"||n===".jsx"||n===".ts"||n===".js"){let i=await e.readFile(t);if(i)return Zm(e,t,i,r)}return null}function Zm(e,t,r,n=!1){let i=G(e,r);return Wt(e,null,t,i,n)}async function Wt(e,t,r,n,i){let s=[];for(let a of n.statements)if(e.ts.isExpressionStatement(a)&&e.ts.isStringLiteral(a.expression)&&a.expression.text==="use server")return s;let o=sr(e,n);return i&&o.push(...du(e,n)),r=e.normalize(r),await Promise.all(o.map(async a=>{let u=await eg(e,t,r,a);s.push(...u)})),s}async function eg(e,t,r,n){let i=[],s=e.relative(e.getAppRootDir(),r),o=te(e,r);if(e.ts.isVariableStatement(n.node)){for(let a of n.node.declarationList.declarations){if(!e.ts.isIdentifier(a.name)||!wr(a.name.text))continue;let u=Nt(e,t,a.initializer);if(u){let c=u.name||a.name.text,l=n.isDefaultExport?"default":c,p=n.isDefaultExport?"default":"named";i.push({cmpInfo:{id:await Z(e,r,l),displayFilePath:Y(e,r),name:ee(c),inputs:[],exportName:l,exportType:p,importName:c,filePath:r,relFilePath:s,importPath:o,dependencies:u.deps,framework:"react"},node:u})}}return i}if(e.ts.isArrowFunction(n.node)){let a=Nt(e,t,n.node);if(a){let u=Xe(e,r),c=n.isDefaultExport?"default":u,l=n.isDefaultExport?"default":"named";i.push({cmpInfo:{id:await Z(e,r,c),displayFilePath:Y(e,r),name:u,inputs:[],exportName:c,exportType:l,importName:rr(e,r),filePath:r,relFilePath:s,importPath:o,dependencies:a.deps,framework:"react"},node:a})}return i}if(e.ts.isFunctionExpression(n.node)||e.ts.isFunctionDeclaration(n.node)){let a=n.node.name?.text;if(a&&!wr(a))return i;let u=Nt(e,t,n.node);if(u){let c=u.name||Xe(e,r),l=n.isDefaultExport||!u.name?"default":u.name,p=n.isDefaultExport?"default":"named";i.push({cmpInfo:{id:await Z(e,r,l),displayFilePath:Y(e,r),name:c,inputs:[],exportName:l,exportType:p,importName:u.name||rr(e,r),filePath:r,relFilePath:s,importPath:o,dependencies:u.deps,framework:"react"},node:u})}return i}if((e.ts.isExportSpecifier(n.node)||e.ts.isIdentifier(n.node))&&wr(n.node.getText())){let a,u=Nt(e,t,n.node);if(u){let c=u.name||Xe(e,r),l=n.isDefaultExport||!u.name?"default":u.name,p=n.isDefaultExport?"default":"named",d=tg(e,n.node)?.moduleSpecifier??rg(e,n.node)?.moduleSpecifier;if(d&&e.ts.isStringLiteral(d)){let D=t?.getSymbolAtLocation(d);if(D&&D.declarations&&D.declarations.length>0){let m=D.declarations[0];(!e.ts.isSourceFile(m)||e.ts.isSourceFile(m)&&m.fileName.includes("node_modules"))&&(a=d.text)}}i.push({cmpInfo:{id:await Z(e,r,l,a),displayFilePath:Y(e,r),name:c,inputs:[],exportName:l,exportType:p,importName:u.name||rr(e,r),filePath:r,relFilePath:s,importPath:a||o,externalImportPath:a,dependencies:u.deps,framework:"react"},node:u})}return i}if(e.ts.isExportDeclaration(n.node)&&n.node.exportClause===void 0){let a=n.node.moduleSpecifier;if(a&&e.ts.isStringLiteral(a)){let u=await og(e,t,r,a);i.push(...u)}return i}return i}function tg(e,t){for(;t;){if(e.ts.isExportDeclaration(t))return t;t=t.parent}return null}function rg(e,t){for(;t;){if(e.ts.isImportDeclaration(t))return t;t=t.parent}return null}function Nt(e,t,r){if(!r)return null;if(e.ts.isArrowFunction(r))return Qn(e,r.body)?{name:"",fnNode:r,deps:Ir(e,t,r)}:null;if(e.ts.isFunctionExpression(r)||e.ts.isFunctionDeclaration(r))return Qn(e,r.body)?{name:r.name?.text||"",fnNode:r,deps:Ir(e,t,r)}:null;if(e.ts.isCallExpression(r)){let n=r.expression;if(e.ts.isPropertyAccessExpression(n)){let i=r.arguments;if(i.length===0)return null;let s=n.expression;if(!e.ts.isIdentifier(s)||s.text!=="React")return null;let o=n.name;return!e.ts.isIdentifier(o)||o.text!=="forwardRef"?null:Nt(e,t,i[0])}else if(e.ts.isIdentifier(n)&&(n.text==="observer"||n.text==="forwardRef")){let i=r.arguments;return i.length===0?null:Nt(e,t,i[0])}return null}if(!t)return null;if(e.ts.isPropertyAccessExpression(r)){let n=r.expression,i=r.name;if(!e.ts.isIdentifier(n)||!e.ts.isIdentifier(i)||!wr(i.text))return null;let o=t.getTypeAtLocation(i).getCallSignatures();if(o.length>0&&o[0].getParameters().length>0)return{name:"",fnNode:i,deps:Ir(e,t,i)}}if(e.ts.isExportSpecifier(r)){let n=r.name;return{name:n.text||"",fnNode:n,deps:Ir(e,t,n)}}if(e.ts.isIdentifier(r))return{name:r.text||"",fnNode:r,deps:Ir(e,t,r)};if(e.ts.isExpressionStatement(r)){let n=r.expression;if(e.ts.isAsExpression(n)&&e.ts.isIdentifier(n.type)&&n.type.text==="default")return Nt(e,t,n.expression)}if(e.ts.isVariableStatement(r)){for(let n of r.declarationList.declarations)if(n.initializer&&e.ts.isAsExpression(n.initializer)){let i=n.initializer;if(e.ts.isIdentifier(i.type)&&i.type.text==="default"){let s=Nt(e,t,i.expression);if(s&&e.ts.isIdentifier(n.name))return{name:n.name.text,fnNode:s.fnNode,deps:s.deps}}}}return null}async function gu(e,t){let r=[],n=t.getSourceFiles(),i=t.getTypeChecker();return await Promise.all(n.map(async s=>{let o=e.normalize(s.fileName);if(Un(e,ng,s.fileName)||o===e.reactConfigPath||o===e.builderComponentPath)return;let a=await Wt(e,i,o,s,o===e.registryPath);r.push(...a)})),r.sort((s,o)=>s.cmpInfo.name.localeCompare(o.cmpInfo.name))}var ng=new Set(["node_modules","dist"]);async function og(e,t,r,n){let i=[],s=n.text;if(!t)return i;try{let o=t.getSymbolAtLocation(n);if(!o)return i;let a=t.getExportsOfModule(o);for(let u of a){let c=u.valueDeclaration||u.declarations?.[0];if(!c)continue;let l=u.name;if(!wr(l)&&l!=="default"||!hu(e,t,c))continue;let p=Nt(e,t,c);if(p){let d=u.name,D=d==="default"?"default":"named",m=ee(d),f=d==="default"?rr(e,r):d;i.push({cmpInfo:{id:await Z(e,r,d,s),displayFilePath:Y(e,r),name:m,inputs:[],exportName:d,exportType:D,importName:f,filePath:r,relFilePath:e.relative(e.getAppRootDir(),r),importPath:s,externalImportPath:s,dependencies:p.deps,framework:"react"},node:p})}}}catch(o){e.Sentry?.captureException(new Error(`Error processing module ${s}:`,{cause:o}),{extra:{modulePath:s,filePath:r}})}return i}function hu(e,t,r){if(e.ts.isInterfaceDeclaration(r)||e.ts.isTypeAliasDeclaration(r))return!1;if(e.ts.isExportSpecifier(r)){let n=t.getSymbolAtLocation(r.name);if(n){let s=t.getAliasedSymbol(n).declarations?.[0];if(s)return hu(e,t,s)}return!1}if(e.ts.isFunctionDeclaration(r)||e.ts.isArrowFunction(r)||e.ts.isFunctionExpression(r)){let n=t.getSignatureFromDeclaration(r);if(n){let i=t.getReturnTypeOfSignature(n);return fu(i,t)}}return e.ts.isClassDeclaration(r)?r.heritageClauses?.some(i=>i.types.some(s=>s.expression.getText()==="React.Component"||s.expression.getText()==="Component"))??!1:e.ts.isVariableDeclaration(r)?t.getTypeAtLocation(r).getCallSignatures().some(s=>fu(t.getReturnTypeOfSignature(s),t)):!1}function fu(e,t){let r=t.typeToString(e);return r==="JSX.Element"||r==="Element"||r.includes("ReactElement")||r.includes("React.ReactElement")||r.includes("ReactNode")}async function Du(e,t){let r=[],n=t.getSourceFiles(),i=t.getTypeChecker();return await Promise.all(n.map(async s=>{let o=e.basename(s.fileName);if(e.appDir&&ig.has(o)||e.dirname(s.fileName).includes("node_modules"))return;let a=e.normalize(s.fileName);if(a===e.nextConfigPath||a===e.builderComponentPath)return;let u=await Wt(e,i,a,s,a===e.registryPath||He(a));r.push(...u)})),r.sort((s,o)=>s.cmpInfo.name.localeCompare(o.cmpInfo.name))}var ig=new Set(["default.tsx","default.ts","default.jsx","default.js","error.tsx","error.ts","error.jsx","error.js","layout.tsx","layout.ts","layout.jsx","layout.js","loading.tsx","loading.ts","loading.jsx","loading.js","not-found.tsx","not-found.ts","not-found.jsx","not-found.js","page.tsx","page.ts","page.jsx","page.js","route.tsx","route.ts","route.jsx","route.js","template.tsx","template.ts","template.jsx","template.js"]);function bt(e,t){let r=[],n=[],i=[],s=[];for(let o of t.statements){if(e.ts.isImportDeclaration(o)){if(e.ts.isStringLiteral(o.moduleSpecifier)){let u=o.moduleSpecifier.text;if(!u.startsWith(".")&&!u.startsWith("/")){r.push(o);continue}}let a=o.importClause;if(a){if(a.namedBindings){n.push(o);continue}if(a.name){n.push(o);continue}}i.push(o);continue}s.push(o)}return e.ts.factory.updateSourceFile(t,[...li(e,r),...li(e,n),...li(e,i),...s])}function dt(e){let t=e.split(`
|
|
295
295
|
`).map(n=>n.trimEnd());e="";let r=!1;for(let n=t.length-1;n>=0;n--){let i=t[n];!r&&i.startsWith("import ")&&(r=!0,i=i+`
|
|
296
296
|
`),/^builder.init(.*)$/.test(i)&&(i=i+`
|
|
297
297
|
`),t[n-1]&&!t[n-1].includes("*/")&&(i.trim().startsWith("Builder.registerComponent")&&(i=`
|
|
@@ -300,8 +300,8 @@ ${r}=${n}
|
|
|
300
300
|
`+i),i.trim().startsWith("export ")&&(i=`
|
|
301
301
|
`+i)),e=i+`
|
|
302
302
|
`+e}return e.trim()+`
|
|
303
|
-
`}function
|
|
304
|
-
${e}`),e}function Lu(e,t){let r=t.statements.filter(n=>!(e.ts.isExpressionStatement(n)&&e.ts.isStringLiteral(n.expression)&&e.ts.isStringLiteral(n.expression)&&n.expression.text==="use client"));return e.ts.factory.updateSourceFile(t,r)}function yt(e,t){return t.sort((r,n)=>{if(e.ts.isObjectLiteralExpression(r)&&e.ts.isObjectLiteralExpression(n)){let i=Nu(e,r),s=Nu(e,n);return i.toLocaleLowerCase().localeCompare(s.toLocaleLowerCase())}return 1})}function Nu(e,t){let r=t.properties.find(n=>Z(e,n)==="name");return r&&e.ts.isPropertyAssignment(r)&&e.ts.isStringLiteral(r.initializer)?r.initializer.text:"zzzz"}async function Mu(e){let t=await e.readFile(e.registryPath);return t?rh(e,t):{components:[],sourceFile:G(e,"")}}async function rh(e,t){let r=G(e,t);return e.sdkVersion===N.gen2?oh(e,r):nh(e,r)}async function nh(e,t){let r=[];for(let n=0;n<t.statements.length;n++){let i=t.statements[n];if(!e.ts.isExpressionStatement(i))continue;let s=i.expression;if(!e.ts.isCallExpression(s))continue;let o=s.expression;if(!e.ts.isPropertyAccessExpression(o))continue;let a=o.expression;if(!e.ts.isIdentifier(a)||a.text!=="Builder"||o.name.text!=="registerComponent")continue;let c=s.arguments;if(c.length<2)continue;let l=c[1];if(!e.ts.isObjectLiteralExpression(l))continue;let p=c[0];if(e.ts.isCallExpression(p)){let d=e.ts.isIdentifier(p.expression)&&p.expression.text;if(d==="withChildren"){let m=Pi(e,p.arguments[0]);if(e.ts.isCallExpression(m)){let f=await Fi(e,n,m,l,!0);f&&r.push(f)}else{let f=m;if(e.ts.isIdentifier(f)){let h=await Ai(e,t,n,f,l,!0);h&&r.push(h)}}continue}if(d==="dynamic"){let m=await Fi(e,n,p,l,!1);m&&r.push(m);continue}let g=Pi(e,p.arguments[0]);if(e.ts.isCallExpression(g)&&e.ts.isIdentifier(g.expression)&&g.expression.text==="dynamic"){let m=await Fi(e,n,g,l,!1);m&&r.push(m);continue}if(e.ts.isIdentifier(g)){let m=await Ai(e,t,n,g,l,!1);m&&r.push(m);continue}continue}if(e.ts.isIdentifier(p)){let d=await Ai(e,t,n,p,l,!1);d&&r.push(d);continue}}return{sourceFile:t,components:Be(r)}}function Pi(e,t){return e.ts.isCallExpression(t)?(e.ts.isIdentifier(t.expression)&&t.expression.text)==="dynamic"?t:Pi(e,t.arguments[0]):t}async function Fi(e,t,r,n,i){let s={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],nodeIndex:t,acceptsChildren:i,framework:"react"},o=r.arguments;if(o.length===0)return null;let a=o[0];if(!e.ts.isArrowFunction(a))return null;let u=a.body;if(e.ts.isCallExpression(u)){if(u.expression.kind!==e.ts.SyntaxKind.ImportKeyword||u.arguments.length!==1)return null;let l=u.arguments[0];if(!e.ts.isStringLiteral(l))return null;let p=l.text,d=await Br(e,p);s.filePath=d,s.relFilePath=e.relative(e.getAppRootDir(),s.filePath),await e.exists(d)?s.importPath=re(e,s.filePath):(s.externalImportPath=p,s.importPath=s.externalImportPath),s.name=Ye(e,s.filePath),s.importName="default",s.exportName="default",s.exportType="default"}else if(e.ts.isPropertyAccessExpression(u)){let c=u.expression;if(!e.ts.isParenthesizedExpression(c))return null;let l=c.expression;if(!e.ts.isAwaitExpression(l))return null;let p=l.expression;if(!e.ts.isCallExpression(p)||p.expression.kind!==e.ts.SyntaxKind.ImportKeyword||p.arguments.length!==1)return null;let g=p.arguments[0];if(!e.ts.isStringLiteral(g)||!e.ts.isIdentifier(u.name))return null;let m=g.text,f=await Br(e,m);s.filePath=f,s.relFilePath=e.relative(e.getAppRootDir(),s.filePath),await e.exists(f)?s.importPath=re(e,s.filePath):(s.externalImportPath=m,s.importPath=s.externalImportPath),s.name=te(u.name.text),s.importName=u.name.text,s.exportName=u.name.text,s.exportType="named"}else return null;return s=Ne(e,s,n),s.displayFilePath=Q(e,s.filePath),s.filePath&&s.exportName&&(s.id=await ee(e,s.filePath,s.exportName,s.externalImportPath)),s}async function Ai(e,t,r,n,i,s){let o={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],nodeIndex:r,acceptsChildren:s,framework:"react"},a=t.statements.filter(c=>e.ts.isImportDeclaration(c)),u=a.find(c=>c.importClause&&c.importClause.name?.text===n.text);if(u){let c=u.moduleSpecifier;if(!e.ts.isStringLiteral(c))return null;let l=await Br(e,c.text);o.filePath=l,o.relFilePath=e.relative(e.getAppRootDir(),o.filePath),await e.exists(l)?o.importPath=re(e,o.filePath):(o.externalImportPath=c.text,o.importPath=o.externalImportPath),o.name=Ye(e,o.filePath),o.importName=n.text,o.exportName="default",o.exportType="default"}else{let c=a.find(d=>!d.importClause||!d.importClause.namedBindings||!e.ts.isNamedImports(d.importClause.namedBindings)?!1:d.importClause.namedBindings.elements.some(g=>g.name.text===n.text));if(!c)return null;let l=c.moduleSpecifier;if(!e.ts.isStringLiteral(l))return null;let p=await Br(e,l.text);o.filePath=p,o.relFilePath=e.relative(e.getAppRootDir(),o.filePath),await e.exists(p)?o.importPath=re(e,o.filePath):(o.externalImportPath=l.text,o.importPath=o.externalImportPath),o.name=te(n.text),o.importName=n.text,o.exportName=n.text,o.exportType="named"}return o=Ne(e,o,i),o.displayFilePath=Q(e,o.filePath),o.filePath&&o.exportName&&(o.id=await ee(e,o.filePath,o.exportName,o.externalImportPath)),o}function Br(e,t){return cn(e,e.normalize(e.resolve(e.dirname(e.registryPath),t)))}function ju(e,t,r){let n=!1,i=0,s=[...t.statements];for(let c=0;c<s.length;c++){let l=s[c];if(e.ts.isImportDeclaration(l)){i=c;continue}if(!e.ts.isExpressionStatement(l))continue;let p=l.expression;if(!e.ts.isCallExpression(p))continue;let d=p.expression;if(!e.ts.isPropertyAccessExpression(d))continue;let g=d.expression;if(!e.ts.isIdentifier(g)||g.text!=="builder")continue;if(d.name.text=="init"){n=!0;break}else continue}if(n)return t;let o=e.ts.factory.createPropertyAccessExpression(e.ts.factory.createPropertyAccessExpression(e.ts.factory.createIdentifier("process"),e.ts.factory.createIdentifier("env")),e.ts.factory.createIdentifier(ht)),a=r?e.ts.factory.createNonNullExpression(o):o,u=e.ts.factory.createExpressionStatement(e.ts.factory.createCallExpression(e.ts.factory.createPropertyAccessExpression(e.ts.factory.createIdentifier("builder"),e.ts.factory.createIdentifier("init")),void 0,[a]));return s.splice(i+1,0,u),e.ts.factory.updateSourceFile(t,s)}async function oh(e,t){let r=[],n=fe(e,t,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(i,s)=>{let o=await Ti(e,t,i);o&&(o.nodeIndex=s,r.push(o))})),{sourceFile:t,components:Be(r)}}async function Ti(e,t,r){if(!e.ts.isObjectLiteralExpression(r))return null;let n={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],acceptsChildren:!1,framework:"react"};Pr(e,r)&&(n.acceptsChildren=!0);for(let s of r.properties){if(!e.ts.isPropertyAssignment(s)||!e.ts.isIdentifier(s.name))continue;if(Z(e,s)==="component"){let a,{initializer:u}=s;if(e.ts.isCallExpression(u)&&(e.ts.isIdentifier(u.expression)&&u.expression.text)==="dynamic"){let g=u.arguments;if(g.length===0)return null;let m=g[0];if(!e.ts.isArrowFunction(m))return null;let f=m.body;if(e.ts.isCallExpression(f)){if(f.expression.kind!==e.ts.SyntaxKind.ImportKeyword||f.arguments.length!==1)return null;let D=f.arguments[0];if(!e.ts.isStringLiteral(D))return null;let v=D.text,E=await Br(e,v);n.filePath=E,n.relFilePath=e.relative(e.getAppRootDir(),n.filePath),await e.exists(E)?n.importPath=re(e,n.filePath):(n.externalImportPath=v,n.importPath=n.externalImportPath),n.name=Ye(e,n.filePath),n.importName="default",n.exportName="default",n.exportType="default"}else if(e.ts.isPropertyAccessExpression(f)){let h=f.expression;if(!e.ts.isParenthesizedExpression(h))return null;let D=h.expression;if(!e.ts.isAwaitExpression(D))return null;let v=D.expression;if(!e.ts.isCallExpression(v)||v.expression.kind!==e.ts.SyntaxKind.ImportKeyword||v.arguments.length!==1)return null;let P=v.arguments[0];if(!e.ts.isStringLiteral(P)||!e.ts.isIdentifier(f.name))return null;let A=P.text,F=await Br(e,A);n.filePath=F,n.relFilePath=e.relative(e.getAppRootDir(),n.filePath),await e.exists(F)?n.importPath=re(e,n.filePath):(n.externalImportPath=A,n.importPath=n.externalImportPath),n.name=te(f.name.text),n.importName=f.name.text,n.exportName=f.name.text,n.exportType="named"}else return null;return n=Ne(e,n,r),n.displayFilePath=Q(e,n.filePath),n.filePath&&n.exportName&&(n.id=await ee(e,n.filePath,n.exportName,n.externalImportPath)),n}if(e.ts.isIdentifier(u)&&(a=u.text),!a)continue;n.name===""&&(n.name=te(a)),n.importName=a;let c=await Dt(e,e.registryPath,t,a);if(!c)continue;n.filePath=c.filePath,n.relFilePath=c.relFilePath,await e.exists(c.filePath)?n.importPath=re(e,c.filePath):(n.externalImportPath=c.importPath,n.importPath=n.externalImportPath),n.importPath=re(e,c.filePath),n.displayFilePath=c.displayFilePath,n.exportType=c.exportType;let l=t.statements.filter(d=>e.ts.isImportDeclaration(d)),p=l.find(d=>d.importClause&&d.importClause.name?.text===a);if(p){let d=p.moduleSpecifier;if(!e.ts.isStringLiteral(d))return null;n.exportName="default"}else{let d=l.find(m=>!m.importClause||!m.importClause.namedBindings||!e.ts.isNamedImports(m.importClause.namedBindings)?!1:m.importClause.namedBindings.elements.some(f=>f.name.text===a));if(!d)return null;let g=d.moduleSpecifier;if(!e.ts.isStringLiteral(g))return null;n.exportName=a}continue}}return n=Ne(e,n,r),n.filePath&&n.exportName&&(n.id=await ee(e,n.filePath,n.exportName,n.externalImportPath)),n}function xt(e,t){let r=[...t.statements],n=!1;for(let i=t.statements.length-1;i>=0;i--){let s=t.statements[i];if(e.ts.isImportDeclaration(s)&&s.importClause){let o=!1,a=s.importClause.namedBindings;if(a&&e.ts.isNamedImports(a)&&a.elements){let u=[...a.elements];for(let c=u.length-1;c>=0;c--){let l=u[c];if(e.ts.isImportSpecifier(l)){let p=l.name;if(p&&e.ts.isIdentifier(p)){let d=p.text;Uu(e,t,d)||u.splice(c,1)}}}if(u.length===0)o=!0;else if(a.elements.length!==u.length){let c=e.ts.factory.updateImportClause(s.importClause,!1,s.importClause.name,e.ts.factory.createNamedImports(u)),l=e.ts.factory.updateImportDeclaration(s,void 0,c,s.moduleSpecifier,void 0);r[i]=l,n=!0}}else if(s.importClause.name&&e.ts.isIdentifier(s.importClause.name)){let u=s.importClause.name.text;Uu(e,t,u)||(o=!0)}o&&(r.splice(i,1),n=!0)}}return n?e.ts.factory.updateSourceFile(t,r):t}function Uu(e,t,r){let n=!1;function i(s){if(!e.ts.isImportDeclaration(s)){if(e.ts.isIdentifier(s)&&s.text===r){n=!0;return}e.ts.forEachChild(s,i)}}return e.ts.forEachChild(t,i),n}function bt(e,t,r,n,i,s,o){let a=null,u=null,c=null,l=-1;t=Ve(t),r=Ve(r);let p=t.find(g=>g.id===e),d=r.find(g=>g.id===e);if(n)d||(a={...Ve(p),inputs:Ve(p.inputs).map(g=>(g.isRegistered=!0,g))},l=r.length,r.push(a));else if(typeof d?.nodeIndex=="number"&&d.nodeIndex>-1){if(i)l=d.nodeIndex,u=Ve(d),r=r.filter(g=>g.id!==e);else if(s!=null)ih(d,s),l=d.nodeIndex,c=d;else if(o!=null){let g=d.inputs.find(m=>m.name===o.name);g&&(o.registerInput===!1?g.isRegistered=!1:(sh(g,o),g.isRegistered=!0),c=d,l=d.nodeIndex)}}return{addCmpToRegistry:a,removeCmpFromRegistry:u,updateRegisteredCmp:c,nodeIndex:l,components:lt(t,r)}}function lt(e,t){let r=Be([...t.map(n=>(n.isRegistered=!0,n)),...e.filter(n=>!t.some(i=>i.id===n.id)).map(n=>(n.isRegistered=!1,n))]);return r.forEach(n=>{n.inputs=n.inputs.map(wi),n.inputs.sort((o,a)=>o.name.toLowerCase().localeCompare(a.name.toLowerCase()));let i=t.find(o=>o.id===n.id);i&&(i.acceptsChildren=bi(n));let s=e.find(o=>o.id===n.id&&o.externalImportPath);s&&(n.filePath=s.filePath,n.relFilePath=s.relFilePath)}),r}function ih(e,t){Te(t.name)?e.name=t.name:t.name===null&&(e.name=e.importName),Te(t.description)?e.description=t.description:t.description===null&&delete e.description,Te(t.image)?e.image=t.image:t.image===null&&delete e.image}function sh(e,t){Te(t.type)&&(e.type=t.type),Te(t.friendlyName)?e.friendlyName=t.friendlyName:t.friendlyName===null&&delete e.friendlyName,Te(t.defaultValue)||Xr(t.defaultValue)||xr(t.defaultValue)?e.defaultValue=t.defaultValue:t.defaultValue===null&&delete e.defaultValue,Te(t.helperText)?e.helperText=t.helperText:t.helperText===null&&delete e.helperText,t.required===!0?e.required=t.required:(t.required===null||t.required===!1)&&delete e.required}async function Gt(e){let t=new Set,r=async i=>{let s=await e.readdir(i);await Promise.all(s.map(async o=>{if(o.startsWith(".")||o==="node_modules")return;let a=e.join(i,o),u=e.extname(o).toLowerCase();if(u===".tsx"||u===".jsx"||u===".ts"||u===".js"){t.add(a);return}(await e.stat(a)).isDirectory()&&await r(a)}))};return await r(e.getAppRootDir()),await ge(e,[...t])}function wt(e,t,r){return Tr(e,t,r.variableName)?t:ah(e,t,r)}function ah(e,t,r){let n=typeof r.arrayType=="string"?e.ts.factory.createArrayTypeNode(e.ts.factory.createTypeReferenceNode(r.arrayType,void 0)):void 0,i=e.ts.factory.createArrayLiteralExpression([]),s=e.ts.factory.createVariableDeclaration(r.variableName,void 0,n,i),o=e.ts.factory.createVariableDeclarationList([s],e.ts.NodeFlags.Const),a=e.ts.factory.createModifier(e.ts.SyntaxKind.ExportKeyword),u=e.ts.factory.createVariableStatement([a],o),c=[...t.statements,u];return e.ts.factory.updateSourceFile(t,c)}async function vt(e,t,r,n,i,s,o,a){let u=await Gt(e),[c,l,p,d]=await Promise.all([_u(e,u),Mu(e),Re(e),sn(e)]),g=c.map(E=>E.cmpInfo),m=l.components,f={components:lt(g,m),registryPath:e.registryPath,registryDisplayPath:Q(e,e.registryPath),frameworks:e.getFrameworks(),dependencies:et(g),publicApiKey:d.envValue??void 0,devToolsVersion:e.version};if(a)return f.components=await Ir(e,f.components),f;let h=!1,D=l.sourceFile,v=Array.isArray(t)?t:typeof t=="string"?[t]:[];if(v.length>0){let E=v.map(F=>{let T=c.find(k=>k.cmpInfo.id===F);if(!T)throw new Error(`Component ${F} not found`);return T}),P=Array.from(new Set(E.map(F=>F.cmpInfo.filePath))),A=await ge(e,P);for(let F of E){let T=f.components.find(C=>C.id===F.cmpInfo.id),k=await kr(e,F,A,e.registryPath===F.cmpInfo.filePath||He(F.cmpInfo.filePath));Ge(T,k);let I=g.findIndex(C=>C.id===F.cmpInfo.id);g[I].inputs=k;let S=bt(F.cmpInfo.id,g,m,r,n,i,s);if(e.sdkVersion===N.gen2){let{elements:C,elmIndex:$,statementIndex:O,statement:L,variableDeclaration:y}=await lh(e,D,F);if(S.addCmpToRegistry)C.push(ch(e,S.addCmpToRegistry)),h=!0;else if(S.removeCmpFromRegistry)C.splice($,1),h=!0;else if(S.updateRegisteredCmp){let x=he(e,C[$],S.updateRegisteredCmp);C[$]=e.ts.factory.updateObjectLiteralExpression(x,[Vu(e,S.updateRegisteredCmp),...x.properties.slice(1)]),h=!0}if(h&&o){let x=[...D.statements];x[O]=e.ts.factory.updateVariableStatement(L,L.modifiers,e.ts.factory.updateVariableDeclarationList(L.declarationList,[e.ts.factory.updateVariableDeclaration(y,y.name,y.exclamationToken,y.type,e.ts.factory.createArrayLiteralExpression(yt(e,C)))])),D=e.ts.factory.updateSourceFile(D,x),D=Hu(e,S,D),D=q(e,D,{namedImports:["RegisteredComponent"],importPath:"@builder.io/sdk-react",isTypeOnly:!0}),D=wt(e,D,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),f.components=S.components,m=S.components.filter(ue=>ue.isRegistered)}}else{let C=[...D.statements];S.addCmpToRegistry?(C.push(Fu(e,S.addCmpToRegistry)),h=!0):S.removeCmpFromRegistry?(C.splice(S.nodeIndex,1),h=!0):S.updateRegisteredCmp&&(C[S.nodeIndex]=vi(e,C[S.nodeIndex],S.updateRegisteredCmp),h=!0),h&&o&&(D=e.ts.factory.updateSourceFile(D,C),D=q(e,D,{namedImports:["Builder","builder"],importPath:"@builder.io/react"}),D=ju(e,D,p),D=Hu(e,S,D),T?.acceptsChildren&&(D=q(e,D,{namedImports:["withChildren"],importPath:"@builder.io/react"})),f.components=S.components,m=S.components.filter($=>$.isRegistered))}}}if(h&&o){D=xt(e,D),D=Ct(e,D),e.appDir&&(D=Lu(e,D));let E=Ce(e,D);E=ct(E),e.appDir&&(E=Ou(E)),E=await e.formatCode(e.registryPath,E),await e.writeFile(e.registryPath,E)}return f}function Vu(e,t){let r=e.ts.factory.createIdentifier(t.importName);return e.appDir?e.ts.factory.createPropertyAssignment("component",r):e.ts.factory.createPropertyAssignment("component",ph(e,t))}function uh(e){return e.ts.factory.createPropertyAssignment("canHaveChildren",e.ts.factory.createTrue())}function ch(e,t){return he(e,e.ts.factory.createObjectLiteralExpression([Vu(e,t),...t.acceptsChildren?[uh(e)]:[]],!0),t)}async function lh(e,t,r){let n=fe(e,t,"CUSTOM_COMPONENTS");if(!n)throw new Error(`Exported name of the Builder registry must be "CUSTOM_COMPONENTS". Please update your Builder registry file: ${e.registryPath}`);let i=n.arrayLiteralExp.elements.filter(o=>e.ts.isObjectLiteralExpression(o)),s=-1;for(let o=0;o<i.length;o++)if((await Ti(e,t,i[o]))?.id===r.cmpInfo.id){s=o;break}return{...n,elements:i,elmIndex:s}}function Hu(e,t,r){if(e.appDir){let n=t.addCmpToRegistry||t.updateRegisteredCmp;if(n){let i=n.externalImportPath?n.externalImportPath:W(e,e.registryPath,n.filePath);n.exportType==="default"?r=q(e,r,{defaultImport:n.importName,importPath:i}):n.exportType==="named"&&(r=q(e,r,{namedImports:[n.importName],importPath:i}))}}else r=q(e,r,{defaultImport:"dynamic",importPath:"next/dynamic"});return r}function ph(e,t){let r=t.externalImportPath?t.externalImportPath:W(e,e.registryPath,t.filePath),n=t.exportName!=="default",i;n?i=e.ts.factory.createPropertyAccessExpression(e.ts.factory.createAwaitExpression(e.ts.factory.createCallExpression(e.ts.factory.createIdentifier("import"),void 0,[e.ts.factory.createStringLiteral(r)])),e.ts.factory.createIdentifier(t.exportName)):i=e.ts.factory.createCallExpression(e.ts.factory.createIdentifier("import"),void 0,[e.ts.factory.createStringLiteral(r)]);let s=e.ts.factory.createArrowFunction(n?[e.ts.factory.createModifier(e.ts.SyntaxKind.AsyncKeyword)]:void 0,void 0,[],void 0,e.ts.factory.createToken(e.ts.SyntaxKind.EqualsGreaterThanToken),i);return e.ts.factory.createCallExpression(e.ts.factory.createIdentifier("dynamic"),void 0,[s])}async function Gu(e){let t=[],r=await hh(e,t);return await Yu(e,t,r),e.appDir?(e.debug(`ensure builder setup for next.js app ${e.appDir}`),await fh(e,e.appDir,t)):e.pagesDir&&(e.debug(`ensure builder setup for next.js pages ${e.pagesDir}`),await mh(e,e.pagesDir,t)),t}async function Wu(e){let t=[];return await Yu(e,t),e.appDir?(e.debug(`ensure figma-imports setup for next.js app ${e.appDir}`),await dh(e,e.appDir,t)):e.pagesDir&&(e.debug(`ensure figma-imports setup for next.js pages ${e.pagesDir}`),await gh(e,e.pagesDir,t)),t}async function dh(e,t,r){let n=`page.${e.typescriptEnabled?"tsx":"jsx"}`,i=e.join(t,"figma-imports",n);if(!await e.exists(i)){let s=await e.formatCode(i,qu({sys:e,routePath:i,modelName:"figma-imports"}));await e.writeFile(i,s),r.push({filePath:i,modifiedType:"create"})}if(!await e.exists(e.builderComponentPath)){let s=await e.formatCode(e.builderComponentPath,zu(e));await e.writeFile(e.builderComponentPath,s),r.push({filePath:e.builderComponentPath,modifiedType:"create"})}}async function fh(e,t,r){let n=`page.${e.typescriptEnabled?"tsx":"jsx"}`,i=e.join(t,"[...page]",n);if(!await e.exists(i)){let s=await e.formatCode(i,qu({sys:e,routePath:i,modelName:"page"}));await e.writeFile(i,s),r.push({filePath:i,modifiedType:"create"})}if(!await e.exists(e.builderComponentPath)){let s=await e.formatCode(e.builderComponentPath,zu(e));await e.writeFile(e.builderComponentPath,s),r.push({filePath:e.builderComponentPath,modifiedType:"create"})}}function zu(e){let t=e.typescriptEnabled;return e.sdkVersion===N.gen2?`
|
|
303
|
+
`}function li(e,t){return t.sort((r,n)=>{let i=Cu(e,r),s=Cu(e,n);return i.toLocaleLowerCase().localeCompare(s.toLocaleLowerCase())})}function Cu(e,t){let r=t.importClause;if(r){let n=r.namedBindings;if(n&&e.ts.isNamedImports(n)&&n.elements.length>0)return n.elements[0].name.text;if(r.name)return r.name.text}return t.moduleSpecifier&&e.ts.isStringLiteral(t.moduleSpecifier)?t.moduleSpecifier.text:""}function xu(e){return typeof e=="string"&&!e.includes("'use client'")&&!e.includes(`"use client"'`)&&(e=`"use client"
|
|
304
|
+
${e}`),e}function bu(e,t){let r=t.statements.filter(n=>!(e.ts.isExpressionStatement(n)&&e.ts.isStringLiteral(n.expression)&&e.ts.isStringLiteral(n.expression)&&n.expression.text==="use client"));return e.ts.factory.updateSourceFile(t,r)}function wt(e,t){return t.sort((r,n)=>{if(e.ts.isObjectLiteralExpression(r)&&e.ts.isObjectLiteralExpression(n)){let i=yu(e,r),s=yu(e,n);return i.toLocaleLowerCase().localeCompare(s.toLocaleLowerCase())}return 1})}function yu(e,t){let r=t.properties.find(n=>X(e,n)==="name");return r&&e.ts.isPropertyAssignment(r)&&e.ts.isStringLiteral(r.initializer)?r.initializer.text:"zzzz"}async function wu(e){let t=await e.readFile(e.registryPath);return t?sg(e,t):{components:[],sourceFile:G(e,"")}}async function sg(e,t){let r=G(e,t);return e.sdkVersion===N.gen2?ug(e,r):ag(e,r)}async function ag(e,t){let r=[];for(let n=0;n<t.statements.length;n++){let i=t.statements[n];if(!e.ts.isExpressionStatement(i))continue;let s=i.expression;if(!e.ts.isCallExpression(s))continue;let o=s.expression;if(!e.ts.isPropertyAccessExpression(o))continue;let a=o.expression;if(!e.ts.isIdentifier(a)||a.text!=="Builder"||o.name.text!=="registerComponent")continue;let c=s.arguments;if(c.length<2)continue;let l=c[1];if(!e.ts.isObjectLiteralExpression(l))continue;let p=c[0];if(e.ts.isCallExpression(p)){let d=e.ts.isIdentifier(p.expression)&&p.expression.text;if(d==="withChildren"){let m=fi(e,p.arguments[0]);if(e.ts.isCallExpression(m)){let f=await pi(e,n,m,l,!0);f&&r.push(f)}else{let f=m;if(e.ts.isIdentifier(f)){let g=await di(e,t,n,f,l,!0);g&&r.push(g)}}continue}if(d==="dynamic"){let m=await pi(e,n,p,l,!1);m&&r.push(m);continue}let D=fi(e,p.arguments[0]);if(e.ts.isCallExpression(D)&&e.ts.isIdentifier(D.expression)&&D.expression.text==="dynamic"){let m=await pi(e,n,D,l,!1);m&&r.push(m);continue}if(e.ts.isIdentifier(D)){let m=await di(e,t,n,D,l,!1);m&&r.push(m);continue}continue}if(e.ts.isIdentifier(p)){let d=await di(e,t,n,p,l,!1);d&&r.push(d);continue}}return{sourceFile:t,components:$e(r)}}function fi(e,t){return e.ts.isCallExpression(t)?(e.ts.isIdentifier(t.expression)&&t.expression.text)==="dynamic"?t:fi(e,t.arguments[0]):t}async function pi(e,t,r,n,i){let s={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],nodeIndex:t,acceptsChildren:i,framework:"react"},o=r.arguments;if(o.length===0)return null;let a=o[0];if(!e.ts.isArrowFunction(a))return null;let u=a.body;if(e.ts.isCallExpression(u)){if(u.expression.kind!==e.ts.SyntaxKind.ImportKeyword||u.arguments.length!==1)return null;let l=u.arguments[0];if(!e.ts.isStringLiteral(l))return null;let p=l.text,d=await $r(e,p);s.filePath=d,s.relFilePath=e.relative(e.getAppRootDir(),s.filePath),await e.exists(d)?s.importPath=te(e,s.filePath):(s.externalImportPath=p,s.importPath=s.externalImportPath),s.name=Xe(e,s.filePath),s.importName="default",s.exportName="default",s.exportType="default"}else if(e.ts.isPropertyAccessExpression(u)){let c=u.expression;if(!e.ts.isParenthesizedExpression(c))return null;let l=c.expression;if(!e.ts.isAwaitExpression(l))return null;let p=l.expression;if(!e.ts.isCallExpression(p)||p.expression.kind!==e.ts.SyntaxKind.ImportKeyword||p.arguments.length!==1)return null;let D=p.arguments[0];if(!e.ts.isStringLiteral(D)||!e.ts.isIdentifier(u.name))return null;let m=D.text,f=await $r(e,m);s.filePath=f,s.relFilePath=e.relative(e.getAppRootDir(),s.filePath),await e.exists(f)?s.importPath=te(e,s.filePath):(s.externalImportPath=m,s.importPath=s.externalImportPath),s.name=ee(u.name.text),s.importName=u.name.text,s.exportName=u.name.text,s.exportType="named"}else return null;return s=Oe(e,s,n),s.displayFilePath=Y(e,s.filePath),s.filePath&&s.exportName&&(s.id=await Z(e,s.filePath,s.exportName,s.externalImportPath)),s}async function di(e,t,r,n,i,s){let o={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],nodeIndex:r,acceptsChildren:s,framework:"react"},a=t.statements.filter(c=>e.ts.isImportDeclaration(c)),u=a.find(c=>c.importClause&&c.importClause.name?.text===n.text);if(u){let c=u.moduleSpecifier;if(!e.ts.isStringLiteral(c))return null;let l=await $r(e,c.text);o.filePath=l,o.relFilePath=e.relative(e.getAppRootDir(),o.filePath),await e.exists(l)?o.importPath=te(e,o.filePath):(o.externalImportPath=c.text,o.importPath=o.externalImportPath),o.name=Xe(e,o.filePath),o.importName=n.text,o.exportName="default",o.exportType="default"}else{let c=a.find(d=>!d.importClause||!d.importClause.namedBindings||!e.ts.isNamedImports(d.importClause.namedBindings)?!1:d.importClause.namedBindings.elements.some(D=>D.name.text===n.text));if(!c)return null;let l=c.moduleSpecifier;if(!e.ts.isStringLiteral(l))return null;let p=await $r(e,l.text);o.filePath=p,o.relFilePath=e.relative(e.getAppRootDir(),o.filePath),await e.exists(p)?o.importPath=te(e,o.filePath):(o.externalImportPath=l.text,o.importPath=o.externalImportPath),o.name=ee(n.text),o.importName=n.text,o.exportName=n.text,o.exportType="named"}return o=Oe(e,o,i),o.displayFilePath=Y(e,o.filePath),o.filePath&&o.exportName&&(o.id=await Z(e,o.filePath,o.exportName,o.externalImportPath)),o}function $r(e,t){return on(e,e.normalize(e.resolve(e.dirname(e.registryPath),t)))}function Eu(e,t,r){let n=!1,i=0,s=[...t.statements];for(let c=0;c<s.length;c++){let l=s[c];if(e.ts.isImportDeclaration(l)){i=c;continue}if(!e.ts.isExpressionStatement(l))continue;let p=l.expression;if(!e.ts.isCallExpression(p))continue;let d=p.expression;if(!e.ts.isPropertyAccessExpression(d))continue;let D=d.expression;if(!e.ts.isIdentifier(D)||D.text!=="builder")continue;if(d.name.text=="init"){n=!0;break}else continue}if(n)return t;let o=e.ts.factory.createPropertyAccessExpression(e.ts.factory.createPropertyAccessExpression(e.ts.factory.createIdentifier("process"),e.ts.factory.createIdentifier("env")),e.ts.factory.createIdentifier(yt)),a=r?e.ts.factory.createNonNullExpression(o):o,u=e.ts.factory.createExpressionStatement(e.ts.factory.createCallExpression(e.ts.factory.createPropertyAccessExpression(e.ts.factory.createIdentifier("builder"),e.ts.factory.createIdentifier("init")),void 0,[a]));return s.splice(i+1,0,u),e.ts.factory.updateSourceFile(t,s)}async function ug(e,t){let r=[],n=fe(e,t,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(i,s)=>{let o=await mi(e,t,i);o&&(o.nodeIndex=s,r.push(o))})),{sourceFile:t,components:$e(r)}}async function mi(e,t,r){if(!e.ts.isObjectLiteralExpression(r))return null;let n={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],acceptsChildren:!1,framework:"react"};Tr(e,r)&&(n.acceptsChildren=!0);for(let s of r.properties){if(!e.ts.isPropertyAssignment(s)||!e.ts.isIdentifier(s.name))continue;if(X(e,s)==="component"){let a,{initializer:u}=s;if(e.ts.isCallExpression(u)&&(e.ts.isIdentifier(u.expression)&&u.expression.text)==="dynamic"){let D=u.arguments;if(D.length===0)return null;let m=D[0];if(!e.ts.isArrowFunction(m))return null;let f=m.body;if(e.ts.isCallExpression(f)){if(f.expression.kind!==e.ts.SyntaxKind.ImportKeyword||f.arguments.length!==1)return null;let h=f.arguments[0];if(!e.ts.isStringLiteral(h))return null;let E=h.text,v=await $r(e,E);n.filePath=v,n.relFilePath=e.relative(e.getAppRootDir(),n.filePath),await e.exists(v)?n.importPath=te(e,n.filePath):(n.externalImportPath=E,n.importPath=n.externalImportPath),n.name=Xe(e,n.filePath),n.importName="default",n.exportName="default",n.exportType="default"}else if(e.ts.isPropertyAccessExpression(f)){let g=f.expression;if(!e.ts.isParenthesizedExpression(g))return null;let h=g.expression;if(!e.ts.isAwaitExpression(h))return null;let E=h.expression;if(!e.ts.isCallExpression(E)||E.expression.kind!==e.ts.SyntaxKind.ImportKeyword||E.arguments.length!==1)return null;let P=E.arguments[0];if(!e.ts.isStringLiteral(P)||!e.ts.isIdentifier(f.name))return null;let A=P.text,F=await $r(e,A);n.filePath=F,n.relFilePath=e.relative(e.getAppRootDir(),n.filePath),await e.exists(F)?n.importPath=te(e,n.filePath):(n.externalImportPath=A,n.importPath=n.externalImportPath),n.name=ee(f.name.text),n.importName=f.name.text,n.exportName=f.name.text,n.exportType="named"}else return null;return n=Oe(e,n,r),n.displayFilePath=Y(e,n.filePath),n.filePath&&n.exportName&&(n.id=await Z(e,n.filePath,n.exportName,n.externalImportPath)),n}if(e.ts.isIdentifier(u)&&(a=u.text),!a)continue;n.name===""&&(n.name=ee(a)),n.importName=a;let c=await xt(e,e.registryPath,t,a);if(!c)continue;n.filePath=c.filePath,n.relFilePath=c.relFilePath,await e.exists(c.filePath)?n.importPath=te(e,c.filePath):(n.externalImportPath=c.importPath,n.importPath=n.externalImportPath),n.importPath=te(e,c.filePath),n.displayFilePath=c.displayFilePath,n.exportType=c.exportType;let l=t.statements.filter(d=>e.ts.isImportDeclaration(d)),p=l.find(d=>d.importClause&&d.importClause.name?.text===a);if(p){let d=p.moduleSpecifier;if(!e.ts.isStringLiteral(d))return null;n.exportName="default"}else{let d=l.find(m=>!m.importClause||!m.importClause.namedBindings||!e.ts.isNamedImports(m.importClause.namedBindings)?!1:m.importClause.namedBindings.elements.some(f=>f.name.text===a));if(!d)return null;let D=d.moduleSpecifier;if(!e.ts.isStringLiteral(D))return null;n.exportName=a}continue}}return n=Oe(e,n,r),n.filePath&&n.exportName&&(n.id=await Z(e,n.filePath,n.exportName,n.externalImportPath)),n}function Et(e,t){let r=[...t.statements],n=!1;for(let i=t.statements.length-1;i>=0;i--){let s=t.statements[i];if(e.ts.isImportDeclaration(s)&&s.importClause){let o=!1,a=s.importClause.namedBindings;if(a&&e.ts.isNamedImports(a)&&a.elements){let u=[...a.elements];for(let c=u.length-1;c>=0;c--){let l=u[c];if(e.ts.isImportSpecifier(l)){let p=l.name;if(p&&e.ts.isIdentifier(p)){let d=p.text;vu(e,t,d)||u.splice(c,1)}}}if(u.length===0)o=!0;else if(a.elements.length!==u.length){let c=e.ts.factory.updateImportClause(s.importClause,!1,s.importClause.name,e.ts.factory.createNamedImports(u)),l=e.ts.factory.updateImportDeclaration(s,void 0,c,s.moduleSpecifier,void 0);r[i]=l,n=!0}}else if(s.importClause.name&&e.ts.isIdentifier(s.importClause.name)){let u=s.importClause.name.text;vu(e,t,u)||(o=!0)}o&&(r.splice(i,1),n=!0)}}return n?e.ts.factory.updateSourceFile(t,r):t}function vu(e,t,r){let n=!1;function i(s){if(!e.ts.isImportDeclaration(s)){if(e.ts.isIdentifier(s)&&s.text===r){n=!0;return}e.ts.forEachChild(s,i)}}return e.ts.forEachChild(t,i),n}function vt(e,t,r,n,i,s,o){let a=null,u=null,c=null,l=-1;t=Ke(t),r=Ke(r);let p=t.find(D=>D.id===e),d=r.find(D=>D.id===e);if(n)d||(a={...Ke(p),inputs:Ke(p.inputs).map(D=>(D.isRegistered=!0,D))},l=r.length,r.push(a));else if(typeof d?.nodeIndex=="number"&&d.nodeIndex>-1){if(i)l=d.nodeIndex,u=Ke(d),r=r.filter(D=>D.id!==e);else if(s!=null)cg(d,s),l=d.nodeIndex,c=d;else if(o!=null){let D=d.inputs.find(m=>m.name===o.name);D&&(o.registerInput===!1?D.isRegistered=!1:(lg(D,o),D.isRegistered=!0),c=d,l=d.nodeIndex)}}return{addCmpToRegistry:a,removeCmpFromRegistry:u,updateRegisteredCmp:c,nodeIndex:l,components:ft(t,r)}}function ft(e,t){let r=$e([...t.map(n=>(n.isRegistered=!0,n)),...e.filter(n=>!t.some(i=>i.id===n.id)).map(n=>(n.isRegistered=!1,n))]);return r.forEach(n=>{n.inputs=n.inputs.map(ai),n.inputs.sort((o,a)=>o.name.toLowerCase().localeCompare(a.name.toLowerCase()));let i=t.find(o=>o.id===n.id);i&&(i.acceptsChildren=si(n));let s=e.find(o=>o.id===n.id&&o.externalImportPath);s&&(n.filePath=s.filePath,n.relFilePath=s.relFilePath)}),r}function cg(e,t){Re(t.name)?e.name=t.name:t.name===null&&(e.name=e.importName),Re(t.description)?e.description=t.description:t.description===null&&delete e.description,Re(t.image)?e.image=t.image:t.image===null&&delete e.image}function lg(e,t){Re(t.type)&&(e.type=t.type),Re(t.friendlyName)?e.friendlyName=t.friendlyName:t.friendlyName===null&&delete e.friendlyName,Re(t.defaultValue)||qr(t.defaultValue)||br(t.defaultValue)?e.defaultValue=t.defaultValue:t.defaultValue===null&&delete e.defaultValue,Re(t.helperText)?e.helperText=t.helperText:t.helperText===null&&delete e.helperText,t.required===!0?e.required=t.required:(t.required===null||t.required===!1)&&delete e.required}async function zt(e){let t=new Set,r=async i=>{let s=await e.readdir(i);await Promise.all(s.map(async o=>{if(o.startsWith(".")||o==="node_modules")return;let a=e.join(i,o),u=e.extname(o).toLowerCase();if(u===".tsx"||u===".jsx"||u===".ts"||u===".js"){t.add(a);return}(await e.stat(a)).isDirectory()&&await r(a)}))};return await r(e.getAppRootDir()),await ge(e,[...t])}function St(e,t,r){return Rr(e,t,r.variableName)?t:pg(e,t,r)}function pg(e,t,r){let n=typeof r.arrayType=="string"?e.ts.factory.createArrayTypeNode(e.ts.factory.createTypeReferenceNode(r.arrayType,void 0)):void 0,i=e.ts.factory.createArrayLiteralExpression([]),s=e.ts.factory.createVariableDeclaration(r.variableName,void 0,n,i),o=e.ts.factory.createVariableDeclarationList([s],e.ts.NodeFlags.Const),a=e.ts.factory.createModifier(e.ts.SyntaxKind.ExportKeyword),u=e.ts.factory.createVariableStatement([a],o),c=[...t.statements,u];return e.ts.factory.updateSourceFile(t,c)}async function Ft(e,t,r,n,i,s,o,a){let u=await zt(e),[c,l,p,d]=await Promise.all([Du(e,u),wu(e),Ie(e),tn(e)]),D=c.map(v=>v.cmpInfo),m=l.components,f={components:ft(D,m),registryPath:e.registryPath,registryDisplayPath:Y(e,e.registryPath),frameworks:e.getFrameworks(),dependencies:rt(D),publicApiKey:d.envValue??void 0,devToolsVersion:e.version};if(a)return f.components=await kr(e,f.components),f;let g=!1,h=l.sourceFile,E=Array.isArray(t)?t:typeof t=="string"?[t]:[];if(E.length>0){let v=E.map(F=>{let T=c.find(k=>k.cmpInfo.id===F);if(!T)throw new Error(`Component ${F} not found`);return T}),P=Array.from(new Set(v.map(F=>F.cmpInfo.filePath))),A=await ge(e,P);for(let F of v){let T=f.components.find(C=>C.id===F.cmpInfo.id),k=await Br(e,F,A,e.registryPath===F.cmpInfo.filePath||He(F.cmpInfo.filePath));We(T,k);let I=D.findIndex(C=>C.id===F.cmpInfo.id);D[I].inputs=k;let S=vt(F.cmpInfo.id,D,m,r,n,i,s);if(e.sdkVersion===N.gen2){let{elements:C,elmIndex:$,statementIndex:O,statement:L,variableDeclaration:y}=await mg(e,h,F);if(S.addCmpToRegistry)C.push(fg(e,S.addCmpToRegistry)),g=!0;else if(S.removeCmpFromRegistry)C.splice($,1),g=!0;else if(S.updateRegisteredCmp){let x=he(e,C[$],S.updateRegisteredCmp);C[$]=e.ts.factory.updateObjectLiteralExpression(x,[Fu(e,S.updateRegisteredCmp),...x.properties.slice(1)]),g=!0}if(g&&o){let x=[...h.statements];x[O]=e.ts.factory.updateVariableStatement(L,L.modifiers,e.ts.factory.updateVariableDeclarationList(L.declarationList,[e.ts.factory.updateVariableDeclaration(y,y.name,y.exclamationToken,y.type,e.ts.factory.createArrayLiteralExpression(wt(e,C)))])),h=e.ts.factory.updateSourceFile(h,x),h=Su(e,S,h),h=z(e,h,{namedImports:["RegisteredComponent"],importPath:"@builder.io/sdk-react",isTypeOnly:!0}),h=St(e,h,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),f.components=S.components,m=S.components.filter(ue=>ue.isRegistered)}}else{let C=[...h.statements];S.addCmpToRegistry?(C.push(cu(e,S.addCmpToRegistry)),g=!0):S.removeCmpFromRegistry?(C.splice(S.nodeIndex,1),g=!0):S.updateRegisteredCmp&&(C[S.nodeIndex]=ui(e,C[S.nodeIndex],S.updateRegisteredCmp),g=!0),g&&o&&(h=e.ts.factory.updateSourceFile(h,C),h=z(e,h,{namedImports:["Builder","builder"],importPath:"@builder.io/react"}),h=Eu(e,h,p),h=Su(e,S,h),T?.acceptsChildren&&(h=z(e,h,{namedImports:["withChildren"],importPath:"@builder.io/react"})),f.components=S.components,m=S.components.filter($=>$.isRegistered))}}}if(g&&o){h=Et(e,h),h=bt(e,h),e.appDir&&(h=bu(e,h));let v=De(e,h);v=dt(v),e.appDir&&(v=xu(v)),v=await e.formatCode(e.registryPath,v),await e.writeFile(e.registryPath,v)}return f}function Fu(e,t){let r=e.ts.factory.createIdentifier(t.importName);return e.appDir?e.ts.factory.createPropertyAssignment("component",r):e.ts.factory.createPropertyAssignment("component",gg(e,t))}function dg(e){return e.ts.factory.createPropertyAssignment("canHaveChildren",e.ts.factory.createTrue())}function fg(e,t){return he(e,e.ts.factory.createObjectLiteralExpression([Fu(e,t),...t.acceptsChildren?[dg(e)]:[]],!0),t)}async function mg(e,t,r){let n=fe(e,t,"CUSTOM_COMPONENTS");if(!n)throw new Error(`Exported name of the Builder registry must be "CUSTOM_COMPONENTS". Please update your Builder registry file: ${e.registryPath}`);let i=n.arrayLiteralExp.elements.filter(o=>e.ts.isObjectLiteralExpression(o)),s=-1;for(let o=0;o<i.length;o++)if((await mi(e,t,i[o]))?.id===r.cmpInfo.id){s=o;break}return{...n,elements:i,elmIndex:s}}function Su(e,t,r){if(e.appDir){let n=t.addCmpToRegistry||t.updateRegisteredCmp;if(n){let i=n.externalImportPath?n.externalImportPath:W(e,e.registryPath,n.filePath);n.exportType==="default"?r=z(e,r,{defaultImport:n.importName,importPath:i}):n.exportType==="named"&&(r=z(e,r,{namedImports:[n.importName],importPath:i}))}}else r=z(e,r,{defaultImport:"dynamic",importPath:"next/dynamic"});return r}function gg(e,t){let r=t.externalImportPath?t.externalImportPath:W(e,e.registryPath,t.filePath),n=t.exportName!=="default",i;n?i=e.ts.factory.createPropertyAccessExpression(e.ts.factory.createAwaitExpression(e.ts.factory.createCallExpression(e.ts.factory.createIdentifier("import"),void 0,[e.ts.factory.createStringLiteral(r)])),e.ts.factory.createIdentifier(t.exportName)):i=e.ts.factory.createCallExpression(e.ts.factory.createIdentifier("import"),void 0,[e.ts.factory.createStringLiteral(r)]);let s=e.ts.factory.createArrowFunction(n?[e.ts.factory.createModifier(e.ts.SyntaxKind.AsyncKeyword)]:void 0,void 0,[],void 0,e.ts.factory.createToken(e.ts.SyntaxKind.EqualsGreaterThanToken),i);return e.ts.factory.createCallExpression(e.ts.factory.createIdentifier("dynamic"),void 0,[s])}async function Pu(e){let t=[],r=await xg(e,t);return await Bu(e,t,r),e.appDir?(e.debug(`ensure builder setup for next.js app ${e.appDir}`),await Dg(e,e.appDir,t)):e.pagesDir&&(e.debug(`ensure builder setup for next.js pages ${e.pagesDir}`),await Cg(e,e.pagesDir,t)),t}async function Tu(e){let t=[];return await Bu(e,t),e.appDir?(e.debug(`ensure figma-imports setup for next.js app ${e.appDir}`),await hg(e,e.appDir,t)):e.pagesDir&&(e.debug(`ensure figma-imports setup for next.js pages ${e.pagesDir}`),await yg(e,e.pagesDir,t)),t}async function hg(e,t,r){let n=`page.${e.typescriptEnabled?"tsx":"jsx"}`,i=e.join(t,"figma-imports",n);if(!await e.exists(i)){let s=await e.formatCode(i,Iu({sys:e,routePath:i,modelName:"figma-imports"}));await e.writeFile(i,s),r.push({filePath:i,modifiedType:"create"})}if(!await e.exists(e.builderComponentPath)){let s=await e.formatCode(e.builderComponentPath,Ru(e));await e.writeFile(e.builderComponentPath,s),r.push({filePath:e.builderComponentPath,modifiedType:"create"})}}async function Dg(e,t,r){let n=`page.${e.typescriptEnabled?"tsx":"jsx"}`,i=e.join(t,"[...page]",n);if(!await e.exists(i)){let s=await e.formatCode(i,Iu({sys:e,routePath:i,modelName:"page"}));await e.writeFile(i,s),r.push({filePath:i,modifiedType:"create"})}if(!await e.exists(e.builderComponentPath)){let s=await e.formatCode(e.builderComponentPath,Ru(e));await e.writeFile(e.builderComponentPath,s),r.push({filePath:e.builderComponentPath,modifiedType:"create"})}}function Ru(e){let t=e.typescriptEnabled;return e.sdkVersion===N.gen2?`
|
|
305
305
|
"use client";
|
|
306
306
|
import { ${t?"BuilderContent, ":""} isPreviewing, Content } from "@builder.io/sdk-react";
|
|
307
307
|
import DefaultErrorPage from "next/error";
|
|
@@ -313,7 +313,7 @@ interface BuilderPageProps {
|
|
|
313
313
|
}`:""}
|
|
314
314
|
|
|
315
315
|
// Builder Public API Key set in .env file
|
|
316
|
-
const builderApiKey = process.env.${
|
|
316
|
+
const builderApiKey = process.env.${yt}${t?"!":""};
|
|
317
317
|
|
|
318
318
|
export function RenderBuilderContent({ content, model }${t?": BuilderPageProps":""}) {
|
|
319
319
|
// Call the isPreviewing hook to determine if
|
|
@@ -344,7 +344,7 @@ ${t?`
|
|
|
344
344
|
type BuilderPageProps = ComponentProps<typeof BuilderComponent>;`:""}
|
|
345
345
|
|
|
346
346
|
// Builder Public API Key set in .env file
|
|
347
|
-
builder.init(process.env.${
|
|
347
|
+
builder.init(process.env.${yt}${t?"!":""});
|
|
348
348
|
|
|
349
349
|
export function RenderBuilderContent({ content, model }${t?": BuilderPageProps":""}) {
|
|
350
350
|
// Call the useIsPreviewing hook to determine if
|
|
@@ -360,7 +360,7 @@ export function RenderBuilderContent({ content, model }${t?": BuilderPageProps":
|
|
|
360
360
|
// DefaultErrorPage with a 404.
|
|
361
361
|
return <DefaultErrorPage statusCode={404} />;
|
|
362
362
|
}
|
|
363
|
-
`.trimStart()}function
|
|
363
|
+
`.trimStart()}function Au(e){return e.features.asyncParams?`
|
|
364
364
|
interface PageProps {
|
|
365
365
|
params: Promise<{
|
|
366
366
|
page: string[];
|
|
@@ -370,14 +370,14 @@ interface PageProps {
|
|
|
370
370
|
params: {
|
|
371
371
|
page: string[];
|
|
372
372
|
};
|
|
373
|
-
}`}function
|
|
373
|
+
}`}function Iu({sys:e,routePath:t,modelName:r}){let n=e.typescriptEnabled,i=W(e,t,e.builderComponentPath);return e.sdkVersion===N.gen2?`
|
|
374
374
|
import { fetchOneEntry } from "@builder.io/sdk-react";
|
|
375
375
|
import { RenderBuilderContent } from ${JSON.stringify(i)};
|
|
376
376
|
|
|
377
377
|
// Builder Public API Key set in .env file
|
|
378
|
-
const PUBLIC_API_KEY = process.env.${
|
|
378
|
+
const PUBLIC_API_KEY = process.env.${yt}${n?"!":""};
|
|
379
379
|
|
|
380
|
-
${n?
|
|
380
|
+
${n?Au(e):""}
|
|
381
381
|
|
|
382
382
|
export default async function Page(props${n?": PageProps":""}) {
|
|
383
383
|
const builderModelName = "${r}";
|
|
@@ -404,8 +404,8 @@ import { builder } from "@builder.io/sdk";
|
|
|
404
404
|
import { RenderBuilderContent } from ${JSON.stringify(i)};
|
|
405
405
|
|
|
406
406
|
// Builder Public API Key set in .env file
|
|
407
|
-
builder.init(process.env.${
|
|
408
|
-
${n?
|
|
407
|
+
builder.init(process.env.${yt}${n?"!":""});
|
|
408
|
+
${n?Au(e):""}
|
|
409
409
|
|
|
410
410
|
export default async function Page(props${n?": PageProps":""}) {
|
|
411
411
|
const builderModelName = "${r}";
|
|
@@ -428,7 +428,7 @@ export default async function Page(props${n?": PageProps":""}) {
|
|
|
428
428
|
</>
|
|
429
429
|
);
|
|
430
430
|
}
|
|
431
|
-
`.trimStart()}async function
|
|
431
|
+
`.trimStart()}async function Cg(e,t,r){let n=`[...page].${e.typescriptEnabled?"tsx":"jsx"}`,i=e.join(t,n);if(!await e.exists(i)){let s=await e.formatCode(i,ku({sys:e,routePath:i,modelName:"page"}));await e.writeFile(i,s),r.push({filePath:i,modifiedType:"create"})}}async function yg(e,t,r){let n=`figma-imports.${e.typescriptEnabled?"tsx":"jsx"}`,i=e.join(t,n);if(!await e.exists(i)){let s=await e.formatCode(i,ku({sys:e,routePath:i,modelName:"figma-imports"}));await e.writeFile(i,s),r.push({filePath:i,modifiedType:"create"})}}function ku({sys:e,routePath:t,modelName:r}){let n=e.typescriptEnabled;return e.sdkVersion===N.gen2?`
|
|
432
432
|
import React from "react";
|
|
433
433
|
import { useRouter } from "next/router";
|
|
434
434
|
${n?'import type { BuilderContent } from "@builder.io/sdk-react";':""}
|
|
@@ -443,7 +443,7 @@ import Head from "next/head";
|
|
|
443
443
|
${n?'import { GetStaticProps } from "next";':""}
|
|
444
444
|
import { CUSTOM_COMPONENTS } from ${JSON.stringify(W(e,e.builderComponentPath,e.registryPath))};
|
|
445
445
|
|
|
446
|
-
const BUILDER_API_KEY = process.env.${
|
|
446
|
+
const BUILDER_API_KEY = process.env.${yt}${n?"!":""};
|
|
447
447
|
|
|
448
448
|
// Define a function that fetches the Builder
|
|
449
449
|
// content for a given page
|
|
@@ -527,7 +527,7 @@ import { BuilderContent } from "@builder.io/sdk";`:""}${n?`
|
|
|
527
527
|
import { GetStaticProps } from "next";`:""}
|
|
528
528
|
import ${JSON.stringify(W(e,t,e.registryPath))};
|
|
529
529
|
|
|
530
|
-
builder.init(process.env.${
|
|
530
|
+
builder.init(process.env.${yt}${n?"!":""});
|
|
531
531
|
|
|
532
532
|
// Define a function that fetches the Builder
|
|
533
533
|
// content for a given page
|
|
@@ -592,7 +592,7 @@ export default function Page({ page }${n?": { page: BuilderContent | null }":""}
|
|
|
592
592
|
</>
|
|
593
593
|
);
|
|
594
594
|
}
|
|
595
|
-
`.trimStart()}async function
|
|
595
|
+
`.trimStart()}async function xg(e,t){let n=e.typescriptEnabled?"tsx":"jsx",i=e.join(e.componentsDir,"Counter"),s=e.join(i,`Counter.${n}`),o=e.join(i,"styles.module.css"),{component:a,styles:u}=bg(e);if(!await e.exists(s)){let c=await e.formatCode(s,a);await e.writeFile(s,c),t.push({filePath:s,modifiedType:"create"})}return await e.exists(o)||(await e.writeFile(o,u),t.push({filePath:o,modifiedType:"create"})),s}function bg(e){let t=e.typescriptEnabled,r=`
|
|
596
596
|
"use client"
|
|
597
597
|
import React, { useState } from "react";
|
|
598
598
|
import styles from "./styles.module.css";
|
|
@@ -655,18 +655,18 @@ export default Counter;
|
|
|
655
655
|
font-size: 42px;
|
|
656
656
|
text-align: center;
|
|
657
657
|
}
|
|
658
|
-
`.trimStart();return{component:r,styles:n}}async function
|
|
658
|
+
`.trimStart();return{component:r,styles:n}}async function Bu(e,t,r){if(!await e.exists(e.registryPath)){if(e.sdkVersion===N.gen2){let s=wg(e);await e.writeFile(e.registryPath,s)}else await e.writeFile(e.registryPath,"");t.push({filePath:e.registryPath,modifiedType:"create"})}if(!r)return;let i=(await Ft(e,null,!1,!1,null,null,!1,!1)).components.find(s=>s.filePath===r);i&&await Ft(e,i.id,!0,!1,null,null,!0,!1)}function wg(e){return e.typescriptEnabled?`import type { RegisteredComponent } from "@builder.io/sdk-react";
|
|
659
659
|
|
|
660
660
|
export const CUSTOM_COMPONENTS: RegisteredComponent[] = [
|
|
661
661
|
];`:`export const CUSTOM_COMPONENTS = [
|
|
662
662
|
];
|
|
663
|
-
`}async function _r(e){let t=await
|
|
663
|
+
`}async function _r(e){let t=await Gt(e,e.getRepoRootDir());if(t&&typeof t=="object"){let r=new Set(Object.keys({...t.dependencies,...t.devDependencies}));if(r.has("@builder.io/sdk-react"))return N.gen2;if(r.has("@builder.io/react"))return N.gen1}return null}async function $u(e){let t=await Eg(e);return{builderPageOptions:async()=>({templateContentId:"3de2f13211234071a4b19a17b4fbc5a7",pathname:"/builder-demo",title:"Builder + Next.js Demo Page"}),ensureBuilderSetup:()=>Pu(t),ensureFigmaImportPage:()=>Tu(t),getRegistryPath:()=>t.registryPath,getRegistry:n=>Ft(t,null,!1,!1,null,null,!1,!!n?.readAllInputTypes),addExternalPackage:n=>{t.addExternalPackage(n)},loadComponent:async n=>{let i=await Ft(t,n.cmpId,!1,!1,null,null,!1,!1);return{...i,component:i.components.find(s=>s.id===n.cmpId)}},registerComponent:n=>Ft(t,n.cmpId,!0,!1,null,null,!0,!1),setRegisteredComponentInfo:n=>Ft(t,n.cmpId,!1,!1,n,null,!0,!1),setRegisteredComponentInput:n=>Ft(t,n.cmpId,!1,!1,null,n,!0,!1),unregisterComponent:n=>Ft(t,n.cmpId,!1,!0,null,null,!0,!1),getPublicApiKey:()=>tn(t),setPublicApiKey:n=>nu(t,n.publicApiKey),getDependencies:n=>n.sdkVersion===N.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:()=>et(t),setCache:n=>tt(t,n)}}async function Eg(e){let t=e.getAppRootDir(),r=e.join(t,"src"),n=await vg(e),i=await Ie(e),s=e.getFrameworks().find(c=>c.name==="next"),o={asyncParams:s?.version?.major!==void 0&&s.version.major>=15},a={},u={...e,addExternalPackage:c=>{a[e.join(t,c,"index.ts")]=`export * from "${c}";`},readFileSync:c=>a[c]??e.readFileSync(c),existsSync:c=>!!a[c]||e.existsSync(c),readdirSync:c=>{let l=e.readdirSync(c);return c===t?[...l,...Object.keys(a).map(p=>p.slice(t.length+1))]:l},readdir:async c=>{let l=await e.readdir(c);return c===t?[...l,...Object.keys(a).map(p=>p.slice(t.length+1))]:l},appDir:null,pagesDir:null,srcDir:null,builderComponentPath:"",componentsDir:"",registryPath:"",nextConfigPath:n,typescriptEnabled:i,features:o};if(e.sdkVersion?u.sdkVersion=e.sdkVersion:u.sdkVersion=await _r(u),await e.exists(r)){u.srcDir=r,u.componentsDir=e.join(r,"components");let c=e.join(r,"app");await e.exists(c)&&(u.appDir=c);let l=e.join(r,"pages");await e.exists(l)&&(u.pagesDir=l),u.registryPath=await Ne(e,r)}else u.componentsDir=e.join(t,"components"),u.registryPath=await Ne(e,t);if(u.builderComponentPath=e.join(u.componentsDir,`builder.${i?"tsx":"jsx"}`),!u.appDir){let c=e.join(t,"app");await e.exists(c)&&(u.appDir=c)}if(!u.pagesDir){let c=e.join(t,"pages");await e.exists(c)&&(u.pagesDir=c)}if(!u.appDir&&!u.pagesDir&&!e.ignoreMissingConfig)throw new Error(`Could not find Next.js "app" or "pages" directory. Searched in "${t}".`);return u}async function vg(e){let t=e.join(e.getAppRootDir(),"next.config.ts");if(await e.exists(t))return t;let r=e.join(e.getAppRootDir(),"next.config.mjs");if(await e.exists(r))return r;let n=e.join(e.getAppRootDir(),"next.config.js");if(await e.exists(n))return n;throw new Error(`Could not find Next.js config file. Searched for "next.config.ts", "next.config.mjs" and "next.config.js" in "${e.getAppRootDir()}".`)}async function sn(e){return await Dt(e,[".env"],Nu)}async function _u(e,t){Sg(t);let r=await sn(e),n=await Ct(e,r.file,r.envKey,t);return{...r,modifiedType:n}}function Sg(e){typeof process<"u"&&(process.env[Nu]=e)}var Nu="PUBLIC_BUILDER_API_KEY";function Ou(e,t,r){if(r.length===0)return e;let n=e.split(`
|
|
664
664
|
`),i=n.findIndex(a=>a.includes(r));if(i===-1||n.some(a=>a.includes(t[0])))return e;let o=["/**",...t.map(a=>` * ${a.trim()}`)," */"];return n.splice(i,0,...o),n.join(`
|
|
665
|
-
`)}async function
|
|
665
|
+
`)}async function Mu(e,t){let r=[],n=t.getSourceFiles(),i=t.getTypeChecker();return await Promise.all(n.map(async s=>{let o=e.basename(s.fileName);if(o.startsWith(".")||Pg.has(o))return;let a=e.normalize(s.fileName);if(a===e.registryPath)return;let u=await Xn(e,i,a,s);r.push(...u)})),r}async function ju(e,t){if(e.extname(t).toLowerCase()===".tsx"){let n=await e.readFile(t);if(n)return Fg(e,t,n)}return null}function Fg(e,t,r){let n=G(e,r);return Xn(e,null,t,n)}async function Xn(e,t,r,n){r=e.normalize(r);let i=[],s=sr(e,n);return await Promise.all(s.map(async o=>{let a=await Ag(e,t,r,o);a&&i.push(a)})),i}async function Ag(e,t,r,n){let i=e.relative(e.getAppRootDir(),r),s=te(e,r);if(e.ts.isVariableStatement(n.node))for(let o of n.node.declarationList.declarations){let a=Lu(e,o.initializer);if(a&&e.ts.isIdentifier(o.name)){let u=o.name.text;return{cmpInfo:{id:await Z(e,r,u),displayFilePath:Y(e,r),name:ee(u),inputs:[],exportName:n.isDefaultExport?"default":u,exportType:n.isDefaultExport?"default":"named",importName:u,filePath:r,relFilePath:i,importPath:s,framework:"qwik"},node:a}}}else if(e.ts.isCallExpression(n.node)){let o=Lu(e,n.node);if(o)return{cmpInfo:{id:await Z(e,r,"default"),displayFilePath:Y(e,r),name:Xe(e,r),inputs:[],exportName:"default",exportType:"default",importName:rr(e,r),filePath:r,relFilePath:i,importPath:s,framework:"qwik"},node:o}}return null}function Lu(e,t){if(t&&e.ts.isCallExpression(t)&&e.ts.isIdentifier(t.expression)&&t.expression.text==="component$"&&t.arguments.length>0){let r=t.arguments[0];if(e.ts.isArrowFunction(r)||e.ts.isFunctionExpression(r))return{callExpression:t,fnNode:r}}return null}var Pg=new Set(["node_modules","layout.tsx","404.tsx","router-head.tsx"]);async function Uu(e,t){let r=t.node.fnNode;if((e.ts.isArrowFunction(r)||e.ts.isFunctionExpression(r))&&r.parameters.length>0){let{sourceFile:i,typeChecker:s}=await Er(e,t.cmpInfo.filePath,null);if(!(await Xn(e,s,t.cmpInfo.filePath,i)).find(u=>u.cmpInfo.id===t.cmpInfo.id))throw new Error(`createComponentInputs() Could not find component ${t.cmpInfo.name} in ${t.cmpInfo.filePath}`);return ir(e,s,r)}return[]}async function Vu(e){return gi(e)}async function gi(e){let t=[];return await e.exists(e.registryPath)||(await e.writeFile(e.registryPath,Tg),t.push({filePath:e.registryPath,modifiedType:"create"})),t}var Tg=`import type { RegisteredComponent } from "@builder.io/sdk-qwik";
|
|
666
666
|
|
|
667
667
|
export const CUSTOM_COMPONENTS: RegisteredComponent[] = [
|
|
668
668
|
];
|
|
669
|
-
`;async function sc(e){await Ri(e);let t=await e.readFile(e.registryPath);return t?Fh(e,t):{components:[],sourceFile:G(e,"")}}async function Fh(e,t){let r=G(e,t);return Ah(e,r)}async function Ah(e,t){let r=[],n=fe(e,t,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(i,s)=>{let o=await Ii(e,t,i);o&&(o.nodeIndex=s,r.push(o))})),{sourceFile:t,components:Be(r)}}async function Ii(e,t,r){if(!e.ts.isObjectLiteralExpression(r))return null;let n={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],framework:"qwik"};for(let i of r.properties){if(!e.ts.isPropertyAssignment(i)||!e.ts.isIdentifier(i.name))continue;if(Z(e,i)==="component"&&e.ts.isIdentifier(i.initializer)){let o=i.initializer.text;n.name===""&&(n.name=te(o)),n.importName=o;let a=await Dt(e,e.registryPath,t,o);if(!a)continue;n.filePath=a.filePath,n.relFilePath=a.relFilePath,n.importPath=re(e,a.filePath),n.displayFilePath=a.displayFilePath,n.exportType=a.exportType;let u=await nc(e,a.filePath);if(u&&u.length>0)if(u.length===1)n.exportName=u[0].cmpInfo.exportName;else{let c=u.find(l=>l.cmpInfo.exportName===o);c&&(n.exportName=c.cmpInfo.exportName)}continue}}return n=Ne(e,n,r),n.filePath&&n.exportName&&(n.id=await ee(e,n.filePath,n.exportName)),n}async function ac(e){let t=new Set,r=async i=>{let s=await e.readdir(i);await Promise.all(s.map(async o=>{if(o.startsWith(".")||o==="node_modules")return;let a=e.join(i,o),u=e.extname(o).toLowerCase();if(u===".tsx"||u===".ts"){t.add(a);return}(await e.stat(a)).isDirectory()&&await r(a)}))};return await r(e.getAppRootDir()),await ge(e,[...t])}async function ir(e,t,r,n,i,s,o,a){let u=await ac(e),[c,l,p]=await Promise.all([rc(e,u),sc(e),ln(e)]),d=c.map(f=>f.cmpInfo),g=l.components,m={components:lt(d,g),registryPath:e.registryPath,registryDisplayPath:Q(e,e.registryPath),frameworks:e.getFrameworks(),dependencies:et(d),publicApiKey:p.envValue??void 0,devToolsVersion:e.version};if(a)return m;if(t!=null){let f=c.find(S=>S.cmpInfo.id===t);if(!f)throw new Error(`Component ${t} not found`);let h=l.sourceFile,D=m.components.find(S=>S.id===t),v=await oc(e,f);Ge(D,v),t=Array.isArray(t)?t[0]:t;let E=bt(t,d,g,r,n,i,s),{elements:P,elmIndex:A,statementIndex:F,statement:T,variableDeclaration:k}=await Th(e,h,f),I=!1;if(E.addCmpToRegistry?(P.push(Ph(e,E.addCmpToRegistry)),I=!0):E.removeCmpFromRegistry?(P.splice(A,1),I=!0):E.updateRegisteredCmp&&(P[A]=he(e,P[A],E.updateRegisteredCmp),I=!0),I&&o){let S=[...h.statements];S[F]=e.ts.factory.updateVariableStatement(T,T.modifiers,e.ts.factory.updateVariableDeclarationList(T.declarationList,[e.ts.factory.updateVariableDeclaration(k,k.name,k.exclamationToken,k.type,e.ts.factory.createArrayLiteralExpression(yt(e,P)))])),h=e.ts.factory.updateSourceFile(h,S),D.exportType==="named"?h=q(e,h,{namedImports:[D.importName],importPath:W(e,e.registryPath,D.filePath)}):h=q(e,h,{defaultImport:D.importName,importPath:W(e,e.registryPath,D.filePath)}),h=q(e,h,{namedImports:["RegisteredComponent"],importPath:"@builder.io/sdk-qwik",isTypeOnly:!0}),h=wt(e,h,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),h=xt(e,h),h=Ct(e,h);let C=Ce(e,h);C=ct(C),C=ec(C,Rh,"CUSTOM_COMPONENTS"),C=await e.formatCode(e.registryPath,C),await e.writeFile(e.registryPath,C)}m.components=E.components}return m}function Ph(e,t){return he(e,e.ts.factory.createObjectLiteralExpression([e.ts.factory.createPropertyAssignment("component",e.ts.factory.createIdentifier(t.importName))],!0),t)}async function Th(e,t,r){let n=fe(e,t,"CUSTOM_COMPONENTS");if(!n)throw new Error(`Exported name of the Builder registry must be "CUSTOM_COMPONENTS". Please update your Builder registry file: ${e.registryPath}`);let i=n.arrayLiteralExp.elements.filter(o=>e.ts.isObjectLiteralExpression(o)),s=-1;for(let o=0;o<i.length;o++)if((await Ii(e,t,i[o]))?.id===r.cmpInfo.id){s=o;break}return{...n,elements:i,elmIndex:s}}var Rh=["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 uc(e){let t=await Ih(e);return{builderPageOptions:async()=>({templateContentId:"dc70f1d979ad416d8fd357137eb9ddfb",pathname:"/",title:"Builder + Qwik Demo Page"}),ensureBuilderSetup:()=>ic(t),ensureFigmaImportPage:async()=>[],getRegistryPath:()=>t.registryPath,getRegistry:n=>ir(t,null,!1,!1,null,null,!1,!!n?.readAllInputTypes),addExternalPackage:async n=>{},loadComponent:async n=>{let i=await ir(t,n.cmpId,!1,!1,null,null,!1,!1);return{...i,component:i.components.find(s=>s.id===n.cmpId)}},registerComponent:n=>ir(t,n.cmpId,!0,!1,null,null,!0,!1),setRegisteredComponentInfo:n=>ir(t,n.cmpId,!1,!1,n,null,!0,!1),setRegisteredComponentInput:n=>ir(t,n.cmpId,!1,!1,null,n,!0,!1),unregisterComponent:n=>ir(t,n.cmpId,!1,!0,null,null,!0,!1),getPublicApiKey:()=>ln(t),setPublicApiKey:n=>Xu(t,n.publicApiKey),getDependencies:n=>[{name:"@builder.io/dev-tools"},{name:"@builder.io/sdk-qwik"}],getDevRunCommand:()=>"dev",getCache:()=>Xe(t),setCache:n=>Ze(t,n)}}async function Ih(e){let t=await Zr(e,e.getAppRootDir(),"components");if(!t)throw new Error(`Could not find components directory within project: ${e.getAppRootDir()}`);let r=await $e(e,t),n=e.join(e.getAppRootDir(),".env");return{...e,componentsDir:t,registryPath:r,envPath:n}}async function pn(e){return await mt(e,[".env"],dn)}async function cc(e,t){let r=await pn(e),n=await gt(e,r.file,r.envKey,t);return{...r,modifiedType:n}}var dn="PUBLIC_BUILDER_KEY";var kh=new Set(["dist","node_modules"]);async function lc(e,t){let r=[],n=t.getSourceFiles(),i=t.getTypeChecker(),s=e.join(e.getAppRootDir(),"build");return await Promise.all(n.map(async o=>{let a=e.basename(o.fileName);if(a.startsWith(".")||a==="node_modules"||qn(e,kh,o.fileName)||Bh.has(a)||a.includes("$."))return;let u=e.normalize(o.fileName);if(u===e.remixConfigPath||u===s)return;let c=await Kt(e,i,u,o,u===e.registryPath);r.push(...c)})),r}var Bh=new Set(["root.tsx","root.ts","root.jsx","root.js","_index.tsx","_index.jsx","_index.ts","_index.js"]);async function pc(e){await so(e);let t=await e.readFile(e.registryPath);return t?_h(e,t):{components:[],sourceFile:G(e,"")}}async function _h(e,t){let r=G(e,t);return $h(e,r)}async function $h(e,t){let r=[],n=fe(e,t,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(i,s)=>{let o=await ki(e,t,i);o&&(o.nodeIndex=s,r.push(o))})),{sourceFile:t,components:Be(r)}}async function ki(e,t,r){if(!e.ts.isObjectLiteralExpression(r))return null;let n={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],acceptsChildren:!1,framework:"react"};e.sdkVersion===N.gen2&&Pr(e,r)&&(n.acceptsChildren=!0);for(let i of r.properties){if(!e.ts.isPropertyAssignment(i)||!e.ts.isIdentifier(i.name))continue;if(Z(e,i)==="component"){let o,{initializer:a}=i;if(e.ts.isIdentifier(a))o=a.text;else if(e.ts.isCallExpression(a)){(e.ts.isIdentifier(a.expression)&&a.expression.text)==="withChildren"&&(n.acceptsChildren=!0);let l=a.arguments[0];e.ts.isIdentifier(l)&&(o=l.text)}if(!o)continue;n.name===""&&(n.name=te(o)),n.importName=o;let u=await Dt(e,e.registryPath,t,o);if(!u)continue;if(n.filePath=u.filePath,n.relFilePath=u.relFilePath,await e.exists(u.filePath)?n.importPath=re(e,u.filePath):(n.externalImportPath=u.importPath,n.importPath=n.externalImportPath),n.displayFilePath=u.displayFilePath,n.exportType=u.exportType,n.externalImportPath)n.exportName=o;else{let c=await Iu(e,u.filePath,e.registryPath===u.filePath||He(u.filePath));if(c&&c.length>0)if(c.length===1)n.exportName=c[0].cmpInfo.exportName;else{let l=c.find(p=>p.cmpInfo.exportName===o);l&&(n.exportName=l.cmpInfo.exportName)}}continue}}return n=Ne(e,n,r),n.filePath&&n.exportName&&(n.id=await ee(e,n.filePath,n.exportName,n.externalImportPath)),n}async function Et(e,t,r,n,i,s,o,a){let u=await Gt(e),[c,l,p]=await Promise.all([lc(e,u),pc(e),pn(e)]),d=c.map(v=>v.cmpInfo),g=l.components,m={components:lt(d,g),registryPath:e.registryPath,registryDisplayPath:Q(e,e.registryPath),frameworks:e.getFrameworks(),dependencies:et(d),publicApiKey:p.envValue??void 0,devToolsVersion:e.version};if(a)return m.components=await Ir(e,m.components),m;let f=!1,h=l.sourceFile,D=Array.isArray(t)?t:typeof t=="string"?[t]:[];if(D.length>0){let v=D.map(A=>{let F=c.find(T=>T.cmpInfo.id===A);if(!F)throw new Error(`Component ${A} not found`);return F}),E=Array.from(new Set(v.map(A=>A.cmpInfo.filePath))),P=await ge(e,E);for(let A of v){let F=m.components.find(y=>y.id===A.cmpInfo.id),T=await kr(e,A,P,e.registryPath===A.cmpInfo.filePath||He(A.cmpInfo.filePath));Ge(F,T);let k=d.findIndex(y=>y.id===A.cmpInfo.id);d[k].inputs=T;let I=bt(A.cmpInfo.id,d,g,r,n,i,s),{elements:S,elmIndex:C,statementIndex:$,statement:O,variableDeclaration:L}=await Oh(e,h,A);if(I.addCmpToRegistry)S.push(Nh(e,I.addCmpToRegistry)),f=!0;else if(I.removeCmpFromRegistry)S.splice(C,1),f=!0;else if(I.updateRegisteredCmp){let y=he(e,S[C],I.updateRegisteredCmp);S[C]=e.ts.factory.updateObjectLiteralExpression(y,[dc(e,I.updateRegisteredCmp),...y.properties.slice(1)]),f=!0}if(f&&o){let y=[...h.statements];y[$]=e.ts.factory.updateVariableStatement(O,O.modifiers,e.ts.factory.updateVariableDeclarationList(O.declarationList,[e.ts.factory.updateVariableDeclaration(L,L.name,L.exclamationToken,L.type,e.ts.factory.createArrayLiteralExpression(yt(e,S)))])),h=e.ts.factory.updateSourceFile(h,y),F.exportType==="named"?h=q(e,h,{namedImports:[F.importName],importPath:F.externalImportPath?F.externalImportPath:W(e,e.registryPath,F.filePath)}):h=q(e,h,{defaultImport:F.importName,importPath:F.externalImportPath?F.externalImportPath:W(e,e.registryPath,F.filePath)});let x=e.sdkVersion===N.gen2?"@builder.io/sdk-react":"@builder.io/react";h=q(e,h,{namedImports:["RegisteredComponent"],importPath:x,isTypeOnly:!0}),F.acceptsChildren&&e.sdkVersion!==N.gen2&&(h=q(e,h,{namedImports:["withChildren"],importPath:"@builder.io/react"})),h=wt(e,h,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),m.components=I.components,g=I.components.filter(ue=>ue.isRegistered)}}}if(f&&o){h=xt(e,h),h=Ct(e,h);let v=Ce(e,h);v=ct(v),v=await e.formatCode(e.registryPath,v),await e.writeFile(e.registryPath,v)}return m}function dc(e,t){if(e.sdkVersion===N.gen2)return e.ts.factory.createPropertyAssignment("component",e.ts.factory.createIdentifier(t.importName));let r=e.ts.factory.createIdentifier(t.importName),n=t.acceptsChildren?e.ts.factory.createCallExpression(e.ts.factory.createIdentifier("withChildren"),void 0,[r]):r;return e.ts.factory.createPropertyAssignment("component",n)}function Nh(e,t){return he(e,e.ts.factory.createObjectLiteralExpression([dc(e,t),...t.acceptsChildren&&e.sdkVersion===N.gen2?[e.ts.factory.createPropertyAssignment("canHaveChildren",e.ts.factory.createTrue())]:[]],!0),t)}async function Oh(e,t,r){let n=fe(e,t,"CUSTOM_COMPONENTS");if(!n)throw new Error(`Exported name of the Builder registry must be "CUSTOM_COMPONENTS". Please update your Builder registry file: ${e.registryPath}`);let i=n.arrayLiteralExp.elements.filter(o=>e.ts.isObjectLiteralExpression(o)),s=-1;for(let o=0;o<i.length;o++)if((await ki(e,t,i[o]))?.id===r.cmpInfo.id){s=o;break}return{...n,elements:i,elmIndex:s}}async function fc(e){let t=[],r=await jh(e,t);return t.push(...await so(e)),await Hh(e,r),await Mh(e,t),t}async function mc(e){let t=[];return t.push(...await so(e)),await Lh(e,t),t}async function Lh(e,t){let r=`figma-imports.${e.typescriptEnabled?"tsx":"jsx"}`;e.hasLocaleParam&&(e.debug("remixEnsureFigmaImportRoute, hasLocaleParam"),r=`($locale).${r}`);let n=e.join(e.routesDir,r),i=await e.exists(n);e.debug(`remixEnsureFigmaImportRoute, hasRoute: ${i}`);let s=await e.formatCode(n,gc({sys:e,routePath:n,modelName:"figma-imports"}));await e.writeFile(n,s),t.push({filePath:n,modifiedType:i?"update":"create"})}async function Mh(e,t){let r=`$.${e.typescriptEnabled?"tsx":"jsx"}`;e.hasLocaleParam&&(e.debug("remixEnsureAppRoute, hasLocaleParam"),r=`($locale).${r}`),e.sdkVersion===N.gen2&&(r=`($slug)._index.${e.typescriptEnabled?"tsx":"jsx"}`);let n=e.join(e.routesDir,r),i=await e.exists(n);e.debug(`remixEnsureAppRoute, hasRoute: ${i}`);let s=await e.formatCode(n,gc({sys:e,routePath:n,modelName:"page"}));await e.writeFile(n,s),t.push({filePath:n,modifiedType:i?"update":"create"})}function gc({sys:e,routePath:t,modelName:r}){let n=e.typescriptEnabled,i=W(e,t,e.registryPath),s="",o="";n&&(s="import type { LoaderArgs } from '@remix-run/server-runtime';",o=": LoaderArgs");let a=`process.env.${dn}`,u="";return e.getFrameworks().some(c=>c.name==="@shopify/remix-oxygen")&&(a=`context.env.${dn}`,u=", context"),n&&(a+="!"),e.sdkVersion===N.gen2?`
|
|
669
|
+
`;async function Hu(e){await gi(e);let t=await e.readFile(e.registryPath);return t?Rg(e,t):{components:[],sourceFile:G(e,"")}}async function Rg(e,t){let r=G(e,t);return Ig(e,r)}async function Ig(e,t){let r=[],n=fe(e,t,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(i,s)=>{let o=await hi(e,t,i);o&&(o.nodeIndex=s,r.push(o))})),{sourceFile:t,components:$e(r)}}async function hi(e,t,r){if(!e.ts.isObjectLiteralExpression(r))return null;let n={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],framework:"qwik"};for(let i of r.properties){if(!e.ts.isPropertyAssignment(i)||!e.ts.isIdentifier(i.name))continue;if(X(e,i)==="component"&&e.ts.isIdentifier(i.initializer)){let o=i.initializer.text;n.name===""&&(n.name=ee(o)),n.importName=o;let a=await xt(e,e.registryPath,t,o);if(!a)continue;n.filePath=a.filePath,n.relFilePath=a.relFilePath,n.importPath=te(e,a.filePath),n.displayFilePath=a.displayFilePath,n.exportType=a.exportType;let u=await ju(e,a.filePath);if(u&&u.length>0)if(u.length===1)n.exportName=u[0].cmpInfo.exportName;else{let c=u.find(l=>l.cmpInfo.exportName===o);c&&(n.exportName=c.cmpInfo.exportName)}continue}}return n=Oe(e,n,r),n.filePath&&n.exportName&&(n.id=await Z(e,n.filePath,n.exportName)),n}async function Ku(e){let t=new Set,r=async i=>{let s=await e.readdir(i);await Promise.all(s.map(async o=>{if(o.startsWith(".")||o==="node_modules")return;let a=e.join(i,o),u=e.extname(o).toLowerCase();if(u===".tsx"||u===".ts"){t.add(a);return}(await e.stat(a)).isDirectory()&&await r(a)}))};return await r(e.getAppRootDir()),await ge(e,[...t])}async function ar(e,t,r,n,i,s,o,a){let u=await Ku(e),[c,l,p]=await Promise.all([Mu(e,u),Hu(e),sn(e)]),d=c.map(f=>f.cmpInfo),D=l.components,m={components:ft(d,D),registryPath:e.registryPath,registryDisplayPath:Y(e,e.registryPath),frameworks:e.getFrameworks(),dependencies:rt(d),publicApiKey:p.envValue??void 0,devToolsVersion:e.version};if(a)return m;if(t!=null){let f=c.find(S=>S.cmpInfo.id===t);if(!f)throw new Error(`Component ${t} not found`);let g=l.sourceFile,h=m.components.find(S=>S.id===t),E=await Uu(e,f);We(h,E),t=Array.isArray(t)?t[0]:t;let v=vt(t,d,D,r,n,i,s),{elements:P,elmIndex:A,statementIndex:F,statement:T,variableDeclaration:k}=await Bg(e,g,f),I=!1;if(v.addCmpToRegistry?(P.push(kg(e,v.addCmpToRegistry)),I=!0):v.removeCmpFromRegistry?(P.splice(A,1),I=!0):v.updateRegisteredCmp&&(P[A]=he(e,P[A],v.updateRegisteredCmp),I=!0),I&&o){let S=[...g.statements];S[F]=e.ts.factory.updateVariableStatement(T,T.modifiers,e.ts.factory.updateVariableDeclarationList(T.declarationList,[e.ts.factory.updateVariableDeclaration(k,k.name,k.exclamationToken,k.type,e.ts.factory.createArrayLiteralExpression(wt(e,P)))])),g=e.ts.factory.updateSourceFile(g,S),h.exportType==="named"?g=z(e,g,{namedImports:[h.importName],importPath:W(e,e.registryPath,h.filePath)}):g=z(e,g,{defaultImport:h.importName,importPath:W(e,e.registryPath,h.filePath)}),g=z(e,g,{namedImports:["RegisteredComponent"],importPath:"@builder.io/sdk-qwik",isTypeOnly:!0}),g=St(e,g,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),g=Et(e,g),g=bt(e,g);let C=De(e,g);C=dt(C),C=Ou(C,$g,"CUSTOM_COMPONENTS"),C=await e.formatCode(e.registryPath,C),await e.writeFile(e.registryPath,C)}m.components=v.components}return m}function kg(e,t){return he(e,e.ts.factory.createObjectLiteralExpression([e.ts.factory.createPropertyAssignment("component",e.ts.factory.createIdentifier(t.importName))],!0),t)}async function Bg(e,t,r){let n=fe(e,t,"CUSTOM_COMPONENTS");if(!n)throw new Error(`Exported name of the Builder registry must be "CUSTOM_COMPONENTS". Please update your Builder registry file: ${e.registryPath}`);let i=n.arrayLiteralExp.elements.filter(o=>e.ts.isObjectLiteralExpression(o)),s=-1;for(let o=0;o<i.length;o++)if((await hi(e,t,i[o]))?.id===r.cmpInfo.id){s=o;break}return{...n,elements:i,elmIndex:s}}var $g=["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 Gu(e){let t=await _g(e);return{builderPageOptions:async()=>({templateContentId:"dc70f1d979ad416d8fd357137eb9ddfb",pathname:"/",title:"Builder + Qwik Demo Page"}),ensureBuilderSetup:()=>Vu(t),ensureFigmaImportPage:async()=>[],getRegistryPath:()=>t.registryPath,getRegistry:n=>ar(t,null,!1,!1,null,null,!1,!!n?.readAllInputTypes),addExternalPackage:async n=>{},loadComponent:async n=>{let i=await ar(t,n.cmpId,!1,!1,null,null,!1,!1);return{...i,component:i.components.find(s=>s.id===n.cmpId)}},registerComponent:n=>ar(t,n.cmpId,!0,!1,null,null,!0,!1),setRegisteredComponentInfo:n=>ar(t,n.cmpId,!1,!1,n,null,!0,!1),setRegisteredComponentInput:n=>ar(t,n.cmpId,!1,!1,null,n,!0,!1),unregisterComponent:n=>ar(t,n.cmpId,!1,!0,null,null,!0,!1),getPublicApiKey:()=>sn(t),setPublicApiKey:n=>_u(t,n.publicApiKey),getDependencies:n=>[{name:"@builder.io/dev-tools"},{name:"@builder.io/sdk-qwik"}],getDevRunCommand:()=>"dev",getCache:()=>et(t),setCache:n=>tt(t,n)}}async function _g(e){let t=await Jr(e,e.getAppRootDir(),"components");if(!t)throw new Error(`Could not find components directory within project: ${e.getAppRootDir()}`);let r=await Ne(e,t),n=e.join(e.getAppRootDir(),".env");return{...e,componentsDir:t,registryPath:r,envPath:n}}async function an(e){return await Dt(e,[".env"],un)}async function Wu(e,t){let r=await an(e),n=await Ct(e,r.file,r.envKey,t);return{...r,modifiedType:n}}var un="PUBLIC_BUILDER_KEY";var Ng=new Set(["dist","node_modules"]);async function zu(e,t){let r=[],n=t.getSourceFiles(),i=t.getTypeChecker(),s=e.join(e.getAppRootDir(),"build");return await Promise.all(n.map(async o=>{let a=e.basename(o.fileName);if(a.startsWith(".")||a==="node_modules"||Un(e,Ng,o.fileName)||Og.has(a)||a.includes("$."))return;let u=e.normalize(o.fileName);if(u===e.remixConfigPath||u===s)return;let c=await Wt(e,i,u,o,u===e.registryPath);r.push(...c)})),r}var Og=new Set(["root.tsx","root.ts","root.jsx","root.js","_index.tsx","_index.jsx","_index.ts","_index.js"]);async function qu(e){await Zn(e);let t=await e.readFile(e.registryPath);return t?Lg(e,t):{components:[],sourceFile:G(e,"")}}async function Lg(e,t){let r=G(e,t);return Mg(e,r)}async function Mg(e,t){let r=[],n=fe(e,t,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(i,s)=>{let o=await Di(e,t,i);o&&(o.nodeIndex=s,r.push(o))})),{sourceFile:t,components:$e(r)}}async function Di(e,t,r){if(!e.ts.isObjectLiteralExpression(r))return null;let n={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],acceptsChildren:!1,framework:"react"};e.sdkVersion===N.gen2&&Tr(e,r)&&(n.acceptsChildren=!0);for(let i of r.properties){if(!e.ts.isPropertyAssignment(i)||!e.ts.isIdentifier(i.name))continue;if(X(e,i)==="component"){let o,{initializer:a}=i;if(e.ts.isIdentifier(a))o=a.text;else if(e.ts.isCallExpression(a)){(e.ts.isIdentifier(a.expression)&&a.expression.text)==="withChildren"&&(n.acceptsChildren=!0);let l=a.arguments[0];e.ts.isIdentifier(l)&&(o=l.text)}if(!o)continue;n.name===""&&(n.name=ee(o)),n.importName=o;let u=await xt(e,e.registryPath,t,o);if(!u)continue;if(n.filePath=u.filePath,n.relFilePath=u.relFilePath,await e.exists(u.filePath)?n.importPath=te(e,u.filePath):(n.externalImportPath=u.importPath,n.importPath=n.externalImportPath),n.displayFilePath=u.displayFilePath,n.exportType=u.exportType,n.externalImportPath)n.exportName=o;else{let c=await mu(e,u.filePath,e.registryPath===u.filePath||He(u.filePath));if(c&&c.length>0)if(c.length===1)n.exportName=c[0].cmpInfo.exportName;else{let l=c.find(p=>p.cmpInfo.exportName===o);l&&(n.exportName=l.cmpInfo.exportName)}}continue}}return n=Oe(e,n,r),n.filePath&&n.exportName&&(n.id=await Z(e,n.filePath,n.exportName,n.externalImportPath)),n}async function At(e,t,r,n,i,s,o,a){let u=await zt(e),[c,l,p]=await Promise.all([zu(e,u),qu(e),an(e)]),d=c.map(E=>E.cmpInfo),D=l.components,m={components:ft(d,D),registryPath:e.registryPath,registryDisplayPath:Y(e,e.registryPath),frameworks:e.getFrameworks(),dependencies:rt(d),publicApiKey:p.envValue??void 0,devToolsVersion:e.version};if(a)return m.components=await kr(e,m.components),m;let f=!1,g=l.sourceFile,h=Array.isArray(t)?t:typeof t=="string"?[t]:[];if(h.length>0){let E=h.map(A=>{let F=c.find(T=>T.cmpInfo.id===A);if(!F)throw new Error(`Component ${A} not found`);return F}),v=Array.from(new Set(E.map(A=>A.cmpInfo.filePath))),P=await ge(e,v);for(let A of E){let F=m.components.find(y=>y.id===A.cmpInfo.id),T=await Br(e,A,P,e.registryPath===A.cmpInfo.filePath||He(A.cmpInfo.filePath));We(F,T);let k=d.findIndex(y=>y.id===A.cmpInfo.id);d[k].inputs=T;let I=vt(A.cmpInfo.id,d,D,r,n,i,s),{elements:S,elmIndex:C,statementIndex:$,statement:O,variableDeclaration:L}=await Ug(e,g,A);if(I.addCmpToRegistry)S.push(jg(e,I.addCmpToRegistry)),f=!0;else if(I.removeCmpFromRegistry)S.splice(C,1),f=!0;else if(I.updateRegisteredCmp){let y=he(e,S[C],I.updateRegisteredCmp);S[C]=e.ts.factory.updateObjectLiteralExpression(y,[Ju(e,I.updateRegisteredCmp),...y.properties.slice(1)]),f=!0}if(f&&o){let y=[...g.statements];y[$]=e.ts.factory.updateVariableStatement(O,O.modifiers,e.ts.factory.updateVariableDeclarationList(O.declarationList,[e.ts.factory.updateVariableDeclaration(L,L.name,L.exclamationToken,L.type,e.ts.factory.createArrayLiteralExpression(wt(e,S)))])),g=e.ts.factory.updateSourceFile(g,y),F.exportType==="named"?g=z(e,g,{namedImports:[F.importName],importPath:F.externalImportPath?F.externalImportPath:W(e,e.registryPath,F.filePath)}):g=z(e,g,{defaultImport:F.importName,importPath:F.externalImportPath?F.externalImportPath:W(e,e.registryPath,F.filePath)});let x=e.sdkVersion===N.gen2?"@builder.io/sdk-react":"@builder.io/react";g=z(e,g,{namedImports:["RegisteredComponent"],importPath:x,isTypeOnly:!0}),F.acceptsChildren&&e.sdkVersion!==N.gen2&&(g=z(e,g,{namedImports:["withChildren"],importPath:"@builder.io/react"})),g=St(e,g,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),m.components=I.components,D=I.components.filter(ue=>ue.isRegistered)}}}if(f&&o){g=Et(e,g),g=bt(e,g);let E=De(e,g);E=dt(E),E=await e.formatCode(e.registryPath,E),await e.writeFile(e.registryPath,E)}return m}function Ju(e,t){if(e.sdkVersion===N.gen2)return e.ts.factory.createPropertyAssignment("component",e.ts.factory.createIdentifier(t.importName));let r=e.ts.factory.createIdentifier(t.importName),n=t.acceptsChildren?e.ts.factory.createCallExpression(e.ts.factory.createIdentifier("withChildren"),void 0,[r]):r;return e.ts.factory.createPropertyAssignment("component",n)}function jg(e,t){return he(e,e.ts.factory.createObjectLiteralExpression([Ju(e,t),...t.acceptsChildren&&e.sdkVersion===N.gen2?[e.ts.factory.createPropertyAssignment("canHaveChildren",e.ts.factory.createTrue())]:[]],!0),t)}async function Ug(e,t,r){let n=fe(e,t,"CUSTOM_COMPONENTS");if(!n)throw new Error(`Exported name of the Builder registry must be "CUSTOM_COMPONENTS". Please update your Builder registry file: ${e.registryPath}`);let i=n.arrayLiteralExp.elements.filter(o=>e.ts.isObjectLiteralExpression(o)),s=-1;for(let o=0;o<i.length;o++)if((await Di(e,t,i[o]))?.id===r.cmpInfo.id){s=o;break}return{...n,elements:i,elmIndex:s}}async function Yu(e){let t=[],r=await Kg(e,t);return t.push(...await Zn(e)),await Wg(e,r),await Hg(e,t),t}async function Qu(e){let t=[];return t.push(...await Zn(e)),await Vg(e,t),t}async function Vg(e,t){let r=`figma-imports.${e.typescriptEnabled?"tsx":"jsx"}`;e.hasLocaleParam&&(e.debug("remixEnsureFigmaImportRoute, hasLocaleParam"),r=`($locale).${r}`);let n=e.join(e.routesDir,r),i=await e.exists(n);e.debug(`remixEnsureFigmaImportRoute, hasRoute: ${i}`);let s=await e.formatCode(n,Xu({sys:e,routePath:n,modelName:"figma-imports"}));await e.writeFile(n,s),t.push({filePath:n,modifiedType:i?"update":"create"})}async function Hg(e,t){let r=`$.${e.typescriptEnabled?"tsx":"jsx"}`;e.hasLocaleParam&&(e.debug("remixEnsureAppRoute, hasLocaleParam"),r=`($locale).${r}`),e.sdkVersion===N.gen2&&(r=`($slug)._index.${e.typescriptEnabled?"tsx":"jsx"}`);let n=e.join(e.routesDir,r),i=await e.exists(n);e.debug(`remixEnsureAppRoute, hasRoute: ${i}`);let s=await e.formatCode(n,Xu({sys:e,routePath:n,modelName:"page"}));await e.writeFile(n,s),t.push({filePath:n,modifiedType:i?"update":"create"})}function Xu({sys:e,routePath:t,modelName:r}){let n=e.typescriptEnabled,i=W(e,t,e.registryPath),s="",o="";n&&(s="import type { LoaderArgs } from '@remix-run/server-runtime';",o=": LoaderArgs");let a=`process.env.${un}`,u="";return e.getFrameworks().some(c=>c.name==="@shopify/remix-oxygen")&&(a=`context.env.${un}`,u=", context"),n&&(a+="!"),e.sdkVersion===N.gen2?`
|
|
670
670
|
|
|
671
671
|
import {
|
|
672
672
|
Content,
|
|
@@ -772,11 +772,11 @@ export default function Page() {
|
|
|
772
772
|
${n?`
|
|
773
773
|
declare global {
|
|
774
774
|
interface Env {
|
|
775
|
-
${
|
|
775
|
+
${un}: string;
|
|
776
776
|
}
|
|
777
777
|
}
|
|
778
778
|
`:""}
|
|
779
|
-
`}async function
|
|
779
|
+
`}async function Kg(e,t){let n=e.typescriptEnabled?"tsx":"jsx",i=e.join(e.componentsDir,"Counter"),s=e.join(i,`Counter.${n}`),o=e.join(i,"styles.module.css"),{component:a,styles:u}=Gg(e),c=await e.exists(s);if(e.debug(`remixEnsureCounterComponent, hasCounterCmp: ${c}`),!c){let p=await e.formatCode(s,a);await e.writeFile(s,p),t.push({filePath:s,modifiedType:"create"})}let l=await e.exists(o);return e.debug(`remixEnsureCounterComponent, hasCounterStyles: ${l}`),l||(await e.writeFile(o,u),t.push({filePath:o,modifiedType:"create"})),s}function Gg(e){let t=e.typescriptEnabled,r=`
|
|
780
780
|
import { useState } from "react";
|
|
781
781
|
import styles from "./styles.module.css";
|
|
782
782
|
${t?`
|
|
@@ -839,17 +839,17 @@ export default Counter;
|
|
|
839
839
|
font-size: 42px;
|
|
840
840
|
text-align: center;
|
|
841
841
|
}
|
|
842
|
-
`.trimStart();return{component:r,styles:n}}async function
|
|
842
|
+
`.trimStart();return{component:r,styles:n}}async function Wg(e,t){let n=(await At(e,null,!1,!1,null,null,!1,!1)).components.find(i=>i.filePath===t);n&&await At(e,n.id,!0,!1,null,null,!0,!1)}async function Zn(e){let t=[];return await e.exists(e.registryPath)||(await e.writeFile(e.registryPath,zg(e)),t.push({filePath:e.registryPath,modifiedType:"create"})),t}function zg(e){let t=e.sdkVersion===N.gen2;return e.typescriptEnabled?`import type { RegisteredComponent } from ${t?'"@builder.io/sdk-react"':'"@builder.io/react"'};
|
|
843
843
|
|
|
844
844
|
export const CUSTOM_COMPONENTS: RegisteredComponent[] = [
|
|
845
845
|
];`:`export const CUSTOM_COMPONENTS = [
|
|
846
846
|
];
|
|
847
|
-
`}async function
|
|
847
|
+
`}async function Zu(e){let t=await qg(e);return{builderPageOptions:async()=>{let n="/builder-demo",i=t.hasLocaleParam?`/en-us${n}`:void 0;return{templateContentId:"a5c9eef7909d4fc99554264a17de22c9",pathname:n,localePathname:i,title:"Builder + Remix Demo Page"}},ensureBuilderSetup:()=>Yu(t),ensureFigmaImportPage:()=>Qu(t),getRegistryPath:()=>t.registryPath,getRegistry:n=>At(t,null,!1,!1,null,null,!1,!!n?.readAllInputTypes),addExternalPackage:n=>{t.addExternalPackage(n)},loadComponent:async n=>{let i=await At(t,n.cmpId,!1,!1,null,null,!1,!1);return{...i,component:i.components.find(s=>s.id===n.cmpId)}},registerComponent:n=>At(t,n.cmpId,!0,!1,null,null,!0,!1),setRegisteredComponentInfo:n=>At(t,n.cmpId,!1,!1,n,null,!0,!1),setRegisteredComponentInput:n=>At(t,n.cmpId,!1,!1,null,n,!0,!1),unregisterComponent:n=>At(t,n.cmpId,!1,!0,null,null,!0,!1),getPublicApiKey:()=>an(t),setPublicApiKey:n=>Wu(t,n.publicApiKey),getDependencies:n=>n.sdkVersion===N.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:()=>et(t),setCache:n=>tt(t,n)}}async function qg(e){let t=await Yg(e),r=e.getAppRootDir(),n=await Qg(e),i=e.dirname(n),s=e.join(i,"components"),o=await Ie(e),a=await Ne(e,i),u={},c={...e,registryPath:a,remixConfigPath:t,typescriptEnabled:o,appDir:i,componentsDir:s,routesDir:n,hasLocaleParam:await Jg(e,n),addExternalPackage:l=>{u[e.join(r,l,"index.ts")]=`export * from "${l}";`},readFileSync:l=>u[l]??e.readFileSync(l),existsSync:l=>!!u[l]||e.existsSync(l),readdirSync:l=>{let p=e.readdirSync(l);return l===r?[...p,...Object.keys(u).map(d=>d.slice(r.length+1))]:p},readdir:async l=>{let p=await e.readdir(l);return l===r?[...p,...Object.keys(u).map(d=>d.slice(r.length+1))]:p}};return e.sdkVersion?c.sdkVersion=e.sdkVersion:c.sdkVersion=await _r(c),c}async function Jg(e,t){return(await e.readdir(t)).some(n=>n.startsWith("($locale)."))}async function Yg(e){let t=["remix.config.ts","remix.config.js","vite.config.ts","vite.config.js"];for(let r of t){let n=e.join(e.getAppRootDir(),r);if(await e.exists(n))return n}if(e.ignoreMissingConfig)return"";throw new Error(`Could not find Remix config file. Searched for ${t.join(", ")} in "${e.getAppRootDir()}".`)}async function Qg(e){let t=await Jr(e,e.getAppRootDir(),"routes");if(t)return t;throw new Error(`Could not find Remix "routes" directory in "${e.getAppRootDir()}". Please ensure this command is ran from within your Remix project's directory.`)}async function cn(e){let t=[".env"],r=e.configType==="vite"?ln:eo;return await Dt(e,t,r)}async function ec(e,t){let r=await cn(e),n=await Ct(e,r.file,r.envKey,t);return{...r,modifiedType:n}}var ln="VITE_PUBLIC_BUILDER_KEY",eo="PUBLIC_BUILDER_KEY";function tc(e,t){let r=`Builder.registerComponent(
|
|
848
848
|
`;r+=` ${t.importName},
|
|
849
849
|
`,r+=` {
|
|
850
850
|
name: "${t.name}",
|
|
851
851
|
}
|
|
852
|
-
`,r+=");";let n=
|
|
852
|
+
`,r+=");";let n=jn(e,r);return Ci(e,n,t)}function Ci(e,t,r){if(!e.ts.isExpressionStatement(t))return t;let n=t.expression;if(!e.ts.isCallExpression(n))return t;let i=[...n.arguments];if(i.length<2)return t;let s=i[1];return e.ts.isObjectLiteralExpression(s)?(i[1]=he(e,s,r),e.ts.factory.updateExpressionStatement(t,e.ts.factory.updateCallExpression(n,n.expression,n.typeArguments,i))):t}async function rc(e){let t=await e.readFile(e.registryPath);return t?Xg(e,t):{components:[],sourceFile:G(e,"")}}async function Xg(e,t){let r=G(e,t);return e.sdkVersion===N.gen2?th(e,r):Zg(e,r)}async function Zg(e,t){let r=[];for(let n=0;n<t.statements.length;n++){let i=t.statements[n];if(!e.ts.isExpressionStatement(i))continue;let s=i.expression;if(!e.ts.isCallExpression(s))continue;let o=s.expression;if(!e.ts.isPropertyAccessExpression(o))continue;let a=o.expression;if(!e.ts.isIdentifier(a)||a.text!=="Builder"||o.name.text!=="registerComponent")continue;let c=s.arguments;if(c.length<2)continue;let l=c[1];if(!e.ts.isObjectLiteralExpression(l))continue;let p=c[0];if(e.ts.isIdentifier(p)){let d=await eh(e,t,n,p,l,!1);d&&r.push(d);continue}}return{sourceFile:t,components:$e(r)}}async function eh(e,t,r,n,i,s){let o={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],nodeIndex:r,acceptsChildren:s,framework:"react"},a=t.statements.filter(c=>e.ts.isImportDeclaration(c)),u=a.find(c=>c.importClause&&c.importClause.name?.text===n.text);if(u){let c=u.moduleSpecifier;if(!e.ts.isStringLiteral(c))return null;o.filePath=await yi(e,c.text),o.relFilePath=e.relative(e.getAppRootDir(),o.filePath),o.importPath=te(e,o.filePath),o.name=Xe(e,o.filePath),o.importName=n.text,o.exportName="default",o.exportType="default"}else{let c=a.find(d=>!d.importClause||!d.importClause.namedBindings||!e.ts.isNamedImports(d.importClause.namedBindings)?!1:d.importClause.namedBindings.elements.some(D=>D.name.text===n.text));if(!c)return null;let l=c.moduleSpecifier;if(!e.ts.isStringLiteral(l))return null;let p=await yi(e,l.text);o.filePath=await yi(e,l.text),o.relFilePath=e.relative(e.getAppRootDir(),o.filePath),await e.exists(p)?o.importPath=te(e,o.filePath):(o.externalImportPath=l.text,o.importPath=o.externalImportPath),o.name=ee(n.text),o.importName=n.text,o.exportName=n.text,o.exportType="named"}return o=Oe(e,o,i),o.displayFilePath=Y(e,o.filePath),o.filePath&&o.exportName&&(o.id=await Z(e,o.filePath,o.exportName,o.externalImportPath)),o}function yi(e,t){return on(e,e.normalize(e.resolve(e.dirname(e.registryPath),t)))}async function th(e,t){let r=[],n=fe(e,t,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(i,s)=>{let o=await xi(e,t,i);o&&(o.nodeIndex=s,r.push(o))})),{sourceFile:t,components:$e(r)}}async function xi(e,t,r){if(!e.ts.isObjectLiteralExpression(r))return null;let n={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],acceptsChildren:!1,framework:"react"};Tr(e,r)&&(n.acceptsChildren=!0);for(let s of r.properties){if(!e.ts.isPropertyAssignment(s)||!e.ts.isIdentifier(s.name))continue;if(X(e,s)==="component"){let a,{initializer:u}=s;if(e.ts.isIdentifier(u)&&(a=u.text),!a)continue;n.name===""&&(n.name=ee(a)),n.importName=a;let c=await xt(e,e.registryPath,t,a);if(!c)continue;n.filePath=c.filePath,n.relFilePath=c.relFilePath,await e.exists(c.filePath)?n.importPath=te(e,c.filePath):(n.externalImportPath=c.importPath,n.importPath=n.externalImportPath),n.displayFilePath=c.displayFilePath,n.exportType=c.exportType;let l=t.statements.filter(d=>e.ts.isImportDeclaration(d)),p=l.find(d=>d.importClause&&d.importClause.name?.text===a);if(p){let d=p.moduleSpecifier;if(!e.ts.isStringLiteral(d))return null;n.exportName="default"}else{let d=l.find(m=>!m.importClause||!m.importClause.namedBindings||!e.ts.isNamedImports(m.importClause.namedBindings)?!1:m.importClause.namedBindings.elements.some(f=>f.name.text===a));if(!d)return null;let D=d.moduleSpecifier;if(!e.ts.isStringLiteral(D))return null;n.exportName=a}continue}}return n=Oe(e,n,r),n.filePath&&n.exportName&&(n.id=await Z(e,n.filePath,n.exportName,n.externalImportPath)),n}async function Pt(e,t,r,n,i,s,o,a){let u=await zt(e),[c,l,p,d]=await Promise.all([gu(e,u),rc(e),Ie(e),cn(e)]),D=c.map(v=>v.cmpInfo),m=l.components,f={components:ft(D,m),registryPath:e.registryPath,registryDisplayPath:Y(e,e.registryPath),frameworks:e.getFrameworks(),dependencies:rt(D),publicApiKey:d.envValue??void 0,devToolsVersion:e.version};if(a)return f.components=await kr(e,f.components),f;let g=!1,h=l.sourceFile,E=Array.isArray(t)?t:typeof t=="string"?[t]:[];if(E.length>0){let v=E.map(F=>{let T=c.find(k=>k.cmpInfo.id===F);if(!T)throw new Error(`Component ${F} not found`);return T}),P=Array.from(new Set(v.map(F=>F.cmpInfo.filePath))),A=await ge(e,P);for(let F of v){let T=f.components.find(C=>C.id===F.cmpInfo.id),k=await Br(e,F,A,e.registryPath===F.cmpInfo.filePath||He(F.cmpInfo.filePath));We(T,k);let I=D.findIndex(C=>C.id===F.cmpInfo.id);D[I].inputs=k;let S=vt(F.cmpInfo.id,D,m,r,n,i,s);if(e.sdkVersion===N.gen2){let{elements:C,elmIndex:$,statementIndex:O,statement:L,variableDeclaration:y}=await rh(e,h,F);if(S.addCmpToRegistry)C.push(nh(e,S.addCmpToRegistry)),g=!0;else if(S.removeCmpFromRegistry)C.splice($,1),g=!0;else if(S.updateRegisteredCmp){let x=he(e,C[$],S.updateRegisteredCmp),ue=e.ts.factory.createIdentifier(S.updateRegisteredCmp.importName);C[$]=e.ts.factory.updateObjectLiteralExpression(x,[e.ts.factory.createPropertyAssignment("component",ue),...x.properties.slice(1)]),g=!0}if(g&&o){let x=[...h.statements];x[O]=e.ts.factory.updateVariableStatement(L,L.modifiers,e.ts.factory.updateVariableDeclarationList(L.declarationList,[e.ts.factory.updateVariableDeclaration(y,y.name,y.exclamationToken,y.type,e.ts.factory.createArrayLiteralExpression(wt(e,C)))])),h=e.ts.factory.updateSourceFile(h,x),h=nc(e,S,h),h=z(e,h,{namedImports:["RegisteredComponent"],importPath:"@builder.io/sdk-react",isTypeOnly:!0}),h=St(e,h,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),f.components=S.components,m=S.components.filter(ue=>ue.isRegistered)}}else{let C=[...h.statements];S.addCmpToRegistry?(C.push(tc(e,S.addCmpToRegistry)),g=!0):S.removeCmpFromRegistry?(C.splice(S.nodeIndex,1),g=!0):S.updateRegisteredCmp&&(C[S.nodeIndex]=Ci(e,C[S.nodeIndex],S.updateRegisteredCmp),g=!0),g&&o&&(h=e.ts.factory.updateSourceFile(h,C),h=z(e,h,{namedImports:["Builder","builder"],importPath:"@builder.io/react"}),h=nc(e,S,h),T?.acceptsChildren&&(h=z(e,h,{namedImports:["withChildren"],importPath:"@builder.io/react"})),f.components=S.components,m=S.components.filter($=>$.isRegistered))}}}if(g&&o){h=Et(e,h),h=bt(e,h);let v=De(e,h);v=dt(v),v=await e.formatCode(e.registryPath,v),await e.writeFile(e.registryPath,v)}return f}async function rh(e,t,r){let n=fe(e,t,"CUSTOM_COMPONENTS");if(!n)throw new Error(`Exported name of the Builder registry must be "CUSTOM_COMPONENTS". Please update your Builder registry file: ${e.registryPath}`);let i=n.arrayLiteralExp.elements.filter(o=>e.ts.isObjectLiteralExpression(o)),s=-1;for(let o=0;o<i.length;o++)if((await xi(e,t,i[o]))?.id===r.cmpInfo.id){s=o;break}return{...n,elements:i,elmIndex:s}}function nh(e,t){let r=e.ts.factory.createIdentifier(t.importName);return he(e,e.ts.factory.createObjectLiteralExpression([e.ts.factory.createPropertyAssignment("component",r),...t.acceptsChildren?[e.ts.factory.createPropertyAssignment("canHaveChildren",e.ts.factory.createTrue())]:[]],!0),t)}function nc(e,t,r){let n=t.addCmpToRegistry||t.updateRegisteredCmp;if(n){let i=n.externalImportPath?n.externalImportPath:W(e,e.registryPath,n.filePath);n.exportType==="default"?r=z(e,r,{defaultImport:n.importName,importPath:i}):n.exportType==="named"&&(r=z(e,r,{namedImports:[n.importName],importPath:i}))}return r}async function oc(e){let t=[],r=await oh(e,t);if(await ac(e,t,r),!await e.exists(e.builderComponentPath)){let n=await e.formatCode(e.builderComponentPath,sc(e,e.builderComponentPath));await e.writeFile(e.builderComponentPath,n),t.push({filePath:e.builderComponentPath,modifiedType:"create"})}return t}async function ic(e){let t=[];await ac(e,t);let r=`figma-imports.${e.typescriptEnabled?"tsx":"jsx"}`,n=e.join(e.componentsDir,r);if(!await e.exists(n)){let i=await e.formatCode(n,sc(e,n,"figma-imports"));await e.writeFile(n,i),t.push({filePath:n,modifiedType:"create"})}return t}function sc(e,t,r="page"){let n=e.typescriptEnabled;return e.sdkVersion===N.gen2?`
|
|
853
853
|
import React from "react";
|
|
854
854
|
import {
|
|
855
855
|
Content,
|
|
@@ -861,7 +861,7 @@ export const CUSTOM_COMPONENTS: RegisteredComponent[] = [
|
|
|
861
861
|
import { CUSTOM_COMPONENTS } from ${JSON.stringify(W(e,t,e.registryPath))};
|
|
862
862
|
|
|
863
863
|
// Builder Public API Key set in .env file
|
|
864
|
-
const BUILDER_API_KEY = ${e.configType==="vite"?`import.meta.env.${
|
|
864
|
+
const BUILDER_API_KEY = ${e.configType==="vite"?`import.meta.env.${ln};`:`${eo};`}
|
|
865
865
|
const MODEL_NAME = "${r}";
|
|
866
866
|
|
|
867
867
|
export default function BuilderPage() {
|
|
@@ -914,7 +914,7 @@ import { BuilderComponent, builder, useIsPreviewing } from "@builder.io/react";
|
|
|
914
914
|
import ${JSON.stringify(W(e,t,e.registryPath))};
|
|
915
915
|
|
|
916
916
|
// Builder Public API Key set in .env file
|
|
917
|
-
${e.configType==="vite"?`builder.init(import.meta.env.${
|
|
917
|
+
${e.configType==="vite"?`builder.init(import.meta.env.${ln}${n?"!":""})`:`builder.init("${eo}")`}
|
|
918
918
|
|
|
919
919
|
export default function BuilderPage() {
|
|
920
920
|
const isPreviewingInBuilder = useIsPreviewing();
|
|
@@ -959,7 +959,7 @@ export default function BuilderPage() {
|
|
|
959
959
|
</>
|
|
960
960
|
);
|
|
961
961
|
}
|
|
962
|
-
`.trimStart()}async function
|
|
962
|
+
`.trimStart()}async function ac(e,t,r){if(!await e.exists(e.registryPath)){if(e.sdkVersion===N.gen2){let s=sh(e);await e.writeFile(e.registryPath,s)}else await e.writeFile(e.registryPath,"");t.push({filePath:e.registryPath,modifiedType:"create"})}if(!r)return;let i=(await Pt(e,null,!1,!1,null,null,!1,!1)).components.find(s=>s.filePath===r);i&&await Pt(e,i.id,!0,!1,null,null,!0,!1)}async function oh(e,t){let n=e.typescriptEnabled?"tsx":"jsx",i=e.join(e.componentsDir,"Counter"),s=e.join(i,`Counter.${n}`),o=e.join(i,"styles.module.css"),{component:a,styles:u}=ih(e);if(!await e.exists(s)){let c=await e.formatCode(s,a);await e.writeFile(s,c),t.push({filePath:s,modifiedType:"create"})}return await e.exists(o)||(await e.writeFile(o,u),t.push({filePath:o,modifiedType:"create"})),s}function ih(e){let t=e.typescriptEnabled,r=`
|
|
963
963
|
"use client"
|
|
964
964
|
import React, { useState } from "react";
|
|
965
965
|
import styles from "./styles.module.css";
|
|
@@ -1022,18 +1022,18 @@ export default Counter;
|
|
|
1022
1022
|
font-size: 42px;
|
|
1023
1023
|
text-align: center;
|
|
1024
1024
|
}
|
|
1025
|
-
`.trimStart();return{component:r,styles:n}}function
|
|
1025
|
+
`.trimStart();return{component:r,styles:n}}function sh(e){return e.typescriptEnabled?`import type { RegisteredComponent } from "@builder.io/sdk-react";
|
|
1026
1026
|
|
|
1027
1027
|
export const CUSTOM_COMPONENTS: RegisteredComponent[] = [
|
|
1028
1028
|
];`:`export const CUSTOM_COMPONENTS = [
|
|
1029
1029
|
];
|
|
1030
|
-
`}async function
|
|
1030
|
+
`}async function uc(e){let t=await ah(e);return{builderPageOptions:async()=>({templateContentId:"2e36438034894a8abf279ea9e6d3596f",pathname:"/builder-demo",title:"Builder + React Demo Page"}),ensureBuilderSetup:()=>oc(t),ensureFigmaImportPage:()=>ic(t),getRegistryPath:()=>t.registryPath,getRegistry:n=>Pt(t,null,!1,!1,null,null,!1,!!n?.readAllInputTypes),addExternalPackage:n=>{t.addExternalPackage(n)},loadComponent:async n=>{let i=await Pt(t,n.cmpId,!1,!1,null,null,!1,!1);return{...i,component:i.components.find(s=>s.id===n.cmpId)}},registerComponent:n=>Pt(t,n.cmpId,!0,!1,null,null,!0,!1),setRegisteredComponentInfo:n=>Pt(t,n.cmpId,!1,!1,n,null,!0,!1),setRegisteredComponentInput:n=>Pt(t,n.cmpId,!1,!1,null,n,!0,!1),unregisterComponent:n=>Pt(t,n.cmpId,!1,!0,null,null,!0,!1),getPublicApiKey:()=>cn(t),setPublicApiKey:n=>ec(t,n.publicApiKey),getDependencies:n=>n.sdkVersion===N.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:()=>et(t),setCache:n=>tt(t,n)}}async function ah(e){let t=await uh(e),r=e.getAppRootDir(),n=e.join(r,"src"),i=await Ie(e),s={},o={...e,srcDir:null,builderComponentPath:"",componentsDir:"",registryPath:"",reactConfigPath:t,typescriptEnabled:i,configType:"",addExternalPackage:a=>{s[e.join(r,a,"index.ts")]=`export * from "${a}";`},readFileSync:a=>s[a]??e.readFileSync(a),existsSync:a=>!!s[a]||e.existsSync(a),readdirSync:a=>{let u=e.readdirSync(a);return a===r?[...u,...Object.keys(s).map(c=>c.slice(r.length+1))]:u},readdir:async a=>{let u=await e.readdir(a);return a===r?[...u,...Object.keys(s).map(c=>c.slice(r.length+1))]:u}};return e.sdkVersion?o.sdkVersion=e.sdkVersion:o.sdkVersion=await _r(o),t.includes("webpack.config")&&(o.configType="webpack"),t.includes("vite.config")&&(o.configType="vite"),await e.exists(n)?(o.srcDir=n,o.componentsDir=e.join(n,"components"),o.registryPath=await Ne(e,n),o.builderComponentPath=e.join(o.srcDir,`builder-page.${i?"tsx":"jsx"}`)):(o.componentsDir=e.join(r,"components"),o.registryPath=await Ne(e,r),o.builderComponentPath=e.join(r,`builder-page.${i?"tsx":"jsx"}`)),o}async function uh(e){let t=["vite.config.ts","vite.config.js","webpack.config.js","webpack.config.ts"];for(let r of t){let n=e.join(e.getAppRootDir(),r);if(await e.exists(n))return n}if(e.ignoreMissingConfig)return"";throw new Error(`Could not find React config file. Searched for ${t.join(", ")} in "${e.getAppRootDir()}".`)}async function pn(e){return await ch(e,["environment.ts"],to)}async function cc(e,t){let r=await pn(e),n=await fh(e,r.file,r.envKey,t);return{...r,modifiedType:n}}async function ch(e,t,r){let n={envKey:r,envValue:null,file:""};for(let i of t){let s=e.join(e.getAppRootDir(),"src","environments",i),o=await lh(e,s);if(typeof o=="string"&&o.length>0&&o!=="YOUR_API_KEY")return n.envValue=o,n.file=s,n}return n.file=e.join(e.getAppRootDir(),"src","environments",t[t.length-1]),n}async function lh(e,t){let r=await e.readFile(t);return r?ph(e,r):""}function ph(e,t){let r=G(e,t),n="",s=Rr(e,r,"environment");if(s&&s.statement.declarationList.declarations.length>0){let a=s.statement.declarationList.declarations[0].initializer;a&&e.ts.isObjectLiteralExpression(a)&&a.properties.forEach(u=>{e.ts.isPropertyAssignment(u)&&e.ts.isIdentifier(u.name)&&u.name.text===to&&e.ts.isStringLiteral(u.initializer)&&(n=u.initializer.text)})}return n}async function dh(e,t,r,n){let i=G(e,t),o=Rr(e,i,"environment");if(o&&o.statement.declarationList.declarations.length>0){let a=o.statement.declarationList,u=a.declarations[0],c=u.initializer;if(c&&e.ts.isObjectLiteralExpression(c)){let l=e.ts.factory.createPropertyAssignment(e.ts.factory.createIdentifier(r),e.ts.factory.createStringLiteral(n)),p=e.ts.factory.createNodeArray([...c.properties,l]),d=e.ts.factory.updateObjectLiteralExpression(c,p),D=e.ts.factory.updateVariableDeclaration(u,u.name,u.exclamationToken,u.type,d),m=e.ts.factory.updateVariableDeclarationList(a,[D]);return e.ts.factory.updateVariableStatement(o.statement,o.statement.modifiers,m)}return null}return null}async function fh(e,t,r,n){let i=await e.readFile(t);if(i)if(i.includes(r))e.debug(`"${r}" already set in ${t}`);else{e.debug(`Add "${r}" to ${t}`);let s=await dh(e,i,r,n);if(s){let o=De(e,s),a=await e.formatCode(t,o);await e.writeFile(t,a)}return"update"}else{e.debug(`Creating new env file with "${r}" at ${t}`);let s=`
|
|
1031
1031
|
// https://www.builder.io/c/docs/using-your-api-key
|
|
1032
1032
|
export const environment = {
|
|
1033
1033
|
production: false,
|
|
1034
1034
|
builderApiKey: "${n}",
|
|
1035
1035
|
};
|
|
1036
|
-
`.trimStart(),o=await e.formatCode(t,s);return await e.writeFile(t,o),"create"}return null}var uo="builderApiKey";async function Pc(e,t){let r=[],n=t.getSourceFiles(),i=t.getTypeChecker();return await Promise.all(n.map(async s=>{let o=e.basename(s.fileName);if(dD(e,s.fileName)||o.startsWith(".")||o==="node_modules"||lD.has(o))return;let a=e.normalize(s.fileName);if(a===e.registryPath)return;let u=await co(e,i,a,s);r.push(...u)})),r.sort((s,o)=>s.cmpInfo.name.localeCompare(o.cmpInfo.name))}var lD=new Set([]),pD=new Set(["node_modules"]);function dD(e,t){for(let r of pD)if(e.dirname(t).includes(r))return!0;return!1}async function Tc(e,t){let r=e.extname(t).toLowerCase();if(r===".tsx"||r===".jsx"||r===".ts"||r===".js"){let n=await e.readFile(t);if(n)return fD(e,t,n)}return null}function fD(e,t,r){let n=G(e,r);return co(e,null,t,n)}async function co(e,t,r,n){let i=[],s={};r=e.normalize(r);let o=n.statements.filter(l=>e.ts.isClassDeclaration(l)&&CD(e,l)),a=n.statements.find(l=>e.ts.isImportDeclaration(l)&&e.ts.isStringLiteral(l.moduleSpecifier)&&l.moduleSpecifier.text==="@angular/core");if(a&&e.ts.isImportDeclaration(a)){let l=a.importClause?.namedBindings;if(l&&e.ts.isNamedImports(l)){let p=l.elements.find(d=>(d.propertyName??d.name).text==="input");p&&(s.inputSignalImportName=p.name.text)}}let u=await gD(e,t,r,n),c=yD(e,n);return await Promise.all(o.map(async l=>{let p=await mD(e,t,r,l,c,s);i.push(...p)})),i.push(...u),i}async function Ni(e,t,r){if(t.node.fnNode){let{sourceFile:n,typeChecker:i}=await wr(e,t.cmpInfo.filePath,r),o=(await co(e,i,t.cmpInfo.filePath,n)).find(a=>a.cmpInfo.id===t.cmpInfo.id);if(!o)throw new Error(`Could not find component ${t.cmpInfo.name} in ${t.cmpInfo.filePath}`);return o.cmpInfo.inputs}return[]}async function Rc(e,t,r){let n=await ge(e,r.map(o=>o.filePath)),i=n.getTypeChecker();return await Promise.all(r.filter(o=>!(o.name.endsWith("Page")||o.name.endsWith("Module")||o.name==="AppComponent")).map(async o=>{if(!o.isRegistered){let a=n.getSourceFile(o.filePath);if(a){let c=(await co(e,i,o.filePath,a)).find(l=>l.cmpInfo.id===o.id);if(c){o.inputs=nr(e,i,c.node.fnNode);let l=t.find(p=>p.cmpInfo.id===o.id);if(l){let p=await Ni(e,l,n);Ge(o,p)}}}}return o}))}async function mD(e,t,r,n,i,s){let o=[],a=e.relative(e.getAppRootDir(),r),u=re(e,r),c=n.name?.text;if(!c)return o;let l=!1;n.modifiers&&(l=n.modifiers.some(m=>m.kind===e.ts.SyntaxKind.DefaultKeyword));let p=l?"default":c,d=l?"default":"named",g=[];return n.members.forEach(m=>{if(e.ts.isPropertyDeclaration(m)||e.ts.isGetAccessor(m)||e.ts.isSetAccessor(m)){let D=(e.ts.getDecorators(m)??[]).find(E=>hD(e,E))!==void 0&&e.ts.isIdentifier(m.name),v=s?.inputSignalImportName!==void 0&&e.ts.isIdentifier(m.name)&&DD(e,m,s.inputSignalImportName);if(D||v){let E="any";if(e.ts.isSetAccessor(m))E=Ac(e,m.parameters[0].type);else if(m.type&&t){let A=t.getTypeAtLocation(m.type);E=t.typeToString(A)}else E=Ac(e,m.type);let P={name:m.name.text,type:i[E]?"string":E};i[E]&&(P.enum=i[E]),g.push(P)}}}),o.push({cmpInfo:{id:await ee(e,r,c),displayFilePath:Q(e,r),name:te(c),inputs:g,exportName:p,exportType:d,importName:c,filePath:r,relFilePath:a,importPath:u,meta:{...bD(e,n)},framework:"angular"},node:{name:c,fnNode:n,deps:void 0}}),o}async function gD(e,t,r,n){let i=[],s=e.relative(e.getAppRootDir(),r),o=re(e,r);for(let a of n.statements)if(e.ts.isExportDeclaration(a)&&a.exportClause&&e.ts.isNamedExports(a.exportClause))for(let u of a.exportClause.elements){let c=u.name?.text;if(!c)continue;let l=c,p="named",d=[];if(t){let f=t.getSymbolAtLocation(u.name);if(f){let h=t.getDeclaredTypeOfSymbol(f);t.getPropertiesOfType(h).forEach(v=>{let E=v.getDeclarations();E&&E.forEach(P=>{if(e.ts.isPropertyDeclaration(P)){let A=t.getTypeAtLocation(P),F={name:v.getName(),type:xD(e,t,A)};d.push(F)}})})}}let g=e.ts.isExportSpecifier(u)&&u.parent?u.parent.parent:void 0,m;if(g){let f=g.moduleSpecifier;if(f&&e.ts.isStringLiteral(f)){let h=t?.getSymbolAtLocation(f);if(h&&h.declarations&&h.declarations.length>0){let D=h.declarations[0];(!e.ts.isSourceFile(D)||e.ts.isSourceFile(D)&&D.fileName.includes("node_modules"))&&(m=f.text)}}}i.push({cmpInfo:{id:await ee(e,r,c,m),displayFilePath:Q(e,r),name:te(c),inputs:d,exportName:l,exportType:p,importName:c,filePath:r,relFilePath:s,importPath:m||o,externalImportPath:m,framework:"angular"},node:{name:c,fnNode:u,deps:void 0}})}else if(e.ts.isExportDeclaration(a)&&!a.exportClause&&a.moduleSpecifier&&e.ts.isStringLiteral(a.moduleSpecifier)){let u=a.moduleSpecifier.text;if(t)try{let c=t.getSymbolAtLocation(a.moduleSpecifier);if(c&&c.exports){let l=t.getExportsOfModule(c);for(let p of l)if(p.flags&e.ts.SymbolFlags.Class){let d=p.getName();if(d.startsWith("_"))continue;i.push({cmpInfo:{id:await ee(e,r,d,u),displayFilePath:Q(e,r),name:te(d),inputs:[],exportName:d,exportType:"named",importName:d,filePath:r,relFilePath:s,importPath:u,externalImportPath:u,framework:"angular"},node:{name:d,fnNode:a,deps:void 0}})}}}catch(c){console.warn(`Error processing star export from ${u}:`,c)}}return i}function hD(e,t){return Ic(e,t,"Input")}function DD(e,t,r){return e.ts.isPropertyDeclaration(t)&&t.initializer!==void 0&&e.ts.isCallExpression(t.initializer)&&e.ts.isIdentifier(t.initializer.expression)&&t.initializer.expression.text===r}function Ic(e,t,r){if(e.ts.isCallExpression(t.expression)){let n=t.expression;if(e.ts.isIdentifier(n.expression))return n.expression?.text===r}return!1}function CD(e,t){return!!e.ts.getDecorators(t)?.some(i=>e.ts.isCallExpression(i.expression)&&e.ts.isIdentifier(i.expression.expression)&&i.expression.expression.text==="Component")}function Ac(e,t){if(!t)return"any";let r="any";switch(t.kind){case e.ts.SyntaxKind.StringKeyword:r="string";break;case e.ts.SyntaxKind.NumberKeyword:r="number";break;case e.ts.SyntaxKind.BooleanKeyword:r="boolean";break;case e.ts.SyntaxKind.TypeReference:e.ts.isTypeReferenceNode(t)&&e.ts.isIdentifier(t.typeName)&&(r=t.typeName.text);break}return r.includes("|")?"string":r}function yD(e,t){let r={};return e.ts.forEachChild(t,n=>{e.ts.isTypeAliasDeclaration(n)&&e.ts.isUnionTypeNode(n.type)&&n.type.types.every(i=>e.ts.isLiteralTypeNode(i)&&e.ts.isStringLiteral(i.literal))&&(r[n.name.text]=n.type.types.map(i=>i.literal.text))}),r}function xD(e,t,r){let n=t.typeToString(r);if(n==="any"){let i=r.getSymbol();if(i){let s=i.getDeclarations();if(s&&s.length>0){let o=s[0];if(e.ts.isVariableDeclaration(o)){let a=o.type;a&&(n=t.typeToString(t.getTypeAtLocation(a)))}}}}return n}function bD(e,t){let{getDecorators:r,isCallExpression:n,isIdentifier:i,isObjectLiteralExpression:s,isPropertyAssignment:o,isStringLiteral:a,SyntaxKind:u}=e.ts,c,l;return r(t)?.forEach(d=>{if(Ic(e,d,"Component")){let{expression:g}=d;if(n(g)){let[m]=g.arguments;s(m)&&m.properties.forEach(f=>{o(f)&&i(f.name)&&(f.name.escapedText==="selector"&&a(f.initializer)&&(c=f.initializer.text),f.name.escapedText==="standalone"&&(l=f.initializer.kind===u.TrueKeyword))})}}}),{selector:c,standalone:l}}async function lo(e,t,r){let n=e.typescriptEnabled?".ts":".js",i=`app.module${n}`,s=e.join(e.appDir,i),o=await e.readFile(s);if(!o){e.Sentry?.captureException(new Error(`Unable to read app.module.${n} at ${s}`),{extra:{appModuleCode:o,appModulePath:s}});return}let a=await wD(e,s,t,r,o);if(!a){e.Sentry?.captureException(new Error(`Unable to update app.module.${n} at ${s}`),{extra:{appModuleCode:o,appModulePath:s}});return}return await e.writeFile(s,a),s}async function wD(e,t,r,n,i){let s=i,o=G(e,i),a=W(e,t,n);o=q(e,o,{namedImports:[r],importPath:a}),o=q(e,o,{namedImports:["Content"],importPath:"@builder.io/sdk-angular"});let u=[];for(let c of o.statements)if(e.ts.isClassDeclaration(c)&&c.name?.text==="AppModule"){let l=vD(e,r,c);u.push(l)}else u.push(c);return o=e.ts.factory.updateSourceFile(o,u),s=Ce(e,o),s}function vD(e,t,r){let n=e.ts.getDecorators(r);if(n){for(let i of n)if(e.ts.isCallExpression(i.expression)&&e.ts.isIdentifier(i.expression.expression)&&i.expression.expression.text==="NgModule"){let s=i.expression.arguments;if(s.length===1&&e.ts.isObjectLiteralExpression(s[0])){let o=kc(e,s[0],"declarations",t);if(o){let a=kc(e,o,"imports","Content");if(a&&(o=a),o){let u=e.ts.factory.updateDecorator(i,e.ts.factory.updateCallExpression(i.expression,i.expression.expression,i.expression.typeArguments,[o])),l=[...n.map(p=>p===i?u:p),...e.ts.getModifiers(r)||[]];return e.ts.factory.updateClassDeclaration(r,l,r.name,r.typeParameters,r.heritageClauses,r.members)}}}}}return r}function kc(e,t,r,n){let i=[...t.properties],s=i.findIndex(a=>Z(e,a)===r);if(s>-1){let a=i[s];if(e.ts.isPropertyAssignment(a)&&a.initializer&&e.ts.isArrayLiteralExpression(a.initializer)){let u=Bc(e,a.initializer,n);return u?(i[s]=e.ts.factory.updatePropertyAssignment(a,a.name,u),e.ts.factory.updateObjectLiteralExpression(t,i)):null}return null}let o=Bc(e,e.ts.factory.createArrayLiteralExpression([],!0),n);return o?e.ts.factory.updateObjectLiteralExpression(t,[...i,e.ts.factory.createPropertyAssignment(r,o)]):null}function Bc(e,t,r){return t.elements.some(i=>e.ts.isIdentifier(i)?i.text===r:!1)?null:e.ts.factory.updateArrayLiteralExpression(t,[...t.elements,e.ts.factory.createIdentifier(r)])}async function Oi(e,t,r,n){let s=`app.routes${e.typescriptEnabled?".ts":".js"}`,o=e.join(e.appDir,s);try{if(e.magicast){let a=await e.magicast.loadFile(o);Object.keys(a.exports).length===0&&(a.exports.routes=[]);let c=Object.keys(a.exports)[0],l=a.exports[c];if(l.find(d=>d.path===t))return;let p=e.magicast.builders.raw("{}");if(p.path=t,p.component=e.magicast.builders.raw(r),l.push(p),a.imports.$items.find(d=>d.imported===r))return;a.imports.$append({imported:r,from:n}),await e.magicast.writeFile(a,o)}}catch(a){let u=null;try{u=e.readFileSync(o)}catch(c){e.Sentry?.captureException(c,{level:"warning"})}e.Sentry?.captureException(a,{extra:{content:u,appRoutesPath:o,componentName:r,componentPath:n}})}}var Gc=De(Kc(),1);async function Wc(e){let t=e.ts.findConfigFile(e.getAppRootDir(),e.existsSync);if(t){let r=await e.readFile(t);if(!r)return;let n=Gc.default.parse(r);if(!n||typeof n!="object"||Array.isArray(n))return;let i=n.compilerOptions;if(!i||typeof i!="object"||Array.isArray(i))return;let s=i.paths;(!s||typeof s!="object"||Array.isArray(s))&&(i.paths={},s=i.paths),Object.assign(i.paths,{"~/*":["./src/*"]}),await e.writeFile(t,JSON.stringify(n,null,2))}}async function zc(e){let t=[],r=await _D(e,t);t.push(...await ho(e)),await kD(e,r);let n="BuilderPage";if(!await e.exists(e.builderPageComponentPath)){let i=await e.formatCode(e.builderPageComponentPath,Jc(e,n,e.builderPageComponentPath,"builder-page","page",!0));await e.writeFile(e.builderPageComponentPath,i),t.push({filePath:e.builderPageComponentPath,modifiedType:"create"})}if(e.hasAppModule){await lo(e,"Counter",r);let i=await lo(e,n,e.builderPageComponentPath);i&&t.push({filePath:i,modifiedType:"update"})}return await Oi(e,"**",n,"./components/builder-page.component"),t}async function qc(e){let t=[];t.push(...await ho(e));let r="FigmaImportsPage",n="figma-imports.component",i=e.join(e.componentsDir,`${n}.${e.typescriptEnabled?"ts":"js"}`);if(!await e.exists(i)){let s=await e.formatCode(i,Jc(e,r,i,"figma-imports","figma-imports",!1));await e.writeFile(i,s),t.push({filePath:i,modifiedType:"create"})}if(e.hasAppModule){let s=await lo(e,r,i);s&&t.push({filePath:s,modifiedType:"update"})}return await Oi(e,"figma-imports",r,`./components/${n}`),await Wc(e),t}async function ho(e){let t=[];return await e.exists(e.registryPath)||(await e.writeFile(e.registryPath,BD(e)),t.push({filePath:e.registryPath,modifiedType:"create"})),t}async function kD(e,t){let n=(await Ft(e,null,!1,!1,null,null,!1,!1)).components.find(i=>i.filePath===t);n&&await Ft(e,n.id,!0,!1,null,null,!0,!1)}function Jc(e,t,r,n,i,s){let o=!e.hasAppModule,a=W(e,r,e.registryPath),u=e.join(e.getAppRootDir(),"src","environments","environment.ts"),c=W(e,r,u),l=s?` <ng-container *ngIf="content || isPreviewing; else notFound">
|
|
1036
|
+
`.trimStart(),o=await e.formatCode(t,s);return await e.writeFile(t,o),"create"}return null}var to="builderApiKey";async function pc(e,t){let r=[],n=t.getSourceFiles(),i=t.getTypeChecker();return await Promise.all(n.map(async s=>{let o=e.basename(s.fileName);if(hh(e,s.fileName)||o.startsWith(".")||o==="node_modules"||mh.has(o))return;let a=e.normalize(s.fileName);if(a===e.registryPath)return;let u=await ro(e,i,a,s);r.push(...u)})),r.sort((s,o)=>s.cmpInfo.name.localeCompare(o.cmpInfo.name))}var mh=new Set([]),gh=new Set(["node_modules"]);function hh(e,t){for(let r of gh)if(e.dirname(t).includes(r))return!0;return!1}async function dc(e,t){let r=e.extname(t).toLowerCase();if(r===".tsx"||r===".jsx"||r===".ts"||r===".js"){let n=await e.readFile(t);if(n)return Dh(e,t,n)}return null}function Dh(e,t,r){let n=G(e,r);return ro(e,null,t,n)}async function ro(e,t,r,n){let i=[],s={};r=e.normalize(r);let o=n.statements.filter(l=>e.ts.isClassDeclaration(l)&&wh(e,l)),a=n.statements.find(l=>e.ts.isImportDeclaration(l)&&e.ts.isStringLiteral(l.moduleSpecifier)&&l.moduleSpecifier.text==="@angular/core");if(a&&e.ts.isImportDeclaration(a)){let l=a.importClause?.namedBindings;if(l&&e.ts.isNamedImports(l)){let p=l.elements.find(d=>(d.propertyName??d.name).text==="input");p&&(s.inputSignalImportName=p.name.text)}}let u=await yh(e,t,r,n),c=Eh(e,n);return await Promise.all(o.map(async l=>{let p=await Ch(e,t,r,l,c,s);i.push(...p)})),i.push(...u),i}async function bi(e,t,r){if(t.node.fnNode){let{sourceFile:n,typeChecker:i}=await Er(e,t.cmpInfo.filePath,r),o=(await ro(e,i,t.cmpInfo.filePath,n)).find(a=>a.cmpInfo.id===t.cmpInfo.id);if(!o)throw new Error(`Could not find component ${t.cmpInfo.name} in ${t.cmpInfo.filePath}`);return o.cmpInfo.inputs}return[]}async function fc(e,t,r){let n=await ge(e,r.map(o=>o.filePath)),i=n.getTypeChecker();return await Promise.all(r.filter(o=>!(o.name.endsWith("Page")||o.name.endsWith("Module")||o.name==="AppComponent")).map(async o=>{if(!o.isRegistered){let a=n.getSourceFile(o.filePath);if(a){let c=(await ro(e,i,o.filePath,a)).find(l=>l.cmpInfo.id===o.id);if(c){o.inputs=ir(e,i,c.node.fnNode);let l=t.find(p=>p.cmpInfo.id===o.id);if(l){let p=await bi(e,l,n);We(o,p)}}}}return o}))}async function Ch(e,t,r,n,i,s){let o=[],a=e.relative(e.getAppRootDir(),r),u=te(e,r),c=n.name?.text;if(!c)return o;let l=!1;n.modifiers&&(l=n.modifiers.some(m=>m.kind===e.ts.SyntaxKind.DefaultKeyword));let p=l?"default":c,d=l?"default":"named",D=[];return n.members.forEach(m=>{if(e.ts.isPropertyDeclaration(m)||e.ts.isGetAccessor(m)||e.ts.isSetAccessor(m)){let h=(e.ts.getDecorators(m)??[]).find(v=>xh(e,v))!==void 0&&e.ts.isIdentifier(m.name),E=s?.inputSignalImportName!==void 0&&e.ts.isIdentifier(m.name)&&bh(e,m,s.inputSignalImportName);if(h||E){let v="any";if(e.ts.isSetAccessor(m))v=lc(e,m.parameters[0].type);else if(m.type&&t){let A=t.getTypeAtLocation(m.type);v=t.typeToString(A)}else v=lc(e,m.type);let P={name:m.name.text,type:i[v]?"string":v};i[v]&&(P.enum=i[v]),D.push(P)}}}),o.push({cmpInfo:{id:await Z(e,r,c),displayFilePath:Y(e,r),name:ee(c),inputs:D,exportName:p,exportType:d,importName:c,filePath:r,relFilePath:a,importPath:u,meta:{...Sh(e,n)},framework:"angular"},node:{name:c,fnNode:n,deps:void 0}}),o}async function yh(e,t,r,n){let i=[],s=e.relative(e.getAppRootDir(),r),o=te(e,r);for(let a of n.statements)if(e.ts.isExportDeclaration(a)&&a.exportClause&&e.ts.isNamedExports(a.exportClause))for(let u of a.exportClause.elements){let c=u.name?.text;if(!c)continue;let l=c,p="named",d=[];if(t){let f=t.getSymbolAtLocation(u.name);if(f){let g=t.getDeclaredTypeOfSymbol(f);t.getPropertiesOfType(g).forEach(E=>{let v=E.getDeclarations();v&&v.forEach(P=>{if(e.ts.isPropertyDeclaration(P)){let A=t.getTypeAtLocation(P),F={name:E.getName(),type:vh(e,t,A)};d.push(F)}})})}}let D=e.ts.isExportSpecifier(u)&&u.parent?u.parent.parent:void 0,m;if(D){let f=D.moduleSpecifier;if(f&&e.ts.isStringLiteral(f)){let g=t?.getSymbolAtLocation(f);if(g&&g.declarations&&g.declarations.length>0){let h=g.declarations[0];(!e.ts.isSourceFile(h)||e.ts.isSourceFile(h)&&h.fileName.includes("node_modules"))&&(m=f.text)}}}i.push({cmpInfo:{id:await Z(e,r,c,m),displayFilePath:Y(e,r),name:ee(c),inputs:d,exportName:l,exportType:p,importName:c,filePath:r,relFilePath:s,importPath:m||o,externalImportPath:m,framework:"angular"},node:{name:c,fnNode:u,deps:void 0}})}else if(e.ts.isExportDeclaration(a)&&!a.exportClause&&a.moduleSpecifier&&e.ts.isStringLiteral(a.moduleSpecifier)){let u=a.moduleSpecifier.text;if(t)try{let c=t.getSymbolAtLocation(a.moduleSpecifier);if(c&&c.exports){let l=t.getExportsOfModule(c);for(let p of l)if(p.flags&e.ts.SymbolFlags.Class){let d=p.getName();if(d.startsWith("_"))continue;i.push({cmpInfo:{id:await Z(e,r,d,u),displayFilePath:Y(e,r),name:ee(d),inputs:[],exportName:d,exportType:"named",importName:d,filePath:r,relFilePath:s,importPath:u,externalImportPath:u,framework:"angular"},node:{name:d,fnNode:a,deps:void 0}})}}}catch(c){console.warn(`Error processing star export from ${u}:`,c)}}return i}function xh(e,t){return mc(e,t,"Input")}function bh(e,t,r){return e.ts.isPropertyDeclaration(t)&&t.initializer!==void 0&&e.ts.isCallExpression(t.initializer)&&e.ts.isIdentifier(t.initializer.expression)&&t.initializer.expression.text===r}function mc(e,t,r){if(e.ts.isCallExpression(t.expression)){let n=t.expression;if(e.ts.isIdentifier(n.expression))return n.expression?.text===r}return!1}function wh(e,t){return!!e.ts.getDecorators(t)?.some(i=>e.ts.isCallExpression(i.expression)&&e.ts.isIdentifier(i.expression.expression)&&i.expression.expression.text==="Component")}function lc(e,t){if(!t)return"any";let r="any";switch(t.kind){case e.ts.SyntaxKind.StringKeyword:r="string";break;case e.ts.SyntaxKind.NumberKeyword:r="number";break;case e.ts.SyntaxKind.BooleanKeyword:r="boolean";break;case e.ts.SyntaxKind.TypeReference:e.ts.isTypeReferenceNode(t)&&e.ts.isIdentifier(t.typeName)&&(r=t.typeName.text);break}return r.includes("|")?"string":r}function Eh(e,t){let r={};return e.ts.forEachChild(t,n=>{e.ts.isTypeAliasDeclaration(n)&&e.ts.isUnionTypeNode(n.type)&&n.type.types.every(i=>e.ts.isLiteralTypeNode(i)&&e.ts.isStringLiteral(i.literal))&&(r[n.name.text]=n.type.types.map(i=>i.literal.text))}),r}function vh(e,t,r){let n=t.typeToString(r);if(n==="any"){let i=r.getSymbol();if(i){let s=i.getDeclarations();if(s&&s.length>0){let o=s[0];if(e.ts.isVariableDeclaration(o)){let a=o.type;a&&(n=t.typeToString(t.getTypeAtLocation(a)))}}}}return n}function Sh(e,t){let{getDecorators:r,isCallExpression:n,isIdentifier:i,isObjectLiteralExpression:s,isPropertyAssignment:o,isStringLiteral:a,SyntaxKind:u}=e.ts,c,l;return r(t)?.forEach(d=>{if(mc(e,d,"Component")){let{expression:D}=d;if(n(D)){let[m]=D.arguments;s(m)&&m.properties.forEach(f=>{o(f)&&i(f.name)&&(f.name.escapedText==="selector"&&a(f.initializer)&&(c=f.initializer.text),f.name.escapedText==="standalone"&&(l=f.initializer.kind===u.TrueKeyword))})}}}),{selector:c,standalone:l}}async function no(e,t,r){let n=e.typescriptEnabled?".ts":".js",i=`app.module${n}`,s=e.join(e.appDir,i),o=await e.readFile(s);if(!o){e.Sentry?.captureException(new Error(`Unable to read app.module.${n} at ${s}`),{extra:{appModuleCode:o,appModulePath:s}});return}let a=await Fh(e,s,t,r,o);if(!a){e.Sentry?.captureException(new Error(`Unable to update app.module.${n} at ${s}`),{extra:{appModuleCode:o,appModulePath:s}});return}return await e.writeFile(s,a),s}async function Fh(e,t,r,n,i){let s=i,o=G(e,i),a=W(e,t,n);o=z(e,o,{namedImports:[r],importPath:a}),o=z(e,o,{namedImports:["Content"],importPath:"@builder.io/sdk-angular"});let u=[];for(let c of o.statements)if(e.ts.isClassDeclaration(c)&&c.name?.text==="AppModule"){let l=Ah(e,r,c);u.push(l)}else u.push(c);return o=e.ts.factory.updateSourceFile(o,u),s=De(e,o),s}function Ah(e,t,r){let n=e.ts.getDecorators(r);if(n){for(let i of n)if(e.ts.isCallExpression(i.expression)&&e.ts.isIdentifier(i.expression.expression)&&i.expression.expression.text==="NgModule"){let s=i.expression.arguments;if(s.length===1&&e.ts.isObjectLiteralExpression(s[0])){let o=gc(e,s[0],"declarations",t);if(o){let a=gc(e,o,"imports","Content");if(a&&(o=a),o){let u=e.ts.factory.updateDecorator(i,e.ts.factory.updateCallExpression(i.expression,i.expression.expression,i.expression.typeArguments,[o])),l=[...n.map(p=>p===i?u:p),...e.ts.getModifiers(r)||[]];return e.ts.factory.updateClassDeclaration(r,l,r.name,r.typeParameters,r.heritageClauses,r.members)}}}}}return r}function gc(e,t,r,n){let i=[...t.properties],s=i.findIndex(a=>X(e,a)===r);if(s>-1){let a=i[s];if(e.ts.isPropertyAssignment(a)&&a.initializer&&e.ts.isArrayLiteralExpression(a.initializer)){let u=hc(e,a.initializer,n);return u?(i[s]=e.ts.factory.updatePropertyAssignment(a,a.name,u),e.ts.factory.updateObjectLiteralExpression(t,i)):null}return null}let o=hc(e,e.ts.factory.createArrayLiteralExpression([],!0),n);return o?e.ts.factory.updateObjectLiteralExpression(t,[...i,e.ts.factory.createPropertyAssignment(r,o)]):null}function hc(e,t,r){return t.elements.some(i=>e.ts.isIdentifier(i)?i.text===r:!1)?null:e.ts.factory.updateArrayLiteralExpression(t,[...t.elements,e.ts.factory.createIdentifier(r)])}async function wi(e,t,r,n){let s=`app.routes${e.typescriptEnabled?".ts":".js"}`,o=e.join(e.appDir,s);try{if(e.magicast){let a=await e.magicast.loadFile(o);Object.keys(a.exports).length===0&&(a.exports.routes=[]);let c=Object.keys(a.exports)[0],l=a.exports[c];if(l.find(d=>d.path===t))return;let p=e.magicast.builders.raw("{}");if(p.path=t,p.component=e.magicast.builders.raw(r),l.push(p),a.imports.$items.find(d=>d.imported===r))return;a.imports.$append({imported:r,from:n}),await e.magicast.writeFile(a,o)}}catch(a){let u=null;try{u=e.readFileSync(o)}catch(c){e.Sentry?.captureException(c,{level:"warning"})}e.Sentry?.captureException(a,{extra:{content:u,appRoutesPath:o,componentName:r,componentPath:n}})}}var Pc=we(Ac(),1);async function Tc(e){let t=e.ts.findConfigFile(e.getAppRootDir(),e.existsSync);if(t){let r=await e.readFile(t);if(!r)return;let n=Pc.default.parse(r);if(!n||typeof n!="object"||Array.isArray(n))return;let i=n.compilerOptions;if(!i||typeof i!="object"||Array.isArray(i))return;let s=i.paths;(!s||typeof s!="object"||Array.isArray(s))&&(i.paths={},s=i.paths),Object.assign(i.paths,{"~/*":["./src/*"]}),await e.writeFile(t,JSON.stringify(n,null,2))}}async function Rc(e){let t=[],r=await Lh(e,t);t.push(...await uo(e)),await Nh(e,r);let n="BuilderPage";if(!await e.exists(e.builderPageComponentPath)){let i=await e.formatCode(e.builderPageComponentPath,kc(e,n,e.builderPageComponentPath,"builder-page","page",!0));await e.writeFile(e.builderPageComponentPath,i),t.push({filePath:e.builderPageComponentPath,modifiedType:"create"})}if(e.hasAppModule){await no(e,"Counter",r);let i=await no(e,n,e.builderPageComponentPath);i&&t.push({filePath:i,modifiedType:"update"})}return await wi(e,"**",n,"./components/builder-page.component"),t}async function Ic(e){let t=[];t.push(...await uo(e));let r="FigmaImportsPage",n="figma-imports.component",i=e.join(e.componentsDir,`${n}.${e.typescriptEnabled?"ts":"js"}`);if(!await e.exists(i)){let s=await e.formatCode(i,kc(e,r,i,"figma-imports","figma-imports",!1));await e.writeFile(i,s),t.push({filePath:i,modifiedType:"create"})}if(e.hasAppModule){let s=await no(e,r,i);s&&t.push({filePath:s,modifiedType:"update"})}return await wi(e,"figma-imports",r,`./components/${n}`),await Tc(e),t}async function uo(e){let t=[];return await e.exists(e.registryPath)||(await e.writeFile(e.registryPath,Oh(e)),t.push({filePath:e.registryPath,modifiedType:"create"})),t}async function Nh(e,t){let n=(await Tt(e,null,!1,!1,null,null,!1,!1)).components.find(i=>i.filePath===t);n&&await Tt(e,n.id,!0,!1,null,null,!0,!1)}function kc(e,t,r,n,i,s){let o=!e.hasAppModule,a=W(e,r,e.registryPath),u=e.join(e.getAppRootDir(),"src","environments","environment.ts"),c=W(e,r,u),l=s?` <ng-container *ngIf="content || isPreviewing; else notFound">
|
|
1037
1037
|
<builder-content
|
|
1038
1038
|
[model]="model"
|
|
1039
1039
|
[content]="content"
|
|
@@ -1071,7 +1071,7 @@ export class ${t} {
|
|
|
1071
1071
|
`:""}
|
|
1072
1072
|
@Input() model = '${i}';
|
|
1073
1073
|
|
|
1074
|
-
apiKey = environment.${
|
|
1074
|
+
apiKey = environment.${to};
|
|
1075
1075
|
${e.typescriptEnabled?`
|
|
1076
1076
|
content: BuilderContent | null = null;
|
|
1077
1077
|
`:`
|
|
@@ -1099,12 +1099,12 @@ export class ${t} {
|
|
|
1099
1099
|
}
|
|
1100
1100
|
}
|
|
1101
1101
|
|
|
1102
|
-
`.trimStart()}function
|
|
1102
|
+
`.trimStart()}function Oh(e){return e.typescriptEnabled?`import type { RegisteredComponent } from "@builder.io/sdk-angular";
|
|
1103
1103
|
|
|
1104
1104
|
export const CUSTOM_COMPONENTS: RegisteredComponent[] = [
|
|
1105
1105
|
];`:`export const CUSTOM_COMPONENTS = [
|
|
1106
1106
|
];
|
|
1107
|
-
`}async function
|
|
1107
|
+
`}async function Lh(e,t){let n=e.typescriptEnabled?"ts":"js",i=e.join(e.componentsDir,`counter.component.${n}`),s=await e.exists(i);e.debug(`angularEnsureCounterComponent, hasCounterCmp: ${s}`);let o=Mh(e);if(!s){let a=await e.formatCode(i,o);await e.writeFile(i,a),t.push({filePath:i,modifiedType:"create"})}return i}function Mh(e){return`
|
|
1108
1108
|
import { Component, Input } from '@angular/core';
|
|
1109
1109
|
|
|
1110
1110
|
@Component({
|
|
@@ -1172,7 +1172,7 @@ export class Counter {
|
|
|
1172
1172
|
}
|
|
1173
1173
|
}
|
|
1174
1174
|
|
|
1175
|
-
`.trimStart()}async function Yc(e){await ho(e);let t=await e.readFile(e.registryPath);return t?ND(e,t):{components:[],sourceFile:G(e,"")}}async function ND(e,t){let r=G(e,t);return OD(e,r)}async function OD(e,t){let r=[],n=fe(e,t,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(i,s)=>{let o=await Wi(e,t,i);o&&(o.nodeIndex=s,r.push(o))})),{sourceFile:t,components:Be(r)}}async function Wi(e,t,r){if(!e.ts.isObjectLiteralExpression(r))return null;let n={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],framework:"angular"};for(let i of r.properties){if(!e.ts.isPropertyAssignment(i)||!e.ts.isIdentifier(i.name))continue;if(Z(e,i)==="component"){let o,{initializer:a}=i;if(e.ts.isIdentifier(a))o=a.text;else if(e.ts.isCallExpression(a)){let c=a.arguments[0];e.ts.isIdentifier(c)&&(o=c.text)}if(!o)continue;n.name===""&&(n.name=te(o)),n.importName=o;let u=await Dt(e,e.registryPath,t,o);if(!u)continue;if(n.filePath=u.filePath,n.relFilePath=u.relFilePath,await e.exists(u.filePath)?n.importPath=re(e,u.filePath):(n.externalImportPath=u.importPath,n.importPath=n.externalImportPath),n.displayFilePath=u.displayFilePath,n.exportType=u.exportType,n.externalImportPath)n.exportName=o;else{let c=await Tc(e,u.filePath);if(c&&c.length>0)if(c.length===1)n.exportName=c[0].cmpInfo.exportName;else{let l=c.find(p=>p.cmpInfo.exportName===o);l&&(n.exportName=l.cmpInfo.exportName)}}continue}}return n=Ne(e,n,r),n.filePath&&n.exportName&&(n.id=await ee(e,n.filePath,n.exportName,n.externalImportPath)),n}async function Ft(e,t,r,n,i,s,o,a){let u=await Gt(e),[c,l,p]=await Promise.all([Pc(e,u),Yc(e),gn(e)]),d=c.map(v=>v.cmpInfo),g=l.components,m={components:lt(d,g),registryPath:e.registryPath,registryDisplayPath:Q(e,e.registryPath),frameworks:e.getFrameworks(),dependencies:et(d),publicApiKey:p.envValue??void 0,devToolsVersion:e.version};if(a)return m.components=await Rc(e,c,m.components),m;let f=!1,h=l.sourceFile,D=Array.isArray(t)?t:typeof t=="string"?[t]:[];if(D.length>0){let v=D.map(A=>{let F=c.find(T=>T.cmpInfo.id===A);if(!F)throw new Error(`Component ${A} not found`);return F}),E=Array.from(new Set(v.map(A=>A.cmpInfo.filePath))),P=await ge(e,E);for(let A of v){let F=m.components.find(y=>y.id===A.cmpInfo.id),T=await Ni(e,A,P);Ge(F,T);let k=d.findIndex(y=>y.id===A.cmpInfo.id);d[k].inputs=T;let I=bt(A.cmpInfo.id,d,g,r,n,i,s),{elements:S,elmIndex:C,statementIndex:$,statement:O,variableDeclaration:L}=await MD(e,h,A);if(I.addCmpToRegistry)S.push(LD(e,I.addCmpToRegistry)),f=!0;else if(I.removeCmpFromRegistry)S.splice(C,1),f=!0;else if(I.updateRegisteredCmp){let y=he(e,S[C],I.updateRegisteredCmp);S[C]=e.ts.factory.updateObjectLiteralExpression(y,[Qc(e,I.updateRegisteredCmp),...y.properties.slice(1)]),f=!0}if(f&&o){let y=[...h.statements];y[$]=e.ts.factory.updateVariableStatement(O,O.modifiers,e.ts.factory.updateVariableDeclarationList(O.declarationList,[e.ts.factory.updateVariableDeclaration(L,L.name,L.exclamationToken,L.type,e.ts.factory.createArrayLiteralExpression(yt(e,S)))])),h=e.ts.factory.updateSourceFile(h,y),F.exportType==="named"?h=q(e,h,{namedImports:[F.importName],importPath:F.externalImportPath?F.externalImportPath:W(e,e.registryPath,F.filePath)}):h=q(e,h,{defaultImport:F.importName,importPath:F.externalImportPath?F.externalImportPath:W(e,e.registryPath,F.filePath)}),h=q(e,h,{namedImports:["RegisteredComponent"],importPath:"@builder.io/sdk-angular",isTypeOnly:!0}),h=wt(e,h,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),m.components=I.components,g=I.components.filter(x=>x.isRegistered)}}}if(f&&o){h=xt(e,h),h=Ct(e,h);let v=Ce(e,h);v=ct(v),v=await e.formatCode(e.registryPath,v),await e.writeFile(e.registryPath,v)}return m}function Qc(e,t){let r=e.ts.factory.createIdentifier(t.importName);return e.ts.factory.createPropertyAssignment("component",r)}function LD(e,t){return he(e,e.ts.factory.createObjectLiteralExpression([Qc(e,t)],!0),t)}async function MD(e,t,r){let n=fe(e,t,"CUSTOM_COMPONENTS");if(!n)throw new Error(`Exported name of the Builder registry must be "CUSTOM_COMPONENTS". Please update your Builder registry file: ${e.registryPath}`);let i=n.arrayLiteralExp.elements.filter(o=>e.ts.isObjectLiteralExpression(o)),s=-1;for(let o=0;o<i.length;o++)if((await Wi(e,t,i[o]))?.id===r.cmpInfo.id){s=o;break}return{...n,elements:i,elmIndex:s}}async function Xc(e){let t=await jD(e);return{builderPageOptions:async()=>({templateContentId:"f0b8016ac92e474699293211a268ebaa",pathname:"/builder-demo",title:"Builder + Angular Demo Page"}),ensureBuilderSetup:()=>zc(t),ensureFigmaImportPage:()=>qc(t),getRegistryPath:()=>t.registryPath,getRegistry:n=>Ft(t,null,!1,!1,null,null,!1,!!n?.readAllInputTypes),addExternalPackage:async n=>{t.addExternalPackage(n)},loadComponent:async n=>{let i=await Ft(t,n.cmpId,!1,!1,null,null,!1,!1);return{...i,component:i.components.find(s=>s.id===n.cmpId)}},registerComponent:n=>Ft(t,n.cmpId,!0,!1,null,null,!0,!1),setRegisteredComponentInfo:n=>Ft(t,n.cmpId,!1,!1,n,null,!0,!1),setRegisteredComponentInput:n=>Ft(t,n.cmpId,!1,!1,null,n,!0,!1),unregisterComponent:n=>Ft(t,n.cmpId,!1,!0,null,null,!0,!1),getPublicApiKey:()=>gn(t),setPublicApiKey:n=>Fc(t,n.publicApiKey),getDependencies:n=>[{name:"@builder.io/dev-tools"},{name:"@builder.io/sdk-angular"},{name:"concurrently"}],getDevRunCommand:()=>"builder-dev",getCache:()=>Xe(t),setCache:n=>Ze(t,n)}}async function jD(e){let t=await UD(e),r=e.getAppRootDir(),n=e.join(r,"src"),i=await Re(e),s=e.join(n,"app"),o=await $e(e,s),a={},u={...e,srcDir:"",appDir:"",componentsDir:"",registryPath:o,angularConfigPath:t,typescriptEnabled:i,builderPageComponentPath:"",hasAppModule:!1,addExternalPackage:p=>{a[e.join(r,p,"index.ts")]=`export * from "${p}";`},readFileSync:p=>a[p]??e.readFileSync(p),existsSync:p=>!!a[p]||e.existsSync(p),readdirSync:p=>{let d=e.readdirSync(p);return p===r?[...d,...Object.keys(a).map(g=>g.slice(r.length+1))]:d},readdir:async p=>{let d=await e.readdir(p);return p===r?[...d,...Object.keys(a).map(g=>g.slice(r.length+1))]:d}};if(!await e.exists(n))throw new Error(`Could not find src directory. Searched for src in "${e.getAppRootDir()}".`);u.srcDir=n,u.appDir=s,u.componentsDir=e.join(u.appDir,"components"),u.builderPageComponentPath=e.join(u.componentsDir,`builder-page.component.${i?"ts":"js"}`);let c=`app.module.${i?"ts":"js"}`,l=e.join(u.appDir,c);return await e.exists(l)&&(u.hasAppModule=!0),u}async function UD(e){let t=e.join(e.getAppRootDir(),"angular.json");if(await e.exists(t))return t;let r=e.join(e.getAppRootDir(),"project.json");if(await e.exists(r))return r;if(e.ignoreMissingConfig)return"";throw new Error(`Could not find Angular config file. Searched for angular.json & project.json in "${e.getAppRootDir()}".`)}async function Cn(e){let t=e.configType==="vite"?HD:VD;return await mt(e,[".env"],t)}async function Zc(e,t){let r=await Cn(e),n=await gt(e,r.file,r.envKey,t);return{...r,modifiedType:n}}var HD="VITE_PUBLIC_BUILDER_KEY",VD="PUBLIC_BUILDER_KEY";async function tl(e,t,r){try{let n=await e.readFile(t);if(!n)return null;let i=e.relative(e.getAppRootDir(),t),s=t.split("/").pop()?.replace(".vue","")||"UnknownComponent",o=zD(s),a=GD(n,r),u=KD(n);return{id:qD(t),name:o,filePath:i,relFilePath:i,inputs:a,framework:"vue",exportType:"default",exportName:"default",importName:o,importPath:i,vueApiType:u}}catch(n){return console.warn(`Failed to parse Vue component ${t}:`,n),null}}function KD(e){return/<script[^>]*\s+setup[^>]*>/.test(e)?"composition-setup":/import\s+\{[^}]*\b(ref|reactive|computed|watch|onMounted|defineComponent)\b[^}]*\}\s+from\s+['"]vue['"]/.test(e)||/setup\s*\([^)]*\)\s*\{/.test(e)?"composition":"options"}function GD(e,t){if(!t)return[];let r=[],n=[/defineProps<\s*\{([^}]+)\}\s*>\s*\(\s*\)/g,/defineProps\s*\(\s*\{([^}]+)\}\s*\)/g,/defineProps\s*\(\s*\[([^\]]+)\]\s*\)/g];for(let u of n){let c;for(;(c=u.exec(e))!==null;){let l=c[1];l.includes(":")?r.push(...zi(l)):r.push(...el(l))}}let i=/props\s*:\s*(\{[^}]+\}|\[[^\]]+\])/g,s;for(;(s=i.exec(e))!==null;){let u=s[1];if(u.startsWith("{")){let c=u.slice(1,-1);r.push(...zi(c))}else{let c=u.slice(1,-1);r.push(...el(c))}}let o=/setup\s*\(\s*props\s*(?::\s*\{([^}]+)\})?\s*[,)]?/g,a;for(;(a=o.exec(e))!==null;)a[1]&&r.push(...zi(a[1]));return WD(r)}function zi(e){let t=[],r=/(\w+)\s*:\s*([^,;]+)/g,n;for(;(n=r.exec(e))!==null;){let[,o,a]=n;t.push({name:o.trim(),type:qi(a.trim()),required:!a.includes("?")&&!a.includes("undefined")})}let i=/(\w+)\s*:\s*\{([^}]+)\}/g;for(;(n=i.exec(e))!==null;){let[,o,a]=n,u=a.match(/type\s*:\s*(\w+)/),c=a.match(/required\s*:\s*(true|false)/),l=a.match(/default\s*:\s*([^,}]+)/);t.push({name:o.trim(),type:u?qi(u[1]):"any",required:c?c[1]==="true":!1,defaultValue:l?l[1].trim():void 0})}let s=/(\w+)\s*:\s*(\w+)(?=\s*[,}])/g;for(;(n=s.exec(e))!==null;){let[,o,a]=n;t.some(u=>u.name===o.trim())||t.push({name:o.trim(),type:qi(a.trim()),required:!1})}return t}function el(e){let t=[],r=e.split(",").map(n=>n.trim().replace(/['"]/g,"")).filter(n=>n.length>0);for(let n of r)t.push({name:n,type:"any",required:!1});return t}function qi(e){let t={String:"string",Number:"number",Boolean:"boolean",Array:"any[]",Object:"object",Function:"function",Date:"Date",Symbol:"symbol",string:"string",number:"number",boolean:"boolean",object:"object",function:"function"},r=e.replace(/\s*\|\s*undefined/g,"").replace(/\?$/,"");return t[r]||r||"any"}function WD(e){let t=new Set;return e.filter(r=>t.has(r.name)?!1:(t.add(r.name),!0))}function zD(e){return e.replace(/[-_\s]+(.)?/g,(t,r)=>r?r.toUpperCase():"").replace(/^(.)/,(t,r)=>r?r.toUpperCase():"")}function qD(e){return e.replace(/[^a-zA-Z0-9]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").toLowerCase()}async function ur(e,t){let r=await JD(e,t.readAllInputTypes),n=await Cn(e);return{components:r,registryPath:e.registryPath,registryDisplayPath:e.relative(e.getAppRootDir(),e.registryPath),frameworks:e.getFrameworks(),dependencies:et(r),publicApiKey:n.envValue??void 0,devToolsVersion:e.version}}async function JD(e,t){let r=[],n=await YD(e,e.getAppRootDir());for(let i of n){let s=await tl(e,i,t);s&&r.push(s)}return r}async function YD(e,t){let r=[],n=async s=>{try{let o=await e.readdir(s);for(let a of o){let u=e.join(s,a);(await e.stat(u)).isDirectory()?!a.startsWith(".")&&a!=="node_modules"&&a!=="dist"&&a!=="build"&&a!==".nuxt"&&a!==".output"&&await n(u):a.endsWith(".vue")&&r.push(u)}}catch{}};await n(t);let i=["components","pages","layouts"];for(let s of i){let o=e.join(t,s);try{(await e.stat(o)).isDirectory()&&await n(o)}catch{}}return r}async function rl(e){let t={errors:[]};try{await ol(e)}catch(r){t.errors.push(r instanceof Error?r.message:String(r))}return t}async function nl(e){let t=[];t.push(...await ol(e));let n=e.join(e.componentsDir,"FigmaImports.vue");if(!await e.exists(n)){let i=await e.formatCode(n,QD(e,n,"figma-imports"));await e.writeFile(n,i),t.push({filePath:n,modifiedType:"create"})}return t}async function ol(e){let t=[];return await e.exists(e.registryPath)||(await e.writeFile(e.registryPath,ZD(e)),t.push({filePath:e.registryPath,modifiedType:"create"})),t}function QD(e,t,r="page"){let n=W(e,t,e.registryPath),i=e.typescriptEnabled;return e.isNuxt?`<template>
|
|
1175
|
+
`.trimStart()}async function Bc(e){await uo(e);let t=await e.readFile(e.registryPath);return t?jh(e,t):{components:[],sourceFile:G(e,"")}}async function jh(e,t){let r=G(e,t);return Uh(e,r)}async function Uh(e,t){let r=[],n=fe(e,t,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(i,s)=>{let o=await Ii(e,t,i);o&&(o.nodeIndex=s,r.push(o))})),{sourceFile:t,components:$e(r)}}async function Ii(e,t,r){if(!e.ts.isObjectLiteralExpression(r))return null;let n={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],framework:"angular"};for(let i of r.properties){if(!e.ts.isPropertyAssignment(i)||!e.ts.isIdentifier(i.name))continue;if(X(e,i)==="component"){let o,{initializer:a}=i;if(e.ts.isIdentifier(a))o=a.text;else if(e.ts.isCallExpression(a)){let c=a.arguments[0];e.ts.isIdentifier(c)&&(o=c.text)}if(!o)continue;n.name===""&&(n.name=ee(o)),n.importName=o;let u=await xt(e,e.registryPath,t,o);if(!u)continue;if(n.filePath=u.filePath,n.relFilePath=u.relFilePath,await e.exists(u.filePath)?n.importPath=te(e,u.filePath):(n.externalImportPath=u.importPath,n.importPath=n.externalImportPath),n.displayFilePath=u.displayFilePath,n.exportType=u.exportType,n.externalImportPath)n.exportName=o;else{let c=await dc(e,u.filePath);if(c&&c.length>0)if(c.length===1)n.exportName=c[0].cmpInfo.exportName;else{let l=c.find(p=>p.cmpInfo.exportName===o);l&&(n.exportName=l.cmpInfo.exportName)}}continue}}return n=Oe(e,n,r),n.filePath&&n.exportName&&(n.id=await Z(e,n.filePath,n.exportName,n.externalImportPath)),n}async function Tt(e,t,r,n,i,s,o,a){let u=await zt(e),[c,l,p]=await Promise.all([pc(e,u),Bc(e),pn(e)]),d=c.map(E=>E.cmpInfo),D=l.components,m={components:ft(d,D),registryPath:e.registryPath,registryDisplayPath:Y(e,e.registryPath),frameworks:e.getFrameworks(),dependencies:rt(d),publicApiKey:p.envValue??void 0,devToolsVersion:e.version};if(a)return m.components=await fc(e,c,m.components),m;let f=!1,g=l.sourceFile,h=Array.isArray(t)?t:typeof t=="string"?[t]:[];if(h.length>0){let E=h.map(A=>{let F=c.find(T=>T.cmpInfo.id===A);if(!F)throw new Error(`Component ${A} not found`);return F}),v=Array.from(new Set(E.map(A=>A.cmpInfo.filePath))),P=await ge(e,v);for(let A of E){let F=m.components.find(y=>y.id===A.cmpInfo.id),T=await bi(e,A,P);We(F,T);let k=d.findIndex(y=>y.id===A.cmpInfo.id);d[k].inputs=T;let I=vt(A.cmpInfo.id,d,D,r,n,i,s),{elements:S,elmIndex:C,statementIndex:$,statement:O,variableDeclaration:L}=await Hh(e,g,A);if(I.addCmpToRegistry)S.push(Vh(e,I.addCmpToRegistry)),f=!0;else if(I.removeCmpFromRegistry)S.splice(C,1),f=!0;else if(I.updateRegisteredCmp){let y=he(e,S[C],I.updateRegisteredCmp);S[C]=e.ts.factory.updateObjectLiteralExpression(y,[$c(e,I.updateRegisteredCmp),...y.properties.slice(1)]),f=!0}if(f&&o){let y=[...g.statements];y[$]=e.ts.factory.updateVariableStatement(O,O.modifiers,e.ts.factory.updateVariableDeclarationList(O.declarationList,[e.ts.factory.updateVariableDeclaration(L,L.name,L.exclamationToken,L.type,e.ts.factory.createArrayLiteralExpression(wt(e,S)))])),g=e.ts.factory.updateSourceFile(g,y),F.exportType==="named"?g=z(e,g,{namedImports:[F.importName],importPath:F.externalImportPath?F.externalImportPath:W(e,e.registryPath,F.filePath)}):g=z(e,g,{defaultImport:F.importName,importPath:F.externalImportPath?F.externalImportPath:W(e,e.registryPath,F.filePath)}),g=z(e,g,{namedImports:["RegisteredComponent"],importPath:"@builder.io/sdk-angular",isTypeOnly:!0}),g=St(e,g,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),m.components=I.components,D=I.components.filter(x=>x.isRegistered)}}}if(f&&o){g=Et(e,g),g=bt(e,g);let E=De(e,g);E=dt(E),E=await e.formatCode(e.registryPath,E),await e.writeFile(e.registryPath,E)}return m}function $c(e,t){let r=e.ts.factory.createIdentifier(t.importName);return e.ts.factory.createPropertyAssignment("component",r)}function Vh(e,t){return he(e,e.ts.factory.createObjectLiteralExpression([$c(e,t)],!0),t)}async function Hh(e,t,r){let n=fe(e,t,"CUSTOM_COMPONENTS");if(!n)throw new Error(`Exported name of the Builder registry must be "CUSTOM_COMPONENTS". Please update your Builder registry file: ${e.registryPath}`);let i=n.arrayLiteralExp.elements.filter(o=>e.ts.isObjectLiteralExpression(o)),s=-1;for(let o=0;o<i.length;o++)if((await Ii(e,t,i[o]))?.id===r.cmpInfo.id){s=o;break}return{...n,elements:i,elmIndex:s}}async function _c(e){let t=await Kh(e);return{builderPageOptions:async()=>({templateContentId:"f0b8016ac92e474699293211a268ebaa",pathname:"/builder-demo",title:"Builder + Angular Demo Page"}),ensureBuilderSetup:()=>Rc(t),ensureFigmaImportPage:()=>Ic(t),getRegistryPath:()=>t.registryPath,getRegistry:n=>Tt(t,null,!1,!1,null,null,!1,!!n?.readAllInputTypes),addExternalPackage:async n=>{t.addExternalPackage(n)},loadComponent:async n=>{let i=await Tt(t,n.cmpId,!1,!1,null,null,!1,!1);return{...i,component:i.components.find(s=>s.id===n.cmpId)}},registerComponent:n=>Tt(t,n.cmpId,!0,!1,null,null,!0,!1),setRegisteredComponentInfo:n=>Tt(t,n.cmpId,!1,!1,n,null,!0,!1),setRegisteredComponentInput:n=>Tt(t,n.cmpId,!1,!1,null,n,!0,!1),unregisterComponent:n=>Tt(t,n.cmpId,!1,!0,null,null,!0,!1),getPublicApiKey:()=>pn(t),setPublicApiKey:n=>cc(t,n.publicApiKey),getDependencies:n=>[{name:"@builder.io/dev-tools"},{name:"@builder.io/sdk-angular"},{name:"concurrently"}],getDevRunCommand:()=>"builder-dev",getCache:()=>et(t),setCache:n=>tt(t,n)}}async function Kh(e){let t=await Gh(e),r=e.getAppRootDir(),n=e.join(r,"src"),i=await Ie(e),s=e.join(n,"app"),o=await Ne(e,s),a={},u={...e,srcDir:"",appDir:"",componentsDir:"",registryPath:o,angularConfigPath:t,typescriptEnabled:i,builderPageComponentPath:"",hasAppModule:!1,addExternalPackage:p=>{a[e.join(r,p,"index.ts")]=`export * from "${p}";`},readFileSync:p=>a[p]??e.readFileSync(p),existsSync:p=>!!a[p]||e.existsSync(p),readdirSync:p=>{let d=e.readdirSync(p);return p===r?[...d,...Object.keys(a).map(D=>D.slice(r.length+1))]:d},readdir:async p=>{let d=await e.readdir(p);return p===r?[...d,...Object.keys(a).map(D=>D.slice(r.length+1))]:d}};if(!await e.exists(n))throw new Error(`Could not find src directory. Searched for src in "${e.getAppRootDir()}".`);u.srcDir=n,u.appDir=s,u.componentsDir=e.join(u.appDir,"components"),u.builderPageComponentPath=e.join(u.componentsDir,`builder-page.component.${i?"ts":"js"}`);let c=`app.module.${i?"ts":"js"}`,l=e.join(u.appDir,c);return await e.exists(l)&&(u.hasAppModule=!0),u}async function Gh(e){let t=e.join(e.getAppRootDir(),"angular.json");if(await e.exists(t))return t;let r=e.join(e.getAppRootDir(),"project.json");if(await e.exists(r))return r;if(e.ignoreMissingConfig)return"";throw new Error(`Could not find Angular config file. Searched for angular.json & project.json in "${e.getAppRootDir()}".`)}async function mn(e){let t=e.configType==="vite"?Wh:zh;return await Dt(e,[".env"],t)}async function Nc(e,t){let r=await mn(e),n=await Ct(e,r.file,r.envKey,t);return{...r,modifiedType:n}}var Wh="VITE_PUBLIC_BUILDER_KEY",zh="PUBLIC_BUILDER_KEY";async function Lc(e,t,r){try{let n=await e.readFile(t);if(!n)return null;let i=e.relative(e.getAppRootDir(),t),s=t.split("/").pop()?.replace(".vue","")||"UnknownComponent",o=Qh(s),a=Jh(n,r),u=qh(n);return{id:Xh(t),name:o,filePath:i,relFilePath:i,inputs:a,framework:"vue",exportType:"default",exportName:"default",importName:o,importPath:i,vueApiType:u}}catch(n){return console.warn(`Failed to parse Vue component ${t}:`,n),null}}function qh(e){return/<script[^>]*\s+setup[^>]*>/.test(e)?"composition-setup":/import\s+\{[^}]*\b(ref|reactive|computed|watch|onMounted|defineComponent)\b[^}]*\}\s+from\s+['"]vue['"]/.test(e)||/setup\s*\([^)]*\)\s*\{/.test(e)?"composition":"options"}function Jh(e,t){if(!t)return[];let r=[],n=[/defineProps<\s*\{([^}]+)\}\s*>\s*\(\s*\)/g,/defineProps\s*\(\s*\{([^}]+)\}\s*\)/g,/defineProps\s*\(\s*\[([^\]]+)\]\s*\)/g];for(let u of n){let c;for(;(c=u.exec(e))!==null;){let l=c[1];l.includes(":")?r.push(...ki(l)):r.push(...Oc(l))}}let i=/props\s*:\s*(\{[^}]+\}|\[[^\]]+\])/g,s;for(;(s=i.exec(e))!==null;){let u=s[1];if(u.startsWith("{")){let c=u.slice(1,-1);r.push(...ki(c))}else{let c=u.slice(1,-1);r.push(...Oc(c))}}let o=/setup\s*\(\s*props\s*(?::\s*\{([^}]+)\})?\s*[,)]?/g,a;for(;(a=o.exec(e))!==null;)a[1]&&r.push(...ki(a[1]));return Yh(r)}function ki(e){let t=[],r=/(\w+)\s*:\s*([^,;]+)/g,n;for(;(n=r.exec(e))!==null;){let[,o,a]=n;t.push({name:o.trim(),type:Bi(a.trim()),required:!a.includes("?")&&!a.includes("undefined")})}let i=/(\w+)\s*:\s*\{([^}]+)\}/g;for(;(n=i.exec(e))!==null;){let[,o,a]=n,u=a.match(/type\s*:\s*(\w+)/),c=a.match(/required\s*:\s*(true|false)/),l=a.match(/default\s*:\s*([^,}]+)/);t.push({name:o.trim(),type:u?Bi(u[1]):"any",required:c?c[1]==="true":!1,defaultValue:l?l[1].trim():void 0})}let s=/(\w+)\s*:\s*(\w+)(?=\s*[,}])/g;for(;(n=s.exec(e))!==null;){let[,o,a]=n;t.some(u=>u.name===o.trim())||t.push({name:o.trim(),type:Bi(a.trim()),required:!1})}return t}function Oc(e){let t=[],r=e.split(",").map(n=>n.trim().replace(/['"]/g,"")).filter(n=>n.length>0);for(let n of r)t.push({name:n,type:"any",required:!1});return t}function Bi(e){let t={String:"string",Number:"number",Boolean:"boolean",Array:"any[]",Object:"object",Function:"function",Date:"Date",Symbol:"symbol",string:"string",number:"number",boolean:"boolean",object:"object",function:"function"},r=e.replace(/\s*\|\s*undefined/g,"").replace(/\?$/,"");return t[r]||r||"any"}function Yh(e){let t=new Set;return e.filter(r=>t.has(r.name)?!1:(t.add(r.name),!0))}function Qh(e){return e.replace(/[-_\s]+(.)?/g,(t,r)=>r?r.toUpperCase():"").replace(/^(.)/,(t,r)=>r?r.toUpperCase():"")}function Xh(e){return e.replace(/[^a-zA-Z0-9]/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").toLowerCase()}async function lr(e,t){let r=await Zh(e,t.readAllInputTypes),n=await mn(e);return{components:r,registryPath:e.registryPath,registryDisplayPath:e.relative(e.getAppRootDir(),e.registryPath),frameworks:e.getFrameworks(),dependencies:rt(r),publicApiKey:n.envValue??void 0,devToolsVersion:e.version}}async function Zh(e,t){let r=[],n=await eD(e,e.getAppRootDir());for(let i of n){let s=await Lc(e,i,t);s&&r.push(s)}return r}async function eD(e,t){let r=[],n=async s=>{try{let o=await e.readdir(s);for(let a of o){let u=e.join(s,a);(await e.stat(u)).isDirectory()?!a.startsWith(".")&&a!=="node_modules"&&a!=="dist"&&a!=="build"&&a!==".nuxt"&&a!==".output"&&await n(u):a.endsWith(".vue")&&r.push(u)}}catch{}};await n(t);let i=["components","pages","layouts"];for(let s of i){let o=e.join(t,s);try{(await e.stat(o)).isDirectory()&&await n(o)}catch{}}return r}async function Mc(e){let t={errors:[]};try{await Uc(e)}catch(r){t.errors.push(r instanceof Error?r.message:String(r))}return t}async function jc(e){let t=[];t.push(...await Uc(e));let n=e.join(e.componentsDir,"FigmaImports.vue");if(!await e.exists(n)){let i=await e.formatCode(n,tD(e,n,"figma-imports"));await e.writeFile(n,i),t.push({filePath:n,modifiedType:"create"})}return t}async function Uc(e){let t=[];return await e.exists(e.registryPath)||(await e.writeFile(e.registryPath,nD(e)),t.push({filePath:e.registryPath,modifiedType:"create"})),t}function tD(e,t,r="page"){let n=W(e,t,e.registryPath),i=e.typescriptEnabled;return e.isNuxt?`<template>
|
|
1176
1176
|
<div>
|
|
1177
1177
|
<div v-if="pending">Loading...</div>
|
|
1178
1178
|
<div v-else-if="error">Error loading content</div>
|
|
@@ -1228,7 +1228,7 @@ export default defineComponent({
|
|
|
1228
1228
|
},
|
|
1229
1229
|
setup() {
|
|
1230
1230
|
const model = '${r}'
|
|
1231
|
-
const apiKey = ${
|
|
1231
|
+
const apiKey = ${rD(e)}
|
|
1232
1232
|
const content = ref${i?"<any>":""}(null)
|
|
1233
1233
|
const loading = ref(true)
|
|
1234
1234
|
const customComponents = CUSTOM_COMPONENTS
|
|
@@ -1261,7 +1261,7 @@ export default defineComponent({
|
|
|
1261
1261
|
}
|
|
1262
1262
|
}
|
|
1263
1263
|
})
|
|
1264
|
-
</script>`}function
|
|
1264
|
+
</script>`}function rD(e){return e.isNuxt?"useRuntimeConfig().public.builderApiKey":e.configType==="vite"?"import.meta.env.VITE_BUILDER_API_KEY":"process.env.VUE_APP_BUILDER_API_KEY"}function nD(e){return`import type { RegisteredComponent } from "@builder.io/sdk-vue";
|
|
1265
1265
|
|
|
1266
1266
|
export const CUSTOM_COMPONENTS: RegisteredComponent[] = [
|
|
1267
1267
|
// Add your Vue components here
|
|
@@ -1278,19 +1278,19 @@ export const CUSTOM_COMPONENTS: RegisteredComponent[] = [
|
|
|
1278
1278
|
// ]
|
|
1279
1279
|
// }
|
|
1280
1280
|
];
|
|
1281
|
-
`}async function
|
|
1281
|
+
`}async function Vc(e){let t=await oD(e);return{builderPageOptions:async()=>({templateContentId:"vue-demo-template-id",pathname:"/builder-demo",title:"Builder + Vue Demo Page"}),ensureBuilderSetup:async()=>(await Mc(t)).errors.length>0?[]:[],ensureFigmaImportPage:()=>jc(t),getRegistryPath:()=>t.registryPath,getRegistry:n=>lr(t,{readAllInputTypes:!!n?.readAllInputTypes}),addExternalPackage:n=>{t.addExternalPackage(n)},loadComponent:async n=>{let i=await lr(t,{readAllInputTypes:!1}),s=i.components.find(o=>o.id===n.cmpId);return{...i,component:s}},registerComponent:async n=>lr(t,{readAllInputTypes:!1}),setRegisteredComponentInfo:async n=>lr(t,{readAllInputTypes:!1}),setRegisteredComponentInput:async n=>lr(t,{readAllInputTypes:!1}),unregisterComponent:async n=>lr(t,{readAllInputTypes:!1}),getPublicApiKey:()=>mn(t),setPublicApiKey:n=>Nc(t,n.publicApiKey),getDependencies:n=>n.sdkVersion===N.gen2?[{name:"@builder.io/dev-tools"},{name:"@builder.io/sdk-vue"}]:[{name:"@builder.io/dev-tools"},{name:"@builder.io/vue"},{name:"@builder.io/sdk"}],getDevRunCommand:()=>"dev",getCache:()=>et(t),setCache:n=>tt(t,n)}}async function oD(e){let t=await iD(e),r=e.getAppRootDir(),n=e.join(r,"src"),i=await Ie(e),s={},o={...e,srcDir:null,builderComponentPath:"",componentsDir:"",registryPath:"",vueConfigPath:t,typescriptEnabled:i,configType:"",isNuxt:await sD(e),addExternalPackage:c=>{s[e.join(r,c,"index.ts")]=`export * from "${c}";`},readFileSync:c=>s[c]??e.readFileSync(c),existsSync:c=>!!s[c]||e.existsSync(c),readdirSync:c=>{let l=e.readdirSync(c);return c===r?[...l,...Object.keys(s).map(p=>p.slice(r.length+1))]:l},readdir:async c=>{let l=await e.readdir(c);return c===r?[...l,...Object.keys(s).map(p=>p.slice(r.length+1))]:l}};t.includes("webpack.config")&&(o.configType="webpack"),(t.includes("vite.config")||t.includes("nuxt.config"))&&(o.configType="vite");let a=await e.exists(n);o.srcDir=a?n:null;let u=[e.join(r,"components"),e.join(r,"src","components"),e.join(r,"app","components")];for(let c of u)if(await e.exists(c)){o.componentsDir=c;break}return o.componentsDir||(o.componentsDir=a?e.join(n,"components"):e.join(r,"components")),o.registryPath=await Ne(e,o.componentsDir),o}async function iD(e){let t=["nuxt.config.ts","nuxt.config.js","vite.config.ts","vite.config.js","webpack.config.js","webpack.config.ts","vue.config.js","vue.config.ts"];for(let r of t){let n=e.join(e.getAppRootDir(),r);if(await e.exists(n))return n}if(e.ignoreMissingConfig)return"";throw new Error(`Could not find Vue config file. Searched for ${t.join(", ")} in "${e.getAppRootDir()}".`)}async function sD(e){let t=["nuxt.config.ts","nuxt.config.js"];for(let r of t){let n=e.join(e.getAppRootDir(),r);if(await e.exists(n))return!0}try{let r=e.join(e.getAppRootDir(),"package.json");if(await e.exists(r)){let n=JSON.parse(await e.readFile(r)||"{}"),i={...n.dependencies,...n.devDependencies};return!!(i.nuxt||i["@nuxt/kit"]||i.nuxt3)}}catch{}return!1}var fo=we(tl(),1);async function rl(e,t){let n={components:(await t.getRegistry()).components.filter(s=>s.isRegistered).map(s=>{let o={filePath:ct(e.relative(e.getAppRootDir(),s.filePath)),name:s.name,image:s.image,description:s.description,exportName:s.exportName,inputs:Ke(s.inputs)};return Ke(o)}),version:1};e.debug("exporting registry components:",n.components.length);let i=(0,fo.compress)(n);return btoa(JSON.stringify(i))}async function nl(e,t,r){if(typeof r!="string")throw new Error("Invalid registry to import");let n=await t.getRegistry(),i=JSON.parse(atob(r)),s=(0,fo.decompress)(i),o=Ke(n);e.debug("importing registry components:",s.components.length);for(let a of s.components){let u=ct(e.normalize(a.filePath)),c=n.components.find(p=>ct(p.filePath).endsWith(u)&&p.exportName===a.exportName);if(!c){console.error(`Could not find component to register: ${a.filePath}, ${a.exportName}`);continue}e.debug(`register (${c.id})`,c.filePath),await t.registerComponent({cmpId:c.id});for(let p of a.inputs)e.debug(`set input (${c.id})`),await t.setRegisteredComponentInput({cmpId:c.id,name:p.name,type:p.type,required:p.required,defaultValue:p.defaultValue,friendlyName:p.friendlyName,helperText:p.helperText});e.debug(`set input (${c.id}) info`);let l=await t.setRegisteredComponentInfo({cmpId:c.id,name:a.name,image:a.image,description:a.description});o=Ke(l)}return o}var ze={react:"react",remix:"remix",angular:"angular",next:"next",qwik:"qwik",vue:"vue"},XA={[ze.react]:[{version:N.gen1,recommended:!0},{version:N.gen2,recommended:!1}],[ze.remix]:[{version:N.gen1,recommended:!1},{version:N.gen2,recommended:!0}],[ze.angular]:[{version:N.gen2,recommended:!0}],[ze.next]:[{version:N.gen1,recommended:!0},{version:N.gen2,recommended:!1}],[ze.qwik]:[{version:N.gen2,recommended:!0}],[ze.vue]:[{version:N.gen1,recommended:!0},{version:N.gen2,recommended:!1}]};async function ol(e,t){let r=[],n=new Set;async function i(s){let o=e.join(s,"package.json");try{if(!await e.exists(o))return null;let u=await e.readFile(o);if(u===null)throw new Error(`Failed to read package.json at ${o}`);let c=JSON.parse(u);if(typeof c.name!="string"||c.name.trim()===""||n.has(c.name))return null;n.add(c.name);let l={name:c.name,subPackages:[]},p=await e.readdir(s);for(let d of p)d!=="node_modules"&&(await e.stat(e.join(s,d))).isDirectory()&&l.subPackages.push(d);return r.push(l),l}catch(a){return e.Sentry?.captureException(a,{level:"warning"}),null}}try{let s=e.join(t,"package.json");if(await e.exists(s)){let a=await e.readFile(s);if(a!==null){let u=JSON.parse(a),c={...u.dependencies,...u.devDependencies};for(let l of Object.keys(c)){let p=e.join(t,"node_modules",l);await i(p)}if(Array.isArray(u.workspaces))for(let l of u.workspaces){let p=await e.readdir(e.join(t,l));for(let d of p){let D=e.join(t,l,d);await i(D)}}}}}catch(s){e.Sentry?.captureException(s,{level:"warning"})}return r}var RD={"@builder.io/qwik-city":Gu,next:$u,"@remix-run/react":Zu,react:uc,"@angular/core":_c,vue:Vc},ID={"@builder.io/qwik-city":ze.qwik,next:ze.next,"@remix-run/react":ze.remix,react:ze.react,"@angular/core":ze.angular,vue:ze.vue};async function mo(e){if(!e.ts)throw new Error("createDevTools() requires a TypeScript instance passed to the 'ts' option");if((!e.frameworks||e.frameworks.length===0)&&(e.frameworks=await vr(e)),e.frameworks.length===0)throw new Error("Supported Devtools framework for not found");for(let t of e.frameworks){let r=RD[t.name];if(r)try{let n=await r(e);return{...n,exportRegistry:()=>rl(e,n),importRegistry:s=>nl(e,n,s),framework:ID[t.name],findAllDependencies:async()=>await ol(e,e.getRepoRootDir())}}catch(n){e.Sentry?.captureException(n,{level:"warning"})}}throw new Error(`Devtools framework not found for ${e.getAppRootDir()}, ${JSON.stringify(e.frameworks,null,2)}`)}var qP=`
|
|
1282
1282
|
/** @type {import('next').NextConfig} */
|
|
1283
1283
|
const nextConfig = {
|
|
1284
1284
|
}
|
|
1285
1285
|
|
|
1286
1286
|
module.exports = nextConfig
|
|
1287
|
-
`.trimStart();import*as
|
|
1288
|
-
`);let
|
|
1287
|
+
`.trimStart();import*as il from"@sentry/node";import*as sl from"@amplitude/analytics-node";async function Ut(e){if(process.env.NODE_ENV!=="test")try{await Promise.allSettled([il.flush(2e3),sl.flush().promise])}catch(t){console.error(t)}process.exit(e)}var dr=process.env.AIR_HOST||"https://api.builder.io";import*as Lr from"@amplitude/analytics-node";import*as Dn from"@sentry/node";var Ee=[];for(let e=0;e<256;++e)Ee.push((e+256).toString(16).slice(1));function al(e,t=0){return(Ee[e[t+0]]+Ee[e[t+1]]+Ee[e[t+2]]+Ee[e[t+3]]+"-"+Ee[e[t+4]]+Ee[e[t+5]]+"-"+Ee[e[t+6]]+Ee[e[t+7]]+"-"+Ee[e[t+8]]+Ee[e[t+9]]+"-"+Ee[e[t+10]]+Ee[e[t+11]]+Ee[e[t+12]]+Ee[e[t+13]]+Ee[e[t+14]]+Ee[e[t+15]]).toLowerCase()}import kD from"crypto";var ho=new Uint8Array(256),go=ho.length;function Ji(){return go>ho.length-16&&(kD.randomFillSync(ho),go=0),ho.slice(go,go+=16)}import BD from"crypto";var Yi={randomUUID:BD.randomUUID};function $D(e,t,r){if(Yi.randomUUID&&!t&&!e)return Yi.randomUUID();e=e||{};let n=e.random||(e.rng||Ji)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let i=0;i<16;++i)t[r+i]=n[i];return t}return al(n)}var Qi=$D;var fr=class extends Error{},ot=class extends fr{constructor({type:r,cause:n,message:i,suggestions:s=[],hostname:o,port:a,statusCode:u,errorCode:c}){super(i,{cause:n});ve(this,"type");ve(this,"suggestions");ve(this,"hostname");ve(this,"port");ve(this,"statusCode");ve(this,"errorCode");this.name="NetworkError",this.type=r,this.suggestions=s,this.hostname=o,this.port=a,this.statusCode=u,this.errorCode=c}};function Xi(e,t,r){switch(e.code){case"ECONNREFUSED":return new ot({type:"connection_refused",cause:e,message:`Connection refused to ${t}${r?`:${r}`:""}. The server may be down or unreachable.`,suggestions:["Check your internet connection","Try again in a few minutes - the service may be temporarily unavailable","Contact support if the issue persists"],hostname:t,port:r,errorCode:"ECONNREFUSED"});case"ETIMEDOUT":return new ot({type:"connection_timeout",cause:e,message:`Connection timed out to ${t}${r?`:${r}`:""}. The request took too long to complete.`,suggestions:["Check your internet connection speed","Try again in a few minutes","Contact support if the issue persists"],hostname:t,port:r,errorCode:"ETIMEDOUT"});case"ENOTFOUND":return new ot({type:"dns_not_found",cause:e,message:`Cannot resolve ${t}. The server address could not be found.`,suggestions:["Check your internet connection","Try again in a few minutes","Contact support if the issue persists"],hostname:t,errorCode:"ENOTFOUND"});default:return new ot({type:"unknown",cause:e,message:`Network error connecting to ${t}: ${e.message}`,suggestions:["Check your internet connection","Try again in a few minutes","Contact support if the issue persists"],hostname:t,port:r})}}async function Cn(e,t){let r={...t,app:"dev-tools-cli",package:"cli"},n=await _D(),i=await ND();return await Lr.track(e,r,{user_id:n,device_id:i}).promise}var Do,Zi;async function ul(e){Do=e;let t=await Sr();await qo({...t,userId:e})}async function _D(){if(Do)return Do;let e=await Sr(),t;return zo(e,"userId")&&(t=e.userId),Do=t,t}async function ND(){if(Zi)return Zi;let e=await Sr(),t=Qi();return zo(e,"deviceId")?t=e.deviceId:await qo({...e,deviceId:t}),Zi=t,t}import{fetch as LD}from"undici";var cl="0.0.0";import ll from"process";import*as pl from"@sentry/node";var mr=class extends Error{constructor(r,n,i){super(r,i);ve(this,"code");this.name="CodeGenError",this.code=n}};var Rt=async(e,t)=>{let r="fetch"in globalThis?globalThis.fetch:LD,n=typeof e=="string"?e:e instanceof URL?e.toString():e.url,i=new URL(n),s=i.hostname,o=i.port?parseInt(i.port):void 0;try{let a=pl.getTraceData(),u=await r(e,{...t,headers:{...t?.headers,...MD(),...a}});if(!u.ok){if(u.status===402){let c=await u.json(),l=c.code??"credits-limit-daily",p=c.message??"You've reached the DAY AI credits limit for your current plan.";throw new mr(p,l)}else if(u.status===429){let c=await u.json(),l=c.code??"credits-limit-other",p=c.message??"Rate limit exceeded. Please try again later.";throw new mr(p,l)}if(u.status>=500){let c;try{let l=await u.text();if(l)try{let p=JSON.parse(l);c=p.message||p.error||l}catch{c=l}}catch{}throw new ot({type:"server_error",cause:c?new Error(c):void 0,message:`Server error from ${s} (HTTP ${u.status}). The server encountered an internal error.`,suggestions:["Try again in a few minutes - this may be a temporary issue","Contact support if the problem persists"],hostname:s,statusCode:u.status})}}return u}catch(a){if(a instanceof ot||a instanceof mr||a instanceof Error&&a.name==="AbortError")throw a;if(a instanceof Error){if(a.name==="TypeError"&&a.cause instanceof Error){let p=a.cause;if(p.code)throw Xi(p,s,o)}if(a.code)throw Xi(a,s,o);if(a.message?.includes("SSL")||a.message?.includes("TLS")||a.message?.includes("certificate")||a.message?.includes("CERT"))throw new ot({type:"ssl_error",cause:a,message:`SSL/TLS error connecting to ${s}. The connection could not be secured.`,suggestions:["Check your internet connection","Try again in a few minutes","Contact support@builder.io if the issue persists"],hostname:s})}let u=t?.method||"GET",c=a instanceof Error?a.message:String(a);throw new ot({type:"unknown",cause:a instanceof Error?a:new Error(String(a)),message:`Network error for ${u} ${i.toString()}: ${c}`,suggestions:["Check your internet connection","Try again in a few minutes","Contact support if the issue persists"],hostname:s,port:o})}};function MD(){let t={darwin:"Macintosh",win32:"Windows NT",linux:"Linux",android:"Android",ios:"iPhone"}[ll.platform]||"Unknown",r=ll.platform==="win32"?"10.0":"";return{"User-Agent":`Mozilla/5.0 (${t}${r?"; "+r:""}) builder-cli/${cl}`,"Sec-Ch-Ua-Platform":t}}import*as jD from"@sentry/node";var $t=we(nr(),1);import QT from"prettier";import h1 from"chokidar";import C1 from"ignore";import ml from"process";function ts(){let{env:e}=ml,{TERM:t,TERM_PROGRAM:r}=e;return ml.platform!=="win32"?t!=="linux":!!e.WT_SESSION||!!e.TERMINUS_SUBLIME||e.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||t==="xterm-256color"||t==="alacritty"||t==="rxvt-unicode"||t==="rxvt-unicode-256color"||e.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var rs=we(nr(),1),Mr=we(Kn(),1),bn=we(nr(),1),Co=()=>{let e=ns?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],t=ns?80:120,r,n=!1,i="",s="",o="",a=g=>{let h=g>1?"Something went wrong":"Canceled";n&&D(h,g)},u=(g,h)=>{console.error(h,g),a(2)},c=()=>a(1),l=()=>{process.on("uncaughtExceptionMonitor",u),process.on("unhandledRejection",u),process.on("SIGINT",c),process.on("SIGTERM",c),process.on("exit",a)},p=()=>{process.removeListener("uncaughtExceptionMonitor",u),process.removeListener("unhandledRejection",u),process.removeListener("SIGINT",c),process.removeListener("SIGTERM",c),process.removeListener("exit",a)},d=(g="")=>{n=!0,i=g.replace(/\.+$/,""),process.stdout.write(`${rs.default.gray(KD)}
|
|
1288
|
+
`);let h=0,E=0;l(),process.env.CI||(r=setInterval(()=>{let v=rs.default.magenta(e[h]),P=".".repeat(Math.floor(E)).slice(0,3);process.stdout.write(Mr.cursor.move(-999,-o.split(`
|
|
1289
1289
|
`).length+1)),process.stdout.write(Mr.erase.down(o.split(`
|
|
1290
|
-
`).length));let A=`${
|
|
1290
|
+
`).length));let A=`${v} ${i}${P}${s}`;process.stdout.write(A),h=h+1<e.length?h+1:0,E=E<e.length?E+.125:0,o=A},t))},D=(g,h=0)=>{i=g??i,n=!1,clearInterval(r);let E=h===0?(0,bn.green)(zD):h===1?(0,bn.red)(GD):(0,bn.red)(WD);process.stdout.write(Mr.cursor.move(-999,-o.split(`
|
|
1291
1291
|
`).length+1)),process.stdout.write(Mr.erase.down(o.split(`
|
|
1292
|
-
`).length)),process.stdout.write(`${
|
|
1293
|
-
`),o=i,p()};return{start:d,stop:
|
|
1292
|
+
`).length)),process.stdout.write(`${E} ${i}
|
|
1293
|
+
`),o=i,p()};return{start:d,stop:D,message:(g="")=>{i=g??i},extra:(g="")=>{s=g}}},ns=ts(),yo=(e,t)=>ns?e:t,KD=yo("\u2502","|"),GD=yo("\u25A0","x"),WD=yo("\u25B2","x"),zD=yo("\u25C7","o");var b=we(nr(),1);function os(e){switch(Cn("cli help",{subcommand:e}),console.log(""),_t((0,b.bgCyan)((0,b.bold)((0,b.white)(" help ")))+" "+(0,b.dim)(Ve)),e){case"add":case"generate":case"gen":case"g":_t(`${(0,b.cyan)("\u2192")} ${(0,b.bold)("Generate Figma Components")}
|
|
1294
1294
|
|
|
1295
1295
|
${(0,b.bgGreen)((0,b.white)(` npx ${_e()} figma generate URL [URL ...] `))}
|
|
1296
1296
|
|
|
@@ -1308,7 +1308,7 @@ ${(0,b.yellow)("Arguments:")}
|
|
|
1308
1308
|
${(0,b.cyan)("--ci")} Run in CI mode without interactive prompts
|
|
1309
1309
|
${(0,b.cyan)("--force")} Force operation even if there are warnings
|
|
1310
1310
|
${(0,b.cyan)("--skipInstallation")} Skip the package installation step
|
|
1311
|
-
${(0,b.cyan)("--yes")} Auto-confirm all prompts`);break;case"auth":
|
|
1311
|
+
${(0,b.cyan)("--yes")} Auto-confirm all prompts`);break;case"auth":Q.info(`${(0,b.cyan)("\u2192")} ${(0,b.bold)("Authentication")}
|
|
1312
1312
|
|
|
1313
1313
|
${(0,b.bgGreen)((0,b.white)(` npx ${_e()} auth `))}
|
|
1314
1314
|
|
|
@@ -1343,7 +1343,7 @@ ${(0,b.yellow)("Subcommands:")}
|
|
|
1343
1343
|
|
|
1344
1344
|
${(0,b.bgGreen)((0,b.white)(` npx ${_e()} auth status `))}
|
|
1345
1345
|
|
|
1346
|
-
Check authentication status and user information.`);break;case"publish":
|
|
1346
|
+
Check authentication status and user information.`);break;case"publish":Q.info(`${(0,b.cyan)("\u2192")} ${(0,b.bold)("Publish Mappings")}
|
|
1347
1347
|
|
|
1348
1348
|
${(0,b.bgGreen)((0,b.white)(` npx ${_e()} figma publish `))}
|
|
1349
1349
|
|
|
@@ -1356,7 +1356,7 @@ ${(0,b.yellow)("Arguments:")}
|
|
|
1356
1356
|
${(0,b.cyan)("--verbose")} Print output as JSON
|
|
1357
1357
|
${(0,b.cyan)("--dryrun")} Run without making changes
|
|
1358
1358
|
${(0,b.cyan)("--yes")} Auto-confirm all prompts
|
|
1359
|
-
${(0,b.cyan)("--clearMappings")} Remove all mappings from the space, publishing zero mappings`);break;case"migrate":
|
|
1359
|
+
${(0,b.cyan)("--clearMappings")} Remove all mappings from the space, publishing zero mappings`);break;case"migrate":Q.info(`${(0,b.cyan)("\u2192")} ${(0,b.bold)("Migrate Mappings")}
|
|
1360
1360
|
|
|
1361
1361
|
${(0,b.bgGreen)((0,b.white)(` npx ${_e()} figma migrate `))}
|
|
1362
1362
|
|
|
@@ -1368,7 +1368,7 @@ ${(0,b.yellow)("Description:")}
|
|
|
1368
1368
|
${(0,b.yellow)("Arguments:")}
|
|
1369
1369
|
${(0,b.cyan)("--spaceId")} Builder.io space ID to use
|
|
1370
1370
|
${(0,b.cyan)("--force")} Force migration even if there are warnings
|
|
1371
|
-
${(0,b.cyan)("--yes")} Auto-confirm all prompts`);break;case"code":
|
|
1371
|
+
${(0,b.cyan)("--yes")} Auto-confirm all prompts`);break;case"code":Q.info(`${(0,b.cyan)("\u2192")} ${(0,b.bold)("Code Generation")}
|
|
1372
1372
|
|
|
1373
1373
|
${(0,b.bgGreen)((0,b.white)(` npx ${_e()} code --url URL `))}
|
|
1374
1374
|
|
|
@@ -1386,7 +1386,7 @@ ${(0,b.yellow)("Arguments:")}
|
|
|
1386
1386
|
${(0,b.yellow)("Configuration Files:")}
|
|
1387
1387
|
${(0,b.cyan)(".builderignore")} Add patterns to exclude files from being included in code generation
|
|
1388
1388
|
${(0,b.cyan)(".builderrules")} Add custom instructions that will be injected into the LLM prompt
|
|
1389
|
-
${(0,b.cyan)(".cursorrules")} Cursor's settings are automatically supported for consistent behavior`);break;case"indexing":
|
|
1389
|
+
${(0,b.cyan)(".cursorrules")} Cursor's settings are automatically supported for consistent behavior`);break;case"indexing":Q.info(`${(0,b.cyan)("\u2192")} ${(0,b.bold)("Code Indexing")}
|
|
1390
1390
|
|
|
1391
1391
|
${(0,b.bgGreen)((0,b.white)(` npx ${_e()} code indexing `))}
|
|
1392
1392
|
|
|
@@ -1394,7 +1394,7 @@ Index your codebase to improve code generation results.
|
|
|
1394
1394
|
|
|
1395
1395
|
${(0,b.yellow)("Arguments:")}
|
|
1396
1396
|
${(0,b.cyan)("--spaceId")} Builder.io space ID to use
|
|
1397
|
-
${(0,b.cyan)("--cwd")} Working directory to run commands from`);break;case"index-repo":
|
|
1397
|
+
${(0,b.cyan)("--cwd")} Working directory to run commands from`);break;case"index-repo":Q.info(`${(0,b.cyan)("\u2192")} ${(0,b.bold)("Repository Indexing")}
|
|
1398
1398
|
|
|
1399
1399
|
${(0,b.bgGreen)((0,b.white)(` npx ${_e()} index-repo `))}
|
|
1400
1400
|
|
|
@@ -1402,7 +1402,7 @@ Index your entire repository to improve code generation results.
|
|
|
1402
1402
|
|
|
1403
1403
|
${(0,b.yellow)("Arguments:")}
|
|
1404
1404
|
${(0,b.cyan)("--spaceId")} Builder.io space ID to use
|
|
1405
|
-
${(0,b.cyan)("--cwd")} Working directory to run commands from`);break;case"launch":case"fusion":
|
|
1405
|
+
${(0,b.cyan)("--cwd")} Working directory to run commands from`);break;case"launch":case"fusion":Q.info(`${(0,b.cyan)("\u2192")} ${(0,b.bold)("Fusion Development Server")}
|
|
1406
1406
|
|
|
1407
1407
|
${(0,b.bgGreen)((0,b.white)(` npx ${_e()} launch -p <port> -c <command> `))}
|
|
1408
1408
|
|
|
@@ -1421,7 +1421,7 @@ ${(0,b.yellow)("Example:")}
|
|
|
1421
1421
|
${(0,b.cyan)('npx builder.io launch -p 3000 -c "npm run dev"')}
|
|
1422
1422
|
|
|
1423
1423
|
${(0,b.yellow)("Note:")}
|
|
1424
|
-
- The proxy runs on port ${(0,b.cyan)("48752")} and the API server on port ${(0,b.cyan)("48753")}`);break;case"launch-init":
|
|
1424
|
+
- The proxy runs on port ${(0,b.cyan)("48752")} and the API server on port ${(0,b.cyan)("48753")}`);break;case"launch-init":_t(`${(0,b.cyan)("\u2192")} ${(0,b.bold)("Initialize Builder.io Repository")}
|
|
1425
1425
|
|
|
1426
1426
|
${(0,b.bgGreen)((0,b.white)(` npx ${_e()} init `))}
|
|
1427
1427
|
|
|
@@ -1431,18 +1431,20 @@ ${(0,b.yellow)("Arguments:")}
|
|
|
1431
1431
|
${(0,b.cyan)("--repoFullName")} Repository name in format owner/repo
|
|
1432
1432
|
${(0,b.cyan)("--branchName")} Branch name to clone (required)
|
|
1433
1433
|
${(0,b.cyan)("--githubToken")} GitHub token for private repositories
|
|
1434
|
-
${(0,b.cyan)("--installCommand")} Command to install dependencies (defaults to npm install)`);break;default:
|
|
1435
|
-
`),[{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:"Authenticate with Builder.io"},{command:"auth status",description:"Check authentication status and user information"},{command:"code",description:"Generate or modify code based on Figma designs"},{command:"indexing",description:"Index your codebase to improve code generation results"},{command:"index-repo",description:"Index your entire repository to improve code generation results"},{command:"code-server",description:"Start a development server that provides project file information and code analysis"},{command:"launch",description:"Launch a development server"}].forEach(({command:r,description:n})=>{
|
|
1434
|
+
${(0,b.cyan)("--installCommand")} Command to install dependencies (defaults to npm install)`);break;default:Q.info(`${(0,b.bold)("Available Commands:")}
|
|
1435
|
+
`),[{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:"Authenticate with Builder.io"},{command:"auth status",description:"Check authentication status and user information"},{command:"code",description:"Generate or modify code based on Figma designs"},{command:"indexing",description:"Index your codebase to improve code generation results"},{command:"index-repo",description:"Index your entire repository to improve code generation results"},{command:"code-server",description:"Start a development server that provides project file information and code analysis"},{command:"launch",description:"Launch a development server"}].forEach(({command:r,description:n})=>{Q.info(`${(0,b.cyan)("\u2192")} ${(0,b.bgGreen)((0,b.white)(` npx ${_e()} figma ${r} `))}
|
|
1436
1436
|
${(0,b.dim)(n)}
|
|
1437
|
-
`)}),
|
|
1438
|
-
Use ${(0,b.cyan)(`npx ${_e()} figma help <command>`)} for detailed help about a command`)}
|
|
1439
|
-
`));var t=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(var n=0;n<r.length;n++){var i=r[n];n%2&&!this.options.newlineIsToken?t[t.length-1]+=i:(this.options.ignoreWhitespace&&(i=i.trim()),t.push(i))}return t};var
|
|
1440
|
-
|
|
1437
|
+
`)}),Q.info(`
|
|
1438
|
+
Use ${(0,b.cyan)(`npx ${_e()} figma help <command>`)} for detailed help about a command`)}en("bye \u{1F44B}")}var JD=["steve8708/mui-vite","steve8708/carbon-vite","steve8708/vite-react-shopify-polaris","steve8708/cloudscape-demos","BuilderIO/fusion-angular-tailwind-starter","BuilderIO/fusion-svelte-tailwind-starter","BuilderIO/fusion-vue-tailwind-starter"],YD="BuilderIO/fusion-starter",is=[...JD,YD],G1=is.map(e=>`https://github.com/${e}`);function Vt(){}Vt.prototype={diff:function(t,r){var n,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=i.callback;typeof i=="function"&&(s=i,i={}),this.options=i;var o=this;function a(P){return s?(setTimeout(function(){s(void 0,P)},0),!0):P}t=this.castInput(t),r=this.castInput(r),t=this.removeEmpty(this.tokenize(t)),r=this.removeEmpty(this.tokenize(r));var u=r.length,c=t.length,l=1,p=u+c;i.maxEditLength&&(p=Math.min(p,i.maxEditLength));var d=(n=i.timeout)!==null&&n!==void 0?n:1/0,D=Date.now()+d,m=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(m[0],r,t,0);if(m[0].oldPos+1>=c&&f+1>=u)return a([{value:this.join(r),count:r.length}]);var g=-1/0,h=1/0;function E(){for(var P=Math.max(g,-l);P<=Math.min(h,l);P+=2){var A=void 0,F=m[P-1],T=m[P+1];F&&(m[P-1]=void 0);var k=!1;if(T){var I=T.oldPos-P;k=T&&0<=I&&I<u}var S=F&&F.oldPos+1<c;if(!k&&!S){m[P]=void 0;continue}if(!S||k&&F.oldPos+1<T.oldPos?A=o.addToPath(T,!0,void 0,0):A=o.addToPath(F,void 0,!0,1),f=o.extractCommon(A,r,t,P),A.oldPos+1>=c&&f+1>=u)return a(QD(o,A.lastComponent,r,t,o.useLongestToken));m[P]=A,A.oldPos+1>=c&&(h=Math.min(h,P-1)),f+1>=u&&(g=Math.max(g,P+1))}l++}if(s)(function P(){setTimeout(function(){if(l>p||Date.now()>D)return s();E()||P()},0)})();else for(;l<=p&&Date.now()<=D;){var v=E();if(v)return v}},addToPath:function(t,r,n,i){var s=t.lastComponent;return s&&s.added===r&&s.removed===n?{oldPos:t.oldPos+i,lastComponent:{count:s.count+1,added:r,removed:n,previousComponent:s.previousComponent}}:{oldPos:t.oldPos+i,lastComponent:{count:1,added:r,removed:n,previousComponent:s}}},extractCommon:function(t,r,n,i){for(var s=r.length,o=n.length,a=t.oldPos,u=a-i,c=0;u+1<s&&a+1<o&&this.equals(r[u+1],n[a+1]);)u++,a++,c++;return c&&(t.lastComponent={count:c,previousComponent:t.lastComponent}),t.oldPos=a,u},equals:function(t,r){return this.options.comparator?this.options.comparator(t,r):t===r||this.options.ignoreCase&&t.toLowerCase()===r.toLowerCase()},removeEmpty:function(t){for(var r=[],n=0;n<t.length;n++)t[n]&&r.push(t[n]);return r},castInput:function(t){return t},tokenize:function(t){return t.split("")},join:function(t){return t.join("")}};function QD(e,t,r,n,i){for(var s=[],o;t;)s.push(t),o=t.previousComponent,delete t.previousComponent,t=o;s.reverse();for(var a=0,u=s.length,c=0,l=0;a<u;a++){var p=s[a];if(p.removed){if(p.value=e.join(n.slice(l,l+p.count)),l+=p.count,a&&s[a-1].added){var D=s[a-1];s[a-1]=s[a],s[a]=D}}else{if(!p.added&&i){var d=r.slice(c,c+p.count);d=d.map(function(f,g){var h=n[l+g];return h.length>f.length?h:f}),p.value=e.join(d)}else p.value=e.join(r.slice(c,c+p.count));c+=p.count,p.added||(l+=p.count)}}var m=s[u-1];return u>1&&typeof m.value=="string"&&(m.added||m.removed)&&e.equals("",m.value)&&(s[u-2].value+=m.value,s.pop()),s}var oR=new Vt;var hl=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,Dl=/\S/,Cl=new Vt;Cl.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!Dl.test(e)&&!Dl.test(t)};Cl.tokenize=function(e){for(var t=e.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),r=0;r<t.length-1;r++)!t[r+1]&&t[r+2]&&hl.test(t[r])&&hl.test(t[r+2])&&(t[r]+=t[r+2],t.splice(r+1,2),r--);return t};var yl=new Vt;yl.tokenize=function(e){this.options.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
1439
|
+
`));var t=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(var n=0;n<r.length;n++){var i=r[n];n%2&&!this.options.newlineIsToken?t[t.length-1]+=i:(this.options.ignoreWhitespace&&(i=i.trim()),t.push(i))}return t};var XD=new Vt;XD.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var ZD=new Vt;ZD.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function xo(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?xo=function(t){return typeof t}:xo=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xo(e)}var eC=Object.prototype.toString,wn=new Vt;wn.useLongestToken=!0;wn.tokenize=yl.tokenize;wn.castInput=function(e){var t=this.options,r=t.undefinedReplacement,n=t.stringifyReplacer,i=n===void 0?function(s,o){return typeof o>"u"?r:o}:n;return typeof e=="string"?e:JSON.stringify(ss(e,null,null,i),i," ")};wn.equals=function(e,t){return Vt.prototype.equals.call(wn,e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"))};function ss(e,t,r,n,i){t=t||[],r=r||[],n&&(e=n(i,e));var s;for(s=0;s<t.length;s+=1)if(t[s]===e)return r[s];var o;if(eC.call(e)==="[object Array]"){for(t.push(e),o=new Array(e.length),r.push(o),s=0;s<e.length;s+=1)o[s]=ss(e[s],t,r,n,i);return t.pop(),r.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),xo(e)==="object"&&e!==null){t.push(e),o={},r.push(o);var a=[],u;for(u in e)e.hasOwnProperty(u)&&a.push(u);for(a.sort(),s=0;s<a.length;s+=1)u=a[s],o[u]=ss(e[u],t,r,n,u);t.pop(),r.pop()}else o=e;return o}var as=new Vt;as.tokenize=function(e){return e.slice()};as.join=as.removeEmpty=function(e){return e};import*as tC from"@sentry/node";var Ly=we(Sl(),1);var _y=we(dp(),1);var $y=we(wp(),1),Ep="/_builder.io",PR=Ep+"/api";var Io=class{constructor(){ve(this,"connections",new Set);ve(this,"maxConnections",1e3)}addConnection(t){return this.connections.size>=this.maxConnections?(console.warn(`[ConnectionTracker] Max connections (${this.maxConnections}) reached, rejecting new connection`),!1):(this.connections.add(t),t.on("close",()=>{this.removeConnection(t)}),t.on("error",()=>{this.removeConnection(t)}),!0)}removeConnection(t){this.connections.delete(t)}getConnectionCount(){return this.connections.size}cleanup(){for(let t of this.connections)t.writable&&t.write(`HTTP/1.1 503 Service Unavailable\r
|
|
1440
|
+
\r
|
|
1441
|
+
`),t.destroy();this.connections.clear()}};var $R=new Io;import N2 from"prettier";var o0=we(Ys(),1);var r0=we(Ys(),1);import*as s0 from"@sentry/node";async function Qs(e){let{default:t}=await import("open");await t(e)}import*as a0 from"@sentry/node";var _k=`
|
|
1442
|
+
`+(0,$t.dim)("ESC to interrupt");import*as ut from"typescript";function Xs(e){return!(e.category!==ut.DiagnosticCategory.Error||!e.file||e.code===6133||e.code===6138||e.code===6305||e.code===6196||e.code===6192||e.code===6198||e.code===6199||e.code===6205||e.code===1449||e.code===2578||e.code===7006||e.code===5074||e.code===7026||e.code===2503||e.code===2695||e.code===2322)}async function u0(e,t,r){let n=[],i=[t],s=e.relative(e.getAppRootDir(),t.fileName);for(;i.length>0;){let o=i.shift();if(f0(o,t)){let a=l0(e,o,t,r),{line:u,character:c}=t.getLineAndCharacterOfPosition(o.getStart());a&&(a.loc=`${s}:${u+1}:${c+1}`,n.push(a))}i.push(...o.getChildren(t))}return n}var c0="figmaMapping";function l0(e,t,r,n){let[i]=t.arguments;if(!i)throw new Error("Invalid figmaMapping call, no arguments found");if(!j.isObjectLiteralExpression(i))throw new Error("Invalid figmaMapping call, argument is not an object literal");let s=i.properties;if(!s)throw new Error("Invalid figmaMapping call, argument has no properties");let o="",a,u,c,l="-",p=e.basename(r.fileName).replace(/\.mapper\.[tsxjm]+$/,""),d,D,m,f,g;if(t.typeArguments&&t.typeArguments.length>0){let T=Bd(t.typeArguments[0].getText(r));T&&(p=T)}for(let T of s){let k=T.name?.getText(r);if(!k)throw new Error("Invalid figmaMapping call, property has no name");switch(k){case"componentName":{if(!("initializer"in T))throw new Error("Invalid figmaMapping call, componentName has no initializer");let I=T.initializer;if(!j.isStringLiteral(I))throw new Error("Invalid figmaMapping call, componentName is not a string literal");a=I.text;break}case"url":{if(!("initializer"in T))throw new Error("Invalid figmaMapping call, url has no initializer");let I=T.initializer;if(!j.isStringLiteral(I))throw new Error("Invalid figmaMapping call, url is not a string literal");f=I.text;break}case"componentKey":{if(!("initializer"in T))throw new Error("Invalid figmaMapping call, componentKey has no initializer");let I=T.initializer;if(!j.isStringLiteral(I))throw new Error("Invalid figmaMapping call, componentKey is not a string literal");o=I.text;break}case"meta":{if(!("initializer"in T))throw new Error("Invalid figmaMapping call, meta has no initializer");let I=T.initializer;if(j.isObjectLiteralExpression(I)){g={imports:[]};for(let S of I.properties)j.isPropertyAssignment(S)&&j.isIdentifier(S.name)&&S.name.text==="imports"&&j.isArrayLiteralExpression(S.initializer)&&(g.imports=S.initializer.elements.map($=>{if(j.isStringLiteral($))return $.text;if(j.isObjectLiteralExpression($)){let O={};for(let L of $.properties)if(j.isPropertyAssignment(L)&&j.isIdentifier(L.name)){let y=L.name.text;j.isStringLiteral(L.initializer)&&(O[y]=L.initializer.text)}return O}return null}).filter(Boolean))}break}case"mapper":if(j.isMethodDeclaration(T)){let I=function(C){let O=n.getSymbolAtLocation(C)?.getDeclarations()?.[0];if(O){let L=d0(O);if(L?.importClause){let y=L.importClause.name?.getText(r);return y===l?(d="default",D=y):L.importClause.namedBindings&&j.isNamedImports(L.importClause.namedBindings)&&(d="named",L.importClause.namedBindings.elements.forEach(x=>{x.name.getText(r)===l&&(D=x.name.getText(r))})),D&&j.isStringLiteral(L.moduleSpecifier)&&(m=L.moduleSpecifier.text),!0}}return!1},S=function(C){if((j.isJsxOpeningElement(C)||j.isJsxSelfClosingElement(C))&&j.isIdentifier(C.tagName)){l=C.tagName.getText(r),I(C.tagName);return}else if(j.isTaggedTemplateExpression(C)&&j.isIdentifier(C.tag)&&(C.tag.escapedText==="html"||C.tag.escapedText==="tmpl")){if(j.isTemplateExpression(C.template)){let O=C.template.templateSpans.find(L=>j.isIdentifier(L.expression)&&p0(L.expression.text)&&I(L.expression));if(O&&j.isIdentifier(O.expression)){l=O.expression.text;return}}let $=C.template.getText(r).match(/^`\s*<([^\s]+)/);if($){l=$[1];return}if($=C.template.getText(r).match(/^`\s*([^\s]+)/),$){l=$[1];return}}else j.forEachChild(C,S)};var A=I,F=S;if(T.parameters&&T.parameters.length>0&&T.parameters[0]&&T.parameters[0].type){let C=T.parameters[0].type.getText(r),$=Bd(C);$&&(p=$)}j.forEachChild(T,S),c=T.getText(r).replace(/^mapper/,"function Mapper"),u=Zs(c);break}case"designTokenMapper":if(j.isMethodDeclaration(T)){c=T.getText(r).replace(/^designTokenMapper/,"function Mapper"),u=Zs(c),o="design-tokens";break}case"genericMapper":if(j.isMethodDeclaration(T)){c=T.getText(r).replace(/^genericMapper/,"function Mapper"),u=Zs(c),o="*";break}}}if(!o&&!f)throw new Error("Invalid figmaMapping call, no componentKey or url found");if(!o&&!u)throw new Error("Invalid figmaMapping call, no mapper found");if(!o&&!c)throw new Error("Invalid figmaMapping call, no original mapper found");let h=h0(r),E=g?.imports??[],v=[],P=[];v.push(...h);for(let T of E)typeof T=="string"?P.push(T):v.push(T);return{builderName:l,figmaName:a??p,figmaKey:o,figmaUrl:f,inputMapper:u,exportType:d,importName:D,importPath:m,originalInputMapper:c,imports:v,importStrings:P.length>0?P:void 0,source:"cli"}}function p0(e){return e.charAt(0)===e.charAt(0).toUpperCase()}function Zs(e){return j.transpile(e,{target:j.ScriptTarget.Latest,allowNonTsExtensions:!0,moduleResolution:j.ModuleResolutionKind.NodeJs,module:j.ModuleKind.CommonJS,noImplicitAny:!1,esModuleInterop:!0,noUnusedLocals:!1,noUnusedParameters:!1,jsx:j.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 d0(e){let t=e;for(;t;){if(j.isImportDeclaration(t))return t;t=t.parent}}function f0(e,t){return j.isCallExpression(e)&&e.expression.getText(t)===c0}async function $d(e){let t=["node_modules","dist","build","public"];return(await e.readdirRecursive(e.getAppRootDir(),t)).filter(n=>He(n))}function Bd(e){let t=e.match(/^Figma(\w+)Props$/);if(t&&typeof t[1]=="string")return t[1]}async function _d(e,t,r,n=!1){try{return r||(r=await mo(e)),(await r.setPublicApiKey({publicApiKey:t})).modifiedType==="permission-error"?{success:!1,error:"permission-error"}:(n&&await r.ensureFigmaImportPage(),{success:!0})}catch(i){let s="unknown-error";return i instanceof Error?s=i.message:typeof i=="string"&&(s=i),{success:!1,error:s}}}var m0={getCanonicalFileName:e=>e,getCurrentDirectory:()=>j.sys.getCurrentDirectory(),getNewLine:()=>j.sys.newLine};function g0(e){return j.formatDiagnosticsWithColorAndContext(e,m0)}async function Nd({sys:e,mappingFiles:t,typeCheck:r}){if(e.Sentry?.setContext("findMappings",{mappingFiles:t}),!t.length)return{mapperFiles:[],figmaBuilderLinks:[],figmaLinksToResolve:[],diagnostics:[]};let n=[],i=[],s=[],o=await ge(e,t),a=o.getTypeChecker(),u=o.getSyntacticDiagnostics().filter(Xs).filter(p=>p.file?.fileName?t.includes(p.file.fileName):!1);if(u.length>0)return Q.error(`At least one of the mappings contain syntactic errors:
|
|
1441
1443
|
|
|
1442
|
-
${
|
|
1444
|
+
${g0(u)}`),Ut(1);let c=[...r?o.getSemanticDiagnostics():[]].filter(Xs);for(let p of t)try{let d=o.getSourceFile(p);if(!d){e.Sentry?.captureException(new Error("Could not find source file"),{extra:{file:p,sourceFiles:o.getSourceFiles().map(f=>f.fileName)},level:"warning"});continue}let D=d?.fileName;if(i.push({filePath:p,content:d.getText()}),D){let f=c.filter(g=>g.file?.fileName===D);f.length>0&&s.push(...f)}let m=await u0(e,d,a);n.push(...m)}catch(d){return e.Sentry?.captureException(d),await Ut(1)}let l=n.filter(p=>p.figmaUrl&&!p.figmaKey).map(p=>p.figmaUrl);return{mapperFiles:i,figmaBuilderLinks:n,figmaLinksToResolve:l,diagnostics:s}}function h0(e){let t=[];for(let r of e.statements){if(!j.isImportDeclaration(r)||!r.importClause||r.importClause.isTypeOnly||!j.isStringLiteral(r.moduleSpecifier))continue;let n=r.moduleSpecifier.text;if(n.startsWith("@builder.io"))continue;r.importClause.name&&t.push({importType:"default",importName:r.importClause.name.text,importPath:n});let i=r.importClause.namedBindings;if(i&&j.isNamedImports(i))for(let s of i.elements)s.isTypeOnly||t.push({importType:"named",importName:s.name.text,importPath:n})}return t}import{randomUUID as y0}from"crypto";var x0=5294,b0=5284,ta=4,ea=e=>!!(process.env.CI||e.ci),w0=(e,t)=>{let r=ea(t)?{}:na(e),n=r.spaceName,i=t.builderUserId??process.env.BUILDER_USER_ID??r.userId,s=t.builderPublicKey??process.env.BUILDER_PUBLIC_KEY??r.builderPublicKey,o=t.builderPrivateKey??process.env.BUILDER_PRIVATE_KEY??r.builderPrivateKey,a=process.env.FIGMA_PERSONAL_TOKEN??t.figmaToken,u;return a?u={access_token:a,oauth:!1}:u=r.figmaAuth,{spaceName:n,userId:i,builderPublicKey:s,builderPrivateKey:o,figmaAuth:u,timestamp:r.timestamp}},xn=async(e,t,r)=>{let{spaceName:n,userId:i,builderPublicKey:s,builderPrivateKey:o,figmaAuth:a,timestamp:u}=w0(e,t);if(r.forceSpaceId&&!t.yes&&s&&s!==r.forceSpaceId)if(Q.warning(`You are currently authenticated for space ${(0,Xt.yellow)(s)} (${n||"unnamed"}), but this command requires space ${(0,Xt.green)(r.forceSpaceId)}.`),await Zr({message:"You must switch to the correct space to continue with this code generation command.",options:[{value:"switch",label:"Switch to required space",hint:"Authenticate with the correct space and continue"},{value:"exit",label:"Exit code generation",hint:"Cancel the command and stay in current space"}]})==="switch")s=r.forceSpaceId,o=void 0,n=void 0,i=void 0;else return Q.info("Code generation cancelled. You can run the command again when you're ready to switch spaces."),await Ut(1);if(ea(t)){if(!a&&r.figmaAuth)throw new Error(`No Figma personal token found.
|
|
1443
1445
|
Please set the FIGMA_PERSONAL_TOKEN environment variable.`);if(!o&&r.builderPrivateKey)throw new Error(`No Builder private key found.
|
|
1444
1446
|
Please set the BUILDER_PRIVATE_KEY environment variable.`);if(!s&&r.builderPublicKey)throw new Error(`No Builder public key found.
|
|
1445
|
-
Please set the BUILDER_PUBLIC_KEY environment variable.`);return{figmaAuth:a,builderPublicKey:s,builderPrivateKey:o,userId:i,spaceName:n}}if((r.force||!a&&r.figmaAuth)&&(a=await
|
|
1447
|
+
Please set the BUILDER_PUBLIC_KEY environment variable.`);return{figmaAuth:a,builderPublicKey:s,builderPrivateKey:o,userId:i,spaceName:n}}if((r.force||!a&&r.figmaAuth)&&(a=await v0(e),Md(e,{figmaAuth:a})),r.force||!o&&r.builderPrivateKey||!s&&r.builderPublicKey){let{privateKey:c,spaceId:l,spaceName:p,userId:d}=await S0(e,r.forceSpaceId);if(r.forceSpaceId&&l!==r.forceSpaceId)throw new Error(`OAuth flow returned space ${(0,Xt.yellow)(l)}, however the command specified --spaceId=${(0,Xt.green)(r.forceSpaceId)}`);s=l,o=c,n=p,i=d,await ul(i),await Gt(e,e.getAppRootDir())&&(await _d(e,l,void 0,!1)||Q.warn("Unable to set public api key in an existing .env file or create a new one. Please ensure you have write access in the current directory.")),Md(e,{builderPublicKey:s,builderPrivateKey:o,spaceName:n,userId:i,timestamp:new Date().toISOString()})}return i?e.Sentry?.setUser({id:i,username:process.env.USER||process.env.USERNAME||"unknown"}):s&&e.Sentry?.setUser({id:s,username:process.env.USER||process.env.USERNAME||"unknown"}),(n||s)&&e.Sentry?.setContext("builder",{spaceId:s,spaceName:n,userId:i}),{figmaAuth:a,builderPublicKey:s,builderPrivateKey:o,spaceName:n,userId:i,timestamp:u}},E0="RHr2ed743waC2g2ZHMEJSn6O0NQ08L";async function v0(e){let t=y0();return Ud({sys:e,name:"Figma",initialPort:x0,requestListener:async(r,n,i,s,o)=>{let a=new URL(n.url||"",`http://localhost:${r}`);if(a.pathname==="/figma-connect"){let u=a.searchParams.get("code"),c=a.searchParams.get("state"),l="nrGCqw6TLl95QJhVDi097A",p=E0,D=`Basic ${Buffer.from(`${l}:${p}`).toString("base64")}`;if(u&&t===c){let f=await(await Rt("https://api.figma.com/v1/oauth/token",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Authorization:D},body:new URLSearchParams({redirect_uri:`http://localhost:${r}/figma-connect`,code:u,grant_type:"authorization_code"}).toString()})).json();i.end(`<!doctype html>
|
|
1446
1448
|
<html lang="en" dir="ltr">
|
|
1447
1449
|
<head>
|
|
1448
1450
|
<meta charset="utf-8" />
|
|
@@ -1551,7 +1553,7 @@ Please set the BUILDER_PUBLIC_KEY environment variable.`);return{figmaAuth:a,bui
|
|
|
1551
1553
|
<!--SCRIPT_PLACEHOLDER-->
|
|
1552
1554
|
</body>
|
|
1553
1555
|
</html>
|
|
1554
|
-
`.replace("{{MESSAGE}}","The CLI has authenticated correctly with Figma"),()=>{s({...f,oauth:!0})})}}},onListen:r=>{let n=new URL("https://www.figma.com/oauth");return n.searchParams.set("client_id","nrGCqw6TLl95QJhVDi097A"),n.searchParams.set("redirect_uri",`http://localhost:${r}/figma-connect`),n.searchParams.set("scope","files:read,file_dev_resources:read,file_variables:read"),n.searchParams.set("state",t),n.searchParams.set("response_type","code"),n.href}})}async function
|
|
1556
|
+
`.replace("{{MESSAGE}}","The CLI has authenticated correctly with Figma"),()=>{s({...f,oauth:!0})})}}},onListen:r=>{let n=new URL("https://www.figma.com/oauth");return n.searchParams.set("client_id","nrGCqw6TLl95QJhVDi097A"),n.searchParams.set("redirect_uri",`http://localhost:${r}/figma-connect`),n.searchParams.set("scope","files:read,file_dev_resources:read,file_variables:read"),n.searchParams.set("state",t),n.searchParams.set("response_type","code"),n.href}})}async function S0(e,t){let r=await e.getDeviceId();return Ud({sys:e,name:"Builder.io",initialPort:b0,requestListener:async(n,i,s,o)=>{let a=new URL(i.url||"",`http://localhost:${n}`);a.pathname===er&&s.end(`<!doctype html>
|
|
1555
1557
|
<html lang="en" dir="ltr">
|
|
1556
1558
|
<head>
|
|
1557
1559
|
<meta charset="utf-8" />
|
|
@@ -1660,67 +1662,27 @@ Please set the BUILDER_PUBLIC_KEY environment variable.`);return{figmaAuth:a,bui
|
|
|
1660
1662
|
<!--SCRIPT_PLACEHOLDER-->
|
|
1661
1663
|
</body>
|
|
1662
1664
|
</html>
|
|
1663
|
-
`.replace("{{MESSAGE}}","The CLI has authenticated correctly with Builder.io"),()=>{o({privateKey:a.searchParams.get("p-key")||"",spaceId:a.searchParams.get("api-key")||"",spaceName:a.searchParams.get("org-name")||"",userId:a.searchParams.get("user-id")||""})})},onListen:n=>{let i=new URL("/cli-auth","https://builder.io");i.searchParams.set("client_id","builder-dev-tools-cli"),i.searchParams.set("host",r),i.searchParams.set("response_type","code"),i.searchParams.set("cli","true"),t&&i.searchParams.set("space_id",t);let s=new URL(
|
|
1665
|
+
`.replace("{{MESSAGE}}","The CLI has authenticated correctly with Builder.io"),()=>{o({privateKey:a.searchParams.get("p-key")||"",spaceId:a.searchParams.get("api-key")||"",spaceName:a.searchParams.get("org-name")||"",userId:a.searchParams.get("user-id")||""})})},onListen:n=>{let i=new URL("/cli-auth","https://builder.io");i.searchParams.set("client_id","builder-dev-tools-cli"),i.searchParams.set("host",r),i.searchParams.set("response_type","code"),i.searchParams.set("cli","true"),t&&i.searchParams.set("space_id",t);let s=new URL(er,`http://localhost:${n}`);s.searchParams.set(Ln,C0()),s.searchParams.set(Mn,process.versions.node);let o=e.getFrameworks();return o.length>0&&(i.searchParams.set(xr,o[0].name),s.searchParams.set(xr,o[0].name)),i.searchParams.set("redirect_url",s.href),i.href}})}function Md(e,t){if(ra(Kt(e.getAppRootDir(),"node_modules"))){let n=Kt(e.getAppRootDir(),"node_modules",".builder"),i=Kt(n,"data.json"),s=na(e);t=Object.assign(s,t),Ld(Od(i),{recursive:!0}),Mo(i,JSON.stringify({credentials:t},null,2))}else{let n=Kt(e.getAppRootDir(),".config","builderio"),i=Kt(n,"data.json"),s=Kt(e.getAppRootDir(),".gitignore"),o=na(e);t=Object.assign(o,t),Ld(Od(i),{recursive:!0}),Mo(i,JSON.stringify({credentials:t},null,2));let a=".config/";if(ra(s)){let u=jd(s,"utf8");u.includes(a)||Mo(s,u+`
|
|
1664
1666
|
`+a+`
|
|
1665
|
-
`)}else
|
|
1666
|
-
`)}}function
|
|
1667
|
-
OPEN: ${(0,
|
|
1667
|
+
`)}else Mo(s,a+`
|
|
1668
|
+
`)}}function na(e){let t=Kt(e.getAppRootDir(),".config","builderio","data.json"),r=[Kt(e.getAppRootDir(),"node_modules",".builder","data.json"),t,Kt(e.getRepoRootDir(),".git",".builder.json")];for(let n of r)if(ra(n))try{let i=jd(n,"utf8");return JSON.parse(i).credentials}catch(i){e.Sentry?.captureException(i,{level:"warning"})}return{}}async function Ud(e){let t,r,n,i=new Promise((p,d)=>{t=p,r=d}),s=e.initialPort,o=0,a=D0((p,d)=>e.requestListener(s,p,d,t,r)),u=()=>{c(),a&&("closeAllConnections"in a&&a.closeAllConnections(),a.close(p=>{p&&e.sys.Sentry?.captureException(p)}))};process.on("uncaughtExceptionMonitor",u),process.on("unhandledRejection",u),process.on("SIGINT",u),process.on("SIGTERM",u),process.on("exit",u);let c=()=>{process.removeListener("uncaughtExceptionMonitor",u),process.removeListener("unhandledRejection",u),process.removeListener("SIGINT",u),process.removeListener("SIGTERM",u),process.removeListener("exit",u)},l=()=>new Promise((p,d)=>{let D=m=>{a.removeListener("error",D),m.code==="EADDRINUSE"&&o<ta?(Q.warning(`Port ${s} is already in use, trying next port`),s++,o++,p(0)):d(m)};a.once("error",D),a.listen(s,()=>{a.removeListener("error",D);let m=a.address();p(m.port)})});try{let p=0;for(;p===0&&o<ta;)p=await l();if(p===0)throw new Error(`Failed to find an available port after ${ta} attempts`);let d=e.onListen(p);Q.warn(`Required authenticating with ${e.name}
|
|
1669
|
+
OPEN: ${(0,Xt.dim)(d)}`),n=Co(),n.start(`Waiting for ${e.name} authentication`),await Qs(d);let D=await i;return n&&n.stop(`Authenticated with ${e.name} successfully`),D}catch(p){throw n&&(n.stop(`Failed to authenticate with ${e.name}.`,-1),os("auth")),e.sys.Sentry?.captureException(p),u(),p}finally{u()}}async function Hd(e,t,r,n){try{if(!e)return zr(r,n,400,"Builder context closed");let i=R0(r);if(i.pathname===Ho){if(r.method==="POST"){let s=await T0(r);if(s)try{let o=await Ta(e,JSON.parse(s));return Vd(r,n,200,o)}catch(o){e.debug("Dev API Error",o.stack||o.message||o);let a={errors:[String(o.message||o)]};return Vd(r,n,500,a)}}else if(r.method==="OPTIONS"){let s={"Access-Control-Allow-Methods":"POST, OPTIONS","Access-Control-Allow-Headers":"Content-Type, Cache-Control, X-Builder-Devtools-Version, sentry-trace, baggage"},o=r.headers.origin;o&&o!=="null"?Kd(new URL(o))&&(s["Access-Control-Allow-Origin"]=o):s["Access-Control-Allow-Origin"]="*",n.writeHead(200,s),n.end();return}return zr(r,n,405,`${Ho} is an API endpoint used only during development by the Builder.io Devtools client-side script`)}if(i.pathname===Ko)return F0(r,n,200,await Ra(e));if(i.pathname===oa){let s=i.searchParams.get(Vo);return s?P0(n,302,await Ba(e,s)):zr(r,n,400,`Missing ${Vo} querystring`)}if(i.pathname===er)return A0(r,n,200,await Ia(e));if(i.pathname===ia){await xn(e,{_:[]},{});let s=await $d(e),{figmaBuilderLinks:o,diagnostics:a}=await Nd({mappingFiles:s,sys:e});return Bn(r,n,200,"application/json",JSON.stringify({figmaBuilderLinks:o,foundErrors:a.length>0,diagnostics:a,version:2,local:!0},null,2))}return i.pathname===tr?(e.debug(`Close Dev Tools Server Requested: ${i.href}`),setTimeout(()=>{try{t.close(s=>{e.debug(`Dev Tools Server Closed Error: ${s}`)})}catch(s){e.debug(`Error closing devtools server: ${s}`)}},20),zr(r,n,200,"Closing Dev Tools Server")):zr(r,n,404,"Not found")}catch(i){return e?.Sentry?.captureException(i),zr(r,n,500,`Dev Server Error: ${i}`)}}function Vd(e,t,r,n){Bn(e,t,r,"application/json",JSON.stringify(n))}function F0(e,t,r,n){Bn(e,t,r,"application/javascript",n)}function A0(e,t,r,n){Bn(e,t,r,"text/html",n)}function zr(e,t,r,n){Bn(e,t,r,"text/plain",n)}function Bn(e,t,r,n,i){let s={"Content-Type":`${n}; charset=utf-8`,"Cache-Control":"no-cache, no-store, must-revalidate","X-Builder-Devtools-Version":Ve},o=e.headers.origin;o&&o!=="null"?Kd(new URL(o))&&(s["Access-Control-Allow-Origin"]=o):s["Access-Control-Allow-Origin"]="*",t.writeHead(r,s),t.end(i)}function Kd(e){return e.hostname==="localhost"||e.origin==="https://builder.io"||e.origin==="https://www.builder.io"||e.origin.endsWith(".builder.io")?!0:e.port===""?!1:e.port!=="80"&&e.port!=="443"}function P0(e,t,r){e.writeHead(t,{Location:r}),e.end()}async function T0(e){let t="";for await(let r of e)t+=r;return t}function R0(e){let t=e.url||"/";return new URL(t,`http://${e.headers.host}`)}async function Gd(e){if(globalThis.__builderDevToolsServer)return e.debug("reusing existing devtools server"),globalThis.__builderDevToolsServer.setContext(e),globalThis.__builderDevToolsServer;let t=await B0(e),r=I0((i,s)=>{Hd(e,r,i,s)}),n=()=>new Promise((i,s)=>{r.listening?(e.debug(`closing devtools server on port ${t}`),r.close(o=>{e=null,o?(e.debug(`error closing devtools server on port ${t}`),s(o)):(e&&e.debug(`closed devtools server on port ${t}`),i())})):(e.debug(`devtools server on port ${t} not listening`),i())});return process.once("SIGTERM",n),process.once("SIGINT",n),process.env.CI!=="true"&&process.stdin.on("end",n),globalThis.__builderDevToolsServer={url:new URL(`http://localhost:${t}`).href,port:t,setContext:i=>{e.debug(`set devtools context on server ${t}`),e=i},close:async()=>{globalThis.__builderDevToolsServer=null,await n()}},new Promise(i=>{r.listen(t,()=>{e.debug(`started devtools server on port ${t}`),i(globalThis.__builderDevToolsServer)})})}function B0(e){return new Promise(t=>{let r=e.port;try{k0({hostname:"localhost",port:r,path:tr,method:"GET"},i=>{i.on("end",()=>{e.debug(`${tr} - Response ended`),t(r)})}).on("error",i=>{e.debug(`${tr} - No response ${i}`),t(r)}).end()}catch(n){e.debug(`${tr} - Error ${n}`),t(r)}})}async function fl(e){let t={...e,devToolsServerUrl:"",isValid:!1,serverShouldRestart:!1,publicApiKey:"",port:e.port||5273,ignoreMissingConfig:!1,getAllProjectFiles:e.getAllProjectFiles||(()=>Promise.resolve([]))},r=e.getFrameworks().map(s=>s.name).join(", ");t.debug(`create devtools ${Wd} [${r}]`);let n=await Gd(t);return t.devToolsServerUrl=n.url,t.port=n.port,{getUrl:()=>t.devToolsServerUrl}}var Wd=Ve;export{fl as createDevToolsServer,Wd as version};
|
|
1668
1670
|
/*! Bundled license information:
|
|
1669
1671
|
|
|
1670
|
-
|
|
1671
|
-
(*!
|
|
1672
|
-
* Array of passes.
|
|
1673
|
-
*
|
|
1674
|
-
* A `pass` is just a function that is executed on `req, res, options`
|
|
1675
|
-
* so that you can easily add new checks while still keeping the base
|
|
1676
|
-
* flexible.
|
|
1677
|
-
*)
|
|
1678
|
-
|
|
1679
|
-
http-proxy/lib/http-proxy/passes/web-incoming.js:
|
|
1680
|
-
(*!
|
|
1681
|
-
* Array of passes.
|
|
1682
|
-
*
|
|
1683
|
-
* A `pass` is just a function that is executed on `req, res, options`
|
|
1684
|
-
* so that you can easily add new checks while still keeping the base
|
|
1685
|
-
* flexible.
|
|
1686
|
-
*)
|
|
1687
|
-
|
|
1688
|
-
http-proxy/lib/http-proxy/passes/ws-incoming.js:
|
|
1689
|
-
(*!
|
|
1690
|
-
* Array of passes.
|
|
1691
|
-
*
|
|
1692
|
-
* A `pass` is just a function that is executed on `req, socket, options`
|
|
1693
|
-
* so that you can easily add new checks while still keeping the base
|
|
1694
|
-
* flexible.
|
|
1695
|
-
*)
|
|
1696
|
-
|
|
1697
|
-
http-proxy/index.js:
|
|
1698
|
-
(*!
|
|
1699
|
-
* Caron dimonio, con occhi di bragia
|
|
1700
|
-
* loro accennando, tutte le raccoglie;
|
|
1701
|
-
* batte col remo qualunque s’adagia
|
|
1702
|
-
*
|
|
1703
|
-
* Charon the demon, with the eyes of glede,
|
|
1704
|
-
* Beckoning to them, collects them all together,
|
|
1705
|
-
* Beats with his oar whoever lags behind
|
|
1706
|
-
*
|
|
1707
|
-
* Dante - The Divine Comedy (Canto III)
|
|
1708
|
-
*)
|
|
1709
|
-
|
|
1710
|
-
is-extglob/index.js:
|
|
1672
|
+
cookie/index.js:
|
|
1711
1673
|
(*!
|
|
1712
|
-
*
|
|
1713
|
-
*
|
|
1714
|
-
* Copyright
|
|
1715
|
-
*
|
|
1674
|
+
* cookie
|
|
1675
|
+
* Copyright(c) 2012-2014 Roman Shtylman
|
|
1676
|
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
1677
|
+
* MIT Licensed
|
|
1716
1678
|
*)
|
|
1717
1679
|
|
|
1718
|
-
|
|
1680
|
+
cookie-parser/index.js:
|
|
1719
1681
|
(*!
|
|
1720
|
-
*
|
|
1721
|
-
*
|
|
1722
|
-
* Copyright
|
|
1723
|
-
*
|
|
1682
|
+
* cookie-parser
|
|
1683
|
+
* Copyright(c) 2014 TJ Holowaychuk
|
|
1684
|
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
1685
|
+
* MIT Licensed
|
|
1724
1686
|
*)
|
|
1725
1687
|
|
|
1726
1688
|
is-number/index.js:
|
|
@@ -1746,20 +1708,4 @@ fill-range/index.js:
|
|
|
1746
1708
|
* Copyright (c) 2014-present, Jon Schlinkert.
|
|
1747
1709
|
* Licensed under the MIT License.
|
|
1748
1710
|
*)
|
|
1749
|
-
|
|
1750
|
-
cookie/index.js:
|
|
1751
|
-
(*!
|
|
1752
|
-
* cookie
|
|
1753
|
-
* Copyright(c) 2012-2014 Roman Shtylman
|
|
1754
|
-
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
1755
|
-
* MIT Licensed
|
|
1756
|
-
*)
|
|
1757
|
-
|
|
1758
|
-
cookie-parser/index.js:
|
|
1759
|
-
(*!
|
|
1760
|
-
* cookie-parser
|
|
1761
|
-
* Copyright(c) 2014 TJ Holowaychuk
|
|
1762
|
-
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
1763
|
-
* MIT Licensed
|
|
1764
|
-
*)
|
|
1765
1711
|
*/
|