builder.io 1.6.16 → 1.6.17
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 +1127 -444
- package/cli/index.cjs.map +4 -4
- package/core/index.cjs +4 -4
- package/core/index.mjs +4 -4
- package/figma/index.cjs +1 -1
- package/figma/index.mjs +1 -1
- package/node/index.cjs +1 -1
- package/node/index.mjs +1 -1
- package/package.json +11 -2
- package/server/index.cjs +134 -115
- package/server/index.mjs +132 -113
- package/types/_tests_/launch.e2e.d.ts +1 -0
- package/types/_tests_/utils.d.ts +2 -1
- package/types/cli/code.d.ts +15 -4
- package/types/cli/download.d.ts +1 -1
- package/types/cli/figma-publish.d.ts +3 -11
- package/types/cli/figma-utils.d.ts +2 -15
- package/types/cli/index.d.ts +14 -0
- package/types/cli/launch.d.ts +5 -0
- package/types/core/adapters/react/react-api-key.d.ts +1 -1
- package/types/figma/index.d.ts +2 -0
- package/types/tsconfig.tsbuildinfo +1 -1
package/server/index.cjs
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
"use strict";var fu=Object.create;var wn=Object.defineProperty;var du=Object.getOwnPropertyDescriptor;var Du=Object.getOwnPropertyNames;var gu=Object.getPrototypeOf,hu=Object.prototype.hasOwnProperty;var ae=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Cu=(e,t)=>{for(var r in t)wn(e,r,{get:t[r],enumerable:!0})},Mo=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Du(t))!hu.call(e,i)&&i!==r&&wn(e,i,{get:()=>t[i],enumerable:!(n=du(t,i))||n.enumerable});return e};var B=(e,t,r)=>(r=e!=null?fu(gu(e)):{},Mo(t||!e||!e.__esModule?wn(r,"default",{value:e,enumerable:!0}):r,e)),xu=e=>Mo(wn({},"__esModule",{value:!0}),e);var Ko=ae((hf,Vo)=>{"use strict";Vo.exports=function(){if(process.env.npm_config_user_agent)return Fu(process.env.npm_config_user_agent)};function Fu(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 Bn=ae((Xf,xi)=>{"use strict";var Sr="\x1B",Q=`${Sr}[`,Lu="\x07",wr={to(e,t){return t?`${Q}${t+1};${e+1}H`:`${Q}${e+1}G`},move(e,t){let r="";return e<0?r+=`${Q}${-e}D`:e>0&&(r+=`${Q}${e}C`),t<0?r+=`${Q}${-t}A`:t>0&&(r+=`${Q}${t}B`),r},up:(e=1)=>`${Q}${e}A`,down:(e=1)=>`${Q}${e}B`,forward:(e=1)=>`${Q}${e}C`,backward:(e=1)=>`${Q}${e}D`,nextLine:(e=1)=>`${Q}E`.repeat(e),prevLine:(e=1)=>`${Q}F`.repeat(e),left:`${Q}G`,hide:`${Q}?25l`,show:`${Q}?25h`,save:`${Sr}7`,restore:`${Sr}8`},Ou={up:(e=1)=>`${Q}S`.repeat(e),down:(e=1)=>`${Q}T`.repeat(e)},_u={screen:`${Q}2J`,up:(e=1)=>`${Q}1J`.repeat(e),down:(e=1)=>`${Q}J`.repeat(e),line:`${Q}2K`,lineEnd:`${Q}K`,lineStart:`${Q}1K`,lines(e){let t="";for(let r=0;r<e;r++)t+=this.line+(r<e-1?wr.up():"");return e&&(t+=wr.left),t}};xi.exports={cursor:wr,scroll:Ou,erase:_u,beep:Lu}});var it=ae((Zf,vr)=>{var Nn=process||{},Ei=Nn.argv||[],Rn=Nn.env||{},Mu=!(Rn.NO_COLOR||Ei.includes("--no-color"))&&(!!Rn.FORCE_COLOR||Ei.includes("--color")||Nn.platform==="win32"||(Nn.stdout||{}).isTTY&&Rn.TERM!=="dumb"||!!Rn.CI),ju=(e,t,r=e)=>n=>{let i=""+n,a=i.indexOf(t,e.length);return~a?e+Uu(i,t,r,a)+t:e+i+t},Uu=(e,t,r,n)=>{let i="",a=0;do i+=e.substring(a,n)+r,a=n+t.length,n=e.indexOf(t,a);while(~n);return i+e.substring(a)},Fi=(e=Mu)=>{let t=e?ju:()=>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")}};vr.exports=Fi();vr.exports.createColors=Fi});var rs=ae((qC,Wn)=>{Wn.exports.Space_Separator=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/;Wn.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]/;Wn.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 Xr=ae((WC,os)=>{var Yr=rs();os.exports={isSpaceSeparator(e){return typeof e=="string"&&Yr.Space_Separator.test(e)},isIdStartChar(e){return typeof e=="string"&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="$"||e==="_"||Yr.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"||Yr.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 ls=ae((JC,us)=>{var ne=Xr(),eo,fe,et,Hn,pt,Re,re,ro,Dn;us.exports=function(t,r){eo=String(t),fe="start",et=[],Hn=0,pt=1,Re=0,re=void 0,ro=void 0,Dn=void 0;do re=Bp(),kp[fe]();while(re.type!=="eof");return typeof r=="function"?to({"":Dn},"",r):Dn};function to(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 a=String(i),o=to(n,a,r);o===void 0?delete n[a]:Object.defineProperty(n,a,{value:o,writable:!0,enumerable:!0,configurable:!0})}else for(let i in n){let a=to(n,i,r);a===void 0?delete n[i]:Object.defineProperty(n,i,{value:a,writable:!0,enumerable:!0,configurable:!0})}return r.call(e,t,n)}var T,P,dn,Ze,R;function Bp(){for(T="default",P="",dn=!1,Ze=1;;){R=tt();let e=as[T]();if(e)return e}}function tt(){if(eo[Hn])return String.fromCodePoint(eo.codePointAt(Hn))}function C(){let e=tt();return e===`
|
|
2
|
-
`?(
|
|
3
|
-
`:case"\r":case"\u2028":case"\u2029":C();return;case"/":C(),
|
|
4
|
-
`:case"\r":case"\u2028":case"\u2029":C(),
|
|
5
|
-
`:case"\r":throw
|
|
6
|
-
`;case"r":return C(),"\r";case"t":return C()," ";case"v":return C(),"\v";case"0":if(C(),ne.isDigit(tt()))throw
|
|
1
|
+
"use strict";var pu=Object.create;var vn=Object.defineProperty;var mu=Object.getOwnPropertyDescriptor;var fu=Object.getOwnPropertyNames;var du=Object.getPrototypeOf,Du=Object.prototype.hasOwnProperty;var ae=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),gu=(e,t)=>{for(var r in t)vn(e,r,{get:t[r],enumerable:!0})},Mo=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of fu(t))!Du.call(e,i)&&i!==r&&vn(e,i,{get:()=>t[i],enumerable:!(n=mu(t,i))||n.enumerable});return e};var R=(e,t,r)=>(r=e!=null?pu(du(e)):{},Mo(t||!e||!e.__esModule?vn(r,"default",{value:e,enumerable:!0}):r,e)),hu=e=>Mo(vn({},"__esModule",{value:!0}),e);var Ko=ae((xf,Vo)=>{"use strict";Vo.exports=function(){if(process.env.npm_config_user_agent)return xu(process.env.npm_config_user_agent)};function xu(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 Bn=ae((ed,xi)=>{"use strict";var yr="\x1B",Q=`${yr}[`,ku="\x07",Sr={to(e,t){return t?`${Q}${t+1};${e+1}H`:`${Q}${e+1}G`},move(e,t){let r="";return e<0?r+=`${Q}${-e}D`:e>0&&(r+=`${Q}${e}C`),t<0?r+=`${Q}${-t}A`:t>0&&(r+=`${Q}${t}B`),r},up:(e=1)=>`${Q}${e}A`,down:(e=1)=>`${Q}${e}B`,forward:(e=1)=>`${Q}${e}C`,backward:(e=1)=>`${Q}${e}D`,nextLine:(e=1)=>`${Q}E`.repeat(e),prevLine:(e=1)=>`${Q}F`.repeat(e),left:`${Q}G`,hide:`${Q}?25l`,show:`${Q}?25h`,save:`${yr}7`,restore:`${yr}8`},$u={up:(e=1)=>`${Q}S`.repeat(e),down:(e=1)=>`${Q}T`.repeat(e)},Lu={screen:`${Q}2J`,up:(e=1)=>`${Q}1J`.repeat(e),down:(e=1)=>`${Q}J`.repeat(e),line:`${Q}2K`,lineEnd:`${Q}K`,lineStart:`${Q}1K`,lines(e){let t="";for(let r=0;r<e;r++)t+=this.line+(r<e-1?Sr.up():"");return e&&(t+=Sr.left),t}};xi.exports={cursor:Sr,scroll:$u,erase:Lu,beep:ku}});var at=ae((td,vr)=>{var Nn=process||{},Ei=Nn.argv||[],Rn=Nn.env||{},Ou=!(Rn.NO_COLOR||Ei.includes("--no-color"))&&(!!Rn.FORCE_COLOR||Ei.includes("--color")||Nn.platform==="win32"||(Nn.stdout||{}).isTTY&&Rn.TERM!=="dumb"||!!Rn.CI),_u=(e,t,r=e)=>n=>{let i=""+n,a=i.indexOf(t,e.length);return~a?e+Mu(i,t,r,a)+t:e+i+t},Mu=(e,t,r,n)=>{let i="",a=0;do i+=e.substring(a,n)+r,a=n+t.length,n=e.indexOf(t,a);while(~n);return i+e.substring(a)},Fi=(e=Ou)=>{let t=e?_u:()=>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")}};vr.exports=Fi();vr.exports.createColors=Fi});var ns=ae((qC,qn)=>{qn.exports.Space_Separator=/[\u1680\u2000-\u200A\u202F\u205F\u3000]/;qn.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]/;qn.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 Yr=ae((WC,rs)=>{var Qr=ns();rs.exports={isSpaceSeparator(e){return typeof e=="string"&&Qr.Space_Separator.test(e)},isIdStartChar(e){return typeof e=="string"&&(e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="$"||e==="_"||Qr.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"||Qr.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 us=ae((JC,ss)=>{var ne=Yr(),Zr,fe,et,Jn,mt,Ne,re,no,Dn;ss.exports=function(t,r){Zr=String(t),fe="start",et=[],Jn=0,mt=1,Ne=0,re=void 0,no=void 0,Dn=void 0;do re=Ip(),Np[fe]();while(re.type!=="eof");return typeof r=="function"?eo({"":Dn},"",r):Dn};function eo(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 a=String(i),o=eo(n,a,r);o===void 0?delete n[a]:Object.defineProperty(n,a,{value:o,writable:!0,enumerable:!0,configurable:!0})}else for(let i in n){let a=eo(n,i,r);a===void 0?delete n[i]:Object.defineProperty(n,i,{value:a,writable:!0,enumerable:!0,configurable:!0})}return r.call(e,t,n)}var I,P,dn,Ze,N;function Ip(){for(I="default",P="",dn=!1,Ze=1;;){N=tt();let e=is[I]();if(e)return e}}function tt(){if(Zr[Jn])return String.fromCodePoint(Zr.codePointAt(Jn))}function C(){let e=tt();return e===`
|
|
2
|
+
`?(mt++,Ne=0):e?Ne+=e.length:Ne++,e&&(Jn+=e.length),e}var is={default(){switch(N){case" ":case"\v":case"\f":case" ":case"\xA0":case"\uFEFF":case`
|
|
3
|
+
`:case"\r":case"\u2028":case"\u2029":C();return;case"/":C(),I="comment";return;case void 0:return C(),J("eof")}if(ne.isSpaceSeparator(N)){C();return}return is[fe]()},comment(){switch(N){case"*":C(),I="multiLineComment";return;case"/":C(),I="singleLineComment";return}throw H(C())},multiLineComment(){switch(N){case"*":C(),I="multiLineCommentAsterisk";return;case void 0:throw H(C())}C()},multiLineCommentAsterisk(){switch(N){case"*":C();return;case"/":C(),I="default";return;case void 0:throw H(C())}C(),I="multiLineComment"},singleLineComment(){switch(N){case`
|
|
4
|
+
`:case"\r":case"\u2028":case"\u2029":C(),I="default";return;case void 0:return C(),J("eof")}C()},value(){switch(N){case"{":case"[":return J("punctuator",C());case"n":return C(),vt("ull"),J("null",null);case"t":return C(),vt("rue"),J("boolean",!0);case"f":return C(),vt("alse"),J("boolean",!1);case"-":case"+":C()==="-"&&(Ze=-1),I="sign";return;case".":P=C(),I="decimalPointLeading";return;case"0":P=C(),I="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":P=C(),I="decimalInteger";return;case"I":return C(),vt("nfinity"),J("numeric",1/0);case"N":return C(),vt("aN"),J("numeric",NaN);case'"':case"'":dn=C()==='"',P="",I="string";return}throw H(C())},identifierNameStartEscape(){if(N!=="u")throw H(C());C();let e=to();switch(e){case"$":case"_":break;default:if(!ne.isIdStartChar(e))throw os();break}P+=e,I="identifierName"},identifierName(){switch(N){case"$":case"_":case"\u200C":case"\u200D":P+=C();return;case"\\":C(),I="identifierNameEscape";return}if(ne.isIdContinueChar(N)){P+=C();return}return J("identifier",P)},identifierNameEscape(){if(N!=="u")throw H(C());C();let e=to();switch(e){case"$":case"_":case"\u200C":case"\u200D":break;default:if(!ne.isIdContinueChar(e))throw os();break}P+=e,I="identifierName"},sign(){switch(N){case".":P=C(),I="decimalPointLeading";return;case"0":P=C(),I="zero";return;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":P=C(),I="decimalInteger";return;case"I":return C(),vt("nfinity"),J("numeric",Ze*(1/0));case"N":return C(),vt("aN"),J("numeric",NaN)}throw H(C())},zero(){switch(N){case".":P+=C(),I="decimalPoint";return;case"e":case"E":P+=C(),I="decimalExponent";return;case"x":case"X":P+=C(),I="hexadecimal";return}return J("numeric",Ze*0)},decimalInteger(){switch(N){case".":P+=C(),I="decimalPoint";return;case"e":case"E":P+=C(),I="decimalExponent";return}if(ne.isDigit(N)){P+=C();return}return J("numeric",Ze*Number(P))},decimalPointLeading(){if(ne.isDigit(N)){P+=C(),I="decimalFraction";return}throw H(C())},decimalPoint(){switch(N){case"e":case"E":P+=C(),I="decimalExponent";return}if(ne.isDigit(N)){P+=C(),I="decimalFraction";return}return J("numeric",Ze*Number(P))},decimalFraction(){switch(N){case"e":case"E":P+=C(),I="decimalExponent";return}if(ne.isDigit(N)){P+=C();return}return J("numeric",Ze*Number(P))},decimalExponent(){switch(N){case"+":case"-":P+=C(),I="decimalExponentSign";return}if(ne.isDigit(N)){P+=C(),I="decimalExponentInteger";return}throw H(C())},decimalExponentSign(){if(ne.isDigit(N)){P+=C(),I="decimalExponentInteger";return}throw H(C())},decimalExponentInteger(){if(ne.isDigit(N)){P+=C();return}return J("numeric",Ze*Number(P))},hexadecimal(){if(ne.isHexDigit(N)){P+=C(),I="hexadecimalInteger";return}throw H(C())},hexadecimalInteger(){if(ne.isHexDigit(N)){P+=C();return}return J("numeric",Ze*Number(P))},string(){switch(N){case"\\":C(),P+=Bp();return;case'"':if(dn)return C(),J("string",P);P+=C();return;case"'":if(!dn)return C(),J("string",P);P+=C();return;case`
|
|
5
|
+
`:case"\r":throw H(C());case"\u2028":case"\u2029":kp(N);break;case void 0:throw H(C())}P+=C()},start(){switch(N){case"{":case"[":return J("punctuator",C())}I="value"},beforePropertyName(){switch(N){case"$":case"_":P=C(),I="identifierName";return;case"\\":C(),I="identifierNameStartEscape";return;case"}":return J("punctuator",C());case'"':case"'":dn=C()==='"',I="string";return}if(ne.isIdStartChar(N)){P+=C(),I="identifierName";return}throw H(C())},afterPropertyName(){if(N===":")return J("punctuator",C());throw H(C())},beforePropertyValue(){I="value"},afterPropertyValue(){switch(N){case",":case"}":return J("punctuator",C())}throw H(C())},beforeArrayValue(){if(N==="]")return J("punctuator",C());I="value"},afterArrayValue(){switch(N){case",":case"]":return J("punctuator",C())}throw H(C())},end(){throw H(C())}};function J(e,t){return{type:e,value:t,line:mt,column:Ne}}function vt(e){for(let t of e){if(tt()!==t)throw H(C());C()}}function Bp(){switch(tt()){case"b":return C(),"\b";case"f":return C(),"\f";case"n":return C(),`
|
|
6
|
+
`;case"r":return C(),"\r";case"t":return C()," ";case"v":return C(),"\v";case"0":if(C(),ne.isDigit(tt()))throw H(C());return"\0";case"x":return C(),Rp();case"u":return C(),to();case`
|
|
7
7
|
`:case"\u2028":case"\u2029":return C(),"";case"\r":return C(),tt()===`
|
|
8
|
-
`&&C(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":throw
|
|
9
|
-
`+a;
|
|
10
|
-
`+a+
|
|
11
|
-
`+
|
|
12
|
-
`+a,
|
|
13
|
-
`+a+
|
|
14
|
-
`+
|
|
8
|
+
`&&C(),"";case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":throw H(C());case void 0:throw H(C())}return C()}function Rp(){let e="",t=tt();if(!ne.isHexDigit(t)||(e+=C(),t=tt(),!ne.isHexDigit(t)))throw H(C());return e+=C(),String.fromCodePoint(parseInt(e,16))}function to(){let e="",t=4;for(;t-- >0;){let r=tt();if(!ne.isHexDigit(r))throw H(C());e+=C()}return String.fromCodePoint(parseInt(e,16))}var Np={start(){if(re.type==="eof")throw wt();Xr()},beforePropertyName(){switch(re.type){case"identifier":case"string":no=re.value,fe="afterPropertyName";return;case"punctuator":Wn();return;case"eof":throw wt()}},afterPropertyName(){if(re.type==="eof")throw wt();fe="beforePropertyValue"},beforePropertyValue(){if(re.type==="eof")throw wt();Xr()},beforeArrayValue(){if(re.type==="eof")throw wt();if(re.type==="punctuator"&&re.value==="]"){Wn();return}Xr()},afterPropertyValue(){if(re.type==="eof")throw wt();switch(re.value){case",":fe="beforePropertyName";return;case"}":Wn()}},afterArrayValue(){if(re.type==="eof")throw wt();switch(re.value){case",":fe="beforeArrayValue";return;case"]":Wn()}},end(){}};function Xr(){let e;switch(re.type){case"punctuator":switch(re.value){case"{":e={};break;case"[":e=[];break}break;case"null":case"boolean":case"numeric":case"string":e=re.value;break}if(Dn===void 0)Dn=e;else{let t=et[et.length-1];Array.isArray(t)?t.push(e):Object.defineProperty(t,no,{value:e,writable:!0,enumerable:!0,configurable:!0})}if(e!==null&&typeof e=="object")et.push(e),Array.isArray(e)?fe="beforeArrayValue":fe="beforePropertyName";else{let t=et[et.length-1];t==null?fe="end":Array.isArray(t)?fe="afterArrayValue":fe="afterPropertyValue"}}function Wn(){et.pop();let e=et[et.length-1];e==null?fe="end":Array.isArray(e)?fe="afterArrayValue":fe="afterPropertyValue"}function H(e){return Hn(e===void 0?`JSON5: invalid end of input at ${mt}:${Ne}`:`JSON5: invalid character '${as(e)}' at ${mt}:${Ne}`)}function wt(){return Hn(`JSON5: invalid end of input at ${mt}:${Ne}`)}function os(){return Ne-=5,Hn(`JSON5: invalid identifier character at ${mt}:${Ne}`)}function kp(e){console.warn(`JSON5: '${as(e)}' in strings is not valid ECMAScript; consider escaping`)}function as(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 Hn(e){let t=new SyntaxError(e);return t.lineNumber=mt,t.columnNumber=Ne,t}});var cs=ae((HC,ls)=>{var ro=Yr();ls.exports=function(t,r,n){let i=[],a="",o,s,u="",l;if(r!=null&&typeof r=="object"&&!Array.isArray(r)&&(n=r.space,l=r.quote,r=r.replacer),typeof r=="function")s=r;else if(Array.isArray(r)){o=[];for(let d of r){let g;typeof d=="string"?g=d:(typeof d=="number"||d instanceof String||d instanceof Number)&&(g=String(d)),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)),c("",{"":t});function c(d,g){let f=g[d];switch(f!=null&&(typeof f.toJSON5=="function"?f=f.toJSON5(d):typeof f.toJSON=="function"&&(f=f.toJSON(d))),s&&(f=s.call(g,d,f)),f instanceof Number?f=Number(f):f instanceof String?f=String(f):f instanceof Boolean&&(f=f.valueOf()),f){case null:return"null";case!0:return"true";case!1:return"false"}if(typeof f=="string")return p(f,!1);if(typeof f=="number")return String(f);if(typeof f=="object")return Array.isArray(f)?D(f):m(f)}function p(d){let g={"'":.1,'"':.2},f={"'":"\\'",'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t","\v":"\\v","\0":"\\0","\u2028":"\\u2028","\u2029":"\\u2029"},x="";for(let S=0;S<d.length;S++){let v=d[S];switch(v){case"'":case'"':g[v]++,x+=v;continue;case"\0":if(ro.isDigit(d[S+1])){x+="\\x00";continue}}if(f[v]){x+=f[v];continue}if(v<" "){let F=v.charCodeAt(0).toString(16);x+="\\x"+("00"+F).substring(F.length);continue}x+=v}let y=l||Object.keys(g).reduce((S,v)=>g[S]<g[v]?S:v);return x=x.replace(new RegExp(y,"g"),f[y]),y+x+y}function m(d){if(i.indexOf(d)>=0)throw TypeError("Converting circular structure to JSON5");i.push(d);let g=a;a=a+u;let f=o||Object.keys(d),x=[];for(let S of f){let v=c(S,d);if(v!==void 0){let F=h(S)+":";u!==""&&(F+=" "),F+=v,x.push(F)}}let y;if(x.length===0)y="{}";else{let S;if(u==="")S=x.join(","),y="{"+S+"}";else{let v=`,
|
|
9
|
+
`+a;S=x.join(v),y=`{
|
|
10
|
+
`+a+S+`,
|
|
11
|
+
`+g+"}"}}return i.pop(),a=g,y}function h(d){if(d.length===0)return p(d,!0);let g=String.fromCodePoint(d.codePointAt(0));if(!ro.isIdStartChar(g))return p(d,!0);for(let f=g.length;f<d.length;f++)if(!ro.isIdContinueChar(String.fromCodePoint(d.codePointAt(f))))return p(d,!0);return d}function D(d){if(i.indexOf(d)>=0)throw TypeError("Converting circular structure to JSON5");i.push(d);let g=a;a=a+u;let f=[];for(let y=0;y<d.length;y++){let S=c(String(y),d);f.push(S!==void 0?S:"null")}let x;if(f.length===0)x="[]";else if(u==="")x="["+f.join(",")+"]";else{let y=`,
|
|
12
|
+
`+a,S=f.join(y);x=`[
|
|
13
|
+
`+a+S+`,
|
|
14
|
+
`+g+"]"}return i.pop(),a=g,x}}});var ms=ae((GC,ps)=>{var $p=us(),Lp=cs(),Op={parse:$p,stringify:Lp};ps.exports=Op});var io=ae(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.throwUnsupportedData=ft.throwUnknownDataType=ft.getType=void 0;function Fs(e){return Object.prototype.toString.call(e)}ft.getType=Fs;function Hp(e){throw new TypeError("unsupported data type: "+Fs(e))}ft.throwUnknownDataType=Hp;function Gp(e){throw new TypeError("unsupported data type: "+e)}ft.throwUnsupportedData=Gp});var co=ae(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 nt="";for(let e=0;e<10;e++){let t=String.fromCharCode(48+e);nt+=t}for(let e=0;e<26;e++){let t=String.fromCharCode(65+e);nt+=t}for(let e=0;e<26;e++){let t=String.fromCharCode(97+e);nt+=t}var zt=nt.length,so={};for(let e=0;e<zt;e++){let t=nt[e];so[t]=e}function uo(e){let t=0,r=1;for(let n=e.length-1;n>=0;n--){let i=e[n],a=so[i];a*=r,t+=a,r*=zt}return t}se.s_to_int=uo;function ys(e){let t=BigInt(0),r=BigInt(1),n=BigInt(zt);for(let i=e.length-1;i>=0;i--){let a=e[i],o=BigInt(so[a]);o*=r,t+=o,r*=n}return t}se.s_to_big_int=ys;function lo(e){if(e===0)return nt[0];let t=[];for(;e!==0;){let r=e%zt,n=nt[r];t.push(n),e-=r,e/=zt}return t.reverse().join("")}se.int_to_s=lo;function Ss(e){let t=BigInt(0),r=BigInt(zt);if(e===t)return nt[0];let n=[];for(;e!==t;){let i=e%r,a=nt[Number(i)];n.push(a),e/=r}return n.reverse().join("")}se.big_int_to_s=Ss;function vs(e){return e.split("").reverse().join("")}function ws(e){if(e<0)return"-"+ws(-e);let[t,r]=e.toString().split(".");if(!r)if(t.includes("e")){let[a,o]=t.split("e");t=a,r="0e"+o}else return lo(e);let n;r&&([r,n]=r.split("e")),t=Qn(t),r=vs(r),r=Qn(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=Qn(n),i+=n}return i}se.num_to_s=ws;function Qn(e){let t=+e;return t.toString()===e&&t+1!==t&&t-1!==t?lo(t):":"+Ss(BigInt(e))}se.int_str_to_s=Qn;function ao(e){return e[0]===":"?ys(e.substring(1)).toString():uo(e).toString()}function bs(e){if(e[0]==="-")return-bs(e.substr(1));let[t,r,n]=e.split(".");if(!r)return uo(t);t=ao(t),r=ao(r),r=vs(r);let i=t+"."+r;if(n){i+="e";let a=!1;n[0]==="-"&&(a=!0,n=n.slice(1)),n=ao(n),i+=a?-n:+n}return+i}se.s_to_num=bs});var mo=ae(ue=>{"use strict";Object.defineProperty(ue,"__esModule",{value:!0});ue.decodeStr=ue.encodeStr=ue.decodeBool=ue.encodeBool=ue.decodeKey=ue.decodeNum=ue.encodeNum=void 0;var po=co();function Qp(e){return"n|"+(0,po.num_to_s)(e)}ue.encodeNum=Qp;function Yp(e){return e=e.replace("n|",""),(0,po.s_to_num)(e)}ue.decodeNum=Yp;function Xp(e){return typeof e=="number"?e:(0,po.s_to_int)(e)}ue.decodeKey=Xp;function Zp(e){return e?"b|T":"b|F"}ue.encodeBool=Zp;function em(e){switch(e){case"b|T":return!0;case"b|F":return!1}return!!e}ue.decodeBool=em;function tm(e){switch(e[0]+e[1]){case"b|":case"o|":case"n|":case"a|":case"s|":e="s|"+e}return e}ue.encodeStr=tm;function nm(e){return e[0]+e[1]==="s|"?e.substr(2):e}ue.decodeStr=nm});var fo=ae(Yn=>{"use strict";Object.defineProperty(Yn,"__esModule",{value:!0});Yn.config=void 0;Yn.config={sort_key:!1,error_on_nan:!1,error_on_infinite:!1}});var Co=ae(be=>{"use strict";Object.defineProperty(be,"__esModule",{value:!0});be.addValue=be.makeInMemoryMemory=be.makeInMemoryCache=be.makeInMemoryStore=be.memToValues=void 0;var ho=fo(),Do=io(),go=mo(),rm=co();function om(e){return e.store.toArray()}be.memToValues=om;function As(){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}}}be.makeInMemoryStore=As;function Ps(){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}}}be.makeInMemoryCache=Ps;function im(){return{store:As(),cache:Ps(),keyCount:0}}be.makeInMemoryMemory=im;function bt(e,t){if(e.cache.hasValue(t))return e.cache.getValue(t);let r=e.keyCount++,n=(0,rm.num_to_s)(r);return e.store.add(t),e.cache.setValue(t,n),n}function am(e,t){ho.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 bt(e,null);if(Array.isArray(t)){let n="a";for(let i=0;i<t.length;i++){let a=t[i],o=a===null?"_":gn(e,a,t);n+="|"+o}return n==="a"&&(n="a|"),bt(e,n)}else{let n=Object.keys(t);if(n.length===0)return bt(e,"o|");let i="o",a=am(e,n);i+="|"+a;for(let o of n){let s=t[o],u=gn(e,s,t);i+="|"+u}return bt(e,i)}case"boolean":return bt(e,(0,go.encodeBool)(t));case"number":return Number.isNaN(t)?(ho.config.error_on_nan&&(0,Do.throwUnsupportedData)("[number NaN]"),""):Number.POSITIVE_INFINITY===t||Number.NEGATIVE_INFINITY===t?(ho.config.error_on_infinite&&(0,Do.throwUnsupportedData)("[number Infinity]"),""):bt(e,(0,go.encodeNum)(t));case"string":return bt(e,(0,go.encodeStr)(t))}return(0,Do.throwUnknownDataType)(t)}be.addValue=gn});var Eo=ae(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.decompress=dt.decode=dt.compress=void 0;var sm=io(),Xn=mo(),xo=Co();function um(e){let t=(0,xo.makeInMemoryMemory)(),r=(0,xo.addValue)(t,e,void 0);return[(0,xo.memToValues)(t),r]}dt.compress=um;function lm(e,t){if(t==="o|")return{};let r={},n=t.split("|"),i=n[1],a=hn(e,i),o=n.length;o-2===1&&!Array.isArray(a)&&(a=[a]);for(let s=2;s<o;s++){let u=a[s-2],l=n[s];l=hn(e,l),r[u]=l}return r}function cm(e,t){if(t==="a|")return[];let r=t.split("|"),n=r.length-1,i=new Array(n);for(let a=0;a<n;a++){let o=r[a+1];o=hn(e,o),i[a]=o}return i}function hn(e,t){if(t===""||t==="_")return null;let r=(0,Xn.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,Xn.decodeBool)(n);case"o|":return lm(e,n);case"n|":return(0,Xn.decodeNum)(n);case"a|":return cm(e,n);default:return(0,Xn.decodeStr)(n)}}return(0,sm.throwUnknownDataType)(n)}dt.decode=hn;function pm(e){let[t,r]=e;return hn(t,r)}dt.decompress=pm});var Is=ae(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.trimUndefinedRecursively=qt.trimUndefined=void 0;function mm(e){for(let t in e)e[t]===void 0&&delete e[t]}qt.trimUndefined=mm;function fm(e){Ts(e,new Set)}qt.trimUndefinedRecursively=fm;function Ts(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)&&Ts(n,t)}}});var Ns=ae(le=>{"use strict";Object.defineProperty(le,"__esModule",{value:!0});le.config=le.trimUndefinedRecursively=le.trimUndefined=le.addValue=le.decode=le.decompress=le.compress=void 0;var Bs=Eo();Object.defineProperty(le,"compress",{enumerable:!0,get:function(){return Bs.compress}});Object.defineProperty(le,"decompress",{enumerable:!0,get:function(){return Bs.decompress}});var dm=Eo();Object.defineProperty(le,"decode",{enumerable:!0,get:function(){return dm.decode}});var Dm=Co();Object.defineProperty(le,"addValue",{enumerable:!0,get:function(){return Dm.addValue}});var Rs=Is();Object.defineProperty(le,"trimUndefined",{enumerable:!0,get:function(){return Rs.trimUndefined}});Object.defineProperty(le,"trimUndefinedRecursively",{enumerable:!0,get:function(){return Rs.trimUndefinedRecursively}});var gm=fo();Object.defineProperty(le,"config",{enumerable:!0,get:function(){return gm.config}})});var df={};gu(df,{createDevToolsServer:()=>bo,version:()=>_o});module.exports=hu(df);var Cu="1.6.17",ge=process.env.OVERRIDE_VERSION??Cu;var pr=require("http");var mr="preview-url";var Pt="framework",wn="platform",bn="node",jo="/~builder-connect",Ct="/~builder-connected",fr="/~builder-dev-tools",dr="/~builder-dev-tools.js",xt="/~builder-dev-tools-close",Uo="/mappings";function k(e,t=""){return e.ts.createSourceFile("module.tsx",typeof t=="string"?t:"",e.ts.ScriptTarget.Latest,void 0)}function An(e,t=""){let r=k(e,t?.trim());if(r.statements.length===0)throw new Error(`No statements found in code: ${t}`);return r.statements[0]}function te(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()+`
|
|
15
15
|
`:n.printNode(e.ts.EmitHint.Unspecified,t,e.ts.createSourceFile("module.tsx","",e.ts.ScriptTarget.Latest)).trim()+`
|
|
16
|
-
`}return""}var qo=
|
|
17
|
-
`,getSourceFile:s=>{if(s=e.normalize(s),s.includes("node_modules")){let l=Yt.get(s);if(l)return
|
|
18
|
-
${u}`)}else n(`Request to ${e.url.href} failed with status ${o.statusCode}: ${s}`)})}).on("error",o=>{n(`Error fetching ${e.url.href}, ${o}`)});e.body&&(a.setHeader("Content-Type","application/json"),a.write(e.body)),a.end()})}function
|
|
16
|
+
`}return""}var qo=R(Ko(),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 O(e,t,r){t=Te(t),r=Te(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=Te(e.normalize(i)),i.startsWith(".")||(i="./"+i),i}function Te(e){return e.startsWith("\\\\?\\")?e:e.replace(/\\/g,"/")}function Et(e,t){let r=e.extname(t),n=e.basename(t,r).split(/[\/\\]/),i=n[n.length-1];return zo(i==="index"?e.basename(e.dirname(t)):i)}function zo(e){return W(e).replace(/ /g,"")}function ye(e,t){let r=e.extname(t),n=Te(e.basename(t,r)).split("/").pop();return W(n==="index"?e.basename(e.dirname(t)):n)}function z(e,t){let r=Te(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 M(e,t){let r=t,n=[];for(let i=0;i<2;i++){let a=e.basename(r);if(!a||a==="components")break;n.unshift(a),r=e.dirname(r)}return n.join("/")}function W(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 de(e){return e.sort((t,r)=>t.name.toLocaleLowerCase().localeCompare(r.name.toLocaleLowerCase()))}async function q(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 Wo(e){return(await e.hash(e.getAppRootDir())).substring(0,8)}function Ht(e){return typeof e=="number"}function Tt(e){return typeof e=="boolean"}function me(e){return typeof e=="string"}function It(e){return typeof e=="string"?/^[A-Z][A-Za-z0-9]*$/.test(e):!1}function Ce(e){return JSON.parse(JSON.stringify(e))}function Pn(e,t,r){for(let n of t)if(e.dirname(r).includes(n))return!0;return!1}function Jo(){try{let e=(0,qo.default)();if(e?.name)return e.name}catch{}return"npm"}function Eu(){return process.platform.startsWith("win")}function Ie(){return Eu()?'"@builder.io/dev-tools"':"builder.io"}function xe(e){let t=e.join(e.getAppRootDir(),"tsconfig.json");return e.exists(t)}var Fu=["node_modules","dist","build","public"];async function Se(e,t){async function r(i,a){if(a>10)return;let o=await e.readdir(i);for(let s of o){if(Fu.includes(s))continue;let u=e.join(i,s),l=await e.stat(u);if(l){if(l.isFile()&&s.startsWith("builder-registry."))return u;if(l.isDirectory()){let c=await r(u,a+1);if(c)return c}}}}let n=await r(e.getAppRootDir(),0);if(!n){let a=`builder-registry.${await xe(e)?"ts":"js"}`;return e.join(t,a)}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"),a=await e.readFile(i);if(a)return JSON.parse(a);if(t===r)break;t=e.dirname(t)}return null}async function Ho(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 Qt(e,t,r){let n=await e.readdir(t);return n.includes(r)?e.join(t,r):(await Promise.all(n.map(async a=>{if(a.startsWith(".")||a==="node_modules")return;let o=e.join(t,a);if((await e.stat(o)).isDirectory()){let u=await Qt(e,o,r);if(u)return u}}))).find(a=>typeof a=="string")}async function Z(e,t,r){if(!Array.isArray(t)||t.length===0)throw new Error(`createTsProgram() Invalid filePaths: ${t}`);let n=await Ho(e,t[0]),i=e.join(n,"typescript","lib"),a=new Map,o={fileExists:s=>{if(s=e.normalize(s),s.includes("node_modules")){let u=Yt.get(s);if(!u){try{e.statSync(s).isFile()?u={exists:!0,content:e.readFileSync(s)}:u={exists:!1}}catch{u={exists:!1}}Yt.set(s,u)}return u.exists}if(!a.has(s))if(e.existsSync(s)){let l=e.statSync(s);a.set(s,l.isFile())}else a.set(s,!1);return a.get(s)},getCanonicalFileName:s=>e.normalize(s),getCurrentDirectory:()=>e.cwd(),getDefaultLibFileName:()=>e.join(i,"lib.d.ts"),getDefaultLibLocation:()=>i,getNewLine:()=>`
|
|
17
|
+
`,getSourceFile:s=>{if(s=e.normalize(s),s.includes("node_modules")){let l=Yt.get(s);if(l)return k(e,l.content)}let u;try{u=e.readFileSync(s)}catch{console.error(`Could not read: ${s}`),u==null}if(u==null){let l=e.basename(s),c=e.extname(l).toLowerCase();if(s.startsWith(i)&&c===".ts"&&(u=Qo.get(l),u==null&&typeof self<"u"&&typeof fetch=="function"))throw new In(l)}return s.includes("node_modules")&&(u?Yt.set(s,{exists:!0,content:u}):Yt.set(s,{exists:!1})),k(e,u)},readFile:s=>{let u=e.readFileSync(s);return typeof u=="string"?u:void 0},useCaseSensitiveFileNames:()=>!1,writeFile:()=>{}};for(;;)try{return yu(e,o,t,r)}catch(s){if(s instanceof In){await Su(e,s.libName);continue}throw e.Sentry?.captureException(s),new Error(`createTsProgram() Could not create program for: ${t[0]}`,{cause:s})}}function yu(e,t,r,n){let i={rootNames:[...r],host:t,options:{}},a=e.ts.findConfigFile(e.dirname(r[0]),o=>e.existsSync(o));if(a){let o=Go.get(a);if(!o){let s=e.ts.readConfigFile(a,u=>{let l=e.readFileSync(u);return typeof l=="string"?l:void 0});s.error?e.Sentry?.captureException(new Error("Error reading tsconfig for createTsProgram"),{extra:{error:s.error,tsConfigPath:a}}):(o=e.ts.parseJsonConfigFileContent(s.config,e.ts.sys||{useCaseSensitiveFileNames:!1,readDirectory:(l,c)=>e.readdirSync(l),fileExists:l=>e.existsSync(l),readFile:l=>e.readFileSync(l)||void 0},e.dirname(a),void 0,a).options,Go.set(a,o))}o&&(i.options=Ce(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 Bt(e,t,r){r||(r=await Z(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 In=class{constructor(t){this.libName=t}};async function Su(e,t){let r=`https://cdn.jsdelivr.net/npm/typescript@${e.ts.version}/lib/${t}`;Tn.has(t)||Tn.set(t,fetch(r).then(n=>n.text()).then(n=>{Qo.set(t,n)})),await Tn.get(t),Tn.delete(t)}var Qo=new Map,Tn=new Map,Yt=new Map,Go=new Map;async function Yo(e,t){let r=await e.readFile(t.filePath);return r==null?{diagnostics:[{messageText:`Error reading: ${t.filePath}`}],code:null,output:null}:Dr(e,{code:r,filePath:t.filePath,compilerOptions:t.compilerOptions})}function Dr(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}var $e=require("fs/promises");var hr=require("os"),Cr=R(require("path"),1),wu=R(require("prettier"),1),bu=R(require("typescript"),1),Au=R(require("launch-editor"),1);async function Rt(e){let t=[],r=await Gt(e,e.getRepoRootDir());if(r){let n=await Zo(r,e);t.push(...n)}return t}async function Zo(e,t){let r=[];if(e&&typeof e=="object"){let n=new Set(Object.keys({...e.dependencies,...e.devDependencies}));for(let i of vu)if(n.has(i)&&!r.some(a=>a.name===i)){let a={name:i};Xo.has(i)&&(a.version=await Xo.get(i)(t)),r.push(a)}}return r}function gr(e){let t=parseInt(e);return Number.isNaN(t)?void 0:t}var Xo=new Map([["next",async e=>{if(!e.spawnSync)return;let t=Jo(),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 a=i[0].split("Next.js v")[1],[o,s,u]=a.split(".");return{major:gr(o),minor:gr(s),patch:gr(u)}}]]),vu=["@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"];var Pu=R(require("@sentry/node"),1);function ei(){let e=(0,hr.homedir)();return Cr.default.join(e,".config","builder","dev-tools.json")}function xr(e,t){return typeof e=="object"&&e!=null&&t in e}async function Nt(){let e=ei();try{let t=await(0,$e.readFile)(e,"utf-8");if(typeof t=="string")return JSON.parse(t)}catch(t){if(t.code==="ENOENT")return null}return null}async function Er(e){let t=ei();e=typeof e=="object"&&e!=null?e:{},await(0,$e.mkdir)(Cr.default.dirname(t),{recursive:!0}),await(0,$e.writeFile)(t,JSON.stringify(e??{},null,2))}var A={gen1:"Gen 1",gen2:"Gen 2"},Xt={CMS:"cms",VCP:"vcp",HYBRID:"hybrid"};var ti=require("console"),ni=require("http"),ri=require("https");function kt(e){let t=Date.now();return new Promise((r,n)=>{let a=Tu(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 s="";o.on("data",u=>{s+=u}),o.on("end",()=>{if((0,ti.debug)(`${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(s))}catch(u){n(`Response from ${e.url.href} is not valid JSON: ${s}
|
|
18
|
+
${u}`)}else n(`Request to ${e.url.href} failed with status ${o.statusCode}: ${s}`)})}).on("error",o=>{n(`Error fetching ${e.url.href}, ${o}`)});e.body&&(a.setHeader("Content-Type","application/json"),a.write(e.body)),a.end()})}function Tu(e){if(e.protocol==="https:")return ri.request;if(e.protocol==="http:")return ni.request;throw new Error(`Unsupported protocol ${e.protocol}`)}async function oi(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 kt({url:t,method:"GET"}))[e.model]}async function ii(e,t){if(t.kind===Xt.VCP)return!0;let r=new URL("https://cdn.builder.io/api/v2/admin"),n={query:`query {
|
|
19
19
|
models {
|
|
20
20
|
id
|
|
21
21
|
name
|
|
22
22
|
}
|
|
23
|
-
}`};e.debug(`Get model id for model name "${t.model}"`);let a=(await kt({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(!a)return e.debug(`No model found for model name "${t.model}"`),!1;e.debug(`Data query, modelId: "${a.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",a.id),o.searchParams.set("apiKey",t.publicApiKey);let s=await kt({url:o,method:"GET"});return e.debug(`Data results (${s.results.length}): ${o.href}`),s.results.length>0}async function ai(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 kt({url:r,method:"GET"});return e.debug(`get content results: ${n.results.length}`),n}async function si(e,t){let r=new URL(`https://cdn.builder.io/api/v1/write/${t.model}`);e.debug(`writing "${t.model}" content:`,r.href),await kt({url:r,method:"POST",headers:{Authorization:`Bearer ${t.privateAuthKey}`},body:t.body})}var $t="page",ui="integration-welcome-screens",li="8d9ee72a33344b4b867918b442ebd0af";async function ci(e,t){let r=await ai(e,{model:ui,publicApiKey:li,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=
|
|
23
|
+
}`};e.debug(`Get model id for model name "${t.model}"`);let a=(await kt({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(!a)return e.debug(`No model found for model name "${t.model}"`),!1;e.debug(`Data query, modelId: "${a.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",a.id),o.searchParams.set("apiKey",t.publicApiKey);let s=await kt({url:o,method:"GET"});return e.debug(`Data results (${s.results.length}): ${o.href}`),s.results.length>0}async function ai(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 kt({url:r,method:"GET"});return e.debug(`get content results: ${n.results.length}`),n}async function si(e,t){let r=new URL(`https://cdn.builder.io/api/v1/write/${t.model}`);e.debug(`writing "${t.model}" content:`,r.href),await kt({url:r,method:"POST",headers:{Authorization:`Bearer ${t.privateAuthKey}`},body:t.body})}var $t="page",ui="integration-welcome-screens",li="8d9ee72a33344b4b867918b442ebd0af";async function ci(e,t){let r=await ai(e,{model:ui,publicApiKey:li,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=Iu(t.publicApiKey,t.pathname,t.title,n);await si(e,{privateAuthKey:t.privateAuthKey,model:$t,body:i})}function Iu(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 pi(e,t,r,n){e.debug(`connect builder with public key: ${t}`),e.publicApiKey=t;let i=e.closeAppServer(),a=await e.setPublicApiKey({publicApiKey:t});e.debug(`set public key: process.env.${a.envKey}=${t}`),process.env[a.envKey]=t;let o=await e.builderPageOptions();e.debug(`builder model: ${$t}, path: ${o.pathname}, template: ${o.templateContentId}`);let s=await ii(e,{model:$t,pageUrl:o.pathname,publicApiKey:t,privateAuthKey:r,kind:n});if(!s){await ci(e,{templateContentId:o.templateContentId,pathname:o.pathname,title:o.title,publicApiKey:t,privateAuthKey:r});let c=5,p=0;for(;!s&&p<c;){await new Promise(h=>setTimeout(h,1e3));let m=await oi({model:$t,pageUrl:o.pathname,publicApiKey:t,privateAuthKey:r});p++,m&&m.length>0&&(s=!0)}}await i,e.debug("ensure builder setup");let u=[];n===Xt.VCP?u=await e.ensureFigmaImportPage():u=await e.ensureBuilderSetup(),a.modifiedType&&u.push({filePath:a.file,modifiedType:a.modifiedType}),u.forEach(c=>{c.displayFilePath=e.relative(e.getAppRootDir(),c.filePath)}),u.sort((c,p)=>c.filePath.localeCompare(p.filePath)),u.length>0?(e.debug(`modified files: ${u.map(c=>c.displayFilePath).join(", ")}`),await e.restartAppServer(),await new Promise(c=>setTimeout(c,500))):e.debug("no modified files");let l={success:!0,pathname:o.localePathname||o.pathname,modifiedFiles:u,platform:e.platform(),kind:n};return n===Xt.VCP&&(l.pathname="/"),e.debug(`connected builder: ${l.pathname}`),l}async function mi(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 fi(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 pi(e,t.data.publicApiKey,t.data.privateAuthKey,t.data.kind);break}case"enableDevTools":{r.data=Nu(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 mi(e);break}case"loadComponent":{r.data=await e.loadComponent(t.data);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":{Fr(e,t.path)?r.data=await e.readdir(t.path,!0):r.errors=[`Invalid file request: ${t.path}`];break}case"readFile":{Fr(e,t.path)?r.data=await e.readFile(t.path):r.errors=[`Invalid file request: ${t.path}`];break}case"writeFile":{Fr(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 Yo(e,t);break}case"transileModule":{r.data=Dr(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 Nt();break}default:{r.errors=[`Unknown request type: ${JSON.stringify(t)}`];let n=t}}return r}function Fr(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],!Ru.includes(i)))return!1}return Bu(e,t),!1}function Bu(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 Ru=[".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 Nu(e,t){return!t&&e.serverShouldRestart&&setTimeout(()=>{console.log(`
|
|
24
24
|
Restarting server after Builder Devtools update...
|
|
25
25
|
`),e.restartAppServer()},10),e.enableAppWatch(!t),{enabled:t,platform:e.platform()}}async function di(e){return gi(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(\`
|
|
26
26
|
\`).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=\`
|
|
@@ -33,7 +33,7 @@ Restarting server after Builder Devtools update...
|
|
|
33
33
|
<h3>How's Devtools working for you?</h3>
|
|
34
34
|
<p>We'd love your feedback!</p>
|
|
35
35
|
</div>
|
|
36
|
-
\`,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.6.16"}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)}
|
|
36
|
+
\`,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.6.17"}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)}
|
|
37
37
|
</style>\`,Dt=class extends HTMLElement{constructor(){super()}connectedCallback(){let e=this.attachShadow({mode:"open"});e.innerHTML=lo+\`<main>
|
|
38
38
|
<aside>
|
|
39
39
|
<div class="logo"></div>
|
|
@@ -72,7 +72,7 @@ Restarting server after Builder Devtools update...
|
|
|
72
72
|
</nav>
|
|
73
73
|
</section>
|
|
74
74
|
</main>
|
|
75
|
-
\`,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.6.
|
|
75
|
+
\`,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.6.17"),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.6.17"),mo());})();`)}async function Di(e){return gi(e,`<!doctype html>
|
|
76
76
|
<html lang="en" dir="ltr">
|
|
77
77
|
<head>
|
|
78
78
|
<meta charset="utf-8" />
|
|
@@ -238,50 +238,50 @@ Restarting server after Builder Devtools update...
|
|
|
238
238
|
</script>
|
|
239
239
|
</body>
|
|
240
240
|
</html>
|
|
241
|
-
`)}async function gi(e,t){let r=await Wo(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:"")}var hi=require("os");async function Ci(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(Ct,e.devToolsServerUrl);n.searchParams.set(vn,(0,hi.platform)()),n.searchParams.set(bn,process.versions.node);let i=e.getFrameworks();return i.length>0&&(r.searchParams.set(Pt,i[0].name),n.searchParams.set(Pt,i[0].name)),r.searchParams.set("redirect_url",n.href),r.searchParams.set("preview_url",t),r.href}var iu=require("http");var au=require("os"),pr=require("path"),Ye=require("fs");var Fe=B(Bn(),1),On=require("process");var Pr=B(require("readline"),1),Ti=require("tty");function Vu({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 Ku=Vu();function Ii(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(Ku,"")}function Bi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ri={exports:{}};(function(e){var t={};e.exports=t,t.eastAsianWidth=function(n){var i=n.charCodeAt(0),a=n.length==2?n.charCodeAt(1):0,o=i;return 55296<=i&&i<=56319&&56320<=a&&a<=57343&&(i&=1023,a&=1023,o=i<<10|a,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),a=0,o=0;o<i.length;o++)a=a+this.characterLength(i[o]);return a},t.slice=function(n,i,a){textLen=t.length(n),i=i||0,a=a||1,i<0&&(i=textLen+i),a<0&&(a=textLen+a);for(var o="",s=0,u=r(n),l=0;l<u.length;l++){var c=u[l],p=t.length(c);if(s>=i-(p==2?1:0))if(s+p<=a)o+=c;else break;s+=p}return o}})(Ri);var zu=Ri.exports,qu=Bi(zu),Wu=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},Ju=Bi(Wu);function Zt(e,t={}){if(typeof e!="string"||e.length===0||(t={ambiguousIsNarrow:!0,...t},e=Ii(e),e.length===0))return 0;e=e.replace(Ju()," ");let r=t.ambiguousIsNarrow?1:2,n=0;for(let i of e){let a=i.codePointAt(0);if(!(a<=31||a>=127&&a<=159||a>=768&&a<=879))switch(qu.eastAsianWidth(i)){case"F":case"W":n+=2;break;case"A":n+=r;break;default:n+=1}}return n}var br=10,yi=(e=0)=>t=>`\x1B[${t+e}m`,Si=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,wi=(e=0)=>(t,r,n)=>`\x1B[${38+e};2;${t};${r};${n}m`,G={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(G.modifier);var Hu=Object.keys(G.color),Gu=Object.keys(G.bgColor);[...Hu,...Gu];function Qu(){let e=new Map;for(let[t,r]of Object.entries(G)){for(let[n,i]of Object.entries(r))G[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},r[n]=G[n],e.set(i[0],i[1]);Object.defineProperty(G,t,{value:r,enumerable:!1})}return Object.defineProperty(G,"codes",{value:e,enumerable:!1}),G.color.close="\x1B[39m",G.bgColor.close="\x1B[49m",G.color.ansi=yi(),G.color.ansi256=Si(),G.color.ansi16m=wi(),G.bgColor.ansi=yi(br),G.bgColor.ansi256=Si(br),G.bgColor.ansi16m=wi(br),Object.defineProperties(G,{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(a=>a+a).join(""));let i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:t=>G.rgbToAnsi256(...G.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 s=t%36;r=Math.floor(t/36)/5,n=Math.floor(s/6)/5,i=s%6/5}let a=Math.max(r,n,i)*2;if(a===0)return 30;let o=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(r));return a===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(t,r,n)=>G.ansi256ToAnsi(G.rgbToAnsi256(t,r,n)),enumerable:!1},hexToAnsi:{value:t=>G.ansi256ToAnsi(G.hexToAnsi256(t)),enumerable:!1}}),G}var Yu=Qu(),_n=new Set(["\x1B","\x9B"]),Xu=39,Ir="\x07",Ni="[",Zu="]",ki="m",Br=`${Zu}8;;`,vi=e=>`${_n.values().next().value}${Ni}${e}${ki}`,bi=e=>`${_n.values().next().value}${Br}${e}${Ir}`,el=e=>e.split(" ").map(t=>Zt(t)),Ar=(e,t,r)=>{let n=[...t],i=!1,a=!1,o=Zt(Ii(e[e.length-1]));for(let[s,u]of n.entries()){let l=Zt(u);if(o+l<=r?e[e.length-1]+=u:(e.push(u),o=0),_n.has(u)&&(i=!0,a=n.slice(s+1).join("").startsWith(Br)),i){a?u===Ir&&(i=!1,a=!1):u===ki&&(i=!1);continue}o+=l,o===r&&s<n.length-1&&(e.push(""),o=0)}!o&&e[e.length-1].length>0&&e.length>1&&(e[e.length-2]+=e.pop())},tl=e=>{let t=e.split(" "),r=t.length;for(;r>0&&!(Zt(t[r-1])>0);)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")},nl=(e,t,r={})=>{if(r.trim!==!1&&e.trim()==="")return"";let n="",i,a,o=el(e),s=[""];for(let[l,c]of e.split(" ").entries()){r.trim!==!1&&(s[s.length-1]=s[s.length-1].trimStart());let p=Zt(s[s.length-1]);if(l!==0&&(p>=t&&(r.wordWrap===!1||r.trim===!1)&&(s.push(""),p=0),(p>0||r.trim===!1)&&(s[s.length-1]+=" ",p++)),r.hard&&o[l]>t){let m=t-p,g=1+Math.floor((o[l]-m-1)/t);Math.floor((o[l]-1)/t)<g&&s.push(""),Ar(s,c,t);continue}if(p+o[l]>t&&p>0&&o[l]>0){if(r.wordWrap===!1&&p<t){Ar(s,c,t);continue}s.push("")}if(p+o[l]>t&&r.wordWrap===!1){Ar(s,c,t);continue}s[s.length-1]+=c}r.trim!==!1&&(s=s.map(l=>tl(l)));let u=[...s.join(`
|
|
242
|
-
`)];for(let[l,c]of u.entries()){if(n+=c,
|
|
243
|
-
`?(a&&(n+=bi("")),i&&p&&(n+=
|
|
244
|
-
`&&(i&&p&&(n+=
|
|
241
|
+
`)}async function gi(e,t){let r=await Wo(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:"")}var hi=require("os");async function Ci(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(Ct,e.devToolsServerUrl);n.searchParams.set(wn,(0,hi.platform)()),n.searchParams.set(bn,process.versions.node);let i=e.getFrameworks();return i.length>0&&(r.searchParams.set(Pt,i[0].name),n.searchParams.set(Pt,i[0].name)),r.searchParams.set("redirect_url",n.href),r.searchParams.set("preview_url",t),r.href}var ru=require("http");var ou=require("os"),cr=require("path"),Qe=require("fs");var Ee=R(Bn(),1),Ln=require("process");var Ar=R(require("readline"),1),Ti=require("tty");function ju({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 Uu=ju();function Ii(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(Uu,"")}function Bi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ri={exports:{}};(function(e){var t={};e.exports=t,t.eastAsianWidth=function(n){var i=n.charCodeAt(0),a=n.length==2?n.charCodeAt(1):0,o=i;return 55296<=i&&i<=56319&&56320<=a&&a<=57343&&(i&=1023,a&=1023,o=i<<10|a,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),a=0,o=0;o<i.length;o++)a=a+this.characterLength(i[o]);return a},t.slice=function(n,i,a){textLen=t.length(n),i=i||0,a=a||1,i<0&&(i=textLen+i),a<0&&(a=textLen+a);for(var o="",s=0,u=r(n),l=0;l<u.length;l++){var c=u[l],p=t.length(c);if(s>=i-(p==2?1:0))if(s+p<=a)o+=c;else break;s+=p}return o}})(Ri);var Vu=Ri.exports,Ku=Bi(Vu),zu=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},qu=Bi(zu);function Zt(e,t={}){if(typeof e!="string"||e.length===0||(t={ambiguousIsNarrow:!0,...t},e=Ii(e),e.length===0))return 0;e=e.replace(qu()," ");let r=t.ambiguousIsNarrow?1:2,n=0;for(let i of e){let a=i.codePointAt(0);if(!(a<=31||a>=127&&a<=159||a>=768&&a<=879))switch(Ku.eastAsianWidth(i)){case"F":case"W":n+=2;break;case"A":n+=r;break;default:n+=1}}return n}var wr=10,yi=(e=0)=>t=>`\x1B[${t+e}m`,Si=(e=0)=>t=>`\x1B[${38+e};5;${t}m`,vi=(e=0)=>(t,r,n)=>`\x1B[${38+e};2;${t};${r};${n}m`,G={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(G.modifier);var Wu=Object.keys(G.color),Ju=Object.keys(G.bgColor);[...Wu,...Ju];function Hu(){let e=new Map;for(let[t,r]of Object.entries(G)){for(let[n,i]of Object.entries(r))G[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},r[n]=G[n],e.set(i[0],i[1]);Object.defineProperty(G,t,{value:r,enumerable:!1})}return Object.defineProperty(G,"codes",{value:e,enumerable:!1}),G.color.close="\x1B[39m",G.bgColor.close="\x1B[49m",G.color.ansi=yi(),G.color.ansi256=Si(),G.color.ansi16m=vi(),G.bgColor.ansi=yi(wr),G.bgColor.ansi256=Si(wr),G.bgColor.ansi16m=vi(wr),Object.defineProperties(G,{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(a=>a+a).join(""));let i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:t=>G.rgbToAnsi256(...G.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 s=t%36;r=Math.floor(t/36)/5,n=Math.floor(s/6)/5,i=s%6/5}let a=Math.max(r,n,i)*2;if(a===0)return 30;let o=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(r));return a===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(t,r,n)=>G.ansi256ToAnsi(G.rgbToAnsi256(t,r,n)),enumerable:!1},hexToAnsi:{value:t=>G.ansi256ToAnsi(G.hexToAnsi256(t)),enumerable:!1}}),G}var Gu=Hu(),On=new Set(["\x1B","\x9B"]),Qu=39,Tr="\x07",Ni="[",Yu="]",ki="m",Ir=`${Yu}8;;`,wi=e=>`${On.values().next().value}${Ni}${e}${ki}`,bi=e=>`${On.values().next().value}${Ir}${e}${Tr}`,Xu=e=>e.split(" ").map(t=>Zt(t)),br=(e,t,r)=>{let n=[...t],i=!1,a=!1,o=Zt(Ii(e[e.length-1]));for(let[s,u]of n.entries()){let l=Zt(u);if(o+l<=r?e[e.length-1]+=u:(e.push(u),o=0),On.has(u)&&(i=!0,a=n.slice(s+1).join("").startsWith(Ir)),i){a?u===Tr&&(i=!1,a=!1):u===ki&&(i=!1);continue}o+=l,o===r&&s<n.length-1&&(e.push(""),o=0)}!o&&e[e.length-1].length>0&&e.length>1&&(e[e.length-2]+=e.pop())},Zu=e=>{let t=e.split(" "),r=t.length;for(;r>0&&!(Zt(t[r-1])>0);)r--;return r===t.length?e:t.slice(0,r).join(" ")+t.slice(r).join("")},el=(e,t,r={})=>{if(r.trim!==!1&&e.trim()==="")return"";let n="",i,a,o=Xu(e),s=[""];for(let[l,c]of e.split(" ").entries()){r.trim!==!1&&(s[s.length-1]=s[s.length-1].trimStart());let p=Zt(s[s.length-1]);if(l!==0&&(p>=t&&(r.wordWrap===!1||r.trim===!1)&&(s.push(""),p=0),(p>0||r.trim===!1)&&(s[s.length-1]+=" ",p++)),r.hard&&o[l]>t){let m=t-p,h=1+Math.floor((o[l]-m-1)/t);Math.floor((o[l]-1)/t)<h&&s.push(""),br(s,c,t);continue}if(p+o[l]>t&&p>0&&o[l]>0){if(r.wordWrap===!1&&p<t){br(s,c,t);continue}s.push("")}if(p+o[l]>t&&r.wordWrap===!1){br(s,c,t);continue}s[s.length-1]+=c}r.trim!==!1&&(s=s.map(l=>Zu(l)));let u=[...s.join(`
|
|
242
|
+
`)];for(let[l,c]of u.entries()){if(n+=c,On.has(c)){let{groups:m}=new RegExp(`(?:\\${Ni}(?<code>\\d+)m|\\${Ir}(?<uri>.*)${Tr})`).exec(u.slice(l).join(""))||{groups:{}};if(m.code!==void 0){let h=Number.parseFloat(m.code);i=h===Qu?void 0:h}else m.uri!==void 0&&(a=m.uri.length===0?void 0:m.uri)}let p=Gu.codes.get(Number(i));u[l+1]===`
|
|
243
|
+
`?(a&&(n+=bi("")),i&&p&&(n+=wi(p))):c===`
|
|
244
|
+
`&&(i&&p&&(n+=wi(i)),a&&(n+=bi(a)))}return n};function Ai(e,t,r){return String(e).normalize().replace(/\r\n/g,`
|
|
245
245
|
`).split(`
|
|
246
|
-
`).map(n=>
|
|
247
|
-
`)}var
|
|
246
|
+
`).map(n=>el(n,t,r)).join(`
|
|
247
|
+
`)}var tl=Object.defineProperty,nl=(e,t,r)=>t in e?tl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ve=(e,t,r)=>(nl(e,typeof t!="symbol"?t+"":t,r),r);function rl(e,t){if(e===t)return;let r=e.split(`
|
|
248
248
|
`),n=t.split(`
|
|
249
|
-
`),i=[];for(let a=0;a<Math.max(r.length,n.length);a++)r[a]!==n[a]&&i.push(a);return i}var
|
|
250
|
-
`),kn(this.input,!1),this.rl
|
|
251
|
-
`).length-1;this.output.write(
|
|
252
|
-
`);this.output.write(i[n]),this._prevFrame=t,this.output.write(
|
|
249
|
+
`),i=[];for(let a=0;a<Math.max(r.length,n.length);a++)r[a]!==n[a]&&i.push(a);return i}var ol=Symbol("clack:cancel");function kn(e,t){e.isTTY&&e.setRawMode(t)}var Pi=new Map([["k","up"],["j","down"],["h","left"],["l","right"]]),il=new Set(["up","down","left","right","space","enter"]),Pr=class{constructor({render:t,input:r=Ln.stdin,output:n=Ln.stdout,...i},a=!0){ve(this,"input"),ve(this,"output"),ve(this,"rl"),ve(this,"opts"),ve(this,"_track",!1),ve(this,"_render"),ve(this,"_cursor",0),ve(this,"state","initial"),ve(this,"value"),ve(this,"error",""),ve(this,"subscribers",new Map),ve(this,"_prevFrame",""),this.opts=i,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=t.bind(this),this._track=a,this.input=r,this.output=n}prompt(){let t=new Ti.WriteStream(0);return t._write=(r,n,i)=>{this._track&&(this.value=this.rl.line.replace(/\t/g,""),this._cursor=this.rl.cursor,this.emit("value",this.value)),i()},this.input.pipe(t),this.rl=Ar.default.createInterface({input:this.input,output:t,tabSize:2,prompt:"",escapeCodeTimeout:50}),Ar.default.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),kn(this.input,!0),this.output.on("resize",this.render),this.render(),new Promise((r,n)=>{this.once("submit",()=>{this.output.write(Ee.cursor.show),this.output.off("resize",this.render),kn(this.input,!1),r(this.value)}),this.once("cancel",()=>{this.output.write(Ee.cursor.show),this.output.off("resize",this.render),kn(this.input,!1),r(ol)})})}on(t,r){let n=this.subscribers.get(t)??[];n.push({cb:r}),this.subscribers.set(t,n)}once(t,r){let n=this.subscribers.get(t)??[];n.push({cb:r,once:!0}),this.subscribers.set(t,n)}emit(t,...r){let n=this.subscribers.get(t)??[],i=[];for(let a of n)a.cb(...r),a.once&&i.push(()=>n.splice(n.indexOf(a),1));for(let a of i)a()}unsubscribe(){this.subscribers.clear()}onKeypress(t,r){if(this.state==="error"&&(this.state="active"),r?.name&&!this._track&&Pi.has(r.name)&&this.emit("cursor",Pi.get(r.name)),r?.name&&il.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.opts.validate){let n=this.opts.validate(this.value);n&&(this.error=n,this.state="error",this.rl.write(this.value))}this.state!=="error"&&(this.state="submit")}t===""&&(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(`
|
|
250
|
+
`),kn(this.input,!1),this.rl.close(),this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let t=Ai(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
|
|
251
|
+
`).length-1;this.output.write(Ee.cursor.move(-999,t*-1))}render(){let t=Ai(this._render(this)??"",process.stdout.columns,{hard:!0});if(t!==this._prevFrame){if(this.state==="initial")this.output.write(Ee.cursor.hide);else{let r=rl(this._prevFrame,t);if(this.restoreCursor(),r&&r?.length===1){let n=r[0];this.output.write(Ee.cursor.move(0,n)),this.output.write(Ee.erase.lines(1));let i=t.split(`
|
|
252
|
+
`);this.output.write(i[n]),this._prevFrame=t,this.output.write(Ee.cursor.move(0,i.length-n-1));return}else if(r&&r?.length>1){let n=r[0];this.output.write(Ee.cursor.move(0,n)),this.output.write(Ee.erase.down());let i=t.split(`
|
|
253
253
|
`).slice(n);this.output.write(i.join(`
|
|
254
|
-
`)),this._prevFrame=t;return}this.output.write(
|
|
255
|
-
${
|
|
256
|
-
`,i=this.value?t:r;switch(this.state){case"submit":return`${n}${
|
|
257
|
-
${
|
|
258
|
-
${
|
|
259
|
-
`}}}).prompt()};var
|
|
260
|
-
`)},nn=(e="")=>{process.stdout.write(`${
|
|
261
|
-
${
|
|
262
|
-
|
|
263
|
-
`)},
|
|
264
|
-
`);r.push(`${t} ${n}`,...i.map(a=>`${
|
|
254
|
+
`)),this._prevFrame=t;return}this.output.write(Ee.erase.down())}this.output.write(t),this.state==="initial"&&(this.state="active"),this._prevFrame=t}}},$n=class extends Pr{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(t){super(t,!1),this.value=!!t.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",r=>{this.output.write(Ee.cursor.move(0,-1)),this.value=r,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};var nd=globalThis.process.platform.startsWith("win");var we=R(require("process"),1),_=R(at(),1),Oi=R(Bn(),1);function al(){return we.default.platform!=="win32"?we.default.env.TERM!=="linux":!!we.default.env.CI||!!we.default.env.WT_SESSION||!!we.default.env.TERMINUS_SUBLIME||we.default.env.ConEmuTask==="{cmd::Cmder}"||we.default.env.TERM_PROGRAM==="Terminus-Sublime"||we.default.env.TERM_PROGRAM==="vscode"||we.default.env.TERM==="xterm-256color"||we.default.env.TERM==="alacritty"||we.default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var sl=al(),Y=(e,t)=>sl?e:t,ul=Y("\u25C6","*"),ll=Y("\u25A0","x"),cl=Y("\u25B2","x"),_i=Y("\u25C7","o"),pl=Y("\u250C","T"),Ye=Y("\u2502","|"),Mi=Y("\u2514","\u2014"),$i=Y("\u25CF",">"),Li=Y("\u25CB"," "),md=Y("\u25FB","[\u2022]"),fd=Y("\u25FC","[+]"),dd=Y("\u25FB","[ ]"),Dd=Y("\u25AA","\u2022"),gd=Y("\u2500","-"),hd=Y("\u256E","+"),Cd=Y("\u251C","+"),xd=Y("\u256F","+"),ml=Y("\u25CF","\u2022"),fl=Y("\u25C6","*"),dl=Y("\u25B2","!"),Dl=Y("\u25A0","x"),gl=e=>{switch(e){case"initial":case"active":return _.default.cyan(ul);case"cancel":return _.default.red(ll);case"error":return _.default.yellow(cl);case"submit":return _.default.green(_i)}};var tn=e=>{let t=e.active??"Yes",r=e.inactive??"No";return new $n({active:t,inactive:r,initialValue:e.initialValue??!0,render(){let n=`${_.default.gray(Ye)}
|
|
255
|
+
${gl(this.state)} ${e.message}
|
|
256
|
+
`,i=this.value?t:r;switch(this.state){case"submit":return`${n}${_.default.gray(Ye)} ${_.default.dim(i)}`;case"cancel":return`${n}${_.default.gray(Ye)} ${_.default.strikethrough(_.default.dim(i))}
|
|
257
|
+
${_.default.gray(Ye)}`;default:return`${n}${_.default.cyan(Ye)} ${this.value?`${_.default.green($i)} ${t}`:`${_.default.dim(Li)} ${_.default.dim(t)}`} ${_.default.dim("/")} ${this.value?`${_.default.dim(Li)} ${_.default.dim(r)}`:`${_.default.green($i)} ${r}`}
|
|
258
|
+
${_.default.cyan(Mi)}
|
|
259
|
+
`}}}).prompt()};var st=(e="")=>{process.stdout.write(`${_.default.gray(pl)} ${e}
|
|
260
|
+
`)},nn=(e="")=>{process.stdout.write(`${_.default.gray(Ye)}
|
|
261
|
+
${_.default.gray(Mi)} ${e}
|
|
262
|
+
|
|
263
|
+
`)},K={message:(e="",{symbol:t=_.default.gray(Ye)}={})=>{let r=[`${_.default.gray(Ye)}`];if(e){let[n,...i]=e.split(`
|
|
264
|
+
`);r.push(`${t} ${n}`,...i.map(a=>`${_.default.gray(Ye)} ${a}`))}process.stdout.write(`${r.join(`
|
|
265
265
|
`)}
|
|
266
|
-
`)},info:e=>{
|
|
267
|
-
`),n;for(;(n=
|
|
268
|
-
`),a=a.replace(/\\r/g,"\r")),t[i]=a}return t}var
|
|
266
|
+
`)},info:e=>{K.message(e,{symbol:_.default.blue(ml)})},success:e=>{K.message(e,{symbol:_.default.green(fl)})},step:e=>{K.message(e,{symbol:_.default.green(_i)})},warn:e=>{K.message(e,{symbol:_.default.yellow(dl)})},warning:e=>{K.warn(e)},error:e=>{K.message(e,{symbol:_.default.red(Dl)})}};var gt=R(at(),1);var L=R(require("typescript"),1);async function Le(e){let t=ji(e),r=await e.readFile(t);return typeof r=="string"?JSON.parse(r):{}}async function Oe(e,t){t=typeof t=="object"&&t!=null?t:{};let r=ji(e);await e.writeFile(r,JSON.stringify(t??{},null,2))}function ji(e){let t=e.getAppRootDir();return e.join(t,"node_modules",".builder","builder-cache.json")}async function ut(e,t,r){let n={envKey:r,envValue:null,file:""};for(let i of t){let a=e.join(e.getAppRootDir(),i),o=await hl(e,a);if(o){let s=o[r];if(typeof s=="string"&&s.length>0&&s!=="YOUR_API_KEY")return n.envValue=s,n.file=a,n}}return n.file=e.join(e.getAppRootDir(),t[t.length-1]),n}async function hl(e,t){let r=await e.readFile(t);return typeof r=="string"?Ui(r):null}function Ui(e){let t={},r=e.replace(/\r\n?/gm,`
|
|
267
|
+
`),n;for(;(n=Cl.exec(r))!=null;){let i=n[1],a=n[2]||"";a=a.trim();let o=a[0];a=a.replace(/^(['"`])([\s\S]*)\1$/gm,"$2"),o==='"'&&(a=a.replace(/\\n/g,`
|
|
268
|
+
`),a=a.replace(/\\r/g,"\r")),t[i]=a}return t}var Cl=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm;async function lt(e,t,r,n){let i="# https://www.builder.io/c/docs/using-your-api-key",a=await e.readFile(t);if(a)if(a.includes(r))if(a.includes(n))e.debug(`"${r}" with "${n}" already set in ${t}`);else return e.debug(`Replace "${r}" in ${t}`),a=a.replace(new RegExp(`${r}=.*`),`${r}=${n}`),await e.writeFile(t,a),"update";else return e.debug(`Append "${r}" to ${t}`),a+=`
|
|
269
269
|
|
|
270
270
|
${i}
|
|
271
271
|
${r}=${n}
|
|
272
272
|
|
|
273
273
|
`,await e.writeFile(t,a),"update";else return e.debug(`Creating new .env file with "${r}" at ${t}`),a=[i,`${r}=${n}`,""].join(`
|
|
274
|
-
`),await e.writeFile(t,a),"create";return null}async function rn(e){return await st(e,[".env.local",".env.development.local",".env.production.local",".env.development",".env.production",".env"],Me)}async function Ki(e,t){let r=await rn(e),n=await ut(e,r.file,r.envKey,t);return{...r,modifiedType:n}}var Me="NEXT_PUBLIC_BUILDER_API_KEY";function Lt(e,t,r,n,i=!0){let a=t.properties.filter(s=>e.ts.isPropertyAssignment(s)),o=El(e,t,r);return o>-1?n==null&&i?e.ts.factory.updateObjectLiteralExpression(t,a.filter((s,u)=>u!==o)):(a[o]=e.ts.factory.updatePropertyAssignment(a[o],a[o].name,on(e,n)),e.ts.factory.updateObjectLiteralExpression(t,a)):(n!=null&&a.push(e.ts.factory.createPropertyAssignment(r,on(e,n))),e.ts.factory.updateObjectLiteralExpression(t,a))}function El(e,t,r){return t.properties.findIndex(n=>j(e,n)===r)}function an(e,t){switch(t.kind){case e.ts.SyntaxKind.ArrayLiteralExpression:return yl(e,t);case e.ts.SyntaxKind.ObjectLiteralExpression:return Fl(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 Fl(e,t){let r={};if(t&&e.ts.isObjectLiteralExpression(t)){for(let n of t.properties)if(e.ts.isPropertyAssignment(n)){let i=j(e,n);i&&(r[i]=an(e,n.initializer))}}return r}function yl(e,t){return t&&e.ts.isArrayLiteralExpression(t)?t.elements.map(r=>an(e,r)):[]}function j(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 on(e,t){return Rr(e,t,new WeakSet)}function Rr(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)?Sl(e,t,r):typeof t=="object"?wl(e,t,r):e.ts.factory.createIdentifier(t)}function Sl(e,t,r){let n=t.map(i=>Rr(e,i,r));return e.ts.factory.createArrayLiteralExpression(n,!0)}function wl(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,Rr(e,t[i],r)));return e.ts.factory.createObjectLiteralExpression(n,!0)}function Ft(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 a=r.parameters;if(a.length>0){let o=a[0],s=t.getTypeAtLocation(o);s.aliasTypeArguments&&s.aliasTypeArguments.length>0&&(s=s.aliasTypeArguments[0]),!!(s.flags&e.ts.TypeFlags.Object)&&(i=s.getProperties())}}else if(e.ts.isIdentifier(r)){let a=t.getTypeAtLocation(r),o=a.symbol?.valueDeclaration;if(o&&e.ts.isClassDeclaration(o)){let u=o.heritageClauses?.find(l=>l.token===e.ts.SyntaxKind.ExtendsKeyword)?.types;if(u){for(let l of u)if(t.getSymbolAtLocation(l.expression)?.name==="Component"){if(e.ts.isExpressionWithTypeArguments(l)){let p=l.typeArguments;if(p){let m=p[0];i=t.getTypeFromTypeNode(m).getProperties()}}break}}}if(!i){let s=a.getCallSignatures();if(s.length>0){let u=s[0].getParameters();u.length>0&&(i=t.getTypeOfSymbolAtLocation(u[0],r).getProperties())}}}else if(e.ts.isExportSpecifier(r)){let a=t.getSymbolAtLocation(r.name);if(a){let s=t.getTypeOfSymbolAtLocation(a,r).getCallSignatures();if(s.length>0){let u=s[0].getParameters();u.length>0&&(i=t.getTypeOfSymbolAtLocation(u[0],r).getProperties())}}}if(i)for(let a of i){let o=vl(e,t,a);o&&n.push(o)}return n=n.filter(qi),n.length>0?n:bl(e,r)}function vl(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 a="string",o;if(n?.type){let u=t.getTypeFromTypeNode(n.type),l=t.typeToString(u),c=Nr(l);c.knownType?a=c.builderType:Pl(l)||u.flags&e.ts.TypeFlags.StringLike?a="string":u.flags&e.ts.TypeFlags.NumberLike?a="number":u.flags&e.ts.TypeFlags.IndexedAccess?a="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)?a="object":a="string",l!==a&&(o=l)}let s={name:i,type:a,isRegistered:!1};if(o&&n.type){let u=Rl(e,t,t.getTypeFromTypeNode(n.type));s.meta=s.meta||{},u&&u.length>0&&s.type==="string"&&u.every(Il)?s.enum=u.map(Bl):s.meta.ts=o}return n.questionToken||(s.required=!0),s}return null}function bl(e,t){let r=[],n=e.ts.getJSDocCommentsAndTags(t);for(let i of n)if(!(!e.ts.isJSDoc(i)||!i.tags))for(let a of i.tags){if(!e.ts.isJSDocParameterTag(a)||a.tagName.text!=="param")continue;let s=a.typeExpression?.type;if(!s||!e.ts.isJSDocTypeLiteral(s))continue;let u=s.jsDocPropertyTags;if(u)for(let l of u){if(!e.ts.isJSDocPropertyLikeTag(l))continue;let c=l.name;if(!e.ts.isQualifiedName(c))continue;let p=l.typeExpression;if(!p)continue;let m="";switch(p.type.kind){case e.ts.SyntaxKind.StringKeyword:{m="string";break}case e.ts.SyntaxKind.NumberKeyword:{m="number";break}case e.ts.SyntaxKind.BooleanKeyword:{m="boolean";break}default:continue}let d={name:c.right.text,type:m,isRegistered:!1};r.push(d)}}return r.filter(qi)}var Al=["ClassicComponent","FunctionComponent","IntrinsicElements","JSX","ReactNode","ReactElement","ReactPortal"];function Pl(e){return typeof e!="string"?!1:!!Al.some(t=>e.includes(t))}function Nr(e){return typeof e=="string"&&(e=e.trim(),Tl.some(t=>t.value===e))?{builderType:e,knownType:!0}:{builderType:"string",knownType:!1}}var Tl=[{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 Il(e){return/^['"].*['"]$/.test(e)}function Bl(e){return(e.startsWith('"')||e.startsWith("'"))&&(e.endsWith('"')||e.endsWith("'"))?e.slice(1,-1):e}var Rl=(e,t,r)=>{let n=new Set;zi(e,t,r,n);let i=n.delete("true"),a=n.delete("false");(i||a)&&n.add("boolean");let o=Array.from(n.keys()).sort();if(o.length>1&&(o=o.map(s=>s.indexOf("=>")>=0?`(${s})`:s)),!(o.length>20))return o},Nl=(e,t,r)=>{let n=e.ts.TypeFormatFlags.InElementType|e.ts.TypeFormatFlags.NoTruncation;return t.typeToString(r,void 0,n)},zi=(e,t,r,n)=>{if(r.isUnion())r.types.forEach(i=>{zi(e,t,i,n)});else if(r.isLiteral()){let i=Nl(e,t,r);n.add(i)}};function qi(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!kl.has(t.toLowerCase())}var kl=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 De(e,t,r){for(let n of r.properties){if(!e.ts.isPropertyAssignment(n))continue;let i=j(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 a=$l(e,n.initializer);ye(t,a);continue}if(i==="meta"&&e.ts.isObjectLiteralExpression(n.initializer)){let a=an(e,n.initializer);a&&typeof a=="object"&&(t.meta=a);continue}}return t}function $l(e,t){let r=[];for(let n of t.elements)e.ts.isObjectLiteralExpression(n)&&r.push(Ll(e,n));return r}function Ll(e,t){let r=an(e,t),n=Kl(r);return n.isRegistered=!0,n}function ee(e,t,r){let n=_l(r);return t=Lt(e,t,"name",n.name,!1),t=Lt(e,t,"description",n.description),t=Lt(e,t,"image",n.image),t=Lt(e,t,"meta",n.meta),t=Ol(e,t,n),zl(e,t)}function Ol(e,t,r){let n=null,i=t.properties.filter(s=>e.ts.isPropertyAssignment(s)&&e.ts.isIdentifier(s.name)),a=i.findIndex(s=>e.ts.isIdentifier(s.name)&&s.name.text==="inputs"),o=[...r.inputs??[]];if(a>-1){if(o.length===0)return Lt(e,t,"inputs",null);let s=i[a];e.ts.isPropertyAssignment(s)&&e.ts.isArrayLiteralExpression(s.initializer)&&(n=s.initializer)}return o.length===0?t:(n=jl(e,n||e.ts.factory.createArrayLiteralExpression(),o),a>-1?i[a]=e.ts.factory.updatePropertyAssignment(i[a],i[a].name,n):i.push(e.ts.factory.createPropertyAssignment("inputs",n)),e.ts.factory.updateObjectLiteralExpression(t,i))}function _l(e){return{name:e.name,description:e.description,image:e.image,inputs:(e.inputs||[]).filter(r=>r.isRegistered).map(Ml),...e.meta?{meta:{...e.meta}}:{}}}function Ml(e){let t={name:e.name,type:e.type};return(me(e.defaultValue)||Ht(e.defaultValue)||Tt(e.defaultValue))&&(t.defaultValue=e.defaultValue),me(e.friendlyName)&&(t.friendlyName=e.friendlyName),me(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 jl(e,t,r){let n=t.elements.filter(i=>{if(!e.ts.isObjectLiteralExpression(i))return!1;let a=i.properties.find(s=>j(e,s)==="name");if(!a)return!1;let o=a.initializer;return e.ts.isStringLiteral(o)?r.some(s=>s.name===o.text):!1});for(let i of r)n=Ul(e,n,i);return n.sort((i,a)=>{let o=i.properties.find(m=>j(e,m)==="name"),s=a.properties.find(m=>j(e,m)==="name"),u=o?.initializer,l=s?.initializer,c=u&&e.ts.isStringLiteral(u)?u.text:"zz",p=l&&e.ts.isStringLiteral(l)?l.text:"zz";return c.toLowerCase().localeCompare(p.toLowerCase())}),e.ts.factory.updateArrayLiteralExpression(t,n)}function Ul(e,t,r){let n=t.findIndex(i=>i.properties.some(a=>{let o=j(e,a);return e.ts.isPropertyAssignment(a)&&o==="name"&&e.ts.isStringLiteral(a.initializer)&&a.initializer.text===r.name}));if(n>-1)t[n]=Wi(e,t[n],r);else{let i=Wi(e,e.ts.factory.createObjectLiteralExpression([e.ts.factory.createPropertyAssignment("name",e.ts.factory.createStringLiteral(r.name))],!0),r);t.push(i)}return t}function Wi(e,t,r){let n=t.properties.filter(a=>e.ts.isPropertyAssignment(a)),i=Object.keys(r).filter(a=>a!=="isRegistered");for(let a of i)n=Vl(e,n,r,a);return n=ql(e,n.filter(a=>{let o=j(e,a);return i.includes(o)})),e.ts.factory.updateObjectLiteralExpression(t,n)}function Vl(e,t,r,n){let i=t.findIndex(a=>e.ts.isIdentifier(a.name)&&a.name.text===n);return i>-1?t[i]=e.ts.factory.updatePropertyAssignment(t[i],t[i].name,on(e,r[n])):t.push(e.ts.factory.createPropertyAssignment(n,on(e,r[n]))),t}function ye(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=kr(e)}function Kl(e){let t=Nr(e.type),r={name:e.name.trim(),type:t.builderType};return me(e.friendlyName)&&e.friendlyName.trim()!==e.name.trim()&&(r.friendlyName=e.friendlyName),(me(e.defaultValue)||Ht(e.defaultValue)||Tt(e.defaultValue))&&(r.defaultValue=e.defaultValue),me(e.helperText)&&(r.helperText=e.helperText),Tt(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),$r(r)}function kr(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 $r(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 zl(e,t){let r=[...t.properties].sort((n,i)=>{let a=j(e,n)||"zz",o=j(e,i)||"zz";if(a==="inputs")return 1;let s=Ji.indexOf(a),u=Ji.indexOf(o);return s>-1?u>-1&&s>u?1:-1:u>-1?s>-1&&u<s?-1:1:a.localeCompare(o)});return e.ts.factory.updateObjectLiteralExpression(t,r)}var Ji=["component","name","description"];function ql(e,t){return[...t].sort((n,i)=>{let a=j(e,n)||"zz",o=j(e,i)||"zz",s=Hi.indexOf(a),u=Hi.indexOf(o);return s>-1?u>-1&&s>u?1:-1:u>-1?s>-1&&u<s?-1:1:a.localeCompare(o)})}var Hi=["name","type"];function Ot(e,t){for(let r of t.properties){if(!e.ts.isPropertyAssignment(r)||!e.ts.isIdentifier(r.name))continue;if(j(e,r)==="canHaveChildren"){let{initializer:i}=r;return i.kind===e.ts.SyntaxKind.TrueKeyword}}return!1}function Gi(e,t){let r=`Builder.registerComponent(
|
|
274
|
+
`),await e.writeFile(t,a),"create";return null}async function rn(e){return await ut(e,[".env.local",".env.development.local",".env.production.local",".env.development",".env.production",".env"],_e)}async function Vi(e,t){let r=await rn(e),n=await lt(e,r.file,r.envKey,t);return{...r,modifiedType:n}}var _e="NEXT_PUBLIC_BUILDER_API_KEY";function Lt(e,t,r,n,i=!0){let a=t.properties.filter(s=>e.ts.isPropertyAssignment(s)),o=xl(e,t,r);return o>-1?n==null&&i?e.ts.factory.updateObjectLiteralExpression(t,a.filter((s,u)=>u!==o)):(a[o]=e.ts.factory.updatePropertyAssignment(a[o],a[o].name,on(e,n)),e.ts.factory.updateObjectLiteralExpression(t,a)):(n!=null&&a.push(e.ts.factory.createPropertyAssignment(r,on(e,n))),e.ts.factory.updateObjectLiteralExpression(t,a))}function xl(e,t,r){return t.properties.findIndex(n=>j(e,n)===r)}function an(e,t){switch(t.kind){case e.ts.SyntaxKind.ArrayLiteralExpression:return Fl(e,t);case e.ts.SyntaxKind.ObjectLiteralExpression:return El(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 El(e,t){let r={};if(t&&e.ts.isObjectLiteralExpression(t)){for(let n of t.properties)if(e.ts.isPropertyAssignment(n)){let i=j(e,n);i&&(r[i]=an(e,n.initializer))}}return r}function Fl(e,t){return t&&e.ts.isArrayLiteralExpression(t)?t.elements.map(r=>an(e,r)):[]}function j(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 on(e,t){return Br(e,t,new WeakSet)}function Br(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)?yl(e,t,r):typeof t=="object"?Sl(e,t,r):e.ts.factory.createIdentifier(t)}function yl(e,t,r){let n=t.map(i=>Br(e,i,r));return e.ts.factory.createArrayLiteralExpression(n,!0)}function Sl(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,Br(e,t[i],r)));return e.ts.factory.createObjectLiteralExpression(n,!0)}function Ft(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 a=r.parameters;if(a.length>0){let o=a[0],s=t.getTypeAtLocation(o);s.aliasTypeArguments&&s.aliasTypeArguments.length>0&&(s=s.aliasTypeArguments[0]),!!(s.flags&e.ts.TypeFlags.Object)&&(i=s.getProperties())}}else if(e.ts.isIdentifier(r)){let a=t.getTypeAtLocation(r),o=a.symbol?.valueDeclaration;if(o&&e.ts.isClassDeclaration(o)){let u=o.heritageClauses?.find(l=>l.token===e.ts.SyntaxKind.ExtendsKeyword)?.types;if(u){for(let l of u)if(t.getSymbolAtLocation(l.expression)?.name==="Component"){if(e.ts.isExpressionWithTypeArguments(l)){let p=l.typeArguments;if(p){let m=p[0];i=t.getTypeFromTypeNode(m).getProperties()}}break}}}if(!i){let s=a.getCallSignatures();if(s.length>0){let u=s[0].getParameters();u.length>0&&(i=t.getTypeOfSymbolAtLocation(u[0],r).getProperties())}}}else if(e.ts.isExportSpecifier(r)){let a=t.getSymbolAtLocation(r.name);if(a){let s=t.getTypeOfSymbolAtLocation(a,r).getCallSignatures();if(s.length>0){let u=s[0].getParameters();u.length>0&&(i=t.getTypeOfSymbolAtLocation(u[0],r).getProperties())}}}if(i)for(let a of i){let o=vl(e,t,a);o&&n.push(o)}return n=n.filter(zi),n.length>0?n:wl(e,r)}function vl(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 a="string",o;if(n?.type){let u=t.getTypeFromTypeNode(n.type),l=t.typeToString(u),c=Rr(l);c.knownType?a=c.builderType:Al(l)||u.flags&e.ts.TypeFlags.StringLike?a="string":u.flags&e.ts.TypeFlags.NumberLike?a="number":u.flags&e.ts.TypeFlags.IndexedAccess?a="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)?a="object":a="string",l!==a&&(o=l)}let s={name:i,type:a,isRegistered:!1};if(o&&n.type){let u=Bl(e,t,t.getTypeFromTypeNode(n.type));s.meta=s.meta||{},u&&u.length>0&&s.type==="string"&&u.every(Tl)?s.enum=u.map(Il):s.meta.ts=o}return n.questionToken||(s.required=!0),s}return null}function wl(e,t){let r=[],n=e.ts.getJSDocCommentsAndTags(t);for(let i of n)if(!(!e.ts.isJSDoc(i)||!i.tags))for(let a of i.tags){if(!e.ts.isJSDocParameterTag(a)||a.tagName.text!=="param")continue;let s=a.typeExpression?.type;if(!s||!e.ts.isJSDocTypeLiteral(s))continue;let u=s.jsDocPropertyTags;if(u)for(let l of u){if(!e.ts.isJSDocPropertyLikeTag(l))continue;let c=l.name;if(!e.ts.isQualifiedName(c))continue;let p=l.typeExpression;if(!p)continue;let m="";switch(p.type.kind){case e.ts.SyntaxKind.StringKeyword:{m="string";break}case e.ts.SyntaxKind.NumberKeyword:{m="number";break}case e.ts.SyntaxKind.BooleanKeyword:{m="boolean";break}default:continue}let D={name:c.right.text,type:m,isRegistered:!1};r.push(D)}}return r.filter(zi)}var bl=["ClassicComponent","FunctionComponent","IntrinsicElements","JSX","ReactNode","ReactElement","ReactPortal"];function Al(e){return typeof e!="string"?!1:!!bl.some(t=>e.includes(t))}function Rr(e){return typeof e=="string"&&(e=e.trim(),Pl.some(t=>t.value===e))?{builderType:e,knownType:!0}:{builderType:"string",knownType:!1}}var Pl=[{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 Tl(e){return/^['"].*['"]$/.test(e)}function Il(e){return(e.startsWith('"')||e.startsWith("'"))&&(e.endsWith('"')||e.endsWith("'"))?e.slice(1,-1):e}var Bl=(e,t,r)=>{let n=new Set;Ki(e,t,r,n);let i=n.delete("true"),a=n.delete("false");(i||a)&&n.add("boolean");let o=Array.from(n.keys()).sort();if(o.length>1&&(o=o.map(s=>s.indexOf("=>")>=0?`(${s})`:s)),!(o.length>20))return o},Rl=(e,t,r)=>{let n=e.ts.TypeFormatFlags.InElementType|e.ts.TypeFormatFlags.NoTruncation;return t.typeToString(r,void 0,n)},Ki=(e,t,r,n)=>{if(r.isUnion())r.types.forEach(i=>{Ki(e,t,i,n)});else if(r.isLiteral()){let i=Rl(e,t,r);n.add(i)}};function zi(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!Nl.has(t.toLowerCase())}var Nl=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 De(e,t,r){for(let n of r.properties){if(!e.ts.isPropertyAssignment(n))continue;let i=j(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 a=kl(e,n.initializer);Fe(t,a);continue}if(i==="meta"&&e.ts.isObjectLiteralExpression(n.initializer)){let a=an(e,n.initializer);a&&typeof a=="object"&&(t.meta=a);continue}}return t}function kl(e,t){let r=[];for(let n of t.elements)e.ts.isObjectLiteralExpression(n)&&r.push($l(e,n));return r}function $l(e,t){let r=an(e,t),n=Vl(r);return n.isRegistered=!0,n}function ee(e,t,r){let n=Ol(r);return t=Lt(e,t,"name",n.name,!1),t=Lt(e,t,"description",n.description),t=Lt(e,t,"image",n.image),t=Lt(e,t,"meta",n.meta),t=Ll(e,t,n),Kl(e,t)}function Ll(e,t,r){let n=null,i=t.properties.filter(s=>e.ts.isPropertyAssignment(s)&&e.ts.isIdentifier(s.name)),a=i.findIndex(s=>e.ts.isIdentifier(s.name)&&s.name.text==="inputs"),o=[...r.inputs??[]];if(a>-1){if(o.length===0)return Lt(e,t,"inputs",null);let s=i[a];e.ts.isPropertyAssignment(s)&&e.ts.isArrayLiteralExpression(s.initializer)&&(n=s.initializer)}return o.length===0?t:(n=Ml(e,n||e.ts.factory.createArrayLiteralExpression(),o),a>-1?i[a]=e.ts.factory.updatePropertyAssignment(i[a],i[a].name,n):i.push(e.ts.factory.createPropertyAssignment("inputs",n)),e.ts.factory.updateObjectLiteralExpression(t,i))}function Ol(e){return{name:e.name,description:e.description,image:e.image,inputs:(e.inputs||[]).filter(r=>r.isRegistered).map(_l),...e.meta?{meta:{...e.meta}}:{}}}function _l(e){let t={name:e.name,type:e.type};return(me(e.defaultValue)||Ht(e.defaultValue)||Tt(e.defaultValue))&&(t.defaultValue=e.defaultValue),me(e.friendlyName)&&(t.friendlyName=e.friendlyName),me(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 Ml(e,t,r){let n=t.elements.filter(i=>{if(!e.ts.isObjectLiteralExpression(i))return!1;let a=i.properties.find(s=>j(e,s)==="name");if(!a)return!1;let o=a.initializer;return e.ts.isStringLiteral(o)?r.some(s=>s.name===o.text):!1});for(let i of r)n=jl(e,n,i);return n.sort((i,a)=>{let o=i.properties.find(m=>j(e,m)==="name"),s=a.properties.find(m=>j(e,m)==="name"),u=o?.initializer,l=s?.initializer,c=u&&e.ts.isStringLiteral(u)?u.text:"zz",p=l&&e.ts.isStringLiteral(l)?l.text:"zz";return c.toLowerCase().localeCompare(p.toLowerCase())}),e.ts.factory.updateArrayLiteralExpression(t,n)}function jl(e,t,r){let n=t.findIndex(i=>i.properties.some(a=>{let o=j(e,a);return e.ts.isPropertyAssignment(a)&&o==="name"&&e.ts.isStringLiteral(a.initializer)&&a.initializer.text===r.name}));if(n>-1)t[n]=qi(e,t[n],r);else{let i=qi(e,e.ts.factory.createObjectLiteralExpression([e.ts.factory.createPropertyAssignment("name",e.ts.factory.createStringLiteral(r.name))],!0),r);t.push(i)}return t}function qi(e,t,r){let n=t.properties.filter(a=>e.ts.isPropertyAssignment(a)),i=Object.keys(r).filter(a=>a!=="isRegistered");for(let a of i)n=Ul(e,n,r,a);return n=zl(e,n.filter(a=>{let o=j(e,a);return i.includes(o)})),e.ts.factory.updateObjectLiteralExpression(t,n)}function Ul(e,t,r,n){let i=t.findIndex(a=>e.ts.isIdentifier(a.name)&&a.name.text===n);return i>-1?t[i]=e.ts.factory.updatePropertyAssignment(t[i],t[i].name,on(e,r[n])):t.push(e.ts.factory.createPropertyAssignment(n,on(e,r[n]))),t}function Fe(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=Nr(e)}function Vl(e){let t=Rr(e.type),r={name:e.name.trim(),type:t.builderType};return me(e.friendlyName)&&e.friendlyName.trim()!==e.name.trim()&&(r.friendlyName=e.friendlyName),(me(e.defaultValue)||Ht(e.defaultValue)||Tt(e.defaultValue))&&(r.defaultValue=e.defaultValue),me(e.helperText)&&(r.helperText=e.helperText),Tt(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),kr(r)}function Nr(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 kr(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 Kl(e,t){let r=[...t.properties].sort((n,i)=>{let a=j(e,n)||"zz",o=j(e,i)||"zz";if(a==="inputs")return 1;let s=Wi.indexOf(a),u=Wi.indexOf(o);return s>-1?u>-1&&s>u?1:-1:u>-1?s>-1&&u<s?-1:1:a.localeCompare(o)});return e.ts.factory.updateObjectLiteralExpression(t,r)}var Wi=["component","name","description"];function zl(e,t){return[...t].sort((n,i)=>{let a=j(e,n)||"zz",o=j(e,i)||"zz",s=Ji.indexOf(a),u=Ji.indexOf(o);return s>-1?u>-1&&s>u?1:-1:u>-1?s>-1&&u<s?-1:1:a.localeCompare(o)})}var Ji=["name","type"];function Ot(e,t){for(let r of t.properties){if(!e.ts.isPropertyAssignment(r)||!e.ts.isIdentifier(r.name))continue;if(j(e,r)==="canHaveChildren"){let{initializer:i}=r;return i.kind===e.ts.SyntaxKind.TrueKeyword}}return!1}function Hi(e,t){let r=`Builder.registerComponent(
|
|
275
275
|
`;if(e.appDir)t.acceptsChildren?r+=` withChildren(${t.importName}),
|
|
276
276
|
`:r+=` ${t.importName},
|
|
277
|
-
`;else{let i=t.externalImportPath?t.externalImportPath:
|
|
277
|
+
`;else{let i=t.externalImportPath?t.externalImportPath:O(e,e.registryPath,t.filePath);t.exportName==="default"?t.acceptsChildren?r+=` withChildren(dynamic(() => import(${JSON.stringify(i)}))),
|
|
278
278
|
`:r+=` dynamic(() => import(${JSON.stringify(i)})),
|
|
279
279
|
`:t.acceptsChildren?r+=` withChildren(dynamic(async () => (await import(${JSON.stringify(i)})).${t.exportName})),
|
|
280
280
|
`:r+=` dynamic(async () => (await import(${JSON.stringify(i)})).${t.exportName}),
|
|
281
281
|
`}r+=` {
|
|
282
282
|
name: "${t.name}",
|
|
283
283
|
}
|
|
284
|
-
`,r+=");";let n=An(e,r);return Lr(e,n,t)}function Lr(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 a=i[1];return e.ts.isObjectLiteralExpression(a)?(i[1]=ee(e,a,r),e.ts.factory.updateExpressionStatement(t,e.ts.factory.updateCallExpression(n,n.expression,n.typeArguments,i))):t}function $(e,t,r,n="esm"){return Array.isArray(r.namedImports)&&r.namedImports.forEach(i=>{t=Wl(e,t,i,r.importPath,!!r.isTypeOnly,n)}),typeof r.defaultImport=="string"&&(t=Jl(e,t,r.defaultImport,r.importPath,n)),t}function Wl(e,t,r,n,i,a){return a==="cjs"?Yi(e,t,null,r,n):Qi(e,t,null,r,n,i)}function Jl(e,t,r,n,i){return i==="cjs"?Yi(e,t,r,null,n):Qi(e,t,r,null,n,!1)}function Qi(e,t,r,n,i,a){let o=[...t.statements],s=0,u=!1,l=!1;for(let g=0;g<o.length;g++){let d=o[g];if(!e.ts.isImportDeclaration(d)||(s=g,!d.moduleSpecifier||!e.ts.isStringLiteral(d.moduleSpecifier))||d.moduleSpecifier.text!==i||!!d.importClause?.isTypeOnly!==a)continue;let D=[],h=d.importClause?.namedBindings;if(h&&e.ts.isNamedImports(h)&&h.elements&&D.push(...h.elements),typeof n=="string"){if(D.some(F=>F.name.text===n))return t;D.push(e.ts.factory.createImportSpecifier(!1,void 0,e.ts.factory.createIdentifier(n))),D.sort((F,x)=>F.name.text.localeCompare(x.name.text)),u=!0}let f=d.importClause?d.importClause.name:void 0;if(typeof r=="string"){if(f&&f.text===r)return t;f=e.ts.factory.createIdentifier(r),l=!0}if(u||l)return o[g]=e.ts.factory.updateImportDeclaration(d,void 0,e.ts.factory.createImportClause(a,f,e.ts.factory.createNamedImports(D)),d.moduleSpecifier,void 0),e.ts.factory.updateSourceFile(t,o)}let c,p;typeof r=="string"&&(c=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 m=e.ts.factory.createImportDeclaration(void 0,e.ts.factory.createImportClause(a,c,p),e.ts.factory.createStringLiteral(i));return o.splice(s,0,m),e.ts.factory.updateSourceFile(t,o)}function Yi(e,t,r,n,i){let a=[...t.statements],o=0;for(let s=0;s<a.length;s++){let u=a[s];if(e.ts.isVariableStatement(u))for(let l=0;l<u.declarationList.declarations.length;l++){let c=[...u.declarationList.declarations],p=c[l],m=p.initializer;if(!m||!e.ts.isCallExpression(m))continue;let g=m.expression;if(!e.ts.isIdentifier(g)||g.text!=="require"||m.arguments.length!==1)continue;let d=m.arguments[0];if(e.ts.isStringLiteral(d)&&(o=s,d.text===i)){if(e.ts.isIdentifier(p.name)&&typeof r=="string")return p.name.text===r?t:(c[l]=e.ts.factory.updateVariableDeclaration(p,e.ts.factory.createIdentifier(r),p.exclamationToken,p.type,p.initializer),a[s]=e.ts.factory.updateVariableStatement(u,u.modifiers,e.ts.factory.updateVariableDeclarationList(u.declarationList,c)),e.ts.factory.updateSourceFile(t,a));if(e.ts.isObjectBindingPattern(p.name)&&typeof n=="string"){let D=[...p.name.elements];return D.some(f=>!e.ts.isBindingElement(f)||!e.ts.isIdentifier(f.name)?!1:f.name.text===n)?t:(D.push(e.ts.factory.createBindingElement(void 0,void 0,n)),D.sort((f,F)=>!e.ts.isBindingElement(f)||!e.ts.isIdentifier(f.name)||!e.ts.isBindingElement(F)||!e.ts.isIdentifier(F.name)?0:f.name.text.localeCompare(F.name.text)),c[l]=e.ts.factory.updateVariableDeclaration(p,e.ts.factory.createObjectBindingPattern(D),p.exclamationToken,p.type,p.initializer),a[s]=e.ts.factory.updateVariableStatement(u,u.modifiers,e.ts.factory.updateVariableDeclarationList(u.declarationList,c)),e.ts.factory.updateSourceFile(t,a))}}}}if(typeof r=="string"){let s=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 a.splice(o,0,s),e.ts.factory.updateSourceFile(t,a)}if(typeof n=="string"){let s=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 a.splice(o,0,s),e.ts.factory.updateSourceFile(t,a)}return t}function yt(e,t,r="esm"){return r==="cjs"?Gl(e,t):Hl(e,t)}function Hl(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 a=i.name.text;for(let o of t.statements)if(e.ts.isVariableStatement(o))for(let s of o.declarationList.declarations)e.ts.isIdentifier(s.name)&&s.name.text===a&&r.push({isDefaultExport:!1,statement:o,node:o});else e.ts.isFunctionDeclaration(o)&&o.name&&o.name.text===a&&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,a=n.expression;if(e.ts.isIdentifier(a)){let o=a.text;for(let s of t.statements){if(e.ts.isVariableStatement(s))for(let u of s.declarationList.declarations)e.ts.isIdentifier(u.name)&&u.name.text===o&&r.push({isDefaultExport:i,statement:s,node:s});e.ts.isFunctionDeclaration(s)&&s.name?.text===o&&r.push({isDefaultExport:i,statement:s,node:s})}}else(e.ts.isArrowFunction(a)||e.ts.isCallExpression(a)||e.ts.isFunctionDeclaration(a)||e.ts.isObjectLiteralExpression(a))&&r.push({isDefaultExport:i,statement:n,node:a});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 Gl(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,a=n.expression.right;if(!e.ts.isIdentifier(i.expression))continue;if(i.expression.text==="module"&&i.name.text==="exports"){if(e.ts.isIdentifier(a)){let o=a.text;for(let s of t.statements)if(e.ts.isVariableStatement(s))for(let u of s.declarationList.declarations)e.ts.isIdentifier(u.name)&&u.name.text===o&&r.push({isDefaultExport:!0,statement:s,node:s});else e.ts.isFunctionDeclaration(s)&&s.name&&s.name.text===o&&r.push({isDefaultExport:!0,statement:s,node:s})}else r.push({isDefaultExport:!0,statement:n,node:a});continue}}return r}function Ql(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 je(e,t,r,n){let i=Ql(e,r,n);if(i){let a=await sn(e,e.normalize(e.resolve(e.dirname(t),i.importPath))),o=e.relative(e.getAppRootDir(),a);return{displayFilePath:M(e,a),filePath:a,relFilePath:o,importPath:i.importPath,exportType:i.exportType}}return null}function _t(e,t,r){for(let n=0;n<t.statements.length;n++){let i=t.statements[n];if(e.ts.isVariableStatement(i)){for(let a of i.declarationList.declarations)if(e.ts.isIdentifier(a.name)&&a.name.text===r)return{statement:i,statementIndex:n}}}return null}function X(e,t,r){let n=_t(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 Mn(e,t){if(t){if(Yl(e,t))return!0;let r=!1;if(t.forEachChild(n=>{Mn(e,n)&&(r=!0)}),r)return!0}return!1}function Yl(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 sn(e,t){let r=e.extname(t).toLowerCase();if(r===""||!Or.includes(r)){for(let n of Or){let i=t+n;if(await e.exists(i))return i}for(let n of Or){let i=e.join(t,"index"+n);if(await e.exists(i))return i}}return t}var Or=[".tsx",".jsx",".ts",".js"];function Mt(e,t,r){if(!r||!t)return;let n=t.getSymbolAtLocation(r);if(!n)return;let i=n.valueDeclaration;if(!i)return;let a=i.getSourceFile().fileName,o=Xl(e,a);return o?[{name:o}]:void 0}function Xl(e,t){if(typeof t=="string"){t=e.normalize(Te(t));let r=t.split("/"),n=r.lastIndexOf("node_modules");if(n>-1){let i=r.slice(n+1),a=i[0];if(a)return a.startsWith("@")&&i[1]&&(a+="/"+i[1]),a}}}function Ue(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 Xi(e,t,r="esm"){return r==="cjs"?tc(e,t):ec(e,t)}var Zl=/^(@\w|\w)/;function ec(e,t){let r=[];for(let n of t.statements)if(e.ts.isImportDeclaration(n)&&e.ts.isLiteralExpression(n.moduleSpecifier)){if(!Zl.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 tc(e,t){return[]}async function jt(e,t){if(!t.some(o=>!o.isRegistered))return t;let n=await Z(e,t.map(o=>o.filePath)),i=n.getTypeChecker();return await Promise.all(t.map(async o=>{let s=n.getSourceFile(o.filePath);if(s){let l=(await lt(e,i,o.filePath,s,!1)).find(c=>c.cmpInfo.id===o.id);l&&(o.inputs=Ft(e,i,l.node.fnNode))}return o}))}async function Ut(e,t,r,n){if(t.node.fnNode){let{sourceFile:i,typeChecker:a}=await Bt(e,t.cmpInfo.filePath,r),s=(await lt(e,a,t.cmpInfo.filePath,i,n)).find(u=>u.cmpInfo.id===t.cmpInfo.id);if(!s)throw new Error(`createComponentInputs() Could not find component ${t.cmpInfo.name} in ${t.cmpInfo.filePath}`);return Ft(e,a,s.node.fnNode)}return[]}async function ea(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 nc(e,t,i,r)}return null}function nc(e,t,r,n=!1){let i=N(e,r);return lt(e,null,t,i,n)}async function lt(e,t,r,n,i){let a=[];for(let s of n.statements)if(e.ts.isExpressionStatement(s)&&e.ts.isStringLiteral(s.expression)&&s.expression.text==="use server")return a;let o=yt(e,n);return i&&o.push(...Xi(e,n)),r=e.normalize(r),await Promise.all(o.map(async s=>{let u=await rc(e,t,r,s);a.push(...u)})),a}async function rc(e,t,r,n){let i=[],a=e.relative(e.getAppRootDir(),r),o=V(e,r);if(e.ts.isVariableStatement(n.node)){for(let s of n.node.declarationList.declarations){if(!e.ts.isIdentifier(s.name)||!It(s.name.text))continue;let u=Xe(e,t,s.initializer);if(u){let l=u.name||s.name.text,c=n.isDefaultExport?"default":l,p=n.isDefaultExport?"default":"named";i.push({cmpInfo:{id:await K(e,r,c),displayFilePath:M(e,r),name:q(l),inputs:[],exportName:c,exportType:p,importName:l,filePath:r,relFilePath:a,importPath:o,dependencies:u.deps,framework:"react"},node:u})}}return i}if(e.ts.isArrowFunction(n.node)){let s=Xe(e,t,n.node);if(s){let u=Se(e,r),l=n.isDefaultExport?"default":u,c=n.isDefaultExport?"default":"named";i.push({cmpInfo:{id:await K(e,r,l),displayFilePath:M(e,r),name:u,inputs:[],exportName:l,exportType:c,importName:Et(e,r),filePath:r,relFilePath:a,importPath:o,dependencies:s.deps,framework:"react"},node:s})}return i}if(e.ts.isFunctionExpression(n.node)||e.ts.isFunctionDeclaration(n.node)){let s=n.node.name?.text;if(s&&!It(s))return i;let u=Xe(e,t,n.node);if(u){let l=u.name||Se(e,r),c=n.isDefaultExport||!u.name?"default":u.name,p=n.isDefaultExport?"default":"named";i.push({cmpInfo:{id:await K(e,r,c),displayFilePath:M(e,r),name:l,inputs:[],exportName:c,exportType:p,importName:u.name||Et(e,r),filePath:r,relFilePath:a,importPath:o,dependencies:u.deps,framework:"react"},node:u})}return i}if((e.ts.isExportSpecifier(n.node)||e.ts.isIdentifier(n.node))&&It(n.node.getText())){let s,u=Xe(e,t,n.node);if(u){let l=u.name||Se(e,r),c=n.isDefaultExport||!u.name?"default":u.name,p=n.isDefaultExport?"default":"named",m=oc(e,n.node)?.moduleSpecifier??ic(e,n.node)?.moduleSpecifier;if(m&&e.ts.isStringLiteral(m)){let g=t?.getSymbolAtLocation(m);if(g&&g.declarations&&g.declarations.length>0){let d=g.declarations[0];(!e.ts.isSourceFile(d)||e.ts.isSourceFile(d)&&d.fileName.includes("node_modules"))&&(s=m.text)}}i.push({cmpInfo:{id:await K(e,r,c,s),displayFilePath:M(e,r),name:l,inputs:[],exportName:c,exportType:p,importName:u.name||Et(e,r),filePath:r,relFilePath:a,importPath:s||o,externalImportPath:s,dependencies:u.deps,framework:"react"},node:u})}return i}if(e.ts.isExportDeclaration(n.node)&&n.node.exportClause===void 0){let s=n.node.moduleSpecifier;if(s&&e.ts.isStringLiteral(s)){let u=await sc(e,t,r,s);i.push(...u)}return i}return i}function oc(e,t){for(;t;){if(e.ts.isExportDeclaration(t))return t;t=t.parent}return null}function ic(e,t){for(;t;){if(e.ts.isImportDeclaration(t))return t;t=t.parent}return null}function Xe(e,t,r){if(!r)return null;if(e.ts.isArrowFunction(r))return Mn(e,r.body)?{name:"",fnNode:r,deps:Mt(e,t,r)}:null;if(e.ts.isFunctionExpression(r)||e.ts.isFunctionDeclaration(r))return Mn(e,r.body)?{name:r.name?.text||"",fnNode:r,deps:Mt(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 a=n.expression;if(!e.ts.isIdentifier(a)||a.text!=="React")return null;let o=n.name;return!e.ts.isIdentifier(o)||o.text!=="forwardRef"?null:Xe(e,t,i[0])}else if(e.ts.isIdentifier(n)&&n.text==="observer"){let i=r.arguments;return i.length===0?null:Xe(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)||!It(i.text))return null;let o=t.getTypeAtLocation(i).getCallSignatures();if(o.length>0&&o[0].getParameters().length>0)return{name:"",fnNode:i,deps:Mt(e,t,i)}}if(e.ts.isExportSpecifier(r)){let n=r.name;return{name:n.text||"",fnNode:n,deps:Mt(e,t,n)}}if(e.ts.isIdentifier(r))return{name:r.text||"",fnNode:r,deps:Mt(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 Xe(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 a=Xe(e,t,i.expression);if(a&&e.ts.isIdentifier(n.name))return{name:n.name.text,fnNode:a.fnNode,deps:a.deps}}}}return null}async function ta(e,t){let r=[],n=t.getSourceFiles(),i=t.getTypeChecker();return await Promise.all(n.map(async a=>{let o=e.normalize(a.fileName);if(Pn(e,ac,a.fileName)||o===e.reactConfigPath||o===e.builderComponentPath)return;let s=await lt(e,i,o,a,o===e.registryPath);r.push(...s)})),r.sort((a,o)=>a.cmpInfo.name.localeCompare(o.cmpInfo.name))}var ac=new Set(["node_modules","dist"]);async function sc(e,t,r,n){let i=[],a=n.text;if(!t)return i;try{let o=t.getSymbolAtLocation(n);if(!o)return i;let s=t.getExportsOfModule(o);for(let u of s){let l=u.valueDeclaration||u.declarations?.[0];if(!l)continue;let c=u.name;if(!It(c)&&c!=="default"||!na(e,t,l))continue;let p=Xe(e,t,l);if(p){let m=u.name,g=m==="default"?"default":"named",d=q(m),D=m==="default"?Et(e,r):m;i.push({cmpInfo:{id:await K(e,r,m,a),displayFilePath:M(e,r),name:d,inputs:[],exportName:m,exportType:g,importName:D,filePath:r,relFilePath:e.relative(e.getAppRootDir(),r),importPath:a,externalImportPath:a,dependencies:p.deps,framework:"react"},node:p})}}}catch(o){e.Sentry?.captureException(new Error(`Error processing module ${a}:`,{cause:o}),{extra:{modulePath:a,filePath:r}})}return i}function na(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 a=t.getAliasedSymbol(n).declarations?.[0];if(a)return na(e,t,a)}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 Zi(i,t)}}return e.ts.isClassDeclaration(r)?r.heritageClauses?.some(i=>i.types.some(a=>a.expression.getText()==="React.Component"||a.expression.getText()==="Component"))??!1:e.ts.isVariableDeclaration(r)?t.getTypeAtLocation(r).getCallSignatures().some(a=>Zi(t.getReturnTypeOfSignature(a),t)):!1}function Zi(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 ra(e,t){let r=[],n=t.getSourceFiles(),i=t.getTypeChecker();return await Promise.all(n.map(async a=>{let o=e.basename(a.fileName);if(e.appDir&&uc.has(o)||e.dirname(a.fileName).includes("node_modules"))return;let s=e.normalize(a.fileName);if(s===e.nextConfigPath||s===e.builderComponentPath)return;let u=await lt(e,i,s,a,s===e.registryPath||he(s));r.push(...u)})),r.sort((a,o)=>a.cmpInfo.name.localeCompare(o.cmpInfo.name))}var uc=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 Ve(e,t){let r=[],n=[],i=[],a=[];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 s=o.importClause;if(s){if(s.namedBindings){n.push(o);continue}if(s.name){n.push(o);continue}}i.push(o);continue}a.push(o)}return e.ts.factory.updateSourceFile(t,[..._r(e,r),..._r(e,n),..._r(e,i),...a])}function Ie(e){let t=e.split(`
|
|
284
|
+
`,r+=");";let n=An(e,r);return $r(e,n,t)}function $r(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 a=i[1];return e.ts.isObjectLiteralExpression(a)?(i[1]=ee(e,a,r),e.ts.factory.updateExpressionStatement(t,e.ts.factory.updateCallExpression(n,n.expression,n.typeArguments,i))):t}function $(e,t,r,n="esm"){return Array.isArray(r.namedImports)&&r.namedImports.forEach(i=>{t=ql(e,t,i,r.importPath,!!r.isTypeOnly,n)}),typeof r.defaultImport=="string"&&(t=Wl(e,t,r.defaultImport,r.importPath,n)),t}function ql(e,t,r,n,i,a){return a==="cjs"?Qi(e,t,null,r,n):Gi(e,t,null,r,n,i)}function Wl(e,t,r,n,i){return i==="cjs"?Qi(e,t,r,null,n):Gi(e,t,r,null,n,!1)}function Gi(e,t,r,n,i,a){let o=[...t.statements],s=0,u=!1,l=!1;for(let h=0;h<o.length;h++){let D=o[h];if(!e.ts.isImportDeclaration(D)||(s=h,!D.moduleSpecifier||!e.ts.isStringLiteral(D.moduleSpecifier))||D.moduleSpecifier.text!==i||!!D.importClause?.isTypeOnly!==a)continue;let d=[],g=D.importClause?.namedBindings;if(g&&e.ts.isNamedImports(g)&&g.elements&&d.push(...g.elements),typeof n=="string"){if(d.some(x=>x.name.text===n))return t;d.push(e.ts.factory.createImportSpecifier(!1,void 0,e.ts.factory.createIdentifier(n))),d.sort((x,y)=>x.name.text.localeCompare(y.name.text)),u=!0}let f=D.importClause?D.importClause.name:void 0;if(typeof r=="string"){if(f&&f.text===r)return t;f=e.ts.factory.createIdentifier(r),l=!0}if(u||l)return o[h]=e.ts.factory.updateImportDeclaration(D,void 0,e.ts.factory.createImportClause(a,f,e.ts.factory.createNamedImports(d)),D.moduleSpecifier,void 0),e.ts.factory.updateSourceFile(t,o)}let c,p;typeof r=="string"&&(c=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 m=e.ts.factory.createImportDeclaration(void 0,e.ts.factory.createImportClause(a,c,p),e.ts.factory.createStringLiteral(i));return o.splice(s,0,m),e.ts.factory.updateSourceFile(t,o)}function Qi(e,t,r,n,i){let a=[...t.statements],o=0;for(let s=0;s<a.length;s++){let u=a[s];if(e.ts.isVariableStatement(u))for(let l=0;l<u.declarationList.declarations.length;l++){let c=[...u.declarationList.declarations],p=c[l],m=p.initializer;if(!m||!e.ts.isCallExpression(m))continue;let h=m.expression;if(!e.ts.isIdentifier(h)||h.text!=="require"||m.arguments.length!==1)continue;let D=m.arguments[0];if(e.ts.isStringLiteral(D)&&(o=s,D.text===i)){if(e.ts.isIdentifier(p.name)&&typeof r=="string")return p.name.text===r?t:(c[l]=e.ts.factory.updateVariableDeclaration(p,e.ts.factory.createIdentifier(r),p.exclamationToken,p.type,p.initializer),a[s]=e.ts.factory.updateVariableStatement(u,u.modifiers,e.ts.factory.updateVariableDeclarationList(u.declarationList,c)),e.ts.factory.updateSourceFile(t,a));if(e.ts.isObjectBindingPattern(p.name)&&typeof n=="string"){let d=[...p.name.elements];return d.some(f=>!e.ts.isBindingElement(f)||!e.ts.isIdentifier(f.name)?!1:f.name.text===n)?t:(d.push(e.ts.factory.createBindingElement(void 0,void 0,n)),d.sort((f,x)=>!e.ts.isBindingElement(f)||!e.ts.isIdentifier(f.name)||!e.ts.isBindingElement(x)||!e.ts.isIdentifier(x.name)?0:f.name.text.localeCompare(x.name.text)),c[l]=e.ts.factory.updateVariableDeclaration(p,e.ts.factory.createObjectBindingPattern(d),p.exclamationToken,p.type,p.initializer),a[s]=e.ts.factory.updateVariableStatement(u,u.modifiers,e.ts.factory.updateVariableDeclarationList(u.declarationList,c)),e.ts.factory.updateSourceFile(t,a))}}}}if(typeof r=="string"){let s=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 a.splice(o,0,s),e.ts.factory.updateSourceFile(t,a)}if(typeof n=="string"){let s=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 a.splice(o,0,s),e.ts.factory.updateSourceFile(t,a)}return t}function yt(e,t,r="esm"){return r==="cjs"?Hl(e,t):Jl(e,t)}function Jl(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 a=i.name.text;for(let o of t.statements)if(e.ts.isVariableStatement(o))for(let s of o.declarationList.declarations)e.ts.isIdentifier(s.name)&&s.name.text===a&&r.push({isDefaultExport:!1,statement:o,node:o});else e.ts.isFunctionDeclaration(o)&&o.name&&o.name.text===a&&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,a=n.expression;if(e.ts.isIdentifier(a)){let o=a.text;for(let s of t.statements){if(e.ts.isVariableStatement(s))for(let u of s.declarationList.declarations)e.ts.isIdentifier(u.name)&&u.name.text===o&&r.push({isDefaultExport:i,statement:s,node:s});e.ts.isFunctionDeclaration(s)&&s.name?.text===o&&r.push({isDefaultExport:i,statement:s,node:s})}}else(e.ts.isArrowFunction(a)||e.ts.isCallExpression(a)||e.ts.isFunctionDeclaration(a)||e.ts.isObjectLiteralExpression(a))&&r.push({isDefaultExport:i,statement:n,node:a});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 Hl(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,a=n.expression.right;if(!e.ts.isIdentifier(i.expression))continue;if(i.expression.text==="module"&&i.name.text==="exports"){if(e.ts.isIdentifier(a)){let o=a.text;for(let s of t.statements)if(e.ts.isVariableStatement(s))for(let u of s.declarationList.declarations)e.ts.isIdentifier(u.name)&&u.name.text===o&&r.push({isDefaultExport:!0,statement:s,node:s});else e.ts.isFunctionDeclaration(s)&&s.name&&s.name.text===o&&r.push({isDefaultExport:!0,statement:s,node:s})}else r.push({isDefaultExport:!0,statement:n,node:a});continue}}return r}function Gl(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 Me(e,t,r,n){let i=Gl(e,r,n);if(i){let a=await sn(e,e.normalize(e.resolve(e.dirname(t),i.importPath))),o=e.relative(e.getAppRootDir(),a);return{displayFilePath:M(e,a),filePath:a,relFilePath:o,importPath:i.importPath,exportType:i.exportType}}return null}function _t(e,t,r){for(let n=0;n<t.statements.length;n++){let i=t.statements[n];if(e.ts.isVariableStatement(i)){for(let a of i.declarationList.declarations)if(e.ts.isIdentifier(a.name)&&a.name.text===r)return{statement:i,statementIndex:n}}}return null}function X(e,t,r){let n=_t(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 _n(e,t){if(t){if(Ql(e,t))return!0;let r=!1;if(t.forEachChild(n=>{_n(e,n)&&(r=!0)}),r)return!0}return!1}function Ql(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 sn(e,t){let r=e.extname(t).toLowerCase();if(r===""||!Lr.includes(r)){for(let n of Lr){let i=t+n;if(await e.exists(i))return i}for(let n of Lr){let i=e.join(t,"index"+n);if(await e.exists(i))return i}}return t}var Lr=[".tsx",".jsx",".ts",".js"];function Mt(e,t,r){if(!r||!t)return;let n=t.getSymbolAtLocation(r);if(!n)return;let i=n.valueDeclaration;if(!i)return;let a=i.getSourceFile().fileName,o=Yl(e,a);return o?[{name:o}]:void 0}function Yl(e,t){if(typeof t=="string"){t=e.normalize(Te(t));let r=t.split("/"),n=r.lastIndexOf("node_modules");if(n>-1){let i=r.slice(n+1),a=i[0];if(a)return a.startsWith("@")&&i[1]&&(a+="/"+i[1]),a}}}function je(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 Yi(e,t,r="esm"){return r==="cjs"?ec(e,t):Zl(e,t)}var Xl=/^(@\w|\w)/;function Zl(e,t){let r=[];for(let n of t.statements)if(e.ts.isImportDeclaration(n)&&e.ts.isLiteralExpression(n.moduleSpecifier)){if(!Xl.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 ec(e,t){return[]}async function jt(e,t){if(!t.some(o=>!o.isRegistered))return t;let n=await Z(e,t.map(o=>o.filePath)),i=n.getTypeChecker();return await Promise.all(t.map(async o=>{let s=n.getSourceFile(o.filePath);if(s){let l=(await ct(e,i,o.filePath,s,!1)).find(c=>c.cmpInfo.id===o.id);l&&(o.inputs=Ft(e,i,l.node.fnNode))}return o}))}async function Ut(e,t,r,n){if(t.node.fnNode){let{sourceFile:i,typeChecker:a}=await Bt(e,t.cmpInfo.filePath,r),s=(await ct(e,a,t.cmpInfo.filePath,i,n)).find(u=>u.cmpInfo.id===t.cmpInfo.id);if(!s)throw new Error(`createComponentInputs() Could not find component ${t.cmpInfo.name} in ${t.cmpInfo.filePath}`);return Ft(e,a,s.node.fnNode)}return[]}async function Zi(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 tc(e,t,i,r)}return null}function tc(e,t,r,n=!1){let i=k(e,r);return ct(e,null,t,i,n)}async function ct(e,t,r,n,i){let a=[];for(let s of n.statements)if(e.ts.isExpressionStatement(s)&&e.ts.isStringLiteral(s.expression)&&s.expression.text==="use server")return a;let o=yt(e,n);return i&&o.push(...Yi(e,n)),r=e.normalize(r),await Promise.all(o.map(async s=>{let u=await nc(e,t,r,s);a.push(...u)})),a}async function nc(e,t,r,n){let i=[],a=e.relative(e.getAppRootDir(),r),o=z(e,r);if(e.ts.isVariableStatement(n.node)){for(let s of n.node.declarationList.declarations){if(!e.ts.isIdentifier(s.name)||!It(s.name.text))continue;let u=Xe(e,t,s.initializer);if(u){let l=u.name||s.name.text,c=n.isDefaultExport?"default":l,p=n.isDefaultExport?"default":"named";i.push({cmpInfo:{id:await q(e,r,c),displayFilePath:M(e,r),name:W(l),inputs:[],exportName:c,exportType:p,importName:l,filePath:r,relFilePath:a,importPath:o,dependencies:u.deps,framework:"react"},node:u})}}return i}if(e.ts.isArrowFunction(n.node)){let s=Xe(e,t,n.node);if(s){let u=ye(e,r),l=n.isDefaultExport?"default":u,c=n.isDefaultExport?"default":"named";i.push({cmpInfo:{id:await q(e,r,l),displayFilePath:M(e,r),name:u,inputs:[],exportName:l,exportType:c,importName:Et(e,r),filePath:r,relFilePath:a,importPath:o,dependencies:s.deps,framework:"react"},node:s})}return i}if(e.ts.isFunctionExpression(n.node)||e.ts.isFunctionDeclaration(n.node)){let s=n.node.name?.text;if(s&&!It(s))return i;let u=Xe(e,t,n.node);if(u){let l=u.name||ye(e,r),c=n.isDefaultExport||!u.name?"default":u.name,p=n.isDefaultExport?"default":"named";i.push({cmpInfo:{id:await q(e,r,c),displayFilePath:M(e,r),name:l,inputs:[],exportName:c,exportType:p,importName:u.name||Et(e,r),filePath:r,relFilePath:a,importPath:o,dependencies:u.deps,framework:"react"},node:u})}return i}if((e.ts.isExportSpecifier(n.node)||e.ts.isIdentifier(n.node))&&It(n.node.getText())){let s,u=Xe(e,t,n.node);if(u){let l=u.name||ye(e,r),c=n.isDefaultExport||!u.name?"default":u.name,p=n.isDefaultExport?"default":"named",m=rc(e,n.node)?.moduleSpecifier??oc(e,n.node)?.moduleSpecifier;if(m&&e.ts.isStringLiteral(m)){let h=t?.getSymbolAtLocation(m);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"))&&(s=m.text)}}i.push({cmpInfo:{id:await q(e,r,c,s),displayFilePath:M(e,r),name:l,inputs:[],exportName:c,exportType:p,importName:u.name||Et(e,r),filePath:r,relFilePath:a,importPath:s||o,externalImportPath:s,dependencies:u.deps,framework:"react"},node:u})}return i}if(e.ts.isExportDeclaration(n.node)&&n.node.exportClause===void 0){let s=n.node.moduleSpecifier;if(s&&e.ts.isStringLiteral(s)){let u=await ac(e,t,r,s);i.push(...u)}return i}return i}function rc(e,t){for(;t;){if(e.ts.isExportDeclaration(t))return t;t=t.parent}return null}function oc(e,t){for(;t;){if(e.ts.isImportDeclaration(t))return t;t=t.parent}return null}function Xe(e,t,r){if(!r)return null;if(e.ts.isArrowFunction(r))return _n(e,r.body)?{name:"",fnNode:r,deps:Mt(e,t,r)}:null;if(e.ts.isFunctionExpression(r)||e.ts.isFunctionDeclaration(r))return _n(e,r.body)?{name:r.name?.text||"",fnNode:r,deps:Mt(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 a=n.expression;if(!e.ts.isIdentifier(a)||a.text!=="React")return null;let o=n.name;return!e.ts.isIdentifier(o)||o.text!=="forwardRef"?null:Xe(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:Xe(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)||!It(i.text))return null;let o=t.getTypeAtLocation(i).getCallSignatures();if(o.length>0&&o[0].getParameters().length>0)return{name:"",fnNode:i,deps:Mt(e,t,i)}}if(e.ts.isExportSpecifier(r)){let n=r.name;return{name:n.text||"",fnNode:n,deps:Mt(e,t,n)}}if(e.ts.isIdentifier(r))return{name:r.text||"",fnNode:r,deps:Mt(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 Xe(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 a=Xe(e,t,i.expression);if(a&&e.ts.isIdentifier(n.name))return{name:n.name.text,fnNode:a.fnNode,deps:a.deps}}}}return null}async function ea(e,t){let r=[],n=t.getSourceFiles(),i=t.getTypeChecker();return await Promise.all(n.map(async a=>{let o=e.normalize(a.fileName);if(Pn(e,ic,a.fileName)||o===e.reactConfigPath||o===e.builderComponentPath)return;let s=await ct(e,i,o,a,o===e.registryPath);r.push(...s)})),r.sort((a,o)=>a.cmpInfo.name.localeCompare(o.cmpInfo.name))}var ic=new Set(["node_modules","dist"]);async function ac(e,t,r,n){let i=[],a=n.text;if(!t)return i;try{let o=t.getSymbolAtLocation(n);if(!o)return i;let s=t.getExportsOfModule(o);for(let u of s){let l=u.valueDeclaration||u.declarations?.[0];if(!l)continue;let c=u.name;if(!It(c)&&c!=="default"||!ta(e,t,l))continue;let p=Xe(e,t,l);if(p){let m=u.name,h=m==="default"?"default":"named",D=W(m),d=m==="default"?Et(e,r):m;i.push({cmpInfo:{id:await q(e,r,m,a),displayFilePath:M(e,r),name:D,inputs:[],exportName:m,exportType:h,importName:d,filePath:r,relFilePath:e.relative(e.getAppRootDir(),r),importPath:a,externalImportPath:a,dependencies:p.deps,framework:"react"},node:p})}}}catch(o){e.Sentry?.captureException(new Error(`Error processing module ${a}:`,{cause:o}),{extra:{modulePath:a,filePath:r}})}return i}function ta(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 a=t.getAliasedSymbol(n).declarations?.[0];if(a)return ta(e,t,a)}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 Xi(i,t)}}return e.ts.isClassDeclaration(r)?r.heritageClauses?.some(i=>i.types.some(a=>a.expression.getText()==="React.Component"||a.expression.getText()==="Component"))??!1:e.ts.isVariableDeclaration(r)?t.getTypeAtLocation(r).getCallSignatures().some(a=>Xi(t.getReturnTypeOfSignature(a),t)):!1}function Xi(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 na(e,t){let r=[],n=t.getSourceFiles(),i=t.getTypeChecker();return await Promise.all(n.map(async a=>{let o=e.basename(a.fileName);if(e.appDir&&sc.has(o)||e.dirname(a.fileName).includes("node_modules"))return;let s=e.normalize(a.fileName);if(s===e.nextConfigPath||s===e.builderComponentPath)return;let u=await ct(e,i,s,a,s===e.registryPath||he(s));r.push(...u)})),r.sort((a,o)=>a.cmpInfo.name.localeCompare(o.cmpInfo.name))}var sc=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 Ue(e,t){let r=[],n=[],i=[],a=[];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 s=o.importClause;if(s){if(s.namedBindings){n.push(o);continue}if(s.name){n.push(o);continue}}i.push(o);continue}a.push(o)}return e.ts.factory.updateSourceFile(t,[...Or(e,r),...Or(e,n),...Or(e,i),...a])}function Be(e){let t=e.split(`
|
|
285
285
|
`).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+`
|
|
286
286
|
`),/^builder.init(.*)$/.test(i)&&(i=i+`
|
|
287
287
|
`),t[n-1]&&!t[n-1].includes("*/")&&(i.trim().startsWith("Builder.registerComponent")&&(i=`
|
|
@@ -290,12 +290,12 @@ ${r}=${n}
|
|
|
290
290
|
`+i),i.trim().startsWith("export ")&&(i=`
|
|
291
291
|
`+i)),e=i+`
|
|
292
292
|
`+e}return e.trim()+`
|
|
293
|
-
`}function
|
|
294
|
-
${e}`),e}function sa(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 Ke(e,t){return t.sort((r,n)=>{if(e.ts.isObjectLiteralExpression(r)&&e.ts.isObjectLiteralExpression(n)){let i=ia(e,r),a=ia(e,n);return i.toLocaleLowerCase().localeCompare(a.toLocaleLowerCase())}return 1})}function ia(e,t){let r=t.properties.find(n=>j(e,n)==="name");return r&&e.ts.isPropertyAssignment(r)&&e.ts.isStringLiteral(r.initializer)?r.initializer.text:"zzzz"}async function ua(e){let t=await e.readFile(e.registryPath);return t?lc(e,t):{components:[],sourceFile:N(e,"")}}async function lc(e,t){let r=N(e,t);return e.sdkVersion===A.gen2?pc(e,r):cc(e,r)}async function cc(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 a=i.expression;if(!e.ts.isCallExpression(a))continue;let o=a.expression;if(!e.ts.isPropertyAccessExpression(o))continue;let s=o.expression;if(!e.ts.isIdentifier(s)||s.text!=="Builder"||o.name.text!=="registerComponent")continue;let l=a.arguments;if(l.length<2)continue;let c=l[1];if(!e.ts.isObjectLiteralExpression(c))continue;let p=l[0];if(e.ts.isCallExpression(p)){let m=e.ts.isIdentifier(p.expression)&&p.expression.text;if(m==="withChildren"){let d=Ur(e,p.arguments[0]);if(e.ts.isCallExpression(d)){let D=await Mr(e,n,d,c,!0);D&&r.push(D)}else{let D=d;if(e.ts.isIdentifier(D)){let h=await jr(e,t,n,D,c,!0);h&&r.push(h)}}continue}if(m==="dynamic"){let d=await Mr(e,n,p,c,!1);d&&r.push(d);continue}let g=Ur(e,p.arguments[0]);if(e.ts.isCallExpression(g)&&e.ts.isIdentifier(g.expression)&&g.expression.text==="dynamic"){let d=await Mr(e,n,g,c,!1);d&&r.push(d);continue}if(e.ts.isIdentifier(g)){let d=await jr(e,t,n,g,c,!1);d&&r.push(d);continue}continue}if(e.ts.isIdentifier(p)){let m=await jr(e,t,n,p,c,!1);m&&r.push(m);continue}}return{sourceFile:t,components:de(r)}}function Ur(e,t){return e.ts.isCallExpression(t)?(e.ts.isIdentifier(t.expression)&&t.expression.text)==="dynamic"?t:Ur(e,t.arguments[0]):t}async function Mr(e,t,r,n,i){let a={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 s=o[0];if(!e.ts.isArrowFunction(s))return null;let u=s.body;if(e.ts.isCallExpression(u)){if(u.expression.kind!==e.ts.SyntaxKind.ImportKeyword||u.arguments.length!==1)return null;let c=u.arguments[0];if(!e.ts.isStringLiteral(c))return null;let p=c.text,m=await Vt(e,p);a.filePath=m,a.relFilePath=e.relative(e.getAppRootDir(),a.filePath),await e.exists(m)?a.importPath=V(e,a.filePath):(a.externalImportPath=p,a.importPath=a.externalImportPath),a.name=Se(e,a.filePath),a.importName="default",a.exportName="default",a.exportType="default"}else if(e.ts.isPropertyAccessExpression(u)){let l=u.expression;if(!e.ts.isParenthesizedExpression(l))return null;let c=l.expression;if(!e.ts.isAwaitExpression(c))return null;let p=c.expression;if(!e.ts.isCallExpression(p)||p.expression.kind!==e.ts.SyntaxKind.ImportKeyword||p.arguments.length!==1)return null;let g=p.arguments[0];if(!e.ts.isStringLiteral(g)||!e.ts.isIdentifier(u.name))return null;let d=g.text,D=await Vt(e,d);a.filePath=D,a.relFilePath=e.relative(e.getAppRootDir(),a.filePath),await e.exists(D)?a.importPath=V(e,a.filePath):(a.externalImportPath=d,a.importPath=a.externalImportPath),a.name=q(u.name.text),a.importName=u.name.text,a.exportName=u.name.text,a.exportType="named"}else return null;return a=De(e,a,n),a.displayFilePath=M(e,a.filePath),a.filePath&&a.exportName&&(a.id=await K(e,a.filePath,a.exportName,a.externalImportPath)),a}async function jr(e,t,r,n,i,a){let o={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],nodeIndex:r,acceptsChildren:a,framework:"react"},s=t.statements.filter(l=>e.ts.isImportDeclaration(l)),u=s.find(l=>l.importClause&&l.importClause.name?.text===n.text);if(u){let l=u.moduleSpecifier;if(!e.ts.isStringLiteral(l))return null;let c=await Vt(e,l.text);o.filePath=c,o.relFilePath=e.relative(e.getAppRootDir(),o.filePath),await e.exists(c)?o.importPath=V(e,o.filePath):(o.externalImportPath=l.text,o.importPath=o.externalImportPath),o.name=Se(e,o.filePath),o.importName=n.text,o.exportName="default",o.exportType="default"}else{let l=s.find(m=>!m.importClause||!m.importClause.namedBindings||!e.ts.isNamedImports(m.importClause.namedBindings)?!1:m.importClause.namedBindings.elements.some(g=>g.name.text===n.text));if(!l)return null;let c=l.moduleSpecifier;if(!e.ts.isStringLiteral(c))return null;let p=await Vt(e,c.text);o.filePath=p,o.relFilePath=e.relative(e.getAppRootDir(),o.filePath),await e.exists(p)?o.importPath=V(e,o.filePath):(o.externalImportPath=c.text,o.importPath=o.externalImportPath),o.name=q(n.text),o.importName=n.text,o.exportName=n.text,o.exportType="named"}return o=De(e,o,i),o.displayFilePath=M(e,o.filePath),o.filePath&&o.exportName&&(o.id=await K(e,o.filePath,o.exportName,o.externalImportPath)),o}function Vt(e,t){return sn(e,e.normalize(e.resolve(e.dirname(e.registryPath),t)))}function la(e,t,r){let n=!1,i=0,a=[...t.statements];for(let l=0;l<a.length;l++){let c=a[l];if(e.ts.isImportDeclaration(c)){i=l;continue}if(!e.ts.isExpressionStatement(c))continue;let p=c.expression;if(!e.ts.isCallExpression(p))continue;let m=p.expression;if(!e.ts.isPropertyAccessExpression(m))continue;let g=m.expression;if(!e.ts.isIdentifier(g)||g.text!=="builder")continue;if(m.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(Me)),s=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,[s]));return a.splice(i+1,0,u),e.ts.factory.updateSourceFile(t,a)}async function pc(e,t){let r=[],n=X(e,t,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(i,a)=>{let o=await Vr(e,t,i);o&&(o.nodeIndex=a,r.push(o))})),{sourceFile:t,components:de(r)}}async function Vr(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"};Ot(e,r)&&(n.acceptsChildren=!0);for(let a of r.properties){if(!e.ts.isPropertyAssignment(a)||!e.ts.isIdentifier(a.name))continue;if(j(e,a)==="component"){let s,{initializer:u}=a;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 d=g[0];if(!e.ts.isArrowFunction(d))return null;let D=d.body;if(e.ts.isCallExpression(D)){if(D.expression.kind!==e.ts.SyntaxKind.ImportKeyword||D.arguments.length!==1)return null;let f=D.arguments[0];if(!e.ts.isStringLiteral(f))return null;let F=f.text,x=await Vt(e,F);n.filePath=x,n.relFilePath=e.relative(e.getAppRootDir(),n.filePath),await e.exists(x)?n.importPath=V(e,n.filePath):(n.externalImportPath=F,n.importPath=n.externalImportPath),n.name=Se(e,n.filePath),n.importName="default",n.exportName="default",n.exportType="default"}else if(e.ts.isPropertyAccessExpression(D)){let h=D.expression;if(!e.ts.isParenthesizedExpression(h))return null;let f=h.expression;if(!e.ts.isAwaitExpression(f))return null;let F=f.expression;if(!e.ts.isCallExpression(F)||F.expression.kind!==e.ts.SyntaxKind.ImportKeyword||F.arguments.length!==1)return null;let w=F.arguments[0];if(!e.ts.isStringLiteral(w)||!e.ts.isIdentifier(D.name))return null;let S=w.text,y=await Vt(e,S);n.filePath=y,n.relFilePath=e.relative(e.getAppRootDir(),n.filePath),await e.exists(y)?n.importPath=V(e,n.filePath):(n.externalImportPath=S,n.importPath=n.externalImportPath),n.name=q(D.name.text),n.importName=D.name.text,n.exportName=D.name.text,n.exportType="named"}else return null;return n=De(e,n,r),n.displayFilePath=M(e,n.filePath),n.filePath&&n.exportName&&(n.id=await K(e,n.filePath,n.exportName,n.externalImportPath)),n}if(e.ts.isIdentifier(u)&&(s=u.text),!s)continue;n.name===""&&(n.name=q(s)),n.importName=s;let l=await je(e,e.registryPath,t,s);if(!l)continue;n.filePath=l.filePath,n.relFilePath=l.relFilePath,await e.exists(l.filePath)?n.importPath=V(e,l.filePath):(n.externalImportPath=l.importPath,n.importPath=n.externalImportPath),n.importPath=V(e,l.filePath),n.displayFilePath=l.displayFilePath,n.exportType=l.exportType;let c=t.statements.filter(m=>e.ts.isImportDeclaration(m)),p=c.find(m=>m.importClause&&m.importClause.name?.text===s);if(p){let m=p.moduleSpecifier;if(!e.ts.isStringLiteral(m))return null;n.exportName="default"}else{let m=c.find(d=>!d.importClause||!d.importClause.namedBindings||!e.ts.isNamedImports(d.importClause.namedBindings)?!1:d.importClause.namedBindings.elements.some(D=>D.name.text===s));if(!m)return null;let g=m.moduleSpecifier;if(!e.ts.isStringLiteral(g))return null;n.exportName=s}continue}}return n=De(e,n,r),n.filePath&&n.exportName&&(n.id=await K(e,n.filePath,n.exportName,n.externalImportPath)),n}function ze(e,t){let r=[...t.statements],n=!1;for(let i=t.statements.length-1;i>=0;i--){let a=t.statements[i];if(e.ts.isImportDeclaration(a)&&a.importClause){let o=!1,s=a.importClause.namedBindings;if(s&&e.ts.isNamedImports(s)&&s.elements){let u=[...s.elements];for(let l=u.length-1;l>=0;l--){let c=u[l];if(e.ts.isImportSpecifier(c)){let p=c.name;if(p&&e.ts.isIdentifier(p)){let m=p.text;ca(e,t,m)||u.splice(l,1)}}}if(u.length===0)o=!0;else if(s.elements.length!==u.length){let l=e.ts.factory.updateImportClause(a.importClause,!1,a.importClause.name,e.ts.factory.createNamedImports(u)),c=e.ts.factory.updateImportDeclaration(a,void 0,l,a.moduleSpecifier,void 0);r[i]=c,n=!0}}else if(a.importClause.name&&e.ts.isIdentifier(a.importClause.name)){let u=a.importClause.name.text;ca(e,t,u)||(o=!0)}o&&(r.splice(i,1),n=!0)}}return n?e.ts.factory.updateSourceFile(t,r):t}function ca(e,t,r){let n=!1;function i(a){if(!e.ts.isImportDeclaration(a)){if(e.ts.isIdentifier(a)&&a.text===r){n=!0;return}e.ts.forEachChild(a,i)}}return e.ts.forEachChild(t,i),n}function qe(e,t,r,n,i,a,o){let s=null,u=null,l=null,c=-1;t=Ce(t),r=Ce(r);let p=t.find(g=>g.id===e),m=r.find(g=>g.id===e);if(n)m||(s={...Ce(p),inputs:Ce(p.inputs).map(g=>(g.isRegistered=!0,g))},c=r.length,r.push(s));else if(typeof m?.nodeIndex=="number"&&m.nodeIndex>-1){if(i)c=m.nodeIndex,u=Ce(m),r=r.filter(g=>g.id!==e);else if(a!=null)mc(m,a),c=m.nodeIndex,l=m;else if(o!=null){let g=m.inputs.find(d=>d.name===o.name);g&&(o.registerInput===!1?g.isRegistered=!1:(fc(g,o),g.isRegistered=!0),l=m,c=m.nodeIndex)}}return{addCmpToRegistry:s,removeCmpFromRegistry:u,updateRegisteredCmp:l,nodeIndex:c,components:Be(t,r)}}function Be(e,t){let r=de([...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($r),n.inputs.sort((o,s)=>o.name.toLowerCase().localeCompare(s.name.toLowerCase()));let i=t.find(o=>o.id===n.id);i&&(i.acceptsChildren=kr(n));let a=e.find(o=>o.id===n.id&&o.externalImportPath);a&&(n.filePath=a.filePath,n.relFilePath=a.relFilePath)}),r}function mc(e,t){me(t.name)?e.name=t.name:t.name===null&&(e.name=e.importName),me(t.description)?e.description=t.description:t.description===null&&delete e.description,me(t.image)?e.image=t.image:t.image===null&&delete e.image}function fc(e,t){me(t.type)&&(e.type=t.type),me(t.friendlyName)?e.friendlyName=t.friendlyName:t.friendlyName===null&&delete e.friendlyName,me(t.defaultValue)||Ht(t.defaultValue)||Tt(t.defaultValue)?e.defaultValue=t.defaultValue:t.defaultValue===null&&delete e.defaultValue,me(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 ct(e){let t=new Set,r=async i=>{let a=await e.readdir(i);await Promise.all(a.map(async o=>{if(o.startsWith(".")||o==="node_modules")return;let s=e.join(i,o),u=e.extname(o).toLowerCase();if(u===".tsx"||u===".jsx"||u===".ts"||u===".js"){t.add(s);return}(await e.stat(s)).isDirectory()&&await r(s)}))};return await r(e.getAppRootDir()),await Z(e,[...t])}function We(e,t,r){return _t(e,t,r.variableName)?t:dc(e,t,r)}function dc(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([]),a=e.ts.factory.createVariableDeclaration(r.variableName,void 0,n,i),o=e.ts.factory.createVariableDeclarationList([a],e.ts.NodeFlags.Const),s=e.ts.factory.createModifier(e.ts.SyntaxKind.ExportKeyword),u=e.ts.factory.createVariableStatement([s],o),l=[...t.statements,u];return e.ts.factory.updateSourceFile(t,l)}async function Je(e,t,r,n,i,a,o,s){let u=await ct(e),[l,c,p,m]=await Promise.all([ra(e,u),ua(e),xe(e),rn(e)]),g=l.map(x=>x.cmpInfo),d=c.components,D={components:Be(g,d),registryPath:e.registryPath,registryDisplayPath:M(e,e.registryPath),frameworks:e.getFrameworks(),dependencies:Ue(g),publicApiKey:m.envValue??void 0,devToolsVersion:e.version};if(s)return D.components=await jt(e,D.components),D;let h=!1,f=c.sourceFile,F=Array.isArray(t)?t:typeof t=="string"?[t]:[];if(F.length>0){let x=F.map(y=>{let I=l.find(L=>L.cmpInfo.id===y);if(!I)throw new Error(`Component ${y} not found`);return I}),w=Array.from(new Set(x.map(y=>y.cmpInfo.filePath))),S=await Z(e,w);for(let y of x){let I=D.components.find(b=>b.id===y.cmpInfo.id),L=await Ut(e,y,S,e.registryPath===y.cmpInfo.filePath||he(y.cmpInfo.filePath));ye(I,L);let O=g.findIndex(b=>b.id===y.cmpInfo.id);g[O].inputs=L;let v=qe(y.cmpInfo.id,g,d,r,n,i,a);if(e.sdkVersion===A.gen2){let{elements:b,elmIndex:ce,statementIndex:Pe,statement:oe,variableDeclaration:U}=await hc(e,f,y);if(v.addCmpToRegistry)b.push(gc(e,v.addCmpToRegistry)),h=!0;else if(v.removeCmpFromRegistry)b.splice(ce,1),h=!0;else if(v.updateRegisteredCmp){let pe=ee(e,b[ce],v.updateRegisteredCmp);b[ce]=e.ts.factory.updateObjectLiteralExpression(pe,[ma(e,v.updateRegisteredCmp),...pe.properties.slice(1)]),h=!0}if(h&&o){let pe=[...f.statements];pe[Pe]=e.ts.factory.updateVariableStatement(oe,oe.modifiers,e.ts.factory.updateVariableDeclarationList(oe.declarationList,[e.ts.factory.updateVariableDeclaration(U,U.name,U.exclamationToken,U.type,e.ts.factory.createArrayLiteralExpression(Ke(e,b)))])),f=e.ts.factory.updateSourceFile(f,pe),f=pa(e,v,f),f=$(e,f,{namedImports:["RegisteredComponent"],importPath:"@builder.io/sdk-react",isTypeOnly:!0}),f=We(e,f,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),D.components=v.components,d=v.components.filter(ht=>ht.isRegistered)}}else{let b=[...f.statements];v.addCmpToRegistry?(b.push(Gi(e,v.addCmpToRegistry)),h=!0):v.removeCmpFromRegistry?(b.splice(v.nodeIndex,1),h=!0):v.updateRegisteredCmp&&(b[v.nodeIndex]=Lr(e,b[v.nodeIndex],v.updateRegisteredCmp),h=!0),h&&o&&(f=e.ts.factory.updateSourceFile(f,b),f=$(e,f,{namedImports:["Builder","builder"],importPath:"@builder.io/react"}),f=la(e,f,p),f=pa(e,v,f),I?.acceptsChildren&&(f=$(e,f,{namedImports:["withChildren"],importPath:"@builder.io/react"})),D.components=v.components,d=v.components.filter(ce=>ce.isRegistered))}}}if(h&&o){f=ze(e,f),f=Ve(e,f),e.appDir&&(f=sa(e,f));let x=te(e,f);x=Ie(x),e.appDir&&(x=aa(x)),x=await e.formatCode(e.registryPath,x),await e.writeFile(e.registryPath,x)}return D}function ma(e,t){let r=e.ts.factory.createIdentifier(t.importName);return e.appDir?e.ts.factory.createPropertyAssignment("component",r):e.ts.factory.createPropertyAssignment("component",Cc(e,t))}function Dc(e){return e.ts.factory.createPropertyAssignment("canHaveChildren",e.ts.factory.createTrue())}function gc(e,t){return ee(e,e.ts.factory.createObjectLiteralExpression([ma(e,t),...t.acceptsChildren?[Dc(e)]:[]],!0),t)}async function hc(e,t,r){let n=X(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)),a=-1;for(let o=0;o<i.length;o++)if((await Vr(e,t,i[o]))?.id===r.cmpInfo.id){a=o;break}return{...n,elements:i,elmIndex:a}}function pa(e,t,r){if(e.appDir){let n=t.addCmpToRegistry||t.updateRegisteredCmp;if(n){let i=n.externalImportPath?n.externalImportPath:_(e,e.registryPath,n.filePath);n.exportType==="default"?r=$(e,r,{defaultImport:n.importName,importPath:i}):n.exportType==="named"&&(r=$(e,r,{namedImports:[n.importName],importPath:i}))}}else r=$(e,r,{defaultImport:"dynamic",importPath:"next/dynamic"});return r}function Cc(e,t){let r=t.externalImportPath?t.externalImportPath:_(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 a=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,[a])}async function da(e){let t=[],r=await Sc(e,t);return await xa(e,t,r),e.appDir?(e.debug(`ensure builder setup for next.js app ${e.appDir}`),await Ec(e,e.appDir,t)):e.pagesDir&&(e.debug(`ensure builder setup for next.js pages ${e.pagesDir}`),await Fc(e,e.pagesDir,t)),t}async function Da(e){let t=[];return await xa(e,t),e.appDir?(e.debug(`ensure figma-imports setup for next.js app ${e.appDir}`),await xc(e,e.appDir,t)):e.pagesDir&&(e.debug(`ensure figma-imports setup for next.js pages ${e.pagesDir}`),await yc(e,e.pagesDir,t)),t}async function xc(e,t,r){let n=`page.${e.typescriptEnabled?"tsx":"jsx"}`,i=e.join(t,"figma-imports",n);if(!await e.exists(i)){let a=await e.formatCode(i,ha({sys:e,routePath:i,modelName:"figma-imports"}));await e.writeFile(i,a),r.push({filePath:i,modifiedType:"create"})}if(!await e.exists(e.builderComponentPath)){let a=await e.formatCode(e.builderComponentPath,ga(e));await e.writeFile(e.builderComponentPath,a),r.push({filePath:e.builderComponentPath,modifiedType:"create"})}}async function Ec(e,t,r){let n=`page.${e.typescriptEnabled?"tsx":"jsx"}`,i=e.join(t,"[...page]",n);if(!await e.exists(i)){let a=await e.formatCode(i,ha({sys:e,routePath:i,modelName:"page"}));await e.writeFile(i,a),r.push({filePath:i,modifiedType:"create"})}if(!await e.exists(e.builderComponentPath)){let a=await e.formatCode(e.builderComponentPath,ga(e));await e.writeFile(e.builderComponentPath,a),r.push({filePath:e.builderComponentPath,modifiedType:"create"})}}function ga(e){let t=e.typescriptEnabled;return e.sdkVersion===A.gen2?`
|
|
293
|
+
`}function Or(e,t){return t.sort((r,n)=>{let i=ra(e,r),a=ra(e,n);return i.toLocaleLowerCase().localeCompare(a.toLocaleLowerCase())})}function ra(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 ia(e){return typeof e=="string"&&!e.includes("'use client'")&&!e.includes(`"use client"'`)&&(e=`"use client"
|
|
294
|
+
${e}`),e}function aa(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 Ve(e,t){return t.sort((r,n)=>{if(e.ts.isObjectLiteralExpression(r)&&e.ts.isObjectLiteralExpression(n)){let i=oa(e,r),a=oa(e,n);return i.toLocaleLowerCase().localeCompare(a.toLocaleLowerCase())}return 1})}function oa(e,t){let r=t.properties.find(n=>j(e,n)==="name");return r&&e.ts.isPropertyAssignment(r)&&e.ts.isStringLiteral(r.initializer)?r.initializer.text:"zzzz"}async function sa(e){let t=await e.readFile(e.registryPath);return t?uc(e,t):{components:[],sourceFile:k(e,"")}}async function uc(e,t){let r=k(e,t);return e.sdkVersion===A.gen2?cc(e,r):lc(e,r)}async function lc(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 a=i.expression;if(!e.ts.isCallExpression(a))continue;let o=a.expression;if(!e.ts.isPropertyAccessExpression(o))continue;let s=o.expression;if(!e.ts.isIdentifier(s)||s.text!=="Builder"||o.name.text!=="registerComponent")continue;let l=a.arguments;if(l.length<2)continue;let c=l[1];if(!e.ts.isObjectLiteralExpression(c))continue;let p=l[0];if(e.ts.isCallExpression(p)){let m=e.ts.isIdentifier(p.expression)&&p.expression.text;if(m==="withChildren"){let D=jr(e,p.arguments[0]);if(e.ts.isCallExpression(D)){let d=await _r(e,n,D,c,!0);d&&r.push(d)}else{let d=D;if(e.ts.isIdentifier(d)){let g=await Mr(e,t,n,d,c,!0);g&&r.push(g)}}continue}if(m==="dynamic"){let D=await _r(e,n,p,c,!1);D&&r.push(D);continue}let h=jr(e,p.arguments[0]);if(e.ts.isCallExpression(h)&&e.ts.isIdentifier(h.expression)&&h.expression.text==="dynamic"){let D=await _r(e,n,h,c,!1);D&&r.push(D);continue}if(e.ts.isIdentifier(h)){let D=await Mr(e,t,n,h,c,!1);D&&r.push(D);continue}continue}if(e.ts.isIdentifier(p)){let m=await Mr(e,t,n,p,c,!1);m&&r.push(m);continue}}return{sourceFile:t,components:de(r)}}function jr(e,t){return e.ts.isCallExpression(t)?(e.ts.isIdentifier(t.expression)&&t.expression.text)==="dynamic"?t:jr(e,t.arguments[0]):t}async function _r(e,t,r,n,i){let a={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 s=o[0];if(!e.ts.isArrowFunction(s))return null;let u=s.body;if(e.ts.isCallExpression(u)){if(u.expression.kind!==e.ts.SyntaxKind.ImportKeyword||u.arguments.length!==1)return null;let c=u.arguments[0];if(!e.ts.isStringLiteral(c))return null;let p=c.text,m=await Vt(e,p);a.filePath=m,a.relFilePath=e.relative(e.getAppRootDir(),a.filePath),await e.exists(m)?a.importPath=z(e,a.filePath):(a.externalImportPath=p,a.importPath=a.externalImportPath),a.name=ye(e,a.filePath),a.importName="default",a.exportName="default",a.exportType="default"}else if(e.ts.isPropertyAccessExpression(u)){let l=u.expression;if(!e.ts.isParenthesizedExpression(l))return null;let c=l.expression;if(!e.ts.isAwaitExpression(c))return null;let p=c.expression;if(!e.ts.isCallExpression(p)||p.expression.kind!==e.ts.SyntaxKind.ImportKeyword||p.arguments.length!==1)return null;let h=p.arguments[0];if(!e.ts.isStringLiteral(h)||!e.ts.isIdentifier(u.name))return null;let D=h.text,d=await Vt(e,D);a.filePath=d,a.relFilePath=e.relative(e.getAppRootDir(),a.filePath),await e.exists(d)?a.importPath=z(e,a.filePath):(a.externalImportPath=D,a.importPath=a.externalImportPath),a.name=W(u.name.text),a.importName=u.name.text,a.exportName=u.name.text,a.exportType="named"}else return null;return a=De(e,a,n),a.displayFilePath=M(e,a.filePath),a.filePath&&a.exportName&&(a.id=await q(e,a.filePath,a.exportName,a.externalImportPath)),a}async function Mr(e,t,r,n,i,a){let o={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],nodeIndex:r,acceptsChildren:a,framework:"react"},s=t.statements.filter(l=>e.ts.isImportDeclaration(l)),u=s.find(l=>l.importClause&&l.importClause.name?.text===n.text);if(u){let l=u.moduleSpecifier;if(!e.ts.isStringLiteral(l))return null;let c=await Vt(e,l.text);o.filePath=c,o.relFilePath=e.relative(e.getAppRootDir(),o.filePath),await e.exists(c)?o.importPath=z(e,o.filePath):(o.externalImportPath=l.text,o.importPath=o.externalImportPath),o.name=ye(e,o.filePath),o.importName=n.text,o.exportName="default",o.exportType="default"}else{let l=s.find(m=>!m.importClause||!m.importClause.namedBindings||!e.ts.isNamedImports(m.importClause.namedBindings)?!1:m.importClause.namedBindings.elements.some(h=>h.name.text===n.text));if(!l)return null;let c=l.moduleSpecifier;if(!e.ts.isStringLiteral(c))return null;let p=await Vt(e,c.text);o.filePath=p,o.relFilePath=e.relative(e.getAppRootDir(),o.filePath),await e.exists(p)?o.importPath=z(e,o.filePath):(o.externalImportPath=c.text,o.importPath=o.externalImportPath),o.name=W(n.text),o.importName=n.text,o.exportName=n.text,o.exportType="named"}return o=De(e,o,i),o.displayFilePath=M(e,o.filePath),o.filePath&&o.exportName&&(o.id=await q(e,o.filePath,o.exportName,o.externalImportPath)),o}function Vt(e,t){return sn(e,e.normalize(e.resolve(e.dirname(e.registryPath),t)))}function ua(e,t,r){let n=!1,i=0,a=[...t.statements];for(let l=0;l<a.length;l++){let c=a[l];if(e.ts.isImportDeclaration(c)){i=l;continue}if(!e.ts.isExpressionStatement(c))continue;let p=c.expression;if(!e.ts.isCallExpression(p))continue;let m=p.expression;if(!e.ts.isPropertyAccessExpression(m))continue;let h=m.expression;if(!e.ts.isIdentifier(h)||h.text!=="builder")continue;if(m.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(_e)),s=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,[s]));return a.splice(i+1,0,u),e.ts.factory.updateSourceFile(t,a)}async function cc(e,t){let r=[],n=X(e,t,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(i,a)=>{let o=await Ur(e,t,i);o&&(o.nodeIndex=a,r.push(o))})),{sourceFile:t,components:de(r)}}async function Ur(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"};Ot(e,r)&&(n.acceptsChildren=!0);for(let a of r.properties){if(!e.ts.isPropertyAssignment(a)||!e.ts.isIdentifier(a.name))continue;if(j(e,a)==="component"){let s,{initializer:u}=a;if(e.ts.isCallExpression(u)&&(e.ts.isIdentifier(u.expression)&&u.expression.text)==="dynamic"){let h=u.arguments;if(h.length===0)return null;let D=h[0];if(!e.ts.isArrowFunction(D))return null;let d=D.body;if(e.ts.isCallExpression(d)){if(d.expression.kind!==e.ts.SyntaxKind.ImportKeyword||d.arguments.length!==1)return null;let f=d.arguments[0];if(!e.ts.isStringLiteral(f))return null;let x=f.text,y=await Vt(e,x);n.filePath=y,n.relFilePath=e.relative(e.getAppRootDir(),n.filePath),await e.exists(y)?n.importPath=z(e,n.filePath):(n.externalImportPath=x,n.importPath=n.externalImportPath),n.name=ye(e,n.filePath),n.importName="default",n.exportName="default",n.exportType="default"}else if(e.ts.isPropertyAccessExpression(d)){let g=d.expression;if(!e.ts.isParenthesizedExpression(g))return null;let f=g.expression;if(!e.ts.isAwaitExpression(f))return null;let x=f.expression;if(!e.ts.isCallExpression(x)||x.expression.kind!==e.ts.SyntaxKind.ImportKeyword||x.arguments.length!==1)return null;let S=x.arguments[0];if(!e.ts.isStringLiteral(S)||!e.ts.isIdentifier(d.name))return null;let v=S.text,F=await Vt(e,v);n.filePath=F,n.relFilePath=e.relative(e.getAppRootDir(),n.filePath),await e.exists(F)?n.importPath=z(e,n.filePath):(n.externalImportPath=v,n.importPath=n.externalImportPath),n.name=W(d.name.text),n.importName=d.name.text,n.exportName=d.name.text,n.exportType="named"}else return null;return n=De(e,n,r),n.displayFilePath=M(e,n.filePath),n.filePath&&n.exportName&&(n.id=await q(e,n.filePath,n.exportName,n.externalImportPath)),n}if(e.ts.isIdentifier(u)&&(s=u.text),!s)continue;n.name===""&&(n.name=W(s)),n.importName=s;let l=await Me(e,e.registryPath,t,s);if(!l)continue;n.filePath=l.filePath,n.relFilePath=l.relFilePath,await e.exists(l.filePath)?n.importPath=z(e,l.filePath):(n.externalImportPath=l.importPath,n.importPath=n.externalImportPath),n.importPath=z(e,l.filePath),n.displayFilePath=l.displayFilePath,n.exportType=l.exportType;let c=t.statements.filter(m=>e.ts.isImportDeclaration(m)),p=c.find(m=>m.importClause&&m.importClause.name?.text===s);if(p){let m=p.moduleSpecifier;if(!e.ts.isStringLiteral(m))return null;n.exportName="default"}else{let m=c.find(D=>!D.importClause||!D.importClause.namedBindings||!e.ts.isNamedImports(D.importClause.namedBindings)?!1:D.importClause.namedBindings.elements.some(d=>d.name.text===s));if(!m)return null;let h=m.moduleSpecifier;if(!e.ts.isStringLiteral(h))return null;n.exportName=s}continue}}return n=De(e,n,r),n.filePath&&n.exportName&&(n.id=await q(e,n.filePath,n.exportName,n.externalImportPath)),n}function Ke(e,t){let r=[...t.statements],n=!1;for(let i=t.statements.length-1;i>=0;i--){let a=t.statements[i];if(e.ts.isImportDeclaration(a)&&a.importClause){let o=!1,s=a.importClause.namedBindings;if(s&&e.ts.isNamedImports(s)&&s.elements){let u=[...s.elements];for(let l=u.length-1;l>=0;l--){let c=u[l];if(e.ts.isImportSpecifier(c)){let p=c.name;if(p&&e.ts.isIdentifier(p)){let m=p.text;la(e,t,m)||u.splice(l,1)}}}if(u.length===0)o=!0;else if(s.elements.length!==u.length){let l=e.ts.factory.updateImportClause(a.importClause,!1,a.importClause.name,e.ts.factory.createNamedImports(u)),c=e.ts.factory.updateImportDeclaration(a,void 0,l,a.moduleSpecifier,void 0);r[i]=c,n=!0}}else if(a.importClause.name&&e.ts.isIdentifier(a.importClause.name)){let u=a.importClause.name.text;la(e,t,u)||(o=!0)}o&&(r.splice(i,1),n=!0)}}return n?e.ts.factory.updateSourceFile(t,r):t}function la(e,t,r){let n=!1;function i(a){if(!e.ts.isImportDeclaration(a)){if(e.ts.isIdentifier(a)&&a.text===r){n=!0;return}e.ts.forEachChild(a,i)}}return e.ts.forEachChild(t,i),n}function ze(e,t,r,n,i,a,o){let s=null,u=null,l=null,c=-1;t=Ce(t),r=Ce(r);let p=t.find(h=>h.id===e),m=r.find(h=>h.id===e);if(n)m||(s={...Ce(p),inputs:Ce(p.inputs).map(h=>(h.isRegistered=!0,h))},c=r.length,r.push(s));else if(typeof m?.nodeIndex=="number"&&m.nodeIndex>-1){if(i)c=m.nodeIndex,u=Ce(m),r=r.filter(h=>h.id!==e);else if(a!=null)pc(m,a),c=m.nodeIndex,l=m;else if(o!=null){let h=m.inputs.find(D=>D.name===o.name);h&&(o.registerInput===!1?h.isRegistered=!1:(mc(h,o),h.isRegistered=!0),l=m,c=m.nodeIndex)}}return{addCmpToRegistry:s,removeCmpFromRegistry:u,updateRegisteredCmp:l,nodeIndex:c,components:Re(t,r)}}function Re(e,t){let r=de([...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(kr),n.inputs.sort((o,s)=>o.name.toLowerCase().localeCompare(s.name.toLowerCase()));let i=t.find(o=>o.id===n.id);i&&(i.acceptsChildren=Nr(n));let a=e.find(o=>o.id===n.id&&o.externalImportPath);a&&(n.filePath=a.filePath,n.relFilePath=a.relFilePath)}),r}function pc(e,t){me(t.name)?e.name=t.name:t.name===null&&(e.name=e.importName),me(t.description)?e.description=t.description:t.description===null&&delete e.description,me(t.image)?e.image=t.image:t.image===null&&delete e.image}function mc(e,t){me(t.type)&&(e.type=t.type),me(t.friendlyName)?e.friendlyName=t.friendlyName:t.friendlyName===null&&delete e.friendlyName,me(t.defaultValue)||Ht(t.defaultValue)||Tt(t.defaultValue)?e.defaultValue=t.defaultValue:t.defaultValue===null&&delete e.defaultValue,me(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 pt(e){let t=new Set,r=async i=>{let a=await e.readdir(i);await Promise.all(a.map(async o=>{if(o.startsWith(".")||o==="node_modules")return;let s=e.join(i,o),u=e.extname(o).toLowerCase();if(u===".tsx"||u===".jsx"||u===".ts"||u===".js"){t.add(s);return}(await e.stat(s)).isDirectory()&&await r(s)}))};return await r(e.getAppRootDir()),await Z(e,[...t])}function qe(e,t,r){return _t(e,t,r.variableName)?t:fc(e,t,r)}function fc(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([]),a=e.ts.factory.createVariableDeclaration(r.variableName,void 0,n,i),o=e.ts.factory.createVariableDeclarationList([a],e.ts.NodeFlags.Const),s=e.ts.factory.createModifier(e.ts.SyntaxKind.ExportKeyword),u=e.ts.factory.createVariableStatement([s],o),l=[...t.statements,u];return e.ts.factory.updateSourceFile(t,l)}async function We(e,t,r,n,i,a,o,s){let u=await pt(e),[l,c,p,m]=await Promise.all([na(e,u),sa(e),xe(e),rn(e)]),h=l.map(y=>y.cmpInfo),D=c.components,d={components:Re(h,D),registryPath:e.registryPath,registryDisplayPath:M(e,e.registryPath),frameworks:e.getFrameworks(),dependencies:je(h),publicApiKey:m.envValue??void 0,devToolsVersion:e.version};if(s)return d.components=await jt(e,d.components),d;let g=!1,f=c.sourceFile,x=Array.isArray(t)?t:typeof t=="string"?[t]:[];if(x.length>0){let y=x.map(F=>{let B=l.find(U=>U.cmpInfo.id===F);if(!B)throw new Error(`Component ${F} not found`);return B}),S=Array.from(new Set(y.map(F=>F.cmpInfo.filePath))),v=await Z(e,S);for(let F of y){let B=d.components.find(b=>b.id===F.cmpInfo.id),U=await Ut(e,F,v,e.registryPath===F.cmpInfo.filePath||he(F.cmpInfo.filePath));Fe(B,U);let T=h.findIndex(b=>b.id===F.cmpInfo.id);h[T].inputs=U;let w=ze(F.cmpInfo.id,h,D,r,n,i,a);if(e.sdkVersion===A.gen2){let{elements:b,elmIndex:ce,statementIndex:Pe,statement:oe,variableDeclaration:V}=await gc(e,f,F);if(w.addCmpToRegistry)b.push(Dc(e,w.addCmpToRegistry)),g=!0;else if(w.removeCmpFromRegistry)b.splice(ce,1),g=!0;else if(w.updateRegisteredCmp){let pe=ee(e,b[ce],w.updateRegisteredCmp);b[ce]=e.ts.factory.updateObjectLiteralExpression(pe,[pa(e,w.updateRegisteredCmp),...pe.properties.slice(1)]),g=!0}if(g&&o){let pe=[...f.statements];pe[Pe]=e.ts.factory.updateVariableStatement(oe,oe.modifiers,e.ts.factory.updateVariableDeclarationList(oe.declarationList,[e.ts.factory.updateVariableDeclaration(V,V.name,V.exclamationToken,V.type,e.ts.factory.createArrayLiteralExpression(Ve(e,b)))])),f=e.ts.factory.updateSourceFile(f,pe),f=ca(e,w,f),f=$(e,f,{namedImports:["RegisteredComponent"],importPath:"@builder.io/sdk-react",isTypeOnly:!0}),f=qe(e,f,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),d.components=w.components,D=w.components.filter(ht=>ht.isRegistered)}}else{let b=[...f.statements];w.addCmpToRegistry?(b.push(Hi(e,w.addCmpToRegistry)),g=!0):w.removeCmpFromRegistry?(b.splice(w.nodeIndex,1),g=!0):w.updateRegisteredCmp&&(b[w.nodeIndex]=$r(e,b[w.nodeIndex],w.updateRegisteredCmp),g=!0),g&&o&&(f=e.ts.factory.updateSourceFile(f,b),f=$(e,f,{namedImports:["Builder","builder"],importPath:"@builder.io/react"}),f=ua(e,f,p),f=ca(e,w,f),B?.acceptsChildren&&(f=$(e,f,{namedImports:["withChildren"],importPath:"@builder.io/react"})),d.components=w.components,D=w.components.filter(ce=>ce.isRegistered))}}}if(g&&o){f=Ke(e,f),f=Ue(e,f),e.appDir&&(f=aa(e,f));let y=te(e,f);y=Be(y),e.appDir&&(y=ia(y)),y=await e.formatCode(e.registryPath,y),await e.writeFile(e.registryPath,y)}return d}function pa(e,t){let r=e.ts.factory.createIdentifier(t.importName);return e.appDir?e.ts.factory.createPropertyAssignment("component",r):e.ts.factory.createPropertyAssignment("component",hc(e,t))}function dc(e){return e.ts.factory.createPropertyAssignment("canHaveChildren",e.ts.factory.createTrue())}function Dc(e,t){return ee(e,e.ts.factory.createObjectLiteralExpression([pa(e,t),...t.acceptsChildren?[dc(e)]:[]],!0),t)}async function gc(e,t,r){let n=X(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)),a=-1;for(let o=0;o<i.length;o++)if((await Ur(e,t,i[o]))?.id===r.cmpInfo.id){a=o;break}return{...n,elements:i,elmIndex:a}}function ca(e,t,r){if(e.appDir){let n=t.addCmpToRegistry||t.updateRegisteredCmp;if(n){let i=n.externalImportPath?n.externalImportPath:O(e,e.registryPath,n.filePath);n.exportType==="default"?r=$(e,r,{defaultImport:n.importName,importPath:i}):n.exportType==="named"&&(r=$(e,r,{namedImports:[n.importName],importPath:i}))}}else r=$(e,r,{defaultImport:"dynamic",importPath:"next/dynamic"});return r}function hc(e,t){let r=t.externalImportPath?t.externalImportPath:O(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 a=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,[a])}async function fa(e){let t=[],r=await yc(e,t);return await Ca(e,t,r),e.appDir?(e.debug(`ensure builder setup for next.js app ${e.appDir}`),await xc(e,e.appDir,t)):e.pagesDir&&(e.debug(`ensure builder setup for next.js pages ${e.pagesDir}`),await Ec(e,e.pagesDir,t)),t}async function da(e){let t=[];return await Ca(e,t),e.appDir?(e.debug(`ensure figma-imports setup for next.js app ${e.appDir}`),await Cc(e,e.appDir,t)):e.pagesDir&&(e.debug(`ensure figma-imports setup for next.js pages ${e.pagesDir}`),await Fc(e,e.pagesDir,t)),t}async function Cc(e,t,r){let n=`page.${e.typescriptEnabled?"tsx":"jsx"}`,i=e.join(t,"figma-imports",n);if(!await e.exists(i)){let a=await e.formatCode(i,ga({sys:e,routePath:i,modelName:"figma-imports"}));await e.writeFile(i,a),r.push({filePath:i,modifiedType:"create"})}if(!await e.exists(e.builderComponentPath)){let a=await e.formatCode(e.builderComponentPath,Da(e));await e.writeFile(e.builderComponentPath,a),r.push({filePath:e.builderComponentPath,modifiedType:"create"})}}async function xc(e,t,r){let n=`page.${e.typescriptEnabled?"tsx":"jsx"}`,i=e.join(t,"[...page]",n);if(!await e.exists(i)){let a=await e.formatCode(i,ga({sys:e,routePath:i,modelName:"page"}));await e.writeFile(i,a),r.push({filePath:i,modifiedType:"create"})}if(!await e.exists(e.builderComponentPath)){let a=await e.formatCode(e.builderComponentPath,Da(e));await e.writeFile(e.builderComponentPath,a),r.push({filePath:e.builderComponentPath,modifiedType:"create"})}}function Da(e){let t=e.typescriptEnabled;return e.sdkVersion===A.gen2?`
|
|
295
295
|
"use client";
|
|
296
296
|
import { ${t?"BuilderContent, ":""} isPreviewing, Content } from "@builder.io/sdk-react";
|
|
297
297
|
import DefaultErrorPage from "next/error";
|
|
298
|
-
import { CUSTOM_COMPONENTS } from ${JSON.stringify(
|
|
298
|
+
import { CUSTOM_COMPONENTS } from ${JSON.stringify(O(e,e.builderComponentPath,e.registryPath))};
|
|
299
299
|
${t?`
|
|
300
300
|
interface BuilderPageProps {
|
|
301
301
|
content: BuilderContent | null;
|
|
@@ -303,7 +303,7 @@ interface BuilderPageProps {
|
|
|
303
303
|
}`:""}
|
|
304
304
|
|
|
305
305
|
// Builder Public API Key set in .env file
|
|
306
|
-
const builderApiKey = process.env.${
|
|
306
|
+
const builderApiKey = process.env.${_e}${t?"!":""};
|
|
307
307
|
|
|
308
308
|
export function RenderBuilderContent({ content, model }${t?": BuilderPageProps":""}) {
|
|
309
309
|
// Call the isPreviewing hook to determine if
|
|
@@ -329,12 +329,12 @@ ${t?'import { ComponentProps } from "react";':""}
|
|
|
329
329
|
import { BuilderComponent, useIsPreviewing } from "@builder.io/react";
|
|
330
330
|
import { ${t?"BuilderContent, ":""}builder } from '@builder.io/sdk';
|
|
331
331
|
import DefaultErrorPage from "next/error";
|
|
332
|
-
import ${JSON.stringify(
|
|
332
|
+
import ${JSON.stringify(O(e,e.builderComponentPath,e.registryPath))};
|
|
333
333
|
${t?`
|
|
334
334
|
type BuilderPageProps = ComponentProps<typeof BuilderComponent>;`:""}
|
|
335
335
|
|
|
336
336
|
// Builder Public API Key set in .env file
|
|
337
|
-
builder.init(process.env.${
|
|
337
|
+
builder.init(process.env.${_e}${t?"!":""});
|
|
338
338
|
|
|
339
339
|
export function RenderBuilderContent({ content, model }${t?": BuilderPageProps":""}) {
|
|
340
340
|
// Call the useIsPreviewing hook to determine if
|
|
@@ -350,7 +350,7 @@ export function RenderBuilderContent({ content, model }${t?": BuilderPageProps":
|
|
|
350
350
|
// DefaultErrorPage with a 404.
|
|
351
351
|
return <DefaultErrorPage statusCode={404} />;
|
|
352
352
|
}
|
|
353
|
-
`.trimStart()}function
|
|
353
|
+
`.trimStart()}function ma(e){return e.features.asyncParams?`
|
|
354
354
|
interface PageProps {
|
|
355
355
|
params: Promise<{
|
|
356
356
|
page: string[];
|
|
@@ -360,14 +360,14 @@ interface PageProps {
|
|
|
360
360
|
params: {
|
|
361
361
|
page: string[];
|
|
362
362
|
};
|
|
363
|
-
}`}function
|
|
363
|
+
}`}function ga({sys:e,routePath:t,modelName:r}){let n=e.typescriptEnabled,i=O(e,t,e.builderComponentPath);return e.sdkVersion===A.gen2?`
|
|
364
364
|
import { fetchOneEntry } from "@builder.io/sdk-react";
|
|
365
365
|
import { RenderBuilderContent } from ${JSON.stringify(i)};
|
|
366
366
|
|
|
367
367
|
// Builder Public API Key set in .env file
|
|
368
|
-
const PUBLIC_API_KEY = process.env.${
|
|
368
|
+
const PUBLIC_API_KEY = process.env.${_e}${n?"!":""};
|
|
369
369
|
|
|
370
|
-
${n?
|
|
370
|
+
${n?ma(e):""}
|
|
371
371
|
|
|
372
372
|
export default async function Page(props${n?": PageProps":""}) {
|
|
373
373
|
const builderModelName = "${r}";
|
|
@@ -394,8 +394,8 @@ import { builder } from "@builder.io/sdk";
|
|
|
394
394
|
import { RenderBuilderContent } from ${JSON.stringify(i)};
|
|
395
395
|
|
|
396
396
|
// Builder Public API Key set in .env file
|
|
397
|
-
builder.init(process.env.${
|
|
398
|
-
${n?
|
|
397
|
+
builder.init(process.env.${_e}${n?"!":""});
|
|
398
|
+
${n?ma(e):""}
|
|
399
399
|
|
|
400
400
|
export default async function Page(props${n?": PageProps":""}) {
|
|
401
401
|
const builderModelName = "${r}";
|
|
@@ -418,7 +418,7 @@ export default async function Page(props${n?": PageProps":""}) {
|
|
|
418
418
|
</>
|
|
419
419
|
);
|
|
420
420
|
}
|
|
421
|
-
`.trimStart()}async function
|
|
421
|
+
`.trimStart()}async function Ec(e,t,r){let n=`[...page].${e.typescriptEnabled?"tsx":"jsx"}`,i=e.join(t,n);if(!await e.exists(i)){let a=await e.formatCode(i,ha({sys:e,routePath:i,modelName:"page"}));await e.writeFile(i,a),r.push({filePath:i,modifiedType:"create"})}}async function Fc(e,t,r){let n=`figma-imports.${e.typescriptEnabled?"tsx":"jsx"}`,i=e.join(t,n);if(!await e.exists(i)){let a=await e.formatCode(i,ha({sys:e,routePath:i,modelName:"figma-imports"}));await e.writeFile(i,a),r.push({filePath:i,modifiedType:"create"})}}function ha({sys:e,routePath:t,modelName:r}){let n=e.typescriptEnabled;return e.sdkVersion===A.gen2?`
|
|
422
422
|
import React from "react";
|
|
423
423
|
import { useRouter } from "next/router";
|
|
424
424
|
${n?'import type { BuilderContent } from "@builder.io/sdk-react";':""}
|
|
@@ -431,9 +431,9 @@ import {
|
|
|
431
431
|
import DefaultErrorPage from "next/error";
|
|
432
432
|
import Head from "next/head";
|
|
433
433
|
${n?'import { GetStaticProps } from "next";':""}
|
|
434
|
-
import { CUSTOM_COMPONENTS } from ${JSON.stringify(
|
|
434
|
+
import { CUSTOM_COMPONENTS } from ${JSON.stringify(O(e,e.builderComponentPath,e.registryPath))};
|
|
435
435
|
|
|
436
|
-
const BUILDER_API_KEY = process.env.${
|
|
436
|
+
const BUILDER_API_KEY = process.env.${_e}${n?"!":""};
|
|
437
437
|
|
|
438
438
|
// Define a function that fetches the Builder
|
|
439
439
|
// content for a given page
|
|
@@ -515,9 +515,9 @@ import DefaultErrorPage from "next/error";
|
|
|
515
515
|
import Head from "next/head";${n?`
|
|
516
516
|
import { BuilderContent } from "@builder.io/sdk";`:""}${n?`
|
|
517
517
|
import { GetStaticProps } from "next";`:""}
|
|
518
|
-
import ${JSON.stringify(
|
|
518
|
+
import ${JSON.stringify(O(e,t,e.registryPath))};
|
|
519
519
|
|
|
520
|
-
builder.init(process.env.${
|
|
520
|
+
builder.init(process.env.${_e}${n?"!":""});
|
|
521
521
|
|
|
522
522
|
// Define a function that fetches the Builder
|
|
523
523
|
// content for a given page
|
|
@@ -582,7 +582,7 @@ export default function Page({ page }${n?": { page: BuilderContent | null }":""}
|
|
|
582
582
|
</>
|
|
583
583
|
);
|
|
584
584
|
}
|
|
585
|
-
`.trimStart()}async function
|
|
585
|
+
`.trimStart()}async function yc(e,t){let n=e.typescriptEnabled?"tsx":"jsx",i=e.join(e.componentsDir,"Counter"),a=e.join(i,`Counter.${n}`),o=e.join(i,"styles.module.css"),{component:s,styles:u}=Sc(e);if(!await e.exists(a)){let l=await e.formatCode(a,s);await e.writeFile(a,l),t.push({filePath:a,modifiedType:"create"})}return await e.exists(o)||(await e.writeFile(o,u),t.push({filePath:o,modifiedType:"create"})),a}function Sc(e){let t=e.typescriptEnabled,r=`
|
|
586
586
|
"use client"
|
|
587
587
|
import React, { useState } from "react";
|
|
588
588
|
import styles from "./styles.module.css";
|
|
@@ -645,18 +645,18 @@ export default Counter;
|
|
|
645
645
|
font-size: 42px;
|
|
646
646
|
text-align: center;
|
|
647
647
|
}
|
|
648
|
-
`.trimStart();return{component:r,styles:n}}async function
|
|
648
|
+
`.trimStart();return{component:r,styles:n}}async function Ca(e,t,r){if(!await e.exists(e.registryPath)){if(e.sdkVersion===A.gen2){let a=vc(e);await e.writeFile(e.registryPath,a)}else await e.writeFile(e.registryPath,"");t.push({filePath:e.registryPath,modifiedType:"create"})}if(!r)return;let i=(await We(e,null,!1,!1,null,null,!1,!1)).components.find(a=>a.filePath===r);i&&await We(e,i.id,!0,!1,null,null,!0,!1)}function vc(e){return e.typescriptEnabled?`import type { RegisteredComponent } from "@builder.io/sdk-react";
|
|
649
649
|
|
|
650
650
|
export const CUSTOM_COMPONENTS: RegisteredComponent[] = [
|
|
651
651
|
];`:`export const CUSTOM_COMPONENTS = [
|
|
652
652
|
];
|
|
653
|
-
`}async function Kt(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 A.gen2;if(r.has("@builder.io/react"))return A.gen1}return null}async function
|
|
653
|
+
`}async function Kt(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 A.gen2;if(r.has("@builder.io/react"))return A.gen1}return null}async function xa(e){let t=await wc(e);return{builderPageOptions:async()=>({templateContentId:"3de2f13211234071a4b19a17b4fbc5a7",pathname:"/builder-demo",title:"Builder + Next.js Demo Page"}),ensureBuilderSetup:()=>fa(t),ensureFigmaImportPage:()=>da(t),getRegistryPath:()=>t.registryPath,getRegistry:n=>We(t,null,!1,!1,null,null,!1,!!n?.readAllInputTypes),addExternalPackage:n=>{t.addExternalPackage(n)},loadComponent:async n=>{let i=await We(t,n.cmpId,!1,!1,null,null,!1,!1);return{...i,component:i.components.find(a=>a.id===n.cmpId)}},registerComponent:n=>We(t,n.cmpId,!0,!1,null,null,!0,!1),setRegisteredComponentInfo:n=>We(t,n.cmpId,!1,!1,n,null,!0,!1),setRegisteredComponentInput:n=>We(t,n.cmpId,!1,!1,null,n,!0,!1),unregisterComponent:n=>We(t,n.cmpId,!1,!0,null,null,!0,!1),getPublicApiKey:()=>rn(t),setPublicApiKey:n=>Vi(t,n.publicApiKey),getDependencies:n=>n.sdkVersion===A.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:()=>Le(t),setCache:n=>Oe(t,n)}}async function wc(e){let t=e.getAppRootDir(),r=e.join(t,"src"),n=await bc(e),i=await xe(e),a=e.getFrameworks().find(l=>l.name==="next"),o={asyncParams:a?.version?.major!==void 0&&a.version.major>=15},s={},u={...e,addExternalPackage:l=>{s[e.join(t,l,"index.ts")]=`export * from "${l}";`},readFileSync:l=>s[l]??e.readFileSync(l),existsSync:l=>!!s[l]||e.existsSync(l),readdirSync:l=>{let c=e.readdirSync(l);return l===t?[...c,...Object.keys(s).map(p=>p.slice(t.length+1))]:c},readdir:async l=>{let c=await e.readdir(l);return l===t?[...c,...Object.keys(s).map(p=>p.slice(t.length+1))]:c},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 Kt(u),await e.exists(r)){u.srcDir=r,u.componentsDir=e.join(r,"components");let l=e.join(r,"app");await e.exists(l)&&(u.appDir=l);let c=e.join(r,"pages");await e.exists(c)&&(u.pagesDir=c),u.registryPath=await Se(e,r)}else u.componentsDir=e.join(t,"components"),u.registryPath=await Se(e,t);if(u.builderComponentPath=e.join(u.componentsDir,`builder.${i?"tsx":"jsx"}`),!u.appDir){let l=e.join(t,"app");await e.exists(l)&&(u.appDir=l)}if(!u.pagesDir){let l=e.join(t,"pages");await e.exists(l)&&(u.pagesDir=l)}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 bc(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 un(e){return await ut(e,[".env"],Fa)}async function Ea(e,t){Ac(t);let r=await un(e),n=await lt(e,r.file,r.envKey,t);return{...r,modifiedType:n}}function Ac(e){typeof process<"u"&&(process.env[Fa]=e)}var Fa="PUBLIC_BUILDER_API_KEY";function ya(e,t,r){if(r.length===0)return e;let n=e.split(`
|
|
654
654
|
`),i=n.findIndex(s=>s.includes(r));if(i===-1||n.some(s=>s.includes(t[0])))return e;let o=["/**",...t.map(s=>` * ${s.trim()}`)," */"];return n.splice(i,0,...o),n.join(`
|
|
655
|
-
`)}async function va(e,t){let r=[],n=t.getSourceFiles(),i=t.getTypeChecker();return await Promise.all(n.map(async a=>{let o=e.basename(a.fileName);if(o.startsWith(".")||
|
|
655
|
+
`)}async function va(e,t){let r=[],n=t.getSourceFiles(),i=t.getTypeChecker();return await Promise.all(n.map(async a=>{let o=e.basename(a.fileName);if(o.startsWith(".")||Ic.has(o))return;let s=e.normalize(a.fileName);if(s===e.registryPath)return;let u=await Mn(e,i,s,a);r.push(...u)})),r}async function wa(e,t){if(e.extname(t).toLowerCase()===".tsx"){let n=await e.readFile(t);if(n)return Pc(e,t,n)}return null}function Pc(e,t,r){let n=k(e,r);return Mn(e,null,t,n)}async function Mn(e,t,r,n){r=e.normalize(r);let i=[],a=yt(e,n);return await Promise.all(a.map(async o=>{let s=await Tc(e,t,r,o);s&&i.push(s)})),i}async function Tc(e,t,r,n){let i=e.relative(e.getAppRootDir(),r),a=z(e,r);if(e.ts.isVariableStatement(n.node))for(let o of n.node.declarationList.declarations){let s=Sa(e,o.initializer);if(s&&e.ts.isIdentifier(o.name)){let u=o.name.text;return{cmpInfo:{id:await q(e,r,u),displayFilePath:M(e,r),name:W(u),inputs:[],exportName:n.isDefaultExport?"default":u,exportType:n.isDefaultExport?"default":"named",importName:u,filePath:r,relFilePath:i,importPath:a,framework:"qwik"},node:s}}}else if(e.ts.isCallExpression(n.node)){let o=Sa(e,n.node);if(o)return{cmpInfo:{id:await q(e,r,"default"),displayFilePath:M(e,r),name:ye(e,r),inputs:[],exportName:"default",exportType:"default",importName:Et(e,r),filePath:r,relFilePath:i,importPath:a,framework:"qwik"},node:o}}return null}function Sa(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 Ic=new Set(["node_modules","layout.tsx","404.tsx","router-head.tsx"]);async function ba(e,t){let r=t.node.fnNode;if((e.ts.isArrowFunction(r)||e.ts.isFunctionExpression(r))&&r.parameters.length>0){let{sourceFile:i,typeChecker:a}=await Bt(e,t.cmpInfo.filePath,null);if(!(await Mn(e,a,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 Ft(e,a,r)}return[]}async function Aa(e){return Vr(e)}async function Vr(e){let t=[];return await e.exists(e.registryPath)||(await e.writeFile(e.registryPath,Bc),t.push({filePath:e.registryPath,modifiedType:"create"})),t}var Bc=`import type { RegisteredComponent } from "@builder.io/sdk-qwik";
|
|
656
656
|
|
|
657
657
|
export const CUSTOM_COMPONENTS: RegisteredComponent[] = [
|
|
658
658
|
];
|
|
659
|
-
`;async function Ta(e){await Kr(e);let t=await e.readFile(e.registryPath);return t?Nc(e,t):{components:[],sourceFile:N(e,"")}}async function Nc(e,t){let r=N(e,t);return kc(e,r)}async function kc(e,t){let r=[],n=X(e,t,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(i,a)=>{let o=await zr(e,t,i);o&&(o.nodeIndex=a,r.push(o))})),{sourceFile:t,components:de(r)}}async function zr(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(j(e,i)==="component"&&e.ts.isIdentifier(i.initializer)){let o=i.initializer.text;n.name===""&&(n.name=q(o)),n.importName=o;let s=await je(e,e.registryPath,t,o);if(!s)continue;n.filePath=s.filePath,n.relFilePath=s.relFilePath,n.importPath=V(e,s.filePath),n.displayFilePath=s.displayFilePath,n.exportType=s.exportType;let u=await ba(e,s.filePath);if(u&&u.length>0)if(u.length===1)n.exportName=u[0].cmpInfo.exportName;else{let l=u.find(c=>c.cmpInfo.exportName===o);l&&(n.exportName=l.cmpInfo.exportName)}continue}}return n=De(e,n,r),n.filePath&&n.exportName&&(n.id=await K(e,n.filePath,n.exportName)),n}async function Ia(e){let t=new Set,r=async i=>{let a=await e.readdir(i);await Promise.all(a.map(async o=>{if(o.startsWith(".")||o==="node_modules")return;let s=e.join(i,o),u=e.extname(o).toLowerCase();if(u===".tsx"||u===".ts"){t.add(s);return}(await e.stat(s)).isDirectory()&&await r(s)}))};return await r(e.getAppRootDir()),await Z(e,[...t])}async function St(e,t,r,n,i,a,o,s){let u=await Ia(e),[l,c,p]=await Promise.all([va(e,u),Ta(e),un(e)]),m=l.map(D=>D.cmpInfo),g=c.components,d={components:Be(m,g),registryPath:e.registryPath,registryDisplayPath:M(e,e.registryPath),frameworks:e.getFrameworks(),dependencies:Ue(m),publicApiKey:p.envValue??void 0,devToolsVersion:e.version};if(s)return d;if(t!=null){let D=l.find(v=>v.cmpInfo.id===t);if(!D)throw new Error(`Component ${t} not found`);let h=c.sourceFile,f=d.components.find(v=>v.id===t),F=await Aa(e,D);console.log("sourceInputs",F),ye(f,F),t=Array.isArray(t)?t[0]:t;let x=qe(t,m,g,r,n,i,a),{elements:w,elmIndex:S,statementIndex:y,statement:I,variableDeclaration:L}=await Lc(e,h,D),O=!1;if(x.addCmpToRegistry?(w.push($c(e,x.addCmpToRegistry)),O=!0):x.removeCmpFromRegistry?(w.splice(S,1),O=!0):x.updateRegisteredCmp&&(w[S]=ee(e,w[S],x.updateRegisteredCmp),O=!0),O&&o){let v=[...h.statements];v[y]=e.ts.factory.updateVariableStatement(I,I.modifiers,e.ts.factory.updateVariableDeclarationList(I.declarationList,[e.ts.factory.updateVariableDeclaration(L,L.name,L.exclamationToken,L.type,e.ts.factory.createArrayLiteralExpression(Ke(e,w)))])),h=e.ts.factory.updateSourceFile(h,v),f.exportType==="named"?h=$(e,h,{namedImports:[f.importName],importPath:_(e,e.registryPath,f.filePath)}):h=$(e,h,{defaultImport:f.importName,importPath:_(e,e.registryPath,f.filePath)}),h=$(e,h,{namedImports:["RegisteredComponent"],importPath:"@builder.io/sdk-qwik",isTypeOnly:!0}),h=We(e,h,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),h=ze(e,h),h=Ve(e,h);let b=te(e,h);b=Ie(b),b=Sa(b,Oc,"CUSTOM_COMPONENTS"),b=await e.formatCode(e.registryPath,b),await e.writeFile(e.registryPath,b)}d.components=x.components}return d}function $c(e,t){return ee(e,e.ts.factory.createObjectLiteralExpression([e.ts.factory.createPropertyAssignment("component",e.ts.factory.createIdentifier(t.importName))],!0),t)}async function Lc(e,t,r){let n=X(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)),a=-1;for(let o=0;o<i.length;o++)if((await zr(e,t,i[o]))?.id===r.cmpInfo.id){a=o;break}return{...n,elements:i,elmIndex:a}}var Oc=["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 Ba(e){let t=await _c(e);return{builderPageOptions:async()=>({templateContentId:"dc70f1d979ad416d8fd357137eb9ddfb",pathname:"/",title:"Builder + Qwik Demo Page"}),ensureBuilderSetup:()=>Pa(t),ensureFigmaImportPage:async()=>[],getRegistryPath:()=>t.registryPath,getRegistry:n=>St(t,null,!1,!1,null,null,!1,!!n?.readAllInputTypes),addExternalPackage:async n=>{},loadComponent:async n=>{let i=await St(t,n.cmpId,!1,!1,null,null,!1,!1);return{...i,component:i.components.find(a=>a.id===n.cmpId)}},registerComponent:n=>St(t,n.cmpId,!0,!1,null,null,!0,!1),setRegisteredComponentInfo:n=>St(t,n.cmpId,!1,!1,n,null,!0,!1),setRegisteredComponentInput:n=>St(t,n.cmpId,!1,!1,null,n,!0,!1),unregisterComponent:n=>St(t,n.cmpId,!1,!0,null,null,!0,!1),getPublicApiKey:()=>un(t),setPublicApiKey:n=>Fa(t,n.publicApiKey),getDependencies:n=>[{name:"@builder.io/dev-tools"},{name:"@builder.io/sdk-qwik"}],getDevRunCommand:()=>"dev",getCache:()=>Oe(t),setCache:n=>_e(t,n)}}async function _c(e){let t=await Qt(e,e.getAppRootDir(),"components");if(!t)throw new Error(`Could not find components directory within project: ${e.getAppRootDir()}`);let r=await we(e,t),n=e.join(e.getAppRootDir(),".env");return{...e,componentsDir:t,registryPath:r,envPath:n}}async function ln(e){return await st(e,[".env"],cn)}async function Ra(e,t){let r=await ln(e),n=await ut(e,r.file,r.envKey,t);return{...r,modifiedType:n}}var cn="PUBLIC_BUILDER_KEY";var Mc=new Set(["dist","node_modules"]);async function Na(e,t){let r=[],n=t.getSourceFiles(),i=t.getTypeChecker(),a=e.join(e.getAppRootDir(),"build");return await Promise.all(n.map(async o=>{let s=e.basename(o.fileName);if(s.startsWith(".")||s==="node_modules"||Pn(e,Mc,o.fileName)||jc.has(s)||s.includes("$."))return;let u=e.normalize(o.fileName);if(u===e.remixConfigPath||u===a)return;let l=await lt(e,i,u,o,u===e.registryPath);r.push(...l)})),r}var jc=new Set(["root.tsx","root.ts","root.jsx","root.js","_index.tsx","_index.jsx","_index.ts","_index.js"]);async function ka(e){await Un(e);let t=await e.readFile(e.registryPath);return t?Uc(e,t):{components:[],sourceFile:N(e,"")}}async function Uc(e,t){let r=N(e,t);return Vc(e,r)}async function Vc(e,t){let r=[],n=X(e,t,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(i,a)=>{let o=await qr(e,t,i);o&&(o.nodeIndex=a,r.push(o))})),{sourceFile:t,components:de(r)}}async function qr(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===A.gen2&&Ot(e,r)&&(n.acceptsChildren=!0);for(let i of r.properties){if(!e.ts.isPropertyAssignment(i)||!e.ts.isIdentifier(i.name))continue;if(j(e,i)==="component"){let o,{initializer:s}=i;if(e.ts.isIdentifier(s))o=s.text;else if(e.ts.isCallExpression(s)){(e.ts.isIdentifier(s.expression)&&s.expression.text)==="withChildren"&&(n.acceptsChildren=!0);let c=s.arguments[0];e.ts.isIdentifier(c)&&(o=c.text)}if(!o)continue;n.name===""&&(n.name=q(o)),n.importName=o;let u=await je(e,e.registryPath,t,o);if(!u)continue;if(n.filePath=u.filePath,n.relFilePath=u.relFilePath,await e.exists(u.filePath)?n.importPath=V(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 l=await ea(e,u.filePath,e.registryPath===u.filePath||he(u.filePath));if(l&&l.length>0)if(l.length===1)n.exportName=l[0].cmpInfo.exportName;else{let c=l.find(p=>p.cmpInfo.exportName===o);c&&(n.exportName=c.cmpInfo.exportName)}}continue}}return n=De(e,n,r),n.filePath&&n.exportName&&(n.id=await K(e,n.filePath,n.exportName,n.externalImportPath)),n}async function He(e,t,r,n,i,a,o,s){let u=await ct(e),[l,c,p]=await Promise.all([Na(e,u),ka(e),ln(e)]),m=l.map(F=>F.cmpInfo),g=c.components,d={components:Be(m,g),registryPath:e.registryPath,registryDisplayPath:M(e,e.registryPath),frameworks:e.getFrameworks(),dependencies:Ue(m),publicApiKey:p.envValue??void 0,devToolsVersion:e.version};if(s)return d.components=await jt(e,d.components),d;let D=!1,h=c.sourceFile,f=Array.isArray(t)?t:typeof t=="string"?[t]:[];if(f.length>0){let F=f.map(S=>{let y=l.find(I=>I.cmpInfo.id===S);if(!y)throw new Error(`Component ${S} not found`);return y}),x=Array.from(new Set(F.map(S=>S.cmpInfo.filePath))),w=await Z(e,x);for(let S of F){let y=d.components.find(U=>U.id===S.cmpInfo.id),I=await Ut(e,S,w,e.registryPath===S.cmpInfo.filePath||he(S.cmpInfo.filePath));ye(y,I);let L=m.findIndex(U=>U.id===S.cmpInfo.id);m[L].inputs=I;let O=qe(S.cmpInfo.id,m,g,r,n,i,a),{elements:v,elmIndex:b,statementIndex:ce,statement:Pe,variableDeclaration:oe}=await zc(e,h,S);if(O.addCmpToRegistry)v.push(Kc(e,O.addCmpToRegistry)),D=!0;else if(O.removeCmpFromRegistry)v.splice(b,1),D=!0;else if(O.updateRegisteredCmp){let U=ee(e,v[b],O.updateRegisteredCmp);v[b]=e.ts.factory.updateObjectLiteralExpression(U,[$a(e,O.updateRegisteredCmp),...U.properties.slice(1)]),D=!0}if(D&&o){let U=[...h.statements];U[ce]=e.ts.factory.updateVariableStatement(Pe,Pe.modifiers,e.ts.factory.updateVariableDeclarationList(Pe.declarationList,[e.ts.factory.updateVariableDeclaration(oe,oe.name,oe.exclamationToken,oe.type,e.ts.factory.createArrayLiteralExpression(Ke(e,v)))])),h=e.ts.factory.updateSourceFile(h,U),y.exportType==="named"?h=$(e,h,{namedImports:[y.importName],importPath:y.externalImportPath?y.externalImportPath:_(e,e.registryPath,y.filePath)}):h=$(e,h,{defaultImport:y.importName,importPath:y.externalImportPath?y.externalImportPath:_(e,e.registryPath,y.filePath)});let pe=e.sdkVersion===A.gen2?"@builder.io/sdk-react":"@builder.io/react";h=$(e,h,{namedImports:["RegisteredComponent"],importPath:pe,isTypeOnly:!0}),y.acceptsChildren&&e.sdkVersion!==A.gen2&&(h=$(e,h,{namedImports:["withChildren"],importPath:"@builder.io/react"})),h=We(e,h,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),d.components=O.components,g=O.components.filter(ht=>ht.isRegistered)}}}if(D&&o){h=ze(e,h),h=Ve(e,h);let F=te(e,h);F=Ie(F),F=await e.formatCode(e.registryPath,F),await e.writeFile(e.registryPath,F)}return d}function $a(e,t){if(e.sdkVersion===A.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 Kc(e,t){return ee(e,e.ts.factory.createObjectLiteralExpression([$a(e,t),...t.acceptsChildren&&e.sdkVersion===A.gen2?[e.ts.factory.createPropertyAssignment("canHaveChildren",e.ts.factory.createTrue())]:[]],!0),t)}async function zc(e,t,r){let n=X(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)),a=-1;for(let o=0;o<i.length;o++)if((await qr(e,t,i[o]))?.id===r.cmpInfo.id){a=o;break}return{...n,elements:i,elmIndex:a}}async function La(e){let t=[],r=await Jc(e,t);return t.push(...await Un(e)),await Gc(e,r),await Wc(e,t),t}async function Oa(e){let t=[];return t.push(...await Un(e)),await qc(e,t),t}async function qc(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 a=await e.formatCode(n,_a({sys:e,routePath:n,modelName:"figma-imports"}));await e.writeFile(n,a),t.push({filePath:n,modifiedType:i?"update":"create"})}async function Wc(e,t){let r=`$.${e.typescriptEnabled?"tsx":"jsx"}`;e.hasLocaleParam&&(e.debug("remixEnsureAppRoute, hasLocaleParam"),r=`($locale).${r}`),e.sdkVersion===A.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 a=await e.formatCode(n,_a({sys:e,routePath:n,modelName:"page"}));await e.writeFile(n,a),t.push({filePath:n,modifiedType:i?"update":"create"})}function _a({sys:e,routePath:t,modelName:r}){let n=e.typescriptEnabled,i=_(e,t,e.registryPath),a="",o="";n&&(a="import type { LoaderArgs } from '@remix-run/server-runtime';",o=": LoaderArgs");let s=`process.env.${cn}`,u="";return e.getFrameworks().some(l=>l.name==="@shopify/remix-oxygen")&&(s=`context.env.${cn}`,u=", context"),n&&(s+="!"),e.sdkVersion===A.gen2?`
|
|
659
|
+
`;async function Pa(e){await Vr(e);let t=await e.readFile(e.registryPath);return t?Rc(e,t):{components:[],sourceFile:k(e,"")}}async function Rc(e,t){let r=k(e,t);return Nc(e,r)}async function Nc(e,t){let r=[],n=X(e,t,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(i,a)=>{let o=await Kr(e,t,i);o&&(o.nodeIndex=a,r.push(o))})),{sourceFile:t,components:de(r)}}async function Kr(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(j(e,i)==="component"&&e.ts.isIdentifier(i.initializer)){let o=i.initializer.text;n.name===""&&(n.name=W(o)),n.importName=o;let s=await Me(e,e.registryPath,t,o);if(!s)continue;n.filePath=s.filePath,n.relFilePath=s.relFilePath,n.importPath=z(e,s.filePath),n.displayFilePath=s.displayFilePath,n.exportType=s.exportType;let u=await wa(e,s.filePath);if(u&&u.length>0)if(u.length===1)n.exportName=u[0].cmpInfo.exportName;else{let l=u.find(c=>c.cmpInfo.exportName===o);l&&(n.exportName=l.cmpInfo.exportName)}continue}}return n=De(e,n,r),n.filePath&&n.exportName&&(n.id=await q(e,n.filePath,n.exportName)),n}async function Ta(e){let t=new Set,r=async i=>{let a=await e.readdir(i);await Promise.all(a.map(async o=>{if(o.startsWith(".")||o==="node_modules")return;let s=e.join(i,o),u=e.extname(o).toLowerCase();if(u===".tsx"||u===".ts"){t.add(s);return}(await e.stat(s)).isDirectory()&&await r(s)}))};return await r(e.getAppRootDir()),await Z(e,[...t])}async function St(e,t,r,n,i,a,o,s){let u=await Ta(e),[l,c,p]=await Promise.all([va(e,u),Pa(e),un(e)]),m=l.map(d=>d.cmpInfo),h=c.components,D={components:Re(m,h),registryPath:e.registryPath,registryDisplayPath:M(e,e.registryPath),frameworks:e.getFrameworks(),dependencies:je(m),publicApiKey:p.envValue??void 0,devToolsVersion:e.version};if(s)return D;if(t!=null){let d=l.find(w=>w.cmpInfo.id===t);if(!d)throw new Error(`Component ${t} not found`);let g=c.sourceFile,f=D.components.find(w=>w.id===t),x=await ba(e,d);Fe(f,x),t=Array.isArray(t)?t[0]:t;let y=ze(t,m,h,r,n,i,a),{elements:S,elmIndex:v,statementIndex:F,statement:B,variableDeclaration:U}=await $c(e,g,d),T=!1;if(y.addCmpToRegistry?(S.push(kc(e,y.addCmpToRegistry)),T=!0):y.removeCmpFromRegistry?(S.splice(v,1),T=!0):y.updateRegisteredCmp&&(S[v]=ee(e,S[v],y.updateRegisteredCmp),T=!0),T&&o){let w=[...g.statements];w[F]=e.ts.factory.updateVariableStatement(B,B.modifiers,e.ts.factory.updateVariableDeclarationList(B.declarationList,[e.ts.factory.updateVariableDeclaration(U,U.name,U.exclamationToken,U.type,e.ts.factory.createArrayLiteralExpression(Ve(e,S)))])),g=e.ts.factory.updateSourceFile(g,w),f.exportType==="named"?g=$(e,g,{namedImports:[f.importName],importPath:O(e,e.registryPath,f.filePath)}):g=$(e,g,{defaultImport:f.importName,importPath:O(e,e.registryPath,f.filePath)}),g=$(e,g,{namedImports:["RegisteredComponent"],importPath:"@builder.io/sdk-qwik",isTypeOnly:!0}),g=qe(e,g,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),g=Ke(e,g),g=Ue(e,g);let b=te(e,g);b=Be(b),b=ya(b,Lc,"CUSTOM_COMPONENTS"),b=await e.formatCode(e.registryPath,b),await e.writeFile(e.registryPath,b)}D.components=y.components}return D}function kc(e,t){return ee(e,e.ts.factory.createObjectLiteralExpression([e.ts.factory.createPropertyAssignment("component",e.ts.factory.createIdentifier(t.importName))],!0),t)}async function $c(e,t,r){let n=X(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)),a=-1;for(let o=0;o<i.length;o++)if((await Kr(e,t,i[o]))?.id===r.cmpInfo.id){a=o;break}return{...n,elements:i,elmIndex:a}}var Lc=["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 Ia(e){let t=await Oc(e);return{builderPageOptions:async()=>({templateContentId:"dc70f1d979ad416d8fd357137eb9ddfb",pathname:"/",title:"Builder + Qwik Demo Page"}),ensureBuilderSetup:()=>Aa(t),ensureFigmaImportPage:async()=>[],getRegistryPath:()=>t.registryPath,getRegistry:n=>St(t,null,!1,!1,null,null,!1,!!n?.readAllInputTypes),addExternalPackage:async n=>{},loadComponent:async n=>{let i=await St(t,n.cmpId,!1,!1,null,null,!1,!1);return{...i,component:i.components.find(a=>a.id===n.cmpId)}},registerComponent:n=>St(t,n.cmpId,!0,!1,null,null,!0,!1),setRegisteredComponentInfo:n=>St(t,n.cmpId,!1,!1,n,null,!0,!1),setRegisteredComponentInput:n=>St(t,n.cmpId,!1,!1,null,n,!0,!1),unregisterComponent:n=>St(t,n.cmpId,!1,!0,null,null,!0,!1),getPublicApiKey:()=>un(t),setPublicApiKey:n=>Ea(t,n.publicApiKey),getDependencies:n=>[{name:"@builder.io/dev-tools"},{name:"@builder.io/sdk-qwik"}],getDevRunCommand:()=>"dev",getCache:()=>Le(t),setCache:n=>Oe(t,n)}}async function Oc(e){let t=await Qt(e,e.getAppRootDir(),"components");if(!t)throw new Error(`Could not find components directory within project: ${e.getAppRootDir()}`);let r=await Se(e,t),n=e.join(e.getAppRootDir(),".env");return{...e,componentsDir:t,registryPath:r,envPath:n}}async function ln(e){return await ut(e,[".env"],cn)}async function Ba(e,t){let r=await ln(e),n=await lt(e,r.file,r.envKey,t);return{...r,modifiedType:n}}var cn="PUBLIC_BUILDER_KEY";var _c=new Set(["dist","node_modules"]);async function Ra(e,t){let r=[],n=t.getSourceFiles(),i=t.getTypeChecker(),a=e.join(e.getAppRootDir(),"build");return await Promise.all(n.map(async o=>{let s=e.basename(o.fileName);if(s.startsWith(".")||s==="node_modules"||Pn(e,_c,o.fileName)||Mc.has(s)||s.includes("$."))return;let u=e.normalize(o.fileName);if(u===e.remixConfigPath||u===a)return;let l=await ct(e,i,u,o,u===e.registryPath);r.push(...l)})),r}var Mc=new Set(["root.tsx","root.ts","root.jsx","root.js","_index.tsx","_index.jsx","_index.ts","_index.js"]);async function Na(e){await jn(e);let t=await e.readFile(e.registryPath);return t?jc(e,t):{components:[],sourceFile:k(e,"")}}async function jc(e,t){let r=k(e,t);return Uc(e,r)}async function Uc(e,t){let r=[],n=X(e,t,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(i,a)=>{let o=await zr(e,t,i);o&&(o.nodeIndex=a,r.push(o))})),{sourceFile:t,components:de(r)}}async function zr(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===A.gen2&&Ot(e,r)&&(n.acceptsChildren=!0);for(let i of r.properties){if(!e.ts.isPropertyAssignment(i)||!e.ts.isIdentifier(i.name))continue;if(j(e,i)==="component"){let o,{initializer:s}=i;if(e.ts.isIdentifier(s))o=s.text;else if(e.ts.isCallExpression(s)){(e.ts.isIdentifier(s.expression)&&s.expression.text)==="withChildren"&&(n.acceptsChildren=!0);let c=s.arguments[0];e.ts.isIdentifier(c)&&(o=c.text)}if(!o)continue;n.name===""&&(n.name=W(o)),n.importName=o;let u=await Me(e,e.registryPath,t,o);if(!u)continue;if(n.filePath=u.filePath,n.relFilePath=u.relFilePath,await e.exists(u.filePath)?n.importPath=z(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 l=await Zi(e,u.filePath,e.registryPath===u.filePath||he(u.filePath));if(l&&l.length>0)if(l.length===1)n.exportName=l[0].cmpInfo.exportName;else{let c=l.find(p=>p.cmpInfo.exportName===o);c&&(n.exportName=c.cmpInfo.exportName)}}continue}}return n=De(e,n,r),n.filePath&&n.exportName&&(n.id=await q(e,n.filePath,n.exportName,n.externalImportPath)),n}async function Je(e,t,r,n,i,a,o,s){let u=await pt(e),[l,c,p]=await Promise.all([Ra(e,u),Na(e),ln(e)]),m=l.map(x=>x.cmpInfo),h=c.components,D={components:Re(m,h),registryPath:e.registryPath,registryDisplayPath:M(e,e.registryPath),frameworks:e.getFrameworks(),dependencies:je(m),publicApiKey:p.envValue??void 0,devToolsVersion:e.version};if(s)return D.components=await jt(e,D.components),D;let d=!1,g=c.sourceFile,f=Array.isArray(t)?t:typeof t=="string"?[t]:[];if(f.length>0){let x=f.map(v=>{let F=l.find(B=>B.cmpInfo.id===v);if(!F)throw new Error(`Component ${v} not found`);return F}),y=Array.from(new Set(x.map(v=>v.cmpInfo.filePath))),S=await Z(e,y);for(let v of x){let F=D.components.find(V=>V.id===v.cmpInfo.id),B=await Ut(e,v,S,e.registryPath===v.cmpInfo.filePath||he(v.cmpInfo.filePath));Fe(F,B);let U=m.findIndex(V=>V.id===v.cmpInfo.id);m[U].inputs=B;let T=ze(v.cmpInfo.id,m,h,r,n,i,a),{elements:w,elmIndex:b,statementIndex:ce,statement:Pe,variableDeclaration:oe}=await Kc(e,g,v);if(T.addCmpToRegistry)w.push(Vc(e,T.addCmpToRegistry)),d=!0;else if(T.removeCmpFromRegistry)w.splice(b,1),d=!0;else if(T.updateRegisteredCmp){let V=ee(e,w[b],T.updateRegisteredCmp);w[b]=e.ts.factory.updateObjectLiteralExpression(V,[ka(e,T.updateRegisteredCmp),...V.properties.slice(1)]),d=!0}if(d&&o){let V=[...g.statements];V[ce]=e.ts.factory.updateVariableStatement(Pe,Pe.modifiers,e.ts.factory.updateVariableDeclarationList(Pe.declarationList,[e.ts.factory.updateVariableDeclaration(oe,oe.name,oe.exclamationToken,oe.type,e.ts.factory.createArrayLiteralExpression(Ve(e,w)))])),g=e.ts.factory.updateSourceFile(g,V),F.exportType==="named"?g=$(e,g,{namedImports:[F.importName],importPath:F.externalImportPath?F.externalImportPath:O(e,e.registryPath,F.filePath)}):g=$(e,g,{defaultImport:F.importName,importPath:F.externalImportPath?F.externalImportPath:O(e,e.registryPath,F.filePath)});let pe=e.sdkVersion===A.gen2?"@builder.io/sdk-react":"@builder.io/react";g=$(e,g,{namedImports:["RegisteredComponent"],importPath:pe,isTypeOnly:!0}),F.acceptsChildren&&e.sdkVersion!==A.gen2&&(g=$(e,g,{namedImports:["withChildren"],importPath:"@builder.io/react"})),g=qe(e,g,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),D.components=T.components,h=T.components.filter(ht=>ht.isRegistered)}}}if(d&&o){g=Ke(e,g),g=Ue(e,g);let x=te(e,g);x=Be(x),x=await e.formatCode(e.registryPath,x),await e.writeFile(e.registryPath,x)}return D}function ka(e,t){if(e.sdkVersion===A.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 Vc(e,t){return ee(e,e.ts.factory.createObjectLiteralExpression([ka(e,t),...t.acceptsChildren&&e.sdkVersion===A.gen2?[e.ts.factory.createPropertyAssignment("canHaveChildren",e.ts.factory.createTrue())]:[]],!0),t)}async function Kc(e,t,r){let n=X(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)),a=-1;for(let o=0;o<i.length;o++)if((await zr(e,t,i[o]))?.id===r.cmpInfo.id){a=o;break}return{...n,elements:i,elmIndex:a}}async function $a(e){let t=[],r=await Wc(e,t);return t.push(...await jn(e)),await Hc(e,r),await qc(e,t),t}async function La(e){let t=[];return t.push(...await jn(e)),await zc(e,t),t}async function zc(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 a=await e.formatCode(n,Oa({sys:e,routePath:n,modelName:"figma-imports"}));await e.writeFile(n,a),t.push({filePath:n,modifiedType:i?"update":"create"})}async function qc(e,t){let r=`$.${e.typescriptEnabled?"tsx":"jsx"}`;e.hasLocaleParam&&(e.debug("remixEnsureAppRoute, hasLocaleParam"),r=`($locale).${r}`),e.sdkVersion===A.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 a=await e.formatCode(n,Oa({sys:e,routePath:n,modelName:"page"}));await e.writeFile(n,a),t.push({filePath:n,modifiedType:i?"update":"create"})}function Oa({sys:e,routePath:t,modelName:r}){let n=e.typescriptEnabled,i=O(e,t,e.registryPath),a="",o="";n&&(a="import type { LoaderArgs } from '@remix-run/server-runtime';",o=": LoaderArgs");let s=`process.env.${cn}`,u="";return e.getFrameworks().some(l=>l.name==="@shopify/remix-oxygen")&&(s=`context.env.${cn}`,u=", context"),n&&(s+="!"),e.sdkVersion===A.gen2?`
|
|
660
660
|
|
|
661
661
|
import {
|
|
662
662
|
Content,
|
|
@@ -766,7 +766,7 @@ declare global {
|
|
|
766
766
|
}
|
|
767
767
|
}
|
|
768
768
|
`:""}
|
|
769
|
-
`}async function
|
|
769
|
+
`}async function Wc(e,t){let n=e.typescriptEnabled?"tsx":"jsx",i=e.join(e.componentsDir,"Counter"),a=e.join(i,`Counter.${n}`),o=e.join(i,"styles.module.css"),{component:s,styles:u}=Jc(e),l=await e.exists(a);if(e.debug(`remixEnsureCounterComponent, hasCounterCmp: ${l}`),!l){let p=await e.formatCode(a,s);await e.writeFile(a,p),t.push({filePath:a,modifiedType:"create"})}let c=await e.exists(o);return e.debug(`remixEnsureCounterComponent, hasCounterStyles: ${c}`),c||(await e.writeFile(o,u),t.push({filePath:o,modifiedType:"create"})),a}function Jc(e){let t=e.typescriptEnabled,r=`
|
|
770
770
|
import { useState } from "react";
|
|
771
771
|
import styles from "./styles.module.css";
|
|
772
772
|
${t?`
|
|
@@ -829,17 +829,17 @@ export default Counter;
|
|
|
829
829
|
font-size: 42px;
|
|
830
830
|
text-align: center;
|
|
831
831
|
}
|
|
832
|
-
`.trimStart();return{component:r,styles:n}}async function
|
|
832
|
+
`.trimStart();return{component:r,styles:n}}async function Hc(e,t){let n=(await Je(e,null,!1,!1,null,null,!1,!1)).components.find(i=>i.filePath===t);n&&await Je(e,n.id,!0,!1,null,null,!0,!1)}async function jn(e){let t=[];return await e.exists(e.registryPath)||(await e.writeFile(e.registryPath,Gc(e)),t.push({filePath:e.registryPath,modifiedType:"create"})),t}function Gc(e){let t=e.sdkVersion===A.gen2;return e.typescriptEnabled?`import type { RegisteredComponent } from ${t?'"@builder.io/sdk-react"':'"@builder.io/react"'};
|
|
833
833
|
|
|
834
834
|
export const CUSTOM_COMPONENTS: RegisteredComponent[] = [
|
|
835
835
|
];`:`export const CUSTOM_COMPONENTS = [
|
|
836
836
|
];
|
|
837
|
-
`}async function
|
|
837
|
+
`}async function _a(e){let t=await Qc(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:()=>$a(t),ensureFigmaImportPage:()=>La(t),getRegistryPath:()=>t.registryPath,getRegistry:n=>Je(t,null,!1,!1,null,null,!1,!!n?.readAllInputTypes),addExternalPackage:n=>{t.addExternalPackage(n)},loadComponent:async n=>{let i=await Je(t,n.cmpId,!1,!1,null,null,!1,!1);return{...i,component:i.components.find(a=>a.id===n.cmpId)}},registerComponent:n=>Je(t,n.cmpId,!0,!1,null,null,!0,!1),setRegisteredComponentInfo:n=>Je(t,n.cmpId,!1,!1,n,null,!0,!1),setRegisteredComponentInput:n=>Je(t,n.cmpId,!1,!1,null,n,!0,!1),unregisterComponent:n=>Je(t,n.cmpId,!1,!0,null,null,!0,!1),getPublicApiKey:()=>ln(t),setPublicApiKey:n=>Ba(t,n.publicApiKey),getDependencies:n=>n.sdkVersion===A.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:()=>Le(t),setCache:n=>Oe(t,n)}}async function Qc(e){let t=await Xc(e),r=e.getAppRootDir(),n=await Zc(e),i=e.dirname(n),a=e.join(i,"components"),o=await xe(e),s=await Se(e,i),u={},l={...e,registryPath:s,remixConfigPath:t,typescriptEnabled:o,appDir:i,componentsDir:a,routesDir:n,hasLocaleParam:await Yc(e,n),addExternalPackage:c=>{u[e.join(r,c,"index.ts")]=`export * from "${c}";`},readFileSync:c=>u[c]??e.readFileSync(c),existsSync:c=>!!u[c]||e.existsSync(c),readdirSync:c=>{let p=e.readdirSync(c);return c===r?[...p,...Object.keys(u).map(m=>m.slice(r.length+1))]:p},readdir:async c=>{let p=await e.readdir(c);return c===r?[...p,...Object.keys(u).map(m=>m.slice(r.length+1))]:p}};return e.sdkVersion?l.sdkVersion=e.sdkVersion:l.sdkVersion=await Kt(l),l}async function Yc(e,t){return(await e.readdir(t)).some(n=>n.startsWith("($locale)."))}async function Xc(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 Zc(e){let t=await Qt(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 pn(e){let t=[".env"],r=e.configType==="vite"?mn:Un;return await ut(e,t,r)}async function Ma(e,t){let r=await pn(e),n=await lt(e,r.file,r.envKey,t);return{...r,modifiedType:n}}var mn="VITE_PUBLIC_BUILDER_KEY",Un="PUBLIC_BUILDER_KEY";function ja(e,t){let r=`Builder.registerComponent(
|
|
838
838
|
`;r+=` ${t.importName},
|
|
839
839
|
`,r+=` {
|
|
840
840
|
name: "${t.name}",
|
|
841
841
|
}
|
|
842
|
-
`,r+=");";let n=An(e,r);return
|
|
842
|
+
`,r+=");";let n=An(e,r);return qr(e,n,t)}function qr(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 a=i[1];return e.ts.isObjectLiteralExpression(a)?(i[1]=ee(e,a,r),e.ts.factory.updateExpressionStatement(t,e.ts.factory.updateCallExpression(n,n.expression,n.typeArguments,i))):t}async function Ua(e){let t=await e.readFile(e.registryPath);return t?ep(e,t):{components:[],sourceFile:k(e,"")}}async function ep(e,t){let r=k(e,t);return e.sdkVersion===A.gen2?rp(e,r):tp(e,r)}async function tp(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 a=i.expression;if(!e.ts.isCallExpression(a))continue;let o=a.expression;if(!e.ts.isPropertyAccessExpression(o))continue;let s=o.expression;if(!e.ts.isIdentifier(s)||s.text!=="Builder"||o.name.text!=="registerComponent")continue;let l=a.arguments;if(l.length<2)continue;let c=l[1];if(!e.ts.isObjectLiteralExpression(c))continue;let p=l[0];if(e.ts.isIdentifier(p)){let m=await np(e,t,n,p,c,!1);m&&r.push(m);continue}}return{sourceFile:t,components:de(r)}}async function np(e,t,r,n,i,a){let o={id:"",name:"",displayFilePath:"",exportName:"",importName:"",filePath:"",relFilePath:"",importPath:"",inputs:[],nodeIndex:r,acceptsChildren:a,framework:"react"},s=t.statements.filter(l=>e.ts.isImportDeclaration(l)),u=s.find(l=>l.importClause&&l.importClause.name?.text===n.text);if(u){let l=u.moduleSpecifier;if(!e.ts.isStringLiteral(l))return null;o.filePath=await Wr(e,l.text),o.relFilePath=e.relative(e.getAppRootDir(),o.filePath),o.importPath=z(e,o.filePath),o.name=ye(e,o.filePath),o.importName=n.text,o.exportName="default",o.exportType="default"}else{let l=s.find(m=>!m.importClause||!m.importClause.namedBindings||!e.ts.isNamedImports(m.importClause.namedBindings)?!1:m.importClause.namedBindings.elements.some(h=>h.name.text===n.text));if(!l)return null;let c=l.moduleSpecifier;if(!e.ts.isStringLiteral(c))return null;let p=await Wr(e,c.text);o.filePath=await Wr(e,c.text),o.relFilePath=e.relative(e.getAppRootDir(),o.filePath),await e.exists(p)?o.importPath=z(e,o.filePath):(o.externalImportPath=c.text,o.importPath=o.externalImportPath),o.name=W(n.text),o.importName=n.text,o.exportName=n.text,o.exportType="named"}return o=De(e,o,i),o.displayFilePath=M(e,o.filePath),o.filePath&&o.exportName&&(o.id=await q(e,o.filePath,o.exportName,o.externalImportPath)),o}function Wr(e,t){return sn(e,e.normalize(e.resolve(e.dirname(e.registryPath),t)))}async function rp(e,t){let r=[],n=X(e,t,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(i,a)=>{let o=await Jr(e,t,i);o&&(o.nodeIndex=a,r.push(o))})),{sourceFile:t,components:de(r)}}async function Jr(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"};Ot(e,r)&&(n.acceptsChildren=!0);for(let a of r.properties){if(!e.ts.isPropertyAssignment(a)||!e.ts.isIdentifier(a.name))continue;if(j(e,a)==="component"){let s,{initializer:u}=a;if(e.ts.isIdentifier(u)&&(s=u.text),!s)continue;n.name===""&&(n.name=W(s)),n.importName=s;let l=await Me(e,e.registryPath,t,s);if(!l)continue;n.filePath=l.filePath,n.relFilePath=l.relFilePath,await e.exists(l.filePath)?n.importPath=z(e,l.filePath):(n.externalImportPath=l.importPath,n.importPath=n.externalImportPath),n.displayFilePath=l.displayFilePath,n.exportType=l.exportType;let c=t.statements.filter(m=>e.ts.isImportDeclaration(m)),p=c.find(m=>m.importClause&&m.importClause.name?.text===s);if(p){let m=p.moduleSpecifier;if(!e.ts.isStringLiteral(m))return null;n.exportName="default"}else{let m=c.find(D=>!D.importClause||!D.importClause.namedBindings||!e.ts.isNamedImports(D.importClause.namedBindings)?!1:D.importClause.namedBindings.elements.some(d=>d.name.text===s));if(!m)return null;let h=m.moduleSpecifier;if(!e.ts.isStringLiteral(h))return null;n.exportName=s}continue}}return n=De(e,n,r),n.filePath&&n.exportName&&(n.id=await q(e,n.filePath,n.exportName,n.externalImportPath)),n}async function He(e,t,r,n,i,a,o,s){let u=await pt(e),[l,c,p,m]=await Promise.all([ea(e,u),Ua(e),xe(e),pn(e)]),h=l.map(y=>y.cmpInfo),D=c.components,d={components:Re(h,D),registryPath:e.registryPath,registryDisplayPath:M(e,e.registryPath),frameworks:e.getFrameworks(),dependencies:je(h),publicApiKey:m.envValue??void 0,devToolsVersion:e.version};if(s)return d.components=await jt(e,d.components),d;let g=!1,f=c.sourceFile,x=Array.isArray(t)?t:typeof t=="string"?[t]:[];if(x.length>0){let y=x.map(F=>{let B=l.find(U=>U.cmpInfo.id===F);if(!B)throw new Error(`Component ${F} not found`);return B}),S=Array.from(new Set(y.map(F=>F.cmpInfo.filePath))),v=await Z(e,S);for(let F of y){let B=d.components.find(b=>b.id===F.cmpInfo.id),U=await Ut(e,F,v,e.registryPath===F.cmpInfo.filePath||he(F.cmpInfo.filePath));Fe(B,U);let T=h.findIndex(b=>b.id===F.cmpInfo.id);h[T].inputs=U;let w=ze(F.cmpInfo.id,h,D,r,n,i,a);if(e.sdkVersion===A.gen2){let{elements:b,elmIndex:ce,statementIndex:Pe,statement:oe,variableDeclaration:V}=await op(e,f,F);if(w.addCmpToRegistry)b.push(ip(e,w.addCmpToRegistry)),g=!0;else if(w.removeCmpFromRegistry)b.splice(ce,1),g=!0;else if(w.updateRegisteredCmp){let pe=ee(e,b[ce],w.updateRegisteredCmp),ht=e.ts.factory.createIdentifier(w.updateRegisteredCmp.importName);b[ce]=e.ts.factory.updateObjectLiteralExpression(pe,[e.ts.factory.createPropertyAssignment("component",ht),...pe.properties.slice(1)]),g=!0}if(g&&o){let pe=[...f.statements];pe[Pe]=e.ts.factory.updateVariableStatement(oe,oe.modifiers,e.ts.factory.updateVariableDeclarationList(oe.declarationList,[e.ts.factory.updateVariableDeclaration(V,V.name,V.exclamationToken,V.type,e.ts.factory.createArrayLiteralExpression(Ve(e,b)))])),f=e.ts.factory.updateSourceFile(f,pe),f=Va(e,w,f),f=$(e,f,{namedImports:["RegisteredComponent"],importPath:"@builder.io/sdk-react",isTypeOnly:!0}),f=qe(e,f,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),d.components=w.components,D=w.components.filter(ht=>ht.isRegistered)}}else{let b=[...f.statements];w.addCmpToRegistry?(b.push(ja(e,w.addCmpToRegistry)),g=!0):w.removeCmpFromRegistry?(b.splice(w.nodeIndex,1),g=!0):w.updateRegisteredCmp&&(b[w.nodeIndex]=qr(e,b[w.nodeIndex],w.updateRegisteredCmp),g=!0),g&&o&&(f=e.ts.factory.updateSourceFile(f,b),f=$(e,f,{namedImports:["Builder","builder"],importPath:"@builder.io/react"}),f=Va(e,w,f),B?.acceptsChildren&&(f=$(e,f,{namedImports:["withChildren"],importPath:"@builder.io/react"})),d.components=w.components,D=w.components.filter(ce=>ce.isRegistered))}}}if(g&&o){f=Ke(e,f),f=Ue(e,f);let y=te(e,f);y=Be(y),y=await e.formatCode(e.registryPath,y),await e.writeFile(e.registryPath,y)}return d}async function op(e,t,r){let n=X(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)),a=-1;for(let o=0;o<i.length;o++)if((await Jr(e,t,i[o]))?.id===r.cmpInfo.id){a=o;break}return{...n,elements:i,elmIndex:a}}function ip(e,t){let r=e.ts.factory.createIdentifier(t.importName);return ee(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 Va(e,t,r){let n=t.addCmpToRegistry||t.updateRegisteredCmp;if(n){let i=n.externalImportPath?n.externalImportPath:O(e,e.registryPath,n.filePath);n.exportType==="default"?r=$(e,r,{defaultImport:n.importName,importPath:i}):n.exportType==="named"&&(r=$(e,r,{namedImports:[n.importName],importPath:i}))}return r}async function Ka(e){let t=[],r=await ap(e,t);if(await Wa(e,t,r),!await e.exists(e.builderComponentPath)){let n=await e.formatCode(e.builderComponentPath,qa(e,e.builderComponentPath));await e.writeFile(e.builderComponentPath,n),t.push({filePath:e.builderComponentPath,modifiedType:"create"})}return t}async function za(e){let t=[];await Wa(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,qa(e,n,"figma-imports"));await e.writeFile(n,i),t.push({filePath:n,modifiedType:"create"})}return t}function qa(e,t,r="page"){let n=e.typescriptEnabled;return e.sdkVersion===A.gen2?`
|
|
843
843
|
import React from "react";
|
|
844
844
|
import {
|
|
845
845
|
Content,
|
|
@@ -848,10 +848,10 @@ export const CUSTOM_COMPONENTS: RegisteredComponent[] = [
|
|
|
848
848
|
isPreviewing,
|
|
849
849
|
${n?"type BuilderContent,":""}
|
|
850
850
|
} from "@builder.io/sdk-react";
|
|
851
|
-
import { CUSTOM_COMPONENTS } from ${JSON.stringify(
|
|
851
|
+
import { CUSTOM_COMPONENTS } from ${JSON.stringify(O(e,t,e.registryPath))};
|
|
852
852
|
|
|
853
853
|
// Builder Public API Key set in .env file
|
|
854
|
-
const BUILDER_API_KEY = ${e.configType==="vite"?`import.meta.env.${mn};`:`${
|
|
854
|
+
const BUILDER_API_KEY = ${e.configType==="vite"?`import.meta.env.${mn};`:`${Un};`}
|
|
855
855
|
const MODEL_NAME = "${r}";
|
|
856
856
|
|
|
857
857
|
export default function BuilderPage() {
|
|
@@ -901,10 +901,10 @@ export const CUSTOM_COMPONENTS: RegisteredComponent[] = [
|
|
|
901
901
|
`:`
|
|
902
902
|
import React from "react";
|
|
903
903
|
import { BuilderComponent, builder, useIsPreviewing } from "@builder.io/react";
|
|
904
|
-
import ${JSON.stringify(
|
|
904
|
+
import ${JSON.stringify(O(e,t,e.registryPath))};
|
|
905
905
|
|
|
906
906
|
// Builder Public API Key set in .env file
|
|
907
|
-
${e.configType==="vite"?`builder.init(import.meta.env.${mn}${n?"!":""})`:`builder.init("${
|
|
907
|
+
${e.configType==="vite"?`builder.init(import.meta.env.${mn}${n?"!":""})`:`builder.init("${Un}")`}
|
|
908
908
|
|
|
909
909
|
export default function BuilderPage() {
|
|
910
910
|
const isPreviewingInBuilder = useIsPreviewing();
|
|
@@ -949,7 +949,7 @@ export default function BuilderPage() {
|
|
|
949
949
|
</>
|
|
950
950
|
);
|
|
951
951
|
}
|
|
952
|
-
`.trimStart()}async function
|
|
952
|
+
`.trimStart()}async function Wa(e,t,r){if(!await e.exists(e.registryPath)){if(e.sdkVersion===A.gen2){let a=up(e);await e.writeFile(e.registryPath,a)}else await e.writeFile(e.registryPath,"");t.push({filePath:e.registryPath,modifiedType:"create"})}if(!r)return;let i=(await He(e,null,!1,!1,null,null,!1,!1)).components.find(a=>a.filePath===r);i&&await He(e,i.id,!0,!1,null,null,!0,!1)}async function ap(e,t){let n=e.typescriptEnabled?"tsx":"jsx",i=e.join(e.componentsDir,"Counter"),a=e.join(i,`Counter.${n}`),o=e.join(i,"styles.module.css"),{component:s,styles:u}=sp(e);if(!await e.exists(a)){let l=await e.formatCode(a,s);await e.writeFile(a,l),t.push({filePath:a,modifiedType:"create"})}return await e.exists(o)||(await e.writeFile(o,u),t.push({filePath:o,modifiedType:"create"})),a}function sp(e){let t=e.typescriptEnabled,r=`
|
|
953
953
|
"use client"
|
|
954
954
|
import React, { useState } from "react";
|
|
955
955
|
import styles from "./styles.module.css";
|
|
@@ -1012,18 +1012,18 @@ export default Counter;
|
|
|
1012
1012
|
font-size: 42px;
|
|
1013
1013
|
text-align: center;
|
|
1014
1014
|
}
|
|
1015
|
-
`.trimStart();return{component:r,styles:n}}function
|
|
1015
|
+
`.trimStart();return{component:r,styles:n}}function up(e){return e.typescriptEnabled?`import type { RegisteredComponent } from "@builder.io/sdk-react";
|
|
1016
1016
|
|
|
1017
1017
|
export const CUSTOM_COMPONENTS: RegisteredComponent[] = [
|
|
1018
1018
|
];`:`export const CUSTOM_COMPONENTS = [
|
|
1019
1019
|
];
|
|
1020
|
-
`}async function
|
|
1020
|
+
`}async function Ja(e){let t=await lp(e);return{builderPageOptions:async()=>({templateContentId:"2e36438034894a8abf279ea9e6d3596f",pathname:"/builder-demo",title:"Builder + React Demo Page"}),ensureBuilderSetup:()=>Ka(t),ensureFigmaImportPage:()=>za(t),getRegistryPath:()=>t.registryPath,getRegistry:n=>He(t,null,!1,!1,null,null,!1,!!n?.readAllInputTypes),addExternalPackage:n=>{t.addExternalPackage(n)},loadComponent:async n=>{let i=await He(t,n.cmpId,!1,!1,null,null,!1,!1);return{...i,component:i.components.find(a=>a.id===n.cmpId)}},registerComponent:n=>He(t,n.cmpId,!0,!1,null,null,!0,!1),setRegisteredComponentInfo:n=>He(t,n.cmpId,!1,!1,n,null,!0,!1),setRegisteredComponentInput:n=>He(t,n.cmpId,!1,!1,null,n,!0,!1),unregisterComponent:n=>He(t,n.cmpId,!1,!0,null,null,!0,!1),getPublicApiKey:()=>pn(t),setPublicApiKey:n=>Ma(t,n.publicApiKey),getDependencies:n=>n.sdkVersion===A.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:()=>Le(t),setCache:n=>Oe(t,n)}}async function lp(e){let t=await cp(e),r=e.getAppRootDir(),n=e.join(r,"src"),i=await xe(e),a={},o={...e,srcDir:null,builderComponentPath:"",componentsDir:"",registryPath:"",reactConfigPath:t,typescriptEnabled:i,configType:"",addExternalPackage:s=>{a[e.join(r,s,"index.ts")]=`export * from "${s}";`},readFileSync:s=>a[s]??e.readFileSync(s),existsSync:s=>!!a[s]||e.existsSync(s),readdirSync:s=>{let u=e.readdirSync(s);return s===r?[...u,...Object.keys(a).map(l=>l.slice(r.length+1))]:u},readdir:async s=>{let u=await e.readdir(s);return s===r?[...u,...Object.keys(a).map(l=>l.slice(r.length+1))]:u}};return e.sdkVersion?o.sdkVersion=e.sdkVersion:o.sdkVersion=await Kt(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 Se(e,n),o.builderComponentPath=e.join(o.srcDir,`builder-page.${i?"tsx":"jsx"}`)):(o.componentsDir=e.join(r,"components"),o.registryPath=await Se(e,r),o.builderComponentPath=e.join(r,`builder-page.${i?"tsx":"jsx"}`)),o}async function cp(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 fn(e){return await pp(e,["environment.ts"],Vn)}async function Ha(e,t){let r=await fn(e),n=await Dp(e,r.file,r.envKey,t);return{...r,modifiedType:n}}async function pp(e,t,r){let n={envKey:r,envValue:null,file:""};for(let i of t){let a=e.join(e.getAppRootDir(),"src","environments",i),o=await mp(e,a);if(typeof o=="string"&&o.length>0&&o!=="YOUR_API_KEY")return n.envValue=o,n.file=a,n}return n.file=e.join(e.getAppRootDir(),"src","environments",t[t.length-1]),n}async function mp(e,t){let r=await e.readFile(t);return r?fp(e,r):""}function fp(e,t){let r=k(e,t),n="",a=_t(e,r,"environment");if(a&&a.statement.declarationList.declarations.length>0){let s=a.statement.declarationList.declarations[0].initializer;s&&e.ts.isObjectLiteralExpression(s)&&s.properties.forEach(u=>{e.ts.isPropertyAssignment(u)&&e.ts.isIdentifier(u.name)&&u.name.text===Vn&&e.ts.isStringLiteral(u.initializer)&&(n=u.initializer.text)})}return n}async function dp(e,t,r,n){let i=k(e,t),o=_t(e,i,"environment");if(o&&o.statement.declarationList.declarations.length>0){let s=o.statement.declarationList,u=s.declarations[0],l=u.initializer;if(l&&e.ts.isObjectLiteralExpression(l)){let c=e.ts.factory.createPropertyAssignment(e.ts.factory.createIdentifier(r),e.ts.factory.createStringLiteral(n)),p=e.ts.factory.createNodeArray([...l.properties,c]),m=e.ts.factory.updateObjectLiteralExpression(l,p),h=e.ts.factory.updateVariableDeclaration(u,u.name,u.exclamationToken,u.type,m),D=e.ts.factory.updateVariableDeclarationList(s,[h]);return e.ts.factory.updateVariableStatement(o.statement,o.statement.modifiers,D)}return null}return null}async function Dp(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 a=await dp(e,i,r,n);if(a){let o=te(e,a),s=await e.formatCode(t,o);await e.writeFile(t,s)}return"update"}else{e.debug(`Creating new env file with "${r}" at ${t}`);let a=`
|
|
1021
1021
|
// https://www.builder.io/c/docs/using-your-api-key
|
|
1022
1022
|
export const environment = {
|
|
1023
1023
|
production: false,
|
|
1024
1024
|
builderApiKey: "${n}",
|
|
1025
1025
|
};
|
|
1026
|
-
`.trimStart(),o=await e.formatCode(t,a);return await e.writeFile(t,o),"create"}return null}var Kn="builderApiKey";async function Ya(e,t){let r=[],n=t.getSourceFiles(),i=t.getTypeChecker();return await Promise.all(n.map(async a=>{let o=e.basename(a.fileName);if(xp(e,a.fileName)||o.startsWith(".")||o==="node_modules"||hp.has(o))return;let s=e.normalize(a.fileName);if(s===e.registryPath)return;let u=await zn(e,i,s,a);r.push(...u)})),r.sort((a,o)=>a.cmpInfo.name.localeCompare(o.cmpInfo.name))}var hp=new Set([]),Cp=new Set(["node_modules"]);function xp(e,t){for(let r of Cp)if(e.dirname(t).includes(r))return!0;return!1}async function Xa(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 Ep(e,t,n)}return null}function Ep(e,t,r){let n=N(e,r);return zn(e,null,t,n)}async function zn(e,t,r,n){let i=[],a={};r=e.normalize(r);let o=n.statements.filter(c=>e.ts.isClassDeclaration(c)&&vp(e,c)),s=n.statements.find(c=>e.ts.isImportDeclaration(c)&&e.ts.isStringLiteral(c.moduleSpecifier)&&c.moduleSpecifier.text==="@angular/core");if(s&&e.ts.isImportDeclaration(s)){let c=s.importClause?.namedBindings;if(c&&e.ts.isNamedImports(c)){let p=c.elements.find(m=>(m.propertyName??m.name).text==="input");p&&(a.inputSignalImportName=p.name.text)}}let u=await yp(e,t,r,n),l=bp(e,n);return await Promise.all(o.map(async c=>{let p=await Fp(e,t,r,c,l,a);i.push(...p)})),i.push(...u),i}async function Gr(e,t,r){if(t.node.fnNode){let{sourceFile:n,typeChecker:i}=await Bt(e,t.cmpInfo.filePath,r),o=(await zn(e,i,t.cmpInfo.filePath,n)).find(s=>s.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 Za(e,t,r){let n=await Z(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 s=n.getSourceFile(o.filePath);if(s){let l=(await zn(e,i,o.filePath,s)).find(c=>c.cmpInfo.id===o.id);if(l){o.inputs=Ft(e,i,l.node.fnNode);let c=t.find(p=>p.cmpInfo.id===o.id);if(c){let p=await Gr(e,c,n);ye(o,p)}}}}return o}))}async function Fp(e,t,r,n,i,a){let o=[],s=e.relative(e.getAppRootDir(),r),u=V(e,r),l=n.name?.text;if(!l)return o;let c=!1;n.modifiers&&(c=n.modifiers.some(d=>d.kind===e.ts.SyntaxKind.DefaultKeyword));let p=c?"default":l,m=c?"default":"named",g=[];return n.members.forEach(d=>{if(e.ts.isPropertyDeclaration(d)||e.ts.isGetAccessor(d)||e.ts.isSetAccessor(d)){let f=(e.ts.getDecorators(d)??[]).find(x=>Sp(e,x))!==void 0&&e.ts.isIdentifier(d.name),F=a?.inputSignalImportName!==void 0&&e.ts.isIdentifier(d.name)&&wp(e,d,a.inputSignalImportName);if(f||F){let x="any";if(e.ts.isSetAccessor(d))x=Qa(e,d.parameters[0].type);else if(d.type&&t){let S=t.getTypeAtLocation(d.type);x=t.typeToString(S)}else x=Qa(e,d.type);let w={name:d.name.text,type:i[x]?"string":x};i[x]&&(w.enum=i[x]),g.push(w)}}}),o.push({cmpInfo:{id:await K(e,r,l),displayFilePath:M(e,r),name:q(l),inputs:g,exportName:p,exportType:m,importName:l,filePath:r,relFilePath:s,importPath:u,meta:{...Pp(e,n)},framework:"angular"},node:{name:l,fnNode:n,deps:void 0}}),o}async function yp(e,t,r,n){let i=[],a=e.relative(e.getAppRootDir(),r),o=V(e,r);for(let s of n.statements)if(e.ts.isExportDeclaration(s)&&s.exportClause&&e.ts.isNamedExports(s.exportClause))for(let u of s.exportClause.elements){let l=u.name?.text;if(!l)continue;let c=l,p="named",m=[];if(t){let D=t.getSymbolAtLocation(u.name);if(D){let h=t.getDeclaredTypeOfSymbol(D);t.getPropertiesOfType(h).forEach(F=>{let x=F.getDeclarations();x&&x.forEach(w=>{if(e.ts.isPropertyDeclaration(w)){let S=t.getTypeAtLocation(w),y={name:F.getName(),type:Ap(e,t,S)};m.push(y)}})})}}let g=e.ts.isExportSpecifier(u)&&u.parent?u.parent.parent:void 0,d;if(g){let D=g.moduleSpecifier;if(D&&e.ts.isStringLiteral(D)){let h=t?.getSymbolAtLocation(D);if(h&&h.declarations&&h.declarations.length>0){let f=h.declarations[0];(!e.ts.isSourceFile(f)||e.ts.isSourceFile(f)&&f.fileName.includes("node_modules"))&&(d=D.text)}}}i.push({cmpInfo:{id:await K(e,r,l,d),displayFilePath:M(e,r),name:q(l),inputs:m,exportName:c,exportType:p,importName:l,filePath:r,relFilePath:a,importPath:d||o,externalImportPath:d,framework:"angular"},node:{name:l,fnNode:u,deps:void 0}})}return i}function Sp(e,t){return es(e,t,"Input")}function wp(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 es(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 vp(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 Qa(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 bp(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 Ap(e,t,r){let n=t.typeToString(r);if(n==="any"){let i=r.getSymbol();if(i){let a=i.getDeclarations();if(a&&a.length>0){let o=a[0];if(e.ts.isVariableDeclaration(o)){let s=o.type;s&&(n=t.typeToString(t.getTypeAtLocation(s)))}}}}return n}function Pp(e,t){let{getDecorators:r,isCallExpression:n,isIdentifier:i,isObjectLiteralExpression:a,isPropertyAssignment:o,isStringLiteral:s,SyntaxKind:u}=e.ts,l,c;return r(t)?.forEach(m=>{if(es(e,m,"Component")){let{expression:g}=m;if(n(g)){let[d]=g.arguments;a(d)&&d.properties.forEach(D=>{o(D)&&i(D.name)&&(D.name.escapedText==="selector"&&s(D.initializer)&&(l=D.initializer.text),D.name.escapedText==="standalone"&&(c=D.initializer.kind===u.TrueKeyword))})}}}),{selector:l,standalone:c}}async function qn(e,t,r){let n=e.typescriptEnabled?".ts":".js",i=`app.module${n}`,a=e.join(e.appDir,i),o=await e.readFile(a);if(!o){e.Sentry?.captureException(new Error(`Unable to read app.module.${n} at ${a}`),{extra:{appModuleCode:o,appModulePath:a}});return}let s=await Tp(e,a,t,r,o);if(!s){e.Sentry?.captureException(new Error(`Unable to update app.module.${n} at ${a}`),{extra:{appModuleCode:o,appModulePath:a}});return}return await e.writeFile(a,s),a}async function Tp(e,t,r,n,i){let a=i,o=N(e,i),s=_(e,t,n);o=$(e,o,{namedImports:[r],importPath:s}),o=$(e,o,{namedImports:["Content"],importPath:"@builder.io/sdk-angular"});let u=[];for(let l of o.statements)if(e.ts.isClassDeclaration(l)&&l.name?.text==="AppModule"){let c=Ip(e,r,l);u.push(c)}else u.push(l);return o=e.ts.factory.updateSourceFile(o,u),a=te(e,o),a}function Ip(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 a=i.expression.arguments;if(a.length===1&&e.ts.isObjectLiteralExpression(a[0])){let o=ts(e,a[0],"declarations",t);if(o){let s=ts(e,o,"imports","Content");if(s&&(o=s),o){let u=e.ts.factory.updateDecorator(i,e.ts.factory.updateCallExpression(i.expression,i.expression.expression,i.expression.typeArguments,[o])),c=[...n.map(p=>p===i?u:p),...e.ts.getModifiers(r)||[]];return e.ts.factory.updateClassDeclaration(r,c,r.name,r.typeParameters,r.heritageClauses,r.members)}}}}}return r}function ts(e,t,r,n){let i=[...t.properties],a=i.findIndex(s=>j(e,s)===r);if(a>-1){let s=i[a];if(e.ts.isPropertyAssignment(s)&&s.initializer&&e.ts.isArrayLiteralExpression(s.initializer)){let u=ns(e,s.initializer,n);return u?(i[a]=e.ts.factory.updatePropertyAssignment(s,s.name,u),e.ts.factory.updateObjectLiteralExpression(t,i)):null}return null}let o=ns(e,e.ts.factory.createArrayLiteralExpression([],!0),n);return o?e.ts.factory.updateObjectLiteralExpression(t,[...i,e.ts.factory.createPropertyAssignment(r,o)]):null}function ns(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 Qr(e,t,r,n){let a=`app.routes${e.typescriptEnabled?".ts":".js"}`,o=e.join(e.appDir,a);try{if(e.magicast){let s=await e.magicast.loadFile(o);Object.keys(s.exports).length===0&&(s.exports.routes=[]);let l=Object.keys(s.exports)[0],c=s.exports[l];if(c.find(m=>m.path===t))return;let p=e.magicast.builders.raw("{}");if(p.path=t,p.component=e.magicast.builders.raw(r),c.push(p),s.imports.$items.find(m=>m.imported===r))return;s.imports.$append({imported:r,from:n}),await e.magicast.writeFile(s,o)}}catch(s){let u=null;try{u=e.readFileSync(o)}catch(l){e.Sentry?.captureException(l,{level:"warning"})}e.Sentry?.captureException(s,{extra:{content:u,appRoutesPath:o,componentName:r,componentPath:n}})}}var ds=B(fs(),1);async function Ds(e){let t=e.ts.findConfigFile(e.getAppRootDir(),e.existsSync);if(t){let r=await e.readFile(t);if(!r)return;let n=ds.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 a=i.paths;(!a||typeof a!="object"||Array.isArray(a))&&(i.paths={},a=i.paths),Object.assign(i.paths,{"~/*":["./src/*"]}),await e.writeFile(t,JSON.stringify(n,null,2))}}async function gs(e){let t=[],r=await Up(e,t);t.push(...await Qn(e)),await Mp(e,r);let n="BuilderPage";if(!await e.exists(e.builderPageComponentPath)){let i=await e.formatCode(e.builderPageComponentPath,Cs(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 qn(e,"Counter",r);let i=await qn(e,n,e.builderPageComponentPath);i&&t.push({filePath:i,modifiedType:"update"})}return await Qr(e,"**",n,"./components/builder-page.component"),t}async function hs(e){let t=[];t.push(...await Qn(e));let r="FigmaImportsPage",n="figma-imports.component",i=e.join(e.componentsDir,`${n}.${e.typescriptEnabled?"ts":"js"}`);if(!await e.exists(i)){let a=await e.formatCode(i,Cs(e,r,i,"figma-imports","figma-imports",!1));await e.writeFile(i,a),t.push({filePath:i,modifiedType:"create"})}if(e.hasAppModule){let a=await qn(e,r,i);a&&t.push({filePath:a,modifiedType:"update"})}return await Qr(e,"figma-imports",r,`./components/${n}`),await Ds(e),t}async function Qn(e){let t=[];return await e.exists(e.registryPath)||(await e.writeFile(e.registryPath,jp(e)),t.push({filePath:e.registryPath,modifiedType:"create"})),t}async function Mp(e,t){let n=(await Qe(e,null,!1,!1,null,null,!1,!1)).components.find(i=>i.filePath===t);n&&await Qe(e,n.id,!0,!1,null,null,!0,!1)}function Cs(e,t,r,n,i,a){let o=!e.hasAppModule,s=_(e,r,e.registryPath),u=e.join(e.getAppRootDir(),"src","environments","environment.ts"),l=_(e,r,u),c=a?` <ng-container *ngIf="content || isPreviewing; else notFound">
|
|
1026
|
+
`.trimStart(),o=await e.formatCode(t,a);return await e.writeFile(t,o),"create"}return null}var Vn="builderApiKey";async function Qa(e,t){let r=[],n=t.getSourceFiles(),i=t.getTypeChecker();return await Promise.all(n.map(async a=>{let o=e.basename(a.fileName);if(Cp(e,a.fileName)||o.startsWith(".")||o==="node_modules"||gp.has(o))return;let s=e.normalize(a.fileName);if(s===e.registryPath)return;let u=await Kn(e,i,s,a);r.push(...u)})),r.sort((a,o)=>a.cmpInfo.name.localeCompare(o.cmpInfo.name))}var gp=new Set([]),hp=new Set(["node_modules"]);function Cp(e,t){for(let r of hp)if(e.dirname(t).includes(r))return!0;return!1}async function Ya(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 xp(e,t,n)}return null}function xp(e,t,r){let n=k(e,r);return Kn(e,null,t,n)}async function Kn(e,t,r,n){let i=[],a={};r=e.normalize(r);let o=n.statements.filter(c=>e.ts.isClassDeclaration(c)&&vp(e,c)),s=n.statements.find(c=>e.ts.isImportDeclaration(c)&&e.ts.isStringLiteral(c.moduleSpecifier)&&c.moduleSpecifier.text==="@angular/core");if(s&&e.ts.isImportDeclaration(s)){let c=s.importClause?.namedBindings;if(c&&e.ts.isNamedImports(c)){let p=c.elements.find(m=>(m.propertyName??m.name).text==="input");p&&(a.inputSignalImportName=p.name.text)}}let u=await Fp(e,t,r,n),l=wp(e,n);return await Promise.all(o.map(async c=>{let p=await Ep(e,t,r,c,l,a);i.push(...p)})),i.push(...u),i}async function Hr(e,t,r){if(t.node.fnNode){let{sourceFile:n,typeChecker:i}=await Bt(e,t.cmpInfo.filePath,r),o=(await Kn(e,i,t.cmpInfo.filePath,n)).find(s=>s.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 Xa(e,t,r){let n=await Z(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 s=n.getSourceFile(o.filePath);if(s){let l=(await Kn(e,i,o.filePath,s)).find(c=>c.cmpInfo.id===o.id);if(l){o.inputs=Ft(e,i,l.node.fnNode);let c=t.find(p=>p.cmpInfo.id===o.id);if(c){let p=await Hr(e,c,n);Fe(o,p)}}}}return o}))}async function Ep(e,t,r,n,i,a){let o=[],s=e.relative(e.getAppRootDir(),r),u=z(e,r),l=n.name?.text;if(!l)return o;let c=!1;n.modifiers&&(c=n.modifiers.some(D=>D.kind===e.ts.SyntaxKind.DefaultKeyword));let p=c?"default":l,m=c?"default":"named",h=[];return n.members.forEach(D=>{if(e.ts.isPropertyDeclaration(D)||e.ts.isGetAccessor(D)||e.ts.isSetAccessor(D)){let f=(e.ts.getDecorators(D)??[]).find(y=>yp(e,y))!==void 0&&e.ts.isIdentifier(D.name),x=a?.inputSignalImportName!==void 0&&e.ts.isIdentifier(D.name)&&Sp(e,D,a.inputSignalImportName);if(f||x){let y="any";if(e.ts.isSetAccessor(D))y=Ga(e,D.parameters[0].type);else if(D.type&&t){let v=t.getTypeAtLocation(D.type);y=t.typeToString(v)}else y=Ga(e,D.type);let S={name:D.name.text,type:i[y]?"string":y};i[y]&&(S.enum=i[y]),h.push(S)}}}),o.push({cmpInfo:{id:await q(e,r,l),displayFilePath:M(e,r),name:W(l),inputs:h,exportName:p,exportType:m,importName:l,filePath:r,relFilePath:s,importPath:u,meta:{...Ap(e,n)},framework:"angular"},node:{name:l,fnNode:n,deps:void 0}}),o}async function Fp(e,t,r,n){let i=[],a=e.relative(e.getAppRootDir(),r),o=z(e,r);for(let s of n.statements)if(e.ts.isExportDeclaration(s)&&s.exportClause&&e.ts.isNamedExports(s.exportClause))for(let u of s.exportClause.elements){let l=u.name?.text;if(!l)continue;let c=l,p="named",m=[];if(t){let d=t.getSymbolAtLocation(u.name);if(d){let g=t.getDeclaredTypeOfSymbol(d);t.getPropertiesOfType(g).forEach(x=>{let y=x.getDeclarations();y&&y.forEach(S=>{if(e.ts.isPropertyDeclaration(S)){let v=t.getTypeAtLocation(S),F={name:x.getName(),type:bp(e,t,v)};m.push(F)}})})}}let h=e.ts.isExportSpecifier(u)&&u.parent?u.parent.parent:void 0,D;if(h){let d=h.moduleSpecifier;if(d&&e.ts.isStringLiteral(d)){let g=t?.getSymbolAtLocation(d);if(g&&g.declarations&&g.declarations.length>0){let f=g.declarations[0];(!e.ts.isSourceFile(f)||e.ts.isSourceFile(f)&&f.fileName.includes("node_modules"))&&(D=d.text)}}}i.push({cmpInfo:{id:await q(e,r,l,D),displayFilePath:M(e,r),name:W(l),inputs:m,exportName:c,exportType:p,importName:l,filePath:r,relFilePath:a,importPath:D||o,externalImportPath:D,framework:"angular"},node:{name:l,fnNode:u,deps:void 0}})}return i}function yp(e,t){return Za(e,t,"Input")}function Sp(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 Za(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 vp(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 Ga(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 wp(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 bp(e,t,r){let n=t.typeToString(r);if(n==="any"){let i=r.getSymbol();if(i){let a=i.getDeclarations();if(a&&a.length>0){let o=a[0];if(e.ts.isVariableDeclaration(o)){let s=o.type;s&&(n=t.typeToString(t.getTypeAtLocation(s)))}}}}return n}function Ap(e,t){let{getDecorators:r,isCallExpression:n,isIdentifier:i,isObjectLiteralExpression:a,isPropertyAssignment:o,isStringLiteral:s,SyntaxKind:u}=e.ts,l,c;return r(t)?.forEach(m=>{if(Za(e,m,"Component")){let{expression:h}=m;if(n(h)){let[D]=h.arguments;a(D)&&D.properties.forEach(d=>{o(d)&&i(d.name)&&(d.name.escapedText==="selector"&&s(d.initializer)&&(l=d.initializer.text),d.name.escapedText==="standalone"&&(c=d.initializer.kind===u.TrueKeyword))})}}}),{selector:l,standalone:c}}async function zn(e,t,r){let n=e.typescriptEnabled?".ts":".js",i=`app.module${n}`,a=e.join(e.appDir,i),o=await e.readFile(a);if(!o){e.Sentry?.captureException(new Error(`Unable to read app.module.${n} at ${a}`),{extra:{appModuleCode:o,appModulePath:a}});return}let s=await Pp(e,a,t,r,o);if(!s){e.Sentry?.captureException(new Error(`Unable to update app.module.${n} at ${a}`),{extra:{appModuleCode:o,appModulePath:a}});return}return await e.writeFile(a,s),a}async function Pp(e,t,r,n,i){let a=i,o=k(e,i),s=O(e,t,n);o=$(e,o,{namedImports:[r],importPath:s}),o=$(e,o,{namedImports:["Content"],importPath:"@builder.io/sdk-angular"});let u=[];for(let l of o.statements)if(e.ts.isClassDeclaration(l)&&l.name?.text==="AppModule"){let c=Tp(e,r,l);u.push(c)}else u.push(l);return o=e.ts.factory.updateSourceFile(o,u),a=te(e,o),a}function Tp(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 a=i.expression.arguments;if(a.length===1&&e.ts.isObjectLiteralExpression(a[0])){let o=es(e,a[0],"declarations",t);if(o){let s=es(e,o,"imports","Content");if(s&&(o=s),o){let u=e.ts.factory.updateDecorator(i,e.ts.factory.updateCallExpression(i.expression,i.expression.expression,i.expression.typeArguments,[o])),c=[...n.map(p=>p===i?u:p),...e.ts.getModifiers(r)||[]];return e.ts.factory.updateClassDeclaration(r,c,r.name,r.typeParameters,r.heritageClauses,r.members)}}}}}return r}function es(e,t,r,n){let i=[...t.properties],a=i.findIndex(s=>j(e,s)===r);if(a>-1){let s=i[a];if(e.ts.isPropertyAssignment(s)&&s.initializer&&e.ts.isArrayLiteralExpression(s.initializer)){let u=ts(e,s.initializer,n);return u?(i[a]=e.ts.factory.updatePropertyAssignment(s,s.name,u),e.ts.factory.updateObjectLiteralExpression(t,i)):null}return null}let o=ts(e,e.ts.factory.createArrayLiteralExpression([],!0),n);return o?e.ts.factory.updateObjectLiteralExpression(t,[...i,e.ts.factory.createPropertyAssignment(r,o)]):null}function ts(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 Gr(e,t,r,n){let a=`app.routes${e.typescriptEnabled?".ts":".js"}`,o=e.join(e.appDir,a);try{if(e.magicast){let s=await e.magicast.loadFile(o);Object.keys(s.exports).length===0&&(s.exports.routes=[]);let l=Object.keys(s.exports)[0],c=s.exports[l];if(c.find(m=>m.path===t))return;let p=e.magicast.builders.raw("{}");if(p.path=t,p.component=e.magicast.builders.raw(r),c.push(p),s.imports.$items.find(m=>m.imported===r))return;s.imports.$append({imported:r,from:n}),await e.magicast.writeFile(s,o)}}catch(s){let u=null;try{u=e.readFileSync(o)}catch(l){e.Sentry?.captureException(l,{level:"warning"})}e.Sentry?.captureException(s,{extra:{content:u,appRoutesPath:o,componentName:r,componentPath:n}})}}var fs=R(ms(),1);async function ds(e){let t=e.ts.findConfigFile(e.getAppRootDir(),e.existsSync);if(t){let r=await e.readFile(t);if(!r)return;let n=fs.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 a=i.paths;(!a||typeof a!="object"||Array.isArray(a))&&(i.paths={},a=i.paths),Object.assign(i.paths,{"~/*":["./src/*"]}),await e.writeFile(t,JSON.stringify(n,null,2))}}async function Ds(e){let t=[],r=await jp(e,t);t.push(...await Gn(e)),await _p(e,r);let n="BuilderPage";if(!await e.exists(e.builderPageComponentPath)){let i=await e.formatCode(e.builderPageComponentPath,hs(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 zn(e,"Counter",r);let i=await zn(e,n,e.builderPageComponentPath);i&&t.push({filePath:i,modifiedType:"update"})}return await Gr(e,"**",n,"./components/builder-page.component"),t}async function gs(e){let t=[];t.push(...await Gn(e));let r="FigmaImportsPage",n="figma-imports.component",i=e.join(e.componentsDir,`${n}.${e.typescriptEnabled?"ts":"js"}`);if(!await e.exists(i)){let a=await e.formatCode(i,hs(e,r,i,"figma-imports","figma-imports",!1));await e.writeFile(i,a),t.push({filePath:i,modifiedType:"create"})}if(e.hasAppModule){let a=await zn(e,r,i);a&&t.push({filePath:a,modifiedType:"update"})}return await Gr(e,"figma-imports",r,`./components/${n}`),await ds(e),t}async function Gn(e){let t=[];return await e.exists(e.registryPath)||(await e.writeFile(e.registryPath,Mp(e)),t.push({filePath:e.registryPath,modifiedType:"create"})),t}async function _p(e,t){let n=(await Ge(e,null,!1,!1,null,null,!1,!1)).components.find(i=>i.filePath===t);n&&await Ge(e,n.id,!0,!1,null,null,!0,!1)}function hs(e,t,r,n,i,a){let o=!e.hasAppModule,s=O(e,r,e.registryPath),u=e.join(e.getAppRootDir(),"src","environments","environment.ts"),l=O(e,r,u),c=a?` <ng-container *ngIf="content || isPreviewing; else notFound">
|
|
1027
1027
|
<builder-content
|
|
1028
1028
|
[model]="model"
|
|
1029
1029
|
[content]="content"
|
|
@@ -1061,7 +1061,7 @@ export class ${t} {
|
|
|
1061
1061
|
`:""}
|
|
1062
1062
|
@Input() model = '${i}';
|
|
1063
1063
|
|
|
1064
|
-
apiKey = environment.${
|
|
1064
|
+
apiKey = environment.${Vn};
|
|
1065
1065
|
${e.typescriptEnabled?`
|
|
1066
1066
|
content: BuilderContent | null = null;
|
|
1067
1067
|
`:`
|
|
@@ -1089,12 +1089,12 @@ export class ${t} {
|
|
|
1089
1089
|
}
|
|
1090
1090
|
}
|
|
1091
1091
|
|
|
1092
|
-
`.trimStart()}function
|
|
1092
|
+
`.trimStart()}function Mp(e){return e.typescriptEnabled?`import type { RegisteredComponent } from "@builder.io/sdk-angular";
|
|
1093
1093
|
|
|
1094
1094
|
export const CUSTOM_COMPONENTS: RegisteredComponent[] = [
|
|
1095
1095
|
];`:`export const CUSTOM_COMPONENTS = [
|
|
1096
1096
|
];
|
|
1097
|
-
`}async function
|
|
1097
|
+
`}async function jp(e,t){let n=e.typescriptEnabled?"ts":"js",i=e.join(e.componentsDir,`counter.component.${n}`),a=await e.exists(i);e.debug(`angularEnsureCounterComponent, hasCounterCmp: ${a}`);let o=Up(e);if(!a){let s=await e.formatCode(i,o);await e.writeFile(i,s),t.push({filePath:i,modifiedType:"create"})}return i}function Up(e){return`
|
|
1098
1098
|
import { Component, Input } from '@angular/core';
|
|
1099
1099
|
|
|
1100
1100
|
@Component({
|
|
@@ -1162,26 +1162,26 @@ export class Counter {
|
|
|
1162
1162
|
}
|
|
1163
1163
|
}
|
|
1164
1164
|
|
|
1165
|
-
`.trimStart()}async function xs(e){await Qn(e);let t=await e.readFile(e.registryPath);return t?Kp(e,t):{components:[],sourceFile:N(e,"")}}async function Kp(e,t){let r=N(e,t);return zp(e,r)}async function zp(e,t){let r=[],n=X(e,t,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(i,a)=>{let o=await io(e,t,i);o&&(o.nodeIndex=a,r.push(o))})),{sourceFile:t,components:de(r)}}async function io(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(j(e,i)==="component"){let o,{initializer:s}=i;if(e.ts.isIdentifier(s))o=s.text;else if(e.ts.isCallExpression(s)){let l=s.arguments[0];e.ts.isIdentifier(l)&&(o=l.text)}if(!o)continue;n.name===""&&(n.name=q(o)),n.importName=o;let u=await je(e,e.registryPath,t,o);if(!u)continue;if(n.filePath=u.filePath,n.relFilePath=u.relFilePath,await e.exists(u.filePath)?n.importPath=V(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 l=await Xa(e,u.filePath);if(l&&l.length>0)if(l.length===1)n.exportName=l[0].cmpInfo.exportName;else{let c=l.find(p=>p.cmpInfo.exportName===o);c&&(n.exportName=c.cmpInfo.exportName)}}continue}}return n=De(e,n,r),n.filePath&&n.exportName&&(n.id=await K(e,n.filePath,n.exportName,n.externalImportPath)),n}async function Qe(e,t,r,n,i,a,o,s){let u=await ct(e),[l,c,p]=await Promise.all([Ya(e,u),xs(e),fn(e)]),m=l.map(F=>F.cmpInfo),g=c.components,d={components:Be(m,g),registryPath:e.registryPath,registryDisplayPath:M(e,e.registryPath),frameworks:e.getFrameworks(),dependencies:Ue(m),publicApiKey:p.envValue??void 0,devToolsVersion:e.version};if(s)return d.components=await Za(e,l,d.components),d;let D=!1,h=c.sourceFile,f=Array.isArray(t)?t:typeof t=="string"?[t]:[];if(f.length>0){let F=f.map(S=>{let y=l.find(I=>I.cmpInfo.id===S);if(!y)throw new Error(`Component ${S} not found`);return y}),x=Array.from(new Set(F.map(S=>S.cmpInfo.filePath))),w=await Z(e,x);for(let S of F){let y=d.components.find(U=>U.id===S.cmpInfo.id),I=await Gr(e,S,w);ye(y,I);let L=m.findIndex(U=>U.id===S.cmpInfo.id);m[L].inputs=I;let O=qe(S.cmpInfo.id,m,g,r,n,i,a),{elements:v,elmIndex:b,statementIndex:ce,statement:Pe,variableDeclaration:oe}=await Wp(e,h,S);if(O.addCmpToRegistry)v.push(qp(e,O.addCmpToRegistry)),D=!0;else if(O.removeCmpFromRegistry)v.splice(b,1),D=!0;else if(O.updateRegisteredCmp){let U=ee(e,v[b],O.updateRegisteredCmp);v[b]=e.ts.factory.updateObjectLiteralExpression(U,[Es(e,O.updateRegisteredCmp),...U.properties.slice(1)]),D=!0}if(D&&o){let U=[...h.statements];U[ce]=e.ts.factory.updateVariableStatement(Pe,Pe.modifiers,e.ts.factory.updateVariableDeclarationList(Pe.declarationList,[e.ts.factory.updateVariableDeclaration(oe,oe.name,oe.exclamationToken,oe.type,e.ts.factory.createArrayLiteralExpression(Ke(e,v)))])),h=e.ts.factory.updateSourceFile(h,U),y.exportType==="named"?h=$(e,h,{namedImports:[y.importName],importPath:y.externalImportPath?y.externalImportPath:_(e,e.registryPath,y.filePath)}):h=$(e,h,{defaultImport:y.importName,importPath:y.externalImportPath?y.externalImportPath:_(e,e.registryPath,y.filePath)}),h=$(e,h,{namedImports:["RegisteredComponent"],importPath:"@builder.io/sdk-angular",isTypeOnly:!0}),h=We(e,h,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),d.components=O.components,g=O.components.filter(pe=>pe.isRegistered)}}}if(D&&o){h=ze(e,h),h=Ve(e,h);let F=te(e,h);F=Ie(F),F=await e.formatCode(e.registryPath,F),await e.writeFile(e.registryPath,F)}return d}function Es(e,t){let r=e.ts.factory.createIdentifier(t.importName);return e.ts.factory.createPropertyAssignment("component",r)}function qp(e,t){return ee(e,e.ts.factory.createObjectLiteralExpression([Es(e,t)],!0),t)}async function Wp(e,t,r){let n=X(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)),a=-1;for(let o=0;o<i.length;o++)if((await io(e,t,i[o]))?.id===r.cmpInfo.id){a=o;break}return{...n,elements:i,elmIndex:a}}async function Fs(e){let t=await Jp(e),r={};return{builderPageOptions:async()=>({templateContentId:"f0b8016ac92e474699293211a268ebaa",pathname:"/builder-demo",title:"Builder + Angular Demo Page"}),ensureBuilderSetup:()=>gs(t),ensureFigmaImportPage:()=>hs(t),getRegistryPath:()=>t.registryPath,getRegistry:i=>Qe(t,null,!1,!1,null,null,!1,!!i?.readAllInputTypes),addExternalPackage:async i=>{r[i]||(r[i]=`export * from "${i}";`)},loadComponent:async i=>{let a=await Qe(t,i.cmpId,!1,!1,null,null,!1,!1);return{...a,component:a.components.find(o=>o.id===i.cmpId)}},registerComponent:i=>Qe(t,i.cmpId,!0,!1,null,null,!0,!1),setRegisteredComponentInfo:i=>Qe(t,i.cmpId,!1,!1,i,null,!0,!1),setRegisteredComponentInput:i=>Qe(t,i.cmpId,!1,!1,null,i,!0,!1),unregisterComponent:i=>Qe(t,i.cmpId,!1,!0,null,null,!0,!1),getPublicApiKey:()=>fn(t),setPublicApiKey:i=>Ga(t,i.publicApiKey),getDependencies:i=>[{name:"@builder.io/dev-tools"},{name:"@builder.io/sdk-angular"},{name:"concurrently"}],getDevRunCommand:()=>"builder-dev",getCache:()=>Oe(t),setCache:i=>_e(t,i)}}async function Jp(e){let t=await Hp(e),r=e.getAppRootDir(),n=e.join(r,"src"),i=await xe(e),a=e.join(n,"app"),o=await we(e,a),s={...e,srcDir:"",appDir:"",componentsDir:"",registryPath:o,angularConfigPath:t,typescriptEnabled:i,builderPageComponentPath:"",hasAppModule:!1};if(!await e.exists(n))throw new Error(`Could not find src directory. Searched for src in "${e.getAppRootDir()}".`);s.srcDir=n,s.appDir=a,s.componentsDir=e.join(s.appDir,"components"),s.builderPageComponentPath=e.join(s.componentsDir,`builder-page.component.${i?"ts":"js"}`);let u=`app.module.${i?"ts":"js"}`,l=e.join(s.appDir,u);return await e.exists(l)&&(s.hasAppModule=!0),s}async function Hp(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()}".`)}var er=B(ks(),1);async function $s(e,t){let n={components:(await t.getRegistry()).components.filter(a=>a.isRegistered).map(a=>{let o={filePath:Te(e.relative(e.getAppRootDir(),a.filePath)),name:a.name,image:a.image,description:a.description,exportName:a.exportName,inputs:Ce(a.inputs)};return Ce(o)}),version:1};e.debug("exporting registry components:",n.components.length);let i=(0,er.compress)(n);return btoa(JSON.stringify(i))}async function Ls(e,t,r){if(typeof r!="string")throw new Error("Invalid registry to import");let n=await t.getRegistry(),i=JSON.parse(atob(r)),a=(0,er.decompress)(i),o=Ce(n);e.debug("importing registry components:",a.components.length);for(let s of a.components){let u=Te(e.normalize(s.filePath)),l=n.components.find(p=>Te(p.filePath).endsWith(u)&&p.exportName===s.exportName);if(!l){console.error(`Could not find component to register: ${s.filePath}, ${s.exportName}`);continue}e.debug(`register (${l.id})`,l.filePath),await t.registerComponent({cmpId:l.id});for(let p of s.inputs)e.debug(`set input (${l.id})`),await t.setRegisteredComponentInput({cmpId:l.id,name:p.name,type:p.type,required:p.required,defaultValue:p.defaultValue,friendlyName:p.friendlyName,helperText:p.helperText});e.debug(`set input (${l.id}) info`);let c=await t.setRegisteredComponentInfo({cmpId:l.id,name:s.name,image:s.image,description:s.description});o=Ce(c)}return o}var Ne={react:"react",remix:"remix",angular:"angular",next:"next",qwik:"qwik"},W0={[Ne.react]:[{version:A.gen1,recommended:!0},{version:A.gen2,recommended:!1}],[Ne.remix]:[{version:A.gen1,recommended:!1},{version:A.gen2,recommended:!0}],[Ne.angular]:[{version:A.gen2,recommended:!0}],[Ne.next]:[{version:A.gen1,recommended:!0},{version:A.gen2,recommended:!1}],[Ne.qwik]:[{version:A.gen2,recommended:!0}]};async function Os(e,t){let r=[],n=new Set;async function i(a){let o=e.join(a,"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 l=JSON.parse(u);if(n.has(l.name))return null;n.add(l.name);let c={name:l.name,subPackages:[]},p=await e.readdir(a);for(let m of p)m!=="node_modules"&&(await e.stat(e.join(a,m))).isDirectory()&&c.subPackages.push(m);return r.push(c),c}catch(s){return e.Sentry?.captureException(s,{level:"warning"}),null}}try{let a=e.join(t,"package.json");if(await e.exists(a)){let s=await e.readFile(a);if(s!==null){let u=JSON.parse(s),l={...u.dependencies,...u.devDependencies};for(let c of Object.keys(l)){let p=e.join(t,"node_modules",c);await i(p)}if(u.workspaces)for(let c of u.workspaces){let p=await e.readdir(e.join(t,c));for(let m of p){let g=e.join(t,c,m);await i(g)}}}}}catch(a){e.Sentry?.captureException(a,{level:"warning"})}return r}var Cm={"@builder.io/qwik-city":Ba,next:Ea,"@remix-run/react":Ma,react:Ha,"@angular/core":Fs},xm={"@builder.io/qwik-city":Ne.qwik,next:Ne.next,"@remix-run/react":Ne.remix,react:Ne.react,"@angular/core":Ne.angular};async function tr(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 Rt(e)),e.frameworks.length===0)throw new Error("Supported Devtools framework for not found");for(let t of e.frameworks){let r=Cm[t.name];if(r)try{let n=await r(e);return{...n,exportRegistry:()=>$s(e,n),importRegistry:a=>Ls(e,n,a),framework:xm[t.name],findAllDependencies:async()=>await Os(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 Vx=`
|
|
1165
|
+
`.trimStart()}async function Cs(e){await Gn(e);let t=await e.readFile(e.registryPath);return t?Vp(e,t):{components:[],sourceFile:k(e,"")}}async function Vp(e,t){let r=k(e,t);return Kp(e,r)}async function Kp(e,t){let r=[],n=X(e,t,"CUSTOM_COMPONENTS");return n&&await Promise.all(n.arrayLiteralExp.elements.map(async(i,a)=>{let o=await oo(e,t,i);o&&(o.nodeIndex=a,r.push(o))})),{sourceFile:t,components:de(r)}}async function oo(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(j(e,i)==="component"){let o,{initializer:s}=i;if(e.ts.isIdentifier(s))o=s.text;else if(e.ts.isCallExpression(s)){let l=s.arguments[0];e.ts.isIdentifier(l)&&(o=l.text)}if(!o)continue;n.name===""&&(n.name=W(o)),n.importName=o;let u=await Me(e,e.registryPath,t,o);if(!u)continue;if(n.filePath=u.filePath,n.relFilePath=u.relFilePath,await e.exists(u.filePath)?n.importPath=z(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 l=await Ya(e,u.filePath);if(l&&l.length>0)if(l.length===1)n.exportName=l[0].cmpInfo.exportName;else{let c=l.find(p=>p.cmpInfo.exportName===o);c&&(n.exportName=c.cmpInfo.exportName)}}continue}}return n=De(e,n,r),n.filePath&&n.exportName&&(n.id=await q(e,n.filePath,n.exportName,n.externalImportPath)),n}async function Ge(e,t,r,n,i,a,o,s){let u=await pt(e),[l,c,p]=await Promise.all([Qa(e,u),Cs(e),fn(e)]),m=l.map(x=>x.cmpInfo),h=c.components,D={components:Re(m,h),registryPath:e.registryPath,registryDisplayPath:M(e,e.registryPath),frameworks:e.getFrameworks(),dependencies:je(m),publicApiKey:p.envValue??void 0,devToolsVersion:e.version};if(s)return D.components=await Xa(e,l,D.components),D;let d=!1,g=c.sourceFile,f=Array.isArray(t)?t:typeof t=="string"?[t]:[];if(f.length>0){let x=f.map(v=>{let F=l.find(B=>B.cmpInfo.id===v);if(!F)throw new Error(`Component ${v} not found`);return F}),y=Array.from(new Set(x.map(v=>v.cmpInfo.filePath))),S=await Z(e,y);for(let v of x){let F=D.components.find(V=>V.id===v.cmpInfo.id),B=await Hr(e,v,S);Fe(F,B);let U=m.findIndex(V=>V.id===v.cmpInfo.id);m[U].inputs=B;let T=ze(v.cmpInfo.id,m,h,r,n,i,a),{elements:w,elmIndex:b,statementIndex:ce,statement:Pe,variableDeclaration:oe}=await qp(e,g,v);if(T.addCmpToRegistry)w.push(zp(e,T.addCmpToRegistry)),d=!0;else if(T.removeCmpFromRegistry)w.splice(b,1),d=!0;else if(T.updateRegisteredCmp){let V=ee(e,w[b],T.updateRegisteredCmp);w[b]=e.ts.factory.updateObjectLiteralExpression(V,[xs(e,T.updateRegisteredCmp),...V.properties.slice(1)]),d=!0}if(d&&o){let V=[...g.statements];V[ce]=e.ts.factory.updateVariableStatement(Pe,Pe.modifiers,e.ts.factory.updateVariableDeclarationList(Pe.declarationList,[e.ts.factory.updateVariableDeclaration(oe,oe.name,oe.exclamationToken,oe.type,e.ts.factory.createArrayLiteralExpression(Ve(e,w)))])),g=e.ts.factory.updateSourceFile(g,V),F.exportType==="named"?g=$(e,g,{namedImports:[F.importName],importPath:F.externalImportPath?F.externalImportPath:O(e,e.registryPath,F.filePath)}):g=$(e,g,{defaultImport:F.importName,importPath:F.externalImportPath?F.externalImportPath:O(e,e.registryPath,F.filePath)}),g=$(e,g,{namedImports:["RegisteredComponent"],importPath:"@builder.io/sdk-angular",isTypeOnly:!0}),g=qe(e,g,{variableName:"CUSTOM_COMPONENTS",arrayType:"RegisteredComponent"}),D.components=T.components,h=T.components.filter(pe=>pe.isRegistered)}}}if(d&&o){g=Ke(e,g),g=Ue(e,g);let x=te(e,g);x=Be(x),x=await e.formatCode(e.registryPath,x),await e.writeFile(e.registryPath,x)}return D}function xs(e,t){let r=e.ts.factory.createIdentifier(t.importName);return e.ts.factory.createPropertyAssignment("component",r)}function zp(e,t){return ee(e,e.ts.factory.createObjectLiteralExpression([xs(e,t)],!0),t)}async function qp(e,t,r){let n=X(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)),a=-1;for(let o=0;o<i.length;o++)if((await oo(e,t,i[o]))?.id===r.cmpInfo.id){a=o;break}return{...n,elements:i,elmIndex:a}}async function Es(e){let t=await Wp(e),r={};return{builderPageOptions:async()=>({templateContentId:"f0b8016ac92e474699293211a268ebaa",pathname:"/builder-demo",title:"Builder + Angular Demo Page"}),ensureBuilderSetup:()=>Ds(t),ensureFigmaImportPage:()=>gs(t),getRegistryPath:()=>t.registryPath,getRegistry:i=>Ge(t,null,!1,!1,null,null,!1,!!i?.readAllInputTypes),addExternalPackage:async i=>{r[i]||(r[i]=`export * from "${i}";`)},loadComponent:async i=>{let a=await Ge(t,i.cmpId,!1,!1,null,null,!1,!1);return{...a,component:a.components.find(o=>o.id===i.cmpId)}},registerComponent:i=>Ge(t,i.cmpId,!0,!1,null,null,!0,!1),setRegisteredComponentInfo:i=>Ge(t,i.cmpId,!1,!1,i,null,!0,!1),setRegisteredComponentInput:i=>Ge(t,i.cmpId,!1,!1,null,i,!0,!1),unregisterComponent:i=>Ge(t,i.cmpId,!1,!0,null,null,!0,!1),getPublicApiKey:()=>fn(t),setPublicApiKey:i=>Ha(t,i.publicApiKey),getDependencies:i=>[{name:"@builder.io/dev-tools"},{name:"@builder.io/sdk-angular"},{name:"concurrently"}],getDevRunCommand:()=>"builder-dev",getCache:()=>Le(t),setCache:i=>Oe(t,i)}}async function Wp(e){let t=await Jp(e),r=e.getAppRootDir(),n=e.join(r,"src"),i=await xe(e),a=e.join(n,"app"),o=await Se(e,a),s={...e,srcDir:"",appDir:"",componentsDir:"",registryPath:o,angularConfigPath:t,typescriptEnabled:i,builderPageComponentPath:"",hasAppModule:!1};if(!await e.exists(n))throw new Error(`Could not find src directory. Searched for src in "${e.getAppRootDir()}".`);s.srcDir=n,s.appDir=a,s.componentsDir=e.join(s.appDir,"components"),s.builderPageComponentPath=e.join(s.componentsDir,`builder-page.component.${i?"ts":"js"}`);let u=`app.module.${i?"ts":"js"}`,l=e.join(s.appDir,u);return await e.exists(l)&&(s.hasAppModule=!0),s}async function Jp(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()}".`)}var Zn=R(Ns(),1);async function ks(e,t){let n={components:(await t.getRegistry()).components.filter(a=>a.isRegistered).map(a=>{let o={filePath:Te(e.relative(e.getAppRootDir(),a.filePath)),name:a.name,image:a.image,description:a.description,exportName:a.exportName,inputs:Ce(a.inputs)};return Ce(o)}),version:1};e.debug("exporting registry components:",n.components.length);let i=(0,Zn.compress)(n);return btoa(JSON.stringify(i))}async function $s(e,t,r){if(typeof r!="string")throw new Error("Invalid registry to import");let n=await t.getRegistry(),i=JSON.parse(atob(r)),a=(0,Zn.decompress)(i),o=Ce(n);e.debug("importing registry components:",a.components.length);for(let s of a.components){let u=Te(e.normalize(s.filePath)),l=n.components.find(p=>Te(p.filePath).endsWith(u)&&p.exportName===s.exportName);if(!l){console.error(`Could not find component to register: ${s.filePath}, ${s.exportName}`);continue}e.debug(`register (${l.id})`,l.filePath),await t.registerComponent({cmpId:l.id});for(let p of s.inputs)e.debug(`set input (${l.id})`),await t.setRegisteredComponentInput({cmpId:l.id,name:p.name,type:p.type,required:p.required,defaultValue:p.defaultValue,friendlyName:p.friendlyName,helperText:p.helperText});e.debug(`set input (${l.id}) info`);let c=await t.setRegisteredComponentInfo({cmpId:l.id,name:s.name,image:s.image,description:s.description});o=Ce(c)}return o}var ke={react:"react",remix:"remix",angular:"angular",next:"next",qwik:"qwik"},W0={[ke.react]:[{version:A.gen1,recommended:!0},{version:A.gen2,recommended:!1}],[ke.remix]:[{version:A.gen1,recommended:!1},{version:A.gen2,recommended:!0}],[ke.angular]:[{version:A.gen2,recommended:!0}],[ke.next]:[{version:A.gen1,recommended:!0},{version:A.gen2,recommended:!1}],[ke.qwik]:[{version:A.gen2,recommended:!0}]};async function Ls(e,t){let r=[],n=new Set;async function i(a){let o=e.join(a,"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 l=JSON.parse(u);if(n.has(l.name))return null;n.add(l.name);let c={name:l.name,subPackages:[]},p=await e.readdir(a);for(let m of p)m!=="node_modules"&&(await e.stat(e.join(a,m))).isDirectory()&&c.subPackages.push(m);return r.push(c),c}catch(s){return e.Sentry?.captureException(s,{level:"warning"}),null}}try{let a=e.join(t,"package.json");if(await e.exists(a)){let s=await e.readFile(a);if(s!==null){let u=JSON.parse(s),l={...u.dependencies,...u.devDependencies};for(let c of Object.keys(l)){let p=e.join(t,"node_modules",c);await i(p)}if(u.workspaces)for(let c of u.workspaces){let p=await e.readdir(e.join(t,c));for(let m of p){let h=e.join(t,c,m);await i(h)}}}}}catch(a){e.Sentry?.captureException(a,{level:"warning"})}return r}var hm={"@builder.io/qwik-city":Ia,next:xa,"@remix-run/react":_a,react:Ja,"@angular/core":Es},Cm={"@builder.io/qwik-city":ke.qwik,next:ke.next,"@remix-run/react":ke.remix,react:ke.react,"@angular/core":ke.angular};async function er(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 Rt(e)),e.frameworks.length===0)throw new Error("Supported Devtools framework for not found");for(let t of e.frameworks){let r=hm[t.name];if(r)try{let n=await r(e);return{...n,exportRegistry:()=>ks(e,n),importRegistry:a=>$s(e,n,a),framework:Cm[t.name],findAllDependencies:async()=>await Ls(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 Vx=`
|
|
1166
1166
|
/** @type {import('next').NextConfig} */
|
|
1167
1167
|
const nextConfig = {
|
|
1168
1168
|
}
|
|
1169
1169
|
|
|
1170
1170
|
module.exports = nextConfig
|
|
1171
|
-
`.trimStart();var
|
|
1171
|
+
`.trimStart();var Os=R(require("@sentry/node"),1),_s=R(require("@amplitude/analytics-node"),1);async function rt(e){if(process.env.NODE_ENV!=="test")try{await Promise.allSettled([Os.flush(2e3),_s.flush().promise])}catch(t){console.error(t)}process.exit(e)}var Cn=process.env.AIR_HOST||"https://ai.builder.io";var Wt=R(require("@amplitude/analytics-node"),1),xn=R(require("@sentry/node"),1);var ie=[];for(let e=0;e<256;++e)ie.push((e+256).toString(16).slice(1));function Ms(e,t=0){return(ie[e[t+0]]+ie[e[t+1]]+ie[e[t+2]]+ie[e[t+3]]+"-"+ie[e[t+4]]+ie[e[t+5]]+"-"+ie[e[t+6]]+ie[e[t+7]]+"-"+ie[e[t+8]]+ie[e[t+9]]+"-"+ie[e[t+10]]+ie[e[t+11]]+ie[e[t+12]]+ie[e[t+13]]+ie[e[t+14]]+ie[e[t+15]]).toLowerCase()}var js=R(require("crypto")),nr=new Uint8Array(256),tr=nr.length;function Fo(){return tr>nr.length-16&&(js.default.randomFillSync(nr),tr=0),nr.slice(tr,tr+=16)}var Us=R(require("crypto")),yo={randomUUID:Us.default.randomUUID};function xm(e,t,r){if(yo.randomUUID&&!t&&!e)return yo.randomUUID();e=e||{};let n=e.random||(e.rng||Fo)();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 Ms(n)}var So=xm;async function or(e,t){let r={...t,app:"dev-tools-cli",package:"cli"},n=await Em(),i=await Fm();return await Wt.track(e,r,{user_id:n,device_id:i}).promise}var rr,vo;async function Vs(e){rr=e;let t=await Nt();await Er({...t,userId:e})}async function Em(){if(rr)return rr;let e=await Nt(),t;return xr(e,"userId")&&(t=e.userId),rr=t,t}async function Fm(){if(vo)return vo;let e=await Nt(),t=So();return xr(e,"deviceId")?t=e.deviceId:await Er({...e,deviceId:t}),vo=t,t}var zs=R(at(),1),qs=require("undici");var Ws=R(at(),1);var Ks="0.0.0";var wo=R(require("process"),1),At=async(e,t)=>{let r="fetch"in globalThis?globalThis.fetch:qs.fetch;try{let n=await r(e,{...t,headers:{...t?.headers,...Sm()}});if(!n.ok&&n.status===429){let i=await n.json(),a=i.severity??"high",o=i.message??"Rate limit exceeded. Please try again later.";return console.log(),a==="high"?n.error((0,zs.red)(`${n.status} ${o}
|
|
1172
1172
|
|
|
1173
|
-
`)):n.warn((0,
|
|
1173
|
+
`)):n.warn((0,Ws.yellow)(`${n.status} ${o}
|
|
1174
1174
|
|
|
1175
|
-
`)),await
|
|
1176
|
-
`));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
|
|
1177
|
-
`);let
|
|
1178
|
-
`).length+1)),process.stdout.write(
|
|
1179
|
-
`).length));let
|
|
1180
|
-
`).length+1)),process.stdout.write(
|
|
1181
|
-
`).length)),process.stdout.write(`${
|
|
1182
|
-
`),s=a,m(),r()};return{start:
|
|
1175
|
+
`)),await rt(1)}return n}catch(n){let i=typeof e=="string"?e:e instanceof URL?e.toString():e.url,a=t?.method||"GET",o=n instanceof Error?n.message:String(n),s=new Error(`Fetch failed for ${a} ${i}: ${o}`);throw n instanceof Error&&(s.cause=n),s.requestContext={url:i,method:a,headers:t?.headers},s}};function Sm(){let t={darwin:"Macintosh",win32:"Windows NT",linux:"Linux",android:"Android",ios:"iPhone"}[wo.default.platform]||"Unknown",r=wo.default.platform==="win32"?"10.0":"";return{"User-Agent":`Mozilla/5.0 (${t}${r?"; "+r:""}) builder-cli/${Ks}`,"Sec-Ch-Ua-Platform":t}}var vm=R(require("@sentry/node"),1);var Pm=require("glob");var wm=R(require("prettier"),1);var Tm=R(require("chokidar"),1),Im=R(require("ignore"),1);function ot(){}ot.prototype={diff:function(t,r){var n,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=i.callback;typeof i=="function"&&(a=i,i={}),this.options=i;var o=this;function s(S){return a?(setTimeout(function(){a(void 0,S)},0),!0):S}t=this.castInput(t),r=this.castInput(r),t=this.removeEmpty(this.tokenize(t)),r=this.removeEmpty(this.tokenize(r));var u=r.length,l=t.length,c=1,p=u+l;i.maxEditLength&&(p=Math.min(p,i.maxEditLength));var m=(n=i.timeout)!==null&&n!==void 0?n:1/0,h=Date.now()+m,D=[{oldPos:-1,lastComponent:void 0}],d=this.extractCommon(D[0],r,t,0);if(D[0].oldPos+1>=l&&d+1>=u)return s([{value:this.join(r),count:r.length}]);var g=-1/0,f=1/0;function x(){for(var S=Math.max(g,-c);S<=Math.min(f,c);S+=2){var v=void 0,F=D[S-1],B=D[S+1];F&&(D[S-1]=void 0);var U=!1;if(B){var T=B.oldPos-S;U=B&&0<=T&&T<u}var w=F&&F.oldPos+1<l;if(!U&&!w){D[S]=void 0;continue}if(!w||U&&F.oldPos+1<B.oldPos?v=o.addToPath(B,!0,void 0,0):v=o.addToPath(F,void 0,!0,1),d=o.extractCommon(v,r,t,S),v.oldPos+1>=l&&d+1>=u)return s(Bm(o,v.lastComponent,r,t,o.useLongestToken));D[S]=v,v.oldPos+1>=l&&(f=Math.min(f,S-1)),d+1>=u&&(g=Math.max(g,S+1))}c++}if(a)(function S(){setTimeout(function(){if(c>p||Date.now()>h)return a();x()||S()},0)})();else for(;c<=p&&Date.now()<=h;){var y=x();if(y)return y}},addToPath:function(t,r,n,i){var a=t.lastComponent;return a&&a.added===r&&a.removed===n?{oldPos:t.oldPos+i,lastComponent:{count:a.count+1,added:r,removed:n,previousComponent:a.previousComponent}}:{oldPos:t.oldPos+i,lastComponent:{count:1,added:r,removed:n,previousComponent:a}}},extractCommon:function(t,r,n,i){for(var a=r.length,o=n.length,s=t.oldPos,u=s-i,l=0;u+1<a&&s+1<o&&this.equals(r[u+1],n[s+1]);)u++,s++,l++;return l&&(t.lastComponent={count:l,previousComponent:t.lastComponent}),t.oldPos=s,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 Bm(e,t,r,n,i){for(var a=[],o;t;)a.push(t),o=t.previousComponent,delete t.previousComponent,t=o;a.reverse();for(var s=0,u=a.length,l=0,c=0;s<u;s++){var p=a[s];if(p.removed){if(p.value=e.join(n.slice(c,c+p.count)),c+=p.count,s&&a[s-1].added){var h=a[s-1];a[s-1]=a[s],a[s]=h}}else{if(!p.added&&i){var m=r.slice(l,l+p.count);m=m.map(function(d,g){var f=n[c+g];return f.length>d.length?f:d}),p.value=e.join(m)}else p.value=e.join(r.slice(l,l+p.count));l+=p.count,p.added||(c+=p.count)}}var D=a[u-1];return u>1&&typeof D.value=="string"&&(D.added||D.removed)&&e.equals("",D.value)&&(a[u-2].value+=D.value,a.pop()),a}var ZE=new ot;var Hs=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,Gs=/\S/,Qs=new ot;Qs.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!Gs.test(e)&&!Gs.test(t)};Qs.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]&&Hs.test(t[r])&&Hs.test(t[r+2])&&(t[r]+=t[r+2],t.splice(r+1,2),r--);return t};var Ys=new ot;Ys.tokenize=function(e){this.options.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
1176
|
+
`));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 Rm=new ot;Rm.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var Nm=new ot;Nm.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function ar(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ar=function(t){return typeof t}:ar=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ar(e)}var km=Object.prototype.toString,Fn=new ot;Fn.useLongestToken=!0;Fn.tokenize=Ys.tokenize;Fn.castInput=function(e){var t=this.options,r=t.undefinedReplacement,n=t.stringifyReplacer,i=n===void 0?function(a,o){return typeof o>"u"?r:o}:n;return typeof e=="string"?e:JSON.stringify(Ao(e,null,null,i),i," ")};Fn.equals=function(e,t){return ot.prototype.equals.call(Fn,e.replace(/,([\r\n])/g,"$1"),t.replace(/,([\r\n])/g,"$1"))};function Ao(e,t,r,n,i){t=t||[],r=r||[],n&&(e=n(i,e));var a;for(a=0;a<t.length;a+=1)if(t[a]===e)return r[a];var o;if(km.call(e)==="[object Array]"){for(t.push(e),o=new Array(e.length),r.push(o),a=0;a<e.length;a+=1)o[a]=Ao(e[a],t,r,n,i);return t.pop(),r.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),ar(e)==="object"&&e!==null){t.push(e),o={},r.push(o);var s=[],u;for(u in e)e.hasOwnProperty(u)&&s.push(u);for(s.sort(),a=0;a<s.length;a+=1)u=s[a],o[u]=Ao(e[u],t,r,n,u);t.pop(),r.pop()}else o=e;return o}var Po=new ot;Po.tokenize=function(e){return e.slice()};Po.join=Po.removeEmpty=function(e){return e};var To=R(require("process"),1);function Io(){let{env:e}=To.default,{TERM:t,TERM_PROGRAM:r}=e;return To.default.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 Bo=R(at(),1),it=R(Bn(),1),sr=require("process"),Dt=R(require("readline"),1),yn=R(at(),1),ur=()=>{let e=Ro?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],t=Ro?80:120,r,n,i=!1,a="",o="",s="",u=f=>{let x=f>1?"Something went wrong":"Canceled";i&&D(x,f)},l=(f,x)=>{console.error(x,f),u(2)},c=()=>u(1),p=()=>{process.on("uncaughtExceptionMonitor",l),process.on("unhandledRejection",l),process.on("SIGINT",c),process.on("SIGTERM",c),process.on("exit",u)},m=()=>{process.removeListener("uncaughtExceptionMonitor",l),process.removeListener("unhandledRejection",l),process.removeListener("SIGINT",c),process.removeListener("SIGTERM",c),process.removeListener("exit",u)},h=(f="")=>{i=!0,r=jm(),a=f.replace(/\.+$/,""),process.stdout.write(`${Bo.default.gray($m)}
|
|
1177
|
+
`);let x=0,y=0;p(),process.env.CI||(n=setInterval(()=>{let S=Bo.default.magenta(e[x]),v=".".repeat(Math.floor(y)).slice(0,3);process.stdout.write(it.cursor.move(-999,-s.split(`
|
|
1178
|
+
`).length+1)),process.stdout.write(it.erase.down(s.split(`
|
|
1179
|
+
`).length));let F=`${S} ${a}${v}${o}`;process.stdout.write(F),x=x+1<e.length?x+1:0,y=y<e.length?y+.125:0,s=F},t))},D=(f,x=0)=>{a=f??a,i=!1,clearInterval(n);let y=x===0?(0,yn.green)(_m):x===1?(0,yn.red)(Lm):(0,yn.red)(Om);process.stdout.write(it.cursor.move(-999,-s.split(`
|
|
1180
|
+
`).length+1)),process.stdout.write(it.erase.down(s.split(`
|
|
1181
|
+
`).length)),process.stdout.write(`${y} ${a}
|
|
1182
|
+
`),s=a,m(),r()};return{start:h,stop:D,message:(f="")=>{a=f??a},extra:(f="")=>{o=f}}},Ro=Io(),lr=(e,t)=>Ro?e:t,$m=lr("\u2502","|"),Lm=lr("\u25A0","x"),Om=lr("\u25B2","x"),_m=lr("\u25C7","o"),Mm=globalThis.process.platform.startsWith("win");function jm({input:e=sr.stdin,output:t=sr.stdout,overwrite:r=!0,hideCursor:n=!0}={}){let i=Dt.createInterface({input:e,output:t,prompt:"",tabSize:1});Dt.emitKeypressEvents(e,i),e.isTTY&&e.setRawMode(!0);let a=(o,{name:s})=>{if(String(o)===""){n&&t.write(it.cursor.show),process.exit(0);return}if(!r)return;Dt.moveCursor(t,s==="return"?0:-1,s==="return"?-1:0,()=>{Dt.clearLine(t,1,()=>{e.once("keypress",a)})})};return n&&t.write(it.cursor.hide),e.once("keypress",a),()=>{e.off("keypress",a),n&&t.write(it.cursor.show),e.isTTY&&!Mm&&e.setRawMode(!1),i.terminal=!1,i.close()}}var E=R(at(),1);function No(e){switch(or("cli help",{subcommand:e}),console.log(""),st((0,E.bgCyan)((0,E.bold)((0,E.white)(" help ")))+" "+(0,E.dim)(ge)),e){case"add":case"generate":case"gen":case"g":st(`${(0,E.cyan)("\u2192")} ${(0,E.bold)("Generate Figma Components")}
|
|
1183
1183
|
|
|
1184
|
-
${(0,E.bgGreen)((0,E.white)(` npx ${
|
|
1184
|
+
${(0,E.bgGreen)((0,E.white)(` npx ${Ie()} figma generate URL [URL ...] `))}
|
|
1185
1185
|
|
|
1186
1186
|
Start the auto-mapping wizard for the Figma Component URLs pasted in.
|
|
1187
1187
|
|
|
@@ -1197,9 +1197,9 @@ ${(0,E.yellow)("Arguments:")}
|
|
|
1197
1197
|
${(0,E.cyan)("--ci")} Run in CI mode without interactive prompts
|
|
1198
1198
|
${(0,E.cyan)("--force")} Force operation even if there are warnings
|
|
1199
1199
|
${(0,E.cyan)("--skipInstallation")} Skip the package installation step
|
|
1200
|
-
${(0,E.cyan)("--yes")} Auto-confirm all prompts`);break;case"auth":
|
|
1200
|
+
${(0,E.cyan)("--yes")} Auto-confirm all prompts`);break;case"auth":K.info(`${(0,E.cyan)("\u2192")} ${(0,E.bold)("Authentication")}
|
|
1201
1201
|
|
|
1202
|
-
${(0,E.bgGreen)((0,E.white)(` npx ${
|
|
1202
|
+
${(0,E.bgGreen)((0,E.white)(` npx ${Ie()} auth `))}
|
|
1203
1203
|
|
|
1204
1204
|
Re-authenticate with Figma and Builder.io.
|
|
1205
1205
|
|
|
@@ -1215,7 +1215,7 @@ ${(0,E.yellow)("Non-Interactive Authentication:")}
|
|
|
1215
1215
|
Example using environment variables:
|
|
1216
1216
|
${(0,E.dim)('export BUILDER_PRIVATE_KEY="your-private-key"')}
|
|
1217
1217
|
${(0,E.dim)('export FIGMA_PERSONAL_TOKEN="your-figma-token"')}
|
|
1218
|
-
${(0,E.dim)(`npx ${
|
|
1218
|
+
${(0,E.dim)(`npx ${Ie()} figma generate <url> --ci`)}
|
|
1219
1219
|
|
|
1220
1220
|
${(0,E.yellow)("Arguments:")}
|
|
1221
1221
|
${(0,E.cyan)("--figmaToken")} Figma access token for authentication
|
|
@@ -1225,9 +1225,9 @@ ${(0,E.yellow)("Arguments:")}
|
|
|
1225
1225
|
${(0,E.yellow)("Learn More:")}
|
|
1226
1226
|
\u2022 Builder.io API keys: https://www.builder.io/c/docs/using-your-api-key#managing-private-keys
|
|
1227
1227
|
\u2022 Figma access token: https://help.figma.com/hc/en-us/articles/8085703771159-Manage-personal-access-tokens
|
|
1228
|
-
\u2022 CI setup guide: https://www.builder.io/c/docs/integrating-builder-figma`);break;case"publish":
|
|
1228
|
+
\u2022 CI setup guide: https://www.builder.io/c/docs/integrating-builder-figma`);break;case"publish":K.info(`${(0,E.cyan)("\u2192")} ${(0,E.bold)("Publish Mappings")}
|
|
1229
1229
|
|
|
1230
|
-
${(0,E.bgGreen)((0,E.white)(` npx ${
|
|
1230
|
+
${(0,E.bgGreen)((0,E.white)(` npx ${Ie()} figma publish `))}
|
|
1231
1231
|
|
|
1232
1232
|
Publish your Figma Mappings to Builder.io.
|
|
1233
1233
|
|
|
@@ -1237,9 +1237,9 @@ ${(0,E.yellow)("Arguments:")}
|
|
|
1237
1237
|
${(0,E.cyan)("--force")} Force publish even if there are warnings
|
|
1238
1238
|
${(0,E.cyan)("--verbose")} Print output as JSON
|
|
1239
1239
|
${(0,E.cyan)("--dryrun")} Run without making changes
|
|
1240
|
-
${(0,E.cyan)("--yes")} Auto-confirm all prompts`);break;case"migrate":
|
|
1240
|
+
${(0,E.cyan)("--yes")} Auto-confirm all prompts`);break;case"migrate":K.info(`${(0,E.cyan)("\u2192")} ${(0,E.bold)("Migrate Mappings")}
|
|
1241
1241
|
|
|
1242
|
-
${(0,E.bgGreen)((0,E.white)(` npx ${
|
|
1242
|
+
${(0,E.bgGreen)((0,E.white)(` npx ${Ie()} figma migrate `))}
|
|
1243
1243
|
|
|
1244
1244
|
Migrate your existing Figma Mappings into the repo as local files.
|
|
1245
1245
|
|
|
@@ -1249,9 +1249,9 @@ ${(0,E.yellow)("Description:")}
|
|
|
1249
1249
|
${(0,E.yellow)("Arguments:")}
|
|
1250
1250
|
${(0,E.cyan)("--spaceId")} Builder.io space ID to use
|
|
1251
1251
|
${(0,E.cyan)("--force")} Force migration even if there are warnings
|
|
1252
|
-
${(0,E.cyan)("--yes")} Auto-confirm all prompts`);break;case"code":
|
|
1252
|
+
${(0,E.cyan)("--yes")} Auto-confirm all prompts`);break;case"code":K.info(`${(0,E.cyan)("\u2192")} ${(0,E.bold)("Code Generation")}
|
|
1253
1253
|
|
|
1254
|
-
${(0,E.bgGreen)((0,E.white)(` npx ${
|
|
1254
|
+
${(0,E.bgGreen)((0,E.white)(` npx ${Ie()} code --url URL `))}
|
|
1255
1255
|
|
|
1256
1256
|
Generate or modify code based on Figma designs.
|
|
1257
1257
|
|
|
@@ -1265,23 +1265,42 @@ ${(0,E.yellow)("Arguments:")}
|
|
|
1265
1265
|
${(0,E.yellow)("Configuration Files:")}
|
|
1266
1266
|
${(0,E.cyan)(".builderignore")} Add patterns to exclude files from being included in code generation
|
|
1267
1267
|
${(0,E.cyan)(".builderrules")} Add custom instructions that will be injected into the LLM prompt
|
|
1268
|
-
${(0,E.cyan)(".cursorrules")} Cursor's settings are automatically supported for consistent behavior`);break;case"indexing":
|
|
1268
|
+
${(0,E.cyan)(".cursorrules")} Cursor's settings are automatically supported for consistent behavior`);break;case"indexing":K.info(`${(0,E.cyan)("\u2192")} ${(0,E.bold)("Code Indexing")}
|
|
1269
1269
|
|
|
1270
|
-
${(0,E.bgGreen)((0,E.white)(` npx ${
|
|
1270
|
+
${(0,E.bgGreen)((0,E.white)(` npx ${Ie()} code indexing `))}
|
|
1271
1271
|
|
|
1272
1272
|
Index your codebase to improve code generation results.
|
|
1273
1273
|
|
|
1274
1274
|
${(0,E.yellow)("Arguments:")}
|
|
1275
1275
|
${(0,E.cyan)("--spaceId")} Builder.io space ID to use
|
|
1276
|
-
${(0,E.cyan)("--cwd")} Working directory to run commands from`);break;
|
|
1277
|
-
|
|
1276
|
+
${(0,E.cyan)("--cwd")} Working directory to run commands from`);break;case"launch":K.info(`${(0,E.cyan)("\u2192")} ${(0,E.bold)("Launch Development Server")}
|
|
1277
|
+
|
|
1278
|
+
${(0,E.bgGreen)((0,E.white)(` npx ${Ie()} launch -p <port> -c <command> `))}
|
|
1279
|
+
|
|
1280
|
+
This command will:
|
|
1281
|
+
1. Run your development server command
|
|
1282
|
+
2. Create a proxy server that injects Builder.io scripts into your application on the specified port
|
|
1283
|
+
3. Set up an API server to handle Builder.io operations
|
|
1284
|
+
|
|
1285
|
+
${(0,E.yellow)("Arguments:")}
|
|
1286
|
+
${(0,E.cyan)("-p, --port")} Port number where your application is running
|
|
1287
|
+
${(0,E.cyan)("-c, --command")} Command to run your development server
|
|
1288
|
+
|
|
1289
|
+
${(0,E.yellow)("Example:")}
|
|
1290
|
+
${(0,E.cyan)('npx builder.io launch -p 3000 -c "npm run dev"')}
|
|
1291
|
+
|
|
1292
|
+
${(0,E.yellow)("Note:")}
|
|
1293
|
+
- The proxy runs on port ${(0,E.cyan)("48752")} and the API server on port ${(0,E.cyan)("48753")}`);break;default:K.info(`${(0,E.bold)("Available Commands:")}
|
|
1294
|
+
`),[{command:"generate URL [URL ...]",description:"Start the auto-mapping wizard for Figma Component URLs"},{command:"publish",description:"Publish your Figma Mappings to Builder.io"},{command:"migrate",description:"Migrate existing Figma Mappings into the repo as local files"},{command:"auth",description:"Re-authenticate with Figma and Builder.io"},{command:"code",description:"Generate or modify code based on Figma designs"},{command:"indexing",description:"Index your codebase to improve code generation results"},{command:"launch",description:"Launch a development server"}].forEach(({command:r,description:n})=>{K.info(`${(0,E.cyan)("\u2192")} ${(0,E.bgGreen)((0,E.white)(` npx ${Ie()} figma ${r} `))}
|
|
1278
1295
|
${(0,E.dim)(n)}
|
|
1279
|
-
`)}),
|
|
1280
|
-
Use ${(0,E.cyan)(`npx ${
|
|
1281
|
-
|
|
1296
|
+
`)}),K.info(`
|
|
1297
|
+
Use ${(0,E.cyan)(`npx ${Ie()} figma help <command>`)} for detailed help about a command`)}nn("bye \u{1F44B}")}var Km=R(require("prompts"),1);var qm=R(require("prettier"),1);var Ae=R(require("typescript"),1);function ko(e){return!(e.category!==Ae.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 Wm(e,t,r){let n=[],i=[t],a=e.relative(e.getAppRootDir(),t.fileName);for(;i.length>0;){let o=i.shift();if(Ym(o,t)){let s=Hm(e,o,t,r),{line:u,character:l}=t.getLineAndCharacterOfPosition(o.getStart());s&&(s.loc=`${a}:${u+1}:${l+1}`,n.push(s))}i.push(...o.getChildren(t))}return n}var Jm="figmaMapping";function Hm(e,t,r,n){let[i]=t.arguments;if(!i)throw new Error("Invalid figmaMapping call, no arguments found");if(!L.default.isObjectLiteralExpression(i))throw new Error("Invalid figmaMapping call, argument is not an object literal");let a=i.properties;if(!a)throw new Error("Invalid figmaMapping call, argument has no properties");let o="",s,u,l,c="-",p=e.basename(r.fileName).replace(/\.mapper\.[tsxjm]+$/,""),m,h,D,d;if(t.typeArguments&&t.typeArguments.length>0){let x=Xs(t.typeArguments[0].getText(r));x&&(p=x)}for(let x of a){let y=x.name?.getText(r);if(!y)throw new Error("Invalid figmaMapping call, property has no name");switch(y){case"componentName":{if(!("initializer"in x))throw new Error("Invalid figmaMapping call, componentName has no initializer");let S=x.initializer;if(!L.default.isStringLiteral(S))throw new Error("Invalid figmaMapping call, componentName is not a string literal");s=S.text;break}case"url":{if(!("initializer"in x))throw new Error("Invalid figmaMapping call, url has no initializer");let S=x.initializer;if(!L.default.isStringLiteral(S))throw new Error("Invalid figmaMapping call, url is not a string literal");d=S.text;break}case"componentKey":{if(!("initializer"in x))throw new Error("Invalid figmaMapping call, componentKey has no initializer");let S=x.initializer;if(!L.default.isStringLiteral(S))throw new Error("Invalid figmaMapping call, componentKey is not a string literal");o=S.text;break}case"mapper":if(L.default.isMethodDeclaration(x)){let S=function(F){let U=n.getSymbolAtLocation(F)?.getDeclarations()?.[0];if(U){let T=Qm(U);if(T?.importClause){let w=T.importClause.name?.getText(r);return w===c?(m="default",h=w):T.importClause.namedBindings&&L.default.isNamedImports(T.importClause.namedBindings)&&(m="named",T.importClause.namedBindings.elements.forEach(b=>{b.name.getText(r)===c&&(h=b.name.getText(r))})),h&&L.default.isStringLiteral(T.moduleSpecifier)&&(D=T.moduleSpecifier.text),!0}}return!1},v=function(F){if((L.default.isJsxOpeningElement(F)||L.default.isJsxSelfClosingElement(F))&&L.default.isIdentifier(F.tagName)){c=F.tagName.getText(r),S(F.tagName);return}else if(L.default.isTaggedTemplateExpression(F)&&L.default.isIdentifier(F.tag)&&F.tag.escapedText==="html"){if(L.default.isTemplateExpression(F.template)){let U=F.template.templateSpans.find(T=>L.default.isIdentifier(T.expression)&&Gm(T.expression.text)&&S(T.expression));if(U&&L.default.isIdentifier(U.expression)){c=U.expression.text;return}}let B=F.template.getText(r).match(/^`\s*<([^\s]+)/);if(B){c=B[1];return}}else L.default.forEachChild(F,v)};var g=S,f=v;if(x.parameters[0].type){let F=x.parameters[0].type.getText(r),B=Xs(F);B&&(p=B)}L.default.forEachChild(x,v),l=x.getText(r).replace(/^mapper/,"function Mapper"),u=$o(l);break}case"designTokenMapper":if(L.default.isMethodDeclaration(x)){l=x.getText(r).replace(/^designTokenMapper/,"function Mapper"),u=$o(l),o="design-tokens";break}case"genericMapper":if(L.default.isMethodDeclaration(x)){l=x.getText(r).replace(/^genericMapper/,"function Mapper"),u=$o(l),o="*";break}}}if(!o&&!d)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&&!l)throw new Error("Invalid figmaMapping call, no original mapper found");return{builderName:c,figmaName:s??p,figmaKey:o,figmaUrl:d,inputMapper:u,exportType:m,importName:h,importPath:D,originalInputMapper:l,imports:ef(r),source:"cli"}}function Gm(e){return e.charAt(0)===e.charAt(0).toUpperCase()}function $o(e){return L.default.transpile(e,{target:L.default.ScriptTarget.Latest,allowNonTsExtensions:!0,moduleResolution:L.default.ModuleResolutionKind.NodeJs,module:L.default.ModuleKind.CommonJS,noImplicitAny:!1,esModuleInterop:!0,noUnusedLocals:!1,noUnusedParameters:!1,jsx:L.default.JsxEmit.React,jsxFactory:"React.createElement",jsxFragmentFactory:"React.Fragment",allowJs:!0,checkJs:!0,strict:!0,suppressImplicitAnyIndexErrors:!0,typeRoots:["node_modules/@types"],inlineSources:!0,inlineSourceMap:!0})}function Qm(e){let t=e;for(;t;){if(L.default.isImportDeclaration(t))return t;t=t.parent}}function Ym(e,t){return L.default.isCallExpression(e)&&e.expression.getText(t)===Jm}async function Zs(e){let t=["node_modules","dist","build","public"];return(await e.readdirRecursive(e.getAppRootDir(),t)).filter(n=>he(n))}function Xs(e){let t=e.match(/^Figma(\w+)Props$/);if(t&&typeof t[1]=="string")return t[1]}async function eu(e,t,r,n=!1){try{return r||(r=await er(e)),await r.setPublicApiKey({publicApiKey:t}),n&&await r.ensureFigmaImportPage(),!0}catch(i){return e.Sentry?.captureException(i,{level:"warning"}),!1}}var Xm={getCanonicalFileName:e=>e,getCurrentDirectory:()=>L.default.sys.getCurrentDirectory(),getNewLine:()=>L.default.sys.newLine};function Zm(e){return L.default.formatDiagnosticsWithColorAndContext(e,Xm)}async function tu({sys:e,mappingFiles:t,typeCheck:r}){if(e.Sentry?.setContext("findMappings",{mappingFiles:t}),!t.length)return{mapperFiles:[],figmaBuilderLinks:[],figmaLinksToResolve:[],diagnostics:[]};let n=[],i=[],a=[],o=await Z(e,t),s=o.getTypeChecker(),u=o.getSyntacticDiagnostics().filter(ko).filter(p=>p.file?.fileName?t.includes(p.file.fileName):!1);if(u.length>0)return K.error(`At least one of the mappings contain syntactic errors:
|
|
1298
|
+
|
|
1299
|
+
${Zm(u)}`),rt(1);let l=[...r?o.getSemanticDiagnostics():[]].filter(ko);for(let p of t)try{let m=o.getSourceFile(p);if(!m){e.Sentry?.captureException(new Error("Could not find source file"),{extra:{file:p,sourceFiles:o.getSourceFiles().map(d=>d.fileName)},level:"warning"});continue}let h=m?.fileName;if(i.push({filePath:p,content:m.getText()}),h){let d=l.filter(g=>g.file?.fileName===h);d.length>0&&a.push(...d)}let D=await Wm(e,m,s);n.push(...D)}catch(m){return e.Sentry?.captureException(m),await rt(1)}let c=n.filter(p=>p.figmaUrl&&!p.figmaKey).map(p=>p.figmaUrl);return{mapperFiles:i,figmaBuilderLinks:n,figmaLinksToResolve:c,diagnostics:a}}function ef(e){let t=[];for(let r of e.statements){if(!L.default.isImportDeclaration(r)||!r.importClause||r.importClause.isTypeOnly||!L.default.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&&L.default.isNamedImports(i))for(let a of i.elements)a.isTypeOnly||t.push({importType:"named",importName:a.name.text,importPath:n})}return t}var iu=require("crypto");var tf=5294,nf=5284,Oo=4,Lo=e=>!!(process.env.CI||e.ci),En=async(e,t,r)=>{let n=Lo(t)?{}:sf(e),i=n.spaceName,a=n.userId,o,s=process.env.BUILDER_PUBLIC_KEY??n.builderPublicKey,u=process.env.BUILDER_PRIVATE_KEY??n.builderPrivateKey,l=process.env.FIGMA_PERSONAL_TOKEN??t.figmaToken;if(l?o={access_token:l,oauth:!1}:o=n.figmaAuth,r.forceSpaceId&&!t.yes&&s&&s!==r.forceSpaceId&&(K.warning(`CLI is currently logged in space ${(0,gt.yellow)(s)},
|
|
1300
|
+
However the command required --spaceId=${(0,gt.green)(r.forceSpaceId)}`),await tn({message:"Do you wanna switch spaces?",active:"Yes",inactive:`Stay in current ${i} space`})?(s=r.forceSpaceId,u=void 0,i=void 0,a=void 0):K.warning("Staying in the current space. Some other auth issues might occur.")),Lo(t)){if(!o&&r.figmaAuth)throw new Error(`No Figma personal token found.
|
|
1282
1301
|
Please set the FIGMA_PERSONAL_TOKEN environment variable.`);if(!u&&r.builderPrivateKey)throw new Error(`No Builder private key found.
|
|
1283
1302
|
Please set the BUILDER_PRIVATE_KEY environment variable.`);if(!s&&r.builderPublicKey)throw new Error(`No Builder public key found.
|
|
1284
|
-
Please set the BUILDER_PUBLIC_KEY environment variable.`);return{figmaAuth:o,builderPublicKey:s,builderPrivateKey:u}}if((r.force||!o&&r.figmaAuth)&&(o=await
|
|
1303
|
+
Please set the BUILDER_PUBLIC_KEY environment variable.`);return{figmaAuth:o,builderPublicKey:s,builderPrivateKey:u}}if((r.force||!o&&r.figmaAuth)&&(o=await of(e),nu(e,{figmaAuth:o})),r.force||!u&&r.builderPrivateKey||!s&&r.builderPublicKey){let{privateKey:c,spaceId:p,spaceName:m,userId:h}=await af(e,r.forceSpaceId);if(r.forceSpaceId&&p!==r.forceSpaceId)throw new Error(`OAuth flow returned space ${(0,gt.yellow)(p)}, however the command specified --spaceId=${(0,gt.green)(r.forceSpaceId)}`);s=p,u=c,i=m,a=h,await Vs(a),await eu(e,p,void 0,!1),nu(e,{builderPublicKey:s,builderPrivateKey:u,spaceName:i,userId:a})}return a&&e.Sentry?.setUser({id:a,username:process.env.USER||process.env.USERNAME||"unknown"}),(i||s)&&e.Sentry?.setContext("builder",{spaceId:s,spaceName:i,userId:a}),{figmaAuth:o,builderPublicKey:s,builderPrivateKey:u,spaceName:i,userId:a}},rf="RHr2ed743waC2g2ZHMEJSn6O0NQ08L";async function of(e){let t=(0,iu.randomUUID)();return au({sys:e,name:"Figma",initialPort:tf,requestListener:async(r,n,i,a,o)=>{let s=new URL(n.url||"",`http://localhost:${r}`);if(s.pathname==="/figma-connect"){let u=s.searchParams.get("code"),l=s.searchParams.get("state"),c="nrGCqw6TLl95QJhVDi097A",p=rf,h=`Basic ${Buffer.from(`${c}:${p}`).toString("base64")}`;if(u&&t===l){let D=await At("https://api.figma.com/v1/oauth/token",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Authorization:h},body:new URLSearchParams({redirect_uri:`http://localhost:${r}/figma-connect`,code:u,grant_type:"authorization_code"}).toString()});D.ok||o(new Error("Failed to get figma access token"));let d=await D.json();i.end(`<!doctype html>
|
|
1285
1304
|
<html lang="en" dir="ltr">
|
|
1286
1305
|
<head>
|
|
1287
1306
|
<meta charset="utf-8" />
|
|
@@ -1390,7 +1409,7 @@ Please set the BUILDER_PUBLIC_KEY environment variable.`);return{figmaAuth:o,bui
|
|
|
1390
1409
|
<!--SCRIPT_PLACEHOLDER-->
|
|
1391
1410
|
</body>
|
|
1392
1411
|
</html>
|
|
1393
|
-
`.replace("{{MESSAGE}}","The CLI has authenticated correctly with Figma"),()=>{a({...
|
|
1412
|
+
`.replace("{{MESSAGE}}","The CLI has authenticated correctly with Figma"),()=>{a({...d,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 af(e,t){let r=await e.getDeviceId();return au({sys:e,name:"Builder.io",initialPort:nf,requestListener:async(n,i,a,o)=>{let s=new URL(i.url||"",`http://localhost:${n}`);s.pathname===Ct&&a.end(`<!doctype html>
|
|
1394
1413
|
<html lang="en" dir="ltr">
|
|
1395
1414
|
<head>
|
|
1396
1415
|
<meta charset="utf-8" />
|
|
@@ -1499,5 +1518,5 @@ Please set the BUILDER_PUBLIC_KEY environment variable.`);return{figmaAuth:o,bui
|
|
|
1499
1518
|
<!--SCRIPT_PLACEHOLDER-->
|
|
1500
1519
|
</body>
|
|
1501
1520
|
</html>
|
|
1502
|
-
`.replace("{{MESSAGE}}","The CLI has authenticated correctly with Builder.io"),()=>{o({privateKey:s.searchParams.get("p-key")||"",spaceId:s.searchParams.get("api-key")||"",spaceName:s.searchParams.get("org-name")||"",userId:s.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 a=new URL(Ct,`http://localhost:${n}`);a.searchParams.set(
|
|
1503
|
-
OPEN: ${(0,gt.dim)(
|
|
1521
|
+
`.replace("{{MESSAGE}}","The CLI has authenticated correctly with Builder.io"),()=>{o({privateKey:s.searchParams.get("p-key")||"",spaceId:s.searchParams.get("api-key")||"",spaceName:s.searchParams.get("org-name")||"",userId:s.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 a=new URL(Ct,`http://localhost:${n}`);a.searchParams.set(wn,(0,ou.platform)()),a.searchParams.set(bn,process.versions.node);let o=e.getFrameworks();return o.length>0&&(i.searchParams.set(Pt,o[0].name),a.searchParams.set(Pt,o[0].name)),i.searchParams.set("redirect_url",a.href),i.href}})}function nu(e,t){let r=e.getAppRootDir(),n=(0,cr.join)(r,"node_modules",".builder"),i=(0,cr.join)(n,"data.json");if((0,Qe.existsSync)(i))try{let a=(0,Qe.readFileSync)(i,"utf8");t=Object.assign(JSON.parse(a).credentials,t)}catch(a){e.Sentry?.captureException(a)}else(0,Qe.mkdirSync)(n,{recursive:!0});(0,Qe.writeFileSync)(i,JSON.stringify({credentials:t},null,2))}function sf(e){let t=e.getAppRootDir(),r=(0,cr.join)(t,"node_modules",".builder","data.json");if((0,Qe.existsSync)(r))try{let n=(0,Qe.readFileSync)(r,"utf8");return JSON.parse(n).credentials}catch(n){e.Sentry?.captureException(n)}return{}}async function au(e){let{default:t}=await import("open"),r,n,i,a=new Promise((m,h)=>{r=m,n=h}),o=e.initialPort,s=0,u=(0,ru.createServer)((m,h)=>e.requestListener(o,m,h,r,n)),l=()=>{c(),u&&("closeAllConnections"in u&&u.closeAllConnections(),u.close(m=>{m&&e.sys.Sentry?.captureException(m)}))};process.on("uncaughtExceptionMonitor",l),process.on("unhandledRejection",l),process.on("SIGINT",l),process.on("SIGTERM",l),process.on("exit",l);let c=()=>{process.removeListener("uncaughtExceptionMonitor",l),process.removeListener("unhandledRejection",l),process.removeListener("SIGINT",l),process.removeListener("SIGTERM",l),process.removeListener("exit",l)},p=()=>new Promise((m,h)=>{let D=d=>{u.removeListener("error",D),d.code==="EADDRINUSE"&&s<Oo?(K.warning(`Port ${o} is already in use, trying next port`),o++,s++,m(0)):h(d)};u.once("error",D),u.listen(o,()=>{u.removeListener("error",D);let d=u.address();m(d.port)})});try{let m=0;for(;m===0&&s<Oo;)m=await p();if(m===0)throw new Error(`Failed to find an available port after ${Oo} attempts`);let h=e.onListen(m);K.warn(`Required authenticating with ${e.name}
|
|
1522
|
+
OPEN: ${(0,gt.dim)(h)}`),i=ur(),i.start(`Waiting for ${e.name} authentication`),t(h,{wait:!1});let D=await a;return i&&i.stop(`Authenticated with ${e.name} successfully`),D}catch(m){throw i&&(i.stop(`Failed to authenticate with ${e.name}.`,-1),No("auth")),e.sys.Sentry?.captureException(m),l(),m}finally{l()}}async function uu(e,t,r,n){try{if(!e)return Jt(r,n,400,"Builder context closed");let i=mf(r);if(i.pathname===fr){if(r.method==="POST"){let a=await pf(r);if(a)try{let o=await fi(e,JSON.parse(a));return su(r,n,200,o)}catch(o){e.debug("Dev API Error",o.stack||o.message||o);let s={errors:[String(o.message||o)]};return su(r,n,500,s)}}else if(r.method==="OPTIONS"){let a={"Access-Control-Allow-Methods":"POST, OPTIONS","Access-Control-Allow-Headers":"Content-Type, Cache-Control, X-Builder-Devtools-Version"},o=r.headers.origin;o&&o!=="null"?lu(new URL(o))&&(a["Access-Control-Allow-Origin"]=o):a["Access-Control-Allow-Origin"]="*",n.writeHead(200,a),n.end();return}return Jt(r,n,405,`${fr} is an API endpoint used only during development by the Builder.io Devtools client-side script`)}if(i.pathname===dr)return uf(r,n,200,await di(e));if(i.pathname===jo){let a=i.searchParams.get(mr);return a?cf(n,302,await Ci(e,a)):Jt(r,n,400,`Missing ${mr} querystring`)}if(i.pathname===Ct)return lf(r,n,200,await Di(e));if(i.pathname===Uo){await En(e,{_:[]},{});let a=await Zs(e),{figmaBuilderLinks:o,diagnostics:s}=await tu({mappingFiles:a,sys:e});return Sn(r,n,200,"application/json",JSON.stringify({figmaBuilderLinks:o,foundErrors:s.length>0,diagnostics:s,version:2,local:!0},null,2))}return i.pathname===xt?(e.debug(`Close Dev Tools Server Requested: ${i.href}`),setTimeout(()=>{try{t.close(a=>{e.debug(`Dev Tools Server Closed Error: ${a}`)})}catch(a){e.debug(`Error closing devtools server: ${a}`)}},20),Jt(r,n,200,"Closing Dev Tools Server")):Jt(r,n,404,"Not found")}catch(i){return e?.Sentry?.captureException(i),Jt(r,n,500,`Dev Server Error: ${i}`)}}function su(e,t,r,n){Sn(e,t,r,"application/json",JSON.stringify(n))}function uf(e,t,r,n){Sn(e,t,r,"application/javascript",n)}function lf(e,t,r,n){Sn(e,t,r,"text/html",n)}function Jt(e,t,r,n){Sn(e,t,r,"text/plain",n)}function Sn(e,t,r,n,i){let a={"Content-Type":`${n}; charset=utf-8`,"Cache-Control":"no-cache, no-store, must-revalidate","X-Builder-Devtools-Version":ge},o=e.headers.origin;o&&o!=="null"?lu(new URL(o))&&(a["Access-Control-Allow-Origin"]=o):a["Access-Control-Allow-Origin"]="*",t.writeHead(r,a),t.end(i)}function lu(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 cf(e,t,r){e.writeHead(t,{Location:r}),e.end()}async function pf(e){let t="";for await(let r of e)t+=r;return t}function mf(e){let t=e.url||"/";return new URL(t,`http://${e.headers.host}`)}async function cu(e){if(globalThis.__builderDevToolsServer)return e.debug("reusing existing devtools server"),globalThis.__builderDevToolsServer.setContext(e),globalThis.__builderDevToolsServer;let t=await ff(e),r=(0,pr.createServer)((i,a)=>{uu(e,r,i,a)}),n=()=>new Promise((i,a)=>{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}`),a(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 ff(e){return new Promise(t=>{let r=e.port;try{(0,pr.request)({hostname:"localhost",port:r,path:xt,method:"GET"},i=>{i.on("end",()=>{e.debug(`${xt} - Response ended`),t(r)})}).on("error",i=>{e.debug(`${xt} - No response ${i}`),t(r)}).end()}catch(n){e.debug(`${xt} - Error ${n}`),t(r)}})}async function bo(e){let t={getPastSyncInfo:()=>null,resyncSnippet:()=>null,...e,devToolsServerUrl:"",isValid:!1,publicApiKey:"",serverShouldRestart:!1,port:e.port||5273,ignoreMissingConfig:!1},r=e.getFrameworks().map(a=>a.name).join(", ");t.debug(`create devtools ${_o} [${r}]`);let n=await cu(t);return t.devToolsServerUrl=n.url,t.port=n.port,{getUrl:()=>t.devToolsServerUrl}}var _o=ge;0&&(module.exports={createDevToolsServer,version});
|