@nylas/web-elements 1.1.0-canary.19.c → 1.1.0-canary.19.d

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 (876) hide show
  1. package/dist/cjs/add-circle-icon_2.cjs.entry.js +1 -1
  2. package/dist/cjs/archive-icon_7.cjs.entry.js +7 -7
  3. package/dist/cjs/arrow-icon.cjs.entry.js +1 -1
  4. package/dist/cjs/bold-icon_3.cjs.entry.js +3 -3
  5. package/dist/cjs/button-component_4.cjs.entry.js +203 -0
  6. package/dist/cjs/button-component_4.cjs.entry.js.map +1 -0
  7. package/dist/cjs/calendar-agenda-fill-icon_35.cjs.entry.js +6943 -0
  8. package/dist/cjs/calendar-agenda-fill-icon_35.cjs.entry.js.map +1 -0
  9. package/dist/cjs/chevron-icon_3.cjs.entry.js +11 -3
  10. package/dist/cjs/chevron-icon_3.cjs.entry.js.map +1 -1
  11. package/dist/cjs/clock-icon_2.cjs.entry.js +1 -1
  12. package/dist/cjs/{constants-3e962931.js → constants-7cc75333.js} +106 -1
  13. package/dist/cjs/{constants-3e962931.js.map → constants-7cc75333.js.map} +1 -1
  14. package/dist/cjs/copy-icon_4.cjs.entry.js +72 -0
  15. package/dist/cjs/copy-icon_4.cjs.entry.js.map +1 -0
  16. package/dist/cjs/document-refresh-icon.cjs.entry.js +1 -1
  17. package/dist/cjs/forward-icon_6.cjs.entry.js +7 -7
  18. package/dist/cjs/globe-icon.cjs.entry.js +1 -1
  19. package/dist/cjs/google-logo-icon_4.cjs.entry.js +192 -51
  20. package/dist/cjs/google-logo-icon_4.cjs.entry.js.map +1 -1
  21. package/dist/cjs/index-7af03e3f.js +20 -16
  22. package/dist/cjs/index.cjs.js +1 -1
  23. package/dist/cjs/info-icon_2.cjs.entry.js +2 -2
  24. package/dist/cjs/input-dropdown_2.cjs.entry.js +2 -2
  25. package/dist/cjs/loader.cjs.js +1 -1
  26. package/dist/cjs/loading-icon.cjs.entry.js +1 -1
  27. package/dist/cjs/multi-select-dropdown.cjs.entry.js +144 -0
  28. package/dist/cjs/multi-select-dropdown.cjs.entry.js.map +1 -0
  29. package/dist/cjs/{nylas-api-request-a1751a40.js → nylas-api-request-393b08a0.js} +2 -1
  30. package/dist/cjs/nylas-api-request-393b08a0.js.map +1 -0
  31. package/dist/cjs/nylas-booked-event-card_10.cjs.entry.js +66 -35
  32. package/dist/cjs/nylas-booked-event-card_10.cjs.entry.js.map +1 -1
  33. package/dist/cjs/nylas-custom-booking-flow.cjs.entry.js +1 -1
  34. package/dist/cjs/nylas-form-card.cjs.entry.js +1 -1
  35. package/dist/cjs/nylas-if-state.cjs.entry.js +1 -1
  36. package/dist/cjs/nylas-list-folders.cjs.entry.js +1 -1
  37. package/dist/cjs/nylas-list-threads.cjs.entry.js +1 -1
  38. package/dist/cjs/nylas-login.cjs.entry.js +1 -1
  39. package/dist/cjs/nylas-mailbox-toolbar-button.cjs.entry.js +1 -1
  40. package/dist/cjs/nylas-mailbox.cjs.entry.js +1 -1
  41. package/dist/cjs/nylas-provider.cjs.entry.js +3 -3
  42. package/dist/cjs/nylas-scheduler-editor.cjs.entry.js +26 -9
  43. package/dist/cjs/nylas-scheduler-editor.cjs.entry.js.map +1 -1
  44. package/dist/cjs/nylas-scheduling.cjs.entry.js +3 -3
  45. package/dist/cjs/nylas-scheduling.cjs.entry.js.map +1 -1
  46. package/dist/cjs/nylas-threads-refresh.cjs.entry.js +2 -2
  47. package/dist/cjs/nylas-threads-search.cjs.entry.js +1 -1
  48. package/dist/cjs/nylas-time-window-picker.cjs.entry.js +1 -1
  49. package/dist/cjs/nylas-view-thread.cjs.entry.js +1 -1
  50. package/dist/cjs/nylas-web-elements.cjs.js +1 -1
  51. package/dist/cjs/play-icon_2.cjs.entry.js +2 -2
  52. package/dist/cjs/refresh-icon.cjs.entry.js +1 -1
  53. package/dist/cjs/{scheduler-config-store-9f19c7a9.js → scheduler-config-store-5bfc8cb8.js} +3 -1
  54. package/dist/cjs/scheduler-config-store-5bfc8cb8.js.map +1 -0
  55. package/dist/cjs/{scheduler-store-0f7328f1.js → scheduler-store-b5cf2e82.js} +43 -7
  56. package/dist/cjs/scheduler-store-b5cf2e82.js.map +1 -0
  57. package/dist/cjs/textarea-component.cjs.entry.js +3 -1
  58. package/dist/cjs/textarea-component.cjs.entry.js.map +1 -1
  59. package/dist/cjs/translate-icon.cjs.entry.js +1 -1
  60. package/dist/cjs/warning-icon.cjs.entry.js +1 -1
  61. package/dist/collection/collection-manifest.json +14 -0
  62. package/dist/collection/common/constants.js +102 -0
  63. package/dist/collection/common/constants.js.map +1 -1
  64. package/dist/collection/common/icons/add-circle.js +1 -1
  65. package/dist/collection/common/icons/archive.js +1 -1
  66. package/dist/collection/common/icons/arrow.js +1 -1
  67. package/dist/collection/common/icons/bold.js +1 -1
  68. package/dist/collection/common/icons/calendar-agenda-fill.js +63 -0
  69. package/dist/collection/common/icons/calendar-agenda-fill.js.map +1 -0
  70. package/dist/collection/common/icons/calendar-agenda.js +63 -0
  71. package/dist/collection/common/icons/calendar-agenda.js.map +1 -0
  72. package/dist/collection/common/icons/copy.js +63 -0
  73. package/dist/collection/common/icons/copy.js.map +1 -0
  74. package/dist/collection/common/icons/delete.js +63 -0
  75. package/dist/collection/common/icons/delete.js.map +1 -0
  76. package/dist/collection/common/icons/document-refresh.js +1 -1
  77. package/dist/collection/common/icons/dragable.js +63 -0
  78. package/dist/collection/common/icons/dragable.js.map +1 -0
  79. package/dist/collection/common/icons/edit.js +63 -0
  80. package/dist/collection/common/icons/edit.js.map +1 -0
  81. package/dist/collection/common/icons/eye.js +63 -0
  82. package/dist/collection/common/icons/eye.js.map +1 -0
  83. package/dist/collection/common/icons/flow.js +1 -1
  84. package/dist/collection/common/icons/folder.js +1 -1
  85. package/dist/collection/common/icons/forward.js +1 -1
  86. package/dist/collection/common/icons/globe.js +1 -1
  87. package/dist/collection/common/icons/google-logo.js +1 -1
  88. package/dist/collection/common/icons/google-meet.js +63 -0
  89. package/dist/collection/common/icons/google-meet.js.map +1 -0
  90. package/dist/collection/common/icons/inbox.js +1 -1
  91. package/dist/collection/common/icons/info.js +1 -1
  92. package/dist/collection/common/icons/italic.js +1 -1
  93. package/dist/collection/common/icons/loading.js +1 -1
  94. package/dist/collection/common/icons/location-off.js +1 -1
  95. package/dist/collection/common/icons/location.js +1 -1
  96. package/dist/collection/common/icons/microsof-teams.js +63 -0
  97. package/dist/collection/common/icons/microsof-teams.js.map +1 -0
  98. package/dist/collection/common/icons/microsoft-logo.js +1 -1
  99. package/dist/collection/common/icons/nylas-logo.js +1 -1
  100. package/dist/collection/common/icons/people.js +1 -1
  101. package/dist/collection/common/icons/person.js +1 -1
  102. package/dist/collection/common/icons/play.js +1 -1
  103. package/dist/collection/common/icons/plus.js +63 -0
  104. package/dist/collection/common/icons/plus.js.map +1 -0
  105. package/dist/collection/common/icons/refresh.js +1 -1
  106. package/dist/collection/common/icons/reply-all.js +1 -1
  107. package/dist/collection/common/icons/reply.js +1 -1
  108. package/dist/collection/common/icons/search.js +1 -1
  109. package/dist/collection/common/icons/sent.js +1 -1
  110. package/dist/collection/common/icons/spam.js +1 -1
  111. package/dist/collection/common/icons/star.js +1 -1
  112. package/dist/collection/common/icons/stop.js +1 -1
  113. package/dist/collection/common/icons/translate.js +1 -1
  114. package/dist/collection/common/icons/trash.js +1 -1
  115. package/dist/collection/common/icons/underline.js +1 -1
  116. package/dist/collection/common/icons/warning.js +1 -1
  117. package/dist/collection/common/icons/zoom.js +63 -0
  118. package/dist/collection/common/icons/zoom.js.map +1 -0
  119. package/dist/collection/common/nylas-api-request.js +1 -0
  120. package/dist/collection/common/nylas-api-request.js.map +1 -1
  121. package/dist/collection/common/types.js.map +1 -1
  122. package/dist/collection/components/design-system/button-component/button-component.css +4 -0
  123. package/dist/collection/components/design-system/button-component/button-component.js +1 -1
  124. package/dist/collection/components/design-system/checkbox-component/checkbox-component.css +15 -1
  125. package/dist/collection/components/design-system/checkbox-component/checkbox-component.js +46 -6
  126. package/dist/collection/components/design-system/checkbox-component/checkbox-component.js.map +1 -1
  127. package/dist/collection/components/design-system/input-component/input-component.css +9 -1
  128. package/dist/collection/components/design-system/input-component/input-component.js +20 -8
  129. package/dist/collection/components/design-system/input-component/input-component.js.map +1 -1
  130. package/dist/collection/components/design-system/input-dropdown/input-dropdown.js +1 -1
  131. package/dist/collection/components/design-system/multi-select-dropdown/multi-select-dropdown.css +8 -1
  132. package/dist/collection/components/design-system/multi-select-dropdown/multi-select-dropdown.js +21 -2
  133. package/dist/collection/components/design-system/multi-select-dropdown/multi-select-dropdown.js.map +1 -1
  134. package/dist/collection/components/design-system/radio-button-group/radio-button-group.css +57 -1
  135. package/dist/collection/components/design-system/radio-button-group/radio-button-group.js +69 -10
  136. package/dist/collection/components/design-system/radio-button-group/radio-button-group.js.map +1 -1
  137. package/dist/collection/components/design-system/select-dropdown/select-dropdown.js +45 -2
  138. package/dist/collection/components/design-system/select-dropdown/select-dropdown.js.map +1 -1
  139. package/dist/collection/components/design-system/textarea-component/textarea-component.js +23 -3
  140. package/dist/collection/components/design-system/textarea-component/textarea-component.js.map +1 -1
  141. package/dist/collection/components/design-system/time-period-selector/time-period-selector.js +1 -1
  142. package/dist/collection/components/design-system/toggle-switch/toggle-switch.css +1 -1
  143. package/dist/collection/components/design-system/toggle-switch/toggle-switch.js +5 -5
  144. package/dist/collection/components/design-system/toggle-switch/toggle-switch.js.map +1 -1
  145. package/dist/collection/components/design-system/tooltip-component/toolitp-component.js +1 -1
  146. package/dist/collection/components/mailbox/nylas-composer/nylas-composer.js +1 -1
  147. package/dist/collection/components/mailbox/nylas-list-folders/nylas-list-folders.js +1 -1
  148. package/dist/collection/components/mailbox/nylas-list-threads/nylas-list-threads.js +1 -1
  149. package/dist/collection/components/mailbox/nylas-mailbox/nylas-mailbox.js +1 -1
  150. package/dist/collection/components/mailbox/nylas-mailbox-toolbar-button/nylas-mailbox-toolbar-button.js +1 -1
  151. package/dist/collection/components/mailbox/nylas-summarize-message-button/nylas-summarize-message-button.js +2 -2
  152. package/dist/collection/components/mailbox/nylas-threads-refresh/nylas-threads-refresh.js +2 -2
  153. package/dist/collection/components/mailbox/nylas-threads-search/nylas-threads-search.js +1 -1
  154. package/dist/collection/components/mailbox/nylas-view-email/nylas-view-email.js +1 -1
  155. package/dist/collection/components/mailbox/nylas-view-thread/nylas-view-thread.js +1 -1
  156. package/dist/collection/components/nylas-if-state/nylas-if-state.js +1 -1
  157. package/dist/collection/components/nylas-login/nylas-login.js +1 -1
  158. package/dist/collection/components/nylas-provider/nylas-provider.js +1 -1
  159. package/dist/collection/components/scheduler/nylas-booked-event-card/nylas-booked-event-card.js +23 -4
  160. package/dist/collection/components/scheduler/nylas-booked-event-card/nylas-booked-event-card.js.map +1 -1
  161. package/dist/collection/components/scheduler/nylas-booked-event-card/test/nylas-booked-event-card.spec.js +1 -0
  162. package/dist/collection/components/scheduler/nylas-booked-event-card/test/nylas-booked-event-card.spec.js.map +1 -1
  163. package/dist/collection/components/scheduler/nylas-booking-form/nylas-booking-form.js +37 -21
  164. package/dist/collection/components/scheduler/nylas-booking-form/nylas-booking-form.js.map +1 -1
  165. package/dist/collection/components/scheduler/nylas-cancel-booking-form/nylas-cancel-booking-form.js +42 -3
  166. package/dist/collection/components/scheduler/nylas-cancel-booking-form/nylas-cancel-booking-form.js.map +1 -1
  167. package/dist/collection/components/scheduler/nylas-cancel-booking-form/test/nylas-cancel-booking-form.spec.js +11 -0
  168. package/dist/collection/components/scheduler/nylas-cancel-booking-form/test/nylas-cancel-booking-form.spec.js.map +1 -1
  169. package/dist/collection/components/scheduler/nylas-cancelled-event-card/nylas-cancelled-event-card.js +2 -2
  170. package/dist/collection/components/scheduler/nylas-date-picker/nylas-date-picker.js +1 -1
  171. package/dist/collection/components/scheduler/nylas-notification/nylas-notification.js +1 -1
  172. package/dist/collection/components/scheduler/nylas-scheduling/nylas-scheduling.css +4 -1
  173. package/dist/collection/components/scheduler/nylas-scheduling/nylas-scheduling.js +3 -3
  174. package/dist/collection/components/scheduler/nylas-scheduling/nylas-scheduling.js.map +1 -1
  175. package/dist/collection/components/scheduler/nylas-selected-event-card/nylas-selected-event-card.js +1 -1
  176. package/dist/collection/components/scheduler/nylas-timeslot-picker/nylas-timeslot-picker.css +2 -2
  177. package/dist/collection/components/scheduler/nylas-timeslot-picker/nylas-timeslot-picker.js +8 -7
  178. package/dist/collection/components/scheduler/nylas-timeslot-picker/nylas-timeslot-picker.js.map +1 -1
  179. package/dist/collection/components/scheduler-editor/nylas-additional-participants/nylas-additional-participants.css +16 -2
  180. package/dist/collection/components/scheduler-editor/nylas-additional-participants/nylas-additional-participants.js +31 -12
  181. package/dist/collection/components/scheduler-editor/nylas-additional-participants/nylas-additional-participants.js.map +1 -1
  182. package/dist/collection/components/scheduler-editor/nylas-availability-picker/nylas-availability-picker.css +3 -0
  183. package/dist/collection/components/scheduler-editor/nylas-availability-picker/nylas-availability-picker.js +2 -2
  184. package/dist/collection/components/scheduler-editor/nylas-availability-picker/nylas-availability-picker.js.map +1 -1
  185. package/dist/collection/components/scheduler-editor/nylas-booking-calendar-picker/nylas-booking-calendar-picker.css +3 -0
  186. package/dist/collection/components/scheduler-editor/nylas-booking-calendar-picker/nylas-booking-calendar-picker.js +22 -6
  187. package/dist/collection/components/scheduler-editor/nylas-booking-calendar-picker/nylas-booking-calendar-picker.js.map +1 -1
  188. package/dist/collection/components/scheduler-editor/nylas-booking-form-config/nylas-booking-form-config.css +233 -0
  189. package/dist/collection/components/scheduler-editor/nylas-booking-form-config/nylas-booking-form-config.js +388 -0
  190. package/dist/collection/components/scheduler-editor/nylas-booking-form-config/nylas-booking-form-config.js.map +1 -0
  191. package/dist/collection/components/scheduler-editor/nylas-calendar-picker/nylas-calendar-picker.css +3 -20
  192. package/dist/collection/components/scheduler-editor/nylas-calendar-picker/nylas-calendar-picker.js +19 -9
  193. package/dist/collection/components/scheduler-editor/nylas-calendar-picker/nylas-calendar-picker.js.map +1 -1
  194. package/dist/collection/components/scheduler-editor/nylas-cancellation-policy/nylas-cancellation-policy.js +1 -1
  195. package/dist/collection/components/scheduler-editor/nylas-connected-calendars/nylas-connected-calendars.css +105 -0
  196. package/dist/collection/components/scheduler-editor/nylas-connected-calendars/nylas-connected-calendars.js +298 -0
  197. package/dist/collection/components/scheduler-editor/nylas-connected-calendars/nylas-connected-calendars.js.map +1 -0
  198. package/dist/collection/components/scheduler-editor/nylas-custom-booking-flow/nylas-custom-booking-flow.js +1 -1
  199. package/dist/collection/components/scheduler-editor/nylas-customize-booking-settings/nylas-customize-booking-settings.js +5 -5
  200. package/dist/collection/components/scheduler-editor/nylas-customize-booking-settings/nylas-customize-booking-settings.js.map +1 -1
  201. package/dist/collection/components/scheduler-editor/nylas-editor-tabs/nylas-editor-tabs.css +3 -0
  202. package/dist/collection/components/scheduler-editor/nylas-editor-tabs/nylas-editor-tabs.js +106 -20
  203. package/dist/collection/components/scheduler-editor/nylas-editor-tabs/nylas-editor-tabs.js.map +1 -1
  204. package/dist/collection/components/scheduler-editor/nylas-editor-tabs/tab-contents.js +7 -7
  205. package/dist/collection/components/scheduler-editor/nylas-editor-tabs/tab-contents.js.map +1 -1
  206. package/dist/collection/components/scheduler-editor/nylas-event-info/nylas-event-info.js +1 -1
  207. package/dist/collection/components/scheduler-editor/nylas-event-limits/nylas-event-limits.js +1 -1
  208. package/dist/collection/components/scheduler-editor/nylas-event-limits/nylas-event-limits.js.map +1 -1
  209. package/dist/collection/components/scheduler-editor/nylas-event-location/nylas-event-location.js +161 -11
  210. package/dist/collection/components/scheduler-editor/nylas-event-location/nylas-event-location.js.map +1 -1
  211. package/dist/collection/components/scheduler-editor/nylas-event-title/nylas-event-title.js +1 -1
  212. package/dist/collection/components/scheduler-editor/nylas-event-title/nylas-event-title.js.map +1 -1
  213. package/dist/collection/components/scheduler-editor/nylas-form-card/nylas-form-card.js +1 -1
  214. package/dist/collection/components/scheduler-editor/nylas-limit-future-bookings/nylas-limit-future-bookings.js +1 -1
  215. package/dist/collection/components/scheduler-editor/nylas-limit-future-bookings/nylas-limit-future-bookings.js.map +1 -1
  216. package/dist/collection/components/scheduler-editor/nylas-list-configurations/nylas-list-configurations.css +79 -3
  217. package/dist/collection/components/scheduler-editor/nylas-list-configurations/nylas-list-configurations.js +125 -22
  218. package/dist/collection/components/scheduler-editor/nylas-list-configurations/nylas-list-configurations.js.map +1 -1
  219. package/dist/collection/components/scheduler-editor/nylas-min-booking-notice/nylas-min-booking-notice.js +1 -1
  220. package/dist/collection/components/scheduler-editor/nylas-min-booking-notice/nylas-min-booking-notice.js.map +1 -1
  221. package/dist/collection/components/scheduler-editor/nylas-min-cancellation-notice/nylas-min-cancellation-notice.js +1 -1
  222. package/dist/collection/components/scheduler-editor/nylas-min-cancellation-notice/nylas-min-cancellation-notice.js.map +1 -1
  223. package/dist/collection/components/scheduler-editor/nylas-participant-booking-calendars/nylas-participant-booking-calendars.css +105 -0
  224. package/dist/collection/components/scheduler-editor/nylas-participant-booking-calendars/nylas-participant-booking-calendars.js +324 -0
  225. package/dist/collection/components/scheduler-editor/nylas-participant-booking-calendars/nylas-participant-booking-calendars.js.map +1 -0
  226. package/dist/collection/components/scheduler-editor/nylas-participants-custom-availability/nylas-participants-custom-availability.js +39 -5
  227. package/dist/collection/components/scheduler-editor/nylas-participants-custom-availability/nylas-participants-custom-availability.js.map +1 -1
  228. package/dist/collection/components/scheduler-editor/nylas-scheduler-editor/ExpressFlow.js +4 -3
  229. package/dist/collection/components/scheduler-editor/nylas-scheduler-editor/ExpressFlow.js.map +1 -1
  230. package/dist/collection/components/scheduler-editor/nylas-scheduler-editor/nylas-scheduler-editor.js +59 -9
  231. package/dist/collection/components/scheduler-editor/nylas-scheduler-editor/nylas-scheduler-editor.js.map +1 -1
  232. package/dist/collection/components/scheduler-editor/nylas-time-window-picker/nylas-time-window-picker.js +1 -1
  233. package/dist/collection/components/scheduler-editor/nylas-timeslot-interval/nylas-timeslot-interval.js +16 -16
  234. package/dist/collection/components/scheduler-editor/nylas-timeslot-interval/nylas-timeslot-interval.js.map +1 -1
  235. package/dist/collection/connector/shared/api/scheduler-config.js +4 -2
  236. package/dist/collection/connector/shared/api/scheduler-config.js.map +1 -1
  237. package/dist/collection/connector/shared/api/scheduler.js +41 -6
  238. package/dist/collection/connector/shared/api/scheduler.js.map +1 -1
  239. package/dist/collection/stores/scheduler-config-store.js +2 -0
  240. package/dist/collection/stores/scheduler-config-store.js.map +1 -1
  241. package/dist/collection/stores/scheduler-store.js +1 -0
  242. package/dist/collection/stores/scheduler-store.js.map +1 -1
  243. package/dist/collection/types/index.js.map +1 -1
  244. package/dist/components/add-circle.js +1 -1
  245. package/dist/components/archive.js +1 -1
  246. package/dist/components/arrow.js +1 -1
  247. package/dist/components/bold.js +1 -1
  248. package/dist/components/button-component2.js +2 -2
  249. package/dist/components/button-component2.js.map +1 -1
  250. package/dist/components/calendar-agenda-fill-icon.d.ts +11 -0
  251. package/dist/components/calendar-agenda-fill-icon.js +8 -0
  252. package/dist/components/calendar-agenda-fill-icon.js.map +1 -0
  253. package/dist/components/calendar-agenda-fill.js +37 -0
  254. package/dist/components/calendar-agenda-fill.js.map +1 -0
  255. package/dist/components/calendar-agenda-icon.d.ts +11 -0
  256. package/dist/components/calendar-agenda-icon.js +8 -0
  257. package/dist/components/calendar-agenda-icon.js.map +1 -0
  258. package/dist/components/calendar-agenda.js +37 -0
  259. package/dist/components/calendar-agenda.js.map +1 -0
  260. package/dist/components/checkbox-component2.js +18 -4
  261. package/dist/components/checkbox-component2.js.map +1 -1
  262. package/dist/components/constants.js +102 -1
  263. package/dist/components/constants.js.map +1 -1
  264. package/dist/components/copy-icon.d.ts +11 -0
  265. package/dist/components/copy-icon.js +8 -0
  266. package/dist/components/copy-icon.js.map +1 -0
  267. package/dist/components/copy.js +37 -0
  268. package/dist/components/copy.js.map +1 -0
  269. package/dist/components/delete-icon.d.ts +11 -0
  270. package/dist/components/delete-icon.js +8 -0
  271. package/dist/components/delete-icon.js.map +1 -0
  272. package/dist/components/delete.js +37 -0
  273. package/dist/components/delete.js.map +1 -0
  274. package/dist/components/document-refresh-icon.js +1 -1
  275. package/dist/components/dragable-icon.d.ts +11 -0
  276. package/dist/components/dragable-icon.js +8 -0
  277. package/dist/components/dragable-icon.js.map +1 -0
  278. package/dist/components/dragable.js +37 -0
  279. package/dist/components/dragable.js.map +1 -0
  280. package/dist/components/edit-icon.d.ts +11 -0
  281. package/dist/components/edit-icon.js +8 -0
  282. package/dist/components/edit-icon.js.map +1 -0
  283. package/dist/components/edit.js +37 -0
  284. package/dist/components/edit.js.map +1 -0
  285. package/dist/components/eye-icon.d.ts +11 -0
  286. package/dist/components/eye-icon.js +8 -0
  287. package/dist/components/eye-icon.js.map +1 -0
  288. package/dist/components/eye.js +37 -0
  289. package/dist/components/eye.js.map +1 -0
  290. package/dist/components/flow.js +1 -1
  291. package/dist/components/folder.js +1 -1
  292. package/dist/components/forward.js +1 -1
  293. package/dist/components/globe.js +1 -1
  294. package/dist/components/google-logo.js +1 -1
  295. package/dist/components/google-meet-icon.d.ts +11 -0
  296. package/dist/components/google-meet-icon.js +8 -0
  297. package/dist/components/google-meet-icon.js.map +1 -0
  298. package/dist/components/google-meet.js +37 -0
  299. package/dist/components/google-meet.js.map +1 -0
  300. package/dist/components/inbox.js +1 -1
  301. package/dist/components/info.js +1 -1
  302. package/dist/components/input-component2.js +17 -6
  303. package/dist/components/input-component2.js.map +1 -1
  304. package/dist/components/input-dropdown2.js +1 -1
  305. package/dist/components/italic.js +1 -1
  306. package/dist/components/loading.js +1 -1
  307. package/dist/components/location-off.js +1 -1
  308. package/dist/components/location.js +1 -1
  309. package/dist/components/microsof-teams.js +37 -0
  310. package/dist/components/microsof-teams.js.map +1 -0
  311. package/dist/components/microsoft-logo.js +1 -1
  312. package/dist/components/microsoft-teams-icon.d.ts +11 -0
  313. package/dist/components/microsoft-teams-icon.js +8 -0
  314. package/dist/components/microsoft-teams-icon.js.map +1 -0
  315. package/dist/components/multi-select-dropdown2.js +5 -3
  316. package/dist/components/multi-select-dropdown2.js.map +1 -1
  317. package/dist/components/nylas-additional-participants2.js +26 -8
  318. package/dist/components/nylas-additional-participants2.js.map +1 -1
  319. package/dist/components/nylas-api-request.js +1 -0
  320. package/dist/components/nylas-api-request.js.map +1 -1
  321. package/dist/components/nylas-availability-picker2.js +2 -2
  322. package/dist/components/nylas-availability-picker2.js.map +1 -1
  323. package/dist/components/nylas-booked-event-card2.js +7 -4
  324. package/dist/components/nylas-booked-event-card2.js.map +1 -1
  325. package/dist/components/nylas-booking-calendar-picker2.js +5 -6
  326. package/dist/components/nylas-booking-calendar-picker2.js.map +1 -1
  327. package/dist/components/nylas-booking-form-config.d.ts +11 -0
  328. package/dist/components/nylas-booking-form-config.js +8 -0
  329. package/dist/components/nylas-booking-form-config.js.map +1 -0
  330. package/dist/components/nylas-booking-form-config2.js +3691 -0
  331. package/dist/components/nylas-booking-form-config2.js.map +1 -0
  332. package/dist/components/nylas-booking-form2.js +78 -32
  333. package/dist/components/nylas-booking-form2.js.map +1 -1
  334. package/dist/components/nylas-calendar-picker2.js +27 -23
  335. package/dist/components/nylas-calendar-picker2.js.map +1 -1
  336. package/dist/components/nylas-cancel-booking-form2.js +21 -2
  337. package/dist/components/nylas-cancel-booking-form2.js.map +1 -1
  338. package/dist/components/nylas-cancellation-policy2.js +1 -1
  339. package/dist/components/nylas-cancelled-event-card2.js +1 -1
  340. package/dist/components/nylas-composer2.js +1 -1
  341. package/dist/components/nylas-connected-calendars.d.ts +11 -0
  342. package/dist/components/nylas-connected-calendars.js +8 -0
  343. package/dist/components/nylas-connected-calendars.js.map +1 -0
  344. package/dist/components/nylas-connected-calendars2.js +232 -0
  345. package/dist/components/nylas-connected-calendars2.js.map +1 -0
  346. package/dist/components/nylas-custom-booking-flow.js +1 -1
  347. package/dist/components/nylas-customize-booking-settings2.js +4 -4
  348. package/dist/components/nylas-customize-booking-settings2.js.map +1 -1
  349. package/dist/components/nylas-editor-tabs2.js +251 -113
  350. package/dist/components/nylas-editor-tabs2.js.map +1 -1
  351. package/dist/components/nylas-event-info2.js +1 -1
  352. package/dist/components/nylas-event-limits2.js +1 -1
  353. package/dist/components/nylas-event-limits2.js.map +1 -1
  354. package/dist/components/nylas-event-location2.js +138 -25
  355. package/dist/components/nylas-event-location2.js.map +1 -1
  356. package/dist/components/nylas-event-title2.js +1 -1
  357. package/dist/components/nylas-event-title2.js.map +1 -1
  358. package/dist/components/nylas-form-card2.js +1 -1
  359. package/dist/components/nylas-if-state.js +1 -1
  360. package/dist/components/nylas-limit-future-bookings2.js +1 -1
  361. package/dist/components/nylas-limit-future-bookings2.js.map +1 -1
  362. package/dist/components/nylas-list-configurations2.js +142 -25
  363. package/dist/components/nylas-list-configurations2.js.map +1 -1
  364. package/dist/components/nylas-list-folders.js +1 -1
  365. package/dist/components/nylas-list-threads.js +1 -1
  366. package/dist/components/nylas-login.js +1 -1
  367. package/dist/components/nylas-logo2.js +1 -1
  368. package/dist/components/nylas-mailbox-toolbar-button.js +1 -1
  369. package/dist/components/nylas-mailbox.js +1 -1
  370. package/dist/components/nylas-min-booking-notice2.js +1 -1
  371. package/dist/components/nylas-min-booking-notice2.js.map +1 -1
  372. package/dist/components/nylas-min-cancellation-notice2.js +1 -1
  373. package/dist/components/nylas-min-cancellation-notice2.js.map +1 -1
  374. package/dist/components/nylas-notification2.js +1 -1
  375. package/dist/components/nylas-participant-booking-calendars.d.ts +11 -0
  376. package/dist/components/nylas-participant-booking-calendars.js +8 -0
  377. package/dist/components/nylas-participant-booking-calendars.js.map +1 -0
  378. package/dist/components/nylas-participant-booking-calendars2.js +237 -0
  379. package/dist/components/nylas-participant-booking-calendars2.js.map +1 -0
  380. package/dist/components/nylas-participants-custom-availability2.js +18 -5
  381. package/dist/components/nylas-participants-custom-availability2.js.map +1 -1
  382. package/dist/components/nylas-provider.js +1 -1
  383. package/dist/components/nylas-scheduler-editor.js +210 -101
  384. package/dist/components/nylas-scheduler-editor.js.map +1 -1
  385. package/dist/components/nylas-scheduling.js +70 -52
  386. package/dist/components/nylas-scheduling.js.map +1 -1
  387. package/dist/components/nylas-summarize-message-button2.js +2 -2
  388. package/dist/components/nylas-threads-refresh.js +2 -2
  389. package/dist/components/nylas-threads-search.js +1 -1
  390. package/dist/components/nylas-time-window-picker2.js +1 -1
  391. package/dist/components/nylas-timeslot-interval2.js +11 -11
  392. package/dist/components/nylas-timeslot-interval2.js.map +1 -1
  393. package/dist/components/nylas-timeslot-picker2.js +6 -5
  394. package/dist/components/nylas-timeslot-picker2.js.map +1 -1
  395. package/dist/components/nylas-view-email2.js +1 -1
  396. package/dist/components/nylas-view-thread.js +1 -1
  397. package/dist/components/people.js +1 -1
  398. package/dist/components/person.js +1 -1
  399. package/dist/components/play.js +1 -1
  400. package/dist/components/plus-icon.d.ts +11 -0
  401. package/dist/components/plus-icon.js +8 -0
  402. package/dist/components/plus-icon.js.map +1 -0
  403. package/dist/components/plus.js +37 -0
  404. package/dist/components/plus.js.map +1 -0
  405. package/dist/components/radio-button-group2.js +23 -6
  406. package/dist/components/radio-button-group2.js.map +1 -1
  407. package/dist/components/refresh.js +1 -1
  408. package/dist/components/reply-all.js +1 -1
  409. package/dist/components/reply.js +1 -1
  410. package/dist/components/scheduler-config-store.js +2 -0
  411. package/dist/components/scheduler-config-store.js.map +1 -1
  412. package/dist/components/scheduler-store.js +42 -6
  413. package/dist/components/scheduler-store.js.map +1 -1
  414. package/dist/components/search.js +1 -1
  415. package/dist/components/select-dropdown2.js +12 -2
  416. package/dist/components/select-dropdown2.js.map +1 -1
  417. package/dist/components/sent.js +1 -1
  418. package/dist/components/spam.js +1 -1
  419. package/dist/components/star.js +1 -1
  420. package/dist/components/stop.js +1 -1
  421. package/dist/components/textarea-component.js +1 -82
  422. package/dist/components/textarea-component.js.map +1 -1
  423. package/dist/components/textarea-component2.js +89 -0
  424. package/dist/components/textarea-component2.js.map +1 -0
  425. package/dist/components/time-period-selector2.js +1 -1
  426. package/dist/components/toggle-switch2.js +2 -2
  427. package/dist/components/toggle-switch2.js.map +1 -1
  428. package/dist/components/toolitp-component.js +1 -1
  429. package/dist/components/translate.js +1 -1
  430. package/dist/components/trash.js +1 -1
  431. package/dist/components/underline.js +1 -1
  432. package/dist/components/warning.js +1 -1
  433. package/dist/components/zoom-icon.d.ts +11 -0
  434. package/dist/components/zoom-icon.js +8 -0
  435. package/dist/components/zoom-icon.js.map +1 -0
  436. package/dist/components/zoom.js +37 -0
  437. package/dist/components/zoom.js.map +1 -0
  438. package/dist/esm/add-circle-icon_2.entry.js +1 -1
  439. package/dist/esm/archive-icon_7.entry.js +7 -7
  440. package/dist/esm/arrow-icon.entry.js +1 -1
  441. package/dist/esm/bold-icon_3.entry.js +3 -3
  442. package/dist/esm/button-component_4.entry.js +196 -0
  443. package/dist/esm/button-component_4.entry.js.map +1 -0
  444. package/dist/esm/calendar-agenda-fill-icon_35.entry.js +6905 -0
  445. package/dist/esm/calendar-agenda-fill-icon_35.entry.js.map +1 -0
  446. package/dist/esm/chevron-icon_3.entry.js +11 -3
  447. package/dist/esm/chevron-icon_3.entry.js.map +1 -1
  448. package/dist/esm/clock-icon_2.entry.js +1 -1
  449. package/dist/esm/{constants-f34b9c6e.js → constants-7ce66b44.js} +103 -2
  450. package/dist/esm/{constants-f34b9c6e.js.map → constants-7ce66b44.js.map} +1 -1
  451. package/dist/esm/copy-icon_4.entry.js +65 -0
  452. package/dist/esm/copy-icon_4.entry.js.map +1 -0
  453. package/dist/esm/document-refresh-icon.entry.js +1 -1
  454. package/dist/esm/forward-icon_6.entry.js +7 -7
  455. package/dist/esm/globe-icon.entry.js +1 -1
  456. package/dist/esm/google-logo-icon_4.entry.js +192 -51
  457. package/dist/esm/google-logo-icon_4.entry.js.map +1 -1
  458. package/dist/esm/index-7cb0dd3d.js +20 -16
  459. package/dist/esm/index.js +1 -1
  460. package/dist/esm/info-icon_2.entry.js +2 -2
  461. package/dist/esm/input-dropdown_2.entry.js +2 -2
  462. package/dist/esm/loader.js +1 -1
  463. package/dist/esm/loading-icon.entry.js +1 -1
  464. package/dist/esm/multi-select-dropdown.entry.js +140 -0
  465. package/dist/esm/multi-select-dropdown.entry.js.map +1 -0
  466. package/dist/esm/{nylas-api-request-a67d2997.js → nylas-api-request-4f8edff2.js} +2 -1
  467. package/dist/esm/nylas-api-request-4f8edff2.js.map +1 -0
  468. package/dist/esm/nylas-booked-event-card_10.entry.js +66 -35
  469. package/dist/esm/nylas-booked-event-card_10.entry.js.map +1 -1
  470. package/dist/esm/nylas-custom-booking-flow.entry.js +1 -1
  471. package/dist/esm/nylas-form-card.entry.js +1 -1
  472. package/dist/esm/nylas-if-state.entry.js +1 -1
  473. package/dist/esm/nylas-list-folders.entry.js +1 -1
  474. package/dist/esm/nylas-list-threads.entry.js +1 -1
  475. package/dist/esm/nylas-login.entry.js +1 -1
  476. package/dist/esm/nylas-mailbox-toolbar-button.entry.js +1 -1
  477. package/dist/esm/nylas-mailbox.entry.js +1 -1
  478. package/dist/esm/nylas-provider.entry.js +3 -3
  479. package/dist/esm/nylas-scheduler-editor.entry.js +26 -9
  480. package/dist/esm/nylas-scheduler-editor.entry.js.map +1 -1
  481. package/dist/esm/nylas-scheduling.entry.js +3 -3
  482. package/dist/esm/nylas-scheduling.entry.js.map +1 -1
  483. package/dist/esm/nylas-threads-refresh.entry.js +2 -2
  484. package/dist/esm/nylas-threads-search.entry.js +1 -1
  485. package/dist/esm/nylas-time-window-picker.entry.js +1 -1
  486. package/dist/esm/nylas-view-thread.entry.js +1 -1
  487. package/dist/esm/nylas-web-elements.js +1 -1
  488. package/dist/esm/play-icon_2.entry.js +2 -2
  489. package/dist/esm/refresh-icon.entry.js +1 -1
  490. package/dist/esm/{scheduler-config-store-4a50a03d.js → scheduler-config-store-9ccfba4d.js} +3 -1
  491. package/dist/esm/scheduler-config-store-9ccfba4d.js.map +1 -0
  492. package/dist/esm/{scheduler-store-f02ce045.js → scheduler-store-8a400448.js} +43 -7
  493. package/dist/esm/scheduler-store-8a400448.js.map +1 -0
  494. package/dist/esm/textarea-component.entry.js +3 -1
  495. package/dist/esm/textarea-component.entry.js.map +1 -1
  496. package/dist/esm/translate-icon.entry.js +1 -1
  497. package/dist/esm/warning-icon.entry.js +1 -1
  498. package/dist/nylas-web-elements/index.esm.js +1 -1
  499. package/dist/nylas-web-elements/nylas-web-elements.esm.js +1 -1
  500. package/dist/nylas-web-elements/nylas-web-elements.esm.js.map +1 -1
  501. package/dist/nylas-web-elements/p-0161429f.entry.js +2 -0
  502. package/dist/nylas-web-elements/{p-33a6a75b.entry.js.map → p-0161429f.entry.js.map} +1 -1
  503. package/dist/nylas-web-elements/p-064c2ae5.entry.js +2 -0
  504. package/dist/nylas-web-elements/{p-de7b0878.entry.js → p-0aa1e433.entry.js} +2 -2
  505. package/dist/nylas-web-elements/{p-3f122804.entry.js → p-0bf6f818.entry.js} +2 -2
  506. package/dist/nylas-web-elements/p-1102df14.entry.js +2 -0
  507. package/dist/nylas-web-elements/{p-f1a54acf.entry.js → p-155e5ce8.entry.js} +2 -2
  508. package/dist/nylas-web-elements/{p-a85408e0.entry.js → p-18d100c8.entry.js} +2 -2
  509. package/dist/nylas-web-elements/{p-5231fc13.entry.js → p-1a7edf86.entry.js} +3 -3
  510. package/dist/nylas-web-elements/p-1d8c468f.entry.js +2 -0
  511. package/dist/nylas-web-elements/p-1d8c468f.entry.js.map +1 -0
  512. package/dist/nylas-web-elements/{p-be38a8eb.entry.js → p-1e1ae8d0.entry.js} +2 -2
  513. package/dist/nylas-web-elements/p-1f290858.entry.js +2 -0
  514. package/dist/nylas-web-elements/p-1f290858.entry.js.map +1 -0
  515. package/dist/nylas-web-elements/{p-eb7e8455.entry.js → p-1fbe50b1.entry.js} +2 -2
  516. package/dist/nylas-web-elements/p-20bbc663.js +2 -0
  517. package/dist/nylas-web-elements/p-20bbc663.js.map +1 -0
  518. package/dist/nylas-web-elements/{p-49f716ed.js → p-2270e6cf.js} +4 -4
  519. package/dist/nylas-web-elements/p-2270e6cf.js.map +1 -0
  520. package/dist/nylas-web-elements/{p-70e5cfb0.entry.js → p-22e05c7d.entry.js} +2 -2
  521. package/dist/nylas-web-elements/{p-554891cd.entry.js → p-26302ad0.entry.js} +2 -2
  522. package/dist/nylas-web-elements/p-27df8f01.entry.js +2 -0
  523. package/dist/nylas-web-elements/p-27df8f01.entry.js.map +1 -0
  524. package/dist/nylas-web-elements/p-2b1d53fa.entry.js +8 -0
  525. package/dist/nylas-web-elements/p-2b1d53fa.entry.js.map +1 -0
  526. package/dist/nylas-web-elements/{p-6ce66add.entry.js → p-2f47205d.entry.js} +2 -2
  527. package/dist/nylas-web-elements/{p-28512ab6.entry.js → p-3277023d.entry.js} +2 -2
  528. package/dist/nylas-web-elements/{p-1a27960b.entry.js → p-3423de64.entry.js} +2 -2
  529. package/dist/nylas-web-elements/p-3423de64.entry.js.map +1 -0
  530. package/dist/nylas-web-elements/{p-b0c8021f.entry.js → p-34c747f9.entry.js} +2 -2
  531. package/dist/nylas-web-elements/{p-d9a91bc9.entry.js → p-359af1e3.entry.js} +2 -2
  532. package/dist/nylas-web-elements/p-359af1e3.entry.js.map +1 -0
  533. package/dist/nylas-web-elements/{p-613c070f.js → p-371b20b2.js} +2 -2
  534. package/dist/nylas-web-elements/p-371b20b2.js.map +1 -0
  535. package/dist/nylas-web-elements/{p-e9ba368f.entry.js → p-3ae38e51.entry.js} +2 -2
  536. package/dist/nylas-web-elements/{p-6ef1024f.entry.js → p-3bc1289e.entry.js} +2 -2
  537. package/dist/nylas-web-elements/{p-7fcecf3f.entry.js → p-3d1e8e4d.entry.js} +2 -2
  538. package/dist/nylas-web-elements/{p-45c37986.entry.js → p-3dae0c71.entry.js} +2 -2
  539. package/dist/nylas-web-elements/{p-acadfabf.entry.js → p-3db7ab8d.entry.js} +3 -3
  540. package/dist/nylas-web-elements/{p-66493463.entry.js → p-3e09b0fb.entry.js} +2 -2
  541. package/dist/nylas-web-elements/{p-5c3c1888.entry.js → p-3eac9f45.entry.js} +2 -2
  542. package/dist/nylas-web-elements/{p-dcc27b67.entry.js → p-4000107d.entry.js} +2 -2
  543. package/dist/nylas-web-elements/p-40cad9a8.entry.js +11 -0
  544. package/dist/nylas-web-elements/p-40cad9a8.entry.js.map +1 -0
  545. package/dist/nylas-web-elements/p-445d8bb4.entry.js +11 -0
  546. package/dist/nylas-web-elements/p-445d8bb4.entry.js.map +1 -0
  547. package/dist/nylas-web-elements/{p-08d75d35.entry.js → p-47392968.entry.js} +2 -2
  548. package/dist/nylas-web-elements/{p-16a3bfb2.entry.js → p-4a594ebe.entry.js} +2 -2
  549. package/dist/nylas-web-elements/{p-d633e735.entry.js → p-4b6995fe.entry.js} +2 -2
  550. package/dist/nylas-web-elements/p-4cdd4107.entry.js +2 -0
  551. package/dist/nylas-web-elements/{p-39fd9c90.entry.js → p-4e8c8939.entry.js} +2 -2
  552. package/dist/nylas-web-elements/{p-9b68568e.entry.js → p-4e9ba325.entry.js} +2 -2
  553. package/dist/nylas-web-elements/p-4f55d0e5.entry.js +2 -0
  554. package/dist/nylas-web-elements/{p-12b83ea9.entry.js.map → p-4f55d0e5.entry.js.map} +1 -1
  555. package/dist/nylas-web-elements/{p-9794f735.entry.js → p-524a6acc.entry.js} +2 -2
  556. package/dist/nylas-web-elements/{p-6bd9c9c3.entry.js → p-533d39ce.entry.js} +2 -2
  557. package/dist/nylas-web-elements/{p-e928898a.entry.js → p-5a379fb5.entry.js} +2 -2
  558. package/dist/nylas-web-elements/{p-c90755ba.entry.js → p-5a68368a.entry.js} +2 -2
  559. package/dist/nylas-web-elements/{p-37f41a90.entry.js → p-5b965d0d.entry.js} +2 -2
  560. package/dist/nylas-web-elements/p-5e1cd3c1.entry.js +2 -0
  561. package/dist/nylas-web-elements/p-5e1cd3c1.entry.js.map +1 -0
  562. package/dist/nylas-web-elements/{p-34f0d1fe.entry.js → p-5ff4e63b.entry.js} +2 -2
  563. package/dist/nylas-web-elements/p-62aeac5f.entry.js +2 -0
  564. package/dist/nylas-web-elements/p-62aeac5f.entry.js.map +1 -0
  565. package/dist/nylas-web-elements/p-64d43339.entry.js +2 -0
  566. package/dist/nylas-web-elements/p-64d43339.entry.js.map +1 -0
  567. package/dist/nylas-web-elements/p-656cf33f.entry.js +2 -0
  568. package/dist/nylas-web-elements/{p-cf589eab.entry.js → p-65b7a2a7.entry.js} +2 -2
  569. package/dist/nylas-web-elements/p-68471dbd.entry.js +8 -0
  570. package/dist/nylas-web-elements/p-68471dbd.entry.js.map +1 -0
  571. package/dist/nylas-web-elements/p-692852d2.entry.js +2 -0
  572. package/dist/nylas-web-elements/p-692852d2.entry.js.map +1 -0
  573. package/dist/nylas-web-elements/{p-60b03f86.entry.js → p-6c8af4fb.entry.js} +2 -2
  574. package/dist/nylas-web-elements/p-6d410f0a.entry.js +2 -0
  575. package/dist/nylas-web-elements/{p-daac96cb.entry.js → p-6e50d2fd.entry.js} +3 -3
  576. package/dist/nylas-web-elements/p-6e8b7ce8.entry.js +2 -0
  577. package/dist/nylas-web-elements/p-7042eb03.entry.js +2 -0
  578. package/dist/nylas-web-elements/{p-958746a1.entry.js.map → p-7042eb03.entry.js.map} +1 -1
  579. package/dist/nylas-web-elements/{p-b9fa6848.entry.js → p-7355937b.entry.js} +2 -2
  580. package/dist/nylas-web-elements/p-749238c6.entry.js +2 -0
  581. package/dist/nylas-web-elements/p-749238c6.entry.js.map +1 -0
  582. package/dist/nylas-web-elements/p-76156a82.entry.js +2 -0
  583. package/dist/nylas-web-elements/p-79c1475e.entry.js +11 -0
  584. package/dist/nylas-web-elements/p-79c1475e.entry.js.map +1 -0
  585. package/dist/nylas-web-elements/p-79c33cf9.entry.js +2 -0
  586. package/dist/nylas-web-elements/p-79c33cf9.entry.js.map +1 -0
  587. package/dist/nylas-web-elements/{p-052bc3b1.entry.js → p-7e08f131.entry.js} +2 -2
  588. package/dist/nylas-web-elements/{p-a12f3223.entry.js → p-7e10aa6d.entry.js} +2 -2
  589. package/dist/nylas-web-elements/{p-a7b19349.entry.js → p-7e53588e.entry.js} +2 -2
  590. package/dist/nylas-web-elements/p-83de54ae.entry.js +2 -0
  591. package/dist/nylas-web-elements/{p-b2d95965.entry.js → p-884b66bd.entry.js} +2 -2
  592. package/dist/nylas-web-elements/p-8aac762b.entry.js +2 -0
  593. package/dist/nylas-web-elements/p-8aac762b.entry.js.map +1 -0
  594. package/dist/nylas-web-elements/p-8d74c874.js +2 -0
  595. package/dist/nylas-web-elements/p-8d74c874.js.map +1 -0
  596. package/dist/nylas-web-elements/{p-a800e7af.entry.js → p-8ddf6518.entry.js} +2 -2
  597. package/dist/nylas-web-elements/p-8ddf6518.entry.js.map +1 -0
  598. package/dist/nylas-web-elements/{p-7a95bc3f.entry.js → p-90294a76.entry.js} +2 -2
  599. package/dist/nylas-web-elements/p-90817d1f.entry.js +2 -0
  600. package/dist/nylas-web-elements/{p-f1b0120b.entry.js → p-90d32fc3.entry.js} +2 -2
  601. package/dist/nylas-web-elements/p-94a93ca9.entry.js +2 -0
  602. package/dist/nylas-web-elements/p-94a93ca9.entry.js.map +1 -0
  603. package/dist/nylas-web-elements/p-95a9d2f1.entry.js +2 -0
  604. package/dist/nylas-web-elements/p-96746b87.entry.js +2 -0
  605. package/dist/nylas-web-elements/p-97026709.entry.js +2 -0
  606. package/dist/nylas-web-elements/{p-65097f45.entry.js → p-987042a1.entry.js} +2 -2
  607. package/dist/nylas-web-elements/{p-7ce048c0.entry.js → p-9f903292.entry.js} +2 -2
  608. package/dist/nylas-web-elements/{p-bd34f97d.entry.js → p-9fdbeba5.entry.js} +2 -2
  609. package/dist/nylas-web-elements/{p-2a92691a.entry.js → p-a22908ba.entry.js} +2 -2
  610. package/dist/nylas-web-elements/{p-091a8f00.entry.js → p-a3c76c06.entry.js} +2 -2
  611. package/dist/nylas-web-elements/{p-520ffe94.entry.js → p-a63d6241.entry.js} +2 -2
  612. package/dist/nylas-web-elements/{p-cf0d5ab9.entry.js → p-aa4e6e5e.entry.js} +2 -2
  613. package/dist/nylas-web-elements/{p-ba5a625c.entry.js → p-ab050d5b.entry.js} +2 -2
  614. package/dist/nylas-web-elements/p-b2b2d351.entry.js +2 -0
  615. package/dist/nylas-web-elements/p-b2b2d351.entry.js.map +1 -0
  616. package/dist/nylas-web-elements/{p-161c9325.entry.js → p-b348aad4.entry.js} +2 -2
  617. package/dist/nylas-web-elements/{p-bfe8e06b.entry.js → p-b547209f.entry.js} +2 -2
  618. package/dist/nylas-web-elements/{p-e8cde784.entry.js → p-b5b051e0.entry.js} +2 -2
  619. package/dist/nylas-web-elements/{p-aae7febd.entry.js → p-b7a53268.entry.js} +2 -2
  620. package/dist/nylas-web-elements/p-b8a9e8f4.entry.js +2 -0
  621. package/dist/nylas-web-elements/p-b8a9e8f4.entry.js.map +1 -0
  622. package/dist/nylas-web-elements/{p-385070ba.entry.js → p-bc6c9256.entry.js} +2 -2
  623. package/dist/nylas-web-elements/{p-cb03e4d4.entry.js → p-be26ce19.entry.js} +2 -2
  624. package/dist/nylas-web-elements/{p-8a4ac2a4.entry.js → p-bed6d217.entry.js} +2 -2
  625. package/dist/nylas-web-elements/p-bf4e0d2a.entry.js +2 -0
  626. package/dist/nylas-web-elements/p-bf4e0d2a.entry.js.map +1 -0
  627. package/dist/nylas-web-elements/{p-8e63b66c.entry.js → p-cb9fd100.entry.js} +2 -2
  628. package/dist/nylas-web-elements/p-ce14a1d5.entry.js +2 -0
  629. package/dist/nylas-web-elements/{p-1fa7b832.entry.js.map → p-ce14a1d5.entry.js.map} +1 -1
  630. package/dist/nylas-web-elements/{p-44507695.entry.js → p-cee0929a.entry.js} +2 -2
  631. package/dist/nylas-web-elements/{p-b334d63b.entry.js → p-cffb3636.entry.js} +2 -2
  632. package/dist/nylas-web-elements/{p-b2aca6c4.entry.js → p-d1ab9d75.entry.js} +2 -2
  633. package/dist/nylas-web-elements/p-d6a19e25.entry.js +2 -0
  634. package/dist/nylas-web-elements/p-d6a19e25.entry.js.map +1 -0
  635. package/dist/nylas-web-elements/{p-f96b12de.entry.js → p-d830e428.entry.js} +2 -2
  636. package/dist/nylas-web-elements/{p-8075a758.entry.js → p-d9b08dd2.entry.js} +2 -2
  637. package/dist/nylas-web-elements/{p-8f843faf.entry.js → p-db73506b.entry.js} +2 -2
  638. package/dist/nylas-web-elements/p-dcf99ddf.entry.js +2 -0
  639. package/dist/nylas-web-elements/p-dcf99ddf.entry.js.map +1 -0
  640. package/dist/nylas-web-elements/{p-d513d2ee.entry.js → p-de2f4643.entry.js} +2 -2
  641. package/dist/nylas-web-elements/{p-f2d1b1a6.entry.js.map → p-de2f4643.entry.js.map} +1 -1
  642. package/dist/nylas-web-elements/{p-25c97a60.entry.js → p-de84d999.entry.js} +2 -2
  643. package/dist/nylas-web-elements/p-debf614f.entry.js +8 -0
  644. package/dist/nylas-web-elements/p-debf614f.entry.js.map +1 -0
  645. package/dist/nylas-web-elements/{p-158fe1e9.entry.js → p-dfe9b5d0.entry.js} +2 -2
  646. package/dist/nylas-web-elements/{p-085950eb.entry.js → p-e5452799.entry.js} +2 -2
  647. package/dist/nylas-web-elements/{p-f8653b9b.entry.js → p-e6e79d76.entry.js} +2 -2
  648. package/dist/nylas-web-elements/{p-b813eb5d.entry.js → p-e944aa75.entry.js} +2 -2
  649. package/dist/nylas-web-elements/p-ec844414.entry.js +2 -0
  650. package/dist/nylas-web-elements/{p-34f0d1fe.entry.js.map → p-ec844414.entry.js.map} +1 -1
  651. package/dist/nylas-web-elements/p-ed64716c.entry.js +2 -0
  652. package/dist/nylas-web-elements/p-ed64716c.entry.js.map +1 -0
  653. package/dist/nylas-web-elements/{p-ecaf3ae1.entry.js → p-eff175d3.entry.js} +2 -2
  654. package/dist/nylas-web-elements/{p-246983ed.entry.js → p-eff774e6.entry.js} +2 -2
  655. package/dist/nylas-web-elements/p-f03b9d40.entry.js +2 -0
  656. package/dist/nylas-web-elements/p-f03b9d40.entry.js.map +1 -0
  657. package/dist/nylas-web-elements/{p-2f148064.entry.js → p-f13b8bd3.entry.js} +2 -2
  658. package/dist/nylas-web-elements/{p-8f3b02cd.entry.js → p-f7465959.entry.js} +2 -2
  659. package/dist/nylas-web-elements/p-f8e8270d.entry.js +2 -0
  660. package/dist/nylas-web-elements/p-f8e8270d.entry.js.map +1 -0
  661. package/dist/types/common/constants.d.ts +17 -0
  662. package/dist/types/common/icons/calendar-agenda-fill.d.ts +5 -0
  663. package/dist/types/common/icons/calendar-agenda.d.ts +5 -0
  664. package/dist/types/common/icons/copy.d.ts +5 -0
  665. package/dist/types/common/icons/delete.d.ts +5 -0
  666. package/dist/types/common/icons/dragable.d.ts +5 -0
  667. package/dist/types/common/icons/edit.d.ts +5 -0
  668. package/dist/types/common/icons/eye.d.ts +5 -0
  669. package/dist/types/common/icons/google-meet.d.ts +5 -0
  670. package/dist/types/common/icons/microsof-teams.d.ts +5 -0
  671. package/dist/types/common/icons/plus.d.ts +5 -0
  672. package/dist/types/common/icons/zoom.d.ts +5 -0
  673. package/dist/types/common/nylas-api-request.d.ts +1 -0
  674. package/dist/types/common/types.d.ts +1 -0
  675. package/dist/types/components/design-system/checkbox-component/checkbox-component.d.ts +3 -0
  676. package/dist/types/components/design-system/input-component/input-component.d.ts +2 -1
  677. package/dist/types/components/design-system/multi-select-dropdown/multi-select-dropdown.d.ts +1 -0
  678. package/dist/types/components/design-system/radio-button-group/radio-button-group.d.ts +6 -1
  679. package/dist/types/components/design-system/select-dropdown/select-dropdown.d.ts +3 -0
  680. package/dist/types/components/design-system/textarea-component/textarea-component.d.ts +2 -0
  681. package/dist/types/components/scheduler/nylas-booked-event-card/nylas-booked-event-card.d.ts +1 -0
  682. package/dist/types/components/scheduler/nylas-booking-form/nylas-booking-form.d.ts +8 -6
  683. package/dist/types/components/scheduler/nylas-cancel-booking-form/nylas-cancel-booking-form.d.ts +3 -2
  684. package/dist/types/components/scheduler-editor/nylas-additional-participants/nylas-additional-participants.d.ts +7 -4
  685. package/dist/types/components/scheduler-editor/nylas-booking-calendar-picker/nylas-booking-calendar-picker.d.ts +1 -0
  686. package/dist/types/components/scheduler-editor/nylas-booking-form-config/nylas-booking-form-config.d.ts +51 -0
  687. package/dist/types/components/scheduler-editor/nylas-calendar-picker/nylas-calendar-picker.d.ts +1 -0
  688. package/dist/types/components/scheduler-editor/nylas-connected-calendars/nylas-connected-calendars.d.ts +41 -0
  689. package/dist/types/components/scheduler-editor/nylas-customize-booking-settings/nylas-customize-booking-settings.d.ts +1 -1
  690. package/dist/types/components/scheduler-editor/nylas-editor-tabs/nylas-editor-tabs.d.ts +27 -4
  691. package/dist/types/components/scheduler-editor/nylas-editor-tabs/tab-contents.d.ts +2 -1
  692. package/dist/types/components/scheduler-editor/nylas-event-location/nylas-event-location.d.ts +7 -1
  693. package/dist/types/components/scheduler-editor/nylas-list-configurations/nylas-list-configurations.d.ts +13 -2
  694. package/dist/types/components/scheduler-editor/nylas-participant-booking-calendars/nylas-participant-booking-calendars.d.ts +43 -0
  695. package/dist/types/components/scheduler-editor/nylas-participants-custom-availability/nylas-participants-custom-availability.d.ts +4 -2
  696. package/dist/types/components/scheduler-editor/nylas-scheduler-editor/ExpressFlow.d.ts +11 -2
  697. package/dist/types/components/scheduler-editor/nylas-scheduler-editor/nylas-scheduler-editor.d.ts +4 -2
  698. package/dist/types/components/scheduler-editor/nylas-timeslot-interval/nylas-timeslot-interval.d.ts +2 -2
  699. package/dist/types/components.d.ts +723 -30
  700. package/dist/types/connector/shared/api/scheduler-config.d.ts +1 -1
  701. package/dist/types/stores/scheduler-config-store.d.ts +5 -2
  702. package/dist/types/stores/scheduler-store.d.ts +3 -1
  703. package/dist/types/types/index.d.ts +8 -0
  704. package/package.json +3 -2
  705. package/dist/cjs/button-component.cjs.entry.js +0 -31
  706. package/dist/cjs/button-component.cjs.entry.js.map +0 -1
  707. package/dist/cjs/calendar-info-icon_28.cjs.entry.js +0 -2935
  708. package/dist/cjs/calendar-info-icon_28.cjs.entry.js.map +0 -1
  709. package/dist/cjs/input-component.cjs.entry.js +0 -89
  710. package/dist/cjs/input-component.cjs.entry.js.map +0 -1
  711. package/dist/cjs/nylas-api-request-a1751a40.js.map +0 -1
  712. package/dist/cjs/scheduler-config-store-9f19c7a9.js.map +0 -1
  713. package/dist/cjs/scheduler-store-0f7328f1.js.map +0 -1
  714. package/dist/esm/button-component.entry.js +0 -27
  715. package/dist/esm/button-component.entry.js.map +0 -1
  716. package/dist/esm/calendar-info-icon_28.entry.js +0 -2904
  717. package/dist/esm/calendar-info-icon_28.entry.js.map +0 -1
  718. package/dist/esm/input-component.entry.js +0 -85
  719. package/dist/esm/input-component.entry.js.map +0 -1
  720. package/dist/esm/nylas-api-request-a67d2997.js.map +0 -1
  721. package/dist/esm/scheduler-config-store-4a50a03d.js.map +0 -1
  722. package/dist/esm/scheduler-store-f02ce045.js.map +0 -1
  723. package/dist/nylas-web-elements/p-019be093.entry.js +0 -11
  724. package/dist/nylas-web-elements/p-019be093.entry.js.map +0 -1
  725. package/dist/nylas-web-elements/p-05833164.entry.js +0 -2
  726. package/dist/nylas-web-elements/p-05833164.entry.js.map +0 -1
  727. package/dist/nylas-web-elements/p-061d0ae2.entry.js +0 -2
  728. package/dist/nylas-web-elements/p-061d0ae2.entry.js.map +0 -1
  729. package/dist/nylas-web-elements/p-0c31f7ca.entry.js +0 -2
  730. package/dist/nylas-web-elements/p-0d98c728.entry.js +0 -2
  731. package/dist/nylas-web-elements/p-0d98c728.entry.js.map +0 -1
  732. package/dist/nylas-web-elements/p-12b83ea9.entry.js +0 -2
  733. package/dist/nylas-web-elements/p-16fb6243.entry.js +0 -2
  734. package/dist/nylas-web-elements/p-1970b6ee.entry.js +0 -2
  735. package/dist/nylas-web-elements/p-1a27960b.entry.js.map +0 -1
  736. package/dist/nylas-web-elements/p-1fa7b832.entry.js +0 -2
  737. package/dist/nylas-web-elements/p-26976360.entry.js +0 -2
  738. package/dist/nylas-web-elements/p-26976360.entry.js.map +0 -1
  739. package/dist/nylas-web-elements/p-29938263.js +0 -2
  740. package/dist/nylas-web-elements/p-29938263.js.map +0 -1
  741. package/dist/nylas-web-elements/p-33a6a75b.entry.js +0 -2
  742. package/dist/nylas-web-elements/p-36f4b804.entry.js +0 -2
  743. package/dist/nylas-web-elements/p-36f4b804.entry.js.map +0 -1
  744. package/dist/nylas-web-elements/p-39160c0d.entry.js +0 -11
  745. package/dist/nylas-web-elements/p-39160c0d.entry.js.map +0 -1
  746. package/dist/nylas-web-elements/p-3b6bd448.entry.js +0 -2
  747. package/dist/nylas-web-elements/p-3eeab083.entry.js +0 -2
  748. package/dist/nylas-web-elements/p-49f716ed.js.map +0 -1
  749. package/dist/nylas-web-elements/p-53a1bb82.entry.js +0 -2
  750. package/dist/nylas-web-elements/p-53a1bb82.entry.js.map +0 -1
  751. package/dist/nylas-web-elements/p-5bed86c2.entry.js +0 -2
  752. package/dist/nylas-web-elements/p-5ddd0c37.entry.js +0 -2
  753. package/dist/nylas-web-elements/p-613c070f.js.map +0 -1
  754. package/dist/nylas-web-elements/p-644ff4ee.entry.js +0 -2
  755. package/dist/nylas-web-elements/p-644ff4ee.entry.js.map +0 -1
  756. package/dist/nylas-web-elements/p-64d73008.entry.js +0 -2
  757. package/dist/nylas-web-elements/p-6ddb4b95.entry.js +0 -2
  758. package/dist/nylas-web-elements/p-6ddb4b95.entry.js.map +0 -1
  759. package/dist/nylas-web-elements/p-823c8aa2.js +0 -2
  760. package/dist/nylas-web-elements/p-823c8aa2.js.map +0 -1
  761. package/dist/nylas-web-elements/p-83444c0a.entry.js +0 -2
  762. package/dist/nylas-web-elements/p-83444c0a.entry.js.map +0 -1
  763. package/dist/nylas-web-elements/p-8506a8d4.entry.js +0 -11
  764. package/dist/nylas-web-elements/p-8506a8d4.entry.js.map +0 -1
  765. package/dist/nylas-web-elements/p-926dd201.entry.js +0 -2
  766. package/dist/nylas-web-elements/p-9283504a.entry.js +0 -2
  767. package/dist/nylas-web-elements/p-9283504a.entry.js.map +0 -1
  768. package/dist/nylas-web-elements/p-958746a1.entry.js +0 -2
  769. package/dist/nylas-web-elements/p-9bb41364.entry.js +0 -2
  770. package/dist/nylas-web-elements/p-9bb41364.entry.js.map +0 -1
  771. package/dist/nylas-web-elements/p-a800e7af.entry.js.map +0 -1
  772. package/dist/nylas-web-elements/p-a8678862.entry.js +0 -2
  773. package/dist/nylas-web-elements/p-aac962c7.entry.js +0 -2
  774. package/dist/nylas-web-elements/p-aac962c7.entry.js.map +0 -1
  775. package/dist/nylas-web-elements/p-b4d09fcf.entry.js +0 -2
  776. package/dist/nylas-web-elements/p-b4d09fcf.entry.js.map +0 -1
  777. package/dist/nylas-web-elements/p-b9559f06.entry.js +0 -2
  778. package/dist/nylas-web-elements/p-b9559f06.entry.js.map +0 -1
  779. package/dist/nylas-web-elements/p-bab1d562.entry.js +0 -2
  780. package/dist/nylas-web-elements/p-bab1d562.entry.js.map +0 -1
  781. package/dist/nylas-web-elements/p-c18c15d0.entry.js +0 -2
  782. package/dist/nylas-web-elements/p-c1ff6499.entry.js +0 -2
  783. package/dist/nylas-web-elements/p-c1ff6499.entry.js.map +0 -1
  784. package/dist/nylas-web-elements/p-d5d67115.entry.js +0 -2
  785. package/dist/nylas-web-elements/p-d5d67115.entry.js.map +0 -1
  786. package/dist/nylas-web-elements/p-d9a91bc9.entry.js.map +0 -1
  787. package/dist/nylas-web-elements/p-ea12997b.entry.js +0 -2
  788. package/dist/nylas-web-elements/p-f2d1b1a6.entry.js +0 -2
  789. package/dist/nylas-web-elements/p-f6fafe86.entry.js +0 -2
  790. package/dist/nylas-web-elements/p-f6fafe86.entry.js.map +0 -1
  791. package/dist/nylas-web-elements/p-ffce3a49.entry.js +0 -2
  792. package/dist/nylas-web-elements/p-ffce3a49.entry.js.map +0 -1
  793. /package/dist/nylas-web-elements/{p-08d75d35.entry.js.map → p-064c2ae5.entry.js.map} +0 -0
  794. /package/dist/nylas-web-elements/{p-5bed86c2.entry.js.map → p-0aa1e433.entry.js.map} +0 -0
  795. /package/dist/nylas-web-elements/{p-3f122804.entry.js.map → p-0bf6f818.entry.js.map} +0 -0
  796. /package/dist/nylas-web-elements/{p-926dd201.entry.js.map → p-1102df14.entry.js.map} +0 -0
  797. /package/dist/nylas-web-elements/{p-a7b19349.entry.js.map → p-155e5ce8.entry.js.map} +0 -0
  798. /package/dist/nylas-web-elements/{p-a85408e0.entry.js.map → p-18d100c8.entry.js.map} +0 -0
  799. /package/dist/nylas-web-elements/{p-5231fc13.entry.js.map → p-1a7edf86.entry.js.map} +0 -0
  800. /package/dist/nylas-web-elements/{p-554891cd.entry.js.map → p-1e1ae8d0.entry.js.map} +0 -0
  801. /package/dist/nylas-web-elements/{p-65097f45.entry.js.map → p-1fbe50b1.entry.js.map} +0 -0
  802. /package/dist/nylas-web-elements/{p-70e5cfb0.entry.js.map → p-22e05c7d.entry.js.map} +0 -0
  803. /package/dist/nylas-web-elements/{p-be38a8eb.entry.js.map → p-26302ad0.entry.js.map} +0 -0
  804. /package/dist/nylas-web-elements/{p-2a92691a.entry.js.map → p-2f47205d.entry.js.map} +0 -0
  805. /package/dist/nylas-web-elements/{p-085950eb.entry.js.map → p-3277023d.entry.js.map} +0 -0
  806. /package/dist/nylas-web-elements/{p-64d73008.entry.js.map → p-34c747f9.entry.js.map} +0 -0
  807. /package/dist/nylas-web-elements/{p-45c37986.entry.js.map → p-3ae38e51.entry.js.map} +0 -0
  808. /package/dist/nylas-web-elements/{p-0c31f7ca.entry.js.map → p-3bc1289e.entry.js.map} +0 -0
  809. /package/dist/nylas-web-elements/{p-5ddd0c37.entry.js.map → p-3d1e8e4d.entry.js.map} +0 -0
  810. /package/dist/nylas-web-elements/{p-e9ba368f.entry.js.map → p-3dae0c71.entry.js.map} +0 -0
  811. /package/dist/nylas-web-elements/{p-acadfabf.entry.js.map → p-3db7ab8d.entry.js.map} +0 -0
  812. /package/dist/nylas-web-elements/{p-28512ab6.entry.js.map → p-3e09b0fb.entry.js.map} +0 -0
  813. /package/dist/nylas-web-elements/{p-158fe1e9.entry.js.map → p-3eac9f45.entry.js.map} +0 -0
  814. /package/dist/nylas-web-elements/{p-d513d2ee.entry.js.map → p-4000107d.entry.js.map} +0 -0
  815. /package/dist/nylas-web-elements/{p-3b6bd448.entry.js.map → p-47392968.entry.js.map} +0 -0
  816. /package/dist/nylas-web-elements/{p-16a3bfb2.entry.js.map → p-4a594ebe.entry.js.map} +0 -0
  817. /package/dist/nylas-web-elements/{p-c90755ba.entry.js.map → p-4b6995fe.entry.js.map} +0 -0
  818. /package/dist/nylas-web-elements/{p-b2d95965.entry.js.map → p-4cdd4107.entry.js.map} +0 -0
  819. /package/dist/nylas-web-elements/{p-25c97a60.entry.js.map → p-4e8c8939.entry.js.map} +0 -0
  820. /package/dist/nylas-web-elements/{p-6bd9c9c3.entry.js.map → p-4e9ba325.entry.js.map} +0 -0
  821. /package/dist/nylas-web-elements/{p-6ce66add.entry.js.map → p-524a6acc.entry.js.map} +0 -0
  822. /package/dist/nylas-web-elements/{p-9b68568e.entry.js.map → p-533d39ce.entry.js.map} +0 -0
  823. /package/dist/nylas-web-elements/{p-7a95bc3f.entry.js.map → p-5a379fb5.entry.js.map} +0 -0
  824. /package/dist/nylas-web-elements/{p-cb03e4d4.entry.js.map → p-5a68368a.entry.js.map} +0 -0
  825. /package/dist/nylas-web-elements/{p-1970b6ee.entry.js.map → p-5b965d0d.entry.js.map} +0 -0
  826. /package/dist/nylas-web-elements/{p-091a8f00.entry.js.map → p-5ff4e63b.entry.js.map} +0 -0
  827. /package/dist/nylas-web-elements/{p-37f41a90.entry.js.map → p-656cf33f.entry.js.map} +0 -0
  828. /package/dist/nylas-web-elements/{p-246983ed.entry.js.map → p-65b7a2a7.entry.js.map} +0 -0
  829. /package/dist/nylas-web-elements/{p-60b03f86.entry.js.map → p-6c8af4fb.entry.js.map} +0 -0
  830. /package/dist/nylas-web-elements/{p-8e63b66c.entry.js.map → p-6d410f0a.entry.js.map} +0 -0
  831. /package/dist/nylas-web-elements/{p-daac96cb.entry.js.map → p-6e50d2fd.entry.js.map} +0 -0
  832. /package/dist/nylas-web-elements/{p-c18c15d0.entry.js.map → p-6e8b7ce8.entry.js.map} +0 -0
  833. /package/dist/nylas-web-elements/{p-b9fa6848.entry.js.map → p-7355937b.entry.js.map} +0 -0
  834. /package/dist/nylas-web-elements/{p-a8678862.entry.js.map → p-76156a82.entry.js.map} +0 -0
  835. /package/dist/nylas-web-elements/{p-052bc3b1.entry.js.map → p-7e08f131.entry.js.map} +0 -0
  836. /package/dist/nylas-web-elements/{p-2f148064.entry.js.map → p-7e10aa6d.entry.js.map} +0 -0
  837. /package/dist/nylas-web-elements/{p-b2aca6c4.entry.js.map → p-7e53588e.entry.js.map} +0 -0
  838. /package/dist/nylas-web-elements/{p-aae7febd.entry.js.map → p-83de54ae.entry.js.map} +0 -0
  839. /package/dist/nylas-web-elements/{p-de7b0878.entry.js.map → p-884b66bd.entry.js.map} +0 -0
  840. /package/dist/nylas-web-elements/{p-e928898a.entry.js.map → p-90294a76.entry.js.map} +0 -0
  841. /package/dist/nylas-web-elements/{p-3eeab083.entry.js.map → p-90817d1f.entry.js.map} +0 -0
  842. /package/dist/nylas-web-elements/{p-f1b0120b.entry.js.map → p-90d32fc3.entry.js.map} +0 -0
  843. /package/dist/nylas-web-elements/{p-dcc27b67.entry.js.map → p-95a9d2f1.entry.js.map} +0 -0
  844. /package/dist/nylas-web-elements/{p-6ef1024f.entry.js.map → p-96746b87.entry.js.map} +0 -0
  845. /package/dist/nylas-web-elements/{p-7fcecf3f.entry.js.map → p-97026709.entry.js.map} +0 -0
  846. /package/dist/nylas-web-elements/{p-eb7e8455.entry.js.map → p-987042a1.entry.js.map} +0 -0
  847. /package/dist/nylas-web-elements/{p-44507695.entry.js.map → p-9f903292.entry.js.map} +0 -0
  848. /package/dist/nylas-web-elements/{p-7ce048c0.entry.js.map → p-9fdbeba5.entry.js.map} +0 -0
  849. /package/dist/nylas-web-elements/{p-9794f735.entry.js.map → p-a22908ba.entry.js.map} +0 -0
  850. /package/dist/nylas-web-elements/{p-16fb6243.entry.js.map → p-a3c76c06.entry.js.map} +0 -0
  851. /package/dist/nylas-web-elements/{p-520ffe94.entry.js.map → p-a63d6241.entry.js.map} +0 -0
  852. /package/dist/nylas-web-elements/{p-cf0d5ab9.entry.js.map → p-aa4e6e5e.entry.js.map} +0 -0
  853. /package/dist/nylas-web-elements/{p-ba5a625c.entry.js.map → p-ab050d5b.entry.js.map} +0 -0
  854. /package/dist/nylas-web-elements/{p-161c9325.entry.js.map → p-b348aad4.entry.js.map} +0 -0
  855. /package/dist/nylas-web-elements/{p-5c3c1888.entry.js.map → p-b547209f.entry.js.map} +0 -0
  856. /package/dist/nylas-web-elements/{p-e8cde784.entry.js.map → p-b5b051e0.entry.js.map} +0 -0
  857. /package/dist/nylas-web-elements/{p-b0c8021f.entry.js.map → p-b7a53268.entry.js.map} +0 -0
  858. /package/dist/nylas-web-elements/{p-385070ba.entry.js.map → p-bc6c9256.entry.js.map} +0 -0
  859. /package/dist/nylas-web-elements/{p-d633e735.entry.js.map → p-be26ce19.entry.js.map} +0 -0
  860. /package/dist/nylas-web-elements/{p-8a4ac2a4.entry.js.map → p-bed6d217.entry.js.map} +0 -0
  861. /package/dist/nylas-web-elements/{p-8f3b02cd.entry.js.map → p-cb9fd100.entry.js.map} +0 -0
  862. /package/dist/nylas-web-elements/{p-bd34f97d.entry.js.map → p-cee0929a.entry.js.map} +0 -0
  863. /package/dist/nylas-web-elements/{p-b334d63b.entry.js.map → p-cffb3636.entry.js.map} +0 -0
  864. /package/dist/nylas-web-elements/{p-f1a54acf.entry.js.map → p-d1ab9d75.entry.js.map} +0 -0
  865. /package/dist/nylas-web-elements/{p-f96b12de.entry.js.map → p-d830e428.entry.js.map} +0 -0
  866. /package/dist/nylas-web-elements/{p-8075a758.entry.js.map → p-d9b08dd2.entry.js.map} +0 -0
  867. /package/dist/nylas-web-elements/{p-39fd9c90.entry.js.map → p-db73506b.entry.js.map} +0 -0
  868. /package/dist/nylas-web-elements/{p-8f843faf.entry.js.map → p-de84d999.entry.js.map} +0 -0
  869. /package/dist/nylas-web-elements/{p-bfe8e06b.entry.js.map → p-dfe9b5d0.entry.js.map} +0 -0
  870. /package/dist/nylas-web-elements/{p-66493463.entry.js.map → p-e5452799.entry.js.map} +0 -0
  871. /package/dist/nylas-web-elements/{p-f8653b9b.entry.js.map → p-e6e79d76.entry.js.map} +0 -0
  872. /package/dist/nylas-web-elements/{p-b813eb5d.entry.js.map → p-e944aa75.entry.js.map} +0 -0
  873. /package/dist/nylas-web-elements/{p-a12f3223.entry.js.map → p-eff175d3.entry.js.map} +0 -0
  874. /package/dist/nylas-web-elements/{p-cf589eab.entry.js.map → p-eff774e6.entry.js.map} +0 -0
  875. /package/dist/nylas-web-elements/{p-ecaf3ae1.entry.js.map → p-f13b8bd3.entry.js.map} +0 -0
  876. /package/dist/nylas-web-elements/{p-ea12997b.entry.js.map → p-f7465959.entry.js.map} +0 -0
