@venite/components 0.16.7 → 0.16.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (729) hide show
  1. package/dist/cjs/_commonjsHelpers-bcc1208a.js +25 -0
  2. package/dist/cjs/animation-34a434a2.js +957 -0
  3. package/dist/cjs/app-globals-60a4f972.js +7 -0
  4. package/dist/cjs/book-1a92678a.js +287 -0
  5. package/dist/cjs/change-cdb1e8c0.js +16 -0
  6. package/dist/cjs/cubic-bezier-f3b34d27.js +91 -0
  7. package/dist/cjs/cursor-81bfd01e.js +12 -0
  8. package/dist/cjs/focus-visible-5621d6b1.js +45 -0
  9. package/dist/cjs/framework-delegate-84d33ff0.js +37 -0
  10. package/dist/cjs/gesture-controller-5bd9d825.js +193 -0
  11. package/dist/cjs/haptic-88c261ab.js +49 -0
  12. package/dist/cjs/hardware-back-button-8c2f48d2.js +59 -0
  13. package/dist/cjs/heading-5afc2b24.js +21 -0
  14. package/dist/cjs/helpers-41dfb43a.js +110 -0
  15. package/dist/cjs/image-3bee3e73.js +21 -0
  16. package/dist/cjs/index-1a73a70c.js +211 -0
  17. package/dist/cjs/index-4b7e4228.js +135 -0
  18. package/dist/cjs/index-7aa21373.js +92 -0
  19. package/dist/cjs/index-8197bb45.js +441 -0
  20. package/dist/{ldf/index-ea7a35b9.js → cjs/index-8fe0df8d.js} +213 -1242
  21. package/dist/cjs/index-c5bdf2bc.js +167 -0
  22. package/dist/cjs/index-de13bd01.js +463 -0
  23. package/dist/cjs/index-e4c51e4d.js +307 -0
  24. package/dist/cjs/index.cjs.js +8 -0
  25. package/dist/cjs/input-shims-9c2d56bd.js +357 -0
  26. package/dist/cjs/ion-action-sheet.cjs.entry.js +230 -0
  27. package/dist/cjs/ion-alert.cjs.entry.js +386 -0
  28. package/dist/cjs/ion-app.cjs.entry.js +60 -0
  29. package/dist/cjs/ion-avatar.cjs.entry.js +25 -0
  30. package/dist/cjs/ion-back-button.cjs.entry.js +79 -0
  31. package/dist/cjs/ion-backdrop.cjs.entry.js +67 -0
  32. package/dist/cjs/ion-badge.cjs.entry.js +27 -0
  33. package/dist/cjs/ion-button_13.cjs.entry.js +1786 -0
  34. package/dist/cjs/ion-card-content_6.cjs.entry.js +405 -0
  35. package/dist/cjs/ion-card-subtitle.cjs.entry.js +27 -0
  36. package/dist/cjs/ion-card_2.cjs.entry.js +91 -0
  37. package/dist/cjs/ion-checkbox_3.cjs.entry.js +234 -0
  38. package/dist/cjs/ion-chip.cjs.entry.js +31 -0
  39. package/dist/cjs/ion-datetime_2.cjs.entry.js +1125 -0
  40. package/dist/cjs/ion-fab-button.cjs.entry.js +74 -0
  41. package/dist/cjs/ion-fab-list.cjs.entry.js +45 -0
  42. package/dist/cjs/ion-fab.cjs.entry.js +74 -0
  43. package/dist/cjs/ion-footer.cjs.entry.js +43 -0
  44. package/dist/cjs/ion-img.cjs.entry.js +72 -0
  45. package/dist/cjs/ion-infinite-scroll-content.cjs.entry.js +37 -0
  46. package/dist/cjs/ion-infinite-scroll.cjs.entry.js +206 -0
  47. package/dist/cjs/ion-input_2.cjs.entry.js +2645 -0
  48. package/dist/cjs/ion-item-divider.cjs.entry.js +36 -0
  49. package/dist/cjs/ion-item-group.cjs.entry.js +31 -0
  50. package/dist/cjs/ion-item-option.cjs.entry.js +55 -0
  51. package/dist/cjs/ion-item-options.cjs.entry.js +47 -0
  52. package/dist/cjs/ion-item-sliding.cjs.entry.js +359 -0
  53. package/dist/cjs/ion-list-header.cjs.entry.js +28 -0
  54. package/dist/cjs/ion-loading.cjs.entry.js +213 -0
  55. package/dist/cjs/ion-menu-button.cjs.entry.js +61 -0
  56. package/dist/cjs/ion-menu-toggle.cjs.entry.js +47 -0
  57. package/dist/cjs/ion-menu.cjs.entry.js +456 -0
  58. package/dist/cjs/ion-modal.cjs.entry.js +488 -0
  59. package/dist/cjs/ion-nav-link.cjs.entry.js +44 -0
  60. package/dist/cjs/ion-nav.cjs.entry.js +812 -0
  61. package/dist/cjs/ion-note.cjs.entry.js +27 -0
  62. package/dist/cjs/ion-picker-column.cjs.entry.js +327 -0
  63. package/dist/cjs/ion-picker.cjs.entry.js +214 -0
  64. package/dist/cjs/ion-popover.cjs.entry.js +363 -0
  65. package/dist/cjs/ion-progress-bar.cjs.entry.js +67 -0
  66. package/dist/cjs/ion-radio_2.cjs.entry.js +149 -0
  67. package/dist/cjs/ion-range.cjs.entry.js +395 -0
  68. package/dist/cjs/ion-refresher-content.cjs.entry.js +40 -0
  69. package/dist/cjs/ion-refresher.cjs.entry.js +832 -0
  70. package/dist/cjs/ion-reorder-group.cjs.entry.js +281 -0
  71. package/dist/cjs/ion-reorder.cjs.entry.js +31 -0
  72. package/dist/cjs/ion-route-redirect.cjs.entry.js +24 -0
  73. package/dist/cjs/ion-route.cjs.entry.js +49 -0
  74. package/dist/cjs/ion-router-link.cjs.entry.js +35 -0
  75. package/dist/cjs/ion-router-outlet.cjs.entry.js +160 -0
  76. package/dist/cjs/ion-router.cjs.entry.js +631 -0
  77. package/dist/cjs/ion-segment_16.cjs.entry.js +2507 -0
  78. package/dist/cjs/ion-select-popover.cjs.entry.js +33 -0
  79. package/dist/cjs/ion-select_2.cjs.entry.js +444 -0
  80. package/dist/cjs/ion-slide.cjs.entry.js +25 -0
  81. package/dist/cjs/ion-slides.cjs.entry.js +404 -0
  82. package/dist/cjs/ion-spinner.cjs.entry.js +60 -0
  83. package/dist/cjs/ion-split-pane.cjs.entry.js +150 -0
  84. package/dist/cjs/ion-tab-bar.cjs.entry.js +58 -0
  85. package/dist/cjs/ion-tab-button.cjs.entry.js +99 -0
  86. package/dist/cjs/ion-tab.cjs.entry.js +58 -0
  87. package/dist/cjs/ion-tabs.cjs.entry.js +155 -0
  88. package/dist/cjs/ion-text.cjs.entry.js +22 -0
  89. package/dist/cjs/ion-textarea.cjs.entry.js +217 -0
  90. package/dist/cjs/ion-thumbnail.cjs.entry.js +20 -0
  91. package/dist/cjs/ion-toast.cjs.entry.js +280 -0
  92. package/dist/cjs/ion-virtual-scroll.cjs.entry.js +544 -0
  93. package/dist/cjs/ionic-global-581fb4f8.js +204 -0
  94. package/dist/cjs/ios.transition-7244ac4e.js +459 -0
  95. package/dist/cjs/ldf-day-name_5.cjs.entry.js +5682 -0
  96. package/dist/cjs/ldf-editable-add-block-menu.cjs.entry.js +573 -0
  97. package/dist/cjs/ldf-editable-condition-piece.cjs.entry.js +220 -0
  98. package/dist/cjs/ldf-editable-condition.cjs.entry.js +106 -0
  99. package/dist/cjs/ldf-editable-filter-documents.cjs.entry.js +152 -0
  100. package/dist/cjs/ldf-editable-lookup_2.cjs.entry.js +496 -0
  101. package/dist/cjs/ldf-editable-metadata.cjs.entry.js +186 -0
  102. package/dist/cjs/ldf-editable-preference-option.cjs.entry.js +72 -0
  103. package/dist/cjs/ldf-editable-preference.cjs.entry.js +89 -0
  104. package/dist/cjs/ldf-editable-preferences.cjs.entry.js +200 -0
  105. package/dist/cjs/ldf-editable-string-list.cjs.entry.js +134 -0
  106. package/dist/cjs/ldf-editor-cursors.cjs.entry.js +276 -0
  107. package/dist/cjs/ldf-editor.cjs.entry.js +238 -0
  108. package/dist/cjs/ldf.cjs.js +22 -0
  109. package/dist/cjs/loader.cjs.js +24 -0
  110. package/dist/cjs/locale-d4e925b1.js +8 -0
  111. package/dist/cjs/md.transition-d86b1ef0.js +62 -0
  112. package/dist/cjs/menu-toggle-util-293e388b.js +11 -0
  113. package/dist/cjs/option-24f3d13a.js +167 -0
  114. package/dist/cjs/overlays-eb464d6d.js +228 -0
  115. package/dist/cjs/preference-a4bd51c4.js +23 -0
  116. package/dist/cjs/refrain-91fb446b.js +21 -0
  117. package/dist/cjs/rubric-5b467a6a.js +1220 -0
  118. package/dist/cjs/specific-class-a1112e78.js +38 -0
  119. package/dist/cjs/spinner-configs-b0bec093.js +112 -0
  120. package/dist/cjs/status-tap-7afb25f5.js +25 -0
  121. package/dist/cjs/swipe-back-f887168e.js +52 -0
  122. package/dist/cjs/swiper.bundle-cb0f61f7.js +6246 -0
  123. package/dist/cjs/tap-click-e0af5237.js +169 -0
  124. package/dist/cjs/text-5edb80f3.js +18 -0
  125. package/dist/cjs/theme-81caa5b0.js +47 -0
  126. package/dist/collection/collection-manifest.json +146 -0
  127. package/dist/collection/components/bible-reading/bible-reading.css +84 -0
  128. package/dist/collection/components/bible-reading/bible-reading.i18n.en.json +13 -0
  129. package/dist/collection/components/bible-reading/bible-reading.i18n.es.json +4 -0
  130. package/dist/collection/components/bible-reading/bible-reading.js +328 -0
  131. package/dist/collection/components/bible-reading/dist/bible-reading.js +354 -0
  132. package/dist/collection/components/bible-reading/fetch-reading.js +17 -0
  133. package/dist/collection/components/day-name/day-name.css +18 -0
  134. package/dist/collection/components/day-name/day-name.i18n.en.json +4 -0
  135. package/dist/{ldf/ldf-day-name.entry.js → collection/components/day-name/day-name.js} +54 -27
  136. package/dist/collection/components/editable-add-block/editable-add-block.css +93 -0
  137. package/dist/collection/components/editable-add-block/editable-add-block.i18n.en.json +5 -0
  138. package/dist/collection/components/editable-add-block/editable-add-block.js +135 -0
  139. package/dist/collection/components/editable-add-block-menu/dist/menu-options.js +230 -0
  140. package/dist/collection/components/editable-add-block-menu/editable-add-block-menu.css +33 -0
  141. package/dist/collection/components/editable-add-block-menu/editable-add-block-menu.i18n.en.json +48 -0
  142. package/dist/collection/components/editable-add-block-menu/editable-add-block-menu.js +101 -0
  143. package/dist/collection/components/editable-add-block-menu/menu-options.js +423 -0
  144. package/dist/collection/components/editable-antiphon-field/editable-antiphon-field.i18n.en.json +11 -0
  145. package/dist/collection/components/editable-antiphon-field/editable-antiphon-field.js +332 -0
  146. package/dist/collection/components/editable-antiphon-field/ldf-editable-antiphon-field.css +7 -0
  147. package/dist/collection/components/editable-boolean/editable-boolean.js +117 -0
  148. package/dist/collection/components/editable-condition/editable-condition.i18n.en.json +7 -0
  149. package/dist/collection/components/editable-condition/editable-condition.js +192 -0
  150. package/dist/collection/components/editable-condition-piece/dist/editable-condition-piece.js +257 -0
  151. package/dist/collection/components/editable-condition-piece/editable-condition-piece.css +34 -0
  152. package/dist/collection/components/editable-condition-piece/editable-condition-piece.i18n.en.json +21 -0
  153. package/dist/collection/components/editable-condition-piece/editable-condition-piece.js +233 -0
  154. package/dist/collection/components/editable-condition-piece/except-only-strings.js +12 -0
  155. package/dist/collection/components/editable-condition-piece/except-only.js +20 -0
  156. package/dist/collection/components/editable-delete/editable-delete.i18n.en.json +6 -0
  157. package/dist/collection/components/editable-delete/editable-delete.js +175 -0
  158. package/dist/collection/components/editable-filter-documents/dist/editable-filter-documents.js +242 -0
  159. package/dist/collection/components/editable-filter-documents/editable-filter-documents.css +11 -0
  160. package/dist/collection/components/editable-filter-documents/editable-filter-documents.i18n.en.json +9 -0
  161. package/dist/collection/components/editable-filter-documents/editable-filter-documents.js +294 -0
  162. package/dist/collection/components/editable-lookup/editable-lookup.js +210 -0
  163. package/dist/collection/components/editable-metadata/editable-metadata.css +44 -0
  164. package/dist/collection/components/editable-metadata/editable-metadata.i18n.en.json +51 -0
  165. package/dist/collection/components/editable-metadata/editable-metadata.js +261 -0
  166. package/dist/collection/components/editable-metadata-buttons/dist/editable-metadata-buttons.js +444 -0
  167. package/dist/collection/components/editable-metadata-buttons/editable-metadata-buttons.css +37 -0
  168. package/dist/collection/components/editable-metadata-buttons/editable-metadata-buttons.i18n.en.json +31 -0
  169. package/dist/collection/components/editable-metadata-buttons/editable-metadata-buttons.js +433 -0
  170. package/dist/collection/components/editable-metadata-metadata-fields/dist/editable-metadata-metadata-fields.js +399 -0
  171. package/dist/collection/components/editable-metadata-metadata-fields/editable-metadata-metadata-fields.i18n.en.json +48 -0
  172. package/dist/collection/components/editable-metadata-metadata-fields/editable-metadata-metadata-fields.js +438 -0
  173. package/dist/collection/components/editable-preference/editable-preference.i18n.en.json +8 -0
  174. package/dist/collection/components/editable-preference/editable-preference.js +166 -0
  175. package/dist/collection/components/editable-preference-option/editable-preference-option.i18n.en.json +9 -0
  176. package/dist/collection/components/editable-preference-option/editable-preference-option.js +128 -0
  177. package/dist/collection/components/editable-preferences/dist/editable-preferences.js +281 -0
  178. package/dist/collection/components/editable-preferences/editable-preferences.css +3 -0
  179. package/dist/collection/components/editable-preferences/editable-preferences.i18n.en.json +10 -0
  180. package/dist/collection/components/editable-preferences/editable-preferences.js +230 -0
  181. package/dist/collection/components/editable-preferences/preference-tree.js +24 -0
  182. package/dist/collection/components/editable-select/dist/editable-select.js +69 -0
  183. package/dist/collection/components/editable-select/editable-select.css +0 -0
  184. package/dist/collection/components/editable-select/editable-select.js +157 -0
  185. package/dist/collection/components/editable-string-list/dist/editable-string-list.js +207 -0
  186. package/dist/collection/components/editable-string-list/editable-string-list.css +21 -0
  187. package/dist/collection/components/editable-string-list/editable-string-list.i18n.en.json +18 -0
  188. package/dist/collection/components/editable-string-list/editable-string-list.js +194 -0
  189. package/dist/collection/components/editable-text/dist/editable-text.js +300 -0
  190. package/dist/collection/components/editable-text/dist/handle-input.js +52 -0
  191. package/dist/collection/components/editable-text/editable-text.css +53 -0
  192. package/dist/collection/components/editable-text/editable-text.i18n.en.json +3 -0
  193. package/dist/collection/components/editable-text/editable-text.js +473 -0
  194. package/dist/collection/components/editable-text/handle-input.js +47 -0
  195. package/dist/collection/components/editor/dist/editor.js +403 -0
  196. package/dist/collection/components/editor/editor.css +41 -0
  197. package/dist/collection/components/editor/editor.js +579 -0
  198. package/dist/collection/components/editor-cursors/editor-cursors.css +43 -0
  199. package/dist/collection/components/editor-cursors/editor-cursors.js +228 -0
  200. package/dist/collection/components/heading/dist/heading.js +210 -0
  201. package/dist/collection/components/heading/editable-node.js +2 -0
  202. package/dist/collection/components/heading/heading.css +96 -0
  203. package/dist/collection/components/heading/heading.i18n.en.json +4 -0
  204. package/dist/collection/components/heading/heading.js +198 -0
  205. package/dist/collection/components/image/image.css +75 -0
  206. package/dist/collection/components/image/image.i18n.en.json +4 -0
  207. package/dist/collection/components/image/image.js +303 -0
  208. package/dist/collection/components/label-bar/label-bar.css +40 -0
  209. package/dist/collection/components/label-bar/label-bar.js +49 -0
  210. package/dist/collection/components/liturgical-document/condition-node.js +86 -0
  211. package/dist/collection/components/liturgical-document/dist/liturgical-document.js +341 -0
  212. package/dist/collection/components/liturgical-document/liturgical-document.css +73 -0
  213. package/dist/collection/components/liturgical-document/liturgical-document.i18n.en.json +45 -0
  214. package/dist/collection/components/liturgical-document/liturgical-document.js +465 -0
  215. package/dist/collection/components/liturgical-document/lookup-node.js +80 -0
  216. package/dist/collection/components/liturgy/liturgy.js +138 -0
  217. package/dist/collection/components/meditation/dist/meditation.js +345 -0
  218. package/dist/collection/components/meditation/meditation.css +63 -0
  219. package/dist/collection/components/meditation/meditation.i18n.en.json +8 -0
  220. package/dist/collection/components/meditation/meditation.js +409 -0
  221. package/dist/collection/components/option/dist/option.js +318 -0
  222. package/dist/collection/components/option/option.css +8 -0
  223. package/dist/collection/components/option/option.i18n.en.json +3 -0
  224. package/dist/{ldf/ldf-option.entry.js → collection/components/option/option.js} +214 -31
  225. package/dist/collection/components/prayers-and-thanksgivings/dist/prayers-and-thanksgivings.js +258 -0
  226. package/dist/collection/components/prayers-and-thanksgivings/prayers-and-thanksgivings.css +3 -0
  227. package/dist/collection/components/prayers-and-thanksgivings/prayers-and-thanksgivings.i18n.en.json +3 -0
  228. package/dist/collection/components/prayers-and-thanksgivings/prayers-and-thanksgivings.js +265 -0
  229. package/dist/collection/components/psalm/dist/psalm.js +383 -0
  230. package/dist/collection/components/psalm/psalm.css +152 -0
  231. package/dist/collection/components/psalm/psalm.i18n.en.json +10 -0
  232. package/dist/collection/components/psalm/psalm.js +361 -0
  233. package/dist/collection/components/refrain/refrain.css +42 -0
  234. package/dist/collection/components/refrain/refrain.js +105 -0
  235. package/dist/collection/components/responsive-prayer/responsive-prayer.css +83 -0
  236. package/dist/collection/components/responsive-prayer/responsive-prayer.i18n.en.json +7 -0
  237. package/dist/collection/components/responsive-prayer/responsive-prayer.js +215 -0
  238. package/dist/collection/components/rubric/rubric.css +9 -0
  239. package/dist/collection/components/rubric/rubric.js +104 -0
  240. package/dist/collection/components/string/dist/string.js +194 -0
  241. package/dist/collection/components/string/string.css +60 -0
  242. package/dist/{ldf/ldf-string.entry.js → collection/components/string/string.js} +179 -18
  243. package/dist/collection/components/text/dist/text.js +234 -0
  244. package/dist/collection/components/text/text.css +52 -0
  245. package/dist/collection/components/text/text.i18n.en.json +7 -0
  246. package/dist/collection/components/text/text.i18n.es.json +3 -0
  247. package/dist/collection/components/text/text.js +224 -0
  248. package/dist/collection/i18n/bible-reading.i18n.en.json +13 -0
  249. package/dist/collection/i18n/bible-reading.i18n.es.json +4 -0
  250. package/dist/collection/i18n/day-name.i18n.en.json +4 -0
  251. package/dist/collection/i18n/editable-add-block-menu.i18n.en.json +48 -0
  252. package/dist/collection/i18n/editable-add-block.i18n.en.json +5 -0
  253. package/dist/collection/i18n/editable-antiphon-field.i18n.en.json +11 -0
  254. package/dist/collection/i18n/editable-condition-piece.i18n.en.json +21 -0
  255. package/dist/collection/i18n/editable-condition.i18n.en.json +7 -0
  256. package/dist/collection/i18n/editable-delete.i18n.en.json +6 -0
  257. package/dist/collection/i18n/editable-filter-documents.i18n.en.json +9 -0
  258. package/dist/collection/i18n/editable-metadata-buttons.i18n.en.json +31 -0
  259. package/dist/collection/i18n/editable-metadata-metadata-fields.i18n.en.json +48 -0
  260. package/dist/collection/i18n/editable-metadata.i18n.en.json +51 -0
  261. package/dist/collection/i18n/editable-preference-option.i18n.en.json +9 -0
  262. package/dist/collection/i18n/editable-preference.i18n.en.json +8 -0
  263. package/dist/collection/i18n/editable-preferences.i18n.en.json +10 -0
  264. package/dist/collection/i18n/editable-string-list.i18n.en.json +18 -0
  265. package/dist/collection/i18n/editable-text.i18n.en.json +3 -0
  266. package/dist/collection/i18n/heading.i18n.en.json +4 -0
  267. package/dist/collection/i18n/image.i18n.en.json +4 -0
  268. package/dist/collection/i18n/liturgical-document.i18n.en.json +45 -0
  269. package/dist/collection/i18n/meditation.i18n.en.json +8 -0
  270. package/dist/collection/i18n/option.i18n.en.json +3 -0
  271. package/dist/collection/i18n/prayers-and-thanksgivings.i18n.en.json +3 -0
  272. package/dist/collection/i18n/psalm.i18n.en.json +10 -0
  273. package/dist/collection/i18n/responsive-prayer.i18n.en.json +7 -0
  274. package/dist/collection/i18n/text.i18n.en.json +7 -0
  275. package/dist/collection/i18n/text.i18n.es.json +3 -0
  276. package/dist/collection/index.js +2 -0
  277. package/dist/collection/interfaces/add-option-to-doc.js +1 -0
  278. package/dist/collection/interfaces/dist/menu-option.js +9 -0
  279. package/dist/collection/interfaces/index.js +2 -0
  280. package/dist/collection/interfaces/menu-option.js +2 -0
  281. package/dist/collection/utils/element-from-path.js +14 -0
  282. package/dist/{ldf/locale-d595f8f6.js → collection/utils/locale.js} +2 -4
  283. package/dist/esm/_commonjsHelpers-ba3f0406.js +21 -0
  284. package/dist/{ldf/animation-6b850b6a.js → esm/animation-7a1025d0.js} +1 -1
  285. package/dist/{ldf/app-globals-d4376e8c.js → esm/app-globals-729b03cf.js} +1 -1
  286. package/dist/esm/book-31b8cdde.js +282 -0
  287. package/dist/esm/change-ea574d32.js +14 -0
  288. package/dist/{ldf → esm}/cubic-bezier-89113939.js +0 -0
  289. package/dist/esm/cursor-0e47f111.js +10 -0
  290. package/dist/{ldf → esm}/focus-visible-571e113e.js +0 -0
  291. package/dist/{ldf → esm}/framework-delegate-7af2c551.js +0 -0
  292. package/dist/esm/gesture-controller-5bf8565e.js +191 -0
  293. package/dist/{ldf/haptic-0d102c16.js → esm/haptic-fc16a4d8.js} +0 -24
  294. package/dist/{ldf → esm}/hardware-back-button-b3b61715.js +0 -0
  295. package/dist/esm/heading-cc5ffa8a.js +19 -0
  296. package/dist/{ldf/helpers-e9bf4204.js → esm/helpers-8c93393b.js} +0 -3
  297. package/dist/esm/image-c6a3f0c5.js +19 -0
  298. package/dist/{ldf/index-dd274afe.js → esm/index-1bf6d100.js} +3 -31
  299. package/dist/{ldf/index-4505cc02.js → esm/index-734a6b69.js} +2 -2
  300. package/dist/{ldf/index-9b41fcc6.js → esm/index-82044e24.js} +3 -190
  301. package/dist/{ldf → esm}/index-86d5f3ab.js +0 -0
  302. package/dist/{ldf/index-fc8c2f30.js → esm/index-9579282b.js} +3 -3
  303. package/dist/{ldf → esm}/index-c7ecbd63.js +0 -0
  304. package/dist/{ldf/index-7845c707.js → esm/index-f08f6130.js} +1 -6
  305. package/dist/esm/index-f0f6a379.js +1765 -0
  306. package/dist/esm/index.js +4 -0
  307. package/dist/{ldf/input-shims-b58afc2a.js → esm/input-shims-a4ad2743.js} +5 -7
  308. package/dist/{ldf → esm}/ion-action-sheet.entry.js +5 -5
  309. package/dist/{ldf → esm}/ion-alert.entry.js +5 -5
  310. package/dist/{ldf → esm}/ion-app.entry.js +6 -6
  311. package/dist/{ldf → esm}/ion-avatar.entry.js +2 -2
  312. package/dist/{ldf → esm}/ion-back-button.entry.js +2 -2
  313. package/dist/{ldf → esm}/ion-backdrop.entry.js +3 -3
  314. package/dist/{ldf → esm}/ion-badge.entry.js +2 -2
  315. package/dist/esm/ion-button_13.entry.js +1770 -0
  316. package/dist/esm/ion-card-content_6.entry.js +396 -0
  317. package/dist/{ldf → esm}/ion-card-subtitle.entry.js +2 -2
  318. package/dist/{ldf/ion-card.entry.js → esm/ion-card_2.entry.js} +27 -3
  319. package/dist/{ldf/ion-checkbox.entry.js → esm/ion-checkbox_3.entry.js} +123 -4
  320. package/dist/{ldf → esm}/ion-chip.entry.js +2 -2
  321. package/dist/{ldf/ion-datetime.entry.js → esm/ion-datetime_2.entry.js} +152 -6
  322. package/dist/{ldf → esm}/ion-fab-button.entry.js +3 -3
  323. package/dist/{ldf → esm}/ion-fab-list.entry.js +2 -2
  324. package/dist/{ldf → esm}/ion-fab.entry.js +2 -2
  325. package/dist/{ldf → esm}/ion-footer.entry.js +2 -2
  326. package/dist/{ldf → esm}/ion-img.entry.js +2 -2
  327. package/dist/{ldf → esm}/ion-infinite-scroll-content.entry.js +2 -2
  328. package/dist/{ldf → esm}/ion-infinite-scroll.entry.js +2 -2
  329. package/dist/{ldf/ldf-editable-text.entry.js → esm/ion-input_2.entry.js} +222 -12
  330. package/dist/{ldf → esm}/ion-item-divider.entry.js +2 -2
  331. package/dist/{ldf → esm}/ion-item-group.entry.js +2 -2
  332. package/dist/{ldf → esm}/ion-item-option.entry.js +2 -2
  333. package/dist/{ldf → esm}/ion-item-options.entry.js +3 -3
  334. package/dist/{ldf → esm}/ion-item-sliding.entry.js +4 -4
  335. package/dist/{ldf → esm}/ion-list-header.entry.js +2 -2
  336. package/dist/{ldf → esm}/ion-loading.entry.js +5 -5
  337. package/dist/{ldf → esm}/ion-menu-button.entry.js +6 -6
  338. package/dist/{ldf → esm}/ion-menu-toggle.entry.js +6 -6
  339. package/dist/{ldf → esm}/ion-menu.entry.js +7 -11
  340. package/dist/{ldf → esm}/ion-modal.entry.js +8 -7
  341. package/dist/{ldf → esm}/ion-nav-link.entry.js +1 -1
  342. package/dist/{ldf → esm}/ion-nav.entry.js +5 -9
  343. package/dist/{ldf → esm}/ion-note.entry.js +2 -2
  344. package/dist/{ldf → esm}/ion-picker-column.entry.js +5 -5
  345. package/dist/{ldf → esm}/ion-picker.entry.js +5 -5
  346. package/dist/{ldf → esm}/ion-popover.entry.js +6 -6
  347. package/dist/{ldf → esm}/ion-progress-bar.entry.js +3 -3
  348. package/dist/{ldf/ion-radio.entry.js → esm/ion-radio_2.entry.js} +57 -4
  349. package/dist/{ldf → esm}/ion-range.entry.js +4 -4
  350. package/dist/{ldf → esm}/ion-refresher-content.entry.js +2 -2
  351. package/dist/{ldf → esm}/ion-refresher.entry.js +7 -57
  352. package/dist/{ldf → esm}/ion-reorder-group.entry.js +4 -4
  353. package/dist/{ldf → esm}/ion-reorder.entry.js +2 -2
  354. package/dist/{ldf → esm}/ion-route-redirect.entry.js +1 -1
  355. package/dist/{ldf → esm}/ion-route.entry.js +1 -1
  356. package/dist/{ldf → esm}/ion-router-link.entry.js +2 -2
  357. package/dist/{ldf → esm}/ion-router-outlet.entry.js +4 -4
  358. package/dist/{ldf → esm}/ion-router.entry.js +2 -2
  359. package/dist/esm/ion-segment_16.entry.js +2488 -0
  360. package/dist/{ldf → esm}/ion-select-popover.entry.js +3 -3
  361. package/dist/{ldf/ion-select.entry.js → esm/ion-select_2.entry.js} +24 -5
  362. package/dist/{ldf → esm}/ion-slide.entry.js +2 -2
  363. package/dist/{ldf → esm}/ion-slides.entry.js +3 -3
  364. package/dist/{ldf → esm}/ion-spinner.entry.js +2 -2
  365. package/dist/{ldf → esm}/ion-split-pane.entry.js +2 -8
  366. package/dist/{ldf → esm}/ion-tab-bar.entry.js +2 -2
  367. package/dist/{ldf → esm}/ion-tab-button.entry.js +2 -2
  368. package/dist/{ldf → esm}/ion-tab.entry.js +1 -9
  369. package/dist/{ldf → esm}/ion-tabs.entry.js +1 -1
  370. package/dist/{ldf → esm}/ion-text.entry.js +2 -2
  371. package/dist/{ldf → esm}/ion-textarea.entry.js +5 -5
  372. package/dist/{ldf → esm}/ion-thumbnail.entry.js +2 -2
  373. package/dist/{ldf → esm}/ion-toast.entry.js +5 -5
  374. package/dist/{ldf → esm}/ion-virtual-scroll.entry.js +1 -1
  375. package/dist/{ldf/ionic-global-98eeb119.js → esm/ionic-global-ef89a0a5.js} +1 -2
  376. package/dist/{ldf/ios.transition-1d534d59.js → esm/ios.transition-b1be0863.js} +4 -4
  377. package/dist/{ldf/ldf-text.entry.js → esm/ldf-day-name_5.entry.js} +508 -126
  378. package/dist/{ldf → esm}/ldf-editable-add-block-menu.entry.js +9 -4
  379. package/dist/{ldf → esm}/ldf-editable-condition-piece.entry.js +24 -4
  380. package/dist/{ldf → esm}/ldf-editable-condition.entry.js +4 -4
  381. package/dist/{ldf → esm}/ldf-editable-filter-documents.entry.js +32 -4
  382. package/dist/{ldf/ldf-editable-metadata-metadata-fields.entry.js → esm/ldf-editable-lookup_2.entry.js} +121 -5
  383. package/dist/{ldf → esm}/ldf-editable-metadata.entry.js +10 -4
  384. package/dist/{ldf → esm}/ldf-editable-preference-option.entry.js +5 -4
  385. package/dist/{ldf → esm}/ldf-editable-preference.entry.js +5 -4
  386. package/dist/{ldf → esm}/ldf-editable-preferences.entry.js +20 -17
  387. package/dist/{ldf → esm}/ldf-editable-string-list.entry.js +4 -4
  388. package/dist/{ldf → esm}/ldf-editor-cursors.entry.js +5 -9
  389. package/dist/{ldf → esm}/ldf-editor.entry.js +6 -4
  390. package/dist/esm/ldf.js +20 -0
  391. package/dist/esm/loader.js +20 -0
  392. package/dist/esm/locale-ec8e14e6.js +6 -0
  393. package/dist/{ldf/md.transition-a8cd439c.js → esm/md.transition-1763f475.js} +4 -4
  394. package/dist/{ldf/menu-toggle-util-9f807d31.js → esm/menu-toggle-util-29e61ff3.js} +1 -1
  395. package/dist/esm/option-da8390ad.js +164 -0
  396. package/dist/{ldf/overlays-10805282.js → esm/overlays-06b43b65.js} +2 -2
  397. package/dist/esm/polyfills/core-js.js +11 -0
  398. package/dist/esm/polyfills/css-shim.js +1 -0
  399. package/dist/esm/polyfills/dom.js +79 -0
  400. package/dist/esm/polyfills/es5-html-element.js +1 -0
  401. package/dist/esm/polyfills/index.js +34 -0
  402. package/dist/esm/polyfills/system.js +6 -0
  403. package/dist/esm/preference-d070d4cb.js +20 -0
  404. package/dist/esm/refrain-75a412cb.js +19 -0
  405. package/dist/esm/rubric-91bf7fed.js +1213 -0
  406. package/dist/esm/specific-class-ef83cfb6.js +36 -0
  407. package/dist/{ldf → esm}/spinner-configs-5dd6891e.js +0 -0
  408. package/dist/{ldf/status-tap-b8afd87d.js → esm/status-tap-7458bd71.js} +1 -1
  409. package/dist/{ldf/swipe-back-2b2f4e51.js → esm/swipe-back-762284df.js} +3 -2
  410. package/dist/{ldf/swiper.bundle-49d79db9.js → esm/swiper.bundle-13b9da83.js} +2 -2
  411. package/dist/{ldf/tap-click-fccc5499.js → esm/tap-click-9b3d603b.js} +1 -1
  412. package/dist/esm/text-ed75fbd4.js +16 -0
  413. package/dist/{ldf → esm}/theme-74c22054.js +0 -0
  414. package/dist/index.cjs.js +1 -0
  415. package/dist/index.js +1 -0
  416. package/dist/ldf/index.esm.js +1 -4
  417. package/dist/ldf/ldf.css +3 -122
  418. package/dist/ldf/ldf.esm.js +1 -123
  419. package/dist/ldf/p-018e57db.entry.js +1 -0
  420. package/dist/ldf/p-03389897.js +1 -0
  421. package/dist/ldf/p-03afc8cb.entry.js +1 -0
  422. package/dist/ldf/p-04715bf0.entry.js +1 -0
  423. package/dist/ldf/p-0491d1d2.js +1 -0
  424. package/dist/ldf/p-07d6d3ad.entry.js +1 -0
  425. package/dist/ldf/p-08584ccc.entry.js +1 -0
  426. package/dist/ldf/p-0873a34a.entry.js +1 -0
  427. package/dist/ldf/p-0ab55cf6.js +1 -0
  428. package/dist/ldf/p-1482a707.js +1 -0
  429. package/dist/ldf/p-177ede88.js +1 -0
  430. package/dist/ldf/p-1902f41e.entry.js +1 -0
  431. package/dist/ldf/p-1a8e2899.entry.js +1 -0
  432. package/dist/ldf/p-1c8cc5bf.entry.js +1 -0
  433. package/dist/ldf/p-1ff665a7.entry.js +1 -0
  434. package/dist/ldf/p-21e2f0a3.entry.js +1 -0
  435. package/dist/ldf/p-23af1bc3.entry.js +1 -0
  436. package/dist/ldf/p-25a736f1.entry.js +1 -0
  437. package/dist/ldf/p-2ae548b3.entry.js +1 -0
  438. package/dist/ldf/p-2c36a583.entry.js +1 -0
  439. package/dist/ldf/p-302dc0d5.entry.js +1 -0
  440. package/dist/ldf/p-327b14ac.entry.js +1 -0
  441. package/dist/ldf/p-32f7ba8e.entry.js +1 -0
  442. package/dist/ldf/p-3545fcdc.entry.js +1 -0
  443. package/dist/ldf/p-374118d7.entry.js +1 -0
  444. package/dist/ldf/p-380f8655.entry.js +1 -0
  445. package/dist/ldf/p-3c9930ff.entry.js +1 -0
  446. package/dist/ldf/p-3ca74c80.js +8 -0
  447. package/dist/ldf/p-3e8ff66b.js +1 -0
  448. package/dist/ldf/p-3f39c2ad.entry.js +1 -0
  449. package/dist/ldf/p-3f8ef67b.entry.js +1 -0
  450. package/dist/ldf/p-402c811f.js +1 -0
  451. package/dist/ldf/p-430c418a.entry.js +1 -0
  452. package/dist/ldf/p-476327d6.js +1 -0
  453. package/dist/ldf/p-48e44122.js +1 -0
  454. package/dist/ldf/p-4a4380fa.entry.js +1 -0
  455. package/dist/ldf/p-4aa9a6f2.js +1 -0
  456. package/dist/ldf/p-4b80de48.js +1 -0
  457. package/dist/ldf/p-4e0b3c0f.entry.js +1 -0
  458. package/dist/ldf/p-5066eaa5.js +1 -0
  459. package/dist/ldf/p-52656429.entry.js +1 -0
  460. package/dist/ldf/p-55d797c1.js +1 -0
  461. package/dist/ldf/p-59340423.entry.js +1 -0
  462. package/dist/ldf/p-594fa9d4.entry.js +1 -0
  463. package/dist/ldf/p-5b43e6be.js +1 -0
  464. package/dist/ldf/p-5b51185b.js +1 -0
  465. package/dist/ldf/p-5be7ff17.entry.js +1 -0
  466. package/dist/ldf/p-5ea6de28.entry.js +1 -0
  467. package/dist/ldf/p-63b5daf6.entry.js +1 -0
  468. package/dist/ldf/p-65563763.entry.js +1 -0
  469. package/dist/ldf/p-65d26c45.js +1 -0
  470. package/dist/ldf/p-65ea7ab3.entry.js +1 -0
  471. package/dist/ldf/p-66a7385e.entry.js +1 -0
  472. package/dist/ldf/p-6857574d.js +1 -0
  473. package/dist/ldf/p-69f85ad3.entry.js +1 -0
  474. package/dist/ldf/p-6fe24d85.entry.js +1 -0
  475. package/dist/ldf/p-70e47f8b.entry.js +1 -0
  476. package/dist/ldf/p-714cf0b2.js +1 -0
  477. package/dist/ldf/p-718ae824.js +1 -0
  478. package/dist/ldf/p-78da8fe1.js +1 -0
  479. package/dist/ldf/p-79a526a1.entry.js +1 -0
  480. package/dist/ldf/p-7abeb82c.entry.js +1 -0
  481. package/dist/ldf/p-7efa633b.entry.js +1 -0
  482. package/dist/ldf/p-800a115c.entry.js +1 -0
  483. package/dist/ldf/p-84f38db6.entry.js +1 -0
  484. package/dist/ldf/p-8767a74e.entry.js +1 -0
  485. package/dist/ldf/p-88dbd8b6.js +1 -0
  486. package/dist/ldf/p-8932ec85.entry.js +1 -0
  487. package/dist/ldf/p-8c2727db.entry.js +1 -0
  488. package/dist/ldf/p-8ec26587.js +1 -0
  489. package/dist/ldf/p-8f67abb8.js +3 -0
  490. package/dist/ldf/p-9155f066.js +1 -0
  491. package/dist/ldf/p-978e2c6d.js +1 -0
  492. package/dist/ldf/p-991c0877.js +1 -0
  493. package/dist/ldf/p-9bd5d1d4.entry.js +1 -0
  494. package/dist/ldf/p-9c1973a6.entry.js +1 -0
  495. package/dist/ldf/p-9c397c49.entry.js +1 -0
  496. package/dist/ldf/p-9e2c172e.entry.js +1 -0
  497. package/dist/ldf/p-a1729dbd.js +1 -0
  498. package/dist/ldf/p-ac7a17ce.entry.js +1 -0
  499. package/dist/ldf/p-acbbd1ec.js +1 -0
  500. package/dist/ldf/p-afc1a02c.js +1 -0
  501. package/dist/ldf/p-b1242016.js +1 -0
  502. package/dist/ldf/p-b62e8f49.js +1 -0
  503. package/dist/ldf/p-b7388aec.entry.js +1 -0
  504. package/dist/ldf/p-b78336d7.entry.js +1 -0
  505. package/dist/ldf/p-ba021918.entry.js +1 -0
  506. package/dist/ldf/p-bdcf2b02.entry.js +1 -0
  507. package/dist/ldf/p-c1df632d.entry.js +1 -0
  508. package/dist/ldf/p-c3042920.entry.js +1 -0
  509. package/dist/ldf/p-c3807857.entry.js +1 -0
  510. package/dist/ldf/p-c3841978.entry.js +1 -0
  511. package/dist/ldf/p-c41e055c.entry.js +1 -0
  512. package/dist/ldf/p-c60a875b.js +1 -0
  513. package/dist/ldf/p-c6163f81.entry.js +1 -0
  514. package/dist/ldf/p-c6a8f4aa.js +1 -0
  515. package/dist/ldf/p-c6b42618.entry.js +1 -0
  516. package/dist/ldf/p-c74d3fd0.entry.js +1 -0
  517. package/dist/ldf/p-c82dd468.entry.js +1 -0
  518. package/dist/ldf/p-ca698b8f.entry.js +1 -0
  519. package/dist/ldf/p-cbfbb80c.entry.js +1 -0
  520. package/dist/ldf/p-d195c957.entry.js +1 -0
  521. package/dist/ldf/p-d282d4f9.js +1 -0
  522. package/dist/ldf/p-d7966e9b.entry.js +1 -0
  523. package/dist/ldf/p-d7f8c770.js +1 -0
  524. package/dist/ldf/p-d9c1c1f6.js +1 -0
  525. package/dist/ldf/p-dc445c36.entry.js +1 -0
  526. package/dist/ldf/p-dd99e42a.entry.js +1 -0
  527. package/dist/ldf/p-de5bb5ad.js +1 -0
  528. package/dist/ldf/p-e0e12ae3.entry.js +1 -0
  529. package/dist/ldf/p-e215fd02.entry.js +1 -0
  530. package/dist/ldf/p-e4be11ad.entry.js +1 -0
  531. package/dist/ldf/p-e4f0cd91.entry.js +1 -0
  532. package/dist/ldf/p-e911e60d.js +1 -0
  533. package/dist/ldf/p-ea66c343.entry.js +1 -0
  534. package/dist/ldf/p-ec5eecdc.entry.js +1 -0
  535. package/dist/ldf/p-ed3327fa.js +1 -0
  536. package/dist/ldf/p-f0de7628.entry.js +1 -0
  537. package/dist/ldf/p-f2ce126e.js +1 -0
  538. package/dist/ldf/p-f3a0c163.js +1 -0
  539. package/dist/ldf/p-fa191f47.entry.js +1 -0
  540. package/dist/ldf/p-fe59a676.entry.js +1 -0
  541. package/dist/node_modules/@ionic/core/dist/collection/components/action-sheet/action-sheet.ios.css +363 -0
  542. package/dist/node_modules/@ionic/core/dist/collection/components/action-sheet/action-sheet.md.css +285 -0
  543. package/dist/node_modules/@ionic/core/dist/collection/components/alert/alert.ios.css +483 -0
  544. package/dist/node_modules/@ionic/core/dist/collection/components/alert/alert.md.css +501 -0
  545. package/dist/node_modules/@ionic/core/dist/collection/components/app/app.css +7 -0
  546. package/dist/node_modules/@ionic/core/dist/collection/components/avatar/avatar.ios.css +22 -0
  547. package/dist/node_modules/@ionic/core/dist/collection/components/avatar/avatar.md.css +22 -0
  548. package/dist/node_modules/@ionic/core/dist/collection/components/back-button/back-button.ios.css +277 -0
  549. package/dist/node_modules/@ionic/core/dist/collection/components/back-button/back-button.md.css +305 -0
  550. package/dist/node_modules/@ionic/core/dist/collection/components/backdrop/backdrop.ios.css +26 -0
  551. package/dist/node_modules/@ionic/core/dist/collection/components/backdrop/backdrop.md.css +26 -0
  552. package/dist/node_modules/@ionic/core/dist/collection/components/badge/badge.ios.css +58 -0
  553. package/dist/node_modules/@ionic/core/dist/collection/components/badge/badge.md.css +62 -0
  554. package/dist/node_modules/@ionic/core/dist/collection/components/button/button.ios.css +440 -0
  555. package/dist/node_modules/@ionic/core/dist/collection/components/button/button.md.css +428 -0
  556. package/dist/node_modules/@ionic/core/dist/collection/components/buttons/buttons.ios.css +128 -0
  557. package/dist/node_modules/@ionic/core/dist/collection/components/buttons/buttons.md.css +151 -0
  558. package/dist/node_modules/@ionic/core/dist/collection/components/card/card.ios.css +101 -0
  559. package/dist/node_modules/@ionic/core/dist/collection/components/card/card.md.css +95 -0
  560. package/dist/node_modules/@ionic/core/dist/collection/components/card-content/card-content.ios.css +61 -0
  561. package/dist/node_modules/@ionic/core/dist/collection/components/card-content/card-content.md.css +63 -0
  562. package/dist/node_modules/@ionic/core/dist/collection/components/card-header/card-header.ios.css +37 -0
  563. package/dist/node_modules/@ionic/core/dist/collection/components/card-header/card-header.md.css +35 -0
  564. package/dist/node_modules/@ionic/core/dist/collection/components/card-subtitle/card-subtitle.ios.css +28 -0
  565. package/dist/node_modules/@ionic/core/dist/collection/components/card-subtitle/card-subtitle.md.css +26 -0
  566. package/dist/node_modules/@ionic/core/dist/collection/components/card-title/card-title.ios.css +27 -0
  567. package/dist/node_modules/@ionic/core/dist/collection/components/card-title/card-title.md.css +27 -0
  568. package/dist/node_modules/@ionic/core/dist/collection/components/checkbox/checkbox.ios.css +147 -0
  569. package/dist/node_modules/@ionic/core/dist/collection/components/checkbox/checkbox.md.css +150 -0
  570. package/dist/node_modules/@ionic/core/dist/collection/components/chip/chip.ios.css +194 -0
  571. package/dist/node_modules/@ionic/core/dist/collection/components/chip/chip.md.css +194 -0
  572. package/dist/node_modules/@ionic/core/dist/collection/components/col/col.css +108 -0
  573. package/dist/node_modules/@ionic/core/dist/collection/components/content/content.css +167 -0
  574. package/dist/node_modules/@ionic/core/dist/collection/components/datetime/datetime.ios.css +106 -0
  575. package/dist/node_modules/@ionic/core/dist/collection/components/datetime/datetime.md.css +106 -0
  576. package/dist/node_modules/@ionic/core/dist/collection/components/fab/fab.css +61 -0
  577. package/dist/node_modules/@ionic/core/dist/collection/components/fab-button/fab-button.ios.css +324 -0
  578. package/dist/node_modules/@ionic/core/dist/collection/components/fab-button/fab-button.md.css +293 -0
  579. package/dist/node_modules/@ionic/core/dist/collection/components/fab-list/fab-list.css +116 -0
  580. package/dist/node_modules/@ionic/core/dist/collection/components/footer/footer.ios.css +33 -0
  581. package/dist/node_modules/@ionic/core/dist/collection/components/footer/footer.md.css +37 -0
  582. package/dist/node_modules/@ionic/core/dist/collection/components/grid/grid.css +151 -0
  583. package/dist/node_modules/@ionic/core/dist/collection/components/header/header.ios.css +92 -0
  584. package/dist/node_modules/@ionic/core/dist/collection/components/header/header.md.css +40 -0
  585. package/dist/node_modules/@ionic/core/dist/collection/components/img/img.css +12 -0
  586. package/dist/node_modules/@ionic/core/dist/collection/components/infinite-scroll/infinite-scroll.css +8 -0
  587. package/dist/node_modules/@ionic/core/dist/collection/components/infinite-scroll-content/infinite-scroll-content.ios.css +54 -0
  588. package/dist/node_modules/@ionic/core/dist/collection/components/infinite-scroll-content/infinite-scroll-content.md.css +54 -0
  589. package/dist/node_modules/@ionic/core/dist/collection/components/input/input.ios.css +172 -0
  590. package/dist/node_modules/@ionic/core/dist/collection/components/input/input.md.css +172 -0
  591. package/dist/node_modules/@ionic/core/dist/collection/components/item/item.ios.css +563 -0
  592. package/dist/node_modules/@ionic/core/dist/collection/components/item/item.md.css +630 -0
  593. package/dist/node_modules/@ionic/core/dist/collection/components/item-divider/item-divider.ios.css +204 -0
  594. package/dist/node_modules/@ionic/core/dist/collection/components/item-divider/item-divider.md.css +297 -0
  595. package/dist/node_modules/@ionic/core/dist/collection/components/item-group/item-group.ios.css +3 -0
  596. package/dist/node_modules/@ionic/core/dist/collection/components/item-group/item-group.md.css +3 -0
  597. package/dist/node_modules/@ionic/core/dist/collection/components/item-option/item-option.ios.css +186 -0
  598. package/dist/node_modules/@ionic/core/dist/collection/components/item-option/item-option.md.css +180 -0
  599. package/dist/node_modules/@ionic/core/dist/collection/components/item-options/item-options.ios.css +88 -0
  600. package/dist/node_modules/@ionic/core/dist/collection/components/item-options/item-options.md.css +85 -0
  601. package/dist/node_modules/@ionic/core/dist/collection/components/item-sliding/item-sliding.css +42 -0
  602. package/dist/node_modules/@ionic/core/dist/collection/components/label/label.ios.css +152 -0
  603. package/dist/node_modules/@ionic/core/dist/collection/components/label/label.md.css +163 -0
  604. package/dist/node_modules/@ionic/core/dist/collection/components/list/list.ios.css +91 -0
  605. package/dist/node_modules/@ionic/core/dist/collection/components/list/list.md.css +114 -0
  606. package/dist/node_modules/@ionic/core/dist/collection/components/list-header/list-header.ios.css +118 -0
  607. package/dist/node_modules/@ionic/core/dist/collection/components/list-header/list-header.md.css +94 -0
  608. package/dist/node_modules/@ionic/core/dist/collection/components/loading/loading.ios.css +113 -0
  609. package/dist/node_modules/@ionic/core/dist/collection/components/loading/loading.md.css +104 -0
  610. package/dist/node_modules/@ionic/core/dist/collection/components/menu/menu.ios.css +131 -0
  611. package/dist/node_modules/@ionic/core/dist/collection/components/menu/menu.md.css +127 -0
  612. package/dist/node_modules/@ionic/core/dist/collection/components/menu-button/menu-button.ios.css +175 -0
  613. package/dist/node_modules/@ionic/core/dist/collection/components/menu-button/menu-button.md.css +178 -0
  614. package/dist/node_modules/@ionic/core/dist/collection/components/menu-toggle/menu-toggle.css +3 -0
  615. package/dist/node_modules/@ionic/core/dist/collection/components/modal/modal.ios.css +158 -0
  616. package/dist/node_modules/@ionic/core/dist/collection/components/modal/modal.md.css +104 -0
  617. package/dist/node_modules/@ionic/core/dist/collection/components/nav/nav.css +10 -0
  618. package/dist/node_modules/@ionic/core/dist/collection/components/note/note.ios.css +16 -0
  619. package/dist/node_modules/@ionic/core/dist/collection/components/note/note.md.css +17 -0
  620. package/dist/node_modules/@ionic/core/dist/collection/components/picker/picker.ios.css +216 -0
  621. package/dist/node_modules/@ionic/core/dist/collection/components/picker/picker.md.css +203 -0
  622. package/dist/node_modules/@ionic/core/dist/collection/components/picker-column/picker-column.ios.css +122 -0
  623. package/dist/node_modules/@ionic/core/dist/collection/components/picker-column/picker-column.md.css +123 -0
  624. package/dist/node_modules/@ionic/core/dist/collection/components/popover/popover.ios.css +117 -0
  625. package/dist/node_modules/@ionic/core/dist/collection/components/popover/popover.md.css +82 -0
  626. package/dist/node_modules/@ionic/core/dist/collection/components/progress-bar/progress-bar.ios.css +191 -0
  627. package/dist/node_modules/@ionic/core/dist/collection/components/progress-bar/progress-bar.md.css +191 -0
  628. package/dist/node_modules/@ionic/core/dist/collection/components/radio/radio.ios.css +151 -0
  629. package/dist/node_modules/@ionic/core/dist/collection/components/radio/radio.md.css +152 -0
  630. package/dist/node_modules/@ionic/core/dist/collection/components/range/range.ios.css +275 -0
  631. package/dist/node_modules/@ionic/core/dist/collection/components/range/range.md.css +320 -0
  632. package/dist/node_modules/@ionic/core/dist/collection/components/refresher/refresher.ios.css +177 -0
  633. package/dist/node_modules/@ionic/core/dist/collection/components/refresher/refresher.md.css +210 -0
  634. package/dist/node_modules/@ionic/core/dist/collection/components/reorder/reorder.ios.css +15 -0
  635. package/dist/node_modules/@ionic/core/dist/collection/components/reorder/reorder.md.css +15 -0
  636. package/dist/node_modules/@ionic/core/dist/collection/components/reorder-group/reorder-group.css +33 -0
  637. package/dist/node_modules/@ionic/core/dist/collection/components/ripple-effect/ripple-effect.css +58 -0
  638. package/dist/node_modules/@ionic/core/dist/collection/components/router-link/router-link.css +29 -0
  639. package/dist/node_modules/@ionic/core/dist/collection/components/router-outlet/route-outlet.css +10 -0
  640. package/dist/node_modules/@ionic/core/dist/collection/components/row/row.css +4 -0
  641. package/dist/node_modules/@ionic/core/dist/collection/components/searchbar/searchbar.ios.css +348 -0
  642. package/dist/node_modules/@ionic/core/dist/collection/components/searchbar/searchbar.md.css +279 -0
  643. package/dist/node_modules/@ionic/core/dist/collection/components/segment/segment.ios.css +64 -0
  644. package/dist/node_modules/@ionic/core/dist/collection/components/segment/segment.md.css +35 -0
  645. package/dist/node_modules/@ionic/core/dist/collection/components/segment-button/segment-button.ios.css +442 -0
  646. package/dist/node_modules/@ionic/core/dist/collection/components/segment-button/segment-button.md.css +424 -0
  647. package/dist/node_modules/@ionic/core/dist/collection/components/select/select.ios.css +123 -0
  648. package/dist/node_modules/@ionic/core/dist/collection/components/select/select.md.css +123 -0
  649. package/dist/node_modules/@ionic/core/dist/collection/components/select-option/select-option.css +3 -0
  650. package/dist/node_modules/@ionic/core/dist/collection/components/select-popover/select-popover.css +14 -0
  651. package/dist/node_modules/@ionic/core/dist/collection/components/skeleton-text/skeleton-text.css +53 -0
  652. package/dist/node_modules/@ionic/core/dist/collection/components/slide/slide.css +31 -0
  653. package/dist/node_modules/@ionic/core/dist/collection/components/slides/slides.ios.css +764 -0
  654. package/dist/node_modules/@ionic/core/dist/collection/components/slides/slides.md.css +764 -0
  655. package/dist/node_modules/@ionic/core/dist/collection/components/spinner/spinner.css +154 -0
  656. package/dist/node_modules/@ionic/core/dist/collection/components/split-pane/split-pane.ios.css +108 -0
  657. package/dist/node_modules/@ionic/core/dist/collection/components/split-pane/split-pane.md.css +108 -0
  658. package/dist/node_modules/@ionic/core/dist/collection/components/tab/tab.css +4 -0
  659. package/dist/node_modules/@ionic/core/dist/collection/components/tab-bar/tab-bar.ios.css +96 -0
  660. package/dist/node_modules/@ionic/core/dist/collection/components/tab-bar/tab-bar.md.css +81 -0
  661. package/dist/node_modules/@ionic/core/dist/collection/components/tab-button/tab-button.ios.css +308 -0
  662. package/dist/node_modules/@ionic/core/dist/collection/components/tab-button/tab-button.md.css +331 -0
  663. package/dist/node_modules/@ionic/core/dist/collection/components/tabs/tabs.css +19 -0
  664. package/dist/node_modules/@ionic/core/dist/collection/components/text/text.css +3 -0
  665. package/dist/node_modules/@ionic/core/dist/collection/components/textarea/textarea.ios.css +142 -0
  666. package/dist/node_modules/@ionic/core/dist/collection/components/textarea/textarea.md.css +146 -0
  667. package/dist/node_modules/@ionic/core/dist/collection/components/thumbnail/thumbnail.css +21 -0
  668. package/dist/node_modules/@ionic/core/dist/collection/components/title/title.ios.css +110 -0
  669. package/dist/node_modules/@ionic/core/dist/collection/components/title/title.md.css +55 -0
  670. package/dist/node_modules/@ionic/core/dist/collection/components/toast/toast.ios.css +249 -0
  671. package/dist/node_modules/@ionic/core/dist/collection/components/toast/toast.md.css +282 -0
  672. package/dist/node_modules/@ionic/core/dist/collection/components/toggle/toggle.ios.css +214 -0
  673. package/dist/node_modules/@ionic/core/dist/collection/components/toggle/toggle.md.css +211 -0
  674. package/dist/node_modules/@ionic/core/dist/collection/components/toolbar/toolbar.ios.css +174 -0
  675. package/dist/node_modules/@ionic/core/dist/collection/components/toolbar/toolbar.md.css +167 -0
  676. package/dist/node_modules/@ionic/core/dist/collection/components/virtual-scroll/virtual-scroll.css +21 -0
  677. package/dist/node_modules/ionicons/dist/collection/components/icon/icon.css +101 -0
  678. package/package.json +2 -2
  679. package/dist/ldf/_commonjsHelpers-8fe71198.js +0 -44
  680. package/dist/ldf/css-shim-5630fd5e.js +0 -4
  681. package/dist/ldf/dom-bd0bf1dc.js +0 -73
  682. package/dist/ldf/index-f441adec.js +0 -2901
  683. package/dist/ldf/index-f4e3260e.js +0 -36
  684. package/dist/ldf/ion-button.entry.js +0 -109
  685. package/dist/ldf/ion-buttons.entry.js +0 -38
  686. package/dist/ldf/ion-card-content.entry.js +0 -26
  687. package/dist/ldf/ion-card-header.entry.js +0 -29
  688. package/dist/ldf/ion-card-title.entry.js +0 -23
  689. package/dist/ldf/ion-col.entry.js +0 -114
  690. package/dist/ldf/ion-content.entry.js +0 -299
  691. package/dist/ldf/ion-grid.entry.js +0 -24
  692. package/dist/ldf/ion-header.entry.js +0 -255
  693. package/dist/ldf/ion-icon.entry.js +0 -172
  694. package/dist/ldf/ion-input.entry.js +0 -216
  695. package/dist/ldf/ion-item.entry.js +0 -119
  696. package/dist/ldf/ion-label.entry.js +0 -51
  697. package/dist/ldf/ion-list.entry.js +0 -48
  698. package/dist/ldf/ion-radio-group.entry.js +0 -57
  699. package/dist/ldf/ion-ripple-effect.entry.js +0 -89
  700. package/dist/ldf/ion-row.entry.js +0 -16
  701. package/dist/ldf/ion-searchbar.entry.js +0 -326
  702. package/dist/ldf/ion-segment-button.entry.js +0 -88
  703. package/dist/ldf/ion-segment.entry.js +0 -296
  704. package/dist/ldf/ion-select-option.entry.js +0 -23
  705. package/dist/ldf/ion-skeleton-text.entry.js +0 -29
  706. package/dist/ldf/ion-title.entry.js +0 -44
  707. package/dist/ldf/ion-toggle.entry.js +0 -152
  708. package/dist/ldf/ion-toolbar.entry.js +0 -67
  709. package/dist/ldf/ldf-bible-reading.entry.js +0 -252
  710. package/dist/ldf/ldf-editable-add-block.entry.js +0 -49
  711. package/dist/ldf/ldf-editable-antiphon-field.entry.js +0 -223
  712. package/dist/ldf/ldf-editable-boolean.entry.js +0 -42
  713. package/dist/ldf/ldf-editable-delete.entry.js +0 -97
  714. package/dist/ldf/ldf-editable-lookup.entry.js +0 -115
  715. package/dist/ldf/ldf-editable-metadata-buttons.entry.js +0 -293
  716. package/dist/ldf/ldf-editable-select.entry.js +0 -33
  717. package/dist/ldf/ldf-heading.entry.js +0 -124
  718. package/dist/ldf/ldf-image.entry.js +0 -195
  719. package/dist/ldf/ldf-label-bar.entry.js +0 -22
  720. package/dist/ldf/ldf-liturgical-document.entry.js +0 -462
  721. package/dist/ldf/ldf-liturgy.entry.js +0 -49
  722. package/dist/ldf/ldf-meditation.entry.js +0 -180
  723. package/dist/ldf/ldf-prayers-and-thanksgivings.entry.js +0 -136
  724. package/dist/ldf/ldf-psalm.entry.js +0 -267
  725. package/dist/ldf/ldf-refrain.entry.js +0 -42
  726. package/dist/ldf/ldf-responsive-prayer.entry.js +0 -137
  727. package/dist/ldf/ldf-rubric.entry.js +0 -41
  728. package/dist/ldf/shadow-css-10669ec3.js +0 -383
  729. package/dist/ldf/utils-8d15f916.js +0 -91
