@pie-element/inline-dropdown 10.1.1-next.0 → 10.1.1-next.101

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 (247) hide show
  1. package/CHANGELOG.json +1082 -0
  2. package/CHANGELOG.md +2181 -0
  3. package/LICENSE.md +5 -0
  4. package/README.md +1 -0
  5. package/configure/CHANGELOG.json +647 -0
  6. package/configure/CHANGELOG.md +1938 -0
  7. package/configure/lib/defaults.js +192 -0
  8. package/configure/lib/defaults.js.map +1 -0
  9. package/configure/lib/index.js +139 -0
  10. package/configure/lib/index.js.map +1 -0
  11. package/configure/lib/inline-dropdown-toolbar.js +462 -0
  12. package/configure/lib/inline-dropdown-toolbar.js.map +1 -0
  13. package/configure/lib/main.js +612 -0
  14. package/configure/lib/main.js.map +1 -0
  15. package/configure/lib/markupUtils.js +50 -0
  16. package/configure/lib/markupUtils.js.map +1 -0
  17. package/configure/lib/response-area.js +48 -0
  18. package/configure/lib/response-area.js.map +1 -0
  19. package/configure/lib/utils.js +22 -0
  20. package/configure/lib/utils.js.map +1 -0
  21. package/configure/package.json +24 -0
  22. package/controller/CHANGELOG.json +467 -0
  23. package/controller/CHANGELOG.md +1279 -0
  24. package/controller/lib/defaults.js +25 -0
  25. package/controller/lib/defaults.js.map +1 -0
  26. package/controller/lib/index.js +295 -0
  27. package/controller/lib/index.js.map +1 -0
  28. package/controller/lib/utils.js +32 -0
  29. package/controller/lib/utils.js.map +1 -0
  30. package/controller/package.json +16 -0
  31. package/docs/config-schema.json +2854 -0
  32. package/docs/config-schema.json.md +2106 -0
  33. package/docs/demo/config.js +8 -0
  34. package/docs/demo/generate.js +76 -0
  35. package/docs/demo/index.html +1 -0
  36. package/docs/demo/session.js +11 -0
  37. package/docs/pie-schema.json +1152 -0
  38. package/docs/pie-schema.json.md +814 -0
  39. package/lib/index.js +86 -0
  40. package/lib/index.js.map +1 -0
  41. package/lib/inline-dropdown.js +176 -0
  42. package/lib/inline-dropdown.js.map +1 -0
  43. package/package.json +20 -57
  44. package/dist/author/defaults.d.ts +0 -194
  45. package/dist/author/defaults.js +0 -130
  46. package/dist/author/index.d.ts +0 -43
  47. package/dist/author/index.js +0 -83
  48. package/dist/author/inline-dropdown-toolbar.d.ts +0 -48
  49. package/dist/author/inline-dropdown-toolbar.js +0 -269
  50. package/dist/author/main.d.ts +0 -49
  51. package/dist/author/main.js +0 -384
  52. package/dist/author/markupUtils.d.ts +0 -12
  53. package/dist/author/markupUtils.js +0 -23
  54. package/dist/author/response-area.d.ts +0 -20
  55. package/dist/author/response-area.js +0 -32
  56. package/dist/author/utils.d.ts +0 -10
  57. package/dist/author/utils.js +0 -10
  58. package/dist/controller/defaults.d.ts +0 -27
  59. package/dist/controller/defaults.js +0 -21
  60. package/dist/controller/index.d.ts +0 -54
  61. package/dist/controller/index.js +0 -126
  62. package/dist/controller/utils.d.ts +0 -12
  63. package/dist/controller/utils.js +0 -13
  64. package/dist/delivery/index.d.ts +0 -20
  65. package/dist/delivery/index.js +0 -60
  66. package/dist/delivery/inline-dropdown.d.ts +0 -38
  67. package/dist/delivery/inline-dropdown.js +0 -109
  68. package/dist/index.d.ts +0 -1
  69. package/dist/index.iife.d.ts +0 -8
  70. package/dist/index.iife.js +0 -148
  71. package/dist/index.js +0 -2
  72. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_DataView.js +0 -6
  73. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Hash.js +0 -16
  74. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_ListCache.js +0 -16
  75. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Map.js +0 -6
  76. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_MapCache.js +0 -16
  77. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Promise.js +0 -6
  78. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Set.js +0 -6
  79. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_SetCache.js +0 -11
  80. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Stack.js +0 -14
  81. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Symbol.js +0 -5
  82. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_Uint8Array.js +0 -5
  83. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_WeakMap.js +0 -6
  84. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_apply.js +0 -12
  85. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayEach.js +0 -7
  86. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayFilter.js +0 -10
  87. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayLikeKeys.js +0 -15
  88. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayMap.js +0 -7
  89. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayPush.js +0 -7
  90. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arrayReduce.js +0 -8
  91. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_arraySome.js +0 -7
  92. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assignValue.js +0 -10
  93. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_assocIndexOf.js +0 -8
  94. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssign.js +0 -8
  95. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignIn.js +0 -8
  96. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseAssignValue.js +0 -12
  97. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseClone.js +0 -57
  98. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseCreate.js +0 -14
  99. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseEach.js +0 -6
  100. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseExtremum.js +0 -11
  101. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseFor.js +0 -5
  102. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseForOwn.js +0 -8
  103. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGet.js +0 -10
  104. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetAllKeys.js +0 -9
  105. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGetTag.js +0 -10
  106. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseGt.js +0 -6
  107. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseHasIn.js +0 -6
  108. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsArguments.js +0 -9
  109. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqual.js +0 -8
  110. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsEqualDeep.js +0 -30
  111. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsMap.js +0 -9
  112. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsMatch.js +0 -26
  113. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsNative.js +0 -11
  114. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsSet.js +0 -9
  115. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIsTypedArray.js +0 -11
  116. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseIteratee.js +0 -11
  117. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeys.js +0 -12
  118. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseKeysIn.js +0 -13
  119. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseMap.js +0 -11
  120. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseMatches.js +0 -12
  121. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseMatchesProperty.js +0 -17
  122. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseProperty.js +0 -8
  123. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_basePropertyDeep.js +0 -9
  124. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_basePropertyOf.js +0 -8
  125. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseReduce.js +0 -8
  126. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseRest.js +0 -9
  127. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseSetToString.js +0 -14
  128. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseTimes.js +0 -7
  129. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseToString.js +0 -15
  130. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_baseUnary.js +0 -8
  131. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cacheHas.js +0 -6
  132. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_castFunction.js +0 -7
  133. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_castPath.js +0 -10
  134. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneArrayBuffer.js +0 -8
  135. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneBuffer.js +0 -10
  136. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneDataView.js +0 -8
  137. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneRegExp.js +0 -8
  138. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneSymbol.js +0 -8
  139. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_cloneTypedArray.js +0 -8
  140. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyArray.js +0 -8
  141. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copyObject.js +0 -14
  142. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbols.js +0 -8
  143. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_copySymbolsIn.js +0 -8
  144. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_coreJsData.js +0 -5
  145. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createBaseEach.js +0 -12
  146. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_createBaseFor.js +0 -12
  147. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_defineProperty.js +0 -10
  148. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalArrays.js +0 -35
  149. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalByTag.js +0 -35
  150. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_equalObjects.js +0 -32
  151. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_escapeHtmlChar.js +0 -11
  152. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_freeGlobal.js +0 -4
  153. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeys.js +0 -9
  154. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getAllKeysIn.js +0 -9
  155. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getMapData.js +0 -8
  156. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getMatchData.js +0 -16
  157. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getNative.js +0 -9
  158. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getPrototype.js +0 -5
  159. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getRawTag.js +0 -14
  160. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbols.js +0 -10
  161. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getSymbolsIn.js +0 -11
  162. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getTag.js +0 -23
  163. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_getValue.js +0 -6
  164. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hasPath.js +0 -18
  165. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashClear.js +0 -7
  166. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashDelete.js +0 -7
  167. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashGet.js +0 -13
  168. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashHas.js +0 -9
  169. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_hashSet.js +0 -9
  170. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneArray.js +0 -8
  171. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneByTag.js +0 -33
  172. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_initCloneObject.js +0 -9
  173. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIndex.js +0 -8
  174. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isIterateeCall.js +0 -12
  175. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKey.js +0 -11
  176. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isKeyable.js +0 -7
  177. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isMasked.js +0 -11
  178. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isPrototype.js +0 -8
  179. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_isStrictComparable.js +0 -7
  180. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheClear.js +0 -6
  181. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheDelete.js +0 -9
  182. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheGet.js +0 -8
  183. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheHas.js +0 -7
  184. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_listCacheSet.js +0 -8
  185. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheClear.js +0 -13
  186. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheDelete.js +0 -8
  187. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheGet.js +0 -7
  188. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheHas.js +0 -7
  189. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapCacheSet.js +0 -8
  190. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_mapToArray.js +0 -9
  191. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_matchesStrictComparable.js +0 -8
  192. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_memoizeCapped.js +0 -11
  193. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeCreate.js +0 -5
  194. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeys.js +0 -5
  195. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nativeKeysIn.js +0 -8
  196. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_nodeUtil.js +0 -9
  197. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_objectToString.js +0 -7
  198. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overArg.js +0 -8
  199. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_overRest.js +0 -13
  200. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_root.js +0 -5
  201. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheAdd.js +0 -7
  202. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setCacheHas.js +0 -6
  203. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setToArray.js +0 -9
  204. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_setToString.js +0 -6
  205. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_shortOut.js +0 -14
  206. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackClear.js +0 -7
  207. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackDelete.js +0 -7
  208. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackGet.js +0 -6
  209. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackHas.js +0 -6
  210. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stackSet.js +0 -16
  211. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_stringToPath.js +0 -10
  212. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toKey.js +0 -10
  213. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/_toSource.js +0 -15
  214. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/cloneDeep.js +0 -8
  215. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/constant.js +0 -8
  216. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/defaults.js +0 -16
  217. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/eq.js +0 -6
  218. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/escape.js +0 -9
  219. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/forEach.js +0 -10
  220. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/get.js +0 -8
  221. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/hasIn.js +0 -8
  222. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/identity.js +0 -6
  223. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArguments.js +0 -10
  224. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArray.js +0 -4
  225. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isArrayLike.js +0 -8
  226. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isBuffer.js +0 -6
  227. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEmpty.js +0 -21
  228. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isEqual.js +0 -7
  229. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isFunction.js +0 -11
  230. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isLength.js +0 -7
  231. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isMap.js +0 -7
  232. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObject.js +0 -7
  233. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isObjectLike.js +0 -6
  234. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSet.js +0 -7
  235. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isSymbol.js +0 -9
  236. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isTypedArray.js +0 -7
  237. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/isUndefined.js +0 -6
  238. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keys.js +0 -9
  239. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/keysIn.js +0 -9
  240. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/map.js +0 -10
  241. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/max.js +0 -9
  242. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/memoize.js +0 -16
  243. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/property.js +0 -10
  244. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/reduce.js +0 -12
  245. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubArray.js +0 -6
  246. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/stubFalse.js +0 -6
  247. package/dist/node_modules/.bun/lodash-es@4.18.1/node_modules/lodash-es/toString.js +0 -7
