@nylas/web-elements 1.0.0-prealpha1

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 (879) hide show
  1. package/LICENSE +21 -0
  2. package/dist/cjs/_commonjsHelpers-0a7b82d9.js +23 -0
  3. package/dist/cjs/_commonjsHelpers-0a7b82d9.js.map +1 -0
  4. package/dist/cjs/app-globals-d58ac016.js +11 -0
  5. package/dist/cjs/app-globals-d58ac016.js.map +1 -0
  6. package/dist/cjs/archive-icon_7.cjs.entry.js +120 -0
  7. package/dist/cjs/archive-icon_7.cjs.entry.js.map +1 -0
  8. package/dist/cjs/arrow-icon.cjs.entry.js +24 -0
  9. package/dist/cjs/arrow-icon.cjs.entry.js.map +1 -0
  10. package/dist/cjs/bold-icon_3.cjs.entry.js +56 -0
  11. package/dist/cjs/bold-icon_3.cjs.entry.js.map +1 -0
  12. package/dist/cjs/calendar-cancel-icon.cjs.entry.js +24 -0
  13. package/dist/cjs/calendar-cancel-icon.cjs.entry.js.map +1 -0
  14. package/dist/cjs/calendar-check-icon_3.cjs.entry.js +56 -0
  15. package/dist/cjs/calendar-check-icon_3.cjs.entry.js.map +1 -0
  16. package/dist/cjs/calendar-icon.cjs.entry.js +24 -0
  17. package/dist/cjs/calendar-icon.cjs.entry.js.map +1 -0
  18. package/dist/cjs/chevron-icon.cjs.entry.js +24 -0
  19. package/dist/cjs/chevron-icon.cjs.entry.js.map +1 -0
  20. package/dist/cjs/close-icon_2.cjs.entry.js +40 -0
  21. package/dist/cjs/close-icon_2.cjs.entry.js.map +1 -0
  22. package/dist/cjs/document-refresh-icon.cjs.entry.js +24 -0
  23. package/dist/cjs/document-refresh-icon.cjs.entry.js.map +1 -0
  24. package/dist/cjs/duration-18b22d1b.js +84 -0
  25. package/dist/cjs/duration-18b22d1b.js.map +1 -0
  26. package/dist/cjs/elements-b06c817b.js +21585 -0
  27. package/dist/cjs/elements-b06c817b.js.map +1 -0
  28. package/dist/cjs/flow-d922fbd4.js +891 -0
  29. package/dist/cjs/flow-d922fbd4.js.map +1 -0
  30. package/dist/cjs/focus-visible-857fc8f9.js +327 -0
  31. package/dist/cjs/focus-visible-857fc8f9.js.map +1 -0
  32. package/dist/cjs/forward-icon_6.cjs.entry.js +2216 -0
  33. package/dist/cjs/forward-icon_6.cjs.entry.js.map +1 -0
  34. package/dist/cjs/globe-icon.cjs.entry.js +24 -0
  35. package/dist/cjs/globe-icon.cjs.entry.js.map +1 -0
  36. package/dist/cjs/index-34e64e2d.js +2173 -0
  37. package/dist/cjs/index-34e64e2d.js.map +1 -0
  38. package/dist/cjs/index-e869130c.js +198 -0
  39. package/dist/cjs/index-e869130c.js.map +1 -0
  40. package/dist/cjs/index.cjs.js +12 -0
  41. package/dist/cjs/index.cjs.js.map +1 -0
  42. package/dist/cjs/index.es-e78884f5.js +3217 -0
  43. package/dist/cjs/index.es-e78884f5.js.map +1 -0
  44. package/dist/cjs/loader.cjs.js +17 -0
  45. package/dist/cjs/loader.cjs.js.map +1 -0
  46. package/dist/cjs/loading-icon.cjs.entry.js +24 -0
  47. package/dist/cjs/loading-icon.cjs.entry.js.map +1 -0
  48. package/dist/cjs/mailbox-store-0b1636fa.js +529 -0
  49. package/dist/cjs/mailbox-store-0b1636fa.js.map +1 -0
  50. package/dist/cjs/nylas-booked-event-card_9.cjs.entry.js +8127 -0
  51. package/dist/cjs/nylas-booked-event-card_9.cjs.entry.js.map +1 -0
  52. package/dist/cjs/nylas-if-state_3.cjs.entry.js +409 -0
  53. package/dist/cjs/nylas-if-state_3.cjs.entry.js.map +1 -0
  54. package/dist/cjs/nylas-list-folders.cjs.entry.js +120 -0
  55. package/dist/cjs/nylas-list-folders.cjs.entry.js.map +1 -0
  56. package/dist/cjs/nylas-list-threads.cjs.entry.js +89 -0
  57. package/dist/cjs/nylas-list-threads.cjs.entry.js.map +1 -0
  58. package/dist/cjs/nylas-mailbox-pagination.cjs.entry.js +140 -0
  59. package/dist/cjs/nylas-mailbox-pagination.cjs.entry.js.map +1 -0
  60. package/dist/cjs/nylas-mailbox-toolbar-button.cjs.entry.js +100 -0
  61. package/dist/cjs/nylas-mailbox-toolbar-button.cjs.entry.js.map +1 -0
  62. package/dist/cjs/nylas-open-hours-picker.cjs.entry.js +333 -0
  63. package/dist/cjs/nylas-open-hours-picker.cjs.entry.js.map +1 -0
  64. package/dist/cjs/nylas-provider.cjs.entry.js +184 -0
  65. package/dist/cjs/nylas-provider.cjs.entry.js.map +1 -0
  66. package/dist/cjs/nylas-scheduler.cjs.entry.js +242 -0
  67. package/dist/cjs/nylas-scheduler.cjs.entry.js.map +1 -0
  68. package/dist/cjs/nylas-threads-refresh.cjs.entry.js +118 -0
  69. package/dist/cjs/nylas-threads-refresh.cjs.entry.js.map +1 -0
  70. package/dist/cjs/nylas-threads-search.cjs.entry.js +84 -0
  71. package/dist/cjs/nylas-threads-search.cjs.entry.js.map +1 -0
  72. package/dist/cjs/nylas-view-thread.cjs.entry.js +234 -0
  73. package/dist/cjs/nylas-view-thread.cjs.entry.js.map +1 -0
  74. package/dist/cjs/nylas-web-elements.cjs.js +27 -0
  75. package/dist/cjs/nylas-web-elements.cjs.js.map +1 -0
  76. package/dist/cjs/play-icon_2.cjs.entry.js +40 -0
  77. package/dist/cjs/play-icon_2.cjs.entry.js.map +1 -0
  78. package/dist/cjs/property-d934a711.js +47 -0
  79. package/dist/cjs/property-d934a711.js.map +1 -0
  80. package/dist/cjs/refresh-icon.cjs.entry.js +24 -0
  81. package/dist/cjs/refresh-icon.cjs.entry.js.map +1 -0
  82. package/dist/cjs/register-component-f76b61a6.js +140 -0
  83. package/dist/cjs/register-component-f76b61a6.js.map +1 -0
  84. package/dist/cjs/scheduler-store-e9822441.js +254 -0
  85. package/dist/cjs/scheduler-store-e9822441.js.map +1 -0
  86. package/dist/cjs/translate-icon.cjs.entry.js +24 -0
  87. package/dist/cjs/translate-icon.cjs.entry.js.map +1 -0
  88. package/dist/cjs/utils-f91d4c73.js +161 -0
  89. package/dist/cjs/utils-f91d4c73.js.map +1 -0
  90. package/dist/collection/assets/icons/chevron.svg +3 -0
  91. package/dist/collection/collection-manifest.json +66 -0
  92. package/dist/collection/common/abstract-provider.js +231 -0
  93. package/dist/collection/common/abstract-provider.js.map +1 -0
  94. package/dist/collection/common/component-types.js +2 -0
  95. package/dist/collection/common/component-types.js.map +1 -0
  96. package/dist/collection/common/constants.js +12 -0
  97. package/dist/collection/common/constants.js.map +1 -0
  98. package/dist/collection/common/global.js +4 -0
  99. package/dist/collection/common/global.js.map +1 -0
  100. package/dist/collection/common/icons/archive.js +63 -0
  101. package/dist/collection/common/icons/archive.js.map +1 -0
  102. package/dist/collection/common/icons/arrow.js +63 -0
  103. package/dist/collection/common/icons/arrow.js.map +1 -0
  104. package/dist/collection/common/icons/bold.js +63 -0
  105. package/dist/collection/common/icons/bold.js.map +1 -0
  106. package/dist/collection/common/icons/calendar-cancel.js +63 -0
  107. package/dist/collection/common/icons/calendar-cancel.js.map +1 -0
  108. package/dist/collection/common/icons/calendar-check.js +63 -0
  109. package/dist/collection/common/icons/calendar-check.js.map +1 -0
  110. package/dist/collection/common/icons/calendar.js +63 -0
  111. package/dist/collection/common/icons/calendar.js.map +1 -0
  112. package/dist/collection/common/icons/checkmark-circle.js +63 -0
  113. package/dist/collection/common/icons/checkmark-circle.js.map +1 -0
  114. package/dist/collection/common/icons/chevron.js +63 -0
  115. package/dist/collection/common/icons/chevron.js.map +1 -0
  116. package/dist/collection/common/icons/close.js +63 -0
  117. package/dist/collection/common/icons/close.js.map +1 -0
  118. package/dist/collection/common/icons/document-refresh.js +63 -0
  119. package/dist/collection/common/icons/document-refresh.js.map +1 -0
  120. package/dist/collection/common/icons/folder.js +63 -0
  121. package/dist/collection/common/icons/folder.js.map +1 -0
  122. package/dist/collection/common/icons/forward.js +63 -0
  123. package/dist/collection/common/icons/forward.js.map +1 -0
  124. package/dist/collection/common/icons/globe.js +63 -0
  125. package/dist/collection/common/icons/globe.js.map +1 -0
  126. package/dist/collection/common/icons/icon.css +3 -0
  127. package/dist/collection/common/icons/inbox.js +63 -0
  128. package/dist/collection/common/icons/inbox.js.map +1 -0
  129. package/dist/collection/common/icons/italic.js +63 -0
  130. package/dist/collection/common/icons/italic.js.map +1 -0
  131. package/dist/collection/common/icons/loading.css +33 -0
  132. package/dist/collection/common/icons/loading.js +63 -0
  133. package/dist/collection/common/icons/loading.js.map +1 -0
  134. package/dist/collection/common/icons/nylas-logo.js +63 -0
  135. package/dist/collection/common/icons/nylas-logo.js.map +1 -0
  136. package/dist/collection/common/icons/people.js +63 -0
  137. package/dist/collection/common/icons/people.js.map +1 -0
  138. package/dist/collection/common/icons/play.js +63 -0
  139. package/dist/collection/common/icons/play.js.map +1 -0
  140. package/dist/collection/common/icons/refresh.js +63 -0
  141. package/dist/collection/common/icons/refresh.js.map +1 -0
  142. package/dist/collection/common/icons/reply-all.js +63 -0
  143. package/dist/collection/common/icons/reply-all.js.map +1 -0
  144. package/dist/collection/common/icons/reply.js +63 -0
  145. package/dist/collection/common/icons/reply.js.map +1 -0
  146. package/dist/collection/common/icons/sent.js +63 -0
  147. package/dist/collection/common/icons/sent.js.map +1 -0
  148. package/dist/collection/common/icons/spam.js +63 -0
  149. package/dist/collection/common/icons/spam.js.map +1 -0
  150. package/dist/collection/common/icons/star.js +63 -0
  151. package/dist/collection/common/icons/star.js.map +1 -0
  152. package/dist/collection/common/icons/stop.js +63 -0
  153. package/dist/collection/common/icons/stop.js.map +1 -0
  154. package/dist/collection/common/icons/translate.js +63 -0
  155. package/dist/collection/common/icons/translate.js.map +1 -0
  156. package/dist/collection/common/icons/trash.js +63 -0
  157. package/dist/collection/common/icons/trash.js.map +1 -0
  158. package/dist/collection/common/icons/underline.js +63 -0
  159. package/dist/collection/common/icons/underline.js.map +1 -0
  160. package/dist/collection/common/icons/warning.js +63 -0
  161. package/dist/collection/common/icons/warning.js.map +1 -0
  162. package/dist/collection/common/mocks/threads.js +57 -0
  163. package/dist/collection/common/mocks/threads.js.map +1 -0
  164. package/dist/collection/common/nylas-theme/index.js +4 -0
  165. package/dist/collection/common/nylas-theme/index.js.map +1 -0
  166. package/dist/collection/common/register-component.js +134 -0
  167. package/dist/collection/common/register-component.js.map +1 -0
  168. package/dist/collection/common/types.js +2 -0
  169. package/dist/collection/common/types.js.map +1 -0
  170. package/dist/collection/components/mailbox/nylas-composer/nylas-composer.css +89 -0
  171. package/dist/collection/components/mailbox/nylas-composer/nylas-composer.js +241 -0
  172. package/dist/collection/components/mailbox/nylas-composer/nylas-composer.js.map +1 -0
  173. package/dist/collection/components/mailbox/nylas-composer/test/nylas-composer.e2e.js +10 -0
  174. package/dist/collection/components/mailbox/nylas-composer/test/nylas-composer.e2e.js.map +1 -0
  175. package/dist/collection/components/mailbox/nylas-composer/test/nylas-composer.spec-disabled.js +12 -0
  176. package/dist/collection/components/mailbox/nylas-composer/test/nylas-composer.spec-disabled.js.map +1 -0
  177. package/dist/collection/components/mailbox/nylas-list-folders/nylas-list-folders.css +37 -0
  178. package/dist/collection/components/mailbox/nylas-list-folders/nylas-list-folders.js +193 -0
  179. package/dist/collection/components/mailbox/nylas-list-folders/nylas-list-folders.js.map +1 -0
  180. package/dist/collection/components/mailbox/nylas-list-folders/test/nylas-list-folders.e2e.js +10 -0
  181. package/dist/collection/components/mailbox/nylas-list-folders/test/nylas-list-folders.e2e.js.map +1 -0
  182. package/dist/collection/components/mailbox/nylas-list-folders/test/nylas-list-folders.spec.js +12 -0
  183. package/dist/collection/components/mailbox/nylas-list-folders/test/nylas-list-folders.spec.js.map +1 -0
  184. package/dist/collection/components/mailbox/nylas-list-threads/nylas-list-threads.css +156 -0
  185. package/dist/collection/components/mailbox/nylas-list-threads/nylas-list-threads.js +218 -0
  186. package/dist/collection/components/mailbox/nylas-list-threads/nylas-list-threads.js.map +1 -0
  187. package/dist/collection/components/mailbox/nylas-list-threads/test/nylas-list-threads.e2e.js +22 -0
  188. package/dist/collection/components/mailbox/nylas-list-threads/test/nylas-list-threads.e2e.js.map +1 -0
  189. package/dist/collection/components/mailbox/nylas-list-threads/test/nylas-list-threads.spec.js +25 -0
  190. package/dist/collection/components/mailbox/nylas-list-threads/test/nylas-list-threads.spec.js.map +1 -0
  191. package/dist/collection/components/mailbox/nylas-mailbox/nylas-mailbox.css +3 -0
  192. package/dist/collection/components/mailbox/nylas-mailbox/nylas-mailbox.js +474 -0
  193. package/dist/collection/components/mailbox/nylas-mailbox/nylas-mailbox.js.map +1 -0
  194. package/dist/collection/components/mailbox/nylas-mailbox/test/nylas-mailbox.e2e.js +16 -0
  195. package/dist/collection/components/mailbox/nylas-mailbox/test/nylas-mailbox.e2e.js.map +1 -0
  196. package/dist/collection/components/mailbox/nylas-mailbox/test/nylas-mailbox.spec.js +32 -0
  197. package/dist/collection/components/mailbox/nylas-mailbox/test/nylas-mailbox.spec.js.map +1 -0
  198. package/dist/collection/components/mailbox/nylas-mailbox-pagination/nylas-mailbox-pagination.css +55 -0
  199. package/dist/collection/components/mailbox/nylas-mailbox-pagination/nylas-mailbox-pagination.js +371 -0
  200. package/dist/collection/components/mailbox/nylas-mailbox-pagination/nylas-mailbox-pagination.js.map +1 -0
  201. package/dist/collection/components/mailbox/nylas-mailbox-pagination/test/nylas-mailbox-pagination.e2e.js +10 -0
  202. package/dist/collection/components/mailbox/nylas-mailbox-pagination/test/nylas-mailbox-pagination.e2e.js.map +1 -0
  203. package/dist/collection/components/mailbox/nylas-mailbox-pagination/test/nylas-mailbox-pagination.spec.js +12 -0
  204. package/dist/collection/components/mailbox/nylas-mailbox-pagination/test/nylas-mailbox-pagination.spec.js.map +1 -0
  205. package/dist/collection/components/mailbox/nylas-mailbox-toolbar-button/nylas-mailbox-toolbar-button.css +18 -0
  206. package/dist/collection/components/mailbox/nylas-mailbox-toolbar-button/nylas-mailbox-toolbar-button.js +182 -0
  207. package/dist/collection/components/mailbox/nylas-mailbox-toolbar-button/nylas-mailbox-toolbar-button.js.map +1 -0
  208. package/dist/collection/components/mailbox/nylas-summarize-message-button/nylas-summarize-message-button.css +61 -0
  209. package/dist/collection/components/mailbox/nylas-summarize-message-button/nylas-summarize-message-button.js +329 -0
  210. package/dist/collection/components/mailbox/nylas-summarize-message-button/nylas-summarize-message-button.js.map +1 -0
  211. package/dist/collection/components/mailbox/nylas-summarize-message-button/test/nylas-summarize-message-button.e2e.js +10 -0
  212. package/dist/collection/components/mailbox/nylas-summarize-message-button/test/nylas-summarize-message-button.e2e.js.map +1 -0
  213. package/dist/collection/components/mailbox/nylas-summarize-message-button/test/nylas-summarize-message-button.spec.js +12 -0
  214. package/dist/collection/components/mailbox/nylas-summarize-message-button/test/nylas-summarize-message-button.spec.js.map +1 -0
  215. package/dist/collection/components/mailbox/nylas-threads-refresh/nylas-threads-refresh.css +53 -0
  216. package/dist/collection/components/mailbox/nylas-threads-refresh/nylas-threads-refresh.js +172 -0
  217. package/dist/collection/components/mailbox/nylas-threads-refresh/nylas-threads-refresh.js.map +1 -0
  218. package/dist/collection/components/mailbox/nylas-threads-refresh/test/nylas-threads-refresh.e2e.js +10 -0
  219. package/dist/collection/components/mailbox/nylas-threads-refresh/test/nylas-threads-refresh.e2e.js.map +1 -0
  220. package/dist/collection/components/mailbox/nylas-threads-refresh/test/nylas-threads-refresh.spec.js +12 -0
  221. package/dist/collection/components/mailbox/nylas-threads-refresh/test/nylas-threads-refresh.spec.js.map +1 -0
  222. package/dist/collection/components/mailbox/nylas-threads-search/nylas-threads-search.css +8 -0
  223. package/dist/collection/components/mailbox/nylas-threads-search/nylas-threads-search.js +130 -0
  224. package/dist/collection/components/mailbox/nylas-threads-search/nylas-threads-search.js.map +1 -0
  225. package/dist/collection/components/mailbox/nylas-threads-search/test/nylas-threads-search.e2e.js +10 -0
  226. package/dist/collection/components/mailbox/nylas-threads-search/test/nylas-threads-search.e2e.js.map +1 -0
  227. package/dist/collection/components/mailbox/nylas-threads-search/test/nylas-threads-search.spec.js +12 -0
  228. package/dist/collection/components/mailbox/nylas-threads-search/test/nylas-threads-search.spec.js.map +1 -0
  229. package/dist/collection/components/mailbox/nylas-view-email/nylas-view-email.css +43 -0
  230. package/dist/collection/components/mailbox/nylas-view-email/nylas-view-email.js +282 -0
  231. package/dist/collection/components/mailbox/nylas-view-email/nylas-view-email.js.map +1 -0
  232. package/dist/collection/components/mailbox/nylas-view-thread/nylas-view-thread.css +243 -0
  233. package/dist/collection/components/mailbox/nylas-view-thread/nylas-view-thread.js +342 -0
  234. package/dist/collection/components/mailbox/nylas-view-thread/nylas-view-thread.js.map +1 -0
  235. package/dist/collection/components/mailbox/nylas-view-thread/view-thread-message.js +25 -0
  236. package/dist/collection/components/mailbox/nylas-view-thread/view-thread-message.js.map +1 -0
  237. package/dist/collection/components/nylas-if-state/nylas-if-state.css +84 -0
  238. package/dist/collection/components/nylas-if-state/nylas-if-state.js +241 -0
  239. package/dist/collection/components/nylas-if-state/nylas-if-state.js.map +1 -0
  240. package/dist/collection/components/nylas-if-state/test/nylas-if-state.e2e.js +10 -0
  241. package/dist/collection/components/nylas-if-state/test/nylas-if-state.e2e.js.map +1 -0
  242. package/dist/collection/components/nylas-if-state/test/nylas-if-state.spec.js +12 -0
  243. package/dist/collection/components/nylas-if-state/test/nylas-if-state.spec.js.map +1 -0
  244. package/dist/collection/components/nylas-login/nylas-login.css +94 -0
  245. package/dist/collection/components/nylas-login/nylas-login.js +289 -0
  246. package/dist/collection/components/nylas-login/nylas-login.js.map +1 -0
  247. package/dist/collection/components/nylas-login/test/nylas-login.e2e.js +10 -0
  248. package/dist/collection/components/nylas-login/test/nylas-login.e2e.js.map +1 -0
  249. package/dist/collection/components/nylas-login/test/nylas-login.spec.js +12 -0
  250. package/dist/collection/components/nylas-login/test/nylas-login.spec.js.map +1 -0
  251. package/dist/collection/components/nylas-provider/nylas-provider.css +3 -0
  252. package/dist/collection/components/nylas-provider/nylas-provider.js +423 -0
  253. package/dist/collection/components/nylas-provider/nylas-provider.js.map +1 -0
  254. package/dist/collection/components/nylas-provider/test/nylas-provider.e2e.js +10 -0
  255. package/dist/collection/components/nylas-provider/test/nylas-provider.e2e.js.map +1 -0
  256. package/dist/collection/components/nylas-provider/test/nylas-provider.spec.js +32 -0
  257. package/dist/collection/components/nylas-provider/test/nylas-provider.spec.js.map +1 -0
  258. package/dist/collection/components/scheduler/nylas-booked-event-card/nylas-booked-event-card.css +155 -0
  259. package/dist/collection/components/scheduler/nylas-booked-event-card/nylas-booked-event-card.js +178 -0
  260. package/dist/collection/components/scheduler/nylas-booked-event-card/nylas-booked-event-card.js.map +1 -0
  261. package/dist/collection/components/scheduler/nylas-booking-form/nylas-booking-form.css +129 -0
  262. package/dist/collection/components/scheduler/nylas-booking-form/nylas-booking-form.js +323 -0
  263. package/dist/collection/components/scheduler/nylas-booking-form/nylas-booking-form.js.map +1 -0
  264. package/dist/collection/components/scheduler/nylas-cancelled-event-card/nylas-cancelled-event-card.css +78 -0
  265. package/dist/collection/components/scheduler/nylas-cancelled-event-card/nylas-cancelled-event-card.js +107 -0
  266. package/dist/collection/components/scheduler/nylas-cancelled-event-card/nylas-cancelled-event-card.js.map +1 -0
  267. package/dist/collection/components/scheduler/nylas-date-picker/nylas-date-picker.css +150 -0
  268. package/dist/collection/components/scheduler/nylas-date-picker/nylas-date-picker.js +213 -0
  269. package/dist/collection/components/scheduler/nylas-date-picker/nylas-date-picker.js.map +1 -0
  270. package/dist/collection/components/scheduler/nylas-locale-switch/nylas-locale-switch.css +72 -0
  271. package/dist/collection/components/scheduler/nylas-locale-switch/nylas-locale-switch.js +147 -0
  272. package/dist/collection/components/scheduler/nylas-locale-switch/nylas-locale-switch.js.map +1 -0
  273. package/dist/collection/components/scheduler/nylas-notification/nylas-notification.css +63 -0
  274. package/dist/collection/components/scheduler/nylas-notification/nylas-notification.js +132 -0
  275. package/dist/collection/components/scheduler/nylas-notification/nylas-notification.js.map +1 -0
  276. package/dist/collection/components/scheduler/nylas-open-hours-picker/nylas-open-hours-picker.css +105 -0
  277. package/dist/collection/components/scheduler/nylas-open-hours-picker/nylas-open-hours-picker.js +460 -0
  278. package/dist/collection/components/scheduler/nylas-open-hours-picker/nylas-open-hours-picker.js.map +1 -0
  279. package/dist/collection/components/scheduler/nylas-open-hours-picker/test/nylas-open-hours-picker.e2e.js +10 -0
  280. package/dist/collection/components/scheduler/nylas-open-hours-picker/test/nylas-open-hours-picker.e2e.js.map +1 -0
  281. package/dist/collection/components/scheduler/nylas-open-hours-picker/test/nylas-open-hours-picker.spec.js +12 -0
  282. package/dist/collection/components/scheduler/nylas-open-hours-picker/test/nylas-open-hours-picker.spec.js.map +1 -0
  283. package/dist/collection/components/scheduler/nylas-scheduler/nylas-scheduler.css +182 -0
  284. package/dist/collection/components/scheduler/nylas-scheduler/nylas-scheduler.js +533 -0
  285. package/dist/collection/components/scheduler/nylas-scheduler/nylas-scheduler.js.map +1 -0
  286. package/dist/collection/components/scheduler/nylas-scheduler/scheduler-view.js +6 -0
  287. package/dist/collection/components/scheduler/nylas-scheduler/scheduler-view.js.map +1 -0
  288. package/dist/collection/components/scheduler/nylas-selected-event-card/nylas-selected-event-card.css +63 -0
  289. package/dist/collection/components/scheduler/nylas-selected-event-card/nylas-selected-event-card.js +150 -0
  290. package/dist/collection/components/scheduler/nylas-selected-event-card/nylas-selected-event-card.js.map +1 -0
  291. package/dist/collection/components/scheduler/nylas-timeslot-picker/nylas-timeslot-picker.css +115 -0
  292. package/dist/collection/components/scheduler/nylas-timeslot-picker/nylas-timeslot-picker.js +311 -0
  293. package/dist/collection/components/scheduler/nylas-timeslot-picker/nylas-timeslot-picker.js.map +1 -0
  294. package/dist/collection/connector/connector-interface.js +2 -0
  295. package/dist/collection/connector/connector-interface.js.map +1 -0
  296. package/dist/collection/connector/nylas-connector/index.js +78 -0
  297. package/dist/collection/connector/nylas-connector/index.js.map +1 -0
  298. package/dist/collection/connector/nylas-mailbox-connector/index.js +62 -0
  299. package/dist/collection/connector/nylas-mailbox-connector/index.js.map +1 -0
  300. package/dist/collection/connector/nylas-scheduler-connector/index.js +43 -0
  301. package/dist/collection/connector/nylas-scheduler-connector/index.js.map +1 -0
  302. package/dist/collection/connector/shared/api/auth.js +60 -0
  303. package/dist/collection/connector/shared/api/auth.js.map +1 -0
  304. package/dist/collection/connector/shared/api/folders.js +33 -0
  305. package/dist/collection/connector/shared/api/folders.js.map +1 -0
  306. package/dist/collection/connector/shared/api/messages.js +95 -0
  307. package/dist/collection/connector/shared/api/messages.js.map +1 -0
  308. package/dist/collection/connector/shared/api/scheduler.js +203 -0
  309. package/dist/collection/connector/shared/api/scheduler.js.map +1 -0
  310. package/dist/collection/connector/shared/api/threads.js +165 -0
  311. package/dist/collection/connector/shared/api/threads.js.map +1 -0
  312. package/dist/collection/index.js +4 -0
  313. package/dist/collection/index.js.map +1 -0
  314. package/dist/collection/routers/hash-router.js +109 -0
  315. package/dist/collection/routers/hash-router.js.map +1 -0
  316. package/dist/collection/routers/router-interface.js +2 -0
  317. package/dist/collection/routers/router-interface.js.map +1 -0
  318. package/dist/collection/stores/auth-store.js +18 -0
  319. package/dist/collection/stores/auth-store.js.map +1 -0
  320. package/dist/collection/stores/mailbox-store.js +42 -0
  321. package/dist/collection/stores/mailbox-store.js.map +1 -0
  322. package/dist/collection/stores/scheduler-store.js +44 -0
  323. package/dist/collection/stores/scheduler-store.js.map +1 -0
  324. package/dist/collection/utils/color-utils.js +161 -0
  325. package/dist/collection/utils/color-utils.js.map +1 -0
  326. package/dist/collection/utils/utils.js +157 -0
  327. package/dist/collection/utils/utils.js.map +1 -0
  328. package/dist/collection/utils/utils.spec.js +16 -0
  329. package/dist/collection/utils/utils.spec.js.map +1 -0
  330. package/dist/components/_commonjsHelpers.js +20 -0
  331. package/dist/components/_commonjsHelpers.js.map +1 -0
  332. package/dist/components/archive-icon.d.ts +11 -0
  333. package/dist/components/archive-icon.js +8 -0
  334. package/dist/components/archive-icon.js.map +1 -0
  335. package/dist/components/archive.js +37 -0
  336. package/dist/components/archive.js.map +1 -0
  337. package/dist/components/arrow-icon.d.ts +11 -0
  338. package/dist/components/arrow-icon.js +8 -0
  339. package/dist/components/arrow-icon.js.map +1 -0
  340. package/dist/components/arrow.js +37 -0
  341. package/dist/components/arrow.js.map +1 -0
  342. package/dist/components/assets/chevron.svg +3 -0
  343. package/dist/components/bold-icon.d.ts +11 -0
  344. package/dist/components/bold-icon.js +8 -0
  345. package/dist/components/bold-icon.js.map +1 -0
  346. package/dist/components/bold.js +37 -0
  347. package/dist/components/bold.js.map +1 -0
  348. package/dist/components/calendar-cancel-icon.d.ts +11 -0
  349. package/dist/components/calendar-cancel-icon.js +8 -0
  350. package/dist/components/calendar-cancel-icon.js.map +1 -0
  351. package/dist/components/calendar-cancel.js +37 -0
  352. package/dist/components/calendar-cancel.js.map +1 -0
  353. package/dist/components/calendar-check-icon.d.ts +11 -0
  354. package/dist/components/calendar-check-icon.js +8 -0
  355. package/dist/components/calendar-check-icon.js.map +1 -0
  356. package/dist/components/calendar-check.js +37 -0
  357. package/dist/components/calendar-check.js.map +1 -0
  358. package/dist/components/calendar-icon.d.ts +11 -0
  359. package/dist/components/calendar-icon.js +8 -0
  360. package/dist/components/calendar-icon.js.map +1 -0
  361. package/dist/components/calendar.js +37 -0
  362. package/dist/components/calendar.js.map +1 -0
  363. package/dist/components/checkmark-circle-icon.d.ts +11 -0
  364. package/dist/components/checkmark-circle-icon.js +8 -0
  365. package/dist/components/checkmark-circle-icon.js.map +1 -0
  366. package/dist/components/checkmark-circle.js +37 -0
  367. package/dist/components/checkmark-circle.js.map +1 -0
  368. package/dist/components/chevron-icon.d.ts +11 -0
  369. package/dist/components/chevron-icon.js +8 -0
  370. package/dist/components/chevron-icon.js.map +1 -0
  371. package/dist/components/chevron.js +37 -0
  372. package/dist/components/chevron.js.map +1 -0
  373. package/dist/components/close-icon.d.ts +11 -0
  374. package/dist/components/close-icon.js +8 -0
  375. package/dist/components/close-icon.js.map +1 -0
  376. package/dist/components/close.js +37 -0
  377. package/dist/components/close.js.map +1 -0
  378. package/dist/components/constants.js +7296 -0
  379. package/dist/components/constants.js.map +1 -0
  380. package/dist/components/define-element.js +40 -0
  381. package/dist/components/define-element.js.map +1 -0
  382. package/dist/components/document-refresh-icon.d.ts +11 -0
  383. package/dist/components/document-refresh-icon.js +40 -0
  384. package/dist/components/document-refresh-icon.js.map +1 -0
  385. package/dist/components/duration.js +78 -0
  386. package/dist/components/duration.js.map +1 -0
  387. package/dist/components/elements.js +21583 -0
  388. package/dist/components/elements.js.map +1 -0
  389. package/dist/components/flow.js +888 -0
  390. package/dist/components/flow.js.map +1 -0
  391. package/dist/components/focus-visible.js +325 -0
  392. package/dist/components/focus-visible.js.map +1 -0
  393. package/dist/components/folder-icon.d.ts +11 -0
  394. package/dist/components/folder-icon.js +8 -0
  395. package/dist/components/folder-icon.js.map +1 -0
  396. package/dist/components/folder.js +37 -0
  397. package/dist/components/folder.js.map +1 -0
  398. package/dist/components/forward-icon.d.ts +11 -0
  399. package/dist/components/forward-icon.js +8 -0
  400. package/dist/components/forward-icon.js.map +1 -0
  401. package/dist/components/forward.js +37 -0
  402. package/dist/components/forward.js.map +1 -0
  403. package/dist/components/globe-icon.d.ts +11 -0
  404. package/dist/components/globe-icon.js +8 -0
  405. package/dist/components/globe-icon.js.map +1 -0
  406. package/dist/components/globe.js +37 -0
  407. package/dist/components/globe.js.map +1 -0
  408. package/dist/components/inbox-icon.d.ts +11 -0
  409. package/dist/components/inbox-icon.js +8 -0
  410. package/dist/components/inbox-icon.js.map +1 -0
  411. package/dist/components/inbox.js +37 -0
  412. package/dist/components/inbox.js.map +1 -0
  413. package/dist/components/index.d.ts +33 -0
  414. package/dist/components/index.es.js +3211 -0
  415. package/dist/components/index.es.js.map +1 -0
  416. package/dist/components/index.js +16 -0
  417. package/dist/components/index.js.map +1 -0
  418. package/dist/components/index2.js +196 -0
  419. package/dist/components/index2.js.map +1 -0
  420. package/dist/components/italic-icon.d.ts +11 -0
  421. package/dist/components/italic-icon.js +8 -0
  422. package/dist/components/italic-icon.js.map +1 -0
  423. package/dist/components/italic.js +37 -0
  424. package/dist/components/italic.js.map +1 -0
  425. package/dist/components/loading-icon.d.ts +11 -0
  426. package/dist/components/loading-icon.js +8 -0
  427. package/dist/components/loading-icon.js.map +1 -0
  428. package/dist/components/loading.js +38 -0
  429. package/dist/components/loading.js.map +1 -0
  430. package/dist/components/mailbox-store.js +521 -0
  431. package/dist/components/mailbox-store.js.map +1 -0
  432. package/dist/components/nylas-booked-event-card.d.ts +11 -0
  433. package/dist/components/nylas-booked-event-card.js +8 -0
  434. package/dist/components/nylas-booked-event-card.js.map +1 -0
  435. package/dist/components/nylas-booked-event-card2.js +121 -0
  436. package/dist/components/nylas-booked-event-card2.js.map +1 -0
  437. package/dist/components/nylas-booking-form.d.ts +11 -0
  438. package/dist/components/nylas-booking-form.js +8 -0
  439. package/dist/components/nylas-booking-form.js.map +1 -0
  440. package/dist/components/nylas-booking-form2.js +224 -0
  441. package/dist/components/nylas-booking-form2.js.map +1 -0
  442. package/dist/components/nylas-cancelled-event-card.d.ts +11 -0
  443. package/dist/components/nylas-cancelled-event-card.js +8 -0
  444. package/dist/components/nylas-cancelled-event-card.js.map +1 -0
  445. package/dist/components/nylas-cancelled-event-card2.js +85 -0
  446. package/dist/components/nylas-cancelled-event-card2.js.map +1 -0
  447. package/dist/components/nylas-composer.d.ts +11 -0
  448. package/dist/components/nylas-composer.js +8 -0
  449. package/dist/components/nylas-composer.js.map +1 -0
  450. package/dist/components/nylas-composer2.js +186 -0
  451. package/dist/components/nylas-composer2.js.map +1 -0
  452. package/dist/components/nylas-date-picker.d.ts +11 -0
  453. package/dist/components/nylas-date-picker.js +8 -0
  454. package/dist/components/nylas-date-picker.js.map +1 -0
  455. package/dist/components/nylas-date-picker2.js +150 -0
  456. package/dist/components/nylas-date-picker2.js.map +1 -0
  457. package/dist/components/nylas-if-state.d.ts +11 -0
  458. package/dist/components/nylas-if-state.js +153 -0
  459. package/dist/components/nylas-if-state.js.map +1 -0
  460. package/dist/components/nylas-list-folders.d.ts +11 -0
  461. package/dist/components/nylas-list-folders.js +183 -0
  462. package/dist/components/nylas-list-folders.js.map +1 -0
  463. package/dist/components/nylas-list-threads.d.ts +11 -0
  464. package/dist/components/nylas-list-threads.js +109 -0
  465. package/dist/components/nylas-list-threads.js.map +1 -0
  466. package/dist/components/nylas-locale-switch.d.ts +11 -0
  467. package/dist/components/nylas-locale-switch.js +8 -0
  468. package/dist/components/nylas-locale-switch.js.map +1 -0
  469. package/dist/components/nylas-locale-switch2.js +103 -0
  470. package/dist/components/nylas-locale-switch2.js.map +1 -0
  471. package/dist/components/nylas-login.d.ts +11 -0
  472. package/dist/components/nylas-login.js +127 -0
  473. package/dist/components/nylas-login.js.map +1 -0
  474. package/dist/components/nylas-logo.d.ts +11 -0
  475. package/dist/components/nylas-logo.js +8 -0
  476. package/dist/components/nylas-logo.js.map +1 -0
  477. package/dist/components/nylas-logo2.js +37 -0
  478. package/dist/components/nylas-logo2.js.map +1 -0
  479. package/dist/components/nylas-mailbox-pagination.d.ts +11 -0
  480. package/dist/components/nylas-mailbox-pagination.js +175 -0
  481. package/dist/components/nylas-mailbox-pagination.js.map +1 -0
  482. package/dist/components/nylas-mailbox-toolbar-button.d.ts +11 -0
  483. package/dist/components/nylas-mailbox-toolbar-button.js +119 -0
  484. package/dist/components/nylas-mailbox-toolbar-button.js.map +1 -0
  485. package/dist/components/nylas-mailbox.d.ts +11 -0
  486. package/dist/components/nylas-mailbox.js +219 -0
  487. package/dist/components/nylas-mailbox.js.map +1 -0
  488. package/dist/components/nylas-notification.d.ts +11 -0
  489. package/dist/components/nylas-notification.js +8 -0
  490. package/dist/components/nylas-notification.js.map +1 -0
  491. package/dist/components/nylas-notification2.js +90 -0
  492. package/dist/components/nylas-notification2.js.map +1 -0
  493. package/dist/components/nylas-open-hours-picker.d.ts +11 -0
  494. package/dist/components/nylas-open-hours-picker.js +365 -0
  495. package/dist/components/nylas-open-hours-picker.js.map +1 -0
  496. package/dist/components/nylas-provider.d.ts +11 -0
  497. package/dist/components/nylas-provider.js +206 -0
  498. package/dist/components/nylas-provider.js.map +1 -0
  499. package/dist/components/nylas-scheduler.d.ts +11 -0
  500. package/dist/components/nylas-scheduler.js +392 -0
  501. package/dist/components/nylas-scheduler.js.map +1 -0
  502. package/dist/components/nylas-selected-event-card.d.ts +11 -0
  503. package/dist/components/nylas-selected-event-card.js +8 -0
  504. package/dist/components/nylas-selected-event-card.js.map +1 -0
  505. package/dist/components/nylas-selected-event-card2.js +110 -0
  506. package/dist/components/nylas-selected-event-card2.js.map +1 -0
  507. package/dist/components/nylas-summarize-message-button.d.ts +11 -0
  508. package/dist/components/nylas-summarize-message-button.js +8 -0
  509. package/dist/components/nylas-summarize-message-button.js.map +1 -0
  510. package/dist/components/nylas-summarize-message-button2.js +233 -0
  511. package/dist/components/nylas-summarize-message-button2.js.map +1 -0
  512. package/dist/components/nylas-threads-refresh.d.ts +11 -0
  513. package/dist/components/nylas-threads-refresh.js +149 -0
  514. package/dist/components/nylas-threads-refresh.js.map +1 -0
  515. package/dist/components/nylas-threads-search.d.ts +11 -0
  516. package/dist/components/nylas-threads-search.js +103 -0
  517. package/dist/components/nylas-threads-search.js.map +1 -0
  518. package/dist/components/nylas-timeslot-picker.d.ts +11 -0
  519. package/dist/components/nylas-timeslot-picker.js +8 -0
  520. package/dist/components/nylas-timeslot-picker.js.map +1 -0
  521. package/dist/components/nylas-timeslot-picker2.js +174 -0
  522. package/dist/components/nylas-timeslot-picker2.js.map +1 -0
  523. package/dist/components/nylas-view-email.d.ts +11 -0
  524. package/dist/components/nylas-view-email.js +8 -0
  525. package/dist/components/nylas-view-email.js.map +1 -0
  526. package/dist/components/nylas-view-email2.js +1859 -0
  527. package/dist/components/nylas-view-email2.js.map +1 -0
  528. package/dist/components/nylas-view-thread.d.ts +11 -0
  529. package/dist/components/nylas-view-thread.js +338 -0
  530. package/dist/components/nylas-view-thread.js.map +1 -0
  531. package/dist/components/people-icon.d.ts +11 -0
  532. package/dist/components/people-icon.js +8 -0
  533. package/dist/components/people-icon.js.map +1 -0
  534. package/dist/components/people.js +37 -0
  535. package/dist/components/people.js.map +1 -0
  536. package/dist/components/play-icon.d.ts +11 -0
  537. package/dist/components/play-icon.js +8 -0
  538. package/dist/components/play-icon.js.map +1 -0
  539. package/dist/components/play.js +37 -0
  540. package/dist/components/play.js.map +1 -0
  541. package/dist/components/property.js +36 -0
  542. package/dist/components/property.js.map +1 -0
  543. package/dist/components/refresh-icon.d.ts +11 -0
  544. package/dist/components/refresh-icon.js +8 -0
  545. package/dist/components/refresh-icon.js.map +1 -0
  546. package/dist/components/refresh.js +37 -0
  547. package/dist/components/refresh.js.map +1 -0
  548. package/dist/components/register-component.js +138 -0
  549. package/dist/components/register-component.js.map +1 -0
  550. package/dist/components/reply-all-icon.d.ts +11 -0
  551. package/dist/components/reply-all-icon.js +8 -0
  552. package/dist/components/reply-all-icon.js.map +1 -0
  553. package/dist/components/reply-all.js +37 -0
  554. package/dist/components/reply-all.js.map +1 -0
  555. package/dist/components/reply-icon.d.ts +11 -0
  556. package/dist/components/reply-icon.js +8 -0
  557. package/dist/components/reply-icon.js.map +1 -0
  558. package/dist/components/reply.js +37 -0
  559. package/dist/components/reply.js.map +1 -0
  560. package/dist/components/scheduler-store.js +251 -0
  561. package/dist/components/scheduler-store.js.map +1 -0
  562. package/dist/components/sent-icon.d.ts +11 -0
  563. package/dist/components/sent-icon.js +8 -0
  564. package/dist/components/sent-icon.js.map +1 -0
  565. package/dist/components/sent.js +37 -0
  566. package/dist/components/sent.js.map +1 -0
  567. package/dist/components/sp-icon-chevron-left.js +23 -0
  568. package/dist/components/sp-icon-chevron-left.js.map +1 -0
  569. package/dist/components/spam-icon.d.ts +11 -0
  570. package/dist/components/spam-icon.js +8 -0
  571. package/dist/components/spam-icon.js.map +1 -0
  572. package/dist/components/spam.js +37 -0
  573. package/dist/components/spam.js.map +1 -0
  574. package/dist/components/star-icon.d.ts +11 -0
  575. package/dist/components/star-icon.js +8 -0
  576. package/dist/components/star-icon.js.map +1 -0
  577. package/dist/components/star.js +37 -0
  578. package/dist/components/star.js.map +1 -0
  579. package/dist/components/stop-icon.d.ts +11 -0
  580. package/dist/components/stop-icon.js +8 -0
  581. package/dist/components/stop-icon.js.map +1 -0
  582. package/dist/components/stop.js +37 -0
  583. package/dist/components/stop.js.map +1 -0
  584. package/dist/components/translate-icon.d.ts +11 -0
  585. package/dist/components/translate-icon.js +8 -0
  586. package/dist/components/translate-icon.js.map +1 -0
  587. package/dist/components/translate.js +37 -0
  588. package/dist/components/translate.js.map +1 -0
  589. package/dist/components/trash-icon.d.ts +11 -0
  590. package/dist/components/trash-icon.js +8 -0
  591. package/dist/components/trash-icon.js.map +1 -0
  592. package/dist/components/trash.js +37 -0
  593. package/dist/components/trash.js.map +1 -0
  594. package/dist/components/underline-icon.d.ts +11 -0
  595. package/dist/components/underline-icon.js +8 -0
  596. package/dist/components/underline-icon.js.map +1 -0
  597. package/dist/components/underline.js +37 -0
  598. package/dist/components/underline.js.map +1 -0
  599. package/dist/components/utils.js +140 -0
  600. package/dist/components/utils.js.map +1 -0
  601. package/dist/components/warning-icon.d.ts +11 -0
  602. package/dist/components/warning-icon.js +8 -0
  603. package/dist/components/warning-icon.js.map +1 -0
  604. package/dist/components/warning.js +37 -0
  605. package/dist/components/warning.js.map +1 -0
  606. package/dist/esm/_commonjsHelpers-57e89916.js +20 -0
  607. package/dist/esm/_commonjsHelpers-57e89916.js.map +1 -0
  608. package/dist/esm/app-globals-47969cee.js +9 -0
  609. package/dist/esm/app-globals-47969cee.js.map +1 -0
  610. package/dist/esm/archive-icon_7.entry.js +110 -0
  611. package/dist/esm/archive-icon_7.entry.js.map +1 -0
  612. package/dist/esm/arrow-icon.entry.js +20 -0
  613. package/dist/esm/arrow-icon.entry.js.map +1 -0
  614. package/dist/esm/bold-icon_3.entry.js +50 -0
  615. package/dist/esm/bold-icon_3.entry.js.map +1 -0
  616. package/dist/esm/calendar-cancel-icon.entry.js +20 -0
  617. package/dist/esm/calendar-cancel-icon.entry.js.map +1 -0
  618. package/dist/esm/calendar-check-icon_3.entry.js +50 -0
  619. package/dist/esm/calendar-check-icon_3.entry.js.map +1 -0
  620. package/dist/esm/calendar-icon.entry.js +20 -0
  621. package/dist/esm/calendar-icon.entry.js.map +1 -0
  622. package/dist/esm/chevron-icon.entry.js +20 -0
  623. package/dist/esm/chevron-icon.entry.js.map +1 -0
  624. package/dist/esm/close-icon_2.entry.js +35 -0
  625. package/dist/esm/close-icon_2.entry.js.map +1 -0
  626. package/dist/esm/document-refresh-icon.entry.js +20 -0
  627. package/dist/esm/document-refresh-icon.entry.js.map +1 -0
  628. package/dist/esm/duration-bddc4a13.js +78 -0
  629. package/dist/esm/duration-bddc4a13.js.map +1 -0
  630. package/dist/esm/elements-60ebdb01.js +21583 -0
  631. package/dist/esm/elements-60ebdb01.js.map +1 -0
  632. package/dist/esm/flow-40ff9cea.js +888 -0
  633. package/dist/esm/flow-40ff9cea.js.map +1 -0
  634. package/dist/esm/focus-visible-e8093c16.js +325 -0
  635. package/dist/esm/focus-visible-e8093c16.js.map +1 -0
  636. package/dist/esm/forward-icon_6.entry.js +2207 -0
  637. package/dist/esm/forward-icon_6.entry.js.map +1 -0
  638. package/dist/esm/globe-icon.entry.js +20 -0
  639. package/dist/esm/globe-icon.entry.js.map +1 -0
  640. package/dist/esm/index-2b85580a.js +196 -0
  641. package/dist/esm/index-2b85580a.js.map +1 -0
  642. package/dist/esm/index-b2270b4a.js +2141 -0
  643. package/dist/esm/index-b2270b4a.js.map +1 -0
  644. package/dist/esm/index.es-6f3582a1.js +3211 -0
  645. package/dist/esm/index.es-6f3582a1.js.map +1 -0
  646. package/dist/esm/index.js +8 -0
  647. package/dist/esm/index.js.map +1 -0
  648. package/dist/esm/loader.js +13 -0
  649. package/dist/esm/loader.js.map +1 -0
  650. package/dist/esm/loading-icon.entry.js +20 -0
  651. package/dist/esm/loading-icon.entry.js.map +1 -0
  652. package/dist/esm/mailbox-store-0019772c.js +521 -0
  653. package/dist/esm/mailbox-store-0019772c.js.map +1 -0
  654. package/dist/esm/nylas-booked-event-card_9.entry.js +8115 -0
  655. package/dist/esm/nylas-booked-event-card_9.entry.js.map +1 -0
  656. package/dist/esm/nylas-if-state_3.entry.js +403 -0
  657. package/dist/esm/nylas-if-state_3.entry.js.map +1 -0
  658. package/dist/esm/nylas-list-folders.entry.js +116 -0
  659. package/dist/esm/nylas-list-folders.entry.js.map +1 -0
  660. package/dist/esm/nylas-list-threads.entry.js +85 -0
  661. package/dist/esm/nylas-list-threads.entry.js.map +1 -0
  662. package/dist/esm/nylas-mailbox-pagination.entry.js +136 -0
  663. package/dist/esm/nylas-mailbox-pagination.entry.js.map +1 -0
  664. package/dist/esm/nylas-mailbox-toolbar-button.entry.js +96 -0
  665. package/dist/esm/nylas-mailbox-toolbar-button.entry.js.map +1 -0
  666. package/dist/esm/nylas-open-hours-picker.entry.js +329 -0
  667. package/dist/esm/nylas-open-hours-picker.entry.js.map +1 -0
  668. package/dist/esm/nylas-provider.entry.js +180 -0
  669. package/dist/esm/nylas-provider.entry.js.map +1 -0
  670. package/dist/esm/nylas-scheduler.entry.js +238 -0
  671. package/dist/esm/nylas-scheduler.entry.js.map +1 -0
  672. package/dist/esm/nylas-threads-refresh.entry.js +114 -0
  673. package/dist/esm/nylas-threads-refresh.entry.js.map +1 -0
  674. package/dist/esm/nylas-threads-search.entry.js +80 -0
  675. package/dist/esm/nylas-threads-search.entry.js.map +1 -0
  676. package/dist/esm/nylas-view-thread.entry.js +230 -0
  677. package/dist/esm/nylas-view-thread.entry.js.map +1 -0
  678. package/dist/esm/nylas-web-elements.js +22 -0
  679. package/dist/esm/nylas-web-elements.js.map +1 -0
  680. package/dist/esm/play-icon_2.entry.js +35 -0
  681. package/dist/esm/play-icon_2.entry.js.map +1 -0
  682. package/dist/esm/polyfills/core-js.js +11 -0
  683. package/dist/esm/polyfills/dom.js +79 -0
  684. package/dist/esm/polyfills/es5-html-element.js +1 -0
  685. package/dist/esm/polyfills/index.js +34 -0
  686. package/dist/esm/polyfills/system.js +6 -0
  687. package/dist/esm/property-0065dde7.js +36 -0
  688. package/dist/esm/property-0065dde7.js.map +1 -0
  689. package/dist/esm/refresh-icon.entry.js +20 -0
  690. package/dist/esm/refresh-icon.entry.js.map +1 -0
  691. package/dist/esm/register-component-55376f31.js +138 -0
  692. package/dist/esm/register-component-55376f31.js.map +1 -0
  693. package/dist/esm/scheduler-store-5a39585a.js +251 -0
  694. package/dist/esm/scheduler-store-5a39585a.js.map +1 -0
  695. package/dist/esm/translate-icon.entry.js +20 -0
  696. package/dist/esm/translate-icon.entry.js.map +1 -0
  697. package/dist/esm/utils-5074a070.js +140 -0
  698. package/dist/esm/utils-5074a070.js.map +1 -0
  699. package/dist/index.cjs.js +1 -0
  700. package/dist/index.js +1 -0
  701. package/dist/nylas-web-elements/index.esm.js +2 -0
  702. package/dist/nylas-web-elements/index.esm.js.map +1 -0
  703. package/dist/nylas-web-elements/nylas-web-elements.css +239 -0
  704. package/dist/nylas-web-elements/nylas-web-elements.esm.js +2 -0
  705. package/dist/nylas-web-elements/nylas-web-elements.esm.js.map +1 -0
  706. package/dist/nylas-web-elements/p-06974d68.js +2 -0
  707. package/dist/nylas-web-elements/p-06974d68.js.map +1 -0
  708. package/dist/nylas-web-elements/p-113fe52e.entry.js +2 -0
  709. package/dist/nylas-web-elements/p-113fe52e.entry.js.map +1 -0
  710. package/dist/nylas-web-elements/p-16fb3c85.entry.js +2 -0
  711. package/dist/nylas-web-elements/p-16fb3c85.entry.js.map +1 -0
  712. package/dist/nylas-web-elements/p-24c42c37.entry.js +2 -0
  713. package/dist/nylas-web-elements/p-24c42c37.entry.js.map +1 -0
  714. package/dist/nylas-web-elements/p-2881b62f.js +16519 -0
  715. package/dist/nylas-web-elements/p-2881b62f.js.map +1 -0
  716. package/dist/nylas-web-elements/p-33da6cf1.entry.js +2 -0
  717. package/dist/nylas-web-elements/p-33da6cf1.entry.js.map +1 -0
  718. package/dist/nylas-web-elements/p-37f99b96.entry.js +2 -0
  719. package/dist/nylas-web-elements/p-37f99b96.entry.js.map +1 -0
  720. package/dist/nylas-web-elements/p-3bc3426e.entry.js +2 -0
  721. package/dist/nylas-web-elements/p-3bc3426e.entry.js.map +1 -0
  722. package/dist/nylas-web-elements/p-3c8822f1.entry.js +2 -0
  723. package/dist/nylas-web-elements/p-3c8822f1.entry.js.map +1 -0
  724. package/dist/nylas-web-elements/p-5770704d.js +2 -0
  725. package/dist/nylas-web-elements/p-5770704d.js.map +1 -0
  726. package/dist/nylas-web-elements/p-5862975b.js +2 -0
  727. package/dist/nylas-web-elements/p-5862975b.js.map +1 -0
  728. package/dist/nylas-web-elements/p-647cf7be.entry.js +2 -0
  729. package/dist/nylas-web-elements/p-647cf7be.entry.js.map +1 -0
  730. package/dist/nylas-web-elements/p-663edeb8.entry.js +2 -0
  731. package/dist/nylas-web-elements/p-663edeb8.entry.js.map +1 -0
  732. package/dist/nylas-web-elements/p-67c9158e.entry.js +2 -0
  733. package/dist/nylas-web-elements/p-67c9158e.entry.js.map +1 -0
  734. package/dist/nylas-web-elements/p-6ba7a037.js +2 -0
  735. package/dist/nylas-web-elements/p-6ba7a037.js.map +1 -0
  736. package/dist/nylas-web-elements/p-6da0b8f0.entry.js +2 -0
  737. package/dist/nylas-web-elements/p-6da0b8f0.entry.js.map +1 -0
  738. package/dist/nylas-web-elements/p-6df00ba0.js +27 -0
  739. package/dist/nylas-web-elements/p-6df00ba0.js.map +1 -0
  740. package/dist/nylas-web-elements/p-74141ef6.entry.js +2 -0
  741. package/dist/nylas-web-elements/p-74141ef6.entry.js.map +1 -0
  742. package/dist/nylas-web-elements/p-85d41197.entry.js +2 -0
  743. package/dist/nylas-web-elements/p-85d41197.entry.js.map +1 -0
  744. package/dist/nylas-web-elements/p-97518578.entry.js +2 -0
  745. package/dist/nylas-web-elements/p-97518578.entry.js.map +1 -0
  746. package/dist/nylas-web-elements/p-98ec4a7a.js +2 -0
  747. package/dist/nylas-web-elements/p-98ec4a7a.js.map +1 -0
  748. package/dist/nylas-web-elements/p-998d25d5.entry.js +2 -0
  749. package/dist/nylas-web-elements/p-998d25d5.entry.js.map +1 -0
  750. package/dist/nylas-web-elements/p-a7bfd3af.entry.js +77 -0
  751. package/dist/nylas-web-elements/p-a7bfd3af.entry.js.map +1 -0
  752. package/dist/nylas-web-elements/p-a95208c7.js +2 -0
  753. package/dist/nylas-web-elements/p-a95208c7.js.map +1 -0
  754. package/dist/nylas-web-elements/p-adacdaeb.entry.js +2 -0
  755. package/dist/nylas-web-elements/p-adacdaeb.entry.js.map +1 -0
  756. package/dist/nylas-web-elements/p-b7d4b7b5.entry.js +2 -0
  757. package/dist/nylas-web-elements/p-b7d4b7b5.entry.js.map +1 -0
  758. package/dist/nylas-web-elements/p-b85dfeac.entry.js +2 -0
  759. package/dist/nylas-web-elements/p-b85dfeac.entry.js.map +1 -0
  760. package/dist/nylas-web-elements/p-b96b37f1.entry.js +2 -0
  761. package/dist/nylas-web-elements/p-b96b37f1.entry.js.map +1 -0
  762. package/dist/nylas-web-elements/p-c2e69618.entry.js +2 -0
  763. package/dist/nylas-web-elements/p-c2e69618.entry.js.map +1 -0
  764. package/dist/nylas-web-elements/p-c440f148.entry.js +2 -0
  765. package/dist/nylas-web-elements/p-c440f148.entry.js.map +1 -0
  766. package/dist/nylas-web-elements/p-c66e27d0.js +3 -0
  767. package/dist/nylas-web-elements/p-c66e27d0.js.map +1 -0
  768. package/dist/nylas-web-elements/p-c685e944.entry.js +3 -0
  769. package/dist/nylas-web-elements/p-c685e944.entry.js.map +1 -0
  770. package/dist/nylas-web-elements/p-cb65c223.js +2 -0
  771. package/dist/nylas-web-elements/p-cb65c223.js.map +1 -0
  772. package/dist/nylas-web-elements/p-cc21d351.js +17 -0
  773. package/dist/nylas-web-elements/p-cc21d351.js.map +1 -0
  774. package/dist/nylas-web-elements/p-d4b1e3e4.entry.js +2 -0
  775. package/dist/nylas-web-elements/p-d4b1e3e4.entry.js.map +1 -0
  776. package/dist/nylas-web-elements/p-db24cc70.entry.js +2 -0
  777. package/dist/nylas-web-elements/p-db24cc70.entry.js.map +1 -0
  778. package/dist/nylas-web-elements/p-de1bcc4a.js +2 -0
  779. package/dist/nylas-web-elements/p-de1bcc4a.js.map +1 -0
  780. package/dist/nylas-web-elements/p-df9f71ea.js +2 -0
  781. package/dist/nylas-web-elements/p-df9f71ea.js.map +1 -0
  782. package/dist/nylas-web-elements/p-eeb0a591.js +2 -0
  783. package/dist/nylas-web-elements/p-eeb0a591.js.map +1 -0
  784. package/dist/nylas-web-elements/p-f029c1b7.entry.js +2 -0
  785. package/dist/nylas-web-elements/p-f029c1b7.entry.js.map +1 -0
  786. package/dist/nylas-web-elements/p-f9a4758a.entry.js +2 -0
  787. package/dist/nylas-web-elements/p-f9a4758a.entry.js.map +1 -0
  788. package/dist/types/common/abstract-provider.d.ts +52 -0
  789. package/dist/types/common/component-types.d.ts +22 -0
  790. package/dist/types/common/constants.d.ts +6 -0
  791. package/dist/types/common/global.d.ts +1 -0
  792. package/dist/types/common/icons/archive.d.ts +5 -0
  793. package/dist/types/common/icons/arrow.d.ts +5 -0
  794. package/dist/types/common/icons/bold.d.ts +5 -0
  795. package/dist/types/common/icons/calendar-cancel.d.ts +5 -0
  796. package/dist/types/common/icons/calendar-check.d.ts +5 -0
  797. package/dist/types/common/icons/calendar.d.ts +5 -0
  798. package/dist/types/common/icons/checkmark-circle.d.ts +5 -0
  799. package/dist/types/common/icons/chevron.d.ts +5 -0
  800. package/dist/types/common/icons/close.d.ts +5 -0
  801. package/dist/types/common/icons/document-refresh.d.ts +5 -0
  802. package/dist/types/common/icons/folder.d.ts +5 -0
  803. package/dist/types/common/icons/forward.d.ts +5 -0
  804. package/dist/types/common/icons/globe.d.ts +5 -0
  805. package/dist/types/common/icons/inbox.d.ts +5 -0
  806. package/dist/types/common/icons/italic.d.ts +5 -0
  807. package/dist/types/common/icons/loading.d.ts +5 -0
  808. package/dist/types/common/icons/nylas-logo.d.ts +5 -0
  809. package/dist/types/common/icons/people.d.ts +5 -0
  810. package/dist/types/common/icons/play.d.ts +5 -0
  811. package/dist/types/common/icons/refresh.d.ts +5 -0
  812. package/dist/types/common/icons/reply-all.d.ts +5 -0
  813. package/dist/types/common/icons/reply.d.ts +5 -0
  814. package/dist/types/common/icons/sent.d.ts +5 -0
  815. package/dist/types/common/icons/spam.d.ts +5 -0
  816. package/dist/types/common/icons/star.d.ts +5 -0
  817. package/dist/types/common/icons/stop.d.ts +5 -0
  818. package/dist/types/common/icons/translate.d.ts +5 -0
  819. package/dist/types/common/icons/trash.d.ts +5 -0
  820. package/dist/types/common/icons/underline.d.ts +5 -0
  821. package/dist/types/common/icons/warning.d.ts +5 -0
  822. package/dist/types/common/mocks/threads.d.ts +3 -0
  823. package/dist/types/common/nylas-theme/index.d.ts +27 -0
  824. package/dist/types/common/register-component.d.ts +29 -0
  825. package/dist/types/common/types.d.ts +108 -0
  826. package/dist/types/components/mailbox/nylas-composer/nylas-composer.d.ts +22 -0
  827. package/dist/types/components/mailbox/nylas-composer/test/nylas-composer.spec-disabled.d.ts +1 -0
  828. package/dist/types/components/mailbox/nylas-list-folders/nylas-list-folders.d.ts +19 -0
  829. package/dist/types/components/mailbox/nylas-list-threads/nylas-list-threads.d.ts +19 -0
  830. package/dist/types/components/mailbox/nylas-mailbox/nylas-mailbox.d.ts +35 -0
  831. package/dist/types/components/mailbox/nylas-mailbox-pagination/nylas-mailbox-pagination.d.ts +30 -0
  832. package/dist/types/components/mailbox/nylas-mailbox-toolbar-button/nylas-mailbox-toolbar-button.d.ts +26 -0
  833. package/dist/types/components/mailbox/nylas-summarize-message-button/nylas-summarize-message-button.d.ts +25 -0
  834. package/dist/types/components/mailbox/nylas-threads-refresh/nylas-threads-refresh.d.ts +23 -0
  835. package/dist/types/components/mailbox/nylas-threads-search/nylas-threads-search.d.ts +13 -0
  836. package/dist/types/components/mailbox/nylas-view-email/nylas-view-email.d.ts +25 -0
  837. package/dist/types/components/mailbox/nylas-view-thread/nylas-view-thread.d.ts +30 -0
  838. package/dist/types/components/mailbox/nylas-view-thread/view-thread-message.d.ts +12 -0
  839. package/dist/types/components/nylas-if-state/nylas-if-state.d.ts +22 -0
  840. package/dist/types/components/nylas-login/nylas-login.d.ts +26 -0
  841. package/dist/types/components/nylas-provider/nylas-provider.d.ts +35 -0
  842. package/dist/types/components/scheduler/nylas-booked-event-card/nylas-booked-event-card.d.ts +22 -0
  843. package/dist/types/components/scheduler/nylas-booking-form/nylas-booking-form.d.ts +33 -0
  844. package/dist/types/components/scheduler/nylas-cancelled-event-card/nylas-cancelled-event-card.d.ts +13 -0
  845. package/dist/types/components/scheduler/nylas-date-picker/nylas-date-picker.d.ts +19 -0
  846. package/dist/types/components/scheduler/nylas-locale-switch/nylas-locale-switch.d.ts +13 -0
  847. package/dist/types/components/scheduler/nylas-notification/nylas-notification.d.ts +13 -0
  848. package/dist/types/components/scheduler/nylas-open-hours-picker/nylas-open-hours-picker.d.ts +40 -0
  849. package/dist/types/components/scheduler/nylas-scheduler/nylas-scheduler.d.ts +41 -0
  850. package/dist/types/components/scheduler/nylas-scheduler/scheduler-view.d.ts +6 -0
  851. package/dist/types/components/scheduler/nylas-selected-event-card/nylas-selected-event-card.d.ts +15 -0
  852. package/dist/types/components/scheduler/nylas-timeslot-picker/nylas-timeslot-picker.d.ts +28 -0
  853. package/dist/types/components.d.ts +2123 -0
  854. package/dist/types/connector/connector-interface.d.ts +35 -0
  855. package/dist/types/connector/nylas-connector/index.d.ts +59 -0
  856. package/dist/types/connector/nylas-mailbox-connector/index.d.ts +52 -0
  857. package/dist/types/connector/nylas-scheduler-connector/index.d.ts +24 -0
  858. package/dist/types/connector/shared/api/auth.d.ts +13 -0
  859. package/dist/types/connector/shared/api/folders.d.ts +10 -0
  860. package/dist/types/connector/shared/api/messages.d.ts +13 -0
  861. package/dist/types/connector/shared/api/scheduler.d.ts +29 -0
  862. package/dist/types/connector/shared/api/threads.d.ts +20 -0
  863. package/dist/types/index.d.ts +4 -0
  864. package/dist/types/routers/hash-router.d.ts +21 -0
  865. package/dist/types/routers/router-interface.d.ts +16 -0
  866. package/dist/types/stencil-public-runtime.d.ts +1681 -0
  867. package/dist/types/stores/auth-store.d.ts +9 -0
  868. package/dist/types/stores/mailbox-store.d.ts +19 -0
  869. package/dist/types/stores/scheduler-store.d.ts +32 -0
  870. package/dist/types/utils/color-utils.d.ts +9 -0
  871. package/dist/types/utils/utils.d.ts +28 -0
  872. package/loader/cdn.js +3 -0
  873. package/loader/index.cjs.js +3 -0
  874. package/loader/index.d.ts +21 -0
  875. package/loader/index.es2017.js +3 -0
  876. package/loader/index.js +4 -0
  877. package/loader/package.json +11 -0
  878. package/package.json +69 -0
  879. package/readme.md +42 -0
