ms-vite-plugin 1.4.67 → 1.4.69

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.addVararg=o;function c(t){t.vararg=!0,s(t.body.body)}function a(t){switch(t.type){case"FuncExpr":c(t);break;case"UnaryExpr":a(t.arg);break;case"BinaryExpr":a(t.left),a(t.right);break;case"TableExpr":for(const e of t.fields)e.kind==="index"&&a(e.key),a(e.value);break;case"IndexExpr":a(t.object),a(t.index);break;case"MemberExpr":a(t.object);break;case"CallExpr":a(t.callee);for(const e of t.args)a(e);break;case"MethodCallExpr":a(t.object);for(const e of t.args)a(e);break;case"ParenExpr":a(t.exp);break;default:break}}function s(t){for(const e of t)switch(e.type){case"DoStat":case"WhileStat":case"RepeatStat":case"ForNumStat":case"ForInStat":if(e.type==="WhileStat"&&a(e.cond),e.type==="RepeatStat"&&a(e.cond),e.type==="ForNumStat"&&(a(e.start),a(e.end),e.step&&a(e.step)),e.type==="ForInStat")for(const r of e.exps)a(r);s(e.body.body);break;case"IfStat":for(const r of e.clauses)a(r.cond),s(r.body.body);e.elseBody&&s(e.elseBody.body);break;case"FuncStat":case"LocalFuncStat":c(e.func);break;case"LocalStat":if(e.exps)for(const r of e.exps)a(r);break;case"AssignStat":for(const r of e.vars)a(r);for(const r of e.exps)a(r);break;case"CallStat":a(e.exp);break;case"ReturnStat":for(const r of e.exps)a(r);break;default:break}}function o(t){s(t.body)}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.addVararg=r;function c(t){t.vararg=!0,s(t.body.body)}function a(t){switch(t.type){case"FuncExpr":c(t);break;case"UnaryExpr":a(t.arg);break;case"BinaryExpr":a(t.left),a(t.right);break;case"TableExpr":for(const e of t.fields)e.kind==="index"&&a(e.key),a(e.value);break;case"IndexExpr":a(t.object),a(t.index);break;case"MemberExpr":a(t.object);break;case"CallExpr":a(t.callee);for(const e of t.args)a(e);break;case"MethodCallExpr":a(t.object);for(const e of t.args)a(e);break;case"ParenExpr":a(t.exp);break;default:break}}function s(t){for(const e of t)switch(e.type){case"DoStat":case"WhileStat":case"RepeatStat":case"ForNumStat":case"ForInStat":if(e.type==="WhileStat"&&a(e.cond),e.type==="RepeatStat"&&a(e.cond),e.type==="ForNumStat"&&(a(e.start),a(e.end),e.step&&a(e.step)),e.type==="ForInStat")for(const o of e.exps)a(o);s(e.body.body);break;case"IfStat":for(const o of e.clauses)a(o.cond),s(o.body.body);e.elseBody&&s(e.elseBody.body);break;case"FuncStat":case"LocalFuncStat":c(e.func);break;case"LocalStat":if(e.exps)for(const o of e.exps)a(o);break;case"AssignStat":for(const o of e.vars)a(o);for(const o of e.exps)a(o);break;case"CallStat":a(e.exp);break;case"ReturnStat":for(const o of e.exps)a(o);break;default:break}}function r(t){s(t.body)}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.flattenControlFlow=C;function m(e){return{type:"NumberLiteral",raw:String(e),value:e}}function y(e){return{type:"NameExpr",name:e}}function b(e,t){return{type:"AssignStat",vars:e.map(a=>y(a)),exps:t}}function u(e,t){return b([e.stateName],[typeof t=="number"?m(t):t])}function k(e,t,a){return{type:"BinaryExpr",op:"or",left:{type:"BinaryExpr",op:"and",left:y(e),right:m(t)},right:m(a)}}function E(e,t,a){return{type:"BinaryExpr",op:e,left:t,right:a}}function S(e){const t=`__t${e.nextTemp}`;return e.nextTemp+=1,e.temps.push(t),t}function x(e){const t=e.nextState;return e.nextState+=1,e.states.set(t,[]),t}function r(e,t,a){e.states.get(t).push(a)}function L(e,t){for(const a of e)if(a.type==="LocalStat")for(const o of a.names)t.push(o.name);else if(a.type==="LocalFuncStat")t.push(a.name);else if(a.type==="ForNumStat")t.push(a.name),L(a.body.body,t);else if(a.type==="ForInStat")t.push(...a.names),L(a.body.body,t);else if(a.type==="DoStat"||a.type==="WhileStat"||a.type==="RepeatStat")L(a.body.body,t);else if(a.type==="IfStat"){for(const o of a.clauses)L(o.body.body,t);a.elseBody&&L(a.elseBody.body,t)}}function h(e,t,a,o){if(e.length===0)return t;const p=e.map(()=>x(a));for(let n=0;n<e.length;n+=1){const c=e[n];c.type==="LabelStat"&&a.userLabels.set(c.name,p[n])}for(let n=0;n<e.length;n+=1){const c=n+1<e.length?p[n+1]:t;I(a,p[n],e[n],c,o)}return p[0]}function I(e,t,a,o,p){switch(a.type){case"EmptyStat":case"LabelStat":r(e,t,u(e,o));return;case"AssignStat":case"CallStat":case"FuncStat":r(e,t,a),r(e,t,u(e,o));return;case"LocalStat":a.exps&&a.exps.length>0&&r(e,t,b(a.names.map(n=>n.name),a.exps)),r(e,t,u(e,o));return;case"LocalFuncStat":r(e,t,b([a.name],[a.func])),r(e,t,u(e,o));return;case"ReturnStat":r(e,t,a);return;case"BreakStat":r(e,t,u(e,p));return;case"GotoStat":{const n=e.userLabels.get(a.name);if(n===void 0)throw new Error(`goto \u672A\u5B9A\u4E49\u6807\u7B7E ::${a.name}::`);r(e,t,u(e,n));return}case"DoStat":r(e,t,u(e,h(a.body.body,o,e,p)));return;case"IfStat":{const n=S(e);let c=t;for(let l=0;l<a.clauses.length;l+=1){const f=l===a.clauses.length-1,d=h(a.clauses[l].body.body,o,e,p);let i=o;f?a.elseBody&&(i=h(a.elseBody.body,o,e,p)):i=x(e),r(e,c,b([n],[a.clauses[l].cond])),r(e,c,u(e,k(n,d,i))),f||(c=i)}a.clauses.length===0&&r(e,t,u(e,o));return}case"WhileStat":{const n=S(e),c=h(a.body.body,t,e,o);r(e,t,b([n],[a.cond])),r(e,t,u(e,k(n,c,o)));return}case"RepeatStat":{const n=S(e),c=x(e),l=h(a.body.body,c,e,o);r(e,t,u(e,l)),r(e,c,b([n],[a.cond])),r(e,c,u(e,k(n,o,l)));return}case"ForNumStat":{const n=a.name,c=S(e),l=S(e),f=S(e),d=x(e),i=x(e),F=x(e),g=x(e),N=h(a.body.body,g,e,o);r(e,t,b([n],[a.start])),r(e,t,b([c],[a.end])),r(e,t,b([l],[a.step??m(1)])),r(e,t,u(e,d)),r(e,d,b([f],[E(">=",y(l),m(0))])),r(e,d,u(e,k(f,i,F))),r(e,i,b([f],[E("<=",y(n),y(c))])),r(e,i,u(e,k(f,N,o))),r(e,F,b([f],[E(">=",y(n),y(c))])),r(e,F,u(e,k(f,N,o))),r(e,g,b([n],[E("+",y(n),y(l))])),r(e,g,u(e,d));return}case"ForInStat":{const n=S(e),c=S(e),l=S(e),f=S(e),d=x(e),i=[b([l],[y(a.names[0])]),...a.body.body],F=h(i,d,e,o),g=a.exps.slice();for(;g.length<3;)g.push({type:"NilLiteral"});r(e,t,b([n,c,l],g.slice(0,3))),r(e,t,u(e,d)),r(e,d,{type:"AssignStat",vars:a.names.map(N=>y(N)),exps:[{type:"CallExpr",callee:y(n),args:[y(c),y(l)]}]}),r(e,d,b([f],[E("~=",y(a.names[0]),{type:"NilLiteral"})])),r(e,d,u(e,k(f,F,o)));return}default:r(e,t,u(e,o))}}function v(e,t){const a=e.slice();let o=t>>>0||1;for(let p=a.length-1;p>0;p-=1){o=Math.imul(o,1664525)+1013904223>>>0;const n=o%(p+1),c=a[p];a[p]=a[n],a[n]=c}return a}function w(e,t){if(e.length===0)return e;const a={states:new Map,temps:[],nextState:1,nextTemp:1,stateName:"__s",userLabels:new Map},o=[];L(e,o);const p=h(e,0,a,0),n=[...new Set([...o,...a.temps,a.stateName])],c=v([...a.states.keys()],t).map(l=>({cond:E("==",y(a.stateName),m(l)),body:{type:"Block",body:a.states.get(l)}}));return[{type:"LocalStat",names:n.map(l=>({name:l}))},b([a.stateName],[m(p)]),{type:"WhileStat",cond:E("~=",y(a.stateName),m(0)),body:{type:"Block",body:[{type:"IfStat",clauses:c}]}}]}function s(e,t){switch(e.type){case"FuncExpr":B(e.body.body,t),e.body.body=w(e.body.body,t);break;case"UnaryExpr":s(e.arg,t);break;case"BinaryExpr":s(e.left,t),s(e.right,t);break;case"TableExpr":for(const a of e.fields)a.kind==="index"&&s(a.key,t),s(a.value,t);break;case"IndexExpr":s(e.object,t),s(e.index,t);break;case"MemberExpr":s(e.object,t);break;case"CallExpr":s(e.callee,t);for(const a of e.args)s(a,t);break;case"MethodCallExpr":s(e.object,t);for(const a of e.args)s(a,t);break;case"ParenExpr":s(e.exp,t);break;default:break}}function B(e,t){for(const a of e)switch(a.type){case"DoStat":case"WhileStat":case"RepeatStat":case"ForNumStat":case"ForInStat":if((a.type==="WhileStat"||a.type==="RepeatStat")&&s(a.cond,t),a.type==="ForNumStat"&&(s(a.start,t),s(a.end,t),a.step&&s(a.step,t)),a.type==="ForInStat")for(const o of a.exps)s(o,t);B(a.body.body,t);break;case"IfStat":for(const o of a.clauses)s(o.cond,t),B(o.body.body,t);a.elseBody&&B(a.elseBody.body,t);break;case"FuncStat":case"LocalFuncStat":B(a.func.body.body,t),a.func.body.body=w(a.func.body.body,t);break;case"LocalStat":if(a.exps)for(const o of a.exps)s(o,t);break;case"AssignStat":for(const o of a.vars)s(o,t);for(const o of a.exps)s(o,t);break;case"CallStat":s(a.exp,t);break;case"ReturnStat":for(const o of a.exps)s(o,t);break;default:break}}function C(e,t){B(e.body,t),e.body=w(e.body,t)}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.flattenControlFlow=C;function m(e){return{type:"NumberLiteral",raw:String(e),value:e}}function y(e){return{type:"NameExpr",name:e}}function b(e,t){return{type:"AssignStat",vars:e.map(a=>y(a)),exps:t}}function u(e,t){return b([e.stateName],[typeof t=="number"?m(t):t])}function k(e,t,a){return{type:"BinaryExpr",op:"or",left:{type:"BinaryExpr",op:"and",left:y(e),right:m(t)},right:m(a)}}function E(e,t,a){return{type:"BinaryExpr",op:e,left:t,right:a}}function S(e){const t=`__t${e.nextTemp}`;return e.nextTemp+=1,e.temps.push(t),t}function x(e){const t=e.nextState;return e.nextState+=1,e.states.set(t,[]),t}function r(e,t,a){e.states.get(t).push(a)}function L(e,t){for(const a of e)if(a.type==="LocalStat")for(const s of a.names)t.push(s.name);else if(a.type==="LocalFuncStat")t.push(a.name);else if(a.type==="ForNumStat")t.push(a.name),L(a.body.body,t);else if(a.type==="ForInStat")t.push(...a.names),L(a.body.body,t);else if(a.type==="DoStat"||a.type==="WhileStat"||a.type==="RepeatStat")L(a.body.body,t);else if(a.type==="IfStat"){for(const s of a.clauses)L(s.body.body,t);a.elseBody&&L(a.elseBody.body,t)}}function h(e,t,a,s){if(e.length===0)return t;const p=e.map(()=>x(a));for(let o=0;o<e.length;o+=1){const c=e[o];c.type==="LabelStat"&&a.userLabels.set(c.name,p[o])}for(let o=0;o<e.length;o+=1){const c=o+1<e.length?p[o+1]:t;I(a,p[o],e[o],c,s)}return p[0]}function I(e,t,a,s,p){switch(a.type){case"EmptyStat":case"LabelStat":r(e,t,u(e,s));return;case"AssignStat":case"CallStat":case"FuncStat":r(e,t,a),r(e,t,u(e,s));return;case"LocalStat":a.exps&&a.exps.length>0&&r(e,t,b(a.names.map(o=>o.name),a.exps)),r(e,t,u(e,s));return;case"LocalFuncStat":r(e,t,b([a.name],[a.func])),r(e,t,u(e,s));return;case"ReturnStat":r(e,t,a);return;case"BreakStat":r(e,t,u(e,p));return;case"GotoStat":{const o=e.userLabels.get(a.name);if(o===void 0)throw new Error(`goto \u672A\u5B9A\u4E49\u6807\u7B7E ::${a.name}::`);r(e,t,u(e,o));return}case"DoStat":r(e,t,u(e,h(a.body.body,s,e,p)));return;case"IfStat":{const o=S(e);let c=t;for(let l=0;l<a.clauses.length;l+=1){const f=l===a.clauses.length-1,d=h(a.clauses[l].body.body,s,e,p);let i=s;f?a.elseBody&&(i=h(a.elseBody.body,s,e,p)):i=x(e),r(e,c,b([o],[a.clauses[l].cond])),r(e,c,u(e,k(o,d,i))),f||(c=i)}a.clauses.length===0&&r(e,t,u(e,s));return}case"WhileStat":{const o=S(e),c=h(a.body.body,t,e,s);r(e,t,b([o],[a.cond])),r(e,t,u(e,k(o,c,s)));return}case"RepeatStat":{const o=S(e),c=x(e),l=h(a.body.body,c,e,s);r(e,t,u(e,l)),r(e,c,b([o],[a.cond])),r(e,c,u(e,k(o,s,l)));return}case"ForNumStat":{const o=a.name,c=S(e),l=S(e),f=S(e),d=x(e),i=x(e),F=x(e),g=x(e),N=h(a.body.body,g,e,s);r(e,t,b([o],[a.start])),r(e,t,b([c],[a.end])),r(e,t,b([l],[a.step??m(1)])),r(e,t,u(e,d)),r(e,d,b([f],[E(">=",y(l),m(0))])),r(e,d,u(e,k(f,i,F))),r(e,i,b([f],[E("<=",y(o),y(c))])),r(e,i,u(e,k(f,N,s))),r(e,F,b([f],[E(">=",y(o),y(c))])),r(e,F,u(e,k(f,N,s))),r(e,g,b([o],[E("+",y(o),y(l))])),r(e,g,u(e,d));return}case"ForInStat":{const o=S(e),c=S(e),l=S(e),f=S(e),d=x(e),i=[b([l],[y(a.names[0])]),...a.body.body],F=h(i,d,e,s),g=a.exps.slice();for(;g.length<3;)g.push({type:"NilLiteral"});r(e,t,b([o,c,l],g.slice(0,3))),r(e,t,u(e,d)),r(e,d,{type:"AssignStat",vars:a.names.map(N=>y(N)),exps:[{type:"CallExpr",callee:y(o),args:[y(c),y(l)]}]}),r(e,d,b([f],[E("~=",y(a.names[0]),{type:"NilLiteral"})])),r(e,d,u(e,k(f,F,s)));return}default:r(e,t,u(e,s))}}function v(e,t){const a=e.slice();let s=t>>>0||1;for(let p=a.length-1;p>0;p-=1){s=Math.imul(s,1664525)+1013904223>>>0;const o=s%(p+1),c=a[p];a[p]=a[o],a[o]=c}return a}function w(e,t){if(e.length===0)return e;const a={states:new Map,temps:[],nextState:1,nextTemp:1,stateName:"__s",userLabels:new Map},s=[];L(e,s);const p=h(e,0,a,0),o=[...new Set([...s,...a.temps,a.stateName])],c=v([...a.states.keys()],t).map(l=>({cond:E("==",y(a.stateName),m(l)),body:{type:"Block",body:a.states.get(l)}}));return[{type:"LocalStat",names:o.map(l=>({name:l}))},b([a.stateName],[m(p)]),{type:"WhileStat",cond:E("~=",y(a.stateName),m(0)),body:{type:"Block",body:[{type:"IfStat",clauses:c}]}}]}function n(e,t){switch(e.type){case"FuncExpr":B(e.body.body,t),e.body.body=w(e.body.body,t);break;case"UnaryExpr":n(e.arg,t);break;case"BinaryExpr":n(e.left,t),n(e.right,t);break;case"TableExpr":for(const a of e.fields)a.kind==="index"&&n(a.key,t),n(a.value,t);break;case"IndexExpr":n(e.object,t),n(e.index,t);break;case"MemberExpr":n(e.object,t);break;case"CallExpr":n(e.callee,t);for(const a of e.args)n(a,t);break;case"MethodCallExpr":n(e.object,t);for(const a of e.args)n(a,t);break;case"ParenExpr":n(e.exp,t);break;default:break}}function B(e,t){for(const a of e)switch(a.type){case"DoStat":case"WhileStat":case"RepeatStat":case"ForNumStat":case"ForInStat":if((a.type==="WhileStat"||a.type==="RepeatStat")&&n(a.cond,t),a.type==="ForNumStat"&&(n(a.start,t),n(a.end,t),a.step&&n(a.step,t)),a.type==="ForInStat")for(const s of a.exps)n(s,t);B(a.body.body,t);break;case"IfStat":for(const s of a.clauses)n(s.cond,t),B(s.body.body,t);a.elseBody&&B(a.elseBody.body,t);break;case"FuncStat":case"LocalFuncStat":B(a.func.body.body,t),a.func.body.body=w(a.func.body.body,t);break;case"LocalStat":if(a.exps)for(const s of a.exps)n(s,t);break;case"AssignStat":for(const s of a.vars)n(s,t);for(const s of a.exps)n(s,t);break;case"CallStat":n(a.exp,t);break;case"ReturnStat":for(const s of a.exps)n(s,t);break;default:break}}function C(e,t){B(e.body,t),e.body=w(e.body,t)}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.shortName=o,exports.renameLocals=c;const u=require("./reserved"),d=require("./scope"),l="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function o(r){let e=r,t="";do t=l[e%l.length]+t,e=Math.floor(e/l.length)-1;while(e>=0);return u.luaKeywords.has(t)?`_${t}`:t}function c(r){let e=0;const t=new Set;(0,d.collectAndRename)(r,(a,s)=>{if(a.newName!==a.original)return;let n=o(e);for(e+=1;s.has(n)||t.has(n)||u.luaKeywords.has(n);)n=o(e),e+=1;a.newName=n,t.add(n),s.add(n)})}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.shortName=o,exports.renameLocals=c;const u=require("./reserved"),d=require("./scope"),l="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function o(a){let e=a,t="";do t=l[e%l.length]+t,e=Math.floor(e/l.length)-1;while(e>=0);return u.luaKeywords.has(t)?`_${t}`:t}function c(a){let e=0;const t=new Set;(0,d.collectAndRename)(a,(r,s)=>{if(r.newName!==r.original)return;let n=o(e);for(e+=1;s.has(n)||t.has(n)||u.luaKeywords.has(n);)n=o(e),e+=1;r.newName=n,t.add(n),s.add(n)})}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.resolveLocal=i,exports.collectAndRename=x;function i(e,o){let n=e;for(;n;){const a=n.locals.get(o);if(a)return a;n=n.parent}}function s(e){return{parent:e,locals:new Map}}function f(e,o){const n=e.locals.get(o);if(n)return n;const a={original:o,newName:o};return e.locals.set(o,a),a}function x(e,o){const n=new Set,a={locals:new Map};d(e.body,a,n,o)}function u(e,o,n,a){d(e.body,o,n,a)}function d(e,o,n,a){for(const c of e)b(c,o,n,a)}function m(e,o,n,a){const c=s(o),r=e.params.slice();for(let l=0;l<r.length;l+=1){const p=f(c,r[l]);a(p,n),e.params[l]=p.newName}u(e.body,c,n,a)}function b(e,o,n,a){switch(e.type){case"EmptyStat":case"BreakStat":case"GotoStat":case"LabelStat":return;case"DoStat":u(e.body,s(o),n,a);return;case"WhileStat":t(e.cond,o,n,a),u(e.body,s(o),n,a);return;case"RepeatStat":{const c=s(o);u(e.body,c,n,a),t(e.cond,c,n,a);return}case"IfStat":for(const c of e.clauses)t(c.cond,o,n,a),u(c.body,s(o),n,a);e.elseBody&&u(e.elseBody,s(o),n,a);return;case"ForNumStat":{t(e.start,o,n,a),t(e.end,o,n,a),e.step&&t(e.step,o,n,a);const c=s(o),r=f(c,e.name);a(r,n),e.name=r.newName,u(e.body,c,n,a);return}case"ForInStat":{for(const r of e.exps)t(r,o,n,a);const c=s(o);for(let r=0;r<e.names.length;r+=1){const l=f(c,e.names[r]);a(l,n),e.names[r]=l.newName}u(e.body,c,n,a);return}case"FuncStat":{const c=i(o,e.name.base);c&&(e.name.base=c.newName),m(e.func,o,n,a);return}case"LocalFuncStat":{const c=f(o,e.name);a(c,n),e.name=c.newName,m(e.func,o,n,a);return}case"LocalStat":if(e.exps)for(const c of e.exps)t(c,o,n,a);for(let c=0;c<e.names.length;c+=1){const r=f(o,e.names[c].name);a(r,n),e.names[c].name=r.newName}return;case"AssignStat":for(const c of e.vars)t(c,o,n,a);for(const c of e.exps)t(c,o,n,a);return;case"CallStat":t(e.exp,o,n,a);return;case"ReturnStat":for(const c of e.exps)t(c,o,n,a);return}}function t(e,o,n,a){switch(e.type){case"NilLiteral":case"BoolLiteral":case"NumberLiteral":case"StringLiteral":case"VarargExpr":return;case"NameExpr":{const c=i(o,e.name);c&&(e.name=c.newName);return}case"UnaryExpr":t(e.arg,o,n,a);return;case"BinaryExpr":t(e.left,o,n,a),t(e.right,o,n,a);return;case"FuncExpr":m(e,o,n,a);return;case"TableExpr":for(const c of e.fields)c.kind==="index"&&t(c.key,o,n,a),t(c.value,o,n,a);return;case"IndexExpr":t(e.object,o,n,a),t(e.index,o,n,a);return;case"MemberExpr":t(e.object,o,n,a);return;case"CallExpr":t(e.callee,o,n,a);for(const c of e.args)t(c,o,n,a);return;case"MethodCallExpr":t(e.object,o,n,a);for(const c of e.args)t(c,o,n,a);return;case"ParenExpr":t(e.exp,o,n,a);return}}
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.resolveLocal=i,exports.collectAndRename=x;function i(e,s){let n=e;for(;n;){const a=n.locals.get(s);if(a)return a;n=n.parent}}function c(e){return{parent:e,locals:new Map}}function f(e,s){const n=e.locals.get(s);if(n)return n;const a={original:s,newName:s};return e.locals.set(s,a),a}function x(e,s){const n=new Set,a={locals:new Map};d(e.body,a,n,s)}function u(e,s,n,a){d(e.body,s,n,a)}function d(e,s,n,a){for(const o of e)b(o,s,n,a)}function m(e,s,n,a){const o=c(s),r=e.params.slice();for(let l=0;l<r.length;l+=1){const p=f(o,r[l]);a(p,n),e.params[l]=p.newName}u(e.body,o,n,a)}function b(e,s,n,a){switch(e.type){case"EmptyStat":case"BreakStat":case"GotoStat":case"LabelStat":return;case"DoStat":u(e.body,c(s),n,a);return;case"WhileStat":t(e.cond,s,n,a),u(e.body,c(s),n,a);return;case"RepeatStat":{const o=c(s);u(e.body,o,n,a),t(e.cond,o,n,a);return}case"IfStat":for(const o of e.clauses)t(o.cond,s,n,a),u(o.body,c(s),n,a);e.elseBody&&u(e.elseBody,c(s),n,a);return;case"ForNumStat":{t(e.start,s,n,a),t(e.end,s,n,a),e.step&&t(e.step,s,n,a);const o=c(s),r=f(o,e.name);a(r,n),e.name=r.newName,u(e.body,o,n,a);return}case"ForInStat":{for(const r of e.exps)t(r,s,n,a);const o=c(s);for(let r=0;r<e.names.length;r+=1){const l=f(o,e.names[r]);a(l,n),e.names[r]=l.newName}u(e.body,o,n,a);return}case"FuncStat":{const o=i(s,e.name.base);o&&(e.name.base=o.newName),m(e.func,s,n,a);return}case"LocalFuncStat":{const o=f(s,e.name);a(o,n),e.name=o.newName,m(e.func,s,n,a);return}case"LocalStat":if(e.exps)for(const o of e.exps)t(o,s,n,a);for(let o=0;o<e.names.length;o+=1){const r=f(s,e.names[o].name);a(r,n),e.names[o].name=r.newName}return;case"AssignStat":for(const o of e.vars)t(o,s,n,a);for(const o of e.exps)t(o,s,n,a);return;case"CallStat":t(e.exp,s,n,a);return;case"ReturnStat":for(const o of e.exps)t(o,s,n,a);return}}function t(e,s,n,a){switch(e.type){case"NilLiteral":case"BoolLiteral":case"NumberLiteral":case"StringLiteral":case"VarargExpr":return;case"NameExpr":{const o=i(s,e.name);o&&(e.name=o.newName);return}case"UnaryExpr":t(e.arg,s,n,a);return;case"BinaryExpr":t(e.left,s,n,a),t(e.right,s,n,a);return;case"FuncExpr":m(e,s,n,a);return;case"TableExpr":for(const o of e.fields)o.kind==="index"&&t(o.key,s,n,a),t(o.value,s,n,a);return;case"IndexExpr":t(e.object,s,n,a),t(e.index,s,n,a);return;case"MemberExpr":t(e.object,s,n,a);return;case"CallExpr":t(e.callee,s,n,a);for(const o of e.args)t(o,s,n,a);return;case"MethodCallExpr":t(e.object,s,n,a);for(const o of e.args)t(o,s,n,a);return;case"ParenExpr":t(e.exp,s,n,a);return}}
@@ -1,4 +1,4 @@
1
- "use strict";var I=exports&&exports.__createBinding||(Object.create?(function(t,e,r,s){s===void 0&&(s=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,s,i)}):(function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]})),_=exports&&exports.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),E=exports&&exports.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var s=[];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(s[s.length]=i);return s},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var s=t(e),i=0;i<s.length;i++)s[i]!=="default"&&I(r,e,s[i]);return _(r,e),r}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.protectScript=k,exports.createScriptProtectPlugin=F,exports.createKjstEmbedPlugin=R,exports.createScriptProtectHelpers=C;const A=E(require("acorn")),h=E(require("crypto")),w=require("magic-string"),x="KJST",T=1,v="/*KJST",D="*/",U=`-----BEGIN PUBLIC KEY-----
1
+ "use strict";var w=exports&&exports.__createBinding||(Object.create?(function(t,e,n,a){a===void 0&&(a=n);var i=Object.getOwnPropertyDescriptor(e,n);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,a,i)}):(function(t,e,n,a){a===void 0&&(a=n),t[a]=e[n]})),k=exports&&exports.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),C=exports&&exports.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(n){var a=[];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(a[a.length]=i);return a},t(e)};return function(e){if(e&&e.__esModule)return e;var n={};if(e!=null)for(var a=t(e),i=0;i<a.length;i++)a[i]!=="default"&&w(n,e,a[i]);return k(n,e),n}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.protectScript=F,exports.createScriptProtectPlugin=Y,exports.createKjstEmbedPlugin=Q,exports.createScriptProtectHelpers=_;const E=C(require("acorn")),p=C(require("crypto")),T=require("magic-string"),D=Buffer.from([126,145,60,165]),M=2,U="x",N=Buffer.from([165,60,145,126]),L=`-----BEGIN PUBLIC KEY-----
2
2
  MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArzeAhUUEi4p0AxLYIVJK
