@weapp-vite/miniprogram-automator 1.5.6-dev.20261119.1 → 1.5.6-dev.20261121.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.mjs
CHANGED
|
@@ -1402,7 +1402,7 @@ var Connection = class Connection extends EventEmitter {
|
|
|
1402
1402
|
};
|
|
1403
1403
|
// src/headless.ts
|
|
1404
1404
|
async function launchHeadlessAutomator(options) {
|
|
1405
|
-
return await (await import("./launch-
|
|
1405
|
+
return await (await import("./launch-DT7hs3Jv.mjs")).launch({ projectPath: options.projectPath });
|
|
1406
1406
|
}
|
|
1407
1407
|
// src/launcher/diagnostics.ts
|
|
1408
1408
|
/** 将本次 CLI 的有界输出附到原始错误,避免泄露登录票据及账号参数。 */
|
|
@@ -1658,7 +1658,7 @@ function spawnWechatCli(cliPath, args, cwd, scope) {
|
|
|
1658
1658
|
return Object.assign(state, { release });
|
|
1659
1659
|
}
|
|
1660
1660
|
// package.json
|
|
1661
|
-
var version = "1.5.6-dev.
|
|
1661
|
+
var version = "1.5.6-dev.20261121.1";
|
|
1662
1662
|
// src/appServiceHeap.ts
|
|
1663
1663
|
function isRecord$1(value) {
|
|
1664
1664
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
@@ -13634,19 +13634,19 @@ function isValidAmbientConstInitializer(expression, estree) {
|
|
|
13634
13634
|
if (typeof value === "string" || typeof value === "boolean") return true;
|
|
13635
13635
|
}
|
|
13636
13636
|
} else if (type === "StringLiteral" || type === "BooleanLiteral") return true;
|
|
13637
|
-
if (isNumber$
|
|
13637
|
+
if (isNumber$2(expression, estree) || isNegativeNumber(expression, estree)) return true;
|
|
13638
13638
|
if (type === "TemplateLiteral" && expression.expressions.length === 0) return true;
|
|
13639
13639
|
if (isPossiblyLiteralEnum(expression)) return true;
|
|
13640
13640
|
return false;
|
|
13641
13641
|
}
|
|
13642
|
-
function isNumber$
|
|
13642
|
+
function isNumber$2(expression, estree) {
|
|
13643
13643
|
if (estree) return expression.type === "Literal" && (typeof expression.value === "number" || "bigint" in expression);
|
|
13644
13644
|
return expression.type === "NumericLiteral" || expression.type === "BigIntLiteral";
|
|
13645
13645
|
}
|
|
13646
13646
|
function isNegativeNumber(expression, estree) {
|
|
13647
13647
|
if (expression.type === "UnaryExpression") {
|
|
13648
13648
|
const { operator, argument } = expression;
|
|
13649
|
-
if (operator === "-" && isNumber$
|
|
13649
|
+
if (operator === "-" && isNumber$2(argument, estree)) return true;
|
|
13650
13650
|
}
|
|
13651
13651
|
return false;
|
|
13652
13652
|
}
|
|
@@ -14029,6 +14029,44 @@ function resolveWxmlStringLiteral(node) {
|
|
|
14029
14029
|
}
|
|
14030
14030
|
// ../../node_modules/.pnpm/entities@9.0.0/node_modules/entities/dist/decode-codepoint.js
|
|
14031
14031
|
/**
|
|
14032
|
+
* C1 Unicode control character reference replacements (code points 128-159).
|
|
14033
|
+
* Index i gives the replacement for code point 128+i; 0 means "no replacement".
|
|
14034
|
+
*/
|
|
14035
|
+
const c1$1 = [
|
|
14036
|
+
8364,
|
|
14037
|
+
0,
|
|
14038
|
+
8218,
|
|
14039
|
+
402,
|
|
14040
|
+
8222,
|
|
14041
|
+
8230,
|
|
14042
|
+
8224,
|
|
14043
|
+
8225,
|
|
14044
|
+
710,
|
|
14045
|
+
8240,
|
|
14046
|
+
352,
|
|
14047
|
+
8249,
|
|
14048
|
+
338,
|
|
14049
|
+
0,
|
|
14050
|
+
381,
|
|
14051
|
+
0,
|
|
14052
|
+
0,
|
|
14053
|
+
8216,
|
|
14054
|
+
8217,
|
|
14055
|
+
8220,
|
|
14056
|
+
8221,
|
|
14057
|
+
8226,
|
|
14058
|
+
8211,
|
|
14059
|
+
8212,
|
|
14060
|
+
732,
|
|
14061
|
+
8482,
|
|
14062
|
+
353,
|
|
14063
|
+
8250,
|
|
14064
|
+
339,
|
|
14065
|
+
0,
|
|
14066
|
+
382,
|
|
14067
|
+
376
|
|
14068
|
+
];
|
|
14069
|
+
/**
|
|
14032
14070
|
* True for NUL, UTF-16 surrogates, and values past U+10FFFF.
|
|
14033
14071
|
* @param codePoint Unicode code point to check.
|
|
14034
14072
|
*/
|
|
@@ -14036,6 +14074,18 @@ function isInvalidCodePoint$1(codePoint) {
|
|
|
14036
14074
|
return codePoint === 0 || codePoint >= 55296 && codePoint <= 57343 || codePoint > 1114111;
|
|
14037
14075
|
}
|
|
14038
14076
|
/**
|
|
14077
|
+
* Replace the given code point with U+FFFD if it is NUL (0), a surrogate, or
|
|
14078
|
+
* outside the valid Unicode range. Code points in the C1 controls range
|
|
14079
|
+
* (128-159) are remapped to their Windows-1252 equivalents, following the
|
|
14080
|
+
* HTML spec. All other code points are returned unchanged.
|
|
14081
|
+
* @param codePoint Unicode code point to convert.
|
|
14082
|
+
*/
|
|
14083
|
+
function replaceCodePoint$1(codePoint) {
|
|
14084
|
+
if (isInvalidCodePoint$1(codePoint)) return 65533;
|
|
14085
|
+
if (codePoint >= 128 && codePoint <= 159) return c1$1[codePoint - 128] || codePoint;
|
|
14086
|
+
return codePoint;
|
|
14087
|
+
}
|
|
14088
|
+
/**
|
|
14039
14089
|
* XML numeric character references are the referenced Unicode code point.
|
|
14040
14090
|
* Invalid values still become U+FFFD; the HTML Windows-1252 C1 remap is not
|
|
14041
14091
|
* applied.
|
|
@@ -14045,10 +14095,147 @@ function isInvalidCodePoint$1(codePoint) {
|
|
|
14045
14095
|
function replaceCodePointXML$1(codePoint) {
|
|
14046
14096
|
return isInvalidCodePoint$1(codePoint) ? 65533 : codePoint;
|
|
14047
14097
|
}
|
|
14098
|
+
/**
|
|
14099
|
+
* Convert the code point of a decoded numeric entity to a string, replacing
|
|
14100
|
+
* invalid values.
|
|
14101
|
+
*
|
|
14102
|
+
* Fast path for plain BMP code points: [1..0x7F] and [0xA0..0xD7FF] pass
|
|
14103
|
+
* `replaceCodePoint` unchanged (no NUL, C1 remap, surrogate, or out-of-range
|
|
14104
|
+
* handling) and fit a single charCode. 0xd760 = 0xD800 (the first surrogate)
|
|
14105
|
+
* - 0xA0.
|
|
14106
|
+
* @param codePoint Unicode code point to convert.
|
|
14107
|
+
*/
|
|
14108
|
+
function codePointToString(codePoint) {
|
|
14109
|
+
return codePoint - 1 >>> 0 < 127 || codePoint - 160 >>> 0 < 55136 ? String.fromCharCode(codePoint) : String.fromCodePoint(replaceCodePoint$1(codePoint));
|
|
14110
|
+
}
|
|
14111
|
+
// ../../node_modules/.pnpm/entities@9.0.0/node_modules/entities/dist/generated/decode-data-html.js
|
|
14112
|
+
/**
|
|
14113
|
+
* Serialized decode data; the format is documented in
|
|
14114
|
+
* `src/internal/decode-data-format.ts`. `[0]` is one-byte data (all char
|
|
14115
|
+
* codes <= 0xFF: header, front-coded name suffixes, per-name metadata,
|
|
14116
|
+
* cuckoo choice bits); `[1]` holds the replacement values.
|
|
14117
|
+
*/
|
|
14118
|
+
const htmlDecodeData = ["Q=¨`p0AEligMPacutebrevecircyfrgravelphamacrndogonpfpplyFunctionringscrsigntildeumlBackslashrvwedcyecausernoullistafropfrevescrumpeqCHcyOPYacutepitalDifferentialDyleyscaronedilirconintdotedillanterDotfrhiircleDotMinusPlusTimeslockwiseContourIntegralseCurlyDoubleQuoteQuoteolonengruentinttourIntegralpfroductunterClockwiseContourIntegralrossscrupCapDDotrahdJcyScyZcyaggerrrshvcaronyeltafriacriticalAcuteDotubleAcuteGraveTildemondfferentialDopftDotEqualubleContourIntegralDotwnArrowLeftArrowRightArrowTeeongLeftArrowRightArrowRightArrowRightArrowTeeUpArrowDownArrowVerticalBarwnArrowBarUpArrowBreveLeftRightVectorTeeVectorVectorBarRightTeeVectorVectorBarTeeArrowarrowscrtrokENGTHacutecaronircydotfrgravelementmacrptySmallSquareVerySmallSquareogonpfpsilonqualTildeilibriumscrimtaumlxistsponentialEFcyfrilledSmallSquareVerySmallSquareopfrAlluriertrfscrGJcyTammadbrevecedilircydotfrgopfreaterEqualLessFullEqualGreaterLessSlantEqualTildescrtHARDcyacektcircfrilbertSpaceopfrizontalLinescrtrokumpDownHumpEqualIEcyJligOcyacutecircydotfrgravemacrginaryIpliesntegralrsectionvisibleCommaTimesogonpftascrtildeukcymlJcircyfropfscrercyukcyKHcyJcyappacedilyfropfscrLJcyTacutembdangplacetrfrrcaronedilyeftAngleBracketrrowBarRightArrowCeilingDoubleBracketwnTeeVectorVectorBarFloorRightArrowVectorTeeArrowVectorriangleBarEqualUpDownVectorTeeVectorVectorBarVectorBararrowrightarrowssEqualGreaterFullEqualGreaterLessSlantEqualTildefrleftarrowmidotongLeftArrowRightArrowRightArrowleftarrowrightarrowrightarrowpfwerLeftArrowRightArrowscrhtroktMapcyediumSpacellintrffrinusPlusopfscruNJcyacutecaronedilyegativeMediumSpaceThickSpacenSpaceVeryThinSpacestedGreaterGreaterLessLesswLinefroBreaknBreakingSpacepftCongruentupCapDoubleVerticalBarElementqualTildexistsGreaterEqualFullEqualGreaterLessSlantEqualTildeHumpDownHumpEqualLeftTriangleBarEqualssEqualGreaterLessSlantEqualTildeNestedGreaterGreaterLessLessPrecedesEqualSlantEqualReverseElementightTriangleBarEqualSquareSubsetEqualpersetEqualubsetEqualcceedsEqualSlantEqualTildepersetEqualTildeEqualFullEqualTildeVerticalBarscrtildeuOEligacutecircydblacfrgravemacregaicronopfpenCurlyDoubleQuoteQuoterscrlashtildemesumlverBarraceketParenthesisPartialDcyfrhiilusMinusoincareplanepfrecedesEqualSlantEqualTildeimeoductportionalscriQUOTfropfscrRBarrEGacutengrrtlcaronedilyeverseElementquilibriumUpEquilibriumfrhoightAngleBracketrrowBarLeftArrowCeilingDoubleBracketwnTeeVectorVectorBarFloorTeeArrowVectorriangleBarEqualUpDownVectorTeeVectorVectorBarVectorBararrowopfundImpliesrightarrowscrhuleDelayedSHCHcycyOFTcyacutecaronedilircyfrhortDownArrowLeftArrowRightArrowUpArrowigmamallCircleopfqrtuareIntersectionSubsetEqualpersetEqualUnionscrtarubsetEqualcceedsEqualSlantEqualTildehThatmpersetEqualsetTHORNRADESHcycyabucaronedilyfrhereforetaickSpacenSpaceildeEqualFullEqualTildeopfripleDotscrtrokUacuterrocirbrcyevecircydblacfrgravemacrnderBarraceketParenthesisionPlusogonpfpArrowBarDownArrowDownArrowEquilibriumTeeArrowarrowdownarrowperLeftArrowRightArrowsilonringscrtildeumlVDashbarcydashleerbarticalBarLineSeparatorTildeyThinSpacefropfscrvdashWcircedgefropfscrXfriopfscrYAcyIcyUcyacutecircyfropfscrumlZHcyacutecaronydoteroWidthSpacetafropfscraacutebrevecEdircuteyeligfrgravelefsymphphamacrlgpndanddslopevgelemsdaabcdefghrtvbdsphtzarrogonpfpEacireidosproxeqringscrtympeqtildeumlwconintintbNotackcongepsilonprimesimeqrveewedgebrktbrkcongydquoecausemptyvpsirnoutahweenfrigcapircupodotplustimessqcuptartriangledownupuplusveewedgekarowlacklozengesquaretriangledownleftrightnkk12434ocknequivotopfttomwtiexDLRlrHDUduULRlrVHLRhlrboxdLRlrhDUduminusplustimesuLRlrvHLRhlrprimerevevbarscremiimeolbhsubulletmpEeqcacutepandbrcupcapupdotsretoncapsronedilircupssmdotedilmptyvnterdotfrhcyeckmarkiirEceqlearrowleftrightdRSastcircdashefnintmidscirlubsuitoloneqmmatpfnlementxesngdotintpfrodysrrarrossscrubepetdotudarrlreprsclarrppbrcapcapupdotorsrarrmlyeqprecsuccveewedgerenvearrowleftrightveewedwconintintylctydArrHaraggerlethrrshvbkarowlaccaronydaggerrrotseqegltamptyvfishtrharlriamondsuitsegammasinvideontimesonxjcylcornropollarpfteqdotminusplussquareublebarwedgewnarrowdownarrowsharpoonleftrightrbkarowcornropscryoltroktdotrifuarrharwanglezcyigrarreDDototacutestercaronircolonydotefDotrgravesdotlinterslsdotmacrptysetvsp134ngspogonpfparsllussilonvqcircolonsimlantgtrlessualsestivDDvparslrDotarrscrdotimtahumlroxclistpectationonentialefallingdotseqcyemalefiligligligriligjliglatligtnsnofopfrallkvpartintrac123456823534584556878slownscrgElacutemmadpbrevecircydotelqqslantsccdotollesfrggimeljcylEajnEapproxeqqsimopfravescrimeltccirdotlParquestrapproxrrdoteqlessqlesslesssimvertneqqnEhArrairsplfmiltrdcyrcirwbarcirceartsuitlliprconfrksearowwarowoarrmthtokleftarrowrightarrowpfrbarscrlashtrokybullpheniacutecircyecyxclffrgraveiiintntnfinotajligmacrgelinepartthofpedncarefintieodottcalegersrcallarhkprodocygonpftaprodquestscrinEdotsvvtildeukcymljcircyfrmathopfscrercyukcykappavcedilyfrgreenhcyjcyopfscrlAarrrrtailBarrEgHaracuteemptyvgranmbdangdlepquorrbfsfshklpplsimtltailesbarrbrkracekkeslducaronedililubydcaquorrdharusharsheftarrowtailharpoondownupleftarrowsrightarrowsharpoonssquigarrowthreetimesgqqslantsccdotorgessapproxdoteqgtrqgtrgtrsimfishtloorrgEhardulblkjcylarrcornerhardtrimidotoustachenEapproxeqqsimoangrrbrkngleftarrowrightarrowmapstorightarrowoparrowleftrightparflustimeswastbarzengefparltrarrcornerhardmtrisaquocrhimegqbuortroktccirdothreeimeslarrquestrPariefurdsharuharvertneqqnEmDDotacrletesepstodownleftuprkercommaydasheasuredanglefrhoicrodastcirdotnusbdulcpdrnplusodelspfpscrtposultimapmapnGgtvLeftarrowrightarrowltvRightarrowVDashdashablacutengpEidosproxturalsbspumpecapronedilongdotupydasheArrarhkrowdotquivsearimxistsfrgEeqqslantssimtrhArrarrparisdvjcylArrEarrdreftarrowrightarrowqqslantsssimtriemidopftinEdotvabcnivabcparallelsltolintrcueeceqrArrarrcwightarrowtriesccueerhortmidparallelimeqmidparqsubepeubEeseteqqcceqpEeseteqqtglildelgrianglelefteqrightequmerospvDashHarrapdashgetinfinlArretrierArrtriesimwArrarhkrownearoSacutestcircydashblacivotsoldeligfcirrgonravethbarmintlarrcirrossinetmacregaicrondnusopfparerplusrarrderoffmigoforslopevscrlasholtildemesasumlvbarparallelsimltcyercntiodmilptenkfrhivmmatoneitchforkvlanckhkvusacirbcirdouemnsimtwomointintpfundrEapcueecapproxcurlyeqeqnapproxeqqsimsimimesnEapsimodfalarlinesurfptosimurelscriuncspqfrintopfprimescruaternionsintesteqotrAarrrrtailBarrHaraceutedicemptyvngdelequorrapbfscfshklpplsimtlwtailionalsbarrbrkracekkeslducaronedililubydcaldharquorshealinepartsctgfishtloorrhardulovightarrowtailharpoondownupleftarrowsharpoonsrightarrowssquigarrowthreetimesngsingdotseqlarrharmmoustachenmidoangrrbrkparflustimespargtpolintrarrsaquocrhqbuorthreeimesriefltriuluharxsacutebquocEaproncueedilircnEapsimpolintsimydotbeeArrarhkrowctmiswartminusnxtfrownharpchcyyortmidparallelyigmafvmdoteqgElEneplusrarrlarrmallsetminusshpeparslidletesoftcylbarpfpadesuitrqcapsupssubeseteqpesetequareffrarrscretmnmiletarftarfraightepsilonphinsubEdotedotmultnEeplusrarrseteqqneqqimubpccapproxcurlyeqeqnapproxeqqsimsimmngp123EdotsubedothsolublarrmultnEeplusseteqqneqqimubpwArrarhkrownwarzligtargetubrkcaronedilydotelrecfrhere4foretasymvickapproxsimnspkapsimornildemesbardntoeapbotcirforksaprimeradeiangledownlefteqqrighteqdoteminusplussbtimepeziumscryhcytrokwixtoheadleftarrowrightarrowuArrHaracuterrbrcyevecircydarrblacharfishtrgraveharlrblklcornerroptrimacrlogonpfparrowdownarrowharpoonleftrightlussihlonuparrowsrcornerropingtriscrtdotilderifuarrmlwanglevArrBarvDashangrtrepsilonkappanothingphiiroptorhosigmaubsetneqqpsetneqqthetariangleleftrightcydasheebareqlliprbartfrltrinsubpopfproprtriscrubnEepnEezigzagwcircedbargeqierpfropfpreathscrxcapircupdtrifrhArrarrilArrarrmapnisodotpflustimerArrarrscrqcupuplustriveewedgeyacuteycircyenfricyopfscrucymlzacutecaronydoteetrftafrhcyigrarropfscrwjnjC(D%D($(D'%$$ED($'$'$%$'%E$/D'$F%'D(D&#,%%&&$%$)%+%%$E$F$'$&$(#'D&$(%$&4%($(E'%&%($&$)%*$%$%$+)()')($:&5-($'($%*&&&/%%&)%@$'$F$%&&#%%)$&$&$&$(%%%&$(%$$%&%$E$2.&0,.(.(&'%.$F%$&&&(%6)&+*),---&*/1---)-.&)*+,).%*,&,*'('2+,+)1&'1,)2&'&*('($F%'#&D%D($(E&%$$&$ED($)$'%1(2$'%E$)$'((&+$&%%$%D&$(%-#&$E$3)2$F%'%+$&#'D$$'($$($(%&%$$&$E$$$F$./'*,***'*-*($F$$#)$'%$$'$%$.$&%/$&%'$.'(#'$'$&D(D'%$$&$%D($$%&&*%($%&('+%/,($'%E%%$&$($'E%#(%$$E$F$F%'$'#'$&$'$(%$$E$F$F#'D$$(%'%%%+%%$(%'%$$2(',&,-'*'0).+)1&'('-,)'&*(*)(*/&/('/),))/&')-&'('-%1','*'''-'($E$$%+$($/+-'-',+-'-%E%/(-$&%$%'$$#&$%$-%*$E$+$F$&$$#'$($(%'%$$5+-.)+0%5)+%($E$)%1%%%$&,'(&4&*''+H'(&*-(-L-J-'-M-(&O*H&/2F2((%*(***G*M*(&W,K&+.H.-&1'/3F3(&O2(.I4('H,(().H.-.H(I.(&(+(+,+(&.$FD($$#(D(D'%$$($ED($'%&%($F$6,($$$FE'D(&&D&$)('+&'.#+$%$E$%$$$+$/%%$$%)+(+-+(%&%(&*-%$F%$C'$E$&$F#(D%$(%%%%'%$(%'%$$$%/+-*0$%$%$3)'-&-,(*(0*.,)2&(((&+(+))*0&0((/*,*)0&().&(($&%-$-$&%$$-#)%%$($($$%'%'%&%$$E$0(,(-(*$'$-$F$&%')/))/(+)1()($F$&$%&&)(%)+(+-+(&(%$%$&(+(&&C($'$'%%$%%$$(%'%$$E$+&%%K&)$'(((,(($F$+$F%'C)%%''$'&&D'%$$($ED($'$*)',&(.%&('$'%E$)*&*,%,%.%&((%(%,%/(-%%'&$'$F$(D&#($&$%$'($$%%'&$'*+'+,+(&-$E$F$F$(#($'$E$F$F#F$$$F$F#'$&$&D($'%$$E$F$F$&#'$($(%$$&$0%%$%$&$FC)$($$%D%$E&E&%$D'$$%DD($)&%%&$'&%E$$%&&&$&(&$%$&$&%&&)%*$*$*$*$*$*$*$&%(%*$&&'$&'$'%E$$%$%'%$%%%%%')%D'$F%$%&(%D(D&$*%&#'$*'*'('&*%%'&&)%$&''$'%$$'$()$%(%&%'%%&$&'$E$('&'%&''''(&('&&/.%&(&&&($($.()(+0'0'0(&%%&'$&%%&$E&G%%$F%$&&%'%&'$'$'$&$'$'$'$'$&%'$'$'$&$'$'$'$'$'$'$&&&%'$'$'$&$'$'$'$'$&(&'&(&%'$'$'$&$'$'$'$'$'$'$$($'E'$F%&%%'$%%'$''$&'%%%'$'$($#)%$&&&(&&'%&&&D%&&%$'&&E'%&%&(%$&D'%(E%'($E$&%&('%$$%&$&$'%'..()%*$*&*'*'&$&(&&&'$'(&$'($)$%&($&$'%'))&%%'&&&%E&&F$'%$'%&$F%%'$&$'$$'$))$%&&%%')$%$&(&&'%&&&%&D%')$&+*'(&((F&&.-(%&%&$*%&$(#'$&$(%'%%%%'$$)%&$(%$$$%(&%%(D%%&%($(%D$''$$&'&*''$%$%(%&%$F&)*&&$&$(&&$(%E%$&%(&&(&'&)%/%*'-'..($*%'&&$F&$%%%'$'%%'$$'%&$)$&%)#(%%D(%'$(%%G$%'%$$&$$$'%D$$E'%$&&$$%)%$%$&&$'%&(&($%%'%($$%%%$'%E$&'%%&%%'&'$$(&'%&&**'%'&&&%(%%)$'%&$&%&%%$%E$D&%%$&%&%,&,#0$%$($(%&&&%D$'$G$&%&%&$&$F%'&$'$$*D(($H$($($($'%($G%($($'%'%($'%&%%&$F#%%$$(%&($%$$($'%$$&$$%$%$&$&(%$&%&&)$*$&D'%$E$$%$$'$&$$%$%$%$$%%%''%$&$'$%&$F$'$&%%'$'$D$%%&%%&%'%(%*'%&&&)((&'&&$K%E#'$(%%%'%'&$'&'$$&$'$()&%'%'$E$*&($'%'%.'-%E%'$F%'%'$(%'C)$$E&%$$&E&$%%DD($$%'&%%'%&$'$'&%''''&%%%%&$$%'%&(&%'%$&&&(''&(&'$&%&%E%%$'D($F%%'$'&'$($'$$$%'$'E%#(%$$E$'$F$F%'$'#(($$(%$$E$($&$&$F$F#(%%%'$'$$%$$&$(%)%'%'%%'$'%%$E&%%'$(%'%'%'%'%'&'%%$&&&$'D$'%&%'($&%'&)$$(%'&%%%%$$&%&($%(&(%%$$%*,''..%'-'-1$,+,-'-%$%$&$&(%$&%&&)$*$&D'%&*'&'()''&'&$(%'%D$$%$$''$($%&$&$$%&%)%'%&$(%')'$%%%''%$&$'$%&$'&%%&%.+-')'-%.,(%&&D&&%(%'&&%$&'&$$&'%$'%)%&($%$%&$(%E%$%%'$'$%%&%($%'D$%%&%%&%'%'%'%(%'&$'$'$$*&'$K%E#(D&%%&$'&%$&&)')')%%'$(%$$'$/$E$%D'%$&&&&F&%&($($)$$&%%$($(%E$$$F%'$$%)%&#F%D&D$,(-%D%D&D$-$(%'$'%'%E%$&D&E&%&'%&(%*$D&%F(D$&&&%'%&(F%%%$$'$$%&%''$(%%F%'%'&E%')$$E$E%$&$'D'H&D%&%$&$$'%&%&$$%$&$%$$&$'%D%&%%%$&*(-&$'D'H&D'$%&%$&%($$&$FE$&%(D(F(%)$)$&%(%)$)$$&'('E'D%(%$&&&D'$(E$'%&(D(D%,%&($$%&&&D&D%*)+%%'$($%&%&%((%%%'D'$'F*%,D&%(E&$'D'$'F*%,D$&E'%%%.0%,(1%$$%$&&&%$(%'%E%'%E&D%(%'&D&D'F%'&G%F$'%''$(%%'#%D(%%$&G$%$$'%'%%%%%'$'$'%D$&E'%$$'%$$&$'%&&'%&%$$'%&%(&$&&$F$&%&%&$$%&%$&%(%F$F$%'%%%(%$$&E'%%D(&&)%D&$'#&F$''&&'$&$$%$(&&&&&$&'$E$%&$%'%&$$%*%$$()$'%%%'''$'&'%($'$G%'&'&$$$*%EE&$$%$%%%&%$&$')'*'%'*(&(&'&%&($%%&%&&%%&(''''&$'%%&%'$F%$$(#F$&$F$($F$-'&%&(%E%#(%%%'$'$&$F&&%&%)%%'$'$'%E&%%'%'$(%'$'%'%'%'%'&'%'$%'&%('$'%&%'($&%'&)$$(%'&%%%%$$&%(%&($%%$&'&'''$%%E$$(%'%D$''$($%$&$$,-'(./%(-,+(.(-(-%%%-$'%&%$$()'$'$'&%%&%&&D&&%($&'%%)$'$(%E%$%%&%($$(%'%%'$'$''$)$$#)$'$$%$%%&&%&%$&&%&%%&%&&%)%&%$$&'$'$$'%''$(%E%%%%'%)'$%%$E&&$'%'&$%)(+E$$'($($%$&&&$'$&$'$&$'$&%&'&'$'$/&&%)%%&%%$&$'D$(%$&$'%%E$()&&$$'(D&%(D%&($(&+%'$($(&+%%$&&($&$$'$F%'%'%'$&'$%0+&&%$%&$&&&$'&&'&%'$&'&'&&)%+$)&,$'%'%($%%')'*'%'*(&(&'&%$%%%$F$F$F$&$&&'&&$'&&'(%&'&'&%'$&'&&)%+$)&,$'%'%($$'%''$(%%'D'#)%$$&$(%'%$$&$($E$(('&%(&($%,(&&&%&&&E&$'E&($)%($%%$&%$&&&&&D'&%%$($'%)+'+'/%+$+(0%&&&$&(&'&%&'%)$F&$%&%'$'%1*-#'$&D(%%$'&&D'%$$'%'%&$(%DD($''$%&$()%&&%&$'E$$'%E$)%,%.,(%&%%'$'&%+$()%&&%&%&$F$'%'%%'$$'E%$)#'$&'$$'$(%+&(&*&&'$'(&$'%&('K/D(J/D&('..($%$'$%&&&%%'%'&$$E$'$G'D$F$'$'$F%G(D&F(D$)#($(&%($%'$E$F$$$$%'$F#'%&%%$'$E$'%&$$$'%&$&$&$'%E&&%'$'%&$F%'$(%&$&$(C)&$$'%$D%$E$&$F$F$&E%#)$(%$$&$(%%$E$&$)$F$F$%%%0@0000H8H40H000047P00P@001000@0B0HP@:H9T8P000LB8d@800@I0<110000QQ8400P10030005940@410020000Q02000@0200000@P0101@8000440400000000808000000000@00000000P`0000000040400@0004<000000000008000030000000000P020T400020@0@00000000000000000000000000P0000000400400000400220080000100000000000000000P000000000000P000000@00402000000000@00000000000000000000040000000000000", "Æ&ÁĂÂА𝔄ÀΑĀ⩓Ą𝔸Å𝒜≔ÃÄ∖⫧⌆Б∵ℬΒ𝔅𝔹˘ℬ≎Ч©Ć⋒ⅅℭČÇĈ∰Ċ¸·ℭΧ⊙⊖⊕⊗∲”’∷⩴≡∯∮ℂ∐∳⨯𝒞⋓≍ⅅ⤑ЂЅЏ‡↡⫤ĎД∇Δ𝔇´˙˝`˜⋄ⅆ𝔻¨⃜≐∯¨⇓⇐⇔⫤⟸⟺⟹⇒⊨⇑⇕∥↓⤓⇵̑⥐⥞↽⥖⥟⇁⥗⊤↧⇓𝒟ĐŊÐÉĚÊЭĖ𝔈È∈Ē◻▫Ę𝔼Ε⩵≂⇌ℰ⩳ΗË∃ⅇФ𝔉◼▪𝔽∀ℱℱЃ>ΓϜĞĢĜГĠ𝔊⋙𝔾≥⋛≧⪢≷⩾≳𝒢≫Ъˇ^Ĥℌℋℍ─ℋĦ≎≏ЕIJЁÍÎИİℑÌℑĪⅈ⇒∬∫⋂Į𝕀ΙℐĨІÏĴЙ𝔍𝕁𝒥ЈЄХЌΚĶК𝔎𝕂𝒦Љ<ĹΛ⟪ℒ↞ĽĻЛ⟨←⇤⇆⌈⟦⥡⇃⥙⌊↔⥎⊣↤⥚⊲⧏⊴⥑⥠↿⥘↼⥒⇐⇔⋚≦≶⪡⩽≲𝔏⋘⇚Ŀ⟵⟷⟶⟸⟺⟹𝕃↙↘ℒ↰Ł≪⤅М ℳ𝔐∓𝕄ℳΜЊŃŇŅН≫≪\n𝔑\xA0ℕ⫬≢≭∦∉≠≂̸∄≯≱≧̸≫̸≹⩾̸≵≎̸≏̸⋪⧏̸⋬≮≰≸≪̸⩽̸≴⪢̸⪡̸⊀⪯̸⋠∌⋫⧐̸⋭⊏̸⋢⊐̸⋣⊂⃒⊈⊁⪰̸⋡≿̸⊃⃒⊉≁≄≇≉∤𝒩ÑΝŒÓÔОŐ𝔒ÒŌΩΟ𝕆“‘⩔𝒪ØÕ⨷Ö‾⏞⎴⏜∂П𝔓ΦΠ±ℌℙ⪻≺⪯≼≾″∏∷∝𝒫Ψ\"𝔔ℚ𝒬⤐®Ŕ⟫↠⤖ŘŖРℜ∋⇋⥯ℜΡ⟩→⇥⇄⌉⟧⥝⇂⥕⌋⊢↦⥛⊳⧐⊵⥏⥜↾⥔⇀⥓⇒ℝ⥰⇛ℛ↱⧴ЩШЬŚ⪼ŠŞŜС𝔖↓←→↑Σ∘𝕊√□⊓⊏⊑⊐⊒⊔𝒮⋆⋐⋐⊆≻⪰≽≿∋∑⋑⊃⊇⋑Þ™ЋЦ ΤŤŢТ𝔗∴Θ ∼≃≅≈𝕋⃛𝒯ŦÚ↟⥉ЎŬÛУŰ𝔘ÙŪ_⏟⎵⏝⋃⊎Ų𝕌↑⤒⇅↕⥮⊥↥⇑⇕↖↗ϒΥŮ𝒰ŨÜ⊫⫫В⊩⫦⋁‖‖∣|❘≀ 𝔙𝕍𝒱⊪Ŵ⋀𝔚𝕎𝒲𝔛Ξ𝕏𝒳ЯЇЮÝŶЫ𝔜𝕐𝒴ŸЖŹŽЗŻΖℨℤ𝒵áă∾∾̳∿â´аæ𝔞àℵℵαā⨿&∧⩕⩜⩘⩚∠⦤∠∡⦨⦩⦪⦫⦬⦭⦮⦯∟⊾⦝∢Å⍼ą𝕒≈⩰⩯≊≋'≈≊å𝒶*≈≍ãä∳⨑⫭≌϶‵∽⋍⊽⌅⌅⎵⎶≌б„∵∵⦰϶ℬβℶ≬𝔟⋂◯⋃⨀⨁⨂⨆★▽△⨄⋁⋀⤍⧫▪▴▾◂▸␣▒░▓█=⃥≡⃥⌐𝕓⊥⊥⋈╗╔╖╓═╦╩╤╧╝╚╜╙║╬╣╠╫╢╟⧉╕╒┐┌─╥╨┬┴⊟⊞⊠╛╘┘└│╪╡╞┼┤├‵˘¦𝒷⁏∽⋍\\⧅⟈••≎⪮≏≏ć∩⩄⩉⩋⩇⩀∩︀⁁ˇ⩍čçĉ⩌⩐ċ¸⦲¢·𝔠ч✓✓χ○⧃ˆ≗↺↻®Ⓢ⊛⊚⊝≗⨐⫯⧂♣♣:≔≔,@∁∘∁ℂ≅⩭∮𝕔∐©℗↵✗𝒸⫏⫑⫐⫒⋯⤸⤵⋞⋟↶⤽∪⩈⩆⩊⊍⩅∪︀↷⤼⋞⋟⋎⋏¤↶↷⋎⋏∲∱⌭⇓⥥†ℸ↓‐⊣⤏˝ďдⅆ‡⇊⩷°δ⦱⥿𝔡⇃⇂⋄⋄♦♦¨ϝ⋲÷÷⋇⋇ђ⌞⌍$𝕕˙≐≑∸∔⊡⌆↓⇊⇃⇂⤐⌟⌌𝒹ѕ⧶đ⋱▿▾⇵⥯⦦џ⟿⩷≑é⩮ě≖ê≕эėⅇ≒𝔢⪚è⪖⪘⪙⏧ℓ⪕⪗ē∅∅∅ ŋ ę𝕖⋕⧣⩱εεϵ≖≕≂⪖⪕=≟≡⩸⧥≓⥱ℯ≐≂ηðë€!∃ℰⅇ≒ф♀ffiffffl𝔣fifj♭fl▱ƒ𝕗∀⋔⫙⨍½⅓¼⅕⅙⅛⅔⅖¾⅗⅜⅘⅚⅝⅞⁄⌢𝒻≧⪌ǵγϝ⪆ğĝгġ≥⋛≥≧⩾⩾⪩⪀⪂⪄⋛︀⪔𝔤≫⋙ℷѓ≷⪒⪥⪤≩⪊⪊⪈⪈≩⋧𝕘`ℊ≳⪎⪐>⪧⩺⋗⦕⩼⪆⥸⋗⋛⪌≷≳≩︀≩︀⇔ ½ℋъ↔⥈↭ℏĥ♥♥…⊹𝔥⤥⤦⇿∻↩↪𝕙―𝒽ℏħ⁃‐íîие¡⇔𝔦ìⅈ⨌∭⧜℩ijīℑℐℑı⊷Ƶ∈℅∞⧝ı∫⊺ℤ⊺⨗⨼ёį𝕚ι⨼¿𝒾∈⋹⋵⋴⋳∈ĩіïĵй𝔧ȷ𝕛𝒿јєκϰķк𝔨ĸхќ𝕜𝓀⇚⇐⤛⤎≦⪋⥢ĺ⦴ℒλ⟨⦑⟨⪅«←⇤⤟⤝↩↫⤹⥳↢⪫⤙⪭⪭︀⤌❲{[⦋⦏⦍ľļ⌈{л⤶“„⥧⥋↲≤←↢↽↼⇇↔⇆⇋↭⋋⋚≤≦⩽⩽⪨⩿⪁⪃⋚︀⪓⪅⋖⋚⪋≶≲⥼⌊𝔩≶⪑↽↼⥪▄љ≪⇇⌞⥫◺ŀ⎰⎰≨⪉⪉⪇⪇≨⋦⟬⇽⟦⟵⟷⟼⟶↫↬⦅𝕝⨭⨴∗_◊◊⧫(⦓⇆⌟⇋⥭⊿‹𝓁↰≲⪍⪏[‘‚ł<⪦⩹⋖⋋⋉⥶⩻⦖◃⊴◂⥊⥦≨︀≨︀∺¯♂✠✠↦↦↧↤↥▮⨩м—∡𝔪℧µ∣*⫰·−⊟∸⨪⫛…∓⊧𝕞∓𝓂∾μ⊸⊸⋙̸≫⃒≫̸⇍⇎⋘̸≪⃒≪̸⇏⊯⊮∇ń∠⃒≉⩰̸≋̸ʼn≉♮♮ℕ\xA0≎̸≏̸⩃ňņ≇⩭̸⩂н–≠⇗⤤↗↗≐̸≢⤨≂̸∄∄𝔫≧̸≱≱≧̸⩾̸⩾̸≵≯≯⇎↮⫲∋⋼⋺∋њ⇍≦̸↚‥≰↚↮≰≦̸⩽̸⩽̸≮≴≮⋪⋬∤𝕟¬∉⋹̸⋵̸∉⋷⋶∌∌⋾⋽∦∦⫽⃥∂̸⨔⊀⋠⪯̸⊀⪯̸⇏↛⤳̸↝̸↛⋫⋭⊁⋡⪰̸𝓃∤∦≁≄≄∤∦⋢⋣⊄⫅̸⊈⊂⃒⊈⫅̸⊁⪰̸⊅⫆̸⊉⊃⃒⊉⫆̸≹ñ≸⋪⋬⋫⋭ν#№ ⊭⤄≍⃒⊬≥⃒>⃒⧞⤂≤⃒<⃒⊴⃒⤃⊵⃒∼⃒⇖⤣↖↖⤧Ⓢó⊛⊚ôо⊝ő⨸⊙⦼œ⦿𝔬˛ò⧁⦵Ω∮↺⦾⦻‾⧀ōωο⦶⊖𝕠⦷⦹⊕∨↻⩝ℴℴªº⊶⩖⩗⩛ℴø⊘õ⊗⨶ö⌽∥¶∥⫳⫽∂п%.‰⊥‱𝔭φϕℳ☎π⋔ϖℏℎℏ+⨣⊞⨢∔⨥⩲±⨦⨧±⨕𝕡£≺⪳⪷≼⪯≺⪷≼⪯⪹⪵⋨≾′ℙ⪵⪹⋨∏⌮⌒⌓∝∝≾⊰𝓅ψ 𝔮⨌𝕢⁗𝓆ℍ⨖?≟\"⇛⇒⤜⤏⥤∽̱ŕ√⦳⟩⦒⦥⟩»→⥵⇥⤠⤳⤞↪↬⥅⥴↣↝⤚∶ℚ⤍❳}]⦌⦎⦐řŗ⌉}р⤷⥩””↳ℜℛℜℝ▭®⥽⌋𝔯⇁⇀⥬ρϱ→↣⇁⇀⇄⇌⇉↝⋌˚≓⇄⇌⎱⎱⫮⟭⇾⟧⦆𝕣⨮⨵)⦔⨒⇉›𝓇↱]’’⋌⋊▹⊵▸⧎⥨℞ś‚≻⪴⪸š≽⪰şŝ⪶⪺⋩⨓≿с⋅⊡⩦⇘⤥↘↘§;⤩∖∖✶𝔰⌢♯щш∣∥σςς∼⩪≃≃⪞⪠⪝⪟≆⨤⥲←∖⨳⧤∣⌣⪪⪬⪬︀ь/⧄⌿𝕤♠♠∥⊓⊓︀⊔⊔︀⊏⊑⊏⊑⊐⊒⊐⊒□□▪▪→𝓈∖⌣⋆☆★ϵϕ¯⊂⫅⪽⊆⫃⫁⫋⊊⪿⥹⊂⊆⫅⊊⫋⫇⫕⫓≻⪸≽⪰⪺⪶⋩≿∑♪⊃¹²³⫆⪾⫘⊇⫄⟉⫗⥻⫂⫌⊋⫀⊃⊇⫆⊋⫌⫈⫔⫖⇙⤦↙↙⤪ß⌖τ⎴ťţт⃛⌕𝔱∴∴θϑϑ≈∼ ≈∼þ˜×⊠⨱⨰∭⤨⊤⌶⫱𝕥⫚⤩‴™▵▿◃⊴≜▹⊵◬≜⨺⨹⧍⨻⏢𝓉цћŧ≬↞↠⇑⥣ú↑ўŭûу⇅ű⥮⥾𝔲ù↿↾▀⌜⌜⌏◸ū¨ų𝕦↑↕↿↾⊎υϒυ⇈⌝⌝⌎ů◹𝓊⋰ũ▵▴⇈ü⦧⇕⫨⫩⊨⦜ϵϰ∅ϕϖ∝↕ϱς⊊︀⫋︀⊋︀⫌︀ϑ⊲⊳в⊢∨⊻≚⋮||𝔳⊲⊂⃒⊃⃒𝕧∝⊳𝓋⫋︀⊊︀⫌︀⊋︀⦚ŵ⩟∧≙℘𝔴𝕨℘≀≀𝓌⋂◯⋃▽𝔵⟺⟷ξ⟸⟵⟼⋻⨀𝕩⨁⨂⟹⟶𝓍⨆⨄△⋁⋀ýяŷы¥𝔶ї𝕪𝓎юÿźžзżℨζ𝔷ж⇝𝕫𝓏"];
|
|
14119
|
+
/** Multiplier deriving the first candidate bucket from a key. */
|
|
14120
|
+
const BUCKET_HASH_1 = 2654435761;
|
|
14121
|
+
/** Multiplier deriving the second candidate bucket from a key. */
|
|
14122
|
+
const BUCKET_HASH_2 = 2246822507;
|
|
14123
|
+
/** Size of the (c0,c1) class table (10-bit index). */
|
|
14124
|
+
const PAIR_TABLE_SIZE = 1024;
|
|
14125
|
+
/**
|
|
14126
|
+
* Map an alphanumeric char code to 6 bits (1..62); 0 = not alphanumeric.
|
|
14127
|
+
* Used for the key's last-character field.
|
|
14128
|
+
*/
|
|
14129
|
+
const CHAR_REMAP = (() => {
|
|
14130
|
+
const remap = /* @__PURE__ */ new Uint8Array(128);
|
|
14131
|
+
for (let code = 48; code <= 57; code++) remap[code] = code - 47;
|
|
14132
|
+
for (let code = 65; code <= 90; code++) remap[code] = code - 54;
|
|
14133
|
+
for (let code = 97; code <= 122; code++) remap[code] = code - 60;
|
|
14134
|
+
return remap;
|
|
14135
|
+
})();
|
|
14136
|
+
/**
|
|
14137
|
+
* The exact 32-bit key for a name occurring at `nameStart` with `length`
|
|
14138
|
+
* chars. Covers the first two and last two characters plus the length;
|
|
14139
|
+
* middle characters are verified separately against the names blob.
|
|
14140
|
+
*
|
|
14141
|
+
* The hot decoder inlines this computation; tests assert both stay in sync
|
|
14142
|
+
* by looking every entity up through the public API.
|
|
14143
|
+
* @param text Text containing the name.
|
|
14144
|
+
* @param nameStart Index of the name's first character.
|
|
14145
|
+
* @param length Length of the name.
|
|
14146
|
+
*/
|
|
14147
|
+
function exactKey(text, nameStart, length) {
|
|
14148
|
+
return text.charCodeAt(nameStart) << 25 | text.charCodeAt(nameStart + 1) << 18 | text.charCodeAt(nameStart + length - 2) << 11 | CHAR_REMAP[text.charCodeAt(nameStart + length - 1)] << 5 | length;
|
|
14149
|
+
}
|
|
14150
|
+
/**
|
|
14151
|
+
* The 10-bit (c0,c1) class index used by the probe front end. The function
|
|
14152
|
+
* was chosen by exhaustive search over load-free mixers for minimal
|
|
14153
|
+
* candidate-set collisions on the real entity set.
|
|
14154
|
+
* @param c0 First char code of the candidate name.
|
|
14155
|
+
* @param c1 Second char code.
|
|
14156
|
+
*/
|
|
14157
|
+
function pairIndex(c0, c1) {
|
|
14158
|
+
return (c0 * 3 << 3 ^ c1) & 1023;
|
|
14159
|
+
}
|
|
14160
|
+
/**
|
|
14161
|
+
* First candidate bucket for a key in a table of `buckets` buckets.
|
|
14162
|
+
* @param key Exact key.
|
|
14163
|
+
* @param buckets Bucket count.
|
|
14164
|
+
*/
|
|
14165
|
+
function bucketOne(key, buckets) {
|
|
14166
|
+
return (Math.imul(key, BUCKET_HASH_1) >>> 16) * buckets >>> 16;
|
|
14167
|
+
}
|
|
14168
|
+
/**
|
|
14169
|
+
* Second candidate bucket for a key.
|
|
14170
|
+
* @param key Exact key.
|
|
14171
|
+
* @param buckets Bucket count.
|
|
14172
|
+
*/
|
|
14173
|
+
function bucketTwo(key, buckets) {
|
|
14174
|
+
return (Math.imul(key, BUCKET_HASH_2) >>> 16) * buckets >>> 16;
|
|
14175
|
+
}
|
|
14176
|
+
/**
|
|
14177
|
+
* Build the lookup structures from a serialized dataset.
|
|
14178
|
+
* @param packed Serialized decode data, see `decode-data-format.ts`.
|
|
14179
|
+
*/
|
|
14180
|
+
function initDecodeData(packed) {
|
|
14181
|
+
const [data, values] = packed;
|
|
14182
|
+
const nameCount = data.charCodeAt(0) - 48 << 6 | data.charCodeAt(1) - 48;
|
|
14183
|
+
const suffixesLength = data.charCodeAt(2) - 48 << 6 | data.charCodeAt(3) - 48;
|
|
14184
|
+
const buckets = data.charCodeAt(4) - 48 << 6 | data.charCodeAt(5) - 48;
|
|
14185
|
+
const metaStart = 6 + suffixesLength;
|
|
14186
|
+
const choicesStart = metaStart + 2 * nameCount;
|
|
14187
|
+
const slotCount = 2 * buckets;
|
|
14188
|
+
const keys = new Int32Array(slotCount);
|
|
14189
|
+
const slotMidOff = new Uint16Array(slotCount);
|
|
14190
|
+
const slotValue = new Uint16Array(slotCount);
|
|
14191
|
+
const lengthBits = new Uint32Array(PAIR_TABLE_SIZE);
|
|
14192
|
+
const middleOffsets = /* @__PURE__ */ new Map();
|
|
14193
|
+
const middles = [];
|
|
14194
|
+
let name = "";
|
|
14195
|
+
let suffixOffset = 6;
|
|
14196
|
+
let valueOffset = 0;
|
|
14197
|
+
for (let index = 0; index < nameCount; index++) {
|
|
14198
|
+
const meta0 = data.charCodeAt(metaStart + 2 * index) - 35;
|
|
14199
|
+
const meta1 = data.charCodeAt(metaStart + 2 * index + 1) - 35;
|
|
14200
|
+
const prefixLength = meta0 & 31;
|
|
14201
|
+
const length = prefixLength + (meta1 & 31);
|
|
14202
|
+
const valueLength = (meta1 >> 5) + 1;
|
|
14203
|
+
name = name.slice(0, prefixLength) + data.slice(suffixOffset, suffixOffset + length - prefixLength);
|
|
14204
|
+
suffixOffset += length - prefixLength;
|
|
14205
|
+
const key = exactKey(name, 0, length);
|
|
14206
|
+
let slot = 2 * ((data.charCodeAt(choicesStart + Math.floor(index / 6)) - 48 & 1 << index % 6) === 0 ? bucketOne : bucketTwo)(key, buckets);
|
|
14207
|
+
if (keys[slot] !== 0) slot += 1;
|
|
14208
|
+
keys[slot] = key;
|
|
14209
|
+
if (length > 4) {
|
|
14210
|
+
const middle = name.slice(2, length - 2);
|
|
14211
|
+
const existing = middleOffsets.get(middle);
|
|
14212
|
+
if (existing === void 0) {
|
|
14213
|
+
middleOffsets.set(middle, middles.length);
|
|
14214
|
+
slotMidOff[slot] = middles.length;
|
|
14215
|
+
for (let middleIndex = 0; middleIndex < middle.length; middleIndex += 2) middles.push(middle.charCodeAt(middleIndex) | middle.charCodeAt(middleIndex + 1) << 16);
|
|
14216
|
+
} else slotMidOff[slot] = existing;
|
|
14217
|
+
}
|
|
14218
|
+
const pair = pairIndex(name.charCodeAt(0), name.charCodeAt(1));
|
|
14219
|
+
lengthBits[pair] |= length <= 16 ? 1 << length - 2 : 32768;
|
|
14220
|
+
if ((meta0 & 32) !== 0) lengthBits[pair] |= 1 << length - 2 + 16;
|
|
14221
|
+
slotValue[slot] = valueOffset << 2 | valueLength - 1 | (meta0 & 32) >> 4;
|
|
14222
|
+
valueOffset += valueLength;
|
|
14223
|
+
}
|
|
14224
|
+
return {
|
|
14225
|
+
keys,
|
|
14226
|
+
buckets,
|
|
14227
|
+
slotMidOff,
|
|
14228
|
+
slotValue,
|
|
14229
|
+
values,
|
|
14230
|
+
lengthBits,
|
|
14231
|
+
middles: new Uint32Array(middles)
|
|
14232
|
+
};
|
|
14233
|
+
}
|
|
14048
14234
|
// ../../node_modules/.pnpm/entities@9.0.0/node_modules/entities/dist/decode.js
|
|
14049
14235
|
const CHAR_AMP = 38;
|
|
14050
14236
|
const CHAR_NUM = 35;
|
|
14051
14237
|
const CHAR_SEMI = 59;
|
|
14238
|
+
const CHAR_EQUALS = 61;
|
|
14052
14239
|
const CHAR_ZERO = 48;
|
|
14053
14240
|
const CHAR_LOWER_A = 97;
|
|
14054
14241
|
const CHAR_LOWER_X = 120;
|
|
@@ -14056,6 +14243,27 @@ const CHAR_UPPER_A = 65;
|
|
|
14056
14243
|
/** Bit that needs to be set to convert an upper case ASCII character to lower case */
|
|
14057
14244
|
const TO_LOWER_BIT$1 = 32;
|
|
14058
14245
|
/**
|
|
14246
|
+
* Unsigned subtraction trick: (code - lo) >>> 0 wraps negatives to large
|
|
14247
|
+
* values, so a single `<=` covers the entire [lo..hi] range check.
|
|
14248
|
+
* @param code Code point to check.
|
|
14249
|
+
*/
|
|
14250
|
+
function isNumber$1(code) {
|
|
14251
|
+
return code - CHAR_ZERO >>> 0 <= 9;
|
|
14252
|
+
}
|
|
14253
|
+
function isAlphaNumeric(code) {
|
|
14254
|
+
return isNumber$1(code) || (code | TO_LOWER_BIT$1) - CHAR_LOWER_A >>> 0 <= 25;
|
|
14255
|
+
}
|
|
14256
|
+
/**
|
|
14257
|
+
* Checks if the given character is a valid end character for an entity in an attribute.
|
|
14258
|
+
*
|
|
14259
|
+
* Attribute values that aren't terminated properly aren't parsed, and shouldn't lead to a parser error.
|
|
14260
|
+
* See the example in https://html.spec.whatwg.org/multipage/parsing.html#named-character-reference-state
|
|
14261
|
+
* @param code Code point to check.
|
|
14262
|
+
*/
|
|
14263
|
+
function isEntityInAttributeInvalidEnd$1(code) {
|
|
14264
|
+
return code === CHAR_EQUALS || isAlphaNumeric(code);
|
|
14265
|
+
}
|
|
14266
|
+
/**
|
|
14059
14267
|
* Decoding mode for named entities.
|
|
14060
14268
|
*/
|
|
14061
14269
|
var DecodingMode$1;
|
|
@@ -14067,6 +14275,66 @@ var DecodingMode$1;
|
|
|
14067
14275
|
/** Entities in attributes have limitations on ending characters. */
|
|
14068
14276
|
DecodingMode[DecodingMode["Attribute"] = 2] = "Attribute";
|
|
14069
14277
|
})(DecodingMode$1 || (DecodingMode$1 = {}));
|
|
14278
|
+
/** Decode data for HTML entities. */
|
|
14279
|
+
const htmlDecode = /* #__PURE__ */ initDecodeData(htmlDecodeData);
|
|
14280
|
+
const htmlKeys = /* #__PURE__ */ (() => htmlDecode.keys)();
|
|
14281
|
+
const htmlBuckets = /* #__PURE__ */ (() => htmlDecode.buckets)();
|
|
14282
|
+
const htmlSlotMidOff = /* #__PURE__ */ (() => htmlDecode.slotMidOff)();
|
|
14283
|
+
const htmlLengthBits = /* #__PURE__ */ (() => htmlDecode.lengthBits)();
|
|
14284
|
+
const htmlMiddles = /* #__PURE__ */ (() => htmlDecode.middles)();
|
|
14285
|
+
/** Hoisted for the specialized HTML cores; see `emitHtmlValue`. */
|
|
14286
|
+
const htmlSlotValue = /* #__PURE__ */ (() => htmlDecode.slotValue)();
|
|
14287
|
+
const htmlValues = /* #__PURE__ */ (() => htmlDecode.values)();
|
|
14288
|
+
/**
|
|
14289
|
+
* The replacement string for a packed `slotValue` entry. Most values need
|
|
14290
|
+
* just one UTF-16 code unit.
|
|
14291
|
+
* @param packed Replacement offset, legacy flag, and length from `htmlSlotValue`.
|
|
14292
|
+
*/
|
|
14293
|
+
function emitHtmlValue(packed) {
|
|
14294
|
+
const off = packed >> 2;
|
|
14295
|
+
return (packed & 1) === 0 ? htmlValues.charAt(off) : htmlValues.slice(off, off + (packed & 1) + 1);
|
|
14296
|
+
}
|
|
14297
|
+
/**
|
|
14298
|
+
* Find the slot matching `text[start..start+length)`, or -1. A match proves
|
|
14299
|
+
* every character of the span (exact key + middle comparison).
|
|
14300
|
+
* @param text Input text.
|
|
14301
|
+
* @param start Start of the span in `text`.
|
|
14302
|
+
* @param length Length of the span.
|
|
14303
|
+
*/
|
|
14304
|
+
function findSlotHtml(text, start, length) {
|
|
14305
|
+
const c0 = text.charCodeAt(start);
|
|
14306
|
+
const c1 = text.charCodeAt(start + 1);
|
|
14307
|
+
const c2 = text.charCodeAt(start + length - 2);
|
|
14308
|
+
const c3 = text.charCodeAt(start + length - 1);
|
|
14309
|
+
if ((c0 | c1 | c2 | c3) > 127) return -1;
|
|
14310
|
+
const key = c0 << 25 | c1 << 18 | c2 << 11 | CHAR_REMAP[c3] << 5 | length;
|
|
14311
|
+
let slot = 2 * ((Math.imul(key, BUCKET_HASH_1) >>> 16) * htmlBuckets >>> 16);
|
|
14312
|
+
for (let attempt = 0;; attempt++) {
|
|
14313
|
+
if (htmlKeys[slot] === key && (length <= 4 || isMidMatchHtml(slot, text, start, length))) return slot;
|
|
14314
|
+
if (htmlKeys[slot + 1] === key && (length <= 4 || isMidMatchHtml(slot + 1, text, start, length))) return slot + 1;
|
|
14315
|
+
if (attempt === 1) return -1;
|
|
14316
|
+
slot = 2 * ((Math.imul(key, BUCKET_HASH_2) >>> 16) * htmlBuckets >>> 16);
|
|
14317
|
+
}
|
|
14318
|
+
}
|
|
14319
|
+
/**
|
|
14320
|
+
* Compare the middle characters (positions 2..length-3) of the candidate at
|
|
14321
|
+
* `slot` against the input. The key already proves the outer characters and
|
|
14322
|
+
* the length. Names of length at most four are accepted by the caller.
|
|
14323
|
+
* @param slot Slot of the candidate.
|
|
14324
|
+
* @param text Input text.
|
|
14325
|
+
* @param start Start of the span in `text`.
|
|
14326
|
+
* @param length Length of the span.
|
|
14327
|
+
*/
|
|
14328
|
+
function isMidMatchHtml(slot, text, start, length) {
|
|
14329
|
+
let wordIndex = htmlSlotMidOff[slot];
|
|
14330
|
+
let index = start + 2;
|
|
14331
|
+
const end = start + length - 2;
|
|
14332
|
+
while (index + 1 < end) {
|
|
14333
|
+
if ((text.charCodeAt(index) | text.charCodeAt(index + 1) << 16) !== htmlMiddles[wordIndex++]) return false;
|
|
14334
|
+
index += 2;
|
|
14335
|
+
}
|
|
14336
|
+
return index === end || text.charCodeAt(index) === (htmlMiddles[wordIndex] & 65535);
|
|
14337
|
+
}
|
|
14070
14338
|
/**
|
|
14071
14339
|
* `parseNumericEntity` packs its two results into one integer:
|
|
14072
14340
|
* `(consumed << CONSUMED_SHIFT) | codePoint`. The code point occupies the low
|
|
@@ -14080,15 +14348,15 @@ const NUMERIC_CONSUMED_SHIFT = 21;
|
|
|
14080
14348
|
const NUMERIC_CODE_POINT_MASK = 2097151;
|
|
14081
14349
|
const NUMERIC_CONSUMED_OVERFLOW = 2047;
|
|
14082
14350
|
/** Full length, including `&`, when the packed consumed field overflows. */
|
|
14083
|
-
let longNumericConsumed
|
|
14351
|
+
let longNumericConsumed = 0;
|
|
14084
14352
|
/**
|
|
14085
14353
|
* Recover the consumed count before the next numeric parse can overwrite
|
|
14086
14354
|
* `longNumericConsumed`. This avoids allocating a tuple for each reference.
|
|
14087
14355
|
* @param packed Packed result of `parseNumericEntity`.
|
|
14088
14356
|
*/
|
|
14089
|
-
function unpackConsumed
|
|
14357
|
+
function unpackConsumed(packed) {
|
|
14090
14358
|
const consumed = packed >>> NUMERIC_CONSUMED_SHIFT;
|
|
14091
|
-
return consumed === NUMERIC_CONSUMED_OVERFLOW ? longNumericConsumed
|
|
14359
|
+
return consumed === NUMERIC_CONSUMED_OVERFLOW ? longNumericConsumed : consumed;
|
|
14092
14360
|
}
|
|
14093
14361
|
/** ASCII digit values; 0xff marks characters outside the hexadecimal range. */
|
|
14094
14362
|
const numericDigits = /* #__PURE__ */ (() => {
|
|
@@ -14110,7 +14378,7 @@ const numericDigits = /* #__PURE__ */ (() => {
|
|
|
14110
14378
|
* @param offset Index right after the `#`.
|
|
14111
14379
|
* @param isStrict Whether a terminating semicolon is required.
|
|
14112
14380
|
*/
|
|
14113
|
-
function parseNumericEntity
|
|
14381
|
+
function parseNumericEntity(input, offset, isStrict) {
|
|
14114
14382
|
const inputLength = input.length;
|
|
14115
14383
|
let index = offset;
|
|
14116
14384
|
let codePoint = 0;
|
|
@@ -14145,12 +14413,150 @@ function parseNumericEntity$1(input, offset, isStrict) {
|
|
|
14145
14413
|
if (index < inputLength && input.charCodeAt(index) === CHAR_SEMI) consumed += 1;
|
|
14146
14414
|
else if (isStrict) return 0;
|
|
14147
14415
|
if (consumed >= NUMERIC_CONSUMED_OVERFLOW) {
|
|
14148
|
-
longNumericConsumed
|
|
14416
|
+
longNumericConsumed = consumed;
|
|
14149
14417
|
consumed = NUMERIC_CONSUMED_OVERFLOW;
|
|
14150
14418
|
}
|
|
14151
14419
|
return consumed << NUMERIC_CONSUMED_SHIFT | codePoint;
|
|
14152
14420
|
}
|
|
14153
14421
|
/**
|
|
14422
|
+
* Find the longest legacy (semicolon-less) match for the name starting at
|
|
14423
|
+
* `start`, using the per-class legacy length bits. Returns
|
|
14424
|
+
* `slot << 3 | matchLength`, or -1 if there is no match. Only called after
|
|
14425
|
+
* the exact probes failed (the miss path).
|
|
14426
|
+
* @param input Input text.
|
|
14427
|
+
* @param start Start of the name.
|
|
14428
|
+
* @param maxLength Number of available run characters.
|
|
14429
|
+
*/
|
|
14430
|
+
function findLegacySlot(input, start, maxLength) {
|
|
14431
|
+
let legacy = htmlLengthBits[pairIndex(input.charCodeAt(start), input.charCodeAt(start + 1))] >>> 16 & 31;
|
|
14432
|
+
while (legacy !== 0) {
|
|
14433
|
+
const top = 31 - Math.clz32(legacy);
|
|
14434
|
+
legacy ^= 1 << top;
|
|
14435
|
+
if (top + 2 > maxLength) continue;
|
|
14436
|
+
const slot = findSlotHtml(input, start, top + 2);
|
|
14437
|
+
if (slot >= 0 && (htmlSlotValue[slot] & 2) !== 0) return slot << 3 | top + 2;
|
|
14438
|
+
}
|
|
14439
|
+
return -1;
|
|
14440
|
+
}
|
|
14441
|
+
/**
|
|
14442
|
+
* Match a class containing long names without probing all its shorter lengths.
|
|
14443
|
+
* The 32-character window bounds the scan even for invalid or unterminated runs.
|
|
14444
|
+
* Returns `(slot << 6) | consumed`, excluding the `&`, or -1 on a miss.
|
|
14445
|
+
* @param input Input containing the candidate name.
|
|
14446
|
+
* @param start Start of the name.
|
|
14447
|
+
* @param mode Decoding mode, including the rules for legacy matches.
|
|
14448
|
+
*/
|
|
14449
|
+
function findLongClassMatch(input, start, mode) {
|
|
14450
|
+
const length = input.slice(start, start + 32).indexOf(";");
|
|
14451
|
+
if (length - 2 >>> 0 <= 29) {
|
|
14452
|
+
const slot = findSlotHtml(input, start, length);
|
|
14453
|
+
if (slot >= 0) return slot << 6 | length + 1;
|
|
14454
|
+
}
|
|
14455
|
+
if (mode !== DecodingMode$1.Strict) {
|
|
14456
|
+
const packed = findLegacySlot(input, start, Math.min(31, input.length - start));
|
|
14457
|
+
if (packed >= 0) {
|
|
14458
|
+
const length = packed & 7;
|
|
14459
|
+
if (mode !== DecodingMode$1.Attribute || start + length >= input.length || !isEntityInAttributeInvalidEnd$1(input.charCodeAt(start + length))) return packed >> 3 << 6 | length;
|
|
14460
|
+
}
|
|
14461
|
+
}
|
|
14462
|
+
return -1;
|
|
14463
|
+
}
|
|
14464
|
+
/**
|
|
14465
|
+
* The next `&` to resume from after emitting a replacement, given the index
|
|
14466
|
+
* just past it. A leaf the decoders call after every emit: the common
|
|
14467
|
+
* adjacent-entity case (`&<`) skips the `indexOf` C++ call.
|
|
14468
|
+
* @param input Input text.
|
|
14469
|
+
* @param last Index just past the entity that was emitted.
|
|
14470
|
+
*/
|
|
14471
|
+
function nextOffset(input, last) {
|
|
14472
|
+
if (last >= input.length) return -1;
|
|
14473
|
+
return input.charCodeAt(last) === CHAR_AMP ? last : input.indexOf("&", last);
|
|
14474
|
+
}
|
|
14475
|
+
/**
|
|
14476
|
+
* Synchronous HTML decoder, shared by all three decoding modes.
|
|
14477
|
+
* @param input String to decode.
|
|
14478
|
+
* @param mode Decoding mode for named entities.
|
|
14479
|
+
*/
|
|
14480
|
+
function decodeHtmlText(input, mode) {
|
|
14481
|
+
const isLegacyAllowed = mode !== DecodingMode$1.Strict;
|
|
14482
|
+
let offset = input.indexOf("&");
|
|
14483
|
+
if (offset < 0) return input;
|
|
14484
|
+
const inputLength = input.length;
|
|
14485
|
+
let result = "";
|
|
14486
|
+
let last = 0;
|
|
14487
|
+
do {
|
|
14488
|
+
const start = offset + 1;
|
|
14489
|
+
if (start + 1 >= inputLength) break;
|
|
14490
|
+
const c0 = input.charCodeAt(start);
|
|
14491
|
+
if (c0 === CHAR_AMP) {
|
|
14492
|
+
offset = start;
|
|
14493
|
+
continue;
|
|
14494
|
+
}
|
|
14495
|
+
if (c0 === CHAR_NUM) {
|
|
14496
|
+
const packed = parseNumericEntity(input, start + 1, !isLegacyAllowed);
|
|
14497
|
+
const consumed = unpackConsumed(packed);
|
|
14498
|
+
if (consumed === 0) offset = input.indexOf("&", start);
|
|
14499
|
+
else {
|
|
14500
|
+
if (last !== offset) result += input.slice(last, offset);
|
|
14501
|
+
result += codePointToString(packed & NUMERIC_CODE_POINT_MASK);
|
|
14502
|
+
last = offset + consumed;
|
|
14503
|
+
offset = nextOffset(input, last);
|
|
14504
|
+
}
|
|
14505
|
+
continue;
|
|
14506
|
+
}
|
|
14507
|
+
const bits = htmlLengthBits[pairIndex(c0, input.charCodeAt(start + 1))];
|
|
14508
|
+
if ((bits & 32768) !== 0) {
|
|
14509
|
+
const packed = findLongClassMatch(input, start, mode);
|
|
14510
|
+
if (packed >= 0) {
|
|
14511
|
+
if (last !== offset) result += input.slice(last, offset);
|
|
14512
|
+
result += emitHtmlValue(htmlSlotValue[packed >> 6]);
|
|
14513
|
+
last = start + (packed & 63);
|
|
14514
|
+
offset = nextOffset(input, last);
|
|
14515
|
+
} else offset = input.indexOf("&", start);
|
|
14516
|
+
continue;
|
|
14517
|
+
}
|
|
14518
|
+
let probed = bits & 32767;
|
|
14519
|
+
let matched = -1;
|
|
14520
|
+
while (probed !== 0) {
|
|
14521
|
+
const low = probed & -probed;
|
|
14522
|
+
probed ^= low;
|
|
14523
|
+
const length = 33 - Math.clz32(low);
|
|
14524
|
+
const end = start + length;
|
|
14525
|
+
if (end > inputLength) break;
|
|
14526
|
+
const isTerminated = end < inputLength && input.charCodeAt(end) === CHAR_SEMI;
|
|
14527
|
+
if (!(isTerminated || isLegacyAllowed && (bits >>> length + 14 & 1) !== 0)) continue;
|
|
14528
|
+
const slot = findSlotHtml(input, start, length);
|
|
14529
|
+
if (slot < 0) continue;
|
|
14530
|
+
if (isTerminated) {
|
|
14531
|
+
matched = slot << 6 | 32 | length + 1;
|
|
14532
|
+
break;
|
|
14533
|
+
}
|
|
14534
|
+
if ((htmlSlotValue[slot] & 2) !== 0) matched = slot << 6 | length;
|
|
14535
|
+
}
|
|
14536
|
+
if (matched >= 0) {
|
|
14537
|
+
const length = matched & 31;
|
|
14538
|
+
if ((matched & 32) !== 0 || mode !== DecodingMode$1.Attribute || start + length >= inputLength || !isEntityInAttributeInvalidEnd$1(input.charCodeAt(start + length))) {
|
|
14539
|
+
if (last !== offset) result += input.slice(last, offset);
|
|
14540
|
+
result += emitHtmlValue(htmlSlotValue[matched >> 6]);
|
|
14541
|
+
last = start + length;
|
|
14542
|
+
offset = nextOffset(input, last);
|
|
14543
|
+
continue;
|
|
14544
|
+
}
|
|
14545
|
+
}
|
|
14546
|
+
offset = input.indexOf("&", start + 1);
|
|
14547
|
+
} while (offset >= 0);
|
|
14548
|
+
return result + input.slice(last);
|
|
14549
|
+
}
|
|
14550
|
+
/**
|
|
14551
|
+
* Decodes an HTML string.
|
|
14552
|
+
* @param htmlString The string to decode.
|
|
14553
|
+
* @param mode The decoding mode.
|
|
14554
|
+
* @returns The decoded string.
|
|
14555
|
+
*/
|
|
14556
|
+
function decodeHTML(htmlString, mode = DecodingMode$1.Legacy) {
|
|
14557
|
+
return decodeHtmlText(htmlString, mode);
|
|
14558
|
+
}
|
|
14559
|
+
/**
|
|
14154
14560
|
* Decodes an XML string, requiring all entities to be terminated by a
|
|
14155
14561
|
* semicolon.
|
|
14156
14562
|
* @param xmlString The string to decode.
|
|
@@ -14168,8 +14574,8 @@ function decodeXML(xmlString) {
|
|
|
14168
14574
|
let value = "";
|
|
14169
14575
|
const c1 = xmlString.charCodeAt(start);
|
|
14170
14576
|
if (c1 === CHAR_NUM) {
|
|
14171
|
-
const packed = parseNumericEntity
|
|
14172
|
-
consumed = unpackConsumed
|
|
14577
|
+
const packed = parseNumericEntity(xmlString, start + 1, true);
|
|
14578
|
+
consumed = unpackConsumed(packed);
|
|
14173
14579
|
if (consumed !== 0) {
|
|
14174
14580
|
const codePoint = packed & NUMERIC_CODE_POINT_MASK;
|
|
14175
14581
|
value = codePoint - 1 >>> 0 < 55295 ? String.fromCharCode(codePoint) : String.fromCodePoint(replaceCodePointXML$1(codePoint));
|
|
@@ -16609,19 +17015,6 @@ function replaceCodePoint(codePoint) {
|
|
|
16609
17015
|
function replaceCodePointXML(codePoint) {
|
|
16610
17016
|
return isInvalidCodePoint(codePoint) ? 65533 : codePoint;
|
|
16611
17017
|
}
|
|
16612
|
-
/**
|
|
16613
|
-
* Convert the code point of a decoded numeric entity to a string, replacing
|
|
16614
|
-
* invalid values.
|
|
16615
|
-
*
|
|
16616
|
-
* Fast path for plain BMP code points: [1..0x7F] and [0xA0..0xD7FF] pass
|
|
16617
|
-
* `replaceCodePoint` unchanged (no NUL, C1 remap, surrogate, or out-of-range
|
|
16618
|
-
* handling) and fit a single charCode. 0xd760 = 0xD800 (the first surrogate)
|
|
16619
|
-
* - 0xA0.
|
|
16620
|
-
* @param codePoint Unicode code point to convert.
|
|
16621
|
-
*/
|
|
16622
|
-
function codePointToString(codePoint) {
|
|
16623
|
-
return codePoint - 1 >>> 0 < 127 || codePoint - 160 >>> 0 < 55136 ? String.fromCharCode(codePoint) : String.fromCodePoint(replaceCodePoint(codePoint));
|
|
16624
|
-
}
|
|
16625
17018
|
// ../../node_modules/.pnpm/entities@8.1.0/node_modules/entities/dist/internal/decode-shared.js
|
|
16626
17019
|
const BASE91_INVERSE = /* #__PURE__ */ (() => {
|
|
16627
17020
|
const table = /* @__PURE__ */ new Uint8Array(127);
|
|
@@ -16858,31 +17251,6 @@ var CharCodes$1;
|
|
|
16858
17251
|
})(CharCodes$1 || (CharCodes$1 = {}));
|
|
16859
17252
|
/** Bit that needs to be set to convert an upper case ASCII character to lower case */
|
|
16860
17253
|
const TO_LOWER_BIT = 32;
|
|
16861
|
-
const CONSUMED_SHIFT = 21;
|
|
16862
|
-
const CODE_POINT_MASK = 2097151;
|
|
16863
|
-
/**
|
|
16864
|
-
* Reserved consumed field for counts of at least 2047 characters after `&`.
|
|
16865
|
-
* The true count is in `longNumericConsumed`.
|
|
16866
|
-
*/
|
|
16867
|
-
const CONSUMED_OVERFLOW = 2047;
|
|
16868
|
-
/**
|
|
16869
|
-
* Side channel for numeric entities of at least 2048 characters including
|
|
16870
|
-
* `&`. Set by `parseNumericEntity` when its consumed count reaches the
|
|
16871
|
-
* reserved value `CONSUMED_OVERFLOW`; callers read the true count from here.
|
|
16872
|
-
* A module-level slot avoids a tuple allocation on the hot path.
|
|
16873
|
-
*/
|
|
16874
|
-
let longNumericConsumed = 0;
|
|
16875
|
-
/**
|
|
16876
|
-
* Extract the consumed count from a `parseNumericEntity` packed result,
|
|
16877
|
-
* recovering the true length from `longNumericConsumed` when the packed
|
|
16878
|
-
* field contains the sentinel. Read it before the next `parseNumericEntity`
|
|
16879
|
-
* call, which may overwrite the side channel. This helper owns that protocol.
|
|
16880
|
-
* @param packed Packed result of `parseNumericEntity`.
|
|
16881
|
-
*/
|
|
16882
|
-
function unpackConsumed(packed) {
|
|
16883
|
-
const consumed = packed >>> CONSUMED_SHIFT;
|
|
16884
|
-
return consumed === CONSUMED_OVERFLOW ? longNumericConsumed : consumed;
|
|
16885
|
-
}
|
|
16886
17254
|
/**
|
|
16887
17255
|
* Unsigned subtraction trick: (code - lo) >>> 0 wraps negatives to large
|
|
16888
17256
|
* values, so a single `<=` covers the entire [lo..hi] range check.
|
|
@@ -17295,202 +17663,6 @@ function determineBranch(decodeTree, current, nodeIndex, char) {
|
|
|
17295
17663
|
}
|
|
17296
17664
|
return -1;
|
|
17297
17665
|
}
|
|
17298
|
-
/**
|
|
17299
|
-
* Read the decoded value from a trie node.
|
|
17300
|
-
* @param decodeTree The trie.
|
|
17301
|
-
* @param nodeIndex The index of the node.
|
|
17302
|
-
* @param valueLength The length of the value (1, 2, or 3).
|
|
17303
|
-
* @returns The decoded string.
|
|
17304
|
-
*/
|
|
17305
|
-
function readTrieValue(decodeTree, nodeIndex, valueLength) {
|
|
17306
|
-
if (valueLength === 1) return String.fromCharCode(decodeTree[nodeIndex] & BinTrieFlags.VALUE_MASK);
|
|
17307
|
-
if (valueLength === 2) return String.fromCharCode(decodeTree[nodeIndex + 1]);
|
|
17308
|
-
return String.fromCharCode(decodeTree[nodeIndex + 1], decodeTree[nodeIndex + 2]);
|
|
17309
|
-
}
|
|
17310
|
-
/**
|
|
17311
|
-
* Parse a numeric entity (`&#DDD;` or `&#xHHH;`).
|
|
17312
|
-
*
|
|
17313
|
-
* Encodes the result as `(consumed << CONSUMED_SHIFT) | codepoint` (see
|
|
17314
|
-
* the packing comment at the top of the file; overlong entities spill
|
|
17315
|
-
* their length into `longNumericConsumed`). Returns 0 when no digits were
|
|
17316
|
-
* found.
|
|
17317
|
-
*
|
|
17318
|
-
* This is the sync counterpart of the streaming
|
|
17319
|
-
* `EntityDecoder#stateNumericDecimal` / `#stateNumericHex`. Digit parsing
|
|
17320
|
-
* matches those methods; only this packed result needs a value clamp.
|
|
17321
|
-
* @param input The input string.
|
|
17322
|
-
* @param numberStart Index of the `#` character.
|
|
17323
|
-
* @param inputLength Cached `input.length`.
|
|
17324
|
-
*/
|
|
17325
|
-
function parseNumericEntity(input, numberStart, inputLength) {
|
|
17326
|
-
let offset = numberStart + 1;
|
|
17327
|
-
let cp = 0;
|
|
17328
|
-
let digitStart = offset;
|
|
17329
|
-
if (offset < inputLength && (input.charCodeAt(offset) | TO_LOWER_BIT) === CharCodes$1.LOWER_X) {
|
|
17330
|
-
offset += 1;
|
|
17331
|
-
digitStart = offset;
|
|
17332
|
-
while (offset < inputLength) {
|
|
17333
|
-
const char = input.charCodeAt(offset);
|
|
17334
|
-
if (isNumber(char)) cp = cp * 16 + (char - CharCodes$1.ZERO);
|
|
17335
|
-
else if (isHexadecimalCharacter(char)) cp = cp * 16 + ((char | TO_LOWER_BIT) - CharCodes$1.LOWER_A + 10);
|
|
17336
|
-
else break;
|
|
17337
|
-
offset += 1;
|
|
17338
|
-
}
|
|
17339
|
-
} else while (offset < inputLength) {
|
|
17340
|
-
const digit = input.charCodeAt(offset) - CharCodes$1.ZERO;
|
|
17341
|
-
if (digit >>> 0 > 9) break;
|
|
17342
|
-
cp = cp * 10 + digit;
|
|
17343
|
-
offset += 1;
|
|
17344
|
-
}
|
|
17345
|
-
if (offset === digitStart) return 0;
|
|
17346
|
-
if (offset < inputLength && input.charCodeAt(offset) === CharCodes$1.SEMI) offset += 1;
|
|
17347
|
-
if (cp > 1114111) cp = 1114112;
|
|
17348
|
-
let consumed = offset - numberStart;
|
|
17349
|
-
if (consumed >= CONSUMED_OVERFLOW) {
|
|
17350
|
-
longNumericConsumed = consumed;
|
|
17351
|
-
consumed = CONSUMED_OVERFLOW;
|
|
17352
|
-
}
|
|
17353
|
-
return consumed << CONSUMED_SHIFT | cp;
|
|
17354
|
-
}
|
|
17355
|
-
/**
|
|
17356
|
-
* Decode all entities in `input` using the HTML trie.
|
|
17357
|
-
*
|
|
17358
|
-
* Hard-wired to `htmlDecodeTree`: the inline root navigation below assumes
|
|
17359
|
-
* the HTML root's jump-table shape, so this must not be generalized to
|
|
17360
|
-
* other tries (the XML trie's dictionary root would silently match no
|
|
17361
|
-
* entities — `decodeXML` has its own hand-coded fast path instead).
|
|
17362
|
-
* @param input The string to decode.
|
|
17363
|
-
* @param isStrict Only match semicolon-terminated entities.
|
|
17364
|
-
* @param isAttribute Whether to apply attribute-specific parsing rules (disallowing certain non-semicolon terminators).
|
|
17365
|
-
* @returns The decoded string.
|
|
17366
|
-
*/
|
|
17367
|
-
function decodeWithTrie(input, isStrict, isAttribute) {
|
|
17368
|
-
const decodeTree = htmlDecodeTree;
|
|
17369
|
-
let offset = input.indexOf("&");
|
|
17370
|
-
if (offset < 0) return input;
|
|
17371
|
-
const inputLength = input.length;
|
|
17372
|
-
let chunkStart = 0;
|
|
17373
|
-
let result = "";
|
|
17374
|
-
const root = decodeTree[0];
|
|
17375
|
-
const rootJumpOffset = root & BinTrieFlags.JUMP_TABLE;
|
|
17376
|
-
const rootBranchCount = (root & BinTrieFlags.BRANCH_LENGTH) >> 7;
|
|
17377
|
-
do {
|
|
17378
|
-
const entityStart = offset + 1;
|
|
17379
|
-
const firstChar = input.charCodeAt(entityStart);
|
|
17380
|
-
let consumed;
|
|
17381
|
-
let value;
|
|
17382
|
-
if (firstChar === CharCodes$1.NUM) {
|
|
17383
|
-
const packed = parseNumericEntity(input, entityStart, inputLength);
|
|
17384
|
-
consumed = unpackConsumed(packed);
|
|
17385
|
-
if (isStrict && consumed > 0 && input.charCodeAt(entityStart + consumed - 1) !== CharCodes$1.SEMI) consumed = 0;
|
|
17386
|
-
value = consumed === 0 ? "" : codePointToString(packed & CODE_POINT_MASK);
|
|
17387
|
-
} else if (isAlpha(firstChar)) {
|
|
17388
|
-
consumed = 0;
|
|
17389
|
-
value = "";
|
|
17390
|
-
const rootSlotIndex = firstChar - rootJumpOffset;
|
|
17391
|
-
let nodeIndex;
|
|
17392
|
-
if (rootSlotIndex >>> 0 < rootBranchCount) {
|
|
17393
|
-
const stored = decodeTree[1 + rootSlotIndex];
|
|
17394
|
-
nodeIndex = stored === 0 ? -1 : rootBranchCount + stored & 65535;
|
|
17395
|
-
} else nodeIndex = -1;
|
|
17396
|
-
let bestNodeIndex = 0;
|
|
17397
|
-
let bestValueLength = 0;
|
|
17398
|
-
let current = nodeIndex < 0 ? 0 : decodeTree[nodeIndex];
|
|
17399
|
-
let index = entityStart + 1;
|
|
17400
|
-
trie: while (index < inputLength) {
|
|
17401
|
-
while ((current & (BinTrieFlags.VALUE_LENGTH | BinTrieFlags.FLAG13)) === 0 && (current & BinTrieFlags.JUMP_TABLE) !== 0) {
|
|
17402
|
-
const jumpOffset = current & BinTrieFlags.JUMP_TABLE;
|
|
17403
|
-
const branchCount = (current & BinTrieFlags.BRANCH_LENGTH) >> 7;
|
|
17404
|
-
if (branchCount === 0) {
|
|
17405
|
-
if (input.charCodeAt(index) !== jumpOffset) break trie;
|
|
17406
|
-
nodeIndex += 1;
|
|
17407
|
-
} else {
|
|
17408
|
-
const slot = input.charCodeAt(index) - jumpOffset;
|
|
17409
|
-
if (slot >>> 0 >= branchCount) break trie;
|
|
17410
|
-
const stored = decodeTree[nodeIndex + 1 + slot];
|
|
17411
|
-
if (stored === 0) break trie;
|
|
17412
|
-
nodeIndex = nodeIndex + branchCount + stored & 65535;
|
|
17413
|
-
}
|
|
17414
|
-
current = decodeTree[nodeIndex];
|
|
17415
|
-
index += 1;
|
|
17416
|
-
if (index >= inputLength) break trie;
|
|
17417
|
-
}
|
|
17418
|
-
if ((current & (BinTrieFlags.VALUE_LENGTH | BinTrieFlags.FLAG13)) === BinTrieFlags.FLAG13) {
|
|
17419
|
-
const runLength = (current & BinTrieFlags.BRANCH_LENGTH) >> 7;
|
|
17420
|
-
if (input.charCodeAt(index) !== (current & BinTrieFlags.JUMP_TABLE)) break;
|
|
17421
|
-
index += 1;
|
|
17422
|
-
const remaining = runLength - 1;
|
|
17423
|
-
let wordIndex = nodeIndex + 1;
|
|
17424
|
-
let charIndexInPacked = 0;
|
|
17425
|
-
for (; charIndexInPacked + 1 < remaining; charIndexInPacked += 2) {
|
|
17426
|
-
const packed = decodeTree[wordIndex];
|
|
17427
|
-
if (input.charCodeAt(index) !== (packed & 255)) break trie;
|
|
17428
|
-
index += 1;
|
|
17429
|
-
if (input.charCodeAt(index) !== (packed >> 8 & 255)) break trie;
|
|
17430
|
-
index += 1;
|
|
17431
|
-
wordIndex += 1;
|
|
17432
|
-
}
|
|
17433
|
-
if (charIndexInPacked < remaining) {
|
|
17434
|
-
if (input.charCodeAt(index) !== (decodeTree[wordIndex] & 255)) break;
|
|
17435
|
-
index += 1;
|
|
17436
|
-
}
|
|
17437
|
-
nodeIndex += 1 + (runLength >> 1);
|
|
17438
|
-
current = decodeTree[nodeIndex];
|
|
17439
|
-
continue;
|
|
17440
|
-
}
|
|
17441
|
-
const valueLength = current >>> 14;
|
|
17442
|
-
const char = input.charCodeAt(index);
|
|
17443
|
-
if (valueLength !== 0) {
|
|
17444
|
-
if (char === CharCodes$1.SEMI) {
|
|
17445
|
-
consumed = index - entityStart + 1;
|
|
17446
|
-
value = valueLength === 1 ? String.fromCharCode(current & BinTrieFlags.VALUE_MASK) : readTrieValue(decodeTree, nodeIndex, valueLength);
|
|
17447
|
-
break;
|
|
17448
|
-
}
|
|
17449
|
-
if (!isStrict && (current & BinTrieFlags.FLAG13) === 0) {
|
|
17450
|
-
consumed = index - entityStart;
|
|
17451
|
-
bestNodeIndex = nodeIndex;
|
|
17452
|
-
bestValueLength = valueLength;
|
|
17453
|
-
}
|
|
17454
|
-
if (valueLength === 1) break;
|
|
17455
|
-
}
|
|
17456
|
-
const next = determineBranch(decodeTree, current, nodeIndex + (valueLength || 1), char);
|
|
17457
|
-
if (next < 0) break;
|
|
17458
|
-
nodeIndex = next;
|
|
17459
|
-
current = decodeTree[nodeIndex];
|
|
17460
|
-
index += 1;
|
|
17461
|
-
}
|
|
17462
|
-
if (value === "") {
|
|
17463
|
-
const finalVL = current >>> 14;
|
|
17464
|
-
if (finalVL !== 0 && !isStrict && (current & BinTrieFlags.FLAG13) === 0) {
|
|
17465
|
-
consumed = index - entityStart;
|
|
17466
|
-
bestNodeIndex = nodeIndex;
|
|
17467
|
-
bestValueLength = finalVL;
|
|
17468
|
-
}
|
|
17469
|
-
if (consumed > 0) value = readTrieValue(decodeTree, bestNodeIndex, bestValueLength);
|
|
17470
|
-
}
|
|
17471
|
-
} else {
|
|
17472
|
-
consumed = 0;
|
|
17473
|
-
value = "";
|
|
17474
|
-
}
|
|
17475
|
-
if (consumed === 0 || isAttribute && firstChar !== CharCodes$1.NUM && input.charCodeAt(entityStart + consumed - 1) !== CharCodes$1.SEMI && entityStart + consumed < inputLength && isEntityInAttributeInvalidEnd(input.charCodeAt(entityStart + consumed))) offset = entityStart;
|
|
17476
|
-
else {
|
|
17477
|
-
if (chunkStart < offset) result += input.slice(chunkStart, offset);
|
|
17478
|
-
result += value;
|
|
17479
|
-
offset = chunkStart = entityStart + consumed;
|
|
17480
|
-
}
|
|
17481
|
-
if (input.charCodeAt(offset) !== CharCodes$1.AMP) offset = input.indexOf("&", offset);
|
|
17482
|
-
} while (offset >= 0);
|
|
17483
|
-
return result + input.slice(chunkStart);
|
|
17484
|
-
}
|
|
17485
|
-
/**
|
|
17486
|
-
* Decodes an HTML string.
|
|
17487
|
-
* @param htmlString The string to decode.
|
|
17488
|
-
* @param mode The decoding mode.
|
|
17489
|
-
* @returns The decoded string.
|
|
17490
|
-
*/
|
|
17491
|
-
function decodeHTML(htmlString, mode = DecodingMode.Legacy) {
|
|
17492
|
-
return decodeWithTrie(htmlString, mode === DecodingMode.Strict, mode === DecodingMode.Attribute);
|
|
17493
|
-
}
|
|
17494
17666
|
// ../../node_modules/.pnpm/htmlparser2@12.0.0/node_modules/htmlparser2/dist/Tokenizer.js
|
|
17495
17667
|
var CharCodes;
|
|
17496
17668
|
(function(CharCodes) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weapp-vite/miniprogram-automator",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.5.6-dev.
|
|
4
|
+
"version": "1.5.6-dev.20261121.1",
|
|
5
5
|
"description": "完全兼容微信 miniprogram-automator 的现代化替代实现",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@types/ws": "^8.18.2",
|
|
52
|
-
"@weapp-vite/qr": "1.2.6-dev.
|
|
52
|
+
"@weapp-vite/qr": "1.2.6-dev.20261121.1",
|
|
53
53
|
"obug": "^3.0.0",
|
|
54
54
|
"ws": "^8.23.0"
|
|
55
55
|
},
|
|
@@ -69,9 +69,9 @@
|
|
|
69
69
|
},
|
|
70
70
|
"repoctlSnapshot": {
|
|
71
71
|
"kind": "nightly",
|
|
72
|
-
"commit": "
|
|
73
|
-
"buildId": "
|
|
74
|
-
"identityKey": "
|
|
72
|
+
"commit": "dc7c2df637732f85aa3f00aab8ea177e6a248a45",
|
|
73
|
+
"buildId": "44859834569-1",
|
|
74
|
+
"identityKey": "3877da22075f3d3a54622dac72998faeecce7424a36dcd8dbbc6f52b4b051ba2",
|
|
75
75
|
"tag": "snapshot-nightly"
|
|
76
76
|
},
|
|
77
77
|
"scripts": {
|