@semiont/react-ui 0.5.1 → 0.5.3

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 (177) hide show
  1. package/README.md +13 -0
  2. package/dist/{ar-3W37O3R3.mjs → ar-UUMMNQKF.mjs} +2 -17
  3. package/dist/ar-UUMMNQKF.mjs.map +1 -0
  4. package/dist/{bn-JZTJLMVE.mjs → bn-AL5BJSR3.mjs} +2 -17
  5. package/dist/bn-AL5BJSR3.mjs.map +1 -0
  6. package/dist/{chunk-4NOUO3W6.mjs → chunk-EBBL3VJI.mjs} +5062 -2906
  7. package/dist/chunk-EBBL3VJI.mjs.map +1 -0
  8. package/dist/{chunk-NOD3NCXE.mjs → chunk-OJSRLEER.mjs} +2 -17
  9. package/dist/chunk-OJSRLEER.mjs.map +1 -0
  10. package/dist/{cs-XYHH7HNE.mjs → cs-UMINALSU.mjs} +2 -17
  11. package/dist/cs-UMINALSU.mjs.map +1 -0
  12. package/dist/{da-MZKIECVT.mjs → da-FKUX6CDL.mjs} +2 -17
  13. package/dist/da-FKUX6CDL.mjs.map +1 -0
  14. package/dist/{de-AYXTMRQW.mjs → de-XSJ3E25S.mjs} +2 -17
  15. package/dist/de-XSJ3E25S.mjs.map +1 -0
  16. package/dist/{el-A6CVQWAW.mjs → el-UJXNRCBP.mjs} +2 -17
  17. package/dist/el-UJXNRCBP.mjs.map +1 -0
  18. package/dist/{en-YPQQBI4T.mjs → en-J5DHKLQ5.mjs} +2 -2
  19. package/dist/{es-M2HXLJGT.mjs → es-VURP62BU.mjs} +2 -17
  20. package/dist/es-VURP62BU.mjs.map +1 -0
  21. package/dist/{fa-V6JZJDYP.mjs → fa-TIT5ZPZY.mjs} +2 -17
  22. package/dist/fa-TIT5ZPZY.mjs.map +1 -0
  23. package/dist/{fi-ONDTZ5H7.mjs → fi-F7VTGT4H.mjs} +2 -17
  24. package/dist/fi-F7VTGT4H.mjs.map +1 -0
  25. package/dist/{fr-PAPV4H4G.mjs → fr-2ZR26VF7.mjs} +2 -17
  26. package/dist/fr-2ZR26VF7.mjs.map +1 -0
  27. package/dist/{he-F6VTLJLW.mjs → he-BXP2KYVZ.mjs} +2 -17
  28. package/dist/he-BXP2KYVZ.mjs.map +1 -0
  29. package/dist/{hi-CFUAV4BF.mjs → hi-PSWTP3NC.mjs} +2 -17
  30. package/dist/hi-PSWTP3NC.mjs.map +1 -0
  31. package/dist/{id-NBKLCCI7.mjs → id-HO6TXGTO.mjs} +2 -17
  32. package/dist/id-HO6TXGTO.mjs.map +1 -0
  33. package/dist/index.d.mts +292 -27
  34. package/dist/index.mjs +1134 -592
  35. package/dist/index.mjs.map +1 -1
  36. package/dist/{it-SLSOWVVU.mjs → it-AGTDMBL3.mjs} +2 -17
  37. package/dist/it-AGTDMBL3.mjs.map +1 -0
  38. package/dist/{ja-L5IG4ECE.mjs → ja-TTGOVF5K.mjs} +2 -17
  39. package/dist/ja-TTGOVF5K.mjs.map +1 -0
  40. package/dist/{ko-QYMTULKK.mjs → ko-FF77IQ7N.mjs} +2 -17
  41. package/dist/ko-FF77IQ7N.mjs.map +1 -0
  42. package/dist/{ms-5DGSFKM2.mjs → ms-UPQWWIL4.mjs} +2 -17
  43. package/dist/ms-UPQWWIL4.mjs.map +1 -0
  44. package/dist/{nl-VZPCGONO.mjs → nl-W75HEPFL.mjs} +2 -17
  45. package/dist/nl-W75HEPFL.mjs.map +1 -0
  46. package/dist/{no-MF6F352I.mjs → no-R4W7W7ZU.mjs} +2 -17
  47. package/dist/no-R4W7W7ZU.mjs.map +1 -0
  48. package/dist/{pl-WIK72JUO.mjs → pl-GQC2ELWO.mjs} +2 -17
  49. package/dist/pl-GQC2ELWO.mjs.map +1 -0
  50. package/dist/{pt-RRP5ZF6A.mjs → pt-YGVT62RU.mjs} +2 -17
  51. package/dist/pt-YGVT62RU.mjs.map +1 -0
  52. package/dist/{ro-XHQLC3T7.mjs → ro-TST6XS6X.mjs} +2 -17
  53. package/dist/ro-TST6XS6X.mjs.map +1 -0
  54. package/dist/{sv-EWULDN6E.mjs → sv-TQLF6HV7.mjs} +2 -17
  55. package/dist/sv-TQLF6HV7.mjs.map +1 -0
  56. package/dist/test-utils.d.mts +1 -1
  57. package/dist/test-utils.mjs +5 -2353
  58. package/dist/test-utils.mjs.map +1 -1
  59. package/dist/{th-TGOBHFG4.mjs → th-HJUIETVR.mjs} +2 -17
  60. package/dist/th-HJUIETVR.mjs.map +1 -0
  61. package/dist/{tr-LMMPBMV7.mjs → tr-CW3C46TW.mjs} +2 -17
  62. package/dist/tr-CW3C46TW.mjs.map +1 -0
  63. package/dist/{uk-IPGRRJY6.mjs → uk-WTHZQB2U.mjs} +2 -17
  64. package/dist/uk-WTHZQB2U.mjs.map +1 -0
  65. package/dist/{vi-Q676OJQS.mjs → vi-PHWHJLKP.mjs} +2 -17
  66. package/dist/vi-PHWHJLKP.mjs.map +1 -0
  67. package/dist/{zh-F3MTWQDX.mjs → zh-MO3FCUD6.mjs} +2 -17
  68. package/dist/zh-MO3FCUD6.mjs.map +1 -0
  69. package/package.json +1 -1
  70. package/src/components/StatusDisplay.tsx +1 -1
  71. package/src/components/modals/PermissionDeniedModal.tsx +2 -2
  72. package/src/components/modals/SessionExpiredModal.tsx +4 -4
  73. package/src/components/resource/panels/AssessmentPanel.tsx +4 -0
  74. package/src/components/resource/panels/AssistSection.tsx +10 -1
  75. package/src/components/resource/panels/CollaborationPanel.tsx +1 -1
  76. package/src/components/resource/panels/CommentsPanel.tsx +4 -0
  77. package/src/components/resource/panels/HighlightPanel.tsx +4 -0
  78. package/src/components/resource/panels/ReferencesPanel.tsx +11 -0
  79. package/src/components/resource/panels/TagEntry.tsx +13 -2
  80. package/src/components/resource/panels/TaggingPanel.tsx +93 -41
  81. package/src/components/resource/panels/UnifiedAnnotationsPanel.tsx +11 -1
  82. package/src/components/resource/panels/__tests__/ReferencesPanel.observable-flow.test.tsx +2 -2
  83. package/src/components/resource/panels/__tests__/TagEntry.test.tsx +26 -19
  84. package/src/components/resource/panels/__tests__/TaggingPanel.test.tsx +128 -38
  85. package/src/features/admin-devops/components/AdminDevOpsPage.tsx +1 -1
  86. package/src/features/admin-exchange/components/AdminExchangePage.tsx +1 -1
  87. package/src/features/admin-exchange/components/ImportCard.tsx +1 -1
  88. package/src/features/admin-exchange/state/__tests__/exchange-state-unit.test.ts +171 -0
  89. package/src/features/admin-exchange/state/exchange-state-unit.ts +131 -0
  90. package/src/features/admin-security/components/AdminSecurityPage.tsx +1 -1
  91. package/src/features/admin-security/state/__tests__/admin-security-state-unit.test.ts +68 -0
  92. package/src/features/admin-security/state/admin-security-state-unit.ts +46 -0
  93. package/src/features/admin-users/components/AdminUsersPage.tsx +1 -1
  94. package/src/features/admin-users/state/__tests__/admin-users-state-unit.test.ts +86 -0
  95. package/src/features/admin-users/state/admin-users-state-unit.ts +73 -0
  96. package/src/features/auth-welcome/state/__tests__/welcome-state-unit.test.ts +86 -0
  97. package/src/features/auth-welcome/state/welcome-state-unit.ts +44 -0
  98. package/src/features/moderate-entity-tags/components/EntityTagsPage.tsx +1 -1
  99. package/src/features/moderate-entity-tags/state/__tests__/entity-tags-state-unit.test.ts +102 -0
  100. package/src/features/moderate-entity-tags/state/entity-tags-state-unit.ts +64 -0
  101. package/src/features/moderate-recent/components/RecentDocumentsPage.tsx +1 -1
  102. package/src/features/moderate-tag-schemas/components/TagSchemasPage.tsx +4 -4
  103. package/src/features/moderation-linked-data/components/LinkedDataPage.tsx +1 -1
  104. package/src/features/resource-compose/__tests__/UploadProgressBar.test.tsx +225 -0
  105. package/src/features/resource-compose/components/ResourceComposePage.tsx +19 -4
  106. package/src/features/resource-compose/components/UploadProgressBar.tsx +94 -0
  107. package/src/features/resource-compose/state/__tests__/compose-page-state-unit.test.ts +187 -0
  108. package/src/features/resource-compose/state/compose-page-state-unit.ts +209 -0
  109. package/src/features/resource-discovery/components/ResourceDiscoveryPage.tsx +1 -1
  110. package/src/features/resource-discovery/state/__tests__/discover-state-unit.test.ts +76 -0
  111. package/src/features/resource-discovery/state/discover-state-unit.ts +54 -0
  112. package/src/features/resource-viewer/__tests__/ResourceViewerPage.test.tsx +4 -2
  113. package/src/features/resource-viewer/components/ResourceViewerPage.tsx +36 -32
  114. package/src/features/resource-viewer/state/__tests__/resource-loader-state-unit.test.ts +46 -0
  115. package/src/features/resource-viewer/state/__tests__/resource-viewer-page-state-unit.test.ts +203 -0
  116. package/src/features/resource-viewer/state/resource-loader-state-unit.ts +26 -0
  117. package/src/features/resource-viewer/state/resource-viewer-page-state-unit.ts +180 -0
  118. package/translations/ar.json +1 -16
  119. package/translations/bn.json +1 -16
  120. package/translations/cs.json +1 -16
  121. package/translations/da.json +1 -16
  122. package/translations/de.json +1 -16
  123. package/translations/el.json +1 -16
  124. package/translations/en.json +1 -16
  125. package/translations/es.json +1 -16
  126. package/translations/fa.json +1 -16
  127. package/translations/fi.json +1 -16
  128. package/translations/fr.json +1 -16
  129. package/translations/he.json +1 -16
  130. package/translations/hi.json +1 -16
  131. package/translations/id.json +1 -16
  132. package/translations/it.json +1 -16
  133. package/translations/ja.json +1 -16
  134. package/translations/ko.json +1 -16
  135. package/translations/ms.json +1 -16
  136. package/translations/nl.json +1 -16
  137. package/translations/no.json +1 -16
  138. package/translations/pl.json +1 -16
  139. package/translations/pt.json +1 -16
  140. package/translations/ro.json +1 -16
  141. package/translations/sv.json +1 -16
  142. package/translations/th.json +1 -16
  143. package/translations/tr.json +1 -16
  144. package/translations/uk.json +1 -16
  145. package/translations/vi.json +1 -16
  146. package/translations/zh.json +1 -16
  147. package/dist/ar-3W37O3R3.mjs.map +0 -1
  148. package/dist/bn-JZTJLMVE.mjs.map +0 -1
  149. package/dist/chunk-4NOUO3W6.mjs.map +0 -1
  150. package/dist/chunk-NOD3NCXE.mjs.map +0 -1
  151. package/dist/cs-XYHH7HNE.mjs.map +0 -1
  152. package/dist/da-MZKIECVT.mjs.map +0 -1
  153. package/dist/de-AYXTMRQW.mjs.map +0 -1
  154. package/dist/el-A6CVQWAW.mjs.map +0 -1
  155. package/dist/es-M2HXLJGT.mjs.map +0 -1
  156. package/dist/fa-V6JZJDYP.mjs.map +0 -1
  157. package/dist/fi-ONDTZ5H7.mjs.map +0 -1
  158. package/dist/fr-PAPV4H4G.mjs.map +0 -1
  159. package/dist/he-F6VTLJLW.mjs.map +0 -1
  160. package/dist/hi-CFUAV4BF.mjs.map +0 -1
  161. package/dist/id-NBKLCCI7.mjs.map +0 -1
  162. package/dist/it-SLSOWVVU.mjs.map +0 -1
  163. package/dist/ja-L5IG4ECE.mjs.map +0 -1
  164. package/dist/ko-QYMTULKK.mjs.map +0 -1
  165. package/dist/ms-5DGSFKM2.mjs.map +0 -1
  166. package/dist/nl-VZPCGONO.mjs.map +0 -1
  167. package/dist/no-MF6F352I.mjs.map +0 -1
  168. package/dist/pl-WIK72JUO.mjs.map +0 -1
  169. package/dist/pt-RRP5ZF6A.mjs.map +0 -1
  170. package/dist/ro-XHQLC3T7.mjs.map +0 -1
  171. package/dist/sv-EWULDN6E.mjs.map +0 -1
  172. package/dist/th-TGOBHFG4.mjs.map +0 -1
  173. package/dist/tr-LMMPBMV7.mjs.map +0 -1
  174. package/dist/uk-IPGRRJY6.mjs.map +0 -1
  175. package/dist/vi-Q676OJQS.mjs.map +0 -1
  176. package/dist/zh-F3MTWQDX.mjs.map +0 -1
  177. /package/dist/{en-YPQQBI4T.mjs.map → en-J5DHKLQ5.mjs.map} +0 -0