3
3
  UcXyySzlh8G4TfH/quDXiKVlYlho9v2R1cQKQgFpVuDW8SDyc2iWUTNa8D/NX9LN
4
4
  IqcgQP0lyTxuFvevfGOlPt6NDl0nYNqaToK5AvN/F7AcchU9JrNSB4BNEeFRechm
@@ -6,5 +6,4 @@ GL9m5iUY0HCbiOIcbo+rx1GQaqTYCUuZIJttuARYCq0ggoOHjBqMHUKWwdNtJVoe
6
6
  PrdRaKzL3CB2gXazQzKUVrlK2vEDEaTvSLJoCym7SkSf/XmxjfEADlcwrqTb01ar
7
7
  U8mm9/g5R9q43B8NqlTpGOcs1OpAY5DZW1DDjXhyHBfrPCt82hhmeO/yI0N8vE2m
8
8
  MwIDAQAB
9
- -----END PUBLIC KEY-----`,O=new Set(["action","$\u52A8\u4F5C","appleOcr","$\u82F9\u679COCR","cloud","$\u4E91\u63A7","config","$\u914D\u7F6E","cryptoUtils","cv","device","$\u8BBE\u5907","dotOcr","$\u70B9\u9635OCR","file","$\u6587\u4EF6","hid","$HID","hotUpdate","$\u70ED\u66F4\u65B0","http","$HTTP","image","$\u56FE\u7247","ime","$\u8F93\u5165\u6CD5","logger","$\u65E5\u5FD7","media","$\u5A92\u4F53","mysql","$MySQL\u6570\u636E\u5E93","netCard","$\u5361\u5BC6","paddleOcr","$PaddleOCR","pip","$\u60AC\u6D6E\u7A97","sharedState","$\u5171\u4EAB\u72B6\u6001","system","$\u7CFB\u7EDF","thread","$\u7EBF\u7A0B","tomatoOcr","tts","$\u6587\u5B57\u8F6C\u8BED\u97F3","ui","$\u89C6\u56FE","utils","$\u5DE5\u5177","yolo","$YOLO","yoloCls","$YOLO\u5206\u7C7B"]),M=new Set(["createNodeSelector","$\u521B\u5EFA\u8282\u70B9\u9009\u62E9\u5668","exit","$\u9000\u51FA\u811A\u672C","getAgentFastMode","$\u83B7\u53D6Agent\u5FEB\u901F\u6A21\u5F0F","getAgentTouchMode","$\u83B7\u53D6Agent\u89E6\u63A7\u6A21\u5F0F","getContext","$\u83B7\u53D6\u4E0A\u4E0B\u6587","getCpuAutoThrottle","$\u83B7\u53D6CPU\u81EA\u52A8\u9650\u6D41","getCpuThrottleDelay","$\u83B7\u53D6CPU\u9650\u6D41\u5EF6\u8FDF","importClass","$\u5BFC\u5165\u7C7B","loadDex","$\u52A0\u8F7DDex","logd","$\u6253\u5370\u8C03\u8BD5\u65E5\u5FD7","loge","$\u6253\u5370\u9519\u8BEF\u65E5\u5FD7","logi","$\u6253\u5370\u4FE1\u606F\u65E5\u5FD7","logw","$\u6253\u5370\u8B66\u544A\u65E5\u5FD7","println","$\u6253\u5370","restartScript","$\u91CD\u542F\u811A\u672C","setAgentFastMode","$\u8BBE\u7F6EAgent\u5FEB\u901F\u6A21\u5F0F","setAgentTouchMode","$\u8BBE\u7F6EAgent\u89E6\u63A7\u6A21\u5F0F","setCpuAutoThrottle","$\u8BBE\u7F6ECPU\u81EA\u52A8\u9650\u6D41","setCpuThrottleDelay","$\u8BBE\u7F6ECPU\u9650\u6D41\u5EF6\u8FDF","setExceptionCallback","$\u8BBE\u7F6E\u5F02\u5E38\u505C\u6B62\u56DE\u8C03","setStopCallback","$\u8BBE\u7F6E\u505C\u6B62\u56DE\u8C03","sleep","$\u5EF6\u65F6","takeMeToFront","$APP\u5207\u5165\u524D\u53F0","time","$\u83B7\u53D6\u5F53\u524D\u65F6\u95F4\u6233"]);function m(t){for(;;){const e=`_0x${h.randomBytes(3).toString("hex")}`;if(!t.has(e))return t.add(e),e}}function y(t,e){const r=t.indexOf(e);return r>=0?r:(t.push(e),t.length-1)}function S(t,e){for(let r=e.length-1;r>=0;r-=1)if(e[r].has(t))return!0;return!1}function p(t,e){if(!(!t||typeof t!="object")){if(t.type==="Identifier"){e.add(t.name);return}if(t.type==="AssignmentPattern"){p(t.left,e);return}if(t.type==="RestElement"){p(t.argument,e);return}if(t.type==="ArrayPattern"){for(const r of t.elements||[])p(r,e);return}if(t.type==="ObjectPattern")for(const r of t.properties||[])r.type==="RestElement"?p(r.argument,e):p(r.value,e)}}function N(t){try{return A.parse(t,{allowHashBang:!0,ecmaVersion:"latest",sourceType:"script"})}catch{return A.parse(t,{allowHashBang:!0,ecmaVersion:"latest",sourceType:"module"})}}function P(t,e,r,s){if(!t||typeof t!="object"||typeof t.type!="string")return;let i=0;if(t.type==="FunctionDeclaration"||t.type==="FunctionExpression"||t.type==="ArrowFunctionExpression"){const c=new Set;t.id&&t.id.type==="Identifier"&&c.add(t.id.name);for(const a of t.params||[])p(a,c);r.push(c),i+=1}if(t.type==="CatchClause"&&t.param){const c=new Set;p(t.param,c),r.push(c),i+=1}if(t.type==="VariableDeclaration"){const c=r[r.length-1];for(const a of t.declarations||[])p(a.id,c)}s(t,e,r);for(const c of Object.keys(t)){if(c==="parent"||c==="start"||c==="end"||c==="loc"||c==="range"||c==="raw")continue;const a=t[c];if(Array.isArray(a))for(const u of a)P(u,t,r,s);else a&&typeof a=="object"&&P(a,t,r,s)}for(;i>0;)r.pop(),i-=1}function K(t,e){return!(!e||t.value!=="use strict"||e.type!=="ExpressionStatement")}function B(t){if(!(!t||t.type!=="MemberExpression")){if(t.computed)return t.property?.type==="Literal"&&typeof t.property.value=="string"?t.property.value:void 0;if(t.property?.type==="Identifier")return t.property.name}}function L(t){const e=Buffer.from(JSON.stringify(t),"utf8"),r=h.randomBytes(32),s=h.randomBytes(16),i=h.createCipheriv("aes-256-cbc",r,s),c=Buffer.concat([i.update(e),i.final()]),a=h.publicEncrypt({key:U,padding:h.constants.RSA_PKCS1_PADDING},r),u=Buffer.alloc(7);u.write(x,0,4,"ascii"),u.writeUInt8(T,4),u.writeUInt16BE(a.length,5);const n=Buffer.alloc(4);return n.writeUInt32BE(c.length,0),Buffer.concat([u,a,s,n,c])}function k(t){const e=C();return b(t,e[0],e[1],e[2])}function F(t){const e=new Set(t),r=t[0],s=t[1],i=t[2];if(!r||!s||!i||e.size!==3)throw new Error("script protect helper names \u65E0\u6548");return{name:"kuaijs-script-protect",apply:"build",enforce:"post",renderChunk(c,a){const u=b(c,r,s,i);return this.emitFile({type:"asset",fileName:a.fileName.replace(/\.js$/i,".kjst"),source:u.table}),{code:u.code,map:null}}}}function R(){return{name:"kuaijs-kjst-embed",apply:"build",enforce:"post",generateBundle(t,e){for(const[r,s]of Object.entries(e)){if(s.type!=="asset"||!/\.kjst$/i.test(r))continue;const i=r.replace(/\.kjst$/i,".js"),c=e[i];if(!c||c.type!=="chunk")continue;const a=s.source,u=typeof a=="string"?Buffer.from(a,"binary"):Buffer.from(a);c.code=`${c.code}
10
- ${v}${u.toString("base64")}${D}`,delete e[r]}}}}function C(){const t=new Set;return[m(t),m(t),m(t)]}function b(t,e,r,s){const i=[""],c=[],a=N(t);P(a,null,[new Set],(n,l,d)=>{if(n.type==="CallExpression"){const o=n.callee;if(o?.type==="Identifier"){if(M.has(o.name)&&!S(o.name,d)){const f=y(i,o.name);c.push({start:o.start,end:o.end,text:`${r}(0,${f})`})}return}if(o?.type==="MemberExpression"&&o.object?.type==="Identifier"){const f=o.object.name,$=B(o);if($&&O.has(f)&&!S(f,d)){const g=y(i,f),j=y(i,$);c.push({start:o.start,end:o.end,text:`${r}(${g},${j})`})}}return}if(n.type==="MemberExpression"){if(l?.type==="CallExpression"&&l.callee===n||l?.type==="AssignmentExpression"&&l.left===n||n.object?.type!=="Identifier")return;const o=n.object.name,f=B(n);if(f&&O.has(o)&&!S(o,d)){const $=y(i,o),g=y(i,f);c.push({start:n.start,end:n.end,text:`${s}(${$},${g})`})}return}if(n.type==="Literal"&&typeof n.value=="string"){if(K(n,l)||l?.type==="Property"&&l.key===n)return;const o=y(i,n.value);c.push({start:n.start,end:n.end,text:`${e}(${o})`});return}if(n.type==="Property"&&!n.method&&!n.computed&&n.key?.type==="Identifier"&&n.key.name!=="__proto__"){const o=y(i,n.key.name),f=`[${e}(${o})]`;n.shorthand?c.push({start:n.start,end:n.end,text:`${f}:${n.key.name}`}):c.push({start:n.key.start,end:n.key.end,text:f})}}),c.sort((n,l)=>l.start-n.start);const u=new w(t);for(const n of c)n.start===n.end?u.appendLeft(n.start,n.text):u.overwrite(n.start,n.end,n.text);return{code:u.toString(),table:L({s:e,n:r,p:s,v:i}),reservedNames:[e,r,s]}}
9
+ -----END PUBLIC KEY-----`,S=new Set(["action","$\u52A8\u4F5C","appleOcr","$\u82F9\u679COCR","cloud","$\u4E91\u63A7","config","$\u914D\u7F6E","cryptoUtils","cv","device","$\u8BBE\u5907","dotOcr","$\u70B9\u9635OCR","file","$\u6587\u4EF6","hid","$HID","hidKey","$HID\u6309\u952E","hotUpdate","$\u70ED\u66F4\u65B0","http","$HTTP","image","$\u56FE\u7247","ime","$\u8F93\u5165\u6CD5","logger","$\u65E5\u5FD7","media","$\u5A92\u4F53","mysql","$MySQL\u6570\u636E\u5E93","netCard","$\u5361\u5BC6","paddleOcr","$PaddleOCR","pip","$\u60AC\u6D6E\u7A97","sharedState","$\u5171\u4EAB\u72B6\u6001","system","$\u7CFB\u7EDF","thread","$\u7EBF\u7A0B","tomatoOcr","tts","$\u6587\u5B57\u8F6C\u8BED\u97F3","ui","$\u89C6\u56FE","utils","$\u5DE5\u5177","yolo","$YOLO","yoloCls","$YOLO\u5206\u7C7B"]),I=new Set(["createNodeSelector","$\u521B\u5EFA\u8282\u70B9\u9009\u62E9\u5668","exit","$\u9000\u51FA\u811A\u672C","getAgentFastMode","$\u83B7\u53D6Agent\u5FEB\u901F\u6A21\u5F0F","getAgentTouchMode","$\u83B7\u53D6Agent\u89E6\u63A7\u6A21\u5F0F","getContext","$\u83B7\u53D6\u4E0A\u4E0B\u6587","getCpuAutoThrottle","$\u83B7\u53D6CPU\u81EA\u52A8\u9650\u6D41","getCpuThrottleDelay","$\u83B7\u53D6CPU\u9650\u6D41\u5EF6\u8FDF","importClass","$\u5BFC\u5165\u7C7B","loadDex","$\u52A0\u8F7DDex","logd","$\u6253\u5370\u8C03\u8BD5\u65E5\u5FD7","loge","$\u6253\u5370\u9519\u8BEF\u65E5\u5FD7","logi","$\u6253\u5370\u4FE1\u606F\u65E5\u5FD7","logw","$\u6253\u5370\u8B66\u544A\u65E5\u5FD7","println","$\u6253\u5370","restartScript","$\u91CD\u542F\u811A\u672C","setAgentFastMode","$\u8BBE\u7F6EAgent\u5FEB\u901F\u6A21\u5F0F","setAgentTouchMode","$\u8BBE\u7F6EAgent\u89E6\u63A7\u6A21\u5F0F","setCpuAutoThrottle","$\u8BBE\u7F6ECPU\u81EA\u52A8\u9650\u6D41","setCpuThrottleDelay","$\u8BBE\u7F6ECPU\u9650\u6D41\u5EF6\u8FDF","setExceptionCallback","$\u8BBE\u7F6E\u5F02\u5E38\u505C\u6B62\u56DE\u8C03","setStopCallback","$\u8BBE\u7F6E\u505C\u6B62\u56DE\u8C03","sleep","$\u5EF6\u65F6","takeMeToFront","$APP\u5207\u5165\u524D\u53F0","time","$\u83B7\u53D6\u5F53\u524D\u65F6\u95F4\u6233"]);function b(t){for(;;){const e=`_0x${p.randomBytes(3).toString("hex")}`;if(!t.has(e))return t.add(e),e}}function g(t,e){const n=t.indexOf(e);return n>=0?n:(t.push(e),t.length-1)}function A(t,e){for(let n=e.length-1;n>=0;n-=1)if(e[n].has(t))return!0;return!1}function h(t,e){if(!(!t||typeof t!="object")){if(t.type==="Identifier"){e.add(t.name);return}if(t.type==="AssignmentPattern"){h(t.left,e);return}if(t.type==="RestElement"){h(t.argument,e);return}if(t.type==="ArrayPattern"){for(const n of t.elements||[])h(n,e);return}if(t.type==="ObjectPattern")for(const n of t.properties||[])n.type==="RestElement"?h(n.argument,e):h(n.value,e)}}function K(t){try{return E.parse(t,{allowHashBang:!0,ecmaVersion:"latest",sourceType:"script"})}catch{return E.parse(t,{allowHashBang:!0,ecmaVersion:"latest",sourceType:"module"})}}function O(t,e,n,a){if(!t||typeof t!="object"||typeof t.type!="string")return;let i=0;if(t.type==="FunctionDeclaration"||t.type==="FunctionExpression"||t.type==="ArrowFunctionExpression"){const o=new Set;t.id&&t.id.type==="Identifier"&&o.add(t.id.name);for(const u of t.params||[])h(u,o);n.push(o),i+=1}if(t.type==="CatchClause"&&t.param){const o=new Set;h(t.param,o),n.push(o),i+=1}if(t.type==="VariableDeclaration"){const o=n[n.length-1];for(const u of t.declarations||[])h(u.id,o)}a(t,e,n);for(const o of Object.keys(t)){if(o==="parent"||o==="start"||o==="end"||o==="loc"||o==="range"||o==="raw")continue;const u=t[o];if(Array.isArray(u))for(const s of u)O(s,t,n,a);else u&&typeof u=="object"&&O(u,t,n,a)}for(;i>0;)n.pop(),i-=1}function H(t,e){return!(!e||t.value!=="use strict"||e.type!=="ExpressionStatement")}function j(t){if(!(!t||t.type!=="MemberExpression")){if(t.computed)return t.property?.type==="Literal"&&typeof t.property.value=="string"?t.property.value:void 0;if(t.property?.type==="Identifier")return t.property.name}}function d(t,e){return t^e}function x(t){for(let e=t.length-1;e>0;e-=1){const n=p.randomInt(e+1),a=t[e];t[e]=t[n],t[n]=a}}function R(t){const e=[...S,...I].filter(c=>!t.includes(c));x(e);const n=Math.min(e.length,6+p.randomInt(7)),a=2+p.randomInt(4),i=[];for(let c=0;c<t.length;c+=1)i.push({intern:c,value:t[c]});for(let c=0;c<n;c+=1)i.push({intern:null,value:e[c]});for(let c=0;c<a;c+=1)i.push({intern:null,value:""});x(i);const o=i.map(c=>c.value),u=new Array(t.length).fill(-1),s=[];for(let c=0;c<i.length;c+=1){const y=i[c];y.intern!==null&&(u[y.intern]=c),y.value===""&&s.push(c)}return{values:o,slotOf:u,globalSlots:s}}function q(t){return t.length===0?0:t[p.randomInt(t.length)]}function G(t){const e=Buffer.from(JSON.stringify(t),"utf8"),n=p.randomBytes(32),a=p.randomBytes(16),i=p.createCipheriv("aes-256-cbc",n,a),o=Buffer.concat([i.update(e),i.final()]),u=p.publicEncrypt({key:L,padding:p.constants.RSA_PKCS1_PADDING},n),s=Buffer.alloc(7);D.copy(s,0),s.writeUInt8(M,4),s.writeUInt16BE(u.length,5);const c=Buffer.alloc(4);return c.writeUInt32BE(o.length,0),Buffer.concat([s,u,a,c,o])}function F(t){const e=_();return v(t,e[0],e[1],e[2])}function Y(t){const e=new Set(t),n=t[0],a=t[1],i=t[2];if(!n||!a||!i||e.size!==3)throw new Error("script protect helper names \u65E0\u6548");return{name:"kuaijs-script-protect",apply:"build",renderChunk:{order:"pre",handler(o,u){const s=v(o,n,a,i);return this.emitFile({type:"asset",fileName:u.fileName.replace(/\.js$/i,".kjst"),source:s.table}),{code:s.code,map:null}}}}}function Q(){return{name:"kuaijs-kjst-embed",apply:"build",enforce:"post",generateBundle(t,e){for(const[n,a]of Object.entries(e)){if(a.type!=="asset"||!/\.kjst$/i.test(n))continue;const i=n.replace(/\.kjst$/i,".js"),o=e[i];if(!o||o.type!=="chunk")continue;const u=a.source,s=typeof u=="string"?Buffer.from(u,"binary"):Buffer.from(u),c=Buffer.from(o.code,"utf8"),y=Buffer.alloc(4);y.writeUInt32BE(s.length,0);const B=Buffer.concat([c,s,y,N]);delete e[n],delete e[i],this.emitFile({type:"asset",fileName:i,source:B})}}}}function _(){const t=new Set;return[b(t),b(t),b(t)]}function v(t,e,n,a){const i=[""],o=[],u=K(t);let s=p.randomBytes(2).readUInt16BE(0);s===0&&(s=1),O(u,null,[new Set],(r,l,$)=>{if(r.type==="CallExpression"){const f=r.callee;if(f?.type==="Identifier"){I.has(f.name)&&!A(f.name,$)&&o.push({start:f.start,end:f.end,kind:"nGlobal",a:g(i,f.name)});return}if(f?.type==="MemberExpression"&&f.object?.type==="Identifier"){const m=f.object.name,P=j(f);P&&S.has(m)&&!A(m,$)&&o.push({start:f.start,end:f.end,kind:"nMember",a:g(i,m),b:g(i,P)})}return}if(r.type==="MemberExpression"){if(l?.type==="CallExpression"&&l.callee===r||l?.type==="AssignmentExpression"&&l.left===r||r.object?.type!=="Identifier")return;const f=r.object.name,m=j(r);m&&S.has(f)&&!A(f,$)&&o.push({start:r.start,end:r.end,kind:"p",a:g(i,f),b:g(i,m)});return}if(r.type==="Literal"&&typeof r.value=="string"){if(H(r,l)||l?.type==="Property"&&l.key===r)return;o.push({start:r.start,end:r.end,kind:"s",a:g(i,r.value)});return}r.type==="Property"&&!r.method&&!r.computed&&r.key?.type==="Identifier"&&r.key.name!=="__proto__"&&o.push({start:r.shorthand?r.start:r.key.start,end:r.shorthand?r.end:r.key.end,kind:r.shorthand?"keyShort":"key",a:g(i,r.key.name),ident:r.key.name})});const c=R(i),y=o.map(r=>{const l=c.slotOf[r.a],$=r.b===void 0?0:c.slotOf[r.b];return r.kind==="nGlobal"?{start:r.start,end:r.end,text:`${n}(${d(q(c.globalSlots),s)},${d(l,s)})`}:r.kind==="nMember"?{start:r.start,end:r.end,text:`${n}(${d(l,s)},${d($,s)})`}:r.kind==="p"?{start:r.start,end:r.end,text:`${a}(${d(l,s)},${d($,s)})`}:r.kind==="keyShort"?{start:r.start,end:r.end,text:`[${e}(${d(l,s)})]:${r.ident??""}`}:{start:r.start,end:r.end,text:r.kind==="key"?`[${e}(${d(l,s)})]`:`${e}(${d(l,s)})`}});y.sort((r,l)=>l.start-r.start);const B=new T(t);for(const r of y)r.start===r.end?B.appendLeft(r.start,r.text):B.overwrite(r.start,r.end,r.text);return{code:B.toString(),table:G({s:e,n,p:a,v:c.values,[U]:s}),reservedNames:[e,n,a]}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ms-vite-plugin",
3
- "version": "1.4.67",
3
+ "version": "1.4.69",
4
4
  "type": "commonjs",
5
5
  "license": "MIT",
6
6
  "publishConfig": {