builder.io 1.11.33 → 1.11.35
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 +316 -311
- package/cli/index.cjs.map +4 -4
- package/core/index.cjs +1 -1
- package/core/index.mjs +1 -1
- package/node/index.cjs +11 -11
- package/node/index.mjs +11 -11
- package/package.json +1 -1
- package/server/index.cjs +69 -69
- package/server/index.mjs +57 -57
- package/types/cli/launch/helpers.d.ts +14 -0
- package/types/cli/launch/helpers.test.d.ts +1 -0
- package/types/cli/sync-utils.d.ts +2 -1
- package/types/tsconfig.tsbuildinfo +1 -1
package/core/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var bi=Object.create;var gt=Object.defineProperty;var Ii=Object.getOwnPropertyDescriptor;var Ri=Object.getOwnPropertyNames;var Ni=Object.getPrototypeOf,Bi=Object.prototype.hasOwnProperty;var Oi=(e,t,r)=>t in e?gt(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),ki=(e,t)=>{for(var r in t)gt(e,r,{get:t[r],enumerable:!0})},er=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Ri(t))!Bi.call(e,o)&&o!==r&>(e,o,{get:()=>t[o],enumerable:!(n=Ii(t,o))||n.enumerable});return e};var tr=(e,t,r)=>(r=e!=null?bi(Ni(e)):{},er(t||!e||!e.__esModule?gt(r,"default",{value:e,enumerable:!0}):r,e)),Li=e=>er(gt({},"__esModule",{value:!0}),e);var nr=(e,t,r)=>Oi(e,typeof t!="symbol"?t+"":t,r);var ar=Le((yp,ir)=>{"use strict";ir.exports=function(){if(process.env.npm_config_user_agent)return Vi(process.env.npm_config_user_agent)};function Vi(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 Ln=Le(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.throwUnsupportedData=Je.throwUnknownDataType=Je.getType=void 0;function Qo(e){return Object.prototype.toString.call(e)}Je.getType=Qo;function Vu(e){throw new TypeError("unsupported data type: "+Qo(e))}Je.throwUnknownDataType=Vu;function $u(e){throw new TypeError("unsupported data type: "+e)}Je.throwUnsupportedData=$u});var Kn=Le(H=>{"use strict";Object.defineProperty(H,"__esModule",{value:!0});H.s_to_num=H.int_str_to_s=H.num_to_s=H.big_int_to_s=H.int_to_s=H.s_to_big_int=H.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 ft=Ke.length,jn={};for(let e=0;e<ft;e++){let t=Ke[e];jn[t]=e}function Vn(e){let t=0,r=1;for(let n=e.length-1;n>=0;n--){let o=e[n],i=jn[o];i*=r,t+=i,r*=ft}return t}H.s_to_int=Vn;function Yo(e){let t=BigInt(0),r=BigInt(1),n=BigInt(ft);for(let o=e.length-1;o>=0;o--){let i=e[o],a=BigInt(jn[i]);a*=r,t+=a,r*=n}return t}H.s_to_big_int=Yo;function $n(e){if(e===0)return Ke[0];let t=[];for(;e!==0;){let r=e%ft,n=Ke[r];t.push(n),e-=r,e/=ft}return t.reverse().join("")}H.int_to_s=$n;function Go(e){let t=BigInt(0),r=BigInt(ft);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("")}H.big_int_to_s=Go;function Ho(e){return e.split("").reverse().join("")}function Xo(e){if(e<0)return"-"+Xo(-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 $n(e);let n;r&&([r,n]=r.split("e")),t=Xt(t),r=Ho(r),r=Xt(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=Xt(n),o+=n}return o}H.num_to_s=Xo;function Xt(e){let t=+e;return t.toString()===e&&t+1!==t&&t-1!==t?$n(t):":"+Go(BigInt(e))}H.int_str_to_s=Xt;function _n(e){return e[0]===":"?Yo(e.substring(1)).toString():Vn(e).toString()}function Zo(e){if(e[0]==="-")return-Zo(e.substr(1));let[t,r,n]=e.split(".");if(!r)return Vn(t);t=_n(t),r=_n(r),r=Ho(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}H.s_to_num=Zo});var Un=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 Mn=Kn();function Ku(e){return"n|"+(0,Mn.num_to_s)(e)}X.encodeNum=Ku;function Mu(e){return e=e.replace("n|",""),(0,Mn.s_to_num)(e)}X.decodeNum=Mu;function Uu(e){return typeof e=="number"?e:(0,Mn.s_to_int)(e)}X.decodeKey=Uu;function zu(e){return e?"b|T":"b|F"}X.encodeBool=zu;function qu(e){switch(e){case"b|T":return!0;case"b|F":return!1}return!!e}X.decodeBool=qu;function Ju(e){switch(e[0]+e[1]){case"b|":case"o|":case"n|":case"a|":case"s|":e="s|"+e}return e}X.encodeStr=Ju;function Wu(e){return e[0]+e[1]==="s|"?e.substr(2):e}X.decodeStr=Wu});var zn=Le(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.config=void 0;Zt.config={sort_key:!1,error_on_nan:!1,error_on_infinite:!1}});var Qn=Le(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.addValue=xe.makeInMemoryMemory=xe.makeInMemoryCache=xe.makeInMemoryStore=xe.memToValues=void 0;var Wn=zn(),qn=Ln(),Jn=Un(),Qu=Kn();function Yu(e){return e.store.toArray()}xe.memToValues=Yu;function ei(){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=ei;function ti(){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=ti;function Gu(){return{store:ei(),cache:ti(),keyCount:0}}xe.makeInMemoryMemory=Gu;function tt(e,t){if(e.cache.hasValue(t))return e.cache.getValue(t);let r=e.keyCount++,n=(0,Qu.num_to_s)(r);return e.store.add(t),e.cache.setValue(t,n),n}function Hu(e,t){Wn.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 tt(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|"),tt(e,n)}else{let n=Object.keys(t);if(n.length===0)return tt(e,"o|");let o="o",i=Hu(e,n);o+="|"+i;for(let a of n){let s=t[a],u=Bt(e,s,t);o+="|"+u}return tt(e,o)}case"boolean":return tt(e,(0,Jn.encodeBool)(t));case"number":return Number.isNaN(t)?(Wn.config.error_on_nan&&(0,qn.throwUnsupportedData)("[number NaN]"),""):Number.POSITIVE_INFINITY===t||Number.NEGATIVE_INFINITY===t?(Wn.config.error_on_infinite&&(0,qn.throwUnsupportedData)("[number Infinity]"),""):tt(e,(0,Jn.encodeNum)(t));case"string":return tt(e,(0,Jn.encodeStr)(t))}return(0,qn.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 Xu=Ln(),en=Un(),Yn=Qn();function Zu(e){let t=(0,Yn.makeInMemoryMemory)(),r=(0,Yn.addValue)(t,e,void 0);return[(0,Yn.memToValues)(t),r]}We.compress=Zu;function ep(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 tp(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,en.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,en.decodeBool)(n);case"o|":return ep(e,n);case"n|":return(0,en.decodeNum)(n);case"a|":return tp(e,n);default:return(0,en.decodeStr)(n)}}return(0,Xu.throwUnknownDataType)(n)}We.decode=Ot;function np(e){let[t,r]=e;return Ot(t,r)}We.decompress=np});var ri=Le(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.trimUndefinedRecursively=dt.trimUndefined=void 0;function rp(e){for(let t in e)e[t]===void 0&&delete e[t]}dt.trimUndefined=rp;function op(e){ni(e,new Set)}dt.trimUndefinedRecursively=op;function ni(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)&&ni(n,t)}}});var ai=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 oi=Gn();Object.defineProperty(Z,"compress",{enumerable:!0,get:function(){return oi.compress}});Object.defineProperty(Z,"decompress",{enumerable:!0,get:function(){return oi.decompress}});var ip=Gn();Object.defineProperty(Z,"decode",{enumerable:!0,get:function(){return ip.decode}});var ap=Qn();Object.defineProperty(Z,"addValue",{enumerable:!0,get:function(){return ap.addValue}});var ii=ri();Object.defineProperty(Z,"trimUndefined",{enumerable:!0,get:function(){return ii.trimUndefined}});Object.defineProperty(Z,"trimUndefinedRecursively",{enumerable:!0,get:function(){return ii.trimUndefinedRecursively}});var sp=zn();Object.defineProperty(Z,"config",{enumerable:!0,get:function(){return sp.config}})});var Sp={};ki(Sp,{createDevTools:()=>ci,createDevToolsSys:()=>mi,detectFrameworks:()=>Me,detectFrameworksFromPackageJson:()=>an,ensureConfigPlugin:()=>wi,findBuildToolConfig:()=>Zn,getClientScript:()=>Ti,parseDotEnvContent:()=>sn,version:()=>Lt});module.exports=Li(Sp);var _i="1.11.33",rr=process.env.OVERRIDE_VERSION??_i;function ne(e){let t=e.join(e.getAppRootDir(),"tsconfig.json");return e.exists(t)}var ji=["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(ji.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 or(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 ur=tr(ar(),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 sr(o==="index"?e.basename(e.dirname(t)):o)}function sr(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 O(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 nt(e){return typeof e=="boolean"}function re(e){return typeof e=="string"}function rt(e){return typeof e=="string"?/^[A-Z][A-Za-z0-9]*$/.test(e):!1}function ue(e){return JSON.parse(JSON.stringify(e))}function _t(e,t,r){for(let n of t)if(e.dirname(r).includes(n))return!0;return!1}function pr(){try{let e=(0,ur.default)();if(e?.name)return e.name}catch{}return"npm"}async function Me(e){let t=[],r=await Dt(e,e.getRepoRootDir());if(r){let n=await an(r,e);t.push(...n)}return t}async function lr(e){let t=await Dt(e,e.getRepoRootDir());return t?.scripts?.dev?t.scripts.dev.includes("--turbopack"):!1}async function an(e,t){let r=[];if(e&&typeof e=="object"){let n=new Set(Object.keys({...e.dependencies,...e.devDependencies}));for(let o of $i)if(n.has(o)&&!r.some(i=>i.name===o)){let i={name:o};cr.has(o)&&(i.version=await cr.get(o)(t)),r.push(i)}}return r}function on(e){let t=parseInt(e);return Number.isNaN(t)?void 0:t}var cr=new Map([["next",async e=>{if(!e.spawnSync)return;let t=pr(),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:on(a),minor:on(s),patch:on(u)}}]]),$i=["@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=mr(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=mr(e);await e.writeFile(r,JSON.stringify(t??{},null,2))}function mr(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 Ki(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 Ki(e,t){let r=await e.readFile(t);return typeof r=="string"?sn(r):null}function sn(e){let t={},r=e.replace(/\r\n?/gm,`
|
|
1
|
+
"use strict";var bi=Object.create;var gt=Object.defineProperty;var Ii=Object.getOwnPropertyDescriptor;var Ri=Object.getOwnPropertyNames;var Ni=Object.getPrototypeOf,Bi=Object.prototype.hasOwnProperty;var Oi=(e,t,r)=>t in e?gt(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),ki=(e,t)=>{for(var r in t)gt(e,r,{get:t[r],enumerable:!0})},er=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Ri(t))!Bi.call(e,o)&&o!==r&>(e,o,{get:()=>t[o],enumerable:!(n=Ii(t,o))||n.enumerable});return e};var tr=(e,t,r)=>(r=e!=null?bi(Ni(e)):{},er(t||!e||!e.__esModule?gt(r,"default",{value:e,enumerable:!0}):r,e)),Li=e=>er(gt({},"__esModule",{value:!0}),e);var nr=(e,t,r)=>Oi(e,typeof t!="symbol"?t+"":t,r);var ar=Le((yp,ir)=>{"use strict";ir.exports=function(){if(process.env.npm_config_user_agent)return Vi(process.env.npm_config_user_agent)};function Vi(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 Ln=Le(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.throwUnsupportedData=Je.throwUnknownDataType=Je.getType=void 0;function Qo(e){return Object.prototype.toString.call(e)}Je.getType=Qo;function Vu(e){throw new TypeError("unsupported data type: "+Qo(e))}Je.throwUnknownDataType=Vu;function $u(e){throw new TypeError("unsupported data type: "+e)}Je.throwUnsupportedData=$u});var Kn=Le(H=>{"use strict";Object.defineProperty(H,"__esModule",{value:!0});H.s_to_num=H.int_str_to_s=H.num_to_s=H.big_int_to_s=H.int_to_s=H.s_to_big_int=H.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 ft=Ke.length,jn={};for(let e=0;e<ft;e++){let t=Ke[e];jn[t]=e}function Vn(e){let t=0,r=1;for(let n=e.length-1;n>=0;n--){let o=e[n],i=jn[o];i*=r,t+=i,r*=ft}return t}H.s_to_int=Vn;function Yo(e){let t=BigInt(0),r=BigInt(1),n=BigInt(ft);for(let o=e.length-1;o>=0;o--){let i=e[o],a=BigInt(jn[i]);a*=r,t+=a,r*=n}return t}H.s_to_big_int=Yo;function $n(e){if(e===0)return Ke[0];let t=[];for(;e!==0;){let r=e%ft,n=Ke[r];t.push(n),e-=r,e/=ft}return t.reverse().join("")}H.int_to_s=$n;function Go(e){let t=BigInt(0),r=BigInt(ft);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("")}H.big_int_to_s=Go;function Ho(e){return e.split("").reverse().join("")}function Xo(e){if(e<0)return"-"+Xo(-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 $n(e);let n;r&&([r,n]=r.split("e")),t=Xt(t),r=Ho(r),r=Xt(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=Xt(n),o+=n}return o}H.num_to_s=Xo;function Xt(e){let t=+e;return t.toString()===e&&t+1!==t&&t-1!==t?$n(t):":"+Go(BigInt(e))}H.int_str_to_s=Xt;function _n(e){return e[0]===":"?Yo(e.substring(1)).toString():Vn(e).toString()}function Zo(e){if(e[0]==="-")return-Zo(e.substr(1));let[t,r,n]=e.split(".");if(!r)return Vn(t);t=_n(t),r=_n(r),r=Ho(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}H.s_to_num=Zo});var Un=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 Mn=Kn();function Ku(e){return"n|"+(0,Mn.num_to_s)(e)}X.encodeNum=Ku;function Mu(e){return e=e.replace("n|",""),(0,Mn.s_to_num)(e)}X.decodeNum=Mu;function Uu(e){return typeof e=="number"?e:(0,Mn.s_to_int)(e)}X.decodeKey=Uu;function zu(e){return e?"b|T":"b|F"}X.encodeBool=zu;function qu(e){switch(e){case"b|T":return!0;case"b|F":return!1}return!!e}X.decodeBool=qu;function Ju(e){switch(e[0]+e[1]){case"b|":case"o|":case"n|":case"a|":case"s|":e="s|"+e}return e}X.encodeStr=Ju;function Wu(e){return e[0]+e[1]==="s|"?e.substr(2):e}X.decodeStr=Wu});var zn=Le(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.config=void 0;Zt.config={sort_key:!1,error_on_nan:!1,error_on_infinite:!1}});var Qn=Le(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.addValue=xe.makeInMemoryMemory=xe.makeInMemoryCache=xe.makeInMemoryStore=xe.memToValues=void 0;var Wn=zn(),qn=Ln(),Jn=Un(),Qu=Kn();function Yu(e){return e.store.toArray()}xe.memToValues=Yu;function ei(){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=ei;function ti(){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=ti;function Gu(){return{store:ei(),cache:ti(),keyCount:0}}xe.makeInMemoryMemory=Gu;function tt(e,t){if(e.cache.hasValue(t))return e.cache.getValue(t);let r=e.keyCount++,n=(0,Qu.num_to_s)(r);return e.store.add(t),e.cache.setValue(t,n),n}function Hu(e,t){Wn.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 tt(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|"),tt(e,n)}else{let n=Object.keys(t);if(n.length===0)return tt(e,"o|");let o="o",i=Hu(e,n);o+="|"+i;for(let a of n){let s=t[a],u=Bt(e,s,t);o+="|"+u}return tt(e,o)}case"boolean":return tt(e,(0,Jn.encodeBool)(t));case"number":return Number.isNaN(t)?(Wn.config.error_on_nan&&(0,qn.throwUnsupportedData)("[number NaN]"),""):Number.POSITIVE_INFINITY===t||Number.NEGATIVE_INFINITY===t?(Wn.config.error_on_infinite&&(0,qn.throwUnsupportedData)("[number Infinity]"),""):tt(e,(0,Jn.encodeNum)(t));case"string":return tt(e,(0,Jn.encodeStr)(t))}return(0,qn.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 Xu=Ln(),en=Un(),Yn=Qn();function Zu(e){let t=(0,Yn.makeInMemoryMemory)(),r=(0,Yn.addValue)(t,e,void 0);return[(0,Yn.memToValues)(t),r]}We.compress=Zu;function ep(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 tp(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,en.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,en.decodeBool)(n);case"o|":return ep(e,n);case"n|":return(0,en.decodeNum)(n);case"a|":return tp(e,n);default:return(0,en.decodeStr)(n)}}return(0,Xu.throwUnknownDataType)(n)}We.decode=Ot;function np(e){let[t,r]=e;return Ot(t,r)}We.decompress=np});var ri=Le(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.trimUndefinedRecursively=dt.trimUndefined=void 0;function rp(e){for(let t in e)e[t]===void 0&&delete e[t]}dt.trimUndefined=rp;function op(e){ni(e,new Set)}dt.trimUndefinedRecursively=op;function ni(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)&&ni(n,t)}}});var ai=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 oi=Gn();Object.defineProperty(Z,"compress",{enumerable:!0,get:function(){return oi.compress}});Object.defineProperty(Z,"decompress",{enumerable:!0,get:function(){return oi.decompress}});var ip=Gn();Object.defineProperty(Z,"decode",{enumerable:!0,get:function(){return ip.decode}});var ap=Qn();Object.defineProperty(Z,"addValue",{enumerable:!0,get:function(){return ap.addValue}});var ii=ri();Object.defineProperty(Z,"trimUndefined",{enumerable:!0,get:function(){return ii.trimUndefined}});Object.defineProperty(Z,"trimUndefinedRecursively",{enumerable:!0,get:function(){return ii.trimUndefinedRecursively}});var sp=zn();Object.defineProperty(Z,"config",{enumerable:!0,get:function(){return sp.config}})});var Sp={};ki(Sp,{createDevTools:()=>ci,createDevToolsSys:()=>mi,detectFrameworks:()=>Me,detectFrameworksFromPackageJson:()=>an,ensureConfigPlugin:()=>wi,findBuildToolConfig:()=>Zn,getClientScript:()=>Ti,parseDotEnvContent:()=>sn,version:()=>Lt});module.exports=Li(Sp);var _i="1.11.35",rr=process.env.OVERRIDE_VERSION??_i;function ne(e){let t=e.join(e.getAppRootDir(),"tsconfig.json");return e.exists(t)}var ji=["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(ji.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 or(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 ur=tr(ar(),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 sr(o==="index"?e.basename(e.dirname(t)):o)}function sr(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 O(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 nt(e){return typeof e=="boolean"}function re(e){return typeof e=="string"}function rt(e){return typeof e=="string"?/^[A-Z][A-Za-z0-9]*$/.test(e):!1}function ue(e){return JSON.parse(JSON.stringify(e))}function _t(e,t,r){for(let n of t)if(e.dirname(r).includes(n))return!0;return!1}function pr(){try{let e=(0,ur.default)();if(e?.name)return e.name}catch{}return"npm"}async function Me(e){let t=[],r=await Dt(e,e.getRepoRootDir());if(r){let n=await an(r,e);t.push(...n)}return t}async function lr(e){let t=await Dt(e,e.getRepoRootDir());return t?.scripts?.dev?t.scripts.dev.includes("--turbopack"):!1}async function an(e,t){let r=[];if(e&&typeof e=="object"){let n=new Set(Object.keys({...e.dependencies,...e.devDependencies}));for(let o of $i)if(n.has(o)&&!r.some(i=>i.name===o)){let i={name:o};cr.has(o)&&(i.version=await cr.get(o)(t)),r.push(i)}}return r}function on(e){let t=parseInt(e);return Number.isNaN(t)?void 0:t}var cr=new Map([["next",async e=>{if(!e.spawnSync)return;let t=pr(),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:on(a),minor:on(s),patch:on(u)}}]]),$i=["@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=mr(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=mr(e);await e.writeFile(r,JSON.stringify(t??{},null,2))}function mr(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 Ki(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 Ki(e,t){let r=await e.readFile(t);return typeof r=="string"?sn(r):null}function sn(e){let t={},r=e.replace(/\r\n?/gm,`
|
|
2
2
|
`),n;for(;(n=Mi.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 Mi=/(?:^|^)\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 Pi=Object.create;var rn=Object.defineProperty;var yi=Object.getOwnPropertyDescriptor;var wi=Object.getOwnPropertyNames;var vi=Object.getPrototypeOf,Ti=Object.prototype.hasOwnProperty;var bi=(e,t,r)=>t in e?rn(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 Ii=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of wi(t))!Ti.call(e,o)&&o!==r&&rn(e,o,{get:()=>t[o],enumerable:!(n=yi(t,o))||n.enumerable});return e};var Hn=(e,t,r)=>(r=e!=null?Pi(vi(e)):{},Ii(t||!e||!e.__esModule?rn(r,"default",{value:e,enumerable:!0}):r,e));var Xn=(e,t,r)=>bi(e,typeof t!="symbol"?t+"":t,r);var nr=Le((Ap,tr)=>{"use strict";tr.exports=function(){if(process.env.npm_config_user_agent)return Bi(process.env.npm_config_user_agent)};function Bi(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 On=Le(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});qe.throwUnsupportedData=qe.throwUnknownDataType=qe.getType=void 0;function Jo(e){return Object.prototype.toString.call(e)}qe.getType=Jo;function Bu(e){throw new TypeError("unsupported data type: "+Jo(e))}qe.throwUnknownDataType=Bu;function Ou(e){throw new TypeError("unsupported data type: "+e)}qe.throwUnsupportedData=Ou});var Vn=Le(H=>{"use strict";Object.defineProperty(H,"__esModule",{value:!0});H.s_to_num=H.int_str_to_s=H.num_to_s=H.big_int_to_s=H.int_to_s=H.s_to_big_int=H.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 ft=Ke.length,Ln={};for(let e=0;e<ft;e++){let t=Ke[e];Ln[t]=e}function _n(e){let t=0,r=1;for(let n=e.length-1;n>=0;n--){let o=e[n],i=Ln[o];i*=r,t+=i,r*=ft}return t}H.s_to_int=_n;function Wo(e){let t=BigInt(0),r=BigInt(1),n=BigInt(ft);for(let o=e.length-1;o>=0;o--){let i=e[o],a=BigInt(Ln[i]);a*=r,t+=a,r*=n}return t}H.s_to_big_int=Wo;function jn(e){if(e===0)return Ke[0];let t=[];for(;e!==0;){let r=e%ft,n=Ke[r];t.push(n),e-=r,e/=ft}return t.reverse().join("")}H.int_to_s=jn;function Qo(e){let t=BigInt(0),r=BigInt(ft);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("")}H.big_int_to_s=Qo;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 jn(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}H.num_to_s=Go;function Gt(e){let t=+e;return t.toString()===e&&t+1!==t&&t-1!==t?jn(t):":"+Qo(BigInt(e))}H.int_str_to_s=Gt;function kn(e){return e[0]===":"?Wo(e.substring(1)).toString():_n(e).toString()}function Ho(e){if(e[0]==="-")return-Ho(e.substr(1));let[t,r,n]=e.split(".");if(!r)return _n(t);t=kn(t),r=kn(r),r=Yo(r);let o=t+"."+r;if(n){o+="e";let i=!1;n[0]==="-"&&(i=!0,n=n.slice(1)),n=kn(n),o+=i?-n:+n}return+o}H.s_to_num=Ho});var Kn=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 $n=Vn();function ku(e){return"n|"+(0,$n.num_to_s)(e)}X.encodeNum=ku;function Lu(e){return e=e.replace("n|",""),(0,$n.s_to_num)(e)}X.decodeNum=Lu;function _u(e){return typeof e=="number"?e:(0,$n.s_to_int)(e)}X.decodeKey=_u;function ju(e){return e?"b|T":"b|F"}X.encodeBool=ju;function Vu(e){switch(e){case"b|T":return!0;case"b|F":return!1}return!!e}X.decodeBool=Vu;function $u(e){switch(e[0]+e[1]){case"b|":case"o|":case"n|":case"a|":case"s|":e="s|"+e}return e}X.encodeStr=$u;function Ku(e){return e[0]+e[1]==="s|"?e.substr(2):e}X.decodeStr=Ku});var Mn=Le(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.config=void 0;Ht.config={sort_key:!1,error_on_nan:!1,error_on_infinite:!1}});var Jn=Le(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.addValue=xe.makeInMemoryMemory=xe.makeInMemoryCache=xe.makeInMemoryStore=xe.memToValues=void 0;var qn=Mn(),Un=On(),zn=Kn(),Mu=Vn();function Uu(e){return e.store.toArray()}xe.memToValues=Uu;function Xo(){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=Xo;function Zo(){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=Zo;function zu(){return{store:Xo(),cache:Zo(),keyCount:0}}xe.makeInMemoryMemory=zu;function tt(e,t){if(e.cache.hasValue(t))return e.cache.getValue(t);let r=e.keyCount++,n=(0,Mu.num_to_s)(r);return e.store.add(t),e.cache.setValue(t,n),n}function qu(e,t){qn.config.sort_key&&t.sort();let r=t.join(",");if(e.cache.hasSchema(r))return e.cache.getSchema(r);let n=Nt(e,t,void 0);return e.cache.setSchema(r,n),n}function Nt(e,t,r){if(t===null)return"";switch(typeof t){case"undefined":if(Array.isArray(r))return Nt(e,null,r);break;case"object":if(t===null)return tt(e,null);if(Array.isArray(t)){let n="a";for(let o=0;o<t.length;o++){let i=t[o],a=i===null?"_":Nt(e,i,t);n+="|"+a}return n==="a"&&(n="a|"),tt(e,n)}else{let n=Object.keys(t);if(n.length===0)return tt(e,"o|");let o="o",i=qu(e,n);o+="|"+i;for(let a of n){let s=t[a],u=Nt(e,s,t);o+="|"+u}return tt(e,o)}case"boolean":return tt(e,(0,zn.encodeBool)(t));case"number":return Number.isNaN(t)?(qn.config.error_on_nan&&(0,Un.throwUnsupportedData)("[number NaN]"),""):Number.POSITIVE_INFINITY===t||Number.NEGATIVE_INFINITY===t?(qn.config.error_on_infinite&&(0,Un.throwUnsupportedData)("[number Infinity]"),""):tt(e,(0,zn.encodeNum)(t));case"string":return tt(e,(0,zn.encodeStr)(t))}return(0,Un.throwUnknownDataType)(t)}xe.addValue=Nt});var Qn=Le(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.decompress=Je.decode=Je.compress=void 0;var Ju=On(),Xt=Kn(),Wn=Jn();function Wu(e){let t=(0,Wn.makeInMemoryMemory)(),r=(0,Wn.addValue)(t,e,void 0);return[(0,Wn.memToValues)(t),r]}Je.compress=Wu;function Qu(e,t){if(t==="o|")return{};let r={},n=t.split("|"),o=n[1],i=Bt(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=Bt(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=Bt(e,a),o[i]=a}return o}function Bt(e,t){if(t===""||t==="_")return null;let r=(0,Xt.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,Xt.decodeBool)(n);case"o|":return Qu(e,n);case"n|":return(0,Xt.decodeNum)(n);case"a|":return Yu(e,n);default:return(0,Xt.decodeStr)(n)}}return(0,Ju.throwUnknownDataType)(n)}Je.decode=Bt;function Gu(e){let[t,r]=e;return Bt(t,r)}Je.decompress=Gu});var ti=Le(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.trimUndefinedRecursively=dt.trimUndefined=void 0;function Hu(e){for(let t in e)e[t]===void 0&&delete e[t]}dt.trimUndefined=Hu;function Xu(e){ei(e,new Set)}dt.trimUndefinedRecursively=Xu;function ei(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)&&ei(n,t)}}});var oi=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 ni=Qn();Object.defineProperty(Z,"compress",{enumerable:!0,get:function(){return ni.compress}});Object.defineProperty(Z,"decompress",{enumerable:!0,get:function(){return ni.decompress}});var Zu=Qn();Object.defineProperty(Z,"decode",{enumerable:!0,get:function(){return Zu.decode}});var ep=Jn();Object.defineProperty(Z,"addValue",{enumerable:!0,get:function(){return ep.addValue}});var ri=ti();Object.defineProperty(Z,"trimUndefined",{enumerable:!0,get:function(){return ri.trimUndefined}});Object.defineProperty(Z,"trimUndefinedRecursively",{enumerable:!0,get:function(){return ri.trimUndefinedRecursively}});var tp=Mn();Object.defineProperty(Z,"config",{enumerable:!0,get:function(){return tp.config}})});var Ri="1.11.33",Zn=process.env.OVERRIDE_VERSION??Ri;function ne(e){let t=e.join(e.getAppRootDir(),"tsconfig.json");return e.exists(t)}var Ni=["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(Ni.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 gt(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 er(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 Dt(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 Dt(e,a,r);if(u)return u}}))).find(i=>typeof i=="string")}var or=Hn(nr(),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 Qe(e,t){let r=e.extname(t),n=e.basename(t,r).split(/[\/\\]/),o=n[n.length-1];return rr(o==="index"?e.basename(e.dirname(t)):o)}function rr(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 O(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 xt(e){return typeof e=="number"}function nt(e){return typeof e=="boolean"}function re(e){return typeof e=="string"}function rt(e){return typeof e=="string"?/^[A-Z][A-Za-z0-9]*$/.test(e):!1}function ue(e){return JSON.parse(JSON.stringify(e))}function kt(e,t,r){for(let n of t)if(e.dirname(r).includes(n))return!0;return!1}function ir(){try{let e=(0,or.default)();if(e?.name)return e.name}catch{}return"npm"}async function Ye(e){let t=[],r=await gt(e,e.getRepoRootDir());if(r){let n=await ur(r,e);t.push(...n)}return t}async function sr(e){let t=await gt(e,e.getRepoRootDir());return t?.scripts?.dev?t.scripts.dev.includes("--turbopack"):!1}async function ur(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};ar.has(o)&&(i.version=await ar.get(o)(t)),r.push(i)}}return r}function on(e){let t=parseInt(e);return Number.isNaN(t)?void 0:t}var ar=new Map([["next",async e=>{if(!e.spawnSync)return;let t=ir(),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:on(a),minor:on(s),patch:on(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=pr(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=pr(e);await e.writeFile(r,JSON.stringify(t??{},null,2))}function pr(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 ki(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 ki(e,t){let r=await e.readFile(t);return typeof r=="string"?cr(r):null}function cr(e){let t={},r=e.replace(/\r\n?/gm,`
|
|
2
|
+
var Pi=Object.create;var rn=Object.defineProperty;var yi=Object.getOwnPropertyDescriptor;var wi=Object.getOwnPropertyNames;var vi=Object.getPrototypeOf,Ti=Object.prototype.hasOwnProperty;var bi=(e,t,r)=>t in e?rn(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 Ii=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of wi(t))!Ti.call(e,o)&&o!==r&&rn(e,o,{get:()=>t[o],enumerable:!(n=yi(t,o))||n.enumerable});return e};var Hn=(e,t,r)=>(r=e!=null?Pi(vi(e)):{},Ii(t||!e||!e.__esModule?rn(r,"default",{value:e,enumerable:!0}):r,e));var Xn=(e,t,r)=>bi(e,typeof t!="symbol"?t+"":t,r);var nr=Le((Ap,tr)=>{"use strict";tr.exports=function(){if(process.env.npm_config_user_agent)return Bi(process.env.npm_config_user_agent)};function Bi(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 On=Le(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});qe.throwUnsupportedData=qe.throwUnknownDataType=qe.getType=void 0;function Jo(e){return Object.prototype.toString.call(e)}qe.getType=Jo;function Bu(e){throw new TypeError("unsupported data type: "+Jo(e))}qe.throwUnknownDataType=Bu;function Ou(e){throw new TypeError("unsupported data type: "+e)}qe.throwUnsupportedData=Ou});var Vn=Le(H=>{"use strict";Object.defineProperty(H,"__esModule",{value:!0});H.s_to_num=H.int_str_to_s=H.num_to_s=H.big_int_to_s=H.int_to_s=H.s_to_big_int=H.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 ft=Ke.length,Ln={};for(let e=0;e<ft;e++){let t=Ke[e];Ln[t]=e}function _n(e){let t=0,r=1;for(let n=e.length-1;n>=0;n--){let o=e[n],i=Ln[o];i*=r,t+=i,r*=ft}return t}H.s_to_int=_n;function Wo(e){let t=BigInt(0),r=BigInt(1),n=BigInt(ft);for(let o=e.length-1;o>=0;o--){let i=e[o],a=BigInt(Ln[i]);a*=r,t+=a,r*=n}return t}H.s_to_big_int=Wo;function jn(e){if(e===0)return Ke[0];let t=[];for(;e!==0;){let r=e%ft,n=Ke[r];t.push(n),e-=r,e/=ft}return t.reverse().join("")}H.int_to_s=jn;function Qo(e){let t=BigInt(0),r=BigInt(ft);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("")}H.big_int_to_s=Qo;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 jn(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}H.num_to_s=Go;function Gt(e){let t=+e;return t.toString()===e&&t+1!==t&&t-1!==t?jn(t):":"+Qo(BigInt(e))}H.int_str_to_s=Gt;function kn(e){return e[0]===":"?Wo(e.substring(1)).toString():_n(e).toString()}function Ho(e){if(e[0]==="-")return-Ho(e.substr(1));let[t,r,n]=e.split(".");if(!r)return _n(t);t=kn(t),r=kn(r),r=Yo(r);let o=t+"."+r;if(n){o+="e";let i=!1;n[0]==="-"&&(i=!0,n=n.slice(1)),n=kn(n),o+=i?-n:+n}return+o}H.s_to_num=Ho});var Kn=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 $n=Vn();function ku(e){return"n|"+(0,$n.num_to_s)(e)}X.encodeNum=ku;function Lu(e){return e=e.replace("n|",""),(0,$n.s_to_num)(e)}X.decodeNum=Lu;function _u(e){return typeof e=="number"?e:(0,$n.s_to_int)(e)}X.decodeKey=_u;function ju(e){return e?"b|T":"b|F"}X.encodeBool=ju;function Vu(e){switch(e){case"b|T":return!0;case"b|F":return!1}return!!e}X.decodeBool=Vu;function $u(e){switch(e[0]+e[1]){case"b|":case"o|":case"n|":case"a|":case"s|":e="s|"+e}return e}X.encodeStr=$u;function Ku(e){return e[0]+e[1]==="s|"?e.substr(2):e}X.decodeStr=Ku});var Mn=Le(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.config=void 0;Ht.config={sort_key:!1,error_on_nan:!1,error_on_infinite:!1}});var Jn=Le(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.addValue=xe.makeInMemoryMemory=xe.makeInMemoryCache=xe.makeInMemoryStore=xe.memToValues=void 0;var qn=Mn(),Un=On(),zn=Kn(),Mu=Vn();function Uu(e){return e.store.toArray()}xe.memToValues=Uu;function Xo(){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=Xo;function Zo(){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=Zo;function zu(){return{store:Xo(),cache:Zo(),keyCount:0}}xe.makeInMemoryMemory=zu;function tt(e,t){if(e.cache.hasValue(t))return e.cache.getValue(t);let r=e.keyCount++,n=(0,Mu.num_to_s)(r);return e.store.add(t),e.cache.setValue(t,n),n}function qu(e,t){qn.config.sort_key&&t.sort();let r=t.join(",");if(e.cache.hasSchema(r))return e.cache.getSchema(r);let n=Nt(e,t,void 0);return e.cache.setSchema(r,n),n}function Nt(e,t,r){if(t===null)return"";switch(typeof t){case"undefined":if(Array.isArray(r))return Nt(e,null,r);break;case"object":if(t===null)return tt(e,null);if(Array.isArray(t)){let n="a";for(let o=0;o<t.length;o++){let i=t[o],a=i===null?"_":Nt(e,i,t);n+="|"+a}return n==="a"&&(n="a|"),tt(e,n)}else{let n=Object.keys(t);if(n.length===0)return tt(e,"o|");let o="o",i=qu(e,n);o+="|"+i;for(let a of n){let s=t[a],u=Nt(e,s,t);o+="|"+u}return tt(e,o)}case"boolean":return tt(e,(0,zn.encodeBool)(t));case"number":return Number.isNaN(t)?(qn.config.error_on_nan&&(0,Un.throwUnsupportedData)("[number NaN]"),""):Number.POSITIVE_INFINITY===t||Number.NEGATIVE_INFINITY===t?(qn.config.error_on_infinite&&(0,Un.throwUnsupportedData)("[number Infinity]"),""):tt(e,(0,zn.encodeNum)(t));case"string":return tt(e,(0,zn.encodeStr)(t))}return(0,Un.throwUnknownDataType)(t)}xe.addValue=Nt});var Qn=Le(Je=>{"use strict";Object.defineProperty(Je,"__esModule",{value:!0});Je.decompress=Je.decode=Je.compress=void 0;var Ju=On(),Xt=Kn(),Wn=Jn();function Wu(e){let t=(0,Wn.makeInMemoryMemory)(),r=(0,Wn.addValue)(t,e,void 0);return[(0,Wn.memToValues)(t),r]}Je.compress=Wu;function Qu(e,t){if(t==="o|")return{};let r={},n=t.split("|"),o=n[1],i=Bt(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=Bt(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=Bt(e,a),o[i]=a}return o}function Bt(e,t){if(t===""||t==="_")return null;let r=(0,Xt.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,Xt.decodeBool)(n);case"o|":return Qu(e,n);case"n|":return(0,Xt.decodeNum)(n);case"a|":return Yu(e,n);default:return(0,Xt.decodeStr)(n)}}return(0,Ju.throwUnknownDataType)(n)}Je.decode=Bt;function Gu(e){let[t,r]=e;return Bt(t,r)}Je.decompress=Gu});var ti=Le(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.trimUndefinedRecursively=dt.trimUndefined=void 0;function Hu(e){for(let t in e)e[t]===void 0&&delete e[t]}dt.trimUndefined=Hu;function Xu(e){ei(e,new Set)}dt.trimUndefinedRecursively=Xu;function ei(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)&&ei(n,t)}}});var oi=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 ni=Qn();Object.defineProperty(Z,"compress",{enumerable:!0,get:function(){return ni.compress}});Object.defineProperty(Z,"decompress",{enumerable:!0,get:function(){return ni.decompress}});var Zu=Qn();Object.defineProperty(Z,"decode",{enumerable:!0,get:function(){return Zu.decode}});var ep=Jn();Object.defineProperty(Z,"addValue",{enumerable:!0,get:function(){return ep.addValue}});var ri=ti();Object.defineProperty(Z,"trimUndefined",{enumerable:!0,get:function(){return ri.trimUndefined}});Object.defineProperty(Z,"trimUndefinedRecursively",{enumerable:!0,get:function(){return ri.trimUndefinedRecursively}});var tp=Mn();Object.defineProperty(Z,"config",{enumerable:!0,get:function(){return tp.config}})});var Ri="1.11.35",Zn=process.env.OVERRIDE_VERSION??Ri;function ne(e){let t=e.join(e.getAppRootDir(),"tsconfig.json");return e.exists(t)}var Ni=["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(Ni.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 gt(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 er(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 Dt(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 Dt(e,a,r);if(u)return u}}))).find(i=>typeof i=="string")}var or=Hn(nr(),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 Qe(e,t){let r=e.extname(t),n=e.basename(t,r).split(/[\/\\]/),o=n[n.length-1];return rr(o==="index"?e.basename(e.dirname(t)):o)}function rr(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 O(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 xt(e){return typeof e=="number"}function nt(e){return typeof e=="boolean"}function re(e){return typeof e=="string"}function rt(e){return typeof e=="string"?/^[A-Z][A-Za-z0-9]*$/.test(e):!1}function ue(e){return JSON.parse(JSON.stringify(e))}function kt(e,t,r){for(let n of t)if(e.dirname(r).includes(n))return!0;return!1}function ir(){try{let e=(0,or.default)();if(e?.name)return e.name}catch{}return"npm"}async function Ye(e){let t=[],r=await gt(e,e.getRepoRootDir());if(r){let n=await ur(r,e);t.push(...n)}return t}async function sr(e){let t=await gt(e,e.getRepoRootDir());return t?.scripts?.dev?t.scripts.dev.includes("--turbopack"):!1}async function ur(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};ar.has(o)&&(i.version=await ar.get(o)(t)),r.push(i)}}return r}function on(e){let t=parseInt(e);return Number.isNaN(t)?void 0:t}var ar=new Map([["next",async e=>{if(!e.spawnSync)return;let t=ir(),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:on(a),minor:on(s),patch:on(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=pr(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=pr(e);await e.writeFile(r,JSON.stringify(t??{},null,2))}function pr(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 ki(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 ki(e,t){let r=await e.readFile(t);return typeof r=="string"?cr(r):null}function cr(e){let t={},r=e.replace(/\r\n?/gm,`
|
|
3
3
|
`),n;for(;(n=Li.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 Li=/(?:^|^)\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
|
|