package/dist/index.mjs CHANGED
@@ -15,8 +15,9 @@ import {
15
15
  require_bufferToggle,
16
16
  require_bufferWhen,
17
17
  require_catchError,
18
+ require_cjs,
18
19
  require_combineAll,
19
- require_combineLatest2 as require_combineLatest,
20
+ require_combineLatest,
20
21
  require_combineLatestAll,
21
22
  require_combineLatestWith,
22
23
  require_concat,
@@ -116,15 +117,15 @@ import {
116
117
  require_windowToggle,
117
118
  require_windowWhen,
118
119
  require_withLatestFrom,
119
- require_zip2 as require_zip,
120
+ require_zip,
120
121
  require_zipAll,
121
122
  require_zipWith,
122
123
  usePreloadTranslations,
123
124
  useSemiont,
124
125
  useToast,
125
126
  useTranslations
126
- } from "./chunk-4NOUO3W6.mjs";
127
- import "./chunk-NOD3NCXE.mjs";
127
+ } from "./chunk-EBBL3VJI.mjs";
128
+ import "./chunk-OJSRLEER.mjs";
128
129
  import {
129
130
  __commonJS,
130
131
  __export,
@@ -132,7 +133,7 @@ import {
132
133
  } from "./chunk-D4GAAQMM.mjs";
133
134
 
134
135
  // ../../node_modules/inline-style-parser/cjs/index.js
135
- var require_cjs = __commonJS({
136
+ var require_cjs2 = __commonJS({
136
137
  "../../node_modules/inline-style-parser/cjs/index.js"(exports, module) {
137
138
  "use strict";
138
139
  var COMMENT_REGEX = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;
@@ -271,7 +272,7 @@ var require_cjs = __commonJS({
271
272
  });
272
273
 
273
274
  // ../../node_modules/style-to-object/cjs/index.js
274
- var require_cjs2 = __commonJS({
275
+ var require_cjs3 = __commonJS({
275
276
  "../../node_modules/style-to-object/cjs/index.js"(exports) {
276
277
  "use strict";
277
278
  var __importDefault = exports && exports.__importDefault || function(mod) {
@@ -279,7 +280,7 @@ var require_cjs2 = __commonJS({
279
280
  };
280
281
  Object.defineProperty(exports, "__esModule", { value: true });
281
282
  exports.default = StyleToObject;
282
- var inline_style_parser_1 = __importDefault(require_cjs());
283
+ var inline_style_parser_1 = __importDefault(require_cjs2());
283
284
  function StyleToObject(style, iterator) {
284
285
  let styleObject = null;
285
286
  if (!style || typeof style !== "string") {
@@ -344,13 +345,13 @@ var require_utilities = __commonJS({
344
345
  });
345
346
 
346
347
  // ../../node_modules/style-to-js/cjs/index.js
347
- var require_cjs3 = __commonJS({
348
+ var require_cjs4 = __commonJS({
348
349
  "../../node_modules/style-to-js/cjs/index.js"(exports, module) {
349
350
  "use strict";
350
351
  var __importDefault = exports && exports.__importDefault || function(mod) {
351
352
  return mod && mod.__esModule ? mod : { "default": mod };
352
353
  };
353
- var style_to_object_1 = __importDefault(require_cjs2());
354
+ var style_to_object_1 = __importDefault(require_cjs3());
354
355
  var utilities_1 = require_utilities();
355
356
  function StyleToJS(style, options) {
356
357
  var output = {};
@@ -3145,8 +3146,8 @@ var StateEffectType = class {
3145
3146
  /**
3146
3147
  @internal
3147
3148
  */
3148
- constructor(map5) {
3149
- this.map = map5;
3149
+ constructor(map10) {
3150
+ this.map = map10;
3150
3151
  }
3151
3152
  /**
3152
3153
  Create a [state effect](https://codemirror.net/6/docs/ref/#state.StateEffect) instance of this
@@ -3684,9 +3685,9 @@ var EditorState = class _EditorState {
3684
3685
  literal dollar sign.
3685
3686
  */
3686
3687
  phrase(phrase, ...insert2) {
3687
- for (let map5 of this.facet(_EditorState.phrases))
3688
- if (Object.prototype.hasOwnProperty.call(map5, phrase)) {
3689
- phrase = map5[phrase];
3688
+ for (let map10 of this.facet(_EditorState.phrases))
3689
+ if (Object.prototype.hasOwnProperty.call(map10, phrase)) {
3690
+ phrase = map10[phrase];
3690
3691
  break;
3691
3692
  }
3692
3693
  if (insert2.length)
@@ -10665,21 +10666,21 @@ var ViewState = class {
10665
10666
  }
10666
10667
  getViewport(bias, scrollTarget) {
10667
10668
  let marginTop = 0.5 - Math.max(-0.5, Math.min(0.5, bias / 1e3 / 2));
10668
- let map5 = this.heightMap, oracle = this.heightOracle;
10669
+ let map10 = this.heightMap, oracle = this.heightOracle;
10669
10670
  let { visibleTop, visibleBottom } = this;
10670
- let viewport = new Viewport(map5.lineAt(visibleTop - marginTop * 1e3, QueryType.ByHeight, oracle, 0, 0).from, map5.lineAt(visibleBottom + (1 - marginTop) * 1e3, QueryType.ByHeight, oracle, 0, 0).to);
10671
+ let viewport = new Viewport(map10.lineAt(visibleTop - marginTop * 1e3, QueryType.ByHeight, oracle, 0, 0).from, map10.lineAt(visibleBottom + (1 - marginTop) * 1e3, QueryType.ByHeight, oracle, 0, 0).to);
10671
10672
  if (scrollTarget) {
10672
10673
  let { head } = scrollTarget.range;
10673
10674
  if (head < viewport.from || head > viewport.to) {
10674
10675
  let viewHeight = Math.min(this.editorHeight, this.pixelViewport.bottom - this.pixelViewport.top);
10675
- let block = map5.lineAt(head, QueryType.ByPos, oracle, 0, 0), topPos;
10676
+ let block = map10.lineAt(head, QueryType.ByPos, oracle, 0, 0), topPos;
10676
10677
  if (scrollTarget.y == "center")
10677
10678
  topPos = (block.top + block.bottom) / 2 - viewHeight / 2;
10678
10679
  else if (scrollTarget.y == "start" || scrollTarget.y == "nearest" && head < viewport.from)
10679
10680
  topPos = block.top;
10680
10681
  else
10681
10682
  topPos = block.bottom - viewHeight;
10682
- viewport = new Viewport(map5.lineAt(topPos - 1e3 / 2, QueryType.ByHeight, oracle, 0, 0).from, map5.lineAt(topPos + viewHeight + 1e3 / 2, QueryType.ByHeight, oracle, 0, 0).to);
10683
+ viewport = new Viewport(map10.lineAt(topPos - 1e3 / 2, QueryType.ByHeight, oracle, 0, 0).from, map10.lineAt(topPos + viewHeight + 1e3 / 2, QueryType.ByHeight, oracle, 0, 0).to);
10683
10684
  }
10684
10685
  }
10685
10686
  return viewport;
@@ -12989,10 +12990,10 @@ var keymap = /* @__PURE__ */ Facet.define({ enables: handleKeyEvents });
12989
12990
  var Keymaps = /* @__PURE__ */ new WeakMap();
12990
12991
  function getKeymap(state) {
12991
12992
  let bindings = state.facet(keymap);
12992
- let map5 = Keymaps.get(bindings);
12993
- if (!map5)
12994
- Keymaps.set(bindings, map5 = buildKeymap(bindings.reduce((a15, b8) => a15.concat(b8), [])));
12995
- return map5;
12993
+ let map10 = Keymaps.get(bindings);
12994
+ if (!map10)
12995
+ Keymaps.set(bindings, map10 = buildKeymap(bindings.reduce((a15, b8) => a15.concat(b8), [])));
12996
+ return map10;
12996
12997
  }
12997
12998
  var storedPrefix = null;
12998
12999
  var PrefixTimeout = 4e3;
@@ -13064,7 +13065,7 @@ function buildKeymap(bindings, platform = currentPlatform) {
13064
13065
  return bound;
13065
13066
  }
13066
13067
  var currentKeyEvent = null;
13067
- function runHandlers(map5, event, view, scope) {
13068
+ function runHandlers(map10, event, view, scope) {
13068
13069
  currentKeyEvent = event;
13069
13070
  let name3 = keyName(event);
13070
13071
  let charCode = codePointAt2(name3, 0), isChar = codePointSize2(charCode) == name3.length && name3 != " ";
@@ -13096,7 +13097,7 @@ function runHandlers(map5, event, view, scope) {
13096
13097
  }
13097
13098
  return false;
13098
13099
  };
13099
- let scopeObj = map5[scope], baseName, shiftName;
13100
+ let scopeObj = map10[scope], baseName, shiftName;
13100
13101
  if (scopeObj) {
13101
13102
  if (runFor(scopeObj[prefix + modifiers(name3, event, !isChar)])) {
13102
13103
  handled = true;
@@ -13773,11 +13774,11 @@ var NodeType = class _NodeType {
13773
13774
  names, separated by spaces, in a single property name to map
13774
13775
  multiple node names to a single value.
13775
13776
  */
13776
- static match(map5) {
13777
+ static match(map10) {
13777
13778
  let direct = /* @__PURE__ */ Object.create(null);
13778
- for (let prop in map5)
13779
+ for (let prop in map10)
13779
13780
  for (let name3 of prop.split(" "))
13780
- direct[name3] = map5[prop];
13781
+ direct[name3] = map10[prop];
13781
13782
  return (node2) => {
13782
13783
  for (let groups = node2.prop(NodeProp.group), i12 = -1; i12 < (groups ? groups.length : 0); i12++) {
13783
13784
  let found = direct[i12 < 0 ? node2.name : groups[i12]];
@@ -15850,13 +15851,13 @@ var Rule = class {
15850
15851
  };
15851
15852
  Rule.empty = new Rule([], 2, null);
15852
15853
  function tagHighlighter(tags3, options) {
15853
- let map5 = /* @__PURE__ */ Object.create(null);
15854
+ let map10 = /* @__PURE__ */ Object.create(null);
15854
15855
  for (let style of tags3) {
15855
15856
  if (!Array.isArray(style.tag))
15856
- map5[style.tag.id] = style.class;
15857
+ map10[style.tag.id] = style.class;
15857
15858
  else
15858
15859
  for (let tag of style.tag)
15859
- map5[tag.id] = style.class;
15860
+ map10[tag.id] = style.class;
15860
15861
  }
15861
15862
  let { scope, all: all2 = null } = options || {};
15862
15863
  return {
@@ -15864,7 +15865,7 @@ function tagHighlighter(tags3, options) {
15864
15865
  let cls = all2;
15865
15866
  for (let tag of tags4) {
15866
15867
  for (let sub of tag.set) {
15867
- let tagClass = map5[sub.id];
15868
+ let tagClass = map10[sub.id];
15868
15869
  if (tagClass) {
15869
15870
  cls = cls ? cls + " " + tagClass : tagClass;
15870
15871
  break;
@@ -17532,7 +17533,7 @@ function saveSelectedShapeForSelectorType(selectorType, shape) {
17532
17533
  }
17533
17534
 
17534
17535
  // src/index.ts
17535
- import { createSearchPipeline as createSearchPipeline3 } from "@semiont/sdk";
17536
+ import { createSearchPipeline as createSearchPipeline4 } from "@semiont/sdk";
17536
17537
 
17537
17538
  // src/lib/annotation-overlay.ts
17538
17539
  import { getTextPositionSelector, getTargetSelector, getExactText, getBodySource as getBodySource2 } from "@semiont/core";
@@ -17542,12 +17543,12 @@ function buildSourceToRenderedMap(markdownSource, container) {
17542
17543
  while (walker.nextNode()) {
17543
17544
  renderedText += walker.currentNode.textContent ?? "";
17544
17545
  }
17545
- const map5 = /* @__PURE__ */ new Map();
17546
+ const map10 = /* @__PURE__ */ new Map();
17546
17547
  let renderedPos = 0;
17547
17548
  let sourcePos = 0;
17548
17549
  while (sourcePos < markdownSource.length && renderedPos < renderedText.length) {
17549
17550
  if (markdownSource[sourcePos] === renderedText[renderedPos]) {
17550
- map5.set(sourcePos, renderedPos);
17551
+ map10.set(sourcePos, renderedPos);
17551
17552
  renderedPos++;
17552
17553
  sourcePos++;
17553
17554
  } else {
@@ -17555,10 +17556,10 @@ function buildSourceToRenderedMap(markdownSource, container) {
17555
17556
  }
17556
17557
  }
17557
17558
  while (sourcePos < markdownSource.length) {
17558
- map5.set(sourcePos, renderedPos);
17559
+ map10.set(sourcePos, renderedPos);
17559
17560
  sourcePos++;
17560
17561
  }
17561
- return map5;
17562
+ return map10;
17562
17563
  }
17563
17564
  function buildTextNodeIndex(container) {
17564
17565
  const entries = [];
@@ -17708,212 +17709,6 @@ function supportsDetection(mediaType) {
17708
17709
  return baseType.startsWith("text/");
17709
17710
  }
17710
17711
 
17711
- // ../ontology/dist/index.js
17712
- var TAG_SCHEMAS = {
17713
- "legal-irac": {
17714
- id: "legal-irac",
17715
- name: "Legal Analysis (IRAC)",
17716
- description: "Issue, Rule, Application, Conclusion framework for legal reasoning",
17717
- domain: "legal",
17718
- tags: [
17719
- {
17720
- name: "Issue",
17721
- description: "The legal question or problem to be resolved",
17722
- examples: [
17723
- "What is the central legal question?",
17724
- "What must the court decide?",
17725
- "What is the dispute about?"
17726
- ]
17727
- },
17728
- {
17729
- name: "Rule",
17730
- description: "The relevant law, statute, or legal principle",
17731
- examples: [
17732
- "What law applies?",
17733
- "What is the legal standard?",
17734
- "What statute governs this case?"
17735
- ]
17736
- },
17737
- {
17738
- name: "Application",
17739
- description: "How the rule applies to the specific facts",
17740
- examples: [
17741
- "How does the law apply to these facts?",
17742
- "Analysis of the case",
17743
- "How do the facts satisfy the legal standard?"
17744
- ]
17745
- },
17746
- {
17747
- name: "Conclusion",
17748
- description: "The resolution or outcome based on the analysis",
17749
- examples: [
17750
- "What is the court's decision?",
17751
- "What is the final judgment?",
17752
- "What is the holding?"
17753
- ]
17754
- }
17755
- ]
17756
- },
17757
- "scientific-imrad": {
17758
- id: "scientific-imrad",
17759
- name: "Scientific Paper (IMRAD)",
17760
- description: "Introduction, Methods, Results, Discussion structure for research papers",
17761
- domain: "scientific",
17762
- tags: [
17763
- {
17764
- name: "Introduction",
17765
- description: "Background, context, and research question",
17766
- examples: [
17767
- "What is the research question?",
17768
- "Why is this important?",
17769
- "What is the hypothesis?"
17770
- ]
17771
- },
17772
- {
17773
- name: "Methods",
17774
- description: "Experimental design and procedures",
17775
- examples: [
17776
- "How was the study conducted?",
17777
- "What methods were used?",
17778
- "What was the experimental design?"
17779
- ]
17780
- },
17781
- {
17782
- name: "Results",
17783
- description: "Findings and observations",
17784
- examples: [
17785
- "What did the study find?",
17786
- "What are the data?",
17787
- "What were the observations?"
17788
- ]
17789
- },
17790
- {
17791
- name: "Discussion",
17792
- description: "Interpretation and implications of results",
17793
- examples: [
17794
- "What do the results mean?",
17795
- "What are the implications?",
17796
- "How do these findings relate to prior work?"
17797
- ]
17798
- }
17799
- ]
17800
- },
17801
- "argument-toulmin": {
17802
- id: "argument-toulmin",
17803
- name: "Argument Structure (Toulmin)",
17804
- description: "Claim, Evidence, Warrant, Counterargument, Rebuttal framework for argumentation",
17805
- domain: "general",
17806
- tags: [
17807
- {
17808
- name: "Claim",
17809
- description: "The main assertion or thesis",
17810
- examples: [
17811
- "What is being argued?",
17812
- "What is the main point?",
17813
- "What position is being taken?"
17814
- ]
17815
- },
17816
- {
17817
- name: "Evidence",
17818
- description: "Data or facts supporting the claim",
17819
- examples: [
17820
- "What supports this claim?",
17821
- "What are the facts?",
17822
- "What data is provided?"
17823
- ]
17824
- },
17825
- {
17826
- name: "Warrant",
17827
- description: "Reasoning connecting evidence to claim",
17828
- examples: [
17829
- "Why does this evidence support the claim?",
17830
- "What is the logic?",
17831
- "How does this reasoning work?"
17832
- ]
17833
- },
17834
- {
17835
- name: "Counterargument",
17836
- description: "Opposing viewpoints or objections",
17837
- examples: [
17838
- "What are the objections?",
17839
- "What do critics say?",
17840
- "What are alternative views?"
17841
- ]
17842
- },
17843
- {
17844
- name: "Rebuttal",
17845
- description: "Response to counterarguments",
17846
- examples: [
17847
- "How is the objection addressed?",
17848
- "Why is the counterargument wrong?",
17849
- "How is the criticism answered?"
17850
- ]
17851
- }
17852
- ]
17853
- }
17854
- };
17855
- function getTagSchema(schemaId) {
17856
- return TAG_SCHEMAS[schemaId] || null;
17857
- }
17858
- function getAllTagSchemas() {
17859
- return Object.values(TAG_SCHEMAS);
17860
- }
17861
- function getTagSchemasByDomain(domain2) {
17862
- return Object.values(TAG_SCHEMAS).filter((schema) => schema.domain === domain2);
17863
- }
17864
- function isValidCategory(schemaId, categoryName) {
17865
- const schema = getTagSchema(schemaId);
17866
- if (!schema) return false;
17867
- return schema.tags.some((tag) => tag.name === categoryName);
17868
- }
17869
- function getSchemaCategory(schemaId, categoryName) {
17870
- const schema = getTagSchema(schemaId);
17871
- if (!schema) return null;
17872
- return schema.tags.find((tag) => tag.name === categoryName) || null;
17873
- }
17874
- function getEntityTypes(annotation) {
17875
- if (Array.isArray(annotation.body)) {
17876
- const entityTags = [];
17877
- for (const item of annotation.body) {
17878
- if (typeof item === "object" && item !== null && "type" in item && "value" in item && "purpose" in item) {
17879
- const itemType = item.type;
17880
- const itemValue = item.value;
17881
- const itemPurpose = item.purpose;
17882
- if (itemType === "TextualBody" && itemPurpose === "tagging" && typeof itemValue === "string" && itemValue.length > 0) {
17883
- entityTags.push(itemValue);
17884
- }
17885
- }
17886
- }
17887
- return entityTags;
17888
- }
17889
- return [];
17890
- }
17891
- function isTag2(annotation) {
17892
- return annotation.motivation === "tagging";
17893
- }
17894
- function getTagCategory(annotation) {
17895
- if (!isTag2(annotation)) return void 0;
17896
- const bodies = Array.isArray(annotation.body) ? annotation.body : [annotation.body];
17897
- const taggingBody = bodies.find(
17898
- (b8) => b8 !== null && typeof b8 === "object" && "purpose" in b8 && b8.purpose === "tagging"
17899
- );
17900
- if (taggingBody && "value" in taggingBody) {
17901
- return taggingBody.value;
17902
- }
17903
- return void 0;
17904
- }
17905
- function getTagSchemaId(annotation) {
17906
- if (!isTag2(annotation)) return void 0;
17907
- const bodies = Array.isArray(annotation.body) ? annotation.body : [annotation.body];
17908
- const classifyingBody = bodies.find(
17909
- (b8) => b8 !== null && typeof b8 === "object" && "purpose" in b8 && b8.purpose === "classifying"
17910
- );
17911
- if (classifyingBody && "value" in classifyingBody) {
17912
- return classifyingBody.value;
17913
- }
17914
- return void 0;
17915
- }
17916
-
17917
17712
  // src/lib/validation.ts
17918
17713
  import { isValidEmail } from "@semiont/core";
17919
17714
  var ImageURLSchema = {
@@ -18031,12 +17826,12 @@ function sanitizeImageURL(url) {
18031
17826
  }
18032
17827
  }
18033
17828
 
18034
- // src/hooks/useViewModel.ts
17829
+ // src/hooks/useStateUnit.ts
18035
17830
  import { useState, useEffect } from "react";
18036
- function useViewModel(factory) {
18037
- const [vm] = useState(factory);
18038
- useEffect(() => () => vm.dispose(), [vm]);
18039
- return vm;
17831
+ function useStateUnit(factory) {
17832
+ const [unit] = useState(factory);
17833
+ useEffect(() => () => unit.dispose(), [unit]);
17834
+ return unit;
18040
17835
  }
18041
17836
 
18042
17837
  // src/hooks/useDebounce.ts
@@ -18930,7 +18725,7 @@ function ResourceAnnotationsProvider({ children }) {
18930
18725
  },
18931
18726
  body
18932
18727
  };
18933
- const result = await semiont.mark.annotation(rUri, createData);
18728
+ const result = await semiont.mark.annotation(createData);
18934
18729
  if (result.annotationId) {
18935
18730
  setNewAnnotationIds((prev) => new Set(prev).add(result.annotationId));
18936
18731
  setTimeout(() => {
@@ -26356,7 +26151,7 @@ import { isReference as isReference3 } from "@semiont/core";
26356
26151
  import { createHoverHandlers } from "@semiont/sdk";
26357
26152
 
26358
26153
  // src/lib/codemirror-logic.ts
26359
- import { isHighlight as isHighlight2, isReference as isReference2, isResolvedReference as isResolvedReference2, isComment as isComment2, isAssessment, isTag as isTag3, getBodySource as getBodySource3 } from "@semiont/core";
26154
+ import { isHighlight as isHighlight2, isReference as isReference2, isResolvedReference as isResolvedReference2, isComment as isComment2, isAssessment, isTag as isTag2, getBodySource as getBodySource3 } from "@semiont/core";
26360
26155
  function convertSegmentPositions(segments, content4) {
26361
26156
  if (!content4.includes("\r\n")) {
26362
26157
  return segments;
@@ -26387,7 +26182,7 @@ function getAnnotationTooltip(annotation) {
26387
26182
  const isCommentAnn = isComment2(annotation);
26388
26183
  const isHighlightAnn = isHighlight2(annotation);
26389
26184
  const isAssessmentAnn = isAssessment(annotation);
26390
- const isTagAnn = isTag3(annotation);
26185
+ const isTagAnn = isTag2(annotation);
26391
26186
  const isReferenceAnn = isReference2(annotation);
26392
26187
  const isResolvedRef = isResolvedReference2(annotation);
26393
26188
  if (isCommentAnn) {
@@ -26412,7 +26207,7 @@ function getAnnotationDecorationMeta(annotation, isNew) {
26412
26207
  const isReferenceAnn = isReference2(annotation);
26413
26208
  const isCommentAnn = isComment2(annotation);
26414
26209
  const isAssessmentAnn = isAssessment(annotation);
26415
- const isTagAnn = isTag3(annotation);
26210
+ const isTagAnn = isTag2(annotation);
26416
26211
  let annotationType = "highlight";
26417
26212
  if (isCommentAnn) annotationType = "comment";
26418
26213
  else if (isReferenceAnn) annotationType = "reference";
@@ -29624,7 +29419,7 @@ function PopupContainer({ children, position: position3, onClose, isOpen, wide =
29624
29419
 
29625
29420
  // src/components/image-annotation/AnnotationOverlay.tsx
29626
29421
  import { useMemo as useMemo3 } from "react";
29627
- import { getSvgSelector, isHighlight as isHighlight3, isReference as isReference4, isAssessment as isAssessment2, isComment as isComment3, isTag as isTag4, isBodyResolved, isResolvedReference as isResolvedReference3 } from "@semiont/core";
29422
+ import { getSvgSelector, isHighlight as isHighlight3, isReference as isReference4, isAssessment as isAssessment2, isComment as isComment3, isTag as isTag3, isBodyResolved, isResolvedReference as isResolvedReference3 } from "@semiont/core";
29628
29423
  import { createHoverHandlers as createHoverHandlers2 } from "@semiont/sdk";
29629
29424
  import { parseSvgSelector } from "@semiont/core";
29630
29425
  import { jsx as jsx17, jsxs as jsxs10 } from "react/jsx-runtime";
@@ -29637,7 +29432,7 @@ function getAnnotationColor(annotation) {
29637
29432
  return { stroke: "rgb(239, 68, 68)", fill: "rgba(239, 68, 68, 0.2)" };
29638
29433
  } else if (isComment3(annotation)) {
29639
29434
  return { stroke: "rgb(255, 255, 255)", fill: "rgba(255, 255, 255, 0.2)" };
29640
- } else if (isTag4(annotation)) {
29435
+ } else if (isTag3(annotation)) {
29641
29436
  return { stroke: "rgb(234, 88, 12)", fill: "rgba(234, 88, 12, 0.2)" };
29642
29437
  }
29643
29438
  return { stroke: "rgb(156, 163, 175)", fill: "rgba(156, 163, 175, 0.2)" };
@@ -29649,7 +29444,7 @@ function getAnnotationTooltip2(annotation) {
29649
29444
  return "Highlight";
29650
29445
  } else if (isAssessment2(annotation)) {
29651
29446
  return "Assessment";
29652
- } else if (isTag4(annotation)) {
29447
+ } else if (isTag3(annotation)) {
29653
29448
  return "Tag";
29654
29449
  } else if (isResolvedReference3(annotation)) {
29655
29450
  return "Resolved Reference";
@@ -32523,7 +32318,7 @@ function stringify2(values2) {
32523
32318
  }
32524
32319
 
32525
32320
  // ../../node_modules/hast-util-to-jsx-runtime/lib/index.js
32526
- var import_style_to_js = __toESM(require_cjs3(), 1);
32321
+ var import_style_to_js = __toESM(require_cjs4(), 1);
32527
32322
 
32528
32323
  // ../../node_modules/unist-util-position/lib/index.js
32529
32324
  var pointEnd = point("end");
@@ -32867,11 +32662,11 @@ function addChildren(props, children) {
32867
32662
  }
32868
32663
  }
32869
32664
  }
32870
- function productionCreate(_4, jsx91, jsxs81) {
32665
+ function productionCreate(_4, jsx92, jsxs82) {
32871
32666
  return create2;
32872
32667
  function create2(_5, type, props, key) {
32873
32668
  const isStaticChildren = Array.isArray(props.children);
32874
- const fn = isStaticChildren ? jsxs81 : jsx91;
32669
+ const fn = isStaticChildren ? jsxs82 : jsx92;
32875
32670
  return key ? fn(type, props, key) : fn(type, props);
32876
32671
  }
32877
32672
  }
@@ -39065,11 +38860,11 @@ function createTokenizer(parser6, initialize, from) {
39065
38860
  constructs2
39066
38861
  ])
39067
38862
  ) : handleMapOfConstructs(constructs2);
39068
- function handleMapOfConstructs(map5) {
38863
+ function handleMapOfConstructs(map10) {
39069
38864
  return start2;
39070
38865
  function start2(code4) {
39071
- const left = code4 !== null && map5[code4];
39072
- const all2 = code4 !== null && map5.null;
38866
+ const left = code4 !== null && map10[code4];
38867
+ const all2 = code4 !== null && map10.null;
39073
38868
  const list4 = [
39074
38869
  // To do: add more extension tests.
39075
38870
  /* c8 ignore next 2 */
@@ -40662,10 +40457,10 @@ var deserializer = ($4, _4) => {
40662
40457
  return as(new RegExp(source, flags), index2);
40663
40458
  }
40664
40459
  case MAP: {
40665
- const map5 = as(/* @__PURE__ */ new Map(), index2);
40460
+ const map10 = as(/* @__PURE__ */ new Map(), index2);
40666
40461
  for (const [key, index3] of value)
40667
- map5.set(unpair(key), unpair(index3));
40668
- return map5;
40462
+ map10.set(unpair(key), unpair(index3));
40463
+ return map10;
40669
40464
  }
40670
40465
  case SET2: {
40671
40466
  const set = as(/* @__PURE__ */ new Set(), index2);
@@ -41170,10 +40965,10 @@ function createState(tree, options) {
41170
40965
  };
41171
40966
  visit(tree, function(node2) {
41172
40967
  if (node2.type === "definition" || node2.type === "footnoteDefinition") {
41173
- const map5 = node2.type === "definition" ? definitionById : footnoteById;
40968
+ const map10 = node2.type === "definition" ? definitionById : footnoteById;
41174
40969
  const id2 = String(node2.identifier).toUpperCase();
41175
- if (!map5.has(id2)) {
41176
- map5.set(id2, node2);
40970
+ if (!map10.has(id2)) {
40971
+ map10.set(id2, node2);
41177
40972
  }
41178
40973
  }
41179
40974
  });
@@ -44048,11 +43843,11 @@ function listItem2(node2, parent, state, info) {
44048
43843
  const exit3 = state.enter("listItem");
44049
43844
  const value = state.indentLines(
44050
43845
  state.containerFlow(node2, tracker.current()),
44051
- map5
43846
+ map10
44052
43847
  );
44053
43848
  exit3();
44054
43849
  return value;
44055
- function map5(line, index2, blank) {
43850
+ function map10(line, index2, blank) {
44056
43851
  if (index2) {
44057
43852
  return (blank ? "" : " ".repeat(size)) + line;
44058
43853
  }
@@ -45507,7 +45302,7 @@ function resolveTable(events2, context) {
45507
45302
  let currentTable;
45508
45303
  let currentBody;
45509
45304
  let currentCell;
45510
- const map5 = new EditMap();
45305
+ const map10 = new EditMap();
45511
45306
  while (++index2 < events2.length) {
45512
45307
  const event = events2[index2];
45513
45308
  const token = event[1];
@@ -45515,7 +45310,7 @@ function resolveTable(events2, context) {
45515
45310
  if (token.type === "tableHead") {
45516
45311
  afterHeadAwaitingFirstBodyRow = false;
45517
45312
  if (lastTableEnd !== 0) {
45518
- flushTableEnd(map5, context, lastTableEnd, currentTable, currentBody);
45313
+ flushTableEnd(map10, context, lastTableEnd, currentTable, currentBody);
45519
45314
  currentBody = void 0;
45520
45315
  lastTableEnd = 0;
45521
45316
  }
@@ -45525,7 +45320,7 @@ function resolveTable(events2, context) {
45525
45320
  // Note: correct end is set later.
45526
45321
  end: Object.assign({}, token.end)
45527
45322
  };
45528
- map5.add(index2, 0, [["enter", currentTable, context]]);
45323
+ map10.add(index2, 0, [["enter", currentTable, context]]);
45529
45324
  } else if (token.type === "tableRow" || token.type === "tableDelimiterRow") {
45530
45325
  inFirstCellAwaitingPipe = true;
45531
45326
  currentCell = void 0;
@@ -45539,7 +45334,7 @@ function resolveTable(events2, context) {
45539
45334
  // Note: correct end is set later.
45540
45335
  end: Object.assign({}, token.end)
45541
45336
  };
45542
- map5.add(index2, 0, [["enter", currentBody, context]]);
45337
+ map10.add(index2, 0, [["enter", currentBody, context]]);
45543
45338
  }
45544
45339
  rowKind = token.type === "tableDelimiterRow" ? 2 : currentBody ? 3 : 1;
45545
45340
  } else if (rowKind && (token.type === "data" || token.type === "tableDelimiterMarker" || token.type === "tableDelimiterFiller")) {
@@ -45547,7 +45342,7 @@ function resolveTable(events2, context) {
45547
45342
  if (cell[2] === 0) {
45548
45343
  if (lastCell[1] !== 0) {
45549
45344
  cell[0] = cell[1];
45550
- currentCell = flushCell(map5, context, lastCell, rowKind, void 0, currentCell);
45345
+ currentCell = flushCell(map10, context, lastCell, rowKind, void 0, currentCell);
45551
45346
  lastCell = [0, 0, 0, 0];
45552
45347
  }
45553
45348
  cell[2] = index2;
@@ -45558,7 +45353,7 @@ function resolveTable(events2, context) {
45558
45353
  } else {
45559
45354
  if (lastCell[1] !== 0) {
45560
45355
  cell[0] = cell[1];
45561
- currentCell = flushCell(map5, context, lastCell, rowKind, void 0, currentCell);
45356
+ currentCell = flushCell(map10, context, lastCell, rowKind, void 0, currentCell);
45562
45357
  }
45563
45358
  lastCell = cell;
45564
45359
  cell = [lastCell[1], index2, 0, 0];
@@ -45571,9 +45366,9 @@ function resolveTable(events2, context) {
45571
45366
  lastTableEnd = index2;
45572
45367
  if (lastCell[1] !== 0) {
45573
45368
  cell[0] = cell[1];
45574
- currentCell = flushCell(map5, context, lastCell, rowKind, index2, currentCell);
45369
+ currentCell = flushCell(map10, context, lastCell, rowKind, index2, currentCell);
45575
45370
  } else if (cell[1] !== 0) {
45576
- currentCell = flushCell(map5, context, cell, rowKind, index2, currentCell);
45371
+ currentCell = flushCell(map10, context, cell, rowKind, index2, currentCell);
45577
45372
  }
45578
45373
  rowKind = 0;
45579
45374
  } else if (rowKind && (token.type === "data" || token.type === "tableDelimiterMarker" || token.type === "tableDelimiterFiller")) {
@@ -45581,9 +45376,9 @@ function resolveTable(events2, context) {
45581
45376
  }
45582
45377
  }
45583
45378
  if (lastTableEnd !== 0) {
45584
- flushTableEnd(map5, context, lastTableEnd, currentTable, currentBody);
45379
+ flushTableEnd(map10, context, lastTableEnd, currentTable, currentBody);
45585
45380
  }
45586
- map5.consume(context.events);
45381
+ map10.consume(context.events);
45587
45382
  index2 = -1;
45588
45383
  while (++index2 < context.events.length) {
45589
45384
  const event = context.events[index2];
@@ -45593,12 +45388,12 @@ function resolveTable(events2, context) {
45593
45388
  }
45594
45389
  return events2;
45595
45390
  }
45596
- function flushCell(map5, context, range, rowKind, rowEnd, previousCell) {
45391
+ function flushCell(map10, context, range, rowKind, rowEnd, previousCell) {
45597
45392
  const groupName = rowKind === 1 ? "tableHeader" : rowKind === 2 ? "tableDelimiter" : "tableData";
45598
45393
  const valueName = "tableContent";
45599
45394
  if (range[0] !== 0) {
45600
45395
  previousCell.end = Object.assign({}, getPoint(context.events, range[0]));
45601
- map5.add(range[0], 0, [["exit", previousCell, context]]);
45396
+ map10.add(range[0], 0, [["exit", previousCell, context]]);
45602
45397
  }
45603
45398
  const now = getPoint(context.events, range[1]);
45604
45399
  previousCell = {
@@ -45607,7 +45402,7 @@ function flushCell(map5, context, range, rowKind, rowEnd, previousCell) {
45607
45402
  // Note: correct end is set later.
45608
45403
  end: Object.assign({}, now)
45609
45404
  };
45610
- map5.add(range[1], 0, [["enter", previousCell, context]]);
45405
+ map10.add(range[1], 0, [["enter", previousCell, context]]);
45611
45406
  if (range[2] !== 0) {
45612
45407
  const relatedStart = getPoint(context.events, range[2]);
45613
45408
  const relatedEnd = getPoint(context.events, range[3]);
@@ -45616,7 +45411,7 @@ function flushCell(map5, context, range, rowKind, rowEnd, previousCell) {
45616
45411
  start: Object.assign({}, relatedStart),
45617
45412
  end: Object.assign({}, relatedEnd)
45618
45413
  };
45619
- map5.add(range[2], 0, [["enter", valueToken, context]]);
45414
+ map10.add(range[2], 0, [["enter", valueToken, context]]);
45620
45415
  if (rowKind !== 2) {
45621
45416
  const start2 = context.events[range[2]];
45622
45417
  const end = context.events[range[3]];
@@ -45626,19 +45421,19 @@ function flushCell(map5, context, range, rowKind, rowEnd, previousCell) {
45626
45421
  if (range[3] > range[2] + 1) {
45627
45422
  const a15 = range[2] + 1;
45628
45423
  const b8 = range[3] - range[2] - 1;
45629
- map5.add(a15, b8, []);
45424
+ map10.add(a15, b8, []);
45630
45425
  }
45631
45426
  }
45632
- map5.add(range[3] + 1, 0, [["exit", valueToken, context]]);
45427
+ map10.add(range[3] + 1, 0, [["exit", valueToken, context]]);
45633
45428
  }
45634
45429
  if (rowEnd !== void 0) {
45635
45430
  previousCell.end = Object.assign({}, getPoint(context.events, rowEnd));
45636
- map5.add(rowEnd, 0, [["exit", previousCell, context]]);
45431
+ map10.add(rowEnd, 0, [["exit", previousCell, context]]);
45637
45432
  previousCell = void 0;
45638
45433
  }
45639
45434
  return previousCell;
45640
45435
  }
45641
- function flushTableEnd(map5, context, index2, table2, tableBody) {
45436
+ function flushTableEnd(map10, context, index2, table2, tableBody) {
45642
45437
  const exits = [];
45643
45438
  const related = getPoint(context.events, index2);
45644
45439
  if (tableBody) {
@@ -45647,7 +45442,7 @@ function flushTableEnd(map5, context, index2, table2, tableBody) {
45647
45442
  }
45648
45443
  table2.end = Object.assign({}, related);
45649
45444
  exits.push(["exit", table2, context]);
45650
- map5.add(index2 + 1, 0, exits);
45445
+ map10.add(index2 + 1, 0, exits);
45651
45446
  }
45652
45447
  function getPoint(events2, index2) {
45653
45448
  const event = events2[index2];
@@ -45973,7 +45768,7 @@ var BrowseView = memo(function BrowseView2({
45973
45768
 
45974
45769
  // src/components/resource/ResourceViewer.tsx
45975
45770
  import { useState as useState18, useEffect as useEffect25, useCallback as useCallback16, useRef as useRef17, useMemo as useMemo5 } from "react";
45976
- import { getExactText as getExactText3, getTargetSelector as getTargetSelector4, isHighlight as isHighlight4, isAssessment as isAssessment3, isReference as isReference5, isComment as isComment4, isTag as isTag5, getBodySource as getBodySource4 } from "@semiont/core";
45771
+ import { getExactText as getExactText3, getTargetSelector as getTargetSelector4, isHighlight as isHighlight4, isAssessment as isAssessment3, isReference as isReference5, isComment as isComment4, isTag as isTag4, getBodySource as getBodySource4 } from "@semiont/core";
45977
45772
  import { jsx as jsx28, jsxs as jsxs20 } from "react/jsx-runtime";
45978
45773
  function ResourceViewer({
45979
45774
  resource,
@@ -46111,7 +45906,7 @@ function ResourceViewer({
46111
45906
  return;
46112
45907
  }
46113
45908
  }
46114
- const isSimpleAnnotation = isHighlight4(annotation) || isAssessment3(annotation) || isComment4(annotation) || isReference5(annotation) || isTag5(annotation);
45909
+ const isSimpleAnnotation = isHighlight4(annotation) || isAssessment3(annotation) || isComment4(annotation) || isReference5(annotation) || isTag4(annotation);
46115
45910
  if (selectedClick === "follow" && isReference5(annotation)) {
46116
45911
  const bodySource = getBodySource4(annotation.body);
46117
45912
  if (bodySource) {
@@ -46369,6 +46164,7 @@ function AssistSection({
46369
46164
  annotationType,
46370
46165
  isAssisting,
46371
46166
  locale,
46167
+ sourceLanguage,
46372
46168
  progress
46373
46169
  }) {
46374
46170
  const panelName = annotationType === "highlight" ? "HighlightPanel" : annotationType === "assessment" ? "AssessmentPanel" : "CommentsPanel";
@@ -46394,11 +46190,16 @@ function AssistSection({
46394
46190
  instructions: instructions.trim() || void 0,
46395
46191
  tone: (annotationType === "comment" || annotationType === "assessment") && tone ? tone : void 0,
46396
46192
  density: (annotationType === "comment" || annotationType === "assessment" || annotationType === "highlight") && useDensity ? density : void 0,
46397
- language: annotationType === "comment" || annotationType === "assessment" ? locale : void 0
46193
+ // Body locale only applies where the LLM writes natural-language text:
46194
+ // comment/assessment have a body, highlight does not.
46195
+ language: annotationType === "comment" || annotationType === "assessment" ? locale : void 0,
46196
+ // Source locale applies to all three — affects analysis quality on
46197
+ // non-English source, regardless of whether a body is produced.
46198
+ sourceLanguage
46398
46199
  });
46399
46200
  setInstructions("");
46400
46201
  setTone("");
46401
- }, [annotationType, instructions, tone, useDensity, density, locale, session]);
46202
+ }, [annotationType, instructions, tone, useDensity, density, locale, sourceLanguage, session]);
46402
46203
  const handleDismissProgress = useCallback17(() => {
46403
46204
  session?.client.mark.dismissProgress();
46404
46205
  }, [session]);
@@ -46598,6 +46399,7 @@ function AssessmentPanel({
46598
46399
  isAssisting = false,
46599
46400
  progress,
46600
46401
  locale,
46402
+ sourceLanguage,
46601
46403
  annotateMode = true,
46602
46404
  scrollToAnnotationId,
46603
46405
  onScrollCompleted,
@@ -46744,6 +46546,7 @@ function AssessmentPanel({
46744
46546
  annotationType: "assessment",
46745
46547
  isAssisting,
46746
46548
  locale,
46549
+ sourceLanguage,
46747
46550
  progress
46748
46551
  }
46749
46552
  ),
@@ -47001,6 +46804,7 @@ function CommentsPanel({
47001
46804
  isAssisting = false,
47002
46805
  progress,
47003
46806
  locale,
46807
+ sourceLanguage,
47004
46808
  scrollToAnnotationId,
47005
46809
  onScrollCompleted,
47006
46810
  hoveredAnnotationId
@@ -47147,6 +46951,7 @@ function CommentsPanel({
47147
46951
  annotationType: "comment",
47148
46952
  isAssisting,
47149
46953
  locale,
46954
+ sourceLanguage,
47150
46955
  progress
47151
46956
  }
47152
46957
  ),
@@ -47236,7 +47041,8 @@ function HighlightPanel({
47236
47041
  annotateMode = true,
47237
47042
  scrollToAnnotationId,
47238
47043
  onScrollCompleted,
47239
- hoveredAnnotationId
47044
+ hoveredAnnotationId,
47045
+ sourceLanguage
47240
47046
  }) {
47241
47047
  const t12 = useTranslations("HighlightPanel");
47242
47048
  const session = useObservable(useSemiont().activeSession$);
@@ -47312,7 +47118,8 @@ function HighlightPanel({
47312
47118
  {
47313
47119
  annotationType: "highlight",
47314
47120
  isAssisting,
47315
- progress
47121
+ progress,
47122
+ sourceLanguage
47316
47123
  }
47317
47124
  ),
47318
47125
  /* @__PURE__ */ jsx36("div", { className: "semiont-panel__list", children: sortedAnnotations.length === 0 ? /* @__PURE__ */ jsx36("p", { className: "semiont-panel__empty", children: t12("noHighlights") }) : sortedAnnotations.map((highlight) => /* @__PURE__ */ jsx36(
@@ -47401,6 +47208,52 @@ function JsonLdPanel({ resource: semiontResource }) {
47401
47208
  // src/components/resource/panels/ReferenceEntry.tsx
47402
47209
  import { resourceId } from "@semiont/core";
47403
47210
  import { getAnnotationExactText as getAnnotationExactText4, isBodyResolved as isBodyResolved2, getBodySource as getBodySource5, getFragmentSelector, getSvgSelector as getSvgSelector2, getTargetSelector as getTargetSelector8 } from "@semiont/core";
47211
+
47212
+ // ../ontology/dist/index.js
47213
+ function getEntityTypes(annotation) {
47214
+ if (Array.isArray(annotation.body)) {
47215
+ const entityTags = [];
47216
+ for (const item of annotation.body) {
47217
+ if (typeof item === "object" && item !== null && "type" in item && "value" in item && "purpose" in item) {
47218
+ const itemType = item.type;
47219
+ const itemValue = item.value;
47220
+ const itemPurpose = item.purpose;
47221
+ if (itemType === "TextualBody" && itemPurpose === "tagging" && typeof itemValue === "string" && itemValue.length > 0) {
47222
+ entityTags.push(itemValue);
47223
+ }
47224
+ }
47225
+ }
47226
+ return entityTags;
47227
+ }
47228
+ return [];
47229
+ }
47230
+ function isTag5(annotation) {
47231
+ return annotation.motivation === "tagging";
47232
+ }
47233
+ function getTagCategory(annotation) {
47234
+ if (!isTag5(annotation)) return void 0;
47235
+ const bodies = Array.isArray(annotation.body) ? annotation.body : [annotation.body];
47236
+ const taggingBody = bodies.find(
47237
+ (b8) => b8 !== null && typeof b8 === "object" && "purpose" in b8 && b8.purpose === "tagging"
47238
+ );
47239
+ if (taggingBody && "value" in taggingBody) {
47240
+ return taggingBody.value;
47241
+ }
47242
+ return void 0;
47243
+ }
47244
+ function getTagSchemaId(annotation) {
47245
+ if (!isTag5(annotation)) return void 0;
47246
+ const bodies = Array.isArray(annotation.body) ? annotation.body : [annotation.body];
47247
+ const classifyingBody = bodies.find(
47248
+ (b8) => b8 !== null && typeof b8 === "object" && "purpose" in b8 && b8.purpose === "classifying"
47249
+ );
47250
+ if (classifyingBody && "value" in classifyingBody) {
47251
+ return classifyingBody.value;
47252
+ }
47253
+ return void 0;
47254
+ }
47255
+
47256
+ // src/components/resource/panels/ReferenceEntry.tsx
47404
47257
  import { jsx as jsx38, jsxs as jsxs31 } from "react/jsx-runtime";
47405
47258
  function ReferenceEntry({
47406
47259
  reference,
@@ -47564,7 +47417,9 @@ function ReferencesPanel({
47564
47417
  pendingAnnotation,
47565
47418
  scrollToAnnotationId,
47566
47419
  onScrollCompleted,
47567
- hoveredAnnotationId
47420
+ hoveredAnnotationId,
47421
+ locale,
47422
+ sourceLanguage
47568
47423
  }) {
47569
47424
  const t12 = useTranslations("ReferencesPanel");
47570
47425
  const session = useObservable(useSemiont().activeSession$);
@@ -47645,7 +47500,11 @@ function ReferencesPanel({
47645
47500
  setLastDetectionLog(null);
47646
47501
  session?.client.mark.requestAssist("linking", {
47647
47502
  entityTypes: selectedEntityTypes,
47648
- includeDescriptiveReferences
47503
+ includeDescriptiveReferences,
47504
+ // Body locale stamps the unresolved-reference body's `language`;
47505
+ // sourceLanguage tunes the prompt for non-English source content.
47506
+ language: locale,
47507
+ sourceLanguage
47649
47508
  });
47650
47509
  };
47651
47510
  const hasSavedLogRef = useRef23(false);
@@ -48098,6 +47957,7 @@ function StatisticsPanel({
48098
47957
  }
48099
47958
 
48100
47959
  // src/components/resource/panels/TagEntry.tsx
47960
+ import { useMemo as useMemo10 } from "react";
48101
47961
  import { getAnnotationExactText as getAnnotationExactText5 } from "@semiont/core";
48102
47962
  import { jsx as jsx42, jsxs as jsxs35 } from "react/jsx-runtime";
48103
47963
  function TagEntry({
@@ -48111,7 +47971,12 @@ function TagEntry({
48111
47971
  const selectedText = getAnnotationExactText5(tag);
48112
47972
  const category = getTagCategory(tag);
48113
47973
  const schemaId = getTagSchemaId(tag);
48114
- const schema = schemaId ? getTagSchema(schemaId) : null;
47974
+ const tagSchemas$ = useMemo10(
47975
+ () => session?.client.browse.tagSchemas() ?? null,
47976
+ [session]
47977
+ );
47978
+ const schemas = useObservable(tagSchemas$);
47979
+ const schema = schemaId && schemas ? schemas.find((s11) => s11.id === schemaId) ?? null : null;
48115
47980
  return /* @__PURE__ */ jsxs35(
48116
47981
  "div",
48117
47982
  {
@@ -48144,7 +48009,7 @@ function TagEntry({
48144
48009
  }
48145
48010
 
48146
48011
  // src/components/resource/panels/TaggingPanel.tsx
48147
- import { useState as useState25, useEffect as useEffect33, useRef as useRef24, useCallback as useCallback22, useMemo as useMemo10 } from "react";
48012
+ import { useState as useState25, useEffect as useEffect33, useRef as useRef24, useCallback as useCallback22, useMemo as useMemo11 } from "react";
48148
48013
  import { getTextPositionSelector as getTextPositionSelector7, getTargetSelector as getTargetSelector10 } from "@semiont/core";
48149
48014
  import { Fragment as Fragment8, jsx as jsx43, jsxs as jsxs36 } from "react/jsx-runtime";
48150
48015
  function getSelectorDisplayText4(selector) {
@@ -48168,12 +48033,26 @@ function TaggingPanel({
48168
48033
  pendingAnnotation,
48169
48034
  scrollToAnnotationId,
48170
48035
  onScrollCompleted,
48171
- hoveredAnnotationId
48036
+ hoveredAnnotationId,
48037
+ locale,
48038
+ sourceLanguage
48172
48039
  }) {
48173
48040
  const t12 = useTranslations("TaggingPanel");
48174
48041
  const session = useObservable(useSemiont().activeSession$);
48175
- const [selectedSchemaId, setSelectedSchemaId] = useState25("legal-irac");
48042
+ const tagSchemas$ = useMemo11(
48043
+ () => session?.client.browse.tagSchemas() ?? null,
48044
+ [session]
48045
+ );
48046
+ const schemasObserved = useObservable(tagSchemas$);
48047
+ const schemas = schemasObserved ?? [];
48048
+ const noSchemasRegistered = schemasObserved !== void 0 && schemasObserved.length === 0;
48049
+ const [selectedSchemaId, setSelectedSchemaId] = useState25("");
48176
48050
  const [selectedCategories, setSelectedCategories] = useState25(/* @__PURE__ */ new Set());
48051
+ useEffect33(() => {
48052
+ if (!selectedSchemaId && schemas.length > 0) {
48053
+ setSelectedSchemaId(schemas[0].id);
48054
+ }
48055
+ }, [schemas, selectedSchemaId]);
48177
48056
  const [focusedAnnotationId, setFocusedAnnotationId] = useState25(null);
48178
48057
  const containerRef = useRef24(null);
48179
48058
  const [isAssistExpanded, setIsDetectExpanded] = useState25(() => {
@@ -48193,7 +48072,7 @@ function TaggingPanel({
48193
48072
  "browse:click": handleAnnotationClick2
48194
48073
  });
48195
48074
  const entryRefs = useRef24(/* @__PURE__ */ new Map());
48196
- const sortedAnnotations = useMemo10(() => {
48075
+ const sortedAnnotations = useMemo11(() => {
48197
48076
  return [...annotations].sort((a15, b8) => {
48198
48077
  const aSelector = getTextPositionSelector7(getTargetSelector10(a15.target));
48199
48078
  const bSelector = getTextPositionSelector7(getTargetSelector10(b8.target));
@@ -48239,7 +48118,6 @@ function TaggingPanel({
48239
48118
  container.scrollTo({ top: scrollTo, behavior: "smooth" });
48240
48119
  }
48241
48120
  }, [hoveredAnnotationId]);
48242
- const schemas = getAllTagSchemas();
48243
48121
  const selectedSchema = schemas.find((s11) => s11.id === selectedSchemaId);
48244
48122
  const handleSchemaChange = (schemaId) => {
48245
48123
  setSelectedSchemaId(schemaId);
@@ -48266,7 +48144,11 @@ function TaggingPanel({
48266
48144
  if (selectedCategories.size > 0) {
48267
48145
  session?.client.mark.requestAssist("tagging", {
48268
48146
  schemaId: selectedSchemaId,
48269
- categories: Array.from(selectedCategories)
48147
+ categories: Array.from(selectedCategories),
48148
+ // Body locale stamps the tagging body's `language`; sourceLanguage
48149
+ // tunes the prompt for non-English source content.
48150
+ language: locale,
48151
+ sourceLanguage
48270
48152
  });
48271
48153
  setSelectedCategories(/* @__PURE__ */ new Set());
48272
48154
  }
@@ -48293,7 +48175,8 @@ function TaggingPanel({
48293
48175
  }
48294
48176
  return t12("fragmentSelected");
48295
48177
  })() }) }),
48296
- /* @__PURE__ */ jsxs36("div", { className: "semiont-form-field", children: [
48178
+ noSchemasRegistered && /* @__PURE__ */ jsx43("p", { className: "semiont-form__help", "data-type": "tag-no-schemas", children: t12("noSchemas") }),
48179
+ !noSchemasRegistered && /* @__PURE__ */ jsxs36("div", { className: "semiont-form-field", children: [
48297
48180
  /* @__PURE__ */ jsx43("label", { className: "semiont-form-field__label", children: t12("selectSchema") }),
48298
48181
  /* @__PURE__ */ jsx43(
48299
48182
  "select",
@@ -48301,7 +48184,7 @@ function TaggingPanel({
48301
48184
  value: selectedSchemaId,
48302
48185
  onChange: (e6) => handleSchemaChange(e6.target.value),
48303
48186
  className: "semiont-select",
48304
- children: schemas.map((schema) => /* @__PURE__ */ jsx43("option", { value: schema.id, children: t12(`schema${schema.id === "legal-irac" ? "Legal" : schema.id === "scientific-imrad" ? "Scientific" : "Argument"}`) }, schema.id))
48187
+ children: schemas.map((schema) => /* @__PURE__ */ jsx43("option", { value: schema.id, children: schema.name }, schema.id))
48305
48188
  }
48306
48189
  )
48307
48190
  ] }),
@@ -48365,7 +48248,8 @@ function TaggingPanel({
48365
48248
  ),
48366
48249
  isAssistExpanded && /* @__PURE__ */ jsxs36("div", { className: "semiont-assist-widget", "data-assisting": isAssisting && progress ? "true" : "false", "data-type": "tag", children: [
48367
48250
  !isAssisting && !progress && /* @__PURE__ */ jsxs36(Fragment8, { children: [
48368
- /* @__PURE__ */ jsxs36("div", { className: "semiont-form-field", children: [
48251
+ noSchemasRegistered && /* @__PURE__ */ jsx43("p", { className: "semiont-form__help", "data-type": "tag-no-schemas", children: t12("noSchemas") }),
48252
+ !noSchemasRegistered && /* @__PURE__ */ jsxs36("div", { className: "semiont-form-field", children: [
48369
48253
  /* @__PURE__ */ jsx43("label", { className: "semiont-form-field__label", children: t12("selectSchema") }),
48370
48254
  /* @__PURE__ */ jsx43(
48371
48255
  "select",
@@ -48373,7 +48257,7 @@ function TaggingPanel({
48373
48257
  value: selectedSchemaId,
48374
48258
  onChange: (e6) => handleSchemaChange(e6.target.value),
48375
48259
  className: "semiont-select",
48376
- children: schemas.map((schema) => /* @__PURE__ */ jsx43("option", { value: schema.id, children: t12(`schema${schema.id === "legal-irac" ? "Legal" : schema.id === "scientific-imrad" ? "Scientific" : "Argument"}`) }, schema.id))
48260
+ children: schemas.map((schema) => /* @__PURE__ */ jsx43("option", { value: schema.id, children: schema.name }, schema.id))
48377
48261
  }
48378
48262
  ),
48379
48263
  selectedSchema && /* @__PURE__ */ jsx43("p", { className: "semiont-form__help", children: selectedSchema.description })
@@ -48420,7 +48304,7 @@ function TaggingPanel({
48420
48304
  className: "semiont-form__checkbox-label",
48421
48305
  style: { display: "flex", flexDirection: "column", gap: "0.25rem" },
48422
48306
  children: [
48423
- /* @__PURE__ */ jsx43("span", { style: { fontWeight: 500 }, children: t12(`category${category.name.replace(/\s+/g, "")}`) }),
48307
+ /* @__PURE__ */ jsx43("span", { style: { fontWeight: 500 }, children: category.name }),
48424
48308
  /* @__PURE__ */ jsx43("span", { style: { fontSize: "var(--semiont-text-xs)", color: "var(--semiont-text-secondary)" }, children: category.description })
48425
48309
  ]
48426
48310
  }
@@ -48616,6 +48500,7 @@ function UnifiedAnnotationsPanel(props) {
48616
48500
  progress,
48617
48501
  annotateMode: props.annotateMode,
48618
48502
  locale: props.locale,
48503
+ sourceLanguage: props.sourceLanguage,
48619
48504
  scrollToAnnotationId: props.scrollToAnnotationId,
48620
48505
  onScrollCompleted: props.onScrollCompleted,
48621
48506
  hoveredAnnotationId: props.hoveredAnnotationId
@@ -48640,6 +48525,8 @@ function UnifiedAnnotationsPanel(props) {
48640
48525
  scrollToAnnotationId: commonProps.scrollToAnnotationId,
48641
48526
  onScrollCompleted: commonProps.onScrollCompleted,
48642
48527
  hoveredAnnotationId: commonProps.hoveredAnnotationId,
48528
+ locale: commonProps.locale,
48529
+ sourceLanguage: commonProps.sourceLanguage,
48643
48530
  allEntityTypes: props.allEntityTypes || [],
48644
48531
  generatingReferenceId: props.generatingReferenceId,
48645
48532
  referencedBy: props.referencedBy,
@@ -48952,16 +48839,16 @@ function SimpleNavigation({
48952
48839
  import { useCallback as useCallback29, useState as useState32, useRef as useRef31, useEffect as useEffect41 } from "react";
48953
48840
 
48954
48841
  // ../../node_modules/@dnd-kit/core/dist/core.esm.js
48955
- import React18, { createContext as createContext5, useContext as useContext5, useEffect as useEffect38, useState as useState30, useCallback as useCallback26, useMemo as useMemo12, useRef as useRef28, memo as memo2, useReducer, cloneElement, forwardRef } from "react";
48842
+ import React18, { createContext as createContext5, useContext as useContext5, useEffect as useEffect38, useState as useState30, useCallback as useCallback26, useMemo as useMemo13, useRef as useRef28, memo as memo2, useReducer, cloneElement, forwardRef } from "react";
48956
48843
  import { createPortal, unstable_batchedUpdates } from "react-dom";
48957
48844
 
48958
48845
  // ../../node_modules/@dnd-kit/utilities/dist/utilities.esm.js
48959
- import { useMemo as useMemo11, useLayoutEffect, useEffect as useEffect37, useRef as useRef27, useCallback as useCallback24 } from "react";
48846
+ import { useMemo as useMemo12, useLayoutEffect, useEffect as useEffect37, useRef as useRef27, useCallback as useCallback24 } from "react";
48960
48847
  function useCombinedRefs() {
48961
48848
  for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
48962
48849
  refs[_key] = arguments[_key];
48963
48850
  }
48964
- return useMemo11(
48851
+ return useMemo12(
48965
48852
  () => (node2) => {
48966
48853
  refs.forEach((ref) => ref(node2));
48967
48854
  },
@@ -49064,7 +48951,7 @@ function useLatestValue(value, dependencies) {
49064
48951
  }
49065
48952
  function useLazyMemo(callback, dependencies) {
49066
48953
  const valueRef = useRef27();
49067
- return useMemo11(
48954
+ return useMemo12(
49068
48955
  () => {
49069
48956
  const newValue = callback(valueRef.current);
49070
48957
  valueRef.current = newValue;
@@ -49098,7 +48985,7 @@ function usePrevious(value) {
49098
48985
  }
49099
48986
  var ids = {};
49100
48987
  function useUniqueId(prefix, value) {
49101
- return useMemo11(() => {
48988
+ return useMemo12(() => {
49102
48989
  if (value) {
49103
48990
  return value;
49104
48991
  }
@@ -49370,7 +49257,7 @@ function Accessibility(_ref) {
49370
49257
  useEffect38(() => {
49371
49258
  setMounted(true);
49372
49259
  }, []);
49373
- useDndMonitor(useMemo12(() => ({
49260
+ useDndMonitor(useMemo13(() => ({
49374
49261
  onDragStart(_ref2) {
49375
49262
  let {
49376
49263
  active
@@ -49448,7 +49335,7 @@ var Action;
49448
49335
  function noop() {
49449
49336
  }
49450
49337
  function useSensor(sensor, options) {
49451
- return useMemo12(
49338
+ return useMemo13(
49452
49339
  () => ({
49453
49340
  sensor,
49454
49341
  options: options != null ? options : {}
@@ -49461,7 +49348,7 @@ function useSensors() {
49461
49348
  for (var _len = arguments.length, sensors = new Array(_len), _key = 0; _key < _len; _key++) {
49462
49349
  sensors[_key] = arguments[_key];
49463
49350
  }
49464
- return useMemo12(
49351
+ return useMemo13(
49465
49352
  () => [...sensors].filter((sensor) => sensor != null),
49466
49353
  // eslint-disable-next-line react-hooks/exhaustive-deps
49467
49354
  [...sensors]
@@ -50711,7 +50598,7 @@ function useAutoScroller(_ref) {
50711
50598
  x: 0,
50712
50599
  y: 0
50713
50600
  });
50714
- const rect = useMemo12(() => {
50601
+ const rect = useMemo13(() => {
50715
50602
  switch (activator) {
50716
50603
  case AutoScrollActivator.Pointer:
50717
50604
  return pointerCoordinates ? {
@@ -50734,7 +50621,7 @@ function useAutoScroller(_ref) {
50734
50621
  const scrollTop = scrollSpeed.current.y * scrollDirection.current.y;
50735
50622
  scrollContainer.scrollBy(scrollLeft, scrollTop);
50736
50623
  }, []);
50737
- const sortedScrollableAncestors = useMemo12(() => order2 === TraversalOrder.TreeOrder ? [...scrollableAncestors].reverse() : scrollableAncestors, [order2, scrollableAncestors]);
50624
+ const sortedScrollableAncestors = useMemo13(() => order2 === TraversalOrder.TreeOrder ? [...scrollableAncestors].reverse() : scrollableAncestors, [order2, scrollableAncestors]);
50738
50625
  useEffect38(
50739
50626
  () => {
50740
50627
  if (!enabled || !scrollableAncestors.length || !rect) {
@@ -50848,7 +50735,7 @@ function useCachedNode(draggableNodes, id2) {
50848
50735
  }, [node2, id2]);
50849
50736
  }
50850
50737
  function useCombineActivators(sensors, getSyntheticHandler) {
50851
- return useMemo12(() => sensors.reduce((accumulator, sensor) => {
50738
+ return useMemo13(() => sensors.reduce((accumulator, sensor) => {
50852
50739
  const {
50853
50740
  sensor: Sensor
50854
50741
  } = sensor;
@@ -50905,23 +50792,23 @@ function useDroppableMeasuring(containers, _ref) {
50905
50792
  return defaultValue;
50906
50793
  }
50907
50794
  if (!previousValue || previousValue === defaultValue || containersRef.current !== containers || queue != null) {
50908
- const map5 = /* @__PURE__ */ new Map();
50795
+ const map10 = /* @__PURE__ */ new Map();
50909
50796
  for (let container of containers) {
50910
50797
  if (!container) {
50911
50798
  continue;
50912
50799
  }
50913
50800
  if (queue && queue.length > 0 && !queue.includes(container.id) && container.rect.current) {
50914
- map5.set(container.id, container.rect.current);
50801
+ map10.set(container.id, container.rect.current);
50915
50802
  continue;
50916
50803
  }
50917
50804
  const node2 = container.node.current;
50918
50805
  const rect = node2 ? new Rect(measure(node2), node2) : null;
50919
50806
  container.rect.current = rect;
50920
50807
  if (rect) {
50921
- map5.set(container.id, rect);
50808
+ map10.set(container.id, rect);
50922
50809
  }
50923
50810
  }
50924
- return map5;
50811
+ return map10;
50925
50812
  }
50926
50813
  return previousValue;
50927
50814
  }, [containers, queue, dragging, disabled, measure]);
@@ -50996,7 +50883,7 @@ function useMutationObserver(_ref) {
50996
50883
  disabled
50997
50884
  } = _ref;
50998
50885
  const handleMutations = useEvent(callback);
50999
- const mutationObserver = useMemo12(() => {
50886
+ const mutationObserver = useMemo13(() => {
51000
50887
  if (disabled || typeof window === "undefined" || typeof window.MutationObserver === "undefined") {
51001
50888
  return void 0;
51002
50889
  }
@@ -51016,7 +50903,7 @@ function useResizeObserver(_ref) {
51016
50903
  disabled
51017
50904
  } = _ref;
51018
50905
  const handleResize = useEvent(callback);
51019
- const resizeObserver = useMemo12(
50906
+ const resizeObserver = useMemo13(
51020
50907
  () => {
51021
50908
  if (disabled || typeof window === "undefined" || typeof window.ResizeObserver === "undefined") {
51022
50909
  return void 0;
@@ -51158,7 +51045,7 @@ function useScrollOffsets(elements) {
51158
51045
  });
51159
51046
  }
51160
51047
  }, [handleScroll, elements]);
51161
- return useMemo12(() => {
51048
+ return useMemo13(() => {
51162
51049
  if (elements.length) {
51163
51050
  return scrollCoordinates ? Array.from(scrollCoordinates.values()).reduce((acc, coordinates) => add(acc, coordinates), defaultCoordinates) : getScrollOffsets(elements);
51164
51051
  }
@@ -51217,7 +51104,7 @@ function useSensorSetup(sensors) {
51217
51104
  );
51218
51105
  }
51219
51106
  function useSyntheticListeners(listeners, id2) {
51220
- return useMemo12(() => {
51107
+ return useMemo13(() => {
51221
51108
  return listeners.reduce((acc, _ref) => {
51222
51109
  let {
51223
51110
  eventName,
@@ -51231,7 +51118,7 @@ function useSyntheticListeners(listeners, id2) {
51231
51118
  }, [listeners, id2]);
51232
51119
  }
51233
51120
  function useWindowRect(element2) {
51234
- return useMemo12(() => element2 ? getWindowClientRect(element2) : null, [element2]);
51121
+ return useMemo13(() => element2 ? getWindowClientRect(element2) : null, [element2]);
51235
51122
  }
51236
51123
  var defaultValue$2 = [];
51237
51124
  function useRects(elements, measure) {
@@ -51303,7 +51190,7 @@ function useDragOverlayMeasuring(_ref) {
51303
51190
  setRect(node2 ? measure(node2) : null);
51304
51191
  }, [measure, resizeObserver]);
51305
51192
  const [nodeRef, setRef] = useNodeRef(handleNodeChange);
51306
- return useMemo12(() => ({
51193
+ return useMemo13(() => ({
51307
51194
  nodeRef,
51308
51195
  rect,
51309
51196
  setRef
@@ -51580,7 +51467,7 @@ function applyModifiers(modifiers2, _ref) {
51580
51467
  }, transform) : transform;
51581
51468
  }
51582
51469
  function useMeasuringConfiguration(config) {
51583
- return useMemo12(
51470
+ return useMemo13(
51584
51471
  () => ({
51585
51472
  draggable: {
51586
51473
  ...defaultMeasuringConfiguration.draggable,
@@ -51691,7 +51578,7 @@ var DndContext = /* @__PURE__ */ memo2(function DndContext2(_ref) {
51691
51578
  initial: null,
51692
51579
  translated: null
51693
51580
  });
51694
- const active = useMemo12(() => {
51581
+ const active = useMemo13(() => {
51695
51582
  var _node$data;
51696
51583
  return activeId != null ? {
51697
51584
  id: activeId,
@@ -51705,7 +51592,7 @@ var DndContext = /* @__PURE__ */ memo2(function DndContext2(_ref) {
51705
51592
  const [activatorEvent, setActivatorEvent] = useState30(null);
51706
51593
  const latestProps = useLatestValue(props, Object.values(props));
51707
51594
  const draggableDescribedById = useUniqueId("DndDescribedBy", id2);
51708
- const enabledDroppableContainers = useMemo12(() => droppableContainers.getEnabled(), [droppableContainers]);
51595
+ const enabledDroppableContainers = useMemo13(() => droppableContainers.getEnabled(), [droppableContainers]);
51709
51596
  const measuringConfiguration = useMeasuringConfiguration(measuring);
51710
51597
  const {
51711
51598
  droppableRects,
@@ -51717,7 +51604,7 @@ var DndContext = /* @__PURE__ */ memo2(function DndContext2(_ref) {
51717
51604
  config: measuringConfiguration.droppable
51718
51605
  });
51719
51606
  const activeNode = useCachedNode(draggableNodes, activeId);
51720
- const activationCoordinates = useMemo12(() => activatorEvent ? getEventCoordinates(activatorEvent) : null, [activatorEvent]);
51607
+ const activationCoordinates = useMemo13(() => activatorEvent ? getEventCoordinates(activatorEvent) : null, [activatorEvent]);
51721
51608
  const autoScrollOptions = getAutoScrollerOptions();
51722
51609
  const initialActiveNodeRect = useInitialRect(activeNode, measuringConfiguration.draggable.measure);
51723
51610
  useLayoutShiftScrollCompensation({
@@ -52088,7 +51975,7 @@ var DndContext = /* @__PURE__ */ memo2(function DndContext2(_ref) {
52088
51975
  scrollableAncestors,
52089
51976
  scrollableAncestorRects
52090
51977
  });
52091
- const publicContext = useMemo12(() => {
51978
+ const publicContext = useMemo13(() => {
52092
51979
  const context = {
52093
51980
  active,
52094
51981
  activeNode,
@@ -52110,7 +51997,7 @@ var DndContext = /* @__PURE__ */ memo2(function DndContext2(_ref) {
52110
51997
  };
52111
51998
  return context;
52112
51999
  }, [active, activeNode, activeNodeRect, activatorEvent, collisions, containerNodeRect, dragOverlay, draggableNodes, droppableContainers, droppableRects, over, measureDroppableContainers, scrollableAncestors, scrollableAncestorRects, measuringConfiguration, measuringScheduled, windowRect2]);
52113
- const internalContext = useMemo12(() => {
52000
+ const internalContext = useMemo13(() => {
52114
52001
  const context = {
52115
52002
  activatorEvent,
52116
52003
  activators,
@@ -52205,7 +52092,7 @@ function useDraggable(_ref) {
52205
52092
  // eslint-disable-next-line react-hooks/exhaustive-deps
52206
52093
  [draggableNodes, id2]
52207
52094
  );
52208
- const memoizedAttributes = useMemo12(() => ({
52095
+ const memoizedAttributes = useMemo13(() => ({
52209
52096
  role,
52210
52097
  tabIndex,
52211
52098
  "aria-disabled": disabled,
@@ -52350,7 +52237,7 @@ function useDroppable(_ref) {
52350
52237
  }
52351
52238
 
52352
52239
  // ../../node_modules/@dnd-kit/sortable/dist/sortable.esm.js
52353
- import React19, { useMemo as useMemo13, useRef as useRef29, useEffect as useEffect39, useState as useState31, useContext as useContext6 } from "react";
52240
+ import React19, { useMemo as useMemo14, useRef as useRef29, useEffect as useEffect39, useState as useState31, useContext as useContext6 } from "react";
52354
52241
  function arrayMove(array, from, to) {
52355
52242
  const newArray = array.slice();
52356
52243
  newArray.splice(to < 0 ? newArray.length + to : to, 0, newArray.splice(from, 1)[0]);
@@ -52504,7 +52391,7 @@ function SortableContext(_ref) {
52504
52391
  } = useDndContext();
52505
52392
  const containerId = useUniqueId(ID_PREFIX2, id2);
52506
52393
  const useDragOverlay = Boolean(dragOverlay.rect !== null);
52507
- const items = useMemo13(() => userDefinedItems.map((item) => typeof item === "object" && "id" in item ? item.id : item), [userDefinedItems]);
52394
+ const items = useMemo14(() => userDefinedItems.map((item) => typeof item === "object" && "id" in item ? item.id : item), [userDefinedItems]);
52508
52395
  const isDragging = active != null;
52509
52396
  const activeIndex = active ? items.indexOf(active.id) : -1;
52510
52397
  const overIndex = over ? items.indexOf(over.id) : -1;
@@ -52520,7 +52407,7 @@ function SortableContext(_ref) {
52520
52407
  useEffect39(() => {
52521
52408
  previousItemsRef.current = items;
52522
52409
  }, [items]);
52523
- const contextValue = useMemo13(
52410
+ const contextValue = useMemo14(
52524
52411
  () => ({
52525
52412
  activeIndex,
52526
52413
  containerId,
@@ -52647,7 +52534,7 @@ function useSortable(_ref) {
52647
52534
  } = useContext6(Context2);
52648
52535
  const disabled = normalizeLocalDisabled(localDisabled, globalDisabled);
52649
52536
  const index2 = items.indexOf(id2);
52650
- const data2 = useMemo13(() => ({
52537
+ const data2 = useMemo14(() => ({
52651
52538
  sortable: {
52652
52539
  containerId,
52653
52540
  index: index2,
@@ -52655,7 +52542,7 @@ function useSortable(_ref) {
52655
52542
  },
52656
52543
  ...customData
52657
52544
  }), [containerId, customData, index2, items]);
52658
- const itemsAfterCurrentSortable = useMemo13(() => items.slice(items.indexOf(id2)), [items, id2]);
52545
+ const itemsAfterCurrentSortable = useMemo14(() => items.slice(items.indexOf(id2)), [items, id2]);
52659
52546
  const {
52660
52547
  rect,
52661
52548
  node: node2,
@@ -55841,8 +55728,62 @@ function UserCircleIcon({
55841
55728
  var ForwardRef17 = /* @__PURE__ */ React42.forwardRef(UserCircleIcon);
55842
55729
  var UserCircleIcon_default = ForwardRef17;
55843
55730
 
55731
+ // src/state/shell-state-unit.ts
55732
+ var import_rxjs = __toESM(require_cjs());
55733
+ var COMMON_PANELS = ["knowledge-base", "user", "settings"];
55734
+ var RESOURCE_PANELS = ["history", "info", "annotations", "collaboration", "jsonld"];
55735
+ var MOTIVATION_TO_TAB = {
55736
+ "linking": "reference",
55737
+ "commenting": "comment",
55738
+ "tagging": "tag",
55739
+ "highlighting": "highlight",
55740
+ "assessing": "assessment"
55741
+ };
55742
+ var tabGenerationCounter = 0;
55743
+ function createShellStateUnit(browser2, options) {
55744
+ const subs = [];
55745
+ const activePanel$ = new import_rxjs.BehaviorSubject(options?.initialPanel ?? null);
55746
+ const scrollToAnnotationId$ = new import_rxjs.BehaviorSubject(null);
55747
+ const panelInitialTab$ = new import_rxjs.BehaviorSubject(null);
55748
+ if (options?.onPanelChange) {
55749
+ const cb = options.onPanelChange;
55750
+ subs.push(activePanel$.subscribe(cb));
55751
+ }
55752
+ subs.push(browser2.stream("panel:toggle").subscribe(({ panel }) => {
55753
+ const current = activePanel$.getValue();
55754
+ activePanel$.next(current === panel ? null : panel);
55755
+ }));
55756
+ subs.push(browser2.stream("panel:open").subscribe(({ panel, scrollToAnnotationId, motivation }) => {
55757
+ if (scrollToAnnotationId) {
55758
+ scrollToAnnotationId$.next(scrollToAnnotationId);
55759
+ }
55760
+ if (motivation) {
55761
+ const tab2 = MOTIVATION_TO_TAB[motivation] || "highlight";
55762
+ panelInitialTab$.next({ tab: tab2, generation: ++tabGenerationCounter });
55763
+ }
55764
+ activePanel$.next(panel);
55765
+ }));
55766
+ subs.push(browser2.stream("panel:close").subscribe(() => {
55767
+ activePanel$.next(null);
55768
+ }));
55769
+ return {
55770
+ activePanel$: activePanel$.asObservable(),
55771
+ scrollToAnnotationId$: scrollToAnnotationId$.asObservable(),
55772
+ panelInitialTab$: panelInitialTab$.asObservable(),
55773
+ openPanel: (panel) => browser2.emit("panel:open", { panel }),
55774
+ closePanel: () => browser2.emit("panel:close", void 0),
55775
+ togglePanel: (panel) => browser2.emit("panel:toggle", { panel }),
55776
+ onScrollCompleted: () => scrollToAnnotationId$.next(null),
55777
+ dispose() {
55778
+ subs.forEach((s11) => s11.unsubscribe());
55779
+ activePanel$.complete();
55780
+ scrollToAnnotationId$.complete();
55781
+ panelInitialTab$.complete();
55782
+ }
55783
+ };
55784
+ }
55785
+
55844
55786
  // src/features/admin-devops/components/AdminDevOpsPage.tsx
55845
- import { COMMON_PANELS } from "@semiont/sdk";
55846
55787
  import { jsx as jsx72, jsxs as jsxs62 } from "react/jsx-runtime";
55847
55788
  function AdminDevOpsPage({
55848
55789
  suggestedFeatures,
@@ -55914,9 +55855,6 @@ function AdminDevOpsPage({
55914
55855
  ] });
55915
55856
  }
55916
55857
 
55917
- // src/features/admin-exchange/components/AdminExchangePage.tsx
55918
- import { COMMON_PANELS as COMMON_PANELS2 } from "@semiont/sdk";
55919
-
55920
55858
  // src/features/admin-exchange/components/ExportCard.tsx
55921
55859
  import { jsx as jsx73, jsxs as jsxs63 } from "react/jsx-runtime";
55922
55860
  function ExportCard({ onExport, isExporting, translations: t12 }) {
@@ -56127,7 +56065,7 @@ function AdminExchangePage({
56127
56065
  ToolbarPanels,
56128
56066
  Toolbar: Toolbar2
56129
56067
  }) {
56130
- return /* @__PURE__ */ jsxs66("div", { className: `semiont-page${activePanel && COMMON_PANELS2.includes(activePanel) ? " semiont-page--panel-open" : ""}`, children: [
56068
+ return /* @__PURE__ */ jsxs66("div", { className: `semiont-page${activePanel && COMMON_PANELS.includes(activePanel) ? " semiont-page--panel-open" : ""}`, children: [
56131
56069
  /* @__PURE__ */ jsxs66("div", { className: "semiont-page__content", children: [
56132
56070
  /* @__PURE__ */ jsxs66("div", { className: "semiont-page__header", children: [
56133
56071
  /* @__PURE__ */ jsx76("h1", { className: "semiont-page__title", children: t12.title }),
@@ -56186,7 +56124,6 @@ function AdminExchangePage({
56186
56124
  }
56187
56125
 
56188
56126
  // src/features/admin-security/components/AdminSecurityPage.tsx
56189
- import { COMMON_PANELS as COMMON_PANELS3 } from "@semiont/sdk";
56190
56127
  import { jsx as jsx77, jsxs as jsxs67 } from "react/jsx-runtime";
56191
56128
  function AdminSecurityPage({
56192
56129
  providers,
@@ -56199,7 +56136,7 @@ function AdminSecurityPage({
56199
56136
  ToolbarPanels,
56200
56137
  Toolbar: Toolbar2
56201
56138
  }) {
56202
- return /* @__PURE__ */ jsxs67("div", { className: `semiont-page${activePanel && COMMON_PANELS3.includes(activePanel) ? " semiont-page--panel-open" : ""}`, children: [
56139
+ return /* @__PURE__ */ jsxs67("div", { className: `semiont-page${activePanel && COMMON_PANELS.includes(activePanel) ? " semiont-page--panel-open" : ""}`, children: [
56203
56140
  /* @__PURE__ */ jsx77("div", { className: "semiont-page__content", children: /* @__PURE__ */ jsxs67("div", { className: "semiont-page__sections", children: [
56204
56141
  /* @__PURE__ */ jsxs67("div", { className: "semiont-page__header", children: [
56205
56142
  /* @__PURE__ */ jsx77("h1", { className: "semiont-page__title", children: t12.title }),
@@ -56282,7 +56219,6 @@ function AdminSecurityPage({
56282
56219
  }
56283
56220
 
56284
56221
  // src/features/moderation-linked-data/components/LinkedDataPage.tsx
56285
- import { COMMON_PANELS as COMMON_PANELS4 } from "@semiont/sdk";
56286
56222
  import { jsx as jsx78, jsxs as jsxs68 } from "react/jsx-runtime";
56287
56223
  function LinkedDataPage({
56288
56224
  onExport,
@@ -56303,7 +56239,7 @@ function LinkedDataPage({
56303
56239
  ToolbarPanels,
56304
56240
  Toolbar: Toolbar2
56305
56241
  }) {
56306
- return /* @__PURE__ */ jsxs68("div", { className: `semiont-page${activePanel && COMMON_PANELS4.includes(activePanel) ? " semiont-page--panel-open" : ""}`, children: [
56242
+ return /* @__PURE__ */ jsxs68("div", { className: `semiont-page${activePanel && COMMON_PANELS.includes(activePanel) ? " semiont-page--panel-open" : ""}`, children: [
56307
56243
  /* @__PURE__ */ jsxs68("div", { className: "semiont-page__content", children: [
56308
56244
  /* @__PURE__ */ jsxs68("div", { className: "semiont-page__header", children: [
56309
56245
  /* @__PURE__ */ jsx78("h1", { className: "semiont-page__title", children: t12.title }),
@@ -56363,7 +56299,6 @@ function LinkedDataPage({
56363
56299
 
56364
56300
  // src/features/admin-users/components/AdminUsersPage.tsx
56365
56301
  import { useState as useState43 } from "react";
56366
- import { COMMON_PANELS as COMMON_PANELS5 } from "@semiont/sdk";
56367
56302
  import { Fragment as Fragment15, jsx as jsx79, jsxs as jsxs69 } from "react/jsx-runtime";
56368
56303
  function UserTableRow({
56369
56304
  user,
@@ -56456,7 +56391,7 @@ function AdminUsersPage({
56456
56391
  const matchesStatus = selectedStatus === "all" || userStatus === selectedStatus;
56457
56392
  return matchesSearch && matchesRole && matchesStatus;
56458
56393
  });
56459
- return /* @__PURE__ */ jsxs69("div", { className: `semiont-page${activePanel && COMMON_PANELS5.includes(activePanel) ? " semiont-page--panel-open" : ""}`, children: [
56394
+ return /* @__PURE__ */ jsxs69("div", { className: `semiont-page${activePanel && COMMON_PANELS.includes(activePanel) ? " semiont-page--panel-open" : ""}`, children: [
56460
56395
  /* @__PURE__ */ jsx79("div", { className: "semiont-page__content", children: /* @__PURE__ */ jsxs69("div", { className: "semiont-page__sections", children: [
56461
56396
  /* @__PURE__ */ jsxs69("div", { className: "semiont-page__header-with-action", children: [
56462
56397
  /* @__PURE__ */ jsxs69("div", { children: [
@@ -57075,7 +57010,6 @@ function WelcomePage({
57075
57010
  }
57076
57011
 
57077
57012
  // src/features/moderate-entity-tags/components/EntityTagsPage.tsx
57078
- import { COMMON_PANELS as COMMON_PANELS6 } from "@semiont/sdk";
57079
57013
  import { Fragment as Fragment17, jsx as jsx84, jsxs as jsxs74 } from "react/jsx-runtime";
57080
57014
  function EntityTagsPage({
57081
57015
  entityTypes,
@@ -57096,7 +57030,7 @@ function EntityTagsPage({
57096
57030
  onAddTag();
57097
57031
  }
57098
57032
  };
57099
- return /* @__PURE__ */ jsxs74("div", { className: `semiont-page${activePanel && COMMON_PANELS6.includes(activePanel) ? " semiont-page--panel-open" : ""}`, children: [
57033
+ return /* @__PURE__ */ jsxs74("div", { className: `semiont-page${activePanel && COMMON_PANELS.includes(activePanel) ? " semiont-page--panel-open" : ""}`, children: [
57100
57034
  /* @__PURE__ */ jsxs74("div", { className: "semiont-page__content", children: [
57101
57035
  /* @__PURE__ */ jsxs74("div", { className: "semiont-page__header", children: [
57102
57036
  /* @__PURE__ */ jsx84("h1", { className: "semiont-page__title", children: t12.pageTitle }),
@@ -57171,7 +57105,6 @@ function EntityTagsPage({
57171
57105
  }
57172
57106
 
57173
57107
  // src/features/moderate-recent/components/RecentDocumentsPage.tsx
57174
- import { COMMON_PANELS as COMMON_PANELS7 } from "@semiont/sdk";
57175
57108
  import { jsx as jsx85, jsxs as jsxs75 } from "react/jsx-runtime";
57176
57109
  function RecentDocumentsPage({
57177
57110
  isLoading,
@@ -57185,7 +57118,7 @@ function RecentDocumentsPage({
57185
57118
  if (isLoading) {
57186
57119
  return /* @__PURE__ */ jsx85("div", { className: "semiont-page__loading", children: /* @__PURE__ */ jsx85("p", { className: "semiont-page__loading-text", children: t12.loading }) });
57187
57120
  }
57188
- return /* @__PURE__ */ jsxs75("div", { className: `semiont-page${activePanel && COMMON_PANELS7.includes(activePanel) ? " semiont-page--panel-open" : ""}`, children: [
57121
+ return /* @__PURE__ */ jsxs75("div", { className: `semiont-page${activePanel && COMMON_PANELS.includes(activePanel) ? " semiont-page--panel-open" : ""}`, children: [
57189
57122
  /* @__PURE__ */ jsxs75("div", { className: "semiont-page__content", children: [
57190
57123
  /* @__PURE__ */ jsxs75("div", { className: "semiont-page__header", children: [
57191
57124
  /* @__PURE__ */ jsx85("h1", { className: "semiont-page__title", children: t12.pageTitle }),
@@ -57227,7 +57160,6 @@ function RecentDocumentsPage({
57227
57160
  }
57228
57161
 
57229
57162
  // src/features/moderate-tag-schemas/components/TagSchemasPage.tsx
57230
- import { COMMON_PANELS as COMMON_PANELS8 } from "@semiont/sdk";
57231
57163
  import { jsx as jsx86, jsxs as jsxs76 } from "react/jsx-runtime";
57232
57164
  var domainIcons = {
57233
57165
  legal: ScaleIcon_default,
@@ -57252,7 +57184,7 @@ function TagSchemasPage({
57252
57184
  if (isLoading) {
57253
57185
  return /* @__PURE__ */ jsx86("div", { className: "semiont-page__loading", children: /* @__PURE__ */ jsx86("p", { className: "semiont-page__loading-text", children: t12.loading }) });
57254
57186
  }
57255
- return /* @__PURE__ */ jsxs76("div", { className: `semiont-page${activePanel && COMMON_PANELS8.includes(activePanel) ? " semiont-page--panel-open" : ""}`, children: [
57187
+ return /* @__PURE__ */ jsxs76("div", { className: `semiont-page${activePanel && COMMON_PANELS.includes(activePanel) ? " semiont-page--panel-open" : ""}`, children: [
57256
57188
  /* @__PURE__ */ jsxs76("div", { className: "semiont-page__content", children: [
57257
57189
  /* @__PURE__ */ jsxs76("div", { className: "semiont-page__header", children: [
57258
57190
  /* @__PURE__ */ jsx86("h1", { className: "semiont-page__title", children: t12.pageTitle }),
@@ -57332,8 +57264,78 @@ function TagSchemasPage({
57332
57264
  // src/features/resource-compose/components/ResourceComposePage.tsx
57333
57265
  import { useState as useState45, useEffect as useEffect48 } from "react";
57334
57266
  import { isImageMimeType, isPdfMimeType as isPdfMimeType4, LOCALES as LOCALES3 } from "@semiont/core";
57335
- import { COMMON_PANELS as COMMON_PANELS9 } from "@semiont/sdk";
57336
- import { jsx as jsx87, jsxs as jsxs77 } from "react/jsx-runtime";
57267
+
57268
+ // src/features/resource-compose/components/UploadProgressBar.tsx
57269
+ import { Fragment as Fragment18, jsx as jsx87, jsxs as jsxs77 } from "react/jsx-runtime";
57270
+ function formatBytes(bytes) {
57271
+ if (bytes < 1024) return `${bytes} B`;
57272
+ if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
57273
+ if (bytes < 1024 * 1024 * 1024) return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
57274
+ return `${(bytes / (1024 * 1024 * 1024)).toFixed(2)} GB`;
57275
+ }
57276
+ function UploadProgressBar({ progress, label = "Upload" }) {
57277
+ if (!progress) return null;
57278
+ if (progress.phase === "started") {
57279
+ return /* @__PURE__ */ jsxs77("div", { className: "semiont-progress-wrapper", role: "status", "aria-live": "polite", children: [
57280
+ /* @__PURE__ */ jsx87("div", { className: "semiont-progress__label", children: /* @__PURE__ */ jsxs77("span", { children: [
57281
+ label,
57282
+ ": starting\u2026"
57283
+ ] }) }),
57284
+ /* @__PURE__ */ jsx87("div", { className: "semiont-progress semiont-progress--indeterminate", children: /* @__PURE__ */ jsx87("div", { className: "semiont-progress__fill" }) })
57285
+ ] });
57286
+ }
57287
+ if (progress.phase === "progress") {
57288
+ const indeterminate = progress.totalBytes <= 0;
57289
+ const percentage = indeterminate ? 0 : Math.min(100, Math.round(progress.bytesUploaded / progress.totalBytes * 100));
57290
+ return /* @__PURE__ */ jsxs77("div", { className: "semiont-progress-wrapper", role: "status", "aria-live": "polite", children: [
57291
+ /* @__PURE__ */ jsx87("div", { className: "semiont-progress__label", children: indeterminate ? /* @__PURE__ */ jsxs77("span", { children: [
57292
+ label,
57293
+ ": ",
57294
+ formatBytes(progress.bytesUploaded),
57295
+ "\u2026"
57296
+ ] }) : /* @__PURE__ */ jsxs77(Fragment18, { children: [
57297
+ /* @__PURE__ */ jsxs77("span", { children: [
57298
+ label,
57299
+ ": ",
57300
+ percentage,
57301
+ "%"
57302
+ ] }),
57303
+ /* @__PURE__ */ jsxs77("span", { children: [
57304
+ formatBytes(progress.bytesUploaded),
57305
+ " / ",
57306
+ formatBytes(progress.totalBytes)
57307
+ ] })
57308
+ ] }) }),
57309
+ /* @__PURE__ */ jsx87(
57310
+ "div",
57311
+ {
57312
+ className: `semiont-progress${indeterminate ? " semiont-progress--indeterminate" : ""}`,
57313
+ role: "progressbar",
57314
+ "aria-valuemin": 0,
57315
+ "aria-valuemax": indeterminate ? void 0 : 100,
57316
+ "aria-valuenow": indeterminate ? void 0 : percentage,
57317
+ children: /* @__PURE__ */ jsx87(
57318
+ "div",
57319
+ {
57320
+ className: "semiont-progress__fill",
57321
+ style: indeterminate ? void 0 : { width: `${percentage}%` }
57322
+ }
57323
+ )
57324
+ }
57325
+ )
57326
+ ] });
57327
+ }
57328
+ return /* @__PURE__ */ jsxs77("div", { className: "semiont-progress-wrapper", role: "status", "aria-live": "polite", children: [
57329
+ /* @__PURE__ */ jsx87("div", { className: "semiont-progress__label", children: /* @__PURE__ */ jsxs77("span", { children: [
57330
+ label,
57331
+ ": uploaded"
57332
+ ] }) }),
57333
+ /* @__PURE__ */ jsx87("div", { className: "semiont-progress", role: "progressbar", "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": 100, children: /* @__PURE__ */ jsx87("div", { className: "semiont-progress__fill semiont-progress__fill--success", style: { width: "100%" } }) })
57334
+ ] });
57335
+ }
57336
+
57337
+ // src/features/resource-compose/components/ResourceComposePage.tsx
57338
+ import { jsx as jsx88, jsxs as jsxs78 } from "react/jsx-runtime";
57337
57339
  function ResourceComposePage({
57338
57340
  mode,
57339
57341
  cloneData,
@@ -57347,6 +57349,7 @@ function ResourceComposePage({
57347
57349
  activePanel,
57348
57350
  onSaveResource,
57349
57351
  onCancel,
57352
+ uploadProgress = null,
57350
57353
  translations: t12,
57351
57354
  ToolbarPanels,
57352
57355
  Toolbar: Toolbar2
@@ -57447,22 +57450,22 @@ function ResourceComposePage({
57447
57450
  };
57448
57451
  const isClone = mode === "clone";
57449
57452
  const isReferenceCompletion = mode === "reference";
57450
- return /* @__PURE__ */ jsxs77("div", { className: `semiont-page${activePanel && COMMON_PANELS9.includes(activePanel) ? " semiont-page--panel-open" : ""}`, children: [
57451
- /* @__PURE__ */ jsxs77("div", { className: "semiont-page__content semiont-page__compose", children: [
57452
- /* @__PURE__ */ jsxs77("div", { className: "semiont-page__header", children: [
57453
- /* @__PURE__ */ jsx87("h1", { className: "semiont-page__title", children: isClone ? t12.titleEditClone : isReferenceCompletion ? t12.titleCompleteReference : t12.title }),
57454
- (isClone || isReferenceCompletion) && /* @__PURE__ */ jsx87("p", { className: "semiont-page__subtitle", children: isClone ? t12.subtitleClone : t12.subtitleReference }),
57455
- isReferenceCompletion && /* @__PURE__ */ jsx87("div", { className: "semiont-page__reference-notice", children: /* @__PURE__ */ jsx87("p", { className: "semiont-page__reference-notice-text", children: t12.linkedNoticePrefix }) })
57453
+ return /* @__PURE__ */ jsxs78("div", { className: `semiont-page${activePanel && COMMON_PANELS.includes(activePanel) ? " semiont-page--panel-open" : ""}`, children: [
57454
+ /* @__PURE__ */ jsxs78("div", { className: "semiont-page__content semiont-page__compose", children: [
57455
+ /* @__PURE__ */ jsxs78("div", { className: "semiont-page__header", children: [
57456
+ /* @__PURE__ */ jsx88("h1", { className: "semiont-page__title", children: isClone ? t12.titleEditClone : isReferenceCompletion ? t12.titleCompleteReference : t12.title }),
57457
+ (isClone || isReferenceCompletion) && /* @__PURE__ */ jsx88("p", { className: "semiont-page__subtitle", children: isClone ? t12.subtitleClone : t12.subtitleReference }),
57458
+ isReferenceCompletion && /* @__PURE__ */ jsx88("div", { className: "semiont-page__reference-notice", children: /* @__PURE__ */ jsx88("p", { className: "semiont-page__reference-notice-text", children: t12.linkedNoticePrefix }) })
57456
57459
  ] }),
57457
- gatheredContext && /* @__PURE__ */ jsxs77("div", { className: "semiont-form__field", style: {
57460
+ gatheredContext && /* @__PURE__ */ jsxs78("div", { className: "semiont-form__field", style: {
57458
57461
  marginBottom: "1.5rem",
57459
57462
  padding: "1rem",
57460
57463
  backgroundColor: "var(--semiont-bg-secondary)",
57461
57464
  borderRadius: "var(--semiont-radius-md)",
57462
57465
  border: "1px solid var(--semiont-border-primary)"
57463
57466
  }, children: [
57464
- /* @__PURE__ */ jsx87("h3", { className: "semiont-form__label", style: { marginBottom: "0.75rem" }, children: "Gathered Context" }),
57465
- gatheredContext.sourceContext && /* @__PURE__ */ jsx87("div", { style: {
57467
+ /* @__PURE__ */ jsx88("h3", { className: "semiont-form__label", style: { marginBottom: "0.75rem" }, children: "Gathered Context" }),
57468
+ gatheredContext.sourceContext && /* @__PURE__ */ jsx88("div", { style: {
57466
57469
  padding: "0.75rem",
57467
57470
  backgroundColor: "var(--semiont-bg-primary)",
57468
57471
  borderRadius: "var(--semiont-radius-md)",
@@ -57470,30 +57473,30 @@ function ResourceComposePage({
57470
57473
  maxHeight: "150px",
57471
57474
  overflowY: "auto",
57472
57475
  marginBottom: "0.5rem"
57473
- }, children: /* @__PURE__ */ jsxs77("div", { style: { fontSize: "var(--semiont-text-sm)", fontFamily: "monospace", whiteSpace: "pre-wrap", color: "var(--semiont-text-secondary)" }, children: [
57474
- gatheredContext.sourceContext.before && /* @__PURE__ */ jsx87("span", { children: gatheredContext.sourceContext.before }),
57475
- /* @__PURE__ */ jsx87("span", { style: {
57476
+ }, children: /* @__PURE__ */ jsxs78("div", { style: { fontSize: "var(--semiont-text-sm)", fontFamily: "monospace", whiteSpace: "pre-wrap", color: "var(--semiont-text-secondary)" }, children: [
57477
+ gatheredContext.sourceContext.before && /* @__PURE__ */ jsx88("span", { children: gatheredContext.sourceContext.before }),
57478
+ /* @__PURE__ */ jsx88("span", { style: {
57476
57479
  backgroundColor: "var(--semiont-color-primary-100)",
57477
57480
  padding: "0 0.25rem",
57478
57481
  fontWeight: 600,
57479
57482
  color: "var(--semiont-color-primary-900)"
57480
57483
  }, children: gatheredContext.sourceContext.selected }),
57481
- gatheredContext.sourceContext.after && /* @__PURE__ */ jsx87("span", { children: gatheredContext.sourceContext.after })
57484
+ gatheredContext.sourceContext.after && /* @__PURE__ */ jsx88("span", { children: gatheredContext.sourceContext.after })
57482
57485
  ] }) }),
57483
- gatheredContext.graphContext && gatheredContext.graphContext.connections && gatheredContext.graphContext.connections.length > 0 && /* @__PURE__ */ jsxs77("div", { style: {
57486
+ gatheredContext.graphContext && gatheredContext.graphContext.connections && gatheredContext.graphContext.connections.length > 0 && /* @__PURE__ */ jsxs78("div", { style: {
57484
57487
  padding: "0.5rem 0",
57485
57488
  fontSize: "var(--semiont-text-sm)",
57486
57489
  color: "var(--semiont-text-secondary)"
57487
57490
  }, children: [
57488
- /* @__PURE__ */ jsx87("span", { style: { fontSize: "var(--semiont-text-xs)", fontWeight: 500, marginRight: "0.5rem" }, children: "Connections:" }),
57489
- gatheredContext.graphContext.connections.map((conn) => /* @__PURE__ */ jsx87("span", { className: "semiont-chip", style: { fontSize: "var(--semiont-text-xs)", padding: "0.125rem 0.5rem", marginRight: "0.25rem" }, children: conn.resourceName }, conn.resourceId))
57491
+ /* @__PURE__ */ jsx88("span", { style: { fontSize: "var(--semiont-text-xs)", fontWeight: 500, marginRight: "0.5rem" }, children: "Connections:" }),
57492
+ gatheredContext.graphContext.connections.map((conn) => /* @__PURE__ */ jsx88("span", { className: "semiont-chip", style: { fontSize: "var(--semiont-text-xs)", padding: "0.125rem 0.5rem", marginRight: "0.25rem" }, children: conn.resourceName }, conn.resourceId))
57490
57493
  ] })
57491
57494
  ] }),
57492
- /* @__PURE__ */ jsx87("div", { className: "semiont-form", children: /* @__PURE__ */ jsxs77("form", { onSubmit: handleSaveResource, className: "semiont-form__fields semiont-compose-grid", children: [
57493
- /* @__PURE__ */ jsxs77("div", { className: "semiont-compose-grid__meta", children: [
57494
- /* @__PURE__ */ jsxs77("div", { className: "semiont-form__field", children: [
57495
- /* @__PURE__ */ jsx87("label", { htmlFor: "docName", className: "semiont-form__label", children: t12.resourceName }),
57496
- /* @__PURE__ */ jsx87(
57495
+ /* @__PURE__ */ jsx88("div", { className: "semiont-form", children: /* @__PURE__ */ jsxs78("form", { onSubmit: handleSaveResource, className: "semiont-form__fields semiont-compose-grid", children: [
57496
+ /* @__PURE__ */ jsxs78("div", { className: "semiont-compose-grid__meta", children: [
57497
+ /* @__PURE__ */ jsxs78("div", { className: "semiont-form__field", children: [
57498
+ /* @__PURE__ */ jsx88("label", { htmlFor: "docName", className: "semiont-form__label", children: t12.resourceName }),
57499
+ /* @__PURE__ */ jsx88(
57497
57500
  "input",
57498
57501
  {
57499
57502
  id: "docName",
@@ -57507,11 +57510,11 @@ function ResourceComposePage({
57507
57510
  }
57508
57511
  )
57509
57512
  ] }),
57510
- /* @__PURE__ */ jsxs77("div", { className: "semiont-form__field", children: [
57511
- /* @__PURE__ */ jsx87("label", { htmlFor: "storagePath", className: "semiont-form__label", children: "Save location" }),
57512
- /* @__PURE__ */ jsxs77("div", { className: "semiont-input-addon", children: [
57513
- /* @__PURE__ */ jsx87("span", { className: "semiont-input-addon__prefix", children: "file://" }),
57514
- /* @__PURE__ */ jsx87(
57513
+ /* @__PURE__ */ jsxs78("div", { className: "semiont-form__field", children: [
57514
+ /* @__PURE__ */ jsx88("label", { htmlFor: "storagePath", className: "semiont-form__label", children: "Save location" }),
57515
+ /* @__PURE__ */ jsxs78("div", { className: "semiont-input-addon", children: [
57516
+ /* @__PURE__ */ jsx88("span", { className: "semiont-input-addon__prefix", children: "file://" }),
57517
+ /* @__PURE__ */ jsx88(
57515
57518
  "input",
57516
57519
  {
57517
57520
  id: "storagePath",
@@ -57526,9 +57529,9 @@ function ResourceComposePage({
57526
57529
  )
57527
57530
  ] })
57528
57531
  ] }),
57529
- (!isReferenceCompletion || selectedEntityTypes.length === 0) && /* @__PURE__ */ jsxs77("div", { className: "semiont-form__field semiont-form__entity-types", children: [
57530
- /* @__PURE__ */ jsx87("div", { className: "semiont-form__label", children: t12.entityTypes }),
57531
- /* @__PURE__ */ jsx87(
57532
+ (!isReferenceCompletion || selectedEntityTypes.length === 0) && /* @__PURE__ */ jsxs78("div", { className: "semiont-form__field semiont-form__entity-types", children: [
57533
+ /* @__PURE__ */ jsx88("div", { className: "semiont-form__label", children: t12.entityTypes }),
57534
+ /* @__PURE__ */ jsx88(
57532
57535
  "div",
57533
57536
  {
57534
57537
  className: "semiont-form__entity-type-buttons",
@@ -57536,7 +57539,7 @@ function ResourceComposePage({
57536
57539
  "aria-describedby": "entity-types-description",
57537
57540
  children: availableEntityTypes.map((type) => {
57538
57541
  const isSelected = selectedEntityTypes.includes(type);
57539
- return /* @__PURE__ */ jsx87(
57542
+ return /* @__PURE__ */ jsx88(
57540
57543
  "button",
57541
57544
  {
57542
57545
  type: "button",
@@ -57557,7 +57560,7 @@ function ResourceComposePage({
57557
57560
  })
57558
57561
  }
57559
57562
  ),
57560
- selectedEntityTypes.length > 0 && /* @__PURE__ */ jsxs77(
57563
+ selectedEntityTypes.length > 0 && /* @__PURE__ */ jsxs78(
57561
57564
  "div",
57562
57565
  {
57563
57566
  className: "sr-only",
@@ -57573,9 +57576,9 @@ function ResourceComposePage({
57573
57576
  }
57574
57577
  )
57575
57578
  ] }),
57576
- isReferenceCompletion && selectedEntityTypes.length > 0 && /* @__PURE__ */ jsxs77("div", { className: "semiont-form__field semiont-form__entity-types-display", role: "region", "aria-labelledby": "selected-entity-types-label", children: [
57577
- /* @__PURE__ */ jsx87("h3", { id: "selected-entity-types-label", className: "semiont-form__label", children: t12.entityTypes }),
57578
- /* @__PURE__ */ jsx87("div", { className: "semiont-form__entity-type-tags", role: "list", children: selectedEntityTypes.map((type) => /* @__PURE__ */ jsx87(
57579
+ isReferenceCompletion && selectedEntityTypes.length > 0 && /* @__PURE__ */ jsxs78("div", { className: "semiont-form__field semiont-form__entity-types-display", role: "region", "aria-labelledby": "selected-entity-types-label", children: [
57580
+ /* @__PURE__ */ jsx88("h3", { id: "selected-entity-types-label", className: "semiont-form__label", children: t12.entityTypes }),
57581
+ /* @__PURE__ */ jsx88("div", { className: "semiont-form__entity-type-tags", role: "list", children: selectedEntityTypes.map((type) => /* @__PURE__ */ jsx88(
57579
57582
  "span",
57580
57583
  {
57581
57584
  role: "listitem",
@@ -57585,11 +57588,11 @@ function ResourceComposePage({
57585
57588
  },
57586
57589
  type
57587
57590
  )) }),
57588
- /* @__PURE__ */ jsx87("p", { className: "semiont-form__helper-text", id: "reference-entity-types-description", children: "These entity types were selected when creating the reference" })
57591
+ /* @__PURE__ */ jsx88("p", { className: "semiont-form__helper-text", id: "reference-entity-types-description", children: "These entity types were selected when creating the reference" })
57589
57592
  ] }),
57590
- /* @__PURE__ */ jsxs77("div", { className: "semiont-form__field", children: [
57591
- /* @__PURE__ */ jsx87("label", { htmlFor: "language-select", className: "semiont-form__label", children: t12.language }),
57592
- /* @__PURE__ */ jsx87(
57593
+ /* @__PURE__ */ jsxs78("div", { className: "semiont-form__field", children: [
57594
+ /* @__PURE__ */ jsx88("label", { htmlFor: "language-select", className: "semiont-form__label", children: t12.language }),
57595
+ /* @__PURE__ */ jsx88(
57593
57596
  "select",
57594
57597
  {
57595
57598
  id: "language-select",
@@ -57597,16 +57600,16 @@ function ResourceComposePage({
57597
57600
  onChange: (e6) => setSelectedLanguage(e6.target.value),
57598
57601
  disabled: isCreating,
57599
57602
  className: "semiont-select",
57600
- children: LOCALES3.map((lang) => /* @__PURE__ */ jsx87("option", { value: lang.code, children: lang.nativeName }, lang.code))
57603
+ children: LOCALES3.map((lang) => /* @__PURE__ */ jsx88("option", { value: lang.code, children: lang.nativeName }, lang.code))
57601
57604
  }
57602
57605
  )
57603
57606
  ] })
57604
57607
  ] }),
57605
- /* @__PURE__ */ jsxs77("div", { className: "semiont-compose-grid__content", children: [
57606
- !isClone && !isReferenceCompletion && /* @__PURE__ */ jsxs77("div", { className: "semiont-form__field", children: [
57607
- /* @__PURE__ */ jsx87("label", { className: "semiont-form__label", children: t12.contentSource }),
57608
- /* @__PURE__ */ jsxs77("div", { className: "semiont-form__content-source-toggle", children: [
57609
- /* @__PURE__ */ jsxs77(
57608
+ /* @__PURE__ */ jsxs78("div", { className: "semiont-compose-grid__content", children: [
57609
+ !isClone && !isReferenceCompletion && /* @__PURE__ */ jsxs78("div", { className: "semiont-form__field", children: [
57610
+ /* @__PURE__ */ jsx88("label", { className: "semiont-form__label", children: t12.contentSource }),
57611
+ /* @__PURE__ */ jsxs78("div", { className: "semiont-form__content-source-toggle", children: [
57612
+ /* @__PURE__ */ jsxs78(
57610
57613
  "button",
57611
57614
  {
57612
57615
  type: "button",
@@ -57615,15 +57618,15 @@ function ResourceComposePage({
57615
57618
  className: "semiont-form__content-source-button",
57616
57619
  "data-active": inputMethod === "upload",
57617
57620
  children: [
57618
- /* @__PURE__ */ jsxs77("div", { className: "semiont-form__content-source-icon-wrapper", children: [
57619
- /* @__PURE__ */ jsx87("span", { className: "semiont-form__content-source-icon", children: "\u{1F4CE}" }),
57620
- /* @__PURE__ */ jsx87("span", { className: "semiont-form__content-source-label", children: t12.uploadFile })
57621
+ /* @__PURE__ */ jsxs78("div", { className: "semiont-form__content-source-icon-wrapper", children: [
57622
+ /* @__PURE__ */ jsx88("span", { className: "semiont-form__content-source-icon", children: "\u{1F4CE}" }),
57623
+ /* @__PURE__ */ jsx88("span", { className: "semiont-form__content-source-label", children: t12.uploadFile })
57621
57624
  ] }),
57622
- /* @__PURE__ */ jsx87("div", { className: "semiont-form__content-source-description", children: t12.uploadFileDescription })
57625
+ /* @__PURE__ */ jsx88("div", { className: "semiont-form__content-source-description", children: t12.uploadFileDescription })
57623
57626
  ]
57624
57627
  }
57625
57628
  ),
57626
- /* @__PURE__ */ jsxs77(
57629
+ /* @__PURE__ */ jsxs78(
57627
57630
  "button",
57628
57631
  {
57629
57632
  type: "button",
@@ -57632,20 +57635,20 @@ function ResourceComposePage({
57632
57635
  className: "semiont-form__content-source-button",
57633
57636
  "data-active": inputMethod === "write",
57634
57637
  children: [
57635
- /* @__PURE__ */ jsxs77("div", { className: "semiont-form__content-source-icon-wrapper", children: [
57636
- /* @__PURE__ */ jsx87("span", { className: "semiont-form__content-source-icon", children: "\u270D\uFE0F" }),
57637
- /* @__PURE__ */ jsx87("span", { className: "semiont-form__content-source-label", children: t12.writeContent })
57638
+ /* @__PURE__ */ jsxs78("div", { className: "semiont-form__content-source-icon-wrapper", children: [
57639
+ /* @__PURE__ */ jsx88("span", { className: "semiont-form__content-source-icon", children: "\u270D\uFE0F" }),
57640
+ /* @__PURE__ */ jsx88("span", { className: "semiont-form__content-source-label", children: t12.writeContent })
57638
57641
  ] }),
57639
- /* @__PURE__ */ jsx87("div", { className: "semiont-form__content-source-description", children: t12.writeContentDescription })
57642
+ /* @__PURE__ */ jsx88("div", { className: "semiont-form__content-source-description", children: t12.writeContentDescription })
57640
57643
  ]
57641
57644
  }
57642
57645
  )
57643
57646
  ] })
57644
57647
  ] }),
57645
- !isClone && !isReferenceCompletion && inputMethod === "upload" && /* @__PURE__ */ jsxs77("div", { className: "semiont-form__upload-section", children: [
57646
- /* @__PURE__ */ jsx87("div", { children: /* @__PURE__ */ jsxs77("div", { className: "semiont-form__upload-container", children: [
57647
- /* @__PURE__ */ jsx87("label", { className: "semiont-form__upload-dropzone", children: /* @__PURE__ */ jsxs77("div", { className: "semiont-form__upload-area", children: [
57648
- /* @__PURE__ */ jsx87(
57648
+ !isClone && !isReferenceCompletion && inputMethod === "upload" && /* @__PURE__ */ jsxs78("div", { className: "semiont-form__upload-section", children: [
57649
+ /* @__PURE__ */ jsx88("div", { children: /* @__PURE__ */ jsxs78("div", { className: "semiont-form__upload-container", children: [
57650
+ /* @__PURE__ */ jsx88("label", { className: "semiont-form__upload-dropzone", children: /* @__PURE__ */ jsxs78("div", { className: "semiont-form__upload-area", children: [
57651
+ /* @__PURE__ */ jsx88(
57649
57652
  "input",
57650
57653
  {
57651
57654
  type: "file",
@@ -57655,10 +57658,10 @@ function ResourceComposePage({
57655
57658
  disabled: isCreating
57656
57659
  }
57657
57660
  ),
57658
- /* @__PURE__ */ jsx87("p", { className: "semiont-form__upload-text", children: uploadedFile ? uploadedFile.name : t12.dropFileOrClick }),
57659
- /* @__PURE__ */ jsx87("p", { className: "semiont-form__upload-hint", children: t12.supportedFormats })
57661
+ /* @__PURE__ */ jsx88("p", { className: "semiont-form__upload-text", children: uploadedFile ? uploadedFile.name : t12.dropFileOrClick }),
57662
+ /* @__PURE__ */ jsx88("p", { className: "semiont-form__upload-hint", children: t12.supportedFormats })
57660
57663
  ] }) }),
57661
- uploadedFile && /* @__PURE__ */ jsx87(
57664
+ uploadedFile && /* @__PURE__ */ jsx88(
57662
57665
  "button",
57663
57666
  {
57664
57667
  type: "button",
@@ -57673,17 +57676,17 @@ function ResourceComposePage({
57673
57676
  }
57674
57677
  )
57675
57678
  ] }) }),
57676
- uploadedFile && /* @__PURE__ */ jsxs77("div", { className: "semiont-form__media-type", children: [
57677
- /* @__PURE__ */ jsxs77("span", { className: "semiont-form__media-type-label", children: [
57679
+ uploadedFile && /* @__PURE__ */ jsxs78("div", { className: "semiont-form__media-type", children: [
57680
+ /* @__PURE__ */ jsxs78("span", { className: "semiont-form__media-type-label", children: [
57678
57681
  t12.mediaType,
57679
57682
  ":"
57680
57683
  ] }),
57681
- /* @__PURE__ */ jsx87("code", { className: "semiont-form__media-type-value", children: fileMimeType }),
57682
- /* @__PURE__ */ jsx87("span", { className: "semiont-form__media-type-lock", title: t12.autoDetected, children: "\u{1F512}" })
57684
+ /* @__PURE__ */ jsx88("code", { className: "semiont-form__media-type-value", children: fileMimeType }),
57685
+ /* @__PURE__ */ jsx88("span", { className: "semiont-form__media-type-lock", title: t12.autoDetected, children: "\u{1F512}" })
57683
57686
  ] }),
57684
- uploadedFile && filePreviewUrl && isImageMimeType(fileMimeType) && /* @__PURE__ */ jsxs77("div", { className: "semiont-form__image-preview", children: [
57685
- /* @__PURE__ */ jsx87("p", { className: "semiont-form__image-preview-label", children: "Preview:" }),
57686
- /* @__PURE__ */ jsx87("div", { className: "semiont-form__image-preview-container", children: /* @__PURE__ */ jsx87(
57687
+ uploadedFile && filePreviewUrl && isImageMimeType(fileMimeType) && /* @__PURE__ */ jsxs78("div", { className: "semiont-form__image-preview", children: [
57688
+ /* @__PURE__ */ jsx88("p", { className: "semiont-form__image-preview-label", children: "Preview:" }),
57689
+ /* @__PURE__ */ jsx88("div", { className: "semiont-form__image-preview-container", children: /* @__PURE__ */ jsx88(
57687
57690
  "img",
57688
57691
  {
57689
57692
  src: filePreviewUrl,
@@ -57693,10 +57696,10 @@ function ResourceComposePage({
57693
57696
  ) })
57694
57697
  ] })
57695
57698
  ] }),
57696
- (isClone || isReferenceCompletion || inputMethod === "write") && /* @__PURE__ */ jsxs77("div", { className: "semiont-form__write-section", children: [
57697
- !isClone && !isReferenceCompletion && /* @__PURE__ */ jsxs77("div", { className: "semiont-form__field", children: [
57698
- /* @__PURE__ */ jsx87("label", { htmlFor: "format-select", className: "semiont-form__label", children: t12.format }),
57699
- /* @__PURE__ */ jsxs77(
57699
+ (isClone || isReferenceCompletion || inputMethod === "write") && /* @__PURE__ */ jsxs78("div", { className: "semiont-form__write-section", children: [
57700
+ !isClone && !isReferenceCompletion && /* @__PURE__ */ jsxs78("div", { className: "semiont-form__field", children: [
57701
+ /* @__PURE__ */ jsx88("label", { htmlFor: "format-select", className: "semiont-form__label", children: t12.format }),
57702
+ /* @__PURE__ */ jsxs78(
57700
57703
  "select",
57701
57704
  {
57702
57705
  id: "format-select",
@@ -57705,16 +57708,16 @@ function ResourceComposePage({
57705
57708
  disabled: isCreating,
57706
57709
  className: "semiont-select",
57707
57710
  children: [
57708
- /* @__PURE__ */ jsx87("option", { value: "text/markdown", children: "Markdown (text/markdown)" }),
57709
- /* @__PURE__ */ jsx87("option", { value: "text/plain", children: "Plain Text (text/plain)" }),
57710
- /* @__PURE__ */ jsx87("option", { value: "text/html", children: "HTML (text/html)" })
57711
+ /* @__PURE__ */ jsx88("option", { value: "text/markdown", children: "Markdown (text/markdown)" }),
57712
+ /* @__PURE__ */ jsx88("option", { value: "text/plain", children: "Plain Text (text/plain)" }),
57713
+ /* @__PURE__ */ jsx88("option", { value: "text/html", children: "HTML (text/html)" })
57711
57714
  ]
57712
57715
  }
57713
57716
  )
57714
57717
  ] }),
57715
- /* @__PURE__ */ jsxs77("div", { className: "semiont-form__field semiont-form__editor", children: [
57716
- /* @__PURE__ */ jsx87("label", { className: "semiont-form__label", children: isClone ? t12.resourceContent : t12.content }),
57717
- /* @__PURE__ */ jsx87("div", { className: "semiont-form__editor-wrapper", lang: selectedLanguage, children: /* @__PURE__ */ jsx87(
57718
+ /* @__PURE__ */ jsxs78("div", { className: "semiont-form__field semiont-form__editor", children: [
57719
+ /* @__PURE__ */ jsx88("label", { className: "semiont-form__label", children: isClone ? t12.resourceContent : t12.content }),
57720
+ /* @__PURE__ */ jsx88("div", { className: "semiont-form__editor-wrapper", lang: selectedLanguage, children: /* @__PURE__ */ jsx88(
57718
57721
  CodeMirrorRenderer,
57719
57722
  {
57720
57723
  content: newResourceContent,
@@ -57726,9 +57729,9 @@ function ResourceComposePage({
57726
57729
  }
57727
57730
  ) })
57728
57731
  ] }),
57729
- !isClone && !isReferenceCompletion && /* @__PURE__ */ jsxs77("div", { className: "semiont-form__field", children: [
57730
- /* @__PURE__ */ jsx87("label", { htmlFor: "charset-select", className: "semiont-form__label", children: t12.encoding }),
57731
- /* @__PURE__ */ jsxs77(
57732
+ !isClone && !isReferenceCompletion && /* @__PURE__ */ jsxs78("div", { className: "semiont-form__field", children: [
57733
+ /* @__PURE__ */ jsx88("label", { htmlFor: "charset-select", className: "semiont-form__label", children: t12.encoding }),
57734
+ /* @__PURE__ */ jsxs78(
57732
57735
  "select",
57733
57736
  {
57734
57737
  id: "charset-select",
@@ -57737,18 +57740,18 @@ function ResourceComposePage({
57737
57740
  disabled: isCreating,
57738
57741
  className: "semiont-select",
57739
57742
  children: [
57740
- /* @__PURE__ */ jsx87("option", { value: "", children: "UTF-8 (default)" }),
57741
- /* @__PURE__ */ jsx87("option", { value: "iso-8859-1", children: "ISO-8859-1 (Latin-1)" }),
57742
- /* @__PURE__ */ jsx87("option", { value: "windows-1252", children: "Windows-1252" }),
57743
- /* @__PURE__ */ jsx87("option", { value: "ascii", children: "ASCII" }),
57744
- /* @__PURE__ */ jsx87("option", { value: "utf-16le", children: "UTF-16LE" })
57743
+ /* @__PURE__ */ jsx88("option", { value: "", children: "UTF-8 (default)" }),
57744
+ /* @__PURE__ */ jsx88("option", { value: "iso-8859-1", children: "ISO-8859-1 (Latin-1)" }),
57745
+ /* @__PURE__ */ jsx88("option", { value: "windows-1252", children: "Windows-1252" }),
57746
+ /* @__PURE__ */ jsx88("option", { value: "ascii", children: "ASCII" }),
57747
+ /* @__PURE__ */ jsx88("option", { value: "utf-16le", children: "UTF-16LE" })
57745
57748
  ]
57746
57749
  }
57747
57750
  )
57748
57751
  ] })
57749
57752
  ] }),
57750
- isClone && /* @__PURE__ */ jsxs77("div", { className: "semiont-form__checkbox-field", children: [
57751
- /* @__PURE__ */ jsx87(
57753
+ isClone && /* @__PURE__ */ jsxs78("div", { className: "semiont-form__checkbox-field", children: [
57754
+ /* @__PURE__ */ jsx88(
57752
57755
  "input",
57753
57756
  {
57754
57757
  id: "archiveOriginal",
@@ -57759,34 +57762,35 @@ function ResourceComposePage({
57759
57762
  disabled: isCreating
57760
57763
  }
57761
57764
  ),
57762
- /* @__PURE__ */ jsx87("label", { htmlFor: "archiveOriginal", className: "semiont-form__checkbox-label", children: t12.archiveOriginal })
57765
+ /* @__PURE__ */ jsx88("label", { htmlFor: "archiveOriginal", className: "semiont-form__checkbox-label", children: t12.archiveOriginal })
57763
57766
  ] })
57764
57767
  ] }),
57765
- /* @__PURE__ */ jsxs77("div", { className: "semiont-form__actions", children: [
57766
- /* @__PURE__ */ jsx87(
57768
+ /* @__PURE__ */ jsxs78("div", { className: "semiont-form__actions", children: [
57769
+ /* @__PURE__ */ jsx88(
57767
57770
  "button",
57768
57771
  {
57769
57772
  type: "button",
57770
57773
  onClick: onCancel,
57771
- disabled: isCreating,
57774
+ disabled: isCreating || uploadProgress !== null,
57772
57775
  className: buttonStyles.tertiary.base,
57773
57776
  children: t12.cancel
57774
57777
  }
57775
57778
  ),
57776
- /* @__PURE__ */ jsx87(
57779
+ /* @__PURE__ */ jsx88(
57777
57780
  "button",
57778
57781
  {
57779
57782
  type: "submit",
57780
- disabled: isCreating || !newResourceName.trim(),
57783
+ disabled: isCreating || uploadProgress !== null || !newResourceName.trim(),
57781
57784
  className: buttonStyles.primary.base,
57782
57785
  children: isCreating ? isClone ? t12.saving : isReferenceCompletion ? t12.creatingAndLinking : t12.creating : isClone ? t12.saveClonedResource : isReferenceCompletion ? t12.createAndLinkResource : t12.createResource
57783
57786
  }
57784
57787
  )
57785
- ] })
57788
+ ] }),
57789
+ /* @__PURE__ */ jsx88(UploadProgressBar, { progress: uploadProgress })
57786
57790
  ] }) })
57787
57791
  ] }),
57788
- /* @__PURE__ */ jsxs77("div", { className: "semiont-page__sidebar", children: [
57789
- /* @__PURE__ */ jsx87(
57792
+ /* @__PURE__ */ jsxs78("div", { className: "semiont-page__sidebar", children: [
57793
+ /* @__PURE__ */ jsx88(
57790
57794
  ToolbarPanels,
57791
57795
  {
57792
57796
  activePanel,
@@ -57794,7 +57798,7 @@ function ResourceComposePage({
57794
57798
  showLineNumbers
57795
57799
  }
57796
57800
  ),
57797
- /* @__PURE__ */ jsx87(
57801
+ /* @__PURE__ */ jsx88(
57798
57802
  Toolbar2,
57799
57803
  {
57800
57804
  context: "simple",
@@ -57808,18 +57812,17 @@ function ResourceComposePage({
57808
57812
  // src/features/resource-discovery/components/ResourceDiscoveryPage.tsx
57809
57813
  import { useState as useState46, useCallback as useCallback33, useRef as useRef36 } from "react";
57810
57814
  import { getResourceId as getResourceId3 } from "@semiont/core";
57811
- import { COMMON_PANELS as COMMON_PANELS10 } from "@semiont/sdk";
57812
57815
 
57813
57816
  // src/features/resource-discovery/components/ResourceCard.tsx
57814
57817
  import React48 from "react";
57815
- import { jsx as jsx88, jsxs as jsxs78 } from "react/jsx-runtime";
57818
+ import { jsx as jsx89, jsxs as jsxs79 } from "react/jsx-runtime";
57816
57819
  var ResourceCard = React48.memo(({
57817
57820
  resource,
57818
57821
  onOpen,
57819
57822
  tabIndex = 0,
57820
57823
  archivedLabel,
57821
57824
  createdLabel
57822
- }) => /* @__PURE__ */ jsxs78(
57825
+ }) => /* @__PURE__ */ jsxs79(
57823
57826
  "div",
57824
57827
  {
57825
57828
  onClick: () => onOpen(resource),
@@ -57834,18 +57837,18 @@ var ResourceCard = React48.memo(({
57834
57837
  "aria-label": `Open resource: ${resource.name}`,
57835
57838
  className: "semiont-resource-card",
57836
57839
  children: [
57837
- /* @__PURE__ */ jsxs78("div", { className: "semiont-resource-card__header", children: [
57838
- /* @__PURE__ */ jsx88("h4", { className: "semiont-resource-card__title", children: resource.name }),
57839
- resource.archived && /* @__PURE__ */ jsx88("span", { className: "semiont-resource-card__badge", "data-type": "archived", children: archivedLabel })
57840
+ /* @__PURE__ */ jsxs79("div", { className: "semiont-resource-card__header", children: [
57841
+ /* @__PURE__ */ jsx89("h4", { className: "semiont-resource-card__title", children: resource.name }),
57842
+ resource.archived && /* @__PURE__ */ jsx89("span", { className: "semiont-resource-card__badge", "data-type": "archived", children: archivedLabel })
57840
57843
  ] }),
57841
- /* @__PURE__ */ jsxs78("div", { className: "semiont-resource-card__metadata", children: [
57842
- /* @__PURE__ */ jsxs78("span", { className: "semiont-resource-card__date", children: [
57844
+ /* @__PURE__ */ jsxs79("div", { className: "semiont-resource-card__metadata", children: [
57845
+ /* @__PURE__ */ jsxs79("span", { className: "semiont-resource-card__date", children: [
57843
57846
  createdLabel,
57844
57847
  " ",
57845
57848
  resource.dateCreated ? new Date(resource.dateCreated).toLocaleDateString() : "N/A"
57846
57849
  ] }),
57847
- resource.entityTypes && resource.entityTypes.length > 0 && /* @__PURE__ */ jsxs78("div", { className: "semiont-tags", children: [
57848
- resource.entityTypes.slice(0, 2).map((type) => /* @__PURE__ */ jsx88(
57850
+ resource.entityTypes && resource.entityTypes.length > 0 && /* @__PURE__ */ jsxs79("div", { className: "semiont-tags", children: [
57851
+ resource.entityTypes.slice(0, 2).map((type) => /* @__PURE__ */ jsx89(
57849
57852
  "span",
57850
57853
  {
57851
57854
  className: "semiont-tag semiont-tag--secondary semiont-tag--compact semiont-tag--rounded-sm",
@@ -57853,7 +57856,7 @@ var ResourceCard = React48.memo(({
57853
57856
  },
57854
57857
  type
57855
57858
  )),
57856
- resource.entityTypes.length > 2 && /* @__PURE__ */ jsxs78("span", { className: "semiont-tag semiont-tag--secondary semiont-tag--compact semiont-tag--rounded-sm", children: [
57859
+ resource.entityTypes.length > 2 && /* @__PURE__ */ jsxs79("span", { className: "semiont-tag semiont-tag--secondary semiont-tag--compact semiont-tag--rounded-sm", children: [
57857
57860
  "+",
57858
57861
  resource.entityTypes.length - 2
57859
57862
  ] })
@@ -57865,7 +57868,7 @@ var ResourceCard = React48.memo(({
57865
57868
  ResourceCard.displayName = "ResourceCard";
57866
57869
 
57867
57870
  // src/features/resource-discovery/components/ResourceDiscoveryPage.tsx
57868
- import { jsx as jsx89, jsxs as jsxs79 } from "react/jsx-runtime";
57871
+ import { jsx as jsx90, jsxs as jsxs80 } from "react/jsx-runtime";
57869
57872
  function ResourceDiscoveryPage({
57870
57873
  recentDocuments,
57871
57874
  searchDocuments,
@@ -57910,18 +57913,18 @@ function ResourceDiscoveryPage({
57910
57913
  }
57911
57914
  }, []);
57912
57915
  if (isLoadingRecent) {
57913
- return /* @__PURE__ */ jsx89("div", { className: "semiont-page__loading", children: /* @__PURE__ */ jsx89("p", { className: "semiont-page__loading-text", children: t12.loadingKnowledgeBase }) });
57916
+ return /* @__PURE__ */ jsx90("div", { className: "semiont-page__loading", children: /* @__PURE__ */ jsx90("p", { className: "semiont-page__loading-text", children: t12.loadingKnowledgeBase }) });
57914
57917
  }
57915
57918
  const showNoResultsWarning = hasSearchQuery && searchDocuments.length === 0 && !isSearching;
57916
- return /* @__PURE__ */ jsxs79("div", { className: `semiont-page${activePanel && COMMON_PANELS10.includes(activePanel) ? " semiont-page--panel-open" : ""}`, children: [
57917
- /* @__PURE__ */ jsxs79("div", { className: "semiont-page__content", children: [
57918
- /* @__PURE__ */ jsxs79("div", { className: "semiont-page__header", children: [
57919
- /* @__PURE__ */ jsx89("h1", { className: "semiont-page__title", children: t12.title }),
57920
- /* @__PURE__ */ jsx89("p", { className: "semiont-page__subtitle", children: t12.subtitle })
57919
+ return /* @__PURE__ */ jsxs80("div", { className: `semiont-page${activePanel && COMMON_PANELS.includes(activePanel) ? " semiont-page--panel-open" : ""}`, children: [
57920
+ /* @__PURE__ */ jsxs80("div", { className: "semiont-page__content", children: [
57921
+ /* @__PURE__ */ jsxs80("div", { className: "semiont-page__header", children: [
57922
+ /* @__PURE__ */ jsx90("h1", { className: "semiont-page__title", children: t12.title }),
57923
+ /* @__PURE__ */ jsx90("p", { className: "semiont-page__subtitle", children: t12.subtitle })
57921
57924
  ] }),
57922
- /* @__PURE__ */ jsxs79("div", { className: "semiont-card", children: [
57923
- /* @__PURE__ */ jsx89("div", { className: "semiont-card__search-form", children: /* @__PURE__ */ jsxs79("div", { className: "semiont-card__search-wrapper", children: [
57924
- /* @__PURE__ */ jsx89(
57925
+ /* @__PURE__ */ jsxs80("div", { className: "semiont-card", children: [
57926
+ /* @__PURE__ */ jsx90("div", { className: "semiont-card__search-form", children: /* @__PURE__ */ jsxs80("div", { className: "semiont-card__search-wrapper", children: [
57927
+ /* @__PURE__ */ jsx90(
57925
57928
  "input",
57926
57929
  {
57927
57930
  type: "text",
@@ -57932,11 +57935,11 @@ function ResourceDiscoveryPage({
57932
57935
  "aria-label": t12.searchPlaceholder
57933
57936
  }
57934
57937
  ),
57935
- isSearching && /* @__PURE__ */ jsx89("span", { className: "semiont-card__search-status", "aria-live": "polite", children: t12.searching })
57938
+ isSearching && /* @__PURE__ */ jsx90("span", { className: "semiont-card__search-status", "aria-live": "polite", children: t12.searching })
57936
57939
  ] }) }),
57937
- entityTypes.length > 0 && /* @__PURE__ */ jsxs79("div", { className: "semiont-card__filters", children: [
57938
- /* @__PURE__ */ jsx89("h3", { className: "semiont-card__filters-label", children: t12.filterByEntityType }),
57939
- /* @__PURE__ */ jsxs79(
57940
+ entityTypes.length > 0 && /* @__PURE__ */ jsxs80("div", { className: "semiont-card__filters", children: [
57941
+ /* @__PURE__ */ jsx90("h3", { className: "semiont-card__filters-label", children: t12.filterByEntityType }),
57942
+ /* @__PURE__ */ jsxs80(
57940
57943
  "div",
57941
57944
  {
57942
57945
  ref: entityFilterRoving.containerRef,
@@ -57945,7 +57948,7 @@ function ResourceDiscoveryPage({
57945
57948
  role: "group",
57946
57949
  "aria-label": "Entity type filters",
57947
57950
  children: [
57948
- /* @__PURE__ */ jsx89(
57951
+ /* @__PURE__ */ jsx90(
57949
57952
  "button",
57950
57953
  {
57951
57954
  onClick: () => handleEntityTypeFilter(""),
@@ -57956,7 +57959,7 @@ function ResourceDiscoveryPage({
57956
57959
  children: t12.all
57957
57960
  }
57958
57961
  ),
57959
- entityTypes.map((type) => /* @__PURE__ */ jsx89(
57962
+ entityTypes.map((type) => /* @__PURE__ */ jsx90(
57960
57963
  "button",
57961
57964
  {
57962
57965
  onClick: () => handleEntityTypeFilter(type),
@@ -57972,10 +57975,10 @@ function ResourceDiscoveryPage({
57972
57975
  }
57973
57976
  )
57974
57977
  ] }),
57975
- /* @__PURE__ */ jsxs79("div", { className: "semiont-card__documents", children: [
57976
- /* @__PURE__ */ jsx89("h3", { className: "semiont-card__documents-label", children: hasSearchQuery && searchDocuments.length > 0 ? t12.searchResults(searchDocuments.length) : selectedEntityType ? t12.documentsTaggedWith(selectedEntityType) : t12.recentResources }),
57977
- showNoResultsWarning && /* @__PURE__ */ jsx89("div", { className: "semiont-card__warning", children: /* @__PURE__ */ jsx89("p", { className: "semiont-card__warning-text", children: t12.noResultsFound(searchQuery) }) }),
57978
- filteredResources.length > 0 ? /* @__PURE__ */ jsx89(
57978
+ /* @__PURE__ */ jsxs80("div", { className: "semiont-card__documents", children: [
57979
+ /* @__PURE__ */ jsx90("h3", { className: "semiont-card__documents-label", children: hasSearchQuery && searchDocuments.length > 0 ? t12.searchResults(searchDocuments.length) : selectedEntityType ? t12.documentsTaggedWith(selectedEntityType) : t12.recentResources }),
57980
+ showNoResultsWarning && /* @__PURE__ */ jsx90("div", { className: "semiont-card__warning", children: /* @__PURE__ */ jsx90("p", { className: "semiont-card__warning-text", children: t12.noResultsFound(searchQuery) }) }),
57981
+ filteredResources.length > 0 ? /* @__PURE__ */ jsx90(
57979
57982
  "div",
57980
57983
  {
57981
57984
  ref: documentGridRoving.containerRef,
@@ -57983,7 +57986,7 @@ function ResourceDiscoveryPage({
57983
57986
  className: "semiont-card-grid",
57984
57987
  role: "group",
57985
57988
  "aria-label": "Document grid",
57986
- children: filteredResources.map((resource, index2) => /* @__PURE__ */ jsx89(
57989
+ children: filteredResources.map((resource, index2) => /* @__PURE__ */ jsx90(
57987
57990
  ResourceCard,
57988
57991
  {
57989
57992
  resource,
@@ -57995,9 +57998,9 @@ function ResourceDiscoveryPage({
57995
57998
  getResourceId3(resource)
57996
57999
  ))
57997
58000
  }
57998
- ) : /* @__PURE__ */ jsxs79("div", { className: "semiont-card__empty", children: [
57999
- /* @__PURE__ */ jsx89("p", { className: "semiont-card__empty-text", children: t12.noResourcesAvailable }),
58000
- !hasSearchQuery && /* @__PURE__ */ jsx89(
58001
+ ) : /* @__PURE__ */ jsxs80("div", { className: "semiont-card__empty", children: [
58002
+ /* @__PURE__ */ jsx90("p", { className: "semiont-card__empty-text", children: t12.noResourcesAvailable }),
58003
+ !hasSearchQuery && /* @__PURE__ */ jsx90(
58001
58004
  "button",
58002
58005
  {
58003
58006
  onClick: onNavigateToCompose,
@@ -58009,8 +58012,8 @@ function ResourceDiscoveryPage({
58009
58012
  ] })
58010
58013
  ] })
58011
58014
  ] }),
58012
- /* @__PURE__ */ jsxs79("div", { className: "semiont-page__sidebar", children: [
58013
- /* @__PURE__ */ jsx89(
58015
+ /* @__PURE__ */ jsxs80("div", { className: "semiont-page__sidebar", children: [
58016
+ /* @__PURE__ */ jsx90(
58014
58017
  ToolbarPanels,
58015
58018
  {
58016
58019
  activePanel,
@@ -58018,7 +58021,7 @@ function ResourceDiscoveryPage({
58018
58021
  showLineNumbers
58019
58022
  }
58020
58023
  ),
58021
- /* @__PURE__ */ jsx89(
58024
+ /* @__PURE__ */ jsx90(
58022
58025
  Toolbar,
58023
58026
  {
58024
58027
  context: "simple",
@@ -58070,11 +58073,125 @@ function useMediaToken(id2) {
58070
58073
  return { token, loading };
58071
58074
  }
58072
58075
 
58073
- // src/features/resource-viewer/components/ResourceViewerPage.tsx
58074
- import { createResourceViewerPageVM } from "@semiont/sdk";
58076
+ // src/features/resource-viewer/state/resource-viewer-page-state-unit.ts
58077
+ var import_rxjs2 = __toESM(require_cjs());
58078
+ import { createDisposer } from "@semiont/sdk";
58079
+ import { createBeckonStateUnit } from "@semiont/sdk";
58080
+ import { createMarkStateUnit } from "@semiont/sdk";
58081
+ import { createGatherStateUnit } from "@semiont/sdk";
58082
+ import { createMatchStateUnit } from "@semiont/sdk";
58083
+ import { createYieldStateUnit } from "@semiont/sdk";
58084
+ import { decodeWithCharset as decodeWithCharset2 } from "@semiont/core";
58085
+ import { isHighlight as isHighlight5, isComment as isComment5, isAssessment as isAssessment4, isReference as isReference6, isTag as isTag6 } from "@semiont/core";
58086
+ var WIZARD_CLOSED = {
58087
+ open: false,
58088
+ annotationId: null,
58089
+ resourceId: null,
58090
+ defaultTitle: "",
58091
+ entityTypes: []
58092
+ };
58093
+ function createResourceViewerPageStateUnit(client, resourceId2, locale, browse, options) {
58094
+ const disposer = createDisposer();
58095
+ const beckon = createBeckonStateUnit(client);
58096
+ const mark2 = createMarkStateUnit(client, resourceId2);
58097
+ const gather = createGatherStateUnit(client, resourceId2);
58098
+ const matchStateUnit = createMatchStateUnit(client, resourceId2);
58099
+ const yieldStateUnit = createYieldStateUnit(client, resourceId2, locale);
58100
+ disposer.add(beckon);
58101
+ disposer.add(browse);
58102
+ disposer.add(mark2);
58103
+ disposer.add(gather);
58104
+ disposer.add(matchStateUnit);
58105
+ disposer.add(yieldStateUnit);
58106
+ const annotations$ = client.browse.annotations(resourceId2).pipe(
58107
+ (0, import_rxjs2.map)((a15) => a15 ?? [])
58108
+ );
58109
+ const annotationGroups$ = annotations$.pipe(
58110
+ (0, import_rxjs2.map)((anns) => {
58111
+ const groups = { highlights: [], comments: [], assessments: [], references: [], tags: [] };
58112
+ for (const ann of anns) {
58113
+ if (isHighlight5(ann)) groups.highlights.push(ann);
58114
+ else if (isComment5(ann)) groups.comments.push(ann);
58115
+ else if (isAssessment4(ann)) groups.assessments.push(ann);
58116
+ else if (isReference6(ann)) groups.references.push(ann);
58117
+ else if (isTag6(ann)) groups.tags.push(ann);
58118
+ }
58119
+ return groups;
58120
+ })
58121
+ );
58122
+ const entityTypes$ = client.browse.entityTypes().pipe(
58123
+ (0, import_rxjs2.map)((e6) => e6 ?? [])
58124
+ );
58125
+ const events$ = client.browse.events(resourceId2).pipe(
58126
+ (0, import_rxjs2.map)((e6) => e6 ?? [])
58127
+ );
58128
+ const referencedBy$ = client.browse.referencedBy(resourceId2).pipe(
58129
+ (0, import_rxjs2.map)((r14) => r14 ?? [])
58130
+ );
58131
+ const content$ = new import_rxjs2.BehaviorSubject("");
58132
+ const contentLoading$ = new import_rxjs2.BehaviorSubject(false);
58133
+ const mediaToken$ = new import_rxjs2.BehaviorSubject(null);
58134
+ const mediaType = options?.mediaType || "text/plain";
58135
+ const isBinaryType = mediaType.startsWith("image/") || mediaType === "application/pdf";
58136
+ if (!isBinaryType && mediaType) {
58137
+ contentLoading$.next(true);
58138
+ client.browse.resourceRepresentation(resourceId2, { accept: mediaType }).then(({ data: data2 }) => {
58139
+ content$.next(decodeWithCharset2(data2, mediaType));
58140
+ contentLoading$.next(false);
58141
+ }).catch(() => {
58142
+ contentLoading$.next(false);
58143
+ });
58144
+ }
58145
+ if (isBinaryType) {
58146
+ client.auth.mediaToken(resourceId2).then(({ token }) => mediaToken$.next(token)).catch(() => {
58147
+ });
58148
+ }
58149
+ const wizard$ = new import_rxjs2.BehaviorSubject(WIZARD_CLOSED);
58150
+ const unsubscribeResource = client.subscribeToResource(resourceId2);
58151
+ disposer.add(unsubscribeResource);
58152
+ const bindInitiateSub = client.bus.get("bind:initiate").subscribe((event) => {
58153
+ wizard$.next({
58154
+ open: true,
58155
+ annotationId: event.annotationId,
58156
+ resourceId: event.resourceId,
58157
+ defaultTitle: event.defaultTitle,
58158
+ entityTypes: event.entityTypes
58159
+ });
58160
+ client.bus.get("gather:requested").next({
58161
+ correlationId: crypto.randomUUID(),
58162
+ annotationId: event.annotationId,
58163
+ resourceId: event.resourceId,
58164
+ options: { contextWindow: 2e3 }
58165
+ });
58166
+ });
58167
+ disposer.add(() => bindInitiateSub.unsubscribe());
58168
+ return {
58169
+ beckon,
58170
+ browse,
58171
+ mark: mark2,
58172
+ gather,
58173
+ yield: yieldStateUnit,
58174
+ annotations$,
58175
+ annotationGroups$,
58176
+ entityTypes$,
58177
+ events$,
58178
+ referencedBy$,
58179
+ content$: content$.asObservable(),
58180
+ contentLoading$: contentLoading$.asObservable(),
58181
+ mediaToken$: mediaToken$.asObservable(),
58182
+ wizard$: wizard$.asObservable(),
58183
+ closeWizard: () => wizard$.next(WIZARD_CLOSED),
58184
+ dispose: () => {
58185
+ wizard$.complete();
58186
+ content$.complete();
58187
+ contentLoading$.complete();
58188
+ mediaToken$.complete();
58189
+ disposer.dispose();
58190
+ }
58191
+ };
58192
+ }
58075
58193
 
58076
- // src/hooks/useShellVM.ts
58077
- import { createShellVM } from "@semiont/sdk";
58194
+ // src/hooks/useShellStateUnit.ts
58078
58195
  function readPanel() {
58079
58196
  if (typeof window === "undefined") return null;
58080
58197
  const saved = localStorage.getItem("activeToolbarPanel");
@@ -58085,16 +58202,16 @@ function persistPanel(panel) {
58085
58202
  if (panel) localStorage.setItem("activeToolbarPanel", panel);
58086
58203
  else localStorage.removeItem("activeToolbarPanel");
58087
58204
  }
58088
- function useShellVM() {
58205
+ function useShellStateUnit() {
58089
58206
  const semiont = useSemiont();
58090
- return useViewModel(() => createShellVM(semiont, {
58207
+ return useStateUnit(() => createShellStateUnit(semiont, {
58091
58208
  initialPanel: readPanel(),
58092
58209
  onPanelChange: persistPanel
58093
58210
  }));
58094
58211
  }
58095
58212
 
58096
58213
  // src/features/resource-viewer/components/ResourceViewerPage.tsx
58097
- import { jsx as jsx90, jsxs as jsxs80 } from "react/jsx-runtime";
58214
+ import { jsx as jsx91, jsxs as jsxs81 } from "react/jsx-runtime";
58098
58215
  function ResourceViewerPage({
58099
58216
  resource,
58100
58217
  rUri,
@@ -58122,47 +58239,51 @@ function ResourceViewerPage({
58122
58239
  const binaryContent = isBinary && mediaToken && semiont ? `${semiont.baseUrl}/api/resources/${rUri}?token=${mediaToken}` : "";
58123
58240
  const content4 = isBinary ? binaryContent : textContent;
58124
58241
  const contentLoading = isBinary ? mediaTokenLoading : textLoading;
58125
- const browseVM = useShellVM();
58126
- const vm = useViewModel(() => createResourceViewerPageVM(semiont, rUri, locale, browseVM));
58127
- const annotations = useObservable(vm.annotations$) ?? [];
58128
- const groups = useObservable(vm.annotationGroups$);
58129
- const allEntityTypes = useObservable(vm.entityTypes$) ?? [];
58130
- const referencedByRaw = useObservable(vm.referencedBy$);
58242
+ const browseStateUnit = useShellStateUnit();
58243
+ const stateUnit = useStateUnit(() => createResourceViewerPageStateUnit(semiont, rUri, locale, browseStateUnit));
58244
+ const annotations = useObservable(stateUnit.annotations$) ?? [];
58245
+ const groups = useObservable(stateUnit.annotationGroups$);
58246
+ const allEntityTypes = useObservable(stateUnit.entityTypes$) ?? [];
58247
+ const referencedByRaw = useObservable(stateUnit.referencedBy$);
58131
58248
  const referencedBy = referencedByRaw ?? [];
58132
58249
  const referencedByLoading = referencedByRaw === void 0;
58133
- const hoveredAnnotationId = useObservable(vm.beckon.hoveredAnnotationId$) ?? null;
58134
- const pendingAnnotation = useObservable(vm.mark.pendingAnnotation$) ?? null;
58135
- const assistingMotivation = useObservable(vm.mark.assistingMotivation$) ?? null;
58136
- const progress = useObservable(vm.mark.progress$) ?? null;
58137
- const activePanel = useObservable(vm.browse.activePanel$) ?? null;
58138
- const scrollToAnnotationId = useObservable(vm.browse.scrollToAnnotationId$) ?? null;
58139
- const panelInitialTab = useObservable(vm.browse.panelInitialTab$) ?? null;
58140
- const onScrollCompleted = vm.browse.onScrollCompleted;
58141
- const generationProgress = useObservable(vm.yield.progress$) ?? null;
58142
- const gatherContext = useObservable(vm.gather.context$) ?? null;
58143
- const gatherLoading = useObservable(vm.gather.loading$) ?? false;
58144
- const gatherError = useObservable(vm.gather.error$) ?? null;
58145
- const wizardState = useObservable(vm.wizard$);
58250
+ const hoveredAnnotationId = useObservable(stateUnit.beckon.hoveredAnnotationId$) ?? null;
58251
+ const pendingAnnotation = useObservable(stateUnit.mark.pendingAnnotation$) ?? null;
58252
+ const assistingMotivation = useObservable(stateUnit.mark.assistingMotivation$) ?? null;
58253
+ const progress = useObservable(stateUnit.mark.progress$) ?? null;
58254
+ const activePanel = useObservable(stateUnit.browse.activePanel$) ?? null;
58255
+ const scrollToAnnotationId = useObservable(stateUnit.browse.scrollToAnnotationId$) ?? null;
58256
+ const panelInitialTab = useObservable(stateUnit.browse.panelInitialTab$) ?? null;
58257
+ const onScrollCompleted = stateUnit.browse.onScrollCompleted;
58258
+ const generationProgress = useObservable(stateUnit.yield.progress$) ?? null;
58259
+ const gatherContext = useObservable(stateUnit.gather.context$) ?? null;
58260
+ const gatherLoading = useObservable(stateUnit.gather.loading$) ?? false;
58261
+ const gatherError = useObservable(stateUnit.gather.error$) ?? null;
58262
+ const wizardState = useObservable(stateUnit.wizard$);
58146
58263
  const wizardOpen = wizardState?.open ?? false;
58147
58264
  const wizardAnnotationId = wizardState?.annotationId ?? null;
58148
58265
  const wizardResourceId = wizardState?.resourceId ?? null;
58149
58266
  const wizardDefaultTitle = wizardState?.defaultTitle ?? "";
58150
58267
  const wizardEntityTypes = wizardState?.entityTypes ?? [];
58151
58268
  const handleWizardClose = useCallback34(() => {
58152
- vm.closeWizard();
58153
- }, [vm]);
58269
+ stateUnit.closeWizard();
58270
+ }, [stateUnit]);
58154
58271
  const handleWizardGenerateSubmit = useCallback34((referenceId, config) => {
58155
58272
  clearNewAnnotationId(annotationId(referenceId));
58156
- vm.yield.generate(referenceId, {
58273
+ stateUnit.yield.generate(referenceId, {
58157
58274
  title: config.title,
58158
58275
  storageUri: config.storagePath,
58159
58276
  prompt: config.prompt,
58160
58277
  language: config.language,
58278
+ // The source resource is the one the user is viewing — fed into the
58279
+ // prompt so the LLM understands the embedded context (selected
58280
+ // passage, surrounding text) regardless of UI/target language.
58281
+ sourceLanguage: getLanguage(resource),
58161
58282
  temperature: config.temperature,
58162
58283
  maxTokens: config.maxTokens,
58163
58284
  context: config.context
58164
58285
  });
58165
- }, [vm, clearNewAnnotationId]);
58286
+ }, [stateUnit, clearNewAnnotationId, resource]);
58166
58287
  const handleWizardLinkResource = useCallback34(async (referenceId, targetResourceId) => {
58167
58288
  if (!semiont) return;
58168
58289
  try {
@@ -58327,17 +58448,17 @@ function ResourceViewerPage({
58327
58448
  }, [session]);
58328
58449
  const handleEventClick = useCallback34((_annotationId) => {
58329
58450
  }, []);
58330
- return /* @__PURE__ */ jsxs80("div", { className: `semiont-document-viewer${activePanel ? " semiont-document-viewer--panel-open" : ""}`, children: [
58331
- /* @__PURE__ */ jsxs80("div", { className: "semiont-document-viewer__main", children: [
58332
- /* @__PURE__ */ jsxs80("div", { className: "semiont-document-viewer__content", children: [
58333
- /* @__PURE__ */ jsx90("div", { className: "semiont-document-viewer__header", children: /* @__PURE__ */ jsx90("div", { className: "semiont-document-viewer__header-inner", children: /* @__PURE__ */ jsx90("h2", { className: "semiont-document-viewer__title", children: resource.name }) }) }),
58334
- /* @__PURE__ */ jsx90("div", { className: "semiont-document-viewer__scrollable-body", lang: getLanguage(resource) || void 0, children: /* @__PURE__ */ jsx90(
58451
+ return /* @__PURE__ */ jsxs81("div", { className: `semiont-document-viewer${activePanel ? " semiont-document-viewer--panel-open" : ""}`, children: [
58452
+ /* @__PURE__ */ jsxs81("div", { className: "semiont-document-viewer__main", children: [
58453
+ /* @__PURE__ */ jsxs81("div", { className: "semiont-document-viewer__content", children: [
58454
+ /* @__PURE__ */ jsx91("div", { className: "semiont-document-viewer__header", children: /* @__PURE__ */ jsx91("div", { className: "semiont-document-viewer__header-inner", children: /* @__PURE__ */ jsx91("h2", { className: "semiont-document-viewer__title", children: resource.name }) }) }),
58455
+ /* @__PURE__ */ jsx91("div", { className: "semiont-document-viewer__scrollable-body", lang: getLanguage(resource) || void 0, children: /* @__PURE__ */ jsx91(
58335
58456
  ErrorBoundary,
58336
58457
  {
58337
- fallback: (error, reset) => /* @__PURE__ */ jsxs80("div", { className: "semiont-document-viewer__error", children: [
58338
- /* @__PURE__ */ jsx90("h3", { className: "semiont-document-viewer__error-title", children: "Error loading document viewer" }),
58339
- /* @__PURE__ */ jsx90("p", { className: "semiont-document-viewer__error-message", children: error.message }),
58340
- /* @__PURE__ */ jsx90(
58458
+ fallback: (error, reset) => /* @__PURE__ */ jsxs81("div", { className: "semiont-document-viewer__error", children: [
58459
+ /* @__PURE__ */ jsx91("h3", { className: "semiont-document-viewer__error-title", children: "Error loading document viewer" }),
58460
+ /* @__PURE__ */ jsx91("p", { className: "semiont-document-viewer__error-message", children: error.message }),
58461
+ /* @__PURE__ */ jsx91(
58341
58462
  "button",
58342
58463
  {
58343
58464
  onClick: reset,
@@ -58346,7 +58467,7 @@ function ResourceViewerPage({
58346
58467
  }
58347
58468
  )
58348
58469
  ] }),
58349
- children: contentLoading ? /* @__PURE__ */ jsx90("div", { className: "semiont-document-viewer__loading", children: "Loading document content..." }) : /* @__PURE__ */ jsx90(
58470
+ children: contentLoading ? /* @__PURE__ */ jsx91("div", { className: "semiont-document-viewer__loading", children: "Loading document content..." }) : /* @__PURE__ */ jsx91(
58350
58471
  ResourceViewer,
58351
58472
  {
58352
58473
  resource: resourceWithContent,
@@ -58360,18 +58481,17 @@ function ResourceViewerPage({
58360
58481
  }
58361
58482
  ) })
58362
58483
  ] }),
58363
- /* @__PURE__ */ jsxs80("div", { className: "semiont-document-viewer__sidebar", children: [
58364
- /* @__PURE__ */ jsxs80(
58484
+ /* @__PURE__ */ jsxs81("div", { className: "semiont-document-viewer__sidebar", children: [
58485
+ /* @__PURE__ */ jsxs81(
58365
58486
  ToolbarPanels,
58366
58487
  {
58367
58488
  activePanel,
58368
58489
  theme: theme2,
58369
58490
  showLineNumbers,
58370
- hoverDelayMs,
58371
58491
  width: activePanel === "jsonld" ? "w-[600px]" : activePanel === "annotations" ? "w-[400px]" : "w-64",
58372
58492
  children: [
58373
- annotateMode && resource.archived && /* @__PURE__ */ jsx90("div", { className: "semiont-document-viewer__archived-status", children: /* @__PURE__ */ jsx90("div", { className: "semiont-document-viewer__archived-text", children: "\u{1F4E6} Archived" }) }),
58374
- activePanel === "annotations" && !resource.archived && /* @__PURE__ */ jsx90(
58493
+ annotateMode && resource.archived && /* @__PURE__ */ jsx91("div", { className: "semiont-document-viewer__archived-status", children: /* @__PURE__ */ jsx91("div", { className: "semiont-document-viewer__archived-text", children: "\u{1F4E6} Archived" }) }),
58494
+ activePanel === "annotations" && !resource.archived && /* @__PURE__ */ jsx91(
58375
58495
  UnifiedAnnotationsPanel,
58376
58496
  {
58377
58497
  annotations,
@@ -58386,6 +58506,7 @@ function ResourceViewerPage({
58386
58506
  referencedByLoading,
58387
58507
  resourceId: rUri,
58388
58508
  locale,
58509
+ sourceLanguage: getLanguage(resource),
58389
58510
  scrollToAnnotationId,
58390
58511
  hoveredAnnotationId,
58391
58512
  onScrollCompleted,
@@ -58395,7 +58516,7 @@ function ResourceViewerPage({
58395
58516
  routes
58396
58517
  }
58397
58518
  ),
58398
- activePanel === "history" && /* @__PURE__ */ jsx90(
58519
+ activePanel === "history" && /* @__PURE__ */ jsx91(
58399
58520
  AnnotationHistory,
58400
58521
  {
58401
58522
  rUri,
@@ -58406,7 +58527,7 @@ function ResourceViewerPage({
58406
58527
  routes
58407
58528
  }
58408
58529
  ),
58409
- activePanel === "info" && /* @__PURE__ */ jsx90(
58530
+ activePanel === "info" && /* @__PURE__ */ jsx91(
58410
58531
  ResourceInfoPanel,
58411
58532
  {
58412
58533
  resourceId: rUri,
@@ -58424,7 +58545,7 @@ function ResourceViewerPage({
58424
58545
  generator: resource.generator
58425
58546
  }
58426
58547
  ),
58427
- activePanel === "collaboration" && /* @__PURE__ */ jsx90(
58548
+ activePanel === "collaboration" && /* @__PURE__ */ jsx91(
58428
58549
  CollaborationPanel,
58429
58550
  {
58430
58551
  state: streamStatus,
@@ -58432,11 +58553,11 @@ function ResourceViewerPage({
58432
58553
  knowledgeBaseName
58433
58554
  }
58434
58555
  ),
58435
- activePanel === "jsonld" && /* @__PURE__ */ jsx90(JsonLdPanel, { resource })
58556
+ activePanel === "jsonld" && /* @__PURE__ */ jsx91(JsonLdPanel, { resource })
58436
58557
  ]
58437
58558
  }
58438
58559
  ),
58439
- /* @__PURE__ */ jsx90(
58560
+ /* @__PURE__ */ jsx91(
58440
58561
  Toolbar,
58441
58562
  {
58442
58563
  context: "document",
@@ -58446,7 +58567,7 @@ function ResourceViewerPage({
58446
58567
  )
58447
58568
  ] })
58448
58569
  ] }),
58449
- /* @__PURE__ */ jsx90(
58570
+ /* @__PURE__ */ jsx91(
58450
58571
  ReferenceWizardModal,
58451
58572
  {
58452
58573
  isOpen: wizardOpen,
@@ -58505,24 +58626,452 @@ function ResourceViewerPage({
58505
58626
  }
58506
58627
 
58507
58628
  // src/index.ts
58508
- import { createBeckonVM, createHoverHandlers as createHoverHandlers4, HOVER_DELAY_MS as HOVER_DELAY_MS3 } from "@semiont/sdk";
58509
- import { createMarkVM } from "@semiont/sdk";
58510
- import { createShellVM as createShellVM2, COMMON_PANELS as COMMON_PANELS11, RESOURCE_PANELS } from "@semiont/sdk";
58511
- import { createYieldVM } from "@semiont/sdk";
58512
- import { createGatherVM } from "@semiont/sdk";
58513
- import { createMatchVM } from "@semiont/sdk";
58514
- import { createDiscoverVM } from "@semiont/sdk";
58515
- import { createResourceViewerPageVM as createResourceViewerPageVM2 } from "@semiont/sdk";
58516
- import { createComposePageVM } from "@semiont/sdk";
58517
- import { createEntityTagsVM } from "@semiont/sdk";
58518
- import { createExchangeVM } from "@semiont/sdk";
58519
- import { createAdminUsersVM } from "@semiont/sdk";
58520
- import { createAdminSecurityVM } from "@semiont/sdk";
58521
- import { createWelcomeVM } from "@semiont/sdk";
58522
- import { createResourceLoaderVM } from "@semiont/sdk";
58523
- import { createSessionVM } from "@semiont/sdk";
58524
- import { createJobClaimAdapter } from "@semiont/sdk";
58525
- import { createJobQueueVM } from "@semiont/sdk";
58629
+ import { createBeckonStateUnit as createBeckonStateUnit2, createHoverHandlers as createHoverHandlers4, HOVER_DELAY_MS as HOVER_DELAY_MS3 } from "@semiont/sdk";
58630
+ import { createMarkStateUnit as createMarkStateUnit2 } from "@semiont/sdk";
58631
+ import { createYieldStateUnit as createYieldStateUnit2 } from "@semiont/sdk";
58632
+ import { createGatherStateUnit as createGatherStateUnit2 } from "@semiont/sdk";
58633
+ import { createMatchStateUnit as createMatchStateUnit2 } from "@semiont/sdk";
58634
+
58635
+ // src/state/session-state-unit.ts
58636
+ var import_rxjs3 = __toESM(require_cjs());
58637
+ function createSessionStateUnit(client) {
58638
+ const isLoggingOut$ = new import_rxjs3.BehaviorSubject(false);
58639
+ const logout = async () => {
58640
+ isLoggingOut$.next(true);
58641
+ try {
58642
+ await client.auth.logout();
58643
+ } catch {
58644
+ } finally {
58645
+ isLoggingOut$.next(false);
58646
+ }
58647
+ };
58648
+ return {
58649
+ isLoggingOut$: isLoggingOut$.asObservable(),
58650
+ logout,
58651
+ dispose: () => {
58652
+ isLoggingOut$.complete();
58653
+ }
58654
+ };
58655
+ }
58656
+
58657
+ // src/features/resource-compose/state/compose-page-state-unit.ts
58658
+ var import_rxjs4 = __toESM(require_cjs());
58659
+ import { resourceId as makeResourceId2, annotationId as makeAnnotationId } from "@semiont/core";
58660
+ import { createDisposer as createDisposer2 } from "@semiont/sdk";
58661
+ import { getPrimaryMediaType as getPrimaryMediaType3, decodeWithCharset as decodeWithCharset3 } from "@semiont/core";
58662
+ function createComposePageStateUnit(client, browse, params, auth) {
58663
+ const disposer = createDisposer2();
58664
+ disposer.add(browse);
58665
+ const isReferenceMode = Boolean(params.annotationUri && params.sourceDocumentId && params.name);
58666
+ const isCloneMode = params.mode === "clone" && Boolean(params.token);
58667
+ const pageMode = isCloneMode ? "clone" : isReferenceMode ? "reference" : "new";
58668
+ const mode$ = new import_rxjs4.BehaviorSubject(pageMode);
58669
+ const loading$ = new import_rxjs4.BehaviorSubject(true);
58670
+ const cloneData$ = new import_rxjs4.BehaviorSubject(null);
58671
+ const referenceData$ = new import_rxjs4.BehaviorSubject(null);
58672
+ const gatheredContext$ = new import_rxjs4.BehaviorSubject(null);
58673
+ const uploadProgress$ = new import_rxjs4.BehaviorSubject(null);
58674
+ const entityTypes$ = client.browse.entityTypes().pipe(
58675
+ (0, import_rxjs4.map)((e6) => e6 ?? [])
58676
+ );
58677
+ if (isReferenceMode) {
58678
+ const entityTypes = params.entityTypes ? params.entityTypes.split(",") : [];
58679
+ referenceData$.next({
58680
+ annotationUri: params.annotationUri,
58681
+ sourceDocumentId: params.sourceDocumentId,
58682
+ name: params.name,
58683
+ entityTypes
58684
+ });
58685
+ if (params.storedContext) {
58686
+ try {
58687
+ gatheredContext$.next(JSON.parse(params.storedContext));
58688
+ } catch {
58689
+ }
58690
+ }
58691
+ loading$.next(false);
58692
+ } else if (isCloneMode) {
58693
+ void (async () => {
58694
+ try {
58695
+ const tokenResult = await client.yield.fromToken(params.token);
58696
+ if (tokenResult && auth) {
58697
+ const rId = makeResourceId2(tokenResult["@id"]);
58698
+ const mediaType = getPrimaryMediaType3(tokenResult) || "text/plain";
58699
+ const { data: data2 } = await client.browse.resourceRepresentation(rId, {
58700
+ accept: mediaType
58701
+ });
58702
+ const content4 = decodeWithCharset3(data2, mediaType);
58703
+ cloneData$.next({ sourceResource: tokenResult, sourceContent: content4 });
58704
+ }
58705
+ } catch {
58706
+ }
58707
+ loading$.next(false);
58708
+ })();
58709
+ } else {
58710
+ loading$.next(false);
58711
+ }
58712
+ const save = async (saveParams) => {
58713
+ if (saveParams.mode === "clone") {
58714
+ const response = await client.yield.createFromToken({
58715
+ token: params.token,
58716
+ name: saveParams.name,
58717
+ content: saveParams.content,
58718
+ archiveOriginal: saveParams.archiveOriginal ?? true
58719
+ });
58720
+ return response.resourceId;
58721
+ }
58722
+ let fileToUpload;
58723
+ let mimeType;
58724
+ if (saveParams.file) {
58725
+ fileToUpload = saveParams.file;
58726
+ mimeType = saveParams.format ?? "application/octet-stream";
58727
+ } else {
58728
+ const blob = new Blob([saveParams.content || ""], { type: saveParams.format ?? "application/octet-stream" });
58729
+ const extension2 = saveParams.format === "text/plain" ? ".txt" : saveParams.format === "text/html" ? ".html" : ".md";
58730
+ fileToUpload = new File([blob], saveParams.name + extension2, { type: saveParams.format ?? "application/octet-stream" });
58731
+ mimeType = saveParams.format ?? "application/octet-stream";
58732
+ }
58733
+ const format = saveParams.charset && !saveParams.file ? `${mimeType}; charset=${saveParams.charset}` : mimeType;
58734
+ const newResourceId = await new Promise((resolve, reject) => {
58735
+ client.yield.resource({
58736
+ name: saveParams.name,
58737
+ file: fileToUpload,
58738
+ format,
58739
+ entityTypes: saveParams.entityTypes || [],
58740
+ language: saveParams.language,
58741
+ creationMethod: "ui",
58742
+ storageUri: saveParams.storageUri
58743
+ }).subscribe({
58744
+ next: (event) => {
58745
+ uploadProgress$.next(event);
58746
+ if (event.phase === "finished") resolve(event.resourceId);
58747
+ },
58748
+ error: (err) => {
58749
+ uploadProgress$.next(null);
58750
+ reject(err);
58751
+ },
58752
+ complete: () => uploadProgress$.next(null)
58753
+ });
58754
+ });
58755
+ if (saveParams.mode === "reference" && saveParams.annotationUri && saveParams.sourceDocumentId) {
58756
+ await client.bind.body(
58757
+ makeResourceId2(saveParams.sourceDocumentId),
58758
+ makeAnnotationId(saveParams.annotationUri),
58759
+ [{ op: "add", item: { type: "SpecificResource", source: newResourceId, purpose: "linking" } }]
58760
+ );
58761
+ }
58762
+ return newResourceId;
58763
+ };
58764
+ return {
58765
+ browse,
58766
+ mode$: mode$.asObservable(),
58767
+ loading$: loading$.asObservable(),
58768
+ cloneData$: cloneData$.asObservable(),
58769
+ referenceData$: referenceData$.asObservable(),
58770
+ gatheredContext$: gatheredContext$.asObservable(),
58771
+ entityTypes$,
58772
+ uploadProgress$: uploadProgress$.asObservable(),
58773
+ save,
58774
+ dispose: () => {
58775
+ mode$.complete();
58776
+ loading$.complete();
58777
+ cloneData$.complete();
58778
+ referenceData$.complete();
58779
+ gatheredContext$.complete();
58780
+ disposer.dispose();
58781
+ }
58782
+ };
58783
+ }
58784
+
58785
+ // src/features/resource-viewer/state/resource-loader-state-unit.ts
58786
+ var import_rxjs5 = __toESM(require_cjs());
58787
+ function createResourceLoaderStateUnit(client, resourceId2) {
58788
+ const raw$ = client.browse.resource(resourceId2);
58789
+ const resource$ = raw$;
58790
+ const isLoading$ = raw$.pipe((0, import_rxjs5.map)((r14) => r14 === void 0));
58791
+ return {
58792
+ resource$,
58793
+ isLoading$,
58794
+ invalidate: () => client.browse.invalidateResourceDetail(resourceId2),
58795
+ dispose: () => {
58796
+ }
58797
+ };
58798
+ }
58799
+
58800
+ // src/features/admin-users/state/admin-users-state-unit.ts
58801
+ var import_rxjs6 = __toESM(require_cjs());
58802
+ import { userDID } from "@semiont/core";
58803
+ import { createDisposer as createDisposer3 } from "@semiont/sdk";
58804
+ function createAdminUsersStateUnit(client, browse) {
58805
+ const disposer = createDisposer3();
58806
+ disposer.add(browse);
58807
+ const users$ = new import_rxjs6.BehaviorSubject([]);
58808
+ const stats$ = new import_rxjs6.BehaviorSubject(null);
58809
+ const usersLoading$ = new import_rxjs6.BehaviorSubject(true);
58810
+ const statsLoading$ = new import_rxjs6.BehaviorSubject(true);
58811
+ const fetchUsers = () => {
58812
+ usersLoading$.next(true);
58813
+ client.admin.users().then((data2) => {
58814
+ users$.next(data2.users ?? []);
58815
+ usersLoading$.next(false);
58816
+ }).catch(() => usersLoading$.next(false));
58817
+ };
58818
+ const fetchStats = () => {
58819
+ statsLoading$.next(true);
58820
+ client.admin.userStats().then((data2) => {
58821
+ stats$.next(data2.stats ?? null);
58822
+ statsLoading$.next(false);
58823
+ }).catch(() => statsLoading$.next(false));
58824
+ };
58825
+ fetchUsers();
58826
+ fetchStats();
58827
+ const updateUser = async (id2, data2) => {
58828
+ await client.admin.updateUser(userDID(id2), data2);
58829
+ fetchUsers();
58830
+ fetchStats();
58831
+ };
58832
+ return {
58833
+ browse,
58834
+ users$: users$.asObservable(),
58835
+ stats$: stats$.asObservable(),
58836
+ usersLoading$: usersLoading$.asObservable(),
58837
+ statsLoading$: statsLoading$.asObservable(),
58838
+ updateUser,
58839
+ dispose: () => {
58840
+ users$.complete();
58841
+ stats$.complete();
58842
+ usersLoading$.complete();
58843
+ statsLoading$.complete();
58844
+ disposer.dispose();
58845
+ }
58846
+ };
58847
+ }
58848
+
58849
+ // src/features/admin-security/state/admin-security-state-unit.ts
58850
+ var import_rxjs7 = __toESM(require_cjs());
58851
+ import { createDisposer as createDisposer4 } from "@semiont/sdk";
58852
+ function createAdminSecurityStateUnit(client, browse) {
58853
+ const disposer = createDisposer4();
58854
+ disposer.add(browse);
58855
+ const providers$ = new import_rxjs7.BehaviorSubject([]);
58856
+ const allowedDomains$ = new import_rxjs7.BehaviorSubject([]);
58857
+ const isLoading$ = new import_rxjs7.BehaviorSubject(true);
58858
+ client.admin.oauthConfig().then((data2) => {
58859
+ const config = data2;
58860
+ providers$.next(config.providers ?? []);
58861
+ allowedDomains$.next(config.allowedDomains ?? []);
58862
+ isLoading$.next(false);
58863
+ }).catch(() => isLoading$.next(false));
58864
+ return {
58865
+ browse,
58866
+ providers$: providers$.asObservable(),
58867
+ allowedDomains$: allowedDomains$.asObservable(),
58868
+ isLoading$: isLoading$.asObservable(),
58869
+ dispose: () => {
58870
+ providers$.complete();
58871
+ allowedDomains$.complete();
58872
+ isLoading$.complete();
58873
+ disposer.dispose();
58874
+ }
58875
+ };
58876
+ }
58877
+
58878
+ // src/features/admin-exchange/state/exchange-state-unit.ts
58879
+ var import_rxjs8 = __toESM(require_cjs());
58880
+ var import_operators3 = __toESM(require_operators());
58881
+ import { createDisposer as createDisposer5 } from "@semiont/sdk";
58882
+ function createExchangeStateUnit(browse, exportFn, importFn) {
58883
+ const disposer = createDisposer5();
58884
+ disposer.add(browse);
58885
+ const selectedFile$ = new import_rxjs8.BehaviorSubject(null);
58886
+ const preview$ = new import_rxjs8.BehaviorSubject(null);
58887
+ const importPhase$ = new import_rxjs8.BehaviorSubject(null);
58888
+ const importMessage$ = new import_rxjs8.BehaviorSubject(void 0);
58889
+ const importResult$ = new import_rxjs8.BehaviorSubject(void 0);
58890
+ const isExporting$ = new import_rxjs8.BehaviorSubject(false);
58891
+ const isImporting$ = new import_rxjs8.BehaviorSubject(false);
58892
+ const selectFile = (file) => {
58893
+ selectedFile$.next(file);
58894
+ importPhase$.next(null);
58895
+ importMessage$.next(void 0);
58896
+ importResult$.next(void 0);
58897
+ preview$.next({
58898
+ format: file.name.endsWith(".tar.gz") || file.name.endsWith(".gz") ? "semiont-linked-data" : "unknown",
58899
+ version: 1,
58900
+ sourceUrl: "",
58901
+ stats: {}
58902
+ });
58903
+ };
58904
+ const cancelImport = () => {
58905
+ selectedFile$.next(null);
58906
+ preview$.next(null);
58907
+ importPhase$.next(null);
58908
+ importMessage$.next(void 0);
58909
+ importResult$.next(void 0);
58910
+ };
58911
+ const doExport = async () => {
58912
+ isExporting$.next(true);
58913
+ try {
58914
+ const download = await exportFn();
58915
+ const blob = await new Response(download.stream).blob();
58916
+ const filename = download.filename ?? `semiont-export-${Date.now()}.tar.gz`;
58917
+ return { blob, filename };
58918
+ } finally {
58919
+ isExporting$.next(false);
58920
+ }
58921
+ };
58922
+ const doImport = async () => {
58923
+ const file = selectedFile$.getValue();
58924
+ if (!file) return;
58925
+ isImporting$.next(true);
58926
+ importPhase$.next("started");
58927
+ importMessage$.next(void 0);
58928
+ importResult$.next(void 0);
58929
+ try {
58930
+ await (0, import_rxjs8.lastValueFrom)(
58931
+ importFn(file).pipe(
58932
+ (0, import_operators3.tap)((event) => {
58933
+ importPhase$.next(event.phase);
58934
+ importMessage$.next(event.message);
58935
+ if (event.result) importResult$.next(event.result);
58936
+ })
58937
+ )
58938
+ );
58939
+ } finally {
58940
+ isImporting$.next(false);
58941
+ }
58942
+ };
58943
+ return {
58944
+ browse,
58945
+ selectedFile$: selectedFile$.asObservable(),
58946
+ preview$: preview$.asObservable(),
58947
+ importPhase$: importPhase$.asObservable(),
58948
+ importMessage$: importMessage$.asObservable(),
58949
+ importResult$: importResult$.asObservable(),
58950
+ isExporting$: isExporting$.asObservable(),
58951
+ isImporting$: isImporting$.asObservable(),
58952
+ selectFile,
58953
+ cancelImport,
58954
+ doExport,
58955
+ doImport,
58956
+ dispose: () => {
58957
+ selectedFile$.complete();
58958
+ preview$.complete();
58959
+ importPhase$.complete();
58960
+ importMessage$.complete();
58961
+ importResult$.complete();
58962
+ isExporting$.complete();
58963
+ isImporting$.complete();
58964
+ disposer.dispose();
58965
+ }
58966
+ };
58967
+ }
58968
+
58969
+ // src/features/auth-welcome/state/welcome-state-unit.ts
58970
+ var import_rxjs9 = __toESM(require_cjs());
58971
+ import { createDisposer as createDisposer6 } from "@semiont/sdk";
58972
+ function createWelcomeStateUnit(client) {
58973
+ const disposer = createDisposer6();
58974
+ const userData$ = new import_rxjs9.BehaviorSubject(null);
58975
+ const isProcessing$ = new import_rxjs9.BehaviorSubject(false);
58976
+ client.auth.me().then((data2) => userData$.next(data2)).catch(() => {
58977
+ });
58978
+ const acceptTerms = async () => {
58979
+ isProcessing$.next(true);
58980
+ try {
58981
+ await client.auth.acceptTerms();
58982
+ userData$.next({ ...userData$.getValue(), termsAcceptedAt: (/* @__PURE__ */ new Date()).toISOString() });
58983
+ } finally {
58984
+ isProcessing$.next(false);
58985
+ }
58986
+ };
58987
+ return {
58988
+ userData$: userData$.asObservable(),
58989
+ isProcessing$: isProcessing$.asObservable(),
58990
+ acceptTerms,
58991
+ dispose: () => {
58992
+ userData$.complete();
58993
+ isProcessing$.complete();
58994
+ disposer.dispose();
58995
+ }
58996
+ };
58997
+ }
58998
+
58999
+ // src/features/resource-discovery/state/discover-state-unit.ts
59000
+ var import_rxjs10 = __toESM(require_cjs());
59001
+ import { createDisposer as createDisposer7 } from "@semiont/sdk";
59002
+ import { createSearchPipeline as createSearchPipeline3 } from "@semiont/sdk";
59003
+ var RECENT_LIMIT = 10;
59004
+ var SEARCH_LIMIT3 = 20;
59005
+ function createDiscoverStateUnit(client, browse) {
59006
+ const disposer = createDisposer7();
59007
+ const search2 = createSearchPipeline3(
59008
+ (q2) => client.browse.resources({ search: q2, limit: SEARCH_LIMIT3 })
59009
+ );
59010
+ disposer.add(search2);
59011
+ disposer.add(browse);
59012
+ const recent$ = client.browse.resources({ limit: RECENT_LIMIT, archived: false });
59013
+ const recentResources$ = recent$.pipe(
59014
+ (0, import_rxjs10.map)((r14) => r14 ?? [])
59015
+ );
59016
+ const isLoadingRecent$ = recent$.pipe(
59017
+ (0, import_rxjs10.map)((r14) => r14 === void 0)
59018
+ );
59019
+ const entityTypes$ = client.browse.entityTypes().pipe(
59020
+ (0, import_rxjs10.map)((e6) => e6 ?? [])
59021
+ );
59022
+ return {
59023
+ browse,
59024
+ search: search2,
59025
+ recentResources$,
59026
+ entityTypes$,
59027
+ isLoadingRecent$,
59028
+ dispose: () => disposer.dispose()
59029
+ };
59030
+ }
59031
+
59032
+ // src/features/moderate-entity-tags/state/entity-tags-state-unit.ts
59033
+ var import_rxjs11 = __toESM(require_cjs());
59034
+ import { createDisposer as createDisposer8 } from "@semiont/sdk";
59035
+ function createEntityTagsStateUnit(client, browse) {
59036
+ const disposer = createDisposer8();
59037
+ disposer.add(browse);
59038
+ const newTag$ = new import_rxjs11.BehaviorSubject("");
59039
+ const error$ = new import_rxjs11.BehaviorSubject("");
59040
+ const isAdding$ = new import_rxjs11.BehaviorSubject(false);
59041
+ const raw$ = client.browse.entityTypes();
59042
+ const entityTypes$ = raw$.pipe((0, import_rxjs11.map)((e6) => e6 ?? []));
59043
+ const isLoading$ = raw$.pipe((0, import_rxjs11.map)((e6) => e6 === void 0));
59044
+ const addTag = async () => {
59045
+ const tag = newTag$.getValue().trim();
59046
+ if (!tag) return;
59047
+ error$.next("");
59048
+ isAdding$.next(true);
59049
+ try {
59050
+ await client.frame.addEntityType(tag);
59051
+ newTag$.next("");
59052
+ } catch (err) {
59053
+ error$.next(err instanceof Error ? err.message : "Failed to add entity type");
59054
+ } finally {
59055
+ isAdding$.next(false);
59056
+ }
59057
+ };
59058
+ return {
59059
+ browse,
59060
+ entityTypes$,
59061
+ isLoading$,
59062
+ newTag$: newTag$.asObservable(),
59063
+ error$: error$.asObservable(),
59064
+ isAdding$: isAdding$.asObservable(),
59065
+ setNewTag: (v4) => newTag$.next(v4),
59066
+ addTag,
59067
+ dispose: () => {
59068
+ newTag$.complete();
59069
+ error$.complete();
59070
+ isAdding$.complete();
59071
+ disposer.dispose();
59072
+ }
59073
+ };
59074
+ }
58526
59075
  export {
58527
59076
  ANNOTATORS,
58528
59077
  AVAILABLE_LOCALES,
@@ -58544,7 +59093,7 @@ export {
58544
59093
  BrowseView,
58545
59094
  Button,
58546
59095
  ButtonGroup,
58547
- COMMON_PANELS11 as COMMON_PANELS,
59096
+ COMMON_PANELS,
58548
59097
  CodeMirrorRenderer,
58549
59098
  CollaborationPanel,
58550
59099
  CollapsibleResourceNavigation,
@@ -58614,7 +59163,6 @@ export {
58614
59163
  StatisticsPanel,
58615
59164
  StatusDisplay,
58616
59165
  SvgDrawingCanvas,
58617
- TAG_SCHEMAS,
58618
59166
  TagEntry,
58619
59167
  TagSchemasPage,
58620
59168
  TaggingPanel,
@@ -58625,6 +59173,7 @@ export {
58625
59173
  TranslationProvider,
58626
59174
  UnifiedAnnotationsPanel,
58627
59175
  UnifiedHeader,
59176
+ UploadProgressBar,
58628
59177
  UserMenuSkeleton,
58629
59178
  WebBrowserStorage,
58630
59179
  WelcomePage,
@@ -58633,42 +59182,35 @@ export {
58633
59182
  buildTextNodeIndex,
58634
59183
  buttonStyles,
58635
59184
  clearHighlights,
58636
- createAdminSecurityVM,
58637
- createAdminUsersVM,
58638
- createBeckonVM,
58639
- createComposePageVM,
58640
- createDiscoverVM,
58641
- createEntityTagsVM,
58642
- createExchangeVM,
58643
- createGatherVM,
59185
+ createAdminSecurityStateUnit,
59186
+ createAdminUsersStateUnit,
59187
+ createBeckonStateUnit2 as createBeckonStateUnit,
59188
+ createComposePageStateUnit,
59189
+ createDiscoverStateUnit,
59190
+ createEntityTagsStateUnit,
59191
+ createExchangeStateUnit,
59192
+ createGatherStateUnit2 as createGatherStateUnit,
58644
59193
  createHoverHandlers4 as createHoverHandlers,
58645
- createJobClaimAdapter,
58646
- createJobQueueVM,
58647
- createMarkVM,
58648
- createMatchVM,
58649
- createResourceLoaderVM,
58650
- createResourceViewerPageVM2 as createResourceViewerPageVM,
58651
- createSearchPipeline3 as createSearchPipeline,
58652
- createSessionVM,
58653
- createShellVM2 as createShellVM,
58654
- createWelcomeVM,
58655
- createYieldVM,
59194
+ createMarkStateUnit2 as createMarkStateUnit,
59195
+ createMatchStateUnit2 as createMatchStateUnit,
59196
+ createResourceLoaderStateUnit,
59197
+ createResourceViewerPageStateUnit,
59198
+ createSearchPipeline4 as createSearchPipeline,
59199
+ createSessionStateUnit,
59200
+ createShellStateUnit,
59201
+ createWelcomeStateUnit,
59202
+ createYieldStateUnit2 as createYieldStateUnit,
58656
59203
  cssVariables,
58657
59204
  faviconPaths,
58658
59205
  formatTime,
58659
59206
  generateCSSVariables,
58660
- getAllTagSchemas,
58661
59207
  getResourceIcon,
58662
59208
  getSelectedShapeForSelectorType,
58663
59209
  getSelectorType,
58664
59210
  getShortcutDisplay,
58665
59211
  getSupportedShapes,
58666
- getSchemaCategory as getTagCategory,
58667
- getTagSchema,
58668
- getTagSchemasByDomain,
58669
59212
  hideWidgetPreview,
58670
59213
  isShapeSupported,
58671
- isValidCategory,
58672
59214
  jsonLightHighlightStyle,
58673
59215
  jsonLightTheme,
58674
59216
  resolveAnnotationRanges,
@@ -58708,10 +59250,10 @@ export {
58708
59250
  useSearchAnnouncements,
58709
59251
  useSemiont,
58710
59252
  useSessionExpiry,
58711
- useShellVM,
59253
+ useShellStateUnit,
59254
+ useStateUnit,
58712
59255
  useTheme,
58713
59256
  useToast,
58714
- useTranslations,
58715
- useViewModel
59257
+ useTranslations
58716
59258
  };
58717
59259
  //# sourceMappingURL=index.mjs.map