@@ -0,0 +1,3691 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
2
+ import { R as RegisterComponent } from './register-component.js';
3
+ import { a as debug } from './utils.js';
4
+ import { D as DEFAULT_FORM_FIELD_TYPES, F as FIELD_TYPES } from './constants.js';
5
+ import { d as defineCustomElement$8 } from './add-circle.js';
6
+ import { d as defineCustomElement$7 } from './chevron.js';
7
+ import { d as defineCustomElement$6 } from './close.js';
8
+ import { d as defineCustomElement$5 } from './dragable.js';
9
+ import { d as defineCustomElement$4 } from './input-component2.js';
10
+ import { d as defineCustomElement$3 } from './plus.js';
11
+ import { d as defineCustomElement$2 } from './search.js';
12
+ import { d as defineCustomElement$1 } from './select-dropdown2.js';
13
+
14
+ /**!
15
+ * Sortable 1.15.2
16
+ * @author RubaXa <trash@rubaxa.org>
17
+ * @author owenm <owen23355@gmail.com>
18
+ * @license MIT
19
+ */
20
+ function ownKeys(object, enumerableOnly) {
21
+ var keys = Object.keys(object);
22
+ if (Object.getOwnPropertySymbols) {
23
+ var symbols = Object.getOwnPropertySymbols(object);
24
+ if (enumerableOnly) {
25
+ symbols = symbols.filter(function (sym) {
26
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
27
+ });
28
+ }
29
+ keys.push.apply(keys, symbols);
30
+ }
31
+ return keys;
32
+ }
33
+ function _objectSpread2(target) {
34
+ for (var i = 1; i < arguments.length; i++) {
35
+ var source = arguments[i] != null ? arguments[i] : {};
36
+ if (i % 2) {
37
+ ownKeys(Object(source), true).forEach(function (key) {
38
+ _defineProperty(target, key, source[key]);
39
+ });
40
+ } else if (Object.getOwnPropertyDescriptors) {
41
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
42
+ } else {
43
+ ownKeys(Object(source)).forEach(function (key) {
44
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
45
+ });
46
+ }
47
+ }
48
+ return target;
49
+ }
50
+ function _typeof(obj) {
51
+ "@babel/helpers - typeof";
52
+
53
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
54
+ _typeof = function (obj) {
55
+ return typeof obj;
56
+ };
57
+ } else {
58
+ _typeof = function (obj) {
59
+ return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
60
+ };
61
+ }
62
+ return _typeof(obj);
63
+ }
64
+ function _defineProperty(obj, key, value) {
65
+ if (key in obj) {
66
+ Object.defineProperty(obj, key, {
67
+ value: value,
68
+ enumerable: true,
69
+ configurable: true,
70
+ writable: true
71
+ });
72
+ } else {
73
+ obj[key] = value;
74
+ }
75
+ return obj;
76
+ }
77
+ function _extends() {
78
+ _extends = Object.assign || function (target) {
79
+ for (var i = 1; i < arguments.length; i++) {
80
+ var source = arguments[i];
81
+ for (var key in source) {
82
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
83
+ target[key] = source[key];
84
+ }
85
+ }
86
+ }
87
+ return target;
88
+ };
89
+ return _extends.apply(this, arguments);
90
+ }
91
+ function _objectWithoutPropertiesLoose(source, excluded) {
92
+ if (source == null) return {};
93
+ var target = {};
94
+ var sourceKeys = Object.keys(source);
95
+ var key, i;
96
+ for (i = 0; i < sourceKeys.length; i++) {
97
+ key = sourceKeys[i];
98
+ if (excluded.indexOf(key) >= 0) continue;
99
+ target[key] = source[key];
100
+ }
101
+ return target;
102
+ }
103
+ function _objectWithoutProperties(source, excluded) {
104
+ if (source == null) return {};
105
+ var target = _objectWithoutPropertiesLoose(source, excluded);
106
+ var key, i;
107
+ if (Object.getOwnPropertySymbols) {
108
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
109
+ for (i = 0; i < sourceSymbolKeys.length; i++) {
110
+ key = sourceSymbolKeys[i];
111
+ if (excluded.indexOf(key) >= 0) continue;
112
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
113
+ target[key] = source[key];
114
+ }
115
+ }
116
+ return target;
117
+ }
118
+ function _toConsumableArray(arr) {
119
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
120
+ }
121
+ function _arrayWithoutHoles(arr) {
122
+ if (Array.isArray(arr)) return _arrayLikeToArray(arr);
123
+ }
124
+ function _iterableToArray(iter) {
125
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
126
+ }
127
+ function _unsupportedIterableToArray(o, minLen) {
128
+ if (!o) return;
129
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
130
+ var n = Object.prototype.toString.call(o).slice(8, -1);
131
+ if (n === "Object" && o.constructor) n = o.constructor.name;
132
+ if (n === "Map" || n === "Set") return Array.from(o);
133
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
134
+ }
135
+ function _arrayLikeToArray(arr, len) {
136
+ if (len == null || len > arr.length) len = arr.length;
137
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
138
+ return arr2;
139
+ }
140
+ function _nonIterableSpread() {
141
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
142
+ }
143
+
144
+ var version = "1.15.2";
145
+
146
+ function userAgent(pattern) {
147
+ if (typeof window !== 'undefined' && window.navigator) {
148
+ return !! /*@__PURE__*/navigator.userAgent.match(pattern);
149
+ }
150
+ }
151
+ var IE11OrLess = userAgent(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i);
152
+ var Edge = userAgent(/Edge/i);
153
+ var FireFox = userAgent(/firefox/i);
154
+ var Safari = userAgent(/safari/i) && !userAgent(/chrome/i) && !userAgent(/android/i);
155
+ var IOS = userAgent(/iP(ad|od|hone)/i);
156
+ var ChromeForAndroid = userAgent(/chrome/i) && userAgent(/android/i);
157
+
158
+ var captureMode = {
159
+ capture: false,
160
+ passive: false
161
+ };
162
+ function on(el, event, fn) {
163
+ el.addEventListener(event, fn, !IE11OrLess && captureMode);
164
+ }
165
+ function off(el, event, fn) {
166
+ el.removeEventListener(event, fn, !IE11OrLess && captureMode);
167
+ }
168
+ function matches( /**HTMLElement*/el, /**String*/selector) {
169
+ if (!selector) return;
170
+ selector[0] === '>' && (selector = selector.substring(1));
171
+ if (el) {
172
+ try {
173
+ if (el.matches) {
174
+ return el.matches(selector);
175
+ } else if (el.msMatchesSelector) {
176
+ return el.msMatchesSelector(selector);
177
+ } else if (el.webkitMatchesSelector) {
178
+ return el.webkitMatchesSelector(selector);
179
+ }
180
+ } catch (_) {
181
+ return false;
182
+ }
183
+ }
184
+ return false;
185
+ }
186
+ function getParentOrHost(el) {
187
+ return el.host && el !== document && el.host.nodeType ? el.host : el.parentNode;
188
+ }
189
+ function closest( /**HTMLElement*/el, /**String*/selector, /**HTMLElement*/ctx, includeCTX) {
190
+ if (el) {
191
+ ctx = ctx || document;
192
+ do {
193
+ if (selector != null && (selector[0] === '>' ? el.parentNode === ctx && matches(el, selector) : matches(el, selector)) || includeCTX && el === ctx) {
194
+ return el;
195
+ }
196
+ if (el === ctx) break;
197
+ /* jshint boss:true */
198
+ } while (el = getParentOrHost(el));
199
+ }
200
+ return null;
201
+ }
202
+ var R_SPACE = /\s+/g;
203
+ function toggleClass(el, name, state) {
204
+ if (el && name) {
205
+ if (el.classList) {
206
+ el.classList[state ? 'add' : 'remove'](name);
207
+ } else {
208
+ var className = (' ' + el.className + ' ').replace(R_SPACE, ' ').replace(' ' + name + ' ', ' ');
209
+ el.className = (className + (state ? ' ' + name : '')).replace(R_SPACE, ' ');
210
+ }
211
+ }
212
+ }
213
+ function css(el, prop, val) {
214
+ var style = el && el.style;
215
+ if (style) {
216
+ if (val === void 0) {
217
+ if (document.defaultView && document.defaultView.getComputedStyle) {
218
+ val = document.defaultView.getComputedStyle(el, '');
219
+ } else if (el.currentStyle) {
220
+ val = el.currentStyle;
221
+ }
222
+ return prop === void 0 ? val : val[prop];
223
+ } else {
224
+ if (!(prop in style) && prop.indexOf('webkit') === -1) {
225
+ prop = '-webkit-' + prop;
226
+ }
227
+ style[prop] = val + (typeof val === 'string' ? '' : 'px');
228
+ }
229
+ }
230
+ }
231
+ function matrix(el, selfOnly) {
232
+ var appliedTransforms = '';
233
+ if (typeof el === 'string') {
234
+ appliedTransforms = el;
235
+ } else {
236
+ do {
237
+ var transform = css(el, 'transform');
238
+ if (transform && transform !== 'none') {
239
+ appliedTransforms = transform + ' ' + appliedTransforms;
240
+ }
241
+ /* jshint boss:true */
242
+ } while (!selfOnly && (el = el.parentNode));
243
+ }
244
+ var matrixFn = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
245
+ /*jshint -W056 */
246
+ return matrixFn && new matrixFn(appliedTransforms);
247
+ }
248
+ function find(ctx, tagName, iterator) {
249
+ if (ctx) {
250
+ var list = ctx.getElementsByTagName(tagName),
251
+ i = 0,
252
+ n = list.length;
253
+ if (iterator) {
254
+ for (; i < n; i++) {
255
+ iterator(list[i], i);
256
+ }
257
+ }
258
+ return list;
259
+ }
260
+ return [];
261
+ }
262
+ function getWindowScrollingElement() {
263
+ var scrollingElement = document.scrollingElement;
264
+ if (scrollingElement) {
265
+ return scrollingElement;
266
+ } else {
267
+ return document.documentElement;
268
+ }
269
+ }
270
+
271
+ /**
272
+ * Returns the "bounding client rect" of given element
273
+ * @param {HTMLElement} el The element whose boundingClientRect is wanted
274
+ * @param {[Boolean]} relativeToContainingBlock Whether the rect should be relative to the containing block of (including) the container
275
+ * @param {[Boolean]} relativeToNonStaticParent Whether the rect should be relative to the relative parent of (including) the contaienr
276
+ * @param {[Boolean]} undoScale Whether the container's scale() should be undone
277
+ * @param {[HTMLElement]} container The parent the element will be placed in
278
+ * @return {Object} The boundingClientRect of el, with specified adjustments
279
+ */
280
+ function getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoScale, container) {
281
+ if (!el.getBoundingClientRect && el !== window) return;
282
+ var elRect, top, left, bottom, right, height, width;
283
+ if (el !== window && el.parentNode && el !== getWindowScrollingElement()) {
284
+ elRect = el.getBoundingClientRect();
285
+ top = elRect.top;
286
+ left = elRect.left;
287
+ bottom = elRect.bottom;
288
+ right = elRect.right;
289
+ height = elRect.height;
290
+ width = elRect.width;
291
+ } else {
292
+ top = 0;
293
+ left = 0;
294
+ bottom = window.innerHeight;
295
+ right = window.innerWidth;
296
+ height = window.innerHeight;
297
+ width = window.innerWidth;
298
+ }
299
+ if ((relativeToContainingBlock || relativeToNonStaticParent) && el !== window) {
300
+ // Adjust for translate()
301
+ container = container || el.parentNode;
302
+
303
+ // solves #1123 (see: https://stackoverflow.com/a/37953806/6088312)
304
+ // Not needed on <= IE11
305
+ if (!IE11OrLess) {
306
+ do {
307
+ if (container && container.getBoundingClientRect && (css(container, 'transform') !== 'none' || relativeToNonStaticParent && css(container, 'position') !== 'static')) {
308
+ var containerRect = container.getBoundingClientRect();
309
+
310
+ // Set relative to edges of padding box of container
311
+ top -= containerRect.top + parseInt(css(container, 'border-top-width'));
312
+ left -= containerRect.left + parseInt(css(container, 'border-left-width'));
313
+ bottom = top + elRect.height;
314
+ right = left + elRect.width;
315
+ break;
316
+ }
317
+ /* jshint boss:true */
318
+ } while (container = container.parentNode);
319
+ }
320
+ }
321
+ if (undoScale && el !== window) {
322
+ // Adjust for scale()
323
+ var elMatrix = matrix(container || el),
324
+ scaleX = elMatrix && elMatrix.a,
325
+ scaleY = elMatrix && elMatrix.d;
326
+ if (elMatrix) {
327
+ top /= scaleY;
328
+ left /= scaleX;
329
+ width /= scaleX;
330
+ height /= scaleY;
331
+ bottom = top + height;
332
+ right = left + width;
333
+ }
334
+ }
335
+ return {
336
+ top: top,
337
+ left: left,
338
+ bottom: bottom,
339
+ right: right,
340
+ width: width,
341
+ height: height
342
+ };
343
+ }
344
+
345
+ /**
346
+ * Checks if a side of an element is scrolled past a side of its parents
347
+ * @param {HTMLElement} el The element who's side being scrolled out of view is in question
348
+ * @param {String} elSide Side of the element in question ('top', 'left', 'right', 'bottom')
349
+ * @param {String} parentSide Side of the parent in question ('top', 'left', 'right', 'bottom')
350
+ * @return {HTMLElement} The parent scroll element that the el's side is scrolled past, or null if there is no such element
351
+ */
352
+ function isScrolledPast(el, elSide, parentSide) {
353
+ var parent = getParentAutoScrollElement(el, true),
354
+ elSideVal = getRect(el)[elSide];
355
+
356
+ /* jshint boss:true */
357
+ while (parent) {
358
+ var parentSideVal = getRect(parent)[parentSide],
359
+ visible = void 0;
360
+ if (parentSide === 'top' || parentSide === 'left') {
361
+ visible = elSideVal >= parentSideVal;
362
+ } else {
363
+ visible = elSideVal <= parentSideVal;
364
+ }
365
+ if (!visible) return parent;
366
+ if (parent === getWindowScrollingElement()) break;
367
+ parent = getParentAutoScrollElement(parent, false);
368
+ }
369
+ return false;
370
+ }
371
+
372
+ /**
373
+ * Gets nth child of el, ignoring hidden children, sortable's elements (does not ignore clone if it's visible)
374
+ * and non-draggable elements
375
+ * @param {HTMLElement} el The parent element
376
+ * @param {Number} childNum The index of the child
377
+ * @param {Object} options Parent Sortable's options
378
+ * @return {HTMLElement} The child at index childNum, or null if not found
379
+ */
380
+ function getChild(el, childNum, options, includeDragEl) {
381
+ var currentChild = 0,
382
+ i = 0,
383
+ children = el.children;
384
+ while (i < children.length) {
385
+ if (children[i].style.display !== 'none' && children[i] !== Sortable.ghost && (includeDragEl || children[i] !== Sortable.dragged) && closest(children[i], options.draggable, el, false)) {
386
+ if (currentChild === childNum) {
387
+ return children[i];
388
+ }
389
+ currentChild++;
390
+ }
391
+ i++;
392
+ }
393
+ return null;
394
+ }
395
+
396
+ /**
397
+ * Gets the last child in the el, ignoring ghostEl or invisible elements (clones)
398
+ * @param {HTMLElement} el Parent element
399
+ * @param {selector} selector Any other elements that should be ignored
400
+ * @return {HTMLElement} The last child, ignoring ghostEl
401
+ */
402
+ function lastChild(el, selector) {
403
+ var last = el.lastElementChild;
404
+ while (last && (last === Sortable.ghost || css(last, 'display') === 'none' || selector && !matches(last, selector))) {
405
+ last = last.previousElementSibling;
406
+ }
407
+ return last || null;
408
+ }
409
+
410
+ /**
411
+ * Returns the index of an element within its parent for a selected set of
412
+ * elements
413
+ * @param {HTMLElement} el
414
+ * @param {selector} selector
415
+ * @return {number}
416
+ */
417
+ function index(el, selector) {
418
+ var index = 0;
419
+ if (!el || !el.parentNode) {
420
+ return -1;
421
+ }
422
+
423
+ /* jshint boss:true */
424
+ while (el = el.previousElementSibling) {
425
+ if (el.nodeName.toUpperCase() !== 'TEMPLATE' && el !== Sortable.clone && (!selector || matches(el, selector))) {
426
+ index++;
427
+ }
428
+ }
429
+ return index;
430
+ }
431
+
432
+ /**
433
+ * Returns the scroll offset of the given element, added with all the scroll offsets of parent elements.
434
+ * The value is returned in real pixels.
435
+ * @param {HTMLElement} el
436
+ * @return {Array} Offsets in the format of [left, top]
437
+ */
438
+ function getRelativeScrollOffset(el) {
439
+ var offsetLeft = 0,
440
+ offsetTop = 0,
441
+ winScroller = getWindowScrollingElement();
442
+ if (el) {
443
+ do {
444
+ var elMatrix = matrix(el),
445
+ scaleX = elMatrix.a,
446
+ scaleY = elMatrix.d;
447
+ offsetLeft += el.scrollLeft * scaleX;
448
+ offsetTop += el.scrollTop * scaleY;
449
+ } while (el !== winScroller && (el = el.parentNode));
450
+ }
451
+ return [offsetLeft, offsetTop];
452
+ }
453
+
454
+ /**
455
+ * Returns the index of the object within the given array
456
+ * @param {Array} arr Array that may or may not hold the object
457
+ * @param {Object} obj An object that has a key-value pair unique to and identical to a key-value pair in the object you want to find
458
+ * @return {Number} The index of the object in the array, or -1
459
+ */
460
+ function indexOfObject(arr, obj) {
461
+ for (var i in arr) {
462
+ if (!arr.hasOwnProperty(i)) continue;
463
+ for (var key in obj) {
464
+ if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i);
465
+ }
466
+ }
467
+ return -1;
468
+ }
469
+ function getParentAutoScrollElement(el, includeSelf) {
470
+ // skip to window
471
+ if (!el || !el.getBoundingClientRect) return getWindowScrollingElement();
472
+ var elem = el;
473
+ var gotSelf = false;
474
+ do {
475
+ // we don't need to get elem css if it isn't even overflowing in the first place (performance)
476
+ if (elem.clientWidth < elem.scrollWidth || elem.clientHeight < elem.scrollHeight) {
477
+ var elemCSS = css(elem);
478
+ if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == 'auto' || elemCSS.overflowX == 'scroll') || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == 'auto' || elemCSS.overflowY == 'scroll')) {
479
+ if (!elem.getBoundingClientRect || elem === document.body) return getWindowScrollingElement();
480
+ if (gotSelf || includeSelf) return elem;
481
+ gotSelf = true;
482
+ }
483
+ }
484
+ /* jshint boss:true */
485
+ } while (elem = elem.parentNode);
486
+ return getWindowScrollingElement();
487
+ }
488
+ function extend(dst, src) {
489
+ if (dst && src) {
490
+ for (var key in src) {
491
+ if (src.hasOwnProperty(key)) {
492
+ dst[key] = src[key];
493
+ }
494
+ }
495
+ }
496
+ return dst;
497
+ }
498
+ function isRectEqual(rect1, rect2) {
499
+ return Math.round(rect1.top) === Math.round(rect2.top) && Math.round(rect1.left) === Math.round(rect2.left) && Math.round(rect1.height) === Math.round(rect2.height) && Math.round(rect1.width) === Math.round(rect2.width);
500
+ }
501
+ var _throttleTimeout;
502
+ function throttle(callback, ms) {
503
+ return function () {
504
+ if (!_throttleTimeout) {
505
+ var args = arguments,
506
+ _this = this;
507
+ if (args.length === 1) {
508
+ callback.call(_this, args[0]);
509
+ } else {
510
+ callback.apply(_this, args);
511
+ }
512
+ _throttleTimeout = setTimeout(function () {
513
+ _throttleTimeout = void 0;
514
+ }, ms);
515
+ }
516
+ };
517
+ }
518
+ function cancelThrottle() {
519
+ clearTimeout(_throttleTimeout);
520
+ _throttleTimeout = void 0;
521
+ }
522
+ function scrollBy(el, x, y) {
523
+ el.scrollLeft += x;
524
+ el.scrollTop += y;
525
+ }
526
+ function clone(el) {
527
+ var Polymer = window.Polymer;
528
+ var $ = window.jQuery || window.Zepto;
529
+ if (Polymer && Polymer.dom) {
530
+ return Polymer.dom(el).cloneNode(true);
531
+ } else if ($) {
532
+ return $(el).clone(true)[0];
533
+ } else {
534
+ return el.cloneNode(true);
535
+ }
536
+ }
537
+ function setRect(el, rect) {
538
+ css(el, 'position', 'absolute');
539
+ css(el, 'top', rect.top);
540
+ css(el, 'left', rect.left);
541
+ css(el, 'width', rect.width);
542
+ css(el, 'height', rect.height);
543
+ }
544
+ function unsetRect(el) {
545
+ css(el, 'position', '');
546
+ css(el, 'top', '');
547
+ css(el, 'left', '');
548
+ css(el, 'width', '');
549
+ css(el, 'height', '');
550
+ }
551
+ function getChildContainingRectFromElement(container, options, ghostEl) {
552
+ var rect = {};
553
+ Array.from(container.children).forEach(function (child) {
554
+ var _rect$left, _rect$top, _rect$right, _rect$bottom;
555
+ if (!closest(child, options.draggable, container, false) || child.animated || child === ghostEl) return;
556
+ var childRect = getRect(child);
557
+ rect.left = Math.min((_rect$left = rect.left) !== null && _rect$left !== void 0 ? _rect$left : Infinity, childRect.left);
558
+ rect.top = Math.min((_rect$top = rect.top) !== null && _rect$top !== void 0 ? _rect$top : Infinity, childRect.top);
559
+ rect.right = Math.max((_rect$right = rect.right) !== null && _rect$right !== void 0 ? _rect$right : -Infinity, childRect.right);
560
+ rect.bottom = Math.max((_rect$bottom = rect.bottom) !== null && _rect$bottom !== void 0 ? _rect$bottom : -Infinity, childRect.bottom);
561
+ });
562
+ rect.width = rect.right - rect.left;
563
+ rect.height = rect.bottom - rect.top;
564
+ rect.x = rect.left;
565
+ rect.y = rect.top;
566
+ return rect;
567
+ }
568
+ var expando = 'Sortable' + new Date().getTime();
569
+
570
+ function AnimationStateManager() {
571
+ var animationStates = [],
572
+ animationCallbackId;
573
+ return {
574
+ captureAnimationState: function captureAnimationState() {
575
+ animationStates = [];
576
+ if (!this.options.animation) return;
577
+ var children = [].slice.call(this.el.children);
578
+ children.forEach(function (child) {
579
+ if (css(child, 'display') === 'none' || child === Sortable.ghost) return;
580
+ animationStates.push({
581
+ target: child,
582
+ rect: getRect(child)
583
+ });
584
+ var fromRect = _objectSpread2({}, animationStates[animationStates.length - 1].rect);
585
+
586
+ // If animating: compensate for current animation
587
+ if (child.thisAnimationDuration) {
588
+ var childMatrix = matrix(child, true);
589
+ if (childMatrix) {
590
+ fromRect.top -= childMatrix.f;
591
+ fromRect.left -= childMatrix.e;
592
+ }
593
+ }
594
+ child.fromRect = fromRect;
595
+ });
596
+ },
597
+ addAnimationState: function addAnimationState(state) {
598
+ animationStates.push(state);
599
+ },
600
+ removeAnimationState: function removeAnimationState(target) {
601
+ animationStates.splice(indexOfObject(animationStates, {
602
+ target: target
603
+ }), 1);
604
+ },
605
+ animateAll: function animateAll(callback) {
606
+ var _this = this;
607
+ if (!this.options.animation) {
608
+ clearTimeout(animationCallbackId);
609
+ if (typeof callback === 'function') callback();
610
+ return;
611
+ }
612
+ var animating = false,
613
+ animationTime = 0;
614
+ animationStates.forEach(function (state) {
615
+ var time = 0,
616
+ target = state.target,
617
+ fromRect = target.fromRect,
618
+ toRect = getRect(target),
619
+ prevFromRect = target.prevFromRect,
620
+ prevToRect = target.prevToRect,
621
+ animatingRect = state.rect,
622
+ targetMatrix = matrix(target, true);
623
+ if (targetMatrix) {
624
+ // Compensate for current animation
625
+ toRect.top -= targetMatrix.f;
626
+ toRect.left -= targetMatrix.e;
627
+ }
628
+ target.toRect = toRect;
629
+ if (target.thisAnimationDuration) {
630
+ // Could also check if animatingRect is between fromRect and toRect
631
+ if (isRectEqual(prevFromRect, toRect) && !isRectEqual(fromRect, toRect) &&
632
+ // Make sure animatingRect is on line between toRect & fromRect
633
+ (animatingRect.top - toRect.top) / (animatingRect.left - toRect.left) === (fromRect.top - toRect.top) / (fromRect.left - toRect.left)) {
634
+ // If returning to same place as started from animation and on same axis
635
+ time = calculateRealTime(animatingRect, prevFromRect, prevToRect, _this.options);
636
+ }
637
+ }
638
+
639
+ // if fromRect != toRect: animate
640
+ if (!isRectEqual(toRect, fromRect)) {
641
+ target.prevFromRect = fromRect;
642
+ target.prevToRect = toRect;
643
+ if (!time) {
644
+ time = _this.options.animation;
645
+ }
646
+ _this.animate(target, animatingRect, toRect, time);
647
+ }
648
+ if (time) {
649
+ animating = true;
650
+ animationTime = Math.max(animationTime, time);
651
+ clearTimeout(target.animationResetTimer);
652
+ target.animationResetTimer = setTimeout(function () {
653
+ target.animationTime = 0;
654
+ target.prevFromRect = null;
655
+ target.fromRect = null;
656
+ target.prevToRect = null;
657
+ target.thisAnimationDuration = null;
658
+ }, time);
659
+ target.thisAnimationDuration = time;
660
+ }
661
+ });
662
+ clearTimeout(animationCallbackId);
663
+ if (!animating) {
664
+ if (typeof callback === 'function') callback();
665
+ } else {
666
+ animationCallbackId = setTimeout(function () {
667
+ if (typeof callback === 'function') callback();
668
+ }, animationTime);
669
+ }
670
+ animationStates = [];
671
+ },
672
+ animate: function animate(target, currentRect, toRect, duration) {
673
+ if (duration) {
674
+ css(target, 'transition', '');
675
+ css(target, 'transform', '');
676
+ var elMatrix = matrix(this.el),
677
+ scaleX = elMatrix && elMatrix.a,
678
+ scaleY = elMatrix && elMatrix.d,
679
+ translateX = (currentRect.left - toRect.left) / (scaleX || 1),
680
+ translateY = (currentRect.top - toRect.top) / (scaleY || 1);
681
+ target.animatingX = !!translateX;
682
+ target.animatingY = !!translateY;
683
+ css(target, 'transform', 'translate3d(' + translateX + 'px,' + translateY + 'px,0)');
684
+ this.forRepaintDummy = repaint(target); // repaint
685
+
686
+ css(target, 'transition', 'transform ' + duration + 'ms' + (this.options.easing ? ' ' + this.options.easing : ''));
687
+ css(target, 'transform', 'translate3d(0,0,0)');
688
+ typeof target.animated === 'number' && clearTimeout(target.animated);
689
+ target.animated = setTimeout(function () {
690
+ css(target, 'transition', '');
691
+ css(target, 'transform', '');
692
+ target.animated = false;
693
+ target.animatingX = false;
694
+ target.animatingY = false;
695
+ }, duration);
696
+ }
697
+ }
698
+ };
699
+ }
700
+ function repaint(target) {
701
+ return target.offsetWidth;
702
+ }
703
+ function calculateRealTime(animatingRect, fromRect, toRect, options) {
704
+ return Math.sqrt(Math.pow(fromRect.top - animatingRect.top, 2) + Math.pow(fromRect.left - animatingRect.left, 2)) / Math.sqrt(Math.pow(fromRect.top - toRect.top, 2) + Math.pow(fromRect.left - toRect.left, 2)) * options.animation;
705
+ }
706
+
707
+ var plugins = [];
708
+ var defaults = {
709
+ initializeByDefault: true
710
+ };
711
+ var PluginManager = {
712
+ mount: function mount(plugin) {
713
+ // Set default static properties
714
+ for (var option in defaults) {
715
+ if (defaults.hasOwnProperty(option) && !(option in plugin)) {
716
+ plugin[option] = defaults[option];
717
+ }
718
+ }
719
+ plugins.forEach(function (p) {
720
+ if (p.pluginName === plugin.pluginName) {
721
+ throw "Sortable: Cannot mount plugin ".concat(plugin.pluginName, " more than once");
722
+ }
723
+ });
724
+ plugins.push(plugin);
725
+ },
726
+ pluginEvent: function pluginEvent(eventName, sortable, evt) {
727
+ var _this = this;
728
+ this.eventCanceled = false;
729
+ evt.cancel = function () {
730
+ _this.eventCanceled = true;
731
+ };
732
+ var eventNameGlobal = eventName + 'Global';
733
+ plugins.forEach(function (plugin) {
734
+ if (!sortable[plugin.pluginName]) return;
735
+ // Fire global events if it exists in this sortable
736
+ if (sortable[plugin.pluginName][eventNameGlobal]) {
737
+ sortable[plugin.pluginName][eventNameGlobal](_objectSpread2({
738
+ sortable: sortable
739
+ }, evt));
740
+ }
741
+
742
+ // Only fire plugin event if plugin is enabled in this sortable,
743
+ // and plugin has event defined
744
+ if (sortable.options[plugin.pluginName] && sortable[plugin.pluginName][eventName]) {
745
+ sortable[plugin.pluginName][eventName](_objectSpread2({
746
+ sortable: sortable
747
+ }, evt));
748
+ }
749
+ });
750
+ },
751
+ initializePlugins: function initializePlugins(sortable, el, defaults, options) {
752
+ plugins.forEach(function (plugin) {
753
+ var pluginName = plugin.pluginName;
754
+ if (!sortable.options[pluginName] && !plugin.initializeByDefault) return;
755
+ var initialized = new plugin(sortable, el, sortable.options);
756
+ initialized.sortable = sortable;
757
+ initialized.options = sortable.options;
758
+ sortable[pluginName] = initialized;
759
+
760
+ // Add default options from plugin
761
+ _extends(defaults, initialized.defaults);
762
+ });
763
+ for (var option in sortable.options) {
764
+ if (!sortable.options.hasOwnProperty(option)) continue;
765
+ var modified = this.modifyOption(sortable, option, sortable.options[option]);
766
+ if (typeof modified !== 'undefined') {
767
+ sortable.options[option] = modified;
768
+ }
769
+ }
770
+ },
771
+ getEventProperties: function getEventProperties(name, sortable) {
772
+ var eventProperties = {};
773
+ plugins.forEach(function (plugin) {
774
+ if (typeof plugin.eventProperties !== 'function') return;
775
+ _extends(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name));
776
+ });
777
+ return eventProperties;
778
+ },
779
+ modifyOption: function modifyOption(sortable, name, value) {
780
+ var modifiedValue;
781
+ plugins.forEach(function (plugin) {
782
+ // Plugin must exist on the Sortable
783
+ if (!sortable[plugin.pluginName]) return;
784
+
785
+ // If static option listener exists for this option, call in the context of the Sortable's instance of this plugin
786
+ if (plugin.optionListeners && typeof plugin.optionListeners[name] === 'function') {
787
+ modifiedValue = plugin.optionListeners[name].call(sortable[plugin.pluginName], value);
788
+ }
789
+ });
790
+ return modifiedValue;
791
+ }
792
+ };
793
+
794
+ function dispatchEvent(_ref) {
795
+ var sortable = _ref.sortable,
796
+ rootEl = _ref.rootEl,
797
+ name = _ref.name,
798
+ targetEl = _ref.targetEl,
799
+ cloneEl = _ref.cloneEl,
800
+ toEl = _ref.toEl,
801
+ fromEl = _ref.fromEl,
802
+ oldIndex = _ref.oldIndex,
803
+ newIndex = _ref.newIndex,
804
+ oldDraggableIndex = _ref.oldDraggableIndex,
805
+ newDraggableIndex = _ref.newDraggableIndex,
806
+ originalEvent = _ref.originalEvent,
807
+ putSortable = _ref.putSortable,
808
+ extraEventProperties = _ref.extraEventProperties;
809
+ sortable = sortable || rootEl && rootEl[expando];
810
+ if (!sortable) return;
811
+ var evt,
812
+ options = sortable.options,
813
+ onName = 'on' + name.charAt(0).toUpperCase() + name.substr(1);
814
+ // Support for new CustomEvent feature
815
+ if (window.CustomEvent && !IE11OrLess && !Edge) {
816
+ evt = new CustomEvent(name, {
817
+ bubbles: true,
818
+ cancelable: true
819
+ });
820
+ } else {
821
+ evt = document.createEvent('Event');
822
+ evt.initEvent(name, true, true);
823
+ }
824
+ evt.to = toEl || rootEl;
825
+ evt.from = fromEl || rootEl;
826
+ evt.item = targetEl || rootEl;
827
+ evt.clone = cloneEl;
828
+ evt.oldIndex = oldIndex;
829
+ evt.newIndex = newIndex;
830
+ evt.oldDraggableIndex = oldDraggableIndex;
831
+ evt.newDraggableIndex = newDraggableIndex;
832
+ evt.originalEvent = originalEvent;
833
+ evt.pullMode = putSortable ? putSortable.lastPutMode : undefined;
834
+ var allEventProperties = _objectSpread2(_objectSpread2({}, extraEventProperties), PluginManager.getEventProperties(name, sortable));
835
+ for (var option in allEventProperties) {
836
+ evt[option] = allEventProperties[option];
837
+ }
838
+ if (rootEl) {
839
+ rootEl.dispatchEvent(evt);
840
+ }
841
+ if (options[onName]) {
842
+ options[onName].call(sortable, evt);
843
+ }
844
+ }
845
+
846
+ var _excluded = ["evt"];
847
+ var pluginEvent = function pluginEvent(eventName, sortable) {
848
+ var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
849
+ originalEvent = _ref.evt,
850
+ data = _objectWithoutProperties(_ref, _excluded);
851
+ PluginManager.pluginEvent.bind(Sortable)(eventName, sortable, _objectSpread2({
852
+ dragEl: dragEl,
853
+ parentEl: parentEl,
854
+ ghostEl: ghostEl,
855
+ rootEl: rootEl,
856
+ nextEl: nextEl,
857
+ lastDownEl: lastDownEl,
858
+ cloneEl: cloneEl,
859
+ cloneHidden: cloneHidden,
860
+ dragStarted: moved,
861
+ putSortable: putSortable,
862
+ activeSortable: Sortable.active,
863
+ originalEvent: originalEvent,
864
+ oldIndex: oldIndex,
865
+ oldDraggableIndex: oldDraggableIndex,
866
+ newIndex: newIndex,
867
+ newDraggableIndex: newDraggableIndex,
868
+ hideGhostForTarget: _hideGhostForTarget,
869
+ unhideGhostForTarget: _unhideGhostForTarget,
870
+ cloneNowHidden: function cloneNowHidden() {
871
+ cloneHidden = true;
872
+ },
873
+ cloneNowShown: function cloneNowShown() {
874
+ cloneHidden = false;
875
+ },
876
+ dispatchSortableEvent: function dispatchSortableEvent(name) {
877
+ _dispatchEvent({
878
+ sortable: sortable,
879
+ name: name,
880
+ originalEvent: originalEvent
881
+ });
882
+ }
883
+ }, data));
884
+ };
885
+ function _dispatchEvent(info) {
886
+ dispatchEvent(_objectSpread2({
887
+ putSortable: putSortable,
888
+ cloneEl: cloneEl,
889
+ targetEl: dragEl,
890
+ rootEl: rootEl,
891
+ oldIndex: oldIndex,
892
+ oldDraggableIndex: oldDraggableIndex,
893
+ newIndex: newIndex,
894
+ newDraggableIndex: newDraggableIndex
895
+ }, info));
896
+ }
897
+ var dragEl,
898
+ parentEl,
899
+ ghostEl,
900
+ rootEl,
901
+ nextEl,
902
+ lastDownEl,
903
+ cloneEl,
904
+ cloneHidden,
905
+ oldIndex,
906
+ newIndex,
907
+ oldDraggableIndex,
908
+ newDraggableIndex,
909
+ activeGroup,
910
+ putSortable,
911
+ awaitingDragStarted = false,
912
+ ignoreNextClick = false,
913
+ sortables = [],
914
+ tapEvt,
915
+ touchEvt,
916
+ lastDx,
917
+ lastDy,
918
+ tapDistanceLeft,
919
+ tapDistanceTop,
920
+ moved,
921
+ lastTarget,
922
+ lastDirection,
923
+ pastFirstInvertThresh = false,
924
+ isCircumstantialInvert = false,
925
+ targetMoveDistance,
926
+ // For positioning ghost absolutely
927
+ ghostRelativeParent,
928
+ ghostRelativeParentInitialScroll = [],
929
+ // (left, top)
930
+
931
+ _silent = false,
932
+ savedInputChecked = [];
933
+
934
+ /** @const */
935
+ var documentExists = typeof document !== 'undefined',
936
+ PositionGhostAbsolutely = IOS,
937
+ CSSFloatProperty = Edge || IE11OrLess ? 'cssFloat' : 'float',
938
+ // This will not pass for IE9, because IE9 DnD only works on anchors
939
+ supportDraggable = documentExists && !ChromeForAndroid && !IOS && 'draggable' in document.createElement('div'),
940
+ supportCssPointerEvents = function () {
941
+ if (!documentExists) return;
942
+ // false when <= IE11
943
+ if (IE11OrLess) {
944
+ return false;
945
+ }
946
+ var el = document.createElement('x');
947
+ el.style.cssText = 'pointer-events:auto';
948
+ return el.style.pointerEvents === 'auto';
949
+ }(),
950
+ _detectDirection = function _detectDirection(el, options) {
951
+ var elCSS = css(el),
952
+ elWidth = parseInt(elCSS.width) - parseInt(elCSS.paddingLeft) - parseInt(elCSS.paddingRight) - parseInt(elCSS.borderLeftWidth) - parseInt(elCSS.borderRightWidth),
953
+ child1 = getChild(el, 0, options),
954
+ child2 = getChild(el, 1, options),
955
+ firstChildCSS = child1 && css(child1),
956
+ secondChildCSS = child2 && css(child2),
957
+ firstChildWidth = firstChildCSS && parseInt(firstChildCSS.marginLeft) + parseInt(firstChildCSS.marginRight) + getRect(child1).width,
958
+ secondChildWidth = secondChildCSS && parseInt(secondChildCSS.marginLeft) + parseInt(secondChildCSS.marginRight) + getRect(child2).width;
959
+ if (elCSS.display === 'flex') {
960
+ return elCSS.flexDirection === 'column' || elCSS.flexDirection === 'column-reverse' ? 'vertical' : 'horizontal';
961
+ }
962
+ if (elCSS.display === 'grid') {
963
+ return elCSS.gridTemplateColumns.split(' ').length <= 1 ? 'vertical' : 'horizontal';
964
+ }
965
+ if (child1 && firstChildCSS["float"] && firstChildCSS["float"] !== 'none') {
966
+ var touchingSideChild2 = firstChildCSS["float"] === 'left' ? 'left' : 'right';
967
+ return child2 && (secondChildCSS.clear === 'both' || secondChildCSS.clear === touchingSideChild2) ? 'vertical' : 'horizontal';
968
+ }
969
+ return child1 && (firstChildCSS.display === 'block' || firstChildCSS.display === 'flex' || firstChildCSS.display === 'table' || firstChildCSS.display === 'grid' || firstChildWidth >= elWidth && elCSS[CSSFloatProperty] === 'none' || child2 && elCSS[CSSFloatProperty] === 'none' && firstChildWidth + secondChildWidth > elWidth) ? 'vertical' : 'horizontal';
970
+ },
971
+ _dragElInRowColumn = function _dragElInRowColumn(dragRect, targetRect, vertical) {
972
+ var dragElS1Opp = vertical ? dragRect.left : dragRect.top,
973
+ dragElS2Opp = vertical ? dragRect.right : dragRect.bottom,
974
+ dragElOppLength = vertical ? dragRect.width : dragRect.height,
975
+ targetS1Opp = vertical ? targetRect.left : targetRect.top,
976
+ targetS2Opp = vertical ? targetRect.right : targetRect.bottom,
977
+ targetOppLength = vertical ? targetRect.width : targetRect.height;
978
+ return dragElS1Opp === targetS1Opp || dragElS2Opp === targetS2Opp || dragElS1Opp + dragElOppLength / 2 === targetS1Opp + targetOppLength / 2;
979
+ },
980
+ /**
981
+ * Detects first nearest empty sortable to X and Y position using emptyInsertThreshold.
982
+ * @param {Number} x X position
983
+ * @param {Number} y Y position
984
+ * @return {HTMLElement} Element of the first found nearest Sortable
985
+ */
986
+ _detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) {
987
+ var ret;
988
+ sortables.some(function (sortable) {
989
+ var threshold = sortable[expando].options.emptyInsertThreshold;
990
+ if (!threshold || lastChild(sortable)) return;
991
+ var rect = getRect(sortable),
992
+ insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold,
993
+ insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold;
994
+ if (insideHorizontally && insideVertically) {
995
+ return ret = sortable;
996
+ }
997
+ });
998
+ return ret;
999
+ },
1000
+ _prepareGroup = function _prepareGroup(options) {
1001
+ function toFn(value, pull) {
1002
+ return function (to, from, dragEl, evt) {
1003
+ var sameGroup = to.options.group.name && from.options.group.name && to.options.group.name === from.options.group.name;
1004
+ if (value == null && (pull || sameGroup)) {
1005
+ // Default pull value
1006
+ // Default pull and put value if same group
1007
+ return true;
1008
+ } else if (value == null || value === false) {
1009
+ return false;
1010
+ } else if (pull && value === 'clone') {
1011
+ return value;
1012
+ } else if (typeof value === 'function') {
1013
+ return toFn(value(to, from, dragEl, evt), pull)(to, from, dragEl, evt);
1014
+ } else {
1015
+ var otherGroup = (pull ? to : from).options.group.name;
1016
+ return value === true || typeof value === 'string' && value === otherGroup || value.join && value.indexOf(otherGroup) > -1;
1017
+ }
1018
+ };
1019
+ }
1020
+ var group = {};
1021
+ var originalGroup = options.group;
1022
+ if (!originalGroup || _typeof(originalGroup) != 'object') {
1023
+ originalGroup = {
1024
+ name: originalGroup
1025
+ };
1026
+ }
1027
+ group.name = originalGroup.name;
1028
+ group.checkPull = toFn(originalGroup.pull, true);
1029
+ group.checkPut = toFn(originalGroup.put);
1030
+ group.revertClone = originalGroup.revertClone;
1031
+ options.group = group;
1032
+ },
1033
+ _hideGhostForTarget = function _hideGhostForTarget() {
1034
+ if (!supportCssPointerEvents && ghostEl) {
1035
+ css(ghostEl, 'display', 'none');
1036
+ }
1037
+ },
1038
+ _unhideGhostForTarget = function _unhideGhostForTarget() {
1039
+ if (!supportCssPointerEvents && ghostEl) {
1040
+ css(ghostEl, 'display', '');
1041
+ }
1042
+ };
1043
+
1044
+ // #1184 fix - Prevent click event on fallback if dragged but item not changed position
1045
+ if (documentExists && !ChromeForAndroid) {
1046
+ document.addEventListener('click', function (evt) {
1047
+ if (ignoreNextClick) {
1048
+ evt.preventDefault();
1049
+ evt.stopPropagation && evt.stopPropagation();
1050
+ evt.stopImmediatePropagation && evt.stopImmediatePropagation();
1051
+ ignoreNextClick = false;
1052
+ return false;
1053
+ }
1054
+ }, true);
1055
+ }
1056
+ var nearestEmptyInsertDetectEvent = function nearestEmptyInsertDetectEvent(evt) {
1057
+ if (dragEl) {
1058
+ evt = evt.touches ? evt.touches[0] : evt;
1059
+ var nearest = _detectNearestEmptySortable(evt.clientX, evt.clientY);
1060
+ if (nearest) {
1061
+ // Create imitation event
1062
+ var event = {};
1063
+ for (var i in evt) {
1064
+ if (evt.hasOwnProperty(i)) {
1065
+ event[i] = evt[i];
1066
+ }
1067
+ }
1068
+ event.target = event.rootEl = nearest;
1069
+ event.preventDefault = void 0;
1070
+ event.stopPropagation = void 0;
1071
+ nearest[expando]._onDragOver(event);
1072
+ }
1073
+ }
1074
+ };
1075
+ var _checkOutsideTargetEl = function _checkOutsideTargetEl(evt) {
1076
+ if (dragEl) {
1077
+ dragEl.parentNode[expando]._isOutsideThisEl(evt.target);
1078
+ }
1079
+ };
1080
+
1081
+ /**
1082
+ * @class Sortable
1083
+ * @param {HTMLElement} el
1084
+ * @param {Object} [options]
1085
+ */
1086
+ function Sortable(el, options) {
1087
+ if (!(el && el.nodeType && el.nodeType === 1)) {
1088
+ throw "Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(el));
1089
+ }
1090
+ this.el = el; // root element
1091
+ this.options = options = _extends({}, options);
1092
+
1093
+ // Export instance
1094
+ el[expando] = this;
1095
+ var defaults = {
1096
+ group: null,
1097
+ sort: true,
1098
+ disabled: false,
1099
+ store: null,
1100
+ handle: null,
1101
+ draggable: /^[uo]l$/i.test(el.nodeName) ? '>li' : '>*',
1102
+ swapThreshold: 1,
1103
+ // percentage; 0 <= x <= 1
1104
+ invertSwap: false,
1105
+ // invert always
1106
+ invertedSwapThreshold: null,
1107
+ // will be set to same as swapThreshold if default
1108
+ removeCloneOnHide: true,
1109
+ direction: function direction() {
1110
+ return _detectDirection(el, this.options);
1111
+ },
1112
+ ghostClass: 'sortable-ghost',
1113
+ chosenClass: 'sortable-chosen',
1114
+ dragClass: 'sortable-drag',
1115
+ ignore: 'a, img',
1116
+ filter: null,
1117
+ preventOnFilter: true,
1118
+ animation: 0,
1119
+ easing: null,
1120
+ setData: function setData(dataTransfer, dragEl) {
1121
+ dataTransfer.setData('Text', dragEl.textContent);
1122
+ },
1123
+ dropBubble: false,
1124
+ dragoverBubble: false,
1125
+ dataIdAttr: 'data-id',
1126
+ delay: 0,
1127
+ delayOnTouchOnly: false,
1128
+ touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,
1129
+ forceFallback: false,
1130
+ fallbackClass: 'sortable-fallback',
1131
+ fallbackOnBody: false,
1132
+ fallbackTolerance: 0,
1133
+ fallbackOffset: {
1134
+ x: 0,
1135
+ y: 0
1136
+ },
1137
+ supportPointer: Sortable.supportPointer !== false && 'PointerEvent' in window && !Safari,
1138
+ emptyInsertThreshold: 5
1139
+ };
1140
+ PluginManager.initializePlugins(this, el, defaults);
1141
+
1142
+ // Set default options
1143
+ for (var name in defaults) {
1144
+ !(name in options) && (options[name] = defaults[name]);
1145
+ }
1146
+ _prepareGroup(options);
1147
+
1148
+ // Bind all private methods
1149
+ for (var fn in this) {
1150
+ if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {
1151
+ this[fn] = this[fn].bind(this);
1152
+ }
1153
+ }
1154
+
1155
+ // Setup drag mode
1156
+ this.nativeDraggable = options.forceFallback ? false : supportDraggable;
1157
+ if (this.nativeDraggable) {
1158
+ // Touch start threshold cannot be greater than the native dragstart threshold
1159
+ this.options.touchStartThreshold = 1;
1160
+ }
1161
+
1162
+ // Bind events
1163
+ if (options.supportPointer) {
1164
+ on(el, 'pointerdown', this._onTapStart);
1165
+ } else {
1166
+ on(el, 'mousedown', this._onTapStart);
1167
+ on(el, 'touchstart', this._onTapStart);
1168
+ }
1169
+ if (this.nativeDraggable) {
1170
+ on(el, 'dragover', this);
1171
+ on(el, 'dragenter', this);
1172
+ }
1173
+ sortables.push(this.el);
1174
+
1175
+ // Restore sorting
1176
+ options.store && options.store.get && this.sort(options.store.get(this) || []);
1177
+
1178
+ // Add animation state manager
1179
+ _extends(this, AnimationStateManager());
1180
+ }
1181
+ Sortable.prototype = /** @lends Sortable.prototype */{
1182
+ constructor: Sortable,
1183
+ _isOutsideThisEl: function _isOutsideThisEl(target) {
1184
+ if (!this.el.contains(target) && target !== this.el) {
1185
+ lastTarget = null;
1186
+ }
1187
+ },
1188
+ _getDirection: function _getDirection(evt, target) {
1189
+ return typeof this.options.direction === 'function' ? this.options.direction.call(this, evt, target, dragEl) : this.options.direction;
1190
+ },
1191
+ _onTapStart: function _onTapStart( /** Event|TouchEvent */evt) {
1192
+ if (!evt.cancelable) return;
1193
+ var _this = this,
1194
+ el = this.el,
1195
+ options = this.options,
1196
+ preventOnFilter = options.preventOnFilter,
1197
+ type = evt.type,
1198
+ touch = evt.touches && evt.touches[0] || evt.pointerType && evt.pointerType === 'touch' && evt,
1199
+ target = (touch || evt).target,
1200
+ originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0] || evt.composedPath && evt.composedPath()[0]) || target,
1201
+ filter = options.filter;
1202
+ _saveInputCheckedState(el);
1203
+
1204
+ // Don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group.
1205
+ if (dragEl) {
1206
+ return;
1207
+ }
1208
+ if (/mousedown|pointerdown/.test(type) && evt.button !== 0 || options.disabled) {
1209
+ return; // only left button and enabled
1210
+ }
1211
+
1212
+ // cancel dnd if original target is content editable
1213
+ if (originalTarget.isContentEditable) {
1214
+ return;
1215
+ }
1216
+
1217
+ // Safari ignores further event handling after mousedown
1218
+ if (!this.nativeDraggable && Safari && target && target.tagName.toUpperCase() === 'SELECT') {
1219
+ return;
1220
+ }
1221
+ target = closest(target, options.draggable, el, false);
1222
+ if (target && target.animated) {
1223
+ return;
1224
+ }
1225
+ if (lastDownEl === target) {
1226
+ // Ignoring duplicate `down`
1227
+ return;
1228
+ }
1229
+
1230
+ // Get the index of the dragged element within its parent
1231
+ oldIndex = index(target);
1232
+ oldDraggableIndex = index(target, options.draggable);
1233
+
1234
+ // Check filter
1235
+ if (typeof filter === 'function') {
1236
+ if (filter.call(this, evt, target, this)) {
1237
+ _dispatchEvent({
1238
+ sortable: _this,
1239
+ rootEl: originalTarget,
1240
+ name: 'filter',
1241
+ targetEl: target,
1242
+ toEl: el,
1243
+ fromEl: el
1244
+ });
1245
+ pluginEvent('filter', _this, {
1246
+ evt: evt
1247
+ });
1248
+ preventOnFilter && evt.cancelable && evt.preventDefault();
1249
+ return; // cancel dnd
1250
+ }
1251
+ } else if (filter) {
1252
+ filter = filter.split(',').some(function (criteria) {
1253
+ criteria = closest(originalTarget, criteria.trim(), el, false);
1254
+ if (criteria) {
1255
+ _dispatchEvent({
1256
+ sortable: _this,
1257
+ rootEl: criteria,
1258
+ name: 'filter',
1259
+ targetEl: target,
1260
+ fromEl: el,
1261
+ toEl: el
1262
+ });
1263
+ pluginEvent('filter', _this, {
1264
+ evt: evt
1265
+ });
1266
+ return true;
1267
+ }
1268
+ });
1269
+ if (filter) {
1270
+ preventOnFilter && evt.cancelable && evt.preventDefault();
1271
+ return; // cancel dnd
1272
+ }
1273
+ }
1274
+ if (options.handle && !closest(originalTarget, options.handle, el, false)) {
1275
+ return;
1276
+ }
1277
+
1278
+ // Prepare `dragstart`
1279
+ this._prepareDragStart(evt, touch, target);
1280
+ },
1281
+ _prepareDragStart: function _prepareDragStart( /** Event */evt, /** Touch */touch, /** HTMLElement */target) {
1282
+ var _this = this,
1283
+ el = _this.el,
1284
+ options = _this.options,
1285
+ ownerDocument = el.ownerDocument,
1286
+ dragStartFn;
1287
+ if (target && !dragEl && target.parentNode === el) {
1288
+ var dragRect = getRect(target);
1289
+ rootEl = el;
1290
+ dragEl = target;
1291
+ parentEl = dragEl.parentNode;
1292
+ nextEl = dragEl.nextSibling;
1293
+ lastDownEl = target;
1294
+ activeGroup = options.group;
1295
+ Sortable.dragged = dragEl;
1296
+ tapEvt = {
1297
+ target: dragEl,
1298
+ clientX: (touch || evt).clientX,
1299
+ clientY: (touch || evt).clientY
1300
+ };
1301
+ tapDistanceLeft = tapEvt.clientX - dragRect.left;
1302
+ tapDistanceTop = tapEvt.clientY - dragRect.top;
1303
+ this._lastX = (touch || evt).clientX;
1304
+ this._lastY = (touch || evt).clientY;
1305
+ dragEl.style['will-change'] = 'all';
1306
+ dragStartFn = function dragStartFn() {
1307
+ pluginEvent('delayEnded', _this, {
1308
+ evt: evt
1309
+ });
1310
+ if (Sortable.eventCanceled) {
1311
+ _this._onDrop();
1312
+ return;
1313
+ }
1314
+ // Delayed drag has been triggered
1315
+ // we can re-enable the events: touchmove/mousemove
1316
+ _this._disableDelayedDragEvents();
1317
+ if (!FireFox && _this.nativeDraggable) {
1318
+ dragEl.draggable = true;
1319
+ }
1320
+
1321
+ // Bind the events: dragstart/dragend
1322
+ _this._triggerDragStart(evt, touch);
1323
+
1324
+ // Drag start event
1325
+ _dispatchEvent({
1326
+ sortable: _this,
1327
+ name: 'choose',
1328
+ originalEvent: evt
1329
+ });
1330
+
1331
+ // Chosen item
1332
+ toggleClass(dragEl, options.chosenClass, true);
1333
+ };
1334
+
1335
+ // Disable "draggable"
1336
+ options.ignore.split(',').forEach(function (criteria) {
1337
+ find(dragEl, criteria.trim(), _disableDraggable);
1338
+ });
1339
+ on(ownerDocument, 'dragover', nearestEmptyInsertDetectEvent);
1340
+ on(ownerDocument, 'mousemove', nearestEmptyInsertDetectEvent);
1341
+ on(ownerDocument, 'touchmove', nearestEmptyInsertDetectEvent);
1342
+ on(ownerDocument, 'mouseup', _this._onDrop);
1343
+ on(ownerDocument, 'touchend', _this._onDrop);
1344
+ on(ownerDocument, 'touchcancel', _this._onDrop);
1345
+
1346
+ // Make dragEl draggable (must be before delay for FireFox)
1347
+ if (FireFox && this.nativeDraggable) {
1348
+ this.options.touchStartThreshold = 4;
1349
+ dragEl.draggable = true;
1350
+ }
1351
+ pluginEvent('delayStart', this, {
1352
+ evt: evt
1353
+ });
1354
+
1355
+ // Delay is impossible for native DnD in Edge or IE
1356
+ if (options.delay && (!options.delayOnTouchOnly || touch) && (!this.nativeDraggable || !(Edge || IE11OrLess))) {
1357
+ if (Sortable.eventCanceled) {
1358
+ this._onDrop();
1359
+ return;
1360
+ }
1361
+ // If the user moves the pointer or let go the click or touch
1362
+ // before the delay has been reached:
1363
+ // disable the delayed drag
1364
+ on(ownerDocument, 'mouseup', _this._disableDelayedDrag);
1365
+ on(ownerDocument, 'touchend', _this._disableDelayedDrag);
1366
+ on(ownerDocument, 'touchcancel', _this._disableDelayedDrag);
1367
+ on(ownerDocument, 'mousemove', _this._delayedDragTouchMoveHandler);
1368
+ on(ownerDocument, 'touchmove', _this._delayedDragTouchMoveHandler);
1369
+ options.supportPointer && on(ownerDocument, 'pointermove', _this._delayedDragTouchMoveHandler);
1370
+ _this._dragStartTimer = setTimeout(dragStartFn, options.delay);
1371
+ } else {
1372
+ dragStartFn();
1373
+ }
1374
+ }
1375
+ },
1376
+ _delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler( /** TouchEvent|PointerEvent **/e) {
1377
+ var touch = e.touches ? e.touches[0] : e;
1378
+ if (Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1))) {
1379
+ this._disableDelayedDrag();
1380
+ }
1381
+ },
1382
+ _disableDelayedDrag: function _disableDelayedDrag() {
1383
+ dragEl && _disableDraggable(dragEl);
1384
+ clearTimeout(this._dragStartTimer);
1385
+ this._disableDelayedDragEvents();
1386
+ },
1387
+ _disableDelayedDragEvents: function _disableDelayedDragEvents() {
1388
+ var ownerDocument = this.el.ownerDocument;
1389
+ off(ownerDocument, 'mouseup', this._disableDelayedDrag);
1390
+ off(ownerDocument, 'touchend', this._disableDelayedDrag);
1391
+ off(ownerDocument, 'touchcancel', this._disableDelayedDrag);
1392
+ off(ownerDocument, 'mousemove', this._delayedDragTouchMoveHandler);
1393
+ off(ownerDocument, 'touchmove', this._delayedDragTouchMoveHandler);
1394
+ off(ownerDocument, 'pointermove', this._delayedDragTouchMoveHandler);
1395
+ },
1396
+ _triggerDragStart: function _triggerDragStart( /** Event */evt, /** Touch */touch) {
1397
+ touch = touch || evt.pointerType == 'touch' && evt;
1398
+ if (!this.nativeDraggable || touch) {
1399
+ if (this.options.supportPointer) {
1400
+ on(document, 'pointermove', this._onTouchMove);
1401
+ } else if (touch) {
1402
+ on(document, 'touchmove', this._onTouchMove);
1403
+ } else {
1404
+ on(document, 'mousemove', this._onTouchMove);
1405
+ }
1406
+ } else {
1407
+ on(dragEl, 'dragend', this);
1408
+ on(rootEl, 'dragstart', this._onDragStart);
1409
+ }
1410
+ try {
1411
+ if (document.selection) {
1412
+ // Timeout neccessary for IE9
1413
+ _nextTick(function () {
1414
+ document.selection.empty();
1415
+ });
1416
+ } else {
1417
+ window.getSelection().removeAllRanges();
1418
+ }
1419
+ } catch (err) {}
1420
+ },
1421
+ _dragStarted: function _dragStarted(fallback, evt) {
1422
+ awaitingDragStarted = false;
1423
+ if (rootEl && dragEl) {
1424
+ pluginEvent('dragStarted', this, {
1425
+ evt: evt
1426
+ });
1427
+ if (this.nativeDraggable) {
1428
+ on(document, 'dragover', _checkOutsideTargetEl);
1429
+ }
1430
+ var options = this.options;
1431
+
1432
+ // Apply effect
1433
+ !fallback && toggleClass(dragEl, options.dragClass, false);
1434
+ toggleClass(dragEl, options.ghostClass, true);
1435
+ Sortable.active = this;
1436
+ fallback && this._appendGhost();
1437
+
1438
+ // Drag start event
1439
+ _dispatchEvent({
1440
+ sortable: this,
1441
+ name: 'start',
1442
+ originalEvent: evt
1443
+ });
1444
+ } else {
1445
+ this._nulling();
1446
+ }
1447
+ },
1448
+ _emulateDragOver: function _emulateDragOver() {
1449
+ if (touchEvt) {
1450
+ this._lastX = touchEvt.clientX;
1451
+ this._lastY = touchEvt.clientY;
1452
+ _hideGhostForTarget();
1453
+ var target = document.elementFromPoint(touchEvt.clientX, touchEvt.clientY);
1454
+ var parent = target;
1455
+ while (target && target.shadowRoot) {
1456
+ target = target.shadowRoot.elementFromPoint(touchEvt.clientX, touchEvt.clientY);
1457
+ if (target === parent) break;
1458
+ parent = target;
1459
+ }
1460
+ dragEl.parentNode[expando]._isOutsideThisEl(target);
1461
+ if (parent) {
1462
+ do {
1463
+ if (parent[expando]) {
1464
+ var inserted = void 0;
1465
+ inserted = parent[expando]._onDragOver({
1466
+ clientX: touchEvt.clientX,
1467
+ clientY: touchEvt.clientY,
1468
+ target: target,
1469
+ rootEl: parent
1470
+ });
1471
+ if (inserted && !this.options.dragoverBubble) {
1472
+ break;
1473
+ }
1474
+ }
1475
+ target = parent; // store last element
1476
+ }
1477
+ /* jshint boss:true */ while (parent = parent.parentNode);
1478
+ }
1479
+ _unhideGhostForTarget();
1480
+ }
1481
+ },
1482
+ _onTouchMove: function _onTouchMove( /**TouchEvent*/evt) {
1483
+ if (tapEvt) {
1484
+ var options = this.options,
1485
+ fallbackTolerance = options.fallbackTolerance,
1486
+ fallbackOffset = options.fallbackOffset,
1487
+ touch = evt.touches ? evt.touches[0] : evt,
1488
+ ghostMatrix = ghostEl && matrix(ghostEl, true),
1489
+ scaleX = ghostEl && ghostMatrix && ghostMatrix.a,
1490
+ scaleY = ghostEl && ghostMatrix && ghostMatrix.d,
1491
+ relativeScrollOffset = PositionGhostAbsolutely && ghostRelativeParent && getRelativeScrollOffset(ghostRelativeParent),
1492
+ dx = (touch.clientX - tapEvt.clientX + fallbackOffset.x) / (scaleX || 1) + (relativeScrollOffset ? relativeScrollOffset[0] - ghostRelativeParentInitialScroll[0] : 0) / (scaleX || 1),
1493
+ dy = (touch.clientY - tapEvt.clientY + fallbackOffset.y) / (scaleY || 1) + (relativeScrollOffset ? relativeScrollOffset[1] - ghostRelativeParentInitialScroll[1] : 0) / (scaleY || 1);
1494
+
1495
+ // only set the status to dragging, when we are actually dragging
1496
+ if (!Sortable.active && !awaitingDragStarted) {
1497
+ if (fallbackTolerance && Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) < fallbackTolerance) {
1498
+ return;
1499
+ }
1500
+ this._onDragStart(evt, true);
1501
+ }
1502
+ if (ghostEl) {
1503
+ if (ghostMatrix) {
1504
+ ghostMatrix.e += dx - (lastDx || 0);
1505
+ ghostMatrix.f += dy - (lastDy || 0);
1506
+ } else {
1507
+ ghostMatrix = {
1508
+ a: 1,
1509
+ b: 0,
1510
+ c: 0,
1511
+ d: 1,
1512
+ e: dx,
1513
+ f: dy
1514
+ };
1515
+ }
1516
+ var cssMatrix = "matrix(".concat(ghostMatrix.a, ",").concat(ghostMatrix.b, ",").concat(ghostMatrix.c, ",").concat(ghostMatrix.d, ",").concat(ghostMatrix.e, ",").concat(ghostMatrix.f, ")");
1517
+ css(ghostEl, 'webkitTransform', cssMatrix);
1518
+ css(ghostEl, 'mozTransform', cssMatrix);
1519
+ css(ghostEl, 'msTransform', cssMatrix);
1520
+ css(ghostEl, 'transform', cssMatrix);
1521
+ lastDx = dx;
1522
+ lastDy = dy;
1523
+ touchEvt = touch;
1524
+ }
1525
+ evt.cancelable && evt.preventDefault();
1526
+ }
1527
+ },
1528
+ _appendGhost: function _appendGhost() {
1529
+ // Bug if using scale(): https://stackoverflow.com/questions/2637058
1530
+ // Not being adjusted for
1531
+ if (!ghostEl) {
1532
+ var container = this.options.fallbackOnBody ? document.body : rootEl,
1533
+ rect = getRect(dragEl, true, PositionGhostAbsolutely, true, container),
1534
+ options = this.options;
1535
+
1536
+ // Position absolutely
1537
+ if (PositionGhostAbsolutely) {
1538
+ // Get relatively positioned parent
1539
+ ghostRelativeParent = container;
1540
+ while (css(ghostRelativeParent, 'position') === 'static' && css(ghostRelativeParent, 'transform') === 'none' && ghostRelativeParent !== document) {
1541
+ ghostRelativeParent = ghostRelativeParent.parentNode;
1542
+ }
1543
+ if (ghostRelativeParent !== document.body && ghostRelativeParent !== document.documentElement) {
1544
+ if (ghostRelativeParent === document) ghostRelativeParent = getWindowScrollingElement();
1545
+ rect.top += ghostRelativeParent.scrollTop;
1546
+ rect.left += ghostRelativeParent.scrollLeft;
1547
+ } else {
1548
+ ghostRelativeParent = getWindowScrollingElement();
1549
+ }
1550
+ ghostRelativeParentInitialScroll = getRelativeScrollOffset(ghostRelativeParent);
1551
+ }
1552
+ ghostEl = dragEl.cloneNode(true);
1553
+ toggleClass(ghostEl, options.ghostClass, false);
1554
+ toggleClass(ghostEl, options.fallbackClass, true);
1555
+ toggleClass(ghostEl, options.dragClass, true);
1556
+ css(ghostEl, 'transition', '');
1557
+ css(ghostEl, 'transform', '');
1558
+ css(ghostEl, 'box-sizing', 'border-box');
1559
+ css(ghostEl, 'margin', 0);
1560
+ css(ghostEl, 'top', rect.top);
1561
+ css(ghostEl, 'left', rect.left);
1562
+ css(ghostEl, 'width', rect.width);
1563
+ css(ghostEl, 'height', rect.height);
1564
+ css(ghostEl, 'opacity', '0.8');
1565
+ css(ghostEl, 'position', PositionGhostAbsolutely ? 'absolute' : 'fixed');
1566
+ css(ghostEl, 'zIndex', '100000');
1567
+ css(ghostEl, 'pointerEvents', 'none');
1568
+ Sortable.ghost = ghostEl;
1569
+ container.appendChild(ghostEl);
1570
+
1571
+ // Set transform-origin
1572
+ css(ghostEl, 'transform-origin', tapDistanceLeft / parseInt(ghostEl.style.width) * 100 + '% ' + tapDistanceTop / parseInt(ghostEl.style.height) * 100 + '%');
1573
+ }
1574
+ },
1575
+ _onDragStart: function _onDragStart( /**Event*/evt, /**boolean*/fallback) {
1576
+ var _this = this;
1577
+ var dataTransfer = evt.dataTransfer;
1578
+ var options = _this.options;
1579
+ pluginEvent('dragStart', this, {
1580
+ evt: evt
1581
+ });
1582
+ if (Sortable.eventCanceled) {
1583
+ this._onDrop();
1584
+ return;
1585
+ }
1586
+ pluginEvent('setupClone', this);
1587
+ if (!Sortable.eventCanceled) {
1588
+ cloneEl = clone(dragEl);
1589
+ cloneEl.removeAttribute("id");
1590
+ cloneEl.draggable = false;
1591
+ cloneEl.style['will-change'] = '';
1592
+ this._hideClone();
1593
+ toggleClass(cloneEl, this.options.chosenClass, false);
1594
+ Sortable.clone = cloneEl;
1595
+ }
1596
+
1597
+ // #1143: IFrame support workaround
1598
+ _this.cloneId = _nextTick(function () {
1599
+ pluginEvent('clone', _this);
1600
+ if (Sortable.eventCanceled) return;
1601
+ if (!_this.options.removeCloneOnHide) {
1602
+ rootEl.insertBefore(cloneEl, dragEl);
1603
+ }
1604
+ _this._hideClone();
1605
+ _dispatchEvent({
1606
+ sortable: _this,
1607
+ name: 'clone'
1608
+ });
1609
+ });
1610
+ !fallback && toggleClass(dragEl, options.dragClass, true);
1611
+
1612
+ // Set proper drop events
1613
+ if (fallback) {
1614
+ ignoreNextClick = true;
1615
+ _this._loopId = setInterval(_this._emulateDragOver, 50);
1616
+ } else {
1617
+ // Undo what was set in _prepareDragStart before drag started
1618
+ off(document, 'mouseup', _this._onDrop);
1619
+ off(document, 'touchend', _this._onDrop);
1620
+ off(document, 'touchcancel', _this._onDrop);
1621
+ if (dataTransfer) {
1622
+ dataTransfer.effectAllowed = 'move';
1623
+ options.setData && options.setData.call(_this, dataTransfer, dragEl);
1624
+ }
1625
+ on(document, 'drop', _this);
1626
+
1627
+ // #1276 fix:
1628
+ css(dragEl, 'transform', 'translateZ(0)');
1629
+ }
1630
+ awaitingDragStarted = true;
1631
+ _this._dragStartId = _nextTick(_this._dragStarted.bind(_this, fallback, evt));
1632
+ on(document, 'selectstart', _this);
1633
+ moved = true;
1634
+ if (Safari) {
1635
+ css(document.body, 'user-select', 'none');
1636
+ }
1637
+ },
1638
+ // Returns true - if no further action is needed (either inserted or another condition)
1639
+ _onDragOver: function _onDragOver( /**Event*/evt) {
1640
+ var el = this.el,
1641
+ target = evt.target,
1642
+ dragRect,
1643
+ targetRect,
1644
+ revert,
1645
+ options = this.options,
1646
+ group = options.group,
1647
+ activeSortable = Sortable.active,
1648
+ isOwner = activeGroup === group,
1649
+ canSort = options.sort,
1650
+ fromSortable = putSortable || activeSortable,
1651
+ vertical,
1652
+ _this = this,
1653
+ completedFired = false;
1654
+ if (_silent) return;
1655
+ function dragOverEvent(name, extra) {
1656
+ pluginEvent(name, _this, _objectSpread2({
1657
+ evt: evt,
1658
+ isOwner: isOwner,
1659
+ axis: vertical ? 'vertical' : 'horizontal',
1660
+ revert: revert,
1661
+ dragRect: dragRect,
1662
+ targetRect: targetRect,
1663
+ canSort: canSort,
1664
+ fromSortable: fromSortable,
1665
+ target: target,
1666
+ completed: completed,
1667
+ onMove: function onMove(target, after) {
1668
+ return _onMove(rootEl, el, dragEl, dragRect, target, getRect(target), evt, after);
1669
+ },
1670
+ changed: changed
1671
+ }, extra));
1672
+ }
1673
+
1674
+ // Capture animation state
1675
+ function capture() {
1676
+ dragOverEvent('dragOverAnimationCapture');
1677
+ _this.captureAnimationState();
1678
+ if (_this !== fromSortable) {
1679
+ fromSortable.captureAnimationState();
1680
+ }
1681
+ }
1682
+
1683
+ // Return invocation when dragEl is inserted (or completed)
1684
+ function completed(insertion) {
1685
+ dragOverEvent('dragOverCompleted', {
1686
+ insertion: insertion
1687
+ });
1688
+ if (insertion) {
1689
+ // Clones must be hidden before folding animation to capture dragRectAbsolute properly
1690
+ if (isOwner) {
1691
+ activeSortable._hideClone();
1692
+ } else {
1693
+ activeSortable._showClone(_this);
1694
+ }
1695
+ if (_this !== fromSortable) {
1696
+ // Set ghost class to new sortable's ghost class
1697
+ toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : activeSortable.options.ghostClass, false);
1698
+ toggleClass(dragEl, options.ghostClass, true);
1699
+ }
1700
+ if (putSortable !== _this && _this !== Sortable.active) {
1701
+ putSortable = _this;
1702
+ } else if (_this === Sortable.active && putSortable) {
1703
+ putSortable = null;
1704
+ }
1705
+
1706
+ // Animation
1707
+ if (fromSortable === _this) {
1708
+ _this._ignoreWhileAnimating = target;
1709
+ }
1710
+ _this.animateAll(function () {
1711
+ dragOverEvent('dragOverAnimationComplete');
1712
+ _this._ignoreWhileAnimating = null;
1713
+ });
1714
+ if (_this !== fromSortable) {
1715
+ fromSortable.animateAll();
1716
+ fromSortable._ignoreWhileAnimating = null;
1717
+ }
1718
+ }
1719
+
1720
+ // Null lastTarget if it is not inside a previously swapped element
1721
+ if (target === dragEl && !dragEl.animated || target === el && !target.animated) {
1722
+ lastTarget = null;
1723
+ }
1724
+
1725
+ // no bubbling and not fallback
1726
+ if (!options.dragoverBubble && !evt.rootEl && target !== document) {
1727
+ dragEl.parentNode[expando]._isOutsideThisEl(evt.target);
1728
+
1729
+ // Do not detect for empty insert if already inserted
1730
+ !insertion && nearestEmptyInsertDetectEvent(evt);
1731
+ }
1732
+ !options.dragoverBubble && evt.stopPropagation && evt.stopPropagation();
1733
+ return completedFired = true;
1734
+ }
1735
+
1736
+ // Call when dragEl has been inserted
1737
+ function changed() {
1738
+ newIndex = index(dragEl);
1739
+ newDraggableIndex = index(dragEl, options.draggable);
1740
+ _dispatchEvent({
1741
+ sortable: _this,
1742
+ name: 'change',
1743
+ toEl: el,
1744
+ newIndex: newIndex,
1745
+ newDraggableIndex: newDraggableIndex,
1746
+ originalEvent: evt
1747
+ });
1748
+ }
1749
+ if (evt.preventDefault !== void 0) {
1750
+ evt.cancelable && evt.preventDefault();
1751
+ }
1752
+ target = closest(target, options.draggable, el, true);
1753
+ dragOverEvent('dragOver');
1754
+ if (Sortable.eventCanceled) return completedFired;
1755
+ if (dragEl.contains(evt.target) || target.animated && target.animatingX && target.animatingY || _this._ignoreWhileAnimating === target) {
1756
+ return completed(false);
1757
+ }
1758
+ ignoreNextClick = false;
1759
+ if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = parentEl !== rootEl) // Reverting item into the original list
1760
+ : putSortable === this || (this.lastPutMode = activeGroup.checkPull(this, activeSortable, dragEl, evt)) && group.checkPut(this, activeSortable, dragEl, evt))) {
1761
+ vertical = this._getDirection(evt, target) === 'vertical';
1762
+ dragRect = getRect(dragEl);
1763
+ dragOverEvent('dragOverValid');
1764
+ if (Sortable.eventCanceled) return completedFired;
1765
+ if (revert) {
1766
+ parentEl = rootEl; // actualization
1767
+ capture();
1768
+ this._hideClone();
1769
+ dragOverEvent('revert');
1770
+ if (!Sortable.eventCanceled) {
1771
+ if (nextEl) {
1772
+ rootEl.insertBefore(dragEl, nextEl);
1773
+ } else {
1774
+ rootEl.appendChild(dragEl);
1775
+ }
1776
+ }
1777
+ return completed(true);
1778
+ }
1779
+ var elLastChild = lastChild(el, options.draggable);
1780
+ if (!elLastChild || _ghostIsLast(evt, vertical, this) && !elLastChild.animated) {
1781
+ // Insert to end of list
1782
+
1783
+ // If already at end of list: Do not insert
1784
+ if (elLastChild === dragEl) {
1785
+ return completed(false);
1786
+ }
1787
+
1788
+ // if there is a last element, it is the target
1789
+ if (elLastChild && el === evt.target) {
1790
+ target = elLastChild;
1791
+ }
1792
+ if (target) {
1793
+ targetRect = getRect(target);
1794
+ }
1795
+ if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, !!target) !== false) {
1796
+ capture();
1797
+ if (elLastChild && elLastChild.nextSibling) {
1798
+ // the last draggable element is not the last node
1799
+ el.insertBefore(dragEl, elLastChild.nextSibling);
1800
+ } else {
1801
+ el.appendChild(dragEl);
1802
+ }
1803
+ parentEl = el; // actualization
1804
+
1805
+ changed();
1806
+ return completed(true);
1807
+ }
1808
+ } else if (elLastChild && _ghostIsFirst(evt, vertical, this)) {
1809
+ // Insert to start of list
1810
+ var firstChild = getChild(el, 0, options, true);
1811
+ if (firstChild === dragEl) {
1812
+ return completed(false);
1813
+ }
1814
+ target = firstChild;
1815
+ targetRect = getRect(target);
1816
+ if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, false) !== false) {
1817
+ capture();
1818
+ el.insertBefore(dragEl, firstChild);
1819
+ parentEl = el; // actualization
1820
+
1821
+ changed();
1822
+ return completed(true);
1823
+ }
1824
+ } else if (target.parentNode === el) {
1825
+ targetRect = getRect(target);
1826
+ var direction = 0,
1827
+ targetBeforeFirstSwap,
1828
+ differentLevel = dragEl.parentNode !== el,
1829
+ differentRowCol = !_dragElInRowColumn(dragEl.animated && dragEl.toRect || dragRect, target.animated && target.toRect || targetRect, vertical),
1830
+ side1 = vertical ? 'top' : 'left',
1831
+ scrolledPastTop = isScrolledPast(target, 'top', 'top') || isScrolledPast(dragEl, 'top', 'top'),
1832
+ scrollBefore = scrolledPastTop ? scrolledPastTop.scrollTop : void 0;
1833
+ if (lastTarget !== target) {
1834
+ targetBeforeFirstSwap = targetRect[side1];
1835
+ pastFirstInvertThresh = false;
1836
+ isCircumstantialInvert = !differentRowCol && options.invertSwap || differentLevel;
1837
+ }
1838
+ direction = _getSwapDirection(evt, target, targetRect, vertical, differentRowCol ? 1 : options.swapThreshold, options.invertedSwapThreshold == null ? options.swapThreshold : options.invertedSwapThreshold, isCircumstantialInvert, lastTarget === target);
1839
+ var sibling;
1840
+ if (direction !== 0) {
1841
+ // Check if target is beside dragEl in respective direction (ignoring hidden elements)
1842
+ var dragIndex = index(dragEl);
1843
+ do {
1844
+ dragIndex -= direction;
1845
+ sibling = parentEl.children[dragIndex];
1846
+ } while (sibling && (css(sibling, 'display') === 'none' || sibling === ghostEl));
1847
+ }
1848
+ // If dragEl is already beside target: Do not insert
1849
+ if (direction === 0 || sibling === target) {
1850
+ return completed(false);
1851
+ }
1852
+ lastTarget = target;
1853
+ lastDirection = direction;
1854
+ var nextSibling = target.nextElementSibling,
1855
+ after = false;
1856
+ after = direction === 1;
1857
+ var moveVector = _onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, after);
1858
+ if (moveVector !== false) {
1859
+ if (moveVector === 1 || moveVector === -1) {
1860
+ after = moveVector === 1;
1861
+ }
1862
+ _silent = true;
1863
+ setTimeout(_unsilent, 30);
1864
+ capture();
1865
+ if (after && !nextSibling) {
1866
+ el.appendChild(dragEl);
1867
+ } else {
1868
+ target.parentNode.insertBefore(dragEl, after ? nextSibling : target);
1869
+ }
1870
+
1871
+ // Undo chrome's scroll adjustment (has no effect on other browsers)
1872
+ if (scrolledPastTop) {
1873
+ scrollBy(scrolledPastTop, 0, scrollBefore - scrolledPastTop.scrollTop);
1874
+ }
1875
+ parentEl = dragEl.parentNode; // actualization
1876
+
1877
+ // must be done before animation
1878
+ if (targetBeforeFirstSwap !== undefined && !isCircumstantialInvert) {
1879
+ targetMoveDistance = Math.abs(targetBeforeFirstSwap - getRect(target)[side1]);
1880
+ }
1881
+ changed();
1882
+ return completed(true);
1883
+ }
1884
+ }
1885
+ if (el.contains(dragEl)) {
1886
+ return completed(false);
1887
+ }
1888
+ }
1889
+ return false;
1890
+ },
1891
+ _ignoreWhileAnimating: null,
1892
+ _offMoveEvents: function _offMoveEvents() {
1893
+ off(document, 'mousemove', this._onTouchMove);
1894
+ off(document, 'touchmove', this._onTouchMove);
1895
+ off(document, 'pointermove', this._onTouchMove);
1896
+ off(document, 'dragover', nearestEmptyInsertDetectEvent);
1897
+ off(document, 'mousemove', nearestEmptyInsertDetectEvent);
1898
+ off(document, 'touchmove', nearestEmptyInsertDetectEvent);
1899
+ },
1900
+ _offUpEvents: function _offUpEvents() {
1901
+ var ownerDocument = this.el.ownerDocument;
1902
+ off(ownerDocument, 'mouseup', this._onDrop);
1903
+ off(ownerDocument, 'touchend', this._onDrop);
1904
+ off(ownerDocument, 'pointerup', this._onDrop);
1905
+ off(ownerDocument, 'touchcancel', this._onDrop);
1906
+ off(document, 'selectstart', this);
1907
+ },
1908
+ _onDrop: function _onDrop( /**Event*/evt) {
1909
+ var el = this.el,
1910
+ options = this.options;
1911
+
1912
+ // Get the index of the dragged element within its parent
1913
+ newIndex = index(dragEl);
1914
+ newDraggableIndex = index(dragEl, options.draggable);
1915
+ pluginEvent('drop', this, {
1916
+ evt: evt
1917
+ });
1918
+ parentEl = dragEl && dragEl.parentNode;
1919
+
1920
+ // Get again after plugin event
1921
+ newIndex = index(dragEl);
1922
+ newDraggableIndex = index(dragEl, options.draggable);
1923
+ if (Sortable.eventCanceled) {
1924
+ this._nulling();
1925
+ return;
1926
+ }
1927
+ awaitingDragStarted = false;
1928
+ isCircumstantialInvert = false;
1929
+ pastFirstInvertThresh = false;
1930
+ clearInterval(this._loopId);
1931
+ clearTimeout(this._dragStartTimer);
1932
+ _cancelNextTick(this.cloneId);
1933
+ _cancelNextTick(this._dragStartId);
1934
+
1935
+ // Unbind events
1936
+ if (this.nativeDraggable) {
1937
+ off(document, 'drop', this);
1938
+ off(el, 'dragstart', this._onDragStart);
1939
+ }
1940
+ this._offMoveEvents();
1941
+ this._offUpEvents();
1942
+ if (Safari) {
1943
+ css(document.body, 'user-select', '');
1944
+ }
1945
+ css(dragEl, 'transform', '');
1946
+ if (evt) {
1947
+ if (moved) {
1948
+ evt.cancelable && evt.preventDefault();
1949
+ !options.dropBubble && evt.stopPropagation();
1950
+ }
1951
+ ghostEl && ghostEl.parentNode && ghostEl.parentNode.removeChild(ghostEl);
1952
+ if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {
1953
+ // Remove clone(s)
1954
+ cloneEl && cloneEl.parentNode && cloneEl.parentNode.removeChild(cloneEl);
1955
+ }
1956
+ if (dragEl) {
1957
+ if (this.nativeDraggable) {
1958
+ off(dragEl, 'dragend', this);
1959
+ }
1960
+ _disableDraggable(dragEl);
1961
+ dragEl.style['will-change'] = '';
1962
+
1963
+ // Remove classes
1964
+ // ghostClass is added in dragStarted
1965
+ if (moved && !awaitingDragStarted) {
1966
+ toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : this.options.ghostClass, false);
1967
+ }
1968
+ toggleClass(dragEl, this.options.chosenClass, false);
1969
+
1970
+ // Drag stop event
1971
+ _dispatchEvent({
1972
+ sortable: this,
1973
+ name: 'unchoose',
1974
+ toEl: parentEl,
1975
+ newIndex: null,
1976
+ newDraggableIndex: null,
1977
+ originalEvent: evt
1978
+ });
1979
+ if (rootEl !== parentEl) {
1980
+ if (newIndex >= 0) {
1981
+ // Add event
1982
+ _dispatchEvent({
1983
+ rootEl: parentEl,
1984
+ name: 'add',
1985
+ toEl: parentEl,
1986
+ fromEl: rootEl,
1987
+ originalEvent: evt
1988
+ });
1989
+
1990
+ // Remove event
1991
+ _dispatchEvent({
1992
+ sortable: this,
1993
+ name: 'remove',
1994
+ toEl: parentEl,
1995
+ originalEvent: evt
1996
+ });
1997
+
1998
+ // drag from one list and drop into another
1999
+ _dispatchEvent({
2000
+ rootEl: parentEl,
2001
+ name: 'sort',
2002
+ toEl: parentEl,
2003
+ fromEl: rootEl,
2004
+ originalEvent: evt
2005
+ });
2006
+ _dispatchEvent({
2007
+ sortable: this,
2008
+ name: 'sort',
2009
+ toEl: parentEl,
2010
+ originalEvent: evt
2011
+ });
2012
+ }
2013
+ putSortable && putSortable.save();
2014
+ } else {
2015
+ if (newIndex !== oldIndex) {
2016
+ if (newIndex >= 0) {
2017
+ // drag & drop within the same list
2018
+ _dispatchEvent({
2019
+ sortable: this,
2020
+ name: 'update',
2021
+ toEl: parentEl,
2022
+ originalEvent: evt
2023
+ });
2024
+ _dispatchEvent({
2025
+ sortable: this,
2026
+ name: 'sort',
2027
+ toEl: parentEl,
2028
+ originalEvent: evt
2029
+ });
2030
+ }
2031
+ }
2032
+ }
2033
+ if (Sortable.active) {
2034
+ /* jshint eqnull:true */
2035
+ if (newIndex == null || newIndex === -1) {
2036
+ newIndex = oldIndex;
2037
+ newDraggableIndex = oldDraggableIndex;
2038
+ }
2039
+ _dispatchEvent({
2040
+ sortable: this,
2041
+ name: 'end',
2042
+ toEl: parentEl,
2043
+ originalEvent: evt
2044
+ });
2045
+
2046
+ // Save sorting
2047
+ this.save();
2048
+ }
2049
+ }
2050
+ }
2051
+ this._nulling();
2052
+ },
2053
+ _nulling: function _nulling() {
2054
+ pluginEvent('nulling', this);
2055
+ rootEl = dragEl = parentEl = ghostEl = nextEl = cloneEl = lastDownEl = cloneHidden = tapEvt = touchEvt = moved = newIndex = newDraggableIndex = oldIndex = oldDraggableIndex = lastTarget = lastDirection = putSortable = activeGroup = Sortable.dragged = Sortable.ghost = Sortable.clone = Sortable.active = null;
2056
+ savedInputChecked.forEach(function (el) {
2057
+ el.checked = true;
2058
+ });
2059
+ savedInputChecked.length = lastDx = lastDy = 0;
2060
+ },
2061
+ handleEvent: function handleEvent( /**Event*/evt) {
2062
+ switch (evt.type) {
2063
+ case 'drop':
2064
+ case 'dragend':
2065
+ this._onDrop(evt);
2066
+ break;
2067
+ case 'dragenter':
2068
+ case 'dragover':
2069
+ if (dragEl) {
2070
+ this._onDragOver(evt);
2071
+ _globalDragOver(evt);
2072
+ }
2073
+ break;
2074
+ case 'selectstart':
2075
+ evt.preventDefault();
2076
+ break;
2077
+ }
2078
+ },
2079
+ /**
2080
+ * Serializes the item into an array of string.
2081
+ * @returns {String[]}
2082
+ */
2083
+ toArray: function toArray() {
2084
+ var order = [],
2085
+ el,
2086
+ children = this.el.children,
2087
+ i = 0,
2088
+ n = children.length,
2089
+ options = this.options;
2090
+ for (; i < n; i++) {
2091
+ el = children[i];
2092
+ if (closest(el, options.draggable, this.el, false)) {
2093
+ order.push(el.getAttribute(options.dataIdAttr) || _generateId(el));
2094
+ }
2095
+ }
2096
+ return order;
2097
+ },
2098
+ /**
2099
+ * Sorts the elements according to the array.
2100
+ * @param {String[]} order order of the items
2101
+ */
2102
+ sort: function sort(order, useAnimation) {
2103
+ var items = {},
2104
+ rootEl = this.el;
2105
+ this.toArray().forEach(function (id, i) {
2106
+ var el = rootEl.children[i];
2107
+ if (closest(el, this.options.draggable, rootEl, false)) {
2108
+ items[id] = el;
2109
+ }
2110
+ }, this);
2111
+ useAnimation && this.captureAnimationState();
2112
+ order.forEach(function (id) {
2113
+ if (items[id]) {
2114
+ rootEl.removeChild(items[id]);
2115
+ rootEl.appendChild(items[id]);
2116
+ }
2117
+ });
2118
+ useAnimation && this.animateAll();
2119
+ },
2120
+ /**
2121
+ * Save the current sorting
2122
+ */
2123
+ save: function save() {
2124
+ var store = this.options.store;
2125
+ store && store.set && store.set(this);
2126
+ },
2127
+ /**
2128
+ * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.
2129
+ * @param {HTMLElement} el
2130
+ * @param {String} [selector] default: `options.draggable`
2131
+ * @returns {HTMLElement|null}
2132
+ */
2133
+ closest: function closest$1(el, selector) {
2134
+ return closest(el, selector || this.options.draggable, this.el, false);
2135
+ },
2136
+ /**
2137
+ * Set/get option
2138
+ * @param {string} name
2139
+ * @param {*} [value]
2140
+ * @returns {*}
2141
+ */
2142
+ option: function option(name, value) {
2143
+ var options = this.options;
2144
+ if (value === void 0) {
2145
+ return options[name];
2146
+ } else {
2147
+ var modifiedValue = PluginManager.modifyOption(this, name, value);
2148
+ if (typeof modifiedValue !== 'undefined') {
2149
+ options[name] = modifiedValue;
2150
+ } else {
2151
+ options[name] = value;
2152
+ }
2153
+ if (name === 'group') {
2154
+ _prepareGroup(options);
2155
+ }
2156
+ }
2157
+ },
2158
+ /**
2159
+ * Destroy
2160
+ */
2161
+ destroy: function destroy() {
2162
+ pluginEvent('destroy', this);
2163
+ var el = this.el;
2164
+ el[expando] = null;
2165
+ off(el, 'mousedown', this._onTapStart);
2166
+ off(el, 'touchstart', this._onTapStart);
2167
+ off(el, 'pointerdown', this._onTapStart);
2168
+ if (this.nativeDraggable) {
2169
+ off(el, 'dragover', this);
2170
+ off(el, 'dragenter', this);
2171
+ }
2172
+ // Remove draggable attributes
2173
+ Array.prototype.forEach.call(el.querySelectorAll('[draggable]'), function (el) {
2174
+ el.removeAttribute('draggable');
2175
+ });
2176
+ this._onDrop();
2177
+ this._disableDelayedDragEvents();
2178
+ sortables.splice(sortables.indexOf(this.el), 1);
2179
+ this.el = el = null;
2180
+ },
2181
+ _hideClone: function _hideClone() {
2182
+ if (!cloneHidden) {
2183
+ pluginEvent('hideClone', this);
2184
+ if (Sortable.eventCanceled) return;
2185
+ css(cloneEl, 'display', 'none');
2186
+ if (this.options.removeCloneOnHide && cloneEl.parentNode) {
2187
+ cloneEl.parentNode.removeChild(cloneEl);
2188
+ }
2189
+ cloneHidden = true;
2190
+ }
2191
+ },
2192
+ _showClone: function _showClone(putSortable) {
2193
+ if (putSortable.lastPutMode !== 'clone') {
2194
+ this._hideClone();
2195
+ return;
2196
+ }
2197
+ if (cloneHidden) {
2198
+ pluginEvent('showClone', this);
2199
+ if (Sortable.eventCanceled) return;
2200
+
2201
+ // show clone at dragEl or original position
2202
+ if (dragEl.parentNode == rootEl && !this.options.group.revertClone) {
2203
+ rootEl.insertBefore(cloneEl, dragEl);
2204
+ } else if (nextEl) {
2205
+ rootEl.insertBefore(cloneEl, nextEl);
2206
+ } else {
2207
+ rootEl.appendChild(cloneEl);
2208
+ }
2209
+ if (this.options.group.revertClone) {
2210
+ this.animate(dragEl, cloneEl);
2211
+ }
2212
+ css(cloneEl, 'display', '');
2213
+ cloneHidden = false;
2214
+ }
2215
+ }
2216
+ };
2217
+ function _globalDragOver( /**Event*/evt) {
2218
+ if (evt.dataTransfer) {
2219
+ evt.dataTransfer.dropEffect = 'move';
2220
+ }
2221
+ evt.cancelable && evt.preventDefault();
2222
+ }
2223
+ function _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalEvent, willInsertAfter) {
2224
+ var evt,
2225
+ sortable = fromEl[expando],
2226
+ onMoveFn = sortable.options.onMove,
2227
+ retVal;
2228
+ // Support for new CustomEvent feature
2229
+ if (window.CustomEvent && !IE11OrLess && !Edge) {
2230
+ evt = new CustomEvent('move', {
2231
+ bubbles: true,
2232
+ cancelable: true
2233
+ });
2234
+ } else {
2235
+ evt = document.createEvent('Event');
2236
+ evt.initEvent('move', true, true);
2237
+ }
2238
+ evt.to = toEl;
2239
+ evt.from = fromEl;
2240
+ evt.dragged = dragEl;
2241
+ evt.draggedRect = dragRect;
2242
+ evt.related = targetEl || toEl;
2243
+ evt.relatedRect = targetRect || getRect(toEl);
2244
+ evt.willInsertAfter = willInsertAfter;
2245
+ evt.originalEvent = originalEvent;
2246
+ fromEl.dispatchEvent(evt);
2247
+ if (onMoveFn) {
2248
+ retVal = onMoveFn.call(sortable, evt, originalEvent);
2249
+ }
2250
+ return retVal;
2251
+ }
2252
+ function _disableDraggable(el) {
2253
+ el.draggable = false;
2254
+ }
2255
+ function _unsilent() {
2256
+ _silent = false;
2257
+ }
2258
+ function _ghostIsFirst(evt, vertical, sortable) {
2259
+ var firstElRect = getRect(getChild(sortable.el, 0, sortable.options, true));
2260
+ var childContainingRect = getChildContainingRectFromElement(sortable.el, sortable.options, ghostEl);
2261
+ var spacer = 10;
2262
+ return vertical ? evt.clientX < childContainingRect.left - spacer || evt.clientY < firstElRect.top && evt.clientX < firstElRect.right : evt.clientY < childContainingRect.top - spacer || evt.clientY < firstElRect.bottom && evt.clientX < firstElRect.left;
2263
+ }
2264
+ function _ghostIsLast(evt, vertical, sortable) {
2265
+ var lastElRect = getRect(lastChild(sortable.el, sortable.options.draggable));
2266
+ var childContainingRect = getChildContainingRectFromElement(sortable.el, sortable.options, ghostEl);
2267
+ var spacer = 10;
2268
+ return vertical ? evt.clientX > childContainingRect.right + spacer || evt.clientY > lastElRect.bottom && evt.clientX > lastElRect.left : evt.clientY > childContainingRect.bottom + spacer || evt.clientX > lastElRect.right && evt.clientY > lastElRect.top;
2269
+ }
2270
+ function _getSwapDirection(evt, target, targetRect, vertical, swapThreshold, invertedSwapThreshold, invertSwap, isLastTarget) {
2271
+ var mouseOnAxis = vertical ? evt.clientY : evt.clientX,
2272
+ targetLength = vertical ? targetRect.height : targetRect.width,
2273
+ targetS1 = vertical ? targetRect.top : targetRect.left,
2274
+ targetS2 = vertical ? targetRect.bottom : targetRect.right,
2275
+ invert = false;
2276
+ if (!invertSwap) {
2277
+ // Never invert or create dragEl shadow when target movemenet causes mouse to move past the end of regular swapThreshold
2278
+ if (isLastTarget && targetMoveDistance < targetLength * swapThreshold) {
2279
+ // multiplied only by swapThreshold because mouse will already be inside target by (1 - threshold) * targetLength / 2
2280
+ // check if past first invert threshold on side opposite of lastDirection
2281
+ if (!pastFirstInvertThresh && (lastDirection === 1 ? mouseOnAxis > targetS1 + targetLength * invertedSwapThreshold / 2 : mouseOnAxis < targetS2 - targetLength * invertedSwapThreshold / 2)) {
2282
+ // past first invert threshold, do not restrict inverted threshold to dragEl shadow
2283
+ pastFirstInvertThresh = true;
2284
+ }
2285
+ if (!pastFirstInvertThresh) {
2286
+ // dragEl shadow (target move distance shadow)
2287
+ if (lastDirection === 1 ? mouseOnAxis < targetS1 + targetMoveDistance // over dragEl shadow
2288
+ : mouseOnAxis > targetS2 - targetMoveDistance) {
2289
+ return -lastDirection;
2290
+ }
2291
+ } else {
2292
+ invert = true;
2293
+ }
2294
+ } else {
2295
+ // Regular
2296
+ if (mouseOnAxis > targetS1 + targetLength * (1 - swapThreshold) / 2 && mouseOnAxis < targetS2 - targetLength * (1 - swapThreshold) / 2) {
2297
+ return _getInsertDirection(target);
2298
+ }
2299
+ }
2300
+ }
2301
+ invert = invert || invertSwap;
2302
+ if (invert) {
2303
+ // Invert of regular
2304
+ if (mouseOnAxis < targetS1 + targetLength * invertedSwapThreshold / 2 || mouseOnAxis > targetS2 - targetLength * invertedSwapThreshold / 2) {
2305
+ return mouseOnAxis > targetS1 + targetLength / 2 ? 1 : -1;
2306
+ }
2307
+ }
2308
+ return 0;
2309
+ }
2310
+
2311
+ /**
2312
+ * Gets the direction dragEl must be swapped relative to target in order to make it
2313
+ * seem that dragEl has been "inserted" into that element's position
2314
+ * @param {HTMLElement} target The target whose position dragEl is being inserted at
2315
+ * @return {Number} Direction dragEl must be swapped
2316
+ */
2317
+ function _getInsertDirection(target) {
2318
+ if (index(dragEl) < index(target)) {
2319
+ return 1;
2320
+ } else {
2321
+ return -1;
2322
+ }
2323
+ }
2324
+
2325
+ /**
2326
+ * Generate id
2327
+ * @param {HTMLElement} el
2328
+ * @returns {String}
2329
+ * @private
2330
+ */
2331
+ function _generateId(el) {
2332
+ var str = el.tagName + el.className + el.src + el.href + el.textContent,
2333
+ i = str.length,
2334
+ sum = 0;
2335
+ while (i--) {
2336
+ sum += str.charCodeAt(i);
2337
+ }
2338
+ return sum.toString(36);
2339
+ }
2340
+ function _saveInputCheckedState(root) {
2341
+ savedInputChecked.length = 0;
2342
+ var inputs = root.getElementsByTagName('input');
2343
+ var idx = inputs.length;
2344
+ while (idx--) {
2345
+ var el = inputs[idx];
2346
+ el.checked && savedInputChecked.push(el);
2347
+ }
2348
+ }
2349
+ function _nextTick(fn) {
2350
+ return setTimeout(fn, 0);
2351
+ }
2352
+ function _cancelNextTick(id) {
2353
+ return clearTimeout(id);
2354
+ }
2355
+
2356
+ // Fixed #973:
2357
+ if (documentExists) {
2358
+ on(document, 'touchmove', function (evt) {
2359
+ if ((Sortable.active || awaitingDragStarted) && evt.cancelable) {
2360
+ evt.preventDefault();
2361
+ }
2362
+ });
2363
+ }
2364
+
2365
+ // Export utils
2366
+ Sortable.utils = {
2367
+ on: on,
2368
+ off: off,
2369
+ css: css,
2370
+ find: find,
2371
+ is: function is(el, selector) {
2372
+ return !!closest(el, selector, el, false);
2373
+ },
2374
+ extend: extend,
2375
+ throttle: throttle,
2376
+ closest: closest,
2377
+ toggleClass: toggleClass,
2378
+ clone: clone,
2379
+ index: index,
2380
+ nextTick: _nextTick,
2381
+ cancelNextTick: _cancelNextTick,
2382
+ detectDirection: _detectDirection,
2383
+ getChild: getChild
2384
+ };
2385
+
2386
+ /**
2387
+ * Get the Sortable instance of an element
2388
+ * @param {HTMLElement} element The element
2389
+ * @return {Sortable|undefined} The instance of Sortable
2390
+ */
2391
+ Sortable.get = function (element) {
2392
+ return element[expando];
2393
+ };
2394
+
2395
+ /**
2396
+ * Mount a plugin to Sortable
2397
+ * @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted
2398
+ */
2399
+ Sortable.mount = function () {
2400
+ for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) {
2401
+ plugins[_key] = arguments[_key];
2402
+ }
2403
+ if (plugins[0].constructor === Array) plugins = plugins[0];
2404
+ plugins.forEach(function (plugin) {
2405
+ if (!plugin.prototype || !plugin.prototype.constructor) {
2406
+ throw "Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(plugin));
2407
+ }
2408
+ if (plugin.utils) Sortable.utils = _objectSpread2(_objectSpread2({}, Sortable.utils), plugin.utils);
2409
+ PluginManager.mount(plugin);
2410
+ });
2411
+ };
2412
+
2413
+ /**
2414
+ * Create sortable instance
2415
+ * @param {HTMLElement} el
2416
+ * @param {Object} [options]
2417
+ */
2418
+ Sortable.create = function (el, options) {
2419
+ return new Sortable(el, options);
2420
+ };
2421
+
2422
+ // Export
2423
+ Sortable.version = version;
2424
+
2425
+ var autoScrolls = [],
2426
+ scrollEl,
2427
+ scrollRootEl,
2428
+ scrolling = false,
2429
+ lastAutoScrollX,
2430
+ lastAutoScrollY,
2431
+ touchEvt$1,
2432
+ pointerElemChangedInterval;
2433
+ function AutoScrollPlugin() {
2434
+ function AutoScroll() {
2435
+ this.defaults = {
2436
+ scroll: true,
2437
+ forceAutoScrollFallback: false,
2438
+ scrollSensitivity: 30,
2439
+ scrollSpeed: 10,
2440
+ bubbleScroll: true
2441
+ };
2442
+
2443
+ // Bind all private methods
2444
+ for (var fn in this) {
2445
+ if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {
2446
+ this[fn] = this[fn].bind(this);
2447
+ }
2448
+ }
2449
+ }
2450
+ AutoScroll.prototype = {
2451
+ dragStarted: function dragStarted(_ref) {
2452
+ var originalEvent = _ref.originalEvent;
2453
+ if (this.sortable.nativeDraggable) {
2454
+ on(document, 'dragover', this._handleAutoScroll);
2455
+ } else {
2456
+ if (this.options.supportPointer) {
2457
+ on(document, 'pointermove', this._handleFallbackAutoScroll);
2458
+ } else if (originalEvent.touches) {
2459
+ on(document, 'touchmove', this._handleFallbackAutoScroll);
2460
+ } else {
2461
+ on(document, 'mousemove', this._handleFallbackAutoScroll);
2462
+ }
2463
+ }
2464
+ },
2465
+ dragOverCompleted: function dragOverCompleted(_ref2) {
2466
+ var originalEvent = _ref2.originalEvent;
2467
+ // For when bubbling is canceled and using fallback (fallback 'touchmove' always reached)
2468
+ if (!this.options.dragOverBubble && !originalEvent.rootEl) {
2469
+ this._handleAutoScroll(originalEvent);
2470
+ }
2471
+ },
2472
+ drop: function drop() {
2473
+ if (this.sortable.nativeDraggable) {
2474
+ off(document, 'dragover', this._handleAutoScroll);
2475
+ } else {
2476
+ off(document, 'pointermove', this._handleFallbackAutoScroll);
2477
+ off(document, 'touchmove', this._handleFallbackAutoScroll);
2478
+ off(document, 'mousemove', this._handleFallbackAutoScroll);
2479
+ }
2480
+ clearPointerElemChangedInterval();
2481
+ clearAutoScrolls();
2482
+ cancelThrottle();
2483
+ },
2484
+ nulling: function nulling() {
2485
+ touchEvt$1 = scrollRootEl = scrollEl = scrolling = pointerElemChangedInterval = lastAutoScrollX = lastAutoScrollY = null;
2486
+ autoScrolls.length = 0;
2487
+ },
2488
+ _handleFallbackAutoScroll: function _handleFallbackAutoScroll(evt) {
2489
+ this._handleAutoScroll(evt, true);
2490
+ },
2491
+ _handleAutoScroll: function _handleAutoScroll(evt, fallback) {
2492
+ var _this = this;
2493
+ var x = (evt.touches ? evt.touches[0] : evt).clientX,
2494
+ y = (evt.touches ? evt.touches[0] : evt).clientY,
2495
+ elem = document.elementFromPoint(x, y);
2496
+ touchEvt$1 = evt;
2497
+
2498
+ // IE does not seem to have native autoscroll,
2499
+ // Edge's autoscroll seems too conditional,
2500
+ // MACOS Safari does not have autoscroll,
2501
+ // Firefox and Chrome are good
2502
+ if (fallback || this.options.forceAutoScrollFallback || Edge || IE11OrLess || Safari) {
2503
+ autoScroll(evt, this.options, elem, fallback);
2504
+
2505
+ // Listener for pointer element change
2506
+ var ogElemScroller = getParentAutoScrollElement(elem, true);
2507
+ if (scrolling && (!pointerElemChangedInterval || x !== lastAutoScrollX || y !== lastAutoScrollY)) {
2508
+ pointerElemChangedInterval && clearPointerElemChangedInterval();
2509
+ // Detect for pointer elem change, emulating native DnD behaviour
2510
+ pointerElemChangedInterval = setInterval(function () {
2511
+ var newElem = getParentAutoScrollElement(document.elementFromPoint(x, y), true);
2512
+ if (newElem !== ogElemScroller) {
2513
+ ogElemScroller = newElem;
2514
+ clearAutoScrolls();
2515
+ }
2516
+ autoScroll(evt, _this.options, newElem, fallback);
2517
+ }, 10);
2518
+ lastAutoScrollX = x;
2519
+ lastAutoScrollY = y;
2520
+ }
2521
+ } else {
2522
+ // if DnD is enabled (and browser has good autoscrolling), first autoscroll will already scroll, so get parent autoscroll of first autoscroll
2523
+ if (!this.options.bubbleScroll || getParentAutoScrollElement(elem, true) === getWindowScrollingElement()) {
2524
+ clearAutoScrolls();
2525
+ return;
2526
+ }
2527
+ autoScroll(evt, this.options, getParentAutoScrollElement(elem, false), false);
2528
+ }
2529
+ }
2530
+ };
2531
+ return _extends(AutoScroll, {
2532
+ pluginName: 'scroll',
2533
+ initializeByDefault: true
2534
+ });
2535
+ }
2536
+ function clearAutoScrolls() {
2537
+ autoScrolls.forEach(function (autoScroll) {
2538
+ clearInterval(autoScroll.pid);
2539
+ });
2540
+ autoScrolls = [];
2541
+ }
2542
+ function clearPointerElemChangedInterval() {
2543
+ clearInterval(pointerElemChangedInterval);
2544
+ }
2545
+ var autoScroll = throttle(function (evt, options, rootEl, isFallback) {
2546
+ // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=505521
2547
+ if (!options.scroll) return;
2548
+ var x = (evt.touches ? evt.touches[0] : evt).clientX,
2549
+ y = (evt.touches ? evt.touches[0] : evt).clientY,
2550
+ sens = options.scrollSensitivity,
2551
+ speed = options.scrollSpeed,
2552
+ winScroller = getWindowScrollingElement();
2553
+ var scrollThisInstance = false,
2554
+ scrollCustomFn;
2555
+
2556
+ // New scroll root, set scrollEl
2557
+ if (scrollRootEl !== rootEl) {
2558
+ scrollRootEl = rootEl;
2559
+ clearAutoScrolls();
2560
+ scrollEl = options.scroll;
2561
+ scrollCustomFn = options.scrollFn;
2562
+ if (scrollEl === true) {
2563
+ scrollEl = getParentAutoScrollElement(rootEl, true);
2564
+ }
2565
+ }
2566
+ var layersOut = 0;
2567
+ var currentParent = scrollEl;
2568
+ do {
2569
+ var el = currentParent,
2570
+ rect = getRect(el),
2571
+ top = rect.top,
2572
+ bottom = rect.bottom,
2573
+ left = rect.left,
2574
+ right = rect.right,
2575
+ width = rect.width,
2576
+ height = rect.height,
2577
+ canScrollX = void 0,
2578
+ canScrollY = void 0,
2579
+ scrollWidth = el.scrollWidth,
2580
+ scrollHeight = el.scrollHeight,
2581
+ elCSS = css(el),
2582
+ scrollPosX = el.scrollLeft,
2583
+ scrollPosY = el.scrollTop;
2584
+ if (el === winScroller) {
2585
+ canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll' || elCSS.overflowX === 'visible');
2586
+ canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll' || elCSS.overflowY === 'visible');
2587
+ } else {
2588
+ canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll');
2589
+ canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll');
2590
+ }
2591
+ var vx = canScrollX && (Math.abs(right - x) <= sens && scrollPosX + width < scrollWidth) - (Math.abs(left - x) <= sens && !!scrollPosX);
2592
+ var vy = canScrollY && (Math.abs(bottom - y) <= sens && scrollPosY + height < scrollHeight) - (Math.abs(top - y) <= sens && !!scrollPosY);
2593
+ if (!autoScrolls[layersOut]) {
2594
+ for (var i = 0; i <= layersOut; i++) {
2595
+ if (!autoScrolls[i]) {
2596
+ autoScrolls[i] = {};
2597
+ }
2598
+ }
2599
+ }
2600
+ if (autoScrolls[layersOut].vx != vx || autoScrolls[layersOut].vy != vy || autoScrolls[layersOut].el !== el) {
2601
+ autoScrolls[layersOut].el = el;
2602
+ autoScrolls[layersOut].vx = vx;
2603
+ autoScrolls[layersOut].vy = vy;
2604
+ clearInterval(autoScrolls[layersOut].pid);
2605
+ if (vx != 0 || vy != 0) {
2606
+ scrollThisInstance = true;
2607
+ /* jshint loopfunc:true */
2608
+ autoScrolls[layersOut].pid = setInterval(function () {
2609
+ // emulate drag over during autoscroll (fallback), emulating native DnD behaviour
2610
+ if (isFallback && this.layer === 0) {
2611
+ Sortable.active._onTouchMove(touchEvt$1); // To move ghost if it is positioned absolutely
2612
+ }
2613
+ var scrollOffsetY = autoScrolls[this.layer].vy ? autoScrolls[this.layer].vy * speed : 0;
2614
+ var scrollOffsetX = autoScrolls[this.layer].vx ? autoScrolls[this.layer].vx * speed : 0;
2615
+ if (typeof scrollCustomFn === 'function') {
2616
+ if (scrollCustomFn.call(Sortable.dragged.parentNode[expando], scrollOffsetX, scrollOffsetY, evt, touchEvt$1, autoScrolls[this.layer].el) !== 'continue') {
2617
+ return;
2618
+ }
2619
+ }
2620
+ scrollBy(autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY);
2621
+ }.bind({
2622
+ layer: layersOut
2623
+ }), 24);
2624
+ }
2625
+ }
2626
+ layersOut++;
2627
+ } while (options.bubbleScroll && currentParent !== winScroller && (currentParent = getParentAutoScrollElement(currentParent, false)));
2628
+ scrolling = scrollThisInstance; // in case another function catches scrolling as false in between when it is not
2629
+ }, 30);
2630
+
2631
+ var drop = function drop(_ref) {
2632
+ var originalEvent = _ref.originalEvent,
2633
+ putSortable = _ref.putSortable,
2634
+ dragEl = _ref.dragEl,
2635
+ activeSortable = _ref.activeSortable,
2636
+ dispatchSortableEvent = _ref.dispatchSortableEvent,
2637
+ hideGhostForTarget = _ref.hideGhostForTarget,
2638
+ unhideGhostForTarget = _ref.unhideGhostForTarget;
2639
+ if (!originalEvent) return;
2640
+ var toSortable = putSortable || activeSortable;
2641
+ hideGhostForTarget();
2642
+ var touch = originalEvent.changedTouches && originalEvent.changedTouches.length ? originalEvent.changedTouches[0] : originalEvent;
2643
+ var target = document.elementFromPoint(touch.clientX, touch.clientY);
2644
+ unhideGhostForTarget();
2645
+ if (toSortable && !toSortable.el.contains(target)) {
2646
+ dispatchSortableEvent('spill');
2647
+ this.onSpill({
2648
+ dragEl: dragEl,
2649
+ putSortable: putSortable
2650
+ });
2651
+ }
2652
+ };
2653
+ function Revert() {}
2654
+ Revert.prototype = {
2655
+ startIndex: null,
2656
+ dragStart: function dragStart(_ref2) {
2657
+ var oldDraggableIndex = _ref2.oldDraggableIndex;
2658
+ this.startIndex = oldDraggableIndex;
2659
+ },
2660
+ onSpill: function onSpill(_ref3) {
2661
+ var dragEl = _ref3.dragEl,
2662
+ putSortable = _ref3.putSortable;
2663
+ this.sortable.captureAnimationState();
2664
+ if (putSortable) {
2665
+ putSortable.captureAnimationState();
2666
+ }
2667
+ var nextSibling = getChild(this.sortable.el, this.startIndex, this.options);
2668
+ if (nextSibling) {
2669
+ this.sortable.el.insertBefore(dragEl, nextSibling);
2670
+ } else {
2671
+ this.sortable.el.appendChild(dragEl);
2672
+ }
2673
+ this.sortable.animateAll();
2674
+ if (putSortable) {
2675
+ putSortable.animateAll();
2676
+ }
2677
+ },
2678
+ drop: drop
2679
+ };
2680
+ _extends(Revert, {
2681
+ pluginName: 'revertOnSpill'
2682
+ });
2683
+ function Remove() {}
2684
+ Remove.prototype = {
2685
+ onSpill: function onSpill(_ref4) {
2686
+ var dragEl = _ref4.dragEl,
2687
+ putSortable = _ref4.putSortable;
2688
+ var parentSortable = putSortable || this.sortable;
2689
+ parentSortable.captureAnimationState();
2690
+ dragEl.parentNode && dragEl.parentNode.removeChild(dragEl);
2691
+ parentSortable.animateAll();
2692
+ },
2693
+ drop: drop
2694
+ };
2695
+ _extends(Remove, {
2696
+ pluginName: 'removeOnSpill'
2697
+ });
2698
+
2699
+ var lastSwapEl;
2700
+ function SwapPlugin() {
2701
+ function Swap() {
2702
+ this.defaults = {
2703
+ swapClass: 'sortable-swap-highlight'
2704
+ };
2705
+ }
2706
+ Swap.prototype = {
2707
+ dragStart: function dragStart(_ref) {
2708
+ var dragEl = _ref.dragEl;
2709
+ lastSwapEl = dragEl;
2710
+ },
2711
+ dragOverValid: function dragOverValid(_ref2) {
2712
+ var completed = _ref2.completed,
2713
+ target = _ref2.target,
2714
+ onMove = _ref2.onMove,
2715
+ activeSortable = _ref2.activeSortable,
2716
+ changed = _ref2.changed,
2717
+ cancel = _ref2.cancel;
2718
+ if (!activeSortable.options.swap) return;
2719
+ var el = this.sortable.el,
2720
+ options = this.options;
2721
+ if (target && target !== el) {
2722
+ var prevSwapEl = lastSwapEl;
2723
+ if (onMove(target) !== false) {
2724
+ toggleClass(target, options.swapClass, true);
2725
+ lastSwapEl = target;
2726
+ } else {
2727
+ lastSwapEl = null;
2728
+ }
2729
+ if (prevSwapEl && prevSwapEl !== lastSwapEl) {
2730
+ toggleClass(prevSwapEl, options.swapClass, false);
2731
+ }
2732
+ }
2733
+ changed();
2734
+ completed(true);
2735
+ cancel();
2736
+ },
2737
+ drop: function drop(_ref3) {
2738
+ var activeSortable = _ref3.activeSortable,
2739
+ putSortable = _ref3.putSortable,
2740
+ dragEl = _ref3.dragEl;
2741
+ var toSortable = putSortable || this.sortable;
2742
+ var options = this.options;
2743
+ lastSwapEl && toggleClass(lastSwapEl, options.swapClass, false);
2744
+ if (lastSwapEl && (options.swap || putSortable && putSortable.options.swap)) {
2745
+ if (dragEl !== lastSwapEl) {
2746
+ toSortable.captureAnimationState();
2747
+ if (toSortable !== activeSortable) activeSortable.captureAnimationState();
2748
+ swapNodes(dragEl, lastSwapEl);
2749
+ toSortable.animateAll();
2750
+ if (toSortable !== activeSortable) activeSortable.animateAll();
2751
+ }
2752
+ }
2753
+ },
2754
+ nulling: function nulling() {
2755
+ lastSwapEl = null;
2756
+ }
2757
+ };
2758
+ return _extends(Swap, {
2759
+ pluginName: 'swap',
2760
+ eventProperties: function eventProperties() {
2761
+ return {
2762
+ swapItem: lastSwapEl
2763
+ };
2764
+ }
2765
+ });
2766
+ }
2767
+ function swapNodes(n1, n2) {
2768
+ var p1 = n1.parentNode,
2769
+ p2 = n2.parentNode,
2770
+ i1,
2771
+ i2;
2772
+ if (!p1 || !p2 || p1.isEqualNode(n2) || p2.isEqualNode(n1)) return;
2773
+ i1 = index(n1);
2774
+ i2 = index(n2);
2775
+ if (p1.isEqualNode(p2) && i1 < i2) {
2776
+ i2++;
2777
+ }
2778
+ p1.insertBefore(n2, p1.children[i1]);
2779
+ p2.insertBefore(n1, p2.children[i2]);
2780
+ }
2781
+
2782
+ var multiDragElements = [],
2783
+ multiDragClones = [],
2784
+ lastMultiDragSelect,
2785
+ // for selection with modifier key down (SHIFT)
2786
+ multiDragSortable,
2787
+ initialFolding = false,
2788
+ // Initial multi-drag fold when drag started
2789
+ folding = false,
2790
+ // Folding any other time
2791
+ dragStarted = false,
2792
+ dragEl$1,
2793
+ clonesFromRect,
2794
+ clonesHidden;
2795
+ function MultiDragPlugin() {
2796
+ function MultiDrag(sortable) {
2797
+ // Bind all private methods
2798
+ for (var fn in this) {
2799
+ if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {
2800
+ this[fn] = this[fn].bind(this);
2801
+ }
2802
+ }
2803
+ if (!sortable.options.avoidImplicitDeselect) {
2804
+ if (sortable.options.supportPointer) {
2805
+ on(document, 'pointerup', this._deselectMultiDrag);
2806
+ } else {
2807
+ on(document, 'mouseup', this._deselectMultiDrag);
2808
+ on(document, 'touchend', this._deselectMultiDrag);
2809
+ }
2810
+ }
2811
+ on(document, 'keydown', this._checkKeyDown);
2812
+ on(document, 'keyup', this._checkKeyUp);
2813
+ this.defaults = {
2814
+ selectedClass: 'sortable-selected',
2815
+ multiDragKey: null,
2816
+ avoidImplicitDeselect: false,
2817
+ setData: function setData(dataTransfer, dragEl) {
2818
+ var data = '';
2819
+ if (multiDragElements.length && multiDragSortable === sortable) {
2820
+ multiDragElements.forEach(function (multiDragElement, i) {
2821
+ data += (!i ? '' : ', ') + multiDragElement.textContent;
2822
+ });
2823
+ } else {
2824
+ data = dragEl.textContent;
2825
+ }
2826
+ dataTransfer.setData('Text', data);
2827
+ }
2828
+ };
2829
+ }
2830
+ MultiDrag.prototype = {
2831
+ multiDragKeyDown: false,
2832
+ isMultiDrag: false,
2833
+ delayStartGlobal: function delayStartGlobal(_ref) {
2834
+ var dragged = _ref.dragEl;
2835
+ dragEl$1 = dragged;
2836
+ },
2837
+ delayEnded: function delayEnded() {
2838
+ this.isMultiDrag = ~multiDragElements.indexOf(dragEl$1);
2839
+ },
2840
+ setupClone: function setupClone(_ref2) {
2841
+ var sortable = _ref2.sortable,
2842
+ cancel = _ref2.cancel;
2843
+ if (!this.isMultiDrag) return;
2844
+ for (var i = 0; i < multiDragElements.length; i++) {
2845
+ multiDragClones.push(clone(multiDragElements[i]));
2846
+ multiDragClones[i].sortableIndex = multiDragElements[i].sortableIndex;
2847
+ multiDragClones[i].draggable = false;
2848
+ multiDragClones[i].style['will-change'] = '';
2849
+ toggleClass(multiDragClones[i], this.options.selectedClass, false);
2850
+ multiDragElements[i] === dragEl$1 && toggleClass(multiDragClones[i], this.options.chosenClass, false);
2851
+ }
2852
+ sortable._hideClone();
2853
+ cancel();
2854
+ },
2855
+ clone: function clone(_ref3) {
2856
+ var sortable = _ref3.sortable,
2857
+ rootEl = _ref3.rootEl,
2858
+ dispatchSortableEvent = _ref3.dispatchSortableEvent,
2859
+ cancel = _ref3.cancel;
2860
+ if (!this.isMultiDrag) return;
2861
+ if (!this.options.removeCloneOnHide) {
2862
+ if (multiDragElements.length && multiDragSortable === sortable) {
2863
+ insertMultiDragClones(true, rootEl);
2864
+ dispatchSortableEvent('clone');
2865
+ cancel();
2866
+ }
2867
+ }
2868
+ },
2869
+ showClone: function showClone(_ref4) {
2870
+ var cloneNowShown = _ref4.cloneNowShown,
2871
+ rootEl = _ref4.rootEl,
2872
+ cancel = _ref4.cancel;
2873
+ if (!this.isMultiDrag) return;
2874
+ insertMultiDragClones(false, rootEl);
2875
+ multiDragClones.forEach(function (clone) {
2876
+ css(clone, 'display', '');
2877
+ });
2878
+ cloneNowShown();
2879
+ clonesHidden = false;
2880
+ cancel();
2881
+ },
2882
+ hideClone: function hideClone(_ref5) {
2883
+ var _this = this;
2884
+ var cloneNowHidden = _ref5.cloneNowHidden,
2885
+ cancel = _ref5.cancel;
2886
+ if (!this.isMultiDrag) return;
2887
+ multiDragClones.forEach(function (clone) {
2888
+ css(clone, 'display', 'none');
2889
+ if (_this.options.removeCloneOnHide && clone.parentNode) {
2890
+ clone.parentNode.removeChild(clone);
2891
+ }
2892
+ });
2893
+ cloneNowHidden();
2894
+ clonesHidden = true;
2895
+ cancel();
2896
+ },
2897
+ dragStartGlobal: function dragStartGlobal(_ref6) {
2898
+ if (!this.isMultiDrag && multiDragSortable) {
2899
+ multiDragSortable.multiDrag._deselectMultiDrag();
2900
+ }
2901
+ multiDragElements.forEach(function (multiDragElement) {
2902
+ multiDragElement.sortableIndex = index(multiDragElement);
2903
+ });
2904
+
2905
+ // Sort multi-drag elements
2906
+ multiDragElements = multiDragElements.sort(function (a, b) {
2907
+ return a.sortableIndex - b.sortableIndex;
2908
+ });
2909
+ dragStarted = true;
2910
+ },
2911
+ dragStarted: function dragStarted(_ref7) {
2912
+ var _this2 = this;
2913
+ var sortable = _ref7.sortable;
2914
+ if (!this.isMultiDrag) return;
2915
+ if (this.options.sort) {
2916
+ // Capture rects,
2917
+ // hide multi drag elements (by positioning them absolute),
2918
+ // set multi drag elements rects to dragRect,
2919
+ // show multi drag elements,
2920
+ // animate to rects,
2921
+ // unset rects & remove from DOM
2922
+
2923
+ sortable.captureAnimationState();
2924
+ if (this.options.animation) {
2925
+ multiDragElements.forEach(function (multiDragElement) {
2926
+ if (multiDragElement === dragEl$1) return;
2927
+ css(multiDragElement, 'position', 'absolute');
2928
+ });
2929
+ var dragRect = getRect(dragEl$1, false, true, true);
2930
+ multiDragElements.forEach(function (multiDragElement) {
2931
+ if (multiDragElement === dragEl$1) return;
2932
+ setRect(multiDragElement, dragRect);
2933
+ });
2934
+ folding = true;
2935
+ initialFolding = true;
2936
+ }
2937
+ }
2938
+ sortable.animateAll(function () {
2939
+ folding = false;
2940
+ initialFolding = false;
2941
+ if (_this2.options.animation) {
2942
+ multiDragElements.forEach(function (multiDragElement) {
2943
+ unsetRect(multiDragElement);
2944
+ });
2945
+ }
2946
+
2947
+ // Remove all auxiliary multidrag items from el, if sorting enabled
2948
+ if (_this2.options.sort) {
2949
+ removeMultiDragElements();
2950
+ }
2951
+ });
2952
+ },
2953
+ dragOver: function dragOver(_ref8) {
2954
+ var target = _ref8.target,
2955
+ completed = _ref8.completed,
2956
+ cancel = _ref8.cancel;
2957
+ if (folding && ~multiDragElements.indexOf(target)) {
2958
+ completed(false);
2959
+ cancel();
2960
+ }
2961
+ },
2962
+ revert: function revert(_ref9) {
2963
+ var fromSortable = _ref9.fromSortable,
2964
+ rootEl = _ref9.rootEl,
2965
+ sortable = _ref9.sortable,
2966
+ dragRect = _ref9.dragRect;
2967
+ if (multiDragElements.length > 1) {
2968
+ // Setup unfold animation
2969
+ multiDragElements.forEach(function (multiDragElement) {
2970
+ sortable.addAnimationState({
2971
+ target: multiDragElement,
2972
+ rect: folding ? getRect(multiDragElement) : dragRect
2973
+ });
2974
+ unsetRect(multiDragElement);
2975
+ multiDragElement.fromRect = dragRect;
2976
+ fromSortable.removeAnimationState(multiDragElement);
2977
+ });
2978
+ folding = false;
2979
+ insertMultiDragElements(!this.options.removeCloneOnHide, rootEl);
2980
+ }
2981
+ },
2982
+ dragOverCompleted: function dragOverCompleted(_ref10) {
2983
+ var sortable = _ref10.sortable,
2984
+ isOwner = _ref10.isOwner,
2985
+ insertion = _ref10.insertion,
2986
+ activeSortable = _ref10.activeSortable,
2987
+ parentEl = _ref10.parentEl,
2988
+ putSortable = _ref10.putSortable;
2989
+ var options = this.options;
2990
+ if (insertion) {
2991
+ // Clones must be hidden before folding animation to capture dragRectAbsolute properly
2992
+ if (isOwner) {
2993
+ activeSortable._hideClone();
2994
+ }
2995
+ initialFolding = false;
2996
+ // If leaving sort:false root, or already folding - Fold to new location
2997
+ if (options.animation && multiDragElements.length > 1 && (folding || !isOwner && !activeSortable.options.sort && !putSortable)) {
2998
+ // Fold: Set all multi drag elements's rects to dragEl's rect when multi-drag elements are invisible
2999
+ var dragRectAbsolute = getRect(dragEl$1, false, true, true);
3000
+ multiDragElements.forEach(function (multiDragElement) {
3001
+ if (multiDragElement === dragEl$1) return;
3002
+ setRect(multiDragElement, dragRectAbsolute);
3003
+
3004
+ // Move element(s) to end of parentEl so that it does not interfere with multi-drag clones insertion if they are inserted
3005
+ // while folding, and so that we can capture them again because old sortable will no longer be fromSortable
3006
+ parentEl.appendChild(multiDragElement);
3007
+ });
3008
+ folding = true;
3009
+ }
3010
+
3011
+ // Clones must be shown (and check to remove multi drags) after folding when interfering multiDragElements are moved out
3012
+ if (!isOwner) {
3013
+ // Only remove if not folding (folding will remove them anyways)
3014
+ if (!folding) {
3015
+ removeMultiDragElements();
3016
+ }
3017
+ if (multiDragElements.length > 1) {
3018
+ var clonesHiddenBefore = clonesHidden;
3019
+ activeSortable._showClone(sortable);
3020
+
3021
+ // Unfold animation for clones if showing from hidden
3022
+ if (activeSortable.options.animation && !clonesHidden && clonesHiddenBefore) {
3023
+ multiDragClones.forEach(function (clone) {
3024
+ activeSortable.addAnimationState({
3025
+ target: clone,
3026
+ rect: clonesFromRect
3027
+ });
3028
+ clone.fromRect = clonesFromRect;
3029
+ clone.thisAnimationDuration = null;
3030
+ });
3031
+ }
3032
+ } else {
3033
+ activeSortable._showClone(sortable);
3034
+ }
3035
+ }
3036
+ }
3037
+ },
3038
+ dragOverAnimationCapture: function dragOverAnimationCapture(_ref11) {
3039
+ var dragRect = _ref11.dragRect,
3040
+ isOwner = _ref11.isOwner,
3041
+ activeSortable = _ref11.activeSortable;
3042
+ multiDragElements.forEach(function (multiDragElement) {
3043
+ multiDragElement.thisAnimationDuration = null;
3044
+ });
3045
+ if (activeSortable.options.animation && !isOwner && activeSortable.multiDrag.isMultiDrag) {
3046
+ clonesFromRect = _extends({}, dragRect);
3047
+ var dragMatrix = matrix(dragEl$1, true);
3048
+ clonesFromRect.top -= dragMatrix.f;
3049
+ clonesFromRect.left -= dragMatrix.e;
3050
+ }
3051
+ },
3052
+ dragOverAnimationComplete: function dragOverAnimationComplete() {
3053
+ if (folding) {
3054
+ folding = false;
3055
+ removeMultiDragElements();
3056
+ }
3057
+ },
3058
+ drop: function drop(_ref12) {
3059
+ var evt = _ref12.originalEvent,
3060
+ rootEl = _ref12.rootEl,
3061
+ parentEl = _ref12.parentEl,
3062
+ sortable = _ref12.sortable,
3063
+ dispatchSortableEvent = _ref12.dispatchSortableEvent,
3064
+ oldIndex = _ref12.oldIndex,
3065
+ putSortable = _ref12.putSortable;
3066
+ var toSortable = putSortable || this.sortable;
3067
+ if (!evt) return;
3068
+ var options = this.options,
3069
+ children = parentEl.children;
3070
+
3071
+ // Multi-drag selection
3072
+ if (!dragStarted) {
3073
+ if (options.multiDragKey && !this.multiDragKeyDown) {
3074
+ this._deselectMultiDrag();
3075
+ }
3076
+ toggleClass(dragEl$1, options.selectedClass, !~multiDragElements.indexOf(dragEl$1));
3077
+ if (!~multiDragElements.indexOf(dragEl$1)) {
3078
+ multiDragElements.push(dragEl$1);
3079
+ dispatchEvent({
3080
+ sortable: sortable,
3081
+ rootEl: rootEl,
3082
+ name: 'select',
3083
+ targetEl: dragEl$1,
3084
+ originalEvent: evt
3085
+ });
3086
+
3087
+ // Modifier activated, select from last to dragEl
3088
+ if (evt.shiftKey && lastMultiDragSelect && sortable.el.contains(lastMultiDragSelect)) {
3089
+ var lastIndex = index(lastMultiDragSelect),
3090
+ currentIndex = index(dragEl$1);
3091
+ if (~lastIndex && ~currentIndex && lastIndex !== currentIndex) {
3092
+ // Must include lastMultiDragSelect (select it), in case modified selection from no selection
3093
+ // (but previous selection existed)
3094
+ var n, i;
3095
+ if (currentIndex > lastIndex) {
3096
+ i = lastIndex;
3097
+ n = currentIndex;
3098
+ } else {
3099
+ i = currentIndex;
3100
+ n = lastIndex + 1;
3101
+ }
3102
+ for (; i < n; i++) {
3103
+ if (~multiDragElements.indexOf(children[i])) continue;
3104
+ toggleClass(children[i], options.selectedClass, true);
3105
+ multiDragElements.push(children[i]);
3106
+ dispatchEvent({
3107
+ sortable: sortable,
3108
+ rootEl: rootEl,
3109
+ name: 'select',
3110
+ targetEl: children[i],
3111
+ originalEvent: evt
3112
+ });
3113
+ }
3114
+ }
3115
+ } else {
3116
+ lastMultiDragSelect = dragEl$1;
3117
+ }
3118
+ multiDragSortable = toSortable;
3119
+ } else {
3120
+ multiDragElements.splice(multiDragElements.indexOf(dragEl$1), 1);
3121
+ lastMultiDragSelect = null;
3122
+ dispatchEvent({
3123
+ sortable: sortable,
3124
+ rootEl: rootEl,
3125
+ name: 'deselect',
3126
+ targetEl: dragEl$1,
3127
+ originalEvent: evt
3128
+ });
3129
+ }
3130
+ }
3131
+
3132
+ // Multi-drag drop
3133
+ if (dragStarted && this.isMultiDrag) {
3134
+ folding = false;
3135
+ // Do not "unfold" after around dragEl if reverted
3136
+ if ((parentEl[expando].options.sort || parentEl !== rootEl) && multiDragElements.length > 1) {
3137
+ var dragRect = getRect(dragEl$1),
3138
+ multiDragIndex = index(dragEl$1, ':not(.' + this.options.selectedClass + ')');
3139
+ if (!initialFolding && options.animation) dragEl$1.thisAnimationDuration = null;
3140
+ toSortable.captureAnimationState();
3141
+ if (!initialFolding) {
3142
+ if (options.animation) {
3143
+ dragEl$1.fromRect = dragRect;
3144
+ multiDragElements.forEach(function (multiDragElement) {
3145
+ multiDragElement.thisAnimationDuration = null;
3146
+ if (multiDragElement !== dragEl$1) {
3147
+ var rect = folding ? getRect(multiDragElement) : dragRect;
3148
+ multiDragElement.fromRect = rect;
3149
+
3150
+ // Prepare unfold animation
3151
+ toSortable.addAnimationState({
3152
+ target: multiDragElement,
3153
+ rect: rect
3154
+ });
3155
+ }
3156
+ });
3157
+ }
3158
+
3159
+ // Multi drag elements are not necessarily removed from the DOM on drop, so to reinsert
3160
+ // properly they must all be removed
3161
+ removeMultiDragElements();
3162
+ multiDragElements.forEach(function (multiDragElement) {
3163
+ if (children[multiDragIndex]) {
3164
+ parentEl.insertBefore(multiDragElement, children[multiDragIndex]);
3165
+ } else {
3166
+ parentEl.appendChild(multiDragElement);
3167
+ }
3168
+ multiDragIndex++;
3169
+ });
3170
+
3171
+ // If initial folding is done, the elements may have changed position because they are now
3172
+ // unfolding around dragEl, even though dragEl may not have his index changed, so update event
3173
+ // must be fired here as Sortable will not.
3174
+ if (oldIndex === index(dragEl$1)) {
3175
+ var update = false;
3176
+ multiDragElements.forEach(function (multiDragElement) {
3177
+ if (multiDragElement.sortableIndex !== index(multiDragElement)) {
3178
+ update = true;
3179
+ return;
3180
+ }
3181
+ });
3182
+ if (update) {
3183
+ dispatchSortableEvent('update');
3184
+ dispatchSortableEvent('sort');
3185
+ }
3186
+ }
3187
+ }
3188
+
3189
+ // Must be done after capturing individual rects (scroll bar)
3190
+ multiDragElements.forEach(function (multiDragElement) {
3191
+ unsetRect(multiDragElement);
3192
+ });
3193
+ toSortable.animateAll();
3194
+ }
3195
+ multiDragSortable = toSortable;
3196
+ }
3197
+
3198
+ // Remove clones if necessary
3199
+ if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {
3200
+ multiDragClones.forEach(function (clone) {
3201
+ clone.parentNode && clone.parentNode.removeChild(clone);
3202
+ });
3203
+ }
3204
+ },
3205
+ nullingGlobal: function nullingGlobal() {
3206
+ this.isMultiDrag = dragStarted = false;
3207
+ multiDragClones.length = 0;
3208
+ },
3209
+ destroyGlobal: function destroyGlobal() {
3210
+ this._deselectMultiDrag();
3211
+ off(document, 'pointerup', this._deselectMultiDrag);
3212
+ off(document, 'mouseup', this._deselectMultiDrag);
3213
+ off(document, 'touchend', this._deselectMultiDrag);
3214
+ off(document, 'keydown', this._checkKeyDown);
3215
+ off(document, 'keyup', this._checkKeyUp);
3216
+ },
3217
+ _deselectMultiDrag: function _deselectMultiDrag(evt) {
3218
+ if (typeof dragStarted !== "undefined" && dragStarted) return;
3219
+
3220
+ // Only deselect if selection is in this sortable
3221
+ if (multiDragSortable !== this.sortable) return;
3222
+
3223
+ // Only deselect if target is not item in this sortable
3224
+ if (evt && closest(evt.target, this.options.draggable, this.sortable.el, false)) return;
3225
+
3226
+ // Only deselect if left click
3227
+ if (evt && evt.button !== 0) return;
3228
+ while (multiDragElements.length) {
3229
+ var el = multiDragElements[0];
3230
+ toggleClass(el, this.options.selectedClass, false);
3231
+ multiDragElements.shift();
3232
+ dispatchEvent({
3233
+ sortable: this.sortable,
3234
+ rootEl: this.sortable.el,
3235
+ name: 'deselect',
3236
+ targetEl: el,
3237
+ originalEvent: evt
3238
+ });
3239
+ }
3240
+ },
3241
+ _checkKeyDown: function _checkKeyDown(evt) {
3242
+ if (evt.key === this.options.multiDragKey) {
3243
+ this.multiDragKeyDown = true;
3244
+ }
3245
+ },
3246
+ _checkKeyUp: function _checkKeyUp(evt) {
3247
+ if (evt.key === this.options.multiDragKey) {
3248
+ this.multiDragKeyDown = false;
3249
+ }
3250
+ }
3251
+ };
3252
+ return _extends(MultiDrag, {
3253
+ // Static methods & properties
3254
+ pluginName: 'multiDrag',
3255
+ utils: {
3256
+ /**
3257
+ * Selects the provided multi-drag item
3258
+ * @param {HTMLElement} el The element to be selected
3259
+ */
3260
+ select: function select(el) {
3261
+ var sortable = el.parentNode[expando];
3262
+ if (!sortable || !sortable.options.multiDrag || ~multiDragElements.indexOf(el)) return;
3263
+ if (multiDragSortable && multiDragSortable !== sortable) {
3264
+ multiDragSortable.multiDrag._deselectMultiDrag();
3265
+ multiDragSortable = sortable;
3266
+ }
3267
+ toggleClass(el, sortable.options.selectedClass, true);
3268
+ multiDragElements.push(el);
3269
+ },
3270
+ /**
3271
+ * Deselects the provided multi-drag item
3272
+ * @param {HTMLElement} el The element to be deselected
3273
+ */
3274
+ deselect: function deselect(el) {
3275
+ var sortable = el.parentNode[expando],
3276
+ index = multiDragElements.indexOf(el);
3277
+ if (!sortable || !sortable.options.multiDrag || !~index) return;
3278
+ toggleClass(el, sortable.options.selectedClass, false);
3279
+ multiDragElements.splice(index, 1);
3280
+ }
3281
+ },
3282
+ eventProperties: function eventProperties() {
3283
+ var _this3 = this;
3284
+ var oldIndicies = [],
3285
+ newIndicies = [];
3286
+ multiDragElements.forEach(function (multiDragElement) {
3287
+ oldIndicies.push({
3288
+ multiDragElement: multiDragElement,
3289
+ index: multiDragElement.sortableIndex
3290
+ });
3291
+
3292
+ // multiDragElements will already be sorted if folding
3293
+ var newIndex;
3294
+ if (folding && multiDragElement !== dragEl$1) {
3295
+ newIndex = -1;
3296
+ } else if (folding) {
3297
+ newIndex = index(multiDragElement, ':not(.' + _this3.options.selectedClass + ')');
3298
+ } else {
3299
+ newIndex = index(multiDragElement);
3300
+ }
3301
+ newIndicies.push({
3302
+ multiDragElement: multiDragElement,
3303
+ index: newIndex
3304
+ });
3305
+ });
3306
+ return {
3307
+ items: _toConsumableArray(multiDragElements),
3308
+ clones: [].concat(multiDragClones),
3309
+ oldIndicies: oldIndicies,
3310
+ newIndicies: newIndicies
3311
+ };
3312
+ },
3313
+ optionListeners: {
3314
+ multiDragKey: function multiDragKey(key) {
3315
+ key = key.toLowerCase();
3316
+ if (key === 'ctrl') {
3317
+ key = 'Control';
3318
+ } else if (key.length > 1) {
3319
+ key = key.charAt(0).toUpperCase() + key.substr(1);
3320
+ }
3321
+ return key;
3322
+ }
3323
+ }
3324
+ });
3325
+ }
3326
+ function insertMultiDragElements(clonesInserted, rootEl) {
3327
+ multiDragElements.forEach(function (multiDragElement, i) {
3328
+ var target = rootEl.children[multiDragElement.sortableIndex + (clonesInserted ? Number(i) : 0)];
3329
+ if (target) {
3330
+ rootEl.insertBefore(multiDragElement, target);
3331
+ } else {
3332
+ rootEl.appendChild(multiDragElement);
3333
+ }
3334
+ });
3335
+ }
3336
+
3337
+ /**
3338
+ * Insert multi-drag clones
3339
+ * @param {[Boolean]} elementsInserted Whether the multi-drag elements are inserted
3340
+ * @param {HTMLElement} rootEl
3341
+ */
3342
+ function insertMultiDragClones(elementsInserted, rootEl) {
3343
+ multiDragClones.forEach(function (clone, i) {
3344
+ var target = rootEl.children[clone.sortableIndex + (elementsInserted ? Number(i) : 0)];
3345
+ if (target) {
3346
+ rootEl.insertBefore(clone, target);
3347
+ } else {
3348
+ rootEl.appendChild(clone);
3349
+ }
3350
+ });
3351
+ }
3352
+ function removeMultiDragElements() {
3353
+ multiDragElements.forEach(function (multiDragElement) {
3354
+ if (multiDragElement === dragEl$1) return;
3355
+ multiDragElement.parentNode && multiDragElement.parentNode.removeChild(multiDragElement);
3356
+ });
3357
+ }
3358
+
3359
+ Sortable.mount(new AutoScrollPlugin());
3360
+ Sortable.mount(Remove, Revert);
3361
+
3362
+ Sortable.mount(new SwapPlugin());
3363
+ Sortable.mount(new MultiDragPlugin());
3364
+
3365
+ const nylasBookingFormConfigCss = ":host{display:block;--nylas-primary:#2563eb;--nylas-error:#cc4841;--nylas-error-pressed:#992222;--nylas-wraning:#f06c00;--nylas-success:#16a392;--nylas-info:#2b8fc2;--nylas-base-0:#ffffff;--nylas-base-25:#fcfcfd;--nylas-base-50:#f8f9fc;--nylas-base-100:#eaecf5;--nylas-base-200:#d5d9eb;--nylas-base-300:#b3b8d8;--nylas-base-400:#717bbc;--nylas-base-500:#4e5ba6;--nylas-base-600:#3e4784;--nylas-base-700:#263f72;--nylas-base-800:#293056;--nylas-base-900:#101323;--nylas-base-950:#0e101b;--nylas-border-radius:0.25rem;--nylas-border-radius-2x:0.5rem;--nylas-border-radius-3x:0.75rem;--nylas-font-family:\"Inter\", sans-serif;width:inherit}.nylas-booking-form-config{width:inherit;display:flex;flex-direction:column;margin:1rem}.nylas-booking-form-config .header{padding:1rem;display:flex;justify-content:space-between}.nylas-booking-form-config .header .header_text h3{margin:0;font-size:16px;font-weight:500;line-height:20px;color:var(--nylas-base-900);text-align:left}.nylas-booking-form-config .header .header_text p{margin:0.25rem 0 0 0;font-size:0.875rem;font-weight:400;line-height:20px;color:var(--nylas-base-600);text-align:left}.nylas-booking-form-config .header .header_action{display:flex}.nylas-booking-form-config .header .header_action select-dropdown::part(sd_dropdown-button){width:100%;display:flex;justify-content:space-between;align-items:center;border:1px solid var(--nylas-base-200);border-radius:var(--nylas-border-radius-2x);padding:1rem}.nylas-booking-form-config .content{padding:1rem;color:var(--nylas-base-900);font-size:16px;font-family:var(--nylas-font-family)}@media screen and (max-width: 504px){.nylas-booking-form-config .content{font-size:15px}}.nylas-booking-form-config .content .additional_fields{display:flex;flex-direction:column;gap:1rem;margin:1rem 0;position:relative;overflow:auto}@media screen and (max-width: 504px){.nylas-booking-form-config .content .additional_fields{gap:0.5rem;padding:0}}.nylas-booking-form-config .content .additional_fields .form-field{border-radius:var(--nylas-border-radius-2x);border:1px solid var(--nylas-base-200);padding:1rem;user-select:none;background-color:white;position:relative}.nylas-booking-form-config .content .additional_fields .form-field.highlight{background-color:var(--nylas-base-200)}.nylas-booking-form-config .content .additional_fields .form-field .form-field_header{display:flex;justify-content:space-between;align-items:center}.nylas-booking-form-config .content .additional_fields .form-field .form-field_header .dragable{cursor:move}.nylas-booking-form-config .content .additional_fields .form-field .form-field_header .form-field_header_text{flex:1;text-align:left;padding-left:1rem}.nylas-booking-form-config .content .additional_fields .form-field .form-field_header .form-field_header_text h4{margin:0;font-size:16px;line-height:20px;color:var(--nylas-base-900);text-align:left}.nylas-booking-form-config .content .additional_fields .form-field .form-field_header .form-field_header_text p{margin:0.25rem 0 0 0;font-size:0.875rem;font-weight:400;line-height:20px;color:var(--nylas-base-600);text-align:left}.nylas-booking-form-config .content .additional_fields .form-field .form-field_header .form-field_header_actions{display:flex;align-items:center}.nylas-booking-form-config .content .additional_fields .form-field .form-field_header .form-field_header_actions .is-required{color:var(--nylas-base-500);background-color:var(--nylas-base-50);font-weight:600;padding:4px 8px;border-radius:var(--nylas-border-radius-2x)}.nylas-booking-form-config .content .additional_fields .form-field .form-field_header .form-field_header_actions button{border:none;background:transparent;height:40px;margin:0 1rem;cursor:pointer;color:var(--nylas-base-800)}.nylas-booking-form-config .content .additional_fields .form-field .form-field_header .form-field_header_actions button:hover,.nylas-booking-form-config .content .additional_fields .form-field .form-field_header .form-field_header_actions button:active{color:var(--nylas-primary)}.nylas-booking-form-config .content .additional_fields .form-field .form-field_header .form-field_header_actions .chevron{display:flex;align-self:center;cursor:pointer}.nylas-booking-form-config .content .additional_fields .form-field .form-field_header .form-field_header_actions .chevron:hover,.nylas-booking-form-config .content .additional_fields .form-field .form-field_header .form-field_header_actions .chevron:active{color:var(--nylas-primary)}.nylas-booking-form-config .content .additional_fields .form-field .form-field_header .form-field_header_actions .chevron.open{transform:rotate(90deg)}.nylas-booking-form-config .content .additional_fields .form-field .form-field_header .form-field_header_actions .chevron.closed{transform:rotate(270deg)}.nylas-booking-form-config .content .additional_fields .form-field .form-field_content{padding:1.5rem 0 0 2.7rem}.nylas-booking-form-config .content .additional_fields .form-field .form-field_content.hidden{display:none}.nylas-booking-form-config .content .additional_fields .form-field .form-field_content .inputs{display:flex}.nylas-booking-form-config .content .additional_fields .form-field .form-field_content .inputs .label-input{padding:0 1rem 0 0}.nylas-booking-form-config .content .additional_fields .form-field .form-field_content .inputs .required-input{display:flex}.nylas-booking-form-config .content .additional_fields .form-field .form-field_content .inputs .required-input label{padding:0.5rem}.nylas-booking-form-config .content .additional_fields .form-field .form-field_content .inputs .required-input input[type=checkbox]{transform:scale(1.3)}.nylas-booking-form-config .content .additional_fields .form-field .form-field_content .options-container h4{margin:0;font-size:16px;line-height:20px;font-weight:500;padding:0.5rem 0;color:var(--nylas-base-900);text-align:left}.nylas-booking-form-config .content .additional_fields .form-field .form-field_content .options-container button{border:none;background:transparent;height:40px;margin:1rem 0;cursor:pointer;color:var(--nylas-base-800);display:flex;align-items:center;justify-content:space-between}.nylas-booking-form-config .content .additional_fields .form-field .form-field_content .options-container button:hover,.nylas-booking-form-config .content .additional_fields .form-field .form-field_content .options-container button:active{color:var(--nylas-primary)}.nylas-booking-form-config .content .additional_fields .form-field .form-field_content .options-container .options{display:flex;flex-direction:column;gap:1rem}.nylas-booking-form-config .content .additional_fields .form-field .form-field_content .options-container .options .option{display:flex;justify-content:space-between;align-items:center}.nylas-booking-form-config .content .additional_fields .form-field .form-field_content .options-container .options .option button{border:none;background:transparent;height:40px;margin:0 1rem;cursor:pointer;color:var(--nylas-base-800)}.nylas-booking-form-config .content .additional_fields .form-field .form-field_content .options-container .options .option button:hover,.nylas-booking-form-config .content .additional_fields .form-field .form-field_content .options-container .options .option button:active{color:var(--nylas-primary)}";
3366
+ const NylasBookingFormConfigStyle0 = nylasBookingFormConfigCss;
3367
+
3368
+ var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
3369
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3370
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
3371
+ r = Reflect.decorate(decorators, target, key, desc);
3372
+ else
3373
+ for (var i = decorators.length - 1; i >= 0; i--)
3374
+ if (d = decorators[i])
3375
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
3376
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
3377
+ };
3378
+ var __metadata = (undefined && undefined.__metadata) || function (k, v) {
3379
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
3380
+ return Reflect.metadata(k, v);
3381
+ };
3382
+ const NylasBookingForm = proxyCustomElement(class NylasBookingForm extends HTMLElement {
3383
+ constructor() {
3384
+ super();
3385
+ this.__registerHost();
3386
+ this.__attachShadow();
3387
+ this.valueChanged = createEvent(this, "valueChanged", 7);
3388
+ this.internals = this.attachInternals();
3389
+ this.selectedConfiguration = undefined;
3390
+ this.name = 'booking-form-config';
3391
+ this.additonalFields = [];
3392
+ this.formFields = [
3393
+ {
3394
+ type: 'text',
3395
+ label: 'Your name',
3396
+ key: 'your_name',
3397
+ typeLabel: 'Short text',
3398
+ readonly: true,
3399
+ required: true,
3400
+ isOpen: false,
3401
+ order: 0,
3402
+ },
3403
+ {
3404
+ type: 'email',
3405
+ label: 'Your Email',
3406
+ key: 'your_email',
3407
+ typeLabel: 'Email',
3408
+ readonly: true,
3409
+ isOpen: false,
3410
+ required: true,
3411
+ order: 1,
3412
+ },
3413
+ ...this.additonalFields
3414
+ .sort((a, b) => a.order - b.order)
3415
+ .map((f, i) => {
3416
+ const { typeLabel } = FIELD_TYPES.find(field => field.type === f.type);
3417
+ f.order = i + 2;
3418
+ return { ...f, isOpen: false, typeLabel };
3419
+ }),
3420
+ ];
3421
+ }
3422
+ elementNameChangedHandler(newValue) {
3423
+ debug('nylas-calendar-picker', 'elementNameChangedHandler', newValue);
3424
+ this.host.setAttribute('name', newValue);
3425
+ }
3426
+ connectedCallback() {
3427
+ debug('nylas-booking-form-config', 'connectedCallback');
3428
+ }
3429
+ disconnectedCallback() {
3430
+ debug('nylas-booking-form-config', 'disconnectedCallback');
3431
+ }
3432
+ componentWillLoad() {
3433
+ debug('nylas-booking-form-config', 'componentWillLoad');
3434
+ this.host.setAttribute('name', this.name);
3435
+ }
3436
+ componentDidLoad() {
3437
+ debug('nylas-booking-form-config', 'componentDidLoad');
3438
+ const container = this.host.shadowRoot?.getElementById('fields');
3439
+ Sortable.create(container, {
3440
+ animation: 150,
3441
+ swap: true,
3442
+ swapClass: 'highlight',
3443
+ onEnd: this.swapFields.bind(this),
3444
+ filter: '.fixed',
3445
+ onMove: evt => !evt.related.classList.contains('fixed'),
3446
+ });
3447
+ }
3448
+ watchHandler(newValue) {
3449
+ const additionalFields = newValue;
3450
+ const sortedFields = additionalFields
3451
+ .filter(f => !f.readonly)
3452
+ .sort((a, b) => a.order - b.order)
3453
+ .map((f, i) => {
3454
+ const field = {
3455
+ type: f.type,
3456
+ required: f.required,
3457
+ label: f.label,
3458
+ order: i + 1,
3459
+ options: f.options,
3460
+ key: f.key,
3461
+ };
3462
+ return { ...field };
3463
+ });
3464
+ const addFieldsMap = sortedFields.reduce((acc, field) => {
3465
+ acc[field.key] = {
3466
+ type: field.type,
3467
+ required: field.required,
3468
+ order: field.order,
3469
+ options: field.options,
3470
+ label: field.label,
3471
+ };
3472
+ return acc;
3473
+ }, {});
3474
+ this.valueChanged.emit({
3475
+ value: addFieldsMap,
3476
+ name: this.name,
3477
+ });
3478
+ }
3479
+ nylasFormDropdownChangedHandler(event) {
3480
+ const { name, value } = event.detail;
3481
+ if (name === 'add-field') {
3482
+ const field = FIELD_TYPES.find(f => f.type === value);
3483
+ const maxOrder = Math.max(...this.formFields.map(f => f.order));
3484
+ const newField = { ...field, order: maxOrder + 1 };
3485
+ const existingFieldWithLabel = this.formFields.filter(f => f.label.startsWith(field.label));
3486
+ if (existingFieldWithLabel && existingFieldWithLabel.length > 0) {
3487
+ const label = `${field.label} ${existingFieldWithLabel.length + 1}`;
3488
+ newField.label = label;
3489
+ const key = label.split(' ').join('_');
3490
+ newField.key = key;
3491
+ }
3492
+ this.formFields = [...this.formFields, newField];
3493
+ }
3494
+ }
3495
+ nylasFormInputChangedHandler(event) {
3496
+ const { name } = event.detail;
3497
+ const [fieldIndex, optionIndex] = name.split('_');
3498
+ if (optionIndex) {
3499
+ this.fieldOptionChange(parseInt(fieldIndex), parseInt(optionIndex), event);
3500
+ }
3501
+ else {
3502
+ this.fieldLabelChange(parseInt(fieldIndex), event);
3503
+ }
3504
+ }
3505
+ swapFields(event) {
3506
+ const { oldIndex, newIndex } = event;
3507
+ if (oldIndex !== undefined && newIndex !== undefined && oldIndex !== newIndex) {
3508
+ const newArray = [...this.formFields].map(f => {
3509
+ if (f.order === oldIndex) {
3510
+ return {
3511
+ ...f,
3512
+ order: newIndex,
3513
+ };
3514
+ }
3515
+ if (f.order === newIndex) {
3516
+ return {
3517
+ ...f,
3518
+ order: oldIndex,
3519
+ };
3520
+ }
3521
+ return f;
3522
+ });
3523
+ this.formFields = newArray;
3524
+ }
3525
+ }
3526
+ fieldToggle(index) {
3527
+ this.formFields = this.formFields.map((f, i) => {
3528
+ if (index == i) {
3529
+ f.isOpen = !f.isOpen;
3530
+ }
3531
+ return f;
3532
+ });
3533
+ }
3534
+ fieldRemove(index) {
3535
+ this.formFields = this.formFields.filter((_, i) => i !== index);
3536
+ }
3537
+ fieldRequired(index) {
3538
+ this.formFields = this.formFields.map((field, i) => {
3539
+ if (i === index) {
3540
+ field.required = !field.required;
3541
+ }
3542
+ return field;
3543
+ });
3544
+ }
3545
+ fieldLabelChange(index, event) {
3546
+ const target = event.detail;
3547
+ this.formFields = this.formFields.map((field, i) => {
3548
+ if (i === index) {
3549
+ field.label = target.value;
3550
+ }
3551
+ return field;
3552
+ });
3553
+ }
3554
+ fieldOptionAdd(index) {
3555
+ this.formFields = this.formFields.map((field, i) => {
3556
+ if (i === index) {
3557
+ if (!field.options) {
3558
+ field.options = [];
3559
+ }
3560
+ field.options = [...field.options, ''];
3561
+ }
3562
+ return field;
3563
+ });
3564
+ }
3565
+ fieldOptionRemove(fieldIndex, index) {
3566
+ this.formFields = this.formFields.map((field, i) => {
3567
+ if (i === fieldIndex) {
3568
+ if (!field.options) {
3569
+ field.options = [];
3570
+ }
3571
+ field.options = field.options.filter((_, i) => i !== index);
3572
+ }
3573
+ return field;
3574
+ });
3575
+ }
3576
+ fieldOptionChange(fieldIndex, index, event) {
3577
+ this.formFields = this.formFields.map((field, i) => {
3578
+ if (i === fieldIndex) {
3579
+ if (!field.options) {
3580
+ field.options = [];
3581
+ }
3582
+ field.options = field.options.map((o, i) => {
3583
+ if (i === index) {
3584
+ o = event.detail.value;
3585
+ }
3586
+ return o;
3587
+ });
3588
+ }
3589
+ return field;
3590
+ });
3591
+ }
3592
+ render() {
3593
+ return (h(Host, { key: '2a7bb5b2ee7caef3541054226ae026f9d61cfecf' }, h("div", { key: '0df0a49314526d603dcf00b4342f827c1ba76313', class: "nylas-booking-form-config" }, h("div", { key: '0b13698b3681aa00777ff1bc42ab1ba2008454a2', class: "header", part: "nbfc__header" }, h("div", { key: 'de1a7adf65d1d247819c251e235b71e02b18e038', class: "header_text" }, h("h3", { key: 'fb9ec159ba8c5ea894d73b737fac9848e5171a60' }, "Booking form"), h("p", { key: '59ec79e047a3ca87cd8ab6da7d0bb8595d81d8c5' }, "Customize the questions asked on the booking page.")), h("div", { key: '71405efb52d2972b232bb00625726a907c376dde', class: "header_action" }, h("select-dropdown", { key: '4288411410b255c86ba8d5056ec80d3681b97102', name: "add-field", exportparts: "sd_dropdown: nbfc__add_field, sd_dropdown-button: nbfc__add_field-button, sd_dropdown-content: nbfc__add_field-dropdown-content", options: DEFAULT_FORM_FIELD_TYPES, withSearch: false, withChevron: false, dropdownButtonText: "Add new type" }, h("span", { key: '6996c85d84233207956c3ed895a19a62c4488fae', slot: "select-icon" }, h("plus-icon", { key: '9c1bd64b45c664a47e1ed8188a083116b4a155ea', width: "15", height: "15" }))))), h("div", { key: '31c4029da44683be582d414b8efd977ac8ccf736', class: "content" }, h("div", { key: '7ed3b165c1925480dbdc02bb07f79188a1e55d0d', id: "fields", class: "additional_fields", part: "nbfc__additional_fields" }, this.formFields.map((field, i) => {
3594
+ return (h("div", { class: `form-field draggable ${field.readonly && 'fixed'}`, part: "nbfc__form_field", key: i }, h("div", { class: "form-field_header", part: "nbfc__form_field-header" }, h("span", { class: "dragable" }, h("dragable-icon", { width: "24", height: "25" })), h("div", { class: "form-field_header_text" }, h("h4", null, field.label), h("p", null, field.typeLabel)), h("div", { class: "form-field_header_actions" }, h("span", { class: `is-required` }, field.required ? 'Required' : 'Optional'), !field.readonly && (h("button", { onClick: () => {
3595
+ this.fieldRemove(i);
3596
+ } }, h("close-icon", null))), h("span", { class: `chevron ${field.isOpen ? 'open' : 'closed'}`, onClick: () => {
3597
+ this.fieldToggle(i);
3598
+ } }, h("chevron-icon", { width: "24", height: "24" })))), h("div", { class: `form-field_content ${!field.isOpen && 'hidden'}`, part: "nbfc__form_field-content" }, h("div", { class: "inputs" }, h("input-component", { class: 'label-input', name: `${i}`, key: i, label: "Label", required: false, readOnly: field.readonly, pattern: /^[a-zA-Z0-9\s]*$/, defaultValue: field.label }, h("div", { class: "required-input", slot: "additional-input" }, h("input", { type: "checkbox", name: `required_${field.order}`, id: `required_${field.order}`, onClick: () => {
3599
+ this.fieldRequired(i);
3600
+ }, checked: field.required, disabled: field.readonly }), h("label", { htmlFor: `required_${field.order}`, "aria-label": "Required" }, "Required")))), field.options != undefined && (h("div", { class: "options-container" }, h("h4", null, "ALL OPTIONS"), h("div", { class: "options" }, field.options.map((o, j) => {
3601
+ return (h("div", { class: "option" }, h("input-component", { key: j, name: `${i}_${j}`, label: field.typeLabel + ' option ' + (j + 1), required: true, pattern: /^[a-zA-Z0-9\s]*$/, defaultValue: o }, j > 1 && (h("div", { class: "required-input", slot: "additional-input" }, h("button", { onClick: () => {
3602
+ this.fieldOptionRemove(i, j);
3603
+ } }, h("close-icon", null)))))));
3604
+ })), h("button", { onClick: () => {
3605
+ this.fieldOptionAdd(i);
3606
+ }, part: "nap__add-time-range" }, h("add-circle-icon", null), " Add an option"))))));
3607
+ }))))));
3608
+ }
3609
+ static get formAssociated() { return true; }
3610
+ get host() { return this; }
3611
+ static get watchers() { return {
3612
+ "name": ["elementNameChangedHandler"],
3613
+ "formFields": ["watchHandler"]
3614
+ }; }
3615
+ static get style() { return NylasBookingFormConfigStyle0; }
3616
+ }, [65, "nylas-booking-form-config", {
3617
+ "selectedConfiguration": [16],
3618
+ "name": [1],
3619
+ "additonalFields": [16],
3620
+ "formFields": [32]
3621
+ }, [[0, "nylasFormDropdownChanged", "nylasFormDropdownChangedHandler"], [0, "nylasFormInputChanged", "nylasFormInputChangedHandler"]], {
3622
+ "name": ["elementNameChangedHandler"],
3623
+ "formFields": ["watchHandler"]
3624
+ }]);
3625
+ __decorate([
3626
+ RegisterComponent({
3627
+ name: 'nylas-booking-form-config',
3628
+ stateToProps: new Map([['schedulerConfig.selectedConfiguration', 'selectedConfiguration']]),
3629
+ fireRegisterEvent: true,
3630
+ }),
3631
+ __metadata("design:type", Function),
3632
+ __metadata("design:paramtypes", []),
3633
+ __metadata("design:returntype", void 0)
3634
+ ], NylasBookingForm.prototype, "render", null);
3635
+ function defineCustomElement() {
3636
+ if (typeof customElements === "undefined") {
3637
+ return;
3638
+ }
3639
+ const components = ["nylas-booking-form-config", "add-circle-icon", "chevron-icon", "close-icon", "dragable-icon", "input-component", "plus-icon", "search-icon", "select-dropdown"];
3640
+ components.forEach(tagName => { switch (tagName) {
3641
+ case "nylas-booking-form-config":
3642
+ if (!customElements.get(tagName)) {
3643
+ customElements.define(tagName, NylasBookingForm);
3644
+ }
3645
+ break;
3646
+ case "add-circle-icon":
3647
+ if (!customElements.get(tagName)) {
3648
+ defineCustomElement$8();
3649
+ }
3650
+ break;
3651
+ case "chevron-icon":
3652
+ if (!customElements.get(tagName)) {
3653
+ defineCustomElement$7();
3654
+ }
3655
+ break;
3656
+ case "close-icon":
3657
+ if (!customElements.get(tagName)) {
3658
+ defineCustomElement$6();
3659
+ }
3660
+ break;
3661
+ case "dragable-icon":
3662
+ if (!customElements.get(tagName)) {
3663
+ defineCustomElement$5();
3664
+ }
3665
+ break;
3666
+ case "input-component":
3667
+ if (!customElements.get(tagName)) {
3668
+ defineCustomElement$4();
3669
+ }
3670
+ break;
3671
+ case "plus-icon":
3672
+ if (!customElements.get(tagName)) {
3673
+ defineCustomElement$3();
3674
+ }
3675
+ break;
3676
+ case "search-icon":
3677
+ if (!customElements.get(tagName)) {
3678
+ defineCustomElement$2();
3679
+ }
3680
+ break;
3681
+ case "select-dropdown":
3682
+ if (!customElements.get(tagName)) {
3683
+ defineCustomElement$1();
3684
+ }
3685
+ break;
3686
+ } });
3687
+ }
3688
+
3689
+ export { NylasBookingForm as N, defineCustomElement as d };
3690
+
3691
+ //# sourceMappingURL=nylas-booking-form-config2.js.map