superdoc 2.29.0-next.9 → 2.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/dist/chunks/{FindReplaceSurface-BKVHzhQ4.es.js → FindReplaceSurface-B_5ggdWg.es.js} +1 -1
  2. package/dist/chunks/{FindReplaceSurface-BNDrJ6VS.cjs → FindReplaceSurface-fVHxPXtn.cjs} +1 -1
  3. package/dist/chunks/{PasswordPromptSurface-6mF6Azda.es.js → PasswordPromptSurface-CZqhDQQ1.es.js} +1 -1
  4. package/dist/chunks/{PasswordPromptSurface-BNkaztaP.cjs → PasswordPromptSurface-x8GNmMJT.cjs} +1 -1
  5. package/dist/chunks/{PdfViewer-aOWhUVI7.es.js → PdfViewer-CW09MNrB.es.js} +4 -10
  6. package/dist/chunks/{PdfViewer-DmSkZehl.cjs → PdfViewer-CkrAHpC-.cjs} +4 -10
  7. package/dist/chunks/{_plugin-vue_export-helper-6MBoygIY.cjs → _plugin-vue_export-helper-BkbCxNeT.cjs} +31 -7
  8. package/dist/chunks/{_plugin-vue_export-helper-CsJQtMvr.es.js → _plugin-vue_export-helper-DRPRMkeA.es.js} +20 -8
  9. package/dist/chunks/{create-super-doc-ui-Bm5kmx0W.es.js → create-super-doc-ui-Dc8dQAMc.es.js} +83 -114
  10. package/dist/chunks/{create-super-doc-ui-DN70aatf.cjs → create-super-doc-ui-L60GhVAX.cjs} +199 -236
  11. package/dist/collaboration-upgrade-engine.cjs +1 -1
  12. package/dist/collaboration-upgrade-engine.es.js +1 -1
  13. package/dist/document-api/src/contract/command-catalog.d.ts +1 -1
  14. package/dist/public/ui-react.cjs +1 -1
  15. package/dist/public/ui-react.es.js +1 -1
  16. package/dist/public/ui-vue.cjs +1 -1
  17. package/dist/public/ui-vue.es.js +1 -1
  18. package/dist/public/ui.cjs +1 -1
  19. package/dist/public/ui.es.js +1 -1
  20. package/dist/style.css +1 -1
  21. package/dist/style.layered.css +1 -1
  22. package/dist/superdoc/src/components/CommentsLayer/collect-removed-comment-ids.d.ts +11 -1
  23. package/dist/superdoc/src/components/CommentsLayer/collect-tracked-change-thread.d.ts +19 -2
  24. package/dist/superdoc/src/components/CommentsLayer/comment-urls.d.ts +1 -1
  25. package/dist/superdoc/src/components/CommentsLayer/commentsList/super-comments-list.d.ts +23 -20
  26. package/dist/superdoc/src/components/CommentsLayer/helpers.d.ts +1 -4
  27. package/dist/superdoc/src/components/CommentsLayer/tracked-change-threading.d.ts +16 -1
  28. package/dist/superdoc/src/components/Whiteboard/WhiteboardLayer.vue.d.ts +4 -5
  29. package/dist/superdoc/src/components/Whiteboard/WhiteboardPage.vue.d.ts +3 -4
  30. package/dist/superdoc/src/components/Whiteboard/whiteboard-types.d.ts +2 -0
  31. package/dist/superdoc/src/components/surfaces/watermark-surface-runtime.d.ts +7 -7
  32. package/dist/superdoc/src/composables/use-comment-small-screen.d.ts +11 -7
  33. package/dist/superdoc/src/composables/use-compact-comment-popover.d.ts +44 -18
  34. package/dist/superdoc/src/composables/use-find-replace.d.ts +13 -3
  35. package/dist/superdoc/src/composables/use-password-prompt.d.ts +1 -1
  36. package/dist/superdoc/src/composables/use-viewport-fit.d.ts +62 -26
  37. package/dist/superdoc/src/core/SuperDoc.d.ts +3 -3
  38. package/dist/superdoc/src/core/pdf/pdf-adapter.d.ts +6 -2
  39. package/dist/superdoc/src/core/types/index.d.ts +37 -4
  40. package/dist/superdoc/src/core/v2-integration/browser-peer-runtime.d.ts +5 -3
  41. package/dist/superdoc/src/core/v2-integration/cdn-engine-loader.d.ts +3 -13
  42. package/dist/superdoc/src/core/v2-integration/internal-vue-runtime.d.ts +64 -59
  43. package/dist/superdoc/src/helpers/object-guards.d.ts +1 -0
  44. package/dist/superdoc/src/helpers/v2-author-required-rejection.d.ts +8 -11
  45. package/dist/superdoc/src/helpers/v2-bulk-decision-event.d.ts +9 -7
  46. package/dist/superdoc/src/helpers/v2-keyboard-edit-rejection.d.ts +8 -7
  47. package/dist/superdoc/src/helpers/v2-mutation-exception.d.ts +12 -8
  48. package/dist/superdoc/src/helpers/v2-review-target.d.ts +11 -1
  49. package/dist/superdoc/src/helpers/v2-selection-sync.d.ts +40 -14
  50. package/dist/superdoc/src/helpers/v2-typing-mutation-event.d.ts +14 -5
  51. package/dist/superdoc/src/icons.d.ts +11 -19
  52. package/dist/superdoc/src/internal/diagnostics/translate-diagnostic.d.ts +6 -4
  53. package/dist/superdoc/src/internal/toolbar/built-in/PageNumberMenu.vue.d.ts +25 -15
  54. package/dist/superdoc/src/internal/toolbar/built-in/constants.d.ts +3 -1
  55. package/dist/superdoc/src/internal/toolbar/built-in/font-options.d.ts +15 -1
  56. package/dist/superdoc/src/internal/toolbar/built-in/font-typeahead.d.ts +37 -7
  57. package/dist/superdoc/src/internal/toolbar/built-in/format-negation.d.ts +10 -4
  58. package/dist/superdoc/src/internal/toolbar/built-in/general.d.ts +12 -1
  59. package/dist/superdoc/src/internal/toolbar/built-in/helpers.d.ts +9 -4
  60. package/dist/superdoc/src/internal/toolbar/built-in/list-style-buttons.d.ts +2 -2
  61. package/dist/superdoc/src/internal/toolbar/built-in/page-number-feedback.d.ts +4 -5
  62. package/dist/superdoc/src/internal/toolbar/built-in/scroll-helpers.d.ts +3 -4
  63. package/dist/superdoc/src/internal/toolbar/built-in/toolbarIcons.d.ts +78 -145
  64. package/dist/superdoc/src/internal/toolbar/built-in/url-safety.d.ts +11 -3
  65. package/dist/superdoc/src/internal/toolbar/built-in-toolbar.d.ts +4 -3
  66. package/dist/superdoc/src/internal/toolbar/image-upload.d.ts +29 -39
  67. package/dist/superdoc/src/public/ui/format-painter-helpers.d.ts +2 -8
  68. package/dist/superdoc/src/stores/comments-store.d.ts +7 -7
  69. package/dist/superdoc/src/stores/helpers/comment-document-scope.d.ts +22 -0
  70. package/dist/superdoc/src/stores/helpers/pending-selection-snapshot.d.ts +17 -0
  71. package/dist/superdoc/src/stores/helpers/tracked-change-compaction.d.ts +16 -0
  72. package/dist/superdoc/src/stores/helpers/tracked-change-decision.d.ts +45 -0
  73. package/dist/superdoc/src/stores/superdoc-store.d.ts +21 -21
  74. package/dist/superdoc.cjs +423 -464
  75. package/dist/superdoc.es.js +335 -376
  76. package/dist-cdn/style.layered.css +1 -1
  77. package/dist-cdn/superdoc.min.css +1 -1
  78. package/dist-cdn/superdoc.min.js +41 -41
  79. package/package.json +3 -2
  80. package/dist/superdoc/src/main.d.ts +0 -1
@@ -1,4 +1,4 @@
1
- const require__plugin_vue_export_helper = require("./_plugin-vue_export-helper-6MBoygIY.cjs");
1
+ const require__plugin_vue_export_helper = require("./_plugin-vue_export-helper-BkbCxNeT.cjs");
2
2
  const require_is_finite_number = require("./is-finite-number-BEXgTRgc.cjs");
3
3
  //#region src/internal/diagnostics/workflow-recording.ts
