@pie-element/extended-text-entry 15.1.1-next.11 → 15.1.2-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (212) hide show
  1. package/configure.js +2 -0
  2. package/controller.js +1 -0
  3. package/dist/author/defaults.d.ts +166 -0
  4. package/dist/author/defaults.js +209 -0
  5. package/dist/author/index.d.ts +52 -0
  6. package/dist/author/index.js +74 -0
  7. package/dist/author/main.d.ts +26 -0
  8. package/dist/author/main.js +166 -0
  9. package/dist/browser/author/index.js +495 -0
  10. package/dist/browser/author/index.js.map +1 -0
  11. package/dist/browser/browser-kkT1XVKw.js +210 -0
  12. package/dist/browser/browser-kkT1XVKw.js.map +1 -0
  13. package/dist/browser/controller/index.js +184 -0
  14. package/dist/browser/controller/index.js.map +1 -0
  15. package/dist/browser/delivery/index.js +98 -0
  16. package/dist/browser/delivery/index.js.map +1 -0
  17. package/dist/browser/dist-D8VooYkz.js +49034 -0
  18. package/dist/browser/dist-D8VooYkz.js.map +1 -0
  19. package/dist/browser/extended-text-entry.css +2 -0
  20. package/dist/browser/main-C2oHx_V9.js +714 -0
  21. package/dist/browser/main-C2oHx_V9.js.map +1 -0
  22. package/dist/browser/print/index.js +53 -0
  23. package/dist/browser/print/index.js.map +1 -0
  24. package/dist/controller/defaults.d.ts +33 -0
  25. package/dist/controller/defaults.js +104 -0
  26. package/dist/controller/index.d.ts +59 -0
  27. package/dist/controller/index.js +72 -0
  28. package/dist/delivery/annotation/annotation-editor.d.ts +47 -0
  29. package/dist/delivery/annotation/annotation-editor.js +296 -0
  30. package/dist/delivery/annotation/annotation-menu.d.ts +25 -0
  31. package/dist/delivery/annotation/annotation-menu.js +113 -0
  32. package/dist/delivery/annotation/annotation-utils.d.ts +20 -0
  33. package/dist/delivery/annotation/annotation-utils.js +65 -0
  34. package/dist/delivery/annotation/freeform-editor.d.ts +30 -0
  35. package/dist/delivery/annotation/freeform-editor.js +143 -0
  36. package/dist/delivery/index.d.ts +23 -0
  37. package/dist/delivery/index.js +68 -0
  38. package/dist/delivery/main.d.ts +27 -0
  39. package/dist/delivery/main.js +134 -0
  40. package/dist/extended-text-entry.css +2 -0
  41. package/dist/index.d.ts +1 -0
  42. package/dist/index.iife.d.ts +8 -0
  43. package/dist/index.iife.js +403 -0
  44. package/dist/index.js +2 -0
  45. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_DataView.js +6 -0
  46. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Hash.js +16 -0
  47. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_ListCache.js +16 -0
  48. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Map.js +6 -0
  49. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_MapCache.js +16 -0
  50. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Promise.js +6 -0
  51. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Set.js +6 -0
  52. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Stack.js +14 -0
  53. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Symbol.js +5 -0
  54. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Uint8Array.js +5 -0
  55. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_WeakMap.js +6 -0
  56. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayEach.js +7 -0
  57. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayFilter.js +10 -0
  58. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayLikeKeys.js +15 -0
  59. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayPush.js +7 -0
  60. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assignValue.js +10 -0
  61. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assocIndexOf.js +8 -0
  62. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssign.js +8 -0
  63. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignIn.js +8 -0
  64. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignValue.js +12 -0
  65. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseClone.js +57 -0
  66. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseCreate.js +14 -0
  67. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetAllKeys.js +9 -0
  68. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.js +10 -0
  69. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsArguments.js +9 -0
  70. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsMap.js +9 -0
  71. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNative.js +11 -0
  72. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsSet.js +9 -0
  73. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsTypedArray.js +11 -0
  74. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeys.js +12 -0
  75. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeysIn.js +13 -0
  76. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTimes.js +7 -0
  77. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTrim.js +8 -0
  78. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUnary.js +8 -0
  79. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneArrayBuffer.js +8 -0
  80. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneBuffer.js +10 -0
  81. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneDataView.js +8 -0
  82. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneRegExp.js +8 -0
  83. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneSymbol.js +8 -0
  84. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneTypedArray.js +8 -0
  85. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyArray.js +8 -0
  86. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyObject.js +14 -0
  87. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbols.js +8 -0
  88. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbolsIn.js +8 -0
  89. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_coreJsData.js +5 -0
  90. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_defineProperty.js +10 -0
  91. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.js +4 -0
  92. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeys.js +9 -0
  93. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeysIn.js +9 -0
  94. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getMapData.js +8 -0
  95. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getNative.js +9 -0
  96. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getPrototype.js +5 -0
  97. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getRawTag.js +14 -0
  98. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbols.js +10 -0
  99. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbolsIn.js +11 -0
  100. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getTag.js +23 -0
  101. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getValue.js +6 -0
  102. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashClear.js +7 -0
  103. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashDelete.js +7 -0
  104. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashGet.js +13 -0
  105. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashHas.js +9 -0
  106. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashSet.js +9 -0
  107. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneArray.js +8 -0
  108. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneByTag.js +33 -0
  109. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneObject.js +9 -0
  110. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIndex.js +8 -0
  111. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKeyable.js +7 -0
  112. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isMasked.js +11 -0
  113. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isPrototype.js +8 -0
  114. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheClear.js +6 -0
  115. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheDelete.js +9 -0
  116. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheGet.js +8 -0
  117. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheHas.js +7 -0
  118. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheSet.js +8 -0
  119. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheClear.js +13 -0
  120. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheDelete.js +8 -0
  121. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheGet.js +7 -0
  122. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheHas.js +7 -0
  123. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheSet.js +8 -0
  124. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeCreate.js +5 -0
  125. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeys.js +5 -0
  126. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeysIn.js +8 -0
  127. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nodeUtil.js +9 -0
  128. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.js +7 -0
  129. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overArg.js +8 -0
  130. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_root.js +5 -0
  131. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackClear.js +7 -0
  132. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackDelete.js +7 -0
  133. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackGet.js +6 -0
  134. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackHas.js +6 -0
  135. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackSet.js +16 -0
  136. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toSource.js +15 -0
  137. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_trimmedEndIndex.js +8 -0
  138. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/cloneDeep.js +8 -0
  139. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/debounce.js +50 -0
  140. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/eq.js +6 -0
  141. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArguments.js +10 -0
  142. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArray.js +4 -0
  143. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArrayLike.js +8 -0
  144. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isBuffer.js +6 -0
  145. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isFunction.js +11 -0
  146. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isLength.js +7 -0
  147. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isMap.js +7 -0
  148. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObject.js +7 -0
  149. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObjectLike.js +6 -0
  150. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSet.js +7 -0
  151. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSymbol.js +9 -0
  152. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isTypedArray.js +7 -0
  153. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keys.js +9 -0
  154. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keysIn.js +9 -0
  155. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/now.js +7 -0
  156. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubArray.js +6 -0
  157. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubFalse.js +6 -0
  158. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/toNumber.js +19 -0
  159. package/dist/print/index.d.ts +15 -0
  160. package/dist/print/index.js +49 -0
  161. package/package.json +83 -21
  162. package/CHANGELOG.json +0 -1282
  163. package/CHANGELOG.md +0 -2260
  164. package/LICENSE.md +0 -5
  165. package/README.md +0 -1
  166. package/configure/CHANGELOG.json +0 -922
  167. package/configure/CHANGELOG.md +0 -1949
  168. package/configure/lib/defaults.js +0 -224
  169. package/configure/lib/defaults.js.map +0 -1
  170. package/configure/lib/index.js +0 -125
  171. package/configure/lib/index.js.map +0 -1
  172. package/configure/lib/main.js +0 -247
  173. package/configure/lib/main.js.map +0 -1
  174. package/configure/package.json +0 -23
  175. package/controller/CHANGELOG.json +0 -362
  176. package/controller/CHANGELOG.md +0 -1179
  177. package/controller/lib/defaults.js +0 -91
  178. package/controller/lib/defaults.js.map +0 -1
  179. package/controller/lib/index.js +0 -101
  180. package/controller/lib/index.js.map +0 -1
  181. package/controller/package.json +0 -16
  182. package/docs/config-schema.json +0 -1782
  183. package/docs/config-schema.json.md +0 -1333
  184. package/docs/demo/config.js +0 -7
  185. package/docs/demo/generate.js +0 -14
  186. package/docs/demo/index.html +0 -3
  187. package/docs/demo/session.js +0 -7
  188. package/docs/pie-schema.json +0 -954
  189. package/docs/pie-schema.json.md +0 -717
  190. package/lib/annotation/annotation-editor.js +0 -636
  191. package/lib/annotation/annotation-editor.js.map +0 -1
  192. package/lib/annotation/annotation-menu.js +0 -147
  193. package/lib/annotation/annotation-menu.js.map +0 -1
  194. package/lib/annotation/annotation-utils.js +0 -205
  195. package/lib/annotation/annotation-utils.js.map +0 -1
  196. package/lib/annotation/freeform-editor.js +0 -241
  197. package/lib/annotation/freeform-editor.js.map +0 -1
  198. package/lib/index.js +0 -108
  199. package/lib/index.js.map +0 -1
  200. package/lib/main.js +0 -205
  201. package/lib/main.js.map +0 -1
  202. package/lib/print.js +0 -86
  203. package/lib/print.js.map +0 -1
  204. package/module/configure.js +0 -1
  205. package/module/controller.js +0 -139
  206. package/module/demo.js +0 -38
  207. package/module/element.js +0 -1
  208. package/module/index.html +0 -21
  209. package/module/manifest.json +0 -22
  210. package/module/print-demo.js +0 -76
  211. package/module/print.html +0 -18
  212. package/module/print.js +0 -1
