@wix/himalaya-cli 0.1644.0 → 0.1645.0
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.mjs +685 -566
- package/guides/one-app-to-himi-app.md +13 -2
- package/package.json +2 -2
package/dist/cli.mjs
CHANGED
|
@@ -1354,8 +1354,8 @@ function primaryCtaStructureGap(text15) {
|
|
|
1354
1354
|
}
|
|
1355
1355
|
const data = ctaTables.flatMap(({ table }) => table.data);
|
|
1356
1356
|
const flat = (value2) => value2.toLowerCase().replace(/[^a-z0-9]+/g, " ").trim();
|
|
1357
|
-
const
|
|
1358
|
-
const missing3 = declaredStates(text15).filter((state) => !
|
|
1357
|
+
const rowText2 = data.map((row2) => flat(row2.join(" ")));
|
|
1358
|
+
const missing3 = declaredStates(text15).filter((state) => !rowText2.some((row2) => row2.includes(flat(state))));
|
|
1359
1359
|
if (missing3.length) return `The acceptance table has no row for the declared state(s): ${missing3.join(", ")}.`;
|
|
1360
1360
|
return null;
|
|
1361
1361
|
}
|
|
@@ -1731,9 +1731,9 @@ function applyBase44AppId(dir, appId2, tenantUrl) {
|
|
|
1731
1731
|
const config = join2(dir, "config.ts");
|
|
1732
1732
|
if (!existsSync(config)) return false;
|
|
1733
1733
|
const body = readFileSync2(config, "utf8");
|
|
1734
|
-
const
|
|
1735
|
-
if (!body.includes(
|
|
1736
|
-
let configured = body.replaceAll(
|
|
1734
|
+
const literal2 = `"${BASE44_APP_ID_PLACEHOLDER}"`;
|
|
1735
|
+
if (!body.includes(literal2)) return false;
|
|
1736
|
+
let configured = body.replaceAll(literal2, `"${appId2}"`);
|
|
1737
1737
|
if (tenantUrl !== void 0) {
|
|
1738
1738
|
const host = base44TenantUrl(tenantUrl).hostname;
|
|
1739
1739
|
if (!/^\s*base44:\s*\{/m.test(configured) || /\bappLinkHosts\s*:/.test(configured)) {
|
|
@@ -5743,8 +5743,8 @@ function isStaticInitializer(expr) {
|
|
|
5743
5743
|
}
|
|
5744
5744
|
return false;
|
|
5745
5745
|
}
|
|
5746
|
-
function collectPaths(
|
|
5747
|
-
for (const p2 of
|
|
5746
|
+
function collectPaths(obj13, prefix, out2) {
|
|
5747
|
+
for (const p2 of obj13.properties) {
|
|
5748
5748
|
let key3;
|
|
5749
5749
|
if (ts.isPropertyAssignment(p2)) key3 = propName(p2.name);
|
|
5750
5750
|
else if (ts.isShorthandPropertyAssignment(p2)) key3 = p2.name.text;
|
|
@@ -5972,20 +5972,20 @@ function analyzeController(source, file2, profile, diagnostics) {
|
|
|
5972
5972
|
error(object15, "initialState and handlers must be object literals.");
|
|
5973
5973
|
return;
|
|
5974
5974
|
}
|
|
5975
|
-
function
|
|
5976
|
-
if (ts2.isAsExpression(n2) || ts2.isSatisfiesExpression(n2) || ts2.isParenthesizedExpression(n2)) return
|
|
5975
|
+
function literal2(n2) {
|
|
5976
|
+
if (ts2.isAsExpression(n2) || ts2.isSatisfiesExpression(n2) || ts2.isParenthesizedExpression(n2)) return literal2(n2.expression);
|
|
5977
5977
|
if (ts2.isStringLiteral(n2) || ts2.isNoSubstitutionTemplateLiteral(n2)) return n2.text;
|
|
5978
5978
|
if (ts2.isNumericLiteral(n2)) return Number(n2.text);
|
|
5979
5979
|
if (n2.kind === ts2.SyntaxKind.TrueKeyword) return true;
|
|
5980
5980
|
if (n2.kind === ts2.SyntaxKind.FalseKeyword) return false;
|
|
5981
5981
|
if (n2.kind === ts2.SyntaxKind.NullKeyword) return null;
|
|
5982
5982
|
if (ts2.isPrefixUnaryExpression(n2) && n2.operator === ts2.SyntaxKind.MinusToken && ts2.isNumericLiteral(n2.operand)) return -Number(n2.operand.text);
|
|
5983
|
-
if (ts2.isArrayLiteralExpression(n2)) return n2.elements.map((e2) =>
|
|
5983
|
+
if (ts2.isArrayLiteralExpression(n2)) return n2.elements.map((e2) => literal2(e2));
|
|
5984
5984
|
if (ts2.isObjectLiteralExpression(n2)) return Object.fromEntries(n2.properties.map((p2) => {
|
|
5985
5985
|
if (!ts2.isPropertyAssignment(p2) || ts2.isComputedPropertyName(p2.name)) throw new Error("State must contain JSON literals; no spreads, calls, or computed keys.");
|
|
5986
5986
|
const key3 = p2.name.getText(sf2).replace(/^["']|["']$/g, "");
|
|
5987
5987
|
if (unsafe.has(key3) || key3.startsWith("__hhp")) throw new Error(`Unsafe or reserved state key ${key3}.`);
|
|
5988
|
-
return [key3,
|
|
5988
|
+
return [key3, literal2(p2.initializer)];
|
|
5989
5989
|
}));
|
|
5990
5990
|
throw new Error("State must contain JSON literals; no spreads, calls, or computed keys.");
|
|
5991
5991
|
}
|
|
@@ -5997,7 +5997,7 @@ function analyzeController(source, file2, profile, diagnostics) {
|
|
|
5997
5997
|
if (v2 && typeof v2 === "object" && !Array.isArray(v2)) collect2(v2, path2);
|
|
5998
5998
|
}
|
|
5999
5999
|
};
|
|
6000
|
-
const initial =
|
|
6000
|
+
const initial = literal2(state.initializer);
|
|
6001
6001
|
if (!initial || typeof initial !== "object" || Array.isArray(initial)) throw new Error("initialState must be a JSON object.");
|
|
6002
6002
|
const paths2 = /* @__PURE__ */ new Map();
|
|
6003
6003
|
collect2(initial);
|
|
@@ -9771,8 +9771,8 @@ function tsExtResolvePlugin() {
|
|
|
9771
9771
|
setup(b2) {
|
|
9772
9772
|
b2.onResolve({ filter: /\.js$/ }, (args) => {
|
|
9773
9773
|
if (args.kind === "entry-point" || !args.path.startsWith(".")) return void 0;
|
|
9774
|
-
const
|
|
9775
|
-
return existsSync11(
|
|
9774
|
+
const ts21 = resolve10(args.resolveDir, args.path.replace(/\.js$/, ".ts"));
|
|
9775
|
+
return existsSync11(ts21) ? { path: ts21 } : void 0;
|
|
9776
9776
|
});
|
|
9777
9777
|
}
|
|
9778
9778
|
};
|
|
@@ -10528,7 +10528,7 @@ function bundleFor(file2) {
|
|
|
10528
10528
|
const match = /^tier5-src\/([^/]+)\//.exec(file2);
|
|
10529
10529
|
return match?.[1] ?? "_shared";
|
|
10530
10530
|
}
|
|
10531
|
-
function toIssue(
|
|
10531
|
+
function toIssue(ts21, contentDir2, diagnostic) {
|
|
10532
10532
|
const file2 = diagnostic.file ? relativeFile(contentDir2, diagnostic.file.fileName) : void 0;
|
|
10533
10533
|
const position = diagnostic.file && diagnostic.start !== void 0 ? diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start) : void 0;
|
|
10534
10534
|
return {
|
|
@@ -10536,13 +10536,13 @@ function toIssue(ts20, contentDir2, diagnostic) {
|
|
|
10536
10536
|
...file2 ? { file: file2 } : {},
|
|
10537
10537
|
...position ? { line: position.line + 1, column: position.character + 1 } : {},
|
|
10538
10538
|
code: `TS${diagnostic.code}`,
|
|
10539
|
-
message:
|
|
10539
|
+
message: ts21.flattenDiagnosticMessageText(diagnostic.messageText, "\n")
|
|
10540
10540
|
};
|
|
10541
10541
|
}
|
|
10542
|
-
function confinedHost(
|
|
10542
|
+
function confinedHost(ts21, contentDir2, options) {
|
|
10543
10543
|
if (!buildConfinementRequired()) return void 0;
|
|
10544
|
-
const host =
|
|
10545
|
-
const libDir = resolve12(
|
|
10544
|
+
const host = ts21.createCompilerHost(options);
|
|
10545
|
+
const libDir = resolve12(ts21.getDefaultLibFilePath(options), "..");
|
|
10546
10546
|
const allows = confinementMatcher(contentDir2, [libDir]);
|
|
10547
10547
|
const getSourceFile = host.getSourceFile.bind(host);
|
|
10548
10548
|
const readFile3 = host.readFile.bind(host);
|
|
@@ -10571,7 +10571,7 @@ function confinedHost(ts20, contentDir2, options) {
|
|
|
10571
10571
|
}
|
|
10572
10572
|
async function typecheckContentWorkers(contentDir2, options) {
|
|
10573
10573
|
if (!existsSync12(resolve12(contentDir2, "tier5-src"))) return [];
|
|
10574
|
-
const
|
|
10574
|
+
const ts21 = await compiler2();
|
|
10575
10575
|
const config = {
|
|
10576
10576
|
compilerOptions: {
|
|
10577
10577
|
...CONTENT_WORKER_COMPILER_OPTIONS,
|
|
@@ -10580,18 +10580,18 @@ async function typecheckContentWorkers(contentDir2, options) {
|
|
|
10580
10580
|
// The deployed authoring runtime stages TypeScript 6, which requires an explicit
|
|
10581
10581
|
// acknowledgement for this compatibility `baseUrl`; the repository's TypeScript 5 lane
|
|
10582
10582
|
// rejects that 6.0 value, so keep it specific to the compiler that needs it.
|
|
10583
|
-
...Number.parseInt(
|
|
10583
|
+
...Number.parseInt(ts21.versionMajorMinor, 10) >= 6 ? { ignoreDeprecations: "6.0" } : {}
|
|
10584
10584
|
},
|
|
10585
10585
|
include: ["tier5-src/*/index.ts", "tier5-src/_shared/**/*.ts"]
|
|
10586
10586
|
};
|
|
10587
|
-
const parsed =
|
|
10587
|
+
const parsed = ts21.parseJsonConfigFileContent(config, ts21.sys, contentDir2);
|
|
10588
10588
|
if (parsed.fileNames.length === 0) return [];
|
|
10589
|
-
const program =
|
|
10589
|
+
const program = ts21.createProgram({
|
|
10590
10590
|
rootNames: parsed.fileNames,
|
|
10591
10591
|
options: parsed.options,
|
|
10592
|
-
host: confinedHost(
|
|
10592
|
+
host: confinedHost(ts21, contentDir2, parsed.options)
|
|
10593
10593
|
});
|
|
10594
|
-
return [...parsed.errors, ...
|
|
10594
|
+
return [...parsed.errors, ...ts21.getPreEmitDiagnostics(program)].filter((diagnostic) => diagnostic.category === ts21.DiagnosticCategory.Error && belongsToContentWorkers(contentDir2, diagnostic)).map((diagnostic) => toIssue(ts21, contentDir2, diagnostic));
|
|
10595
10595
|
}
|
|
10596
10596
|
var compilerPromise;
|
|
10597
10597
|
var init_tier5_typecheck = __esm({
|
|
@@ -13264,13 +13264,13 @@ function walk(node3, registry2, path2, out2) {
|
|
|
13264
13264
|
node3.forEach((item, i2) => walk(item, registry2, `${path2}[${i2}]`, out2));
|
|
13265
13265
|
return;
|
|
13266
13266
|
}
|
|
13267
|
-
const
|
|
13268
|
-
const bg =
|
|
13267
|
+
const obj13 = node3;
|
|
13268
|
+
const bg = obj13.background;
|
|
13269
13269
|
if (bg && typeof bg.token === "string" && !registry2.colors.has(bg.token)) {
|
|
13270
13270
|
out2.push({ path: `${path2}.background.token`, kind: "color", name: bg.token });
|
|
13271
13271
|
}
|
|
13272
|
-
if (
|
|
13273
|
-
const props2 =
|
|
13272
|
+
if (obj13.type === "Text") {
|
|
13273
|
+
const props2 = obj13.props;
|
|
13274
13274
|
if (props2 && typeof props2.style === "string" && !registry2.typography.has(props2.style)) {
|
|
13275
13275
|
out2.push({
|
|
13276
13276
|
path: `${path2}.props.style`,
|
|
@@ -13286,11 +13286,11 @@ function walk(node3, registry2, path2, out2) {
|
|
|
13286
13286
|
});
|
|
13287
13287
|
}
|
|
13288
13288
|
}
|
|
13289
|
-
const type2 = typeof
|
|
13289
|
+
const type2 = typeof obj13.type === "string" ? obj13.type : "";
|
|
13290
13290
|
const colorProps = Object.prototype.hasOwnProperty.call(COLOR_TOKEN_PROPS, type2) ? COLOR_TOKEN_PROPS[type2] : void 0;
|
|
13291
13291
|
const typoProps = Object.prototype.hasOwnProperty.call(TYPOGRAPHY_TOKEN_PROPS, type2) ? TYPOGRAPHY_TOKEN_PROPS[type2] : void 0;
|
|
13292
|
-
if ((colorProps || typoProps) &&
|
|
13293
|
-
const props2 =
|
|
13292
|
+
if ((colorProps || typoProps) && obj13.props && typeof obj13.props === "object") {
|
|
13293
|
+
const props2 = obj13.props;
|
|
13294
13294
|
const check = (spec, kind) => {
|
|
13295
13295
|
const [arrayKey, leaf] = spec.includes("[].") ? spec.split("[].") : [void 0, spec];
|
|
13296
13296
|
const sites = arrayKey ? (Array.isArray(props2[arrayKey]) ? props2[arrayKey] : []).map((el2, i2) => [`${path2}.props.${arrayKey}[${i2}].${leaf}`, el2 && typeof el2 === "object" ? el2[leaf] : void 0]) : [[`${path2}.props.${leaf}`, props2[leaf]]];
|
|
@@ -13304,7 +13304,7 @@ function walk(node3, registry2, path2, out2) {
|
|
|
13304
13304
|
for (const spec of colorProps ?? []) check(spec, "color");
|
|
13305
13305
|
for (const spec of typoProps ?? []) check(spec, "typography");
|
|
13306
13306
|
}
|
|
13307
|
-
for (const [key3, value2] of Object.entries(
|
|
13307
|
+
for (const [key3, value2] of Object.entries(obj13)) {
|
|
13308
13308
|
walk(value2, registry2, `${path2}.${key3}`, out2);
|
|
13309
13309
|
}
|
|
13310
13310
|
}
|
|
@@ -13380,15 +13380,15 @@ function findUnknownComponents(node3, allowed2, path2 = "$", out2 = []) {
|
|
|
13380
13380
|
);
|
|
13381
13381
|
return out2;
|
|
13382
13382
|
}
|
|
13383
|
-
const
|
|
13384
|
-
const body =
|
|
13383
|
+
const obj13 = node3;
|
|
13384
|
+
const body = obj13.body;
|
|
13385
13385
|
if (body && typeof body.package === "string" && typeof body.type === "string") {
|
|
13386
13386
|
const key3 = `${body.package}.${body.type}`;
|
|
13387
13387
|
if (!allowed2.has(key3)) {
|
|
13388
13388
|
out2.push({ path: path2, package: body.package, type: body.type });
|
|
13389
13389
|
}
|
|
13390
13390
|
}
|
|
13391
|
-
for (const [key3, value2] of Object.entries(
|
|
13391
|
+
for (const [key3, value2] of Object.entries(obj13)) {
|
|
13392
13392
|
findUnknownComponents(value2, allowed2, `${path2}.${key3}`, out2);
|
|
13393
13393
|
}
|
|
13394
13394
|
return out2;
|
|
@@ -13457,8 +13457,8 @@ function scanWidgetPayload(node3, family, path2, bindings, disallowed, timeRefs,
|
|
|
13457
13457
|
return;
|
|
13458
13458
|
}
|
|
13459
13459
|
if (node3 === null || typeof node3 !== "object") return;
|
|
13460
|
-
const
|
|
13461
|
-
const body =
|
|
13460
|
+
const obj13 = node3;
|
|
13461
|
+
const body = obj13.body;
|
|
13462
13462
|
if (body && typeof body.package === "string" && typeof body.type === "string") {
|
|
13463
13463
|
const key3 = `${body.package}.${body.type}`;
|
|
13464
13464
|
if (family && !isComponentAllowedForFamily(key3, family)) {
|
|
@@ -13474,7 +13474,7 @@ function scanWidgetPayload(node3, family, path2, bindings, disallowed, timeRefs,
|
|
|
13474
13474
|
intents.push({ path: `${path2}.body.props.intent`, reason: "widget Button commands use the required `action` field" });
|
|
13475
13475
|
}
|
|
13476
13476
|
validateWidgetActionRef(button.action, `${path2}.body.props.action`, intents);
|
|
13477
|
-
const componentId =
|
|
13477
|
+
const componentId = obj13.id;
|
|
13478
13478
|
if (typeof componentId !== "string" || !WIDGET_ACTION_IDENTIFIER.test(componentId)) {
|
|
13479
13479
|
intents.push({
|
|
13480
13480
|
path: `${path2}.id`,
|
|
@@ -13485,8 +13485,8 @@ function scanWidgetPayload(node3, family, path2, bindings, disallowed, timeRefs,
|
|
|
13485
13485
|
}
|
|
13486
13486
|
}
|
|
13487
13487
|
}
|
|
13488
|
-
if (
|
|
13489
|
-
const tr2 =
|
|
13488
|
+
if (obj13.timeRef !== void 0 && obj13.timeRef !== null) {
|
|
13489
|
+
const tr2 = obj13.timeRef;
|
|
13490
13490
|
if (typeof tr2 !== "object" || Array.isArray(tr2)) {
|
|
13491
13491
|
timeRefs.push({ path: `${path2}.timeRef`, reason: "must be an object { at, style? }" });
|
|
13492
13492
|
} else {
|
|
@@ -13500,7 +13500,7 @@ function scanWidgetPayload(node3, family, path2, bindings, disallowed, timeRefs,
|
|
|
13500
13500
|
}
|
|
13501
13501
|
}
|
|
13502
13502
|
}
|
|
13503
|
-
for (const [k2, v2] of Object.entries(
|
|
13503
|
+
for (const [k2, v2] of Object.entries(obj13)) {
|
|
13504
13504
|
scanWidgetPayload(v2, family, `${path2}.${k2}`, bindings, disallowed, timeRefs, intents, actionSites2);
|
|
13505
13505
|
}
|
|
13506
13506
|
}
|
|
@@ -15382,8 +15382,8 @@ function collectDescriptorStrings(descriptor, options = {}) {
|
|
|
15382
15382
|
return;
|
|
15383
15383
|
}
|
|
15384
15384
|
if (!node3 || typeof node3 !== "object") return;
|
|
15385
|
-
const
|
|
15386
|
-
const body =
|
|
15385
|
+
const obj13 = node3;
|
|
15386
|
+
const body = obj13.body;
|
|
15387
15387
|
const type2 = typeof body?.type === "string" ? body.type : null;
|
|
15388
15388
|
const props2 = body?.props;
|
|
15389
15389
|
if (type2 && props2 && typeof props2 === "object") {
|
|
@@ -15409,13 +15409,13 @@ function collectDescriptorStrings(descriptor, options = {}) {
|
|
|
15409
15409
|
});
|
|
15410
15410
|
}
|
|
15411
15411
|
}
|
|
15412
|
-
for (const [k2, v2] of Object.entries(
|
|
15412
|
+
for (const [k2, v2] of Object.entries(obj13)) {
|
|
15413
15413
|
if (k2 === "body") continue;
|
|
15414
15414
|
if (typeof v2 === "string" && SECONDARY_FIELDS.has(k2) && !BINDING_SIGIL.test(v2) && isCopy2(v2)) {
|
|
15415
15415
|
push({ value: v2, bucket: "reachable", type: type2, prop: k2, path: `${path2}.${k2}` });
|
|
15416
15416
|
}
|
|
15417
15417
|
}
|
|
15418
|
-
for (const [k2, v2] of Object.entries(
|
|
15418
|
+
for (const [k2, v2] of Object.entries(obj13)) {
|
|
15419
15419
|
if (path2 === "" && k2 === "input" && v2 !== null && typeof v2 === "object") continue;
|
|
15420
15420
|
if (path2 === "logicBundle" && k2 === "bootState") continue;
|
|
15421
15421
|
if (v2 && typeof v2 === "object") visit(v2, path2 ? `${path2}.${k2}` : k2);
|
|
@@ -18273,13 +18273,13 @@ function enumFieldNames(schema2 = screenDescriptorSchema) {
|
|
|
18273
18273
|
const names2 = /* @__PURE__ */ new Set();
|
|
18274
18274
|
const visit = (node3, propName7) => {
|
|
18275
18275
|
if (!node3 || typeof node3 !== "object") return;
|
|
18276
|
-
const
|
|
18277
|
-
if (propName7 && Array.isArray(
|
|
18278
|
-
if (
|
|
18279
|
-
for (const [k2, v2] of Object.entries(
|
|
18276
|
+
const obj13 = node3;
|
|
18277
|
+
if (propName7 && Array.isArray(obj13.enum)) names2.add(propName7);
|
|
18278
|
+
if (obj13.properties && typeof obj13.properties === "object") {
|
|
18279
|
+
for (const [k2, v2] of Object.entries(obj13.properties)) visit(v2, k2);
|
|
18280
18280
|
}
|
|
18281
18281
|
for (const key3 of ["items", "additionalProperties", "anyOf", "oneOf", "allOf", "definitions", "$defs"]) {
|
|
18282
|
-
const v2 =
|
|
18282
|
+
const v2 = obj13[key3];
|
|
18283
18283
|
if (Array.isArray(v2)) v2.forEach((x2) => visit(x2, propName7));
|
|
18284
18284
|
else if (v2 && typeof v2 === "object") {
|
|
18285
18285
|
if (key3 === "definitions" || key3 === "$defs") {
|
|
@@ -18528,8 +18528,8 @@ function richContentFindings(descriptor) {
|
|
|
18528
18528
|
if (body?.package === "himalaya" && body.type === "RichContent") {
|
|
18529
18529
|
const props2 = body.props ?? {};
|
|
18530
18530
|
const docPath = typeof props2.documentJsonPath === "string" && props2.documentJsonPath !== "" ? props2.documentJsonPath : void 0;
|
|
18531
|
-
const
|
|
18532
|
-
if (docPath === void 0 === (
|
|
18531
|
+
const literal2 = typeof props2.documentJson === "string" ? props2.documentJson : void 0;
|
|
18532
|
+
if (docPath === void 0 === (literal2 === void 0)) {
|
|
18533
18533
|
out2.push({ path: path2, message: "RichContent needs exactly one of documentJsonPath and documentJson" });
|
|
18534
18534
|
}
|
|
18535
18535
|
if (docPath !== void 0 && !docPath.startsWith("$service:") && !docPath.startsWith("$item.")) {
|
|
@@ -18537,8 +18537,8 @@ function richContentFindings(descriptor) {
|
|
|
18537
18537
|
} else if (docPath?.startsWith("$item.") && !/^\$item\.[A-Za-z0-9_]+$/.test(docPath)) {
|
|
18538
18538
|
out2.push({ path: path2, message: `RichContent.documentJsonPath "${docPath}" must name one row field: "$item.<letters, digits, _>"` });
|
|
18539
18539
|
}
|
|
18540
|
-
if (
|
|
18541
|
-
const laid = layoutRichContent(
|
|
18540
|
+
if (literal2 !== void 0) {
|
|
18541
|
+
const laid = layoutRichContent(literal2);
|
|
18542
18542
|
if ("rejected" in laid) {
|
|
18543
18543
|
out2.push({ path: path2, message: `RichContent.documentJson is rejected by the renderers (${laid.rejected}) \u2014 every surface would show the fallback` });
|
|
18544
18544
|
}
|
|
@@ -18566,13 +18566,13 @@ function richContentEditorFindings(descriptor) {
|
|
|
18566
18566
|
if (isHimalaya && body.type === "RichContentEditor") {
|
|
18567
18567
|
const p2 = body.props ?? {};
|
|
18568
18568
|
const docPath = typeof p2.documentPath === "string" && p2.documentPath !== "" ? p2.documentPath : void 0;
|
|
18569
|
-
const
|
|
18570
|
-
if (docPath !== void 0 &&
|
|
18569
|
+
const literal2 = typeof p2.documentJson === "string" ? p2.documentJson : void 0;
|
|
18570
|
+
if (docPath !== void 0 && literal2 !== void 0) out2.push({ path: path2, message: "RichContentEditor takes at most one of documentPath and documentJson" });
|
|
18571
18571
|
if (docPath !== void 0 && !docPath.startsWith("$service:")) out2.push({ path: path2, message: `RichContentEditor.documentPath must be a "$service:" binding, got "${docPath}"` });
|
|
18572
|
-
if (
|
|
18572
|
+
if (literal2 !== void 0) {
|
|
18573
18573
|
let doc;
|
|
18574
18574
|
try {
|
|
18575
|
-
doc = JSON.parse(
|
|
18575
|
+
doc = JSON.parse(literal2);
|
|
18576
18576
|
} catch {
|
|
18577
18577
|
doc = void 0;
|
|
18578
18578
|
}
|
|
@@ -19676,13 +19676,13 @@ function validateScreenDescriptor(screenId, served, opts = {}) {
|
|
|
19676
19676
|
return;
|
|
19677
19677
|
}
|
|
19678
19678
|
if (!node3 || typeof node3 !== "object") return;
|
|
19679
|
-
const
|
|
19680
|
-
const body =
|
|
19679
|
+
const obj13 = node3;
|
|
19680
|
+
const body = obj13.body;
|
|
19681
19681
|
const iconName = body?.type === "Icon" ? body.props?.name : void 0;
|
|
19682
19682
|
if (iconName != null && typeof iconName !== "string") {
|
|
19683
19683
|
flagNonString("name", iconName, at2 ? `${at2}.body.props.name` : "props.name");
|
|
19684
19684
|
}
|
|
19685
|
-
for (const [k2, v3] of Object.entries(
|
|
19685
|
+
for (const [k2, v3] of Object.entries(obj13)) {
|
|
19686
19686
|
if (isOpaqueAuthorJson(k2, v3, at2 === "")) continue;
|
|
19687
19687
|
if (NAMED_ICON_PROPS.has(k2) && v3 != null && typeof v3 !== "string") {
|
|
19688
19688
|
flagNonString(k2, v3, at2 ? `${at2}.${k2}` : k2);
|
|
@@ -19712,12 +19712,12 @@ function validateScreenDescriptor(screenId, served, opts = {}) {
|
|
|
19712
19712
|
return;
|
|
19713
19713
|
}
|
|
19714
19714
|
if (!node3 || typeof node3 !== "object") return;
|
|
19715
|
-
const
|
|
19716
|
-
const body =
|
|
19715
|
+
const obj13 = node3;
|
|
19716
|
+
const body = obj13.body;
|
|
19717
19717
|
if (body && body.type === "Icon" && judgeable(body.props?.name)) {
|
|
19718
19718
|
flagIcon(body.props.name, at2 ? `${at2}.body.props.name` : "props.name");
|
|
19719
19719
|
}
|
|
19720
|
-
for (const [k2, v3] of Object.entries(
|
|
19720
|
+
for (const [k2, v3] of Object.entries(obj13)) {
|
|
19721
19721
|
if (isOpaqueAuthorJson(k2, v3, at2 === "")) continue;
|
|
19722
19722
|
if (ICON_NAME_PROPS.has(k2) && judgeable(v3)) flagIcon(v3, at2 ? `${at2}.${k2}` : k2);
|
|
19723
19723
|
if (v3 && typeof v3 === "object") scanIcons(v3, at2 ? `${at2}.${k2}` : k2);
|
|
@@ -23566,22 +23566,22 @@ var init_pixels = __esm({
|
|
|
23566
23566
|
});
|
|
23567
23567
|
|
|
23568
23568
|
// ../../core/dev-server/src/declared-navigation-ast.ts
|
|
23569
|
-
function fixedNavigations(bundleJs,
|
|
23570
|
-
literalTargets(bundleJs,
|
|
23569
|
+
function fixedNavigations(bundleJs, ts21) {
|
|
23570
|
+
literalTargets(bundleJs, ts21);
|
|
23571
23571
|
return fixedCache.get(bundleJs) ?? /* @__PURE__ */ new Map();
|
|
23572
23572
|
}
|
|
23573
|
-
function literalTargets(bundleJs,
|
|
23574
|
-
const name = (n2) => n2 && (
|
|
23573
|
+
function literalTargets(bundleJs, ts21) {
|
|
23574
|
+
const name = (n2) => n2 && (ts21.isIdentifier(n2) || ts21.isStringLiteral(n2) || ts21.isNoSubstitutionTemplateLiteral(n2)) ? n2.text : void 0;
|
|
23575
23575
|
const object15 = (n2) => {
|
|
23576
|
-
while (n2 &&
|
|
23577
|
-
return n2 &&
|
|
23576
|
+
while (n2 && ts21.isParenthesizedExpression(n2)) n2 = n2.expression;
|
|
23577
|
+
return n2 && ts21.isObjectLiteralExpression(n2) ? n2 : void 0;
|
|
23578
23578
|
};
|
|
23579
23579
|
const property2 = (o2, key3) => o2?.properties.find((p2) => name(p2.name) === key3);
|
|
23580
|
-
const initializer = (p2) => p2 &&
|
|
23581
|
-
const callable = (n2) => !!n2 && (
|
|
23580
|
+
const initializer = (p2) => p2 && ts21.isPropertyAssignment(p2) ? p2.initializer : void 0;
|
|
23581
|
+
const callable = (n2) => !!n2 && (ts21.isArrowFunction(n2) || ts21.isFunctionExpression(n2) || ts21.isFunctionDeclaration(n2) || ts21.isMethodDeclaration(n2));
|
|
23582
23582
|
const cached3 = cache.get(bundleJs);
|
|
23583
23583
|
if (cached3) return cached3;
|
|
23584
|
-
const file2 =
|
|
23584
|
+
const file2 = ts21.createSourceFile("himi-bundle.js", bundleJs, ts21.ScriptTarget.Latest, true, ts21.ScriptKind.JS);
|
|
23585
23585
|
const symbols = /* @__PURE__ */ new Map();
|
|
23586
23586
|
const note = (key3, fn2) => {
|
|
23587
23587
|
if (!key3) return;
|
|
@@ -23589,16 +23589,16 @@ function literalTargets(bundleJs, ts20) {
|
|
|
23589
23589
|
symbols.set(key3, { count: (prior?.count ?? 0) + 1, fn: fn2 });
|
|
23590
23590
|
};
|
|
23591
23591
|
const declarations = (node3) => {
|
|
23592
|
-
if (
|
|
23593
|
-
else if (
|
|
23594
|
-
else if (
|
|
23595
|
-
else if (
|
|
23596
|
-
|
|
23592
|
+
if (ts21.isFunctionDeclaration(node3)) note(name(node3.name), node3);
|
|
23593
|
+
else if (ts21.isVariableDeclaration(node3)) note(name(node3.name), callable(node3.initializer) ? node3.initializer : void 0);
|
|
23594
|
+
else if (ts21.isParameter(node3)) note(name(node3.name));
|
|
23595
|
+
else if (ts21.isBindingElement(node3)) note(name(node3.name));
|
|
23596
|
+
ts21.forEachChild(node3, declarations);
|
|
23597
23597
|
};
|
|
23598
23598
|
declarations(file2);
|
|
23599
23599
|
const resolve98 = (node3) => {
|
|
23600
23600
|
if (callable(node3)) return node3;
|
|
23601
|
-
if (node3 &&
|
|
23601
|
+
if (node3 && ts21.isIdentifier(node3)) {
|
|
23602
23602
|
const symbol = symbols.get(node3.text);
|
|
23603
23603
|
if (symbol?.count === 1) return symbol.fn;
|
|
23604
23604
|
}
|
|
@@ -23612,9 +23612,9 @@ function literalTargets(bundleJs, ts20) {
|
|
|
23612
23612
|
const nav = {};
|
|
23613
23613
|
for (const p2 of o2.properties) {
|
|
23614
23614
|
const key3 = name(p2.name);
|
|
23615
|
-
if (!
|
|
23616
|
-
if (
|
|
23617
|
-
else if (key3 === "reset" && p2.initializer.kind ===
|
|
23615
|
+
if (!ts21.isPropertyAssignment(p2) || !key3 || !NAV_KEYS.has(key3)) return void 0;
|
|
23616
|
+
if (ts21.isStringLiteralLike(p2.initializer) && p2.initializer.text) nav[key3] = p2.initializer.text;
|
|
23617
|
+
else if (key3 === "reset" && p2.initializer.kind === ts21.SyntaxKind.TrueKeyword) nav[key3] = true;
|
|
23618
23618
|
else return void 0;
|
|
23619
23619
|
}
|
|
23620
23620
|
const { screenId, presentation, tab, reset } = nav;
|
|
@@ -23625,75 +23625,75 @@ function literalTargets(bundleJs, ts20) {
|
|
|
23625
23625
|
};
|
|
23626
23626
|
const assigned = /* @__PURE__ */ new Set();
|
|
23627
23627
|
const assignedNames = (n2) => {
|
|
23628
|
-
if (
|
|
23629
|
-
else
|
|
23628
|
+
if (ts21.isIdentifier(n2)) assigned.add(n2.text);
|
|
23629
|
+
else ts21.forEachChild(n2, assignedNames);
|
|
23630
23630
|
};
|
|
23631
23631
|
const assignments = (n2) => {
|
|
23632
|
-
if (
|
|
23633
|
-
else if ((
|
|
23634
|
-
else if ((
|
|
23635
|
-
|
|
23632
|
+
if (ts21.isBinaryExpression(n2) && n2.operatorToken.kind >= ts21.SyntaxKind.FirstAssignment && n2.operatorToken.kind <= ts21.SyntaxKind.LastAssignment) assignedNames(n2.left);
|
|
23633
|
+
else if ((ts21.isPrefixUnaryExpression(n2) || ts21.isPostfixUnaryExpression(n2)) && (n2.operator === ts21.SyntaxKind.PlusPlusToken || n2.operator === ts21.SyntaxKind.MinusMinusToken)) assignedNames(n2.operand);
|
|
23634
|
+
else if ((ts21.isForOfStatement(n2) || ts21.isForInStatement(n2)) && !ts21.isVariableDeclarationList(n2.initializer)) assignedNames(n2.initializer);
|
|
23635
|
+
ts21.forEachChild(n2, assignments);
|
|
23636
23636
|
};
|
|
23637
23637
|
assignments(file2);
|
|
23638
23638
|
const plain2 = (fn2) => {
|
|
23639
|
-
const modifiers =
|
|
23640
|
-
return !fn2.asteriskToken && !modifiers.some((m2) => m2.kind ===
|
|
23639
|
+
const modifiers = ts21.canHaveModifiers(fn2) ? ts21.getModifiers(fn2) ?? [] : [];
|
|
23640
|
+
return !fn2.asteriskToken && !modifiers.some((m2) => m2.kind === ts21.SyntaxKind.AsyncKeyword);
|
|
23641
23641
|
};
|
|
23642
23642
|
const plainParams = (fn2) => {
|
|
23643
23643
|
const names2 = /* @__PURE__ */ new Set();
|
|
23644
23644
|
for (const p2 of fn2.parameters) {
|
|
23645
|
-
if (!
|
|
23645
|
+
if (!ts21.isIdentifier(p2.name) || p2.initializer || p2.dotDotDotToken) return void 0;
|
|
23646
23646
|
names2.add(p2.name.text);
|
|
23647
23647
|
}
|
|
23648
23648
|
return names2;
|
|
23649
23649
|
};
|
|
23650
23650
|
const provenSafe = (expr, params) => {
|
|
23651
|
-
while (
|
|
23652
|
-
if (
|
|
23653
|
-
if (expr.kind ===
|
|
23654
|
-
if (
|
|
23655
|
-
if (
|
|
23656
|
-
return expr.elements.every((e2) => !
|
|
23657
|
-
}
|
|
23658
|
-
if (
|
|
23651
|
+
while (ts21.isParenthesizedExpression(expr)) expr = expr.expression;
|
|
23652
|
+
if (ts21.isStringLiteral(expr) || ts21.isNoSubstitutionTemplateLiteral(expr) || ts21.isNumericLiteral(expr)) return true;
|
|
23653
|
+
if (expr.kind === ts21.SyntaxKind.TrueKeyword || expr.kind === ts21.SyntaxKind.FalseKeyword || expr.kind === ts21.SyntaxKind.NullKeyword) return true;
|
|
23654
|
+
if (ts21.isIdentifier(expr)) return params.has(expr.text);
|
|
23655
|
+
if (ts21.isArrayLiteralExpression(expr)) {
|
|
23656
|
+
return expr.elements.every((e2) => !ts21.isSpreadElement(e2) && !ts21.isOmittedExpression(e2) && provenSafe(e2, params));
|
|
23657
|
+
}
|
|
23658
|
+
if (ts21.isObjectLiteralExpression(expr)) return expr.properties.every((p2) => safeProperty(p2, params));
|
|
23659
23659
|
return false;
|
|
23660
23660
|
};
|
|
23661
23661
|
const safeProperty = (p2, params) => {
|
|
23662
|
-
if (
|
|
23663
|
-
if (
|
|
23664
|
-
if (
|
|
23662
|
+
if (ts21.isSpreadAssignment(p2)) return provenSafe(p2.expression, params);
|
|
23663
|
+
if (ts21.isPropertyAssignment(p2)) return !ts21.isComputedPropertyName(p2.name) && provenSafe(p2.initializer, params);
|
|
23664
|
+
if (ts21.isShorthandPropertyAssignment(p2)) return params.has(p2.name.text) && !p2.objectAssignmentInitializer;
|
|
23665
23665
|
return false;
|
|
23666
23666
|
};
|
|
23667
23667
|
const isNavigateHelper = (callee) => {
|
|
23668
|
-
if (!
|
|
23668
|
+
if (!ts21.isIdentifier(callee) || !/^navigate[0-9]*$/.test(callee.text) || assigned.has(callee.text)) return false;
|
|
23669
23669
|
const symbol = symbols.get(callee.text);
|
|
23670
23670
|
const helper = symbol?.count === 1 ? symbol.fn : void 0;
|
|
23671
23671
|
if (!helper?.body || !plain2(helper) || helper.parameters.length !== 2 || !plainParams(helper)) return false;
|
|
23672
23672
|
const [stateParam, navParam] = helper.parameters.map((p2) => name(p2.name));
|
|
23673
|
-
const body =
|
|
23673
|
+
const body = ts21.isBlock(helper.body) ? helper.body.statements.length === 1 && ts21.isReturnStatement(helper.body.statements[0]) ? helper.body.statements[0].expression : void 0 : helper.body;
|
|
23674
23674
|
const o2 = object15(body);
|
|
23675
23675
|
if (!o2 || o2.properties.length !== 2 || !stateParam || !navParam) return false;
|
|
23676
23676
|
const [spread, nav] = o2.properties;
|
|
23677
|
-
return
|
|
23677
|
+
return ts21.isSpreadAssignment(spread) && ts21.isIdentifier(spread.expression) && spread.expression.text === stateParam && ts21.isPropertyAssignment(nav) && name(nav.name) === "_nav" && ts21.isIdentifier(nav.initializer) && nav.initializer.text === navParam;
|
|
23678
23678
|
};
|
|
23679
23679
|
const fixedOf = (fn2) => {
|
|
23680
23680
|
const params = plainParams(fn2);
|
|
23681
23681
|
if (!fn2.body || !plain2(fn2) || !params) return void 0;
|
|
23682
23682
|
let result = void 0;
|
|
23683
|
-
if (
|
|
23683
|
+
if (ts21.isBlock(fn2.body)) {
|
|
23684
23684
|
const [only, ...rest] = fn2.body.statements;
|
|
23685
|
-
if (!only || rest.length > 0 || !
|
|
23685
|
+
if (!only || rest.length > 0 || !ts21.isReturnStatement(only)) return void 0;
|
|
23686
23686
|
result = only.expression;
|
|
23687
23687
|
} else result = fn2.body;
|
|
23688
|
-
while (result &&
|
|
23688
|
+
while (result && ts21.isParenthesizedExpression(result)) result = result.expression;
|
|
23689
23689
|
let navNode;
|
|
23690
|
-
if (result &&
|
|
23690
|
+
if (result && ts21.isObjectLiteralExpression(result)) {
|
|
23691
23691
|
const props2 = result.properties;
|
|
23692
23692
|
const lastProp = props2[props2.length - 1];
|
|
23693
|
-
if (!lastProp || !
|
|
23693
|
+
if (!lastProp || !ts21.isPropertyAssignment(lastProp) || ts21.isComputedPropertyName(lastProp.name) || name(lastProp.name) !== "_nav") return void 0;
|
|
23694
23694
|
if (!props2.slice(0, -1).every((p2) => safeProperty(p2, params))) return void 0;
|
|
23695
23695
|
navNode = lastProp.initializer;
|
|
23696
|
-
} else if (result &&
|
|
23696
|
+
} else if (result && ts21.isCallExpression(result) && result.arguments.length === 2 && isNavigateHelper(result.expression)) {
|
|
23697
23697
|
if (!provenSafe(result.arguments[0], params)) return void 0;
|
|
23698
23698
|
navNode = result.arguments[1];
|
|
23699
23699
|
}
|
|
@@ -23703,58 +23703,58 @@ function literalTargets(bundleJs, ts20) {
|
|
|
23703
23703
|
return { nav, line: position.line + 1, column: position.character };
|
|
23704
23704
|
};
|
|
23705
23705
|
const visit = (node3) => {
|
|
23706
|
-
if (
|
|
23707
|
-
const callee =
|
|
23706
|
+
if (ts21.isCallExpression(node3)) {
|
|
23707
|
+
const callee = ts21.isPropertyAccessExpression(node3.expression) ? node3.expression.name.text : name(node3.expression);
|
|
23708
23708
|
const service = node3.arguments[0];
|
|
23709
|
-
if (callee && /^defineService[0-9]*$/.test(callee) && service &&
|
|
23709
|
+
if (callee && /^defineService[0-9]*$/.test(callee) && service && ts21.isStringLiteralLike(service)) {
|
|
23710
23710
|
const actions = object15(initializer(property2(object15(node3.arguments[1]), "actions")));
|
|
23711
23711
|
for (const member of actions?.properties ?? []) {
|
|
23712
23712
|
const action = name(member.name);
|
|
23713
|
-
const fn2 =
|
|
23713
|
+
const fn2 = ts21.isMethodDeclaration(member) ? member : resolve98(ts21.isShorthandPropertyAssignment(member) ? member.name : initializer(member));
|
|
23714
23714
|
if (!action || !fn2?.body) continue;
|
|
23715
23715
|
const targets = [];
|
|
23716
23716
|
const target = (expr) => {
|
|
23717
23717
|
const sid = initializer(property2(object15(expr), "screenId"));
|
|
23718
|
-
if (!sid || !
|
|
23718
|
+
if (!sid || !ts21.isStringLiteralLike(sid)) return;
|
|
23719
23719
|
const position = file2.getLineAndCharacterOfPosition(sid.getStart(file2));
|
|
23720
23720
|
targets.push({ screenId: sid.text, line: position.line + 1, column: position.character });
|
|
23721
23721
|
};
|
|
23722
23722
|
const returned = (expr) => {
|
|
23723
23723
|
if (!expr) return;
|
|
23724
|
-
if (
|
|
23724
|
+
if (ts21.isParenthesizedExpression(expr) || ts21.isAwaitExpression(expr)) {
|
|
23725
23725
|
returned(expr.expression);
|
|
23726
23726
|
return;
|
|
23727
23727
|
}
|
|
23728
|
-
if (
|
|
23728
|
+
if (ts21.isConditionalExpression(expr)) {
|
|
23729
23729
|
returned(expr.whenTrue);
|
|
23730
23730
|
returned(expr.whenFalse);
|
|
23731
23731
|
return;
|
|
23732
23732
|
}
|
|
23733
|
-
if (
|
|
23733
|
+
if (ts21.isObjectLiteralExpression(expr)) {
|
|
23734
23734
|
target(initializer(property2(expr, "_nav")));
|
|
23735
23735
|
return;
|
|
23736
23736
|
}
|
|
23737
|
-
if (
|
|
23738
|
-
const called =
|
|
23737
|
+
if (ts21.isCallExpression(expr)) {
|
|
23738
|
+
const called = ts21.isPropertyAccessExpression(expr.expression) ? expr.expression.name.text : name(expr.expression);
|
|
23739
23739
|
if (called && /^navigate[0-9]*$/.test(called)) target(expr.arguments[1]);
|
|
23740
23740
|
}
|
|
23741
23741
|
};
|
|
23742
|
-
if (
|
|
23742
|
+
if (ts21.isBlock(fn2.body)) {
|
|
23743
23743
|
const returns = (part4) => {
|
|
23744
23744
|
if (callable(part4)) return;
|
|
23745
|
-
if (
|
|
23746
|
-
else
|
|
23745
|
+
if (ts21.isReturnStatement(part4)) returned(part4.expression);
|
|
23746
|
+
else ts21.forEachChild(part4, returns);
|
|
23747
23747
|
};
|
|
23748
23748
|
returns(fn2.body);
|
|
23749
23749
|
} else returned(fn2.body);
|
|
23750
23750
|
results.set("tier5." + service.text + "." + action, targets);
|
|
23751
|
-
const ref =
|
|
23752
|
-
const always = ref &&
|
|
23751
|
+
const ref = ts21.isShorthandPropertyAssignment(member) ? member.name : initializer(member);
|
|
23752
|
+
const always = ref && ts21.isIdentifier(ref) && assigned.has(ref.text) ? void 0 : fixedOf(fn2);
|
|
23753
23753
|
if (always) fixed.set("tier5." + service.text + "." + action, always);
|
|
23754
23754
|
}
|
|
23755
23755
|
}
|
|
23756
23756
|
}
|
|
23757
|
-
|
|
23757
|
+
ts21.forEachChild(node3, visit);
|
|
23758
23758
|
};
|
|
23759
23759
|
visit(file2);
|
|
23760
23760
|
cache.set(bundleJs, results);
|
|
@@ -24026,11 +24026,11 @@ function appIconBadgeSourcesErrors(value2) {
|
|
|
24026
24026
|
function validateOverlayPatch(patch) {
|
|
24027
24027
|
const errs = [];
|
|
24028
24028
|
if (!patch || typeof patch !== "object" || Array.isArray(patch)) return ["overlay must be a JSON object"];
|
|
24029
|
-
const
|
|
24030
|
-
for (const k2 of Object.keys(
|
|
24029
|
+
const obj13 = patch;
|
|
24030
|
+
for (const k2 of Object.keys(obj13)) {
|
|
24031
24031
|
if (STRUCTURAL_KEYS.has(k2)) errs.push(`"${k2}" is structural \u2014 edit it in source (deriveNavigationConfig), not the overlay`);
|
|
24032
24032
|
else if (!OPERATIONAL_OVERLAY_KEYS.has(k2)) errs.push(`"${k2}" is not an allowed operational overlay key`);
|
|
24033
|
-
else if (k2 === "appIconBadgeSources") errs.push(...appIconBadgeSourcesErrors(
|
|
24033
|
+
else if (k2 === "appIconBadgeSources") errs.push(...appIconBadgeSourcesErrors(obj13[k2]));
|
|
24034
24034
|
}
|
|
24035
24035
|
return errs;
|
|
24036
24036
|
}
|
|
@@ -25506,10 +25506,10 @@ function inferScreenDisplayName(screenId) {
|
|
|
25506
25506
|
return `${words || screenId}${opaque2 ? ` (${opaque2[1]})` : ""}`;
|
|
25507
25507
|
}
|
|
25508
25508
|
function screenDisplayName(screenId, displayName3, title, navigationLabel) {
|
|
25509
|
-
const
|
|
25510
|
-
if (
|
|
25511
|
-
if (
|
|
25512
|
-
if (
|
|
25509
|
+
const literal2 = (value2) => typeof value2 === "string" && !!value2.trim() && !value2.trim().startsWith("$") && !/^__[A-Z0-9_]+__$/.test(value2.trim());
|
|
25510
|
+
if (literal2(displayName3)) return displayName3.trim();
|
|
25511
|
+
if (literal2(title) && title.trim() !== screenId) return title.trim();
|
|
25512
|
+
if (literal2(navigationLabel)) return navigationLabel.trim();
|
|
25513
25513
|
return inferScreenDisplayName(screenId);
|
|
25514
25514
|
}
|
|
25515
25515
|
var ScreenViewValidationError, ID, object;
|
|
@@ -27833,8 +27833,8 @@ function translate(node3, tag) {
|
|
|
27833
27833
|
return;
|
|
27834
27834
|
}
|
|
27835
27835
|
if (typeof n2 !== "object" || n2 === null) return;
|
|
27836
|
-
const
|
|
27837
|
-
const body =
|
|
27836
|
+
const obj13 = n2;
|
|
27837
|
+
const body = obj13.body;
|
|
27838
27838
|
if (body && typeof body.type === "string" && body.props) {
|
|
27839
27839
|
const fields = STRING_FIELDS_BY_TYPE[body.type] ?? [];
|
|
27840
27840
|
for (const f2 of fields) {
|
|
@@ -27858,12 +27858,12 @@ function translate(node3, tag) {
|
|
|
27858
27858
|
if (t2) templ.template = t2;
|
|
27859
27859
|
}
|
|
27860
27860
|
}
|
|
27861
|
-
for (const [k2, v2] of Object.entries(
|
|
27861
|
+
for (const [k2, v2] of Object.entries(obj13)) {
|
|
27862
27862
|
if (atRoot && k2 === "input" && v2 !== null && typeof v2 === "object") continue;
|
|
27863
27863
|
if (inLogicBundle && k2 === "bootState") continue;
|
|
27864
27864
|
if (typeof v2 === "string" && SECONDARY_FIELDS.has(k2)) {
|
|
27865
27865
|
const t2 = map2.get(v2);
|
|
27866
|
-
if (t2)
|
|
27866
|
+
if (t2) obj13[k2] = t2;
|
|
27867
27867
|
} else {
|
|
27868
27868
|
visit(v2, false, atRoot && k2 === "logicBundle");
|
|
27869
27869
|
}
|
|
@@ -35718,8 +35718,8 @@ async function readBody(req) {
|
|
|
35718
35718
|
for await (const c2 of req) chunks.push(c2);
|
|
35719
35719
|
return Buffer.concat(chunks).toString("utf-8");
|
|
35720
35720
|
}
|
|
35721
|
-
function json(res, status,
|
|
35722
|
-
const body = JSON.stringify(
|
|
35721
|
+
function json(res, status, obj13) {
|
|
35722
|
+
const body = JSON.stringify(obj13);
|
|
35723
35723
|
res.statusCode = status;
|
|
35724
35724
|
res.setHeader("content-type", "application/json; charset=utf-8");
|
|
35725
35725
|
res.end(body);
|
|
@@ -37917,14 +37917,14 @@ function validateParams(schema2, params) {
|
|
|
37917
37917
|
if (!schema2 || !schema2.type && !schema2.properties && !schema2.required && !schema2.enum) {
|
|
37918
37918
|
return issues;
|
|
37919
37919
|
}
|
|
37920
|
-
const
|
|
37920
|
+
const obj13 = params ?? {};
|
|
37921
37921
|
for (const key3 of schema2.required ?? []) {
|
|
37922
|
-
if (
|
|
37922
|
+
if (obj13[key3] === void 0 || obj13[key3] === null) {
|
|
37923
37923
|
issues.push({ path: key3, message: `required field "${key3}" is missing` });
|
|
37924
37924
|
}
|
|
37925
37925
|
}
|
|
37926
37926
|
for (const [key3, sub] of Object.entries(schema2.properties ?? {})) {
|
|
37927
|
-
const val =
|
|
37927
|
+
const val = obj13[key3];
|
|
37928
37928
|
if (val === void 0 || val === null) continue;
|
|
37929
37929
|
if (sub.type && typeOf3(val) !== sub.type) {
|
|
37930
37930
|
issues.push({ path: key3, message: `"${key3}" must be ${sub.type}, got ${typeOf3(val)}` });
|
|
@@ -44134,7 +44134,7 @@ function pdfObjectSyntax(text15) {
|
|
|
44134
44134
|
return out2.join("");
|
|
44135
44135
|
}
|
|
44136
44136
|
function pdfRootPageCount(syntax) {
|
|
44137
|
-
const
|
|
44137
|
+
const obj13 = (n3, g2) => {
|
|
44138
44138
|
const all = [...syntax.matchAll(new RegExp(`(?:^|[^0-9])${n3}\\s+${g2}\\s+obj\\b`, "g"))];
|
|
44139
44139
|
const at2 = all[all.length - 1];
|
|
44140
44140
|
if (!at2) return null;
|
|
@@ -44144,10 +44144,10 @@ function pdfRootPageCount(syntax) {
|
|
|
44144
44144
|
const trailers = [...syntax.matchAll(/trailer\s*<<([\s\S]*?)>>/g)];
|
|
44145
44145
|
const root = trailers.length ? /\/Root\s+(\d+)\s+(\d+)\s+R/.exec(trailers[trailers.length - 1][1]) : null;
|
|
44146
44146
|
if (!root) return null;
|
|
44147
|
-
const catalog4 =
|
|
44147
|
+
const catalog4 = obj13(root[1], root[2]);
|
|
44148
44148
|
const pagesRef = catalog4 ? /\/Pages\s+(\d+)\s+(\d+)\s+R/.exec(catalog4) : null;
|
|
44149
44149
|
if (!pagesRef) return null;
|
|
44150
|
-
const pages2 =
|
|
44150
|
+
const pages2 = obj13(pagesRef[1], pagesRef[2]);
|
|
44151
44151
|
const c2 = pages2 ? /\/Count\s+(\d+)/.exec(pages2) : null;
|
|
44152
44152
|
const n2 = c2 ? Number(c2[1]) : NaN;
|
|
44153
44153
|
return Number.isFinite(n2) && n2 > 0 ? n2 : null;
|
|
@@ -44841,8 +44841,8 @@ function updateUrlHash(url, hash3, allowRel = false) {
|
|
|
44841
44841
|
function stripPath(str13) {
|
|
44842
44842
|
return str13.substring(str13.lastIndexOf("/") + 1);
|
|
44843
44843
|
}
|
|
44844
|
-
function shadow(
|
|
44845
|
-
Object.defineProperty(
|
|
44844
|
+
function shadow(obj13, prop2, value2, nonSerializable2 = false) {
|
|
44845
|
+
Object.defineProperty(obj13, prop2, {
|
|
44846
44846
|
value: value2,
|
|
44847
44847
|
enumerable: !nonSerializable2,
|
|
44848
44848
|
configurable: true,
|
|
@@ -45357,9 +45357,9 @@ function makePathFromDrawOPS(data) {
|
|
|
45357
45357
|
}
|
|
45358
45358
|
return path2;
|
|
45359
45359
|
}
|
|
45360
|
-
function bindEvents(
|
|
45360
|
+
function bindEvents(obj13, element, names2) {
|
|
45361
45361
|
for (const name of names2) {
|
|
45362
|
-
element.addEventListener(name,
|
|
45362
|
+
element.addEventListener(name, obj13[name].bind(obj13));
|
|
45363
45363
|
}
|
|
45364
45364
|
}
|
|
45365
45365
|
function preventDefault(evt) {
|
|
@@ -47260,10 +47260,10 @@ var init_pdf = __esm({
|
|
|
47260
47260
|
},
|
|
47261
47261
|
/***/
|
|
47262
47262
|
1767(module) {
|
|
47263
|
-
module.exports = function(
|
|
47263
|
+
module.exports = function(obj13) {
|
|
47264
47264
|
return {
|
|
47265
|
-
iterator:
|
|
47266
|
-
next:
|
|
47265
|
+
iterator: obj13,
|
|
47266
|
+
next: obj13.next,
|
|
47267
47267
|
done: false
|
|
47268
47268
|
};
|
|
47269
47269
|
};
|
|
@@ -47274,10 +47274,10 @@ var init_pdf = __esm({
|
|
|
47274
47274
|
var anObject = __webpack_require__3(8551);
|
|
47275
47275
|
var getIteratorDirect = __webpack_require__3(1767);
|
|
47276
47276
|
var getIteratorMethod = __webpack_require__3(3085);
|
|
47277
|
-
module.exports = function(
|
|
47278
|
-
if (!stringHandling || typeof
|
|
47279
|
-
var method = getIteratorMethod(
|
|
47280
|
-
return getIteratorDirect(anObject(method !== void 0 ? call(method,
|
|
47277
|
+
module.exports = function(obj13, stringHandling) {
|
|
47278
|
+
if (!stringHandling || typeof obj13 !== "string") anObject(obj13);
|
|
47279
|
+
var method = getIteratorMethod(obj13);
|
|
47280
|
+
return getIteratorDirect(anObject(method !== void 0 ? call(method, obj13) : obj13));
|
|
47281
47281
|
};
|
|
47282
47282
|
},
|
|
47283
47283
|
/***/
|
|
@@ -47340,13 +47340,13 @@ var init_pdf = __esm({
|
|
|
47340
47340
|
return call(this.has, this.set, it2);
|
|
47341
47341
|
}
|
|
47342
47342
|
};
|
|
47343
|
-
module.exports = function(
|
|
47344
|
-
anObject(
|
|
47345
|
-
var numSize = +
|
|
47343
|
+
module.exports = function(obj13) {
|
|
47344
|
+
anObject(obj13);
|
|
47345
|
+
var numSize = +obj13.size;
|
|
47346
47346
|
if (numSize !== numSize) throw new $TypeError(INVALID_SIZE);
|
|
47347
47347
|
var intSize = toIntegerOrInfinity(numSize);
|
|
47348
47348
|
if (intSize < 0) throw new $RangeError(INVALID_SIZE);
|
|
47349
|
-
return new SetRecord(
|
|
47349
|
+
return new SetRecord(obj13, intSize);
|
|
47350
47350
|
};
|
|
47351
47351
|
},
|
|
47352
47352
|
/***/
|
|
@@ -47893,8 +47893,8 @@ var init_pdf = __esm({
|
|
|
47893
47893
|
/***/
|
|
47894
47894
|
6198(module, __unused_webpack_exports, __webpack_require__3) {
|
|
47895
47895
|
var toLength = __webpack_require__3(8014);
|
|
47896
|
-
module.exports = function(
|
|
47897
|
-
return toLength(
|
|
47896
|
+
module.exports = function(obj13) {
|
|
47897
|
+
return toLength(obj13.length);
|
|
47898
47898
|
};
|
|
47899
47899
|
},
|
|
47900
47900
|
/***/
|
|
@@ -50699,7 +50699,7 @@ var init_pdf = __esm({
|
|
|
50699
50699
|
};
|
|
50700
50700
|
})();
|
|
50701
50701
|
(() => {
|
|
50702
|
-
__webpack_require__.o = (
|
|
50702
|
+
__webpack_require__.o = (obj13, prop2) => Object.prototype.hasOwnProperty.call(obj13, prop2);
|
|
50703
50703
|
})();
|
|
50704
50704
|
es_array_includes = __webpack_require__(4423);
|
|
50705
50705
|
es_array_push = __webpack_require__(4114);
|
|
@@ -56894,13 +56894,13 @@ var init_pdf = __esm({
|
|
|
56894
56894
|
this.onAnnotationEditor?.(null);
|
|
56895
56895
|
}
|
|
56896
56896
|
setValue(key3, value2) {
|
|
56897
|
-
const
|
|
56897
|
+
const obj13 = this.#storage.get(key3);
|
|
56898
56898
|
let modified = false;
|
|
56899
|
-
if (
|
|
56899
|
+
if (obj13 !== void 0) {
|
|
56900
56900
|
for (const [entry, val] of Object.entries(value2)) {
|
|
56901
|
-
if (
|
|
56901
|
+
if (obj13[entry] !== val) {
|
|
56902
56902
|
modified = true;
|
|
56903
|
-
|
|
56903
|
+
obj13[entry] = val;
|
|
56904
56904
|
}
|
|
56905
56905
|
}
|
|
56906
56906
|
} else {
|
|
@@ -58559,9 +58559,9 @@ var init_pdf = __esm({
|
|
|
58559
58559
|
LoopbackPort = class {
|
|
58560
58560
|
#listeners = /* @__PURE__ */ new Map();
|
|
58561
58561
|
#deferred = Promise.resolve();
|
|
58562
|
-
postMessage(
|
|
58562
|
+
postMessage(obj13, transfer) {
|
|
58563
58563
|
const event = {
|
|
58564
|
-
data: structuredClone(
|
|
58564
|
+
data: structuredClone(obj13, transfer ? {
|
|
58565
58565
|
transfer
|
|
58566
58566
|
} : null)
|
|
58567
58567
|
};
|
|
@@ -64037,35 +64037,35 @@ fn fs_main(in : VertexOutput) -> @location(0) vec4<f32> {
|
|
|
64037
64037
|
#objs = /* @__PURE__ */ new Map();
|
|
64038
64038
|
get(objId, callback = null) {
|
|
64039
64039
|
if (callback) {
|
|
64040
|
-
const
|
|
64041
|
-
|
|
64040
|
+
const obj14 = this.#objs.getOrInsertComputed(objId, dataObj);
|
|
64041
|
+
obj14.promise.then(() => callback(obj14.data));
|
|
64042
64042
|
return null;
|
|
64043
64043
|
}
|
|
64044
|
-
const
|
|
64045
|
-
if (!
|
|
64044
|
+
const obj13 = this.#objs.get(objId);
|
|
64045
|
+
if (!obj13 || obj13.data === INITIAL_DATA) {
|
|
64046
64046
|
throw new Error(`Requesting object that isn't resolved yet ${objId}.`);
|
|
64047
64047
|
}
|
|
64048
|
-
return
|
|
64048
|
+
return obj13.data;
|
|
64049
64049
|
}
|
|
64050
64050
|
has(objId) {
|
|
64051
|
-
const
|
|
64052
|
-
return !!
|
|
64051
|
+
const obj13 = this.#objs.get(objId);
|
|
64052
|
+
return !!obj13 && obj13.data !== INITIAL_DATA;
|
|
64053
64053
|
}
|
|
64054
64054
|
delete(objId) {
|
|
64055
|
-
const
|
|
64056
|
-
if (!
|
|
64055
|
+
const obj13 = this.#objs.get(objId);
|
|
64056
|
+
if (!obj13 || obj13.data === INITIAL_DATA) {
|
|
64057
64057
|
return false;
|
|
64058
64058
|
}
|
|
64059
64059
|
this.#objs.delete(objId);
|
|
64060
64060
|
return true;
|
|
64061
64061
|
}
|
|
64062
64062
|
resolve(objId, data = null) {
|
|
64063
|
-
const
|
|
64064
|
-
if (
|
|
64063
|
+
const obj13 = this.#objs.getOrInsertComputed(objId, dataObj);
|
|
64064
|
+
if (obj13.data !== INITIAL_DATA) {
|
|
64065
64065
|
throw new Error(`Object already resolved ${objId}.`);
|
|
64066
64066
|
}
|
|
64067
|
-
|
|
64068
|
-
|
|
64067
|
+
obj13.data = data;
|
|
64068
|
+
obj13.resolve();
|
|
64069
64069
|
}
|
|
64070
64070
|
clear() {
|
|
64071
64071
|
for (const {
|
|
@@ -131660,8 +131660,8 @@ var init_renderNode = __esm({
|
|
|
131660
131660
|
let countAttrs;
|
|
131661
131661
|
let countContent;
|
|
131662
131662
|
if (props2.animateValue === true && !ctx.reduceMotion()) {
|
|
131663
|
-
const
|
|
131664
|
-
const parsed =
|
|
131663
|
+
const literal2 = typeof props2.text === "string" && !isBinding(props2.text) ? props2.text : void 0;
|
|
131664
|
+
const parsed = literal2 != null ? parseCountUp(literal2) : null;
|
|
131665
131665
|
if (parsed) {
|
|
131666
131666
|
ensureCountUpRuntime();
|
|
131667
131667
|
countAttrs = {
|
|
@@ -132902,7 +132902,7 @@ var init_renderNode = __esm({
|
|
|
132902
132902
|
const gated2 = props2.presentedPath != null || props2.presented != null;
|
|
132903
132903
|
const gate = props2.presentedPath != null ? bound2 : props2.presented;
|
|
132904
132904
|
const gateOpen = gate === true || gate === "true";
|
|
132905
|
-
const
|
|
132905
|
+
const literal2 = props2.presentedPath == null && props2.presented != null;
|
|
132906
132906
|
const identity = { path: props2.presentedPath, presented: props2.presented, provider: ctx.provider };
|
|
132907
132907
|
const [local, setLocal] = React17.useState({ ...identity, opened: false, dismissed: false });
|
|
132908
132908
|
const sameGate = local.path === identity.path && local.presented === identity.presented && local.provider === identity.provider;
|
|
@@ -132955,7 +132955,7 @@ var init_renderNode = __esm({
|
|
|
132955
132955
|
}, [gated2, shown2, props2.presentedPath, props2.presented, ctx.provider]);
|
|
132956
132956
|
const floating = gated2 ? { position: "absolute", zIndex: 40, ...overlayEdgeStyle(placed, 6), translate: `${placement.x}px ${placement.y}px` } : {};
|
|
132957
132957
|
const inline = gated2 ? null : inlineEdgeFlex(resolveOverlayEdge("Popover", props2.edge));
|
|
132958
|
-
const openFromAnchor =
|
|
132958
|
+
const openFromAnchor = literal2 ? () => {
|
|
132959
132959
|
if (shown2) return;
|
|
132960
132960
|
setLocal({ ...identity, opened: true, dismissed: false });
|
|
132961
132961
|
} : void 0;
|
|
@@ -132963,9 +132963,9 @@ var init_renderNode = __esm({
|
|
|
132963
132963
|
const [needsSeparateOpener, setNeedsSeparateOpener] = React17.useState(false);
|
|
132964
132964
|
useIsomorphicLayoutEffect(() => {
|
|
132965
132965
|
const el2 = anchorRef.current;
|
|
132966
|
-
const want =
|
|
132966
|
+
const want = literal2 && el2 != null && !hasTabStop(el2);
|
|
132967
132967
|
if (want !== anchorIsButton) setAnchorIsButton(want);
|
|
132968
|
-
const needsOpener =
|
|
132968
|
+
const needsOpener = literal2 && el2 != null && Array.from(el2.querySelectorAll(NATIVELY_TABBABLE)).some((control) => control.tabIndex >= 0 && !control.disabled && !control.matches('button,a[href],area[href],summary,input[type="button"],input[type="submit"],input[type="reset"],input[type="checkbox"],input[type="radio"],[role="button"],[role="link"]'));
|
|
132969
132969
|
if (needsOpener !== needsSeparateOpener) setNeedsSeparateOpener(needsOpener);
|
|
132970
132970
|
});
|
|
132971
132971
|
const anchorButtonProps = anchorIsButton ? {
|
|
@@ -133566,8 +133566,8 @@ var init_renderNode = __esm({
|
|
|
133566
133566
|
const boundState = useResolvedScalar(props2.statePath, ctx);
|
|
133567
133567
|
const boundDelivery = useResolvedScalar(props2.deliveryPath, ctx);
|
|
133568
133568
|
const boundRate = useResolvedScalar(props2.ratePath, ctx);
|
|
133569
|
-
const num4 = (bound2,
|
|
133570
|
-
const v2 = bound2 !== void 0 && bound2 !== null ? bound2 :
|
|
133569
|
+
const num4 = (bound2, literal2, dflt) => {
|
|
133570
|
+
const v2 = bound2 !== void 0 && bound2 !== null ? bound2 : literal2;
|
|
133571
133571
|
const n2 = typeof v2 === "number" ? v2 : typeof v2 === "string" ? Number(v2) : NaN;
|
|
133572
133572
|
return Number.isFinite(n2) ? n2 : dflt;
|
|
133573
133573
|
};
|
|
@@ -135777,16 +135777,16 @@ __export(render_descriptor_exports, {
|
|
|
135777
135777
|
});
|
|
135778
135778
|
function a11ySemantics(type2, props2, modifiers, ancestorHidden, resolve98) {
|
|
135779
135779
|
if (!A11Y_MODIFIER_KEYS.some((k2) => modifiers[k2] !== void 0)) return void 0;
|
|
135780
|
-
const
|
|
135780
|
+
const literal2 = (v2) => typeof v2 === "string" && v2.trim() !== "" && !isDynamicValue(v2) ? v2 : void 0;
|
|
135781
135781
|
const spoken = (v2) => {
|
|
135782
|
-
const lit =
|
|
135782
|
+
const lit = literal2(v2);
|
|
135783
135783
|
if (lit !== void 0 || !resolve98 || typeof v2 !== "string" || !isDynamicValue(v2)) return lit;
|
|
135784
135784
|
const r3 = resolve98(v2);
|
|
135785
135785
|
if (r3 === v2) return void 0;
|
|
135786
135786
|
return typeof r3 === "string" && r3.trim() !== "" ? r3 : typeof r3 === "number" ? String(r3) : void 0;
|
|
135787
135787
|
};
|
|
135788
135788
|
const exposure = ancestorHidden ? "hidden" : atExposureOf({ ...props2, modifiers });
|
|
135789
|
-
const declared =
|
|
135789
|
+
const declared = literal2(modifiers.accessibilityRole);
|
|
135790
135790
|
const inferred = (typeof modifiers.headingLevel === "number" ? "heading" : void 0) ?? (type2 === "SelectionControl" && props2.kind === "radio" ? "radio" : void 0) ?? (type2 === "BottomSheet" ? props2.modal === false ? "region" : "dialog" : void 0) ?? A11Y_CONTRACT[type2]?.role ?? "unspecified";
|
|
135791
135791
|
const role = declared === "decorative" && isInteractive({ ...props2, modifiers }) ? "button" : declared ?? inferred;
|
|
135792
135792
|
if (exposure === "hidden") return { role, exposure };
|
|
@@ -135809,9 +135809,9 @@ function a11ySemantics(type2, props2, modifiers, ancestorHidden, resolve98) {
|
|
|
135809
135809
|
if (announce && typeof announce === "object" && !Array.isArray(announce)) {
|
|
135810
135810
|
const a2 = announce;
|
|
135811
135811
|
out2.live = {
|
|
135812
|
-
politeness:
|
|
135813
|
-
trigger:
|
|
135814
|
-
...
|
|
135812
|
+
politeness: literal2(a2.politeness) ?? "polite",
|
|
135813
|
+
trigger: literal2(a2.trigger) ?? "on_change",
|
|
135814
|
+
...literal2(a2.text) !== void 0 ? { text: literal2(a2.text) } : {}
|
|
135815
135815
|
};
|
|
135816
135816
|
}
|
|
135817
135817
|
return out2;
|
|
@@ -135856,9 +135856,9 @@ function clientEnvFor(scheme, width, isRTL2) {
|
|
|
135856
135856
|
}
|
|
135857
135857
|
function nodeHidden(modifiers, provider, itemScope, env) {
|
|
135858
135858
|
const hp = modifiers.hiddenPath ?? modifiers.hidden_path;
|
|
135859
|
-
const
|
|
135859
|
+
const literal2 = modifiers.hidden === true;
|
|
135860
135860
|
const stateGate = typeof hp === "string" && (hp.startsWith("$service:") || hp.startsWith("$app:"));
|
|
135861
|
-
if (
|
|
135861
|
+
if (literal2 && !stateGate) return true;
|
|
135862
135862
|
if (typeof hp !== "string" || !hp) return false;
|
|
135863
135863
|
const low = hp.trim().toLowerCase();
|
|
135864
135864
|
if (low === "true" || low === "1") return true;
|
|
@@ -135866,7 +135866,7 @@ function nodeHidden(modifiers, provider, itemScope, env) {
|
|
|
135866
135866
|
if (isEnvExpr(hp)) return env ? envHidden(hp, env) === true : false;
|
|
135867
135867
|
if (hp.startsWith("$item") || stateGate) {
|
|
135868
135868
|
const v2 = hp.startsWith("$app:") ? provider.value(hp) ?? void 0 : resolveTreeScalar(hp, provider, itemScope);
|
|
135869
|
-
return
|
|
135869
|
+
return literal2 && (v2 === void 0 || v2 === null) ? true : hiddenBool2(v2);
|
|
135870
135870
|
}
|
|
135871
135871
|
return false;
|
|
135872
135872
|
}
|
|
@@ -135925,14 +135925,14 @@ function collectNativeOnly(node3) {
|
|
|
135925
135925
|
}
|
|
135926
135926
|
function buildRenderTree(node3, path2 = "$", provider = null, itemScope = void 0, includeRawProps = false, env = null, a11yHiddenAbove = false) {
|
|
135927
135927
|
if (!node3 || typeof node3 !== "object") return null;
|
|
135928
|
-
const
|
|
135929
|
-
const body =
|
|
135928
|
+
const obj13 = node3;
|
|
135929
|
+
const body = obj13.body ?? {};
|
|
135930
135930
|
const type2 = typeof body.type === "string" ? body.type : "Unknown";
|
|
135931
|
-
const id = typeof
|
|
135931
|
+
const id = typeof obj13.id === "string" && obj13.id ? obj13.id : path2;
|
|
135932
135932
|
const out2 = { id, type: type2 };
|
|
135933
135933
|
if (typeof body.package === "string") out2.package = body.package;
|
|
135934
135934
|
const props2 = body.props ?? {};
|
|
135935
|
-
const modifiers =
|
|
135935
|
+
const modifiers = obj13.modifiers ?? {};
|
|
135936
135936
|
if (includeRawProps) {
|
|
135937
135937
|
const raw = {};
|
|
135938
135938
|
for (const [key3, value2] of Object.entries(props2)) {
|
|
@@ -137822,8 +137822,8 @@ function send(res, status, body, headers2 = {}) {
|
|
|
137822
137822
|
}
|
|
137823
137823
|
res.end(body);
|
|
137824
137824
|
}
|
|
137825
|
-
function sendJson(res, status,
|
|
137826
|
-
send(res, status, JSON.stringify(
|
|
137825
|
+
function sendJson(res, status, obj13, headers2 = {}) {
|
|
137826
|
+
send(res, status, JSON.stringify(obj13), {
|
|
137827
137827
|
"content-type": "application/json; charset=utf-8",
|
|
137828
137828
|
...headers2
|
|
137829
137829
|
});
|
|
@@ -139108,11 +139108,11 @@ async function handleWebWix(req, res, state) {
|
|
|
139108
139108
|
return {};
|
|
139109
139109
|
}
|
|
139110
139110
|
};
|
|
139111
|
-
const reply = (status,
|
|
139111
|
+
const reply = (status, obj13) => {
|
|
139112
139112
|
res.statusCode = status;
|
|
139113
139113
|
res.setHeader("content-type", "application/json; charset=utf-8");
|
|
139114
139114
|
res.setHeader("access-control-allow-origin", "*");
|
|
139115
|
-
res.end(JSON.stringify(
|
|
139115
|
+
res.end(JSON.stringify(obj13));
|
|
139116
139116
|
};
|
|
139117
139117
|
if (path2 === "/v1/__webwix/stream" && req.method === "POST") {
|
|
139118
139118
|
const b2 = await readJson12();
|
|
@@ -142214,9 +142214,9 @@ function hasRowBinding(props2) {
|
|
|
142214
142214
|
});
|
|
142215
142215
|
}
|
|
142216
142216
|
function declaredOptionIds(props2, resolve98) {
|
|
142217
|
-
const
|
|
142217
|
+
const literal2 = props2.options ?? props2.tabs ?? props2.chips;
|
|
142218
142218
|
const bound2 = props2.optionsPath !== void 0 ? resolved(props2.optionsPath, resolve98) : void 0;
|
|
142219
|
-
const raw = Array.isArray(bound2) ? bound2 :
|
|
142219
|
+
const raw = Array.isArray(bound2) ? bound2 : literal2;
|
|
142220
142220
|
if (!Array.isArray(raw)) return [];
|
|
142221
142221
|
const out2 = [];
|
|
142222
142222
|
for (const o2 of raw) {
|
|
@@ -142284,8 +142284,8 @@ function synthesizeInput(control, resolve98, tokens2) {
|
|
|
142284
142284
|
if (!acceptsWords(props2) || !acceptsWords(control.wrapper ?? {})) return null;
|
|
142285
142285
|
const binding2 = typeof props2.valuePath === "string" ? props2.valuePath : typeof props2.value === "string" && props2.value.startsWith("$service:") ? props2.value : void 0;
|
|
142286
142286
|
const bound2 = binding2 === void 0 ? void 0 : resolve98(binding2);
|
|
142287
|
-
const
|
|
142288
|
-
const current = typeof bound2 === "string" ? bound2 : typeof bound2 === "number" ? String(bound2) :
|
|
142287
|
+
const literal2 = typeof props2.value === "string" && !props2.value.startsWith("$") ? props2.value : void 0;
|
|
142288
|
+
const current = typeof bound2 === "string" ? bound2 : typeof bound2 === "number" ? String(bound2) : literal2 ?? "";
|
|
142289
142289
|
const max = typeof props2.maxLength === "number" && props2.maxLength > 0 ? props2.maxLength : void 0;
|
|
142290
142290
|
const pick3 = tokens2().find((t2) => t2 !== current && (max === void 0 || t2.length <= max));
|
|
142291
142291
|
if (pick3 === void 0) return null;
|
|
@@ -142757,11 +142757,11 @@ function localDatabaseAnswer(schema2, store, queue, method, params) {
|
|
|
142757
142757
|
return { item: hit ? detached(hit) : null };
|
|
142758
142758
|
}
|
|
142759
142759
|
case "upsert": {
|
|
142760
|
-
const
|
|
142761
|
-
if (!
|
|
142760
|
+
const obj13 = parseJsonObject(params.object);
|
|
142761
|
+
if (!obj13 || typeof obj13.id !== "string") {
|
|
142762
142762
|
throw new Error("local_database.upsert: object with string id required");
|
|
142763
142763
|
}
|
|
142764
|
-
const row2 = detached(
|
|
142764
|
+
const row2 = detached(obj13);
|
|
142765
142765
|
const at2 = rows.findIndex((r3) => r3.id === row2.id);
|
|
142766
142766
|
const next = [...rows];
|
|
142767
142767
|
if (at2 >= 0) next[at2] = row2;
|
|
@@ -145672,19 +145672,19 @@ function logicBundleOf(descriptor) {
|
|
|
145672
145672
|
}
|
|
145673
145673
|
function collectComponentTypes(value2, into = /* @__PURE__ */ new Set()) {
|
|
145674
145674
|
if (!value2 || typeof value2 !== "object") return into;
|
|
145675
|
-
const
|
|
145676
|
-
if ((
|
|
145677
|
-
for (const child of Object.values(
|
|
145675
|
+
const obj13 = value2;
|
|
145676
|
+
if ((obj13.package === "himalaya" || obj13.package === "himalaya.core") && typeof obj13.type === "string") into.add(obj13.type);
|
|
145677
|
+
for (const child of Object.values(obj13)) collectComponentTypes(child, into);
|
|
145678
145678
|
return into;
|
|
145679
145679
|
}
|
|
145680
145680
|
function unsupportedComponentMinVersions(value2, into = []) {
|
|
145681
145681
|
if (!value2 || typeof value2 !== "object") return into;
|
|
145682
|
-
const
|
|
145683
|
-
const isComponent2 = typeof
|
|
145684
|
-
if (isComponent2 && typeof
|
|
145685
|
-
into.push({ id:
|
|
145682
|
+
const obj13 = value2;
|
|
145683
|
+
const isComponent2 = typeof obj13.id === "string" && (obj13.body !== null && typeof obj13.body === "object" || typeof obj13.package === "string" && typeof obj13.type === "string");
|
|
145684
|
+
if (isComponent2 && typeof obj13.minVersion === "number" && obj13.minVersion > SUPPORTED_COMPONENT_MIN_VERSION) {
|
|
145685
|
+
into.push({ id: obj13.id, minVersion: obj13.minVersion });
|
|
145686
145686
|
}
|
|
145687
|
-
for (const child of Object.values(
|
|
145687
|
+
for (const child of Object.values(obj13)) unsupportedComponentMinVersions(child, into);
|
|
145688
145688
|
return into;
|
|
145689
145689
|
}
|
|
145690
145690
|
function explicitMinRuntimeVersion(raw) {
|
|
@@ -145695,11 +145695,11 @@ function explicitMinRuntimeVersion(raw) {
|
|
|
145695
145695
|
}
|
|
145696
145696
|
function collectNativeComponents(value2, into) {
|
|
145697
145697
|
if (!value2 || typeof value2 !== "object") return;
|
|
145698
|
-
const
|
|
145699
|
-
const pkg = typeof
|
|
145700
|
-
const type2 = typeof
|
|
145698
|
+
const obj13 = value2;
|
|
145699
|
+
const pkg = typeof obj13.package === "string" ? obj13.package : void 0;
|
|
145700
|
+
const type2 = typeof obj13.type === "string" ? obj13.type : void 0;
|
|
145701
145701
|
if (pkg && type2 && pkg !== "himalaya" && pkg !== "himalaya.core") into.add(`${pkg}.${type2}`);
|
|
145702
|
-
for (const child of Object.values(
|
|
145702
|
+
for (const child of Object.values(obj13)) collectNativeComponents(child, into);
|
|
145703
145703
|
}
|
|
145704
145704
|
function maximumBinaryVersion(current, candidate) {
|
|
145705
145705
|
if (typeof candidate !== "string" || !/^\d+(?:\.\d+){0,3}$/.test(candidate)) return current;
|
|
@@ -148007,9 +148007,9 @@ function stateOf(view) {
|
|
|
148007
148007
|
build: b2 && view.live ? { ok: b2.ok, ms: b2.ms, screens: b2.screens, at: b2.at, run: view.live.runId } : null
|
|
148008
148008
|
};
|
|
148009
148009
|
}
|
|
148010
|
-
function frameFor(state, prev,
|
|
148011
|
-
if (key3 || !prev) return { ts:
|
|
148012
|
-
const f2 = { ts:
|
|
148010
|
+
function frameFor(state, prev, ts21, v2, key3) {
|
|
148011
|
+
if (key3 || !prev) return { ts: ts21, v: v2, key: true, ...state };
|
|
148012
|
+
const f2 = { ts: ts21, v: v2 };
|
|
148013
148013
|
if (!same2(state.step, prev.step)) f2.step = state.step;
|
|
148014
148014
|
if (!same2(state.now, prev.now)) f2.now = state.now;
|
|
148015
148015
|
const screens = {};
|
|
@@ -150356,16 +150356,16 @@ function blankComments(src) {
|
|
|
150356
150356
|
}
|
|
150357
150357
|
function parseStoreBlock(configTs) {
|
|
150358
150358
|
const text15 = blankComments(configTs);
|
|
150359
|
-
const
|
|
150360
|
-
if (
|
|
150361
|
-
if (
|
|
150359
|
+
const literal2 = [...text15.matchAll(/(?<![\w$.])store\s*:\s*(?=\{\s*["']?adopt["']?\s*:)/g)];
|
|
150360
|
+
if (literal2.length > 1) throw new Error("config.ts declares `store: { adopt }` more than once");
|
|
150361
|
+
if (literal2.length === 0) {
|
|
150362
150362
|
if (/(?<![\w$.])adopt\s*:/.test(text15) || /(?<![\w$.])store\s*:/.test(text15) && /(?<![\w$.])adopt\b/.test(text15)) {
|
|
150363
150363
|
throw new Error("config.ts mentions store.adopt but not as an inline `store: { adopt: { \u2026 } }` literal \u2014 write it inline so every tool reads the same identity");
|
|
150364
150364
|
}
|
|
150365
150365
|
return void 0;
|
|
150366
150366
|
}
|
|
150367
150367
|
const p2 = new LiteralParser(text15);
|
|
150368
|
-
p2.i =
|
|
150368
|
+
p2.i = literal2[0].index + literal2[0][0].length;
|
|
150369
150369
|
return p2.object();
|
|
150370
150370
|
}
|
|
150371
150371
|
function adoptedIdentityOfConfigTs(configTs) {
|
|
@@ -156051,14 +156051,14 @@ function compress(arr3, options, matcher, readonlyMatcher) {
|
|
|
156051
156051
|
} else if (text15 !== void 0) compressedObj[options.textNodeName] = text15;
|
|
156052
156052
|
return compressedObj;
|
|
156053
156053
|
}
|
|
156054
|
-
function propName2(
|
|
156055
|
-
const keys = Object.keys(
|
|
156054
|
+
function propName2(obj13) {
|
|
156055
|
+
const keys = Object.keys(obj13);
|
|
156056
156056
|
for (let i2 = 0; i2 < keys.length; i2++) {
|
|
156057
156057
|
const key3 = keys[i2];
|
|
156058
156058
|
if (key3 !== ":@") return key3;
|
|
156059
156059
|
}
|
|
156060
156060
|
}
|
|
156061
|
-
function assignAttributes(
|
|
156061
|
+
function assignAttributes(obj13, attrMap, readonlyMatcher, options) {
|
|
156062
156062
|
if (attrMap) {
|
|
156063
156063
|
const keys = Object.keys(attrMap);
|
|
156064
156064
|
const len = keys.length;
|
|
@@ -156067,20 +156067,20 @@ function assignAttributes(obj12, attrMap, readonlyMatcher, options) {
|
|
|
156067
156067
|
const rawAttrName = atrrName.startsWith(options.attributeNamePrefix) ? atrrName.substring(options.attributeNamePrefix.length) : atrrName;
|
|
156068
156068
|
const jPathOrMatcher = options.jPath ? readonlyMatcher.toString() + "." + rawAttrName : readonlyMatcher;
|
|
156069
156069
|
if (options.isArray(atrrName, jPathOrMatcher, true, true)) {
|
|
156070
|
-
|
|
156070
|
+
obj13[atrrName] = [attrMap[atrrName]];
|
|
156071
156071
|
} else {
|
|
156072
|
-
|
|
156072
|
+
obj13[atrrName] = attrMap[atrrName];
|
|
156073
156073
|
}
|
|
156074
156074
|
}
|
|
156075
156075
|
}
|
|
156076
156076
|
}
|
|
156077
|
-
function isLeafTag(
|
|
156077
|
+
function isLeafTag(obj13, options) {
|
|
156078
156078
|
const { textNodeName } = options;
|
|
156079
|
-
const propCount = Object.keys(
|
|
156079
|
+
const propCount = Object.keys(obj13).length;
|
|
156080
156080
|
if (propCount === 0) {
|
|
156081
156081
|
return true;
|
|
156082
156082
|
}
|
|
156083
|
-
if (propCount === 1 && (
|
|
156083
|
+
if (propCount === 1 && (obj13[textNodeName] || typeof obj13[textNodeName] === "boolean" || obj13[textNodeName] === 0)) {
|
|
156084
156084
|
return true;
|
|
156085
156085
|
}
|
|
156086
156086
|
return false;
|
|
@@ -156373,11 +156373,11 @@ function attr_to_str_raw(attrMap, options) {
|
|
|
156373
156373
|
}
|
|
156374
156374
|
return attrStr;
|
|
156375
156375
|
}
|
|
156376
|
-
function propName3(
|
|
156377
|
-
const keys = Object.keys(
|
|
156376
|
+
function propName3(obj13) {
|
|
156377
|
+
const keys = Object.keys(obj13);
|
|
156378
156378
|
for (let i2 = 0; i2 < keys.length; i2++) {
|
|
156379
156379
|
const key3 = keys[i2];
|
|
156380
|
-
if (!Object.prototype.hasOwnProperty.call(
|
|
156380
|
+
if (!Object.prototype.hasOwnProperty.call(obj13, key3)) continue;
|
|
156381
156381
|
if (key3 !== ":@") return key3;
|
|
156382
156382
|
}
|
|
156383
156383
|
}
|
|
@@ -156740,12 +156740,12 @@ var init_fxb = __esm({
|
|
|
156740
156740
|
return " " + attrName;
|
|
156741
156741
|
} else return " " + attrName + '="' + escapeAttribute2(val) + '"';
|
|
156742
156742
|
};
|
|
156743
|
-
Builder2.prototype.extractAttributes = function(
|
|
156744
|
-
if (!
|
|
156743
|
+
Builder2.prototype.extractAttributes = function(obj13) {
|
|
156744
|
+
if (!obj13 || typeof obj13 !== "object") return null;
|
|
156745
156745
|
const attrValues = {};
|
|
156746
156746
|
let hasAttrs = false;
|
|
156747
|
-
if (this.options.attributesGroupName &&
|
|
156748
|
-
const attrGroup =
|
|
156747
|
+
if (this.options.attributesGroupName && obj13[this.options.attributesGroupName]) {
|
|
156748
|
+
const attrGroup = obj13[this.options.attributesGroupName];
|
|
156749
156749
|
for (let attrKey in attrGroup) {
|
|
156750
156750
|
if (!Object.prototype.hasOwnProperty.call(attrGroup, attrKey)) continue;
|
|
156751
156751
|
const cleanKey = attrKey.startsWith(this.options.attributeNamePrefix) ? attrKey.substring(this.options.attributeNamePrefix.length) : attrKey;
|
|
@@ -156753,33 +156753,33 @@ var init_fxb = __esm({
|
|
|
156753
156753
|
hasAttrs = true;
|
|
156754
156754
|
}
|
|
156755
156755
|
} else {
|
|
156756
|
-
for (let key3 in
|
|
156757
|
-
if (!Object.prototype.hasOwnProperty.call(
|
|
156756
|
+
for (let key3 in obj13) {
|
|
156757
|
+
if (!Object.prototype.hasOwnProperty.call(obj13, key3)) continue;
|
|
156758
156758
|
const attr3 = this.isAttribute(key3);
|
|
156759
156759
|
if (attr3) {
|
|
156760
|
-
attrValues[attr3] = escapeAttribute2(
|
|
156760
|
+
attrValues[attr3] = escapeAttribute2(obj13[key3]);
|
|
156761
156761
|
hasAttrs = true;
|
|
156762
156762
|
}
|
|
156763
156763
|
}
|
|
156764
156764
|
}
|
|
156765
156765
|
return hasAttrs ? attrValues : null;
|
|
156766
156766
|
};
|
|
156767
|
-
Builder2.prototype.buildRawContent = function(
|
|
156768
|
-
if (typeof
|
|
156769
|
-
return
|
|
156767
|
+
Builder2.prototype.buildRawContent = function(obj13) {
|
|
156768
|
+
if (typeof obj13 === "string") {
|
|
156769
|
+
return obj13;
|
|
156770
156770
|
}
|
|
156771
|
-
if (typeof
|
|
156772
|
-
return String(
|
|
156771
|
+
if (typeof obj13 !== "object" || obj13 === null) {
|
|
156772
|
+
return String(obj13);
|
|
156773
156773
|
}
|
|
156774
|
-
if (
|
|
156775
|
-
return
|
|
156774
|
+
if (obj13[this.options.textNodeName] !== void 0) {
|
|
156775
|
+
return obj13[this.options.textNodeName];
|
|
156776
156776
|
}
|
|
156777
156777
|
let content = "";
|
|
156778
|
-
for (let key3 in
|
|
156779
|
-
if (!Object.prototype.hasOwnProperty.call(
|
|
156778
|
+
for (let key3 in obj13) {
|
|
156779
|
+
if (!Object.prototype.hasOwnProperty.call(obj13, key3)) continue;
|
|
156780
156780
|
if (this.isAttribute(key3)) continue;
|
|
156781
156781
|
if (this.options.attributesGroupName && key3 === this.options.attributesGroupName) continue;
|
|
156782
|
-
const value2 =
|
|
156782
|
+
const value2 = obj13[key3];
|
|
156783
156783
|
if (key3 === this.options.textNodeName) {
|
|
156784
156784
|
content += value2;
|
|
156785
156785
|
} else if (Array.isArray(value2)) {
|
|
@@ -156810,11 +156810,11 @@ var init_fxb = __esm({
|
|
|
156810
156810
|
}
|
|
156811
156811
|
return content;
|
|
156812
156812
|
};
|
|
156813
|
-
Builder2.prototype.buildAttributesForStopNode = function(
|
|
156814
|
-
if (!
|
|
156813
|
+
Builder2.prototype.buildAttributesForStopNode = function(obj13) {
|
|
156814
|
+
if (!obj13 || typeof obj13 !== "object") return "";
|
|
156815
156815
|
let attrStr = "";
|
|
156816
|
-
if (this.options.attributesGroupName &&
|
|
156817
|
-
const attrGroup =
|
|
156816
|
+
if (this.options.attributesGroupName && obj13[this.options.attributesGroupName]) {
|
|
156817
|
+
const attrGroup = obj13[this.options.attributesGroupName];
|
|
156818
156818
|
for (let attrKey in attrGroup) {
|
|
156819
156819
|
if (!Object.prototype.hasOwnProperty.call(attrGroup, attrKey)) continue;
|
|
156820
156820
|
const cleanKey = attrKey.startsWith(this.options.attributeNamePrefix) ? attrKey.substring(this.options.attributeNamePrefix.length) : attrKey;
|
|
@@ -156826,11 +156826,11 @@ var init_fxb = __esm({
|
|
|
156826
156826
|
}
|
|
156827
156827
|
}
|
|
156828
156828
|
} else {
|
|
156829
|
-
for (let key3 in
|
|
156830
|
-
if (!Object.prototype.hasOwnProperty.call(
|
|
156829
|
+
for (let key3 in obj13) {
|
|
156830
|
+
if (!Object.prototype.hasOwnProperty.call(obj13, key3)) continue;
|
|
156831
156831
|
const attr3 = this.isAttribute(key3);
|
|
156832
156832
|
if (attr3) {
|
|
156833
|
-
const val =
|
|
156833
|
+
const val = obj13[key3];
|
|
156834
156834
|
if (val === true && this.options.suppressBooleanAttributes) {
|
|
156835
156835
|
attrStr += " " + attr3;
|
|
156836
156836
|
} else {
|
|
@@ -158647,10 +158647,10 @@ function trimCapabilities(config, keptBlocks) {
|
|
|
158647
158647
|
for (const block of objectLiteralsOf(code, ["app", "navigation"])) if (block.includes("...")) return unread;
|
|
158648
158648
|
for (const m2 of code.matchAll(/\b(?:declaredCapabilities|declared_capabilities)["']?\s*:\s*/g)) {
|
|
158649
158649
|
const rest = code.slice(m2.index + m2[0].length);
|
|
158650
|
-
const
|
|
158650
|
+
const literal2 = /^(\[[^\]]*\])\s*(?=[,}])/.exec(rest)?.[1];
|
|
158651
158651
|
let ids;
|
|
158652
158652
|
try {
|
|
158653
|
-
ids =
|
|
158653
|
+
ids = literal2 ? JSON.parse(literal2) : void 0;
|
|
158654
158654
|
} catch {
|
|
158655
158655
|
ids = void 0;
|
|
158656
158656
|
}
|
|
@@ -158687,11 +158687,11 @@ function configWithoutComments(text15) {
|
|
|
158687
158687
|
}
|
|
158688
158688
|
return parts.join("") + text15.slice(end);
|
|
158689
158689
|
}
|
|
158690
|
-
function jsonString(
|
|
158690
|
+
function jsonString(literal2, what) {
|
|
158691
158691
|
try {
|
|
158692
|
-
return JSON.parse(
|
|
158692
|
+
return JSON.parse(literal2);
|
|
158693
158693
|
} catch (e2) {
|
|
158694
|
-
throw new TrimRefusal(`${what} ${
|
|
158694
|
+
throw new TrimRefusal(`${what} ${literal2} is not a valid JSON string (${e2.message}) \u2014 trim reads the shape \`himi init\` writes; fix the literal or trim by hand (\`himi docs trim-a-template\`)`);
|
|
158695
158695
|
}
|
|
158696
158696
|
}
|
|
158697
158697
|
function bracketEnd(src, open) {
|
|
@@ -159306,13 +159306,13 @@ function planTrim(src, keepIds, links) {
|
|
|
159306
159306
|
const dirs = new Set(src.workerDirs);
|
|
159307
159307
|
const removedWorkers = sorted(removedRoutes.flatMap((r3) => r3.bundles).filter((b2) => dirs.has(b2) && !keptWorkers.has(b2)));
|
|
159308
159308
|
const workerRefs = [];
|
|
159309
|
-
const
|
|
159309
|
+
const literal2 = /(["'`])([A-Za-z_][A-Za-z0-9_]*[_/]?)(?=\1|\$\{)/g;
|
|
159310
159310
|
for (const rel of Object.keys(src.workerFiles).sort()) {
|
|
159311
159311
|
const dir = rel.split("/")[1];
|
|
159312
159312
|
if (!keptWorkers.has(dir) || !dirs.has(dir)) continue;
|
|
159313
159313
|
const lines = src.workerFiles[rel].split("\n");
|
|
159314
159314
|
lines.forEach((line, i2) => {
|
|
159315
|
-
for (const m2 of line.matchAll(
|
|
159315
|
+
for (const m2 of line.matchAll(literal2)) {
|
|
159316
159316
|
const token = m2[2];
|
|
159317
159317
|
const prefix = /[_/]$/.test(token);
|
|
159318
159318
|
const route = prefix ? app.templated.find((r3) => r3.re.test(`${token}x`)) : resolveIn(app, token);
|
|
@@ -160696,9 +160696,9 @@ function unwrap(node3) {
|
|
|
160696
160696
|
}
|
|
160697
160697
|
return current;
|
|
160698
160698
|
}
|
|
160699
|
-
function lookup3(
|
|
160699
|
+
function lookup3(literal2, name) {
|
|
160700
160700
|
let found = { kind: "absent" };
|
|
160701
|
-
for (const p2 of
|
|
160701
|
+
for (const p2 of literal2.properties) {
|
|
160702
160702
|
const key3 = p2.name && (ts7.isIdentifier(p2.name) || ts7.isStringLiteral(p2.name)) ? p2.name.text : void 0;
|
|
160703
160703
|
if (ts7.isPropertyAssignment(p2) && key3 === name) found = { kind: "written", node: p2 };
|
|
160704
160704
|
else if (ts7.isSpreadAssignment(p2) || p2.name && ts7.isComputedPropertyName(p2.name) || key3 === name) found = { kind: "opaque" };
|
|
@@ -160706,22 +160706,22 @@ function lookup3(literal, name) {
|
|
|
160706
160706
|
return found;
|
|
160707
160707
|
}
|
|
160708
160708
|
function stringValue(node3, name) {
|
|
160709
|
-
const
|
|
160710
|
-
const found = ts7.isObjectLiteralExpression(
|
|
160709
|
+
const literal2 = unwrap(node3);
|
|
160710
|
+
const found = ts7.isObjectLiteralExpression(literal2) ? lookup3(literal2, name) : void 0;
|
|
160711
160711
|
const value2 = found?.kind === "written" ? found.node.initializer : void 0;
|
|
160712
160712
|
return value2 && ts7.isStringLiteralLike(value2) ? value2.text : void 0;
|
|
160713
160713
|
}
|
|
160714
|
-
function appendProperties(
|
|
160714
|
+
function appendProperties(literal2, file2, lines) {
|
|
160715
160715
|
const inline = () => lines.filter((line) => !line.trimStart().startsWith("//")).join(" ");
|
|
160716
|
-
if (
|
|
160717
|
-
const at3 =
|
|
160718
|
-
return { at: at3, end:
|
|
160716
|
+
if (literal2.properties.length === 0) {
|
|
160717
|
+
const at3 = literal2.getStart(file2) + 1;
|
|
160718
|
+
return { at: at3, end: literal2.end - 1, text: ` ${inline().replace(/,$/, "")} ` };
|
|
160719
160719
|
}
|
|
160720
|
-
const last =
|
|
160721
|
-
const trailing =
|
|
160722
|
-
const at2 = trailing ?
|
|
160720
|
+
const last = literal2.properties[literal2.properties.length - 1];
|
|
160721
|
+
const trailing = literal2.properties.hasTrailingComma;
|
|
160722
|
+
const at2 = trailing ? literal2.properties.end : last.end;
|
|
160723
160723
|
const lead = trailing ? "" : ",";
|
|
160724
|
-
if (onOneLine(
|
|
160724
|
+
if (onOneLine(literal2, file2)) {
|
|
160725
160725
|
const text15 = inline();
|
|
160726
160726
|
return { at: at2, end: at2, text: `${lead} ${trailing ? text15 : text15.replace(/,$/, "")}` };
|
|
160727
160727
|
}
|
|
@@ -160850,8 +160850,8 @@ function planPush(app, pingAppName, plan) {
|
|
|
160850
160850
|
}
|
|
160851
160851
|
}
|
|
160852
160852
|
function planRetiredFamily(block, plan) {
|
|
160853
|
-
const
|
|
160854
|
-
const found = ts8.isObjectLiteralExpression(
|
|
160853
|
+
const literal2 = unwrap(block);
|
|
160854
|
+
const found = ts8.isObjectLiteralExpression(literal2) ? lookup3(literal2, "pingAppName") : void 0;
|
|
160855
160855
|
const value2 = found?.kind === "written" ? unwrap(found.node.initializer) : void 0;
|
|
160856
160856
|
const replacement = value2 && ts8.isStringLiteralLike(value2) ? replacementPingFamily(value2.text) : void 0;
|
|
160857
160857
|
if (!value2 || !replacement) return;
|
|
@@ -162406,15 +162406,15 @@ function loadMemory2(dir) {
|
|
|
162406
162406
|
for (const t2 of m2.timeline) {
|
|
162407
162407
|
if (!isObj3(t2)) continue;
|
|
162408
162408
|
const file2 = historyName(t2.sha, t2.ext);
|
|
162409
|
-
const
|
|
162409
|
+
const ts21 = str5(t2.ts);
|
|
162410
162410
|
const id = str5(t2.id);
|
|
162411
|
-
if (file2 &&
|
|
162411
|
+
if (file2 && ts21 && id) timeline.push({ ts: ts21, id, file: file2 });
|
|
162412
162412
|
}
|
|
162413
162413
|
return { createdAt: str5(m2.createdAt), shots, timeline };
|
|
162414
162414
|
}
|
|
162415
|
-
function captionAt(entries,
|
|
162415
|
+
function captionAt(entries, ts21) {
|
|
162416
162416
|
let best = null;
|
|
162417
|
-
for (const e2 of entries) if (e2.ts <=
|
|
162417
|
+
for (const e2 of entries) if (e2.ts <= ts21) best = e2;
|
|
162418
162418
|
return best ? best.message : null;
|
|
162419
162419
|
}
|
|
162420
162420
|
function thin(items, max) {
|
|
@@ -162534,13 +162534,13 @@ function duration(ms2) {
|
|
|
162534
162534
|
const m2 = Math.round(ms2 / 6e4);
|
|
162535
162535
|
return m2 < 60 ? `${m2} min` : `${Math.floor(m2 / 60)} h ${m2 % 60} min`;
|
|
162536
162536
|
}
|
|
162537
|
-
function utcDay(
|
|
162538
|
-
const d2 = new Date(
|
|
162537
|
+
function utcDay(ts21) {
|
|
162538
|
+
const d2 = new Date(ts21);
|
|
162539
162539
|
return Number.isNaN(d2.getTime()) ? "" : `${d2.toUTCString().slice(0, 16)} (UTC)`;
|
|
162540
162540
|
}
|
|
162541
|
-
function sinceStart(start,
|
|
162541
|
+
function sinceStart(start, ts21) {
|
|
162542
162542
|
if (!start) return "";
|
|
162543
|
-
const s2 = Math.max(0, Math.round((Date.parse(
|
|
162543
|
+
const s2 = Math.max(0, Math.round((Date.parse(ts21) - Date.parse(start)) / 1e3));
|
|
162544
162544
|
const h2 = Math.floor(s2 / 3600);
|
|
162545
162545
|
const m2 = Math.floor(s2 % 3600 / 60);
|
|
162546
162546
|
const sec = String(s2 % 60).padStart(2, "0");
|
|
@@ -162550,7 +162550,7 @@ function renderReel(plan, images) {
|
|
|
162550
162550
|
const img = (f2, alt, cls = "") => f2 && images.has(f2) ? `<img class="${cls}" src="${images.get(f2)}" alt="${escapeHtml(alt)}">` : "";
|
|
162551
162551
|
const count2 = (n2) => escapeHtml(String(Number.isSafeInteger(n2) && n2 >= 0 ? n2 : 0));
|
|
162552
162552
|
const accent = ACCENT.test(plan.accent) ? plan.accent : DEFAULT_ACCENT;
|
|
162553
|
-
const clock = (
|
|
162553
|
+
const clock = (ts21) => sinceStart(plan.startedAt, ts21);
|
|
162554
162554
|
const frames = plan.frames.filter((f2) => images.has(f2.file));
|
|
162555
162555
|
const flip = frames.length ? `<section class="flip"><div class="phone">${frames.map((f2, i2) => `<img class="fr${i2 === 0 ? " on" : ""}" src="${images.get(f2.file)}" alt="${escapeHtml(plan.focusId ?? "")} at ${clock(f2.ts)}">`).join("")}</div>
|
|
162556
162556
|
<div class="flipcap"><div class="t" id="ft">${frames[0] ? clock(frames[0].ts) : ""}</div><div id="fc">${escapeHtml(frames[0]?.caption ?? "")}</div><div class="bar"><div id="fb"></div></div></div></section>` : `<p class="muted">No screen versions were recorded \u2014 open the build board with <code>himi studio</code> before building to capture them.</p>`;
|
|
@@ -166131,8 +166131,8 @@ function rotateHue(hex2, deg) {
|
|
|
166131
166131
|
return "#" + rgb.map((v2) => Math.max(0, Math.min(255, v2)).toString(16).padStart(2, "0")).join("");
|
|
166132
166132
|
}
|
|
166133
166133
|
function resolveTokensPath(app, configTs) {
|
|
166134
|
-
const
|
|
166135
|
-
if (
|
|
166134
|
+
const literal2 = /^ {2}designTokensPath\s*:\s*["']([^"']+)["']/m.exec(stripComments(configTs))?.[1];
|
|
166135
|
+
if (literal2) return { path: resolve49(appDir(app), literal2), source: "declared" };
|
|
166136
166136
|
return { path: join57(appDir(app), "tokens.json"), source: "assumed" };
|
|
166137
166137
|
}
|
|
166138
166138
|
function resolveToken(app, token, tokensPathOverride) {
|
|
@@ -167142,17 +167142,17 @@ function requireInt() {
|
|
|
167142
167142
|
construct: constructYamlInteger,
|
|
167143
167143
|
predicate: isInteger,
|
|
167144
167144
|
represent: {
|
|
167145
|
-
binary: function(
|
|
167146
|
-
return
|
|
167145
|
+
binary: function(obj13) {
|
|
167146
|
+
return obj13 >= 0 ? "0b" + obj13.toString(2) : "-0b" + obj13.toString(2).slice(1);
|
|
167147
167147
|
},
|
|
167148
|
-
octal: function(
|
|
167149
|
-
return
|
|
167148
|
+
octal: function(obj13) {
|
|
167149
|
+
return obj13 >= 0 ? "0o" + obj13.toString(8) : "-0o" + obj13.toString(8).slice(1);
|
|
167150
167150
|
},
|
|
167151
|
-
decimal: function(
|
|
167152
|
-
return
|
|
167151
|
+
decimal: function(obj13) {
|
|
167152
|
+
return obj13.toString(10);
|
|
167153
167153
|
},
|
|
167154
|
-
hexadecimal: function(
|
|
167155
|
-
return
|
|
167154
|
+
hexadecimal: function(obj13) {
|
|
167155
|
+
return obj13 >= 0 ? "0x" + obj13.toString(16).toUpperCase() : "-0x" + obj13.toString(16).toUpperCase().slice(1);
|
|
167156
167156
|
}
|
|
167157
167157
|
},
|
|
167158
167158
|
defaultStyle: "decimal",
|
|
@@ -167418,8 +167418,8 @@ function requireBinary() {
|
|
|
167418
167418
|
}
|
|
167419
167419
|
return result;
|
|
167420
167420
|
}
|
|
167421
|
-
function isBinary(
|
|
167422
|
-
return Object.prototype.toString.call(
|
|
167421
|
+
function isBinary(obj13) {
|
|
167422
|
+
return Object.prototype.toString.call(obj13) === "[object Uint8Array]";
|
|
167423
167423
|
}
|
|
167424
167424
|
binary = new Type22("tag:yaml.org,2002:binary", {
|
|
167425
167425
|
kind: "scalar",
|
|
@@ -167565,8 +167565,8 @@ function requireLoader() {
|
|
|
167565
167565
|
const PATTERN_FLOW_INDICATORS = /[,\[\]{}]/;
|
|
167566
167566
|
const PATTERN_TAG_HANDLE = /^(?:!|!!|![0-9A-Za-z-]+!)$/;
|
|
167567
167567
|
const PATTERN_TAG_URI = /^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;
|
|
167568
|
-
function _class(
|
|
167569
|
-
return Object.prototype.toString.call(
|
|
167568
|
+
function _class(obj13) {
|
|
167569
|
+
return Object.prototype.toString.call(obj13);
|
|
167570
167570
|
}
|
|
167571
167571
|
function isEol(c2) {
|
|
167572
167572
|
return c2 === 10 || c2 === 13;
|
|
@@ -172023,7 +172023,7 @@ function navPathError(raw, opts = {}) {
|
|
|
172023
172023
|
function navConfigPathErrors(config) {
|
|
172024
172024
|
const errors = [];
|
|
172025
172025
|
const list2 = (v2) => Array.isArray(v2) ? v2.flatMap((x2, i2) => x2 !== null && typeof x2 === "object" ? [[x2, i2]] : []) : [];
|
|
172026
|
-
const
|
|
172026
|
+
const obj13 = (v2) => v2 !== null && typeof v2 === "object" && !Array.isArray(v2) ? v2 : void 0;
|
|
172027
172027
|
const check = (where, raw, allowApp = true) => {
|
|
172028
172028
|
const e2 = navPathError(raw, { allowApp });
|
|
172029
172029
|
if (e2) errors.push(`${where}: ${e2}`);
|
|
@@ -172032,7 +172032,7 @@ function navConfigPathErrors(config) {
|
|
|
172032
172032
|
check(`${where}.hiddenPath`, it2.hiddenPath, false);
|
|
172033
172033
|
check(`${where}.labelPath`, it2.labelPath);
|
|
172034
172034
|
check(`${where}.iconPath`, it2.iconPath);
|
|
172035
|
-
check(`${where}.badge.valuePath`,
|
|
172035
|
+
check(`${where}.badge.valuePath`, obj13(it2.badge)?.valuePath);
|
|
172036
172036
|
if (it2.hiddenUntilResolved && !it2.hiddenPath) {
|
|
172037
172037
|
errors.push(`${where}: hiddenUntilResolved without hiddenPath can never resolve, so the item would never show`);
|
|
172038
172038
|
}
|
|
@@ -172043,30 +172043,30 @@ function navConfigPathErrors(config) {
|
|
|
172043
172043
|
check(`${where}.subtitlePath`, h2.subtitlePath);
|
|
172044
172044
|
check(`${where}.imageUrlPath`, h2.imageUrlPath);
|
|
172045
172045
|
};
|
|
172046
|
-
for (const [it2, i2] of list2(
|
|
172047
|
-
for (const [it2, i2] of list2(
|
|
172048
|
-
for (const [it2, i2] of list2(
|
|
172049
|
-
for (const [it2, i2] of list2(
|
|
172050
|
-
header("drawer.header",
|
|
172051
|
-
const sidebarHeader =
|
|
172046
|
+
for (const [it2, i2] of list2(obj13(config.tabBar)?.items)) item(`tabBar.items[${i2}] "${it2.id}"`, it2);
|
|
172047
|
+
for (const [it2, i2] of list2(obj13(config.sidebar)?.items)) item(`sidebar.items[${i2}] "${it2.id}"`, it2);
|
|
172048
|
+
for (const [it2, i2] of list2(obj13(config.drawer)?.items)) item(`drawer.items[${i2}] "${it2.id}"`, it2);
|
|
172049
|
+
for (const [it2, i2] of list2(obj13(config.topBarDefault)?.actions)) item(`topBarDefault.actions[${i2}] "${it2.id}"`, it2);
|
|
172050
|
+
header("drawer.header", obj13(obj13(config.drawer)?.header));
|
|
172051
|
+
const sidebarHeader = obj13(obj13(config.sidebar)?.header);
|
|
172052
172052
|
header("sidebar.header", sidebarHeader);
|
|
172053
172053
|
for (const key3 of ["titlePath", "subtitlePath", "imageUrlPath"]) {
|
|
172054
172054
|
if (sidebarHeader?.[key3]) {
|
|
172055
172055
|
errors.push(`sidebar.header.${key3}: sidebar header bindings are not rendered yet (#4116) \u2014 bind drawer.header, which the sidebar shows`);
|
|
172056
172056
|
}
|
|
172057
172057
|
}
|
|
172058
|
-
check("topBarLogo.imageUrlPath",
|
|
172058
|
+
check("topBarLogo.imageUrlPath", obj13(config.topBarLogo)?.imageUrlPath);
|
|
172059
172059
|
const firstOf = (v2, skip = false) => list2(v2).find(([it2]) => !skip || it2.role !== "section" && it2.role !== "note");
|
|
172060
|
-
const tabs = firstOf(
|
|
172060
|
+
const tabs = firstOf(obj13(config.tabBar)?.items);
|
|
172061
172061
|
const kind = typeof config.navKind === "string" ? config.navKind : "";
|
|
172062
|
-
const rail = kind === "drawer" ? void 0 : firstOf(
|
|
172062
|
+
const rail = kind === "drawer" ? void 0 : firstOf(obj13(config.sidebar)?.items);
|
|
172063
172063
|
const homes = [];
|
|
172064
172064
|
if (tabs && !(kind === "sidebar" && rail)) homes.push(["tabBar.items", tabs]);
|
|
172065
172065
|
if (rail && (kind === "sidebar" || kind === "responsive" || !tabs)) homes.push(["sidebar.items", rail]);
|
|
172066
172066
|
if (!tabs && !rail) {
|
|
172067
172067
|
const home = typeof config.homeScreenId === "string" && config.homeScreenId.length > 0 ? config.homeScreenId : void 0;
|
|
172068
|
-
const rows = list2(
|
|
172069
|
-
const row2 = home !== void 0 ? rows.find(([it2]) => it2.screenId === home) : firstOf(
|
|
172068
|
+
const rows = list2(obj13(config.drawer)?.items);
|
|
172069
|
+
const row2 = home !== void 0 ? rows.find(([it2]) => it2.screenId === home) : firstOf(obj13(config.drawer)?.items, true);
|
|
172070
172070
|
homes.push(["drawer.items", row2]);
|
|
172071
172071
|
}
|
|
172072
172072
|
for (const [where, first] of homes) {
|
|
@@ -178786,12 +178786,12 @@ __export(input_evidence_isolation_exports, {
|
|
|
178786
178786
|
runInputEvidenceChild: () => runInputEvidenceChild
|
|
178787
178787
|
});
|
|
178788
178788
|
async function installInputEvidenceIsolation(dir) {
|
|
178789
|
-
const { lstatSync: lstatSync30, readdirSync:
|
|
178789
|
+
const { lstatSync: lstatSync30, readdirSync: readdirSync48 } = await import("node:fs");
|
|
178790
178790
|
const { join: join144 } = await import("node:path");
|
|
178791
178791
|
const check = (path2) => {
|
|
178792
178792
|
const stat2 = lstatSync30(path2);
|
|
178793
178793
|
if (stat2.isSymbolicLink()) throw new Error("input evidence requires a content tree without symlinks");
|
|
178794
|
-
if (stat2.isDirectory()) for (const name of
|
|
178794
|
+
if (stat2.isDirectory()) for (const name of readdirSync48(path2)) check(join144(path2, name));
|
|
178795
178795
|
};
|
|
178796
178796
|
check(dir);
|
|
178797
178797
|
const { requireBuildConfinement: requireBuildConfinement2 } = await Promise.resolve().then(() => (init_build_lib(), build_lib_exports));
|
|
@@ -178860,9 +178860,9 @@ async function runInputEvidenceChild(ctx) {
|
|
|
178860
178860
|
}
|
|
178861
178861
|
}
|
|
178862
178862
|
async function inputEvidenceSourceArchiveHash(dir) {
|
|
178863
|
-
const { createHash:
|
|
178863
|
+
const { createHash: createHash61 } = await import("node:crypto");
|
|
178864
178864
|
const { collectAppSource: collectAppSource2, zipAppSource: zipAppSource2 } = await Promise.resolve().then(() => (init_app_source(), app_source_exports));
|
|
178865
|
-
return
|
|
178865
|
+
return createHash61("sha256").update(zipAppSource2(collectAppSource2(dir).entries).toString("base64")).digest("hex");
|
|
178866
178866
|
}
|
|
178867
178867
|
var init_input_evidence_isolation = __esm({
|
|
178868
178868
|
"src/input-evidence-isolation.ts"() {
|
|
@@ -180529,12 +180529,12 @@ function appObject(source) {
|
|
|
180529
180529
|
function patchConfig(configText, counters) {
|
|
180530
180530
|
const topBar = { actions: counters.map(headerBadgeAction) };
|
|
180531
180531
|
const bundle = headerBadgesBundleRef();
|
|
180532
|
-
const
|
|
180532
|
+
const literal2 = (value2, indent2) => JSON.stringify(value2, null, 2).replaceAll("\n", `
|
|
180533
180533
|
${indent2}`);
|
|
180534
180534
|
const source = ts11.createSourceFile("config.ts", configText, ts11.ScriptTarget.Latest, true, ts11.ScriptKind.TS);
|
|
180535
180535
|
const diagnostics = source.parseDiagnostics;
|
|
180536
|
-
const snippetFor = (indent2) => `${indent2}"topBarDefault": ${
|
|
180537
|
-
${indent2}"navLogicBundle": ${
|
|
180536
|
+
const snippetFor = (indent2) => `${indent2}"topBarDefault": ${literal2(topBar, indent2)},
|
|
180537
|
+
${indent2}"navLogicBundle": ${literal2(bundle, indent2)},`;
|
|
180538
180538
|
if (diagnostics.length) return { status: "manual", reason: "config.ts could not be parsed", snippet: snippetFor(" ") };
|
|
180539
180539
|
const app = appObject(source);
|
|
180540
180540
|
const navigationProperty = app && findProperty(app, "navigation");
|
|
@@ -180556,7 +180556,7 @@ ${indent2}"navLogicBundle": ${literal(bundle, indent2)},`;
|
|
|
180556
180556
|
const existingText = existingBar === void 0 ? void 0 : squash(existingBar.initializer.getText(source));
|
|
180557
180557
|
const same3 = existingBar !== void 0 && sameBundle && (existingText === squash(JSON.stringify(topBar)) || existingText === squash(JSON.stringify(inboxBar)));
|
|
180558
180558
|
if (!existingBar && sameBundle) {
|
|
180559
|
-
const barOnly = `${indent}"topBarDefault": ${
|
|
180559
|
+
const barOnly = `${indent}"topBarDefault": ${literal2(topBar, indent)},`;
|
|
180560
180560
|
const at2 = navigation.getStart(source) + 1;
|
|
180561
180561
|
return { status: "written", text: `${configText.slice(0, at2)}
|
|
180562
180562
|
${barOnly}${configText.slice(at2)}`, snippet: snippet4 };
|
|
@@ -189613,8 +189613,8 @@ var init_iap_client = __esm({
|
|
|
189613
189613
|
scrub(text15) {
|
|
189614
189614
|
const { keyId, issuerId, privateKeyPem } = this.options.key;
|
|
189615
189615
|
let out2 = text15;
|
|
189616
|
-
for (const
|
|
189617
|
-
if (
|
|
189616
|
+
for (const literal2 of [this.token?.value, privateKeyPem, issuerId, keyId]) {
|
|
189617
|
+
if (literal2) out2 = out2.split(literal2).join("[redacted]");
|
|
189618
189618
|
}
|
|
189619
189619
|
for (const shape of SECRET_SHAPES2) out2 = out2.replace(shape, "[redacted]");
|
|
189620
189620
|
return out2;
|
|
@@ -190192,39 +190192,39 @@ var init_iap_catalog_api = __esm({
|
|
|
190192
190192
|
// ../store-release/iap-manifest.ts
|
|
190193
190193
|
import { createHash as createHash44 } from "node:crypto";
|
|
190194
190194
|
function readTarget(reader, value2) {
|
|
190195
|
-
const
|
|
190195
|
+
const obj13 = reader.object(value2, "target", TARGET_KEYS);
|
|
190196
190196
|
return {
|
|
190197
|
-
himiApp: reader.text(
|
|
190198
|
-
wixSiteId: reader.text(
|
|
190199
|
-
appleAppId: reader.text(
|
|
190200
|
-
bundleId: reader.text(
|
|
190201
|
-
...
|
|
190202
|
-
...
|
|
190197
|
+
himiApp: reader.text(obj13, "himiApp", "target"),
|
|
190198
|
+
wixSiteId: reader.text(obj13, "wixSiteId", "target"),
|
|
190199
|
+
appleAppId: reader.text(obj13, "appleAppId", "target", APPLE_APP_ID),
|
|
190200
|
+
bundleId: reader.text(obj13, "bundleId", "target", BUNDLE_ID),
|
|
190201
|
+
...obj13.teamId !== void 0 ? { teamId: reader.text(obj13, "teamId", "target", TEAM_ID) } : {},
|
|
190202
|
+
...obj13.profile !== void 0 ? { profile: reader.text(obj13, "profile", "target") } : {}
|
|
190203
190203
|
};
|
|
190204
190204
|
}
|
|
190205
190205
|
function readLocalizations(reader, item, path2) {
|
|
190206
190206
|
const localizations = reader.list(item, "localizations", path2).map((value2, i2) => {
|
|
190207
190207
|
const at2 = `${path2}.localizations[${i2}]`;
|
|
190208
|
-
const
|
|
190209
|
-
const name = reader.text(
|
|
190208
|
+
const obj13 = reader.object(value2, at2, LOCALIZATION_KEYS);
|
|
190209
|
+
const name = reader.text(obj13, "name", at2);
|
|
190210
190210
|
const length = [...name].length;
|
|
190211
190211
|
const { min, max } = APPLE_LIMITS.displayName;
|
|
190212
190212
|
if (name && (length < min || length > max)) reader.problems.push(`${at2}.name must be ${min}\u2013${max} characters (got ${length})`);
|
|
190213
|
-
const description = reader.text(
|
|
190213
|
+
const description = reader.text(obj13, "description", at2);
|
|
190214
190214
|
reader.maxLength(description, `${at2}.description`, APPLE_LIMITS.description);
|
|
190215
|
-
return { locale: reader.text(
|
|
190215
|
+
return { locale: reader.text(obj13, "locale", at2, LOCALE), name, description };
|
|
190216
190216
|
});
|
|
190217
190217
|
reader.duplicates(localizations.map((l2) => l2.locale), `${path2}.localizations`, "locale");
|
|
190218
190218
|
return localizations;
|
|
190219
190219
|
}
|
|
190220
190220
|
function readPrice(reader, item, path2) {
|
|
190221
190221
|
const at2 = `${path2}.price`;
|
|
190222
|
-
const
|
|
190223
|
-
const rule =
|
|
190222
|
+
const obj13 = reader.object(item.price, at2, PRICE_KEYS);
|
|
190223
|
+
const rule = obj13.rule === void 0 ? void 0 : reader.oneOf(obj13, "rule", at2, PRICE_RULES, "exact matches Apple's price exactly; atLeast takes the next Apple price point up");
|
|
190224
190224
|
return {
|
|
190225
|
-
baseTerritory: reader.text(
|
|
190226
|
-
currency: reader.text(
|
|
190227
|
-
amount: reader.text(
|
|
190225
|
+
baseTerritory: reader.text(obj13, "baseTerritory", at2, TERRITORY),
|
|
190226
|
+
currency: reader.text(obj13, "currency", at2, CURRENCY2),
|
|
190227
|
+
amount: reader.text(obj13, "amount", at2, AMOUNT),
|
|
190228
190228
|
...rule ? { rule } : {}
|
|
190229
190229
|
};
|
|
190230
190230
|
}
|
|
@@ -190238,50 +190238,50 @@ function readTerritories(reader, item, path2, baseTerritory) {
|
|
|
190238
190238
|
return territories;
|
|
190239
190239
|
}
|
|
190240
190240
|
function readWixEntity(reader, value2, at2) {
|
|
190241
|
-
const
|
|
190242
|
-
return { entityType: reader.text(
|
|
190241
|
+
const obj13 = reader.object(value2, at2, WIX_KEYS);
|
|
190242
|
+
return { entityType: reader.text(obj13, "entityType", at2), entityId: reader.text(obj13, "entityId", at2) };
|
|
190243
190243
|
}
|
|
190244
|
-
function readUnlocks(reader,
|
|
190245
|
-
return reader.list(
|
|
190244
|
+
function readUnlocks(reader, obj13, path2) {
|
|
190245
|
+
return reader.list(obj13, "unlocks", path2).map((value2, i2) => {
|
|
190246
190246
|
const at2 = `${path2}.unlocks[${i2}]`;
|
|
190247
190247
|
const unlock = reader.object(value2, at2, UNLOCK_KEYS);
|
|
190248
190248
|
return { entityType: reader.text(unlock, "entityType", at2), entityId: reader.text(unlock, "entityId", at2), entitlement: reader.text(unlock, "entitlement", at2) };
|
|
190249
190249
|
});
|
|
190250
190250
|
}
|
|
190251
|
-
function readSubject(reader,
|
|
190252
|
-
if (
|
|
190251
|
+
function readSubject(reader, obj13, path2, type2) {
|
|
190252
|
+
if (obj13.wix === void 0 === (obj13.unlocks === void 0)) {
|
|
190253
190253
|
reader.problems.push(`${path2} must name exactly one of "wix" or "unlocks"`);
|
|
190254
190254
|
return {};
|
|
190255
190255
|
}
|
|
190256
|
-
if (
|
|
190256
|
+
if (obj13.wix !== void 0) return { wix: readWixEntity(reader, obj13.wix, `${path2}.wix`) };
|
|
190257
190257
|
if (type2 !== "consumable") reader.problems.push(`${path2}: only a consumable may carry "unlocks" \u2014 a non-consumable sells exactly one Wix item`);
|
|
190258
|
-
return { unlocks: readUnlocks(reader,
|
|
190258
|
+
return { unlocks: readUnlocks(reader, obj13, path2) };
|
|
190259
190259
|
}
|
|
190260
|
-
function limitedText(reader,
|
|
190261
|
-
const value2 = reader.text(
|
|
190260
|
+
function limitedText(reader, obj13, key3, path2, max, rule) {
|
|
190261
|
+
const value2 = reader.text(obj13, key3, path2, rule);
|
|
190262
190262
|
reader.maxLength(value2, childPath(path2, key3), max);
|
|
190263
190263
|
return value2;
|
|
190264
190264
|
}
|
|
190265
190265
|
function readItem(reader, value2, index) {
|
|
190266
190266
|
const path2 = `items[${index}]`;
|
|
190267
|
-
const
|
|
190268
|
-
const type2 = reader.oneOf(
|
|
190269
|
-
const price = readPrice(reader,
|
|
190270
|
-
const reviewNote = reader.optionalText(
|
|
190267
|
+
const obj13 = reader.object(value2, path2, ITEM_KEYS);
|
|
190268
|
+
const type2 = reader.oneOf(obj13, "type", path2, PRODUCT_TYPES, "subscriptions are not supported by this version");
|
|
190269
|
+
const price = readPrice(reader, obj13, path2);
|
|
190270
|
+
const reviewNote = reader.optionalText(obj13, "reviewNote", path2);
|
|
190271
190271
|
if (reviewNote) reader.maxLength(reviewNote, `${path2}.reviewNote`, APPLE_LIMITS.reviewNote);
|
|
190272
|
-
const reviewScreenshot =
|
|
190272
|
+
const reviewScreenshot = obj13.reviewScreenshot === void 0 ? void 0 : reader.text(obj13, "reviewScreenshot", path2, SCREENSHOT_PATH);
|
|
190273
190273
|
return {
|
|
190274
|
-
...readSubject(reader,
|
|
190275
|
-
classification: reader.literal(
|
|
190276
|
-
entitlement: reader.text(
|
|
190277
|
-
productId: limitedText(reader,
|
|
190274
|
+
...readSubject(reader, obj13, path2, type2),
|
|
190275
|
+
classification: reader.literal(obj13, "classification", path2, "digital", "physical goods and unclassified products are never registered as in-app purchases"),
|
|
190276
|
+
entitlement: reader.text(obj13, "entitlement", path2),
|
|
190277
|
+
productId: limitedText(reader, obj13, "productId", path2, APPLE_LIMITS.productId, PRODUCT_ID),
|
|
190278
190278
|
type: type2,
|
|
190279
|
-
referenceName: limitedText(reader,
|
|
190279
|
+
referenceName: limitedText(reader, obj13, "referenceName", path2, APPLE_LIMITS.referenceName),
|
|
190280
190280
|
...reviewNote === void 0 ? {} : { reviewNote },
|
|
190281
190281
|
...reviewScreenshot === void 0 ? {} : { reviewScreenshot },
|
|
190282
|
-
localizations: readLocalizations(reader,
|
|
190282
|
+
localizations: readLocalizations(reader, obj13, path2),
|
|
190283
190283
|
price,
|
|
190284
|
-
territories: readTerritories(reader,
|
|
190284
|
+
territories: readTerritories(reader, obj13, path2, price.baseTerritory)
|
|
190285
190285
|
};
|
|
190286
190286
|
}
|
|
190287
190287
|
function wixEntitiesOf(item) {
|
|
@@ -190317,10 +190317,10 @@ function parseJson3(text15, label3) {
|
|
|
190317
190317
|
function parseIapManifest(text15, label3) {
|
|
190318
190318
|
const doc = parseJson3(text15, label3);
|
|
190319
190319
|
const reader = new ManifestReader();
|
|
190320
|
-
const
|
|
190321
|
-
if (
|
|
190322
|
-
const target = readTarget(reader,
|
|
190323
|
-
const items = reader.list(
|
|
190320
|
+
const obj13 = reader.object(doc, "", MANIFEST_KEYS);
|
|
190321
|
+
if (obj13.manifestVersion !== 1) reader.problems.push("manifestVersion must be 1");
|
|
190322
|
+
const target = readTarget(reader, obj13.target);
|
|
190323
|
+
const items = reader.list(obj13, "items", "").map((item, i2) => readItem(reader, item, i2));
|
|
190324
190324
|
reportDuplicateMappings(reader, items);
|
|
190325
190325
|
reportCredentialMaterial(reader, doc, "");
|
|
190326
190326
|
if (reader.problems.length) throw new IapManifestError(label3, reader.problems);
|
|
@@ -190329,8 +190329,8 @@ function parseIapManifest(text15, label3) {
|
|
|
190329
190329
|
function sortKeys(value2) {
|
|
190330
190330
|
if (Array.isArray(value2)) return value2.map(sortKeys);
|
|
190331
190331
|
if (!value2 || typeof value2 !== "object") return value2;
|
|
190332
|
-
const
|
|
190333
|
-
return Object.fromEntries(Object.keys(
|
|
190332
|
+
const obj13 = value2;
|
|
190333
|
+
return Object.fromEntries(Object.keys(obj13).sort().map((key3) => [key3, sortKeys(obj13[key3])]));
|
|
190334
190334
|
}
|
|
190335
190335
|
function canonicalJson3(value2) {
|
|
190336
190336
|
return JSON.stringify(sortKeys(value2));
|
|
@@ -190403,8 +190403,8 @@ var init_iap_manifest = __esm({
|
|
|
190403
190403
|
}
|
|
190404
190404
|
return value2;
|
|
190405
190405
|
}
|
|
190406
|
-
text(
|
|
190407
|
-
return this.textValue(
|
|
190406
|
+
text(obj13, key3, path2, rule) {
|
|
190407
|
+
return this.textValue(obj13[key3], childPath(path2, key3), rule);
|
|
190408
190408
|
}
|
|
190409
190409
|
textValue(value2, at2, rule) {
|
|
190410
190410
|
if (typeof value2 !== "string" || !value2.trim()) {
|
|
@@ -190414,23 +190414,23 @@ var init_iap_manifest = __esm({
|
|
|
190414
190414
|
if (rule && !rule.pattern.test(value2)) this.problems.push(`${at2} must be ${rule.hint} (got ${JSON.stringify(value2)})`);
|
|
190415
190415
|
return value2;
|
|
190416
190416
|
}
|
|
190417
|
-
optionalText(
|
|
190418
|
-
return
|
|
190417
|
+
optionalText(obj13, key3, path2) {
|
|
190418
|
+
return obj13[key3] === void 0 ? void 0 : this.text(obj13, key3, path2);
|
|
190419
190419
|
}
|
|
190420
|
-
list(
|
|
190421
|
-
const value2 =
|
|
190420
|
+
list(obj13, key3, path2) {
|
|
190421
|
+
const value2 = obj13[key3];
|
|
190422
190422
|
if (!Array.isArray(value2) || value2.length === 0) {
|
|
190423
190423
|
this.problems.push(`${childPath(path2, key3)} must be a non-empty list`);
|
|
190424
190424
|
return [];
|
|
190425
190425
|
}
|
|
190426
190426
|
return value2;
|
|
190427
190427
|
}
|
|
190428
|
-
literal(
|
|
190429
|
-
if (
|
|
190428
|
+
literal(obj13, key3, path2, expected, why) {
|
|
190429
|
+
if (obj13[key3] !== expected) this.problems.push(`${childPath(path2, key3)} must be ${JSON.stringify(expected)} \u2014 ${why}`);
|
|
190430
190430
|
return expected;
|
|
190431
190431
|
}
|
|
190432
|
-
oneOf(
|
|
190433
|
-
const value2 =
|
|
190432
|
+
oneOf(obj13, key3, path2, allowed2, why) {
|
|
190433
|
+
const value2 = obj13[key3];
|
|
190434
190434
|
if (allowed2.includes(value2)) return value2;
|
|
190435
190435
|
this.problems.push(`${childPath(path2, key3)} must be ${allowed2.map((a2) => JSON.stringify(a2)).join(" or ")} \u2014 ${why}`);
|
|
190436
190436
|
return allowed2[0];
|
|
@@ -192148,10 +192148,10 @@ function bundleFinding(app, { bundleId, storeBundleId }, fileName) {
|
|
|
192148
192148
|
function bindingFinding(app, file2, purchasesAppId, wanted, fileName) {
|
|
192149
192149
|
const wixIap = lookup3(app, "wixIap");
|
|
192150
192150
|
if (wixIap.kind === "absent") return { splice: appendProperties(app, file2, [`${wanted},`]), applied: "wixIap.purchasesAppId" };
|
|
192151
|
-
const
|
|
192152
|
-
if (!
|
|
192153
|
-
const current = lookup3(
|
|
192154
|
-
if (current.kind === "absent") return { splice: appendProperties(
|
|
192151
|
+
const literal2 = wixIap.kind === "written" ? unwrap(wixIap.node.initializer) : void 0;
|
|
192152
|
+
if (!literal2 || !ts15.isObjectLiteralExpression(literal2)) return { instruction: `${fileName} computes wixIap, so it was not edited: it must evaluate to ${wanted}.` };
|
|
192153
|
+
const current = lookup3(literal2, "purchasesAppId");
|
|
192154
|
+
if (current.kind === "absent") return { splice: appendProperties(literal2, file2, [`purchasesAppId: ${JSON.stringify(purchasesAppId)},`]), applied: "wixIap.purchasesAppId" };
|
|
192155
192155
|
const value2 = current.kind === "written" ? unwrap(current.node.initializer) : void 0;
|
|
192156
192156
|
if (!value2 || !ts15.isStringLiteralLike(value2)) return { instruction: `${fileName} computes wixIap.purchasesAppId, so it was not edited: it must evaluate to ${JSON.stringify(purchasesAppId)}.` };
|
|
192157
192157
|
if (value2.text === purchasesAppId) return {};
|
|
@@ -200772,20 +200772,20 @@ function fromJSON(str13) {
|
|
|
200772
200772
|
if (!str13 || isEmptyString(str13)) {
|
|
200773
200773
|
return void 0;
|
|
200774
200774
|
}
|
|
200775
|
-
let
|
|
200775
|
+
let obj13;
|
|
200776
200776
|
if (typeof str13 === "string") {
|
|
200777
200777
|
try {
|
|
200778
|
-
|
|
200778
|
+
obj13 = JSON.parse(str13);
|
|
200779
200779
|
} catch {
|
|
200780
200780
|
return void 0;
|
|
200781
200781
|
}
|
|
200782
200782
|
} else {
|
|
200783
|
-
|
|
200783
|
+
obj13 = str13;
|
|
200784
200784
|
}
|
|
200785
200785
|
const c2 = new Cookie();
|
|
200786
200786
|
Cookie.serializableProperties.forEach((prop2) => {
|
|
200787
|
-
if (
|
|
200788
|
-
const val =
|
|
200787
|
+
if (obj13 && typeof obj13 === "object" && inOperator(prop2, obj13)) {
|
|
200788
|
+
const val = obj13[prop2];
|
|
200789
200789
|
if (val === void 0) {
|
|
200790
200790
|
return;
|
|
200791
200791
|
}
|
|
@@ -200804,7 +200804,7 @@ function fromJSON(str13) {
|
|
|
200804
200804
|
case "creation":
|
|
200805
200805
|
case "lastAccessed":
|
|
200806
200806
|
if (typeof val === "number" || typeof val === "string" || val instanceof Date) {
|
|
200807
|
-
c2[prop2] =
|
|
200807
|
+
c2[prop2] = obj13[prop2] == "Infinity" ? "Infinity" : new Date(val);
|
|
200808
200808
|
} else if (val === null) {
|
|
200809
200809
|
c2[prop2] = null;
|
|
200810
200810
|
}
|
|
@@ -201062,7 +201062,7 @@ var init_dist = __esm({
|
|
|
201062
201062
|
);
|
|
201063
201063
|
}
|
|
201064
201064
|
};
|
|
201065
|
-
objectToString = (
|
|
201065
|
+
objectToString = (obj13) => Object.prototype.toString.call(obj13);
|
|
201066
201066
|
safeArrayToString = (arr3, seenArrays) => {
|
|
201067
201067
|
if (typeof arr3.join !== "function") return objectToString(arr3);
|
|
201068
201068
|
seenArrays.add(arr3);
|
|
@@ -201354,7 +201354,7 @@ var init_dist = __esm({
|
|
|
201354
201354
|
* If you want a property to be serialized, add the property name to {@link Cookie.serializableProperties}.
|
|
201355
201355
|
*/
|
|
201356
201356
|
toJSON() {
|
|
201357
|
-
const
|
|
201357
|
+
const obj13 = {};
|
|
201358
201358
|
for (const prop2 of _Cookie2.serializableProperties) {
|
|
201359
201359
|
const val = this[prop2];
|
|
201360
201360
|
if (val === cookieDefaults[prop2]) {
|
|
@@ -201365,49 +201365,49 @@ var init_dist = __esm({
|
|
|
201365
201365
|
case "value":
|
|
201366
201366
|
case "sameSite":
|
|
201367
201367
|
if (typeof val === "string") {
|
|
201368
|
-
|
|
201368
|
+
obj13[prop2] = val;
|
|
201369
201369
|
}
|
|
201370
201370
|
break;
|
|
201371
201371
|
case "expires":
|
|
201372
201372
|
case "creation":
|
|
201373
201373
|
case "lastAccessed":
|
|
201374
201374
|
if (typeof val === "number" || typeof val === "string" || val instanceof Date) {
|
|
201375
|
-
|
|
201375
|
+
obj13[prop2] = val == "Infinity" ? "Infinity" : new Date(val).toISOString();
|
|
201376
201376
|
} else if (val === null) {
|
|
201377
|
-
|
|
201377
|
+
obj13[prop2] = null;
|
|
201378
201378
|
}
|
|
201379
201379
|
break;
|
|
201380
201380
|
case "maxAge":
|
|
201381
201381
|
if (typeof val === "number" || val === "Infinity" || val === "-Infinity") {
|
|
201382
|
-
|
|
201382
|
+
obj13[prop2] = val;
|
|
201383
201383
|
}
|
|
201384
201384
|
break;
|
|
201385
201385
|
case "domain":
|
|
201386
201386
|
case "path":
|
|
201387
201387
|
if (typeof val === "string" || val === null) {
|
|
201388
|
-
|
|
201388
|
+
obj13[prop2] = val;
|
|
201389
201389
|
}
|
|
201390
201390
|
break;
|
|
201391
201391
|
case "secure":
|
|
201392
201392
|
case "httpOnly":
|
|
201393
201393
|
if (typeof val === "boolean") {
|
|
201394
|
-
|
|
201394
|
+
obj13[prop2] = val;
|
|
201395
201395
|
}
|
|
201396
201396
|
break;
|
|
201397
201397
|
case "extensions":
|
|
201398
201398
|
if (Array.isArray(val)) {
|
|
201399
|
-
|
|
201399
|
+
obj13[prop2] = val;
|
|
201400
201400
|
}
|
|
201401
201401
|
break;
|
|
201402
201402
|
case "hostOnly":
|
|
201403
201403
|
case "pathIsDefault":
|
|
201404
201404
|
if (typeof val === "boolean" || val === null) {
|
|
201405
|
-
|
|
201405
|
+
obj13[prop2] = val;
|
|
201406
201406
|
}
|
|
201407
201407
|
break;
|
|
201408
201408
|
}
|
|
201409
201409
|
}
|
|
201410
|
-
return
|
|
201410
|
+
return obj13;
|
|
201411
201411
|
}
|
|
201412
201412
|
/**
|
|
201413
201413
|
* Does a deep clone of this cookie, implemented exactly as `Cookie.fromJSON(cookie.toJSON())`.
|
|
@@ -204421,17 +204421,17 @@ var init_collect = __esm({
|
|
|
204421
204421
|
|
|
204422
204422
|
// src/one-app/invite-plan.ts
|
|
204423
204423
|
function planInvites(raw, metaSiteId) {
|
|
204424
|
-
const
|
|
204424
|
+
const obj13 = (v2) => v2 && typeof v2 === "object" && !Array.isArray(v2) ? v2 : {};
|
|
204425
204425
|
const part4 = (v2) => v2.replaceAll("~", "~0").replaceAll("/", "~1");
|
|
204426
|
-
const headers2 =
|
|
204426
|
+
const headers2 = obj13(raw.headers);
|
|
204427
204427
|
return {
|
|
204428
204428
|
schemaVersion: 1,
|
|
204429
204429
|
recipe: "@wix/himalaya/screens",
|
|
204430
204430
|
declaredCapabilities: ["share", "wix_api", "app_info"],
|
|
204431
|
-
screens: Object.entries(
|
|
204432
|
-
const headerId =
|
|
204431
|
+
screens: Object.entries(obj13(raw.screens)).flatMap(([screenId, value2]) => {
|
|
204432
|
+
const headerId = obj13(value2).headerId;
|
|
204433
204433
|
if (typeof headerId !== "string") return [];
|
|
204434
|
-
const settings =
|
|
204434
|
+
const settings = obj13(obj13(headers2[headerId]).settings);
|
|
204435
204435
|
if (typeof settings.showInviteButton !== "boolean") return [];
|
|
204436
204436
|
return [{
|
|
204437
204437
|
screenId,
|
|
@@ -204826,7 +204826,7 @@ function generateScreens(input) {
|
|
|
204826
204826
|
let screenId2 = [...verticals][0];
|
|
204827
204827
|
const present = input.takenScreenIds;
|
|
204828
204828
|
const fallback = TEMPLATE_FALLBACKS[screenId2];
|
|
204829
|
-
if (present &&
|
|
204829
|
+
if (present && !present.has(screenId2)) {
|
|
204830
204830
|
if (fallback && present.has(fallback)) {
|
|
204831
204831
|
out2.gaps.push({ page: label3, sectionId: str11(elements[0].elementId), sectionDefinitionId: type2, reason: `this scaffold has no ${screenId2} screen; the page opens the template's ${fallback} instead, with its own title and layout` });
|
|
204832
204832
|
out2.routes.push({ layoutItemId, label: label3, screenId: fallback, kind: "template" });
|
|
@@ -204894,7 +204894,9 @@ function generateScreens(input) {
|
|
|
204894
204894
|
}
|
|
204895
204895
|
const empty2 = built === null || Array.isArray(built) && built.length === 0;
|
|
204896
204896
|
const fallback = FALLBACK_TARGETS[type2];
|
|
204897
|
-
|
|
204897
|
+
const scaffold = input.takenScreenIds;
|
|
204898
|
+
const linkable = !fallback?.needsScreen || !scaffold || scaffold.has(fallback.screen);
|
|
204899
|
+
if (empty2 && unmapped.length > reported && fallback && linkable) {
|
|
204898
204900
|
const reasons = unmapped.splice(reported).map((u2) => u2.reason);
|
|
204899
204901
|
uses.length = registered;
|
|
204900
204902
|
extras.length = extra;
|
|
@@ -205002,7 +205004,8 @@ var init_generate2 = __esm({
|
|
|
205002
205004
|
events_list_section: { sibling: "events_list_section", screen: "himi_events" },
|
|
205003
205005
|
newBlog_postlist_vertical_section: { screen: "himi_blog" },
|
|
205004
205006
|
newBlog_compact_post_list_vertical_section: { screen: "himi_blog" },
|
|
205005
|
-
member_list_section: { sibling: "member_list_section", screen: "himi_members" }
|
|
205007
|
+
member_list_section: { sibling: "member_list_section", screen: "himi_members" },
|
|
205008
|
+
bookings_services_list_section: { screen: "himi_services", needsScreen: true }
|
|
205006
205009
|
};
|
|
205007
205010
|
ROUTE_PLACEHOLDER = "@route:";
|
|
205008
205011
|
BOTTOM_TABS_BEFORE_MORE = 4;
|
|
@@ -205011,7 +205014,8 @@ var init_generate2 = __esm({
|
|
|
205011
205014
|
groups_feed_section: "himi_groups_feed",
|
|
205012
205015
|
loyalty_status_section: "himi_loyalty",
|
|
205013
205016
|
loyalty_offering_section: "himi_loyalty",
|
|
205014
|
-
stores_products_grid_section: "himi_shop"
|
|
205017
|
+
stores_products_grid_section: "himi_shop",
|
|
205018
|
+
bookings_services_list_section: "himi_services"
|
|
205015
205019
|
};
|
|
205016
205020
|
TEMPLATE_FALLBACKS = { himi_groups_feed: "himi_groups" };
|
|
205017
205021
|
MODULES = {
|
|
@@ -205114,6 +205118,9 @@ var init_generate2 = __esm({
|
|
|
205114
205118
|
if (placement?.state === "ready" && placement.component) return vstack(`${id}.box`, [placement.component], 0, inset(8, 8));
|
|
205115
205119
|
return ctx.unsupported(elementId, "pages_section", placement ? `its Pages document is not ready in pages-content.json (state "${str11(placement.state)}")` : "its Pages document is not in pages-content.json: re-run `himi one-app migrate` to collect it");
|
|
205116
205120
|
},
|
|
205121
|
+
// The services list is the template's own screen (search, category chips, location pin, course dates, Ended): it has no inline
|
|
205122
|
+
// form, so beside generated sections it keeps its place as its title and a See All link to that screen.
|
|
205123
|
+
bookings_services_list_section: (_id, _s2, _st, _index, ctx, sectionId) => ctx.unsupported(sectionId, "bookings_services_list_section", "the services list is the template's himi_services screen and has no inline form"),
|
|
205117
205124
|
// The programs carousel: the shared programs module in carousel layout, configured from the section's own settings.
|
|
205118
205125
|
achievements_carousel_section: (id, s2, st2, index, ctx) => {
|
|
205119
205126
|
const sorting = obj6(st2.sortingSettings);
|
|
@@ -205233,14 +205240,14 @@ function ricosTexts(documentJson) {
|
|
|
205233
205240
|
function literalSlugFindings(slug, displayName3, screens, authoredText = []) {
|
|
205234
205241
|
if (slug.toLowerCase() === displayName3.trim().toLowerCase()) return [];
|
|
205235
205242
|
const escaped = slug.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
205236
|
-
const
|
|
205243
|
+
const literal2 = new RegExp(`(^|[^\\p{L}\\p{N}_@/.-])${escaped}(?![\\p{L}\\p{N}_@/-]|\\.[\\p{L}\\p{N}])`, "iu");
|
|
205237
205244
|
const name = displayName3.trim().replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
205238
205245
|
const businessName = new RegExp(`(^|[^\\p{L}\\p{N}_-])${name}(?![\\p{L}\\p{N}_-])`, "giu");
|
|
205239
205246
|
const findings = [];
|
|
205240
205247
|
const authored2 = new Set(authoredText);
|
|
205241
205248
|
for (const { screenId, descriptor } of screens) {
|
|
205242
205249
|
const check = (value2, path2, allowAuthored = screenId !== "himi_business_chat") => {
|
|
205243
|
-
if (typeof value2 === "string" && !(allowAuthored && authored2.has(value2)) && !value2.startsWith("$service:") && !value2.startsWith("$item.") &&
|
|
205250
|
+
if (typeof value2 === "string" && !(allowAuthored && authored2.has(value2)) && !value2.startsWith("$service:") && !value2.startsWith("$item.") && literal2.test(value2.replace(businessName, "$1"))) {
|
|
205244
205251
|
findings.push({ screenId, path: path2, value: value2 });
|
|
205245
205252
|
}
|
|
205246
205253
|
};
|
|
@@ -205285,10 +205292,10 @@ function appNameLiteral(configSource) {
|
|
|
205285
205292
|
return found;
|
|
205286
205293
|
}
|
|
205287
205294
|
function fixAppName(configSource, slug, displayName3) {
|
|
205288
|
-
const
|
|
205289
|
-
if (!
|
|
205295
|
+
const literal2 = appNameLiteral(configSource);
|
|
205296
|
+
if (!literal2 || literal2.value.toLowerCase() !== slug.toLowerCase() || literal2.value === displayName3.trim()) return void 0;
|
|
205290
205297
|
if (slug.toLowerCase() === displayName3.trim().toLowerCase()) return void 0;
|
|
205291
|
-
return { current:
|
|
205298
|
+
return { current: literal2.value, fixed: configSource.slice(0, literal2.start) + JSON.stringify(displayName3.trim()) + configSource.slice(literal2.end) };
|
|
205292
205299
|
}
|
|
205293
205300
|
function sourceIdentity(evidenceDir) {
|
|
205294
205301
|
const { manifest: manifest2, raw } = verifiedEvidence(evidenceDir);
|
|
@@ -205418,32 +205425,123 @@ var init_validate_identity = __esm({
|
|
|
205418
205425
|
}
|
|
205419
205426
|
});
|
|
205420
205427
|
|
|
205428
|
+
// src/one-app/invite-drawer.ts
|
|
205429
|
+
import { createHash as createHash57 } from "node:crypto";
|
|
205430
|
+
import ts17 from "typescript";
|
|
205431
|
+
function sourceShowsInvite(plan) {
|
|
205432
|
+
const screens = obj8(plan).screens;
|
|
205433
|
+
return Array.isArray(screens) && screens.some((screen) => obj8(obj8(screen).metadata).showInviteButton === true);
|
|
205434
|
+
}
|
|
205435
|
+
function rowText(indent) {
|
|
205436
|
+
const props2 = [
|
|
205437
|
+
["id", INVITE_DRAWER_ID],
|
|
205438
|
+
["screenId", INVITE_SCREEN],
|
|
205439
|
+
["label", INVITE_LABEL],
|
|
205440
|
+
["icon", INVITE_ACTION.icon],
|
|
205441
|
+
["hiddenPath", INVITE_ACTION.hiddenPath],
|
|
205442
|
+
["hiddenUntilResolved", true]
|
|
205443
|
+
];
|
|
205444
|
+
return `{
|
|
205445
|
+
${props2.map(([key3, value2]) => `${indent} ${JSON.stringify(key3)}: ${JSON.stringify(value2)}`).join(",\n")}
|
|
205446
|
+
${indent}}`;
|
|
205447
|
+
}
|
|
205448
|
+
function applyInviteDrawer(configText, showsInvite) {
|
|
205449
|
+
const unchanged = (status, reason) => ({ status, ...reason ? { reason } : {}, text: configText });
|
|
205450
|
+
if (!showsInvite) return unchanged("unchanged", "the source header does not show the Invite button");
|
|
205451
|
+
const file2 = ts17.createSourceFile("config.ts", configText, ts17.ScriptTarget.Latest, true, ts17.ScriptKind.TS);
|
|
205452
|
+
const app = appObject(file2);
|
|
205453
|
+
const navigationValue = app && findProperty(app, "navigation")?.initializer;
|
|
205454
|
+
if (!navigationValue || !ts17.isObjectLiteralExpression(navigationValue)) return unchanged("manual", "config.ts has no literal `navigation: {...}` in its defineApp call");
|
|
205455
|
+
const drawerValue = findProperty(navigationValue, "drawer")?.initializer;
|
|
205456
|
+
const itemsValue = drawerValue && ts17.isObjectLiteralExpression(drawerValue) ? findProperty(drawerValue, "items")?.initializer : void 0;
|
|
205457
|
+
if (!itemsValue) return unchanged("absent", "the app has no side menu (navigation.drawer.items), so there is nowhere to add Invite");
|
|
205458
|
+
if (!ts17.isArrayLiteralExpression(itemsValue)) return unchanged("manual", "navigation.drawer.items is not an array literal, so a row cannot be added safely");
|
|
205459
|
+
const rows = itemsValue.elements.filter(ts17.isObjectLiteralExpression);
|
|
205460
|
+
const hasRow = rows.some((row2) => literal(findProperty(row2, "id")?.initializer) === INVITE_DRAWER_ID || literal(findProperty(row2, "screenId")?.initializer) === INVITE_SCREEN);
|
|
205461
|
+
if (hasRow) return { ...unchanged("unchanged", "the side menu already has an Invite row"), rowPresent: true };
|
|
205462
|
+
const linkValue = findProperty(navigationValue, "linkableScreens")?.initializer;
|
|
205463
|
+
const linked = linkValue && ts17.isArrayLiteralExpression(linkValue) && linkValue.elements.some((item) => ts17.isObjectLiteralExpression(item) && literal(findProperty(item, "screenId")?.initializer) === INVITE_SCREEN);
|
|
205464
|
+
if (!linked) {
|
|
205465
|
+
return unchanged("absent", `the source shows Invite, but config.ts does not declare ${INVITE_SCREEN} in navigation.linkableScreens: build the Invite flow first (himi docs one-app-to-himi-app, "Invite is behavior"), then provision again`);
|
|
205466
|
+
}
|
|
205467
|
+
const elements = itemsValue.elements;
|
|
205468
|
+
const firstSection = elements.findIndex((item) => ts17.isObjectLiteralExpression(item) && literal(findProperty(item, "role")?.initializer) === "section");
|
|
205469
|
+
const before = firstSection === -1 ? elements.length - 1 : firstSection - 1;
|
|
205470
|
+
const destination = elements.slice(0, before + 1).some((item) => ts17.isObjectLiteralExpression(item) && !!literal(findProperty(item, "screenId")?.initializer) && !["section", "note"].includes(literal(findProperty(item, "role")?.initializer) ?? ""));
|
|
205471
|
+
if (!destination) return unchanged("absent", "the side menu has no destination before where Invite would go, and Invite must not become the app's home screen");
|
|
205472
|
+
const anchor = elements[before];
|
|
205473
|
+
const indent = " ".repeat(file2.getLineAndCharacterOfPosition(anchor.getStart()).character);
|
|
205474
|
+
const trailing = before === elements.length - 1 && elements.hasTrailingComma;
|
|
205475
|
+
const at2 = trailing ? configText.indexOf(",", anchor.getEnd()) + 1 : anchor.getEnd();
|
|
205476
|
+
const insertion = trailing ? `
|
|
205477
|
+
${indent}${rowText(indent)},` : `,
|
|
205478
|
+
${indent}${rowText(indent)}`;
|
|
205479
|
+
const text15 = `${configText.slice(0, at2)}${insertion}${configText.slice(at2)}`;
|
|
205480
|
+
return { status: "set", rowPresent: true, text: text15 };
|
|
205481
|
+
}
|
|
205482
|
+
function withInviteTranslation(catalogText, locale) {
|
|
205483
|
+
const translation = INVITE_TRANSLATIONS[locale];
|
|
205484
|
+
if (!translation) return void 0;
|
|
205485
|
+
let catalog4;
|
|
205486
|
+
try {
|
|
205487
|
+
catalog4 = obj8(JSON.parse(catalogText));
|
|
205488
|
+
} catch {
|
|
205489
|
+
return void 0;
|
|
205490
|
+
}
|
|
205491
|
+
const messages = obj8(catalog4.messages);
|
|
205492
|
+
if (!("messages" in catalog4)) return void 0;
|
|
205493
|
+
const existing = Object.values(messages).map(obj8).find((row2) => row2.source === INVITE_LABEL);
|
|
205494
|
+
if (existing && typeof existing.translation === "string" && existing.translation.trim()) return void 0;
|
|
205495
|
+
if (existing) {
|
|
205496
|
+
existing.translation = translation;
|
|
205497
|
+
if (typeof existing.key !== "string" || !existing.key) existing.key = "tab.invite";
|
|
205498
|
+
} else {
|
|
205499
|
+
messages[`h_${createHash57("sha1").update(INVITE_LABEL).digest("hex").slice(0, 12)}`] = { source: INVITE_LABEL, key: "tab.invite", translation };
|
|
205500
|
+
}
|
|
205501
|
+
return `${JSON.stringify({ ...catalog4, messages }, null, 2)}
|
|
205502
|
+
`;
|
|
205503
|
+
}
|
|
205504
|
+
var INVITE_SCREEN, INVITE_DRAWER_ID, INVITE_ACTION, INVITE_LABEL, obj8, literal, INVITE_TRANSLATIONS;
|
|
205505
|
+
var init_invite_drawer = __esm({
|
|
205506
|
+
"src/one-app/invite-drawer.ts"() {
|
|
205507
|
+
init_define_HHP_CATALOG();
|
|
205508
|
+
init_header_badges();
|
|
205509
|
+
INVITE_SCREEN = "source_invite";
|
|
205510
|
+
INVITE_DRAWER_ID = "drawer_invite";
|
|
205511
|
+
INVITE_ACTION = { icon: "share", hiddenPath: "$service:invite.hidden" };
|
|
205512
|
+
INVITE_LABEL = "Invite";
|
|
205513
|
+
obj8 = (v2) => v2 && typeof v2 === "object" && !Array.isArray(v2) ? v2 : {};
|
|
205514
|
+
literal = (node3) => node3 && ts17.isStringLiteralLike(node3) ? node3.text : void 0;
|
|
205515
|
+
INVITE_TRANSLATIONS = { he: "\u05D4\u05D6\u05DE\u05E0\u05EA \u05D7\u05D1\u05E8\u05D9\u05DD" };
|
|
205516
|
+
}
|
|
205517
|
+
});
|
|
205518
|
+
|
|
205421
205519
|
// src/one-app/provision.ts
|
|
205422
|
-
import { existsSync as existsSync121, readFileSync as readFileSync140, writeFileSync as writeFileSync56 } from "node:fs";
|
|
205520
|
+
import { existsSync as existsSync121, readdirSync as readdirSync47, readFileSync as readFileSync140, writeFileSync as writeFileSync56 } from "node:fs";
|
|
205423
205521
|
import { join as join130, resolve as resolve89 } from "node:path";
|
|
205424
|
-
import
|
|
205522
|
+
import ts18 from "typescript";
|
|
205425
205523
|
function rootOnAppear2(descriptor) {
|
|
205426
|
-
const modifiers =
|
|
205524
|
+
const modifiers = obj9(obj9(descriptor.payload).modifiers);
|
|
205427
205525
|
const appear = modifiers.onAppear;
|
|
205428
205526
|
return appear && typeof appear === "object" && !Array.isArray(appear) ? appear : void 0;
|
|
205429
205527
|
}
|
|
205430
205528
|
function nativeTabBar(configSource) {
|
|
205431
|
-
const file2 =
|
|
205529
|
+
const file2 = ts18.createSourceFile("config.ts", configSource, ts18.ScriptTarget.Latest, true, ts18.ScriptKind.TS);
|
|
205432
205530
|
let tabBar;
|
|
205433
205531
|
const visit = (node3) => {
|
|
205434
205532
|
if (tabBar) return;
|
|
205435
|
-
if (
|
|
205436
|
-
const navigation = node3.arguments[0] &&
|
|
205437
|
-
const bar = navigation &&
|
|
205438
|
-
if (bar &&
|
|
205533
|
+
if (ts18.isCallExpression(node3) && ts18.isIdentifier(node3.expression) && node3.expression.text === "defineApp") {
|
|
205534
|
+
const navigation = node3.arguments[0] && ts18.isObjectLiteralExpression(node3.arguments[0]) ? propOf(node3.arguments[0], "navigation")?.initializer : void 0;
|
|
205535
|
+
const bar = navigation && ts18.isObjectLiteralExpression(navigation) ? propOf(navigation, "tabBar")?.initializer : void 0;
|
|
205536
|
+
if (bar && ts18.isObjectLiteralExpression(bar)) tabBar = bar;
|
|
205439
205537
|
return;
|
|
205440
205538
|
}
|
|
205441
|
-
|
|
205539
|
+
ts18.forEachChild(node3, visit);
|
|
205442
205540
|
};
|
|
205443
205541
|
visit(file2);
|
|
205444
205542
|
if (!tabBar) return void 0;
|
|
205445
205543
|
const current = propOf(tabBar, "presentation")?.initializer;
|
|
205446
|
-
if (current &&
|
|
205544
|
+
if (current && ts18.isStringLiteralLike(current) && current.text.trim()) return { presentation: current.text };
|
|
205447
205545
|
if (current || !tabBar.properties[0]) return void 0;
|
|
205448
205546
|
const indent = file2.getLineAndCharacterOfPosition(tabBar.properties[0].getStart(file2)).character;
|
|
205449
205547
|
const at2 = tabBar.getStart(file2) + 1;
|
|
@@ -205465,29 +205563,29 @@ function provisionSiteBinding(dir, binding2, dryRun = false) {
|
|
|
205465
205563
|
return { status: "unverified", reason: "the collection has no verified source site id and URL; the auth is left as it is" };
|
|
205466
205564
|
}
|
|
205467
205565
|
const source = readFileSync140(configPath, "utf8");
|
|
205468
|
-
const file2 =
|
|
205566
|
+
const file2 = ts18.createSourceFile("config.ts", source, ts18.ScriptTarget.Latest, true, ts18.ScriptKind.TS);
|
|
205469
205567
|
let argument;
|
|
205470
205568
|
const visit = (node3) => {
|
|
205471
205569
|
if (argument) return;
|
|
205472
|
-
if (
|
|
205570
|
+
if (ts18.isCallExpression(node3) && ts18.isIdentifier(node3.expression) && node3.expression.text === "WixConsumerAuthProvider") {
|
|
205473
205571
|
const arg = node3.arguments[0];
|
|
205474
|
-
if (arg &&
|
|
205572
|
+
if (arg && ts18.isObjectLiteralExpression(arg)) argument = arg;
|
|
205475
205573
|
return;
|
|
205476
205574
|
}
|
|
205477
|
-
|
|
205575
|
+
ts18.forEachChild(node3, visit);
|
|
205478
205576
|
};
|
|
205479
205577
|
visit(file2);
|
|
205480
205578
|
if (!argument) return { status: "absent", reason: "config.ts has no WixConsumerAuthProvider({...}) to bind" };
|
|
205481
205579
|
const text15 = (name) => {
|
|
205482
205580
|
const v2 = propOf(argument, name)?.initializer;
|
|
205483
|
-
return v2 &&
|
|
205581
|
+
return v2 && ts18.isStringLiteralLike(v2) ? v2.text : void 0;
|
|
205484
205582
|
};
|
|
205485
205583
|
if (text15("visitorSource") === "one-app" && text15("metaSiteId")?.toLowerCase() === binding2.metaSiteId.toLowerCase()) return { status: "unchanged" };
|
|
205486
205584
|
const clientId = propOf(argument, "clientId")?.initializer;
|
|
205487
205585
|
const placeholder3 = !clientId || clientId.getText(file2).includes("YOUR_WIX_CLIENT_ID");
|
|
205488
205586
|
if (!placeholder3) return { status: "unchanged", reason: "config.ts has its own clientId, which is the author's binding; it is not replaced" };
|
|
205489
205587
|
const indent = " ";
|
|
205490
|
-
const
|
|
205588
|
+
const literal2 = `{
|
|
205491
205589
|
${indent}${indent}// Bound to the source site through its One App visitor identity (guide "Same-site identity"): no OAuth client is
|
|
205492
205590
|
${indent}${indent}// created on the customer's site, and no environment variable can repoint the build.
|
|
205493
205591
|
${indent}${indent}visitorSource: "one-app",
|
|
@@ -205496,22 +205594,22 @@ ${indent}${indent}siteUrl: ${JSON.stringify(binding2.siteUrl)},
|
|
|
205496
205594
|
${indent}${indent}bootAsVisitor: true,
|
|
205497
205595
|
${indent}${indent}preserveVisitorOnSignOut: true,
|
|
205498
205596
|
${indent}}`;
|
|
205499
|
-
if (!dryRun) writeFileSync56(configPath, `${source.slice(0, argument.getStart(file2))}${
|
|
205597
|
+
if (!dryRun) writeFileSync56(configPath, `${source.slice(0, argument.getStart(file2))}${literal2}${source.slice(argument.getEnd())}`, "utf8");
|
|
205500
205598
|
return { status: "set" };
|
|
205501
205599
|
}
|
|
205502
205600
|
function inboxEntriesInConfig(configSource) {
|
|
205503
|
-
const file2 =
|
|
205601
|
+
const file2 = ts18.createSourceFile("config.ts", configSource, ts18.ScriptTarget.Latest, true, ts18.ScriptKind.TS);
|
|
205504
205602
|
const found = [];
|
|
205505
205603
|
const literalOf = (o2, name) => {
|
|
205506
205604
|
const v2 = propOf(o2, name)?.initializer;
|
|
205507
|
-
return v2 &&
|
|
205605
|
+
return v2 && ts18.isStringLiteralLike(v2) ? v2 : void 0;
|
|
205508
205606
|
};
|
|
205509
205607
|
const visit = (node3) => {
|
|
205510
|
-
if (
|
|
205608
|
+
if (ts18.isObjectLiteralExpression(node3)) {
|
|
205511
205609
|
const id = literalOf(node3, "id")?.text;
|
|
205512
205610
|
const onTap = propOf(node3, "onTap")?.initializer;
|
|
205513
|
-
const params = onTap &&
|
|
205514
|
-
const tapTarget2 = params &&
|
|
205611
|
+
const params = onTap && ts18.isObjectLiteralExpression(onTap) ? propOf(onTap, "params")?.initializer : void 0;
|
|
205612
|
+
const tapTarget2 = params && ts18.isObjectLiteralExpression(params) ? literalOf(params, "screenId") : void 0;
|
|
205515
205613
|
if (id === "chat" && tapTarget2) found.push({ site: "top-bar chat", literal: tapTarget2 });
|
|
205516
205614
|
const screenId = literalOf(node3, "screenId");
|
|
205517
205615
|
if (id === "drawer_inbox" && screenId) found.push({ site: "drawer Inbox", literal: screenId });
|
|
@@ -205519,7 +205617,7 @@ function inboxEntriesInConfig(configSource) {
|
|
|
205519
205617
|
if (screenId?.text === "himi_chat_thread" && parent) found.push({ site: "chat thread parent", literal: parent });
|
|
205520
205618
|
if (screenId?.text === BUSINESS_CHAT_SCREEN && parent?.text === "") found.push({ site: "business chat parent", literal: parent });
|
|
205521
205619
|
}
|
|
205522
|
-
|
|
205620
|
+
ts18.forEachChild(node3, visit);
|
|
205523
205621
|
};
|
|
205524
205622
|
visit(file2);
|
|
205525
205623
|
const stale = found.filter((f2) => f2.literal.text === BUSINESS_CHAT_SCREEN || f2.site === "business chat parent");
|
|
@@ -205537,8 +205635,8 @@ function reopenAsInbox(node3) {
|
|
|
205537
205635
|
}
|
|
205538
205636
|
if (!node3 || typeof node3 !== "object") return false;
|
|
205539
205637
|
const record3 = node3;
|
|
205540
|
-
if (record3.actionId === "himi.open" &&
|
|
205541
|
-
record3.params = { ...
|
|
205638
|
+
if (record3.actionId === "himi.open" && obj9(record3.params).screenId === BUSINESS_CHAT_SCREEN) {
|
|
205639
|
+
record3.params = { ...obj9(record3.params), screenId: INBOX_SCREEN };
|
|
205542
205640
|
changed = true;
|
|
205543
205641
|
}
|
|
205544
205642
|
for (const value2 of Object.values(record3)) changed = reopenAsInbox(value2) || changed;
|
|
@@ -205623,7 +205721,7 @@ function readEntry(dir, screenId) {
|
|
|
205623
205721
|
}
|
|
205624
205722
|
function parseEntry(entryText, screenId) {
|
|
205625
205723
|
try {
|
|
205626
|
-
return
|
|
205724
|
+
return obj9(JSON.parse(`{${entryText.trimEnd().replace(/,$/, "")}}`)[screenId]);
|
|
205627
205725
|
} catch {
|
|
205628
205726
|
return void 0;
|
|
205629
205727
|
}
|
|
@@ -205632,7 +205730,7 @@ function applyScreenParams(dir, screenId, params, dryRun = false) {
|
|
|
205632
205730
|
const descriptor = readEntry(dir, screenId);
|
|
205633
205731
|
const appear = descriptor ? rootOnAppear2(descriptor) : void 0;
|
|
205634
205732
|
if (!descriptor || !appear) return "absent";
|
|
205635
|
-
const current =
|
|
205733
|
+
const current = obj9(appear.params);
|
|
205636
205734
|
if (Object.entries(params).every(([k2, v2]) => current[k2] === v2)) return "unchanged";
|
|
205637
205735
|
if (!dryRun) {
|
|
205638
205736
|
appear.params = { ...current, ...params };
|
|
@@ -205640,6 +205738,23 @@ function applyScreenParams(dir, screenId, params, dryRun = false) {
|
|
|
205640
205738
|
}
|
|
205641
205739
|
return "set";
|
|
205642
205740
|
}
|
|
205741
|
+
function provisionInviteDrawer(dir, showsInvite, dryRun = false) {
|
|
205742
|
+
const configPath = join130(dir, "config.ts");
|
|
205743
|
+
if (!existsSync121(configPath)) return { status: "absent", reason: "no config.ts to add the Invite row to" };
|
|
205744
|
+
const result = applyInviteDrawer(readFileSync140(configPath, "utf8"), showsInvite);
|
|
205745
|
+
const translated = [];
|
|
205746
|
+
if (result.rowPresent) {
|
|
205747
|
+
const l10n = join130(dir, "l10n");
|
|
205748
|
+
for (const file2 of existsSync121(l10n) ? readdirSync47(l10n).filter((name) => /^[a-z]{2,3}(-[A-Za-z0-9]+)?\.json$/.test(name)) : []) {
|
|
205749
|
+
const next = withInviteTranslation(readFileSync140(join130(l10n, file2), "utf8"), file2.replace(/\.json$/, ""));
|
|
205750
|
+
if (next === void 0) continue;
|
|
205751
|
+
translated.push(file2.replace(/\.json$/, ""));
|
|
205752
|
+
if (!dryRun) writeFileSync56(join130(l10n, file2), next, "utf8");
|
|
205753
|
+
}
|
|
205754
|
+
if (result.status === "set" && !dryRun) writeFileSync56(configPath, result.text, "utf8");
|
|
205755
|
+
}
|
|
205756
|
+
return { status: result.status, ...result.reason ? { reason: result.reason } : {}, ...translated.length ? { translated } : {} };
|
|
205757
|
+
}
|
|
205643
205758
|
function provisionScreens(dir, facts, dryRun = false) {
|
|
205644
205759
|
const out2 = { set: [], unchanged: [], unverified: [], absent: [], renamed: [] };
|
|
205645
205760
|
const byScreen = /* @__PURE__ */ new Map();
|
|
@@ -205655,7 +205770,7 @@ function provisionScreens(dir, facts, dryRun = false) {
|
|
|
205655
205770
|
out2.absent.push(screenId);
|
|
205656
205771
|
continue;
|
|
205657
205772
|
}
|
|
205658
|
-
const params = { ...
|
|
205773
|
+
const params = { ...obj9(appear.params) };
|
|
205659
205774
|
let changed = false;
|
|
205660
205775
|
for (const item of items) {
|
|
205661
205776
|
const value2 = facts[item.evidence === "paymentCurrency" ? "paymentCurrency" : "timeZone"];
|
|
@@ -205680,6 +205795,7 @@ function provisionScreens(dir, facts, dryRun = false) {
|
|
|
205680
205795
|
out2.renamed = provisionScreenNames(dir, facts.displayName, dryRun);
|
|
205681
205796
|
out2.tabBar = provisionTabBar(dir, dryRun);
|
|
205682
205797
|
out2.chat = provisionChatTarget(dir, facts.memberChat, dryRun);
|
|
205798
|
+
out2.invite = provisionInviteDrawer(dir, facts.showsInvite === true, dryRun);
|
|
205683
205799
|
out2.siteBinding = provisionSiteBinding(dir, { metaSiteId: facts.metaSiteId, siteUrl: facts.siteUrl }, dryRun);
|
|
205684
205800
|
return out2;
|
|
205685
205801
|
}
|
|
@@ -205713,8 +205829,8 @@ async function runOneAppProvision(args, io2) {
|
|
|
205713
205829
|
}
|
|
205714
205830
|
let facts;
|
|
205715
205831
|
try {
|
|
205716
|
-
const manifest2 =
|
|
205717
|
-
const context =
|
|
205832
|
+
const manifest2 = obj9(verifiedEvidence(resolve89(evidenceDir)).manifest);
|
|
205833
|
+
const context = obj9(readHashedEvidenceJson(resolve89(evidenceDir), "business-context.json"));
|
|
205718
205834
|
facts = {
|
|
205719
205835
|
...typeof context.paymentCurrency === "string" && /^[A-Z]{3}$/.test(context.paymentCurrency) ? { paymentCurrency: context.paymentCurrency } : {},
|
|
205720
205836
|
...typeof context.timeZone === "string" && context.timeZone ? { timeZone: context.timeZone } : {},
|
|
@@ -205722,8 +205838,10 @@ async function runOneAppProvision(args, io2) {
|
|
|
205722
205838
|
// Recorded by the collection from the source's own Inbox setting: only an explicit true counts.
|
|
205723
205839
|
...manifest2.memberChat === true ? { memberChat: true } : {},
|
|
205724
205840
|
// The source site the migration collected from: what the same-site binding is written from.
|
|
205725
|
-
...typeof
|
|
205726
|
-
...typeof manifest2.siteUrl === "string" && manifest2.siteUrl ? { siteUrl: manifest2.siteUrl } : {}
|
|
205841
|
+
...typeof obj9(manifest2.source).metaSiteId === "string" ? { metaSiteId: obj9(manifest2.source).metaSiteId } : {},
|
|
205842
|
+
...typeof manifest2.siteUrl === "string" && manifest2.siteUrl ? { siteUrl: manifest2.siteUrl } : {},
|
|
205843
|
+
// The source header's own Invite setting, as planned at collection (an older collection has no plan: nothing is added).
|
|
205844
|
+
...sourceShowsInvite(readHashedEvidenceJson(resolve89(evidenceDir), "invite-plan.json")) ? { showsInvite: true } : {}
|
|
205727
205845
|
};
|
|
205728
205846
|
} catch (error) {
|
|
205729
205847
|
return report4(io2, false, { code: "evidence_invalid", error: error instanceof Error ? error.message : String(error) });
|
|
@@ -205735,7 +205853,7 @@ async function runOneAppProvision(args, io2) {
|
|
|
205735
205853
|
return report4(io2, false, { code: "content_invalid", error: error instanceof Error ? error.message : String(error) });
|
|
205736
205854
|
}
|
|
205737
205855
|
}
|
|
205738
|
-
var
|
|
205856
|
+
var obj9, PROVISION_USAGE, PROVISIONED_PARAMS, propName6, propOf, GUID2, INBOX_SCREEN, BUSINESS_CHAT_SCREEN, INBOX_DOOR_SCREENS, NAME_SLOTS;
|
|
205739
205857
|
var init_provision = __esm({
|
|
205740
205858
|
"src/one-app/provision.ts"() {
|
|
205741
205859
|
init_define_HHP_CATALOG();
|
|
@@ -205745,7 +205863,8 @@ var init_provision = __esm({
|
|
|
205745
205863
|
init_coverage();
|
|
205746
205864
|
init_validate_topbar();
|
|
205747
205865
|
init_validate_identity();
|
|
205748
|
-
|
|
205866
|
+
init_invite_drawer();
|
|
205867
|
+
obj9 = (v2) => v2 && typeof v2 === "object" && !Array.isArray(v2) ? v2 : {};
|
|
205749
205868
|
PROVISION_USAGE = "himi one-app provision --evidence-dir <.himi/one-app> --content <app-dir> [--dry-run]";
|
|
205750
205869
|
PROVISIONED_PARAMS = [
|
|
205751
205870
|
{ screenId: "himi_loyalty", param: "currency", evidence: "paymentCurrency" },
|
|
@@ -205753,8 +205872,8 @@ var init_provision = __esm({
|
|
|
205753
205872
|
{ screenId: "himi_service", param: "businessTimeZone", evidence: "timeZone" },
|
|
205754
205873
|
{ screenId: "himi_time", param: "businessTimeZone", evidence: "timeZone" }
|
|
205755
205874
|
];
|
|
205756
|
-
propName6 = (p2) =>
|
|
205757
|
-
propOf = (o2, name) => o2.properties.find((p2) => propName6(p2) === name &&
|
|
205875
|
+
propName6 = (p2) => ts18.isPropertyAssignment(p2) && (ts18.isIdentifier(p2.name) || ts18.isStringLiteral(p2.name)) ? p2.name.text : void 0;
|
|
205876
|
+
propOf = (o2, name) => o2.properties.find((p2) => propName6(p2) === name && ts18.isPropertyAssignment(p2));
|
|
205758
205877
|
GUID2 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
205759
205878
|
INBOX_SCREEN = "himi_inbox";
|
|
205760
205879
|
BUSINESS_CHAT_SCREEN = "himi_business_chat";
|
|
@@ -205893,16 +206012,16 @@ var init_generate_cli = __esm({
|
|
|
205893
206012
|
});
|
|
205894
206013
|
|
|
205895
206014
|
// src/one-app/access.ts
|
|
205896
|
-
import
|
|
205897
|
-
import { createHash as
|
|
206015
|
+
import ts19 from "typescript";
|
|
206016
|
+
import { createHash as createHash58 } from "node:crypto";
|
|
205898
206017
|
function gateKey(layoutItemId) {
|
|
205899
206018
|
let out2 = "g_";
|
|
205900
206019
|
for (const char of layoutItemId.toLowerCase()) out2 += char >= "a" && char <= "z" || char >= "0" && char <= "9" ? char : "_";
|
|
205901
206020
|
return out2;
|
|
205902
206021
|
}
|
|
205903
206022
|
function ruleOf(permissions) {
|
|
205904
|
-
if (permissions.badges) return { kind: "badges", ids: strings(
|
|
205905
|
-
if (permissions.paidPlans) return { kind: "paidPlans", ids: strings(
|
|
206023
|
+
if (permissions.badges) return { kind: "badges", ids: strings(obj10(permissions.badges).ids) };
|
|
206024
|
+
if (permissions.paidPlans) return { kind: "paidPlans", ids: strings(obj10(permissions.paidPlans).ids) };
|
|
205906
206025
|
if (permissions.membersOnly === true) return { kind: "membersOnly" };
|
|
205907
206026
|
return void 0;
|
|
205908
206027
|
}
|
|
@@ -205911,10 +206030,10 @@ function planAccess(raw, screens, previous = []) {
|
|
|
205911
206030
|
const unmapped = [];
|
|
205912
206031
|
const warnings = [];
|
|
205913
206032
|
const taken = /* @__PURE__ */ new Map();
|
|
205914
|
-
for (const [id, value2] of Object.entries(
|
|
205915
|
-
const item =
|
|
206033
|
+
for (const [id, value2] of Object.entries(obj10(raw.layoutItems))) {
|
|
206034
|
+
const item = obj10(value2);
|
|
205916
206035
|
const layoutItemId = text13(item.id) || id;
|
|
205917
|
-
const permissions =
|
|
206036
|
+
const permissions = obj10(item.permissions);
|
|
205918
206037
|
const rule = ruleOf(permissions);
|
|
205919
206038
|
if (!rule) continue;
|
|
205920
206039
|
const title = text13(item.title);
|
|
@@ -205929,7 +206048,7 @@ function planAccess(raw, screens, previous = []) {
|
|
|
205929
206048
|
continue;
|
|
205930
206049
|
}
|
|
205931
206050
|
taken.set(screenId, layoutItemId);
|
|
205932
|
-
const settings =
|
|
206051
|
+
const settings = obj10(permissions.accessScreenSettings);
|
|
205933
206052
|
const visible = settings.screenVisible ?? settings.isScreenVisible;
|
|
205934
206053
|
gates.push({
|
|
205935
206054
|
key: gateKey(layoutItemId),
|
|
@@ -205953,7 +206072,7 @@ function planAccess(raw, screens, previous = []) {
|
|
|
205953
206072
|
for (const gate of gates.filter((item) => !written.has(item.layoutItemId))) byKey.set(gate.key, [...byKey.get(gate.key) ?? [], gate]);
|
|
205954
206073
|
for (const [key3, group] of byKey) {
|
|
205955
206074
|
if (group.length < 2 && !writtenKeys.has(key3)) continue;
|
|
205956
|
-
for (const gate of group) gate.key = `${key3}_${
|
|
206075
|
+
for (const gate of group) gate.key = `${key3}_${createHash58("sha256").update(gate.layoutItemId).digest("hex").slice(0, 10)}`;
|
|
205957
206076
|
warnings.push(`layout items ${group.map((gate) => gate.layoutItemId).join(", ")} normalize to a gate key another page has: each gets a hash suffix`);
|
|
205958
206077
|
}
|
|
205959
206078
|
if (new Set(gates.map((gate) => gate.key)).size !== gates.length) throw new Error("two layout items still share a gate key after the hash suffix: rename one in the source");
|
|
@@ -206009,18 +206128,18 @@ function applyEdits(source, edits) {
|
|
|
206009
206128
|
return out2;
|
|
206010
206129
|
}
|
|
206011
206130
|
function parse3(fileName, source) {
|
|
206012
|
-
const file2 =
|
|
206131
|
+
const file2 = ts19.createSourceFile(fileName, source, ts19.ScriptTarget.Latest, true, ts19.ScriptKind.TS);
|
|
206013
206132
|
return file2.parseDiagnostics.length ? void 0 : file2;
|
|
206014
206133
|
}
|
|
206015
206134
|
function screensObject(file2) {
|
|
206016
206135
|
for (const statement of file2.statements) {
|
|
206017
|
-
if (!
|
|
206136
|
+
if (!ts19.isVariableStatement(statement)) continue;
|
|
206018
206137
|
for (const declaration of statement.declarationList.declarations) {
|
|
206019
|
-
if (!
|
|
206138
|
+
if (!ts19.isIdentifier(declaration.name) || declaration.name.text !== "SCREENS" || !declaration.initializer) continue;
|
|
206020
206139
|
let init = declaration.initializer;
|
|
206021
|
-
while (
|
|
206022
|
-
if (
|
|
206023
|
-
if (
|
|
206140
|
+
while (ts19.isParenthesizedExpression(init) || ts19.isAsExpression(init) || ts19.isSatisfiesExpression(init)) init = init.expression;
|
|
206141
|
+
if (ts19.isCallExpression(init) && init.arguments[0] && ts19.isObjectLiteralExpression(init.arguments[0])) return init.arguments[0];
|
|
206142
|
+
if (ts19.isObjectLiteralExpression(init)) return init;
|
|
206024
206143
|
}
|
|
206025
206144
|
}
|
|
206026
206145
|
return void 0;
|
|
@@ -206030,7 +206149,7 @@ function declaredScreens(source) {
|
|
|
206030
206149
|
const screens = file2 && screensObject(file2);
|
|
206031
206150
|
if (!screens) return void 0;
|
|
206032
206151
|
const out2 = /* @__PURE__ */ new Set();
|
|
206033
|
-
for (const property2 of screens.properties) if (
|
|
206152
|
+
for (const property2 of screens.properties) if (ts19.isPropertyAssignment(property2)) {
|
|
206034
206153
|
const name = propName5(property2.name);
|
|
206035
206154
|
if (name) out2.add(name);
|
|
206036
206155
|
}
|
|
@@ -206039,7 +206158,7 @@ function declaredScreens(source) {
|
|
|
206039
206158
|
function payloadParts(source, payload) {
|
|
206040
206159
|
const parts = {};
|
|
206041
206160
|
for (const property2 of payload.properties) {
|
|
206042
|
-
if (!
|
|
206161
|
+
if (!ts19.isPropertyAssignment(property2)) return void 0;
|
|
206043
206162
|
const name = propName5(property2.name);
|
|
206044
206163
|
if (!name || !PAYLOAD_KEYS.has(name)) return void 0;
|
|
206045
206164
|
parts[name] = slice(source, property2.initializer);
|
|
@@ -206052,9 +206171,9 @@ function openCase(payload, gate, source) {
|
|
|
206052
206171
|
if (!body || stringValue3(findProperty(body, "type")?.initializer) !== "FragmentSlot" || !props2) return "none";
|
|
206053
206172
|
if (stringValue3(findProperty(props2, "casePath")?.initializer) !== accessStatePath(gate)) return "none";
|
|
206054
206173
|
const cases = findProperty(props2, "cases")?.initializer;
|
|
206055
|
-
if (!cases || !
|
|
206174
|
+
if (!cases || !ts19.isArrayLiteralExpression(cases)) return void 0;
|
|
206056
206175
|
for (const element of cases.elements) {
|
|
206057
|
-
if (!
|
|
206176
|
+
if (!ts19.isObjectLiteralExpression(element)) continue;
|
|
206058
206177
|
if (stringValue3(findProperty(element, "id")?.initializer) !== "open") continue;
|
|
206059
206178
|
const content = objectValue(findProperty(element, "content"));
|
|
206060
206179
|
return content ? payloadParts(source, content) : void 0;
|
|
@@ -206092,7 +206211,7 @@ function applyScreens(source, gates, context) {
|
|
|
206092
206211
|
const conflicts = [];
|
|
206093
206212
|
const hiding = gates.filter(mayHide);
|
|
206094
206213
|
const visit = (current) => {
|
|
206095
|
-
if (
|
|
206214
|
+
if (ts19.isPropertyAssignment(current) && propName5(current.name) === "onTap" && ts19.isObjectLiteralExpression(current.initializer) && ts19.isObjectLiteralExpression(current.parent)) {
|
|
206096
206215
|
const params = objectValue(findProperty(current.initializer, "params"));
|
|
206097
206216
|
const opens = stringValue3(findProperty(current.initializer, "actionId")?.initializer) === "himi.open" ? stringValue3(params && findProperty(params, "screenId")?.initializer) : void 0;
|
|
206098
206217
|
const gate = hiding.find((item) => item.screenId === opens);
|
|
@@ -206104,7 +206223,7 @@ function applyScreens(source, gates, context) {
|
|
|
206104
206223
|
} else if (stringValue3(existing.initializer) !== accessRowHiddenPath(gate)) conflicts.push(`an entry opening ${gate.screenId} already has hiddenPath ${slice(source, existing.initializer)}`);
|
|
206105
206224
|
}
|
|
206106
206225
|
}
|
|
206107
|
-
|
|
206226
|
+
ts19.forEachChild(current, visit);
|
|
206108
206227
|
};
|
|
206109
206228
|
visit(first);
|
|
206110
206229
|
if (conflicts.length) return refuse7(conflicts.join("; "));
|
|
@@ -206115,7 +206234,7 @@ function applyScreens(source, gates, context) {
|
|
|
206115
206234
|
const missing3 = [];
|
|
206116
206235
|
const edits = [];
|
|
206117
206236
|
for (const gate of gates) {
|
|
206118
|
-
const screen = screens.properties.find((property2) =>
|
|
206237
|
+
const screen = screens.properties.find((property2) => ts19.isPropertyAssignment(property2) && propName5(property2.name) === gate.screenId);
|
|
206119
206238
|
if (!screen) {
|
|
206120
206239
|
missing3.push(gate.screenId);
|
|
206121
206240
|
continue;
|
|
@@ -206142,7 +206261,7 @@ function applyConfig(configText, gates, options = {}) {
|
|
|
206142
206261
|
const navigationProperty = app && findProperty(app, "navigation");
|
|
206143
206262
|
const navigation = objectValue(navigationProperty);
|
|
206144
206263
|
if (!navigation) return refuse7("config.ts has no literal `navigation: {...}` in its defineApp call");
|
|
206145
|
-
if (navigation.properties.some((property2) => !
|
|
206264
|
+
if (navigation.properties.some((property2) => !ts19.isPropertyAssignment(property2))) return refuse7("navigation has spreads or accessors, so it cannot be edited safely");
|
|
206146
206265
|
const edits = [];
|
|
206147
206266
|
const bound2 = [];
|
|
206148
206267
|
const conflicts = [];
|
|
@@ -206173,7 +206292,7 @@ ${indent}"navLogicBundle": ${indented(headerBadgesBundleRef(ACCESS_NAV_BUNDLE),
|
|
|
206173
206292
|
const appBlock = objectValue(appProperty);
|
|
206174
206293
|
const declared = appBlock && findProperty(appBlock, "newApp");
|
|
206175
206294
|
if (appProperty && !appBlock) conflicts.push("`app` in config.ts is not an object literal, so `newApp` cannot be added to it safely");
|
|
206176
|
-
else if (declared?.initializer.kind !==
|
|
206295
|
+
else if (declared?.initializer.kind !== ts19.SyntaxKind.TrueKeyword) {
|
|
206177
206296
|
if (declared) conflicts.push("`app.newApp` is declared but not `true`: the page locks need app services, which an app that already shipped older binaries cannot use yet");
|
|
206178
206297
|
else if (!options.newApp) return { ...refuse7(NEW_APP_REASON), needsNewApp: true };
|
|
206179
206298
|
else if (appBlock) edits.push({ start: appBlock.getStart() + 1, end: appBlock.getStart() + 1, replacement: `
|
|
@@ -206191,7 +206310,7 @@ ${indent}"app": { "newApp": true },` });
|
|
|
206191
206310
|
const itemsOf = (name) => {
|
|
206192
206311
|
const block = objectValue(findProperty(navigation, name));
|
|
206193
206312
|
const list2 = block && findProperty(block, "items")?.initializer;
|
|
206194
|
-
return list2 &&
|
|
206313
|
+
return list2 && ts19.isArrayLiteralExpression(list2) ? list2.elements.filter(ts19.isObjectLiteralExpression) : [];
|
|
206195
206314
|
};
|
|
206196
206315
|
const screenOf = (row2) => stringValue3(findProperty(row2, "screenId")?.initializer);
|
|
206197
206316
|
const tabs = itemsOf("tabBar");
|
|
@@ -206208,7 +206327,7 @@ ${indent}"app": { "newApp": true },` });
|
|
|
206208
206327
|
const home = [];
|
|
206209
206328
|
const found = /* @__PURE__ */ new Set();
|
|
206210
206329
|
const visit = (current) => {
|
|
206211
|
-
if (
|
|
206330
|
+
if (ts19.isObjectLiteralExpression(current) && findProperty(current, "label")) {
|
|
206212
206331
|
const screenId = stringValue3(findProperty(current, "screenId")?.initializer);
|
|
206213
206332
|
const gate = hiding.find((item) => item.screenId === screenId);
|
|
206214
206333
|
if (gate) {
|
|
@@ -206230,11 +206349,11 @@ ${indent}` });
|
|
|
206230
206349
|
edits.push({ start: existing.getStart(), end: existing.getStart(), replacement: `"hiddenUntilResolved": true,
|
|
206231
206350
|
${indent}` });
|
|
206232
206351
|
bound2.push(gate.screenId);
|
|
206233
|
-
} else if (resolved2.initializer.kind !==
|
|
206352
|
+
} else if (resolved2.initializer.kind !== ts19.SyntaxKind.TrueKeyword) conflicts.push(`the entry for ${gate.screenId} sets hiddenUntilResolved to something other than true, which would show a hidden tab before the lock is decided`);
|
|
206234
206353
|
}
|
|
206235
206354
|
}
|
|
206236
206355
|
}
|
|
206237
|
-
|
|
206356
|
+
ts19.forEachChild(current, visit);
|
|
206238
206357
|
};
|
|
206239
206358
|
visit(navigation);
|
|
206240
206359
|
if (conflicts.length) return refuse7(conflicts.join("; "));
|
|
@@ -206250,16 +206369,16 @@ function applyLoginWall(configText, wall, options = {}) {
|
|
|
206250
206369
|
const authProperty = app && findProperty(app, "auth");
|
|
206251
206370
|
if (!authProperty) return refuse7("config.ts has no literal `auth: ...` in its defineApp call");
|
|
206252
206371
|
const init = authProperty.initializer;
|
|
206253
|
-
const wrapped =
|
|
206372
|
+
const wrapped = ts19.isCallExpression(init) && ts19.isIdentifier(init.expression) && init.expression.text === LOGIN_HELPER && init.arguments.length === 1;
|
|
206254
206373
|
if (wall === "none") {
|
|
206255
206374
|
if (wrapped && options.keepExisting) return { status: "unchanged", text: configText, kept: true };
|
|
206256
206375
|
return wrapped ? refuse7("the app requires login (`requireLogin` in config.ts) but the source no longer does: remove it by hand, a login requirement is not taken out automatically") : { status: "unchanged", text: configText };
|
|
206257
206376
|
}
|
|
206258
206377
|
if (wrapped) return { status: "unchanged", text: configText };
|
|
206259
|
-
const declared = file2.statements.some((statement) =>
|
|
206378
|
+
const declared = file2.statements.some((statement) => ts19.isVariableStatement(statement) && statement.declarationList.declarations.some((declaration) => ts19.isIdentifier(declaration.name) && declaration.name.text === LOGIN_HELPER));
|
|
206260
206379
|
const edits = [{ start: init.getStart(), end: init.getEnd(), replacement: `${LOGIN_HELPER}(${init.getText(file2)})` }];
|
|
206261
206380
|
if (!declared) {
|
|
206262
|
-
const imports = file2.statements.filter(
|
|
206381
|
+
const imports = file2.statements.filter(ts19.isImportDeclaration);
|
|
206263
206382
|
const at2 = imports.length ? imports[imports.length - 1].getEnd() : 0;
|
|
206264
206383
|
edits.push({ start: at2, end: at2, replacement: `
|
|
206265
206384
|
|
|
@@ -206274,14 +206393,14 @@ function tableGates(tableText) {
|
|
|
206274
206393
|
const file2 = parse3("access-gates-table.ts", tableText);
|
|
206275
206394
|
if (!file2) return void 0;
|
|
206276
206395
|
for (const statement of file2.statements) {
|
|
206277
|
-
if (!
|
|
206396
|
+
if (!ts19.isVariableStatement(statement)) continue;
|
|
206278
206397
|
for (const declaration of statement.declarationList.declarations) {
|
|
206279
|
-
if (!
|
|
206398
|
+
if (!ts19.isIdentifier(declaration.name) || declaration.name.text !== "ACCESS_GATES" || !declaration.initializer) continue;
|
|
206280
206399
|
let init = declaration.initializer;
|
|
206281
|
-
while (
|
|
206282
|
-
if (!
|
|
206400
|
+
while (ts19.isParenthesizedExpression(init) || ts19.isAsExpression(init) || ts19.isSatisfiesExpression(init)) init = init.expression;
|
|
206401
|
+
if (!ts19.isArrayLiteralExpression(init)) return void 0;
|
|
206283
206402
|
return init.elements.flatMap((element) => {
|
|
206284
|
-
if (!
|
|
206403
|
+
if (!ts19.isObjectLiteralExpression(element)) return [];
|
|
206285
206404
|
const key3 = stringValue3(findProperty(element, "key")?.initializer);
|
|
206286
206405
|
if (key3 === void 0) return [];
|
|
206287
206406
|
return [{ key: key3, layoutItemId: stringValue3(findProperty(element, "layoutItemId")?.initializer) ?? "", screenId: stringValue3(findProperty(element, "screenId")?.initializer) ?? "" }];
|
|
@@ -206305,13 +206424,13 @@ function renderGateTable(gates) {
|
|
|
206305
206424
|
""
|
|
206306
206425
|
].join("\n");
|
|
206307
206426
|
}
|
|
206308
|
-
var
|
|
206427
|
+
var obj10, text13, strings, mayHide, STOCK_COPY, node2, SIGN_IN_SCREEN, CHAT_SCREEN, PLANS_SCREEN, slotPrefix, accessStatePath, accessRowHiddenPath, accessHiddenPath, slice, stringValue3, objectValue, PAYLOAD_KEYS, indented, LOGIN_HELPER, NEW_APP_REASON;
|
|
206309
206428
|
var init_access = __esm({
|
|
206310
206429
|
"src/one-app/access.ts"() {
|
|
206311
206430
|
init_define_HHP_CATALOG();
|
|
206312
206431
|
init_shared_drift();
|
|
206313
206432
|
init_header_badges();
|
|
206314
|
-
|
|
206433
|
+
obj10 = (value2) => value2 && typeof value2 === "object" && !Array.isArray(value2) ? value2 : {};
|
|
206315
206434
|
text13 = (value2) => typeof value2 === "string" ? value2 : "";
|
|
206316
206435
|
strings = (value2) => Array.isArray(value2) ? value2.filter((item) => typeof item === "string") : [];
|
|
206317
206436
|
mayHide = (gate) => gate.mode === "hidden" || gate.hideFromVisitors;
|
|
@@ -206335,8 +206454,8 @@ var init_access = __esm({
|
|
|
206335
206454
|
accessRowHiddenPath = (gate) => `$app:${NAV_SERVICE}.accessHidden.${gate.key}`;
|
|
206336
206455
|
accessHiddenPath = (gate) => `$service:${NAV_SERVICE}.accessHidden.${gate.key}`;
|
|
206337
206456
|
slice = (source, node3) => source.slice(node3.getStart(), node3.getEnd());
|
|
206338
|
-
stringValue3 = (node3) => node3 && (
|
|
206339
|
-
objectValue = (property2) => property2 &&
|
|
206457
|
+
stringValue3 = (node3) => node3 && (ts19.isStringLiteral(node3) || ts19.isNoSubstitutionTemplateLiteral(node3)) ? node3.text : void 0;
|
|
206458
|
+
objectValue = (property2) => property2 && ts19.isObjectLiteralExpression(property2.initializer) ? property2.initializer : void 0;
|
|
206340
206459
|
PAYLOAD_KEYS = /* @__PURE__ */ new Set(["id", "body", "modifiers"]);
|
|
206341
206460
|
indented = (value2, indent) => JSON.stringify(value2, null, 2).replaceAll("\n", `
|
|
206342
206461
|
${indent}`);
|
|
@@ -206346,7 +206465,7 @@ ${indent}`);
|
|
|
206346
206465
|
});
|
|
206347
206466
|
|
|
206348
206467
|
// src/one-app/access-cli.ts
|
|
206349
|
-
import { createHash as
|
|
206468
|
+
import { createHash as createHash59 } from "node:crypto";
|
|
206350
206469
|
import { existsSync as existsSync123, readFileSync as readFileSync142, rmSync as rmSync37, statSync as statSync33, writeFileSync as writeFileSync58 } from "node:fs";
|
|
206351
206470
|
import { join as join132, resolve as resolve91 } from "node:path";
|
|
206352
206471
|
function parseArgs5(args) {
|
|
@@ -206483,7 +206602,7 @@ function recordedLoginPolicy(evidenceDir) {
|
|
|
206483
206602
|
const expected = manifest2.sha256?.["access-policy.json"];
|
|
206484
206603
|
if (expected === void 0) return void 0;
|
|
206485
206604
|
const bytes2 = readFileSync142(join132(evidenceDir, "access-policy.json"));
|
|
206486
|
-
if (
|
|
206605
|
+
if (createHash59("sha256").update(bytes2).digest("hex") !== expected) throw new Error("access-policy.json does not match the hash recorded in manifest.json.");
|
|
206487
206606
|
const value2 = JSON.parse(bytes2.toString("utf8")).visitorModeEnabled;
|
|
206488
206607
|
return typeof value2 === "boolean" ? value2 : void 0;
|
|
206489
206608
|
}
|
|
@@ -206750,8 +206869,8 @@ var init_access_policy = __esm({
|
|
|
206750
206869
|
import { readFileSync as readFileSync143 } from "node:fs";
|
|
206751
206870
|
import { join as join133, resolve as resolve92 } from "node:path";
|
|
206752
206871
|
function preservesUnverifiedFlow(flow) {
|
|
206753
|
-
const checkout =
|
|
206754
|
-
return flow.payment === "online-paid" &&
|
|
206872
|
+
const checkout = obj11(flow.checkout);
|
|
206873
|
+
return flow.payment === "online-paid" && obj11(flow.readiness).state === "unverified" && checkout.state === "supported" && text14(checkout.evidence) && (flow.decision === void 0 || obj11(flow.decision).action === "proceed");
|
|
206755
206874
|
}
|
|
206756
206875
|
function initialPaymentReview(metaSiteId) {
|
|
206757
206876
|
return {
|
|
@@ -206768,7 +206887,7 @@ function initialPaymentReview(metaSiteId) {
|
|
|
206768
206887
|
};
|
|
206769
206888
|
}
|
|
206770
206889
|
function paymentReviewIssues(value2, metaSiteId) {
|
|
206771
|
-
const review =
|
|
206890
|
+
const review = obj11(value2);
|
|
206772
206891
|
const issues = [];
|
|
206773
206892
|
if (review.schemaVersion !== 1 && review.schemaVersion !== 2 || !sameSite(review.metaSiteId, metaSiteId)) issues.push("Review must name the collected site and schemaVersion 2 (or 1 for a legacy review).");
|
|
206774
206893
|
if (review.inventoryReviewed !== true || !text14(review.inventoryEvidence)) issues.push("Review the source actions and live read-only catalog/payment options, including free and offline flows, before generation.");
|
|
@@ -206777,7 +206896,7 @@ function paymentReviewIssues(value2, metaSiteId) {
|
|
|
206777
206896
|
if (review.flows.length > 0 && review.noPurchaseFlows === true) issues.push("A no-purchase finding cannot accompany listed flows; review the inventory.");
|
|
206778
206897
|
const ids = /* @__PURE__ */ new Set();
|
|
206779
206898
|
for (const [index, value3] of review.flows.entries()) {
|
|
206780
|
-
const flow =
|
|
206899
|
+
const flow = obj11(value3);
|
|
206781
206900
|
const label3 = `Flow ${index + 1}`;
|
|
206782
206901
|
if (!text14(flow.id) || ids.has(String(flow.id))) issues.push(`${label3} needs a unique source-bound id.`);
|
|
206783
206902
|
ids.add(String(flow.id));
|
|
@@ -206787,9 +206906,9 @@ function paymentReviewIssues(value2, metaSiteId) {
|
|
|
206787
206906
|
issues.push(`${label3} has unresolved payment intent; split mixed online/offline choices into separate flows.`);
|
|
206788
206907
|
continue;
|
|
206789
206908
|
}
|
|
206790
|
-
const readiness =
|
|
206791
|
-
const decision =
|
|
206792
|
-
const checkout =
|
|
206909
|
+
const readiness = obj11(flow.readiness);
|
|
206910
|
+
const decision = obj11(flow.decision);
|
|
206911
|
+
const checkout = obj11(flow.checkout);
|
|
206793
206912
|
if ((review.schemaVersion === 2 || flow.checkout !== void 0) && (typeof checkout.state !== "string" || !["supported", "unsupported", "unverified"].includes(checkout.state) || !text14(checkout.evidence))) issues.push(`${label3} needs supported, unsupported or unverified target checkout compatibility with evidence.`);
|
|
206794
206913
|
if (!sameSite(readiness.metaSiteId, metaSiteId)) issues.push(`${label3} readiness must name the collected site; evidence from another site cannot authorize checkout.`);
|
|
206795
206914
|
if (typeof readiness.state !== "string" || !["ready", "missing", "unverified"].includes(readiness.state) || !text14(readiness.evidence)) issues.push(`${label3} needs ready, missing or unverified readiness with site-bound evidence.`);
|
|
@@ -206803,7 +206922,7 @@ function paymentReviewIssues(value2, metaSiteId) {
|
|
|
206803
206922
|
if (decision.action === "connect-provider") issues.push(`${label3} is waiting for owner setup and a new readiness review; do not generate its paid UI yet.`);
|
|
206804
206923
|
if (decision.action === "retain") {
|
|
206805
206924
|
if (!text14(decision.explanation)) issues.push(`${label3} must explain payment availability before checkout.`);
|
|
206806
|
-
const recovery =
|
|
206925
|
+
const recovery = obj11(decision.recovery);
|
|
206807
206926
|
if (recovery.action !== "back" && !(recovery.action === "contact" && text14(recovery.target))) issues.push(`${label3} must record a back action or the real contact route to implement before checkout.`);
|
|
206808
206927
|
}
|
|
206809
206928
|
}
|
|
@@ -206827,12 +206946,12 @@ function runPaymentReview(args, io2) {
|
|
|
206827
206946
|
if (!evidenceDir) return fail8("invalid_usage", ["Pass --evidence-dir."], 2);
|
|
206828
206947
|
try {
|
|
206829
206948
|
const { manifest: manifest2 } = verifiedEvidence(evidenceDir);
|
|
206830
|
-
const metaSiteId =
|
|
206949
|
+
const metaSiteId = obj11(manifest2.source).metaSiteId;
|
|
206831
206950
|
if (typeof metaSiteId !== "string") throw Error("Missing site binding");
|
|
206832
206951
|
const review = JSON.parse(readFileSync143(join133(evidenceDir, "payment-review.json"), "utf8"));
|
|
206833
206952
|
const issues = paymentReviewIssues(review, metaSiteId);
|
|
206834
206953
|
if (issues.length) return fail8("payment_decision_required", issues, 1);
|
|
206835
|
-
const warnings =
|
|
206954
|
+
const warnings = obj11(review).flows.map(obj11).filter(preservesUnverifiedFlow).map((flow) => ({
|
|
206836
206955
|
code: "payment_readiness_unverified",
|
|
206837
206956
|
flowId: flow.id,
|
|
206838
206957
|
message: "Payment setup could not be verified. Preserve the existing purchase flow with its supported checkout; do not claim payments are disconnected."
|
|
@@ -206843,12 +206962,12 @@ function runPaymentReview(args, io2) {
|
|
|
206843
206962
|
return fail8("payment_review_unreadable", ["Read the collected manifest and source evidence, then prepare payment-review.json for that site."], 1);
|
|
206844
206963
|
}
|
|
206845
206964
|
}
|
|
206846
|
-
var
|
|
206965
|
+
var obj11, text14, sameSite, PAYMENT_REVIEW_USAGE;
|
|
206847
206966
|
var init_payment_review = __esm({
|
|
206848
206967
|
"src/one-app/payment-review.ts"() {
|
|
206849
206968
|
init_define_HHP_CATALOG();
|
|
206850
206969
|
init_coverage();
|
|
206851
|
-
|
|
206970
|
+
obj11 = (value2) => value2 !== null && typeof value2 === "object" && !Array.isArray(value2) ? value2 : {};
|
|
206852
206971
|
text14 = (value2) => typeof value2 === "string" && value2.trim().length > 0;
|
|
206853
206972
|
sameSite = (value2, expected) => typeof value2 === "string" && value2.toLowerCase() === expected.toLowerCase();
|
|
206854
206973
|
PAYMENT_REVIEW_USAGE = "himi one-app validate-payments --evidence-dir <.himi/one-app> [--json]";
|
|
@@ -207018,7 +207137,7 @@ __export(cli_exports2, {
|
|
|
207018
207137
|
runOneAppCommand: () => runOneAppCommand
|
|
207019
207138
|
});
|
|
207020
207139
|
import { closeSync as closeSync9, constants as constants9, lstatSync as lstatSync29, mkdirSync as mkdirSync53, openSync as openSync8, readFileSync as readFileSync144, realpathSync as realpathSync17, writeFileSync as writeFileSync59 } from "node:fs";
|
|
207021
|
-
import { createHash as
|
|
207140
|
+
import { createHash as createHash60 } from "node:crypto";
|
|
207022
207141
|
import { isIP as isIP2 } from "node:net";
|
|
207023
207142
|
import { dirname as dirname65, join as join134, parse as parse4, resolve as resolve93 } from "node:path";
|
|
207024
207143
|
function nativeSiteHost(host) {
|
|
@@ -207233,7 +207352,7 @@ validate-payments checks site-bound payment evidence and explicit paid-flow deci
|
|
|
207233
207352
|
throw new OneAppError("artifact_write_failed", "Could not save the migration evidence. Existing files were kept.", { stage });
|
|
207234
207353
|
}
|
|
207235
207354
|
artifacts[name] = path2;
|
|
207236
|
-
hashes[name] =
|
|
207355
|
+
hashes[name] = createHash60("sha256").update(content).digest("hex");
|
|
207237
207356
|
return path2;
|
|
207238
207357
|
};
|
|
207239
207358
|
const progress = (nextStage) => {
|
|
@@ -208773,30 +208892,30 @@ function verticalForSection(definitionId) {
|
|
|
208773
208892
|
return SECTION_PREFIX_TO_VERTICAL.find(([prefix]) => definitionId.startsWith(prefix))?.[1];
|
|
208774
208893
|
}
|
|
208775
208894
|
function inOrder(refs) {
|
|
208776
|
-
return refs.map(
|
|
208895
|
+
return refs.map(obj12);
|
|
208777
208896
|
}
|
|
208778
208897
|
function access(value2) {
|
|
208779
|
-
const p2 =
|
|
208898
|
+
const p2 = obj12(value2);
|
|
208780
208899
|
const out2 = {};
|
|
208781
208900
|
if (p2.membersOnly === true || p2.type === "membersOnly") out2.membersOnly = true;
|
|
208782
|
-
const badges = strs2(
|
|
208901
|
+
const badges = strs2(obj12(p2.badges).ids);
|
|
208783
208902
|
if (badges.length) out2.badgeIds = badges;
|
|
208784
|
-
const plans = strs2(
|
|
208903
|
+
const plans = strs2(obj12(pick2(p2, "paidPlans", "paid_plans")).ids);
|
|
208785
208904
|
if (plans.length) out2.paidPlanIds = plans;
|
|
208786
208905
|
const hidden = strs2(pick2(p2, "hiddenForOs", "hidden_for_os")).filter((os2) => os2 === "IOS" || os2 === "ANDROID");
|
|
208787
208906
|
if (hidden.length) out2.hiddenForOs = hidden;
|
|
208788
208907
|
return Object.keys(out2).length ? out2 : void 0;
|
|
208789
208908
|
}
|
|
208790
208909
|
function summarizeStructure(raw, catalog4 = loadSectionCatalog()) {
|
|
208791
|
-
const screens =
|
|
208792
|
-
const layouts =
|
|
208793
|
-
const sections =
|
|
208910
|
+
const screens = obj12(raw.screens);
|
|
208911
|
+
const layouts = obj12(pick2(raw, "layoutItems", "layout_items"));
|
|
208912
|
+
const sections = obj12(raw.sections);
|
|
208794
208913
|
const coverage = Object.fromEntries(SECTION_COVERAGES.map((c2) => [c2, 0]));
|
|
208795
208914
|
const verticals = /* @__PURE__ */ new Set();
|
|
208796
208915
|
const gaps = /* @__PURE__ */ new Set();
|
|
208797
208916
|
const section3 = (ref) => {
|
|
208798
208917
|
const id = str12(pick2(ref, "elementId", "element_id"));
|
|
208799
|
-
const s2 = id ?
|
|
208918
|
+
const s2 = id ? obj12(sections[id]) : {};
|
|
208800
208919
|
const definitionId = str12(pick2(s2, "sectionDefinitionId", "section_definition_id"));
|
|
208801
208920
|
if (!id || !definitionId || outOfScope(definitionId)) return [];
|
|
208802
208921
|
const entry = catalog4.get(definitionId);
|
|
@@ -208811,7 +208930,7 @@ function summarizeStructure(raw, catalog4 = loadSectionCatalog()) {
|
|
|
208811
208930
|
definitionId,
|
|
208812
208931
|
...str12(s2.title) ? { title: str12(s2.title) } : {},
|
|
208813
208932
|
...acc ? { access: acc } : {},
|
|
208814
|
-
settingsKeys: Object.keys(
|
|
208933
|
+
settingsKeys: Object.keys(obj12(s2.settings)).sort(),
|
|
208815
208934
|
coverage: cov,
|
|
208816
208935
|
...entry?.himi ? { himi: entry.himi } : {},
|
|
208817
208936
|
...vertical ? { vertical } : {}
|
|
@@ -208819,22 +208938,22 @@ function summarizeStructure(raw, catalog4 = loadSectionCatalog()) {
|
|
|
208819
208938
|
};
|
|
208820
208939
|
const page = (layoutItemId) => {
|
|
208821
208940
|
if (!Object.hasOwn(layouts, layoutItemId)) return void 0;
|
|
208822
|
-
const item =
|
|
208941
|
+
const item = obj12(layouts[layoutItemId]);
|
|
208823
208942
|
const acc = access(item.permissions);
|
|
208824
208943
|
return {
|
|
208825
208944
|
id: layoutItemId,
|
|
208826
208945
|
...str12(item.title) ? { title: str12(item.title) } : {},
|
|
208827
208946
|
...str12(item.slug) ? { slug: str12(item.slug) } : {},
|
|
208828
|
-
...
|
|
208947
|
+
...obj12(item.settings).hideFromNavigation === true ? { hidden: true } : {},
|
|
208829
208948
|
...acc ? { access: acc } : {},
|
|
208830
208949
|
sections: inOrder(arr2(item.elements)).flatMap(section3)
|
|
208831
208950
|
};
|
|
208832
208951
|
};
|
|
208833
|
-
const tabs = inOrder(arr2(pick2(
|
|
208952
|
+
const tabs = inOrder(arr2(pick2(obj12(raw.navigation), "bottomTabs", "bottom_tabs"))).flatMap((tab) => {
|
|
208834
208953
|
const screenId = str12(pick2(tab, "screenId", "screen_id"));
|
|
208835
208954
|
if (!screenId) return [];
|
|
208836
|
-
const screen =
|
|
208837
|
-
const layout =
|
|
208955
|
+
const screen = obj12(screens[screenId]);
|
|
208956
|
+
const layout = obj12(screen.layout);
|
|
208838
208957
|
const items = inOrder(arr2(layout.items));
|
|
208839
208958
|
const rendered = str12(layout.type) === "LINEAR" ? items.slice(0, 1) : items;
|
|
208840
208959
|
const pages2 = rendered.flatMap((ref) => {
|
|
@@ -208852,11 +208971,11 @@ function summarizeStructure(raw, catalog4 = loadSectionCatalog()) {
|
|
|
208852
208971
|
pages: pages2
|
|
208853
208972
|
}];
|
|
208854
208973
|
});
|
|
208855
|
-
const profile = inOrder(arr2(
|
|
208856
|
-
const settings =
|
|
208857
|
-
const theme =
|
|
208858
|
-
const colors =
|
|
208859
|
-
const typography =
|
|
208974
|
+
const profile = inOrder(arr2(obj12(pick2(raw, "businessProfile", "business_profile")).elements)).flatMap(section3);
|
|
208975
|
+
const settings = obj12(raw.settings);
|
|
208976
|
+
const theme = obj12(settings.theme);
|
|
208977
|
+
const colors = obj12(theme.colors);
|
|
208978
|
+
const typography = obj12(theme.typography);
|
|
208860
208979
|
const themePrimary = str12(pick2(theme, "primaryColor", "primary_color"));
|
|
208861
208980
|
const brandedPrimary = str12(colors.primary);
|
|
208862
208981
|
const primaryColor = (pick2(raw, "appInstance", "app_instance") === "DEFAULT" ? themePrimary ?? brandedPrimary : brandedPrimary ?? themePrimary) ?? str12(pick2(settings, "primaryColor", "primary_color"));
|
|
@@ -208888,10 +209007,10 @@ function summarizeStructure(raw, catalog4 = loadSectionCatalog()) {
|
|
|
208888
209007
|
}
|
|
208889
209008
|
function pagesAreOwnerOnly(refs, layouts, sections) {
|
|
208890
209009
|
return refs.every((ref) => {
|
|
208891
|
-
const item =
|
|
209010
|
+
const item = obj12(layouts[str12(pick2(obj12(ref), "layoutItemId", "layout_item_id")) ?? ""]);
|
|
208892
209011
|
const elements = arr2(item.elements);
|
|
208893
209012
|
return elements.length > 0 && elements.every((e2) => {
|
|
208894
|
-
const s2 =
|
|
209013
|
+
const s2 = obj12(sections[str12(pick2(obj12(e2), "elementId", "element_id")) ?? ""]);
|
|
208895
209014
|
return outOfScope(str12(pick2(s2, "sectionDefinitionId", "section_definition_id")));
|
|
208896
209015
|
});
|
|
208897
209016
|
});
|
|
@@ -208968,7 +209087,7 @@ function appPrimaryColor(app) {
|
|
|
208968
209087
|
const m2 = /^#([0-9A-F])([0-9A-F])([0-9A-F])$/.exec(raw);
|
|
208969
209088
|
return m2 ? `#${m2[1]}${m2[1]}${m2[2]}${m2[2]}${m2[3]}${m2[3]}` : void 0;
|
|
208970
209089
|
}
|
|
208971
|
-
var TIMEOUT_MS5, SECTION_CATALOG_GUIDE, bundledCatalog, SECTION_PREFIX_TO_VERTICAL,
|
|
209090
|
+
var TIMEOUT_MS5, SECTION_CATALOG_GUIDE, bundledCatalog, SECTION_PREFIX_TO_VERTICAL, obj12, arr2, TEXT_CAP, str12, strs2, pick2, outOfScope, empty;
|
|
208972
209091
|
var init_mobile_app = __esm({
|
|
208973
209092
|
"src/site-analyze/mobile-app.ts"() {
|
|
208974
209093
|
init_define_HHP_CATALOG();
|
|
@@ -209010,7 +209129,7 @@ var init_mobile_app = __esm({
|
|
|
209010
209129
|
["vod_", "videos"],
|
|
209011
209130
|
["podcasts_", "podcasts"]
|
|
209012
209131
|
];
|
|
209013
|
-
|
|
209132
|
+
obj12 = (v2) => v2 !== null && typeof v2 === "object" && !Array.isArray(v2) ? v2 : {};
|
|
209014
209133
|
arr2 = (v2) => Array.isArray(v2) ? v2 : [];
|
|
209015
209134
|
TEXT_CAP = 200;
|
|
209016
209135
|
str12 = (v2) => {
|
|
@@ -211657,7 +211776,7 @@ var init_site_oauth_client = __esm({
|
|
|
211657
211776
|
|
|
211658
211777
|
// src/site-analyze/velo-source.ts
|
|
211659
211778
|
import path from "node:path";
|
|
211660
|
-
import
|
|
211779
|
+
import ts20 from "typescript";
|
|
211661
211780
|
function applySourceEdits(source, edits) {
|
|
211662
211781
|
const chunks = [];
|
|
211663
211782
|
let cursor = 0;
|
|
@@ -211675,13 +211794,13 @@ function redactVeloSource(source, knownSecrets = []) {
|
|
|
211675
211794
|
/\b(?:IST\.[\w.-]+|eyJ[\w-]+\.[\w-]+\.[\w-]+|(?:sk|rk)_(?:live|test)_[\w-]+|gh[pousr]_[\w]+|github_pat_[\w]+|AKIA[A-Z0-9]{16})\b/g,
|
|
211676
211795
|
REDACTED2
|
|
211677
211796
|
).replace(/\b(?:Bearer|Basic)\s+[A-Za-z0-9._~+/=-]+/gi, REDACTED2).replace(/\b([a-z][a-z0-9+.-]*:\/\/)[^\s/'"`]+:[^\s/'"`]+@/gi, "$1[REDACTED]@").replace(/([?&](?:api[-_]?key|token|secret|password|signature)=)[^&#\s'"`]+/gi, "$1[REDACTED]");
|
|
211678
|
-
const parsed =
|
|
211797
|
+
const parsed = ts20.createSourceFile("backend.ts", source, ts20.ScriptTarget.Latest, true);
|
|
211679
211798
|
const comments = /* @__PURE__ */ new Map();
|
|
211680
211799
|
const visitComments = (node3) => {
|
|
211681
211800
|
for (const range of [
|
|
211682
|
-
...
|
|
211683
|
-
...
|
|
211684
|
-
...
|
|
211801
|
+
...ts20.getLeadingCommentRanges(source, node3.pos) ?? [],
|
|
211802
|
+
...ts20.getTrailingCommentRanges(source, node3.pos) ?? [],
|
|
211803
|
+
...ts20.getTrailingCommentRanges(source, node3.end) ?? []
|
|
211685
211804
|
]) comments.set(range.pos, range.end);
|
|
211686
211805
|
for (const child of node3.getChildren(parsed)) visitComments(child);
|
|
211687
211806
|
};
|
|
@@ -211700,22 +211819,22 @@ function redactVeloSource(source, knownSecrets = []) {
|
|
|
211700
211819
|
if (/^["'`][A-Za-z0-9_+/=-]{24,}["'`]$/.test(token)) return JSON.stringify(REDACTED2);
|
|
211701
211820
|
return token;
|
|
211702
211821
|
};
|
|
211703
|
-
const clean2 =
|
|
211822
|
+
const clean2 = ts20.createSourceFile("backend.ts", source, ts20.ScriptTarget.Latest, true);
|
|
211704
211823
|
const masks = [];
|
|
211705
211824
|
const collectMasks = (node3) => {
|
|
211706
211825
|
const start = node3.getStart(clean2);
|
|
211707
|
-
if (
|
|
211826
|
+
if (ts20.isRegularExpressionLiteral(node3)) {
|
|
211708
211827
|
masks.push({ start, end: node3.end, text: " ".repeat(node3.end - start) });
|
|
211709
|
-
} else if (
|
|
211828
|
+
} else if (ts20.isStringLiteral(node3) || ts20.isTemplateLiteralToken(node3)) {
|
|
211710
211829
|
masks.push({ start, end: node3.end, text: source.slice(start, node3.end).replace(/;/g, " ") });
|
|
211711
211830
|
}
|
|
211712
|
-
|
|
211831
|
+
ts20.forEachChild(node3, collectMasks);
|
|
211713
211832
|
};
|
|
211714
211833
|
collectMasks(clean2);
|
|
211715
211834
|
const assignmentContext = applySourceEdits(source, masks);
|
|
211716
211835
|
const edits = [];
|
|
211717
211836
|
const visitLiterals = (node3) => {
|
|
211718
|
-
if (
|
|
211837
|
+
if (ts20.isStringLiteral(node3) || ts20.isNoSubstitutionTemplateLiteral(node3) || ts20.isTemplateExpression(node3)) {
|
|
211719
211838
|
const start = node3.getStart(clean2);
|
|
211720
211839
|
const text15 = source.slice(start, node3.end);
|
|
211721
211840
|
const redacted = redactLiteral(text15, start);
|
|
@@ -211724,7 +211843,7 @@ function redactVeloSource(source, knownSecrets = []) {
|
|
|
211724
211843
|
return;
|
|
211725
211844
|
}
|
|
211726
211845
|
}
|
|
211727
|
-
|
|
211846
|
+
ts20.forEachChild(node3, visitLiterals);
|
|
211728
211847
|
};
|
|
211729
211848
|
visitLiterals(clean2);
|
|
211730
211849
|
return applySourceEdits(source, edits);
|
|
@@ -211763,19 +211882,19 @@ function selectVeloSource(files, request, knownSecrets = []) {
|
|
|
211763
211882
|
selected.set(file2.path, { source: excerpt, sourceTruncated: excerpt.length < redacted.length });
|
|
211764
211883
|
remaining -= excerpt.length;
|
|
211765
211884
|
const dependencies = [];
|
|
211766
|
-
const parsed =
|
|
211885
|
+
const parsed = ts20.createSourceFile(file2.path, file2.content, ts20.ScriptTarget.Latest, true);
|
|
211767
211886
|
const specifiers = [];
|
|
211768
211887
|
const collectImports = (node3) => {
|
|
211769
211888
|
let specifier;
|
|
211770
|
-
if (
|
|
211889
|
+
if (ts20.isImportDeclaration(node3) || ts20.isExportDeclaration(node3)) {
|
|
211771
211890
|
specifier = node3.moduleSpecifier;
|
|
211772
|
-
} else if (
|
|
211891
|
+
} else if (ts20.isImportEqualsDeclaration(node3) && ts20.isExternalModuleReference(node3.moduleReference)) {
|
|
211773
211892
|
specifier = node3.moduleReference.expression;
|
|
211774
|
-
} else if (
|
|
211893
|
+
} else if (ts20.isCallExpression(node3) && (node3.expression.kind === ts20.SyntaxKind.ImportKeyword || ts20.isIdentifier(node3.expression) && node3.expression.text === "require")) {
|
|
211775
211894
|
specifier = node3.arguments[0];
|
|
211776
211895
|
}
|
|
211777
|
-
if (specifier &&
|
|
211778
|
-
|
|
211896
|
+
if (specifier && ts20.isStringLiteralLike(specifier)) specifiers.push(specifier.text);
|
|
211897
|
+
ts20.forEachChild(node3, collectImports);
|
|
211779
211898
|
};
|
|
211780
211899
|
collectImports(parsed);
|
|
211781
211900
|
for (const specifier of specifiers) {
|
|
@@ -215488,12 +215607,12 @@ async function ejectCommand(ctx) {
|
|
|
215488
215607
|
print({ ok: false, error: "eject needs a module", hint: `one of: ${EJECTABLE2.join(", ")}` });
|
|
215489
215608
|
return 2;
|
|
215490
215609
|
}
|
|
215491
|
-
const { readdirSync:
|
|
215610
|
+
const { readdirSync: readdirSync48, existsSync: fileExists } = await import("node:fs");
|
|
215492
215611
|
const { join: pathJoin3 } = await import("node:path");
|
|
215493
215612
|
const targets = [];
|
|
215494
215613
|
const t5 = pathJoin3(dir, "tier5-src");
|
|
215495
215614
|
if (fileExists(t5)) {
|
|
215496
|
-
for (const d2 of
|
|
215615
|
+
for (const d2 of readdirSync48(t5, { withFileTypes: true })) {
|
|
215497
215616
|
if (d2.isDirectory()) targets.push(pathJoin3(t5, d2.name, "index.ts"));
|
|
215498
215617
|
}
|
|
215499
215618
|
}
|
|
@@ -215695,11 +215814,11 @@ function dpxCookieHeader(raw) {
|
|
|
215695
215814
|
const trimmed = raw.trim();
|
|
215696
215815
|
try {
|
|
215697
215816
|
const json9 = Buffer.from(trimmed, "base64url").toString("utf8");
|
|
215698
|
-
const
|
|
215699
|
-
if (
|
|
215817
|
+
const obj13 = JSON.parse(json9);
|
|
215818
|
+
if (obj13 && typeof obj13 === "object") {
|
|
215700
215819
|
const pairs2 = [
|
|
215701
|
-
typeof
|
|
215702
|
-
typeof
|
|
215820
|
+
typeof obj13.wewix === "string" ? `${BO_WEWIX_COOKIE}=${obj13.wewix}` : void 0,
|
|
215821
|
+
typeof obj13.bo === "string" ? `${BO_COOKIE}=${obj13.bo}` : void 0
|
|
215703
215822
|
].filter((pair) => pair !== void 0);
|
|
215704
215823
|
if (pairs2.length) return pairs2.join("; ");
|
|
215705
215824
|
}
|
|
@@ -219952,7 +220071,7 @@ async function distCommand(ctx) {
|
|
|
219952
220071
|
const app2 = typeof job.app === "string" ? job.app : void 0;
|
|
219953
220072
|
const jobId = typeof job.jobId === "string" ? job.jobId : void 0;
|
|
219954
220073
|
if (!player || !app2 || !jobId) return;
|
|
219955
|
-
const render2 = (label3, payload,
|
|
220074
|
+
const render2 = (label3, payload, literal2) => {
|
|
219956
220075
|
io2.log(`
|
|
219957
220076
|
${label3}`);
|
|
219958
220077
|
try {
|
|
@@ -219963,7 +220082,7 @@ ${label3}`);
|
|
|
219963
220082
|
io2.log(" QR omitted (link is too long)");
|
|
219964
220083
|
}
|
|
219965
220084
|
io2.log(` ${payload}`);
|
|
219966
|
-
if (
|
|
220085
|
+
if (literal2 && literal2 !== payload) io2.log(` ${literal2}`);
|
|
219967
220086
|
};
|
|
219968
220087
|
render2(" Himi Player", player);
|
|
219969
220088
|
if (job.status !== "SUCCESS") return;
|