4
4
  var fields$1 = /* @__PURE__ */ new Set([
@@ -1079,11 +1079,6 @@ var decodeLayoutStoryDataset = (raw) => {
1079
1079
  `${DOM_CLASS_NAMES.BLOCK_SDT}${DATA_ATTRS.SDT_ID}`;
1080
1080
  `${DATA_ATTRS.DRAGGABLE}`;
1081
1081
  //#endregion
1082
- //#region src/helpers/object-guards.ts
1083
- function isPlainObject(value) {
1084
- return typeof value === "object" && value !== null && !Array.isArray(value);
1085
- }
1086
- //#endregion
1087
1082
  //#region src/helpers/tracked-change-comment-lane.ts
1088
1083
  var TRACKED_CHANGE_COMMENT_LANE_ID_PREFIX = "tc-comment:";
1089
1084
  function isSyntheticTrackedChangeCommentLaneItem(item) {
@@ -1304,7 +1299,7 @@ function shallowEqual(a, b) {
1304
1299
  return true;
1305
1300
  }
1306
1301
  //#endregion
1307
- //#region src/internal/toolbar/image-upload.js
1302
+ //#region src/internal/toolbar/image-upload.ts
1308
1303
  /**
1309
1304
  * Interactive image acquisition for the built-in toolbar (SD-3567).
1310
1305
  *
@@ -1325,8 +1320,6 @@ var SUPPORTED_IMAGE_EXTENSIONS = /\.(png|jpe?g)$/i;
1325
1320
  /**
1326
1321
  * Whether a picked/dropped file is an insertable image (PNG/JPEG). Falls back
1327
1322
  * to the file extension when the browser reports no MIME type.
1328
- * @param {File | null | undefined} file
1329
- * @returns {boolean}
1330
1323
  */
1331
1324
  function isSupportedImageFile(file) {
1332
1325
  if (!file) return false;
@@ -1341,8 +1334,6 @@ function isSupportedImageFile(file) {
1341
1334
  * accepts those by extension, but `readAsDataURL` would then produce an
1342
1335
  * `application/octet-stream` data URI that `create.image` rejects. Rewrite
1343
1336
  * the media type from the filename so extension-accepted files still insert.
1344
- * @param {Blob & { name?: string }} file
1345
- * @returns {Promise<string>}
1346
1337
  */
1347
1338
  function fileToDataUri(file) {
1348
1339
  return new Promise((resolve, reject) => {
@@ -1355,9 +1346,6 @@ function fileToDataUri(file) {
1355
1346
  /**
1356
1347
  * Ensure a data URI read from a supported file carries a PNG/JPEG media type.
1357
1348
  * Leaves URIs already typed as a supported image (or uninferable ones) alone.
1358
- * @param {string} dataUri
1359
- * @param {(Blob & { name?: string }) | null | undefined} file
1360
- * @returns {string}
1361
1349
  */
1362
1350
  function normalizeImageDataUri(dataUri, file) {
1363
1351
  const match = /^data:([^;,]*);base64,/.exec(dataUri);
@@ -1374,9 +1362,6 @@ function normalizeImageDataUri(dataUri, file) {
1374
1362
  * `handleImageUpload` callback when configured (V1 contract:
1375
1363
  * `(file: File) => Promise<string>`). A returned non-data URL is fetched and
1376
1364
  * embedded, because `create.image` requires an embedded base64 data URI.
1377
- * @param {File} file
1378
- * @param {((file: File) => Promise<string>) | null | undefined} handleImageUpload
1379
- * @returns {Promise<string>}
1380
1365
  */
1381
1366
  async function resolveImageSrc(file, handleImageUpload) {
1382
1367
  if (typeof handleImageUpload === "function") {
@@ -1392,9 +1377,6 @@ async function resolveImageSrc(file, handleImageUpload) {
1392
1377
  * presigned URLs often respond `application/octet-stream`, so keep a filename
1393
1378
  * hint (URL path, falling back to the originally picked file) for the media
1394
1379
  * type normalization in `fileToDataUri`.
1395
- * @param {string} url
1396
- * @param {File | null | undefined} pickedFile
1397
- * @returns {Promise<string>}
1398
1380
  */
1399
1381
  async function embedRemoteImage(url, pickedFile) {
1400
1382
  const response = await fetch(url);
@@ -1408,13 +1390,6 @@ async function embedRemoteImage(url, pickedFile) {
1408
1390
  * stays attached (hidden) so automation and tests can drive it; `destroy()`
1409
1391
  * removes it. Picking a file calls `onPick(file)`; an unsupported type or a
1410
1392
  * failed pick routes through `onError(error)`.
1411
- *
1412
- * @param {{
1413
- * ownerDocument?: Document,
1414
- * onPick?: (file: File) => unknown,
1415
- * onError?: (error: Error) => void,
1416
- * }} options
1417
- * @returns {{ input: HTMLInputElement, open: () => void, destroy: () => void }}
1418
1393
  */
1419
1394
  function createImageFilePicker({ ownerDocument = document, onPick, onError } = {}) {
1420
1395
  const input = ownerDocument.createElement("input");
@@ -2007,13 +1982,9 @@ var WatermarkSurface_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/
2007
1982
  //#region src/components/surfaces/WatermarkSurface.vue
2008
1983
  var WatermarkSurface_default = /* @__PURE__ */ require__plugin_vue_export_helper._plugin_vue_export_helper_default(WatermarkSurface_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-df56c82c"]]);
2009
1984
  //#endregion
2010
- //#region src/components/surfaces/watermark-surface-runtime.js
2011
- /**
2012
- * Keeps Vue rendering and post-dismissal announcements outside the public type graph.
2013
- * @param {(() => HTMLElement | null) | undefined} getContainer
2014
- */
1985
+ //#region src/components/surfaces/watermark-surface-runtime.ts
1986
+ /** Keeps Vue rendering and post-dismissal announcements outside the public type graph. */
2015
1987
  function createWatermarkSurfaceRuntime(getContainer) {
2016
- /** @type {HTMLDivElement | null} */
2017
1988
  let status = null;
2018
1989
  let disposed = false;
2019
1990
  return {
@@ -2024,7 +1995,6 @@ function createWatermarkSurfaceRuntime(getContainer) {
2024
1995
  const item = opener?.closest("[data-sd-part=\"toolbar-item\"]") ?? opener?.querySelector("[data-sd-part=\"toolbar-item\"]");
2025
1996
  const container = (item?.closest("[data-sd-part=\"toolbar\"]"))?.parentElement;
2026
1997
  const isWatermarkEntry = item?.querySelector("[data-item=\"btn-watermark\"], [data-item=\"btn-overflow\"]");
2027
- /** @param {() => boolean} isCurrent */
2028
1998
  return async (isCurrent) => {
2029
1999
  await require__plugin_vue_export_helper.nextTick();
2030
2000
  if (disposed || !isCurrent() || !isWatermarkEntry || opener?.isConnected || !container?.isConnected) return;
@@ -2056,7 +2026,6 @@ function createWatermarkSurfaceRuntime(getContainer) {
2056
2026
  });
2057
2027
  container.appendChild(status);
2058
2028
  },
2059
- /** @param {string} message */
2060
2029
  announce(message) {
2061
2030
  if (!disposed && status) status.textContent = message;
2062
2031
  },
@@ -2672,34 +2641,33 @@ function fontsValue(value) {
2672
2641
  return Object.keys(result).length > 0 ? result : null;
2673
2642
  }
2674
2643
  //#endregion
2675
- //#region src/public/ui/format-painter-helpers.js
2644
+ //#region src/public/ui/format-painter-helpers.ts
2676
2645
  /**
2677
2646
  * Maps SDRunProps field names to InlineRunPatch field names.
2678
2647
  * SDRunProps (read-side) and InlineRunPatch (write-side) use different keys
2679
2648
  * for the same properties; direct assignment between them is forbidden.
2680
- *
2681
- * @param {Record<string, unknown>} props - SDRunProps object from doc.getNodeById
2682
- * @returns {Record<string, unknown>} InlineRunPatch ready for doc.format.apply
2683
2649
  */
2684
2650
  function sdRunPropsToInlineRunPatch(props) {
2685
2651
  if (!props || typeof props !== "object") return {};
2686
2652
  const patch = {};
2687
- if (props.fonts) patch.rFonts = {
2688
- ascii: props.fonts.ascii,
2689
- hAnsi: props.fonts.hAnsi,
2690
- eastAsia: props.fonts.eastAsia,
2691
- cs: props.fonts.cs,
2692
- asciiTheme: props.fonts.asciiTheme,
2693
- hAnsiTheme: props.fonts.hAnsiTheme,
2694
- eastAsiaTheme: props.fonts.eastAsiaTheme,
2695
- csTheme: props.fonts.csTheme,
2696
- hint: props.fonts.hint
2653
+ const fonts = props.fonts;
2654
+ if (require__plugin_vue_export_helper.isPlainObject(fonts)) patch.rFonts = {
2655
+ ascii: fonts.ascii,
2656
+ hAnsi: fonts.hAnsi,
2657
+ eastAsia: fonts.eastAsia,
2658
+ cs: fonts.cs,
2659
+ asciiTheme: fonts.asciiTheme,
2660
+ hAnsiTheme: fonts.hAnsiTheme,
2661
+ eastAsiaTheme: fonts.eastAsiaTheme,
2662
+ csTheme: fonts.csTheme,
2663
+ hint: fonts.hint
2697
2664
  };
2698
2665
  if (props.fontFamily != null) patch.fontFamily = props.fontFamily;
2699
- if (props.lang) patch.lang = {
2700
- val: props.lang.val,
2701
- eastAsia: props.lang.eastAsia,
2702
- bidi: props.lang.bidi
2666
+ const lang = props.lang;
2667
+ if (require__plugin_vue_export_helper.isPlainObject(lang)) patch.lang = {
2668
+ val: lang.val,
2669
+ eastAsia: lang.eastAsia,
2670
+ bidi: lang.bidi
2703
2671
  };
2704
2672
  if (props.fontSize != null) patch.fontSize = props.fontSize;
2705
2673
  if (props.fontSizeCs != null) patch.fontSizeCs = props.fontSizeCs;
@@ -2740,19 +2708,24 @@ function sdRunPropsToInlineRunPatch(props) {
2740
2708
  function projectColorRefToInlineColor(color) {
2741
2709
  if (!color) return void 0;
2742
2710
  if (typeof color === "string") return color;
2711
+ if (!require__plugin_vue_export_helper.isPlainObject(color)) return void 0;
2743
2712
  if (color.model === "rgb") return color.value;
2744
2713
  if (color.model === "auto") return "auto";
2745
2714
  }
2746
2715
  function projectUnderlineToInlinePatch(underline) {
2747
2716
  if (underline == null) return void 0;
2717
+ if (!require__plugin_vue_export_helper.isPlainObject(underline)) return true;
2748
2718
  const patch = {};
2749
2719
  if (underline.style != null) patch.style = underline.style;
2750
- if (underline.color?.model === "rgb") patch.color = underline.color.value;
2751
- if (underline.color?.model === "theme") patch.themeColor = underline.color.theme;
2720
+ const color = underline.color;
2721
+ if (require__plugin_vue_export_helper.isPlainObject(color)) {
2722
+ if (color.model === "rgb") patch.color = color.value;
2723
+ else if (color.model === "theme") patch.themeColor = color.theme;
2724
+ }
2752
2725
  return Object.keys(patch).length > 0 ? patch : true;
2753
2726
  }
2754
2727
  function projectShadingToInlinePatch(shading) {
2755
- if (!shading) return void 0;
2728
+ if (!require__plugin_vue_export_helper.isPlainObject(shading)) return void 0;
2756
2729
  const patch = {};
2757
2730
  const fill = projectColorRefToInlineColor(shading.fill);
2758
2731
  if (fill != null) patch.fill = fill;
@@ -2762,7 +2735,7 @@ function projectShadingToInlinePatch(shading) {
2762
2735
  return Object.keys(patch).length > 0 ? patch : void 0;
2763
2736
  }
2764
2737
  function projectBorderToInlinePatch(border) {
2765
- if (!border) return void 0;
2738
+ if (!require__plugin_vue_export_helper.isPlainObject(border)) return void 0;
2766
2739
  const patch = {};
2767
2740
  if (border.style != null) patch.val = border.style;
2768
2741
  if (border.width != null) patch.sz = border.width;
@@ -2777,9 +2750,6 @@ function projectBorderToInlinePatch(border) {
2777
2750
  *
2778
2751
  * Falls back to the plain text target when the host has not populated an
2779
2752
  * explicit `selectionTarget` yet.
2780
- *
2781
- * @param {{ selectionTarget?: unknown; target?: unknown } | null | undefined} selection
2782
- * @returns {string}
2783
2753
  */
2784
2754
  function selectionKey(selection) {
2785
2755
  const target = selection?.selectionTarget ?? selection?.target;
@@ -2794,8 +2764,8 @@ function selectionKey(selection) {
2794
2764
  //#region src/helpers/v2-review-mutation-impact.ts
2795
2765
  function mutationCommittedEventChangedVisibleContent(event) {
2796
2766
  if (event.dryRun === true) return false;
2797
- if (isPlainObject(event.result) && event.result.noop === true) return false;
2798
- const receipt = isPlainObject(event.receipt) ? event.receipt : null;
2767
+ if (require__plugin_vue_export_helper.isPlainObject(event.result) && event.result.noop === true) return false;
2768
+ const receipt = require__plugin_vue_export_helper.isPlainObject(event.receipt) ? event.receipt : null;
2799
2769
  if (receipt?.changed === false || receipt?.noop === true || receipt?.status === "NO_OP") return false;
2800
2770
  return true;
2801
2771
  }
@@ -2810,18 +2780,18 @@ function mutationCommittedEventChangedDocument(event) {
2810
2780
  * plans carry the same identities through `trackedChanges` and per-step ids.
2811
2781
  */
2812
2782
  function getV2TrackedChangeMutationImpact(event) {
2813
- if (!isPlainObject(event) || event.type !== "mutation:committed") return null;
2783
+ if (!require__plugin_vue_export_helper.isPlainObject(event) || event.type !== "mutation:committed") return null;
2814
2784
  const payload = event.origin === "history" ? event.result : event.receipt;
2815
- if (!isPlainObject(payload)) return null;
2785
+ if (!require__plugin_vue_export_helper.isPlainObject(payload)) return null;
2816
2786
  const upsertIds = /* @__PURE__ */ new Set();
2817
2787
  const removedIds = /* @__PURE__ */ new Set();
2818
2788
  const remappedPairs = [];
2819
2789
  const collectEntity = (entry, into) => {
2820
- if (!isPlainObject(entry) || entry.kind !== "entity" || entry.entityType !== "trackedChange") return;
2790
+ if (!require__plugin_vue_export_helper.isPlainObject(entry) || entry.kind !== "entity" || entry.entityType !== "trackedChange") return;
2821
2791
  if (typeof entry.entityId === "string" && entry.entityId.length > 0) into.add(entry.entityId);
2822
2792
  };
2823
2793
  const readEntityId = (entry) => {
2824
- if (!isPlainObject(entry) || entry.kind !== "entity" || entry.entityType !== "trackedChange") return null;
2794
+ if (!require__plugin_vue_export_helper.isPlainObject(entry) || entry.kind !== "entity" || entry.entityType !== "trackedChange") return null;
2825
2795
  return typeof entry.entityId === "string" && entry.entityId.length > 0 ? entry.entityId : null;
2826
2796
  };
2827
2797
  if (Array.isArray(payload.inserted)) payload.inserted.forEach((entry) => collectEntity(entry, upsertIds));
@@ -2829,13 +2799,13 @@ function getV2TrackedChangeMutationImpact(event) {
2829
2799
  if (Array.isArray(payload.trackedChangeRefs)) payload.trackedChangeRefs.forEach((entry) => collectEntity(entry, upsertIds));
2830
2800
  if (Array.isArray(payload.trackedChanges)) payload.trackedChanges.forEach((entry) => collectEntity(entry, upsertIds));
2831
2801
  if (Array.isArray(payload.steps)) for (const step of payload.steps) {
2832
- if (!isPlainObject(step) || !Array.isArray(step.trackedChangeIds)) continue;
2802
+ if (!require__plugin_vue_export_helper.isPlainObject(step) || !Array.isArray(step.trackedChangeIds)) continue;
2833
2803
  for (const id of step.trackedChangeIds) if (typeof id === "string" && id.length > 0) upsertIds.add(id);
2834
2804
  }
2835
2805
  if (Array.isArray(payload.removed)) payload.removed.forEach((entry) => collectEntity(entry, removedIds));
2836
2806
  if (Array.isArray(payload.invalidatedRefs)) payload.invalidatedRefs.forEach((entry) => collectEntity(entry, removedIds));
2837
2807
  if (Array.isArray(payload.remappedRefs)) for (const mapping of payload.remappedRefs) {
2838
- if (!isPlainObject(mapping)) continue;
2808
+ if (!require__plugin_vue_export_helper.isPlainObject(mapping)) continue;
2839
2809
  const fromId = readEntityId(mapping.from);
2840
2810
  const toId = readEntityId(mapping.to);
2841
2811
  if (fromId) removedIds.add(fromId);
@@ -2861,10 +2831,10 @@ function getV2TrackedChangeMutationImpact(event) {
2861
2831
  */
2862
2832
  function collectV2InvalidatedCommentIds(event) {
2863
2833
  const removedIds = /* @__PURE__ */ new Set();
2864
- if (!isPlainObject(event) || event.type !== "mutation:committed") return removedIds;
2834
+ if (!require__plugin_vue_export_helper.isPlainObject(event) || event.type !== "mutation:committed") return removedIds;
2865
2835
  const payload = event.origin === "history" ? event.result : event.receipt;
2866
- if (!isPlainObject(payload) || !Array.isArray(payload.invalidatedRefs)) return removedIds;
2867
- for (const ref of payload.invalidatedRefs) if (isPlainObject(ref) && ref.kind === "entity" && ref.entityType === "comment" && typeof ref.entityId === "string" && ref.entityId) removedIds.add(ref.entityId);
2836
+ if (!require__plugin_vue_export_helper.isPlainObject(payload) || !Array.isArray(payload.invalidatedRefs)) return removedIds;
2837
+ for (const ref of payload.invalidatedRefs) if (require__plugin_vue_export_helper.isPlainObject(ref) && ref.kind === "entity" && ref.entityType === "comment" && typeof ref.entityId === "string" && ref.entityId) removedIds.add(ref.entityId);
2868
2838
  return removedIds;
2869
2839
  }
2870
2840
  function applyV2CommentInvalidationFromMutation({ event, commentsStore, superdoc, documentId } = {}) {
@@ -2884,11 +2854,11 @@ function applyV2CommentInvalidationFromMutation({ event, commentsStore, superdoc
2884
2854
  }
2885
2855
  function readAllResolvedFact(event, receipt) {
2886
2856
  const fact = event.trackedChangeAllResolved;
2887
- if (event.origin === "history" || !isPlainObject(fact) || fact.schemaVersion !== 1 || fact.targetKind !== "all" || fact.decision !== "accept" && fact.decision !== "reject" || fact.remainingLogicalCount !== 0 || typeof fact.catalogRevision !== "string" || !fact.catalogRevision || typeof fact.sourceCoverageRevision !== "string" || !fact.sourceCoverageRevision || typeof fact.logicalTargetCount !== "number" || !Number.isSafeInteger(fact.logicalTargetCount) || fact.logicalTargetCount <= 0 || typeof fact.physicalCarrierCount !== "number" || !Number.isSafeInteger(fact.physicalCarrierCount) || fact.physicalCarrierCount < fact.logicalTargetCount || typeof fact.txId !== "string" || fact.txId !== receipt.txId || typeof fact.documentEpoch !== "string" || !Number.isSafeInteger(fact.commitSequence) || typeof fact.packagePreviousRevision !== "string" || typeof fact.packageNextRevision !== "string" || fact.packagePreviousRevision === fact.packageNextRevision) return null;
2857
+ if (event.origin === "history" || !require__plugin_vue_export_helper.isPlainObject(fact) || fact.schemaVersion !== 1 || fact.targetKind !== "all" || fact.decision !== "accept" && fact.decision !== "reject" || fact.remainingLogicalCount !== 0 || typeof fact.catalogRevision !== "string" || !fact.catalogRevision || typeof fact.sourceCoverageRevision !== "string" || !fact.sourceCoverageRevision || typeof fact.logicalTargetCount !== "number" || !Number.isSafeInteger(fact.logicalTargetCount) || fact.logicalTargetCount <= 0 || typeof fact.physicalCarrierCount !== "number" || !Number.isSafeInteger(fact.physicalCarrierCount) || fact.physicalCarrierCount < fact.logicalTargetCount || typeof fact.txId !== "string" || fact.txId !== receipt.txId || typeof fact.documentEpoch !== "string" || !Number.isSafeInteger(fact.commitSequence) || typeof fact.packagePreviousRevision !== "string" || typeof fact.packageNextRevision !== "string" || fact.packagePreviousRevision === fact.packageNextRevision) return null;
2888
2858
  return fact;
2889
2859
  }
2890
2860
  //#endregion
2891
- //#region src/helpers/v2-typing-mutation-event.js
2861
+ //#region src/helpers/v2-typing-mutation-event.ts
2892
2862
  /**
2893
2863
  * Command kinds whose committed mutations belong to the sustained typing
2894
2864
  * cadence class (insert / replace / plain paste / Backspace / Delete).
@@ -2929,9 +2899,6 @@ var V2_TYPING_COMMAND_KINDS = /* @__PURE__ */ new Set([
2929
2899
  * Events without a forwarded `editableCommandKind` (programmatic Document API
2930
2900
  * mutations, history commits, unclassified structural commands) return false
2931
2901
  * so they keep hydrating immediately.
2932
- *
2933
- * @param {{ type?: string, origin?: string, editableCommandKind?: string } | null | undefined} event
2934
- * @returns {boolean}
2935
2902
  */
2936
2903
  var isV2EditableTextMutationEvent = (event) => {
2937
2904
  if (event?.type !== "mutation:committed" || event.origin !== "command") return false;
@@ -4873,20 +4840,20 @@ function hostMethod(target, name) {
4873
4840
  return typeof member === "function" ? (...args) => Reflect.apply(member, target, args) : null;
4874
4841
  }
4875
4842
  function readEffectiveInlineUniformityStates(raw) {
4876
- if (!isPlainObject(raw) || raw.success !== true) return null;
4843
+ if (!require__plugin_vue_export_helper.isPlainObject(raw) || raw.success !== true) return null;
4877
4844
  const states = {};
4878
- if (!isPlainObject(raw.values)) return states;
4845
+ if (!require__plugin_vue_export_helper.isPlainObject(raw.values)) return states;
4879
4846
  for (const [key, entry] of Object.entries(raw.values)) {
4880
4847
  if (!entry) continue;
4881
- states[key] = isPlainObject(entry) && entry.state === "uniform" && typeof entry.value === "string" ? {
4848
+ states[key] = require__plugin_vue_export_helper.isPlainObject(entry) && entry.state === "uniform" && typeof entry.value === "string" ? {
4882
4849
  state: "uniform",
4883
4850
  value: entry.value
4884
- } : { state: isPlainObject(entry) && entry.state === "mixed" ? "mixed" : "unresolvable" };
4851
+ } : { state: require__plugin_vue_export_helper.isPlainObject(entry) && entry.state === "mixed" ? "mixed" : "unresolvable" };
4885
4852
  }
4886
4853
  return states;
4887
4854
  }
4888
4855
  function hasAbortedFlag(value) {
4889
- return isPlainObject(value) && typeof value.aborted === "boolean";
4856
+ return require__plugin_vue_export_helper.isPlainObject(value) && typeof value.aborted === "boolean";
4890
4857
  }
4891
4858
  function isPromiseLike(value) {
4892
4859
  return Boolean(value) && (typeof value === "object" || typeof value === "function") && typeof value.then === "function";
@@ -5887,8 +5854,8 @@ function normalizeCommandState(state, source) {
5887
5854
  };
5888
5855
  }
5889
5856
  function projectTrackChangesItem(item) {
5890
- if (!isPlainObject(item)) return null;
5891
- const change = isPlainObject(item.change) ? item.change : item;
5857
+ if (!require__plugin_vue_export_helper.isPlainObject(item)) return null;
5858
+ const change = require__plugin_vue_export_helper.isPlainObject(item.change) ? item.change : item;
5892
5859
  return {
5893
5860
  ...item,
5894
5861
  id: item.id ?? change.id,
@@ -5929,9 +5896,9 @@ function documentChangeFromHostEvent(event) {
5929
5896
  };
5930
5897
  if (event.type !== "mutation:committed") return null;
5931
5898
  if (event.origin === "history") {
5932
- const result = isPlainObject(event.result) ? event.result : null;
5899
+ const result = require__plugin_vue_export_helper.isPlainObject(event.result) ? event.result : null;
5933
5900
  if (!result || result.noop === true) return null;
5934
- const history = isPlainObject(result.history) ? result.history : null;
5901
+ const history = require__plugin_vue_export_helper.isPlainObject(result.history) ? result.history : null;
5935
5902
  return {
5936
5903
  cause: event.direction === "redo" ? "redo" : "undo",
5937
5904
  changeTag: null,
@@ -5940,7 +5907,7 @@ function documentChangeFromHostEvent(event) {
5940
5907
  };
5941
5908
  }
5942
5909
  if (!mutationCommittedEventChangedDocument(event)) return null;
5943
- const receipt = isPlainObject(event.receipt) ? event.receipt : {};
5910
+ const receipt = require__plugin_vue_export_helper.isPlainObject(event.receipt) ? event.receipt : {};
5944
5911
  return {
5945
5912
  cause: event.cause === "user" ? "user" : "api",
5946
5913
  changeTag: typeof receipt.changeTag === "string" ? receipt.changeTag : null,
@@ -6128,9 +6095,9 @@ function selectionTargetFromTextTarget(target) {
6128
6095
  };
6129
6096
  }
6130
6097
  function capturedTableCellTarget(value) {
6131
- if (!isPlainObject(value)) return null;
6098
+ if (!require__plugin_vue_export_helper.isPlainObject(value)) return null;
6132
6099
  if (value.kind !== "selection" || value.coordinateSpace !== void 0 && value.coordinateSpace !== "visible" && value.coordinateSpace !== "tracked" || value.story !== void 0 && !isStoryLocator(value.story)) return null;
6133
- for (const point of [value.start, value.end]) if (!isPlainObject(point) || point.kind !== "text" || typeof point.blockId !== "string" || point.blockId.length === 0 || typeof point.offset !== "number" || !Number.isInteger(point.offset) || point.offset < 0 || point.story !== void 0 && !isStoryLocator(point.story)) return null;
6100
+ for (const point of [value.start, value.end]) if (!require__plugin_vue_export_helper.isPlainObject(point) || point.kind !== "text" || typeof point.blockId !== "string" || point.blockId.length === 0 || typeof point.offset !== "number" || !Number.isInteger(point.offset) || point.offset < 0 || point.story !== void 0 && !isStoryLocator(point.story)) return null;
6134
6101
  return value;
6135
6102
  }
6136
6103
  function selectionTargetForRestore(capture) {
@@ -6385,7 +6352,7 @@ function createSuperDocUI(options) {
6385
6352
  };
6386
6353
  try {
6387
6354
  const result = open();
6388
- if (isPlainObject(result) && result.ok === false) return {
6355
+ if (require__plugin_vue_export_helper.isPlainObject(result) && result.ok === false) return {
6389
6356
  ok: false,
6390
6357
  reason: coerceSuperDocUIReason(result.reason, SUPERDOC_UI_REASONS.operationUnavailable)
6391
6358
  };
@@ -6430,7 +6397,7 @@ function createSuperDocUI(options) {
6430
6397
  const getSnapshot = hostMethod(getV2ReviewWindowSource(), "getSnapshot");
6431
6398
  if (!getSnapshot) return null;
6432
6399
  const snapshot = safeCall(() => getSnapshot(), null);
6433
- return isPlainObject(snapshot) ? snapshot : null;
6400
+ return require__plugin_vue_export_helper.isPlainObject(snapshot) ? snapshot : null;
6434
6401
  };
6435
6402
  const hasV2ReviewWindowFeed = () => typeof getV2ReviewWindowSource()?.getSnapshot === "function";
6436
6403
  const reviewWindowSliceStatus = (snapshot) => {
@@ -6451,8 +6418,8 @@ function createSuperDocUI(options) {
6451
6418
  let wholeTableParagraphSeed = null;
6452
6419
  const readHostSelectionSnapshot = () => {
6453
6420
  const handles = safeCall(() => hostMethod(getHost(), "getHandles")?.() ?? null, null);
6454
- const editing = isPlainObject(handles) ? handles.editing : void 0;
6455
- const getSnapshot = hostMethod(isPlainObject(editing) ? editing.selection : void 0, "getSnapshot") ?? hostMethod(isPlainObject(handles) ? handles.selection : void 0, "getSnapshot");
6421
+ const editing = require__plugin_vue_export_helper.isPlainObject(handles) ? handles.editing : void 0;
6422
+ const getSnapshot = hostMethod(require__plugin_vue_export_helper.isPlainObject(editing) ? editing.selection : void 0, "getSnapshot") ?? hostMethod(require__plugin_vue_export_helper.isPlainObject(handles) ? handles.selection : void 0, "getSnapshot");
6456
6423
  if (!getSnapshot) return null;
6457
6424
  const snapshot = safeCall(() => getSnapshot(), null);
6458
6425
  return snapshot && typeof snapshot === "object" ? snapshot : null;
@@ -6595,9 +6562,9 @@ function createSuperDocUI(options) {
6595
6562
  const getSnapshot = hostMethod(getEditCommands(), "getSnapshot");
6596
6563
  if (!getSnapshot) return null;
6597
6564
  const snap = safeCall(() => getSnapshot(), null);
6598
- const commands = isPlainObject(snap) ? snap.commands : void 0;
6599
- const entry = isPlainObject(commands) ? commands[commandId] : void 0;
6600
- return isPlainObject(entry) ? entry : null;
6565
+ const commands = require__plugin_vue_export_helper.isPlainObject(snap) ? snap.commands : void 0;
6566
+ const entry = require__plugin_vue_export_helper.isPlainObject(commands) ? commands[commandId] : void 0;
6567
+ return require__plugin_vue_export_helper.isPlainObject(entry) ? entry : null;
6601
6568
  };
6602
6569
  /** Read the `lists.apply` command state surfaced by the v2 edit-command snapshot. */
6603
6570
  const readListApplyStateEntry = () => {
@@ -6626,7 +6593,7 @@ function createSuperDocUI(options) {
6626
6593
  const getTableContext = hostMethod(getHost(), "getTableContext");
6627
6594
  if (!getTableContext) return null;
6628
6595
  const snapshot = safeCall(() => getTableContext(), null);
6629
- return isPlainObject(snapshot) ? snapshot : null;
6596
+ return require__plugin_vue_export_helper.isPlainObject(snapshot) ? snapshot : null;
6630
6597
  };
6631
6598
  const resolveTableContext = () => {
6632
6599
  const snapshot = readHostTableContext();
@@ -6670,12 +6637,12 @@ function createSuperDocUI(options) {
6670
6637
  const readHandles = hostMethod(getHost(), "getHandles");
6671
6638
  if (!readHandles) return;
6672
6639
  const handles = safeCall(() => readHandles(), null);
6673
- if (!isPlainObject(handles)) return;
6640
+ if (!require__plugin_vue_export_helper.isPlainObject(handles)) return;
6674
6641
  const review = handles.review;
6675
6642
  if (next) {
6676
6643
  const setActiveReviewTarget = hostMethod(review, "setActiveReviewTarget");
6677
6644
  if (!setActiveReviewTarget) return;
6678
- const layout = isPlainObject(handles.layout) ? handles.layout : void 0;
6645
+ const layout = require__plugin_vue_export_helper.isPlainObject(handles.layout) ? handles.layout : void 0;
6679
6646
  safeCall(() => setActiveReviewTarget({
6680
6647
  entityType,
6681
6648
  entityId: next.id,
@@ -6693,7 +6660,7 @@ function createSuperDocUI(options) {
6693
6660
  const clearActiveReviewTarget = hostMethod(review, "clearActiveReviewTarget");
6694
6661
  if (!getActiveReviewTarget || !clearActiveReviewTarget) return;
6695
6662
  const activeTarget = safeCall(() => getActiveReviewTarget(), null);
6696
- if (isPlainObject(activeTarget) && activeTarget.entityType === entityType) safeCall(() => clearActiveReviewTarget(), void 0);
6663
+ if (require__plugin_vue_export_helper.isPlainObject(activeTarget) && activeTarget.entityType === entityType) safeCall(() => clearActiveReviewTarget(), void 0);
6697
6664
  };
6698
6665
  const mirrorTrackedChangeFocusToHost = (next) => mirrorReviewFocusToHost("trackedChange", next);
6699
6666
  const readReviewFocus = () => ({
@@ -6800,7 +6767,7 @@ function createSuperDocUI(options) {
6800
6767
  if (existing?.generation === generation) return existing.promise;
6801
6768
  const signal = uiTrackedChangesCatalogState.abortController.signal;
6802
6769
  const validateResult = (result) => {
6803
- const record = isPlainObject(result) ? result : void 0;
6770
+ const record = require__plugin_vue_export_helper.isPlainObject(result) ? result : void 0;
6804
6771
  if (signal.aborted || generation !== uiTrackedChangesCatalogState.generation || record?.reason === "review-hydration-superseded") throw new Error("ui-review-catalog-superseded");
6805
6772
  if (record?.ok === false) throw new Error(typeof record.reason === "string" ? record.reason : "ui-review-catalog-read-failed");
6806
6773
  return result;
@@ -6897,7 +6864,7 @@ function createSuperDocUI(options) {
6897
6864
  if (disposed) return;
6898
6865
  for (const listener of [...listeners]) listener(state);
6899
6866
  };
6900
- const record = isPlainObject(receipt) ? receipt : null;
6867
+ const record = require__plugin_vue_export_helper.isPlainObject(receipt) ? receipt : null;
6901
6868
  const readiness = getEditor()?.documentMutationReadiness;
6902
6869
  const waitForPostPaintTask = () => {
6903
6870
  const requestFrame = globalThis.requestAnimationFrame;
@@ -7545,6 +7512,23 @@ function createSuperDocUI(options) {
7545
7512
  const clearAsyncReadKeys = (predicate) => {
7546
7513
  for (const key of asyncReads.keys()) if (predicate(key)) asyncReads.delete(key);
7547
7514
  };
7515
+ const seedAsyncRead = (key, token, value, inflightToken = null) => {
7516
+ asyncReads.set(key, {
7517
+ token,
7518
+ value,
7519
+ hasSettled: true,
7520
+ inflightToken
7521
+ });
7522
+ };
7523
+ const selectionValidationSnapshot = () => ({
7524
+ held: typedCaretValidationHeld,
7525
+ pendingToken: pendingSelectionSeedValidationToken
7526
+ });
7527
+ const setSelectionValidation = (next) => {
7528
+ typedCaretValidationHeld = next.held;
7529
+ pendingSelectionSeedValidationToken = next.pendingToken;
7530
+ };
7531
+ const typingIsRecent = () => Date.now() - lastTypingMutationAtMs < HEAVY_READ_IDLE_MS;
7548
7532
  const selectionScopedAsyncReadKeys = (selection) => {
7549
7533
  const signature = selectionSignature(selection);
7550
7534
  const effectiveUniformityKey = effectiveInlineUniformityCacheKey(selection);
@@ -7674,7 +7658,7 @@ function createSuperDocUI(options) {
7674
7658
  if (fromConfig) return fromConfig;
7675
7659
  const getActiveRuntime = hostMethod(superdocRecord, "getActiveRuntime");
7676
7660
  const runtimeSnapshot = safeCall(getActiveRuntime ? () => hostMethod(getActiveRuntime(), "getSnapshot")?.() ?? null : void 0, null);
7677
- const fromRuntime = normalizeDocumentMode(isPlainObject(runtimeSnapshot) ? runtimeSnapshot.documentMode : void 0);
7661
+ const fromRuntime = normalizeDocumentMode(require__plugin_vue_export_helper.isPlainObject(runtimeSnapshot) ? runtimeSnapshot.documentMode : void 0);
7678
7662
  const fromOptions = normalizeDocumentMode((editor?.options)?.documentMode);
7679
7663
  return fromRuntime ?? fromOptions;
7680
7664
  };
@@ -7787,11 +7771,11 @@ function createSuperDocUI(options) {
7787
7771
  if (!host || !editor || !mount || !lifetime || lifetime.aborted || mode === null || seed.empty || seed.tableSelection?.kind !== "tableCells" || seed.tableSelection.type !== "table" || seed.target?.kind !== "text" || !seed.target.segments.length) return false;
7788
7772
  if (nativeSelection) {
7789
7773
  const presentation = safeCall(() => hostMethod(host, "readAppliedSelectionPresentation")?.(), null);
7790
- const applied = normalizeSelectionInfo(isPlainObject(presentation) ? presentation.selection : null);
7774
+ const applied = normalizeSelectionInfo(require__plugin_vue_export_helper.isPlainObject(presentation) ? presentation.selection : null);
7791
7775
  if (readHostSelectionSnapshot() !== nativeSelection || !isNonCollapsedHostSelection(nativeSelection) || !applied || selectionSignature(selectionSliceFromInfo(applied, "ready")) !== selectionSignature(selectionSliceFromInfo(seed, "ready")) || JSON.stringify(applied.tableSelection) !== JSON.stringify(seed.tableSelection)) return false;
7792
7776
  const snapshot = nativeSelection;
7793
7777
  const first = seed.target.segments[0]?.blockId, last = seed.target.segments.at(-1)?.blockId;
7794
- const matches = (point, blockId) => !!blockId && isPlainObject(point) && point.blockId === blockId && storyLocatorSignature(point.story ?? snapshot.story) === storyLocatorSignature(seed.target?.story);
7778
+ const matches = (point, blockId) => !!blockId && require__plugin_vue_export_helper.isPlainObject(point) && point.blockId === blockId && storyLocatorSignature(point.story ?? snapshot.story) === storyLocatorSignature(seed.target?.story);
7795
7779
  if (!(matches(snapshot.anchor, first) && matches(snapshot.focus, last) || matches(snapshot.focus, first) && matches(snapshot.anchor, last))) return false;
7796
7780
  }
7797
7781
  wholeTableParagraphSeed = {
@@ -7812,16 +7796,13 @@ function createSuperDocUI(options) {
7812
7796
  const foreground = foregroundMutationState();
7813
7797
  if (isNonCollapsedHostSelection(hostSelectionSnapshot) && readHostSelectionSnapshot() === hostSelectionSnapshot) {
7814
7798
  const seed = normalizeSelectionInfo(safeCall(() => hostMethod(host, "readLiveSelectionSyncSnapshot")?.(), null));
7815
- if (seed && !seed.selectionTarget && captureWholeTableParagraphSeed(host, seed, hostSelectionSnapshot)) asyncReads.set("selection", {
7816
- token: asyncReads.get("selection")?.token ?? null,
7817
- value: seed,
7818
- hasSettled: true,
7819
- inflightToken: null
7820
- });
7799
+ if (seed && !seed.selectionTarget && captureWholeTableParagraphSeed(host, seed, hostSelectionSnapshot)) seedAsyncRead("selection", asyncReads.get("selection")?.token ?? null, seed);
7821
7800
  }
7822
7801
  if (isNonCollapsedHostSelection(hostSelectionSnapshot) && !(foreground && foreground.active > 0)) {
7823
- typedCaretValidationHeld = false;
7824
- pendingSelectionSeedValidationToken = null;
7802
+ setSelectionValidation({
7803
+ held: false,
7804
+ pendingToken: null
7805
+ });
7825
7806
  issueAsyncRead("selection", selectionReadToken(), selectionCurrentRun, normalizeSelectionInfo);
7826
7807
  return;
7827
7808
  }
@@ -7830,17 +7811,14 @@ function createSuperDocUI(options) {
7830
7811
  const seed = normalizeSelectionInfo(safeCall(() => read.call(host), null));
7831
7812
  if (!seed) return;
7832
7813
  if (wholeTableSelectionChanged) {
7833
- typedCaretValidationHeld = false;
7834
- pendingSelectionSeedValidationToken = null;
7814
+ setSelectionValidation({
7815
+ held: false,
7816
+ pendingToken: null
7817
+ });
7835
7818
  wholeTableParagraphSeed = null;
7836
7819
  captureWholeTableParagraphSeed(host, seed, initialTableSelection);
7837
7820
  const token = selectionReadToken();
7838
- asyncReads.set("selection", {
7839
- token,
7840
- value: seed,
7841
- hasSettled: true,
7842
- inflightToken: null
7843
- });
7821
+ seedAsyncRead("selection", token, seed);
7844
7822
  issueAsyncRead("selection", token, selectionCurrentRun, normalizeSelectionInfo);
7845
7823
  return;
7846
7824
  }
@@ -7850,14 +7828,25 @@ function createSuperDocUI(options) {
7850
7828
  const previousRange = previousCaret?.range;
7851
7829
  const nextRange = nextCaret?.range;
7852
7830
  const sameSeedCaret = Boolean(previousCaret && nextCaret && previousCaret.blockId === nextCaret.blockId && storyLocatorSignature(previousCaret.story) === storyLocatorSignature(nextCaret.story) && previousRange?.start === nextRange?.start);
7853
- typedCaretValidationHeld = Boolean(foreground && foreground.active > 0) || typedCaretValidationHeld && (afterTypingPaint || sameSeedCaret);
7831
+ const validation = selectionValidationSnapshot();
7832
+ const held = Boolean(foreground && foreground.active > 0) || validation.held && (afterTypingPaint || sameSeedCaret);
7833
+ setSelectionValidation({
7834
+ held,
7835
+ pendingToken: validation.pendingToken
7836
+ });
7854
7837
  const token = selectionReadToken();
7855
- const deferAuthoritativeRead = Boolean(foreground && (foreground.active > 0 || foreground.pending > 0)) || typedCaretValidationHeld && Date.now() - lastTypingMutationAtMs < HEAVY_READ_IDLE_MS;
7838
+ const deferAuthoritativeRead = Boolean(foreground && (foreground.active > 0 || foreground.pending > 0)) || held && typingIsRecent();
7856
7839
  if (!deferAuthoritativeRead) {
7857
- pendingSelectionSeedValidationToken = null;
7840
+ setSelectionValidation({
7841
+ held,
7842
+ pendingToken: null
7843
+ });
7858
7844
  if (issueAsyncRead("selection", token, selectionCurrentRun, normalizeSelectionInfo)) return;
7859
7845
  } else {
7860
- pendingSelectionSeedValidationToken = token;
7846
+ setSelectionValidation({
7847
+ held,
7848
+ pendingToken: token
7849
+ });
7861
7850
  scheduleForegroundAsyncRetry();
7862
7851
  }
7863
7852
  const prev = asyncReads.get("selection");
@@ -7867,25 +7856,20 @@ function createSuperDocUI(options) {
7867
7856
  const sameActiveTypingCaret = Boolean(foreground && foreground.active > 0 && previousCaret && nextCaret && previousCaret.blockId === nextCaret.blockId && storyLocatorSignature(previousCaret.story) === storyLocatorSignature(nextCaret.story) && typeof previousRange?.start === "number" && typeof nextRange?.start === "number" && Math.abs(nextRange.start - previousRange.start) <= 2);
7868
7857
  const carriedChangeIds = paintedTrackChangeId != null || sameActiveTypingCaret ? state.selection.activeChangeIds.filter((id) => paintedTrackChangeId == null || buildTrackedChangeIdContext(state.trackChanges.items).aliasesFor(id).includes(paintedTrackChangeId)) : [];
7869
7858
  const seedChangeIds = Array.isArray(seed.activeChangeIds) && seed.activeChangeIds.length > 0 ? seed.activeChangeIds : carriedChangeIds;
7870
- asyncReads.set("selection", {
7871
- token,
7872
- value: {
7873
- ...seed,
7874
- activeMarks: seedMarks,
7875
- activeCommentIds: seedCommentIds,
7876
- activeChangeIds: seedChangeIds
7877
- },
7878
- hasSettled: true,
7879
- inflightToken: deferAuthoritativeRead ? null : prev?.inflightToken ?? null
7880
- });
7859
+ seedAsyncRead("selection", token, {
7860
+ ...seed,
7861
+ activeMarks: seedMarks,
7862
+ activeCommentIds: seedCommentIds,
7863
+ activeChangeIds: seedChangeIds
7864
+ }, deferAuthoritativeRead ? null : prev?.inflightToken ?? null);
7881
7865
  };
7882
7866
  const selectionInfoMatchesHost = (info) => {
7883
7867
  const snapshot = readHostSelectionSnapshot();
7884
7868
  const target = info?.selectionTarget;
7885
7869
  if (!snapshot || target?.kind !== "selection") return false;
7886
7870
  const matches = (rawPoint, rawEndpoint) => {
7887
- const point = isPlainObject(rawPoint) ? rawPoint : void 0;
7888
- const endpoint = isPlainObject(rawEndpoint) ? rawEndpoint : void 0;
7871
+ const point = require__plugin_vue_export_helper.isPlainObject(rawPoint) ? rawPoint : void 0;
7872
+ const endpoint = require__plugin_vue_export_helper.isPlainObject(rawEndpoint) ? rawEndpoint : void 0;
7889
7873
  const offset = target.coordinateSpace === "tracked" ? endpoint?.trackedBlockOffset : endpoint?.blockOffset;
7890
7874
  return point?.kind === "text" && typeof point.blockId === "string" && point.blockId === endpoint?.blockId && typeof point.offset === "number" && point.offset === offset && storyLocatorSignature(point.story ?? target.story) === storyLocatorSignature(endpoint?.story ?? snapshot.story);
7891
7875
  };
@@ -7899,12 +7883,7 @@ function createSuperDocUI(options) {
7899
7883
  const sourceToken = contentToken();
7900
7884
  const mode = readDocumentMode();
7901
7885
  if (typeof current !== "function") {
7902
- asyncReads.set("selection", {
7903
- token,
7904
- value: null,
7905
- hasSettled: true,
7906
- inflightToken: null
7907
- });
7886
+ seedAsyncRead("selection", token, null);
7908
7887
  recompute();
7909
7888
  return selectionSliceFromInfo(null, "pending");
7910
7889
  }
@@ -7921,12 +7900,7 @@ function createSuperDocUI(options) {
7921
7900
  if (disposed) return selectionSliceFromInfo(null, "pending");
7922
7901
  const info = normalizeSelectionInfo(raw);
7923
7902
  if (selectionReadToken() !== token && !(getDoc() === doc && contentToken() === sourceToken && readDocumentMode() === mode && selectionInfoMatchesHost(info))) return attempt < 1 ? readSelectionInfoFresh(attempt + 1) : selectionSliceFromInfo(null, "pending");
7924
- asyncReads.set("selection", {
7925
- token: selectionReadToken(),
7926
- value: info,
7927
- hasSettled: true,
7928
- inflightToken: null
7929
- });
7903
+ seedAsyncRead("selection", selectionReadToken(), info);
7930
7904
  const selection = selectionSliceFromInfo(info, info ? "ready" : "pending");
7931
7905
  recompute();
7932
7906
  return selection;
@@ -7948,7 +7922,7 @@ function createSuperDocUI(options) {
7948
7922
  const readCommentsDirectory = () => {
7949
7923
  const listComments = hostMethod(getDoc()?.comments, "list");
7950
7924
  return readAsync("comments", contentToken(), () => listComments ? listComments() : void 0, (raw) => {
7951
- const items = isPlainObject(raw) ? raw.items : void 0;
7925
+ const items = require__plugin_vue_export_helper.isPlainObject(raw) ? raw.items : void 0;
7952
7926
  return Array.isArray(items) ? realComments(items) : [];
7953
7927
  });
7954
7928
  };
@@ -8198,7 +8172,7 @@ function createSuperDocUI(options) {
8198
8172
  const selectionTarget = selection.target;
8199
8173
  let selectionAnchor;
8200
8174
  if (explicitTarget) {
8201
- const explicitStart = isPlainObject(explicitTarget.start) ? explicitTarget.start : void 0;
8175
+ const explicitStart = require__plugin_vue_export_helper.isPlainObject(explicitTarget.start) ? explicitTarget.start : void 0;
8202
8176
  if (explicitTarget.kind !== "selection" || explicitStart?.kind !== "text" || typeof explicitStart.blockId !== "string" || typeof explicitStart.offset !== "number") return retainSettledActiveContentControls([], status);
8203
8177
  selectionAnchor = {
8204
8178
  blockId: explicitStart.blockId,
@@ -8294,7 +8268,7 @@ function createSuperDocUI(options) {
8294
8268
  }
8295
8269
  const getSnapshot = hostMethod(source, "getSnapshot");
8296
8270
  const snapshot = getSnapshot ? safeCall(() => getSnapshot(), null) : null;
8297
- const { undoDepth, redoDepth } = (isPlainObject(snapshot) && isPlainObject(snapshot.history) ? snapshot.history : null) ?? {};
8271
+ const { undoDepth, redoDepth } = (require__plugin_vue_export_helper.isPlainObject(snapshot) && require__plugin_vue_export_helper.isPlainObject(snapshot.history) ? snapshot.history : null) ?? {};
8298
8272
  if (typeof undoDepth !== "number" || typeof redoDepth !== "number") return historySlice;
8299
8273
  const next = {
8300
8274
  canUndo: undoDepth > 0,
@@ -8309,11 +8283,11 @@ function createSuperDocUI(options) {
8309
8283
  const computeZoom = () => {
8310
8284
  const getZoomState = hostMethod(superdoc, "getZoomState");
8311
8285
  const rawState = safeCall(getZoomState ? () => getZoomState() : void 0, null);
8312
- const state = isPlainObject(rawState) ? rawState : null;
8286
+ const state = require__plugin_vue_export_helper.isPlainObject(rawState) ? rawState : null;
8313
8287
  const value = typeof state?.value === "number" ? state.value : 100;
8314
8288
  const rawMode = state?.mode;
8315
8289
  const mode = rawMode === "manual" || rawMode === "fit-width" ? rawMode : rawMode === "fixed" ? "manual" : null;
8316
- const fit = isPlainObject(state?.fitWidth) ? state.fitWidth : void 0;
8290
+ const fit = require__plugin_vue_export_helper.isPlainObject(state?.fitWidth) ? state.fitWidth : void 0;
8317
8291
  const min = typeof fit?.min === "number" ? fit.min : typeof state?.min === "number" ? state.min : 10;
8318
8292
  const max = typeof fit?.max === "number" ? fit.max : typeof state?.max === "number" ? state.max : 100;
8319
8293
  if (!zoomFitWidth || zoomFitWidth.min !== min || zoomFitWidth.max !== max) zoomFitWidth = {
@@ -8813,7 +8787,7 @@ function createSuperDocUI(options) {
8813
8787
  storyType: "body"
8814
8788
  }
8815
8789
  }));
8816
- return isPlainObject(raw) ? raw : void 0;
8790
+ return require__plugin_vue_export_helper.isPlainObject(raw) ? raw : void 0;
8817
8791
  };
8818
8792
  /**
8819
8793
  * Returns the settled status of the query.match read backing the current
@@ -8953,8 +8927,8 @@ function createSuperDocUI(options) {
8953
8927
  };
8954
8928
  const hostCommandSupport = (command) => {
8955
8929
  const capabilities = safeCall(hostMethod(getHost(), "getCapabilities") ?? void 0, null);
8956
- const editableSubset = isPlainObject(capabilities) ? capabilities.editableSubset : void 0;
8957
- const commands = isPlainObject(editableSubset) ? editableSubset.commands : void 0;
8930
+ const editableSubset = require__plugin_vue_export_helper.isPlainObject(capabilities) ? capabilities.editableSubset : void 0;
8931
+ const commands = require__plugin_vue_export_helper.isPlainObject(editableSubset) ? editableSubset.commands : void 0;
8958
8932
  if (Array.isArray(commands)) return commands.find((entry) => entry?.command === command || entry?.id === command) ?? null;
8959
8933
  if (commands && typeof commands === "object") {
8960
8934
  const record = commands[command];
@@ -9275,8 +9249,8 @@ function createSuperDocUI(options) {
9275
9249
  /** Read one block's list state and cache status through the selected story's list-state seam. */
9276
9250
  const readListStateSnapshotForBlock = (doc, blockId, story, selection) => {
9277
9251
  const applied = doc === getDoc() ? appliedSelectionPresentation(selection)?.listState : null;
9278
- const appliedValue = isPlainObject(applied) ? applied.value : void 0;
9279
- if (isPlainObject(applied) && applied.blockId === blockId && isPlainObject(applied.story) && storyLocatorSignature(applied.story) === storyLocatorSignature(story) && isPlainObject(appliedValue) && appliedValue.success === true) return {
9252
+ const appliedValue = require__plugin_vue_export_helper.isPlainObject(applied) ? applied.value : void 0;
9253
+ if (require__plugin_vue_export_helper.isPlainObject(applied) && applied.blockId === blockId && require__plugin_vue_export_helper.isPlainObject(applied.story) && storyLocatorSignature(applied.story) === storyLocatorSignature(story) && require__plugin_vue_export_helper.isPlainObject(appliedValue) && appliedValue.success === true) return {
9280
9254
  value: appliedValue,
9281
9255
  status: "ready"
9282
9256
  };
@@ -9378,7 +9352,7 @@ function createSuperDocUI(options) {
9378
9352
  const applied = appliedSelectionPresentation(selection);
9379
9353
  if (applied) return new Map(blockIds.flatMap((id) => {
9380
9354
  const alignments = applied.paragraphAlignments;
9381
- const alignment = normalizeParagraphAlignment(isPlainObject(alignments) ? alignments[id] : void 0);
9355
+ const alignment = normalizeParagraphAlignment(require__plugin_vue_export_helper.isPlainObject(alignments) ? alignments[id] : void 0);
9382
9356
  return alignment ? [[id, alignment]] : [];
9383
9357
  }));
9384
9358
  const host = getHost();
@@ -10204,9 +10178,9 @@ function createSuperDocUI(options) {
10204
10178
  let detachDocumentSelection = null;
10205
10179
  const readHostSelectionSource = () => {
10206
10180
  const handles = safeCall(hostMethod(getEditor()?.host, "getHandles") ?? void 0, null);
10207
- const editing = isPlainObject(handles) ? handles.editing : void 0;
10208
- const selection = isPlainObject(editing) ? editing.selection : void 0;
10209
- return isPlainObject(selection) && typeof selection.subscribe === "function" ? selection : null;
10181
+ const editing = require__plugin_vue_export_helper.isPlainObject(handles) ? handles.editing : void 0;
10182
+ const selection = require__plugin_vue_export_helper.isPlainObject(editing) ? editing.selection : void 0;
10183
+ return require__plugin_vue_export_helper.isPlainObject(selection) && typeof selection.subscribe === "function" ? selection : null;
10210
10184
  };
10211
10185
  const caretSelectionNeedsProjectionPaint = () => {
10212
10186
  const host = getHost();
@@ -10247,7 +10221,7 @@ function createSuperDocUI(options) {
10247
10221
  });
10248
10222
  if (typeof unsubscribe === "function") unsubscribeCallbacks.push(() => unsubscribe());
10249
10223
  const handles = safeCall(hostMethod(getHost(), "getHandles") ?? void 0, null);
10250
- const tableSelection = isPlainObject(handles) ? handles.selection : void 0;
10224
+ const tableSelection = require__plugin_vue_export_helper.isPlainObject(handles) ? handles.selection : void 0;
10251
10225
  const subscribeWholeTable = hostMethod(tableSelection, "subscribeWholeTable");
10252
10226
  if (subscribeWholeTable) {
10253
10227
  const refreshWholeTable = (initial = false) => {
@@ -10266,8 +10240,8 @@ function createSuperDocUI(options) {
10266
10240
  };
10267
10241
  const readHostReviewSource = () => {
10268
10242
  const handles = safeCall(hostMethod(getEditor()?.host, "getHandles") ?? void 0, null);
10269
- const review = isPlainObject(handles) ? handles.review : void 0;
10270
- return isPlainObject(review) && typeof review.subscribe === "function" ? review : null;
10243
+ const review = require__plugin_vue_export_helper.isPlainObject(handles) ? handles.review : void 0;
10244
+ return require__plugin_vue_export_helper.isPlainObject(review) && typeof review.subscribe === "function" ? review : null;
10271
10245
  };
10272
10246
  const readHostActiveReviewTarget = (review) => {
10273
10247
  const getActiveReviewTarget = hostMethod(review, "getActiveReviewTarget");
@@ -10275,11 +10249,11 @@ function createSuperDocUI(options) {
10275
10249
  const getSnapshot = hostMethod(review, "getSnapshot");
10276
10250
  if (!getSnapshot) return null;
10277
10251
  const snapshot = safeCall(() => getSnapshot(), null);
10278
- return isPlainObject(snapshot) ? snapshot.activeReviewTarget ?? null : null;
10252
+ return require__plugin_vue_export_helper.isPlainObject(snapshot) ? snapshot.activeReviewTarget ?? null : null;
10279
10253
  };
10280
10254
  let trackedChangeNavigationInFlight = 0;
10281
10255
  let lastPublishedHostReviewTarget;
10282
- const isRepublishedHostReviewTarget = (left, right) => left === right || isPlainObject(left) && isPlainObject(right) && left.layoutEpoch !== right.layoutEpoch && left.origin === right.origin && left.entityType === right.entityType && left.entityId === right.entityId && left.paintedEntityId === right.paintedEntityId && storyLocatorSignature(left.story) === storyLocatorSignature(right.story);
10256
+ const isRepublishedHostReviewTarget = (left, right) => left === right || require__plugin_vue_export_helper.isPlainObject(left) && require__plugin_vue_export_helper.isPlainObject(right) && left.layoutEpoch !== right.layoutEpoch && left.origin === right.origin && left.entityType === right.entityType && left.entityId === right.entityId && left.paintedEntityId === right.paintedEntityId && storyLocatorSignature(left.story) === storyLocatorSignature(right.story);
10283
10257
  const syncTrackedChangeFocusFromHostReviewTarget = (rawTarget, rawSnapshot) => {
10284
10258
  const rejection = (rawSnapshot && typeof rawSnapshot === "object" ? rawSnapshot : null)?.lastInteractionRejection;
10285
10259
  if (rawTarget == null && rejection && typeof rejection === "object" && rejection.code === "review-target-invalidated" && rejection.detail === "not-painted" && (explicitActiveChange || explicitActiveCommentId)) return false;
@@ -10298,7 +10272,7 @@ function createSuperDocUI(options) {
10298
10272
  return true;
10299
10273
  }
10300
10274
  const previousTarget = lastPublishedHostReviewTarget?.raw;
10301
- if (!target && isPlainObject(previousTarget) && previousTarget.entityType === "comment") {
10275
+ if (!target && require__plugin_vue_export_helper.isPlainObject(previousTarget) && previousTarget.entityType === "comment") {
10302
10276
  lastPublishedHostReviewTarget = {
10303
10277
  raw: rawTarget,
10304
10278
  focus: null,
@@ -10446,7 +10420,7 @@ function createSuperDocUI(options) {
10446
10420
  const syncHostEventsSubscription = () => {
10447
10421
  const host = getEditor()?.host;
10448
10422
  const events = host?.events;
10449
- const next = isPlainObject(events) && typeof events.subscribe === "function" ? events : null;
10423
+ const next = require__plugin_vue_export_helper.isPlainObject(events) && typeof events.subscribe === "function" ? events : null;
10450
10424
  if (next === currentHostEventsSource) return;
10451
10425
  if (detachHostEvents) {
10452
10426
  detachHostEvents();
@@ -11261,11 +11235,11 @@ function createSuperDocUI(options) {
11261
11235
  }
11262
11236
  function captureInputSelectionTarget(requireTableCells = false) {
11263
11237
  const handles = safeCall(() => hostMethod(getHost(), "getHandles")?.(), null);
11264
- const selection = isPlainObject(handles) ? handles.selection : void 0;
11238
+ const selection = require__plugin_vue_export_helper.isPlainObject(handles) ? handles.selection : void 0;
11265
11239
  const held = hostMethod(selection, "getSnapshot")?.();
11266
- if (requireTableCells && (!isPlainObject(held) || !held.tableCells)) return null;
11240
+ if (requireTableCells && (!require__plugin_vue_export_helper.isPlainObject(held) || !held.tableCells)) return null;
11267
11241
  const resolved = hostMethod(selection, "toSelectionTarget")?.();
11268
- return isPlainObject(resolved) && resolved.kind === "ok" && resolved.mode === "range" ? capturedTableCellTarget(resolved.target) : null;
11242
+ return require__plugin_vue_export_helper.isPlainObject(resolved) && resolved.kind === "ok" && resolved.mode === "range" ? capturedTableCellTarget(resolved.target) : null;
11269
11243
  }
11270
11244
  function currentUnrepresentableSelectionTarget(selection) {
11271
11245
  if (selection.empty || selection.selectionTarget || selection.target?.kind !== "text") return null;
@@ -11288,8 +11262,8 @@ function createSuperDocUI(options) {
11288
11262
  }
11289
11263
  function tableCellSelectionForTarget(target) {
11290
11264
  const cellTarget = currentCellSelectionTarget();
11291
- const start = isPlainObject(target) && isPlainObject(target.start) ? target.start : void 0;
11292
- const end = isPlainObject(target) && isPlainObject(target.end) ? target.end : void 0;
11265
+ const start = require__plugin_vue_export_helper.isPlainObject(target) && require__plugin_vue_export_helper.isPlainObject(target.start) ? target.start : void 0;
11266
+ const end = require__plugin_vue_export_helper.isPlainObject(target) && require__plugin_vue_export_helper.isPlainObject(target.end) ? target.end : void 0;
11293
11267
  if (!cellTarget || start?.blockId !== cellTarget.start.blockId || end?.blockId !== cellTarget.end.blockId || start?.offset !== cellTarget.start.offset || end?.offset !== cellTarget.end.offset) return null;
11294
11268
  return {
11295
11269
  anchorBlockId: cellTarget.start.blockId,
@@ -11662,16 +11636,16 @@ function createSuperDocUI(options) {
11662
11636
  const linksApi = doc?.hyperlinks;
11663
11637
  if (!linksApi) return false;
11664
11638
  const hyperlinkHandles = hostMethod(getHost(), "getHandles")?.();
11665
- const hyperlinkEditing = isPlainObject(hyperlinkHandles) ? hyperlinkHandles.editing : void 0;
11666
- const trustedHyperlinks = isPlainObject(hyperlinkEditing) ? hyperlinkEditing.hyperlinks : void 0;
11667
- const trustedLinksApi = firstPartyCommandDoc ? isPlainObject(trustedHyperlinks) ? trustedHyperlinks : void 0 : linksApi;
11639
+ const hyperlinkEditing = require__plugin_vue_export_helper.isPlainObject(hyperlinkHandles) ? hyperlinkHandles.editing : void 0;
11640
+ const trustedHyperlinks = require__plugin_vue_export_helper.isPlainObject(hyperlinkEditing) ? hyperlinkEditing.hyperlinks : void 0;
11641
+ const trustedLinksApi = firstPartyCommandDoc ? require__plugin_vue_export_helper.isPlainObject(trustedHyperlinks) ? trustedHyperlinks : void 0 : linksApi;
11668
11642
  const record = readLinkPayloadRecord(payload);
11669
11643
  const href = readLinkPayloadHref(payload);
11670
11644
  const payloadTarget = readLinkPayloadTarget(payload);
11671
11645
  const text = typeof record.text === "string" ? record.text : void 0;
11672
11646
  const currentText = typeof record.currentText === "string" ? record.currentText : void 0;
11673
- const requestedHyperlinkTarget = isPlainObject(record.hyperlinkTarget) ? record.hyperlinkTarget : null;
11674
- const requestedTextTarget = isPlainObject(record.textTarget) ? record.textTarget : null;
11647
+ const requestedHyperlinkTarget = require__plugin_vue_export_helper.isPlainObject(record.hyperlinkTarget) ? record.hyperlinkTarget : null;
11648
+ const requestedTextTarget = require__plugin_vue_export_helper.isPlainObject(record.textTarget) ? record.textTarget : null;
11675
11649
  const hasRequestedHyperlinkTarget = typeof requestedHyperlinkTarget?.storyId === "string" && typeof requestedHyperlinkTarget?.hyperlinkNodeId === "string";
11676
11650
  const textTargets = textAddressesFromTarget(payloadTarget);
11677
11651
  const caretTarget = collapsedTextAddressFromTarget(payloadTarget);
@@ -11864,10 +11838,10 @@ function createSuperDocUI(options) {
11864
11838
  const story = selectionStoryLocator(linkSelection);
11865
11839
  try {
11866
11840
  const reads = blockIds.map((blockId) => listLinks({ within: paragraphTarget(blockId, story) }));
11867
- const validReports = (reports) => reports.every((report) => isPlainObject(report) && Array.isArray(report.items));
11841
+ const validReports = (reports) => reports.every((report) => require__plugin_vue_export_helper.isPlainObject(report) && Array.isArray(report.items));
11868
11842
  const existingFrom = (reports) => {
11869
11843
  for (const report of reports) {
11870
- const hit = (isPlainObject(report) && Array.isArray(report.items) ? report.items : []).find((item) => hyperlinkOverlapsSelection(item, linkSelection));
11844
+ const hit = (require__plugin_vue_export_helper.isPlainObject(report) && Array.isArray(report.items) ? report.items : []).find((item) => hyperlinkOverlapsSelection(item, linkSelection));
11871
11845
  if (hit) return hit;
11872
11846
  }
11873
11847
  return null;
@@ -11923,7 +11897,7 @@ function createSuperDocUI(options) {
11923
11897
  if (nonBodyStory && at.kind === "after") at = {
11924
11898
  ...at,
11925
11899
  target: {
11926
- ...isPlainObject(at.target) ? at.target : {},
11900
+ ...require__plugin_vue_export_helper.isPlainObject(at.target) ? at.target : {},
11927
11901
  story: nonBodyStory
11928
11902
  }
11929
11903
  };
@@ -11967,12 +11941,12 @@ function createSuperDocUI(options) {
11967
11941
  if (!host) return null;
11968
11942
  if (firstPartyCommandDoc !== void 0) {
11969
11943
  const handles = hostMethod(host, "getHandles")?.();
11970
- const editing = isPlainObject(handles) ? handles.editing : void 0;
11971
- const commands = isPlainObject(editing) ? editing.fields : void 0;
11972
- return isPlainObject(commands) ? commands : null;
11944
+ const editing = require__plugin_vue_export_helper.isPlainObject(handles) ? handles.editing : void 0;
11945
+ const commands = require__plugin_vue_export_helper.isPlainObject(editing) ? editing.fields : void 0;
11946
+ return require__plugin_vue_export_helper.isPlainObject(commands) ? commands : null;
11973
11947
  }
11974
11948
  const commands = hostMethod(host, "getCodeFieldEditingCommands")?.();
11975
- return isPlainObject(commands) ? commands : null;
11949
+ return require__plugin_vue_export_helper.isPlainObject(commands) ? commands : null;
11976
11950
  };
11977
11951
  /**
11978
11952
  * Route a header/footer field command (`fields.insert` at the active caret).
@@ -12003,12 +11977,12 @@ function createSuperDocUI(options) {
12003
11977
  if (!host) return null;
12004
11978
  if (firstPartyCommandDoc !== void 0) {
12005
11979
  const handles = hostMethod(host, "getHandles")?.();
12006
- const editing = isPlainObject(handles) ? handles.editing : void 0;
12007
- const commands = isPlainObject(editing) ? editing.pageNumbers : void 0;
12008
- return isPlainObject(commands) ? commands : null;
11980
+ const editing = require__plugin_vue_export_helper.isPlainObject(handles) ? handles.editing : void 0;
11981
+ const commands = require__plugin_vue_export_helper.isPlainObject(editing) ? editing.pageNumbers : void 0;
11982
+ return require__plugin_vue_export_helper.isPlainObject(commands) ? commands : null;
12009
11983
  }
12010
11984
  const commands = hostMethod(host, "getCodePageNumberEditingCommands")?.();
12011
- return isPlainObject(commands) ? commands : null;
11985
+ return require__plugin_vue_export_helper.isPlainObject(commands) ? commands : null;
12012
11986
  };
12013
11987
  /** Route a page-numbers command (`headerFooters.pageNumbers.set` or `.remove` for the caret's section). */
12014
11988
  const executePageNumbersCommand = (descriptor, input) => {
@@ -12041,12 +12015,12 @@ function createSuperDocUI(options) {
12041
12015
  if (!host) return null;
12042
12016
  if (firstPartyCommandDoc !== void 0) {
12043
12017
  const handles = hostMethod(host, "getHandles")?.();
12044
- const editing = isPlainObject(handles) ? handles.editing : void 0;
12045
- const commands = isPlainObject(editing) ? editing.tables : void 0;
12046
- return isPlainObject(commands) ? commands : null;
12018
+ const editing = require__plugin_vue_export_helper.isPlainObject(handles) ? handles.editing : void 0;
12019
+ const commands = require__plugin_vue_export_helper.isPlainObject(editing) ? editing.tables : void 0;
12020
+ return require__plugin_vue_export_helper.isPlainObject(commands) ? commands : null;
12047
12021
  }
12048
12022
  const commands = hostMethod(host, "getCodeTableEditingCommands")?.();
12049
- return isPlainObject(commands) ? commands : null;
12023
+ return require__plugin_vue_export_helper.isPlainObject(commands) ? commands : null;
12050
12024
  };
12051
12025
  /**
12052
12026
  * Route a table cell-context command (`tables.*`) against the live table
@@ -12088,7 +12062,7 @@ function createSuperDocUI(options) {
12088
12062
  };
12089
12063
  const linkPayloadHasExplicitTarget = (payload) => {
12090
12064
  const record = readLinkPayloadRecord(payload);
12091
- return Boolean(readLinkPayloadTarget(payload) || isPlainObject(record.hyperlinkTarget) || isPlainObject(record.textTarget));
12065
+ return Boolean(readLinkPayloadTarget(payload) || require__plugin_vue_export_helper.isPlainObject(record.hyperlinkTarget) || require__plugin_vue_export_helper.isPlainObject(record.textTarget));
12092
12066
  };
12093
12067
  const currentWholeTableParagraphOwner = () => {
12094
12068
  const owner = wholeTableParagraphSeed, host = getHost();
@@ -12096,7 +12070,7 @@ function createSuperDocUI(options) {
12096
12070
  const tableId = owner.info.tableSelection?.tableId;
12097
12071
  const activeTable = safeCall(() => {
12098
12072
  const handles = hostMethod(host, "getHandles")?.();
12099
- return hostMethod(isPlainObject(handles) ? handles.selection : void 0, "getWholeTableNodeId")?.();
12073
+ return hostMethod(require__plugin_vue_export_helper.isPlainObject(handles) ? handles.selection : void 0, "getWholeTableNodeId")?.();
12100
12074
  }, null);
12101
12075
  if (!tableId || activeTable !== tableId || state.selection.tableSelection?.type !== "table" || state.selection.tableSelection.tableId !== tableId || selectionSignature(state.selection) !== selectionSignature(selectionSliceFromInfo(owner.info, "ready"))) return null;
12102
12076
  const applied = appliedSelectionPresentation(state.selection);
@@ -12811,11 +12785,11 @@ function createSuperDocUI(options) {
12811
12785
  const lifecycle = error?.reason;
12812
12786
  return { reason: lifecycle === "host-not-ready" || lifecycle === "host-disposed" || lifecycle === "editing-mount-required" ? SUPERDOC_UI_REASONS.notReady : SUPERDOC_UI_REASONS.hostCapabilityUnavailable };
12813
12787
  }
12814
- const editing = isPlainObject(handles) ? handles.editing : void 0;
12815
- const editingHelper = isPlainObject(editing) ? editing.selectionTargets : void 0;
12816
- if (isPlainObject(editingHelper) && typeof editingHelper.apply === "function") return { helper: editingHelper };
12817
- const reviewHelper = isPlainObject(handles) ? handles.selection : void 0;
12818
- if (isPlainObject(reviewHelper) && typeof reviewHelper.apply === "function") return { helper: reviewHelper };
12788
+ const editing = require__plugin_vue_export_helper.isPlainObject(handles) ? handles.editing : void 0;
12789
+ const editingHelper = require__plugin_vue_export_helper.isPlainObject(editing) ? editing.selectionTargets : void 0;
12790
+ if (require__plugin_vue_export_helper.isPlainObject(editingHelper) && typeof editingHelper.apply === "function") return { helper: editingHelper };
12791
+ const reviewHelper = require__plugin_vue_export_helper.isPlainObject(handles) ? handles.selection : void 0;
12792
+ if (require__plugin_vue_export_helper.isPlainObject(reviewHelper) && typeof reviewHelper.apply === "function") return { helper: reviewHelper };
12819
12793
  return { reason: SUPERDOC_UI_REASONS.hostCapabilityUnavailable };
12820
12794
  };
12821
12795
  /** Live host SelectionTarget from editable or review-safe selection handles. */
@@ -12828,10 +12802,10 @@ function createSuperDocUI(options) {
12828
12802
  } catch {
12829
12803
  return null;
12830
12804
  }
12831
- const editing = isPlainObject(handles) ? handles.editing : void 0;
12832
- const rendered = hostMethod(isPlainObject(editing) ? editing.selection : void 0, "toSelectionTarget")?.() ?? hostMethod(isPlainObject(handles) ? handles.selection : void 0, "toSelectionTarget")?.();
12833
- if (!isPlainObject(rendered) || rendered.kind !== "ok") return null;
12834
- return isPlainObject(rendered.target) ? rendered.target : null;
12805
+ const editing = require__plugin_vue_export_helper.isPlainObject(handles) ? handles.editing : void 0;
12806
+ const rendered = hostMethod(require__plugin_vue_export_helper.isPlainObject(editing) ? editing.selection : void 0, "toSelectionTarget")?.() ?? hostMethod(require__plugin_vue_export_helper.isPlainObject(handles) ? handles.selection : void 0, "toSelectionTarget")?.();
12807
+ if (!require__plugin_vue_export_helper.isPlainObject(rendered) || rendered.kind !== "ok") return null;
12808
+ return require__plugin_vue_export_helper.isPlainObject(rendered.target) ? rendered.target : null;
12835
12809
  };
12836
12810
  const activateContentControlChrome = (id) => {
12837
12811
  const host = getHost();
@@ -12964,7 +12938,7 @@ function createSuperDocUI(options) {
12964
12938
  const getSelectionAnchorRect = hostMethod(getHost(), "getSelectionAnchorRect");
12965
12939
  if (getSelectionAnchorRect) {
12966
12940
  const fromHost = safeCall(() => getSelectionAnchorRect(input), null);
12967
- if (isPlainObject(fromHost) && (Number(fromHost.width) > 0 || Number(fromHost.height) > 0)) return fromHost;
12941
+ if (require__plugin_vue_export_helper.isPlainObject(fromHost) && (Number(fromHost.width) > 0 || Number(fromHost.height) > 0)) return fromHost;
12968
12942
  return null;
12969
12943
  }
12970
12944
  return null;
@@ -13117,13 +13091,13 @@ function createSuperDocUI(options) {
13117
13091
  try {
13118
13092
  const directory = await listBookmarks(address.story ? { in: address.story } : {});
13119
13093
  if (!current()) return unresolved();
13120
- if ((isPlainObject(directory) && Array.isArray(directory.items) ? directory.items : []).filter((item) => isPlainObject(item) && item.name === address.name).length !== 1) return unresolved();
13094
+ if ((require__plugin_vue_export_helper.isPlainObject(directory) && Array.isArray(directory.items) ? directory.items : []).filter((item) => require__plugin_vue_export_helper.isPlainObject(item) && item.name === address.name).length !== 1) return unresolved();
13121
13095
  const info = await getBookmark({ target: address });
13122
- if (!current() || !isPlainObject(info)) return unresolved();
13123
- const range = isPlainObject(info.range) ? info.range : void 0;
13124
- const infoStory = (isPlainObject(info.address) ? info.address : void 0)?.story;
13125
- const storyOutsideBody = Boolean(infoStory) && !(isPlainObject(infoStory) && infoStory.storyType === "body");
13126
- const textPoint = (point) => isPlainObject(point) && typeof point.blockId === "string" && point.blockId.length > 0 && typeof point.offset === "number" && Number.isInteger(point.offset) && point.offset >= 0 ? {
13096
+ if (!current() || !require__plugin_vue_export_helper.isPlainObject(info)) return unresolved();
13097
+ const range = require__plugin_vue_export_helper.isPlainObject(info.range) ? info.range : void 0;
13098
+ const infoStory = (require__plugin_vue_export_helper.isPlainObject(info.address) ? info.address : void 0)?.story;
13099
+ const storyOutsideBody = Boolean(infoStory) && !(require__plugin_vue_export_helper.isPlainObject(infoStory) && infoStory.storyType === "body");
13100
+ const textPoint = (point) => require__plugin_vue_export_helper.isPlainObject(point) && typeof point.blockId === "string" && point.blockId.length > 0 && typeof point.offset === "number" && Number.isInteger(point.offset) && point.offset >= 0 ? {
13127
13101
  blockId: point.blockId,
13128
13102
  offset: point.offset
13129
13103
  } : null;
@@ -13313,7 +13287,7 @@ function createSuperDocUI(options) {
13313
13287
  */
13314
13288
  const commentWriteRefusal = () => commentMutationsAreReadOnly() ? failedReceipt("Comments are read-only.", "DOCUMENT_READONLY") : null;
13315
13289
  const filterCommentsSnapshot = (items, query) => {
13316
- const record = isPlainObject(query) ? query : null;
13290
+ const record = require__plugin_vue_export_helper.isPlainObject(query) ? query : null;
13317
13291
  let filtered = Array.from(items);
13318
13292
  if (record?.includeResolved === false) filtered = filtered.filter((item) => item.status !== "resolved");
13319
13293
  const rawOffset = Number(record?.offset);
@@ -13767,7 +13741,7 @@ function createSuperDocUI(options) {
13767
13741
  }, tcApi)) return false;
13768
13742
  if (firstPartyCommandDoc) {
13769
13743
  const handles = safeCall(hostMethod(getHost(), "getHandles") ?? void 0, null);
13770
- const decide = hostMethod(isPlainObject(handles) ? handles.trackChanges : void 0, "decide");
13744
+ const decide = hostMethod(require__plugin_vue_export_helper.isPlainObject(handles) ? handles.trackChanges : void 0, "decide");
13771
13745
  return decide ? decide({
13772
13746
  decision: kind,
13773
13747
  target
@@ -13830,7 +13804,7 @@ function createSuperDocUI(options) {
13830
13804
  success: false,
13831
13805
  reason: "cancelled"
13832
13806
  };
13833
- const control = (isPlainObject(catalog) ? catalog.items : void 0)?.find((item) => item.id === id);
13807
+ const control = (require__plugin_vue_export_helper.isPlainObject(catalog) ? catalog.items : void 0)?.find((item) => item.id === id);
13834
13808
  if (!control) return {
13835
13809
  success: false,
13836
13810
  reason: "not-found"
@@ -13950,7 +13924,7 @@ function createSuperDocUI(options) {
13950
13924
  };
13951
13925
  }
13952
13926
  const mounted = hostMethod(host, "getMountedHandle")?.();
13953
- hostMethod(isPlainObject(mounted) ? mounted.focus : void 0, "focus")?.({ preventScroll: true });
13927
+ hostMethod(require__plugin_vue_export_helper.isPlainObject(mounted) ? mounted.focus : void 0, "focus")?.({ preventScroll: true });
13954
13928
  activateContentControlChrome(id);
13955
13929
  return { success: true };
13956
13930
  }
@@ -14007,7 +13981,7 @@ function createSuperDocUI(options) {
14007
13981
  const getText = hostMethod(getDoc(), "getText");
14008
13982
  const result = safeCall(getText ? () => getText({}) : void 0, null);
14009
13983
  if (typeof result === "string") return result;
14010
- if (isPlainObject(result) && typeof result.text === "string") return result.text;
13984
+ if (require__plugin_vue_export_helper.isPlainObject(result) && typeof result.text === "string") return result.text;
14011
13985
  return null;
14012
13986
  },
14013
13987
  replaceDocument: async (file) => {
@@ -14043,9 +14017,9 @@ function createSuperDocUI(options) {
14043
14017
  reason: "unavailable"
14044
14018
  };
14045
14019
  const result = safeCall(() => markSaved(version), null);
14046
- return isPlainObject(result) && result.ok === true ? { ok: true } : {
14020
+ return require__plugin_vue_export_helper.isPlainObject(result) && result.ok === true ? { ok: true } : {
14047
14021
  ok: false,
14048
- reason: isPlainObject(result) && result.reason === "document-changed" ? "document-changed" : "unavailable"
14022
+ reason: require__plugin_vue_export_helper.isPlainObject(result) && result.reason === "document-changed" ? "document-changed" : "unavailable"
14049
14023
  };
14050
14024
  }
14051
14025
  };
@@ -14297,7 +14271,7 @@ function createSuperDocUI(options) {
14297
14271
  const liveDecorations = /* @__PURE__ */ new Map();
14298
14272
  const decorationOwnerForProvider = (providerId) => {
14299
14273
  const owner = currentHostVisuals()?.providerOwner?.(providerId);
14300
- return isPlainObject(owner) && typeof owner.id === "string" ? owner : null;
14274
+ return require__plugin_vue_export_helper.isPlainObject(owner) && typeof owner.id === "string" ? owner : null;
14301
14275
  };
14302
14276
  const currentHostVisuals = () => getEditor()?.visuals ?? null;
14303
14277
  const decorationListeners = /* @__PURE__ */ new Set();
@@ -14319,7 +14293,7 @@ function createSuperDocUI(options) {
14319
14293
  };
14320
14294
  const decorationData = (id) => {
14321
14295
  const owner = currentHostVisuals()?.ownerById?.(id);
14322
- return isPlainObject(owner?.data) ? owner.data : void 0;
14296
+ return require__plugin_vue_export_helper.isPlainObject(owner?.data) ? owner.data : void 0;
14323
14297
  };
14324
14298
  const emitDecorationEvent = (type, decoration, point) => {
14325
14299
  const payload = {
@@ -14599,12 +14573,7 @@ function createSuperDocUI(options) {
14599
14573
  const resolved = await Promise.resolve(resolveMetadata({ id }));
14600
14574
  if (token !== localContentToken()) return null;
14601
14575
  const target = readMetadataResolvedTarget(resolved);
14602
- asyncReads.set(metadataResolveKey(id), {
14603
- token,
14604
- value: target,
14605
- hasSettled: true,
14606
- inflightToken: null
14607
- });
14576
+ seedAsyncRead(metadataResolveKey(id), token, target);
14608
14577
  return target;
14609
14578
  } catch {
14610
14579
  return null;
@@ -14723,11 +14692,11 @@ function createSuperDocUI(options) {
14723
14692
  const searchListeners = /* @__PURE__ */ new Set();
14724
14693
  const getHostSearch = () => {
14725
14694
  const search = getHost()?.search;
14726
- return isPlainObject(search) ? search : null;
14695
+ return require__plugin_vue_export_helper.isPlainObject(search) ? search : null;
14727
14696
  };
14728
14697
  const getEditCommandSearch = () => {
14729
14698
  const search = getEditCommands()?.search;
14730
- return isPlainObject(search) ? search : null;
14699
+ return require__plugin_vue_export_helper.isPlainObject(search) ? search : null;
14731
14700
  };
14732
14701
  const searchIsAvailable = () => {
14733
14702
  const search = getHostSearch();
@@ -15956,12 +15925,6 @@ Object.defineProperty(exports, "isAllowed", {
15956
15925
  return isAllowed;
15957
15926
  }
15958
15927
  });
15959
- Object.defineProperty(exports, "isPlainObject", {
15960
- enumerable: true,
15961
- get: function() {
15962
- return isPlainObject;
15963
- }
15964
- });
15965
15928
  Object.defineProperty(exports, "isRecord", {
15966
15929
  enumerable: true,
15967
15930
  get: function() {