@nyaruka/temba-components 0.58.1 → 0.58.8

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 (214) hide show
  1. package/.devcontainer/Dockerfile +14 -0
  2. package/.devcontainer/devcontainer.json +17 -0
  3. package/.dockerignore +1 -0
  4. package/.github/workflows/build.yml +16 -14
  5. package/.github/workflows/publish.yml +9 -9
  6. package/.yarnrc +1 -0
  7. package/.yarnrc.yml +5 -0
  8. package/CHANGELOG.md +51 -0
  9. package/README.md +0 -8
  10. package/dist/{5f784089.js → 82b805ce.js} +36 -6
  11. package/dist/index.js +36 -6
  12. package/dist/static/svg/index.svg +1 -1
  13. package/dist/sw.js +1 -1
  14. package/dist/sw.js.map +1 -1
  15. package/dist/templates/components-body.html +1 -1
  16. package/dist/templates/components-head.html +1 -1
  17. package/out-tsc/src/FormElement.js.map +1 -1
  18. package/out-tsc/src/contacts/events.js +39 -1
  19. package/out-tsc/src/contacts/events.js.map +1 -1
  20. package/out-tsc/src/fields/FieldManager.js +3 -1
  21. package/out-tsc/src/fields/FieldManager.js.map +1 -1
  22. package/out-tsc/src/store/Store.js +3 -0
  23. package/out-tsc/src/store/Store.js.map +1 -1
  24. package/out-tsc/src/vectoricon/index.js +3 -1
  25. package/out-tsc/src/vectoricon/index.js.map +1 -1
  26. package/out-tsc/test/temba-contact-details.test.js +1 -1
  27. package/out-tsc/test/temba-contact-details.test.js.map +1 -1
  28. package/out-tsc/test/temba-contact-history.test.js +1 -1
  29. package/out-tsc/test/temba-contact-history.test.js.map +1 -1
  30. package/out-tsc/test/utils.test.js.map +1 -1
  31. package/package.json +4 -5
  32. package/screenshots/truth/alert/error.png +0 -0
  33. package/screenshots/truth/alert/info.png +0 -0
  34. package/screenshots/truth/alert/warning.png +0 -0
  35. package/screenshots/truth/checkbox/checkbox-label-background-hover.png +0 -0
  36. package/screenshots/truth/checkbox/checkbox-no-label-no-background-hover.png +0 -0
  37. package/screenshots/truth/checkbox/checkbox-whitespace-label-no-background-hover.png +0 -0
  38. package/screenshots/truth/checkbox/checked.png +0 -0
  39. package/screenshots/truth/checkbox/default.png +0 -0
  40. package/screenshots/truth/colorpicker/default.png +0 -0
  41. package/screenshots/truth/colorpicker/focused.png +0 -0
  42. package/screenshots/truth/colorpicker/initialized.png +0 -0
  43. package/screenshots/truth/colorpicker/selected.png +0 -0
  44. package/screenshots/truth/compose/attachments-and-send-button.png +0 -0
  45. package/screenshots/truth/compose/attachments-no-send-button.png +0 -0
  46. package/screenshots/truth/compose/attachments-with-all-files-and-click-send.png +0 -0
  47. package/screenshots/truth/compose/attachments-with-all-files.png +0 -0
  48. package/screenshots/truth/compose/attachments-with-failure-files.png +0 -0
  49. package/screenshots/truth/compose/attachments-with-success-files-and-click-send.png +0 -0
  50. package/screenshots/truth/compose/attachments-with-success-files.png +0 -0
  51. package/screenshots/truth/compose/chatbox-attachments-counter-and-send-button.png +0 -0
  52. package/screenshots/truth/compose/chatbox-attachments-counter-no-send-button.png +0 -0
  53. package/screenshots/truth/compose/chatbox-attachments-no-counter-and-send-button.png +0 -0
  54. package/screenshots/truth/compose/chatbox-attachments-no-counter-no-send-button.png +0 -0
  55. package/screenshots/truth/compose/chatbox-counter-and-send-button.png +0 -0
  56. package/screenshots/truth/compose/chatbox-counter-no-send-button.png +0 -0
  57. package/screenshots/truth/compose/chatbox-no-counter-and-send-button.png +0 -0
  58. package/screenshots/truth/compose/chatbox-no-counter-no-send-button.png +0 -0
  59. package/screenshots/truth/compose/chatbox-no-text-attachments-with-all-files-and-click-send.png +0 -0
  60. package/screenshots/truth/compose/chatbox-no-text-attachments-with-all-files.png +0 -0
  61. package/screenshots/truth/compose/chatbox-no-text-attachments-with-failure-files.png +0 -0
  62. package/screenshots/truth/compose/chatbox-no-text-attachments-with-success-files-and-click-send.png +0 -0
  63. package/screenshots/truth/compose/chatbox-no-text-attachments-with-success-files.png +0 -0
  64. package/screenshots/truth/compose/chatbox-with-text-and-click-send.png +0 -0
  65. package/screenshots/truth/compose/chatbox-with-text-and-hit-enter.png +0 -0
  66. package/screenshots/truth/compose/chatbox-with-text-and-spaces.png +0 -0
  67. package/screenshots/truth/compose/chatbox-with-text-and-url.png +0 -0
  68. package/screenshots/truth/compose/chatbox-with-text-attachments-no-files-and-click-send.png +0 -0
  69. package/screenshots/truth/compose/chatbox-with-text-attachments-no-files-and-hit-enter.png +0 -0
  70. package/screenshots/truth/compose/chatbox-with-text-attachments-no-files.png +0 -0
  71. package/screenshots/truth/compose/chatbox-with-text-attachments-with-all-files-and-click-send.png +0 -0
  72. package/screenshots/truth/compose/chatbox-with-text-attachments-with-all-files-and-hit-enter.png +0 -0
  73. package/screenshots/truth/compose/chatbox-with-text-attachments-with-all-files.png +0 -0
  74. package/screenshots/truth/compose/chatbox-with-text-attachments-with-failure-files.png +0 -0
  75. package/screenshots/truth/compose/chatbox-with-text-attachments-with-success-files-and-click-send.png +0 -0
  76. package/screenshots/truth/compose/chatbox-with-text-attachments-with-success-files-and-hit-enter.png +0 -0
  77. package/screenshots/truth/compose/chatbox-with-text-attachments-with-success-files.png +0 -0
  78. package/screenshots/truth/compose/chatbox-with-text-no-spaces.png +0 -0
  79. package/screenshots/truth/compose/chatbox-with-text.png +0 -0
  80. package/screenshots/truth/contacts/badges.png +0 -0
  81. package/screenshots/truth/contacts/compose-attachments-no-text-failure.png +0 -0
  82. package/screenshots/truth/contacts/compose-attachments-no-text-success.png +0 -0
  83. package/screenshots/truth/contacts/compose-text-and-attachments-failure-attachments.png +0 -0
  84. package/screenshots/truth/contacts/compose-text-and-attachments-failure-generic.png +0 -0
  85. package/screenshots/truth/contacts/compose-text-and-attachments-failure-text-and-attachments.png +0 -0
  86. package/screenshots/truth/contacts/compose-text-and-attachments-failure-text.png +0 -0
  87. package/screenshots/truth/contacts/compose-text-and-attachments-success.png +0 -0
  88. package/screenshots/truth/contacts/compose-text-no-attachments-failure.png +0 -0
  89. package/screenshots/truth/contacts/compose-text-no-attachments-success.png +0 -0
  90. package/screenshots/truth/contacts/contact-active-default.png +0 -0
  91. package/screenshots/truth/contacts/contact-active-show-chatbox.png +0 -0
  92. package/screenshots/truth/contacts/contact-archived-hide-chatbox.png +0 -0
  93. package/screenshots/truth/contacts/contact-blocked-hide-chatbox.png +0 -0
  94. package/screenshots/truth/contacts/contact-stopped-hide-chatbox.png +0 -0
  95. package/screenshots/truth/contacts/details.png +0 -0
  96. package/screenshots/truth/contacts/fields-updated.png +0 -0
  97. package/screenshots/truth/contacts/fields.png +0 -0
  98. package/screenshots/truth/contacts/history.png +0 -0
  99. package/screenshots/truth/contacts/tickets-assignment.png +0 -0
  100. package/screenshots/truth/contacts/tickets.png +0 -0
  101. package/screenshots/truth/content-menu/button-no-items.png +0 -0
  102. package/screenshots/truth/content-menu/item-no-buttons.png +0 -0
  103. package/screenshots/truth/content-menu/items-and-buttons.png +0 -0
  104. package/screenshots/truth/counter/summary.png +0 -0
  105. package/screenshots/truth/counter/text.png +0 -0
  106. package/screenshots/truth/counter/unicode-variables.png +0 -0
  107. package/screenshots/truth/counter/unicode.png +0 -0
  108. package/screenshots/truth/counter/variable.png +0 -0
  109. package/screenshots/truth/date/date.png +0 -0
  110. package/screenshots/truth/date/datetime.png +0 -0
  111. package/screenshots/truth/date/duration.png +0 -0
  112. package/screenshots/truth/datepicker/date-truncated-time.png +0 -0
  113. package/screenshots/truth/datepicker/date.png +0 -0
  114. package/screenshots/truth/datepicker/datetime.png +0 -0
  115. package/screenshots/truth/datepicker/initial-timezone.png +0 -0
  116. package/screenshots/truth/datepicker/initial-value.png +0 -0
  117. package/screenshots/truth/datepicker/updated-keyboard-date.png +0 -0
  118. package/screenshots/truth/datepicker/updated-keyboard.png +0 -0
  119. package/screenshots/truth/dialog/focused.png +0 -0
  120. package/screenshots/truth/label/custom.png +0 -0
  121. package/screenshots/truth/label/danger.png +0 -0
  122. package/screenshots/truth/label/dark.png +0 -0
  123. package/screenshots/truth/label/default-icon.png +0 -0
  124. package/screenshots/truth/label/no-icon.png +0 -0
  125. package/screenshots/truth/label/primary.png +0 -0
  126. package/screenshots/truth/label/secondary.png +0 -0
  127. package/screenshots/truth/label/shadow.png +0 -0
  128. package/screenshots/truth/label/tertiary.png +0 -0
  129. package/screenshots/truth/lightbox/img-zoomed.png +0 -0
  130. package/screenshots/truth/lightbox/img.png +0 -0
  131. package/screenshots/truth/list/fields-dragging.png +0 -0
  132. package/screenshots/truth/list/fields-filtered.png +0 -0
  133. package/screenshots/truth/list/fields-hovered.png +0 -0
  134. package/screenshots/truth/list/fields.png +0 -0
  135. package/screenshots/truth/list/items-selected.png +0 -0
  136. package/screenshots/truth/list/items-updated.png +0 -0
  137. package/screenshots/truth/list/items.png +0 -0
  138. package/screenshots/truth/list/sortable-dragging.png +0 -0
  139. package/screenshots/truth/list/sortable-dropped.png +0 -0
  140. package/screenshots/truth/list/sortable.png +0 -0
  141. package/screenshots/truth/menu/menu-focused-with items.png +0 -0
  142. package/screenshots/truth/menu/menu-refresh-1.png +0 -0
  143. package/screenshots/truth/menu/menu-refresh-2.png +0 -0
  144. package/screenshots/truth/menu/menu-root.png +0 -0
  145. package/screenshots/truth/menu/menu-submenu.png +0 -0
  146. package/screenshots/truth/menu/menu-tasks-nextup.png +0 -0
  147. package/screenshots/truth/menu/menu-tasks.png +0 -0
  148. package/screenshots/truth/modax/form.png +0 -0
  149. package/screenshots/truth/modax/simple.png +0 -0
  150. package/screenshots/truth/options/block.png +0 -0
  151. package/screenshots/truth/select/disabled-multi-selection.png +0 -0
  152. package/screenshots/truth/select/disabled-selection.png +0 -0
  153. package/screenshots/truth/select/disabled.png +0 -0
  154. package/screenshots/truth/select/embedded.png +0 -0
  155. package/screenshots/truth/select/expression-selected.png +0 -0
  156. package/screenshots/truth/select/expressions.png +0 -0
  157. package/screenshots/truth/select/functions.png +0 -0
  158. package/screenshots/truth/select/local-options.png +0 -0
  159. package/screenshots/truth/select/remote-options.png +0 -0
  160. package/screenshots/truth/select/search-enabled.png +0 -0
  161. package/screenshots/truth/select/search-multi-no-matches.png +0 -0
  162. package/screenshots/truth/select/search-selected-focus.png +0 -0
  163. package/screenshots/truth/select/search-selected.png +0 -0
  164. package/screenshots/truth/select/search-with-selected.png +0 -0
  165. package/screenshots/truth/select/searching.png +0 -0
  166. package/screenshots/truth/select/selected-multi.png +0 -0
  167. package/screenshots/truth/select/selected-single.png +0 -0
  168. package/screenshots/truth/select/selection-clearable.png +0 -0
  169. package/screenshots/truth/select/truncated-selection.png +0 -0
  170. package/screenshots/truth/select/with-placeholder.png +0 -0
  171. package/screenshots/truth/select/without-placeholder.png +0 -0
  172. package/screenshots/truth/slider/custom-min-custom-max-valid-value.png +0 -0
  173. package/screenshots/truth/slider/custom-min-default-max-no-value.png +0 -0
  174. package/screenshots/truth/slider/default-min-custom-max-no-value.png +0 -0
  175. package/screenshots/truth/slider/default-min-default-max-invalid-value.png +0 -0
  176. package/screenshots/truth/slider/default-min-default-max-valid-value.png +0 -0
  177. package/screenshots/truth/slider/default.png +0 -0
  178. package/screenshots/truth/slider/no-visible-range-invalid-value.png +0 -0
  179. package/screenshots/truth/slider/no-visible-range-no-value.png +0 -0
  180. package/screenshots/truth/slider/no-visible-range-valid-value.png +0 -0
  181. package/screenshots/truth/slider/update-slider-on-circle-dragged.png +0 -0
  182. package/screenshots/truth/slider/update-slider-on-track-clicked.png +0 -0
  183. package/screenshots/truth/slider/update-slider-on-value-change.png +0 -0
  184. package/screenshots/truth/textinput/input-disabled.png +0 -0
  185. package/screenshots/truth/textinput/input-focused.png +0 -0
  186. package/screenshots/truth/textinput/input-form.png +0 -0
  187. package/screenshots/truth/textinput/input-inserted.png +0 -0
  188. package/screenshots/truth/textinput/input-placeholder.png +0 -0
  189. package/screenshots/truth/textinput/input-updated.png +0 -0
  190. package/screenshots/truth/textinput/input.png +0 -0
  191. package/screenshots/truth/textinput/textarea-focused.png +0 -0
  192. package/screenshots/truth/textinput/textarea.png +0 -0
  193. package/screenshots/truth/tip/bottom.png +0 -0
  194. package/screenshots/truth/tip/left.png +0 -0
  195. package/screenshots/truth/tip/right.png +0 -0
  196. package/screenshots/truth/tip/top.png +0 -0
  197. package/src/FormElement.ts +0 -1
  198. package/src/contacts/events.ts +38 -1
  199. package/src/fields/FieldManager.ts +3 -1
  200. package/src/store/Store.ts +4 -0
  201. package/src/vectoricon/index.ts +3 -1
  202. package/static/css/temba-components.css +41 -41
  203. package/static/svg/index.svg +1 -1
  204. package/static/svg/work/traced/dots-grid.svg +1 -0
  205. package/static/svg/work/traced/layers-three-01.svg +1 -0
  206. package/static/svg/work/used/dots-grid.svg +11 -0
  207. package/static/svg/work/used/layers-three-01.svg +3 -0
  208. package/test/temba-contact-details.test.ts +2 -1
  209. package/test/temba-contact-history.test.ts +1 -1
  210. package/test/utils.test.ts +1 -0
  211. package/test-assets/style.css +53 -33
  212. package/web-test-runner.config.mjs +21 -17
  213. package/screenshots/truth/contact-search/manual-search.png +0 -0
  214. package/screenshots/truth/contact-search/missing-group.png +0 -0
