vite-plugin-taro 0.7.4-beta.0 → 0.7.4
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/dist/index.js
CHANGED
|
@@ -15,7 +15,7 @@ injectIntoGlobalHook(globalThis);
|
|
|
15
15
|
window.$RefreshReg$ = () => {};
|
|
16
16
|
window.$RefreshSig$ = () => (type) => type;`,map:null}}function XM(e){if(!/\bhook\.inject\(internals\)/.test(e))throw Error(`React Reconciler must inject its renderer into the DevTools hook`);return{code:`import '${KM}'\n${e}`,map:null}}function ZM(e){return e.name===`client`}function QM(e,t){let r=GM(e.options.hmr,e.runtime.modules),i=null;return[{name:`vpt:mini-dev`,apply:`serve`,applyToEnvironment:ZM,config(){return{define:{"performance.now":`Date.now`},build:{emptyOutDir:!1,sourcemap:!1},experimental:{bundledDev:!0},server:{ws:{path:_M}}}},configureServer:{order:`post`,async handler(a){SA(n.resolve(a.config.root,a.config.build.outDir)),i=await EM({server:a,contract:e,styles:t,hmrMode:r})}},generateBundle:{order:`post`,handler(t,n){$M(n,e.styles.appFileName)}},closeBundle(){return i?.close()}},{name:`vpt:mini-runtime-lowering`,apply:`serve`,transform:{order:`post`,filter:{id:Ee(TA)},handler(e){return eN(e)}}},...r.plugins,...JM()]}function $M(e,t){delete e[t]}const eN=CA(e=>c(e,TA,{lang:`js`,target:Ne,sourcemap:!1,assumptions:{setPublicClassFields:!0}}));function tN(e){return e?.[`vpt:native-components`]?.assetBytes??0}function nN(e){return e?.[`vpt:native-components`]?.sources??[]}async function rN(e,t){await iN(e.folder),await aN(e);let n=[];return await oN(e.folder,[],n,o(t)),{...e,assets:n}}async function iN(e){try{if((await T(e)).isDirectory())return}catch(t){throw Error.isError(t)&&`code`in t&&t.code===`ENOENT`?Error(`Native component folder does not exist: ${e}`,{cause:t}):t}throw Error(`Native component source is not a directory: ${e}`)}async function aN(e){let t=n.join(e.folder,`${e.entry}.js`);try{if((await T(t)).isFile())return}catch(e){throw Error.isError(e)&&`code`in e&&e.code===`ENOENT`?Error(`Native component entry file does not exist: ${t}`,{cause:e}):e}throw Error(`Native component entry is not a file: ${t}`)}async function oN(e,t,r,i){let a=n.join(e,...t),s=await ee(a,{withFileTypes:!0});s.sort((e,t)=>e.name.localeCompare(t.name));for(let a of s){let s=[...t,a.name];if(a.isDirectory()){await oN(e,s,r,i);continue}if(!a.isFile())continue;let c=n.join(e,...s);o(c)!==i&&r.push({relativePath:s.join(`/`),byteLength:(await T(c)).size})}}function sN(e,t,r){let i=De(t),a=te(e,{astType:`ts`,lang:`tsx`,preserveParens:!1,sourceType:`module`},i),o=pN(a),s=lN(a),c=uN(a,new Set(s.flatMap(e=>e.names))).map(t=>({call:t,definition:fN(t,i,o,n=>yN(n,i,e,t.start))})),l=new d(e,{filename:i});return c.forEach(({call:e,definition:t})=>{l.overwrite(e.start,e.end,JSON.stringify(n.posix.basename(t.folder)))}),s.forEach(({declaration:e})=>{l.remove(e.start,e.end)}),{code:l.toString(),map:r?cN(l,i):null,definitions:c.map(({definition:e})=>e)}}function cN(e,t){let n=e.generateMap({hires:`boundary`,includeContent:!0,source:t});return{file:n.file,mappings:n.mappings,names:n.names,sources:n.sources,sourcesContent:n.sourcesContent,version:n.version}}function lN(e){return e.body.flatMap(e=>{if(e.type!==`ImportDeclaration`||e.source.value!==`virtual:taro/native`)return[];let t=e.specifiers.flatMap(e=>e.type!==`ImportSpecifier`||gN(e.imported)!==`defineNativeComponent`?[]:[e.local.name]);return t.length===0?[]:[{declaration:e,names:t}]})}function uN(e,t){return e.body.flatMap(e=>{if(e.type===`ExpressionStatement`)return dN(e.expression,t)?[e.expression]:[];if(e.type===`ExportDefaultDeclaration`)return dN(e.declaration,t)?[e.declaration]:[];let n=e.type===`ExportNamedDeclaration`?e.declaration:e;return n?.type===`VariableDeclaration`?n.declarations.flatMap(({init:e})=>dN(e,t)?[e]:[]):[]})}function dN(e,t){return e?.type===`CallExpression`&&e.callee.type===`Identifier`&&t.has(e.callee.name)}function fN(e,t,r,i){if(e.arguments.length!==1)throw i(`defineNativeComponent() requires exactly one entry loader`);let a=_N(e.arguments[0]);if(!a)throw i(`Native component entry must use () => import(...) with a static relative .js path`);let s=o(n.resolve(n.dirname(t),a));return{folder:n.posix.dirname(s),entry:n.posix.basename(s,`.js`),fields:hN(e.typeArguments,r,i)}}function pN(e){let t=new Map;for(let n of e.body){let e=n.type===`ExportNamedDeclaration`?n.declaration:n;if(e?.type===`TSTypeAliasDeclaration`&&!e.typeParameters&&e.typeAnnotation.type===`TSTypeLiteral`){t.set(e.id.name,e.typeAnnotation.members);continue}e?.type===`TSInterfaceDeclaration`&&!e.typeParameters&&e.extends.length===0&&t.set(e.id.name,e.body.body)}return t}function mN(e,t){if(e.type===`TSTypeLiteral`)return e.members;if(e.type===`TSTypeReference`&&e.typeName.type===`Identifier`&&!e.typeArguments)return t.get(e.typeName.name)}function hN(e,t,n){if(!e)return[];if(e.params.length!==1)throw n(`Native component interface must be one TypeScript object type`);let r=e.params[0],i=mN(r,t);if(!i)throw n(`Native component interface must be inline or declared in the same module`);let a=new Set;for(let e of i){if(e.type!==`TSPropertySignature`&&e.type!==`TSMethodSignature`)throw n(`Native component interface must contain only static fields`);if(e.computed)throw n(`Native component interface contains a computed field`);let t=gN(e.key);if(!t)throw n(`Native component interface contains a computed field`);if(a.has(t))throw n(`Duplicate native component interface field: ${t}`);a.add(t)}return[...a].filter(e=>e!==`children`)}function gN(e){if(e.type===`Identifier`)return e.name;if(e.type===`Literal`&&typeof e.value==`string`)return e.value}function _N(e){if(e?.type!==`ArrowFunctionExpression`||e.params.length!==0||e.body.type!==`ImportExpression`)return;let t=e.body;if(t.source.type===`Literal`&&typeof t.source.value==`string`&&t.options===null&&vN(t.source.value))return t.source.value}function vN(e){return(e.startsWith(`./`)||e.startsWith(`../`))&&n.posix.extname(e)===`.js`}function yN(e,t,n,r){let i=n.slice(0,r),a=i.split(`
|
|
17
17
|
`).length,o=r-i.lastIndexOf(`
|
|
18
|
-
`);return Error(`${e}\n${t}:${a}:${o}`)}async function bN({code:e,id:t,sourcemap:r,addWatchFile:i}){let a=sN(e,t,r),s=De(t),c=await Promise.all(a.definitions.map(e=>rN(e,s)));c.forEach(e=>{i(e.folder),e.assets.forEach(t=>{i(o(n.join(e.folder,t.relativePath)))})});let l=c.reduce((e,t)=>e+t.assets.reduce((e,t)=>e+t.byteLength,0),0);return{code:a.code,map:a.map,meta:{"vpt:native-components":{sources:c,assetBytes:l}}}}async function xN({bundle:e,getModuleInfo:t,getPackageLocation:r}){let i=[],a=[];for(let o of Object.values(e)){if(o.type!==`chunk`)continue;let e=r(o),s=e.kind===`subpackage`?e.root:void 0;for(let e of o.moduleIds){let r=nN(t(e)?.meta);for(let e of r){let t=n.posix.basename(e.folder),r=n.posix.join(`components`,t),o=s?n.posix.join(s,r):r;a.push({name:t,componentPath:`/${n.posix.join(o,e.entry)}`,fields:e.fields});for(let t of e.assets)i.push({type:`asset`,fileName:n.posix.join(o,t.relativePath),source:await w(n.join(e.folder,t.relativePath))})}}}return{files:i,registrations:a}}async function SN({bundle:e,contract:t,subpackages:n,isProduction:r,getModuleInfo:i,getPackageLocation:a}){let o=await xN({bundle:e,getModuleInfo:i,getPackageLocation:a});return[{type:`asset`,fileName:t.styles.appFileName,source:`@import "./${t.styles.globalFileName}";\n`},...t.output.generateProjectSkeleton({bundle:e,subpackages:n,nativeComponents:o.registrations,isProduction:r}),...o.files]}const CN=`sub/p_`,wN={kind:`main`};function TN({chunks:e,planningBudgetBytes:t,getAdditionalModuleBytes:n}){let r=new Map(Object.entries(e).sort(([e],[t])=>e.localeCompare(t))),i=EN(r),a=DN({chunks:r,mainChunkIds:i}),o=kN({chunks:[...r].filter(([e])=>!i.has(e)).map(([e,t])=>({chunkId:e,estimatedBytes:FN(t)+t.moduleIds.reduce((e,t)=>e+n(t),0),transitions:a.get(e)??new Set})),planningBudgetBytes:t}).map(IN),s=new Map;for(let e of i)s.set(e,wN);for(let e of o)for(let t of e.chunkIds)s.set(t,e);function c(e){let t=s.get(e);if(!t)throw Error(`Mini Program placement is missing final chunk: ${e}`);return t}function l(e){return c(`preliminaryFileName`in e?e.preliminaryFileName:e.fileName)}return{getPackageLocation:l,getPhysicalChunkId(e){let t=l(e);return t.kind===`main`?e.fileName:`${t.root}/${e.fileName}`},getLoadMode(e){return l(e).kind===`subpackage`?`async`:`sync`},finalize(e){let t=Object.values(e).filter(e=>e.type===`chunk`),n=new Set;for(let e of t){let t=c(e.preliminaryFileName);t.kind===`subpackage`&&(e.fileName=`${t.root}/${e.fileName}`,n.add(t.root))}return[...n].sort().map(e=>({root:e}))}}}function EN(e){let t=new Set,n=[...e].filter(([,e])=>e.isEntry).map(([e])=>e);for(;n.length>0;){let r=n.pop();if(!r||t.has(r))continue;let i=e.get(r);i&&(t.add(r),n.push(...i.imports))}return t}function DN({chunks:e,mainChunkIds:t}){let n=new Map,r=0;for(let i of e.values())for(let a of[...i.dynamicImports].sort())if(e.has(a)&&!t.has(a)){for(let i of ON({rootId:a,chunks:e,mainChunkIds:t})){let e=n.get(i)??new Set;e.add(r),n.set(i,e)}r++}return n}function ON({rootId:e,chunks:t,mainChunkIds:n}){let r=new Set,i=[e];for(;i.length>0;){let e=i.pop();if(!e||r.has(e)||n.has(e))continue;let a=t.get(e);a&&(r.add(e),i.push(...a.imports))}return[...r].sort()}function kN({chunks:e,planningBudgetBytes:t}){let n=[],r=[...e].sort(AN);for(let e of r)PN(e.estimatedBytes<=t?jN({bins:n,chunk:e,planningBudgetBytes:t})??NN(n):NN(n),e);return n}function AN(e,t){return t.transitions.size-e.transitions.size||t.estimatedBytes-e.estimatedBytes||e.chunkId.localeCompare(t.chunkId)}function jN({bins:e,chunk:t,planningBudgetBytes:n}){let r;for(let i of e){if(i.estimatedBytes+t.estimatedBytes>n)continue;let e={bin:i,overlap:MN(i.transitions,t.transitions),remainingBytes:n-i.estimatedBytes-t.estimatedBytes};(!r||e.overlap>r.overlap||e.overlap===r.overlap&&e.remainingBytes<r.remainingBytes)&&(r=e)}return r?.bin}function MN(e,t){let[n,r]=e.size<=t.size?[e,t]:[t,e],i=0;for(let e of n)r.has(e)&&i++;return i}function NN(e){let t={chunkIds:[],estimatedBytes:0,transitions:new Set};return e.push(t),t}function PN(e,t){e.chunkIds.push(t.chunkId),e.estimatedBytes+=t.estimatedBytes;for(let n of t.transitions)e.transitions.add(n)}function FN(e){let t=Object.values(e.modules).reduce((e,t)=>e+(t.code?Buffer.byteLength(t.code,`utf8`):0),0),n=e.moduleIds.length*64,r=(e.imports.length+e.dynamicImports.length)*32;return t+n+r+64}function IN(e){let t=[...e.chunkIds].sort(),n=x(`sha256`).update(t.join(`\0`)).digest(`hex`).slice(0,8);return{kind:`subpackage`,root:`${CN}${n}`,chunkIds:t}}function LN(e){return e.startsWith(CN)}function RN(e){return{output:{codeSplitting:{groups:[{name:`polyfills`,test:kA,priority:200,includeDependenciesRecursively:!1},{name:`vendor`,test:AA,priority:100,includeDependenciesRecursively:!0}]},entryFileNames(t){let n=e(t);return n.entryRole===`shell`?`[name]`:n.entryRole===`capsule`?`[name].js`:`common/[name].js`},chunkFileNames:`common/[name].js`},preserveEntrySignatures:`allow-extension`}}function zN(e){let t=jA(e),n={phase:`idle`};function r(){if(n.phase===`idle`||n.phase===`awaiting-chunks`)throw Error(`Mini Program placement is unavailable before Rolldown exposes the final chunk graph`);return n.placement}return{name:`vpt:mini-placer`,config(){return{build:{rolldownOptions:RN(t)}}},renderStart(){n={phase:`awaiting-chunks`}},renderChunk:{order:`pre`,handler(e,t,r,i){if(n.phase!==`planned`){if(n.phase!==`awaiting-chunks`)throw Error(`Mini Program placement received final chunks during the ${n.phase} phase`);n={phase:`planned`,placement:TN({chunks:i.chunks,planningBudgetBytes:19e5,getAdditionalModuleBytes:e=>tN(this.getModuleInfo(e)?.meta)})}}}},generateBundle:{order:`pre`,handler(e,t){let i=r();n={phase:`finalized`,placement:i,subpackages:i.finalize(t)}}},classifyChunk(e){return t(e)},getPackageLocation(e){return r().getPackageLocation(e)},getPhysicalChunkId(e){return r().getPhysicalChunkId(e)},getLoadMode(e){return r().getLoadMode(e)},getSubpackages(){if(n.phase!==`finalized`)throw Error(`Mini Program subpackages are unavailable before output finalization`);return n.subpackages}}}const BN={window:[wA,`window`],document:[wA,`document`],navigator:[wA,`navigator`],requestAnimationFrame:[wA,`requestAnimationFrame`],cancelAnimationFrame:[wA,`cancelAnimationFrame`],Element:[wA,`TaroElement`],SVGElement:[wA,`SVGElement`],MutationObserver:[wA,`MutationObserver`],history:[wA,`history`],location:[wA,`location`]};function VN(e){let t=new Set(e.options.polyfills??[]);return{name:`vpt:mini-polyfills`,config(){return{build:{rolldownOptions:{input:{polyfills:EA},transform:{inject:BN}}}}},resolveId:{filter:{id:Ee(EA)},handler(){return EA}},load:{filter:{id:Ee(EA)},handler(){return
|
|
18
|
+
`);return Error(`${e}\n${t}:${a}:${o}`)}async function bN({code:e,id:t,sourcemap:r,addWatchFile:i}){let a=sN(e,t,r),s=De(t),c=await Promise.all(a.definitions.map(e=>rN(e,s)));c.forEach(e=>{i(e.folder),e.assets.forEach(t=>{i(o(n.join(e.folder,t.relativePath)))})});let l=c.reduce((e,t)=>e+t.assets.reduce((e,t)=>e+t.byteLength,0),0);return{code:a.code,map:a.map,meta:{"vpt:native-components":{sources:c,assetBytes:l}}}}async function xN({bundle:e,getModuleInfo:t,getPackageLocation:r}){let i=[],a=[];for(let o of Object.values(e)){if(o.type!==`chunk`)continue;let e=r(o),s=e.kind===`subpackage`?e.root:void 0;for(let e of o.moduleIds){let r=nN(t(e)?.meta);for(let e of r){let t=n.posix.basename(e.folder),r=n.posix.join(`components`,t),o=s?n.posix.join(s,r):r;a.push({name:t,componentPath:`/${n.posix.join(o,e.entry)}`,fields:e.fields});for(let t of e.assets)i.push({type:`asset`,fileName:n.posix.join(o,t.relativePath),source:await w(n.join(e.folder,t.relativePath))})}}}return{files:i,registrations:a}}async function SN({bundle:e,contract:t,subpackages:n,isProduction:r,getModuleInfo:i,getPackageLocation:a}){let o=await xN({bundle:e,getModuleInfo:i,getPackageLocation:a});return[{type:`asset`,fileName:t.styles.appFileName,source:`@import "./${t.styles.globalFileName}";\n`},...t.output.generateProjectSkeleton({bundle:e,subpackages:n,nativeComponents:o.registrations,isProduction:r}),...o.files]}const CN=`sub/p_`,wN={kind:`main`};function TN({chunks:e,planningBudgetBytes:t,getAdditionalModuleBytes:n}){let r=new Map(Object.entries(e).sort(([e],[t])=>e.localeCompare(t))),i=EN(r),a=DN({chunks:r,mainChunkIds:i}),o=kN({chunks:[...r].filter(([e])=>!i.has(e)).map(([e,t])=>({chunkId:e,estimatedBytes:FN(t)+t.moduleIds.reduce((e,t)=>e+n(t),0),transitions:a.get(e)??new Set})),planningBudgetBytes:t}).map(IN),s=new Map;for(let e of i)s.set(e,wN);for(let e of o)for(let t of e.chunkIds)s.set(t,e);function c(e){let t=s.get(e);if(!t)throw Error(`Mini Program placement is missing final chunk: ${e}`);return t}function l(e){return c(`preliminaryFileName`in e?e.preliminaryFileName:e.fileName)}return{getPackageLocation:l,getPhysicalChunkId(e){let t=l(e);return t.kind===`main`?e.fileName:`${t.root}/${e.fileName}`},getLoadMode(e){return l(e).kind===`subpackage`?`async`:`sync`},finalize(e){let t=Object.values(e).filter(e=>e.type===`chunk`),n=new Set;for(let e of t){let t=c(e.preliminaryFileName);t.kind===`subpackage`&&(e.fileName=`${t.root}/${e.fileName}`,n.add(t.root))}return[...n].sort().map(e=>({root:e}))}}}function EN(e){let t=new Set,n=[...e].filter(([,e])=>e.isEntry).map(([e])=>e);for(;n.length>0;){let r=n.pop();if(!r||t.has(r))continue;let i=e.get(r);i&&(t.add(r),n.push(...i.imports))}return t}function DN({chunks:e,mainChunkIds:t}){let n=new Map,r=0;for(let i of e.values())for(let a of[...i.dynamicImports].sort())if(e.has(a)&&!t.has(a)){for(let i of ON({rootId:a,chunks:e,mainChunkIds:t})){let e=n.get(i)??new Set;e.add(r),n.set(i,e)}r++}return n}function ON({rootId:e,chunks:t,mainChunkIds:n}){let r=new Set,i=[e];for(;i.length>0;){let e=i.pop();if(!e||r.has(e)||n.has(e))continue;let a=t.get(e);a&&(r.add(e),i.push(...a.imports))}return[...r].sort()}function kN({chunks:e,planningBudgetBytes:t}){let n=[],r=[...e].sort(AN);for(let e of r)PN(e.estimatedBytes<=t?jN({bins:n,chunk:e,planningBudgetBytes:t})??NN(n):NN(n),e);return n}function AN(e,t){return t.transitions.size-e.transitions.size||t.estimatedBytes-e.estimatedBytes||e.chunkId.localeCompare(t.chunkId)}function jN({bins:e,chunk:t,planningBudgetBytes:n}){let r;for(let i of e){if(i.estimatedBytes+t.estimatedBytes>n)continue;let e={bin:i,overlap:MN(i.transitions,t.transitions),remainingBytes:n-i.estimatedBytes-t.estimatedBytes};(!r||e.overlap>r.overlap||e.overlap===r.overlap&&e.remainingBytes<r.remainingBytes)&&(r=e)}return r?.bin}function MN(e,t){let[n,r]=e.size<=t.size?[e,t]:[t,e],i=0;for(let e of n)r.has(e)&&i++;return i}function NN(e){let t={chunkIds:[],estimatedBytes:0,transitions:new Set};return e.push(t),t}function PN(e,t){e.chunkIds.push(t.chunkId),e.estimatedBytes+=t.estimatedBytes;for(let n of t.transitions)e.transitions.add(n)}function FN(e){let t=Object.values(e.modules).reduce((e,t)=>e+(t.code?Buffer.byteLength(t.code,`utf8`):0),0),n=e.moduleIds.length*64,r=(e.imports.length+e.dynamicImports.length)*32;return t+n+r+64}function IN(e){let t=[...e.chunkIds].sort(),n=x(`sha256`).update(t.join(`\0`)).digest(`hex`).slice(0,8);return{kind:`subpackage`,root:`${CN}${n}`,chunkIds:t}}function LN(e){return e.startsWith(CN)}function RN(e){return{output:{codeSplitting:{groups:[{name:`polyfills`,test:kA,priority:200,includeDependenciesRecursively:!1},{name:`vendor`,test:AA,priority:100,includeDependenciesRecursively:!0}]},entryFileNames(t){let n=e(t);return n.entryRole===`shell`?`[name]`:n.entryRole===`capsule`?`[name].js`:`common/[name].js`},chunkFileNames:`common/[name].js`},preserveEntrySignatures:`allow-extension`}}function zN(e){let t=jA(e),n={phase:`idle`};function r(){if(n.phase===`idle`||n.phase===`awaiting-chunks`)throw Error(`Mini Program placement is unavailable before Rolldown exposes the final chunk graph`);return n.placement}return{name:`vpt:mini-placer`,config(){return{build:{rolldownOptions:RN(t)}}},renderStart(){n={phase:`awaiting-chunks`}},renderChunk:{order:`pre`,handler(e,t,r,i){if(n.phase!==`planned`){if(n.phase!==`awaiting-chunks`)throw Error(`Mini Program placement received final chunks during the ${n.phase} phase`);n={phase:`planned`,placement:TN({chunks:i.chunks,planningBudgetBytes:19e5,getAdditionalModuleBytes:e=>tN(this.getModuleInfo(e)?.meta)})}}}},generateBundle:{order:`pre`,handler(e,t){let i=r();n={phase:`finalized`,placement:i,subpackages:i.finalize(t)}}},classifyChunk(e){return t(e)},getPackageLocation(e){return r().getPackageLocation(e)},getPhysicalChunkId(e){return r().getPhysicalChunkId(e)},getLoadMode(e){return r().getLoadMode(e)},getSubpackages(){if(n.phase!==`finalized`)throw Error(`Mini Program subpackages are unavailable before output finalization`);return n.subpackages}}}const BN={window:[wA,`window`],document:[wA,`document`],navigator:[wA,`navigator`],requestAnimationFrame:[wA,`requestAnimationFrame`],cancelAnimationFrame:[wA,`cancelAnimationFrame`],Element:[wA,`TaroElement`],SVGElement:[wA,`SVGElement`],MutationObserver:[wA,`MutationObserver`],history:[wA,`history`],location:[wA,`location`]};function VN(e){let t=[...new Set(e.options.polyfills??[])];return{name:`vpt:mini-polyfills`,config(){return{build:{rolldownOptions:{input:{polyfills:EA},transform:{inject:BN}}}}},resolveId:{filter:{id:Ee(EA)},handler(){return EA}},load:{filter:{id:Ee(EA)},handler(){return t.map(e=>`import ${JSON.stringify(HN(e))};`).join(`
|
|
19
19
|
`)}}}}function HN(e){if(!/^[a-z][a-z\d]*(?:[.-][a-z\d]+)*$/.test(e))throw Error(`Invalid core-js polyfill module: ${JSON.stringify(e)}. Use a module name such as "web.url".`);try{return ve.resolve(`core-js/modules/${e}.js`)}catch(t){throw Error(`Unknown core-js polyfill module: ${JSON.stringify(e)}.`,{cause:t})}}function UN(e){return n.posix.normalize(e)}function WN(e,t){if(!t.startsWith(`./`)&&!t.startsWith(`../`))throw Error(`Expected a relative chunk reference in ${e}: ${t}`);return n.posix.join(n.posix.dirname(e),t)}function GN(e,t){return UN(WN(e,t))}var KN=class{original;#e=new Map;#t=[];constructor(e){this.original=e}overwrite(e,t,n){this.#t.push({content:n,end:t,start:e})}remove(e,t){this.overwrite(e,t,``);for(let n of this.#e.keys())n>=e&&n<=t&&this.#e.delete(n)}prependLeft(e,t){this.#n(e).prepend.unshift(t)}appendLeft(e,t){this.#n(e).append.push(t)}appendRight(e,t){this.#n(e).append.push(t)}render(e,t){let n=this.#t.filter(n=>n.start>=e&&n.end<=t).sort((e,t)=>e.start-t.start||t.end-e.end),r=e,i=``;for(let e of n)if(!(e.end<=r)){if(e.start<r)throw Error(`Partially overlapping source edits at ${e.start}:${e.end}`);i+=this.#r(r,e.start,!1),i+=e.content,r=e.end}return i+=this.#r(r,t,!0),i}#n(e){let t=this.#e.get(e);if(t)return t;let n={append:[],prepend:[]};return this.#e.set(e,n),n}#r(e,t,n){let r=[...this.#e.keys()].filter(r=>r>=e&&(r<t||n&&r===t)).sort((e,t)=>e-t),i=e,a=``;for(let e of r)a+=this.original.slice(i,e),a+=this.#i(e),i=e;return a+=this.original.slice(i,t),a}#i(e){let t=this.#e.get(e);return`${t.prepend.join(``)}${t.append.join(``)}`}};function qN(e){let t=p(e.filename,e.code);if(t.errors.length>0){let n=t.errors.map(e=>e.message).join(`; `);throw Error(`Failed to parse ${e.filename} with Oxc: ${n}`)}let n=JN(t.program,e.filename);if(!e.sourcemap){let t=new KN(e.code);return QN(t,n),rP(t,n,e),{code:sP(t,n,e),map:null}}let r=new d(e.code,{filename:e.filename});return QN(r,n),rP(r,n,e),cP(r,n,e),{code:r.toString(),map:PP(r,e.filename)}}function JN(e,t){let n=new Set,r=new Map,i=new Map,a=[],o=[],s=new Set,c=new Set,l=new Ve({preserveExitedScopes:!0}),u=0,d=!1,f=!1;ze(e,{scopeTracker:l,enter(e,t){if(e.type===`Identifier`&&n.add(e.name),e.type===`CallExpression`&&e.callee.type===`Identifier`&&e.callee.name===`eval`&&(d=!0),OP(e)&&(u+=1),e.type===`AwaitExpression`&&u===0&&(f=!0),e.type===`VariableDeclaration`&&e.kind===`var`&&u===0){let n=(t?.type===`ForInStatement`||t?.type===`ForOfStatement`)&&t.left===e;o.push({declaration:e,isForIterationBinding:n}),CP(e).forEach(e=>{c.add(e)})}},leave(e){OP(e)&&--u}});for(let n of e.body)switch(n.type){case`ImportDeclaration`:YN(n,i,s,c,t);break;case`ExportNamedDeclaration`:XN(n,r,t);break;case`ExportDefaultDeclaration`:case`ExportAllDeclaration`:throw NP(t,`source-level ${n.type}`);case`VariableDeclaration`:jP(n,t),n.declarations.flatMap(e=>wP(e.id)).forEach(e=>{c.add(e)});break;case`FunctionDeclaration`:{let e=n.id;a.push(n),c.add(e.name);break}case`ClassDeclaration`:{let e=n.id;c.add(e.name);break}}l.freeze(),AP(d,t);let p=bP(n,i.size);return ZN(r,c,t),{dependencies:[...i.values()],exportNamesByLocal:r,functions:a,generatedNames:p,hasTopLevelAwait:f,hoistedVariables:o,importBindings:s,outerBindings:c,program:e,scopes:l}}function YN(e,t,n,r,i){if(e.phase||e.attributes.length>0||e.importKind===`type`)throw NP(i,`import phases, attributes, or type-only imports`);let a=e.source.value,o=t.get(a)??{source:a,imports:[]};t.has(a)||t.set(a,o);for(let t of e.specifiers)switch(n.add(t.local.name),r.add(t.local.name),t.type){case`ImportDefaultSpecifier`:o.imports.push({imported:`default`,local:t.local.name});break;case`ImportNamespaceSpecifier`:o.imports.push({imported:null,local:t.local.name});break;case`ImportSpecifier`:o.imports.push({imported:xP(t.imported),local:t.local.name})}}function XN(e,t,n){if(e.declaration||e.source||e.attributes.length>0||e.exportKind===`type`)throw NP(n,`declaration exports, re-exports, export attributes, or type-only exports`);for(let n of e.specifiers){let e=xP(n.local),r=xP(n.exported),i=t.get(e)??[];i.push(r),t.has(e)||t.set(e,i)}}function ZN(e,t,n){for(let r of e.keys())if(!t.has(r))throw NP(n,`export of non-module binding ${JSON.stringify(r)}`)}function QN(e,t){for(let n of t.program.body)switch(n.type){case`ImportDeclaration`:e.remove(n.start,n.end);break;case`ExportNamedDeclaration`:e.overwrite(n.start,n.end,dP(n.specifiers,t));break;case`VariableDeclaration`:$N(e,n,t.generatedNames.exportBinding,t.exportNamesByLocal);break;case`ClassDeclaration`:nP(e,n,t.generatedNames.exportBinding,t.exportNamesByLocal)}let n=new Set(t.program.body.flatMap(e=>e.type===`VariableDeclaration`?[e]:[]));t.hoistedVariables.filter(({declaration:e})=>!n.has(e)).forEach(({declaration:n,isForIterationBinding:r})=>{eP(e,n,r,t.generatedNames.exportBinding,t.exportNamesByLocal)})}function $N(e,t,n,r){let i=t.declarations[0];e.overwrite(t.start,i.start,`(`),e.appendLeft(MP(e.original,t.end),`)`),tP(e,t,n,r)}function eP(e,t,n,r,i){let a=t.declarations[0];e.overwrite(t.start,a.start,n?``:`(`),n||e.appendLeft(MP(e.original,t.end),`)`),tP(e,t,r,i)}function tP(e,t,n,r){for(let i of t.declarations){if(!i.init)continue;let t=wP(i.id).flatMap(e=>(r.get(e)??[]).map(t=>({exported:t,local:e})));if(t.length!==0){if(i.id.type===`Identifier`){let t=r.get(i.id.name);e.prependLeft(i.start,mP(n,t,``)),e.appendRight(i.end,hP(t));continue}e.prependLeft(i.start,`(`),e.appendRight(i.end,`,${t.map(({exported:e,local:t})=>vP(n,e,t)).join(`,`)})`)}}}function nP(e,t,n,r){let i=t.id,a=r.get(i.name)??[];e.prependLeft(t.start,mP(n,a,`${i.name}=`)),e.appendRight(t.end,hP(a))}function rP(e,t,n){let r=t.scopes,i=0;ze(t.program,{scopeTracker:r,enter(a){switch(kP(a)&&(i+=1),a.type){case`ImportExpression`:if(a.options||a.phase)throw NP(n.filename,`dynamic import options or phases`);e.overwrite(a.start,a.source.start,`${t.generatedNames.context}.import(`),a.source.type===`Literal`&&typeof a.source.value==`string`&&e.overwrite(a.source.start,a.source.end,JSON.stringify(n.resolveReference(a.source.value,`dynamic`)));break;case`MetaProperty`:a.meta.name===`import`&&a.property.name===`meta`&&e.overwrite(a.start,a.end,`${t.generatedNames.context}.meta`);break;case`ThisExpression`:i===0&&e.overwrite(a.start,a.end,`void 0`);break;case`AssignmentExpression`:iP(e,a.left,a.start,a.end,r,t,n.filename);break;case`UpdateExpression`:aP(e,a,r,t);break;case`ForInStatement`:case`ForOfStatement`:a.left.type!==`VariableDeclaration`&&oP(a.left,r,t.exportNamesByLocal,n.filename)}},leave(e){kP(e)&&--i}})}function iP(e,t,n,r,i,a,o){if(t.type===`Identifier`){let o=pP(t.name,i,a.exportNamesByLocal);if(o.length===0)return;e.prependLeft(n,mP(a.generatedNames.exportBinding,o,``)),e.appendRight(r,hP(o));return}oP(t,i,a.exportNamesByLocal,o)}function aP(e,t,n,r){if(t.argument.type!==`Identifier`)return;let i=pP(t.argument.name,n,r.exportNamesByLocal);if(i.length===0)return;if(t.prefix){e.prependLeft(t.start,mP(r.generatedNames.exportBinding,i,``)),e.appendRight(t.end,hP(i));return}let a=`+${t.argument.name}${t.operator[0]}1`;e.prependLeft(t.start,`(${gP(r.generatedNames.exportBinding,i,a)},`),e.appendRight(t.end,`)`)}function oP(e,t,n,r){let i=TP(e).filter(e=>pP(e,t,n).length>0);if(i.length>0)throw NP(r,`destructuring write to exported binding ${JSON.stringify(i[0])}`)}function sP(e,t,n){let r=lP(t,n),i=t.functions.map(t=>e.render(t.start,t.end)).join(``);return t.functions.forEach(t=>{e.remove(t.start,t.end)}),`${r.prefix}${e.render(0,e.original.length)}}};${i}${r.suffix}`}function cP(e,t,n){let r=lP(t,n);for(let n of t.functions)e.move(n.start,n.end,e.original.length);e.prepend(r.prefix),e.prependLeft(e.original.length,`}};`),e.append(r.suffix)}function lP(e,t){let n=e.dependencies.map(e=>t.resolveReference(e.source,`static`)),r=e.dependencies.map((t,n)=>fP(t,n,e.generatedNames)),i=uP(e),a=e.outerBindings.size>0?`var ${[...e.outerBindings].join(`,`)};`:``,o=e.hasTopLevelAwait?`async function`:`function`,s=`function(${e.generatedNames.exportBinding},${e.generatedNames.context}){"use strict";${a}${i}return {setters:[${r.join(`,`)}],execute:${o}(){`;return t.format===`system-register`?{prefix:`System.register(${JSON.stringify(n)},${s}`,suffix:`})`}:{prefix:`module.exports=[${JSON.stringify(n)},${s}`,suffix:`}]`}}function uP(e){let t=new Set(e.functions.map(e=>e.id.name)),n=e.program.body.flatMap(e=>e.type===`VariableDeclaration`?[e]:[]),r=e.hoistedVariables.map(({declaration:e})=>e).filter(e=>!n.includes(e)),i=[...n,...r].sort((e,t)=>e.start-t.start),a=[];for(let[n,r]of e.exportNamesByLocal)if(t.has(n))for(let e of r)a.push({exported:e,value:n});for(let t of i)for(let n of t.declarations)if(!n.init)for(let t of wP(n.id))for(let n of e.exportNamesByLocal.get(t)??[])a.push({exported:n,value:`void 0`});if(a.length===0)return``;if(a.length===1){let[t]=a;return yP(e.generatedNames.exportBinding,t.exported,t.value)}let o=a.map(({exported:e,value:t})=>`[${JSON.stringify(e)}]:${t}`).join(`,`);return`${e.generatedNames.exportBinding}({${o}});`}function dP(e,t){return e.filter(e=>t.importBindings.has(xP(e.local))).map(e=>{let n=xP(e.local);return yP(t.generatedNames.exportBinding,xP(e.exported),n)}).join(``)}function fP(e,t,n){let r=`${n.dependencyPrefix}${t}`;return`function(${r}){${e.imports.flatMap(e=>{let t=e.imported===null?r:SP(r,e.imported);return[`${e.local}=${t};`]}).join(``)}}`}function pP(e,t,n){let r=n.get(e)??[];return r.length===0||t.getDeclaration(e)?.scope===``?r:[]}function mP(e,t,n){return t.length===0?n:t.reduce((t,n)=>`${_P(e,n)}${t}`,n)}function hP(e){return`)`.repeat(e.length)}function gP(e,t,n){return t.reduce((t,n)=>`${_P(e,n)}${t})`,n)}function _P(e,t){return`${e}(${JSON.stringify(t)},`}function vP(e,t,n){return`${e}(${JSON.stringify(t)},${n})`}function yP(e,t,n){return`${e}(${JSON.stringify(t)},${n});`}function bP(e,t){let n=new Set(e),r=e=>{let t=0,r=e;for(;n.has(r);)t+=1,r=`${e}${t}`;return n.add(r),r};return{context:r(`__systemContext`),exportBinding:r(`__systemExport`),dependencyPrefix:(e=>{let r=0,i=e;for(;Array.from({length:t},(e,t)=>`${i}${t}`).some(e=>n.has(e));)r+=1,i=`${e}${r}`;return Array.from({length:t},(e,t)=>`${i}${t}`).forEach(e=>{n.add(e)}),i})(`__systemDependency`)}}function xP(e){return e.type===`Literal`?String(e.value):e.name}function SP(e,t){return/^[$A-Z_a-z][$\w]*$/.test(t)?`${e}.${t}`:`${e}[${JSON.stringify(t)}]`}function CP(e){return e.declarations.flatMap(e=>wP(e.id))}function wP(e){return EP(e)}function TP(e){return EP(e)}function EP(e){switch(e.type){case`Identifier`:return[e.name];case`AssignmentPattern`:return EP(e.left);case`ArrayPattern`:return e.elements.flatMap(e=>e?EP(e):[]);case`ObjectPattern`:return e.properties.flatMap(e=>e.type===`Property`?EP(e.value):EP(e.argument));case`RestElement`:return EP(e.argument);default:return[]}}function DP(e){return e.type===`FunctionDeclaration`||e.type===`FunctionExpression`||e.type===`ArrowFunctionExpression`||e.type===`TSEmptyBodyFunctionExpression`}function OP(e){return DP(e)||e.type===`ClassDeclaration`||e.type===`ClassExpression`}function kP(e){return DP(e)&&e.type!==`ArrowFunctionExpression`||e.type===`ClassDeclaration`||e.type===`ClassExpression`}function AP(e,t){if(e)throw NP(t,`direct eval`)}function jP(e,t){if(e.kind===`using`||e.kind===`await using`||e.declare)throw NP(t,`using or ambient variable declaration`)}function MP(e,t){return e[t-1]===`;`?t-1:t}function NP(e,t){return Error(`Unsupported final Rolldown chunk ${e}: ${t}`)}function PP(e,t){let n=e.generateMap({file:t,hires:`boundary`,includeContent:!0,source:t});return{version:n.version,file:n.file,sources:n.sources,sourcesContent:n.sourcesContent,names:n.names,mappings:n.mappings}}function FP(e,t,n){return qN({code:e,filename:t.fileName,format:`commonjs-registration`,sourcemap:n,resolveReference(e,n){return IP(t.fileName,e,n)}})}function IP(e,t,n){return n===`dynamic`&&!t.startsWith(`./`)&&!t.startsWith(`../`)?t:GN(e,t)}function LP({code:e,chunk:t,chunks:n,classifyModule:r,sourcemap:i}){let a=p(t.fileName,e);if(a.errors.length>0){let e=a.errors.map(e=>e.message).join(`; `);throw Error(`Failed to parse ${t.fileName} with Oxc: ${e}`)}let o=RP(a.program,t,n,r),s=new d(e,{filename:t.fileName});BP(s,o,t.fileName),KP(s,o.program),zP(s,o);let c=o.exportNamesByLocal.size>0,l=oF(o),u=o.usesPostfixTemp?`var ${o.postfixTemp};`:``,f=iF(o);return c?s.prepend(`"use strict";Object.defineProperty(exports,"__esModule",{value:true});${l}${u}${f}`):s.prepend(`"use strict";${l}${u}${f}`),{code:s.toString(),map:i?hF(s,t.fileName):null}}function RP(e,t,n,r){let i=cF(e),a=new Map,o=[],s=new Map,c=!1;if(ze(e,{enter(e){e.type===`CallExpression`&&e.callee.type===`Identifier`&&e.callee.name===`eval`&&(c=!0)}}),c)throw mF(t.fileName,`direct eval`);for(let c of e.body)switch(c.type){case`ImportDeclaration`:{sF(c,t.fileName);let e=rF(t.fileName,c.source.value,n,r);if(e){let[n]=c.specifiers;if(c.specifiers.length!==1||!n||n.type===`ImportNamespaceSpecifier`)throw Error(`Expected one capsule value import from ${e.fileName} in ${t.fileName}`);o.push({bindings:[],capsuleBinding:{imported:n.type===`ImportDefaultSpecifier`?`default`:uF(n.imported),local:n.local.name,logicalId:GN(t.fileName,c.source.value)},interop:`none`,namespace:``,reference:c.source.value});continue}let a=lF(`__nativeImport`,i),l=c.specifiers.map(e=>{let t={imported:e.type===`ImportNamespaceSpecifier`?null:e.type===`ImportDefaultSpecifier`?`default`:uF(e.imported),local:e.local.name,namespace:a};return s.set(t.local,t),t});o.push({bindings:l,capsuleBinding:null,interop:aF(c),namespace:a,reference:c.source.value});break}case`ExportNamedDeclaration`:qP(c,a,t.fileName);break;case`ExportDefaultDeclaration`:case`ExportAllDeclaration`:throw mF(t.fileName,`source-level ${c.type}`)}let l=lF(`__nativeDefault`,i),u=lF(`__nativeNamespace`,i),d=lF(`__nativePostfix`,i),f=new Ve({preserveExitedScopes:!0});return ze(e,{scopeTracker:f}),f.freeze(),{defaultInterop:l,exportNamesByLocal:a,imports:o,importBindingsByLocal:s,namespaceInterop:u,postfixTemp:d,program:e,scopes:f,usesPostfixTemp:GP(e,f,a)}}function zP(e,t){for(let n of t.program.body)switch(n.type){case`ImportDeclaration`:e.remove(n.start,n.end);break;case`ExportNamedDeclaration`:n.declaration?(e.remove(n.start,n.declaration.start),JP(e,n.declaration,t.exportNamesByLocal)):e.overwrite(n.start,n.end,YP(n.specifiers,t));break;case`VariableDeclaration`:XP(e,n,t.exportNamesByLocal);break;case`FunctionDeclaration`:n.id&&ZP(e,n.end,n.id.name,t.exportNamesByLocal);break;case`ClassDeclaration`:n.id&&ZP(e,n.end,n.id.name,t.exportNamesByLocal)}}function BP(e,t,n){let r=[];ze(t.program,{scopeTracker:t.scopes,enter(i,a){if(i.type===`Identifier`&&a?.type!==`ImportDeclaration`&&Ge(i,a)){let n=t.importBindingsByLocal.get(i.name),o=n?t.scopes.getDeclaration(i.name):null;if(n&&o?.type===`Import`){let t=eF(i,a,r),o=tF(n),s=t===`unbound`?`(0,${o})`:o;e.overwrite(i.start,i.end,a?.type===`Property`&&a.shorthand&&a.value===i?`${i.name}:${s}`:s)}}switch(i.type){case`ImportExpression`:if(i.options||i.phase)throw mF(n,`dynamic import options or phases`);e.overwrite(i.start,i.source.start,`globalThis.System.import(`),i.source.type===`Literal`&&typeof i.source.value==`string`&&(i.source.value.startsWith(`./`)||i.source.value.startsWith(`../`))&&e.overwrite(i.source.start,i.source.end,JSON.stringify(GN(n,i.source.value)));break;case`AssignmentExpression`:VP(e,i.left,i.start,t,n);break;case`UpdateExpression`:HP(e,i,t);break;case`ForInStatement`:case`ForOfStatement`:i.left.type!==`VariableDeclaration`&&UP(i.left,t,n)}r.push(i)},leave(){r.pop()}})}function VP(e,t,n,r,i){if(t.type===`Identifier`){let i=WP(t.name,r);i.length>0&&e.prependLeft(n,QP(i));return}UP(t,r,i)}function HP(e,t,n){if(t.argument.type!==`Identifier`)return;let r=WP(t.argument.name,n);if(r.length!==0){if(t.prefix){e.prependLeft(t.start,QP(r));return}e.prependLeft(t.start,`(${n.postfixTemp}=`),e.appendRight(t.end,`,${$P(r,t.argument.name)},${n.postfixTemp})`)}}function UP(e,t,n){let r=fF(e).filter(e=>WP(e,t).length>0);if(r.length>0)throw mF(n,`destructuring write to exported binding ${JSON.stringify(r[0])}`)}function WP(e,t){let n=t.exportNamesByLocal.get(e)??[];return n.length===0||t.scopes.getDeclaration(e)?.scope===``?n:[]}function GP(e,t,n){let r=!1;return ze(e,{scopeTracker:t,enter(e){r||e.type!==`UpdateExpression`||e.prefix||e.argument.type!==`Identifier`||(n.get(e.argument.name)??[]).length>0&&t.getDeclaration(e.argument.name)?.scope===``&&(r=!0)}}),r}function KP(e,t){let n=0;ze(t,{enter(t){pF(t)&&(n+=1),t.type===`ThisExpression`&&n===0&&e.overwrite(t.start,t.end,`void 0`)},leave(e){pF(e)&&--n}})}function qP(e,t,n){if(e.source||e.attributes.length>0||e.exportKind===`type`)throw mF(n,`re-exports, export attributes, or type-only exports`);if(e.declaration){for(let r of dF(e.declaration,n)){let e=t.get(r)??[];e.push(r),t.has(r)||t.set(r,e)}return}for(let n of e.specifiers){let e=uF(n.local),r=t.get(e)??[];r.push(uF(n.exported)),t.has(e)||t.set(e,r)}}function JP(e,t,n){switch(t.type){case`VariableDeclaration`:XP(e,t,n);break;case`FunctionDeclaration`:case`ClassDeclaration`:t.id&&ZP(e,t.end,t.id.name,n)}}function YP(e,t){return e.map(e=>{let n=uF(e.local),r=uF(e.exported),i=t.importBindingsByLocal.get(n);return i?`Object.defineProperty(exports,${JSON.stringify(r)},{enumerable:true,get:function(){return ${tF(i)}}});`:``}).join(``)}function XP(e,t,n){for(let r of t.declarations){if(r.id.type!==`Identifier`){if(fF(r.id).filter(e=>n.has(e)).length>0)throw mF(`native chunk`,`exported destructuring declaration`);continue}let t=n.get(r.id.name)??[];t.length!==0&&(r.init?e.prependLeft(r.init.start,QP(t)):e.appendRight(r.end,`=${$P(t,`void 0`)}`))}}function ZP(e,t,n,r){let i=r.get(n)??[];i.length>0&&e.appendRight(t,`;${$P(i,n)};`)}function QP(e){return e.reduce((e,t)=>`exports[${JSON.stringify(t)}]=${e}`,``)}function $P(e,t){return`${QP(e)}${t}`}function eF(e,t,n){let r=e,i=t,a=n.length-1;for(;i?.type===`ParenthesizedExpression`&&i.expression===r;)r=i,--a,i=n[a];return i?.type===`CallExpression`&&i.callee===r?`unbound`:i?.type===`NewExpression`&&i.callee===r?`plain`:i?.type===`TaggedTemplateExpression`&&i.tag===r?`unbound`:`plain`}function tF(e){return e.imported===null?e.namespace:nF(e.namespace,e.imported)}function nF(e,t){return/^[$A-Z_a-z][$\w]*$/.test(t)?`${e}.${t}`:`${e}[${JSON.stringify(t)}]`}function rF(e,t,n,r){if(!t.startsWith(`./`)&&!t.startsWith(`../`))return;let i=n[WN(e,t)];return i&&r(i).entryRole===`capsule`?i:void 0}function iF(e){return e.imports.map(t=>{if(t.capsuleBinding){let{imported:e,local:n,logicalId:r}=t.capsuleBinding;return`var ${n}=${nF(`globalThis.System.importSync(${JSON.stringify(r)})`,e)};`}let n=`require(${JSON.stringify(t.reference)})`;if(t.bindings.length===0)return`${n};`;let r=t.interop==="default"?`${e.defaultInterop}(${n})`:t.interop===`namespace`?`${e.namespaceInterop}(${n})`:n;return`var ${t.namespace}=${r};`}).join(``)}function aF(e){return e.specifiers.some(e=>e.type===`ImportNamespaceSpecifier`)?`namespace`:e.specifiers.some(e=>e.type===`ImportDefaultSpecifier`)?`default`:`none`}function oF(e){let t=new Set(e.imports.map(({interop:e})=>e));return`${t.has(`default`)?`function ${e.defaultInterop}(value){return value&&value.__esModule?value:{default:value};}`:``}${t.has(`namespace`)?`function ${e.namespaceInterop}(value){if(value&&value.__esModule)return value;var namespace={default:value};if(value!==null&&(typeof value==="object"||typeof value==="function")){for(var key in value)if(key!=="default"&&Object.prototype.hasOwnProperty.call(value,key))Object.defineProperty(namespace,key,{enumerable:true,get:function(key){return function(){return value[key]}}(key)});}return namespace;}`:``}`}function sF(e,t){if(e.phase||e.attributes.length>0||e.importKind===`type`)throw mF(t,`import phases, attributes, or type-only imports`)}function cF(e){let t=new Set;return ze(e,{enter(e){e.type===`Identifier`&&t.add(e.name)}}),t}function lF(e,t){let n=0,r=e;for(;t.has(r);)n+=1,r=`${e}${n}`;return t.add(r),r}function uF(e){return e.type===`Literal`?String(e.value):e.name}function dF(e,t){return e.type===`VariableDeclaration`?e.declarations.flatMap(({id:e})=>fF(e)):[e.id.name]}function fF(e){switch(e.type){case`Identifier`:return[e.name];case`AssignmentPattern`:return fF(e.left);case`ArrayPattern`:return e.elements.flatMap(e=>e?fF(e):[]);case`ObjectPattern`:return e.properties.flatMap(e=>e.type===`Property`?fF(e.value):fF(e.argument));case`RestElement`:return fF(e.argument);default:return[]}}function pF(e){return e.type===`FunctionDeclaration`||e.type===`FunctionExpression`||e.type===`ClassDeclaration`||e.type===`ClassExpression`}function mF(e,t){return Error(`Unsupported final Rolldown native chunk ${e}: ${t}`)}function hF(e,t){let n=e.generateMap({file:t,hires:`boundary`,includeContent:!0,source:t});return{version:n.version,file:n.file,sources:n.sources,sourcesContent:n.sourcesContent,names:n.names,mappings:n.mappings}}const gF=`moduleId`,_F=`exportBinding`;async function vF({code:e,transportChunk:t,chunks:n,classifyModule:r,getLoadMode:i,getPhysicalChunkId:a=e=>e.fileName,sourcemap:o=!0}){let s=a(t),c=yF(n,r).sort((e,t)=>e.chunk.fileName.localeCompare(t.chunk.fileName)).map(({chunk:e,kind:t})=>{let n=i(e),r=UN(e.fileName),o=a(e);if(t===`amphibious`&&n!==`sync`)throw Error(`Amphibious Mini Program module must be in the main package: ${e.fileName}`);return bF({chunkId:r,transportFileName:s,physicalChunkId:o,loadMode:n,kind:t})});return await uA(e,t.fileName,{__VPT_TRANSPORT__:pl([Fc(gF)],bc([tl(Fc(gF),[...c,SF(gF)])]))},o)}function yF(e,t){let n=[];for(let r of Object.values(e)){let e=t(r).executionKind;e!==`native`&&n.push({chunk:r,kind:e})}return n}function bF({chunkId:e,transportFileName:t,loadMode:n,kind:r,physicalChunkId:i}){let a=CF(t,i),o=Sc(n===`sync`?Fc(`require`):Wc(Fc(`require`),Fc(`async`)),[Rc(a)]),s=r===`capsule`?o:xF(o);return el(Rc(e),[Zc(s)])}function xF(e){return mc([mc([]),pl([Fc(_F)],qc([Jc(`method`,Fc(`execute`),[],bc([kc(Sc(Fc(_F),[e]))]))]))])}function SF(e){return el(null,[rl(Gc(Fc(`Error`),[gc(`+`,Rc(`Unknown System module: `),Fc(e))]))])}function CF(e,t){let r=n.posix.relative(n.posix.dirname(e),t);return r.startsWith(`.`)?r:`./${r}`}function wF({code:e,id:t,appConfig:n,sourcemap:r=!0}){return uA(e,t,{__VPT_APP_CONFIG__:OC(n)},r)}function TF({code:e,id:t,page:n,sourcemap:r=!0}){return uA(e,t,{__VPT_PAGE_PATH__:Rc(n.path),__VPT_PAGE_CONFIG__:OC(FC(n))},r)}function EF(e){let t=o(e.runtime.modules.appCapsule),n=o(e.runtime.modules.pageCapsule),r=DF(e.options.pages,e.runtime.modules),i=new Map(e.options.pages.map(e=>[e.path,e])),a=new Map([[`\0vite/preload-helper.js`,()=>e.runtime.modules.bootstrap],[`\0vpt:taro-target-runtime`,()=>e.taro.targetRuntimePath],[`\0vpt:app-component`,(t,n)=>Ce({appPath:e.options.app,projectRoot:n})],[`\0vpt:page-component`,(e,t)=>we({pagePath:kF({moduleId:e,pageByPath:i}).path,projectRoot:t})],[`\0vpt:page-capsule`,t=>{let n=kF({moduleId:t,pageByPath:i});return OF({moduleId:e.runtime.modules.pageCapsule,pagePath:n.path})}]]);return{...r,resolveId(e,t,n){return a.get(e)?.(t,n)},specialize(r,a,o=!0){let s=De(a);if(s===t)return wF({code:r,id:a,appConfig:IC(e.options),sourcemap:o});if(s===n)return TF({code:r,id:a,page:kF({moduleId:a,pageByPath:i}),sourcemap:o})}}}function DF(e,t){let n=e.map(e=>({capsuleId:OF({moduleId:t.pageCapsule,pagePath:e.path}),capsuleName:`${e.path}-capsule`,shellId:OF({moduleId:t.pageShell,pagePath:e.path}),shellName:`${e.path}.js`}));return{applicationEntryIds:[t.appCapsule,...n.map(e=>e.capsuleId)],input:Object.fromEntries([[`bootstrap`,t.bootstrap],[`transport`,t.transport],[`app.js`,t.appShell],[`app-capsule`,t.appCapsule],[`comp.js`,t.componentShell],[`component-capsule`,t.componentCapsule],[`custom-wrapper.js`,t.customWrapperShell],...n.flatMap(e=>[[e.shellName,e.shellId],[e.capsuleName,e.capsuleId]])])}}function OF({moduleId:e,pagePath:t}){return`${e}?route=${encodeURIComponent(t)}`}function kF({moduleId:e,pageByPath:t}){let n=e?.indexOf(`?`)??-1,r=n===-1?void 0:new URLSearchParams(e?.slice(n+1)).get(`route`),i=r?t.get(r):void 0;if(!i)throw Error(r?`Unknown Page capsule: ${r}`:`Page capsule import must originate from a route module`);return i}var AF;(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.FLAG13=8192]=`FLAG13`,e[e.BRANCH_LENGTH=8064]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`})(AF||={});var jF;(function(e){e[e.NUM=35]=`NUM`,e[e.SEMI=59]=`SEMI`,e[e.EQUALS=61]=`EQUALS`,e[e.ZERO=48]=`ZERO`,e[e.NINE=57]=`NINE`,e[e.LOWER_A=97]=`LOWER_A`,e[e.LOWER_F=102]=`LOWER_F`,e[e.LOWER_X=120]=`LOWER_X`,e[e.LOWER_Z=122]=`LOWER_Z`,e[e.UPPER_A=65]=`UPPER_A`,e[e.UPPER_F=70]=`UPPER_F`,e[e.UPPER_Z=90]=`UPPER_Z`})(jF||={});var MF;(function(e){e[e.EntityStart=0]=`EntityStart`,e[e.NumericStart=1]=`NumericStart`,e[e.NumericDecimal=2]=`NumericDecimal`,e[e.NumericHex=3]=`NumericHex`,e[e.NamedEntity=4]=`NamedEntity`})(MF||={});var NF;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(NF||={});var PF;(function(e){e[e.Tab=9]=`Tab`,e[e.NewLine=10]=`NewLine`,e[e.FormFeed=12]=`FormFeed`,e[e.CarriageReturn=13]=`CarriageReturn`,e[e.Space=32]=`Space`,e[e.ExclamationMark=33]=`ExclamationMark`,e[e.Number=35]=`Number`,e[e.Amp=38]=`Amp`,e[e.SingleQuote=39]=`SingleQuote`,e[e.DoubleQuote=34]=`DoubleQuote`,e[e.Dash=45]=`Dash`,e[e.Slash=47]=`Slash`,e[e.Zero=48]=`Zero`,e[e.Nine=57]=`Nine`,e[e.Semi=59]=`Semi`,e[e.Lt=60]=`Lt`,e[e.Eq=61]=`Eq`,e[e.Gt=62]=`Gt`,e[e.Questionmark=63]=`Questionmark`,e[e.UpperA=65]=`UpperA`,e[e.LowerA=97]=`LowerA`,e[e.UpperF=70]=`UpperF`,e[e.LowerF=102]=`LowerF`,e[e.UpperZ=90]=`UpperZ`,e[e.LowerZ=122]=`LowerZ`,e[e.LowerX=120]=`LowerX`,e[e.OpeningSquareBracket=91]=`OpeningSquareBracket`})(PF||={});var FF;(function(e){e[e.Text=1]=`Text`,e[e.BeforeTagName=2]=`BeforeTagName`,e[e.InTagName=3]=`InTagName`,e[e.InSelfClosingTag=4]=`InSelfClosingTag`,e[e.BeforeClosingTagName=5]=`BeforeClosingTagName`,e[e.InClosingTagName=6]=`InClosingTagName`,e[e.AfterClosingTagName=7]=`AfterClosingTagName`,e[e.BeforeAttributeName=8]=`BeforeAttributeName`,e[e.InAttributeName=9]=`InAttributeName`,e[e.AfterAttributeName=10]=`AfterAttributeName`,e[e.BeforeAttributeValue=11]=`BeforeAttributeValue`,e[e.InAttributeValueDq=12]=`InAttributeValueDq`,e[e.InAttributeValueSq=13]=`InAttributeValueSq`,e[e.InAttributeValueNq=14]=`InAttributeValueNq`,e[e.BeforeDeclaration=15]=`BeforeDeclaration`,e[e.InDeclaration=16]=`InDeclaration`,e[e.InProcessingInstruction=17]=`InProcessingInstruction`,e[e.BeforeComment=18]=`BeforeComment`,e[e.CDATASequence=19]=`CDATASequence`,e[e.DeclarationSequence=20]=`DeclarationSequence`,e[e.InSpecialComment=21]=`InSpecialComment`,e[e.InCommentLike=22]=`InCommentLike`,e[e.SpecialStartSequence=23]=`SpecialStartSequence`,e[e.InSpecialTag=24]=`InSpecialTag`,e[e.InPlainText=25]=`InPlainText`,e[e.InEntity=26]=`InEntity`})(FF||={});var IF;(function(e){e[e.NoValue=0]=`NoValue`,e[e.Unquoted=1]=`Unquoted`,e[e.Single=2]=`Single`,e[e.Double=3]=`Double`})(IF||={});const LF={Empty:new Uint8Array,Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,33,62]),Doctype:new Uint8Array([100,111,99,116,121,112,101]),IframeEnd:new Uint8Array([60,47,105,102,114,97,109,101]),NoembedEnd:new Uint8Array([60,47,110,111,101,109,98,101,100]),NoframesEnd:new Uint8Array([60,47,110,111,102,114,97,109,101,115]),Plaintext:new Uint8Array([60,47,112,108,97,105,110,116,101,120,116]),ScriptEnd:new Uint8Array([60,47,115,99,114,105,112,116]),StyleEnd:new Uint8Array([60,47,115,116,121,108,101]),TitleEnd:new Uint8Array([60,47,116,105,116,108,101]),TextareaEnd:new Uint8Array([60,47,116,101,120,116,97,114,101,97]),XmpEnd:new Uint8Array([60,47,120,109,112])};LF.IframeEnd[2],LF.IframeEnd,LF.NoembedEnd[2],LF.NoembedEnd,LF.Plaintext[2],LF.Plaintext,LF.ScriptEnd[2],LF.ScriptEnd,LF.TitleEnd[2],LF.TitleEnd,LF.XmpEnd[2],LF.XmpEnd;const{fromCodePoint:Sie}=String;var RF;(function(e){e[e.None=0]=`None`,e[e.Svg=1]=`Svg`,e[e.MathML=2]=`MathML`})(RF||={});let zF=()=>{var e=(()=>{var e=Object.defineProperty,t=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,i=(t,n)=>{for(var r in n)e(t,r,{get:n[r],enumerable:!0})},a=(i,a,o,s)=>{if(a&&typeof a==`object`||typeof a==`function`)for(let c of n(a))!r.call(i,c)&&c!==o&&e(i,c,{get:()=>a[c],enumerable:!(s=t(a,c))||s.enumerable});return i},o=t=>a(e({},`__esModule`,{value:!0}),t),s={};i(s,{default:()=>ze});var c=e=>Array.isArray(e),l=e=>typeof e==`function`,u=e=>e.length===0,d=e=>typeof e==`number`,f=e=>typeof e==`object`&&!!e,p=e=>e instanceof RegExp,m=e=>typeof e==`string`,h=e=>e===void 0,g=e=>{let t=new Map;return n=>{let r=t.get(n);if(r)return r;let i=e(n);return t.set(n,i),i}},_=(e,t,n={})=>{let r={cache:{},input:e,index:0,indexMax:0,options:n,output:[]};if(ie(t)(r)&&r.index===e.length)return r.output;throw Error(`Failed to parse at index ${r.indexMax}`)},v=(e,t)=>c(e)?y(e,t):m(e)?x(e,t):b(e,t),y=(e,t)=>{let n={};for(let t of e){if(t.length!==1)throw Error(`Invalid character: "${t}"`);let e=t.charCodeAt(0);n[e]=!0}return e=>{let r=e.index,i=e.input;for(;e.index<i.length&&i.charCodeAt(e.index)in n;)e.index+=1;let a=e.index;if(a>r){if(!h(t)&&!e.options.silent){let n=e.input.slice(r,a),o=l(t)?t(n,i,String(r)):t;h(o)||e.output.push(o)}e.indexMax=Math.max(e.indexMax,e.index)}return!0}},b=(e,t)=>{let n=e.source,r=e.flags.replace(/y|$/,`y`),i=new RegExp(n,r);return ne(e=>{i.lastIndex=e.index;let n=i.exec(e.input);if(n){if(!h(t)&&!e.options.silent){let r=l(t)?t(...n,e.input,String(e.index)):t;h(r)||e.output.push(r)}return e.index+=n[0].length,e.indexMax=Math.max(e.indexMax,e.index),!0}return!1})},x=(e,t)=>n=>{if(n.input.startsWith(e,n.index)){if(!h(t)&&!n.options.silent){let r=l(t)?t(e,n.input,String(n.index)):t;h(r)||n.output.push(r)}return n.index+=e.length,n.indexMax=Math.max(n.indexMax,n.index),!0}return!1},S=(e,t,n,r)=>{let i=ie(e);return ne(E(te(e=>{let r=0;for(;r<n;){let t=e.index;if(!i(e)||(r+=1,e.index===t))break}return r>=t})))},C=(e,t)=>S(e,0,1),w=(e,t)=>S(e,0,1/0),ee=(e,t)=>{let n=e.map(ie);return ne(E(te(e=>{for(let t=0,r=n.length;t<r;t++)if(!n[t](e))return!1;return!0})))},T=(e,t)=>{let n=e.map(ie);return ne(E(e=>{for(let t=0,r=n.length;t<r;t++)if(n[t](e))return!0;return!1}))},te=(e,t=!1)=>{let n=ie(e);return e=>{let r=e.index,i=e.output.length,a=n(e);return(!a||t)&&(e.index=r,e.output.length!==i&&(e.output.length=i)),a}},E=(e,t)=>ie(e),ne=(()=>{let e=0;return t=>{let n=ie(t),r=e+=1;return e=>{var t;if(e.options.memoization===!1)return n(e);let i=e.index,a=(t=e.cache)[r]||(t[r]=new Map),o=a.get(i);if(o===!1)return!1;if(d(o))return e.index=o,!0;if(o)return e.index=o.index,o.output?.length&&e.output.push(...o.output),!0;{let t=e.output.length;if(n(e)){let n=e.index,r=e.output.length;if(r>t){let o=e.output.slice(t,r);a.set(i,{index:n,output:o})}else a.set(i,n);return!0}return a.set(i,!1),!1}}}})(),re=e=>{let t;return n=>(t||=ie(e()),t(n))},ie=g(e=>{if(l(e))return u(e)?re(e):e;if(m(e)||p(e))return v(e);if(c(e))return ee(e);if(f(e))return T(Object.values(e));throw Error(`Invalid rule`)}),ae=`abcdefghijklmnopqrstuvwxyz`,oe=e=>{let t=``;for(;e>0;)t=ae[(e-1)%26]+t,e=Math.floor((e-1)/26);return t},se=e=>{let t=0;for(let n=0,r=e.length;n<r;n++)t=t*26+ae.indexOf(e[n])+1;return t},ce=(e,t)=>{if(t<e)return ce(t,e);let n=[];for(;e<=t;)n.push(e++);return n},le=(e,t,n)=>ce(e,t).map(e=>String(e).padStart(n,`0`)),ue=(e,t)=>ce(se(e),se(t)).map(oe),D=e=>e,de=e=>fe(t=>_(t,e,{memoization:!1}).join(``)),fe=e=>{let t={};return n=>t[n]??(t[n]=e(n))},pe=v(/^\*\*\/\*$/,`.*`),O=v(/^\*\*\/(\*)?([ a-zA-Z0-9._-]+)$/,(e,t,n)=>`.*${t?``:`(?:^|/)`}${n.replaceAll(`.`,`\\.`)}`),k=v(/^\*\*\/(\*)?([ a-zA-Z0-9._-]*)\{([ a-zA-Z0-9._-]+(?:,[ a-zA-Z0-9._-]+)*)\}$/,(e,t,n,r)=>`.*${t?``:`(?:^|/)`}${n.replaceAll(`.`,`\\.`)}(?:${r.replaceAll(`,`,`|`).replaceAll(`.`,`\\.`)})`),A=v(/\\./,D),me=v(/[$.*+?^(){}[\]\|]/,e=>`\\${e}`),he=v(/./,D),ge=T([v(/^(?:!!)*!(.*)$/,(e,t)=>`(?!^${Pe(t)}$).*?`),v(/^(!!)+/,``)]),_e=T([v(/\/(\*\*\/)+/,`(?:/.+/|/)`),v(/^(\*\*\/)+/,`(?:^|.*/)`),v(/\/(\*\*)$/,`(?:/.*|$)`),v(/\*\*/,`.*`)]),ve=T([v(/\*\/(?!\*\*\/)/,`[^/]*/`),v(/\*/,`[^/]*`)]),ye=v(`?`,`[^/]`),be=v(`[`,D),xe=v(`]`,D),j=v(/[!^]/,`^/`),Se=v(/[a-z]-[a-z]|[0-9]-[0-9]/i,D),Ce=T([A,v(/[$.*+?^(){}[\|]/,e=>`\\${e}`),Se,v(/[^\]]/,D)]),we=ee([be,C(j),w(Ce),xe]),Te=v(`{`,`(?:`),Ee=v(`}`,`)`),De=ee([Te,T([v(/(\d+)\.\.(\d+)/,(e,t,n)=>le(+t,+n,Math.min(t.length,n.length)).join(`|`)),v(/([a-z]+)\.\.([a-z]+)/,(e,t,n)=>ue(t,n).join(`|`)),v(/([A-Z]+)\.\.([A-Z]+)/,(e,t,n)=>ue(t.toLowerCase(),n.toLowerCase()).join(`|`).toUpperCase())]),Ee]),Oe=v(`{`,`(?:`),ke=v(`}`,`)`),Ae=v(`,`,`|`),je=v(/[$.*+?^(){[\]\|]/,e=>`\\${e}`),Me=v(/[^}]/,D),Ne=ee([Oe,w(T([_e,ve,ye,we,De,re(()=>Ne),A,je,Ae,Me])),ke]),Pe=de(w(T([pe,O,k,ge,_e,ve,ye,we,De,Ne,A,me,he]))),Fe=v(/\\./,D),Ie=v(/./,D),Le=de(w(T([Fe,v(/\*\*\*+/,`*`),v(/([^/{[(!])\*\*/,(e,t)=>`${t}*`),v(/(^|.)\*\*(?=[^*/)\]}])/,(e,t)=>`${t}*`),Ie]))),Re=(e,t)=>{let n=Array.isArray(e)?e:[e];if(!n.length)return!1;let r=n.map(Re.compile),i=n.every(e=>/(\/(?:\*\*)?|\[\/\])$/.test(e)),a=t.replace(/[\\\/]+/g,`/`).replace(/\/$/,i?`/`:``);return r.some(e=>e.test(a))};Re.compile=e=>RegExp(`^${Pe(Le(e))}$`,`s`);var ze=Re;return o(s)})();return e.default||e},BF;const VF=(e,t)=>(BF||(BF=zF(),zF=null),BF(e,t)),HF=/^[A-Za-z]:\//;function UF(e=``){return e&&e.replace(/\\/g,`/`).replace(HF,e=>e.toUpperCase())}const WF=/^[/\\]{2}/,GF=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/,KF=/^[A-Za-z]:$/,qF=/^\/([A-Za-z]:)?$/,JF=/.(\.[^./]+|\.)$/,YF=/^[/\\]|^[a-zA-Z]:[/\\]/,XF=function(e){if(e.length===0)return`.`;e=UF(e);let t=e.match(WF),n=tI(e),r=e[e.length-1]===`/`;return e=eI(e,!n),e.length===0?n?`/`:r?`./`:`.`:(r&&(e+=`/`),KF.test(e)&&(e+=`/`),t?n?`//${e}`:`//./${e}`:n&&!tI(e)?`/${e}`:e)},ZF=function(...e){let t=``;for(let n of e)if(n){if(t.length>0){let e=t[t.length-1]===`/`,r=n[0]===`/`;t+=e&&r?n.slice(1):e||r?n:`/${n}`}else t+=n}return XF(t)};function QF(){return typeof process<`u`&&typeof process.cwd==`function`?process.cwd().replace(/\\/g,`/`):`/`}const $F=function(...e){e=e.map(e=>UF(e));let t=``,n=!1;for(let r=e.length-1;r>=-1&&!n;r--){let i=r>=0?e[r]:QF();i&&i.length!==0&&(t=`${i}/${t}`,n=tI(i))}return t=eI(t,!n),n&&!tI(t)?`/${t}`:t.length>0?t:`.`};function eI(e,t){let n=``,r=0,i=-1,a=0,o=null;for(let s=0;s<=e.length;++s){if(s<e.length)o=e[s];else if(o===`/`)break;else o=`/`;if(o===`/`){if(i!==s-1&&a!==1){if(a===2){if(n.length<2||r!==2||n[n.length-1]!==`.`||n[n.length-2]!==`.`){if(n.length>2){let e=n.lastIndexOf(`/`);e===-1?(n=``,r=0):(n=n.slice(0,e),r=n.length-1-n.lastIndexOf(`/`)),i=s,a=0;continue}if(n.length>0){n=``,r=0,i=s,a=0;continue}}t&&(n+=n.length>0?`/..`:`..`,r=2)}else n.length>0?n+=`/${e.slice(i+1,s)}`:n=e.slice(i+1,s),r=s-i-1}i=s,a=0}else o===`.`&&a!==-1?++a:a=-1}return n}const tI=function(e){return GF.test(e)},nI=function(e){return UF(e)},rI=function(e){if(e===`..`)return``;let t=JF.exec(UF(e));return t&&t[1]||``},iI=function(e,t){let n=$F(e).replace(qF,`$1`).split(`/`),r=$F(t).replace(qF,`$1`).split(`/`);if(r[0][1]===`:`&&n[0][1]===`:`&&n[0]!==r[0])return r.join(`/`);let i=[...n];for(let e of i){if(r[0]!==e)break;n.shift(),r.shift()}return[...n.map(()=>`..`),...r].join(`/`)},aI=function(e){let t=UF(e).replace(/\/$/,``).split(`/`).slice(0,-1);return t.length===1&&KF.test(t[0])&&(t[0]+=`/`),t.join(`/`)||(tI(e)?`/`:`.`)},oI=function(e){let t=e.ext?e.ext.startsWith(`.`)?e.ext:`.${e.ext}`:``,n=[e.root,e.dir,e.base??(e.name??``)+t].filter(Boolean);return UF(e.root?$F(...n):n.join(`/`))},sI=function(e,t){let n=UF(e).split(`/`),r=``;for(let e=n.length-1;e>=0;e--){let t=n[e];if(t){r=t;break}}return t&&r.endsWith(t)?r.slice(0,-t.length):r},cI={__proto__:null,basename:sI,dirname:aI,extname:rI,format:oI,isAbsolute:tI,join:ZF,matchesGlob:(e,t)=>VF(t,XF(e)),normalize:XF,normalizeString:eI,parse:function(e){let t=YF.exec(e)?.[0]?.replace(/\\/g,`/`)||``,n=sI(e),r=rI(n);return{root:t,dir:aI(e),base:n,ext:r,name:n.slice(0,n.length-r.length)}},relative:iI,resolve:$F,sep:`/`,toNamespacedPath:nI},lI=globalThis.process?.platform===`win32`?`;`:`:`,uI={posix:void 0,win32:void 0},dI=(e=lI)=>new Proxy(cI,{get(t,n){return n===`delimiter`?e:n===`posix`?fI:n===`win32`?pI:uI[n]||cI[n]}}),fI=dI(`:`),pI=dI(`;`);var mI=A(((e,t)=>{let n=/[\t\n\f\r "#'()/;[\\\]{}]/g,r=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,i=/.[\r\n"'(/\\]/,a=/[\da-f]/i;t.exports=function(e,t={}){let o=e.css.valueOf(),s=t.ignoreErrors,c,l,u,d,f,p,m,h,g,_,v=o.length,y=0,b=[],x=[],S=-1;function C(){return y}function w(t){throw e.error(`Unclosed `+t,y)}function ee(){return x.length===0&&y>=v}function T(e){if(x.length)return x.pop();if(y>=v)return;let t=e?e.ignoreUnclosed:!1;switch(c=o.charCodeAt(y),c){case 10:case 32:case 9:case 13:case 12:d=y;do d+=1,c=o.charCodeAt(d);while(c===32||c===10||c===9||c===13||c===12);p=[`space`,o.slice(y,d)],y=d-1;break;case 91:case 93:case 123:case 125:case 58:case 59:case 41:{let e=String.fromCharCode(c);p=[e,e,y];break}case 40:if(_=b.length?b.pop()[1]:``,g=o.charCodeAt(y+1),_===`url`&&g!==39&&g!==34&&g!==32&&g!==10&&g!==9&&g!==12&&g!==13){d=y;do{if(m=!1,d=o.indexOf(`)`,d+1),d===-1){if(s||t){d=y;break}w(`bracket`)}for(h=d;o.charCodeAt(h-1)===92;)--h,m=!m}while(m);p=[`brackets`,o.slice(y,d+1),y,d],y=d}else y<=S?p=[`(`,`(`,y]:(d=o.indexOf(`)`,y+1),l=o.slice(y,d+1),d===-1||i.test(l)?(S=d===-1?v:d,p=[`(`,`(`,y]):(p=[`brackets`,l,y,d],y=d));break;case 39:case 34:f=c===39?`'`:`"`,d=y;do{if(m=!1,d=o.indexOf(f,d+1),d===-1){if(s||t){d=y+1;break}w(`string`)}for(h=d;o.charCodeAt(h-1)===92;)--h,m=!m}while(m);p=[`string`,o.slice(y,d+1),y,d],y=d;break;case 64:n.lastIndex=y+1,n.test(o),d=n.lastIndex===0?o.length-1:n.lastIndex-2,p=[`at-word`,o.slice(y,d+1),y,d],y=d;break;case 92:for(d=y,u=!0;o.charCodeAt(d+1)===92;)d+=1,u=!u;if(c=o.charCodeAt(d+1),u&&c!==47&&c!==32&&c!==10&&c!==9&&c!==13&&c!==12&&(d+=1,a.test(o.charAt(d)))){for(;a.test(o.charAt(d+1));)d+=1;o.charCodeAt(d+1)===32&&(d+=1)}p=[`word`,o.slice(y,d+1),y,d],y=d;break;default:c===47&&o.charCodeAt(y+1)===42?(d=o.indexOf(`*/`,y+2)+1,d===0&&(s||t?d=o.length:w(`comment`)),p=[`comment`,o.slice(y,d+1),y,d],y=d):(r.lastIndex=y+1,r.test(o),d=r.lastIndex===0?o.length-1:r.lastIndex-2,p=[`word`,o.slice(y,d+1),y,d],b.push(p),y=d)}return y++,p}function te(e){x.push(e)}return{back:te,endOfFile:ee,nextToken:T,position:C}}})),hI=A(((e,t)=>{let n=MA(),r=mI(),i;function a(e){i=e}let o={";":n.yellow,":":n.yellow,"(":n.cyan,")":n.cyan,"[":n.yellow,"]":n.yellow,"{":n.yellow,"}":n.yellow,"at-word":n.cyan,brackets:n.cyan,call:n.cyan,class:n.yellow,comment:n.gray,hash:n.magenta,string:n.green};function s([e,t],n){if(e===`word`){if(t[0]===`.`)return`class`;if(t[0]===`#`)return`hash`}if(!n.endOfFile()){let e=n.nextToken();if(n.back(e),e[0]===`brackets`||e[0]===`(`)return`call`}return e}function c(e){let t=r(new i(e),{ignoreErrors:!0}),n=``;for(;!t.endOfFile();){let e=t.nextToken(),r=o[s(e,t)];n+=r?e[1].split(/\r?\n/).map(e=>r(e)).join(`
|
|
20
20
|
`):e[1]}return n}c.registerInput=a,t.exports=c})),gI=A(((e,t)=>{let n=MA(),r=hI();var i=class e extends Error{constructor(t,n,r,i,a,o){super(t),this.name=`CssSyntaxError`,this.reason=t,a&&(this.file=a),i&&(this.source=i),o&&(this.plugin=o),n!==void 0&&r!==void 0&&(typeof n==`number`?(this.line=n,this.column=r):(this.line=n.line,this.column=n.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+`: `:``,this.message+=this.file?this.file:`<css input>`,this.line!==void 0&&(this.message+=`:`+this.line+`:`+this.column),this.message+=`: `+this.reason}showSourceCode(e){if(!this.source)return``;let t=this.source;e??=n.isColorSupported;let i=e=>e,a=e=>e,o=e=>e;if(e){let{bold:e,gray:t,red:s}=n.createColors(!0);a=t=>e(s(t)),i=e=>t(e),r&&(o=e=>r(e))}let s=t.split(/\r?\n/),c=Math.max(this.line-3,0),l=Math.min(this.line+2,s.length),u=String(l).length;return s.slice(c,l).map((e,t)=>{let n=c+1+t,r=` `+(` `+n).slice(-u)+` | `;if(n===this.line){if(e.length>160){let t=Math.max(0,this.column-20),n=Math.max(this.column+20,this.endColumn+20),s=e.slice(t,n),c=i(r.replace(/\d/g,` `))+e.slice(0,Math.min(this.column-1,19)).replace(/[^\t]/g,` `);return a(`>`)+i(r)+o(s)+`
|
|
21
21
|
`+c+a(`^`)}let t=i(r.replace(/\d/g,` `))+e.slice(0,this.column-1).replace(/[^\t]/g,` `);return a(`>`)+i(r)+o(e)+`
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* and ACK form one application transaction; it has no file-delivery or interpreter policy of its own.
|
|
8
8
|
*/
|
|
9
9
|
import { runtimeControlEvent, runtimeReportEvent } from './hmr-protocol.js';
|
|
10
|
+
import { polyfillQueueMicrotask } from './polyfill/polyfill-queue-microtask.js';
|
|
10
11
|
/** Shared no-op CSS contract because physical rebuilds replace styles wholesale. */
|
|
11
12
|
const hotContextInternals = Object.freeze({
|
|
12
13
|
updateStyle() { },
|
|
@@ -78,6 +79,9 @@ export class MiniHmrRuntime extends DevRuntime {
|
|
|
78
79
|
// The base has no messenger: the engine tracks per-client shipped payloads instead
|
|
79
80
|
// of executed module ids, so the Mini Program host registers the client session itself.
|
|
80
81
|
super('');
|
|
82
|
+
// Generated React Refresh boundaries need this host primitive before any application factory runs.
|
|
83
|
+
// Installing it in the shared development runtime covers every Mini target and mode without production overhead.
|
|
84
|
+
polyfillQueueMicrotask(globalThis);
|
|
81
85
|
this.connectSocket = connectSocket;
|
|
82
86
|
}
|
|
83
87
|
/**
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type QueueMicrotask = (callback: () => void) => void;
|
|
2
|
+
type QueueMicrotaskGlobal = {
|
|
3
|
+
queueMicrotask?: QueueMicrotask;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Provides the microtask primitive required by generated development React Refresh boundaries.
|
|
7
|
+
*
|
|
8
|
+
* Supported Mini Program engines provide Promise jobs but do not share a queueMicrotask baseline.
|
|
9
|
+
* Reusing one resolved Promise preserves FIFO ordering without adding core-js or production code.
|
|
10
|
+
*/
|
|
11
|
+
export declare function polyfillQueueMicrotask(runtimeGlobal: QueueMicrotaskGlobal): void;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provides the microtask primitive required by generated development React Refresh boundaries.
|
|
3
|
+
*
|
|
4
|
+
* Supported Mini Program engines provide Promise jobs but do not share a queueMicrotask baseline.
|
|
5
|
+
* Reusing one resolved Promise preserves FIFO ordering without adding core-js or production code.
|
|
6
|
+
*/
|
|
7
|
+
export function polyfillQueueMicrotask(runtimeGlobal) {
|
|
8
|
+
if (runtimeGlobal.queueMicrotask !== undefined) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
const resolvedPromise = Promise.resolve();
|
|
12
|
+
// This intentional global mutation shares one host queue between native chunks and interpreted HMR patches.
|
|
13
|
+
runtimeGlobal.queueMicrotask = (callback) => {
|
|
14
|
+
void resolvedPromise.then(callback);
|
|
15
|
+
};
|
|
16
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plugin-taro",
|
|
3
|
-
"version": "0.7.4
|
|
3
|
+
"version": "0.7.4",
|
|
4
4
|
"author": "sep2",
|
|
5
5
|
"description": "Vite 8 plugin for building one React/Taro codebase for WeChat, Alipay, and H5 targets.",
|
|
6
6
|
"type": "module",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"rolldown": "1.2.8",
|
|
66
66
|
"sval": "0.6.12",
|
|
67
67
|
"tailwindcss": "^4.3.3",
|
|
68
|
-
"vite-plugin-taro-runtime": "0.7.4
|
|
68
|
+
"vite-plugin-taro-runtime": "0.7.4"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
71
|
"react": "^19.3.0",
|