@@ -0,0 +1,2141 @@
1
+ const NAMESPACE = 'nylas-web-elements';
2
+
3
+ /**
4
+ * Virtual DOM patching algorithm based on Snabbdom by
5
+ * Simon Friis Vindum (@paldepind)
6
+ * Licensed under the MIT License
7
+ * https://github.com/snabbdom/snabbdom/blob/master/LICENSE
8
+ *
9
+ * Modified for Stencil's renderer and slot projection
10
+ */
11
+ let scopeId;
12
+ let hostTagName;
13
+ let isSvgMode = false;
14
+ let renderingRef = null;
15
+ let queuePending = false;
16
+ const createTime = (fnName, tagName = '') => {
17
+ {
18
+ return () => {
19
+ return;
20
+ };
21
+ }
22
+ };
23
+ const uniqueTime = (key, measureText) => {
24
+ {
25
+ return () => {
26
+ return;
27
+ };
28
+ }
29
+ };
30
+ const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
31
+ /**
32
+ * Constant for styles to be globally applied to `slot-fb` elements for pseudo-slot behavior.
33
+ *
34
+ * Two cascading rules must be used instead of a `:not()` selector due to Stencil browser
35
+ * support as of Stencil v4.
36
+ */
37
+ const SLOT_FB_CSS = 'slot-fb{display:contents}slot-fb[hidden]{display:none}';
38
+ /**
39
+ * Default style mode id
40
+ */
41
+ /**
42
+ * Reusable empty obj/array
43
+ * Don't add values to these!!
44
+ */
45
+ const EMPTY_OBJ = {};
46
+ /**
47
+ * Namespaces
48
+ */
49
+ const SVG_NS = 'http://www.w3.org/2000/svg';
50
+ const HTML_NS = 'http://www.w3.org/1999/xhtml';
51
+ const isDef = (v) => v != null;
52
+ /**
53
+ * Check whether a value is a 'complex type', defined here as an object or a
54
+ * function.
55
+ *
56
+ * @param o the value to check
57
+ * @returns whether it's a complex type or not
58
+ */
59
+ const isComplexType = (o) => {
60
+ // https://jsperf.com/typeof-fn-object/5
61
+ o = typeof o;
62
+ return o === 'object' || o === 'function';
63
+ };
64
+ /**
65
+ * Helper method for querying a `meta` tag that contains a nonce value
66
+ * out of a DOM's head.
67
+ *
68
+ * @param doc The DOM containing the `head` to query against
69
+ * @returns The content of the meta tag representing the nonce value, or `undefined` if no tag
70
+ * exists or the tag has no content.
71
+ */
72
+ function queryNonceMetaTagContent(doc) {
73
+ var _a, _b, _c;
74
+ return (_c = (_b = (_a = doc.head) === null || _a === void 0 ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) === null || _b === void 0 ? void 0 : _b.getAttribute('content')) !== null && _c !== void 0 ? _c : undefined;
75
+ }
76
+ /**
77
+ * Production h() function based on Preact by
78
+ * Jason Miller (@developit)
79
+ * Licensed under the MIT License
80
+ * https://github.com/developit/preact/blob/master/LICENSE
81
+ *
82
+ * Modified for Stencil's compiler and vdom
83
+ */
84
+ // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
85
+ // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
86
+ const h = (nodeName, vnodeData, ...children) => {
87
+ let child = null;
88
+ let key = null;
89
+ let simple = false;
90
+ let lastSimple = false;
91
+ const vNodeChildren = [];
92
+ const walk = (c) => {
93
+ for (let i = 0; i < c.length; i++) {
94
+ child = c[i];
95
+ if (Array.isArray(child)) {
96
+ walk(child);
97
+ }
98
+ else if (child != null && typeof child !== 'boolean') {
99
+ if ((simple = typeof nodeName !== 'function' && !isComplexType(child))) {
100
+ child = String(child);
101
+ }
102
+ if (simple && lastSimple) {
103
+ // If the previous child was simple (string), we merge both
104
+ vNodeChildren[vNodeChildren.length - 1].$text$ += child;
105
+ }
106
+ else {
107
+ // Append a new vNode, if it's text, we create a text vNode
108
+ vNodeChildren.push(simple ? newVNode(null, child) : child);
109
+ }
110
+ lastSimple = simple;
111
+ }
112
+ }
113
+ };
114
+ walk(children);
115
+ if (vnodeData) {
116
+ if (vnodeData.key) {
117
+ key = vnodeData.key;
118
+ }
119
+ // normalize class / className attributes
120
+ {
121
+ const classData = vnodeData.className || vnodeData.class;
122
+ if (classData) {
123
+ vnodeData.class =
124
+ typeof classData !== 'object'
125
+ ? classData
126
+ : Object.keys(classData)
127
+ .filter((k) => classData[k])
128
+ .join(' ');
129
+ }
130
+ }
131
+ }
132
+ if (typeof nodeName === 'function') {
133
+ // nodeName is a functional component
134
+ return nodeName(vnodeData === null ? {} : vnodeData, vNodeChildren, vdomFnUtils);
135
+ }
136
+ const vnode = newVNode(nodeName, null);
137
+ vnode.$attrs$ = vnodeData;
138
+ if (vNodeChildren.length > 0) {
139
+ vnode.$children$ = vNodeChildren;
140
+ }
141
+ {
142
+ vnode.$key$ = key;
143
+ }
144
+ return vnode;
145
+ };
146
+ /**
147
+ * A utility function for creating a virtual DOM node from a tag and some
148
+ * possible text content.
149
+ *
150
+ * @param tag the tag for this element
151
+ * @param text possible text content for the node
152
+ * @returns a newly-minted virtual DOM node
153
+ */
154
+ const newVNode = (tag, text) => {
155
+ const vnode = {
156
+ $flags$: 0,
157
+ $tag$: tag,
158
+ $text$: text,
159
+ $elm$: null,
160
+ $children$: null,
161
+ };
162
+ {
163
+ vnode.$attrs$ = null;
164
+ }
165
+ {
166
+ vnode.$key$ = null;
167
+ }
168
+ return vnode;
169
+ };
170
+ const Host = {};
171
+ /**
172
+ * Check whether a given node is a Host node or not
173
+ *
174
+ * @param node the virtual DOM node to check
175
+ * @returns whether it's a Host node or not
176
+ */
177
+ const isHost = (node) => node && node.$tag$ === Host;
178
+ /**
179
+ * Implementation of {@link d.FunctionalUtilities} for Stencil's VDom.
180
+ *
181
+ * Note that these functions convert from {@link d.VNode} to
182
+ * {@link d.ChildNode} to give functional component developers a friendly
183
+ * interface.
184
+ */
185
+ const vdomFnUtils = {
186
+ forEach: (children, cb) => children.map(convertToPublic).forEach(cb),
187
+ map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate),
188
+ };
189
+ /**
190
+ * Convert a {@link d.VNode} to a {@link d.ChildNode} in order to present a
191
+ * friendlier public interface (hence, 'convertToPublic').
192
+ *
193
+ * @param node the virtual DOM node to convert
194
+ * @returns a converted child node
195
+ */
196
+ const convertToPublic = (node) => ({
197
+ vattrs: node.$attrs$,
198
+ vchildren: node.$children$,
199
+ vkey: node.$key$,
200
+ vname: node.$name$,
201
+ vtag: node.$tag$,
202
+ vtext: node.$text$,
203
+ });
204
+ /**
205
+ * Convert a {@link d.ChildNode} back to an equivalent {@link d.VNode} in
206
+ * order to use the resulting object in the virtual DOM. The initial object was
207
+ * likely created as part of presenting a public API, so converting it back
208
+ * involved making it 'private' again (hence, `convertToPrivate`).
209
+ *
210
+ * @param node the child node to convert
211
+ * @returns a converted virtual DOM node
212
+ */
213
+ const convertToPrivate = (node) => {
214
+ if (typeof node.vtag === 'function') {
215
+ const vnodeData = Object.assign({}, node.vattrs);
216
+ if (node.vkey) {
217
+ vnodeData.key = node.vkey;
218
+ }
219
+ if (node.vname) {
220
+ vnodeData.name = node.vname;
221
+ }
222
+ return h(node.vtag, vnodeData, ...(node.vchildren || []));
223
+ }
224
+ const vnode = newVNode(node.vtag, node.vtext);
225
+ vnode.$attrs$ = node.vattrs;
226
+ vnode.$children$ = node.vchildren;
227
+ vnode.$key$ = node.vkey;
228
+ vnode.$name$ = node.vname;
229
+ return vnode;
230
+ };
231
+ /**
232
+ * Parse a new property value for a given property type.
233
+ *
234
+ * While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
235
+ * it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
236
+ * 1. `any`, the type given to `propValue` in the function signature
237
+ * 2. the type stored from `propType`.
238
+ *
239
+ * This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
240
+ *
241
+ * Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
242
+ * a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
243
+ * based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
244
+ * ```tsx
245
+ * <my-cmp prop-val={0}></my-cmp>
246
+ * ```
247
+ *
248
+ * HTML prop values on the other hand, will always a string
249
+ *
250
+ * @param propValue the new value to coerce to some type
251
+ * @param propType the type of the prop, expressed as a binary number
252
+ * @returns the parsed/coerced value
253
+ */
254
+ const parsePropertyValue = (propValue, propType) => {
255
+ // ensure this value is of the correct prop type
256
+ if (propValue != null && !isComplexType(propValue)) {
257
+ if (propType & 4 /* MEMBER_FLAGS.Boolean */) {
258
+ // per the HTML spec, any string value means it is a boolean true value
259
+ // but we'll cheat here and say that the string "false" is the boolean false
260
+ return propValue === 'false' ? false : propValue === '' || !!propValue;
261
+ }
262
+ if (propType & 2 /* MEMBER_FLAGS.Number */) {
263
+ // force it to be a number
264
+ return parseFloat(propValue);
265
+ }
266
+ if (propType & 1 /* MEMBER_FLAGS.String */) {
267
+ // could have been passed as a number or boolean
268
+ // but we still want it as a string
269
+ return String(propValue);
270
+ }
271
+ // redundant return here for better minification
272
+ return propValue;
273
+ }
274
+ // not sure exactly what type we want
275
+ // so no need to change to a different type
276
+ return propValue;
277
+ };
278
+ const getElement = (ref) => (getHostRef(ref).$hostElement$ );
279
+ const createEvent = (ref, name, flags) => {
280
+ const elm = getElement(ref);
281
+ return {
282
+ emit: (detail) => {
283
+ return emitEvent(elm, name, {
284
+ bubbles: !!(flags & 4 /* EVENT_FLAGS.Bubbles */),
285
+ composed: !!(flags & 2 /* EVENT_FLAGS.Composed */),
286
+ cancelable: !!(flags & 1 /* EVENT_FLAGS.Cancellable */),
287
+ detail,
288
+ });
289
+ },
290
+ };
291
+ };
292
+ /**
293
+ * Helper function to create & dispatch a custom Event on a provided target
294
+ * @param elm the target of the Event
295
+ * @param name the name to give the custom Event
296
+ * @param opts options for configuring a custom Event
297
+ * @returns the custom Event
298
+ */
299
+ const emitEvent = (elm, name, opts) => {
300
+ const ev = plt.ce(name, opts);
301
+ elm.dispatchEvent(ev);
302
+ return ev;
303
+ };
304
+ const rootAppliedStyles = /*@__PURE__*/ new WeakMap();
305
+ const registerStyle = (scopeId, cssText, allowCS) => {
306
+ let style = styles.get(scopeId);
307
+ if (supportsConstructableStylesheets && allowCS) {
308
+ style = (style || new CSSStyleSheet());
309
+ if (typeof style === 'string') {
310
+ style = cssText;
311
+ }
312
+ else {
313
+ style.replaceSync(cssText);
314
+ }
315
+ }
316
+ else {
317
+ style = cssText;
318
+ }
319
+ styles.set(scopeId, style);
320
+ };
321
+ const addStyle = (styleContainerNode, cmpMeta, mode) => {
322
+ var _a;
323
+ const scopeId = getScopeId(cmpMeta);
324
+ const style = styles.get(scopeId);
325
+ // if an element is NOT connected then getRootNode() will return the wrong root node
326
+ // so the fallback is to always use the document for the root node in those cases
327
+ styleContainerNode = styleContainerNode.nodeType === 11 /* NODE_TYPE.DocumentFragment */ ? styleContainerNode : doc;
328
+ if (style) {
329
+ if (typeof style === 'string') {
330
+ styleContainerNode = styleContainerNode.head || styleContainerNode;
331
+ let appliedStyles = rootAppliedStyles.get(styleContainerNode);
332
+ let styleElm;
333
+ if (!appliedStyles) {
334
+ rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
335
+ }
336
+ if (!appliedStyles.has(scopeId)) {
337
+ {
338
+ styleElm = doc.createElement('style');
339
+ styleElm.innerHTML = style;
340
+ // Apply CSP nonce to the style tag if it exists
341
+ const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
342
+ if (nonce != null) {
343
+ styleElm.setAttribute('nonce', nonce);
344
+ }
345
+ styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
346
+ }
347
+ // Add styles for `slot-fb` elements if we're using slots outside the Shadow DOM
348
+ if (cmpMeta.$flags$ & 4 /* CMP_FLAGS.hasSlotRelocation */) {
349
+ styleElm.innerHTML += SLOT_FB_CSS;
350
+ }
351
+ if (appliedStyles) {
352
+ appliedStyles.add(scopeId);
353
+ }
354
+ }
355
+ }
356
+ else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
357
+ styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
358
+ }
359
+ }
360
+ return scopeId;
361
+ };
362
+ const attachStyles = (hostRef) => {
363
+ const cmpMeta = hostRef.$cmpMeta$;
364
+ const elm = hostRef.$hostElement$;
365
+ const flags = cmpMeta.$flags$;
366
+ const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
367
+ const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
368
+ if (flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
369
+ // only required when we're NOT using native shadow dom (slot)
370
+ // or this browser doesn't support native shadow dom
371
+ // and this host element was NOT created with SSR
372
+ // let's pick out the inner content for slot projection
373
+ // create a node to represent where the original
374
+ // content was first placed, which is useful later on
375
+ // DOM WRITE!!
376
+ elm['s-sc'] = scopeId;
377
+ elm.classList.add(scopeId + '-h');
378
+ if (flags & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {
379
+ elm.classList.add(scopeId + '-s');
380
+ }
381
+ }
382
+ endAttachStyles();
383
+ };
384
+ const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
385
+ /**
386
+ * Production setAccessor() function based on Preact by
387
+ * Jason Miller (@developit)
388
+ * Licensed under the MIT License
389
+ * https://github.com/developit/preact/blob/master/LICENSE
390
+ *
391
+ * Modified for Stencil's compiler and vdom
392
+ */
393
+ /**
394
+ * When running a VDom render set properties present on a VDom node onto the
395
+ * corresponding HTML element.
396
+ *
397
+ * Note that this function has special functionality for the `class`,
398
+ * `style`, `key`, and `ref` attributes, as well as event handlers (like
399
+ * `onClick`, etc). All others are just passed through as-is.
400
+ *
401
+ * @param elm the HTMLElement onto which attributes should be set
402
+ * @param memberName the name of the attribute to set
403
+ * @param oldValue the old value for the attribute
404
+ * @param newValue the new value for the attribute
405
+ * @param isSvg whether we're in an svg context or not
406
+ * @param flags bitflags for Vdom variables
407
+ */
408
+ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
409
+ if (oldValue !== newValue) {
410
+ let isProp = isMemberInElement(elm, memberName);
411
+ let ln = memberName.toLowerCase();
412
+ if (memberName === 'class') {
413
+ const classList = elm.classList;
414
+ const oldClasses = parseClassList(oldValue);
415
+ const newClasses = parseClassList(newValue);
416
+ classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
417
+ classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
418
+ }
419
+ else if (memberName === 'style') {
420
+ // update style attribute, css properties and values
421
+ {
422
+ for (const prop in oldValue) {
423
+ if (!newValue || newValue[prop] == null) {
424
+ if (prop.includes('-')) {
425
+ elm.style.removeProperty(prop);
426
+ }
427
+ else {
428
+ elm.style[prop] = '';
429
+ }
430
+ }
431
+ }
432
+ }
433
+ for (const prop in newValue) {
434
+ if (!oldValue || newValue[prop] !== oldValue[prop]) {
435
+ if (prop.includes('-')) {
436
+ elm.style.setProperty(prop, newValue[prop]);
437
+ }
438
+ else {
439
+ elm.style[prop] = newValue[prop];
440
+ }
441
+ }
442
+ }
443
+ }
444
+ else if (memberName === 'key')
445
+ ;
446
+ else if (memberName === 'ref') {
447
+ // minifier will clean this up
448
+ if (newValue) {
449
+ newValue(elm);
450
+ }
451
+ }
452
+ else if ((!isProp ) &&
453
+ memberName[0] === 'o' &&
454
+ memberName[1] === 'n') {
455
+ // Event Handlers
456
+ // so if the member name starts with "on" and the 3rd characters is
457
+ // a capital letter, and it's not already a member on the element,
458
+ // then we're assuming it's an event listener
459
+ if (memberName[2] === '-') {
460
+ // on- prefixed events
461
+ // allows to be explicit about the dom event to listen without any magic
462
+ // under the hood:
463
+ // <my-cmp on-click> // listens for "click"
464
+ // <my-cmp on-Click> // listens for "Click"
465
+ // <my-cmp on-ionChange> // listens for "ionChange"
466
+ // <my-cmp on-EVENTS> // listens for "EVENTS"
467
+ memberName = memberName.slice(3);
468
+ }
469
+ else if (isMemberInElement(win, ln)) {
470
+ // standard event
471
+ // the JSX attribute could have been "onMouseOver" and the
472
+ // member name "onmouseover" is on the window's prototype
473
+ // so let's add the listener "mouseover", which is all lowercased
474
+ memberName = ln.slice(2);
475
+ }
476
+ else {
477
+ // custom event
478
+ // the JSX attribute could have been "onMyCustomEvent"
479
+ // so let's trim off the "on" prefix and lowercase the first character
480
+ // and add the listener "myCustomEvent"
481
+ // except for the first character, we keep the event name case
482
+ memberName = ln[2] + memberName.slice(3);
483
+ }
484
+ if (oldValue || newValue) {
485
+ // Need to account for "capture" events.
486
+ // If the event name ends with "Capture", we'll update the name to remove
487
+ // the "Capture" suffix and make sure the event listener is setup to handle the capture event.
488
+ const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
489
+ // Make sure we only replace the last instance of "Capture"
490
+ memberName = memberName.replace(CAPTURE_EVENT_REGEX, '');
491
+ if (oldValue) {
492
+ plt.rel(elm, memberName, oldValue, capture);
493
+ }
494
+ if (newValue) {
495
+ plt.ael(elm, memberName, newValue, capture);
496
+ }
497
+ }
498
+ }
499
+ else {
500
+ // Set property if it exists and it's not a SVG
501
+ const isComplex = isComplexType(newValue);
502
+ if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
503
+ try {
504
+ if (!elm.tagName.includes('-')) {
505
+ const n = newValue == null ? '' : newValue;
506
+ // Workaround for Safari, moving the <input> caret when re-assigning the same valued
507
+ if (memberName === 'list') {
508
+ isProp = false;
509
+ }
510
+ else if (oldValue == null || elm[memberName] != n) {
511
+ elm[memberName] = n;
512
+ }
513
+ }
514
+ else {
515
+ elm[memberName] = newValue;
516
+ }
517
+ }
518
+ catch (e) {
519
+ /**
520
+ * in case someone tries to set a read-only property, e.g. "namespaceURI", we just ignore it
521
+ */
522
+ }
523
+ }
524
+ if (newValue == null || newValue === false) {
525
+ if (newValue !== false || elm.getAttribute(memberName) === '') {
526
+ {
527
+ elm.removeAttribute(memberName);
528
+ }
529
+ }
530
+ }
531
+ else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
532
+ newValue = newValue === true ? '' : newValue;
533
+ {
534
+ elm.setAttribute(memberName, newValue);
535
+ }
536
+ }
537
+ }
538
+ }
539
+ };
540
+ const parseClassListRegex = /\s/;
541
+ /**
542
+ * Parsed a string of classnames into an array
543
+ * @param value className string, e.g. "foo bar baz"
544
+ * @returns list of classes, e.g. ["foo", "bar", "baz"]
545
+ */
546
+ const parseClassList = (value) => (!value ? [] : value.split(parseClassListRegex));
547
+ const CAPTURE_EVENT_SUFFIX = 'Capture';
548
+ const CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + '$');
549
+ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
550
+ // if the element passed in is a shadow root, which is a document fragment
551
+ // then we want to be adding attrs/props to the shadow root's "host" element
552
+ // if it's not a shadow root, then we add attrs/props to the same element
553
+ const elm = newVnode.$elm$.nodeType === 11 /* NODE_TYPE.DocumentFragment */ && newVnode.$elm$.host
554
+ ? newVnode.$elm$.host
555
+ : newVnode.$elm$;
556
+ const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
557
+ const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
558
+ {
559
+ // remove attributes no longer present on the vnode by setting them to undefined
560
+ for (memberName in oldVnodeAttrs) {
561
+ if (!(memberName in newVnodeAttrs)) {
562
+ setAccessor(elm, memberName, oldVnodeAttrs[memberName], undefined, isSvgMode, newVnode.$flags$);
563
+ }
564
+ }
565
+ }
566
+ // add new & update changed attributes
567
+ for (memberName in newVnodeAttrs) {
568
+ setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
569
+ }
570
+ };
571
+ /**
572
+ * Create a DOM Node corresponding to one of the children of a given VNode.
573
+ *
574
+ * @param oldParentVNode the parent VNode from the previous render
575
+ * @param newParentVNode the parent VNode from the current render
576
+ * @param childIndex the index of the VNode, in the _new_ parent node's
577
+ * children, for which we will create a new DOM node
578
+ * @param parentElm the parent DOM node which our new node will be a child of
579
+ * @returns the newly created node
580
+ */
581
+ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
582
+ // tslint:disable-next-line: prefer-const
583
+ const newVNode = newParentVNode.$children$[childIndex];
584
+ let i = 0;
585
+ let elm;
586
+ let childNode;
587
+ if (newVNode.$text$ !== null) {
588
+ // create text node
589
+ elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
590
+ }
591
+ else {
592
+ if (!isSvgMode) {
593
+ isSvgMode = newVNode.$tag$ === 'svg';
594
+ }
595
+ // create element
596
+ elm = newVNode.$elm$ = (doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$tag$)
597
+ );
598
+ if (isSvgMode && newVNode.$tag$ === 'foreignObject') {
599
+ isSvgMode = false;
600
+ }
601
+ // add css classes, attrs, props, listeners, etc.
602
+ {
603
+ updateElement(null, newVNode, isSvgMode);
604
+ }
605
+ if (isDef(scopeId) && elm['s-si'] !== scopeId) {
606
+ // if there is a scopeId and this is the initial render
607
+ // then let's add the scopeId as a css class
608
+ elm.classList.add((elm['s-si'] = scopeId));
609
+ }
610
+ if (newVNode.$children$) {
611
+ for (i = 0; i < newVNode.$children$.length; ++i) {
612
+ // create the node
613
+ childNode = createElm(oldParentVNode, newVNode, i);
614
+ // return node could have been null
615
+ if (childNode) {
616
+ // append our new node
617
+ elm.appendChild(childNode);
618
+ }
619
+ }
620
+ }
621
+ {
622
+ if (newVNode.$tag$ === 'svg') {
623
+ // Only reset the SVG context when we're exiting <svg> element
624
+ isSvgMode = false;
625
+ }
626
+ else if (elm.tagName === 'foreignObject') {
627
+ // Reenter SVG context when we're exiting <foreignObject> element
628
+ isSvgMode = true;
629
+ }
630
+ }
631
+ }
632
+ // This needs to always happen so we can hide nodes that are projected
633
+ // to another component but don't end up in a slot
634
+ elm['s-hn'] = hostTagName;
635
+ return elm;
636
+ };
637
+ /**
638
+ * Create DOM nodes corresponding to a list of {@link d.Vnode} objects and
639
+ * add them to the DOM in the appropriate place.
640
+ *
641
+ * @param parentElm the DOM node which should be used as a parent for the new
642
+ * DOM nodes
643
+ * @param before a child of the `parentElm` which the new children should be
644
+ * inserted before (optional)
645
+ * @param parentVNode the parent virtual DOM node
646
+ * @param vnodes the new child virtual DOM nodes to produce DOM nodes for
647
+ * @param startIdx the index in the child virtual DOM nodes at which to start
648
+ * creating DOM nodes (inclusive)
649
+ * @param endIdx the index in the child virtual DOM nodes at which to stop
650
+ * creating DOM nodes (inclusive)
651
+ */
652
+ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
653
+ let containerElm = (parentElm);
654
+ let childNode;
655
+ if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
656
+ containerElm = containerElm.shadowRoot;
657
+ }
658
+ for (; startIdx <= endIdx; ++startIdx) {
659
+ if (vnodes[startIdx]) {
660
+ childNode = createElm(null, parentVNode, startIdx);
661
+ if (childNode) {
662
+ vnodes[startIdx].$elm$ = childNode;
663
+ containerElm.insertBefore(childNode, before);
664
+ }
665
+ }
666
+ }
667
+ };
668
+ /**
669
+ * Remove the DOM elements corresponding to a list of {@link d.VNode} objects.
670
+ * This can be used to, for instance, clean up after a list of children which
671
+ * should no longer be shown.
672
+ *
673
+ * This function also handles some of Stencil's slot relocation logic.
674
+ *
675
+ * @param vnodes a list of virtual DOM nodes to remove
676
+ * @param startIdx the index at which to start removing nodes (inclusive)
677
+ * @param endIdx the index at which to stop removing nodes (inclusive)
678
+ */
679
+ const removeVnodes = (vnodes, startIdx, endIdx) => {
680
+ for (let index = startIdx; index <= endIdx; ++index) {
681
+ const vnode = vnodes[index];
682
+ if (vnode) {
683
+ const elm = vnode.$elm$;
684
+ nullifyVNodeRefs(vnode);
685
+ if (elm) {
686
+ // remove the vnode's element from the dom
687
+ elm.remove();
688
+ }
689
+ }
690
+ }
691
+ };
692
+ /**
693
+ * Reconcile the children of a new VNode with the children of an old VNode by
694
+ * traversing the two collections of children, identifying nodes that are
695
+ * conserved or changed, calling out to `patch` to make any necessary
696
+ * updates to the DOM, and rearranging DOM nodes as needed.
697
+ *
698
+ * The algorithm for reconciling children works by analyzing two 'windows' onto
699
+ * the two arrays of children (`oldCh` and `newCh`). We keep track of the
700
+ * 'windows' by storing start and end indices and references to the
701
+ * corresponding array entries. Initially the two 'windows' are basically equal
702
+ * to the entire array, but we progressively narrow the windows until there are
703
+ * no children left to update by doing the following:
704
+ *
705
+ * 1. Skip any `null` entries at the beginning or end of the two arrays, so
706
+ * that if we have an initial array like the following we'll end up dealing
707
+ * only with a window bounded by the highlighted elements:
708
+ *
709
+ * [null, null, VNode1 , ... , VNode2, null, null]
710
+ * ^^^^^^ ^^^^^^
711
+ *
712
+ * 2. Check to see if the elements at the head and tail positions are equal
713
+ * across the windows. This will basically detect elements which haven't
714
+ * been added, removed, or changed position, i.e. if you had the following
715
+ * VNode elements (represented as HTML):
716
+ *
717
+ * oldVNode: `<div><p><span>HEY</span></p></div>`
718
+ * newVNode: `<div><p><span>THERE</span></p></div>`
719
+ *
720
+ * Then when comparing the children of the `<div>` tag we check the equality
721
+ * of the VNodes corresponding to the `<p>` tags and, since they are the
722
+ * same tag in the same position, we'd be able to avoid completely
723
+ * re-rendering the subtree under them with a new DOM element and would just
724
+ * call out to `patch` to handle reconciling their children and so on.
725
+ *
726
+ * 3. Check, for both windows, to see if the element at the beginning of the
727
+ * window corresponds to the element at the end of the other window. This is
728
+ * a heuristic which will let us identify _some_ situations in which
729
+ * elements have changed position, for instance it _should_ detect that the
730
+ * children nodes themselves have not changed but merely moved in the
731
+ * following example:
732
+ *
733
+ * oldVNode: `<div><element-one /><element-two /></div>`
734
+ * newVNode: `<div><element-two /><element-one /></div>`
735
+ *
736
+ * If we find cases like this then we also need to move the concrete DOM
737
+ * elements corresponding to the moved children to write the re-order to the
738
+ * DOM.
739
+ *
740
+ * 4. Finally, if VNodes have the `key` attribute set on them we check for any
741
+ * nodes in the old children which have the same key as the first element in
742
+ * our window on the new children. If we find such a node we handle calling
743
+ * out to `patch`, moving relevant DOM nodes, and so on, in accordance with
744
+ * what we find.
745
+ *
746
+ * Finally, once we've narrowed our 'windows' to the point that either of them
747
+ * collapse (i.e. they have length 0) we then handle any remaining VNode
748
+ * insertion or deletion that needs to happen to get a DOM state that correctly
749
+ * reflects the new child VNodes. If, for instance, after our window on the old
750
+ * children has collapsed we still have more nodes on the new children that
751
+ * we haven't dealt with yet then we need to add them, or if the new children
752
+ * collapse but we still have unhandled _old_ children then we need to make
753
+ * sure the corresponding DOM nodes are removed.
754
+ *
755
+ * @param parentElm the node into which the parent VNode is rendered
756
+ * @param oldCh the old children of the parent node
757
+ * @param newVNode the new VNode which will replace the parent
758
+ * @param newCh the new children of the parent node
759
+ * @param isInitialRender whether or not this is the first render of the vdom
760
+ */
761
+ const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = false) => {
762
+ let oldStartIdx = 0;
763
+ let newStartIdx = 0;
764
+ let idxInOld = 0;
765
+ let i = 0;
766
+ let oldEndIdx = oldCh.length - 1;
767
+ let oldStartVnode = oldCh[0];
768
+ let oldEndVnode = oldCh[oldEndIdx];
769
+ let newEndIdx = newCh.length - 1;
770
+ let newStartVnode = newCh[0];
771
+ let newEndVnode = newCh[newEndIdx];
772
+ let node;
773
+ let elmToMove;
774
+ while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
775
+ if (oldStartVnode == null) {
776
+ // VNode might have been moved left
777
+ oldStartVnode = oldCh[++oldStartIdx];
778
+ }
779
+ else if (oldEndVnode == null) {
780
+ oldEndVnode = oldCh[--oldEndIdx];
781
+ }
782
+ else if (newStartVnode == null) {
783
+ newStartVnode = newCh[++newStartIdx];
784
+ }
785
+ else if (newEndVnode == null) {
786
+ newEndVnode = newCh[--newEndIdx];
787
+ }
788
+ else if (isSameVnode(oldStartVnode, newStartVnode, isInitialRender)) {
789
+ // if the start nodes are the same then we should patch the new VNode
790
+ // onto the old one, and increment our `newStartIdx` and `oldStartIdx`
791
+ // indices to reflect that. We don't need to move any DOM Nodes around
792
+ // since things are matched up in order.
793
+ patch(oldStartVnode, newStartVnode, isInitialRender);
794
+ oldStartVnode = oldCh[++oldStartIdx];
795
+ newStartVnode = newCh[++newStartIdx];
796
+ }
797
+ else if (isSameVnode(oldEndVnode, newEndVnode, isInitialRender)) {
798
+ // likewise, if the end nodes are the same we patch new onto old and
799
+ // decrement our end indices, and also likewise in this case we don't
800
+ // need to move any DOM Nodes.
801
+ patch(oldEndVnode, newEndVnode, isInitialRender);
802
+ oldEndVnode = oldCh[--oldEndIdx];
803
+ newEndVnode = newCh[--newEndIdx];
804
+ }
805
+ else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
806
+ patch(oldStartVnode, newEndVnode, isInitialRender);
807
+ // We need to move the element for `oldStartVnode` into a position which
808
+ // will be appropriate for `newEndVnode`. For this we can use
809
+ // `.insertBefore` and `oldEndVnode.$elm$.nextSibling`. If there is a
810
+ // sibling for `oldEndVnode.$elm$` then we want to move the DOM node for
811
+ // `oldStartVnode` between `oldEndVnode` and it's sibling, like so:
812
+ //
813
+ // <old-start-node />
814
+ // <some-intervening-node />
815
+ // <old-end-node />
816
+ // <!-- -> <-- `oldStartVnode.$elm$` should be inserted here
817
+ // <next-sibling />
818
+ //
819
+ // If instead `oldEndVnode.$elm$` has no sibling then we just want to put
820
+ // the node for `oldStartVnode` at the end of the children of
821
+ // `parentElm`. Luckily, `Node.nextSibling` will return `null` if there
822
+ // aren't any siblings, and passing `null` to `Node.insertBefore` will
823
+ // append it to the children of the parent element.
824
+ parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
825
+ oldStartVnode = oldCh[++oldStartIdx];
826
+ newEndVnode = newCh[--newEndIdx];
827
+ }
828
+ else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
829
+ patch(oldEndVnode, newStartVnode, isInitialRender);
830
+ // We've already checked above if `oldStartVnode` and `newStartVnode` are
831
+ // the same node, so since we're here we know that they are not. Thus we
832
+ // can move the element for `oldEndVnode` _before_ the element for
833
+ // `oldStartVnode`, leaving `oldStartVnode` to be reconciled in the
834
+ // future.
835
+ parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
836
+ oldEndVnode = oldCh[--oldEndIdx];
837
+ newStartVnode = newCh[++newStartIdx];
838
+ }
839
+ else {
840
+ // Here we do some checks to match up old and new nodes based on the
841
+ // `$key$` attribute, which is set by putting a `key="my-key"` attribute
842
+ // in the JSX for a DOM element in the implementation of a Stencil
843
+ // component.
844
+ //
845
+ // First we check to see if there are any nodes in the array of old
846
+ // children which have the same key as the first node in the new
847
+ // children.
848
+ idxInOld = -1;
849
+ {
850
+ for (i = oldStartIdx; i <= oldEndIdx; ++i) {
851
+ if (oldCh[i] && oldCh[i].$key$ !== null && oldCh[i].$key$ === newStartVnode.$key$) {
852
+ idxInOld = i;
853
+ break;
854
+ }
855
+ }
856
+ }
857
+ if (idxInOld >= 0) {
858
+ // We found a node in the old children which matches up with the first
859
+ // node in the new children! So let's deal with that
860
+ elmToMove = oldCh[idxInOld];
861
+ if (elmToMove.$tag$ !== newStartVnode.$tag$) {
862
+ // the tag doesn't match so we'll need a new DOM element
863
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld);
864
+ }
865
+ else {
866
+ patch(elmToMove, newStartVnode, isInitialRender);
867
+ // invalidate the matching old node so that we won't try to update it
868
+ // again later on
869
+ oldCh[idxInOld] = undefined;
870
+ node = elmToMove.$elm$;
871
+ }
872
+ newStartVnode = newCh[++newStartIdx];
873
+ }
874
+ else {
875
+ // We either didn't find an element in the old children that matches
876
+ // the key of the first new child OR the build is not using `key`
877
+ // attributes at all. In either case we need to create a new element
878
+ // for the new node.
879
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx);
880
+ newStartVnode = newCh[++newStartIdx];
881
+ }
882
+ if (node) {
883
+ // if we created a new node then handle inserting it to the DOM
884
+ {
885
+ oldStartVnode.$elm$.parentNode.insertBefore(node, oldStartVnode.$elm$);
886
+ }
887
+ }
888
+ }
889
+ }
890
+ if (oldStartIdx > oldEndIdx) {
891
+ // we have some more new nodes to add which don't match up with old nodes
892
+ addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
893
+ }
894
+ else if (newStartIdx > newEndIdx) {
895
+ // there are nodes in the `oldCh` array which no longer correspond to nodes
896
+ // in the new array, so lets remove them (which entails cleaning up the
897
+ // relevant DOM nodes)
898
+ removeVnodes(oldCh, oldStartIdx, oldEndIdx);
899
+ }
900
+ };
901
+ /**
902
+ * Compare two VNodes to determine if they are the same
903
+ *
904
+ * **NB**: This function is an equality _heuristic_ based on the available
905
+ * information set on the two VNodes and can be misleading under certain
906
+ * circumstances. In particular, if the two nodes do not have `key` attrs
907
+ * (available under `$key$` on VNodes) then the function falls back on merely
908
+ * checking that they have the same tag.
909
+ *
910
+ * So, in other words, if `key` attrs are not set on VNodes which may be
911
+ * changing order within a `children` array or something along those lines then
912
+ * we could obtain a false negative and then have to do needless re-rendering
913
+ * (i.e. we'd say two VNodes aren't equal when in fact they should be).
914
+ *
915
+ * @param leftVNode the first VNode to check
916
+ * @param rightVNode the second VNode to check
917
+ * @param isInitialRender whether or not this is the first render of the vdom
918
+ * @returns whether they're equal or not
919
+ */
920
+ const isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
921
+ // compare if two vnode to see if they're "technically" the same
922
+ // need to have the same element tag, and same key to be the same
923
+ if (leftVNode.$tag$ === rightVNode.$tag$) {
924
+ // this will be set if JSX tags in the build have `key` attrs set on them
925
+ // we only want to check this if we're not on the first render since on
926
+ // first render `leftVNode.$key$` will always be `null`, so we can be led
927
+ // astray and, for instance, accidentally delete a DOM node that we want to
928
+ // keep around.
929
+ if (!isInitialRender) {
930
+ return leftVNode.$key$ === rightVNode.$key$;
931
+ }
932
+ return true;
933
+ }
934
+ return false;
935
+ };
936
+ /**
937
+ * Handle reconciling an outdated VNode with a new one which corresponds to
938
+ * it. This function handles flushing updates to the DOM and reconciling the
939
+ * children of the two nodes (if any).
940
+ *
941
+ * @param oldVNode an old VNode whose DOM element and children we want to update
942
+ * @param newVNode a new VNode representing an updated version of the old one
943
+ * @param isInitialRender whether or not this is the first render of the vdom
944
+ */
945
+ const patch = (oldVNode, newVNode, isInitialRender = false) => {
946
+ const elm = (newVNode.$elm$ = oldVNode.$elm$);
947
+ const oldChildren = oldVNode.$children$;
948
+ const newChildren = newVNode.$children$;
949
+ const tag = newVNode.$tag$;
950
+ const text = newVNode.$text$;
951
+ if (text === null) {
952
+ {
953
+ // test if we're rendering an svg element, or still rendering nodes inside of one
954
+ // only add this to the when the compiler sees we're using an svg somewhere
955
+ isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
956
+ }
957
+ {
958
+ if (tag === 'slot')
959
+ ;
960
+ else {
961
+ // either this is the first render of an element OR it's an update
962
+ // AND we already know it's possible it could have changed
963
+ // this updates the element's css classes, attrs, props, listeners, etc.
964
+ updateElement(oldVNode, newVNode, isSvgMode);
965
+ }
966
+ }
967
+ if (oldChildren !== null && newChildren !== null) {
968
+ // looks like there's child vnodes for both the old and new vnodes
969
+ // so we need to call `updateChildren` to reconcile them
970
+ updateChildren(elm, oldChildren, newVNode, newChildren, isInitialRender);
971
+ }
972
+ else if (newChildren !== null) {
973
+ // no old child vnodes, but there are new child vnodes to add
974
+ if (oldVNode.$text$ !== null) {
975
+ // the old vnode was text, so be sure to clear it out
976
+ elm.textContent = '';
977
+ }
978
+ // add the new vnode children
979
+ addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1);
980
+ }
981
+ else if (oldChildren !== null) {
982
+ // no new child vnodes, but there are old child vnodes to remove
983
+ removeVnodes(oldChildren, 0, oldChildren.length - 1);
984
+ }
985
+ if (isSvgMode && tag === 'svg') {
986
+ isSvgMode = false;
987
+ }
988
+ }
989
+ else if (oldVNode.$text$ !== text) {
990
+ // update the text content for the text only vnode
991
+ // and also only if the text is different than before
992
+ elm.data = text;
993
+ }
994
+ };
995
+ /**
996
+ * 'Nullify' any VDom `ref` callbacks on a VDom node or its children by calling
997
+ * them with `null`. This signals that the DOM element corresponding to the VDom
998
+ * node has been removed from the DOM.
999
+ *
1000
+ * @param vNode a virtual DOM node
1001
+ */
1002
+ const nullifyVNodeRefs = (vNode) => {
1003
+ {
1004
+ vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
1005
+ vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
1006
+ }
1007
+ };
1008
+ /**
1009
+ * The main entry point for Stencil's virtual DOM-based rendering engine
1010
+ *
1011
+ * Given a {@link d.HostRef} container and some virtual DOM nodes, this
1012
+ * function will handle creating a virtual DOM tree with a single root, patching
1013
+ * the current virtual DOM tree onto an old one (if any), dealing with slot
1014
+ * relocation, and reflecting attributes.
1015
+ *
1016
+ * @param hostRef data needed to root and render the virtual DOM tree, such as
1017
+ * the DOM node into which it should be rendered.
1018
+ * @param renderFnResults the virtual DOM nodes to be rendered
1019
+ * @param isInitialLoad whether or not this is the first call after page load
1020
+ */
1021
+ const renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
1022
+ const hostElm = hostRef.$hostElement$;
1023
+ const oldVNode = hostRef.$vnode$ || newVNode(null, null);
1024
+ // if `renderFnResults` is a Host node then we can use it directly. If not,
1025
+ // we need to call `h` again to wrap the children of our component in a
1026
+ // 'dummy' Host node (well, an empty vnode) since `renderVdom` assumes
1027
+ // implicitly that the top-level vdom node is 1) an only child and 2)
1028
+ // contains attrs that need to be set on the host element.
1029
+ const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
1030
+ hostTagName = hostElm.tagName;
1031
+ // On the first render and *only* on the first render we want to check for
1032
+ // any attributes set on the host element which are also set on the vdom
1033
+ // node. If we find them, we override the value on the VDom node attrs with
1034
+ // the value from the host element, which allows developers building apps
1035
+ // with Stencil components to override e.g. the `role` attribute on a
1036
+ // component even if it's already set on the `Host`.
1037
+ if (isInitialLoad && rootVnode.$attrs$) {
1038
+ for (const key of Object.keys(rootVnode.$attrs$)) {
1039
+ // We have a special implementation in `setAccessor` for `style` and
1040
+ // `class` which reconciles values coming from the VDom with values
1041
+ // already present on the DOM element, so we don't want to override those
1042
+ // attributes on the VDom tree with values from the host element if they
1043
+ // are present.
1044
+ //
1045
+ // Likewise, `ref` and `key` are special internal values for the Stencil
1046
+ // runtime and we don't want to override those either.
1047
+ if (hostElm.hasAttribute(key) && !['key', 'ref', 'style', 'class'].includes(key)) {
1048
+ rootVnode.$attrs$[key] = hostElm[key];
1049
+ }
1050
+ }
1051
+ }
1052
+ rootVnode.$tag$ = null;
1053
+ rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
1054
+ hostRef.$vnode$ = rootVnode;
1055
+ rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
1056
+ {
1057
+ scopeId = hostElm['s-sc'];
1058
+ }
1059
+ // synchronous patch
1060
+ patch(oldVNode, rootVnode, isInitialLoad);
1061
+ };
1062
+ const attachToAncestor = (hostRef, ancestorComponent) => {
1063
+ if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
1064
+ ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
1065
+ }
1066
+ };
1067
+ const scheduleUpdate = (hostRef, isInitialLoad) => {
1068
+ {
1069
+ hostRef.$flags$ |= 16 /* HOST_FLAGS.isQueuedForUpdate */;
1070
+ }
1071
+ if (hostRef.$flags$ & 4 /* HOST_FLAGS.isWaitingForChildren */) {
1072
+ hostRef.$flags$ |= 512 /* HOST_FLAGS.needsRerender */;
1073
+ return;
1074
+ }
1075
+ attachToAncestor(hostRef, hostRef.$ancestorComponent$);
1076
+ // there is no ancestor component or the ancestor component
1077
+ // has already fired off its lifecycle update then
1078
+ // fire off the initial update
1079
+ const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
1080
+ return writeTask(dispatch) ;
1081
+ };
1082
+ /**
1083
+ * Dispatch initial-render and update lifecycle hooks, enqueuing calls to
1084
+ * component lifecycle methods like `componentWillLoad` as well as
1085
+ * {@link updateComponent}, which will kick off the virtual DOM re-render.
1086
+ *
1087
+ * @param hostRef a reference to a host DOM node
1088
+ * @param isInitialLoad whether we're on the initial load or not
1089
+ * @returns an empty Promise which is used to enqueue a series of operations for
1090
+ * the component
1091
+ */
1092
+ const dispatchHooks = (hostRef, isInitialLoad) => {
1093
+ const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
1094
+ const instance = hostRef.$lazyInstance$ ;
1095
+ // We're going to use this variable together with `enqueue` to implement a
1096
+ // little promise-based queue. We start out with it `undefined`. When we add
1097
+ // the first function to the queue we'll set this variable to be that
1098
+ // function's return value. When we attempt to add subsequent values to the
1099
+ // queue we'll check that value and, if it was a `Promise`, we'll then chain
1100
+ // the new function off of that `Promise` using `.then()`. This will give our
1101
+ // queue two nice properties:
1102
+ //
1103
+ // 1. If all functions added to the queue are synchronous they'll be called
1104
+ // synchronously right away.
1105
+ // 2. If all functions added to the queue are asynchronous they'll all be
1106
+ // called in order after `dispatchHooks` exits.
1107
+ let maybePromise;
1108
+ if (isInitialLoad) {
1109
+ {
1110
+ hostRef.$flags$ |= 256 /* HOST_FLAGS.isListenReady */;
1111
+ if (hostRef.$queuedListeners$) {
1112
+ hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
1113
+ hostRef.$queuedListeners$ = undefined;
1114
+ }
1115
+ }
1116
+ {
1117
+ // If `componentWillLoad` returns a `Promise` then we want to wait on
1118
+ // whatever's going on in that `Promise` before we launch into
1119
+ // rendering the component, doing other lifecycle stuff, etc. So
1120
+ // in that case we assign the returned promise to the variable we
1121
+ // declared above to hold a possible 'queueing' Promise
1122
+ maybePromise = safeCall(instance, 'componentWillLoad');
1123
+ }
1124
+ }
1125
+ {
1126
+ maybePromise = enqueue(maybePromise, () => safeCall(instance, 'componentWillRender'));
1127
+ }
1128
+ endSchedule();
1129
+ return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
1130
+ };
1131
+ /**
1132
+ * This function uses a Promise to implement a simple first-in, first-out queue
1133
+ * of functions to be called.
1134
+ *
1135
+ * The queue is ordered on the basis of the first argument. If it's
1136
+ * `undefined`, then nothing is on the queue yet, so the provided function can
1137
+ * be called synchronously (although note that this function may return a
1138
+ * `Promise`). The idea is that then the return value of that enqueueing
1139
+ * operation is kept around, so that if it was a `Promise` then subsequent
1140
+ * functions can be enqueued by calling this function again with that `Promise`
1141
+ * as the first argument.
1142
+ *
1143
+ * @param maybePromise either a `Promise` which should resolve before the next function is called or an 'empty' sentinel
1144
+ * @param fn a function to enqueue
1145
+ * @returns either a `Promise` or the return value of the provided function
1146
+ */
1147
+ const enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn) : fn();
1148
+ /**
1149
+ * Check that a value is a `Promise`. To check, we first see if the value is an
1150
+ * instance of the `Promise` global. In a few circumstances, in particular if
1151
+ * the global has been overwritten, this is could be misleading, so we also do
1152
+ * a little 'duck typing' check to see if the `.then` property of the value is
1153
+ * defined and a function.
1154
+ *
1155
+ * @param maybePromise it might be a promise!
1156
+ * @returns whether it is or not
1157
+ */
1158
+ const isPromisey = (maybePromise) => maybePromise instanceof Promise ||
1159
+ (maybePromise && maybePromise.then && typeof maybePromise.then === 'function');
1160
+ /**
1161
+ * Update a component given reference to its host elements and so on.
1162
+ *
1163
+ * @param hostRef an object containing references to the element's host node,
1164
+ * VDom nodes, and other metadata
1165
+ * @param instance a reference to the underlying host element where it will be
1166
+ * rendered
1167
+ * @param isInitialLoad whether or not this function is being called as part of
1168
+ * the first render cycle
1169
+ */
1170
+ const updateComponent = async (hostRef, instance, isInitialLoad) => {
1171
+ var _a;
1172
+ const elm = hostRef.$hostElement$;
1173
+ const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
1174
+ const rc = elm['s-rc'];
1175
+ if (isInitialLoad) {
1176
+ // DOM WRITE!
1177
+ attachStyles(hostRef);
1178
+ }
1179
+ const endRender = createTime('render', hostRef.$cmpMeta$.$tagName$);
1180
+ {
1181
+ callRender(hostRef, instance, elm, isInitialLoad);
1182
+ }
1183
+ if (rc) {
1184
+ // ok, so turns out there are some child host elements
1185
+ // waiting on this parent element to load
1186
+ // let's fire off all update callbacks waiting
1187
+ rc.map((cb) => cb());
1188
+ elm['s-rc'] = undefined;
1189
+ }
1190
+ endRender();
1191
+ endUpdate();
1192
+ {
1193
+ const childrenPromises = (_a = elm['s-p']) !== null && _a !== void 0 ? _a : [];
1194
+ const postUpdate = () => postUpdateComponent(hostRef);
1195
+ if (childrenPromises.length === 0) {
1196
+ postUpdate();
1197
+ }
1198
+ else {
1199
+ Promise.all(childrenPromises).then(postUpdate);
1200
+ hostRef.$flags$ |= 4 /* HOST_FLAGS.isWaitingForChildren */;
1201
+ childrenPromises.length = 0;
1202
+ }
1203
+ }
1204
+ };
1205
+ /**
1206
+ * Handle making the call to the VDom renderer with the proper context given
1207
+ * various build variables
1208
+ *
1209
+ * @param hostRef an object containing references to the element's host node,
1210
+ * VDom nodes, and other metadata
1211
+ * @param instance a reference to the underlying host element where it will be
1212
+ * rendered
1213
+ * @param elm the Host element for the component
1214
+ * @param isInitialLoad whether or not this function is being called as part of
1215
+ * @returns an empty promise
1216
+ */
1217
+ const callRender = (hostRef, instance, elm, isInitialLoad) => {
1218
+ try {
1219
+ renderingRef = instance;
1220
+ /**
1221
+ * minification optimization: `allRenderFn` is `true` if all components have a `render`
1222
+ * method, so we can call the method immediately. If not, check before calling it.
1223
+ */
1224
+ instance = instance.render() ;
1225
+ {
1226
+ hostRef.$flags$ &= ~16 /* HOST_FLAGS.isQueuedForUpdate */;
1227
+ }
1228
+ {
1229
+ hostRef.$flags$ |= 2 /* HOST_FLAGS.hasRendered */;
1230
+ }
1231
+ {
1232
+ {
1233
+ // looks like we've got child nodes to render into this host element
1234
+ // or we need to update the css class/attrs on the host element
1235
+ // DOM WRITE!
1236
+ {
1237
+ renderVdom(hostRef, instance, isInitialLoad);
1238
+ }
1239
+ }
1240
+ }
1241
+ }
1242
+ catch (e) {
1243
+ consoleError(e, hostRef.$hostElement$);
1244
+ }
1245
+ renderingRef = null;
1246
+ return null;
1247
+ };
1248
+ const getRenderingRef = () => renderingRef;
1249
+ const postUpdateComponent = (hostRef) => {
1250
+ const tagName = hostRef.$cmpMeta$.$tagName$;
1251
+ const elm = hostRef.$hostElement$;
1252
+ const endPostUpdate = createTime('postUpdate', tagName);
1253
+ const instance = hostRef.$lazyInstance$ ;
1254
+ const ancestorComponent = hostRef.$ancestorComponent$;
1255
+ if (!(hostRef.$flags$ & 64 /* HOST_FLAGS.hasLoadedComponent */)) {
1256
+ hostRef.$flags$ |= 64 /* HOST_FLAGS.hasLoadedComponent */;
1257
+ {
1258
+ // DOM WRITE!
1259
+ addHydratedFlag(elm);
1260
+ }
1261
+ {
1262
+ safeCall(instance, 'componentDidLoad');
1263
+ }
1264
+ endPostUpdate();
1265
+ {
1266
+ hostRef.$onReadyResolve$(elm);
1267
+ if (!ancestorComponent) {
1268
+ appDidLoad();
1269
+ }
1270
+ }
1271
+ }
1272
+ else {
1273
+ endPostUpdate();
1274
+ }
1275
+ {
1276
+ hostRef.$onInstanceResolve$(elm);
1277
+ }
1278
+ // load events fire from bottom to top
1279
+ // the deepest elements load first then bubbles up
1280
+ {
1281
+ if (hostRef.$onRenderResolve$) {
1282
+ hostRef.$onRenderResolve$();
1283
+ hostRef.$onRenderResolve$ = undefined;
1284
+ }
1285
+ if (hostRef.$flags$ & 512 /* HOST_FLAGS.needsRerender */) {
1286
+ nextTick(() => scheduleUpdate(hostRef, false));
1287
+ }
1288
+ hostRef.$flags$ &= ~(4 /* HOST_FLAGS.isWaitingForChildren */ | 512 /* HOST_FLAGS.needsRerender */);
1289
+ }
1290
+ // ( •_•)
1291
+ // ( •_•)>⌐■-■
1292
+ // (⌐■_■)
1293
+ };
1294
+ const forceUpdate = (ref) => {
1295
+ {
1296
+ const hostRef = getHostRef(ref);
1297
+ const isConnected = hostRef.$hostElement$.isConnected;
1298
+ if (isConnected &&
1299
+ (hostRef.$flags$ & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
1300
+ scheduleUpdate(hostRef, false);
1301
+ }
1302
+ // Returns "true" when the forced update was successfully scheduled
1303
+ return isConnected;
1304
+ }
1305
+ };
1306
+ const appDidLoad = (who) => {
1307
+ // on appload
1308
+ // we have finish the first big initial render
1309
+ {
1310
+ addHydratedFlag(doc.documentElement);
1311
+ }
1312
+ nextTick(() => emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }));
1313
+ };
1314
+ /**
1315
+ * Allows to safely call a method, e.g. `componentDidLoad`, on an instance,
1316
+ * e.g. custom element node. If a build figures out that e.g. no component
1317
+ * has a `componentDidLoad` method, the instance method gets removed from the
1318
+ * output bundle and this function returns `undefined`.
1319
+ * @param instance any object that may or may not contain methods
1320
+ * @param method method name
1321
+ * @param arg single arbitrary argument
1322
+ * @returns result of method call if it exists, otherwise `undefined`
1323
+ */
1324
+ const safeCall = (instance, method, arg) => {
1325
+ if (instance && instance[method]) {
1326
+ try {
1327
+ return instance[method](arg);
1328
+ }
1329
+ catch (e) {
1330
+ consoleError(e);
1331
+ }
1332
+ }
1333
+ return undefined;
1334
+ };
1335
+ const addHydratedFlag = (elm) => elm.classList.add('hydrated')
1336
+ ;
1337
+ const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
1338
+ const setValue = (ref, propName, newVal, cmpMeta) => {
1339
+ // check our new property value against our internal value
1340
+ const hostRef = getHostRef(ref);
1341
+ const elm = hostRef.$hostElement$ ;
1342
+ const oldVal = hostRef.$instanceValues$.get(propName);
1343
+ const flags = hostRef.$flags$;
1344
+ const instance = hostRef.$lazyInstance$ ;
1345
+ newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
1346
+ // explicitly check for NaN on both sides, as `NaN === NaN` is always false
1347
+ const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
1348
+ const didValueChange = newVal !== oldVal && !areBothNaN;
1349
+ if ((!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) || oldVal === undefined) && didValueChange) {
1350
+ // gadzooks! the property's value has changed!!
1351
+ // set our new value!
1352
+ hostRef.$instanceValues$.set(propName, newVal);
1353
+ if (instance) {
1354
+ // get an array of method names of watch functions to call
1355
+ if (cmpMeta.$watchers$ && flags & 128 /* HOST_FLAGS.isWatchReady */) {
1356
+ const watchMethods = cmpMeta.$watchers$[propName];
1357
+ if (watchMethods) {
1358
+ // this instance is watching for when this property changed
1359
+ watchMethods.map((watchMethodName) => {
1360
+ try {
1361
+ // fire off each of the watch methods that are watching this property
1362
+ instance[watchMethodName](newVal, oldVal, propName);
1363
+ }
1364
+ catch (e) {
1365
+ consoleError(e, elm);
1366
+ }
1367
+ });
1368
+ }
1369
+ }
1370
+ if ((flags & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
1371
+ // looks like this value actually changed, so we've got work to do!
1372
+ // but only if we've already rendered, otherwise just chill out
1373
+ // queue that we need to do an update, but don't worry about queuing
1374
+ // up millions cuz this function ensures it only runs once
1375
+ scheduleUpdate(hostRef, false);
1376
+ }
1377
+ }
1378
+ }
1379
+ };
1380
+ /**
1381
+ * Attach a series of runtime constructs to a compiled Stencil component
1382
+ * constructor, including getters and setters for the `@Prop` and `@State`
1383
+ * decorators, callbacks for when attributes change, and so on.
1384
+ *
1385
+ * @param Cstr the constructor for a component that we need to process
1386
+ * @param cmpMeta metadata collected previously about the component
1387
+ * @param flags a number used to store a series of bit flags
1388
+ * @returns a reference to the same constructor passed in (but now mutated)
1389
+ */
1390
+ const proxyComponent = (Cstr, cmpMeta, flags) => {
1391
+ var _a;
1392
+ const prototype = Cstr.prototype;
1393
+ if (cmpMeta.$members$) {
1394
+ if (Cstr.watchers) {
1395
+ cmpMeta.$watchers$ = Cstr.watchers;
1396
+ }
1397
+ // It's better to have a const than two Object.entries()
1398
+ const members = Object.entries(cmpMeta.$members$);
1399
+ members.map(([memberName, [memberFlags]]) => {
1400
+ if ((memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
1401
+ ((flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
1402
+ // proxyComponent - prop
1403
+ Object.defineProperty(prototype, memberName, {
1404
+ get() {
1405
+ // proxyComponent, get value
1406
+ return getValue(this, memberName);
1407
+ },
1408
+ set(newValue) {
1409
+ // proxyComponent, set value
1410
+ setValue(this, memberName, newValue, cmpMeta);
1411
+ },
1412
+ configurable: true,
1413
+ enumerable: true,
1414
+ });
1415
+ }
1416
+ else if (flags & 1 /* PROXY_FLAGS.isElementConstructor */ &&
1417
+ memberFlags & 64 /* MEMBER_FLAGS.Method */) {
1418
+ // proxyComponent - method
1419
+ Object.defineProperty(prototype, memberName, {
1420
+ value(...args) {
1421
+ var _a;
1422
+ const ref = getHostRef(this);
1423
+ return (_a = ref === null || ref === void 0 ? void 0 : ref.$onInstancePromise$) === null || _a === void 0 ? void 0 : _a.then(() => { var _a; return (_a = ref.$lazyInstance$) === null || _a === void 0 ? void 0 : _a[memberName](...args); });
1424
+ },
1425
+ });
1426
+ }
1427
+ });
1428
+ if ((flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
1429
+ const attrNameToPropName = new Map();
1430
+ prototype.attributeChangedCallback = function (attrName, oldValue, newValue) {
1431
+ plt.jmp(() => {
1432
+ var _a;
1433
+ const propName = attrNameToPropName.get(attrName);
1434
+ // In a web component lifecycle the attributeChangedCallback runs prior to connectedCallback
1435
+ // in the case where an attribute was set inline.
1436
+ // ```html
1437
+ // <my-component some-attribute="some-value"></my-component>
1438
+ // ```
1439
+ //
1440
+ // There is an edge case where a developer sets the attribute inline on a custom element and then
1441
+ // programmatically changes it before it has been upgraded as shown below:
1442
+ //
1443
+ // ```html
1444
+ // <!-- this component has _not_ been upgraded yet -->
1445
+ // <my-component id="test" some-attribute="some-value"></my-component>
1446
+ // <script>
1447
+ // // grab non-upgraded component
1448
+ // el = document.querySelector("#test");
1449
+ // el.someAttribute = "another-value";
1450
+ // // upgrade component
1451
+ // customElements.define('my-component', MyComponent);
1452
+ // </script>
1453
+ // ```
1454
+ // In this case if we do not un-shadow here and use the value of the shadowing property, attributeChangedCallback
1455
+ // will be called with `newValue = "some-value"` and will set the shadowed property (this.someAttribute = "another-value")
1456
+ // to the value that was set inline i.e. "some-value" from above example. When
1457
+ // the connectedCallback attempts to un-shadow it will use "some-value" as the initial value rather than "another-value"
1458
+ //
1459
+ // The case where the attribute was NOT set inline but was not set programmatically shall be handled/un-shadowed
1460
+ // by connectedCallback as this attributeChangedCallback will not fire.
1461
+ //
1462
+ // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
1463
+ //
1464
+ // TODO(STENCIL-16) we should think about whether or not we actually want to be reflecting the attributes to
1465
+ // properties here given that this goes against best practices outlined here
1466
+ // https://developers.google.com/web/fundamentals/web-components/best-practices#avoid-reentrancy
1467
+ if (this.hasOwnProperty(propName)) {
1468
+ newValue = this[propName];
1469
+ delete this[propName];
1470
+ }
1471
+ else if (prototype.hasOwnProperty(propName) &&
1472
+ typeof this[propName] === 'number' &&
1473
+ this[propName] == newValue) {
1474
+ // if the propName exists on the prototype of `Cstr`, this update may be a result of Stencil using native
1475
+ // APIs to reflect props as attributes. Calls to `setAttribute(someElement, propName)` will result in
1476
+ // `propName` to be converted to a `DOMString`, which may not be what we want for other primitive props.
1477
+ return;
1478
+ }
1479
+ else if (propName == null) {
1480
+ // At this point we should know this is not a "member", so we can treat it like watching an attribute
1481
+ // on a vanilla web component
1482
+ const hostRef = getHostRef(this);
1483
+ const flags = hostRef === null || hostRef === void 0 ? void 0 : hostRef.$flags$;
1484
+ // We only want to trigger the callback(s) if:
1485
+ // 1. The instance is ready
1486
+ // 2. The watchers are ready
1487
+ // 3. The value has changed
1488
+ if (flags &&
1489
+ !(flags & 8 /* HOST_FLAGS.isConstructingInstance */) &&
1490
+ flags & 128 /* HOST_FLAGS.isWatchReady */ &&
1491
+ newValue !== oldValue) {
1492
+ const instance = hostRef.$lazyInstance$ ;
1493
+ const entry = (_a = cmpMeta.$watchers$) === null || _a === void 0 ? void 0 : _a[attrName];
1494
+ entry === null || entry === void 0 ? void 0 : entry.forEach((callbackName) => {
1495
+ if (instance[callbackName] != null) {
1496
+ instance[callbackName].call(instance, newValue, oldValue, attrName);
1497
+ }
1498
+ });
1499
+ }
1500
+ return;
1501
+ }
1502
+ this[propName] = newValue === null && typeof this[propName] === 'boolean' ? false : newValue;
1503
+ });
1504
+ };
1505
+ // Create an array of attributes to observe
1506
+ // This list in comprised of all strings used within a `@Watch()` decorator
1507
+ // on a component as well as any Stencil-specific "members" (`@Prop()`s and `@State()`s).
1508
+ // As such, there is no way to guarantee type-safety here that a user hasn't entered
1509
+ // an invalid attribute.
1510
+ Cstr.observedAttributes = Array.from(new Set([
1511
+ ...Object.keys((_a = cmpMeta.$watchers$) !== null && _a !== void 0 ? _a : {}),
1512
+ ...members
1513
+ .filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */)
1514
+ .map(([propName, m]) => {
1515
+ const attrName = m[1] || propName;
1516
+ attrNameToPropName.set(attrName, propName);
1517
+ return attrName;
1518
+ }),
1519
+ ]));
1520
+ }
1521
+ }
1522
+ return Cstr;
1523
+ };
1524
+ /**
1525
+ * Initialize a Stencil component given a reference to its host element, its
1526
+ * runtime bookkeeping data structure, runtime metadata about the component,
1527
+ * and (optionally) an HMR version ID.
1528
+ *
1529
+ * @param elm a host element
1530
+ * @param hostRef the element's runtime bookkeeping object
1531
+ * @param cmpMeta runtime metadata for the Stencil component
1532
+ * @param hmrVersionId an (optional) HMR version ID
1533
+ */
1534
+ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1535
+ let Cstr;
1536
+ // initializeComponent
1537
+ if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
1538
+ // Let the runtime know that the component has been initialized
1539
+ hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
1540
+ {
1541
+ // lazy loaded components
1542
+ // request the component's implementation to be
1543
+ // wired up with the host element
1544
+ Cstr = loadModule(cmpMeta);
1545
+ if (Cstr.then) {
1546
+ // Await creates a micro-task avoid if possible
1547
+ const endLoad = uniqueTime();
1548
+ Cstr = await Cstr;
1549
+ endLoad();
1550
+ }
1551
+ if (!Cstr.isProxied) {
1552
+ // we've never proxied this Constructor before
1553
+ // let's add the getters/setters to its prototype before
1554
+ // the first time we create an instance of the implementation
1555
+ {
1556
+ cmpMeta.$watchers$ = Cstr.watchers;
1557
+ }
1558
+ proxyComponent(Cstr, cmpMeta, 2 /* PROXY_FLAGS.proxyState */);
1559
+ Cstr.isProxied = true;
1560
+ }
1561
+ const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
1562
+ // ok, time to construct the instance
1563
+ // but let's keep track of when we start and stop
1564
+ // so that the getters/setters don't incorrectly step on data
1565
+ {
1566
+ hostRef.$flags$ |= 8 /* HOST_FLAGS.isConstructingInstance */;
1567
+ }
1568
+ // construct the lazy-loaded component implementation
1569
+ // passing the hostRef is very important during
1570
+ // construction in order to directly wire together the
1571
+ // host element and the lazy-loaded instance
1572
+ try {
1573
+ new Cstr(hostRef);
1574
+ }
1575
+ catch (e) {
1576
+ consoleError(e);
1577
+ }
1578
+ {
1579
+ hostRef.$flags$ &= ~8 /* HOST_FLAGS.isConstructingInstance */;
1580
+ }
1581
+ {
1582
+ hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */;
1583
+ }
1584
+ endNewInstance();
1585
+ fireConnectedCallback(hostRef.$lazyInstance$);
1586
+ }
1587
+ if (Cstr.style) {
1588
+ // this component has styles but we haven't registered them yet
1589
+ let style = Cstr.style;
1590
+ const scopeId = getScopeId(cmpMeta);
1591
+ if (!styles.has(scopeId)) {
1592
+ const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
1593
+ registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */));
1594
+ endRegisterStyles();
1595
+ }
1596
+ }
1597
+ }
1598
+ // we've successfully created a lazy instance
1599
+ const ancestorComponent = hostRef.$ancestorComponent$;
1600
+ const schedule = () => scheduleUpdate(hostRef, true);
1601
+ if (ancestorComponent && ancestorComponent['s-rc']) {
1602
+ // this is the initial load and this component it has an ancestor component
1603
+ // but the ancestor component has NOT fired its will update lifecycle yet
1604
+ // so let's just cool our jets and wait for the ancestor to continue first
1605
+ // this will get fired off when the ancestor component
1606
+ // finally gets around to rendering its lazy self
1607
+ // fire off the initial update
1608
+ ancestorComponent['s-rc'].push(schedule);
1609
+ }
1610
+ else {
1611
+ schedule();
1612
+ }
1613
+ };
1614
+ const fireConnectedCallback = (instance) => {
1615
+ {
1616
+ safeCall(instance, 'connectedCallback');
1617
+ }
1618
+ };
1619
+ const connectedCallback = (elm) => {
1620
+ if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
1621
+ const hostRef = getHostRef(elm);
1622
+ const cmpMeta = hostRef.$cmpMeta$;
1623
+ const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
1624
+ if (!(hostRef.$flags$ & 1 /* HOST_FLAGS.hasConnected */)) {
1625
+ // first time this component has connected
1626
+ hostRef.$flags$ |= 1 /* HOST_FLAGS.hasConnected */;
1627
+ {
1628
+ // find the first ancestor component (if there is one) and register
1629
+ // this component as one of the actively loading child components for its ancestor
1630
+ let ancestorComponent = elm;
1631
+ while ((ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host)) {
1632
+ // climb up the ancestors looking for the first
1633
+ // component that hasn't finished its lifecycle update yet
1634
+ if (ancestorComponent['s-p']) {
1635
+ // we found this components first ancestor component
1636
+ // keep a reference to this component's ancestor component
1637
+ attachToAncestor(hostRef, (hostRef.$ancestorComponent$ = ancestorComponent));
1638
+ break;
1639
+ }
1640
+ }
1641
+ }
1642
+ // Lazy properties
1643
+ // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
1644
+ if (cmpMeta.$members$) {
1645
+ Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
1646
+ if (memberFlags & 31 /* MEMBER_FLAGS.Prop */ && elm.hasOwnProperty(memberName)) {
1647
+ const value = elm[memberName];
1648
+ delete elm[memberName];
1649
+ elm[memberName] = value;
1650
+ }
1651
+ });
1652
+ }
1653
+ {
1654
+ initializeComponent(elm, hostRef, cmpMeta);
1655
+ }
1656
+ }
1657
+ else {
1658
+ // not the first time this has connected
1659
+ // reattach any event listeners to the host
1660
+ // since they would have been removed when disconnected
1661
+ addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
1662
+ // fire off connectedCallback() on component instance
1663
+ if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) {
1664
+ fireConnectedCallback(hostRef.$lazyInstance$);
1665
+ }
1666
+ else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
1667
+ hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$));
1668
+ }
1669
+ }
1670
+ endConnected();
1671
+ }
1672
+ };
1673
+ const disconnectInstance = (instance) => {
1674
+ {
1675
+ safeCall(instance, 'disconnectedCallback');
1676
+ }
1677
+ };
1678
+ const disconnectedCallback = async (elm) => {
1679
+ if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
1680
+ const hostRef = getHostRef(elm);
1681
+ {
1682
+ if (hostRef.$rmListeners$) {
1683
+ hostRef.$rmListeners$.map((rmListener) => rmListener());
1684
+ hostRef.$rmListeners$ = undefined;
1685
+ }
1686
+ }
1687
+ if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) {
1688
+ disconnectInstance(hostRef.$lazyInstance$);
1689
+ }
1690
+ else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
1691
+ hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$));
1692
+ }
1693
+ }
1694
+ };
1695
+ const bootstrapLazy = (lazyBundles, options = {}) => {
1696
+ var _a;
1697
+ const endBootstrap = createTime();
1698
+ const cmpTags = [];
1699
+ const exclude = options.exclude || [];
1700
+ const customElements = win.customElements;
1701
+ const head = doc.head;
1702
+ const metaCharset = /*@__PURE__*/ head.querySelector('meta[charset]');
1703
+ const dataStyles = /*@__PURE__*/ doc.createElement('style');
1704
+ const deferredConnectedCallbacks = [];
1705
+ let appLoadFallback;
1706
+ let isBootstrapping = true;
1707
+ Object.assign(plt, options);
1708
+ plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
1709
+ let hasSlotRelocation = false;
1710
+ lazyBundles.map((lazyBundle) => {
1711
+ lazyBundle[1].map((compactMeta) => {
1712
+ var _a;
1713
+ const cmpMeta = {
1714
+ $flags$: compactMeta[0],
1715
+ $tagName$: compactMeta[1],
1716
+ $members$: compactMeta[2],
1717
+ $listeners$: compactMeta[3],
1718
+ };
1719
+ // Check if we are using slots outside the shadow DOM in this component.
1720
+ // We'll use this information later to add styles for `slot-fb` elements
1721
+ if (cmpMeta.$flags$ & 4 /* CMP_FLAGS.hasSlotRelocation */) {
1722
+ hasSlotRelocation = true;
1723
+ }
1724
+ {
1725
+ cmpMeta.$members$ = compactMeta[2];
1726
+ }
1727
+ {
1728
+ cmpMeta.$listeners$ = compactMeta[3];
1729
+ }
1730
+ {
1731
+ cmpMeta.$watchers$ = (_a = compactMeta[4]) !== null && _a !== void 0 ? _a : {};
1732
+ }
1733
+ const tagName = cmpMeta.$tagName$;
1734
+ const HostElement = class extends HTMLElement {
1735
+ // StencilLazyHost
1736
+ constructor(self) {
1737
+ // @ts-ignore
1738
+ super(self);
1739
+ self = this;
1740
+ registerHost(self, cmpMeta);
1741
+ if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
1742
+ // this component is using shadow dom
1743
+ // and this browser supports shadow dom
1744
+ // add the read-only property "shadowRoot" to the host element
1745
+ // adding the shadow root build conditionals to minimize runtime
1746
+ {
1747
+ {
1748
+ self.attachShadow({ mode: 'open' });
1749
+ }
1750
+ }
1751
+ }
1752
+ }
1753
+ connectedCallback() {
1754
+ if (appLoadFallback) {
1755
+ clearTimeout(appLoadFallback);
1756
+ appLoadFallback = null;
1757
+ }
1758
+ if (isBootstrapping) {
1759
+ // connectedCallback will be processed once all components have been registered
1760
+ deferredConnectedCallbacks.push(this);
1761
+ }
1762
+ else {
1763
+ plt.jmp(() => connectedCallback(this));
1764
+ }
1765
+ }
1766
+ disconnectedCallback() {
1767
+ plt.jmp(() => disconnectedCallback(this));
1768
+ }
1769
+ componentOnReady() {
1770
+ return getHostRef(this).$onReadyPromise$;
1771
+ }
1772
+ };
1773
+ cmpMeta.$lazyBundleId$ = lazyBundle[0];
1774
+ if (!exclude.includes(tagName) && !customElements.get(tagName)) {
1775
+ cmpTags.push(tagName);
1776
+ customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* PROXY_FLAGS.isElementConstructor */));
1777
+ }
1778
+ });
1779
+ });
1780
+ // Add styles for `slot-fb` elements if any of our components are using slots outside the Shadow DOM
1781
+ if (hasSlotRelocation) {
1782
+ dataStyles.innerHTML += SLOT_FB_CSS;
1783
+ }
1784
+ // Add hydration styles
1785
+ {
1786
+ dataStyles.innerHTML += cmpTags + HYDRATED_CSS;
1787
+ }
1788
+ // If we have styles, add them to the DOM
1789
+ if (dataStyles.innerHTML.length) {
1790
+ dataStyles.setAttribute('data-styles', '');
1791
+ // Apply CSP nonce to the style tag if it exists
1792
+ const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
1793
+ if (nonce != null) {
1794
+ dataStyles.setAttribute('nonce', nonce);
1795
+ }
1796
+ // Insert the styles into the document head
1797
+ // NOTE: this _needs_ to happen last so we can ensure the nonce (and other attributes) are applied
1798
+ head.insertBefore(dataStyles, metaCharset ? metaCharset.nextSibling : head.firstChild);
1799
+ }
1800
+ // Process deferred connectedCallbacks now all components have been registered
1801
+ isBootstrapping = false;
1802
+ if (deferredConnectedCallbacks.length) {
1803
+ deferredConnectedCallbacks.map((host) => host.connectedCallback());
1804
+ }
1805
+ else {
1806
+ {
1807
+ plt.jmp(() => (appLoadFallback = setTimeout(appDidLoad, 30)));
1808
+ }
1809
+ }
1810
+ // Fallback appLoad event
1811
+ endBootstrap();
1812
+ };
1813
+ const Fragment = (_, children) => children;
1814
+ const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
1815
+ if (listeners) {
1816
+ listeners.map(([flags, name, method]) => {
1817
+ const target = getHostListenerTarget(elm, flags) ;
1818
+ const handler = hostListenerProxy(hostRef, method);
1819
+ const opts = hostListenerOpts(flags);
1820
+ plt.ael(target, name, handler, opts);
1821
+ (hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
1822
+ });
1823
+ }
1824
+ };
1825
+ const hostListenerProxy = (hostRef, methodName) => (ev) => {
1826
+ try {
1827
+ {
1828
+ if (hostRef.$flags$ & 256 /* HOST_FLAGS.isListenReady */) {
1829
+ // instance is ready, let's call it's member method for this event
1830
+ hostRef.$lazyInstance$[methodName](ev);
1831
+ }
1832
+ else {
1833
+ (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
1834
+ }
1835
+ }
1836
+ }
1837
+ catch (e) {
1838
+ consoleError(e);
1839
+ }
1840
+ };
1841
+ const getHostListenerTarget = (elm, flags) => {
1842
+ if (flags & 8 /* LISTENER_FLAGS.TargetWindow */)
1843
+ return win;
1844
+ if (flags & 16 /* LISTENER_FLAGS.TargetBody */)
1845
+ return doc.body;
1846
+ return elm;
1847
+ };
1848
+ // prettier-ignore
1849
+ const hostListenerOpts = (flags) => supportsListenerOptions
1850
+ ? ({
1851
+ passive: (flags & 1 /* LISTENER_FLAGS.Passive */) !== 0,
1852
+ capture: (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0,
1853
+ })
1854
+ : (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0;
1855
+ /**
1856
+ * Assigns the given value to the nonce property on the runtime platform object.
1857
+ * During runtime, this value is used to set the nonce attribute on all dynamically created script and style tags.
1858
+ * @param nonce The value to be assigned to the platform nonce property.
1859
+ * @returns void
1860
+ */
1861
+ const setNonce = (nonce) => (plt.$nonce$ = nonce);
1862
+ /**
1863
+ * A WeakMap mapping runtime component references to their corresponding host reference
1864
+ * instances.
1865
+ *
1866
+ * **Note**: If we're in an HMR context we need to store a reference to this
1867
+ * value on `window` in order to maintain the mapping of {@link d.RuntimeRef}
1868
+ * to {@link d.HostRef} across HMR updates.
1869
+ *
1870
+ * This is necessary because when HMR updates for a component are processed by
1871
+ * the browser-side dev server client the JS bundle for that component is
1872
+ * re-fetched. Since the module containing {@link hostRefs} is included in
1873
+ * that bundle, if we do not store a reference to it the new iteration of the
1874
+ * component will not have access to the previous hostRef map, leading to a
1875
+ * bug where the new version of the component cannot properly initialize.
1876
+ */
1877
+ const hostRefs = new WeakMap();
1878
+ /**
1879
+ * Given a {@link d.RuntimeRef} retrieve the corresponding {@link d.HostRef}
1880
+ *
1881
+ * @param ref the runtime ref of interest
1882
+ * @returns the Host reference (if found) or undefined
1883
+ */
1884
+ const getHostRef = (ref) => hostRefs.get(ref);
1885
+ /**
1886
+ * Register a lazy instance with the {@link hostRefs} object so it's
1887
+ * corresponding {@link d.HostRef} can be retrieved later.
1888
+ *
1889
+ * @param lazyInstance the lazy instance of interest
1890
+ * @param hostRef that instances `HostRef` object
1891
+ * @returns a reference to the host ref WeakMap
1892
+ */
1893
+ const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
1894
+ /**
1895
+ * Register a host element for a Stencil component, setting up various metadata
1896
+ * and callbacks based on {@link BUILD} flags as well as the component's runtime
1897
+ * metadata.
1898
+ *
1899
+ * @param hostElement the host element to register
1900
+ * @param cmpMeta runtime metadata for that component
1901
+ * @returns a reference to the host ref WeakMap
1902
+ */
1903
+ const registerHost = (hostElement, cmpMeta) => {
1904
+ const hostRef = {
1905
+ $flags$: 0,
1906
+ $hostElement$: hostElement,
1907
+ $cmpMeta$: cmpMeta,
1908
+ $instanceValues$: new Map(),
1909
+ };
1910
+ {
1911
+ hostRef.$onInstancePromise$ = new Promise((r) => (hostRef.$onInstanceResolve$ = r));
1912
+ }
1913
+ {
1914
+ hostRef.$onReadyPromise$ = new Promise((r) => (hostRef.$onReadyResolve$ = r));
1915
+ hostElement['s-p'] = [];
1916
+ hostElement['s-rc'] = [];
1917
+ }
1918
+ addHostEventListeners(hostElement, hostRef, cmpMeta.$listeners$);
1919
+ return hostRefs.set(hostElement, hostRef);
1920
+ };
1921
+ const isMemberInElement = (elm, memberName) => memberName in elm;
1922
+ const consoleError = (e, el) => (0, console.error)(e, el);
1923
+ const cmpModules = /*@__PURE__*/ new Map();
1924
+ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
1925
+ // loadModuleImport
1926
+ const exportName = cmpMeta.$tagName$.replace(/-/g, '_');
1927
+ const bundleId = cmpMeta.$lazyBundleId$;
1928
+ const module = cmpModules.get(bundleId) ;
1929
+ if (module) {
1930
+ return module[exportName];
1931
+ }
1932
+
1933
+ if (!hmrVersionId || !BUILD.hotModuleReplacement) {
1934
+ const processMod = importedModule => {
1935
+ cmpModules.set(bundleId, importedModule);
1936
+ return importedModule[exportName];
1937
+ }
1938
+ switch(bundleId) {
1939
+
1940
+ case 'nylas-if-state_3':
1941
+ return import(
1942
+ /* webpackMode: "lazy" */
1943
+ './nylas-if-state_3.entry.js').then(processMod, consoleError);
1944
+ case 'document-refresh-icon':
1945
+ return import(
1946
+ /* webpackMode: "lazy" */
1947
+ './document-refresh-icon.entry.js').then(processMod, consoleError);
1948
+ case 'nylas-list-folders':
1949
+ return import(
1950
+ /* webpackMode: "lazy" */
1951
+ './nylas-list-folders.entry.js').then(processMod, consoleError);
1952
+ case 'nylas-list-threads':
1953
+ return import(
1954
+ /* webpackMode: "lazy" */
1955
+ './nylas-list-threads.entry.js').then(processMod, consoleError);
1956
+ case 'nylas-mailbox-pagination':
1957
+ return import(
1958
+ /* webpackMode: "lazy" */
1959
+ './nylas-mailbox-pagination.entry.js').then(processMod, consoleError);
1960
+ case 'nylas-mailbox-toolbar-button':
1961
+ return import(
1962
+ /* webpackMode: "lazy" */
1963
+ './nylas-mailbox-toolbar-button.entry.js').then(processMod, consoleError);
1964
+ case 'nylas-open-hours-picker':
1965
+ return import(
1966
+ /* webpackMode: "lazy" */
1967
+ './nylas-open-hours-picker.entry.js').then(processMod, consoleError);
1968
+ case 'nylas-provider':
1969
+ return import(
1970
+ /* webpackMode: "lazy" */
1971
+ './nylas-provider.entry.js').then(processMod, consoleError);
1972
+ case 'nylas-scheduler':
1973
+ return import(
1974
+ /* webpackMode: "lazy" */
1975
+ './nylas-scheduler.entry.js').then(processMod, consoleError);
1976
+ case 'nylas-threads-refresh':
1977
+ return import(
1978
+ /* webpackMode: "lazy" */
1979
+ './nylas-threads-refresh.entry.js').then(processMod, consoleError);
1980
+ case 'nylas-threads-search':
1981
+ return import(
1982
+ /* webpackMode: "lazy" */
1983
+ './nylas-threads-search.entry.js').then(processMod, consoleError);
1984
+ case 'nylas-view-thread':
1985
+ return import(
1986
+ /* webpackMode: "lazy" */
1987
+ './nylas-view-thread.entry.js').then(processMod, consoleError);
1988
+ case 'archive-icon_7':
1989
+ return import(
1990
+ /* webpackMode: "lazy" */
1991
+ './archive-icon_7.entry.js').then(processMod, consoleError);
1992
+ case 'arrow-icon':
1993
+ return import(
1994
+ /* webpackMode: "lazy" */
1995
+ './arrow-icon.entry.js').then(processMod, consoleError);
1996
+ case 'forward-icon_6':
1997
+ return import(
1998
+ /* webpackMode: "lazy" */
1999
+ './forward-icon_6.entry.js').then(processMod, consoleError);
2000
+ case 'nylas-booked-event-card_9':
2001
+ return import(
2002
+ /* webpackMode: "lazy" */
2003
+ './nylas-booked-event-card_9.entry.js').then(processMod, consoleError);
2004
+ case 'bold-icon_3':
2005
+ return import(
2006
+ /* webpackMode: "lazy" */
2007
+ './bold-icon_3.entry.js').then(processMod, consoleError);
2008
+ case 'calendar-cancel-icon':
2009
+ return import(
2010
+ /* webpackMode: "lazy" */
2011
+ './calendar-cancel-icon.entry.js').then(processMod, consoleError);
2012
+ case 'calendar-check-icon_3':
2013
+ return import(
2014
+ /* webpackMode: "lazy" */
2015
+ './calendar-check-icon_3.entry.js').then(processMod, consoleError);
2016
+ case 'calendar-icon':
2017
+ return import(
2018
+ /* webpackMode: "lazy" */
2019
+ './calendar-icon.entry.js').then(processMod, consoleError);
2020
+ case 'close-icon_2':
2021
+ return import(
2022
+ /* webpackMode: "lazy" */
2023
+ './close-icon_2.entry.js').then(processMod, consoleError);
2024
+ case 'play-icon_2':
2025
+ return import(
2026
+ /* webpackMode: "lazy" */
2027
+ './play-icon_2.entry.js').then(processMod, consoleError);
2028
+ case 'refresh-icon':
2029
+ return import(
2030
+ /* webpackMode: "lazy" */
2031
+ './refresh-icon.entry.js').then(processMod, consoleError);
2032
+ case 'translate-icon':
2033
+ return import(
2034
+ /* webpackMode: "lazy" */
2035
+ './translate-icon.entry.js').then(processMod, consoleError);
2036
+ case 'chevron-icon':
2037
+ return import(
2038
+ /* webpackMode: "lazy" */
2039
+ './chevron-icon.entry.js').then(processMod, consoleError);
2040
+ case 'globe-icon':
2041
+ return import(
2042
+ /* webpackMode: "lazy" */
2043
+ './globe-icon.entry.js').then(processMod, consoleError);
2044
+ case 'loading-icon':
2045
+ return import(
2046
+ /* webpackMode: "lazy" */
2047
+ './loading-icon.entry.js').then(processMod, consoleError);
2048
+ }
2049
+ }
2050
+ return import(
2051
+ /* @vite-ignore */
2052
+ /* webpackInclude: /\.entry\.js$/ */
2053
+ /* webpackExclude: /\.system\.entry\.js$/ */
2054
+ /* webpackMode: "lazy" */
2055
+ `./${bundleId}.entry.js${''}`).then((importedModule) => {
2056
+ {
2057
+ cmpModules.set(bundleId, importedModule);
2058
+ }
2059
+ return importedModule[exportName];
2060
+ }, consoleError);
2061
+ };
2062
+ const styles = /*@__PURE__*/ new Map();
2063
+ const win = typeof window !== 'undefined' ? window : {};
2064
+ const doc = win.document || { head: {} };
2065
+ const plt = {
2066
+ $flags$: 0,
2067
+ $resourcesUrl$: '',
2068
+ jmp: (h) => h(),
2069
+ raf: (h) => requestAnimationFrame(h),
2070
+ ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
2071
+ rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
2072
+ ce: (eventName, opts) => new CustomEvent(eventName, opts),
2073
+ };
2074
+ const supportsListenerOptions = /*@__PURE__*/ (() => {
2075
+ let supportsListenerOptions = false;
2076
+ try {
2077
+ doc.addEventListener('e', null, Object.defineProperty({}, 'passive', {
2078
+ get() {
2079
+ supportsListenerOptions = true;
2080
+ },
2081
+ }));
2082
+ }
2083
+ catch (e) { }
2084
+ return supportsListenerOptions;
2085
+ })();
2086
+ const promiseResolve = (v) => Promise.resolve(v);
2087
+ const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
2088
+ try {
2089
+ new CSSStyleSheet();
2090
+ return typeof new CSSStyleSheet().replaceSync === 'function';
2091
+ }
2092
+ catch (e) { }
2093
+ return false;
2094
+ })()
2095
+ ;
2096
+ const queueDomReads = [];
2097
+ const queueDomWrites = [];
2098
+ const queueTask = (queue, write) => (cb) => {
2099
+ queue.push(cb);
2100
+ if (!queuePending) {
2101
+ queuePending = true;
2102
+ if (write && plt.$flags$ & 4 /* PLATFORM_FLAGS.queueSync */) {
2103
+ nextTick(flush);
2104
+ }
2105
+ else {
2106
+ plt.raf(flush);
2107
+ }
2108
+ }
2109
+ };
2110
+ const consume = (queue) => {
2111
+ for (let i = 0; i < queue.length; i++) {
2112
+ try {
2113
+ queue[i](performance.now());
2114
+ }
2115
+ catch (e) {
2116
+ consoleError(e);
2117
+ }
2118
+ }
2119
+ queue.length = 0;
2120
+ };
2121
+ const flush = () => {
2122
+ // always force a bunch of medium callbacks to run, but still have
2123
+ // a throttle on how many can run in a certain time
2124
+ // DOM READS!!!
2125
+ consume(queueDomReads);
2126
+ // DOM WRITES!!!
2127
+ {
2128
+ consume(queueDomWrites);
2129
+ if ((queuePending = queueDomReads.length > 0)) {
2130
+ // still more to do yet, but we've run out of time
2131
+ // let's let this thing cool off and try again in the next tick
2132
+ plt.raf(flush);
2133
+ }
2134
+ }
2135
+ };
2136
+ const nextTick = (cb) => promiseResolve().then(cb);
2137
+ const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
2138
+
2139
+ export { Fragment as F, Host as H, getElement as a, bootstrapLazy as b, createEvent as c, forceUpdate as f, getRenderingRef as g, h, promiseResolve as p, registerInstance as r, setNonce as s };
2140
+
2141
+ //# sourceMappingURL=index-b2270b4a.js.map