@superdoc-dev/mcp 0.11.0-next.12 → 0.11.0-next.13

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.
Files changed (2) hide show
  1. package/dist/index.js +1296 -1023
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -169073,6 +169073,1231 @@ var __plugin_vue_export_helper_default = (sfc, props) => {
169073
169073
  };
169074
169074
  var init__plugin_vue_export_helper_5t5P5NuM_es = () => {};
169075
169075
 
169076
+ // ../../packages/superdoc/dist/chunks/create-super-doc-ui-tVaowTvG.es.js
169077
+ function isSettled(status) {
169078
+ return SETTLED_STATUSES.includes(status);
169079
+ }
169080
+ function normalizeFamilyKey$1(family$1) {
169081
+ return family$1.trim().replace(/^["']|["']$/g, "").toLowerCase();
169082
+ }
169083
+ function deriveBundledSubstitutes() {
169084
+ const substitutes = {};
169085
+ for (const row of SUBSTITUTION_EVIDENCE)
169086
+ if (row.policyAction === "substitute" && row.physicalFamily)
169087
+ substitutes[normalizeFamilyKey$1(row.logicalFamily)] = row.physicalFamily;
169088
+ return Object.freeze(substitutes);
169089
+ }
169090
+ function deriveCategoryFallbacks() {
169091
+ const fallbacks = {};
169092
+ for (const row of SUBSTITUTION_EVIDENCE)
169093
+ if (row.policyAction === "category_fallback" && row.physicalFamily)
169094
+ fallbacks[normalizeFamilyKey$1(row.logicalFamily)] = row.physicalFamily;
169095
+ return Object.freeze(fallbacks);
169096
+ }
169097
+ function stripFamilyQuotes(family$1) {
169098
+ return family$1.trim().replace(/^["']|["']$/g, "");
169099
+ }
169100
+ function splitStack(cssFontFamily) {
169101
+ return cssFontFamily.split(",").map((part) => part.trim()).filter(Boolean);
169102
+ }
169103
+ function createFontResolver() {
169104
+ return new FontResolver;
169105
+ }
169106
+ function resolveFontFamily2(logicalFamily) {
169107
+ return defaultResolver.resolveFontFamily(logicalFamily);
169108
+ }
169109
+ function resolvePhysicalFamily(cssFontFamily) {
169110
+ return defaultResolver.resolvePhysicalFamily(cssFontFamily);
169111
+ }
169112
+ function resolveFace(logicalFamily, face, hasFace) {
169113
+ return defaultResolver.resolveFace(logicalFamily, face, hasFace);
169114
+ }
169115
+ function getFontConfigVersion() {
169116
+ return fontConfigVersion;
169117
+ }
169118
+ function bumpFontConfigVersion() {
169119
+ return fontConfigVersion += 1;
169120
+ }
169121
+ function fourFaces(filePrefix) {
169122
+ return [
169123
+ {
169124
+ weight: "normal",
169125
+ style: "normal",
169126
+ file: `${filePrefix}-Regular.woff2`
169127
+ },
169128
+ {
169129
+ weight: "bold",
169130
+ style: "normal",
169131
+ file: `${filePrefix}-Bold.woff2`
169132
+ },
169133
+ {
169134
+ weight: "normal",
169135
+ style: "italic",
169136
+ file: `${filePrefix}-Italic.woff2`
169137
+ },
169138
+ {
169139
+ weight: "bold",
169140
+ style: "italic",
169141
+ file: `${filePrefix}-BoldItalic.woff2`
169142
+ }
169143
+ ];
169144
+ }
169145
+ function family(name, filePrefix, license) {
169146
+ return {
169147
+ family: name,
169148
+ license,
169149
+ faces: fourFaces(filePrefix)
169150
+ };
169151
+ }
169152
+ function withTrailingSlash(base2) {
169153
+ return base2.endsWith("/") ? base2 : `${base2}/`;
169154
+ }
169155
+ function joinUrl(base2, file2) {
169156
+ return `${withTrailingSlash(base2)}${file2}`;
169157
+ }
169158
+ function weightToken(weight) {
169159
+ return weight === "bold" ? "700" : "400";
169160
+ }
169161
+ function bundledAssetSignature(resolve) {
169162
+ const family$1 = BUNDLED_MANIFEST[0];
169163
+ const face = family$1?.faces[0];
169164
+ if (!family$1 || !face)
169165
+ return "";
169166
+ return resolve({
169167
+ file: face.file,
169168
+ family: family$1.family,
169169
+ weight: weightToken(face.weight),
169170
+ style: face.style,
169171
+ source: "bundled-substitute"
169172
+ });
169173
+ }
169174
+ function installBundledSubstitutes(registry3, options = {}) {
169175
+ const resolve = options.resolveAssetUrl ?? ((context) => joinUrl(options.assetBaseUrl ?? defaultAssetBase, context.file));
169176
+ const signature = bundledAssetSignature(resolve);
169177
+ const installed = installedRegistries.get(registry3);
169178
+ if (installed !== undefined) {
169179
+ if (installed !== signature)
169180
+ console.warn(`[superdoc] bundled fonts are already registered for this document from "${installed}"; a later fonts config resolving to "${signature}" is ignored. Use one fonts.assetBaseUrl / fonts.resolveAssetUrl per document.`);
169181
+ return;
169182
+ }
169183
+ installedRegistries.set(registry3, signature);
169184
+ for (const family$1 of BUNDLED_MANIFEST)
169185
+ for (const face of family$1.faces) {
169186
+ const context = {
169187
+ file: face.file,
169188
+ family: family$1.family,
169189
+ weight: weightToken(face.weight),
169190
+ style: face.style,
169191
+ source: "bundled-substitute"
169192
+ };
169193
+ registry3.register({
169194
+ family: family$1.family,
169195
+ source: `url(${resolve(context)})`,
169196
+ descriptors: {
169197
+ weight: face.weight,
169198
+ style: face.style
169199
+ }
169200
+ });
169201
+ }
169202
+ }
169203
+ function buildFontReport(logicalFamilies, registry3, resolver2) {
169204
+ const seen = /* @__PURE__ */ new Set;
169205
+ const report = [];
169206
+ for (const logical of logicalFamilies) {
169207
+ if (!logical || seen.has(logical))
169208
+ continue;
169209
+ seen.add(logical);
169210
+ const { physicalFamily, reason } = resolver2 ? resolver2.resolveFontFamily(logical) : resolveFontFamily2(logical);
169211
+ const loadStatus = registry3.getStatus(physicalFamily);
169212
+ report.push({
169213
+ logicalFamily: logical,
169214
+ physicalFamily,
169215
+ reason,
169216
+ loadStatus,
169217
+ exportFamily: logical,
169218
+ missing: reason === "category_fallback" || isSettled(loadStatus) && loadStatus !== "loaded"
169219
+ });
169220
+ }
169221
+ return report;
169222
+ }
169223
+ function buildFaceReport(usedFaces, registry3, resolver2) {
169224
+ const hasFace = (family$1, weight, style) => registry3.hasFace(family$1, weight, style);
169225
+ const seen = /* @__PURE__ */ new Set;
169226
+ const report = [];
169227
+ for (const { logicalFamily, weight, style } of usedFaces) {
169228
+ if (!logicalFamily)
169229
+ continue;
169230
+ const key2 = `${logicalFamily.toLowerCase()}|${weight}|${style}`;
169231
+ if (seen.has(key2))
169232
+ continue;
169233
+ seen.add(key2);
169234
+ const face = {
169235
+ weight,
169236
+ style
169237
+ };
169238
+ const { physicalFamily, reason } = resolver2 ? resolver2.resolveFace(logicalFamily, face, hasFace) : resolveFace(logicalFamily, face, hasFace);
169239
+ const loadStatus = registry3.getFaceStatus({
169240
+ family: physicalFamily,
169241
+ weight,
169242
+ style
169243
+ });
169244
+ const missing = reason === "fallback_face_absent" || reason === "category_fallback" || isSettled(loadStatus) && loadStatus !== "loaded";
169245
+ report.push({
169246
+ logicalFamily,
169247
+ physicalFamily,
169248
+ reason,
169249
+ loadStatus,
169250
+ exportFamily: logicalFamily,
169251
+ missing,
169252
+ face
169253
+ });
169254
+ }
169255
+ return report;
169256
+ }
169257
+ function quoteFamily(family$1) {
169258
+ return `"${family$1.replace(/\\/g, "\\\\").replace(/"/g, "\\\"")}"`;
169259
+ }
169260
+ function canonicalizeFontSource(source) {
169261
+ const match = /^\s*url\(\s*([\s\S]*?)\s*\)\s*$/i.exec(source);
169262
+ if (!match)
169263
+ return source;
169264
+ let inner = match[1].trim();
169265
+ if (inner.startsWith('"') && inner.endsWith('"') || inner.startsWith("'") && inner.endsWith("'"))
169266
+ inner = inner.slice(1, -1);
169267
+ return `url(${JSON.stringify(inner)})`;
169268
+ }
169269
+ function normalizeFamilyKey(family$1) {
169270
+ return family$1.trim().replace(/^["']|["']$/g, "").toLowerCase();
169271
+ }
169272
+ function normalizeWeight(weight) {
169273
+ if (weight === undefined)
169274
+ return "400";
169275
+ const w = String(weight).trim().toLowerCase();
169276
+ if (w === "bold" || w === "bolder")
169277
+ return "700";
169278
+ const n = Number(w);
169279
+ return Number.isFinite(n) && n >= 600 ? "700" : "400";
169280
+ }
169281
+ function normalizeStyle(style) {
169282
+ if (!style)
169283
+ return "normal";
169284
+ const s = style.trim().toLowerCase();
169285
+ return s.startsWith("italic") || s.startsWith("oblique") ? "italic" : "normal";
169286
+ }
169287
+ function faceKeyOf(family$1, weight, style) {
169288
+ return `${normalizeFamilyKey(family$1)}|${weight}|${style}`;
169289
+ }
169290
+ function faceProbe(family$1, weight, style, size) {
169291
+ return `${style === "italic" ? "italic " : ""}${weight} ${size} ${quoteFamily(family$1)}`;
169292
+ }
169293
+ function getFontRegistryFor(fontSet, FontFaceCtor) {
169294
+ if (!fontSet) {
169295
+ if (!domlessRegistry)
169296
+ domlessRegistry = new FontRegistry({});
169297
+ return domlessRegistry;
169298
+ }
169299
+ let registry3 = registriesByFontSet.get(fontSet);
169300
+ if (!registry3) {
169301
+ registry3 = new FontRegistry({
169302
+ fontSet,
169303
+ FontFaceCtor
169304
+ });
169305
+ registriesByFontSet.set(fontSet, registry3);
169306
+ }
169307
+ return registry3;
169308
+ }
169309
+ function classifyOffering(policyAction, verdict, physicalFamily, bundled) {
169310
+ if (policyAction === "preserve_only")
169311
+ return "preserve_only";
169312
+ if (policyAction === "customer_supplied" || physicalFamily == null)
169313
+ return "customer_supplied";
169314
+ if (policyAction === "category_fallback")
169315
+ return "category_fallback";
169316
+ if (!bundled)
169317
+ return "requires_asset";
169318
+ return verdict === "metric_safe" ? "default" : "qualified";
169319
+ }
169320
+ function deriveOfferings() {
169321
+ const offerings = SUBSTITUTION_EVIDENCE.map((row) => {
169322
+ const bundled = row.physicalFamily != null && BUNDLED_FAMILIES.has(row.physicalFamily);
169323
+ return {
169324
+ logicalFamily: row.logicalFamily,
169325
+ physicalFamily: row.physicalFamily,
169326
+ generic: row.physicalFamily && PHYSICAL_GENERIC[row.physicalFamily] || "sans-serif",
169327
+ offering: classifyOffering(row.policyAction, row.verdict, row.physicalFamily, bundled),
169328
+ bundled,
169329
+ verdict: row.verdict,
169330
+ evidenceId: row.evidenceId
169331
+ };
169332
+ });
169333
+ return Object.freeze(offerings);
169334
+ }
169335
+ function getDefaultFontOfferings() {
169336
+ const rank = (name) => {
169337
+ const i4 = DEFAULT_FONT_ORDER.indexOf(name);
169338
+ return i4 === -1 ? DEFAULT_FONT_ORDER.length : i4;
169339
+ };
169340
+ return FONT_OFFERINGS.filter((o) => o.offering === "default").sort((a, b) => rank(a.logicalFamily) - rank(b.logicalFamily));
169341
+ }
169342
+ function fontOfferingStack(offering) {
169343
+ return `${offering.logicalFamily}, ${offering.generic}`;
169344
+ }
169345
+ function fontOfferingRenderStack(offering) {
169346
+ return offering.physicalFamily ? `${offering.physicalFamily}, ${offering.generic}` : fontOfferingStack(offering);
169347
+ }
169348
+ function getDefaultFontFamilyOptions() {
169349
+ return getDefaultFontOfferings().map((offering) => ({
169350
+ label: offering.logicalFamily,
169351
+ value: fontOfferingStack(offering)
169352
+ }));
169353
+ }
169354
+ var SETTLED_STATUSES, SUBSTITUTION_EVIDENCE, BUNDLED_SUBSTITUTES, CATEGORY_FALLBACKS, FontResolver = class {
169355
+ #overrides = /* @__PURE__ */ new Map;
169356
+ #version = 0;
169357
+ #cachedSignature = null;
169358
+ map(logicalFamily, physicalFamily) {
169359
+ const key2 = normalizeFamilyKey$1(logicalFamily);
169360
+ const physical = physicalFamily?.trim();
169361
+ if (!key2 || !physical)
169362
+ return;
169363
+ if (this.#overrides.get(key2) === physical)
169364
+ return;
169365
+ if (key2 === normalizeFamilyKey$1(physical)) {
169366
+ if (this.#overrides.delete(key2)) {
169367
+ this.#version += 1;
169368
+ this.#cachedSignature = null;
169369
+ }
169370
+ return;
169371
+ }
169372
+ this.#overrides.set(key2, physical);
169373
+ this.#version += 1;
169374
+ this.#cachedSignature = null;
169375
+ }
169376
+ unmap(logicalFamily) {
169377
+ if (this.#overrides.delete(normalizeFamilyKey$1(logicalFamily))) {
169378
+ this.#version += 1;
169379
+ this.#cachedSignature = null;
169380
+ }
169381
+ }
169382
+ reset() {
169383
+ if (this.#overrides.size === 0)
169384
+ return;
169385
+ this.#overrides.clear();
169386
+ this.#version += 1;
169387
+ this.#cachedSignature = null;
169388
+ }
169389
+ get version() {
169390
+ return this.#version;
169391
+ }
169392
+ get signature() {
169393
+ if (this.#cachedSignature !== null)
169394
+ return this.#cachedSignature;
169395
+ this.#cachedSignature = this.#overrides.size === 0 ? "" : JSON.stringify([...this.#overrides.entries()].sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0));
169396
+ return this.#cachedSignature;
169397
+ }
169398
+ #physicalFor(bareFamily) {
169399
+ const key2 = normalizeFamilyKey$1(bareFamily);
169400
+ const override = this.#overrides.get(key2);
169401
+ if (override)
169402
+ return {
169403
+ physical: override,
169404
+ reason: "custom_mapping"
169405
+ };
169406
+ const bundled = BUNDLED_SUBSTITUTES[key2];
169407
+ if (bundled)
169408
+ return {
169409
+ physical: bundled,
169410
+ reason: "bundled_substitute"
169411
+ };
169412
+ const category = CATEGORY_FALLBACKS[key2];
169413
+ if (category)
169414
+ return {
169415
+ physical: category,
169416
+ reason: "category_fallback"
169417
+ };
169418
+ return {
169419
+ physical: bareFamily,
169420
+ reason: "as_requested"
169421
+ };
169422
+ }
169423
+ #resolveFaceLadder(primary, face, hasFace) {
169424
+ const key2 = normalizeFamilyKey$1(primary);
169425
+ const override = this.#overrides.get(key2);
169426
+ if (override && hasFace(override, face.weight, face.style))
169427
+ return {
169428
+ physical: override,
169429
+ reason: "custom_mapping"
169430
+ };
169431
+ if (hasFace(primary, face.weight, face.style))
169432
+ return {
169433
+ physical: primary,
169434
+ reason: "registered_face"
169435
+ };
169436
+ const bundled = BUNDLED_SUBSTITUTES[key2];
169437
+ if (bundled && hasFace(bundled, face.weight, face.style))
169438
+ return {
169439
+ physical: bundled,
169440
+ reason: "bundled_substitute"
169441
+ };
169442
+ const category = CATEGORY_FALLBACKS[key2];
169443
+ if (category && hasFace(category, face.weight, face.style))
169444
+ return {
169445
+ physical: category,
169446
+ reason: "category_fallback"
169447
+ };
169448
+ if (override || bundled)
169449
+ return {
169450
+ physical: primary,
169451
+ reason: "fallback_face_absent"
169452
+ };
169453
+ return {
169454
+ physical: primary,
169455
+ reason: "as_requested"
169456
+ };
169457
+ }
169458
+ resolveFontFamily(logicalFamily) {
169459
+ const primary = splitStack(logicalFamily)[0] ?? logicalFamily;
169460
+ const { physical, reason } = this.#physicalFor(primary);
169461
+ return {
169462
+ logicalFamily,
169463
+ physicalFamily: stripFamilyQuotes(physical),
169464
+ reason
169465
+ };
169466
+ }
169467
+ resolvePhysicalFamily(cssFontFamily) {
169468
+ if (!cssFontFamily)
169469
+ return cssFontFamily;
169470
+ const parts = splitStack(cssFontFamily);
169471
+ if (parts.length === 0)
169472
+ return cssFontFamily;
169473
+ const { physical, reason } = this.#physicalFor(parts[0]);
169474
+ if (reason === "as_requested")
169475
+ return cssFontFamily;
169476
+ return [physical, ...parts.slice(1)].join(", ");
169477
+ }
169478
+ resolveFace(logicalFamily, face, hasFace) {
169479
+ const primary = splitStack(logicalFamily)[0] ?? logicalFamily;
169480
+ const { physical, reason } = this.#resolveFaceLadder(primary, face, hasFace);
169481
+ return {
169482
+ logicalFamily,
169483
+ physicalFamily: stripFamilyQuotes(physical),
169484
+ reason
169485
+ };
169486
+ }
169487
+ resolvePhysicalFamilyForFace(cssFontFamily, face, hasFace) {
169488
+ if (!cssFontFamily)
169489
+ return cssFontFamily;
169490
+ const parts = splitStack(cssFontFamily);
169491
+ if (parts.length === 0)
169492
+ return cssFontFamily;
169493
+ const { physical } = this.#resolveFaceLadder(parts[0], face, hasFace);
169494
+ if (normalizeFamilyKey$1(physical) !== normalizeFamilyKey$1(parts[0]))
169495
+ return [physical, ...parts.slice(1)].join(", ");
169496
+ return cssFontFamily;
169497
+ }
169498
+ resolvePrimaryPhysicalFamily(family$1) {
169499
+ const primary = splitStack(family$1)[0] ?? family$1;
169500
+ return this.#physicalFor(primary).physical;
169501
+ }
169502
+ resolvePhysicalFamilies(families) {
169503
+ const out = /* @__PURE__ */ new Set;
169504
+ for (const family$1 of families)
169505
+ if (family$1)
169506
+ out.add(this.resolvePrimaryPhysicalFamily(family$1));
169507
+ return [...out];
169508
+ }
169509
+ }, defaultResolver, DEFAULT_FONT_MEASURE_CONTEXT, fontConfigVersion = 0, BUNDLED_MANIFEST, defaultAssetBase = "/fonts/", installedRegistries, DEFAULT_FONT_LOAD_TIMEOUT_MS = 3000, DEFAULT_PROBE_SIZE = "16px", FontRegistry = class {
169510
+ #fontSet;
169511
+ #FontFaceCtor;
169512
+ #probeSize;
169513
+ #scheduleTimeout;
169514
+ #cancelTimeout;
169515
+ #managed = /* @__PURE__ */ new Map;
169516
+ #status = /* @__PURE__ */ new Map;
169517
+ #sources = /* @__PURE__ */ new Map;
169518
+ #warnedFailures = /* @__PURE__ */ new Set;
169519
+ #inflight = /* @__PURE__ */ new Map;
169520
+ #faceStatus = /* @__PURE__ */ new Map;
169521
+ #faceInflight = /* @__PURE__ */ new Map;
169522
+ #faceSources = /* @__PURE__ */ new Map;
169523
+ #facesByFamily = /* @__PURE__ */ new Map;
169524
+ #providerFaceKeys = /* @__PURE__ */ new Set;
169525
+ #warnedFaceFailures = /* @__PURE__ */ new Set;
169526
+ constructor(options = {}) {
169527
+ this.#fontSet = options.fontSet ?? null;
169528
+ this.#FontFaceCtor = options.FontFaceCtor ?? null;
169529
+ this.#probeSize = options.probeSize ?? DEFAULT_PROBE_SIZE;
169530
+ this.#scheduleTimeout = options.scheduleTimeout ?? ((cb, ms) => globalThis.setTimeout(cb, ms));
169531
+ this.#cancelTimeout = options.cancelTimeout ?? ((handle2) => globalThis.clearTimeout(handle2));
169532
+ }
169533
+ register(descriptor) {
169534
+ const { family: family$1, source, descriptors: descriptors2 } = descriptor;
169535
+ const identitySource = typeof source === "string" ? canonicalizeFontSource(source) : source;
169536
+ const weight = normalizeWeight(descriptors2?.weight);
169537
+ const style = normalizeStyle(descriptors2?.style);
169538
+ const key2 = faceKeyOf(family$1, weight, style);
169539
+ if (typeof identitySource === "string") {
169540
+ const existingSource = this.#faceSources.get(key2);
169541
+ if (existingSource === identitySource)
169542
+ return {
169543
+ family: family$1,
169544
+ status: this.getStatus(family$1),
169545
+ changed: false
169546
+ };
169547
+ if (existingSource !== undefined)
169548
+ throw new Error(`[superdoc] font face "${key2}" is already registered from a different source ("${existingSource}"); a registered face's source cannot be replaced`);
169549
+ }
169550
+ if (this.#FontFaceCtor && this.#fontSet) {
169551
+ const face = new this.#FontFaceCtor(family$1, source, {
169552
+ ...descriptors2,
169553
+ weight,
169554
+ style
169555
+ });
169556
+ this.#fontSet.add(face);
169557
+ this.#managed.set(family$1, face);
169558
+ }
169559
+ if (typeof source === "string") {
169560
+ const list4 = this.#sources.get(family$1) ?? [];
169561
+ if (!list4.includes(source))
169562
+ list4.push(source);
169563
+ this.#sources.set(family$1, list4);
169564
+ }
169565
+ if (!this.#status.has(family$1))
169566
+ this.#status.set(family$1, "unloaded");
169567
+ this.#providerFaceKeys.add(key2);
169568
+ this.#trackFace(family$1, key2);
169569
+ if (!this.#faceStatus.has(key2))
169570
+ this.#faceStatus.set(key2, "unloaded");
169571
+ if (typeof identitySource === "string" && !this.#faceSources.has(key2))
169572
+ this.#faceSources.set(key2, identitySource);
169573
+ return {
169574
+ family: family$1,
169575
+ status: this.getStatus(family$1),
169576
+ changed: true
169577
+ };
169578
+ }
169579
+ #trackFace(family$1, key2) {
169580
+ const fam = normalizeFamilyKey(family$1);
169581
+ const set3 = this.#facesByFamily.get(fam) ?? /* @__PURE__ */ new Set;
169582
+ set3.add(key2);
169583
+ this.#facesByFamily.set(fam, set3);
169584
+ }
169585
+ isManaged(family$1) {
169586
+ return this.#managed.has(family$1);
169587
+ }
169588
+ getStatus(family$1) {
169589
+ const statuses = [];
169590
+ const faceKeys = this.#facesByFamily.get(normalizeFamilyKey(family$1));
169591
+ if (faceKeys)
169592
+ for (const k of faceKeys)
169593
+ statuses.push(this.#faceStatus.get(k) ?? "unloaded");
169594
+ const legacy = this.#status.get(family$1);
169595
+ if (legacy)
169596
+ statuses.push(legacy);
169597
+ if (statuses.length === 0)
169598
+ return "unloaded";
169599
+ for (const s of [
169600
+ "failed",
169601
+ "timed_out",
169602
+ "fallback_used",
169603
+ "loaded",
169604
+ "loading",
169605
+ "unloaded"
169606
+ ])
169607
+ if (statuses.includes(s))
169608
+ return s;
169609
+ return "unloaded";
169610
+ }
169611
+ hasFace(family$1, weight, style) {
169612
+ const key2 = faceKeyOf(family$1, weight, style);
169613
+ return this.#providerFaceKeys.has(key2) && this.#faceStatus.get(key2) !== "failed";
169614
+ }
169615
+ isAvailable(family$1) {
169616
+ if (!this.#fontSet)
169617
+ return false;
169618
+ try {
169619
+ return this.#fontSet.check(`${this.#probeSize} ${quoteFamily(family$1)}`);
169620
+ } catch {
169621
+ return false;
169622
+ }
169623
+ }
169624
+ awaitFace(family$1, timeoutMs = DEFAULT_FONT_LOAD_TIMEOUT_MS) {
169625
+ if (this.#status.get(family$1) === "loaded")
169626
+ return Promise.resolve({
169627
+ family: family$1,
169628
+ status: "loaded"
169629
+ });
169630
+ const existing = this.#inflight.get(family$1);
169631
+ if (existing)
169632
+ return existing;
169633
+ const probe = this.#loadOne(family$1, timeoutMs).finally(() => {
169634
+ this.#inflight.delete(family$1);
169635
+ });
169636
+ this.#inflight.set(family$1, probe);
169637
+ return probe;
169638
+ }
169639
+ async awaitFaces(families, options = {}) {
169640
+ const unique = [...new Set(families)];
169641
+ const timeoutMs = options.timeoutMs ?? 3000;
169642
+ return Promise.all(unique.map((family$1) => this.awaitFace(family$1, timeoutMs)));
169643
+ }
169644
+ getRequiredFaces(families, timeoutMs = DEFAULT_FONT_LOAD_TIMEOUT_MS) {
169645
+ return [...new Set(families)].map((family$1) => ({
169646
+ family: family$1,
169647
+ status: this.getStatus(family$1),
169648
+ ready: this.awaitFace(family$1, timeoutMs)
169649
+ }));
169650
+ }
169651
+ getStates() {
169652
+ return [...this.#status.entries()].map(([family$1, status]) => ({
169653
+ family: family$1,
169654
+ status
169655
+ }));
169656
+ }
169657
+ getFaceStatus(request) {
169658
+ return this.#faceStatus.get(faceKeyOf(request.family, request.weight, request.style)) ?? "unloaded";
169659
+ }
169660
+ awaitFaceRequest(request, timeoutMs = DEFAULT_FONT_LOAD_TIMEOUT_MS) {
169661
+ const key2 = faceKeyOf(request.family, request.weight, request.style);
169662
+ if (this.#faceStatus.get(key2) === "loaded")
169663
+ return Promise.resolve({
169664
+ request,
169665
+ status: "loaded"
169666
+ });
169667
+ const existing = this.#faceInflight.get(key2);
169668
+ if (existing)
169669
+ return existing;
169670
+ const probe = this.#loadOneFace(request, key2, timeoutMs).finally(() => {
169671
+ this.#faceInflight.delete(key2);
169672
+ });
169673
+ this.#faceInflight.set(key2, probe);
169674
+ return probe;
169675
+ }
169676
+ async awaitFaceRequests(requests, options = {}) {
169677
+ const timeoutMs = options.timeoutMs ?? 3000;
169678
+ const seen = /* @__PURE__ */ new Set;
169679
+ const unique = [];
169680
+ for (const r of requests) {
169681
+ const key2 = faceKeyOf(r.family, r.weight, r.style);
169682
+ if (seen.has(key2))
169683
+ continue;
169684
+ seen.add(key2);
169685
+ unique.push(r);
169686
+ }
169687
+ return Promise.all(unique.map((r) => this.awaitFaceRequest(r, timeoutMs)));
169688
+ }
169689
+ async#loadOneFace(request, key2, timeoutMs) {
169690
+ this.#trackFace(request.family, key2);
169691
+ const fontSet = this.#fontSet;
169692
+ if (!fontSet) {
169693
+ this.#faceStatus.set(key2, "fallback_used");
169694
+ return {
169695
+ request,
169696
+ status: "fallback_used"
169697
+ };
169698
+ }
169699
+ this.#faceStatus.set(key2, "loading");
169700
+ const probe = faceProbe(request.family, request.weight, request.style, this.#probeSize);
169701
+ const TIMEOUT = Symbol("timeout");
169702
+ let handle2;
169703
+ const timeout = new Promise((resolve) => {
169704
+ handle2 = this.#scheduleTimeout(() => resolve(TIMEOUT), timeoutMs);
169705
+ });
169706
+ try {
169707
+ const settled = await Promise.race([fontSet.load(probe), timeout]);
169708
+ if (settled === TIMEOUT) {
169709
+ this.#faceStatus.set(key2, "timed_out");
169710
+ return {
169711
+ request,
169712
+ status: "timed_out"
169713
+ };
169714
+ }
169715
+ const status = settled.length > 0 ? "loaded" : "fallback_used";
169716
+ this.#faceStatus.set(key2, status);
169717
+ return {
169718
+ request,
169719
+ status
169720
+ };
169721
+ } catch {
169722
+ this.#faceStatus.set(key2, "failed");
169723
+ this.#warnFaceFailureOnce(request, key2);
169724
+ return {
169725
+ request,
169726
+ status: "failed"
169727
+ };
169728
+ } finally {
169729
+ this.#cancelTimeout(handle2);
169730
+ }
169731
+ }
169732
+ #warnFaceFailureOnce(request, key2) {
169733
+ if (this.#warnedFaceFailures.has(key2))
169734
+ return;
169735
+ this.#warnedFaceFailures.add(key2);
169736
+ const src = this.#faceSources.get(key2);
169737
+ const detail = src ? ` from ${src}` : "";
169738
+ console.warn(`[superdoc] font face failed to load: "${request.family}" ${request.weight} ${request.style}${detail}. Check fonts.assetBaseUrl / fonts.resolveAssetUrl so the bundled .woff2 are served.`);
169739
+ }
169740
+ async#loadOne(family$1, timeoutMs) {
169741
+ const fontSet = this.#fontSet;
169742
+ if (!fontSet) {
169743
+ this.#status.set(family$1, "fallback_used");
169744
+ return {
169745
+ family: family$1,
169746
+ status: "fallback_used"
169747
+ };
169748
+ }
169749
+ this.#status.set(family$1, "loading");
169750
+ const probe = `${this.#probeSize} ${quoteFamily(family$1)}`;
169751
+ const TIMEOUT = Symbol("timeout");
169752
+ let handle2;
169753
+ const timeout = new Promise((resolve) => {
169754
+ handle2 = this.#scheduleTimeout(() => resolve(TIMEOUT), timeoutMs);
169755
+ });
169756
+ try {
169757
+ const settled = await Promise.race([fontSet.load(probe), timeout]);
169758
+ if (settled === TIMEOUT) {
169759
+ this.#status.set(family$1, "timed_out");
169760
+ return {
169761
+ family: family$1,
169762
+ status: "timed_out"
169763
+ };
169764
+ }
169765
+ const status = settled.length > 0 ? "loaded" : "fallback_used";
169766
+ this.#status.set(family$1, status);
169767
+ return {
169768
+ family: family$1,
169769
+ status
169770
+ };
169771
+ } catch {
169772
+ this.#status.set(family$1, "failed");
169773
+ this.#warnLoadFailureOnce(family$1);
169774
+ return {
169775
+ family: family$1,
169776
+ status: "failed"
169777
+ };
169778
+ } finally {
169779
+ this.#cancelTimeout(handle2);
169780
+ }
169781
+ }
169782
+ #warnLoadFailureOnce(family$1) {
169783
+ if (this.#warnedFailures.has(family$1))
169784
+ return;
169785
+ this.#warnedFailures.add(family$1);
169786
+ const sources = this.#sources.get(family$1);
169787
+ const detail = sources && sources.length ? ` from ${sources.join(", ")}` : "";
169788
+ console.warn(`[superdoc] font asset failed to load for "${family$1}"${detail}. Check fonts.assetBaseUrl / fonts.resolveAssetUrl so the bundled .woff2 are served.`);
169789
+ }
169790
+ }, registriesByFontSet, domlessRegistry = null, PHYSICAL_GENERIC, BUNDLED_FAMILIES, FONT_OFFERINGS, DEFAULT_FONT_ORDER, headlessToolbarConstants, MOD_ALIASES, ALT_ALIASES, CTRL_ALIASES, SHIFT_ALIASES, BUILTIN_CONTEXT_MENU_GROUPS, BUILTIN_GROUP_ORDER, RESERVED_PROXY_PROPERTY_NAMES, ALL_TOOLBAR_COMMAND_IDS, EMPTY_ACTIVE_IDS;
169791
+ var init_create_super_doc_ui_tVaowTvG_es = __esm(() => {
169792
+ init_SuperConverter_bEQ45IUD_es();
169793
+ init_create_headless_toolbar_BmFWtej0_es();
169794
+ SETTLED_STATUSES = [
169795
+ "loaded",
169796
+ "failed",
169797
+ "timed_out",
169798
+ "fallback_used"
169799
+ ];
169800
+ SUBSTITUTION_EVIDENCE = Object.freeze([
169801
+ {
169802
+ evidenceId: "calibri",
169803
+ logicalFamily: "Calibri",
169804
+ physicalFamily: "Carlito",
169805
+ verdict: "metric_safe",
169806
+ faces: {
169807
+ regular: true,
169808
+ bold: true,
169809
+ italic: true,
169810
+ boldItalic: true
169811
+ },
169812
+ advance: {
169813
+ meanDelta: 0,
169814
+ maxDelta: 0
169815
+ },
169816
+ gates: {
169817
+ static: "pass",
169818
+ metric: "pass",
169819
+ layout: "pass",
169820
+ ship: "pass"
169821
+ },
169822
+ policyAction: "substitute",
169823
+ measurementRefs: ["calibri__carlito#analytic_advance#2026-06-03", "calibri__carlito#face_aggregate#2026-06-03"],
169824
+ candidateLicense: "OFL-1.1",
169825
+ exportRule: "preserve_original_name"
169826
+ },
169827
+ {
169828
+ evidenceId: "cambria",
169829
+ logicalFamily: "Cambria",
169830
+ physicalFamily: "Caladea",
169831
+ verdict: "visual_only",
169832
+ faceVerdicts: {
169833
+ regular: "metric_safe",
169834
+ bold: "metric_safe",
169835
+ italic: "metric_safe",
169836
+ boldItalic: "visual_only"
169837
+ },
169838
+ glyphExceptions: [{
169839
+ slot: "boldItalic",
169840
+ codepoint: 96,
169841
+ advanceDelta: 0.231,
169842
+ note: "Caladea Bold Italic grave accent (U+0060) advance diverges ~23% from Cambria; lines containing it reflow."
169843
+ }],
169844
+ faces: {
169845
+ regular: true,
169846
+ bold: true,
169847
+ italic: true,
169848
+ boldItalic: true
169849
+ },
169850
+ advance: {
169851
+ meanDelta: 0.0002378,
169852
+ maxDelta: 0.2310758
169853
+ },
169854
+ gates: {
169855
+ static: "pass",
169856
+ metric: "pass",
169857
+ layout: "not_run",
169858
+ ship: "pass"
169859
+ },
169860
+ policyAction: "substitute",
169861
+ measurementRefs: [
169862
+ "cambria_regular__caladea#regular#w400#d2f6cad3#analytic_advance#2026-06-04",
169863
+ "cambria_bold__caladea#bold#w700#74eda4fc#analytic_advance#2026-06-04",
169864
+ "cambria_italic__caladea#italic#w400#9c968bf6#analytic_advance#2026-06-04",
169865
+ "cambria_boldItalic__caladea#boldItalic#w700#f47a35ad#analytic_advance#2026-06-04"
169866
+ ],
169867
+ candidateLicense: "Apache-2.0",
169868
+ exportRule: "preserve_original_name"
169869
+ },
169870
+ {
169871
+ evidenceId: "arial",
169872
+ logicalFamily: "Arial",
169873
+ physicalFamily: "Liberation Sans",
169874
+ verdict: "metric_safe",
169875
+ faces: {
169876
+ regular: true,
169877
+ bold: true,
169878
+ italic: true,
169879
+ boldItalic: true
169880
+ },
169881
+ advance: {
169882
+ meanDelta: 0,
169883
+ maxDelta: 0
169884
+ },
169885
+ gates: {
169886
+ static: "pass",
169887
+ metric: "pass",
169888
+ layout: "not_run",
169889
+ ship: "pass"
169890
+ },
169891
+ policyAction: "substitute",
169892
+ measurementRefs: ["arial__liberation-sans#analytic_advance#2026-06-03"],
169893
+ candidateLicense: "OFL-1.1",
169894
+ exportRule: "preserve_original_name"
169895
+ },
169896
+ {
169897
+ evidenceId: "times-new-roman",
169898
+ logicalFamily: "Times New Roman",
169899
+ physicalFamily: "Liberation Serif",
169900
+ verdict: "metric_safe",
169901
+ faces: {
169902
+ regular: true,
169903
+ bold: true,
169904
+ italic: true,
169905
+ boldItalic: true
169906
+ },
169907
+ advance: {
169908
+ meanDelta: 0,
169909
+ maxDelta: 0
169910
+ },
169911
+ gates: {
169912
+ static: "pass",
169913
+ metric: "pass",
169914
+ layout: "not_run",
169915
+ ship: "pass"
169916
+ },
169917
+ policyAction: "substitute",
169918
+ measurementRefs: ["times-new-roman__liberation-serif#analytic_advance#2026-06-03"],
169919
+ candidateLicense: "OFL-1.1",
169920
+ exportRule: "preserve_original_name"
169921
+ },
169922
+ {
169923
+ evidenceId: "courier-new",
169924
+ logicalFamily: "Courier New",
169925
+ physicalFamily: "Liberation Mono",
169926
+ verdict: "metric_safe",
169927
+ faces: {
169928
+ regular: true,
169929
+ bold: true,
169930
+ italic: true,
169931
+ boldItalic: true
169932
+ },
169933
+ advance: {
169934
+ meanDelta: 0,
169935
+ maxDelta: 0
169936
+ },
169937
+ gates: {
169938
+ static: "pass",
169939
+ metric: "pass",
169940
+ layout: "not_run",
169941
+ ship: "pass"
169942
+ },
169943
+ policyAction: "substitute",
169944
+ measurementRefs: ["courier-new__liberation-mono#analytic_advance#2026-06-03"],
169945
+ candidateLicense: "OFL-1.1",
169946
+ exportRule: "preserve_original_name"
169947
+ },
169948
+ {
169949
+ evidenceId: "helvetica",
169950
+ logicalFamily: "Helvetica",
169951
+ physicalFamily: "Liberation Sans",
169952
+ verdict: "metric_safe",
169953
+ faces: {
169954
+ regular: true,
169955
+ bold: true,
169956
+ italic: true,
169957
+ boldItalic: true
169958
+ },
169959
+ advance: {
169960
+ meanDelta: 0,
169961
+ maxDelta: 0
169962
+ },
169963
+ gates: {
169964
+ static: "not_run",
169965
+ metric: "pass",
169966
+ layout: "not_run",
169967
+ ship: "fail"
169968
+ },
169969
+ policyAction: "substitute",
169970
+ measurementRefs: ["helvetica__liberation-sans#analytic_advance#2026-06-03"],
169971
+ candidateLicense: "OFL-1.1",
169972
+ exportRule: "preserve_original_name"
169973
+ },
169974
+ {
169975
+ evidenceId: "calibri-light",
169976
+ logicalFamily: "Calibri Light",
169977
+ physicalFamily: "Carlito",
169978
+ verdict: "visual_only",
169979
+ faces: {
169980
+ regular: false,
169981
+ bold: false,
169982
+ italic: false,
169983
+ boldItalic: false
169984
+ },
169985
+ advance: {
169986
+ meanDelta: 0.0148,
169987
+ maxDelta: 0.066
169988
+ },
169989
+ gates: {
169990
+ static: "not_run",
169991
+ metric: "fail",
169992
+ layout: "not_run",
169993
+ ship: "fail"
169994
+ },
169995
+ policyAction: "category_fallback",
169996
+ measurementRefs: ["calibri-light__carlito#analytic_advance#2026-06-05"],
169997
+ candidateLicense: "OFL-1.1",
169998
+ exportRule: "preserve_original_name"
169999
+ }
170000
+ ]);
170001
+ BUNDLED_SUBSTITUTES = deriveBundledSubstitutes();
170002
+ CATEGORY_FALLBACKS = deriveCategoryFallbacks();
170003
+ defaultResolver = new FontResolver;
170004
+ DEFAULT_FONT_MEASURE_CONTEXT = Object.freeze({
170005
+ resolvePhysical: (cssFontFamily, _face) => resolvePhysicalFamily(cssFontFamily),
170006
+ fontSignature: ""
170007
+ });
170008
+ BUNDLED_MANIFEST = Object.freeze([
170009
+ family("Carlito", "Carlito", "OFL-1.1"),
170010
+ family("Caladea", "Caladea", "Apache-2.0"),
170011
+ family("Liberation Sans", "LiberationSans", "OFL-1.1"),
170012
+ family("Liberation Serif", "LiberationSerif", "OFL-1.1"),
170013
+ family("Liberation Mono", "LiberationMono", "OFL-1.1")
170014
+ ]);
170015
+ installedRegistries = /* @__PURE__ */ new WeakMap;
170016
+ registriesByFontSet = /* @__PURE__ */ new WeakMap;
170017
+ PHYSICAL_GENERIC = Object.freeze({
170018
+ Carlito: "sans-serif",
170019
+ Caladea: "serif",
170020
+ "Liberation Sans": "sans-serif",
170021
+ "Liberation Serif": "serif",
170022
+ "Liberation Mono": "monospace"
170023
+ });
170024
+ BUNDLED_FAMILIES = new Set(BUNDLED_MANIFEST.map((f2) => f2.family));
170025
+ FONT_OFFERINGS = deriveOfferings();
170026
+ DEFAULT_FONT_ORDER = [
170027
+ "Calibri",
170028
+ "Arial",
170029
+ "Courier New",
170030
+ "Times New Roman",
170031
+ "Helvetica"
170032
+ ];
170033
+ headlessToolbarConstants = {
170034
+ DEFAULT_TEXT_ALIGN_OPTIONS: [
170035
+ {
170036
+ label: "Left",
170037
+ value: "left"
170038
+ },
170039
+ {
170040
+ label: "Center",
170041
+ value: "center"
170042
+ },
170043
+ {
170044
+ label: "Right",
170045
+ value: "right"
170046
+ },
170047
+ {
170048
+ label: "Justify",
170049
+ value: "justify"
170050
+ }
170051
+ ],
170052
+ DEFAULT_LINE_HEIGHT_OPTIONS: [
170053
+ {
170054
+ label: "1.00",
170055
+ value: 1
170056
+ },
170057
+ {
170058
+ label: "1.15",
170059
+ value: 1.15
170060
+ },
170061
+ {
170062
+ label: "1.50",
170063
+ value: 1.5
170064
+ },
170065
+ {
170066
+ label: "2.00",
170067
+ value: 2
170068
+ },
170069
+ {
170070
+ label: "2.50",
170071
+ value: 2.5
170072
+ },
170073
+ {
170074
+ label: "3.00",
170075
+ value: 3
170076
+ }
170077
+ ],
170078
+ DEFAULT_ZOOM_OPTIONS: [
170079
+ {
170080
+ label: "50%",
170081
+ value: 50
170082
+ },
170083
+ {
170084
+ label: "75%",
170085
+ value: 75
170086
+ },
170087
+ {
170088
+ label: "90%",
170089
+ value: 90
170090
+ },
170091
+ {
170092
+ label: "100%",
170093
+ value: 100
170094
+ },
170095
+ {
170096
+ label: "125%",
170097
+ value: 125
170098
+ },
170099
+ {
170100
+ label: "150%",
170101
+ value: 150
170102
+ },
170103
+ {
170104
+ label: "200%",
170105
+ value: 200
170106
+ }
170107
+ ],
170108
+ DEFAULT_DOCUMENT_MODE_OPTIONS: [
170109
+ {
170110
+ label: "Editing",
170111
+ value: "editing",
170112
+ description: "Edit document directly"
170113
+ },
170114
+ {
170115
+ label: "Suggesting",
170116
+ value: "suggesting",
170117
+ description: "Edits become suggestions"
170118
+ },
170119
+ {
170120
+ label: "Viewing",
170121
+ value: "viewing",
170122
+ description: "View clean version of document only"
170123
+ }
170124
+ ],
170125
+ DEFAULT_FONT_SIZE_OPTIONS: [
170126
+ {
170127
+ label: "8",
170128
+ value: "8pt"
170129
+ },
170130
+ {
170131
+ label: "9",
170132
+ value: "9pt"
170133
+ },
170134
+ {
170135
+ label: "10",
170136
+ value: "10pt"
170137
+ },
170138
+ {
170139
+ label: "11",
170140
+ value: "11pt"
170141
+ },
170142
+ {
170143
+ label: "12",
170144
+ value: "12pt"
170145
+ },
170146
+ {
170147
+ label: "14",
170148
+ value: "14pt"
170149
+ },
170150
+ {
170151
+ label: "18",
170152
+ value: "18pt"
170153
+ },
170154
+ {
170155
+ label: "24",
170156
+ value: "24pt"
170157
+ },
170158
+ {
170159
+ label: "30",
170160
+ value: "30pt"
170161
+ },
170162
+ {
170163
+ label: "36",
170164
+ value: "36pt"
170165
+ },
170166
+ {
170167
+ label: "48",
170168
+ value: "48pt"
170169
+ },
170170
+ {
170171
+ label: "60",
170172
+ value: "60pt"
170173
+ },
170174
+ {
170175
+ label: "72",
170176
+ value: "72pt"
170177
+ },
170178
+ {
170179
+ label: "96",
170180
+ value: "96pt"
170181
+ }
170182
+ ],
170183
+ DEFAULT_FONT_FAMILY_OPTIONS: getDefaultFontFamilyOptions(),
170184
+ DEFAULT_TEXT_COLOR_OPTIONS: [
170185
+ {
170186
+ label: "Black",
170187
+ value: "#000000"
170188
+ },
170189
+ {
170190
+ label: "Dark Gray",
170191
+ value: "#434343"
170192
+ },
170193
+ {
170194
+ label: "Gray",
170195
+ value: "#666666"
170196
+ },
170197
+ {
170198
+ label: "Light Gray",
170199
+ value: "#999999"
170200
+ },
170201
+ {
170202
+ label: "Red",
170203
+ value: "#ff0000"
170204
+ },
170205
+ {
170206
+ label: "Orange",
170207
+ value: "#ff9900"
170208
+ },
170209
+ {
170210
+ label: "Yellow",
170211
+ value: "#ffff00"
170212
+ },
170213
+ {
170214
+ label: "Green",
170215
+ value: "#00ff00"
170216
+ },
170217
+ {
170218
+ label: "Cyan",
170219
+ value: "#00ffff"
170220
+ },
170221
+ {
170222
+ label: "Blue",
170223
+ value: "#0000ff"
170224
+ },
170225
+ {
170226
+ label: "Purple",
170227
+ value: "#9900ff"
170228
+ },
170229
+ {
170230
+ label: "Magenta",
170231
+ value: "#ff00ff"
170232
+ },
170233
+ {
170234
+ label: "None",
170235
+ value: "none"
170236
+ }
170237
+ ],
170238
+ DEFAULT_HIGHLIGHT_COLOR_OPTIONS: [
170239
+ {
170240
+ label: "Yellow",
170241
+ value: "#ffff00"
170242
+ },
170243
+ {
170244
+ label: "Green",
170245
+ value: "#00ff00"
170246
+ },
170247
+ {
170248
+ label: "Cyan",
170249
+ value: "#00ffff"
170250
+ },
170251
+ {
170252
+ label: "Pink",
170253
+ value: "#ff00ff"
170254
+ },
170255
+ {
170256
+ label: "Blue",
170257
+ value: "#0000ff"
170258
+ },
170259
+ {
170260
+ label: "Red",
170261
+ value: "#ff0000"
170262
+ },
170263
+ {
170264
+ label: "Orange",
170265
+ value: "#ff9900"
170266
+ },
170267
+ {
170268
+ label: "None",
170269
+ value: "none"
170270
+ }
170271
+ ]
170272
+ };
170273
+ MOD_ALIASES = new Set([
170274
+ "Mod",
170275
+ "Meta",
170276
+ "Cmd",
170277
+ "Command"
170278
+ ]);
170279
+ ALT_ALIASES = new Set(["Alt", "Option"]);
170280
+ CTRL_ALIASES = new Set(["Control", "Ctrl"]);
170281
+ SHIFT_ALIASES = new Set(["Shift"]);
170282
+ BUILTIN_CONTEXT_MENU_GROUPS = [
170283
+ "format",
170284
+ "clipboard",
170285
+ "review",
170286
+ "comment",
170287
+ "link"
170288
+ ];
170289
+ BUILTIN_GROUP_ORDER = new Map(BUILTIN_CONTEXT_MENU_GROUPS.map((g, i4) => [g, i4]));
170290
+ RESERVED_PROXY_PROPERTY_NAMES = new Set([
170291
+ "register",
170292
+ "get",
170293
+ "has",
170294
+ "require",
170295
+ "getContextMenuItems"
170296
+ ]);
170297
+ ALL_TOOLBAR_COMMAND_IDS = Object.keys(createToolbarRegistry());
170298
+ EMPTY_ACTIVE_IDS = Object.freeze([]);
170299
+ });
170300
+
169076
170301
  // ../../packages/superdoc/dist/chunks/eventemitter3-BnGqBE-Q.es.js
169077
170302
  var import_eventemitter3;
169078
170303
  var init_eventemitter3_BnGqBE_Q_es = __esm(() => {
@@ -174992,12 +176217,12 @@ var require_shared_cjs = __commonJS((exports) => {
174992
176217
  return res.join(`
174993
176218
  `);
174994
176219
  }
174995
- function normalizeStyle(value) {
176220
+ function normalizeStyle2(value) {
174996
176221
  if (isArray2(value)) {
174997
176222
  const res = {};
174998
176223
  for (let i4 = 0;i4 < value.length; i4++) {
174999
176224
  const item = value[i4];
175000
- const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle(item);
176225
+ const normalized = isString(item) ? parseStringStyle(item) : normalizeStyle2(item);
175001
176226
  if (normalized) {
175002
176227
  for (const key2 in normalized) {
175003
176228
  res[key2] = normalized[key2];
@@ -175065,7 +176290,7 @@ var require_shared_cjs = __commonJS((exports) => {
175065
176290
  props.class = normalizeClass(klass);
175066
176291
  }
175067
176292
  if (style) {
175068
- props.style = normalizeStyle(style);
176293
+ props.style = normalizeStyle2(style);
175069
176294
  }
175070
176295
  return props;
175071
176296
  }
@@ -175315,7 +176540,7 @@ var require_shared_cjs = __commonJS((exports) => {
175315
176540
  exports.normalizeClass = normalizeClass;
175316
176541
  exports.normalizeCssVarValue = normalizeCssVarValue;
175317
176542
  exports.normalizeProps = normalizeProps;
175318
- exports.normalizeStyle = normalizeStyle;
176543
+ exports.normalizeStyle = normalizeStyle2;
175319
176544
  exports.objectToString = objectToString;
175320
176545
  exports.parseStringStyle = parseStringStyle;
175321
176546
  exports.propsToAttrMap = propsToAttrMap;
@@ -221110,7 +222335,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
221110
222335
  init_remark_gfm_BhnWr3yf_es();
221111
222336
  });
221112
222337
 
221113
- // ../../packages/superdoc/dist/chunks/src-BhZiOqOm.es.js
222338
+ // ../../packages/superdoc/dist/chunks/src-BjtupAUl.es.js
221114
222339
  function deleteProps(obj, propOrProps) {
221115
222340
  const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
221116
222341
  const removeNested = (target, pathParts, index2 = 0) => {
@@ -242289,9 +243514,9 @@ function findDonorMarkerFont(abstract) {
242289
243514
  continue;
242290
243515
  if (rFontsHasSymbolFont(rFonts))
242291
243516
  continue;
242292
- const family$1 = readRFontsFamily(rFonts);
242293
- if (family$1)
242294
- return family$1;
243517
+ const family2 = readRFontsFamily(rFonts);
243518
+ if (family2)
243519
+ return family2;
242295
243520
  }
242296
243521
  }
242297
243522
  function normalizeLevelFontForNumFmt(lvlEl, newNumFmt) {
@@ -261440,238 +262665,6 @@ function computeTabWidth(currentPos, justification, tabs, hangingIndent, firstLi
261440
262665
  tabWidth = nextDefaultTabStop - currentPos;
261441
262666
  return tabWidth;
261442
262667
  }
261443
- function isSettled(status) {
261444
- return SETTLED_STATUSES.includes(status);
261445
- }
261446
- function normalizeFamilyKey$2(family$1) {
261447
- return family$1.trim().replace(/^["']|["']$/g, "").toLowerCase();
261448
- }
261449
- function deriveBundledSubstitutes() {
261450
- const substitutes = {};
261451
- for (const row2 of SUBSTITUTION_EVIDENCE)
261452
- if (row2.policyAction === "substitute" && row2.physicalFamily)
261453
- substitutes[normalizeFamilyKey$2(row2.logicalFamily)] = row2.physicalFamily;
261454
- return Object.freeze(substitutes);
261455
- }
261456
- function deriveCategoryFallbacks() {
261457
- const fallbacks = {};
261458
- for (const row2 of SUBSTITUTION_EVIDENCE)
261459
- if (row2.policyAction === "category_fallback" && row2.physicalFamily)
261460
- fallbacks[normalizeFamilyKey$2(row2.logicalFamily)] = row2.physicalFamily;
261461
- return Object.freeze(fallbacks);
261462
- }
261463
- function stripFamilyQuotes(family$1) {
261464
- return family$1.trim().replace(/^["']|["']$/g, "");
261465
- }
261466
- function splitStack(cssFontFamily) {
261467
- return cssFontFamily.split(",").map((part) => part.trim()).filter(Boolean);
261468
- }
261469
- function createFontResolver() {
261470
- return new FontResolver;
261471
- }
261472
- function resolveFontFamily2(logicalFamily) {
261473
- return defaultResolver.resolveFontFamily(logicalFamily);
261474
- }
261475
- function resolvePhysicalFamily(cssFontFamily) {
261476
- return defaultResolver.resolvePhysicalFamily(cssFontFamily);
261477
- }
261478
- function resolveFace(logicalFamily, face, hasFace) {
261479
- return defaultResolver.resolveFace(logicalFamily, face, hasFace);
261480
- }
261481
- function getFontConfigVersion() {
261482
- return fontConfigVersion;
261483
- }
261484
- function bumpFontConfigVersion() {
261485
- return fontConfigVersion += 1;
261486
- }
261487
- function fourFaces(filePrefix) {
261488
- return [
261489
- {
261490
- weight: "normal",
261491
- style: "normal",
261492
- file: `${filePrefix}-Regular.woff2`
261493
- },
261494
- {
261495
- weight: "bold",
261496
- style: "normal",
261497
- file: `${filePrefix}-Bold.woff2`
261498
- },
261499
- {
261500
- weight: "normal",
261501
- style: "italic",
261502
- file: `${filePrefix}-Italic.woff2`
261503
- },
261504
- {
261505
- weight: "bold",
261506
- style: "italic",
261507
- file: `${filePrefix}-BoldItalic.woff2`
261508
- }
261509
- ];
261510
- }
261511
- function family(name, filePrefix, license) {
261512
- return {
261513
- family: name,
261514
- license,
261515
- faces: fourFaces(filePrefix)
261516
- };
261517
- }
261518
- function withTrailingSlash(base4) {
261519
- return base4.endsWith("/") ? base4 : `${base4}/`;
261520
- }
261521
- function joinUrl(base4, file2) {
261522
- return `${withTrailingSlash(base4)}${file2}`;
261523
- }
261524
- function weightToken(weight) {
261525
- return weight === "bold" ? "700" : "400";
261526
- }
261527
- function bundledAssetSignature(resolve2) {
261528
- const family$1 = BUNDLED_MANIFEST[0];
261529
- const face = family$1?.faces[0];
261530
- if (!family$1 || !face)
261531
- return "";
261532
- return resolve2({
261533
- file: face.file,
261534
- family: family$1.family,
261535
- weight: weightToken(face.weight),
261536
- style: face.style,
261537
- source: "bundled-substitute"
261538
- });
261539
- }
261540
- function installBundledSubstitutes(registry3, options = {}) {
261541
- const resolve2 = options.resolveAssetUrl ?? ((context) => joinUrl(options.assetBaseUrl ?? defaultAssetBase, context.file));
261542
- const signature = bundledAssetSignature(resolve2);
261543
- const installed = installedRegistries.get(registry3);
261544
- if (installed !== undefined) {
261545
- if (installed !== signature)
261546
- console.warn(`[superdoc] bundled fonts are already registered for this document from "${installed}"; a later fonts config resolving to "${signature}" is ignored. Use one fonts.assetBaseUrl / fonts.resolveAssetUrl per document.`);
261547
- return;
261548
- }
261549
- installedRegistries.set(registry3, signature);
261550
- for (const family$1 of BUNDLED_MANIFEST)
261551
- for (const face of family$1.faces) {
261552
- const context = {
261553
- file: face.file,
261554
- family: family$1.family,
261555
- weight: weightToken(face.weight),
261556
- style: face.style,
261557
- source: "bundled-substitute"
261558
- };
261559
- registry3.register({
261560
- family: family$1.family,
261561
- source: `url(${resolve2(context)})`,
261562
- descriptors: {
261563
- weight: face.weight,
261564
- style: face.style
261565
- }
261566
- });
261567
- }
261568
- }
261569
- function buildFontReport(logicalFamilies, registry3, resolver2) {
261570
- const seen = /* @__PURE__ */ new Set;
261571
- const report = [];
261572
- for (const logical of logicalFamilies) {
261573
- if (!logical || seen.has(logical))
261574
- continue;
261575
- seen.add(logical);
261576
- const { physicalFamily, reason } = resolver2 ? resolver2.resolveFontFamily(logical) : resolveFontFamily2(logical);
261577
- const loadStatus = registry3.getStatus(physicalFamily);
261578
- report.push({
261579
- logicalFamily: logical,
261580
- physicalFamily,
261581
- reason,
261582
- loadStatus,
261583
- exportFamily: logical,
261584
- missing: reason === "category_fallback" || isSettled(loadStatus) && loadStatus !== "loaded"
261585
- });
261586
- }
261587
- return report;
261588
- }
261589
- function buildFaceReport(usedFaces, registry3, resolver2) {
261590
- const hasFace = (family$1, weight, style2) => registry3.hasFace(family$1, weight, style2);
261591
- const seen = /* @__PURE__ */ new Set;
261592
- const report = [];
261593
- for (const { logicalFamily, weight, style: style2 } of usedFaces) {
261594
- if (!logicalFamily)
261595
- continue;
261596
- const key2 = `${logicalFamily.toLowerCase()}|${weight}|${style2}`;
261597
- if (seen.has(key2))
261598
- continue;
261599
- seen.add(key2);
261600
- const face = {
261601
- weight,
261602
- style: style2
261603
- };
261604
- const { physicalFamily, reason } = resolver2 ? resolver2.resolveFace(logicalFamily, face, hasFace) : resolveFace(logicalFamily, face, hasFace);
261605
- const loadStatus = registry3.getFaceStatus({
261606
- family: physicalFamily,
261607
- weight,
261608
- style: style2
261609
- });
261610
- const missing = reason === "fallback_face_absent" || reason === "category_fallback" || isSettled(loadStatus) && loadStatus !== "loaded";
261611
- report.push({
261612
- logicalFamily,
261613
- physicalFamily,
261614
- reason,
261615
- loadStatus,
261616
- exportFamily: logicalFamily,
261617
- missing,
261618
- face
261619
- });
261620
- }
261621
- return report;
261622
- }
261623
- function quoteFamily(family$1) {
261624
- return `"${family$1.replace(/\\/g, "\\\\").replace(/"/g, "\\\"")}"`;
261625
- }
261626
- function canonicalizeFontSource(source) {
261627
- const match$1 = /^\s*url\(\s*([\s\S]*?)\s*\)\s*$/i.exec(source);
261628
- if (!match$1)
261629
- return source;
261630
- let inner = match$1[1].trim();
261631
- if (inner.startsWith('"') && inner.endsWith('"') || inner.startsWith("'") && inner.endsWith("'"))
261632
- inner = inner.slice(1, -1);
261633
- return `url(${JSON.stringify(inner)})`;
261634
- }
261635
- function normalizeFamilyKey$1(family$1) {
261636
- return family$1.trim().replace(/^["']|["']$/g, "").toLowerCase();
261637
- }
261638
- function normalizeWeight(weight) {
261639
- if (weight === undefined)
261640
- return "400";
261641
- const w = String(weight).trim().toLowerCase();
261642
- if (w === "bold" || w === "bolder")
261643
- return "700";
261644
- const n = Number(w);
261645
- return Number.isFinite(n) && n >= 600 ? "700" : "400";
261646
- }
261647
- function normalizeStyle$1(style2) {
261648
- if (!style2)
261649
- return "normal";
261650
- const s2 = style2.trim().toLowerCase();
261651
- return s2.startsWith("italic") || s2.startsWith("oblique") ? "italic" : "normal";
261652
- }
261653
- function faceKeyOf$1(family$1, weight, style2) {
261654
- return `${normalizeFamilyKey$1(family$1)}|${weight}|${style2}`;
261655
- }
261656
- function faceProbe(family$1, weight, style2, size$1) {
261657
- return `${style2 === "italic" ? "italic " : ""}${weight} ${size$1} ${quoteFamily(family$1)}`;
261658
- }
261659
- function getFontRegistryFor(fontSet, FontFaceCtor) {
261660
- if (!fontSet) {
261661
- if (!domlessRegistry)
261662
- domlessRegistry = new FontRegistry({});
261663
- return domlessRegistry;
261664
- }
261665
- let registry3 = registriesByFontSet.get(fontSet);
261666
- if (!registry3) {
261667
- registry3 = new FontRegistry({
261668
- fontSet,
261669
- FontFaceCtor
261670
- });
261671
- registriesByFontSet.set(fontSet, registry3);
261672
- }
261673
- return registry3;
261674
- }
261675
262668
  function isResolvedFragmentWithBorders(item) {
261676
262669
  return item !== undefined && item.kind === "fragment" && "paragraphBorders" in item && item.paragraphBorders !== undefined;
261677
262670
  }
@@ -269667,8 +270660,8 @@ function isTextRun$3(run2) {
269667
270660
  function fontString(run2) {
269668
270661
  const textRun = isTextRun$3(run2) ? run2 : null;
269669
270662
  const size$1 = textRun?.fontSize ?? 16;
269670
- const family$1 = textRun?.fontFamily ?? "Arial";
269671
- return `${textRun?.italic ? "italic " : ""}${textRun?.bold ? "bold " : ""}${size$1}px ${family$1}`.trim();
270663
+ const family2 = textRun?.fontFamily ?? "Arial";
270664
+ return `${textRun?.italic ? "italic " : ""}${textRun?.bold ? "bold " : ""}${size$1}px ${family2}`.trim();
269672
270665
  }
269673
270666
  function runText(run2) {
269674
270667
  if (isEmptySdtPlaceholderRun(run2))
@@ -280514,8 +281507,8 @@ function ensureEndnoteMarker(blocks2, id2, endnoteNumberById, endnoteNumberForma
280514
281507
  }
280515
281508
  runs2.unshift(markerRun);
280516
281509
  }
280517
- function normalizeFamilyKey(family$1) {
280518
- return family$1.trim().replace(/^["']|["']$/g, "").toLowerCase();
281510
+ function normalizeFamilyKey2(family2) {
281511
+ return family2.trim().replace(/^["']|["']$/g, "").toLowerCase();
280519
281512
  }
280520
281513
  function normalizeWeightToken(weight) {
280521
281514
  if (!weight)
@@ -280532,8 +281525,8 @@ function normalizeStyleToken(style2) {
280532
281525
  const s2 = style2.trim().toLowerCase();
280533
281526
  return s2.startsWith("italic") || s2.startsWith("oblique") ? "italic" : "normal";
280534
281527
  }
280535
- function faceKeyOf(family$1, weight, style2) {
280536
- return `${normalizeFamilyKey(family$1)}|${weight}|${style2}`;
281528
+ function faceKeyOf2(family2, weight, style2) {
281529
+ return `${normalizeFamilyKey2(family2)}|${weight}|${style2}`;
280537
281530
  }
280538
281531
  function summarize(results) {
280539
281532
  const summary = emptySummary();
@@ -280557,9 +281550,9 @@ function summarizeFaces(results) {
280557
281550
  worstByFamily.set(request.family, status);
280558
281551
  }
280559
281552
  const summary = emptySummary();
280560
- for (const [family$1, status] of worstByFamily) {
281553
+ for (const [family2, status] of worstByFamily) {
280561
281554
  summary.results.push({
280562
- family: family$1,
281555
+ family: family2,
280563
281556
  status
280564
281557
  });
280565
281558
  if (status === "loaded")
@@ -280637,7 +281630,7 @@ function makeResolveFace(resolver2, hasFace) {
280637
281630
  };
280638
281631
  };
280639
281632
  }
280640
- function collect(acc, node2, resolveFace$1) {
281633
+ function collect(acc, node2, resolveFace2) {
280641
281634
  if (!node2 || typeof node2.fontFamily !== "string" || !node2.fontFamily)
280642
281635
  return;
280643
281636
  const weight = node2.bold === true ? "700" : "400";
@@ -280648,7 +281641,7 @@ function collect(acc, node2, resolveFace$1) {
280648
281641
  const usedKey = `${logicalPrimary.toLowerCase()}|${weight}|${style2}`;
280649
281642
  if (acc.usedFaces.has(usedKey))
280650
281643
  return;
280651
- const { physicalFamily, reason } = resolveFace$1(node2.fontFamily, {
281644
+ const { physicalFamily, reason } = resolveFace2(node2.fontFamily, {
280652
281645
  weight,
280653
281646
  style: style2
280654
281647
  });
@@ -280674,7 +281667,7 @@ function collect(acc, node2, resolveFace$1) {
280674
281667
  });
280675
281668
  }
280676
281669
  }
280677
- function collectRuns(acc, runs2, resolveFace$1) {
281670
+ function collectRuns(acc, runs2, resolveFace2) {
280678
281671
  if (!runs2)
280679
281672
  return;
280680
281673
  for (const run2 of runs2) {
@@ -280683,48 +281676,48 @@ function collectRuns(acc, runs2, resolveFace$1) {
280683
281676
  collect(acc, {
280684
281677
  ...bearing,
280685
281678
  fontFamily: "Arial"
280686
- }, resolveFace$1);
281679
+ }, resolveFace2);
280687
281680
  else
280688
- collect(acc, bearing, resolveFace$1);
281681
+ collect(acc, bearing, resolveFace2);
280689
281682
  }
280690
281683
  }
280691
- function collectParagraph(acc, paragraph2, resolveFace$1) {
281684
+ function collectParagraph(acc, paragraph2, resolveFace2) {
280692
281685
  if (!paragraph2)
280693
281686
  return;
280694
- collectRuns(acc, paragraph2.runs, resolveFace$1);
280695
- collect(acc, paragraph2.attrs?.wordLayout?.marker?.run, resolveFace$1);
280696
- collect(acc, paragraph2.attrs?.dropCapDescriptor?.run, resolveFace$1);
281687
+ collectRuns(acc, paragraph2.runs, resolveFace2);
281688
+ collect(acc, paragraph2.attrs?.wordLayout?.marker?.run, resolveFace2);
281689
+ collect(acc, paragraph2.attrs?.dropCapDescriptor?.run, resolveFace2);
280697
281690
  }
280698
- function collectTable(acc, table2, resolveFace$1) {
281691
+ function collectTable(acc, table2, resolveFace2) {
280699
281692
  for (const row2 of table2.rows)
280700
281693
  for (const cell2 of row2.cells) {
280701
- collectParagraph(acc, cell2.paragraph, resolveFace$1);
281694
+ collectParagraph(acc, cell2.paragraph, resolveFace2);
280702
281695
  if (cell2.blocks)
280703
281696
  for (const b$1 of cell2.blocks)
280704
- collectBlock(acc, b$1, resolveFace$1);
281697
+ collectBlock(acc, b$1, resolveFace2);
280705
281698
  }
280706
281699
  }
280707
- function collectList(acc, list5, resolveFace$1) {
281700
+ function collectList(acc, list5, resolveFace2) {
280708
281701
  for (const item of list5.items)
280709
- collectParagraph(acc, item.paragraph, resolveFace$1);
281702
+ collectParagraph(acc, item.paragraph, resolveFace2);
280710
281703
  }
280711
- function collectBlock(acc, block, resolveFace$1) {
281704
+ function collectBlock(acc, block, resolveFace2) {
280712
281705
  switch (block.kind) {
280713
281706
  case "paragraph":
280714
- collectParagraph(acc, block, resolveFace$1);
281707
+ collectParagraph(acc, block, resolveFace2);
280715
281708
  break;
280716
281709
  case "table":
280717
- collectTable(acc, block, resolveFace$1);
281710
+ collectTable(acc, block, resolveFace2);
280718
281711
  break;
280719
281712
  case "list":
280720
- collectList(acc, block, resolveFace$1);
281713
+ collectList(acc, block, resolveFace2);
280721
281714
  break;
280722
281715
  default:
280723
281716
  break;
280724
281717
  }
280725
281718
  }
280726
281719
  function planFontFaces(blocks2, resolver2, hasFace) {
280727
- const resolveFace$1 = makeResolveFace(resolver2, hasFace);
281720
+ const resolveFace2 = makeResolveFace(resolver2, hasFace);
280728
281721
  const acc = {
280729
281722
  requiredFaces: /* @__PURE__ */ new Map,
280730
281723
  usedFaces: /* @__PURE__ */ new Map,
@@ -280732,7 +281725,7 @@ function planFontFaces(blocks2, resolver2, hasFace) {
280732
281725
  };
280733
281726
  if (blocks2)
280734
281727
  for (const block of blocks2)
280735
- collectBlock(acc, block, resolveFace$1);
281728
+ collectBlock(acc, block, resolveFace2);
280736
281729
  return {
280737
281730
  requiredFaces: [...acc.requiredFaces.values()],
280738
281731
  usedFaces: [...acc.usedFaces.values()],
@@ -302641,443 +303634,7 @@ menclose::after {
302641
303634
  const minReadablePx = getMinimumReadableTextStartPx(markerContentEndPx, gutterWidthPx);
302642
303635
  return Math.max(nextTabStopPx, minReadablePx);
302643
303636
  }
302644
- }, SETTLED_STATUSES, SUBSTITUTION_EVIDENCE, BUNDLED_SUBSTITUTES, CATEGORY_FALLBACKS, FontResolver = class {
302645
- #overrides = /* @__PURE__ */ new Map;
302646
- #version = 0;
302647
- #cachedSignature = null;
302648
- map(logicalFamily, physicalFamily) {
302649
- const key2 = normalizeFamilyKey$2(logicalFamily);
302650
- const physical = physicalFamily?.trim();
302651
- if (!key2 || !physical)
302652
- return;
302653
- if (this.#overrides.get(key2) === physical)
302654
- return;
302655
- if (key2 === normalizeFamilyKey$2(physical)) {
302656
- if (this.#overrides.delete(key2)) {
302657
- this.#version += 1;
302658
- this.#cachedSignature = null;
302659
- }
302660
- return;
302661
- }
302662
- this.#overrides.set(key2, physical);
302663
- this.#version += 1;
302664
- this.#cachedSignature = null;
302665
- }
302666
- unmap(logicalFamily) {
302667
- if (this.#overrides.delete(normalizeFamilyKey$2(logicalFamily))) {
302668
- this.#version += 1;
302669
- this.#cachedSignature = null;
302670
- }
302671
- }
302672
- reset() {
302673
- if (this.#overrides.size === 0)
302674
- return;
302675
- this.#overrides.clear();
302676
- this.#version += 1;
302677
- this.#cachedSignature = null;
302678
- }
302679
- get version() {
302680
- return this.#version;
302681
- }
302682
- get signature() {
302683
- if (this.#cachedSignature !== null)
302684
- return this.#cachedSignature;
302685
- this.#cachedSignature = this.#overrides.size === 0 ? "" : JSON.stringify([...this.#overrides.entries()].sort(([a2], [b$1]) => a2 < b$1 ? -1 : a2 > b$1 ? 1 : 0));
302686
- return this.#cachedSignature;
302687
- }
302688
- #physicalFor(bareFamily) {
302689
- const key2 = normalizeFamilyKey$2(bareFamily);
302690
- const override = this.#overrides.get(key2);
302691
- if (override)
302692
- return {
302693
- physical: override,
302694
- reason: "custom_mapping"
302695
- };
302696
- const bundled = BUNDLED_SUBSTITUTES[key2];
302697
- if (bundled)
302698
- return {
302699
- physical: bundled,
302700
- reason: "bundled_substitute"
302701
- };
302702
- const category = CATEGORY_FALLBACKS[key2];
302703
- if (category)
302704
- return {
302705
- physical: category,
302706
- reason: "category_fallback"
302707
- };
302708
- return {
302709
- physical: bareFamily,
302710
- reason: "as_requested"
302711
- };
302712
- }
302713
- #resolveFaceLadder(primary, face, hasFace) {
302714
- const key2 = normalizeFamilyKey$2(primary);
302715
- const override = this.#overrides.get(key2);
302716
- if (override && hasFace(override, face.weight, face.style))
302717
- return {
302718
- physical: override,
302719
- reason: "custom_mapping"
302720
- };
302721
- if (hasFace(primary, face.weight, face.style))
302722
- return {
302723
- physical: primary,
302724
- reason: "registered_face"
302725
- };
302726
- const bundled = BUNDLED_SUBSTITUTES[key2];
302727
- if (bundled && hasFace(bundled, face.weight, face.style))
302728
- return {
302729
- physical: bundled,
302730
- reason: "bundled_substitute"
302731
- };
302732
- const category = CATEGORY_FALLBACKS[key2];
302733
- if (category && hasFace(category, face.weight, face.style))
302734
- return {
302735
- physical: category,
302736
- reason: "category_fallback"
302737
- };
302738
- if (override || bundled)
302739
- return {
302740
- physical: primary,
302741
- reason: "fallback_face_absent"
302742
- };
302743
- return {
302744
- physical: primary,
302745
- reason: "as_requested"
302746
- };
302747
- }
302748
- resolveFontFamily(logicalFamily) {
302749
- const primary = splitStack(logicalFamily)[0] ?? logicalFamily;
302750
- const { physical, reason } = this.#physicalFor(primary);
302751
- return {
302752
- logicalFamily,
302753
- physicalFamily: stripFamilyQuotes(physical),
302754
- reason
302755
- };
302756
- }
302757
- resolvePhysicalFamily(cssFontFamily) {
302758
- if (!cssFontFamily)
302759
- return cssFontFamily;
302760
- const parts = splitStack(cssFontFamily);
302761
- if (parts.length === 0)
302762
- return cssFontFamily;
302763
- const { physical, reason } = this.#physicalFor(parts[0]);
302764
- if (reason === "as_requested")
302765
- return cssFontFamily;
302766
- return [physical, ...parts.slice(1)].join(", ");
302767
- }
302768
- resolveFace(logicalFamily, face, hasFace) {
302769
- const primary = splitStack(logicalFamily)[0] ?? logicalFamily;
302770
- const { physical, reason } = this.#resolveFaceLadder(primary, face, hasFace);
302771
- return {
302772
- logicalFamily,
302773
- physicalFamily: stripFamilyQuotes(physical),
302774
- reason
302775
- };
302776
- }
302777
- resolvePhysicalFamilyForFace(cssFontFamily, face, hasFace) {
302778
- if (!cssFontFamily)
302779
- return cssFontFamily;
302780
- const parts = splitStack(cssFontFamily);
302781
- if (parts.length === 0)
302782
- return cssFontFamily;
302783
- const { physical } = this.#resolveFaceLadder(parts[0], face, hasFace);
302784
- if (normalizeFamilyKey$2(physical) !== normalizeFamilyKey$2(parts[0]))
302785
- return [physical, ...parts.slice(1)].join(", ");
302786
- return cssFontFamily;
302787
- }
302788
- resolvePrimaryPhysicalFamily(family$1) {
302789
- const primary = splitStack(family$1)[0] ?? family$1;
302790
- return this.#physicalFor(primary).physical;
302791
- }
302792
- resolvePhysicalFamilies(families) {
302793
- const out = /* @__PURE__ */ new Set;
302794
- for (const family$1 of families)
302795
- if (family$1)
302796
- out.add(this.resolvePrimaryPhysicalFamily(family$1));
302797
- return [...out];
302798
- }
302799
- }, defaultResolver, DEFAULT_FONT_MEASURE_CONTEXT, fontConfigVersion = 0, BUNDLED_MANIFEST, defaultAssetBase = "/fonts/", installedRegistries, DEFAULT_FONT_LOAD_TIMEOUT_MS = 3000, DEFAULT_PROBE_SIZE = "16px", FontRegistry = class {
302800
- #fontSet;
302801
- #FontFaceCtor;
302802
- #probeSize;
302803
- #scheduleTimeout;
302804
- #cancelTimeout;
302805
- #managed = /* @__PURE__ */ new Map;
302806
- #status = /* @__PURE__ */ new Map;
302807
- #sources = /* @__PURE__ */ new Map;
302808
- #warnedFailures = /* @__PURE__ */ new Set;
302809
- #inflight = /* @__PURE__ */ new Map;
302810
- #faceStatus = /* @__PURE__ */ new Map;
302811
- #faceInflight = /* @__PURE__ */ new Map;
302812
- #faceSources = /* @__PURE__ */ new Map;
302813
- #facesByFamily = /* @__PURE__ */ new Map;
302814
- #providerFaceKeys = /* @__PURE__ */ new Set;
302815
- #warnedFaceFailures = /* @__PURE__ */ new Set;
302816
- constructor(options = {}) {
302817
- this.#fontSet = options.fontSet ?? null;
302818
- this.#FontFaceCtor = options.FontFaceCtor ?? null;
302819
- this.#probeSize = options.probeSize ?? DEFAULT_PROBE_SIZE;
302820
- this.#scheduleTimeout = options.scheduleTimeout ?? ((cb, ms) => globalThis.setTimeout(cb, ms));
302821
- this.#cancelTimeout = options.cancelTimeout ?? ((handle3) => globalThis.clearTimeout(handle3));
302822
- }
302823
- register(descriptor) {
302824
- const { family: family$1, source, descriptors: descriptors2 } = descriptor;
302825
- const identitySource = typeof source === "string" ? canonicalizeFontSource(source) : source;
302826
- const weight = normalizeWeight(descriptors2?.weight);
302827
- const style2 = normalizeStyle$1(descriptors2?.style);
302828
- const key2 = faceKeyOf$1(family$1, weight, style2);
302829
- if (typeof identitySource === "string") {
302830
- const existingSource = this.#faceSources.get(key2);
302831
- if (existingSource === identitySource)
302832
- return {
302833
- family: family$1,
302834
- status: this.getStatus(family$1),
302835
- changed: false
302836
- };
302837
- if (existingSource !== undefined)
302838
- throw new Error(`[superdoc] font face "${key2}" is already registered from a different source ("${existingSource}"); a registered face's source cannot be replaced`);
302839
- }
302840
- if (this.#FontFaceCtor && this.#fontSet) {
302841
- const face = new this.#FontFaceCtor(family$1, source, {
302842
- ...descriptors2,
302843
- weight,
302844
- style: style2
302845
- });
302846
- this.#fontSet.add(face);
302847
- this.#managed.set(family$1, face);
302848
- }
302849
- if (typeof source === "string") {
302850
- const list5 = this.#sources.get(family$1) ?? [];
302851
- if (!list5.includes(source))
302852
- list5.push(source);
302853
- this.#sources.set(family$1, list5);
302854
- }
302855
- if (!this.#status.has(family$1))
302856
- this.#status.set(family$1, "unloaded");
302857
- this.#providerFaceKeys.add(key2);
302858
- this.#trackFace(family$1, key2);
302859
- if (!this.#faceStatus.has(key2))
302860
- this.#faceStatus.set(key2, "unloaded");
302861
- if (typeof identitySource === "string" && !this.#faceSources.has(key2))
302862
- this.#faceSources.set(key2, identitySource);
302863
- return {
302864
- family: family$1,
302865
- status: this.getStatus(family$1),
302866
- changed: true
302867
- };
302868
- }
302869
- #trackFace(family$1, key2) {
302870
- const fam = normalizeFamilyKey$1(family$1);
302871
- const set3 = this.#facesByFamily.get(fam) ?? /* @__PURE__ */ new Set;
302872
- set3.add(key2);
302873
- this.#facesByFamily.set(fam, set3);
302874
- }
302875
- isManaged(family$1) {
302876
- return this.#managed.has(family$1);
302877
- }
302878
- getStatus(family$1) {
302879
- const statuses = [];
302880
- const faceKeys = this.#facesByFamily.get(normalizeFamilyKey$1(family$1));
302881
- if (faceKeys)
302882
- for (const k$1 of faceKeys)
302883
- statuses.push(this.#faceStatus.get(k$1) ?? "unloaded");
302884
- const legacy = this.#status.get(family$1);
302885
- if (legacy)
302886
- statuses.push(legacy);
302887
- if (statuses.length === 0)
302888
- return "unloaded";
302889
- for (const s2 of [
302890
- "failed",
302891
- "timed_out",
302892
- "fallback_used",
302893
- "loaded",
302894
- "loading",
302895
- "unloaded"
302896
- ])
302897
- if (statuses.includes(s2))
302898
- return s2;
302899
- return "unloaded";
302900
- }
302901
- hasFace(family$1, weight, style2) {
302902
- const key2 = faceKeyOf$1(family$1, weight, style2);
302903
- return this.#providerFaceKeys.has(key2) && this.#faceStatus.get(key2) !== "failed";
302904
- }
302905
- isAvailable(family$1) {
302906
- if (!this.#fontSet)
302907
- return false;
302908
- try {
302909
- return this.#fontSet.check(`${this.#probeSize} ${quoteFamily(family$1)}`);
302910
- } catch {
302911
- return false;
302912
- }
302913
- }
302914
- awaitFace(family$1, timeoutMs = DEFAULT_FONT_LOAD_TIMEOUT_MS) {
302915
- if (this.#status.get(family$1) === "loaded")
302916
- return Promise.resolve({
302917
- family: family$1,
302918
- status: "loaded"
302919
- });
302920
- const existing = this.#inflight.get(family$1);
302921
- if (existing)
302922
- return existing;
302923
- const probe = this.#loadOne(family$1, timeoutMs).finally(() => {
302924
- this.#inflight.delete(family$1);
302925
- });
302926
- this.#inflight.set(family$1, probe);
302927
- return probe;
302928
- }
302929
- async awaitFaces(families, options = {}) {
302930
- const unique$2 = [...new Set(families)];
302931
- const timeoutMs = options.timeoutMs ?? 3000;
302932
- return Promise.all(unique$2.map((family$1) => this.awaitFace(family$1, timeoutMs)));
302933
- }
302934
- getRequiredFaces(families, timeoutMs = DEFAULT_FONT_LOAD_TIMEOUT_MS) {
302935
- return [...new Set(families)].map((family$1) => ({
302936
- family: family$1,
302937
- status: this.getStatus(family$1),
302938
- ready: this.awaitFace(family$1, timeoutMs)
302939
- }));
302940
- }
302941
- getStates() {
302942
- return [...this.#status.entries()].map(([family$1, status]) => ({
302943
- family: family$1,
302944
- status
302945
- }));
302946
- }
302947
- getFaceStatus(request) {
302948
- return this.#faceStatus.get(faceKeyOf$1(request.family, request.weight, request.style)) ?? "unloaded";
302949
- }
302950
- awaitFaceRequest(request, timeoutMs = DEFAULT_FONT_LOAD_TIMEOUT_MS) {
302951
- const key2 = faceKeyOf$1(request.family, request.weight, request.style);
302952
- if (this.#faceStatus.get(key2) === "loaded")
302953
- return Promise.resolve({
302954
- request,
302955
- status: "loaded"
302956
- });
302957
- const existing = this.#faceInflight.get(key2);
302958
- if (existing)
302959
- return existing;
302960
- const probe = this.#loadOneFace(request, key2, timeoutMs).finally(() => {
302961
- this.#faceInflight.delete(key2);
302962
- });
302963
- this.#faceInflight.set(key2, probe);
302964
- return probe;
302965
- }
302966
- async awaitFaceRequests(requests, options = {}) {
302967
- const timeoutMs = options.timeoutMs ?? 3000;
302968
- const seen = /* @__PURE__ */ new Set;
302969
- const unique$2 = [];
302970
- for (const r$1 of requests) {
302971
- const key2 = faceKeyOf$1(r$1.family, r$1.weight, r$1.style);
302972
- if (seen.has(key2))
302973
- continue;
302974
- seen.add(key2);
302975
- unique$2.push(r$1);
302976
- }
302977
- return Promise.all(unique$2.map((r$1) => this.awaitFaceRequest(r$1, timeoutMs)));
302978
- }
302979
- async#loadOneFace(request, key2, timeoutMs) {
302980
- this.#trackFace(request.family, key2);
302981
- const fontSet = this.#fontSet;
302982
- if (!fontSet) {
302983
- this.#faceStatus.set(key2, "fallback_used");
302984
- return {
302985
- request,
302986
- status: "fallback_used"
302987
- };
302988
- }
302989
- this.#faceStatus.set(key2, "loading");
302990
- const probe = faceProbe(request.family, request.weight, request.style, this.#probeSize);
302991
- const TIMEOUT = Symbol("timeout");
302992
- let handle3;
302993
- const timeout$1 = new Promise((resolve2) => {
302994
- handle3 = this.#scheduleTimeout(() => resolve2(TIMEOUT), timeoutMs);
302995
- });
302996
- try {
302997
- const settled = await Promise.race([fontSet.load(probe), timeout$1]);
302998
- if (settled === TIMEOUT) {
302999
- this.#faceStatus.set(key2, "timed_out");
303000
- return {
303001
- request,
303002
- status: "timed_out"
303003
- };
303004
- }
303005
- const status = settled.length > 0 ? "loaded" : "fallback_used";
303006
- this.#faceStatus.set(key2, status);
303007
- return {
303008
- request,
303009
- status
303010
- };
303011
- } catch {
303012
- this.#faceStatus.set(key2, "failed");
303013
- this.#warnFaceFailureOnce(request, key2);
303014
- return {
303015
- request,
303016
- status: "failed"
303017
- };
303018
- } finally {
303019
- this.#cancelTimeout(handle3);
303020
- }
303021
- }
303022
- #warnFaceFailureOnce(request, key2) {
303023
- if (this.#warnedFaceFailures.has(key2))
303024
- return;
303025
- this.#warnedFaceFailures.add(key2);
303026
- const src = this.#faceSources.get(key2);
303027
- const detail = src ? ` from ${src}` : "";
303028
- console.warn(`[superdoc] font face failed to load: "${request.family}" ${request.weight} ${request.style}${detail}. Check fonts.assetBaseUrl / fonts.resolveAssetUrl so the bundled .woff2 are served.`);
303029
- }
303030
- async#loadOne(family$1, timeoutMs) {
303031
- const fontSet = this.#fontSet;
303032
- if (!fontSet) {
303033
- this.#status.set(family$1, "fallback_used");
303034
- return {
303035
- family: family$1,
303036
- status: "fallback_used"
303037
- };
303038
- }
303039
- this.#status.set(family$1, "loading");
303040
- const probe = `${this.#probeSize} ${quoteFamily(family$1)}`;
303041
- const TIMEOUT = Symbol("timeout");
303042
- let handle3;
303043
- const timeout$1 = new Promise((resolve2) => {
303044
- handle3 = this.#scheduleTimeout(() => resolve2(TIMEOUT), timeoutMs);
303045
- });
303046
- try {
303047
- const settled = await Promise.race([fontSet.load(probe), timeout$1]);
303048
- if (settled === TIMEOUT) {
303049
- this.#status.set(family$1, "timed_out");
303050
- return {
303051
- family: family$1,
303052
- status: "timed_out"
303053
- };
303054
- }
303055
- const status = settled.length > 0 ? "loaded" : "fallback_used";
303056
- this.#status.set(family$1, status);
303057
- return {
303058
- family: family$1,
303059
- status
303060
- };
303061
- } catch {
303062
- this.#status.set(family$1, "failed");
303063
- this.#warnLoadFailureOnce(family$1);
303064
- return {
303065
- family: family$1,
303066
- status: "failed"
303067
- };
303068
- } finally {
303069
- this.#cancelTimeout(handle3);
303070
- }
303071
- }
303072
- #warnLoadFailureOnce(family$1) {
303073
- if (this.#warnedFailures.has(family$1))
303074
- return;
303075
- this.#warnedFailures.add(family$1);
303076
- const sources = this.#sources.get(family$1);
303077
- const detail = sources && sources.length ? ` from ${sources.join(", ")}` : "";
303078
- console.warn(`[superdoc] font asset failed to load for "${family$1}"${detail}. Check fonts.assetBaseUrl / fonts.resolveAssetUrl so the bundled .woff2 are served.`);
303079
- }
303080
- }, registriesByFontSet, domlessRegistry = null, hashParagraphBorder$2 = (border) => {
303637
+ }, hashParagraphBorder$2 = (border) => {
303081
303638
  const parts = [];
303082
303639
  if (border.style !== undefined)
303083
303640
  parts.push(`s:${border.style}`);
@@ -310990,8 +311547,8 @@ menclose::after {
310990
311547
  return typeof width === "number" ? width : 0;
310991
311548
  }, isLineBreakRun$1 = (run2) => run2.kind === "lineBreak" || run2.kind === "break" && run2.breakType === "line", markerFontString = (run2) => {
310992
311549
  const size$1 = run2?.fontSize ?? 16;
310993
- const family$1 = run2?.fontFamily ?? "Arial";
310994
- return `${run2?.italic ? "italic " : ""}${run2?.bold ? "bold " : ""}${size$1}px ${family$1}`.trim();
311550
+ const family2 = run2?.fontFamily ?? "Arial";
311551
+ return `${run2?.italic ? "italic " : ""}${run2?.bold ? "bold " : ""}${size$1}px ${family2}`.trim();
310995
311552
  }, buildTabStopsPx$1 = (indent2, tabs, tabIntervalTwips) => {
310996
311553
  const paragraphIndentTwips = {
310997
311554
  left: pxToTwips$1(sanitizeIndent$1(indent2?.left)),
@@ -318433,7 +318990,7 @@ menclose::after {
318433
318990
  const usedFaces = this.#getUsedFaces?.() ?? [];
318434
318991
  const faceRows = buildFaceReport(usedFaces, registry3, resolver2);
318435
318992
  const usedFamilies = new Set(usedFaces.map((u) => u.logicalFamily.toLowerCase()));
318436
- const declaredRows = buildFontReport(declared.filter((family$1) => family$1 && !usedFamilies.has(family$1.toLowerCase())), registry3, resolver2);
318993
+ const declaredRows = buildFontReport(declared.filter((family2) => family2 && !usedFamilies.has(family2.toLowerCase())), registry3, resolver2);
318437
318994
  return [...faceRows, ...declaredRows];
318438
318995
  }
318439
318996
  async ensureReadyForMeasure() {
@@ -318451,7 +319008,7 @@ menclose::after {
318451
319008
  }
318452
319009
  const keyed = required2.map((r$1) => ({
318453
319010
  request: r$1,
318454
- key: faceKeyOf(r$1.family, r$1.weight, r$1.style)
319011
+ key: faceKeyOf2(r$1.family, r$1.weight, r$1.style)
318455
319012
  }));
318456
319013
  const signature = keyed.map((k$1) => k$1.key).sort().join("|");
318457
319014
  if (signature === this.#requiredSignature && keyed.every((k$1) => registry3.getFaceStatus(k$1.request) === "loaded") && this.#lastSummary)
@@ -318468,7 +319025,7 @@ menclose::after {
318468
319025
  }
318469
319026
  const failedKeys = [];
318470
319027
  for (const result of results) {
318471
- const key2 = faceKeyOf(result.request.family, result.request.weight, result.request.style);
319028
+ const key2 = faceKeyOf2(result.request.family, result.request.weight, result.request.style);
318472
319029
  if (result.status === "loaded")
318473
319030
  this.#seenAvailableFaces.add(key2);
318474
319031
  else if (result.status === "failed" && !this.#seenFailedFaces.has(key2)) {
@@ -318490,7 +319047,7 @@ menclose::after {
318490
319047
  return this.#lastSummary ?? emptySummary();
318491
319048
  }
318492
319049
  const signature = required2.slice().sort().join("|");
318493
- if (signature === this.#requiredSignature && required2.every((family$1) => registry3.getStatus(family$1) === "loaded") && this.#lastSummary)
319050
+ if (signature === this.#requiredSignature && required2.every((family2) => registry3.getStatus(family2) === "loaded") && this.#lastSummary)
318494
319051
  return this.#lastSummary;
318495
319052
  this.#requiredSignature = signature;
318496
319053
  this.#requiredFamilies = new Set(required2);
@@ -318578,7 +319135,7 @@ menclose::after {
318578
319135
  return;
318579
319136
  const changedKeys = [];
318580
319137
  if (this.#requiredFaceKeys.size > 0) {
318581
- const loadedFaceKeys = new Set(faces.map((face) => faceKeyOf(face.family, normalizeWeightToken(face.weight), normalizeStyleToken(face.style))));
319138
+ const loadedFaceKeys = new Set(faces.map((face) => faceKeyOf2(face.family, normalizeWeightToken(face.weight), normalizeStyleToken(face.style))));
318582
319139
  for (const key2 of this.#requiredFaceKeys) {
318583
319140
  if (this.#seenAvailableFaces.has(key2))
318584
319141
  continue;
@@ -318588,13 +319145,13 @@ menclose::after {
318588
319145
  }
318589
319146
  }
318590
319147
  } else {
318591
- const loadedFamilies = new Set(faces.map((face) => normalizeFamilyKey(face.family)));
318592
- for (const family$1 of this.#requiredFamilies) {
318593
- if (this.#seenAvailable.has(family$1))
319148
+ const loadedFamilies = new Set(faces.map((face) => normalizeFamilyKey2(face.family)));
319149
+ for (const family2 of this.#requiredFamilies) {
319150
+ if (this.#seenAvailable.has(family2))
318594
319151
  continue;
318595
- if (loadedFamilies.has(normalizeFamilyKey(family$1))) {
318596
- this.#seenAvailable.add(family$1);
318597
- changedKeys.push(normalizeFamilyKey(family$1));
319152
+ if (loadedFamilies.has(normalizeFamilyKey2(family2))) {
319153
+ this.#seenAvailable.add(family2);
319154
+ changedKeys.push(normalizeFamilyKey2(family2));
318598
319155
  }
318599
319156
  }
318600
319157
  }
@@ -318631,8 +319188,8 @@ menclose::after {
318631
319188
  }
318632
319189
  unmap(families) {
318633
319190
  const before = this.#resolver.signature;
318634
- for (const family$1 of Array.isArray(families) ? families : [families])
318635
- this.#resolver.unmap(family$1);
319191
+ for (const family2 of Array.isArray(families) ? families : [families])
319192
+ this.#resolver.unmap(family2);
318636
319193
  this.#reflowIfChanged(before);
318637
319194
  }
318638
319195
  reset() {
@@ -318672,17 +319229,17 @@ menclose::after {
318672
319229
  throw new Error("[superdoc] fonts.add: the font registry is not ready yet");
318673
319230
  let changed = false;
318674
319231
  for (const entry of families) {
318675
- const family$1 = entry?.family;
319232
+ const family2 = entry?.family;
318676
319233
  const faces = entry?.faces;
318677
- if (typeof family$1 !== "string" || !family$1.trim())
319234
+ if (typeof family2 !== "string" || !family2.trim())
318678
319235
  throw new Error('[superdoc] fonts.add: each family needs a non-empty "family" name');
318679
319236
  if (!Array.isArray(faces) || faces.length === 0)
318680
- throw new Error(`[superdoc] fonts.add: family "${family$1}" needs at least one face in "faces"`);
319237
+ throw new Error(`[superdoc] fonts.add: family "${family2}" needs at least one face in "faces"`);
318681
319238
  for (const face of faces) {
318682
319239
  if (!face || typeof face.source !== "string" || !face.source.trim())
318683
- throw new Error(`[superdoc] fonts.add: family "${family$1}" has a face with no "source" URL`);
319240
+ throw new Error(`[superdoc] fonts.add: family "${family2}" has a face with no "source" URL`);
318684
319241
  if (registry3.register({
318685
- family: family$1,
319242
+ family: family2,
318686
319243
  source: toCssFontSource(face.source),
318687
319244
  descriptors: {
318688
319245
  weight: face.weight == null ? undefined : String(face.weight),
@@ -318702,7 +319259,7 @@ menclose::after {
318702
319259
  const registry3 = this.#getGate()?.resolveRegistry();
318703
319260
  if (!registry3)
318704
319261
  throw new Error("[superdoc] fonts.preload: the font registry is not ready yet");
318705
- const hasFace = (family$1, weight, style2) => registry3.hasFace(family$1, weight, style2);
319262
+ const hasFace = (family2, weight, style2) => registry3.hasFace(family2, weight, style2);
318706
319263
  const face = {
318707
319264
  weight: "400",
318708
319265
  style: "normal"
@@ -318825,7 +319382,7 @@ menclose::after {
318825
319382
  return;
318826
319383
  console.log(...args$1);
318827
319384
  }, HEADER_FOOTER_INIT_BUDGET_MS = 200, MAX_ZOOM_WARNING_THRESHOLD = 10, MAX_SELECTION_RECTS_PER_USER = 100, SEMANTIC_RESIZE_DEBOUNCE_MS = 120, MIN_SEMANTIC_CONTENT_WIDTH_PX = 1, GLOBAL_PERFORMANCE, PresentationEditor, ICONS, TEXTS, tableActionsOptions, TRACKED_MARK_NAMES;
318828
- var init_src_BhZiOqOm_es = __esm(() => {
319385
+ var init_src_BjtupAUl_es = __esm(() => {
318829
319386
  init_rolldown_runtime_Bg48TavK_es();
318830
319387
  init_SuperConverter_bEQ45IUD_es();
318831
319388
  init_jszip_C49i9kUs_es();
@@ -318839,6 +319396,7 @@ var init_src_BhZiOqOm_es = __esm(() => {
318839
319396
  init_remark_stringify_6MMJfY0k_es();
318840
319397
  init_DocxZipper_Bu2Fhqkw_es();
318841
319398
  init__plugin_vue_export_helper_5t5P5NuM_es();
319399
+ init_create_super_doc_ui_tVaowTvG_es();
318842
319400
  init_eventemitter3_BnGqBE_Q_es();
318843
319401
  init_errors_CNaD6vcg_es();
318844
319402
  init_blank_docx_1Y_uWgjm_es();
@@ -339477,44 +340035,15 @@ function print() { __p += __j.call(arguments, '') }
339477
340035
  };
339478
340036
  }
339479
340037
  }, [["__scopeId", "data-v-d25821a5"]]);
339480
- TOOLBAR_FONTS = [
339481
- {
339482
- label: "Georgia",
339483
- key: "Georgia, serif",
339484
- fontWeight: 400,
339485
- props: {
339486
- style: { fontFamily: "Georgia, serif" },
339487
- "data-item": "btn-fontFamily-option"
339488
- }
339489
- },
339490
- {
339491
- label: "Arial",
339492
- key: "Arial, sans-serif",
339493
- fontWeight: 400,
339494
- props: {
339495
- style: { fontFamily: "Arial, sans-serif" },
339496
- "data-item": "btn-fontFamily-option"
339497
- }
339498
- },
339499
- {
339500
- label: "Courier New",
339501
- key: "Courier New, monospace",
339502
- fontWeight: 400,
339503
- props: {
339504
- style: { fontFamily: "Courier New, monospace" },
339505
- "data-item": "btn-fontFamily-option"
339506
- }
339507
- },
339508
- {
339509
- label: "Times New Roman",
339510
- key: "Times New Roman, serif",
339511
- fontWeight: 400,
339512
- props: {
339513
- style: { fontFamily: "Times New Roman, serif" },
339514
- "data-item": "btn-fontFamily-option"
339515
- }
340038
+ TOOLBAR_FONTS = getDefaultFontOfferings().map((offering) => ({
340039
+ label: offering.logicalFamily,
340040
+ key: fontOfferingStack(offering),
340041
+ fontWeight: 400,
340042
+ props: {
340043
+ style: { fontFamily: fontOfferingRenderStack(offering) },
340044
+ "data-item": "btn-fontFamily-option"
339516
340045
  }
339517
- ];
340046
+ }));
339518
340047
  TOOLBAR_FONT_SIZES = [
339519
340048
  {
339520
340049
  label: "8",
@@ -345827,229 +346356,6 @@ function print() { __p += __j.call(arguments, '') }
345827
346356
  wave: 1,
345828
346357
  doubleWave: 2
345829
346358
  };
345830
- SETTLED_STATUSES = [
345831
- "loaded",
345832
- "failed",
345833
- "timed_out",
345834
- "fallback_used"
345835
- ];
345836
- SUBSTITUTION_EVIDENCE = Object.freeze([
345837
- {
345838
- evidenceId: "calibri",
345839
- logicalFamily: "Calibri",
345840
- physicalFamily: "Carlito",
345841
- verdict: "metric_safe",
345842
- faces: {
345843
- regular: true,
345844
- bold: true,
345845
- italic: true,
345846
- boldItalic: true
345847
- },
345848
- advance: {
345849
- meanDelta: 0,
345850
- maxDelta: 0
345851
- },
345852
- gates: {
345853
- static: "pass",
345854
- metric: "pass",
345855
- layout: "pass",
345856
- ship: "pass"
345857
- },
345858
- policyAction: "substitute",
345859
- measurementRefs: ["calibri__carlito#analytic_advance#2026-06-03", "calibri__carlito#face_aggregate#2026-06-03"],
345860
- candidateLicense: "OFL-1.1",
345861
- exportRule: "preserve_original_name"
345862
- },
345863
- {
345864
- evidenceId: "cambria",
345865
- logicalFamily: "Cambria",
345866
- physicalFamily: "Caladea",
345867
- verdict: "visual_only",
345868
- faceVerdicts: {
345869
- regular: "metric_safe",
345870
- bold: "metric_safe",
345871
- italic: "metric_safe",
345872
- boldItalic: "visual_only"
345873
- },
345874
- glyphExceptions: [{
345875
- slot: "boldItalic",
345876
- codepoint: 96,
345877
- advanceDelta: 0.231,
345878
- note: "Caladea Bold Italic grave accent (U+0060) advance diverges ~23% from Cambria; lines containing it reflow."
345879
- }],
345880
- faces: {
345881
- regular: true,
345882
- bold: true,
345883
- italic: true,
345884
- boldItalic: true
345885
- },
345886
- advance: {
345887
- meanDelta: 0.0002378,
345888
- maxDelta: 0.2310758
345889
- },
345890
- gates: {
345891
- static: "pass",
345892
- metric: "pass",
345893
- layout: "not_run",
345894
- ship: "pass"
345895
- },
345896
- policyAction: "substitute",
345897
- measurementRefs: [
345898
- "cambria_regular__caladea#regular#w400#d2f6cad3#analytic_advance#2026-06-04",
345899
- "cambria_bold__caladea#bold#w700#74eda4fc#analytic_advance#2026-06-04",
345900
- "cambria_italic__caladea#italic#w400#9c968bf6#analytic_advance#2026-06-04",
345901
- "cambria_boldItalic__caladea#boldItalic#w700#f47a35ad#analytic_advance#2026-06-04"
345902
- ],
345903
- candidateLicense: "Apache-2.0",
345904
- exportRule: "preserve_original_name"
345905
- },
345906
- {
345907
- evidenceId: "arial",
345908
- logicalFamily: "Arial",
345909
- physicalFamily: "Liberation Sans",
345910
- verdict: "metric_safe",
345911
- faces: {
345912
- regular: true,
345913
- bold: true,
345914
- italic: true,
345915
- boldItalic: true
345916
- },
345917
- advance: {
345918
- meanDelta: 0,
345919
- maxDelta: 0
345920
- },
345921
- gates: {
345922
- static: "pass",
345923
- metric: "pass",
345924
- layout: "not_run",
345925
- ship: "pass"
345926
- },
345927
- policyAction: "substitute",
345928
- measurementRefs: ["arial__liberation-sans#analytic_advance#2026-06-03"],
345929
- candidateLicense: "OFL-1.1",
345930
- exportRule: "preserve_original_name"
345931
- },
345932
- {
345933
- evidenceId: "times-new-roman",
345934
- logicalFamily: "Times New Roman",
345935
- physicalFamily: "Liberation Serif",
345936
- verdict: "metric_safe",
345937
- faces: {
345938
- regular: true,
345939
- bold: true,
345940
- italic: true,
345941
- boldItalic: true
345942
- },
345943
- advance: {
345944
- meanDelta: 0,
345945
- maxDelta: 0
345946
- },
345947
- gates: {
345948
- static: "pass",
345949
- metric: "pass",
345950
- layout: "not_run",
345951
- ship: "pass"
345952
- },
345953
- policyAction: "substitute",
345954
- measurementRefs: ["times-new-roman__liberation-serif#analytic_advance#2026-06-03"],
345955
- candidateLicense: "OFL-1.1",
345956
- exportRule: "preserve_original_name"
345957
- },
345958
- {
345959
- evidenceId: "courier-new",
345960
- logicalFamily: "Courier New",
345961
- physicalFamily: "Liberation Mono",
345962
- verdict: "metric_safe",
345963
- faces: {
345964
- regular: true,
345965
- bold: true,
345966
- italic: true,
345967
- boldItalic: true
345968
- },
345969
- advance: {
345970
- meanDelta: 0,
345971
- maxDelta: 0
345972
- },
345973
- gates: {
345974
- static: "pass",
345975
- metric: "pass",
345976
- layout: "not_run",
345977
- ship: "pass"
345978
- },
345979
- policyAction: "substitute",
345980
- measurementRefs: ["courier-new__liberation-mono#analytic_advance#2026-06-03"],
345981
- candidateLicense: "OFL-1.1",
345982
- exportRule: "preserve_original_name"
345983
- },
345984
- {
345985
- evidenceId: "helvetica",
345986
- logicalFamily: "Helvetica",
345987
- physicalFamily: "Liberation Sans",
345988
- verdict: "metric_safe",
345989
- faces: {
345990
- regular: true,
345991
- bold: true,
345992
- italic: true,
345993
- boldItalic: true
345994
- },
345995
- advance: {
345996
- meanDelta: 0,
345997
- maxDelta: 0
345998
- },
345999
- gates: {
346000
- static: "not_run",
346001
- metric: "pass",
346002
- layout: "not_run",
346003
- ship: "fail"
346004
- },
346005
- policyAction: "substitute",
346006
- measurementRefs: ["helvetica__liberation-sans#analytic_advance#2026-06-03"],
346007
- candidateLicense: "OFL-1.1",
346008
- exportRule: "preserve_original_name"
346009
- },
346010
- {
346011
- evidenceId: "calibri-light",
346012
- logicalFamily: "Calibri Light",
346013
- physicalFamily: "Carlito",
346014
- verdict: "visual_only",
346015
- faces: {
346016
- regular: false,
346017
- bold: false,
346018
- italic: false,
346019
- boldItalic: false
346020
- },
346021
- advance: {
346022
- meanDelta: 0.0148,
346023
- maxDelta: 0.066
346024
- },
346025
- gates: {
346026
- static: "not_run",
346027
- metric: "fail",
346028
- layout: "not_run",
346029
- ship: "fail"
346030
- },
346031
- policyAction: "category_fallback",
346032
- measurementRefs: ["calibri-light__carlito#analytic_advance#2026-06-05"],
346033
- candidateLicense: "OFL-1.1",
346034
- exportRule: "preserve_original_name"
346035
- }
346036
- ]);
346037
- BUNDLED_SUBSTITUTES = deriveBundledSubstitutes();
346038
- CATEGORY_FALLBACKS = deriveCategoryFallbacks();
346039
- defaultResolver = new FontResolver;
346040
- DEFAULT_FONT_MEASURE_CONTEXT = Object.freeze({
346041
- resolvePhysical: (cssFontFamily, _face) => resolvePhysicalFamily(cssFontFamily),
346042
- fontSignature: ""
346043
- });
346044
- BUNDLED_MANIFEST = Object.freeze([
346045
- family("Carlito", "Carlito", "OFL-1.1"),
346046
- family("Caladea", "Caladea", "Apache-2.0"),
346047
- family("Liberation Sans", "LiberationSans", "OFL-1.1"),
346048
- family("Liberation Serif", "LiberationSerif", "OFL-1.1"),
346049
- family("Liberation Mono", "LiberationMono", "OFL-1.1")
346050
- ]);
346051
- installedRegistries = /* @__PURE__ */ new WeakMap;
346052
- registriesByFontSet = /* @__PURE__ */ new WeakMap;
346053
346359
  PX_PER_PT$12 = 96 / 72;
346054
346360
  BORDER_SIDES2 = [
346055
346361
  "top",
@@ -347335,7 +347641,7 @@ function print() { __p += __j.call(arguments, '') }
347335
347641
  });
347336
347642
  #fontPlanBlocks = null;
347337
347643
  #fontPlan = null;
347338
- #hasFace = (family$1, weight, style2) => this.#fontGate ? this.#fontGate.resolveRegistry().hasFace(family$1, weight, style2) : false;
347644
+ #hasFace = (family2, weight, style2) => this.#fontGate ? this.#fontGate.resolveRegistry().hasFace(family2, weight, style2) : false;
347339
347645
  #lastFontsChangedKey = null;
347340
347646
  #lastFontsChangedVersion = -1;
347341
347647
  #lastFontsChangedPayload = null;
@@ -353911,39 +354217,6 @@ function print() { __p += __j.call(arguments, '') }
353911
354217
  ]);
353912
354218
  });
353913
354219
 
353914
- // ../../packages/superdoc/dist/chunks/create-super-doc-ui-C2hkLuct.es.js
353915
- var MOD_ALIASES, ALT_ALIASES, CTRL_ALIASES, SHIFT_ALIASES, BUILTIN_CONTEXT_MENU_GROUPS, BUILTIN_GROUP_ORDER, RESERVED_PROXY_PROPERTY_NAMES, ALL_TOOLBAR_COMMAND_IDS, EMPTY_ACTIVE_IDS;
353916
- var init_create_super_doc_ui_C2hkLuct_es = __esm(() => {
353917
- init_SuperConverter_bEQ45IUD_es();
353918
- init_create_headless_toolbar_BmFWtej0_es();
353919
- MOD_ALIASES = new Set([
353920
- "Mod",
353921
- "Meta",
353922
- "Cmd",
353923
- "Command"
353924
- ]);
353925
- ALT_ALIASES = new Set(["Alt", "Option"]);
353926
- CTRL_ALIASES = new Set(["Control", "Ctrl"]);
353927
- SHIFT_ALIASES = new Set(["Shift"]);
353928
- BUILTIN_CONTEXT_MENU_GROUPS = [
353929
- "format",
353930
- "clipboard",
353931
- "review",
353932
- "comment",
353933
- "link"
353934
- ];
353935
- BUILTIN_GROUP_ORDER = new Map(BUILTIN_CONTEXT_MENU_GROUPS.map((g2, i4) => [g2, i4]));
353936
- RESERVED_PROXY_PROPERTY_NAMES = new Set([
353937
- "register",
353938
- "get",
353939
- "has",
353940
- "require",
353941
- "getContextMenuItems"
353942
- ]);
353943
- ALL_TOOLBAR_COMMAND_IDS = Object.keys(createToolbarRegistry());
353944
- EMPTY_ACTIVE_IDS = Object.freeze([]);
353945
- });
353946
-
353947
354220
  // ../../packages/superdoc/dist/chunks/ui-C5PAS9hY.es.js
353948
354221
  var init_ui_C5PAS9hY_es = () => {};
353949
354222
 
@@ -353957,7 +354230,7 @@ var init_zipper_yaJVJ4z9_es = __esm(() => {
353957
354230
 
353958
354231
  // ../../packages/superdoc/dist/super-editor.es.js
353959
354232
  var init_super_editor_es = __esm(() => {
353960
- init_src_BhZiOqOm_es();
354233
+ init_src_BjtupAUl_es();
353961
354234
  init_SuperConverter_bEQ45IUD_es();
353962
354235
  init_jszip_C49i9kUs_es();
353963
354236
  init_xml_js_CqGKpaft_es();
@@ -353966,7 +354239,7 @@ var init_super_editor_es = __esm(() => {
353966
354239
  init_dist_B8HfvhaK_es();
353967
354240
  init_unified_Dsuw2be5_es();
353968
354241
  init_DocxZipper_Bu2Fhqkw_es();
353969
- init_create_super_doc_ui_C2hkLuct_es();
354242
+ init_create_super_doc_ui_tVaowTvG_es();
353970
354243
  init_ui_C5PAS9hY_es();
353971
354244
  init_eventemitter3_BnGqBE_Q_es();
353972
354245
  init_errors_CNaD6vcg_es();