vite-plugin-taro 0.7.5-beta.0 → 0.7.5-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,15 +1,15 @@
1
- import{createRequire as e}from"node:module";import t from"@vitejs/plugin-react";import n from"node:path";import{fileURLToPath as r,pathToFileURL as i}from"node:url";import{isCSSRequest as a,normalizePath as o,rolldownVersion as s,transformWithOxc as c,version as l}from"vite";import u from"@tailwindcss/vite";import{RolldownMagicString as d,build as f}from"rolldown";import{parseSync as p}from"rolldown/utils";import{mkdirSync as m,promises as h,readdirSync as g,unlinkSync as _,writeFileSync as v}from"node:fs";import{dev as y,viteReporterPlugin as b}from"rolldown/experimental";import{createHash as x,randomUUID as S}from"node:crypto";import C,{readFile as w,readdir as ee,stat as T}from"node:fs/promises";import{parseAst as te}from"rolldown/parseAst";import{Scanner as E}from"@tailwindcss/oxide";import ne from"node:process";import{channel as D,tracingChannel as re}from"node:diagnostics_channel";import{RecursiveTemplate as ie,UnRecursiveTemplate as ae,capitalize as oe,toCamelCase as se}from"@tarojs/shared/dist/template.js";import{components as ce}from"vite-plugin-taro-runtime/plugin-platform-tt/runtime-utils";import{components as le}from"vite-plugin-taro-runtime/plugin-platform-weapp/runtime-utils";import{components as O}from"vite-plugin-taro-runtime/plugin-platform-alipay/runtime-utils";var ue=Object.create,de=Object.defineProperty,fe=Object.getOwnPropertyDescriptor,k=Object.getOwnPropertyNames,A=Object.getPrototypeOf,pe=Object.prototype.hasOwnProperty,j=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),me=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=k(t),a=0,o=i.length,s;a<o;a++)s=i[a],!pe.call(e,s)&&s!==n&&de(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=fe(t,s))||r.enumerable});return e},M=(e,t,n)=>(n=e==null?{}:ue(A(e)),me(t||!e||!e.__esModule||!pe.call(e,`default`)?de(n,`default`,{value:e,enumerable:!0}):n,e)),he=e(import.meta.url);const N=e(import.meta.url),ge=n.dirname(N.resolve(`vite-plugin-taro/package.json`)),_e={".ts":{root:`src/runtime`,extension:`.ts`},".js":{root:`dist/runtime`,extension:`.js`}}[n.extname(r(import.meta.url))];function ve(...e){return o(n.join(ge,...e))}function P(e){return ve(_e.root,`${e}${_e.extension}`)}const ye=`virtual:taro/native`;function be(e){let t=P(e===`h5`?`h5/taro-api`:`client/taro/api`),n=new Map([[`virtual:taro/api`,t],[`@tarojs/taro`,t],[`virtual:taro/components`,P(`client/taro/component`)],[ye,P(`client/taro/native`)]]);return{name:`vpt:client-taro`,enforce:`pre`,resolveId:e=>n.get(e)}}function xe({appPath:e,projectRoot:t}){return o(n.resolve(t,e))}function Se({pagePath:e,projectRoot:t}){return o(n.resolve(t,`src`,`${e}.tsx`))}function Ce(e){return Ee(Se(e))}function we(e){let t=o(e).replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return RegExp(`^${t}(?:\\?.*)?$`)}function Te(e){return o(e.replace(/\?.*$/,``))}function Ee(e){return`/@fs/${o(n.resolve(e))}`}function De(e){return{name:`vpt:conditional-directives`,enforce:`pre`,transform:{filter:{id:{include:/^[^?]*\.(?:[cm]?[jt]sx?|css|s[ac]ss|less|styl)(?:\?.*)?$/,exclude:/^[^?]*\/node_modules\//},code:`#if`},handler(t,n){if(Oe(n)&&t.includes(`#if`))return{code:ke(t,e),map:null}}}}}function Oe(e){let t=Te(e);return!t.includes(`/node_modules/`)&&/\.(?:[cm]?[jt]sx?|css|s[ac]ss|less|styl)$/.test(t)}function ke(e,t){let n=Array.from(e.matchAll(/[^\n]*(?:\n|$)/g),e=>e[0]),r=[],i=``;for(let e of n){if(!e)continue;let n=Ae(e),a=e.match(/\r?\n$/)?.[0]??``;if(!n){i+=r.every(e=>e.active)?e:a;continue}if(n.name===`ifdef`||n.name===`ifndef`){let e=r.every(e=>e.active),i=n.target.toLowerCase()===t,a=n.name===`ifdef`?i:!i;r.push({parentActive:e,matched:a,active:e&&a})}else if(n.name===`else`){let e=r.at(-1);e&&(e.active=e.parentActive&&!e.matched)}else r.pop();i+=a}return i}function Ae(e){let t=e.match(/^\s*(?:(?:\/\/)|(?:\/\*))\s*#(ifdef|ifndef|if|elif|else|endif)\b([^*\r\n]*)/);if(!t)return;let n=t[1];if(n===`if`||n===`elif`)throw Error(`vpt no longer supports #${n}; use #ifdef, #ifndef, or #else`);return{name:n,target:t[2].replace(/\*\/$/,``).trim()}}const je=`es2018`,Me=n.dirname(N.resolve(`tailwindcss/package.json`)),Ne=P(`h5/app`);function Pe(e){return typeof e==`object`&&!!e&&typeof e.type==`string`}var Fe=class{scopeTracker;enter;leave;contextEnter={skip:()=>{this._skip=!0},remove:()=>{this._remove=!0},replace:e=>{this._replacement=e}};contextLeave={remove:this.contextEnter.remove,replace:this.contextEnter.replace};_skip=!1;_remove=!1;_replacement=null;constructor(e,t){this.enter=e.enter,this.leave=e.leave,this.scopeTracker=t?.scopeTracker}replace(e,t,n,r){e&&t!==null&&(n===null?e[t]=r:e[t][n]=r)}insert(e,t,n,r){e&&t!==null&&(n===null?e[t]=r:e[t].splice(n,0,r))}remove(e,t,n){e&&t!==null&&(n===null?delete e[t]:e[t].splice(n,1))}},Ie=class extends Fe{constructor(e,t){super(e,t)}traverse(e,t,n,r){let i={key:null,index:n??null,ast:e},a=this.scopeTracker,o=this.enter,s=this.leave,c=this.contextEnter,l=this.contextLeave,u=(e,t,n,r,d)=>{a&&a.processNodeEnter(e);let f=e,p=!1,m=!1,h=d;if(o&&!d){let s=this._skip,l=this._remove,u=this._replacement;this._skip=!1,this._remove=!1,this._replacement=null,i.key=n,i.index=r,o.call(c,e,t,i),this._replacement&&!this._remove&&(f=this._replacement,m=!0,this.replace(t,n,r,this._replacement),a&&a.processNodeEnter(f)),this._remove&&(p=!0,f=null,this.remove(t,n,r)),this._skip&&(h=!0),this._skip=s,this._remove=l,this._replacement=u}if((!h||a)&&f)for(let e in f){if(e===`type`||e===`start`||e===`end`)continue;let t=f[e];if(t&&typeof t==`object`){if(Array.isArray(t))for(let n=0;n<t.length;n++){let r=t[n];Pe(r)&&u(r,f,e,n,h)===null&&n--}else typeof t.type==`string`&&u(t,f,e,null,h)}}if(a&&(m&&a.processNodeLeave(f),a.processNodeLeave(e)),s&&!d){let a=this._replacement,o=this._remove;this._replacement=null,this._remove=!1,i.key=n,i.index=r,s.call(l,e,t,i),this._replacement&&!this._remove&&(f=this._replacement,p?this.insert(t,n,r,this._replacement):this.replace(t,n,r,this._replacement)),this._remove&&(f=null,this.remove(t,n,r)),this._replacement=a,this._remove=o}return f};if(!Pe(e))return null;if(a&&a.onWalkStart(e),a&&!o&&!s){let t=e=>{a.processNodeEnter(e);for(let n in e){if(n===`type`||n===`start`||n===`end`)continue;let r=e[n];if(r&&typeof r==`object`){if(Array.isArray(r))for(let e=0;e<r.length;e++){let n=r[e];Pe(n)&&t(n)}else typeof r.type==`string`&&t(r)}}a.processNodeLeave(e)};return t(e),e}return u(e,r??null,t??null,n??null,!1)}};function Le(e,t){return new Ie({enter:t.enter,leave:t.leave},{scopeTracker:t.scopeTracker}).traverse(e)}const Re=new Set(`Program.BlockStatement.StaticBlock.TSModuleBlock.FunctionDeclaration.FunctionExpression.ArrowFunctionExpression.VariableDeclaration.ClassDeclaration.ClassExpression.ImportDeclaration.TSEnumDeclaration.TSModuleDeclaration.TSImportEqualsDeclaration.TSDeclareFunction.TSInterfaceDeclaration.TSTypeAliasDeclaration.TSTypeParameter.TSMappedType.TSEnumBody.TSMethodSignature.TSCallSignatureDeclaration.TSConstructSignatureDeclaration.TSFunctionType.TSConstructorType.TSConditionalType.CatchClause.ForStatement.ForOfStatement.ForInStatement.SwitchStatement`.split(`.`));var ze=class{scopeIndexStack=[];scopeKeyStack=[];scopeOwnerStack=[];scopeIndexKey=``;scopes=new Map;typeScopes=new Map;implicitArguments=new WeakMap;options;isFrozen=!1;constructor(e={}){this.options=e}onWalkStart=e=>{this.scopeIndexStack.length===0&&e.type!==`Program`&&this.scopeIndexStack.push(0)};pushScope(e){let t=this.scopeIndexStack[this.scopeIndexStack.length-1];this.scopeKeyStack.push(this.scopeIndexKey),this.scopeOwnerStack.push(e),this.scopeIndexStack.push(0),t!==void 0&&(this.scopeIndexKey=this.scopeIndexKey?`${this.scopeIndexKey}-${t}`:`${t}`)}popScope(){this.scopeOwnerStack.pop(),this.scopeIndexStack.pop(),this.scopeIndexStack[this.scopeIndexStack.length-1]!==void 0&&this.scopeIndexStack[this.scopeIndexStack.length-1]++,this.options.preserveExitedScopes||(this.scopes.delete(this.scopeIndexKey),this.typeScopes.delete(this.scopeIndexKey)),this.scopeIndexKey=this.scopeKeyStack.pop()??``}getScopeKeyAt(e){return e===this.scopeKeyStack.length-1?this.scopeIndexKey:this.scopeKeyStack[e+1]}getVarScopeKey(){let e=this.scopeOwnerStack;for(let t=e.length-1;t>=0;t--)switch(e[t].type){case`FunctionDeclaration`:case`FunctionExpression`:case`ArrowFunctionExpression`:case`TSDeclareFunction`:case`Program`:case`StaticBlock`:case`TSModuleBlock`:return this.getScopeKeyAt(t)}return``}declareInNamespace(e,t,n){let r=e.get(n.scope);r||(r=new Map,e.set(n.scope,r)),r.set(t,n)}declareIdentifier(e,t,n={value:!0}){this.isFrozen||(n.value&&this.declareInNamespace(this.scopes,e,t),n.type&&this.declareInNamespace(this.typeScopes,e,t))}declareFunctionParameter(e,t){if(this.isFrozen)return;let n=Be(e);for(let e of n)this.declareIdentifier(e.name,new qe(e,this.scopeIndexKey,t))}declarePattern(e,t){if(this.isFrozen)return;let n=t.type===`VariableDeclaration`&&t.kind===`var`?this.getVarScopeKey():this.scopeIndexKey,r=Be(e);for(let e of r)this.declareIdentifier(e.name,t.type===`VariableDeclaration`?new Xe(e,n,t):t.type===`CatchClause`?new Qe(e,n,t):new qe(e,n,t))}processNodeEnter=e=>{if(Re.has(e.type))switch(e.type){case`Program`:case`BlockStatement`:case`StaticBlock`:case`SwitchStatement`:case`TSModuleBlock`:case`TSMethodSignature`:case`TSCallSignatureDeclaration`:case`TSConstructSignatureDeclaration`:case`TSFunctionType`:case`TSConstructorType`:case`TSConditionalType`:this.pushScope(e);break;case`FunctionDeclaration`:e.id?.name&&this.declareIdentifier(e.id.name,new Je(e,this.scopeIndexKey)),this.pushScope(e);for(let t of e.params)this.declareFunctionParameter(t,e);break;case`FunctionExpression`:this.pushScope(e),e.id?.name&&this.declareIdentifier(e.id.name,new Je(e,this.scopeIndexKey)),this.pushScope(e);for(let t of e.params)this.declareFunctionParameter(t,e);break;case`ArrowFunctionExpression`:this.pushScope(e);for(let t of e.params)this.declareFunctionParameter(t,e);break;case`VariableDeclaration`:for(let t of e.declarations)this.declarePattern(t.id,e);break;case`ClassDeclaration`:e.id?.name&&this.declareIdentifier(e.id.name,new Ke(e.id,this.scopeIndexKey),{value:!0,type:!0}),e.typeParameters&&this.pushScope(e);break;case`ClassExpression`:this.pushScope(e),e.id?.name&&this.declareIdentifier(e.id.name,new Ke(e.id,this.scopeIndexKey),{value:!0,type:!0});break;case`ImportDeclaration`:for(let t of e.specifiers){let n=e.importKind===`type`||t.type===`ImportSpecifier`&&t.importKind===`type`;this.declareIdentifier(t.local.name,new Ze(t,this.scopeIndexKey,e),{value:!n,type:!0})}break;case`TSEnumDeclaration`:case`TSModuleDeclaration`:case`TSImportEqualsDeclaration`:if(e.type===`TSModuleDeclaration`&&e.kind===`global`)break;e.id?.type===`Identifier`&&e.id.name&&this.declareIdentifier(e.id.name,new Ke(e.id,this.scopeIndexKey),{value:!0,type:!0});break;case`TSDeclareFunction`:e.id?.name&&this.declareIdentifier(e.id.name,new Ke(e.id,this.scopeIndexKey)),this.pushScope(e);break;case`TSInterfaceDeclaration`:case`TSTypeAliasDeclaration`:e.id?.name&&this.declareIdentifier(e.id.name,new Ke(e.id,this.scopeIndexKey),{type:!0}),this.pushScope(e);break;case`TSTypeParameter`:e.name?.name&&this.declareIdentifier(e.name.name,new Ke(e.name,this.scopeIndexKey),{type:!0});break;case`TSMappedType`:this.pushScope(e),this.declareIdentifier(e.key.name,new Ke(e.key,this.scopeIndexKey),{type:!0});break;case`TSEnumBody`:this.pushScope(e);for(let t of e.members)t.id.type===`Identifier`&&this.declareIdentifier(t.id.name,new Ke(t.id,this.scopeIndexKey));break;case`CatchClause`:this.pushScope(e),e.param&&this.declarePattern(e.param,e);break;case`ForStatement`:case`ForOfStatement`:case`ForInStatement`:if(this.pushScope(e),e.type===`ForStatement`&&e.init?.type===`VariableDeclaration`)for(let t of e.init.declarations)this.declarePattern(t.id,e.init);else if((e.type===`ForOfStatement`||e.type===`ForInStatement`)&&e.left.type===`VariableDeclaration`)for(let t of e.left.declarations)this.declarePattern(t.id,e.left)}};processNodeLeave=e=>{let t=this.scopeOwnerStack;for(;t.length>0&&t[t.length-1]===e;)this.popScope()};getDeclarationIn(e,t){let n=this.scopeIndexKey;for(;;){let r=e.get(n)?.get(t);if(r)return r;if(!n)return null;let i=n.lastIndexOf(`-`);n=i===-1?``:n.slice(0,i)}}isDeclared(e,t){return this.getDeclaration(e,t)!==null}getDeclaration(e,t){let n=t?.mode??`value`,r=(n===`type`?null:this.getDeclarationIn(this.scopes,e))??(n===`value`?null:this.getDeclarationIn(this.typeScopes,e));if(e===`arguments`&&n!==`type`){let e=this.scopeOwnerStack;for(let t=e.length-1;t>=0;t--){let n=e[t];if(n.type===`FunctionDeclaration`||n.type===`FunctionExpression`){let e=this.getScopeKeyAt(t);if(!r||We(e,r.scope)){let t=this.implicitArguments.get(n);return t||(t=new Ye(n,e),this.implicitArguments.set(n,t)),t}break}}}return r}getCurrentScope(){return this.scopeIndexKey}isCurrentScopeUnder(e){return We(this.scopeIndexKey,e)}freeze(){this.isFrozen=!0,this.scopeIndexStack=[],this.scopeKeyStack=[],this.scopeOwnerStack=[],this.scopeIndexKey=``}};function Be(e){let t=[];function n(e){switch(e.type){case`Identifier`:t.push(e);break;case`AssignmentPattern`:n(e.left);break;case`RestElement`:n(e.argument);break;case`TSParameterProperty`:n(e.parameter);break;case`ArrayPattern`:for(let t of e.elements)t&&n(t.type===`RestElement`?t.argument:t);break;case`ObjectPattern`:for(let t of e.properties)n(t.type===`RestElement`?t.argument:t.value)}}return n(e),t}function Ve(e,t){switch(e.type){case`Identifier`:return e===t;case`AssignmentPattern`:return Ve(e.left,t);case`RestElement`:return Ve(e.argument,t);case`TSParameterProperty`:return Ve(e.parameter,t);case`ArrayPattern`:for(let n of e.elements)if(n&&Ve(n.type===`RestElement`?n.argument:n,t))return!0;return!1;case`ObjectPattern`:for(let n of e.properties)if(Ve(n.type===`RestElement`?n.argument:n.value,t))return!0;return!1}return!1}function He(e,t){if(!t||e.type!==`Identifier`)return!1;switch(t.type){case`FunctionDeclaration`:case`FunctionExpression`:case`ArrowFunctionExpression`:case`TSDeclareFunction`:case`TSEmptyBodyFunctionExpression`:if(t.type!==`ArrowFunctionExpression`&&t.id===e)return!0;for(let n of t.params)if(Ve(n,e))return!0;return!1;case`ClassDeclaration`:case`ClassExpression`:return t.id===e;case`VariableDeclarator`:return Ve(t.id,e);case`CatchClause`:return t.param?Ve(t.param,e):!1;case`ImportSpecifier`:return t.local===e;case`ImportDefaultSpecifier`:case`ImportNamespaceSpecifier`:return!0;case`TSEnumDeclaration`:case`TSModuleDeclaration`:return t.id===e;case`TSImportEqualsDeclaration`:return t.id===e;case`TSParameterProperty`:return Ve(t.parameter,e)}return!1}function Ue(e,t,n){if(!t)return!1;let r=n?.mode??`value`;if(e.type===`JSXIdentifier`){if(r===`type`)return!1;switch(t.type){case`JSXOpeningElement`:case`JSXClosingElement`:return t.name===e&&!/^[a-z]/.test(e.name);case`JSXMemberExpression`:return t.object===e;case`JSXAttribute`:case`JSXNamespacedName`:return!1}return!1}if(e.type!==`Identifier`||He(e,t))return!1;switch(t.type){case`MemberExpression`:return r!==`type`&&(t.object===e||t.computed);case`Property`:return r!==`type`&&(t.value===e||t.computed);case`MethodDefinition`:case`PropertyDefinition`:case`AccessorProperty`:case`TSAbstractMethodDefinition`:case`TSAbstractPropertyDefinition`:case`TSAbstractAccessorProperty`:return r!==`type`&&(t.value===e||t.computed);case`ExportSpecifier`:return r!==`type`&&t.local===e;case`ExportAllDeclaration`:return!1;case`ImportSpecifier`:return!1;case`LabeledStatement`:case`BreakStatement`:case`ContinueStatement`:return!1;case`MetaProperty`:return!1;case`ImportAttribute`:return!1;case`TSEnumMember`:return r!==`type`&&t.id!==e;case`TSMappedType`:return!1;case`TSTypeReference`:return r!==`value`;case`TSQualifiedName`:return r!==`value`&&t.left===e;case`TSClassImplements`:case`TSInterfaceHeritage`:return r!==`value`&&t.expression===e;case`TSTypeParameter`:case`TSInterfaceDeclaration`:case`TSTypeAliasDeclaration`:case`TSPropertySignature`:case`TSMethodSignature`:case`TSIndexSignature`:return!1;case`TSFunctionType`:case`TSConstructorType`:case`TSCallSignatureDeclaration`:case`TSConstructSignatureDeclaration`:return!1}return r!==`type`}function We(e,t){return e.length>t.length&&e.startsWith(t)&&(t===``||e[t.length]===`-`)}var Ge=class{scope;node;constructor(e,t){this.node=e,this.scope=t}isUnderScope(e){return We(this.scope,e)}},Ke=class extends Ge{type=`Identifier`;get start(){return this.node.start}get end(){return this.node.end}},qe=class extends Ge{type=`FunctionParam`;fnNode;constructor(e,t,n){super(e,t),this.fnNode=n}get start(){return this.fnNode.start}get end(){return this.fnNode.end}},Je=class extends Ge{type=`Function`;get start(){return this.node.start}get end(){return this.node.end}},Ye=class extends Ge{type=`FunctionArguments`;get start(){return this.node.start}get end(){return this.node.end}},Xe=class extends Ge{type=`Variable`;variableNode;constructor(e,t,n){super(e,t),this.variableNode=n}get start(){return this.variableNode.start}get end(){return this.variableNode.end}},Ze=class extends Ge{type=`Import`;importNode;constructor(e,t,n){super(e,t),this.importNode=n}get start(){return this.importNode.start}get end(){return this.importNode.end}},Qe=class extends Ge{type=`CatchParam`;catchNode;constructor(e,t,n){super(e,t),this.catchNode=n}get start(){return this.catchNode.start}get end(){return this.catchNode.end}};function $e({code:e,filename:t,sourcemap:n,createVisitor:r}){let i=new d(e,{filename:t}),a=p(t,e);if(a.errors.length>0){let e=a.errors.map(e=>e.message).join(`; `);throw Error(`Failed to parse ${t} with Oxc: ${e}`)}Le(a.program,{enter:r(i)});let o=n?i.generateMap({file:t,hires:`boundary`,includeContent:!0,source:t}):null;return{code:i.toString(),map:o?{version:o.version,file:o.file,sources:o.sources,sourcesContent:o.sourcesContent,names:o.names,mappings:o.mappings}:null}}const et=e(N.resolve(`vite-plugin-taro-runtime/components`)).resolve(`@stencil/core/internal/client`),tt=o(et);function nt(){return{name:`vpt:h5-stencil-client`,transform:{filter:{id:we(et)},handler:rt}}}function rt(e,t){if(Te(t)===tt)return $e({code:e,filename:t,sourcemap:!0,createVisitor:it})}function it(e){return function(t){if(t.type!==`CallExpression`||t.callee.type!==`MemberExpression`||t.callee.computed||t.callee.object.type!==`Identifier`||t.callee.object.name!==`styleContainerNode`||t.callee.property.type!==`Identifier`||t.callee.property.name!==`insertBefore`)return;let[n,r]=t.arguments;if(t.arguments.length!==2||n?.type!==`Identifier`||n.name!==`styleElm`||r?.type!==`CallExpression`||r.callee.type!==`MemberExpression`||r.callee.computed||r.callee.object.type!==`Identifier`||r.callee.object.name!==`styleContainerNode`||r.callee.property.type!==`Identifier`||r.callee.property.name!==`querySelector`)return;let[i]=r.arguments;i?.type===`Literal`&&i.value===`link`&&e.overwrite(r.start,r.end,`scopeId.startsWith("sc-taro-") ? styleContainerNode.querySelector("style,link[rel=\\"stylesheet\\"]") : styleContainerNode.querySelector("link")`)}}function at(e){return e.config??{}}function ot(e){let{subPackages:t,subpackages:n,...r}=e.appJson;return{...r,pages:e.pages.map(e=>e.path)}}function st(e,t){let n=e.split(t).length-1;if(n!==1)throw Error(`Expected one placeholder ${t}, found ${n}`)}function ct(e,t,n,r){let i=new d(e,{filename:t});for(let[t,r]of Object.entries(n)){st(e,t);let n=e.indexOf(t);i.overwrite(n,n+t.length,r)}return{code:i.toString(),map:r?lt(i,t):null}}function lt(e,t){let n=e.generateMap({file:t,source:t,includeContent:!0,hires:`boundary`});return{version:n.version,file:n.file,sources:n.sources,sourcesContent:n.sourcesContent,names:n.names,mappings:n.mappings}}function ut({code:e,id:t,options:n,projectRoot:r,sourcemap:i}){return ct(e,t,{__VPT_H5_APP_CONFIG__:JSON.stringify({router:{},...ot(n)}),__VPT_H5_ROUTES__:`[${n.pages.map(e=>dt(e,r)).join(`,`)}]`},i??!0)}function dt(e,t){let n=JSON.stringify(Ce({pagePath:e.path,projectRoot:t}));return`{path:${JSON.stringify(e.path)},load:async function(context,params){const page=await import(${n});return [page,context,params]},...${JSON.stringify(at(e))}}`}function ft(e){return{resolveId({id:t,projectRoot:n}){if(t===`\0vpt:app-component`)return xe({appPath:e.app,projectRoot:n})},transform({code:t,id:n,projectRoot:r,sourcemap:i=!0}){if(Te(n)===o(Ne))return ut({code:t,id:n,options:e,projectRoot:r,sourcemap:i})}}}function pt(e){return[...u({optimize:!1}),nt(),mt(e)]}function mt(e){let t=ft(e);return{name:`vpt:h5`,config(){return{define:vt(),resolve:{mainFields:[`main:h5`,`browser`,`module`,`jsnext:main`,`jsnext`],alias:[{find:/^tailwindcss(?=\/|$)/,replacement:Me},{find:/^(?:@tarojs\/plugin-platform-h5\/dist|vite-plugin-taro-runtime\/plugin-platform-h5)\/runtime\/apis$/,replacement:N.resolve(`vite-plugin-taro-runtime/plugin-platform-h5/runtime/apis`)},{find:/^(?:@tarojs\/plugin-platform-h5\/dist|vite-plugin-taro-runtime\/plugin-platform-h5)\/definition\.json$/,replacement:N.resolve(`vite-plugin-taro-runtime/plugin-platform-h5/definition.json`)},{find:/^(?:@tarojs\/plugin-framework-react\/dist|vite-plugin-taro-runtime\/plugin-framework-react)\/runtime$/,replacement:N.resolve(`vite-plugin-taro-runtime/plugin-framework-react/runtime`)},{find:/^(?:@tarojs\/runtime|vite-plugin-taro-runtime\/runtime\/h5)$/,replacement:N.resolve(`vite-plugin-taro-runtime/runtime/h5`)},{find:/^(?:@tarojs|vite-plugin-taro-runtime)\/api$/,replacement:N.resolve(`vite-plugin-taro-runtime/api`)},{find:/^(?:@tarojs|vite-plugin-taro-runtime)\/taro-h5\/dist\/api\/taro$/,replacement:N.resolve(`vite-plugin-taro-runtime/taro-h5/dist/api/taro`)},{find:/^(?:@tarojs|vite-plugin-taro-runtime)\/taro-h5\/dist\/api\/index$/,replacement:N.resolve(`vite-plugin-taro-runtime/taro-h5/dist/api/index`)},{find:/^(?:@tarojs|vite-plugin-taro-runtime)\/components\/global\.css$/,replacement:N.resolve(`vite-plugin-taro-runtime/components/global.css`)},{find:/^(?:@tarojs|vite-plugin-taro-runtime)\/components\/dist\/taro-components\/taro-components\.css$/,replacement:N.resolve(`vite-plugin-taro-runtime/components/dist/taro-components/taro-components.css`)},{find:/^(?:@tarojs|vite-plugin-taro-runtime)\/router$/,replacement:N.resolve(`vite-plugin-taro-runtime/router`)},{find:/^(?:@tarojs|vite-plugin-taro-runtime)\/components$/,replacement:N.resolve(`vite-plugin-taro-runtime/components`)},{find:/^(?:@tarojs|vite-plugin-taro-runtime)\/components\/dist\/components$/,replacement:N.resolve(`vite-plugin-taro-runtime/components/dist/components`)}]},optimizeDeps:{include:[`vite-plugin-taro-runtime/plugin-platform-h5/runtime/apis`,`vite-plugin-taro-runtime/plugin-framework-react/runtime`,`vite-plugin-taro-runtime/router`,`vite-plugin-taro-runtime/runtime/h5`,`react-dom/client`],rolldownOptions:{plugins:[gt(),nt()]}},build:{target:je}}},resolveId:{order:`pre`,handler(e){return t.resolveId({id:e,projectRoot:this.environment.config.root})}},transform:{order:`pre`,filter:{id:we(Ne)},handler(e,n){return t.transform({code:e,id:n,projectRoot:this.environment.config.root,sourcemap:!!this.environment.config.build.sourcemap})}},transformIndexHtml:{order:`pre`,handler(){return ht()}}}}function ht(){return[{tag:`script`,attrs:{type:`module`},children:`import '${Ee(Ne)}'`,injectTo:`body`}]}function gt(){return{name:`vpt:h5-optimizer-taro`,resolveId:_t}}function _t(e){if(e===`@tarojs/taro`)return N.resolve(`vite-plugin-taro-runtime/plugin-platform-h5/runtime/apis`)}function vt(){return{"process.env.FRAMEWORK":JSON.stringify(`react`),"process.env.SUPPORT_TARO_POLYFILL":JSON.stringify(`disabled`),"process.env.TARO_ENV":JSON.stringify(`h5`),"process.env.TARO_PLATFORM":JSON.stringify(`web`),"process.env.SUPPORT_DINGTALK_NAVIGATE":JSON.stringify(`disabled`),DEPRECATED_ADAPTER_COMPONENT:`false`}}function yt(e){m(e,{recursive:!0});for(let t of g(e,{recursive:!0,withFileTypes:!0})){let e=n.resolve(t.parentPath,t.name);t.isDirectory()||_(e)}}function bt(e,t={}){let{cache:n=new Map,getCacheKey:r}=t,i=function(t){let i=r?r(t):t;if(n.has(i))return n.get(i);let a=e.call(this,t);return n.set(i,a),a};return i.cache=n,i}const xt=N.resolve(`vite-plugin-taro-runtime/runtime/mini`),St=`\0rolldown/runtime.js`,Ct=`\0vpt:global-binding`,wt=`\0vpt:mini-polyfills`,Tt=[n.resolve(n.dirname(xt),`../..`),...[`react`,`react-dom`].map(e=>n.dirname(N.resolve(`${e}/package.json`)))].map(e=>`${o(e)}/`),Et=`${o(n.dirname(N.resolve(`core-js/package.json`)))}/`,Dt=RegExp(`^${Et.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}`);function Ot(e){let t=o(e);return t===`\0vpt:mini-polyfills`||t===`\0vpt:global-binding`||t.startsWith(Et)}function kt(e){let t=o(e);return Tt.some(e=>t.startsWith(e))}function At(e){let t=new Map([[e.appShell,`shell`],[e.componentShell,`shell`],[e.customWrapperShell,`shell`],[e.pageShell,`shell`],[e.appCapsule,`capsule`],[e.componentCapsule,`capsule`],[e.pageCapsule,`capsule`],[e.bootstrap,`amphibious`],[Ct,`amphibious`],[wt,`amphibious`],[St,`amphibious`],[e.transport,`transport`]]);return e=>{let n=!1,r=!1,i=!1,a=!1;for(let o of e.moduleIds){let e=Te(o);switch(t.get(e)){case`shell`:n=!0;break;case`capsule`:r=!0;break;case`amphibious`:i=!0;break;case`transport`:a=!0}}if(n&&r)throw Error(`Mini Program chunk mixes shell and capsule entries: ${e.moduleIds.join(`, `)}`);let o=n?`shell`:r?`capsule`:void 0;return{entryRole:o,executionKind:i?`amphibious`:o===`shell`||a?`native`:`capsule`,isTransport:a}}}var jt=j(((e,t)=>{let n=process||{},r=n.argv||[],i=n.env||{},a=!(i.NO_COLOR||r.includes(`--no-color`))&&(!!i.FORCE_COLOR||r.includes(`--color`)||n.platform===`win32`||(n.stdout||{}).isTTY&&i.TERM!==`dumb`||!!i.CI),o=(e,t,n=e)=>r=>{let i=``+r,a=i.indexOf(t,e.length);return~a?e+s(i,t,n,a)+t:e+i+t},s=(e,t,n,r)=>{let i=``,a=0;do i+=e.substring(a,r)+n,a=r+t.length,r=e.indexOf(t,a);while(~r);return i+e.substring(a)},c=(e=a)=>{let t=e?o:()=>String;return{isColorSupported:e,reset:t(`\x1B[0m`,`\x1B[0m`),bold:t(`\x1B[1m`,`\x1B[22m`,`\x1B[22m\x1B[1m`),dim:t(`\x1B[2m`,`\x1B[22m`,`\x1B[22m\x1B[2m`),italic:t(`\x1B[3m`,`\x1B[23m`),underline:t(`\x1B[4m`,`\x1B[24m`),inverse:t(`\x1B[7m`,`\x1B[27m`),hidden:t(`\x1B[8m`,`\x1B[28m`),strikethrough:t(`\x1B[9m`,`\x1B[29m`),black:t(`\x1B[30m`,`\x1B[39m`),red:t(`\x1B[31m`,`\x1B[39m`),green:t(`\x1B[32m`,`\x1B[39m`),yellow:t(`\x1B[33m`,`\x1B[39m`),blue:t(`\x1B[34m`,`\x1B[39m`),magenta:t(`\x1B[35m`,`\x1B[39m`),cyan:t(`\x1B[36m`,`\x1B[39m`),white:t(`\x1B[37m`,`\x1B[39m`),gray:t(`\x1B[90m`,`\x1B[39m`),bgBlack:t(`\x1B[40m`,`\x1B[49m`),bgRed:t(`\x1B[41m`,`\x1B[49m`),bgGreen:t(`\x1B[42m`,`\x1B[49m`),bgYellow:t(`\x1B[43m`,`\x1B[49m`),bgBlue:t(`\x1B[44m`,`\x1B[49m`),bgMagenta:t(`\x1B[45m`,`\x1B[49m`),bgCyan:t(`\x1B[46m`,`\x1B[49m`),bgWhite:t(`\x1B[47m`,`\x1B[49m`),blackBright:t(`\x1B[90m`,`\x1B[39m`),redBright:t(`\x1B[91m`,`\x1B[39m`),greenBright:t(`\x1B[92m`,`\x1B[39m`),yellowBright:t(`\x1B[93m`,`\x1B[39m`),blueBright:t(`\x1B[94m`,`\x1B[39m`),magentaBright:t(`\x1B[95m`,`\x1B[39m`),cyanBright:t(`\x1B[96m`,`\x1B[39m`),whiteBright:t(`\x1B[97m`,`\x1B[39m`),bgBlackBright:t(`\x1B[100m`,`\x1B[49m`),bgRedBright:t(`\x1B[101m`,`\x1B[49m`),bgGreenBright:t(`\x1B[102m`,`\x1B[49m`),bgYellowBright:t(`\x1B[103m`,`\x1B[49m`),bgBlueBright:t(`\x1B[104m`,`\x1B[49m`),bgMagentaBright:t(`\x1B[105m`,`\x1B[49m`),bgCyanBright:t(`\x1B[106m`,`\x1B[49m`),bgWhiteBright:t(`\x1B[107m`,`\x1B[49m`)}};t.exports=c(),t.exports.createColors=c}));function Mt(e){return typeof e==`function`}function Nt(e){let t=e(e=>{Error.call(e),e.stack=Error().stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}const Pt=Nt(e=>function(t){e(this),this.message=t?`${t.length} errors occurred during unsubscription:
1
+ import{createRequire as e}from"node:module";import t from"@vitejs/plugin-react";import n from"node:path";import{fileURLToPath as r,pathToFileURL as i}from"node:url";import{isCSSRequest as a,normalizePath as o,rolldownVersion as s,transformWithOxc as c,version as l}from"vite";import u from"@tailwindcss/vite";import{RolldownMagicString as d,build as f}from"rolldown";import{parseSync as p}from"rolldown/utils";import{mkdirSync as m,promises as h,readdirSync as g,unlinkSync as _,writeFileSync as v}from"node:fs";import{dev as y,viteReporterPlugin as b}from"rolldown/experimental";import{createHash as x,randomUUID as S}from"node:crypto";import C,{readFile as w,readdir as ee,stat as T}from"node:fs/promises";import{parseAst as te}from"rolldown/parseAst";import{Scanner as E}from"@tailwindcss/oxide";import ne from"node:process";import{channel as D,tracingChannel as re}from"node:diagnostics_channel";import{RecursiveTemplate as ie,UnRecursiveTemplate as ae,capitalize as oe,toCamelCase as se}from"@tarojs/shared/dist/template.js";import{components as ce}from"vite-plugin-taro-runtime/plugin-platform-tt/runtime-utils";import{components as le}from"vite-plugin-taro-runtime/plugin-platform-weapp/runtime-utils";import{components as O}from"vite-plugin-taro-runtime/plugin-platform-alipay/runtime-utils";var ue=Object.create,de=Object.defineProperty,fe=Object.getOwnPropertyDescriptor,k=Object.getOwnPropertyNames,A=Object.getPrototypeOf,pe=Object.prototype.hasOwnProperty,j=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),me=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=k(t),a=0,o=i.length,s;a<o;a++)s=i[a],!pe.call(e,s)&&s!==n&&de(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=fe(t,s))||r.enumerable});return e},M=(e,t,n)=>(n=e==null?{}:ue(A(e)),me(t||!e||!e.__esModule||!pe.call(e,`default`)?de(n,`default`,{value:e,enumerable:!0}):n,e)),he=e(import.meta.url);const N=e(import.meta.url),ge=n.dirname(N.resolve(`vite-plugin-taro/package.json`)),_e={".ts":{root:`src/runtime`,extension:`.ts`},".js":{root:`dist/runtime`,extension:`.js`}}[n.extname(r(import.meta.url))];function ve(...e){return o(n.join(ge,...e))}function P(e){return ve(_e.root,`${e}${_e.extension}`)}const ye=`virtual:taro/native`;function be(e){let t=P(e===`h5`?`h5/taro-api`:`client/taro/api`),n=new Map([[`virtual:taro/api`,t],[`@tarojs/taro`,t],[`virtual:taro/components`,P(`client/taro/component`)],[ye,P(`client/taro/native`)]]);return{name:`vpt:client-taro`,enforce:`pre`,resolveId:e=>n.get(e)}}function xe({appPath:e,projectRoot:t}){return o(n.resolve(t,e))}function Se({pagePath:e,projectRoot:t}){return o(n.resolve(t,`src`,`${e}.tsx`))}function Ce(e){return Ee(Se(e))}function we(e){let t=o(e).replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return RegExp(`^${t}(?:\\?.*)?$`)}function Te(e){return o(e.replace(/\?.*$/,``))}function Ee(e){return`/@fs/${o(n.resolve(e))}`}function De(e){return{name:`vpt:conditional-directives`,enforce:`pre`,transform:{filter:{id:{include:/^[^?]*\.(?:[cm]?[jt]sx?|css|s[ac]ss|less|styl)(?:\?.*)?$/,exclude:/^[^?]*\/node_modules\//},code:`#if`},handler(t,n){if(Oe(n)&&t.includes(`#if`))return{code:ke(t,e),map:null}}}}}function Oe(e){let t=Te(e);return!t.includes(`/node_modules/`)&&/\.(?:[cm]?[jt]sx?|css|s[ac]ss|less|styl)$/.test(t)}function ke(e,t){let n=Array.from(e.matchAll(/[^\n]*(?:\n|$)/g),e=>e[0]),r=[],i=``;for(let e of n){if(!e)continue;let n=Ae(e),a=e.match(/\r?\n$/)?.[0]??``;if(!n){i+=r.every(e=>e.active)?e:a;continue}if(n.name===`ifdef`||n.name===`ifndef`){let e=r.every(e=>e.active),i=n.target.toLowerCase()===t,a=n.name===`ifdef`?i:!i;r.push({parentActive:e,matched:a,active:e&&a})}else if(n.name===`else`){let e=r.at(-1);e&&(e.active=e.parentActive&&!e.matched)}else r.pop();i+=a}return i}function Ae(e){let t=e.match(/^\s*(?:(?:\/\/)|(?:\/\*))\s*#(ifdef|ifndef|if|elif|else|endif)\b([^*\r\n]*)/);if(!t)return;let n=t[1];if(n===`if`||n===`elif`)throw Error(`vpt no longer supports #${n}; use #ifdef, #ifndef, or #else`);return{name:n,target:t[2].replace(/\*\/$/,``).trim()}}const je=`es2018`,Me=n.dirname(N.resolve(`tailwindcss/package.json`)),Ne=P(`h5/app`);function Pe(e){return typeof e==`object`&&!!e&&typeof e.type==`string`}var Fe=class{scopeTracker;enter;leave;contextEnter={skip:()=>{this._skip=!0},remove:()=>{this._remove=!0},replace:e=>{this._replacement=e}};contextLeave={remove:this.contextEnter.remove,replace:this.contextEnter.replace};_skip=!1;_remove=!1;_replacement=null;constructor(e,t){this.enter=e.enter,this.leave=e.leave,this.scopeTracker=t?.scopeTracker}replace(e,t,n,r){e&&t!==null&&(n===null?e[t]=r:e[t][n]=r)}insert(e,t,n,r){e&&t!==null&&(n===null?e[t]=r:e[t].splice(n,0,r))}remove(e,t,n){e&&t!==null&&(n===null?delete e[t]:e[t].splice(n,1))}},Ie=class extends Fe{constructor(e,t){super(e,t)}traverse(e,t,n,r){let i={key:null,index:n??null,ast:e},a=this.scopeTracker,o=this.enter,s=this.leave,c=this.contextEnter,l=this.contextLeave,u=(e,t,n,r,d)=>{a&&a.processNodeEnter(e);let f=e,p=!1,m=!1,h=d;if(o&&!d){let s=this._skip,l=this._remove,u=this._replacement;this._skip=!1,this._remove=!1,this._replacement=null,i.key=n,i.index=r,o.call(c,e,t,i),this._replacement&&!this._remove&&(f=this._replacement,m=!0,this.replace(t,n,r,this._replacement),a&&a.processNodeEnter(f)),this._remove&&(p=!0,f=null,this.remove(t,n,r)),this._skip&&(h=!0),this._skip=s,this._remove=l,this._replacement=u}if((!h||a)&&f)for(let e in f){if(e===`type`||e===`start`||e===`end`)continue;let t=f[e];if(t&&typeof t==`object`){if(Array.isArray(t))for(let n=0;n<t.length;n++){let r=t[n];Pe(r)&&u(r,f,e,n,h)===null&&n--}else typeof t.type==`string`&&u(t,f,e,null,h)}}if(a&&(m&&a.processNodeLeave(f),a.processNodeLeave(e)),s&&!d){let a=this._replacement,o=this._remove;this._replacement=null,this._remove=!1,i.key=n,i.index=r,s.call(l,e,t,i),this._replacement&&!this._remove&&(f=this._replacement,p?this.insert(t,n,r,this._replacement):this.replace(t,n,r,this._replacement)),this._remove&&(f=null,this.remove(t,n,r)),this._replacement=a,this._remove=o}return f};if(!Pe(e))return null;if(a&&a.onWalkStart(e),a&&!o&&!s){let t=e=>{a.processNodeEnter(e);for(let n in e){if(n===`type`||n===`start`||n===`end`)continue;let r=e[n];if(r&&typeof r==`object`){if(Array.isArray(r))for(let e=0;e<r.length;e++){let n=r[e];Pe(n)&&t(n)}else typeof r.type==`string`&&t(r)}}a.processNodeLeave(e)};return t(e),e}return u(e,r??null,t??null,n??null,!1)}};function Le(e,t){return new Ie({enter:t.enter,leave:t.leave},{scopeTracker:t.scopeTracker}).traverse(e)}const Re=new Set(`Program.BlockStatement.StaticBlock.TSModuleBlock.FunctionDeclaration.FunctionExpression.ArrowFunctionExpression.VariableDeclaration.ClassDeclaration.ClassExpression.ImportDeclaration.TSEnumDeclaration.TSModuleDeclaration.TSImportEqualsDeclaration.TSDeclareFunction.TSInterfaceDeclaration.TSTypeAliasDeclaration.TSTypeParameter.TSMappedType.TSEnumBody.TSMethodSignature.TSCallSignatureDeclaration.TSConstructSignatureDeclaration.TSFunctionType.TSConstructorType.TSConditionalType.CatchClause.ForStatement.ForOfStatement.ForInStatement.SwitchStatement`.split(`.`));var ze=class{scopeIndexStack=[];scopeKeyStack=[];scopeOwnerStack=[];scopeIndexKey=``;scopes=new Map;typeScopes=new Map;implicitArguments=new WeakMap;options;isFrozen=!1;constructor(e={}){this.options=e}onWalkStart=e=>{this.scopeIndexStack.length===0&&e.type!==`Program`&&this.scopeIndexStack.push(0)};pushScope(e){let t=this.scopeIndexStack[this.scopeIndexStack.length-1];this.scopeKeyStack.push(this.scopeIndexKey),this.scopeOwnerStack.push(e),this.scopeIndexStack.push(0),t!==void 0&&(this.scopeIndexKey=this.scopeIndexKey?`${this.scopeIndexKey}-${t}`:`${t}`)}popScope(){this.scopeOwnerStack.pop(),this.scopeIndexStack.pop(),this.scopeIndexStack[this.scopeIndexStack.length-1]!==void 0&&this.scopeIndexStack[this.scopeIndexStack.length-1]++,this.options.preserveExitedScopes||(this.scopes.delete(this.scopeIndexKey),this.typeScopes.delete(this.scopeIndexKey)),this.scopeIndexKey=this.scopeKeyStack.pop()??``}getScopeKeyAt(e){return e===this.scopeKeyStack.length-1?this.scopeIndexKey:this.scopeKeyStack[e+1]}getVarScopeKey(){let e=this.scopeOwnerStack;for(let t=e.length-1;t>=0;t--)switch(e[t].type){case`FunctionDeclaration`:case`FunctionExpression`:case`ArrowFunctionExpression`:case`TSDeclareFunction`:case`Program`:case`StaticBlock`:case`TSModuleBlock`:return this.getScopeKeyAt(t)}return``}declareInNamespace(e,t,n){let r=e.get(n.scope);r||(r=new Map,e.set(n.scope,r)),r.set(t,n)}declareIdentifier(e,t,n={value:!0}){this.isFrozen||(n.value&&this.declareInNamespace(this.scopes,e,t),n.type&&this.declareInNamespace(this.typeScopes,e,t))}declareFunctionParameter(e,t){if(this.isFrozen)return;let n=Be(e);for(let e of n)this.declareIdentifier(e.name,new qe(e,this.scopeIndexKey,t))}declarePattern(e,t){if(this.isFrozen)return;let n=t.type===`VariableDeclaration`&&t.kind===`var`?this.getVarScopeKey():this.scopeIndexKey,r=Be(e);for(let e of r)this.declareIdentifier(e.name,t.type===`VariableDeclaration`?new Xe(e,n,t):t.type===`CatchClause`?new Qe(e,n,t):new qe(e,n,t))}processNodeEnter=e=>{if(Re.has(e.type))switch(e.type){case`Program`:case`BlockStatement`:case`StaticBlock`:case`SwitchStatement`:case`TSModuleBlock`:case`TSMethodSignature`:case`TSCallSignatureDeclaration`:case`TSConstructSignatureDeclaration`:case`TSFunctionType`:case`TSConstructorType`:case`TSConditionalType`:this.pushScope(e);break;case`FunctionDeclaration`:e.id?.name&&this.declareIdentifier(e.id.name,new Je(e,this.scopeIndexKey)),this.pushScope(e);for(let t of e.params)this.declareFunctionParameter(t,e);break;case`FunctionExpression`:this.pushScope(e),e.id?.name&&this.declareIdentifier(e.id.name,new Je(e,this.scopeIndexKey)),this.pushScope(e);for(let t of e.params)this.declareFunctionParameter(t,e);break;case`ArrowFunctionExpression`:this.pushScope(e);for(let t of e.params)this.declareFunctionParameter(t,e);break;case`VariableDeclaration`:for(let t of e.declarations)this.declarePattern(t.id,e);break;case`ClassDeclaration`:e.id?.name&&this.declareIdentifier(e.id.name,new Ke(e.id,this.scopeIndexKey),{value:!0,type:!0}),e.typeParameters&&this.pushScope(e);break;case`ClassExpression`:this.pushScope(e),e.id?.name&&this.declareIdentifier(e.id.name,new Ke(e.id,this.scopeIndexKey),{value:!0,type:!0});break;case`ImportDeclaration`:for(let t of e.specifiers){let n=e.importKind===`type`||t.type===`ImportSpecifier`&&t.importKind===`type`;this.declareIdentifier(t.local.name,new Ze(t,this.scopeIndexKey,e),{value:!n,type:!0})}break;case`TSEnumDeclaration`:case`TSModuleDeclaration`:case`TSImportEqualsDeclaration`:if(e.type===`TSModuleDeclaration`&&e.kind===`global`)break;e.id?.type===`Identifier`&&e.id.name&&this.declareIdentifier(e.id.name,new Ke(e.id,this.scopeIndexKey),{value:!0,type:!0});break;case`TSDeclareFunction`:e.id?.name&&this.declareIdentifier(e.id.name,new Ke(e.id,this.scopeIndexKey)),this.pushScope(e);break;case`TSInterfaceDeclaration`:case`TSTypeAliasDeclaration`:e.id?.name&&this.declareIdentifier(e.id.name,new Ke(e.id,this.scopeIndexKey),{type:!0}),this.pushScope(e);break;case`TSTypeParameter`:e.name?.name&&this.declareIdentifier(e.name.name,new Ke(e.name,this.scopeIndexKey),{type:!0});break;case`TSMappedType`:this.pushScope(e),this.declareIdentifier(e.key.name,new Ke(e.key,this.scopeIndexKey),{type:!0});break;case`TSEnumBody`:this.pushScope(e);for(let t of e.members)t.id.type===`Identifier`&&this.declareIdentifier(t.id.name,new Ke(t.id,this.scopeIndexKey));break;case`CatchClause`:this.pushScope(e),e.param&&this.declarePattern(e.param,e);break;case`ForStatement`:case`ForOfStatement`:case`ForInStatement`:if(this.pushScope(e),e.type===`ForStatement`&&e.init?.type===`VariableDeclaration`)for(let t of e.init.declarations)this.declarePattern(t.id,e.init);else if((e.type===`ForOfStatement`||e.type===`ForInStatement`)&&e.left.type===`VariableDeclaration`)for(let t of e.left.declarations)this.declarePattern(t.id,e.left)}};processNodeLeave=e=>{let t=this.scopeOwnerStack;for(;t.length>0&&t[t.length-1]===e;)this.popScope()};getDeclarationIn(e,t){let n=this.scopeIndexKey;for(;;){let r=e.get(n)?.get(t);if(r)return r;if(!n)return null;let i=n.lastIndexOf(`-`);n=i===-1?``:n.slice(0,i)}}isDeclared(e,t){return this.getDeclaration(e,t)!==null}getDeclaration(e,t){let n=t?.mode??`value`,r=(n===`type`?null:this.getDeclarationIn(this.scopes,e))??(n===`value`?null:this.getDeclarationIn(this.typeScopes,e));if(e===`arguments`&&n!==`type`){let e=this.scopeOwnerStack;for(let t=e.length-1;t>=0;t--){let n=e[t];if(n.type===`FunctionDeclaration`||n.type===`FunctionExpression`){let e=this.getScopeKeyAt(t);if(!r||We(e,r.scope)){let t=this.implicitArguments.get(n);return t||(t=new Ye(n,e),this.implicitArguments.set(n,t)),t}break}}}return r}getCurrentScope(){return this.scopeIndexKey}isCurrentScopeUnder(e){return We(this.scopeIndexKey,e)}freeze(){this.isFrozen=!0,this.scopeIndexStack=[],this.scopeKeyStack=[],this.scopeOwnerStack=[],this.scopeIndexKey=``}};function Be(e){let t=[];function n(e){switch(e.type){case`Identifier`:t.push(e);break;case`AssignmentPattern`:n(e.left);break;case`RestElement`:n(e.argument);break;case`TSParameterProperty`:n(e.parameter);break;case`ArrayPattern`:for(let t of e.elements)t&&n(t.type===`RestElement`?t.argument:t);break;case`ObjectPattern`:for(let t of e.properties)n(t.type===`RestElement`?t.argument:t.value)}}return n(e),t}function Ve(e,t){switch(e.type){case`Identifier`:return e===t;case`AssignmentPattern`:return Ve(e.left,t);case`RestElement`:return Ve(e.argument,t);case`TSParameterProperty`:return Ve(e.parameter,t);case`ArrayPattern`:for(let n of e.elements)if(n&&Ve(n.type===`RestElement`?n.argument:n,t))return!0;return!1;case`ObjectPattern`:for(let n of e.properties)if(Ve(n.type===`RestElement`?n.argument:n.value,t))return!0;return!1}return!1}function He(e,t){if(!t||e.type!==`Identifier`)return!1;switch(t.type){case`FunctionDeclaration`:case`FunctionExpression`:case`ArrowFunctionExpression`:case`TSDeclareFunction`:case`TSEmptyBodyFunctionExpression`:if(t.type!==`ArrowFunctionExpression`&&t.id===e)return!0;for(let n of t.params)if(Ve(n,e))return!0;return!1;case`ClassDeclaration`:case`ClassExpression`:return t.id===e;case`VariableDeclarator`:return Ve(t.id,e);case`CatchClause`:return t.param?Ve(t.param,e):!1;case`ImportSpecifier`:return t.local===e;case`ImportDefaultSpecifier`:case`ImportNamespaceSpecifier`:return!0;case`TSEnumDeclaration`:case`TSModuleDeclaration`:return t.id===e;case`TSImportEqualsDeclaration`:return t.id===e;case`TSParameterProperty`:return Ve(t.parameter,e)}return!1}function Ue(e,t,n){if(!t)return!1;let r=n?.mode??`value`;if(e.type===`JSXIdentifier`){if(r===`type`)return!1;switch(t.type){case`JSXOpeningElement`:case`JSXClosingElement`:return t.name===e&&!/^[a-z]/.test(e.name);case`JSXMemberExpression`:return t.object===e;case`JSXAttribute`:case`JSXNamespacedName`:return!1}return!1}if(e.type!==`Identifier`||He(e,t))return!1;switch(t.type){case`MemberExpression`:return r!==`type`&&(t.object===e||t.computed);case`Property`:return r!==`type`&&(t.value===e||t.computed);case`MethodDefinition`:case`PropertyDefinition`:case`AccessorProperty`:case`TSAbstractMethodDefinition`:case`TSAbstractPropertyDefinition`:case`TSAbstractAccessorProperty`:return r!==`type`&&(t.value===e||t.computed);case`ExportSpecifier`:return r!==`type`&&t.local===e;case`ExportAllDeclaration`:return!1;case`ImportSpecifier`:return!1;case`LabeledStatement`:case`BreakStatement`:case`ContinueStatement`:return!1;case`MetaProperty`:return!1;case`ImportAttribute`:return!1;case`TSEnumMember`:return r!==`type`&&t.id!==e;case`TSMappedType`:return!1;case`TSTypeReference`:return r!==`value`;case`TSQualifiedName`:return r!==`value`&&t.left===e;case`TSClassImplements`:case`TSInterfaceHeritage`:return r!==`value`&&t.expression===e;case`TSTypeParameter`:case`TSInterfaceDeclaration`:case`TSTypeAliasDeclaration`:case`TSPropertySignature`:case`TSMethodSignature`:case`TSIndexSignature`:return!1;case`TSFunctionType`:case`TSConstructorType`:case`TSCallSignatureDeclaration`:case`TSConstructSignatureDeclaration`:return!1}return r!==`type`}function We(e,t){return e.length>t.length&&e.startsWith(t)&&(t===``||e[t.length]===`-`)}var Ge=class{scope;node;constructor(e,t){this.node=e,this.scope=t}isUnderScope(e){return We(this.scope,e)}},Ke=class extends Ge{type=`Identifier`;get start(){return this.node.start}get end(){return this.node.end}},qe=class extends Ge{type=`FunctionParam`;fnNode;constructor(e,t,n){super(e,t),this.fnNode=n}get start(){return this.fnNode.start}get end(){return this.fnNode.end}},Je=class extends Ge{type=`Function`;get start(){return this.node.start}get end(){return this.node.end}},Ye=class extends Ge{type=`FunctionArguments`;get start(){return this.node.start}get end(){return this.node.end}},Xe=class extends Ge{type=`Variable`;variableNode;constructor(e,t,n){super(e,t),this.variableNode=n}get start(){return this.variableNode.start}get end(){return this.variableNode.end}},Ze=class extends Ge{type=`Import`;importNode;constructor(e,t,n){super(e,t),this.importNode=n}get start(){return this.importNode.start}get end(){return this.importNode.end}},Qe=class extends Ge{type=`CatchParam`;catchNode;constructor(e,t,n){super(e,t),this.catchNode=n}get start(){return this.catchNode.start}get end(){return this.catchNode.end}};function $e({code:e,filename:t,sourcemap:n,createVisitor:r}){let i=new d(e,{filename:t}),a=p(t,e);if(a.errors.length>0){let e=a.errors.map(e=>e.message).join(`; `);throw Error(`Failed to parse ${t} with Oxc: ${e}`)}Le(a.program,{enter:r(i)});let o=n?i.generateMap({file:t,hires:`boundary`,includeContent:!0,source:t}):null;return{code:i.toString(),map:o?{version:o.version,file:o.file,sources:o.sources,sourcesContent:o.sourcesContent,names:o.names,mappings:o.mappings}:null}}const et=e(N.resolve(`vite-plugin-taro-runtime/components`)).resolve(`@stencil/core/internal/client`),tt=o(et);function nt(){return{name:`vpt:h5-stencil-client`,transform:{filter:{id:we(et)},handler:rt}}}function rt(e,t){if(Te(t)===tt)return $e({code:e,filename:t,sourcemap:!0,createVisitor:it})}function it(e){return function(t){if(t.type!==`CallExpression`||t.callee.type!==`MemberExpression`||t.callee.computed||t.callee.object.type!==`Identifier`||t.callee.object.name!==`styleContainerNode`||t.callee.property.type!==`Identifier`||t.callee.property.name!==`insertBefore`)return;let[n,r]=t.arguments;if(t.arguments.length!==2||n?.type!==`Identifier`||n.name!==`styleElm`||r?.type!==`CallExpression`||r.callee.type!==`MemberExpression`||r.callee.computed||r.callee.object.type!==`Identifier`||r.callee.object.name!==`styleContainerNode`||r.callee.property.type!==`Identifier`||r.callee.property.name!==`querySelector`)return;let[i]=r.arguments;i?.type===`Literal`&&i.value===`link`&&e.overwrite(r.start,r.end,`scopeId.startsWith("sc-taro-") ? styleContainerNode.querySelector("style,link[rel=\\"stylesheet\\"]") : styleContainerNode.querySelector("link")`)}}function at(e){return e.config??{}}function ot(e){let{subPackages:t,subpackages:n,...r}=e.appJson;return{...r,pages:e.pages.map(e=>e.path)}}function st(e,t){let n=e.split(t).length-1;if(n!==1)throw Error(`Expected one placeholder ${t}, found ${n}`)}function ct(e,t,n,r){let i=new d(e,{filename:t});for(let[t,r]of Object.entries(n)){st(e,t);let n=e.indexOf(t);i.overwrite(n,n+t.length,r)}return{code:i.toString(),map:r?lt(i,t):null}}function lt(e,t){let n=e.generateMap({file:t,source:t,includeContent:!0,hires:`boundary`});return{version:n.version,file:n.file,sources:n.sources,sourcesContent:n.sourcesContent,names:n.names,mappings:n.mappings}}function ut({code:e,id:t,options:n,projectRoot:r,sourcemap:i}){return ct(e,t,{__VPT_H5_APP_CONFIG__:JSON.stringify({router:{},...ot(n)}),__VPT_H5_ROUTES__:`[${n.pages.map(e=>dt(e,r)).join(`,`)}]`},i??!0)}function dt(e,t){let n=JSON.stringify(Ce({pagePath:e.path,projectRoot:t}));return`{path:${JSON.stringify(e.path)},load:async function(context,params){const page=await import(${n});return [page,context,params]},...${JSON.stringify(at(e))}}`}function ft(e){return{resolveId({id:t,projectRoot:n}){if(t===`\0vpt:app-component`)return xe({appPath:e.app,projectRoot:n})},transform({code:t,id:n,projectRoot:r,sourcemap:i=!0}){if(Te(n)===o(Ne))return ut({code:t,id:n,options:e,projectRoot:r,sourcemap:i})}}}function pt(e){return[...u({optimize:!1}),nt(),mt(e)]}function mt(e){let t=ft(e);return{name:`vpt:h5`,config(){return{define:vt(),resolve:{mainFields:[`main:h5`,`browser`,`module`,`jsnext:main`,`jsnext`],alias:[{find:/^tailwindcss(?=\/|$)/,replacement:Me},{find:/^(?:@tarojs\/plugin-platform-h5\/dist|vite-plugin-taro-runtime\/plugin-platform-h5)\/runtime\/apis$/,replacement:N.resolve(`vite-plugin-taro-runtime/plugin-platform-h5/runtime/apis`)},{find:/^(?:@tarojs\/plugin-platform-h5\/dist|vite-plugin-taro-runtime\/plugin-platform-h5)\/definition\.json$/,replacement:N.resolve(`vite-plugin-taro-runtime/plugin-platform-h5/definition.json`)},{find:/^(?:@tarojs\/plugin-framework-react\/dist|vite-plugin-taro-runtime\/plugin-framework-react)\/runtime$/,replacement:N.resolve(`vite-plugin-taro-runtime/plugin-framework-react/runtime`)},{find:/^(?:@tarojs\/runtime|vite-plugin-taro-runtime\/runtime\/h5)$/,replacement:N.resolve(`vite-plugin-taro-runtime/runtime/h5`)},{find:/^(?:@tarojs|vite-plugin-taro-runtime)\/api$/,replacement:N.resolve(`vite-plugin-taro-runtime/api`)},{find:/^(?:@tarojs|vite-plugin-taro-runtime)\/taro-h5\/dist\/api\/taro$/,replacement:N.resolve(`vite-plugin-taro-runtime/taro-h5/dist/api/taro`)},{find:/^(?:@tarojs|vite-plugin-taro-runtime)\/taro-h5\/dist\/api\/index$/,replacement:N.resolve(`vite-plugin-taro-runtime/taro-h5/dist/api/index`)},{find:/^(?:@tarojs|vite-plugin-taro-runtime)\/components\/global\.css$/,replacement:N.resolve(`vite-plugin-taro-runtime/components/global.css`)},{find:/^(?:@tarojs|vite-plugin-taro-runtime)\/components\/dist\/taro-components\/taro-components\.css$/,replacement:N.resolve(`vite-plugin-taro-runtime/components/dist/taro-components/taro-components.css`)},{find:/^(?:@tarojs|vite-plugin-taro-runtime)\/router$/,replacement:N.resolve(`vite-plugin-taro-runtime/router`)},{find:/^(?:@tarojs|vite-plugin-taro-runtime)\/components$/,replacement:N.resolve(`vite-plugin-taro-runtime/components`)},{find:/^(?:@tarojs|vite-plugin-taro-runtime)\/components\/dist\/components$/,replacement:N.resolve(`vite-plugin-taro-runtime/components/dist/components`)}]},optimizeDeps:{include:[`vite-plugin-taro-runtime/plugin-platform-h5/runtime/apis`,`vite-plugin-taro-runtime/plugin-framework-react/runtime`,`vite-plugin-taro-runtime/router`,`vite-plugin-taro-runtime/runtime/h5`,`react-dom/client`],rolldownOptions:{plugins:[gt(),nt()]}},build:{target:je}}},resolveId:{order:`pre`,handler(e){return t.resolveId({id:e,projectRoot:this.environment.config.root})}},transform:{order:`pre`,filter:{id:we(Ne)},handler(e,n){return t.transform({code:e,id:n,projectRoot:this.environment.config.root,sourcemap:!!this.environment.config.build.sourcemap})}},transformIndexHtml:{order:`pre`,handler(){return ht()}}}}function ht(){return[{tag:`script`,attrs:{type:`module`},children:`import '${Ee(Ne)}'`,injectTo:`body`}]}function gt(){return{name:`vpt:h5-optimizer-taro`,resolveId:_t}}function _t(e){if(e===`@tarojs/taro`)return N.resolve(`vite-plugin-taro-runtime/plugin-platform-h5/runtime/apis`)}function vt(){return{"process.env.FRAMEWORK":JSON.stringify(`react`),"process.env.SUPPORT_TARO_POLYFILL":JSON.stringify(`disabled`),"process.env.TARO_ENV":JSON.stringify(`h5`),"process.env.TARO_PLATFORM":JSON.stringify(`web`),"process.env.SUPPORT_DINGTALK_NAVIGATE":JSON.stringify(`disabled`),DEPRECATED_ADAPTER_COMPONENT:`false`}}function yt(e){m(e,{recursive:!0});for(let t of g(e,{recursive:!0,withFileTypes:!0})){let e=n.resolve(t.parentPath,t.name);t.isDirectory()||_(e)}}function bt(e,t={}){let{cache:n=new Map,getCacheKey:r}=t,i=function(t){let i=r?r(t):t;if(n.has(i))return n.get(i);let a=e.call(this,t);return n.set(i,a),a};return i.cache=n,i}const xt=N.resolve(`vite-plugin-taro-runtime/runtime/mini`),St=`\0rolldown/runtime.js`,Ct=`\0vpt:global-binding`,wt=`\0vpt:mini-polyfills`,Tt=`common/vpt/transport.js`,Et=[n.resolve(n.dirname(xt),`../..`),...[`react`,`react-dom`].map(e=>n.dirname(N.resolve(`${e}/package.json`)))].map(e=>`${o(e)}/`),Dt=`${o(n.dirname(N.resolve(`core-js/package.json`)))}/`,Ot=RegExp(`^${Dt.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}`);function kt(e){let t=o(e);return t===`\0vpt:mini-polyfills`||t===`\0vpt:global-binding`||t.startsWith(Dt)}function At(e){let t=o(e);return Et.some(e=>t.startsWith(e))}function jt(e){let t=new Map([[e.appShell,`native`],[e.componentShell,`native`],[e.customWrapperShell,`native`],[e.pageShell,`native`],[e.appCapsule,`entry-capsule`],[e.componentCapsule,`entry-capsule`],[e.pageCapsule,`entry-capsule`],[e.bootstrap,`amphibious`],[Ct,`amphibious`],[wt,`amphibious`],[St,`amphibious`]]);return e=>{for(let n of e.moduleIds){let e=t.get(Te(n));if(e!==void 0)return e}return`normal-capsule`}}var Mt=j(((e,t)=>{let n=process||{},r=n.argv||[],i=n.env||{},a=!(i.NO_COLOR||r.includes(`--no-color`))&&(!!i.FORCE_COLOR||r.includes(`--color`)||n.platform===`win32`||(n.stdout||{}).isTTY&&i.TERM!==`dumb`||!!i.CI),o=(e,t,n=e)=>r=>{let i=``+r,a=i.indexOf(t,e.length);return~a?e+s(i,t,n,a)+t:e+i+t},s=(e,t,n,r)=>{let i=``,a=0;do i+=e.substring(a,r)+n,a=r+t.length,r=e.indexOf(t,a);while(~r);return i+e.substring(a)},c=(e=a)=>{let t=e?o:()=>String;return{isColorSupported:e,reset:t(`\x1B[0m`,`\x1B[0m`),bold:t(`\x1B[1m`,`\x1B[22m`,`\x1B[22m\x1B[1m`),dim:t(`\x1B[2m`,`\x1B[22m`,`\x1B[22m\x1B[2m`),italic:t(`\x1B[3m`,`\x1B[23m`),underline:t(`\x1B[4m`,`\x1B[24m`),inverse:t(`\x1B[7m`,`\x1B[27m`),hidden:t(`\x1B[8m`,`\x1B[28m`),strikethrough:t(`\x1B[9m`,`\x1B[29m`),black:t(`\x1B[30m`,`\x1B[39m`),red:t(`\x1B[31m`,`\x1B[39m`),green:t(`\x1B[32m`,`\x1B[39m`),yellow:t(`\x1B[33m`,`\x1B[39m`),blue:t(`\x1B[34m`,`\x1B[39m`),magenta:t(`\x1B[35m`,`\x1B[39m`),cyan:t(`\x1B[36m`,`\x1B[39m`),white:t(`\x1B[37m`,`\x1B[39m`),gray:t(`\x1B[90m`,`\x1B[39m`),bgBlack:t(`\x1B[40m`,`\x1B[49m`),bgRed:t(`\x1B[41m`,`\x1B[49m`),bgGreen:t(`\x1B[42m`,`\x1B[49m`),bgYellow:t(`\x1B[43m`,`\x1B[49m`),bgBlue:t(`\x1B[44m`,`\x1B[49m`),bgMagenta:t(`\x1B[45m`,`\x1B[49m`),bgCyan:t(`\x1B[46m`,`\x1B[49m`),bgWhite:t(`\x1B[47m`,`\x1B[49m`),blackBright:t(`\x1B[90m`,`\x1B[39m`),redBright:t(`\x1B[91m`,`\x1B[39m`),greenBright:t(`\x1B[92m`,`\x1B[39m`),yellowBright:t(`\x1B[93m`,`\x1B[39m`),blueBright:t(`\x1B[94m`,`\x1B[39m`),magentaBright:t(`\x1B[95m`,`\x1B[39m`),cyanBright:t(`\x1B[96m`,`\x1B[39m`),whiteBright:t(`\x1B[97m`,`\x1B[39m`),bgBlackBright:t(`\x1B[100m`,`\x1B[49m`),bgRedBright:t(`\x1B[101m`,`\x1B[49m`),bgGreenBright:t(`\x1B[102m`,`\x1B[49m`),bgYellowBright:t(`\x1B[103m`,`\x1B[49m`),bgBlueBright:t(`\x1B[104m`,`\x1B[49m`),bgMagentaBright:t(`\x1B[105m`,`\x1B[49m`),bgCyanBright:t(`\x1B[106m`,`\x1B[49m`),bgWhiteBright:t(`\x1B[107m`,`\x1B[49m`)}};t.exports=c(),t.exports.createColors=c}));function Nt(e){return typeof e==`function`}function Pt(e){let t=e(e=>{Error.call(e),e.stack=Error().stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}const Ft=Pt(e=>function(t){e(this),this.message=t?`${t.length} errors occurred during unsubscription:
2
2
  ${t.map((e,t)=>`${t+1}) ${e.toString()}`).join(`
3
- `)}`:``,this.name=`UnsubscriptionError`,this.errors=t});function Ft(e,t){if(e){let n=e.indexOf(t);0<=n&&e.splice(n,1)}}var It=class e{constructor(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let e;if(!this.closed){this.closed=!0;let{_parentage:t}=this;if(t){if(this._parentage=null,Array.isArray(t))for(let e of t)e.remove(this);else t.remove(this)}let{initialTeardown:n}=this;if(Mt(n))try{n()}catch(t){e=t instanceof Pt?t.errors:[t]}let{_finalizers:r}=this;if(r){this._finalizers=null;for(let t of r)try{zt(t)}catch(t){e??=[],t instanceof Pt?e=[...e,...t.errors]:e.push(t)}}if(e)throw new Pt(e)}}add(t){if(t&&t!==this){if(this.closed)zt(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=this._finalizers??[]).push(t)}}}_hasParent(e){let{_parentage:t}=this;return t===e||Array.isArray(t)&&t.includes(e)}_addParent(e){let{_parentage:t}=this;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e}_removeParent(e){let{_parentage:t}=this;t===e?this._parentage=null:Array.isArray(t)&&Ft(t,e)}remove(t){let{_finalizers:n}=this;n&&Ft(n,t),t instanceof e&&t._removeParent(this)}};It.EMPTY=(()=>{let e=new It;return e.closed=!0,e})();const Lt=It.EMPTY;function Rt(e){return e instanceof It||e&&`closed`in e&&Mt(e.remove)&&Mt(e.add)&&Mt(e.unsubscribe)}function zt(e){Mt(e)?e():e.unsubscribe()}const Bt={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Vt={setTimeout(e,t,...n){let{delegate:r}=Vt;return r?.setTimeout?r.setTimeout(e,t,...n):setTimeout(e,t,...n)},clearTimeout(e){let{delegate:t}=Vt;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function Ht(e){Vt.setTimeout(()=>{let{onUnhandledError:t}=Bt;if(t)t(e);else throw e})}function Ut(){}const Wt=qt(`C`,void 0,void 0);function Gt(e){return qt(`E`,void 0,e)}function Kt(e){return qt(`N`,e,void 0)}function qt(e,t,n){return{kind:e,value:t,error:n}}let Jt=null;function Yt(e){if(Bt.useDeprecatedSynchronousErrorHandling){let t=!Jt;if(t&&(Jt={errorThrown:!1,error:null}),e(),t){let{errorThrown:e,error:t}=Jt;if(Jt=null,e)throw t}}else e()}function Xt(e){Bt.useDeprecatedSynchronousErrorHandling&&Jt&&(Jt.errorThrown=!0,Jt.error=e)}var Zt=class extends It{constructor(e){super(),this.isStopped=!1,e?(this.destination=e,Rt(e)&&e.add(this)):this.destination=on}static create(e,t,n){return new tn(e,t,n)}next(e){this.isStopped?an(Kt(e),this):this._next(e)}error(e){this.isStopped?an(Gt(e),this):(this.isStopped=!0,this._error(e))}complete(){this.isStopped?an(Wt,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(e){this.destination.next(e)}_error(e){try{this.destination.error(e)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}};const Qt=Function.prototype.bind;function $t(e,t){return Qt.call(e,t)}var en=class{constructor(e){this.partialObserver=e}next(e){let{partialObserver:t}=this;if(t.next)try{t.next(e)}catch(e){nn(e)}}error(e){let{partialObserver:t}=this;if(t.error)try{t.error(e)}catch(e){nn(e)}else nn(e)}complete(){let{partialObserver:e}=this;if(e.complete)try{e.complete()}catch(e){nn(e)}}},tn=class extends Zt{constructor(e,t,n){super();let r;if(Mt(e)||!e)r={next:e??void 0,error:t??void 0,complete:n??void 0};else{let t;this&&Bt.useDeprecatedNextContext?(t=Object.create(e),t.unsubscribe=()=>this.unsubscribe(),r={next:e.next&&$t(e.next,t),error:e.error&&$t(e.error,t),complete:e.complete&&$t(e.complete,t)}):r=e}this.destination=new en(r)}};function nn(e){Bt.useDeprecatedSynchronousErrorHandling?Xt(e):Ht(e)}function rn(e){throw e}function an(e,t){let{onStoppedNotification:n}=Bt;n&&Vt.setTimeout(()=>n(e,t))}const on={closed:!0,next:Ut,error:rn,complete:Ut},sn=typeof Symbol==`function`&&Symbol.observable||`@@observable`;function cn(e){return e}function ln(e){return e.length===0?cn:e.length===1?e[0]:function(t){return e.reduce((e,t)=>t(e),t)}}var un=class e{constructor(e){e&&(this._subscribe=e)}lift(t){let n=new e;return n.source=this,n.operator=t,n}subscribe(e,t,n){let r=pn(e)?e:new tn(e,t,n);return Yt(()=>{let{operator:e,source:t}=this;r.add(e?e.call(r,t):t?this._subscribe(r):this._trySubscribe(r))}),r}_trySubscribe(e){try{return this._subscribe(e)}catch(t){e.error(t)}}forEach(e,t){return t=dn(t),new t((t,n)=>{let r=new tn({next:t=>{try{e(t)}catch(e){n(e),r.unsubscribe()}},error:n,complete:t});this.subscribe(r)})}_subscribe(e){return this.source?.subscribe(e)}[sn](){return this}pipe(...e){return ln(e)(this)}toPromise(e){return e=dn(e),new e((e,t)=>{let n;this.subscribe(e=>n=e,e=>t(e),()=>e(n))})}};un.create=e=>new un(e);function dn(e){return e??Bt.Promise??Promise}function fn(e){return e&&Mt(e.next)&&Mt(e.error)&&Mt(e.complete)}function pn(e){return e&&e instanceof Zt||fn(e)&&Rt(e)}function mn(e){return Mt(e?.lift)}function hn(e){return t=>{if(mn(t))return t.lift(function(t){try{return e(t,this)}catch(e){this.error(e)}});throw TypeError(`Unable to lift unknown Observable type`)}}function gn(e,t,n,r,i){return new _n(e,t,n,r,i)}var _n=class extends Zt{constructor(e,t,n,r,i,a){super(e),this.onFinalize=i,this.shouldUnsubscribe=a,this._next=t?function(n){try{t(n)}catch(t){e.error(t)}}:super._next,this._error=r?function(t){try{r(t)}catch(t){e.error(t)}finally{this.unsubscribe()}}:super._error,this._complete=n?function(){try{n()}catch(t){e.error(t)}finally{this.unsubscribe()}}:super._complete}unsubscribe(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){let{closed:t}=this;super.unsubscribe(),!t&&((e=this.onFinalize)==null||e.call(this))}}};const vn=Nt(e=>function(){e(this),this.name=`ObjectUnsubscribedError`,this.message=`object unsubscribed`});var yn=class extends un{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(e){let t=new bn(this,this);return t.operator=e,t}_throwIfClosed(){if(this.closed)throw new vn}next(e){Yt(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||=Array.from(this.observers);for(let t of this.currentObservers)t.next(e)}})}error(e){Yt(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=e;let{observers:t}=this;for(;t.length;)t.shift().error(e)}})}complete(){Yt(()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;let{observers:e}=this;for(;e.length;)e.shift().complete()}})}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){return this.observers?.length>0}_trySubscribe(e){return this._throwIfClosed(),super._trySubscribe(e)}_subscribe(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)}_innerSubscribe(e){let{hasError:t,isStopped:n,observers:r}=this;return t||n?Lt:(this.currentObservers=null,r.push(e),new It(()=>{this.currentObservers=null,Ft(r,e)}))}_checkFinalizedStatuses(e){let{hasError:t,thrownError:n,isStopped:r}=this;t?e.error(n):r&&e.complete()}asObservable(){let e=new un;return e.source=this,e}};yn.create=(e,t)=>new bn(e,t);var bn=class extends yn{constructor(e,t){super(),this.destination=e,this.source=t}next(e){var t,n;(n=(t=this.destination)?.next)==null||n.call(t,e)}error(e){var t,n;(n=(t=this.destination)?.error)==null||n.call(t,e)}complete(){var e,t;(t=(e=this.destination)?.complete)==null||t.call(e)}_subscribe(e){return this.source?.subscribe(e)??Lt}};const xn={now(){return(xn.delegate||Date).now()},delegate:void 0};var Sn=class extends It{constructor(e,t){super()}schedule(e,t=0){return this}};const Cn={setInterval(e,t,...n){let{delegate:r}=Cn;return r?.setInterval?r.setInterval(e,t,...n):setInterval(e,t,...n)},clearInterval(e){let{delegate:t}=Cn;return(t?.clearInterval||clearInterval)(e)},delegate:void 0};var wn=class extends Sn{constructor(e,t){super(e,t),this.scheduler=e,this.work=t,this.pending=!1}schedule(e,t=0){if(this.closed)return this;this.state=e;let n=this.id,r=this.scheduler;return n!=null&&(this.id=this.recycleAsyncId(r,n,t)),this.pending=!0,this.delay=t,this.id=this.id??this.requestAsyncId(r,this.id,t),this}requestAsyncId(e,t,n=0){return Cn.setInterval(e.flush.bind(e,this),n)}recycleAsyncId(e,t,n=0){if(n!=null&&this.delay===n&&this.pending===!1)return t;t!=null&&Cn.clearInterval(t)}execute(e,t){if(this.closed)return Error(`executing a cancelled action`);this.pending=!1;let n=this._execute(e,t);if(n)return n;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(e,t){let n=!1,r;try{this.work(e)}catch(e){n=!0,r=e||Error(`Scheduled action threw falsy error`)}if(n)return this.unsubscribe(),r}unsubscribe(){if(!this.closed){let{id:e,scheduler:t}=this,{actions:n}=t;this.work=this.state=this.scheduler=null,this.pending=!1,Ft(n,this),e!=null&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null,super.unsubscribe()}}},Tn=class e{constructor(t,n=e.now){this.schedulerActionCtor=t,this.now=n}schedule(e,t=0,n){return new this.schedulerActionCtor(this,e).schedule(n,t)}};Tn.now=xn.now;const En=new class extends Tn{constructor(e,t=Tn.now){super(e,t),this.actions=[],this._active=!1}flush(e){let{actions:t}=this;if(this._active){t.push(e);return}let n;this._active=!0;do if(n=e.execute(e.state,e.delay))break;while(e=t.shift());if(this._active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}}}(wn),Dn=new un(e=>e.complete());function On(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function kn(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)}function An(e){return this instanceof An?(this.v=e,this):new An(e)}function jn(e,t,n){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var r=n.apply(e,t||[]),i,a=[];return i=Object.create((typeof AsyncIterator==`function`?AsyncIterator:Object).prototype),s(`next`),s(`throw`),s(`return`,o),i[Symbol.asyncIterator]=function(){return this},i;function o(e){return function(t){return Promise.resolve(t).then(e,d)}}function s(e,t){r[e]&&(i[e]=function(t){return new Promise(function(n,r){a.push([e,t,n,r])>1||c(e,t)})},t&&(i[e]=t(i[e])))}function c(e,t){try{l(r[e](t))}catch(e){f(a[0][3],e)}}function l(e){e.value instanceof An?Promise.resolve(e.value.v).then(u,d):f(a[0][2],e)}function u(e){c(`next`,e)}function d(e){c(`throw`,e)}function f(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}}function Mn(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof kn==`function`?kn(e):e[Symbol.iterator](),n={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,a){n=e[t](n),i(r,a,n.done,n.value)})}}function i(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}}const Nn=(e=>e&&typeof e.length==`number`&&typeof e!=`function`);function Pn(e){return Mt(e?.then)}function Fn(e){return Mt(e[sn])}function In(e){return Symbol.asyncIterator&&Mt(e?.[Symbol.asyncIterator])}function Ln(e){return TypeError(`You provided ${typeof e==`object`&&e?`an invalid object`:`'${e}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}function Rn(){return typeof Symbol!=`function`||!Symbol.iterator?`@@iterator`:Symbol.iterator}const zn=Rn();function Bn(e){return Mt(e?.[zn])}function Vn(e){return jn(this,arguments,function*(){let t=e.getReader();try{for(;;){let{value:e,done:n}=yield An(t.read());if(n)return yield An(void 0);yield yield An(e)}}finally{t.releaseLock()}})}function Hn(e){return Mt(e?.getReader)}function Un(e){if(e instanceof un)return e;if(e!=null){if(Fn(e))return Wn(e);if(Nn(e))return Gn(e);if(Pn(e))return Kn(e);if(In(e))return Jn(e);if(Bn(e))return qn(e);if(Hn(e))return Yn(e)}throw Ln(e)}function Wn(e){return new un(t=>{let n=e[sn]();if(Mt(n.subscribe))return n.subscribe(t);throw TypeError(`Provided object does not correctly implement Symbol.observable`)})}function Gn(e){return new un(t=>{for(let n=0;n<e.length&&!t.closed;n++)t.next(e[n]);t.complete()})}function Kn(e){return new un(t=>{e.then(e=>{t.closed||(t.next(e),t.complete())},e=>t.error(e)).then(null,Ht)})}function qn(e){return new un(t=>{for(let n of e)if(t.next(n),t.closed)return;t.complete()})}function Jn(e){return new un(t=>{Xn(e,t).catch(e=>t.error(e))})}function Yn(e){return Jn(Vn(e))}function Xn(e,t){var n,r,i,a;return On(this,void 0,void 0,function*(){try{for(n=Mn(e);r=yield n.next(),!r.done;){let e=r.value;if(t.next(e),t.closed)return}}catch(e){i={error:e}}finally{try{r&&!r.done&&(a=n.return)&&(yield a.call(n))}finally{if(i)throw i.error}}t.complete()})}function Zn(e,t,n,r=0,i=!1){let a=t.schedule(function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()},r);if(e.add(a),!i)return a}const Qn=Nt(e=>function(){e(this),this.name=`EmptyError`,this.message=`no elements in sequence`});function $n(e,t){let n=typeof t==`object`;return new Promise((r,i)=>{let a=!1,o;e.subscribe({next:e=>{o=e,a=!0},error:i,complete:()=>{a?r(o):n?r(t.defaultValue):i(new Qn)}})})}function er(e,t){let n=typeof t==`object`;return new Promise((r,i)=>{let a=new tn({next:e=>{r(e),a.unsubscribe()},error:i,complete:()=>{n?r(t.defaultValue):i(new Qn)}});e.subscribe(a)})}function tr(e,t){return hn((n,r)=>{let i=0;n.subscribe(gn(r,n=>{r.next(e.call(t,n,i++))}))})}function nr(e,t,n,r,i,a,o,s){let c=[],l=0,u=0,d=!1,f=()=>{d&&!c.length&&!l&&t.complete()},p=e=>l<r?m(e):c.push(e),m=e=>{a&&t.next(e),l++;let s=!1;Un(n(e,u++)).subscribe(gn(t,e=>{i?.(e),a?p(e):t.next(e)},()=>{s=!0},void 0,()=>{if(s)try{for(l--;c.length&&l<r;){let e=c.shift();o?Zn(t,o,()=>m(e)):m(e)}f()}catch(e){t.error(e)}}))};return e.subscribe(gn(t,p,()=>{d=!0,f()})),()=>{s?.()}}function rr(e,t,n=1/0){return Mt(t)?rr((n,r)=>tr((e,i)=>t(n,e,r,i))(Un(e(n,r))),n):(typeof t==`number`&&(n=t),hn((t,r)=>nr(t,r,e,n)))}function ir(e){return new un(t=>{Un(e()).subscribe(t)})}function ar(e,t){return hn((n,r)=>{let i=0;n.subscribe(gn(r,n=>e.call(t,n,i++)&&r.next(n)))})}function or(e){return hn((t,n)=>{let r=[];return t.subscribe(gn(n,e=>r.push(e),()=>{n.next(r),n.complete()})),Un(e).subscribe(gn(n,()=>{let e=r;r=[],n.next(e)},Ut)),()=>{r=null}})}function sr(e){return hn((t,n)=>{let r=null,i=!1,a;r=t.subscribe(gn(n,void 0,void 0,o=>{a=Un(e(o,sr(e)(t))),r?(r.unsubscribe(),r=null,a.subscribe(n)):i=!0})),i&&(r.unsubscribe(),r=null,a.subscribe(n))})}function cr(e,t){return Mt(t)?rr(e,t,1):rr(e,1)}function lr(e,t=En){return hn((n,r)=>{let i=null,a=null,o=null,s=()=>{if(i){i.unsubscribe(),i=null;let e=a;a=null,r.next(e)}};function c(){let n=o+e,a=t.now();if(a<n){i=this.schedule(void 0,n-a),r.add(i);return}s()}n.subscribe(gn(r,n=>{a=n,o=t.now(),i||(i=t.schedule(c,e),r.add(i))},()=>{s(),r.complete()},void 0,()=>{a=i=null}))})}var ur=M(jt(),1);const dr=`vpt:mini-hmr:control`;function fr(e,t,n,r){let i=new yn;return i.pipe(or(i.pipe(lr(e,t))),ar(e=>e.length>0)).subscribe(e=>{let t=e.findLast(e=>e instanceof Error);t&&r(t);let i=e.filter(e=>!(e instanceof Error));i.length>0&&n({updates:i.flatMap(e=>e.updates),changedFiles:i.flatMap(e=>e.changedFiles)})}),i}const pr=`hmr/info.js`;function mr(e){return`module.exports = Object.freeze(${JSON.stringify(e)});\n`}function hr(e,t){return`@import "./${e}";\n/* vpt-build:${t} */\n`}async function gr(e,t,r){let i=n.join(e,t),a=n.dirname(i);await C.mkdir(a,{recursive:!0});let o=n.join(a,`.${n.basename(i)}.${S()}.txt`);try{await C.writeFile(o,r),await C.rename(o,i)}finally{await C.rm(o,{force:!0})}}const _r=`/__vpt_hmr__`;function vr(e,t){let n=new yn,r=$n(n.pipe(cr(n=>n.kind===`barrier`?ir(()=>(n.resolve(),Dn)):ir(()=>Promise.resolve(e(n.action))).pipe(sr(e=>(t(n.action,e),Dn))))),{defaultValue:void 0});return{complete:async()=>{n.complete(),await r},next(e){n.next({kind:`action`,action:e})},waitForAction(e){return er(n.pipe(ar(e=>e.kind===`action`),tr(e=>e.action),ar(e)))},waitForIdle(){let e=Promise.withResolvers();return n.next({kind:`barrier`,resolve:e.resolve}),e.promise}}}function yr({bundledDev:e,server:t,contract:n,hmrMode:r}){let i=e.getRolldownOptions.bind(e);e.getRolldownOptions=async()=>{let e=await i(),a=xr(e),o=t.config.build.rolldownOptions.output;if(Array.isArray(o))throw Error(`Mini Program development supports one configured Rolldown output.`);let s=o??{},c=new Set(n.options.pages.map(e=>`${e.path}.js`));Object.assign(a,s,{banner:r.createEntryBanner(c),format:`es`,minify:!0,sourcemap:!1}),e.experimental??={};let l=e.experimental.devMode;return e.experimental.devMode={...typeof l==`object`?l:{},implement:await wr(r.runtimeFile),lazy:!1,skipCommonRuntimeInjection:!1},e.plugins=[e.plugins,Cr(t)],Sr(e.plugins),e}}function br(e){if(!e.output||Array.isArray(e.output))throw Error(`Mini Program development requires exactly one Rolldown output.`);return e.output}function xr(e){if(Array.isArray(e.output))throw Error(`Mini Program development requires one configured Rolldown output.`);return e.output??={},e.output}function Sr(e){if(Array.isArray(e)){e.forEach(Sr);return}if(!e||typeof e!=`object`)return;let t=e;t.name===`builtin:vite-transform`&&t._options?.transformOptions&&(t._options.transformOptions.sourcemap=!1)}function Cr(e){let{build:t,logger:r,root:i}=e.config;return b({assetsDir:n.join(t.assetsDir,`/`),chunkLimit:2e3,isLib:!!t.lib,isTty:!(!process.stdout.isTTY||process.env.CI),logInfo:e=>r.info(e),reportCompressedSize:!1,root:i,warnLargeChunks:!1})}const wr=bt(async function(e){return`__rolldown_runtime__ = (function (globalThis) {\n${(await f({input:e,output:{format:`iife`,minify:!1,sourcemap:!1},write:!1})).output[0].code}\nreturn globalThis.__rolldown_runtime__;\n})(__VPT_GLOBAL__);`});var Tr=class{publishPatches;buildId;pendingPatches=[];hasPublishedPatches=!1;constructor(e){this.publishPatches=e}isCurrentBuild(e){return e===this.buildId}startBuild(){let e=this.buildId,t=S();return this.buildId=t,this.pendingPatches.length=0,this.hasPublishedPatches=!1,{buildId:t,previousBuildId:e}}async produce(e){this.buildId!==void 0&&e.length!==0&&(this.pendingPatches.push(...e),await this.publishPatches({buildId:this.buildId,patches:this.pendingPatches}),this.hasPublishedPatches=!0)}isBaselineCurrent(){return!this.hasPublishedPatches}acknowledge(e){let t=0;for(;t<this.pendingPatches.length&&this.pendingPatches[t].seq<=e;)t++;this.pendingPatches.splice(0,t)}};async function Er({server:e,contract:t,styles:n,hmrMode:r}){let i=Nr(e),a=vr(m,(n,r)=>jr(e.config.logger,`${t.options.target} HMR ${n.kind} failed`,r)),o=(t,n)=>gr(e.config.build.outDir,t,n),s=new Tr(e=>f(r.publish?.(e)));e.ws.on(`vpt:mini-hmr:report`,e=>{a.next({kind:`report`,report:e})}),yr({bundledDev:i,server:e,contract:t,hmrMode:r});let c=await _(),l=fr(16,En,e=>{a.next({kind:`publish`,result:e})},e=>{a.next({kind:`error`,error:e})});return i._devEngine=c,i.triggerBundleRegenerationIfStale=async()=>!1,i.listen=async()=>{let e=a.waitForAction(e=>e.kind===`output`);await c.run();let{result:t}=await e;if(t instanceof Error)throw t;await c.ensureCurrentBuildFinish(),await a.waitForIdle()},r.rebuildStrategy===`on-failure`&&e.httpServer?.once(`listening`,()=>{a.next({kind:`listening`})}),kr(e),{close:async()=>{l.complete(),await a.waitForIdle(),await c.ensureCurrentBuildFinish(),await a.complete(),e.ws.send(dr,{kind:`close`,reason:`host closed`})}};async function u(e){await o(t.styles.globalFileName,e)}async function d(){if(r.rebuildStrategy===`always`){let{buildId:e}=s.startBuild();await o(t.styles.appFileName,hr(t.styles.globalFileName,e));return}let n=Dr(e);if(n===void 0)return;e.ws.send(dr,{kind:`close`,reason:`build replaced`});let{buildId:i,previousBuildId:a}=s.startBuild();a&&await c.removeClient(a),await c.registerClient(i),await p(i,n)}async function f(t){if(t)switch(t.kind){case`write`:await o(t.fileName,t.source);return;case`event`:e.ws.send(t.event,t.data);return}}async function p(n,i){let a={buildId:n,endpoint:Or(e,i)};await f(r.reset?.()),await o(pr,mr(a)),await o(t.styles.appFileName,hr(t.styles.globalFileName,n))}function m(n){switch(n.kind){case`publish`:return b(n.result);case`error`:jr(e.config.logger,`${t.options.target} HMR update failed`,n.error);return;case`report`:return g(n.report);case`output`:if(n.result instanceof Error){jr(e.config.logger,`${t.options.target} dev build failed`,n.result);return}return h();case`listening`:return d()}}async function h(){await n.finalizeUpdate([],u),await d()}function g(e){if(s.isCurrentBuild(e.buildId))switch(e.kind){case`startup`:s.isBaselineCurrent()||v(`App started after published patches; replacing baseline`);return;case`rebuild`:v(e.reason);return;case`applied`:s.acknowledge(e.seq);return}}async function _(){let e=await i.getRolldownOptions(),t=br(e);return y(e,t,{onHmrUpdates:r.rebuildStrategy===`on-failure`?e=>{l.next(e)}:void 0,onOutput:e=>{a.next({kind:`output`,result:e})},rebuildStrategy:r.rebuildStrategy===`always`?`always`:`never`,watch:{skipWrite:!1,useDebounce:!0}})}function v(n){e.config.logger.info(`[vpt] ${t.options.target} full rebuild required${n?`: ${n}`:``}`),c.triggerFullBuild()}async function b(e){let t=[];for(let{clientId:n,update:r}of e.updates)if(s.isCurrentBuild(n)&&r.type!==`Noop`){if(r.type===`Patch`){t.push(r);continue}v(r.reason);return}await x(t)}async function x(e){if(e.length===0)return;let t=await n.finalizeUpdate(e,u);await s.produce(t),await S(t)}async function S(e){for(let t of e)await c.notifyPayloadDelivered(t.filename)}}function Dr(e){let t=e.httpServer;if(!t)return;let n=t.address();if(n&&typeof n!=`string`)return n.port}function Or(e,t){let n=typeof e.config.server.ws==`object`?e.config.server.ws:void 0;if(e.config.server.ws===!1||e.config.base!==`/`||n?.path!==`/__vpt_hmr__`||n?.protocol!==void 0||n?.host!==void 0||n?.port!==void 0||n?.clientPort!==void 0||n?.server!==void 0)throw Error(`Mini Program HMR requires Vite WebSocket on the development HTTP server.`);let r=e.config.server.https?`wss`:`ws`,i=new URL(`${r}://${Mr(e)}:${t}${_r}`);return i.searchParams.set(`token`,e.config.webSocketToken),i.href}function kr(e){e.printUrls=()=>{e.config.logger.info(` ${ur.default.green(`➜`)} ${ur.default.bold(`Mini Program project`)}: ${ur.default.cyan(Ar(e.config.build.outDir,e.config.configFile,e.config.root))}`)}}function Ar(e,t,r){let i=t?n.dirname(t):r,a=n.relative(i,e).replaceAll(`\\`,`/`);return a?a.startsWith(`.`)?a:`./${a}`:`.`}function jr(e,t,n){Error.isError(n)?e.error(`[vpt] ${t}`,{error:n}):e.error(`[vpt] ${t} with unknown error: ${n}`)}function Mr(e){let t=e.httpServer?.address();return!t||typeof t==`string`||t.address===`0.0.0.0`||t.address===`::`?`127.0.0.1`:t.address.includes(`:`)?`[${t.address}]`:t.address}function Nr(e){let t=e.environments.client.bundledDev;if(!t)throw Error(`Vite did not create the Mini Program bundled-development environment.`);return t}const Pr=`hmr/patches.js`;function Fr(e){return{rebuildStrategy:`on-failure`,runtimeFile:e.devtoolsHmrRuntime,plugins:[zr(e.pageShell)],createEntryBanner:Rr,reset:()=>({kind:`write`,fileName:Pr,source:Ir()}),publish:e=>({kind:`write`,fileName:Pr,source:Lr(e.buildId,e.patches)})}}function Ir(){return`module.exports = undefined;
4
- `}function Lr(e,t){if(t.length===0)throw Error(`Cannot render an empty Mini Program patch range.`);let n=t.map(e=>`{seq: ${e.seq}, changedIds: ${JSON.stringify(e.changedIds)}, factory: (__rolldown_runtime__) => {\n${e.code}\n}}`);return`module.exports = {buildId: ${JSON.stringify(e)}, patches: [${n.join(`,`)}]};\n`}function Rr(e){return t=>t.name===`app.js`?`__rolldown_runtime__.initialize(require('./${pr}'));\n`:e.has(t.name)?`__rolldown_runtime__.applyPatches(require('${n.posix.relative(n.posix.dirname(t.fileName),Pr)}'));\n`:``}function zr(e){return{name:`vpt:mini-page-shell-hmr`,apply:`serve`,transform:{order:`post`,filter:{id:we(e)},handler(e){return Br(e)}}}}function Br(e){let t=`Page(pageConfig)`;if(!e.includes(t))throw Error(`Mini Program Page shell must register pageConfig`);return{code:e.replace(t,`Page(__rolldown_runtime__.injectPageHmr(pageConfig))`),map:null}}function Vr(e){return{rebuildStrategy:`on-failure`,runtimeFile:e.interpreterHmrRuntime,plugins:[],createEntryBanner:Hr,publish:e=>({kind:`event`,event:`vpt:hmr-interpreter:source`,data:{kind:`patches`,buildId:e.buildId,patches:e.patches}})}}function Hr(e){return e=>e.name===`app.js`?`__rolldown_runtime__.initialize(require('./${pr}'));\n`:``}function Ur(e){return{rebuildStrategy:`always`,runtimeFile:e.devtoolsHmrRuntime,plugins:[],createEntryBanner:Wr}}function Wr(e){return e=>``}function Gr(e,t){switch(e?.mode??`devtools`){case`devtools`:return Fr(t);case`interpreter`:return Vr(t);case`rebuild`:return Ur(t)}}const Kr=`/@react-refresh`,qr=o(n.join(n.dirname(N.resolve(`react-reconciler/package.json`)),`cjs/react-reconciler.development.js`));function Jr(){return[{name:`vpt:mini-react-refresh-runtime`,apply:`serve`,config(){return{define:{queueMicrotask:`globalThis.queueMicrotask`,"window.$RefreshReg$":`globalThis.$RefreshReg$`,"window.$RefreshSig$":`globalThis.$RefreshSig$`,"window.__registerBeforePerformReactRefresh":`globalThis.__registerBeforePerformReactRefresh`,"window.__getReactRefreshIgnoredExports":`globalThis.__getReactRefreshIgnoredExports`}}},transform:{order:`post`,filter:{id:we(Kr)},handler(e){return Yr(e)}}},{name:`vpt:mini-react-refresh-renderer-dependency`,apply:`serve`,transform:{order:`post`,filter:{id:we(qr)},handler(e){return Xr(e)}}}]}function Yr(e){return{code:`${e}
3
+ `)}`:``,this.name=`UnsubscriptionError`,this.errors=t});function It(e,t){if(e){let n=e.indexOf(t);0<=n&&e.splice(n,1)}}var Lt=class e{constructor(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let e;if(!this.closed){this.closed=!0;let{_parentage:t}=this;if(t){if(this._parentage=null,Array.isArray(t))for(let e of t)e.remove(this);else t.remove(this)}let{initialTeardown:n}=this;if(Nt(n))try{n()}catch(t){e=t instanceof Ft?t.errors:[t]}let{_finalizers:r}=this;if(r){this._finalizers=null;for(let t of r)try{Bt(t)}catch(t){e??=[],t instanceof Ft?e=[...e,...t.errors]:e.push(t)}}if(e)throw new Ft(e)}}add(t){if(t&&t!==this){if(this.closed)Bt(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=this._finalizers??[]).push(t)}}}_hasParent(e){let{_parentage:t}=this;return t===e||Array.isArray(t)&&t.includes(e)}_addParent(e){let{_parentage:t}=this;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e}_removeParent(e){let{_parentage:t}=this;t===e?this._parentage=null:Array.isArray(t)&&It(t,e)}remove(t){let{_finalizers:n}=this;n&&It(n,t),t instanceof e&&t._removeParent(this)}};Lt.EMPTY=(()=>{let e=new Lt;return e.closed=!0,e})();const Rt=Lt.EMPTY;function zt(e){return e instanceof Lt||e&&`closed`in e&&Nt(e.remove)&&Nt(e.add)&&Nt(e.unsubscribe)}function Bt(e){Nt(e)?e():e.unsubscribe()}const Vt={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Ht={setTimeout(e,t,...n){let{delegate:r}=Ht;return r?.setTimeout?r.setTimeout(e,t,...n):setTimeout(e,t,...n)},clearTimeout(e){let{delegate:t}=Ht;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function Ut(e){Ht.setTimeout(()=>{let{onUnhandledError:t}=Vt;if(t)t(e);else throw e})}function Wt(){}const Gt=Jt(`C`,void 0,void 0);function Kt(e){return Jt(`E`,void 0,e)}function qt(e){return Jt(`N`,e,void 0)}function Jt(e,t,n){return{kind:e,value:t,error:n}}let Yt=null;function Xt(e){if(Vt.useDeprecatedSynchronousErrorHandling){let t=!Yt;if(t&&(Yt={errorThrown:!1,error:null}),e(),t){let{errorThrown:e,error:t}=Yt;if(Yt=null,e)throw t}}else e()}function Zt(e){Vt.useDeprecatedSynchronousErrorHandling&&Yt&&(Yt.errorThrown=!0,Yt.error=e)}var Qt=class extends Lt{constructor(e){super(),this.isStopped=!1,e?(this.destination=e,zt(e)&&e.add(this)):this.destination=sn}static create(e,t,n){return new nn(e,t,n)}next(e){this.isStopped?on(qt(e),this):this._next(e)}error(e){this.isStopped?on(Kt(e),this):(this.isStopped=!0,this._error(e))}complete(){this.isStopped?on(Gt,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(e){this.destination.next(e)}_error(e){try{this.destination.error(e)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}};const $t=Function.prototype.bind;function en(e,t){return $t.call(e,t)}var tn=class{constructor(e){this.partialObserver=e}next(e){let{partialObserver:t}=this;if(t.next)try{t.next(e)}catch(e){rn(e)}}error(e){let{partialObserver:t}=this;if(t.error)try{t.error(e)}catch(e){rn(e)}else rn(e)}complete(){let{partialObserver:e}=this;if(e.complete)try{e.complete()}catch(e){rn(e)}}},nn=class extends Qt{constructor(e,t,n){super();let r;if(Nt(e)||!e)r={next:e??void 0,error:t??void 0,complete:n??void 0};else{let t;this&&Vt.useDeprecatedNextContext?(t=Object.create(e),t.unsubscribe=()=>this.unsubscribe(),r={next:e.next&&en(e.next,t),error:e.error&&en(e.error,t),complete:e.complete&&en(e.complete,t)}):r=e}this.destination=new tn(r)}};function rn(e){Vt.useDeprecatedSynchronousErrorHandling?Zt(e):Ut(e)}function an(e){throw e}function on(e,t){let{onStoppedNotification:n}=Vt;n&&Ht.setTimeout(()=>n(e,t))}const sn={closed:!0,next:Wt,error:an,complete:Wt},cn=typeof Symbol==`function`&&Symbol.observable||`@@observable`;function ln(e){return e}function un(e){return e.length===0?ln:e.length===1?e[0]:function(t){return e.reduce((e,t)=>t(e),t)}}var dn=class e{constructor(e){e&&(this._subscribe=e)}lift(t){let n=new e;return n.source=this,n.operator=t,n}subscribe(e,t,n){let r=mn(e)?e:new nn(e,t,n);return Xt(()=>{let{operator:e,source:t}=this;r.add(e?e.call(r,t):t?this._subscribe(r):this._trySubscribe(r))}),r}_trySubscribe(e){try{return this._subscribe(e)}catch(t){e.error(t)}}forEach(e,t){return t=fn(t),new t((t,n)=>{let r=new nn({next:t=>{try{e(t)}catch(e){n(e),r.unsubscribe()}},error:n,complete:t});this.subscribe(r)})}_subscribe(e){return this.source?.subscribe(e)}[cn](){return this}pipe(...e){return un(e)(this)}toPromise(e){return e=fn(e),new e((e,t)=>{let n;this.subscribe(e=>n=e,e=>t(e),()=>e(n))})}};dn.create=e=>new dn(e);function fn(e){return e??Vt.Promise??Promise}function pn(e){return e&&Nt(e.next)&&Nt(e.error)&&Nt(e.complete)}function mn(e){return e&&e instanceof Qt||pn(e)&&zt(e)}function hn(e){return Nt(e?.lift)}function gn(e){return t=>{if(hn(t))return t.lift(function(t){try{return e(t,this)}catch(e){this.error(e)}});throw TypeError(`Unable to lift unknown Observable type`)}}function _n(e,t,n,r,i){return new vn(e,t,n,r,i)}var vn=class extends Qt{constructor(e,t,n,r,i,a){super(e),this.onFinalize=i,this.shouldUnsubscribe=a,this._next=t?function(n){try{t(n)}catch(t){e.error(t)}}:super._next,this._error=r?function(t){try{r(t)}catch(t){e.error(t)}finally{this.unsubscribe()}}:super._error,this._complete=n?function(){try{n()}catch(t){e.error(t)}finally{this.unsubscribe()}}:super._complete}unsubscribe(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){let{closed:t}=this;super.unsubscribe(),!t&&((e=this.onFinalize)==null||e.call(this))}}};const yn=Pt(e=>function(){e(this),this.name=`ObjectUnsubscribedError`,this.message=`object unsubscribed`});var bn=class extends dn{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(e){let t=new xn(this,this);return t.operator=e,t}_throwIfClosed(){if(this.closed)throw new yn}next(e){Xt(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||=Array.from(this.observers);for(let t of this.currentObservers)t.next(e)}})}error(e){Xt(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=e;let{observers:t}=this;for(;t.length;)t.shift().error(e)}})}complete(){Xt(()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;let{observers:e}=this;for(;e.length;)e.shift().complete()}})}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){return this.observers?.length>0}_trySubscribe(e){return this._throwIfClosed(),super._trySubscribe(e)}_subscribe(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)}_innerSubscribe(e){let{hasError:t,isStopped:n,observers:r}=this;return t||n?Rt:(this.currentObservers=null,r.push(e),new Lt(()=>{this.currentObservers=null,It(r,e)}))}_checkFinalizedStatuses(e){let{hasError:t,thrownError:n,isStopped:r}=this;t?e.error(n):r&&e.complete()}asObservable(){let e=new dn;return e.source=this,e}};bn.create=(e,t)=>new xn(e,t);var xn=class extends bn{constructor(e,t){super(),this.destination=e,this.source=t}next(e){var t,n;(n=(t=this.destination)?.next)==null||n.call(t,e)}error(e){var t,n;(n=(t=this.destination)?.error)==null||n.call(t,e)}complete(){var e,t;(t=(e=this.destination)?.complete)==null||t.call(e)}_subscribe(e){return this.source?.subscribe(e)??Rt}};const Sn={now(){return(Sn.delegate||Date).now()},delegate:void 0};var Cn=class extends Lt{constructor(e,t){super()}schedule(e,t=0){return this}};const wn={setInterval(e,t,...n){let{delegate:r}=wn;return r?.setInterval?r.setInterval(e,t,...n):setInterval(e,t,...n)},clearInterval(e){let{delegate:t}=wn;return(t?.clearInterval||clearInterval)(e)},delegate:void 0};var Tn=class extends Cn{constructor(e,t){super(e,t),this.scheduler=e,this.work=t,this.pending=!1}schedule(e,t=0){if(this.closed)return this;this.state=e;let n=this.id,r=this.scheduler;return n!=null&&(this.id=this.recycleAsyncId(r,n,t)),this.pending=!0,this.delay=t,this.id=this.id??this.requestAsyncId(r,this.id,t),this}requestAsyncId(e,t,n=0){return wn.setInterval(e.flush.bind(e,this),n)}recycleAsyncId(e,t,n=0){if(n!=null&&this.delay===n&&this.pending===!1)return t;t!=null&&wn.clearInterval(t)}execute(e,t){if(this.closed)return Error(`executing a cancelled action`);this.pending=!1;let n=this._execute(e,t);if(n)return n;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(e,t){let n=!1,r;try{this.work(e)}catch(e){n=!0,r=e||Error(`Scheduled action threw falsy error`)}if(n)return this.unsubscribe(),r}unsubscribe(){if(!this.closed){let{id:e,scheduler:t}=this,{actions:n}=t;this.work=this.state=this.scheduler=null,this.pending=!1,It(n,this),e!=null&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null,super.unsubscribe()}}},En=class e{constructor(t,n=e.now){this.schedulerActionCtor=t,this.now=n}schedule(e,t=0,n){return new this.schedulerActionCtor(this,e).schedule(n,t)}};En.now=Sn.now;const Dn=new class extends En{constructor(e,t=En.now){super(e,t),this.actions=[],this._active=!1}flush(e){let{actions:t}=this;if(this._active){t.push(e);return}let n;this._active=!0;do if(n=e.execute(e.state,e.delay))break;while(e=t.shift());if(this._active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}}}(Tn),On=new dn(e=>e.complete());function kn(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function An(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)}function jn(e){return this instanceof jn?(this.v=e,this):new jn(e)}function Mn(e,t,n){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var r=n.apply(e,t||[]),i,a=[];return i=Object.create((typeof AsyncIterator==`function`?AsyncIterator:Object).prototype),s(`next`),s(`throw`),s(`return`,o),i[Symbol.asyncIterator]=function(){return this},i;function o(e){return function(t){return Promise.resolve(t).then(e,d)}}function s(e,t){r[e]&&(i[e]=function(t){return new Promise(function(n,r){a.push([e,t,n,r])>1||c(e,t)})},t&&(i[e]=t(i[e])))}function c(e,t){try{l(r[e](t))}catch(e){f(a[0][3],e)}}function l(e){e.value instanceof jn?Promise.resolve(e.value.v).then(u,d):f(a[0][2],e)}function u(e){c(`next`,e)}function d(e){c(`throw`,e)}function f(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}}function Nn(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof An==`function`?An(e):e[Symbol.iterator](),n={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,a){n=e[t](n),i(r,a,n.done,n.value)})}}function i(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}}const Pn=(e=>e&&typeof e.length==`number`&&typeof e!=`function`);function Fn(e){return Nt(e?.then)}function In(e){return Nt(e[cn])}function Ln(e){return Symbol.asyncIterator&&Nt(e?.[Symbol.asyncIterator])}function Rn(e){return TypeError(`You provided ${typeof e==`object`&&e?`an invalid object`:`'${e}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}function zn(){return typeof Symbol!=`function`||!Symbol.iterator?`@@iterator`:Symbol.iterator}const Bn=zn();function Vn(e){return Nt(e?.[Bn])}function Hn(e){return Mn(this,arguments,function*(){let t=e.getReader();try{for(;;){let{value:e,done:n}=yield jn(t.read());if(n)return yield jn(void 0);yield yield jn(e)}}finally{t.releaseLock()}})}function Un(e){return Nt(e?.getReader)}function Wn(e){if(e instanceof dn)return e;if(e!=null){if(In(e))return Gn(e);if(Pn(e))return Kn(e);if(Fn(e))return qn(e);if(Ln(e))return Yn(e);if(Vn(e))return Jn(e);if(Un(e))return Xn(e)}throw Rn(e)}function Gn(e){return new dn(t=>{let n=e[cn]();if(Nt(n.subscribe))return n.subscribe(t);throw TypeError(`Provided object does not correctly implement Symbol.observable`)})}function Kn(e){return new dn(t=>{for(let n=0;n<e.length&&!t.closed;n++)t.next(e[n]);t.complete()})}function qn(e){return new dn(t=>{e.then(e=>{t.closed||(t.next(e),t.complete())},e=>t.error(e)).then(null,Ut)})}function Jn(e){return new dn(t=>{for(let n of e)if(t.next(n),t.closed)return;t.complete()})}function Yn(e){return new dn(t=>{Zn(e,t).catch(e=>t.error(e))})}function Xn(e){return Yn(Hn(e))}function Zn(e,t){var n,r,i,a;return kn(this,void 0,void 0,function*(){try{for(n=Nn(e);r=yield n.next(),!r.done;){let e=r.value;if(t.next(e),t.closed)return}}catch(e){i={error:e}}finally{try{r&&!r.done&&(a=n.return)&&(yield a.call(n))}finally{if(i)throw i.error}}t.complete()})}function Qn(e,t,n,r=0,i=!1){let a=t.schedule(function(){n(),i?e.add(this.schedule(null,r)):this.unsubscribe()},r);if(e.add(a),!i)return a}const $n=Pt(e=>function(){e(this),this.name=`EmptyError`,this.message=`no elements in sequence`});function er(e,t){let n=typeof t==`object`;return new Promise((r,i)=>{let a=!1,o;e.subscribe({next:e=>{o=e,a=!0},error:i,complete:()=>{a?r(o):n?r(t.defaultValue):i(new $n)}})})}function tr(e,t){let n=typeof t==`object`;return new Promise((r,i)=>{let a=new nn({next:e=>{r(e),a.unsubscribe()},error:i,complete:()=>{n?r(t.defaultValue):i(new $n)}});e.subscribe(a)})}function nr(e,t){return gn((n,r)=>{let i=0;n.subscribe(_n(r,n=>{r.next(e.call(t,n,i++))}))})}function rr(e,t,n,r,i,a,o,s){let c=[],l=0,u=0,d=!1,f=()=>{d&&!c.length&&!l&&t.complete()},p=e=>l<r?m(e):c.push(e),m=e=>{a&&t.next(e),l++;let s=!1;Wn(n(e,u++)).subscribe(_n(t,e=>{i?.(e),a?p(e):t.next(e)},()=>{s=!0},void 0,()=>{if(s)try{for(l--;c.length&&l<r;){let e=c.shift();o?Qn(t,o,()=>m(e)):m(e)}f()}catch(e){t.error(e)}}))};return e.subscribe(_n(t,p,()=>{d=!0,f()})),()=>{s?.()}}function ir(e,t,n=1/0){return Nt(t)?ir((n,r)=>nr((e,i)=>t(n,e,r,i))(Wn(e(n,r))),n):(typeof t==`number`&&(n=t),gn((t,r)=>rr(t,r,e,n)))}function ar(e){return new dn(t=>{Wn(e()).subscribe(t)})}function or(e,t){return gn((n,r)=>{let i=0;n.subscribe(_n(r,n=>e.call(t,n,i++)&&r.next(n)))})}function sr(e){return gn((t,n)=>{let r=[];return t.subscribe(_n(n,e=>r.push(e),()=>{n.next(r),n.complete()})),Wn(e).subscribe(_n(n,()=>{let e=r;r=[],n.next(e)},Wt)),()=>{r=null}})}function cr(e){return gn((t,n)=>{let r=null,i=!1,a;r=t.subscribe(_n(n,void 0,void 0,o=>{a=Wn(e(o,cr(e)(t))),r?(r.unsubscribe(),r=null,a.subscribe(n)):i=!0})),i&&(r.unsubscribe(),r=null,a.subscribe(n))})}function lr(e,t){return Nt(t)?ir(e,t,1):ir(e,1)}function ur(e,t=Dn){return gn((n,r)=>{let i=null,a=null,o=null,s=()=>{if(i){i.unsubscribe(),i=null;let e=a;a=null,r.next(e)}};function c(){let n=o+e,a=t.now();if(a<n){i=this.schedule(void 0,n-a),r.add(i);return}s()}n.subscribe(_n(r,n=>{a=n,o=t.now(),i||(i=t.schedule(c,e),r.add(i))},()=>{s(),r.complete()},void 0,()=>{a=i=null}))})}var dr=M(Mt(),1);const fr=`vpt:mini-hmr:control`;function pr(e,t,n,r){let i=new bn;return i.pipe(sr(i.pipe(ur(e,t))),or(e=>e.length>0)).subscribe(e=>{let t=e.findLast(e=>e instanceof Error);t&&r(t);let i=e.filter(e=>!(e instanceof Error));i.length>0&&n({updates:i.flatMap(e=>e.updates),changedFiles:i.flatMap(e=>e.changedFiles)})}),i}const mr=`hmr/info.js`;function hr(e){return`module.exports = Object.freeze(${JSON.stringify(e)});\n`}function gr(e,t){return`@import "./${e}";\n/* vpt-build:${t} */\n`}async function _r(e,t,r){let i=n.join(e,t),a=n.dirname(i);await C.mkdir(a,{recursive:!0});let o=n.join(a,`.${n.basename(i)}.${S()}.txt`);try{await C.writeFile(o,r),await C.rename(o,i)}finally{await C.rm(o,{force:!0})}}const vr=`/__vpt_hmr__`;function yr(e,t){let n=new bn,r=er(n.pipe(lr(n=>n.kind===`barrier`?ar(()=>(n.resolve(),On)):ar(()=>Promise.resolve(e(n.action))).pipe(cr(e=>(t(n.action,e),On))))),{defaultValue:void 0});return{complete:async()=>{n.complete(),await r},next(e){n.next({kind:`action`,action:e})},waitForAction(e){return tr(n.pipe(or(e=>e.kind===`action`),nr(e=>e.action),or(e)))},waitForIdle(){let e=Promise.withResolvers();return n.next({kind:`barrier`,resolve:e.resolve}),e.promise}}}function br({bundledDev:e,server:t,contract:n,hmrMode:r}){let i=e.getRolldownOptions.bind(e);e.getRolldownOptions=async()=>{let e=await i(),a=Sr(e),o=t.config.build.rolldownOptions.output;if(Array.isArray(o))throw Error(`Mini Program development supports one configured Rolldown output.`);let s=o??{},c=new Set(n.options.pages.map(e=>`${e.path}.js`));Object.assign(a,s,{banner:r.createEntryBanner(c),format:`es`,minify:!0,sourcemap:!1}),e.experimental??={};let l=e.experimental.devMode;return e.experimental.devMode={...typeof l==`object`?l:{},implement:await Tr(r.runtimeFile),lazy:!1,skipCommonRuntimeInjection:!1},e.plugins=[e.plugins,wr(t)],Cr(e.plugins),e}}function xr(e){if(!e.output||Array.isArray(e.output))throw Error(`Mini Program development requires exactly one Rolldown output.`);return e.output}function Sr(e){if(Array.isArray(e.output))throw Error(`Mini Program development requires one configured Rolldown output.`);return e.output??={},e.output}function Cr(e){if(Array.isArray(e)){e.forEach(Cr);return}if(!e||typeof e!=`object`)return;let t=e;t.name===`builtin:vite-transform`&&t._options?.transformOptions&&(t._options.transformOptions.sourcemap=!1)}function wr(e){let{build:t,logger:r,root:i}=e.config;return b({assetsDir:n.join(t.assetsDir,`/`),chunkLimit:2e3,isLib:!!t.lib,isTty:!(!process.stdout.isTTY||process.env.CI),logInfo:e=>r.info(e),reportCompressedSize:!1,root:i,warnLargeChunks:!1})}const Tr=bt(async function(e){return`__rolldown_runtime__ = (function (globalThis) {\n${(await f({input:e,output:{format:`iife`,minify:!1,sourcemap:!1},write:!1})).output[0].code}\nreturn globalThis.__rolldown_runtime__;\n})(__VPT_GLOBAL__);`});var Er=class{publishPatches;buildId;pendingPatches=[];hasPublishedPatches=!1;constructor(e){this.publishPatches=e}isCurrentBuild(e){return e===this.buildId}startBuild(){let e=this.buildId,t=S();return this.buildId=t,this.pendingPatches.length=0,this.hasPublishedPatches=!1,{buildId:t,previousBuildId:e}}async produce(e){this.buildId!==void 0&&e.length!==0&&(this.pendingPatches.push(...e),await this.publishPatches({buildId:this.buildId,patches:this.pendingPatches}),this.hasPublishedPatches=!0)}isBaselineCurrent(){return!this.hasPublishedPatches}acknowledge(e){let t=0;for(;t<this.pendingPatches.length&&this.pendingPatches[t].seq<=e;)t++;this.pendingPatches.splice(0,t)}};async function Dr({server:e,contract:t,styles:n,hmrMode:r}){let i=Pr(e),a=yr(m,(n,r)=>Mr(e.config.logger,`${t.options.target} HMR ${n.kind} failed`,r)),o=(t,n)=>_r(e.config.build.outDir,t,n),s=new Er(e=>f(r.publish?.(e)));e.ws.on(`vpt:mini-hmr:report`,e=>{a.next({kind:`report`,report:e})}),br({bundledDev:i,server:e,contract:t,hmrMode:r});let c=await _(),l=pr(16,Dn,e=>{a.next({kind:`publish`,result:e})},e=>{a.next({kind:`error`,error:e})});return i._devEngine=c,i.triggerBundleRegenerationIfStale=async()=>!1,i.listen=async()=>{let e=a.waitForAction(e=>e.kind===`output`);await c.run();let{result:t}=await e;if(t instanceof Error)throw t;await c.ensureCurrentBuildFinish(),await a.waitForIdle()},r.rebuildStrategy===`on-failure`&&e.httpServer?.once(`listening`,()=>{a.next({kind:`listening`})}),Ar(e),{close:async()=>{l.complete(),await a.waitForIdle(),await c.ensureCurrentBuildFinish(),await a.complete(),e.ws.send(fr,{kind:`close`,reason:`host closed`})}};async function u(e){await o(t.styles.globalFileName,e)}async function d(){if(r.rebuildStrategy===`always`){let{buildId:e}=s.startBuild();await o(t.styles.appFileName,gr(t.styles.globalFileName,e));return}let n=Or(e);if(n===void 0)return;e.ws.send(fr,{kind:`close`,reason:`build replaced`});let{buildId:i,previousBuildId:a}=s.startBuild();a&&await c.removeClient(a),await c.registerClient(i),await p(i,n)}async function f(t){if(t)switch(t.kind){case`write`:await o(t.fileName,t.source);return;case`event`:e.ws.send(t.event,t.data);return}}async function p(n,i){let a={buildId:n,endpoint:kr(e,i)};await f(r.reset?.()),await o(mr,hr(a)),await o(t.styles.appFileName,gr(t.styles.globalFileName,n))}function m(n){switch(n.kind){case`publish`:return b(n.result);case`error`:Mr(e.config.logger,`${t.options.target} HMR update failed`,n.error);return;case`report`:return g(n.report);case`output`:if(n.result instanceof Error){Mr(e.config.logger,`${t.options.target} dev build failed`,n.result);return}return h();case`listening`:return d()}}async function h(){await n.finalizeUpdate([],u),await d()}function g(e){if(s.isCurrentBuild(e.buildId))switch(e.kind){case`startup`:s.isBaselineCurrent()||v(`App started after published patches; replacing baseline`);return;case`rebuild`:v(e.reason);return;case`applied`:s.acknowledge(e.seq);return}}async function _(){let e=await i.getRolldownOptions(),t=xr(e);return y(e,t,{onHmrUpdates:r.rebuildStrategy===`on-failure`?e=>{l.next(e)}:void 0,onOutput:e=>{a.next({kind:`output`,result:e})},rebuildStrategy:r.rebuildStrategy===`always`?`always`:`never`,watch:{skipWrite:!1,useDebounce:!0}})}function v(n){e.config.logger.info(`[vpt] ${t.options.target} full rebuild required${n?`: ${n}`:``}`),c.triggerFullBuild()}async function b(e){let t=[];for(let{clientId:n,update:r}of e.updates)if(s.isCurrentBuild(n)&&r.type!==`Noop`){if(r.type===`Patch`){t.push(r);continue}v(r.reason);return}await x(t)}async function x(e){if(e.length===0)return;let t=await n.finalizeUpdate(e,u);await s.produce(t),await S(t)}async function S(e){for(let t of e)await c.notifyPayloadDelivered(t.filename)}}function Or(e){let t=e.httpServer;if(!t)return;let n=t.address();if(n&&typeof n!=`string`)return n.port}function kr(e,t){let n=typeof e.config.server.ws==`object`?e.config.server.ws:void 0;if(e.config.server.ws===!1||e.config.base!==`/`||n?.path!==`/__vpt_hmr__`||n?.protocol!==void 0||n?.host!==void 0||n?.port!==void 0||n?.clientPort!==void 0||n?.server!==void 0)throw Error(`Mini Program HMR requires Vite WebSocket on the development HTTP server.`);let r=e.config.server.https?`wss`:`ws`,i=new URL(`${r}://${Nr(e)}:${t}${vr}`);return i.searchParams.set(`token`,e.config.webSocketToken),i.href}function Ar(e){e.printUrls=()=>{e.config.logger.info(` ${dr.default.green(`➜`)} ${dr.default.bold(`Mini Program project`)}: ${dr.default.cyan(jr(e.config.build.outDir,e.config.configFile,e.config.root))}`)}}function jr(e,t,r){let i=t?n.dirname(t):r,a=n.relative(i,e).replaceAll(`\\`,`/`);return a?a.startsWith(`.`)?a:`./${a}`:`.`}function Mr(e,t,n){Error.isError(n)?e.error(`[vpt] ${t}`,{error:n}):e.error(`[vpt] ${t} with unknown error: ${n}`)}function Nr(e){let t=e.httpServer?.address();return!t||typeof t==`string`||t.address===`0.0.0.0`||t.address===`::`?`127.0.0.1`:t.address.includes(`:`)?`[${t.address}]`:t.address}function Pr(e){let t=e.environments.client.bundledDev;if(!t)throw Error(`Vite did not create the Mini Program bundled-development environment.`);return t}const Fr=`hmr/patches.js`;function Ir(e){return{rebuildStrategy:`on-failure`,runtimeFile:e.devtoolsHmrRuntime,plugins:[Br(e.pageShell)],createEntryBanner:zr,reset:()=>({kind:`write`,fileName:Fr,source:Lr()}),publish:e=>({kind:`write`,fileName:Fr,source:Rr(e.buildId,e.patches)})}}function Lr(){return`module.exports = undefined;
4
+ `}function Rr(e,t){if(t.length===0)throw Error(`Cannot render an empty Mini Program patch range.`);let n=t.map(e=>`{seq: ${e.seq}, changedIds: ${JSON.stringify(e.changedIds)}, factory: (__rolldown_runtime__) => {\n${e.code}\n}}`);return`module.exports = {buildId: ${JSON.stringify(e)}, patches: [${n.join(`,`)}]};\n`}function zr(e){return t=>t.name===`app.js`?`__rolldown_runtime__.initialize(require('./${mr}'));\n`:e.has(t.name)?`__rolldown_runtime__.applyPatches(require('${n.posix.relative(n.posix.dirname(t.fileName),Fr)}'));\n`:``}function Br(e){return{name:`vpt:mini-page-shell-hmr`,apply:`serve`,transform:{order:`post`,filter:{id:we(e)},handler(e){return Vr(e)}}}}function Vr(e){let t=`Page(pageConfig)`;if(!e.includes(t))throw Error(`Mini Program Page shell must register pageConfig`);return{code:e.replace(t,`Page(__rolldown_runtime__.injectPageHmr(pageConfig))`),map:null}}function Hr(e){return{rebuildStrategy:`on-failure`,runtimeFile:e.interpreterHmrRuntime,plugins:[],createEntryBanner:Ur,publish:e=>({kind:`event`,event:`vpt:hmr-interpreter:source`,data:{kind:`patches`,buildId:e.buildId,patches:e.patches}})}}function Ur(e){return e=>e.name===`app.js`?`__rolldown_runtime__.initialize(require('./${mr}'));\n`:``}function Wr(e){return{rebuildStrategy:`always`,runtimeFile:e.devtoolsHmrRuntime,plugins:[],createEntryBanner:Gr}}function Gr(e){return e=>``}function Kr(e,t){switch(e?.mode??`devtools`){case`devtools`:return Ir(t);case`interpreter`:return Hr(t);case`rebuild`:return Wr(t)}}const qr=`/@react-refresh`,Jr=o(n.join(n.dirname(N.resolve(`react-reconciler/package.json`)),`cjs/react-reconciler.development.js`));function Yr(){return[{name:`vpt:mini-react-refresh-runtime`,apply:`serve`,config(){return{define:{queueMicrotask:`globalThis.queueMicrotask`,"window.$RefreshReg$":`globalThis.$RefreshReg$`,"window.$RefreshSig$":`globalThis.$RefreshSig$`,"window.__registerBeforePerformReactRefresh":`globalThis.__registerBeforePerformReactRefresh`,"window.__getReactRefreshIgnoredExports":`globalThis.__getReactRefreshIgnoredExports`}}},transform:{order:`post`,filter:{id:we(qr)},handler(e){return Xr(e)}}},{name:`vpt:mini-react-refresh-renderer-dependency`,apply:`serve`,transform:{order:`post`,filter:{id:we(Jr)},handler(e){return Zr(e)}}}]}function Xr(e){return{code:`${e}
5
5
  injectIntoGlobalHook(globalThis);
6
6
  globalThis.$RefreshReg$ = () => {};
7
- globalThis.$RefreshSig$ = () => (type) => type;`,map:null}}function Xr(e){if(!/\bhook\.inject\(internals\)/.test(e))throw Error(`React Reconciler must inject its renderer into the DevTools hook`);return{code:`import '${Kr}'\n${e}`,map:null}}function Zr(e){return e.name===`client`}function Qr(e,t){let r=Gr(e.options.hmr,e.runtime.modules),i=null;return[{name:`vpt:mini-dev`,apply:`serve`,applyToEnvironment:Zr,config(){return{define:{"performance.now":`Date.now`},build:{emptyOutDir:!1,sourcemap:!1},experimental:{bundledDev:!0},server:{ws:{path:_r}}}},configureServer:{order:`post`,async handler(a){yt(n.resolve(a.config.root,a.config.build.outDir)),i=await Er({server:a,contract:e,styles:t,hmrMode:r})}},generateBundle:{order:`post`,handler(t,n){$r(n,e.styles.appFileName)}},closeBundle(){return i?.close()}},{name:`vpt:mini-runtime-lowering`,apply:`serve`,transform:{order:`post`,filter:{id:we(St)},handler(e){return ei(e)}}},...r.plugins,...Jr()]}function $r(e,t){delete e[t]}const ei=bt(e=>c(e,St,{lang:`js`,target:je,sourcemap:!1,assumptions:{setPublicClassFields:!0}})),ti=P(`global/vpt-global`),ni=`common/vpt-global.js`;function ri(e){function t(t){let r=n.posix.relative(n.posix.dirname(e.getPhysicalChunkId(t)),ni),i=r.startsWith(`.`)?r:`./${r}`;return`require(${JSON.stringify(i)}).vptGlobal`}return[{name:`vpt:mini-global`,resolveId:{filter:{id:we(Ct)},handler(){return Ct}},load:{filter:{id:we(Ct)},handler(){return`export const vptGlobal = __VPT_GLOBAL__;`}},config(){return{build:{rolldownOptions:{transform:{inject:{globalThis:[Ct,`vptGlobal`]}}}}}},renderChunk:{order:`pre`,filter:{code:/__VPT_GLOBAL__/},handler(e,n,r){if(n.moduleIds.includes(`\0vpt:global-binding`)||n.moduleIds.includes(`\0rolldown/runtime.js`))return c(e,n.fileName,{define:{__VPT_GLOBAL__:t(n)},sourcemap:!!r.sourcemap})}},generateBundle:{order:`post`,async handler(e){let t=await ii({dir:e.dir,minify:e.minify!==!1,sourcemap:e.sourcemap});for(let e of t.output)e.type===`asset`?this.emitFile({type:`asset`,fileName:e.fileName,source:e.source}):this.emitFile({type:`prebuilt-chunk`,fileName:e.fileName,code:e.code,exports:e.exports,facadeModuleId:ti,isEntry:!0})}}},{name:`vpt:mini-global-dev`,apply:`serve`,renderChunk:{order:`pre`,filter:{code:/__rolldown_runtime__/},handler(e,n){return{code:(n.moduleIds.includes(`\0rolldown/runtime.js`)?`let __rolldown_runtime__;
8
- `:`const __rolldown_runtime__ = ${t(n)}.__rolldown_runtime__;\n`)+e,map:null}}}}]}const ii=bt(e=>f({input:ti,transform:{target:je},output:{...e,format:`cjs`,strict:!0,generatedCode:{symbols:!1},entryFileNames:ni},write:!1}),{getCacheKey:e=>JSON.stringify(e)});function ai(e){return e?.[`vpt:native-components`]?.assetBytes??0}function oi(e){return e?.[`vpt:native-components`]?.sources??[]}async function si(e,t){await ci(e.folder),await li(e);let n=[];return await ui(e.folder,[],n,o(t)),{...e,assets:n}}async function ci(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 li(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 ui(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 ui(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 di(e,t,r){let i=Te(t),a=te(e,{astType:`ts`,lang:`tsx`,preserveParens:!1,sourceType:`module`},i),o=_i(a),s=pi(a),c=mi(a,new Set(s.flatMap(e=>e.names))).map(t=>({call:t,definition:gi(t,i,o,n=>Ci(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?fi(l,i):null,definitions:c.map(({definition:e})=>e)}}function fi(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 pi(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`||bi(e.imported)!==`defineNativeComponent`?[]:[e.local.name]);return t.length===0?[]:[{declaration:e,names:t}]})}function mi(e,t){return e.body.flatMap(e=>{if(e.type===`ExpressionStatement`)return hi(e.expression,t)?[e.expression]:[];if(e.type===`ExportDefaultDeclaration`)return hi(e.declaration,t)?[e.declaration]:[];let n=e.type===`ExportNamedDeclaration`?e.declaration:e;return n?.type===`VariableDeclaration`?n.declarations.flatMap(({init:e})=>hi(e,t)?[e]:[]):[]})}function hi(e,t){return e?.type===`CallExpression`&&e.callee.type===`Identifier`&&t.has(e.callee.name)}function gi(e,t,r,i){if(e.arguments.length!==1)throw i(`defineNativeComponent() requires exactly one entry loader`);let a=xi(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:yi(e.typeArguments,r,i)}}function _i(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 vi(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 yi(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=vi(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=bi(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 bi(e){if(e.type===`Identifier`)return e.name;if(e.type===`Literal`&&typeof e.value==`string`)return e.value}function xi(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&&Si(t.source.value))return t.source.value}function Si(e){return(e.startsWith(`./`)||e.startsWith(`../`))&&n.posix.extname(e)===`.js`}function Ci(e,t,n,r){let i=n.slice(0,r),a=i.split(`
7
+ globalThis.$RefreshSig$ = () => (type) => type;`,map:null}}function Zr(e){if(!/\bhook\.inject\(internals\)/.test(e))throw Error(`React Reconciler must inject its renderer into the DevTools hook`);return{code:`import '${qr}'\n${e}`,map:null}}function Qr(e){return e.name===`client`}function $r(e,t){let r=Kr(e.options.hmr,e.runtime.modules),i=null;return[{name:`vpt:mini-dev`,apply:`serve`,applyToEnvironment:Qr,config(){return{define:{"performance.now":`Date.now`},build:{emptyOutDir:!1,sourcemap:!1},experimental:{bundledDev:!0},server:{ws:{path:vr}}}},configureServer:{order:`post`,async handler(a){yt(n.resolve(a.config.root,a.config.build.outDir)),i=await Dr({server:a,contract:e,styles:t,hmrMode:r})}},generateBundle:{order:`post`,handler(t,n){ei(n,e.styles.appFileName)}},closeBundle(){return i?.close()}},{name:`vpt:mini-runtime-lowering`,apply:`serve`,transform:{order:`post`,filter:{id:we(St)},handler(e){return ti(e)}}},...r.plugins,...Yr()]}function ei(e,t){delete e[t]}const ti=bt(e=>c(e,St,{lang:`js`,target:je,sourcemap:!1,assumptions:{setPublicClassFields:!0}})),ni=P(`global/vpt-global`),ri=`common/vpt/global.js`;function ii(e){function t(t){let r=n.posix.relative(n.posix.dirname(e.getPhysicalChunkId(t)),ri),i=r.startsWith(`.`)?r:`./${r}`;return`require(${JSON.stringify(i)}).vptGlobal`}return[{name:`vpt:mini-global`,resolveId:{filter:{id:we(Ct)},handler(){return Ct}},load:{filter:{id:we(Ct)},handler(){return`export const vptGlobal = __VPT_GLOBAL__;`}},config(){return{build:{rolldownOptions:{transform:{inject:{globalThis:[Ct,`vptGlobal`]}}}}}},renderChunk:{order:`pre`,filter:{code:/__VPT_GLOBAL__/},handler(e,n,r){if(n.moduleIds.includes(`\0vpt:global-binding`)||n.moduleIds.includes(`\0rolldown/runtime.js`))return c(e,n.fileName,{define:{__VPT_GLOBAL__:t(n)},sourcemap:!!r.sourcemap})}},generateBundle:{order:`post`,async handler(e){let t=await ai({dir:e.dir,minify:e.minify!==!1,sourcemap:e.sourcemap});for(let e of t.output)e.type===`asset`?this.emitFile({type:`asset`,fileName:e.fileName,source:e.source}):this.emitFile({type:`prebuilt-chunk`,fileName:e.fileName,code:e.code,exports:e.exports,facadeModuleId:ni,isEntry:!0})}}},{name:`vpt:mini-global-dev`,apply:`serve`,renderChunk:{order:`pre`,filter:{code:/__rolldown_runtime__/},handler(e,n){return{code:(n.moduleIds.includes(`\0rolldown/runtime.js`)?`let __rolldown_runtime__;
8
+ `:`const __rolldown_runtime__ = ${t(n)}.__rolldown_runtime__;\n`)+e,map:null}}}}]}const ai=bt(e=>f({input:ni,transform:{target:je},output:{...e,format:`cjs`,strict:!0,generatedCode:{symbols:!1},entryFileNames:ri},write:!1}),{getCacheKey:e=>JSON.stringify(e)});function oi(e){return e?.[`vpt:native-components`]?.assetBytes??0}function si(e){return e?.[`vpt:native-components`]?.sources??[]}async function ci(e,t){await li(e.folder),await ui(e);let n=[];return await di(e.folder,[],n,o(t)),{...e,assets:n}}async function li(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 ui(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 di(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 di(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 fi(e,t,r){let i=Te(t),a=te(e,{astType:`ts`,lang:`tsx`,preserveParens:!1,sourceType:`module`},i),o=vi(a),s=mi(a),c=hi(a,new Set(s.flatMap(e=>e.names))).map(t=>({call:t,definition:_i(t,i,o,n=>wi(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?pi(l,i):null,definitions:c.map(({definition:e})=>e)}}function pi(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 mi(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`||xi(e.imported)!==`defineNativeComponent`?[]:[e.local.name]);return t.length===0?[]:[{declaration:e,names:t}]})}function hi(e,t){return e.body.flatMap(e=>{if(e.type===`ExpressionStatement`)return gi(e.expression,t)?[e.expression]:[];if(e.type===`ExportDefaultDeclaration`)return gi(e.declaration,t)?[e.declaration]:[];let n=e.type===`ExportNamedDeclaration`?e.declaration:e;return n?.type===`VariableDeclaration`?n.declarations.flatMap(({init:e})=>gi(e,t)?[e]:[]):[]})}function gi(e,t){return e?.type===`CallExpression`&&e.callee.type===`Identifier`&&t.has(e.callee.name)}function _i(e,t,r,i){if(e.arguments.length!==1)throw i(`defineNativeComponent() requires exactly one entry loader`);let a=Si(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:bi(e.typeArguments,r,i)}}function vi(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 yi(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 bi(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=yi(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=xi(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 xi(e){if(e.type===`Identifier`)return e.name;if(e.type===`Literal`&&typeof e.value==`string`)return e.value}function Si(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&&Ci(t.source.value))return t.source.value}function Ci(e){return(e.startsWith(`./`)||e.startsWith(`../`))&&n.posix.extname(e)===`.js`}function wi(e,t,n,r){let i=n.slice(0,r),a=i.split(`
9
9
  `).length,o=r-i.lastIndexOf(`
10
- `);return Error(`${e}\n${t}:${a}:${o}`)}async function wi({code:e,id:t,sourcemap:r,addWatchFile:i}){let a=di(e,t,r),s=Te(t),c=await Promise.all(a.definitions.map(e=>si(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}}}}function Ti(){return{name:`vpt:mini-native-component`,transform:{order:`pre`,filter:{code:ye},handler(e,t){return wi({code:e,id:t,sourcemap:!!this.environment.config.build.sourcemap,addWatchFile:e=>this.addWatchFile(e)})}}}}async function Ei({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=oi(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 Di({bundle:e,contract:t,subpackages:n,isProduction:r,getModuleInfo:i,getPackageLocation:a}){let o=await Ei({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 Oi=`sub/p_`,ki={kind:`main`};function Ai({chunks:e,planningBudgetBytes:t,getAdditionalModuleBytes:n}){let r=new Map(Object.entries(e).sort(([e],[t])=>e.localeCompare(t))),i=new Map([...r.values()].flatMap(e=>e.facadeModuleId===null?[]:[[e.facadeModuleId,e]])),a=ji(r),o=Mi({chunks:r,mainChunkIds:a}),s=Pi({chunks:[...r].filter(([e])=>!a.has(e)).map(([e,t])=>({chunkId:e,estimatedBytes:Bi(t)+t.moduleIds.reduce((e,t)=>e+n(t),0),transitions:o.get(e)??new Set})),planningBudgetBytes:t}).map(Vi),c=new Map;for(let e of a)c.set(e,ki);for(let e of s)for(let t of e.chunkIds)c.set(t,e);function l(e){let t=c.get(e);if(!t)throw Error(`Mini Program placement is missing final chunk: ${e}`);return t}function u(e){return l(`preliminaryFileName`in e?e.preliminaryFileName:e.fileName)}return{getPackageLocation:u,getPhysicalChunkId(e){let t=typeof e==`string`?i.get(e):e;if(!t)throw Error(`Mini Program placement is missing entry module: ${e}`);let n=u(t);return n.kind===`main`?t.fileName:`${n.root}/${t.fileName}`},getLoadMode(e){return u(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=l(e.preliminaryFileName);t.kind===`subpackage`&&(e.fileName=`${t.root}/${e.fileName}`,n.add(t.root))}return[...n].sort().map(e=>({root:e}))}}}function ji(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 Mi({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 Ni({rootId:a,chunks:e,mainChunkIds:t})){let e=n.get(i)??new Set;e.add(r),n.set(i,e)}r++}return n}function Ni({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 Pi({chunks:e,planningBudgetBytes:t}){let n=[],r=[...e].sort(Fi);for(let e of r)zi(e.estimatedBytes<=t?Ii({bins:n,chunk:e,planningBudgetBytes:t})??Ri(n):Ri(n),e);return n}function Fi(e,t){return t.transitions.size-e.transitions.size||t.estimatedBytes-e.estimatedBytes||e.chunkId.localeCompare(t.chunkId)}function Ii({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:Li(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 Li(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 Ri(e){let t={chunkIds:[],estimatedBytes:0,transitions:new Set};return e.push(t),t}function zi(e,t){e.chunkIds.push(t.chunkId),e.estimatedBytes+=t.estimatedBytes;for(let n of t.transitions)e.transitions.add(n)}function Bi(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 Vi(e){let t=[...e.chunkIds].sort(),n=x(`sha256`).update(t.join(`\0`)).digest(`hex`).slice(0,8);return{kind:`subpackage`,root:`${Oi}${n}`,chunkIds:t}}function Hi(e){return e.startsWith(Oi)}function Ui(e){return{output:{codeSplitting:{groups:[{name:`polyfills`,test:Ot,priority:200,includeDependenciesRecursively:!1},{name:`vendor`,test:kt,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 Wi(e){let t=At(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:Ui(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:Ai({chunks:i.chunks,planningBudgetBytes:19e5,getAdditionalModuleBytes:e=>ai(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 Gi={document:[xt,`document`],navigator:[xt,`navigator`],requestAnimationFrame:[xt,`requestAnimationFrame`],cancelAnimationFrame:[xt,`cancelAnimationFrame`],Element:[xt,`TaroElement`],SVGElement:[xt,`SVGElement`],MutationObserver:[xt,`MutationObserver`],history:[xt,`history`],location:[xt,`location`]},Ki=Object.fromEntries(Object.keys(Gi).map(e=>[e,`globalThis.${e}`]));function qi(e){let t=[...new Set(e.options.polyfills??[])];return{name:`vpt:mini-polyfills`,config(){return{build:{rolldownOptions:{input:{polyfills:wt},transform:{inject:Gi}}}}},transform:{filter:{id:Dt,code:RegExp(`\\\\|\\b(?:${Object.keys(Gi).join(`|`)})\\b`)},handler(e,t){return c(e,t,{define:Ki,sourcemap:!!this.environment.config.build.sourcemap})}},resolveId:{filter:{id:we(wt)},handler(){return wt}},load:{filter:{id:we(wt)},handler(){return t.map(e=>`import ${JSON.stringify(Ji(e))};`).join(`
11
- `)}}}}function Ji(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 N.resolve(`core-js/modules/${e}.js`)}catch(t){throw Error(`Unknown core-js polyfill module: ${JSON.stringify(e)}.`,{cause:t})}}function Yi(e){return n.posix.normalize(e)}function Xi(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 Zi(e,t){return Yi(Xi(e,t))}var Qi=class{original;#e=new Map;#t=[];constructor(e){this.original=e}overwrite(e,t,n){this.#t.push({content:n,end:t,start:e})}prependLeft(e,t){this.#n(e).prepend.push(t)}appendLeft(e,t){this.#n(e).append.push(t)}appendRight(e,t){this.#n(e).append.push(t)}compile(){let e={original:this.original,replacements:this.#t.toSorted((e,t)=>e.start-t.start||t.end-e.end),insertions:[...this.#e].sort(([e],[t])=>e-t).map(([e,t])=>({start:e,content:t.prepend.toReversed().join(``)+t.append.join(``)}))};return{render:(t,n)=>ea(e,t,n,!0,!0),renderOutside:t=>$i(e,t)}}#n(e){let t=this.#e.get(e);if(t)return t;let n={append:[],prepend:[]};return this.#e.set(e,n),n}};function $i(e,t){let n=[],r=0,i=!0;for(let a of t)n.push(ea(e,r,a.start,i,!1)),r=a.end,i=!1;return n.push(ea(e,r,e.original.length,i,!0)),n.join(``)}function ea(e,t,n,r,i){let a=t,o=ta(e.insertions,t),s=[],c=(n,i)=>{for(;o<e.insertions.length;){let c=e.insertions[o];if(c.start>n||c.start===n&&!i)break;o++,!(c.start<a||c.start===t&&!r)&&(s.push(e.original.slice(a,c.start),c.content),a=c.start)}s.push(e.original.slice(a,n)),a=n};for(let r=ta(e.replacements,t);r<e.replacements.length;r++){let t=e.replacements[r];if(t.start>=n)break;if(!(t.end>n||t.end<=a)){if(t.start<a)throw Error(`Partially overlapping source edits at ${t.start}:${t.end}`);c(t.start,!1),s.push(t.content),a=t.end}}return c(n,i),s.join(``)}function ta(e,t){let n=0,r=e.length;for(;n<r;){let i=Math.floor((n+r)/2);e[i].start<t?n=i+1:r=i}return n}function na(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=ra(t.program,e.filename);if(!e.sourcemap){let t=new Qi(e.code);return sa(t,n),fa(t,n,e),{code:ga(t,n,e),map:null}}let r=new d(e.code,{filename:e.filename});return sa(r,n),fa(r,n,e),_a(r,n,e),{code:r.toString(),map:Ua(r,e.filename)}}function ra(e,t){let n=new Set,r=new Map,i=new Map,a=[],o=[],s=[],c=new Set,l=new Set,u=new ze({preserveExitedScopes:!0}),d=0,f=!1,p=!1;Le(e,{scopeTracker:u,enter(e,t){if(e.type===`Identifier`&&n.add(e.name),e.type===`CallExpression`&&e.callee.type===`Identifier`&&e.callee.name===`eval`&&(f=!0),La(e)&&(d+=1),e.type===`AwaitExpression`&&d===0&&(p=!0),e.type===`VariableDeclaration`&&d===0&&(e.kind===`var`||t?.type===`Program`)&&(o.push(e),e.kind===`var`)){if(t?.type!==`Program`){let n=(t?.type===`ForInStatement`||t?.type===`ForOfStatement`)&&t.left===e;s.push({declaration:e,isForIterationBinding:n})}Ma(e).forEach(e=>{l.add(e)})}},leave(e){La(e)&&--d}});for(let n of e.body)switch(n.type){case`ImportDeclaration`:ia(n,i,c,l,t);break;case`ExportNamedDeclaration`:aa(n,r,t);break;case`ExportDefaultDeclaration`:case`ExportAllDeclaration`:throw Ha(t,`source-level ${n.type}`);case`VariableDeclaration`:Ba(n,t),n.declarations.flatMap(e=>Na(e.id)).forEach(e=>{l.add(e)});break;case`FunctionDeclaration`:{let e=n.id;a.push(n),l.add(e.name);break}case`ClassDeclaration`:{let e=n.id;l.add(e.name);break}}u.freeze(),za(f,t);let m=ka(n,i.size);return oa(r,l,t),{dependencies:[...i.values()],exportNamesByLocal:r,functions:a,generatedNames:m,hasTopLevelAwait:p,importBindings:c,moduleVariables:o,nestedHoistedVariables:s,outerBindings:l,program:e,scopes:u}}function ia(e,t,n,r,i){if(e.phase||e.attributes.length>0||e.importKind===`type`)throw Ha(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:Aa(t.imported),local:t.local.name})}}function aa(e,t,n){if(e.declaration||e.source||e.attributes.length>0||e.exportKind===`type`)throw Ha(n,`declaration exports, re-exports, export attributes, or type-only exports`);for(let n of e.specifiers){let e=Aa(n.local),r=Aa(n.exported),i=t.get(e)??[];i.push(r),t.has(e)||t.set(e,i)}}function oa(e,t,n){for(let r of e.keys())if(!t.has(r))throw Ha(n,`export of non-module binding ${JSON.stringify(r)}`)}function sa(e,t){for(let n of t.program.body)switch(n.type){case`ImportDeclaration`:e.overwrite(n.start,n.end,``);break;case`ExportNamedDeclaration`:e.overwrite(n.start,n.end,ba(n.specifiers,t));break;case`VariableDeclaration`:ca(e,n,t.generatedNames.exportBinding,t.exportNamesByLocal);break;case`ClassDeclaration`:da(e,n,t.generatedNames.exportBinding,t.exportNamesByLocal)}for(let{declaration:n,isForIterationBinding:r}of t.nestedHoistedVariables)la(e,n,r,t.generatedNames.exportBinding,t.exportNamesByLocal)}function ca(e,t,n,r){let i=t.declarations[0];e.overwrite(t.start,i.start,`(`),e.appendLeft(Va(e.original,t.end),`)`),ua(e,t,n,r)}function la(e,t,n,r,i){let a=t.declarations[0];e.overwrite(t.start,a.start,n?``:`(`),n||e.appendLeft(Va(e.original,t.end),`)`),ua(e,t,r,i)}function ua(e,t,n,r){for(let i of t.declarations){if(!i.init)continue;let t=Na(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,Ca(n,t,``)),e.appendRight(i.end,wa(t));continue}e.prependLeft(i.start,`(`),e.appendRight(i.end,`,${t.map(({exported:e,local:t})=>Da(n,e,t)).join(`,`)})`)}}}function da(e,t,n,r){let i=t.id,a=r.get(i.name)??[];e.prependLeft(t.start,Ca(n,a,`${i.name}=`)),e.appendRight(t.end,wa(a))}function fa(e,t,n){let r=t.scopes,i=0;Le(t.program,{scopeTracker:r,enter(a){switch(Ra(a)&&(i+=1),a.type){case`ImportExpression`:if(a.options||a.phase)throw Ha(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`:pa(e,a.left,a.start,a.end,r,t,n.filename);break;case`UpdateExpression`:ma(e,a,r,t);break;case`ForInStatement`:case`ForOfStatement`:a.left.type!==`VariableDeclaration`&&ha(a.left,r,t.exportNamesByLocal,n.filename)}},leave(e){Ra(e)&&--i}})}function pa(e,t,n,r,i,a,o){if(t.type===`Identifier`){let o=Sa(t.name,i,a.exportNamesByLocal);if(o.length===0)return;e.prependLeft(n,Ca(a.generatedNames.exportBinding,o,``)),e.appendRight(r,wa(o));return}ha(t,i,a.exportNamesByLocal,o)}function ma(e,t,n,r){if(t.argument.type!==`Identifier`)return;let i=Sa(t.argument.name,n,r.exportNamesByLocal);if(i.length===0)return;if(t.prefix){e.prependLeft(t.start,Ca(r.generatedNames.exportBinding,i,``)),e.appendRight(t.end,wa(i));return}let a=`+${t.argument.name}${t.operator[0]}1`;e.prependLeft(t.start,`(${Ta(r.generatedNames.exportBinding,i,a)},`),e.appendRight(t.end,`)`)}function ha(e,t,n,r){let i=Pa(e).filter(e=>Sa(e,t,n).length>0);if(i.length>0)throw Ha(r,`destructuring write to exported binding ${JSON.stringify(i[0])}`)}function ga(e,t,n){let r=va(t,n),i=e.compile(),a=t.functions.map(e=>i.render(e.start,e.end)).join(``);return`${r.prefix}${i.renderOutside(t.functions)}}};${a}${r.suffix}`}function _a(e,t,n){let r=va(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 va(e,t){let n=e.dependencies.map(e=>t.resolveReference(e.source,`static`)),r=e.dependencies.map((t,n)=>xa(t,n,e.generatedNames)),i=ya(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 ya(e){let t=new Set(e.functions.map(e=>e.id.name)),n=[];for(let[r,i]of e.exportNamesByLocal)if(t.has(r))for(let e of i)n.push({exported:e,value:r});for(let t of e.moduleVariables)for(let r of t.declarations)if(!r.init)for(let t of Na(r.id))for(let r of e.exportNamesByLocal.get(t)??[])n.push({exported:r,value:`void 0`});if(n.length===0)return``;if(n.length===1){let[t]=n;return Oa(e.generatedNames.exportBinding,t.exported,t.value)}let r=n.map(({exported:e,value:t})=>`[${JSON.stringify(e)}]:${t}`).join(`,`);return`${e.generatedNames.exportBinding}({${r}});`}function ba(e,t){return e.filter(e=>t.importBindings.has(Aa(e.local))).map(e=>{let n=Aa(e.local);return Oa(t.generatedNames.exportBinding,Aa(e.exported),n)}).join(``)}function xa(e,t,n){let r=`${n.dependencyPrefix}${t}`;return`function(${r}){${e.imports.flatMap(e=>{let t=e.imported===null?r:ja(r,e.imported);return[`${e.local}=${t};`]}).join(``)}}`}function Sa(e,t,n){let r=n.get(e)??[];return r.length===0||t.getDeclaration(e)?.scope===``?r:[]}function Ca(e,t,n){return t.length===0?n:t.reduce((t,n)=>`${Ea(e,n)}${t}`,n)}function wa(e){return`)`.repeat(e.length)}function Ta(e,t,n){return t.reduce((t,n)=>`${Ea(e,n)}${t})`,n)}function Ea(e,t){return`${e}(${JSON.stringify(t)},`}function Da(e,t,n){return`${e}(${JSON.stringify(t)},${n})`}function Oa(e,t,n){return`${e}(${JSON.stringify(t)},${n});`}function ka(e,t){let n=t=>{let n=0,r=t;for(;e.has(r);)n+=1,r=`${t}${n}`;return r};return{context:n(`__systemContext`),exportBinding:n(`__systemExport`),dependencyPrefix:(n=>{let r=0,i=n;for(;;){let a=0;for(;a<t&&!e.has(`${i}${a}`);)a+=1;if(a===t)return i;r+=1,i=`${n}${r}`}})(`__systemDependency`)}}function Aa(e){return e.type===`Literal`?String(e.value):e.name}function ja(e,t){return/^[$A-Z_a-z][$\w]*$/.test(t)?`${e}.${t}`:`${e}[${JSON.stringify(t)}]`}function Ma(e){return e.declarations.flatMap(e=>Na(e.id))}function Na(e){return Fa(e)}function Pa(e){return Fa(e)}function Fa(e){switch(e.type){case`Identifier`:return[e.name];case`AssignmentPattern`:return Fa(e.left);case`ArrayPattern`:return e.elements.flatMap(e=>e?Fa(e):[]);case`ObjectPattern`:return e.properties.flatMap(e=>e.type===`Property`?Fa(e.value):Fa(e.argument));case`RestElement`:return Fa(e.argument);default:return[]}}function Ia(e){return e.type===`FunctionDeclaration`||e.type===`FunctionExpression`||e.type===`ArrowFunctionExpression`||e.type===`TSEmptyBodyFunctionExpression`}function La(e){return Ia(e)||e.type===`ClassDeclaration`||e.type===`ClassExpression`}function Ra(e){return Ia(e)&&e.type!==`ArrowFunctionExpression`||e.type===`ClassDeclaration`||e.type===`ClassExpression`}function za(e,t){if(e)throw Ha(t,`direct eval`)}function Ba(e,t){if(e.kind===`using`||e.kind===`await using`||e.declare)throw Ha(t,`using or ambient variable declaration`)}function Va(e,t){return e[t-1]===`;`?t-1:t}function Ha(e,t){return Error(`Unsupported final Rolldown chunk ${e}: ${t}`)}function Ua(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 Wa(e,t,n){return na({code:e,filename:t.fileName,format:`commonjs-registration`,sourcemap:n,resolveReference(e,n){return Ga(t.fileName,e,n)}})}function Ga(e,t,n){return n===`dynamic`&&!t.startsWith(`./`)&&!t.startsWith(`../`)?t:Zi(e,t)}function Ka({code:e,chunk:t,chunks:n,bootstrapModuleId:r,getPhysicalChunkId:i,classifyModule:a,sourcemap:o}){let s=p(t.fileName,e);if(s.errors.length>0){let e=s.errors.map(e=>e.message).join(`; `);throw Error(`Failed to parse ${t.fileName} with Oxc: ${e}`)}let c=qa(s.program,t,n,r,i,a),l=new d(e,{filename:t.fileName});Ya(l,c,t.fileName);let u=Xa(l,c,t.fileName);Ja(l,c);let f=c.exportNamesByLocal.size>0,m=ho(c),h=u?`var ${c.postfixTemp};`:``,g=po(c);return f?l.prepend(`"use strict";Object.defineProperty(exports,"__esModule",{value:true});${m}${h}${g}`):l.prepend(`"use strict";${m}${h}${g}`),{code:l.toString(),map:o?Co(l,t.fileName):null}}function qa(e,t,r,i,a,o){let s=new Set,c=new Map,l=[],u=new Map,d=new ze({preserveExitedScopes:!0}),f=[],m=!1;if(Le(e,{scopeTracker:d,enter(e){e.type===`Identifier`&&s.add(e.name),e.type===`CallExpression`&&e.callee.type===`Identifier`&&e.callee.name===`eval`&&(m=!0),e.type===`ImportExpression`&&f.push(e)}}),d.freeze(),m)throw So(t.fileName,`direct eval`);let h=0;function g(e,t){let n=t;if(n===void 0){for(n=h===0?`__nativeImport`:`__nativeImport${h}`;s.has(n);)h+=1,n=`__nativeImport${h}`;s.add(n),h+=1}let r=n;return{bindings:e.specifiers.map(e=>{let t={imported:e.type===`ImportNamespaceSpecifier`?null:e.type===`ImportDefaultSpecifier`?`default`:vo(e.imported),local:e.local.name,namespace:r};return u.set(t.local,t),t}),capsuleBinding:null,interop:mo(e),namespace:r,reference:e.source.value}}for(let n of e.body)switch(n.type){case`ImportDeclaration`:{go(n,t.fileName);let e=fo(t.fileName,n.source.value,r,o);if(e){let[r]=n.specifiers;if(n.specifiers.length!==1||!r||r.type===`ImportNamespaceSpecifier`)throw Error(`Expected one capsule value import from ${e.fileName} in ${t.fileName}`);l.push({bindings:[],capsuleBinding:{imported:r.type===`ImportDefaultSpecifier`?`default`:vo(r.imported),local:r.local.name,logicalId:Zi(t.fileName,n.source.value)},interop:`none`,namespace:``,reference:n.source.value});continue}l.push(g(n,void 0));break}case`ExportNamedDeclaration`:to(n,c,t.fileName);break;case`ExportDefaultDeclaration`:case`ExportAllDeclaration`:throw So(t.fileName,`source-level ${n.type}`)}if(f.length>0||l.some(e=>e.capsuleBinding)){let e=n.posix.relative(n.posix.dirname(a(t)),a(i)),r=e.startsWith(`../`)?e:`./${e}`,o=_o(`__nativeSystem`,s),c=p(t.fileName,`import { System as ${o} } from ${JSON.stringify(r)}`).program.body[0],u=l.findIndex(e=>e.reference===r),d=u<0?void 0:l.splice(u,1)[0],f=g(c,d?.namespace);l.unshift(d?{...d,bindings:[...f.bindings,...d.bindings]}:f)}return{defaultInterop:_o(`__nativeDefault`,s),dynamicImports:f,exportNamesByLocal:c,imports:l,importBindingsByLocal:u,namespaceInterop:_o(`__nativeNamespace`,s),postfixTemp:_o(`__nativePostfix`,s),program:e,scopes:d}}function Ja(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),no(e,n.declaration,t.exportNamesByLocal)):e.overwrite(n.start,n.end,ro(n.specifiers,t));break;case`VariableDeclaration`:io(e,n,t.exportNamesByLocal);break;case`FunctionDeclaration`:n.id&&ao(e,n.end,n.id.name,t.exportNamesByLocal);break;case`ClassDeclaration`:n.id&&ao(e,n.end,n.id.name,t.exportNamesByLocal)}}function Ya(e,t,n){for(let r of t.dynamicImports){if(r.options||r.phase)throw So(n,`dynamic import options or phases`);let i=lo(t.imports[0].bindings[0]);e.overwrite(r.start,r.source.start,`${i}.import(`),r.source.type===`Literal`&&typeof r.source.value==`string`&&(r.source.value.startsWith(`./`)||r.source.value.startsWith(`../`))&&e.overwrite(r.source.start,r.source.end,JSON.stringify(Zi(n,r.source.value)))}}function Xa(e,t,n){let r=[],i=0,a=!1;return Le(t.program,{scopeTracker:t.scopes,enter(o,s){if(xo(o)&&(i+=1),o.type===`ThisExpression`&&i===0&&e.overwrite(o.start,o.end,`void 0`),o.type===`Identifier`&&s?.type!==`ImportDeclaration`&&Ue(o,s)){let n=t.importBindingsByLocal.get(o.name),i=n?t.scopes.getDeclaration(o.name):null;if(n&&i?.type===`Import`){let t=co(o,s,r),i=lo(n),a=t===`unbound`?`(0,${i})`:i;e.overwrite(o.start,o.end,s?.type===`Property`&&s.shorthand&&s.value===o?`${o.name}:${a}`:a)}}switch(o.type){case`AssignmentExpression`:Za(e,o.left,o.start,t,n);break;case`UpdateExpression`:Qa(e,o,t)&&(a=!0);break;case`ForInStatement`:case`ForOfStatement`:o.left.type!==`VariableDeclaration`&&$a(o.left,t,n)}r.push(o)},leave(e){r.pop(),xo(e)&&--i}}),a}function Za(e,t,n,r,i){if(t.type===`Identifier`){let i=eo(t.name,r);i.length>0&&e.prependLeft(n,oo(i));return}$a(t,r,i)}function Qa(e,t,n){if(t.argument.type!==`Identifier`)return!1;let r=eo(t.argument.name,n);return r.length===0?!1:t.prefix?(e.prependLeft(t.start,oo(r)),!1):(e.prependLeft(t.start,`(${n.postfixTemp}=`),e.appendRight(t.end,`,${so(r,t.argument.name)},${n.postfixTemp})`),!0)}function $a(e,t,n){let r=bo(e).filter(e=>eo(e,t).length>0);if(r.length>0)throw So(n,`destructuring write to exported binding ${JSON.stringify(r[0])}`)}function eo(e,t){let n=t.exportNamesByLocal.get(e)??[];return n.length===0||t.scopes.getDeclaration(e)?.scope===``?n:[]}function to(e,t,n){if(e.source||e.attributes.length>0||e.exportKind===`type`)throw So(n,`re-exports, export attributes, or type-only exports`);if(e.declaration){for(let r of yo(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=vo(n.local),r=t.get(e)??[];r.push(vo(n.exported)),t.has(e)||t.set(e,r)}}function no(e,t,n){switch(t.type){case`VariableDeclaration`:io(e,t,n);break;case`FunctionDeclaration`:case`ClassDeclaration`:t.id&&ao(e,t.end,t.id.name,n)}}function ro(e,t){return e.map(e=>{let n=vo(e.local),r=vo(e.exported),i=t.importBindingsByLocal.get(n);return i?`Object.defineProperty(exports,${JSON.stringify(r)},{enumerable:true,get:function(){return ${lo(i)}}});`:``}).join(``)}function io(e,t,n){for(let r of t.declarations){if(r.id.type!==`Identifier`){if(bo(r.id).filter(e=>n.has(e)).length>0)throw So(`native chunk`,`exported destructuring declaration`);continue}let t=n.get(r.id.name)??[];t.length!==0&&(r.init?e.prependLeft(r.init.start,oo(t)):e.appendRight(r.end,`=${so(t,`void 0`)}`))}}function ao(e,t,n,r){let i=r.get(n)??[];i.length>0&&e.appendRight(t,`;${so(i,n)};`)}function oo(e){return e.reduce((e,t)=>`exports[${JSON.stringify(t)}]=${e}`,``)}function so(e,t){return`${oo(e)}${t}`}function co(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 lo(e){return e.imported===null?e.namespace:uo(e.namespace,e.imported)}function uo(e,t){return/^[$A-Z_a-z][$\w]*$/.test(t)?`${e}.${t}`:`${e}[${JSON.stringify(t)}]`}function fo(e,t,n,r){if(!t.startsWith(`./`)&&!t.startsWith(`../`))return;let i=n[Xi(e,t)];return i&&r(i).entryRole===`capsule`?i:void 0}function po(e){return e.imports.map(t=>{if(t.capsuleBinding){let{imported:n,local:r,logicalId:i}=t.capsuleBinding;return`var ${r}=${uo(`${lo(e.imports[0].bindings[0])}.importSync(${JSON.stringify(i)})`,n)};`}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 mo(e){return e.specifiers.some(e=>e.type===`ImportNamespaceSpecifier`)?`namespace`:e.specifiers.some(e=>e.type===`ImportDefaultSpecifier`)?`default`:`none`}function ho(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 go(e,t){if(e.phase||e.attributes.length>0||e.importKind===`type`)throw So(t,`import phases, attributes, or type-only imports`)}function _o(e,t){let n=0,r=e;for(;t.has(r);)n+=1,r=`${e}${n}`;return t.add(r),r}function vo(e){return e.type===`Literal`?String(e.value):e.name}function yo(e,t){return e.type===`VariableDeclaration`?e.declarations.flatMap(({id:e})=>bo(e)):[e.id.name]}function bo(e){switch(e.type){case`Identifier`:return[e.name];case`AssignmentPattern`:return bo(e.left);case`ArrayPattern`:return e.elements.flatMap(e=>e?bo(e):[]);case`ObjectPattern`:return e.properties.flatMap(e=>e.type===`Property`?bo(e.value):bo(e.argument));case`RestElement`:return bo(e.argument);default:return[]}}function xo(e){return e.type===`FunctionDeclaration`||e.type===`FunctionExpression`||e.type===`ClassDeclaration`||e.type===`ClassExpression`}function So(e,t){return Error(`Unsupported final Rolldown native chunk ${e}: ${t}`)}function Co(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}}async function wo({code:e,transportChunk:t,chunks:n,classifyModule:r,getLoadMode:i,getPhysicalChunkId:a,sourcemap:o}){let s=To({transportChunk:t,chunks:n,classifyModule:r,getLoadMode:i,getPhysicalChunkId:a??(e=>e.fileName)});return ct(e,t.fileName,{__VPT_TRANSPORT__:s},o??!0)}function To({transportChunk:e,chunks:t,classifyModule:r,getLoadMode:i,getPhysicalChunkId:a}){let o=n.posix.dirname(a(e));return`function(moduleId){switch(moduleId){${Object.values(t).map(e=>({chunk:e,kind:r(e).executionKind})).filter(({kind:e})=>e!==`native`).sort((e,t)=>e.chunk.fileName.localeCompare(t.chunk.fileName)).map(({chunk:e,kind:t})=>{let r=i(e);if(t===`amphibious`&&r!==`sync`)throw Error(`Amphibious module must be in the main package: ${e.fileName}`);let s=n.posix.relative(o,a(e)),c=JSON.stringify(s.startsWith(`.`)?s:`./${s}`),l=`${r===`sync`?`require`:`require.async`}(${c})`,u=t===`capsule`?l:`[[],function(exportBinding){return {execute:function(){exportBinding(${l})}}}]`;return`case ${JSON.stringify(Yi(e.fileName))}:return ${u};`}).join(``)}default:throw new Error('Unknown module: '+moduleId)}}`}function Eo({code:e,id:t,appConfig:n,sourcemap:r}){return ct(e,t,{__VPT_APP_CONFIG__:JSON.stringify(n)},r??!1)}function Do({code:e,id:t,page:n,sourcemap:r}){return ct(e,t,{__VPT_PAGE_PATH__:JSON.stringify(n.path),__VPT_PAGE_CONFIG__:JSON.stringify(at(n))},r??!1)}function Oo(e){let t=o(e.runtime.modules.appCapsule),n=o(e.runtime.modules.pageCapsule),r=ko(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)=>xe({appPath:e.options.app,projectRoot:n})],[`\0vpt:page-component`,(e,t)=>Se({pagePath:jo({moduleId:e,pageByPath:i}).path,projectRoot:t})],[`\0vpt:page-capsule`,t=>{let n=jo({moduleId:t,pageByPath:i});return Ao({moduleId:e.runtime.modules.pageCapsule,pagePath:n.path})}]]);return{...r,resolveId(e,t,n){return a.get(e)?.(t,n)},specialize(r,a,o){let s=Te(a);if(s===t)return Eo({code:r,id:a,appConfig:ot(e.options),sourcemap:o});if(s===n)return Do({code:r,id:a,page:jo({moduleId:a,pageByPath:i}),sourcemap:o})}}}function ko(e,t){let n=e.map(e=>({capsuleId:Ao({moduleId:t.pageCapsule,pagePath:e.path}),capsuleName:`${e.path}-capsule`,shellId:Ao({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 Ao({moduleId:e,pagePath:t}){return`${e}?route=${encodeURIComponent(t)}`}function jo({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 Mo;(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`})(Mo||={});var No;(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`})(No||={});var Po;(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`})(Po||={});var Fo;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(Fo||={});var Io;(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`})(Io||={});var Lo;(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`})(Lo||={});var Ro;(function(e){e[e.NoValue=0]=`NoValue`,e[e.Unquoted=1]=`Unquoted`,e[e.Single=2]=`Single`,e[e.Double=3]=`Double`})(Ro||={});const zo={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])};zo.IframeEnd[2],zo.IframeEnd,zo.NoembedEnd[2],zo.NoembedEnd,zo.Plaintext[2],zo.Plaintext,zo.ScriptEnd[2],zo.ScriptEnd,zo.TitleEnd[2],zo.TitleEnd,zo.XmpEnd[2],zo.XmpEnd;const{fromCodePoint:Bo}=String;var Vo;(function(e){e[e.None=0]=`None`,e[e.Svg=1]=`Svg`,e[e.MathML=2]=`MathML`})(Vo||={});let Ho=()=>{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:()=>Ie});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(re(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=re(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(re);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(re);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=re(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)=>re(e),ne=(()=>{let e=0;return t=>{let n=re(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}}}})(),D=e=>{let t;return n=>(t||=re(e()),t(n))},re=g(e=>{if(l(e))return u(e)?D(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`)}),ie=`abcdefghijklmnopqrstuvwxyz`,ae=e=>{let t=``;for(;e>0;)t=ie[(e-1)%26]+t,e=Math.floor((e-1)/26);return t},oe=e=>{let t=0;for(let n=0,r=e.length;n<r;n++)t=t*26+ie.indexOf(e[n])+1;return t},se=(e,t)=>{if(t<e)return se(t,e);let n=[];for(;e<=t;)n.push(e++);return n},ce=(e,t,n)=>se(e,t).map(e=>String(e).padStart(n,`0`)),le=(e,t)=>se(oe(e),oe(t)).map(ae),O=e=>e,ue=e=>de(t=>_(t,e,{memoization:!1}).join(``)),de=e=>{let t={};return n=>t[n]??(t[n]=e(n))},fe=v(/^\*\*\/\*$/,`.*`),k=v(/^\*\*\/(\*)?([ a-zA-Z0-9._-]+)$/,(e,t,n)=>`.*${t?``:`(?:^|/)`}${n.replaceAll(`.`,`\\.`)}`),A=v(/^\*\*\/(\*)?([ a-zA-Z0-9._-]*)\{([ a-zA-Z0-9._-]+(?:,[ a-zA-Z0-9._-]+)*)\}$/,(e,t,n,r)=>`.*${t?``:`(?:^|/)`}${n.replaceAll(`.`,`\\.`)}(?:${r.replaceAll(`,`,`|`).replaceAll(`.`,`\\.`)})`),pe=v(/\\./,O),j=v(/[$.*+?^(){}[\]\|]/,e=>`\\${e}`),me=v(/./,O),M=T([v(/^(?:!!)*!(.*)$/,(e,t)=>`(?!^${je(t)}$).*?`),v(/^(!!)+/,``)]),he=T([v(/\/(\*\*\/)+/,`(?:/.+/|/)`),v(/^(\*\*\/)+/,`(?:^|.*/)`),v(/\/(\*\*)$/,`(?:/.*|$)`),v(/\*\*/,`.*`)]),N=T([v(/\*\/(?!\*\*\/)/,`[^/]*/`),v(/\*/,`[^/]*`)]),ge=v(`?`,`[^/]`),_e=v(`[`,O),ve=v(`]`,O),P=v(/[!^]/,`^/`),ye=v(/[a-z]-[a-z]|[0-9]-[0-9]/i,O),be=T([pe,v(/[$.*+?^(){}[\|]/,e=>`\\${e}`),ye,v(/[^\]]/,O)]),xe=ee([_e,C(P),w(be),ve]),Se=v(`{`,`(?:`),Ce=v(`}`,`)`),we=ee([Se,T([v(/(\d+)\.\.(\d+)/,(e,t,n)=>ce(+t,+n,Math.min(t.length,n.length)).join(`|`)),v(/([a-z]+)\.\.([a-z]+)/,(e,t,n)=>le(t,n).join(`|`)),v(/([A-Z]+)\.\.([A-Z]+)/,(e,t,n)=>le(t.toLowerCase(),n.toLowerCase()).join(`|`).toUpperCase())]),Ce]),Te=v(`{`,`(?:`),Ee=v(`}`,`)`),De=v(`,`,`|`),Oe=v(/[$.*+?^(){[\]\|]/,e=>`\\${e}`),ke=v(/[^}]/,O),Ae=ee([Te,w(T([he,N,ge,xe,we,D(()=>Ae),pe,Oe,De,ke])),Ee]),je=ue(w(T([fe,k,A,M,he,N,ge,xe,we,Ae,pe,j,me]))),Me=v(/\\./,O),Ne=v(/./,O),Pe=ue(w(T([Me,v(/\*\*\*+/,`*`),v(/([^/{[(!])\*\*/,(e,t)=>`${t}*`),v(/(^|.)\*\*(?=[^*/)\]}])/,(e,t)=>`${t}*`),Ne]))),Fe=(e,t)=>{let n=Array.isArray(e)?e:[e];if(!n.length)return!1;let r=n.map(Fe.compile),i=n.every(e=>/(\/(?:\*\*)?|\[\/\])$/.test(e)),a=t.replace(/[\\\/]+/g,`/`).replace(/\/$/,i?`/`:``);return r.some(e=>e.test(a))};Fe.compile=e=>RegExp(`^${je(Pe(e))}$`,`s`);var Ie=Fe;return o(s)})();return e.default||e},Uo;const Wo=(e,t)=>(Uo||(Uo=Ho(),Ho=null),Uo(e,t)),Go=/^[A-Za-z]:\//;function Ko(e=``){return e&&e.replace(/\\/g,`/`).replace(Go,e=>e.toUpperCase())}const qo=/^[/\\]{2}/,Jo=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/,Yo=/^[A-Za-z]:$/,Xo=/^\/([A-Za-z]:)?$/,Zo=/.(\.[^./]+|\.)$/,Qo=/^[/\\]|^[a-zA-Z]:[/\\]/,$o=function(e){if(e.length===0)return`.`;e=Ko(e);let t=e.match(qo),n=is(e),r=e[e.length-1]===`/`;return e=rs(e,!n),e.length===0?n?`/`:r?`./`:`.`:(r&&(e+=`/`),Yo.test(e)&&(e+=`/`),t?n?`//${e}`:`//./${e}`:n&&!is(e)?`/${e}`:e)},es=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 $o(t)};function ts(){return typeof process<`u`&&typeof process.cwd==`function`?process.cwd().replace(/\\/g,`/`):`/`}const ns=function(...e){e=e.map(e=>Ko(e));let t=``,n=!1;for(let r=e.length-1;r>=-1&&!n;r--){let i=r>=0?e[r]:ts();i&&i.length!==0&&(t=`${i}/${t}`,n=is(i))}return t=rs(t,!n),n&&!is(t)?`/${t}`:t.length>0?t:`.`};function rs(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 is=function(e){return Jo.test(e)},as=function(e){return Ko(e)},os=function(e){if(e===`..`)return``;let t=Zo.exec(Ko(e));return t&&t[1]||``},ss=function(e,t){let n=ns(e).replace(Xo,`$1`).split(`/`),r=ns(t).replace(Xo,`$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(`/`)},cs=function(e){let t=Ko(e).replace(/\/$/,``).split(`/`).slice(0,-1);return t.length===1&&Yo.test(t[0])&&(t[0]+=`/`),t.join(`/`)||(is(e)?`/`:`.`)},ls=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 Ko(e.root?ns(...n):n.join(`/`))},us=function(e,t){let n=Ko(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},ds={__proto__:null,basename:us,dirname:cs,extname:os,format:ls,isAbsolute:is,join:es,matchesGlob:(e,t)=>Wo(t,$o(e)),normalize:$o,normalizeString:rs,parse:function(e){let t=Qo.exec(e)?.[0]?.replace(/\\/g,`/`)||``,n=us(e),r=os(n);return{root:t,dir:cs(e),base:n,ext:r,name:n.slice(0,n.length-r.length)}},relative:ss,resolve:ns,sep:`/`,toNamespacedPath:as},fs=globalThis.process?.platform===`win32`?`;`:`:`,ps={posix:void 0,win32:void 0},ms=(e=fs)=>new Proxy(ds,{get(t,n){return n===`delimiter`?e:n===`posix`?hs:n===`win32`?gs:ps[n]||ds[n]}}),hs=ms(`:`),gs=ms(`;`);var _s=j(((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}}})),vs=j(((e,t)=>{let n=jt(),r=_s(),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(`
12
- `):e[1]}return n}c.registerInput=a,t.exports=c})),ys=j(((e,t)=>{let n=jt(),r=vs();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)+`
10
+ `);return Error(`${e}\n${t}:${a}:${o}`)}async function Ti({code:e,id:t,sourcemap:r,addWatchFile:i}){let a=fi(e,t,r),s=Te(t),c=await Promise.all(a.definitions.map(e=>ci(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}}}}function Ei(){return{name:`vpt:mini-native-component`,transform:{order:`pre`,filter:{code:ye},handler(e,t){return Ti({code:e,id:t,sourcemap:!!this.environment.config.build.sourcemap,addWatchFile:e=>this.addWatchFile(e)})}}}}function Di(e){return n.posix.normalize(e)}function Oi(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 ki(e,t){return Di(Oi(e,t))}function Ai({bundle:e,classifyModule:t,getPackageLocation:r}){let i=[],a=n.posix.dirname(Tt);for(let o of Object.keys(e).sort()){let s=e[o];if(s.type!==`chunk`)continue;let c=t(s);if(c===`native`)continue;let l=r(s),u=l.kind===`subpackage`;if(c===`amphibious`&&u)throw Error(`Amphibious module must be in the main package: ${s.fileName}`);let d=Di(u?s.fileName.slice(l.root.length+1):s.fileName),f=n.posix.relative(a,s.fileName),p=JSON.stringify(f.startsWith(`.`)?f:`./${f}`),m=`${u?`require.async`:`require`}(${p})`,h=c===`amphibious`?`[[],function(e){return{execute:function(){e(${m})}}}]`:m;i.push(`case ${JSON.stringify(d)}:return ${h};`)}return{type:`asset`,fileName:Tt,source:`"use strict";exports.transport=function(m){switch(m){${i.join(``)}default:throw new Error('Unknown module: '+m)}};`}}async function ji({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=si(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 Mi({bundle:e,contract:t,subpackages:n,isProduction:r,getModuleInfo:i,getPackageLocation:a}){let o=await ji({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 Ni=`sub/p_`,Pi={kind:`main`};function Fi({chunks:e,planningBudgetBytes:t,getAdditionalModuleBytes:n}){let r=new Map(Object.entries(e).sort(([e],[t])=>e.localeCompare(t))),i=new Map([...r.values()].flatMap(e=>e.facadeModuleId===null?[]:[[e.facadeModuleId,e]])),a=Ii(r),o=Li({chunks:r,mainChunkIds:a}),s=zi({chunks:[...r].filter(([e])=>!a.has(e)).map(([e,t])=>({chunkId:e,estimatedBytes:Gi(t)+t.moduleIds.reduce((e,t)=>e+n(t),0),transitions:o.get(e)??new Set})),planningBudgetBytes:t}).map(Ki),c=new Map;for(let e of a)c.set(e,Pi);for(let e of s)for(let t of e.chunkIds)c.set(t,e);function l(e){let t=c.get(e);if(!t)throw Error(`Mini Program placement is missing final chunk: ${e}`);return t}function u(e){return l(`preliminaryFileName`in e?e.preliminaryFileName:e.fileName)}return{getPackageLocation:u,getPhysicalChunkId(e){let t=typeof e==`string`?i.get(e):e;if(!t)throw Error(`Mini Program placement is missing entry module: ${e}`);let n=u(t);return n.kind===`main`?t.fileName:`${n.root}/${t.fileName}`},finalize(e){let t=Object.values(e).filter(e=>e.type===`chunk`),n=new Set;for(let e of t){let t=l(e.preliminaryFileName);t.kind===`subpackage`&&(e.fileName=`${t.root}/${e.fileName}`,n.add(t.root))}return[...n].sort().map(e=>({root:e}))}}}function Ii(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 Li({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 Ri({rootId:a,chunks:e,mainChunkIds:t})){let e=n.get(i)??new Set;e.add(r),n.set(i,e)}r++}return n}function Ri({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 zi({chunks:e,planningBudgetBytes:t}){let n=[],r=[...e].sort(Bi);for(let e of r)Wi(e.estimatedBytes<=t?Vi({bins:n,chunk:e,planningBudgetBytes:t})??Ui(n):Ui(n),e);return n}function Bi(e,t){return t.transitions.size-e.transitions.size||t.estimatedBytes-e.estimatedBytes||e.chunkId.localeCompare(t.chunkId)}function Vi({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:Hi(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 Hi(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 Ui(e){let t={chunkIds:[],estimatedBytes:0,transitions:new Set};return e.push(t),t}function Wi(e,t){e.chunkIds.push(t.chunkId),e.estimatedBytes+=t.estimatedBytes;for(let n of t.transitions)e.transitions.add(n)}function Gi(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 Ki(e){let t=[...e.chunkIds].sort(),n=x(`sha256`).update(t.join(`\0`)).digest(`hex`).slice(0,8);return{kind:`subpackage`,root:`${Ni}${n}`,chunkIds:t}}function qi(e){return e.startsWith(Ni)}function Ji(e){return{output:{codeSplitting:{groups:[{name:`polyfills`,test:kt,priority:200,includeDependenciesRecursively:!1},{name:`vendor`,test:At,priority:100,includeDependenciesRecursively:!0}]},entryFileNames(t){switch(e(t)){case`native`:return`[name]`;case`entry-capsule`:return`[name].js`;default:return`common/[name].js`}},chunkFileNames:`common/[name].js`},preserveEntrySignatures:`allow-extension`}}function Yi(e){let t=jt(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:Ji(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:Fi({chunks:i.chunks,planningBudgetBytes:19e5,getAdditionalModuleBytes:e=>oi(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)},getSubpackages(){if(n.phase!==`finalized`)throw Error(`Mini Program subpackages are unavailable before output finalization`);return n.subpackages}}}const Xi={document:[xt,`document`],navigator:[xt,`navigator`],requestAnimationFrame:[xt,`requestAnimationFrame`],cancelAnimationFrame:[xt,`cancelAnimationFrame`],Element:[xt,`TaroElement`],SVGElement:[xt,`SVGElement`],MutationObserver:[xt,`MutationObserver`],history:[xt,`history`],location:[xt,`location`]},Zi=Object.fromEntries(Object.keys(Xi).map(e=>[e,`globalThis.${e}`]));function Qi(e){let t=[...new Set(e.options.polyfills??[])];return{name:`vpt:mini-polyfills`,config(){return{build:{rolldownOptions:{input:{polyfills:wt},transform:{inject:Xi}}}}},transform:{filter:{id:Ot,code:RegExp(`\\\\|\\b(?:${Object.keys(Xi).join(`|`)})\\b`)},handler(e,t){return c(e,t,{define:Zi,sourcemap:!!this.environment.config.build.sourcemap})}},resolveId:{filter:{id:we(wt)},handler(){return wt}},load:{filter:{id:we(wt)},handler(){return t.map(e=>`import ${JSON.stringify($i(e))};`).join(`
11
+ `)}}}}function $i(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 N.resolve(`core-js/modules/${e}.js`)}catch(t){throw Error(`Unknown core-js polyfill module: ${JSON.stringify(e)}.`,{cause:t})}}var ea=class{original;#e=new Map;#t=[];constructor(e){this.original=e}overwrite(e,t,n){this.#t.push({content:n,end:t,start:e})}prependLeft(e,t){this.#n(e).prepend.push(t)}appendLeft(e,t){this.#n(e).append.push(t)}appendRight(e,t){this.#n(e).append.push(t)}compile(){let e={original:this.original,replacements:this.#t.toSorted((e,t)=>e.start-t.start||t.end-e.end),insertions:[...this.#e].sort(([e],[t])=>e-t).map(([e,t])=>({start:e,content:t.prepend.toReversed().join(``)+t.append.join(``)}))};return{render:(t,n)=>na(e,t,n,!0,!0),renderOutside:t=>ta(e,t)}}#n(e){let t=this.#e.get(e);if(t)return t;let n={append:[],prepend:[]};return this.#e.set(e,n),n}};function ta(e,t){let n=[],r=0,i=!0;for(let a of t)n.push(na(e,r,a.start,i,!1)),r=a.end,i=!1;return n.push(na(e,r,e.original.length,i,!0)),n.join(``)}function na(e,t,n,r,i){let a=t,o=ra(e.insertions,t),s=[],c=(n,i)=>{for(;o<e.insertions.length;){let c=e.insertions[o];if(c.start>n||c.start===n&&!i)break;o++,!(c.start<a||c.start===t&&!r)&&(s.push(e.original.slice(a,c.start),c.content),a=c.start)}s.push(e.original.slice(a,n)),a=n};for(let r=ra(e.replacements,t);r<e.replacements.length;r++){let t=e.replacements[r];if(t.start>=n)break;if(!(t.end>n||t.end<=a)){if(t.start<a)throw Error(`Partially overlapping source edits at ${t.start}:${t.end}`);c(t.start,!1),s.push(t.content),a=t.end}}return c(n,i),s.join(``)}function ra(e,t){let n=0,r=e.length;for(;n<r;){let i=Math.floor((n+r)/2);e[i].start<t?n=i+1:r=i}return n}function ia(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=aa(t.program,e.filename);if(!e.sourcemap){let t=new ea(e.code);return la(t,n),ma(t,n,e),{code:va(t,n,e),map:null}}let r=new d(e.code,{filename:e.filename});return la(r,n),ma(r,n,e),ya(r,n,e),{code:r.toString(),map:Ga(r,e.filename)}}function aa(e,t){let n=new Set,r=new Map,i=new Map,a=[],o=[],s=[],c=new Set,l=new Set,u=new ze({preserveExitedScopes:!0}),d=0,f=!1,p=!1;Le(e,{scopeTracker:u,enter(e,t){if(e.type===`Identifier`&&n.add(e.name),e.type===`CallExpression`&&e.callee.type===`Identifier`&&e.callee.name===`eval`&&(f=!0),za(e)&&(d+=1),e.type===`AwaitExpression`&&d===0&&(p=!0),e.type===`VariableDeclaration`&&d===0&&(e.kind===`var`||t?.type===`Program`)&&(o.push(e),e.kind===`var`)){if(t?.type!==`Program`){let n=(t?.type===`ForInStatement`||t?.type===`ForOfStatement`)&&t.left===e;s.push({declaration:e,isForIterationBinding:n})}Pa(e).forEach(e=>{l.add(e)})}},leave(e){za(e)&&--d}});for(let n of e.body)switch(n.type){case`ImportDeclaration`:oa(n,i,c,l,t);break;case`ExportNamedDeclaration`:sa(n,r,t);break;case`ExportDefaultDeclaration`:case`ExportAllDeclaration`:throw Wa(t,`source-level ${n.type}`);case`VariableDeclaration`:Ha(n,t),n.declarations.flatMap(e=>Fa(e.id)).forEach(e=>{l.add(e)});break;case`FunctionDeclaration`:{let e=n.id;a.push(n),l.add(e.name);break}case`ClassDeclaration`:{let e=n.id;l.add(e.name);break}}u.freeze(),Va(f,t);let m=ja(n,i.size);return ca(r,l,t),{dependencies:[...i.values()],exportNamesByLocal:r,functions:a,generatedNames:m,hasTopLevelAwait:p,importBindings:c,moduleVariables:o,nestedHoistedVariables:s,outerBindings:l,program:e,scopes:u}}function oa(e,t,n,r,i){if(e.phase||e.attributes.length>0||e.importKind===`type`)throw Wa(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:Ma(t.imported),local:t.local.name})}}function sa(e,t,n){if(e.declaration||e.source||e.attributes.length>0||e.exportKind===`type`)throw Wa(n,`declaration exports, re-exports, export attributes, or type-only exports`);for(let n of e.specifiers){let e=Ma(n.local),r=Ma(n.exported),i=t.get(e)??[];i.push(r),t.has(e)||t.set(e,i)}}function ca(e,t,n){for(let r of e.keys())if(!t.has(r))throw Wa(n,`export of non-module binding ${JSON.stringify(r)}`)}function la(e,t){for(let n of t.program.body)switch(n.type){case`ImportDeclaration`:e.overwrite(n.start,n.end,``);break;case`ExportNamedDeclaration`:e.overwrite(n.start,n.end,Sa(n.specifiers,t));break;case`VariableDeclaration`:ua(e,n,t.generatedNames.exportBinding,t.exportNamesByLocal);break;case`ClassDeclaration`:pa(e,n,t.generatedNames.exportBinding,t.exportNamesByLocal)}for(let{declaration:n,isForIterationBinding:r}of t.nestedHoistedVariables)da(e,n,r,t.generatedNames.exportBinding,t.exportNamesByLocal)}function ua(e,t,n,r){let i=t.declarations[0];e.overwrite(t.start,i.start,`(`),e.appendLeft(Ua(e.original,t.end),`)`),fa(e,t,n,r)}function da(e,t,n,r,i){let a=t.declarations[0];e.overwrite(t.start,a.start,n?``:`(`),n||e.appendLeft(Ua(e.original,t.end),`)`),fa(e,t,r,i)}function fa(e,t,n,r){for(let i of t.declarations){if(!i.init)continue;let t=Fa(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,Ta(n,t,``)),e.appendRight(i.end,Ea(t));continue}e.prependLeft(i.start,`(`),e.appendRight(i.end,`,${t.map(({exported:e,local:t})=>ka(n,e,t)).join(`,`)})`)}}}function pa(e,t,n,r){let i=t.id,a=r.get(i.name)??[];e.prependLeft(t.start,Ta(n,a,`${i.name}=`)),e.appendRight(t.end,Ea(a))}function ma(e,t,n){let r=t.scopes,i=0;Le(t.program,{scopeTracker:r,enter(a){switch(Ba(a)&&(i+=1),a.type){case`ImportExpression`:if(a.options||a.phase)throw Wa(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`:ha(e,a.left,a.start,a.end,r,t,n.filename);break;case`UpdateExpression`:ga(e,a,r,t);break;case`ForInStatement`:case`ForOfStatement`:a.left.type!==`VariableDeclaration`&&_a(a.left,r,t.exportNamesByLocal,n.filename)}},leave(e){Ba(e)&&--i}})}function ha(e,t,n,r,i,a,o){if(t.type===`Identifier`){let o=wa(t.name,i,a.exportNamesByLocal);if(o.length===0)return;e.prependLeft(n,Ta(a.generatedNames.exportBinding,o,``)),e.appendRight(r,Ea(o));return}_a(t,i,a.exportNamesByLocal,o)}function ga(e,t,n,r){if(t.argument.type!==`Identifier`)return;let i=wa(t.argument.name,n,r.exportNamesByLocal);if(i.length===0)return;if(t.prefix){e.prependLeft(t.start,Ta(r.generatedNames.exportBinding,i,``)),e.appendRight(t.end,Ea(i));return}let a=`+${t.argument.name}${t.operator[0]}1`;e.prependLeft(t.start,`(${Da(r.generatedNames.exportBinding,i,a)},`),e.appendRight(t.end,`)`)}function _a(e,t,n,r){let i=Ia(e).filter(e=>wa(e,t,n).length>0);if(i.length>0)throw Wa(r,`destructuring write to exported binding ${JSON.stringify(i[0])}`)}function va(e,t,n){let r=ba(t,n),i=e.compile(),a=t.functions.map(e=>i.render(e.start,e.end)).join(``);return`${r.prefix}${i.renderOutside(t.functions)}}};${a}${r.suffix}`}function ya(e,t,n){let r=ba(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 ba(e,t){let n=e.dependencies.map(e=>t.resolveReference(e.source,`static`)),r=e.dependencies.map((t,n)=>Ca(t,n,e.generatedNames)),i=xa(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 xa(e){let t=new Set(e.functions.map(e=>e.id.name)),n=[];for(let[r,i]of e.exportNamesByLocal)if(t.has(r))for(let e of i)n.push({exported:e,value:r});for(let t of e.moduleVariables)for(let r of t.declarations)if(!r.init)for(let t of Fa(r.id))for(let r of e.exportNamesByLocal.get(t)??[])n.push({exported:r,value:`void 0`});if(n.length===0)return``;if(n.length===1){let[t]=n;return Aa(e.generatedNames.exportBinding,t.exported,t.value)}let r=n.map(({exported:e,value:t})=>`[${JSON.stringify(e)}]:${t}`).join(`,`);return`${e.generatedNames.exportBinding}({${r}});`}function Sa(e,t){return e.filter(e=>t.importBindings.has(Ma(e.local))).map(e=>{let n=Ma(e.local);return Aa(t.generatedNames.exportBinding,Ma(e.exported),n)}).join(``)}function Ca(e,t,n){let r=`${n.dependencyPrefix}${t}`;return`function(${r}){${e.imports.flatMap(e=>{let t=e.imported===null?r:Na(r,e.imported);return[`${e.local}=${t};`]}).join(``)}}`}function wa(e,t,n){let r=n.get(e)??[];return r.length===0||t.getDeclaration(e)?.scope===``?r:[]}function Ta(e,t,n){return t.length===0?n:t.reduce((t,n)=>`${Oa(e,n)}${t}`,n)}function Ea(e){return`)`.repeat(e.length)}function Da(e,t,n){return t.reduce((t,n)=>`${Oa(e,n)}${t})`,n)}function Oa(e,t){return`${e}(${JSON.stringify(t)},`}function ka(e,t,n){return`${e}(${JSON.stringify(t)},${n})`}function Aa(e,t,n){return`${e}(${JSON.stringify(t)},${n});`}function ja(e,t){let n=t=>{let n=0,r=t;for(;e.has(r);)n+=1,r=`${t}${n}`;return r};return{context:n(`__systemContext`),exportBinding:n(`__systemExport`),dependencyPrefix:(n=>{let r=0,i=n;for(;;){let a=0;for(;a<t&&!e.has(`${i}${a}`);)a+=1;if(a===t)return i;r+=1,i=`${n}${r}`}})(`__systemDependency`)}}function Ma(e){return e.type===`Literal`?String(e.value):e.name}function Na(e,t){return/^[$A-Z_a-z][$\w]*$/.test(t)?`${e}.${t}`:`${e}[${JSON.stringify(t)}]`}function Pa(e){return e.declarations.flatMap(e=>Fa(e.id))}function Fa(e){return La(e)}function Ia(e){return La(e)}function La(e){switch(e.type){case`Identifier`:return[e.name];case`AssignmentPattern`:return La(e.left);case`ArrayPattern`:return e.elements.flatMap(e=>e?La(e):[]);case`ObjectPattern`:return e.properties.flatMap(e=>e.type===`Property`?La(e.value):La(e.argument));case`RestElement`:return La(e.argument);default:return[]}}function Ra(e){return e.type===`FunctionDeclaration`||e.type===`FunctionExpression`||e.type===`ArrowFunctionExpression`||e.type===`TSEmptyBodyFunctionExpression`}function za(e){return Ra(e)||e.type===`ClassDeclaration`||e.type===`ClassExpression`}function Ba(e){return Ra(e)&&e.type!==`ArrowFunctionExpression`||e.type===`ClassDeclaration`||e.type===`ClassExpression`}function Va(e,t){if(e)throw Wa(t,`direct eval`)}function Ha(e,t){if(e.kind===`using`||e.kind===`await using`||e.declare)throw Wa(t,`using or ambient variable declaration`)}function Ua(e,t){return e[t-1]===`;`?t-1:t}function Wa(e,t){return Error(`Unsupported final Rolldown chunk ${e}: ${t}`)}function Ga(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 Ka(e,t,n){return ia({code:e,filename:t.fileName,format:`commonjs-registration`,sourcemap:n,resolveReference(e,n){return qa(t.fileName,e,n)}})}function qa(e,t,n){return n===`dynamic`&&!t.startsWith(`./`)&&!t.startsWith(`../`)?t:ki(e,t)}function Ja({code:e,chunk:t,chunks:n,bootstrapModuleId:r,getPhysicalChunkId:i,classifyModule:a,sourcemap:o}){let s=p(t.fileName,e);if(s.errors.length>0){let e=s.errors.map(e=>e.message).join(`; `);throw Error(`Failed to parse ${t.fileName} with Oxc: ${e}`)}let c=Ya(s.program,t,n,r,i,a),l=new d(e,{filename:t.fileName});Za(l,c,t.fileName);let u=Qa(l,c,t.fileName);Xa(l,c);let f=c.exportNamesByLocal.size>0,m=_o(c),h=u?`var ${c.postfixTemp};`:``,g=ho(c);return f?l.prepend(`"use strict";Object.defineProperty(exports,"__esModule",{value:true});${m}${h}${g}`):l.prepend(`"use strict";${m}${h}${g}`),{code:l.toString(),map:o?To(l,t.fileName):null}}function Ya(e,t,r,i,a,o){let s=new Set,c=new Map,l=[],u=new Map,d=new ze({preserveExitedScopes:!0}),f=[],m=!1;if(Le(e,{scopeTracker:d,enter(e){e.type===`Identifier`&&s.add(e.name),e.type===`CallExpression`&&e.callee.type===`Identifier`&&e.callee.name===`eval`&&(m=!0),e.type===`ImportExpression`&&f.push(e)}}),d.freeze(),m)throw wo(t.fileName,`direct eval`);let h=0;function g(e,t){let n=t;if(n===void 0){for(n=h===0?`__nativeImport`:`__nativeImport${h}`;s.has(n);)h+=1,n=`__nativeImport${h}`;s.add(n),h+=1}let r=n;return{bindings:e.specifiers.map(e=>{let t={imported:e.type===`ImportNamespaceSpecifier`?null:e.type===`ImportDefaultSpecifier`?`default`:bo(e.imported),local:e.local.name,namespace:r};return u.set(t.local,t),t}),capsuleBinding:null,interop:go(e),namespace:r,reference:e.source.value}}for(let n of e.body)switch(n.type){case`ImportDeclaration`:{vo(n,t.fileName);let e=mo(t.fileName,n.source.value,r,o);if(e){let[r]=n.specifiers;if(n.specifiers.length!==1||!r||r.type===`ImportNamespaceSpecifier`)throw Error(`Expected one capsule value import from ${e.fileName} in ${t.fileName}`);l.push({bindings:[],capsuleBinding:{imported:r.type===`ImportDefaultSpecifier`?`default`:bo(r.imported),local:r.local.name,logicalId:ki(t.fileName,n.source.value)},interop:`none`,namespace:``,reference:n.source.value});continue}l.push(g(n,void 0));break}case`ExportNamedDeclaration`:ro(n,c,t.fileName);break;case`ExportDefaultDeclaration`:case`ExportAllDeclaration`:throw wo(t.fileName,`source-level ${n.type}`)}if(f.length>0||l.some(e=>e.capsuleBinding)){let e=n.posix.relative(n.posix.dirname(a(t)),a(i)),r=e.startsWith(`../`)?e:`./${e}`,o=yo(`__nativeSystem`,s),c=p(t.fileName,`import { System as ${o} } from ${JSON.stringify(r)}`).program.body[0],u=l.findIndex(e=>e.reference===r),d=u<0?void 0:l.splice(u,1)[0],f=g(c,d?.namespace);l.unshift(d?{...d,bindings:[...f.bindings,...d.bindings]}:f)}return{defaultInterop:yo(`__nativeDefault`,s),dynamicImports:f,exportNamesByLocal:c,imports:l,importBindingsByLocal:u,namespaceInterop:yo(`__nativeNamespace`,s),postfixTemp:yo(`__nativePostfix`,s),program:e,scopes:d}}function Xa(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),io(e,n.declaration,t.exportNamesByLocal)):e.overwrite(n.start,n.end,ao(n.specifiers,t));break;case`VariableDeclaration`:oo(e,n,t.exportNamesByLocal);break;case`FunctionDeclaration`:n.id&&so(e,n.end,n.id.name,t.exportNamesByLocal);break;case`ClassDeclaration`:n.id&&so(e,n.end,n.id.name,t.exportNamesByLocal)}}function Za(e,t,n){for(let r of t.dynamicImports){if(r.options||r.phase)throw wo(n,`dynamic import options or phases`);let i=fo(t.imports[0].bindings[0]);e.overwrite(r.start,r.source.start,`${i}.import(`),r.source.type===`Literal`&&typeof r.source.value==`string`&&(r.source.value.startsWith(`./`)||r.source.value.startsWith(`../`))&&e.overwrite(r.source.start,r.source.end,JSON.stringify(ki(n,r.source.value)))}}function Qa(e,t,n){let r=[],i=0,a=!1;return Le(t.program,{scopeTracker:t.scopes,enter(o,s){if(Co(o)&&(i+=1),o.type===`ThisExpression`&&i===0&&e.overwrite(o.start,o.end,`void 0`),o.type===`Identifier`&&s?.type!==`ImportDeclaration`&&Ue(o,s)){let n=t.importBindingsByLocal.get(o.name),i=n?t.scopes.getDeclaration(o.name):null;if(n&&i?.type===`Import`){let t=uo(o,s,r),i=fo(n),a=t===`unbound`?`(0,${i})`:i;e.overwrite(o.start,o.end,s?.type===`Property`&&s.shorthand&&s.value===o?`${o.name}:${a}`:a)}}switch(o.type){case`AssignmentExpression`:$a(e,o.left,o.start,t,n);break;case`UpdateExpression`:eo(e,o,t)&&(a=!0);break;case`ForInStatement`:case`ForOfStatement`:o.left.type!==`VariableDeclaration`&&to(o.left,t,n)}r.push(o)},leave(e){r.pop(),Co(e)&&--i}}),a}function $a(e,t,n,r,i){if(t.type===`Identifier`){let i=no(t.name,r);i.length>0&&e.prependLeft(n,co(i));return}to(t,r,i)}function eo(e,t,n){if(t.argument.type!==`Identifier`)return!1;let r=no(t.argument.name,n);return r.length===0?!1:t.prefix?(e.prependLeft(t.start,co(r)),!1):(e.prependLeft(t.start,`(${n.postfixTemp}=`),e.appendRight(t.end,`,${lo(r,t.argument.name)},${n.postfixTemp})`),!0)}function to(e,t,n){let r=So(e).filter(e=>no(e,t).length>0);if(r.length>0)throw wo(n,`destructuring write to exported binding ${JSON.stringify(r[0])}`)}function no(e,t){let n=t.exportNamesByLocal.get(e)??[];return n.length===0||t.scopes.getDeclaration(e)?.scope===``?n:[]}function ro(e,t,n){if(e.source||e.attributes.length>0||e.exportKind===`type`)throw wo(n,`re-exports, export attributes, or type-only exports`);if(e.declaration){for(let r of xo(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=bo(n.local),r=t.get(e)??[];r.push(bo(n.exported)),t.has(e)||t.set(e,r)}}function io(e,t,n){switch(t.type){case`VariableDeclaration`:oo(e,t,n);break;case`FunctionDeclaration`:case`ClassDeclaration`:t.id&&so(e,t.end,t.id.name,n)}}function ao(e,t){return e.map(e=>{let n=bo(e.local),r=bo(e.exported),i=t.importBindingsByLocal.get(n);return i?`Object.defineProperty(exports,${JSON.stringify(r)},{enumerable:true,get:function(){return ${fo(i)}}});`:``}).join(``)}function oo(e,t,n){for(let r of t.declarations){if(r.id.type!==`Identifier`){if(So(r.id).filter(e=>n.has(e)).length>0)throw wo(`native chunk`,`exported destructuring declaration`);continue}let t=n.get(r.id.name)??[];t.length!==0&&(r.init?e.prependLeft(r.init.start,co(t)):e.appendRight(r.end,`=${lo(t,`void 0`)}`))}}function so(e,t,n,r){let i=r.get(n)??[];i.length>0&&e.appendRight(t,`;${lo(i,n)};`)}function co(e){return e.reduce((e,t)=>`exports[${JSON.stringify(t)}]=${e}`,``)}function lo(e,t){return`${co(e)}${t}`}function uo(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 fo(e){return e.imported===null?e.namespace:po(e.namespace,e.imported)}function po(e,t){return/^[$A-Z_a-z][$\w]*$/.test(t)?`${e}.${t}`:`${e}[${JSON.stringify(t)}]`}function mo(e,t,n,r){if(!t.startsWith(`./`)&&!t.startsWith(`../`))return;let i=n[Oi(e,t)];return i&&r(i)===`entry-capsule`?i:void 0}function ho(e){return e.imports.map(t=>{if(t.capsuleBinding){let{imported:n,local:r,logicalId:i}=t.capsuleBinding;return`var ${r}=${po(`${fo(e.imports[0].bindings[0])}.importSync(${JSON.stringify(i)})`,n)};`}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 go(e){return e.specifiers.some(e=>e.type===`ImportNamespaceSpecifier`)?`namespace`:e.specifiers.some(e=>e.type===`ImportDefaultSpecifier`)?`default`:`none`}function _o(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 vo(e,t){if(e.phase||e.attributes.length>0||e.importKind===`type`)throw wo(t,`import phases, attributes, or type-only imports`)}function yo(e,t){let n=0,r=e;for(;t.has(r);)n+=1,r=`${e}${n}`;return t.add(r),r}function bo(e){return e.type===`Literal`?String(e.value):e.name}function xo(e,t){return e.type===`VariableDeclaration`?e.declarations.flatMap(({id:e})=>So(e)):[e.id.name]}function So(e){switch(e.type){case`Identifier`:return[e.name];case`AssignmentPattern`:return So(e.left);case`ArrayPattern`:return e.elements.flatMap(e=>e?So(e):[]);case`ObjectPattern`:return e.properties.flatMap(e=>e.type===`Property`?So(e.value):So(e.argument));case`RestElement`:return So(e.argument);default:return[]}}function Co(e){return e.type===`FunctionDeclaration`||e.type===`FunctionExpression`||e.type===`ClassDeclaration`||e.type===`ClassExpression`}function wo(e,t){return Error(`Unsupported final Rolldown native chunk ${e}: ${t}`)}function To(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 Eo({code:e,id:t,appConfig:n,sourcemap:r}){return ct(e,t,{__VPT_APP_CONFIG__:JSON.stringify(n)},r??!1)}function Do({code:e,id:t,page:n,sourcemap:r}){return ct(e,t,{__VPT_PAGE_PATH__:JSON.stringify(n.path),__VPT_PAGE_CONFIG__:JSON.stringify(at(n))},r??!1)}function Oo(e){let t=o(e.runtime.modules.appCapsule),r=o(e.runtime.modules.pageCapsule),i=ko(e.options.pages,e.runtime.modules),a=new Map(e.options.pages.map(e=>[e.path,e])),s=new Map([[`\0vite/preload-helper.js`,()=>e.runtime.modules.bootstrap],[`\0vpt:taro-target-runtime`,()=>e.taro.targetRuntimePath],[`\0vpt:app-component`,(t,n)=>xe({appPath:e.options.app,projectRoot:n})],[`\0vpt:page-component`,(e,t)=>Se({pagePath:jo({moduleId:e,pageByPath:a}).path,projectRoot:t})],[`\0vpt:page-capsule`,t=>{let n=jo({moduleId:t,pageByPath:a});return Ao({moduleId:e.runtime.modules.pageCapsule,pagePath:n.path})}]]);return{...i,resolveId(e,t,r){return e===`\0vpt:mini-transport`?{id:`./${n.posix.relative(`common`,Tt)}`,external:!0}:s.get(e)?.(t,r)},specialize(n,i,o){let s=Te(i);if(s===t)return Eo({code:n,id:i,appConfig:ot(e.options),sourcemap:o});if(s===r)return Do({code:n,id:i,page:jo({moduleId:i,pageByPath:a}),sourcemap:o})}}}function ko(e,t){let n=e.map(e=>({capsuleId:Ao({moduleId:t.pageCapsule,pagePath:e.path}),capsuleName:`${e.path}-capsule`,shellId:Ao({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],[`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 Ao({moduleId:e,pagePath:t}){return`${e}?route=${encodeURIComponent(t)}`}function jo({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 Mo;(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`})(Mo||={});var No;(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`})(No||={});var Po;(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`})(Po||={});var Fo;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(Fo||={});var Io;(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`})(Io||={});var Lo;(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`})(Lo||={});var Ro;(function(e){e[e.NoValue=0]=`NoValue`,e[e.Unquoted=1]=`Unquoted`,e[e.Single=2]=`Single`,e[e.Double=3]=`Double`})(Ro||={});const zo={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])};zo.IframeEnd[2],zo.IframeEnd,zo.NoembedEnd[2],zo.NoembedEnd,zo.Plaintext[2],zo.Plaintext,zo.ScriptEnd[2],zo.ScriptEnd,zo.TitleEnd[2],zo.TitleEnd,zo.XmpEnd[2],zo.XmpEnd;const{fromCodePoint:Bo}=String;var Vo;(function(e){e[e.None=0]=`None`,e[e.Svg=1]=`Svg`,e[e.MathML=2]=`MathML`})(Vo||={});let Ho=()=>{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:()=>Ie});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(re(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=re(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(re);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(re);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=re(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)=>re(e),ne=(()=>{let e=0;return t=>{let n=re(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}}}})(),D=e=>{let t;return n=>(t||=re(e()),t(n))},re=g(e=>{if(l(e))return u(e)?D(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`)}),ie=`abcdefghijklmnopqrstuvwxyz`,ae=e=>{let t=``;for(;e>0;)t=ie[(e-1)%26]+t,e=Math.floor((e-1)/26);return t},oe=e=>{let t=0;for(let n=0,r=e.length;n<r;n++)t=t*26+ie.indexOf(e[n])+1;return t},se=(e,t)=>{if(t<e)return se(t,e);let n=[];for(;e<=t;)n.push(e++);return n},ce=(e,t,n)=>se(e,t).map(e=>String(e).padStart(n,`0`)),le=(e,t)=>se(oe(e),oe(t)).map(ae),O=e=>e,ue=e=>de(t=>_(t,e,{memoization:!1}).join(``)),de=e=>{let t={};return n=>t[n]??(t[n]=e(n))},fe=v(/^\*\*\/\*$/,`.*`),k=v(/^\*\*\/(\*)?([ a-zA-Z0-9._-]+)$/,(e,t,n)=>`.*${t?``:`(?:^|/)`}${n.replaceAll(`.`,`\\.`)}`),A=v(/^\*\*\/(\*)?([ a-zA-Z0-9._-]*)\{([ a-zA-Z0-9._-]+(?:,[ a-zA-Z0-9._-]+)*)\}$/,(e,t,n,r)=>`.*${t?``:`(?:^|/)`}${n.replaceAll(`.`,`\\.`)}(?:${r.replaceAll(`,`,`|`).replaceAll(`.`,`\\.`)})`),pe=v(/\\./,O),j=v(/[$.*+?^(){}[\]\|]/,e=>`\\${e}`),me=v(/./,O),M=T([v(/^(?:!!)*!(.*)$/,(e,t)=>`(?!^${je(t)}$).*?`),v(/^(!!)+/,``)]),he=T([v(/\/(\*\*\/)+/,`(?:/.+/|/)`),v(/^(\*\*\/)+/,`(?:^|.*/)`),v(/\/(\*\*)$/,`(?:/.*|$)`),v(/\*\*/,`.*`)]),N=T([v(/\*\/(?!\*\*\/)/,`[^/]*/`),v(/\*/,`[^/]*`)]),ge=v(`?`,`[^/]`),_e=v(`[`,O),ve=v(`]`,O),P=v(/[!^]/,`^/`),ye=v(/[a-z]-[a-z]|[0-9]-[0-9]/i,O),be=T([pe,v(/[$.*+?^(){}[\|]/,e=>`\\${e}`),ye,v(/[^\]]/,O)]),xe=ee([_e,C(P),w(be),ve]),Se=v(`{`,`(?:`),Ce=v(`}`,`)`),we=ee([Se,T([v(/(\d+)\.\.(\d+)/,(e,t,n)=>ce(+t,+n,Math.min(t.length,n.length)).join(`|`)),v(/([a-z]+)\.\.([a-z]+)/,(e,t,n)=>le(t,n).join(`|`)),v(/([A-Z]+)\.\.([A-Z]+)/,(e,t,n)=>le(t.toLowerCase(),n.toLowerCase()).join(`|`).toUpperCase())]),Ce]),Te=v(`{`,`(?:`),Ee=v(`}`,`)`),De=v(`,`,`|`),Oe=v(/[$.*+?^(){[\]\|]/,e=>`\\${e}`),ke=v(/[^}]/,O),Ae=ee([Te,w(T([he,N,ge,xe,we,D(()=>Ae),pe,Oe,De,ke])),Ee]),je=ue(w(T([fe,k,A,M,he,N,ge,xe,we,Ae,pe,j,me]))),Me=v(/\\./,O),Ne=v(/./,O),Pe=ue(w(T([Me,v(/\*\*\*+/,`*`),v(/([^/{[(!])\*\*/,(e,t)=>`${t}*`),v(/(^|.)\*\*(?=[^*/)\]}])/,(e,t)=>`${t}*`),Ne]))),Fe=(e,t)=>{let n=Array.isArray(e)?e:[e];if(!n.length)return!1;let r=n.map(Fe.compile),i=n.every(e=>/(\/(?:\*\*)?|\[\/\])$/.test(e)),a=t.replace(/[\\\/]+/g,`/`).replace(/\/$/,i?`/`:``);return r.some(e=>e.test(a))};Fe.compile=e=>RegExp(`^${je(Pe(e))}$`,`s`);var Ie=Fe;return o(s)})();return e.default||e},Uo;const Wo=(e,t)=>(Uo||(Uo=Ho(),Ho=null),Uo(e,t)),Go=/^[A-Za-z]:\//;function Ko(e=``){return e&&e.replace(/\\/g,`/`).replace(Go,e=>e.toUpperCase())}const qo=/^[/\\]{2}/,Jo=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/,Yo=/^[A-Za-z]:$/,Xo=/^\/([A-Za-z]:)?$/,Zo=/.(\.[^./]+|\.)$/,Qo=/^[/\\]|^[a-zA-Z]:[/\\]/,$o=function(e){if(e.length===0)return`.`;e=Ko(e);let t=e.match(qo),n=is(e),r=e[e.length-1]===`/`;return e=rs(e,!n),e.length===0?n?`/`:r?`./`:`.`:(r&&(e+=`/`),Yo.test(e)&&(e+=`/`),t?n?`//${e}`:`//./${e}`:n&&!is(e)?`/${e}`:e)},es=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 $o(t)};function ts(){return typeof process<`u`&&typeof process.cwd==`function`?process.cwd().replace(/\\/g,`/`):`/`}const ns=function(...e){e=e.map(e=>Ko(e));let t=``,n=!1;for(let r=e.length-1;r>=-1&&!n;r--){let i=r>=0?e[r]:ts();i&&i.length!==0&&(t=`${i}/${t}`,n=is(i))}return t=rs(t,!n),n&&!is(t)?`/${t}`:t.length>0?t:`.`};function rs(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 is=function(e){return Jo.test(e)},as=function(e){return Ko(e)},os=function(e){if(e===`..`)return``;let t=Zo.exec(Ko(e));return t&&t[1]||``},ss=function(e,t){let n=ns(e).replace(Xo,`$1`).split(`/`),r=ns(t).replace(Xo,`$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(`/`)},cs=function(e){let t=Ko(e).replace(/\/$/,``).split(`/`).slice(0,-1);return t.length===1&&Yo.test(t[0])&&(t[0]+=`/`),t.join(`/`)||(is(e)?`/`:`.`)},ls=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 Ko(e.root?ns(...n):n.join(`/`))},us=function(e,t){let n=Ko(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},ds={__proto__:null,basename:us,dirname:cs,extname:os,format:ls,isAbsolute:is,join:es,matchesGlob:(e,t)=>Wo(t,$o(e)),normalize:$o,normalizeString:rs,parse:function(e){let t=Qo.exec(e)?.[0]?.replace(/\\/g,`/`)||``,n=us(e),r=os(n);return{root:t,dir:cs(e),base:n,ext:r,name:n.slice(0,n.length-r.length)}},relative:ss,resolve:ns,sep:`/`,toNamespacedPath:as},fs=globalThis.process?.platform===`win32`?`;`:`:`,ps={posix:void 0,win32:void 0},ms=(e=fs)=>new Proxy(ds,{get(t,n){return n===`delimiter`?e:n===`posix`?hs:n===`win32`?gs:ps[n]||ds[n]}}),hs=ms(`:`),gs=ms(`;`);var _s=j(((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}}})),vs=j(((e,t)=>{let n=Mt(),r=_s(),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(`
12
+ `):e[1]}return n}c.registerInput=a,t.exports=c})),ys=j(((e,t)=>{let n=Mt(),r=vs();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)+`
13
13
  `+c+a(`^`)}let t=i(r.replace(/\d/g,` `))+e.slice(0,this.column-1).replace(/[^\t]/g,` `);return a(`>`)+i(r)+o(e)+`
14
14
  `+t+a(`^`)}return` `+i(r)+o(e)}).join(`
15
15
  `)}toString(){let e=this.showSourceCode();return e&&=`
@@ -2856,7 +2856,7 @@ ia,444,260827,151
2856
2856
  }
2857
2857
  \n${(await e(t)).css}`}}}function wV(e,t,n){let r=p(t,e);if(r.errors.length>0){let e=r.errors.map(e=>e.message).join(`; `);throw Error(`Failed to transform Tailwind classes in ${t}: ${e}`)}let i=new d(e,{filename:t});return Le(r.program,{enter:TV(e,n,i)}),i.toString()}function TV(e,t,n){return r=>{if(NV(r)){EV(e,r,t,n);return}r.type===`TemplateElement`&&DV(e,r,t,n)}}function EV(e,t,n,r){let i=AV(t.value,n);i!==void 0&&kV(e,t.start+1,t.end-1,PV(i),r)}function DV(e,t,n,r){let i=AV(t.value.raw,n);i!==void 0&&OV(e,t,i,r)}function OV(e,t,n,r){let i=e[t.start],a=e[t.end-1];kV(e,t.start+ +(i==="`"||i===`}`),t.end-(a==="`"?1:a===`{`?2:0),n,r)}function kV(e,t,n,r,i){t<n&&r!==e.slice(t,n)&&i.overwrite(t,n,r)}function AV(e,t){let n=Au(e),r=e;return n.forEach(e=>{let n=t.get(e);n!==void 0&&(r=r.replace(e,n))}),r===e?void 0:r}function jV(e,t){let n=t.get(e);if(n!==void 0)return n??void 0;let r=new Set,i=new Map;e.forEach(e=>{let t=Yu(e,{map:Pu});t===e||MV(e)||(i.set(e,t),r.add(RegExp.escape(e)),r.add(RegExp.escape(PV(e))))});let a=r.size>0?{pattern:new RegExp([...r].join(`|`)),replacements:i}:null;return t.set(e,a),a??void 0}function MV(e){if(e.startsWith(`//`)||e.startsWith(`http://`)||e.startsWith(`https://`))return!0;let t=e.indexOf(`/`);return t<=0||e.includes(`[`)||e.includes(`]`)||e.includes(`:`)?!1:!e.slice(0,t).includes(`-`)}function NV(e){return e.type===`Literal`&&typeof e.value==`string`}function PV(e){return e.replaceAll(/[\n\r"'\\\u2028\u2029]/g,e=>{switch(e){case`
2858
2858
  `:return`\\n`;case`\r`:return`\\r`;case`\u2028`:return`\\u2028`;case`\u2029`:return`\\u2029`}return`\\${e}`})}async function FV(e,t){if(!t.minify)return e;let{transform:n}=await import(`lightningcss`);return n({filename:t.filename,code:Buffer.from(e),minify:!0}).code.toString()}const IV=[`direct`,`inline`,`inline-css`,`raw`,`style-attr`,`transform-only`,`url`],LV=/(@(?:import|reference)\s+(?:url\(\s*)?)(['"])tailwindcss\2(?=\s*\)?(?:\s|;|$))/g,RV=o(n.join(Me,`index.css`));function zV(e,t){let n,r=t,i,a,o=new Map,s,c=e=>{o.forEach((t,n)=>{t.tailwind?.dependencies.has(e)&&o.set(n,{css:t.css,tailwind:{...t.tailwind,invalidated:!0}})})};return{name:`vpt:mini-styles`,config:{order:`post`,handler(e){return n=e.build?.cssMinify,{build:{cssMinify:!1}}}},configResolved(t){n??=!!t.build.minify,i=BV({filename:e.styles.globalFileName,minify:n}),Su(t.plugins.find(e=>e.name===`vite:css-post`),e=>async function(t,n,r){let i=await e.call(this,t,n,r);if(GV(n)){let e=Te(n);o.set(e,{css:t,tailwind:o.get(e)?.tailwind})}return i})},async buildStart(){r=await Promise.all(t.map(async e=>(await this.resolve(e)).id)),a=this},transform:{filter:{id:/\.(css|less|sass|scss|styl|stylus|pcss|postcss|sss)(?:$|\?)/},order:`pre`,async handler(e,t){if(!GV(t))return;let n=Te(t),r=o.get(n),i=r?.tailwind;if(!qV(e)){o.set(n,{css:r?.css,tailwind:void 0});return}let a=i?.invalidated?void 0:i,s=await UV(this.environment.config.root,n,e,a);return o.set(n,{css:r?.css,tailwind:s.root}),s.root.dependencies.forEach(e=>{this.addWatchFile(e)}),s.root.files.forEach(e=>{this.addWatchFile(e)}),{code:s.css,map:null}}},hotUpdate(e){c(Te(e.file))},watchChange(e){c(Te(e))},generateBundle:{order:`post`,async handler(t,n){let a=Object.values(n).filter(e=>e.type===`chunk`),s=await i(HV(r,o,this),a.map(e=>({code:e.code,filename:e.fileName})));a.forEach((e,t)=>{e.code=s.javaScript[t],e.map=null}),Object.entries(n).forEach(([e,t])=>{JV(t)&&delete n[e]}),this.emitFile({type:`asset`,fileName:e.styles.globalFileName,source:s.stylesheet})}},closeBundle(){this.environment.config.command===`build`&&o.clear()},closeWatcher(){o.clear()},finalizeUpdate:async(e,t)=>{let n=e.map(e=>({code:KV(e.code),filename:e.filename})),c=await i(HV(r,o,a),n);return c.stylesheet!==s&&(await t(c.stylesheet),s=c.stylesheet),e.map((e,t)=>({...e,code:c.javaScript[t]}))}}}function BV(e){let t=CV(),n;return async function(r,i){let a=n&&VV(n.classSet,r.classSet)?n.classSet:r.classSet,o=n?.css===r.css?n.stylesheet:await FV(await t.transformStylesheet(r.css),e),s=i.map(e=>t.transformJavaScript({classSet:a,code:e.code,filename:e.filename}));return n={css:r.css,classSet:a,stylesheet:o},{javaScript:s,stylesheet:o}}}function VV(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function HV(e,t,n){let r=new Set,i=new Set,a=[],o=new Set,s=e=>{if(r.has(e))return;r.add(e);let c=n.getModuleInfo(e);if(!c)return;c.importedIds.forEach(s),c.dynamicallyImportedIds.forEach(s);let l=Te(e),u=t.get(l);u?.css===void 0||i.has(l)||(i.add(l),a.push(u.css),u.tailwind?.classSet.forEach(e=>{o.add(e)}))};return e.forEach(s),{classSet:o,css:a.join(`
2859
- `)}}async function UV(e,t,r,i){let a=i?.source===r,o=a?i.generator:uu(await xu({projectRoot:e,cwd:Me,cssSources:[{css:WV(r),base:n.dirname(t),file:t}]})),s=await o.generate({scanSources:!0});return{css:s.css,root:{source:r,classSet:s.classSet,dependencies:new Set(s.dependencies.map(Te)),generator:o,files:a?i.files:new E({sources:s.sources}).files,invalidated:!1}}}function WV(e){return e.replace(LV,(e,t,n)=>`${t}${n}${RV}${n}`)}function GV(e){if(!a(e))return!1;let t=e.indexOf(`?`);if(t<0)return!0;let n=e.indexOf(`#`,t),r=e.slice(t+1,n<0?void 0:n),i=new URLSearchParams(r);return IV.every(e=>!i.has(e))}function KV(e){return e.replace(/(\b(?:const|let|var)\s+__vite__css[\w$]*\s*=\s*)"(?:\\[\s\S]|[^"\\])*"(?=;\s*\b__vite__updateStyle[\w$]*\s*\()/g,`$1""`)}function qV(e){return/@(?:import|reference)\s+(?:url\(\s*)?['"]tailwindcss(?:\/[^'"]*)?['"]/.test(e)}function JV(e){return e.type===`asset`&&/\.(?:acss|css|ttss|wxss)$/.test(e.fileName)}function YV(){let e=!1;return{name:`vpt:mini-watch`,enforce:`post`,apply:(e,{command:t})=>t===`build`&&!!e.build?.watch&&e.build?.write!==!1&&!e.build?.watch?.skipWrite,applyToEnvironment:Zr,config(){return{build:{emptyOutDir:!1}}},configResolved({root:e,build:t}){yt(n.resolve(e,t.outDir))},buildStart(){e=!1},closeWatcher(){e=!0},closeBundle:{order:`post`,sequential:!0,handler(t){if(t||e)return;let{root:r,build:i}=this.environment.config,a=n.resolve(r,i.outDir,`hmr`);m(a,{recursive:!0}),v(n.join(a,`watch.js`),`// ${S()}\n`)}}}}function XV(e){let t=Oo(e),n=Wi(e.runtime.modules),r=zV(e,t.applicationEntryIds);return[n,r,ZV(e,t,n),Ti(),qi(e),ri(n),Qr(e,r),YV()]}function ZV(e,t,n){return{name:`vpt:mini`,config(){return{define:QV(e.taro.env),appType:`custom`,oxc:{target:je},resolve:{alias:[{find:/^@tarojs\/plugin-framework-react\/dist\/runtime$/,replacement:N.resolve(`vite-plugin-taro-runtime/plugin-framework-react/runtime`)},{find:/^@tarojs\/runtime$/,replacement:xt},{find:/^@tarojs\/api$/,replacement:N.resolve(`vite-plugin-taro-runtime/api`)},{find:/^(?:@tarojs|vite-plugin-taro-runtime)\/components$/,replacement:e.taro.componentsReactPath}]},build:{modulePreload:!1,cssCodeSplit:!1,assetsInlineLimit:0,target:je,rolldownOptions:{input:t.input}}}},resolveId(e,n){return t.resolveId(e,n,this.environment.config.root)},transform:{order:`pre`,filter:{id:[e.runtime.modules.appCapsule,e.runtime.modules.pageCapsule].map(we)},handler(e,n){return t.specialize(e,n,!!this.environment.config.build.sourcemap)}},renderChunk:{order:`post`,async handler(t,r,i,a){let o=n.classifyChunk(r),s=!!i.sourcemap;if(o.executionKind===`capsule`)return Wa(t,r,s);let c=Ka({code:t,chunk:r,chunks:a.chunks,bootstrapModuleId:e.runtime.modules.bootstrap,getPhysicalChunkId:n.getPhysicalChunkId,classifyModule:n.classifyChunk,sourcemap:s});return o.isTransport?wo({code:c.code,transportChunk:r,chunks:a.chunks,classifyModule:n.classifyChunk,getLoadMode:n.getLoadMode,getPhysicalChunkId:n.getPhysicalChunkId,sourcemap:s}):c}},generateBundle:{order:`post`,async handler(t,r){(await Di({bundle:r,contract:e,subpackages:n.getSubpackages(),isProduction:this.environment.config.isProduction,getModuleInfo:e=>this.getModuleInfo(e),getPackageLocation:n.getPackageLocation})).forEach(e=>{this.emitFile(e)})}}}}function QV(e){let t=String(N(`vite-plugin-taro-runtime/taro/package.json`).version);return{"process.env.FRAMEWORK":JSON.stringify(`react`),"process.env.SUPPORT_TARO_POLYFILL":JSON.stringify(`disabled`),"process.env.TARO_ENV":JSON.stringify(e),"process.env.TARO_PLATFORM":JSON.stringify(`mini`),"process.env.TARO_VERSION":JSON.stringify(t),ENABLE_ADJACENT_HTML:`true`,ENABLE_CLONE_NODE:`true`,ENABLE_CONTAINS:`true`,ENABLE_INNER_HTML:`true`,ENABLE_MUTATION_OBSERVER:`true`,ENABLE_SIZE_APIS:`true`,ENABLE_TEMPLATE_CONTENT:`true`}}const $V=`custom-wrapper`;function eH(e,t){return{...ot(e),...t.length>0?{subPackages:t}:{}}}function tH(e,t){let n=at(e),r=dH(n.usingComponents)?n.usingComponents:{},i=dH(n.componentPlaceholder)?n.componentPlaceholder:{},a=Object.keys(t.componentPlaceholder).length>0;return{...n,usingComponents:{...r,...t.usingComponents,comp:cH(e.path,`comp`),[$V]:cH(e.path,$V)},...a?{componentPlaceholder:{...i,...t.componentPlaceholder}}:{}}}function nH(e){let t=Object.keys(e.componentPlaceholder).length>0;return{component:!0,styleIsolation:`apply-shared`,usingComponents:{...e.usingComponents,comp:`./comp`,[$V]:`./${$V}`},...t?{componentPlaceholder:e.componentPlaceholder}:{}}}function rH(e){return{usingComponents:Object.fromEntries(e.map(({name:e,componentPath:t})=>[e,t])),componentPlaceholder:Object.fromEntries(e.flatMap(({name:e,componentPath:t})=>Hi(t.slice(1))?[[e,`view`]]:[]))}}function iH(e,t,n){let r=(lH(e,t)?.renderedExports??[]).map(uH);return{includes:new Set([`view`,`catch-view`,`static-view`,`pure-view`,`click-view`,`scroll-view`,`image`,`static-image`,`text`,`static-text`,`navigator`,`web-view`,`input`,`checkbox`,`radio`,`slot`,`form`,`audio`,`video`,`canvas`,`label`,`textarea`,`progress`,`button`,...r.filter(e=>e!==$V)]),exclude:new Set,thirdPartyComponents:new Map([[$V,new Set],...n.map(e=>[e.name,new Set(e.fields)])]),includeAll:!1}}function aH(e,t,n){return oH(e,n?JSON.stringify(t):`${JSON.stringify(t,null,4)}\n`)}function oH(e,t){return{type:`asset`,fileName:e,source:t}}function sH(e,t,n,r){let i=e.indexOf(t),a=i===-1?-1:e.indexOf(t,i+t.length);if(i===-1||a!==-1)throw Error(`Expected one ${r}, found ${i===-1?0:`multiple`}`);return`${e.slice(0,i)}${n}${e.slice(i+t.length)}`}function cH(e,t){let r=n.posix.relative(n.posix.dirname(e),t);return r.startsWith(`.`)?r:`./${r}`}function lH(e,t){let n=Te(t);for(let t of Object.values(e)){if(t.type!==`chunk`)continue;let e=Object.entries(t.modules).find(([e])=>Te(e)===n);if(e)return e[1]}}function uH(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase()}function dH(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function fH(e,t){let n=`data="{{i:item}}"`;if(!e.includes(n))throw Error(`Recursive base templates must recurse through compact child data`);return`${sH(e.replaceAll(n,`data="{{i:item,p:p}}"`),`<custom-wrapper i="{{i}}"`,`<custom-wrapper i="{{i}}" p="{{p}}"`,`CustomWrapper Page-root bridge`)}
2859
+ `)}}async function UV(e,t,r,i){let a=i?.source===r,o=a?i.generator:uu(await xu({projectRoot:e,cwd:Me,cssSources:[{css:WV(r),base:n.dirname(t),file:t}]})),s=await o.generate({scanSources:!0});return{css:s.css,root:{source:r,classSet:s.classSet,dependencies:new Set(s.dependencies.map(Te)),generator:o,files:a?i.files:new E({sources:s.sources}).files,invalidated:!1}}}function WV(e){return e.replace(LV,(e,t,n)=>`${t}${n}${RV}${n}`)}function GV(e){if(!a(e))return!1;let t=e.indexOf(`?`);if(t<0)return!0;let n=e.indexOf(`#`,t),r=e.slice(t+1,n<0?void 0:n),i=new URLSearchParams(r);return IV.every(e=>!i.has(e))}function KV(e){return e.replace(/(\b(?:const|let|var)\s+__vite__css[\w$]*\s*=\s*)"(?:\\[\s\S]|[^"\\])*"(?=;\s*\b__vite__updateStyle[\w$]*\s*\()/g,`$1""`)}function qV(e){return/@(?:import|reference)\s+(?:url\(\s*)?['"]tailwindcss(?:\/[^'"]*)?['"]/.test(e)}function JV(e){return e.type===`asset`&&/\.(?:acss|css|ttss|wxss)$/.test(e.fileName)}function YV(){let e=!1;return{name:`vpt:mini-watch`,enforce:`post`,apply:(e,{command:t})=>t===`build`&&!!e.build?.watch&&e.build?.write!==!1&&!e.build?.watch?.skipWrite,applyToEnvironment:Qr,config(){return{build:{emptyOutDir:!1}}},configResolved({root:e,build:t}){yt(n.resolve(e,t.outDir))},buildStart(){e=!1},closeWatcher(){e=!0},closeBundle:{order:`post`,sequential:!0,handler(t){if(t||e)return;let{root:r,build:i}=this.environment.config,a=n.resolve(r,i.outDir,`hmr`);m(a,{recursive:!0}),v(n.join(a,`watch.js`),`// ${S()}\n`)}}}}function XV(e){let t=Oo(e),n=Yi(e.runtime.modules),r=zV(e,t.applicationEntryIds);return[n,r,ZV(e,t,n),Ei(),Qi(e),ii(n),$r(e,r),YV()]}function ZV(e,t,n){return{name:`vpt:mini`,config(){return{define:QV(e.taro.env),appType:`custom`,oxc:{target:je},resolve:{alias:[{find:/^@tarojs\/plugin-framework-react\/dist\/runtime$/,replacement:N.resolve(`vite-plugin-taro-runtime/plugin-framework-react/runtime`)},{find:/^@tarojs\/runtime$/,replacement:xt},{find:/^@tarojs\/api$/,replacement:N.resolve(`vite-plugin-taro-runtime/api`)},{find:/^(?:@tarojs|vite-plugin-taro-runtime)\/components$/,replacement:e.taro.componentsReactPath}]},build:{modulePreload:!1,cssCodeSplit:!1,assetsInlineLimit:0,target:je,rolldownOptions:{input:t.input}}}},resolveId(e,n){return t.resolveId(e,n,this.environment.config.root)},transform:{order:`pre`,filter:{id:[e.runtime.modules.appCapsule,e.runtime.modules.pageCapsule].map(we)},handler(e,n){return t.specialize(e,n,!!this.environment.config.build.sourcemap)}},renderChunk:{order:`post`,handler(t,r,i,a){let o=n.classifyChunk(r),s=!!i.sourcemap;switch(o){case`entry-capsule`:case`normal-capsule`:return Ka(t,r,s);case`native`:case`amphibious`:return Ja({code:t,chunk:r,chunks:a.chunks,bootstrapModuleId:e.runtime.modules.bootstrap,getPhysicalChunkId:n.getPhysicalChunkId,classifyModule:n.classifyChunk,sourcemap:s})}}},generateBundle:{order:`post`,async handler(t,r){let i=n.getSubpackages();this.emitFile(Ai({bundle:r,classifyModule:n.classifyChunk,getPackageLocation:n.getPackageLocation})),(await Mi({bundle:r,contract:e,subpackages:i,isProduction:this.environment.config.isProduction,getModuleInfo:e=>this.getModuleInfo(e),getPackageLocation:n.getPackageLocation})).forEach(e=>{this.emitFile(e)})}}}}function QV(e){let t=String(N(`vite-plugin-taro-runtime/taro/package.json`).version);return{"process.env.FRAMEWORK":JSON.stringify(`react`),"process.env.SUPPORT_TARO_POLYFILL":JSON.stringify(`disabled`),"process.env.TARO_ENV":JSON.stringify(e),"process.env.TARO_PLATFORM":JSON.stringify(`mini`),"process.env.TARO_VERSION":JSON.stringify(t),ENABLE_ADJACENT_HTML:`true`,ENABLE_CLONE_NODE:`true`,ENABLE_CONTAINS:`true`,ENABLE_INNER_HTML:`true`,ENABLE_MUTATION_OBSERVER:`true`,ENABLE_SIZE_APIS:`true`,ENABLE_TEMPLATE_CONTENT:`true`}}const $V=`custom-wrapper`;function eH(e,t){return{...ot(e),...t.length>0?{subPackages:t}:{}}}function tH(e,t){let n=at(e),r=dH(n.usingComponents)?n.usingComponents:{},i=dH(n.componentPlaceholder)?n.componentPlaceholder:{},a=Object.keys(t.componentPlaceholder).length>0;return{...n,usingComponents:{...r,...t.usingComponents,comp:cH(e.path,`comp`),[$V]:cH(e.path,$V)},...a?{componentPlaceholder:{...i,...t.componentPlaceholder}}:{}}}function nH(e){let t=Object.keys(e.componentPlaceholder).length>0;return{component:!0,styleIsolation:`apply-shared`,usingComponents:{...e.usingComponents,comp:`./comp`,[$V]:`./${$V}`},...t?{componentPlaceholder:e.componentPlaceholder}:{}}}function rH(e){return{usingComponents:Object.fromEntries(e.map(({name:e,componentPath:t})=>[e,t])),componentPlaceholder:Object.fromEntries(e.flatMap(({name:e,componentPath:t})=>qi(t.slice(1))?[[e,`view`]]:[]))}}function iH(e,t,n){let r=(lH(e,t)?.renderedExports??[]).map(uH);return{includes:new Set([`view`,`catch-view`,`static-view`,`pure-view`,`click-view`,`scroll-view`,`image`,`static-image`,`text`,`static-text`,`navigator`,`web-view`,`input`,`checkbox`,`radio`,`slot`,`form`,`video`,`canvas`,`label`,`textarea`,`progress`,`button`,...r.filter(e=>e!==$V)]),exclude:new Set,thirdPartyComponents:new Map([[$V,new Set],...n.map(e=>[e.name,new Set(e.fields)])]),includeAll:!1}}function aH(e,t,n){return oH(e,n?JSON.stringify(t):`${JSON.stringify(t,null,4)}\n`)}function oH(e,t){return{type:`asset`,fileName:e,source:t}}function sH(e,t,n,r){let i=e.indexOf(t),a=i===-1?-1:e.indexOf(t,i+t.length);if(i===-1||a!==-1)throw Error(`Expected one ${r}, found ${i===-1?0:`multiple`}`);return`${e.slice(0,i)}${n}${e.slice(i+t.length)}`}function cH(e,t){let r=n.posix.relative(n.posix.dirname(e),t);return r.startsWith(`.`)?r:`./${r}`}function lH(e,t){let n=Te(t);for(let t of Object.values(e)){if(t.type!==`chunk`)continue;let e=Object.entries(t.modules).find(([e])=>Te(e)===n);if(e)return e[1]}}function uH(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase()}function dH(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function fH(e,t){let n=`data="{{i:item}}"`;if(!e.includes(n))throw Error(`Recursive base templates must recurse through compact child data`);return`${sH(e.replaceAll(n,`data="{{i:item,p:p}}"`),`<custom-wrapper i="{{i}}"`,`<custom-wrapper i="{{i}}" p="{{p}}"`,`CustomWrapper Page-root bridge`)}
2860
2860
  <template name="tmpl_0_vpt_fragment">
2861
2861
  <template
2862
2862
  is="{{xs.a(0, item.nn)}}"
@@ -2868,7 +2868,7 @@ ia,444,260827,151
2868
2868
  <template name="tmpl_0_vpt_page_outlet">
2869
2869
  <template is="taro_tmpl" data="{{root:p}}" />
2870
2870
  </template>
2871
- `}function pH(e){return sH(e,`data="{{i:i}}"`,`data="{{i:i,p:p}}"`,`recursive component entry`)}function mH(e){return sH(e,`data="{{i:item}}"`,`data="{{i:item,p:p}}"`,`CustomWrapper recursion`)}function hH(e,...t){for(let n of t)n!==void 0&&gH(e,n);return e}function gH(e,t){for(let n in t){let r=t[n],i=e[n];if(Array.isArray(i)&&Array.isArray(r)){e[n]=i.concat(r);continue}if(vH(i)&&vH(r)){gH(i,r);continue}e[n]=_H(r)}}function _H(e){if(Array.isArray(e)){let t=Array(e.length);for(let n=0;n<e.length;n+=1)t[n]=_H(e[n]);return t}if(vH(e)){let t={};return gH(t,e),t}return e}function vH(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var yH=class extends ie{supportXS=!0;Adapter={if:`tt:if`,else:`tt:else`,elseif:`tt:elif`,for:`tt:for`,forItem:`tt:for-item`,forIndex:`tt:for-index`,key:`tt:key`,xs:`sjs`,type:`tt`};replacePropName(e,t){if(t===`eh`){let t=e.toLowerCase();return t===`bindlongtap`?`bindlongpress`:t}return e}buildXsTemplate(e){return`<sjs module="xs" src="${e??`./utils`}.sjs" />`}};function bH(){let e=new yH;return e.mergeComponents({helper:{recursiveMerge:hH}},ce),e}function xH({bundle:e,subpackages:t,nativeComponents:n,isProduction:r,options:i,componentsModulePath:a}){let o=bH(),s=rH(n),c=nH(s),l=(e,t)=>aH(e,t,r);return[l(`app.json`,eH(i,t.map(({root:e})=>({root:e,pages:[],common:!0})))),oH(`base.ttml`,fH(o.buildTemplate(iH(e,a,n)),`tt`)),oH(`utils.sjs`,o.buildXScript()),oH(`comp.ttml`,pH(o.buildBaseComponentTemplate(`.ttml`))),l(`comp.json`,c),oH(`custom-wrapper.ttml`,mH(o.buildCustomComponentTemplate(`.ttml`))),l(`custom-wrapper.json`,c),...i.pages.flatMap(e=>[l(`${e.path}.json`,tH(e,s)),oH(`${e.path}.ttml`,sH(o.buildPageTemplate(cH(e.path,`base.ttml`),{content:at(e),path:e.path}),`<template is="taro_tmpl" data="{{root:root}}" />`,`<comp i="{{app}}" p="{{page}}" />`,`TT Page template entry`)),oH(`${e.path}.ttss`,``)]),l(`project.config.json`,i.projectConfigJson),...i.projectPrivateConfigJson?[l(`project.private.config.json`,i.projectPrivateConfigJson)]:[]]}function SH(e){return XV(CH(e))}function CH(e){let t=N.resolve(`vite-plugin-taro-runtime/plugin-platform-tt/components-react`);return{options:e,taro:{env:`tt`,componentsReactPath:t,targetRuntimePath:P(`tt/taro-runtime`)},runtime:{modules:{bootstrap:P(`mini/amphibious/bootstrap`),transport:P(`mini/amphibious/transport`),appShell:P(`mini/native/app`),appCapsule:P(`mini/capsule/app`),componentShell:P(`mini/native/component`),componentCapsule:P(`mini/capsule/component`),customWrapperShell:P(`mini/native/custom-wrapper`),pageShell:P(`mini/native/page`),pageCapsule:P(`mini/capsule/page`),devtoolsHmrRuntime:P(`tt/dev/devtools-runtime`),interpreterHmrRuntime:P(`tt/dev/interpreter-runtime`)}},styles:{appFileName:`app.ttss`,globalFileName:`assets/global.ttss`},output:{generateProjectSkeleton(n){return xH({...n,options:e,componentsModulePath:t})}}}}var wH=class extends ae{supportXS=!0;Adapter={if:`wx:if`,else:`wx:else`,elseif:`wx:elif`,for:`wx:for`,forItem:`wx:for-item`,forIndex:`wx:for-index`,key:`wx:key`,xs:`wxs`,type:`weapp`};transferComponents={};constructor(){super(),this.nestElements.set(`root-portal`,3)}buildXsTemplate(e){return`<wxs module="xs" src="${e??`./utils`}.wxs" />`}createMiniComponents(e){let t=super.createMiniComponents(e);return this.transferComponents[`page-meta`]=t[`page-meta`],this.transferComponents[`navigation-bar`]=t[`navigation-bar`],delete t[`page-meta`],delete t[`navigation-bar`],t}replacePropName(e,t,n,r){if(t===`eh`){let t=e.toLowerCase();return t===`bindlongtap`&&n!==`canvas`?`bindlongpress`:t}return n===`share-element`&&t===`i.${r.mapkey}`?`key`:e}modifyTemplateResult=(e,t)=>t===`keyboard-accessory`?``:e;buildPageTemplate=(e,t)=>`<import src="${e}"/>${t?.content.enablePageMeta?this.buildPageMeta(e):``}
2871
+ `}function pH(e){return sH(e,`data="{{i:i}}"`,`data="{{i:i,p:p}}"`,`recursive component entry`)}function mH(e){return sH(e,`data="{{i:item}}"`,`data="{{i:item,p:p}}"`,`CustomWrapper recursion`)}function hH(e,...t){for(let n of t)n!==void 0&&gH(e,n);return e}function gH(e,t){for(let n in t){let r=t[n],i=e[n];if(Array.isArray(i)&&Array.isArray(r)){e[n]=i.concat(r);continue}if(vH(i)&&vH(r)){gH(i,r);continue}e[n]=_H(r)}}function _H(e){if(Array.isArray(e)){let t=Array(e.length);for(let n=0;n<e.length;n+=1)t[n]=_H(e[n]);return t}if(vH(e)){let t={};return gH(t,e),t}return e}function vH(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var yH=class extends ie{supportXS=!0;Adapter={if:`tt:if`,else:`tt:else`,elseif:`tt:elif`,for:`tt:for`,forItem:`tt:for-item`,forIndex:`tt:for-index`,key:`tt:key`,xs:`sjs`,type:`tt`};replacePropName(e,t){if(t===`eh`){let t=e.toLowerCase();return t===`bindlongtap`?`bindlongpress`:t}return e}buildXsTemplate(e){return`<sjs module="xs" src="${e??`./utils`}.sjs" />`}};function bH(){let e=new yH;return e.mergeComponents({helper:{recursiveMerge:hH}},ce),e}function xH({bundle:e,subpackages:t,nativeComponents:n,isProduction:r,options:i,componentsModulePath:a}){let o=bH(),s=rH(n),c=nH(s),l=(e,t)=>aH(e,t,r);return[l(`app.json`,eH(i,t.map(({root:e})=>({root:e,pages:[],common:!0})))),oH(`base.ttml`,fH(o.buildTemplate(iH(e,a,n)),`tt`)),oH(`utils.sjs`,o.buildXScript()),oH(`comp.ttml`,pH(o.buildBaseComponentTemplate(`.ttml`))),l(`comp.json`,c),oH(`custom-wrapper.ttml`,mH(o.buildCustomComponentTemplate(`.ttml`))),l(`custom-wrapper.json`,c),...i.pages.flatMap(e=>[l(`${e.path}.json`,tH(e,s)),oH(`${e.path}.ttml`,sH(o.buildPageTemplate(cH(e.path,`base.ttml`),{content:at(e),path:e.path}),`<template is="taro_tmpl" data="{{root:root}}" />`,`<comp i="{{app}}" p="{{page}}" />`,`TT Page template entry`)),oH(`${e.path}.ttss`,``)]),l(`project.config.json`,i.projectConfigJson),...i.projectPrivateConfigJson?[l(`project.private.config.json`,i.projectPrivateConfigJson)]:[]]}function SH(e){return XV(CH(e))}function CH(e){let t=N.resolve(`vite-plugin-taro-runtime/plugin-platform-tt/components-react`);return{options:e,taro:{env:`tt`,componentsReactPath:t,targetRuntimePath:P(`tt/taro-runtime`)},runtime:{modules:{bootstrap:P(`mini/amphibious/bootstrap`),appShell:P(`mini/native/app`),appCapsule:P(`mini/capsule/app`),componentShell:P(`mini/native/component`),componentCapsule:P(`mini/capsule/component`),customWrapperShell:P(`mini/native/custom-wrapper`),pageShell:P(`mini/native/page`),pageCapsule:P(`mini/capsule/page`),devtoolsHmrRuntime:P(`tt/dev/devtools-runtime`),interpreterHmrRuntime:P(`tt/dev/interpreter-runtime`)}},styles:{appFileName:`app.ttss`,globalFileName:`assets/global.ttss`},output:{generateProjectSkeleton(n){return xH({...n,options:e,componentsModulePath:t})}}}}var wH=class extends ae{supportXS=!0;Adapter={if:`wx:if`,else:`wx:else`,elseif:`wx:elif`,for:`wx:for`,forItem:`wx:for-item`,forIndex:`wx:for-index`,key:`wx:key`,xs:`wxs`,type:`weapp`};transferComponents={};constructor(){super(),this.nestElements.set(`root-portal`,3)}buildXsTemplate(e){return`<wxs module="xs" src="${e??`./utils`}.wxs" />`}createMiniComponents(e){let t=super.createMiniComponents(e);return this.transferComponents[`page-meta`]=t[`page-meta`],this.transferComponents[`navigation-bar`]=t[`navigation-bar`],delete t[`page-meta`],delete t[`navigation-bar`],t}replacePropName(e,t,n,r){if(t===`eh`){let t=e.toLowerCase();return t===`bindlongtap`&&n!==`canvas`?`bindlongpress`:t}return n===`share-element`&&t===`i.${r.mapkey}`?`key`:e}modifyTemplateResult=(e,t)=>t===`keyboard-accessory`?``:e;buildPageTemplate=(e,t)=>`<import src="${e}"/>${t?.content.enablePageMeta?this.buildPageMeta(e):``}
2872
2872
  <template is="taro_tmpl" data="{{${this.dataKeymap(`root:root`)}}}" />`;buildPageMeta(e){let t=this.buildTransferredAttributes(`page-meta`,`pageMeta.`),n=this.buildTransferredAttributes(`navigation-bar`,`navigationBar.`);return`
2873
2873
  <wxs module="xs" src="${e.replace(`base.wxml`,`utils.wxs`)}" />
2874
2874
  <page-meta data-sid="{{pageMeta.sid}}" ${t}>
@@ -2883,7 +2883,7 @@ ia,444,260827,151
2883
2883
  />
2884
2884
  </template>
2885
2885
  <template name="tmpl_0_vpt_page_outlet"><slot /></template>
2886
- `}function OH(e){return sH(e,`<template is="taro_tmpl" data="{{root:root}}" />`,`<comp i="{{app}}"><template is="taro_tmpl" data="{{root:page}}" /></comp>`,`Page template entry`)}function kH(e){return{name:e.slice(e.lastIndexOf(`/`)+1),root:e,pages:[]}}function AH(e){return XV(jH(e))}function jH(e){let t=N.resolve(`vite-plugin-taro-runtime/plugin-platform-weapp/components-react`);return{options:e,taro:{env:`weapp`,componentsReactPath:t,targetRuntimePath:N.resolve(`vite-plugin-taro-runtime/plugin-platform-weapp/runtime`)},runtime:{modules:{bootstrap:P(`mini/amphibious/bootstrap`),transport:P(`mini/amphibious/transport`),appShell:P(`mini/native/app`),appCapsule:P(`mini/capsule/app`),componentShell:P(`mini/native/component`),componentCapsule:P(`mini/capsule/component`),customWrapperShell:P(`mini/native/custom-wrapper`),pageShell:P(`mini/native/page`),pageCapsule:P(`mini/capsule/page`),devtoolsHmrRuntime:P(`wx/dev/devtools-runtime`),interpreterHmrRuntime:P(`wx/dev/interpreter-runtime`)}},styles:{appFileName:`app.wxss`,globalFileName:`assets/global.wxss`},output:{generateProjectSkeleton(n){return EH({...n,options:e,componentsModulePath:t})}}}}var MH=class extends ie{exportExpr=`export default`;supportXS=!0;isXMLSupportRecursiveReference=!1;Adapter={if:`a:if`,else:`a:else`,elseif:`a:elif`,for:`a:for`,forItem:`a:for-item`,forIndex:`a:for-index`,key:`a:key`,xs:`sjs`,type:`alipay`};transferComponents={};constructor(){super(),this.nestElements.set(`root-portal`,3)}buildXsTemplate(e){return`<import-sjs name="xs" from="${e??`./utils`}.sjs" />`}replacePropName(e,t,n,r){return t===`eh`?e.replace(`bind`,`on`):n===`map`&&t.includes(r.polygons)?`polygon`:e}getClickEvent(){return{onTap:`eh`}}getEvents(){return{onTap:`eh`,onTouchMove:`eh`,onTouchEnd:`eh`,onTouchCancel:`eh`,onLongTap:`eh`}}buildThirdPartyAttr(e){return[...e].map(e=>e.startsWith(`@`)?`on${oe(e.slice(1))}="eh" `:e.startsWith(`bind`)||e.startsWith(`on`)?`${e}="eh" `:` ${e}="{{ i.${se(e)} }}" `).join(``)}createMiniComponents(e){let t=super.createMiniComponents(e);return delete t.slot,delete t[`slot-view`],delete t[`native-slot`],this.transferComponents[`page-meta`]=t[`page-meta`],delete t[`page-meta`],t}modifyLoopBody=e=>e;modifyLoopContainer=(e,t)=>t===`picker`?`
2886
+ `}function OH(e){return sH(e,`<template is="taro_tmpl" data="{{root:root}}" />`,`<comp i="{{app}}"><template is="taro_tmpl" data="{{root:page}}" /></comp>`,`Page template entry`)}function kH(e){return{name:e.slice(e.lastIndexOf(`/`)+1),root:e,pages:[]}}function AH(e){return XV(jH(e))}function jH(e){let t=N.resolve(`vite-plugin-taro-runtime/plugin-platform-weapp/components-react`);return{options:e,taro:{env:`weapp`,componentsReactPath:t,targetRuntimePath:N.resolve(`vite-plugin-taro-runtime/plugin-platform-weapp/runtime`)},runtime:{modules:{bootstrap:P(`mini/amphibious/bootstrap`),appShell:P(`mini/native/app`),appCapsule:P(`mini/capsule/app`),componentShell:P(`mini/native/component`),componentCapsule:P(`mini/capsule/component`),customWrapperShell:P(`mini/native/custom-wrapper`),pageShell:P(`mini/native/page`),pageCapsule:P(`mini/capsule/page`),devtoolsHmrRuntime:P(`wx/dev/devtools-runtime`),interpreterHmrRuntime:P(`wx/dev/interpreter-runtime`)}},styles:{appFileName:`app.wxss`,globalFileName:`assets/global.wxss`},output:{generateProjectSkeleton(n){return EH({...n,options:e,componentsModulePath:t})}}}}var MH=class extends ie{exportExpr=`export default`;supportXS=!0;isXMLSupportRecursiveReference=!1;Adapter={if:`a:if`,else:`a:else`,elseif:`a:elif`,for:`a:for`,forItem:`a:for-item`,forIndex:`a:for-index`,key:`a:key`,xs:`sjs`,type:`alipay`};transferComponents={};constructor(){super(),this.nestElements.set(`root-portal`,3)}buildXsTemplate(e){return`<import-sjs name="xs" from="${e??`./utils`}.sjs" />`}replacePropName(e,t,n,r){return t===`eh`?e.replace(`bind`,`on`):n===`map`&&t.includes(r.polygons)?`polygon`:e}getClickEvent(){return{onTap:`eh`}}getEvents(){return{onTap:`eh`,onTouchMove:`eh`,onTouchEnd:`eh`,onTouchCancel:`eh`,onLongTap:`eh`}}buildThirdPartyAttr(e){return[...e].map(e=>e.startsWith(`@`)?`on${oe(e.slice(1))}="eh" `:e.startsWith(`bind`)||e.startsWith(`on`)?`${e}="eh" `:` ${e}="{{ i.${se(e)} }}" `).join(``)}createMiniComponents(e){let t=super.createMiniComponents(e);return delete t.slot,delete t[`slot-view`],delete t[`native-slot`],this.transferComponents[`page-meta`]=t[`page-meta`],delete t[`page-meta`],t}modifyLoopBody=e=>e;modifyLoopContainer=(e,t)=>t===`picker`?`
2887
2887
  <view>${e}</view>
2888
2888
  `:t===`swiper`?`
2889
2889
  <block a:for="{{xs.f(i.cn)}}" a:key="sid">
@@ -2903,4 +2903,4 @@ ia,444,260827,151
2903
2903
  }`}buildPageTemplate=(e,t)=>`<import src="${e}"/>${t?.content.enablePageMeta?this.buildPageMeta(e):``}
2904
2904
  <template is="taro_tmpl" data="{{${this.dataKeymap(`root:root`)}}}" />`;buildPageMeta(e){let t=this.buildTransferredAttributes(`page-meta`,`pageMeta.`);return`
2905
2905
  <import-sjs name="xs" from="${e.replace(`base.axml`,`utils.sjs`)}" />
2906
- <page-meta data-sid="{{pageMeta.sid}}" ${t}></page-meta>`}buildTransferredAttributes(e,t){return Object.entries(this.transferComponents[e]).map(([e,n])=>`${e}="${n===`eh`?n:`{{${n.replace(`i.`,t)}}}`}" `).join(``)}};function NH(){let e=new MH;return e.mergeComponents({helper:{recursiveMerge:hH}},O),delete e.internalComponents.Slider[`block-size`],delete e.internalComponents.Slider[`block-color`],delete e.internalComponents.Swiper.bindAnimationFinish,e}function PH({bundle:e,subpackages:t,nativeComponents:n,isProduction:r,options:i,componentsModulePath:a}){let o=NH(),s=iH(e,a,n),c=rH(n),l=nH(c),u=FH(o.buildTemplate(s)),d=pH(o.buildBaseComponentTemplate(`.axml`)),f=mH(o.buildCustomComponentTemplate(`.axml`)),p=t.map(e=>LH(e.root)),m=(e,t)=>aH(e,t,r);return[m(`app.json`,eH(i,p)),oH(`base.axml`,u),oH(`utils.sjs`,o.buildXScript()),oH(`comp.axml`,d),m(`comp.json`,l),oH(`custom-wrapper.axml`,f),m(`custom-wrapper.json`,l),...i.pages.flatMap(e=>{let t=cH(e.path,`base.axml`),n=o.buildPageTemplate(t,{content:at(e),path:e.path});return[m(`${e.path}.json`,tH(e,c)),oH(`${e.path}.axml`,IH({source:n,baseTemplatePath:t})),oH(`${e.path}.acss`,``)]}),m(`mini.project.json`,i.projectConfigJson),...i.projectPrivateConfigJson?[m(`.mini-ide/project-ide.json`,i.projectPrivateConfigJson)]:[],oH(`.browserslistrc`,`defaults and fully supports es6-module`)]}function FH(e){return fH(e,`a`)}function IH({source:e,baseTemplatePath:t}){return sH(sH(e,`<import src="${t}"/>`,``,`Alipay Page base import`),`<template is="taro_tmpl" data="{{root:root}}" />`,`<comp i="{{app}}" p="{{page}}" />`,`Alipay Page template entry`)}function LH(e){return{root:e,pages:[]}}function RH(e){return XV(zH(e))}function zH(e){let t=N.resolve(`vite-plugin-taro-runtime/plugin-platform-alipay/components-react`);return{options:e,taro:{env:`alipay`,componentsReactPath:t,targetRuntimePath:N.resolve(`vite-plugin-taro-runtime/plugin-platform-alipay/runtime`)},runtime:{modules:{bootstrap:P(`mini/amphibious/bootstrap`),transport:P(`mini/amphibious/transport`),appShell:P(`mini/native/app`),appCapsule:P(`mini/capsule/app`),componentShell:P(`mini/native/component`),componentCapsule:P(`mini/capsule/component`),customWrapperShell:P(`mini/native/custom-wrapper`),pageShell:P(`mini/native/page`),pageCapsule:P(`mini/capsule/page`),devtoolsHmrRuntime:P(`zfb/dev/devtools-runtime`),interpreterHmrRuntime:P(`zfb/dev/interpreter-runtime`)}},styles:{appFileName:`app.acss`,globalFileName:`assets/global.acss`},output:{generateProjectSkeleton(n){return PH({...n,options:e,componentsModulePath:t})}}}}const BH=N(`vite-plugin-taro/package.json`),VH=BH.peerDependencies.vite,HH=BH.dependencies.rolldown;function UH(){WH(l,s)}function WH(e,t){if(e!==VH)throw Error(`vpt requires vite@${VH}, but found vite@${e}.`);if(t!==HH)throw Error(`vpt requires rolldown@${HH}, but found rolldown@${t}.`)}function GH(e){return UH(),[De(e.target),be(e.target),...t(),...e.target===`wx`?AH(e):[],...e.target===`zfb`?RH(e):[],...e.target===`tt`?SH(e):[],...e.target===`h5`?pt(e):[]]}export{GH as default};
2906
+ <page-meta data-sid="{{pageMeta.sid}}" ${t}></page-meta>`}buildTransferredAttributes(e,t){return Object.entries(this.transferComponents[e]).map(([e,n])=>`${e}="${n===`eh`?n:`{{${n.replace(`i.`,t)}}}`}" `).join(``)}};function NH(){let e=new MH;return e.mergeComponents({helper:{recursiveMerge:hH}},O),delete e.internalComponents.Slider[`block-size`],delete e.internalComponents.Slider[`block-color`],delete e.internalComponents.Swiper.bindAnimationFinish,e}function PH({bundle:e,subpackages:t,nativeComponents:n,isProduction:r,options:i,componentsModulePath:a}){let o=NH(),s=iH(e,a,n),c=rH(n),l=nH(c),u=FH(o.buildTemplate(s)),d=pH(o.buildBaseComponentTemplate(`.axml`)),f=mH(o.buildCustomComponentTemplate(`.axml`)),p=t.map(e=>LH(e.root)),m=(e,t)=>aH(e,t,r);return[m(`app.json`,eH(i,p)),oH(`base.axml`,u),oH(`utils.sjs`,o.buildXScript()),oH(`comp.axml`,d),m(`comp.json`,l),oH(`custom-wrapper.axml`,f),m(`custom-wrapper.json`,l),...i.pages.flatMap(e=>{let t=cH(e.path,`base.axml`),n=o.buildPageTemplate(t,{content:at(e),path:e.path});return[m(`${e.path}.json`,tH(e,c)),oH(`${e.path}.axml`,IH({source:n,baseTemplatePath:t})),oH(`${e.path}.acss`,``)]}),m(`mini.project.json`,i.projectConfigJson),...i.projectPrivateConfigJson?[m(`.mini-ide/project-ide.json`,i.projectPrivateConfigJson)]:[],oH(`.browserslistrc`,`defaults and fully supports es6-module`)]}function FH(e){return fH(e,`a`)}function IH({source:e,baseTemplatePath:t}){return sH(sH(e,`<import src="${t}"/>`,``,`Alipay Page base import`),`<template is="taro_tmpl" data="{{root:root}}" />`,`<comp i="{{app}}" p="{{page}}" />`,`Alipay Page template entry`)}function LH(e){return{root:e,pages:[]}}function RH(e){return XV(zH(e))}function zH(e){let t=N.resolve(`vite-plugin-taro-runtime/plugin-platform-alipay/components-react`);return{options:e,taro:{env:`alipay`,componentsReactPath:t,targetRuntimePath:N.resolve(`vite-plugin-taro-runtime/plugin-platform-alipay/runtime`)},runtime:{modules:{bootstrap:P(`mini/amphibious/bootstrap`),appShell:P(`mini/native/app`),appCapsule:P(`mini/capsule/app`),componentShell:P(`mini/native/component`),componentCapsule:P(`mini/capsule/component`),customWrapperShell:P(`mini/native/custom-wrapper`),pageShell:P(`mini/native/page`),pageCapsule:P(`mini/capsule/page`),devtoolsHmrRuntime:P(`zfb/dev/devtools-runtime`),interpreterHmrRuntime:P(`zfb/dev/interpreter-runtime`)}},styles:{appFileName:`app.acss`,globalFileName:`assets/global.acss`},output:{generateProjectSkeleton(n){return PH({...n,options:e,componentsModulePath:t})}}}}const BH=N(`vite-plugin-taro/package.json`),VH=BH.peerDependencies.vite,HH=BH.dependencies.rolldown;function UH(){WH(l,s)}function WH(e,t){if(e!==VH)throw Error(`vpt requires vite@${VH}, but found vite@${e}.`);if(t!==HH)throw Error(`vpt requires rolldown@${HH}, but found rolldown@${t}.`)}function GH(e){return UH(),[De(e.target),be(e.target),...t(),...e.target===`wx`?AH(e):[],...e.target===`zfb`?RH(e):[],...e.target===`tt`?SH(e):[],...e.target===`h5`?pt(e):[]]}export{GH as default};
@@ -10,7 +10,7 @@ export declare function isMiniClientEnvironment(environment: Readonly<{
10
10
  * Refresh adaptation transforms.
11
11
  *
12
12
  * The shared style pipeline already owns the resolver's ordered App/Page cascade policy, so the host does not reconstruct it
13
- * from unrelated Rolldown shell and transport entries.
13
+ * from unrelated Rolldown shell and bootstrap entries.
14
14
  */
15
15
  export declare function createMiniDevelopmentPlugin(contract: Pick<MiniContract, 'options' | 'runtime' | 'styles'>, styles: MiniStylePlugin): PluginOption[];
16
16
  /**
@@ -9,7 +9,6 @@ export type TaroContract = {
9
9
  /** Physical runtime modules selected by one Mini Program target. */
10
10
  export type RuntimeModulesContract = {
11
11
  bootstrap: string;
12
- transport: string;
13
12
  appShell: string;
14
13
  appCapsule: string;
15
14
  componentShell: string;
@@ -7,6 +7,9 @@ export declare const rolldownRuntimeId = "\0rolldown/runtime.js";
7
7
  export declare const vptGlobalBindingId = "\0vpt:global-binding";
8
8
  /** Generates the selected core-js imports as one independently executable output entry. */
9
9
  export declare const miniPolyfillsId = "\0vpt:mini-polyfills";
10
+ /** External bootstrap dependency emitted only after the bundled graph is finalized. */
11
+ export declare const miniTransportId = "\0vpt:mini-transport";
12
+ export declare const miniTransportFileName = "common/vpt/transport.js";
10
13
  /** Resolves the shared Taro facade's target initialization side effect. */
11
14
  export declare const taroTargetRuntimeId = "\0vpt:taro-target-runtime";
12
15
  /** Redirects Vite's injected browser preload helper to the bootstrap identity loader. */
@@ -22,18 +25,10 @@ export declare const pageComponentId = "\0vpt:page-component";
22
25
  /** Gives every Page shell one private capsule target that can be resolved using its route. */
23
26
  export declare const pageCapsuleId = "\0vpt:page-capsule";
24
27
  export type MiniChunk = Rolldown.PreRenderedChunk | Rolldown.RenderedChunk;
25
- /** Build-graph role of an explicit native lifecycle entry. */
26
- export type MiniEntryRole = 'shell' | 'capsule';
27
- /** Runtime domain in which one final Mini Program JavaScript chunk executes. */
28
- export type MiniExecutionKind = 'native' | 'capsule' | 'amphibious';
29
- /** Complete execution classification derived from one pass over a chunk's module IDs. */
30
- export type MiniChunkClassification = Readonly<{
31
- entryRole: MiniEntryRole | undefined;
32
- executionKind: MiniExecutionKind;
33
- isTransport: boolean;
34
- }>;
35
- /** Classifies chunks by explicit runtime roles. */
36
- export type MiniModuleClassifier = (chunk: MiniChunk) => MiniChunkClassification;
28
+ /** Distinguishes native shells, lifecycle entry capsules, ordinary capsules, and shared native/SystemJS infrastructure. */
29
+ export type MiniChunkKind = 'native' | 'entry-capsule' | 'normal-capsule' | 'amphibious';
30
+ /** Classifies chunks by their compiler-owned modules; ordinary application chunks are normal capsules. */
31
+ export type MiniModuleClassifier = (chunk: MiniChunk) => MiniChunkKind;
37
32
  /** Native hook filter for the physical core-js graph; the generated import-only entry needs no host rewriting. */
38
33
  export declare const miniPolyfillSourceFilter: RegExp;
39
34
  /** Keeps the global binding and core-js in the pre-bootstrap native chunk, outside the recursive framework group. */
@@ -41,8 +36,8 @@ export declare function isMiniPolyfillModule(moduleId: string): boolean;
41
36
  /** Groups framework modules by resolved package roots; Rolldown includes their dependencies. */
42
37
  export declare function isMiniFrameworkVendorModule(moduleId: string): boolean;
43
38
  /**
44
- * Classifies explicit runtime entries in one module-ID scan; framework vendor remains a capsule.
45
- * Amphibious chunks share bootstrap's bridge so native and SystemJS callers reuse the same exports.
46
- * Construction is O(1); each lookup is O(M), where M is the number of modules in the chunk.
39
+ * The Mini graph separates lifecycle entries from bootstrap/polyfill/runtime infrastructure. A compiler-owned module
40
+ * identifies its chunk's kind; chunks containing only application or framework modules are normal capsules.
41
+ * One scan stops at the first known identity: O(M) worst-case time and O(1) extra space, without per-chunk collections.
47
42
  */
48
43
  export declare function createMiniModuleClassifier(modules: RuntimeModulesContract): MiniModuleClassifier;
@@ -0,0 +1,29 @@
1
+ import type { Rolldown } from 'vite';
2
+ import { type MiniModuleClassifier } from '../module/module.ts';
3
+ import type { PackageLocation } from '../placer/placement.ts';
4
+ /**
5
+ * Emits the closed transport table in generateBundle, after placement and content-hash resolution. Each switch case has two
6
+ * identities: the package-neutral final filename is the SystemJS registration ID, while the package-qualified filename
7
+ * supplies the literal native require path. Preliminary hash placeholders must not escape into this late-generated file.
8
+ *
9
+ * Transport itself executes only as native CommonJS in common/vpt/, separate from the bundled chunk namespace. Together
10
+ * with bootstrap it publishes native namespaces to SystemJS without re-evaluating their module bodies.
11
+ *
12
+ * Do not generate this table in renderChunk: that hook runs before Rolldown's final minifier/code generator, which can rewrite
13
+ * require.async("path") into require.async(`path`). TikTok (tt) misses these template-literal dependencies in its static scan,
14
+ * causing "Can't find module" even when the referenced subpackage file exists. This is a dependency-discovery issue, not a
15
+ * difference in JavaScript string values.
16
+ *
17
+ * Emit the finished CommonJS as an asset in generateBundle so Rolldown writes it without minifying or reprinting its quoted
18
+ * paths. Fixed compact syntax and JSON-encoded IDs need no AST or quote-repair pass, while application chunks retain full
19
+ * compression, mangling, and whitespace removal.
20
+ */
21
+ export declare function createTransportOutput({ bundle, classifyModule, getPackageLocation }: {
22
+ bundle: Rolldown.OutputBundle;
23
+ classifyModule: MiniModuleClassifier;
24
+ getPackageLocation(chunk: Rolldown.OutputChunk): PackageLocation;
25
+ }): {
26
+ type: "asset";
27
+ fileName: string;
28
+ source: string;
29
+ };
@@ -18,7 +18,6 @@ export type Placement = Readonly<{
18
18
  getPackageLocation(chunk: Rolldown.RenderedChunk | Rolldown.OutputChunk): PackageLocation;
19
19
  /** Resolves a rendered chunk or its exact entry module ID to its planned physical path. */
20
20
  getPhysicalChunkId(chunk: Rolldown.RenderedChunk | string): string;
21
- getLoadMode(chunk: Rolldown.RenderedChunk): 'sync' | 'async';
22
21
  finalize(bundle: Rolldown.OutputBundle): readonly GeneratedSubpackage[];
23
22
  }>;
24
23
  /**
@@ -1,14 +1,13 @@
1
1
  import type { Plugin, Rolldown } from 'vite';
2
2
  import type { RuntimeModulesContract } from '../mini-contract.ts';
3
- import { isMiniPolyfillModule, type MiniChunkClassification, type MiniModuleClassifier } from '../module/module.ts';
3
+ import { isMiniPolyfillModule, type MiniChunkKind, type MiniModuleClassifier } from '../module/module.ts';
4
4
  import { type GeneratedSubpackage, type PackageLocation } from './placement.ts';
5
5
  export type { GeneratedSubpackage, Placement } from './placement.ts';
6
6
  /** Placement services consumed by the later Mini Program rendering and output hooks. */
7
7
  export type MiniPlacementPlugin = Plugin & Readonly<{
8
- classifyChunk(chunk: Rolldown.PreRenderedChunk | Rolldown.RenderedChunk): MiniChunkClassification;
8
+ classifyChunk(chunk: Rolldown.PreRenderedChunk | Rolldown.RenderedChunk): MiniChunkKind;
9
9
  getPackageLocation(chunk: Rolldown.RenderedChunk | Rolldown.OutputChunk): PackageLocation;
10
10
  getPhysicalChunkId(chunk: Rolldown.RenderedChunk | string): string;
11
- getLoadMode(chunk: Rolldown.RenderedChunk): 'sync' | 'async';
12
11
  getSubpackages(): readonly GeneratedSubpackage[];
13
12
  }>;
14
13
  /**
@@ -56,7 +55,7 @@ export declare function createPlacementRolldownOptions(classifyChunk: MiniModule
56
55
  * 1. Its config hook installs package-neutral Rolldown names and entry-signature semantics.
57
56
  * 2. `renderStart` atomically starts a generation in `awaiting-chunks`; no stale placement remains reachable.
58
57
  * 3. Its first pre-order `renderChunk` creates one immutable LTHP placement from the complete tree-shaken graph.
59
- * 4. `vpt:mini` asks this plugin only for package ownership, physical relocation, and native loading mode.
58
+ * 4. `vpt:mini` asks this plugin only for package ownership and physical relocation.
60
59
  * 5. Its pre-order `generateBundle` assigns each OutputChunk its package-qualified filename and publishes app.json declarations.
61
60
  *
62
61
  * The discriminated state is the only generation-local mutation: `idle → awaiting-chunks → planned → finalized`. Each hook
@@ -1,7 +1,8 @@
1
+ import { type Rolldown } from 'vite';
1
2
  import type { MiniContract } from '../mini-contract.ts';
2
3
  /** Creates the resolver and source specializer for one Mini Program module graph. */
3
4
  export declare function createResolver(contract: Pick<MiniContract, 'options' | 'runtime' | 'taro'>): {
4
- resolveId(id: string, importer: string | undefined, projectRoot: string): string | undefined;
5
+ resolveId(id: string, importer: string | undefined, projectRoot: string): string | Rolldown.PartialResolvedId | undefined;
5
6
  specialize(code: string, id: string, sourcemap?: boolean): import("../../../utils/transform.ts").AstTransformResult | undefined;
6
7
  applicationEntryIds: string[];
7
8
  input: any;
@@ -5,9 +5,9 @@ const globalThis = vptGlobal;
5
5
  // Install the selected polyfills before the runtime or application uses them.
6
6
  // @ts-expect-error: The Mini build resolves this private polyfills entry.
7
7
  import '\0vpt:mini-polyfills';
8
+ import { transport } from '\0vpt:mini-transport';
8
9
  // Install the minimal SystemJS loader and its synchronous-import extension before any native entry requests a capsule.
9
10
  import { System as createdSystem } from '../systemjs/system-core.js';
10
- import { transport } from './transport.js';
11
11
  // install the System on globalThis
12
12
  globalThis.System = createdSystem;
13
13
  // Publish the installed loader as an explicit native dependency; callers need no ambient globalThis binding.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-taro",
3
- "version": "0.7.5-beta.0",
3
+ "version": "0.7.5-beta.1",
4
4
  "author": "sep2",
5
5
  "description": "Vite 8 plugin for building one React/Taro codebase for WeChat, Alipay, TikTok, and H5 targets.",
6
6
  "type": "module",
@@ -66,7 +66,7 @@
66
66
  "rolldown": "1.2.8",
67
67
  "sval": "0.6.12",
68
68
  "tailwindcss": "^4.3.3",
69
- "vite-plugin-taro-runtime": "0.7.5-beta.0"
69
+ "vite-plugin-taro-runtime": "0.7.5-beta.1"
70
70
  },
71
71
  "peerDependencies": {
72
72
  "react": "^19.3.0",
@@ -1,35 +0,0 @@
1
- import type { Rolldown } from 'vite';
2
- import { type AstTransformResult } from '../../../utils/transform.ts';
3
- import type { MiniModuleClassifier } from '../module/module.ts';
4
- export declare const transportPlaceholder = "__VPT_TRANSPORT__";
5
- /**
6
- * Materializes transport while Rolldown's preliminary hash placeholders are still active. Each switch case deliberately has
7
- * two IDs: the normalized preliminary filename becomes the SystemJS registration identity, while the LTHP-selected
8
- * assets/package-qualified filename becomes the literal native require path. Rolldown
9
- * substitutes both hashes after this transform, so the generated transport code and its own content hash describe the exact
10
- * files that `generateBundle` later materializes.
11
- *
12
- * This intentionally creates broad hash invalidation: changing one capsule can rename transport, then bootstrap, then
13
- * chunks that import bootstrap. A Mini Program ships one application package rather than independently cached HTTP
14
- * chunks, so honest content hashes and automatic graph linking are more valuable than minimizing that hash fan-out.
15
- */
16
- export declare function materializeTransport({ code, transportChunk, chunks, classifyModule, getLoadMode, getPhysicalChunkId, sourcemap }: {
17
- code: string;
18
- transportChunk: Rolldown.RenderedChunk;
19
- chunks: Readonly<Record<string, Rolldown.RenderedChunk>>;
20
- classifyModule: MiniModuleClassifier;
21
- getLoadMode(chunk: Rolldown.RenderedChunk): 'sync' | 'async';
22
- getPhysicalChunkId?: (chunk: Rolldown.RenderedChunk) => string;
23
- sourcemap?: boolean;
24
- }): Promise<AstTransformResult>;
25
- /**
26
- * Generates the closed transport expression from fixed ES2018-compatible syntax and JSON-encoded IDs and paths.
27
- * All require arguments stay literal; inserting this expression needs neither Babel AST construction nor another Oxc pass.
28
- */
29
- export declare function createTransportExpression({ transportChunk, chunks, classifyModule, getLoadMode, getPhysicalChunkId }: {
30
- transportChunk: Rolldown.RenderedChunk;
31
- chunks: Readonly<Record<string, Rolldown.RenderedChunk>>;
32
- classifyModule: MiniModuleClassifier;
33
- getLoadMode(chunk: Rolldown.RenderedChunk): 'sync' | 'async';
34
- getPhysicalChunkId(chunk: Rolldown.RenderedChunk): string;
35
- }): string;
@@ -1,2 +0,0 @@
1
- /** Dispatches to one generated literal require and bridges amphibious CommonJS namespaces inline. */
2
- export declare const transport: (moduleId: string) => System.Registration | PromiseLike<System.Registration>;
@@ -1,4 +0,0 @@
1
- // Transport itself executes only as native CommonJS. It lives beside bootstrap because together they implement the
2
- // amphibious boundary that publishes native namespaces to SystemJS without re-evaluating their module bodies.
3
- /** Dispatches to one generated literal require and bridges amphibious CommonJS namespaces inline. */
4
- export const transport = __VPT_TRANSPORT__;