@validate.qa/runner 1.0.85 → 1.0.87
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/cli.js +602 -2348
- package/dist/cli.mjs +602 -2348
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -980,10 +980,11 @@ var require_mobile_source_parser = __commonJS({
|
|
|
980
980
|
function extractIOS(attrs) {
|
|
981
981
|
const role = nonEmpty3(attrs.type) ?? "XCUIElementTypeOther";
|
|
982
982
|
const name = nonEmpty3(attrs.name);
|
|
983
|
+
const identifier = nonEmpty3(attrs.identifier) ?? nonEmpty3(attrs.accessibilityIdentifier);
|
|
983
984
|
const labelAttr = nonEmpty3(attrs.label);
|
|
984
985
|
const value = nonEmpty3(attrs.value);
|
|
985
986
|
const label = name ?? labelAttr ?? value;
|
|
986
|
-
const accessibilityId = name;
|
|
987
|
+
const accessibilityId = identifier ?? name;
|
|
987
988
|
const text = labelAttr ?? (isStateValueRole(role) ? void 0 : value);
|
|
988
989
|
const bounds = parseIOSBounds(attrs);
|
|
989
990
|
const enabled = attrBoolDefaultTrue(attrs.enabled);
|
|
@@ -75947,6 +75948,34 @@ ${existingScreens.slice(0, 100).map((s) => `- ${s.screenId}${s.name ? ` "${s.nam
|
|
|
75947
75948
|
latest = boundaryResolved;
|
|
75948
75949
|
lastSnapshotIteration = iterationForObservation;
|
|
75949
75950
|
if (boundary.kind === "transient_external") {
|
|
75951
|
+
const isHostHomeShell = /springboard|systemui/i.test(boundary.owner);
|
|
75952
|
+
if (isHostHomeShell) {
|
|
75953
|
+
log2(` Host shell detected from ${source}: ${boundary.owner}; activating ${boundary.targetAppId} so exploration can continue.`);
|
|
75954
|
+
try {
|
|
75955
|
+
await driver.launchApp();
|
|
75956
|
+
const snap = await driver.snapshot();
|
|
75957
|
+
const recovered = buildResolved(snap.xml, snap.windowSize, snap.screenSignal);
|
|
75958
|
+
if (recovered) {
|
|
75959
|
+
const recoveredBoundary = (0, mobile_boundary_js_1.classifyMobileScreenBoundary)(recovered.signal, targetAppId, platform3);
|
|
75960
|
+
if (recoveredBoundary.kind === "target" || recoveredBoundary.kind === "unknown") {
|
|
75961
|
+
const enriched = await enrichResolvedSnapshotWithHybridWeb(recovered, driver, credentialValuesForRedaction, log2, platform3, targetAppId, hybridContextCache, true, source !== "seed snapshot" && source !== "mobile_snapshot");
|
|
75962
|
+
latest = enriched;
|
|
75963
|
+
lastSnapshotIteration = iterationForObservation;
|
|
75964
|
+
const screenId = ingestSnapshot(enriched, iterationForObservation);
|
|
75965
|
+
captureScreenshot(enriched.replacementScreenshot ?? snap.screenshot, screenId);
|
|
75966
|
+
return {
|
|
75967
|
+
observation: enriched.observation,
|
|
75968
|
+
screenId,
|
|
75969
|
+
transientExternal: true,
|
|
75970
|
+
externalOwner: boundary.owner
|
|
75971
|
+
};
|
|
75972
|
+
}
|
|
75973
|
+
}
|
|
75974
|
+
} catch (err) {
|
|
75975
|
+
(0, mobile_driver_errors_js_1.rethrowIfTerminalMobileDriverError)(err);
|
|
75976
|
+
log2(` Failed to recover from host shell ${boundary.owner}: ${err instanceof Error ? err.message : String(err)}`);
|
|
75977
|
+
}
|
|
75978
|
+
}
|
|
75950
75979
|
log2(` System overlay detected from ${source}: ${boundary.owner}; not adding it to target-app survey evidence.`);
|
|
75951
75980
|
return {
|
|
75952
75981
|
observation: `${boundaryResolved.observation}${(0, mobile_boundary_js_1.mobileBoundaryNote)(boundary)}`,
|
|
@@ -76164,6 +76193,7 @@ ${existingScreens.slice(0, 100).map((s) => `- ${s.screenId}${s.name ? ` "${s.nam
|
|
|
76164
76193
|
let summary = "";
|
|
76165
76194
|
let truncated = false;
|
|
76166
76195
|
let truncatedReason;
|
|
76196
|
+
const emptyUiTreeStreak = { count: 0 };
|
|
76167
76197
|
let finishRedirects = 0;
|
|
76168
76198
|
let lastFinishBreadthRemainingItems = null;
|
|
76169
76199
|
let lastFinishBreadthProgressMark = null;
|
|
@@ -76502,10 +76532,17 @@ Exploration complete: ${summary}`);
|
|
|
76502
76532
|
redactionCredentials: credentialValuesForRedaction,
|
|
76503
76533
|
authTracker,
|
|
76504
76534
|
inbox: inboxEnabled && inboxState && inboxReader ? { state: inboxState, reader: inboxReader } : null,
|
|
76505
|
-
allowRelaunch: !preserveAppDataForTools
|
|
76535
|
+
allowRelaunch: !preserveAppDataForTools,
|
|
76536
|
+
emptyUiTreeStreak
|
|
76506
76537
|
});
|
|
76507
76538
|
pushResult(handled);
|
|
76508
76539
|
const handledRecord = handled && typeof handled === "object" ? handled : null;
|
|
76540
|
+
if (handledRecord?.permanent === true && handledRecord?.emptyUiTreeStreak) {
|
|
76541
|
+
explorationComplete = true;
|
|
76542
|
+
summary = typeof handledRecord.reason === "string" && handledRecord.reason.trim() ? handledRecord.reason : "Accessibility tree remained empty after repeated Appium observations; exploration stopped early.";
|
|
76543
|
+
log2(`
|
|
76544
|
+
Stopping Phase 1 early: empty UI tree thrash (streak=${handledRecord.emptyUiTreeStreak}).`);
|
|
76545
|
+
}
|
|
76509
76546
|
const navigationWasAttempted = handledRecord?.ok !== false || Object.prototype.hasOwnProperty.call(handledRecord ?? {}, "screenId") || Object.prototype.hasOwnProperty.call(handledRecord ?? {}, "observation");
|
|
76510
76547
|
if (DEVICE_MUTATION_BARRIER_TOOLS.has(toolName) && navigationWasAttempted) {
|
|
76511
76548
|
navigationBarrierTool = toolName;
|
|
@@ -76594,14 +76631,24 @@ Exploration complete: ${summary}`);
|
|
|
76594
76631
|
}
|
|
76595
76632
|
return result;
|
|
76596
76633
|
}
|
|
76634
|
+
var MAX_EMPTY_UI_TREE_STREAK = 3;
|
|
76597
76635
|
async function dispatchMobileTool(args) {
|
|
76598
|
-
const { toolName, toolArgs, iteration, driver, state: state2, enableRecordJourney, latest, buildResolved, absorbResolvedObservation, resolveRef, resolveHybridRef, currentBoundary, collectedTransitions, counters, journeys, log: log2, credentials, redactionCredentials, authTracker, inbox, allowRelaunch } = args;
|
|
76636
|
+
const { toolName, toolArgs, iteration, driver, state: state2, enableRecordJourney, latest, buildResolved, absorbResolvedObservation, resolveRef, resolveHybridRef, currentBoundary, collectedTransitions, counters, journeys, log: log2, credentials, redactionCredentials, authTracker, inbox, allowRelaunch, emptyUiTreeStreak } = args;
|
|
76637
|
+
const noteEmptyUiTree = () => {
|
|
76638
|
+
emptyUiTreeStreak.count += 1;
|
|
76639
|
+
return emptyUiTreeStreak.count;
|
|
76640
|
+
};
|
|
76641
|
+
const clearEmptyUiTreeStreak = () => {
|
|
76642
|
+
emptyUiTreeStreak.count = 0;
|
|
76643
|
+
};
|
|
76599
76644
|
const absorbActionResult = (actionResult, source, preferCredentialSecondary = false) => {
|
|
76600
76645
|
(0, mobile_driver_errors_js_1.throwIfTerminalMobileActionFailure)(actionResult, source);
|
|
76601
76646
|
const resolved = buildResolved(actionResult.source, latest()?.screen.windowSize ?? null, actionResult.screenSignal);
|
|
76602
76647
|
if (!resolved) {
|
|
76648
|
+
noteEmptyUiTree();
|
|
76603
76649
|
return Promise.resolve({ observation: "(no UI tree returned)", screenId: null });
|
|
76604
76650
|
}
|
|
76651
|
+
clearEmptyUiTreeStreak();
|
|
76605
76652
|
return absorbResolvedObservation(resolved, actionResult.screenshot, iteration, source, preferCredentialSecondary);
|
|
76606
76653
|
};
|
|
76607
76654
|
const currentAuthSurface = () => {
|
|
@@ -76631,8 +76678,17 @@ Exploration complete: ${summary}`);
|
|
|
76631
76678
|
const snap = await driver.snapshot();
|
|
76632
76679
|
const resolved = buildResolved(snap.xml, snap.windowSize, snap.screenSignal);
|
|
76633
76680
|
if (!resolved) {
|
|
76634
|
-
|
|
76681
|
+
const streak = noteEmptyUiTree();
|
|
76682
|
+
log2(` Snapshot returned no UI tree (empty streak ${streak}/${MAX_EMPTY_UI_TREE_STREAK}).`);
|
|
76683
|
+
return {
|
|
76684
|
+
ok: false,
|
|
76685
|
+
error: "snapshot returned no UI tree",
|
|
76686
|
+
emptyUiTreeStreak: streak,
|
|
76687
|
+
permanent: streak >= MAX_EMPTY_UI_TREE_STREAK,
|
|
76688
|
+
reason: streak >= MAX_EMPTY_UI_TREE_STREAK ? "Appium repeatedly returned an empty accessibility tree after settle/activate. Stop relaunch thrash \u2014 call finish_exploration with evidence you have, or abort. This is almost always a session/device/app-start failure, not missing product screens." : "No accessibility tree yet. Prefer one mobile_snapshot after a short wait over repeated relaunches."
|
|
76689
|
+
};
|
|
76635
76690
|
}
|
|
76691
|
+
clearEmptyUiTreeStreak();
|
|
76636
76692
|
const absorbed = await absorbResolvedObservation(resolved, snap.screenshot, iteration, "mobile_snapshot");
|
|
76637
76693
|
if (absorbed.screenId) {
|
|
76638
76694
|
const elementCount = state2.getScreen(absorbed.screenId)?.elements.length ?? resolved.screen.elements.length;
|
|
@@ -77005,14 +77061,30 @@ Exploration complete: ${summary}`);
|
|
|
77005
77061
|
note: "Relaunch refused under preserve policy."
|
|
77006
77062
|
};
|
|
77007
77063
|
}
|
|
77064
|
+
if (emptyUiTreeStreak.count >= MAX_EMPTY_UI_TREE_STREAK) {
|
|
77065
|
+
return {
|
|
77066
|
+
ok: false,
|
|
77067
|
+
error: `mobile_relaunch refused: accessibility tree has been empty for ${emptyUiTreeStreak.count} consecutive observations. Call finish_exploration or stop \u2014 further relaunches will not recover a dead session/app paint.`,
|
|
77068
|
+
permanent: true,
|
|
77069
|
+
emptyUiTreeStreak: emptyUiTreeStreak.count
|
|
77070
|
+
};
|
|
77071
|
+
}
|
|
77008
77072
|
authTracker?.noteInterveningMutation(iteration);
|
|
77009
77073
|
await driver.relaunch();
|
|
77010
77074
|
log2(" Relaunched app for hermetic reset.");
|
|
77011
77075
|
const snap = await driver.snapshot();
|
|
77012
77076
|
const resolved = buildResolved(snap.xml, snap.windowSize, snap.screenSignal);
|
|
77013
77077
|
if (!resolved) {
|
|
77014
|
-
|
|
77078
|
+
const streak = noteEmptyUiTree();
|
|
77079
|
+
log2(` Relaunch yielded no UI tree (empty streak ${streak}/${MAX_EMPTY_UI_TREE_STREAK}).`);
|
|
77080
|
+
return {
|
|
77081
|
+
ok: true,
|
|
77082
|
+
note: "relaunched; no UI tree returned \u2014 call mobile_snapshot.",
|
|
77083
|
+
emptyUiTreeStreak: streak,
|
|
77084
|
+
permanent: streak >= MAX_EMPTY_UI_TREE_STREAK
|
|
77085
|
+
};
|
|
77015
77086
|
}
|
|
77087
|
+
clearEmptyUiTreeStreak();
|
|
77016
77088
|
const absorbed = await absorbResolvedObservation(resolved, snap.screenshot, iteration, "mobile_relaunch");
|
|
77017
77089
|
return {
|
|
77018
77090
|
ok: true,
|
|
@@ -80244,6 +80316,10 @@ var require_mobile_discovery_prompts = __commonJS({
|
|
|
80244
80316
|
"use strict";
|
|
80245
80317
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
80246
80318
|
exports.MOBILE_SCENARIO_SYSTEM_PROMPT = exports.MOBILE_SURVEY_SYSTEM_PROMPT = void 0;
|
|
80319
|
+
exports.isScrubbedPlaceholderName = isScrubbedPlaceholderName;
|
|
80320
|
+
exports.isOpaqueMobileScreenName = isOpaqueMobileScreenName;
|
|
80321
|
+
exports.isPackageLeafAppCatchAll = isPackageLeafAppCatchAll;
|
|
80322
|
+
exports.isLowValueMobileAutoDeepFeature = isLowValueMobileAutoDeepFeature;
|
|
80247
80323
|
exports.formatMobileEvidenceForPlanner = formatMobileEvidenceForPlanner;
|
|
80248
80324
|
exports.transitionSourceLabel = transitionSourceLabel;
|
|
80249
80325
|
exports.buildMobileSiteMap = buildMobileSiteMap;
|
|
@@ -80524,6 +80600,32 @@ Each entry is exactly one of:
|
|
|
80524
80600
|
}
|
|
80525
80601
|
return /^[a-z][\w$]*(?:\.[a-z][\w$]*)+(?:#[a-z0-9_. -]+)?$/i.test(trimmed);
|
|
80526
80602
|
}
|
|
80603
|
+
function isPackageLeafAppCatchAll(name, appId) {
|
|
80604
|
+
const trimmed = name.trim();
|
|
80605
|
+
if (!trimmed || !appId?.trim())
|
|
80606
|
+
return false;
|
|
80607
|
+
const match = trimmed.match(/^(.+?)\s+app$/i);
|
|
80608
|
+
if (!match)
|
|
80609
|
+
return false;
|
|
80610
|
+
const brand = match[1].trim();
|
|
80611
|
+
if (!brand || /\s/.test(brand))
|
|
80612
|
+
return false;
|
|
80613
|
+
const leaf = appId.split(".").map((p) => p.trim()).filter(Boolean).pop();
|
|
80614
|
+
if (!leaf)
|
|
80615
|
+
return false;
|
|
80616
|
+
const normalize = (s) => s.replace(/[^a-z0-9]/gi, "").toLowerCase();
|
|
80617
|
+
return normalize(brand) === normalize(leaf);
|
|
80618
|
+
}
|
|
80619
|
+
function isLowValueMobileAutoDeepFeature(name, appId) {
|
|
80620
|
+
const trimmed = name.trim();
|
|
80621
|
+
if (!trimmed)
|
|
80622
|
+
return true;
|
|
80623
|
+
if (isScrubbedPlaceholderName(trimmed) || isOpaqueMobileScreenName(trimmed, appId))
|
|
80624
|
+
return true;
|
|
80625
|
+
if (isPackageLeafAppCatchAll(trimmed, appId))
|
|
80626
|
+
return true;
|
|
80627
|
+
return false;
|
|
80628
|
+
}
|
|
80527
80629
|
function humanizeToken(token) {
|
|
80528
80630
|
const spaced = token.replace(/[_-]+/g, " ").replace(/([a-z0-9])([A-Z])/g, "$1 $2").trim();
|
|
80529
80631
|
if (!spaced)
|
|
@@ -81555,6 +81657,7 @@ var require_mobile_generator = __commonJS({
|
|
|
81555
81657
|
exports.coalesceRepeatedTaps = coalesceRepeatedTaps;
|
|
81556
81658
|
exports.elideNoOpDetours = elideNoOpDetours;
|
|
81557
81659
|
exports.mobileActionsToPseudoPlaywright = mobileActionsToPseudoPlaywright;
|
|
81660
|
+
exports.isEphemeralContentAssertText = isEphemeralContentAssertText;
|
|
81558
81661
|
exports.evaluateMobileAssertionStrength = evaluateMobileAssertionStrength;
|
|
81559
81662
|
exports.prepareMobileScenarioAppState = prepareMobileScenarioAppState;
|
|
81560
81663
|
exports.runMobileGeneratePhase = runMobileGeneratePhase;
|
|
@@ -82015,15 +82118,20 @@ ${hybridSkeleton.join("\n")}`;
|
|
|
82015
82118
|
- Every element is addressed by a ref like e1, e2. Refs are ONLY valid for the most recent mobile_snapshot. Re-snapshot after every action that changes the screen, then use the NEW refs.
|
|
82016
82119
|
- mobile_tap/mobile_type/mobile_clear take a ref; the loop resolves it to coordinates AND records the durable locator for replay \u2014 you never pass coordinates.
|
|
82017
82120
|
|
|
82018
|
-
## Your job
|
|
82121
|
+
## Your job \u2014 feature fidelity (non-negotiable)
|
|
82122
|
+
The scenario name + goal + steps describe ONE product behavior from survey/discovery. The generated test MUST implement that behavior on THIS app \u2014 not a random walk through tabs.
|
|
82123
|
+
|
|
82019
82124
|
1. mobile_snapshot the current screen.
|
|
82020
|
-
2. Execute the scenario's steps using the real UI: tap
|
|
82021
|
-
3. COMPLETE THE ACTION the scenario is about \u2014 do not stop half-way
|
|
82022
|
-
|
|
82023
|
-
-
|
|
82024
|
-
-
|
|
82025
|
-
|
|
82026
|
-
|
|
82125
|
+
2. Execute the scenario's steps using the real UI: tap the controls that perform the goal, fill fields (mobile_type), submit, navigate to the destination named in the goal.
|
|
82126
|
+
3. COMPLETE THE ACTION the scenario is about \u2014 do not stop half-way:
|
|
82127
|
+
- Form scenarios (sign in, sign up, search, create, change password, edit profile): you MUST commit \u2014 tap submit/primary OR mobile_submit_keyboard. Filling alone is NOT enough. Opening a form without typing is NOT enough for mutation goals.
|
|
82128
|
+
- Content actions (like, share, follow, bookmark, download, \u2026): you MUST tap the control that performs that action \u2014 tab thrash / swipes alone are WRONG.
|
|
82129
|
+
- Navigation scenarios: you MUST land on the destination and assert something unique to it.
|
|
82130
|
+
4. PROVE the outcome with an assert tool that matches the scenario \u2014 not ambient chrome:
|
|
82131
|
+
- mobile_assert_visible({ref}) / mobile_assert_text({ref, expected})
|
|
82132
|
+
- After sign-in \u2192 signed-in product signal; after like \u2192 liked/unlike control or durable like state; after open Settings \u2192 a settings-specific control.
|
|
82133
|
+
- Do NOT assert bottom-nav tab labels alone, notification badge counts ("N unread"), or one-time empty-state CTAs as the scenario outcome.
|
|
82134
|
+
5. Call finish_generate with verified:true ONLY if you completed the goal AND asserted a matching durable outcome. If the app cannot complete the goal, finish with verified:false and explain \u2014 never invent a green path from unrelated screens.
|
|
82027
82135
|
|
|
82028
82136
|
## Rules
|
|
82029
82137
|
- Re-snapshot before every assertion so the ref is fresh.
|
|
@@ -82074,7 +82182,7 @@ ${stepLines || " (no explicit steps \u2014 explore the goal directly)"}
|
|
|
82074
82182
|
Expected outcomes to PROVE with assert tools:
|
|
82075
82183
|
${outcomeLines || " - The target screen is reached and a stable element is visible."}
|
|
82076
82184
|
|
|
82077
|
-
Start by calling mobile_snapshot, then execute the steps
|
|
82185
|
+
Start by calling mobile_snapshot, then execute ONLY the steps needed for this goal \u2014 no tab thrash, no unrelated screens. Every recorded action becomes a permanent test step. Finish with at least one assert that proves THIS goal's outcome (from Expected outcomes), then finish_generate. If you cannot perform the goal on this app build, finish_generate with verified:false rather than a fake green path.`;
|
|
82078
82186
|
}
|
|
82079
82187
|
function buildStatePacket(input) {
|
|
82080
82188
|
const { scenario, iteration, maxIterations, latestObservation, assertCount, actionCount } = input;
|
|
@@ -83541,6 +83649,84 @@ ${statePacket}`, redactionCredentials) },
|
|
|
83541
83649
|
"element-hidden",
|
|
83542
83650
|
"screen-visible"
|
|
83543
83651
|
]);
|
|
83652
|
+
var CONTENT_ACTION_VERB_RE = /\b(like|unlike|favorite|favourite|unfavorite|unfavourite|heart|unheart|follow|unfollow|share|repost|retweet|bookmark|unbookmark|save\s+to|download|subscribe|unsubscribe|block|report|unpin|pin\s+(?:post|item|message|tweet)|mute|unmute|react|upvote|downvote|clap|boost)\b/i;
|
|
83653
|
+
var NAV_CHROME_TAP_RE = /\b(home|you|profile|search|settings|notifications?|inbox|messages?|explore|library|more|menu|tab|bottom\s*nav|videos?|create|feed)\b/i;
|
|
83654
|
+
var VOLATILE_BADGE_ASSERT_RE = /\b\d+\s*(unread|notifications?|messages?|likes?|followers?|comments?|views?)\b|\bunread\b.*\b\d+\b/i;
|
|
83655
|
+
function isContentActionScenario(scenario) {
|
|
83656
|
+
const text = scenarioText(scenario);
|
|
83657
|
+
if (!CONTENT_ACTION_VERB_RE.test(text))
|
|
83658
|
+
return false;
|
|
83659
|
+
if (/\b(view|see|show|open|browse|list|count)\s+(the\s+)?(likes?|followers?|shares?|bookmarks?)\b/i.test(text)) {
|
|
83660
|
+
return false;
|
|
83661
|
+
}
|
|
83662
|
+
return true;
|
|
83663
|
+
}
|
|
83664
|
+
function isContentActionTap(action) {
|
|
83665
|
+
if (action.type !== "TAP")
|
|
83666
|
+
return false;
|
|
83667
|
+
const textForAction = actionText(action);
|
|
83668
|
+
if (NAV_CHROME_TAP_RE.test(textForAction) && !CONTENT_ACTION_VERB_RE.test(textForAction)) {
|
|
83669
|
+
return false;
|
|
83670
|
+
}
|
|
83671
|
+
return CONTENT_ACTION_VERB_RE.test(textForAction);
|
|
83672
|
+
}
|
|
83673
|
+
function isProductiveScenarioAction(action, scenarioTextLower = "") {
|
|
83674
|
+
if (action.type === "TYPE" || action.type === "CLEAR")
|
|
83675
|
+
return true;
|
|
83676
|
+
if (action.type === "TAP") {
|
|
83677
|
+
const t = actionText(action);
|
|
83678
|
+
if (CONTENT_ACTION_VERB_RE.test(t) || isFormCommitAction(action) || isCredentialSubmitTap(action)) {
|
|
83679
|
+
return true;
|
|
83680
|
+
}
|
|
83681
|
+
if (NAV_CHROME_TAP_RE.test(t)) {
|
|
83682
|
+
if (!scenarioTextLower)
|
|
83683
|
+
return false;
|
|
83684
|
+
const chromeWords = t.match(/\b(home|you|profile|search|settings|notifications?|inbox|messages?|explore|library|more|menu|videos?|create|feed)\b/gi) ?? [];
|
|
83685
|
+
return chromeWords.some((w) => scenarioTextLower.includes(w.toLowerCase()));
|
|
83686
|
+
}
|
|
83687
|
+
return true;
|
|
83688
|
+
}
|
|
83689
|
+
return false;
|
|
83690
|
+
}
|
|
83691
|
+
function isNavChromeThrashTrace(actions) {
|
|
83692
|
+
const meaningful = actions.filter((a) => a.type !== "WAIT_FOR_ELEMENT");
|
|
83693
|
+
if (meaningful.length === 0)
|
|
83694
|
+
return false;
|
|
83695
|
+
const hasNavOrGesture = meaningful.some((a) => a.type === "TAP" || a.type === "SWIPE" || a.type === "BACK" || a.type === "HOME");
|
|
83696
|
+
if (!hasNavOrGesture)
|
|
83697
|
+
return false;
|
|
83698
|
+
return meaningful.every((a) => {
|
|
83699
|
+
if (a.type === "SWIPE" || a.type === "BACK" || a.type === "HOME")
|
|
83700
|
+
return true;
|
|
83701
|
+
if (a.type === "ASSERT_VISIBLE" || a.type === "ASSERT_TEXT") {
|
|
83702
|
+
const t = actionText(a);
|
|
83703
|
+
return NAV_CHROME_TAP_RE.test(t) || VOLATILE_BADGE_ASSERT_RE.test(t) || isStructuralOnlyAssert(a);
|
|
83704
|
+
}
|
|
83705
|
+
if (a.type === "TAP") {
|
|
83706
|
+
return NAV_CHROME_TAP_RE.test(actionText(a)) && !CONTENT_ACTION_VERB_RE.test(actionText(a));
|
|
83707
|
+
}
|
|
83708
|
+
return false;
|
|
83709
|
+
});
|
|
83710
|
+
}
|
|
83711
|
+
function isHarnessOrVisibilityScenario(scenario) {
|
|
83712
|
+
const text = scenarioText(scenario);
|
|
83713
|
+
return /\b(avoid|recover|guard|remain|stay\s+in|does\s+not\s+record|external|outside\s+the\s+app|inspect|visibility\s+proof|landing\s+screen|smoke|structural\s+assert|skip\s+link|global\s+navigation\s+anchors?)\b/i.test(text);
|
|
83714
|
+
}
|
|
83715
|
+
function requiresFeatureProgress(scenario) {
|
|
83716
|
+
if (isNavigationFocusedScenario(scenario))
|
|
83717
|
+
return false;
|
|
83718
|
+
if (isCancelDiscardScenario(scenario))
|
|
83719
|
+
return false;
|
|
83720
|
+
if (isContentActionScenario(scenario))
|
|
83721
|
+
return true;
|
|
83722
|
+
if (isHarnessOrVisibilityScenario(scenario))
|
|
83723
|
+
return false;
|
|
83724
|
+
const text = scenarioText(scenario);
|
|
83725
|
+
const behaviorClaim = scenario.type === "HAPPY_PATH" || scenario.type === "USER_JOURNEY" || /\b(happy\s*path|successful|success|complete|user\s+can|should\s+be\s+able)\b/i.test(text);
|
|
83726
|
+
if (!behaviorClaim)
|
|
83727
|
+
return false;
|
|
83728
|
+
return /\b(like|unlike|share|follow|bookmark|download|subscribe|create|save|send|submit|edit|delete|remove|add|play|search|type|fill|login|sign\s*in|log\s*in|register|checkout|update|change|open|view|browse|filter|sort|upload|invite|join)\b/i.test(text);
|
|
83729
|
+
}
|
|
83544
83730
|
function isInspectionOnlyScenario(scenario, actions) {
|
|
83545
83731
|
if (actions.length === 0 || scenario.expectedOutcomes.length === 0)
|
|
83546
83732
|
return false;
|
|
@@ -83550,16 +83736,28 @@ ${statePacket}`, redactionCredentials) },
|
|
|
83550
83736
|
if (actions.some((a) => a.type === "TYPE" || a.type === "CLEAR")) {
|
|
83551
83737
|
return false;
|
|
83552
83738
|
}
|
|
83739
|
+
if (isContentActionScenario(scenario)) {
|
|
83740
|
+
return false;
|
|
83741
|
+
}
|
|
83742
|
+
if (isFormValidationScenario(scenario)) {
|
|
83743
|
+
return false;
|
|
83744
|
+
}
|
|
83553
83745
|
const text = scenarioText(scenario);
|
|
83554
|
-
const visibilityOnlyGoal = (/\b(entry\s+points?|providers?|
|
|
83746
|
+
const visibilityOnlyGoal = (/\b(entry\s+points?|providers?|provider\s+buttons?|sign[- ]?in\s+options|auth(?:entication)?\s+options|available\s+options)\b/.test(text) || /\b(show|display)\s+(all\s+)?(the\s+)?(providers?|options|buttons?|links?|entry\s+points?)\b/.test(text) || /\b(all\s+(three\s+)?providers?)\b/.test(text)) && !/\b(change|update|create|save|send|register|edit|with\s+valid|successful\s+(sign|log)|complete\s+(the\s+)?(login|sign[- ]?in)|submit\s+(the\s+)?(form|credentials)|enter\s+(an?\s+)?(email|password))\b/.test(text);
|
|
83555
83747
|
if (visibilityOnlyGoal) {
|
|
83556
83748
|
const assertCount2 = actions.filter((a) => a.type === "ASSERT_VISIBLE" || a.type === "ASSERT_TEXT").length;
|
|
83557
83749
|
return assertCount2 > 0;
|
|
83558
83750
|
}
|
|
83559
|
-
const completionIntent = scenario.type === "HAPPY_PATH" || /\b(happy\s*path|successful|with\s+valid|complete\s+(the\s+)?(login|sign[- ]?in|registration|checkout|purchase))\b/.test(text);
|
|
83751
|
+
const completionIntent = scenario.type === "HAPPY_PATH" || scenario.type === "USER_JOURNEY" || /\b(happy\s*path|successful|with\s+valid|complete\s+(the\s+)?(login|sign[- ]?in|registration|checkout|purchase)|user\s+can|should\s+be\s+able)\b/.test(text);
|
|
83560
83752
|
const formIntent = /\b(sign\s*in|log\s*in|login|authenticate|register|sign\s*up|checkout|create|save|submit|send|change|update|edit)\b/.test(text);
|
|
83561
83753
|
if (completionIntent && formIntent)
|
|
83562
83754
|
return false;
|
|
83755
|
+
if (completionIntent && /\b(like|unlike|share|follow|bookmark|download|subscribe|create|save|send|post|delete|remove|add|play|pause)\b/i.test(text)) {
|
|
83756
|
+
return false;
|
|
83757
|
+
}
|
|
83758
|
+
if (completionIntent) {
|
|
83759
|
+
return false;
|
|
83760
|
+
}
|
|
83563
83761
|
const assertCount = actions.filter((a) => a.type === "ASSERT_VISIBLE" || a.type === "ASSERT_TEXT").length;
|
|
83564
83762
|
return assertCount > 0;
|
|
83565
83763
|
}
|
|
@@ -83569,7 +83767,18 @@ ${statePacket}`, redactionCredentials) },
|
|
|
83569
83767
|
const completesFlow = /\b(happy\s*path|successful|complete\s+(the\s+)?(login|sign[- ]?in|registration|checkout)|with\s+valid)\b/.test(text);
|
|
83570
83768
|
return navigates && !completesFlow;
|
|
83571
83769
|
}
|
|
83770
|
+
function isCancelDiscardScenario(scenario) {
|
|
83771
|
+
const text = scenarioText(scenario);
|
|
83772
|
+
if (/\bcancel\s+(?:the|my|a|an|this|your|their)?\s*(subscription|order|booking|trip|reservation|membership|plan|purchase|payment|appointment|ticket|flight|ride)\b/i.test(text)) {
|
|
83773
|
+
return false;
|
|
83774
|
+
}
|
|
83775
|
+
const cancelEditPhrase = /\b(cancel|discard|revert|undo)\s+(?:(?:the|my|a|an|this|your|their|all)\s+)?(?:unsaved\s+)?(change|changes|edit|edits|update|updates|draft|input|inputs)\b/i.test(text) || /\b(change|changes|edit|edits|update|updates|draft)\s+(?:are\s+)?(cancelled|canceled|discarded|reverted|undone)\b/i.test(text) || /\breject\s+(?:(?:the|my|a|an|this|your|their|all)\s+)?(change|changes|edit|edits|update|updates|draft)\b/i.test(text);
|
|
83776
|
+
const discardWithoutSave = /\b(without\s+saving|do\s+not\s+save|don't\s+save)\b/i.test(text) && /\b(cancel|discard|revert|undo|leave|exit|back|dismiss)\b/i.test(text);
|
|
83777
|
+
return cancelEditPhrase || discardWithoutSave;
|
|
83778
|
+
}
|
|
83572
83779
|
function isFormValidationScenario(scenario) {
|
|
83780
|
+
if (isCancelDiscardScenario(scenario))
|
|
83781
|
+
return false;
|
|
83573
83782
|
if (scenario.variant === "validation")
|
|
83574
83783
|
return true;
|
|
83575
83784
|
if (scenario.type !== "EDGE_CASE")
|
|
@@ -83580,6 +83789,8 @@ ${statePacket}`, redactionCredentials) },
|
|
|
83580
83789
|
function isFormMutationHappyPath(scenario) {
|
|
83581
83790
|
if (isNavigationFocusedScenario(scenario))
|
|
83582
83791
|
return false;
|
|
83792
|
+
if (isCancelDiscardScenario(scenario))
|
|
83793
|
+
return false;
|
|
83583
83794
|
if (isFormValidationScenario(scenario))
|
|
83584
83795
|
return false;
|
|
83585
83796
|
const text = scenarioText(scenario);
|
|
@@ -83592,9 +83803,14 @@ ${statePacket}`, redactionCredentials) },
|
|
|
83592
83803
|
if (/\b(show|display|visible|options?|providers?|links?)\b/.test(text) && !/\b(change|update|create|save|send|register|edit|post|write|compose|delete|add|set)\b/.test(text)) {
|
|
83593
83804
|
return false;
|
|
83594
83805
|
}
|
|
83595
|
-
|
|
83596
|
-
|
|
83597
|
-
|
|
83806
|
+
if (/\b(play|pause|resume|playback|seek|volume|mute|unmute|shuffle|repeat|now\s+playing|mini\s*player)\b/.test(text) && !/\b(playlist\s+name|edit\s+(track|song|clip)|upload|caption|comment|description|save\s+to|add\s+to\s+(a\s+)?playlist|create\s+(a\s+)?playlist|rename)\b/.test(text)) {
|
|
83807
|
+
return false;
|
|
83808
|
+
}
|
|
83809
|
+
const formObject = "password|email|profile|message|post|item|record|form|settings|account|name|title|description|comment|bio|phone|address|payment|card|user|note|task|entry";
|
|
83810
|
+
const mutationVerb = "change|update|create|save|send|register|sign\\s*up|checkout|edit|post|write|compose|set|add|delete|remove";
|
|
83811
|
+
const determiner = "(?:(?:the|a|an|my|your|their|this|that)\\s+)?(?:new\\s+)?";
|
|
83812
|
+
const mutatesFormObject = new RegExp(`\\b(?:${mutationVerb})\\s+${determiner}(?:${formObject})\\b`).test(text) || new RegExp(`\\b(?:${formObject})\\s+(?:${mutationVerb})\\b`).test(text);
|
|
83813
|
+
return mutatesFormObject;
|
|
83598
83814
|
}
|
|
83599
83815
|
function isNavigationChromeTap(action) {
|
|
83600
83816
|
if (action.type !== "TAP")
|
|
@@ -83683,24 +83899,61 @@ ${statePacket}`, redactionCredentials) },
|
|
|
83683
83899
|
}
|
|
83684
83900
|
function scenarioIntentMismatchReason(scenario, actions) {
|
|
83685
83901
|
const text = scenarioText(scenario);
|
|
83902
|
+
if (isContentActionScenario(scenario)) {
|
|
83903
|
+
const hasActionTap = actions.some((a) => isContentActionTap(a));
|
|
83904
|
+
if (!hasActionTap) {
|
|
83905
|
+
return "content-action scenario (like/share/follow/\u2026) did not record a tap on a matching control";
|
|
83906
|
+
}
|
|
83907
|
+
if (isNavChromeThrashTrace(actions)) {
|
|
83908
|
+
return "content-action scenario only recorded tab thrash / swipes \u2014 no product action";
|
|
83909
|
+
}
|
|
83910
|
+
const asserts2 = actions.filter((a) => a.type === "ASSERT_VISIBLE" || a.type === "ASSERT_TEXT");
|
|
83911
|
+
if (asserts2.length > 0 && asserts2.every((a) => VOLATILE_BADGE_ASSERT_RE.test(actionText(a)) || NAV_CHROME_TAP_RE.test(actionText(a)) && !CONTENT_ACTION_VERB_RE.test(actionText(a)))) {
|
|
83912
|
+
return "content-action scenario only asserted tab chrome or a volatile badge count \u2014 assert the action outcome instead";
|
|
83913
|
+
}
|
|
83914
|
+
return null;
|
|
83915
|
+
}
|
|
83686
83916
|
if (isInspectionOnlyScenario(scenario, actions)) {
|
|
83687
83917
|
return null;
|
|
83688
83918
|
}
|
|
83689
83919
|
if (isNavigationFocusedScenario(scenario)) {
|
|
83690
83920
|
return null;
|
|
83691
83921
|
}
|
|
83922
|
+
if (isCancelDiscardScenario(scenario)) {
|
|
83923
|
+
const hasCancelTap = actions.some((a) => {
|
|
83924
|
+
if (a.type !== "TAP")
|
|
83925
|
+
return false;
|
|
83926
|
+
return /\b(cancel|discard|close|dismiss|revert|undo|not\s+now)\b/.test(actionText(a));
|
|
83927
|
+
});
|
|
83928
|
+
const lastNavIdx = (() => {
|
|
83929
|
+
for (let i = actions.length - 1; i >= 0; i--) {
|
|
83930
|
+
const t = actions[i].type;
|
|
83931
|
+
if (t === "TAP" || t === "BACK" || t === "TYPE" || t === "CLEAR")
|
|
83932
|
+
return i;
|
|
83933
|
+
}
|
|
83934
|
+
return -1;
|
|
83935
|
+
})();
|
|
83936
|
+
const backAsDismiss = lastNavIdx >= 0 && actions[lastNavIdx].type === "BACK" && /\b(back|leave|exit|dismiss)\b/i.test(text) && /\b(without\s+saving|do\s+not\s+save|don't\s+save|discard|cancel)\b/i.test(text);
|
|
83937
|
+
if (!hasCancelTap && !backAsDismiss) {
|
|
83938
|
+
return "cancel/discard scenario did not record a cancel/dismiss action";
|
|
83939
|
+
}
|
|
83940
|
+
return null;
|
|
83941
|
+
}
|
|
83692
83942
|
if (isFormValidationScenario(scenario)) {
|
|
83693
83943
|
const typedFields = actions.some((a) => a.type === "TYPE");
|
|
83694
83944
|
const hasCommit = actions.some((a) => isFormCommitAction(a));
|
|
83695
83945
|
const hasValidationAssert = actions.some((a) => {
|
|
83696
83946
|
if (a.type !== "ASSERT_VISIBLE" && a.type !== "ASSERT_TEXT")
|
|
83697
83947
|
return false;
|
|
83698
|
-
return /\b(error|required|invalid|empty|missing|incorrect|wrong|try again|mismatch|does not match|must match)\b/.test(actionText(a));
|
|
83948
|
+
return /\b(error|required|invalid|empty|missing|incorrect|wrong|try again|mismatch|does not match|must match|cannot be empty|please enter|fill out|is required)\b/.test(actionText(a));
|
|
83699
83949
|
});
|
|
83700
83950
|
const emptyFieldIntent = /\b(empty|required|missing|blank)\b/.test(text);
|
|
83701
83951
|
const invalidValueIntent = /\b(wrong|incorrect|invalid|mismatch|reject)\b/.test(text);
|
|
83952
|
+
if (!hasValidationAssert) {
|
|
83953
|
+
return "validation scenario did not assert a validation/error outcome (commit alone is not proof)";
|
|
83954
|
+
}
|
|
83702
83955
|
if (emptyFieldIntent && !invalidValueIntent) {
|
|
83703
|
-
if (!hasCommit
|
|
83956
|
+
if (!hasCommit) {
|
|
83704
83957
|
return "validation scenario did not record a form commit or validation outcome";
|
|
83705
83958
|
}
|
|
83706
83959
|
return null;
|
|
@@ -83708,7 +83961,7 @@ ${statePacket}`, redactionCredentials) },
|
|
|
83708
83961
|
if (typedFields && !hasCommit) {
|
|
83709
83962
|
return "validation scenario filled fields but never committed the form";
|
|
83710
83963
|
}
|
|
83711
|
-
if (!hasCommit
|
|
83964
|
+
if (!hasCommit) {
|
|
83712
83965
|
return "validation scenario did not record a form commit or validation outcome";
|
|
83713
83966
|
}
|
|
83714
83967
|
return null;
|
|
@@ -83722,6 +83975,10 @@ ${statePacket}`, redactionCredentials) },
|
|
|
83722
83975
|
if (!hasCommit) {
|
|
83723
83976
|
return "form-mutation happy path did not record a form commit";
|
|
83724
83977
|
}
|
|
83978
|
+
const asserts2 = actions.filter((a) => a.type === "ASSERT_VISIBLE" || a.type === "ASSERT_TEXT");
|
|
83979
|
+
if (asserts2.length > 0 && asserts2.every((a) => NAV_CHROME_TAP_RE.test(actionText(a)) || VOLATILE_BADGE_ASSERT_RE.test(actionText(a)) || isStructuralOnlyAssert(a) || isEphemeralContentAssertText(assertIdentityText(a)))) {
|
|
83980
|
+
return "form-mutation happy path only asserted tab chrome or ephemeral content \u2014 assert the saved/updated product outcome";
|
|
83981
|
+
}
|
|
83725
83982
|
}
|
|
83726
83983
|
const isCredentialSignIn = /\b(sign\s*in|log\s*in|login|authenticate|auth)\b/.test(text) && /\b(email|e-mail|password|credential|valid credentials?)\b/.test(text) && !/\b(reset|forgot|recover|logout|log\s*out|sign\s*out|change\s+password|update\s+password)\b/.test(text);
|
|
83727
83984
|
const typedEmailIndexes = [];
|
|
@@ -83782,33 +84039,102 @@ ${statePacket}`, redactionCredentials) },
|
|
|
83782
84039
|
}
|
|
83783
84040
|
}
|
|
83784
84041
|
const isHappyPath = /\b(happy\s*path|successful|success|create|save|submit|complete|checkout|send|post)\b/.test(text) || scenario.type === "HAPPY_PATH";
|
|
83785
|
-
if (
|
|
83786
|
-
|
|
83787
|
-
|
|
83788
|
-
|
|
83789
|
-
|
|
83790
|
-
|
|
83791
|
-
|
|
83792
|
-
|
|
83793
|
-
|
|
83794
|
-
|
|
83795
|
-
|
|
83796
|
-
|
|
83797
|
-
|
|
83798
|
-
|
|
83799
|
-
|
|
83800
|
-
|
|
83801
|
-
|
|
83802
|
-
|
|
83803
|
-
|
|
83804
|
-
|
|
83805
|
-
|
|
83806
|
-
|
|
83807
|
-
|
|
83808
|
-
|
|
84042
|
+
if (isHappyPath) {
|
|
84043
|
+
let lastTypeIndex = -1;
|
|
84044
|
+
let lastAssertIndex = -1;
|
|
84045
|
+
actions.forEach((action, index) => {
|
|
84046
|
+
if (action.type === "TYPE")
|
|
84047
|
+
lastTypeIndex = index;
|
|
84048
|
+
if (action.type === "ASSERT_VISIBLE" || action.type === "ASSERT_TEXT")
|
|
84049
|
+
lastAssertIndex = index;
|
|
84050
|
+
});
|
|
84051
|
+
if (lastTypeIndex >= 0 && lastAssertIndex > lastTypeIndex) {
|
|
84052
|
+
const typeScreen = actions[lastTypeIndex]?.metadata?.screenName?.trim() ?? "";
|
|
84053
|
+
const assertScreen = actions[lastAssertIndex]?.metadata?.screenName?.trim() ?? "";
|
|
84054
|
+
const screensDiffer = typeScreen !== "" && assertScreen !== "" && typeScreen !== assertScreen;
|
|
84055
|
+
const lastTypeAction = actions[lastTypeIndex];
|
|
84056
|
+
const keyboardCommitOnLastType = lastTypeAction != null && isKeyboardFormCommit(lastTypeAction);
|
|
84057
|
+
const commitAfterType = keyboardCommitOnLastType || actions.some((action, index) => {
|
|
84058
|
+
if (index <= lastTypeIndex || index >= lastAssertIndex)
|
|
84059
|
+
return false;
|
|
84060
|
+
return isFormCommitAction(action);
|
|
84061
|
+
});
|
|
84062
|
+
if (screensDiffer && !commitAfterType) {
|
|
84063
|
+
return "form fields were filled then a success assert was recorded without a commit/submit tap between them";
|
|
84064
|
+
}
|
|
84065
|
+
}
|
|
84066
|
+
}
|
|
84067
|
+
if (isNavChromeThrashTrace(actions) && !isNavigationFocusedScenario(scenario) && !isFormMutationHappyPath(scenario) && !isFormValidationScenario(scenario) && !isCredentialSignIn && !isAuthLikeScenario && !isHarnessOrVisibilityScenario(scenario)) {
|
|
84068
|
+
return "recording is only bottom-nav thrash and swipes \u2014 does not execute the scenario goal";
|
|
84069
|
+
}
|
|
84070
|
+
if (requiresFeatureProgress(scenario) && !isFormValidationScenario(scenario) && !isCredentialSignIn && !isAuthLikeScenario) {
|
|
84071
|
+
if (!actions.some((a) => isProductiveScenarioAction(a, text))) {
|
|
84072
|
+
return "happy-path / user-journey scenario did not record a productive product action (only chrome, gestures, or empty work)";
|
|
84073
|
+
}
|
|
84074
|
+
const asserts2 = actions.filter((a) => a.type === "ASSERT_VISIBLE" || a.type === "ASSERT_TEXT");
|
|
84075
|
+
if (asserts2.length > 0 && asserts2.every((a) => VOLATILE_BADGE_ASSERT_RE.test(actionText(a)) || isStructuralOnlyAssert(a))) {
|
|
84076
|
+
return "happy-path / user-journey scenario only asserted volatile badges or structural roots \u2014 assert a durable feature outcome";
|
|
84077
|
+
}
|
|
84078
|
+
}
|
|
84079
|
+
const goalFidelity = scenarioGoalActionFidelityReason(text, actions);
|
|
84080
|
+
if (goalFidelity)
|
|
84081
|
+
return goalFidelity;
|
|
84082
|
+
if (actions.some((a) => isBareHierarchyFieldAction(a))) {
|
|
84083
|
+
return "typed or tapped a bare hierarchy/container target with no accessible label \u2014 use a labeled field/control";
|
|
84084
|
+
}
|
|
84085
|
+
const asserts = actions.filter((a) => a.type === "ASSERT_VISIBLE" || a.type === "ASSERT_TEXT");
|
|
84086
|
+
if (asserts.length > 0 && asserts.every((a) => isEphemeralContentAssertText(assertIdentityText(a)))) {
|
|
84087
|
+
return "only asserted ephemeral feed/catalog content (session-specific titles/ids) \u2014 assert durable product chrome or stable outcome";
|
|
84088
|
+
}
|
|
84089
|
+
return null;
|
|
84090
|
+
}
|
|
84091
|
+
function scenarioGoalActionFidelityReason(scenarioTextLower, actions) {
|
|
84092
|
+
const actionBlob = actions.map((a) => actionText(a)).join(" ").toLowerCase();
|
|
84093
|
+
if (/\b(pick|choose|select)\b.*\b(library|gallery|photos?|camera\s*roll|device)\b|\bfrom\s+(the\s+)?(library|gallery|photos?)\b/.test(scenarioTextLower)) {
|
|
84094
|
+
if (!/\b(library|gallery|photos?|camera\s*roll|pick\s+a\s+video|choose\s+(a\s+)?(video|photo|file)|from\s+library|document\s*picker|media\s*picker)\b/i.test(actionBlob)) {
|
|
84095
|
+
return "scenario claims pick-from-library but recording never tapped a library/gallery/picker control";
|
|
84096
|
+
}
|
|
84097
|
+
}
|
|
84098
|
+
if (/\b(style|styles)\b/.test(scenarioTextLower) && /\b(format|aspect|ratio|quality|reels?|9:16|16:9)\b/.test(scenarioTextLower)) {
|
|
84099
|
+
const pickedStyle = /\b(style|cinematic|anime|realistic|no\s*style|cartoon|oil\s*paint)\b/i.test(actionBlob);
|
|
84100
|
+
const pickedFormat = /\b(9:16|16:9|1:1|reels?|aspect|quality|format|720|1080)\b/i.test(actionBlob);
|
|
84101
|
+
if (!pickedStyle || !pickedFormat) {
|
|
84102
|
+
return "scenario claims style+format selection but recording did not select both a style and a format/aspect control";
|
|
84103
|
+
}
|
|
84104
|
+
}
|
|
84105
|
+
if (/\b(open|launch|start)\b.*\b(camera|recording)\b|\brecord\s+a\s+video\b/.test(scenarioTextLower)) {
|
|
84106
|
+
if (!/\b(camera|record|recording|flash|flip\s+camera|capture|shutter)\b/i.test(actionBlob)) {
|
|
84107
|
+
return "scenario claims open/record camera but recording never reached camera controls";
|
|
84108
|
+
}
|
|
83809
84109
|
}
|
|
83810
84110
|
return null;
|
|
83811
84111
|
}
|
|
84112
|
+
function isBareHierarchyFieldAction(action) {
|
|
84113
|
+
if (action.type !== "TYPE" && action.type !== "CLEAR")
|
|
84114
|
+
return false;
|
|
84115
|
+
const sel = (action.selector ?? "").trim();
|
|
84116
|
+
if (!/^\/hierarchy/i.test(sel))
|
|
84117
|
+
return false;
|
|
84118
|
+
const bundle = action.metadata.locatorBundle;
|
|
84119
|
+
const label = (action.metadata.targetLabel ?? "").trim();
|
|
84120
|
+
if (label && !/^element$/i.test(label))
|
|
84121
|
+
return false;
|
|
84122
|
+
const inner = nonEmpty3(action.innerText);
|
|
84123
|
+
if (inner && !/^element$/i.test(inner))
|
|
84124
|
+
return false;
|
|
84125
|
+
if (nonEmpty3(bundle?.text) || nonEmpty3(bundle?.contentDesc) || nonEmpty3(bundle?.accessibilityId)) {
|
|
84126
|
+
return false;
|
|
84127
|
+
}
|
|
84128
|
+
if (nonEmpty3(bundle?.resourceId) && !isStructuralAssertionIdentity(bundle?.resourceId)) {
|
|
84129
|
+
return false;
|
|
84130
|
+
}
|
|
84131
|
+
if (action.type === "TYPE") {
|
|
84132
|
+
const v = (action.value ?? "").replace(/\s+/g, "");
|
|
84133
|
+
if (v.length > 0)
|
|
84134
|
+
return false;
|
|
84135
|
+
}
|
|
84136
|
+
return true;
|
|
84137
|
+
}
|
|
83812
84138
|
function actionCycleKey(action) {
|
|
83813
84139
|
return `${action.type}|${action.selector}|${action.value ?? ""}`;
|
|
83814
84140
|
}
|
|
@@ -84060,6 +84386,38 @@ ${statePacket}`, redactionCredentials) },
|
|
|
84060
84386
|
lines.push("});");
|
|
84061
84387
|
return lines.join("\n");
|
|
84062
84388
|
}
|
|
84389
|
+
function isEphemeralContentAssertText(text) {
|
|
84390
|
+
const t = text.trim();
|
|
84391
|
+
if (!t)
|
|
84392
|
+
return false;
|
|
84393
|
+
if (/\b\d+\s*(s|sec|secs|second|seconds|m|min|mins|minute|minutes|h|hr|hrs|hour|hours|d|day|days|w|wk|wks|week|weeks|mo|mos|month|months|y|yr|yrs|year|years)\s+ago\b/i.test(t)) {
|
|
84394
|
+
return true;
|
|
84395
|
+
}
|
|
84396
|
+
if (/\b(just\s+now|moments?\s+ago|yesterday)\b/i.test(t))
|
|
84397
|
+
return true;
|
|
84398
|
+
if (/\btoday\s+at\s+\d{1,2}:\d{2}\b/i.test(t))
|
|
84399
|
+
return true;
|
|
84400
|
+
const feedish = /\b(followed|liked|commented|replied|mentioned|shared|posted|unread|notification|message from|new follower)\b/i.test(t) || /\b\d+\s*(s|m|h|d|w)\s+ago\b/i.test(t);
|
|
84401
|
+
if (feedish && t.length >= 70 && /[.!?].+\s/.test(t) && t.split(/\s+/).length >= 10) {
|
|
84402
|
+
return true;
|
|
84403
|
+
}
|
|
84404
|
+
if (t.length >= 40 && /\b(error\s+\d{3,}|generation failed|rate limit|quota exceeded)\b/i.test(t)) {
|
|
84405
|
+
return true;
|
|
84406
|
+
}
|
|
84407
|
+
if (/\b(harness|seed|fixture|demo\s*data|test\s*artist|qa\s*published)\b/i.test(t) && /\d{6,}/.test(t)) {
|
|
84408
|
+
return true;
|
|
84409
|
+
}
|
|
84410
|
+
if (/\bplay\b.+\bby\b.+/i.test(t) && (t.length >= 40 || /\d{6,}/.test(t))) {
|
|
84411
|
+
return true;
|
|
84412
|
+
}
|
|
84413
|
+
if (/^play\s+/i.test(t) && t.length >= 35 && !/\b(home|search|settings|profile|library|playlist|sign\s*in|log\s*in)\b/i.test(t)) {
|
|
84414
|
+
return true;
|
|
84415
|
+
}
|
|
84416
|
+
return false;
|
|
84417
|
+
}
|
|
84418
|
+
function assertIdentityText(action) {
|
|
84419
|
+
return [action.selector, action.value, action.innerText, action.metadata?.targetLabel].filter((v) => typeof v === "string" && v.trim().length > 0).join(" ");
|
|
84420
|
+
}
|
|
84063
84421
|
function evaluateMobileAssertionStrength(actions) {
|
|
84064
84422
|
const modelAsserts = actions.filter((a) => a.type === "ASSERT_VISIBLE" || a.type === "ASSERT_TEXT");
|
|
84065
84423
|
if (modelAsserts.length === 0) {
|
|
@@ -84095,6 +84453,24 @@ ${statePacket}`, redactionCredentials) },
|
|
|
84095
84453
|
}
|
|
84096
84454
|
};
|
|
84097
84455
|
}
|
|
84456
|
+
const ephemeral = modelAsserts.filter((a) => isEphemeralContentAssertText(assertIdentityText(a)));
|
|
84457
|
+
const durable = modelAsserts.filter((a) => !isEphemeralContentAssertText(assertIdentityText(a)));
|
|
84458
|
+
if (ephemeral.length > 0 && durable.length === 0) {
|
|
84459
|
+
return {
|
|
84460
|
+
ok: false,
|
|
84461
|
+
severity: "block",
|
|
84462
|
+
reason: "only ephemeral content assertions (relative times, long feed/notification copy, or backend error strings) \u2014 assert durable chrome or run-scoped data instead",
|
|
84463
|
+
signals: {
|
|
84464
|
+
apiTest: false,
|
|
84465
|
+
interacted: true,
|
|
84466
|
+
mutated: actions.some((a) => a.type === "TYPE"),
|
|
84467
|
+
navOnly: false,
|
|
84468
|
+
hasOutcomeProof: false,
|
|
84469
|
+
errorBanner: false,
|
|
84470
|
+
terminal: null
|
|
84471
|
+
}
|
|
84472
|
+
};
|
|
84473
|
+
}
|
|
84098
84474
|
const code = mobileActionsToPseudoPlaywright(actions);
|
|
84099
84475
|
const interacted = actions.some((a) => a.type === "TAP" || a.type === "TYPE" || a.type === "CLEAR");
|
|
84100
84476
|
return (0, shared_1.validateAssertionStrength)(code, { interactionPerformed: interacted });
|
|
@@ -84970,6 +85346,7 @@ Reason over steps + error + tree + registry and return working healed steps. Do
|
|
|
84970
85346
|
For a fix, return the COMPLETE steps array (not a diff).`;
|
|
84971
85347
|
var DEFAULT_SCRIPT_MAX_ATTEMPTS = 6;
|
|
84972
85348
|
var RECOVERABLE_MAX = 3;
|
|
85349
|
+
var MAX_CONSECUTIVE_INVALID_VERDICTS = 3;
|
|
84973
85350
|
var BONUS_ATTEMPTS_CEIL = 4;
|
|
84974
85351
|
var DEFAULT_BONUS_ATTEMPTS = 2;
|
|
84975
85352
|
var MAX_LOG_CHARS = 4096;
|
|
@@ -85575,6 +85952,7 @@ ${args.directive}`);
|
|
|
85575
85952
|
const triedLocators = [];
|
|
85576
85953
|
let sameErrorCount = 0;
|
|
85577
85954
|
let lastErrorSignature = null;
|
|
85955
|
+
let consecutiveInvalidVerdicts = 0;
|
|
85578
85956
|
const markRecoverableTurn = () => {
|
|
85579
85957
|
if (recoverableUsed < RECOVERABLE_MAX) {
|
|
85580
85958
|
attemptCap += 1;
|
|
@@ -85648,11 +86026,22 @@ ${args.directive}`);
|
|
|
85648
86026
|
aiResponseCount += 1;
|
|
85649
86027
|
const parsed = parseHealVerdict(content);
|
|
85650
86028
|
if (!parsed) {
|
|
85651
|
-
|
|
86029
|
+
consecutiveInvalidVerdicts += 1;
|
|
86030
|
+
options.onProgress?.(`Phase 1 attempt ${attempt}: response was not a valid verdict (${content.length} chars, finish=${finishReason ?? "unknown"}) \u2014 granting a recovery turn (${consecutiveInvalidVerdicts}/${MAX_CONSECUTIVE_INVALID_VERDICTS} consecutive)`);
|
|
86031
|
+
if (consecutiveInvalidVerdicts >= MAX_CONSECUTIVE_INVALID_VERDICTS) {
|
|
86032
|
+
options.onProgress?.(`Phase 1 aborted: ${consecutiveInvalidVerdicts} consecutive invalid verdicts \u2014 freeing device`);
|
|
86033
|
+
return {
|
|
86034
|
+
passed: false,
|
|
86035
|
+
verdict: "config_issue",
|
|
86036
|
+
healReason: `heal model returned ${consecutiveInvalidVerdicts} consecutive non-verdict responses (last ${content.length} chars, finish=${finishReason ?? "unknown"}) \u2014 aborting to free the device`,
|
|
86037
|
+
attemptsUsed: attempt
|
|
86038
|
+
};
|
|
86039
|
+
}
|
|
85652
86040
|
markRecoverableTurn();
|
|
85653
|
-
pendingDirective = "Your last response was not valid JSON matching the verdict schema. Return exactly one JSON verdict object.";
|
|
86041
|
+
pendingDirective = "Your last response was not valid JSON matching the verdict schema. Return exactly one JSON verdict object \u2014 no prose, no markdown fences.";
|
|
85654
86042
|
continue;
|
|
85655
86043
|
}
|
|
86044
|
+
consecutiveInvalidVerdicts = 0;
|
|
85656
86045
|
if (TERMINAL_VERDICTS.has(parsed.verdict)) {
|
|
85657
86046
|
return { passed: false, verdict: parsed.verdict, healReason: parsed.reason, attemptsUsed: attempt };
|
|
85658
86047
|
}
|
|
@@ -101147,2285 +101536,6 @@ var require_rate_limit_detector = __commonJS({
|
|
|
101147
101536
|
}
|
|
101148
101537
|
});
|
|
101149
101538
|
|
|
101150
|
-
// ../../node_modules/source-map-support/node_modules/source-map/lib/base64.js
|
|
101151
|
-
var require_base64 = __commonJS({
|
|
101152
|
-
"../../node_modules/source-map-support/node_modules/source-map/lib/base64.js"(exports) {
|
|
101153
|
-
"use strict";
|
|
101154
|
-
var intToCharMap = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");
|
|
101155
|
-
exports.encode = function(number) {
|
|
101156
|
-
if (0 <= number && number < intToCharMap.length) {
|
|
101157
|
-
return intToCharMap[number];
|
|
101158
|
-
}
|
|
101159
|
-
throw new TypeError("Must be between 0 and 63: " + number);
|
|
101160
|
-
};
|
|
101161
|
-
exports.decode = function(charCode) {
|
|
101162
|
-
var bigA = 65;
|
|
101163
|
-
var bigZ = 90;
|
|
101164
|
-
var littleA = 97;
|
|
101165
|
-
var littleZ = 122;
|
|
101166
|
-
var zero = 48;
|
|
101167
|
-
var nine = 57;
|
|
101168
|
-
var plus = 43;
|
|
101169
|
-
var slash = 47;
|
|
101170
|
-
var littleOffset = 26;
|
|
101171
|
-
var numberOffset = 52;
|
|
101172
|
-
if (bigA <= charCode && charCode <= bigZ) {
|
|
101173
|
-
return charCode - bigA;
|
|
101174
|
-
}
|
|
101175
|
-
if (littleA <= charCode && charCode <= littleZ) {
|
|
101176
|
-
return charCode - littleA + littleOffset;
|
|
101177
|
-
}
|
|
101178
|
-
if (zero <= charCode && charCode <= nine) {
|
|
101179
|
-
return charCode - zero + numberOffset;
|
|
101180
|
-
}
|
|
101181
|
-
if (charCode == plus) {
|
|
101182
|
-
return 62;
|
|
101183
|
-
}
|
|
101184
|
-
if (charCode == slash) {
|
|
101185
|
-
return 63;
|
|
101186
|
-
}
|
|
101187
|
-
return -1;
|
|
101188
|
-
};
|
|
101189
|
-
}
|
|
101190
|
-
});
|
|
101191
|
-
|
|
101192
|
-
// ../../node_modules/source-map-support/node_modules/source-map/lib/base64-vlq.js
|
|
101193
|
-
var require_base64_vlq = __commonJS({
|
|
101194
|
-
"../../node_modules/source-map-support/node_modules/source-map/lib/base64-vlq.js"(exports) {
|
|
101195
|
-
"use strict";
|
|
101196
|
-
var base64 = require_base64();
|
|
101197
|
-
var VLQ_BASE_SHIFT = 5;
|
|
101198
|
-
var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
|
|
101199
|
-
var VLQ_BASE_MASK = VLQ_BASE - 1;
|
|
101200
|
-
var VLQ_CONTINUATION_BIT = VLQ_BASE;
|
|
101201
|
-
function toVLQSigned(aValue) {
|
|
101202
|
-
return aValue < 0 ? (-aValue << 1) + 1 : (aValue << 1) + 0;
|
|
101203
|
-
}
|
|
101204
|
-
function fromVLQSigned(aValue) {
|
|
101205
|
-
var isNegative = (aValue & 1) === 1;
|
|
101206
|
-
var shifted = aValue >> 1;
|
|
101207
|
-
return isNegative ? -shifted : shifted;
|
|
101208
|
-
}
|
|
101209
|
-
exports.encode = function base64VLQ_encode(aValue) {
|
|
101210
|
-
var encoded = "";
|
|
101211
|
-
var digit;
|
|
101212
|
-
var vlq = toVLQSigned(aValue);
|
|
101213
|
-
do {
|
|
101214
|
-
digit = vlq & VLQ_BASE_MASK;
|
|
101215
|
-
vlq >>>= VLQ_BASE_SHIFT;
|
|
101216
|
-
if (vlq > 0) {
|
|
101217
|
-
digit |= VLQ_CONTINUATION_BIT;
|
|
101218
|
-
}
|
|
101219
|
-
encoded += base64.encode(digit);
|
|
101220
|
-
} while (vlq > 0);
|
|
101221
|
-
return encoded;
|
|
101222
|
-
};
|
|
101223
|
-
exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
|
|
101224
|
-
var strLen = aStr.length;
|
|
101225
|
-
var result = 0;
|
|
101226
|
-
var shift = 0;
|
|
101227
|
-
var continuation, digit;
|
|
101228
|
-
do {
|
|
101229
|
-
if (aIndex >= strLen) {
|
|
101230
|
-
throw new Error("Expected more digits in base 64 VLQ value.");
|
|
101231
|
-
}
|
|
101232
|
-
digit = base64.decode(aStr.charCodeAt(aIndex++));
|
|
101233
|
-
if (digit === -1) {
|
|
101234
|
-
throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
|
|
101235
|
-
}
|
|
101236
|
-
continuation = !!(digit & VLQ_CONTINUATION_BIT);
|
|
101237
|
-
digit &= VLQ_BASE_MASK;
|
|
101238
|
-
result = result + (digit << shift);
|
|
101239
|
-
shift += VLQ_BASE_SHIFT;
|
|
101240
|
-
} while (continuation);
|
|
101241
|
-
aOutParam.value = fromVLQSigned(result);
|
|
101242
|
-
aOutParam.rest = aIndex;
|
|
101243
|
-
};
|
|
101244
|
-
}
|
|
101245
|
-
});
|
|
101246
|
-
|
|
101247
|
-
// ../../node_modules/source-map-support/node_modules/source-map/lib/util.js
|
|
101248
|
-
var require_util4 = __commonJS({
|
|
101249
|
-
"../../node_modules/source-map-support/node_modules/source-map/lib/util.js"(exports) {
|
|
101250
|
-
"use strict";
|
|
101251
|
-
function getArg(aArgs, aName, aDefaultValue) {
|
|
101252
|
-
if (aName in aArgs) {
|
|
101253
|
-
return aArgs[aName];
|
|
101254
|
-
} else if (arguments.length === 3) {
|
|
101255
|
-
return aDefaultValue;
|
|
101256
|
-
} else {
|
|
101257
|
-
throw new Error('"' + aName + '" is a required argument.');
|
|
101258
|
-
}
|
|
101259
|
-
}
|
|
101260
|
-
exports.getArg = getArg;
|
|
101261
|
-
var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/;
|
|
101262
|
-
var dataUrlRegexp = /^data:.+\,.+$/;
|
|
101263
|
-
function urlParse(aUrl) {
|
|
101264
|
-
var match = aUrl.match(urlRegexp);
|
|
101265
|
-
if (!match) {
|
|
101266
|
-
return null;
|
|
101267
|
-
}
|
|
101268
|
-
return {
|
|
101269
|
-
scheme: match[1],
|
|
101270
|
-
auth: match[2],
|
|
101271
|
-
host: match[3],
|
|
101272
|
-
port: match[4],
|
|
101273
|
-
path: match[5]
|
|
101274
|
-
};
|
|
101275
|
-
}
|
|
101276
|
-
exports.urlParse = urlParse;
|
|
101277
|
-
function urlGenerate(aParsedUrl) {
|
|
101278
|
-
var url = "";
|
|
101279
|
-
if (aParsedUrl.scheme) {
|
|
101280
|
-
url += aParsedUrl.scheme + ":";
|
|
101281
|
-
}
|
|
101282
|
-
url += "//";
|
|
101283
|
-
if (aParsedUrl.auth) {
|
|
101284
|
-
url += aParsedUrl.auth + "@";
|
|
101285
|
-
}
|
|
101286
|
-
if (aParsedUrl.host) {
|
|
101287
|
-
url += aParsedUrl.host;
|
|
101288
|
-
}
|
|
101289
|
-
if (aParsedUrl.port) {
|
|
101290
|
-
url += ":" + aParsedUrl.port;
|
|
101291
|
-
}
|
|
101292
|
-
if (aParsedUrl.path) {
|
|
101293
|
-
url += aParsedUrl.path;
|
|
101294
|
-
}
|
|
101295
|
-
return url;
|
|
101296
|
-
}
|
|
101297
|
-
exports.urlGenerate = urlGenerate;
|
|
101298
|
-
function normalize(aPath) {
|
|
101299
|
-
var path = aPath;
|
|
101300
|
-
var url = urlParse(aPath);
|
|
101301
|
-
if (url) {
|
|
101302
|
-
if (!url.path) {
|
|
101303
|
-
return aPath;
|
|
101304
|
-
}
|
|
101305
|
-
path = url.path;
|
|
101306
|
-
}
|
|
101307
|
-
var isAbsolute2 = exports.isAbsolute(path);
|
|
101308
|
-
var parts = path.split(/\/+/);
|
|
101309
|
-
for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
|
|
101310
|
-
part = parts[i];
|
|
101311
|
-
if (part === ".") {
|
|
101312
|
-
parts.splice(i, 1);
|
|
101313
|
-
} else if (part === "..") {
|
|
101314
|
-
up++;
|
|
101315
|
-
} else if (up > 0) {
|
|
101316
|
-
if (part === "") {
|
|
101317
|
-
parts.splice(i + 1, up);
|
|
101318
|
-
up = 0;
|
|
101319
|
-
} else {
|
|
101320
|
-
parts.splice(i, 2);
|
|
101321
|
-
up--;
|
|
101322
|
-
}
|
|
101323
|
-
}
|
|
101324
|
-
}
|
|
101325
|
-
path = parts.join("/");
|
|
101326
|
-
if (path === "") {
|
|
101327
|
-
path = isAbsolute2 ? "/" : ".";
|
|
101328
|
-
}
|
|
101329
|
-
if (url) {
|
|
101330
|
-
url.path = path;
|
|
101331
|
-
return urlGenerate(url);
|
|
101332
|
-
}
|
|
101333
|
-
return path;
|
|
101334
|
-
}
|
|
101335
|
-
exports.normalize = normalize;
|
|
101336
|
-
function join8(aRoot, aPath) {
|
|
101337
|
-
if (aRoot === "") {
|
|
101338
|
-
aRoot = ".";
|
|
101339
|
-
}
|
|
101340
|
-
if (aPath === "") {
|
|
101341
|
-
aPath = ".";
|
|
101342
|
-
}
|
|
101343
|
-
var aPathUrl = urlParse(aPath);
|
|
101344
|
-
var aRootUrl = urlParse(aRoot);
|
|
101345
|
-
if (aRootUrl) {
|
|
101346
|
-
aRoot = aRootUrl.path || "/";
|
|
101347
|
-
}
|
|
101348
|
-
if (aPathUrl && !aPathUrl.scheme) {
|
|
101349
|
-
if (aRootUrl) {
|
|
101350
|
-
aPathUrl.scheme = aRootUrl.scheme;
|
|
101351
|
-
}
|
|
101352
|
-
return urlGenerate(aPathUrl);
|
|
101353
|
-
}
|
|
101354
|
-
if (aPathUrl || aPath.match(dataUrlRegexp)) {
|
|
101355
|
-
return aPath;
|
|
101356
|
-
}
|
|
101357
|
-
if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
|
|
101358
|
-
aRootUrl.host = aPath;
|
|
101359
|
-
return urlGenerate(aRootUrl);
|
|
101360
|
-
}
|
|
101361
|
-
var joined = aPath.charAt(0) === "/" ? aPath : normalize(aRoot.replace(/\/+$/, "") + "/" + aPath);
|
|
101362
|
-
if (aRootUrl) {
|
|
101363
|
-
aRootUrl.path = joined;
|
|
101364
|
-
return urlGenerate(aRootUrl);
|
|
101365
|
-
}
|
|
101366
|
-
return joined;
|
|
101367
|
-
}
|
|
101368
|
-
exports.join = join8;
|
|
101369
|
-
exports.isAbsolute = function(aPath) {
|
|
101370
|
-
return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
|
|
101371
|
-
};
|
|
101372
|
-
function relative(aRoot, aPath) {
|
|
101373
|
-
if (aRoot === "") {
|
|
101374
|
-
aRoot = ".";
|
|
101375
|
-
}
|
|
101376
|
-
aRoot = aRoot.replace(/\/$/, "");
|
|
101377
|
-
var level = 0;
|
|
101378
|
-
while (aPath.indexOf(aRoot + "/") !== 0) {
|
|
101379
|
-
var index = aRoot.lastIndexOf("/");
|
|
101380
|
-
if (index < 0) {
|
|
101381
|
-
return aPath;
|
|
101382
|
-
}
|
|
101383
|
-
aRoot = aRoot.slice(0, index);
|
|
101384
|
-
if (aRoot.match(/^([^\/]+:\/)?\/*$/)) {
|
|
101385
|
-
return aPath;
|
|
101386
|
-
}
|
|
101387
|
-
++level;
|
|
101388
|
-
}
|
|
101389
|
-
return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
|
|
101390
|
-
}
|
|
101391
|
-
exports.relative = relative;
|
|
101392
|
-
var supportsNullProto = (function() {
|
|
101393
|
-
var obj = /* @__PURE__ */ Object.create(null);
|
|
101394
|
-
return !("__proto__" in obj);
|
|
101395
|
-
})();
|
|
101396
|
-
function identity(s) {
|
|
101397
|
-
return s;
|
|
101398
|
-
}
|
|
101399
|
-
function toSetString(aStr) {
|
|
101400
|
-
if (isProtoString(aStr)) {
|
|
101401
|
-
return "$" + aStr;
|
|
101402
|
-
}
|
|
101403
|
-
return aStr;
|
|
101404
|
-
}
|
|
101405
|
-
exports.toSetString = supportsNullProto ? identity : toSetString;
|
|
101406
|
-
function fromSetString(aStr) {
|
|
101407
|
-
if (isProtoString(aStr)) {
|
|
101408
|
-
return aStr.slice(1);
|
|
101409
|
-
}
|
|
101410
|
-
return aStr;
|
|
101411
|
-
}
|
|
101412
|
-
exports.fromSetString = supportsNullProto ? identity : fromSetString;
|
|
101413
|
-
function isProtoString(s) {
|
|
101414
|
-
if (!s) {
|
|
101415
|
-
return false;
|
|
101416
|
-
}
|
|
101417
|
-
var length = s.length;
|
|
101418
|
-
if (length < 9) {
|
|
101419
|
-
return false;
|
|
101420
|
-
}
|
|
101421
|
-
if (s.charCodeAt(length - 1) !== 95 || s.charCodeAt(length - 2) !== 95 || s.charCodeAt(length - 3) !== 111 || s.charCodeAt(length - 4) !== 116 || s.charCodeAt(length - 5) !== 111 || s.charCodeAt(length - 6) !== 114 || s.charCodeAt(length - 7) !== 112 || s.charCodeAt(length - 8) !== 95 || s.charCodeAt(length - 9) !== 95) {
|
|
101422
|
-
return false;
|
|
101423
|
-
}
|
|
101424
|
-
for (var i = length - 10; i >= 0; i--) {
|
|
101425
|
-
if (s.charCodeAt(i) !== 36) {
|
|
101426
|
-
return false;
|
|
101427
|
-
}
|
|
101428
|
-
}
|
|
101429
|
-
return true;
|
|
101430
|
-
}
|
|
101431
|
-
function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
|
|
101432
|
-
var cmp = strcmp(mappingA.source, mappingB.source);
|
|
101433
|
-
if (cmp !== 0) {
|
|
101434
|
-
return cmp;
|
|
101435
|
-
}
|
|
101436
|
-
cmp = mappingA.originalLine - mappingB.originalLine;
|
|
101437
|
-
if (cmp !== 0) {
|
|
101438
|
-
return cmp;
|
|
101439
|
-
}
|
|
101440
|
-
cmp = mappingA.originalColumn - mappingB.originalColumn;
|
|
101441
|
-
if (cmp !== 0 || onlyCompareOriginal) {
|
|
101442
|
-
return cmp;
|
|
101443
|
-
}
|
|
101444
|
-
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
|
|
101445
|
-
if (cmp !== 0) {
|
|
101446
|
-
return cmp;
|
|
101447
|
-
}
|
|
101448
|
-
cmp = mappingA.generatedLine - mappingB.generatedLine;
|
|
101449
|
-
if (cmp !== 0) {
|
|
101450
|
-
return cmp;
|
|
101451
|
-
}
|
|
101452
|
-
return strcmp(mappingA.name, mappingB.name);
|
|
101453
|
-
}
|
|
101454
|
-
exports.compareByOriginalPositions = compareByOriginalPositions;
|
|
101455
|
-
function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
|
|
101456
|
-
var cmp = mappingA.generatedLine - mappingB.generatedLine;
|
|
101457
|
-
if (cmp !== 0) {
|
|
101458
|
-
return cmp;
|
|
101459
|
-
}
|
|
101460
|
-
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
|
|
101461
|
-
if (cmp !== 0 || onlyCompareGenerated) {
|
|
101462
|
-
return cmp;
|
|
101463
|
-
}
|
|
101464
|
-
cmp = strcmp(mappingA.source, mappingB.source);
|
|
101465
|
-
if (cmp !== 0) {
|
|
101466
|
-
return cmp;
|
|
101467
|
-
}
|
|
101468
|
-
cmp = mappingA.originalLine - mappingB.originalLine;
|
|
101469
|
-
if (cmp !== 0) {
|
|
101470
|
-
return cmp;
|
|
101471
|
-
}
|
|
101472
|
-
cmp = mappingA.originalColumn - mappingB.originalColumn;
|
|
101473
|
-
if (cmp !== 0) {
|
|
101474
|
-
return cmp;
|
|
101475
|
-
}
|
|
101476
|
-
return strcmp(mappingA.name, mappingB.name);
|
|
101477
|
-
}
|
|
101478
|
-
exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
|
|
101479
|
-
function strcmp(aStr1, aStr2) {
|
|
101480
|
-
if (aStr1 === aStr2) {
|
|
101481
|
-
return 0;
|
|
101482
|
-
}
|
|
101483
|
-
if (aStr1 === null) {
|
|
101484
|
-
return 1;
|
|
101485
|
-
}
|
|
101486
|
-
if (aStr2 === null) {
|
|
101487
|
-
return -1;
|
|
101488
|
-
}
|
|
101489
|
-
if (aStr1 > aStr2) {
|
|
101490
|
-
return 1;
|
|
101491
|
-
}
|
|
101492
|
-
return -1;
|
|
101493
|
-
}
|
|
101494
|
-
function compareByGeneratedPositionsInflated(mappingA, mappingB) {
|
|
101495
|
-
var cmp = mappingA.generatedLine - mappingB.generatedLine;
|
|
101496
|
-
if (cmp !== 0) {
|
|
101497
|
-
return cmp;
|
|
101498
|
-
}
|
|
101499
|
-
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
|
|
101500
|
-
if (cmp !== 0) {
|
|
101501
|
-
return cmp;
|
|
101502
|
-
}
|
|
101503
|
-
cmp = strcmp(mappingA.source, mappingB.source);
|
|
101504
|
-
if (cmp !== 0) {
|
|
101505
|
-
return cmp;
|
|
101506
|
-
}
|
|
101507
|
-
cmp = mappingA.originalLine - mappingB.originalLine;
|
|
101508
|
-
if (cmp !== 0) {
|
|
101509
|
-
return cmp;
|
|
101510
|
-
}
|
|
101511
|
-
cmp = mappingA.originalColumn - mappingB.originalColumn;
|
|
101512
|
-
if (cmp !== 0) {
|
|
101513
|
-
return cmp;
|
|
101514
|
-
}
|
|
101515
|
-
return strcmp(mappingA.name, mappingB.name);
|
|
101516
|
-
}
|
|
101517
|
-
exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
|
|
101518
|
-
function parseSourceMapInput(str) {
|
|
101519
|
-
return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, ""));
|
|
101520
|
-
}
|
|
101521
|
-
exports.parseSourceMapInput = parseSourceMapInput;
|
|
101522
|
-
function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {
|
|
101523
|
-
sourceURL = sourceURL || "";
|
|
101524
|
-
if (sourceRoot) {
|
|
101525
|
-
if (sourceRoot[sourceRoot.length - 1] !== "/" && sourceURL[0] !== "/") {
|
|
101526
|
-
sourceRoot += "/";
|
|
101527
|
-
}
|
|
101528
|
-
sourceURL = sourceRoot + sourceURL;
|
|
101529
|
-
}
|
|
101530
|
-
if (sourceMapURL) {
|
|
101531
|
-
var parsed = urlParse(sourceMapURL);
|
|
101532
|
-
if (!parsed) {
|
|
101533
|
-
throw new Error("sourceMapURL could not be parsed");
|
|
101534
|
-
}
|
|
101535
|
-
if (parsed.path) {
|
|
101536
|
-
var index = parsed.path.lastIndexOf("/");
|
|
101537
|
-
if (index >= 0) {
|
|
101538
|
-
parsed.path = parsed.path.substring(0, index + 1);
|
|
101539
|
-
}
|
|
101540
|
-
}
|
|
101541
|
-
sourceURL = join8(urlGenerate(parsed), sourceURL);
|
|
101542
|
-
}
|
|
101543
|
-
return normalize(sourceURL);
|
|
101544
|
-
}
|
|
101545
|
-
exports.computeSourceURL = computeSourceURL;
|
|
101546
|
-
}
|
|
101547
|
-
});
|
|
101548
|
-
|
|
101549
|
-
// ../../node_modules/source-map-support/node_modules/source-map/lib/array-set.js
|
|
101550
|
-
var require_array_set = __commonJS({
|
|
101551
|
-
"../../node_modules/source-map-support/node_modules/source-map/lib/array-set.js"(exports) {
|
|
101552
|
-
"use strict";
|
|
101553
|
-
var util = require_util4();
|
|
101554
|
-
var has = Object.prototype.hasOwnProperty;
|
|
101555
|
-
var hasNativeMap = typeof Map !== "undefined";
|
|
101556
|
-
function ArraySet() {
|
|
101557
|
-
this._array = [];
|
|
101558
|
-
this._set = hasNativeMap ? /* @__PURE__ */ new Map() : /* @__PURE__ */ Object.create(null);
|
|
101559
|
-
}
|
|
101560
|
-
ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
|
|
101561
|
-
var set = new ArraySet();
|
|
101562
|
-
for (var i = 0, len = aArray.length; i < len; i++) {
|
|
101563
|
-
set.add(aArray[i], aAllowDuplicates);
|
|
101564
|
-
}
|
|
101565
|
-
return set;
|
|
101566
|
-
};
|
|
101567
|
-
ArraySet.prototype.size = function ArraySet_size() {
|
|
101568
|
-
return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;
|
|
101569
|
-
};
|
|
101570
|
-
ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
|
|
101571
|
-
var sStr = hasNativeMap ? aStr : util.toSetString(aStr);
|
|
101572
|
-
var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);
|
|
101573
|
-
var idx = this._array.length;
|
|
101574
|
-
if (!isDuplicate || aAllowDuplicates) {
|
|
101575
|
-
this._array.push(aStr);
|
|
101576
|
-
}
|
|
101577
|
-
if (!isDuplicate) {
|
|
101578
|
-
if (hasNativeMap) {
|
|
101579
|
-
this._set.set(aStr, idx);
|
|
101580
|
-
} else {
|
|
101581
|
-
this._set[sStr] = idx;
|
|
101582
|
-
}
|
|
101583
|
-
}
|
|
101584
|
-
};
|
|
101585
|
-
ArraySet.prototype.has = function ArraySet_has(aStr) {
|
|
101586
|
-
if (hasNativeMap) {
|
|
101587
|
-
return this._set.has(aStr);
|
|
101588
|
-
} else {
|
|
101589
|
-
var sStr = util.toSetString(aStr);
|
|
101590
|
-
return has.call(this._set, sStr);
|
|
101591
|
-
}
|
|
101592
|
-
};
|
|
101593
|
-
ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {
|
|
101594
|
-
if (hasNativeMap) {
|
|
101595
|
-
var idx = this._set.get(aStr);
|
|
101596
|
-
if (idx >= 0) {
|
|
101597
|
-
return idx;
|
|
101598
|
-
}
|
|
101599
|
-
} else {
|
|
101600
|
-
var sStr = util.toSetString(aStr);
|
|
101601
|
-
if (has.call(this._set, sStr)) {
|
|
101602
|
-
return this._set[sStr];
|
|
101603
|
-
}
|
|
101604
|
-
}
|
|
101605
|
-
throw new Error('"' + aStr + '" is not in the set.');
|
|
101606
|
-
};
|
|
101607
|
-
ArraySet.prototype.at = function ArraySet_at(aIdx) {
|
|
101608
|
-
if (aIdx >= 0 && aIdx < this._array.length) {
|
|
101609
|
-
return this._array[aIdx];
|
|
101610
|
-
}
|
|
101611
|
-
throw new Error("No element indexed by " + aIdx);
|
|
101612
|
-
};
|
|
101613
|
-
ArraySet.prototype.toArray = function ArraySet_toArray() {
|
|
101614
|
-
return this._array.slice();
|
|
101615
|
-
};
|
|
101616
|
-
exports.ArraySet = ArraySet;
|
|
101617
|
-
}
|
|
101618
|
-
});
|
|
101619
|
-
|
|
101620
|
-
// ../../node_modules/source-map-support/node_modules/source-map/lib/mapping-list.js
|
|
101621
|
-
var require_mapping_list = __commonJS({
|
|
101622
|
-
"../../node_modules/source-map-support/node_modules/source-map/lib/mapping-list.js"(exports) {
|
|
101623
|
-
"use strict";
|
|
101624
|
-
var util = require_util4();
|
|
101625
|
-
function generatedPositionAfter(mappingA, mappingB) {
|
|
101626
|
-
var lineA = mappingA.generatedLine;
|
|
101627
|
-
var lineB = mappingB.generatedLine;
|
|
101628
|
-
var columnA = mappingA.generatedColumn;
|
|
101629
|
-
var columnB = mappingB.generatedColumn;
|
|
101630
|
-
return lineB > lineA || lineB == lineA && columnB >= columnA || util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
|
|
101631
|
-
}
|
|
101632
|
-
function MappingList() {
|
|
101633
|
-
this._array = [];
|
|
101634
|
-
this._sorted = true;
|
|
101635
|
-
this._last = { generatedLine: -1, generatedColumn: 0 };
|
|
101636
|
-
}
|
|
101637
|
-
MappingList.prototype.unsortedForEach = function MappingList_forEach(aCallback, aThisArg) {
|
|
101638
|
-
this._array.forEach(aCallback, aThisArg);
|
|
101639
|
-
};
|
|
101640
|
-
MappingList.prototype.add = function MappingList_add(aMapping) {
|
|
101641
|
-
if (generatedPositionAfter(this._last, aMapping)) {
|
|
101642
|
-
this._last = aMapping;
|
|
101643
|
-
this._array.push(aMapping);
|
|
101644
|
-
} else {
|
|
101645
|
-
this._sorted = false;
|
|
101646
|
-
this._array.push(aMapping);
|
|
101647
|
-
}
|
|
101648
|
-
};
|
|
101649
|
-
MappingList.prototype.toArray = function MappingList_toArray() {
|
|
101650
|
-
if (!this._sorted) {
|
|
101651
|
-
this._array.sort(util.compareByGeneratedPositionsInflated);
|
|
101652
|
-
this._sorted = true;
|
|
101653
|
-
}
|
|
101654
|
-
return this._array;
|
|
101655
|
-
};
|
|
101656
|
-
exports.MappingList = MappingList;
|
|
101657
|
-
}
|
|
101658
|
-
});
|
|
101659
|
-
|
|
101660
|
-
// ../../node_modules/source-map-support/node_modules/source-map/lib/source-map-generator.js
|
|
101661
|
-
var require_source_map_generator = __commonJS({
|
|
101662
|
-
"../../node_modules/source-map-support/node_modules/source-map/lib/source-map-generator.js"(exports) {
|
|
101663
|
-
"use strict";
|
|
101664
|
-
var base64VLQ = require_base64_vlq();
|
|
101665
|
-
var util = require_util4();
|
|
101666
|
-
var ArraySet = require_array_set().ArraySet;
|
|
101667
|
-
var MappingList = require_mapping_list().MappingList;
|
|
101668
|
-
function SourceMapGenerator(aArgs) {
|
|
101669
|
-
if (!aArgs) {
|
|
101670
|
-
aArgs = {};
|
|
101671
|
-
}
|
|
101672
|
-
this._file = util.getArg(aArgs, "file", null);
|
|
101673
|
-
this._sourceRoot = util.getArg(aArgs, "sourceRoot", null);
|
|
101674
|
-
this._skipValidation = util.getArg(aArgs, "skipValidation", false);
|
|
101675
|
-
this._sources = new ArraySet();
|
|
101676
|
-
this._names = new ArraySet();
|
|
101677
|
-
this._mappings = new MappingList();
|
|
101678
|
-
this._sourcesContents = null;
|
|
101679
|
-
}
|
|
101680
|
-
SourceMapGenerator.prototype._version = 3;
|
|
101681
|
-
SourceMapGenerator.fromSourceMap = function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {
|
|
101682
|
-
var sourceRoot = aSourceMapConsumer.sourceRoot;
|
|
101683
|
-
var generator = new SourceMapGenerator({
|
|
101684
|
-
file: aSourceMapConsumer.file,
|
|
101685
|
-
sourceRoot
|
|
101686
|
-
});
|
|
101687
|
-
aSourceMapConsumer.eachMapping(function(mapping) {
|
|
101688
|
-
var newMapping = {
|
|
101689
|
-
generated: {
|
|
101690
|
-
line: mapping.generatedLine,
|
|
101691
|
-
column: mapping.generatedColumn
|
|
101692
|
-
}
|
|
101693
|
-
};
|
|
101694
|
-
if (mapping.source != null) {
|
|
101695
|
-
newMapping.source = mapping.source;
|
|
101696
|
-
if (sourceRoot != null) {
|
|
101697
|
-
newMapping.source = util.relative(sourceRoot, newMapping.source);
|
|
101698
|
-
}
|
|
101699
|
-
newMapping.original = {
|
|
101700
|
-
line: mapping.originalLine,
|
|
101701
|
-
column: mapping.originalColumn
|
|
101702
|
-
};
|
|
101703
|
-
if (mapping.name != null) {
|
|
101704
|
-
newMapping.name = mapping.name;
|
|
101705
|
-
}
|
|
101706
|
-
}
|
|
101707
|
-
generator.addMapping(newMapping);
|
|
101708
|
-
});
|
|
101709
|
-
aSourceMapConsumer.sources.forEach(function(sourceFile) {
|
|
101710
|
-
var sourceRelative = sourceFile;
|
|
101711
|
-
if (sourceRoot !== null) {
|
|
101712
|
-
sourceRelative = util.relative(sourceRoot, sourceFile);
|
|
101713
|
-
}
|
|
101714
|
-
if (!generator._sources.has(sourceRelative)) {
|
|
101715
|
-
generator._sources.add(sourceRelative);
|
|
101716
|
-
}
|
|
101717
|
-
var content = aSourceMapConsumer.sourceContentFor(sourceFile);
|
|
101718
|
-
if (content != null) {
|
|
101719
|
-
generator.setSourceContent(sourceFile, content);
|
|
101720
|
-
}
|
|
101721
|
-
});
|
|
101722
|
-
return generator;
|
|
101723
|
-
};
|
|
101724
|
-
SourceMapGenerator.prototype.addMapping = function SourceMapGenerator_addMapping(aArgs) {
|
|
101725
|
-
var generated = util.getArg(aArgs, "generated");
|
|
101726
|
-
var original = util.getArg(aArgs, "original", null);
|
|
101727
|
-
var source = util.getArg(aArgs, "source", null);
|
|
101728
|
-
var name = util.getArg(aArgs, "name", null);
|
|
101729
|
-
if (!this._skipValidation) {
|
|
101730
|
-
this._validateMapping(generated, original, source, name);
|
|
101731
|
-
}
|
|
101732
|
-
if (source != null) {
|
|
101733
|
-
source = String(source);
|
|
101734
|
-
if (!this._sources.has(source)) {
|
|
101735
|
-
this._sources.add(source);
|
|
101736
|
-
}
|
|
101737
|
-
}
|
|
101738
|
-
if (name != null) {
|
|
101739
|
-
name = String(name);
|
|
101740
|
-
if (!this._names.has(name)) {
|
|
101741
|
-
this._names.add(name);
|
|
101742
|
-
}
|
|
101743
|
-
}
|
|
101744
|
-
this._mappings.add({
|
|
101745
|
-
generatedLine: generated.line,
|
|
101746
|
-
generatedColumn: generated.column,
|
|
101747
|
-
originalLine: original != null && original.line,
|
|
101748
|
-
originalColumn: original != null && original.column,
|
|
101749
|
-
source,
|
|
101750
|
-
name
|
|
101751
|
-
});
|
|
101752
|
-
};
|
|
101753
|
-
SourceMapGenerator.prototype.setSourceContent = function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
|
|
101754
|
-
var source = aSourceFile;
|
|
101755
|
-
if (this._sourceRoot != null) {
|
|
101756
|
-
source = util.relative(this._sourceRoot, source);
|
|
101757
|
-
}
|
|
101758
|
-
if (aSourceContent != null) {
|
|
101759
|
-
if (!this._sourcesContents) {
|
|
101760
|
-
this._sourcesContents = /* @__PURE__ */ Object.create(null);
|
|
101761
|
-
}
|
|
101762
|
-
this._sourcesContents[util.toSetString(source)] = aSourceContent;
|
|
101763
|
-
} else if (this._sourcesContents) {
|
|
101764
|
-
delete this._sourcesContents[util.toSetString(source)];
|
|
101765
|
-
if (Object.keys(this._sourcesContents).length === 0) {
|
|
101766
|
-
this._sourcesContents = null;
|
|
101767
|
-
}
|
|
101768
|
-
}
|
|
101769
|
-
};
|
|
101770
|
-
SourceMapGenerator.prototype.applySourceMap = function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
|
|
101771
|
-
var sourceFile = aSourceFile;
|
|
101772
|
-
if (aSourceFile == null) {
|
|
101773
|
-
if (aSourceMapConsumer.file == null) {
|
|
101774
|
-
throw new Error(
|
|
101775
|
-
`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`
|
|
101776
|
-
);
|
|
101777
|
-
}
|
|
101778
|
-
sourceFile = aSourceMapConsumer.file;
|
|
101779
|
-
}
|
|
101780
|
-
var sourceRoot = this._sourceRoot;
|
|
101781
|
-
if (sourceRoot != null) {
|
|
101782
|
-
sourceFile = util.relative(sourceRoot, sourceFile);
|
|
101783
|
-
}
|
|
101784
|
-
var newSources = new ArraySet();
|
|
101785
|
-
var newNames = new ArraySet();
|
|
101786
|
-
this._mappings.unsortedForEach(function(mapping) {
|
|
101787
|
-
if (mapping.source === sourceFile && mapping.originalLine != null) {
|
|
101788
|
-
var original = aSourceMapConsumer.originalPositionFor({
|
|
101789
|
-
line: mapping.originalLine,
|
|
101790
|
-
column: mapping.originalColumn
|
|
101791
|
-
});
|
|
101792
|
-
if (original.source != null) {
|
|
101793
|
-
mapping.source = original.source;
|
|
101794
|
-
if (aSourceMapPath != null) {
|
|
101795
|
-
mapping.source = util.join(aSourceMapPath, mapping.source);
|
|
101796
|
-
}
|
|
101797
|
-
if (sourceRoot != null) {
|
|
101798
|
-
mapping.source = util.relative(sourceRoot, mapping.source);
|
|
101799
|
-
}
|
|
101800
|
-
mapping.originalLine = original.line;
|
|
101801
|
-
mapping.originalColumn = original.column;
|
|
101802
|
-
if (original.name != null) {
|
|
101803
|
-
mapping.name = original.name;
|
|
101804
|
-
}
|
|
101805
|
-
}
|
|
101806
|
-
}
|
|
101807
|
-
var source = mapping.source;
|
|
101808
|
-
if (source != null && !newSources.has(source)) {
|
|
101809
|
-
newSources.add(source);
|
|
101810
|
-
}
|
|
101811
|
-
var name = mapping.name;
|
|
101812
|
-
if (name != null && !newNames.has(name)) {
|
|
101813
|
-
newNames.add(name);
|
|
101814
|
-
}
|
|
101815
|
-
}, this);
|
|
101816
|
-
this._sources = newSources;
|
|
101817
|
-
this._names = newNames;
|
|
101818
|
-
aSourceMapConsumer.sources.forEach(function(sourceFile2) {
|
|
101819
|
-
var content = aSourceMapConsumer.sourceContentFor(sourceFile2);
|
|
101820
|
-
if (content != null) {
|
|
101821
|
-
if (aSourceMapPath != null) {
|
|
101822
|
-
sourceFile2 = util.join(aSourceMapPath, sourceFile2);
|
|
101823
|
-
}
|
|
101824
|
-
if (sourceRoot != null) {
|
|
101825
|
-
sourceFile2 = util.relative(sourceRoot, sourceFile2);
|
|
101826
|
-
}
|
|
101827
|
-
this.setSourceContent(sourceFile2, content);
|
|
101828
|
-
}
|
|
101829
|
-
}, this);
|
|
101830
|
-
};
|
|
101831
|
-
SourceMapGenerator.prototype._validateMapping = function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, aName) {
|
|
101832
|
-
if (aOriginal && typeof aOriginal.line !== "number" && typeof aOriginal.column !== "number") {
|
|
101833
|
-
throw new Error(
|
|
101834
|
-
"original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values."
|
|
101835
|
-
);
|
|
101836
|
-
}
|
|
101837
|
-
if (aGenerated && "line" in aGenerated && "column" in aGenerated && aGenerated.line > 0 && aGenerated.column >= 0 && !aOriginal && !aSource && !aName) {
|
|
101838
|
-
return;
|
|
101839
|
-
} else if (aGenerated && "line" in aGenerated && "column" in aGenerated && aOriginal && "line" in aOriginal && "column" in aOriginal && aGenerated.line > 0 && aGenerated.column >= 0 && aOriginal.line > 0 && aOriginal.column >= 0 && aSource) {
|
|
101840
|
-
return;
|
|
101841
|
-
} else {
|
|
101842
|
-
throw new Error("Invalid mapping: " + JSON.stringify({
|
|
101843
|
-
generated: aGenerated,
|
|
101844
|
-
source: aSource,
|
|
101845
|
-
original: aOriginal,
|
|
101846
|
-
name: aName
|
|
101847
|
-
}));
|
|
101848
|
-
}
|
|
101849
|
-
};
|
|
101850
|
-
SourceMapGenerator.prototype._serializeMappings = function SourceMapGenerator_serializeMappings() {
|
|
101851
|
-
var previousGeneratedColumn = 0;
|
|
101852
|
-
var previousGeneratedLine = 1;
|
|
101853
|
-
var previousOriginalColumn = 0;
|
|
101854
|
-
var previousOriginalLine = 0;
|
|
101855
|
-
var previousName = 0;
|
|
101856
|
-
var previousSource = 0;
|
|
101857
|
-
var result = "";
|
|
101858
|
-
var next;
|
|
101859
|
-
var mapping;
|
|
101860
|
-
var nameIdx;
|
|
101861
|
-
var sourceIdx;
|
|
101862
|
-
var mappings = this._mappings.toArray();
|
|
101863
|
-
for (var i = 0, len = mappings.length; i < len; i++) {
|
|
101864
|
-
mapping = mappings[i];
|
|
101865
|
-
next = "";
|
|
101866
|
-
if (mapping.generatedLine !== previousGeneratedLine) {
|
|
101867
|
-
previousGeneratedColumn = 0;
|
|
101868
|
-
while (mapping.generatedLine !== previousGeneratedLine) {
|
|
101869
|
-
next += ";";
|
|
101870
|
-
previousGeneratedLine++;
|
|
101871
|
-
}
|
|
101872
|
-
} else {
|
|
101873
|
-
if (i > 0) {
|
|
101874
|
-
if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {
|
|
101875
|
-
continue;
|
|
101876
|
-
}
|
|
101877
|
-
next += ",";
|
|
101878
|
-
}
|
|
101879
|
-
}
|
|
101880
|
-
next += base64VLQ.encode(mapping.generatedColumn - previousGeneratedColumn);
|
|
101881
|
-
previousGeneratedColumn = mapping.generatedColumn;
|
|
101882
|
-
if (mapping.source != null) {
|
|
101883
|
-
sourceIdx = this._sources.indexOf(mapping.source);
|
|
101884
|
-
next += base64VLQ.encode(sourceIdx - previousSource);
|
|
101885
|
-
previousSource = sourceIdx;
|
|
101886
|
-
next += base64VLQ.encode(mapping.originalLine - 1 - previousOriginalLine);
|
|
101887
|
-
previousOriginalLine = mapping.originalLine - 1;
|
|
101888
|
-
next += base64VLQ.encode(mapping.originalColumn - previousOriginalColumn);
|
|
101889
|
-
previousOriginalColumn = mapping.originalColumn;
|
|
101890
|
-
if (mapping.name != null) {
|
|
101891
|
-
nameIdx = this._names.indexOf(mapping.name);
|
|
101892
|
-
next += base64VLQ.encode(nameIdx - previousName);
|
|
101893
|
-
previousName = nameIdx;
|
|
101894
|
-
}
|
|
101895
|
-
}
|
|
101896
|
-
result += next;
|
|
101897
|
-
}
|
|
101898
|
-
return result;
|
|
101899
|
-
};
|
|
101900
|
-
SourceMapGenerator.prototype._generateSourcesContent = function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
|
|
101901
|
-
return aSources.map(function(source) {
|
|
101902
|
-
if (!this._sourcesContents) {
|
|
101903
|
-
return null;
|
|
101904
|
-
}
|
|
101905
|
-
if (aSourceRoot != null) {
|
|
101906
|
-
source = util.relative(aSourceRoot, source);
|
|
101907
|
-
}
|
|
101908
|
-
var key = util.toSetString(source);
|
|
101909
|
-
return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) ? this._sourcesContents[key] : null;
|
|
101910
|
-
}, this);
|
|
101911
|
-
};
|
|
101912
|
-
SourceMapGenerator.prototype.toJSON = function SourceMapGenerator_toJSON() {
|
|
101913
|
-
var map2 = {
|
|
101914
|
-
version: this._version,
|
|
101915
|
-
sources: this._sources.toArray(),
|
|
101916
|
-
names: this._names.toArray(),
|
|
101917
|
-
mappings: this._serializeMappings()
|
|
101918
|
-
};
|
|
101919
|
-
if (this._file != null) {
|
|
101920
|
-
map2.file = this._file;
|
|
101921
|
-
}
|
|
101922
|
-
if (this._sourceRoot != null) {
|
|
101923
|
-
map2.sourceRoot = this._sourceRoot;
|
|
101924
|
-
}
|
|
101925
|
-
if (this._sourcesContents) {
|
|
101926
|
-
map2.sourcesContent = this._generateSourcesContent(map2.sources, map2.sourceRoot);
|
|
101927
|
-
}
|
|
101928
|
-
return map2;
|
|
101929
|
-
};
|
|
101930
|
-
SourceMapGenerator.prototype.toString = function SourceMapGenerator_toString() {
|
|
101931
|
-
return JSON.stringify(this.toJSON());
|
|
101932
|
-
};
|
|
101933
|
-
exports.SourceMapGenerator = SourceMapGenerator;
|
|
101934
|
-
}
|
|
101935
|
-
});
|
|
101936
|
-
|
|
101937
|
-
// ../../node_modules/source-map-support/node_modules/source-map/lib/binary-search.js
|
|
101938
|
-
var require_binary_search = __commonJS({
|
|
101939
|
-
"../../node_modules/source-map-support/node_modules/source-map/lib/binary-search.js"(exports) {
|
|
101940
|
-
"use strict";
|
|
101941
|
-
exports.GREATEST_LOWER_BOUND = 1;
|
|
101942
|
-
exports.LEAST_UPPER_BOUND = 2;
|
|
101943
|
-
function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
|
|
101944
|
-
var mid = Math.floor((aHigh - aLow) / 2) + aLow;
|
|
101945
|
-
var cmp = aCompare(aNeedle, aHaystack[mid], true);
|
|
101946
|
-
if (cmp === 0) {
|
|
101947
|
-
return mid;
|
|
101948
|
-
} else if (cmp > 0) {
|
|
101949
|
-
if (aHigh - mid > 1) {
|
|
101950
|
-
return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
|
|
101951
|
-
}
|
|
101952
|
-
if (aBias == exports.LEAST_UPPER_BOUND) {
|
|
101953
|
-
return aHigh < aHaystack.length ? aHigh : -1;
|
|
101954
|
-
} else {
|
|
101955
|
-
return mid;
|
|
101956
|
-
}
|
|
101957
|
-
} else {
|
|
101958
|
-
if (mid - aLow > 1) {
|
|
101959
|
-
return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
|
|
101960
|
-
}
|
|
101961
|
-
if (aBias == exports.LEAST_UPPER_BOUND) {
|
|
101962
|
-
return mid;
|
|
101963
|
-
} else {
|
|
101964
|
-
return aLow < 0 ? -1 : aLow;
|
|
101965
|
-
}
|
|
101966
|
-
}
|
|
101967
|
-
}
|
|
101968
|
-
exports.search = function search(aNeedle, aHaystack, aCompare, aBias) {
|
|
101969
|
-
if (aHaystack.length === 0) {
|
|
101970
|
-
return -1;
|
|
101971
|
-
}
|
|
101972
|
-
var index = recursiveSearch(
|
|
101973
|
-
-1,
|
|
101974
|
-
aHaystack.length,
|
|
101975
|
-
aNeedle,
|
|
101976
|
-
aHaystack,
|
|
101977
|
-
aCompare,
|
|
101978
|
-
aBias || exports.GREATEST_LOWER_BOUND
|
|
101979
|
-
);
|
|
101980
|
-
if (index < 0) {
|
|
101981
|
-
return -1;
|
|
101982
|
-
}
|
|
101983
|
-
while (index - 1 >= 0) {
|
|
101984
|
-
if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {
|
|
101985
|
-
break;
|
|
101986
|
-
}
|
|
101987
|
-
--index;
|
|
101988
|
-
}
|
|
101989
|
-
return index;
|
|
101990
|
-
};
|
|
101991
|
-
}
|
|
101992
|
-
});
|
|
101993
|
-
|
|
101994
|
-
// ../../node_modules/source-map-support/node_modules/source-map/lib/quick-sort.js
|
|
101995
|
-
var require_quick_sort = __commonJS({
|
|
101996
|
-
"../../node_modules/source-map-support/node_modules/source-map/lib/quick-sort.js"(exports) {
|
|
101997
|
-
"use strict";
|
|
101998
|
-
function swap(ary, x, y) {
|
|
101999
|
-
var temp = ary[x];
|
|
102000
|
-
ary[x] = ary[y];
|
|
102001
|
-
ary[y] = temp;
|
|
102002
|
-
}
|
|
102003
|
-
function randomIntInRange(low, high) {
|
|
102004
|
-
return Math.round(low + Math.random() * (high - low));
|
|
102005
|
-
}
|
|
102006
|
-
function doQuickSort(ary, comparator, p, r) {
|
|
102007
|
-
if (p < r) {
|
|
102008
|
-
var pivotIndex = randomIntInRange(p, r);
|
|
102009
|
-
var i = p - 1;
|
|
102010
|
-
swap(ary, pivotIndex, r);
|
|
102011
|
-
var pivot = ary[r];
|
|
102012
|
-
for (var j = p; j < r; j++) {
|
|
102013
|
-
if (comparator(ary[j], pivot) <= 0) {
|
|
102014
|
-
i += 1;
|
|
102015
|
-
swap(ary, i, j);
|
|
102016
|
-
}
|
|
102017
|
-
}
|
|
102018
|
-
swap(ary, i + 1, j);
|
|
102019
|
-
var q = i + 1;
|
|
102020
|
-
doQuickSort(ary, comparator, p, q - 1);
|
|
102021
|
-
doQuickSort(ary, comparator, q + 1, r);
|
|
102022
|
-
}
|
|
102023
|
-
}
|
|
102024
|
-
exports.quickSort = function(ary, comparator) {
|
|
102025
|
-
doQuickSort(ary, comparator, 0, ary.length - 1);
|
|
102026
|
-
};
|
|
102027
|
-
}
|
|
102028
|
-
});
|
|
102029
|
-
|
|
102030
|
-
// ../../node_modules/source-map-support/node_modules/source-map/lib/source-map-consumer.js
|
|
102031
|
-
var require_source_map_consumer = __commonJS({
|
|
102032
|
-
"../../node_modules/source-map-support/node_modules/source-map/lib/source-map-consumer.js"(exports) {
|
|
102033
|
-
"use strict";
|
|
102034
|
-
var util = require_util4();
|
|
102035
|
-
var binarySearch = require_binary_search();
|
|
102036
|
-
var ArraySet = require_array_set().ArraySet;
|
|
102037
|
-
var base64VLQ = require_base64_vlq();
|
|
102038
|
-
var quickSort = require_quick_sort().quickSort;
|
|
102039
|
-
function SourceMapConsumer(aSourceMap, aSourceMapURL) {
|
|
102040
|
-
var sourceMap = aSourceMap;
|
|
102041
|
-
if (typeof aSourceMap === "string") {
|
|
102042
|
-
sourceMap = util.parseSourceMapInput(aSourceMap);
|
|
102043
|
-
}
|
|
102044
|
-
return sourceMap.sections != null ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) : new BasicSourceMapConsumer(sourceMap, aSourceMapURL);
|
|
102045
|
-
}
|
|
102046
|
-
SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) {
|
|
102047
|
-
return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL);
|
|
102048
|
-
};
|
|
102049
|
-
SourceMapConsumer.prototype._version = 3;
|
|
102050
|
-
SourceMapConsumer.prototype.__generatedMappings = null;
|
|
102051
|
-
Object.defineProperty(SourceMapConsumer.prototype, "_generatedMappings", {
|
|
102052
|
-
configurable: true,
|
|
102053
|
-
enumerable: true,
|
|
102054
|
-
get: function() {
|
|
102055
|
-
if (!this.__generatedMappings) {
|
|
102056
|
-
this._parseMappings(this._mappings, this.sourceRoot);
|
|
102057
|
-
}
|
|
102058
|
-
return this.__generatedMappings;
|
|
102059
|
-
}
|
|
102060
|
-
});
|
|
102061
|
-
SourceMapConsumer.prototype.__originalMappings = null;
|
|
102062
|
-
Object.defineProperty(SourceMapConsumer.prototype, "_originalMappings", {
|
|
102063
|
-
configurable: true,
|
|
102064
|
-
enumerable: true,
|
|
102065
|
-
get: function() {
|
|
102066
|
-
if (!this.__originalMappings) {
|
|
102067
|
-
this._parseMappings(this._mappings, this.sourceRoot);
|
|
102068
|
-
}
|
|
102069
|
-
return this.__originalMappings;
|
|
102070
|
-
}
|
|
102071
|
-
});
|
|
102072
|
-
SourceMapConsumer.prototype._charIsMappingSeparator = function SourceMapConsumer_charIsMappingSeparator(aStr, index) {
|
|
102073
|
-
var c = aStr.charAt(index);
|
|
102074
|
-
return c === ";" || c === ",";
|
|
102075
|
-
};
|
|
102076
|
-
SourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
|
|
102077
|
-
throw new Error("Subclasses must implement _parseMappings");
|
|
102078
|
-
};
|
|
102079
|
-
SourceMapConsumer.GENERATED_ORDER = 1;
|
|
102080
|
-
SourceMapConsumer.ORIGINAL_ORDER = 2;
|
|
102081
|
-
SourceMapConsumer.GREATEST_LOWER_BOUND = 1;
|
|
102082
|
-
SourceMapConsumer.LEAST_UPPER_BOUND = 2;
|
|
102083
|
-
SourceMapConsumer.prototype.eachMapping = function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
|
|
102084
|
-
var context = aContext || null;
|
|
102085
|
-
var order = aOrder || SourceMapConsumer.GENERATED_ORDER;
|
|
102086
|
-
var mappings;
|
|
102087
|
-
switch (order) {
|
|
102088
|
-
case SourceMapConsumer.GENERATED_ORDER:
|
|
102089
|
-
mappings = this._generatedMappings;
|
|
102090
|
-
break;
|
|
102091
|
-
case SourceMapConsumer.ORIGINAL_ORDER:
|
|
102092
|
-
mappings = this._originalMappings;
|
|
102093
|
-
break;
|
|
102094
|
-
default:
|
|
102095
|
-
throw new Error("Unknown order of iteration.");
|
|
102096
|
-
}
|
|
102097
|
-
var sourceRoot = this.sourceRoot;
|
|
102098
|
-
mappings.map(function(mapping) {
|
|
102099
|
-
var source = mapping.source === null ? null : this._sources.at(mapping.source);
|
|
102100
|
-
source = util.computeSourceURL(sourceRoot, source, this._sourceMapURL);
|
|
102101
|
-
return {
|
|
102102
|
-
source,
|
|
102103
|
-
generatedLine: mapping.generatedLine,
|
|
102104
|
-
generatedColumn: mapping.generatedColumn,
|
|
102105
|
-
originalLine: mapping.originalLine,
|
|
102106
|
-
originalColumn: mapping.originalColumn,
|
|
102107
|
-
name: mapping.name === null ? null : this._names.at(mapping.name)
|
|
102108
|
-
};
|
|
102109
|
-
}, this).forEach(aCallback, context);
|
|
102110
|
-
};
|
|
102111
|
-
SourceMapConsumer.prototype.allGeneratedPositionsFor = function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {
|
|
102112
|
-
var line = util.getArg(aArgs, "line");
|
|
102113
|
-
var needle = {
|
|
102114
|
-
source: util.getArg(aArgs, "source"),
|
|
102115
|
-
originalLine: line,
|
|
102116
|
-
originalColumn: util.getArg(aArgs, "column", 0)
|
|
102117
|
-
};
|
|
102118
|
-
needle.source = this._findSourceIndex(needle.source);
|
|
102119
|
-
if (needle.source < 0) {
|
|
102120
|
-
return [];
|
|
102121
|
-
}
|
|
102122
|
-
var mappings = [];
|
|
102123
|
-
var index = this._findMapping(
|
|
102124
|
-
needle,
|
|
102125
|
-
this._originalMappings,
|
|
102126
|
-
"originalLine",
|
|
102127
|
-
"originalColumn",
|
|
102128
|
-
util.compareByOriginalPositions,
|
|
102129
|
-
binarySearch.LEAST_UPPER_BOUND
|
|
102130
|
-
);
|
|
102131
|
-
if (index >= 0) {
|
|
102132
|
-
var mapping = this._originalMappings[index];
|
|
102133
|
-
if (aArgs.column === void 0) {
|
|
102134
|
-
var originalLine = mapping.originalLine;
|
|
102135
|
-
while (mapping && mapping.originalLine === originalLine) {
|
|
102136
|
-
mappings.push({
|
|
102137
|
-
line: util.getArg(mapping, "generatedLine", null),
|
|
102138
|
-
column: util.getArg(mapping, "generatedColumn", null),
|
|
102139
|
-
lastColumn: util.getArg(mapping, "lastGeneratedColumn", null)
|
|
102140
|
-
});
|
|
102141
|
-
mapping = this._originalMappings[++index];
|
|
102142
|
-
}
|
|
102143
|
-
} else {
|
|
102144
|
-
var originalColumn = mapping.originalColumn;
|
|
102145
|
-
while (mapping && mapping.originalLine === line && mapping.originalColumn == originalColumn) {
|
|
102146
|
-
mappings.push({
|
|
102147
|
-
line: util.getArg(mapping, "generatedLine", null),
|
|
102148
|
-
column: util.getArg(mapping, "generatedColumn", null),
|
|
102149
|
-
lastColumn: util.getArg(mapping, "lastGeneratedColumn", null)
|
|
102150
|
-
});
|
|
102151
|
-
mapping = this._originalMappings[++index];
|
|
102152
|
-
}
|
|
102153
|
-
}
|
|
102154
|
-
}
|
|
102155
|
-
return mappings;
|
|
102156
|
-
};
|
|
102157
|
-
exports.SourceMapConsumer = SourceMapConsumer;
|
|
102158
|
-
function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) {
|
|
102159
|
-
var sourceMap = aSourceMap;
|
|
102160
|
-
if (typeof aSourceMap === "string") {
|
|
102161
|
-
sourceMap = util.parseSourceMapInput(aSourceMap);
|
|
102162
|
-
}
|
|
102163
|
-
var version = util.getArg(sourceMap, "version");
|
|
102164
|
-
var sources = util.getArg(sourceMap, "sources");
|
|
102165
|
-
var names = util.getArg(sourceMap, "names", []);
|
|
102166
|
-
var sourceRoot = util.getArg(sourceMap, "sourceRoot", null);
|
|
102167
|
-
var sourcesContent = util.getArg(sourceMap, "sourcesContent", null);
|
|
102168
|
-
var mappings = util.getArg(sourceMap, "mappings");
|
|
102169
|
-
var file = util.getArg(sourceMap, "file", null);
|
|
102170
|
-
if (version != this._version) {
|
|
102171
|
-
throw new Error("Unsupported version: " + version);
|
|
102172
|
-
}
|
|
102173
|
-
if (sourceRoot) {
|
|
102174
|
-
sourceRoot = util.normalize(sourceRoot);
|
|
102175
|
-
}
|
|
102176
|
-
sources = sources.map(String).map(util.normalize).map(function(source) {
|
|
102177
|
-
return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) ? util.relative(sourceRoot, source) : source;
|
|
102178
|
-
});
|
|
102179
|
-
this._names = ArraySet.fromArray(names.map(String), true);
|
|
102180
|
-
this._sources = ArraySet.fromArray(sources, true);
|
|
102181
|
-
this._absoluteSources = this._sources.toArray().map(function(s) {
|
|
102182
|
-
return util.computeSourceURL(sourceRoot, s, aSourceMapURL);
|
|
102183
|
-
});
|
|
102184
|
-
this.sourceRoot = sourceRoot;
|
|
102185
|
-
this.sourcesContent = sourcesContent;
|
|
102186
|
-
this._mappings = mappings;
|
|
102187
|
-
this._sourceMapURL = aSourceMapURL;
|
|
102188
|
-
this.file = file;
|
|
102189
|
-
}
|
|
102190
|
-
BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
|
|
102191
|
-
BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;
|
|
102192
|
-
BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) {
|
|
102193
|
-
var relativeSource = aSource;
|
|
102194
|
-
if (this.sourceRoot != null) {
|
|
102195
|
-
relativeSource = util.relative(this.sourceRoot, relativeSource);
|
|
102196
|
-
}
|
|
102197
|
-
if (this._sources.has(relativeSource)) {
|
|
102198
|
-
return this._sources.indexOf(relativeSource);
|
|
102199
|
-
}
|
|
102200
|
-
var i;
|
|
102201
|
-
for (i = 0; i < this._absoluteSources.length; ++i) {
|
|
102202
|
-
if (this._absoluteSources[i] == aSource) {
|
|
102203
|
-
return i;
|
|
102204
|
-
}
|
|
102205
|
-
}
|
|
102206
|
-
return -1;
|
|
102207
|
-
};
|
|
102208
|
-
BasicSourceMapConsumer.fromSourceMap = function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) {
|
|
102209
|
-
var smc = Object.create(BasicSourceMapConsumer.prototype);
|
|
102210
|
-
var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);
|
|
102211
|
-
var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);
|
|
102212
|
-
smc.sourceRoot = aSourceMap._sourceRoot;
|
|
102213
|
-
smc.sourcesContent = aSourceMap._generateSourcesContent(
|
|
102214
|
-
smc._sources.toArray(),
|
|
102215
|
-
smc.sourceRoot
|
|
102216
|
-
);
|
|
102217
|
-
smc.file = aSourceMap._file;
|
|
102218
|
-
smc._sourceMapURL = aSourceMapURL;
|
|
102219
|
-
smc._absoluteSources = smc._sources.toArray().map(function(s) {
|
|
102220
|
-
return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL);
|
|
102221
|
-
});
|
|
102222
|
-
var generatedMappings = aSourceMap._mappings.toArray().slice();
|
|
102223
|
-
var destGeneratedMappings = smc.__generatedMappings = [];
|
|
102224
|
-
var destOriginalMappings = smc.__originalMappings = [];
|
|
102225
|
-
for (var i = 0, length = generatedMappings.length; i < length; i++) {
|
|
102226
|
-
var srcMapping = generatedMappings[i];
|
|
102227
|
-
var destMapping = new Mapping();
|
|
102228
|
-
destMapping.generatedLine = srcMapping.generatedLine;
|
|
102229
|
-
destMapping.generatedColumn = srcMapping.generatedColumn;
|
|
102230
|
-
if (srcMapping.source) {
|
|
102231
|
-
destMapping.source = sources.indexOf(srcMapping.source);
|
|
102232
|
-
destMapping.originalLine = srcMapping.originalLine;
|
|
102233
|
-
destMapping.originalColumn = srcMapping.originalColumn;
|
|
102234
|
-
if (srcMapping.name) {
|
|
102235
|
-
destMapping.name = names.indexOf(srcMapping.name);
|
|
102236
|
-
}
|
|
102237
|
-
destOriginalMappings.push(destMapping);
|
|
102238
|
-
}
|
|
102239
|
-
destGeneratedMappings.push(destMapping);
|
|
102240
|
-
}
|
|
102241
|
-
quickSort(smc.__originalMappings, util.compareByOriginalPositions);
|
|
102242
|
-
return smc;
|
|
102243
|
-
};
|
|
102244
|
-
BasicSourceMapConsumer.prototype._version = 3;
|
|
102245
|
-
Object.defineProperty(BasicSourceMapConsumer.prototype, "sources", {
|
|
102246
|
-
get: function() {
|
|
102247
|
-
return this._absoluteSources.slice();
|
|
102248
|
-
}
|
|
102249
|
-
});
|
|
102250
|
-
function Mapping() {
|
|
102251
|
-
this.generatedLine = 0;
|
|
102252
|
-
this.generatedColumn = 0;
|
|
102253
|
-
this.source = null;
|
|
102254
|
-
this.originalLine = null;
|
|
102255
|
-
this.originalColumn = null;
|
|
102256
|
-
this.name = null;
|
|
102257
|
-
}
|
|
102258
|
-
BasicSourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
|
|
102259
|
-
var generatedLine = 1;
|
|
102260
|
-
var previousGeneratedColumn = 0;
|
|
102261
|
-
var previousOriginalLine = 0;
|
|
102262
|
-
var previousOriginalColumn = 0;
|
|
102263
|
-
var previousSource = 0;
|
|
102264
|
-
var previousName = 0;
|
|
102265
|
-
var length = aStr.length;
|
|
102266
|
-
var index = 0;
|
|
102267
|
-
var cachedSegments = {};
|
|
102268
|
-
var temp = {};
|
|
102269
|
-
var originalMappings = [];
|
|
102270
|
-
var generatedMappings = [];
|
|
102271
|
-
var mapping, str, segment, end, value;
|
|
102272
|
-
while (index < length) {
|
|
102273
|
-
if (aStr.charAt(index) === ";") {
|
|
102274
|
-
generatedLine++;
|
|
102275
|
-
index++;
|
|
102276
|
-
previousGeneratedColumn = 0;
|
|
102277
|
-
} else if (aStr.charAt(index) === ",") {
|
|
102278
|
-
index++;
|
|
102279
|
-
} else {
|
|
102280
|
-
mapping = new Mapping();
|
|
102281
|
-
mapping.generatedLine = generatedLine;
|
|
102282
|
-
for (end = index; end < length; end++) {
|
|
102283
|
-
if (this._charIsMappingSeparator(aStr, end)) {
|
|
102284
|
-
break;
|
|
102285
|
-
}
|
|
102286
|
-
}
|
|
102287
|
-
str = aStr.slice(index, end);
|
|
102288
|
-
segment = cachedSegments[str];
|
|
102289
|
-
if (segment) {
|
|
102290
|
-
index += str.length;
|
|
102291
|
-
} else {
|
|
102292
|
-
segment = [];
|
|
102293
|
-
while (index < end) {
|
|
102294
|
-
base64VLQ.decode(aStr, index, temp);
|
|
102295
|
-
value = temp.value;
|
|
102296
|
-
index = temp.rest;
|
|
102297
|
-
segment.push(value);
|
|
102298
|
-
}
|
|
102299
|
-
if (segment.length === 2) {
|
|
102300
|
-
throw new Error("Found a source, but no line and column");
|
|
102301
|
-
}
|
|
102302
|
-
if (segment.length === 3) {
|
|
102303
|
-
throw new Error("Found a source and line, but no column");
|
|
102304
|
-
}
|
|
102305
|
-
cachedSegments[str] = segment;
|
|
102306
|
-
}
|
|
102307
|
-
mapping.generatedColumn = previousGeneratedColumn + segment[0];
|
|
102308
|
-
previousGeneratedColumn = mapping.generatedColumn;
|
|
102309
|
-
if (segment.length > 1) {
|
|
102310
|
-
mapping.source = previousSource + segment[1];
|
|
102311
|
-
previousSource += segment[1];
|
|
102312
|
-
mapping.originalLine = previousOriginalLine + segment[2];
|
|
102313
|
-
previousOriginalLine = mapping.originalLine;
|
|
102314
|
-
mapping.originalLine += 1;
|
|
102315
|
-
mapping.originalColumn = previousOriginalColumn + segment[3];
|
|
102316
|
-
previousOriginalColumn = mapping.originalColumn;
|
|
102317
|
-
if (segment.length > 4) {
|
|
102318
|
-
mapping.name = previousName + segment[4];
|
|
102319
|
-
previousName += segment[4];
|
|
102320
|
-
}
|
|
102321
|
-
}
|
|
102322
|
-
generatedMappings.push(mapping);
|
|
102323
|
-
if (typeof mapping.originalLine === "number") {
|
|
102324
|
-
originalMappings.push(mapping);
|
|
102325
|
-
}
|
|
102326
|
-
}
|
|
102327
|
-
}
|
|
102328
|
-
quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated);
|
|
102329
|
-
this.__generatedMappings = generatedMappings;
|
|
102330
|
-
quickSort(originalMappings, util.compareByOriginalPositions);
|
|
102331
|
-
this.__originalMappings = originalMappings;
|
|
102332
|
-
};
|
|
102333
|
-
BasicSourceMapConsumer.prototype._findMapping = function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, aColumnName, aComparator, aBias) {
|
|
102334
|
-
if (aNeedle[aLineName] <= 0) {
|
|
102335
|
-
throw new TypeError("Line must be greater than or equal to 1, got " + aNeedle[aLineName]);
|
|
102336
|
-
}
|
|
102337
|
-
if (aNeedle[aColumnName] < 0) {
|
|
102338
|
-
throw new TypeError("Column must be greater than or equal to 0, got " + aNeedle[aColumnName]);
|
|
102339
|
-
}
|
|
102340
|
-
return binarySearch.search(aNeedle, aMappings, aComparator, aBias);
|
|
102341
|
-
};
|
|
102342
|
-
BasicSourceMapConsumer.prototype.computeColumnSpans = function SourceMapConsumer_computeColumnSpans() {
|
|
102343
|
-
for (var index = 0; index < this._generatedMappings.length; ++index) {
|
|
102344
|
-
var mapping = this._generatedMappings[index];
|
|
102345
|
-
if (index + 1 < this._generatedMappings.length) {
|
|
102346
|
-
var nextMapping = this._generatedMappings[index + 1];
|
|
102347
|
-
if (mapping.generatedLine === nextMapping.generatedLine) {
|
|
102348
|
-
mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;
|
|
102349
|
-
continue;
|
|
102350
|
-
}
|
|
102351
|
-
}
|
|
102352
|
-
mapping.lastGeneratedColumn = Infinity;
|
|
102353
|
-
}
|
|
102354
|
-
};
|
|
102355
|
-
BasicSourceMapConsumer.prototype.originalPositionFor = function SourceMapConsumer_originalPositionFor(aArgs) {
|
|
102356
|
-
var needle = {
|
|
102357
|
-
generatedLine: util.getArg(aArgs, "line"),
|
|
102358
|
-
generatedColumn: util.getArg(aArgs, "column")
|
|
102359
|
-
};
|
|
102360
|
-
var index = this._findMapping(
|
|
102361
|
-
needle,
|
|
102362
|
-
this._generatedMappings,
|
|
102363
|
-
"generatedLine",
|
|
102364
|
-
"generatedColumn",
|
|
102365
|
-
util.compareByGeneratedPositionsDeflated,
|
|
102366
|
-
util.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND)
|
|
102367
|
-
);
|
|
102368
|
-
if (index >= 0) {
|
|
102369
|
-
var mapping = this._generatedMappings[index];
|
|
102370
|
-
if (mapping.generatedLine === needle.generatedLine) {
|
|
102371
|
-
var source = util.getArg(mapping, "source", null);
|
|
102372
|
-
if (source !== null) {
|
|
102373
|
-
source = this._sources.at(source);
|
|
102374
|
-
source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);
|
|
102375
|
-
}
|
|
102376
|
-
var name = util.getArg(mapping, "name", null);
|
|
102377
|
-
if (name !== null) {
|
|
102378
|
-
name = this._names.at(name);
|
|
102379
|
-
}
|
|
102380
|
-
return {
|
|
102381
|
-
source,
|
|
102382
|
-
line: util.getArg(mapping, "originalLine", null),
|
|
102383
|
-
column: util.getArg(mapping, "originalColumn", null),
|
|
102384
|
-
name
|
|
102385
|
-
};
|
|
102386
|
-
}
|
|
102387
|
-
}
|
|
102388
|
-
return {
|
|
102389
|
-
source: null,
|
|
102390
|
-
line: null,
|
|
102391
|
-
column: null,
|
|
102392
|
-
name: null
|
|
102393
|
-
};
|
|
102394
|
-
};
|
|
102395
|
-
BasicSourceMapConsumer.prototype.hasContentsOfAllSources = function BasicSourceMapConsumer_hasContentsOfAllSources() {
|
|
102396
|
-
if (!this.sourcesContent) {
|
|
102397
|
-
return false;
|
|
102398
|
-
}
|
|
102399
|
-
return this.sourcesContent.length >= this._sources.size() && !this.sourcesContent.some(function(sc) {
|
|
102400
|
-
return sc == null;
|
|
102401
|
-
});
|
|
102402
|
-
};
|
|
102403
|
-
BasicSourceMapConsumer.prototype.sourceContentFor = function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
|
|
102404
|
-
if (!this.sourcesContent) {
|
|
102405
|
-
return null;
|
|
102406
|
-
}
|
|
102407
|
-
var index = this._findSourceIndex(aSource);
|
|
102408
|
-
if (index >= 0) {
|
|
102409
|
-
return this.sourcesContent[index];
|
|
102410
|
-
}
|
|
102411
|
-
var relativeSource = aSource;
|
|
102412
|
-
if (this.sourceRoot != null) {
|
|
102413
|
-
relativeSource = util.relative(this.sourceRoot, relativeSource);
|
|
102414
|
-
}
|
|
102415
|
-
var url;
|
|
102416
|
-
if (this.sourceRoot != null && (url = util.urlParse(this.sourceRoot))) {
|
|
102417
|
-
var fileUriAbsPath = relativeSource.replace(/^file:\/\//, "");
|
|
102418
|
-
if (url.scheme == "file" && this._sources.has(fileUriAbsPath)) {
|
|
102419
|
-
return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)];
|
|
102420
|
-
}
|
|
102421
|
-
if ((!url.path || url.path == "/") && this._sources.has("/" + relativeSource)) {
|
|
102422
|
-
return this.sourcesContent[this._sources.indexOf("/" + relativeSource)];
|
|
102423
|
-
}
|
|
102424
|
-
}
|
|
102425
|
-
if (nullOnMissing) {
|
|
102426
|
-
return null;
|
|
102427
|
-
} else {
|
|
102428
|
-
throw new Error('"' + relativeSource + '" is not in the SourceMap.');
|
|
102429
|
-
}
|
|
102430
|
-
};
|
|
102431
|
-
BasicSourceMapConsumer.prototype.generatedPositionFor = function SourceMapConsumer_generatedPositionFor(aArgs) {
|
|
102432
|
-
var source = util.getArg(aArgs, "source");
|
|
102433
|
-
source = this._findSourceIndex(source);
|
|
102434
|
-
if (source < 0) {
|
|
102435
|
-
return {
|
|
102436
|
-
line: null,
|
|
102437
|
-
column: null,
|
|
102438
|
-
lastColumn: null
|
|
102439
|
-
};
|
|
102440
|
-
}
|
|
102441
|
-
var needle = {
|
|
102442
|
-
source,
|
|
102443
|
-
originalLine: util.getArg(aArgs, "line"),
|
|
102444
|
-
originalColumn: util.getArg(aArgs, "column")
|
|
102445
|
-
};
|
|
102446
|
-
var index = this._findMapping(
|
|
102447
|
-
needle,
|
|
102448
|
-
this._originalMappings,
|
|
102449
|
-
"originalLine",
|
|
102450
|
-
"originalColumn",
|
|
102451
|
-
util.compareByOriginalPositions,
|
|
102452
|
-
util.getArg(aArgs, "bias", SourceMapConsumer.GREATEST_LOWER_BOUND)
|
|
102453
|
-
);
|
|
102454
|
-
if (index >= 0) {
|
|
102455
|
-
var mapping = this._originalMappings[index];
|
|
102456
|
-
if (mapping.source === needle.source) {
|
|
102457
|
-
return {
|
|
102458
|
-
line: util.getArg(mapping, "generatedLine", null),
|
|
102459
|
-
column: util.getArg(mapping, "generatedColumn", null),
|
|
102460
|
-
lastColumn: util.getArg(mapping, "lastGeneratedColumn", null)
|
|
102461
|
-
};
|
|
102462
|
-
}
|
|
102463
|
-
}
|
|
102464
|
-
return {
|
|
102465
|
-
line: null,
|
|
102466
|
-
column: null,
|
|
102467
|
-
lastColumn: null
|
|
102468
|
-
};
|
|
102469
|
-
};
|
|
102470
|
-
exports.BasicSourceMapConsumer = BasicSourceMapConsumer;
|
|
102471
|
-
function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {
|
|
102472
|
-
var sourceMap = aSourceMap;
|
|
102473
|
-
if (typeof aSourceMap === "string") {
|
|
102474
|
-
sourceMap = util.parseSourceMapInput(aSourceMap);
|
|
102475
|
-
}
|
|
102476
|
-
var version = util.getArg(sourceMap, "version");
|
|
102477
|
-
var sections = util.getArg(sourceMap, "sections");
|
|
102478
|
-
if (version != this._version) {
|
|
102479
|
-
throw new Error("Unsupported version: " + version);
|
|
102480
|
-
}
|
|
102481
|
-
this._sources = new ArraySet();
|
|
102482
|
-
this._names = new ArraySet();
|
|
102483
|
-
var lastOffset = {
|
|
102484
|
-
line: -1,
|
|
102485
|
-
column: 0
|
|
102486
|
-
};
|
|
102487
|
-
this._sections = sections.map(function(s) {
|
|
102488
|
-
if (s.url) {
|
|
102489
|
-
throw new Error("Support for url field in sections not implemented.");
|
|
102490
|
-
}
|
|
102491
|
-
var offset = util.getArg(s, "offset");
|
|
102492
|
-
var offsetLine = util.getArg(offset, "line");
|
|
102493
|
-
var offsetColumn = util.getArg(offset, "column");
|
|
102494
|
-
if (offsetLine < lastOffset.line || offsetLine === lastOffset.line && offsetColumn < lastOffset.column) {
|
|
102495
|
-
throw new Error("Section offsets must be ordered and non-overlapping.");
|
|
102496
|
-
}
|
|
102497
|
-
lastOffset = offset;
|
|
102498
|
-
return {
|
|
102499
|
-
generatedOffset: {
|
|
102500
|
-
// The offset fields are 0-based, but we use 1-based indices when
|
|
102501
|
-
// encoding/decoding from VLQ.
|
|
102502
|
-
generatedLine: offsetLine + 1,
|
|
102503
|
-
generatedColumn: offsetColumn + 1
|
|
102504
|
-
},
|
|
102505
|
-
consumer: new SourceMapConsumer(util.getArg(s, "map"), aSourceMapURL)
|
|
102506
|
-
};
|
|
102507
|
-
});
|
|
102508
|
-
}
|
|
102509
|
-
IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
|
|
102510
|
-
IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;
|
|
102511
|
-
IndexedSourceMapConsumer.prototype._version = 3;
|
|
102512
|
-
Object.defineProperty(IndexedSourceMapConsumer.prototype, "sources", {
|
|
102513
|
-
get: function() {
|
|
102514
|
-
var sources = [];
|
|
102515
|
-
for (var i = 0; i < this._sections.length; i++) {
|
|
102516
|
-
for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {
|
|
102517
|
-
sources.push(this._sections[i].consumer.sources[j]);
|
|
102518
|
-
}
|
|
102519
|
-
}
|
|
102520
|
-
return sources;
|
|
102521
|
-
}
|
|
102522
|
-
});
|
|
102523
|
-
IndexedSourceMapConsumer.prototype.originalPositionFor = function IndexedSourceMapConsumer_originalPositionFor(aArgs) {
|
|
102524
|
-
var needle = {
|
|
102525
|
-
generatedLine: util.getArg(aArgs, "line"),
|
|
102526
|
-
generatedColumn: util.getArg(aArgs, "column")
|
|
102527
|
-
};
|
|
102528
|
-
var sectionIndex = binarySearch.search(
|
|
102529
|
-
needle,
|
|
102530
|
-
this._sections,
|
|
102531
|
-
function(needle2, section2) {
|
|
102532
|
-
var cmp = needle2.generatedLine - section2.generatedOffset.generatedLine;
|
|
102533
|
-
if (cmp) {
|
|
102534
|
-
return cmp;
|
|
102535
|
-
}
|
|
102536
|
-
return needle2.generatedColumn - section2.generatedOffset.generatedColumn;
|
|
102537
|
-
}
|
|
102538
|
-
);
|
|
102539
|
-
var section = this._sections[sectionIndex];
|
|
102540
|
-
if (!section) {
|
|
102541
|
-
return {
|
|
102542
|
-
source: null,
|
|
102543
|
-
line: null,
|
|
102544
|
-
column: null,
|
|
102545
|
-
name: null
|
|
102546
|
-
};
|
|
102547
|
-
}
|
|
102548
|
-
return section.consumer.originalPositionFor({
|
|
102549
|
-
line: needle.generatedLine - (section.generatedOffset.generatedLine - 1),
|
|
102550
|
-
column: needle.generatedColumn - (section.generatedOffset.generatedLine === needle.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0),
|
|
102551
|
-
bias: aArgs.bias
|
|
102552
|
-
});
|
|
102553
|
-
};
|
|
102554
|
-
IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = function IndexedSourceMapConsumer_hasContentsOfAllSources() {
|
|
102555
|
-
return this._sections.every(function(s) {
|
|
102556
|
-
return s.consumer.hasContentsOfAllSources();
|
|
102557
|
-
});
|
|
102558
|
-
};
|
|
102559
|
-
IndexedSourceMapConsumer.prototype.sourceContentFor = function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
|
|
102560
|
-
for (var i = 0; i < this._sections.length; i++) {
|
|
102561
|
-
var section = this._sections[i];
|
|
102562
|
-
var content = section.consumer.sourceContentFor(aSource, true);
|
|
102563
|
-
if (content) {
|
|
102564
|
-
return content;
|
|
102565
|
-
}
|
|
102566
|
-
}
|
|
102567
|
-
if (nullOnMissing) {
|
|
102568
|
-
return null;
|
|
102569
|
-
} else {
|
|
102570
|
-
throw new Error('"' + aSource + '" is not in the SourceMap.');
|
|
102571
|
-
}
|
|
102572
|
-
};
|
|
102573
|
-
IndexedSourceMapConsumer.prototype.generatedPositionFor = function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {
|
|
102574
|
-
for (var i = 0; i < this._sections.length; i++) {
|
|
102575
|
-
var section = this._sections[i];
|
|
102576
|
-
if (section.consumer._findSourceIndex(util.getArg(aArgs, "source")) === -1) {
|
|
102577
|
-
continue;
|
|
102578
|
-
}
|
|
102579
|
-
var generatedPosition = section.consumer.generatedPositionFor(aArgs);
|
|
102580
|
-
if (generatedPosition) {
|
|
102581
|
-
var ret = {
|
|
102582
|
-
line: generatedPosition.line + (section.generatedOffset.generatedLine - 1),
|
|
102583
|
-
column: generatedPosition.column + (section.generatedOffset.generatedLine === generatedPosition.line ? section.generatedOffset.generatedColumn - 1 : 0)
|
|
102584
|
-
};
|
|
102585
|
-
return ret;
|
|
102586
|
-
}
|
|
102587
|
-
}
|
|
102588
|
-
return {
|
|
102589
|
-
line: null,
|
|
102590
|
-
column: null
|
|
102591
|
-
};
|
|
102592
|
-
};
|
|
102593
|
-
IndexedSourceMapConsumer.prototype._parseMappings = function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {
|
|
102594
|
-
this.__generatedMappings = [];
|
|
102595
|
-
this.__originalMappings = [];
|
|
102596
|
-
for (var i = 0; i < this._sections.length; i++) {
|
|
102597
|
-
var section = this._sections[i];
|
|
102598
|
-
var sectionMappings = section.consumer._generatedMappings;
|
|
102599
|
-
for (var j = 0; j < sectionMappings.length; j++) {
|
|
102600
|
-
var mapping = sectionMappings[j];
|
|
102601
|
-
var source = section.consumer._sources.at(mapping.source);
|
|
102602
|
-
source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL);
|
|
102603
|
-
this._sources.add(source);
|
|
102604
|
-
source = this._sources.indexOf(source);
|
|
102605
|
-
var name = null;
|
|
102606
|
-
if (mapping.name) {
|
|
102607
|
-
name = section.consumer._names.at(mapping.name);
|
|
102608
|
-
this._names.add(name);
|
|
102609
|
-
name = this._names.indexOf(name);
|
|
102610
|
-
}
|
|
102611
|
-
var adjustedMapping = {
|
|
102612
|
-
source,
|
|
102613
|
-
generatedLine: mapping.generatedLine + (section.generatedOffset.generatedLine - 1),
|
|
102614
|
-
generatedColumn: mapping.generatedColumn + (section.generatedOffset.generatedLine === mapping.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0),
|
|
102615
|
-
originalLine: mapping.originalLine,
|
|
102616
|
-
originalColumn: mapping.originalColumn,
|
|
102617
|
-
name
|
|
102618
|
-
};
|
|
102619
|
-
this.__generatedMappings.push(adjustedMapping);
|
|
102620
|
-
if (typeof adjustedMapping.originalLine === "number") {
|
|
102621
|
-
this.__originalMappings.push(adjustedMapping);
|
|
102622
|
-
}
|
|
102623
|
-
}
|
|
102624
|
-
}
|
|
102625
|
-
quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);
|
|
102626
|
-
quickSort(this.__originalMappings, util.compareByOriginalPositions);
|
|
102627
|
-
};
|
|
102628
|
-
exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;
|
|
102629
|
-
}
|
|
102630
|
-
});
|
|
102631
|
-
|
|
102632
|
-
// ../../node_modules/source-map-support/node_modules/source-map/lib/source-node.js
|
|
102633
|
-
var require_source_node = __commonJS({
|
|
102634
|
-
"../../node_modules/source-map-support/node_modules/source-map/lib/source-node.js"(exports) {
|
|
102635
|
-
"use strict";
|
|
102636
|
-
var SourceMapGenerator = require_source_map_generator().SourceMapGenerator;
|
|
102637
|
-
var util = require_util4();
|
|
102638
|
-
var REGEX_NEWLINE = /(\r?\n)/;
|
|
102639
|
-
var NEWLINE_CODE = 10;
|
|
102640
|
-
var isSourceNode = "$$$isSourceNode$$$";
|
|
102641
|
-
function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
|
|
102642
|
-
this.children = [];
|
|
102643
|
-
this.sourceContents = {};
|
|
102644
|
-
this.line = aLine == null ? null : aLine;
|
|
102645
|
-
this.column = aColumn == null ? null : aColumn;
|
|
102646
|
-
this.source = aSource == null ? null : aSource;
|
|
102647
|
-
this.name = aName == null ? null : aName;
|
|
102648
|
-
this[isSourceNode] = true;
|
|
102649
|
-
if (aChunks != null) this.add(aChunks);
|
|
102650
|
-
}
|
|
102651
|
-
SourceNode.fromStringWithSourceMap = function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {
|
|
102652
|
-
var node = new SourceNode();
|
|
102653
|
-
var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
|
|
102654
|
-
var remainingLinesIndex = 0;
|
|
102655
|
-
var shiftNextLine = function() {
|
|
102656
|
-
var lineContents = getNextLine();
|
|
102657
|
-
var newLine = getNextLine() || "";
|
|
102658
|
-
return lineContents + newLine;
|
|
102659
|
-
function getNextLine() {
|
|
102660
|
-
return remainingLinesIndex < remainingLines.length ? remainingLines[remainingLinesIndex++] : void 0;
|
|
102661
|
-
}
|
|
102662
|
-
};
|
|
102663
|
-
var lastGeneratedLine = 1, lastGeneratedColumn = 0;
|
|
102664
|
-
var lastMapping = null;
|
|
102665
|
-
aSourceMapConsumer.eachMapping(function(mapping) {
|
|
102666
|
-
if (lastMapping !== null) {
|
|
102667
|
-
if (lastGeneratedLine < mapping.generatedLine) {
|
|
102668
|
-
addMappingWithCode(lastMapping, shiftNextLine());
|
|
102669
|
-
lastGeneratedLine++;
|
|
102670
|
-
lastGeneratedColumn = 0;
|
|
102671
|
-
} else {
|
|
102672
|
-
var nextLine = remainingLines[remainingLinesIndex] || "";
|
|
102673
|
-
var code = nextLine.substr(0, mapping.generatedColumn - lastGeneratedColumn);
|
|
102674
|
-
remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - lastGeneratedColumn);
|
|
102675
|
-
lastGeneratedColumn = mapping.generatedColumn;
|
|
102676
|
-
addMappingWithCode(lastMapping, code);
|
|
102677
|
-
lastMapping = mapping;
|
|
102678
|
-
return;
|
|
102679
|
-
}
|
|
102680
|
-
}
|
|
102681
|
-
while (lastGeneratedLine < mapping.generatedLine) {
|
|
102682
|
-
node.add(shiftNextLine());
|
|
102683
|
-
lastGeneratedLine++;
|
|
102684
|
-
}
|
|
102685
|
-
if (lastGeneratedColumn < mapping.generatedColumn) {
|
|
102686
|
-
var nextLine = remainingLines[remainingLinesIndex] || "";
|
|
102687
|
-
node.add(nextLine.substr(0, mapping.generatedColumn));
|
|
102688
|
-
remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);
|
|
102689
|
-
lastGeneratedColumn = mapping.generatedColumn;
|
|
102690
|
-
}
|
|
102691
|
-
lastMapping = mapping;
|
|
102692
|
-
}, this);
|
|
102693
|
-
if (remainingLinesIndex < remainingLines.length) {
|
|
102694
|
-
if (lastMapping) {
|
|
102695
|
-
addMappingWithCode(lastMapping, shiftNextLine());
|
|
102696
|
-
}
|
|
102697
|
-
node.add(remainingLines.splice(remainingLinesIndex).join(""));
|
|
102698
|
-
}
|
|
102699
|
-
aSourceMapConsumer.sources.forEach(function(sourceFile) {
|
|
102700
|
-
var content = aSourceMapConsumer.sourceContentFor(sourceFile);
|
|
102701
|
-
if (content != null) {
|
|
102702
|
-
if (aRelativePath != null) {
|
|
102703
|
-
sourceFile = util.join(aRelativePath, sourceFile);
|
|
102704
|
-
}
|
|
102705
|
-
node.setSourceContent(sourceFile, content);
|
|
102706
|
-
}
|
|
102707
|
-
});
|
|
102708
|
-
return node;
|
|
102709
|
-
function addMappingWithCode(mapping, code) {
|
|
102710
|
-
if (mapping === null || mapping.source === void 0) {
|
|
102711
|
-
node.add(code);
|
|
102712
|
-
} else {
|
|
102713
|
-
var source = aRelativePath ? util.join(aRelativePath, mapping.source) : mapping.source;
|
|
102714
|
-
node.add(new SourceNode(
|
|
102715
|
-
mapping.originalLine,
|
|
102716
|
-
mapping.originalColumn,
|
|
102717
|
-
source,
|
|
102718
|
-
code,
|
|
102719
|
-
mapping.name
|
|
102720
|
-
));
|
|
102721
|
-
}
|
|
102722
|
-
}
|
|
102723
|
-
};
|
|
102724
|
-
SourceNode.prototype.add = function SourceNode_add(aChunk) {
|
|
102725
|
-
if (Array.isArray(aChunk)) {
|
|
102726
|
-
aChunk.forEach(function(chunk) {
|
|
102727
|
-
this.add(chunk);
|
|
102728
|
-
}, this);
|
|
102729
|
-
} else if (aChunk[isSourceNode] || typeof aChunk === "string") {
|
|
102730
|
-
if (aChunk) {
|
|
102731
|
-
this.children.push(aChunk);
|
|
102732
|
-
}
|
|
102733
|
-
} else {
|
|
102734
|
-
throw new TypeError(
|
|
102735
|
-
"Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
|
|
102736
|
-
);
|
|
102737
|
-
}
|
|
102738
|
-
return this;
|
|
102739
|
-
};
|
|
102740
|
-
SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {
|
|
102741
|
-
if (Array.isArray(aChunk)) {
|
|
102742
|
-
for (var i = aChunk.length - 1; i >= 0; i--) {
|
|
102743
|
-
this.prepend(aChunk[i]);
|
|
102744
|
-
}
|
|
102745
|
-
} else if (aChunk[isSourceNode] || typeof aChunk === "string") {
|
|
102746
|
-
this.children.unshift(aChunk);
|
|
102747
|
-
} else {
|
|
102748
|
-
throw new TypeError(
|
|
102749
|
-
"Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
|
|
102750
|
-
);
|
|
102751
|
-
}
|
|
102752
|
-
return this;
|
|
102753
|
-
};
|
|
102754
|
-
SourceNode.prototype.walk = function SourceNode_walk(aFn) {
|
|
102755
|
-
var chunk;
|
|
102756
|
-
for (var i = 0, len = this.children.length; i < len; i++) {
|
|
102757
|
-
chunk = this.children[i];
|
|
102758
|
-
if (chunk[isSourceNode]) {
|
|
102759
|
-
chunk.walk(aFn);
|
|
102760
|
-
} else {
|
|
102761
|
-
if (chunk !== "") {
|
|
102762
|
-
aFn(chunk, {
|
|
102763
|
-
source: this.source,
|
|
102764
|
-
line: this.line,
|
|
102765
|
-
column: this.column,
|
|
102766
|
-
name: this.name
|
|
102767
|
-
});
|
|
102768
|
-
}
|
|
102769
|
-
}
|
|
102770
|
-
}
|
|
102771
|
-
};
|
|
102772
|
-
SourceNode.prototype.join = function SourceNode_join(aSep) {
|
|
102773
|
-
var newChildren;
|
|
102774
|
-
var i;
|
|
102775
|
-
var len = this.children.length;
|
|
102776
|
-
if (len > 0) {
|
|
102777
|
-
newChildren = [];
|
|
102778
|
-
for (i = 0; i < len - 1; i++) {
|
|
102779
|
-
newChildren.push(this.children[i]);
|
|
102780
|
-
newChildren.push(aSep);
|
|
102781
|
-
}
|
|
102782
|
-
newChildren.push(this.children[i]);
|
|
102783
|
-
this.children = newChildren;
|
|
102784
|
-
}
|
|
102785
|
-
return this;
|
|
102786
|
-
};
|
|
102787
|
-
SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {
|
|
102788
|
-
var lastChild = this.children[this.children.length - 1];
|
|
102789
|
-
if (lastChild[isSourceNode]) {
|
|
102790
|
-
lastChild.replaceRight(aPattern, aReplacement);
|
|
102791
|
-
} else if (typeof lastChild === "string") {
|
|
102792
|
-
this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);
|
|
102793
|
-
} else {
|
|
102794
|
-
this.children.push("".replace(aPattern, aReplacement));
|
|
102795
|
-
}
|
|
102796
|
-
return this;
|
|
102797
|
-
};
|
|
102798
|
-
SourceNode.prototype.setSourceContent = function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
|
|
102799
|
-
this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;
|
|
102800
|
-
};
|
|
102801
|
-
SourceNode.prototype.walkSourceContents = function SourceNode_walkSourceContents(aFn) {
|
|
102802
|
-
for (var i = 0, len = this.children.length; i < len; i++) {
|
|
102803
|
-
if (this.children[i][isSourceNode]) {
|
|
102804
|
-
this.children[i].walkSourceContents(aFn);
|
|
102805
|
-
}
|
|
102806
|
-
}
|
|
102807
|
-
var sources = Object.keys(this.sourceContents);
|
|
102808
|
-
for (var i = 0, len = sources.length; i < len; i++) {
|
|
102809
|
-
aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);
|
|
102810
|
-
}
|
|
102811
|
-
};
|
|
102812
|
-
SourceNode.prototype.toString = function SourceNode_toString() {
|
|
102813
|
-
var str = "";
|
|
102814
|
-
this.walk(function(chunk) {
|
|
102815
|
-
str += chunk;
|
|
102816
|
-
});
|
|
102817
|
-
return str;
|
|
102818
|
-
};
|
|
102819
|
-
SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
|
|
102820
|
-
var generated = {
|
|
102821
|
-
code: "",
|
|
102822
|
-
line: 1,
|
|
102823
|
-
column: 0
|
|
102824
|
-
};
|
|
102825
|
-
var map2 = new SourceMapGenerator(aArgs);
|
|
102826
|
-
var sourceMappingActive = false;
|
|
102827
|
-
var lastOriginalSource = null;
|
|
102828
|
-
var lastOriginalLine = null;
|
|
102829
|
-
var lastOriginalColumn = null;
|
|
102830
|
-
var lastOriginalName = null;
|
|
102831
|
-
this.walk(function(chunk, original) {
|
|
102832
|
-
generated.code += chunk;
|
|
102833
|
-
if (original.source !== null && original.line !== null && original.column !== null) {
|
|
102834
|
-
if (lastOriginalSource !== original.source || lastOriginalLine !== original.line || lastOriginalColumn !== original.column || lastOriginalName !== original.name) {
|
|
102835
|
-
map2.addMapping({
|
|
102836
|
-
source: original.source,
|
|
102837
|
-
original: {
|
|
102838
|
-
line: original.line,
|
|
102839
|
-
column: original.column
|
|
102840
|
-
},
|
|
102841
|
-
generated: {
|
|
102842
|
-
line: generated.line,
|
|
102843
|
-
column: generated.column
|
|
102844
|
-
},
|
|
102845
|
-
name: original.name
|
|
102846
|
-
});
|
|
102847
|
-
}
|
|
102848
|
-
lastOriginalSource = original.source;
|
|
102849
|
-
lastOriginalLine = original.line;
|
|
102850
|
-
lastOriginalColumn = original.column;
|
|
102851
|
-
lastOriginalName = original.name;
|
|
102852
|
-
sourceMappingActive = true;
|
|
102853
|
-
} else if (sourceMappingActive) {
|
|
102854
|
-
map2.addMapping({
|
|
102855
|
-
generated: {
|
|
102856
|
-
line: generated.line,
|
|
102857
|
-
column: generated.column
|
|
102858
|
-
}
|
|
102859
|
-
});
|
|
102860
|
-
lastOriginalSource = null;
|
|
102861
|
-
sourceMappingActive = false;
|
|
102862
|
-
}
|
|
102863
|
-
for (var idx = 0, length = chunk.length; idx < length; idx++) {
|
|
102864
|
-
if (chunk.charCodeAt(idx) === NEWLINE_CODE) {
|
|
102865
|
-
generated.line++;
|
|
102866
|
-
generated.column = 0;
|
|
102867
|
-
if (idx + 1 === length) {
|
|
102868
|
-
lastOriginalSource = null;
|
|
102869
|
-
sourceMappingActive = false;
|
|
102870
|
-
} else if (sourceMappingActive) {
|
|
102871
|
-
map2.addMapping({
|
|
102872
|
-
source: original.source,
|
|
102873
|
-
original: {
|
|
102874
|
-
line: original.line,
|
|
102875
|
-
column: original.column
|
|
102876
|
-
},
|
|
102877
|
-
generated: {
|
|
102878
|
-
line: generated.line,
|
|
102879
|
-
column: generated.column
|
|
102880
|
-
},
|
|
102881
|
-
name: original.name
|
|
102882
|
-
});
|
|
102883
|
-
}
|
|
102884
|
-
} else {
|
|
102885
|
-
generated.column++;
|
|
102886
|
-
}
|
|
102887
|
-
}
|
|
102888
|
-
});
|
|
102889
|
-
this.walkSourceContents(function(sourceFile, sourceContent) {
|
|
102890
|
-
map2.setSourceContent(sourceFile, sourceContent);
|
|
102891
|
-
});
|
|
102892
|
-
return { code: generated.code, map: map2 };
|
|
102893
|
-
};
|
|
102894
|
-
exports.SourceNode = SourceNode;
|
|
102895
|
-
}
|
|
102896
|
-
});
|
|
102897
|
-
|
|
102898
|
-
// ../../node_modules/source-map-support/node_modules/source-map/source-map.js
|
|
102899
|
-
var require_source_map = __commonJS({
|
|
102900
|
-
"../../node_modules/source-map-support/node_modules/source-map/source-map.js"(exports) {
|
|
102901
|
-
"use strict";
|
|
102902
|
-
exports.SourceMapGenerator = require_source_map_generator().SourceMapGenerator;
|
|
102903
|
-
exports.SourceMapConsumer = require_source_map_consumer().SourceMapConsumer;
|
|
102904
|
-
exports.SourceNode = require_source_node().SourceNode;
|
|
102905
|
-
}
|
|
102906
|
-
});
|
|
102907
|
-
|
|
102908
|
-
// ../../node_modules/buffer-from/index.js
|
|
102909
|
-
var require_buffer_from = __commonJS({
|
|
102910
|
-
"../../node_modules/buffer-from/index.js"(exports, module) {
|
|
102911
|
-
"use strict";
|
|
102912
|
-
var toString = Object.prototype.toString;
|
|
102913
|
-
var isModern = typeof Buffer !== "undefined" && typeof Buffer.alloc === "function" && typeof Buffer.allocUnsafe === "function" && typeof Buffer.from === "function";
|
|
102914
|
-
function isArrayBuffer(input) {
|
|
102915
|
-
return toString.call(input).slice(8, -1) === "ArrayBuffer";
|
|
102916
|
-
}
|
|
102917
|
-
function fromArrayBuffer(obj, byteOffset, length) {
|
|
102918
|
-
byteOffset >>>= 0;
|
|
102919
|
-
var maxLength = obj.byteLength - byteOffset;
|
|
102920
|
-
if (maxLength < 0) {
|
|
102921
|
-
throw new RangeError("'offset' is out of bounds");
|
|
102922
|
-
}
|
|
102923
|
-
if (length === void 0) {
|
|
102924
|
-
length = maxLength;
|
|
102925
|
-
} else {
|
|
102926
|
-
length >>>= 0;
|
|
102927
|
-
if (length > maxLength) {
|
|
102928
|
-
throw new RangeError("'length' is out of bounds");
|
|
102929
|
-
}
|
|
102930
|
-
}
|
|
102931
|
-
return isModern ? Buffer.from(obj.slice(byteOffset, byteOffset + length)) : new Buffer(new Uint8Array(obj.slice(byteOffset, byteOffset + length)));
|
|
102932
|
-
}
|
|
102933
|
-
function fromString(string, encoding) {
|
|
102934
|
-
if (typeof encoding !== "string" || encoding === "") {
|
|
102935
|
-
encoding = "utf8";
|
|
102936
|
-
}
|
|
102937
|
-
if (!Buffer.isEncoding(encoding)) {
|
|
102938
|
-
throw new TypeError('"encoding" must be a valid string encoding');
|
|
102939
|
-
}
|
|
102940
|
-
return isModern ? Buffer.from(string, encoding) : new Buffer(string, encoding);
|
|
102941
|
-
}
|
|
102942
|
-
function bufferFrom(value, encodingOrOffset, length) {
|
|
102943
|
-
if (typeof value === "number") {
|
|
102944
|
-
throw new TypeError('"value" argument must not be a number');
|
|
102945
|
-
}
|
|
102946
|
-
if (isArrayBuffer(value)) {
|
|
102947
|
-
return fromArrayBuffer(value, encodingOrOffset, length);
|
|
102948
|
-
}
|
|
102949
|
-
if (typeof value === "string") {
|
|
102950
|
-
return fromString(value, encodingOrOffset);
|
|
102951
|
-
}
|
|
102952
|
-
return isModern ? Buffer.from(value) : new Buffer(value);
|
|
102953
|
-
}
|
|
102954
|
-
module.exports = bufferFrom;
|
|
102955
|
-
}
|
|
102956
|
-
});
|
|
102957
|
-
|
|
102958
|
-
// ../../node_modules/source-map-support/source-map-support.js
|
|
102959
|
-
var require_source_map_support = __commonJS({
|
|
102960
|
-
"../../node_modules/source-map-support/source-map-support.js"(exports, module) {
|
|
102961
|
-
"use strict";
|
|
102962
|
-
var SourceMapConsumer = require_source_map().SourceMapConsumer;
|
|
102963
|
-
var path = __require("path");
|
|
102964
|
-
var fs;
|
|
102965
|
-
try {
|
|
102966
|
-
fs = __require("fs");
|
|
102967
|
-
if (!fs.existsSync || !fs.readFileSync) {
|
|
102968
|
-
fs = null;
|
|
102969
|
-
}
|
|
102970
|
-
} catch (err) {
|
|
102971
|
-
}
|
|
102972
|
-
var bufferFrom = require_buffer_from();
|
|
102973
|
-
function dynamicRequire(mod, request) {
|
|
102974
|
-
return mod.require(request);
|
|
102975
|
-
}
|
|
102976
|
-
var errorFormatterInstalled = false;
|
|
102977
|
-
var uncaughtShimInstalled = false;
|
|
102978
|
-
var emptyCacheBetweenOperations = false;
|
|
102979
|
-
var environment = "auto";
|
|
102980
|
-
var fileContentsCache = {};
|
|
102981
|
-
var sourceMapCache = {};
|
|
102982
|
-
var reSourceMap = /^data:application\/json[^,]+base64,/;
|
|
102983
|
-
var retrieveFileHandlers = [];
|
|
102984
|
-
var retrieveMapHandlers = [];
|
|
102985
|
-
function isInBrowser() {
|
|
102986
|
-
if (environment === "browser")
|
|
102987
|
-
return true;
|
|
102988
|
-
if (environment === "node")
|
|
102989
|
-
return false;
|
|
102990
|
-
return typeof window !== "undefined" && typeof XMLHttpRequest === "function" && !(window.require && window.module && window.process && window.process.type === "renderer");
|
|
102991
|
-
}
|
|
102992
|
-
function hasGlobalProcessEventEmitter() {
|
|
102993
|
-
return typeof process === "object" && process !== null && typeof process.on === "function";
|
|
102994
|
-
}
|
|
102995
|
-
function globalProcessVersion() {
|
|
102996
|
-
if (typeof process === "object" && process !== null) {
|
|
102997
|
-
return process.version;
|
|
102998
|
-
} else {
|
|
102999
|
-
return "";
|
|
103000
|
-
}
|
|
103001
|
-
}
|
|
103002
|
-
function globalProcessStderr() {
|
|
103003
|
-
if (typeof process === "object" && process !== null) {
|
|
103004
|
-
return process.stderr;
|
|
103005
|
-
}
|
|
103006
|
-
}
|
|
103007
|
-
function globalProcessExit(code) {
|
|
103008
|
-
if (typeof process === "object" && process !== null && typeof process.exit === "function") {
|
|
103009
|
-
return process.exit(code);
|
|
103010
|
-
}
|
|
103011
|
-
}
|
|
103012
|
-
function handlerExec(list) {
|
|
103013
|
-
return function(arg) {
|
|
103014
|
-
for (var i = 0; i < list.length; i++) {
|
|
103015
|
-
var ret = list[i](arg);
|
|
103016
|
-
if (ret) {
|
|
103017
|
-
return ret;
|
|
103018
|
-
}
|
|
103019
|
-
}
|
|
103020
|
-
return null;
|
|
103021
|
-
};
|
|
103022
|
-
}
|
|
103023
|
-
var retrieveFile = handlerExec(retrieveFileHandlers);
|
|
103024
|
-
retrieveFileHandlers.push(function(path2) {
|
|
103025
|
-
path2 = path2.trim();
|
|
103026
|
-
if (/^file:/.test(path2)) {
|
|
103027
|
-
path2 = path2.replace(/file:\/\/\/(\w:)?/, function(protocol, drive) {
|
|
103028
|
-
return drive ? "" : (
|
|
103029
|
-
// file:///C:/dir/file -> C:/dir/file
|
|
103030
|
-
"/"
|
|
103031
|
-
);
|
|
103032
|
-
});
|
|
103033
|
-
}
|
|
103034
|
-
if (path2 in fileContentsCache) {
|
|
103035
|
-
return fileContentsCache[path2];
|
|
103036
|
-
}
|
|
103037
|
-
var contents = "";
|
|
103038
|
-
try {
|
|
103039
|
-
if (!fs) {
|
|
103040
|
-
var xhr = new XMLHttpRequest();
|
|
103041
|
-
xhr.open(
|
|
103042
|
-
"GET",
|
|
103043
|
-
path2,
|
|
103044
|
-
/** async */
|
|
103045
|
-
false
|
|
103046
|
-
);
|
|
103047
|
-
xhr.send(null);
|
|
103048
|
-
if (xhr.readyState === 4 && xhr.status === 200) {
|
|
103049
|
-
contents = xhr.responseText;
|
|
103050
|
-
}
|
|
103051
|
-
} else if (fs.existsSync(path2)) {
|
|
103052
|
-
contents = fs.readFileSync(path2, "utf8");
|
|
103053
|
-
}
|
|
103054
|
-
} catch (er) {
|
|
103055
|
-
}
|
|
103056
|
-
return fileContentsCache[path2] = contents;
|
|
103057
|
-
});
|
|
103058
|
-
function supportRelativeURL(file, url) {
|
|
103059
|
-
if (!file) return url;
|
|
103060
|
-
var dir = path.dirname(file);
|
|
103061
|
-
var match = /^\w+:\/\/[^\/]*/.exec(dir);
|
|
103062
|
-
var protocol = match ? match[0] : "";
|
|
103063
|
-
var startPath = dir.slice(protocol.length);
|
|
103064
|
-
if (protocol && /^\/\w\:/.test(startPath)) {
|
|
103065
|
-
protocol += "/";
|
|
103066
|
-
return protocol + path.resolve(dir.slice(protocol.length), url).replace(/\\/g, "/");
|
|
103067
|
-
}
|
|
103068
|
-
return protocol + path.resolve(dir.slice(protocol.length), url);
|
|
103069
|
-
}
|
|
103070
|
-
function retrieveSourceMapURL(source) {
|
|
103071
|
-
var fileData;
|
|
103072
|
-
if (isInBrowser()) {
|
|
103073
|
-
try {
|
|
103074
|
-
var xhr = new XMLHttpRequest();
|
|
103075
|
-
xhr.open("GET", source, false);
|
|
103076
|
-
xhr.send(null);
|
|
103077
|
-
fileData = xhr.readyState === 4 ? xhr.responseText : null;
|
|
103078
|
-
var sourceMapHeader = xhr.getResponseHeader("SourceMap") || xhr.getResponseHeader("X-SourceMap");
|
|
103079
|
-
if (sourceMapHeader) {
|
|
103080
|
-
return sourceMapHeader;
|
|
103081
|
-
}
|
|
103082
|
-
} catch (e) {
|
|
103083
|
-
}
|
|
103084
|
-
}
|
|
103085
|
-
fileData = retrieveFile(source);
|
|
103086
|
-
var re = /(?:\/\/[@#][\s]*sourceMappingURL=([^\s'"]+)[\s]*$)|(?:\/\*[@#][\s]*sourceMappingURL=([^\s*'"]+)[\s]*(?:\*\/)[\s]*$)/mg;
|
|
103087
|
-
var lastMatch, match;
|
|
103088
|
-
while (match = re.exec(fileData)) lastMatch = match;
|
|
103089
|
-
if (!lastMatch) return null;
|
|
103090
|
-
return lastMatch[1];
|
|
103091
|
-
}
|
|
103092
|
-
var retrieveSourceMap = handlerExec(retrieveMapHandlers);
|
|
103093
|
-
retrieveMapHandlers.push(function(source) {
|
|
103094
|
-
var sourceMappingURL = retrieveSourceMapURL(source);
|
|
103095
|
-
if (!sourceMappingURL) return null;
|
|
103096
|
-
var sourceMapData;
|
|
103097
|
-
if (reSourceMap.test(sourceMappingURL)) {
|
|
103098
|
-
var rawData = sourceMappingURL.slice(sourceMappingURL.indexOf(",") + 1);
|
|
103099
|
-
sourceMapData = bufferFrom(rawData, "base64").toString();
|
|
103100
|
-
sourceMappingURL = source;
|
|
103101
|
-
} else {
|
|
103102
|
-
sourceMappingURL = supportRelativeURL(source, sourceMappingURL);
|
|
103103
|
-
sourceMapData = retrieveFile(sourceMappingURL);
|
|
103104
|
-
}
|
|
103105
|
-
if (!sourceMapData) {
|
|
103106
|
-
return null;
|
|
103107
|
-
}
|
|
103108
|
-
return {
|
|
103109
|
-
url: sourceMappingURL,
|
|
103110
|
-
map: sourceMapData
|
|
103111
|
-
};
|
|
103112
|
-
});
|
|
103113
|
-
function mapSourcePosition(position) {
|
|
103114
|
-
var sourceMap = sourceMapCache[position.source];
|
|
103115
|
-
if (!sourceMap) {
|
|
103116
|
-
var urlAndMap = retrieveSourceMap(position.source);
|
|
103117
|
-
if (urlAndMap) {
|
|
103118
|
-
sourceMap = sourceMapCache[position.source] = {
|
|
103119
|
-
url: urlAndMap.url,
|
|
103120
|
-
map: new SourceMapConsumer(urlAndMap.map)
|
|
103121
|
-
};
|
|
103122
|
-
if (sourceMap.map.sourcesContent) {
|
|
103123
|
-
sourceMap.map.sources.forEach(function(source, i) {
|
|
103124
|
-
var contents = sourceMap.map.sourcesContent[i];
|
|
103125
|
-
if (contents) {
|
|
103126
|
-
var url = supportRelativeURL(sourceMap.url, source);
|
|
103127
|
-
fileContentsCache[url] = contents;
|
|
103128
|
-
}
|
|
103129
|
-
});
|
|
103130
|
-
}
|
|
103131
|
-
} else {
|
|
103132
|
-
sourceMap = sourceMapCache[position.source] = {
|
|
103133
|
-
url: null,
|
|
103134
|
-
map: null
|
|
103135
|
-
};
|
|
103136
|
-
}
|
|
103137
|
-
}
|
|
103138
|
-
if (sourceMap && sourceMap.map && typeof sourceMap.map.originalPositionFor === "function") {
|
|
103139
|
-
var originalPosition = sourceMap.map.originalPositionFor(position);
|
|
103140
|
-
if (originalPosition.source !== null) {
|
|
103141
|
-
originalPosition.source = supportRelativeURL(
|
|
103142
|
-
sourceMap.url,
|
|
103143
|
-
originalPosition.source
|
|
103144
|
-
);
|
|
103145
|
-
return originalPosition;
|
|
103146
|
-
}
|
|
103147
|
-
}
|
|
103148
|
-
return position;
|
|
103149
|
-
}
|
|
103150
|
-
function mapEvalOrigin(origin) {
|
|
103151
|
-
var match = /^eval at ([^(]+) \((.+):(\d+):(\d+)\)$/.exec(origin);
|
|
103152
|
-
if (match) {
|
|
103153
|
-
var position = mapSourcePosition({
|
|
103154
|
-
source: match[2],
|
|
103155
|
-
line: +match[3],
|
|
103156
|
-
column: match[4] - 1
|
|
103157
|
-
});
|
|
103158
|
-
return "eval at " + match[1] + " (" + position.source + ":" + position.line + ":" + (position.column + 1) + ")";
|
|
103159
|
-
}
|
|
103160
|
-
match = /^eval at ([^(]+) \((.+)\)$/.exec(origin);
|
|
103161
|
-
if (match) {
|
|
103162
|
-
return "eval at " + match[1] + " (" + mapEvalOrigin(match[2]) + ")";
|
|
103163
|
-
}
|
|
103164
|
-
return origin;
|
|
103165
|
-
}
|
|
103166
|
-
function CallSiteToString() {
|
|
103167
|
-
var fileName;
|
|
103168
|
-
var fileLocation = "";
|
|
103169
|
-
if (this.isNative()) {
|
|
103170
|
-
fileLocation = "native";
|
|
103171
|
-
} else {
|
|
103172
|
-
fileName = this.getScriptNameOrSourceURL();
|
|
103173
|
-
if (!fileName && this.isEval()) {
|
|
103174
|
-
fileLocation = this.getEvalOrigin();
|
|
103175
|
-
fileLocation += ", ";
|
|
103176
|
-
}
|
|
103177
|
-
if (fileName) {
|
|
103178
|
-
fileLocation += fileName;
|
|
103179
|
-
} else {
|
|
103180
|
-
fileLocation += "<anonymous>";
|
|
103181
|
-
}
|
|
103182
|
-
var lineNumber = this.getLineNumber();
|
|
103183
|
-
if (lineNumber != null) {
|
|
103184
|
-
fileLocation += ":" + lineNumber;
|
|
103185
|
-
var columnNumber = this.getColumnNumber();
|
|
103186
|
-
if (columnNumber) {
|
|
103187
|
-
fileLocation += ":" + columnNumber;
|
|
103188
|
-
}
|
|
103189
|
-
}
|
|
103190
|
-
}
|
|
103191
|
-
var line = "";
|
|
103192
|
-
var functionName = this.getFunctionName();
|
|
103193
|
-
var addSuffix = true;
|
|
103194
|
-
var isConstructor = this.isConstructor();
|
|
103195
|
-
var isMethodCall = !(this.isToplevel() || isConstructor);
|
|
103196
|
-
if (isMethodCall) {
|
|
103197
|
-
var typeName = this.getTypeName();
|
|
103198
|
-
if (typeName === "[object Object]") {
|
|
103199
|
-
typeName = "null";
|
|
103200
|
-
}
|
|
103201
|
-
var methodName = this.getMethodName();
|
|
103202
|
-
if (functionName) {
|
|
103203
|
-
if (typeName && functionName.indexOf(typeName) != 0) {
|
|
103204
|
-
line += typeName + ".";
|
|
103205
|
-
}
|
|
103206
|
-
line += functionName;
|
|
103207
|
-
if (methodName && functionName.indexOf("." + methodName) != functionName.length - methodName.length - 1) {
|
|
103208
|
-
line += " [as " + methodName + "]";
|
|
103209
|
-
}
|
|
103210
|
-
} else {
|
|
103211
|
-
line += typeName + "." + (methodName || "<anonymous>");
|
|
103212
|
-
}
|
|
103213
|
-
} else if (isConstructor) {
|
|
103214
|
-
line += "new " + (functionName || "<anonymous>");
|
|
103215
|
-
} else if (functionName) {
|
|
103216
|
-
line += functionName;
|
|
103217
|
-
} else {
|
|
103218
|
-
line += fileLocation;
|
|
103219
|
-
addSuffix = false;
|
|
103220
|
-
}
|
|
103221
|
-
if (addSuffix) {
|
|
103222
|
-
line += " (" + fileLocation + ")";
|
|
103223
|
-
}
|
|
103224
|
-
return line;
|
|
103225
|
-
}
|
|
103226
|
-
function cloneCallSite(frame) {
|
|
103227
|
-
var object = {};
|
|
103228
|
-
Object.getOwnPropertyNames(Object.getPrototypeOf(frame)).forEach(function(name) {
|
|
103229
|
-
object[name] = /^(?:is|get)/.test(name) ? function() {
|
|
103230
|
-
return frame[name].call(frame);
|
|
103231
|
-
} : frame[name];
|
|
103232
|
-
});
|
|
103233
|
-
object.toString = CallSiteToString;
|
|
103234
|
-
return object;
|
|
103235
|
-
}
|
|
103236
|
-
function wrapCallSite(frame, state2) {
|
|
103237
|
-
if (state2 === void 0) {
|
|
103238
|
-
state2 = { nextPosition: null, curPosition: null };
|
|
103239
|
-
}
|
|
103240
|
-
if (frame.isNative()) {
|
|
103241
|
-
state2.curPosition = null;
|
|
103242
|
-
return frame;
|
|
103243
|
-
}
|
|
103244
|
-
var source = frame.getFileName() || frame.getScriptNameOrSourceURL();
|
|
103245
|
-
if (source) {
|
|
103246
|
-
var line = frame.getLineNumber();
|
|
103247
|
-
var column = frame.getColumnNumber() - 1;
|
|
103248
|
-
var noHeader = /^v(10\.1[6-9]|10\.[2-9][0-9]|10\.[0-9]{3,}|1[2-9]\d*|[2-9]\d|\d{3,}|11\.11)/;
|
|
103249
|
-
var headerLength = noHeader.test(globalProcessVersion()) ? 0 : 62;
|
|
103250
|
-
if (line === 1 && column > headerLength && !isInBrowser() && !frame.isEval()) {
|
|
103251
|
-
column -= headerLength;
|
|
103252
|
-
}
|
|
103253
|
-
var position = mapSourcePosition({
|
|
103254
|
-
source,
|
|
103255
|
-
line,
|
|
103256
|
-
column
|
|
103257
|
-
});
|
|
103258
|
-
state2.curPosition = position;
|
|
103259
|
-
frame = cloneCallSite(frame);
|
|
103260
|
-
var originalFunctionName = frame.getFunctionName;
|
|
103261
|
-
frame.getFunctionName = function() {
|
|
103262
|
-
if (state2.nextPosition == null) {
|
|
103263
|
-
return originalFunctionName();
|
|
103264
|
-
}
|
|
103265
|
-
return state2.nextPosition.name || originalFunctionName();
|
|
103266
|
-
};
|
|
103267
|
-
frame.getFileName = function() {
|
|
103268
|
-
return position.source;
|
|
103269
|
-
};
|
|
103270
|
-
frame.getLineNumber = function() {
|
|
103271
|
-
return position.line;
|
|
103272
|
-
};
|
|
103273
|
-
frame.getColumnNumber = function() {
|
|
103274
|
-
return position.column + 1;
|
|
103275
|
-
};
|
|
103276
|
-
frame.getScriptNameOrSourceURL = function() {
|
|
103277
|
-
return position.source;
|
|
103278
|
-
};
|
|
103279
|
-
return frame;
|
|
103280
|
-
}
|
|
103281
|
-
var origin = frame.isEval() && frame.getEvalOrigin();
|
|
103282
|
-
if (origin) {
|
|
103283
|
-
origin = mapEvalOrigin(origin);
|
|
103284
|
-
frame = cloneCallSite(frame);
|
|
103285
|
-
frame.getEvalOrigin = function() {
|
|
103286
|
-
return origin;
|
|
103287
|
-
};
|
|
103288
|
-
return frame;
|
|
103289
|
-
}
|
|
103290
|
-
return frame;
|
|
103291
|
-
}
|
|
103292
|
-
function prepareStackTrace(error2, stack) {
|
|
103293
|
-
if (emptyCacheBetweenOperations) {
|
|
103294
|
-
fileContentsCache = {};
|
|
103295
|
-
sourceMapCache = {};
|
|
103296
|
-
}
|
|
103297
|
-
var name = error2.name || "Error";
|
|
103298
|
-
var message = error2.message || "";
|
|
103299
|
-
var errorString = name + ": " + message;
|
|
103300
|
-
var state2 = { nextPosition: null, curPosition: null };
|
|
103301
|
-
var processedStack = [];
|
|
103302
|
-
for (var i = stack.length - 1; i >= 0; i--) {
|
|
103303
|
-
processedStack.push("\n at " + wrapCallSite(stack[i], state2));
|
|
103304
|
-
state2.nextPosition = state2.curPosition;
|
|
103305
|
-
}
|
|
103306
|
-
state2.curPosition = state2.nextPosition = null;
|
|
103307
|
-
return errorString + processedStack.reverse().join("");
|
|
103308
|
-
}
|
|
103309
|
-
function getErrorSource(error2) {
|
|
103310
|
-
var match = /\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(error2.stack);
|
|
103311
|
-
if (match) {
|
|
103312
|
-
var source = match[1];
|
|
103313
|
-
var line = +match[2];
|
|
103314
|
-
var column = +match[3];
|
|
103315
|
-
var contents = fileContentsCache[source];
|
|
103316
|
-
if (!contents && fs && fs.existsSync(source)) {
|
|
103317
|
-
try {
|
|
103318
|
-
contents = fs.readFileSync(source, "utf8");
|
|
103319
|
-
} catch (er) {
|
|
103320
|
-
contents = "";
|
|
103321
|
-
}
|
|
103322
|
-
}
|
|
103323
|
-
if (contents) {
|
|
103324
|
-
var code = contents.split(/(?:\r\n|\r|\n)/)[line - 1];
|
|
103325
|
-
if (code) {
|
|
103326
|
-
return source + ":" + line + "\n" + code + "\n" + new Array(column).join(" ") + "^";
|
|
103327
|
-
}
|
|
103328
|
-
}
|
|
103329
|
-
}
|
|
103330
|
-
return null;
|
|
103331
|
-
}
|
|
103332
|
-
function printErrorAndExit(error2) {
|
|
103333
|
-
var source = getErrorSource(error2);
|
|
103334
|
-
var stderr = globalProcessStderr();
|
|
103335
|
-
if (stderr && stderr._handle && stderr._handle.setBlocking) {
|
|
103336
|
-
stderr._handle.setBlocking(true);
|
|
103337
|
-
}
|
|
103338
|
-
if (source) {
|
|
103339
|
-
console.error();
|
|
103340
|
-
console.error(source);
|
|
103341
|
-
}
|
|
103342
|
-
console.error(error2.stack);
|
|
103343
|
-
globalProcessExit(1);
|
|
103344
|
-
}
|
|
103345
|
-
function shimEmitUncaughtException() {
|
|
103346
|
-
var origEmit = process.emit;
|
|
103347
|
-
process.emit = function(type) {
|
|
103348
|
-
if (type === "uncaughtException") {
|
|
103349
|
-
var hasStack = arguments[1] && arguments[1].stack;
|
|
103350
|
-
var hasListeners = this.listeners(type).length > 0;
|
|
103351
|
-
if (hasStack && !hasListeners) {
|
|
103352
|
-
return printErrorAndExit(arguments[1]);
|
|
103353
|
-
}
|
|
103354
|
-
}
|
|
103355
|
-
return origEmit.apply(this, arguments);
|
|
103356
|
-
};
|
|
103357
|
-
}
|
|
103358
|
-
var originalRetrieveFileHandlers = retrieveFileHandlers.slice(0);
|
|
103359
|
-
var originalRetrieveMapHandlers = retrieveMapHandlers.slice(0);
|
|
103360
|
-
exports.wrapCallSite = wrapCallSite;
|
|
103361
|
-
exports.getErrorSource = getErrorSource;
|
|
103362
|
-
exports.mapSourcePosition = mapSourcePosition;
|
|
103363
|
-
exports.retrieveSourceMap = retrieveSourceMap;
|
|
103364
|
-
exports.install = function(options) {
|
|
103365
|
-
options = options || {};
|
|
103366
|
-
if (options.environment) {
|
|
103367
|
-
environment = options.environment;
|
|
103368
|
-
if (["node", "browser", "auto"].indexOf(environment) === -1) {
|
|
103369
|
-
throw new Error("environment " + environment + " was unknown. Available options are {auto, browser, node}");
|
|
103370
|
-
}
|
|
103371
|
-
}
|
|
103372
|
-
if (options.retrieveFile) {
|
|
103373
|
-
if (options.overrideRetrieveFile) {
|
|
103374
|
-
retrieveFileHandlers.length = 0;
|
|
103375
|
-
}
|
|
103376
|
-
retrieveFileHandlers.unshift(options.retrieveFile);
|
|
103377
|
-
}
|
|
103378
|
-
if (options.retrieveSourceMap) {
|
|
103379
|
-
if (options.overrideRetrieveSourceMap) {
|
|
103380
|
-
retrieveMapHandlers.length = 0;
|
|
103381
|
-
}
|
|
103382
|
-
retrieveMapHandlers.unshift(options.retrieveSourceMap);
|
|
103383
|
-
}
|
|
103384
|
-
if (options.hookRequire && !isInBrowser()) {
|
|
103385
|
-
var Module = dynamicRequire(module, "module");
|
|
103386
|
-
var $compile = Module.prototype._compile;
|
|
103387
|
-
if (!$compile.__sourceMapSupport) {
|
|
103388
|
-
Module.prototype._compile = function(content, filename) {
|
|
103389
|
-
fileContentsCache[filename] = content;
|
|
103390
|
-
sourceMapCache[filename] = void 0;
|
|
103391
|
-
return $compile.call(this, content, filename);
|
|
103392
|
-
};
|
|
103393
|
-
Module.prototype._compile.__sourceMapSupport = true;
|
|
103394
|
-
}
|
|
103395
|
-
}
|
|
103396
|
-
if (!emptyCacheBetweenOperations) {
|
|
103397
|
-
emptyCacheBetweenOperations = "emptyCacheBetweenOperations" in options ? options.emptyCacheBetweenOperations : false;
|
|
103398
|
-
}
|
|
103399
|
-
if (!errorFormatterInstalled) {
|
|
103400
|
-
errorFormatterInstalled = true;
|
|
103401
|
-
Error.prepareStackTrace = prepareStackTrace;
|
|
103402
|
-
}
|
|
103403
|
-
if (!uncaughtShimInstalled) {
|
|
103404
|
-
var installHandler = "handleUncaughtExceptions" in options ? options.handleUncaughtExceptions : true;
|
|
103405
|
-
try {
|
|
103406
|
-
var worker_threads = dynamicRequire(module, "worker_threads");
|
|
103407
|
-
if (worker_threads.isMainThread === false) {
|
|
103408
|
-
installHandler = false;
|
|
103409
|
-
}
|
|
103410
|
-
} catch (e) {
|
|
103411
|
-
}
|
|
103412
|
-
if (installHandler && hasGlobalProcessEventEmitter()) {
|
|
103413
|
-
uncaughtShimInstalled = true;
|
|
103414
|
-
shimEmitUncaughtException();
|
|
103415
|
-
}
|
|
103416
|
-
}
|
|
103417
|
-
};
|
|
103418
|
-
exports.resetRetrieveHandlers = function() {
|
|
103419
|
-
retrieveFileHandlers.length = 0;
|
|
103420
|
-
retrieveMapHandlers.length = 0;
|
|
103421
|
-
retrieveFileHandlers = originalRetrieveFileHandlers.slice(0);
|
|
103422
|
-
retrieveMapHandlers = originalRetrieveMapHandlers.slice(0);
|
|
103423
|
-
retrieveSourceMap = handlerExec(retrieveMapHandlers);
|
|
103424
|
-
retrieveFile = handlerExec(retrieveFileHandlers);
|
|
103425
|
-
};
|
|
103426
|
-
}
|
|
103427
|
-
});
|
|
103428
|
-
|
|
103429
101539
|
// ../../node_modules/typescript/lib/typescript.js
|
|
103430
101540
|
var require_typescript = __commonJS({
|
|
103431
101541
|
"../../node_modules/typescript/lib/typescript.js"(exports, module) {
|
|
@@ -112082,7 +110192,7 @@ ${lanes.join("\n")}
|
|
|
112082
110192
|
debugMode: !!process.env.NODE_INSPECTOR_IPC || !!process.env.VSCODE_INSPECTOR_OPTIONS || some(process.execArgv, (arg) => /^--(?:inspect|debug)(?:-brk)?(?:=\d+)?$/i.test(arg)) || !!process.recordreplay,
|
|
112083
110193
|
tryEnableSourceMapsForHost() {
|
|
112084
110194
|
try {
|
|
112085
|
-
|
|
110195
|
+
__require("source-map-support").install();
|
|
112086
110196
|
} catch {
|
|
112087
110197
|
}
|
|
112088
110198
|
},
|
|
@@ -340617,7 +338727,7 @@ var require_decoder = __commonJS({
|
|
|
340617
338727
|
});
|
|
340618
338728
|
|
|
340619
338729
|
// ../../node_modules/adm-zip/util/index.js
|
|
340620
|
-
var
|
|
338730
|
+
var require_util4 = __commonJS({
|
|
340621
338731
|
"../../node_modules/adm-zip/util/index.js"(exports, module) {
|
|
340622
338732
|
"use strict";
|
|
340623
338733
|
module.exports = require_utils2();
|
|
@@ -340632,7 +338742,7 @@ var require_util5 = __commonJS({
|
|
|
340632
338742
|
var require_entryHeader = __commonJS({
|
|
340633
338743
|
"../../node_modules/adm-zip/headers/entryHeader.js"(exports, module) {
|
|
340634
338744
|
"use strict";
|
|
340635
|
-
var Utils =
|
|
338745
|
+
var Utils = require_util4();
|
|
340636
338746
|
var Constants = Utils.Constants;
|
|
340637
338747
|
module.exports = function() {
|
|
340638
338748
|
var _verMade = 20, _version = 10, _flags = 0, _method = 0, _time = 0, _crc = 0, _compressedSize = 0, _size = 0, _fnameLen = 0, _extraLen = 0, _comLen = 0, _diskStart = 0, _inattr = 0, _attr = 0, _offset = 0;
|
|
@@ -340903,7 +339013,7 @@ var require_entryHeader = __commonJS({
|
|
|
340903
339013
|
var require_mainHeader = __commonJS({
|
|
340904
339014
|
"../../node_modules/adm-zip/headers/mainHeader.js"(exports, module) {
|
|
340905
339015
|
"use strict";
|
|
340906
|
-
var Utils =
|
|
339016
|
+
var Utils = require_util4();
|
|
340907
339017
|
var Constants = Utils.Constants;
|
|
340908
339018
|
module.exports = function() {
|
|
340909
339019
|
var _volumeEntries = 0, _totalEntries = 0, _size = 0, _offset = 0, _commentLength = 0;
|
|
@@ -341201,7 +339311,7 @@ var require_methods = __commonJS({
|
|
|
341201
339311
|
var require_zipEntry = __commonJS({
|
|
341202
339312
|
"../../node_modules/adm-zip/zipEntry.js"(exports, module) {
|
|
341203
339313
|
"use strict";
|
|
341204
|
-
var Utils =
|
|
339314
|
+
var Utils = require_util4();
|
|
341205
339315
|
var Headers = require_headers3();
|
|
341206
339316
|
var Constants = Utils.Constants;
|
|
341207
339317
|
var Methods = require_methods();
|
|
@@ -341535,7 +339645,7 @@ var require_zipFile = __commonJS({
|
|
|
341535
339645
|
"use strict";
|
|
341536
339646
|
var ZipEntry = require_zipEntry();
|
|
341537
339647
|
var Headers = require_headers3();
|
|
341538
|
-
var Utils =
|
|
339648
|
+
var Utils = require_util4();
|
|
341539
339649
|
module.exports = function(inBuffer, options) {
|
|
341540
339650
|
var entryList = [], entryTable = {}, _comment = Buffer.alloc(0), mainHeader = new Headers.MainHeader(), loadedEntries = false;
|
|
341541
339651
|
var password = null;
|
|
@@ -341880,7 +339990,7 @@ var require_zipFile = __commonJS({
|
|
|
341880
339990
|
var require_adm_zip = __commonJS({
|
|
341881
339991
|
"../../node_modules/adm-zip/adm-zip.js"(exports, module) {
|
|
341882
339992
|
"use strict";
|
|
341883
|
-
var Utils =
|
|
339993
|
+
var Utils = require_util4();
|
|
341884
339994
|
var pth = __require("path");
|
|
341885
339995
|
var ZipEntry = require_zipEntry();
|
|
341886
339996
|
var ZipFile = require_zipFile();
|
|
@@ -353039,9 +351149,9 @@ var require_dist2 = __commonJS({
|
|
|
353039
351149
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p)) __createBinding(exports2, m, p);
|
|
353040
351150
|
};
|
|
353041
351151
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
353042
|
-
exports.
|
|
353043
|
-
exports.
|
|
353044
|
-
exports.BrokeredInboxReader = exports.applyPlusTag = exports.deriveProjectInboxTag = exports.deriveInboxTag = exports.loadVerificationInboxConfig = exports.VerificationInboxReader = exports.UNSUPPORTED_RENDERER_PREFIX = exports.UnsupportedRendererError = exports.buildCanvasModeAuthoringAddendum = exports.buildUnsupportedRendererMessage = exports.modelSupportsVision = exports.decideCanvasStrategy = exports.decideAppRenderType = exports.detectCanvasApp = exports.detectRateLimitBlock = exports.isSafeCanonicalRedirect = exports.resolveBaseUrlPreflight = exports.checkBaseUrlRedirect = exports.truncateAtLine = exports.neutralizeUntrustedBlock = exports.renderUntrustedKnowledgeBlock = exports.stripJsonFences = exports.scrubCredentials = exports.withAIRetry = exports.snapshotMatchingChildren = exports.findNewChromiumChildPid = exports.killProcessTree = exports.gracefulCloseWithTreeKill = exports.liveBrowserRegistry = exports.REPO_SWITCH_REMOVED_FRACTION = void 0;
|
|
351152
|
+
exports.filterLoginCaptureCredentials = exports.buildLoginCaptureCredentials = exports.isReservedRunnerEnvVar = exports.RESERVED_RUNNER_ENV_VARS = exports.AUTH_MARKER_VERSION = exports.buildHealAuthStamp = exports.extractAuthRegion = exports.upsertAuthBlock = exports.buildAuthRecipe = exports.commandToReplayStep = exports.buildReplayPlan = exports.absoluteRoute = exports.renderReplaySettleArrow = exports.renderReplayClickArrow = exports.renderAuthFn = exports.filterFeatureGroupsToPathScope = exports.isAuthFlowRoute = exports.deriveSurveyPathScope = exports.canonicalizeRoute = exports.codeUsesInboxHelper = exports.codeUsesTestInboxIdentity = exports.codeSelfProvisionsRegistration = exports.executeGrokPerBatchHeal = exports.executeGrokPerTestHeal = exports.headerVal = exports.classifyAuthType = exports.isTextExcerptable = exports.isStaticAssetByExt = exports.isApiCall = exports.buildApiCallSummary = exports.computeMobileHealOutcome = exports.detectMobileStepSecretLeak = exports.redactMobileSecretsFromText = exports.MOBILE_LIVE_HEAL_SYSTEM_PROMPT = exports.MOBILE_SCRIPT_HEAL_SYSTEM_PROMPT = exports.executeMobileLiveHeal = exports.executeMobileTestWithHealing = exports.executeMobileScriptDrivenHeal = exports.prepareMobileScenarioAppState = exports.runMobileGeneratePhase = exports.isLowValueMobileAutoDeepFeature = exports.isPackageLeafAppCatchAll = exports.isOpaqueMobileScreenName = exports.isScrubbedPlaceholderName = exports.runMobileAIPlanner = exports.buildMobileSiteMap = exports.formatMobileEvidenceForPlanner = exports.MOBILE_SCENARIO_SYSTEM_PROMPT = exports.MOBILE_SURVEY_SYSTEM_PROMPT = exports.runMobileExplorePhase = void 0;
|
|
351153
|
+
exports.sha256Hex = exports.hashFiles = exports.enumerateTestFiles = exports.buildNextManifest = exports.detectRepoSwitch = exports.classifyImportDiff = exports.parseImportManifest = exports.validateAuthoredMobileTest = exports.buildMobileRepoAuthorSystemRules = exports.buildMobileRepoAuthorKickoff = exports.buildMobileRepoAuthorContractMd = exports.REPO_ANALYSIS_SCHEMA_VERSION = exports.validateSourceEndpoints = exports.validateAuthoredTest = exports.validateRepoMapFile = exports.validateRepoMemoryFile = exports.buildTestingStandardsSection = exports.buildRepoAuthorSystemRules = exports.buildRepoAuthorKickoff = exports.buildRepoAuthorContractMd = exports.buildRepoMapSystemRules = exports.buildRepoMapKickoff = exports.buildRepoMapContractMd = exports.buildRepoMemorySystemRules = exports.buildRepoMemoryKickoff = exports.buildRepoMemoryContractMd = exports.runRepoAnalysisOnRunner = exports.MOBILE_IMPORT_SCHEMA_VERSION = exports.validateImportedMobileTest = exports.buildMobileImportSystemRules = exports.buildMobileImportKickoff = exports.buildMobileImportContractMd = exports.IMPORT_SCHEMA_VERSION = exports.validateImportResultFile = exports.validateImportedTest = exports.buildImportSystemRules = exports.buildImportKickoff = exports.buildImportContractMd = exports.MAX_ARCHIVE_BYTES = exports.isUnsafeEntryName = exports.extractZipSafely = exports.downloadArchiveCapped = exports.detectArchiveKind = exports.acquireRepoForImport = exports.runFrameworkImportOnRunner = exports.getAgenticEngine = exports.resolveRefFromSnapshot = exports.replayAuthRecipeIntoBrowser = exports.runRegisterCaptureRun = exports.runLoginCaptureRun = void 0;
|
|
351154
|
+
exports.BrokeredInboxReader = exports.applyPlusTag = exports.deriveProjectInboxTag = exports.deriveInboxTag = exports.loadVerificationInboxConfig = exports.VerificationInboxReader = exports.UNSUPPORTED_RENDERER_PREFIX = exports.UnsupportedRendererError = exports.buildCanvasModeAuthoringAddendum = exports.buildUnsupportedRendererMessage = exports.modelSupportsVision = exports.decideCanvasStrategy = exports.decideAppRenderType = exports.detectCanvasApp = exports.detectRateLimitBlock = exports.isSafeCanonicalRedirect = exports.resolveBaseUrlPreflight = exports.checkBaseUrlRedirect = exports.truncateAtLine = exports.neutralizeUntrustedBlock = exports.renderUntrustedKnowledgeBlock = exports.stripJsonFences = exports.scrubCredentials = exports.withAIRetry = exports.snapshotMatchingChildren = exports.findNewChromiumChildPid = exports.killProcessTree = exports.gracefulCloseWithTreeKill = exports.liveBrowserRegistry = exports.REPO_SWITCH_REMOVED_FRACTION = exports.MAX_MANIFEST_FILES = exports.toDiffSummary = exports.isLikelyTestFile = exports.sanitizeRepoRelPath = void 0;
|
|
353045
351155
|
__exportStar(require_ai_provider(), exports);
|
|
353046
351156
|
__exportStar(require_mobile_types(), exports);
|
|
353047
351157
|
__exportStar(require_mobile_source_parser(), exports);
|
|
@@ -353066,6 +351176,18 @@ var require_dist2 = __commonJS({
|
|
|
353066
351176
|
Object.defineProperty(exports, "runMobileAIPlanner", { enumerable: true, get: function() {
|
|
353067
351177
|
return mobile_discovery_prompts_js_1.runMobileAIPlanner;
|
|
353068
351178
|
} });
|
|
351179
|
+
Object.defineProperty(exports, "isScrubbedPlaceholderName", { enumerable: true, get: function() {
|
|
351180
|
+
return mobile_discovery_prompts_js_1.isScrubbedPlaceholderName;
|
|
351181
|
+
} });
|
|
351182
|
+
Object.defineProperty(exports, "isOpaqueMobileScreenName", { enumerable: true, get: function() {
|
|
351183
|
+
return mobile_discovery_prompts_js_1.isOpaqueMobileScreenName;
|
|
351184
|
+
} });
|
|
351185
|
+
Object.defineProperty(exports, "isPackageLeafAppCatchAll", { enumerable: true, get: function() {
|
|
351186
|
+
return mobile_discovery_prompts_js_1.isPackageLeafAppCatchAll;
|
|
351187
|
+
} });
|
|
351188
|
+
Object.defineProperty(exports, "isLowValueMobileAutoDeepFeature", { enumerable: true, get: function() {
|
|
351189
|
+
return mobile_discovery_prompts_js_1.isLowValueMobileAutoDeepFeature;
|
|
351190
|
+
} });
|
|
353069
351191
|
var mobile_generator_js_1 = require_mobile_generator();
|
|
353070
351192
|
Object.defineProperty(exports, "runMobileGeneratePhase", { enumerable: true, get: function() {
|
|
353071
351193
|
return mobile_generator_js_1.runMobileGeneratePhase;
|
|
@@ -353501,7 +351623,7 @@ var require_package4 = __commonJS({
|
|
|
353501
351623
|
"package.json"(exports, module) {
|
|
353502
351624
|
module.exports = {
|
|
353503
351625
|
name: "@validate.qa/runner",
|
|
353504
|
-
version: "1.0.
|
|
351626
|
+
version: "1.0.87",
|
|
353505
351627
|
description: "validate local test runner - execute Playwright tests on your machine, connected to validate.qa cloud.",
|
|
353506
351628
|
bin: {
|
|
353507
351629
|
"validate-runner": "dist/cli.js"
|
|
@@ -355413,7 +353535,7 @@ async function pressHome(sessionPath, platform3) {
|
|
|
355413
353535
|
// src/services/device-quarantine.ts
|
|
355414
353536
|
var QUARANTINE_MAX_MS = (() => {
|
|
355415
353537
|
const raw = Number(process.env.VALIDATEQA_DEVICE_QUARANTINE_MAX_MS);
|
|
355416
|
-
return Number.isFinite(raw) && raw > 0 ? raw :
|
|
353538
|
+
return Number.isFinite(raw) && raw > 0 ? raw : 2 * 60 * 1e3;
|
|
355417
353539
|
})();
|
|
355418
353540
|
var quarantinedAt = /* @__PURE__ */ new Map();
|
|
355419
353541
|
var nextQuarantineToken = 1;
|
|
@@ -356913,6 +355035,12 @@ async function createSession(target) {
|
|
|
356913
355035
|
// Scoped to simulator UDIDs (a physical iOS device has no such step);
|
|
356914
355036
|
// override with APPIUM_IOS_HEADLESS=false to force a visible Simulator run.
|
|
356915
355037
|
...isIosSimulatorUdid(target.deviceId) && process.env.APPIUM_IOS_HEADLESS !== "false" ? { "appium:isHeadless": true } : {},
|
|
355038
|
+
// WDA cold-start is flaky under dual-sim load (xcodebuild 65/75, SIGTERM).
|
|
355039
|
+
// Retry startup instead of failing the whole discovery session once.
|
|
355040
|
+
"appium:wdaStartupRetries": 4,
|
|
355041
|
+
"appium:wdaStartupRetryInterval": 2e3,
|
|
355042
|
+
"appium:wdaLaunchTimeout": 12e4,
|
|
355043
|
+
"appium:wdaConnectionTimeout": 12e4,
|
|
356916
355044
|
...parallelCaps,
|
|
356917
355045
|
...realCaps
|
|
356918
355046
|
} : {
|
|
@@ -356924,6 +355052,12 @@ async function createSession(target) {
|
|
|
356924
355052
|
"appium:noReset": true,
|
|
356925
355053
|
// See the iOS branch: the 60s default kills AI-driven discovery sessions.
|
|
356926
355054
|
"appium:newCommandTimeout": MOBILE_NEW_COMMAND_TIMEOUT_SECONDS,
|
|
355055
|
+
// Default UIA2 server launch is 30s — under dual-emu / post-quarantine
|
|
355056
|
+
// stress instrumentation often needs longer or the session never binds
|
|
355057
|
+
// ("instrumentation process cannot be initialized within 30000ms").
|
|
355058
|
+
"appium:uiautomator2ServerLaunchTimeout": 12e4,
|
|
355059
|
+
"appium:uiautomator2ServerInstallTimeout": 12e4,
|
|
355060
|
+
"appium:adbExecTimeout": 12e4,
|
|
356927
355061
|
"appium:chromedriverExecutableDir": ensureWritableChromedriverExecutableDir(),
|
|
356928
355062
|
...parallelCaps,
|
|
356929
355063
|
...realCaps
|
|
@@ -359702,6 +357836,12 @@ async function startSession(validated, res) {
|
|
|
359702
357836
|
// overrides. Verified live: without this, recorder/mirror sessions on iOS
|
|
359703
357837
|
// die with "Simulator.app does not exist" while executor sessions work.
|
|
359704
357838
|
...isIosSimulatorUdid(deviceId) && process.env.APPIUM_IOS_HEADLESS !== "false" ? { "appium:isHeadless": true } : {},
|
|
357839
|
+
// Match executor createSession: tolerate WDA cold-start flakes.
|
|
357840
|
+
"appium:newCommandTimeout": Number(process.env.VALIDATEQA_MOBILE_NEW_COMMAND_TIMEOUT) > 0 ? Math.floor(Number(process.env.VALIDATEQA_MOBILE_NEW_COMMAND_TIMEOUT)) : 600,
|
|
357841
|
+
"appium:wdaStartupRetries": 4,
|
|
357842
|
+
"appium:wdaStartupRetryInterval": 2e3,
|
|
357843
|
+
"appium:wdaLaunchTimeout": 12e4,
|
|
357844
|
+
"appium:wdaConnectionTimeout": 12e4,
|
|
359705
357845
|
...realCaps
|
|
359706
357846
|
} : {
|
|
359707
357847
|
platformName: "Android",
|
|
@@ -359710,6 +357850,10 @@ async function startSession(validated, res) {
|
|
|
359710
357850
|
...deviceId ? { "appium:udid": deviceId } : {},
|
|
359711
357851
|
...platformVersion ? { "appium:platformVersion": platformVersion } : {},
|
|
359712
357852
|
"appium:noReset": true,
|
|
357853
|
+
"appium:newCommandTimeout": Number(process.env.VALIDATEQA_MOBILE_NEW_COMMAND_TIMEOUT) > 0 ? Math.floor(Number(process.env.VALIDATEQA_MOBILE_NEW_COMMAND_TIMEOUT)) : 600,
|
|
357854
|
+
"appium:uiautomator2ServerLaunchTimeout": 12e4,
|
|
357855
|
+
"appium:uiautomator2ServerInstallTimeout": 12e4,
|
|
357856
|
+
"appium:adbExecTimeout": 12e4,
|
|
359713
357857
|
"appium:chromedriverExecutableDir": ensureWritableChromedriverExecutableDir(),
|
|
359714
357858
|
...realCaps
|
|
359715
357859
|
};
|
|
@@ -360801,11 +358945,33 @@ var MobileBridgeDriver = class {
|
|
|
360801
358945
|
*/
|
|
360802
358946
|
async snapshot() {
|
|
360803
358947
|
return this.withSessionRecovery("snapshot", async () => {
|
|
360804
|
-
|
|
360805
|
-
|
|
360806
|
-
|
|
360807
|
-
|
|
360808
|
-
|
|
358948
|
+
let xml = await getPageSource(this.sessionPath);
|
|
358949
|
+
let screenshot = await getScreenshot(this.sessionPath);
|
|
358950
|
+
let windowSize = await getWindowSize(this.sessionPath);
|
|
358951
|
+
if (!xml) {
|
|
358952
|
+
try {
|
|
358953
|
+
await waitForUiSettle(this.sessionPath, {
|
|
358954
|
+
timeoutMs: 8e3,
|
|
358955
|
+
minStableFrames: 2,
|
|
358956
|
+
pollMs: 300,
|
|
358957
|
+
minElements: 1
|
|
358958
|
+
});
|
|
358959
|
+
} catch (err) {
|
|
358960
|
+
if (isRecoverableAppiumSessionFailure(err)) throw err;
|
|
358961
|
+
}
|
|
358962
|
+
xml = await getPageSource(this.sessionPath);
|
|
358963
|
+
}
|
|
358964
|
+
if (!xml) {
|
|
358965
|
+
try {
|
|
358966
|
+
await this.executeScript("mobile: activateApp", [this.appLifecycleArgs()]);
|
|
358967
|
+
await waitForColdBootSettle(this.sessionPath);
|
|
358968
|
+
} catch (err) {
|
|
358969
|
+
if (isRecoverableAppiumSessionFailure(err)) throw err;
|
|
358970
|
+
}
|
|
358971
|
+
xml = await getPageSource(this.sessionPath);
|
|
358972
|
+
if (!screenshot) screenshot = await getScreenshot(this.sessionPath);
|
|
358973
|
+
if (!windowSize) windowSize = await getWindowSize(this.sessionPath);
|
|
358974
|
+
}
|
|
360809
358975
|
if (!xml && !screenshot && !windowSize) {
|
|
360810
358976
|
await this.assertSessionReachable();
|
|
360811
358977
|
}
|
|
@@ -361803,8 +359969,13 @@ var RunnerUpgradeRequiredError = class extends Error {
|
|
|
361803
359969
|
this.latestVersion = latestVersion;
|
|
361804
359970
|
}
|
|
361805
359971
|
};
|
|
359972
|
+
var PENDING_POLL_TIMEOUT_MS = Math.max(15e3, envInt("VALIDATE_RUNNER_PENDING_TIMEOUT_MS", 9e4));
|
|
359973
|
+
var POLL_STUCK_RECYCLE_MS = Math.max(6e4, envInt("VALIDATE_RUNNER_POLL_STUCK_MS", 5 * 6e4));
|
|
361806
359974
|
async function fetchPendingRuns(serverUrl, headers) {
|
|
361807
|
-
const res = await fetch(`${serverUrl}/api/runner/pending`, {
|
|
359975
|
+
const res = await fetch(`${serverUrl}/api/runner/pending`, {
|
|
359976
|
+
headers,
|
|
359977
|
+
signal: AbortSignal.timeout(PENDING_POLL_TIMEOUT_MS)
|
|
359978
|
+
});
|
|
361808
359979
|
if (!res.ok) {
|
|
361809
359980
|
if (res.status === 401) throw new Error("Runner token is invalid or expired. Run: validate.qa-runner login");
|
|
361810
359981
|
if (res.status === 426) {
|
|
@@ -363745,14 +361916,17 @@ ${finalVerifyResult.logs ?? ""}`;
|
|
|
363745
361916
|
// Android default) — a personal physical device must never have
|
|
363746
361917
|
// its app data wiped.
|
|
363747
361918
|
allowAppReset: mobileTarget.resetPolicy !== "PRESERVE_APP_DATA" && shouldResetMobileAppData(platform3, session.deviceId),
|
|
363748
|
-
|
|
361919
|
+
// Dual-device discovery + long AI turns can lose WDA/UIA2 more than
|
|
361920
|
+
// once per run. One recovery was too tight — the next snapshot
|
|
361921
|
+
// failed as "no UI tree" after a single WDA death.
|
|
361922
|
+
maxSessionRecoveries: 3,
|
|
363749
361923
|
recoverSession: async (cause) => {
|
|
363750
361924
|
if (discoveryTeardownStarted) {
|
|
363751
361925
|
throw new Error("discovery teardown already started \u2014 not recreating the Appium session");
|
|
363752
361926
|
}
|
|
363753
361927
|
const lost = session;
|
|
363754
361928
|
mobileOnLog(
|
|
363755
|
-
`[appium] discovery session lost (${cause.message}); recreating
|
|
361929
|
+
`[appium] discovery session lost (${cause.message}); recreating on the leased device`
|
|
363756
361930
|
);
|
|
363757
361931
|
if (lost) {
|
|
363758
361932
|
detachMirrorSession(lost.deviceId);
|
|
@@ -365214,10 +363388,12 @@ async function startRunner(opts) {
|
|
|
365214
363388
|
log.dim(line);
|
|
365215
363389
|
};
|
|
365216
363390
|
let lastPendingSummary = "";
|
|
363391
|
+
let lastSuccessfulPollAt = Date.now();
|
|
365217
363392
|
while (!shuttingDown) {
|
|
365218
363393
|
try {
|
|
365219
363394
|
if (activeRuns < MAX_CONCURRENT) {
|
|
365220
363395
|
const pending = await fetchPendingRuns(serverUrl, headers);
|
|
363396
|
+
lastSuccessfulPollAt = Date.now();
|
|
365221
363397
|
{
|
|
365222
363398
|
const pendingIds = new Set(pending.map((r) => r.runId));
|
|
365223
363399
|
for (const id of [...deferralLogged.keys()]) {
|
|
@@ -365422,6 +363598,8 @@ async function startRunner(opts) {
|
|
|
365422
363598
|
}
|
|
365423
363599
|
}
|
|
365424
363600
|
consecutivePollErrors = 0;
|
|
363601
|
+
} else {
|
|
363602
|
+
lastSuccessfulPollAt = Date.now();
|
|
365425
363603
|
}
|
|
365426
363604
|
} catch (err) {
|
|
365427
363605
|
if (err instanceof RunnerUpgradeRequiredError) {
|
|
@@ -365430,6 +363608,13 @@ async function startRunner(opts) {
|
|
|
365430
363608
|
}
|
|
365431
363609
|
const message = err instanceof Error ? err.message : String(err);
|
|
365432
363610
|
consecutivePollErrors++;
|
|
363611
|
+
const stuckForMs = Date.now() - lastSuccessfulPollAt;
|
|
363612
|
+
if (stuckForMs >= POLL_STUCK_RECYCLE_MS) {
|
|
363613
|
+
log.warn(
|
|
363614
|
+
`Poll stuck for ${Math.round(stuckForMs / 1e3)}s (>= ${Math.round(POLL_STUCK_RECYCLE_MS / 1e3)}s) after error: ${message}. Recycling runner process so the supervisor can restart with a clean loop; orphaned work is re-queued server-side.`
|
|
363615
|
+
);
|
|
363616
|
+
process.exit(78);
|
|
363617
|
+
}
|
|
365433
363618
|
const backoffMs = Math.min(pollIntervalMs * Math.pow(2, consecutivePollErrors - 1), MAX_BACKOFF_MS);
|
|
365434
363619
|
if (consecutivePollErrors > 1) {
|
|
365435
363620
|
log.warn(`Poll error #${consecutivePollErrors} (${message}) - backing off for ${(backoffMs / 1e3).toFixed(1)}s`);
|
|
@@ -365482,7 +363667,76 @@ program.command("login").description("Save runner credentials for future use").r
|
|
|
365482
363667
|
console.log("");
|
|
365483
363668
|
console.log("Run: validate-runner start");
|
|
365484
363669
|
});
|
|
365485
|
-
|
|
363670
|
+
async function superviseRunnerStart(argv) {
|
|
363671
|
+
const { spawn: spawn2 } = await import("child_process");
|
|
363672
|
+
const minBackoffMs = 2e3;
|
|
363673
|
+
const maxBackoffMs = 6e4;
|
|
363674
|
+
let backoffMs = minBackoffMs;
|
|
363675
|
+
let restarts = 0;
|
|
363676
|
+
const windowStart = Date.now();
|
|
363677
|
+
const maxRestartsPerHour = Math.max(1, Number(process.env.VALIDATE_RUNNER_MAX_RESTARTS_PER_HOUR || 30));
|
|
363678
|
+
const childEnv = { ...process.env, VALIDATE_RUNNER_SUPERVISED_CHILD: "1" };
|
|
363679
|
+
const runOnce = () => new Promise((resolve2) => {
|
|
363680
|
+
const child = spawn2(process.execPath, argv, {
|
|
363681
|
+
stdio: "inherit",
|
|
363682
|
+
env: childEnv
|
|
363683
|
+
});
|
|
363684
|
+
const onSignal = (sig) => {
|
|
363685
|
+
try {
|
|
363686
|
+
child.kill(sig);
|
|
363687
|
+
} catch {
|
|
363688
|
+
}
|
|
363689
|
+
};
|
|
363690
|
+
process.once("SIGINT", onSignal);
|
|
363691
|
+
process.once("SIGTERM", onSignal);
|
|
363692
|
+
child.on("exit", (code, signal) => {
|
|
363693
|
+
process.removeListener("SIGINT", onSignal);
|
|
363694
|
+
process.removeListener("SIGTERM", onSignal);
|
|
363695
|
+
if (signal === "SIGINT" || signal === "SIGTERM") {
|
|
363696
|
+
resolve2(0);
|
|
363697
|
+
return;
|
|
363698
|
+
}
|
|
363699
|
+
resolve2(code ?? 1);
|
|
363700
|
+
});
|
|
363701
|
+
});
|
|
363702
|
+
const childArgv = argv.filter((a) => a !== "--supervise" && a !== "--no-supervise");
|
|
363703
|
+
console.log("\u{1F6E1} Runner supervisor enabled \u2014 will auto-restart on crash/stuck exit");
|
|
363704
|
+
console.log(" (disable with --no-supervise or VALIDATE_RUNNER_SUPERVISE=0)");
|
|
363705
|
+
for (; ; ) {
|
|
363706
|
+
const code = await runOnce();
|
|
363707
|
+
if (code === 0) {
|
|
363708
|
+
process.exit(0);
|
|
363709
|
+
}
|
|
363710
|
+
restarts += 1;
|
|
363711
|
+
const elapsedH = (Date.now() - windowStart) / 36e5;
|
|
363712
|
+
if (elapsedH < 1 && restarts > maxRestartsPerHour) {
|
|
363713
|
+
console.error(
|
|
363714
|
+
`\u2717 Supervisor: ${restarts} restarts in under 1h (cap ${maxRestartsPerHour}). Stopping to avoid a crash loop. Fix the underlying issue and re-run start.`
|
|
363715
|
+
);
|
|
363716
|
+
process.exit(1);
|
|
363717
|
+
}
|
|
363718
|
+
console.warn(
|
|
363719
|
+
`\u26A0 Runner exited with code ${code} \u2014 restarting in ${(backoffMs / 1e3).toFixed(1)}s (restart #${restarts}). Server will re-queue orphaned work; pending jobs resume automatically.`
|
|
363720
|
+
);
|
|
363721
|
+
await new Promise((r) => setTimeout(r, backoffMs));
|
|
363722
|
+
backoffMs = Math.min(maxBackoffMs, Math.round(backoffMs * 1.5));
|
|
363723
|
+
}
|
|
363724
|
+
}
|
|
363725
|
+
function shouldSupervise(opts) {
|
|
363726
|
+
if (opts.supervise === false) return false;
|
|
363727
|
+
if (opts.supervise === true) return true;
|
|
363728
|
+
if (process.env.VALIDATE_RUNNER_SUPERVISED_CHILD === "1") return false;
|
|
363729
|
+
if (process.env.RUNNER_CLOUD === "true") return false;
|
|
363730
|
+
const env = (process.env.VALIDATE_RUNNER_SUPERVISE ?? "1").trim().toLowerCase();
|
|
363731
|
+
return env !== "0" && env !== "false" && env !== "off" && env !== "no";
|
|
363732
|
+
}
|
|
363733
|
+
program.command("start").description("Start the local test runner").option("--token <token>", "Runner token (overrides saved credentials)").option("--server <url>", "Server URL (overrides saved credentials)").option("--project <id>", "Project ID (overrides saved credentials)").option("--mode <mode>", "Runner mode: playwright-native (default)", "playwright-native").option("--poll-interval <ms>", "Poll interval in milliseconds", "2000").option("--mobile", "Enable mobile testing (Appium + mobile bridge server)").option("--tunnel", "Enable ngrok tunnel for mobile bridge (allows HTTPS dashboard to connect)").option("--supervise", "Auto-restart the runner if it crashes or self-recycles (default for local)").option("--no-supervise", "Disable auto-restart supervisor").action(async (opts) => {
|
|
363734
|
+
if (shouldSupervise(opts)) {
|
|
363735
|
+
const argv = [...process.argv.slice(1)];
|
|
363736
|
+
if (!argv.includes("--no-supervise")) argv.push("--no-supervise");
|
|
363737
|
+
await superviseRunnerStart(argv);
|
|
363738
|
+
return;
|
|
363739
|
+
}
|
|
365486
363740
|
await requireLatestRunner();
|
|
365487
363741
|
const saved = loadCredentials();
|
|
365488
363742
|
const authToken = opts.token || process.env.AUTH_TOKEN || saved?.token;
|