@@ -0,0 +1,14 @@
1
+ FROM "mcr.microsoft.com/devcontainers/typescript-node:1-16-bullseye"
2
+
3
+ RUN apt-get update \
4
+ && apt-get install chromium fonts-noto-color-emoji -y --no-install-recommends -qq
5
+
6
+ # The rest of our environment
7
+ ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
8
+ ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
9
+ ENV CHROME_PATH=/usr/bin/chromium
10
+ ENV DEBIAN_FRONTEND=noninteractive
11
+
12
+ WORKDIR /workspaces/temba-components
13
+ RUN yarn install
14
+ USER node
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "temba-components",
3
+ "build": {
4
+ "dockerfile": "Dockerfile"
5
+ },
6
+ "forwardPorts": [
7
+ 3010
8
+ ],
9
+ "runArgs": [
10
+ "--network=textit_default",
11
+ "--hostname=temba-components"
12
+ ],
13
+ "remoteUser": "node",
14
+ "postCreateCommand": "sudo chown -R node /workspaces/temba-components/static/svg && sudo chown node /workspaces/temba-components && sudo chown node /workspaces/temba-components/screenshots && yarn install"
15
+ // "features": {},
16
+ // "customizations": {},
17
+ }
package/.dockerignore ADDED
@@ -0,0 +1 @@
1
+ node_modules
@@ -1,27 +1,29 @@
1
- name: Build
1
+ name: 'build'
2
2
 
3
3
  on: [push]
4
4
 
5
5
  jobs:
6
- bulid:
7
- runs-on: macOS-11
6
+ build:
7
+ runs-on: ubuntu-latest
8
8
  steps:
9
- - uses: actions/checkout@v1
10
- - uses: actions/setup-node@v3
9
+ - name: Checkout (GitHub)
10
+ uses: actions/checkout@v3
11
+ - run: docker network create --driver bridge textit_default
12
+ - name: Build and run dev container task
13
+ uses: devcontainers/ci@v0.3
11
14
  with:
12
- node-version: 16
13
- - name: Screenshot Tests
14
- run: |
15
- yarn install
16
- yarn test
17
- yarn build
18
- env:
19
- CI: true
20
- - uses: actions/upload-artifact@v2
15
+ runCmd: yarn test
16
+ push: never
17
+ env: |
18
+ CI=true
19
+
20
+ - name: Upload artifacts
21
21
  if: failure()
22
+ uses: actions/upload-artifact@v3
22
23
  with:
23
24
  name: screenshots
24
25
  path: screenshots/
26
+
25
27
  - name: Upload coverage to Codecov
26
28
  uses: codecov/codecov-action@v3
27
29
  with:
@@ -10,16 +10,16 @@ jobs:
10
10
  runs-on: ubuntu-latest
11
11
 
12
12
  steps:
13
- - uses: actions/checkout@v1
14
- - uses: actions/setup-node@v3
13
+ - name: Checkout (GitHub)
14
+ uses: actions/checkout@v3
15
+ - run: docker network create --driver bridge textit_default
16
+ - name: Build and run dev container task
17
+ uses: devcontainers/ci@v0.3
15
18
  with:
16
- node-version: 16
17
- - name: Build and Test
18
- run: |
19
- yarn install
20
- yarn run build
21
- env:
22
- CI: true
19
+ runCmd: yarn run build
20
+ push: never
21
+ env: |
22
+ CI=true
23
23
  - name: Publish
24
24
  run: |
25
25
  npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
package/.yarnrc CHANGED
@@ -3,3 +3,4 @@
3
3
 
4
4
 
5
5
  # yarn-path ".yarn/releases/yarn-1.22.10.cjs"
6
+ # --install.modules-folder "./linux/node_modules"
package/.yarnrc.yml CHANGED
@@ -1 +1,6 @@
1
1
  nodeLinker: node-modules