@@ -0,0 +1,714 @@
1
+ import { a as e, t } from "./browser-kkT1XVKw.js";
2
+ import { _ as n, a as r, b as i, c as a, f as o, g as s, l as c, m as l, o as u, p as d, s as f, t as p, u as m, v as h } from "./dist-D8VooYkz.js";
3
+ import g from "react";
4
+ import { jsx as _, jsxs as v } from "react/jsx-runtime";
5
+ //#region src/delivery/annotation/annotation-utils.ts
6
+ var y = /* @__PURE__ */ e(i(), 1), b = /* @__PURE__ */ e(t(), 1), x = (e, t, n) => {
7
+ let r = n || [], i = r.reduce((e, t) => e + t.textContent.length, 0), a = !0;
8
+ if (i > t) return !1;
9
+ for (e &&= (e.nodeType === 3 && e.parentNode && !e.parentNode.hasAttribute("data-ann-id") && r.push(e), e.firstChild); e && a;) a = x(e, t, r), e = e.nextSibling;
10
+ return r;
11
+ }, S = (e, t, n) => {
12
+ let r = x(n, t), i = [], a = 0;
13
+ return r.forEach((n) => {
14
+ let r = a + n.textContent.length;
15
+ [e, t].forEach((e) => {
16
+ a <= e && e < r && i.push({
17
+ node: n,
18
+ offset: e - a
19
+ });
20
+ }), a = r;
21
+ }), i;
22
+ }, C = (e) => {
23
+ let { commonAncestorContainer: t, startContainer: n, endContainer: r, startOffset: i, endOffset: a } = e, o = [], s = !1, c = !1, l = "", u = (e) => {
24
+ let { nodeValue: t, childNodes: d } = e;
25
+ e === n && e === r ? (t && (l += t.substring(i, a)), s = c = !0) : e === n ? (t && (l += t.substring(i)), s = !0) : e === r ? (t && (l += t.substring(0, a)), c = !0) : e && e.nodeType === 3 && e.parentNode && !e.parentNode.hasAttribute("data-ann-id") && t && s && !c && (l += t, o.push(e)), d.forEach((e) => {
26
+ if (!c) u(e);
27
+ else return;
28
+ });
29
+ };
30
+ return u(t), [o, l];
31
+ }, w = (e) => {
32
+ let t = document.createElement("SPAN");
33
+ return e.surroundContents(t), t;
34
+ }, T = (e) => {
35
+ if (e.startContainer === e.endContainer) return [w(e)];
36
+ let [t] = C(e), n = document.createRange();
37
+ n.selectNodeContents(e.startContainer), n.setStart(e.startContainer, e.startOffset);
38
+ let r = w(n), i = document.createRange();
39
+ i.selectNode(e.endContainer), i.setEnd(e.endContainer, e.endOffset);
40
+ let a = w(i);
41
+ return [
42
+ r,
43
+ ...t.map((e) => {
44
+ let t = document.createElement("SPAN");
45
+ return e.parentNode.insertBefore(t, e), t.appendChild(e), t;
46
+ }),
47
+ a
48
+ ];
49
+ }, E = (e, t) => {
50
+ let n = document.createRange();
51
+ n.setStart(t, 0), n.setEnd(e.startContainer, e.startOffset);
52
+ let [, r] = C(n), [, i] = C(e), a = r.length;
53
+ return {
54
+ quote: i,
55
+ start: a,
56
+ end: a + i.length
57
+ };
58
+ }, D = (e, t) => {
59
+ (e || []).forEach((e) => {
60
+ let t = e.parentNode, n = e.childNodes, r = n.length;
61
+ if (r > 0) for (let i = 0; i < r; i++) t.insertBefore(n[0], e);
62
+ else t.insertBefore(document.createTextNode(e.textContent), e);
63
+ t.removeChild(e);
64
+ }), t.normalize();
65
+ }, O = () => {
66
+ document.getSelection ? (document.getSelection().removeAllRanges(), document.getSelection().addRange(document.createRange())) : window.getSelection ? window.getSelection().removeAllRanges ? (window.getSelection().removeAllRanges(), window.getSelection().addRange(document.createRange())) : window.getSelection().empty && window.getSelection().empty() : document.selection && document.selection.empty();
67
+ }, k = (e) => e.length >= 20 || e.search(/\n|\r|\r\n/) !== -1, A = (e) => Array.from(document.querySelectorAll(`[data-id='${e}']`)), j = (e) => document.querySelector(`[data-ann-id='${e}']`), M = n(o)(({ theme: e, annotationType: t }) => ({ "& .MuiPaper-root": {
68
+ overflowX: "unset",
69
+ overflowY: "unset",
70
+ marginLeft: "16px",
71
+ "&::before": {
72
+ position: "absolute",
73
+ right: "100%",
74
+ top: "13px",
75
+ border: "solid transparent",
76
+ content: "\"\"",
77
+ height: 0,
78
+ width: 0,
79
+ pointerEvents: "none",
80
+ borderWidth: "7px",
81
+ borderRightColor: e.palette.grey[100]
82
+ },
83
+ ...t === "negative" && { "&::before": { borderRightColor: "rgb(255, 204, 238) !important" } },
84
+ ...t === "positive" && { "&::before": { borderRightColor: "rgb(153, 255, 153) !important" } }
85
+ } })), N = n("div")(({ theme: e, annotationType: t }) => ({
86
+ width: "200px",
87
+ overflow: "hidden",
88
+ borderRadius: "4px",
89
+ backgroundColor: "#ffffff",
90
+ border: `4px solid ${e.palette.grey[100]}`,
91
+ ...t === "negative" && { borderColor: "rgb(255, 204, 238) !important" },
92
+ ...t === "positive" && { borderColor: "rgb(153, 255, 153) !important" }
93
+ })), P = n("div")(({ theme: e }) => ({
94
+ display: "flex",
95
+ flexWrap: "wrap",
96
+ borderTop: `2px solid ${e.palette.grey[100]}`
97
+ })), F = n("div")(({ theme: e, variant: t, annotationType: n }) => ({
98
+ flexGrow: 1,
99
+ width: "28%",
100
+ textAlign: "center",
101
+ padding: "4px",
102
+ cursor: "pointer",
103
+ "&:not(:nth-child(3n))": { borderRight: `1px solid ${e.palette.grey[100]}` },
104
+ "&:hover": { backgroundColor: e.palette.grey[100] },
105
+ ...t === "positive" && {
106
+ backgroundColor: "rgb(153, 255, 153) !important",
107
+ "&:hover": { filter: "brightness(85%)" }
108
+ },
109
+ ...t === "negative" && {
110
+ backgroundColor: "rgb(255, 204, 238) !important",
111
+ "&:hover": { filter: "brightness(85%)" }
112
+ },
113
+ ...t === "typeChange" && n === "negative" && { "&:hover": { backgroundColor: "rgb(153, 255, 153) !important" } },
114
+ ...t === "typeChange" && n === "positive" && { "&:hover": { backgroundColor: "rgb(255, 204, 238) !important" } }
115
+ })), I = class extends g.Component {
116
+ static propTypes = {
117
+ anchorEl: y.default.object,
118
+ open: y.default.bool,
119
+ offset: y.default.number,
120
+ value: y.default.string,
121
+ type: y.default.string,
122
+ onClose: y.default.func,
123
+ onDelete: y.default.func,
124
+ onSave: y.default.func,
125
+ onTypeChange: y.default.func
126
+ };
127
+ constructor(e) {
128
+ super(e), this.state = { value: e.value };
129
+ }
130
+ UNSAFE_componentWillReceiveProps(e) {
131
+ let { value: t } = e, { value: n } = this.props;
132
+ t !== n && this.setState({ value: t });
133
+ }
134
+ onValueChange = (e) => this.setState({ value: e.target.value });
135
+ handleSave = () => {
136
+ let { value: e, onSave: t, onClose: n, onDelete: r } = this.props, { value: i } = this.state;
137
+ i === "" && r(), e !== i && t(e, i), this.setState({ value: "" }), n();
138
+ };
139
+ handleTypeChange = () => {
140
+ let { onTypeChange: e, onDelete: t } = this.props, { value: n } = this.state;
141
+ n === "" ? t() : e(n), this.setState({ value: "" });
142
+ };
143
+ render() {
144
+ let { anchorEl: e, offset: t, onDelete: n, open: r, type: i } = this.props, { value: a } = this.state;
145
+ return /* @__PURE__ */ _(M, {
146
+ anchorEl: e,
147
+ elevation: 2,
148
+ open: r,
149
+ onClose: this.handleSave,
150
+ annotationType: i,
151
+ style: {
152
+ marginTop: `${t}px`,
153
+ transition: "margin-top 2s ease-out"
154
+ },
155
+ transitionDuration: {
156
+ enter: 225,
157
+ exit: 195
158
+ },
159
+ anchorOrigin: {
160
+ vertical: "top",
161
+ horizontal: "right"
162
+ },
163
+ transformOrigin: {
164
+ vertical: "top",
165
+ horizontal: "left"
166
+ },
167
+ children: /* @__PURE__ */ v(N, {
168
+ annotationType: i,
169
+ children: [/* @__PURE__ */ _(u, {
170
+ id: "annotation-editor",
171
+ style: {
172
+ padding: "2px 5px",
173
+ width: "95%"
174
+ },
175
+ autoFocus: !0,
176
+ multiline: !0,
177
+ rows: 1,
178
+ maxRows: 4,
179
+ value: a,
180
+ onChange: this.onValueChange,
181
+ InputProps: { disableUnderline: !0 }
182
+ }), /* @__PURE__ */ v(P, { children: [
183
+ /* @__PURE__ */ _(F, {
184
+ onClick: n,
185
+ children: "Delete"
186
+ }),
187
+ /* @__PURE__ */ _(F, {
188
+ variant: "typeChange",
189
+ annotationType: i,
190
+ onClick: this.handleTypeChange,
191
+ children: i === "negative" ? "Green" : "Pink"
192
+ }),
193
+ /* @__PURE__ */ _(F, {
194
+ onClick: this.handleSave,
195
+ children: "Save"
196
+ })
197
+ ] })]
198
+ })
199
+ });
200
+ }
201
+ }, ee = n(o)({ "& .MuiPaper-root": {
202
+ overflowX: "unset",
203
+ overflowY: "unset",
204
+ marginTop: "-16px",
205
+ "&::after": {
206
+ position: "absolute",
207
+ left: "calc(50% - 7px)",
208
+ border: "solid transparent",
209
+ content: "\"\"",
210
+ height: 0,
211
+ width: 0,
212
+ pointerEvents: "none",
213
+ borderWidth: "7px",
214
+ borderTopColor: "black"
215
+ }
216
+ } }), te = n("div")(({ theme: e }) => ({
217
+ width: "300px",
218
+ overflow: "hidden",
219
+ borderRadius: "4px",
220
+ backgroundColor: e.palette.common.white,
221
+ border: `2px solid ${e.palette.grey[100]}`
222
+ })), ne = n("div")({
223
+ display: "flex",
224
+ flexWrap: "wrap"
225
+ }), re = n("div")(({ theme: e }) => ({
226
+ display: "flex",
227
+ flexWrap: "wrap",
228
+ borderTop: `2px solid ${e.palette.grey[100]}`
229
+ })), L = n("div")(({ theme: e, variant: t }) => ({
230
+ width: "22%",
231
+ textAlign: "center",
232
+ padding: "4px",
233
+ cursor: "pointer",
234
+ borderBottom: `1px solid ${e.palette.grey[100]}`,
235
+ "&:not(:nth-child(4n))": { borderRight: `1px solid ${e.palette.grey[100]}` },
236
+ "&:nth-child(4n)": { flexGrow: 1 },
237
+ "&:hover": { backgroundColor: e.palette.grey[100] },
238
+ ...t === "positive" && {
239
+ backgroundColor: "rgb(153, 255, 153) !important",
240
+ "&:hover": { filter: "brightness(85%)" }
241
+ },
242
+ ...t === "negative" && {
243
+ backgroundColor: "rgb(255, 204, 238) !important",
244
+ "&:hover": { filter: "brightness(85%)" }
245
+ }
246
+ })), R = class extends g.Component {
247
+ static propTypes = {
248
+ anchorEl: y.default.object,
249
+ open: y.default.bool,
250
+ annotations: y.default.array,
251
+ isNewAnnotation: y.default.bool,
252
+ onClose: y.default.func,
253
+ onDelete: y.default.func,
254
+ onEdit: y.default.func,
255
+ onWrite: y.default.func,
256
+ onAnnotate: y.default.func
257
+ };
258
+ render() {
259
+ let { anchorEl: e, annotations: t, isNewAnnotation: n, onAnnotate: r, onClose: i, onEdit: a, onDelete: o, onWrite: s, open: c } = this.props;
260
+ return /* @__PURE__ */ _(ee, {
261
+ anchorEl: e,
262
+ open: c,
263
+ onClose: i,
264
+ elevation: 5,
265
+ transitionDuration: {
266
+ enter: 225,
267
+ exit: 195
268
+ },
269
+ anchorOrigin: {
270
+ vertical: "top",
271
+ horizontal: "center"
272
+ },
273
+ transformOrigin: {
274
+ vertical: "bottom",
275
+ horizontal: "center"
276
+ },
277
+ children: /* @__PURE__ */ v(te, { children: [/* @__PURE__ */ _(ne, { children: t.map((e, t) => /* @__PURE__ */ _(L, {
278
+ variant: e.type,
279
+ onClick: () => r(e),
280
+ children: e.label
281
+ }, `annotation-${t}`)) }), /* @__PURE__ */ v(re, { children: [
282
+ /* @__PURE__ */ _(L, {
283
+ onClick: i,
284
+ children: "Cancel"
285
+ }),
286
+ /* @__PURE__ */ _(L, { style: { pointerEvents: "none" } }),
287
+ n ? /* @__PURE__ */ v(g.Fragment, { children: [/* @__PURE__ */ _(L, {
288
+ variant: "positive",
289
+ onClick: () => s("positive"),
290
+ children: "Write"
291
+ }), /* @__PURE__ */ _(L, {
292
+ variant: "negative",
293
+ onClick: () => s("negative"),
294
+ children: "Write"
295
+ })] }) : /* @__PURE__ */ v(g.Fragment, { children: [/* @__PURE__ */ _(L, {
296
+ onClick: o,
297
+ children: "Delete"
298
+ }), /* @__PURE__ */ _(L, {
299
+ onClick: a,
300
+ children: "Edit"
301
+ })] })
302
+ ] })] })
303
+ });
304
+ }
305
+ }, z = n("div")({
306
+ padding: "10px 120px 10px 16px",
307
+ backgroundColor: "rgba(0, 0, 0, 0.06)",
308
+ border: "1px solid #ccc",
309
+ borderRadius: "4px",
310
+ overflowY: "scroll",
311
+ lineHeight: "36px",
312
+ whiteSpace: "pre-wrap",
313
+ overflowWrap: "break-word",
314
+ "& p": { margin: 0 },
315
+ "& span[data-latex]": {
316
+ userSelect: "none",
317
+ "-webkit-user-select": "none",
318
+ "-moz-user-select": "none",
319
+ "-ms-user-select": "none"
320
+ }
321
+ }), B = n("div")({ width: "230px" }), V = n("div")({
322
+ position: "relative",
323
+ overflowX: "hidden",
324
+ display: "flex"
325
+ }), H = n(p)(({ theme: e }) => ({
326
+ paddingTop: e.spacing(2),
327
+ marginBottom: e.spacing(2),
328
+ marginTop: e.spacing(2),
329
+ width: "100%"
330
+ })), U = "\n .sideAnnotation:before {\n position: absolute;\n right: var(--before-right, 100%);\n top: var(--before-top, 5px);\n border: solid transparent;\n content: \"\";\n height: 0;\n width: 0;\n pointer-events: none;\n border-width: var(--before-border-width, 7px);\n border-right-color: var(--before-border-color, rgb(153, 255, 153));\n }\n";
331
+ if (!document.getElementById("annotation-editor-styles")) {
332
+ let e = document.createElement("style");
333
+ e.id = "annotation-editor-styles", e.textContent = U, document.head.appendChild(e);
334
+ }
335
+ var W = class extends g.Component {
336
+ static propTypes = {
337
+ text: y.default.string,
338
+ comment: y.default.string,
339
+ annotations: y.default.array,
340
+ predefinedAnnotations: y.default.array,
341
+ onChange: y.default.func.isRequired,
342
+ onCommentChange: y.default.func.isRequired,
343
+ width: y.default.number,
344
+ height: y.default.number,
345
+ maxHeight: y.default.string,
346
+ disabled: y.default.bool,
347
+ disabledMath: y.default.bool,
348
+ customKeys: y.default.array,
349
+ keypadMode: y.default.string
350
+ };
351
+ constructor(e) {
352
+ super(e), this.state = {
353
+ anchorEl: null,
354
+ openedMenu: !1,
355
+ openedEditor: !1,
356
+ selectedElems: [],
357
+ labelElem: null,
358
+ selectionDetails: null,
359
+ annotation: null,
360
+ annotationIndex: null
361
+ };
362
+ }
363
+ componentDidMount() {
364
+ let { annotations: e, text: t } = this.props;
365
+ t && e.forEach((e) => {
366
+ let [t, n] = S(e.start, e.end, this.textRef);
367
+ if (t && n) {
368
+ let r = document.createRange();
369
+ r.setStart(t.node, t.offset), r.setEnd(n.node, n.offset);
370
+ let i = T(r);
371
+ this.createDOMAnnotation(i, e);
372
+ }
373
+ }), this.textRef && (this.adjustAnnotationsPosition(), this.textRef.addEventListener("scroll", this.adjustAnnotationsPosition));
374
+ }
375
+ adjustAnnotationsPosition = () => {
376
+ if (this.textRef && this.labelsRef) {
377
+ let e = this.textRef.offsetLeft + this.textRef.offsetWidth + 8;
378
+ Array.from(this.labelsRef.children).forEach((t) => {
379
+ let n = A(t.dataset.annId), r = (n[0].offsetTop ? n[0].offsetTop : n[0].offsetParent.offsetTop) - this.textRef.scrollTop - 6;
380
+ t.style.top = `${r}px`, t.style.left = `${e}px`;
381
+ });
382
+ }
383
+ };
384
+ handleClick = (e) => {
385
+ let { annotations: t } = this.props, { selectionDetails: n } = this.state;
386
+ if (n) return;
387
+ let { id: r, annId: i } = e.target.dataset, a = r || i, o = A(a), s = j(a), c = t.findIndex((e) => e.id === a), l = s.hasAttribute("data-freeform");
388
+ l && (s.style.zIndex = "10"), this.setState({
389
+ anchorEl: o[0],
390
+ openedMenu: !!r || !!i && !l,
391
+ openedEditor: !!i && l,
392
+ selectedElems: o,
393
+ labelElem: s,
394
+ annotationIndex: c,
395
+ annotation: t[c],
396
+ selectionDetails: null
397
+ });
398
+ };
399
+ handleHover = (e) => {
400
+ let { id: t, annId: n } = e.target.dataset, r = t || n, i = A(r), a = j(r), o = a.hasAttribute("data-freeform");
401
+ i.forEach((e) => {
402
+ e.style.zIndex = "20", e.classList.contains("positive") ? e.style.backgroundColor = "rgb(51, 255, 51, 0.7)" : e.classList.contains("negative") && (e.style.backgroundColor = "rgba(255, 102, 204, 0.55)");
403
+ }), o ? (a.style.zIndex = "20", a.classList.contains("positive") ? (a.style.backgroundColor = "rgb(128, 255, 128)", a.style.setProperty("--before-border-color", "rgb(153, 255, 153)")) : a.classList.contains("negative") && (a.style.backgroundColor = "rgb(255, 179, 230)", a.style.setProperty("--before-border-color", "rgb(255, 179, 230)"))) : (a.style.zIndex = "20", a.classList.contains("positive") ? a.style.color = "rgb(0, 77, 0)" : a.classList.contains("negative") && (a.style.color = "rgb(153, 0, 102)"));
404
+ };
405
+ handleCancelHover = (e) => {
406
+ let { id: t, annId: n } = e.target.dataset, r = t || n, i = A(r), a = j(r), o = a.hasAttribute("data-freeform");
407
+ i.forEach((e) => {
408
+ e.style.zIndex = "", e.classList.contains("positive") ? e.style.backgroundColor = "rgb(51, 255, 51, 0.5)" : e.classList.contains("negative") && (e.style.backgroundColor = "rgba(255, 102, 204, 0.4)");
409
+ }), o ? (a.style.zIndex = "", a.classList.contains("positive") ? (a.style.backgroundColor = "rgb(153, 255, 153)", a.style.removeProperty("--before-border-color")) : a.classList.contains("negative") && (a.style.backgroundColor = "rgb(255, 204, 238)", a.style.removeProperty("--before-border-color"))) : (a.style.zIndex = "", a.classList.contains("positive") ? a.style.color = "rgb(0, 128, 0)" : a.classList.contains("negative") && (a.style.color = "rgb(204, 0, 136)"));
410
+ };
411
+ handleClose = (e) => {
412
+ let { selectedElems: t, labelElem: n } = this.state;
413
+ t.length && !t[0].hasAttribute("data-id") && D(t, this.textRef), n && (n.style.zIndex = ""), this.setState({
414
+ anchorEl: null,
415
+ openedMenu: !1,
416
+ openedEditor: !1,
417
+ selectedElems: [],
418
+ labelElem: null,
419
+ selectionDetails: null,
420
+ annotationIndex: null,
421
+ annotation: null
422
+ }), O();
423
+ };
424
+ handleSelection = (e) => {
425
+ let t = window.getSelection();
426
+ if (e.detail > 2) {
427
+ O();
428
+ return;
429
+ }
430
+ if (t && t.rangeCount > 0) {
431
+ let e = t.getRangeAt(0), n = e.toString(), r = this.textRef.contains(e.commonAncestorContainer);
432
+ if (!t.isCollapsed && n !== "" && r) {
433
+ let t = E(e, this.textRef), n = T(e);
434
+ this.setState({
435
+ anchorEl: n[0],
436
+ openedMenu: !0,
437
+ selectedElems: n,
438
+ selectionDetails: t
439
+ });
440
+ }
441
+ }
442
+ };
443
+ deleteAnnotation = () => {
444
+ let { annotations: e, onChange: t } = this.props, { selectedElems: n, labelElem: r, annotationIndex: i, annotation: a } = this.state;
445
+ (k(a.label) ? this.labelsRef : n[0]).removeChild(r), D(n, this.textRef), e.splice(i, 1), t(e), this.handleClose();
446
+ };
447
+ createDOMAnnotation = (e, t) => {
448
+ let { disabled: n } = this.props, { id: r, label: i, type: a } = t;
449
+ (e || []).forEach((e) => {
450
+ e.dataset.id = r, e.className = `annotation ${a}`, e.style.position = "relative", e.style.cursor = "pointer", a === "positive" ? e.style.backgroundColor = "rgb(51, 255, 51, 0.5)" : a === "negative" && (e.style.backgroundColor = "rgba(255, 102, 204, 0.4)"), e.onclick = !n && this.handleClick, e.onmouseover = this.handleHover, e.onmouseout = this.handleCancelHover;
451
+ });
452
+ let o = e && e[0] || {}, s = document.createElement("SPAN");
453
+ if (s.dataset.annId = r, s.innerHTML = i, s.onclick = !n && this.handleClick, s.onmouseover = this.handleHover, s.onmouseout = this.handleCancelHover, k(i)) {
454
+ let e = (o.offsetTop ? o.offsetTop : o.offsetParent.offsetTop) - this.textRef.scrollTop, t = this.textRef.offsetLeft + this.textRef.offsetWidth + 8;
455
+ s.dataset.freeform = !0, s.className = `sideAnnotation ${a}`, s.style.position = "absolute", s.style.padding = "4px", s.style.borderRadius = "4px", s.style.marginLeft = "8px", s.style.width = "180px", s.style.whiteSpace = "pre-wrap", s.style.wordBreak = "break-word", s.style.border = "2px solid #ffffff", s.style.fontSize = "14px", s.style.fontStyle = "normal", s.style.fontWeight = "normal", s.style.top = `${e}px`, s.style.left = `${t}px`, a === "negative" ? s.style.backgroundColor = "rgb(255, 204, 238)" : a === "positive" && (s.style.backgroundColor = "rgb(153, 255, 153)"), s.style.setProperty("--before-border-width", "7px"), s.style.setProperty("--before-top", "5px"), s.style.setProperty("--before-right", "100%"), a === "negative" ? s.style.setProperty("--before-border-color", "rgb(255, 204, 238)") : a === "positive" && s.style.setProperty("--before-border-color", "rgb(153, 255, 153)"), this.labelsRef.appendChild(s);
456
+ } else s.className = `annotationLabel ${a}`, s.style.backgroundColor = "rgb(242, 242, 242)", s.style.padding = "2px", s.style.position = "absolute", s.style.userSelect = "none", s.style.whiteSpace = "nowrap", s.style.top = "-10px", s.style.left = "-2px", s.style.fontSize = "12px", s.style.fontStyle = "normal", s.style.fontWeight = "normal", s.style.lineHeight = "6px", s.style.webkitUserSelect = "none", s.style.mozUserSelect = "none", s.style.msUserSelect = "none", a === "positive" ? s.style.color = "rgb(0, 128, 0)" : a === "negative" && (s.style.color = "rgb(204, 0, 136)"), o.appendChild(s);
457
+ };
458
+ createNewAnnotation = (e, t) => {
459
+ let { selectedElems: n, selectionDetails: r } = this.state, i = {
460
+ id: [
461
+ r.start,
462
+ r.end,
463
+ (/* @__PURE__ */ new Date()).getTime()
464
+ ].join("-"),
465
+ label: e,
466
+ type: t,
467
+ ...r
468
+ };
469
+ return this.createDOMAnnotation(n, i), i;
470
+ };
471
+ handleMenuClick = (e) => {
472
+ let { annotations: t, onChange: n } = this.props, { annotation: r, annotationIndex: i } = this.state, { type: a, text: o } = e;
473
+ if (r) {
474
+ let e = {
475
+ ...r,
476
+ label: o,
477
+ type: a
478
+ }, { type: n, label: s } = r;
479
+ this.updateLabel(s, e, a !== n && n), t.splice(i, 1, e);
480
+ } else {
481
+ let e = this.createNewAnnotation(o, a);
482
+ t.push(e);
483
+ }
484
+ n(t), this.handleClose();
485
+ };
486
+ editAnnotation = () => {
487
+ this.setState({
488
+ openedMenu: !1,
489
+ openedEditor: !0
490
+ });
491
+ };
492
+ addAnnotation = (e) => {
493
+ let { annotations: t, onChange: n } = this.props, r = this.createNewAnnotation("", e), i = j(r.id);
494
+ t.push(r), this.setState({
495
+ openedMenu: !1,
496
+ openedEditor: !0,
497
+ annotationIndex: t.length - 1,
498
+ annotation: r,
499
+ labelElem: i
500
+ }), n(t);
501
+ };
502
+ updateLabel = (e, t, n) => {
503
+ let { selectedElems: r, labelElem: i } = this.state, { label: a, type: o } = t;
504
+ k(a) && k(e) || !k(a) && !k(e) ? (i.innerHTML = a, n && (i.classList.remove(n), i.classList.add(o), r.forEach((e) => {
505
+ e.classList.remove(n), e.classList.add(o);
506
+ }))) : k(a) && !k(e) ? (r[0].removeChild(i), this.createDOMAnnotation(r, t)) : !k(a) && k(e) && (this.labelsRef.removeChild(i), this.createDOMAnnotation(r, t));
507
+ };
508
+ changeAnnotationType = (e) => {
509
+ let { annotations: t, onChange: n } = this.props, { annotationIndex: r, selectedElems: i } = this.state, { type: a, label: o } = t[r], s = a === "positive" ? "negative" : "positive", c = {
510
+ ...t[r],
511
+ type: s,
512
+ label: e
513
+ };
514
+ i.forEach((e) => {
515
+ e.classList.remove(a), e.classList.add(s);
516
+ }), this.updateLabel(o, c, a), t.splice(r, 1, c), n(t), this.handleClose();
517
+ };
518
+ updateAnnotation = (e, t) => {
519
+ let { annotations: n, onChange: r } = this.props, { annotationIndex: i } = this.state, a = {
520
+ ...n[i],
521
+ label: t
522
+ };
523
+ this.updateLabel(e, a), n.splice(i, 1, a), r(n);
524
+ };
525
+ componentWillUnmount() {
526
+ this.textRef.removeEventListener("scroll", this.adjustAnnotationsPosition);
527
+ }
528
+ render() {
529
+ let { comment: e, customKeys: t, disabled: n, disabledMath: i, keypadMode: a, height: o, width: s, maxHeight: c, onCommentChange: l, predefinedAnnotations: u, text: d } = this.props, { anchorEl: f, annotation: p, openedMenu: m, openedEditor: h, selectionDetails: g } = this.state, y = f && (f.offsetTop ? f.offsetTop : f.offsetParent.offsetTop), b = this.textRef && y ? y - this.textRef.scrollTop - 8 : 0;
530
+ return /* @__PURE__ */ v("div", { children: [
531
+ /* @__PURE__ */ v(V, { children: [/* @__PURE__ */ _(z, {
532
+ style: {
533
+ width: s - 34,
534
+ minHeight: o,
535
+ maxHeight: c
536
+ },
537
+ ref: (e) => this.textRef = e,
538
+ onMouseDown: n ? () => {} : O,
539
+ onMouseUp: n ? () => {} : this.handleSelection,
540
+ dangerouslySetInnerHTML: { __html: d }
541
+ }), /* @__PURE__ */ _(B, { ref: (e) => this.labelsRef = e })] }),
542
+ /* @__PURE__ */ _(H, {
543
+ label: "Comment",
544
+ children: /* @__PURE__ */ _(r, {
545
+ className: "prompt",
546
+ markup: e || "",
547
+ onChange: l,
548
+ width: s && (s + 104).toString(),
549
+ disabled: n,
550
+ pluginProps: {
551
+ math: {
552
+ disabled: i,
553
+ customKeys: t,
554
+ keypadMode: a,
555
+ controlledKeypadMode: !1
556
+ },
557
+ video: { disabled: !0 },
558
+ audio: { disabled: !0 },
559
+ textAlign: { disabled: !0 },
560
+ h3: { disabled: !0 }
561
+ }
562
+ })
563
+ }),
564
+ /* @__PURE__ */ _(R, {
565
+ anchorEl: f,
566
+ open: m && !n,
567
+ annotations: u,
568
+ isNewAnnotation: !!g,
569
+ onClose: this.handleClose,
570
+ onDelete: this.deleteAnnotation,
571
+ onEdit: this.editAnnotation,
572
+ onWrite: this.addAnnotation,
573
+ onAnnotate: this.handleMenuClick
574
+ }),
575
+ /* @__PURE__ */ _(I, {
576
+ anchorEl: this.textRef,
577
+ open: h && !n,
578
+ offset: b,
579
+ value: p && p.label || "",
580
+ type: p && p.type,
581
+ onClose: this.handleClose,
582
+ onDelete: this.deleteAnnotation,
583
+ onSave: this.updateAnnotation,
584
+ onTypeChange: this.changeAnnotationType
585
+ })
586
+ ] });
587
+ }
588
+ };
589
+ //#endregion
590
+ //#region src/delivery/main.tsx
591
+ function G(e) {
592
+ return typeof e == "function" || typeof e == "object" && !!e && typeof e.$$typeof == "symbol";
593
+ }
594
+ function K(e, t) {
595
+ return !e || G(e) ? e : G(e.default) ? e.default : t && G(e[t]) ? e[t] : t && G(e[t]?.default) ? e[t].default : e;
596
+ }
597
+ var q = K(c, "UiLayout") || K(Q.UiLayout, "UiLayout"), J = K(a, "PreviewPrompt") || K(Q.PreviewPrompt, "PreviewPrompt"), Y = K(m, "Collapsible") || K(Q.Collapsible, "Collapsible"), ie = K(d, "Feedback") || K(Q.Feedback, "Feedback"), X = f, Z = X.default, Q = Z && typeof Z == "object" ? Z : X, ae = (0, b.default)("@pie-ui:extended-text-entry"), oe = n(q)({
598
+ backgroundColor: l.background(),
599
+ color: l.text()
600
+ }), se = n(s)(({ theme: e }) => ({
601
+ width: "100%",
602
+ color: l.text(),
603
+ marginBottom: e.spacing(2),
604
+ fontSize: "inherit"
605
+ })), ce = n("div")(({ theme: e }) => ({ marginBottom: e.spacing(2) })), le = n(r)(({ theme: e }) => ({
606
+ marginBottom: e.spacing(2),
607
+ borderRadius: "4px"
608
+ })), $ = n("h2")({
609
+ position: "absolute",
610
+ left: "-10000px",
611
+ top: "auto",
612
+ width: "1px",
613
+ height: "1px",
614
+ overflow: "hidden"
615
+ }), ue = class extends g.Component {
616
+ static propTypes = {
617
+ onValueChange: y.default.func.isRequired,
618
+ onAnnotationsChange: y.default.func.isRequired,
619
+ onCommentChange: y.default.func.isRequired,
620
+ model: y.default.object,
621
+ session: y.default.shape({
622
+ value: y.default.string,
623
+ annotations: y.default.array,
624
+ comment: y.default.string
625
+ }).isRequired
626
+ };
627
+ changeSessionValue = h(this.props.onValueChange, 1500);
628
+ changeSessionComment = h(this.props.onCommentChange, 1500);
629
+ render() {
630
+ let { model: e, session: t, onAnnotationsChange: n } = this.props, { animationsDisabled: r, annotatorMode: i, customKeys: a, dimensions: o, disabled: s, disabledAnnotator: c, equationEditor: l, extraCSSRules: u, feedback: d, mathInput: f, playersToolbarPosition: p, predefinedAnnotations: m, prompt: h, spanishInput: g, specialInput: y, spellCheckEnabled: b, teacherInstructions: x } = e, { annotations: S, comment: C, value: w } = t, { width: T, height: E } = o || {}, D = "40vh", O = { position: p === "top" ? "top" : "bottom" };
631
+ ae("[render] disabled? ", s);
632
+ let k = /* @__PURE__ */ _(J, {
633
+ defaultClassName: "teacher-instructions",
634
+ prompt: x
635
+ }), A = [];
636
+ return g && A.push({ language: "spanish" }), y && A.push({ language: "special" }), /* @__PURE__ */ v(oe, {
637
+ extraCSSRules: u,
638
+ ref: (e) => {
639
+ this.containerRef = e;
640
+ },
641
+ children: [
642
+ /* @__PURE__ */ _($, { children: "Constructed Response Question" }),
643
+ x && /* @__PURE__ */ _(ce, { children: r ? k : /* @__PURE__ */ _(Y, {
644
+ labels: {
645
+ hidden: "Show Teacher Instructions",
646
+ visible: "Hide Teacher Instructions"
647
+ },
648
+ children: k
649
+ }) }),
650
+ h && /* @__PURE__ */ _(se, {
651
+ component: "span",
652
+ children: /* @__PURE__ */ _(J, {
653
+ defaultClassName: "prompt",
654
+ prompt: e.prompt
655
+ })
656
+ }),
657
+ i ? /* @__PURE__ */ _(W, {
658
+ text: w || "",
659
+ annotations: S || [],
660
+ comment: C || "",
661
+ predefinedAnnotations: m || [],
662
+ onChange: n,
663
+ onCommentChange: this.changeSessionComment,
664
+ width: T,
665
+ height: E,
666
+ maxHeight: D,
667
+ disabled: c,
668
+ disabledMath: !f,
669
+ customKeys: a,
670
+ keypadMode: l
671
+ }) : /* @__PURE__ */ _(le, {
672
+ className: "response-area-editor",
673
+ onChange: this.changeSessionValue,
674
+ markup: w || "",
675
+ maxWidth: T && T.toString(),
676
+ minWidth: "100px",
677
+ minHeight: E && E.toString(),
678
+ maxHeight: D,
679
+ disabled: s,
680
+ highlightShape: !0,
681
+ toolbarOpts: O,
682
+ spellCheck: b,
683
+ charactersLimit: 5e4,
684
+ autoWidthToolbar: !0,
685
+ pluginProps: {
686
+ math: {
687
+ disabled: !f,
688
+ customKeys: this.props.model.customKeys,
689
+ keypadMode: this.props.model.equationEditor,
690
+ controlledKeypadMode: !1
691
+ },
692
+ video: { disabled: !0 },
693
+ audio: { disabled: !0 },
694
+ table: { disabled: !0 },
695
+ textAlign: { disabled: !0 },
696
+ h3: { disabled: !0 },
697
+ separateParagraphs: { disabled: !1 },
698
+ ul_list: { disabled: !0 },
699
+ ol_list: { disabled: !0 }
700
+ },
701
+ languageCharactersProps: A
702
+ }),
703
+ d && /* @__PURE__ */ _(ie, {
704
+ correctness: "correct",
705
+ feedback: d
706
+ })
707
+ ]
708
+ });
709
+ }
710
+ };
711
+ //#endregion
712
+ export { ue as t };
713
+
714
+ //# sourceMappingURL=main-C2oHx_V9.js.map