builder.io 1.18.30 → 1.18.33

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 CHANGED
@@ -1,4 +1,4 @@
1
- var Zse=Object.create;var Sy=Object.defineProperty;var Qse=Object.getOwnPropertyDescriptor;var eoe=Object.getOwnPropertyNames;var toe=Object.getPrototypeOf,roe=Object.prototype.hasOwnProperty;var k=(t,e)=>()=>(t&&(e=t(t=0)),e);var S=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Ty=(t,e)=>{for(var r in e)Sy(t,r,{get:e[r],enumerable:!0})},FN=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of eoe(e))!roe.call(t,i)&&i!==r&&Sy(t,i,{get:()=>e[i],enumerable:!(n=Qse(e,i))||n.enumerable});return t};var z=(t,e,r)=>(r=t!=null?Zse(toe(t)):{},FN(e||!t||!t.__esModule?Sy(r,"default",{value:t,enumerable:!0}):r,t)),noe=t=>FN(Sy({},"__esModule",{value:!0}),t);var f=k(()=>{{let t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:"b3004cc2d505256dd7b6741bfb0c0021c61a50f8"}}});var IN=S((Q9e,kN)=>{f();function Cw(t){return t==null?[]:Array.isArray(t)?t:[t]}function ioe(t,e,r,n){var i,s=t[e],o=~n.string.indexOf(e)?r==null||r===!0?"":String(r):typeof r=="boolean"?r:~n.boolean.indexOf(e)?r==="false"?!1:r==="true"||(t._.push((i=+r,i*0===0?i:r)),!!r):(i=+r,i*0===0?i:r);t[e]=s==null?o:Array.isArray(s)?s.concat(o):[s,o]}kN.exports=function(t,e){t=t||[],e=e||{};var r,n,i,s,o,a={_:[]},c=0,u=0,l=0,p=t.length;let d=e.alias!==void 0,h=e.unknown!==void 0,m=e.default!==void 0;if(e.alias=e.alias||{},e.string=Cw(e.string),e.boolean=Cw(e.boolean),d)for(r in e.alias)for(n=e.alias[r]=Cw(e.alias[r]),c=0;c<n.length;c++)(e.alias[n[c]]=n.concat(r)).splice(c,1);for(c=e.boolean.length;c-- >0;)for(n=e.alias[e.boolean[c]]||[],u=n.length;u-- >0;)e.boolean.push(n[u]);for(c=e.string.length;c-- >0;)for(n=e.alias[e.string[c]]||[],u=n.length;u-- >0;)e.string.push(n[u]);if(m){for(r in e.default)if(s=typeof e.default[r],n=e.alias[r]=e.alias[r]||[],e[s]!==void 0)for(e[s].push(r),c=0;c<n.length;c++)e[s].push(n[c])}let g=h?Object.keys(e.alias):[];for(c=0;c<p;c++){if(i=t[c],i==="--"){a._=a._.concat(t.slice(++c));break}for(u=0;u<i.length&&i.charCodeAt(u)===45;u++);if(u===0)a._.push(i);else if(i.substring(u,u+3)==="no-"){if(s=i.substring(u+3),h&&!~g.indexOf(s))return e.unknown(i);a[s]=!1}else{for(l=u+1;l<i.length&&i.charCodeAt(l)!==61;l++);for(s=i.substring(u,l),o=i.substring(++l)||c+1===p||(""+t[c+1]).charCodeAt(0)===45||t[++c],n=u===2?[s]:s,l=0;l<n.length;l++){if(s=n[l],h&&!~g.indexOf(s))return e.unknown("-".repeat(u)+s);ioe(a,s,l+1<n.length||o,e)}}}if(m)for(r in e.default)a[r]===void 0&&(a[r]=e.default[r]);if(d)for(r in a)for(n=e.alias[r]||[];n.length>0;)a[n.shift()]=a[r];return a}});function soe(t){let e=[],r=tu.default.dirname(t);for(;r!==tu.default.dirname(r);){let n=tu.default.join(r,".prettierignore");Sw.default.existsSync(n)&&e.push(n);let i=tu.default.join(r,".git");if(Sw.default.existsSync(i))break;r=tu.default.dirname(r)}return e}function ooe(t){if(!t)return Ew.default;try{let r=(0,NN.createRequire)(t)("prettier");if(!r)throw new Error("Prettier not found");return r}catch{return Ew.default}}async function Ai(t,e,r,n){try{let i=tu.default.resolve(t,n??"file.tsx"),s=ooe(i);if(n){let a=soe(i);if((await s.getFileInfo(i,{ignorePath:a.length>0?a:void 0})).ignored)return e}let o=await s.resolveConfig(i);return o?await s.format(e,{...o,filepath:n,parser:r}):await s.format(e,{filepath:n,parser:r})}catch{return e}}var Ew,NN,tu,Sw,Of=k(()=>{"use strict";f();Ew=z(require("prettier"),1),NN=require("node:module"),tu=z(require("node:path"),1),Sw=z(require("node:fs"),1)});var Tw,Hl,Ay,Py,RN,ru,Aw,Pw,nu,ON,Kl=k(()=>{"use strict";f();Tw="preview-url",Hl="framework",Ay="platform",Py="node",RN="/~builder-connect",ru="/~builder-connected",Aw="/~builder-dev-tools",Pw="/~builder-dev-tools.js",nu="/~builder-dev-tools-close",ON="/mappings"});var _y=S((s5e,MN)=>{"use strict";f();var _w={to(t,e){return e?`\x1B[${e+1};${t+1}H`:`\x1B[${t+1}G`},move(t,e){let r="";return t<0?r+=`\x1B[${-t}D`:t>0&&(r+=`\x1B[${t}C`),e<0?r+=`\x1B[${-e}A`:e>0&&(r+=`\x1B[${e}B`),r},up:(t=1)=>`\x1B[${t}A`,down:(t=1)=>`\x1B[${t}B`,forward:(t=1)=>`\x1B[${t}C`,backward:(t=1)=>`\x1B[${t}D`,nextLine:(t=1)=>"\x1B[E".repeat(t),prevLine:(t=1)=>"\x1B[F".repeat(t),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},aoe={up:(t=1)=>"\x1B[S".repeat(t),down:(t=1)=>"\x1B[T".repeat(t)},coe={screen:"\x1B[2J",up:(t=1)=>"\x1B[1J".repeat(t),down:(t=1)=>"\x1B[J".repeat(t),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(t){let e="";for(let r=0;r<t;r++)e+=this.line+(r<t-1?_w.up():"");return t&&(e+=_w.left),e}};MN.exports={cursor:_w,scroll:aoe,erase:coe,beep:"\x07"}});var dr=S((a5e,Fw)=>{f();var ky=process||{},BN=ky.argv||[],Fy=ky.env||{},uoe=!(Fy.NO_COLOR||BN.includes("--no-color"))&&(!!Fy.FORCE_COLOR||BN.includes("--color")||ky.platform==="win32"||(ky.stdout||{}).isTTY&&Fy.TERM!=="dumb"||!!Fy.CI),loe=(t,e,r=t)=>n=>{let i=""+n,s=i.indexOf(e,t.length);return~s?t+poe(i,e,r,s)+e:t+i+e},poe=(t,e,r,n)=>{let i="",s=0;do i+=t.substring(s,n)+r,s=n+e.length,n=t.indexOf(e,s);while(~n);return i+t.substring(s)},LN=(t=uoe)=>{let e=t?loe:()=>String;return{isColorSupported:t,reset:e("\x1B[0m","\x1B[0m"),bold:e("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:e("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:e("\x1B[3m","\x1B[23m"),underline:e("\x1B[4m","\x1B[24m"),inverse:e("\x1B[7m","\x1B[27m"),hidden:e("\x1B[8m","\x1B[28m"),strikethrough:e("\x1B[9m","\x1B[29m"),black:e("\x1B[30m","\x1B[39m"),red:e("\x1B[31m","\x1B[39m"),green:e("\x1B[32m","\x1B[39m"),yellow:e("\x1B[33m","\x1B[39m"),blue:e("\x1B[34m","\x1B[39m"),magenta:e("\x1B[35m","\x1B[39m"),cyan:e("\x1B[36m","\x1B[39m"),white:e("\x1B[37m","\x1B[39m"),gray:e("\x1B[90m","\x1B[39m"),bgBlack:e("\x1B[40m","\x1B[49m"),bgRed:e("\x1B[41m","\x1B[49m"),bgGreen:e("\x1B[42m","\x1B[49m"),bgYellow:e("\x1B[43m","\x1B[49m"),bgBlue:e("\x1B[44m","\x1B[49m"),bgMagenta:e("\x1B[45m","\x1B[49m"),bgCyan:e("\x1B[46m","\x1B[49m"),bgWhite:e("\x1B[47m","\x1B[49m"),blackBright:e("\x1B[90m","\x1B[39m"),redBright:e("\x1B[91m","\x1B[39m"),greenBright:e("\x1B[92m","\x1B[39m"),yellowBright:e("\x1B[93m","\x1B[39m"),blueBright:e("\x1B[94m","\x1B[39m"),magentaBright:e("\x1B[95m","\x1B[39m"),cyanBright:e("\x1B[96m","\x1B[39m"),whiteBright:e("\x1B[97m","\x1B[39m"),bgBlackBright:e("\x1B[100m","\x1B[49m"),bgRedBright:e("\x1B[101m","\x1B[49m"),bgGreenBright:e("\x1B[102m","\x1B[49m"),bgYellowBright:e("\x1B[103m","\x1B[49m"),bgBlueBright:e("\x1B[104m","\x1B[49m"),bgMagentaBright:e("\x1B[105m","\x1B[49m"),bgCyanBright:e("\x1B[106m","\x1B[49m"),bgWhiteBright:e("\x1B[107m","\x1B[49m")}};Fw.exports=LN();Fw.exports.createColors=LN});function doe({onlyFirst:t=!1}={}){let e=["[\\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(e,t?void 0:"g")}function JN(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(foe,"")}function YN(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Mf(t,e={}){if(typeof t!="string"||t.length===0||(e={ambiguousIsNarrow:!0,...e},t=JN(t),t.length===0))return 0;t=t.replace(yoe()," ");let r=e.ambiguousIsNarrow?1:2,n=0;for(let i of t){let s=i.codePointAt(0);if(!(s<=31||s>=127&&s<=159||s>=768&&s<=879))switch(hoe.eastAsianWidth(i)){case"F":case"W":n+=2;break;case"A":n+=r;break;default:n+=1}}return n}function xoe(){let t=new Map;for(let[e,r]of Object.entries(ir)){for(let[n,i]of Object.entries(r))ir[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},r[n]=ir[n],t.set(i[0],i[1]);Object.defineProperty(ir,e,{value:r,enumerable:!1})}return Object.defineProperty(ir,"codes",{value:t,enumerable:!1}),ir.color.close="\x1B[39m",ir.bgColor.close="\x1B[49m",ir.color.ansi=$N(),ir.color.ansi256=jN(),ir.color.ansi16m=UN(),ir.bgColor.ansi=$N(kw),ir.bgColor.ansi256=jN(kw),ir.bgColor.ansi16m=UN(kw),Object.defineProperties(ir,{rgbToAnsi256:{value:(e,r,n)=>e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:e=>{let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(s=>s+s).join(""));let i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:e=>ir.rgbToAnsi256(...ir.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:e=>{if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,n,i;if(e>=232)r=((e-232)*10+8)/255,n=r,i=r;else{e-=16;let a=e%36;r=Math.floor(e/36)/5,n=Math.floor(a/6)/5,i=a%6/5}let s=Math.max(r,n,i)*2;if(s===0)return 30;let o=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(r));return s===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(e,r,n)=>ir.ansi256ToAnsi(ir.rgbToAnsi256(e,r,n)),enumerable:!1},hexToAnsi:{value:e=>ir.ansi256ToAnsi(ir.hexToAnsi256(e)),enumerable:!1}}),ir}function GN(t,e,r){return String(t).normalize().replace(/\r\n/g,`
1
+ var Zse=Object.create;var Sy=Object.defineProperty;var Qse=Object.getOwnPropertyDescriptor;var eoe=Object.getOwnPropertyNames;var toe=Object.getPrototypeOf,roe=Object.prototype.hasOwnProperty;var k=(t,e)=>()=>(t&&(e=t(t=0)),e);var S=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Ty=(t,e)=>{for(var r in e)Sy(t,r,{get:e[r],enumerable:!0})},FN=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of eoe(e))!roe.call(t,i)&&i!==r&&Sy(t,i,{get:()=>e[i],enumerable:!(n=Qse(e,i))||n.enumerable});return t};var z=(t,e,r)=>(r=t!=null?Zse(toe(t)):{},FN(e||!t||!t.__esModule?Sy(r,"default",{value:t,enumerable:!0}):r,t)),noe=t=>FN(Sy({},"__esModule",{value:!0}),t);var f=k(()=>{{let t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:"ffc3e54879256b6263c24536da1f8b8360764556"}}});var IN=S((Q9e,kN)=>{f();function Cw(t){return t==null?[]:Array.isArray(t)?t:[t]}function ioe(t,e,r,n){var i,s=t[e],o=~n.string.indexOf(e)?r==null||r===!0?"":String(r):typeof r=="boolean"?r:~n.boolean.indexOf(e)?r==="false"?!1:r==="true"||(t._.push((i=+r,i*0===0?i:r)),!!r):(i=+r,i*0===0?i:r);t[e]=s==null?o:Array.isArray(s)?s.concat(o):[s,o]}kN.exports=function(t,e){t=t||[],e=e||{};var r,n,i,s,o,a={_:[]},c=0,u=0,l=0,p=t.length;let d=e.alias!==void 0,h=e.unknown!==void 0,m=e.default!==void 0;if(e.alias=e.alias||{},e.string=Cw(e.string),e.boolean=Cw(e.boolean),d)for(r in e.alias)for(n=e.alias[r]=Cw(e.alias[r]),c=0;c<n.length;c++)(e.alias[n[c]]=n.concat(r)).splice(c,1);for(c=e.boolean.length;c-- >0;)for(n=e.alias[e.boolean[c]]||[],u=n.length;u-- >0;)e.boolean.push(n[u]);for(c=e.string.length;c-- >0;)for(n=e.alias[e.string[c]]||[],u=n.length;u-- >0;)e.string.push(n[u]);if(m){for(r in e.default)if(s=typeof e.default[r],n=e.alias[r]=e.alias[r]||[],e[s]!==void 0)for(e[s].push(r),c=0;c<n.length;c++)e[s].push(n[c])}let g=h?Object.keys(e.alias):[];for(c=0;c<p;c++){if(i=t[c],i==="--"){a._=a._.concat(t.slice(++c));break}for(u=0;u<i.length&&i.charCodeAt(u)===45;u++);if(u===0)a._.push(i);else if(i.substring(u,u+3)==="no-"){if(s=i.substring(u+3),h&&!~g.indexOf(s))return e.unknown(i);a[s]=!1}else{for(l=u+1;l<i.length&&i.charCodeAt(l)!==61;l++);for(s=i.substring(u,l),o=i.substring(++l)||c+1===p||(""+t[c+1]).charCodeAt(0)===45||t[++c],n=u===2?[s]:s,l=0;l<n.length;l++){if(s=n[l],h&&!~g.indexOf(s))return e.unknown("-".repeat(u)+s);ioe(a,s,l+1<n.length||o,e)}}}if(m)for(r in e.default)a[r]===void 0&&(a[r]=e.default[r]);if(d)for(r in a)for(n=e.alias[r]||[];n.length>0;)a[n.shift()]=a[r];return a}});function soe(t){let e=[],r=tu.default.dirname(t);for(;r!==tu.default.dirname(r);){let n=tu.default.join(r,".prettierignore");Sw.default.existsSync(n)&&e.push(n);let i=tu.default.join(r,".git");if(Sw.default.existsSync(i))break;r=tu.default.dirname(r)}return e}function ooe(t){if(!t)return Ew.default;try{let r=(0,NN.createRequire)(t)("prettier");if(!r)throw new Error("Prettier not found");return r}catch{return Ew.default}}async function Ai(t,e,r,n){try{let i=tu.default.resolve(t,n??"file.tsx"),s=ooe(i);if(n){let a=soe(i);if((await s.getFileInfo(i,{ignorePath:a.length>0?a:void 0})).ignored)return e}let o=await s.resolveConfig(i);return o?await s.format(e,{...o,filepath:n,parser:r}):await s.format(e,{filepath:n,parser:r})}catch{return e}}var Ew,NN,tu,Sw,Of=k(()=>{"use strict";f();Ew=z(require("prettier"),1),NN=require("node:module"),tu=z(require("node:path"),1),Sw=z(require("node:fs"),1)});var Tw,Hl,Ay,Py,RN,ru,Aw,Pw,nu,ON,Kl=k(()=>{"use strict";f();Tw="preview-url",Hl="framework",Ay="platform",Py="node",RN="/~builder-connect",ru="/~builder-connected",Aw="/~builder-dev-tools",Pw="/~builder-dev-tools.js",nu="/~builder-dev-tools-close",ON="/mappings"});var _y=S((s5e,MN)=>{"use strict";f();var _w={to(t,e){return e?`\x1B[${e+1};${t+1}H`:`\x1B[${t+1}G`},move(t,e){let r="";return t<0?r+=`\x1B[${-t}D`:t>0&&(r+=`\x1B[${t}C`),e<0?r+=`\x1B[${-e}A`:e>0&&(r+=`\x1B[${e}B`),r},up:(t=1)=>`\x1B[${t}A`,down:(t=1)=>`\x1B[${t}B`,forward:(t=1)=>`\x1B[${t}C`,backward:(t=1)=>`\x1B[${t}D`,nextLine:(t=1)=>"\x1B[E".repeat(t),prevLine:(t=1)=>"\x1B[F".repeat(t),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},aoe={up:(t=1)=>"\x1B[S".repeat(t),down:(t=1)=>"\x1B[T".repeat(t)},coe={screen:"\x1B[2J",up:(t=1)=>"\x1B[1J".repeat(t),down:(t=1)=>"\x1B[J".repeat(t),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(t){let e="";for(let r=0;r<t;r++)e+=this.line+(r<t-1?_w.up():"");return t&&(e+=_w.left),e}};MN.exports={cursor:_w,scroll:aoe,erase:coe,beep:"\x07"}});var dr=S((a5e,Fw)=>{f();var ky=process||{},BN=ky.argv||[],Fy=ky.env||{},uoe=!(Fy.NO_COLOR||BN.includes("--no-color"))&&(!!Fy.FORCE_COLOR||BN.includes("--color")||ky.platform==="win32"||(ky.stdout||{}).isTTY&&Fy.TERM!=="dumb"||!!Fy.CI),loe=(t,e,r=t)=>n=>{let i=""+n,s=i.indexOf(e,t.length);return~s?t+poe(i,e,r,s)+e:t+i+e},poe=(t,e,r,n)=>{let i="",s=0;do i+=t.substring(s,n)+r,s=n+e.length,n=t.indexOf(e,s);while(~n);return i+t.substring(s)},LN=(t=uoe)=>{let e=t?loe:()=>String;return{isColorSupported:t,reset:e("\x1B[0m","\x1B[0m"),bold:e("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:e("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:e("\x1B[3m","\x1B[23m"),underline:e("\x1B[4m","\x1B[24m"),inverse:e("\x1B[7m","\x1B[27m"),hidden:e("\x1B[8m","\x1B[28m"),strikethrough:e("\x1B[9m","\x1B[29m"),black:e("\x1B[30m","\x1B[39m"),red:e("\x1B[31m","\x1B[39m"),green:e("\x1B[32m","\x1B[39m"),yellow:e("\x1B[33m","\x1B[39m"),blue:e("\x1B[34m","\x1B[39m"),magenta:e("\x1B[35m","\x1B[39m"),cyan:e("\x1B[36m","\x1B[39m"),white:e("\x1B[37m","\x1B[39m"),gray:e("\x1B[90m","\x1B[39m"),bgBlack:e("\x1B[40m","\x1B[49m"),bgRed:e("\x1B[41m","\x1B[49m"),bgGreen:e("\x1B[42m","\x1B[49m"),bgYellow:e("\x1B[43m","\x1B[49m"),bgBlue:e("\x1B[44m","\x1B[49m"),bgMagenta:e("\x1B[45m","\x1B[49m"),bgCyan:e("\x1B[46m","\x1B[49m"),bgWhite:e("\x1B[47m","\x1B[49m"),blackBright:e("\x1B[90m","\x1B[39m"),redBright:e("\x1B[91m","\x1B[39m"),greenBright:e("\x1B[92m","\x1B[39m"),yellowBright:e("\x1B[93m","\x1B[39m"),blueBright:e("\x1B[94m","\x1B[39m"),magentaBright:e("\x1B[95m","\x1B[39m"),cyanBright:e("\x1B[96m","\x1B[39m"),whiteBright:e("\x1B[97m","\x1B[39m"),bgBlackBright:e("\x1B[100m","\x1B[49m"),bgRedBright:e("\x1B[101m","\x1B[49m"),bgGreenBright:e("\x1B[102m","\x1B[49m"),bgYellowBright:e("\x1B[103m","\x1B[49m"),bgBlueBright:e("\x1B[104m","\x1B[49m"),bgMagentaBright:e("\x1B[105m","\x1B[49m"),bgCyanBright:e("\x1B[106m","\x1B[49m"),bgWhiteBright:e("\x1B[107m","\x1B[49m")}};Fw.exports=LN();Fw.exports.createColors=LN});function doe({onlyFirst:t=!1}={}){let e=["[\\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(e,t?void 0:"g")}function JN(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(foe,"")}function YN(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Mf(t,e={}){if(typeof t!="string"||t.length===0||(e={ambiguousIsNarrow:!0,...e},t=JN(t),t.length===0))return 0;t=t.replace(yoe()," ");let r=e.ambiguousIsNarrow?1:2,n=0;for(let i of t){let s=i.codePointAt(0);if(!(s<=31||s>=127&&s<=159||s>=768&&s<=879))switch(hoe.eastAsianWidth(i)){case"F":case"W":n+=2;break;case"A":n+=r;break;default:n+=1}}return n}function xoe(){let t=new Map;for(let[e,r]of Object.entries(ir)){for(let[n,i]of Object.entries(r))ir[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},r[n]=ir[n],t.set(i[0],i[1]);Object.defineProperty(ir,e,{value:r,enumerable:!1})}return Object.defineProperty(ir,"codes",{value:t,enumerable:!1}),ir.color.close="\x1B[39m",ir.bgColor.close="\x1B[49m",ir.color.ansi=$N(),ir.color.ansi256=jN(),ir.color.ansi16m=UN(),ir.bgColor.ansi=$N(kw),ir.bgColor.ansi256=jN(kw),ir.bgColor.ansi16m=UN(kw),Object.defineProperties(ir,{rgbToAnsi256:{value:(e,r,n)=>e===r&&r===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value:e=>{let r=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!r)return[0,0,0];let[n]=r;n.length===3&&(n=[...n].map(s=>s+s).join(""));let i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:e=>ir.rgbToAnsi256(...ir.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value:e=>{if(e<8)return 30+e;if(e<16)return 90+(e-8);let r,n,i;if(e>=232)r=((e-232)*10+8)/255,n=r,i=r;else{e-=16;let a=e%36;r=Math.floor(e/36)/5,n=Math.floor(a/6)/5,i=a%6/5}let s=Math.max(r,n,i)*2;if(s===0)return 30;let o=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(r));return s===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(e,r,n)=>ir.ansi256ToAnsi(ir.rgbToAnsi256(e,r,n)),enumerable:!1},hexToAnsi:{value:e=>ir.ansi256ToAnsi(ir.hexToAnsi256(e)),enumerable:!1}}),ir}function GN(t,e,r){return String(t).normalize().replace(/\r\n/g,`
2
2
  `).split(`
3
3
  `).map(n=>Toe(n,e,r)).join(`
4
4
  `)}function Bw(t,e){if(typeof t=="string")return Ny.aliases.get(t)===e;for(let r of t)if(r!==void 0&&Bw(r,e))return!0;return!1}function Poe(t,e){if(t===e)return;let r=t.split(`
@@ -73,7 +73,7 @@ ${iR}${n.trimStart()}`),r=3+(0,iu.stripVTControlCharacters)(n.trimStart()).lengt
73
73
  `),m(),i()};return{start:D,stop:w,message:(v="")=>{a=y(v??a)}}}});function dt(t,e=""){return t.ts.createSourceFile("module.tsx",typeof e=="string"?e:"",t.ts.ScriptTarget.Latest,void 0)}function jy(t,e=""){let r=dt(t,e?.trim());if(r.statements.length===0)throw new Error(`No statements found in code: ${e}`);return r.statements[0]}function Ur(t,e,r){if(e){let n=t.ts.createPrinter({newLine:t.ts.NewLineKind.LineFeed,removeComments:r});return t.ts.isSourceFile(e)?n.printFile(e).trim()+`
74
74
  `:n.printNode(t.ts.EmitHint.Unspecified,e,t.ts.createSourceFile("module.tsx","",t.ts.ScriptTarget.Latest)).trim()+`
75
75
  `}return""}var mr=k(()=>{"use strict";f()});var dR=S((C5e,pR)=>{"use strict";f();pR.exports=function(){if(process.env.npm_config_user_agent)return Voe(process.env.npm_config_user_agent)};function Voe(t){let e=t.split(" ")[0],r=e.lastIndexOf("/"),n=e.substring(0,r);return{name:n==="npminstall"?"cnpm":n,version:e.substring(r+1)}}});function In(t){return t.endsWith(".mapper.tsx")||t.endsWith(".mapper.jsx")||t.endsWith(".mapper.ts")||t.endsWith(".mapper.js")||t.endsWith(".mapper.mjs")}function ft(t,e,r){e=_s(e),r=_s(r),e=t.dirname(e);let n=t.basename(r,t.extname(r));r=t.dirname(r);let i;return n==="index"?i=t.relative(e,r):i=t.relative(e,t.join(r,n)),i=_s(t.normalize(i)),i.startsWith(".")||(i="./"+i),i}function _s(t){return t.startsWith("\\\\?\\")?t:t.replace(/\\/g,"/")}function su(t,e){let r=t.extname(e),n=t.basename(e,r).split(/[\/\\]/),i=n[n.length-1];return fR(i==="index"?t.basename(t.dirname(e)):i)}function fR(t){return Ht(t).replace(/ /g,"")}function Gi(t,e){let r=t.extname(e),n=_s(t.basename(e,r)).split("/").pop();return Ht(n==="index"?t.basename(t.dirname(e)):n)}function Kt(t,e){let r=_s(t.relative(t.getAppRootDir(),e));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=t.getFrameworks();return r.startsWith("src/")&&(r=r.slice(4)),n.some(i=>i.name.includes("next"))?"@/"+r:"~/"+r}function Tt(t,e){let r=e,n=[];for(let i=0;i<2;i++){let s=t.basename(r);if(!s||s==="components")break;n.unshift(s),r=t.dirname(r)}return n.join("/")}function Ht(t){for(t=t.replace(/([A-Z])/g," $1").replace(/\./g," ").replace(/_/g," ").replace(/-/g," ").replace(/\s/g," ").trim();t.includes(" ");)t=t.replace(/ /g," ");return t.split(" ").map(e=>e.length>2?e[0].toUpperCase()+e.slice(1):e).join("").trim()}function ni(t){return t.sort((e,r)=>e.name.toLocaleLowerCase().localeCompare(r.name.toLocaleLowerCase()))}async function qt(t,e,r,n){if(typeof r!="string"||r==="")throw new Error(`getComponentId(), exportName must be a non-empty string, received: ${r}, ${e}`);return n&&(e=n),e=t.normalize(e),(await t.hash(e+"#"+r)).substring(0,8)}async function hR(t){return(await t.hash(t.getAppRootDir())).substring(0,8)}function $f(t){return typeof t=="number"}function Yl(t){return typeof t=="boolean"}function Nn(t){return typeof t=="string"}function Xl(t){return typeof t=="string"?/^[A-Z][A-Za-z0-9]*$/.test(t):!1}function _i(t){return JSON.parse(JSON.stringify(t))}function Uy(t,e,r){for(let n of e)if(t.dirname(r).includes(n))return!0;return!1}function gR(){try{let t=(0,mR.default)();if(t?.name)return t.name}catch{}return"npm"}function Hoe(){return process.platform.startsWith("win")}function sr(){return Hoe()?'"@builder.io/dev-tools"':"builder.io"}function zw(t){return t.replace(/[^a-zA-Z0-9-_]/g,"_")}var mR,st=k(()=>{"use strict";f();mR=z(dR(),1)});function Rn(t){let e=t.join(t.getAppRootDir(),"tsconfig.json");return t.exists(e)}async function ii(t,e){async function r(i,s){if(s>10)return;let o=await t.readdir(i);for(let a of o){if(Koe.includes(a))continue;let c=t.join(i,a),u=await t.stat(c);if(u){if(u.isFile()&&a.startsWith("builder-registry."))return c;if(u.isDirectory()){let l=await r(c,s+1);if(l)return l}}}}let n=await r(t.getAppRootDir(),0);if(!n){let s=`builder-registry.${await Rn(t)?"ts":"js"}`;return t.join(e,s)}return n}async function Fs(t,e){let r=t.resolve("/");for(let n=0;n<20;n++){let i=t.join(e,"package.json"),s=await t.readFile(i);if(s)return JSON.parse(s);if(e===r)break;e=t.dirname(e)}return null}async function yR(t,e){for(let r=0;r<20;r++){let n=t.dirname(e),i=t.join(n,"node_modules");if(await t.exists(i))return i;if(e===t.getAppRootDir())break;e=t.dirname(e)}return t.join(t.getAppRootDir(),"node_modules")}async function jf(t,e,r){let n=await t.readdir(e);return n.includes(r)?t.join(e,r):(await Promise.all(n.map(async s=>{if(s.startsWith(".")||s==="node_modules")return;let o=t.join(e,s);if((await t.stat(o)).isDirectory()){let c=await jf(t,o,r);if(c)return c}}))).find(s=>typeof s=="string")}var Koe,hn=k(()=>{"use strict";f();Koe=["node_modules","dist","build","public"]});async function Rr(t,e,r){if(!Array.isArray(e)||e.length===0)throw new Error(`createTsProgram() Invalid filePaths: ${e}`);let n=await yR(t,e[0]),i=t.join(n,"typescript","lib"),s=new Map,o={fileExists:a=>{if(a=t.normalize(a),a.includes("node_modules")){let c=Uf.get(a);if(!c){try{t.statSync(a).isFile()?c={exists:!0,content:t.readFileSync(a)}:c={exists:!1}}catch{c={exists:!1}}Uf.set(a,c)}return c.exists}if(!s.has(a))if(t.existsSync(a)){let u=t.statSync(a);s.set(a,u.isFile())}else s.set(a,!1);return s.get(a)},getCanonicalFileName:a=>t.normalize(a),getCurrentDirectory:()=>t.cwd(),getDefaultLibFileName:()=>t.join(i,"lib.d.ts"),getDefaultLibLocation:()=>i,getNewLine:()=>`
76
- `,getSourceFile:a=>{if(a=t.normalize(a),a.includes("node_modules")){let u=Uf.get(a);if(u)return dt(t,u.content)}let c;try{c=t.readFileSync(a)}catch{console.error(`Could not read: ${a}`),c==null}if(c==null){let u=t.basename(a),l=t.extname(u).toLowerCase();if(a.startsWith(i)&&l===".ts"&&(c=vR.get(u),c==null&&typeof self<"u"&&typeof fetch=="function"))throw new zy(u)}return a.includes("node_modules")&&(c?Uf.set(a,{exists:!0,content:c}):Uf.set(a,{exists:!1})),dt(t,c)},readFile:a=>{let c=t.readFileSync(a);return typeof c=="string"?c:void 0},useCaseSensitiveFileNames:()=>!1,writeFile:()=>{}};for(;;)try{return Woe(t,o,e,r)}catch(a){if(a instanceof zy){await Joe(t,a.libName);continue}throw t.Sentry?.captureException(a),new Error(`createTsProgram() Could not create program for: ${e[0]}`,{cause:a})}}function Woe(t,e,r,n){let i={rootNames:[...r],host:e,options:{}},s=t.ts.findConfigFile(t.dirname(r[0]),o=>t.existsSync(o));if(s){let o=bR.get(s);if(!o){let a=t.ts.readConfigFile(s,c=>{let u=t.readFileSync(c);return typeof u=="string"?u:void 0});a.error?t.Sentry?.captureException(new Error("Error reading tsconfig for createTsProgram"),{extra:{error:a.error,tsConfigPath:s}}):(o=t.ts.parseJsonConfigFileContent(a.config,t.ts.sys||{useCaseSensitiveFileNames:!1,readDirectory:(u,l)=>t.readdirSync(u),fileExists:u=>t.existsSync(u),readFile:u=>t.readFileSync(u)||void 0},t.dirname(s),void 0,s).options,bR.set(s,o))}o&&(i.options=_i(o))}return i.options.noEmit=!0,i.options.isolatedModules=!1,i.options.strict=!1,i.options.jsx=t.ts.JsxEmit.Preserve,i.options.allowJs=!0,Object.assign(i.options,n),t.ts.createProgram(i)}async function Zl(t,e,r){r||(r=await Rr(t,[e]));let n=r.getSourceFile(e);if(!n)throw new Error(`getTypeChecker() Could not find source file: ${e}`);return{typeChecker:r.getTypeChecker(),sourceFile:n}}async function Joe(t,e){let r=`https://cdn.jsdelivr.net/npm/typescript@${t.ts.version}/lib/${e}`;qy.has(e)||qy.set(e,fetch(r).then(n=>n.text()).then(n=>{vR.set(e,n)})),await qy.get(e),qy.delete(e)}async function xR(t,e){let r=await t.readFile(e.filePath);return r==null?{diagnostics:[{messageText:`Error reading: ${e.filePath}`}],code:null,output:null}:Gw(t,{code:r,filePath:e.filePath,compilerOptions:e.compilerOptions})}function Gw(t,e){let r={diagnostics:[],code:e.code,output:null};try{let n=t.ts.transpileModule(e.code,{compilerOptions:e.compilerOptions,fileName:e.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 zy,vR,qy,Uf,bR,Vi=k(()=>{"use strict";f();mr();st();hn();zy=class{libName;constructor(e){this.libName=e}};vR=new Map,qy=new Map,Uf=new Map,bR=new Map});var Yoe,Ue,_r=k(()=>{"use strict";f();Yoe="1.18.30",Ue=process.env.OVERRIDE_VERSION??Yoe});async function ou(t){let e=[],r=await Fs(t,t.getRepoRootDir());if(r){let n=await wR(r,t);e.push(...n)}return e}async function wR(t,e){let r=[];if(t&&typeof t=="object"){let n=new Set(Object.keys({...t.dependencies,...t.devDependencies}));for(let i of Xoe)if(n.has(i)&&!r.some(s=>s.name===i)){let s={name:i};DR.has(i)&&(s.version=await DR.get(i)(e)),r.push(s)}}return r}function Vw(t){let e=parseInt(t);return Number.isNaN(e)?void 0:e}var DR,Xoe,au=k(()=>{"use strict";f();hn();st();DR=new Map([["next",async t=>{if(!t.spawnSync)return;let e=gR(),r=e==="npm"?"npx":e,{stdout:n}=t.spawnSync(r,["next","-v"],{encoding:"utf8"});if(!n)return;let i=n.match(/(Next.js v)([\d.]+)/g);if(!i)return;let s=i[0].split("Next.js v")[1],[o,a,c]=s.split(".");return{major:Vw(o),minor:Vw(a),patch:Vw(c)}}]]),Xoe=["@shopify/remix-oxygen","@shopify/hydrogen","@builder.io/qwik-city","@remix-run/react","@sveltejs/kit","astro","gatsby","next","nuxt","@builder.io/qwik","@angular/core","react","solid-js","svelte","vue"]});async function Hi(t){let e=CR(t),r=await t.readFile(e);return typeof r=="string"?JSON.parse(r):{}}async function Ki(t,e){e=typeof e=="object"&&e!=null?e:{};let r=CR(t);await t.writeFile(r,JSON.stringify(e??{},null,2))}function CR(t){let e=t.getAppRootDir();return t.join(e,"node_modules",".builder","builder-cache.json")}var cu=k(()=>{"use strict";f()});async function so(t,e,r){let n={envKey:r,envValue:null,file:""};for(let i of e){let s=t.join(t.getAppRootDir(),i),o=await Zoe(t,s);if(o){let a=o[r];if(typeof a=="string"&&a.length>0&&a!=="YOUR_API_KEY")return n.envValue=a,n.file=s,n}}return n.file=t.join(t.getAppRootDir(),e[e.length-1]),n}async function Zoe(t,e){let r=await t.readFile(e);return typeof r=="string"?ER(r):null}function ER(t){let e={},r=t.replace(/\r\n?/gm,`
76
+ `,getSourceFile:a=>{if(a=t.normalize(a),a.includes("node_modules")){let u=Uf.get(a);if(u)return dt(t,u.content)}let c;try{c=t.readFileSync(a)}catch{console.error(`Could not read: ${a}`),c==null}if(c==null){let u=t.basename(a),l=t.extname(u).toLowerCase();if(a.startsWith(i)&&l===".ts"&&(c=vR.get(u),c==null&&typeof self<"u"&&typeof fetch=="function"))throw new zy(u)}return a.includes("node_modules")&&(c?Uf.set(a,{exists:!0,content:c}):Uf.set(a,{exists:!1})),dt(t,c)},readFile:a=>{let c=t.readFileSync(a);return typeof c=="string"?c:void 0},useCaseSensitiveFileNames:()=>!1,writeFile:()=>{}};for(;;)try{return Woe(t,o,e,r)}catch(a){if(a instanceof zy){await Joe(t,a.libName);continue}throw t.Sentry?.captureException(a),new Error(`createTsProgram() Could not create program for: ${e[0]}`,{cause:a})}}function Woe(t,e,r,n){let i={rootNames:[...r],host:e,options:{}},s=t.ts.findConfigFile(t.dirname(r[0]),o=>t.existsSync(o));if(s){let o=bR.get(s);if(!o){let a=t.ts.readConfigFile(s,c=>{let u=t.readFileSync(c);return typeof u=="string"?u:void 0});a.error?t.Sentry?.captureException(new Error("Error reading tsconfig for createTsProgram"),{extra:{error:a.error,tsConfigPath:s}}):(o=t.ts.parseJsonConfigFileContent(a.config,t.ts.sys||{useCaseSensitiveFileNames:!1,readDirectory:(u,l)=>t.readdirSync(u),fileExists:u=>t.existsSync(u),readFile:u=>t.readFileSync(u)||void 0},t.dirname(s),void 0,s).options,bR.set(s,o))}o&&(i.options=_i(o))}return i.options.noEmit=!0,i.options.isolatedModules=!1,i.options.strict=!1,i.options.jsx=t.ts.JsxEmit.Preserve,i.options.allowJs=!0,Object.assign(i.options,n),t.ts.createProgram(i)}async function Zl(t,e,r){r||(r=await Rr(t,[e]));let n=r.getSourceFile(e);if(!n)throw new Error(`getTypeChecker() Could not find source file: ${e}`);return{typeChecker:r.getTypeChecker(),sourceFile:n}}async function Joe(t,e){let r=`https://cdn.jsdelivr.net/npm/typescript@${t.ts.version}/lib/${e}`;qy.has(e)||qy.set(e,fetch(r).then(n=>n.text()).then(n=>{vR.set(e,n)})),await qy.get(e),qy.delete(e)}async function xR(t,e){let r=await t.readFile(e.filePath);return r==null?{diagnostics:[{messageText:`Error reading: ${e.filePath}`}],code:null,output:null}:Gw(t,{code:r,filePath:e.filePath,compilerOptions:e.compilerOptions})}function Gw(t,e){let r={diagnostics:[],code:e.code,output:null};try{let n=t.ts.transpileModule(e.code,{compilerOptions:e.compilerOptions,fileName:e.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 zy,vR,qy,Uf,bR,Vi=k(()=>{"use strict";f();mr();st();hn();zy=class{libName;constructor(e){this.libName=e}};vR=new Map,qy=new Map,Uf=new Map,bR=new Map});var Yoe,Ue,_r=k(()=>{"use strict";f();Yoe="1.18.33",Ue=process.env.OVERRIDE_VERSION??Yoe});async function ou(t){let e=[],r=await Fs(t,t.getRepoRootDir());if(r){let n=await wR(r,t);e.push(...n)}return e}async function wR(t,e){let r=[];if(t&&typeof t=="object"){let n=new Set(Object.keys({...t.dependencies,...t.devDependencies}));for(let i of Xoe)if(n.has(i)&&!r.some(s=>s.name===i)){let s={name:i};DR.has(i)&&(s.version=await DR.get(i)(e)),r.push(s)}}return r}function Vw(t){let e=parseInt(t);return Number.isNaN(e)?void 0:e}var DR,Xoe,au=k(()=>{"use strict";f();hn();st();DR=new Map([["next",async t=>{if(!t.spawnSync)return;let e=gR(),r=e==="npm"?"npx":e,{stdout:n}=t.spawnSync(r,["next","-v"],{encoding:"utf8"});if(!n)return;let i=n.match(/(Next.js v)([\d.]+)/g);if(!i)return;let s=i[0].split("Next.js v")[1],[o,a,c]=s.split(".");return{major:Vw(o),minor:Vw(a),patch:Vw(c)}}]]),Xoe=["@shopify/remix-oxygen","@shopify/hydrogen","@builder.io/qwik-city","@remix-run/react","@sveltejs/kit","astro","gatsby","next","nuxt","@builder.io/qwik","@angular/core","react","solid-js","svelte","vue"]});async function Hi(t){let e=CR(t),r=await t.readFile(e);return typeof r=="string"?JSON.parse(r):{}}async function Ki(t,e){e=typeof e=="object"&&e!=null?e:{};let r=CR(t);await t.writeFile(r,JSON.stringify(e??{},null,2))}function CR(t){let e=t.getAppRootDir();return t.join(e,"node_modules",".builder","builder-cache.json")}var cu=k(()=>{"use strict";f()});async function so(t,e,r){let n={envKey:r,envValue:null,file:""};for(let i of e){let s=t.join(t.getAppRootDir(),i),o=await Zoe(t,s);if(o){let a=o[r];if(typeof a=="string"&&a.length>0&&a!=="YOUR_API_KEY")return n.envValue=a,n.file=s,n}}return n.file=t.join(t.getAppRootDir(),e[e.length-1]),n}async function Zoe(t,e){let r=await t.readFile(e);return typeof r=="string"?ER(r):null}function ER(t){let e={},r=t.replace(/\r\n?/gm,`
77
77
  `),n;for(;(n=Qoe.exec(r))!=null;){let i=n[1],s=n[2]||"";s=s.trim();let o=s[0];s=s.replace(/^(['"`])([\s\S]*)\1$/gm,"$2"),o==='"'&&(s=s.replace(/\\n/g,`
78
78
  `),s=s.replace(/\\r/g,"\r")),e[i]=s}return e}async function oo(t,e,r,n){let i="# https://www.builder.io/c/docs/using-your-api-key",s=await t.readFile(e);try{if(s)if(s.includes(r))if(s.includes(n))t.debug(`"${r}" with "${n}" already set in ${e}`);else return t.debug(`Replace "${r}" in ${e}`),s=s.replace(new RegExp(`${r}=.*`),`${r}=${n}`),await t.writeFile(e,s),"update";else return t.debug(`Append "${r}" to ${e}`),s+=`
79
79
 
@@ -1106,7 +1106,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`),H=L,q=V),se===void 0&&
1106
1106
  `:`
1107
1107
  `)+r,i=n+1,n=t.indexOf(`
1108
1108
  `,i)}while(n!==-1);return s+=t.slice(i),s}var ML=k(()=>{f()});function fm(t){return jL(t)}var BL,LL,pE,bp,dm,$L,vp,Gpe,Eb,jL,dE,Vpe,Hpe,fE,Sb,Kpe,YJe,XJe,UL=k(()=>{f();_L();NL();ML();({stdout:BL,stderr:LL}=IL),pE=Symbol("GENERATOR"),bp=Symbol("STYLER"),dm=Symbol("IS_EMPTY"),$L=["ansi","ansi","ansi256","ansi16m"],vp=Object.create(null),Gpe=(t,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let r=BL?BL.level:0;t.level=e.level===void 0?r:e.level},Eb=class{constructor(e){return jL(e)}},jL=t=>{let e=(...r)=>r.join(" ");return Gpe(e,t),Object.setPrototypeOf(e,fm.prototype),e};Object.setPrototypeOf(fm.prototype,Function.prototype);for(let[t,e]of Object.entries(Os))vp[t]={get(){let r=Sb(this,fE(e.open,e.close,this[bp]),this[dm]);return Object.defineProperty(this,t,{value:r}),r}};vp.visible={get(){let t=Sb(this,this[bp],!0);return Object.defineProperty(this,"visible",{value:t}),t}};dE=(t,e,r,...n)=>t==="rgb"?e==="ansi16m"?Os[r].ansi16m(...n):e==="ansi256"?Os[r].ansi256(Os.rgbToAnsi256(...n)):Os[r].ansi(Os.rgbToAnsi(...n)):t==="hex"?dE("rgb",e,r,...Os.hexToRgb(...n)):Os[r][t](...n),Vpe=["rgb","hex","ansi256"];for(let t of Vpe){vp[t]={get(){let{level:r}=this;return function(...n){let i=fE(dE(t,$L[r],"color",...n),Os.color.close,this[bp]);return Sb(this,i,this[dm])}}};let e="bg"+t[0].toUpperCase()+t.slice(1);vp[e]={get(){let{level:r}=this;return function(...n){let i=fE(dE(t,$L[r],"bgColor",...n),Os.bgColor.close,this[bp]);return Sb(this,i,this[dm])}}}}Hpe=Object.defineProperties(()=>{},{...vp,level:{enumerable:!0,get(){return this[pE].level},set(t){this[pE].level=t}}}),fE=(t,e,r)=>{let n,i;return r===void 0?(n=t,i=e):(n=r.openAll+t,i=e+r.closeAll),{open:t,close:e,openAll:n,closeAll:i,parent:r}},Sb=(t,e,r)=>{let n=(...i)=>Kpe(n,i.length===1?""+i[0]:i.join(" "));return Object.setPrototypeOf(n,Hpe),n[pE]=t,n[bp]=e,n[dm]=r,n},Kpe=(t,e)=>{if(t.level<=0||!e)return t[dm]?"":e;let r=t[bp];if(r===void 0)return e;let{openAll:n,closeAll:i}=r;if(e.includes("\x1B"))for(;r!==void 0;)e=RL(e,r.close,r.open),r=r.parent;let s=e.indexOf(`
1109
- `);return s!==-1&&(e=OL(e,i,n,s)),n+e+i};Object.defineProperties(fm.prototype,vp);YJe=fm(),XJe=fm({level:LL?LL.level:0})});function mm(t){let e=cE(t);return{highlight:r,highlightAuto:n,listLanguages:e.listLanguages,register:e.register,registerAlias:e.registerAlias,registered:e.registered};function r(i,s,o){let a=e.highlight(i,s),c=a.data;return{language:c.language,relevance:c.relevance,value:mE(o||qL,a)}}function n(i,s){let o,a;if(s&&("subset"in s||"sheet"in s)){let l=s;a={subset:l.subset},o=l.sheet}else o=s;let c=e.highlightAuto(i,a),u=c.data;return{language:u.language,relevance:u.relevance,value:mE(o||qL,c)}}}function mE(t,e){let r=new Set(e.type==="element"&&Array.isArray(e.properties.className)?e.properties.className.map(function(a){return String(a).replace(/^hljs-/,"")}):[]),n={},i,s="",o;for(o in t)if(Object.hasOwn(t,o)){let a=o.split(" "),c=t[o];r.has(a[0])?a.length===1?i=c:n[a.slice(1).join(" ")]=c:n[o]=c}return"value"in e?s=e.value:"children"in e&&(s=Wpe(n,e.children)),i&&(s=i(s)),s}function Wpe(t,e){let r=[],n=-1;for(;++n<e.length;)r.push(mE(t,e[n]));return r.join("")}var ot,qL,zL=k(()=>{f();UL();uE();ot=new Eb({level:2}),qL={comment:ot.gray,quote:ot.gray,keyword:ot.green,"selector-tag":ot.green,addition:ot.green,number:ot.cyan,string:ot.cyan,"meta meta-string":ot.cyan,literal:ot.cyan,doctag:ot.cyan,regexp:ot.cyan,title:ot.blue,section:ot.blue,name:ot.blue,"selector-id":ot.blue,"selector-class":ot.blue,attribute:ot.yellow,attr:ot.yellow,variable:ot.yellow,"template-variable":ot.yellow,"class title":ot.yellow,type:ot.yellow,symbol:ot.magenta,bullet:ot.magenta,subst:ot.magenta,meta:ot.magenta,"meta keyword":ot.magenta,"selector-attr":ot.magenta,"selector-pseudo":ot.magenta,link:ot.magenta,built_in:ot.red,deletion:ot.red,emphasis:ot.italic,strong:ot.bold,formula:ot.inverse}});var hE=k(()=>{f();uE();zL()});async function pe(t){if(process.env.NODE_ENV!=="test")try{await Promise.allSettled([GL.flush(2e3),VL.flush().promise])}catch(e){console.error(e)}process.exit(t)}var GL,VL,Xi=k(()=>{"use strict";f();GL=z(require("@sentry/node"),1),VL=z(require("@amplitude/analytics-node"),1)});var Be,an=k(()=>{"use strict";f();Be=process.env.AIR_HOST||"https://api.builder.io"});var KL,HL=k(()=>{KL="1.18.30"});var JL=S(gE=>{f();var WL="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");gE.encode=function(t){if(0<=t&&t<WL.length)return WL[t];throw new TypeError("Must be between 0 and 63: "+t)};gE.decode=function(t){var e=65,r=90,n=97,i=122,s=48,o=57,a=43,c=47,u=26,l=52;return e<=t&&t<=r?t-e:n<=t&&t<=i?t-n+u:s<=t&&t<=o?t-s+l:t==a?62:t==c?63:-1}});var vE=S(bE=>{f();var YL=JL(),yE=5,XL=1<<yE,ZL=XL-1,QL=XL;function Ype(t){return t<0?(-t<<1)+1:(t<<1)+0}function Xpe(t){var e=(t&1)===1,r=t>>1;return e?-r:r}bE.encode=function(e){var r="",n,i=Ype(e);do n=i&ZL,i>>>=yE,i>0&&(n|=QL),r+=YL.encode(n);while(i>0);return r};bE.decode=function(e,r,n){var i=e.length,s=0,o=0,a,c;do{if(r>=i)throw new Error("Expected more digits in base 64 VLQ value.");if(c=YL.decode(e.charCodeAt(r++)),c===-1)throw new Error("Invalid base64 digit: "+e.charAt(r-1));a=!!(c&QL),c&=ZL,s=s+(c<<o),o+=yE}while(a);n.value=Xpe(s),n.rest=r}});var Dp=S(Vr=>{f();function Zpe(t,e,r){if(e in t)return t[e];if(arguments.length===3)return r;throw new Error('"'+e+'" is a required argument.')}Vr.getArg=Zpe;var e8=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,Qpe=/^data:.+\,.+$/;function hm(t){var e=t.match(e8);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}Vr.urlParse=hm;function xp(t){var e="";return t.scheme&&(e+=t.scheme+":"),e+="//",t.auth&&(e+=t.auth+"@"),t.host&&(e+=t.host),t.port&&(e+=":"+t.port),t.path&&(e+=t.path),e}Vr.urlGenerate=xp;var ede=32;function tde(t){var e=[];return function(r){for(var n=0;n<e.length;n++)if(e[n].input===r){var i=e[0];return e[0]=e[n],e[n]=i,e[0].result}var s=t(r);return e.unshift({input:r,result:s}),e.length>ede&&e.pop(),s}}var xE=tde(function(e){var r=e,n=hm(e);if(n){if(!n.path)return e;r=n.path}for(var i=Vr.isAbsolute(r),s=[],o=0,a=0;;)if(o=a,a=r.indexOf("/",o),a===-1){s.push(r.slice(o));break}else for(s.push(r.slice(o,a));a<r.length&&r[a]==="/";)a++;for(var c,u=0,a=s.length-1;a>=0;a--)c=s[a],c==="."?s.splice(a,1):c===".."?u++:u>0&&(c===""?(s.splice(a+1,u),u=0):(s.splice(a,2),u--));return r=s.join("/"),r===""&&(r=i?"/":"."),n?(n.path=r,xp(n)):r});Vr.normalize=xE;function t8(t,e){t===""&&(t="."),e===""&&(e=".");var r=hm(e),n=hm(t);if(n&&(t=n.path||"/"),r&&!r.scheme)return n&&(r.scheme=n.scheme),xp(r);if(r||e.match(Qpe))return e;if(n&&!n.host&&!n.path)return n.host=e,xp(n);var i=e.charAt(0)==="/"?e:xE(t.replace(/\/+$/,"")+"/"+e);return n?(n.path=i,xp(n)):i}Vr.join=t8;Vr.isAbsolute=function(t){return t.charAt(0)==="/"||e8.test(t)};function rde(t,e){t===""&&(t="."),t=t.replace(/\/$/,"");for(var r=0;e.indexOf(t+"/")!==0;){var n=t.lastIndexOf("/");if(n<0||(t=t.slice(0,n),t.match(/^([^\/]+:\/)?\/*$/)))return e;++r}return Array(r+1).join("../")+e.substr(t.length+1)}Vr.relative=rde;var r8=(function(){var t=Object.create(null);return!("__proto__"in t)})();function n8(t){return t}function nde(t){return i8(t)?"$"+t:t}Vr.toSetString=r8?n8:nde;function ide(t){return i8(t)?t.slice(1):t}Vr.fromSetString=r8?n8:ide;function i8(t){if(!t)return!1;var e=t.length;if(e<9||t.charCodeAt(e-1)!==95||t.charCodeAt(e-2)!==95||t.charCodeAt(e-3)!==111||t.charCodeAt(e-4)!==116||t.charCodeAt(e-5)!==111||t.charCodeAt(e-6)!==114||t.charCodeAt(e-7)!==112||t.charCodeAt(e-8)!==95||t.charCodeAt(e-9)!==95)return!1;for(var r=e-10;r>=0;r--)if(t.charCodeAt(r)!==36)return!1;return!0}function sde(t,e,r){var n=la(t.source,e.source);return n!==0||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0||r)||(n=t.generatedColumn-e.generatedColumn,n!==0)||(n=t.generatedLine-e.generatedLine,n!==0)?n:la(t.name,e.name)}Vr.compareByOriginalPositions=sde;function ode(t,e,r){var n;return n=t.originalLine-e.originalLine,n!==0||(n=t.originalColumn-e.originalColumn,n!==0||r)||(n=t.generatedColumn-e.generatedColumn,n!==0)||(n=t.generatedLine-e.generatedLine,n!==0)?n:la(t.name,e.name)}Vr.compareByOriginalPositionsNoSource=ode;function ade(t,e,r){var n=t.generatedLine-e.generatedLine;return n!==0||(n=t.generatedColumn-e.generatedColumn,n!==0||r)||(n=la(t.source,e.source),n!==0)||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0)?n:la(t.name,e.name)}Vr.compareByGeneratedPositionsDeflated=ade;function cde(t,e,r){var n=t.generatedColumn-e.generatedColumn;return n!==0||r||(n=la(t.source,e.source),n!==0)||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0)?n:la(t.name,e.name)}Vr.compareByGeneratedPositionsDeflatedNoLine=cde;function la(t,e){return t===e?0:t===null?1:e===null?-1:t>e?1:-1}function ude(t,e){var r=t.generatedLine-e.generatedLine;return r!==0||(r=t.generatedColumn-e.generatedColumn,r!==0)||(r=la(t.source,e.source),r!==0)||(r=t.originalLine-e.originalLine,r!==0)||(r=t.originalColumn-e.originalColumn,r!==0)?r:la(t.name,e.name)}Vr.compareByGeneratedPositionsInflated=ude;function lde(t){return JSON.parse(t.replace(/^\)]}'[^\n]*\n/,""))}Vr.parseSourceMapInput=lde;function pde(t,e,r){if(e=e||"",t&&(t[t.length-1]!=="/"&&e[0]!=="/"&&(t+="/"),e=t+e),r){var n=hm(r);if(!n)throw new Error("sourceMapURL could not be parsed");if(n.path){var i=n.path.lastIndexOf("/");i>=0&&(n.path=n.path.substring(0,i+1))}e=t8(xp(n),e)}return xE(e)}Vr.computeSourceURL=pde});var CE=S(s8=>{f();var DE=Dp(),wE=Object.prototype.hasOwnProperty,xu=typeof Map<"u";function pa(){this._array=[],this._set=xu?new Map:Object.create(null)}pa.fromArray=function(e,r){for(var n=new pa,i=0,s=e.length;i<s;i++)n.add(e[i],r);return n};pa.prototype.size=function(){return xu?this._set.size:Object.getOwnPropertyNames(this._set).length};pa.prototype.add=function(e,r){var n=xu?e:DE.toSetString(e),i=xu?this.has(e):wE.call(this._set,n),s=this._array.length;(!i||r)&&this._array.push(e),i||(xu?this._set.set(e,s):this._set[n]=s)};pa.prototype.has=function(e){if(xu)return this._set.has(e);var r=DE.toSetString(e);return wE.call(this._set,r)};pa.prototype.indexOf=function(e){if(xu){var r=this._set.get(e);if(r>=0)return r}else{var n=DE.toSetString(e);if(wE.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')};pa.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)};pa.prototype.toArray=function(){return this._array.slice()};s8.ArraySet=pa});var c8=S(a8=>{f();var o8=Dp();function dde(t,e){var r=t.generatedLine,n=e.generatedLine,i=t.generatedColumn,s=e.generatedColumn;return n>r||n==r&&s>=i||o8.compareByGeneratedPositionsInflated(t,e)<=0}function Tb(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}Tb.prototype.unsortedForEach=function(e,r){this._array.forEach(e,r)};Tb.prototype.add=function(e){dde(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))};Tb.prototype.toArray=function(){return this._sorted||(this._array.sort(o8.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};a8.MappingList=Tb});var EE=S(u8=>{f();var gm=vE(),Cr=Dp(),Ab=CE().ArraySet,fde=c8().MappingList;function Zi(t){t||(t={}),this._file=Cr.getArg(t,"file",null),this._sourceRoot=Cr.getArg(t,"sourceRoot",null),this._skipValidation=Cr.getArg(t,"skipValidation",!1),this._ignoreInvalidMapping=Cr.getArg(t,"ignoreInvalidMapping",!1),this._sources=new Ab,this._names=new Ab,this._mappings=new fde,this._sourcesContents=null}Zi.prototype._version=3;Zi.fromSourceMap=function(e,r){var n=e.sourceRoot,i=new Zi(Object.assign(r||{},{file:e.file,sourceRoot:n}));return e.eachMapping(function(s){var o={generated:{line:s.generatedLine,column:s.generatedColumn}};s.source!=null&&(o.source=s.source,n!=null&&(o.source=Cr.relative(n,o.source)),o.original={line:s.originalLine,column:s.originalColumn},s.name!=null&&(o.name=s.name)),i.addMapping(o)}),e.sources.forEach(function(s){var o=s;n!==null&&(o=Cr.relative(n,s)),i._sources.has(o)||i._sources.add(o);var a=e.sourceContentFor(s);a!=null&&i.setSourceContent(s,a)}),i};Zi.prototype.addMapping=function(e){var r=Cr.getArg(e,"generated"),n=Cr.getArg(e,"original",null),i=Cr.getArg(e,"source",null),s=Cr.getArg(e,"name",null);!this._skipValidation&&this._validateMapping(r,n,i,s)===!1||(i!=null&&(i=String(i),this._sources.has(i)||this._sources.add(i)),s!=null&&(s=String(s),this._names.has(s)||this._names.add(s)),this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:i,name:s}))};Zi.prototype.setSourceContent=function(e,r){var n=e;this._sourceRoot!=null&&(n=Cr.relative(this._sourceRoot,n)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[Cr.toSetString(n)]=r):this._sourcesContents&&(delete this._sourcesContents[Cr.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};Zi.prototype.applySourceMap=function(e,r,n){var i=r;if(r==null){if(e.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);i=e.file}var s=this._sourceRoot;s!=null&&(i=Cr.relative(s,i));var o=new Ab,a=new Ab;this._mappings.unsortedForEach(function(c){if(c.source===i&&c.originalLine!=null){var u=e.originalPositionFor({line:c.originalLine,column:c.originalColumn});u.source!=null&&(c.source=u.source,n!=null&&(c.source=Cr.join(n,c.source)),s!=null&&(c.source=Cr.relative(s,c.source)),c.originalLine=u.line,c.originalColumn=u.column,u.name!=null&&(c.name=u.name))}var l=c.source;l!=null&&!o.has(l)&&o.add(l);var p=c.name;p!=null&&!a.has(p)&&a.add(p)},this),this._sources=o,this._names=a,e.sources.forEach(function(c){var u=e.sourceContentFor(c);u!=null&&(n!=null&&(c=Cr.join(n,c)),s!=null&&(c=Cr.relative(s,c)),this.setSourceContent(c,u))},this)};Zi.prototype._validateMapping=function(e,r,n,i){if(r&&typeof r.line!="number"&&typeof r.column!="number"){var s="original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.";if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(s),!1;throw new Error(s)}if(!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!r&&!n&&!i)){if(e&&"line"in e&&"column"in e&&r&&"line"in r&&"column"in r&&e.line>0&&e.column>=0&&r.line>0&&r.column>=0&&n)return;var s="Invalid mapping: "+JSON.stringify({generated:e,source:n,original:r,name:i});if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(s),!1;throw new Error(s)}};Zi.prototype._serializeMappings=function(){for(var e=0,r=1,n=0,i=0,s=0,o=0,a="",c,u,l,p,d=this._mappings.toArray(),h=0,m=d.length;h<m;h++){if(u=d[h],c="",u.generatedLine!==r)for(e=0;u.generatedLine!==r;)c+=";",r++;else if(h>0){if(!Cr.compareByGeneratedPositionsInflated(u,d[h-1]))continue;c+=","}c+=gm.encode(u.generatedColumn-e),e=u.generatedColumn,u.source!=null&&(p=this._sources.indexOf(u.source),c+=gm.encode(p-o),o=p,c+=gm.encode(u.originalLine-1-i),i=u.originalLine-1,c+=gm.encode(u.originalColumn-n),n=u.originalColumn,u.name!=null&&(l=this._names.indexOf(u.name),c+=gm.encode(l-s),s=l)),a+=c}return a};Zi.prototype._generateSourcesContent=function(e,r){return e.map(function(n){if(!this._sourcesContents)return null;r!=null&&(n=Cr.relative(r,n));var i=Cr.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,i)?this._sourcesContents[i]:null},this)};Zi.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(e.file=this._file),this._sourceRoot!=null&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e};Zi.prototype.toString=function(){return JSON.stringify(this.toJSON())};u8.SourceMapGenerator=Zi});var l8=S(Du=>{f();Du.GREATEST_LOWER_BOUND=1;Du.LEAST_UPPER_BOUND=2;function SE(t,e,r,n,i,s){var o=Math.floor((e-t)/2)+t,a=i(r,n[o],!0);return a===0?o:a>0?e-o>1?SE(o,e,r,n,i,s):s==Du.LEAST_UPPER_BOUND?e<n.length?e:-1:o:o-t>1?SE(t,o,r,n,i,s):s==Du.LEAST_UPPER_BOUND?o:t<0?-1:t}Du.search=function(e,r,n,i){if(r.length===0)return-1;var s=SE(-1,r.length,e,r,n,i||Du.GREATEST_LOWER_BOUND);if(s<0)return-1;for(;s-1>=0&&n(r[s],r[s-1],!0)===0;)--s;return s}});var f8=S(d8=>{f();function mde(t){function e(i,s,o){var a=i[s];i[s]=i[o],i[o]=a}function r(i,s){return Math.round(i+Math.random()*(s-i))}function n(i,s,o,a){if(o<a){var c=r(o,a),u=o-1;e(i,c,a);for(var l=i[a],p=o;p<a;p++)s(i[p],l,!1)<=0&&(u+=1,e(i,u,p));e(i,u+1,p);var d=u+1;n(i,s,o,d-1),n(i,s,d+1,a)}}return n}function hde(t){let e=mde.toString();return new Function(`return ${e}`)()(t)}var p8=new WeakMap;d8.quickSort=function(t,e,r=0){let n=p8.get(e);n===void 0&&(n=hde(e),p8.set(e,n)),n(t,e,r,t.length-1)}});var g8=S(Pb=>{f();var me=Dp(),AE=l8(),wp=CE().ArraySet,gde=vE(),ym=f8().quickSort;function Qt(t,e){var r=t;return typeof t=="string"&&(r=me.parseSourceMapInput(t)),r.sections!=null?new Ms(r,e):new cn(r,e)}Qt.fromSourceMap=function(t,e){return cn.fromSourceMap(t,e)};Qt.prototype._version=3;Qt.prototype.__generatedMappings=null;Object.defineProperty(Qt.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}});Qt.prototype.__originalMappings=null;Object.defineProperty(Qt.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}});Qt.prototype._charIsMappingSeparator=function(e,r){var n=e.charAt(r);return n===";"||n===","};Qt.prototype._parseMappings=function(e,r){throw new Error("Subclasses must implement _parseMappings")};Qt.GENERATED_ORDER=1;Qt.ORIGINAL_ORDER=2;Qt.GREATEST_LOWER_BOUND=1;Qt.LEAST_UPPER_BOUND=2;Qt.prototype.eachMapping=function(e,r,n){var i=r||null,s=n||Qt.GENERATED_ORDER,o;switch(s){case Qt.GENERATED_ORDER:o=this._generatedMappings;break;case Qt.ORIGINAL_ORDER:o=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}for(var a=this.sourceRoot,c=e.bind(i),u=this._names,l=this._sources,p=this._sourceMapURL,d=0,h=o.length;d<h;d++){var m=o[d],g=m.source===null?null:l.at(m.source);g!==null&&(g=me.computeSourceURL(a,g,p)),c({source:g,generatedLine:m.generatedLine,generatedColumn:m.generatedColumn,originalLine:m.originalLine,originalColumn:m.originalColumn,name:m.name===null?null:u.at(m.name)})}};Qt.prototype.allGeneratedPositionsFor=function(e){var r=me.getArg(e,"line"),n={source:me.getArg(e,"source"),originalLine:r,originalColumn:me.getArg(e,"column",0)};if(n.source=this._findSourceIndex(n.source),n.source<0)return[];var i=[],s=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",me.compareByOriginalPositions,AE.LEAST_UPPER_BOUND);if(s>=0){var o=this._originalMappings[s];if(e.column===void 0)for(var a=o.originalLine;o&&o.originalLine===a;)i.push({line:me.getArg(o,"generatedLine",null),column:me.getArg(o,"generatedColumn",null),lastColumn:me.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++s];else for(var c=o.originalColumn;o&&o.originalLine===r&&o.originalColumn==c;)i.push({line:me.getArg(o,"generatedLine",null),column:me.getArg(o,"generatedColumn",null),lastColumn:me.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++s]}return i};Pb.SourceMapConsumer=Qt;function cn(t,e){var r=t;typeof t=="string"&&(r=me.parseSourceMapInput(t));var n=me.getArg(r,"version"),i=me.getArg(r,"sources"),s=me.getArg(r,"names",[]),o=me.getArg(r,"sourceRoot",null),a=me.getArg(r,"sourcesContent",null),c=me.getArg(r,"mappings"),u=me.getArg(r,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);o&&(o=me.normalize(o)),i=i.map(String).map(me.normalize).map(function(l){return o&&me.isAbsolute(o)&&me.isAbsolute(l)?me.relative(o,l):l}),this._names=wp.fromArray(s.map(String),!0),this._sources=wp.fromArray(i,!0),this._absoluteSources=this._sources.toArray().map(function(l){return me.computeSourceURL(o,l,e)}),this.sourceRoot=o,this.sourcesContent=a,this._mappings=c,this._sourceMapURL=e,this.file=u}cn.prototype=Object.create(Qt.prototype);cn.prototype.consumer=Qt;cn.prototype._findSourceIndex=function(t){var e=t;if(this.sourceRoot!=null&&(e=me.relative(this.sourceRoot,e)),this._sources.has(e))return this._sources.indexOf(e);var r;for(r=0;r<this._absoluteSources.length;++r)if(this._absoluteSources[r]==t)return r;return-1};cn.fromSourceMap=function(e,r){var n=Object.create(cn.prototype),i=n._names=wp.fromArray(e._names.toArray(),!0),s=n._sources=wp.fromArray(e._sources.toArray(),!0);n.sourceRoot=e._sourceRoot,n.sourcesContent=e._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=e._file,n._sourceMapURL=r,n._absoluteSources=n._sources.toArray().map(function(h){return me.computeSourceURL(n.sourceRoot,h,r)});for(var o=e._mappings.toArray().slice(),a=n.__generatedMappings=[],c=n.__originalMappings=[],u=0,l=o.length;u<l;u++){var p=o[u],d=new h8;d.generatedLine=p.generatedLine,d.generatedColumn=p.generatedColumn,p.source&&(d.source=s.indexOf(p.source),d.originalLine=p.originalLine,d.originalColumn=p.originalColumn,p.name&&(d.name=i.indexOf(p.name)),c.push(d)),a.push(d)}return ym(n.__originalMappings,me.compareByOriginalPositions),n};cn.prototype._version=3;Object.defineProperty(cn.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function h8(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}var TE=me.compareByGeneratedPositionsDeflatedNoLine;function m8(t,e){let r=t.length,n=t.length-e;if(!(n<=1))if(n==2){let i=t[e],s=t[e+1];TE(i,s)>0&&(t[e]=s,t[e+1]=i)}else if(n<20)for(let i=e;i<r;i++)for(let s=i;s>e;s--){let o=t[s-1],a=t[s];if(TE(o,a)<=0)break;t[s-1]=a,t[s]=o}else ym(t,TE,e)}cn.prototype._parseMappings=function(e,r){var n=1,i=0,s=0,o=0,a=0,c=0,u=e.length,l=0,p={},d={},h=[],m=[],g,y,b,D,w;let v=0;for(;l<u;)if(e.charAt(l)===";")n++,l++,i=0,m8(m,v),v=m.length;else if(e.charAt(l)===",")l++;else{for(g=new h8,g.generatedLine=n,D=l;D<u&&!this._charIsMappingSeparator(e,D);D++);for(y=e.slice(l,D),b=[];l<D;)gde.decode(e,l,d),w=d.value,l=d.rest,b.push(w);if(b.length===2)throw new Error("Found a source, but no line and column");if(b.length===3)throw new Error("Found a source and line, but no column");if(g.generatedColumn=i+b[0],i=g.generatedColumn,b.length>1&&(g.source=a+b[1],a+=b[1],g.originalLine=s+b[2],s=g.originalLine,g.originalLine+=1,g.originalColumn=o+b[3],o=g.originalColumn,b.length>4&&(g.name=c+b[4],c+=b[4])),m.push(g),typeof g.originalLine=="number"){let C=g.source;for(;h.length<=C;)h.push(null);h[C]===null&&(h[C]=[]),h[C].push(g)}}m8(m,v),this.__generatedMappings=m;for(var x=0;x<h.length;x++)h[x]!=null&&ym(h[x],me.compareByOriginalPositionsNoSource);this.__originalMappings=[].concat(...h)};cn.prototype._findMapping=function(e,r,n,i,s,o){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[i]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[i]);return AE.search(e,r,s,o)};cn.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var r=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var n=this._generatedMappings[e+1];if(r.generatedLine===n.generatedLine){r.lastGeneratedColumn=n.generatedColumn-1;continue}}r.lastGeneratedColumn=1/0}};cn.prototype.originalPositionFor=function(e){var r={generatedLine:me.getArg(e,"line"),generatedColumn:me.getArg(e,"column")},n=this._findMapping(r,this._generatedMappings,"generatedLine","generatedColumn",me.compareByGeneratedPositionsDeflated,me.getArg(e,"bias",Qt.GREATEST_LOWER_BOUND));if(n>=0){var i=this._generatedMappings[n];if(i.generatedLine===r.generatedLine){var s=me.getArg(i,"source",null);s!==null&&(s=this._sources.at(s),s=me.computeSourceURL(this.sourceRoot,s,this._sourceMapURL));var o=me.getArg(i,"name",null);return o!==null&&(o=this._names.at(o)),{source:s,line:me.getArg(i,"originalLine",null),column:me.getArg(i,"originalColumn",null),name:o}}}return{source:null,line:null,column:null,name:null}};cn.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return e==null}):!1};cn.prototype.sourceContentFor=function(e,r){if(!this.sourcesContent)return null;var n=this._findSourceIndex(e);if(n>=0)return this.sourcesContent[n];var i=e;this.sourceRoot!=null&&(i=me.relative(this.sourceRoot,i));var s;if(this.sourceRoot!=null&&(s=me.urlParse(this.sourceRoot))){var o=i.replace(/^file:\/\//,"");if(s.scheme=="file"&&this._sources.has(o))return this.sourcesContent[this._sources.indexOf(o)];if((!s.path||s.path=="/")&&this._sources.has("/"+i))return this.sourcesContent[this._sources.indexOf("/"+i)]}if(r)return null;throw new Error('"'+i+'" is not in the SourceMap.')};cn.prototype.generatedPositionFor=function(e){var r=me.getArg(e,"source");if(r=this._findSourceIndex(r),r<0)return{line:null,column:null,lastColumn:null};var n={source:r,originalLine:me.getArg(e,"line"),originalColumn:me.getArg(e,"column")},i=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",me.compareByOriginalPositions,me.getArg(e,"bias",Qt.GREATEST_LOWER_BOUND));if(i>=0){var s=this._originalMappings[i];if(s.source===n.source)return{line:me.getArg(s,"generatedLine",null),column:me.getArg(s,"generatedColumn",null),lastColumn:me.getArg(s,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};Pb.BasicSourceMapConsumer=cn;function Ms(t,e){var r=t;typeof t=="string"&&(r=me.parseSourceMapInput(t));var n=me.getArg(r,"version"),i=me.getArg(r,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new wp,this._names=new wp;var s={line:-1,column:0};this._sections=i.map(function(o){if(o.url)throw new Error("Support for url field in sections not implemented.");var a=me.getArg(o,"offset"),c=me.getArg(a,"line"),u=me.getArg(a,"column");if(c<s.line||c===s.line&&u<s.column)throw new Error("Section offsets must be ordered and non-overlapping.");return s=a,{generatedOffset:{generatedLine:c+1,generatedColumn:u+1},consumer:new Qt(me.getArg(o,"map"),e)}})}Ms.prototype=Object.create(Qt.prototype);Ms.prototype.constructor=Qt;Ms.prototype._version=3;Object.defineProperty(Ms.prototype,"sources",{get:function(){for(var t=[],e=0;e<this._sections.length;e++)for(var r=0;r<this._sections[e].consumer.sources.length;r++)t.push(this._sections[e].consumer.sources[r]);return t}});Ms.prototype.originalPositionFor=function(e){var r={generatedLine:me.getArg(e,"line"),generatedColumn:me.getArg(e,"column")},n=AE.search(r,this._sections,function(s,o){var a=s.generatedLine-o.generatedOffset.generatedLine;return a||s.generatedColumn-o.generatedOffset.generatedColumn}),i=this._sections[n];return i?i.consumer.originalPositionFor({line:r.generatedLine-(i.generatedOffset.generatedLine-1),column:r.generatedColumn-(i.generatedOffset.generatedLine===r.generatedLine?i.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}};Ms.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(e){return e.consumer.hasContentsOfAllSources()})};Ms.prototype.sourceContentFor=function(e,r){for(var n=0;n<this._sections.length;n++){var i=this._sections[n],s=i.consumer.sourceContentFor(e,!0);if(s||s==="")return s}if(r)return null;throw new Error('"'+e+'" is not in the SourceMap.')};Ms.prototype.generatedPositionFor=function(e){for(var r=0;r<this._sections.length;r++){var n=this._sections[r];if(n.consumer._findSourceIndex(me.getArg(e,"source"))!==-1){var i=n.consumer.generatedPositionFor(e);if(i){var s={line:i.line+(n.generatedOffset.generatedLine-1),column:i.column+(n.generatedOffset.generatedLine===i.line?n.generatedOffset.generatedColumn-1:0)};return s}}}return{line:null,column:null}};Ms.prototype._parseMappings=function(e,r){this.__generatedMappings=[],this.__originalMappings=[];for(var n=0;n<this._sections.length;n++)for(var i=this._sections[n],s=i.consumer._generatedMappings,o=0;o<s.length;o++){var a=s[o],c=i.consumer._sources.at(a.source);c!==null&&(c=me.computeSourceURL(i.consumer.sourceRoot,c,this._sourceMapURL)),this._sources.add(c),c=this._sources.indexOf(c);var u=null;a.name&&(u=i.consumer._names.at(a.name),this._names.add(u),u=this._names.indexOf(u));var l={source:c,generatedLine:a.generatedLine+(i.generatedOffset.generatedLine-1),generatedColumn:a.generatedColumn+(i.generatedOffset.generatedLine===a.generatedLine?i.generatedOffset.generatedColumn-1:0),originalLine:a.originalLine,originalColumn:a.originalColumn,name:u};this.__generatedMappings.push(l),typeof l.originalLine=="number"&&this.__originalMappings.push(l)}ym(this.__generatedMappings,me.compareByGeneratedPositionsDeflated),ym(this.__originalMappings,me.compareByOriginalPositions)};Pb.IndexedSourceMapConsumer=Ms});var b8=S(y8=>{f();var yde=EE().SourceMapGenerator,_b=Dp(),bde=/(\r?\n)/,vde=10,Cp="$$$isSourceNode$$$";function ki(t,e,r,n,i){this.children=[],this.sourceContents={},this.line=t??null,this.column=e??null,this.source=r??null,this.name=i??null,this[Cp]=!0,n!=null&&this.add(n)}ki.fromStringWithSourceMap=function(e,r,n){var i=new ki,s=e.split(bde),o=0,a=function(){var d=m(),h=m()||"";return d+h;function m(){return o<s.length?s[o++]:void 0}},c=1,u=0,l=null;return r.eachMapping(function(d){if(l!==null)if(c<d.generatedLine)p(l,a()),c++,u=0;else{var h=s[o]||"",m=h.substr(0,d.generatedColumn-u);s[o]=h.substr(d.generatedColumn-u),u=d.generatedColumn,p(l,m),l=d;return}for(;c<d.generatedLine;)i.add(a()),c++;if(u<d.generatedColumn){var h=s[o]||"";i.add(h.substr(0,d.generatedColumn)),s[o]=h.substr(d.generatedColumn),u=d.generatedColumn}l=d},this),o<s.length&&(l&&p(l,a()),i.add(s.splice(o).join(""))),r.sources.forEach(function(d){var h=r.sourceContentFor(d);h!=null&&(n!=null&&(d=_b.join(n,d)),i.setSourceContent(d,h))}),i;function p(d,h){if(d===null||d.source===void 0)i.add(h);else{var m=n?_b.join(n,d.source):d.source;i.add(new ki(d.originalLine,d.originalColumn,m,h,d.name))}}};ki.prototype.add=function(e){if(Array.isArray(e))e.forEach(function(r){this.add(r)},this);else if(e[Cp]||typeof e=="string")e&&this.children.push(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this};ki.prototype.prepend=function(e){if(Array.isArray(e))for(var r=e.length-1;r>=0;r--)this.prepend(e[r]);else if(e[Cp]||typeof e=="string")this.children.unshift(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this};ki.prototype.walk=function(e){for(var r,n=0,i=this.children.length;n<i;n++)r=this.children[n],r[Cp]?r.walk(e):r!==""&&e(r,{source:this.source,line:this.line,column:this.column,name:this.name})};ki.prototype.join=function(e){var r,n,i=this.children.length;if(i>0){for(r=[],n=0;n<i-1;n++)r.push(this.children[n]),r.push(e);r.push(this.children[n]),this.children=r}return this};ki.prototype.replaceRight=function(e,r){var n=this.children[this.children.length-1];return n[Cp]?n.replaceRight(e,r):typeof n=="string"?this.children[this.children.length-1]=n.replace(e,r):this.children.push("".replace(e,r)),this};ki.prototype.setSourceContent=function(e,r){this.sourceContents[_b.toSetString(e)]=r};ki.prototype.walkSourceContents=function(e){for(var r=0,n=this.children.length;r<n;r++)this.children[r][Cp]&&this.children[r].walkSourceContents(e);for(var i=Object.keys(this.sourceContents),r=0,n=i.length;r<n;r++)e(_b.fromSetString(i[r]),this.sourceContents[i[r]])};ki.prototype.toString=function(){var e="";return this.walk(function(r){e+=r}),e};ki.prototype.toStringWithSourceMap=function(e){var r={code:"",line:1,column:0},n=new yde(e),i=!1,s=null,o=null,a=null,c=null;return this.walk(function(u,l){r.code+=u,l.source!==null&&l.line!==null&&l.column!==null?((s!==l.source||o!==l.line||a!==l.column||c!==l.name)&&n.addMapping({source:l.source,original:{line:l.line,column:l.column},generated:{line:r.line,column:r.column},name:l.name}),s=l.source,o=l.line,a=l.column,c=l.name,i=!0):i&&(n.addMapping({generated:{line:r.line,column:r.column}}),s=null,i=!1);for(var p=0,d=u.length;p<d;p++)u.charCodeAt(p)===vde?(r.line++,r.column=0,p+1===d?(s=null,i=!1):i&&n.addMapping({source:l.source,original:{line:l.line,column:l.column},generated:{line:r.line,column:r.column},name:l.name})):r.column++}),this.walkSourceContents(function(u,l){n.setSourceContent(u,l)}),{code:r.code,map:n}};y8.SourceNode=ki});var v8=S(Fb=>{f();Fb.SourceMapGenerator=EE().SourceMapGenerator;Fb.SourceMapConsumer=g8().SourceMapConsumer;Fb.SourceNode=b8().SourceNode});var Y8=S(Am=>{"use strict";f();Object.defineProperty(Am,"__esModule",{value:!0});function xde(t,e){if(t==null)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.includes(n))continue;r[n]=t[n]}return r}var Do=class{constructor(e,r,n){this.line=void 0,this.column=void 0,this.index=void 0,this.line=e,this.column=r,this.index=n}},Pp=class{constructor(e,r){this.start=void 0,this.end=void 0,this.filename=void 0,this.identifierName=void 0,this.start=e,this.end=r}};function Ln(t,e){let{line:r,column:n,index:i}=t;return new Do(r,n+e,i+e)}var x8="BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED",Dde={ImportMetaOutsideModule:{message:`import.meta may appear only with 'sourceType: "module"'`,code:x8},ImportOutsideModule:{message:`'import' and 'export' may appear only with 'sourceType: "module"'`,code:x8}},D8={ArrayPattern:"array destructuring pattern",AssignmentExpression:"assignment expression",AssignmentPattern:"assignment expression",ArrowFunctionExpression:"arrow function expression",ConditionalExpression:"conditional expression",CatchClause:"catch clause",ForOfStatement:"for-of statement",ForInStatement:"for-in statement",ForStatement:"for-loop",FormalParameters:"function parameter list",Identifier:"identifier",ImportSpecifier:"import specifier",ImportDefaultSpecifier:"import default specifier",ImportNamespaceSpecifier:"import namespace specifier",ObjectPattern:"object destructuring pattern",ParenthesizedExpression:"parenthesized expression",RestElement:"rest element",UpdateExpression:{true:"prefix operation",false:"postfix operation"},VariableDeclarator:"variable declaration",YieldExpression:"yield expression"},Nb=t=>t.type==="UpdateExpression"?D8.UpdateExpression[`${t.prefix}`]:D8[t.type],wde={AccessorIsGenerator:({kind:t})=>`A ${t}ter cannot be a generator.`,ArgumentsInClass:"'arguments' is only allowed in functions and class methods.",AsyncFunctionInSingleStatementContext:"Async functions can only be declared at the top level or inside a block.",AwaitBindingIdentifier:"Can not use 'await' as identifier inside an async function.",AwaitBindingIdentifierInStaticBlock:"Can not use 'await' as identifier inside a static block.",AwaitExpressionFormalParameter:"'await' is not allowed in async function parameters.",AwaitUsingNotInAsyncContext:"'await using' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncContext:"'await' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncFunction:"'await' is only allowed within async functions.",BadGetterArity:"A 'get' accessor must not have any formal parameters.",BadSetterArity:"A 'set' accessor must have exactly one formal parameter.",BadSetterRestParameter:"A 'set' accessor function argument must not be a rest parameter.",ConstructorClassField:"Classes may not have a field named 'constructor'.",ConstructorClassPrivateField:"Classes may not have a private field named '#constructor'.",ConstructorIsAccessor:"Class constructor may not be an accessor.",ConstructorIsAsync:"Constructor can't be an async function.",ConstructorIsGenerator:"Constructor can't be a generator.",DeclarationMissingInitializer:({kind:t})=>`Missing initializer in ${t} declaration.`,DecoratorArgumentsOutsideParentheses:"Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.",DecoratorBeforeExport:"Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.",DecoratorsBeforeAfterExport:"Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.",DecoratorConstructor:"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",DecoratorExportClass:"Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.",DecoratorSemicolon:"Decorators must not be followed by a semicolon.",DecoratorStaticBlock:"Decorators can't be used with a static block.",DeferImportRequiresNamespace:'Only `import defer * as x from "./module"` is valid.',DeletePrivateField:"Deleting a private field is not allowed.",DestructureNamedImport:"ES2015 named imports do not destructure. Use another statement for destructuring after the import.",DuplicateConstructor:"Duplicate constructor in the same class.",DuplicateDefaultExport:"Only one default export allowed per module.",DuplicateExport:({exportName:t})=>`\`${t}\` has already been exported. Exported identifiers must be unique.`,DuplicateProto:"Redefinition of __proto__ property.",DuplicateRegExpFlags:"Duplicate regular expression flag.",DynamicImportPhaseRequiresImportExpressions:({phase:t})=>`'import.${t}(...)' can only be parsed when using the 'createImportExpressions' option.`,ElementAfterRest:"Rest element must be last element.",EscapedCharNotAnIdentifier:"Invalid Unicode escape.",ExportBindingIsString:({localName:t,exportName:e})=>`A string literal cannot be used as an exported binding without \`from\`.
1109
+ `);return s!==-1&&(e=OL(e,i,n,s)),n+e+i};Object.defineProperties(fm.prototype,vp);YJe=fm(),XJe=fm({level:LL?LL.level:0})});function mm(t){let e=cE(t);return{highlight:r,highlightAuto:n,listLanguages:e.listLanguages,register:e.register,registerAlias:e.registerAlias,registered:e.registered};function r(i,s,o){let a=e.highlight(i,s),c=a.data;return{language:c.language,relevance:c.relevance,value:mE(o||qL,a)}}function n(i,s){let o,a;if(s&&("subset"in s||"sheet"in s)){let l=s;a={subset:l.subset},o=l.sheet}else o=s;let c=e.highlightAuto(i,a),u=c.data;return{language:u.language,relevance:u.relevance,value:mE(o||qL,c)}}}function mE(t,e){let r=new Set(e.type==="element"&&Array.isArray(e.properties.className)?e.properties.className.map(function(a){return String(a).replace(/^hljs-/,"")}):[]),n={},i,s="",o;for(o in t)if(Object.hasOwn(t,o)){let a=o.split(" "),c=t[o];r.has(a[0])?a.length===1?i=c:n[a.slice(1).join(" ")]=c:n[o]=c}return"value"in e?s=e.value:"children"in e&&(s=Wpe(n,e.children)),i&&(s=i(s)),s}function Wpe(t,e){let r=[],n=-1;for(;++n<e.length;)r.push(mE(t,e[n]));return r.join("")}var ot,qL,zL=k(()=>{f();UL();uE();ot=new Eb({level:2}),qL={comment:ot.gray,quote:ot.gray,keyword:ot.green,"selector-tag":ot.green,addition:ot.green,number:ot.cyan,string:ot.cyan,"meta meta-string":ot.cyan,literal:ot.cyan,doctag:ot.cyan,regexp:ot.cyan,title:ot.blue,section:ot.blue,name:ot.blue,"selector-id":ot.blue,"selector-class":ot.blue,attribute:ot.yellow,attr:ot.yellow,variable:ot.yellow,"template-variable":ot.yellow,"class title":ot.yellow,type:ot.yellow,symbol:ot.magenta,bullet:ot.magenta,subst:ot.magenta,meta:ot.magenta,"meta keyword":ot.magenta,"selector-attr":ot.magenta,"selector-pseudo":ot.magenta,link:ot.magenta,built_in:ot.red,deletion:ot.red,emphasis:ot.italic,strong:ot.bold,formula:ot.inverse}});var hE=k(()=>{f();uE();zL()});async function pe(t){if(process.env.NODE_ENV!=="test")try{await Promise.allSettled([GL.flush(2e3),VL.flush().promise])}catch(e){console.error(e)}process.exit(t)}var GL,VL,Xi=k(()=>{"use strict";f();GL=z(require("@sentry/node"),1),VL=z(require("@amplitude/analytics-node"),1)});var Be,an=k(()=>{"use strict";f();Be=process.env.AIR_HOST||"https://api.builder.io"});var KL,HL=k(()=>{KL="1.18.33"});var JL=S(gE=>{f();var WL="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");gE.encode=function(t){if(0<=t&&t<WL.length)return WL[t];throw new TypeError("Must be between 0 and 63: "+t)};gE.decode=function(t){var e=65,r=90,n=97,i=122,s=48,o=57,a=43,c=47,u=26,l=52;return e<=t&&t<=r?t-e:n<=t&&t<=i?t-n+u:s<=t&&t<=o?t-s+l:t==a?62:t==c?63:-1}});var vE=S(bE=>{f();var YL=JL(),yE=5,XL=1<<yE,ZL=XL-1,QL=XL;function Ype(t){return t<0?(-t<<1)+1:(t<<1)+0}function Xpe(t){var e=(t&1)===1,r=t>>1;return e?-r:r}bE.encode=function(e){var r="",n,i=Ype(e);do n=i&ZL,i>>>=yE,i>0&&(n|=QL),r+=YL.encode(n);while(i>0);return r};bE.decode=function(e,r,n){var i=e.length,s=0,o=0,a,c;do{if(r>=i)throw new Error("Expected more digits in base 64 VLQ value.");if(c=YL.decode(e.charCodeAt(r++)),c===-1)throw new Error("Invalid base64 digit: "+e.charAt(r-1));a=!!(c&QL),c&=ZL,s=s+(c<<o),o+=yE}while(a);n.value=Xpe(s),n.rest=r}});var Dp=S(Vr=>{f();function Zpe(t,e,r){if(e in t)return t[e];if(arguments.length===3)return r;throw new Error('"'+e+'" is a required argument.')}Vr.getArg=Zpe;var e8=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,Qpe=/^data:.+\,.+$/;function hm(t){var e=t.match(e8);return e?{scheme:e[1],auth:e[2],host:e[3],port:e[4],path:e[5]}:null}Vr.urlParse=hm;function xp(t){var e="";return t.scheme&&(e+=t.scheme+":"),e+="//",t.auth&&(e+=t.auth+"@"),t.host&&(e+=t.host),t.port&&(e+=":"+t.port),t.path&&(e+=t.path),e}Vr.urlGenerate=xp;var ede=32;function tde(t){var e=[];return function(r){for(var n=0;n<e.length;n++)if(e[n].input===r){var i=e[0];return e[0]=e[n],e[n]=i,e[0].result}var s=t(r);return e.unshift({input:r,result:s}),e.length>ede&&e.pop(),s}}var xE=tde(function(e){var r=e,n=hm(e);if(n){if(!n.path)return e;r=n.path}for(var i=Vr.isAbsolute(r),s=[],o=0,a=0;;)if(o=a,a=r.indexOf("/",o),a===-1){s.push(r.slice(o));break}else for(s.push(r.slice(o,a));a<r.length&&r[a]==="/";)a++;for(var c,u=0,a=s.length-1;a>=0;a--)c=s[a],c==="."?s.splice(a,1):c===".."?u++:u>0&&(c===""?(s.splice(a+1,u),u=0):(s.splice(a,2),u--));return r=s.join("/"),r===""&&(r=i?"/":"."),n?(n.path=r,xp(n)):r});Vr.normalize=xE;function t8(t,e){t===""&&(t="."),e===""&&(e=".");var r=hm(e),n=hm(t);if(n&&(t=n.path||"/"),r&&!r.scheme)return n&&(r.scheme=n.scheme),xp(r);if(r||e.match(Qpe))return e;if(n&&!n.host&&!n.path)return n.host=e,xp(n);var i=e.charAt(0)==="/"?e:xE(t.replace(/\/+$/,"")+"/"+e);return n?(n.path=i,xp(n)):i}Vr.join=t8;Vr.isAbsolute=function(t){return t.charAt(0)==="/"||e8.test(t)};function rde(t,e){t===""&&(t="."),t=t.replace(/\/$/,"");for(var r=0;e.indexOf(t+"/")!==0;){var n=t.lastIndexOf("/");if(n<0||(t=t.slice(0,n),t.match(/^([^\/]+:\/)?\/*$/)))return e;++r}return Array(r+1).join("../")+e.substr(t.length+1)}Vr.relative=rde;var r8=(function(){var t=Object.create(null);return!("__proto__"in t)})();function n8(t){return t}function nde(t){return i8(t)?"$"+t:t}Vr.toSetString=r8?n8:nde;function ide(t){return i8(t)?t.slice(1):t}Vr.fromSetString=r8?n8:ide;function i8(t){if(!t)return!1;var e=t.length;if(e<9||t.charCodeAt(e-1)!==95||t.charCodeAt(e-2)!==95||t.charCodeAt(e-3)!==111||t.charCodeAt(e-4)!==116||t.charCodeAt(e-5)!==111||t.charCodeAt(e-6)!==114||t.charCodeAt(e-7)!==112||t.charCodeAt(e-8)!==95||t.charCodeAt(e-9)!==95)return!1;for(var r=e-10;r>=0;r--)if(t.charCodeAt(r)!==36)return!1;return!0}function sde(t,e,r){var n=la(t.source,e.source);return n!==0||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0||r)||(n=t.generatedColumn-e.generatedColumn,n!==0)||(n=t.generatedLine-e.generatedLine,n!==0)?n:la(t.name,e.name)}Vr.compareByOriginalPositions=sde;function ode(t,e,r){var n;return n=t.originalLine-e.originalLine,n!==0||(n=t.originalColumn-e.originalColumn,n!==0||r)||(n=t.generatedColumn-e.generatedColumn,n!==0)||(n=t.generatedLine-e.generatedLine,n!==0)?n:la(t.name,e.name)}Vr.compareByOriginalPositionsNoSource=ode;function ade(t,e,r){var n=t.generatedLine-e.generatedLine;return n!==0||(n=t.generatedColumn-e.generatedColumn,n!==0||r)||(n=la(t.source,e.source),n!==0)||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0)?n:la(t.name,e.name)}Vr.compareByGeneratedPositionsDeflated=ade;function cde(t,e,r){var n=t.generatedColumn-e.generatedColumn;return n!==0||r||(n=la(t.source,e.source),n!==0)||(n=t.originalLine-e.originalLine,n!==0)||(n=t.originalColumn-e.originalColumn,n!==0)?n:la(t.name,e.name)}Vr.compareByGeneratedPositionsDeflatedNoLine=cde;function la(t,e){return t===e?0:t===null?1:e===null?-1:t>e?1:-1}function ude(t,e){var r=t.generatedLine-e.generatedLine;return r!==0||(r=t.generatedColumn-e.generatedColumn,r!==0)||(r=la(t.source,e.source),r!==0)||(r=t.originalLine-e.originalLine,r!==0)||(r=t.originalColumn-e.originalColumn,r!==0)?r:la(t.name,e.name)}Vr.compareByGeneratedPositionsInflated=ude;function lde(t){return JSON.parse(t.replace(/^\)]}'[^\n]*\n/,""))}Vr.parseSourceMapInput=lde;function pde(t,e,r){if(e=e||"",t&&(t[t.length-1]!=="/"&&e[0]!=="/"&&(t+="/"),e=t+e),r){var n=hm(r);if(!n)throw new Error("sourceMapURL could not be parsed");if(n.path){var i=n.path.lastIndexOf("/");i>=0&&(n.path=n.path.substring(0,i+1))}e=t8(xp(n),e)}return xE(e)}Vr.computeSourceURL=pde});var CE=S(s8=>{f();var DE=Dp(),wE=Object.prototype.hasOwnProperty,xu=typeof Map<"u";function pa(){this._array=[],this._set=xu?new Map:Object.create(null)}pa.fromArray=function(e,r){for(var n=new pa,i=0,s=e.length;i<s;i++)n.add(e[i],r);return n};pa.prototype.size=function(){return xu?this._set.size:Object.getOwnPropertyNames(this._set).length};pa.prototype.add=function(e,r){var n=xu?e:DE.toSetString(e),i=xu?this.has(e):wE.call(this._set,n),s=this._array.length;(!i||r)&&this._array.push(e),i||(xu?this._set.set(e,s):this._set[n]=s)};pa.prototype.has=function(e){if(xu)return this._set.has(e);var r=DE.toSetString(e);return wE.call(this._set,r)};pa.prototype.indexOf=function(e){if(xu){var r=this._set.get(e);if(r>=0)return r}else{var n=DE.toSetString(e);if(wE.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')};pa.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)};pa.prototype.toArray=function(){return this._array.slice()};s8.ArraySet=pa});var c8=S(a8=>{f();var o8=Dp();function dde(t,e){var r=t.generatedLine,n=e.generatedLine,i=t.generatedColumn,s=e.generatedColumn;return n>r||n==r&&s>=i||o8.compareByGeneratedPositionsInflated(t,e)<=0}function Tb(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}Tb.prototype.unsortedForEach=function(e,r){this._array.forEach(e,r)};Tb.prototype.add=function(e){dde(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))};Tb.prototype.toArray=function(){return this._sorted||(this._array.sort(o8.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};a8.MappingList=Tb});var EE=S(u8=>{f();var gm=vE(),Cr=Dp(),Ab=CE().ArraySet,fde=c8().MappingList;function Zi(t){t||(t={}),this._file=Cr.getArg(t,"file",null),this._sourceRoot=Cr.getArg(t,"sourceRoot",null),this._skipValidation=Cr.getArg(t,"skipValidation",!1),this._ignoreInvalidMapping=Cr.getArg(t,"ignoreInvalidMapping",!1),this._sources=new Ab,this._names=new Ab,this._mappings=new fde,this._sourcesContents=null}Zi.prototype._version=3;Zi.fromSourceMap=function(e,r){var n=e.sourceRoot,i=new Zi(Object.assign(r||{},{file:e.file,sourceRoot:n}));return e.eachMapping(function(s){var o={generated:{line:s.generatedLine,column:s.generatedColumn}};s.source!=null&&(o.source=s.source,n!=null&&(o.source=Cr.relative(n,o.source)),o.original={line:s.originalLine,column:s.originalColumn},s.name!=null&&(o.name=s.name)),i.addMapping(o)}),e.sources.forEach(function(s){var o=s;n!==null&&(o=Cr.relative(n,s)),i._sources.has(o)||i._sources.add(o);var a=e.sourceContentFor(s);a!=null&&i.setSourceContent(s,a)}),i};Zi.prototype.addMapping=function(e){var r=Cr.getArg(e,"generated"),n=Cr.getArg(e,"original",null),i=Cr.getArg(e,"source",null),s=Cr.getArg(e,"name",null);!this._skipValidation&&this._validateMapping(r,n,i,s)===!1||(i!=null&&(i=String(i),this._sources.has(i)||this._sources.add(i)),s!=null&&(s=String(s),this._names.has(s)||this._names.add(s)),this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:i,name:s}))};Zi.prototype.setSourceContent=function(e,r){var n=e;this._sourceRoot!=null&&(n=Cr.relative(this._sourceRoot,n)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[Cr.toSetString(n)]=r):this._sourcesContents&&(delete this._sourcesContents[Cr.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};Zi.prototype.applySourceMap=function(e,r,n){var i=r;if(r==null){if(e.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);i=e.file}var s=this._sourceRoot;s!=null&&(i=Cr.relative(s,i));var o=new Ab,a=new Ab;this._mappings.unsortedForEach(function(c){if(c.source===i&&c.originalLine!=null){var u=e.originalPositionFor({line:c.originalLine,column:c.originalColumn});u.source!=null&&(c.source=u.source,n!=null&&(c.source=Cr.join(n,c.source)),s!=null&&(c.source=Cr.relative(s,c.source)),c.originalLine=u.line,c.originalColumn=u.column,u.name!=null&&(c.name=u.name))}var l=c.source;l!=null&&!o.has(l)&&o.add(l);var p=c.name;p!=null&&!a.has(p)&&a.add(p)},this),this._sources=o,this._names=a,e.sources.forEach(function(c){var u=e.sourceContentFor(c);u!=null&&(n!=null&&(c=Cr.join(n,c)),s!=null&&(c=Cr.relative(s,c)),this.setSourceContent(c,u))},this)};Zi.prototype._validateMapping=function(e,r,n,i){if(r&&typeof r.line!="number"&&typeof r.column!="number"){var s="original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.";if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(s),!1;throw new Error(s)}if(!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!r&&!n&&!i)){if(e&&"line"in e&&"column"in e&&r&&"line"in r&&"column"in r&&e.line>0&&e.column>=0&&r.line>0&&r.column>=0&&n)return;var s="Invalid mapping: "+JSON.stringify({generated:e,source:n,original:r,name:i});if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(s),!1;throw new Error(s)}};Zi.prototype._serializeMappings=function(){for(var e=0,r=1,n=0,i=0,s=0,o=0,a="",c,u,l,p,d=this._mappings.toArray(),h=0,m=d.length;h<m;h++){if(u=d[h],c="",u.generatedLine!==r)for(e=0;u.generatedLine!==r;)c+=";",r++;else if(h>0){if(!Cr.compareByGeneratedPositionsInflated(u,d[h-1]))continue;c+=","}c+=gm.encode(u.generatedColumn-e),e=u.generatedColumn,u.source!=null&&(p=this._sources.indexOf(u.source),c+=gm.encode(p-o),o=p,c+=gm.encode(u.originalLine-1-i),i=u.originalLine-1,c+=gm.encode(u.originalColumn-n),n=u.originalColumn,u.name!=null&&(l=this._names.indexOf(u.name),c+=gm.encode(l-s),s=l)),a+=c}return a};Zi.prototype._generateSourcesContent=function(e,r){return e.map(function(n){if(!this._sourcesContents)return null;r!=null&&(n=Cr.relative(r,n));var i=Cr.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,i)?this._sourcesContents[i]:null},this)};Zi.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(e.file=this._file),this._sourceRoot!=null&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e};Zi.prototype.toString=function(){return JSON.stringify(this.toJSON())};u8.SourceMapGenerator=Zi});var l8=S(Du=>{f();Du.GREATEST_LOWER_BOUND=1;Du.LEAST_UPPER_BOUND=2;function SE(t,e,r,n,i,s){var o=Math.floor((e-t)/2)+t,a=i(r,n[o],!0);return a===0?o:a>0?e-o>1?SE(o,e,r,n,i,s):s==Du.LEAST_UPPER_BOUND?e<n.length?e:-1:o:o-t>1?SE(t,o,r,n,i,s):s==Du.LEAST_UPPER_BOUND?o:t<0?-1:t}Du.search=function(e,r,n,i){if(r.length===0)return-1;var s=SE(-1,r.length,e,r,n,i||Du.GREATEST_LOWER_BOUND);if(s<0)return-1;for(;s-1>=0&&n(r[s],r[s-1],!0)===0;)--s;return s}});var f8=S(d8=>{f();function mde(t){function e(i,s,o){var a=i[s];i[s]=i[o],i[o]=a}function r(i,s){return Math.round(i+Math.random()*(s-i))}function n(i,s,o,a){if(o<a){var c=r(o,a),u=o-1;e(i,c,a);for(var l=i[a],p=o;p<a;p++)s(i[p],l,!1)<=0&&(u+=1,e(i,u,p));e(i,u+1,p);var d=u+1;n(i,s,o,d-1),n(i,s,d+1,a)}}return n}function hde(t){let e=mde.toString();return new Function(`return ${e}`)()(t)}var p8=new WeakMap;d8.quickSort=function(t,e,r=0){let n=p8.get(e);n===void 0&&(n=hde(e),p8.set(e,n)),n(t,e,r,t.length-1)}});var g8=S(Pb=>{f();var me=Dp(),AE=l8(),wp=CE().ArraySet,gde=vE(),ym=f8().quickSort;function Qt(t,e){var r=t;return typeof t=="string"&&(r=me.parseSourceMapInput(t)),r.sections!=null?new Ms(r,e):new cn(r,e)}Qt.fromSourceMap=function(t,e){return cn.fromSourceMap(t,e)};Qt.prototype._version=3;Qt.prototype.__generatedMappings=null;Object.defineProperty(Qt.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}});Qt.prototype.__originalMappings=null;Object.defineProperty(Qt.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}});Qt.prototype._charIsMappingSeparator=function(e,r){var n=e.charAt(r);return n===";"||n===","};Qt.prototype._parseMappings=function(e,r){throw new Error("Subclasses must implement _parseMappings")};Qt.GENERATED_ORDER=1;Qt.ORIGINAL_ORDER=2;Qt.GREATEST_LOWER_BOUND=1;Qt.LEAST_UPPER_BOUND=2;Qt.prototype.eachMapping=function(e,r,n){var i=r||null,s=n||Qt.GENERATED_ORDER,o;switch(s){case Qt.GENERATED_ORDER:o=this._generatedMappings;break;case Qt.ORIGINAL_ORDER:o=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}for(var a=this.sourceRoot,c=e.bind(i),u=this._names,l=this._sources,p=this._sourceMapURL,d=0,h=o.length;d<h;d++){var m=o[d],g=m.source===null?null:l.at(m.source);g!==null&&(g=me.computeSourceURL(a,g,p)),c({source:g,generatedLine:m.generatedLine,generatedColumn:m.generatedColumn,originalLine:m.originalLine,originalColumn:m.originalColumn,name:m.name===null?null:u.at(m.name)})}};Qt.prototype.allGeneratedPositionsFor=function(e){var r=me.getArg(e,"line"),n={source:me.getArg(e,"source"),originalLine:r,originalColumn:me.getArg(e,"column",0)};if(n.source=this._findSourceIndex(n.source),n.source<0)return[];var i=[],s=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",me.compareByOriginalPositions,AE.LEAST_UPPER_BOUND);if(s>=0){var o=this._originalMappings[s];if(e.column===void 0)for(var a=o.originalLine;o&&o.originalLine===a;)i.push({line:me.getArg(o,"generatedLine",null),column:me.getArg(o,"generatedColumn",null),lastColumn:me.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++s];else for(var c=o.originalColumn;o&&o.originalLine===r&&o.originalColumn==c;)i.push({line:me.getArg(o,"generatedLine",null),column:me.getArg(o,"generatedColumn",null),lastColumn:me.getArg(o,"lastGeneratedColumn",null)}),o=this._originalMappings[++s]}return i};Pb.SourceMapConsumer=Qt;function cn(t,e){var r=t;typeof t=="string"&&(r=me.parseSourceMapInput(t));var n=me.getArg(r,"version"),i=me.getArg(r,"sources"),s=me.getArg(r,"names",[]),o=me.getArg(r,"sourceRoot",null),a=me.getArg(r,"sourcesContent",null),c=me.getArg(r,"mappings"),u=me.getArg(r,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);o&&(o=me.normalize(o)),i=i.map(String).map(me.normalize).map(function(l){return o&&me.isAbsolute(o)&&me.isAbsolute(l)?me.relative(o,l):l}),this._names=wp.fromArray(s.map(String),!0),this._sources=wp.fromArray(i,!0),this._absoluteSources=this._sources.toArray().map(function(l){return me.computeSourceURL(o,l,e)}),this.sourceRoot=o,this.sourcesContent=a,this._mappings=c,this._sourceMapURL=e,this.file=u}cn.prototype=Object.create(Qt.prototype);cn.prototype.consumer=Qt;cn.prototype._findSourceIndex=function(t){var e=t;if(this.sourceRoot!=null&&(e=me.relative(this.sourceRoot,e)),this._sources.has(e))return this._sources.indexOf(e);var r;for(r=0;r<this._absoluteSources.length;++r)if(this._absoluteSources[r]==t)return r;return-1};cn.fromSourceMap=function(e,r){var n=Object.create(cn.prototype),i=n._names=wp.fromArray(e._names.toArray(),!0),s=n._sources=wp.fromArray(e._sources.toArray(),!0);n.sourceRoot=e._sourceRoot,n.sourcesContent=e._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=e._file,n._sourceMapURL=r,n._absoluteSources=n._sources.toArray().map(function(h){return me.computeSourceURL(n.sourceRoot,h,r)});for(var o=e._mappings.toArray().slice(),a=n.__generatedMappings=[],c=n.__originalMappings=[],u=0,l=o.length;u<l;u++){var p=o[u],d=new h8;d.generatedLine=p.generatedLine,d.generatedColumn=p.generatedColumn,p.source&&(d.source=s.indexOf(p.source),d.originalLine=p.originalLine,d.originalColumn=p.originalColumn,p.name&&(d.name=i.indexOf(p.name)),c.push(d)),a.push(d)}return ym(n.__originalMappings,me.compareByOriginalPositions),n};cn.prototype._version=3;Object.defineProperty(cn.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function h8(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}var TE=me.compareByGeneratedPositionsDeflatedNoLine;function m8(t,e){let r=t.length,n=t.length-e;if(!(n<=1))if(n==2){let i=t[e],s=t[e+1];TE(i,s)>0&&(t[e]=s,t[e+1]=i)}else if(n<20)for(let i=e;i<r;i++)for(let s=i;s>e;s--){let o=t[s-1],a=t[s];if(TE(o,a)<=0)break;t[s-1]=a,t[s]=o}else ym(t,TE,e)}cn.prototype._parseMappings=function(e,r){var n=1,i=0,s=0,o=0,a=0,c=0,u=e.length,l=0,p={},d={},h=[],m=[],g,y,b,D,w;let v=0;for(;l<u;)if(e.charAt(l)===";")n++,l++,i=0,m8(m,v),v=m.length;else if(e.charAt(l)===",")l++;else{for(g=new h8,g.generatedLine=n,D=l;D<u&&!this._charIsMappingSeparator(e,D);D++);for(y=e.slice(l,D),b=[];l<D;)gde.decode(e,l,d),w=d.value,l=d.rest,b.push(w);if(b.length===2)throw new Error("Found a source, but no line and column");if(b.length===3)throw new Error("Found a source and line, but no column");if(g.generatedColumn=i+b[0],i=g.generatedColumn,b.length>1&&(g.source=a+b[1],a+=b[1],g.originalLine=s+b[2],s=g.originalLine,g.originalLine+=1,g.originalColumn=o+b[3],o=g.originalColumn,b.length>4&&(g.name=c+b[4],c+=b[4])),m.push(g),typeof g.originalLine=="number"){let C=g.source;for(;h.length<=C;)h.push(null);h[C]===null&&(h[C]=[]),h[C].push(g)}}m8(m,v),this.__generatedMappings=m;for(var x=0;x<h.length;x++)h[x]!=null&&ym(h[x],me.compareByOriginalPositionsNoSource);this.__originalMappings=[].concat(...h)};cn.prototype._findMapping=function(e,r,n,i,s,o){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[i]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[i]);return AE.search(e,r,s,o)};cn.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var r=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var n=this._generatedMappings[e+1];if(r.generatedLine===n.generatedLine){r.lastGeneratedColumn=n.generatedColumn-1;continue}}r.lastGeneratedColumn=1/0}};cn.prototype.originalPositionFor=function(e){var r={generatedLine:me.getArg(e,"line"),generatedColumn:me.getArg(e,"column")},n=this._findMapping(r,this._generatedMappings,"generatedLine","generatedColumn",me.compareByGeneratedPositionsDeflated,me.getArg(e,"bias",Qt.GREATEST_LOWER_BOUND));if(n>=0){var i=this._generatedMappings[n];if(i.generatedLine===r.generatedLine){var s=me.getArg(i,"source",null);s!==null&&(s=this._sources.at(s),s=me.computeSourceURL(this.sourceRoot,s,this._sourceMapURL));var o=me.getArg(i,"name",null);return o!==null&&(o=this._names.at(o)),{source:s,line:me.getArg(i,"originalLine",null),column:me.getArg(i,"originalColumn",null),name:o}}}return{source:null,line:null,column:null,name:null}};cn.prototype.hasContentsOfAllSources=function(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return e==null}):!1};cn.prototype.sourceContentFor=function(e,r){if(!this.sourcesContent)return null;var n=this._findSourceIndex(e);if(n>=0)return this.sourcesContent[n];var i=e;this.sourceRoot!=null&&(i=me.relative(this.sourceRoot,i));var s;if(this.sourceRoot!=null&&(s=me.urlParse(this.sourceRoot))){var o=i.replace(/^file:\/\//,"");if(s.scheme=="file"&&this._sources.has(o))return this.sourcesContent[this._sources.indexOf(o)];if((!s.path||s.path=="/")&&this._sources.has("/"+i))return this.sourcesContent[this._sources.indexOf("/"+i)]}if(r)return null;throw new Error('"'+i+'" is not in the SourceMap.')};cn.prototype.generatedPositionFor=function(e){var r=me.getArg(e,"source");if(r=this._findSourceIndex(r),r<0)return{line:null,column:null,lastColumn:null};var n={source:r,originalLine:me.getArg(e,"line"),originalColumn:me.getArg(e,"column")},i=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",me.compareByOriginalPositions,me.getArg(e,"bias",Qt.GREATEST_LOWER_BOUND));if(i>=0){var s=this._originalMappings[i];if(s.source===n.source)return{line:me.getArg(s,"generatedLine",null),column:me.getArg(s,"generatedColumn",null),lastColumn:me.getArg(s,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};Pb.BasicSourceMapConsumer=cn;function Ms(t,e){var r=t;typeof t=="string"&&(r=me.parseSourceMapInput(t));var n=me.getArg(r,"version"),i=me.getArg(r,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new wp,this._names=new wp;var s={line:-1,column:0};this._sections=i.map(function(o){if(o.url)throw new Error("Support for url field in sections not implemented.");var a=me.getArg(o,"offset"),c=me.getArg(a,"line"),u=me.getArg(a,"column");if(c<s.line||c===s.line&&u<s.column)throw new Error("Section offsets must be ordered and non-overlapping.");return s=a,{generatedOffset:{generatedLine:c+1,generatedColumn:u+1},consumer:new Qt(me.getArg(o,"map"),e)}})}Ms.prototype=Object.create(Qt.prototype);Ms.prototype.constructor=Qt;Ms.prototype._version=3;Object.defineProperty(Ms.prototype,"sources",{get:function(){for(var t=[],e=0;e<this._sections.length;e++)for(var r=0;r<this._sections[e].consumer.sources.length;r++)t.push(this._sections[e].consumer.sources[r]);return t}});Ms.prototype.originalPositionFor=function(e){var r={generatedLine:me.getArg(e,"line"),generatedColumn:me.getArg(e,"column")},n=AE.search(r,this._sections,function(s,o){var a=s.generatedLine-o.generatedOffset.generatedLine;return a||s.generatedColumn-o.generatedOffset.generatedColumn}),i=this._sections[n];return i?i.consumer.originalPositionFor({line:r.generatedLine-(i.generatedOffset.generatedLine-1),column:r.generatedColumn-(i.generatedOffset.generatedLine===r.generatedLine?i.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}};Ms.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(e){return e.consumer.hasContentsOfAllSources()})};Ms.prototype.sourceContentFor=function(e,r){for(var n=0;n<this._sections.length;n++){var i=this._sections[n],s=i.consumer.sourceContentFor(e,!0);if(s||s==="")return s}if(r)return null;throw new Error('"'+e+'" is not in the SourceMap.')};Ms.prototype.generatedPositionFor=function(e){for(var r=0;r<this._sections.length;r++){var n=this._sections[r];if(n.consumer._findSourceIndex(me.getArg(e,"source"))!==-1){var i=n.consumer.generatedPositionFor(e);if(i){var s={line:i.line+(n.generatedOffset.generatedLine-1),column:i.column+(n.generatedOffset.generatedLine===i.line?n.generatedOffset.generatedColumn-1:0)};return s}}}return{line:null,column:null}};Ms.prototype._parseMappings=function(e,r){this.__generatedMappings=[],this.__originalMappings=[];for(var n=0;n<this._sections.length;n++)for(var i=this._sections[n],s=i.consumer._generatedMappings,o=0;o<s.length;o++){var a=s[o],c=i.consumer._sources.at(a.source);c!==null&&(c=me.computeSourceURL(i.consumer.sourceRoot,c,this._sourceMapURL)),this._sources.add(c),c=this._sources.indexOf(c);var u=null;a.name&&(u=i.consumer._names.at(a.name),this._names.add(u),u=this._names.indexOf(u));var l={source:c,generatedLine:a.generatedLine+(i.generatedOffset.generatedLine-1),generatedColumn:a.generatedColumn+(i.generatedOffset.generatedLine===a.generatedLine?i.generatedOffset.generatedColumn-1:0),originalLine:a.originalLine,originalColumn:a.originalColumn,name:u};this.__generatedMappings.push(l),typeof l.originalLine=="number"&&this.__originalMappings.push(l)}ym(this.__generatedMappings,me.compareByGeneratedPositionsDeflated),ym(this.__originalMappings,me.compareByOriginalPositions)};Pb.IndexedSourceMapConsumer=Ms});var b8=S(y8=>{f();var yde=EE().SourceMapGenerator,_b=Dp(),bde=/(\r?\n)/,vde=10,Cp="$$$isSourceNode$$$";function ki(t,e,r,n,i){this.children=[],this.sourceContents={},this.line=t??null,this.column=e??null,this.source=r??null,this.name=i??null,this[Cp]=!0,n!=null&&this.add(n)}ki.fromStringWithSourceMap=function(e,r,n){var i=new ki,s=e.split(bde),o=0,a=function(){var d=m(),h=m()||"";return d+h;function m(){return o<s.length?s[o++]:void 0}},c=1,u=0,l=null;return r.eachMapping(function(d){if(l!==null)if(c<d.generatedLine)p(l,a()),c++,u=0;else{var h=s[o]||"",m=h.substr(0,d.generatedColumn-u);s[o]=h.substr(d.generatedColumn-u),u=d.generatedColumn,p(l,m),l=d;return}for(;c<d.generatedLine;)i.add(a()),c++;if(u<d.generatedColumn){var h=s[o]||"";i.add(h.substr(0,d.generatedColumn)),s[o]=h.substr(d.generatedColumn),u=d.generatedColumn}l=d},this),o<s.length&&(l&&p(l,a()),i.add(s.splice(o).join(""))),r.sources.forEach(function(d){var h=r.sourceContentFor(d);h!=null&&(n!=null&&(d=_b.join(n,d)),i.setSourceContent(d,h))}),i;function p(d,h){if(d===null||d.source===void 0)i.add(h);else{var m=n?_b.join(n,d.source):d.source;i.add(new ki(d.originalLine,d.originalColumn,m,h,d.name))}}};ki.prototype.add=function(e){if(Array.isArray(e))e.forEach(function(r){this.add(r)},this);else if(e[Cp]||typeof e=="string")e&&this.children.push(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this};ki.prototype.prepend=function(e){if(Array.isArray(e))for(var r=e.length-1;r>=0;r--)this.prepend(e[r]);else if(e[Cp]||typeof e=="string")this.children.unshift(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this};ki.prototype.walk=function(e){for(var r,n=0,i=this.children.length;n<i;n++)r=this.children[n],r[Cp]?r.walk(e):r!==""&&e(r,{source:this.source,line:this.line,column:this.column,name:this.name})};ki.prototype.join=function(e){var r,n,i=this.children.length;if(i>0){for(r=[],n=0;n<i-1;n++)r.push(this.children[n]),r.push(e);r.push(this.children[n]),this.children=r}return this};ki.prototype.replaceRight=function(e,r){var n=this.children[this.children.length-1];return n[Cp]?n.replaceRight(e,r):typeof n=="string"?this.children[this.children.length-1]=n.replace(e,r):this.children.push("".replace(e,r)),this};ki.prototype.setSourceContent=function(e,r){this.sourceContents[_b.toSetString(e)]=r};ki.prototype.walkSourceContents=function(e){for(var r=0,n=this.children.length;r<n;r++)this.children[r][Cp]&&this.children[r].walkSourceContents(e);for(var i=Object.keys(this.sourceContents),r=0,n=i.length;r<n;r++)e(_b.fromSetString(i[r]),this.sourceContents[i[r]])};ki.prototype.toString=function(){var e="";return this.walk(function(r){e+=r}),e};ki.prototype.toStringWithSourceMap=function(e){var r={code:"",line:1,column:0},n=new yde(e),i=!1,s=null,o=null,a=null,c=null;return this.walk(function(u,l){r.code+=u,l.source!==null&&l.line!==null&&l.column!==null?((s!==l.source||o!==l.line||a!==l.column||c!==l.name)&&n.addMapping({source:l.source,original:{line:l.line,column:l.column},generated:{line:r.line,column:r.column},name:l.name}),s=l.source,o=l.line,a=l.column,c=l.name,i=!0):i&&(n.addMapping({generated:{line:r.line,column:r.column}}),s=null,i=!1);for(var p=0,d=u.length;p<d;p++)u.charCodeAt(p)===vde?(r.line++,r.column=0,p+1===d?(s=null,i=!1):i&&n.addMapping({source:l.source,original:{line:l.line,column:l.column},generated:{line:r.line,column:r.column},name:l.name})):r.column++}),this.walkSourceContents(function(u,l){n.setSourceContent(u,l)}),{code:r.code,map:n}};y8.SourceNode=ki});var v8=S(Fb=>{f();Fb.SourceMapGenerator=EE().SourceMapGenerator;Fb.SourceMapConsumer=g8().SourceMapConsumer;Fb.SourceNode=b8().SourceNode});var Y8=S(Am=>{"use strict";f();Object.defineProperty(Am,"__esModule",{value:!0});function xde(t,e){if(t==null)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.includes(n))continue;r[n]=t[n]}return r}var Do=class{constructor(e,r,n){this.line=void 0,this.column=void 0,this.index=void 0,this.line=e,this.column=r,this.index=n}},Pp=class{constructor(e,r){this.start=void 0,this.end=void 0,this.filename=void 0,this.identifierName=void 0,this.start=e,this.end=r}};function Ln(t,e){let{line:r,column:n,index:i}=t;return new Do(r,n+e,i+e)}var x8="BABEL_PARSER_SOURCETYPE_MODULE_REQUIRED",Dde={ImportMetaOutsideModule:{message:`import.meta may appear only with 'sourceType: "module"'`,code:x8},ImportOutsideModule:{message:`'import' and 'export' may appear only with 'sourceType: "module"'`,code:x8}},D8={ArrayPattern:"array destructuring pattern",AssignmentExpression:"assignment expression",AssignmentPattern:"assignment expression",ArrowFunctionExpression:"arrow function expression",ConditionalExpression:"conditional expression",CatchClause:"catch clause",ForOfStatement:"for-of statement",ForInStatement:"for-in statement",ForStatement:"for-loop",FormalParameters:"function parameter list",Identifier:"identifier",ImportSpecifier:"import specifier",ImportDefaultSpecifier:"import default specifier",ImportNamespaceSpecifier:"import namespace specifier",ObjectPattern:"object destructuring pattern",ParenthesizedExpression:"parenthesized expression",RestElement:"rest element",UpdateExpression:{true:"prefix operation",false:"postfix operation"},VariableDeclarator:"variable declaration",YieldExpression:"yield expression"},Nb=t=>t.type==="UpdateExpression"?D8.UpdateExpression[`${t.prefix}`]:D8[t.type],wde={AccessorIsGenerator:({kind:t})=>`A ${t}ter cannot be a generator.`,ArgumentsInClass:"'arguments' is only allowed in functions and class methods.",AsyncFunctionInSingleStatementContext:"Async functions can only be declared at the top level or inside a block.",AwaitBindingIdentifier:"Can not use 'await' as identifier inside an async function.",AwaitBindingIdentifierInStaticBlock:"Can not use 'await' as identifier inside a static block.",AwaitExpressionFormalParameter:"'await' is not allowed in async function parameters.",AwaitUsingNotInAsyncContext:"'await using' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncContext:"'await' is only allowed within async functions and at the top levels of modules.",AwaitNotInAsyncFunction:"'await' is only allowed within async functions.",BadGetterArity:"A 'get' accessor must not have any formal parameters.",BadSetterArity:"A 'set' accessor must have exactly one formal parameter.",BadSetterRestParameter:"A 'set' accessor function argument must not be a rest parameter.",ConstructorClassField:"Classes may not have a field named 'constructor'.",ConstructorClassPrivateField:"Classes may not have a private field named '#constructor'.",ConstructorIsAccessor:"Class constructor may not be an accessor.",ConstructorIsAsync:"Constructor can't be an async function.",ConstructorIsGenerator:"Constructor can't be a generator.",DeclarationMissingInitializer:({kind:t})=>`Missing initializer in ${t} declaration.`,DecoratorArgumentsOutsideParentheses:"Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.",DecoratorBeforeExport:"Decorators must be placed *before* the 'export' keyword. Remove the 'decoratorsBeforeExport: true' option to use the 'export @decorator class {}' syntax.",DecoratorsBeforeAfterExport:"Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.",DecoratorConstructor:"Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",DecoratorExportClass:"Decorators must be placed *after* the 'export' keyword. Remove the 'decoratorsBeforeExport: false' option to use the '@decorator export class {}' syntax.",DecoratorSemicolon:"Decorators must not be followed by a semicolon.",DecoratorStaticBlock:"Decorators can't be used with a static block.",DeferImportRequiresNamespace:'Only `import defer * as x from "./module"` is valid.',DeletePrivateField:"Deleting a private field is not allowed.",DestructureNamedImport:"ES2015 named imports do not destructure. Use another statement for destructuring after the import.",DuplicateConstructor:"Duplicate constructor in the same class.",DuplicateDefaultExport:"Only one default export allowed per module.",DuplicateExport:({exportName:t})=>`\`${t}\` has already been exported. Exported identifiers must be unique.`,DuplicateProto:"Redefinition of __proto__ property.",DuplicateRegExpFlags:"Duplicate regular expression flag.",DynamicImportPhaseRequiresImportExpressions:({phase:t})=>`'import.${t}(...)' can only be parsed when using the 'createImportExpressions' option.`,ElementAfterRest:"Rest element must be last element.",EscapedCharNotAnIdentifier:"Invalid Unicode escape.",ExportBindingIsString:({localName:t,exportName:e})=>`A string literal cannot be used as an exported binding without \`from\`.
1110
1110
  - Did you mean \`export { '${t}' as '${e}' } from 'some-module'\`?`,ExportDefaultFromAsIdentifier:"'from' is not allowed as an identifier after 'export default'.",ForInOfLoopInitializer:({type:t})=>`'${t==="ForInStatement"?"for-in":"for-of"}' loop variable declaration may not have an initializer.`,ForInUsing:"For-in loop may not start with 'using' declaration.",ForOfAsync:"The left-hand side of a for-of loop may not be 'async'.",ForOfLet:"The left-hand side of a for-of loop may not start with 'let'.",GeneratorInSingleStatementContext:"Generators can only be declared at the top level or inside a block.",IllegalBreakContinue:({type:t})=>`Unsyntactic ${t==="BreakStatement"?"break":"continue"}.`,IllegalLanguageModeDirective:"Illegal 'use strict' directive in function with non-simple parameter list.",IllegalReturn:"'return' outside of function.",ImportAttributesUseAssert:"The `assert` keyword in import attributes is deprecated and it has been replaced by the `with` keyword. You can enable the `deprecatedAssertSyntax: true` option in the import attributes plugin to suppress this error.",ImportBindingIsString:({importName:t})=>`A string literal cannot be used as an imported binding.
1111
1111
  - Did you mean \`import { "${t}" as foo }\`?`,ImportCallArgumentTrailingComma:"Trailing comma is disallowed inside import(...) arguments.",ImportCallArity:({maxArgumentCount:t})=>`\`import()\` requires exactly ${t===1?"one argument":"one or two arguments"}.`,ImportCallNotNewExpression:"Cannot use new with import(...).",ImportCallSpreadArgument:"`...` is not allowed in `import()`.",ImportJSONBindingNotDefault:"A JSON module can only be imported with `default`.",ImportReflectionHasAssertion:"`import module x` cannot have assertions.",ImportReflectionNotBinding:'Only `import module x from "./module"` is valid.',IncompatibleRegExpUVFlags:"The 'u' and 'v' regular expression flags cannot be enabled at the same time.",InvalidBigIntLiteral:"Invalid BigIntLiteral.",InvalidCodePoint:"Code point out of bounds.",InvalidCoverInitializedName:"Invalid shorthand property initializer.",InvalidDecimal:"Invalid decimal.",InvalidDigit:({radix:t})=>`Expected number in radix ${t}.`,InvalidEscapeSequence:"Bad character escape sequence.",InvalidEscapeSequenceTemplate:"Invalid escape sequence in template.",InvalidEscapedReservedWord:({reservedWord:t})=>`Escape sequence in keyword ${t}.`,InvalidIdentifier:({identifierName:t})=>`Invalid identifier ${t}.`,InvalidLhs:({ancestor:t})=>`Invalid left-hand side in ${Nb(t)}.`,InvalidLhsBinding:({ancestor:t})=>`Binding invalid left-hand side in ${Nb(t)}.`,InvalidLhsOptionalChaining:({ancestor:t})=>`Invalid optional chaining in the left-hand side of ${Nb(t)}.`,InvalidNumber:"Invalid number.",InvalidOrMissingExponent:"Floating-point numbers require a valid exponent after the 'e'.",InvalidOrUnexpectedToken:({unexpected:t})=>`Unexpected character '${t}'.`,InvalidParenthesizedAssignment:"Invalid parenthesized assignment pattern.",InvalidPrivateFieldResolution:({identifierName:t})=>`Private name #${t} is not defined.`,InvalidPropertyBindingPattern:"Binding member expression.",InvalidRecordProperty:"Only properties and spread elements are allowed in record definitions.",InvalidRestAssignmentPattern:"Invalid rest operator's argument.",LabelRedeclaration:({labelName:t})=>`Label '${t}' is already declared.`,LetInLexicalBinding:"'let' is disallowed as a lexically bound name.",LineTerminatorBeforeArrow:"No line break is allowed before '=>'.",MalformedRegExpFlags:"Invalid regular expression flag.",MissingClassName:"A class name is required.",MissingEqInAssignment:"Only '=' operator can be used for specifying default value.",MissingSemicolon:"Missing semicolon.",MissingPlugin:({missingPlugin:t})=>`This experimental syntax requires enabling the parser plugin: ${t.map(e=>JSON.stringify(e)).join(", ")}.`,MissingOneOfPlugins:({missingPlugin:t})=>`This experimental syntax requires enabling one of the following parser plugin(s): ${t.map(e=>JSON.stringify(e)).join(", ")}.`,MissingUnicodeEscape:"Expecting Unicode escape sequence \\uXXXX.",MixingCoalesceWithLogical:"Nullish coalescing operator(??) requires parens when mixing with logical operators.",ModuleAttributeDifferentFromType:"The only accepted module attribute is `type`.",ModuleAttributeInvalidValue:"Only string literals are allowed as module attribute values.",ModuleAttributesWithDuplicateKeys:({key:t})=>`Duplicate key "${t}" is not allowed in module attributes.`,ModuleExportNameHasLoneSurrogate:({surrogateCharCode:t})=>`An export name cannot include a lone surrogate, found '\\u${t.toString(16)}'.`,ModuleExportUndefined:({localName:t})=>`Export '${t}' is not defined.`,MultipleDefaultsInSwitch:"Multiple default clauses.",NewlineAfterThrow:"Illegal newline after throw.",NoCatchOrFinally:"Missing catch or finally clause.",NumberIdentifier:"Identifier directly after number.",NumericSeparatorInEscapeSequence:"Numeric separators are not allowed inside unicode escape sequences or hex escape sequences.",ObsoleteAwaitStar:"'await*' has been removed from the async functions proposal. Use Promise.all() instead.",OptionalChainingNoNew:"Constructors in/after an Optional Chain are not allowed.",OptionalChainingNoTemplate:"Tagged Template Literals are not allowed in optionalChain.",OverrideOnConstructor:"'override' modifier cannot appear on a constructor declaration.",ParamDupe:"Argument name clash.",PatternHasAccessor:"Object pattern can't contain getter or setter.",PatternHasMethod:"Object pattern can't contain methods.",PrivateInExpectedIn:({identifierName:t})=>`Private names are only allowed in property accesses (\`obj.#${t}\`) or in \`in\` expressions (\`#${t} in obj\`).`,PrivateNameRedeclaration:({identifierName:t})=>`Duplicate private name #${t}.`,RecordExpressionBarIncorrectEndSyntaxType:"Record expressions ending with '|}' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionBarIncorrectStartSyntaxType:"Record expressions starting with '{|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",RecordExpressionHashIncorrectStartSyntaxType:"Record expressions starting with '#{' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",RecordNoProto:"'__proto__' is not allowed in Record expressions.",RestTrailingComma:"Unexpected trailing comma after rest element.",SloppyFunction:"In non-strict mode code, functions can only be declared at top level or inside a block.",SloppyFunctionAnnexB:"In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement.",SourcePhaseImportRequiresDefault:'Only `import source x from "./module"` is valid.',StaticPrototype:"Classes may not have static property named prototype.",SuperNotAllowed:"`super()` is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class?",SuperPrivateField:"Private fields can't be accessed on super.",TrailingDecorator:"Decorators must be attached to a class element.",TupleExpressionBarIncorrectEndSyntaxType:"Tuple expressions ending with '|]' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionBarIncorrectStartSyntaxType:"Tuple expressions starting with '[|' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'bar'.",TupleExpressionHashIncorrectStartSyntaxType:"Tuple expressions starting with '#[' are only allowed when the 'syntaxType' option of the 'recordAndTuple' plugin is set to 'hash'.",UnexpectedArgumentPlaceholder:"Unexpected argument placeholder.",UnexpectedAwaitAfterPipelineBody:'Unexpected "await" after pipeline body; await must have parentheses in minimal proposal.',UnexpectedDigitAfterHash:"Unexpected digit after hash token.",UnexpectedImportExport:"'import' and 'export' may only appear at the top level.",UnexpectedKeyword:({keyword:t})=>`Unexpected keyword '${t}'.`,UnexpectedLeadingDecorator:"Leading decorators must be attached to a class declaration.",UnexpectedLexicalDeclaration:"Lexical declaration cannot appear in a single-statement context.",UnexpectedNewTarget:"`new.target` can only be used in functions or class properties.",UnexpectedNumericSeparator:"A numeric separator is only allowed between two digits.",UnexpectedPrivateField:"Unexpected private name.",UnexpectedReservedWord:({reservedWord:t})=>`Unexpected reserved word '${t}'.`,UnexpectedSuper:"'super' is only allowed in object methods and classes.",UnexpectedToken:({expected:t,unexpected:e})=>`Unexpected token${e?` '${e}'.`:""}${t?`, expected "${t}"`:""}`,UnexpectedTokenUnaryExponentiation:"Illegal expression. Wrap left hand side or entire exponentiation in parentheses.",UnexpectedUsingDeclaration:"Using declaration cannot appear in the top level when source type is `script`.",UnsupportedBind:"Binding should be performed on object property.",UnsupportedDecoratorExport:"A decorated export must export a class declaration.",UnsupportedDefaultExport:"Only expressions, functions or classes are allowed as the `default` export.",UnsupportedImport:"`import` can only be used in `import()` or `import.meta`.",UnsupportedMetaProperty:({target:t,onlyValidPropertyName:e})=>`The only valid meta property for ${t} is ${t}.${e}.`,UnsupportedParameterDecorator:"Decorators cannot be used to decorate parameters.",UnsupportedPropertyDecorator:"Decorators cannot be used to decorate object literal properties.",UnsupportedSuper:"'super' can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]).",UnterminatedComment:"Unterminated comment.",UnterminatedRegExp:"Unterminated regular expression.",UnterminatedString:"Unterminated string constant.",UnterminatedTemplate:"Unterminated template.",UsingDeclarationExport:"Using declaration cannot be exported.",UsingDeclarationHasBindingPattern:"Using declaration cannot have destructuring patterns.",VarRedeclaration:({identifierName:t})=>`Identifier '${t}' has already been declared.`,YieldBindingIdentifier:"Can not use 'yield' as identifier inside a generator.",YieldInParameter:"Yield expression is not allowed in formal parameters.",ZeroDigitNumericSeparator:"Numeric separator can not be used after leading 0."},Cde={StrictDelete:"Deleting local variable in strict mode.",StrictEvalArguments:({referenceName:t})=>`Assigning to '${t}' in strict mode.`,StrictEvalArgumentsBinding:({bindingName:t})=>`Binding '${t}' in strict mode.`,StrictFunction:"In strict mode code, functions can only be declared at top level or inside a block.",StrictNumericEscape:"The only valid numeric escape in strict mode is '\\0'.",StrictOctalLiteral:"Legacy octal literals are not allowed in strict mode.",StrictWith:"'with' in strict mode."},Ede=new Set(["ArrowFunctionExpression","AssignmentExpression","ConditionalExpression","YieldExpression"]),Sde={PipeBodyIsTighter:"Unexpected yield after pipeline body; any yield expression acting as Hack-style pipe body must be parenthesized due to its loose operator precedence.",PipeTopicRequiresHackPipes:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.',PipeTopicUnbound:"Topic reference is unbound; it must be inside a pipe body.",PipeTopicUnconfiguredToken:({token:t})=>`Invalid topic token ${t}. In order to use ${t} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${t}" }.`,PipeTopicUnused:"Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.",PipeUnparenthesizedBody:({type:t})=>`Hack-style pipe body cannot be an unparenthesized ${Nb({type:t})}; please wrap it in parentheses.`,PipelineBodyNoArrow:'Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized.',PipelineBodySequenceExpression:"Pipeline body may not be a comma-separated sequence expression.",PipelineHeadSequenceExpression:"Pipeline head should not be a comma-separated sequence expression.",PipelineTopicUnused:"Pipeline is in topic style but does not use topic reference.",PrimaryTopicNotAllowed:"Topic reference was used in a lexical context without topic binding.",PrimaryTopicRequiresSmartPipeline:'Topic reference is used, but the pipelineOperator plugin was not passed a "proposal": "hack" or "smart" option.'},Tde=["message"];function w8(t,e,r){Object.defineProperty(t,e,{enumerable:!1,configurable:!0,value:r})}function Ade({toMessage:t,code:e,reasonCode:r,syntaxPlugin:n}){let i=r==="MissingPlugin"||r==="MissingOneOfPlugins";{let s={AccessorCannotDeclareThisParameter:"AccesorCannotDeclareThisParameter",AccessorCannotHaveTypeParameters:"AccesorCannotHaveTypeParameters",ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference:"ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference",SetAccessorCannotHaveOptionalParameter:"SetAccesorCannotHaveOptionalParameter",SetAccessorCannotHaveRestParameter:"SetAccesorCannotHaveRestParameter",SetAccessorCannotHaveReturnType:"SetAccesorCannotHaveReturnType"};s[r]&&(r=s[r])}return function s(o,a){let c=new SyntaxError;return c.code=e,c.reasonCode=r,c.loc=o,c.pos=o.index,c.syntaxPlugin=n,i&&(c.missingPlugin=a.missingPlugin),w8(c,"clone",function(l={}){var p;let{line:d,column:h,index:m}=(p=l.loc)!=null?p:o;return s(new Do(d,h,m),Object.assign({},a,l.details))}),w8(c,"details",a),Object.defineProperty(c,"message",{configurable:!0,get(){let u=`${t(a)} (${o.line}:${o.column})`;return this.message=u,u},set(u){Object.defineProperty(this,"message",{value:u,writable:!0})}}),c}}function ha(t,e){if(Array.isArray(t))return n=>ha(n,t[0]);let r={};for(let n of Object.keys(t)){let i=t[n],s=typeof i=="string"?{message:()=>i}:typeof i=="function"?{message:i}:i,{message:o}=s,a=xde(s,Tde),c=typeof o=="string"?()=>o:o;r[n]=Ade(Object.assign({code:"BABEL_PARSER_SYNTAX_ERROR",reasonCode:n,toMessage:c},e?{syntaxPlugin:e}:{},a))}return r}var O=Object.assign({},ha(Dde),ha(wde),ha(Cde),ha`pipelineOperator`(Sde)),{defineProperty:Pde}=Object,C8=(t,e)=>{t&&Pde(t,e,{enumerable:!1,value:t[e]})};function bm(t){return C8(t.loc.start,"index"),C8(t.loc.end,"index"),t}var _de=t=>class extends t{parse(){let r=bm(super.parse());return this.options.tokens&&(r.tokens=r.tokens.map(bm)),r}parseRegExpLiteral({pattern:r,flags:n}){let i=null;try{i=new RegExp(r,n)}catch{}let s=this.estreeParseLiteral(i);return s.regex={pattern:r,flags:n},s}parseBigIntLiteral(r){let n;try{n=BigInt(r)}catch{n=null}let i=this.estreeParseLiteral(n);return i.bigint=String(i.value||r),i}parseDecimalLiteral(r){let i=this.estreeParseLiteral(null);return i.decimal=String(i.value||r),i}estreeParseLiteral(r){return this.parseLiteral(r,"Literal")}parseStringLiteral(r){return this.estreeParseLiteral(r)}parseNumericLiteral(r){return this.estreeParseLiteral(r)}parseNullLiteral(){return this.estreeParseLiteral(null)}parseBooleanLiteral(r){return this.estreeParseLiteral(r)}directiveToStmt(r){let n=r.value;delete r.value,n.type="Literal",n.raw=n.extra.raw,n.value=n.extra.expressionValue;let i=r;return i.type="ExpressionStatement",i.expression=n,i.directive=n.extra.rawValue,delete n.extra,i}initFunction(r,n){super.initFunction(r,n),r.expression=!1}checkDeclaration(r){r!=null&&this.isObjectProperty(r)?this.checkDeclaration(r.value):super.checkDeclaration(r)}getObjectOrClassMethodParams(r){return r.value.params}isValidDirective(r){var n;return r.type==="ExpressionStatement"&&r.expression.type==="Literal"&&typeof r.expression.value=="string"&&!((n=r.expression.extra)!=null&&n.parenthesized)}parseBlockBody(r,n,i,s,o){super.parseBlockBody(r,n,i,s,o);let a=r.directives.map(c=>this.directiveToStmt(c));r.body=a.concat(r.body),delete r.directives}pushClassMethod(r,n,i,s,o,a){this.parseMethod(n,i,s,o,a,"ClassMethod",!0),n.typeParameters&&(n.value.typeParameters=n.typeParameters,delete n.typeParameters),r.body.push(n)}parsePrivateName(){let r=super.parsePrivateName();return this.getPluginOption("estree","classFeatures")?this.convertPrivateNameToPrivateIdentifier(r):r}convertPrivateNameToPrivateIdentifier(r){let n=super.getPrivateNameSV(r);return r=r,delete r.id,r.name=n,r.type="PrivateIdentifier",r}isPrivateName(r){return this.getPluginOption("estree","classFeatures")?r.type==="PrivateIdentifier":super.isPrivateName(r)}getPrivateNameSV(r){return this.getPluginOption("estree","classFeatures")?r.name:super.getPrivateNameSV(r)}parseLiteral(r,n){let i=super.parseLiteral(r,n);return i.raw=i.extra.raw,delete i.extra,i}parseFunctionBody(r,n,i=!1){super.parseFunctionBody(r,n,i),r.expression=r.body.type!=="BlockStatement"}parseMethod(r,n,i,s,o,a,c=!1){let u=this.startNode();return u.kind=r.kind,u=super.parseMethod(u,n,i,s,o,a,c),u.type="FunctionExpression",delete u.kind,r.value=u,a==="ClassPrivateMethod"&&(r.computed=!1),this.finishNode(r,"MethodDefinition")}nameIsConstructor(r){return r.type==="Literal"?r.value==="constructor":super.nameIsConstructor(r)}parseClassProperty(...r){let n=super.parseClassProperty(...r);return this.getPluginOption("estree","classFeatures")&&(n.type="PropertyDefinition"),n}parseClassPrivateProperty(...r){let n=super.parseClassPrivateProperty(...r);return this.getPluginOption("estree","classFeatures")&&(n.type="PropertyDefinition",n.computed=!1),n}parseObjectMethod(r,n,i,s,o){let a=super.parseObjectMethod(r,n,i,s,o);return a&&(a.type="Property",a.kind==="method"&&(a.kind="init"),a.shorthand=!1),a}parseObjectProperty(r,n,i,s){let o=super.parseObjectProperty(r,n,i,s);return o&&(o.kind="init",o.type="Property"),o}isValidLVal(r,n,i){return r==="Property"?"value":super.isValidLVal(r,n,i)}isAssignable(r,n){return r!=null&&this.isObjectProperty(r)?this.isAssignable(r.value,n):super.isAssignable(r,n)}toAssignable(r,n=!1){if(r!=null&&this.isObjectProperty(r)){let{key:i,value:s}=r;this.isPrivateName(i)&&this.classScope.usePrivateName(this.getPrivateNameSV(i),i.loc.start),this.toAssignable(s,n)}else super.toAssignable(r,n)}toAssignableObjectExpressionProp(r,n,i){r.type==="Property"&&(r.kind==="get"||r.kind==="set")?this.raise(O.PatternHasAccessor,r.key):r.type==="Property"&&r.method?this.raise(O.PatternHasMethod,r.key):super.toAssignableObjectExpressionProp(r,n,i)}finishCallExpression(r,n){let i=super.finishCallExpression(r,n);if(i.callee.type==="Import"){if(i.type="ImportExpression",i.source=i.arguments[0],this.hasPlugin("importAttributes")||this.hasPlugin("importAssertions")){var s,o;i.options=(s=i.arguments[1])!=null?s:null,i.attributes=(o=i.arguments[1])!=null?o:null}delete i.arguments,delete i.callee}return i}toReferencedArguments(r){r.type!=="ImportExpression"&&super.toReferencedArguments(r)}parseExport(r,n){let i=this.state.lastTokStartLoc,s=super.parseExport(r,n);switch(s.type){case"ExportAllDeclaration":s.exported=null;break;case"ExportNamedDeclaration":s.specifiers.length===1&&s.specifiers[0].type==="ExportNamespaceSpecifier"&&(s.type="ExportAllDeclaration",s.exported=s.specifiers[0].exported,delete s.specifiers);case"ExportDefaultDeclaration":{var o;let{declaration:a}=s;a?.type==="ClassDeclaration"&&((o=a.decorators)==null?void 0:o.length)>0&&a.start===s.start&&this.resetStartLocation(s,i)}break}return s}parseSubscript(r,n,i,s){let o=super.parseSubscript(r,n,i,s);if(s.optionalChainMember){if((o.type==="OptionalMemberExpression"||o.type==="OptionalCallExpression")&&(o.type=o.type.substring(8)),s.stop){let a=this.startNodeAtNode(o);return a.expression=o,this.finishNode(a,"ChainExpression")}}else(o.type==="MemberExpression"||o.type==="CallExpression")&&(o.optional=!1);return o}isOptionalMemberExpression(r){return r.type==="ChainExpression"?r.expression.type==="MemberExpression":super.isOptionalMemberExpression(r)}hasPropertyAsPrivateName(r){return r.type==="ChainExpression"&&(r=r.expression),super.hasPropertyAsPrivateName(r)}isObjectProperty(r){return r.type==="Property"&&r.kind==="init"&&!r.method}isObjectMethod(r){return r.type==="Property"&&(r.method||r.kind==="get"||r.kind==="set")}finishNodeAt(r,n,i){return bm(super.finishNodeAt(r,n,i))}resetStartLocation(r,n){super.resetStartLocation(r,n),bm(r)}resetEndLocation(r,n=this.state.lastTokEndLoc){super.resetEndLocation(r,n),bm(r)}},Cu=class{constructor(e,r){this.token=void 0,this.preserveSpace=void 0,this.token=e,this.preserveSpace=!!r}},Ot={brace:new Cu("{"),j_oTag:new Cu("<tag"),j_cTag:new Cu("</tag"),j_expr:new Cu("<tag>...</tag>",!0)};Ot.template=new Cu("`",!0);var Ke=!0,ue=!0,PE=!0,vm=!0,nc=!0,Fde=!0,Mb=class{constructor(e,r={}){this.label=void 0,this.keyword=void 0,this.beforeExpr=void 0,this.startsExpr=void 0,this.rightAssociative=void 0,this.isLoop=void 0,this.isAssign=void 0,this.prefix=void 0,this.postfix=void 0,this.binop=void 0,this.label=e,this.keyword=r.keyword,this.beforeExpr=!!r.beforeExpr,this.startsExpr=!!r.startsExpr,this.rightAssociative=!!r.rightAssociative,this.isLoop=!!r.isLoop,this.isAssign=!!r.isAssign,this.prefix=!!r.prefix,this.postfix=!!r.postfix,this.binop=r.binop!=null?r.binop:null,this.updateContext=null}},eS=new Map;function at(t,e={}){e.keyword=t;let r=ve(t,e);return eS.set(t,r),r}function Bn(t,e){return ve(t,{beforeExpr:Ke,binop:e})}var Cm=-1,fa=[],tS=[],rS=[],nS=[],iS=[],sS=[];function ve(t,e={}){var r,n,i,s;return++Cm,tS.push(t),rS.push((r=e.binop)!=null?r:-1),nS.push((n=e.beforeExpr)!=null?n:!1),iS.push((i=e.startsExpr)!=null?i:!1),sS.push((s=e.prefix)!=null?s:!1),fa.push(new Mb(t,e)),Cm}function He(t,e={}){var r,n,i,s;return++Cm,eS.set(t,Cm),tS.push(t),rS.push((r=e.binop)!=null?r:-1),nS.push((n=e.beforeExpr)!=null?n:!1),iS.push((i=e.startsExpr)!=null?i:!1),sS.push((s=e.prefix)!=null?s:!1),fa.push(new Mb("name",e)),Cm}var kde={bracketL:ve("[",{beforeExpr:Ke,startsExpr:ue}),bracketHashL:ve("#[",{beforeExpr:Ke,startsExpr:ue}),bracketBarL:ve("[|",{beforeExpr:Ke,startsExpr:ue}),bracketR:ve("]"),bracketBarR:ve("|]"),braceL:ve("{",{beforeExpr:Ke,startsExpr:ue}),braceBarL:ve("{|",{beforeExpr:Ke,startsExpr:ue}),braceHashL:ve("#{",{beforeExpr:Ke,startsExpr:ue}),braceR:ve("}"),braceBarR:ve("|}"),parenL:ve("(",{beforeExpr:Ke,startsExpr:ue}),parenR:ve(")"),comma:ve(",",{beforeExpr:Ke}),semi:ve(";",{beforeExpr:Ke}),colon:ve(":",{beforeExpr:Ke}),doubleColon:ve("::",{beforeExpr:Ke}),dot:ve("."),question:ve("?",{beforeExpr:Ke}),questionDot:ve("?."),arrow:ve("=>",{beforeExpr:Ke}),template:ve("template"),ellipsis:ve("...",{beforeExpr:Ke}),backQuote:ve("`",{startsExpr:ue}),dollarBraceL:ve("${",{beforeExpr:Ke,startsExpr:ue}),templateTail:ve("...`",{startsExpr:ue}),templateNonTail:ve("...${",{beforeExpr:Ke,startsExpr:ue}),at:ve("@"),hash:ve("#",{startsExpr:ue}),interpreterDirective:ve("#!..."),eq:ve("=",{beforeExpr:Ke,isAssign:vm}),assign:ve("_=",{beforeExpr:Ke,isAssign:vm}),slashAssign:ve("_=",{beforeExpr:Ke,isAssign:vm}),xorAssign:ve("_=",{beforeExpr:Ke,isAssign:vm}),moduloAssign:ve("_=",{beforeExpr:Ke,isAssign:vm}),incDec:ve("++/--",{prefix:nc,postfix:Fde,startsExpr:ue}),bang:ve("!",{beforeExpr:Ke,prefix:nc,startsExpr:ue}),tilde:ve("~",{beforeExpr:Ke,prefix:nc,startsExpr:ue}),doubleCaret:ve("^^",{startsExpr:ue}),doubleAt:ve("@@",{startsExpr:ue}),pipeline:Bn("|>",0),nullishCoalescing:Bn("??",1),logicalOR:Bn("||",1),logicalAND:Bn("&&",2),bitwiseOR:Bn("|",3),bitwiseXOR:Bn("^",4),bitwiseAND:Bn("&",5),equality:Bn("==/!=/===/!==",6),lt:Bn("</>/<=/>=",7),gt:Bn("</>/<=/>=",7),relational:Bn("</>/<=/>=",7),bitShift:Bn("<</>>/>>>",8),bitShiftL:Bn("<</>>/>>>",8),bitShiftR:Bn("<</>>/>>>",8),plusMin:ve("+/-",{beforeExpr:Ke,binop:9,prefix:nc,startsExpr:ue}),modulo:ve("%",{binop:10,startsExpr:ue}),star:ve("*",{binop:10}),slash:Bn("/",10),exponent:ve("**",{beforeExpr:Ke,binop:11,rightAssociative:!0}),_in:at("in",{beforeExpr:Ke,binop:7}),_instanceof:at("instanceof",{beforeExpr:Ke,binop:7}),_break:at("break"),_case:at("case",{beforeExpr:Ke}),_catch:at("catch"),_continue:at("continue"),_debugger:at("debugger"),_default:at("default",{beforeExpr:Ke}),_else:at("else",{beforeExpr:Ke}),_finally:at("finally"),_function:at("function",{startsExpr:ue}),_if:at("if"),_return:at("return",{beforeExpr:Ke}),_switch:at("switch"),_throw:at("throw",{beforeExpr:Ke,prefix:nc,startsExpr:ue}),_try:at("try"),_var:at("var"),_const:at("const"),_with:at("with"),_new:at("new",{beforeExpr:Ke,startsExpr:ue}),_this:at("this",{startsExpr:ue}),_super:at("super",{startsExpr:ue}),_class:at("class",{startsExpr:ue}),_extends:at("extends",{beforeExpr:Ke}),_export:at("export"),_import:at("import",{startsExpr:ue}),_null:at("null",{startsExpr:ue}),_true:at("true",{startsExpr:ue}),_false:at("false",{startsExpr:ue}),_typeof:at("typeof",{beforeExpr:Ke,prefix:nc,startsExpr:ue}),_void:at("void",{beforeExpr:Ke,prefix:nc,startsExpr:ue}),_delete:at("delete",{beforeExpr:Ke,prefix:nc,startsExpr:ue}),_do:at("do",{isLoop:PE,beforeExpr:Ke}),_for:at("for",{isLoop:PE}),_while:at("while",{isLoop:PE}),_as:He("as",{startsExpr:ue}),_assert:He("assert",{startsExpr:ue}),_async:He("async",{startsExpr:ue}),_await:He("await",{startsExpr:ue}),_defer:He("defer",{startsExpr:ue}),_from:He("from",{startsExpr:ue}),_get:He("get",{startsExpr:ue}),_let:He("let",{startsExpr:ue}),_meta:He("meta",{startsExpr:ue}),_of:He("of",{startsExpr:ue}),_sent:He("sent",{startsExpr:ue}),_set:He("set",{startsExpr:ue}),_source:He("source",{startsExpr:ue}),_static:He("static",{startsExpr:ue}),_using:He("using",{startsExpr:ue}),_yield:He("yield",{startsExpr:ue}),_asserts:He("asserts",{startsExpr:ue}),_checks:He("checks",{startsExpr:ue}),_exports:He("exports",{startsExpr:ue}),_global:He("global",{startsExpr:ue}),_implements:He("implements",{startsExpr:ue}),_intrinsic:He("intrinsic",{startsExpr:ue}),_infer:He("infer",{startsExpr:ue}),_is:He("is",{startsExpr:ue}),_mixins:He("mixins",{startsExpr:ue}),_proto:He("proto",{startsExpr:ue}),_require:He("require",{startsExpr:ue}),_satisfies:He("satisfies",{startsExpr:ue}),_keyof:He("keyof",{startsExpr:ue}),_readonly:He("readonly",{startsExpr:ue}),_unique:He("unique",{startsExpr:ue}),_abstract:He("abstract",{startsExpr:ue}),_declare:He("declare",{startsExpr:ue}),_enum:He("enum",{startsExpr:ue}),_module:He("module",{startsExpr:ue}),_namespace:He("namespace",{startsExpr:ue}),_interface:He("interface",{startsExpr:ue}),_type:He("type",{startsExpr:ue}),_opaque:He("opaque",{startsExpr:ue}),name:ve("name",{startsExpr:ue}),string:ve("string",{startsExpr:ue}),num:ve("num",{startsExpr:ue}),bigint:ve("bigint",{startsExpr:ue}),decimal:ve("decimal",{startsExpr:ue}),regexp:ve("regexp",{startsExpr:ue}),privateName:ve("#name",{startsExpr:ue}),eof:ve("eof"),jsxName:ve("jsxName"),jsxText:ve("jsxText",{beforeExpr:!0}),jsxTagStart:ve("jsxTagStart",{startsExpr:!0}),jsxTagEnd:ve("jsxTagEnd"),placeholder:ve("%%",{startsExpr:!0})};function wt(t){return t>=93&&t<=132}function Ide(t){return t<=92}function Bs(t){return t>=58&&t<=132}function O8(t){return t>=58&&t<=136}function Nde(t){return nS[t]}function RE(t){return iS[t]}function Rde(t){return t>=29&&t<=33}function E8(t){return t>=129&&t<=131}function Ode(t){return t>=90&&t<=92}function oS(t){return t>=58&&t<=92}function Mde(t){return t>=39&&t<=59}function Bde(t){return t===34}function Lde(t){return sS[t]}function $de(t){return t>=121&&t<=123}function jde(t){return t>=124&&t<=130}function sc(t){return tS[t]}function Rb(t){return rS[t]}function Ude(t){return t===57}function Bb(t){return t>=24&&t<=25}function da(t){return fa[t]}fa[8].updateContext=t=>{t.pop()},fa[5].updateContext=fa[7].updateContext=fa[23].updateContext=t=>{t.push(Ot.brace)},fa[22].updateContext=t=>{t[t.length-1]===Ot.template?t.pop():t.push(Ot.template)},fa[142].updateContext=t=>{t.push(Ot.j_expr,Ot.j_oTag)};var aS="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",M8="\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0898-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ACE\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",qde=new RegExp("["+aS+"]"),zde=new RegExp("["+aS+M8+"]");aS=M8=null;var B8=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],Gde=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239];function OE(t,e){let r=65536;for(let n=0,i=e.length;n<i;n+=2){if(r+=e[n],r>t)return!1;if(r+=e[n+1],r>=t)return!0}return!1}function ma(t){return t<65?t===36:t<=90?!0:t<97?t===95:t<=122?!0:t<=65535?t>=170&&qde.test(String.fromCharCode(t)):OE(t,B8)}function Sp(t){return t<48?t===36:t<58?!0:t<65?!1:t<=90?!0:t<97?t===95:t<=122?!0:t<=65535?t>=170&&zde.test(String.fromCharCode(t)):OE(t,B8)||OE(t,Gde)}var cS={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"],strictBind:["eval","arguments"]},Vde=new Set(cS.keyword),Hde=new Set(cS.strict),Kde=new Set(cS.strictBind);function L8(t,e){return e&&t==="await"||t==="enum"}function $8(t,e){return L8(t,e)||Hde.has(t)}function j8(t){return Kde.has(t)}function U8(t,e){return $8(t,e)||j8(t)}function Wde(t){return Vde.has(t)}function Jde(t,e,r){return t===64&&e===64&&ma(r)}var Yde=new Set(["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete","implements","interface","let","package","private","protected","public","static","yield","eval","arguments","enum","await"]);function Xde(t){return Yde.has(t)}var Em=class{constructor(e){this.flags=0,this.names=new Map,this.firstLexicalName="",this.flags=e}},Sm=class{constructor(e,r){this.parser=void 0,this.scopeStack=[],this.inModule=void 0,this.undefinedExports=new Map,this.parser=e,this.inModule=r}get inTopLevel(){return(this.currentScope().flags&1)>0}get inFunction(){return(this.currentVarScopeFlags()&2)>0}get allowSuper(){return(this.currentThisScopeFlags()&16)>0}get allowDirectSuper(){return(this.currentThisScopeFlags()&32)>0}get inClass(){return(this.currentThisScopeFlags()&64)>0}get inClassAndNotInNonArrowFunction(){let e=this.currentThisScopeFlags();return(e&64)>0&&(e&2)===0}get inStaticBlock(){for(let e=this.scopeStack.length-1;;e--){let{flags:r}=this.scopeStack[e];if(r&128)return!0;if(r&451)return!1}}get inNonArrowFunction(){return(this.currentThisScopeFlags()&2)>0}get treatFunctionsAsVar(){return this.treatFunctionsAsVarInScope(this.currentScope())}createScope(e){return new Em(e)}enter(e){this.scopeStack.push(this.createScope(e))}exit(){return this.scopeStack.pop().flags}treatFunctionsAsVarInScope(e){return!!(e.flags&130||!this.parser.inModule&&e.flags&1)}declareName(e,r,n){let i=this.currentScope();if(r&8||r&16){this.checkRedeclarationInScope(i,e,r,n);let s=i.names.get(e)||0;r&16?s=s|4:(i.firstLexicalName||(i.firstLexicalName=e),s=s|2),i.names.set(e,s),r&8&&this.maybeExportDefined(i,e)}else if(r&4)for(let s=this.scopeStack.length-1;s>=0&&(i=this.scopeStack[s],this.checkRedeclarationInScope(i,e,r,n),i.names.set(e,(i.names.get(e)||0)|1),this.maybeExportDefined(i,e),!(i.flags&387));--s);this.parser.inModule&&i.flags&1&&this.undefinedExports.delete(e)}maybeExportDefined(e,r){this.parser.inModule&&e.flags&1&&this.undefinedExports.delete(r)}checkRedeclarationInScope(e,r,n,i){this.isRedeclaredInScope(e,r,n)&&this.parser.raise(O.VarRedeclaration,i,{identifierName:r})}isRedeclaredInScope(e,r,n){if(!(n&1))return!1;if(n&8)return e.names.has(r);let i=e.names.get(r);return n&16?(i&2)>0||!this.treatFunctionsAsVarInScope(e)&&(i&1)>0:(i&2)>0&&!(e.flags&8&&e.firstLexicalName===r)||!this.treatFunctionsAsVarInScope(e)&&(i&4)>0}checkLocalExport(e){let{name:r}=e;this.scopeStack[0].names.has(r)||this.undefinedExports.set(r,e.loc.start)}currentScope(){return this.scopeStack[this.scopeStack.length-1]}currentVarScopeFlags(){for(let e=this.scopeStack.length-1;;e--){let{flags:r}=this.scopeStack[e];if(r&387)return r}}currentThisScopeFlags(){for(let e=this.scopeStack.length-1;;e--){let{flags:r}=this.scopeStack[e];if(r&451&&!(r&4))return r}}},ME=class extends Em{constructor(...e){super(...e),this.declareFunctions=new Set}},BE=class extends Sm{createScope(e){return new ME(e)}declareName(e,r,n){let i=this.currentScope();if(r&2048){this.checkRedeclarationInScope(i,e,r,n),this.maybeExportDefined(i,e),i.declareFunctions.add(e);return}super.declareName(e,r,n)}isRedeclaredInScope(e,r,n){if(super.isRedeclaredInScope(e,r,n))return!0;if(n&2048&&!e.declareFunctions.has(r)){let i=e.names.get(r);return(i&4)>0||(i&2)>0}return!1}checkLocalExport(e){this.scopeStack[0].declareFunctions.has(e.name)||super.checkLocalExport(e)}},LE=class{constructor(){this.sawUnambiguousESM=!1,this.ambiguousScriptDifferentAst=!1}hasPlugin(e){if(typeof e=="string")return this.plugins.has(e);{let[r,n]=e;if(!this.hasPlugin(r))return!1;let i=this.plugins.get(r);for(let s of Object.keys(n))if(i?.[s]!==n[s])return!1;return!0}}getPluginOption(e,r){var n;return(n=this.plugins.get(e))==null?void 0:n[r]}};function q8(t,e){t.trailingComments===void 0?t.trailingComments=e:t.trailingComments.unshift(...e)}function Zde(t,e){t.leadingComments===void 0?t.leadingComments=e:t.leadingComments.unshift(...e)}function Tm(t,e){t.innerComments===void 0?t.innerComments=e:t.innerComments.unshift(...e)}function xm(t,e,r){let n=null,i=e.length;for(;n===null&&i>0;)n=e[--i];n===null||n.start>r.start?Tm(t,r.comments):q8(n,r.comments)}var $E=class extends LE{addComment(e){this.filename&&(e.loc.filename=this.filename);let{commentsLen:r}=this.state;this.comments.length!==r&&(this.comments.length=r),this.comments.push(e),this.state.commentsLen++}processComment(e){let{commentStack:r}=this.state,n=r.length;if(n===0)return;let i=n-1,s=r[i];s.start===e.end&&(s.leadingNode=e,i--);let{start:o}=e;for(;i>=0;i--){let a=r[i],c=a.end;if(c>o)a.containingNode=e,this.finalizeComment(a),r.splice(i,1);else{c===o&&(a.trailingNode=e);break}}}finalizeComment(e){let{comments:r}=e;if(e.leadingNode!==null||e.trailingNode!==null)e.leadingNode!==null&&q8(e.leadingNode,r),e.trailingNode!==null&&Zde(e.trailingNode,r);else{let{containingNode:n,start:i}=e;if(this.input.charCodeAt(i-1)===44)switch(n.type){case"ObjectExpression":case"ObjectPattern":case"RecordExpression":xm(n,n.properties,e);break;case"CallExpression":case"OptionalCallExpression":xm(n,n.arguments,e);break;case"FunctionDeclaration":case"FunctionExpression":case"ArrowFunctionExpression":case"ObjectMethod":case"ClassMethod":case"ClassPrivateMethod":xm(n,n.params,e);break;case"ArrayExpression":case"ArrayPattern":case"TupleExpression":xm(n,n.elements,e);break;case"ExportNamedDeclaration":case"ImportDeclaration":xm(n,n.specifiers,e);break;default:Tm(n,r)}else Tm(n,r)}}finalizeRemainingComments(){let{commentStack:e}=this.state;for(let r=e.length-1;r>=0;r--)this.finalizeComment(e[r]);this.state.commentStack=[]}resetPreviousNodeTrailingComments(e){let{commentStack:r}=this.state,{length:n}=r;if(n===0)return;let i=r[n-1];i.leadingNode===e&&(i.leadingNode=null)}resetPreviousIdentifierLeadingComments(e){let{commentStack:r}=this.state,{length:n}=r;n!==0&&(r[n-1].trailingNode===e?r[n-1].trailingNode=null:n>=2&&r[n-2].trailingNode===e&&(r[n-2].trailingNode=null))}takeSurroundingComments(e,r,n){let{commentStack:i}=this.state,s=i.length;if(s===0)return;let o=s-1;for(;o>=0;o--){let a=i[o],c=a.end;if(a.start===n)a.leadingNode=e;else if(c===r)a.trailingNode=e;else if(c<r)break}}},Qde=/\r\n|[\r\n\u2028\u2029]/,kb=new RegExp(Qde.source,"g");function Tp(t){switch(t){case 10:case 13:case 8232:case 8233:return!0;default:return!1}}function S8(t,e,r){for(let n=e;n<r;n++)if(Tp(t.charCodeAt(n)))return!0;return!1}var _E=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,FE=/(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g;function efe(t){switch(t){case 9:case 11:case 12:case 32:case 160:case 5760:case 8192:case 8193:case 8194:case 8195:case 8196:case 8197:case 8198:case 8199:case 8200:case 8201:case 8202:case 8239:case 8287:case 12288:case 65279:return!0;default:return!1}}var jE=class t{constructor(){this.flags=1024,this.curLine=void 0,this.lineStart=void 0,this.startLoc=void 0,this.endLoc=void 0,this.errors=[],this.potentialArrowAt=-1,this.noArrowAt=[],this.noArrowParamsConversionAt=[],this.topicContext={maxNumOfResolvableTopics:0,maxTopicIndex:null},this.labels=[],this.commentsLen=0,this.commentStack=[],this.pos=0,this.type=139,this.value=null,this.start=0,this.end=0,this.lastTokEndLoc=null,this.lastTokStartLoc=null,this.context=[Ot.brace],this.firstInvalidTemplateEscapePos=null,this.strictErrors=new Map,this.tokensLength=0}get strict(){return(this.flags&1)>0}set strict(e){e?this.flags|=1:this.flags&=-2}init({strictMode:e,sourceType:r,startLine:n,startColumn:i}){this.strict=e===!1?!1:e===!0?!0:r==="module",this.curLine=n,this.lineStart=-i,this.startLoc=this.endLoc=new Do(n,i,0)}get maybeInArrowParameters(){return(this.flags&2)>0}set maybeInArrowParameters(e){e?this.flags|=2:this.flags&=-3}get inType(){return(this.flags&4)>0}set inType(e){e?this.flags|=4:this.flags&=-5}get noAnonFunctionType(){return(this.flags&8)>0}set noAnonFunctionType(e){e?this.flags|=8:this.flags&=-9}get hasFlowComment(){return(this.flags&16)>0}set hasFlowComment(e){e?this.flags|=16:this.flags&=-17}get isAmbientContext(){return(this.flags&32)>0}set isAmbientContext(e){e?this.flags|=32:this.flags&=-33}get inAbstractClass(){return(this.flags&64)>0}set inAbstractClass(e){e?this.flags|=64:this.flags&=-65}get inDisallowConditionalTypesContext(){return(this.flags&128)>0}set inDisallowConditionalTypesContext(e){e?this.flags|=128:this.flags&=-129}get soloAwait(){return(this.flags&256)>0}set soloAwait(e){e?this.flags|=256:this.flags&=-257}get inFSharpPipelineDirectBody(){return(this.flags&512)>0}set inFSharpPipelineDirectBody(e){e?this.flags|=512:this.flags&=-513}get canStartJSXElement(){return(this.flags&1024)>0}set canStartJSXElement(e){e?this.flags|=1024:this.flags&=-1025}get containsEsc(){return(this.flags&2048)>0}set containsEsc(e){e?this.flags|=2048:this.flags&=-2049}get hasTopLevelAwait(){return(this.flags&4096)>0}set hasTopLevelAwait(e){e?this.flags|=4096:this.flags&=-4097}curPosition(){return new Do(this.curLine,this.pos-this.lineStart,this.pos)}clone(){let e=new t;return e.flags=this.flags,e.curLine=this.curLine,e.lineStart=this.lineStart,e.startLoc=this.startLoc,e.endLoc=this.endLoc,e.errors=this.errors.slice(),e.potentialArrowAt=this.potentialArrowAt,e.noArrowAt=this.noArrowAt.slice(),e.noArrowParamsConversionAt=this.noArrowParamsConversionAt.slice(),e.topicContext=this.topicContext,e.labels=this.labels.slice(),e.commentsLen=this.commentsLen,e.commentStack=this.commentStack.slice(),e.pos=this.pos,e.type=this.type,e.value=this.value,e.start=this.start,e.end=this.end,e.lastTokEndLoc=this.lastTokEndLoc,e.lastTokStartLoc=this.lastTokStartLoc,e.context=this.context.slice(),e.firstInvalidTemplateEscapePos=this.firstInvalidTemplateEscapePos,e.strictErrors=this.strictErrors,e.tokensLength=this.tokensLength,e}},tfe=function(e){return e>=48&&e<=57},T8={decBinOct:new Set([46,66,69,79,95,98,101,111]),hex:new Set([46,88,95,120])},Ib={bin:t=>t===48||t===49,oct:t=>t>=48&&t<=55,dec:t=>t>=48&&t<=57,hex:t=>t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102};function A8(t,e,r,n,i,s){let o=r,a=n,c=i,u="",l=null,p=r,{length:d}=e;for(;;){if(r>=d){s.unterminated(o,a,c),u+=e.slice(p,r);break}let h=e.charCodeAt(r);if(rfe(t,h,e,r)){u+=e.slice(p,r);break}if(h===92){u+=e.slice(p,r);let m=nfe(e,r,n,i,t==="template",s);m.ch===null&&!l?l={pos:r,lineStart:n,curLine:i}:u+=m.ch,{pos:r,lineStart:n,curLine:i}=m,p=r}else h===8232||h===8233?(++r,++i,n=r):h===10||h===13?t==="template"?(u+=e.slice(p,r)+`
1112
1112
  `,++r,h===13&&e.charCodeAt(r)===10&&++r,++i,p=n=r):s.unterminated(o,a,c):++r}return{pos:r,str:u,firstInvalidLoc:l,lineStart:n,curLine:i,containsInvalid:!!l}}function rfe(t,e,r,n){return t==="template"?e===96||e===36&&r.charCodeAt(n+1)===123:e===(t==="double"?34:39)}function nfe(t,e,r,n,i,s){let o=!i;e++;let a=u=>({pos:e,ch:u,lineStart:r,curLine:n}),c=t.charCodeAt(e++);switch(c){case 110:return a(`
@@ -1252,7 +1252,7 @@ Restarting server after Builder Devtools update...
1252
1252
  <h3>How's Devtools working for you?</h3>
1253
1253
  <p>We'd love your feedback!</p>
1254
1254
  </div>
1255
- \`,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.18.30"}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)}
1255
+ \`,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.18.33"}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)}
1256
1256
  </style>\`,Dt=class extends HTMLElement{constructor(){super()}connectedCallback(){let e=this.attachShadow({mode:"open"});e.innerHTML=lo+\`<main>
1257
1257
  <aside>
1258
1258
  <div class="logo"></div>
@@ -1291,7 +1291,7 @@ Restarting server after Builder Devtools update...
1291
1291
  </nav>
1292
1292
  </section>
1293
1293
  </main>
1294
- \`,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.18.30"),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.18.30"),mo());})();`)}async function Tj(t){return Aj(t,`<!doctype html>
1294
+ \`,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.18.33"),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.18.33"),mo());})();`)}async function Tj(t){return Aj(t,`<!doctype html>
1295
1295
  <html lang="en" dir="ltr">
1296
1296
  <head>
1297
1297
  <meta charset="utf-8" />
@@ -1945,9 +1945,9 @@ NEXT UP!
1945
1945
  `):void 0})}let g=m.substring(4).split(" ")[0],y=lFe(g);m.startsWith("--- ")?(s=y,i=y,a=0,c=0,u=[],l=[],o=null,p=g==="/dev/null",d=!1):m.startsWith("+++ ")&&(d=g==="/dev/null",g==="/dev/null"?i=s:i=y);continue}else{if(m.startsWith("@@"))continue;m.startsWith("+")?(a++,u.push(m.substring(1)),o===null&&(o="update")):m.startsWith("-")?(c++,l.push(m.substring(1)),o===null&&(o="update")):(m.startsWith(" ")||m==="")&&(u.push(m.substring(1)),l.push(m.substring(1)))}}if(i&&o){let h;p?h="create":d?h="delete":h="update";let m=h==="delete"&&s?s:i;r.push({filePath:m,addedLines:a,removedLines:c,action:h,content:u.length>0?u.join(`
1946
1946
  `):void 0,oldContent:l.length>0?l.join(`
1947
1947
  `):void 0})}return r}var CK=k(()=>{"use strict";f()});var Mc,EK=k(()=>{"use strict";f();Mc=(...t)=>{typeof process<"u"&&process.env.DEBUG==="true"&&console.debug("[DEBUG] ",...t)}});var dFe,Ld,SK,fFe,mFe,hFe,N0,GF=k(()=>{"use strict";f();EK();dFe=()=>{if(typeof globalThis<"u"&&globalThis.crypto)return globalThis.crypto;if(typeof require<"u")try{let t=require("crypto");if(t.webcrypto)return t.webcrypto}catch{}throw new Error("Web Crypto API is not available. Requires Node.js 15+ or a browser environment.")},Ld=dFe(),SK=async()=>{let t=await Ld.subtle.generateKey({name:"AES-GCM",length:256},!0,["encrypt","decrypt"]),e=await Ld.subtle.exportKey("jwk",t);return JSON.stringify(e)},fFe=async()=>Ld.getRandomValues(new Uint8Array(16)),mFe=async(t,e,r)=>{let n=await Ld.subtle.encrypt({name:"AES-GCM",iv:e,tagLength:128},t,typeof r=="string"?new TextEncoder().encode(r):r);return Buffer.from(n)},hFe=async(t,e,r)=>{let n=await Ld.subtle.decrypt({name:"AES-GCM",iv:e,tagLength:128},t,r);return new TextDecoder().decode(n)},N0=async t=>{try{Mc("validateEncryptionKey: Validating encryption key");let e=JSON.parse(t);Mc("validateEncryptionKey: Parsed JWK");let r=await Ld.subtle.importKey("jwk",e,{name:"AES-GCM",length:256},!0,["encrypt","decrypt"]);Mc("validateEncryptionKey: Imported crypto key");let n="test",i=await fFe();Mc("validateEncryptionKey: Generated test IV",i);let s=await mFe(r,i,n);Mc("validateEncryptionKey: Encrypted test data",s);let o=new Uint8Array(s);Mc("validateEncryptionKey: Encrypted test data array",o);let a=await hFe(r,i,o);return Mc("validateEncryptionKey: Decrypted test data",a),a===n}catch(e){return console.error("Could not validate encryption key:",e),!1}}});function VF(t){Object.assign(TK,t)}function R0(t){return!!TK[t]}var TK,HF=k(()=>{"use strict";f();TK={}});function Ra(t){try{if((0,$d.existsSync)(t)){let e=(0,$d.readFileSync)(t,"utf-8");return JSON.parse(e)}}catch{}return null}function vs(t){try{if((0,$d.existsSync)(t))return(0,$d.readFileSync)(t,"utf-8")}catch{}return null}function jd(t){let e=t.filter(r=>!r.includes("/"));return e.some(r=>r==="pnpm-lock.yaml")?{manager:"pnpm",setupCommand:"pnpm install"}:e.some(r=>r==="yarn.lock")?{manager:"yarn",setupCommand:"yarn"}:e.some(r=>r==="bun.lockb")?{manager:"bun",setupCommand:"bun install"}:e.some(r=>r==="package-lock.json")?{manager:"npm",setupCommand:"npm install"}:null}function AK(t,e){return t.some(r=>r===e)}function cg(t,e){return t.filter(n=>!n.includes("/")).some(e)}function Ud(t,e){return t.some(r=>r.startsWith(`${e}/`))}var $d,ug=k(()=>{"use strict";f();$d=require("node:fs")});async function _K(t,e){try{let r=jd(e);if(!r||!cg(e,c=>/^next\.config\.(js|ts|mjs)$/.test(c))||!Ud(e,"app"))return null;let s=(0,PK.join)(t,"package.json"),o=Ra(s);if(!o?.scripts?.dev)return null;let a=o.scripts.dev;return a.includes("next dev")?{id:"nextjs",setupCommand:r.setupCommand,devCommand:a,setupDependencies:[{tool:"node",version:"22",key:"node",type:"mise"}],autoDetectDevServer:!0}:null}catch{return null}}var PK,FK=k(()=>{"use strict";f();PK=require("node:path");ug()});async function kK(t,e){try{let r=jd(e);if(!r)return null;let n=cg(e,d=>d==="vue.config.js"||d==="vue.config.ts"),i=cg(e,d=>/^vite\.config\.(js|ts|mjs)$/.test(d));if(!n&&!i)return null;if(i&&!n){let d=e.filter(h=>/^vite\.config\.(js|ts|mjs)$/.test(h));if(d.length>0){let h=(0,KF.join)(t,d[0]),m=vs(h);if(!m||!m.includes("@vitejs/plugin-vue")&&!m.includes("vite-plugin-vue"))return null}}if(!Ud(e,"src"))return null;let o=(0,KF.join)(t,"package.json"),a=Ra(o);if(!a||!(a.dependencies?.vue||a.devDependencies?.vue)||!a.scripts?.dev)return null;let u=a.scripts.dev,l=u.includes("vite"),p=u.includes("vue-cli-service");return!l&&!p?null:{id:"vue-vite",setupCommand:r.setupCommand,devCommand:u,setupDependencies:[{tool:"node",version:"22",key:"node",type:"mise"}],autoDetectDevServer:!0}}catch{return null}}var KF,IK=k(()=>{"use strict";f();KF=require("node:path");ug()});async function NK(t,e){try{let r=jd(e);if(!r||!AK(e,"svelte.config.js")||!Ud(e,"src"))return null;let s=(0,WF.join)(t,"package.json"),o=Ra(s);if(!o||!(o.dependencies?.svelte||o.devDependencies?.svelte))return null;let c=o.dependencies?.["@sveltejs/kit"]||o.devDependencies?.["@sveltejs/kit"],u=o.dependencies?.["@sveltejs/vite-plugin-svelte"]||o.devDependencies?.["@sveltejs/vite-plugin-svelte"];if(!c&&!u||!o.scripts?.dev)return null;let l=o.scripts.dev,p=l.includes("vite"),d=l.includes("svelte-kit");if(!p&&!d)return null;if(p&&!c){let h=e.filter(m=>/^vite\.config\.(js|ts|mjs)$/.test(m));if(h.length>0){let m=(0,WF.join)(t,h[0]),g=vs(m);if(!g||!g.includes("@sveltejs/vite-plugin-svelte"))return null}}return{id:"svelte-vite",setupCommand:r.setupCommand,devCommand:l,setupDependencies:[{tool:"node",version:"22",key:"node",type:"mise"}],autoDetectDevServer:!0}}catch{return null}}var WF,RK=k(()=>{"use strict";f();WF=require("node:path");ug()});var OK={};Ty(OK,{collectRepoMetrics:()=>TFe,isExactVersion:()=>Qs});function gFe(t){let e=[".ts",".tsx",".js",".jsx",".py",".rb",".go",".rs",".java",".c",".cpp",".cs",".php",".swift",".kt",".scala",".vue",".svelte",".astro",".qwik"],r=["package.json","Cargo.toml","go.mod","pyproject.toml","requirements.txt","Gemfile","pom.xml","build.gradle","next.config.js","next.config.ts","next.config.mjs","nuxt.config.js","nuxt.config.ts","gatsby-config.js","gatsby-config.ts","svelte.config.js","vite.config.js","vite.config.ts","webpack.config.js","webpack.config.ts","rollup.config.js","astro.config.mjs","remix.config.js","angular.json","stencil.config.ts","stencil.config.js","web-dev-server.config.js","web-dev-server.config.mjs","custom-elements.json","hugo.toml","hugo.yaml","config.toml","config.yaml","_config.yml","jekyll-config.yml","docusaurus.config.js","mkdocs.yml","nest-cli.json","tsconfig.json","jsconfig.json","ios/Podfile","android/build.gradle","pubspec.yaml"],n=["src/","app/","pages/","components/","public/","static/","assets/","lib/","pkg/","cmd/","internal/","views/","templates/","content/","layouts/","archetypes/"];return!(t.some(a=>e.some(c=>a.toLowerCase().endsWith(c)))||t.some(a=>{let c=a.replace(/\\/g,"/"),u=c.split("/").pop()||"";return r.includes(u)||r.includes(c)})||t.some(a=>{let c=a.replace(/\\/g,"/");return n.some(u=>c.includes(u))}))}function Qs(t){if(!t)return!1;let e=t.trim();if(e==="")return!1;let r=[">","<",">=","<=","^","~","=","*"];for(let n of r)if(e.includes(n))return!1;return!(e.includes(" ")||/\.x$/i.test(e)||/\.\*$/.test(e)||e.toLowerCase()==="latest")}async function yFe(t,e){try{let r=e.filter(l=>l.endsWith("package.json"));if(Ra((0,Ar.join)(t,"package.json"))?.workspaces){let l=e.some(h=>h.includes("pnpm-workspace.yaml")),p=e.some(h=>h.includes("yarn.lock")),d=await qd(e);return l?{isMonorepo:!0,type:"pnpm-workspaces",possibleRoots:d}:p?{isMonorepo:!0,type:"yarn-workspaces",possibleRoots:d}:{isMonorepo:!0,type:"npm-workspaces",possibleRoots:d}}if(e.some(l=>l.includes("lerna.json")))return{isMonorepo:!0,type:"lerna",possibleRoots:await qd(e)};if(e.some(l=>l.includes("nx.json")))return{isMonorepo:!0,type:"nx",possibleRoots:await qd(e)};if(e.some(l=>l.includes("turbo.json")))return{isMonorepo:!0,type:"turborepo",possibleRoots:await qd(e)};if(vs((0,Ar.join)(t,"Cargo.toml"))?.includes("[workspace]"))return{isMonorepo:!0,type:"cargo-workspaces",possibleRoots:await qd(e)};let c=await qd(e);return c.length>=3?{isMonorepo:!0,type:"other",possibleRoots:c}:r.length>3?{isMonorepo:!0,type:"other",possibleRoots:c}:e.filter(l=>l.endsWith("Cargo.toml")).length>3?{isMonorepo:!0,type:"other",possibleRoots:c}:{isMonorepo:!1,possibleRoots:c.length>0?c:void 0}}catch{return{isMonorepo:!1}}}async function bFe(t,e){try{let r=[],n=e.filter(p=>p.endsWith("package.json")),i={};for(let p of n){let d=(0,Ar.join)(t,p),h=Ra(d);h&&(Object.assign(i,h.dependencies||{}),Object.assign(i,h.devDependencies||{}))}let s={React:{deps:["react","react-dom"],files:["jsx","tsx"]},"Next.js":{deps:["next"],files:["pages/","app/"],configFiles:["next.config.js","next.config.mjs","next.config.ts"]},Vue:{deps:["vue"],files:["vue"]},Nuxt:{deps:["nuxt"],configFiles:["nuxt.config.js","nuxt.config.ts"]},Angular:{deps:["@angular/core"],configFiles:["angular.json"]},Svelte:{deps:["svelte"],files:["svelte"]},SvelteKit:{deps:["@sveltejs/kit"],configFiles:["svelte.config.js"]},Qwik:{deps:["@builder.io/qwik"],files:["qwik"]},Solid:{deps:["solid-js"]},Stencil:{deps:["@stencil/core"],configFiles:["stencil.config.ts","stencil.config.js"]},Lit:{deps:["lit","lit-element","lit-html"]},Polymer:{deps:["@polymer/polymer"]},"FAST (Microsoft)":{deps:["@microsoft/fast-element"]},Haunted:{deps:["haunted"]},Hybrids:{deps:["hybrids"]},Express:{deps:["express"]},Fastify:{deps:["fastify"]},NestJS:{deps:["@nestjs/core"],configFiles:["nest-cli.json"]},Remix:{deps:["@remix-run/react"],configFiles:["remix.config.js"]},Gatsby:{deps:["gatsby"],configFiles:["gatsby-config.js"]},Astro:{deps:["astro"],configFiles:["astro.config.mjs"]}};for(let[p,d]of Object.entries(s)){let h=[],m="low",g=d.deps.some(y=>i?.[y]);g&&(h.push(`dependency: ${d.deps.find(y=>i?.[y])}`),m="high"),d.configFiles&&d.configFiles.some(b=>e.some(D=>D.includes(b)))&&(h.push(`config: ${d.configFiles.find(b=>e.some(D=>D.includes(b)))}`),m="high"),d.files&&!g&&d.files.some(b=>e.some(D=>D.includes(b)))&&(h.push(`files: ${d.files.find(b=>e.some(D=>D.includes(b)))}`),m=m==="high"?"high":"medium"),h.length>0&&r.push({name:p,confidence:m,indicators:h})}let o={Django:{files:["manage.py","settings.py"],imports:["django"]},Flask:{files:["app.py"],imports:["flask"]},FastAPI:{files:[],imports:["fastapi"]}};for(let[p,d]of Object.entries(o)){let h=[],m="low";if(d.files.some(y=>e.some(b=>b.includes(y)))&&(h.push(`file: ${d.files.find(y=>e.some(b=>b.includes(y)))}`),m="high"),d.imports){let y=e.filter(D=>D.includes("requirements.txt")),b=e.filter(D=>D.includes("pyproject.toml"));for(let D of y){let w=vs((0,Ar.join)(t,D));if(w&&d.imports.some(x=>w.includes(x))){h.push("requirements.txt"),m="high";break}}for(let D of b){let w=vs((0,Ar.join)(t,D));if(w&&d.imports.some(x=>w.includes(x))){h.push("pyproject.toml"),m="high";break}}}h.length>0&&r.push({name:p,confidence:m,indicators:h})}let a=e.filter(p=>p.endsWith("Cargo.toml")),c=[{name:"Actix",dep:"actix-web"},{name:"Rocket",dep:"rocket"},{name:"Axum",dep:"axum"},{name:"Warp",dep:"warp"}];for(let p of a){let d=vs((0,Ar.join)(t,p));if(d)for(let{name:h,dep:m}of c)d.includes(m)&&!r.some(g=>g.name===h)&&r.push({name:h,confidence:"high",indicators:[`Cargo.toml: ${m}`]})}let u=e.filter(p=>p.endsWith("go.mod")),l=[{name:"Gin",dep:"github.com/gin-gonic/gin"},{name:"Echo",dep:"github.com/labstack/echo"},{name:"Fiber",dep:"github.com/gofiber/fiber"}];for(let p of u){let d=vs((0,Ar.join)(t,p));if(d)for(let{name:h,dep:m}of l)d.includes(m)&&!r.some(g=>g.name===h)&&r.push({name:h,confidence:"high",indicators:[`go.mod: ${m}`]})}return r}catch{return[]}}async function vFe(t,e){let r=[];try{let n=(0,Ar.join)(t,".npmrc");if((0,ar.existsSync)(n)){r.push({tool:".npmrc"});let m=(0,ar.readFileSync)(n,"utf-8");(m.includes("@")||m.includes("registry"))&&r.push({tool:"private-packages"})}e.some(m=>m.includes(".env")||m.includes(".env.example")||m.includes(".env.template"))&&r.push({tool:"env-file"});let s=(0,Ar.join)(t,".nvmrc"),o=(0,Ar.join)(t,".node-version");if((0,ar.existsSync)(s)){let m=(0,ar.readFileSync)(s,"utf-8").trim();Qs(m)?r.push({tool:"node",version:m}):r.push({tool:"node"})}else if((0,ar.existsSync)(o)){let m=(0,ar.readFileSync)(o,"utf-8").trim();Qs(m)?r.push({tool:"node",version:m}):r.push({tool:"node"})}else{let m=(0,Ar.join)(t,"package.json");if((0,ar.existsSync)(m))try{let g=JSON.parse((0,ar.readFileSync)(m,"utf-8"));if(g.engines?.node){let y=g.engines.node;Qs(y)?r.push({tool:"node",version:y}):r.push({tool:"node"})}}catch{}}let a=(0,Ar.join)(t,"rust-toolchain"),c=(0,Ar.join)(t,"rust-toolchain.toml");if((0,ar.existsSync)(a)){let m=(0,ar.readFileSync)(a,"utf-8").trim();Qs(m)?r.push({tool:"rust",version:m}):r.push({tool:"rust"})}else if((0,ar.existsSync)(c)){let y=(0,ar.readFileSync)(c,"utf-8").match(/channel\s*=\s*"(.+?)"/)?.[1];Qs(y)?r.push({tool:"rust",version:y}):r.push({tool:"rust"})}let u=(0,Ar.join)(t,".python-version");if((0,ar.existsSync)(u)){let m=(0,ar.readFileSync)(u,"utf-8").trim();Qs(m)?r.push({tool:"python",version:m}):r.push({tool:"python"})}else{let m=(0,Ar.join)(t,"pyproject.toml");if((0,ar.existsSync)(m)){let y=(0,ar.readFileSync)(m,"utf-8").match(/requires-python\s*=\s*"(.+?)"/);if(y){let b=y[1];Qs(b)?r.push({tool:"python",version:b}):r.push({tool:"python"})}}}let l=(0,Ar.join)(t,".go-version");if((0,ar.existsSync)(l)){let m=(0,ar.readFileSync)(l,"utf-8").trim();Qs(m)?r.push({tool:"go",version:m}):r.push({tool:"go"})}else{let m=(0,Ar.join)(t,"go.mod");if((0,ar.existsSync)(m)){let y=(0,ar.readFileSync)(m,"utf-8").match(/go\s+(\d+\.\d+)/);if(y){let b=y[1];Qs(b)?r.push({tool:"go",version:b}):r.push({tool:"go"})}}}let p=(0,Ar.join)(t,".ruby-version");if((0,ar.existsSync)(p)){let m=(0,ar.readFileSync)(p,"utf-8").trim();Qs(m)?r.push({tool:"ruby",version:m}):r.push({tool:"ruby"})}e.some(m=>m.includes("docker-compose.yml")||m.includes("docker-compose.yaml")||m.includes("compose.yml")||m.includes("compose.yaml"))&&r.push({tool:"docker-compose"});let h=[{type:"postgresql",indicators:["postgresql","postgres","psql"]},{type:"mysql",indicators:["mysql"]},{type:"mongodb",indicators:["mongodb","mongo"]},{type:"redis",indicators:["redis"]},{type:"sqlite",indicators:["sqlite"]}];for(let{type:m,indicators:g}of h)e.some(b=>g.some(D=>b.toLowerCase().includes(D)))&&r.push({tool:m});return r}catch{return[]}}async function xFe(t){try{let e=[];return t.some(r=>r.includes("package-lock.json"))&&e.push("npm"),t.some(r=>r.includes("yarn.lock"))&&e.push("yarn"),t.some(r=>r.includes("pnpm-lock.yaml"))&&e.push("pnpm"),t.some(r=>r.includes("bun.lockb"))&&e.push("bun"),t.some(r=>r.includes("Cargo.lock"))&&e.push("cargo"),t.some(r=>r.includes("go.sum"))&&e.push("go"),t.some(r=>r.includes("Gemfile.lock"))&&e.push("bundler"),t.some(r=>r.includes("requirements.txt")||r.includes("pyproject.toml"))&&e.push("pip/poetry"),e}catch{return[]}}async function DFe(t){try{let e=[],r=[{name:"Webpack",indicators:["webpack.config.js","webpack.config.ts"]},{name:"Vite",indicators:["vite.config.js","vite.config.ts"]},{name:"esbuild",indicators:["esbuild.config.js"]},{name:"Rollup",indicators:["rollup.config.js"]},{name:"Parcel",indicators:[".parcelrc"]},{name:"Turbopack",indicators:["turbo.json"]},{name:"Make",indicators:["Makefile"]},{name:"CMake",indicators:["CMakeLists.txt"]},{name:"Gradle",indicators:["build.gradle","build.gradle.kts"]},{name:"Maven",indicators:["pom.xml"]}];for(let{name:n,indicators:i}of r)i.some(o=>t.some(a=>a.includes(o)))&&e.push(n);return e}catch{return[]}}function wFe(t,e){let r=[],n=t.split(`
1948
- `);for(let i of n){let s=i.trim();if(!s||s.startsWith("#"))continue;let o=s.match(/^([A-Za-z_][A-Za-z0-9_]*)\s*=\s*(.*)$/);if(o){let a=o[1],c=o[2].trim();(c.startsWith('"')&&c.endsWith('"')||c.startsWith("'")&&c.endsWith("'"))&&(c=c.slice(1,-1)),r.push({key:a,placeholderValue:c||void 0,source:e,type:"env"})}}return r}function CFe(t,e){let r=[],n=/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g,i,s=new Set;for(;(i=n.exec(t))!==null;){let o=i[1];s.has(o)||(s.add(o),r.push({key:o,source:e,type:"npmrc"}))}return r}async function EFe(t,e){try{let r=[],n=new Set,i=[".env.example",".env.template",".env.sample",".env.local.example",".env.development.example",".env.production.example",".env.test.example",".env.staging.example",".env",".env.local",".env.development",".env.production",".env.test",".env.staging"],s=[],o=new Set,a=[];for(let c of e){let u=c.replace(/\\/g,"/");(u===".npmrc"||u.endsWith("/.npmrc"))&&a.push(c)}for(let c of a){let u=(0,Ar.join)(t,c),l=vs(u);if(l){let p=CFe(l,c);for(let d of p)n.has(d.key)||(n.add(d.key),r.push(d))}}for(let c of i)for(let u of e){let l=u.replace(/\\/g,"/");(l===c||l.endsWith(`/${c}`))&&!o.has(u)&&(o.add(u),s.push(u))}for(let c of s){let u=(0,Ar.join)(t,c),l=vs(u);if(l){let p=wFe(l,c);for(let d of p)n.has(d.key)||(n.add(d.key),r.push(d))}}return r}catch{return[]}}async function SFe(t,e){try{let r=await _K(t,e);if(r)return r;let n=await kK(t,e);if(n)return n;let i=await NK(t,e);return i||null}catch{return null}}async function qd(t){try{let e=new Set,r=["__tests__","__test__","__examples__","__example__","__fixtures__","__mocks__","test","tests","testing","spec","specs","example","examples","sample","samples","demo","demos","fixture","fixtures","mock","mocks",".test",".spec"],n=["package.json","tsconfig.json","jsconfig.json","pyproject.toml","setup.py","setup.cfg","Pipfile","requirements.txt","poetry.lock","go.mod","Cargo.toml","Gemfile","Rakefile","pom.xml","build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts","composer.json","mix.exs","Package.swift","pubspec.yaml","stack.yaml","cabal.project","build.sbt","project.clj","deps.edn","CMakeLists.txt","Makefile","Dockerfile",".storybook"],i=a=>a.split("/").some(u=>r.some(l=>u===l||u.startsWith(l+".")));for(let a of t){let c=a.replace(/\\/g,"/"),u=c.split("/").pop()||"";if(n.includes(u)){let l=c.substring(0,c.lastIndexOf("/"));if(l&&i(l))continue;l?e.add(l):e.add(".")}if(u.endsWith(".csproj")||u.endsWith(".fsproj")||u.endsWith(".vbproj")||u.endsWith(".sln")){let l=c.substring(0,c.lastIndexOf("/"));if(l&&i(l))continue;l?e.add(l):e.add(".")}}let s=Array.from(e).sort(),o=s.filter(a=>a!==".");return o.length>0?o:s}catch{return[]}}async function TFe(t,e){let r=[];try{let n=await Mu({sys:t,basePath:e,globPattern:"**/*",dot:!0}),i=gFe(n),s=await yFe(e,n),o=await bFe(e,n),a=await vFe(e,n),c=await xFe(n),u=await DFe(n),l=await EFe(e,n),p=await SFe(e,n),d={languages:[],isEmpty:i,isMonorepo:s.isMonorepo,monorepoType:s.type,frameworks:o,setupRequirements:a,packageManagers:c,buildTools:u,environmentVariables:l.length>0?l:void 0,possibleMonorepoRoots:s.possibleRoots,guessedSettings:p||void 0};return r.length>0&&(d.errors=r),d}catch(n){return{languages:[],isEmpty:!1,isMonorepo:!1,frameworks:[],setupRequirements:[],packageManagers:[],buildTools:[],errors:[`Fatal error: ${n instanceof Error?n.message:String(n)}`]}}}var ar,Ar,MK=k(()=>{"use strict";f();rh();ug();FK();IK();RK();ar=require("node:fs"),Ar=require("node:path")});var zd,LK,$K,O0,JF,jK,AFe,BK,PFe,Bc,wh=k(()=>{"use strict";f();rh();uU();Wr();Ri();an();Mr();zd=z(require("node:fs"),1);sA();pU();qn();ax();LK=z(require("prettier"),1),$K=z(require("chokidar"),1);Nq();Bq();dA();Mt();O0=z(require("node:events"),1);Of();oh();JF=require("node:crypto");Eh();Gq();kA();cx();Gm();wK();lh();CK();jK=require("node:fs/promises");GF();HF();_A();Tx();$u();xc();lx();vP();AFe=30,BK=["ask-to-continue","credits-limit-daily","credits-limit-monthly","credits-limit-other","invalid-last-message"],PFe=["initial-with-url","initial-without-url","success"],Bc=class t{#p;#f;#y;#l;#m;#e;#u;#Z;#B;#P;#a=!1;#n=new O0.default;#V;#L;#$;#H=void 0;#Q=void 0;#ce=Promise.resolve(void 0);#v=[];#h;#j;#_=new Map;#ue=[];#F;#Ae=0;#k;#x;#t;#ee;#U;#q=void 0;#te;#re;#le;#pe;#s;#c;#g;#de;#i;#fe;#I;#K=0;#N;#E;#r;#D;#z;#me;#W=!1;#J=!1;#he=0;#R=0;#w=!1;#ne;#ge;#O=[];#G;#ie=new Set;#d=new Map;#o={watcher:null,listeners:new Set,debounceMs:300,pendingEvents:[]};#ye=!1;constructor(e){if(this.#e=e.sys,this.#me=e.modelOverride,this.#u=e.credentials,"initialUrl"in e){let i=EU(e.initialUrl).id;i?this.#x=i:this.#Z=e.initialUrl}typeof e.autoImportLocalMCPs=="boolean"&&(this.#ye=e.autoImportLocalMCPs),"sessionOrCompletionId"in e?this.#x=e.sessionOrCompletionId:this.#x=e.fusionConfig?.sessionId;let r=e.workingDirectory??e.fusionConfig?.workingDirectory;this.#s=r?e.sys.resolve(e.sys.cwd(),r):e.sys.getCwdDir(),this.#B=e.position,this.#V=e.mode,this.#h=e.privacyMode,this.#t=e.fusionContext,this.#r=e.fusionConfig,this.#D=e.fusionConfig?.projectId,this.#z=e.fusionConfig?.branchName,this.#L=e.fusionConfig?.featureBranch,this.#$=e.fusionConfig?.aiBranch,this.#ne=e.fusionConfig?.proxyOrigin,process.env.FLY_APP_NAME&&(this.#ge=`https://${process.env.FLY_APP_NAME}.fly.dev/`);let n=i=>i.filter(s=>!this.#r?.disabledTools?.includes(s));if(e.enabledTools)this.#E=n(e.enabledTools);else if(this.#V==="quality-v3"){let i=["write_file","search_replace_file","view_path","get_rule","get_style_inspiration","grep_search","web_search","find_media",process.platform==="win32"?"powershell":"bash"];e.fusionContext?.devServerOrchestrator&&i.push("dev_server_control"),this.#E=n(i)}else if(this.#V==="quality-v4"){let i=["Write","Edit","Read","MultiEdit","Grep","Glob","ReadRule","WebSearch","TodoRead","TodoWrite","Agent","FindMedia","WebFetch",process.platform==="win32"?"PowerShell":"Bash"],s=!!(this.#h?.enabled||this.#h?.redactUserMessages||this.#h?.redactLLMMessages);s||i.push("Memory"),R0("fusion-plan-mode")&&i.push("AskUserQuestion","ExitPlanMode"),e.fusionContext?.git&&!s&&i.push("GetScreenshot","Revert"),e.fusionContext?.devServerOrchestrator&&i.push("DevServerControl"),this.#E=n(i)}if(this.#de=e.maxTokens,this.#te=e.builtInCustomInstructions??[],this.#re=e.builtInCustomAgents??[],this.#le=e.builtInMCPServerConfig??{},this.#pe=e.systemPromptOverride,this.#i=e.fusionConfig?.workspace,this.#fe=e.mcpServers??!1,this.#g=this.#s,this.#c=this.#s,this.#i?.folders.length){let i=this.#i.folders.filter(s=>s.enableGit);if(i.length===1){let s=i[0];this.#c=this.#e.resolve(this.#s,s.path);let o=s.backupMetadata?.check.backup;this.#G=ph({version:o?.version,originalRepoUrl:o?.repoUrl,commitHash:o?.lastCommitHash})}else i.length>1&&this.#e.Sentry?.captureException(new Error("Multiple git enabled folders found"))}this.#i?.folders[0]&&this.#C()&&(this.#g=this.#e.resolve(this.#s,this.#i.folders[0].path))}get fusionConfig(){return this.#r}get gitEnabledFolder(){return this.#i?.folders.find(e=>e.enableGit)}get workingDirectory(){return this.#s}getSessionMode(){return this.#p?.sessionMode??"normal"}async switchSessionMode(e){let r=this.getSessionContext();r.sessionMode!==e&&(r.sessionMode=e,this.#w=!1,await this.#T())}async setPrivacyMode(e){if(e&&e.enabled){if(!e.encryptKey&&!this.#j)this.#j=await SK();else if(e.encryptKey){if(!await N0(e.encryptKey))throw new Error("Invalid encryption key: key failed validation");this.#j=e.encryptKey}}else this.#j=void 0;this.#h=e}async initializeSession(e={}){return this.#ee||(this.#ee=this.#Fe(e)),await this.#ee}async loadHistory(){let e=this.getSessionContext(),r=await nx(this.#e,this.#u,e.sessionId,!1),n=new Set;for(let s of r.turns)s.beforeCommit&&n.add(s.beforeCommit),s.afterCommit&&n.add(s.afterCommit),s.lastCommit&&n.add(s.lastCommit);if(n.size>0)try{let o=(await this.git(["cat-file","--batch-check","--buffer"],{sys:this.#e,cwd:this.#c,stdin:Array.from(n).map(a=>`${a}^{commit}`).join(`
1948
+ `);for(let i of n){let s=i.trim();if(!s||s.startsWith("#"))continue;let o=s.match(/^([A-Za-z_][A-Za-z0-9_]*)\s*=\s*(.*)$/);if(o){let a=o[1],c=o[2].trim();(c.startsWith('"')&&c.endsWith('"')||c.startsWith("'")&&c.endsWith("'"))&&(c=c.slice(1,-1)),r.push({key:a,placeholderValue:c||void 0,source:e,type:"env"})}}return r}function CFe(t,e){let r=[],n=/\$\{([A-Za-z_][A-Za-z0-9_]*)\}/g,i,s=new Set;for(;(i=n.exec(t))!==null;){let o=i[1];s.has(o)||(s.add(o),r.push({key:o,source:e,type:"npmrc"}))}return r}async function EFe(t,e){try{let r=[],n=new Set,i=[".env.example",".env.template",".env.sample",".env.local.example",".env.development.example",".env.production.example",".env.test.example",".env.staging.example",".env",".env.local",".env.development",".env.production",".env.test",".env.staging"],s=[],o=new Set,a=[];for(let c of e){let u=c.replace(/\\/g,"/");(u===".npmrc"||u.endsWith("/.npmrc"))&&a.push(c)}for(let c of a){let u=(0,Ar.join)(t,c),l=vs(u);if(l){let p=CFe(l,c);for(let d of p)n.has(d.key)||(n.add(d.key),r.push(d))}}for(let c of i)for(let u of e){let l=u.replace(/\\/g,"/");(l===c||l.endsWith(`/${c}`))&&!o.has(u)&&(o.add(u),s.push(u))}for(let c of s){let u=(0,Ar.join)(t,c),l=vs(u);if(l){let p=wFe(l,c);for(let d of p)n.has(d.key)||(n.add(d.key),r.push(d))}}return r}catch{return[]}}async function SFe(t,e){try{let r=await _K(t,e);if(r)return r;let n=await kK(t,e);if(n)return n;let i=await NK(t,e);return i||null}catch{return null}}async function qd(t){try{let e=new Set,r=["__tests__","__test__","__examples__","__example__","__fixtures__","__mocks__","test","tests","testing","spec","specs","example","examples","sample","samples","demo","demos","fixture","fixtures","mock","mocks",".test",".spec"],n=["package.json","tsconfig.json","jsconfig.json","pyproject.toml","setup.py","setup.cfg","Pipfile","requirements.txt","poetry.lock","go.mod","Cargo.toml","Gemfile","Rakefile","pom.xml","build.gradle","build.gradle.kts","settings.gradle","settings.gradle.kts","composer.json","mix.exs","Package.swift","pubspec.yaml","stack.yaml","cabal.project","build.sbt","project.clj","deps.edn","CMakeLists.txt","Makefile","Dockerfile",".storybook"],i=a=>a.split("/").some(u=>r.some(l=>u===l||u.startsWith(l+".")));for(let a of t){let c=a.replace(/\\/g,"/"),u=c.split("/").pop()||"";if(n.includes(u)){let l=c.substring(0,c.lastIndexOf("/"));if(l&&i(l))continue;l?e.add(l):e.add(".")}if(u.endsWith(".csproj")||u.endsWith(".fsproj")||u.endsWith(".vbproj")||u.endsWith(".sln")){let l=c.substring(0,c.lastIndexOf("/"));if(l&&i(l))continue;l?e.add(l):e.add(".")}}let s=Array.from(e).sort(),o=s.filter(a=>a!==".");return o.length>0?o:s}catch{return[]}}async function TFe(t,e){let r=[];try{let n=await Mu({sys:t,basePath:e,globPattern:"**/*",dot:!0}),i=gFe(n),s=await yFe(e,n),o=await bFe(e,n),a=await vFe(e,n),c=await xFe(n),u=await DFe(n),l=await EFe(e,n),p=await SFe(e,n),d={languages:[],isEmpty:i,isMonorepo:s.isMonorepo,monorepoType:s.type,frameworks:o,setupRequirements:a,packageManagers:c,buildTools:u,environmentVariables:l.length>0?l:void 0,possibleMonorepoRoots:s.possibleRoots,guessedSettings:p||void 0};return r.length>0&&(d.errors=r),d}catch(n){return{languages:[],isEmpty:!1,isMonorepo:!1,frameworks:[],setupRequirements:[],packageManagers:[],buildTools:[],errors:[`Fatal error: ${n instanceof Error?n.message:String(n)}`]}}}var ar,Ar,MK=k(()=>{"use strict";f();rh();ug();FK();IK();RK();ar=require("node:fs"),Ar=require("node:path")});var zd,LK,$K,O0,JF,jK,AFe,BK,PFe,Bc,wh=k(()=>{"use strict";f();rh();uU();Wr();Ri();an();Mr();zd=z(require("node:fs"),1);sA();pU();qn();ax();LK=z(require("prettier"),1),$K=z(require("chokidar"),1);Nq();Bq();dA();Mt();O0=z(require("node:events"),1);Of();oh();JF=require("node:crypto");Eh();Gq();kA();cx();Gm();wK();lh();CK();jK=require("node:fs/promises");GF();HF();_A();Tx();$u();xc();lx();vP();AFe=30,BK=["ask-to-continue","credits-limit-daily","credits-limit-monthly","credits-limit-other","invalid-last-message"],PFe=["initial-with-url","initial-without-url","success"],Bc=class t{#p;#f;#y;#l;#m;#e;#u;#Z;#B;#P;#a=!1;#n=new O0.default;#V;#L;#$;#H=void 0;#Q=void 0;#ce=Promise.resolve(void 0);#x=[];#h;#j;#_=new Map;#ue=[];#F;#Ae=0;#k;#D;#t;#ee;#U;#q=void 0;#te;#re;#le;#pe;#s;#c;#g;#de;#i;#fe;#I;#K=0;#N;#E;#r;#b;#z;#me;#W=!1;#J=!1;#he=0;#R=0;#w=!1;#ne;#ge;#O=[];#G;#ie=new Set;#d=new Map;#o={watcher:null,listeners:new Set,debounceMs:300,pendingEvents:[]};#ye=!1;constructor(e){if(this.#e=e.sys,this.#me=e.modelOverride,this.#u=e.credentials,"initialUrl"in e){let i=EU(e.initialUrl).id;i?this.#D=i:this.#Z=e.initialUrl}typeof e.autoImportLocalMCPs=="boolean"&&(this.#ye=e.autoImportLocalMCPs),"sessionOrCompletionId"in e?this.#D=e.sessionOrCompletionId:this.#D=e.fusionConfig?.sessionId;let r=e.workingDirectory??e.fusionConfig?.workingDirectory;this.#s=r?e.sys.resolve(e.sys.cwd(),r):e.sys.getCwdDir(),this.#B=e.position,this.#V=e.mode,this.#h=e.privacyMode,this.#t=e.fusionContext,this.#r=e.fusionConfig,this.#b=e.fusionConfig?.projectId,this.#z=e.fusionConfig?.branchName,this.#L=e.fusionConfig?.featureBranch,this.#$=e.fusionConfig?.aiBranch,this.#ne=e.fusionConfig?.proxyOrigin,process.env.FLY_APP_NAME&&(this.#ge=`https://${process.env.FLY_APP_NAME}.fly.dev/`);let n=i=>i.filter(s=>!this.#r?.disabledTools?.includes(s));if(e.enabledTools)this.#E=n(e.enabledTools);else if(this.#V==="quality-v3"){let i=["write_file","search_replace_file","view_path","get_rule","get_style_inspiration","grep_search","web_search","find_media",process.platform==="win32"?"powershell":"bash"];e.fusionContext?.devServerOrchestrator&&i.push("dev_server_control"),this.#E=n(i)}else if(this.#V==="quality-v4"){let i=["Write","Edit","Read","MultiEdit","Grep","Glob","ReadRule","WebSearch","TodoRead","TodoWrite","Agent","FindMedia","WebFetch",process.platform==="win32"?"PowerShell":"Bash"],s=!!(this.#h?.enabled||this.#h?.redactUserMessages||this.#h?.redactLLMMessages);!s&&this.#b&&i.push("Memory"),R0("fusion-plan-mode")&&i.push("AskUserQuestion","ExitPlanMode"),e.fusionContext?.git&&!s&&i.push("GetScreenshot","Revert"),e.fusionContext?.devServerOrchestrator&&i.push("DevServerControl"),this.#E=n(i)}if(this.#de=e.maxTokens,this.#te=e.builtInCustomInstructions??[],this.#re=e.builtInCustomAgents??[],this.#le=e.builtInMCPServerConfig??{},this.#pe=e.systemPromptOverride,this.#i=e.fusionConfig?.workspace,this.#fe=e.mcpServers??!1,this.#g=this.#s,this.#c=this.#s,this.#i?.folders.length){let i=this.#i.folders.filter(s=>s.enableGit);if(i.length===1){let s=i[0];this.#c=this.#e.resolve(this.#s,s.path);let o=s.backupMetadata?.check.backup;this.#G=ph({version:o?.version,originalRepoUrl:o?.repoUrl,commitHash:o?.lastCommitHash})}else i.length>1&&this.#e.Sentry?.captureException(new Error("Multiple git enabled folders found"))}this.#i?.folders[0]&&this.#C()&&(this.#g=this.#e.resolve(this.#s,this.#i.folders[0].path))}get fusionConfig(){return this.#r}get gitEnabledFolder(){return this.#i?.folders.find(e=>e.enableGit)}get workingDirectory(){return this.#s}getSessionMode(){return this.#p?.sessionMode??"normal"}async switchSessionMode(e){let r=this.getSessionContext();r.sessionMode!==e&&(r.sessionMode=e,this.#w=!1,await this.#T())}async setPrivacyMode(e){if(e&&e.enabled){if(!e.encryptKey&&!this.#j)this.#j=await SK();else if(e.encryptKey){if(!await N0(e.encryptKey))throw new Error("Invalid encryption key: key failed validation");this.#j=e.encryptKey}}else this.#j=void 0;this.#h=e}async initializeSession(e={}){return this.#ee||(this.#ee=this.#Fe(e)),await this.#ee}async loadHistory(){let e=this.getSessionContext(),r=await nx(this.#e,this.#u,e.sessionId,!1),n=new Set;for(let s of r.turns)s.beforeCommit&&n.add(s.beforeCommit),s.afterCommit&&n.add(s.afterCommit),s.lastCommit&&n.add(s.lastCommit);if(n.size>0)try{let o=(await this.git(["cat-file","--batch-check","--buffer"],{sys:this.#e,cwd:this.#c,stdin:Array.from(n).map(a=>`${a}^{commit}`).join(`
1949
1949
  `)})).trim().split(`
1950
- `);for(let a of o)if(a.includes("missing")){let c=a.split(/\s+/)[0].replace("^{commit}","");n.delete(c)}}catch(s){this.#e.Sentry?.captureException(s)}let i=r.turns.filter(s=>!(s.beforeCommit&&!n.has(s.beforeCommit)||s.afterCommit&&!n.has(s.afterCommit)||s.lastCommit&&!n.has(s.lastCommit)));return{sessionId:e.sessionId,title:e.title,beforeCommit:e.beforeCommit,createdUnixTime:e.createdUnixTime,updatedUnixTime:e.updatedUnixTime,turns:i}}async loadWholeSession(e={}){let{getAll:r=!0}=e,n=this.getSessionContext(),i=0;for(;n.canLoadMore&&n.canLoadMore;){let s=await this.loadMoreTurns();i+=s.length}return{sessionId:n.sessionId,title:n.title,beforeCommit:n.beforeCommit,createdUnixTime:n.createdUnixTime,updatedUnixTime:n.updatedUnixTime,addedTurns:i,turns:r?n.turns:n.turns.slice(0,i)}}async loadMoreTurns(){return this.#U||(this.#U=this.#Pe().then(e=>(this.#U=void 0,e))),this.#U}async#Pe(){let e=this.getSessionContext();if(e.canLoadMore){let r=e.turns[0]?.completionId,n=await nx(this.#e,this.#u,e.sessionId,!0,r);return n.turns.length>0&&e.turns.unshift(...n.turns),e.canLoadMore=n.canLoadMore,n.turns}return[]}async#_e(){try{let e=this.#e.join(this.#c,"file.tsx");return await LK.default.resolveConfig(this.#e.join(e,"file.tsx"))}catch{return null}}async setCustomInstructions(e){this.#te=e,this.#p&&(this.#p.customInstructions=await this.#Y())}async setCustomAgents(e){this.#re=e,this.#p&&(this.#p.customAgents=await this.#se())}async#Y(){let e=await pA({sys:this.#e,projectDir:this.#s,currentDir:this.#c,rootDir:"/"});return fA(this.#te??[],e)}async#se(){if(!this.#E?.includes("Agent"))return[];let e=await Mq({sys:this.#e,projectDir:this.#s,currentDir:this.#c,rootDir:"/"});return fA(this.#re??[],e)}async spawnNamedAgent(e,r){let n=await this.#se(),i=e?n.find(o=>o.name.toLowerCase()===e.toLowerCase()):void 0,s=i?.name??"explorer";return await this.spawnAgent({subagent_type:s,...r,systemPrompt:i?.systemPrompt,tools:i?.tools,model:i?.model,mode:i?.mode,includeMemories:i?.includeMemories??s==="explorer",needDevServer:i?.needDevServer})}async#Fe(e){try{if(this.#J)throw new Error("Code session already closed");if(this.#p)throw new Error("Session context already initialized");this.#a&&console.log(`\u{1F4C1} Current AI working directory: ${this.#s}`),await this.setPrivacyMode(this.#h);let r=await this.#ke(),n=await this.#_e(),i,s;this.#x||(this.#x=r?.sessionId),this.#x?e.skipSessionLoading?i=this.#x:(s=await nx(this.#e,this.#u,this.#x,!0),i=s.sessionId,this.#a&&console.log("SESSION recovered",i,s.turns.length)):i=(0,JF.randomUUID)(),this.#L||(this.#L=r?.featureBranch?.trim());let o={turns:s?.turns??[],sessionId:i,customInstructions:await this.#Y(),customAgents:await this.#se(),title:s?.title,beforeCommit:s?.beforeCommit,createdUnixTime:s?.createdUnixTime??Date.now(),updatedUnixTime:s?.updatedUnixTime??Date.now(),userContext:await ix(this.#e,this.#c),prettierConfig:n,canLoadMore:s?.canLoadMore??!1,state:s?.turns.length?"success":this.#Z?"initial-with-url":"initial-without-url",sessionMode:s?.sessionMode??"normal"};if(s){let c=_o(s.turns);c?.completionId!==s.lastCompletionId&&this.#e.Sentry?.captureException(new Error("Last completion id mismatch"),{tags:{operation:"codegen-initialize-session"},extra:{lastTurn:c,sessionMetadata:s}})}this.#a&&this.#n.on("step",c=>{c.type!=="delta"&&console.log(`Event: ${JSON.stringify(c)}`)}),await this.#Ne(o),this.#p=o;try{let c=await DK(this.#e,this.#s,this.#le,this.#ye);if(c.length>0){this.#a&&console.log(`\u{1F50C} Initializing ${c.length} local MCP server(s)...`),this.#I=await xK(c,this.#e,this.#s);let u=this.#I.getStatus(),l=Object.values(u).filter(p=>p.status==="ok").length;this.#a&&console.log(`\u2713 Connected to ${l}/${c.length} local MCP server(s)`)}}catch(c){this.#e.Sentry?.captureException(c,{level:"warning",tags:{operation:"local-mcp-init"}}),this.#a&&console.error("Failed to initialize local MCP servers:",c)}let a=this.#t?.devServerOrchestrator;if(a){let c=d=>{this.#n.emit("step",{type:"dev-server",devServerState:a.devState,setupState:d,httpServerState:a.httpServerState.state,devCommand:a.devCommand,setupCommand:a.setupCommand,proxyServer:a.proxyTarget,proxyServerSelection:a.proxyServerSelection,remoteAddress:a.httpServerState.remoteAddress,remotePort:a.httpServerState.remotePort,proxyServerReachable:!!this.#r?.isLocal}),this.#T()},u=d=>{this.#n.emit("step",{type:"dev-server",devServerState:d,setupState:a.setupState,httpServerState:a.httpServerState.state,devCommand:a.devCommand,setupCommand:a.setupCommand,proxyServer:a.proxyTarget,proxyServerSelection:a.proxyServerSelection,remoteAddress:a.httpServerState.remoteAddress,remotePort:a.httpServerState.remotePort,proxyServerReachable:!!this.#r?.isLocal}),this.#T()},l=d=>{this.#n.emit("step",{type:"dev-server",devServerState:a.devState,setupState:a.setupState,httpServerState:d.state,devCommand:a.devCommand,setupCommand:a.setupCommand,proxyServer:a.proxyTarget,proxyServerSelection:a.proxyServerSelection,remoteAddress:d.remoteAddress,remotePort:d.remotePort,proxyServerReachable:!!this.#r?.isLocal}),this.#T()},p=d=>{d==="ok-2xx"&&this.requestRefresh()};a.emitter.on("setupState",c),a.emitter.on("devState",u),a.emitter.on("httpServerData",l),a.emitter.on("httpServerState",p),this.#ue.push(()=>{a.emitter.off("setupState",c),a.emitter.off("devState",u),a.emitter.off("httpServerData",l),a.emitter.off("httpServerState",p)})}}catch(r){throw console.error(r),this.#e.Sentry?.captureException(r,{tags:{operation:"codegen-initialize-session"}}),r}}async#be(e){let r=this.#t?.devServerOrchestrator;if(!r)return;e&&await r.waitUntilIdle(500,500);let n=this.getSessionContext(),i=r.setupState,s=await this.#S(),o=r.devCommand,a=r.devState,c=r.state,u=r.setupCommand,l=await r.getOpenPorts(),p=r.proxyTarget,d=r.httpServerState.state,h=r.lastServerStatus,m=d==="error-fetch",g=!1;this.#t?.git&&(g=await this.getCurrentBranch()!==this.getAiBranch());let y=d==="error-5xx"||d==="error-4xx"&&h!==401&&h!==404,b="",D=!1;c==="install-failed"||c==="install-aborted"?b=r.getSetupOutput():(b=r.getCheckpoints(1,a!=="running"?"err":"all"),D=AU(b??""));let w="",v="",x="error",C="Try to fix",E="repair-unknown";if(c==="not-installed"||c==="install-failed"||c==="install-aborted"||c==="failed"||c==="unset"||g||m||y||D||s){if(g&&(E="repair-bad-branch",v+=`- The current branch is not the AI branch (${this.getAiBranch()}).
1950
+ `);for(let a of o)if(a.includes("missing")){let c=a.split(/\s+/)[0].replace("^{commit}","");n.delete(c)}}catch(s){this.#e.Sentry?.captureException(s)}let i=r.turns.filter(s=>!(s.beforeCommit&&!n.has(s.beforeCommit)||s.afterCommit&&!n.has(s.afterCommit)||s.lastCommit&&!n.has(s.lastCommit)));return{sessionId:e.sessionId,title:e.title,beforeCommit:e.beforeCommit,createdUnixTime:e.createdUnixTime,updatedUnixTime:e.updatedUnixTime,turns:i}}async loadWholeSession(e={}){let{getAll:r=!0}=e,n=this.getSessionContext(),i=0;for(;n.canLoadMore&&n.canLoadMore;){let s=await this.loadMoreTurns();i+=s.length}return{sessionId:n.sessionId,title:n.title,beforeCommit:n.beforeCommit,createdUnixTime:n.createdUnixTime,updatedUnixTime:n.updatedUnixTime,addedTurns:i,turns:r?n.turns:n.turns.slice(0,i)}}async loadMoreTurns(){return this.#U||(this.#U=this.#Pe().then(e=>(this.#U=void 0,e))),this.#U}async#Pe(){let e=this.getSessionContext();if(e.canLoadMore){let r=e.turns[0]?.completionId,n=await nx(this.#e,this.#u,e.sessionId,!0,r);return n.turns.length>0&&e.turns.unshift(...n.turns),e.canLoadMore=n.canLoadMore,n.turns}return[]}async#_e(){try{let e=this.#e.join(this.#c,"file.tsx");return await LK.default.resolveConfig(this.#e.join(e,"file.tsx"))}catch{return null}}async setCustomInstructions(e){this.#te=e,this.#p&&(this.#p.customInstructions=await this.#Y())}async setCustomAgents(e){this.#re=e,this.#p&&(this.#p.customAgents=await this.#se())}async#Y(){let e=await pA({sys:this.#e,projectDir:this.#s,currentDir:this.#c,rootDir:"/"});return fA(this.#te??[],e)}async#se(){if(!this.#E?.includes("Agent"))return[];let e=await Mq({sys:this.#e,projectDir:this.#s,currentDir:this.#c,rootDir:"/"});return fA(this.#re??[],e)}async spawnNamedAgent(e,r){let n=await this.#se(),i=e?n.find(o=>o.name.toLowerCase()===e.toLowerCase()):void 0,s=i?.name??"explorer";return await this.spawnAgent({subagent_type:s,...r,systemPrompt:i?.systemPrompt,tools:i?.tools,model:i?.model,mode:i?.mode,includeMemories:i?.includeMemories??s==="explorer",needDevServer:i?.needDevServer})}async#Fe(e){try{if(this.#J)throw new Error("Code session already closed");if(this.#p)throw new Error("Session context already initialized");this.#a&&console.log(`\u{1F4C1} Current AI working directory: ${this.#s}`),await this.setPrivacyMode(this.#h);let r=await this.#ke(),n=await this.#_e(),i,s;this.#D||(this.#D=r?.sessionId),this.#D?e.skipSessionLoading?i=this.#D:(s=await nx(this.#e,this.#u,this.#D,!0),i=s.sessionId,this.#a&&console.log("SESSION recovered",i,s.turns.length)):i=(0,JF.randomUUID)(),this.#L||(this.#L=r?.featureBranch?.trim());let o={turns:s?.turns??[],sessionId:i,customInstructions:await this.#Y(),customAgents:await this.#se(),title:s?.title,beforeCommit:s?.beforeCommit,createdUnixTime:s?.createdUnixTime??Date.now(),updatedUnixTime:s?.updatedUnixTime??Date.now(),userContext:await ix(this.#e,this.#c),prettierConfig:n,canLoadMore:s?.canLoadMore??!1,state:s?.turns.length?"success":this.#Z?"initial-with-url":"initial-without-url",sessionMode:s?.sessionMode??"normal"};if(s){let c=_o(s.turns);c?.completionId!==s.lastCompletionId&&this.#e.Sentry?.captureException(new Error("Last completion id mismatch"),{tags:{operation:"codegen-initialize-session"},extra:{lastTurn:c,sessionMetadata:s}})}this.#a&&this.#n.on("step",c=>{c.type!=="delta"&&console.log(`Event: ${JSON.stringify(c)}`)}),await this.#Ne(o),this.#p=o;try{let c=await DK(this.#e,this.#s,this.#le,this.#ye);if(c.length>0){this.#a&&console.log(`\u{1F50C} Initializing ${c.length} local MCP server(s)...`),this.#I=await xK(c,this.#e,this.#s);let u=this.#I.getStatus(),l=Object.values(u).filter(p=>p.status==="ok").length;this.#a&&console.log(`\u2713 Connected to ${l}/${c.length} local MCP server(s)`)}}catch(c){this.#e.Sentry?.captureException(c,{level:"warning",tags:{operation:"local-mcp-init"}}),this.#a&&console.error("Failed to initialize local MCP servers:",c)}let a=this.#t?.devServerOrchestrator;if(a){let c=d=>{this.#n.emit("step",{type:"dev-server",devServerState:a.devState,setupState:d,httpServerState:a.httpServerState.state,devCommand:a.devCommand,setupCommand:a.setupCommand,proxyServer:a.proxyTarget,proxyServerSelection:a.proxyServerSelection,remoteAddress:a.httpServerState.remoteAddress,remotePort:a.httpServerState.remotePort,proxyServerReachable:!!this.#r?.isLocal}),this.#T()},u=d=>{this.#n.emit("step",{type:"dev-server",devServerState:d,setupState:a.setupState,httpServerState:a.httpServerState.state,devCommand:a.devCommand,setupCommand:a.setupCommand,proxyServer:a.proxyTarget,proxyServerSelection:a.proxyServerSelection,remoteAddress:a.httpServerState.remoteAddress,remotePort:a.httpServerState.remotePort,proxyServerReachable:!!this.#r?.isLocal}),this.#T()},l=d=>{this.#n.emit("step",{type:"dev-server",devServerState:a.devState,setupState:a.setupState,httpServerState:d.state,devCommand:a.devCommand,setupCommand:a.setupCommand,proxyServer:a.proxyTarget,proxyServerSelection:a.proxyServerSelection,remoteAddress:d.remoteAddress,remotePort:d.remotePort,proxyServerReachable:!!this.#r?.isLocal}),this.#T()},p=d=>{d==="ok-2xx"&&this.requestRefresh()};a.emitter.on("setupState",c),a.emitter.on("devState",u),a.emitter.on("httpServerData",l),a.emitter.on("httpServerState",p),this.#ue.push(()=>{a.emitter.off("setupState",c),a.emitter.off("devState",u),a.emitter.off("httpServerData",l),a.emitter.off("httpServerState",p)})}}catch(r){throw console.error(r),this.#e.Sentry?.captureException(r,{tags:{operation:"codegen-initialize-session"}}),r}}async#be(e){let r=this.#t?.devServerOrchestrator;if(!r)return;e&&await r.waitUntilIdle(500,500);let n=this.getSessionContext(),i=r.setupState,s=await this.#S(),o=r.devCommand,a=r.devState,c=r.state,u=r.setupCommand,l=await r.getOpenPorts(),p=r.proxyTarget,d=r.httpServerState.state,h=r.lastServerStatus,m=d==="error-fetch",g=!1;this.#t?.git&&(g=await this.getCurrentBranch()!==this.getAiBranch());let y=d==="error-5xx"||d==="error-4xx"&&h!==401&&h!==404,b="",D=!1;c==="install-failed"||c==="install-aborted"?b=r.getSetupOutput():(b=r.getCheckpoints(1,a!=="running"?"err":"all"),D=AU(b??""));let w="",v="",x="error",C="Try to fix",E="repair-unknown";if(c==="not-installed"||c==="install-failed"||c==="install-aborted"||c==="failed"||c==="unset"||g||m||y||D||s){if(g&&(E="repair-bad-branch",v+=`- The current branch is not the AI branch (${this.getAiBranch()}).
1951
1951
  `,v+=`- Please switch to the AI branch using the 'git' tool.
1952
1952
  `,w=`The current branch is not the AI branch (${this.getAiBranch()}).`),s){E="repair-merge-conflict",C="Resolve conflict",v="Merge conflict detected, please resolve the conflict before continuing",w="Merge conflict detected - changes from different sources need to be combined";try{let F=await this.git(["diff","--cc","--no-color","--unified=0","--no-ext-diff"]);b=F;let _=this.gitEnabledFolder;_&&!this.#C()&&(v=`Notice that all the relative paths in <merge_conflict>, are inside "${_.name}/", remember that when using Read/Write/Edit tools:
1953
1953
  `),v+=`<merge_conflict>
@@ -1995,12 +1995,12 @@ ${r.getSetupOutput().slice(-8e3)}
1995
1995
  <logs>
1996
1996
  ${b}
1997
1997
  </logs>
1998
- `)}let P={devServerState:a,setupState:i,httpServerState:d,proxyServer:p,devCommand:o,setupCommand:u,hasMergeConflict:s,logs:b,prompt:v,message:w},A=!this.#l&&PFe.includes(n.state);return{actionButtonText:C,type:"build-error",level:x,canAutoApply:A,healthStatus:P,message:P.message,userMessage:{userPrompt:P.prompt,repair:!0,category:E,displayPrompt:P.message}}}}async#ke(){let e;if(this.#t?.git)try{if(N.info("\u{1F504} Initializing Fusion session for AI side-car branch workflow..."),e=await this.#e.getRepoInfo(this.#c),!e.hasGit)if(this.#t.gitAutoInit){N.warn("\u{1F6E0}\uFE0F No git repository detected. Initializing a new git repository...");try{await this.git(["init"]),await this.git(["add","."]),await this.git(["branch","-M","main"]),await this.git(["commit","--allow-empty","--quiet","--no-verify","-m","Initial commit for Fusion workflow"]),N.info("\u2705 Successfully initialized a new git repository")}catch(r){console.error("\u274C Failed to initialize git repository:",r);return}}else{N.error("\u274C Error: Not in a git repository. Fusion requires a git repository.");return}return await Px({sys:this.#e,gitWorkingDirectory:this.#c,strict:!0})}catch(r){N.error(`\u274C Error initializing Fusion session: ${r}`);let n=new Error("Initialize Git failed",{cause:r});throw this.#e.Sentry?.captureException(n,{level:"fatal",tags:{operation:"codegen-initialize-session"},extra:{repoInfo:e}}),n}return{featureBranch:void 0,sessionId:void 0,currentCommitHash:void 0}}async#Ie(e){try{await this.git(["checkout",e])}catch{await this.git(["checkout","-b",e])}}async#Ne(e){if(this.#t?.git){if(!this.#$){let o=Uq(this.getFeatureBranch(),e.sessionId);this.#$=o}let r=await this.getCurrentBranch(),n=this.getAiBranch();r!==n&&await this.#Ie(n);try{await this.git(["branch","--set-upstream-to",`refs/remotes/origin/${this.#X()}`])}catch{}let i=_o(e.turns),s=i?.afterCommit??i?.lastCommit;if(s){let o=await this.getCurrentCommitHash();o!==s&&this.#e.Sentry?.captureException(new Error("Init: After commit mismatch"),{tags:{operation:"codegen-initialize-session"},extra:{sessionId:e.sessionId,targetCommit:s,lastTurn:i,currentCommitHash:o}})}if(e.beforeCommit)try{await this.git(["rev-parse","--quiet","--verify",e.beforeCommit])}catch(o){this.#e.Sentry?.captureException(new Error("Init: Before commit not found",{cause:o}),{tags:{operation:"codegen-initialize-session"},extra:{sessionId:e.sessionId,beforeCommit:e.beforeCommit,turnStates:e.turns.length,lastCompletionId:_o(e.turns)?.completionId}})}}}async#Re(e,r){let n;try{n=(await this.git(["remote","get-url","origin"],r)).trim()}catch{}try{new URL(e)}catch{throw this.#e.Sentry?.captureException(new Error("Provided remote url is invalid"),{tags:{operation:"codegen-git"},extra:{url:e,currentOriginUrl:n}}),new Error("Provided remote url is invalid")}n!==e&&(this.#G=void 0,n?await this.git(["remote","set-url","origin",e],r):await this.git(["remote","add","origin",e],r))}async pushRepoV2(e){return await this.pushChanges({pullFirst:!1,updateRepo:e,refreshRemote:!0})}async#ve(){let e;try{let r=this.gitEnabledFolder;if(!r)throw new Error("Main repo not found");if(r.initializationCommand||r.repoUrl?.startsWith("ssh://"))return{success:!0,message:"Git remote URLs update not needed"};if(!this.#D)throw new Error("Project ID is required to update git URLs");let i=await sd(this.#u,this.#D);if(!i.success)throw i.error;if(e=i.gitConfigs,!r.repoName)throw new Error("Main repo not found");let s=e?.[r.repoName];if(s?.url){let o=this.#e.resolve(this.#s,r.path);await this.#Re(s.url,o)}return await this.emitGitStatus(),{success:!0,message:"Git remote URLs updated"}}catch(r){let n=`Failed to update git remote URLs: ${nd(r)}`;return this.#a&&console.error(n),this.#n.emit("step",{type:"error",message:n,code:"git-update-error"}),this.#e.Sentry?.captureException(r,{tags:{operation:"codegen-git",endpoint:"updateGitUrls"},extra:{projectId:this.#D,workspaceFolders:this.#i?.folders,gitConfigs:e}}),{success:!1,message:n,error:r instanceof Error?r:new Error(n)}}}async zipFolder(e){let{resolvedPath:r}=this.resolveWorkspacePath(e,!1),n=Date.now(),i=Math.random().toString(36).substring(2,8),s=`zip-${n}-${i}.zip`,o="/tmp",a=this.#e.join(o,s);return zd.default.mkdirSync(o,{recursive:!0}),await wa("zip",["-r",a,".","-x","**/node_modules/**"],{cwd:r,debug:this.#a,sys:this.#e}),a}async archiveProject(){if(!this.#t?.git)throw new Error("Can not archive project in non git mode");try{let e=Date.now(),r=Math.random().toString(36).substring(2,8),n=`project-${e}-${r}.zip`,i="/tmp",s=this.#e.join(i,n);return zd.default.mkdirSync(i,{recursive:!0}),await this.git(["archive","--format=zip","-o",s,"HEAD"]),s}catch(e){throw new Error("Failed to archive project",{cause:e})}}isIdle(){let e=this.getSessionContext(),r=["generating","replay"];return!this.#N&&!r.includes(e.state)&&this.#O.length===0}async needsBackup(){if(!this.#t?.git||!this.#D||!this.#z)return!1;let e=await this.getCurrentCommitHash();if(!e)return!1;let r=this.gitEnabledFolder?.originalRepoUrl;if(!r)return!1;let n=ph({version:"v2",originalRepoUrl:r,commitHash:e});return this.#G!==n}async uploadBackup(e=!1){try{let r=this.#D,n=this.#z;if(!this.#t?.git)throw new Error("Cannot upload backup in non-git mode");if(!r)throw new Error("Project ID is required for backup upload");if(!n)throw new Error("Branch ID is required for backup upload");let i=this.getAiBranch(),s=this.getFeatureBranch(),o=await this.#De(()=>ox({sys:this.#e,credentials:this.#u,projectId:r,branchName:n,repoPath:this.#c,aiBranch:i,featureBranch:s,workspace:this.#i,debug:this.#a,isConnectedToProvider:!0,forcedFullBackup:e,canAbortMerge:this.#J}));return o.success&&(this.#G=o.backupRef),o}catch(r){if(console.error("Failed to upload backup",r),this.#G=void 0,this.#e.Sentry?.captureException(r,{tags:{operation:"codegen-backup",backupError:""}}),r instanceof Error&&r.message.includes("Commit(s) not found on remote"))throw r instanceof Error?r:new Error(String(r));return{success:!1,error:r instanceof Error?r:new Error(String(r))}}}getCommitMode(){return this.#r?.commitMode??"prs"}#X(){return this.getCommitMode()==="commits"?`${this.getFeatureBranch()}`:`${this.getAiBranch()}`}async#Oe(e){let r=this.getCommitMode(),n=this.#X(),i=await this.getCurrentBranch();return r==="commits"?["push","--no-verify","--set-upstream",...e?["-f"]:[],"origin",`${i}:${n}`]:["push","--no-verify","--set-upstream",...e?["-f"]:[],"origin",n]}async#Me(){try{let e=this.getSessionContext(),r=Array.from(this.#ie);if(this.#ie.clear(),r.length===0||!e.prettierConfig)return!1;for(let n of r){let i=await this.#e.readFile(n);if(!i)continue;let s=await Ai(this.#s,i,void 0,n);await this.#e.writeFile(n,s)}if(this.#t?.git){if(await this.isCleanWorkTree())return!1;await this.manualCommit({add:".",commitMessage:"Prettier format pending files"})}return!0}catch(e){return this.#e.Sentry?.captureException(new Error("Failed to format pending files",{cause:e})),!1}}async pushChanges(e){let{pullFirst:r,updateRepo:n,actor:i,refreshRemote:s,forcePush:o}=IU(e);try{if(!this.#t?.git)throw new Error("Can not push changes in non-git mode");if(n){let u=this.#i?.folders.find(l=>l.enableGit);u&&(u.repoName=n.repoFullName,u.originalRepoUrl=n.repoUrl)}if(s||n){let u=await this.#ve();if(!u.success)throw u.error}if(await this.#S())throw await this.emitGitStatus(),new Error("Merge conflict detected, please resolve the conflict and try again");await this.#Me(),r&&await this.pullLatestFromRemote({requestRefresh:!1});let a=await this.#Oe(o??!r);await this.git(a);let c=await this.emitGitStatus();return await this.#M({lastCommit:c?.currentCommit}),{success:!0}}catch(a){this.#e.Sentry?.captureException(a,{tags:{operation:"codegen-git",endpoint:"pushChanges",actor:i},extra:{pullFirst:r,commitMode:this.getCommitMode(),updateRepo:n,refreshRemote:s}});let c=nd(a);return{success:!1,message:c,error:a instanceof Error?a:new Error(c)}}}async pullLatestFromRemote(e){let r=this.#X();return await this.#xe({branches:[r],allowUnrelatedHistory:!1,canPush:!1,uncommittedChanges:"stash",fastForward:this.getCommitMode()==="commits"?"auto":"never",requestRefresh:e?.requestRefresh??!0})}async abortMerge(e=!0){try{return await this.git(["merge","--abort"]),e&&await this.emitGitStatus(),this.requestRefresh(),{success:!0,message:"Merge aborted"}}catch(r){await this.emitGitStatus();let n=nd(r);return{success:!1,message:n,error:r instanceof Error?r:new Error(n)}}}async syncChangesFromRemote(e){let r=[],n=e?.remoteBranches??"both";return n==="both"?r.push(this.getAiBranch(),this.getFeatureBranch()):n==="main"?r.push(this.getFeatureBranch()):n==="ai"&&r.push(this.getAiBranch()),await this.#xe({branches:r,allowUnrelatedHistory:e?.allowUnrelatedHistory??!0,canPush:e?.canPush??!1,uncommittedChanges:e?.uncommittedChanges??"stash",requestRefresh:e?.requestRefresh,fastForward:e?.fastForward??(this.getCommitMode()==="commits"?"auto":"never")})}async#S(){try{return await this.git(["rev-parse","-q","--verify","MERGE_HEAD"]),!0}catch{return!1}}async#xe({branches:e,allowUnrelatedHistory:r,canPush:n,fastForward:i,uncommittedChanges:s,requestRefresh:o=!1}){try{if(!this.#t?.git)throw new Error("Can not pull changes in non-git mode");if(!e.length)throw new Error("At least one branch name is required");let a=await this.getCurrentBranch(),c=this.getAiBranch();if(a!==c)throw new Error(`Sync failed, we are not in AI branch, current branch: ${a} != ${c}`);if(await this.#S())throw await this.emitGitStatus(),new Error("Merge conflict detected, please resolve the conflict and try again");if(!await this.isCleanWorkTree())switch(s){case"stash":await this.git(["stash","--include-untracked"]);break;case"commit":await this.git(["add","."]),await this.git(["commit","-m","Uncommited changes made outside Fusion"]);break;default:throw new Error("Uncommitted changes detected, please commit or stash them before syncing")}await this.git(["fetch","origin","--prune"]);let p=await this.git(["for-each-ref","refs/remotes/origin"]),d=e.filter(h=>p.includes(`refs/remotes/origin/${h}`));for(let h of d)if(h!==c&&!h.startsWith("ai_")&&await this.git(["update-ref",`refs/heads/${h}`,`refs/remotes/origin/${h}`]),await this.git(["merge",...i==="never"?["--no-ff"]:[],...i==="required"?["--ff-only"]:[],...r?["--allow-unrelated-histories"]:[],`refs/remotes/origin/${h}`]),await this.#S())throw await this.emitGitStatus(),new Error("Merge conflict detected, please resolve the conflict and try again");if(n){let h=await this.pushChanges(!1);if(!h.success)throw h.error}else{let h=await this.emitGitStatus();await this.#M({lastCommit:h?.currentCommit})}return o&&this.requestRefresh(),{success:!0,message:`Successfully merged ${e.join(", ")} into current branch`}}catch(a){await this.emitGitStatus(),this.#e.Sentry?.captureException(a,{tags:{operation:"codegen-git",endpoint:"syncChangesFromBranches"},extra:{branches:e,allowUnrelatedHistory:r}});let c=nd(a);return{success:!1,message:c,error:a instanceof Error?a:new Error(c)}}}async getCurrentCommitHash(e="HEAD"){if(this.#t?.git)try{return(await this.git(["rev-parse",e])).trim()}catch{return}}async getCurrentBranch(){return(await this.git(["branch","--show-current"])).trim()}getFeatureBranch(){if(!this.#L)throw new Error("Feature branch is missing");return this.#L}getAiBranch(){if(!this.#$)throw new Error("AI branch is missing");return this.#$}async git(e,r){if(!this.#t?.git)throw new Error("Can not execute git command in non-git mode.");let n=e[0],i=n==="push"||n==="fetch"||n==="pull",s=Date.now(),o=s-this.#he,c=1e3*60;return i&&o>10*c&&(this.#he=s,await this.#ve()),await this.#De(()=>this.#Be(e,r))}#De(e){let r=this.#ce.then(()=>e());return this.#ce=r.catch(()=>{}),r}async#Be(e,r){if(!this.#t?.git)throw new Error(`Can not execute git command in non-git mode: git ${e.join(" ")}`);let n=`git ${e.join(" ")}`;this.#N&&this.#e.Sentry?.captureException(new Error(`currentGitCommand is not finished yet. Current command: ${this.#N}, New command Received: ${n}`),{tags:{operation:"codegen-git"},extra:{oldCommand:this.#N,newCommand:n}});try{return this.#N=n,await wa("git",e,{cwd:typeof r=="string"?r:this.#c,debug:this.#a,sys:this.#e,timeout:60*1e3,...typeof r=="object"?r:void 0})}finally{this.#N=void 0}}setDebug(e){this.#a=e}async createTerminal(e){let r=this.#t?.devServerOrchestrator,n=e?.terminalId||`pty_${Date.now()}_${(0,JF.randomUUID)()}`,i=this.#oe().find(w=>w.terminalId===n),s=new Set,o=new Set;if(i&&e?.terminalId){if(!e?.force)return i;let w=this.#d.get(e.terminalId);if(!w)return i;w.onDataListeners.forEach(v=>{s.add(v)}),w.onExitListeners.forEach(v=>{o.add(v)}),this.disposeTerminal({terminalId:n,emitTerminals:!1})}let a=e?.shell||(process.platform==="win32"?"powershell.exe":process.env.SHELL||"/bin/bash"),c=e?.cols??120,u=e?.rows??30,l={...process.env,...r?.envVars,...e?.env};e?.inheritCredentials&&(l.BUILDER_USER_ID=e.createdBy??this.#u.userId,l.BUILDER_PUBLIC_KEY=this.#u.builderPublicKey,l.BUILDER_PRIVATE_KEY=this.#u.builderPrivateKey);let p=[],d=w=>{for(let v of s)v(w)},h=({exitCode:w,error:v})=>{let x=this.#d.get(n);x&&(x.state=v?"error":"exited",x.exitCode=w);for(let C of o)C(w);this.#d.delete(n),p.forEach(C=>C())},m=e?.cwd||this.#g,g,y;if(e?.readonly){g="starting";let w=Fo(a,e?.initialCommand??"true",{cwd:m,env:l,stdio:["ignore","pipe","pipe"]});w.on("spawn",()=>{let v=this.#d.get(n);v&&(v.state="running")}),w.stdout.on("data",v=>{d(v.toString())}),w.stderr.on("data",v=>{d(v.toString())}),w.on("error",v=>{h({exitCode:1,error:v})}),w.on("exit",v=>{h({exitCode:v??0})}),p.push(()=>{try{w.removeAllListeners()}catch{}w.kill()}),y=w}else{g="running";let w=mP(this.#e);if(!w)throw new Error("Could not import node-pty");let v=a.includes("bash")||a.includes("zsh"),x=a.includes("zsh")?"%~ $ ":"\\w $ ",C=w.spawn(a,[],{name:"xterm-color",cwd:m,cols:c,rows:u,env:v?{...l,PS1:x}:l}),E=C.onData(d);p.push(()=>{try{E?.dispose?.()}catch{}});let P=C.onExit(h);p.push(()=>{try{P?.dispose?.()}catch{}});let A=e?.initialCommand;A&&(A.endsWith(`
1998
+ `)}let P={devServerState:a,setupState:i,httpServerState:d,proxyServer:p,devCommand:o,setupCommand:u,hasMergeConflict:s,logs:b,prompt:v,message:w},A=!this.#l&&PFe.includes(n.state);return{actionButtonText:C,type:"build-error",level:x,canAutoApply:A,healthStatus:P,message:P.message,userMessage:{userPrompt:P.prompt,repair:!0,category:E,displayPrompt:P.message}}}}async#ke(){let e;if(this.#t?.git)try{if(N.info("\u{1F504} Initializing Fusion session for AI side-car branch workflow..."),e=await this.#e.getRepoInfo(this.#c),!e.hasGit)if(this.#t.gitAutoInit){N.warn("\u{1F6E0}\uFE0F No git repository detected. Initializing a new git repository...");try{await this.git(["init"]),await this.git(["add","."]),await this.git(["branch","-M","main"]),await this.git(["commit","--allow-empty","--quiet","--no-verify","-m","Initial commit for Fusion workflow"]),N.info("\u2705 Successfully initialized a new git repository")}catch(r){console.error("\u274C Failed to initialize git repository:",r);return}}else{N.error("\u274C Error: Not in a git repository. Fusion requires a git repository.");return}return await Px({sys:this.#e,gitWorkingDirectory:this.#c,strict:!0})}catch(r){N.error(`\u274C Error initializing Fusion session: ${r}`);let n=new Error("Initialize Git failed",{cause:r});throw this.#e.Sentry?.captureException(n,{level:"fatal",tags:{operation:"codegen-initialize-session"},extra:{repoInfo:e}}),n}return{featureBranch:void 0,sessionId:void 0,currentCommitHash:void 0}}async#Ie(e){try{await this.git(["checkout",e])}catch{await this.git(["checkout","-b",e])}}async#Ne(e){if(this.#t?.git){if(!this.#$){let o=Uq(this.getFeatureBranch(),e.sessionId);this.#$=o}let r=await this.getCurrentBranch(),n=this.getAiBranch();r!==n&&await this.#Ie(n);try{await this.git(["branch","--set-upstream-to",`refs/remotes/origin/${this.#X()}`])}catch{}let i=_o(e.turns),s=i?.afterCommit??i?.lastCommit;if(s){let o=await this.getCurrentCommitHash();o!==s&&this.#e.Sentry?.captureException(new Error("Init: After commit mismatch"),{tags:{operation:"codegen-initialize-session"},extra:{sessionId:e.sessionId,targetCommit:s,lastTurn:i,currentCommitHash:o}})}if(e.beforeCommit)try{await this.git(["rev-parse","--quiet","--verify",e.beforeCommit])}catch(o){this.#e.Sentry?.captureException(new Error("Init: Before commit not found",{cause:o}),{tags:{operation:"codegen-initialize-session"},extra:{sessionId:e.sessionId,beforeCommit:e.beforeCommit,turnStates:e.turns.length,lastCompletionId:_o(e.turns)?.completionId}})}}}async#Re(e,r){let n;try{n=(await this.git(["remote","get-url","origin"],r)).trim()}catch{}try{new URL(e)}catch{throw this.#e.Sentry?.captureException(new Error("Provided remote url is invalid"),{tags:{operation:"codegen-git"},extra:{url:e,currentOriginUrl:n}}),new Error("Provided remote url is invalid")}n!==e&&(this.#G=void 0,n?await this.git(["remote","set-url","origin",e],r):await this.git(["remote","add","origin",e],r))}async pushRepoV2(e){return await this.pushChanges({pullFirst:!1,updateRepo:e,refreshRemote:!0})}async#ve(){let e;try{let r=this.gitEnabledFolder;if(!r)throw new Error("Main repo not found");if(r.initializationCommand||r.repoUrl?.startsWith("ssh://"))return{success:!0,message:"Git remote URLs update not needed"};if(!this.#b)throw new Error("Project ID is required to update git URLs");let i=await sd(this.#u,this.#b);if(!i.success)throw i.error;if(e=i.gitConfigs,!r.repoName)throw new Error("Main repo not found");let s=e?.[r.repoName];if(s?.url){let o=this.#e.resolve(this.#s,r.path);await this.#Re(s.url,o)}return await this.emitGitStatus(),{success:!0,message:"Git remote URLs updated"}}catch(r){let n=`Failed to update git remote URLs: ${nd(r)}`;return this.#a&&console.error(n),this.#n.emit("step",{type:"error",message:n,code:"git-update-error"}),this.#e.Sentry?.captureException(r,{tags:{operation:"codegen-git",endpoint:"updateGitUrls"},extra:{projectId:this.#b,workspaceFolders:this.#i?.folders,gitConfigs:e}}),{success:!1,message:n,error:r instanceof Error?r:new Error(n)}}}async zipFolder(e){let{resolvedPath:r}=this.resolveWorkspacePath(e,!1),n=Date.now(),i=Math.random().toString(36).substring(2,8),s=`zip-${n}-${i}.zip`,o="/tmp",a=this.#e.join(o,s);return zd.default.mkdirSync(o,{recursive:!0}),await wa("zip",["-r",a,".","-x","**/node_modules/**"],{cwd:r,debug:this.#a,sys:this.#e}),a}async archiveProject(){if(!this.#t?.git)throw new Error("Can not archive project in non git mode");try{let e=Date.now(),r=Math.random().toString(36).substring(2,8),n=`project-${e}-${r}.zip`,i="/tmp",s=this.#e.join(i,n);return zd.default.mkdirSync(i,{recursive:!0}),await this.git(["archive","--format=zip","-o",s,"HEAD"]),s}catch(e){throw new Error("Failed to archive project",{cause:e})}}isIdle(){let e=this.getSessionContext(),r=["generating","replay"];return!this.#N&&!r.includes(e.state)&&this.#O.length===0}async needsBackup(){if(!this.#t?.git||!this.#b||!this.#z)return!1;let e=await this.getCurrentCommitHash();if(!e)return!1;let r=this.gitEnabledFolder?.originalRepoUrl;if(!r)return!1;let n=ph({version:"v2",originalRepoUrl:r,commitHash:e});return this.#G!==n}async uploadBackup(e=!1){try{let r=this.#b,n=this.#z;if(!this.#t?.git)throw new Error("Cannot upload backup in non-git mode");if(!r)throw new Error("Project ID is required for backup upload");if(!n)throw new Error("Branch ID is required for backup upload");let i=this.getAiBranch(),s=this.getFeatureBranch(),o=await this.#De(()=>ox({sys:this.#e,credentials:this.#u,projectId:r,branchName:n,repoPath:this.#c,aiBranch:i,featureBranch:s,workspace:this.#i,debug:this.#a,isConnectedToProvider:!0,forcedFullBackup:e,canAbortMerge:this.#J}));return o.success&&(this.#G=o.backupRef),o}catch(r){if(console.error("Failed to upload backup",r),this.#G=void 0,this.#e.Sentry?.captureException(r,{tags:{operation:"codegen-backup",backupError:""}}),r instanceof Error&&r.message.includes("Commit(s) not found on remote"))throw r instanceof Error?r:new Error(String(r));return{success:!1,error:r instanceof Error?r:new Error(String(r))}}}getCommitMode(){return this.#r?.commitMode??"prs"}#X(){return this.getCommitMode()==="commits"?`${this.getFeatureBranch()}`:`${this.getAiBranch()}`}async#Oe(e){let r=this.getCommitMode(),n=this.#X(),i=await this.getCurrentBranch();return r==="commits"?["push","--no-verify","--set-upstream",...e?["-f"]:[],"origin",`${i}:${n}`]:["push","--no-verify","--set-upstream",...e?["-f"]:[],"origin",n]}async#Me(){try{let e=this.getSessionContext(),r=Array.from(this.#ie);if(this.#ie.clear(),r.length===0||!e.prettierConfig)return!1;for(let n of r){let i=await this.#e.readFile(n);if(!i)continue;let s=await Ai(this.#s,i,void 0,n);await this.#e.writeFile(n,s)}if(this.#t?.git){if(await this.isCleanWorkTree())return!1;await this.manualCommit({add:".",commitMessage:"Prettier format pending files"})}return!0}catch(e){return this.#e.Sentry?.captureException(new Error("Failed to format pending files",{cause:e})),!1}}async pushChanges(e){let{pullFirst:r,updateRepo:n,actor:i,refreshRemote:s,forcePush:o}=IU(e);try{if(!this.#t?.git)throw new Error("Can not push changes in non-git mode");if(n){let u=this.#i?.folders.find(l=>l.enableGit);u&&(u.repoName=n.repoFullName,u.originalRepoUrl=n.repoUrl)}if(s||n){let u=await this.#ve();if(!u.success)throw u.error}if(await this.#S())throw await this.emitGitStatus(),new Error("Merge conflict detected, please resolve the conflict and try again");await this.#Me(),r&&await this.pullLatestFromRemote({requestRefresh:!1});let a=await this.#Oe(o??!r);await this.git(a);let c=await this.emitGitStatus();return await this.#M({lastCommit:c?.currentCommit}),{success:!0}}catch(a){this.#e.Sentry?.captureException(a,{tags:{operation:"codegen-git",endpoint:"pushChanges",actor:i},extra:{pullFirst:r,commitMode:this.getCommitMode(),updateRepo:n,refreshRemote:s}});let c=nd(a);return{success:!1,message:c,error:a instanceof Error?a:new Error(c)}}}async pullLatestFromRemote(e){let r=this.#X();return await this.#xe({branches:[r],allowUnrelatedHistory:!1,canPush:!1,uncommittedChanges:"stash",fastForward:this.getCommitMode()==="commits"?"auto":"never",requestRefresh:e?.requestRefresh??!0})}async abortMerge(e=!0){try{return await this.git(["merge","--abort"]),e&&await this.emitGitStatus(),this.requestRefresh(),{success:!0,message:"Merge aborted"}}catch(r){await this.emitGitStatus();let n=nd(r);return{success:!1,message:n,error:r instanceof Error?r:new Error(n)}}}async syncChangesFromRemote(e){let r=[],n=e?.remoteBranches??"both";return n==="both"?r.push(this.getAiBranch(),this.getFeatureBranch()):n==="main"?r.push(this.getFeatureBranch()):n==="ai"&&r.push(this.getAiBranch()),await this.#xe({branches:r,allowUnrelatedHistory:e?.allowUnrelatedHistory??!0,canPush:e?.canPush??!1,uncommittedChanges:e?.uncommittedChanges??"stash",requestRefresh:e?.requestRefresh,fastForward:e?.fastForward??(this.getCommitMode()==="commits"?"auto":"never")})}async#S(){try{return await this.git(["rev-parse","-q","--verify","MERGE_HEAD"]),!0}catch{return!1}}async#xe({branches:e,allowUnrelatedHistory:r,canPush:n,fastForward:i,uncommittedChanges:s,requestRefresh:o=!1}){try{if(!this.#t?.git)throw new Error("Can not pull changes in non-git mode");if(!e.length)throw new Error("At least one branch name is required");let a=await this.getCurrentBranch(),c=this.getAiBranch();if(a!==c)throw new Error(`Sync failed, we are not in AI branch, current branch: ${a} != ${c}`);if(await this.#S())throw await this.emitGitStatus(),new Error("Merge conflict detected, please resolve the conflict and try again");if(!await this.isCleanWorkTree())switch(s){case"stash":await this.git(["stash","--include-untracked"]);break;case"commit":await this.git(["add","."]),await this.git(["commit","-m","Uncommited changes made outside Fusion"]);break;default:throw new Error("Uncommitted changes detected, please commit or stash them before syncing")}await this.git(["fetch","origin","--prune"]);let p=await this.git(["for-each-ref","refs/remotes/origin"]),d=e.filter(h=>p.includes(`refs/remotes/origin/${h}`));for(let h of d)if(h!==c&&!h.startsWith("ai_")&&await this.git(["update-ref",`refs/heads/${h}`,`refs/remotes/origin/${h}`]),await this.git(["merge",...i==="never"?["--no-ff"]:[],...i==="required"?["--ff-only"]:[],...r?["--allow-unrelated-histories"]:[],`refs/remotes/origin/${h}`]),await this.#S())throw await this.emitGitStatus(),new Error("Merge conflict detected, please resolve the conflict and try again");if(n){let h=await this.pushChanges(!1);if(!h.success)throw h.error}else{let h=await this.emitGitStatus();await this.#M({lastCommit:h?.currentCommit})}return o&&this.requestRefresh(),{success:!0,message:`Successfully merged ${e.join(", ")} into current branch`}}catch(a){await this.emitGitStatus(),this.#e.Sentry?.captureException(a,{tags:{operation:"codegen-git",endpoint:"syncChangesFromBranches"},extra:{branches:e,allowUnrelatedHistory:r}});let c=nd(a);return{success:!1,message:c,error:a instanceof Error?a:new Error(c)}}}async getCurrentCommitHash(e="HEAD"){if(this.#t?.git)try{return(await this.git(["rev-parse",e])).trim()}catch{return}}async getCurrentBranch(){return(await this.git(["branch","--show-current"])).trim()}getFeatureBranch(){if(!this.#L)throw new Error("Feature branch is missing");return this.#L}getAiBranch(){if(!this.#$)throw new Error("AI branch is missing");return this.#$}async git(e,r){if(!this.#t?.git)throw new Error("Can not execute git command in non-git mode.");let n=e[0],i=n==="push"||n==="fetch"||n==="pull",s=Date.now(),o=s-this.#he,c=1e3*60;return i&&o>10*c&&(this.#he=s,await this.#ve()),await this.#De(()=>this.#Be(e,r))}#De(e){let r=this.#ce.then(()=>e());return this.#ce=r.catch(()=>{}),r}async#Be(e,r){if(!this.#t?.git)throw new Error(`Can not execute git command in non-git mode: git ${e.join(" ")}`);let n=`git ${e.join(" ")}`;this.#N&&this.#e.Sentry?.captureException(new Error(`currentGitCommand is not finished yet. Current command: ${this.#N}, New command Received: ${n}`),{tags:{operation:"codegen-git"},extra:{oldCommand:this.#N,newCommand:n}});try{return this.#N=n,await wa("git",e,{cwd:typeof r=="string"?r:this.#c,debug:this.#a,sys:this.#e,timeout:60*1e3,...typeof r=="object"?r:void 0})}finally{this.#N=void 0}}setDebug(e){this.#a=e}async createTerminal(e){let r=this.#t?.devServerOrchestrator,n=e?.terminalId||`pty_${Date.now()}_${(0,JF.randomUUID)()}`,i=this.#oe().find(w=>w.terminalId===n),s=new Set,o=new Set;if(i&&e?.terminalId){if(!e?.force)return i;let w=this.#d.get(e.terminalId);if(!w)return i;w.onDataListeners.forEach(v=>{s.add(v)}),w.onExitListeners.forEach(v=>{o.add(v)}),this.disposeTerminal({terminalId:n,emitTerminals:!1})}let a=e?.shell||(process.platform==="win32"?"powershell.exe":process.env.SHELL||"/bin/bash"),c=e?.cols??120,u=e?.rows??30,l={...process.env,...r?.envVars,...e?.env};e?.inheritCredentials&&(l.BUILDER_USER_ID=e.createdBy??this.#u.userId,l.BUILDER_PUBLIC_KEY=this.#u.builderPublicKey,l.BUILDER_PRIVATE_KEY=this.#u.builderPrivateKey);let p=[],d=w=>{for(let v of s)v(w)},h=({exitCode:w,error:v})=>{let x=this.#d.get(n);x&&(x.state=v?"error":"exited",x.exitCode=w);for(let C of o)C(w);this.#d.delete(n),p.forEach(C=>C())},m=e?.cwd||this.#g,g,y;if(e?.readonly){g="starting";let w=Fo(a,e?.initialCommand??"true",{cwd:m,env:l,stdio:["ignore","pipe","pipe"]});w.on("spawn",()=>{let v=this.#d.get(n);v&&(v.state="running")}),w.stdout.on("data",v=>{d(v.toString())}),w.stderr.on("data",v=>{d(v.toString())}),w.on("error",v=>{h({exitCode:1,error:v})}),w.on("exit",v=>{h({exitCode:v??0})}),p.push(()=>{try{w.removeAllListeners()}catch{}w.kill()}),y=w}else{g="running";let w=mP(this.#e);if(!w)throw new Error("Could not import node-pty");let v=a.includes("bash")||a.includes("zsh"),x=a.includes("zsh")?"%~ $ ":"\\w $ ",C=w.spawn(a,[],{name:"xterm-color",cwd:m,cols:c,rows:u,env:v?{...l,PS1:x}:l}),E=C.onData(d);p.push(()=>{try{E?.dispose?.()}catch{}});let P=C.onExit(h);p.push(()=>{try{P?.dispose?.()}catch{}});let A=e?.initialCommand;A&&(A.endsWith(`
1999
1999
  `)||(A+=`
2000
2000
  `),C.write(A)),y=C}let b=Date.now(),D={terminalId:n,title:e?.title||`Terminal ${this.#d.size+1}`,cwd:m,createdAt:b,lastWrittenAt:b,createdBy:e?.createdBy||"unknown",readonly:e?.readonly??!1,initialCommand:e?.initialCommand,builtIn:!1,state:g,exitCode:void 0};return this.#d.set(n,{...D,pty:y,onDataListeners:s,onExitListeners:o,disposeFns:p,env:e?.env,shell:a,inheritCredentials:e?.inheritCredentials}),(e?.emitTerminals??!0)&&this.emitTerminals(),D}#oe(){let e=this.getSessionContext(),r=Array.from(this.#d.values()).map(i=>({terminalId:i.terminalId,title:i.title,cwd:i.cwd,createdAt:i.createdAt,lastWrittenAt:i.lastWrittenAt,createdBy:i.createdBy,readonly:i.readonly,builtIn:i.builtIn,exitCode:i.exitCode,state:i.state}));this.#E?.includes("Bash")&&r.unshift({terminalId:"bash-tools",title:"Bash",cwd:this.#g,createdAt:e.createdUnixTime,lastWrittenAt:Date.now(),createdBy:"fusion",readonly:!0,builtIn:!0,exitCode:void 0,state:"running"});let n=this.#t?.devServerOrchestrator;return n&&r.unshift({terminalId:"dev-command",title:"Dev Command",cwd:this.#g,createdAt:e.createdUnixTime,lastWrittenAt:Date.now(),createdBy:"fusion",readonly:!n.devCommandProcess?.write,builtIn:!0,state:n.devState==="running"?"running":"exited",exitCode:void 0},{terminalId:"setup-command",title:"Setup Command",cwd:this.#g,createdAt:e.createdUnixTime,lastWrittenAt:Date.now(),createdBy:"fusion",readonly:!0,builtIn:!0,state:n.setupState==="installing"?"running":"exited",exitCode:void 0}),r}emitTerminals(){this.#n.emit("step",{type:"terminals",terminals:this.#oe()})}updateTerminal({terminalId:e,cols:r,rows:n,title:i}){if(e==="dev-command"){if(r||n){let o=this.#t?.devServerOrchestrator;if(o?.devCommandProcess?.resize)return o.devCommandProcess.resize(r,n),!0}return!1}let s=this.#d.get(e);return s?("resize"in s.pty&&(r||n)&&s.pty.resize(r??s.pty.cols,n??s.pty.rows),i&&(s.title=i,this.emitTerminals()),!0):!1}writeTerminal({terminalId:e,data:r}){if(e==="dev-command"){let i=this.#t?.devServerOrchestrator;return i?.devCommandProcess?.write?(i.devCommandProcess.write(r),!0):!1}let n=this.#d.get(e);return!n||n.readonly?!1:("write"in n.pty&&n.pty.write(r),n.lastWrittenAt=Date.now(),!0)}signalTerminal({terminalId:e,signal:r}){if(e==="dev-command"){let i=this.#t?.devServerOrchestrator;return i?.devCommandProcess?.kill?(i.devCommandProcess.kill(r),!0):!1}let n=this.#d.get(e);if(!n||n.readonly)return!1;try{"write"in n.pty?process.platform==="win32"?n.pty.kill():(r==="SIGINT"&&n.pty.write(""),n.pty.kill(r)):n.pty.kill(r)}catch{}return!0}disposeTerminal({terminalId:e,emitTerminals:r=!0}){let n=this.#d.get(e);if(!n)return!1;try{n.pty.kill()}catch{}return n.disposeFns.forEach(i=>{try{i()}catch{}}),n.onDataListeners.clear(),n.onExitListeners.clear(),n.disposeFns=[],this.#d.delete(e),r&&this.emitTerminals(),!0}async restartTerminal({terminalId:e}){if(e==="dev-command"){let i=this.#t?.devServerOrchestrator;if(i)try{return await i.restart(),!0}catch(s){return this.#e.Sentry?.captureException(s),!1}return!1}if(e==="setup-command"){let i=this.#t?.devServerOrchestrator;if(i)try{return await i.runSetupCommand(),!0}catch(s){return this.#e.Sentry?.captureException(s),!1}return!1}if(e==="bash-tools")return!1;let r=this.#d.get(e);return r?(await this.createTerminal({terminalId:e,title:r.title,cwd:r.cwd,env:r.env,shell:r.shell,cols:"cols"in r.pty?r.pty.cols:void 0,rows:"rows"in r.pty?r.pty.rows:void 0,createdBy:r.createdBy,emitTerminals:!1,initialCommand:r.initialCommand,readonly:r.readonly,inheritCredentials:r.inheritCredentials,force:!0}),this.#d.get(e)?(this.emitTerminals(),!0):!1):!1}subscribeTerminal({terminalId:e,onData:r,onExit:n}){if(e==="dev-command"){let i=this.#t?.devServerOrchestrator;if(i){let s=i.getDevWrite();return s&&r(s),i.emitter.on("stdout",r),i.emitter.on("stderr",r),()=>{i.emitter.off("stdout",r),i.emitter.off("stderr",r)}}}else if(e==="setup-command"){let i=this.#t?.devServerOrchestrator;if(i){let s=i.getSetupOutput();return s&&r(s),i.emitter.on("installStdout",r),i.emitter.on("installStderr",r),()=>{i.emitter.off("installStdout",r),i.emitter.off("installStderr",r)}}}else if(e==="bash-tools"){let i=s=>{s.type==="stdio"&&s.source==="tool-command"&&r(s.content)};return this.#n.on("step",i),()=>{this.#n.off("step",i)}}else{let i=this.#d.get(e);if(!i)throw new Error("Terminal not found");return i.onDataListeners.add(r),n&&i.onExitListeners.add(n),"write"in i.pty&&i.pty.write(`clear
2001
2001
  `),()=>{i.onDataListeners.delete(r),n&&i.onExitListeners.delete(n)}}}async getAllFiles(e={}){let{getDotFiles:r=!1,globbyPattern:n="**/*",includePattern:i,gitignore:s,deep:o,truncate:a}=e,c=this.#r?.accessControl,u=c?.entries?.filter(h=>h.action==="allow"&&h.permissions.includes("list")).map(h=>h.resource)??[];if(!this.#i?.folders?.length){let h=await Mu({basePath:this.#s,globPattern:[i??n,...u],extraIgnorePatterns:FA(c).deny,dot:r,gitignore:s,sys:this.#e,deep:o});return PA(h,a)}let l=[],p=await this.#e.readdir(this.#s);for(let h of p)yA(h)&&l.push(h);!l.includes("AGENTS.md")&&this.#i.agentsMD&&l.push("AGENTS.md");for(let h of this.#i.folders){let m=this.#e.resolve(this.#s,h.path),g=await Mu({basePath:m,globPattern:[n,...u],dot:r,gitignore:s,sys:this.#e,deep:o}),y=this.#C()?".":h.name||this.#e.basename(m);for(let b of g)y!=="."?l.push(this.#e.join(y,b)):l.push(b)}let d=fh({files:l,policy:c,filterPattern:i,getDotFiles:r});return PA(d,a)}async searchFiles(e){let{query:r,caseInsensitive:n=!0,includeGlob:i,excludeGlob:s,maxResults:o=1e3,contextBefore:a=0,contextAfter:c=0}=e,u=await yP(this.#e),l=["--path-separator","/","--json","--line-number","--column","--max-columns","500"];return n&&l.push("-i"),a>0&&l.push("-B",a.toString()),c>0&&l.push("-A",c.toString()),i&&l.push("--glob",i),s&&l.push("--glob",`!${s}`),l.push("--ignore-file",".builderignore"),l.push("--",r),new Promise(p=>{let d=uh({command:u,args:l,options:{env:process.env,cwd:this.#g,stdio:["ignore","pipe","pipe"]}}),h=new En(5e4);d.stdout.on("data",m=>{h.write(m.toString())}),d.on("error",()=>{p({matches:[],totalMatches:0,filesWithMatches:0,truncated:!1})}),d.on("close",m=>{if(m!==0)p({matches:[],totalMatches:0,filesWithMatches:0,truncated:!1});else{let g=[],y=new Set,D=h.getContent().split(`
2002
- `),w=[],v=null;for(let C of D)if(C.trim())try{let E=JSON.parse(C);if(E.type==="match"){let P=E.data.path.text,A=E.data.line_number,F=E.data.lines.text.trimEnd(),_=E.data.submatches||[],G,$;_.length>0&&(G=_[0].start,$=_[0].end),y.add(P);let K={filePath:P,lineNumber:A,lineContent:F,columnStart:G,columnEnd:$,contextBefore:w,contextAfter:[]};if(w=[],v=K,g.push(K),g.length>=o)break}else if(E.type==="context"){let P=E.data.line_number,A=E.data.lines.text.trimEnd();v&&P>v.lineNumber?v.contextAfter.push(A):w.push(A)}}catch{continue}let x=g.length>=o;p({matches:g,totalMatches:g.length,filesWithMatches:y.size,truncated:x})}})})}async collectRepoMetrics(e={}){let{collectRepoMetrics:r}=await Promise.resolve().then(()=>(MK(),OK)),n=this.#c;return e.rootPath&&(n=this.#e.join(this.#c,e.rootPath)),r(this.#e,n)}getSessionId(){return this.getSessionContext().sessionId}getSpaceId(){return this.#u.builderPublicKey}async revertToCommitHash(e){this.#w=!1,await this.abortMerge(!1),await this.git(["revert","--no-commit",`${e}..HEAD`]),await this.git(["commit","--allow-empty","--quiet","--no-verify","-m","Revert changes"]);let n=(await this.emitGitStatus())?.currentCommit;if(!n){this.#e.Sentry?.captureException(new Error("Failed to get current commit hash after revert"),{tags:{operation:"codegen-git",endpoint:"revertToCommitHash"}});return}this.requestRefresh(),await this.#M({lastCommit:n})}async resetToCommitHash(e){if(this.#w=!1,await this.abortMerge(!1),await this.git(["reset","--quiet","--hard",e]),(await this.emitGitStatus())?.currentCommit!==e)throw new Error("Failed to reset commit hash");this.requestRefresh()}async restore({location:e,predicate:r,revert:n=!1,dryRun:i=!1,forceReplay:s=!1,debug:o}){let a=this.getSessionContext(),c=a.turns.length,u=null;for(let m=c-1;m>=-1;m--)if(r(m>=0?a.turns[m]:null,m)){u=m;break}if(u===null)return{undone:null,message:"Could not find the target to restore to, the completion id could be wrong"};n||await this.abort(!0);let l=new Map,p=!!this.#t?.git,d=a.turns,h=Math.max(0,e==="before"?u:u+1);for(let m=d.length-1;m>=h;m--){let g=d[m];for(let y of g.applyResults)l.set(y.filePath,y.oldContent??"")}if(!i){let m;if(p){u===-1?a.beforeCommit?m=a.beforeCommit:d.length>0&&(m=d[0].beforeCommit):u<d.length&&(e==="after"?(m=d[u].afterCommit,!m&&u+1<d.length&&(m=d[u+1].beforeCommit)):m=d[u].beforeCommit);let D={commitHash:m,sessionId:a.sessionId,sessionBeforeCommit:a.beforeCommit,turnsLength:d.length,targetIndex:u,currentTurn:d[d.length-1],targetTurn:d[u],targetTurnNext:d[u+1],location:e,forceReplay:s,dryRun:i,debug:o};if(!m)return this.#e.Sentry?.captureException(new Error("No commit hash found for restore"),{tags:{operation:"codegen-git",endpoint:"revertToCommitHash"},contexts:{restore:D}}),{undone:null,message:"Could not find the target to restore to, the git history is missing"};try{n?await this.revertToCommitHash(m):await this.resetToCommitHash(m)}catch(w){return this.#e.Sentry?.captureException(new Error("Error resetting git",{cause:w}),{tags:{operation:"codegen-git",endpoint:"resetToCommitHash"},contexts:{restore:D}}),{undone:null,message:"Failed to reset/restore, the file history is missing"}}}else for(let[D,w]of l.entries())try{w?await this.writeFile(D,w):await this.deleteFile(D)}catch{}if(n)return{undone:[],message:"The revert operation was successful"};let g=d.splice(h,d.length-h),y=_o(d);y&&y?.afterCommit!==m&&(this.#e.Sentry?.captureException(new Error("Reset After commit hash mismatch"),{tags:{operation:"codegen-git",endpoint:"resetToCommitHash"},extra:{lastTurn:y,commitHash:m}}),y.lastCommit=m,await this.#M({completionId:y.completionId,lastCommit:m}));let b=y?.completionId;if(g.length>0&&(await gA(this.#e,this.#u,{lastCompletionId:b,sessionId:a.sessionId},!!this.#a),a.updatedUnixTime=Date.now()),s){let D=a.state;this.#n.emit("step",{type:"batch",steps:[{type:"state",newState:"replay",abortable:!1,previousState:D},...this.#Ee(),{type:"restore",files:Array.from(l.keys()),lastCompletionId:b,location:e},{type:"state",newState:D,abortable:!1,previousState:"replay"}]})}else g.length>0&&this.#n.emit("step",{type:"restore",files:Array.from(l.keys()),lastCompletionId:b,location:e})}return await this.#we(),{undone:Array.from(l.keys()),message:"The restore operation was successful"}}async#we(e){return await this.#t?.devServerOrchestrator?.ensureDevCommand(e)}async restoreFromCompletionId({location:e,completionId:r,forceReplay:n}){let i=this.getSessionContext();return i.turns.find(o=>o.completionId===r)?this.restore({location:e,predicate:o=>o?.completionId===r,forceReplay:n,debug:`restore to: ${r}`}):(await this.#U,i.turns=[],i.canLoadMore=!0,await gA(this.#e,this.#u,{sessionId:i.sessionId,lastCompletionId:r},!!this.#a),await this.loadMoreTurns(),this.restore({location:e,predicate:()=>!0,forceReplay:!0,debug:"restore after history"}))}async restoreBeforeCompletionId(e){return this.restoreFromCompletionId({location:"before",completionId:e,forceReplay:!1})}async undoLastUserMessage(e=!1){return this.restore({location:"before",predicate:r=>r?.user.role==="user",dryRun:e})}getLastUserCompletionId(){let e=this.getSessionContext();return vU(e)?.completionId}getLastCompletionId(){let e=this.getSessionContext();return mA(e)?.completionId}getCurrentState(){return this.getSessionContext().state}getLastApplyResultsTurn(){let e=this.getSessionContext();return xU(e)}getLastTurn(){let e=this.getSessionContext();return mA(e)}getNextUrl(){return this.getLastTurn()?.nextUrl}#Le(){let e=this.#l;if(e)return this.#l=void 0,this.#m=e,e}getNextMessage(){let e=new Promise(r=>{this.#l?r():this.#y=r}).then(()=>{let r=this.#l;if(r)return!r.dropAbortedPrompt&&this.#m&&!r.queue&&(r=ah(this.#m,r)),this.#l=void 0,this.#m=r,r});return{shouldWait:!this.#l,promise:e}}async sendFeedback(e){if(process.env.NODE_ENV==="test")return;Je("quality code feedback given",{spaceId:this.#u.builderPublicKey,sentiment:e.feedbackSentiment,mode:"cli"});let r=e.id??this.getLastCompletionId();r&&await this.#$e({...e,id:r})}#M(e){let r=e.completionId;if(!r){let i=this.getLastTurn();i&&e.lastCommit&&(i.lastCommit=e.lastCommit),r=i?.completionId}let n=hA(this.#e,this.#u,"/codegen/finalize",{completionId:r,projectId:this.#r?.projectId,branchName:this.#r?.branchName,userCompletionId:this.getLastUserCompletionId(),sessionId:this.getSessionId(),...e});return this.#ae(n),n}#$e(e){let r=hA(this.#e,this.#u,"/codegen/feedback",e);return this.#ae(r),r}#ae(e){this.#O.push(e),e.finally(()=>{let r=this.#O.indexOf(e);r!==-1&&this.#O.splice(r,1)})}async lastTurnHasChanges(){let e=await this.undoLastUserMessage(!0);return e.undone?e.undone.length>0:!1}#b(e){let r=this.getSessionContext(),n=r.state;n!==e&&(r.state=e,this.#n.emit("step",{type:"state",abortable:e==="generating",previousState:n,newState:e}))}waitUntilState(e,r=1e4){return new Promise(n=>{if(this.getSessionContext().state===e){n();return}let s,o=a=>{a.type==="state"&&a.newState===e&&(clearTimeout(s),this.#n.removeListener("step",o),n())};s=setTimeout(()=>{this.#n.removeListener("step",o),n()},r),this.#n.on("step",o)})}async clearSession(){let e=this.getSessionContext();e.turns=[],e.customInstructions=await this.#Y(),this.#W=!0,this.#w=!1}async sendMessage(e){let r;if(Array.isArray(e)){r=this.#l;for(let n of e)r?r=ah(r,n):r=n}else r=e,!e.dropAbortedPrompt&&this.#l&&(r=ah(this.#l,e));r&&(this.#l=r,this.#w=!1,this.cancelAllPendingToolFulfilments(),r.queue||await this.abort(),this.#y&&this.#y()),await id()}async spawnAgent(e){let{prompt:r,user:n,onStep:i,signal:s,maxCompletions:o=50,sessionId:a,tools:c=["Read","LS","Glob","ReadRule","Grep","WebSearch","ExplorationMetadata"],model:u="opa5-mini",mode:l="quality-v4-agent",systemPrompt:p,subagent_type:d,includeMemories:h,needDevServer:m}=e,g=this.#t?.devServerOrchestrator;if(m){if(!g)return{success:!1,response:`The ${d} agent can not be used on this session. Do no try again.`,metadata:{important_files:[]}};if(g.httpServerState.state==="stopped"||g.httpServerState.state==="connecting"||g.httpServerState.state==="error-fetch")try{if(g.state==="not-installed")throw new Error(`The ${d} agent can not be used until the setupCommand finish successfully. However, the dev server is not installed.`);if(g.state==="install-failed")throw new Error(`The ${d} agent can not be used until the setupCommand finish successfully. However, last time we try to run the install script, it failed.`);if(g.state==="install-aborted")throw new Error(`The ${d} agent can not be used until the setupCommand finish successfully. However, last time we try to run the install script, it was aborted.`);g.state==="installing"&&await NU(g.setupCommandPromise,s),await g.ensureDevCommand(s),await g.waitUntilServer(s)}catch(A){return{success:!1,response:A instanceof Error?A.message:String(A),metadata:{important_files:[]}}}}let y=this.#B.replace(/-agent$/,""),b={};if(c.includes("mcp:chrome")){let A=await this.#je(s);if(!A)return{success:!1,response:"Failed to get Chrome WebSocket server URL",metadata:{important_files:[]}};b.chrome={command:"npx",args:["-y","chrome-devtools-mcp@latest","--wsEndpoint",A,"--categoryEmulation=false","--viewport=1280x720"]}}let D=p?vc(p,{FUSION_TEST_PROMPT:"",...g?.envVars??process.env}):void 0,w=new t({sys:this.#e,credentials:this.#u,position:`${y}-agent`,mode:l,modelOverride:bP(u),sessionOrCompletionId:a,workingDirectory:this.#s,mcpServers:!1,autoImportLocalMCPs:!1,fusionConfig:this.#r,enabledTools:c,builtInMCPServerConfig:b,systemPromptOverride:D});await w.initializeSession({skipSessionLoading:!0});let v={important_files:[]},x=[],C=w.connectToEventLoop(!1,A=>{A.type==="tool_result"&&A.result.tool_name==="ExplorationMetadata"&&typeof A.result.content=="string"?v=JSON.parse(A.result.content):i&&i(A,d);try{if(A.type==="tool_result"){let F=A.result.content;if(Array.isArray(F)){let _=F.filter(G=>G.type==="image"&&G.source.type==="base64");x.push(..._)}}}catch{}}),E=async()=>{C(),await w.close(!1)};if(s?.aborted)return await E(),{success:!1,response:"Agent task aborted",metadata:{important_files:[]}};let P=async()=>{await E()};s&&s.addEventListener("abort",P);try{await w.sendMessage({userPrompt:r,user:n,maxCompletions:o,category:"background-subagent",includeRelevantMemories:h}),await w.waitUntilIdle();let A=w.getLastTurn();if(!A)return{success:!1,response:"Agent task failed",metadata:{important_files:[]}};let F=A.actions.filter(_=>_.type==="text").map(_=>_.content).join(`
2003
- `);return x.length>1&&(async()=>{try{let _=w.getSessionId(),G="/tmp/gifs",$=`${G}/${_}.gif`;await zd.default.promises.mkdir(G,{recursive:!0});let K=await lU(x,{framerate:1,outputPath:$,cleanup:!0,sys:this.#e});K&&console.log(`[${d}] Generated GIF from ${x.length} images: ${K}`)}catch(_){console.warn(`[${d}] Failed to generate GIF (non-critical): ${_ instanceof Error?_.message:String(_)}`)}})(),{success:!0,response:F,metadata:v,lastTurn:A}}catch(A){return{success:!1,response:`Agent task failed: ${A instanceof Error?A.message:String(A)}`,metadata:{important_files:[]}}}finally{s&&s.removeEventListener("abort",P),await E()}}setProxyOrigin(e){this.#ne=e}async#je(e){let r=this.#u,n=new URL(`${Be}/codegen/get-browser-connection`);r.builderPublicKey&&n.searchParams.set("apiKey",r.builderPublicKey),r.userId&&n.searchParams.set("userId",r.userId);let i={"Content-Type":"application/json"};r.builderPrivateKey&&(i.Authorization=`Bearer ${r.builderPrivateKey}`);let s=await Fe(n,{method:"POST",body:JSON.stringify({sessionId:this.getSessionId(),projectId:this.#D,branchName:this.#z,proxyOrigin:this.#ne,proxyDst:this.#ge}),keepalive:!0,headers:i,signal:e});if(!s.ok)return;let o=await s.json();if(typeof o.wsUrl=="string")return o.wsUrl}getTurns(){let e=this.getSessionContext();return structuredClone(e.turns)}getSessionContext(){if(!this.#p)throw new Error("Session context not initialized");return this.#p}async runSetupCommand(){return await this.#t?.devServerOrchestrator?.runSetupCommand()}abortSetupCommand(){return this.#t?.devServerOrchestrator?.abortSetupCommand()}abortValidateCommand(){return this.#t?.devServerOrchestrator?.abortValidateCommand()}toolsRunning(){return this.#v.length>0}abortAllTools(){for(let e of this.#v)e.abortController.abort()}toolFullfilment(e,r){return typeof r=="string"&&(r={toolResult:r,isError:!1}),this.fulfillToolCall(e,r)}cancelAllPendingToolFulfilments(){for(let e of Array.from(this.#_.keys()))this.fulfillToolCall(e,{toolResult:"Aborted by the user. So the task could not be completed.",isError:!0,title:"Aborted by the user."});this.#_.clear()}fulfillToolCall(e,r){let n=this.#_.get(e);return n?(n(r),this.#_.delete(e),!0):!1}abortToolCall(e){let r=this.#v.find(n=>n.id===e);if(r)return r.abortController.abort(),!0;if(this.#v.length===0){let n=new AbortController;return n.abort(),this.#v.push({id:e,abortController:n,input:{id:e},name:"bash"}),!0}return!1}async acceptCode(){if(this.#Se()){let e=this.getLinesStats();await this.sendFeedback({position:this.#B,acceptedLines:e.net,linesOfCodeAdded:e.added,linesOfCodeRemoved:e.removed})}}async abort(e=!1){return e&&(this.#m=void 0,this.#l=void 0),this.#R=0,this.#f?(this.#f.abort(),this.#f=void 0,!0):!1}async stopEventLoop(){await this.abort(!0),this.#P?.abort(),this.#P=void 0,this.#y&&this.#y()}requestRefresh(){this.#n.emit("step",{type:"builder-action",action:"refresh",metadata:{}})}async configureDevOrchestrator(e){let r=this.#t?.devServerOrchestrator,n={devCommand:!1,hosts:!1,setupCommand:!1,proxyServer:!1,validateCommand:!1,env:!1,setupResult:void 0,devResult:void 0,validateResult:void 0};if(r){let i=[];e.env&&(this.#W=!0,e.replaceEnvs&&r.clearEnvVariables(),Object.entries(e.env).forEach(([s,o])=>{r.setEnvVariable(s,o??void 0)&&(n.env=!0)})),e.proxyServer?i.push(r?.setProxyServer(e.proxyServer).then(s=>{n.proxyServer=s.updatedProxyServer,n.hosts=s.updatedHosts})):e.proxyPort&&i.push(r?.setPort(e.proxyPort).then(s=>n.proxyServer=s)),e.setupCommand!==void 0||e.setupDependencies!==void 0?i.push(r.setSetupCommand({setupDependencies:e.setupDependencies,setupCommand:e.setupCommand,forceRestart:e.forceSetupCommand}).then(s=>{n.setupCommand=!!s,n.setupResult=s??void 0})):(e.forceSetupCommand||n.env&&r.setupState!=="installed")&&i.push(r?.runSetupCommand().then(s=>{n.setupCommand=!!s,n.setupResult=s??void 0})),e.devCommand!==void 0?i.push(r.setDevCommand(e.devCommand??void 0,e.forceDevCommand).then(s=>{n.devCommand=s.status==="success",n.devResult=s??void 0})):(e.forceDevCommand||n.env)&&i.push(r?.restart().then(s=>{n.devCommand=!0,n.devResult=s??void 0})),e.autoDetectDevServer!==void 0&&i.push(r.setAutoDetectSettings(e.autoDetectDevServer,e.autoDetectDevServerPatterns).then(s=>n.proxyServer=n.proxyServer||s)),e.validateCommand!==void 0&&i.push(r.runValidateCommand(e.validateCommand).then(s=>n.validateResult=s)),await Promise.allSettled(i)}return n}#Ue(){for(let e of Array.from(this.#d.keys()))try{this.disposeTerminal({terminalId:e})}catch{}this.#d.clear()}async#Ce(){if(this.#o.debounceTimer&&clearTimeout(this.#o.debounceTimer),this.#o.pendingEvents=[],this.#o.listeners.clear(),this.#o.watcher){try{await this.#o.watcher.close()}catch{}this.#o.watcher=null}}#qe(){if(this.#o.watcher)return;let e=YT(this.#c),r=s=>{let o=this.#e.relative(this.#c,s).replace(/\\/g,"/");return o?this.#Te(o)?!0:e(o):!1},n=$K.default.watch(this.#c,{ignored:r,ignoreInitial:!0,persistent:!0,awaitWriteFinish:{stabilityThreshold:200,pollInterval:100},ignorePermissionErrors:!0,followSymlinks:!1}),i=(s,o)=>{let a=this.#e.relative(this.#c,o).replace(/\\/g,"/"),c={type:"folder-watch",watchId:"global",event:s,path:a,timestamp:Date.now()};this.#o.pendingEvents.push(c),this.#o.debounceTimer&&clearTimeout(this.#o.debounceTimer),this.#o.debounceTimer=setTimeout(()=>{let u=this.#o.pendingEvents;this.#o.pendingEvents=[];for(let l of u)for(let p of this.#o.listeners)try{p(l)}catch(d){this.#e.Sentry?.captureException(d)}},this.#o.debounceMs)};n.on("add",s=>i("add",s)).on("change",s=>i("change",s)).on("unlink",s=>i("unlink",s)).on("addDir",s=>i("addDir",s)).on("unlinkDir",s=>i("unlinkDir",s)).on("error",s=>{this.#e.Sentry?.captureException(s,{tags:{operation:"global-file-watch"}})}),this.#o.watcher=n,this.#a&&console.log(`\u{1F4C2} Initialized global file watcher on: ${this.#s}`)}subscribeToFileChanges(e){return this.#o.listeners.size===0&&this.#qe(),this.#o.listeners.add(e),this.#a&&console.log(`\u{1F4C2} Subscribed to file changes (${this.#o.listeners.size} active listeners)`),async()=>{this.#o.listeners.delete(e),this.#a&&console.log(`\u{1F4C2} Unsubscribed from file changes (${this.#o.listeners.size} remaining listeners)`),this.#o.listeners.size===0&&this.#o.watcher&&(await this.#Ce(),this.#a&&console.log("\u{1F4C2} Closed global file watcher (no more listeners)"))}}async close(e=!1){if(this.#J)return;if(this.#J=!0,this.#ue.forEach(n=>n()),this.#Ue(),await this.#Ce(),this.#I)try{this.#a&&console.log("\u{1F50C} Cleaning up local MCP servers..."),await this.#I.cleanup()}catch(n){this.#e.Sentry?.captureException(n,{level:"warning",tags:{operation:"local-mcp-cleanup"}})}await this.stopEventLoop(),await this.waitUntilState("close",5e3),this.#n.removeAllListeners(),await Promise.allSettled(this.#O);let r=await this.needsBackup();this.#a&&console.log(`\u{1F50D} Closing code gen server: ${JSON.stringify({uploadGitBackup:e,needsBackup:r})}`),e&&r&&await this.uploadBackup()}async emitGitStatus(){let e=await this.#ze();return e&&(this.#H=e,this.#n.emit("step",e),e.hasMergeConflict?await this.#T():this.#H.hasMergeConflict&&await this.#T()),e}async manualCommit(e){if(!this.#t?.git)return!1;let r=this.getSessionContext();if(!r.beforeCommit){let i=await this.getCurrentCommitHash();i&&(r.beforeCommit=i)}await this.git(["add",e.add]),await this.git(["commit","--quiet","--no-verify","-m",e.commitMessage]);let n=await this.getCurrentCommitHash();return await this.#M({lastCommit:n}),await this.emitGitStatus(),!0}getLastSuggestedAction(){return this.#k}async#T(){let e=this.getSessionContext();if(e.state==="generating"||e.state==="close")return this.#k=void 0,!1;let r=await this.#be(!0);return e=this.getSessionContext(),e.state!=="generating"&&e.state!=="close"?(this.#k=r,this.#n.emit("step",{type:"wait-for-input",state:e.state,suggestion:r,sessionMode:e.sessionMode,hasPlanToApply:this.#w}),!0):!1}async#ze(){if(!this.#t?.git)return null;this.#K++;let e=this.#Se(),r=this.getCommitMode(),n=this.#X(),i=!1,s="",o=null;try{let d=await this.git(["rev-parse","--absolute-git-dir"]);o=this.#e.join(d,"FETCH_HEAD"),zd.default.existsSync(o)&&zd.default.unlinkSync(o)}catch(d){this.#e.Sentry?.captureException(d,{tags:{operation:"codegen-git",endpoint:"getGitStatus"},extra:{fetchHeadFilePath:o,isCheckingGitStatus:this.#K}}),o=null}try{s=await this.git(["fetch","--no-tags","origin",n]),i=!0}catch{i=!1}let a=await this.#e.getRepoInfo(this.#c),c=this.getSessionContext().beforeCommit,u=e?1:0,l=0;if(i)try{let d=FU(await this.git(["rev-list","--left-right","--count","HEAD...FETCH_HEAD"]));u=d.ahead,l=d.behind}catch(d){let h=null;if(o)try{h=await this.#e.readFile(this.#e.join(this.#c,".git/FETCH_HEAD")),h=`FETCH_HEAD: ${h}`}catch(m){h=`FETCH_HEAD FAILED: ${String(m)}`}else h="FETCH_HEAD MISSING";this.#e.Sentry?.captureException(d,{tags:{operation:"codegen-git",endpoint:"getGitStatus"},extra:{fetchOutput:s,fetchHead:h,remoteBranch:n,currentBranch:a.currentBranch,currentCommit:a.commit,isCheckingGitStatus:this.#K}})}else!i&&r!=="commits"&&c&&c!==a.commit&&(u=Math.max(u,1));let p=await this.#S();return this.#K--,{type:"git",remoteBranchExists:i,hasGeneratingPlaceholder:await this.#Ye(),isSessionDirty:e||!!c&&c!==a.commit,canSync:(u>0||l>0)&&!p,canPush:(u>0||l>0)&&!p,canPull:l>0&&i,ahead:u,hasMergeConflict:p,commitMode:r,behind:l,currentCommit:a.commit,currentBranch:a.currentBranch,remoteBranch:n}}#Ee(){let e=this.getSessionContext(),r=e.turns,n=[];n.push({type:"session",title:e.title,beforeCommit:e.beforeCommit,createdUnixTime:e.createdUnixTime,updatedUnixTime:e.updatedUnixTime,turns:e.turns.length,id:e.sessionId,lastCompletionId:this.getLastCompletionId(),sessionMode:e.sessionMode,fusionConfig:Ax(this.#r)});for(let i of r){n.push({type:"user",displayPrompt:i.userMessage?i.userMessage.displayPrompt??i.userMessage.userPrompt:void 0,attachments:i.userMessage?.attachments,id:i.completionId,user:i.user,role:i.user.role,compacting:!1});for(let s of i.actions)(s.type==="tool"||s.type==="text"||s.type==="thinking")&&(n.push({type:"start",name:s.type,content:"",id:s.id??"",filePath:s.filePath??"",title:s.actionTitle??s.artifactTitle??s.filePath??""}),n.push({type:"delta",name:s.type,delta:s.content}),s.type==="tool"?n.push({type:s.type,id:s.id,name:s.filePath,content:s.content}):s.type==="thinking"?n.push({type:"planning",content:s.content}):s.type==="text"&&n.push({type:"text",content:s.content}))}return n}connectToEventLoop(e,r){if(e){let n=[],i=this.getSessionContext();n.push({type:"state",newState:"replay",abortable:!1,previousState:i.state}),this.#Q&&n.push(this.#Q),this.#H&&n.push(this.#H),n.push(...this.#Ee());let s=this.#q?_o(this.#q):void 0;if(s)switch(s.type){case"file":case"diff":case"text":case"thinking":case"suggestion":case"tool":n.push({type:"start",id:s.id,name:s.type,filePath:s.filePath??"",title:s.actionTitle??s.artifactTitle??"",content:""}),n.push({type:"delta",name:s.type,delta:s.content});break}n.push({type:"terminals",terminals:this.#oe()});let o=this.#t?.devServerOrchestrator;o?(n.push({type:"dev-server",devServerState:o.devState,setupState:o.setupState,httpServerState:o.httpServerState.state,devCommand:o.devCommand,setupCommand:o.setupCommand,proxyServer:o.proxyTarget,proxyServerSelection:o.proxyServerSelection,remoteAddress:o.httpServerState.remoteAddress,remotePort:o.httpServerState.remotePort,proxyServerReachable:!!this.#r?.isLocal}),o.setupState!=="installed"&&n.push({type:"stdio",id:"setupCommand",command:o.setupCommand??"",content:o.getSetupWrite(),source:"run-command",stream:"stdout"}),n.push({type:"stdio",id:"devServer",command:o.devCommand,content:o.getDevWrite(),source:"run-command",stream:"stdout"})):r({type:"dev-server",devServerState:"running",setupState:"installed",httpServerState:"ok-2xx",devCommand:this.#r?.devCommand,setupCommand:this.#r?.setupCommand,proxyServer:this.#r?.serverUrl,proxyServerSelection:"hardcoded",remoteAddress:void 0,remotePort:void 0,proxyServerReachable:!!this.#r?.isLocal}),n.push({type:"state",newState:i.state,abortable:i.state==="generating",previousState:"replay"}),this.#F&&i.state!=="generating"&&n.push({type:"wait-for-input",state:i.state,suggestion:this.#k,sessionMode:i.sessionMode,hasPlanToApply:this.#w}),r({type:"batch",steps:n})}return this.#n.on("step",r),this.waitForEventLoop(),()=>{this.#n.off("step",r)}}waitUntilPendingPromises(){return Promise.allSettled(this.#O).then(()=>id())}waitUntilIdle(){return this.waitForEventLoop(),id().then(()=>this.waitUntilPendingPromises()).then(()=>{let e=this.getSessionContext();return console.log(`waitUntilIdle: starting in ${e.state}`),e.state==="generating"?(0,O0.once)(this.#n,"idle"):Promise.resolve(void 0)}).then(()=>this.waitUntilPendingPromises()).then(()=>console.log(`waitUntilIdle: idle reached in ${this.getSessionContext().state}`))}waitForEventLoop(){return this.#F?this.#F:this.#F=this.#Ge()}async#Ge(){if(this.#F||this.#P)throw new Error("Event loop already started");let e=_U(),r=c=>{c.type==="error"&&this.#R>0&&(BK.includes(c.code)||(c.restoreCredits=this.#R,this.#R=0,wU(this.#e,this.#u,s.sessionId,c.restoreCredits).catch(u=>{this.#e.Sentry?.captureException(u)}))),this.#n.emit("step",c)};this.#P=new AbortController;let n=this.#P.signal,i=this.#t?.devServerOrchestrator,s=this.getSessionContext(),o=()=>this.getLastCompletionId();this.#e.Sentry?.setContext("codeGen",{sessionId:s.sessionId,get completionId(){return o()}});let a=this.emitGitStatus();this.#ae(a),await a,i?.setupState==="not-installed"&&this.runSetupCommand();try{for(;!n.aborted;){this.#f=void 0;let c=this.getNextMessage();if(c.shouldWait){await this.#we();let l=await this.#T();if(n.aborted)break;l&&RU(c.promise,500).then(p=>{p&&(console.log("emit: idle (next message)"),this.#n.emit("idle"))})}let u=await c.promise;if(n.aborted)break;if(u){try{this.#k=void 0,u.logsCheckpoint&&i?.addCheckpoint(),this.#f=new AbortController;let l=Da([n,this.#f.signal]);if(l?.aborted)throw Hs();if(this.#b("generating"),u.syncChanges){await this.syncChangesFromRemote(u.syncChanges);let d=await this.#be(!1);d&&d.healthStatus.hasMergeConflict&&(u=ah(d.userMessage,u))}u.sessionMode&&u.sessionMode!==s.sessionMode&&this.switchSessionMode(u.sessionMode),await this.#Ve(u,l,r),this.#b("success"),(u.autoPush??"none")!=="none"&&await this.pushChanges({actor:"agent",pullFirst:u.autoPush==="merge-push",forcePush:u.autoPush==="force-push"}),this.#k=void 0}catch(l){l instanceof Error?l.name==="AbortError"?(r({type:"user-abort",hasContinueMessage:!!this.#l}),this.#b("abort")):l instanceof yt?(this.#m=void 0,r({type:"error",code:"cli-network-error",message:l.message}),this.#e.Sentry?.captureException(l,{tags:{operation:"codegen-stream"}}),this.#b("error")):l instanceof bt?(this.#m=void 0,r({type:"error",code:"unknown",message:"An internal error occurred. Please try again."}),this.#e.Sentry?.captureException(l,{tags:{operation:"codegen-stream"}}),this.#b("error")):l instanceof ts?(this.#m=void 0,r({type:"error",code:l.code,message:l.message}),BK.includes(l.code)||this.#e.Sentry?.captureException(l,{tags:{operation:"codegen-stream"}}),this.#b("error")):(this.#m=void 0,r({type:"error",code:"cli-genetic-error",message:l.message,metadata:{error:l}}),this.#e.Sentry?.captureException(l,{tags:{operation:"codegen-stream"}}),this.#b("error")):this.#b("error")}this.#Ae++}}}catch(c){throw this.#e.Sentry?.captureException(c,{level:"fatal"}),c}finally{this.#P=void 0,this.#F=void 0,e()}console.log("emit: idle (close)"),this.#n.emit("idle"),this.#b("close")}async#Ve(e,r,n){this.#R=0;let i=this.getSessionContext(),s=e.maxCompletions??AFe,o=0,a=0,c=0,u=!0,l=!1,p,d=0;try{for(;;){if(r?.aborted)throw Hs();try{if(p||(p=await this.#We(e,u,r,n),p.modelOverride=e.modelOverride),u=!1,p.user.role==="user"){let h=p.files.filter(m=>(m.importance??0)>2.5&&m.content).map(m=>({filePath:m.filePath,size:m.content?.length??0,isCustomInstruction:!1,wasIncluded:m.wasIncluded}));i.customInstructions.forEach(m=>{m.filePath&&h.push({filePath:m.filePath,size:m.content?.length??0,isCustomInstruction:!0,wasIncluded:!0})}),n({type:"user-input",prompt:p.userMessage?.displayPrompt??p.userPrompt,files:h})}try{let{shouldContinue:h,completions:m,filesChanged:g}=await this.#He(i,p,r,n);p=void 0,a=0,o++,l||=g,c+=m,this.#m=void 0;let y=await this.emitGitStatus();if(y){let b=this.getAiBranch();if(y.currentBranch!==b){if(c-1>=s){n({type:"error",code:"ask-to-continue",message:"The agent has been working for a while. Do you want to continue?"});break}u=!0,e={userPrompt:`Seems like the current git branch is ${y.currentBranch}, however, this is a broken state in Fusion. Make sure to git checkout into "${b}", before finishing.`,displayPrompt:""};continue}}if(!h){let b=this.#t?.devServerOrchestrator;if(b?.hasValidateCommand&&e.runValidateCommand&&d<2&&l){d++;let D=await b.runValidateCommand(void 0,r);if(D.status==="failure")this.sendMessage({user:e.user,maxCompletions:e.maxCompletions,runValidateCommand:!0,sessionMode:e.sessionMode,userPrompt:`The validate command (failed, code ${D.code}):
2002
+ `),w=[],v=null;for(let C of D)if(C.trim())try{let E=JSON.parse(C);if(E.type==="match"){let P=E.data.path.text,A=E.data.line_number,F=E.data.lines.text.trimEnd(),_=E.data.submatches||[],G,$;_.length>0&&(G=_[0].start,$=_[0].end),y.add(P);let K={filePath:P,lineNumber:A,lineContent:F,columnStart:G,columnEnd:$,contextBefore:w,contextAfter:[]};if(w=[],v=K,g.push(K),g.length>=o)break}else if(E.type==="context"){let P=E.data.line_number,A=E.data.lines.text.trimEnd();v&&P>v.lineNumber?v.contextAfter.push(A):w.push(A)}}catch{continue}let x=g.length>=o;p({matches:g,totalMatches:g.length,filesWithMatches:y.size,truncated:x})}})})}async collectRepoMetrics(e={}){let{collectRepoMetrics:r}=await Promise.resolve().then(()=>(MK(),OK)),n=this.#c;return e.rootPath&&(n=this.#e.join(this.#c,e.rootPath)),r(this.#e,n)}getSessionId(){return this.getSessionContext().sessionId}getSpaceId(){return this.#u.builderPublicKey}async revertToCommitHash(e){this.#w=!1,await this.abortMerge(!1),await this.git(["revert","--no-commit",`${e}..HEAD`]),await this.git(["commit","--allow-empty","--quiet","--no-verify","-m","Revert changes"]);let n=(await this.emitGitStatus())?.currentCommit;if(!n){this.#e.Sentry?.captureException(new Error("Failed to get current commit hash after revert"),{tags:{operation:"codegen-git",endpoint:"revertToCommitHash"}});return}this.requestRefresh(),await this.#M({lastCommit:n})}async resetToCommitHash(e){if(this.#w=!1,await this.abortMerge(!1),await this.git(["reset","--quiet","--hard",e]),(await this.emitGitStatus())?.currentCommit!==e)throw new Error("Failed to reset commit hash");this.requestRefresh()}async restore({location:e,predicate:r,revert:n=!1,dryRun:i=!1,forceReplay:s=!1,debug:o}){let a=this.getSessionContext(),c=a.turns.length,u=null;for(let m=c-1;m>=-1;m--)if(r(m>=0?a.turns[m]:null,m)){u=m;break}if(u===null)return{undone:null,message:"Could not find the target to restore to, the completion id could be wrong"};n||await this.abort(!0);let l=new Map,p=!!this.#t?.git,d=a.turns,h=Math.max(0,e==="before"?u:u+1);for(let m=d.length-1;m>=h;m--){let g=d[m];for(let y of g.applyResults)l.set(y.filePath,y.oldContent??"")}if(!i){let m;if(p){u===-1?a.beforeCommit?m=a.beforeCommit:d.length>0&&(m=d[0].beforeCommit):u<d.length&&(e==="after"?(m=d[u].afterCommit,!m&&u+1<d.length&&(m=d[u+1].beforeCommit)):m=d[u].beforeCommit);let D={commitHash:m,sessionId:a.sessionId,sessionBeforeCommit:a.beforeCommit,turnsLength:d.length,targetIndex:u,currentTurn:d[d.length-1],targetTurn:d[u],targetTurnNext:d[u+1],location:e,forceReplay:s,dryRun:i,debug:o};if(!m)return this.#e.Sentry?.captureException(new Error("No commit hash found for restore"),{tags:{operation:"codegen-git",endpoint:"revertToCommitHash"},contexts:{restore:D}}),{undone:null,message:"Could not find the target to restore to, the git history is missing"};try{n?await this.revertToCommitHash(m):await this.resetToCommitHash(m)}catch(w){return this.#e.Sentry?.captureException(new Error("Error resetting git",{cause:w}),{tags:{operation:"codegen-git",endpoint:"resetToCommitHash"},contexts:{restore:D}}),{undone:null,message:"Failed to reset/restore, the file history is missing"}}}else for(let[D,w]of l.entries())try{w?await this.writeFile(D,w):await this.deleteFile(D)}catch{}if(n)return{undone:[],message:"The revert operation was successful"};let g=d.splice(h,d.length-h),y=_o(d);y&&y?.afterCommit!==m&&(this.#e.Sentry?.captureException(new Error("Reset After commit hash mismatch"),{tags:{operation:"codegen-git",endpoint:"resetToCommitHash"},extra:{lastTurn:y,commitHash:m}}),y.lastCommit=m,await this.#M({completionId:y.completionId,lastCommit:m}));let b=y?.completionId;if(g.length>0&&(await gA(this.#e,this.#u,{lastCompletionId:b,sessionId:a.sessionId},!!this.#a),a.updatedUnixTime=Date.now()),s){let D=a.state;this.#n.emit("step",{type:"batch",steps:[{type:"state",newState:"replay",abortable:!1,previousState:D},...this.#Ee(),{type:"restore",files:Array.from(l.keys()),lastCompletionId:b,location:e},{type:"state",newState:D,abortable:!1,previousState:"replay"}]})}else g.length>0&&this.#n.emit("step",{type:"restore",files:Array.from(l.keys()),lastCompletionId:b,location:e})}return await this.#we(),{undone:Array.from(l.keys()),message:"The restore operation was successful"}}async#we(e){return await this.#t?.devServerOrchestrator?.ensureDevCommand(e)}async restoreFromCompletionId({location:e,completionId:r,forceReplay:n}){let i=this.getSessionContext();return i.turns.find(o=>o.completionId===r)?this.restore({location:e,predicate:o=>o?.completionId===r,forceReplay:n,debug:`restore to: ${r}`}):(await this.#U,i.turns=[],i.canLoadMore=!0,await gA(this.#e,this.#u,{sessionId:i.sessionId,lastCompletionId:r},!!this.#a),await this.loadMoreTurns(),this.restore({location:e,predicate:()=>!0,forceReplay:!0,debug:"restore after history"}))}async restoreBeforeCompletionId(e){return this.restoreFromCompletionId({location:"before",completionId:e,forceReplay:!1})}async undoLastUserMessage(e=!1){return this.restore({location:"before",predicate:r=>r?.user.role==="user",dryRun:e})}getLastUserCompletionId(){let e=this.getSessionContext();return vU(e)?.completionId}getLastCompletionId(){let e=this.getSessionContext();return mA(e)?.completionId}getCurrentState(){return this.getSessionContext().state}getLastApplyResultsTurn(){let e=this.getSessionContext();return xU(e)}getLastTurn(){let e=this.getSessionContext();return mA(e)}getNextUrl(){return this.getLastTurn()?.nextUrl}#Le(){let e=this.#l;if(e)return this.#l=void 0,this.#m=e,e}getNextMessage(){let e=new Promise(r=>{this.#l?r():this.#y=r}).then(()=>{let r=this.#l;if(r)return!r.dropAbortedPrompt&&this.#m&&!r.queue&&(r=ah(this.#m,r)),this.#l=void 0,this.#m=r,r});return{shouldWait:!this.#l,promise:e}}async sendFeedback(e){if(process.env.NODE_ENV==="test")return;Je("quality code feedback given",{spaceId:this.#u.builderPublicKey,sentiment:e.feedbackSentiment,mode:"cli"});let r=e.id??this.getLastCompletionId();r&&await this.#$e({...e,id:r})}#M(e){let r=e.completionId;if(!r){let i=this.getLastTurn();i&&e.lastCommit&&(i.lastCommit=e.lastCommit),r=i?.completionId}let n=hA(this.#e,this.#u,"/codegen/finalize",{completionId:r,projectId:this.#r?.projectId,branchName:this.#r?.branchName,userCompletionId:this.getLastUserCompletionId(),sessionId:this.getSessionId(),...e});return this.#ae(n),n}#$e(e){let r=hA(this.#e,this.#u,"/codegen/feedback",e);return this.#ae(r),r}#ae(e){this.#O.push(e),e.finally(()=>{let r=this.#O.indexOf(e);r!==-1&&this.#O.splice(r,1)})}async lastTurnHasChanges(){let e=await this.undoLastUserMessage(!0);return e.undone?e.undone.length>0:!1}#v(e){let r=this.getSessionContext(),n=r.state;n!==e&&(r.state=e,this.#n.emit("step",{type:"state",abortable:e==="generating",previousState:n,newState:e}))}waitUntilState(e,r=1e4){return new Promise(n=>{if(this.getSessionContext().state===e){n();return}let s,o=a=>{a.type==="state"&&a.newState===e&&(clearTimeout(s),this.#n.removeListener("step",o),n())};s=setTimeout(()=>{this.#n.removeListener("step",o),n()},r),this.#n.on("step",o)})}async clearSession(){let e=this.getSessionContext();e.turns=[],e.customInstructions=await this.#Y(),this.#W=!0,this.#w=!1}async sendMessage(e){let r;if(Array.isArray(e)){r=this.#l;for(let n of e)r?r=ah(r,n):r=n}else r=e,!e.dropAbortedPrompt&&this.#l&&(r=ah(this.#l,e));r&&(this.#l=r,this.#w=!1,this.cancelAllPendingToolFulfilments(),r.queue||await this.abort(),this.#y&&this.#y()),await id()}async spawnAgent(e){let{prompt:r,user:n,onStep:i,signal:s,maxCompletions:o=50,sessionId:a,tools:c=["Read","LS","Glob","ReadRule","Grep","WebSearch","ExplorationMetadata"],model:u="opa5-mini",mode:l="quality-v4-agent",systemPrompt:p,subagent_type:d,includeMemories:h,needDevServer:m}=e,g=this.#t?.devServerOrchestrator;if(m){if(!g)return{success:!1,response:`The ${d} agent can not be used on this session. Do no try again.`,metadata:{important_files:[]}};if(g.httpServerState.state==="stopped"||g.httpServerState.state==="connecting"||g.httpServerState.state==="error-fetch")try{if(g.state==="not-installed")throw new Error(`The ${d} agent can not be used until the setupCommand finish successfully. However, the dev server is not installed.`);if(g.state==="install-failed")throw new Error(`The ${d} agent can not be used until the setupCommand finish successfully. However, last time we try to run the install script, it failed.`);if(g.state==="install-aborted")throw new Error(`The ${d} agent can not be used until the setupCommand finish successfully. However, last time we try to run the install script, it was aborted.`);g.state==="installing"&&await NU(g.setupCommandPromise,s),await g.ensureDevCommand(s),await g.waitUntilServer(s)}catch(A){return{success:!1,response:A instanceof Error?A.message:String(A),metadata:{important_files:[]}}}}let y=this.#B.replace(/-agent$/,""),b={};if(c.includes("mcp:chrome")){let A=await this.#je(s);if(!A)return{success:!1,response:"Failed to get Chrome WebSocket server URL",metadata:{important_files:[]}};b.chrome={command:"npx",args:["-y","chrome-devtools-mcp@latest","--wsEndpoint",A,"--categoryEmulation=false","--viewport=1280x720"]}}let D=p?vc(p,{FUSION_TEST_PROMPT:"",...g?.envVars??process.env}):void 0,w=new t({sys:this.#e,credentials:this.#u,position:`${y}-agent`,mode:l,modelOverride:bP(u),sessionOrCompletionId:a,workingDirectory:this.#s,mcpServers:!1,autoImportLocalMCPs:!1,fusionConfig:this.#r,enabledTools:c,builtInMCPServerConfig:b,systemPromptOverride:D});await w.initializeSession({skipSessionLoading:!0});let v={important_files:[]},x=[],C=w.connectToEventLoop(!1,A=>{A.type==="tool_result"&&A.result.tool_name==="ExplorationMetadata"&&typeof A.result.content=="string"?v=JSON.parse(A.result.content):i&&i(A,d);try{if(A.type==="tool_result"){let F=A.result.content;if(Array.isArray(F)){let _=F.filter(G=>G.type==="image"&&G.source.type==="base64");x.push(..._)}}}catch{}}),E=async()=>{C(),await w.close(!1)};if(s?.aborted)return await E(),{success:!1,response:"Agent task aborted",metadata:{important_files:[]}};let P=async()=>{await E()};s&&s.addEventListener("abort",P);try{await w.sendMessage({userPrompt:r,user:n,maxCompletions:o,category:"background-subagent",includeRelevantMemories:h}),await w.waitUntilIdle();let A=w.getLastTurn();if(!A)return{success:!1,response:"Agent task failed",metadata:{important_files:[]}};let F=A.actions.filter(_=>_.type==="text").map(_=>_.content).join(`
2003
+ `);return x.length>1&&(async()=>{try{let _=w.getSessionId(),G="/tmp/gifs",$=`${G}/${_}.gif`;await zd.default.promises.mkdir(G,{recursive:!0});let K=await lU(x,{framerate:1,outputPath:$,cleanup:!0,sys:this.#e});K&&console.log(`[${d}] Generated GIF from ${x.length} images: ${K}`)}catch(_){console.warn(`[${d}] Failed to generate GIF (non-critical): ${_ instanceof Error?_.message:String(_)}`)}})(),{success:!0,response:F,metadata:v,lastTurn:A}}catch(A){return{success:!1,response:`Agent task failed: ${A instanceof Error?A.message:String(A)}`,metadata:{important_files:[]}}}finally{s&&s.removeEventListener("abort",P),await E()}}setProxyOrigin(e){this.#ne=e}async#je(e){let r=this.#u,n=new URL(`${Be}/codegen/get-browser-connection`);r.builderPublicKey&&n.searchParams.set("apiKey",r.builderPublicKey),r.userId&&n.searchParams.set("userId",r.userId);let i={"Content-Type":"application/json"};r.builderPrivateKey&&(i.Authorization=`Bearer ${r.builderPrivateKey}`);let s=await Fe(n,{method:"POST",body:JSON.stringify({sessionId:this.getSessionId(),projectId:this.#b,branchName:this.#z,proxyOrigin:this.#ne,proxyDst:this.#ge}),keepalive:!0,headers:i,signal:e});if(!s.ok)return;let o=await s.json();if(typeof o.wsUrl=="string")return o.wsUrl}getTurns(){let e=this.getSessionContext();return structuredClone(e.turns)}getSessionContext(){if(!this.#p)throw new Error("Session context not initialized");return this.#p}async runSetupCommand(){return await this.#t?.devServerOrchestrator?.runSetupCommand()}abortSetupCommand(){return this.#t?.devServerOrchestrator?.abortSetupCommand()}abortValidateCommand(){return this.#t?.devServerOrchestrator?.abortValidateCommand()}toolsRunning(){return this.#x.length>0}abortAllTools(){for(let e of this.#x)e.abortController.abort()}toolFullfilment(e,r){return typeof r=="string"&&(r={toolResult:r,isError:!1}),this.fulfillToolCall(e,r)}cancelAllPendingToolFulfilments(){for(let e of Array.from(this.#_.keys()))this.fulfillToolCall(e,{toolResult:"Aborted by the user. So the task could not be completed.",isError:!0,title:"Aborted by the user."});this.#_.clear()}fulfillToolCall(e,r){let n=this.#_.get(e);return n?(n(r),this.#_.delete(e),!0):!1}abortToolCall(e){let r=this.#x.find(n=>n.id===e);if(r)return r.abortController.abort(),!0;if(this.#x.length===0){let n=new AbortController;return n.abort(),this.#x.push({id:e,abortController:n,input:{id:e},name:"bash"}),!0}return!1}async acceptCode(){if(this.#Se()){let e=this.getLinesStats();await this.sendFeedback({position:this.#B,acceptedLines:e.net,linesOfCodeAdded:e.added,linesOfCodeRemoved:e.removed})}}async abort(e=!1){return e&&(this.#m=void 0,this.#l=void 0),this.#R=0,this.#f?(this.#f.abort(),this.#f=void 0,!0):!1}async stopEventLoop(){await this.abort(!0),this.#P?.abort(),this.#P=void 0,this.#y&&this.#y()}requestRefresh(){this.#n.emit("step",{type:"builder-action",action:"refresh",metadata:{}})}async configureDevOrchestrator(e){let r=this.#t?.devServerOrchestrator,n={devCommand:!1,hosts:!1,setupCommand:!1,proxyServer:!1,validateCommand:!1,env:!1,setupResult:void 0,devResult:void 0,validateResult:void 0};if(r){let i=[];e.env&&(this.#W=!0,e.replaceEnvs&&r.clearEnvVariables(),Object.entries(e.env).forEach(([s,o])=>{r.setEnvVariable(s,o??void 0)&&(n.env=!0)})),e.proxyServer?i.push(r?.setProxyServer(e.proxyServer).then(s=>{n.proxyServer=s.updatedProxyServer,n.hosts=s.updatedHosts})):e.proxyPort&&i.push(r?.setPort(e.proxyPort).then(s=>n.proxyServer=s)),e.setupCommand!==void 0||e.setupDependencies!==void 0?i.push(r.setSetupCommand({setupDependencies:e.setupDependencies,setupCommand:e.setupCommand,forceRestart:e.forceSetupCommand}).then(s=>{n.setupCommand=!!s,n.setupResult=s??void 0})):(e.forceSetupCommand||n.env&&r.setupState!=="installed")&&i.push(r?.runSetupCommand().then(s=>{n.setupCommand=!!s,n.setupResult=s??void 0})),e.devCommand!==void 0?i.push(r.setDevCommand(e.devCommand??void 0,e.forceDevCommand).then(s=>{n.devCommand=s.status==="success",n.devResult=s??void 0})):(e.forceDevCommand||n.env)&&i.push(r?.restart().then(s=>{n.devCommand=!0,n.devResult=s??void 0})),e.autoDetectDevServer!==void 0&&i.push(r.setAutoDetectSettings(e.autoDetectDevServer,e.autoDetectDevServerPatterns).then(s=>n.proxyServer=n.proxyServer||s)),e.validateCommand!==void 0&&i.push(r.runValidateCommand(e.validateCommand).then(s=>n.validateResult=s)),await Promise.allSettled(i)}return n}#Ue(){for(let e of Array.from(this.#d.keys()))try{this.disposeTerminal({terminalId:e})}catch{}this.#d.clear()}async#Ce(){if(this.#o.debounceTimer&&clearTimeout(this.#o.debounceTimer),this.#o.pendingEvents=[],this.#o.listeners.clear(),this.#o.watcher){try{await this.#o.watcher.close()}catch{}this.#o.watcher=null}}#qe(){if(this.#o.watcher)return;let e=YT(this.#c),r=s=>{let o=this.#e.relative(this.#c,s).replace(/\\/g,"/");return o?this.#Te(o)?!0:e(o):!1},n=$K.default.watch(this.#c,{ignored:r,ignoreInitial:!0,persistent:!0,awaitWriteFinish:{stabilityThreshold:200,pollInterval:100},ignorePermissionErrors:!0,followSymlinks:!1}),i=(s,o)=>{let a=this.#e.relative(this.#c,o).replace(/\\/g,"/"),c={type:"folder-watch",watchId:"global",event:s,path:a,timestamp:Date.now()};this.#o.pendingEvents.push(c),this.#o.debounceTimer&&clearTimeout(this.#o.debounceTimer),this.#o.debounceTimer=setTimeout(()=>{let u=this.#o.pendingEvents;this.#o.pendingEvents=[];for(let l of u)for(let p of this.#o.listeners)try{p(l)}catch(d){this.#e.Sentry?.captureException(d)}},this.#o.debounceMs)};n.on("add",s=>i("add",s)).on("change",s=>i("change",s)).on("unlink",s=>i("unlink",s)).on("addDir",s=>i("addDir",s)).on("unlinkDir",s=>i("unlinkDir",s)).on("error",s=>{this.#e.Sentry?.captureException(s,{tags:{operation:"global-file-watch"}})}),this.#o.watcher=n,this.#a&&console.log(`\u{1F4C2} Initialized global file watcher on: ${this.#s}`)}subscribeToFileChanges(e){return this.#o.listeners.size===0&&this.#qe(),this.#o.listeners.add(e),this.#a&&console.log(`\u{1F4C2} Subscribed to file changes (${this.#o.listeners.size} active listeners)`),async()=>{this.#o.listeners.delete(e),this.#a&&console.log(`\u{1F4C2} Unsubscribed from file changes (${this.#o.listeners.size} remaining listeners)`),this.#o.listeners.size===0&&this.#o.watcher&&(await this.#Ce(),this.#a&&console.log("\u{1F4C2} Closed global file watcher (no more listeners)"))}}async close(e=!1){if(this.#J)return;if(this.#J=!0,this.#ue.forEach(n=>n()),this.#Ue(),await this.#Ce(),this.#I)try{this.#a&&console.log("\u{1F50C} Cleaning up local MCP servers..."),await this.#I.cleanup()}catch(n){this.#e.Sentry?.captureException(n,{level:"warning",tags:{operation:"local-mcp-cleanup"}})}await this.stopEventLoop(),await this.waitUntilState("close",5e3),this.#n.removeAllListeners(),await Promise.allSettled(this.#O);let r=await this.needsBackup();this.#a&&console.log(`\u{1F50D} Closing code gen server: ${JSON.stringify({uploadGitBackup:e,needsBackup:r})}`),e&&r&&await this.uploadBackup()}async emitGitStatus(){let e=await this.#ze();return e&&(this.#H=e,this.#n.emit("step",e),e.hasMergeConflict?await this.#T():this.#H.hasMergeConflict&&await this.#T()),e}async manualCommit(e){if(!this.#t?.git)return!1;let r=this.getSessionContext();if(!r.beforeCommit){let i=await this.getCurrentCommitHash();i&&(r.beforeCommit=i)}await this.git(["add",e.add]),await this.git(["commit","--quiet","--no-verify","-m",e.commitMessage]);let n=await this.getCurrentCommitHash();return await this.#M({lastCommit:n}),await this.emitGitStatus(),!0}getLastSuggestedAction(){return this.#k}async#T(){let e=this.getSessionContext();if(e.state==="generating"||e.state==="close")return this.#k=void 0,!1;let r=await this.#be(!0);return e=this.getSessionContext(),e.state!=="generating"&&e.state!=="close"?(this.#k=r,this.#n.emit("step",{type:"wait-for-input",state:e.state,suggestion:r,sessionMode:e.sessionMode,hasPlanToApply:this.#w}),!0):!1}async#ze(){if(!this.#t?.git)return null;this.#K++;let e=this.#Se(),r=this.getCommitMode(),n=this.#X(),i=!1,s="",o=null;try{let d=await this.git(["rev-parse","--absolute-git-dir"]);o=this.#e.join(d,"FETCH_HEAD"),zd.default.existsSync(o)&&zd.default.unlinkSync(o)}catch(d){this.#e.Sentry?.captureException(d,{tags:{operation:"codegen-git",endpoint:"getGitStatus"},extra:{fetchHeadFilePath:o,isCheckingGitStatus:this.#K}}),o=null}try{s=await this.git(["fetch","--no-tags","origin",n]),i=!0}catch{i=!1}let a=await this.#e.getRepoInfo(this.#c),c=this.getSessionContext().beforeCommit,u=e?1:0,l=0;if(i)try{let d=FU(await this.git(["rev-list","--left-right","--count","HEAD...FETCH_HEAD"]));u=d.ahead,l=d.behind}catch(d){let h=null;if(o)try{h=await this.#e.readFile(this.#e.join(this.#c,".git/FETCH_HEAD")),h=`FETCH_HEAD: ${h}`}catch(m){h=`FETCH_HEAD FAILED: ${String(m)}`}else h="FETCH_HEAD MISSING";this.#e.Sentry?.captureException(d,{tags:{operation:"codegen-git",endpoint:"getGitStatus"},extra:{fetchOutput:s,fetchHead:h,remoteBranch:n,currentBranch:a.currentBranch,currentCommit:a.commit,isCheckingGitStatus:this.#K}})}else!i&&r!=="commits"&&c&&c!==a.commit&&(u=Math.max(u,1));let p=await this.#S();return this.#K--,{type:"git",remoteBranchExists:i,hasGeneratingPlaceholder:await this.#Ye(),isSessionDirty:e||!!c&&c!==a.commit,canSync:(u>0||l>0)&&!p,canPush:(u>0||l>0)&&!p,canPull:l>0&&i,ahead:u,hasMergeConflict:p,commitMode:r,behind:l,currentCommit:a.commit,currentBranch:a.currentBranch,remoteBranch:n}}#Ee(){let e=this.getSessionContext(),r=e.turns,n=[];n.push({type:"session",title:e.title,beforeCommit:e.beforeCommit,createdUnixTime:e.createdUnixTime,updatedUnixTime:e.updatedUnixTime,turns:e.turns.length,id:e.sessionId,lastCompletionId:this.getLastCompletionId(),sessionMode:e.sessionMode,fusionConfig:Ax(this.#r)});for(let i of r){n.push({type:"user",displayPrompt:i.userMessage?i.userMessage.displayPrompt??i.userMessage.userPrompt:void 0,attachments:i.userMessage?.attachments,id:i.completionId,user:i.user,role:i.user.role,compacting:!1});for(let s of i.actions)(s.type==="tool"||s.type==="text"||s.type==="thinking")&&(n.push({type:"start",name:s.type,content:"",id:s.id??"",filePath:s.filePath??"",title:s.actionTitle??s.artifactTitle??s.filePath??""}),n.push({type:"delta",name:s.type,delta:s.content}),s.type==="tool"?n.push({type:s.type,id:s.id,name:s.filePath,content:s.content}):s.type==="thinking"?n.push({type:"planning",content:s.content}):s.type==="text"&&n.push({type:"text",content:s.content}))}return n}connectToEventLoop(e,r){if(e){let n=[],i=this.getSessionContext();n.push({type:"state",newState:"replay",abortable:!1,previousState:i.state}),this.#Q&&n.push(this.#Q),this.#H&&n.push(this.#H),n.push(...this.#Ee());let s=this.#q?_o(this.#q):void 0;if(s)switch(s.type){case"file":case"diff":case"text":case"thinking":case"suggestion":case"tool":n.push({type:"start",id:s.id,name:s.type,filePath:s.filePath??"",title:s.actionTitle??s.artifactTitle??"",content:""}),n.push({type:"delta",name:s.type,delta:s.content});break}n.push({type:"terminals",terminals:this.#oe()});let o=this.#t?.devServerOrchestrator;o?(n.push({type:"dev-server",devServerState:o.devState,setupState:o.setupState,httpServerState:o.httpServerState.state,devCommand:o.devCommand,setupCommand:o.setupCommand,proxyServer:o.proxyTarget,proxyServerSelection:o.proxyServerSelection,remoteAddress:o.httpServerState.remoteAddress,remotePort:o.httpServerState.remotePort,proxyServerReachable:!!this.#r?.isLocal}),o.setupState!=="installed"&&n.push({type:"stdio",id:"setupCommand",command:o.setupCommand??"",content:o.getSetupWrite(),source:"run-command",stream:"stdout"}),n.push({type:"stdio",id:"devServer",command:o.devCommand,content:o.getDevWrite(),source:"run-command",stream:"stdout"})):r({type:"dev-server",devServerState:"running",setupState:"installed",httpServerState:"ok-2xx",devCommand:this.#r?.devCommand,setupCommand:this.#r?.setupCommand,proxyServer:this.#r?.serverUrl,proxyServerSelection:"hardcoded",remoteAddress:void 0,remotePort:void 0,proxyServerReachable:!!this.#r?.isLocal}),n.push({type:"state",newState:i.state,abortable:i.state==="generating",previousState:"replay"}),this.#F&&i.state!=="generating"&&n.push({type:"wait-for-input",state:i.state,suggestion:this.#k,sessionMode:i.sessionMode,hasPlanToApply:this.#w}),r({type:"batch",steps:n})}return this.#n.on("step",r),this.waitForEventLoop(),()=>{this.#n.off("step",r)}}waitUntilPendingPromises(){return Promise.allSettled(this.#O).then(()=>id())}waitUntilIdle(){return this.waitForEventLoop(),id().then(()=>this.waitUntilPendingPromises()).then(()=>{let e=this.getSessionContext();return this.#a&&console.log(`waitUntilIdle: starting in ${e.state}`),e.state==="generating"?(0,O0.once)(this.#n,"idle"):Promise.resolve(void 0)}).then(()=>this.waitUntilPendingPromises()).then(()=>{this.#a&&console.log(`waitUntilIdle: idle reached in ${this.getSessionContext().state}`)})}waitForEventLoop(){return this.#F?this.#F:this.#F=this.#Ge()}async#Ge(){if(this.#F||this.#P)throw new Error("Event loop already started");let e=_U(),r=c=>{c.type==="error"&&this.#R>0&&(BK.includes(c.code)||(c.restoreCredits=this.#R,this.#R=0,wU(this.#e,this.#u,s.sessionId,c.restoreCredits).catch(u=>{this.#e.Sentry?.captureException(u)}))),this.#n.emit("step",c)};this.#P=new AbortController;let n=this.#P.signal,i=this.#t?.devServerOrchestrator,s=this.getSessionContext(),o=()=>this.getLastCompletionId();this.#e.Sentry?.setContext("codeGen",{sessionId:s.sessionId,get completionId(){return o()}});let a=this.emitGitStatus();this.#ae(a),await a,i?.setupState==="not-installed"&&this.runSetupCommand();try{for(;!n.aborted;){this.#f=void 0;let c=this.getNextMessage();if(c.shouldWait){await this.#we();let l=await this.#T();if(n.aborted)break;l&&RU(c.promise,500).then(p=>{p&&(console.log("emit: idle (next message)"),this.#n.emit("idle"))})}let u=await c.promise;if(n.aborted)break;if(u){try{this.#k=void 0,u.logsCheckpoint&&i?.addCheckpoint(),this.#f=new AbortController;let l=Da([n,this.#f.signal]);if(l?.aborted)throw Hs();if(this.#v("generating"),u.syncChanges){await this.syncChangesFromRemote(u.syncChanges);let d=await this.#be(!1);d&&d.healthStatus.hasMergeConflict&&(u=ah(d.userMessage,u))}u.sessionMode&&u.sessionMode!==s.sessionMode&&this.switchSessionMode(u.sessionMode),await this.#Ve(u,l,r),this.#v("success"),(u.autoPush??"none")!=="none"&&await this.pushChanges({actor:"agent",pullFirst:u.autoPush==="merge-push",forcePush:u.autoPush==="force-push"}),this.#k=void 0}catch(l){l instanceof Error?l.name==="AbortError"?(r({type:"user-abort",hasContinueMessage:!!this.#l}),this.#v("abort")):l instanceof yt?(this.#m=void 0,r({type:"error",code:"cli-network-error",message:l.message}),this.#e.Sentry?.captureException(l,{tags:{operation:"codegen-stream"}}),this.#v("error")):l instanceof bt?(this.#m=void 0,r({type:"error",code:"unknown",message:"An internal error occurred. Please try again."}),this.#e.Sentry?.captureException(l,{tags:{operation:"codegen-stream"}}),this.#v("error")):l instanceof ts?(this.#m=void 0,r({type:"error",code:l.code,message:l.message}),BK.includes(l.code)||this.#e.Sentry?.captureException(l,{tags:{operation:"codegen-stream"}}),this.#v("error")):(this.#m=void 0,r({type:"error",code:"cli-genetic-error",message:l.message,metadata:{error:l}}),this.#e.Sentry?.captureException(l,{tags:{operation:"codegen-stream"}}),this.#v("error")):this.#v("error")}this.#Ae++}}}catch(c){throw this.#e.Sentry?.captureException(c,{level:"fatal"}),c}finally{this.#P=void 0,this.#F=void 0,e()}console.log("emit: idle (close)"),this.#n.emit("idle"),this.#v("close")}async#Ve(e,r,n){this.#R=0;let i=this.getSessionContext(),s=e.maxCompletions??AFe,o=0,a=0,c=0,u=!0,l=!1,p,d=0;try{for(;;){if(r?.aborted)throw Hs();try{if(p||(p=await this.#We(e,u,r,n),p.modelOverride=e.modelOverride),u=!1,p.user.role==="user"){let h=p.files.filter(m=>(m.importance??0)>2.5&&m.content).map(m=>({filePath:m.filePath,size:m.content?.length??0,isCustomInstruction:!1,wasIncluded:m.wasIncluded}));i.customInstructions.forEach(m=>{m.filePath&&h.push({filePath:m.filePath,size:m.content?.length??0,isCustomInstruction:!0,wasIncluded:!0})}),n({type:"user-input",prompt:p.userMessage?.displayPrompt??p.userPrompt,files:h})}try{let{shouldContinue:h,completions:m,filesChanged:g}=await this.#He(i,p,r,n);p=void 0,a=0,o++,l||=g,c+=m,this.#m=void 0;let y=await this.emitGitStatus();if(y){let b=this.getAiBranch();if(y.currentBranch!==b){if(c-1>=s){n({type:"error",code:"ask-to-continue",message:"The agent has been working for a while. Do you want to continue?"});break}u=!0,e={userPrompt:`Seems like the current git branch is ${y.currentBranch}, however, this is a broken state in Fusion. Make sure to git checkout into "${b}", before finishing.`,displayPrompt:""};continue}}if(!h){let b=this.#t?.devServerOrchestrator;if(b?.hasValidateCommand&&e.runValidateCommand&&d<2&&l){d++;let D=await b.runValidateCommand(void 0,r);if(D.status==="failure")this.sendMessage({user:e.user,maxCompletions:e.maxCompletions,runValidateCommand:!0,sessionMode:e.sessionMode,userPrompt:`The validate command (failed, code ${D.code}):
2004
2004
  <shell>
2005
2005
  ${D.command}
2006
2006
  </shell>
@@ -2009,9 +2009,9 @@ ${b}
2009
2009
  ${D.output}
2010
2010
  </output>
2011
2011
 
2012
- failed with code ${D.code}`,dropAbortedPrompt:!0,attachments:void 0,displayPrompt:`The validation command ${D.command} failed with code ${D.code}.`,queue:!0,category:"repair-validate-command",syncChanges:void 0});else{this.#t?.git&&(await this.#S()||await this.isCleanWorkTree()||await this.manualCommit({add:".",commitMessage:"Validate command fixes"}));break}}else break}if(!r.aborted){let b=this.#Le();if(b?.syncChanges&&await this.syncChangesFromRemote(b.syncChanges),b){u=!0,e=b,c=0;continue}}if(c>=s){n({type:"error",code:"ask-to-continue",message:"The agent has been working for a while. Do you want to continue?"});break}}catch(h){throw await this.emitGitStatus(),h}}catch(h){if(a<2&&(h instanceof ts&&h.code==="abrupt-end"||h instanceof Error&&h.name==="HTTPStreamBroke")){a++;continue}throw h}finally{DU(i.turns)}}}finally{let h=this.#r?.refreshPreview??!0;l&&h&&this.requestRefresh()}}async#He(e,r,n,i){if(this.#q)throw new Error("generateCompletion already started");let s=this.getLastTurn()?.nextUrl??this.#Z,o=!1,a=0;i({type:"start",id:"",name:"thinking",title:"Thinking",content:""});try{let c=this.#q=[],u=await this.getCurrentCommitHash();!e.beforeCommit&&u&&(e.beforeCommit=u);let l=this.#fe;l&&this.#h?.enabled&&(l=!!this.#h.mcpServers);let p=r.userMessage?.uiContextPrompt;if(p&&!this.#C()){let b=this.#r?.workspace?.folders.find(D=>D.enableGit);b?.path&&(p=`Relative file paths are relative to: ${b.path}/`)}let d={url:s,position:this.#B,eventName:"cli code",maxPages:2,autoContinue:1,codeGenMode:this.#V,userContext:{...e.userContext,fullstoryUrl:r.userMessage?.metadata?.fullstoryUrl},files:r.files,maxTokens:this.#de,aclPolicy:this.#r?.accessControl,repoIndexingConfig:this.#r?.repoIndexingConfig,recommendedRoot:this.#r?.workspace?.folders.find(b=>b.enableGit)?.recommendedRoot,attachments:r.attachments,customInstructions:e.customInstructions,customAgents:e.customAgents.map(b=>({name:b.name,description:b.description})),systemPromptOverride:this.#pe,sessionId:e.sessionId,userPrompt:r.userPrompt,ephemeralUserPrompt:r.userMessage?.ephemeralUserPrompt,uiContextPrompt:r.userMessage?.uiContextPrompt,displayUserPrompt:r.userMessage?.displayPrompt,isManualContinue:r.userMessage?.isManualContinue,sessionMode:r.userMessage?.sessionMode,includeRelevantMemories:r.userMessage?.includeRelevantMemories,projectId:this.#D,branchName:this.#z,pingEvents:!0,workingDirectory:this.#g,beforeCommit:u,toolResults:r.toolResults,role:r.user.role,user:r.user,repair:r.repair,category:r.category,enabledTools:this.#E,enabledMCPs:l?r.enabledMCPs:void 0,localMCPTools:this.#I?.listTools(),searchResponse:r.searchResponse,encryptKey:this.#j,maxAgentTiming:180*1e3,mcpServers:l,environmentVariables:kU(this.#r?.environmentVariables??[],this.#t?.devServerOrchestrator?.environmentVariables??[]),dirtyEnvironmentVariables:this.#W&&r.user.role==="user",redactUserMessages:this.#h?.redactUserMessages,redactLLMMessages:this.#h?.redactLLMMessages,modelOverride:r.modelOverride??this.#me,metadata:r.userMessage?.metadata};this.#a&&console.log("Starting completion stream");let h=CU(this.#e,this.#u,d,n),m,g=!1,y=!1;for await(let b of h){let D=async x=>{if(x.type==="user"){let C=m={state:"running",unixTime:Date.now(),title:"",sentiment:void 0,userMessage:r.userMessage,afterCommit:u,beforeCommit:u,lastCommit:void 0,creditsUsed:0,actions:[],applyResults:[],completionId:x.id??"",nextUrl:void 0,user:x.user,autoContinue:!1};m=C,e.turns.push(C),x.compacting&&(e.customInstructions=await this.#Y()),i({type:"user",displayPrompt:x.displayPrompt,id:x.id,user:x.user,role:x.user.role,compacting:x.compacting})}else if(x.type==="mcp-status")this.#Q=x,i(x);else{if(x.type==="mcp-auth-required")return y=!0,i(x),!0;if(x.type==="error")return y=!0,i(x),!0;if(x.type==="done"){a++,this.#R+=x.creditsUsed;let C=m=await this.#Je(e,x,m,u);for(let _ of x.actions??[])_.type==="tool_result"&&i({type:"tool_result",result:{content:_.content,tool_use_id:_.id,type:"tool_result",title:_.actionTitle,tool_name:_.filePath,is_error:!!_.errors?.length}});C.applyResults.length>0&&this.#t?.devServerOrchestrator?.addCheckpoint();let E=await this.#Ze(this.#e,C),P=E.length>0,A=await this.commitWorkInProgress(C,E),F=!1;A?(P=!0,C.afterCommit=A,u=A):A===void 0&&(F=!0),P&&(o=!0),r.user.role==="user"&&(this.#W=!1),this.#M({completionId:C.completionId,beforeCommit:C.beforeCommit,afterCommit:C.afterCommit,commitFailed:F}),i({type:"done",stopReason:x.stopReason,id:x.id,applyResults:C.applyResults,actions:x.actions??[],creditsUsed:x.creditsUsed,sessionUsage:x.sessionUsage,model:x.model,usage:x.usage,url:x.nextUrl,promptVersion:x.promptVersion,hasChanges:P})}else{if(x.type==="continue")return g=x.autoContinue,y=!0,i({type:"continue",id:x.id,url:x.nextUrl,autoContinue:x.autoContinue}),!0;x.type==="thinking"&&(x.actionTitle="Planning"),"content"in x&&x.type!=="delta"&&i({type:"start",name:x.type,filePath:x.filePath??"",id:"id"in x?x.id:void 0,title:x.actionTitle??x.artifactTitle??x.filePath??"",content:x.content??""})}}return!1},w=async x=>{x.type==="thinking"&&i({type:"planning",content:x.content}),x.type==="server_tool_result"&&i({type:"server_tool_result",content:JSON.parse(x.content),title:x.actionTitle??x.artifactTitle??"Server Tool Result",id:x.id}),x.type==="file"&&x.filePath&&!x.synthetic&&i({type:"file",filePath:x.filePath,content:x.content,title:x.actionTitle??x.artifactTitle??"Created",id:x.id,errors:x.errors}),x.type==="diff"&&x.filePath&&!x.synthetic&&i({type:"diff",filePath:x.filePath,title:x.actionTitle??x.artifactTitle??"Updated",content:x.content,id:x.id,errors:x.errors}),x.type==="tool"&&x.filePath?i({type:"tool",name:x.filePath,id:x.id,content:x.content}):x.type==="text"&&i({type:"text",content:x.content})},v=async(x,C)=>{i({type:"delta",name:x.type,delta:C})};if(b.type==="ping"){this.#a&&console.log("generateCompletion: Ping");continue}if(b.type==="delta"){let x=b.content,C=_o(c);C&&"content"in C&&(C.content+=x,await v(C,x))}else{let x=_o(c);if(x&&"content"in x&&(x.incomplete=!1,await w(x)),c.push(b),await D(b))break}}if(!y)throw new ts("Completion stream ended abruptly","abrupt-end");return m?{completions:a,filesChanged:o,shouldContinue:g||m.actions.some(b=>b.type==="tool")||m.autoContinue}:{completions:a,shouldContinue:!1,filesChanged:o}}finally{this.#q=void 0}}async commitWorkInProgress(e,r){if(!this.#t?.git)return!1;let n=await this.#S();if(n&&r.length===0||await this.isCleanWorkTree())return!1;try{n?await this.git(["add",...r]):await this.git(["add","."]);let s=`${e.title}
2012
+ failed with code ${D.code}`,dropAbortedPrompt:!0,attachments:void 0,displayPrompt:`The validation command ${D.command} failed with code ${D.code}.`,queue:!0,category:"repair-validate-command",syncChanges:void 0});else{this.#t?.git&&(await this.#S()||await this.isCleanWorkTree()||await this.manualCommit({add:".",commitMessage:"Validate command fixes"}));break}}else break}if(!r.aborted){let b=this.#Le();if(b?.syncChanges&&await this.syncChangesFromRemote(b.syncChanges),b){u=!0,e=b,c=0;continue}}if(c>=s){n({type:"error",code:"ask-to-continue",message:"The agent has been working for a while. Do you want to continue?"});break}}catch(h){throw await this.emitGitStatus(),h}}catch(h){if(a<2&&(h instanceof ts&&h.code==="abrupt-end"||h instanceof Error&&h.name==="HTTPStreamBroke")){a++;continue}throw h}finally{DU(i.turns)}}}finally{let h=this.#r?.refreshPreview??!0;l&&h&&this.requestRefresh()}}async#He(e,r,n,i){if(this.#q)throw new Error("generateCompletion already started");let s=this.getLastTurn()?.nextUrl??this.#Z,o=!1,a=0;i({type:"start",id:"",name:"thinking",title:"Thinking",content:""});try{let c=this.#q=[],u=await this.getCurrentCommitHash();!e.beforeCommit&&u&&(e.beforeCommit=u);let l=this.#fe;l&&this.#h?.enabled&&(l=!!this.#h.mcpServers);let p=r.userMessage?.uiContextPrompt;if(p&&!this.#C()){let b=this.#r?.workspace?.folders.find(D=>D.enableGit);b?.path&&(p=`Relative file paths are relative to: ${b.path}/`)}let d={url:s,position:this.#B,eventName:"cli code",maxPages:2,autoContinue:1,codeGenMode:this.#V,userContext:{...e.userContext,fullstoryUrl:r.userMessage?.metadata?.fullstoryUrl},files:r.files,maxTokens:this.#de,aclPolicy:this.#r?.accessControl,repoIndexingConfig:this.#r?.repoIndexingConfig,recommendedRoot:this.#r?.workspace?.folders.find(b=>b.enableGit)?.recommendedRoot,attachments:r.attachments,customInstructions:e.customInstructions,customAgents:e.customAgents.map(b=>({name:b.name,description:b.description})),systemPromptOverride:this.#pe,sessionId:e.sessionId,userPrompt:r.userPrompt,ephemeralUserPrompt:r.userMessage?.ephemeralUserPrompt,uiContextPrompt:r.userMessage?.uiContextPrompt,displayUserPrompt:r.userMessage?.displayPrompt,isManualContinue:r.userMessage?.isManualContinue,sessionMode:r.userMessage?.sessionMode,includeRelevantMemories:r.userMessage?.includeRelevantMemories,projectId:this.#b,branchName:this.#z,pingEvents:!0,workingDirectory:this.#g,beforeCommit:u,toolResults:r.toolResults,role:r.user.role,user:r.user,repair:r.repair,category:r.category,enabledTools:this.#E,enabledMCPs:l?r.enabledMCPs:void 0,localMCPTools:this.#I?.listTools(),searchResponse:r.searchResponse,encryptKey:this.#j,maxAgentTiming:180*1e3,mcpServers:l,environmentVariables:kU(this.#r?.environmentVariables??[],this.#t?.devServerOrchestrator?.environmentVariables??[]),dirtyEnvironmentVariables:this.#W&&r.user.role==="user",redactUserMessages:this.#h?.redactUserMessages,redactLLMMessages:this.#h?.redactLLMMessages,modelOverride:r.modelOverride??this.#me,metadata:r.userMessage?.metadata};this.#a&&console.log("Starting completion stream");let h=CU(this.#e,this.#u,d,n),m,g=!1,y=!1;for await(let b of h){let D=async x=>{if(x.type==="user"){let C=m={state:"running",unixTime:Date.now(),title:"",sentiment:void 0,userMessage:r.userMessage,afterCommit:u,beforeCommit:u,lastCommit:void 0,creditsUsed:0,actions:[],applyResults:[],completionId:x.id??"",nextUrl:void 0,user:x.user,autoContinue:!1};m=C,e.turns.push(C),x.compacting&&(e.customInstructions=await this.#Y()),i({type:"user",displayPrompt:x.displayPrompt,id:x.id,user:x.user,role:x.user.role,compacting:x.compacting})}else if(x.type==="mcp-status")this.#Q=x,i(x);else{if(x.type==="mcp-auth-required")return y=!0,i(x),!0;if(x.type==="error")return y=!0,i(x),!0;if(x.type==="done"){a++,this.#R+=x.creditsUsed;let C=m=await this.#Je(e,x,m,u);for(let _ of x.actions??[])_.type==="tool_result"&&i({type:"tool_result",result:{content:_.content,tool_use_id:_.id,type:"tool_result",title:_.actionTitle,tool_name:_.filePath,is_error:!!_.errors?.length}});C.applyResults.length>0&&this.#t?.devServerOrchestrator?.addCheckpoint();let E=await this.#Ze(this.#e,C),P=E.length>0,A=await this.commitWorkInProgress(C,E),F=!1;A?(P=!0,C.afterCommit=A,u=A):A===void 0&&(F=!0),P&&(o=!0),r.user.role==="user"&&(this.#W=!1),this.#M({completionId:C.completionId,beforeCommit:C.beforeCommit,afterCommit:C.afterCommit,commitFailed:F}),i({type:"done",stopReason:x.stopReason,id:x.id,applyResults:C.applyResults,actions:x.actions??[],creditsUsed:x.creditsUsed,sessionUsage:x.sessionUsage,model:x.model,usage:x.usage,url:x.nextUrl,promptVersion:x.promptVersion,hasChanges:P})}else{if(x.type==="continue")return g=x.autoContinue,y=!0,i({type:"continue",id:x.id,url:x.nextUrl,autoContinue:x.autoContinue}),!0;x.type==="thinking"&&(x.actionTitle="Planning"),"content"in x&&x.type!=="delta"&&i({type:"start",name:x.type,filePath:x.filePath??"",id:"id"in x?x.id:void 0,title:x.actionTitle??x.artifactTitle??x.filePath??"",content:x.content??""})}}return!1},w=async x=>{x.type==="thinking"&&i({type:"planning",content:x.content}),x.type==="server_tool_result"&&i({type:"server_tool_result",content:JSON.parse(x.content),title:x.actionTitle??x.artifactTitle??"Server Tool Result",id:x.id}),x.type==="file"&&x.filePath&&!x.synthetic&&i({type:"file",filePath:x.filePath,content:x.content,title:x.actionTitle??x.artifactTitle??"Created",id:x.id,errors:x.errors}),x.type==="diff"&&x.filePath&&!x.synthetic&&i({type:"diff",filePath:x.filePath,title:x.actionTitle??x.artifactTitle??"Updated",content:x.content,id:x.id,errors:x.errors}),x.type==="tool"&&x.filePath?i({type:"tool",name:x.filePath,id:x.id,content:x.content}):x.type==="text"&&i({type:"text",content:x.content})},v=async(x,C)=>{i({type:"delta",name:x.type,delta:C})};if(b.type==="ping"){this.#a&&console.log("generateCompletion: Ping");continue}if(b.type==="delta"){let x=b.content,C=_o(c);C&&"content"in C&&(C.content+=x,await v(C,x))}else{let x=_o(c);if(x&&"content"in x&&(x.incomplete=!1,await w(x)),c.push(b),await D(b))break}}if(!y)throw new ts("Completion stream ended abruptly","abrupt-end");return m?{completions:a,filesChanged:o,shouldContinue:g||m.actions.some(b=>b.type==="tool")||m.autoContinue}:{completions:a,shouldContinue:!1,filesChanged:o}}finally{this.#q=void 0}}async commitWorkInProgress(e,r){if(!this.#t?.git)return!1;let n=await this.#S();if(n&&r.length===0||await this.isCleanWorkTree())return!1;try{n?await this.git(["add",...r]):await this.git(["add","."]);let s=`${e.title}
2013
2013
  ${e.completionId}`.split(`
2014
- `).flatMap(a=>["-m",a]);return await this.git(["commit","--allow-empty","--quiet","--no-verify",...s]),await this.getCurrentCommitHash()}catch(i){n||this.#e.Sentry?.captureException(new Error("Error commiting work in progress",{cause:i}),{tags:{operation:"codegen-git"}})}}async#Ke(e,r,n,i){let s=r.actions.filter(o=>o.type==="tool"&&o.id).map(o=>{let a=o.content.trim(),c={};try{c=a?JSON.parse(a):{}}catch{c={}}return{id:o.id,name:o.filePath,input:c,abortController:this.#v.find(u=>u.id===o.id)?.abortController??new AbortController}})??[];if(s.length>0){this.#v=s;try{let o={sys:this.#e,credentials:this.#u,files:e.files,user:e.user,position:this.#B,fusionConfig:this.#r,enabledTools:this.#E??[],signal:n,canCollapseWorkspace:this.#C(),emitter:this.#n,session:this,filterText:c=>(c=v4(c,this.#g),this.#r?.accessControl?.secrets&&(c=x4(c,this.#r.accessControl.secrets)),c),allowedCommands:QU(this.#r?.allowedCommands??[]),getAllFiles:c=>this.getAllFiles({getDotFiles:c.getDotFiles,includePattern:c.pattern,gitignore:!0}),workingDirectory:this.#s,bashWorkingDirectory:this.#g,workspaceFolders:this.#i?.folders??[],restore:c=>this.restore(c),patchFusionConfig:c=>{e.patchFusionConfig||(e.patchFusionConfig={});let u=e.patchFusionConfig.envVariables;Object.assign(e.patchFusionConfig,c),e.patchFusionConfig.envVariables={...u,...c.envVariables}},readFile:c=>this.readFile(c),writeFile:(c,u)=>this.writeFile(c,u),deleteFile:c=>this.deleteFile(c),fileExists:c=>this.fileExists(c),listDir:c=>this.listDir(c),evaluateAccess:(c,u)=>ko(c,u,this.#r?.accessControl,this.#A()),stat:c=>this.stat(c),localMCPManager:this.#I,passThrough:(c,u)=>{let l={toolResult:"Aborted by the user. So the task could not be completed.",isError:!0,title:"Aborted by the user."};return new Promise(p=>{let d=()=>{u.removeEventListener("abort",h),this.#_.delete(c.id)},h=()=>{d(),p(l)};if(u.aborted){h();return}u.addEventListener("abort",h,{once:!0}),this.#_.set(c.id,m=>{d(),p(m)}),this.#n.emit("step",{type:"tool-call-request",id:c.id,name:c.name,input:c.input})})},resolveWorkspacePath:(c,u)=>this.resolveWorkspacePath(c,u),absolutePathToWorkspaceUrl:c=>this.absolutePathToWorkspaceUrl(c),setHasPlanToApply:c=>{this.#w=c},...this.#t},a=await Fq(o,s,r.cachedToolResults,i);if(r.cachedToolResults=a,o.signal?.aborted)throw Hs();e.patchFusionConfig&&this.#n.emit("step",{type:"fusion-config-patch",patch:e.patchFusionConfig}),e.files=o.files,e.toolResults=a}finally{this.#v=[]}}}async#We(e,r,n,i){let s=this.getSessionContext(),o=_o(s.turns),a=structuredClone(e.user??o?.user??{source:"agent",role:"agent"}),c={userMessage:void 0,userPrompt:"",files:[],attachments:[],searchResponse:null,rerankFiles:0,mostRelevantFile:null,toolResults:[],user:a,modelOverride:e.modelOverride,repair:e.repair,category:e.category,enabledMCPs:e.enabledMCPs},u=!!this.getLastTurn()?.nextUrl,l=s.turns.length<2||!u;if(r){let d=null;if(l){let D=function(v){return y&&TU(v)?5:g.has(v)||b.some(x=>v.toLowerCase().startsWith(x.toLowerCase()))?2:0};var p=D;let h=Kj(await this.getAllFiles({getDotFiles:!1,gitignore:!0,deep:4,truncate:2e4})),m=new Set,g=new Set;if(e.files)for(let v of e.files)m.add(g4(v));let y=e.includeBaseFiles??s.turns.length===0,b=Array.from(m),w=n.aborted?[]:h.map(v=>{let x=D(v);if(x===0)return{filePath:v};let C=null;try{if(C=this.readFileSync(v),!C)return{filePath:v}}catch{return{filePath:v}}let E=C.length<3e4;return{filePath:v,content:C,importance:E?x:2}});c.files=w,c.attachments=e.attachments??[]}if(this.#t?.git){let h,m=await this.getChangesReport();if(m){for(let g of m.files)if(!c.files.some(y=>y.filePath===g))try{let y=await this.readFile(g);c.files.push({filePath:g,importance:0,content:y??void 0})}catch{c.files.push({filePath:g,importance:0})}m.diff.length<3e4?h=m.diff:h=m.files.map(g=>`- ${g}`).join(`
2014
+ `).flatMap(a=>["-m",a]);return await this.git(["commit","--allow-empty","--quiet","--no-verify",...s]),await this.getCurrentCommitHash()}catch(i){n||this.#e.Sentry?.captureException(new Error("Error commiting work in progress",{cause:i}),{tags:{operation:"codegen-git"}})}}async#Ke(e,r,n,i){let s=r.actions.filter(o=>o.type==="tool"&&o.id).map(o=>{let a=o.content.trim(),c={};try{c=a?JSON.parse(a):{}}catch{c={}}return{id:o.id,name:o.filePath,input:c,abortController:this.#x.find(u=>u.id===o.id)?.abortController??new AbortController}})??[];if(s.length>0){this.#x=s;try{let o={sys:this.#e,credentials:this.#u,files:e.files,user:e.user,position:this.#B,fusionConfig:this.#r,enabledTools:this.#E??[],signal:n,canCollapseWorkspace:this.#C(),emitter:this.#n,session:this,filterText:c=>(c=v4(c,this.#g),this.#r?.accessControl?.secrets&&(c=x4(c,this.#r.accessControl.secrets)),c),allowedCommands:QU(this.#r?.allowedCommands??[]),getAllFiles:c=>this.getAllFiles({getDotFiles:c.getDotFiles,includePattern:c.pattern,gitignore:!0}),workingDirectory:this.#s,bashWorkingDirectory:this.#g,workspaceFolders:this.#i?.folders??[],restore:c=>this.restore(c),patchFusionConfig:c=>{e.patchFusionConfig||(e.patchFusionConfig={});let u=e.patchFusionConfig.envVariables;Object.assign(e.patchFusionConfig,c),e.patchFusionConfig.envVariables={...u,...c.envVariables}},readFile:c=>this.readFile(c),writeFile:(c,u)=>this.writeFile(c,u),deleteFile:c=>this.deleteFile(c),fileExists:c=>this.fileExists(c),listDir:c=>this.listDir(c),evaluateAccess:(c,u)=>ko(c,u,this.#r?.accessControl,this.#A()),stat:c=>this.stat(c),localMCPManager:this.#I,passThrough:(c,u)=>{let l={toolResult:"Aborted by the user. So the task could not be completed.",isError:!0,title:"Aborted by the user."};return new Promise(p=>{let d=()=>{u.removeEventListener("abort",h),this.#_.delete(c.id)},h=()=>{d(),p(l)};if(u.aborted){h();return}u.addEventListener("abort",h,{once:!0}),this.#_.set(c.id,m=>{d(),p(m)}),this.#n.emit("step",{type:"tool-call-request",id:c.id,name:c.name,input:c.input})})},resolveWorkspacePath:(c,u)=>this.resolveWorkspacePath(c,u),absolutePathToWorkspaceUrl:c=>this.absolutePathToWorkspaceUrl(c),setHasPlanToApply:c=>{this.#w=c},...this.#t},a=await Fq(o,s,r.cachedToolResults,i);if(r.cachedToolResults=a,o.signal?.aborted)throw Hs();e.patchFusionConfig&&this.#n.emit("step",{type:"fusion-config-patch",patch:e.patchFusionConfig}),e.files=o.files,e.toolResults=a}finally{this.#x=[]}}}async#We(e,r,n,i){let s=this.getSessionContext(),o=_o(s.turns),a=structuredClone(e.user??o?.user??{source:"agent",role:"agent"}),c={userMessage:void 0,userPrompt:"",files:[],attachments:[],searchResponse:null,rerankFiles:0,mostRelevantFile:null,toolResults:[],user:a,modelOverride:e.modelOverride,repair:e.repair,category:e.category,enabledMCPs:e.enabledMCPs},u=!!this.getLastTurn()?.nextUrl,l=s.turns.length<2||!u;if(r){let d=null;if(l){let D=function(v){return y&&TU(v)?5:g.has(v)||b.some(x=>v.toLowerCase().startsWith(x.toLowerCase()))?2:0};var p=D;let h=Kj(await this.getAllFiles({getDotFiles:!1,gitignore:!0,deep:4,truncate:2e4})),m=new Set,g=new Set;if(e.files)for(let v of e.files)m.add(g4(v));let y=e.includeBaseFiles??s.turns.length===0,b=Array.from(m),w=n.aborted?[]:h.map(v=>{let x=D(v);if(x===0)return{filePath:v};let C=null;try{if(C=this.readFileSync(v),!C)return{filePath:v}}catch{return{filePath:v}}let E=C.length<3e4;return{filePath:v,content:C,importance:E?x:2}});c.files=w,c.attachments=e.attachments??[]}if(this.#t?.git){let h,m=await this.getChangesReport();if(m){for(let g of m.files)if(!c.files.some(y=>y.filePath===g))try{let y=await this.readFile(g);c.files.push({filePath:g,importance:0,content:y??void 0})}catch{c.files.push({filePath:g,importance:0})}m.diff.length<3e4?h=m.diff:h=m.files.map(g=>`- ${g}`).join(`
2015
2015
  `).trim().slice(0,3e4),h&&(c.userPrompt=`
2016
2016
  Since last time, some files were changed by the user or tools (formatting for example):
2017
2017
  <modified-files-context>
@@ -2022,14 +2022,14 @@ ${c.userPrompt}`)}}c.userMessage=e,c.userPrompt=e.userPrompt,c.attachments=e.att
2022
2022
  `).length,content:"",oldContent:p});else{let h=cU(p,a.content);o.applyResults.push({action:"update",filePath:c,addedLines:h.filter(m=>m.added).reduce((m,g)=>m+(g.count??0),0),removedLines:h.filter(m=>m.removed).reduce((m,g)=>m+(g.count??0),0),content:a.content,oldContent:p})}else l&&!d?o.applyResults.push({action:"update",filePath:c,addedLines:0,removedLines:0,content:a.content,oldContent:void 0}):o.applyResults.push({action:"create",filePath:c,addedLines:a.content.split(`
2023
2023
  `).length,removedLines:0,content:a.content,oldContent:""})}}return o}#Se(){let e=this.getSessionContext(),r=e.beforeCommit,n=e.turns.findLast(s=>s.afterCommit??s.beforeCommit),i=n?.afterCommit??n?.beforeCommit;return r&&i&&r!==i?!0:e.turns.some(s=>s.applyResults.length>0)}async#Ye(){try{let e="{/* TODO: FUSION_GENERATION_APP_PLACEHOLDER replace everything here with the actual app! */}",r=await this.#e.readFile(this.resolveWorkspacePath("client/pages/Index.tsx",!0).resolvedPath);if((await this.#e.readFile(this.resolveWorkspacePath("client/App.tsx",!0).resolvedPath))?.includes('<Route path="/" element={<Index />} />')&&r&&r.includes(e))return!0}catch{}return!1}#Te(e){let r=e.toLowerCase(),n=[".next/","dist/","build/","out/","node_modules/",".cache/","coverage/","__pycache__/","target/","vendor/",".gradle/",".build/"],i=[".gz",".zip",".tar",".tgz",".7z",".rar",".pack",".bin",".exe",".dll",".so",".dylib",".o",".a",".jar",".class",".pyc",".pyo",".wasm",".png",".jpg",".jpeg",".gif",".ico",".webp",".svg",".mp4",".mp3",".wav",".pdf",".woff",".woff2",".ttf",".eot",".map",".min.js",".min.css",".bundle.js",".chunk.js",".tsbuildinfo"];for(let s of n)if(r.includes(s))return!0;for(let s of i)if(r.endsWith(s))return!0;return!!(r.endsWith("package-lock.json")||r.endsWith("yarn.lock")||r.endsWith("pnpm-lock.yaml")||r.endsWith(".lock"))}async getChangesReport(){if(this.#t?.git)try{let r=this.getSessionContext().turns.findLast(l=>l.actions.some(p=>p.type==="file"||p.type==="diff"))?.afterCommit;if(!r)return;let s=(await this.git(["--no-pager","diff","--name-only",r])).trim().split(`
2024
2024
  `).map(l=>l.trim()).filter(l=>l).filter(l=>!this.#Te(l)),o=s.map(l=>this.absolutePathToWorkspaceUrl(this.#e.join(this.#c,l))).filter(l=>l!=null);if(s.length===0)return{files:[],diff:""};let a=await this.git(["--no-pager","diff","-U0","--no-color",r,"--",...s]).then(l=>l.trim()),c="",u=this.gitEnabledFolder;return u&&!this.#C()&&a.length>0&&(c=`Notice that all the relative paths, are inside "${u.name}/", remember that when using Read/Write/Edit tools:
2025
- `),{files:o,diff:e7(`${c}${a}`,1e4)}}catch(e){this.#e.Sentry?.captureException(e,{tags:{operation:"codegen-git"}});return}}#Xe(){return["status","--porcelain=v1","-z","--ignore-submodules=dirty"]}async isCleanWorkTree(){try{return(await this.git(this.#Xe())).trim().length===0}catch{return!1}}async#Ze(e,r){let n=r.applyResults,i=[];for(let s of n)try{if(s.action==="delete"){let o=await this.deleteFile(s.filePath);o&&i.push(o)}else if(s.content){let o=await this.writeFile(s.filePath,s.content);o&&(this.#ie.add(o),i.push(o))}}catch(o){e.Sentry?.captureException(o)}return i}#Qe(){return this.#i?.folders?.length===1&&this.#i.folders[0].name==="."}#C(){return this.#i?.folders?.length===1||!this.#i?.folders?.length}resolveWorkspacePath(e,r){return qq({filePath:e,forceWorkspace:r,workspace:this.#i,workingDirectory:this.#s,sys:this.#e,canCollapseWorkspace:this.#C()})}#A(){try{let e=this.getSessionContext();return _o(e.turns)?.user.principals}catch{return}}absolutePathToWorkspaceUrl(e){return zq({absolutePath:e,workspace:this.#i,workingDirectory:this.#s,sys:this.#e,canCollapseWorkspace:this.#C()})}async launchEditor(e={}){let r,n,i;return e.filePath?(r=this.resolveWorkspacePath(e.filePath,!1).resolvedPath,n=e.line??void 0,i=e.column??void 0):r=this.#c,await this.#e.exists(r)?await this.#e.launchEditor({filePath:r,line:n,column:i}):{success:!1,message:`File not found: ${r}`}}async readFile(e,r){if(!r){let n=ko(e,"read",this.#r?.accessControl,this.#A());if(!n.allowed)throw new bt(`ACL denied: ${n.message}`)}try{if(e==="AGENTS.md"&&this.#i?.agentsMD)return this.#i.agentsMD;let{resolvedPath:n}=this.resolveWorkspacePath(e,!!r);if(await this.#e.exists(n))return await this.#e.readFile(n);if({resolvedPath:n}=this.resolveWorkspacePath(e,!0),await this.#e.exists(n))return await this.#e.readFile(n)}catch(n){this.#e.Sentry?.captureException(n,{extra:{filePath:e}})}return null}async getFileAtRef(e,r){if(!this.#t?.git)return null;try{let n=r;n||(n=await this.getDefaultBranch());let{resolvedPath:i,workspaceFolder:s}=this.resolveWorkspacePath(e,!0),o=s?.path||this.#s,a=e;return o&&i.startsWith(o)&&(a=i.substring(o.length),a.startsWith("/")&&(a=a.substring(1))),await this.git(["show",`${n}:${a}`])}catch{return null}}async getSingleFileDiff(e){let r=await this.readFile(e,!0),n=await this.getFileAtRef(e),i;return n===null&&r!==null?i="create":n!==null&&r===null?i="delete":i="update",{oldContent:n,newContent:r,action:i}}async fileExists(e){let r=n=>n.startsWith(this.#s)?this.#e.relative(this.#s,n):n;try{if(e==="AGENTS.md"&&this.#i?.agentsMD)return{absolutePath:e,recommendedPath:void 0,workspaceFolder:void 0,virtual:!0};let{resolvedPath:n,workspaceFolder:i}=this.resolveWorkspacePath(e,!1);return await this.#e.exists(n)?{absolutePath:n,recommendedPath:void 0,workspaceFolder:i,virtual:!1}:i?{absolutePath:void 0,recommendedPath:void 0,workspaceFolder:i,virtual:!1}:({resolvedPath:n,workspaceFolder:i}=this.resolveWorkspacePath(e,!0),await this.#e.exists(n)?{absolutePath:n,recommendedPath:r(n),workspaceFolder:i,virtual:!1}:{absolutePath:void 0,recommendedPath:r(n),workspaceFolder:i,virtual:!1})}catch(n){this.#e.Sentry?.captureException(n,{extra:{filePath:e}})}return{absolutePath:void 0,recommendedPath:void 0,workspaceFolder:void 0,virtual:!1}}readFileSync(e,r){if(!r){let n=ko(e,"read",this.#r?.accessControl,this.#A());if(!n.allowed)throw new bt(`ACL denied: ${n.message}`)}try{if(e==="AGENTS.md"&&this.#i?.agentsMD)return this.#i.agentsMD;let{resolvedPath:n}=this.resolveWorkspacePath(e,!1);if(this.#e.existsSync(n))return this.#e.readFileSync(n);if({resolvedPath:n}=this.resolveWorkspacePath(e,!0),this.#e.existsSync(n))return this.#e.readFileSync(n)}catch(n){this.#e.Sentry?.captureException(n,{extra:{filePath:e}})}return null}async writeFile(e,r,n){if(!n){let i=ko(e,"write",this.#r?.accessControl,this.#A());if(!i.allowed)throw new bt(`ACL denied: ${i.message}`)}try{let{resolvedPath:i}=this.resolveWorkspacePath(e,!!n);return await this.#e.writeFile(i,r),i}catch(i){return this.#e.Sentry?.captureException(i,{extra:{filePath:e}}),null}}async listDir(e){let r=ko(e,"list",this.#r?.accessControl,this.#A());if(!r.allowed)throw new bt(`ACL denied: ${r.message}`);try{let{resolvedPath:n,workspaceFolder:i}=this.resolveWorkspacePath(e,!1);if(!await this.#e.exists(n))return[];let o=(await(0,jK.readdir)(n,{withFileTypes:!0})).map(a=>a.name+(a.isDirectory()?"/":""));if(this.#Qe())return fh({files:o.map(a=>this.#e.join(e,a).replace(/^\.\//,"")),policy:this.#r?.accessControl});if(i&&this.#i?.folders){let a=i.name||i.path;return fh({files:o.map(c=>`${a}/${this.#e.join(e,c).replace(/^\.\//,"")}`),policy:this.#r?.accessControl})}return fh({files:o,policy:this.#r?.accessControl})}catch(n){return this.#e.Sentry?.captureException(n,{extra:{dirPath:e}}),[]}}async stat(e,r){if(!r){let n=ko(e,"read",this.#r?.accessControl,this.#A());if(!n.allowed)throw new bt(`ACL denied: ${n.message}`)}try{let{resolvedPath:n}=this.resolveWorkspacePath(e,!1);if(await this.#e.exists(n))return await this.#e.stat(n)}catch(n){this.#e.Sentry?.captureException(n,{extra:{filePath:e}})}return null}async deleteFile(e,r){if(!r){let n=ko(e,"write",this.#r?.accessControl,this.#A());if(!n.allowed)throw new bt(`ACL denied: ${n.message}`)}try{let{resolvedPath:n}=this.resolveWorkspacePath(e,!!r);return await this.#e.exists(n)?(await this.#e.unlink(n),n):null}catch(n){return this.#e.Sentry?.captureException(n,{extra:{filePath:e}}),null}}getLinesStats(){let e=this.#p?.turns.reduce((r,n)=>{let i=n.applyResults.reduce((s,o)=>({added:s.added+o.addedLines,removed:s.removed+o.removedLines}),{added:0,removed:0});return{added:r.added+i.added,removed:r.removed+i.removed}},{added:0,removed:0})??{added:0,removed:0};return{...e,net:e.added-e.removed}}async getDiffFromRemote({numberOfContextLines:e,includeFilesOnly:r,filePaths:n}){if(!this.#t?.git)return[];try{let i=(await this.git(["branch","--show-current"])).trim();if(!i)throw new Error("Could not determine current branch");let s=!1;try{s=(await this.git(["remote"])).includes("origin")}catch(l){throw console.warn("No git remotes configured, cannot get diff from remote"),l}if(!s){console.warn("Origin remote not found, trying to get diff from main branch");try{return await this.getDiffFromParentBranch({numberOfContextLines:e,includeFilesOnly:r,filePaths:n})}catch(l){throw console.warn("Failed to get diff from main branch:",l),l}}let o=!1,a;try{let l=`origin/${i}`;if(o=(await this.git(["ls-remote","--heads","origin",i])).trim().length>0,o)a=l;else return await this.getDiffFromParentBranch({numberOfContextLines:e,includeFilesOnly:r,filePaths:n})}catch(l){throw console.warn("Failed to check remote branches:",l),l}let c=["diff",a];r?c.push("--name-status"):e!==void 0&&c.push(`-U${e}`),c.push("--"),n&&n.length>0&&c.push(...n);let u=await this.git(c);return!u||u.trim()===""?[]:zF(u,r)}catch(i){throw console.error("getDiffFromRemote error:",i),i}}async getDiff({mode:e="remote-parent-branch",numberOfContextLines:r,includeFilesOnly:n,filePaths:i}){if(!this.#t?.git)return{state:"error",error:new Error("Git not configured")};try{switch(e){case"remote-parent-branch":return{state:"success",diff:await this.getDiffFromParentBranch({numberOfContextLines:r,includeFilesOnly:n,filePaths:i})};case"remote-current-branch":return{state:"success",diff:await this.getDiffFromRemote({numberOfContextLines:r,includeFilesOnly:n,filePaths:i})};default:throw new Error(`Unknown diff mode: ${e}`)}}catch(s){return console.error(`getDiff error for mode '${e}':`,s),this.#e.Sentry?.captureException(s),{state:"error",error:s instanceof Error?s:new Error(String(s))}}}async getDefaultBranch(){try{let r=(await this.git(["remote","show","origin"])).match(/HEAD branch: (.+)/);if(r)return`origin/${r[1].trim()}`}catch{}try{if((await this.git(["ls-remote","--heads","origin","main"])).trim().length>0)return"origin/main"}catch{}try{if((await this.git(["ls-remote","--heads","origin","master"])).trim().length>0)return"origin/master"}catch{}try{let r=(await this.git(["ls-remote","--heads","origin"])).trim().split(`
2026
- `).map(n=>n.split(" ")[1]).filter(n=>n&&!n.includes("HEAD"));if(r.length>0)return`origin/${r[0].replace("refs/heads/","")}`}catch{}throw new Error("Could not determine default branch. No remote branches found.")}async getDiffFromParentBranch({numberOfContextLines:e,includeFilesOnly:r,filePaths:n}){try{if(!(await this.git(["branch","--show-current"])).trim())throw new Error("Could not determine current branch");let s=await this.getDefaultBranch();if(!s)throw new Error("Could not find parent branch (main/master)");try{await this.git(["fetch",...s.split("/")])}catch(c){throw console.warn(`Failed to fetch remote ${s}:`,c),c}let o=["diff",s];r?o.push("--name-status"):e!==void 0&&o.push(`-U${e}`),o.push("--"),n&&n.length>0&&o.push(...n);let a=await this.git(o);return!a||a.trim()===""?[]:zF(a,r)}catch(i){throw console.error("getDiffFromParentBranch error:",i),i}}}});function XF(){let{env:t}=YF.default,{TERM:e,TERM_PROGRAM:r}=t;return YF.default.platform!=="win32"?e!=="linux":!!t.WT_SESSION||!!t.TERMINUS_SUBLIME||t.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||t.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var YF,UK=k(()=>{f();YF=z(require("node:process"),1)});var ZF,Gd,lg,Hn,QF,M0,_Fe,FFe,kFe,IFe,Vd=k(()=>{"use strict";f();UK();ZF=z(dr(),1),Gd=z(_y(),1),lg=z(dr(),1),Hn=()=>{let t=QF?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],e=QF?80:120,r,n=!1,i="",s="",o="",a=y=>{let b=y>1?"Something went wrong":"Canceled";n&&h(b,y)},c=(y,b)=>{console.error(b,y),a(2)},u=()=>a(1),l=()=>{process.on("uncaughtExceptionMonitor",c),process.on("unhandledRejection",c),process.on("SIGINT",u),process.on("SIGTERM",u),process.on("exit",a)},p=()=>{process.removeListener("uncaughtExceptionMonitor",c),process.removeListener("unhandledRejection",c),process.removeListener("SIGINT",u),process.removeListener("SIGTERM",u),process.removeListener("exit",a)},d=(y="")=>{n=!0,i=y.replace(/\.+$/,""),process.stdout.write(`${ZF.default.gray(_Fe)}
2025
+ `),{files:o,diff:e7(`${c}${a}`,1e4)}}catch(e){this.#e.Sentry?.captureException(e,{tags:{operation:"codegen-git"}});return}}#Xe(){return["status","--porcelain=v1","-z","--ignore-submodules=dirty"]}async isCleanWorkTree(){try{return(await this.git(this.#Xe())).trim().length===0}catch{return!1}}async#Ze(e,r){let n=r.applyResults,i=[];for(let s of n)try{if(s.action==="delete"){let o=await this.deleteFile(s.filePath);o&&i.push(o)}else if(s.content){let o=await this.writeFile(s.filePath,s.content);o&&(this.#ie.add(o),i.push(o))}}catch(o){e.Sentry?.captureException(o)}return i}#Qe(){return this.#i?.folders?.length===1&&this.#i.folders[0].name==="."}#C(){return this.#i?.folders?.length===1||!this.#i?.folders?.length}resolveWorkspacePath(e,r){return qq({filePath:e,forceWorkspace:r,workspace:this.#i,workingDirectory:this.#s,sys:this.#e,canCollapseWorkspace:this.#C()})}#A(){try{let e=this.getSessionContext();return _o(e.turns)?.user.principals}catch{return}}absolutePathToWorkspaceUrl(e){return zq({absolutePath:e,workspace:this.#i,workingDirectory:this.#s,sys:this.#e,canCollapseWorkspace:this.#C()})}async launchEditor(e={}){let r,n,i;return e.filePath?(r=this.resolveWorkspacePath(e.filePath,!1).resolvedPath,n=e.line??void 0,i=e.column??void 0):r=this.#c,await this.#e.exists(r)?await this.#e.launchEditor({filePath:r,line:n,column:i}):{success:!1,message:`File not found: ${r}`}}async readFile(e,r){if(!r){let n=ko(e,"read",this.#r?.accessControl,this.#A());if(!n.allowed)throw new bt(`ACL denied: ${n.message}`)}try{if(e==="AGENTS.md"&&this.#i?.agentsMD)return this.#i.agentsMD;let{resolvedPath:n}=this.resolveWorkspacePath(e,!!r);if(await this.#e.exists(n))return await this.#e.readFile(n);if({resolvedPath:n}=this.resolveWorkspacePath(e,!0),await this.#e.exists(n))return await this.#e.readFile(n)}catch(n){this.#e.Sentry?.captureException(n,{extra:{filePath:e}})}return null}async getFileAtRef(e,r){if(!this.#t?.git)return null;try{let n=r;if(!n){let u=await this.getDefaultBranch();try{n=(await this.git(["merge-base",u,"HEAD"])).trim()}catch{n=u}}let{resolvedPath:i,workspaceFolder:s}=this.resolveWorkspacePath(e,!0),o=s?.path||this.#s,a=e;return o&&i.startsWith(o)&&(a=i.substring(o.length),a.startsWith("/")&&(a=a.substring(1))),await this.git(["show",`${n}:${a}`])}catch{return null}}async getSingleFileDiff(e){let r=await this.readFile(e,!0),n=await this.getFileAtRef(e),i;return n===null&&r!==null?i="create":n!==null&&r===null?i="delete":i="update",{oldContent:n,newContent:r,action:i}}async fileExists(e){let r=n=>n.startsWith(this.#s)?this.#e.relative(this.#s,n):n;try{if(e==="AGENTS.md"&&this.#i?.agentsMD)return{absolutePath:e,recommendedPath:void 0,workspaceFolder:void 0,virtual:!0};let{resolvedPath:n,workspaceFolder:i}=this.resolveWorkspacePath(e,!1);return await this.#e.exists(n)?{absolutePath:n,recommendedPath:void 0,workspaceFolder:i,virtual:!1}:i?{absolutePath:void 0,recommendedPath:void 0,workspaceFolder:i,virtual:!1}:({resolvedPath:n,workspaceFolder:i}=this.resolveWorkspacePath(e,!0),await this.#e.exists(n)?{absolutePath:n,recommendedPath:r(n),workspaceFolder:i,virtual:!1}:{absolutePath:void 0,recommendedPath:r(n),workspaceFolder:i,virtual:!1})}catch(n){this.#e.Sentry?.captureException(n,{extra:{filePath:e}})}return{absolutePath:void 0,recommendedPath:void 0,workspaceFolder:void 0,virtual:!1}}readFileSync(e,r){if(!r){let n=ko(e,"read",this.#r?.accessControl,this.#A());if(!n.allowed)throw new bt(`ACL denied: ${n.message}`)}try{if(e==="AGENTS.md"&&this.#i?.agentsMD)return this.#i.agentsMD;let{resolvedPath:n}=this.resolveWorkspacePath(e,!1);if(this.#e.existsSync(n))return this.#e.readFileSync(n);if({resolvedPath:n}=this.resolveWorkspacePath(e,!0),this.#e.existsSync(n))return this.#e.readFileSync(n)}catch(n){this.#e.Sentry?.captureException(n,{extra:{filePath:e}})}return null}async writeFile(e,r,n){if(!n){let i=ko(e,"write",this.#r?.accessControl,this.#A());if(!i.allowed)throw new bt(`ACL denied: ${i.message}`)}try{let{resolvedPath:i}=this.resolveWorkspacePath(e,!!n);return await this.#e.writeFile(i,r),i}catch(i){return this.#e.Sentry?.captureException(i,{extra:{filePath:e}}),null}}async listDir(e){let r=ko(e,"list",this.#r?.accessControl,this.#A());if(!r.allowed)throw new bt(`ACL denied: ${r.message}`);try{let{resolvedPath:n,workspaceFolder:i}=this.resolveWorkspacePath(e,!1);if(!await this.#e.exists(n))return[];let o=(await(0,jK.readdir)(n,{withFileTypes:!0})).map(a=>a.name+(a.isDirectory()?"/":""));if(this.#Qe())return fh({files:o.map(a=>this.#e.join(e,a).replace(/^\.\//,"")),policy:this.#r?.accessControl});if(i&&this.#i?.folders){let a=i.name||i.path;return fh({files:o.map(c=>`${a}/${this.#e.join(e,c).replace(/^\.\//,"")}`),policy:this.#r?.accessControl})}return fh({files:o,policy:this.#r?.accessControl})}catch(n){return this.#e.Sentry?.captureException(n,{extra:{dirPath:e}}),[]}}async stat(e,r){if(!r){let n=ko(e,"read",this.#r?.accessControl,this.#A());if(!n.allowed)throw new bt(`ACL denied: ${n.message}`)}try{let{resolvedPath:n}=this.resolveWorkspacePath(e,!1);if(await this.#e.exists(n))return await this.#e.stat(n)}catch(n){this.#e.Sentry?.captureException(n,{extra:{filePath:e}})}return null}async deleteFile(e,r){if(!r){let n=ko(e,"write",this.#r?.accessControl,this.#A());if(!n.allowed)throw new bt(`ACL denied: ${n.message}`)}try{let{resolvedPath:n}=this.resolveWorkspacePath(e,!!r);return await this.#e.exists(n)?(await this.#e.unlink(n),n):null}catch(n){return this.#e.Sentry?.captureException(n,{extra:{filePath:e}}),null}}getLinesStats(){let e=this.#p?.turns.reduce((r,n)=>{let i=n.applyResults.reduce((s,o)=>({added:s.added+o.addedLines,removed:s.removed+o.removedLines}),{added:0,removed:0});return{added:r.added+i.added,removed:r.removed+i.removed}},{added:0,removed:0})??{added:0,removed:0};return{...e,net:e.added-e.removed}}async getDiffFromRemote({numberOfContextLines:e,includeFilesOnly:r,filePaths:n}){if(!this.#t?.git)return[];try{let i=(await this.git(["branch","--show-current"])).trim();if(!i)throw new Error("Could not determine current branch");let s=!1;try{s=(await this.git(["remote"])).includes("origin")}catch(l){throw console.warn("No git remotes configured, cannot get diff from remote"),l}if(!s){console.warn("Origin remote not found, trying to get diff from main branch");try{return await this.getDiffFromParentBranch({numberOfContextLines:e,includeFilesOnly:r,filePaths:n})}catch(l){throw console.warn("Failed to get diff from main branch:",l),l}}let o=!1,a;try{let l=`origin/${i}`;if(o=(await this.git(["ls-remote","--heads","origin",i])).trim().length>0,o)a=l;else return await this.getDiffFromParentBranch({numberOfContextLines:e,includeFilesOnly:r,filePaths:n})}catch(l){throw console.warn("Failed to check remote branches:",l),l}let c=["diff",a];r?c.push("--name-status"):e!==void 0&&c.push(`-U${e}`),c.push("--"),n&&n.length>0&&c.push(...n);let u=await this.git(c);return!u||u.trim()===""?[]:zF(u,r)}catch(i){throw console.error("getDiffFromRemote error:",i),i}}async getDiff({mode:e="remote-parent-branch",numberOfContextLines:r,includeFilesOnly:n,filePaths:i}){if(!this.#t?.git)return{state:"error",error:new Error("Git not configured")};try{switch(e){case"remote-parent-branch":return{state:"success",diff:await this.getDiffFromParentBranch({numberOfContextLines:r,includeFilesOnly:n,filePaths:i})};case"remote-current-branch":return{state:"success",diff:await this.getDiffFromRemote({numberOfContextLines:r,includeFilesOnly:n,filePaths:i})};default:throw new Error(`Unknown diff mode: ${e}`)}}catch(s){return console.error(`getDiff error for mode '${e}':`,s),this.#e.Sentry?.captureException(s),{state:"error",error:s instanceof Error?s:new Error(String(s))}}}async getDefaultBranch(){try{let r=(await this.git(["remote","show","origin"])).match(/HEAD branch: (.+)/);if(r)return`origin/${r[1].trim()}`}catch{}try{if((await this.git(["ls-remote","--heads","origin","main"])).trim().length>0)return"origin/main"}catch{}try{if((await this.git(["ls-remote","--heads","origin","master"])).trim().length>0)return"origin/master"}catch{}try{let r=(await this.git(["ls-remote","--heads","origin"])).trim().split(`
2026
+ `).map(n=>n.split(" ")[1]).filter(n=>n&&!n.includes("HEAD"));if(r.length>0)return`origin/${r[0].replace("refs/heads/","")}`}catch{}throw new Error("Could not determine default branch. No remote branches found.")}async getDiffFromParentBranch({numberOfContextLines:e,includeFilesOnly:r,filePaths:n}){try{if(!(await this.git(["branch","--show-current"])).trim())throw new Error("Could not determine current branch");let s=await this.getDefaultBranch();if(!s)throw new Error("Could not find parent branch (main/master)");let o=["diff",`${s}...HEAD`];r?o.push("--name-status"):e!==void 0&&o.push(`-U${e}`),o.push("--"),n&&n.length>0&&o.push(...n);let a=await this.git(o);return!a||a.trim()===""?[]:zF(a,r)}catch(i){throw console.error("getDiffFromParentBranch error:",i),i}}}});function XF(){let{env:t}=YF.default,{TERM:e,TERM_PROGRAM:r}=t;return YF.default.platform!=="win32"?e!=="linux":!!t.WT_SESSION||!!t.TERMINUS_SUBLIME||t.ConEmuTask==="{cmd::Cmder}"||r==="Terminus-Sublime"||r==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||t.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var YF,UK=k(()=>{f();YF=z(require("node:process"),1)});var ZF,Gd,lg,Hn,QF,M0,_Fe,FFe,kFe,IFe,Vd=k(()=>{"use strict";f();UK();ZF=z(dr(),1),Gd=z(_y(),1),lg=z(dr(),1),Hn=()=>{let t=QF?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],e=QF?80:120,r,n=!1,i="",s="",o="",a=y=>{let b=y>1?"Something went wrong":"Canceled";n&&h(b,y)},c=(y,b)=>{console.error(b,y),a(2)},u=()=>a(1),l=()=>{process.on("uncaughtExceptionMonitor",c),process.on("unhandledRejection",c),process.on("SIGINT",u),process.on("SIGTERM",u),process.on("exit",a)},p=()=>{process.removeListener("uncaughtExceptionMonitor",c),process.removeListener("unhandledRejection",c),process.removeListener("SIGINT",u),process.removeListener("SIGTERM",u),process.removeListener("exit",a)},d=(y="")=>{n=!0,i=y.replace(/\.+$/,""),process.stdout.write(`${ZF.default.gray(_Fe)}
2027
2027
  `);let b=0,D=0;l(),process.env.CI||(r=setInterval(()=>{let w=ZF.default.magenta(t[b]),v=".".repeat(Math.floor(D)).slice(0,3);process.stdout.write(Gd.cursor.move(-999,-o.split(`
2028
2028
  `).length+1)),process.stdout.write(Gd.erase.down(o.split(`
2029
2029
  `).length));let x=`${w} ${i}${v}${s}`;process.stdout.write(x),b=b+1<t.length?b+1:0,D=D<t.length?D+.125:0,o=x},e))},h=(y,b=0)=>{i=y??i,n=!1,clearInterval(r);let D=b===0?(0,lg.green)(IFe):b===1?(0,lg.red)(FFe):(0,lg.red)(kFe);process.stdout.write(Gd.cursor.move(-999,-o.split(`
2030
2030
  `).length+1)),process.stdout.write(Gd.erase.down(o.split(`
2031
2031
  `).length)),process.stdout.write(`${D} ${i}
2032
- `),o=i,p()};return{start:d,stop:h,message:(y="")=>{i=y??i},extra:(y="")=>{s=y}}},QF=XF(),M0=(t,e)=>QF?t:e,_Fe=M0("\u2502","|"),FFe=M0("\u25A0","x"),kFe=M0("\u25B2","x"),IFe=M0("\u25C7","o")});async function Lc(t){let{default:e}=await import("open");await e(t)}var pg=k(()=>{"use strict";f()});async function B0(t,e,r){let n=t.isAbsolute(e)?e:t.resolve(t.cwd(),e),i=await t.readFile(n);if(!i)throw new Error(`Failed to read ${r} file: ${n}`);return N.info(`\u{1F4C4} Loaded ${r} from file: ${n}`),i}async function NFe(t,e,r){let n=r.httpsServerFiles?.key,i=r.httpsServerFiles?.cert,s=r.httpsServerFiles?.ca,o={...r.httpsServerOptions,key:n?await B0(t,n,"key"):r.httpsServerOptions?.key,cert:i?await B0(t,i,"cert"):r.httpsServerOptions?.cert,ca:s?await B0(t,s,"ca"):r.httpsServerOptions?.ca},a=Object.fromEntries(Object.entries(o).filter(([c,u])=>u!==void 0));if(Object.keys(a).length!==0)return a}async function L0(t,e){let r=t.cwd(),n=!!e.local||!e.projectId,i={workingDirectory:r,projectId:e.projectId,branchName:e.branchName,commitMode:"commits",mode:"init-and-launch",isLocal:n,allowedCommands:["npm *","pnpm *","yarn *","yarn","git *","export *","rails *","gem *","bundle *","rake *","echo *","cd *","find *","ls *","rm *","cp *","mv *","curl *","npx tsc *","head *","lsof *","kill *","ps *","awk *","cat *","grep *","sed *","tail *","touch *","mkdir *","npx *","env","printenv *","sleep *","netlify *","node *","tsx *"]};if(e.configJson)try{let p=JSON.parse(e.configJson);i=Object.assign({},i,p),i.isLocal?n=!0:i.projectId&&(n=!1,i.isLocal=!1)}catch(p){t.Sentry?.captureException(p)}else{let p=await qK(t,e);if(p&&await t.exists(p))try{let d=await t.readFile(p);if(d){let h=JSON.parse(d);i=Object.assign({},i,h)}}catch(d){t.Sentry?.captureException(d)}}i.command&&(i.devCommand||(i.devCommand=i.command),delete i.command);let s=e.c||e.command,o=e.p||e.port,a=e.installCommand,c=e.serverUrl,u=e.interactive&&!e.configJson&&!e.fusionInit&&n&&!e.chat;if(c)u=!1,i.serverUrl=c,s||(i.devCommand="");else if(s&&o){u=!1;let p="http://localhost";if(i.serverUrl)try{let d=new URL(i.serverUrl);p=`${d.protocol}//${d.hostname}`}catch{p="http://localhost"}i.serverUrl=`${p}:${o}`,i.devCommand=s}else s&&i.autoDetectDevServer&&(u=!1,i.devCommand=s);if(s&&o&&(u=!1),o&&!c&&(i.serverUrl=`http://localhost:${o}`),a&&(i.setupCommand=a),s&&(i.devCommand=s),s&&!i.serverUrl&&(i.autoDetectDevServer=!0,i.autoSuggestPort=!0),typeof e.authenticateProxy=="boolean"&&(i.authenticateProxy=e.authenticateProxy),typeof e.privacyMode=="boolean"&&e.privacyMode&&(i.privacyMode=Object.assign({},i.privacyMode,{encrypt:!0})),typeof e.autoDetectDevServer=="boolean"&&(i.autoDetectDevServer=e.autoDetectDevServer),typeof e.https=="boolean"&&(i.https=e.https),e.localHttpsDomain&&(i.localHttpsDomain=e.localHttpsDomain),typeof e.nativeApp=="boolean"&&(i.nativeApp=e.nativeApp),e.disabledTools){let p=e.disabledTools.split(",").map(d=>d.trim());i.disabledTools=p}if(i.httpsServerOptions=await NFe(t,e,i),u&&!e.chat){if(!i.devCommand){let p=await Et({message:"Enter the command to run for the dev server (e.g. 'npm run dev')",placeholder:"npm run dev",validate:d=>{if(d.trim()===""||d.length===0)return"Command cannot be empty"}});if(ge(p))return ye("Goodbye! \u{1F44B}"),await(0,ek.exit)(1);i.devCommand=p}if(!i.serverUrl){let p=await Et({message:"Enter the port number for the dev server",placeholder:"3000",validate:d=>{let h=Number(d);if(isNaN(h)||h<0||h>65535||Math.floor(h)!==h)return"Invalid port number, must be an integer between 0 and 65535"}});if(ge(p))return ye("Goodbye! \u{1F44B}"),await(0,ek.exit)(1);i.serverUrl=`http://localhost:${p}`}await tk(t,i,e)}if(typeof i.fusionServerPort=="string"){let p=parseInt(i.fusionServerPort);if(!isNaN(p))i.fusionServerPort=p;else throw new Error(`Invalid fusionServerPort: ${i.fusionServerPort}. Expected a number between 0 and 65535, got "${i.fusionServerPort}".`)}let l=i.privacyMode?.encryptionKeyPath;if(l&&i.privacyMode)try{let d=(await B0(t,l,"encryption key")).trim();i.privacyMode.encryptKey=d,delete i.privacyMode.encryptionKeyPath}catch(p){let d=new Error(`Failed to load encryption key from path: ${l}`,{cause:p});throw t.Sentry?.captureException(d),N.warn(d.message),d}return i}async function tk(t,e,r){let n=await qK(t,r);await t.writeFile(n,JSON.stringify(RFe(e,"workingDirectory","projectId","authenticateProxy","privacyMode"),null,2))}function zK(t,e){let r=Ax(e);t.Sentry?.setTag("isLocal",r.isLocal),t.Sentry?.setTag("commitMode",r.commitMode);let n=r.workspace?.folders.find(i=>i.enableGit)?.originalRepoUrl;if(n){let i=nh.some(s=>n.endsWith(s))?n:"custom-repo";t.Sentry?.setTag("repoUrl",i)}t.Sentry?.setContext("fusionConfig",{...r}),t.Sentry?.getCurrentScope().setContext("fusionConfig",{...r})}var ek,qK,RFe,rk=k(()=>{"use strict";f();Lu();Mt();ek=require("process");Eh();qK=async(t,e)=>{if(e.configPath){let i=t.resolve(t.cwd(),e.configPath);if(await t.exists(i))return i;throw new Error(`Fusion config file not found: ${i}`)}let r=["builder.config.json","fusion.config.json"],n=t.cwd();for(let i of r){let s=t.join(n,i);if(await t.exists(s))return s}return t.join(n,r[0])},RFe=(t,...e)=>{let r={};if(t&&typeof t=="object")for(let n in t)(!t.hasOwnProperty||t.hasOwnProperty(n))&&(e.includes(n)||(r[n]=t[n]));return r}});async function fg(t,e={}){let r=new URL("/design-systems/v1",Be);r.searchParams.set("apiKey",t.builderPublicKey),r.searchParams.set("userId",t.userId),e.includeGlobalScopeDesignSystems&&r.searchParams.set("includeGlobalScopeDesignSystems","true"),e.includeDocumentCount&&r.searchParams.set("includeDocumentCount","true");let n=await Fe(r,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.builderPrivateKey}`}});if(!n.ok)return[];let i=await n.json()??[];return e.onlyEditAccess?i.filter(s=>s.spaceId===t.builderPublicKey):i}var nk,GK,ik,Hd,dg,$0,sk,OFe,MFe,BFe,ok,VK,Di,xs,LFe,HK,KK,WK,ak,JK,zo=k(()=>{"use strict";f();hn();wh();nk=z(require("@sentry/node"),1);Wr();an();Mr();qn();Mt();GK=require("path"),ik="AGENTS.md",Hd="icons.mdx",dg="tokens.mdx",$0="installation.md",sk="repo-indexing",OFe=[{value:"space",label:"Space",hint:"Available to all applications in your current space"}],MFe=[{value:"organization",label:"Organization",hint:"Available to all applications in your organization"}],BFe=[{value:"global",label:"Global",hint:"Available to all applications in the Builder platform"}],ok=async(t,e,r)=>{if(!t.userId)throw new Error("User ID is required");let i=e?.isAdminInOrganization,s=e?.email?.includes("@builder.io"),o=[...OFe];if((i||s)&&o.push(...MFe),s&&o.push(...BFe),o.length===1)return o[0].value;if(r){if(!o.some(u=>u.value===r))throw new Error(`You don't have permission to use the scope "${r}"`);return r}let a=await on({message:"What is your design system scope?",options:o});if(!ge(a))return a},VK=async(t,e)=>{try{let r=t.getAppRootDir(),n=await Fs(t,r);if(!n)return{name:void 0,version:void 0};let i=e??n.name,s;if(e){let o=n.dependencies?.[e]||n.devDependencies?.[e];s=o?.replace(/^[\^~>=<]+/,"")||o}else s=n.version;return{name:i,version:s}}catch(r){return console.error("Error parsing design system",r),{name:void 0,version:void 0}}},Di=async(t,e,r)=>{try{let n=new URL("/mappings/store-component-docs",Be);n.searchParams.set("apiKey",t.builderPublicKey),n.searchParams.set("userId",t.userId);let i=await Fe(n,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.builderPrivateKey}`},body:JSON.stringify(e)});if(!i.ok){let s=await i.text();throw r&&console.error("API request failed:",i.status,s),new Error(`Failed to store component group: ${i.status} ${s}`)}return await i.json()}catch(n){throw n}},xs=async(t,e,r,n,i,s,o,a={},c)=>{let{maxTokens:u,retriesAllowed:l=0,expectFile:p="tool",include:d,exclude:h,instructions:m}=a,g=null,y=p==="tool"?{...t,writeFile:async(w,v)=>(g=typeof v=="string"?v:v.toString(),Promise.resolve())}:t,D={accessControl:LFe(d,h),workingDirectory:t.cwd(),...o&&{workspace:o}};s&&!(0,GK.isAbsolute)(s)&&D.accessControl?.entries?.push({action:"allow",resource:`**/node_modules/${s}/**/*`,permissions:["list","read"]},{action:"allow",resource:`!**/node_modules/${s}/node_modules/**/*`,permissions:["list"]},{action:"deny",resource:`**/node_modules/${s}/node_modules`,permissions:["list","read","write"]});try{let w=new Bc({maxTokens:u,sys:y,credentials:e,position:"repo-indexing",mode:"quality-v4",sessionOrCompletionId:r,...s&&!s.startsWith("/")&&{workingDirectory:`node_modules/${s}`},fusionConfig:D,builtInCustomInstructions:m?[{id:"repo-indexing-instructions",name:"repo-indexing-instructions",type:"always",content:m}]:void 0,enabledTools:["Read","Write","Glob","Bash","Grep","ReadRule","TodoRead","TodoWrite"],...c&&{metadata:c}});if(i&&w.setDebug(i),await w.initializeSession({skipSessionLoading:!0}),w.connectToEventLoop(!1,async v=>{switch(v.type){case"error":{i&&console.error(`
2032
+ `),o=i,p()};return{start:d,stop:h,message:(y="")=>{i=y??i},extra:(y="")=>{s=y}}},QF=XF(),M0=(t,e)=>QF?t:e,_Fe=M0("\u2502","|"),FFe=M0("\u25A0","x"),kFe=M0("\u25B2","x"),IFe=M0("\u25C7","o")});async function Lc(t){let{default:e}=await import("open");await e(t)}var pg=k(()=>{"use strict";f()});async function B0(t,e,r){let n=t.isAbsolute(e)?e:t.resolve(t.cwd(),e),i=await t.readFile(n);if(!i)throw new Error(`Failed to read ${r} file: ${n}`);return N.info(`\u{1F4C4} Loaded ${r} from file: ${n}`),i}async function NFe(t,e,r){let n=r.httpsServerFiles?.key,i=r.httpsServerFiles?.cert,s=r.httpsServerFiles?.ca,o={...r.httpsServerOptions,key:n?await B0(t,n,"key"):r.httpsServerOptions?.key,cert:i?await B0(t,i,"cert"):r.httpsServerOptions?.cert,ca:s?await B0(t,s,"ca"):r.httpsServerOptions?.ca},a=Object.fromEntries(Object.entries(o).filter(([c,u])=>u!==void 0));if(Object.keys(a).length!==0)return a}async function L0(t,e){let r=t.cwd(),n=!!e.local||!e.projectId,i={workingDirectory:r,projectId:e.projectId,branchName:e.branchName,commitMode:"commits",mode:"init-and-launch",isLocal:n,allowedCommands:["npm *","pnpm *","yarn *","yarn","gradle *","gradle","./gradlew *","./gradlew","git *","export *","rails *","gem *","bundle *","rake *","echo *","cd *","find *","ls *","rm *","cp *","mv *","curl *","npx tsc *","head *","lsof *","kill *","ps *","awk *","cat *","grep *","sed *","tail *","touch *","mkdir *","npx *","env","printenv *","sleep *","netlify *","node *","tsx *"]};if(e.configJson)try{let p=JSON.parse(e.configJson);i=Object.assign({},i,p),i.isLocal?n=!0:i.projectId&&(n=!1,i.isLocal=!1)}catch(p){t.Sentry?.captureException(p)}else{let p=await qK(t,e);if(p&&await t.exists(p))try{let d=await t.readFile(p);if(d){let h=JSON.parse(d);i=Object.assign({},i,h)}}catch(d){t.Sentry?.captureException(d)}}i.command&&(i.devCommand||(i.devCommand=i.command),delete i.command);let s=e.c||e.command,o=e.p||e.port,a=e.installCommand,c=e.serverUrl,u=e.interactive&&!e.configJson&&!e.fusionInit&&n&&!e.chat;if(c)u=!1,i.serverUrl=c,s||(i.devCommand="");else if(s&&o){u=!1;let p="http://localhost";if(i.serverUrl)try{let d=new URL(i.serverUrl);p=`${d.protocol}//${d.hostname}`}catch{p="http://localhost"}i.serverUrl=`${p}:${o}`,i.devCommand=s}else s&&i.autoDetectDevServer&&(u=!1,i.devCommand=s);if(s&&o&&(u=!1),o&&!c&&(i.serverUrl=`http://localhost:${o}`),a&&(i.setupCommand=a),s&&(i.devCommand=s),s&&!i.serverUrl&&(i.autoDetectDevServer=!0,i.autoSuggestPort=!0),typeof e.authenticateProxy=="boolean"&&(i.authenticateProxy=e.authenticateProxy),typeof e.privacyMode=="boolean"&&e.privacyMode&&(i.privacyMode=Object.assign({},i.privacyMode,{encrypt:!0})),typeof e.autoDetectDevServer=="boolean"&&(i.autoDetectDevServer=e.autoDetectDevServer),typeof e.https=="boolean"&&(i.https=e.https),e.localHttpsDomain&&(i.localHttpsDomain=e.localHttpsDomain),typeof e.nativeApp=="boolean"&&(i.nativeApp=e.nativeApp),e.disabledTools){let p=e.disabledTools.split(",").map(d=>d.trim());i.disabledTools=p}if(i.httpsServerOptions=await NFe(t,e,i),u&&!e.chat){if(!i.devCommand){let p=await Et({message:"Enter the command to run for the dev server (e.g. 'npm run dev')",placeholder:"npm run dev",validate:d=>{if(d.trim()===""||d.length===0)return"Command cannot be empty"}});if(ge(p))return ye("Goodbye! \u{1F44B}"),await(0,ek.exit)(1);i.devCommand=p}if(!i.serverUrl){let p=await Et({message:"Enter the port number for the dev server",placeholder:"3000",validate:d=>{let h=Number(d);if(isNaN(h)||h<0||h>65535||Math.floor(h)!==h)return"Invalid port number, must be an integer between 0 and 65535"}});if(ge(p))return ye("Goodbye! \u{1F44B}"),await(0,ek.exit)(1);i.serverUrl=`http://localhost:${p}`}await tk(t,i,e)}if(typeof i.fusionServerPort=="string"){let p=parseInt(i.fusionServerPort);if(!isNaN(p))i.fusionServerPort=p;else throw new Error(`Invalid fusionServerPort: ${i.fusionServerPort}. Expected a number between 0 and 65535, got "${i.fusionServerPort}".`)}let l=i.privacyMode?.encryptionKeyPath;if(l&&i.privacyMode)try{let d=(await B0(t,l,"encryption key")).trim();i.privacyMode.encryptKey=d,delete i.privacyMode.encryptionKeyPath}catch(p){let d=new Error(`Failed to load encryption key from path: ${l}`,{cause:p});throw t.Sentry?.captureException(d),N.warn(d.message),d}return i}async function tk(t,e,r){let n=await qK(t,r);await t.writeFile(n,JSON.stringify(RFe(e,"workingDirectory","projectId","authenticateProxy","privacyMode"),null,2))}function zK(t,e){let r=Ax(e);t.Sentry?.setTag("isLocal",r.isLocal),t.Sentry?.setTag("commitMode",r.commitMode);let n=r.workspace?.folders.find(i=>i.enableGit)?.originalRepoUrl;if(n){let i=nh.some(s=>n.endsWith(s))?n:"custom-repo";t.Sentry?.setTag("repoUrl",i)}t.Sentry?.setContext("fusionConfig",{...r}),t.Sentry?.getCurrentScope().setContext("fusionConfig",{...r})}var ek,qK,RFe,rk=k(()=>{"use strict";f();Lu();Mt();ek=require("process");Eh();qK=async(t,e)=>{if(e.configPath){let i=t.resolve(t.cwd(),e.configPath);if(await t.exists(i))return i;throw new Error(`Fusion config file not found: ${i}`)}let r=["builder.config.json","fusion.config.json"],n=t.cwd();for(let i of r){let s=t.join(n,i);if(await t.exists(s))return s}return t.join(n,r[0])},RFe=(t,...e)=>{let r={};if(t&&typeof t=="object")for(let n in t)(!t.hasOwnProperty||t.hasOwnProperty(n))&&(e.includes(n)||(r[n]=t[n]));return r}});async function fg(t,e={}){let r=new URL("/design-systems/v1",Be);r.searchParams.set("apiKey",t.builderPublicKey),r.searchParams.set("userId",t.userId),e.includeGlobalScopeDesignSystems&&r.searchParams.set("includeGlobalScopeDesignSystems","true"),e.includeDocumentCount&&r.searchParams.set("includeDocumentCount","true");let n=await Fe(r,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.builderPrivateKey}`}});if(!n.ok)return[];let i=await n.json()??[];return e.onlyEditAccess?i.filter(s=>s.spaceId===t.builderPublicKey):i}var nk,GK,ik,Hd,dg,$0,sk,OFe,MFe,BFe,ok,VK,Di,xs,LFe,HK,KK,WK,ak,JK,zo=k(()=>{"use strict";f();hn();wh();nk=z(require("@sentry/node"),1);Wr();an();Mr();qn();Mt();GK=require("path"),ik="AGENTS.md",Hd="icons.mdx",dg="tokens.mdx",$0="installation.md",sk="repo-indexing",OFe=[{value:"space",label:"Space",hint:"Available to all applications in your current space"}],MFe=[{value:"organization",label:"Organization",hint:"Available to all applications in your organization"}],BFe=[{value:"global",label:"Global",hint:"Available to all applications in the Builder platform"}],ok=async(t,e,r)=>{if(!t.userId)throw new Error("User ID is required");let i=e?.isAdminInOrganization,s=e?.email?.includes("@builder.io"),o=[...OFe];if((i||s)&&o.push(...MFe),s&&o.push(...BFe),o.length===1)return o[0].value;if(r){if(!o.some(u=>u.value===r))throw new Error(`You don't have permission to use the scope "${r}"`);return r}let a=await on({message:"What is your design system scope?",options:o});if(!ge(a))return a},VK=async(t,e)=>{try{let r=t.getAppRootDir(),n=await Fs(t,r);if(!n)return{name:void 0,version:void 0};let i=e??n.name,s;if(e){let o=n.dependencies?.[e]||n.devDependencies?.[e];s=o?.replace(/^[\^~>=<]+/,"")||o}else s=n.version;return{name:i,version:s}}catch(r){return console.error("Error parsing design system",r),{name:void 0,version:void 0}}},Di=async(t,e,r)=>{try{let n=new URL("/mappings/store-component-docs",Be);n.searchParams.set("apiKey",t.builderPublicKey),n.searchParams.set("userId",t.userId);let i=await Fe(n,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.builderPrivateKey}`},body:JSON.stringify(e)});if(!i.ok){let s=await i.text();throw r&&console.error("API request failed:",i.status,s),new Error(`Failed to store component group: ${i.status} ${s}`)}return await i.json()}catch(n){throw n}},xs=async(t,e,r,n,i,s,o,a={},c)=>{let{maxTokens:u,retriesAllowed:l=0,expectFile:p="tool",include:d,exclude:h,instructions:m}=a,g=null,y=p==="tool"?{...t,writeFile:async(w,v)=>(g=typeof v=="string"?v:v.toString(),Promise.resolve())}:t,D={accessControl:LFe(d,h),workingDirectory:t.cwd(),...o&&{workspace:o}};s&&!(0,GK.isAbsolute)(s)&&D.accessControl?.entries?.push({action:"allow",resource:`**/node_modules/${s}/**/*`,permissions:["list","read"]},{action:"allow",resource:`!**/node_modules/${s}/node_modules/**/*`,permissions:["list"]},{action:"deny",resource:`**/node_modules/${s}/node_modules`,permissions:["list","read","write"]});try{let w=new Bc({maxTokens:u,sys:y,credentials:e,position:"repo-indexing",mode:"quality-v4",sessionOrCompletionId:r,...s&&!s.startsWith("/")&&{workingDirectory:`node_modules/${s}`},fusionConfig:D,builtInCustomInstructions:m?[{id:"repo-indexing-instructions",name:"repo-indexing-instructions",type:"always",content:m}]:void 0,enabledTools:["Read","Write","Glob","Bash","Grep","ReadRule","TodoRead","TodoWrite"],...c&&{metadata:c}});if(i&&w.setDebug(i),await w.initializeSession({skipSessionLoading:!0}),w.connectToEventLoop(!1,async v=>{switch(v.type){case"error":{i&&console.error(`
2033
2033
  `,v.message);break}}}),await w.sendMessage(n),await w.waitUntilIdle(),await w.close(),p!=="tool"){let v=t.join(t.cwd(),p);if(await t.exists(v)){g=await t.readFile(v);try{await t.unlink(v)}catch(C){nk.captureException(C,{extra:{expectedFile:p,expectedFilePath:v}})}}}if(!g){let v=nk.captureException(new bt("Repo indexing failed: No essential files were written"),{tags:{...a?.tags,sessionId:r}});throw new bt(`Sorry, we ran into a problem when indexing your components.
2034
2034
  Session ID: ${r}.
2035
2035
  Please try again. If the issue persists, please contact support@builder.io. and provide the error ID: ${v}`)}return g}catch(w){if(l===0)throw w;return xs(t,e,r,n,i,s,o,{...a,retriesAllowed:l-1},c)}},LFe=(t,e)=>{let r=t?(Array.isArray(t)?t:[t]).map(o=>o.trim()).filter(o=>o.length>0):[],n=e?(Array.isArray(e)?e:[e]).map(o=>o.trim()).filter(o=>o.length>0):[],i=[];i.push({action:"deny",resource:"*.mapper.tsx",description:"Do not index mapper files.",permissions:["read","write","list"]});for(let o of n)i.push({action:"deny",resource:o,description:"Excluded by --exclude flag.",permissions:["read","write","list"]});if(r.length>0){i.push({action:"allow",resource:".",permissions:["read","list"]});for(let o of r)i.push({action:"allow",resource:o,description:"Included by --include flag.",permissions:["read","list"]})}else i.push({action:"allow",resource:".",permissions:["read","list"]}),i.push({action:"allow",resource:"**/*",permissions:["read","list"]});i.push({action:"allow",resource:ik,permissions:["write"]},{action:"allow",resource:"**/repo-indexing/*.mdx",permissions:["write"]},{action:"allow",resource:"component-groups.json",permissions:["write"]},{action:"allow",resource:".icon_discovery_staging/**/*",permissions:["write"]},{action:"allow",resource:".token_discovery_staging/**/*",permissions:["write"]},{action:"allow",resource:"installation.json",permissions:["write"]});let s="You can read all files, but you can only write AGENTS.md, component-groups.json, icons.json, installation.json, .icon_discovery_staging/**/* and repo-indexing/*.mdx.";return r.length>0&&(s=`You can only read files matching these patterns: ${r.join(", ")}. You can only write AGENTS.md, component-groups.json, icons.json, installation.json, .icon_discovery_staging/**/* and repo-indexing/*.mdx.`),n.length>0&&(s+=` Excluded patterns: ${n.join(", ")}.`),{denyDescription:s,entries:i}};HK=(t,e)=>e.find(r=>r.designSystemName===t)||null,KK=(t,e,r,n)=>n&&n.find(i=>i.designSystemName===e&&i.scope===r)||null,WK=async(t,e)=>{let r=new URL("/design-systems/v1",Be);r.searchParams.set("apiKey",t.builderPublicKey),r.searchParams.set("userId",t.userId);let n=await Fe(r,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.builderPrivateKey}`},body:JSON.stringify(e)});if(!n.ok){let o=(await n.json()).message||"Failed to add design system";throw new Error(o)}return(await n.json()).id},ak=async(t,e)=>{let r=new URL(`/design-systems/v1/${e.id}`,Be);r.searchParams.set("apiKey",t.builderPublicKey),r.searchParams.set("userId",t.userId);let n=await Fe(r,{method:"PATCH",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t.builderPrivateKey}`},body:JSON.stringify(e)});if(!n.ok)throw new Error("Failed to update design system");return await n.json()},JK=async t=>{let e=t.join(t.getAppRootDir(),sk);try{return await t.exists(e)?(await t.readdir(e)).filter(s=>s.endsWith(".mdx")||s.endsWith(".md")).length>0:!1}catch{return!1}}});async function $Fe(t){let e="please, enter your own prompt",r=t.getCurrentState(),n=t.getLastApplyResultsTurn();switch(r){case"initial-with-url":{let i='e.g., "add a new contact page", "update the card component", "add a header to the layout of the app"',s=await Et({message:`Describe how the design integrates into your codebase: ${(0,Ie.dim)("or Ctrl+C to exit")}`,placeholder:i,validate(o){if(o.length===0||o===i)return"please, enter a detailed instruction";if(o.length<10)return"a more detailed instruction is needed"}});return ge(s)?{command:"exit",userPrompt:void 0,feedback:void 0}:{command:void 0,userPrompt:s??"integrate design into the app, might be a new page/component/layout depending on the design",feedback:void 0}}case"initial-without-url":{let i='e.g., "add a new page", "add a new component", "update the button component"',s=await Et({message:`What do you want to do? ${(0,Ie.dim)("or Ctrl+C to exit")}`,placeholder:i,validate(o){if(o.length===0||o===i)return e}});return ge(s)?{command:"exit",userPrompt:void 0,feedback:void 0}:{command:void 0,userPrompt:s??"integrate design into the app, might be a new page/component/layout depending on the design",feedback:void 0}}case"abort":{let i='e.g., "make sure to keep X, while removing Y"',s=await Et({message:`Okey! what do you want to do? ${(0,Ie.dim)("or Ctrl+C to exit")}`,placeholder:i,validate(o){if(o.length===0||o===i)return e}});return ge(s)?(await t.acceptCode(),{command:"exit",userPrompt:void 0,feedback:void 0}):{command:void 0,userPrompt:s??"integrate design into the app, might be a new page/component/layout depending on the design",feedback:void 0}}case"error":{let i="Press Enter to retry or prompt how to proceed",s=await Et({message:`Mmmh! something went wrong, let's try again: ${(0,Ie.dim)("or Ctrl+C to exit")}`,placeholder:i,validate:void 0});if(ge(s))return await t.acceptCode(),{command:"exit",userPrompt:void 0,feedback:void 0};let o=s?.trim();return!o||o.length===0||o===i?{command:void 0,userPrompt:"Retry the last failed instruction/command and continue if successful",feedback:void 0}:{command:void 0,userPrompt:o,feedback:void 0}}case"success":{let i='e.g., "Plan, search, build"';if(!n?.applyResults.length){let o=await Et({message:">",placeholder:i,validate(a){if(a.length===0||a===i)return e}});return ge(o)?(await t.acceptCode(),{command:"exit",userPrompt:void 0,feedback:void 0}):{command:void 0,userPrompt:o??"integrate design into the app, might be a new page/component/layout depending on the design",feedback:void 0}}let s=t.lastTurnHasChanges()?await on({message:`What do you want to do next? ${(0,Ie.dim)("or Ctrl+C to exit")}`,options:[{value:"good",label:"\u{1F44D} Accept and Continue",hint:"you will be able to keep prompting for more changes"},{value:"bad",label:"\u{1F44E} Refine",hint:"something went wrong, but I wanna refine instead of a complete undo"},{value:"undo",label:"\u23EE\uFE0F Undo last changes",hint:"want to revert the last changes"}]}):"continue";if(ge(s))return await t.acceptCode(),{command:"exit",userPrompt:void 0,feedback:void 0};if(s==="continue"){let o='e.g., "implement the new page"',a=await Et({message:`What else can I do for you? ${(0,Ie.dim)("or Ctrl+C to exit")}`,placeholder:o,validate(c){if(!c||c===o)return"Ctrl+C to exit"}});if(ge(a))return await t.acceptCode(),{feedback:void 0,command:"exit",userPrompt:void 0}}if(s==="good"){t.sendFeedback({feedbackSentiment:"positive"});let o='e.g., "Make it mobile-friendly", "Add form validation", "add docs"',a=await Et({message:`Describe any additional improvements: ${(0,Ie.dim)("or Ctrl+C to exit")}`,placeholder:o,validate(c){if(!c||c===o)return"Ctrl+C to exit"}});return ge(a)?(await t.acceptCode(),{feedback:"positive",command:"exit",userPrompt:void 0}):{userPrompt:a,feedback:"positive",command:void 0}}if(s==="bad"){t.sendFeedback({feedbackSentiment:"negative"});let o=`e.g., "code seems to be broken", "i can't see the page"`,a=await Et({message:`What went wrong? Please be more detailed this time ${(0,Ie.dim)("or Ctrl+C to exit")}`,placeholder:o,validate(c){if(!c||c===o)return"Ctrl+C to exit"}});return ge(a)?(await t.acceptCode(),{command:"exit",userPrompt:void 0,feedback:void 0}):(t.sendFeedback({feedbackSentiment:"negative",feedbackText:a}),{feedback:"negative",userPrompt:`Last changes were not good, here's my feedback:
@@ -2390,7 +2390,7 @@ Please see the 3.x to 4.x migration guide for details on how to update your app.
2390
2390
  `)+`\r
2391
2391
  \r
2392
2392
  `+r)}function $l(t,e,r,n,i,s){if(t.listenerCount("wsClientError")){let o=new Error(i);Error.captureStackTrace(o,$l),t.emit("wsClientError",o,r,e)}else xy(r,n,i,s)}});var tie=S((_0t,eie)=>{f();var dN=class{constructor(e,r,n){this.etaBufferLength=e||100,this.valueBuffer=[n],this.timeBuffer=[r],this.eta="0"}update(e,r,n){this.valueBuffer.push(r),this.timeBuffer.push(e),this.calculate(n-r)}getTime(){return this.eta}calculate(e){let r=this.valueBuffer.length,n=Math.min(this.etaBufferLength,r),i=this.valueBuffer[r-1]-this.valueBuffer[r-n],s=this.timeBuffer[r-1]-this.timeBuffer[r-n],o=i/s;this.valueBuffer=this.valueBuffer.slice(-this.etaBufferLength),this.timeBuffer=this.timeBuffer.slice(-this.etaBufferLength);let a=Math.ceil(e/o/1e3);isNaN(a)?this.eta="NULL":isFinite(a)?a>1e7?this.eta="INF":a<0?this.eta=0:this.eta=a:this.eta="INF"}};eie.exports=dN});var mN=S((k0t,rie)=>{f();var jl=require("readline"),fN=class{constructor(e){this.stream=e,this.linewrap=!0,this.dy=0}cursorSave(){this.stream.isTTY&&this.stream.write("\x1B7")}cursorRestore(){this.stream.isTTY&&this.stream.write("\x1B8")}cursor(e){this.stream.isTTY&&(e?this.stream.write("\x1B[?25h"):this.stream.write("\x1B[?25l"))}cursorTo(e=null,r=null){this.stream.isTTY&&jl.cursorTo(this.stream,e,r)}cursorRelative(e=null,r=null){this.stream.isTTY&&(this.dy=this.dy+r,jl.moveCursor(this.stream,e,r))}cursorRelativeReset(){this.stream.isTTY&&(jl.moveCursor(this.stream,0,-this.dy),jl.cursorTo(this.stream,0,null),this.dy=0)}clearRight(){this.stream.isTTY&&jl.clearLine(this.stream,1)}clearLine(){this.stream.isTTY&&jl.clearLine(this.stream,0)}clearBottom(){this.stream.isTTY&&jl.clearScreenDown(this.stream)}newline(){this.stream.write(`
2393
- `),this.dy++}write(e,r=!1){this.linewrap===!0&&r===!1?this.stream.write(e.substr(0,this.getWidth())):this.stream.write(e)}lineWrapping(e){this.stream.isTTY&&(this.linewrap=e,e?this.stream.write("\x1B[?7h"):this.stream.write("\x1B[?7l"))}isTTY(){return this.stream.isTTY===!0}getWidth(){return this.stream.columns||(this.stream.isTTY?80:200)}};rie.exports=fN});var iie=S((N0t,nie)=>{"use strict";f();nie.exports=({onlyFirst:t=!1}={})=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}});var oie=S((O0t,sie)=>{"use strict";f();var U6e=iie();sie.exports=t=>typeof t=="string"?t.replace(U6e(),""):t});var cie=S((B0t,hN)=>{"use strict";f();var aie=t=>Number.isNaN(t)?!1:t>=4352&&(t<=4447||t===9001||t===9002||11904<=t&&t<=12871&&t!==12351||12880<=t&&t<=19903||19968<=t&&t<=42182||43360<=t&&t<=43388||44032<=t&&t<=55203||63744<=t&&t<=64255||65040<=t&&t<=65049||65072<=t&&t<=65131||65281<=t&&t<=65376||65504<=t&&t<=65510||110592<=t&&t<=110593||127488<=t&&t<=127569||131072<=t&&t<=262141);hN.exports=aie;hN.exports.default=aie});var lie=S(($0t,uie)=>{"use strict";f();uie.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\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\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])|\uD83C[\uDF3E\uDF73\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])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\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])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\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\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\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\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\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\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*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\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\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\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[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var die=S((U0t,gN)=>{"use strict";f();var q6e=oie(),z6e=cie(),G6e=lie(),pie=t=>{if(typeof t!="string"||t.length===0||(t=q6e(t),t.length===0))return 0;t=t.replace(G6e()," ");let e=0;for(let r=0;r<t.length;r++){let n=t.codePointAt(r);n<=31||n>=127&&n<=159||n>=768&&n<=879||(n>65535&&r++,e+=z6e(n)?2:1)}return e};gN.exports=pie;gN.exports.default=pie});var yN=S((z0t,fie)=>{f();fie.exports=function(e,r,n){if(r.autopadding!==!0)return e;function i(s,o){return(r.autopaddingChar+s).slice(-o)}switch(n){case"percentage":return i(e,3);default:return e}}});var bN=S((V0t,mie)=>{f();mie.exports=function(e,r){let n=Math.round(e*r.barsize),i=r.barsize-n;return r.barCompleteString.substr(0,n)+r.barGlue+r.barIncompleteString.substr(0,i)}});var vN=S((K0t,hie)=>{f();hie.exports=function(e,r,n){function i(o){return n?n*Math.round(o/n):o}function s(o){return(r.autopaddingChar+o).slice(-2)}return e>3600?s(Math.floor(e/3600))+"h"+s(i(e%3600/60))+"m":e>60?s(Math.floor(e/60))+"m"+s(i(e%60))+"s":e>10?s(i(e))+"s":s(e)+"s"}});var xN=S((J0t,gie)=>{f();var V6e=die(),H6e=yN(),K6e=bN(),W6e=vN();gie.exports=function(e,r,n){let i=e.format,s=e.formatTime||W6e,o=e.formatValue||H6e,a=e.formatBar||K6e,c=Math.floor(r.progress*100)+"",u=r.stopTime||Date.now(),l=Math.round((u-r.startTime)/1e3),p=Object.assign({},n,{bar:a(r.progress,e),percentage:o(c,e,"percentage"),total:o(r.total,e,"total"),value:o(r.value,e,"value"),eta:o(r.eta,e,"eta"),eta_formatted:s(r.eta,e,5),duration:o(l,e,"duration"),duration_formatted:s(l,e,1)});i=i.replace(/\{(\w+)\}/g,function(m,g){return typeof p[g]<"u"?p[g]:m});let d=Math.max(0,r.maxWidth-V6e(i)-2),h=Math.floor(d/2);switch(e.align){case"right":i=d>0?" ".repeat(d)+i:i;break;case"center":i=h>0?" ".repeat(h)+i:i;break;case"left":default:break}return i}});var mw=S((X0t,yie)=>{f();function Vt(t,e){return typeof t>"u"||t===null?e:t}yie.exports={parse:function(e,r){let n={},i=Object.assign({},r,e);return n.throttleTime=1e3/Vt(i.fps,10),n.stream=Vt(i.stream,process.stderr),n.terminal=Vt(i.terminal,null),n.clearOnComplete=Vt(i.clearOnComplete,!1),n.stopOnComplete=Vt(i.stopOnComplete,!1),n.barsize=Vt(i.barsize,40),n.align=Vt(i.align,"left"),n.hideCursor=Vt(i.hideCursor,!1),n.linewrap=Vt(i.linewrap,!1),n.barGlue=Vt(i.barGlue,""),n.barCompleteChar=Vt(i.barCompleteChar,"="),n.barIncompleteChar=Vt(i.barIncompleteChar,"-"),n.format=Vt(i.format,"progress [{bar}] {percentage}% | ETA: {eta}s | {value}/{total}"),n.formatTime=Vt(i.formatTime,null),n.formatValue=Vt(i.formatValue,null),n.formatBar=Vt(i.formatBar,null),n.etaBufferLength=Vt(i.etaBuffer,10),n.etaAsynchronousUpdate=Vt(i.etaAsynchronousUpdate,!1),n.progressCalculationRelative=Vt(i.progressCalculationRelative,!1),n.synchronousUpdate=Vt(i.synchronousUpdate,!0),n.noTTYOutput=Vt(i.noTTYOutput,!1),n.notTTYSchedule=Vt(i.notTTYSchedule,2e3),n.emptyOnZero=Vt(i.emptyOnZero,!1),n.forceRedraw=Vt(i.forceRedraw,!1),n.autopadding=Vt(i.autopadding,!1),n.gracefulExit=Vt(i.gracefulExit,!1),n},assignDerivedOptions:function(e){return e.barCompleteString=e.barCompleteChar.repeat(e.barsize+1),e.barIncompleteString=e.barIncompleteChar.repeat(e.barsize+1),e.autopaddingChar=e.autopadding?Vt(e.autopaddingChar," "):"",e}}});var DN=S((eDt,vie)=>{f();var bie=tie(),J6e=mN(),Y6e=xN(),X6e=mw(),Z6e=require("events");vie.exports=class extends Z6e{constructor(e){super(),this.options=X6e.assignDerivedOptions(e),this.terminal=this.options.terminal?this.options.terminal:new J6e(this.options.stream),this.value=0,this.startValue=0,this.total=100,this.lastDrawnString=null,this.startTime=null,this.stopTime=null,this.lastRedraw=Date.now(),this.eta=new bie(this.options.etaBufferLength,0,0),this.payload={},this.isActive=!1,this.formatter=typeof this.options.format=="function"?this.options.format:Y6e}render(e=!1){let r={progress:this.getProgress(),eta:this.eta.getTime(),startTime:this.startTime,stopTime:this.stopTime,total:this.total,value:this.value,maxWidth:this.terminal.getWidth()};this.options.etaAsynchronousUpdate&&this.updateETA();let n=this.formatter(this.options,r,this.payload);(e||this.options.forceRedraw||this.options.noTTYOutput&&!this.terminal.isTTY()||this.lastDrawnString!=n)&&(this.emit("redraw-pre"),this.terminal.cursorTo(0,null),this.terminal.write(n),this.terminal.clearRight(),this.lastDrawnString=n,this.lastRedraw=Date.now(),this.emit("redraw-post"))}start(e,r,n){this.value=r||0,this.total=typeof e<"u"&&e>=0?e:100,this.startValue=r||0,this.payload=n||{},this.startTime=Date.now(),this.stopTime=null,this.lastDrawnString="",this.eta=new bie(this.options.etaBufferLength,this.startTime,this.value),this.isActive=!0,this.emit("start",e,r)}stop(){this.isActive=!1,this.stopTime=Date.now(),this.emit("stop",this.total,this.value)}update(e,r={}){typeof e=="number"&&(this.value=e,this.eta.update(Date.now(),e,this.total));let n=(typeof e=="object"?e:r)||{};this.emit("update",this.total,this.value);for(let i in n)this.payload[i]=n[i];this.value>=this.getTotal()&&this.options.stopOnComplete&&this.stop()}getProgress(){let e=this.value/this.total;return this.options.progressCalculationRelative&&(e=(this.value-this.startValue)/(this.total-this.startValue)),isNaN(e)&&(e=this.options&&this.options.emptyOnZero?0:1),e=Math.min(Math.max(e,0),1),e}increment(e=1,r={}){typeof e=="object"?this.update(this.value+1,e):this.update(this.value+e,r)}getTotal(){return this.total}setTotal(e){typeof e<"u"&&e>=0&&(this.total=e)}updateETA(){this.eta.update(Date.now(),this.value,this.total)}}});var Die=S((nDt,xie)=>{f();var Q6e=DN(),e9e=mw();xie.exports=class extends Q6e{constructor(e,r){super(e9e.parse(e,r)),this.timer=null,this.options.noTTYOutput&&this.terminal.isTTY()===!1&&(this.options.synchronousUpdate=!1),this.schedulingRate=this.terminal.isTTY()?this.options.throttleTime:this.options.notTTYSchedule,this.sigintCallback=null}render(){this.timer&&(clearTimeout(this.timer),this.timer=null),super.render(),this.options.noTTYOutput&&this.terminal.isTTY()===!1&&this.terminal.newline(),this.timer=setTimeout(this.render.bind(this),this.schedulingRate)}update(e,r){this.timer&&(super.update(e,r),this.options.synchronousUpdate&&this.lastRedraw+this.options.throttleTime*2<Date.now()&&this.render())}start(e,r,n){this.options.noTTYOutput===!1&&this.terminal.isTTY()===!1||(this.sigintCallback===null&&this.options.gracefulExit&&(this.sigintCallback=this.stop.bind(this),process.once("SIGINT",this.sigintCallback),process.once("SIGTERM",this.sigintCallback)),this.terminal.cursorSave(),this.options.hideCursor===!0&&this.terminal.cursor(!1),this.options.linewrap===!1&&this.terminal.lineWrapping(!1),super.start(e,r,n),this.render())}stop(){this.timer&&(this.sigintCallback&&(process.removeListener("SIGINT",this.sigintCallback),process.removeListener("SIGTERM",this.sigintCallback),this.sigintCallback=null),this.render(),super.stop(),clearTimeout(this.timer),this.timer=null,this.options.hideCursor===!0&&this.terminal.cursor(!0),this.options.linewrap===!1&&this.terminal.lineWrapping(!0),this.terminal.cursorRestore(),this.options.clearOnComplete?(this.terminal.cursorTo(0,null),this.terminal.clearLine()):this.terminal.newline())}}});var Cie=S((oDt,wie)=>{f();var t9e=mN(),r9e=DN(),n9e=mw(),i9e=require("events");wie.exports=class extends i9e{constructor(e,r){super(),this.bars=[],this.options=n9e.parse(e,r),this.options.synchronousUpdate=!1,this.terminal=this.options.terminal?this.options.terminal:new t9e(this.options.stream),this.timer=null,this.isActive=!1,this.schedulingRate=this.terminal.isTTY()?this.options.throttleTime:this.options.notTTYSchedule,this.loggingBuffer=[],this.sigintCallback=null}create(e,r,n,i={}){let s=new r9e(Object.assign({},this.options,{terminal:this.terminal},i));return this.bars.push(s),this.options.noTTYOutput===!1&&this.terminal.isTTY()===!1||(this.sigintCallback===null&&this.options.gracefulExit&&(this.sigintCallback=this.stop.bind(this),process.once("SIGINT",this.sigintCallback),process.once("SIGTERM",this.sigintCallback)),this.isActive||(this.options.hideCursor===!0&&this.terminal.cursor(!1),this.options.linewrap===!1&&this.terminal.lineWrapping(!1),this.timer=setTimeout(this.update.bind(this),this.schedulingRate)),this.isActive=!0,s.start(e,r,n),this.emit("start")),s}remove(e){let r=this.bars.indexOf(e);return r<0?!1:(this.bars.splice(r,1),this.update(),this.terminal.newline(),this.terminal.clearBottom(),!0)}update(){if(this.timer&&(clearTimeout(this.timer),this.timer=null),this.emit("update-pre"),this.terminal.cursorRelativeReset(),this.emit("redraw-pre"),this.loggingBuffer.length>0)for(this.terminal.clearLine();this.loggingBuffer.length>0;)this.terminal.write(this.loggingBuffer.shift(),!0);for(let e=0;e<this.bars.length;e++)e>0&&this.terminal.newline(),this.bars[e].render();this.emit("redraw-post"),this.options.noTTYOutput&&this.terminal.isTTY()===!1&&(this.terminal.newline(),this.terminal.newline()),this.timer=setTimeout(this.update.bind(this),this.schedulingRate),this.emit("update-post"),this.options.stopOnComplete&&!this.bars.find(e=>e.isActive)&&this.stop()}stop(){if(clearTimeout(this.timer),this.timer=null,this.sigintCallback&&(process.removeListener("SIGINT",this.sigintCallback),process.removeListener("SIGTERM",this.sigintCallback),this.sigintCallback=null),this.isActive=!1,this.options.hideCursor===!0&&this.terminal.cursor(!0),this.options.linewrap===!1&&this.terminal.lineWrapping(!0),this.terminal.cursorRelativeReset(),this.emit("stop-pre-clear"),this.options.clearOnComplete)this.terminal.clearBottom();else{for(let e=0;e<this.bars.length;e++)e>0&&this.terminal.newline(),this.bars[e].render(),this.bars[e].stop();this.terminal.newline()}this.emit("stop")}log(e){this.loggingBuffer.push(e)}}});var Sie=S((cDt,Eie)=>{f();Eie.exports={format:"progress [{bar}] {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"=",barIncompleteChar:"-"}});var Aie=S((lDt,Tie)=>{f();Tie.exports={format:" {bar} {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"\u2588",barIncompleteChar:"\u2591"}});var _ie=S((dDt,Pie)=>{f();Pie.exports={format:" \x1B[90m{bar}\x1B[0m {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"\u2588",barIncompleteChar:"\u2591"}});var kie=S((mDt,Fie)=>{f();Fie.exports={format:" {bar}\u25A0 {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"\u25A0",barIncompleteChar:" "}});var Nie=S((gDt,Iie)=>{f();var s9e=Sie(),o9e=Aie(),a9e=_ie(),c9e=kie();Iie.exports={legacy:s9e,shades_classic:o9e,shades_grey:a9e,rect:c9e}});var Mie=S((bDt,Oie)=>{f();var Rie=Die(),u9e=Cie(),l9e=Nie(),p9e=xN(),d9e=yN(),f9e=bN(),m9e=vN();Oie.exports={Bar:Rie,SingleBar:Rie,MultiBar:u9e,Presets:l9e,Format:{Formatter:p9e,BarFormat:f9e,ValueFormat:d9e,TimeFormat:m9e}}});var qie=S((TDt,Uie)=>{f();Uie.exports=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\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?|[\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](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\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-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g});var Y9e={};Ty(Y9e,{default:()=>J9e});module.exports=noe(Y9e);f();f();try{let t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="82811fcb-edc6-4786-b8c1-8cf7ce3f29ad",t._sentryDebugIdIdentifier="sentry-dbid-82811fcb-edc6-4786-b8c1-8cf7ce3f29ad")}catch{}f();var Kse=require("../core/index.cjs"),Wse=require("../node/index.cjs"),Jse=require("../server/index.cjs"),Yse=z(IN(),1);f();f();var G0=require("fs/promises");Of();Wr();Zp();Mt();var cr=z(dr(),1),Kd=require("node:path");Xi();Ri();Mr();_r();_u();var uke="https://cdn.builder.io",dW=async(t,e)=>{console.log(""),St((0,cr.bgCyan)((0,cr.bold)((0,cr.white)(" figma migrate ")))+" "+(0,cr.dim)(Ue));let{builderPrivateKey:r,builderPublicKey:n}=await $t(t,e,{forceSpaceId:e.spaceId,builderPrivateKey:!0,builderPublicKey:!0});await Je("figma publish started",{spaceId:n});let i=await Ou(t);if(i.length>0){await Je("figma migrate with existing files",{spaceId:n}),N.warning(`${(0,cr.yellow)("This repo already has figma mappings in:")}
2393
+ `),this.dy++}write(e,r=!1){this.linewrap===!0&&r===!1?this.stream.write(e.substr(0,this.getWidth())):this.stream.write(e)}lineWrapping(e){this.stream.isTTY&&(this.linewrap=e,e?this.stream.write("\x1B[?7h"):this.stream.write("\x1B[?7l"))}isTTY(){return this.stream.isTTY===!0}getWidth(){return this.stream.columns||(this.stream.isTTY?80:200)}};rie.exports=fN});var iie=S((N0t,nie)=>{"use strict";f();nie.exports=({onlyFirst:t=!1}={})=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}});var oie=S((O0t,sie)=>{"use strict";f();var U6e=iie();sie.exports=t=>typeof t=="string"?t.replace(U6e(),""):t});var cie=S((B0t,hN)=>{"use strict";f();var aie=t=>Number.isNaN(t)?!1:t>=4352&&(t<=4447||t===9001||t===9002||11904<=t&&t<=12871&&t!==12351||12880<=t&&t<=19903||19968<=t&&t<=42182||43360<=t&&t<=43388||44032<=t&&t<=55203||63744<=t&&t<=64255||65040<=t&&t<=65049||65072<=t&&t<=65131||65281<=t&&t<=65376||65504<=t&&t<=65510||110592<=t&&t<=110593||127488<=t&&t<=127569||131072<=t&&t<=262141);hN.exports=aie;hN.exports.default=aie});var lie=S(($0t,uie)=>{"use strict";f();uie.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\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\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])|\uD83C[\uDF3E\uDF73\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])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\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])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\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\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\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\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\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\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*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\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\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\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[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var die=S((U0t,gN)=>{"use strict";f();var q6e=oie(),z6e=cie(),G6e=lie(),pie=t=>{if(typeof t!="string"||t.length===0||(t=q6e(t),t.length===0))return 0;t=t.replace(G6e()," ");let e=0;for(let r=0;r<t.length;r++){let n=t.codePointAt(r);n<=31||n>=127&&n<=159||n>=768&&n<=879||(n>65535&&r++,e+=z6e(n)?2:1)}return e};gN.exports=pie;gN.exports.default=pie});var yN=S((z0t,fie)=>{f();fie.exports=function(e,r,n){if(r.autopadding!==!0)return e;function i(s,o){return(r.autopaddingChar+s).slice(-o)}switch(n){case"percentage":return i(e,3);default:return e}}});var bN=S((V0t,mie)=>{f();mie.exports=function(e,r){let n=Math.round(e*r.barsize),i=r.barsize-n;return r.barCompleteString.substr(0,n)+r.barGlue+r.barIncompleteString.substr(0,i)}});var vN=S((K0t,hie)=>{f();hie.exports=function(e,r,n){function i(o){return n?n*Math.round(o/n):o}function s(o){return(r.autopaddingChar+o).slice(-2)}return e>3600?s(Math.floor(e/3600))+"h"+s(i(e%3600/60))+"m":e>60?s(Math.floor(e/60))+"m"+s(i(e%60))+"s":e>10?s(i(e))+"s":s(e)+"s"}});var xN=S((J0t,gie)=>{f();var V6e=die(),H6e=yN(),K6e=bN(),W6e=vN();gie.exports=function(e,r,n){let i=e.format,s=e.formatTime||W6e,o=e.formatValue||H6e,a=e.formatBar||K6e,c=Math.floor(r.progress*100)+"",u=r.stopTime||Date.now(),l=Math.round((u-r.startTime)/1e3),p=Object.assign({},n,{bar:a(r.progress,e),percentage:o(c,e,"percentage"),total:o(r.total,e,"total"),value:o(r.value,e,"value"),eta:o(r.eta,e,"eta"),eta_formatted:s(r.eta,e,5),duration:o(l,e,"duration"),duration_formatted:s(l,e,1)});i=i.replace(/\{(\w+)\}/g,function(m,g){return typeof p[g]<"u"?p[g]:m});let d=Math.max(0,r.maxWidth-V6e(i)-2),h=Math.floor(d/2);switch(e.align){case"right":i=d>0?" ".repeat(d)+i:i;break;case"center":i=h>0?" ".repeat(h)+i:i;break;case"left":default:break}return i}});var mw=S((X0t,yie)=>{f();function Vt(t,e){return typeof t>"u"||t===null?e:t}yie.exports={parse:function(e,r){let n={},i=Object.assign({},r,e);return n.throttleTime=1e3/Vt(i.fps,10),n.stream=Vt(i.stream,process.stderr),n.terminal=Vt(i.terminal,null),n.clearOnComplete=Vt(i.clearOnComplete,!1),n.stopOnComplete=Vt(i.stopOnComplete,!1),n.barsize=Vt(i.barsize,40),n.align=Vt(i.align,"left"),n.hideCursor=Vt(i.hideCursor,!1),n.linewrap=Vt(i.linewrap,!1),n.barGlue=Vt(i.barGlue,""),n.barCompleteChar=Vt(i.barCompleteChar,"="),n.barIncompleteChar=Vt(i.barIncompleteChar,"-"),n.format=Vt(i.format,"progress [{bar}] {percentage}% | ETA: {eta}s | {value}/{total}"),n.formatTime=Vt(i.formatTime,null),n.formatValue=Vt(i.formatValue,null),n.formatBar=Vt(i.formatBar,null),n.etaBufferLength=Vt(i.etaBuffer,10),n.etaAsynchronousUpdate=Vt(i.etaAsynchronousUpdate,!1),n.progressCalculationRelative=Vt(i.progressCalculationRelative,!1),n.synchronousUpdate=Vt(i.synchronousUpdate,!0),n.noTTYOutput=Vt(i.noTTYOutput,!1),n.notTTYSchedule=Vt(i.notTTYSchedule,2e3),n.emptyOnZero=Vt(i.emptyOnZero,!1),n.forceRedraw=Vt(i.forceRedraw,!1),n.autopadding=Vt(i.autopadding,!1),n.gracefulExit=Vt(i.gracefulExit,!1),n},assignDerivedOptions:function(e){return e.barCompleteString=e.barCompleteChar.repeat(e.barsize+1),e.barIncompleteString=e.barIncompleteChar.repeat(e.barsize+1),e.autopaddingChar=e.autopadding?Vt(e.autopaddingChar," "):"",e}}});var DN=S((eDt,vie)=>{f();var bie=tie(),J6e=mN(),Y6e=xN(),X6e=mw(),Z6e=require("events");vie.exports=class extends Z6e{constructor(e){super(),this.options=X6e.assignDerivedOptions(e),this.terminal=this.options.terminal?this.options.terminal:new J6e(this.options.stream),this.value=0,this.startValue=0,this.total=100,this.lastDrawnString=null,this.startTime=null,this.stopTime=null,this.lastRedraw=Date.now(),this.eta=new bie(this.options.etaBufferLength,0,0),this.payload={},this.isActive=!1,this.formatter=typeof this.options.format=="function"?this.options.format:Y6e}render(e=!1){let r={progress:this.getProgress(),eta:this.eta.getTime(),startTime:this.startTime,stopTime:this.stopTime,total:this.total,value:this.value,maxWidth:this.terminal.getWidth()};this.options.etaAsynchronousUpdate&&this.updateETA();let n=this.formatter(this.options,r,this.payload);(e||this.options.forceRedraw||this.options.noTTYOutput&&!this.terminal.isTTY()||this.lastDrawnString!=n)&&(this.emit("redraw-pre"),this.terminal.cursorTo(0,null),this.terminal.write(n),this.terminal.clearRight(),this.lastDrawnString=n,this.lastRedraw=Date.now(),this.emit("redraw-post"))}start(e,r,n){this.value=r||0,this.total=typeof e<"u"&&e>=0?e:100,this.startValue=r||0,this.payload=n||{},this.startTime=Date.now(),this.stopTime=null,this.lastDrawnString="",this.eta=new bie(this.options.etaBufferLength,this.startTime,this.value),this.isActive=!0,this.emit("start",e,r)}stop(){this.isActive=!1,this.stopTime=Date.now(),this.emit("stop",this.total,this.value)}update(e,r={}){typeof e=="number"&&(this.value=e,this.eta.update(Date.now(),e,this.total));let n=(typeof e=="object"?e:r)||{};this.emit("update",this.total,this.value);for(let i in n)this.payload[i]=n[i];this.value>=this.getTotal()&&this.options.stopOnComplete&&this.stop()}getProgress(){let e=this.value/this.total;return this.options.progressCalculationRelative&&(e=(this.value-this.startValue)/(this.total-this.startValue)),isNaN(e)&&(e=this.options&&this.options.emptyOnZero?0:1),e=Math.min(Math.max(e,0),1),e}increment(e=1,r={}){typeof e=="object"?this.update(this.value+1,e):this.update(this.value+e,r)}getTotal(){return this.total}setTotal(e){typeof e<"u"&&e>=0&&(this.total=e)}updateETA(){this.eta.update(Date.now(),this.value,this.total)}}});var Die=S((nDt,xie)=>{f();var Q6e=DN(),e9e=mw();xie.exports=class extends Q6e{constructor(e,r){super(e9e.parse(e,r)),this.timer=null,this.options.noTTYOutput&&this.terminal.isTTY()===!1&&(this.options.synchronousUpdate=!1),this.schedulingRate=this.terminal.isTTY()?this.options.throttleTime:this.options.notTTYSchedule,this.sigintCallback=null}render(){this.timer&&(clearTimeout(this.timer),this.timer=null),super.render(),this.options.noTTYOutput&&this.terminal.isTTY()===!1&&this.terminal.newline(),this.timer=setTimeout(this.render.bind(this),this.schedulingRate)}update(e,r){this.timer&&(super.update(e,r),this.options.synchronousUpdate&&this.lastRedraw+this.options.throttleTime*2<Date.now()&&this.render())}start(e,r,n){this.options.noTTYOutput===!1&&this.terminal.isTTY()===!1||(this.sigintCallback===null&&this.options.gracefulExit&&(this.sigintCallback=this.stop.bind(this),process.once("SIGINT",this.sigintCallback),process.once("SIGTERM",this.sigintCallback)),this.terminal.cursorSave(),this.options.hideCursor===!0&&this.terminal.cursor(!1),this.options.linewrap===!1&&this.terminal.lineWrapping(!1),super.start(e,r,n),this.render())}stop(){this.timer&&(this.sigintCallback&&(process.removeListener("SIGINT",this.sigintCallback),process.removeListener("SIGTERM",this.sigintCallback),this.sigintCallback=null),this.render(),super.stop(),clearTimeout(this.timer),this.timer=null,this.options.hideCursor===!0&&this.terminal.cursor(!0),this.options.linewrap===!1&&this.terminal.lineWrapping(!0),this.terminal.cursorRestore(),this.options.clearOnComplete?(this.terminal.cursorTo(0,null),this.terminal.clearLine()):this.terminal.newline())}}});var Cie=S((oDt,wie)=>{f();var t9e=mN(),r9e=DN(),n9e=mw(),i9e=require("events");wie.exports=class extends i9e{constructor(e,r){super(),this.bars=[],this.options=n9e.parse(e,r),this.options.synchronousUpdate=!1,this.terminal=this.options.terminal?this.options.terminal:new t9e(this.options.stream),this.timer=null,this.isActive=!1,this.schedulingRate=this.terminal.isTTY()?this.options.throttleTime:this.options.notTTYSchedule,this.loggingBuffer=[],this.sigintCallback=null}create(e,r,n,i={}){let s=new r9e(Object.assign({},this.options,{terminal:this.terminal},i));return this.bars.push(s),this.options.noTTYOutput===!1&&this.terminal.isTTY()===!1||(this.sigintCallback===null&&this.options.gracefulExit&&(this.sigintCallback=this.stop.bind(this),process.once("SIGINT",this.sigintCallback),process.once("SIGTERM",this.sigintCallback)),this.isActive||(this.options.hideCursor===!0&&this.terminal.cursor(!1),this.options.linewrap===!1&&this.terminal.lineWrapping(!1),this.timer=setTimeout(this.update.bind(this),this.schedulingRate)),this.isActive=!0,s.start(e,r,n),this.emit("start")),s}remove(e){let r=this.bars.indexOf(e);return r<0?!1:(this.bars.splice(r,1),this.update(),this.terminal.newline(),this.terminal.clearBottom(),!0)}update(){if(this.timer&&(clearTimeout(this.timer),this.timer=null),this.emit("update-pre"),this.terminal.cursorRelativeReset(),this.emit("redraw-pre"),this.loggingBuffer.length>0)for(this.terminal.clearLine();this.loggingBuffer.length>0;)this.terminal.write(this.loggingBuffer.shift(),!0);for(let e=0;e<this.bars.length;e++)e>0&&this.terminal.newline(),this.bars[e].render();this.emit("redraw-post"),this.options.noTTYOutput&&this.terminal.isTTY()===!1&&(this.terminal.newline(),this.terminal.newline()),this.timer=setTimeout(this.update.bind(this),this.schedulingRate),this.emit("update-post"),this.options.stopOnComplete&&!this.bars.find(e=>e.isActive)&&this.stop()}stop(){if(clearTimeout(this.timer),this.timer=null,this.sigintCallback&&(process.removeListener("SIGINT",this.sigintCallback),process.removeListener("SIGTERM",this.sigintCallback),this.sigintCallback=null),this.isActive=!1,this.options.hideCursor===!0&&this.terminal.cursor(!0),this.options.linewrap===!1&&this.terminal.lineWrapping(!0),this.terminal.cursorRelativeReset(),this.emit("stop-pre-clear"),this.options.clearOnComplete)this.terminal.clearBottom();else{for(let e=0;e<this.bars.length;e++)e>0&&this.terminal.newline(),this.bars[e].render(),this.bars[e].stop();this.terminal.newline()}this.emit("stop")}log(e){this.loggingBuffer.push(e)}}});var Sie=S((cDt,Eie)=>{f();Eie.exports={format:"progress [{bar}] {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"=",barIncompleteChar:"-"}});var Aie=S((lDt,Tie)=>{f();Tie.exports={format:" {bar} {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"\u2588",barIncompleteChar:"\u2591"}});var _ie=S((dDt,Pie)=>{f();Pie.exports={format:" \x1B[90m{bar}\x1B[0m {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"\u2588",barIncompleteChar:"\u2591"}});var kie=S((mDt,Fie)=>{f();Fie.exports={format:" {bar}\u25A0 {percentage}% | ETA: {eta}s | {value}/{total}",barCompleteChar:"\u25A0",barIncompleteChar:" "}});var Nie=S((gDt,Iie)=>{f();var s9e=Sie(),o9e=Aie(),a9e=_ie(),c9e=kie();Iie.exports={legacy:s9e,shades_classic:o9e,shades_grey:a9e,rect:c9e}});var Mie=S((bDt,Oie)=>{f();var Rie=Die(),u9e=Cie(),l9e=Nie(),p9e=xN(),d9e=yN(),f9e=bN(),m9e=vN();Oie.exports={Bar:Rie,SingleBar:Rie,MultiBar:u9e,Presets:l9e,Format:{Formatter:p9e,BarFormat:f9e,ValueFormat:d9e,TimeFormat:m9e}}});var qie=S((TDt,Uie)=>{f();Uie.exports=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\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?|[\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](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\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-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g});var Y9e={};Ty(Y9e,{default:()=>J9e});module.exports=noe(Y9e);f();f();try{let t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="dd5ea211-ee04-4c11-95ac-e3b680988086",t._sentryDebugIdIdentifier="sentry-dbid-dd5ea211-ee04-4c11-95ac-e3b680988086")}catch{}f();var Kse=require("../core/index.cjs"),Wse=require("../node/index.cjs"),Jse=require("../server/index.cjs"),Yse=z(IN(),1);f();f();var G0=require("fs/promises");Of();Wr();Zp();Mt();var cr=z(dr(),1),Kd=require("node:path");Xi();Ri();Mr();_r();_u();var uke="https://cdn.builder.io",dW=async(t,e)=>{console.log(""),St((0,cr.bgCyan)((0,cr.bold)((0,cr.white)(" figma migrate ")))+" "+(0,cr.dim)(Ue));let{builderPrivateKey:r,builderPublicKey:n}=await $t(t,e,{forceSpaceId:e.spaceId,builderPrivateKey:!0,builderPublicKey:!0});await Je("figma publish started",{spaceId:n});let i=await Ou(t);if(i.length>0){await Je("figma migrate with existing files",{spaceId:n}),N.warning(`${(0,cr.yellow)("This repo already has figma mappings in:")}
2394
2394
 
2395
2395
  ${i.map(u=>` - ${(0,Kd.relative)(t.getAppRootDir(),u)}`).join(`
2396
2396
  `)}