2
+ supportedArchitectures:
3
+ os:
4
+ - "current"
5
+ - "darwin"
6
+ - "linux"
package/CHANGELOG.md CHANGED
@@ -4,8 +4,59 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
+ #### [v0.58.8](https://github.com/nyaruka/temba-components/compare/v0.58.7...v0.58.8)
8
+
9
+ - Update publish.yml [`7dc7d69`](https://github.com/nyaruka/temba-components/commit/7dc7d69822942b39c3b35e06846cfd4c65108b2d)
10
+
11
+ #### [v0.58.7](https://github.com/nyaruka/temba-components/compare/v0.58.6...v0.58.7)
12
+
13
+ > 28 September 2023
14
+
15
+ #### [v0.58.6](https://github.com/nyaruka/temba-components/compare/v0.58.5...v0.58.6)
16
+
17
+ > 28 September 2023
18
+
19
+ - Support rendering optin request [`#359`](https://github.com/nyaruka/temba-components/pull/359)
20
+ - Update screenshots [`#361`](https://github.com/nyaruka/temba-components/pull/361)
21
+ - Adjust styles [`cf34f3f`](https://github.com/nyaruka/temba-components/commit/cf34f3f69439c63554ebec5fdff2fb7ecaf22158)
22
+ - Update build.yml [`94587ec`](https://github.com/nyaruka/temba-components/commit/94587ec8e55c022665cedb1b32348015d9e5d4e6)
23
+ - Fix build [`67e8cd6`](https://github.com/nyaruka/temba-components/commit/67e8cd69ba8a1ac70176e333d0088d855185720d)
24
+
25
+ #### [v0.58.5](https://github.com/nyaruka/temba-components/compare/v0.58.4...v0.58.5)
26
+
27
+ > 6 September 2023
28
+
29
+ - Update more permissions [`d4ed2b7`](https://github.com/nyaruka/temba-components/commit/d4ed2b7e405f3b5e93bafffb051b12ab79e134ad)
30
+
31
+ #### [v0.58.4](https://github.com/nyaruka/temba-components/compare/v0.58.3...v0.58.4)
32
+
33
+ > 6 September 2023
34
+
35
+ - Update permissions [`7781290`](https://github.com/nyaruka/temba-components/commit/7781290466aa04c2127cc118317f39d0d6403b75)
36
+
37
+ #### [v0.58.3](https://github.com/nyaruka/temba-components/compare/v0.58.2...v0.58.3)
38
+
39
+ > 5 September 2023
40
+
41
+ - Fix build permissions [`#358`](https://github.com/nyaruka/temba-components/pull/358)
42
+ - Fix build [`799de81`](https://github.com/nyaruka/temba-components/commit/799de8179f8fcb2cd83bc7605b82483c60bccb21)
43
+ - Move yarn install [`5f90a54`](https://github.com/nyaruka/temba-components/commit/5f90a546ee08cf1df90a0291e99ab4b8c019c413)
44
+ - Set user for docker [`ce9e765`](https://github.com/nyaruka/temba-components/commit/ce9e76566c70bbf36123548e85445f07e4619ddc)
45
+
46
+ #### [v0.58.2](https://github.com/nyaruka/temba-components/compare/v0.58.1...v0.58.2)
47
+
48
+ > 5 September 2023
49
+
50
+ - Update publish action [`#357`](https://github.com/nyaruka/temba-components/pull/357)
51
+ - Try local tests with docker [`#356`](https://github.com/nyaruka/temba-components/pull/356)
52
+ - Dev container [`4664912`](https://github.com/nyaruka/temba-components/commit/46649124e3de86e64432f714c437713e8bff3ae1)
53
+ - Updated screenshots [`e3439c8`](https://github.com/nyaruka/temba-components/commit/e3439c8de26162830f0ff3daa1319036b7255309)
54
+ - Add codecov [`3445f07`](https://github.com/nyaruka/temba-components/commit/3445f07afd1f7c60fd26da430091a56992165a1a)
55
+
7
56
  #### [v0.58.1](https://github.com/nyaruka/temba-components/compare/v0.58.0...v0.58.1)
8
57
 
58
+ > 4 August 2023
59
+
9
60
  - Truncate labels to max-width [`#355`](https://github.com/nyaruka/temba-components/pull/355)
10
61
 
11
62
  #### [v0.58.0](https://github.com/nyaruka/temba-components/compare/v0.57.1...v0.58.0)
package/README.md CHANGED
@@ -72,11 +72,3 @@ To interactively work with components whilst embedded in another project, it can
72
72
  proxy_pass http://localhost:3010/node_modules/$1;
73
73
  }
74
74
  ```
75
-
76
- ## Storybook
77
-
78
- We've added the framework for storybook, but nothing to see here yet!
79
-
80
- ## Legacy Browser Support
81
-
82
- Starting with v1.0 we no longer ship a version with legacy polyfill support. This can still be accomplished manually if desired by toggling the `legacyBuild` attribute in [rollup.config.js](/rollup.config.js#L11).
@@ -1,4 +1,4 @@
1
- function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(r=(s<3?o(r):s>3?o(e,i,r):o(e,i))||r);return s>3&&r&&Object.defineProperty(e,i,r),r}const e=window,i=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,n=Symbol(),o=new WeakMap;class s{constructor(t,e,i){if(this._$cssResult$=!0,i!==n)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(i&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=o.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&o.set(e,t))}return t}toString(){return this.cssText}}const r=(t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,i,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[n+1]),t[0]);return new s(i,t,n)},a=i?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new s("string"==typeof t?t:t+"",void 0,n))(e)})(t):t;var l;const h=window,c=h.trustedTypes,d=c?c.emptyScript:"",u=h.reactiveElementPolyfillSupport,p={toAttribute(t,e){switch(e){case Boolean:t=t?d:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},m=(t,e)=>e!==t&&(e==e||t==t),f={attribute:!0,type:String,converter:p,reflect:!1,hasChanged:m};class g extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(t){var e;this.finalize(),(null!==(e=this.h)&&void 0!==e?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,i)=>{const n=this._$Ep(i,e);void 0!==n&&(this._$Ev.set(n,i),t.push(n))})),t}static createProperty(t,e=f){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const i="symbol"==typeof t?Symbol():"__"+t,n=this.getPropertyDescriptor(t,i,e);void 0!==n&&Object.defineProperty(this.prototype,t,n)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(n){const o=this[t];this[e]=n,this.requestUpdate(t,o,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||f}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const i of e)this.createProperty(i,t[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(a(t))}else void 0!==t&&e.push(a(t));return e}static _$Ep(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}u(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,i;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(i=t.hostConnected)||void 0===i||i.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const n=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,n)=>{i?t.adoptedStyleSheets=n.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):n.forEach((i=>{const n=document.createElement("style"),o=e.litNonce;void 0!==o&&n.setAttribute("nonce",o),n.textContent=i.cssText,t.appendChild(n)}))})(n,this.constructor.elementStyles),n}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EO(t,e,i=f){var n;const o=this.constructor._$Ep(t,i);if(void 0!==o&&!0===i.reflect){const s=(void 0!==(null===(n=i.converter)||void 0===n?void 0:n.toAttribute)?i.converter:p).toAttribute(e,i.type);this._$El=t,null==s?this.removeAttribute(o):this.setAttribute(o,s),this._$El=null}}_$AK(t,e){var i;const n=this.constructor,o=n._$Ev.get(t);if(void 0!==o&&this._$El!==o){const t=n.getPropertyOptions(o),s="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(i=t.converter)||void 0===i?void 0:i.fromAttribute)?t.converter:p;this._$El=o,this[o]=s.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,i){let n=!0;void 0!==t&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||m)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,i))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,e)=>this[e]=t)),this._$Ei=void 0);let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(i)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;null===(e=this._$ES)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$EO(e,this[e],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}}var v;g.finalized=!0,g.elementProperties=new Map,g.elementStyles=[],g.shadowRootOptions={mode:"open"},null==u||u({ReactiveElement:g}),(null!==(l=h.reactiveElementVersions)&&void 0!==l?l:h.reactiveElementVersions=[]).push("1.5.0");const y=window,b=y.trustedTypes,_=b?b.createPolicy("lit-html",{createHTML:t=>t}):void 0,x=`lit$${(Math.random()+"").slice(9)}$`,w="?"+x,k=`<${w}>`,S=document,E=(t="")=>S.createComment(t),C=t=>null===t||"object"!=typeof t&&"function"!=typeof t,$=Array.isArray,T=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,A=/-->/g,M=/>/g,O=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),z=/'/g,P=/"/g,I=/^(?:script|style|textarea|title)$/i,D=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),N=Symbol.for("lit-noChange"),R=Symbol.for("lit-nothing"),B=new WeakMap,q=S.createTreeWalker(S,129,null,!1),U=(t,e)=>{const i=t.length-1,n=[];let o,s=2===e?"<svg>":"",r=T;for(let e=0;e<i;e++){const i=t[e];let a,l,h=-1,c=0;for(;c<i.length&&(r.lastIndex=c,l=r.exec(i),null!==l);)c=r.lastIndex,r===T?"!--"===l[1]?r=A:void 0!==l[1]?r=M:void 0!==l[2]?(I.test(l[2])&&(o=RegExp("</"+l[2],"g")),r=O):void 0!==l[3]&&(r=O):r===O?">"===l[0]?(r=null!=o?o:T,h=-1):void 0===l[1]?h=-2:(h=r.lastIndex-l[2].length,a=l[1],r=void 0===l[3]?O:'"'===l[3]?P:z):r===P||r===z?r=O:r===A||r===M?r=T:(r=O,o=void 0);const d=r===O&&t[e+1].startsWith("/>")?" ":"";s+=r===T?i+k:h>=0?(n.push(a),i.slice(0,h)+"$lit$"+i.slice(h)+x+d):i+x+(-2===h?(n.push(void 0),e):d)}const a=s+(t[i]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==_?_.createHTML(a):a,n]};class Z{constructor({strings:t,_$litType$:e},i){let n;this.parts=[];let o=0,s=0;const r=t.length-1,a=this.parts,[l,h]=U(t,e);if(this.el=Z.createElement(l,i),q.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(n=q.nextNode())&&a.length<r;){if(1===n.nodeType){if(n.hasAttributes()){const t=[];for(const e of n.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(x)){const i=h[s++];if(t.push(e),void 0!==i){const t=n.getAttribute(i.toLowerCase()+"$lit$").split(x),e=/([.?@])?(.*)/.exec(i);a.push({type:1,index:o,name:e[2],strings:t,ctor:"."===e[1]?W:"?"===e[1]?K:"@"===e[1]?Y:H})}else a.push({type:6,index:o})}for(const e of t)n.removeAttribute(e)}if(I.test(n.tagName)){const t=n.textContent.split(x),e=t.length-1;if(e>0){n.textContent=b?b.emptyScript:"";for(let i=0;i<e;i++)n.append(t[i],E()),q.nextNode(),a.push({type:2,index:++o});n.append(t[e],E())}}}else if(8===n.nodeType)if(n.data===w)a.push({type:2,index:o});else{let t=-1;for(;-1!==(t=n.data.indexOf(x,t+1));)a.push({type:7,index:o}),t+=x.length-1}o++}}static createElement(t,e){const i=S.createElement("template");return i.innerHTML=t,i}}function F(t,e,i=t,n){var o,s,r,a;if(e===N)return e;let l=void 0!==n?null===(o=i._$Co)||void 0===o?void 0:o[n]:i._$Cl;const h=C(e)?void 0:e._$litDirective$;return(null==l?void 0:l.constructor)!==h&&(null===(s=null==l?void 0:l._$AO)||void 0===s||s.call(l,!1),void 0===h?l=void 0:(l=new h(t),l._$AT(t,i,n)),void 0!==n?(null!==(r=(a=i)._$Co)&&void 0!==r?r:a._$Co=[])[n]=l:i._$Cl=l),void 0!==l&&(e=F(t,l._$AS(t,e.values),l,n)),e}class V{constructor(t,e){this.u=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}v(t){var e;const{el:{content:i},parts:n}=this._$AD,o=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:S).importNode(i,!0);q.currentNode=o;let s=q.nextNode(),r=0,a=0,l=n[0];for(;void 0!==l;){if(r===l.index){let e;2===l.type?e=new j(s,s.nextSibling,this,t):1===l.type?e=new l.ctor(s,l.name,l.strings,this,t):6===l.type&&(e=new J(s,this,t)),this.u.push(e),l=n[++a]}r!==(null==l?void 0:l.index)&&(s=q.nextNode(),r++)}return o}p(t){let e=0;for(const i of this.u)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class j{constructor(t,e,i,n){var o;this.type=2,this._$AH=R,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=n,this._$Cm=null===(o=null==n?void 0:n.isConnected)||void 0===o||o}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cm}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=F(this,t,e),C(t)?t===R||null==t||""===t?(this._$AH!==R&&this._$AR(),this._$AH=R):t!==this._$AH&&t!==N&&this.g(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>$(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.k(t):this.g(t)}O(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}g(t){this._$AH!==R&&C(this._$AH)?this._$AA.nextSibling.data=t:this.T(S.createTextNode(t)),this._$AH=t}$(t){var e;const{values:i,_$litType$:n}=t,o="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=Z.createElement(n.h,this.options)),n);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===o)this._$AH.p(i);else{const t=new V(o,this),e=t.v(this.options);t.p(i),this.T(e),this._$AH=t}}_$AC(t){let e=B.get(t.strings);return void 0===e&&B.set(t.strings,e=new Z(t)),e}k(t){$(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,n=0;for(const o of t)n===e.length?e.push(i=new j(this.O(E()),this.O(E()),this,this.options)):i=e[n],i._$AI(o),n++;n<e.length&&(this._$AR(i&&i._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){var i;for(null===(i=this._$AP)||void 0===i||i.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cm=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class H{constructor(t,e,i,n,o){this.type=1,this._$AH=R,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=o,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=R}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,n){const o=this.strings;let s=!1;if(void 0===o)t=F(this,t,e,0),s=!C(t)||t!==this._$AH&&t!==N,s&&(this._$AH=t);else{const n=t;let r,a;for(t=o[0],r=0;r<o.length-1;r++)a=F(this,n[i+r],e,r),a===N&&(a=this._$AH[r]),s||(s=!C(a)||a!==this._$AH[r]),a===R?t=R:t!==R&&(t+=(null!=a?a:"")+o[r+1]),this._$AH[r]=a}s&&!n&&this.j(t)}j(t){t===R?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class W extends H{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===R?void 0:t}}const G=b?b.emptyScript:"";class K extends H{constructor(){super(...arguments),this.type=4}j(t){t&&t!==R?this.element.setAttribute(this.name,G):this.element.removeAttribute(this.name)}}class Y extends H{constructor(t,e,i,n,o){super(t,e,i,n,o),this.type=5}_$AI(t,e=this){var i;if((t=null!==(i=F(this,t,e,0))&&void 0!==i?i:R)===N)return;const n=this._$AH,o=t===R&&n!==R||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,s=t!==R&&(n===R||o);o&&this.element.removeEventListener(this.name,this,n),s&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==i?i:this.element,t):this._$AH.handleEvent(t)}}class J{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){F(this,t)}}const X=y.litHtmlPolyfillSupport;null==X||X(Z,j),(null!==(v=y.litHtmlVersions)&&void 0!==v?v:y.litHtmlVersions=[]).push("2.5.0");var Q,tt;class et extends g{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,i)=>{var n,o;const s=null!==(n=null==i?void 0:i.renderBefore)&&void 0!==n?n:e;let r=s._$litPart$;if(void 0===r){const t=null!==(o=null==i?void 0:i.renderBefore)&&void 0!==o?o:null;s._$litPart$=r=new j(e.insertBefore(E(),t),t,void 0,null!=i?i:{})}return r._$AI(t),r})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return N}}et.finalized=!0,et._$litElement$=!0,null===(Q=globalThis.litElementHydrateSupport)||void 0===Q||Q.call(globalThis,{LitElement:et});const it=globalThis.litElementPolyfillSupport;var nt;null==it||it({LitElement:et}),(null!==(tt=globalThis.litElementVersions)&&void 0!==tt?tt:globalThis.litElementVersions=[]).push("3.2.2"),function(t){t[t.YELLOW=33]="YELLOW",t[t.PURPLE=35]="PURPLE",t[t.WHITE=37]="WHITE",t[t.BLUE=34]="BLUE",t[t.RED=31]="RED",t[t.CYAN=36]="CYAN",t[t.GREEN=32]="GREEN",t[t.BLACK=30]="BLACK"}(nt||(nt={}));const ot=(t,e)=>`[${e}m${t}`,st=t=>ot(t.tagName.padEnd(30),nt.PURPLE),rt=(t,e,i=!1)=>{if((t.DEBUG_UPDATES||t.DEBUG)&&e.size>0){console.log(st(t),i?ot("<first-updated>",nt.BLACK):ot("<updated>",nt.YELLOW));for(const[i,n]of e.entries())console.log(" "+String(i).padEnd(30),n,ot("=>",nt.WHITE),t[i])}},at=(t,e,i)=>{(t.DEBUG_EVENTS||t.DEBUG)&&console.log(st(t),void 0!==i?ot("<custom-event>",nt.RED):ot("<event> ",nt.CYAN),ot(e,nt.BLUE),void 0!==i?i:"")};class lt extends et{constructor(){super(...arguments),this.DEBUG=!1,this.DEBUG_UPDATES=!1,this.DEBUG_EVENTS=!1,this.eles={}}getEventHandlers(){return[]}connectedCallback(){super.connectedCallback();for(const t of this.getEventHandlers())t.isDocument?document.addEventListener(t.event,t.method.bind(this)):this.addEventListener(t.event,t.method.bind(this))}disconnectedCallback(){for(const t of this.getEventHandlers())t.isDocument?document.removeEventListener(t.event,t.method):this.removeEventListener(t.event,t.method);super.disconnectedCallback()}firstUpdated(t){super.firstUpdated(t),rt(this,t,!0)}updated(t){super.updated(t),rt(this,t,!1)}fireEvent(t){return at(this,t),this.dispatchEvent(new Event(t,{bubbles:!0,composed:!0}))}fireCustomEvent(t,e={}){this.DEBUG_EVENTS&&at(this,t,e);const i=new CustomEvent(t,{detail:e,bubbles:!0,composed:!0});return this.dispatchEvent(i)}dispatchEvent(t){super.dispatchEvent(t);const e=t.target;if(e){const i=e["-"+t.type];if(i)return i(t);return new Function("event",`\n with(document) {\n with(this) {\n let handler = ${e.getAttribute("-"+t.type)};\n if(typeof handler === 'function') { \n handler(event);\n }\n }\n }\n `).call(e,t)}}closestElement(t,e=this){return function e(i){if(!i||i===document||i===window)return null;i.assignedSlot&&(i=i.assignedSlot);const n=i.closest(t);return n||e(i.getRootNode().host)}(e)}getDiv(t){let e=this.eles[t];return e||(e=this.shadowRoot.querySelector(t),e&&(this.eles[t]=e),e)}}const ht=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(i){i.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(i){i.createProperty(e.key,t)}};function ct(t){return(e,i)=>void 0!==i?((t,e,i)=>{e.constructor.createProperty(i,t)})(t,e,i):ht(t,e)}var dt;null===(dt=window.HTMLSlotElement)||void 0===dt||dt.prototype.assignedElements;class ut extends lt{constructor(){super(),this.name="",this.value=null,this.inputRoot=this,this.disabled=!1,this.internals=this.attachInternals()}updated(t){super.updated(t),t.has("value")&&this.internals.setFormValue(this.value)}get form(){return this.internals.form}get type(){return this.localName}setValue(t){this.value=this.serializeValue(t)}getDeserializedValue(){return JSON.parse(this.value)}serializeValue(t){return JSON.stringify(t)}}ut.formAssociated=!0,t([ct({type:String})],ut.prototype,"name",void 0),t([ct({type:String,attribute:"help_text"})],ut.prototype,"helpText",void 0),t([ct({type:Boolean,attribute:"help_always"})],ut.prototype,"helpAlways",void 0),t([ct({type:Boolean,attribute:"widget_only"})],ut.prototype,"widgetOnly",void 0),t([ct({type:Boolean,attribute:"hide_label"})],ut.prototype,"hideLabel",void 0),t([ct({type:String})],ut.prototype,"label",void 0),t([ct({type:Array})],ut.prototype,"errors",void 0),t([ct({type:String})],ut.prototype,"value",void 0),t([ct({attribute:!1})],ut.prototype,"inputRoot",void 0),t([ct({type:Boolean})],ut.prototype,"disabled",void 0);var pt;!function(t){t.alert_warning="alert-square",t.account="user-01",t.active="play",t.add_note="file-02",t.airtime="bank-note-01",t.analytics="bar-chart-01",t.archive="archive",t.arrow_up="chevron-up",t.arrow_down="chevron-down",t.arrow_left="chevron-left",t.arrow_right="chevron-right",t.attachment="paperclip",t.attachment_audio="volume-min",t.attachment_document="file-06",t.attachment_image="image-01",t.attachment_location="marker-pin-01",t.attachment_video="video-recorder",t.broadcast="announcement-01",t.call="phone-call-01",t.call_missed="phone-call-02",t.campaign="clock-refresh",t.campaign_active="play",t.campaign_archived="archive",t.campaigns="clock-refresh",t.channel="zap",t.channel_a="channel-android",t.channel_ct="channel-clickatell",t.channel_d3="channel-whatsapp",t.channel_ds="channel-discord",t.channel_ex="zap",t.channel_fb="channel-facebook",t.channel_fba="channel-facebook",t.channel_fc="channel-freshchat",t.channel_fcm="channel-firebase",t.channel_ig="channel-instagram",t.channel_jc="channel-jiochat",t.channel_jn="channel-junebug",t.channel_kn="channel-kannel",t.channel_kwa="channel-whatsapp",t.channel_ln="channel-line",t.channel_mg="channel-mtarget",t.channel_pl="channel-plivo",t.channel_rc="channel-rocketchat",t.channel_sl="channel-slack",t.channel_sw="channel-signalwire",t.channel_tq="channel-thinq",t.channel_tg="channel-telegram",t.channel_t="channel-twilio",t.channel_twt="channel-twitter",t.channel_twa="channel-whatsapp",t.channel_vp="channel-viber",t.channel_vk="channel-vk",t.channel_nx="channel-vonage",t.channel_wc="channel-wechat",t.channel_wa="channel-whatsapp",t.channel_wac="channel-whatsapp",t.channel_zvw="channel-whatsapp",t.children="git-branch-01",t.check="check",t.checkbox="square",t.checkbox_checked="check-square",t.checkbox_partial="stop-square",t.classifier_wit="classifier-wit",t.classifier_luis="classifier-luis",t.classifier_bothub="classifier-bothub",t.compose="send-01",t.colors="palette",t.contact="user-01",t.contact_archived="archive",t.contact_blocked="message-x-square",t.contact_stopped="slash-octagon",t.contact_updated="user-edit",t.contacts="user-01",t.conversation="message-chat-square",t.copy="copy-04",t.dashboard="pie-chart-01",t.delete="trash-03",t.delete_small="x",t.down="chevron-down",t.download="download-01",t.edit="edit-03",t.email="mail-01",t.error="alert-circle",t.event="zap",t.fields="user-edit",t.filter="filter-funnel-01",t.flow="flow",t.flow_background="layers-two-01",t.flow_interrupted="x-close",t.flow_ivr="phone",t.flow_message="message-square-02",t.flow_surveyor="tablet-01",t.flow_user="hard-drive",t.flows="flow",t.global="at-sign",t.group="users-01",t.group_smart="atom-01",t.help="help-circle",t.home="settings-02",t.image="image-01",t.inbox="inbox-01",t.incoming_call="phone-incoming-01",t.info="user-square",t.label="tag-01",t.language="translate-01",t.link="link-external-01",t.location="marker-pin-01",t.log="file-02",t.logout="log-out-04",t.menu="menu-01",t.menu_collapse="chevron-left-double",t.message="message-square-02",t.messages="message-square-02",t.missing="maximize-02",t.missed_call="phone-x",t.new="plus",t.next_schedule="alarm-clock",t.notification="bell-01",t.org_active="credit-card-02",t.org_anonymous="glasses-01",t.org_bulk="credit-card-plus",t.org_flagged="flag-01",t.org_new="stars-02",t.org_suspended="slash-circle-01",t.org_verified="check-verified-02",t.overview="pie-chart-01",t.prometheus="prometheus",t.progress_spinner="refresh-cw-04",t.featured="star-01",t.referral="user-right-01",t.resend="refresh-cw-05",t.reset="flip-backward",t.resthooks="share-07",t.restore="play",t.retry="refresh-cw-05",t.rocketchat="rocketchat",t.runs="rows-03",t.schedule="calendar",t.search="search-refraction",t.select_open="chevron-down",t.select_clear="x",t.service="magic-wand-01",t.service_end="log-out-04",t.settings="settings-02",t.sort="chevron-selector-vertical",t.sort_down="sort-arrow-down",t.sort_up="sort-arrow-up",t.staff="hard-drive",t.tickets="agent",t.tickets_all="archive",t.tickets_closed="check",t.tickets_mine="coffee",t.tickets_open="inbox-01",t.tickets_unassigned="inbox-01",t.topic="message-text-circle-02",t.two_factor_enabled="shield-02",t.two_factor_disabled="shield-01",t.trigger="signal-01",t.trigger_active="play",t.trigger_archived="archive",t.trigger_new="plus",t.triggers="signal-01",t.updated="edit-02",t.up="chevron-up",t.upload="upload-cloud-01",t.usages="link-04",t.user="users-01",t.users="users-01",t.user_beta="shield-zap",t.webhook="link-external-01",t.wit="wit",t.workspace="folder",t.zapier="zapier",t.zendesk="zendesk",t.ext="lightning-01",t.fcm="lightning-01",t.bothub="bothub",t.chatbase="chatbase",t.dtone="dtone",t.default="list",t.datepicker="calendar",t.slider="sliders-02",t.select="browser",t.input="edit-05"}(pt||(pt={}));class mt extends ut{constructor(){super(...arguments),this.name="",this.disabled=!1,this.size=1.2,this.animateChange="pulse"}static get styles(){return r`
1
+ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(r=(s<3?o(r):s>3?o(e,i,r):o(e,i))||r);return s>3&&r&&Object.defineProperty(e,i,r),r}const e=window,i=e.ShadowRoot&&(void 0===e.ShadyCSS||e.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,n=Symbol(),o=new WeakMap;class s{constructor(t,e,i){if(this._$cssResult$=!0,i!==n)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(i&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=o.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&o.set(e,t))}return t}toString(){return this.cssText}}const r=(t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,i,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[n+1]),t[0]);return new s(i,t,n)},a=i?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new s("string"==typeof t?t:t+"",void 0,n))(e)})(t):t;var l;const h=window,c=h.trustedTypes,d=c?c.emptyScript:"",u=h.reactiveElementPolyfillSupport,p={toAttribute(t,e){switch(e){case Boolean:t=t?d:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},m=(t,e)=>e!==t&&(e==e||t==t),f={attribute:!0,type:String,converter:p,reflect:!1,hasChanged:m};class g extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(t){var e;this.finalize(),(null!==(e=this.h)&&void 0!==e?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();const t=[];return this.elementProperties.forEach(((e,i)=>{const n=this._$Ep(i,e);void 0!==n&&(this._$Ev.set(n,i),t.push(n))})),t}static createProperty(t,e=f){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){const i="symbol"==typeof t?Symbol():"__"+t,n=this.getPropertyDescriptor(t,i,e);void 0!==n&&Object.defineProperty(this.prototype,t,n)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(n){const o=this[t];this[e]=n,this.requestUpdate(t,o,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||f}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,e=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const i of e)this.createProperty(i,t[i])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(a(t))}else void 0!==t&&e.push(a(t));return e}static _$Ep(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}u(){var t;this._$E_=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(t=this.constructor.h)||void 0===t||t.forEach((t=>t(this)))}addController(t){var e,i;(null!==(e=this._$ES)&&void 0!==e?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null===(i=t.hostConnected)||void 0===i||i.call(t))}removeController(t){var e;null===(e=this._$ES)||void 0===e||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach(((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])}))}createRenderRoot(){var t;const n=null!==(t=this.shadowRoot)&&void 0!==t?t:this.attachShadow(this.constructor.shadowRootOptions);return((t,n)=>{i?t.adoptedStyleSheets=n.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet)):n.forEach((i=>{const n=document.createElement("style"),o=e.litNonce;void 0!==o&&n.setAttribute("nonce",o),n.textContent=i.cssText,t.appendChild(n)}))})(n,this.constructor.elementStyles),n}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostConnected)||void 0===e?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostDisconnected)||void 0===e?void 0:e.call(t)}))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EO(t,e,i=f){var n;const o=this.constructor._$Ep(t,i);if(void 0!==o&&!0===i.reflect){const s=(void 0!==(null===(n=i.converter)||void 0===n?void 0:n.toAttribute)?i.converter:p).toAttribute(e,i.type);this._$El=t,null==s?this.removeAttribute(o):this.setAttribute(o,s),this._$El=null}}_$AK(t,e){var i;const n=this.constructor,o=n._$Ev.get(t);if(void 0!==o&&this._$El!==o){const t=n.getPropertyOptions(o),s="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null===(i=t.converter)||void 0===i?void 0:i.fromAttribute)?t.converter:p;this._$El=o,this[o]=s.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,i){let n=!0;void 0!==t&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||m)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,i))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach(((t,e)=>this[e]=t)),this._$Ei=void 0);let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),null===(t=this._$ES)||void 0===t||t.forEach((t=>{var e;return null===(e=t.hostUpdate)||void 0===e?void 0:e.call(t)})),this.update(i)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;null===(e=this._$ES)||void 0===e||e.forEach((t=>{var e;return null===(e=t.hostUpdated)||void 0===e?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach(((t,e)=>this._$EO(e,this[e],t))),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}}var v;g.finalized=!0,g.elementProperties=new Map,g.elementStyles=[],g.shadowRootOptions={mode:"open"},null==u||u({ReactiveElement:g}),(null!==(l=h.reactiveElementVersions)&&void 0!==l?l:h.reactiveElementVersions=[]).push("1.5.0");const y=window,b=y.trustedTypes,_=b?b.createPolicy("lit-html",{createHTML:t=>t}):void 0,x=`lit$${(Math.random()+"").slice(9)}$`,w="?"+x,k=`<${w}>`,S=document,E=(t="")=>S.createComment(t),C=t=>null===t||"object"!=typeof t&&"function"!=typeof t,$=Array.isArray,T=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,A=/-->/g,M=/>/g,O=RegExp(">|[ \t\n\f\r](?:([^\\s\"'>=/]+)([ \t\n\f\r]*=[ \t\n\f\r]*(?:[^ \t\n\f\r\"'`<>=]|(\"|')|))|$)","g"),z=/'/g,P=/"/g,I=/^(?:script|style|textarea|title)$/i,D=(t=>(e,...i)=>({_$litType$:t,strings:e,values:i}))(1),N=Symbol.for("lit-noChange"),R=Symbol.for("lit-nothing"),B=new WeakMap,q=S.createTreeWalker(S,129,null,!1),U=(t,e)=>{const i=t.length-1,n=[];let o,s=2===e?"<svg>":"",r=T;for(let e=0;e<i;e++){const i=t[e];let a,l,h=-1,c=0;for(;c<i.length&&(r.lastIndex=c,l=r.exec(i),null!==l);)c=r.lastIndex,r===T?"!--"===l[1]?r=A:void 0!==l[1]?r=M:void 0!==l[2]?(I.test(l[2])&&(o=RegExp("</"+l[2],"g")),r=O):void 0!==l[3]&&(r=O):r===O?">"===l[0]?(r=null!=o?o:T,h=-1):void 0===l[1]?h=-2:(h=r.lastIndex-l[2].length,a=l[1],r=void 0===l[3]?O:'"'===l[3]?P:z):r===P||r===z?r=O:r===A||r===M?r=T:(r=O,o=void 0);const d=r===O&&t[e+1].startsWith("/>")?" ":"";s+=r===T?i+k:h>=0?(n.push(a),i.slice(0,h)+"$lit$"+i.slice(h)+x+d):i+x+(-2===h?(n.push(void 0),e):d)}const a=s+(t[i]||"<?>")+(2===e?"</svg>":"");if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return[void 0!==_?_.createHTML(a):a,n]};class Z{constructor({strings:t,_$litType$:e},i){let n;this.parts=[];let o=0,s=0;const r=t.length-1,a=this.parts,[l,h]=U(t,e);if(this.el=Z.createElement(l,i),q.currentNode=this.el.content,2===e){const t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(n=q.nextNode())&&a.length<r;){if(1===n.nodeType){if(n.hasAttributes()){const t=[];for(const e of n.getAttributeNames())if(e.endsWith("$lit$")||e.startsWith(x)){const i=h[s++];if(t.push(e),void 0!==i){const t=n.getAttribute(i.toLowerCase()+"$lit$").split(x),e=/([.?@])?(.*)/.exec(i);a.push({type:1,index:o,name:e[2],strings:t,ctor:"."===e[1]?W:"?"===e[1]?K:"@"===e[1]?Y:H})}else a.push({type:6,index:o})}for(const e of t)n.removeAttribute(e)}if(I.test(n.tagName)){const t=n.textContent.split(x),e=t.length-1;if(e>0){n.textContent=b?b.emptyScript:"";for(let i=0;i<e;i++)n.append(t[i],E()),q.nextNode(),a.push({type:2,index:++o});n.append(t[e],E())}}}else if(8===n.nodeType)if(n.data===w)a.push({type:2,index:o});else{let t=-1;for(;-1!==(t=n.data.indexOf(x,t+1));)a.push({type:7,index:o}),t+=x.length-1}o++}}static createElement(t,e){const i=S.createElement("template");return i.innerHTML=t,i}}function F(t,e,i=t,n){var o,s,r,a;if(e===N)return e;let l=void 0!==n?null===(o=i._$Co)||void 0===o?void 0:o[n]:i._$Cl;const h=C(e)?void 0:e._$litDirective$;return(null==l?void 0:l.constructor)!==h&&(null===(s=null==l?void 0:l._$AO)||void 0===s||s.call(l,!1),void 0===h?l=void 0:(l=new h(t),l._$AT(t,i,n)),void 0!==n?(null!==(r=(a=i)._$Co)&&void 0!==r?r:a._$Co=[])[n]=l:i._$Cl=l),void 0!==l&&(e=F(t,l._$AS(t,e.values),l,n)),e}class V{constructor(t,e){this.u=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}v(t){var e;const{el:{content:i},parts:n}=this._$AD,o=(null!==(e=null==t?void 0:t.creationScope)&&void 0!==e?e:S).importNode(i,!0);q.currentNode=o;let s=q.nextNode(),r=0,a=0,l=n[0];for(;void 0!==l;){if(r===l.index){let e;2===l.type?e=new j(s,s.nextSibling,this,t):1===l.type?e=new l.ctor(s,l.name,l.strings,this,t):6===l.type&&(e=new J(s,this,t)),this.u.push(e),l=n[++a]}r!==(null==l?void 0:l.index)&&(s=q.nextNode(),r++)}return o}p(t){let e=0;for(const i of this.u)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class j{constructor(t,e,i,n){var o;this.type=2,this._$AH=R,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=n,this._$Cm=null===(o=null==n?void 0:n.isConnected)||void 0===o||o}get _$AU(){var t,e;return null!==(e=null===(t=this._$AM)||void 0===t?void 0:t._$AU)&&void 0!==e?e:this._$Cm}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=F(this,t,e),C(t)?t===R||null==t||""===t?(this._$AH!==R&&this._$AR(),this._$AH=R):t!==this._$AH&&t!==N&&this.g(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>$(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]))(t)?this.k(t):this.g(t)}O(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}g(t){this._$AH!==R&&C(this._$AH)?this._$AA.nextSibling.data=t:this.T(S.createTextNode(t)),this._$AH=t}$(t){var e;const{values:i,_$litType$:n}=t,o="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=Z.createElement(n.h,this.options)),n);if((null===(e=this._$AH)||void 0===e?void 0:e._$AD)===o)this._$AH.p(i);else{const t=new V(o,this),e=t.v(this.options);t.p(i),this.T(e),this._$AH=t}}_$AC(t){let e=B.get(t.strings);return void 0===e&&B.set(t.strings,e=new Z(t)),e}k(t){$(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,n=0;for(const o of t)n===e.length?e.push(i=new j(this.O(E()),this.O(E()),this,this.options)):i=e[n],i._$AI(o),n++;n<e.length&&(this._$AR(i&&i._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){var i;for(null===(i=this._$AP)||void 0===i||i.call(this,!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cm=t,null===(e=this._$AP)||void 0===e||e.call(this,t))}}class H{constructor(t,e,i,n,o){this.type=1,this._$AH=R,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=o,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=R}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,n){const o=this.strings;let s=!1;if(void 0===o)t=F(this,t,e,0),s=!C(t)||t!==this._$AH&&t!==N,s&&(this._$AH=t);else{const n=t;let r,a;for(t=o[0],r=0;r<o.length-1;r++)a=F(this,n[i+r],e,r),a===N&&(a=this._$AH[r]),s||(s=!C(a)||a!==this._$AH[r]),a===R?t=R:t!==R&&(t+=(null!=a?a:"")+o[r+1]),this._$AH[r]=a}s&&!n&&this.j(t)}j(t){t===R?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class W extends H{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===R?void 0:t}}const G=b?b.emptyScript:"";class K extends H{constructor(){super(...arguments),this.type=4}j(t){t&&t!==R?this.element.setAttribute(this.name,G):this.element.removeAttribute(this.name)}}class Y extends H{constructor(t,e,i,n,o){super(t,e,i,n,o),this.type=5}_$AI(t,e=this){var i;if((t=null!==(i=F(this,t,e,0))&&void 0!==i?i:R)===N)return;const n=this._$AH,o=t===R&&n!==R||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,s=t!==R&&(n===R||o);o&&this.element.removeEventListener(this.name,this,n),s&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;"function"==typeof this._$AH?this._$AH.call(null!==(i=null===(e=this.options)||void 0===e?void 0:e.host)&&void 0!==i?i:this.element,t):this._$AH.handleEvent(t)}}class J{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){F(this,t)}}const X=y.litHtmlPolyfillSupport;null==X||X(Z,j),(null!==(v=y.litHtmlVersions)&&void 0!==v?v:y.litHtmlVersions=[]).push("2.5.0");var Q,tt;class et extends g{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;const i=super.createRenderRoot();return null!==(t=(e=this.renderOptions).renderBefore)&&void 0!==t||(e.renderBefore=i.firstChild),i}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,i)=>{var n,o;const s=null!==(n=null==i?void 0:i.renderBefore)&&void 0!==n?n:e;let r=s._$litPart$;if(void 0===r){const t=null!==(o=null==i?void 0:i.renderBefore)&&void 0!==o?o:null;s._$litPart$=r=new j(e.insertBefore(E(),t),t,void 0,null!=i?i:{})}return r._$AI(t),r})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null===(t=this._$Do)||void 0===t||t.setConnected(!1)}render(){return N}}et.finalized=!0,et._$litElement$=!0,null===(Q=globalThis.litElementHydrateSupport)||void 0===Q||Q.call(globalThis,{LitElement:et});const it=globalThis.litElementPolyfillSupport;var nt;null==it||it({LitElement:et}),(null!==(tt=globalThis.litElementVersions)&&void 0!==tt?tt:globalThis.litElementVersions=[]).push("3.2.2"),function(t){t[t.YELLOW=33]="YELLOW",t[t.PURPLE=35]="PURPLE",t[t.WHITE=37]="WHITE",t[t.BLUE=34]="BLUE",t[t.RED=31]="RED",t[t.CYAN=36]="CYAN",t[t.GREEN=32]="GREEN",t[t.BLACK=30]="BLACK"}(nt||(nt={}));const ot=(t,e)=>`[${e}m${t}`,st=t=>ot(t.tagName.padEnd(30),nt.PURPLE),rt=(t,e,i=!1)=>{if((t.DEBUG_UPDATES||t.DEBUG)&&e.size>0){console.log(st(t),i?ot("<first-updated>",nt.BLACK):ot("<updated>",nt.YELLOW));for(const[i,n]of e.entries())console.log(" "+String(i).padEnd(30),n,ot("=>",nt.WHITE),t[i])}},at=(t,e,i)=>{(t.DEBUG_EVENTS||t.DEBUG)&&console.log(st(t),void 0!==i?ot("<custom-event>",nt.RED):ot("<event> ",nt.CYAN),ot(e,nt.BLUE),void 0!==i?i:"")};class lt extends et{constructor(){super(...arguments),this.DEBUG=!1,this.DEBUG_UPDATES=!1,this.DEBUG_EVENTS=!1,this.eles={}}getEventHandlers(){return[]}connectedCallback(){super.connectedCallback();for(const t of this.getEventHandlers())t.isDocument?document.addEventListener(t.event,t.method.bind(this)):this.addEventListener(t.event,t.method.bind(this))}disconnectedCallback(){for(const t of this.getEventHandlers())t.isDocument?document.removeEventListener(t.event,t.method):this.removeEventListener(t.event,t.method);super.disconnectedCallback()}firstUpdated(t){super.firstUpdated(t),rt(this,t,!0)}updated(t){super.updated(t),rt(this,t,!1)}fireEvent(t){return at(this,t),this.dispatchEvent(new Event(t,{bubbles:!0,composed:!0}))}fireCustomEvent(t,e={}){this.DEBUG_EVENTS&&at(this,t,e);const i=new CustomEvent(t,{detail:e,bubbles:!0,composed:!0});return this.dispatchEvent(i)}dispatchEvent(t){super.dispatchEvent(t);const e=t.target;if(e){const i=e["-"+t.type];if(i)return i(t);return new Function("event",`\n with(document) {\n with(this) {\n let handler = ${e.getAttribute("-"+t.type)};\n if(typeof handler === 'function') { \n handler(event);\n }\n }\n }\n `).call(e,t)}}closestElement(t,e=this){return function e(i){if(!i||i===document||i===window)return null;i.assignedSlot&&(i=i.assignedSlot);const n=i.closest(t);return n||e(i.getRootNode().host)}(e)}getDiv(t){let e=this.eles[t];return e||(e=this.shadowRoot.querySelector(t),e&&(this.eles[t]=e),e)}}const ht=(t,e)=>"method"===e.kind&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(i){i.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(i){i.createProperty(e.key,t)}};function ct(t){return(e,i)=>void 0!==i?((t,e,i)=>{e.constructor.createProperty(i,t)})(t,e,i):ht(t,e)}var dt;null===(dt=window.HTMLSlotElement)||void 0===dt||dt.prototype.assignedElements;class ut extends lt{constructor(){super(),this.name="",this.value=null,this.inputRoot=this,this.disabled=!1,this.internals=this.attachInternals()}updated(t){super.updated(t),t.has("value")&&this.internals.setFormValue(this.value)}get form(){return this.internals.form}get type(){return this.localName}setValue(t){this.value=this.serializeValue(t)}getDeserializedValue(){return JSON.parse(this.value)}serializeValue(t){return JSON.stringify(t)}}ut.formAssociated=!0,t([ct({type:String})],ut.prototype,"name",void 0),t([ct({type:String,attribute:"help_text"})],ut.prototype,"helpText",void 0),t([ct({type:Boolean,attribute:"help_always"})],ut.prototype,"helpAlways",void 0),t([ct({type:Boolean,attribute:"widget_only"})],ut.prototype,"widgetOnly",void 0),t([ct({type:Boolean,attribute:"hide_label"})],ut.prototype,"hideLabel",void 0),t([ct({type:String})],ut.prototype,"label",void 0),t([ct({type:Array})],ut.prototype,"errors",void 0),t([ct({type:String})],ut.prototype,"value",void 0),t([ct({attribute:!1})],ut.prototype,"inputRoot",void 0),t([ct({type:Boolean})],ut.prototype,"disabled",void 0);var pt;!function(t){t.alert_warning="alert-square",t.account="user-01",t.active="play",t.add_note="file-02",t.airtime="bank-note-01",t.analytics="bar-chart-01",t.archive="archive",t.arrow_up="chevron-up",t.arrow_down="chevron-down",t.arrow_left="chevron-left",t.arrow_right="chevron-right",t.attachment="paperclip",t.attachment_audio="volume-min",t.attachment_document="file-06",t.attachment_image="image-01",t.attachment_location="marker-pin-01",t.attachment_video="video-recorder",t.broadcast="announcement-01",t.call="phone-call-01",t.call_missed="phone-call-02",t.campaign="clock-refresh",t.campaign_active="play",t.campaign_archived="archive",t.campaigns="clock-refresh",t.channel="zap",t.channel_a="channel-android",t.channel_ct="channel-clickatell",t.channel_d3="channel-whatsapp",t.channel_ds="channel-discord",t.channel_ex="zap",t.channel_fb="channel-facebook",t.channel_fba="channel-facebook",t.channel_fc="channel-freshchat",t.channel_fcm="channel-firebase",t.channel_ig="channel-instagram",t.channel_jc="channel-jiochat",t.channel_jn="channel-junebug",t.channel_kn="channel-kannel",t.channel_kwa="channel-whatsapp",t.channel_ln="channel-line",t.channel_mg="channel-mtarget",t.channel_pl="channel-plivo",t.channel_rc="channel-rocketchat",t.channel_sl="channel-slack",t.channel_sw="channel-signalwire",t.channel_tq="channel-thinq",t.channel_tg="channel-telegram",t.channel_t="channel-twilio",t.channel_twt="channel-twitter",t.channel_twa="channel-whatsapp",t.channel_vp="channel-viber",t.channel_vk="channel-vk",t.channel_nx="channel-vonage",t.channel_wc="channel-wechat",t.channel_wa="channel-whatsapp",t.channel_wac="channel-whatsapp",t.channel_zvw="channel-whatsapp",t.children="git-branch-01",t.check="check",t.checkbox="square",t.checkbox_checked="check-square",t.checkbox_partial="stop-square",t.classifier_wit="classifier-wit",t.classifier_luis="classifier-luis",t.classifier_bothub="classifier-bothub",t.compose="send-01",t.colors="palette",t.contact="user-01",t.contact_archived="archive",t.contact_blocked="message-x-square",t.contact_stopped="slash-octagon",t.contact_updated="user-edit",t.contacts="user-01",t.conversation="message-chat-square",t.copy="copy-04",t.dashboard="pie-chart-01",t.delete="trash-03",t.delete_small="x",t.down="chevron-down",t.download="download-01",t.edit="edit-03",t.email="mail-01",t.error="alert-circle",t.event="zap",t.fields="user-edit",t.filter="filter-funnel-01",t.flow="flow",t.flow_background="layers-two-01",t.flow_interrupted="x-close",t.flow_ivr="phone",t.flow_message="message-square-02",t.flow_surveyor="tablet-01",t.flow_user="hard-drive",t.flows="flow",t.global="at-sign",t.grid="dots-grid",t.group="users-01",t.group_smart="atom-01",t.help="help-circle",t.home="settings-02",t.image="image-01",t.inbox="inbox-01",t.incoming_call="phone-incoming-01",t.integrations="layers-three-01",t.info="user-square",t.label="tag-01",t.language="translate-01",t.link="link-external-01",t.location="marker-pin-01",t.log="file-02",t.logout="log-out-04",t.menu="menu-01",t.menu_collapse="chevron-left-double",t.message="message-square-02",t.messages="message-square-02",t.missing="maximize-02",t.missed_call="phone-x",t.new="plus",t.next_schedule="alarm-clock",t.notification="bell-01",t.org_active="credit-card-02",t.org_anonymous="glasses-01",t.org_bulk="credit-card-plus",t.org_flagged="flag-01",t.org_new="stars-02",t.org_suspended="slash-circle-01",t.org_verified="check-verified-02",t.overview="pie-chart-01",t.prometheus="prometheus",t.progress_spinner="refresh-cw-04",t.featured="star-01",t.referral="user-right-01",t.resend="refresh-cw-05",t.reset="flip-backward",t.resthooks="share-07",t.restore="play",t.retry="refresh-cw-05",t.rocketchat="rocketchat",t.runs="rows-03",t.schedule="calendar",t.search="search-refraction",t.select_open="chevron-down",t.select_clear="x",t.service="magic-wand-01",t.service_end="log-out-04",t.settings="settings-02",t.sort="chevron-selector-vertical",t.sort_down="sort-arrow-down",t.sort_up="sort-arrow-up",t.staff="hard-drive",t.tickets="agent",t.tickets_all="archive",t.tickets_closed="check",t.tickets_mine="coffee",t.tickets_open="inbox-01",t.tickets_unassigned="inbox-01",t.topic="message-text-circle-02",t.two_factor_enabled="shield-02",t.two_factor_disabled="shield-01",t.trigger="signal-01",t.trigger_active="play",t.trigger_archived="archive",t.trigger_new="plus",t.triggers="signal-01",t.updated="edit-02",t.up="chevron-up",t.upload="upload-cloud-01",t.usages="link-04",t.user="users-01",t.users="users-01",t.user_beta="shield-zap",t.webhook="link-external-01",t.wit="wit",t.workspace="folder",t.zapier="zapier",t.zendesk="zendesk",t.ext="lightning-01",t.fcm="lightning-01",t.bothub="bothub",t.chatbase="chatbase",t.dtone="dtone",t.default="list",t.datepicker="calendar",t.slider="sliders-02",t.select="browser",t.input="edit-05"}(pt||(pt={}));class mt extends ut{constructor(){super(...arguments),this.name="",this.disabled=!1,this.size=1.2,this.animateChange="pulse"}static get styles(){return r`
2
2
  :host {
3
3
  color: var(--color-text);
4
4
  display: inline-block;
@@ -234,7 +234,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
234
234
  width: 100%;
235
235
  top: 0.5em;
236
236
  }
237
- `}getLocale(){return this.locale[0]}clearCache(){this.cache=$e(this.max,this.ttl)}reset(){this.ready=!1,this.clearCache(),this.settings=JSON.parse(fe("settings")||"{}");const t=[];this.completionEndpoint&&t.push(te(this.completionEndpoint).then((t=>{this.schema=t.json.context,this.fnOptions=t.json.functions}))),this.fieldsEndpoint&&t.push(this.refreshFields()),this.globalsEndpoint&&t.push(se(this.globalsEndpoint).then((t=>{this.keyedAssets.globals=t.map((t=>t.key))}))),this.languagesEndpoint&&t.push(se(this.languagesEndpoint).then((t=>{this.languages=t.reduce((function(t,e){return t[e.value]=e.name,t}),{})}))),this.groupsEndpoint&&t.push(se(this.groupsEndpoint).then((t=>{t.forEach((t=>{this.groups[t.uuid]=t}))}))),this.workspaceEndpoint&&t.push(te(this.workspaceEndpoint).then((t=>{this.workspace=t.json;const e=t.headers.get("content-language");e&&(this.locale=[e,...this.locale])}))),this.usersEndpoint&&t.push(se(this.usersEndpoint).then((t=>{this.users=t}))),this.initialHttpComplete=Promise.all(t),this.initialHttpComplete.then((()=>{this.ready=!0}))}getAssignableUsers(){return this.users.filter((t=>["administrator","editor","agent"].includes(t.role)))}firstUpdated(){this.reset()}getLanguageCode(){return this.locale.length>0?this.locale[0].split("-")[0]:"en"}refreshGlobals(){se(this.globalsEndpoint).then((t=>{this.keyedAssets.globals=t.map((t=>t.key))}))}refreshFields(){return se(this.fieldsEndpoint).then((t=>{this.keyedAssets.fields=[],this.featuredFields=[],t.forEach((t=>{this.keyedAssets.fields.push(t.key),this.fields[t.key]=t,t.featured&&this.featuredFields.push(t)})),this.featuredFields.sort(((t,e)=>e.priority-t.priority)),this.keyedAssets.fields.sort(),this.fireCustomEvent(Ee.StoreUpdated,{url:this.fieldsEndpoint,data:this.keyedAssets.fields})}))}getShortDuration(t,e=null){const i=e||Ss.now();return t.setLocale(this.locale[0]).toRelative({base:i,style:"long"})}getShortDurationFromIso(t,e=null){const i=Ss.fromISO(t),n=e?Ss.fromISO(e):Ss.now();return this.getShortDuration(i,n)}setKeyedAssets(t,e){this.keyedAssets[t]=e}updated(t){if(super.updated(t),t.has("ready")&&this.ready){const t=this.getLanguageCode(),e=Ws.find((e=>e===t));e&&Gs(e)}}getCompletionSchema(){return this.schema}getFunctions(){return this.fnOptions}getKeyedAssets(){return this.keyedAssets}getFieldKeys(){return this.keyedAssets.fields||[]}getContactField(t){return this.fields[t]}getFeaturedFields(){return this.featuredFields}getLanguageName(t){return this.languages[t]}isDynamicGroup(t){const e=this.groups[t];return!(e&&!e.query)}getWorkspace(){return this.workspace}formatDate(t){return Ss.fromISO(t).setLocale(this.getLocale()).toLocaleString(Ss.DATETIME_SHORT)}postJSON(t,e=""){return ae(t,e)}postForm(t,e){return((t,e)=>{const i=new FormData;return Object.keys(e).forEach((t=>{i.append(t,e[t])})),le(t,i)})(t,e)}postUrl(t,e="",i={},n=null){return re(t,e,i,n)}getUrl(t,e){return!(e=e||{}).force&&this.cache.has(t)?new Promise((e=>{e(this.cache.get(t))})):te(t,e.controller,e.headers||{}).then((e=>new Promise(((i,n)=>{e.status>=200&&e.status<=300?(this.cache.set(t,e),i(e)):n("Status: "+e.status)}))))}getResults(t,e){e=e||{};const i="results_"+t,n=this.cache.get(i);return!e.force&&n?new Promise((t=>{t(n)})):new Promise((e=>{const n=this.pendingResolves[t]||[];n.push(e),this.pendingResolves[t]=n,n.length<=1&&ne(t).then((e=>{this.cache.set(i,e);const n=this.pendingResolves[t]||[];for(;n.length>0;){n.pop()(e)}}))}))}updateCache(t,e){this.cache.set(t,e),this.fireCustomEvent(Ee.StoreUpdated,{url:t,data:e})}makeRequest(t,e){const i=this.fetching[t],n=(new Date).getTime();if(i&&n-i<500)return;this.fetching[t]=n,e=e||{};const o=this.cache.get(t);o&&!e.force?this.fireCustomEvent(Ee.StoreUpdated,{url:t,data:o}):ne(t).then((i=>{i=e.prepareData?e.prepareData(i):i,this.cache.set(t,i),this.fireCustomEvent(Ee.StoreUpdated,{url:t,data:i}),delete this.fetching[t]}))}get(t,e=null){return this.settings[t]||e}set(t,e){this.settings[t]=e}render(){if(!this.ready&&this.loader)return D`<temba-loading size="10" units="8"></temba-loading>`}}t([ct({type:Number})],Ks.prototype,"ttl",void 0),t([ct({type:Number})],Ks.prototype,"max",void 0),t([ct({type:Boolean})],Ks.prototype,"ready",void 0),t([ct({type:Boolean})],Ks.prototype,"loader",void 0),t([ct({type:String,attribute:"completion"})],Ks.prototype,"completionEndpoint",void 0),t([ct({type:String,attribute:"fields"})],Ks.prototype,"fieldsEndpoint",void 0),t([ct({type:String,attribute:"groups"})],Ks.prototype,"groupsEndpoint",void 0),t([ct({type:String,attribute:"globals"})],Ks.prototype,"globalsEndpoint",void 0),t([ct({type:String,attribute:"languages"})],Ks.prototype,"languagesEndpoint",void 0),t([ct({type:String,attribute:"workspace"})],Ks.prototype,"workspaceEndpoint",void 0),t([ct({type:String,attribute:"users"})],Ks.prototype,"usersEndpoint",void 0),t([ct({type:Object,attribute:!1})],Ks.prototype,"schema",void 0),t([ct({type:Object,attribute:!1})],Ks.prototype,"fnOptions",void 0),t([ct({type:Object,attribute:!1})],Ks.prototype,"keyedAssets",void 0);class Ys extends lt{constructor(){super(...arguments),this.marginHorizontal=0,this.marginVertical=7,this.scrollPct=75,this.cursorIndex=-1,this.nameKey="name",this.loading=!1,this.hideShadow=!1,this.getName=function(t){return t[this.nameKey||"name"]},this.renderInputOption=function(){return null},this.scrollHeight=0,this.triggerScroll=!1,this.scrollParent=null,this.setCursor=de((function(t){t!==this.cursorIndex&&(this.cursorIndex=t)}),50)}static get styles(){return r`
237
+ `}getLocale(){return this.locale[0]}clearCache(){this.cache=$e(this.max,this.ttl)}reset(){this.ready=!1,this.clearCache(),this.settings=JSON.parse(fe("settings")||"{}");const t=[];this.completionEndpoint&&t.push(te(this.completionEndpoint).then((t=>{this.schema=t.json.context,this.fnOptions=t.json.functions}))),this.fieldsEndpoint&&t.push(this.refreshFields()),this.globalsEndpoint&&t.push(se(this.globalsEndpoint).then((t=>{this.keyedAssets.globals=t.map((t=>t.key))}))),this.languagesEndpoint&&t.push(se(this.languagesEndpoint).then((t=>{this.languages=t.reduce((function(t,e){return t[e.value]=e.name,t}),{})}))),this.groupsEndpoint&&t.push(se(this.groupsEndpoint).then((t=>{t.forEach((t=>{this.groups[t.uuid]=t}))}))),this.workspaceEndpoint&&t.push(te(this.workspaceEndpoint).then((t=>{this.workspace=t.json;const e=t.headers.get("content-language");e&&(this.locale=[e,...this.locale])}))),this.usersEndpoint&&t.push(se(this.usersEndpoint).then((t=>{this.users=t}))),this.initialHttpComplete=Promise.all(t),this.initialHttpComplete.then((()=>{this.ready=!0}))}getAssignableUsers(){return this.users.filter((t=>["administrator","editor","agent"].includes(t.role)))}firstUpdated(){this.reset()}getLanguageCode(){return this.locale.length>0?this.locale[0].split("-")[0]:"en"}refreshGlobals(){se(this.globalsEndpoint).then((t=>{this.keyedAssets.globals=t.map((t=>t.key))}))}refreshFields(){return se(this.fieldsEndpoint).then((t=>{this.keyedAssets.fields=[],this.featuredFields=[],t.forEach((t=>{this.keyedAssets.fields.push(t.key),this.fields[t.key]=t,t.featured&&this.featuredFields.push(t)})),this.featuredFields.sort(((t,e)=>e.priority-t.priority)),this.keyedAssets.fields.sort(),this.fireCustomEvent(Ee.StoreUpdated,{url:this.fieldsEndpoint,data:this.keyedAssets.fields})}))}getShortDuration(t,e=null){const i=e||Ss.now();return t.setLocale(this.locale[0]).toRelative({base:i,style:"long"})}getShortDurationFromIso(t,e=null){const i=Ss.fromISO(t),n=e?Ss.fromISO(e):Ss.now();return this.getShortDuration(i,n)}setKeyedAssets(t,e){this.keyedAssets[t]=e}updated(t){if(super.updated(t),t.has("ready")&&this.ready){const t=this.getLanguageCode(),e=Ws.find((e=>e===t));e&&Gs(e)}}getCompletionSchema(){return this.schema}getFunctions(){return this.fnOptions}getKeyedAssets(){return this.keyedAssets}getFieldKeys(){return this.keyedAssets.fields||[]}getContactField(t){return this.fields[t]}getFeaturedFields(){return this.featuredFields}getLanguageName(t){return this.languages[t]}isDynamicGroup(t){const e=this.groups[t];return e||console.warn("No group for "+t),!(e&&!e.query)}getWorkspace(){return this.workspace}formatDate(t){return Ss.fromISO(t).setLocale(this.getLocale()).toLocaleString(Ss.DATETIME_SHORT)}postJSON(t,e=""){return ae(t,e)}postForm(t,e){return((t,e)=>{const i=new FormData;return Object.keys(e).forEach((t=>{i.append(t,e[t])})),le(t,i)})(t,e)}postUrl(t,e="",i={},n=null){return re(t,e,i,n)}getUrl(t,e){return!(e=e||{}).force&&this.cache.has(t)?new Promise((e=>{e(this.cache.get(t))})):te(t,e.controller,e.headers||{}).then((e=>new Promise(((i,n)=>{e.status>=200&&e.status<=300?(this.cache.set(t,e),i(e)):n("Status: "+e.status)}))))}getResults(t,e){e=e||{};const i="results_"+t,n=this.cache.get(i);return!e.force&&n?new Promise((t=>{t(n)})):new Promise((e=>{const n=this.pendingResolves[t]||[];n.push(e),this.pendingResolves[t]=n,n.length<=1&&ne(t).then((e=>{this.cache.set(i,e);const n=this.pendingResolves[t]||[];for(;n.length>0;){n.pop()(e)}}))}))}updateCache(t,e){this.cache.set(t,e),this.fireCustomEvent(Ee.StoreUpdated,{url:t,data:e})}makeRequest(t,e){const i=this.fetching[t],n=(new Date).getTime();if(i&&n-i<500)return;this.fetching[t]=n,e=e||{};const o=this.cache.get(t);o&&!e.force?this.fireCustomEvent(Ee.StoreUpdated,{url:t,data:o}):ne(t).then((i=>{i=e.prepareData?e.prepareData(i):i,this.cache.set(t,i),this.fireCustomEvent(Ee.StoreUpdated,{url:t,data:i}),delete this.fetching[t]}))}get(t,e=null){return this.settings[t]||e}set(t,e){this.settings[t]=e}render(){if(!this.ready&&this.loader)return D`<temba-loading size="10" units="8"></temba-loading>`}}t([ct({type:Number})],Ks.prototype,"ttl",void 0),t([ct({type:Number})],Ks.prototype,"max",void 0),t([ct({type:Boolean})],Ks.prototype,"ready",void 0),t([ct({type:Boolean})],Ks.prototype,"loader",void 0),t([ct({type:String,attribute:"completion"})],Ks.prototype,"completionEndpoint",void 0),t([ct({type:String,attribute:"fields"})],Ks.prototype,"fieldsEndpoint",void 0),t([ct({type:String,attribute:"groups"})],Ks.prototype,"groupsEndpoint",void 0),t([ct({type:String,attribute:"globals"})],Ks.prototype,"globalsEndpoint",void 0),t([ct({type:String,attribute:"languages"})],Ks.prototype,"languagesEndpoint",void 0),t([ct({type:String,attribute:"workspace"})],Ks.prototype,"workspaceEndpoint",void 0),t([ct({type:String,attribute:"users"})],Ks.prototype,"usersEndpoint",void 0),t([ct({type:Object,attribute:!1})],Ks.prototype,"schema",void 0),t([ct({type:Object,attribute:!1})],Ks.prototype,"fnOptions",void 0),t([ct({type:Object,attribute:!1})],Ks.prototype,"keyedAssets",void 0);class Ys extends lt{constructor(){super(...arguments),this.marginHorizontal=0,this.marginVertical=7,this.scrollPct=75,this.cursorIndex=-1,this.nameKey="name",this.loading=!1,this.hideShadow=!1,this.getName=function(t){return t[this.nameKey||"name"]},this.renderInputOption=function(){return null},this.scrollHeight=0,this.triggerScroll=!1,this.scrollParent=null,this.setCursor=de((function(t){t!==this.cursorIndex&&(this.cursorIndex=t)}),50)}static get styles(){return r`
238
238
  .options-container {
239
239
  background: var(--color-options-bg);
240
240
  user-select: none;
@@ -1867,7 +1867,18 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
1867
1867
  </div>`))}
1868
1868
  </div> `:null}
1869
1869
  </div>
1870
- ${t.msg.text||t.msg.attachments?null:D`<div class="unsupported">Unsupported Message</div>`}
1870
+ ${t.optin?D`<div class="optin">
1871
+ <temba-icon
1872
+ size="1"
1873
+ class="broadcast inline"
1874
+ name="${pt.restore}"
1875
+ ></temba-icon>
1876
+ <div class="text">
1877
+ Requested Opt In for
1878
+ <span class="italic">${t.optin.name}</span>
1879
+ </div>
1880
+ </div>`:null}
1881
+ ${t.msg.text||t.msg.attachments||t.optin?null:D`<div class="unsupported">Unsupported Message</div>`}
1871
1882
 
1872
1883
  <div
1873
1884
  class="msg-summary"
@@ -2271,6 +2282,23 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
2271
2282
  border-radius: var(--curvature);
2272
2283
  }
2273
2284
 
2285
+ .optin {
2286
+ border: 1px solid #f2f2f2;
2287
+ color: #999;
2288
+ padding: 0.5em 1em;
2289
+ border-radius: var(--curvature);
2290
+ display: inline-flex;
2291
+ }
2292
+
2293
+ .optin .text {
2294
+ margin-left: 0.5em;
2295
+ display: inline;
2296
+ }
2297
+
2298
+ .optin span.italic {
2299
+ font-style: italic;
2300
+ }
2301
+
2274
2302
  .time {
2275
2303
  padding: 0.3em 1px;
2276
2304
  }
@@ -2598,7 +2626,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
2598
2626
  ${t.campaign_event.offset_display}
2599
2627
  ${t.campaign_event.relative_to.name}</span
2600
2628
  >
2601
- </div>`)(t);case al.CHANNEL_EVENT:return(t=>{let e="",i=pt.call;return"mt_miss"===t.channel_event_type?(e="Missed outgoing call",i=pt.call_missed):"mo_miss"===t.channel_event_type?(e="Missed incoming call",i=pt.call_missed):"new_conversation"===t.channel_event_type?(e="Started Conversation",i=pt.event):"welcome_message"===t.channel_event_type?(e="Welcome Message Sent",i=pt.event):"referral"===t.channel_event_type?(e="Referred",i=pt.event):"follow"===t.channel_event_type?(e="Followed",i=pt.event):"stop_contact"===t.channel_event_type?(e="Stopped",i=pt.contact_stopped):"mt_call"===t.channel_event_type?e="Outgoing Phone Call":"mo_call"==t.channel_event_type&&(e="Incoming Phone call"),D`<temba-icon name="${i}"></temba-icon>
2629
+ </div>`)(t);case al.CHANNEL_EVENT:return(t=>{let e="",i=pt.call;return"mt_miss"===t.channel_event_type?(e="Missed outgoing call",i=pt.call_missed):"mo_miss"===t.channel_event_type?(e="Missed incoming call",i=pt.call_missed):"new_conversation"===t.channel_event_type?(e="Started Conversation",i=pt.event):"welcome_message"===t.channel_event_type?(e="Welcome Message Sent",i=pt.event):"referral"===t.channel_event_type?(e="Referred",i=pt.event):"follow"===t.channel_event_type?(e="Followed",i=pt.event):"stop_contact"===t.channel_event_type?(e="Stopped",i=pt.contact_stopped):"mt_call"===t.channel_event_type?e="Outgoing Phone Call":"mo_call"==t.channel_event_type?e="Incoming Phone call":"optin"==t.channel_event_type?(e="Opted in",i=pt.restore):"optout"==t.channel_event_type&&(e="Opted out",i=pt.error),D`<temba-icon name="${i}"></temba-icon>
2602
2630
  <div class="description">${e}</div>`})(t);case al.CONTACT_LANGUAGE_CHANGED:return(t=>D`<temba-icon name="${pt.contact_updated}"></temba-icon>
2603
2631
  <div class="description">
2604
2632
  Language updated to <span class="attn">${t.language}</span>
@@ -3100,7 +3128,7 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
3100
3128
  class="${ee({sheet:""===this.src,[this.animateChange]:!!this.animateChange,[this.animateChange+"-"+this.animationStep]:this.animationStep>0,[this.animateClick]:!!this.animateClick,[this.animateClick+"-"+this.animationStep]:this.animationStep>0})}"
3101
3129
  >
3102
3130
  <use
3103
- href="${this.src?this.src:`${this.prefix||window.static_url||"/static/"}svg/index.svg?v=9e7047ba4e3340690cde2911fc99dbeb#${t}`}"
3131
+ href="${this.src?this.src:`${this.prefix||window.static_url||"/static/"}svg/index.svg?v=fd046809342c62aaccb61aa8a97f7eba#${t}`}"
3104
3132
  />
3105
3133
  </svg>
3106
3134
  </div>
@@ -5557,7 +5585,9 @@ function t(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPro
5557
5585
  `:null}
5558
5586
  <div class="flex-grow:1"></div>
5559
5587
  </div>
5560
- <div style="flex-grow:1; font-family: monospace; font-size:0.8em;">
5588
+ <div
5589
+ style="flex-grow:1; font-family: Roboto Mono, monospace; font-size:0.8em;"
5590
+ >
5561
5591
  @fields.${t.key}
5562
5592
  </div>
5563
5593
  <div>${Jl[t.value_type]}</div>