@builder.io/dev-tools 1.19.0 → 1.19.1

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/core/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var Ii=Object.create;var Dt=Object.defineProperty;var Ri=Object.getOwnPropertyDescriptor;var Ni=Object.getOwnPropertyNames;var Bi=Object.getPrototypeOf,ki=Object.prototype.hasOwnProperty;var Oi=(e,t,r)=>t in e?Dt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Le=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Li=(e,t)=>{for(var r in t)Dt(e,r,{get:t[r],enumerable:!0})},rr=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Ni(t))!ki.call(e,o)&&o!==r&&Dt(e,o,{get:()=>t[o],enumerable:!(n=Ri(t,o))||n.enumerable});return e};var or=(e,t,r)=>(r=e!=null?Ii(Bi(e)):{},rr(t||!e||!e.__esModule?Dt(r,"default",{value:e,enumerable:!0}):r,e)),_i=e=>rr(Dt({},"__esModule",{value:!0}),e);var Me=(e,t,r)=>Oi(e,typeof t!="symbol"?t+"":t,r);var ur=Le((wp,sr)=>{"use strict";sr.exports=function(){if(process.env.npm_config_user_agent)return $i(process.env.npm_config_user_agent)};function $i(e){let t=e.split(" ")[0],r=t.lastIndexOf("/"),n=t.substring(0,r);return{name:n==="npminstall"?"cnpm":n,version:t.substring(r+1)}}});var Vn=Le(We=>{"use strict";Object.defineProperty(We,"__esModule",{value:!0});We.throwUnsupportedData=We.throwUnknownDataType=We.getType=void 0;function Ho(e){return Object.prototype.toString.call(e)}We.getType=Ho;function $u(e){throw new TypeError("unsupported data type: "+Ho(e))}We.throwUnknownDataType=$u;function Ku(e){throw new TypeError("unsupported data type: "+e)}We.throwUnsupportedData=Ku});var zn=Le(G=>{"use strict";Object.defineProperty(G,"__esModule",{value:!0});G.s_to_num=G.int_str_to_s=G.num_to_s=G.big_int_to_s=G.int_to_s=G.s_to_big_int=G.s_to_int=void 0;var Ke="";for(let e=0;e<10;e++){let t=String.fromCharCode(48+e);Ke+=t}for(let e=0;e<26;e++){let t=String.fromCharCode(65+e);Ke+=t}for(let e=0;e<26;e++){let t=String.fromCharCode(97+e);Ke+=t}var dt=Ke.length,Kn={};for(let e=0;e<dt;e++){let t=Ke[e];Kn[t]=e}function Mn(e){let t=0,r=1;for(let n=e.length-1;n>=0;n--){let o=e[n],i=Kn[o];i*=r,t+=i,r*=dt}return t}G.s_to_int=Mn;function Yo(e){let t=BigInt(0),r=BigInt(1),n=BigInt(dt);for(let o=e.length-1;o>=0;o--){let i=e[o],a=BigInt(Kn[i]);a*=r,t+=a,r*=n}return t}G.s_to_big_int=Yo;function Un(e){if(e===0)return Ke[0];let t=[];for(;e!==0;){let r=e%dt,n=Ke[r];t.push(n),e-=r,e/=dt}return t.reverse().join("")}G.int_to_s=Un;function Go(e){let t=BigInt(0),r=BigInt(dt);if(e===t)return Ke[0];let n=[];for(;e!==t;){let o=e%r,i=Ke[Number(o)];n.push(i),e/=r}return n.reverse().join("")}G.big_int_to_s=Go;function Xo(e){return e.split("").reverse().join("")}function Zo(e){if(e<0)return"-"+Zo(-e);let[t,r]=e.toString().split(".");if(!r)if(t.includes("e")){let[i,a]=t.split("e");t=i,r="0e"+a}else return Un(e);let n;r&&([r,n]=r.split("e")),t=Zt(t),r=Xo(r),r=Zt(r);let o=t+"."+r;if(n){switch(o+=".",n[0]){case"+":n=n.slice(1);break;case"-":o+="-",n=n.slice(1);break}n=Zt(n),o+=n}return o}G.num_to_s=Zo;function Zt(e){let t=+e;return t.toString()===e&&t+1!==t&&t-1!==t?Un(t):":"+Go(BigInt(e))}G.int_str_to_s=Zt;function $n(e){return e[0]===":"?Yo(e.substring(1)).toString():Mn(e).toString()}function ei(e){if(e[0]==="-")return-ei(e.substr(1));let[t,r,n]=e.split(".");if(!r)return Mn(t);t=$n(t),r=$n(r),r=Xo(r);let o=t+"."+r;if(n){o+="e";let i=!1;n[0]==="-"&&(i=!0,n=n.slice(1)),n=$n(n),o+=i?-n:+n}return+o}G.s_to_num=ei});var Jn=Le(X=>{"use strict";Object.defineProperty(X,"__esModule",{value:!0});X.decodeStr=X.encodeStr=X.decodeBool=X.encodeBool=X.decodeKey=X.decodeNum=X.encodeNum=void 0;var qn=zn();function Mu(e){return"n|"+(0,qn.num_to_s)(e)}X.encodeNum=Mu;function Uu(e){return e=e.replace("n|",""),(0,qn.s_to_num)(e)}X.decodeNum=Uu;function zu(e){return typeof e=="number"?e:(0,qn.s_to_int)(e)}X.decodeKey=zu;function qu(e){return e?"b|T":"b|F"}X.encodeBool=qu;function Ju(e){switch(e){case"b|T":return!0;case"b|F":return!1}return!!e}X.decodeBool=Ju;function Wu(e){switch(e[0]+e[1]){case"b|":case"o|":case"n|":case"a|":case"s|":e="s|"+e}return e}X.encodeStr=Wu;function Qu(e){return e[0]+e[1]==="s|"?e.substr(2):e}X.decodeStr=Qu});var Wn=Le(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.config=void 0;en.config={sort_key:!1,error_on_nan:!1,error_on_infinite:!1}});var Gn=Le(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.addValue=xe.makeInMemoryMemory=xe.makeInMemoryCache=xe.makeInMemoryStore=xe.memToValues=void 0;var Yn=Wn(),Qn=Vn(),Hn=Jn(),Hu=zn();function Yu(e){return e.store.toArray()}xe.memToValues=Yu;function ti(){let e=[];return{forEach(t){for(let r=0;r<e.length;r++)if(t(e[r])==="break")return},add(t){e.push(t)},toArray(){return e}}}xe.makeInMemoryStore=ti;function ni(){let e=Object.create(null),t=Object.create(null);return{getValue(r){return e[r]},getSchema(r){return t[r]},forEachValue(r){for(let[n,o]of Object.entries(e))if(r(n,o)==="break")return},forEachSchema(r){for(let[n,o]of Object.entries(t))if(r(n,o)==="break")return},setValue(r,n){e[r]=n},setSchema(r,n){t[r]=n},hasValue(r){return r in e},hasSchema(r){return r in t}}}xe.makeInMemoryCache=ni;function Gu(){return{store:ti(),cache:ni(),keyCount:0}}xe.makeInMemoryMemory=Gu;function nt(e,t){if(e.cache.hasValue(t))return e.cache.getValue(t);let r=e.keyCount++,n=(0,Hu.num_to_s)(r);return e.store.add(t),e.cache.setValue(t,n),n}function Xu(e,t){Yn.config.sort_key&&t.sort();let r=t.join(",");if(e.cache.hasSchema(r))return e.cache.getSchema(r);let n=kt(e,t,void 0);return e.cache.setSchema(r,n),n}function kt(e,t,r){if(t===null)return"";switch(typeof t){case"undefined":if(Array.isArray(r))return kt(e,null,r);break;case"object":if(t===null)return nt(e,null);if(Array.isArray(t)){let n="a";for(let o=0;o<t.length;o++){let i=t[o],a=i===null?"_":kt(e,i,t);n+="|"+a}return n==="a"&&(n="a|"),nt(e,n)}else{let n=Object.keys(t);if(n.length===0)return nt(e,"o|");let o="o",i=Xu(e,n);o+="|"+i;for(let a of n){let s=t[a],u=kt(e,s,t);o+="|"+u}return nt(e,o)}case"boolean":return nt(e,(0,Hn.encodeBool)(t));case"number":return Number.isNaN(t)?(Yn.config.error_on_nan&&(0,Qn.throwUnsupportedData)("[number NaN]"),""):Number.POSITIVE_INFINITY===t||Number.NEGATIVE_INFINITY===t?(Yn.config.error_on_infinite&&(0,Qn.throwUnsupportedData)("[number Infinity]"),""):nt(e,(0,Hn.encodeNum)(t));case"string":return nt(e,(0,Hn.encodeStr)(t))}return(0,Qn.throwUnknownDataType)(t)}xe.addValue=kt});var Zn=Le(Qe=>{"use strict";Object.defineProperty(Qe,"__esModule",{value:!0});Qe.decompress=Qe.decode=Qe.compress=void 0;var Zu=Vn(),tn=Jn(),Xn=Gn();function ep(e){let t=(0,Xn.makeInMemoryMemory)(),r=(0,Xn.addValue)(t,e,void 0);return[(0,Xn.memToValues)(t),r]}Qe.compress=ep;function tp(e,t){if(t==="o|")return{};let r={},n=t.split("|"),o=n[1],i=Ot(e,o),a=n.length;a-2===1&&!Array.isArray(i)&&(i=[i]);for(let s=2;s<a;s++){let u=i[s-2],p=n[s];p=Ot(e,p),r[u]=p}return r}function np(e,t){if(t==="a|")return[];let r=t.split("|"),n=r.length-1,o=new Array(n);for(let i=0;i<n;i++){let a=r[i+1];a=Ot(e,a),o[i]=a}return o}function Ot(e,t){if(t===""||t==="_")return null;let r=(0,tn.decodeKey)(t),n=e[r];if(n===null)return n;switch(typeof n){case"undefined":return n;case"number":return n;case"string":switch(n[0]+n[1]){case"b|":return(0,tn.decodeBool)(n);case"o|":return tp(e,n);case"n|":return(0,tn.decodeNum)(n);case"a|":return np(e,n);default:return(0,tn.decodeStr)(n)}}return(0,Zu.throwUnknownDataType)(n)}Qe.decode=Ot;function rp(e){let[t,r]=e;return Ot(t,r)}Qe.decompress=rp});var oi=Le(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.trimUndefinedRecursively=gt.trimUndefined=void 0;function op(e){for(let t in e)e[t]===void 0&&delete e[t]}gt.trimUndefined=op;function ip(e){ri(e,new Set)}gt.trimUndefinedRecursively=ip;function ri(e,t){t.add(e);for(let r in e)if(e[r]===void 0)delete e[r];else{let n=e[r];n&&typeof n=="object"&&!t.has(n)&&ri(n,t)}}});var si=Le(Z=>{"use strict";Object.defineProperty(Z,"__esModule",{value:!0});Z.config=Z.trimUndefinedRecursively=Z.trimUndefined=Z.addValue=Z.decode=Z.decompress=Z.compress=void 0;var ii=Zn();Object.defineProperty(Z,"compress",{enumerable:!0,get:function(){return ii.compress}});Object.defineProperty(Z,"decompress",{enumerable:!0,get:function(){return ii.decompress}});var ap=Zn();Object.defineProperty(Z,"decode",{enumerable:!0,get:function(){return ap.decode}});var sp=Gn();Object.defineProperty(Z,"addValue",{enumerable:!0,get:function(){return sp.addValue}});var ai=oi();Object.defineProperty(Z,"trimUndefined",{enumerable:!0,get:function(){return ai.trimUndefined}});Object.defineProperty(Z,"trimUndefinedRecursively",{enumerable:!0,get:function(){return ai.trimUndefinedRecursively}});var up=Wn();Object.defineProperty(Z,"config",{enumerable:!0,get:function(){return up.config}})});var Ap={};Li(Ap,{createDevTools:()=>li,createDevToolsSys:()=>fi,detectFrameworks:()=>Ue,detectFrameworksFromPackageJson:()=>un,ensureConfigPlugin:()=>vi,findBuildToolConfig:()=>nr,getClientScript:()=>bi,parseDotEnvContent:()=>pn,version:()=>_t});module.exports=_i(Ap);var ji="1.19.0",ir=process.env.OVERRIDE_VERSION??ji;function ne(e){let t=e.join(e.getAppRootDir(),"tsconfig.json");return e.exists(t)}var Vi=["node_modules","dist","build","public"];async function ie(e,t){async function r(o,i){if(i>10)return;let a=await e.readdir(o);for(let s of a){if(Vi.includes(s))continue;let u=e.join(o,s),p=await e.stat(u);if(p){if(p.isFile()&&s.startsWith("builder-registry."))return u;if(p.isDirectory()){let f=await r(u,i+1);if(f)return f}}}}let n=await r(e.getAppRootDir(),0);if(!n){let i=`builder-registry.${await ne(e)?"ts":"js"}`;return e.join(t,i)}return n}async function xt(e,t){let r=e.resolve("/");for(let n=0;n<20;n++){let o=e.join(t,"package.json"),i=await e.readFile(o);if(i)return JSON.parse(i);if(t===r)break;t=e.dirname(t)}return null}async function ar(e,t){for(let r=0;r<20;r++){let n=e.dirname(t),o=e.join(n,"node_modules");if(await e.exists(o))return o;if(t===e.getAppRootDir())break;t=e.dirname(t)}return e.join(e.getAppRootDir(),"node_modules")}async function Ct(e,t,r){let n=await e.readdir(t);return n.includes(r)?e.join(t,r):(await Promise.all(n.map(async i=>{if(i.startsWith(".")||i==="node_modules")return;let a=e.join(t,i);if((await e.stat(a)).isDirectory()){let u=await Ct(e,a,r);if(u)return u}}))).find(i=>typeof i=="string")}var cr=or(ur(),1);function Ae(e){return e.endsWith(".mapper.tsx")||e.endsWith(".mapper.jsx")||e.endsWith(".mapper.ts")||e.endsWith(".mapper.js")||e.endsWith(".mapper.mjs")}function N(e,t,r){t=he(t),r=he(r),t=e.dirname(t);let n=e.basename(r,e.extname(r));r=e.dirname(r);let o;return n==="index"?o=e.relative(t,r):o=e.relative(t,e.join(r,n)),o=he(e.normalize(o)),o.startsWith(".")||(o="./"+o),o}function he(e){return e.startsWith("\\\\?\\")?e:e.replace(/\\/g,"/")}function Ye(e,t){let r=e.extname(t),n=e.basename(t,r).split(/[\/\\]/),o=n[n.length-1];return pr(o==="index"?e.basename(e.dirname(t)):o)}function pr(e){return K(e).replace(/ /g,"")}function le(e,t){let r=e.extname(t),n=he(e.basename(t,r)).split("/").pop();return K(n==="index"?e.basename(e.dirname(t)):n)}function M(e,t){let r=he(e.relative(e.getAppRootDir(),t));r=r.split("/").filter(o=>o!=="."&&o!==".."&&o!=="").join("/"),r.endsWith(".tsx")||r.endsWith(".jsx")?r=r.slice(0,-4):(r.endsWith(".ts")||r.endsWith(".js"))&&(r=r.slice(0,-3));let n=e.getFrameworks();return r.startsWith("src/")&&(r=r.slice(4)),n.some(o=>o.name.includes("next"))?"@/"+r:"~/"+r}function k(e,t){let r=t,n=[];for(let o=0;o<2;o++){let i=e.basename(r);if(!i||i==="components")break;n.unshift(i),r=e.dirname(r)}return n.join("/")}function K(e){for(e=e.replace(/([A-Z])/g," $1").replace(/\./g," ").replace(/_/g," ").replace(/-/g," ").replace(/\s/g," ").trim();e.includes(" ");)e=e.replace(/ /g," ");return e.split(" ").map(t=>t.length>2?t[0].toUpperCase()+t.slice(1):t).join("").trim()}function ae(e){return e.sort((t,r)=>t.name.toLocaleLowerCase().localeCompare(r.name.toLocaleLowerCase()))}async function V(e,t,r,n){if(typeof r!="string"||r==="")throw new Error(`getComponentId(), exportName must be a non-empty string, received: ${r}, ${t}`);return n&&(t=n),t=e.normalize(t),(await e.hash(t+"#"+r)).substring(0,8)}function ht(e){return typeof e=="number"}function rt(e){return typeof e=="boolean"}function re(e){return typeof e=="string"}function ot(e){return typeof e=="string"?/^[A-Z][A-Za-z0-9]*$/.test(e):!1}function pe(e){return JSON.parse(JSON.stringify(e))}function jt(e,t,r){for(let n of t)if(e.dirname(r).includes(n))return!0;return!1}function lr(){try{let e=(0,cr.default)();if(e?.name)return e.name}catch{}return"npm"}async function Ue(e){let t=[],r=await xt(e,e.getRepoRootDir());if(r){let n=await un(r,e);t.push(...n)}return t}async function fr(e){let t=await xt(e,e.getRepoRootDir());return t?.scripts?.dev?t.scripts.dev.includes("--turbopack"):!1}async function un(e,t){let r=[];if(e&&typeof e=="object"){let n=new Set(Object.keys({...e.dependencies,...e.devDependencies}));for(let o of Ki)if(n.has(o)&&!r.some(i=>i.name===o)){let i={name:o};mr.has(o)&&(i.version=await mr.get(o)(t)),r.push(i)}}return r}function sn(e){let t=parseInt(e);return Number.isNaN(t)?void 0:t}var mr=new Map([["next",async e=>{if(!e.spawnSync)return;let t=lr(),r=t==="npm"?"npx":t,{stdout:n}=e.spawnSync(r,["next","-v"],{encoding:"utf8"});if(!n)return;let o=n.match(/(Next.js v)([\d.]+)/g);if(!o)return;let i=o[0].split("Next.js v")[1],[a,s,u]=i.split(".");return{major:sn(a),minor:sn(s),patch:sn(u)}}]]),Ki=["@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 me(e){let t=dr(e),r=await e.readFile(t);return typeof r=="string"?JSON.parse(r):{}}async function fe(e,t){t=typeof t=="object"&&t!=null?t:{};let r=dr(e);await e.writeFile(r,JSON.stringify(t??{},null,2))}function dr(e){let t=e.getAppRootDir();return e.join(t,"node_modules",".builder","builder-cache.json")}async function Fe(e,t,r){let n={envKey:r,envValue:null,file:""};for(let o of t){let i=e.join(e.getAppRootDir(),o),a=await Mi(e,i);if(a){let s=a[r];if(typeof s=="string"&&s.length>0&&s!=="YOUR_API_KEY")return n.envValue=s,n.file=i,n}}return n.file=e.join(e.getAppRootDir(),t[t.length-1]),n}async function Mi(e,t){let r=await e.readFile(t);return typeof r=="string"?pn(r):null}function pn(e){let t={},r=e.replace(/\r\n?/gm,`
1
+ "use strict";var Ii=Object.create;var Dt=Object.defineProperty;var Ri=Object.getOwnPropertyDescriptor;var Ni=Object.getOwnPropertyNames;var Bi=Object.getPrototypeOf,ki=Object.prototype.hasOwnProperty;var Oi=(e,t,r)=>t in e?Dt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Le=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Li=(e,t)=>{for(var r in t)Dt(e,r,{get:t[r],enumerable:!0})},rr=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Ni(t))!ki.call(e,o)&&o!==r&&Dt(e,o,{get:()=>t[o],enumerable:!(n=Ri(t,o))||n.enumerable});return e};var or=(e,t,r)=>(r=e!=null?Ii(Bi(e)):{},rr(t||!e||!e.__esModule?Dt(r,"default",{value:e,enumerable:!0}):r,e)),_i=e=>rr(Dt({},"__esModule",{value:!0}),e);var Me=(e,t,r)=>Oi(e,typeof t!="symbol"?t+"":t,r);var ur=Le((wp,sr)=>{"use strict";sr.exports=function(){if(process.env.npm_config_user_agent)return $i(process.env.npm_config_user_agent)};function $i(e){let t=e.split(" ")[0],r=t.lastIndexOf("/"),n=t.substring(0,r);return{name:n==="npminstall"?"cnpm":n,version:t.substring(r+1)}}});var Vn=Le(We=>{"use strict";Object.defineProperty(We,"__esModule",{value:!0});We.throwUnsupportedData=We.throwUnknownDataType=We.getType=void 0;function Ho(e){return Object.prototype.toString.call(e)}We.getType=Ho;function $u(e){throw new TypeError("unsupported data type: "+Ho(e))}We.throwUnknownDataType=$u;function Ku(e){throw new TypeError("unsupported data type: "+e)}We.throwUnsupportedData=Ku});var zn=Le(G=>{"use strict";Object.defineProperty(G,"__esModule",{value:!0});G.s_to_num=G.int_str_to_s=G.num_to_s=G.big_int_to_s=G.int_to_s=G.s_to_big_int=G.s_to_int=void 0;var Ke="";for(let e=0;e<10;e++){let t=String.fromCharCode(48+e);Ke+=t}for(let e=0;e<26;e++){let t=String.fromCharCode(65+e);Ke+=t}for(let e=0;e<26;e++){let t=String.fromCharCode(97+e);Ke+=t}var dt=Ke.length,Kn={};for(let e=0;e<dt;e++){let t=Ke[e];Kn[t]=e}function Mn(e){let t=0,r=1;for(let n=e.length-1;n>=0;n--){let o=e[n],i=Kn[o];i*=r,t+=i,r*=dt}return t}G.s_to_int=Mn;function Yo(e){let t=BigInt(0),r=BigInt(1),n=BigInt(dt);for(let o=e.length-1;o>=0;o--){let i=e[o],a=BigInt(Kn[i]);a*=r,t+=a,r*=n}return t}G.s_to_big_int=Yo;function Un(e){if(e===0)return Ke[0];let t=[];for(;e!==0;){let r=e%dt,n=Ke[r];t.push(n),e-=r,e/=dt}return t.reverse().join("")}G.int_to_s=Un;function Go(e){let t=BigInt(0),r=BigInt(dt);if(e===t)return Ke[0];let n=[];for(;e!==t;){let o=e%r,i=Ke[Number(o)];n.push(i),e/=r}return n.reverse().join("")}G.big_int_to_s=Go;function Xo(e){return e.split("").reverse().join("")}function Zo(e){if(e<0)return"-"+Zo(-e);let[t,r]=e.toString().split(".");if(!r)if(t.includes("e")){let[i,a]=t.split("e");t=i,r="0e"+a}else return Un(e);let n;r&&([r,n]=r.split("e")),t=Zt(t),r=Xo(r),r=Zt(r);let o=t+"."+r;if(n){switch(o+=".",n[0]){case"+":n=n.slice(1);break;case"-":o+="-",n=n.slice(1);break}n=Zt(n),o+=n}return o}G.num_to_s=Zo;function Zt(e){let t=+e;return t.toString()===e&&t+1!==t&&t-1!==t?Un(t):":"+Go(BigInt(e))}G.int_str_to_s=Zt;function $n(e){return e[0]===":"?Yo(e.substring(1)).toString():Mn(e).toString()}function ei(e){if(e[0]==="-")return-ei(e.substr(1));let[t,r,n]=e.split(".");if(!r)return Mn(t);t=$n(t),r=$n(r),r=Xo(r);let o=t+"."+r;if(n){o+="e";let i=!1;n[0]==="-"&&(i=!0,n=n.slice(1)),n=$n(n),o+=i?-n:+n}return+o}G.s_to_num=ei});var Jn=Le(X=>{"use strict";Object.defineProperty(X,"__esModule",{value:!0});X.decodeStr=X.encodeStr=X.decodeBool=X.encodeBool=X.decodeKey=X.decodeNum=X.encodeNum=void 0;var qn=zn();function Mu(e){return"n|"+(0,qn.num_to_s)(e)}X.encodeNum=Mu;function Uu(e){return e=e.replace("n|",""),(0,qn.s_to_num)(e)}X.decodeNum=Uu;function zu(e){return typeof e=="number"?e:(0,qn.s_to_int)(e)}X.decodeKey=zu;function qu(e){return e?"b|T":"b|F"}X.encodeBool=qu;function Ju(e){switch(e){case"b|T":return!0;case"b|F":return!1}return!!e}X.decodeBool=Ju;function Wu(e){switch(e[0]+e[1]){case"b|":case"o|":case"n|":case"a|":case"s|":e="s|"+e}return e}X.encodeStr=Wu;function Qu(e){return e[0]+e[1]==="s|"?e.substr(2):e}X.decodeStr=Qu});var Wn=Le(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.config=void 0;en.config={sort_key:!1,error_on_nan:!1,error_on_infinite:!1}});var Gn=Le(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.addValue=xe.makeInMemoryMemory=xe.makeInMemoryCache=xe.makeInMemoryStore=xe.memToValues=void 0;var Yn=Wn(),Qn=Vn(),Hn=Jn(),Hu=zn();function Yu(e){return e.store.toArray()}xe.memToValues=Yu;function ti(){let e=[];return{forEach(t){for(let r=0;r<e.length;r++)if(t(e[r])==="break")return},add(t){e.push(t)},toArray(){return e}}}xe.makeInMemoryStore=ti;function ni(){let e=Object.create(null),t=Object.create(null);return{getValue(r){return e[r]},getSchema(r){return t[r]},forEachValue(r){for(let[n,o]of Object.entries(e))if(r(n,o)==="break")return},forEachSchema(r){for(let[n,o]of Object.entries(t))if(r(n,o)==="break")return},setValue(r,n){e[r]=n},setSchema(r,n){t[r]=n},hasValue(r){return r in e},hasSchema(r){return r in t}}}xe.makeInMemoryCache=ni;function Gu(){return{store:ti(),cache:ni(),keyCount:0}}xe.makeInMemoryMemory=Gu;function nt(e,t){if(e.cache.hasValue(t))return e.cache.getValue(t);let r=e.keyCount++,n=(0,Hu.num_to_s)(r);return e.store.add(t),e.cache.setValue(t,n),n}function Xu(e,t){Yn.config.sort_key&&t.sort();let r=t.join(",");if(e.cache.hasSchema(r))return e.cache.getSchema(r);let n=kt(e,t,void 0);return e.cache.setSchema(r,n),n}function kt(e,t,r){if(t===null)return"";switch(typeof t){case"undefined":if(Array.isArray(r))return kt(e,null,r);break;case"object":if(t===null)return nt(e,null);if(Array.isArray(t)){let n="a";for(let o=0;o<t.length;o++){let i=t[o],a=i===null?"_":kt(e,i,t);n+="|"+a}return n==="a"&&(n="a|"),nt(e,n)}else{let n=Object.keys(t);if(n.length===0)return nt(e,"o|");let o="o",i=Xu(e,n);o+="|"+i;for(let a of n){let s=t[a],u=kt(e,s,t);o+="|"+u}return nt(e,o)}case"boolean":return nt(e,(0,Hn.encodeBool)(t));case"number":return Number.isNaN(t)?(Yn.config.error_on_nan&&(0,Qn.throwUnsupportedData)("[number NaN]"),""):Number.POSITIVE_INFINITY===t||Number.NEGATIVE_INFINITY===t?(Yn.config.error_on_infinite&&(0,Qn.throwUnsupportedData)("[number Infinity]"),""):nt(e,(0,Hn.encodeNum)(t));case"string":return nt(e,(0,Hn.encodeStr)(t))}return(0,Qn.throwUnknownDataType)(t)}xe.addValue=kt});var Zn=Le(Qe=>{"use strict";Object.defineProperty(Qe,"__esModule",{value:!0});Qe.decompress=Qe.decode=Qe.compress=void 0;var Zu=Vn(),tn=Jn(),Xn=Gn();function ep(e){let t=(0,Xn.makeInMemoryMemory)(),r=(0,Xn.addValue)(t,e,void 0);return[(0,Xn.memToValues)(t),r]}Qe.compress=ep;function tp(e,t){if(t==="o|")return{};let r={},n=t.split("|"),o=n[1],i=Ot(e,o),a=n.length;a-2===1&&!Array.isArray(i)&&(i=[i]);for(let s=2;s<a;s++){let u=i[s-2],p=n[s];p=Ot(e,p),r[u]=p}return r}function np(e,t){if(t==="a|")return[];let r=t.split("|"),n=r.length-1,o=new Array(n);for(let i=0;i<n;i++){let a=r[i+1];a=Ot(e,a),o[i]=a}return o}function Ot(e,t){if(t===""||t==="_")return null;let r=(0,tn.decodeKey)(t),n=e[r];if(n===null)return n;switch(typeof n){case"undefined":return n;case"number":return n;case"string":switch(n[0]+n[1]){case"b|":return(0,tn.decodeBool)(n);case"o|":return tp(e,n);case"n|":return(0,tn.decodeNum)(n);case"a|":return np(e,n);default:return(0,tn.decodeStr)(n)}}return(0,Zu.throwUnknownDataType)(n)}Qe.decode=Ot;function rp(e){let[t,r]=e;return Ot(t,r)}Qe.decompress=rp});var oi=Le(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.trimUndefinedRecursively=gt.trimUndefined=void 0;function op(e){for(let t in e)e[t]===void 0&&delete e[t]}gt.trimUndefined=op;function ip(e){ri(e,new Set)}gt.trimUndefinedRecursively=ip;function ri(e,t){t.add(e);for(let r in e)if(e[r]===void 0)delete e[r];else{let n=e[r];n&&typeof n=="object"&&!t.has(n)&&ri(n,t)}}});var si=Le(Z=>{"use strict";Object.defineProperty(Z,"__esModule",{value:!0});Z.config=Z.trimUndefinedRecursively=Z.trimUndefined=Z.addValue=Z.decode=Z.decompress=Z.compress=void 0;var ii=Zn();Object.defineProperty(Z,"compress",{enumerable:!0,get:function(){return ii.compress}});Object.defineProperty(Z,"decompress",{enumerable:!0,get:function(){return ii.decompress}});var ap=Zn();Object.defineProperty(Z,"decode",{enumerable:!0,get:function(){return ap.decode}});var sp=Gn();Object.defineProperty(Z,"addValue",{enumerable:!0,get:function(){return sp.addValue}});var ai=oi();Object.defineProperty(Z,"trimUndefined",{enumerable:!0,get:function(){return ai.trimUndefined}});Object.defineProperty(Z,"trimUndefinedRecursively",{enumerable:!0,get:function(){return ai.trimUndefinedRecursively}});var up=Wn();Object.defineProperty(Z,"config",{enumerable:!0,get:function(){return up.config}})});var Ap={};Li(Ap,{createDevTools:()=>li,createDevToolsSys:()=>fi,detectFrameworks:()=>Ue,detectFrameworksFromPackageJson:()=>un,ensureConfigPlugin:()=>vi,findBuildToolConfig:()=>nr,getClientScript:()=>bi,parseDotEnvContent:()=>pn,version:()=>_t});module.exports=_i(Ap);var ji="1.19.1",ir=process.env.OVERRIDE_VERSION??ji;function ne(e){let t=e.join(e.getAppRootDir(),"tsconfig.json");return e.exists(t)}var Vi=["node_modules","dist","build","public"];async function ie(e,t){async function r(o,i){if(i>10)return;let a=await e.readdir(o);for(let s of a){if(Vi.includes(s))continue;let u=e.join(o,s),p=await e.stat(u);if(p){if(p.isFile()&&s.startsWith("builder-registry."))return u;if(p.isDirectory()){let f=await r(u,i+1);if(f)return f}}}}let n=await r(e.getAppRootDir(),0);if(!n){let i=`builder-registry.${await ne(e)?"ts":"js"}`;return e.join(t,i)}return n}async function xt(e,t){let r=e.resolve("/");for(let n=0;n<20;n++){let o=e.join(t,"package.json"),i=await e.readFile(o);if(i)return JSON.parse(i);if(t===r)break;t=e.dirname(t)}return null}async function ar(e,t){for(let r=0;r<20;r++){let n=e.dirname(t),o=e.join(n,"node_modules");if(await e.exists(o))return o;if(t===e.getAppRootDir())break;t=e.dirname(t)}return e.join(e.getAppRootDir(),"node_modules")}async function Ct(e,t,r){let n=await e.readdir(t);return n.includes(r)?e.join(t,r):(await Promise.all(n.map(async i=>{if(i.startsWith(".")||i==="node_modules")return;let a=e.join(t,i);if((await e.stat(a)).isDirectory()){let u=await Ct(e,a,r);if(u)return u}}))).find(i=>typeof i=="string")}var cr=or(ur(),1);function Ae(e){return e.endsWith(".mapper.tsx")||e.endsWith(".mapper.jsx")||e.endsWith(".mapper.ts")||e.endsWith(".mapper.js")||e.endsWith(".mapper.mjs")}function N(e,t,r){t=he(t),r=he(r),t=e.dirname(t);let n=e.basename(r,e.extname(r));r=e.dirname(r);let o;return n==="index"?o=e.relative(t,r):o=e.relative(t,e.join(r,n)),o=he(e.normalize(o)),o.startsWith(".")||(o="./"+o),o}function he(e){return e.startsWith("\\\\?\\")?e:e.replace(/\\/g,"/")}function Ye(e,t){let r=e.extname(t),n=e.basename(t,r).split(/[\/\\]/),o=n[n.length-1];return pr(o==="index"?e.basename(e.dirname(t)):o)}function pr(e){return K(e).replace(/ /g,"")}function le(e,t){let r=e.extname(t),n=he(e.basename(t,r)).split("/").pop();return K(n==="index"?e.basename(e.dirname(t)):n)}function M(e,t){let r=he(e.relative(e.getAppRootDir(),t));r=r.split("/").filter(o=>o!=="."&&o!==".."&&o!=="").join("/"),r.endsWith(".tsx")||r.endsWith(".jsx")?r=r.slice(0,-4):(r.endsWith(".ts")||r.endsWith(".js"))&&(r=r.slice(0,-3));let n=e.getFrameworks();return r.startsWith("src/")&&(r=r.slice(4)),n.some(o=>o.name.includes("next"))?"@/"+r:"~/"+r}function k(e,t){let r=t,n=[];for(let o=0;o<2;o++){let i=e.basename(r);if(!i||i==="components")break;n.unshift(i),r=e.dirname(r)}return n.join("/")}function K(e){for(e=e.replace(/([A-Z])/g," $1").replace(/\./g," ").replace(/_/g," ").replace(/-/g," ").replace(/\s/g," ").trim();e.includes(" ");)e=e.replace(/ /g," ");return e.split(" ").map(t=>t.length>2?t[0].toUpperCase()+t.slice(1):t).join("").trim()}function ae(e){return e.sort((t,r)=>t.name.toLocaleLowerCase().localeCompare(r.name.toLocaleLowerCase()))}async function V(e,t,r,n){if(typeof r!="string"||r==="")throw new Error(`getComponentId(), exportName must be a non-empty string, received: ${r}, ${t}`);return n&&(t=n),t=e.normalize(t),(await e.hash(t+"#"+r)).substring(0,8)}function ht(e){return typeof e=="number"}function rt(e){return typeof e=="boolean"}function re(e){return typeof e=="string"}function ot(e){return typeof e=="string"?/^[A-Z][A-Za-z0-9]*$/.test(e):!1}function pe(e){return JSON.parse(JSON.stringify(e))}function jt(e,t,r){for(let n of t)if(e.dirname(r).includes(n))return!0;return!1}function lr(){try{let e=(0,cr.default)();if(e?.name)return e.name}catch{}return"npm"}async function Ue(e){let t=[],r=await xt(e,e.getRepoRootDir());if(r){let n=await un(r,e);t.push(...n)}return t}async function fr(e){let t=await xt(e,e.getRepoRootDir());return t?.scripts?.dev?t.scripts.dev.includes("--turbopack"):!1}async function un(e,t){let r=[];if(e&&typeof e=="object"){let n=new Set(Object.keys({...e.dependencies,...e.devDependencies}));for(let o of Ki)if(n.has(o)&&!r.some(i=>i.name===o)){let i={name:o};mr.has(o)&&(i.version=await mr.get(o)(t)),r.push(i)}}return r}function sn(e){let t=parseInt(e);return Number.isNaN(t)?void 0:t}var mr=new Map([["next",async e=>{if(!e.spawnSync)return;let t=lr(),r=t==="npm"?"npx":t,{stdout:n}=e.spawnSync(r,["next","-v"],{encoding:"utf8"});if(!n)return;let o=n.match(/(Next.js v)([\d.]+)/g);if(!o)return;let i=o[0].split("Next.js v")[1],[a,s,u]=i.split(".");return{major:sn(a),minor:sn(s),patch:sn(u)}}]]),Ki=["@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 me(e){let t=dr(e),r=await e.readFile(t);return typeof r=="string"?JSON.parse(r):{}}async function fe(e,t){t=typeof t=="object"&&t!=null?t:{};let r=dr(e);await e.writeFile(r,JSON.stringify(t??{},null,2))}function dr(e){let t=e.getAppRootDir();return e.join(t,"node_modules",".builder","builder-cache.json")}async function Fe(e,t,r){let n={envKey:r,envValue:null,file:""};for(let o of t){let i=e.join(e.getAppRootDir(),o),a=await Mi(e,i);if(a){let s=a[r];if(typeof s=="string"&&s.length>0&&s!=="YOUR_API_KEY")return n.envValue=s,n.file=i,n}}return n.file=e.join(e.getAppRootDir(),t[t.length-1]),n}async function Mi(e,t){let r=await e.readFile(t);return typeof r=="string"?pn(r):null}function pn(e){let t={},r=e.replace(/\r\n?/gm,`
2
2
  `),n;for(;(n=Ui.exec(r))!=null;){let o=n[1],i=n[2]||"";i=i.trim();let a=i[0];i=i.replace(/^(['"`])([\s\S]*)\1$/gm,"$2"),a==='"'&&(i=i.replace(/\\n/g,`
3
3
  `),i=i.replace(/\\r/g,"\r")),t[o]=i}return t}var Ui=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm;async function Pe(e,t,r,n){let o="# https://www.builder.io/c/docs/using-your-api-key",i=await e.readFile(t);try{if(i)if(i.includes(r))if(i.includes(n))e.debug(`"${r}" with "${n}" already set in ${t}`);else return e.debug(`Replace "${r}" in ${t}`),i=i.replace(new RegExp(`${r}=.*`),`${r}=${n}`),await e.writeFile(t,i),"update";else return e.debug(`Append "${r}" to ${t}`),i+=`
4
4
 
package/core/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
- var yi=Object.create;var an=Object.defineProperty;var wi=Object.getOwnPropertyDescriptor;var vi=Object.getOwnPropertyNames;var Ti=Object.getPrototypeOf,bi=Object.prototype.hasOwnProperty;var Ii=(e,t,r)=>t in e?an(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Le=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ri=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of vi(t))!bi.call(e,o)&&o!==r&&an(e,o,{get:()=>t[o],enumerable:!(n=wi(t,o))||n.enumerable});return e};var er=(e,t,r)=>(r=e!=null?yi(Ti(e)):{},Ri(t||!e||!e.__esModule?an(r,"default",{value:e,enumerable:!0}):r,e));var Me=(e,t,r)=>Ii(e,typeof t!="symbol"?t+"":t,r);var or=Le((Fp,rr)=>{"use strict";rr.exports=function(){if(process.env.npm_config_user_agent)return ki(process.env.npm_config_user_agent)};function ki(e){let t=e.split(" ")[0],r=t.lastIndexOf("/"),n=t.substring(0,r);return{name:n==="npminstall"?"cnpm":n,version:t.substring(r+1)}}});var _n=Le(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.throwUnsupportedData=Je.throwUnknownDataType=Je.getType=void 0;function Wo(e){return Object.prototype.toString.call(e)}Je.getType=Wo;function ku(e){throw new TypeError("unsupported data type: "+Wo(e))}Je.throwUnknownDataType=ku;function Ou(e){throw new TypeError("unsupported data type: "+e)}Je.throwUnsupportedData=Ou});var Mn=Le(G=>{"use strict";Object.defineProperty(G,"__esModule",{value:!0});G.s_to_num=G.int_str_to_s=G.num_to_s=G.big_int_to_s=G.int_to_s=G.s_to_big_int=G.s_to_int=void 0;var Ke="";for(let e=0;e<10;e++){let t=String.fromCharCode(48+e);Ke+=t}for(let e=0;e<26;e++){let t=String.fromCharCode(65+e);Ke+=t}for(let e=0;e<26;e++){let t=String.fromCharCode(97+e);Ke+=t}var dt=Ke.length,Vn={};for(let e=0;e<dt;e++){let t=Ke[e];Vn[t]=e}function $n(e){let t=0,r=1;for(let n=e.length-1;n>=0;n--){let o=e[n],i=Vn[o];i*=r,t+=i,r*=dt}return t}G.s_to_int=$n;function Qo(e){let t=BigInt(0),r=BigInt(1),n=BigInt(dt);for(let o=e.length-1;o>=0;o--){let i=e[o],a=BigInt(Vn[i]);a*=r,t+=a,r*=n}return t}G.s_to_big_int=Qo;function Kn(e){if(e===0)return Ke[0];let t=[];for(;e!==0;){let r=e%dt,n=Ke[r];t.push(n),e-=r,e/=dt}return t.reverse().join("")}G.int_to_s=Kn;function Ho(e){let t=BigInt(0),r=BigInt(dt);if(e===t)return Ke[0];let n=[];for(;e!==t;){let o=e%r,i=Ke[Number(o)];n.push(i),e/=r}return n.reverse().join("")}G.big_int_to_s=Ho;function Yo(e){return e.split("").reverse().join("")}function Go(e){if(e<0)return"-"+Go(-e);let[t,r]=e.toString().split(".");if(!r)if(t.includes("e")){let[i,a]=t.split("e");t=i,r="0e"+a}else return Kn(e);let n;r&&([r,n]=r.split("e")),t=Gt(t),r=Yo(r),r=Gt(r);let o=t+"."+r;if(n){switch(o+=".",n[0]){case"+":n=n.slice(1);break;case"-":o+="-",n=n.slice(1);break}n=Gt(n),o+=n}return o}G.num_to_s=Go;function Gt(e){let t=+e;return t.toString()===e&&t+1!==t&&t-1!==t?Kn(t):":"+Ho(BigInt(e))}G.int_str_to_s=Gt;function jn(e){return e[0]===":"?Qo(e.substring(1)).toString():$n(e).toString()}function Xo(e){if(e[0]==="-")return-Xo(e.substr(1));let[t,r,n]=e.split(".");if(!r)return $n(t);t=jn(t),r=jn(r),r=Yo(r);let o=t+"."+r;if(n){o+="e";let i=!1;n[0]==="-"&&(i=!0,n=n.slice(1)),n=jn(n),o+=i?-n:+n}return+o}G.s_to_num=Xo});var zn=Le(X=>{"use strict";Object.defineProperty(X,"__esModule",{value:!0});X.decodeStr=X.encodeStr=X.decodeBool=X.encodeBool=X.decodeKey=X.decodeNum=X.encodeNum=void 0;var Un=Mn();function Lu(e){return"n|"+(0,Un.num_to_s)(e)}X.encodeNum=Lu;function _u(e){return e=e.replace("n|",""),(0,Un.s_to_num)(e)}X.decodeNum=_u;function ju(e){return typeof e=="number"?e:(0,Un.s_to_int)(e)}X.decodeKey=ju;function Vu(e){return e?"b|T":"b|F"}X.encodeBool=Vu;function $u(e){switch(e){case"b|T":return!0;case"b|F":return!1}return!!e}X.decodeBool=$u;function Ku(e){switch(e[0]+e[1]){case"b|":case"o|":case"n|":case"a|":case"s|":e="s|"+e}return e}X.encodeStr=Ku;function Mu(e){return e[0]+e[1]==="s|"?e.substr(2):e}X.decodeStr=Mu});var qn=Le(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.config=void 0;Xt.config={sort_key:!1,error_on_nan:!1,error_on_infinite:!1}});var Hn=Le(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.addValue=xe.makeInMemoryMemory=xe.makeInMemoryCache=xe.makeInMemoryStore=xe.memToValues=void 0;var Qn=qn(),Jn=_n(),Wn=zn(),Uu=Mn();function zu(e){return e.store.toArray()}xe.memToValues=zu;function Zo(){let e=[];return{forEach(t){for(let r=0;r<e.length;r++)if(t(e[r])==="break")return},add(t){e.push(t)},toArray(){return e}}}xe.makeInMemoryStore=Zo;function ei(){let e=Object.create(null),t=Object.create(null);return{getValue(r){return e[r]},getSchema(r){return t[r]},forEachValue(r){for(let[n,o]of Object.entries(e))if(r(n,o)==="break")return},forEachSchema(r){for(let[n,o]of Object.entries(t))if(r(n,o)==="break")return},setValue(r,n){e[r]=n},setSchema(r,n){t[r]=n},hasValue(r){return r in e},hasSchema(r){return r in t}}}xe.makeInMemoryCache=ei;function qu(){return{store:Zo(),cache:ei(),keyCount:0}}xe.makeInMemoryMemory=qu;function nt(e,t){if(e.cache.hasValue(t))return e.cache.getValue(t);let r=e.keyCount++,n=(0,Uu.num_to_s)(r);return e.store.add(t),e.cache.setValue(t,n),n}function Ju(e,t){Qn.config.sort_key&&t.sort();let r=t.join(",");if(e.cache.hasSchema(r))return e.cache.getSchema(r);let n=Bt(e,t,void 0);return e.cache.setSchema(r,n),n}function Bt(e,t,r){if(t===null)return"";switch(typeof t){case"undefined":if(Array.isArray(r))return Bt(e,null,r);break;case"object":if(t===null)return nt(e,null);if(Array.isArray(t)){let n="a";for(let o=0;o<t.length;o++){let i=t[o],a=i===null?"_":Bt(e,i,t);n+="|"+a}return n==="a"&&(n="a|"),nt(e,n)}else{let n=Object.keys(t);if(n.length===0)return nt(e,"o|");let o="o",i=Ju(e,n);o+="|"+i;for(let a of n){let s=t[a],u=Bt(e,s,t);o+="|"+u}return nt(e,o)}case"boolean":return nt(e,(0,Wn.encodeBool)(t));case"number":return Number.isNaN(t)?(Qn.config.error_on_nan&&(0,Jn.throwUnsupportedData)("[number NaN]"),""):Number.POSITIVE_INFINITY===t||Number.NEGATIVE_INFINITY===t?(Qn.config.error_on_infinite&&(0,Jn.throwUnsupportedData)("[number Infinity]"),""):nt(e,(0,Wn.encodeNum)(t));case"string":return nt(e,(0,Wn.encodeStr)(t))}return(0,Jn.throwUnknownDataType)(t)}xe.addValue=Bt});var Gn=Le(We=>{"use strict";Object.defineProperty(We,"__esModule",{value:!0});We.decompress=We.decode=We.compress=void 0;var Wu=_n(),Zt=zn(),Yn=Hn();function Qu(e){let t=(0,Yn.makeInMemoryMemory)(),r=(0,Yn.addValue)(t,e,void 0);return[(0,Yn.memToValues)(t),r]}We.compress=Qu;function Hu(e,t){if(t==="o|")return{};let r={},n=t.split("|"),o=n[1],i=kt(e,o),a=n.length;a-2===1&&!Array.isArray(i)&&(i=[i]);for(let s=2;s<a;s++){let u=i[s-2],p=n[s];p=kt(e,p),r[u]=p}return r}function Yu(e,t){if(t==="a|")return[];let r=t.split("|"),n=r.length-1,o=new Array(n);for(let i=0;i<n;i++){let a=r[i+1];a=kt(e,a),o[i]=a}return o}function kt(e,t){if(t===""||t==="_")return null;let r=(0,Zt.decodeKey)(t),n=e[r];if(n===null)return n;switch(typeof n){case"undefined":return n;case"number":return n;case"string":switch(n[0]+n[1]){case"b|":return(0,Zt.decodeBool)(n);case"o|":return Hu(e,n);case"n|":return(0,Zt.decodeNum)(n);case"a|":return Yu(e,n);default:return(0,Zt.decodeStr)(n)}}return(0,Wu.throwUnknownDataType)(n)}We.decode=kt;function Gu(e){let[t,r]=e;return kt(t,r)}We.decompress=Gu});var ni=Le(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.trimUndefinedRecursively=gt.trimUndefined=void 0;function Xu(e){for(let t in e)e[t]===void 0&&delete e[t]}gt.trimUndefined=Xu;function Zu(e){ti(e,new Set)}gt.trimUndefinedRecursively=Zu;function ti(e,t){t.add(e);for(let r in e)if(e[r]===void 0)delete e[r];else{let n=e[r];n&&typeof n=="object"&&!t.has(n)&&ti(n,t)}}});var ii=Le(Z=>{"use strict";Object.defineProperty(Z,"__esModule",{value:!0});Z.config=Z.trimUndefinedRecursively=Z.trimUndefined=Z.addValue=Z.decode=Z.decompress=Z.compress=void 0;var ri=Gn();Object.defineProperty(Z,"compress",{enumerable:!0,get:function(){return ri.compress}});Object.defineProperty(Z,"decompress",{enumerable:!0,get:function(){return ri.decompress}});var ep=Gn();Object.defineProperty(Z,"decode",{enumerable:!0,get:function(){return ep.decode}});var tp=Hn();Object.defineProperty(Z,"addValue",{enumerable:!0,get:function(){return tp.addValue}});var oi=ni();Object.defineProperty(Z,"trimUndefined",{enumerable:!0,get:function(){return oi.trimUndefined}});Object.defineProperty(Z,"trimUndefinedRecursively",{enumerable:!0,get:function(){return oi.trimUndefinedRecursively}});var np=qn();Object.defineProperty(Z,"config",{enumerable:!0,get:function(){return np.config}})});var Ni="1.19.0",tr=process.env.OVERRIDE_VERSION??Ni;function ne(e){let t=e.join(e.getAppRootDir(),"tsconfig.json");return e.exists(t)}var Bi=["node_modules","dist","build","public"];async function ie(e,t){async function r(o,i){if(i>10)return;let a=await e.readdir(o);for(let s of a){if(Bi.includes(s))continue;let u=e.join(o,s),p=await e.stat(u);if(p){if(p.isFile()&&s.startsWith("builder-registry."))return u;if(p.isDirectory()){let f=await r(u,i+1);if(f)return f}}}}let n=await r(e.getAppRootDir(),0);if(!n){let i=`builder-registry.${await ne(e)?"ts":"js"}`;return e.join(t,i)}return n}async function Dt(e,t){let r=e.resolve("/");for(let n=0;n<20;n++){let o=e.join(t,"package.json"),i=await e.readFile(o);if(i)return JSON.parse(i);if(t===r)break;t=e.dirname(t)}return null}async function nr(e,t){for(let r=0;r<20;r++){let n=e.dirname(t),o=e.join(n,"node_modules");if(await e.exists(o))return o;if(t===e.getAppRootDir())break;t=e.dirname(t)}return e.join(e.getAppRootDir(),"node_modules")}async function xt(e,t,r){let n=await e.readdir(t);return n.includes(r)?e.join(t,r):(await Promise.all(n.map(async i=>{if(i.startsWith(".")||i==="node_modules")return;let a=e.join(t,i);if((await e.stat(a)).isDirectory()){let u=await xt(e,a,r);if(u)return u}}))).find(i=>typeof i=="string")}var ar=er(or(),1);function Ae(e){return e.endsWith(".mapper.tsx")||e.endsWith(".mapper.jsx")||e.endsWith(".mapper.ts")||e.endsWith(".mapper.js")||e.endsWith(".mapper.mjs")}function N(e,t,r){t=he(t),r=he(r),t=e.dirname(t);let n=e.basename(r,e.extname(r));r=e.dirname(r);let o;return n==="index"?o=e.relative(t,r):o=e.relative(t,e.join(r,n)),o=he(e.normalize(o)),o.startsWith(".")||(o="./"+o),o}function he(e){return e.startsWith("\\\\?\\")?e:e.replace(/\\/g,"/")}function He(e,t){let r=e.extname(t),n=e.basename(t,r).split(/[\/\\]/),o=n[n.length-1];return ir(o==="index"?e.basename(e.dirname(t)):o)}function ir(e){return K(e).replace(/ /g,"")}function le(e,t){let r=e.extname(t),n=he(e.basename(t,r)).split("/").pop();return K(n==="index"?e.basename(e.dirname(t)):n)}function M(e,t){let r=he(e.relative(e.getAppRootDir(),t));r=r.split("/").filter(o=>o!=="."&&o!==".."&&o!=="").join("/"),r.endsWith(".tsx")||r.endsWith(".jsx")?r=r.slice(0,-4):(r.endsWith(".ts")||r.endsWith(".js"))&&(r=r.slice(0,-3));let n=e.getFrameworks();return r.startsWith("src/")&&(r=r.slice(4)),n.some(o=>o.name.includes("next"))?"@/"+r:"~/"+r}function k(e,t){let r=t,n=[];for(let o=0;o<2;o++){let i=e.basename(r);if(!i||i==="components")break;n.unshift(i),r=e.dirname(r)}return n.join("/")}function K(e){for(e=e.replace(/([A-Z])/g," $1").replace(/\./g," ").replace(/_/g," ").replace(/-/g," ").replace(/\s/g," ").trim();e.includes(" ");)e=e.replace(/ /g," ");return e.split(" ").map(t=>t.length>2?t[0].toUpperCase()+t.slice(1):t).join("").trim()}function ae(e){return e.sort((t,r)=>t.name.toLocaleLowerCase().localeCompare(r.name.toLocaleLowerCase()))}async function V(e,t,r,n){if(typeof r!="string"||r==="")throw new Error(`getComponentId(), exportName must be a non-empty string, received: ${r}, ${t}`);return n&&(t=n),t=e.normalize(t),(await e.hash(t+"#"+r)).substring(0,8)}function Ct(e){return typeof e=="number"}function rt(e){return typeof e=="boolean"}function re(e){return typeof e=="string"}function ot(e){return typeof e=="string"?/^[A-Z][A-Za-z0-9]*$/.test(e):!1}function pe(e){return JSON.parse(JSON.stringify(e))}function Lt(e,t,r){for(let n of t)if(e.dirname(r).includes(n))return!0;return!1}function sr(){try{let e=(0,ar.default)();if(e?.name)return e.name}catch{}return"npm"}async function Ye(e){let t=[],r=await Dt(e,e.getRepoRootDir());if(r){let n=await cr(r,e);t.push(...n)}return t}async function pr(e){let t=await Dt(e,e.getRepoRootDir());return t?.scripts?.dev?t.scripts.dev.includes("--turbopack"):!1}async function cr(e,t){let r=[];if(e&&typeof e=="object"){let n=new Set(Object.keys({...e.dependencies,...e.devDependencies}));for(let o of Oi)if(n.has(o)&&!r.some(i=>i.name===o)){let i={name:o};ur.has(o)&&(i.version=await ur.get(o)(t)),r.push(i)}}return r}function sn(e){let t=parseInt(e);return Number.isNaN(t)?void 0:t}var ur=new Map([["next",async e=>{if(!e.spawnSync)return;let t=sr(),r=t==="npm"?"npx":t,{stdout:n}=e.spawnSync(r,["next","-v"],{encoding:"utf8"});if(!n)return;let o=n.match(/(Next.js v)([\d.]+)/g);if(!o)return;let i=o[0].split("Next.js v")[1],[a,s,u]=i.split(".");return{major:sn(a),minor:sn(s),patch:sn(u)}}]]),Oi=["@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 me(e){let t=lr(e),r=await e.readFile(t);return typeof r=="string"?JSON.parse(r):{}}async function fe(e,t){t=typeof t=="object"&&t!=null?t:{};let r=lr(e);await e.writeFile(r,JSON.stringify(t??{},null,2))}function lr(e){let t=e.getAppRootDir();return e.join(t,"node_modules",".builder","builder-cache.json")}async function Fe(e,t,r){let n={envKey:r,envValue:null,file:""};for(let o of t){let i=e.join(e.getAppRootDir(),o),a=await Li(e,i);if(a){let s=a[r];if(typeof s=="string"&&s.length>0&&s!=="YOUR_API_KEY")return n.envValue=s,n.file=i,n}}return n.file=e.join(e.getAppRootDir(),t[t.length-1]),n}async function Li(e,t){let r=await e.readFile(t);return typeof r=="string"?mr(r):null}function mr(e){let t={},r=e.replace(/\r\n?/gm,`
2
+ var yi=Object.create;var an=Object.defineProperty;var wi=Object.getOwnPropertyDescriptor;var vi=Object.getOwnPropertyNames;var Ti=Object.getPrototypeOf,bi=Object.prototype.hasOwnProperty;var Ii=(e,t,r)=>t in e?an(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Le=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ri=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of vi(t))!bi.call(e,o)&&o!==r&&an(e,o,{get:()=>t[o],enumerable:!(n=wi(t,o))||n.enumerable});return e};var er=(e,t,r)=>(r=e!=null?yi(Ti(e)):{},Ri(t||!e||!e.__esModule?an(r,"default",{value:e,enumerable:!0}):r,e));var Me=(e,t,r)=>Ii(e,typeof t!="symbol"?t+"":t,r);var or=Le((Fp,rr)=>{"use strict";rr.exports=function(){if(process.env.npm_config_user_agent)return ki(process.env.npm_config_user_agent)};function ki(e){let t=e.split(" ")[0],r=t.lastIndexOf("/"),n=t.substring(0,r);return{name:n==="npminstall"?"cnpm":n,version:t.substring(r+1)}}});var _n=Le(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.throwUnsupportedData=Je.throwUnknownDataType=Je.getType=void 0;function Wo(e){return Object.prototype.toString.call(e)}Je.getType=Wo;function ku(e){throw new TypeError("unsupported data type: "+Wo(e))}Je.throwUnknownDataType=ku;function Ou(e){throw new TypeError("unsupported data type: "+e)}Je.throwUnsupportedData=Ou});var Mn=Le(G=>{"use strict";Object.defineProperty(G,"__esModule",{value:!0});G.s_to_num=G.int_str_to_s=G.num_to_s=G.big_int_to_s=G.int_to_s=G.s_to_big_int=G.s_to_int=void 0;var Ke="";for(let e=0;e<10;e++){let t=String.fromCharCode(48+e);Ke+=t}for(let e=0;e<26;e++){let t=String.fromCharCode(65+e);Ke+=t}for(let e=0;e<26;e++){let t=String.fromCharCode(97+e);Ke+=t}var dt=Ke.length,Vn={};for(let e=0;e<dt;e++){let t=Ke[e];Vn[t]=e}function $n(e){let t=0,r=1;for(let n=e.length-1;n>=0;n--){let o=e[n],i=Vn[o];i*=r,t+=i,r*=dt}return t}G.s_to_int=$n;function Qo(e){let t=BigInt(0),r=BigInt(1),n=BigInt(dt);for(let o=e.length-1;o>=0;o--){let i=e[o],a=BigInt(Vn[i]);a*=r,t+=a,r*=n}return t}G.s_to_big_int=Qo;function Kn(e){if(e===0)return Ke[0];let t=[];for(;e!==0;){let r=e%dt,n=Ke[r];t.push(n),e-=r,e/=dt}return t.reverse().join("")}G.int_to_s=Kn;function Ho(e){let t=BigInt(0),r=BigInt(dt);if(e===t)return Ke[0];let n=[];for(;e!==t;){let o=e%r,i=Ke[Number(o)];n.push(i),e/=r}return n.reverse().join("")}G.big_int_to_s=Ho;function Yo(e){return e.split("").reverse().join("")}function Go(e){if(e<0)return"-"+Go(-e);let[t,r]=e.toString().split(".");if(!r)if(t.includes("e")){let[i,a]=t.split("e");t=i,r="0e"+a}else return Kn(e);let n;r&&([r,n]=r.split("e")),t=Gt(t),r=Yo(r),r=Gt(r);let o=t+"."+r;if(n){switch(o+=".",n[0]){case"+":n=n.slice(1);break;case"-":o+="-",n=n.slice(1);break}n=Gt(n),o+=n}return o}G.num_to_s=Go;function Gt(e){let t=+e;return t.toString()===e&&t+1!==t&&t-1!==t?Kn(t):":"+Ho(BigInt(e))}G.int_str_to_s=Gt;function jn(e){return e[0]===":"?Qo(e.substring(1)).toString():$n(e).toString()}function Xo(e){if(e[0]==="-")return-Xo(e.substr(1));let[t,r,n]=e.split(".");if(!r)return $n(t);t=jn(t),r=jn(r),r=Yo(r);let o=t+"."+r;if(n){o+="e";let i=!1;n[0]==="-"&&(i=!0,n=n.slice(1)),n=jn(n),o+=i?-n:+n}return+o}G.s_to_num=Xo});var zn=Le(X=>{"use strict";Object.defineProperty(X,"__esModule",{value:!0});X.decodeStr=X.encodeStr=X.decodeBool=X.encodeBool=X.decodeKey=X.decodeNum=X.encodeNum=void 0;var Un=Mn();function Lu(e){return"n|"+(0,Un.num_to_s)(e)}X.encodeNum=Lu;function _u(e){return e=e.replace("n|",""),(0,Un.s_to_num)(e)}X.decodeNum=_u;function ju(e){return typeof e=="number"?e:(0,Un.s_to_int)(e)}X.decodeKey=ju;function Vu(e){return e?"b|T":"b|F"}X.encodeBool=Vu;function $u(e){switch(e){case"b|T":return!0;case"b|F":return!1}return!!e}X.decodeBool=$u;function Ku(e){switch(e[0]+e[1]){case"b|":case"o|":case"n|":case"a|":case"s|":e="s|"+e}return e}X.encodeStr=Ku;function Mu(e){return e[0]+e[1]==="s|"?e.substr(2):e}X.decodeStr=Mu});var qn=Le(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.config=void 0;Xt.config={sort_key:!1,error_on_nan:!1,error_on_infinite:!1}});var Hn=Le(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.addValue=xe.makeInMemoryMemory=xe.makeInMemoryCache=xe.makeInMemoryStore=xe.memToValues=void 0;var Qn=qn(),Jn=_n(),Wn=zn(),Uu=Mn();function zu(e){return e.store.toArray()}xe.memToValues=zu;function Zo(){let e=[];return{forEach(t){for(let r=0;r<e.length;r++)if(t(e[r])==="break")return},add(t){e.push(t)},toArray(){return e}}}xe.makeInMemoryStore=Zo;function ei(){let e=Object.create(null),t=Object.create(null);return{getValue(r){return e[r]},getSchema(r){return t[r]},forEachValue(r){for(let[n,o]of Object.entries(e))if(r(n,o)==="break")return},forEachSchema(r){for(let[n,o]of Object.entries(t))if(r(n,o)==="break")return},setValue(r,n){e[r]=n},setSchema(r,n){t[r]=n},hasValue(r){return r in e},hasSchema(r){return r in t}}}xe.makeInMemoryCache=ei;function qu(){return{store:Zo(),cache:ei(),keyCount:0}}xe.makeInMemoryMemory=qu;function nt(e,t){if(e.cache.hasValue(t))return e.cache.getValue(t);let r=e.keyCount++,n=(0,Uu.num_to_s)(r);return e.store.add(t),e.cache.setValue(t,n),n}function Ju(e,t){Qn.config.sort_key&&t.sort();let r=t.join(",");if(e.cache.hasSchema(r))return e.cache.getSchema(r);let n=Bt(e,t,void 0);return e.cache.setSchema(r,n),n}function Bt(e,t,r){if(t===null)return"";switch(typeof t){case"undefined":if(Array.isArray(r))return Bt(e,null,r);break;case"object":if(t===null)return nt(e,null);if(Array.isArray(t)){let n="a";for(let o=0;o<t.length;o++){let i=t[o],a=i===null?"_":Bt(e,i,t);n+="|"+a}return n==="a"&&(n="a|"),nt(e,n)}else{let n=Object.keys(t);if(n.length===0)return nt(e,"o|");let o="o",i=Ju(e,n);o+="|"+i;for(let a of n){let s=t[a],u=Bt(e,s,t);o+="|"+u}return nt(e,o)}case"boolean":return nt(e,(0,Wn.encodeBool)(t));case"number":return Number.isNaN(t)?(Qn.config.error_on_nan&&(0,Jn.throwUnsupportedData)("[number NaN]"),""):Number.POSITIVE_INFINITY===t||Number.NEGATIVE_INFINITY===t?(Qn.config.error_on_infinite&&(0,Jn.throwUnsupportedData)("[number Infinity]"),""):nt(e,(0,Wn.encodeNum)(t));case"string":return nt(e,(0,Wn.encodeStr)(t))}return(0,Jn.throwUnknownDataType)(t)}xe.addValue=Bt});var Gn=Le(We=>{"use strict";Object.defineProperty(We,"__esModule",{value:!0});We.decompress=We.decode=We.compress=void 0;var Wu=_n(),Zt=zn(),Yn=Hn();function Qu(e){let t=(0,Yn.makeInMemoryMemory)(),r=(0,Yn.addValue)(t,e,void 0);return[(0,Yn.memToValues)(t),r]}We.compress=Qu;function Hu(e,t){if(t==="o|")return{};let r={},n=t.split("|"),o=n[1],i=kt(e,o),a=n.length;a-2===1&&!Array.isArray(i)&&(i=[i]);for(let s=2;s<a;s++){let u=i[s-2],p=n[s];p=kt(e,p),r[u]=p}return r}function Yu(e,t){if(t==="a|")return[];let r=t.split("|"),n=r.length-1,o=new Array(n);for(let i=0;i<n;i++){let a=r[i+1];a=kt(e,a),o[i]=a}return o}function kt(e,t){if(t===""||t==="_")return null;let r=(0,Zt.decodeKey)(t),n=e[r];if(n===null)return n;switch(typeof n){case"undefined":return n;case"number":return n;case"string":switch(n[0]+n[1]){case"b|":return(0,Zt.decodeBool)(n);case"o|":return Hu(e,n);case"n|":return(0,Zt.decodeNum)(n);case"a|":return Yu(e,n);default:return(0,Zt.decodeStr)(n)}}return(0,Wu.throwUnknownDataType)(n)}We.decode=kt;function Gu(e){let[t,r]=e;return kt(t,r)}We.decompress=Gu});var ni=Le(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.trimUndefinedRecursively=gt.trimUndefined=void 0;function Xu(e){for(let t in e)e[t]===void 0&&delete e[t]}gt.trimUndefined=Xu;function Zu(e){ti(e,new Set)}gt.trimUndefinedRecursively=Zu;function ti(e,t){t.add(e);for(let r in e)if(e[r]===void 0)delete e[r];else{let n=e[r];n&&typeof n=="object"&&!t.has(n)&&ti(n,t)}}});var ii=Le(Z=>{"use strict";Object.defineProperty(Z,"__esModule",{value:!0});Z.config=Z.trimUndefinedRecursively=Z.trimUndefined=Z.addValue=Z.decode=Z.decompress=Z.compress=void 0;var ri=Gn();Object.defineProperty(Z,"compress",{enumerable:!0,get:function(){return ri.compress}});Object.defineProperty(Z,"decompress",{enumerable:!0,get:function(){return ri.decompress}});var ep=Gn();Object.defineProperty(Z,"decode",{enumerable:!0,get:function(){return ep.decode}});var tp=Hn();Object.defineProperty(Z,"addValue",{enumerable:!0,get:function(){return tp.addValue}});var oi=ni();Object.defineProperty(Z,"trimUndefined",{enumerable:!0,get:function(){return oi.trimUndefined}});Object.defineProperty(Z,"trimUndefinedRecursively",{enumerable:!0,get:function(){return oi.trimUndefinedRecursively}});var np=qn();Object.defineProperty(Z,"config",{enumerable:!0,get:function(){return np.config}})});var Ni="1.19.1",tr=process.env.OVERRIDE_VERSION??Ni;function ne(e){let t=e.join(e.getAppRootDir(),"tsconfig.json");return e.exists(t)}var Bi=["node_modules","dist","build","public"];async function ie(e,t){async function r(o,i){if(i>10)return;let a=await e.readdir(o);for(let s of a){if(Bi.includes(s))continue;let u=e.join(o,s),p=await e.stat(u);if(p){if(p.isFile()&&s.startsWith("builder-registry."))return u;if(p.isDirectory()){let f=await r(u,i+1);if(f)return f}}}}let n=await r(e.getAppRootDir(),0);if(!n){let i=`builder-registry.${await ne(e)?"ts":"js"}`;return e.join(t,i)}return n}async function Dt(e,t){let r=e.resolve("/");for(let n=0;n<20;n++){let o=e.join(t,"package.json"),i=await e.readFile(o);if(i)return JSON.parse(i);if(t===r)break;t=e.dirname(t)}return null}async function nr(e,t){for(let r=0;r<20;r++){let n=e.dirname(t),o=e.join(n,"node_modules");if(await e.exists(o))return o;if(t===e.getAppRootDir())break;t=e.dirname(t)}return e.join(e.getAppRootDir(),"node_modules")}async function xt(e,t,r){let n=await e.readdir(t);return n.includes(r)?e.join(t,r):(await Promise.all(n.map(async i=>{if(i.startsWith(".")||i==="node_modules")return;let a=e.join(t,i);if((await e.stat(a)).isDirectory()){let u=await xt(e,a,r);if(u)return u}}))).find(i=>typeof i=="string")}var ar=er(or(),1);function Ae(e){return e.endsWith(".mapper.tsx")||e.endsWith(".mapper.jsx")||e.endsWith(".mapper.ts")||e.endsWith(".mapper.js")||e.endsWith(".mapper.mjs")}function N(e,t,r){t=he(t),r=he(r),t=e.dirname(t);let n=e.basename(r,e.extname(r));r=e.dirname(r);let o;return n==="index"?o=e.relative(t,r):o=e.relative(t,e.join(r,n)),o=he(e.normalize(o)),o.startsWith(".")||(o="./"+o),o}function he(e){return e.startsWith("\\\\?\\")?e:e.replace(/\\/g,"/")}function He(e,t){let r=e.extname(t),n=e.basename(t,r).split(/[\/\\]/),o=n[n.length-1];return ir(o==="index"?e.basename(e.dirname(t)):o)}function ir(e){return K(e).replace(/ /g,"")}function le(e,t){let r=e.extname(t),n=he(e.basename(t,r)).split("/").pop();return K(n==="index"?e.basename(e.dirname(t)):n)}function M(e,t){let r=he(e.relative(e.getAppRootDir(),t));r=r.split("/").filter(o=>o!=="."&&o!==".."&&o!=="").join("/"),r.endsWith(".tsx")||r.endsWith(".jsx")?r=r.slice(0,-4):(r.endsWith(".ts")||r.endsWith(".js"))&&(r=r.slice(0,-3));let n=e.getFrameworks();return r.startsWith("src/")&&(r=r.slice(4)),n.some(o=>o.name.includes("next"))?"@/"+r:"~/"+r}function k(e,t){let r=t,n=[];for(let o=0;o<2;o++){let i=e.basename(r);if(!i||i==="components")break;n.unshift(i),r=e.dirname(r)}return n.join("/")}function K(e){for(e=e.replace(/([A-Z])/g," $1").replace(/\./g," ").replace(/_/g," ").replace(/-/g," ").replace(/\s/g," ").trim();e.includes(" ");)e=e.replace(/ /g," ");return e.split(" ").map(t=>t.length>2?t[0].toUpperCase()+t.slice(1):t).join("").trim()}function ae(e){return e.sort((t,r)=>t.name.toLocaleLowerCase().localeCompare(r.name.toLocaleLowerCase()))}async function V(e,t,r,n){if(typeof r!="string"||r==="")throw new Error(`getComponentId(), exportName must be a non-empty string, received: ${r}, ${t}`);return n&&(t=n),t=e.normalize(t),(await e.hash(t+"#"+r)).substring(0,8)}function Ct(e){return typeof e=="number"}function rt(e){return typeof e=="boolean"}function re(e){return typeof e=="string"}function ot(e){return typeof e=="string"?/^[A-Z][A-Za-z0-9]*$/.test(e):!1}function pe(e){return JSON.parse(JSON.stringify(e))}function Lt(e,t,r){for(let n of t)if(e.dirname(r).includes(n))return!0;return!1}function sr(){try{let e=(0,ar.default)();if(e?.name)return e.name}catch{}return"npm"}async function Ye(e){let t=[],r=await Dt(e,e.getRepoRootDir());if(r){let n=await cr(r,e);t.push(...n)}return t}async function pr(e){let t=await Dt(e,e.getRepoRootDir());return t?.scripts?.dev?t.scripts.dev.includes("--turbopack"):!1}async function cr(e,t){let r=[];if(e&&typeof e=="object"){let n=new Set(Object.keys({...e.dependencies,...e.devDependencies}));for(let o of Oi)if(n.has(o)&&!r.some(i=>i.name===o)){let i={name:o};ur.has(o)&&(i.version=await ur.get(o)(t)),r.push(i)}}return r}function sn(e){let t=parseInt(e);return Number.isNaN(t)?void 0:t}var ur=new Map([["next",async e=>{if(!e.spawnSync)return;let t=sr(),r=t==="npm"?"npx":t,{stdout:n}=e.spawnSync(r,["next","-v"],{encoding:"utf8"});if(!n)return;let o=n.match(/(Next.js v)([\d.]+)/g);if(!o)return;let i=o[0].split("Next.js v")[1],[a,s,u]=i.split(".");return{major:sn(a),minor:sn(s),patch:sn(u)}}]]),Oi=["@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 me(e){let t=lr(e),r=await e.readFile(t);return typeof r=="string"?JSON.parse(r):{}}async function fe(e,t){t=typeof t=="object"&&t!=null?t:{};let r=lr(e);await e.writeFile(r,JSON.stringify(t??{},null,2))}function lr(e){let t=e.getAppRootDir();return e.join(t,"node_modules",".builder","builder-cache.json")}async function Fe(e,t,r){let n={envKey:r,envValue:null,file:""};for(let o of t){let i=e.join(e.getAppRootDir(),o),a=await Li(e,i);if(a){let s=a[r];if(typeof s=="string"&&s.length>0&&s!=="YOUR_API_KEY")return n.envValue=s,n.file=i,n}}return n.file=e.join(e.getAppRootDir(),t[t.length-1]),n}async function Li(e,t){let r=await e.readFile(t);return typeof r=="string"?mr(r):null}function mr(e){let t={},r=e.replace(/\r\n?/gm,`
3
3
  `),n;for(;(n=_i.exec(r))!=null;){let o=n[1],i=n[2]||"";i=i.trim();let a=i[0];i=i.replace(/^(['"`])([\s\S]*)\1$/gm,"$2"),a==='"'&&(i=i.replace(/\\n/g,`
4
4
  `),i=i.replace(/\\r/g,"\r")),t[o]=i}return t}var _i=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm;async function Pe(e,t,r,n){let o="# https://www.builder.io/c/docs/using-your-api-key",i=await e.readFile(t);try{if(i)if(i.includes(r))if(i.includes(n))e.debug(`"${r}" with "${n}" already set in ${t}`);else return e.debug(`Replace "${r}" in ${t}`),i=i.replace(new RegExp(`${r}=.*`),`${r}=${n}`),await e.writeFile(t,i),"update";else return e.debug(`Append "${r}" to ${t}`),i+=`
5
5