@@ -0,0 +1,192 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _default = exports.default = {
8
+ model: {
9
+ alternateResponse: {},
10
+ choiceRationaleEnabled: true,
11
+ choices: {},
12
+ disabled: false,
13
+ displayType: 'block',
14
+ markup: '',
15
+ mode: 'gather',
16
+ prompt: '',
17
+ promptEnabled: true,
18
+ rationale: '',
19
+ rationaleEnabled: true,
20
+ shuffle: true,
21
+ studentInstructionsEnabled: true,
22
+ teacherInstructions: '',
23
+ teacherInstructionsEnabled: true,
24
+ toolbarEditorPosition: 'bottom'
25
+ },
26
+ configuration: {
27
+ baseInputConfiguration: {
28
+ audio: {
29
+ disabled: false
30
+ },
31
+ video: {
32
+ disabled: false
33
+ },
34
+ image: {
35
+ disabled: false
36
+ },
37
+ h3: {
38
+ disabled: true
39
+ },
40
+ blockquote: {
41
+ disabled: true
42
+ },
43
+ textAlign: {
44
+ disabled: true
45
+ },
46
+ showParagraphs: {
47
+ disabled: false
48
+ },
49
+ separateParagraphs: {
50
+ disabled: true
51
+ }
52
+ },
53
+ prompt: {
54
+ settings: true,
55
+ label: 'Prompt',
56
+ required: false,
57
+ inputConfiguration: {
58
+ audio: {
59
+ disabled: false
60
+ },
61
+ video: {
62
+ disabled: false
63
+ },
64
+ image: {
65
+ disabled: false
66
+ }
67
+ }
68
+ },
69
+ responseAreaInputConfiguration: {
70
+ inputConfiguration: {
71
+ audio: {
72
+ disabled: true
73
+ },
74
+ video: {
75
+ disabled: true
76
+ },
77
+ image: {
78
+ disabled: true
79
+ },
80
+ table: {
81
+ disabled: true
82
+ },
83
+ ul_list: {
84
+ disabled: true
85
+ },
86
+ ol_list: {
87
+ disabled: true
88
+ }
89
+ }
90
+ },
91
+ settingsPanelDisabled: false,
92
+ spellCheck: {
93
+ label: 'Spellcheck',
94
+ settings: false,
95
+ enabled: true
96
+ },
97
+ lockChoiceOrder: {
98
+ settings: true,
99
+ label: 'Lock Choice Order'
100
+ },
101
+ partialScoring: {
102
+ settings: false,
103
+ label: 'Allow Partial Scoring'
104
+ },
105
+ rationale: {
106
+ settings: true,
107
+ label: 'Rationale',
108
+ required: false,
109
+ inputConfiguration: {
110
+ audio: {
111
+ disabled: false
112
+ },
113
+ video: {
114
+ disabled: false
115
+ },
116
+ image: {
117
+ disabled: false
118
+ },
119
+ textAlign: {
120
+ disabled: true
121
+ }
122
+ }
123
+ },
124
+ teacherInstructions: {
125
+ settings: true,
126
+ label: 'Teacher Instructions',
127
+ required: false,
128
+ inputConfiguration: {
129
+ audio: {
130
+ disabled: false
131
+ },
132
+ video: {
133
+ disabled: false
134
+ },
135
+ image: {
136
+ disabled: false
137
+ }
138
+ }
139
+ },
140
+ template: {
141
+ inputConfiguration: {
142
+ audio: {
143
+ disabled: false
144
+ },
145
+ video: {
146
+ disabled: false
147
+ },
148
+ image: {
149
+ disabled: false
150
+ }
151
+ }
152
+ },
153
+ choiceRationale: {
154
+ settings: true,
155
+ label: 'Choice Rationale'
156
+ },
157
+ toolbarEditorPosition: {
158
+ settings: false,
159
+ label: 'Toolbar Editor Position'
160
+ },
161
+ maxResponseAreas: 10,
162
+ maxResponseAreaChoices: 10,
163
+ maxImageWidth: {
164
+ teacherInstructions: 300,
165
+ prompt: 300,
166
+ rationale: 300
167
+ },
168
+ maxImageHeight: {
169
+ teacherInstructions: 300,
170
+ prompt: 300,
171
+ rationale: 300
172
+ },
173
+ withRubric: {
174
+ settings: false,
175
+ label: 'Add Rubric'
176
+ },
177
+ mathMlOptions: {
178
+ mmlOutput: false,
179
+ mmlEditing: false
180
+ },
181
+ language: {
182
+ settings: false,
183
+ label: 'Specify Language',
184
+ enabled: false
185
+ },
186
+ languageChoices: {
187
+ label: 'Language Choices',
188
+ options: []
189
+ }
190
+ }
191
+ };
192
+ //# sourceMappingURL=defaults.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaults.js","names":["model","alternateResponse","choiceRationaleEnabled","choices","disabled","displayType","markup","mode","prompt","promptEnabled","rationale","rationaleEnabled","shuffle","studentInstructionsEnabled","teacherInstructions","teacherInstructionsEnabled","toolbarEditorPosition","configuration","baseInputConfiguration","audio","video","image","h3","blockquote","textAlign","showParagraphs","separateParagraphs","settings","label","required","inputConfiguration","responseAreaInputConfiguration","table","ul_list","ol_list","settingsPanelDisabled","spellCheck","enabled","lockChoiceOrder","partialScoring","template","choiceRationale","maxResponseAreas","maxResponseAreaChoices","maxImageWidth","maxImageHeight","withRubric","mathMlOptions","mmlOutput","mmlEditing","language","languageChoices","options"],"sources":["../src/defaults.js"],"sourcesContent":["export default {\n model: {\n alternateResponse: {},\n choiceRationaleEnabled: true,\n choices: {},\n disabled: false,\n displayType: 'block',\n markup: '',\n mode: 'gather',\n prompt: '',\n promptEnabled: true,\n rationale: '',\n rationaleEnabled: true,\n shuffle: true,\n studentInstructionsEnabled: true,\n teacherInstructions: '',\n teacherInstructionsEnabled: true,\n toolbarEditorPosition: 'bottom',\n },\n configuration: {\n baseInputConfiguration: {\n audio: { disabled: false },\n video: { disabled: false },\n image: { disabled: false },\n h3: { disabled: true },\n blockquote: { disabled: true },\n textAlign: { disabled: true },\n showParagraphs: { disabled: false },\n separateParagraphs: { disabled: true },\n },\n prompt: {\n settings: true,\n label: 'Prompt',\n required: false,\n inputConfiguration: {\n audio: { disabled: false },\n video: { disabled: false },\n image: { disabled: false },\n },\n },\n responseAreaInputConfiguration: {\n inputConfiguration: {\n audio: { disabled: true },\n video: { disabled: true },\n image: { disabled: true },\n table: { disabled: true },\n ul_list: { disabled: true },\n ol_list: { disabled: true },\n },\n },\n settingsPanelDisabled: false,\n spellCheck: {\n label: 'Spellcheck',\n settings: false,\n enabled: true,\n },\n lockChoiceOrder: {\n settings: true,\n label: 'Lock Choice Order',\n },\n partialScoring: {\n settings: false,\n label: 'Allow Partial Scoring',\n },\n rationale: {\n settings: true,\n label: 'Rationale',\n required: false,\n inputConfiguration: {\n audio: { disabled: false },\n video: { disabled: false },\n image: { disabled: false },\n textAlign: { disabled: true },\n },\n },\n teacherInstructions: {\n settings: true,\n label: 'Teacher Instructions',\n required: false,\n inputConfiguration: {\n audio: { disabled: false },\n video: { disabled: false },\n image: { disabled: false },\n },\n },\n template: {\n inputConfiguration: {\n audio: { disabled: false },\n video: { disabled: false },\n image: { disabled: false },\n },\n },\n choiceRationale: {\n settings: true,\n label: 'Choice Rationale',\n },\n toolbarEditorPosition: {\n settings: false,\n label: 'Toolbar Editor Position',\n },\n maxResponseAreas: 10,\n maxResponseAreaChoices: 10,\n maxImageWidth: {\n teacherInstructions: 300,\n prompt: 300,\n rationale: 300,\n },\n maxImageHeight: {\n teacherInstructions: 300,\n prompt: 300,\n rationale: 300,\n },\n withRubric: {\n settings: false,\n label: 'Add Rubric',\n },\n mathMlOptions: {\n mmlOutput: false,\n mmlEditing: false,\n },\n language: {\n settings: false,\n label: 'Specify Language',\n enabled: false,\n },\n languageChoices: {\n label: 'Language Choices',\n options: [],\n },\n },\n};\n"],"mappings":";;;;;;iCAAe;EACbA,KAAK,EAAE;IACLC,iBAAiB,EAAE,CAAC,CAAC;IACrBC,sBAAsB,EAAE,IAAI;IAC5BC,OAAO,EAAE,CAAC,CAAC;IACXC,QAAQ,EAAE,KAAK;IACfC,WAAW,EAAE,OAAO;IACpBC,MAAM,EAAE,EAAE;IACVC,IAAI,EAAE,QAAQ;IACdC,MAAM,EAAE,EAAE;IACVC,aAAa,EAAE,IAAI;IACnBC,SAAS,EAAE,EAAE;IACbC,gBAAgB,EAAE,IAAI;IACtBC,OAAO,EAAE,IAAI;IACbC,0BAA0B,EAAE,IAAI;IAChCC,mBAAmB,EAAE,EAAE;IACvBC,0BAA0B,EAAE,IAAI;IAChCC,qBAAqB,EAAE;EACzB,CAAC;EACDC,aAAa,EAAE;IACbC,sBAAsB,EAAE;MACtBC,KAAK,EAAE;QAAEf,QAAQ,EAAE;MAAM,CAAC;MAC1BgB,KAAK,EAAE;QAAEhB,QAAQ,EAAE;MAAM,CAAC;MAC1BiB,KAAK,EAAE;QAAEjB,QAAQ,EAAE;MAAM,CAAC;MAC1BkB,EAAE,EAAE;QAAElB,QAAQ,EAAE;MAAK,CAAC;MACtB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EAAE,KAAK;MACfC,KAAK,EAAE;IACT,CAAC;IACDmB,aAAa,EAAE;MACbC,SAAS,EAAE,KAAK;MAChBC,UAAU,EAAE;IACd,CAAC;IACDC,QAAQ,EAAE;MACRvB,QAAQ,EAAE,KAAK;MACfC,KAAK,EAAE,kBAAkB;MACzBS,OAAO,EAAE;IACX,CAAC;IACDc,eAAe,EAAE;MACfvB,KAAK,EAAE,kBAAkB;MACzBwB,OAAO,EAAE;IACX;EACF;AACF,CAAC","ignoreList":[]}
@@ -0,0 +1,139 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = void 0;
8
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
+ var _pieConfigureEvents = require("@pie-framework/pie-configure-events");
10
+ var _react = _interopRequireDefault(require("react"));
11
+ var _client = require("react-dom/client");
12
+ var _main = _interopRequireDefault(require("./main"));
13
+ var _debug = _interopRequireDefault(require("debug"));
14
+ var _lodashEs = require("lodash-es");
15
+ var _defaults = _interopRequireDefault(require("./defaults"));
16
+ var _markupUtils = require("./markupUtils");
17
+ const log = (0, _debug.default)('multiple-choice:configure');
18
+ class InlineDropdown extends HTMLElement {
19
+ constructor() {
20
+ super();
21
+ this._root = null;
22
+ this._model = InlineDropdown.prepareModel();
23
+ this._configuration = _defaults.default.configuration;
24
+ this.onModelChanged = this.onModelChanged.bind(this);
25
+ this.onConfigurationChanged = this.onConfigurationChanged.bind(this);
26
+ }
27
+ set model(s) {
28
+ this._model = InlineDropdown.prepareModel(s);
29
+ this._render();
30
+ }
31
+ set configuration(c) {
32
+ this._configuration = (0, _lodashEs.defaults)(c, _defaults.default.configuration);
33
+
34
+ // if language:enabled is true, then the corresponding default item model should include a language value;
35
+ // if it is false, then the language field should be omitted from the item model.
36
+ // if a default item model includes a language value (e.g., en_US) and the corresponding authoring view settings have language:settings = true,
37
+ // then (a) language:enabled should also be true, and (b) that default language value should be represented in languageChoices[] (as a key).
38
+ if (c.language?.enabled) {
39
+ if (c.languageChoices?.options?.length) {
40
+ this._model.language = c.languageChoices.options[0].value;
41
+ }
42
+ } else if (c.language.settings && this._model.language) {
43
+ this._configuration.language.enabled = true;
44
+ if (!this._configuration.languageChoices.options || !this._configuration.languageChoices.options.length) {
45
+ this._configuration.languageChoices.options = [];
46
+ }
47
+
48
+ // check if the language is already included in the languageChoices.options array
49
+ // and if not, then add it.
50
+ if (!this._configuration.languageChoices.options.find(option => option.value === this._model.language)) {
51
+ this._configuration.languageChoices.options.push({
52
+ value: this._model.language,
53
+ label: this._model.language
54
+ });
55
+ }
56
+ } else {
57
+ delete this._model.language;
58
+ }
59
+ this._render();
60
+ }
61
+ set disableSidePanel(s) {
62
+ this._disableSidePanel = s;
63
+ this._render();
64
+ }
65
+ dispatchModelUpdated(reset) {
66
+ const resetValue = !!reset;
67
+ this.dispatchEvent(new _pieConfigureEvents.ModelUpdatedEvent(this._model, resetValue));
68
+ }
69
+ onModelChanged(m, reset) {
70
+ this._model = InlineDropdown.prepareModel(m);
71
+ this._render();
72
+ this.dispatchModelUpdated(reset);
73
+ }
74
+ onConfigurationChanged(c) {
75
+ this._configuration = c;
76
+ this._render();
77
+ }
78
+
79
+ /** @param {done, progress, file} handler */
80
+ insertImage(handler) {
81
+ this.dispatchEvent(new _pieConfigureEvents.InsertImageEvent(handler));
82
+ }
83
+ onDeleteImage(src, done) {
84
+ this.dispatchEvent(new _pieConfigureEvents.DeleteImageEvent(src, done));
85
+ }
86
+ insertSound(handler) {
87
+ this.dispatchEvent(new _pieConfigureEvents.InsertSoundEvent(handler));
88
+ }
89
+ onDeleteSound(src, done) {
90
+ this.dispatchEvent(new _pieConfigureEvents.DeleteSoundEvent(src, done));
91
+ }
92
+ _render() {
93
+ log('_render');
94
+ let element = /*#__PURE__*/_react.default.createElement(_main.default, {
95
+ model: this._model,
96
+ configuration: this._configuration,
97
+ onModelChanged: this.onModelChanged,
98
+ onConfigurationChanged: this.onConfigurationChanged,
99
+ disableSidePanel: this._disableSidePanel,
100
+ imageSupport: {
101
+ add: this.insertImage.bind(this),
102
+ delete: this.onDeleteImage.bind(this)
103
+ },
104
+ uploadSoundSupport: {
105
+ add: this.insertSound.bind(this),
106
+ delete: this.onDeleteSound.bind(this)
107
+ }
108
+ });
109
+ if (!this._root) {
110
+ this._root = (0, _client.createRoot)(this);
111
+ }
112
+ this._root.render(element);
113
+ }
114
+ connectedCallback() {
115
+ this._render();
116
+ }
117
+ disconnectedCallback() {
118
+ if (this._root) {
119
+ this._root.unmount();
120
+ this._root = null;
121
+ }
122
+ }
123
+ }
124
+ exports.default = InlineDropdown;
125
+ (0, _defineProperty2.default)(InlineDropdown, "prepareModel", (model = {}) => {
126
+ const currModal = {
127
+ ..._defaults.default.model,
128
+ ...model
129
+ };
130
+ const slateMarkup = model.slateMarkup || (0, _markupUtils.createSlateMarkup)(currModal.markup, currModal.choices);
131
+ const markup = (0, _markupUtils.processMarkup)(slateMarkup);
132
+ return {
133
+ ...currModal,
134
+ slateMarkup,
135
+ markup
136
+ /*...processedMarkup,*/
137
+ };
138
+ });
139
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["_pieConfigureEvents","require","_react","_interopRequireDefault","_client","_main","_debug","_lodashEs","_defaults","_markupUtils","log","debug","InlineDropdown","HTMLElement","constructor","_root","_model","prepareModel","_configuration","sensibleDefaults","configuration","onModelChanged","bind","onConfigurationChanged","model","s","_render","c","defaults","language","enabled","languageChoices","options","length","value","settings","find","option","push","label","disableSidePanel","_disableSidePanel","dispatchModelUpdated","reset","resetValue","dispatchEvent","ModelUpdatedEvent","m","insertImage","handler","InsertImageEvent","onDeleteImage","src","done","DeleteImageEvent","insertSound","InsertSoundEvent","onDeleteSound","DeleteSoundEvent","element","React","createElement","Main","imageSupport","add","delete","uploadSoundSupport","createRoot","render","connectedCallback","disconnectedCallback","unmount","exports","default","_defineProperty2","currModal","slateMarkup","createSlateMarkup","markup","choices","processMarkup"],"sources":["../src/index.js"],"sourcesContent":["import {\n ModelUpdatedEvent,\n DeleteImageEvent,\n InsertImageEvent,\n InsertSoundEvent,\n DeleteSoundEvent,\n} from '@pie-framework/pie-configure-events';\n\nimport React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport Main from './main';\nimport debug from 'debug';\nimport { defaults } from 'lodash-es';\n\nimport sensibleDefaults from './defaults';\nimport { processMarkup, createSlateMarkup } from './markupUtils';\n\nconst log = debug('multiple-choice:configure');\n\nexport default class InlineDropdown extends HTMLElement {\n static prepareModel = (model = {}) => {\n const currModal = {\n ...sensibleDefaults.model,\n ...model,\n };\n const slateMarkup = model.slateMarkup || createSlateMarkup(currModal.markup, currModal.choices);\n const markup = processMarkup(slateMarkup);\n\n return {\n ...currModal,\n slateMarkup,\n markup,\n /*...processedMarkup,*/\n };\n };\n\n constructor() {\n super();\n this._root = null;\n this._model = InlineDropdown.prepareModel();\n this._configuration = sensibleDefaults.configuration;\n this.onModelChanged = this.onModelChanged.bind(this);\n this.onConfigurationChanged = this.onConfigurationChanged.bind(this);\n }\n\n set model(s) {\n this._model = InlineDropdown.prepareModel(s);\n this._render();\n }\n\n set configuration(c) {\n this._configuration = defaults(c, sensibleDefaults.configuration);\n\n // if language:enabled is true, then the corresponding default item model should include a language value;\n // if it is false, then the language field should be omitted from the item model.\n // if a default item model includes a language value (e.g., en_US) and the corresponding authoring view settings have language:settings = true,\n // then (a) language:enabled should also be true, and (b) that default language value should be represented in languageChoices[] (as a key).\n if (c.language?.enabled) {\n if (c.languageChoices?.options?.length) {\n this._model.language = c.languageChoices.options[0].value;\n }\n } else if (c.language.settings && this._model.language) {\n this._configuration.language.enabled = true;\n\n if (!this._configuration.languageChoices.options || !this._configuration.languageChoices.options.length) {\n this._configuration.languageChoices.options = [];\n }\n\n // check if the language is already included in the languageChoices.options array\n // and if not, then add it.\n if (!this._configuration.languageChoices.options.find(option => option.value === this._model.language)) {\n this._configuration.languageChoices.options.push({\n value: this._model.language,\n label: this._model.language,\n });\n }\n } else {\n delete this._model.language;\n }\n\n this._render();\n }\n\n set disableSidePanel(s) {\n this._disableSidePanel = s;\n this._render();\n }\n\n dispatchModelUpdated(reset) {\n const resetValue = !!reset;\n\n this.dispatchEvent(new ModelUpdatedEvent(this._model, resetValue));\n }\n\n onModelChanged(m, reset) {\n this._model = InlineDropdown.prepareModel(m);\n this._render();\n this.dispatchModelUpdated(reset);\n }\n\n onConfigurationChanged(c) {\n this._configuration = c;\n this._render();\n }\n\n /** @param {done, progress, file} handler */\n insertImage(handler) {\n this.dispatchEvent(new InsertImageEvent(handler));\n }\n\n onDeleteImage(src, done) {\n this.dispatchEvent(new DeleteImageEvent(src, done));\n }\n\n insertSound(handler) {\n this.dispatchEvent(new InsertSoundEvent(handler));\n }\n\n onDeleteSound(src, done) {\n this.dispatchEvent(new DeleteSoundEvent(src, done));\n }\n\n _render() {\n log('_render');\n let element = React.createElement(Main, {\n model: this._model,\n configuration: this._configuration,\n onModelChanged: this.onModelChanged,\n onConfigurationChanged: this.onConfigurationChanged,\n disableSidePanel: this._disableSidePanel,\n imageSupport: {\n add: this.insertImage.bind(this),\n delete: this.onDeleteImage.bind(this),\n },\n uploadSoundSupport: {\n add: this.insertSound.bind(this),\n delete: this.onDeleteSound.bind(this),\n },\n });\n if (!this._root) {\n this._root = createRoot(this);\n }\n this._root.render(element);\n }\n\n connectedCallback() {\n this._render();\n }\n\n disconnectedCallback() {\n if (this._root) {\n this._root.unmount();\n this._root = null;\n }\n }\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,mBAAA,GAAAC,OAAA;AAQA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,MAAA,GAAAH,sBAAA,CAAAF,OAAA;AACA,IAAAM,SAAA,GAAA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