@@ -0,0 +1,2507 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-8fe0df8d.js');
6
+ const ionicGlobal = require('./ionic-global-581fb4f8.js');
7
+ const helpers = require('./helpers-41dfb43a.js');
8
+ const theme = require('./theme-81caa5b0.js');
9
+ const overlays = require('./overlays-eb464d6d.js');
10
+ const book$1 = require('./book-1a92678a.js');
11
+ const rubric = require('./rubric-5b467a6a.js');
12
+ const heading$1 = require('./heading-5afc2b24.js');
13
+ const option$1 = require('./option-24f3d13a.js');
14
+ const change = require('./change-cdb1e8c0.js');
15
+ const locale = require('./locale-d4e925b1.js');
16
+ const image = require('./image-3bee3e73.js');
17
+ const index$1 = require('./index-7aa21373.js');
18
+ const refrain = require('./refrain-91fb446b.js');
19
+ require('./hardware-back-button-8c2f48d2.js');
20
+ require('./_commonjsHelpers-bcc1208a.js');
21
+
22
+ const segmentIosCss = ":host{--ripple-color:currentColor;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:flex;position:relative;align-items:stretch;justify-content:center;width:100%;background:var(--background);font-family:var(--ion-font-family, inherit);text-align:center;contain:paint}:host(.segment-scrollable){justify-content:start;width:auto;overflow-x:auto}:host(.segment-scrollable::-webkit-scrollbar){display:none}:host{--background:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.065);border-radius:8px;overflow:hidden;z-index:0}:host(.ion-color){background:rgba(var(--ion-color-base-rgb), 0.065)}:host(.in-toolbar){margin-left:auto;margin-right:auto;margin-top:0;margin-bottom:0;width:auto}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host(.in-toolbar){margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}:host(.in-toolbar:not(.ion-color)){background:var(--ion-toolbar-segment-background, var(--background))}:host(.in-toolbar-color:not(.ion-color)){background:rgba(var(--ion-color-contrast-rgb), 0.11)}";
23
+
24
+ const segmentMdCss = ":host{--ripple-color:currentColor;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:flex;position:relative;align-items:stretch;justify-content:center;width:100%;background:var(--background);font-family:var(--ion-font-family, inherit);text-align:center;contain:paint}:host(.segment-scrollable){justify-content:start;width:auto;overflow-x:auto}:host(.segment-scrollable::-webkit-scrollbar){display:none}:host{--background:transparent}:host(.segment-scrollable) ::slotted(ion-segment-button){min-width:auto}";
25
+
26
+ const Segment = class {
27
+ constructor(hostRef) {
28
+ index.registerInstance(this, hostRef);
29
+ this.ionChange = index.createEvent(this, "ionChange", 7);
30
+ this.ionSelect = index.createEvent(this, "ionSelect", 7);
31
+ this.ionStyle = index.createEvent(this, "ionStyle", 7);
32
+ this.didInit = false;
33
+ this.activated = false;
34
+ /**
35
+ * If `true`, the user cannot interact with the segment.
36
+ */
37
+ this.disabled = false;
38
+ /**
39
+ * If `true`, the segment buttons will overflow and the user can swipe to see them.
40
+ * In addition, this will disable the gesture to drag the indicator between the buttons
41
+ * in order to swipe to see hidden buttons.
42
+ */
43
+ this.scrollable = false;
44
+ this.onClick = (ev) => {
45
+ const current = ev.target;
46
+ const previous = this.checked;
47
+ this.value = current.value;
48
+ if (previous && this.scrollable) {
49
+ this.checkButton(previous, current);
50
+ }
51
+ this.checked = current;
52
+ };
53
+ }
54
+ valueChanged(value, oldValue) {
55
+ this.ionSelect.emit({ value });
56
+ if (oldValue !== '' || this.didInit) {
57
+ if (!this.activated) {
58
+ this.ionChange.emit({ value });
59
+ }
60
+ else {
61
+ this.valueAfterGesture = value;
62
+ }
63
+ }
64
+ }
65
+ disabledChanged() {
66
+ this.gestureChanged();
67
+ const buttons = this.getButtons();
68
+ for (const button of buttons) {
69
+ button.disabled = this.disabled;
70
+ }
71
+ }
72
+ gestureChanged() {
73
+ if (this.gesture && !this.scrollable) {
74
+ this.gesture.enable(!this.disabled);
75
+ }
76
+ }
77
+ connectedCallback() {
78
+ this.emitStyle();
79
+ }
80
+ componentWillLoad() {
81
+ this.emitStyle();
82
+ }
83
+ async componentDidLoad() {
84
+ this.setCheckedClasses();
85
+ this.gesture = (await Promise.resolve().then(function () { return require('./index-8197bb45.js'); })).createGesture({
86
+ el: this.el,
87
+ gestureName: 'segment',
88
+ gesturePriority: 100,
89
+ threshold: 0,
90
+ passive: false,
91
+ onStart: ev => this.onStart(ev),
92
+ onMove: ev => this.onMove(ev),
93
+ onEnd: ev => this.onEnd(ev),
94
+ });
95
+ this.gesture.enable(!this.scrollable);
96
+ this.gestureChanged();
97
+ if (this.disabled) {
98
+ this.disabledChanged();
99
+ }
100
+ this.didInit = true;
101
+ }
102
+ onStart(detail) {
103
+ this.activate(detail);
104
+ }
105
+ onMove(detail) {
106
+ this.setNextIndex(detail);
107
+ }
108
+ onEnd(detail) {
109
+ this.setActivated(false);
110
+ const checkedValidButton = this.setNextIndex(detail, true);
111
+ detail.event.stopImmediatePropagation();
112
+ if (checkedValidButton) {
113
+ this.addRipple(detail);
114
+ }
115
+ const value = this.valueAfterGesture;
116
+ if (value !== undefined) {
117
+ this.ionChange.emit({ value });
118
+ this.valueAfterGesture = undefined;
119
+ }
120
+ }
121
+ getButtons() {
122
+ return Array.from(this.el.querySelectorAll('ion-segment-button'));
123
+ }
124
+ /**
125
+ * The gesture blocks the segment button ripple. This
126
+ * function adds the ripple based on the checked segment
127
+ * and where the cursor ended.
128
+ */
129
+ addRipple(detail) {
130
+ const useRippleEffect = ionicGlobal.config.getBoolean('animated', true) && ionicGlobal.config.getBoolean('rippleEffect', true);
131
+ if (!useRippleEffect) {
132
+ return;
133
+ }
134
+ const buttons = this.getButtons();
135
+ const checked = buttons.find(button => button.value === this.value);
136
+ const root = checked.shadowRoot || checked;
137
+ const ripple = root.querySelector('ion-ripple-effect');
138
+ if (!ripple) {
139
+ return;
140
+ }
141
+ const { x, y } = helpers.pointerCoord(detail.event);
142
+ ripple.addRipple(x, y).then(remove => remove());
143
+ }
144
+ /*
145
+ * Activate both the segment and the buttons
146
+ * due to a bug with ::slotted in Safari
147
+ */
148
+ setActivated(activated) {
149
+ const buttons = this.getButtons();
150
+ buttons.forEach(button => {
151
+ if (activated) {
152
+ button.classList.add('segment-button-activated');
153
+ }
154
+ else {
155
+ button.classList.remove('segment-button-activated');
156
+ }
157
+ });
158
+ this.activated = activated;
159
+ }
160
+ activate(detail) {
161
+ const clicked = detail.event.target;
162
+ const buttons = this.getButtons();
163
+ const checked = buttons.find(button => button.value === this.value);
164
+ // Make sure we are only checking for activation on a segment button
165
+ // since disabled buttons will get the click on the segment
166
+ if (clicked.tagName !== 'ION-SEGMENT-BUTTON') {
167
+ return;
168
+ }
169
+ // If there are no checked buttons, set the current button to checked
170
+ if (!checked) {
171
+ this.value = clicked.value;
172
+ }
173
+ // If the gesture began on the clicked button with the indicator
174
+ // then we should activate the indicator
175
+ if (this.value === clicked.value) {
176
+ this.setActivated(true);
177
+ }
178
+ }
179
+ getIndicator(button) {
180
+ const root = button.shadowRoot || button;
181
+ return root.querySelector('.segment-button-indicator');
182
+ }
183
+ checkButton(previous, current) {
184
+ const previousIndicator = this.getIndicator(previous);
185
+ const currentIndicator = this.getIndicator(current);
186
+ if (previousIndicator === null || currentIndicator === null) {
187
+ return;
188
+ }
189
+ const previousClientRect = previousIndicator.getBoundingClientRect();
190
+ const currentClientRect = currentIndicator.getBoundingClientRect();
191
+ const widthDelta = previousClientRect.width / currentClientRect.width;
192
+ const xPosition = previousClientRect.left - currentClientRect.left;
193
+ // Scale the indicator width to match the previous indicator width
194
+ // and translate it on top of the previous indicator
195
+ const transform = `translate3d(${xPosition}px, 0, 0) scaleX(${widthDelta})`;
196
+ index.writeTask(() => {
197
+ // Remove the transition before positioning on top of the previous indicator
198
+ currentIndicator.classList.remove('segment-button-indicator-animated');
199
+ currentIndicator.style.setProperty('transform', transform);
200
+ // Force a repaint to ensure the transform happens
201
+ currentIndicator.getBoundingClientRect();
202
+ // Add the transition to move the indicator into place
203
+ currentIndicator.classList.add('segment-button-indicator-animated');
204
+ // Remove the transform to slide the indicator back to the button clicked
205
+ currentIndicator.style.setProperty('transform', '');
206
+ });
207
+ this.value = current.value;
208
+ this.setCheckedClasses();
209
+ }
210
+ setCheckedClasses() {
211
+ const buttons = this.getButtons();
212
+ const index = buttons.findIndex(button => button.value === this.value);
213
+ const next = index + 1;
214
+ // Keep track of the currently checked button
215
+ this.checked = buttons.find(button => button.value === this.value);
216
+ for (const button of buttons) {
217
+ button.classList.remove('segment-button-after-checked');
218
+ }
219
+ if (next < buttons.length) {
220
+ buttons[next].classList.add('segment-button-after-checked');
221
+ }
222
+ }
223
+ setNextIndex(detail, isEnd = false) {
224
+ const isRTL = document.dir === 'rtl';
225
+ const activated = this.activated;
226
+ const buttons = this.getButtons();
227
+ const index = buttons.findIndex(button => button.value === this.value);
228
+ const previous = buttons[index];
229
+ let current;
230
+ let nextIndex;
231
+ if (index === -1) {
232
+ return;
233
+ }
234
+ // Get the element that the touch event started on in case
235
+ // it was the checked button, then we will move the indicator
236
+ const rect = previous.getBoundingClientRect();
237
+ const left = rect.left;
238
+ const width = rect.width;
239
+ // Get the element that the gesture is on top of based on the currentX of the
240
+ // gesture event and the Y coordinate of the starting element, since the gesture
241
+ // can move up and down off of the segment
242
+ const currentX = detail.currentX;
243
+ const previousY = rect.top + (rect.height / 2);
244
+ const nextEl = document.elementFromPoint(currentX, previousY);
245
+ const decreaseIndex = isRTL ? currentX > (left + width) : currentX < left;
246
+ const increaseIndex = isRTL ? currentX < left : currentX > (left + width);
247
+ // If the indicator is currently activated then we have started the gesture
248
+ // on top of the checked button so we need to slide the indicator
249
+ // by checking the button next to it as we move
250
+ if (activated && !isEnd) {
251
+ // Decrease index, move left in LTR & right in RTL
252
+ if (decreaseIndex) {
253
+ const newIndex = index - 1;
254
+ if (newIndex >= 0) {
255
+ nextIndex = newIndex;
256
+ }
257
+ // Increase index, moves right in LTR & left in RTL
258
+ }
259
+ else if (increaseIndex) {
260
+ if (activated && !isEnd) {
261
+ const newIndex = index + 1;
262
+ if (newIndex < buttons.length) {
263
+ nextIndex = newIndex;
264
+ }
265
+ }
266
+ }
267
+ if (nextIndex !== undefined && !buttons[nextIndex].disabled) {
268
+ current = buttons[nextIndex];
269
+ }
270
+ }
271
+ // If the indicator is not activated then we will just set the indicator
272
+ // to the element where the gesture ended
273
+ if (!activated && isEnd) {
274
+ current = nextEl;
275
+ }
276
+ /* tslint:disable-next-line */
277
+ if (current != null) {
278
+ /**
279
+ * If current element is ion-segment then that means
280
+ * user tried to select a disabled ion-segment-button,
281
+ * and we should not update the ripple.
282
+ */
283
+ if (current.tagName === 'ION-SEGMENT') {
284
+ return false;
285
+ }
286
+ if (previous !== current) {
287
+ this.checkButton(previous, current);
288
+ }
289
+ }
290
+ return true;
291
+ }
292
+ emitStyle() {
293
+ this.ionStyle.emit({
294
+ 'segment': true
295
+ });
296
+ }
297
+ render() {
298
+ const mode = ionicGlobal.getIonMode(this);
299
+ return (index.h(index.Host, { onClick: this.onClick, class: Object.assign(Object.assign({}, theme.createColorClasses(this.color)), { [mode]: true, 'in-toolbar': theme.hostContext('ion-toolbar', this.el), 'in-toolbar-color': theme.hostContext('ion-toolbar[color]', this.el), 'segment-activated': this.activated, 'segment-disabled': this.disabled, 'segment-scrollable': this.scrollable }) }, index.h("slot", null)));
300
+ }
301
+ get el() { return index.getElement(this); }
302
+ static get watchers() { return {
303
+ "value": ["valueChanged"],
304
+ "disabled": ["disabledChanged"]
305
+ }; }
306
+ };
307
+ Segment.style = {
308
+ ios: segmentIosCss,
309
+ md: segmentMdCss
310
+ };
311
+
312
+ const segmentButtonIosCss = ":host{--color:initial;--color-hover:var(--color);--color-checked:var(--color);--color-disabled:var(--color);--padding-start:0;--padding-end:0;--padding-top:0;--padding-bottom:0;border-radius:var(--border-radius);display:flex;position:relative;flex:1 1 auto;flex-direction:column;height:auto;background:var(--background);color:var(--color);text-decoration:none;text-overflow:ellipsis;white-space:nowrap;font-kerning:none;cursor:pointer}.button-native{border-radius:0;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;margin-left:var(--margin-start);margin-right:var(--margin-end);margin-top:var(--margin-top);margin-bottom:var(--margin-bottom);padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);transform:translate3d(0, 0, 0);display:flex;position:relative;flex-direction:inherit;flex-grow:1;align-items:center;justify-content:center;width:100%;min-width:inherit;max-width:inherit;height:auto;min-height:inherit;max-height:inherit;transition:var(--transition);border:none;outline:none;background:transparent;contain:content;pointer-events:none;overflow:hidden;z-index:2}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.button-native{margin-left:unset;margin-right:unset;-webkit-margin-start:var(--margin-start);margin-inline-start:var(--margin-start);-webkit-margin-end:var(--margin-end);margin-inline-end:var(--margin-end)}}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.button-native{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.button-native::after{left:0;right:0;top:0;bottom:0;position:absolute;content:\"\";opacity:0}.button-inner{display:flex;position:relative;flex-flow:inherit;align-items:center;justify-content:center;width:100%;height:100%;z-index:1}:host(.segment-button-checked){background:var(--background-checked);color:var(--color-checked)}:host(.segment-button-disabled){cursor:default;pointer-events:none}:host(.ion-focused) .button-native{color:var(--color-focused)}:host(.ion-focused) .button-native::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}@media (any-hover: hover){:host(:hover) .button-native{color:var(--color-hover)}:host(:hover) .button-native::after{background:var(--background-hover);opacity:var(--background-hover-opacity)}:host(.segment-button-checked:hover) .button-native{color:var(--color-checked)}}::slotted(ion-icon){flex-shrink:0;order:-1;pointer-events:none}::slotted(ion-label){display:block;align-self:center;line-height:22px;text-overflow:ellipsis;white-space:nowrap;box-sizing:border-box;pointer-events:none}:host(.segment-button-layout-icon-top) .button-native{flex-direction:column}:host(.segment-button-layout-icon-start) .button-native{flex-direction:row}:host(.segment-button-layout-icon-end) .button-native{flex-direction:row-reverse}:host(.segment-button-layout-icon-bottom) .button-native{flex-direction:column-reverse}:host(.segment-button-layout-icon-hide) ::slotted(ion-icon){display:none}:host(.segment-button-layout-label-hide) ::slotted(ion-label){display:none}ion-ripple-effect{color:var(--ripple-color, var(--color-checked))}.segment-button-indicator{transform-origin:left;position:absolute;opacity:0;box-sizing:border-box;will-change:transform, opacity;pointer-events:none}.segment-button-indicator-background{width:100%;height:var(--indicator-height);transform:var(--indicator-transform);box-shadow:var(--indicator-box-shadow);pointer-events:none}.segment-button-indicator-animated{transition:var(--indicator-transition)}:host(.segment-button-checked) .segment-button-indicator{opacity:1}@media (prefers-reduced-motion: reduce){.segment-button-indicator-background{transform:none}.segment-button-indicator-animated{transition:none}}:host{--background:none;--background-checked:none;--background-hover:none;--background-hover-opacity:0;--background-focused:none;--background-focused-opacity:0;--border-radius:7px;--border-width:1px;--border-color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.12);--border-style:solid;--indicator-box-shadow:0 0 5px rgba(0, 0, 0, 0.16);--indicator-color:var(--ion-color-step-350, var(--ion-background-color, #fff));--indicator-height:100%;--indicator-transition:transform 260ms cubic-bezier(0.4, 0, 0.2, 1);--indicator-transform:none;--transition:100ms all linear;--padding-top:0;--padding-end:13px;--padding-bottom:0;--padding-start:13px;margin-top:2px;margin-bottom:2px;position:relative;flex-basis:0;flex-direction:row;min-width:70px;min-height:28px;transform:translate3d(0, 0, 0);font-size:13px;font-weight:450;line-height:37px}:host::before{margin-left:0;margin-right:0;margin-top:5px;margin-bottom:5px;transition:160ms opacity ease-in-out;transition-delay:100ms;border-left:var(--border-width) var(--border-style) var(--border-color);content:\"\";opacity:1;will-change:opacity}:host(:first-of-type)::before{border-left-color:transparent}:host(.segment-button-disabled){opacity:0.3}::slotted(ion-icon){font-size:24px}:host(.segment-button-layout-icon-start) ::slotted(ion-label){margin-left:2px;margin-right:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host(.segment-button-layout-icon-start) ::slotted(ion-label){margin-left:unset;margin-right:unset;-webkit-margin-start:2px;margin-inline-start:2px;-webkit-margin-end:0;margin-inline-end:0}}:host(.segment-button-layout-icon-end) ::slotted(ion-label){margin-left:0;margin-right:2px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host(.segment-button-layout-icon-end) ::slotted(ion-label){margin-left:unset;margin-right:unset;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:2px;margin-inline-end:2px}}.segment-button-indicator{padding-left:2px;padding-right:2px;left:0;right:0;top:0;bottom:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.segment-button-indicator{padding-left:unset;padding-right:unset;-webkit-padding-start:2px;padding-inline-start:2px;-webkit-padding-end:2px;padding-inline-end:2px}}.segment-button-indicator-background{border-radius:var(--border-radius);background:var(--indicator-color)}.segment-button-indicator-background{transition:var(--indicator-transition)}:host(.segment-button-checked)::before,:host(.segment-button-after-checked)::before{opacity:0}:host(.segment-button-checked){z-index:-1}:host(.segment-button-activated){--indicator-transform:scale(0.95)}:host(.ion-focused) .button-native{opacity:0.7}@media (any-hover: hover){:host(:hover) .button-native{opacity:0.5}:host(.segment-button-checked:hover) .button-native{opacity:1}}:host(.in-segment-color){background:none;color:var(--ion-text-color, #000)}:host(.in-segment-color) .segment-button-indicator-background{background:var(--ion-color-step-350, var(--ion-background-color, #fff))}@media (any-hover: hover){:host(.in-segment-color:hover) .button-native,:host(.in-segment-color.segment-button-checked:hover) .button-native{color:var(--ion-text-color, #000)}}:host(.in-toolbar:not(.in-segment-color)){--background-checked:var(--ion-toolbar-segment-background-checked, none);--color:var(--ion-toolbar-segment-color, var(--ion-toolbar-color), initial);--color-checked:var(--ion-toolbar-segment-color-checked, var(--ion-toolbar-color), initial);--indicator-color:var(--ion-toolbar-segment-indicator-color, var(--ion-color-step-350, var(--ion-background-color, #fff)))}:host(.in-toolbar-color) .segment-button-indicator-background{background:#fff}:host(.in-toolbar-color:not(.in-segment-color)) .button-native{color:var(--ion-color-contrast)}:host(.in-toolbar-color.segment-button-checked:not(.in-segment-color)) .button-native{color:var(--ion-color-base)}@media (any-hover: hover){:host(.in-toolbar-color:not(.in-segment-color):hover) .button-native{color:var(--ion-color-contrast)}:host(.in-toolbar-color.segment-button-checked:not(.in-segment-color):hover) .button-native{color:var(--ion-color-base)}}";
313
+
314
+ const segmentButtonMdCss = ":host{--color:initial;--color-hover:var(--color);--color-checked:var(--color);--color-disabled:var(--color);--padding-start:0;--padding-end:0;--padding-top:0;--padding-bottom:0;border-radius:var(--border-radius);display:flex;position:relative;flex:1 1 auto;flex-direction:column;height:auto;background:var(--background);color:var(--color);text-decoration:none;text-overflow:ellipsis;white-space:nowrap;font-kerning:none;cursor:pointer}.button-native{border-radius:0;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;margin-left:var(--margin-start);margin-right:var(--margin-end);margin-top:var(--margin-top);margin-bottom:var(--margin-bottom);padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);transform:translate3d(0, 0, 0);display:flex;position:relative;flex-direction:inherit;flex-grow:1;align-items:center;justify-content:center;width:100%;min-width:inherit;max-width:inherit;height:auto;min-height:inherit;max-height:inherit;transition:var(--transition);border:none;outline:none;background:transparent;contain:content;pointer-events:none;overflow:hidden;z-index:2}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.button-native{margin-left:unset;margin-right:unset;-webkit-margin-start:var(--margin-start);margin-inline-start:var(--margin-start);-webkit-margin-end:var(--margin-end);margin-inline-end:var(--margin-end)}}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.button-native{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.button-native::after{left:0;right:0;top:0;bottom:0;position:absolute;content:\"\";opacity:0}.button-inner{display:flex;position:relative;flex-flow:inherit;align-items:center;justify-content:center;width:100%;height:100%;z-index:1}:host(.segment-button-checked){background:var(--background-checked);color:var(--color-checked)}:host(.segment-button-disabled){cursor:default;pointer-events:none}:host(.ion-focused) .button-native{color:var(--color-focused)}:host(.ion-focused) .button-native::after{background:var(--background-focused);opacity:var(--background-focused-opacity)}@media (any-hover: hover){:host(:hover) .button-native{color:var(--color-hover)}:host(:hover) .button-native::after{background:var(--background-hover);opacity:var(--background-hover-opacity)}:host(.segment-button-checked:hover) .button-native{color:var(--color-checked)}}::slotted(ion-icon){flex-shrink:0;order:-1;pointer-events:none}::slotted(ion-label){display:block;align-self:center;line-height:22px;text-overflow:ellipsis;white-space:nowrap;box-sizing:border-box;pointer-events:none}:host(.segment-button-layout-icon-top) .button-native{flex-direction:column}:host(.segment-button-layout-icon-start) .button-native{flex-direction:row}:host(.segment-button-layout-icon-end) .button-native{flex-direction:row-reverse}:host(.segment-button-layout-icon-bottom) .button-native{flex-direction:column-reverse}:host(.segment-button-layout-icon-hide) ::slotted(ion-icon){display:none}:host(.segment-button-layout-label-hide) ::slotted(ion-label){display:none}ion-ripple-effect{color:var(--ripple-color, var(--color-checked))}.segment-button-indicator{transform-origin:left;position:absolute;opacity:0;box-sizing:border-box;will-change:transform, opacity;pointer-events:none}.segment-button-indicator-background{width:100%;height:var(--indicator-height);transform:var(--indicator-transform);box-shadow:var(--indicator-box-shadow);pointer-events:none}.segment-button-indicator-animated{transition:var(--indicator-transition)}:host(.segment-button-checked) .segment-button-indicator{opacity:1}@media (prefers-reduced-motion: reduce){.segment-button-indicator-background{transform:none}.segment-button-indicator-animated{transition:none}}:host{--background:none;--background-checked:none;--background-hover:var(--color-checked);--background-focused:var(--color-checked);--background-activated-opacity:0;--background-focused-opacity:.12;--background-hover-opacity:.04;--color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.6);--color-checked:var(--ion-color-primary, #3880ff);--indicator-box-shadow:none;--indicator-color:var(--color-checked);--indicator-height:2px;--indicator-transition:transform 250ms cubic-bezier(0.4, 0, 0.2, 1);--indicator-transform:none;--padding-top:0;--padding-end:16px;--padding-bottom:0;--padding-start:16px;--transition:color 0.15s linear 0s, opacity 0.15s linear 0s;min-width:90px;max-width:360px;min-height:48px;border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);font-size:14px;font-weight:500;letter-spacing:0.06em;line-height:40px;text-transform:uppercase}.button-native{min-width:90px}:host(.segment-button-disabled){opacity:0.3}:host(.in-segment-color){background:none;color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.6)}:host(.in-segment-color) ion-ripple-effect{color:var(--ion-color-base)}:host(.in-segment-color) .segment-button-indicator-background{background:var(--ion-color-base)}:host(.in-segment-color.segment-button-checked) .button-native{color:var(--ion-color-base)}:host(.in-segment-color.ion-focused) .button-native::after{background:var(--ion-color-base)}@media (any-hover: hover){:host(.in-segment-color:hover) .button-native{color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.6)}:host(.in-segment-color:hover) .button-native::after{background:var(--ion-color-base)}:host(.in-segment-color.segment-button-checked:hover) .button-native{color:var(--ion-color-base)}}:host(.in-toolbar:not(.in-segment-color)){--background:var(--ion-toolbar-segment-background, none);--background-checked:var(--ion-toolbar-segment-background-checked, none);--color:var(--ion-toolbar-segment-color, rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.6));--color-checked:var(--ion-toolbar-segment-color-checked, var(--ion-color-primary, #3880ff));--indicator-color:var(--ion-toolbar-segment-color-checked, var(--color-checked))}:host(.in-toolbar-color:not(.in-segment-color)) .button-native{color:rgba(var(--ion-color-contrast-rgb), 0.6)}:host(.in-toolbar-color.segment-button-checked:not(.in-segment-color)) .button-native{color:var(--ion-color-contrast)}@media (any-hover: hover){:host(.in-toolbar-color:not(.in-segment-color)) .button-native::after{background:var(--ion-color-contrast)}}::slotted(ion-icon){margin-top:12px;margin-bottom:12px;font-size:24px}::slotted(ion-label){margin-top:12px;margin-bottom:12px}:host(.segment-button-layout-icon-top) ::slotted(ion-label),:host(.segment-button-layout-icon-bottom) ::slotted(ion-icon){margin-top:0}:host(.segment-button-layout-icon-top) ::slotted(ion-icon),:host(.segment-button-layout-icon-bottom) ::slotted(ion-label){margin-bottom:0}:host(.segment-button-layout-icon-start) ::slotted(ion-label){margin-left:8px;margin-right:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host(.segment-button-layout-icon-start) ::slotted(ion-label){margin-left:unset;margin-right:unset;-webkit-margin-start:8px;margin-inline-start:8px;-webkit-margin-end:0;margin-inline-end:0}}:host(.segment-button-layout-icon-end) ::slotted(ion-label){margin-left:0;margin-right:8px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host(.segment-button-layout-icon-end) ::slotted(ion-label){margin-left:unset;margin-right:unset;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:8px;margin-inline-end:8px}}:host(.segment-button-has-icon-only) ::slotted(ion-icon){margin-top:12px;margin-bottom:12px}:host(.segment-button-has-label-only) ::slotted(ion-label){margin-top:12px;margin-bottom:12px}.segment-button-indicator{left:0;right:0;bottom:0}.segment-button-indicator-background{background:var(--indicator-color)}:host(.in-toolbar:not(.in-segment-color)) .segment-button-indicator-background{background:var(--ion-toolbar-segment-indicator-color, var(--indicator-color))}:host(.in-toolbar-color:not(.in-segment-color)) .segment-button-indicator-background{background:var(--ion-color-contrast)}";
315
+
316
+ let ids = 0;
317
+ const SegmentButton = class {
318
+ constructor(hostRef) {
319
+ index.registerInstance(this, hostRef);
320
+ this.segmentEl = null;
321
+ this.checked = false;
322
+ /**
323
+ * If `true`, the user cannot interact with the segment button.
324
+ */
325
+ this.disabled = false;
326
+ /**
327
+ * Set the layout of the text and icon in the segment.
328
+ */
329
+ this.layout = 'icon-top';
330
+ /**
331
+ * The type of the button.
332
+ */
333
+ this.type = 'button';
334
+ /**
335
+ * The value of the segment button.
336
+ */
337
+ this.value = 'ion-sb-' + (ids++);
338
+ this.updateState = () => {
339
+ if (this.segmentEl) {
340
+ this.checked = this.segmentEl.value === this.value;
341
+ }
342
+ };
343
+ }
344
+ connectedCallback() {
345
+ const segmentEl = this.segmentEl = this.el.closest('ion-segment');
346
+ if (segmentEl) {
347
+ this.updateState();
348
+ segmentEl.addEventListener('ionSelect', this.updateState);
349
+ }
350
+ }
351
+ disconnectedCallback() {
352
+ const segmentEl = this.segmentEl;
353
+ if (segmentEl) {
354
+ segmentEl.removeEventListener('ionSelect', this.updateState);
355
+ this.segmentEl = null;
356
+ }
357
+ }
358
+ get hasLabel() {
359
+ return !!this.el.querySelector('ion-label');
360
+ }
361
+ get hasIcon() {
362
+ return !!this.el.querySelector('ion-icon');
363
+ }
364
+ render() {
365
+ const { checked, type, disabled, hasIcon, hasLabel, layout } = this;
366
+ const mode = ionicGlobal.getIonMode(this);
367
+ return (index.h(index.Host, { "aria-disabled": disabled ? 'true' : null, class: {
368
+ [mode]: true,
369
+ 'in-toolbar': theme.hostContext('ion-toolbar', this.el),
370
+ 'in-toolbar-color': theme.hostContext('ion-toolbar[color]', this.el),
371
+ 'in-segment': theme.hostContext('ion-segment', this.el),
372
+ 'in-segment-color': theme.hostContext('ion-segment[color]', this.el),
373
+ 'segment-button-has-label': hasLabel,
374
+ 'segment-button-has-icon': hasIcon,
375
+ 'segment-button-has-label-only': hasLabel && !hasIcon,
376
+ 'segment-button-has-icon-only': hasIcon && !hasLabel,
377
+ 'segment-button-disabled': disabled,
378
+ 'segment-button-checked': checked,
379
+ [`segment-button-layout-${layout}`]: true,
380
+ 'ion-activatable': true,
381
+ 'ion-activatable-instant': true,
382
+ 'ion-focusable': true,
383
+ } }, index.h("button", { type: type, "aria-pressed": checked ? 'true' : null, class: "button-native", disabled: disabled }, index.h("span", { class: "button-inner" }, index.h("slot", null)), mode === 'md' && index.h("ion-ripple-effect", null)), index.h("div", { part: "indicator", class: {
384
+ 'segment-button-indicator': true,
385
+ 'segment-button-indicator-animated': true
386
+ } }, index.h("div", { part: "indicator-background", class: "segment-button-indicator-background" }))));
387
+ }
388
+ get el() { return index.getElement(this); }
389
+ };
390
+ SegmentButton.style = {
391
+ ios: segmentButtonIosCss,
392
+ md: segmentButtonMdCss
393
+ };
394
+
395
+ const skeletonTextCss = ":host{--background:rgba(var(--background-rgb, var(--ion-text-color-rgb, 0, 0, 0)), 0.065);border-radius:var(--border-radius, inherit);display:block;width:100%;height:inherit;margin-top:4px;margin-bottom:4px;background:var(--background);line-height:10px;user-select:none;pointer-events:none}span{display:inline-block}:host(.in-media){margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;height:100%}:host(.skeleton-text-animated){position:relative;background:linear-gradient(to right, rgba(var(--background-rgb, var(--ion-text-color-rgb, 0, 0, 0)), 0.065) 8%, rgba(var(--background-rgb, var(--ion-text-color-rgb, 0, 0, 0)), 0.135) 18%, rgba(var(--background-rgb, var(--ion-text-color-rgb, 0, 0, 0)), 0.065) 33%);background-size:800px 104px;animation-duration:1s;animation-fill-mode:forwards;animation-iteration-count:infinite;animation-name:shimmer;animation-timing-function:linear}@keyframes shimmer{0%{background-position:-468px 0}100%{background-position:468px 0}}";
396
+
397
+ const SkeletonText = class {
398
+ constructor(hostRef) {
399
+ index.registerInstance(this, hostRef);
400
+ /**
401
+ * If `true`, the skeleton text will animate.
402
+ */
403
+ this.animated = false;
404
+ }
405
+ render() {
406
+ const animated = this.animated && ionicGlobal.config.getBoolean('animated', true);
407
+ const inMedia = theme.hostContext('ion-avatar', this.el) || theme.hostContext('ion-thumbnail', this.el);
408
+ const mode = ionicGlobal.getIonMode(this);
409
+ return (index.h(index.Host, { class: {
410
+ [mode]: true,
411
+ 'skeleton-text-animated': animated,
412
+ 'in-media': inMedia
413
+ } }, index.h("span", null, "\u00A0")));
414
+ }
415
+ get el() { return index.getElement(this); }
416
+ };
417
+ SkeletonText.style = skeletonTextCss;
418
+
419
+ const amen$1 = "Amen.";
420
+ const book = "Book";
421
+ const chapter = "Chapter";
422
+ const citation$3 = "Citation (e.g., John 1:1)";
423
+ const label$3 = "Label";
424
+ const loading$1 = "Loading...";
425
+ const verse = "Verse";
426
+ const changeReading = "Change Reading";
427
+ const newCitation = "Biblical citation.";
428
+ const cancel$1 = "Cancel";
429
+ const ok$1 = "OK";
430
+ const EN$8 = {
431
+ amen: amen$1,
432
+ book: book,
433
+ chapter: chapter,
434
+ citation: citation$3,
435
+ label: label$3,
436
+ loading: loading$1,
437
+ verse: verse,
438
+ changeReading: changeReading,
439
+ newCitation: newCitation,
440
+ cancel: cancel$1,
441
+ ok: ok$1
442
+ };
443
+
444
+ const amen = "Amén.";
445
+ const loading = "Se está cargando...";
446
+ const ES = {
447
+ amen: amen,
448
+ loading: loading
449
+ };
450
+
451
+ async function fetchReading(citation, version = 'NRSV', api = 'https://us-central1-venite-2.cloudfunctions.net') {
452
+ const findURL = new URL(`${api}/bible`);
453
+ findURL.searchParams.append('citation', citation);
454
+ if (!['NRSV', 'NRSVAE', 'ESV', 'CEB', 'KJV'].includes(version)) {
455
+ findURL.searchParams.append('version', 'NRSV');
456
+ }
457
+ else {
458
+ findURL.searchParams.append('version', version);
459
+ }
460
+ const response = await fetch(findURL.toString()), body = await response.text();
461
+ try {
462
+ return JSON.parse(body);
463
+ }
464
+ catch (_a) {
465
+ throw new Error(body);
466
+ }
467
+ }
468
+
469
+ const bibleReadingCss = "ldf-bible-reading.sc-ldf-bible-reading,.sc-ldf-bible-reading-h{font-family:var(--ldf-font-face);text-align:var(--ldf-text-align)}.bible-reading[lang=he].sc-ldf-bible-reading{text-align:right;direction:rtl;font-size:1.5em;font-family:\"Times New Roman\" !important}.bible-reading[lang=he].sc-ldf-bible-reading .drop.sc-ldf-bible-reading{float:right !important;font-family:\"Times New Roman\" !important}.bible-reading.omit.sc-ldf-bible-reading .verses.sc-ldf-bible-reading{display:none}.editable.bible-reading.sc-ldf-bible-reading .verses.sc-ldf-bible-reading{display:block;color:var(--ldf-greyed-out-text-color)}sup.sc-ldf-bible-reading{display:var(--ldf-bible-reading-verse-number-display);margin-left:0;margin-right:0.25em}.citation.sc-ldf-bible-reading{font-size:80%;font-style:italic;margin-left:1em;float:var(--ldf-bible-reading-citation-float)}.response.sc-ldf-bible-reading{font-weight:var(--ldf-response-font-weight);font-style:var(--ldf-response-font-style)}.verses.sc-ldf-bible-reading .verse.sc-ldf-bible-reading{display:flex;flex-direction:row}sup.sc-ldf-bible-reading:first-of-type{display:var(--ldf-drop-early-verses-display)}.editable-verse.sc-ldf-bible-reading{display:inline}.editable-citation.sc-ldf-bible-reading{display:inline;width:100%}.editable-citation.sc-ldf-bible-reading ldf-editable-text.sc-ldf-bible-reading{display:inline-block;width:25px}.editable-citation.sc-ldf-bible-reading ldf-editable-text.book.sc-ldf-bible-reading{width:75px}h3.editable-label.sc-ldf-bible-reading{text-align:var(--ldf-h3-text-align);font-weight:var(--ldf-h3-font-weight);font-style:var(--ldf-h3-font-style);font-variant:var(--ldf-h3-font-variant);font-size:var(--ldf-h3-font-size);text-transform:var(--ldf-h3-text-transform)}.citation-button.sc-ldf-bible-reading{background:none;border:0;font-family:var(--ldf-font-face);font-size:inherit}";
470
+
471
+ const LOCALE$8 = {
472
+ 'en': EN$8,
473
+ 'es': ES
474
+ };
475
+ const BibleReadingComponent = class {
476
+ constructor(hostRef) {
477
+ index.registerInstance(this, hostRef);
478
+ this.ldfDocShouldChange = index.createEvent(this, "ldfDocShouldChange", 7);
479
+ }
480
+ docChanged(newDoc) {
481
+ try {
482
+ if (typeof newDoc == 'string') {
483
+ this.obj = new rubric.BibleReading(JSON.parse(newDoc));
484
+ }
485
+ else {
486
+ this.obj = new rubric.BibleReading(newDoc);
487
+ }
488
+ this.processIntro();
489
+ }
490
+ catch (e) {
491
+ console.warn(e);
492
+ this.obj = new rubric.BibleReading();
493
+ }
494
+ this.loadVerses();
495
+ }
496
+ // Lifecycle events
497
+ async componentWillLoad() {
498
+ this.docChanged(this.doc);
499
+ this.loadLocaleStrings();
500
+ this.loadVerses();
501
+ this.processIntro();
502
+ }
503
+ processIntro() {
504
+ var _a, _b;
505
+ // process intro
506
+ if ((_b = (_a = this.obj) === null || _a === void 0 ? void 0 : _a.metadata) === null || _b === void 0 ? void 0 : _b.intro) {
507
+ try {
508
+ this.obj.compileIntro();
509
+ this.obj = new rubric.BibleReading(Object.assign({}, this.obj));
510
+ }
511
+ catch (e) {
512
+ console.warn(e);
513
+ console.warn(this.obj);
514
+ }
515
+ }
516
+ }
517
+ // Private methods
518
+ async loadLocaleStrings() {
519
+ try {
520
+ this.localeStrings = LOCALE$8[locale.getComponentClosestLanguage(this.element)];
521
+ }
522
+ catch (e) {
523
+ console.warn(e);
524
+ }
525
+ }
526
+ async changeReading() {
527
+ var _a;
528
+ const localeStrings = this.localeStrings || {};
529
+ const alert = await overlays.alertController.create({
530
+ header: localeStrings.changeReading,
531
+ inputs: [
532
+ {
533
+ name: 'citation',
534
+ type: 'text',
535
+ value: (_a = this.obj) === null || _a === void 0 ? void 0 : _a.citation,
536
+ placeholder: localeStrings.newCitation
537
+ },
538
+ ],
539
+ buttons: [
540
+ {
541
+ text: localeStrings.cancel,
542
+ role: 'cancel',
543
+ cssClass: 'secondary'
544
+ },
545
+ {
546
+ text: localeStrings.ok,
547
+ handler: async (data) => {
548
+ var _a, _b, _c;
549
+ this.ldfDocShouldChange.emit(new change.Change({
550
+ path: this.path,
551
+ op: [
552
+ {
553
+ type: 'set',
554
+ index: 'citation',
555
+ oldValue: (_a = this.obj) === null || _a === void 0 ? void 0 : _a.citation,
556
+ value: data === null || data === void 0 ? void 0 : data.citation
557
+ }
558
+ ]
559
+ }));
560
+ const loading = await overlays.loadingController.create({
561
+ message: localeStrings.loading
562
+ });
563
+ await loading.present();
564
+ const newReading = await fetchReading(data.citation, option$1.versionToString((_b = this.obj) === null || _b === void 0 ? void 0 : _b.version));
565
+ await loading.dismiss();
566
+ this.ldfDocShouldChange.emit(new change.Change({
567
+ path: this.path,
568
+ op: [{
569
+ type: 'set',
570
+ index: 'value',
571
+ oldValue: (_c = this.obj) === null || _c === void 0 ? void 0 : _c.value,
572
+ value: (newReading === null || newReading === void 0 ? void 0 : newReading.value) || []
573
+ }]
574
+ }));
575
+ this.obj = new rubric.BibleReading(Object.assign(Object.assign({}, this.obj), { citation: data === null || data === void 0 ? void 0 : data.citation, value: (newReading === null || newReading === void 0 ? void 0 : newReading.value) || [] }));
576
+ this.loadVerses();
577
+ }
578
+ }
579
+ ]
580
+ });
581
+ await alert.present();
582
+ }
583
+ loadVerses() {
584
+ this.verses = this.obj.value || [];
585
+ }
586
+ paragraphs() {
587
+ const paragraphs = new Array();
588
+ let currentParagraph = new Array();
589
+ this.verses.forEach(verse => {
590
+ if (verse.hasOwnProperty('type') && verse.type === 'heading') {
591
+ paragraphs.push(currentParagraph);
592
+ currentParagraph = new Array();
593
+ }
594
+ else {
595
+ currentParagraph.push(verse);
596
+ }
597
+ });
598
+ paragraphs.push(currentParagraph);
599
+ return paragraphs;
600
+ }
601
+ // Render
602
+ render() {
603
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
604
+ const localeStrings = this.localeStrings || {};
605
+ if (this.verses) {
606
+ /* Editable version */
607
+ if (this.editable) {
608
+ const template = Object.assign(Object.assign({}, this.verses[0]), { text: '' }), templateMaker = (text) => (Object.assign(Object.assign({}, template), { text }));
609
+ return (index.h("div", { lang: (_a = this.obj) === null || _a === void 0 ? void 0 : _a.language, class: `editable bible-reading ${((_b = this.obj) === null || _b === void 0 ? void 0 : _b.display_format) || 'default'}` }, this.editable && index.h("ldf-label-bar", null, index.h("slot", { slot: 'end', name: 'controls' }, index.h("ion-buttons", null, index.h("ion-button", { onClick: () => this.changeReading() }, index.h("ion-icon", { name: "swap-horizontal", slot: "start" }), index.h("ion-label", null, localeStrings.changeReading))))), index.h("ldf-label-bar", null, index.h("h3", { class: "editable-label", slot: "start" }, index.h("ldf-editable-text", { id: "label", text: (_c = this.obj) === null || _c === void 0 ? void 0 : _c.label, path: `${this.path}/label`, placeholder: localeStrings.label })), ((_d = this.obj) === null || _d === void 0 ? void 0 : _d.citation) && index.h("button", { class: "citation-button", slot: "end", onClick: () => this.changeReading() }, this.obj.citation)), ((_f = (_e = this.obj) === null || _e === void 0 ? void 0 : _e.metadata) === null || _f === void 0 ? void 0 : _f.compiled_intro) && index.h("ldf-liturgical-document", { editable: true, doc: this.obj.metadata.intro, path: `${this.path}/metadata/intro` }), index.h("section", { class: "verses" }, this.verses.map((verse, verseIndex) => [
610
+ verse.hasOwnProperty('type') && verse.type === 'heading'
611
+ ? index.h("ldf-heading", { editable: true, doc: verse, path: `${this.path}/value/${verseIndex}` })
612
+ : index.h("div", { class: "editable-verse" }, index.h("div", { class: "editable-citation" }, index.h("ldf-editable-text", { class: "book", id: `verse-${verseIndex}-book`, text: verse.book, path: `${this.path}/value/${verseIndex}/book`, placeholder: localeStrings.book, short: true }), index.h("ldf-editable-text", { id: `verse-${verseIndex}-chapter`, text: verse.chapter, path: `${this.path}/value/${verseIndex}/chapter`, placeholder: localeStrings.chapter, short: true }), " :", index.h("ldf-editable-text", { id: `verse-${verseIndex}-verse`, text: verse.verse, path: `${this.path}/value/${verseIndex}/verse`, placeholder: localeStrings.verse, short: true })), index.h("ldf-editable-text", { id: `verse-${verseIndex}-text`, text: verse.text, path: `${this.path}/value/${verseIndex}/text`, placeholder: localeStrings.text, short: false, template: template, templateMaker: templateMaker }))
613
+ ]))));
614
+ }
615
+ /* `short` renders a few verses, with a response and citation. */
616
+ else if (this.obj.style == 'short') {
617
+ const shortResponse = (((_h = (_g = this.obj) === null || _g === void 0 ? void 0 : _g.metadata) === null || _h === void 0 ? void 0 : _h.response) || localeStrings.amen).length <= 5;
618
+ let responseNode;
619
+ if (!((_k = (_j = this.obj) === null || _j === void 0 ? void 0 : _j.metadata) === null || _k === void 0 ? void 0 : _k.response)) {
620
+ responseNode = index.h("span", { class: "response" }, " ", localeStrings.amen);
621
+ }
622
+ else {
623
+ responseNode = index.h("span", { class: "response" }, " ", this.obj.metadata.response);
624
+ }
625
+ return (index.h(index.Host, null, ((_l = this.obj) === null || _l === void 0 ? void 0 : _l.label) && index.h("ldf-heading", { doc: new heading$1.Heading({ type: 'heading', metadata: { level: 3 }, value: [this.obj.label] }) }), index.h("div", { lang: (_m = this.obj) === null || _m === void 0 ? void 0 : _m.language, class: `bible-reading ${((_o = this.obj) === null || _o === void 0 ? void 0 : _o.display_format) || 'default'}` }, index.h("p", null, this.verses.map((verse, verseIndex) => {
626
+ var _a;
627
+ return verse.hasOwnProperty('type') && verse.type === 'heading'
628
+ ? index.h("ldf-heading", { doc: new heading$1.Heading(verse) })
629
+ : index.h("ldf-string", { citation: { book: verse.book, chapter: verse.chapter, verse: verse.verse }, id: this.obj.uid, text: verse.text, fragment: this.path, dropcap: ((_a = this.obj) === null || _a === void 0 ? void 0 : _a.display_format) == "force_dropcap" && verseIndex === 0 ? "force" : "disabled" });
630
+ }), shortResponse && !((_q = (_p = this.obj) === null || _p === void 0 ? void 0 : _p.metadata) === null || _q === void 0 ? void 0 : _q.omit_response) && responseNode, index.h("span", { class: "citation" }, this.obj.citation)), !shortResponse && !((_s = (_r = this.obj) === null || _r === void 0 ? void 0 : _r.metadata) === null || _s === void 0 ? void 0 : _s.omit_response) && index.h("p", null, responseNode))));
631
+ }
632
+ /* `long` render a typical Bible reading in the liturgy */
633
+ else {
634
+ const paragraphs = this.paragraphs();
635
+ return (index.h("div", { lang: (_t = this.obj) === null || _t === void 0 ? void 0 : _t.language, class: `bible-reading ${((_u = this.obj) === null || _u === void 0 ? void 0 : _u.display_format) || 'default'}` }, index.h("ldf-heading", { doc: new heading$1.Heading({ type: 'heading', metadata: { level: 3 }, value: [this.obj.label], citation: this.obj.citation }) }), ((_w = (_v = this.obj) === null || _v === void 0 ? void 0 : _v.metadata) === null || _w === void 0 ? void 0 : _w.compiled_intro) && index.h("ldf-liturgical-document", { doc: this.obj.metadata.compiled_intro }), paragraphs.map((paragraph, paragraphIndex) => index.h("p", { lang: this.obj.language }, paragraph.map((verse, verseIndex) => verse.hasOwnProperty('type') && verse.type === 'heading'
636
+ ? index.h("ldf-heading", { doc: new heading$1.Heading(verse) })
637
+ : [
638
+ index.h("sup", null, verse.verse),
639
+ index.h("ldf-string", { citation: verse, dropcap: paragraphIndex == 0 && verseIndex == 0 ? 'force' : 'disabled', id: `${verse.chapter}-${verse.book}-${verse.verse}`, text: verse.text, index: verseIndex, fragment: this.path })
640
+ ])))));
641
+ }
642
+ }
643
+ else {
644
+ return this.loadingError ? index.h("pre", null, this.loadingError) : index.h("p", null, localeStrings.loading);
645
+ }
646
+ }
647
+ get element() { return index.getElement(this); }
648
+ static get watchers() { return {
649
+ "doc": ["docChanged"]
650
+ }; }
651
+ };
652
+ BibleReadingComponent.style = bibleReadingCss;
653
+
654
+ const add = "Add";
655
+ const label$2 = "Label";
656
+ const citation$2 = "Citation";
657
+ const EN$7 = {
658
+ add: add,
659
+ label: label$2,
660
+ citation: citation$2
661
+ };
662
+
663
+ const editableAddBlockCss = ".sc-ldf-editable-add-block-h{display:flex;flex-direction:column;align-items:center;width:100%}.sc-ldf-editable-add-block-h .button-container.sc-ldf-editable-add-block{display:flex;align-items:center;height:0;justify-content:center;width:100%}.sc-ldf-editable-add-block-h button.sc-ldf-editable-add-block{background-color:var(--ldf-background-color);color:var(--ldf-color);font-family:var(--ldf-controls-font-family);font-weight:lighter}.sc-ldf-editable-add-block-h button.sc-ldf-editable-add-block:hover{cursor:pointer}.sc-ldf-editable-add-block-h .visible.sc-ldf-editable-add-block{height:0;opacity:1;transition:0.25s}.sc-ldf-editable-add-block-h .hidden.sc-ldf-editable-add-block{height:0;opacity:0;transition:2s}.sc-ldf-editable-add-block-h .underlying.sc-ldf-editable-add-block{width:100%;border-top:1px solid #a0a0a0;border-bottom:1px solid #a0a0a0;min-height:1em;position:relative;bottom:0.5em;z-index:-1}.sc-ldf-editable-add-block-h .underlying.visible.sc-ldf-editable-add-block{opacity:0.5;transition:0.25s}.sc-ldf-editable-add-block-h .underlying.visible.expanded.sc-ldf-editable-add-block{z-index:1}.sc-ldf-editable-add-block-h .underlying.collapsed.sc-ldf-editable-add-block{height:1em}.sc-ldf-editable-add-block-h .underlying.hidden.sc-ldf-editable-add-block{opacity:0;transition:1s}.sc-ldf-editable-add-block-h .underlying.hidden.sc-ldf-editable-add-block button.sc-ldf-editable-add-block{z-index:-1}.sc-ldf-editable-add-block-h .visually-hidden.sc-ldf-editable-add-block{position:absolute !important;height:1px;width:1px;overflow:hidden;clip:rect(1px 1px 1px 1px);clip:rect(1px, 1px, 1px, 1px);white-space:nowrap}.button.sc-ldf-editable-add-block{position:absolute;display:flex;flex-direction:row;align-items:center;justify-content:center;opacity:1;transition:all 0.25s}.hidden.sc-ldf-editable-add-block{display:none;height:0;opacity:0;transition:all 0.25s}";
664
+
665
+ const LOCALE$7 = {
666
+ 'en': EN$7
667
+ };
668
+ const EditableAddBlockComponent = class {
669
+ constructor(hostRef) {
670
+ index.registerInstance(this, hostRef);
671
+ this.ldfDocShouldChange = index.createEvent(this, "ldfDocShouldChange", 7);
672
+ this.ldfDocShouldAdd = index.createEvent(this, "ldfDocShouldAdd", 7);
673
+ }
674
+ // Lifecycle events
675
+ async componentWillLoad() {
676
+ this.loadLocaleStrings();
677
+ }
678
+ // Methods
679
+ async loadLocaleStrings() {
680
+ try {
681
+ this.localeStrings = LOCALE$7[locale.getComponentClosestLanguage(this.element)];
682
+ }
683
+ catch (e) {
684
+ console.warn(e);
685
+ }
686
+ }
687
+ // Render
688
+ render() {
689
+ const localeStrings = this.localeStrings || {};
690
+ return (index.h(index.Host, null, index.h("div", { class: {
691
+ button: true,
692
+ hidden: !this.visible,
693
+ } }, index.h("ion-button", { "aria-role": "button", fill: "outline", onClick: () => this.ldfDocShouldAdd.emit({ base: this.base, index: this.index }) }, index.h("ion-icon", { name: "add", slot: "icon-only" }), index.h("ion-label", { class: "visually-hidden" }, localeStrings.add)))));
694
+ }
695
+ get element() { return index.getElement(this); }
696
+ };
697
+ EditableAddBlockComponent.style = editableAddBlockCss;
698
+
699
+ const abbreviated = "Abbreviated";
700
+ const addOption = "Add an Option";
701
+ const cancel = "Cancel";
702
+ const condition$1 = "Conditions";
703
+ const copy = "Copy";
704
+ const copied = "Copied to Clipboard";
705
+ const displayFormat = "Display";
706
+ const halfverse = "By Half Verse";
707
+ const heading = "Heading Level";
708
+ const heading1 = "1. Title";
709
+ const heading2 = "2. Section Title";
710
+ const heading3 = "3. Label";
711
+ const heading4 = "4. Sub-Section Label";
712
+ const move_down = "Move Down";
713
+ const move_up = "Move Up";
714
+ const ok = "OK";
715
+ const omit = "Omit";
716
+ const preferences = "Preferences";
717
+ const settings = "Settings";
718
+ const edit = "Edit";
719
+ const preview = "Preview";
720
+ const responsive = "Responsive Display Settings";
721
+ const responsiveMsg = "What size devices should this appear on?";
722
+ const responsiveAll = "All devices";
723
+ const responsiveSmallOnly = "Only on small screens";
724
+ const responsiveSmallHidden = "Not on small screens";
725
+ const unison = "Unison";
726
+ const wholeverse = "By Whole Verse";
727
+ const EN$6 = {
728
+ abbreviated: abbreviated,
729
+ addOption: addOption,
730
+ cancel: cancel,
731
+ condition: condition$1,
732
+ copy: copy,
733
+ copied: copied,
734
+ "default": "Default",
735
+ displayFormat: displayFormat,
736
+ halfverse: halfverse,
737
+ heading: heading,
738
+ heading1: heading1,
739
+ heading2: heading2,
740
+ heading3: heading3,
741
+ heading4: heading4,
742
+ move_down: move_down,
743
+ move_up: move_up,
744
+ ok: ok,
745
+ omit: omit,
746
+ preferences: preferences,
747
+ settings: settings,
748
+ edit: edit,
749
+ preview: preview,
750
+ responsive: responsive,
751
+ responsiveMsg: responsiveMsg,
752
+ responsiveAll: responsiveAll,
753
+ responsiveSmallOnly: responsiveSmallOnly,
754
+ responsiveSmallHidden: responsiveSmallHidden,
755
+ unison: unison,
756
+ wholeverse: wholeverse
757
+ };
758
+
759
+ const editableMetadataButtonsCss = ".buttons.sc-ldf-editable-metadata-buttons{position:absolute;height:0;width:100%;display:flex;flex-direction:row;align-items:center;justify-content:flex-end;opacity:1;transition:all 0.25s}.buttons.sc-ldf-editable-metadata-buttons ion-buttons.sc-ldf-editable-metadata-buttons{background-color:var(--ion-color-light, #f4f5f8);border-radius:3px;flex-wrap:wrap;max-width:100%}.hidden.sc-ldf-editable-metadata-buttons{display:none;height:0;opacity:0;transition:all 0.25s}@media (max-width: 767px){.sm-hidden.sc-ldf-editable-metadata-buttons{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}}";
760
+
761
+ const LOCALE$6 = {
762
+ 'en': EN$6
763
+ };
764
+ const EditableMetadataButtonsComponent = class {
765
+ constructor(hostRef) {
766
+ index.registerInstance(this, hostRef);
767
+ this.ldfAddOptionToDoc = index.createEvent(this, "ldfAddOptionToDoc", 7);
768
+ this.ldfTogglePreview = index.createEvent(this, "ldfTogglePreview", 7);
769
+ this.ldfDocShouldMove = index.createEvent(this, "ldfDocShouldMove", 7);
770
+ this.ldfDocShouldChange = index.createEvent(this, "ldfDocShouldChange", 7);
771
+ /** Documents in `preview` mode will display as if they're not editable, unless the user explicitly chooses to edit them */
772
+ this.preview = false;
773
+ }
774
+ objChange(newObj) {
775
+ if (this.modal) {
776
+ this.modal.componentProps = Object.assign(Object.assign({}, this.modal.componentProps), { obj: newObj });
777
+ }
778
+ }
779
+ // Lifecycle events
780
+ componentWillLoad() {
781
+ this.loadLocaleStrings();
782
+ }
783
+ // Private methods
784
+ async loadLocaleStrings() {
785
+ try {
786
+ this.localeStrings = LOCALE$6[locale.getComponentClosestLanguage(this.element)];
787
+ }
788
+ catch (e) {
789
+ console.warn(e);
790
+ }
791
+ }
792
+ /** Display an alert to set responsiveness */
793
+ async openResponsive() {
794
+ var _a;
795
+ const alert = await overlays.alertController.create({
796
+ header: this.localeStrings.responsive,
797
+ message: this.localeStrings.responsiveMsg,
798
+ inputs: [
799
+ {
800
+ name: 'value',
801
+ type: 'radio',
802
+ value: book$1.Responsive.AllSizes,
803
+ label: this.localeStrings.responsiveAll
804
+ },
805
+ {
806
+ name: 'value',
807
+ type: 'radio',
808
+ value: book$1.Responsive.SmallOnly,
809
+ label: this.localeStrings.responsiveSmallOnly
810
+ },
811
+ {
812
+ name: 'value',
813
+ type: 'radio',
814
+ value: book$1.Responsive.SmallHidden,
815
+ label: this.localeStrings.responsiveSmallHidden
816
+ }
817
+ ],
818
+ buttons: [
819
+ {
820
+ role: 'cancel',
821
+ text: this.localeStrings.cancel
822
+ },
823
+ this.localeStrings.ok
824
+ ]
825
+ });
826
+ await alert.present();
827
+ const { data } = await alert.onDidDismiss();
828
+ const { values } = data;
829
+ if (values) {
830
+ this.ldfDocShouldChange.emit(new change.Change({
831
+ path: `${this.base}/${this.index}/responsive`,
832
+ op: [{
833
+ type: 'set',
834
+ oldValue: (_a = this.obj) === null || _a === void 0 ? void 0 : _a.responsive,
835
+ value: values
836
+ }]
837
+ }));
838
+ }
839
+ }
840
+ /** Display a modal `EditableMetadataComponent` */
841
+ async openSettings() {
842
+ this.modal = await this.openModal('ldf-editable-metadata');
843
+ }
844
+ /** Display a modal `EditableConditionComponent` */
845
+ async openCondition() {
846
+ this.modal = await this.openModal('ldf-editable-condition', `${this.base}/${this.index}/condition`, { obj: this.obj });
847
+ }
848
+ /** Display a modal `EditablePreferencesComponent` */
849
+ async openPreferences() {
850
+ const path = this.base && this.index ? `${this.base}/${this.index}` : '';
851
+ this.modal = await this.openModal('ldf-editable-preferences', `${path}/metadata`, {
852
+ obj: this.obj
853
+ });
854
+ }
855
+ async openModal(component, componentPath = undefined, componentProps = undefined) {
856
+ const modal = await overlays.modalController.create({
857
+ component
858
+ });
859
+ const path = componentPath || (this.base && this.index >= 0 ? `${this.base}/${this.index}` : '/');
860
+ modal.componentProps = Object.assign(Object.assign({}, componentProps), { modal, doc: this.obj, path, visible: true, collapsed: false });
861
+ // present the modal
862
+ await modal.present();
863
+ return modal;
864
+ }
865
+ /** Emit an event with information about this document’s location in the tree and current state */
866
+ addOption() {
867
+ this.ldfAddOptionToDoc.emit({
868
+ base: this.base,
869
+ index: this.index,
870
+ obj: this.obj
871
+ });
872
+ }
873
+ move(diff) {
874
+ this.ldfDocShouldMove.emit({
875
+ base: this.base,
876
+ oldIndex: this.index,
877
+ diff
878
+ });
879
+ }
880
+ async headingLevel() {
881
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
882
+ const alert = await overlays.alertController.create({
883
+ header: (_a = this.localeStrings) === null || _a === void 0 ? void 0 : _a.heading,
884
+ inputs: [
885
+ {
886
+ name: 'level',
887
+ type: 'radio',
888
+ value: 1,
889
+ label: (_b = this.localeStrings) === null || _b === void 0 ? void 0 : _b.heading1
890
+ },
891
+ {
892
+ name: 'level',
893
+ type: 'radio',
894
+ value: 2,
895
+ label: (_c = this.localeStrings) === null || _c === void 0 ? void 0 : _c.heading2
896
+ },
897
+ {
898
+ name: 'level',
899
+ type: 'radio',
900
+ value: 3,
901
+ label: (_d = this.localeStrings) === null || _d === void 0 ? void 0 : _d.heading3
902
+ },
903
+ {
904
+ name: 'level',
905
+ type: 'radio',
906
+ value: 4,
907
+ label: (_e = this.localeStrings) === null || _e === void 0 ? void 0 : _e.heading4
908
+ },
909
+ ],
910
+ buttons: [
911
+ {
912
+ text: (_f = this.localeStrings) === null || _f === void 0 ? void 0 : _f.cancel,
913
+ role: 'cancel',
914
+ cssClass: 'secondary'
915
+ },
916
+ {
917
+ text: (_g = this.localeStrings) === null || _g === void 0 ? void 0 : _g.ok,
918
+ }
919
+ ]
920
+ });
921
+ await alert.present();
922
+ const { data } = await alert.onDidDismiss(), { values } = data;
923
+ if ((_h = this.obj) === null || _h === void 0 ? void 0 : _h.metadata) {
924
+ this.ldfDocShouldChange.emit(new change.Change({
925
+ path: `${this.base}/${this.index}/metadata/level`,
926
+ op: [{
927
+ type: 'set',
928
+ value: values,
929
+ oldValue: (_k = (_j = this.obj) === null || _j === void 0 ? void 0 : _j.metadata) === null || _k === void 0 ? void 0 : _k.level
930
+ }]
931
+ }));
932
+ }
933
+ else {
934
+ this.ldfDocShouldChange.emit(new change.Change({
935
+ path: `${this.base}/${this.index}/metadata`,
936
+ op: [{
937
+ type: 'set',
938
+ value: { level: values }
939
+ }]
940
+ }));
941
+ }
942
+ }
943
+ async copyDoc() {
944
+ try {
945
+ navigator.clipboard.writeText(JSON.stringify(this.obj));
946
+ const toast = await overlays.toastController.create({
947
+ message: this.localeStrings.copied,
948
+ duration: 1000,
949
+ color: "success"
950
+ });
951
+ await toast.present();
952
+ }
953
+ catch (e) {
954
+ console.warn('Clipboard operation not allowed.', e);
955
+ }
956
+ }
957
+ // Render
958
+ render() {
959
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
960
+ const localeStrings = this.localeStrings || {}, hasIndex = this.index !== undefined && this.index >= 0;
961
+ return index.h(index.Host, null, index.h("div", { class: { buttons: true, hidden: !this.visible || !this.preview } }, index.h("ion-buttons", { slot: "end" }, (navigator === null || navigator === void 0 ? void 0 : navigator.clipboard) && index.h("ion-button", { onClick: () => this.copyDoc(), "aria-role": 'button', "aria-label": localeStrings.copy }, index.h("ion-label", { class: "sm-hidden" }, localeStrings.copy), index.h("ion-icon", { slot: 'end', name: 'clipboard' })), index.h("ion-button", { onClick: () => this.ldfTogglePreview.emit(false) }, index.h("ion-label", { class: "sm-hidden" }, (_a = this.localeStrings) === null || _a === void 0 ? void 0 : _a.edit), index.h("ion-icon", { slot: "end", name: "create" })))), index.h("div", { class: { buttons: true, hidden: !this.visible || this.preview } }, index.h("ion-buttons", { slot: 'end' }, index.h("ion-button", { onClick: () => this.ldfTogglePreview.emit(true) }, index.h("ion-label", { class: "sm-hidden" }, (_b = this.localeStrings) === null || _b === void 0 ? void 0 : _b.preview), index.h("ion-icon", { slot: "end", name: "eye" })), ((_c = this.obj) === null || _c === void 0 ? void 0 : _c.type) !== 'option' && this.parentType !== 'option' && this.base &&
962
+ index.h("ion-button", { onClick: () => this.addOption(), "aria-role": 'button', "aria-label": localeStrings.addOption }, index.h("ion-icon", { slot: 'icon-only', name: 'add' })), ((_d = this.obj) === null || _d === void 0 ? void 0 : _d.type) == 'liturgy' && index.h("ion-button", { onClick: () => this.openPreferences(), "aria-role": 'button', "aria-label": localeStrings.preferences }, index.h("ion-icon", { slot: 'icon-only', name: 'list' })), ((_e = this.obj) === null || _e === void 0 ? void 0 : _e.type) == 'heading' && index.h("ion-button", { onClick: () => this.headingLevel() }, index.h("ion-label", null, localeStrings[`heading${((_g = (_f = this.obj) === null || _f === void 0 ? void 0 : _f.metadata) === null || _g === void 0 ? void 0 : _g.level) || 3}`] || 'Heading')), ((_j = (_h = this.obj) === null || _h === void 0 ? void 0 : _h.availableDisplayFormats()) === null || _j === void 0 ? void 0 : _j.length) > 0 && index.h("ldf-editable-select", { placeholder: localeStrings.displayFormat, value: this.obj.display_format, path: `${this.base}/${this.index}`, property: "display_format", options: this.obj.availableDisplayFormats().map(value => ({ value, label: localeStrings[value] || value })) }), (this.base && hasIndex || ((_k = this.obj) === null || _k === void 0 ? void 0 : _k.type) !== 'liturgy') && index.h("ion-button", { onClick: () => this.openCondition(), "aria-role": 'button', "aria-label": localeStrings.condition }, index.h("ion-icon", { slot: 'icon-only', name: 'calendar' })), (this.base && hasIndex || ((_l = this.obj) === null || _l === void 0 ? void 0 : _l.type) !== 'liturgy') && index.h("ion-button", { onClick: () => this.openResponsive(), "aria-role": 'button', "aria-label": localeStrings.responsive }, index.h("ion-icon", { slot: 'icon-only', name: 'phone-portrait' })), (navigator === null || navigator === void 0 ? void 0 : navigator.clipboard) && index.h("ion-button", { onClick: () => this.copyDoc(), "aria-role": 'button', "aria-label": localeStrings.copy }, index.h("ion-icon", { slot: 'icon-only', name: 'clipboard' })), index.h("ion-button", { onClick: () => this.openSettings(), "aria-role": 'button', "aria-label": localeStrings.settings }, index.h("ion-icon", { slot: 'icon-only', name: 'cog' })), (this.base && hasIndex && this.index > 0) && index.h("ion-button", { onClick: () => this.move(-1), "aria-role": 'button', "aria-label": localeStrings.move_up }, index.h("ion-icon", { slot: 'icon-only', name: 'arrow-up' })), (this.base && hasIndex) && index.h("ion-button", { onClick: () => this.move(1), "aria-role": 'button', "aria-label": localeStrings.move_down }, index.h("ion-icon", { slot: 'icon-only', name: 'arrow-down' })), hasIndex &&
963
+ index.h("ldf-editable-delete", { base: this.base, index: this.index, obj: this.obj }))));
964
+ }
965
+ get element() { return index.getElement(this); }
966
+ static get watchers() { return {
967
+ "obj": ["objChange"]
968
+ }; }
969
+ };
970
+ EditableMetadataButtonsComponent.style = editableMetadataButtonsCss;
971
+
972
+ const editableSelectCss = "";
973
+
974
+ const EditableSelectComponent = class {
975
+ constructor(hostRef) {
976
+ index.registerInstance(this, hostRef);
977
+ this.ldfChange = index.createEvent(this, "ldfChange", 7);
978
+ this.ldfDocShouldChange = index.createEvent(this, "ldfDocShouldChange", 7);
979
+ }
980
+ // Listeners
981
+ onChange(ev) {
982
+ const oldValue = this.value, value = ev.detail.value;
983
+ if (value !== oldValue) {
984
+ this.ldfDocShouldChange.emit(new change.Change({
985
+ path: this.path,
986
+ op: [
987
+ { type: 'set', index: this.property, oldValue, value }
988
+ ]
989
+ }));
990
+ this.ldfChange.emit(value);
991
+ }
992
+ }
993
+ render() {
994
+ return (index.h("ion-select", { value: this.value, placeholder: this.placeholder }, this.options.map(option => index.h("ion-select-option", { value: option.value }, option.label))));
995
+ }
996
+ get element() { return index.getElement(this); }
997
+ };
998
+ EditableSelectComponent.style = editableSelectCss;
999
+
1000
+ const close = "Return to Bulletin";
1001
+ const url = "URL";
1002
+ const EN$5 = {
1003
+ close: close,
1004
+ url: url
1005
+ };
1006
+
1007
+ const imageCss = "img.sc-ldf-image{height:auto;max-width:100%;z-index:1}figcaption.sc-ldf-image{background-color:var(--ldf-editable-lookup-background-color);border-radius:4px;color:var(--ldf-editable-lookup-color);display:block;margin:auto;text-align:center}.left.sc-ldf-image{text-align:left}.center.sc-ldf-image{text-align:center}.right.sc-ldf-image{text-align:right}.img-wrapper.sc-ldf-image{margin:0;padding:12px;display:inline-block;position:relative}img.editable.sc-ldf-image{border:3px solid var(--ldf-color)}button.resize.sc-ldf-image{height:30px;width:30px;margin:0;padding:0;background-color:var(--ldf-editable-lookup-background-color);border-radius:50%;border:3px solid var(--ldf-color)}.resize.top-left.sc-ldf-image{position:absolute;left:0;top:-3px;cursor:nwse-resize}.resize.bottom-left.sc-ldf-image{position:absolute;left:-3px;bottom:0;cursor:nesw-resize}.resize.top-right.sc-ldf-image{position:absolute;right:-6px;top:-3px;cursor:nesw-resize}.resize.bottom-right.sc-ldf-image{position:absolute;right:-6px;bottom:0;cursor:nwse-resize}";
1008
+
1009
+ var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
1010
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1011
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
1012
+ r = Reflect.decorate(decorators, target, key, desc);
1013
+ else
1014
+ for (var i = decorators.length - 1; i >= 0; i--)
1015
+ if (d = decorators[i])
1016
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
1017
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
1018
+ };
1019
+ const LOCALE$5 = {
1020
+ 'en': EN$5
1021
+ };
1022
+ const ImageComponent = class {
1023
+ constructor(hostRef) {
1024
+ index.registerInstance(this, hostRef);
1025
+ this.ldfDocShouldChange = index.createEvent(this, "ldfDocShouldChange", 7);
1026
+ this.isResizing = false;
1027
+ this.resizingStartPoint = null;
1028
+ this.resizingCorner = null;
1029
+ }
1030
+ docChanged(newDoc) {
1031
+ var _a, _b, _c, _d;
1032
+ try {
1033
+ if (typeof newDoc == 'string') {
1034
+ this.obj = new image.Image(JSON.parse(newDoc));
1035
+ }
1036
+ else {
1037
+ this.obj = new image.Image(newDoc);
1038
+ }
1039
+ this.height = ((_b = (_a = this.obj) === null || _a === void 0 ? void 0 : _a.metadata) === null || _b === void 0 ? void 0 : _b.height) || null;
1040
+ this.width = ((_d = (_c = this.obj) === null || _c === void 0 ? void 0 : _c.metadata) === null || _d === void 0 ? void 0 : _d.width) || null;
1041
+ }
1042
+ catch (e) {
1043
+ console.warn(e);
1044
+ this.obj = new image.Image();
1045
+ }
1046
+ }
1047
+ // Lifecycle events
1048
+ componentWillLoad() {
1049
+ this.docChanged(this.doc);
1050
+ this.loadLocaleStrings();
1051
+ }
1052
+ async loadLocaleStrings() {
1053
+ try {
1054
+ this.localeStrings = LOCALE$5[locale.getComponentClosestLanguage(this.element)];
1055
+ }
1056
+ catch (e) {
1057
+ console.warn(e);
1058
+ }
1059
+ }
1060
+ async showZoomed() {
1061
+ const modal = await overlays.modalController.create({
1062
+ component: 'ldf-image'
1063
+ });
1064
+ modal.componentProps = {
1065
+ modal,
1066
+ doc: this.obj
1067
+ };
1068
+ await modal.present();
1069
+ }
1070
+ startResizing(corner, x, y) {
1071
+ this.resizingCorner = corner;
1072
+ this.resizingStartPoint = { x, y };
1073
+ }
1074
+ stopResizing() {
1075
+ // clear status of resizing
1076
+ console.log('stopResizing');
1077
+ this.resizingCorner = null;
1078
+ }
1079
+ resizingMove(ev) {
1080
+ if (this.resizingCorner && this.resizingStartPoint) {
1081
+ this.processResizingMove(this.resizingCorner, ev.clientX, ev.clientY);
1082
+ }
1083
+ }
1084
+ processResizingMove(corner, clientX, clientY) {
1085
+ const { x } = this.resizingStartPoint;
1086
+ const xDiff = corner === 'nw' || corner === 'sw' ? clientX - x : x - clientX;
1087
+ this.resizingStartPoint = { x: clientX, y: clientY };
1088
+ // force fixed aspect ratio by nulling out `height`
1089
+ this.width = this.imgElement.clientWidth - xDiff;
1090
+ this.height = null;
1091
+ this.updateDoc();
1092
+ }
1093
+ touchStart(corner, ev) {
1094
+ ev.preventDefault();
1095
+ const touch = ev.touches[0];
1096
+ if (touch) {
1097
+ this.startResizing(corner, touch.clientX, touch.clientY);
1098
+ }
1099
+ }
1100
+ touchMove(corner, ev) {
1101
+ ev.preventDefault();
1102
+ const touch = ev.touches[0];
1103
+ if (touch) {
1104
+ this.processResizingMove(corner, touch.clientX, touch.clientY);
1105
+ }
1106
+ }
1107
+ // debounce saving the change by 500ms, preventing sending multiple changes as the mouse moves
1108
+ updateDoc() {
1109
+ var _a, _b, _c, _d, _e, _f;
1110
+ if (!((_a = this.obj) === null || _a === void 0 ? void 0 : _a.metadata)) {
1111
+ this.ldfDocShouldChange.emit(new change.Change({
1112
+ path: this.path,
1113
+ op: [{ type: 'set', index: 'metadata', oldValue: (_b = this.obj) === null || _b === void 0 ? void 0 : _b.metadata, value: {} }]
1114
+ }));
1115
+ }
1116
+ this.ldfDocShouldChange.emit(new change.Change({
1117
+ path: `${this.path}/metadata`,
1118
+ op: [
1119
+ {
1120
+ type: 'set',
1121
+ index: 'height',
1122
+ oldValue: (_d = (_c = this.obj) === null || _c === void 0 ? void 0 : _c.metadata) === null || _d === void 0 ? void 0 : _d.height,
1123
+ value: this.imgElement.clientHeight
1124
+ },
1125
+ {
1126
+ type: 'set',
1127
+ index: 'width',
1128
+ oldValue: (_f = (_e = this.obj) === null || _e === void 0 ? void 0 : _e.metadata) === null || _f === void 0 ? void 0 : _f.width,
1129
+ value: this.imgElement.clientWidth
1130
+ }
1131
+ ]
1132
+ }));
1133
+ }
1134
+ // Render
1135
+ render() {
1136
+ var _a, _b, _c, _d, _e;
1137
+ const localeStrings = this.localeStrings || {};
1138
+ const imageDisplay = [
1139
+ this.editable && index.h("ldf-label-bar", null, index.h("slot", { slot: 'end', name: 'controls' })),
1140
+ index.h("div", { class: `${((_a = this.obj) === null || _a === void 0 ? void 0 : _a.style) || ''} ${((_c = (_b = this.obj) === null || _b === void 0 ? void 0 : _b.metadata) === null || _c === void 0 ? void 0 : _c.align) || 'center'}` }, this.obj.value && this.obj.value.map((url, ii) => {
1141
+ var _a;
1142
+ return this.editable ?
1143
+ index.h("figure", null, index.h("div", { class: "img-wrapper" }, index.h("img", { src: url, ref: el => this.imgElement = el, alt: (_a = this.obj) === null || _a === void 0 ? void 0 : _a.label, style: {
1144
+ height: this.height ? `${this.height}px` : 'auto',
1145
+ width: this.width ? `${this.width}px` : 'auto'
1146
+ }, class: "editable" }), index.h("button", { class: "resize top-left", onMouseDown: (ev) => this.startResizing('nw', ev.clientX, ev.clientY), onTouchStart: (ev) => this.touchStart('nw', ev), onTouchMove: (ev) => this.touchMove('nw', ev), onTouchEnd: () => this.stopResizing() }), index.h("button", { class: "resize bottom-left", onMouseDown: (ev) => this.startResizing('sw', ev.clientX, ev.clientY), onTouchStart: (ev) => this.touchStart('sw', ev), onTouchMove: (ev) => this.touchMove('sw', ev), onTouchEnd: () => this.stopResizing() }), index.h("button", { class: "resize top-right", onMouseDown: (ev) => this.startResizing('ne', ev.clientX, ev.clientY), onTouchStart: (ev) => this.touchStart('ne', ev), onTouchMove: (ev) => this.touchMove('ne', ev), onTouchEnd: () => this.stopResizing() }), index.h("button", { class: "resize bottom-right", onMouseDown: (ev) => this.startResizing('se', ev.clientX, ev.clientY), onTouchStart: (ev) => this.touchStart('se', ev), onTouchMove: (ev) => this.touchMove('se', ev), onTouchEnd: () => this.stopResizing() })), index.h("figcaption", null, index.h("code", null, localeStrings.url), index.h("ldf-editable-text", { id: `${this.obj.uid || this.obj.slug}-${ii}`, text: url, path: `${this.path}/value/${ii}` })))
1147
+ :
1148
+ index.h("img", { src: url, onClick: () => this.showZoomed(), style: {
1149
+ height: this.height ? `${this.height}px` : 'auto',
1150
+ width: this.width ? `${this.width}px` : 'auto'
1151
+ } });
1152
+ }))
1153
+ ];
1154
+ if (!this.modal) {
1155
+ return index.h(index.Host, { lang: (_d = this.obj) === null || _d === void 0 ? void 0 : _d.language }, imageDisplay);
1156
+ }
1157
+ else {
1158
+ return [
1159
+ index.h("ion-header", null, index.h("ion-toolbar", null, index.h("ion-buttons", { slot: "end" }, index.h("ion-button", { onClick: () => this.modal.dismiss() }, index.h("ion-label", { slot: "start" }, localeStrings.close), index.h("ion-icon", { slot: "end", name: "close" }))))),
1160
+ index.h("ion-content", { class: "ion-padding", scrollX: true, lang: (_e = this.obj) === null || _e === void 0 ? void 0 : _e.language }, imageDisplay)
1161
+ ];
1162
+ }
1163
+ }
1164
+ get element() { return index.getElement(this); }
1165
+ static get watchers() { return {
1166
+ "doc": ["docChanged"]
1167
+ }; }
1168
+ };
1169
+ __decorate([
1170
+ index$1.Debounce(250)
1171
+ ], ImageComponent.prototype, "updateDoc", null);
1172
+ ImageComponent.style = imageCss;
1173
+
1174
+ const bible_version = " in the version ";
1175
+ const category = "All items that match the category ";
1176
+ const collect = "The Collect of the Day.";
1177
+ const day_of_month_1 = "It is the ";
1178
+ const day_of_month_2 = " day of the month";
1179
+ const definedByPreference = " defined by the preference ";
1180
+ const fromCanticleTable = " from the canticle table ";
1181
+ const fromLectionary = " from the lectionary ";
1182
+ const lectionaryReading = "The lectionary reading ";
1183
+ const slug = "All items with the slug ";
1184
+ const condition = "Included when ";
1185
+ const and = "all";
1186
+ const or = "any";
1187
+ const the_day = " the day ";
1188
+ const of_the_following = " of the following are true: ";
1189
+ const day = "the liturgical day";
1190
+ const season = "the liturgical season";
1191
+ const week = "the liturgical week";
1192
+ const weekday = "the day of the week";
1193
+ const feastDay = "a Sunday or Holy Day";
1194
+ const is = " is ";
1195
+ const is_not = " is not ";
1196
+ const only = " one of: ";
1197
+ const only_1 = "";
1198
+ const except = " anything but: ";
1199
+ const except_1 = " not ";
1200
+ const the_preference = "the preference ";
1201
+ const the_preference_specified = "chosen in the preference ";
1202
+ const the_date = "the date ";
1203
+ const lte = " ≤ ";
1204
+ const lt = " < ";
1205
+ const gt = " > ";
1206
+ const gte = " ≥ ";
1207
+ const smallOnly = "Only appears on small screens";
1208
+ const smallHidden = "Doesn't appear on small screens";
1209
+ const EN$4 = {
1210
+ bible_version: bible_version,
1211
+ "canticle-1": "The first canticle ",
1212
+ "canticle-2": "The second canticle ",
1213
+ category: category,
1214
+ collect: collect,
1215
+ day_of_month_1: day_of_month_1,
1216
+ day_of_month_2: day_of_month_2,
1217
+ definedByPreference: definedByPreference,
1218
+ fromCanticleTable: fromCanticleTable,
1219
+ fromLectionary: fromLectionary,
1220
+ lectionaryReading: lectionaryReading,
1221
+ "filter-seasonal": " and the current season",
1222
+ "filter-evening-true": " and are in the evening ",
1223
+ "filter-evening-false": " and are not in the evening ",
1224
+ "filter-day": " and the liturgical day ",
1225
+ "rotate-true": " (rotating by day)",
1226
+ "rotate-false": " (including all possibilities)",
1227
+ slug: slug,
1228
+ condition: condition,
1229
+ and: and,
1230
+ or: or,
1231
+ the_day: the_day,
1232
+ of_the_following: of_the_following,
1233
+ day: day,
1234
+ season: season,
1235
+ week: week,
1236
+ weekday: weekday,
1237
+ feastDay: feastDay,
1238
+ is: is,
1239
+ is_not: is_not,
1240
+ only: only,
1241
+ only_1: only_1,
1242
+ except: except,
1243
+ except_1: except_1,
1244
+ the_preference: the_preference,
1245
+ the_preference_specified: the_preference_specified,
1246
+ the_date: the_date,
1247
+ lte: lte,
1248
+ lt: lt,
1249
+ gt: gt,
1250
+ gte: gte,
1251
+ smallOnly: smallOnly,
1252
+ smallHidden: smallHidden
1253
+ };
1254
+
1255
+ const ConditionNode = ({ doc, localeStrings }, children) => index.h("div", { class: 'condition' },
1256
+ index.h("p", null,
1257
+ localeStrings.condition,
1258
+ index.h("code", null, localeStrings[doc.condition.mode]),
1259
+ localeStrings.of_the_following),
1260
+ index.h("ul", null, doc.condition.conditions.map(condition => index.h(ConditionPiece, { condition: condition, localeStrings: localeStrings }))),
1261
+ children);
1262
+ const ConditionPiece = ({ condition, localeStrings }) => {
1263
+ let nodes = [];
1264
+ /* Except/Only fields: day, season, week, weekday */
1265
+ if (condition.day) {
1266
+ nodes = nodes.concat(index.h(ExceptOnly, { condition: condition, field: 'day', localeStrings: localeStrings }));
1267
+ }
1268
+ if (condition.season) {
1269
+ nodes = nodes.concat(index.h(ExceptOnly, { condition: condition, field: 'season', localeStrings: localeStrings }));
1270
+ }
1271
+ if (condition.week) {
1272
+ nodes = nodes.concat(index.h(ExceptOnly, { condition: condition, field: 'week', localeStrings: localeStrings }));
1273
+ }
1274
+ if (condition.weekday) {
1275
+ nodes = nodes.concat(index.h(ExceptOnly, { condition: condition, field: 'weekday', localeStrings: localeStrings }));
1276
+ }
1277
+ if (condition.day_of_month) {
1278
+ nodes.push([
1279
+ localeStrings.day_of_month_1,
1280
+ ordinal_suffix_of(Number(condition.day_of_month)),
1281
+ localeStrings.day_of_month_2
1282
+ ]);
1283
+ }
1284
+ if (condition.hasOwnProperty('feastDay')) {
1285
+ nodes.push([
1286
+ localeStrings.the_day,
1287
+ condition.feastDay ? localeStrings.is : localeStrings.is_not,
1288
+ localeStrings.feastDay
1289
+ ]);
1290
+ }
1291
+ if (condition.preference) {
1292
+ nodes.push([
1293
+ localeStrings.the_preference,
1294
+ index.h("code", null, condition.preference.key),
1295
+ condition.preference.is ? localeStrings.is : localeStrings.is_not,
1296
+ index.h("code", null, condition.preference.value)
1297
+ ]);
1298
+ }
1299
+ if (condition.date) {
1300
+ nodes.push([
1301
+ localeStrings.the_date,
1302
+ condition.date.lt && `${localeStrings.lt} ${condition.date.lt}`,
1303
+ condition.date.lte && `${localeStrings.lte} ${condition.date.lte}`,
1304
+ condition.date.gte && `${localeStrings.gte} ${condition.date.gte}`,
1305
+ condition.date.gt && `${localeStrings.gt} ${condition.date.gt}`,
1306
+ ]);
1307
+ }
1308
+ return nodes.map(node => index.h("li", null, node));
1309
+ };
1310
+ const ExceptOnly = ({ condition, field, localeStrings }) => {
1311
+ var _a, _b;
1312
+ const nodes = [];
1313
+ ((_a = condition[field].except) === null || _a === void 0 ? void 0 : _a.length) > 0 && nodes.push([
1314
+ localeStrings[field],
1315
+ localeStrings.is,
1316
+ condition[field].except.length > 1 ? localeStrings.except : localeStrings.except_1,
1317
+ condition[field].except.join(', ')
1318
+ ]);
1319
+ ((_b = condition[field].only) === null || _b === void 0 ? void 0 : _b.length) > 0 && nodes.push([
1320
+ localeStrings[field],
1321
+ localeStrings.is,
1322
+ condition[field].only.length > 1 ? localeStrings.only : localeStrings.only_1,
1323
+ condition[field].only.join(', ')
1324
+ ]);
1325
+ return nodes;
1326
+ };
1327
+ function ordinal_suffix_of(i) {
1328
+ var j = i % 10, k = i % 100;
1329
+ if (j == 1 && k != 11) {
1330
+ return i + "st";
1331
+ }
1332
+ if (j == 2 && k != 12) {
1333
+ return i + "nd";
1334
+ }
1335
+ if (j == 3 && k != 13) {
1336
+ return i + "rd";
1337
+ }
1338
+ return i + "th";
1339
+ }
1340
+
1341
+ const valueOrPreference = (x, localeStrings) => {
1342
+ if (typeof x === 'object') {
1343
+ return index.h("span", null,
1344
+ localeStrings.definedByPreference,
1345
+ " ",
1346
+ index.h("code", null, x.preference));
1347
+ }
1348
+ else {
1349
+ return index.h("code", null, x);
1350
+ }
1351
+ };
1352
+ const LookupNode = ({ doc, localeStrings }) => {
1353
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4;
1354
+ let desc;
1355
+ if (doc.lookup) {
1356
+ switch ((_a = doc.lookup) === null || _a === void 0 ? void 0 : _a.type) {
1357
+ case 'lectionary':
1358
+ desc = [
1359
+ localeStrings.lectionaryReading,
1360
+ valueOrPreference((_b = doc.lookup) === null || _b === void 0 ? void 0 : _b.item, localeStrings),
1361
+ localeStrings.fromLectionary,
1362
+ valueOrPreference((_c = doc.lookup) === null || _c === void 0 ? void 0 : _c.table, localeStrings),
1363
+ "."
1364
+ ];
1365
+ break;
1366
+ case 'canticle':
1367
+ desc = [
1368
+ localeStrings[`canticle-${(_d = doc.lookup) === null || _d === void 0 ? void 0 : _d.item}`],
1369
+ localeStrings.fromCanticleTable,
1370
+ valueOrPreference((_e = doc.lookup) === null || _e === void 0 ? void 0 : _e.table, localeStrings),
1371
+ "."
1372
+ ];
1373
+ break;
1374
+ case 'category':
1375
+ desc = [
1376
+ localeStrings.category,
1377
+ doc.category.map(category => index.h("code", null, category)),
1378
+ ((_f = doc.lookup) === null || _f === void 0 ? void 0 : _f.filter) && ((_g = doc.lookup) === null || _g === void 0 ? void 0 : _g.filter) == 'seasonal' && localeStrings['filter-seasonal'],
1379
+ ((_h = doc.lookup) === null || _h === void 0 ? void 0 : _h.filter) && ((_j = doc.lookup) === null || _j === void 0 ? void 0 : _j.filter) == 'evening' && localeStrings[`filter-evening-${((_k = doc.lookup) === null || _k === void 0 ? void 0 : _k.item) || true}`],
1380
+ ((_l = doc.lookup) === null || _l === void 0 ? void 0 : _l.filter) && ((_m = doc.lookup) === null || _m === void 0 ? void 0 : _m.filter) == 'day' && localeStrings[`filter-day`],
1381
+ ((_o = doc.lookup) === null || _o === void 0 ? void 0 : _o.filter) && ((_p = doc.lookup) === null || _p === void 0 ? void 0 : _p.filter) == 'day' && index.h("code", null, (_q = doc.lookup) === null || _q === void 0 ? void 0 : _q.item),
1382
+ ((_r = doc.lookup) === null || _r === void 0 ? void 0 : _r.hasOwnProperty('rotate')) && localeStrings[`rotate-${(_s = doc.lookup) === null || _s === void 0 ? void 0 : _s.rotate}`],
1383
+ "."
1384
+ ];
1385
+ break;
1386
+ case 'slug':
1387
+ desc = [
1388
+ localeStrings.slug,
1389
+ index.h("code", null, doc.slug),
1390
+ ((_t = doc.lookup) === null || _t === void 0 ? void 0 : _t.filter) && ((_u = doc.lookup) === null || _u === void 0 ? void 0 : _u.filter) == 'seasonal' && localeStrings['filter-seasonal'],
1391
+ ((_v = doc.lookup) === null || _v === void 0 ? void 0 : _v.filter) && ((_w = doc.lookup) === null || _w === void 0 ? void 0 : _w.filter) == 'evening' && localeStrings[`filter-evening-${((_x = doc.lookup) === null || _x === void 0 ? void 0 : _x.item) || true}`],
1392
+ ((_y = doc.lookup) === null || _y === void 0 ? void 0 : _y.filter) && ((_z = doc.lookup) === null || _z === void 0 ? void 0 : _z.filter) == 'day' && localeStrings[`filter-day`],
1393
+ ((_0 = doc.lookup) === null || _0 === void 0 ? void 0 : _0.filter) && ((_1 = doc.lookup) === null || _1 === void 0 ? void 0 : _1.filter) == 'day' && index.h("code", null, (_2 = doc.lookup) === null || _2 === void 0 ? void 0 : _2.item),
1394
+ ((_3 = doc.lookup) === null || _3 === void 0 ? void 0 : _3.hasOwnProperty('rotate')) && localeStrings[`rotate-${(_4 = doc.lookup) === null || _4 === void 0 ? void 0 : _4.rotate}`],
1395
+ "."
1396
+ ];
1397
+ break;
1398
+ case 'collect':
1399
+ desc = index.h("code", null, localeStrings.collect);
1400
+ break;
1401
+ default:
1402
+ desc = JSON.stringify(doc.lookup);
1403
+ break;
1404
+ }
1405
+ }
1406
+ else if (doc.type === "bible-reading" && doc.citation) {
1407
+ desc = [
1408
+ index.h("code", null, doc.citation),
1409
+ localeStrings.bible_version,
1410
+ ...typeof doc.version === "string"
1411
+ ? [index.h("code", null, doc.version)]
1412
+ : [
1413
+ localeStrings.the_preference_specified,
1414
+ index.h("code", null, "bibleVersion")
1415
+ ]
1416
+ ];
1417
+ }
1418
+ return (index.h("article", { class: "lookup" }, desc));
1419
+ };
1420
+
1421
+ const liturgicalDocumentCss = "ldf-liturgical-document.sc-ldf-liturgical-document,.sc-ldf-liturgical-document-h{font-family:var(--ldf-font-face);display:block}.container.editable.sc-ldf-liturgical-document{padding-top:0}.lookup.sc-ldf-liturgical-document{background-color:var(--ldf-editable-lookup-background-color);color:var(--ldf-editable-lookup-color);border-radius:4px;margin-bottom:1.5em;padding:1em;width:calc(100% - 2em)}.lookup.sc-ldf-liturgical-document code.sc-ldf-liturgical-document{font-weight:bold}.condition.sc-ldf-liturgical-document{background-color:var(--ldf-editable-condition-background-color);color:var(--ldf-editable-condition-color);border-radius:4px;padding:1em;width:calc(100% - 2em)}.condition.sc-ldf-liturgical-document code.sc-ldf-liturgical-document{font-weight:bold}.doc.sc-ldf-liturgical-document{margin-top:var(--ldf-liturgical-document-margin-top)}ldf-editable-metadata-buttons.sc-ldf-liturgical-document{height:none;display:block;z-index:10;background:var(--ldf-background);opacity:0.8;width:100%;position:sticky;top:2em;padding-top:1em;padding-bottom:1em}ldf-editable-metadata-buttons.top-level.sc-ldf-liturgical-document{position:relative;top:0}.small-only.sc-ldf-liturgical-document{display:block}.small-hidden.sc-ldf-liturgical-document{display:none}@media (min-width: 415px){.small-only.sc-ldf-liturgical-document{display:none}.small-hidden.sc-ldf-liturgical-document{display:block}}";
1422
+
1423
+ const LOCALE$4 = {
1424
+ 'en': EN$4
1425
+ };
1426
+ const LiturgicalDocumentComponent = class {
1427
+ constructor(hostRef) {
1428
+ index.registerInstance(this, hostRef);
1429
+ this.focusPath = index.createEvent(this, "focusPath", 7);
1430
+ this.focusObj = index.createEvent(this, "focusObj", 7);
1431
+ this.ldfSelectionChange = index.createEvent(this, "ldfSelectionChange", 7);
1432
+ this.hasFocus = false;
1433
+ this.buttonsSelected = false;
1434
+ this.interrupt = false;
1435
+ /** Type of the parent `LiturgicalDocument`, if any */
1436
+ this.parentType = null;
1437
+ /** Documents in `preview` mode will display as if they're not editable, unless the user explicitly chooses to edit them */
1438
+ this.preview = false;
1439
+ /** CSS padding to add around element, if any. */
1440
+ this.padding = undefined;
1441
+ }
1442
+ async docChanged(newDoc) {
1443
+ let provisionalObj;
1444
+ try {
1445
+ if (typeof newDoc == 'string') {
1446
+ provisionalObj = new book$1.LiturgicalDocument(JSON.parse(newDoc));
1447
+ }
1448
+ else {
1449
+ provisionalObj = new book$1.LiturgicalDocument(newDoc);
1450
+ }
1451
+ }
1452
+ catch (e) {
1453
+ console.warn(e);
1454
+ provisionalObj = new book$1.LiturgicalDocument();
1455
+ }
1456
+ this.obj = provisionalObj || new book$1.LiturgicalDocument();
1457
+ }
1458
+ // Listeners
1459
+ onDragOver() {
1460
+ if (this.path !== "/") {
1461
+ this.hasFocus = true;
1462
+ this.focusPath.emit(this.path);
1463
+ this.focusObj.emit({ obj: this.obj, path: this.path });
1464
+ console.log("dragged over", this.path);
1465
+ }
1466
+ }
1467
+ selectionChangeHandler(ev) {
1468
+ var _a, _b;
1469
+ // stop iOS from taking over
1470
+ ev.preventDefault();
1471
+ // handle the selection
1472
+ const selection = document.getSelection(), anchorNode = selection.anchorNode, citation = (_b = (_a = anchorNode === null || anchorNode === void 0 ? void 0 : anchorNode.parentElement) === null || _a === void 0 ? void 0 : _a.closest('ldf-string')) === null || _b === void 0 ? void 0 : _b.citation;
1473
+ if (this.element.contains(anchorNode)) {
1474
+ const text = selection.toString();
1475
+ this.ldfSelectionChange.emit({
1476
+ target: this.element,
1477
+ text,
1478
+ citation,
1479
+ fragment: this.path
1480
+ });
1481
+ }
1482
+ }
1483
+ // Lifecycle events
1484
+ componentWillLoad() {
1485
+ this.loadLocaleStrings();
1486
+ this.docChanged(this.doc);
1487
+ }
1488
+ /** On hover, display Add Block buttons */
1489
+ onMouseOver() {
1490
+ this.hasFocus = true;
1491
+ this.focusPath.emit(this.path);
1492
+ }
1493
+ onMouseOut(ev) {
1494
+ const elDiv = this.element.querySelector('div.container');
1495
+ if (ev.relatedTarget == elDiv) {
1496
+ setTimeout(() => {
1497
+ this.hasFocus = false;
1498
+ this.focusPath.emit(this.path);
1499
+ }, 500);
1500
+ }
1501
+ }
1502
+ // Firing the event during the capture phase the most specific LiturgicalDocument will
1503
+ // be handled last, i.e., the `Liturgy` won't override subdocuments
1504
+ onClick() {
1505
+ this.hasFocus = true;
1506
+ this.focusPath.emit(this.path);
1507
+ this.focusObj.emit({ obj: this.obj, path: this.path });
1508
+ }
1509
+ async loadLocaleStrings() {
1510
+ try {
1511
+ this.localeStrings = LOCALE$4[locale.getComponentClosestLanguage(this.element)];
1512
+ }
1513
+ catch (e) {
1514
+ console.warn(e);
1515
+ }
1516
+ }
1517
+ /** Gives a loading view, a description of the document (if editing and has a lookup), or the component of the correct type */
1518
+ nodeFromDoc(doc, forceEditable = undefined) {
1519
+ if (doc == undefined) {
1520
+ return (customElements === null || customElements === void 0 ? void 0 : customElements.get('ion-skeleton-text')) ? index.h("ion-skeleton-text", null) : index.h("p", null, "...");
1521
+ }
1522
+ else if (this.editable || forceEditable) {
1523
+ return this.editableNode(doc);
1524
+ }
1525
+ else {
1526
+ return this.chooseComponent(doc);
1527
+ }
1528
+ }
1529
+ editableNode(doc) {
1530
+ var _a;
1531
+ const localeStrings = this.localeStrings || {};
1532
+ if (((_a = doc.value) === null || _a === void 0 ? void 0 : _a.length) > 0 && Boolean(doc.value[0])) {
1533
+ if (doc.condition) {
1534
+ return index.h(ConditionNode, { doc: doc, localeStrings: localeStrings }, this.chooseComponent(doc));
1535
+ }
1536
+ else {
1537
+ return this.chooseComponent(doc);
1538
+ }
1539
+ }
1540
+ else {
1541
+ if (doc.condition && !doc.lookup) {
1542
+ return index.h(ConditionNode, { doc: doc, localeStrings: localeStrings }, this.chooseComponent(doc));
1543
+ }
1544
+ else if (doc.condition && doc.lookup) {
1545
+ return index.h(ConditionNode, { doc: doc, localeStrings: localeStrings }, index.h(LookupNode, { doc: doc, localeStrings: localeStrings }));
1546
+ }
1547
+ else if (!doc.condition && doc.lookup) {
1548
+ return index.h(LookupNode, { doc: doc, localeStrings: localeStrings });
1549
+ }
1550
+ else if (doc.type === "bible-reading") {
1551
+ return index.h(LookupNode, { doc: doc, localeStrings: localeStrings });
1552
+ }
1553
+ else {
1554
+ return this.chooseComponent(doc);
1555
+ }
1556
+ }
1557
+ }
1558
+ /** Processes generic LiturgicalDocument into component of the appropriate type */
1559
+ //@Method()
1560
+ chooseComponent(doc) {
1561
+ var _a, _b;
1562
+ let node;
1563
+ const editable = this.editable && !this.preview;
1564
+ switch (doc === null || doc === void 0 ? void 0 : doc.type) {
1565
+ case 'liturgy':
1566
+ node = index.h("ldf-liturgy", { path: this.path, editable: editable, preview: this.preview, doc: doc });
1567
+ break;
1568
+ case 'heading':
1569
+ node = index.h("ldf-heading", { path: this.path, editable: editable, doc: doc });
1570
+ break;
1571
+ case 'image':
1572
+ node = index.h("ldf-image", { path: this.path, editable: editable, doc: doc });
1573
+ break;
1574
+ case 'meditation':
1575
+ const color = (_b = (_a = this.obj) === null || _a === void 0 ? void 0 : _a.day) === null || _b === void 0 ? void 0 : _b.color, colorValue = (color === null || color === void 0 ? void 0 : color.hasOwnProperty('hex')) ? color.hex : color || '#3489eb';
1576
+ node = index.h("ldf-meditation", { path: this.path, editable: this.editable || this.preview, doc: doc, color: colorValue });
1577
+ break;
1578
+ case 'option':
1579
+ node = index.h("ldf-option", { path: this.path, editable: editable, preview: this.preview, doc: doc });
1580
+ break;
1581
+ case 'refrain':
1582
+ node = index.h("ldf-refrain", { path: this.path, editable: editable, doc: doc });
1583
+ break;
1584
+ case 'rubric':
1585
+ node = index.h("ldf-rubric", { path: this.path, editable: editable, doc: doc });
1586
+ break;
1587
+ case 'text':
1588
+ node = index.h("ldf-text", { path: this.path, editable: editable, doc: doc });
1589
+ break;
1590
+ case 'responsive':
1591
+ node = index.h("ldf-responsive-prayer", { path: this.path, editable: editable, doc: doc });
1592
+ break;
1593
+ case 'bible-reading':
1594
+ node = index.h("ldf-bible-reading", { path: this.path, editable: editable, doc: doc });
1595
+ break;
1596
+ case 'psalm':
1597
+ node = index.h("ldf-psalm", { path: this.path, editable: editable, doc: doc });
1598
+ break;
1599
+ default:
1600
+ console.warn('invalid type for document', doc);
1601
+ break;
1602
+ }
1603
+ return node;
1604
+ }
1605
+ setPreview(preview) {
1606
+ this.preview = preview;
1607
+ this.editable = true;
1608
+ }
1609
+ // Render
1610
+ render() {
1611
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
1612
+ const node = this.nodeFromDoc(this.obj);
1613
+ return (node && index.h(index.Host, { lang: ((_a = this.obj) === null || _a === void 0 ? void 0 : _a.language) || 'en' }, index.h("div", { class: {
1614
+ container: true,
1615
+ editable: this.editable || this.preview,
1616
+ "small-only": !this.editable && !this.preview && ((_b = this.obj) === null || _b === void 0 ? void 0 : _b.responsive) !== undefined && ((_c = this.obj) === null || _c === void 0 ? void 0 : _c.responsive) == book$1.Responsive.SmallOnly,
1617
+ "small-hidden": !this.editable && !this.preview && ((_d = this.obj) === null || _d === void 0 ? void 0 : _d.responsive) !== undefined && ((_e = this.obj) === null || _e === void 0 ? void 0 : _e.responsive) == book$1.Responsive.SmallHidden,
1618
+ } }, (this.editable || this.preview) && index.h("ldf-editable-metadata-buttons", { visible: this.hasFocus, base: this.base, index: this.index, obj: this.obj, parentType: this.parentType, preview: this.preview, onLdfTogglePreview: (e) => this.setPreview(e.detail), class: { 'top-level': ((_f = this.obj) === null || _f === void 0 ? void 0 : _f.type) === 'liturgy' || ((_g = this.obj) === null || _g === void 0 ? void 0 : _g.type) === 'option' } }), (this.editable || this.preview) && (((_h = this.obj) === null || _h === void 0 ? void 0 : _h.responsive) === book$1.Responsive.SmallHidden || ((_j = this.obj) === null || _j === void 0 ? void 0 : _j.responsive) === book$1.Responsive.SmallOnly) && index.h("ion-chip", { class: "responsive-banner" }, index.h("ion-icon", { name: "phone-portrait-outline" }), ((_k = this.obj) === null || _k === void 0 ? void 0 : _k.responsive) === book$1.Responsive.SmallOnly && index.h("ion-label", null, this.localeStrings.smallOnly), ((_l = this.obj) === null || _l === void 0 ? void 0 : _l.responsive) === book$1.Responsive.SmallHidden && index.h("ion-label", null, this.localeStrings.smallHidden)), index.h("div", { id: (this.path || '').replace(/\//g, '-'), class: {
1619
+ doc: true,
1620
+ editable: this.editable || this.preview
1621
+ }, style: { padding: this.padding } }, node))));
1622
+ }
1623
+ get element() { return index.getElement(this); }
1624
+ static get watchers() { return {
1625
+ "doc": ["docChanged"]
1626
+ }; }
1627
+ };
1628
+ LiturgicalDocumentComponent.style = liturgicalDocumentCss;
1629
+
1630
+ const LiturgyComponent = class {
1631
+ constructor(hostRef) {
1632
+ index.registerInstance(this, hostRef);
1633
+ /** Documents in `preview` mode will display as if they're not editable, unless the user explicitly chooses to edit them */
1634
+ this.preview = false;
1635
+ }
1636
+ docChanged(newDoc) {
1637
+ try {
1638
+ if (typeof newDoc == 'string') {
1639
+ this.obj = new rubric.Liturgy(JSON.parse(newDoc));
1640
+ }
1641
+ else {
1642
+ this.obj = new rubric.Liturgy(newDoc);
1643
+ }
1644
+ }
1645
+ catch (e) {
1646
+ console.warn(e);
1647
+ this.obj = new rubric.Liturgy();
1648
+ }
1649
+ }
1650
+ // Lifecycle events
1651
+ componentWillLoad() {
1652
+ this.docChanged(this.doc);
1653
+ }
1654
+ // Listens for ldf-liturgical-document event indicating mouseover
1655
+ onFocusPath(ev) {
1656
+ this.hasFocus = ev.detail;
1657
+ }
1658
+ // Render
1659
+ render() {
1660
+ const basePath = this.path == '/' ? '' : `${this.path}/`, valuePath = `${basePath}/value`;
1661
+ return (index.h(index.Host, { lang: this.obj.language }, (this.editable || this.preview) && index.h("ldf-editable-add-block", { visible: true, base: valuePath, index: 0 }), this.obj.value.map((doc, docIndex) => {
1662
+ var _a, _b, _c;
1663
+ const path = `${valuePath}/${docIndex}`, buttonVisible = this.hasFocus == path // button appears if this doc is focused
1664
+ || docIndex == ((((_b = (_a = this.obj) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.length) || 0) - 1) // or it it's the last doc in the liturgy
1665
+ || ((doc === null || doc === void 0 ? void 0 : doc.type) === 'option' && ((_c = this.hasFocus) === null || _c === void 0 ? void 0 : _c.startsWith(path))); // or if it's an option and one of its children is focused
1666
+ return (index.h("article", { style: { padding: this.editable ? '1em' : '0' } }, index.h("ldf-liturgical-document", { doc: doc, path: path, base: valuePath, index: docIndex, editable: this.editable, preview: this.preview, parentType: 'liturgy' }), (this.editable || this.preview) && index.h("ldf-editable-add-block", { visible: buttonVisible, base: valuePath, index: docIndex + 1 })));
1667
+ })));
1668
+ }
1669
+ static get watchers() { return {
1670
+ "doc": ["docChanged"]
1671
+ }; }
1672
+ };
1673
+
1674
+ const start = "Start";
1675
+ const pause = "Pause";
1676
+ const resume = "Resume";
1677
+ const meditate = "Meditate for";
1678
+ const minutes = "minutes.";
1679
+ const seconds = " seconds. ";
1680
+ const EN$3 = {
1681
+ start: start,
1682
+ pause: pause,
1683
+ resume: resume,
1684
+ meditate: meditate,
1685
+ minutes: minutes,
1686
+ seconds: seconds
1687
+ };
1688
+
1689
+ const meditationCss = "ldf-heading.sc-ldf-meditation .control-container.sc-ldf-meditation,.sc-ldf-meditation-h .control-container.sc-ldf-meditation{display:block;margin:auto}ldf-heading.sc-ldf-meditation .controls.sc-ldf-meditation,.sc-ldf-meditation-h .controls.sc-ldf-meditation{display:flex;align-items:center;justify-content:center;flex-direction:column;text-align:center;width:100%}ldf-heading.sc-ldf-meditation .controls.sc-ldf-meditation input.sc-ldf-meditation,.sc-ldf-meditation-h .controls.sc-ldf-meditation input.sc-ldf-meditation{text-align:center}@media (min-width: 767px){ldf-heading.sc-ldf-meditation .controls.sc-ldf-meditation,.sc-ldf-meditation-h .controls.sc-ldf-meditation{flex-direction:row}}ldf-heading.sc-ldf-meditation .progress-circle-container.sc-ldf-meditation,.sc-ldf-meditation-h .progress-circle-container.sc-ldf-meditation{display:flex;align-items:center;justify-content:center;padding:1em}ldf-heading.sc-ldf-meditation .progress-circle-container.sc-ldf-meditation .progress-circle.sc-ldf-meditation,.sc-ldf-meditation-h .progress-circle-container.sc-ldf-meditation .progress-circle.sc-ldf-meditation{width:300px;height:300px;display:flex;align-items:center;justify-content:center;border-radius:50%}ldf-heading.sc-ldf-meditation .progress-circle-container.sc-ldf-meditation .progress-circle.sc-ldf-meditation .circle-overlay.sc-ldf-meditation,.sc-ldf-meditation-h .progress-circle-container.sc-ldf-meditation .progress-circle.sc-ldf-meditation .circle-overlay.sc-ldf-meditation{background-color:var(--ldf-background-color);display:flex;align-items:center;flex-direction:column;justify-content:center;height:92%;width:92%;border-radius:50%}ldf-heading.sc-ldf-meditation .progress-circle-container.sc-ldf-meditation .progress-circle.sc-ldf-meditation .seconds.sc-ldf-meditation,.sc-ldf-meditation-h .progress-circle-container.sc-ldf-meditation .progress-circle.sc-ldf-meditation .seconds.sc-ldf-meditation{font-family:var(--ldf-font-face);font-size:3em}ldf-heading.sc-ldf-meditation button.clear.sc-ldf-meditation,.sc-ldf-meditation-h button.clear.sc-ldf-meditation{background-color:var(--ldf-background-color);border:none;font-size:1em}.hidden.sc-ldf-meditation{height:0;opacity:0;transition:0.25s}";
1690
+
1691
+ const LOCALE$3 = {
1692
+ 'en': EN$3
1693
+ };
1694
+ const MeditationComponent = class {
1695
+ constructor(hostRef) {
1696
+ index.registerInstance(this, hostRef);
1697
+ this.timerChanged = index.createEvent(this, "timerChanged", 7);
1698
+ this.started = false;
1699
+ this.paused = false;
1700
+ this.startingDuration = undefined;
1701
+ /** Liturgical color to use in display */
1702
+ this.color = "#3333ff";
1703
+ }
1704
+ docChanged(newDoc) {
1705
+ try {
1706
+ if (typeof newDoc == 'string') {
1707
+ this.obj = new rubric.Meditation(JSON.parse(newDoc));
1708
+ }
1709
+ else {
1710
+ this.obj = new rubric.Meditation(newDoc);
1711
+ }
1712
+ }
1713
+ catch (e) {
1714
+ console.warn(e);
1715
+ this.obj = new rubric.Meditation();
1716
+ }
1717
+ }
1718
+ // Lifecycle events
1719
+ async componentWillLoad() {
1720
+ // parse doc we're passed
1721
+ this.docChanged(this.doc);
1722
+ this.loadLocaleStrings();
1723
+ // start the timer
1724
+ if (this.autostart) {
1725
+ this.secondsRemaining = this.obj.metadata.length;
1726
+ this.start();
1727
+ }
1728
+ }
1729
+ // Public methods
1730
+ /** Start the timer, either with a given value of seconds or with the number passed in the Meditation object metadata */
1731
+ async start(value = undefined) {
1732
+ var _a, _b;
1733
+ const metadata = (_b = (_a = this.obj) === null || _a === void 0 ? void 0 : _a.metadata) !== null && _b !== void 0 ? _b : { length: 300, delay: 0 }, seconds = value || metadata.length, delay = metadata.delay;
1734
+ this.secondsRemaining = seconds;
1735
+ this.startingDuration = seconds;
1736
+ // Start the timer after the delay
1737
+ setTimeout(() => {
1738
+ this.startTimer();
1739
+ this.started = true;
1740
+ }, delay);
1741
+ // Emit event that it's running, after the delay
1742
+ setTimeout(() => {
1743
+ this.timerChanged.emit('start');
1744
+ }, delay);
1745
+ }
1746
+ /** Pause the timer */
1747
+ async pause() {
1748
+ this.paused = true;
1749
+ this.stopTimer();
1750
+ }
1751
+ /** Resume the timer */
1752
+ async resume() {
1753
+ this.paused = false;
1754
+ this.startTimer();
1755
+ this.timerChanged.emit('resume');
1756
+ }
1757
+ /** Rewind the timer to its initial value and restart it */
1758
+ async rewind() {
1759
+ this.pause(); // pause and clear the timer
1760
+ this.stopTimer();
1761
+ this.start(); // starts with the value passed
1762
+ this.timerChanged.emit('rewind');
1763
+ }
1764
+ /** Returns the total duration this timer is running for. */
1765
+ async duration() {
1766
+ return this.startingDuration;
1767
+ }
1768
+ /** Reset the selector for length of time */
1769
+ async reset() {
1770
+ await this.pause();
1771
+ this.secondsRemaining = undefined;
1772
+ }
1773
+ // Private methods
1774
+ async loadLocaleStrings() {
1775
+ try {
1776
+ this.localeStrings = LOCALE$3[locale.getComponentClosestLanguage(this.element)];
1777
+ }
1778
+ catch (e) {
1779
+ console.warn(e);
1780
+ }
1781
+ }
1782
+ minutesSeconds(value) {
1783
+ const negative = value < 0, minutes = Math.floor(Math.abs(value / 60));
1784
+ return `${negative ? '-' : ''}${minutes.toString().padStart(2, '0')}:${Math.abs((value - minutes * 60)).toString().padStart(2, '0')}`;
1785
+ }
1786
+ startTimer() {
1787
+ this.timerId = setInterval(() => {
1788
+ this.secondsRemaining--;
1789
+ if (this.secondsRemaining == 0) {
1790
+ this.timerChanged.emit('complete');
1791
+ this.startingDuration = undefined;
1792
+ }
1793
+ else {
1794
+ this.timerChanged.emit(this.secondsRemaining);
1795
+ }
1796
+ }, 1000);
1797
+ }
1798
+ stopTimer() {
1799
+ if (this.timerId) {
1800
+ clearInterval(this.timerId);
1801
+ }
1802
+ // tell the listener to stop audio, controls, etc.
1803
+ this.timerChanged.emit('pause');
1804
+ }
1805
+ handleControlSubmit(e) {
1806
+ e.preventDefault();
1807
+ }
1808
+ handleControlValue(e) {
1809
+ var _a, _b, _c;
1810
+ // Blank values are bad -- replace with 0
1811
+ let value = e.target.value;
1812
+ if (value == '') {
1813
+ value = '0';
1814
+ }
1815
+ // Apply directly to the object and refresh display
1816
+ Object.assign(this.obj, {
1817
+ metadata: Object.assign(Object.assign({}, this.obj.metadata), { length: parseInt(value) * 60 })
1818
+ });
1819
+ this.obj = new rubric.Meditation(this.obj);
1820
+ this.secondsRemaining = (_c = (_b = (_a = this.obj) === null || _a === void 0 ? void 0 : _a.metadata) === null || _b === void 0 ? void 0 : _b.length) !== null && _c !== void 0 ? _c : 0;
1821
+ }
1822
+ buttonNode(handler, label, icon, fill = 'clear', size = 'large') {
1823
+ const localeStrings = this.localeStrings || {};
1824
+ if (customElements && !!customElements.get('ion-button')) {
1825
+ return (index.h("ion-button", { onClick: handler, fill: fill, size: size }, index.h("ion-icon", { name: icon, slot: 'start' }), index.h("ion-label", null, localeStrings[label])));
1826
+ }
1827
+ else {
1828
+ return (index.h("button", { onClick: handler, class: fill, style: { color: this.color } }, localeStrings[label]));
1829
+ }
1830
+ }
1831
+ // Render
1832
+ render() {
1833
+ var _a, _b, _c, _d, _e, _f, _g;
1834
+ const localeStrings = this.localeStrings || {};
1835
+ const length = (_c = (_b = (_a = this.obj) === null || _a === void 0 ? void 0 : _a.metadata) === null || _b === void 0 ? void 0 : _b.length) !== null && _c !== void 0 ? _c : 300, progressAmount = this.secondsRemaining / length, progressPercent = progressAmount * 100;
1836
+ //console.log('meditation', length, progressAmount, progressPercent)
1837
+ return (this.editable
1838
+ ? index.h(index.Host, null, index.h("form", { class: 'controls', onSubmit: (e) => this.handleControlSubmit(e) }, index.h("span", null, localeStrings.meditate), index.h("ldf-editable-text", { inputType: "number", short: true, path: `${this.path}/metadata/length`, text: (_g = ((_f = (_e = (_d = this.obj) === null || _d === void 0 ? void 0 : _d.metadata) === null || _e === void 0 ? void 0 : _e.length) !== null && _f !== void 0 ? _f : 300)) === null || _g === void 0 ? void 0 : _g.toString() }), index.h("span", null, localeStrings.seconds), index.h("span", null, "(", Math.floor(length / 60), ":", Math.floor(length % 60).toString().padStart(2, '0'), ")")))
1839
+ : index.h(index.Host, null, index.h("div", { class: { 'control-container': true, 'hidden': !!this.secondsRemaining } }, index.h("form", { class: 'controls', onSubmit: (e) => this.handleControlSubmit(e) }, this.buttonNode(() => this.start(), 'meditate', 'sunny', 'solid', 'small'), index.h("input", { type: 'number', value: length / 60, onInput: (e) => this.handleControlValue(e) }), index.h("span", null, localeStrings.minutes))), index.h("div", { class: { 'hidden': !this.secondsRemaining } }, index.h("div", { class: 'progress-circle-container' }, index.h("div", { class: 'progress-circle', style: { background: `conic-gradient(${this.color} ${100 - progressPercent}%, 0, #ecf0f1 ${progressPercent}%)` } }, index.h("div", { class: 'circle-overlay' }, index.h("div", { class: 'seconds' }, this.minutesSeconds(this.secondsRemaining)), index.h("div", { class: 'controls' }, !this.started && this.buttonNode(() => this.start(), 'start', 'start'), this.started && !this.paused && this.buttonNode(() => this.pause(), 'pause', 'pause'), this.started && this.paused && this.buttonNode(() => this.resume(), 'resume', 'play'))))))));
1840
+ }
1841
+ get element() { return index.getElement(this); }
1842
+ static get watchers() { return {
1843
+ "doc": ["docChanged"]
1844
+ }; }
1845
+ };
1846
+ MeditationComponent.style = meditationCss;
1847
+
1848
+ const option = "Option";
1849
+ const EN$2 = {
1850
+ option: option
1851
+ };
1852
+
1853
+ const optionCss = ".select-control.sc-ldf-option{margin-top:var(--ldf-select-control-margin-top)}ion-select.sc-ldf-option{width:75vw;max-width:300px}";
1854
+
1855
+ const LOCALE$2 = {
1856
+ 'en': EN$2
1857
+ };
1858
+ const OptionComponent = class {
1859
+ constructor(hostRef) {
1860
+ index.registerInstance(this, hostRef);
1861
+ this.ldfAddOptionToDoc = index.createEvent(this, "ldfAddOptionToDoc", 7);
1862
+ this.ldfDocShouldChange = index.createEvent(this, "ldfDocShouldChange", 7);
1863
+ this.ldfOptionAskForStoredSelection = index.createEvent(this, "ldfOptionAskForStoredSelection", 7);
1864
+ this.ldfOptionMakeSelection = index.createEvent(this, "ldfOptionMakeSelection", 7);
1865
+ }
1866
+ docChanged(newDoc) {
1867
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1868
+ try {
1869
+ if (typeof newDoc == 'string') {
1870
+ this.obj = new option$1.Option(JSON.parse(newDoc));
1871
+ }
1872
+ else {
1873
+ this.obj = new option$1.Option(newDoc);
1874
+ }
1875
+ }
1876
+ catch (e) {
1877
+ console.warn(e);
1878
+ this.obj = new option$1.Option();
1879
+ }
1880
+ const selected = this.editable
1881
+ ? (_f = (_c = (_b = (_a = this.obj) === null || _a === void 0 ? void 0 : _a.metadata) === null || _b === void 0 ? void 0 : _b.editor_selected) !== null && _c !== void 0 ? _c : (_e = (_d = this.obj) === null || _d === void 0 ? void 0 : _d.metadata) === null || _e === void 0 ? void 0 : _e.selected) !== null && _f !== void 0 ? _f : 0
1882
+ : (_j = (_h = (_g = this.obj) === null || _g === void 0 ? void 0 : _g.metadata) === null || _h === void 0 ? void 0 : _h.selected) !== null && _j !== void 0 ? _j : 0;
1883
+ this.select(selected);
1884
+ if (!((_k = this.obj) === null || _k === void 0 ? void 0 : _k.value) || !this.obj.value[selected] || !this.obj.value[selected].value) {
1885
+ this.selectFirstDefined();
1886
+ }
1887
+ this.filterOptions();
1888
+ }
1889
+ // Lifecycle events
1890
+ componentWillLoad() {
1891
+ this.docChanged(this.doc);
1892
+ this.loadLocaleStrings();
1893
+ this.ldfOptionAskForStoredSelection.emit({ el: this.el });
1894
+ }
1895
+ /** Asynchronously load localization strings */
1896
+ async loadLocaleStrings() {
1897
+ try {
1898
+ this.localeStrings = LOCALE$2[locale.getComponentClosestLanguage(this.el)];
1899
+ }
1900
+ catch (e) {
1901
+ console.warn(e);
1902
+ }
1903
+ }
1904
+ /** Display the nth option */
1905
+ async select(index, resultedFromUserAction = false) {
1906
+ var _a, _b, _c, _d, _e, _f, _g, _h;
1907
+ if (((_a = this.obj) === null || _a === void 0 ? void 0 : _a.slug) && typeof index === 'number' && resultedFromUserAction) {
1908
+ this.ldfOptionMakeSelection.emit({ slug: (_b = this.obj) === null || _b === void 0 ? void 0 : _b.slug, index });
1909
+ }
1910
+ const hadMetadata = Boolean((_c = this.obj) === null || _c === void 0 ? void 0 : _c.metadata), oldValue = (_e = (_d = this.obj) === null || _d === void 0 ? void 0 : _d.metadata) === null || _e === void 0 ? void 0 : _e.editor_selected;
1911
+ if (Number(index) >= 0) {
1912
+ //this.selectedDoc = this.obj.value.filter(child => Boolean(child))[index];
1913
+ if ((_f = this.obj) === null || _f === void 0 ? void 0 : _f.metadata) {
1914
+ this.obj.metadata.selected = Number(index);
1915
+ this.obj.metadata.editor_selected = Number(index);
1916
+ }
1917
+ else {
1918
+ this.obj.metadata = { selected: Number(index), editor_selected: Number(index) };
1919
+ }
1920
+ this.obj = new option$1.Option(Object.assign({}, this.obj));
1921
+ // only change the selection at this point if it's not editable
1922
+ // if it's editable, the editor will control when it changes
1923
+ if (resultedFromUserAction && !this.editable) {
1924
+ this.ldfDocShouldChange.emit(new change.Change({
1925
+ path: `${this.path}/metadata`,
1926
+ op: [{
1927
+ type: 'set',
1928
+ index: 'selected',
1929
+ oldValue,
1930
+ value: Number(index)
1931
+ }]
1932
+ }));
1933
+ }
1934
+ if (this.editable) {
1935
+ if (hadMetadata && index !== oldValue) {
1936
+ this.ldfDocShouldChange.emit(new change.Change({
1937
+ path: `${this.path}/metadata`,
1938
+ op: [{
1939
+ type: 'set',
1940
+ index: 'editor_selected',
1941
+ oldValue,
1942
+ value: Number(index)
1943
+ }]
1944
+ }));
1945
+ }
1946
+ else if (!hadMetadata && index !== oldValue) {
1947
+ this.ldfDocShouldChange.emit(new change.Change({
1948
+ path: `${this.path}`,
1949
+ op: [{
1950
+ type: 'set',
1951
+ index: 'metadata',
1952
+ value: { editor_selected: Number(index) }
1953
+ }]
1954
+ }));
1955
+ }
1956
+ }
1957
+ // sets metadata.selected to new index, and creates objects along the way if undefined
1958
+ // without overriding any other metadata fields
1959
+ Object.assign(this.obj, { metadata: Object.assign(Object.assign({}, this.obj.metadata), { selected: index }) });
1960
+ Object.assign(this.obj, { metadata: Object.assign(Object.assign({}, this.obj.metadata), { editor_selected: index }) });
1961
+ }
1962
+ else if (index === 'add') {
1963
+ this.ldfAddOptionToDoc.emit({
1964
+ base: this.path,
1965
+ index: (_h = (_g = this.obj) === null || _g === void 0 ? void 0 : _g.value) === null || _h === void 0 ? void 0 : _h.length,
1966
+ obj: this.obj
1967
+ });
1968
+ }
1969
+ }
1970
+ // Private methods
1971
+ onSelectChange(ev) {
1972
+ const target = ev.target, value = parseInt(target.value);
1973
+ this.select(value, true);
1974
+ }
1975
+ selectFirstDefined() {
1976
+ const first = this.obj.value.find(opt => (opt === null || opt === void 0 ? void 0 : opt.value) !== undefined), index = this.obj.value.filter(child => Boolean(child)).indexOf(first);
1977
+ this.select(index);
1978
+ }
1979
+ filterOptions() {
1980
+ var _a;
1981
+ if (this.obj) {
1982
+ this.obj = new option$1.Option(Object.assign(Object.assign({}, this.obj), { value: (((_a = this.obj) === null || _a === void 0 ? void 0 : _a.value) || []).filter(entry => {
1983
+ return this.editable || (Boolean(entry) && (Boolean(entry.value) || Boolean((entry === null || entry === void 0 ? void 0 : entry.type) === "bible-reading" && entry.citation)));
1984
+ }) }));
1985
+ }
1986
+ }
1987
+ // Render helpers
1988
+ /** Return an Ionic Select or Segment element if available, otherwise a vanilla HTML Select Element */
1989
+ selectNode() {
1990
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
1991
+ const currentlySelected = this.editable ? (_f = (_c = (_b = (_a = this.obj) === null || _a === void 0 ? void 0 : _a.metadata) === null || _b === void 0 ? void 0 : _b.editor_selected) !== null && _c !== void 0 ? _c : (_e = (_d = this.obj) === null || _d === void 0 ? void 0 : _d.metadata) === null || _e === void 0 ? void 0 : _e.selected) !== null && _f !== void 0 ? _f : 0 : (_j = (_h = (_g = this.obj) === null || _g === void 0 ? void 0 : _g.metadata) === null || _h === void 0 ? void 0 : _h.selected) !== null && _j !== void 0 ? _j : 0;
1992
+ if (((_l = (_k = this.obj) === null || _k === void 0 ? void 0 : _k.value) === null || _l === void 0 ? void 0 : _l.length) > 1 || this.editable) {
1993
+ // Ionic available and
1994
+ if (customElements && !!customElements.get('ion-select')) {
1995
+ const optionsAreLong = (((_m = this.obj) === null || _m === void 0 ? void 0 : _m.value) || [])
1996
+ .map((option, optionIndex) => { var _a; return ((_a = this.versionLabel(option, optionIndex)) === null || _a === void 0 ? void 0 : _a.length) > 20; })
1997
+ .reduce((a, b) => a || b, false);
1998
+ // <= 3, short options
1999
+ if (!optionsAreLong && ((_o = this.obj) === null || _o === void 0 ? void 0 : _o.value.length) <= 3) {
2000
+ return (index.h("ion-segment", { color: "primary", value: currentlySelected.toString() }, (_p = this.obj) === null || _p === void 0 ? void 0 :
2001
+ _p.value.map((option, optionIndex) => index.h("ion-segment-button", { value: optionIndex.toString(), onClick: () => this.select(optionIndex, true) }, index.h("ion-label", null, this.versionLabel(option, optionIndex)))), this.editable && index.h("ion-segment-button", { value: 'add', class: 'add', onClick: () => this.select('add', true) }, index.h("ion-label", null, "+"))));
2002
+ }
2003
+ // >2 options, or options are longish
2004
+ else {
2005
+ console.log('>2 or longish');
2006
+ return (index.h("ion-toolbar", null, index.h("ion-select", { value: currentlySelected, slot: this.editable ? 'start' : 'end', onIonChange: e => this.select(Number(e.detail.value), true) }, (_q = this.obj) === null || _q === void 0 ? void 0 : _q.value.map((option, optionIndex) => index.h("ion-select-option", { value: optionIndex }, index.h("ion-label", null, this.versionLabel(option, optionIndex))))), this.editable && index.h("ion-buttons", { slot: 'end' }, index.h("ion-button", { onClick: () => this.select('add', true) }, index.h("ion-icon", { slot: 'icon-only', name: 'add' })))));
2007
+ }
2008
+ }
2009
+ // Ionic not availabe
2010
+ else {
2011
+ return (index.h("ldf-label-bar", null, index.h("select", { onInput: ev => this.onSelectChange(ev), slot: this.editable ? 'start' : 'end' }, (_r = this.obj) === null || _r === void 0 ? void 0 : _r.value.map((option, optionIndex) => index.h("option", { value: optionIndex, selected: optionIndex == currentlySelected }, this.versionLabel(option, optionIndex)))), this.editable && index.h("button", { slot: 'end', onClick: () => this.select('add', true) }, "+")));
2012
+ }
2013
+ }
2014
+ else {
2015
+ return [];
2016
+ }
2017
+ }
2018
+ versionLabel(option, index) {
2019
+ try {
2020
+ return this.obj.getVersionLabel(option);
2021
+ }
2022
+ catch (e) {
2023
+ console.warn(e);
2024
+ return `${(this.localeStrings || {}).option} ${index + 1}`;
2025
+ }
2026
+ }
2027
+ // Render
2028
+ render() {
2029
+ var _a;
2030
+ //console.log('ldf-option (render) ', this.obj?.metadata.selected, this.obj.value, this.selectedDoc)
2031
+ const selectedIndex = this.editable ? (_a = this.obj.metadata.editor_selected) !== null && _a !== void 0 ? _a : this.obj.metadata.selected : this.obj.metadata.selected;
2032
+ return (index.h(index.Host, { lang: this.obj.language }, index.h("div", { class: 'select-control' }, index.h("ldf-label-bar", null, this.selectNode())), (this.obj.value || this.editable) && index.h("ldf-liturgical-document", { doc: this.obj.value[selectedIndex], path: `${this.path}/value/${this.obj.metadata.selected}`, base: `${this.path}/value`, index: selectedIndex, editable: this.editable, parentType: 'option' })));
2033
+ }
2034
+ get el() { return index.getElement(this); }
2035
+ static get watchers() { return {
2036
+ "doc": ["docChanged"]
2037
+ }; }
2038
+ };
2039
+ OptionComponent.style = optionCss;
2040
+
2041
+ const changeCanticle = "Change Canticle";
2042
+ const citation$1 = "(Biblical) Citation";
2043
+ const label$1 = "Label";
2044
+ const latinname = "Latin Name";
2045
+ const section_break_insert = "+ insert section break";
2046
+ const section_break_remove = "x remove section break";
2047
+ const source$1 = "Source";
2048
+ const source_citation = "Citation";
2049
+ const EN$1 = {
2050
+ changeCanticle: changeCanticle,
2051
+ citation: citation$1,
2052
+ label: label$1,
2053
+ latinname: latinname,
2054
+ section_break_insert: section_break_insert,
2055
+ section_break_remove: section_break_remove,
2056
+ source: source$1,
2057
+ source_citation: source_citation
2058
+ };
2059
+
2060
+ const psalmCss = "ldf-psalm.sc-ldf-psalm,.sc-ldf-psalm-h{font-family:var(--ldf-font-face);--ldf-drop-margin-right:var(--ldf-drop-psalm-margin-right)}ldf-psalm[lang=he].sc-ldf-psalm .verse.sc-ldf-psalm,[lang=he].sc-ldf-psalm-h .verse.sc-ldf-psalm{text-align:right;--ldf-drop-float:right}.psalm-set.sc-ldf-psalm{margin-top:0.5em;margin-bottom:0.5em}.psalm-set.sc-ldf-psalm .psalm.sc-ldf-psalm{display:var(--ldf-psalm-grid-display);grid-template-columns:var(--ldf-psalm-grid-template-columns);grid-template-rows:auto;grid-template-areas:var(--ldf-psalm-grid-template-areas);margin:0;text-indent:var(--ldf-psalm-verse-indentation)}.psalm-set.sc-ldf-psalm .psalm.sc-ldf-psalm br.sc-ldf-psalm{display:var(--ldf-psalm-line-break-display)}.psalm-set.sc-ldf-psalm .psalm.sc-ldf-psalm sup.sc-ldf-psalm{float:var(--ldf-psalm-number-float);display:var(--ldf-psalm-number-display);grid-area:var(--ldf-psalm-number-grid-area);margin-right:var(--ldf-psalm-number-margin-right)}.psalm-set.sc-ldf-psalm .psalm.sc-ldf-psalm .text.sc-ldf-psalm{display:var(--ldf-psalm-text-display);grid-area:var(--ldf-psalm-text-grid-area)}.psalm-set.sc-ldf-psalm .psalm.sc-ldf-psalm .halfverse.sc-ldf-psalm{margin-left:var(--ldf-psalm-halfverse-margin-left)}.psalm-set.sc-ldf-psalm .psalm.sc-ldf-psalm .verse.sc-ldf-psalm,.psalm-set.sc-ldf-psalm .psalm.sc-ldf-psalm .halfverse.sc-ldf-psalm{display:var(--ldf-psalm-verse-display)}.psalm-set.sc-ldf-psalm .psalm.sc-ldf-psalm .halfverse.sc-ldf-psalm{display:var(--ldf-psalm-halfverse-display, var(--ldf-psalm-verse-display))}.editable.sc-ldf-psalm .verse.sc-ldf-psalm,.editable.sc-ldf-psalm .halfverse.sc-ldf-psalm{width:100%}.psalm-parent.no-numbers.sc-ldf-psalm{display:block;text-align:left;grid-template-columns:none;grid-template-rows:none;grid-template-areas:none}.psalm-parent.no-numbers.sc-ldf-psalm .psalm.sc-ldf-psalm{display:block;grid-template-columns:none;grid-template-rows:none;grid-template-areas:none}.psalm-parent.no-numbers.sc-ldf-psalm .psalm.sc-ldf-psalm .text.sc-ldf-psalm{text-align:left;grid-area:none;display:var(--ldf-psalm-text-display);width:100%}.psalm-set.sc-ldf-psalm .psalm.sc-ldf-psalm:nth-of-type(1) sup.sc-ldf-psalm{display:var(--ldf-psalm-set-first-verse-number-display)}.psalm-set.sc-ldf-psalm .psalm.sc-ldf-psalm:nth-of-type(1) .text.sc-ldf-psalm:nth-of-type(1) .verse.sc-ldf-psalm:nth-of-type(1){display:var(--ldf-psalm-set-first-verse-display)}.psalm-set.sc-ldf-psalm .psalm.sc-ldf-psalm:nth-of-type(1) .text.sc-ldf-psalm:nth-of-type(1) .halfverse.sc-ldf-psalm:nth-of-type(2){display:var(--ldf-psalm-set-first-half-verse-display, inline-block)}.psalm-set.sc-ldf-psalm:nth-of-type(1) .psalm.sc-ldf-psalm:nth-of-type(1) sup.sc-ldf-psalm{display:var(--ldf-psalm-first-verse-number-display)}.psalm-set.sc-ldf-psalm:nth-of-type(1) .psalm.sc-ldf-psalm:nth-of-type(1) .text.sc-ldf-psalm:nth-of-type(1) .verse.sc-ldf-psalm:nth-of-type(1){display:var(--ldf-psalm-first-verse-display)}.psalm-set.sc-ldf-psalm:nth-of-type(1) .psalm.sc-ldf-psalm:nth-of-type(1) .text.sc-ldf-psalm:nth-of-type(1) .halfverse.sc-ldf-psalm:nth-of-type(2){display:var(--ldf-psalm-first-half-verse-display, inline-block)}.antiphon.sc-ldf-psalm{display:var(--ldf-psalm-antiphon-display);font-style:var(--ldf-antiphon-font-style);font-weight:var(--ldf-antiphon-font-weight);margin-top:0.5em}.repeat-antiphon.sc-ldf-psalm{display:var(--ldf-psalm-repeat-antiphon-display)}h5.sc-ldf-psalm{font-size:1em;font-style:italic;font-weight:normal;margin-right:1em}.psalm.unison.sc-ldf-psalm .text.sc-ldf-psalm{font-weight:var(--ldf-unison-font-weight);font-style:var(--ldf-unison-font-style)}.psalm.omit.sc-ldf-psalm .text.sc-ldf-psalm{display:none}.psalm.wholeverse.sc-ldf-psalm .psalm.sc-ldf-psalm:nth-child(even),.psalm-parent.wholeverse.sc-ldf-psalm .psalm.sc-ldf-psalm:nth-child(even){font-weight:var(--ldf-response-font-weight);font-style:var(--ldf-response-font-style)}.psalm.halfverse.sc-ldf-psalm .halfverse.sc-ldf-psalm,.psalm-parent.halfverse.sc-ldf-psalm .halfverse.sc-ldf-psalm{font-weight:var(--ldf-response-font-weight);font-style:var(--ldf-response-font-style)}h3.editable-label.sc-ldf-psalm{text-align:var(--ldf-h3-text-align);font-weight:var(--ldf-h3-font-weight);font-style:var(--ldf-h3-font-style);font-variant:var(--ldf-h3-font-variant);font-size:var(--ldf-h3-font-size);text-transform:var(--ldf-h3-text-transform)}.section-break.sc-ldf-psalm{display:block;text-align:center;width:100%}.section-break.hidden.sc-ldf-psalm{display:none}";
2061
+
2062
+ const LOCALE$1 = {
2063
+ 'en': EN$1,
2064
+ };
2065
+ const PsalmComponent = class {
2066
+ constructor(hostRef) {
2067
+ index.registerInstance(this, hostRef);
2068
+ this.ldfAskForCanticleOptions = index.createEvent(this, "ldfAskForCanticleOptions", 7);
2069
+ this.ldfDocShouldChange = index.createEvent(this, "ldfDocShouldChange", 7);
2070
+ this.focusedVerse = undefined;
2071
+ this.focusedSection = undefined;
2072
+ }
2073
+ docChanged(newDoc) {
2074
+ try {
2075
+ if (typeof newDoc == 'string') {
2076
+ this.obj = new rubric.Psalm(JSON.parse(newDoc));
2077
+ }
2078
+ else {
2079
+ this.obj = new rubric.Psalm(newDoc);
2080
+ }
2081
+ this.filter();
2082
+ }
2083
+ catch (e) {
2084
+ console.warn(e);
2085
+ this.obj = new rubric.Psalm();
2086
+ }
2087
+ }
2088
+ // Lifecycle events
2089
+ async componentWillLoad() {
2090
+ this.docChanged(this.doc);
2091
+ this.loadLocaleStrings();
2092
+ this.filter();
2093
+ }
2094
+ // Private methods
2095
+ async loadLocaleStrings() {
2096
+ try {
2097
+ this.localeStrings = LOCALE$1[locale.getComponentClosestLanguage(this.element)];
2098
+ }
2099
+ catch (e) {
2100
+ console.warn(e);
2101
+ }
2102
+ }
2103
+ async changeCanticle() {
2104
+ const modal = await overlays.modalController.create({
2105
+ component: 'ldf-editable-filter-documents',
2106
+ });
2107
+ modal.componentProps = {
2108
+ modal,
2109
+ type: "canticle",
2110
+ changeCallback: (doc) => {
2111
+ this.ldfDocShouldChange.emit(new change.Change({
2112
+ path: this.path,
2113
+ op: [{
2114
+ type: 'set',
2115
+ oldValue: this.obj,
2116
+ value: doc
2117
+ }]
2118
+ }));
2119
+ }
2120
+ };
2121
+ await modal.present();
2122
+ this.ldfAskForCanticleOptions.emit(this.path);
2123
+ }
2124
+ async filter() {
2125
+ this.filteredValue = this.obj.filteredVerses();
2126
+ }
2127
+ // Render helpers
2128
+ antiphonNode(antiphon, notEditable = false) {
2129
+ var _a, _b;
2130
+ if (typeof antiphon == 'string') {
2131
+ const refrain$1 = new refrain.Refrain({ type: 'refrain', value: [antiphon], style: 'antiphon' });
2132
+ return index.h("ldf-refrain", { class: 'antiphon', doc: refrain$1, editable: this.editable && !notEditable, path: `${this.path}/metadata/antiphon` });
2133
+ }
2134
+ else if (antiphon === null || antiphon === void 0 ? void 0 : antiphon.type) {
2135
+ return index.h("ldf-liturgical-document", { class: 'antiphon', doc: antiphon, path: `${this.path}/metadata/antiphon`, editable: this.editable && !notEditable });
2136
+ }
2137
+ else if (typeof antiphon == 'object') {
2138
+ // antiphon is something like an O antiphon tree:
2139
+ // dates can be either MM/DD or MM-DD
2140
+ // { '12/23': '...', '12/24': '...' }
2141
+ const date = this.obj.day ? book$1.dateFromYMDString((_b = (_a = this.obj) === null || _a === void 0 ? void 0 : _a.day) === null || _b === void 0 ? void 0 : _b.date) : new Date();
2142
+ return this.antiphonNode(antiphon[`${date.getMonth() + 1}/${date.getDate()}`] || antiphon[`${date.getMonth() + 1}-${date.getDate()}`], true);
2143
+ }
2144
+ }
2145
+ gloriaNode(gloria) {
2146
+ if (typeof gloria == 'string') {
2147
+ const refrain$1 = new refrain.Refrain({ value: [gloria], style: 'gloria' });
2148
+ return index.h("ldf-liturgical-document", { doc: refrain$1, editable: this.editable });
2149
+ }
2150
+ else {
2151
+ return index.h("ldf-liturgical-document", { doc: gloria, editable: this.editable });
2152
+ }
2153
+ }
2154
+ headingNode(value = undefined, level = 3, showLatinName = true, omitCitation = false, omitSource = false) {
2155
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
2156
+ let label = this.obj.label;
2157
+ if (this.obj.style == 'canticle' && this.obj.metadata && this.obj.metadata.number && this.obj.metadata.localname) {
2158
+ label = `${this.obj.metadata.number}. ${this.obj.metadata.localname}`;
2159
+ }
2160
+ else if (this.obj.style == 'canticle' && this.obj.metadata && this.obj.metadata.localname) {
2161
+ label = this.obj.metadata.localname;
2162
+ }
2163
+ const heading = new heading$1.Heading({
2164
+ type: 'heading',
2165
+ metadata: { level },
2166
+ citation: !omitCitation && ((_a = this.obj) === null || _a === void 0 ? void 0 : _a.citation) !== ((_b = this.obj) === null || _b === void 0 ? void 0 : _b.label) ? (_c = this.obj) === null || _c === void 0 ? void 0 : _c.citation : undefined,
2167
+ value: [value !== null && value !== void 0 ? value : label],
2168
+ source: omitSource ? undefined : (_d = this.obj) === null || _d === void 0 ? void 0 : _d.source
2169
+ });
2170
+ return (this.editable
2171
+ ? [
2172
+ index.h("ldf-label-bar", null, index.h("h3", { slot: "start", class: "editable-label" }, index.h("ldf-editable-text", { id: "label", text: (_e = this.obj) === null || _e === void 0 ? void 0 : _e.label, path: `${this.path}/label`, placeholder: (_f = this.localeStrings) === null || _f === void 0 ? void 0 : _f.label })), ((_g = this.obj) === null || _g === void 0 ? void 0 : _g.metadata) && index.h("ldf-editable-text", { id: "latinname", text: (_j = (_h = this.obj) === null || _h === void 0 ? void 0 : _h.metadata) === null || _j === void 0 ? void 0 : _j.latinname, path: `${this.path}/metadata/latinname`, placeholder: (_k = this.localeStrings) === null || _k === void 0 ? void 0 : _k.latinname }), index.h("ldf-editable-text", { slot: "end", id: "source-source", text: (_m = (_l = this.obj) === null || _l === void 0 ? void 0 : _l.source) === null || _m === void 0 ? void 0 : _m.source, path: `${this.path}/source/source`, placeholder: (_o = this.localeStrings) === null || _o === void 0 ? void 0 : _o.source }), index.h("ldf-editable-text", { slot: "end", id: "source-citation", text: (_q = (_p = this.obj) === null || _p === void 0 ? void 0 : _p.source) === null || _q === void 0 ? void 0 : _q.citation, path: `${this.path}/source/citation`, placeholder: (_r = this.localeStrings) === null || _r === void 0 ? void 0 : _r.source_citation })),
2173
+ index.h("ldf-label-bar", null, index.h("ldf-editable-text", { slot: "start", id: "citation", text: (_s = this.obj) === null || _s === void 0 ? void 0 : _s.citation, path: `${this.path}/citation`, placeholder: (_t = this.localeStrings) === null || _t === void 0 ? void 0 : _t.citation }))
2174
+ ]
2175
+ : index.h("ldf-heading", { doc: heading }, showLatinName && index.h("h5", { slot: 'additional' }, (_v = (_u = this.obj) === null || _u === void 0 ? void 0 : _u.metadata) === null || _v === void 0 ? void 0 : _v.latinname)));
2176
+ }
2177
+ insertSectionBreakAfterVerse(sectionIndex, verseIndex) {
2178
+ const section = this.obj.value[sectionIndex], remainingVerses = section.value.slice(0, verseIndex + 1), movingVerses = section.value.slice(verseIndex + 1);
2179
+ this.ldfDocShouldChange.emit(new change.Change({
2180
+ path: `${this.path}/value/${sectionIndex}`,
2181
+ op: [{
2182
+ type: 'set',
2183
+ oldValue: section,
2184
+ value: Object.assign(Object.assign({}, section), { value: remainingVerses })
2185
+ }]
2186
+ }));
2187
+ this.ldfDocShouldChange.emit(new change.Change({
2188
+ path: `${this.path}/value`,
2189
+ op: [{
2190
+ type: 'insertAt',
2191
+ index: sectionIndex + 1,
2192
+ oldValue: section,
2193
+ value: Object.assign(Object.assign({}, section), { value: movingVerses })
2194
+ }]
2195
+ }));
2196
+ }
2197
+ removeSectionBreakAfter(sectionIndex) {
2198
+ const thisSection = this.obj.value[sectionIndex], nextSection = this.obj.value[sectionIndex + 1];
2199
+ if (thisSection && nextSection) {
2200
+ const combinedValue = thisSection.value.concat(nextSection.value);
2201
+ this.ldfDocShouldChange.emit(new change.Change({
2202
+ path: `${this.path}/value/${sectionIndex}/value`,
2203
+ op: [{
2204
+ type: 'set',
2205
+ oldValue: thisSection.value,
2206
+ value: combinedValue
2207
+ }]
2208
+ }));
2209
+ this.ldfDocShouldChange.emit(new change.Change({
2210
+ path: `${this.path}/value`,
2211
+ op: [{
2212
+ type: 'deleteAt',
2213
+ index: sectionIndex + 1,
2214
+ oldValue: nextSection
2215
+ }]
2216
+ }));
2217
+ }
2218
+ }
2219
+ // Render
2220
+ render() {
2221
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
2222
+ const includeAntiphon = this.obj.includeAntiphon();
2223
+ // create blank psalm verse pattern
2224
+ let pattern, templateMaker = (verse) => ({ type: 'psalm-verse', number: '', halfverse: '', verse });
2225
+ if (this.editable) {
2226
+ pattern = Object.assign({}, (((_b = (_a = this.obj) === null || _a === void 0 ? void 0 : _a.value[0]) === null || _b === void 0 ? void 0 : _b.value[0]) || { type: 'psalm-verse', number: '', halfverse: '', verse: '' }));
2227
+ if (pattern.number) {
2228
+ pattern.number = '';
2229
+ }
2230
+ if (pattern.halfverse) {
2231
+ pattern.halfverse = '';
2232
+ }
2233
+ if (pattern.verse) {
2234
+ pattern.verse = '';
2235
+ }
2236
+ }
2237
+ const noNumbers = (((_c = this.obj) === null || _c === void 0 ? void 0 : _c.value) || [])
2238
+ .map(section => section.value.map(verse => !Boolean(verse.number)))
2239
+ .flat()
2240
+ .reduce((a, b) => a || b, false);
2241
+ const localeStrings = this.localeStrings || {};
2242
+ return (index.h(index.Host, { lang: ((_d = this.obj) === null || _d === void 0 ? void 0 : _d.language) || 'en' }, index.h("div", { class: `psalm-parent ${this.editable ? 'editable' : ''} ${((_e = this.obj) === null || _e === void 0 ? void 0 : _e.display_format) || 'default'} ${noNumbers ? 'no-numbers' : ''}` }, (this.editable || ((_f = this.obj) === null || _f === void 0 ? void 0 : _f.style) === 'canticle') && index.h("ldf-label-bar", null, index.h("slot", { slot: 'end', name: 'controls' }, ((_g = this.obj) === null || _g === void 0 ? void 0 : _g.style) === 'canticle' && ((_j = (_h = this.obj) === null || _h === void 0 ? void 0 : _h.metadata) === null || _j === void 0 ? void 0 : _j.changeable) && index.h("ldf-label-bar", null, index.h("slot", { slot: 'end', name: 'controls' }, index.h("ion-buttons", null, index.h("ion-button", { onClick: () => this.changeCanticle() }, index.h("ion-icon", { name: "swap-horizontal", slot: "start" }), index.h("ion-label", null, localeStrings.changeCanticle))))))), this.headingNode(), includeAntiphon && this.antiphonNode(this.obj.metadata.antiphon), (_k = this.filteredValue) === null || _k === void 0 ? void 0 :
2243
+ _k.map((section, sectionIndex) => {
2244
+ var _a, _b, _c;
2245
+ return [
2246
+ // render a `Heading`, if this section has a `label`
2247
+ section.label && ((_a = section.value) === null || _a === void 0 ? void 0 : _a.length) > 0 && this.headingNode(section.label, 4, false, true, true),
2248
+ // build a set of verses
2249
+ index.h("div", { class: 'psalm-set' }, section.value.map((verse, verseIndex) => {
2250
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
2251
+ // build each verse
2252
+ if (verse instanceof heading$1.Heading) {
2253
+ // for e.g., the Benedicite, Heading passed at head of section
2254
+ return index.h("ldf-heading", { doc: verse });
2255
+ }
2256
+ else {
2257
+ // otherwise, it's a normal psalm verse
2258
+ const nodes = new Array();
2259
+ // 1st half of verse
2260
+ nodes.push(index.h("div", { class: 'verse' }, this.editable ?
2261
+ index.h("ldf-editable-text", { id: `${this.obj.uid || this.obj.slug}-${sectionIndex}-${verseIndex}-verse`, text: verse.verse, path: `${this.path}/value/${sectionIndex}/value/${verseIndex}/verse`, placeholder: 'Lorem ipsum sit dolor amet, *', template: pattern, templateMaker: templateMaker }) :
2262
+ index.h("ldf-string", { text: verse.verse, citation: { label: (_a = this.obj) === null || _a === void 0 ? void 0 : _a.label, book: ((_b = this.obj) === null || _b === void 0 ? void 0 : _b.style) === 'psalm' ? 'Psalm' : undefined, chapter: (_d = (_c = this.obj) === null || _c === void 0 ? void 0 : _c.metadata) === null || _d === void 0 ? void 0 : _d.number, verse: verse.number }, dropcap: (verseIndex == 0 && ((_e = this.obj) === null || _e === void 0 ? void 0 : _e.language) !== "he") ? 'force' : 'disabled', index: verseIndex, fragment: this.path })));
2263
+ nodes.push(index.h("br", null));
2264
+ // 2nd half of verse
2265
+ nodes.push(index.h("div", { class: 'halfverse' }, this.editable ?
2266
+ index.h("ldf-editable-text", { id: `${this.obj.uid || this.obj.slug}-${sectionIndex}-${verseIndex}-halfverse`, text: verse.halfverse, path: `${this.path}/value/${sectionIndex}/value/${verseIndex}/halfverse`, placeholder: 'consectetur adipiscing elit.', template: pattern }) :
2267
+ index.h("ldf-string", { text: verse.halfverse, citation: { label: (_f = this.obj) === null || _f === void 0 ? void 0 : _f.label, book: ((_g = this.obj) === null || _g === void 0 ? void 0 : _g.style) === 'psalm' ? 'Psalm' : undefined, chapter: (_j = (_h = this.obj) === null || _h === void 0 ? void 0 : _h.metadata) === null || _j === void 0 ? void 0 : _j.number, verse: verse.number }, dropcap: 'disabled', fragment: this.path })));
2268
+ // render the verse
2269
+ return (index.h("p", { class: this.editable ? 'psalm editable' : 'psalm', onClick: () => {
2270
+ this.focusedVerse = verseIndex;
2271
+ this.focusedSection = sectionIndex;
2272
+ } }, this.editable ?
2273
+ index.h("ldf-editable-text", { id: `${this.obj.uid || this.obj.slug}-${sectionIndex}-${verseIndex}-number`, text: verse.number, path: `${this.path}/value/${sectionIndex}/value/${verseIndex}/number`, placeholder: '#', template: pattern }) :
2274
+ (verse.number && index.h("sup", null, verse.number)), index.h("div", { class: 'text' }, nodes, this.editable && index.h("ion-button", { fill: "clear", class: { "section-break": true, "hidden": this.focusedVerse !== verseIndex || this.focusedSection !== sectionIndex }, onClick: () => this.insertSectionBreakAfterVerse(sectionIndex, verseIndex) }, localeStrings.section_break_insert))));
2275
+ }
2276
+ }), this.obj.repeatAntiphon(sectionIndex, this.filteredValue.length)
2277
+ && index.h("div", { class: 'repeat-antiphon' }, this.antiphonNode((_c = (_b = this.obj) === null || _b === void 0 ? void 0 : _b.metadata) === null || _c === void 0 ? void 0 : _c.antiphon)), this.editable && this.obj.value.length > (sectionIndex + 1) && index.h("ion-button", { fill: "clear", class: "section-break", onClick: () => this.removeSectionBreakAfter(sectionIndex) }, localeStrings.section_break_remove))
2278
+ ];
2279
+ }), ((_m = (_l = this.obj) === null || _l === void 0 ? void 0 : _l.metadata) === null || _m === void 0 ? void 0 : _m.gloria) && !this.obj.metadata.omit_gloria && this.gloriaNode(this.obj.metadata.gloria), ((((_p = (_o = this.obj) === null || _o === void 0 ? void 0 : _o.metadata) === null || _p === void 0 ? void 0 : _p.gloria) && !this.obj.metadata.omit_gloria) || (((_r = (_q = this.obj) === null || _q === void 0 ? void 0 : _q.metadata) === null || _r === void 0 ? void 0 : _r.gloria) === undefined || Boolean((_t = (_s = this.obj) === null || _s === void 0 ? void 0 : _s.metadata) === null || _t === void 0 ? void 0 : _t.omit_gloria))) && includeAntiphon && this.antiphonNode((_v = (_u = this.obj) === null || _u === void 0 ? void 0 : _u.metadata) === null || _v === void 0 ? void 0 : _v.antiphon))));
2280
+ }
2281
+ get element() { return index.getElement(this); }
2282
+ static get watchers() { return {
2283
+ "doc": ["docChanged"]
2284
+ }; }
2285
+ };
2286
+ PsalmComponent.style = psalmCss;
2287
+
2288
+ const refrainCss = "ldf-refrain.sc-ldf-refrain,.sc-ldf-refrain-h{font-family:var(--ldf-font-face);display:block}ldf-refrain.sc-ldf-refrain p.sc-ldf-refrain,.sc-ldf-refrain-h p.sc-ldf-refrain{font-style:inherit;margin-bottom:0;margin:0}.antiphon.sc-ldf-refrain{font-style:var(--ldf-antiphon-font-style)}.gloria.sc-ldf-refrain{margin-left:calc(var(--ldf-gloria-indent) / 2);text-indent:calc(var(--ldf-gloria-indent) / -2)}@media (min-width: 450px){.gloria.sc-ldf-refrain{margin-left:var(--ldf-gloria-indent);text-indent:calc(var(--ldf-gloria-indent) * -1)}.gloria.sc-ldf-refrain>p.sc-ldf-refrain:first-child{margin-left:0em}.gloria.sc-ldf-refrain>p.sc-ldf-refrain:nth-child(even){margin-left:1em}}.left.sc-ldf-refrain{text-align:left}.center.sc-ldf-refrain{text-align:center}.right.sc-ldf-refrain{text-align:right}";
2289
+
2290
+ const RefrainComponent = class {
2291
+ constructor(hostRef) {
2292
+ index.registerInstance(this, hostRef);
2293
+ }
2294
+ docChanged(newDoc) {
2295
+ try {
2296
+ if (typeof newDoc == 'string') {
2297
+ this.obj = new refrain.Refrain(JSON.parse(newDoc));
2298
+ }
2299
+ else {
2300
+ this.obj = new refrain.Refrain(newDoc);
2301
+ }
2302
+ }
2303
+ catch (e) {
2304
+ console.warn(e);
2305
+ this.obj = new refrain.Refrain();
2306
+ }
2307
+ }
2308
+ // Lifecycle events
2309
+ componentWillLoad() {
2310
+ this.docChanged(this.doc);
2311
+ }
2312
+ // Render
2313
+ render() {
2314
+ var _a, _b, _c;
2315
+ return (index.h(index.Host, { lang: this.obj.language }, this.editable && index.h("ldf-label-bar", null, index.h("slot", { slot: 'end', name: 'controls' })), index.h("div", { class: `${((_a = this.obj) === null || _a === void 0 ? void 0 : _a.style) || ''} ${((_c = (_b = this.obj) === null || _b === void 0 ? void 0 : _b.metadata) === null || _c === void 0 ? void 0 : _c.align) || ''}` }, this.obj.value && this.obj.value.map((para, ii) => this.editable ?
2316
+ index.h("ldf-editable-text", { id: `${this.obj.uid || this.obj.slug}-${ii}`, text: para, path: `${this.path}/value/${ii}` }) :
2317
+ index.h("p", { id: `${this.obj.uid || this.obj.slug}-${ii}`, innerHTML: para })))));
2318
+ }
2319
+ static get watchers() { return {
2320
+ "doc": ["docChanged"]
2321
+ }; }
2322
+ };
2323
+ RefrainComponent.style = refrainCss;
2324
+
2325
+ const label = "Label";
2326
+ const source = "Source";
2327
+ const citation = "Citation";
2328
+ const makeOptional = "Make Optional";
2329
+ const optional = "Optional";
2330
+ const EN = {
2331
+ label: label,
2332
+ source: source,
2333
+ citation: citation,
2334
+ makeOptional: makeOptional,
2335
+ optional: optional
2336
+ };
2337
+
2338
+ const responsivePrayerCss = ".sc-ldf-responsive-prayer-h{text-align:var(--ldf-text-align);text-justify:inter-character}.response.sc-ldf-responsive-prayer{font-weight:var(--ldf-response-font-weight);font-style:var(--ldf-response-font-style)}.preces.sc-ldf-responsive-prayer td.sc-ldf-responsive-prayer{text-align:left}.preces.sc-ldf-responsive-prayer td.sc-ldf-responsive-prayer:first-child{font-style:italic;text-align:left;padding-right:1em;vertical-align:top}.optional.sc-ldf-responsive-prayer{padding-left:0.5em;border-left:2px solid black}.line.sc-ldf-responsive-prayer{display:flex;flex-direction:row;align-items:center}.line.sc-ldf-responsive-prayer>*.sc-ldf-responsive-prayer{text-align:var(--ldf-text-align)}.editable.line.sc-ldf-responsive-prayer ldf-editable-boolean.sc-ldf-responsive-prayer{width:2em}.editable.line.sc-ldf-responsive-prayer p.sc-ldf-responsive-prayer{width:calc(100% - 2em)}.rubric.sc-ldf-responsive-prayer{font-family:var(--ldf-font-face);color:var(--ldf-rubric-color);font-style:var(--ldf-rubric-font-style);font-weight:var(--ldf-rubric-font-weight);font-size:var(--ldf-rubric-font-size)}.litany.sc-ldf-responsive-prayer{white-space:pre-wrap}.preces.sc-ldf-responsive-prayer{width:100%}.preces.sc-ldf-responsive-prayer tr.sc-ldf-responsive-prayer,.preces.sc-ldf-responsive-prayer .row.sc-ldf-responsive-prayer{display:table-row;display:var(--ldf-preces-tr-display)}.preces.sc-ldf-responsive-prayer tr.sc-ldf-responsive-prayer td.sc-ldf-responsive-prayer,.preces.sc-ldf-responsive-prayer tr.sc-ldf-responsive-prayer .cell.sc-ldf-responsive-prayer,.preces.sc-ldf-responsive-prayer .row.sc-ldf-responsive-prayer td.sc-ldf-responsive-prayer,.preces.sc-ldf-responsive-prayer .row.sc-ldf-responsive-prayer .cell.sc-ldf-responsive-prayer{display:table-cell;display:var(--ldf-preces-td-display);margin-left:var(--ldf-preces-td-margin-left)}h3.editable-label.sc-ldf-responsive-prayer{text-align:var(--ldf-h3-text-align);font-weight:var(--ldf-h3-font-weight);font-style:var(--ldf-h3-font-style);font-variant:var(--ldf-h3-font-variant);font-size:var(--ldf-h3-font-size);text-transform:var(--ldf-h3-text-transform)}.optional-label.sc-ldf-responsive-prayer{margin-right:0.5em}";
2339
+
2340
+ const LOCALE = {
2341
+ 'en': EN,
2342
+ };
2343
+ const ResponsivePrayerComponent = class {
2344
+ constructor(hostRef) {
2345
+ index.registerInstance(this, hostRef);
2346
+ }
2347
+ docChanged(newDoc) {
2348
+ try {
2349
+ if (typeof newDoc == 'string') {
2350
+ this.obj = new rubric.ResponsivePrayer(JSON.parse(newDoc));
2351
+ }
2352
+ else {
2353
+ this.obj = new rubric.ResponsivePrayer(newDoc);
2354
+ }
2355
+ }
2356
+ catch (e) {
2357
+ console.warn(e);
2358
+ this.obj = new rubric.ResponsivePrayer();
2359
+ }
2360
+ }
2361
+ // Lifecycle events
2362
+ async componentWillLoad() {
2363
+ this.docChanged(this.doc);
2364
+ this.loadLocaleStrings();
2365
+ }
2366
+ async loadLocaleStrings() {
2367
+ try {
2368
+ this.localeStrings = LOCALE[locale.getComponentClosestLanguage(this.element)];
2369
+ }
2370
+ catch (e) {
2371
+ console.warn(e);
2372
+ }
2373
+ }
2374
+ // Render helpers
2375
+ /** renders a `ResponsivePrayerLine` as an `ldf-editable-text` */
2376
+ editableNode(line, index$1, part, template = undefined, templateMaker) {
2377
+ return (index.h("ldf-editable-text", { id: `${this.obj.uid}-${index$1}-${part}`, text: line[part], path: `${this.path}/value/${index$1}/${part}`, template: template, templateMaker: templateMaker }));
2378
+ }
2379
+ /** renders a `ResponsivePrayerLine` as an `ldf-string` */
2380
+ stringNode(line, index$1, part) {
2381
+ return (index.h("ldf-string", { citation: { label: this.obj.label }, id: `${this.obj.uid}-${index$1}-${part}`, text: line[part], dropcap: index$1 == 0 ? "enabled" : "disabled", fragment: this.path }));
2382
+ }
2383
+ // Render the `response` in a litany, and handle `[Silence]` value
2384
+ litanyResponseStringNode(line, index$1) {
2385
+ const text = line.response || this.obj.metadata.response;
2386
+ if (text == '[Silence]') {
2387
+ return (index.h("span", { class: 'rubric' }, index.h("br", null), "Silence"));
2388
+ }
2389
+ else {
2390
+ return (index.h("span", { class: 'response' }, index.h("ldf-string", { citation: { label: this.obj.label }, id: `${this.obj.uid}-${index$1}-response`, text: text, fragment: this.path })));
2391
+ }
2392
+ }
2393
+ editableHeader() {
2394
+ var _a, _b, _c, _d, _e, _f, _g, _h;
2395
+ return index.h("ldf-label-bar", null, index.h("h3", { slot: "start", class: "editable-label" }, index.h("ldf-editable-text", { id: "label", text: (_a = this.obj) === null || _a === void 0 ? void 0 : _a.label, path: `${this.path}/label`, placeholder: (_b = this.localeStrings) === null || _b === void 0 ? void 0 : _b.label })), index.h("ldf-editable-text", { slot: "end", id: "source-source", text: (_d = (_c = this.obj) === null || _c === void 0 ? void 0 : _c.source) === null || _d === void 0 ? void 0 : _d.source, path: `${this.path}/source/source`, placeholder: (_e = this.localeStrings) === null || _e === void 0 ? void 0 : _e.source }), index.h("ldf-editable-text", { slot: "end", id: "source-citation", text: (_g = (_f = this.obj) === null || _f === void 0 ? void 0 : _f.source) === null || _g === void 0 ? void 0 : _g.citation, path: `${this.path}/source/citation`, placeholder: (_h = this.localeStrings) === null || _h === void 0 ? void 0 : _h.citation }));
2396
+ }
2397
+ // Render
2398
+ render() {
2399
+ var _a, _b, _c, _d, _e;
2400
+ const needsHeader = ((_a = this.obj) === null || _a === void 0 ? void 0 : _a.label) || ((_b = this.obj) === null || _b === void 0 ? void 0 : _b.citation) || ((_c = this.obj) === null || _c === void 0 ? void 0 : _c.source);
2401
+ if (this.obj.style == 'preces') {
2402
+ /* `preces` type returns a table like
2403
+ * V. O Lord, open our lips.
2404
+ * R. And our mouth shall proclaim thy praise. */
2405
+ const template = { label: '', text: '' }, templateMaker = (text) => ({ label: '', text });
2406
+ return (index.h(index.Host, { class: this.obj.style, lang: this.obj.language }, index.h("ldf-label-bar", null, index.h("slot", { slot: 'end', name: 'controls' })), !this.editable && needsHeader && index.h("ldf-heading", { doc: new heading$1.Heading({ type: 'heading', metadata: { level: 3 }, value: [this.obj.label], citation: this.obj.citation, source: this.obj.source }) }), this.editable && needsHeader && this.editableHeader(), index.h("table", { class: "preces" }, this.obj.value.map((line, index$1) => index.h("tr", { class: "row" }, index.h("td", { class: "cell" }, this.editable ? this.editableNode(line, index$1, 'label', template, templateMaker) : this.stringNode(line, index$1, 'label')), index.h("td", { class: index$1 % 2 == 0 ? 'cell' : 'cell response' }, this.editable ? this.editableNode(line, index$1, 'text', template, templateMaker) : this.stringNode(line, index$1, 'text')))))));
2407
+ }
2408
+ else if (this.obj.style == 'litany') {
2409
+ /* `litany`type returns prayers and responses with a break between each pair, like
2410
+ * That this evening may be holy, good, and peaceful,
2411
+ * We entreat you, O Lord.
2412
+ *
2413
+ * That your holy angels may lead us in paths of peace and goodwill,
2414
+ * We entreat you, O Lord. */
2415
+ const template = { text: '', response: ((_d = this.obj.metadata) === null || _d === void 0 ? void 0 : _d.response) || '' }, templateMaker = (text) => { var _a; return ({ text, response: ((_a = this.obj.metadata) === null || _a === void 0 ? void 0 : _a.response) || '' }); };
2416
+ return (index.h(index.Host, { class: this.obj.style, lang: this.obj.language }, this.editable && index.h("ldf-label-bar", null, index.h("slot", { slot: 'end', name: 'controls' })), !this.editable && needsHeader && index.h("ldf-heading", { doc: new heading$1.Heading({ type: 'heading', metadata: { level: 3 }, value: [this.obj.label], citation: this.obj.citation, source: this.obj.source }) }), this.editable && needsHeader && this.editableHeader(), this.obj.value.map((line, index$1) => {
2417
+ var _a, _b;
2418
+ // Classes depending on style and whether this line is optional
2419
+ let classes = new Array('litany');
2420
+ if (line.optional) {
2421
+ classes.push('optional');
2422
+ }
2423
+ // Render the line
2424
+ return index.h("div", { class: { "line": true, "editable": this.editable } }, index.h("p", { class: classes.join(' ') }, this.editable
2425
+ ? this.editableNode(line, index$1, 'text', template, templateMaker)
2426
+ : this.stringNode(line, index$1, 'text'), line.response && (this.editable ?
2427
+ index.h("span", { class: 'response' }, this.editableNode(line, index$1, 'response', template, templateMaker)) :
2428
+ [index.h("br", null), this.litanyResponseStringNode(line, index$1)]), (!line.response && ((_a = this.obj.metadata) === null || _a === void 0 ? void 0 : _a.response)) && (this.editable ?
2429
+ index.h("span", { class: 'response' }, index.h("ldf-editable-text", { id: `${this.obj.uid}-${index$1}-response`, text: this.obj.metadata.response, path: `${this.path}/response` })) :
2430
+ [index.h("br", null), this.litanyResponseStringNode(line, index$1)])), this.editable && index.h("label", { class: "optional-label", htmlFor: `optional-${index$1}` }, (_b = this.localeStrings) === null || _b === void 0 ? void 0 : _b.optional), this.editable && index.h("ldf-editable-boolean", { id: `optional-${index$1}`, slot: "start", path: `${this.path}/value/${index$1}/optional`, value: line.optional }));
2431
+ })));
2432
+ }
2433
+ else {
2434
+ /* `responsive` type returns alternating lines like
2435
+ * Lord, hear our prayer.
2436
+ * And let our cry come to you.
2437
+ * Let us pray. */
2438
+ const template = { text: '', response: ((_e = this.obj.metadata) === null || _e === void 0 ? void 0 : _e.response) || '' }, templateMaker = (text) => { var _a; return ({ text, response: ((_a = this.obj.metadata) === null || _a === void 0 ? void 0 : _a.response) || '' }); };
2439
+ return (index.h(index.Host, { class: this.obj.style, lang: this.obj.language }, !this.editableHeader && needsHeader && index.h("ldf-heading", { doc: new heading$1.Heading({ type: 'heading', metadata: { level: 3 }, value: [this.obj.label], citation: this.obj.citation, source: this.obj.source }) }), this.editable && needsHeader && this.editableHeader(), index.h("p", { class: 'responsive' }, this.obj.value.map((line, index$1) => [
2440
+ this.editable ?
2441
+ index.h("div", null, this.editableNode(line, index$1, 'text', template, templateMaker)) :
2442
+ index.h("div", null, this.stringNode(line, index$1, 'text')),
2443
+ this.editable ?
2444
+ index.h("div", { class: 'response' }, this.editableNode(line, index$1, 'response', template, templateMaker)) :
2445
+ index.h("div", { class: 'response' }, this.stringNode(line, index$1, 'response'))
2446
+ ]))));
2447
+ }
2448
+ }
2449
+ get element() { return index.getElement(this); }
2450
+ static get watchers() { return {
2451
+ "doc": ["docChanged"]
2452
+ }; }
2453
+ };
2454
+ ResponsivePrayerComponent.style = responsivePrayerCss;
2455
+
2456
+ const rubricCss = ".sc-ldf-rubric-h{font-family:var(--ldf-font-face);color:var(--ldf-rubric-color);font-style:var(--ldf-rubric-font-style);font-weight:var(--ldf-rubric-font-weight);font-size:var(--ldf-rubric-font-size);text-align:var(--ldf-text-align);text-justify:inter-character}";
2457
+
2458
+ const RubricComponent = class {
2459
+ constructor(hostRef) {
2460
+ index.registerInstance(this, hostRef);
2461
+ }
2462
+ docChanged(newDoc) {
2463
+ try {
2464
+ if (typeof newDoc == 'string') {
2465
+ this.obj = new rubric.Rubric(JSON.parse(newDoc));
2466
+ }
2467
+ else {
2468
+ this.obj = new rubric.Rubric(newDoc);
2469
+ }
2470
+ }
2471
+ catch (e) {
2472
+ console.warn(e);
2473
+ this.obj = new rubric.Rubric();
2474
+ }
2475
+ }
2476
+ // Lifecycle events
2477
+ componentWillLoad() {
2478
+ this.docChanged(this.doc);
2479
+ }
2480
+ // Render
2481
+ render() {
2482
+ return (index.h(index.Host, { lang: this.obj.language }, this.editable && index.h("ldf-label-bar", null, index.h("slot", { slot: 'end', name: 'controls' })), this.obj.value.map((para, ii) => this.editable ?
2483
+ index.h("ldf-editable-text", { id: `${this.obj.uid || this.obj.slug}-${ii}`, text: para, path: `${this.path}/value/${ii}` }) :
2484
+ index.h("p", { id: `${this.obj.uid || this.obj.slug}-${ii}`, class: 'rubric' }, para))));
2485
+ }
2486
+ static get watchers() { return {
2487
+ "doc": ["docChanged"]
2488
+ }; }
2489
+ };
2490
+ RubricComponent.style = rubricCss;
2491
+
2492
+ exports.ion_segment = Segment;
2493
+ exports.ion_segment_button = SegmentButton;
2494
+ exports.ion_skeleton_text = SkeletonText;
2495
+ exports.ldf_bible_reading = BibleReadingComponent;
2496
+ exports.ldf_editable_add_block = EditableAddBlockComponent;
2497
+ exports.ldf_editable_metadata_buttons = EditableMetadataButtonsComponent;
2498
+ exports.ldf_editable_select = EditableSelectComponent;
2499
+ exports.ldf_image = ImageComponent;
2500
+ exports.ldf_liturgical_document = LiturgicalDocumentComponent;
2501
+ exports.ldf_liturgy = LiturgyComponent;
2502
+ exports.ldf_meditation = MeditationComponent;
2503
+ exports.ldf_option = OptionComponent;
2504
+ exports.ldf_psalm = PsalmComponent;
2505
+ exports.ldf_refrain = RefrainComponent;
2506
+ exports.ldf_responsive_prayer = ResponsivePrayerComponent;
2507
+ exports.ldf_rubric = RubricComponent;