alchemy_cms 8.2.7 → 8.3.1

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 (202) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +4 -1
  3. data/app/assets/builds/alchemy/admin.css +1 -1
  4. data/app/assets/builds/alchemy/alchemy_admin.min.js +1 -1
  5. data/app/assets/builds/alchemy/alchemy_admin.min.js.map +1 -1
  6. data/app/assets/builds/alchemy/dark-theme.css +1 -1
  7. data/app/assets/builds/alchemy/light-theme.css +1 -1
  8. data/app/assets/builds/alchemy/preview.min.js +1 -1
  9. data/app/assets/builds/alchemy/theme.css +1 -1
  10. data/app/assets/builds/alchemy/welcome.css +1 -1
  11. data/app/assets/builds/tinymce/skins/content/alchemy/content.min.css +1 -1
  12. data/app/assets/builds/tinymce/skins/content/alchemy-dark/content.min.css +1 -1
  13. data/app/assets/builds/tinymce/skins/ui/alchemy/skin.min.css +1 -1
  14. data/app/assets/builds/tinymce/skins/ui/alchemy-dark/skin.min.css +1 -1
  15. data/app/assets/images/alchemy/admin/logo.svg +27 -0
  16. data/app/assets/images/alchemy/icons-sprite.svg +1 -1
  17. data/app/components/alchemy/admin/dashboard/widget.rb +40 -0
  18. data/app/components/alchemy/admin/dashboard/widgets/attachment_counts.rb +17 -0
  19. data/app/components/alchemy/admin/dashboard/widgets/element_usage.rb +37 -0
  20. data/app/components/alchemy/admin/dashboard/widgets/greeting.html.erb +13 -0
  21. data/app/components/alchemy/admin/dashboard/widgets/greeting.rb +21 -0
  22. data/app/components/alchemy/admin/dashboard/widgets/locked_pages.html.erb +54 -0
  23. data/app/components/alchemy/admin/dashboard/widgets/locked_pages.rb +20 -0
  24. data/app/components/alchemy/admin/dashboard/widgets/online_users.html.erb +22 -0
  25. data/app/components/alchemy/admin/dashboard/widgets/online_users.rb +19 -0
  26. data/app/components/alchemy/admin/dashboard/widgets/page_counts.rb +23 -0
  27. data/app/components/alchemy/admin/dashboard/widgets/page_usage.rb +46 -0
  28. data/app/components/alchemy/admin/dashboard/widgets/picture_counts.rb +17 -0
  29. data/app/components/alchemy/admin/dashboard/widgets/recent_pages.html.erb +41 -0
  30. data/app/components/alchemy/admin/dashboard/widgets/recent_pages.rb +16 -0
  31. data/app/components/alchemy/admin/dashboard/widgets/sites.html.erb +29 -0
  32. data/app/components/alchemy/admin/dashboard/widgets/sites.rb +15 -0
  33. data/app/components/alchemy/admin/dashboard/widgets/stat_widget.html.erb +23 -0
  34. data/app/components/alchemy/admin/dashboard/widgets/stat_widget.rb +19 -0
  35. data/app/components/alchemy/admin/dashboard/widgets/system_info.html.erb +32 -0
  36. data/app/components/alchemy/admin/dashboard/widgets/system_info.rb +37 -0
  37. data/app/components/alchemy/admin/dashboard/widgets/usage_widget.html.erb +42 -0
  38. data/app/components/alchemy/admin/dashboard/widgets/usage_widget.rb +66 -0
  39. data/app/components/alchemy/admin/dashboard/widgets/user_counts.rb +25 -0
  40. data/app/components/alchemy/admin/element_editor.html.erb +27 -20
  41. data/app/components/alchemy/admin/element_schedule_timestamps.rb +33 -0
  42. data/app/components/alchemy/admin/element_select.rb +4 -3
  43. data/app/components/alchemy/admin/link_dialog/anchor_tab.rb +1 -1
  44. data/app/components/alchemy/admin/link_dialog/file_tab.rb +1 -1
  45. data/app/components/alchemy/admin/page_node.html.erb +1 -20
  46. data/app/components/alchemy/admin/page_publication_fields.html.erb +30 -0
  47. data/app/components/alchemy/admin/page_publication_fields.rb +18 -0
  48. data/app/components/alchemy/admin/page_status_indicators.html.erb +29 -0
  49. data/app/components/alchemy/admin/page_status_indicators.rb +9 -0
  50. data/app/components/alchemy/admin/publish_element_button.html.erb +12 -4
  51. data/app/components/alchemy/ingredients/headline_editor.rb +1 -1
  52. data/app/controllers/alchemy/admin/dashboard/widgets_controller.rb +21 -0
  53. data/app/controllers/alchemy/admin/dashboard_controller.rb +3 -12
  54. data/app/controllers/alchemy/admin/pages_controller.rb +6 -5
  55. data/app/controllers/alchemy/pages_controller.rb +5 -4
  56. data/app/helpers/alchemy/elements_block_helper.rb +1 -0
  57. data/app/javascript/alchemy_admin/components/auto_submit.js +15 -9
  58. data/app/javascript/alchemy_admin/components/char_counter.js +17 -7
  59. data/app/javascript/alchemy_admin/components/clipboard_button.js +2 -6
  60. data/app/javascript/alchemy_admin/components/color_select.js +13 -4
  61. data/app/javascript/alchemy_admin/components/datepicker.js +11 -14
  62. data/app/javascript/alchemy_admin/components/dialog_link.js +5 -2
  63. data/app/javascript/alchemy_admin/components/element_editor/delete_element_button.js +6 -3
  64. data/app/javascript/alchemy_admin/components/element_editor.js +45 -28
  65. data/app/javascript/alchemy_admin/components/element_select.js +7 -4
  66. data/app/javascript/alchemy_admin/components/elements_window.js +38 -31
  67. data/app/javascript/alchemy_admin/components/elements_window_handle.js +7 -3
  68. data/app/javascript/alchemy_admin/components/file_editor.js +5 -2
  69. data/app/javascript/alchemy_admin/components/ingredient_group.js +6 -4
  70. data/app/javascript/alchemy_admin/components/link_buttons/link_button.js +1 -2
  71. data/app/javascript/alchemy_admin/components/link_buttons/unlink_button.js +1 -2
  72. data/app/javascript/alchemy_admin/components/link_buttons.js +6 -2
  73. data/app/javascript/alchemy_admin/components/list_filter.js +44 -29
  74. data/app/javascript/alchemy_admin/components/message.js +22 -15
  75. data/app/javascript/alchemy_admin/components/overlay.js +5 -7
  76. data/app/javascript/alchemy_admin/components/page_publication_fields.js +38 -25
  77. data/app/javascript/alchemy_admin/components/picture_description_select.js +5 -2
  78. data/app/javascript/alchemy_admin/components/picture_editor.js +5 -10
  79. data/app/javascript/alchemy_admin/components/picture_thumbnail.js +4 -5
  80. data/app/javascript/alchemy_admin/components/preview_window.js +5 -10
  81. data/app/javascript/alchemy_admin/components/publish_page_button.js +2 -5
  82. data/app/javascript/alchemy_admin/components/remote_select.js +53 -23
  83. data/app/javascript/alchemy_admin/components/select.js +169 -26
  84. data/app/javascript/alchemy_admin/components/sortable_elements.js +1 -1
  85. data/app/javascript/alchemy_admin/components/spinner.js +11 -11
  86. data/app/javascript/alchemy_admin/components/tags_autocomplete.js +9 -1
  87. data/app/javascript/alchemy_admin/components/tinymce.js +16 -22
  88. data/app/javascript/alchemy_admin/components/uploader/file_upload.js +48 -45
  89. data/app/javascript/alchemy_admin/components/uploader/progress.js +70 -84
  90. data/app/javascript/alchemy_admin/components/uploader.js +71 -46
  91. data/app/javascript/alchemy_admin/dialog.js +3 -0
  92. data/app/javascript/alchemy_admin/hotkeys.js +0 -18
  93. data/app/javascript/alchemy_admin/image_cropper.js +7 -9
  94. data/app/javascript/alchemy_admin/initializer.js +21 -0
  95. data/app/javascript/alchemy_admin/utils/dispatch_page_dirty_event.js +7 -0
  96. data/app/javascript/tinymce/plugins/alchemy_link/index.js +9 -0
  97. data/app/jobs/alchemy/base_job.rb +2 -2
  98. data/app/jobs/alchemy/invalidate_elements_cache_job.rb +33 -0
  99. data/app/models/alchemy/page/page_naming.rb +28 -5
  100. data/app/models/alchemy/page/page_natures.rb +7 -2
  101. data/app/models/alchemy/page/page_scopes.rb +2 -2
  102. data/app/models/alchemy/page/url_path.rb +7 -2
  103. data/app/models/alchemy/page.rb +2 -2
  104. data/app/models/alchemy/page_definition.rb +1 -0
  105. data/app/models/alchemy/permissions.rb +1 -1
  106. data/app/models/concerns/alchemy/relatable_resource.rb +8 -0
  107. data/app/services/alchemy/page_finder.rb +88 -0
  108. data/app/stylesheets/alchemy/_custom-properties.scss +6 -4
  109. data/app/stylesheets/alchemy/_mixins.scss +1 -7
  110. data/app/stylesheets/alchemy/_themes.scss +15 -3
  111. data/app/stylesheets/alchemy/admin/_tom-select.scss +241 -0
  112. data/app/stylesheets/alchemy/admin/archive.scss +0 -1
  113. data/app/stylesheets/alchemy/admin/base.scss +0 -19
  114. data/app/stylesheets/alchemy/admin/buttons.scss +1 -0
  115. data/app/stylesheets/alchemy/admin/clipboard.scss +2 -0
  116. data/app/stylesheets/alchemy/admin/dashboard.scss +395 -28
  117. data/app/stylesheets/alchemy/admin/elements.scss +16 -23
  118. data/app/stylesheets/alchemy/admin/filters.scss +4 -1
  119. data/app/stylesheets/alchemy/admin/form_fields.scss +3 -3
  120. data/app/stylesheets/alchemy/admin/forms.scss +126 -94
  121. data/app/stylesheets/alchemy/admin/icons.scss +28 -0
  122. data/app/stylesheets/alchemy/admin/image_library.scss +30 -10
  123. data/app/stylesheets/alchemy/admin/navigation.scss +4 -1
  124. data/app/stylesheets/alchemy/admin/popover.scss +3 -5
  125. data/app/stylesheets/alchemy/admin/resource_info.scss +11 -17
  126. data/app/stylesheets/alchemy/admin/shoelace.scss +8 -0
  127. data/app/stylesheets/alchemy/admin/sitemap.scss +13 -0
  128. data/app/stylesheets/alchemy/admin/tables.scss +32 -3
  129. data/app/stylesheets/alchemy/admin/tags.scss +1 -6
  130. data/app/stylesheets/alchemy/admin/toolbar.scss +0 -1
  131. data/app/stylesheets/alchemy/admin.scss +1 -0
  132. data/app/stylesheets/tinymce/skins/ui/alchemy/skin.scss +0 -4
  133. data/app/stylesheets/tinymce/skins/ui/alchemy-dark/skin.scss +0 -4
  134. data/app/types/alchemy/wildcard_url_type.rb +48 -0
  135. data/app/views/alchemy/_menubar.html.erb +1 -5
  136. data/app/views/alchemy/admin/attachments/edit.html.erb +6 -3
  137. data/app/views/alchemy/admin/dashboard/_dashboard.html.erb +3 -2
  138. data/app/views/alchemy/admin/dashboard/_footer.html.erb +22 -0
  139. data/app/views/alchemy/admin/dashboard/_stats.html.erb +7 -0
  140. data/app/views/alchemy/admin/dashboard/_top.html.erb +4 -12
  141. data/app/views/alchemy/admin/dashboard/_widgets.html.erb +7 -0
  142. data/app/views/alchemy/admin/dashboard/index.html.erb +0 -17
  143. data/app/views/alchemy/admin/dashboard/info.html.erb +1 -62
  144. data/app/views/alchemy/admin/dashboard/widgets/show.html.erb +3 -0
  145. data/app/views/alchemy/admin/elements/_form.html.erb +2 -1
  146. data/app/views/alchemy/admin/elements/_schedule.html.erb +2 -15
  147. data/app/views/alchemy/admin/elements/_schedule_fields.html.erb +2 -0
  148. data/app/views/alchemy/admin/layoutpages/edit.html.erb +6 -3
  149. data/app/views/alchemy/admin/legacy_page_urls/_table.html.erb +0 -1
  150. data/app/views/alchemy/admin/nodes/_page_nodes.html.erb +11 -9
  151. data/app/views/alchemy/admin/pages/_form.html.erb +25 -19
  152. data/app/views/alchemy/admin/pages/_locked_page.html.erb +1 -1
  153. data/app/views/alchemy/admin/pages/_publication_fields.html.erb +2 -32
  154. data/app/views/alchemy/admin/pages/_table.html.erb +1 -18
  155. data/app/views/alchemy/admin/pages/configure.html.erb +2 -2
  156. data/app/views/alchemy/admin/pages/info.html.erb +6 -0
  157. data/app/views/alchemy/admin/pages/unlock.turbo_stream.erb +20 -0
  158. data/app/views/alchemy/admin/pictures/_form.html.erb +1 -1
  159. data/app/views/alchemy/admin/pictures/edit_multiple.html.erb +1 -1
  160. data/app/views/alchemy/admin/resources/_form.html.erb +7 -4
  161. data/app/views/alchemy/admin/resources/edit.html.erb +3 -1
  162. data/app/views/alchemy/admin/resources/new.html.erb +3 -1
  163. data/app/views/alchemy/admin/styleguide/index.html.erb +52 -30
  164. data/app/views/alchemy/admin/translations/_en.js +4 -0
  165. data/app/views/layouts/alchemy/admin.html.erb +3 -3
  166. data/config/importmap.rb +2 -0
  167. data/config/locales/alchemy.en.yml +17 -2
  168. data/config/routes.rb +1 -0
  169. data/lib/alchemy/configuration/class_option.rb +46 -3
  170. data/lib/alchemy/configuration/collection_option.rb +4 -0
  171. data/lib/alchemy/configurations/dashboard.rb +79 -0
  172. data/lib/alchemy/configurations/main.rb +15 -0
  173. data/lib/alchemy/engine.rb +9 -3
  174. data/lib/alchemy/sprockets/skip_builds_compression.rb +33 -0
  175. data/lib/alchemy/test_support/capybara_helpers.rb +17 -0
  176. data/lib/alchemy/test_support/relatable_resource_examples.rb +20 -0
  177. data/lib/alchemy/test_support/rspec_matchers.rb +8 -0
  178. data/lib/alchemy/test_support/shared_publishable_examples.rb +38 -31
  179. data/lib/alchemy/tinymce.rb +1 -1
  180. data/lib/alchemy/version.rb +17 -3
  181. data/vendor/javascript/cropperjs.min.js +1 -1
  182. data/vendor/javascript/flatpickr.min.js +1 -1
  183. data/vendor/javascript/floating-ui.min.js +1 -0
  184. data/vendor/javascript/keymaster.min.js +1 -1
  185. data/vendor/javascript/rails-ujs.min.js +1 -1
  186. data/vendor/javascript/shoelace.min.js +93 -93
  187. data/vendor/javascript/sortable.min.js +1 -1
  188. data/vendor/javascript/tinymce.min.js +5 -1
  189. data/vendor/javascript/tom-select.min.js +1 -0
  190. metadata +58 -19
  191. data/app/javascript/alchemy_admin/components/alchemy_html_element.js +0 -129
  192. data/app/views/alchemy/admin/dashboard/_left_column.html.erb +0 -4
  193. data/app/views/alchemy/admin/dashboard/_right_column.html.erb +0 -9
  194. data/app/views/alchemy/admin/dashboard/widgets/_locked_pages.html.erb +0 -52
  195. data/app/views/alchemy/admin/dashboard/widgets/_recent_pages.html.erb +0 -34
  196. data/app/views/alchemy/admin/dashboard/widgets/_sites.html.erb +0 -25
  197. data/app/views/alchemy/admin/dashboard/widgets/_users.html.erb +0 -21
  198. data/app/views/alchemy/admin/languages/edit.html.erb +0 -1
  199. data/app/views/alchemy/admin/languages/new.html.erb +0 -1
  200. data/app/views/alchemy/admin/pages/unlock.js.erb +0 -20
  201. data/app/views/alchemy/admin/sites/edit.html.erb +0 -1
  202. data/app/views/alchemy/admin/sites/new.html.erb +0 -1
@@ -1 +1 @@
1
- var e=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],n={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:"object"==typeof window&&-1===window.navigator.userAgent.indexOf("MSIE"),ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(e){return"undefined"!=typeof console&&console.warn(e)},getWeek:function(e){var n=new Date(e.getTime());n.setHours(0,0,0,0),n.setDate(n.getDate()+3-(n.getDay()+6)%7);var t=new Date(n.getFullYear(),0,4);return 1+Math.round(((n.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},t={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(e){var n=e%100;if(n>3&&n<21)return"th";switch(n%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},a=function(e,n){return void 0===n&&(n=2),("000"+e).slice(-1*n)},i=function(e){return!0===e?1:0};function o(e,n){var t;return function(){var a=this,i=arguments;clearTimeout(t),t=setTimeout((function(){return e.apply(a,i)}),n)}}var r=function(e){return e instanceof Array?e:[e]};function l(e,n,t){if(!0===t)return e.classList.add(n);e.classList.remove(n)}function c(e,n,t){var a=window.document.createElement(e);return n=n||"",t=t||"",a.className=n,void 0!==t&&(a.textContent=t),a}function s(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function d(e,n){return n(e)?e:e.parentNode?d(e.parentNode,n):void 0}function u(e,n){var t=c("div","numInputWrapper"),a=c("input","numInput "+e),i=c("span","arrowUp"),o=c("span","arrowDown");if(-1===navigator.userAgent.indexOf("MSIE 9.0")?a.type="number":(a.type="text",a.pattern="\\d*"),void 0!==n)for(var r in n)a.setAttribute(r,n[r]);return t.appendChild(a),t.appendChild(i),t.appendChild(o),t}function f(e){try{return"function"==typeof e.composedPath?e.composedPath()[0]:e.target}catch(n){return e.target}}var m=function(){},g=function(e,n,t){return t.months[n?"shorthand":"longhand"][e]},p={D:m,F:function(e,n,t){e.setMonth(t.months.longhand.indexOf(n))},G:function(e,n){e.setHours((e.getHours()>=12?12:0)+parseFloat(n))},H:function(e,n){e.setHours(parseFloat(n))},J:function(e,n){e.setDate(parseFloat(n))},K:function(e,n,t){e.setHours(e.getHours()%12+12*i(new RegExp(t.amPM[1],"i").test(n)))},M:function(e,n,t){e.setMonth(t.months.shorthand.indexOf(n))},S:function(e,n){e.setSeconds(parseFloat(n))},U:function(e,n){return new Date(1e3*parseFloat(n))},W:function(e,n,t){var a=parseInt(n),i=new Date(e.getFullYear(),0,2+7*(a-1),0,0,0,0);return i.setDate(i.getDate()-i.getDay()+t.firstDayOfWeek),i},Y:function(e,n){e.setFullYear(parseFloat(n))},Z:function(e,n){return new Date(n)},d:function(e,n){e.setDate(parseFloat(n))},h:function(e,n){e.setHours((e.getHours()>=12?12:0)+parseFloat(n))},i:function(e,n){e.setMinutes(parseFloat(n))},j:function(e,n){e.setDate(parseFloat(n))},l:m,m:function(e,n){e.setMonth(parseFloat(n)-1)},n:function(e,n){e.setMonth(parseFloat(n)-1)},s:function(e,n){e.setSeconds(parseFloat(n))},u:function(e,n){return new Date(parseFloat(n))},w:m,y:function(e,n){e.setFullYear(2e3+parseFloat(n))}},h={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},v={Z:function(e){return e.toISOString()},D:function(e,n,t){return n.weekdays.shorthand[v.w(e,n,t)]},F:function(e,n,t){return g(v.n(e,n,t)-1,!1,n)},G:function(e,n,t){return a(v.h(e,n,t))},H:function(e){return a(e.getHours())},J:function(e,n){return void 0!==n.ordinal?e.getDate()+n.ordinal(e.getDate()):e.getDate()},K:function(e,n){return n.amPM[i(e.getHours()>11)]},M:function(e,n){return g(e.getMonth(),!0,n)},S:function(e){return a(e.getSeconds())},U:function(e){return e.getTime()/1e3},W:function(e,n,t){return t.getWeek(e)},Y:function(e){return a(e.getFullYear(),4)},d:function(e){return a(e.getDate())},h:function(e){return e.getHours()%12?e.getHours()%12:12},i:function(e){return a(e.getMinutes())},j:function(e){return e.getDate()},l:function(e,n){return n.weekdays.longhand[e.getDay()]},m:function(e){return a(e.getMonth()+1)},n:function(e){return e.getMonth()+1},s:function(e){return e.getSeconds()},u:function(e){return e.getTime()},w:function(e){return e.getDay()},y:function(e){return String(e.getFullYear()).substring(2)}},D=function(e){var a=e.config,i=void 0===a?n:a,o=e.l10n,r=void 0===o?t:o,l=e.isMobile,c=void 0!==l&&l;return function(e,n,t){var a=t||r;return void 0===i.formatDate||c?n.split("").map((function(n,t,o){return v[n]&&"\\"!==o[t-1]?v[n](e,a,i):"\\"!==n?n:""})).join(""):i.formatDate(e,n,a)}},w=function(e){var a=e.config,i=void 0===a?n:a,o=e.l10n,r=void 0===o?t:o;return function(e,t,a,o){if(0===e||e){var l,c=o||r,s=e;if(e instanceof Date)l=new Date(e.getTime());else if("string"!=typeof e&&void 0!==e.toFixed)l=new Date(e);else if("string"==typeof e){var d=t||(i||n).dateFormat,u=String(e).trim();if("today"===u)l=new Date,a=!0;else if(i&&i.parseDate)l=i.parseDate(e,d);else if(/Z$/.test(u)||/GMT$/.test(u))l=new Date(e);else{for(var f=void 0,m=[],g=0,v=0,D="";g<d.length;g++){var w=d[g],b="\\"===w,C="\\"===d[g-1]||b;if(h[w]&&!C){D+=h[w];var M=new RegExp(D).exec(e);M&&(f=!0)&&m["Y"!==w?"push":"unshift"]({fn:p[w],val:M[++v]})}else b||(D+=".")}l=i&&i.noCalendar?new Date((new Date).setHours(0,0,0,0)):new Date((new Date).getFullYear(),0,1,0,0,0,0),m.forEach((function(e){var n=e.fn,t=e.val;return l=n(l,t,c)||l})),l=f?l:void 0}}if(l instanceof Date&&!isNaN(l.getTime()))return!0===a&&l.setHours(0,0,0,0),l;i.errorHandler(new Error("Invalid date provided: "+s))}}};function b(e,n,t){return void 0===t&&(t=!0),!1!==t?new Date(e.getTime()).setHours(0,0,0,0)-new Date(n.getTime()).setHours(0,0,0,0):e.getTime()-n.getTime()}var C=function(e,n,t){return e>Math.min(n,t)&&e<Math.max(n,t)},M=function(e,n,t){return 3600*e+60*n+t},y=function(e){var n=Math.floor(e/3600),t=(e-3600*n)/60;return[n,t,e-3600*n-60*t]},x={DAY:864e5};function E(e){var n=e.defaultHour,t=e.defaultMinute,a=e.defaultSeconds;if(void 0!==e.minDate){var i=e.minDate.getHours(),o=e.minDate.getMinutes(),r=e.minDate.getSeconds();n<i&&(n=i),n===i&&t<o&&(t=o),n===i&&t===o&&a<r&&(a=e.minDate.getSeconds())}if(void 0!==e.maxDate){var l=e.maxDate.getHours(),c=e.maxDate.getMinutes();(n=Math.min(n,l))===l&&(t=Math.min(c,t)),n===l&&t===c&&(a=e.maxDate.getSeconds())}return{hours:n,minutes:t,seconds:a}}"function"!=typeof Object.assign&&(Object.assign=function(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];if(!e)throw TypeError("Cannot convert undefined or null to object");for(var a=function(n){n&&Object.keys(n).forEach((function(t){return e[t]=n[t]}))},i=0,o=n;i<o.length;i++){a(o[i])}return e});var k=window&&window.__assign||function(){return k=Object.assign||function(e){for(var n,t=1,a=arguments.length;t<a;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e},k.apply(this,arguments)},T=window&&window.__spreadArrays||function(){for(var e=0,n=0,t=arguments.length;n<t;n++)e+=arguments[n].length;var a=Array(e),i=0;for(n=0;n<t;n++)for(var o=arguments[n],r=0,l=o.length;r<l;r++,i++)a[i]=o[r];return a},I=300;function S(m,p){var v={config:k(k({},n),O.defaultConfig),l10n:t};function S(){var e;return(null===(e=v.calendarContainer)||void 0===e?void 0:e.getRootNode()).activeElement||document.activeElement}function _(e){return e.bind(v)}function F(){var e=v.config;!1===e.weekNumbers&&1===e.showMonths||!0!==e.noCalendar&&window.requestAnimationFrame((function(){if(void 0!==v.calendarContainer&&(v.calendarContainer.style.visibility="hidden",v.calendarContainer.style.display="block"),void 0!==v.daysContainer){var n=(v.days.offsetWidth+1)*e.showMonths;v.daysContainer.style.width=n+"px",v.calendarContainer.style.width=n+(void 0!==v.weekWrapper?v.weekWrapper.offsetWidth:0)+"px",v.calendarContainer.style.removeProperty("visibility"),v.calendarContainer.style.removeProperty("display")}}))}function A(e){if(0===v.selectedDates.length){var n=void 0===v.config.minDate||b(new Date,v.config.minDate)>=0?new Date:new Date(v.config.minDate.getTime()),t=E(v.config);n.setHours(t.hours,t.minutes,t.seconds,n.getMilliseconds()),v.selectedDates=[n],v.latestSelectedDateObj=n}void 0!==e&&"blur"!==e.type&&function(e){e.preventDefault();var n="keydown"===e.type,t=f(e),o=t;void 0!==v.amPM&&t===v.amPM&&(v.amPM.textContent=v.l10n.amPM[i(v.amPM.textContent===v.l10n.amPM[0])]);var r=parseFloat(o.getAttribute("min")),l=parseFloat(o.getAttribute("max")),c=parseFloat(o.getAttribute("step")),s=parseInt(o.value,10),d=e.delta||(n?38===e.which?1:-1:0),u=s+c*d;if(void 0!==o.value&&2===o.value.length){var m=o===v.hourElement,g=o===v.minuteElement;u<r?(u=l+u+i(!m)+(i(m)&&i(!v.amPM)),g&&B(void 0,-1,v.hourElement)):u>l&&(u=o===v.hourElement?u-l-i(!v.amPM):r,g&&B(void 0,1,v.hourElement)),v.amPM&&m&&(1===c?u+s===23:Math.abs(u-s)>c)&&(v.amPM.textContent=v.l10n.amPM[i(v.amPM.textContent===v.l10n.amPM[0])]),o.value=a(u)}}(e);var o=v._input.value;N(),ke(),v._input.value!==o&&v._debouncedChange()}function N(){if(void 0!==v.hourElement&&void 0!==v.minuteElement){var e,n,t=(parseInt(v.hourElement.value.slice(-2),10)||0)%24,a=(parseInt(v.minuteElement.value,10)||0)%60,o=void 0!==v.secondElement?(parseInt(v.secondElement.value,10)||0)%60:0;void 0!==v.amPM&&(e=t,n=v.amPM.textContent,t=e%12+12*i(n===v.l10n.amPM[1]));var r=void 0!==v.config.minTime||v.config.minDate&&v.minDateHasTime&&v.latestSelectedDateObj&&0===b(v.latestSelectedDateObj,v.config.minDate,!0),l=void 0!==v.config.maxTime||v.config.maxDate&&v.maxDateHasTime&&v.latestSelectedDateObj&&0===b(v.latestSelectedDateObj,v.config.maxDate,!0);if(void 0!==v.config.maxTime&&void 0!==v.config.minTime&&v.config.minTime>v.config.maxTime){var c=M(v.config.minTime.getHours(),v.config.minTime.getMinutes(),v.config.minTime.getSeconds()),s=M(v.config.maxTime.getHours(),v.config.maxTime.getMinutes(),v.config.maxTime.getSeconds()),d=M(t,a,o);if(d>s&&d<c){var u=y(c);t=u[0],a=u[1],o=u[2]}}else{if(l){var f=void 0!==v.config.maxTime?v.config.maxTime:v.config.maxDate;(t=Math.min(t,f.getHours()))===f.getHours()&&(a=Math.min(a,f.getMinutes())),a===f.getMinutes()&&(o=Math.min(o,f.getSeconds()))}if(r){var m=void 0!==v.config.minTime?v.config.minTime:v.config.minDate;(t=Math.max(t,m.getHours()))===m.getHours()&&a<m.getMinutes()&&(a=m.getMinutes()),a===m.getMinutes()&&(o=Math.max(o,m.getSeconds()))}}Y(t,a,o)}}function P(e){var n=e||v.latestSelectedDateObj;n&&n instanceof Date&&Y(n.getHours(),n.getMinutes(),n.getSeconds())}function Y(e,n,t){void 0!==v.latestSelectedDateObj&&v.latestSelectedDateObj.setHours(e%24,n,t||0,0),v.hourElement&&v.minuteElement&&!v.isMobile&&(v.hourElement.value=a(v.config.time_24hr?e:(12+e)%12+12*i(e%12==0)),v.minuteElement.value=a(n),void 0!==v.amPM&&(v.amPM.textContent=v.l10n.amPM[i(e>=12)]),void 0!==v.secondElement&&(v.secondElement.value=a(t)))}function j(e){var n=f(e),t=parseInt(n.value)+(e.delta||0);(t/1e3>1||"Enter"===e.key&&!/[^\d]/.test(t.toString()))&&ae(t)}function H(e,n,t,a){return n instanceof Array?n.forEach((function(n){return H(e,n,t,a)})):e instanceof Array?e.forEach((function(e){return H(e,n,t,a)})):(e.addEventListener(n,t,a),void v._handlers.push({remove:function(){return e.removeEventListener(n,t,a)}}))}function L(){Ce("onChange")}function R(e,n){var t=void 0!==e?v.parseDate(e):v.latestSelectedDateObj||(v.config.minDate&&v.config.minDate>v.now?v.config.minDate:v.config.maxDate&&v.config.maxDate<v.now?v.config.maxDate:v.now),a=v.currentYear,i=v.currentMonth;try{void 0!==t&&(v.currentYear=t.getFullYear(),v.currentMonth=t.getMonth())}catch(e){e.message="Invalid date supplied: "+t,v.config.errorHandler(e)}n&&v.currentYear!==a&&(Ce("onYearChange"),z()),!n||v.currentYear===a&&v.currentMonth===i||Ce("onMonthChange"),v.redraw()}function W(e){var n=f(e);~n.className.indexOf("arrow")&&B(e,n.classList.contains("arrowUp")?1:-1)}function B(e,n,t){var a=e&&f(e),i=t||a&&a.parentNode&&a.parentNode.firstChild,o=Me("increment");o.delta=n,i&&i.dispatchEvent(o)}function J(e,n,t,a){var i=ie(n,!0),o=c("span",e,n.getDate().toString());return o.dateObj=n,o.$i=a,o.setAttribute("aria-label",v.formatDate(n,v.config.ariaDateFormat)),-1===e.indexOf("hidden")&&0===b(n,v.now)&&(v.todayDateElem=o,o.classList.add("today"),o.setAttribute("aria-current","date")),i?(o.tabIndex=-1,ye(n)&&(o.classList.add("selected"),v.selectedDateElem=o,"range"===v.config.mode&&(l(o,"startRange",v.selectedDates[0]&&0===b(n,v.selectedDates[0],!0)),l(o,"endRange",v.selectedDates[1]&&0===b(n,v.selectedDates[1],!0)),"nextMonthDay"===e&&o.classList.add("inRange")))):o.classList.add("flatpickr-disabled"),"range"===v.config.mode&&function(e){return!("range"!==v.config.mode||v.selectedDates.length<2)&&(b(e,v.selectedDates[0])>=0&&b(e,v.selectedDates[1])<=0)}(n)&&!ye(n)&&o.classList.add("inRange"),v.weekNumbers&&1===v.config.showMonths&&"prevMonthDay"!==e&&a%7==6&&v.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+v.config.getWeek(n)+"</span>"),Ce("onDayCreate",o),o}function K(e){e.focus(),"range"===v.config.mode&&ce(e)}function U(e){for(var n=e>0?0:v.config.showMonths-1,t=e>0?v.config.showMonths:-1,a=n;a!=t;a+=e)for(var i=v.daysContainer.children[a],o=e>0?0:i.children.length-1,r=e>0?i.children.length:-1,l=o;l!=r;l+=e){var c=i.children[l];if(-1===c.className.indexOf("hidden")&&ie(c.dateObj))return c}}function q(e,n){var t=S(),a=oe(t||document.body),i=void 0!==e?e:a?t:void 0!==v.selectedDateElem&&oe(v.selectedDateElem)?v.selectedDateElem:void 0!==v.todayDateElem&&oe(v.todayDateElem)?v.todayDateElem:U(n>0?1:-1);void 0===i?v._input.focus():a?function(e,n){for(var t=-1===e.className.indexOf("Month")?e.dateObj.getMonth():v.currentMonth,a=n>0?v.config.showMonths:-1,i=n>0?1:-1,o=t-v.currentMonth;o!=a;o+=i)for(var r=v.daysContainer.children[o],l=t-v.currentMonth===o?e.$i+n:n<0?r.children.length-1:0,c=r.children.length,s=l;s>=0&&s<c&&s!=(n>0?c:-1);s+=i){var d=r.children[s];if(-1===d.className.indexOf("hidden")&&ie(d.dateObj)&&Math.abs(e.$i-s)>=Math.abs(n))return K(d)}v.changeMonth(i),q(U(i),0)}(i,n):K(i)}function $(e,n){for(var t=(new Date(e,n,1).getDay()-v.l10n.firstDayOfWeek+7)%7,a=v.utils.getDaysInMonth((n-1+12)%12,e),i=v.utils.getDaysInMonth(n,e),o=window.document.createDocumentFragment(),r=v.config.showMonths>1,l=r?"prevMonthDay hidden":"prevMonthDay",s=r?"nextMonthDay hidden":"nextMonthDay",d=a+1-t,u=0;d<=a;d++,u++)o.appendChild(J("flatpickr-day "+l,new Date(e,n-1,d),0,u));for(d=1;d<=i;d++,u++)o.appendChild(J("flatpickr-day",new Date(e,n,d),0,u));for(var f=i+1;f<=42-t&&(1===v.config.showMonths||u%7!=0);f++,u++)o.appendChild(J("flatpickr-day "+s,new Date(e,n+1,f%i),0,u));var m=c("div","dayContainer");return m.appendChild(o),m}function V(){if(void 0!==v.daysContainer){s(v.daysContainer),v.weekNumbers&&s(v.weekNumbers);for(var e=document.createDocumentFragment(),n=0;n<v.config.showMonths;n++){var t=new Date(v.currentYear,v.currentMonth,1);t.setMonth(v.currentMonth+n),e.appendChild($(t.getFullYear(),t.getMonth()))}v.daysContainer.appendChild(e),v.days=v.daysContainer.firstChild,"range"===v.config.mode&&1===v.selectedDates.length&&ce()}}function z(){if(!(v.config.showMonths>1||"dropdown"!==v.config.monthSelectorType)){var e=function(e){return!(void 0!==v.config.minDate&&v.currentYear===v.config.minDate.getFullYear()&&e<v.config.minDate.getMonth())&&!(void 0!==v.config.maxDate&&v.currentYear===v.config.maxDate.getFullYear()&&e>v.config.maxDate.getMonth())};v.monthsDropdownContainer.tabIndex=-1,v.monthsDropdownContainer.innerHTML="";for(var n=0;n<12;n++)if(e(n)){var t=c("option","flatpickr-monthDropdown-month");t.value=new Date(v.currentYear,n).getMonth().toString(),t.textContent=g(n,v.config.shorthandCurrentMonth,v.l10n),t.tabIndex=-1,v.currentMonth===n&&(t.selected=!0),v.monthsDropdownContainer.appendChild(t)}}}function G(){var e,n=c("div","flatpickr-month"),t=window.document.createDocumentFragment();v.config.showMonths>1||"static"===v.config.monthSelectorType?e=c("span","cur-month"):(v.monthsDropdownContainer=c("select","flatpickr-monthDropdown-months"),v.monthsDropdownContainer.setAttribute("aria-label",v.l10n.monthAriaLabel),H(v.monthsDropdownContainer,"change",(function(e){var n=f(e),t=parseInt(n.value,10);v.changeMonth(t-v.currentMonth),Ce("onMonthChange")})),z(),e=v.monthsDropdownContainer);var a=u("cur-year",{tabindex:"-1"}),i=a.getElementsByTagName("input")[0];i.setAttribute("aria-label",v.l10n.yearAriaLabel),v.config.minDate&&i.setAttribute("min",v.config.minDate.getFullYear().toString()),v.config.maxDate&&(i.setAttribute("max",v.config.maxDate.getFullYear().toString()),i.disabled=!!v.config.minDate&&v.config.minDate.getFullYear()===v.config.maxDate.getFullYear());var o=c("div","flatpickr-current-month");return o.appendChild(e),o.appendChild(a),t.appendChild(o),n.appendChild(t),{container:n,yearElement:i,monthElement:e}}function Z(){s(v.monthNav),v.monthNav.appendChild(v.prevMonthNav),v.config.showMonths&&(v.yearElements=[],v.monthElements=[]);for(var e=v.config.showMonths;e--;){var n=G();v.yearElements.push(n.yearElement),v.monthElements.push(n.monthElement),v.monthNav.appendChild(n.container)}v.monthNav.appendChild(v.nextMonthNav)}function Q(){v.weekdayContainer?s(v.weekdayContainer):v.weekdayContainer=c("div","flatpickr-weekdays");for(var e=v.config.showMonths;e--;){var n=c("div","flatpickr-weekdaycontainer");v.weekdayContainer.appendChild(n)}return X(),v.weekdayContainer}function X(){if(v.weekdayContainer){var e=v.l10n.firstDayOfWeek,n=T(v.l10n.weekdays.shorthand);e>0&&e<n.length&&(n=T(n.splice(e,n.length),n.splice(0,e)));for(var t=v.config.showMonths;t--;)v.weekdayContainer.children[t].innerHTML="\n <span class='flatpickr-weekday'>\n "+n.join("</span><span class='flatpickr-weekday'>")+"\n </span>\n "}}function ee(e,n){void 0===n&&(n=!0);var t=n?e:e-v.currentMonth;t<0&&!0===v._hidePrevMonthArrow||t>0&&!0===v._hideNextMonthArrow||(v.currentMonth+=t,(v.currentMonth<0||v.currentMonth>11)&&(v.currentYear+=v.currentMonth>11?1:-1,v.currentMonth=(v.currentMonth+12)%12,Ce("onYearChange"),z()),V(),Ce("onMonthChange"),xe())}function ne(e){return v.calendarContainer.contains(e)}function te(e){if(v.isOpen&&!v.config.inline){var n=f(e),t=ne(n),a=!(n===v.input||n===v.altInput||v.element.contains(n)||e.path&&e.path.indexOf&&(~e.path.indexOf(v.input)||~e.path.indexOf(v.altInput)))&&!t&&!ne(e.relatedTarget),i=!v.config.ignoredFocusElements.some((function(e){return e.contains(n)}));a&&i&&(v.config.allowInput&&v.setDate(v._input.value,!1,v.config.altInput?v.config.altFormat:v.config.dateFormat),void 0!==v.timeContainer&&void 0!==v.minuteElement&&void 0!==v.hourElement&&""!==v.input.value&&void 0!==v.input.value&&A(),v.close(),v.config&&"range"===v.config.mode&&1===v.selectedDates.length&&v.clear(!1))}}function ae(e){if(!(!e||v.config.minDate&&e<v.config.minDate.getFullYear()||v.config.maxDate&&e>v.config.maxDate.getFullYear())){var n=e,t=v.currentYear!==n;v.currentYear=n||v.currentYear,v.config.maxDate&&v.currentYear===v.config.maxDate.getFullYear()?v.currentMonth=Math.min(v.config.maxDate.getMonth(),v.currentMonth):v.config.minDate&&v.currentYear===v.config.minDate.getFullYear()&&(v.currentMonth=Math.max(v.config.minDate.getMonth(),v.currentMonth)),t&&(v.redraw(),Ce("onYearChange"),z())}}function ie(e,n){var t;void 0===n&&(n=!0);var a=v.parseDate(e,void 0,n);if(v.config.minDate&&a&&b(a,v.config.minDate,void 0!==n?n:!v.minDateHasTime)<0||v.config.maxDate&&a&&b(a,v.config.maxDate,void 0!==n?n:!v.maxDateHasTime)>0)return!1;if(!v.config.enable&&0===v.config.disable.length)return!0;if(void 0===a)return!1;for(var i=!!v.config.enable,o=null!==(t=v.config.enable)&&void 0!==t?t:v.config.disable,r=0,l=void 0;r<o.length;r++){if("function"==typeof(l=o[r])&&l(a))return i;if(l instanceof Date&&void 0!==a&&l.getTime()===a.getTime())return i;if("string"==typeof l){var c=v.parseDate(l,void 0,!0);return c&&c.getTime()===a.getTime()?i:!i}if("object"==typeof l&&void 0!==a&&l.from&&l.to&&a.getTime()>=l.from.getTime()&&a.getTime()<=l.to.getTime())return i}return!i}function oe(e){return void 0!==v.daysContainer&&(-1===e.className.indexOf("hidden")&&-1===e.className.indexOf("flatpickr-disabled")&&v.daysContainer.contains(e))}function re(e){var n=e.target===v._input,t=v._input.value.trimEnd()!==Ee();!n||!t||e.relatedTarget&&ne(e.relatedTarget)||v.setDate(v._input.value,!0,e.target===v.altInput?v.config.altFormat:v.config.dateFormat)}function le(e){var n=f(e),t=v.config.wrap?m.contains(n):n===v._input,a=v.config.allowInput,i=v.isOpen&&(!a||!t),o=v.config.inline&&t&&!a;if(13===e.keyCode&&t){if(a)return v.setDate(v._input.value,!0,n===v.altInput?v.config.altFormat:v.config.dateFormat),v.close(),n.blur();v.open()}else if(ne(n)||i||o){var r=!!v.timeContainer&&v.timeContainer.contains(n);switch(e.keyCode){case 13:r?(e.preventDefault(),A(),pe()):he(e);break;case 27:e.preventDefault(),pe();break;case 8:case 46:t&&!v.config.allowInput&&(e.preventDefault(),v.clear());break;case 37:case 39:if(r||t)v.hourElement&&v.hourElement.focus();else{e.preventDefault();var l=S();if(void 0!==v.daysContainer&&(!1===a||l&&oe(l))){var c=39===e.keyCode?1:-1;e.ctrlKey?(e.stopPropagation(),ee(c),q(U(1),0)):q(void 0,c)}}break;case 38:case 40:e.preventDefault();var s=40===e.keyCode?1:-1;v.daysContainer&&void 0!==n.$i||n===v.input||n===v.altInput?e.ctrlKey?(e.stopPropagation(),ae(v.currentYear-s),q(U(1),0)):r||q(void 0,7*s):n===v.currentYearElement?ae(v.currentYear-s):v.config.enableTime&&(!r&&v.hourElement&&v.hourElement.focus(),A(e),v._debouncedChange());break;case 9:if(r){var d=[v.hourElement,v.minuteElement,v.secondElement,v.amPM].concat(v.pluginElements).filter((function(e){return e})),u=d.indexOf(n);if(-1!==u){var g=d[u+(e.shiftKey?-1:1)];e.preventDefault(),(g||v._input).focus()}}else!v.config.noCalendar&&v.daysContainer&&v.daysContainer.contains(n)&&e.shiftKey&&(e.preventDefault(),v._input.focus())}}if(void 0!==v.amPM&&n===v.amPM)switch(e.key){case v.l10n.amPM[0].charAt(0):case v.l10n.amPM[0].charAt(0).toLowerCase():v.amPM.textContent=v.l10n.amPM[0],N(),ke();break;case v.l10n.amPM[1].charAt(0):case v.l10n.amPM[1].charAt(0).toLowerCase():v.amPM.textContent=v.l10n.amPM[1],N(),ke()}(t||ne(n))&&Ce("onKeyDown",e)}function ce(e,n){if(void 0===n&&(n="flatpickr-day"),1===v.selectedDates.length&&(!e||e.classList.contains(n)&&!e.classList.contains("flatpickr-disabled"))){for(var t=e?e.dateObj.getTime():v.days.firstElementChild.dateObj.getTime(),a=v.parseDate(v.selectedDates[0],void 0,!0).getTime(),i=Math.min(t,v.selectedDates[0].getTime()),o=Math.max(t,v.selectedDates[0].getTime()),r=!1,l=0,c=0,s=i;s<o;s+=x.DAY)ie(new Date(s),!0)||(r=r||s>i&&s<o,s<a&&(!l||s>l)?l=s:s>a&&(!c||s<c)&&(c=s));Array.from(v.rContainer.querySelectorAll("*:nth-child(-n+"+v.config.showMonths+") > ."+n)).forEach((function(n){var i=n.dateObj.getTime(),o=l>0&&i<l||c>0&&i>c;if(o)return n.classList.add("notAllowed"),void["inRange","startRange","endRange"].forEach((function(e){n.classList.remove(e)}));r&&!o||(["startRange","inRange","endRange","notAllowed"].forEach((function(e){n.classList.remove(e)})),void 0!==e&&(e.classList.add(t<=v.selectedDates[0].getTime()?"startRange":"endRange"),a<t&&i===a?n.classList.add("startRange"):a>t&&i===a&&n.classList.add("endRange"),i>=l&&(0===c||i<=c)&&C(i,a,t)&&n.classList.add("inRange")))}))}}function se(){!v.isOpen||v.config.static||v.config.inline||me()}function de(e){return function(n){var t=v.config["_"+e+"Date"]=v.parseDate(n,v.config.dateFormat),a=v.config["_"+("min"===e?"max":"min")+"Date"];void 0!==t&&(v["min"===e?"minDateHasTime":"maxDateHasTime"]=t.getHours()>0||t.getMinutes()>0||t.getSeconds()>0),v.selectedDates&&(v.selectedDates=v.selectedDates.filter((function(e){return ie(e)})),v.selectedDates.length||"min"!==e||P(t),ke()),v.daysContainer&&(ge(),void 0!==t?v.currentYearElement[e]=t.getFullYear().toString():v.currentYearElement.removeAttribute(e),v.currentYearElement.disabled=!!a&&void 0!==t&&a.getFullYear()===t.getFullYear())}}function ue(){return v.config.wrap?m.querySelector("[data-input]"):m}function fe(){"object"!=typeof v.config.locale&&void 0===O.l10ns[v.config.locale]&&v.config.errorHandler(new Error("flatpickr: invalid locale "+v.config.locale)),v.l10n=k(k({},O.l10ns.default),"object"==typeof v.config.locale?v.config.locale:"default"!==v.config.locale?O.l10ns[v.config.locale]:void 0),h.D="("+v.l10n.weekdays.shorthand.join("|")+")",h.l="("+v.l10n.weekdays.longhand.join("|")+")",h.M="("+v.l10n.months.shorthand.join("|")+")",h.F="("+v.l10n.months.longhand.join("|")+")",h.K="("+v.l10n.amPM[0]+"|"+v.l10n.amPM[1]+"|"+v.l10n.amPM[0].toLowerCase()+"|"+v.l10n.amPM[1].toLowerCase()+")",void 0===k(k({},p),JSON.parse(JSON.stringify(m.dataset||{}))).time_24hr&&void 0===O.defaultConfig.time_24hr&&(v.config.time_24hr=v.l10n.time_24hr),v.formatDate=D(v),v.parseDate=w({config:v.config,l10n:v.l10n})}function me(e){if("function"!=typeof v.config.position){if(void 0!==v.calendarContainer){Ce("onPreCalendarPosition");var n=e||v._positionElement,t=Array.prototype.reduce.call(v.calendarContainer.children,(function(e,n){return e+n.offsetHeight}),0),a=v.calendarContainer.offsetWidth,i=v.config.position.split(" "),o=i[0],r=i.length>1?i[1]:null,c=n.getBoundingClientRect(),s=window.innerHeight-c.bottom,d="above"===o||"below"!==o&&s<t&&c.top>t,u=window.pageYOffset+c.top+(d?-t-2:n.offsetHeight+2);if(l(v.calendarContainer,"arrowTop",!d),l(v.calendarContainer,"arrowBottom",d),!v.config.inline){var f=window.pageXOffset+c.left,m=!1,g=!1;"center"===r?(f-=(a-c.width)/2,m=!0):"right"===r&&(f-=a-c.width,g=!0),l(v.calendarContainer,"arrowLeft",!m&&!g),l(v.calendarContainer,"arrowCenter",m),l(v.calendarContainer,"arrowRight",g);var p=window.document.body.offsetWidth-(window.pageXOffset+c.right),h=f+a>window.document.body.offsetWidth,D=p+a>window.document.body.offsetWidth;if(l(v.calendarContainer,"rightMost",h),!v.config.static)if(v.calendarContainer.style.top=u+"px",h)if(D){var w=function(){for(var e=null,n=0;n<document.styleSheets.length;n++){var t=document.styleSheets[n];if(t.cssRules){try{t.cssRules}catch(e){continue}e=t;break}}return null!=e?e:(a=document.createElement("style"),document.head.appendChild(a),a.sheet);var a}();if(void 0===w)return;var b=window.document.body.offsetWidth,C=Math.max(0,b/2-a/2),M=w.cssRules.length,y="{left:"+c.left+"px;right:auto;}";l(v.calendarContainer,"rightMost",!1),l(v.calendarContainer,"centerMost",!0),w.insertRule(".flatpickr-calendar.centerMost:before,.flatpickr-calendar.centerMost:after"+y,M),v.calendarContainer.style.left=C+"px",v.calendarContainer.style.right="auto"}else v.calendarContainer.style.left="auto",v.calendarContainer.style.right=p+"px";else v.calendarContainer.style.left=f+"px",v.calendarContainer.style.right="auto"}}}else v.config.position(v,e)}function ge(){v.config.noCalendar||v.isMobile||(z(),xe(),V())}function pe(){v._input.focus(),-1!==window.navigator.userAgent.indexOf("MSIE")||void 0!==navigator.msMaxTouchPoints?setTimeout(v.close,0):v.close()}function he(e){e.preventDefault(),e.stopPropagation();var n=d(f(e),(function(e){return e.classList&&e.classList.contains("flatpickr-day")&&!e.classList.contains("flatpickr-disabled")&&!e.classList.contains("notAllowed")}));if(void 0!==n){var t=n,a=v.latestSelectedDateObj=new Date(t.dateObj.getTime()),i=(a.getMonth()<v.currentMonth||a.getMonth()>v.currentMonth+v.config.showMonths-1)&&"range"!==v.config.mode;if(v.selectedDateElem=t,"single"===v.config.mode)v.selectedDates=[a];else if("multiple"===v.config.mode){var o=ye(a);o?v.selectedDates.splice(parseInt(o),1):v.selectedDates.push(a)}else"range"===v.config.mode&&(2===v.selectedDates.length&&v.clear(!1,!1),v.latestSelectedDateObj=a,v.selectedDates.push(a),0!==b(a,v.selectedDates[0],!0)&&v.selectedDates.sort((function(e,n){return e.getTime()-n.getTime()})));if(N(),i){var r=v.currentYear!==a.getFullYear();v.currentYear=a.getFullYear(),v.currentMonth=a.getMonth(),r&&(Ce("onYearChange"),z()),Ce("onMonthChange")}if(xe(),V(),ke(),i||"range"===v.config.mode||1!==v.config.showMonths?void 0!==v.selectedDateElem&&void 0===v.hourElement&&v.selectedDateElem&&v.selectedDateElem.focus():K(t),void 0!==v.hourElement&&void 0!==v.hourElement&&v.hourElement.focus(),v.config.closeOnSelect){var l="single"===v.config.mode&&!v.config.enableTime,c="range"===v.config.mode&&2===v.selectedDates.length&&!v.config.enableTime;(l||c)&&pe()}L()}}v.parseDate=w({config:v.config,l10n:v.l10n}),v._handlers=[],v.pluginElements=[],v.loadedPlugins=[],v._bind=H,v._setHoursFromDate=P,v._positionCalendar=me,v.changeMonth=ee,v.changeYear=ae,v.clear=function(e,n){void 0===e&&(e=!0);void 0===n&&(n=!0);v.input.value="",void 0!==v.altInput&&(v.altInput.value="");void 0!==v.mobileInput&&(v.mobileInput.value="");v.selectedDates=[],v.latestSelectedDateObj=void 0,!0===n&&(v.currentYear=v._initialDate.getFullYear(),v.currentMonth=v._initialDate.getMonth());if(!0===v.config.enableTime){var t=E(v.config);Y(t.hours,t.minutes,t.seconds)}v.redraw(),e&&Ce("onChange")},v.close=function(){v.isOpen=!1,v.isMobile||(void 0!==v.calendarContainer&&v.calendarContainer.classList.remove("open"),void 0!==v._input&&v._input.classList.remove("active"));Ce("onClose")},v.onMouseOver=ce,v._createElement=c,v.createDay=J,v.destroy=function(){void 0!==v.config&&Ce("onDestroy");for(var e=v._handlers.length;e--;)v._handlers[e].remove();if(v._handlers=[],v.mobileInput)v.mobileInput.parentNode&&v.mobileInput.parentNode.removeChild(v.mobileInput),v.mobileInput=void 0;else if(v.calendarContainer&&v.calendarContainer.parentNode)if(v.config.static&&v.calendarContainer.parentNode){var n=v.calendarContainer.parentNode;if(n.lastChild&&n.removeChild(n.lastChild),n.parentNode){for(;n.firstChild;)n.parentNode.insertBefore(n.firstChild,n);n.parentNode.removeChild(n)}}else v.calendarContainer.parentNode.removeChild(v.calendarContainer);v.altInput&&(v.input.type="text",v.altInput.parentNode&&v.altInput.parentNode.removeChild(v.altInput),delete v.altInput);v.input&&(v.input.type=v.input._type,v.input.classList.remove("flatpickr-input"),v.input.removeAttribute("readonly"));["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach((function(e){try{delete v[e]}catch(e){}}))},v.isEnabled=ie,v.jumpToDate=R,v.updateValue=ke,v.open=function(e,n){void 0===n&&(n=v._positionElement);if(!0===v.isMobile){if(e){e.preventDefault();var t=f(e);t&&t.blur()}return void 0!==v.mobileInput&&(v.mobileInput.focus(),v.mobileInput.click()),void Ce("onOpen")}if(v._input.disabled||v.config.inline)return;var a=v.isOpen;v.isOpen=!0,a||(v.calendarContainer.classList.add("open"),v._input.classList.add("active"),Ce("onOpen"),me(n));!0===v.config.enableTime&&!0===v.config.noCalendar&&(!1!==v.config.allowInput||void 0!==e&&v.timeContainer.contains(e.relatedTarget)||setTimeout((function(){return v.hourElement.select()}),50))},v.redraw=ge,v.set=function(n,t){if(null!==n&&"object"==typeof n)for(var a in Object.assign(v.config,n),n)void 0!==ve[a]&&ve[a].forEach((function(e){return e()}));else v.config[n]=t,void 0!==ve[n]?ve[n].forEach((function(e){return e()})):e.indexOf(n)>-1&&(v.config[n]=r(t));v.redraw(),ke(!0)},v.setDate=function(e,n,t){void 0===n&&(n=!1);void 0===t&&(t=v.config.dateFormat);if(0!==e&&!e||e instanceof Array&&0===e.length)return v.clear(n);De(e,t),v.latestSelectedDateObj=v.selectedDates[v.selectedDates.length-1],v.redraw(),R(void 0,n),P(),0===v.selectedDates.length&&v.clear(!1);ke(n),n&&Ce("onChange")},v.toggle=function(e){if(!0===v.isOpen)return v.close();v.open(e)};var ve={locale:[fe,X],showMonths:[Z,F,Q],minDate:[R],maxDate:[R],positionElement:[be],clickOpens:[function(){!0===v.config.clickOpens?(H(v._input,"focus",v.open),H(v._input,"click",v.open)):(v._input.removeEventListener("focus",v.open),v._input.removeEventListener("click",v.open))}]};function De(e,n){var t=[];if(e instanceof Array)t=e.map((function(e){return v.parseDate(e,n)}));else if(e instanceof Date||"number"==typeof e)t=[v.parseDate(e,n)];else if("string"==typeof e)switch(v.config.mode){case"single":case"time":t=[v.parseDate(e,n)];break;case"multiple":t=e.split(v.config.conjunction).map((function(e){return v.parseDate(e,n)}));break;case"range":t=e.split(v.l10n.rangeSeparator).map((function(e){return v.parseDate(e,n)}))}else v.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(e)));v.selectedDates=v.config.allowInvalidPreload?t:t.filter((function(e){return e instanceof Date&&ie(e,!1)})),"range"===v.config.mode&&v.selectedDates.sort((function(e,n){return e.getTime()-n.getTime()}))}function we(e){return e.slice().map((function(e){return"string"==typeof e||"number"==typeof e||e instanceof Date?v.parseDate(e,void 0,!0):e&&"object"==typeof e&&e.from&&e.to?{from:v.parseDate(e.from,void 0),to:v.parseDate(e.to,void 0)}:e})).filter((function(e){return e}))}function be(){v._positionElement=v.config.positionElement||v._input}function Ce(e,n){if(void 0!==v.config){var t=v.config[e];if(void 0!==t&&t.length>0)for(var a=0;t[a]&&a<t.length;a++)t[a](v.selectedDates,v.input.value,v,n);"onChange"===e&&(v.input.dispatchEvent(Me("change")),v.input.dispatchEvent(Me("input")))}}function Me(e){var n=document.createEvent("Event");return n.initEvent(e,!0,!0),n}function ye(e){for(var n=0;n<v.selectedDates.length;n++){var t=v.selectedDates[n];if(t instanceof Date&&0===b(t,e))return""+n}return!1}function xe(){v.config.noCalendar||v.isMobile||!v.monthNav||(v.yearElements.forEach((function(e,n){var t=new Date(v.currentYear,v.currentMonth,1);t.setMonth(v.currentMonth+n),v.config.showMonths>1||"static"===v.config.monthSelectorType?v.monthElements[n].textContent=g(t.getMonth(),v.config.shorthandCurrentMonth,v.l10n)+" ":v.monthsDropdownContainer.value=t.getMonth().toString(),e.value=t.getFullYear().toString()})),v._hidePrevMonthArrow=void 0!==v.config.minDate&&(v.currentYear===v.config.minDate.getFullYear()?v.currentMonth<=v.config.minDate.getMonth():v.currentYear<v.config.minDate.getFullYear()),v._hideNextMonthArrow=void 0!==v.config.maxDate&&(v.currentYear===v.config.maxDate.getFullYear()?v.currentMonth+1>v.config.maxDate.getMonth():v.currentYear>v.config.maxDate.getFullYear()))}function Ee(e){var n=e||(v.config.altInput?v.config.altFormat:v.config.dateFormat);return v.selectedDates.map((function(e){return v.formatDate(e,n)})).filter((function(e,n,t){return"range"!==v.config.mode||v.config.enableTime||t.indexOf(e)===n})).join("range"!==v.config.mode?v.config.conjunction:v.l10n.rangeSeparator)}function ke(e){void 0===e&&(e=!0),void 0!==v.mobileInput&&v.mobileFormatStr&&(v.mobileInput.value=void 0!==v.latestSelectedDateObj?v.formatDate(v.latestSelectedDateObj,v.mobileFormatStr):""),v.input.value=Ee(v.config.dateFormat),void 0!==v.altInput&&(v.altInput.value=Ee(v.config.altFormat)),!1!==e&&Ce("onValueUpdate")}function Te(e){var n=f(e),t=v.prevMonthNav.contains(n),a=v.nextMonthNav.contains(n);t||a?ee(t?-1:1):v.yearElements.indexOf(n)>=0?n.select():n.classList.contains("arrowUp")?v.changeYear(v.currentYear+1):n.classList.contains("arrowDown")&&v.changeYear(v.currentYear-1)}return function(){v.element=v.input=m,v.isOpen=!1,function(){var t=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],a=k(k({},JSON.parse(JSON.stringify(m.dataset||{}))),p),i={};v.config.parseDate=a.parseDate,v.config.formatDate=a.formatDate,Object.defineProperty(v.config,"enable",{get:function(){return v.config._enable},set:function(e){v.config._enable=we(e)}}),Object.defineProperty(v.config,"disable",{get:function(){return v.config._disable},set:function(e){v.config._disable=we(e)}});var o="time"===a.mode;if(!a.dateFormat&&(a.enableTime||o)){var l=O.defaultConfig.dateFormat||n.dateFormat;i.dateFormat=a.noCalendar||o?"H:i"+(a.enableSeconds?":S":""):l+" H:i"+(a.enableSeconds?":S":"")}if(a.altInput&&(a.enableTime||o)&&!a.altFormat){var c=O.defaultConfig.altFormat||n.altFormat;i.altFormat=a.noCalendar||o?"h:i"+(a.enableSeconds?":S K":" K"):c+" h:i"+(a.enableSeconds?":S":"")+" K"}Object.defineProperty(v.config,"minDate",{get:function(){return v.config._minDate},set:de("min")}),Object.defineProperty(v.config,"maxDate",{get:function(){return v.config._maxDate},set:de("max")});var s=function(e){return function(n){v.config["min"===e?"_minTime":"_maxTime"]=v.parseDate(n,"H:i:S")}};Object.defineProperty(v.config,"minTime",{get:function(){return v.config._minTime},set:s("min")}),Object.defineProperty(v.config,"maxTime",{get:function(){return v.config._maxTime},set:s("max")}),"time"===a.mode&&(v.config.noCalendar=!0,v.config.enableTime=!0);Object.assign(v.config,i,a);for(var d=0;d<t.length;d++)v.config[t[d]]=!0===v.config[t[d]]||"true"===v.config[t[d]];e.filter((function(e){return void 0!==v.config[e]})).forEach((function(e){v.config[e]=r(v.config[e]||[]).map(_)})),v.isMobile=!v.config.disableMobile&&!v.config.inline&&"single"===v.config.mode&&!v.config.disable.length&&!v.config.enable&&!v.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(d=0;d<v.config.plugins.length;d++){var u=v.config.plugins[d](v)||{};for(var f in u)e.indexOf(f)>-1?v.config[f]=r(u[f]).map(_).concat(v.config[f]):void 0===a[f]&&(v.config[f]=u[f])}a.altInputClass||(v.config.altInputClass=ue().className+" "+v.config.altInputClass);Ce("onParseConfig")}(),fe(),function(){if(v.input=ue(),!v.input)return void v.config.errorHandler(new Error("Invalid input element specified"));v.input._type=v.input.type,v.input.type="text",v.input.classList.add("flatpickr-input"),v._input=v.input,v.config.altInput&&(v.altInput=c(v.input.nodeName,v.config.altInputClass),v._input=v.altInput,v.altInput.placeholder=v.input.placeholder,v.altInput.disabled=v.input.disabled,v.altInput.required=v.input.required,v.altInput.tabIndex=v.input.tabIndex,v.altInput.type="text",v.input.setAttribute("type","hidden"),!v.config.static&&v.input.parentNode&&v.input.parentNode.insertBefore(v.altInput,v.input.nextSibling));v.config.allowInput||v._input.setAttribute("readonly","readonly");be()}(),function(){v.selectedDates=[],v.now=v.parseDate(v.config.now)||new Date;var e=v.config.defaultDate||("INPUT"!==v.input.nodeName&&"TEXTAREA"!==v.input.nodeName||!v.input.placeholder||v.input.value!==v.input.placeholder?v.input.value:null);e&&De(e,v.config.dateFormat);v._initialDate=v.selectedDates.length>0?v.selectedDates[0]:v.config.minDate&&v.config.minDate.getTime()>v.now.getTime()?v.config.minDate:v.config.maxDate&&v.config.maxDate.getTime()<v.now.getTime()?v.config.maxDate:v.now,v.currentYear=v._initialDate.getFullYear(),v.currentMonth=v._initialDate.getMonth(),v.selectedDates.length>0&&(v.latestSelectedDateObj=v.selectedDates[0]);void 0!==v.config.minTime&&(v.config.minTime=v.parseDate(v.config.minTime,"H:i"));void 0!==v.config.maxTime&&(v.config.maxTime=v.parseDate(v.config.maxTime,"H:i"));v.minDateHasTime=!!v.config.minDate&&(v.config.minDate.getHours()>0||v.config.minDate.getMinutes()>0||v.config.minDate.getSeconds()>0),v.maxDateHasTime=!!v.config.maxDate&&(v.config.maxDate.getHours()>0||v.config.maxDate.getMinutes()>0||v.config.maxDate.getSeconds()>0)}(),v.utils={getDaysInMonth:function(e,n){return void 0===e&&(e=v.currentMonth),void 0===n&&(n=v.currentYear),1===e&&(n%4==0&&n%100!=0||n%400==0)?29:v.l10n.daysInMonth[e]}},v.isMobile||function(){var e=window.document.createDocumentFragment();if(v.calendarContainer=c("div","flatpickr-calendar"),v.calendarContainer.tabIndex=-1,!v.config.noCalendar){if(e.appendChild((v.monthNav=c("div","flatpickr-months"),v.yearElements=[],v.monthElements=[],v.prevMonthNav=c("span","flatpickr-prev-month"),v.prevMonthNav.innerHTML=v.config.prevArrow,v.nextMonthNav=c("span","flatpickr-next-month"),v.nextMonthNav.innerHTML=v.config.nextArrow,Z(),Object.defineProperty(v,"_hidePrevMonthArrow",{get:function(){return v.__hidePrevMonthArrow},set:function(e){v.__hidePrevMonthArrow!==e&&(l(v.prevMonthNav,"flatpickr-disabled",e),v.__hidePrevMonthArrow=e)}}),Object.defineProperty(v,"_hideNextMonthArrow",{get:function(){return v.__hideNextMonthArrow},set:function(e){v.__hideNextMonthArrow!==e&&(l(v.nextMonthNav,"flatpickr-disabled",e),v.__hideNextMonthArrow=e)}}),v.currentYearElement=v.yearElements[0],xe(),v.monthNav)),v.innerContainer=c("div","flatpickr-innerContainer"),v.config.weekNumbers){var n=function(){v.calendarContainer.classList.add("hasWeeks");var e=c("div","flatpickr-weekwrapper");e.appendChild(c("span","flatpickr-weekday",v.l10n.weekAbbreviation));var n=c("div","flatpickr-weeks");return e.appendChild(n),{weekWrapper:e,weekNumbers:n}}(),t=n.weekWrapper,o=n.weekNumbers;v.innerContainer.appendChild(t),v.weekNumbers=o,v.weekWrapper=t}v.rContainer=c("div","flatpickr-rContainer"),v.rContainer.appendChild(Q()),v.daysContainer||(v.daysContainer=c("div","flatpickr-days"),v.daysContainer.tabIndex=-1),V(),v.rContainer.appendChild(v.daysContainer),v.innerContainer.appendChild(v.rContainer),e.appendChild(v.innerContainer)}v.config.enableTime&&e.appendChild(function(){v.calendarContainer.classList.add("hasTime"),v.config.noCalendar&&v.calendarContainer.classList.add("noCalendar");var e=E(v.config);v.timeContainer=c("div","flatpickr-time"),v.timeContainer.tabIndex=-1;var n=c("span","flatpickr-time-separator",":"),t=u("flatpickr-hour",{"aria-label":v.l10n.hourAriaLabel});v.hourElement=t.getElementsByTagName("input")[0];var o=u("flatpickr-minute",{"aria-label":v.l10n.minuteAriaLabel});v.minuteElement=o.getElementsByTagName("input")[0],v.hourElement.tabIndex=v.minuteElement.tabIndex=-1,v.hourElement.value=a(v.latestSelectedDateObj?v.latestSelectedDateObj.getHours():v.config.time_24hr?e.hours:function(e){switch(e%24){case 0:case 12:return 12;default:return e%12}}(e.hours)),v.minuteElement.value=a(v.latestSelectedDateObj?v.latestSelectedDateObj.getMinutes():e.minutes),v.hourElement.setAttribute("step",v.config.hourIncrement.toString()),v.minuteElement.setAttribute("step",v.config.minuteIncrement.toString()),v.hourElement.setAttribute("min",v.config.time_24hr?"0":"1"),v.hourElement.setAttribute("max",v.config.time_24hr?"23":"12"),v.hourElement.setAttribute("maxlength","2"),v.minuteElement.setAttribute("min","0"),v.minuteElement.setAttribute("max","59"),v.minuteElement.setAttribute("maxlength","2"),v.timeContainer.appendChild(t),v.timeContainer.appendChild(n),v.timeContainer.appendChild(o),v.config.time_24hr&&v.timeContainer.classList.add("time24hr");if(v.config.enableSeconds){v.timeContainer.classList.add("hasSeconds");var r=u("flatpickr-second");v.secondElement=r.getElementsByTagName("input")[0],v.secondElement.value=a(v.latestSelectedDateObj?v.latestSelectedDateObj.getSeconds():e.seconds),v.secondElement.setAttribute("step",v.minuteElement.getAttribute("step")),v.secondElement.setAttribute("min","0"),v.secondElement.setAttribute("max","59"),v.secondElement.setAttribute("maxlength","2"),v.timeContainer.appendChild(c("span","flatpickr-time-separator",":")),v.timeContainer.appendChild(r)}v.config.time_24hr||(v.amPM=c("span","flatpickr-am-pm",v.l10n.amPM[i((v.latestSelectedDateObj?v.hourElement.value:v.config.defaultHour)>11)]),v.amPM.title=v.l10n.toggleTitle,v.amPM.tabIndex=-1,v.timeContainer.appendChild(v.amPM));return v.timeContainer}());l(v.calendarContainer,"rangeMode","range"===v.config.mode),l(v.calendarContainer,"animate",!0===v.config.animate),l(v.calendarContainer,"multiMonth",v.config.showMonths>1),v.calendarContainer.appendChild(e);var r=void 0!==v.config.appendTo&&void 0!==v.config.appendTo.nodeType;if((v.config.inline||v.config.static)&&(v.calendarContainer.classList.add(v.config.inline?"inline":"static"),v.config.inline&&(!r&&v.element.parentNode?v.element.parentNode.insertBefore(v.calendarContainer,v._input.nextSibling):void 0!==v.config.appendTo&&v.config.appendTo.appendChild(v.calendarContainer)),v.config.static)){var s=c("div","flatpickr-wrapper");v.element.parentNode&&v.element.parentNode.insertBefore(s,v.element),s.appendChild(v.element),v.altInput&&s.appendChild(v.altInput),s.appendChild(v.calendarContainer)}v.config.static||v.config.inline||(void 0!==v.config.appendTo?v.config.appendTo:window.document.body).appendChild(v.calendarContainer)}(),function(){v.config.wrap&&["open","close","toggle","clear"].forEach((function(e){Array.prototype.forEach.call(v.element.querySelectorAll("[data-"+e+"]"),(function(n){return H(n,"click",v[e])}))}));if(v.isMobile)return void function(){var e=v.config.enableTime?v.config.noCalendar?"time":"datetime-local":"date";v.mobileInput=c("input",v.input.className+" flatpickr-mobile"),v.mobileInput.tabIndex=1,v.mobileInput.type=e,v.mobileInput.disabled=v.input.disabled,v.mobileInput.required=v.input.required,v.mobileInput.placeholder=v.input.placeholder,v.mobileFormatStr="datetime-local"===e?"Y-m-d\\TH:i:S":"date"===e?"Y-m-d":"H:i:S",v.selectedDates.length>0&&(v.mobileInput.defaultValue=v.mobileInput.value=v.formatDate(v.selectedDates[0],v.mobileFormatStr));v.config.minDate&&(v.mobileInput.min=v.formatDate(v.config.minDate,"Y-m-d"));v.config.maxDate&&(v.mobileInput.max=v.formatDate(v.config.maxDate,"Y-m-d"));v.input.getAttribute("step")&&(v.mobileInput.step=String(v.input.getAttribute("step")));v.input.type="hidden",void 0!==v.altInput&&(v.altInput.type="hidden");try{v.input.parentNode&&v.input.parentNode.insertBefore(v.mobileInput,v.input.nextSibling)}catch(e){}H(v.mobileInput,"change",(function(e){v.setDate(f(e).value,!1,v.mobileFormatStr),Ce("onChange"),Ce("onClose")}))}();var e=o(se,50);v._debouncedChange=o(L,I),v.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&H(v.daysContainer,"mouseover",(function(e){"range"===v.config.mode&&ce(f(e))}));H(v._input,"keydown",le),void 0!==v.calendarContainer&&H(v.calendarContainer,"keydown",le);v.config.inline||v.config.static||H(window,"resize",e);void 0!==window.ontouchstart?H(window.document,"touchstart",te):H(window.document,"mousedown",te);H(window.document,"focus",te,{capture:!0}),!0===v.config.clickOpens&&(H(v._input,"focus",v.open),H(v._input,"click",v.open));void 0!==v.daysContainer&&(H(v.monthNav,"click",Te),H(v.monthNav,["keyup","increment"],j),H(v.daysContainer,"click",he));if(void 0!==v.timeContainer&&void 0!==v.minuteElement&&void 0!==v.hourElement){var n=function(e){return f(e).select()};H(v.timeContainer,["increment"],A),H(v.timeContainer,"blur",A,{capture:!0}),H(v.timeContainer,"click",W),H([v.hourElement,v.minuteElement],["focus","click"],n),void 0!==v.secondElement&&H(v.secondElement,"focus",(function(){return v.secondElement&&v.secondElement.select()})),void 0!==v.amPM&&H(v.amPM,"click",(function(e){A(e)}))}v.config.allowInput&&H(v._input,"blur",re)}(),(v.selectedDates.length||v.config.noCalendar)&&(v.config.enableTime&&P(v.config.noCalendar?v.latestSelectedDateObj:void 0),ke(!1)),F();var t=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!v.isMobile&&t&&me(),Ce("onReady")}(),v}function _(e,n){for(var t=Array.prototype.slice.call(e).filter((function(e){return e instanceof HTMLElement})),a=[],i=0;i<t.length;i++){var o=t[i];try{if(null!==o.getAttribute("data-fp-omit"))continue;void 0!==o._flatpickr&&(o._flatpickr.destroy(),o._flatpickr=void 0),o._flatpickr=S(o,n||{}),a.push(o._flatpickr)}catch(e){console.error(e)}}return 1===a.length?a[0]:a}"undefined"!=typeof HTMLElement&&"undefined"!=typeof HTMLCollection&&"undefined"!=typeof NodeList&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(e){return _(this,e)},HTMLElement.prototype.flatpickr=function(e){return _([this],e)});var O=function(e,n){return"string"==typeof e?_(window.document.querySelectorAll(e),n):e instanceof Node?_([e],n):_(e,n)};O.defaultConfig={},O.l10ns={en:k({},t),default:k({},t)},O.localize=function(e){O.l10ns.default=k(k({},O.l10ns.default),e)},O.setDefaults=function(e){O.defaultConfig=k(k({},O.defaultConfig),e)},O.parseDate=w({}),O.formatDate=D({}),O.compareDates=b,"undefined"!=typeof jQuery&&void 0!==jQuery.fn&&(jQuery.fn.flatpickr=function(e){return _(this,e)}),Date.prototype.fp_incr=function(e){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+("string"==typeof e?parseInt(e,10):e))},"undefined"!=typeof window&&(window.flatpickr=O);export{O as default};
1
+ var e=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],n={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:"object"==typeof window&&-1===window.navigator.userAgent.indexOf("MSIE"),ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(e){return"undefined"!=typeof console&&console.warn(e)},getWeek:function(e){var n=new Date(e.getTime());n.setHours(0,0,0,0),n.setDate(n.getDate()+3-(n.getDay()+6)%7);var t=new Date(n.getFullYear(),0,4);return 1+Math.round(((n.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},t={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(e){var n=e%100;if(n>3&&n<21)return"th";switch(n%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},a=function(e,n){return void 0===n&&(n=2),("000"+e).slice(-1*n)},i=function(e){return!0===e?1:0};function o(e,n){var t;return function(){var a=this,i=arguments;clearTimeout(t),t=setTimeout(function(){return e.apply(a,i)},n)}}var r=function(e){return e instanceof Array?e:[e]};function l(e,n,t){if(!0===t)return e.classList.add(n);e.classList.remove(n)}function c(e,n,t){var a=window.document.createElement(e);return n=n||"",t=t||"",a.className=n,void 0!==t&&(a.textContent=t),a}function s(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function d(e,n){return n(e)?e:e.parentNode?d(e.parentNode,n):void 0}function u(e,n){var t=c("div","numInputWrapper"),a=c("input","numInput "+e),i=c("span","arrowUp"),o=c("span","arrowDown");if(-1===navigator.userAgent.indexOf("MSIE 9.0")?a.type="number":(a.type="text",a.pattern="\\d*"),void 0!==n)for(var r in n)a.setAttribute(r,n[r]);return t.appendChild(a),t.appendChild(i),t.appendChild(o),t}function f(e){try{return"function"==typeof e.composedPath?e.composedPath()[0]:e.target}catch(n){return e.target}}var m=function(){},g=function(e,n,t){return t.months[n?"shorthand":"longhand"][e]},p={D:m,F:function(e,n,t){e.setMonth(t.months.longhand.indexOf(n))},G:function(e,n){e.setHours((e.getHours()>=12?12:0)+parseFloat(n))},H:function(e,n){e.setHours(parseFloat(n))},J:function(e,n){e.setDate(parseFloat(n))},K:function(e,n,t){e.setHours(e.getHours()%12+12*i(new RegExp(t.amPM[1],"i").test(n)))},M:function(e,n,t){e.setMonth(t.months.shorthand.indexOf(n))},S:function(e,n){e.setSeconds(parseFloat(n))},U:function(e,n){return new Date(1e3*parseFloat(n))},W:function(e,n,t){var a=parseInt(n),i=new Date(e.getFullYear(),0,2+7*(a-1),0,0,0,0);return i.setDate(i.getDate()-i.getDay()+t.firstDayOfWeek),i},Y:function(e,n){e.setFullYear(parseFloat(n))},Z:function(e,n){return new Date(n)},d:function(e,n){e.setDate(parseFloat(n))},h:function(e,n){e.setHours((e.getHours()>=12?12:0)+parseFloat(n))},i:function(e,n){e.setMinutes(parseFloat(n))},j:function(e,n){e.setDate(parseFloat(n))},l:m,m:function(e,n){e.setMonth(parseFloat(n)-1)},n:function(e,n){e.setMonth(parseFloat(n)-1)},s:function(e,n){e.setSeconds(parseFloat(n))},u:function(e,n){return new Date(parseFloat(n))},w:m,y:function(e,n){e.setFullYear(2e3+parseFloat(n))}},h={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},v={Z:function(e){return e.toISOString()},D:function(e,n,t){return n.weekdays.shorthand[v.w(e,n,t)]},F:function(e,n,t){return g(v.n(e,n,t)-1,!1,n)},G:function(e,n,t){return a(v.h(e,n,t))},H:function(e){return a(e.getHours())},J:function(e,n){return void 0!==n.ordinal?e.getDate()+n.ordinal(e.getDate()):e.getDate()},K:function(e,n){return n.amPM[i(e.getHours()>11)]},M:function(e,n){return g(e.getMonth(),!0,n)},S:function(e){return a(e.getSeconds())},U:function(e){return e.getTime()/1e3},W:function(e,n,t){return t.getWeek(e)},Y:function(e){return a(e.getFullYear(),4)},d:function(e){return a(e.getDate())},h:function(e){return e.getHours()%12?e.getHours()%12:12},i:function(e){return a(e.getMinutes())},j:function(e){return e.getDate()},l:function(e,n){return n.weekdays.longhand[e.getDay()]},m:function(e){return a(e.getMonth()+1)},n:function(e){return e.getMonth()+1},s:function(e){return e.getSeconds()},u:function(e){return e.getTime()},w:function(e){return e.getDay()},y:function(e){return String(e.getFullYear()).substring(2)}},D=function(e){var a=e.config,i=void 0===a?n:a,o=e.l10n,r=void 0===o?t:o,l=e.isMobile,c=void 0!==l&&l;return function(e,n,t){var a=t||r;return void 0===i.formatDate||c?n.split("").map(function(n,t,o){return v[n]&&"\\"!==o[t-1]?v[n](e,a,i):"\\"!==n?n:""}).join(""):i.formatDate(e,n,a)}},w=function(e){var a=e.config,i=void 0===a?n:a,o=e.l10n,r=void 0===o?t:o;return function(e,t,a,o){if(0===e||e){var l,c=o||r,s=e;if(e instanceof Date)l=new Date(e.getTime());else if("string"!=typeof e&&void 0!==e.toFixed)l=new Date(e);else if("string"==typeof e){var d=t||(i||n).dateFormat,u=String(e).trim();if("today"===u)l=new Date,a=!0;else if(i&&i.parseDate)l=i.parseDate(e,d);else if(/Z$/.test(u)||/GMT$/.test(u))l=new Date(e);else{for(var f=void 0,m=[],g=0,v=0,D="";g<d.length;g++){var w=d[g],b="\\"===w,C="\\"===d[g-1]||b;if(h[w]&&!C){D+=h[w];var M=new RegExp(D).exec(e);M&&(f=!0)&&m["Y"!==w?"push":"unshift"]({fn:p[w],val:M[++v]})}else b||(D+=".")}l=i&&i.noCalendar?new Date((new Date).setHours(0,0,0,0)):new Date((new Date).getFullYear(),0,1,0,0,0,0),m.forEach(function(e){var n=e.fn,t=e.val;return l=n(l,t,c)||l}),l=f?l:void 0}}if(l instanceof Date&&!isNaN(l.getTime()))return!0===a&&l.setHours(0,0,0,0),l;i.errorHandler(new Error("Invalid date provided: "+s))}}};function b(e,n,t){return void 0===t&&(t=!0),!1!==t?new Date(e.getTime()).setHours(0,0,0,0)-new Date(n.getTime()).setHours(0,0,0,0):e.getTime()-n.getTime()}var C=function(e,n,t){return 3600*e+60*n+t},M=864e5;function y(e){var n=e.defaultHour,t=e.defaultMinute,a=e.defaultSeconds;if(void 0!==e.minDate){var i=e.minDate.getHours(),o=e.minDate.getMinutes(),r=e.minDate.getSeconds();n<i&&(n=i),n===i&&t<o&&(t=o),n===i&&t===o&&a<r&&(a=e.minDate.getSeconds())}if(void 0!==e.maxDate){var l=e.maxDate.getHours(),c=e.maxDate.getMinutes();(n=Math.min(n,l))===l&&(t=Math.min(c,t)),n===l&&t===c&&(a=e.maxDate.getSeconds())}return{hours:n,minutes:t,seconds:a}}"function"!=typeof Object.assign&&(Object.assign=function(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];if(!e)throw TypeError("Cannot convert undefined or null to object");for(var a=function(n){n&&Object.keys(n).forEach(function(t){return e[t]=n[t]})},i=0,o=n;i<o.length;i++){a(o[i])}return e});var x=window&&window.__assign||function(){return x=Object.assign||function(e){for(var n,t=1,a=arguments.length;t<a;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e},x.apply(this,arguments)},E=window&&window.__spreadArrays||function(){for(var e=0,n=0,t=arguments.length;n<t;n++)e+=arguments[n].length;var a=Array(e),i=0;for(n=0;n<t;n++)for(var o=arguments[n],r=0,l=o.length;r<l;r++,i++)a[i]=o[r];return a};function k(m,p){var v={config:x(x({},n),I.defaultConfig),l10n:t};function k(){var e;return(null===(e=v.calendarContainer)||void 0===e?void 0:e.getRootNode()).activeElement||document.activeElement}function T(e){return e.bind(v)}function S(){var e=v.config;!1===e.weekNumbers&&1===e.showMonths||!0!==e.noCalendar&&window.requestAnimationFrame(function(){if(void 0!==v.calendarContainer&&(v.calendarContainer.style.visibility="hidden",v.calendarContainer.style.display="block"),void 0!==v.daysContainer){var n=(v.days.offsetWidth+1)*e.showMonths;v.daysContainer.style.width=n+"px",v.calendarContainer.style.width=n+(void 0!==v.weekWrapper?v.weekWrapper.offsetWidth:0)+"px",v.calendarContainer.style.removeProperty("visibility"),v.calendarContainer.style.removeProperty("display")}})}function _(e){if(0===v.selectedDates.length){var n=void 0===v.config.minDate||b(new Date,v.config.minDate)>=0?new Date:new Date(v.config.minDate.getTime()),t=y(v.config);n.setHours(t.hours,t.minutes,t.seconds,n.getMilliseconds()),v.selectedDates=[n],v.latestSelectedDateObj=n}void 0!==e&&"blur"!==e.type&&function(e){e.preventDefault();var n="keydown"===e.type,t=f(e),o=t;void 0!==v.amPM&&t===v.amPM&&(v.amPM.textContent=v.l10n.amPM[i(v.amPM.textContent===v.l10n.amPM[0])]);var r=parseFloat(o.getAttribute("min")),l=parseFloat(o.getAttribute("max")),c=parseFloat(o.getAttribute("step")),s=parseInt(o.value,10),d=e.delta||(n?38===e.which?1:-1:0),u=s+c*d;if(void 0!==o.value&&2===o.value.length){var m=o===v.hourElement,g=o===v.minuteElement;u<r?(u=l+u+i(!m)+(i(m)&&i(!v.amPM)),g&&L(void 0,-1,v.hourElement)):u>l&&(u=o===v.hourElement?u-l-i(!v.amPM):r,g&&L(void 0,1,v.hourElement)),v.amPM&&m&&(1===c?u+s===23:Math.abs(u-s)>c)&&(v.amPM.textContent=v.l10n.amPM[i(v.amPM.textContent===v.l10n.amPM[0])]),o.value=a(u)}}(e);var o=v._input.value;O(),ye(),v._input.value!==o&&v._debouncedChange()}function O(){if(void 0!==v.hourElement&&void 0!==v.minuteElement){var e,n,t=(parseInt(v.hourElement.value.slice(-2),10)||0)%24,a=(parseInt(v.minuteElement.value,10)||0)%60,o=void 0!==v.secondElement?(parseInt(v.secondElement.value,10)||0)%60:0;void 0!==v.amPM&&(e=t,n=v.amPM.textContent,t=e%12+12*i(n===v.l10n.amPM[1]));var r=void 0!==v.config.minTime||v.config.minDate&&v.minDateHasTime&&v.latestSelectedDateObj&&0===b(v.latestSelectedDateObj,v.config.minDate,!0),l=void 0!==v.config.maxTime||v.config.maxDate&&v.maxDateHasTime&&v.latestSelectedDateObj&&0===b(v.latestSelectedDateObj,v.config.maxDate,!0);if(void 0!==v.config.maxTime&&void 0!==v.config.minTime&&v.config.minTime>v.config.maxTime){var c=C(v.config.minTime.getHours(),v.config.minTime.getMinutes(),v.config.minTime.getSeconds()),s=C(v.config.maxTime.getHours(),v.config.maxTime.getMinutes(),v.config.maxTime.getSeconds()),d=C(t,a,o);if(d>s&&d<c){var u=function(e){var n=Math.floor(e/3600),t=(e-3600*n)/60;return[n,t,e-3600*n-60*t]}(c);t=u[0],a=u[1],o=u[2]}}else{if(l){var f=void 0!==v.config.maxTime?v.config.maxTime:v.config.maxDate;(t=Math.min(t,f.getHours()))===f.getHours()&&(a=Math.min(a,f.getMinutes())),a===f.getMinutes()&&(o=Math.min(o,f.getSeconds()))}if(r){var m=void 0!==v.config.minTime?v.config.minTime:v.config.minDate;(t=Math.max(t,m.getHours()))===m.getHours()&&a<m.getMinutes()&&(a=m.getMinutes()),a===m.getMinutes()&&(o=Math.max(o,m.getSeconds()))}}A(t,a,o)}}function F(e){var n=e||v.latestSelectedDateObj;n&&n instanceof Date&&A(n.getHours(),n.getMinutes(),n.getSeconds())}function A(e,n,t){void 0!==v.latestSelectedDateObj&&v.latestSelectedDateObj.setHours(e%24,n,t||0,0),v.hourElement&&v.minuteElement&&!v.isMobile&&(v.hourElement.value=a(v.config.time_24hr?e:(12+e)%12+12*i(e%12==0)),v.minuteElement.value=a(n),void 0!==v.amPM&&(v.amPM.textContent=v.l10n.amPM[i(e>=12)]),void 0!==v.secondElement&&(v.secondElement.value=a(t)))}function N(e){var n=f(e),t=parseInt(n.value)+(e.delta||0);(t/1e3>1||"Enter"===e.key&&!/[^\d]/.test(t.toString()))&&ee(t)}function P(e,n,t,a){return n instanceof Array?n.forEach(function(n){return P(e,n,t,a)}):e instanceof Array?e.forEach(function(e){return P(e,n,t,a)}):(e.addEventListener(n,t,a),void v._handlers.push({remove:function(){return e.removeEventListener(n,t,a)}}))}function Y(){De("onChange")}function j(e,n){var t=void 0!==e?v.parseDate(e):v.latestSelectedDateObj||(v.config.minDate&&v.config.minDate>v.now?v.config.minDate:v.config.maxDate&&v.config.maxDate<v.now?v.config.maxDate:v.now),a=v.currentYear,i=v.currentMonth;try{void 0!==t&&(v.currentYear=t.getFullYear(),v.currentMonth=t.getMonth())}catch(e){e.message="Invalid date supplied: "+t,v.config.errorHandler(e)}n&&v.currentYear!==a&&(De("onYearChange"),q()),!n||v.currentYear===a&&v.currentMonth===i||De("onMonthChange"),v.redraw()}function H(e){var n=f(e);~n.className.indexOf("arrow")&&L(e,n.classList.contains("arrowUp")?1:-1)}function L(e,n,t){var a=e&&f(e),i=t||a&&a.parentNode&&a.parentNode.firstChild,o=we("increment");o.delta=n,i&&i.dispatchEvent(o)}function R(e,n,t,a){var i=ne(n,!0),o=c("span",e,n.getDate().toString());return o.dateObj=n,o.$i=a,o.setAttribute("aria-label",v.formatDate(n,v.config.ariaDateFormat)),-1===e.indexOf("hidden")&&0===b(n,v.now)&&(v.todayDateElem=o,o.classList.add("today"),o.setAttribute("aria-current","date")),i?(o.tabIndex=-1,be(n)&&(o.classList.add("selected"),v.selectedDateElem=o,"range"===v.config.mode&&(l(o,"startRange",v.selectedDates[0]&&0===b(n,v.selectedDates[0],!0)),l(o,"endRange",v.selectedDates[1]&&0===b(n,v.selectedDates[1],!0)),"nextMonthDay"===e&&o.classList.add("inRange")))):o.classList.add("flatpickr-disabled"),"range"===v.config.mode&&function(e){return!("range"!==v.config.mode||v.selectedDates.length<2)&&(b(e,v.selectedDates[0])>=0&&b(e,v.selectedDates[1])<=0)}(n)&&!be(n)&&o.classList.add("inRange"),v.weekNumbers&&1===v.config.showMonths&&"prevMonthDay"!==e&&a%7==6&&v.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+v.config.getWeek(n)+"</span>"),De("onDayCreate",o),o}function W(e){e.focus(),"range"===v.config.mode&&oe(e)}function B(e){for(var n=e>0?0:v.config.showMonths-1,t=e>0?v.config.showMonths:-1,a=n;a!=t;a+=e)for(var i=v.daysContainer.children[a],o=e>0?0:i.children.length-1,r=e>0?i.children.length:-1,l=o;l!=r;l+=e){var c=i.children[l];if(-1===c.className.indexOf("hidden")&&ne(c.dateObj))return c}}function J(e,n){var t=k(),a=te(t||document.body),i=void 0!==e?e:a?t:void 0!==v.selectedDateElem&&te(v.selectedDateElem)?v.selectedDateElem:void 0!==v.todayDateElem&&te(v.todayDateElem)?v.todayDateElem:B(n>0?1:-1);void 0===i?v._input.focus():a?function(e,n){for(var t=-1===e.className.indexOf("Month")?e.dateObj.getMonth():v.currentMonth,a=n>0?v.config.showMonths:-1,i=n>0?1:-1,o=t-v.currentMonth;o!=a;o+=i)for(var r=v.daysContainer.children[o],l=t-v.currentMonth===o?e.$i+n:n<0?r.children.length-1:0,c=r.children.length,s=l;s>=0&&s<c&&s!=(n>0?c:-1);s+=i){var d=r.children[s];if(-1===d.className.indexOf("hidden")&&ne(d.dateObj)&&Math.abs(e.$i-s)>=Math.abs(n))return W(d)}v.changeMonth(i),J(B(i),0)}(i,n):W(i)}function K(e,n){for(var t=(new Date(e,n,1).getDay()-v.l10n.firstDayOfWeek+7)%7,a=v.utils.getDaysInMonth((n-1+12)%12,e),i=v.utils.getDaysInMonth(n,e),o=window.document.createDocumentFragment(),r=v.config.showMonths>1,l=r?"prevMonthDay hidden":"prevMonthDay",s=r?"nextMonthDay hidden":"nextMonthDay",d=a+1-t,u=0;d<=a;d++,u++)o.appendChild(R("flatpickr-day "+l,new Date(e,n-1,d),0,u));for(d=1;d<=i;d++,u++)o.appendChild(R("flatpickr-day",new Date(e,n,d),0,u));for(var f=i+1;f<=42-t&&(1===v.config.showMonths||u%7!=0);f++,u++)o.appendChild(R("flatpickr-day "+s,new Date(e,n+1,f%i),0,u));var m=c("div","dayContainer");return m.appendChild(o),m}function U(){if(void 0!==v.daysContainer){s(v.daysContainer),v.weekNumbers&&s(v.weekNumbers);for(var e=document.createDocumentFragment(),n=0;n<v.config.showMonths;n++){var t=new Date(v.currentYear,v.currentMonth,1);t.setMonth(v.currentMonth+n),e.appendChild(K(t.getFullYear(),t.getMonth()))}v.daysContainer.appendChild(e),v.days=v.daysContainer.firstChild,"range"===v.config.mode&&1===v.selectedDates.length&&oe()}}function q(){if(!(v.config.showMonths>1||"dropdown"!==v.config.monthSelectorType)){var e=function(e){return!(void 0!==v.config.minDate&&v.currentYear===v.config.minDate.getFullYear()&&e<v.config.minDate.getMonth())&&!(void 0!==v.config.maxDate&&v.currentYear===v.config.maxDate.getFullYear()&&e>v.config.maxDate.getMonth())};v.monthsDropdownContainer.tabIndex=-1,v.monthsDropdownContainer.innerHTML="";for(var n=0;n<12;n++)if(e(n)){var t=c("option","flatpickr-monthDropdown-month");t.value=new Date(v.currentYear,n).getMonth().toString(),t.textContent=g(n,v.config.shorthandCurrentMonth,v.l10n),t.tabIndex=-1,v.currentMonth===n&&(t.selected=!0),v.monthsDropdownContainer.appendChild(t)}}}function $(){var e,n=c("div","flatpickr-month"),t=window.document.createDocumentFragment();v.config.showMonths>1||"static"===v.config.monthSelectorType?e=c("span","cur-month"):(v.monthsDropdownContainer=c("select","flatpickr-monthDropdown-months"),v.monthsDropdownContainer.setAttribute("aria-label",v.l10n.monthAriaLabel),P(v.monthsDropdownContainer,"change",function(e){var n=f(e),t=parseInt(n.value,10);v.changeMonth(t-v.currentMonth),De("onMonthChange")}),q(),e=v.monthsDropdownContainer);var a=u("cur-year",{tabindex:"-1"}),i=a.getElementsByTagName("input")[0];i.setAttribute("aria-label",v.l10n.yearAriaLabel),v.config.minDate&&i.setAttribute("min",v.config.minDate.getFullYear().toString()),v.config.maxDate&&(i.setAttribute("max",v.config.maxDate.getFullYear().toString()),i.disabled=!!v.config.minDate&&v.config.minDate.getFullYear()===v.config.maxDate.getFullYear());var o=c("div","flatpickr-current-month");return o.appendChild(e),o.appendChild(a),t.appendChild(o),n.appendChild(t),{container:n,yearElement:i,monthElement:e}}function V(){s(v.monthNav),v.monthNav.appendChild(v.prevMonthNav),v.config.showMonths&&(v.yearElements=[],v.monthElements=[]);for(var e=v.config.showMonths;e--;){var n=$();v.yearElements.push(n.yearElement),v.monthElements.push(n.monthElement),v.monthNav.appendChild(n.container)}v.monthNav.appendChild(v.nextMonthNav)}function z(){v.weekdayContainer?s(v.weekdayContainer):v.weekdayContainer=c("div","flatpickr-weekdays");for(var e=v.config.showMonths;e--;){var n=c("div","flatpickr-weekdaycontainer");v.weekdayContainer.appendChild(n)}return G(),v.weekdayContainer}function G(){if(v.weekdayContainer){var e=v.l10n.firstDayOfWeek,n=E(v.l10n.weekdays.shorthand);e>0&&e<n.length&&(n=E(n.splice(e,n.length),n.splice(0,e)));for(var t=v.config.showMonths;t--;)v.weekdayContainer.children[t].innerHTML="\n <span class='flatpickr-weekday'>\n "+n.join("</span><span class='flatpickr-weekday'>")+"\n </span>\n "}}function Z(e,n){void 0===n&&(n=!0);var t=n?e:e-v.currentMonth;t<0&&!0===v._hidePrevMonthArrow||t>0&&!0===v._hideNextMonthArrow||(v.currentMonth+=t,(v.currentMonth<0||v.currentMonth>11)&&(v.currentYear+=v.currentMonth>11?1:-1,v.currentMonth=(v.currentMonth+12)%12,De("onYearChange"),q()),U(),De("onMonthChange"),Ce())}function Q(e){return v.calendarContainer.contains(e)}function X(e){if(v.isOpen&&!v.config.inline){var n=f(e),t=Q(n),a=!(n===v.input||n===v.altInput||v.element.contains(n)||e.path&&e.path.indexOf&&(~e.path.indexOf(v.input)||~e.path.indexOf(v.altInput)))&&!t&&!Q(e.relatedTarget),i=!v.config.ignoredFocusElements.some(function(e){return e.contains(n)});a&&i&&(v.config.allowInput&&v.setDate(v._input.value,!1,v.config.altInput?v.config.altFormat:v.config.dateFormat),void 0!==v.timeContainer&&void 0!==v.minuteElement&&void 0!==v.hourElement&&""!==v.input.value&&void 0!==v.input.value&&_(),v.close(),v.config&&"range"===v.config.mode&&1===v.selectedDates.length&&v.clear(!1))}}function ee(e){if(!(!e||v.config.minDate&&e<v.config.minDate.getFullYear()||v.config.maxDate&&e>v.config.maxDate.getFullYear())){var n=e,t=v.currentYear!==n;v.currentYear=n||v.currentYear,v.config.maxDate&&v.currentYear===v.config.maxDate.getFullYear()?v.currentMonth=Math.min(v.config.maxDate.getMonth(),v.currentMonth):v.config.minDate&&v.currentYear===v.config.minDate.getFullYear()&&(v.currentMonth=Math.max(v.config.minDate.getMonth(),v.currentMonth)),t&&(v.redraw(),De("onYearChange"),q())}}function ne(e,n){var t;void 0===n&&(n=!0);var a=v.parseDate(e,void 0,n);if(v.config.minDate&&a&&b(a,v.config.minDate,void 0!==n?n:!v.minDateHasTime)<0||v.config.maxDate&&a&&b(a,v.config.maxDate,void 0!==n?n:!v.maxDateHasTime)>0)return!1;if(!v.config.enable&&0===v.config.disable.length)return!0;if(void 0===a)return!1;for(var i=!!v.config.enable,o=null!==(t=v.config.enable)&&void 0!==t?t:v.config.disable,r=0,l=void 0;r<o.length;r++){if("function"==typeof(l=o[r])&&l(a))return i;if(l instanceof Date&&void 0!==a&&l.getTime()===a.getTime())return i;if("string"==typeof l){var c=v.parseDate(l,void 0,!0);return c&&c.getTime()===a.getTime()?i:!i}if("object"==typeof l&&void 0!==a&&l.from&&l.to&&a.getTime()>=l.from.getTime()&&a.getTime()<=l.to.getTime())return i}return!i}function te(e){return void 0!==v.daysContainer&&(-1===e.className.indexOf("hidden")&&-1===e.className.indexOf("flatpickr-disabled")&&v.daysContainer.contains(e))}function ae(e){var n=e.target===v._input,t=v._input.value.trimEnd()!==Me();!n||!t||e.relatedTarget&&Q(e.relatedTarget)||v.setDate(v._input.value,!0,e.target===v.altInput?v.config.altFormat:v.config.dateFormat)}function ie(e){var n=f(e),t=v.config.wrap?m.contains(n):n===v._input,a=v.config.allowInput,i=v.isOpen&&(!a||!t),o=v.config.inline&&t&&!a;if(13===e.keyCode&&t){if(a)return v.setDate(v._input.value,!0,n===v.altInput?v.config.altFormat:v.config.dateFormat),v.close(),n.blur();v.open()}else if(Q(n)||i||o){var r=!!v.timeContainer&&v.timeContainer.contains(n);switch(e.keyCode){case 13:r?(e.preventDefault(),_(),fe()):me(e);break;case 27:e.preventDefault(),fe();break;case 8:case 46:t&&!v.config.allowInput&&(e.preventDefault(),v.clear());break;case 37:case 39:if(r||t)v.hourElement&&v.hourElement.focus();else{e.preventDefault();var l=k();if(void 0!==v.daysContainer&&(!1===a||l&&te(l))){var c=39===e.keyCode?1:-1;e.ctrlKey?(e.stopPropagation(),Z(c),J(B(1),0)):J(void 0,c)}}break;case 38:case 40:e.preventDefault();var s=40===e.keyCode?1:-1;v.daysContainer&&void 0!==n.$i||n===v.input||n===v.altInput?e.ctrlKey?(e.stopPropagation(),ee(v.currentYear-s),J(B(1),0)):r||J(void 0,7*s):n===v.currentYearElement?ee(v.currentYear-s):v.config.enableTime&&(!r&&v.hourElement&&v.hourElement.focus(),_(e),v._debouncedChange());break;case 9:if(r){var d=[v.hourElement,v.minuteElement,v.secondElement,v.amPM].concat(v.pluginElements).filter(function(e){return e}),u=d.indexOf(n);if(-1!==u){var g=d[u+(e.shiftKey?-1:1)];e.preventDefault(),(g||v._input).focus()}}else!v.config.noCalendar&&v.daysContainer&&v.daysContainer.contains(n)&&e.shiftKey&&(e.preventDefault(),v._input.focus())}}if(void 0!==v.amPM&&n===v.amPM)switch(e.key){case v.l10n.amPM[0].charAt(0):case v.l10n.amPM[0].charAt(0).toLowerCase():v.amPM.textContent=v.l10n.amPM[0],O(),ye();break;case v.l10n.amPM[1].charAt(0):case v.l10n.amPM[1].charAt(0).toLowerCase():v.amPM.textContent=v.l10n.amPM[1],O(),ye()}(t||Q(n))&&De("onKeyDown",e)}function oe(e,n){if(void 0===n&&(n="flatpickr-day"),1===v.selectedDates.length&&(!e||e.classList.contains(n)&&!e.classList.contains("flatpickr-disabled"))){for(var t=e?e.dateObj.getTime():v.days.firstElementChild.dateObj.getTime(),a=v.parseDate(v.selectedDates[0],void 0,!0).getTime(),i=Math.min(t,v.selectedDates[0].getTime()),o=Math.max(t,v.selectedDates[0].getTime()),r=!1,l=0,c=0,s=i;s<o;s+=M)ne(new Date(s),!0)||(r=r||s>i&&s<o,s<a&&(!l||s>l)?l=s:s>a&&(!c||s<c)&&(c=s));Array.from(v.rContainer.querySelectorAll("*:nth-child(-n+"+v.config.showMonths+") > ."+n)).forEach(function(n){var i,o,s,d=n.dateObj.getTime(),u=l>0&&d<l||c>0&&d>c;if(u)return n.classList.add("notAllowed"),void["inRange","startRange","endRange"].forEach(function(e){n.classList.remove(e)});r&&!u||(["startRange","inRange","endRange","notAllowed"].forEach(function(e){n.classList.remove(e)}),void 0!==e&&(e.classList.add(t<=v.selectedDates[0].getTime()?"startRange":"endRange"),a<t&&d===a?n.classList.add("startRange"):a>t&&d===a&&n.classList.add("endRange"),d>=l&&(0===c||d<=c)&&(o=a,s=t,(i=d)>Math.min(o,s)&&i<Math.max(o,s))&&n.classList.add("inRange")))})}}function re(){!v.isOpen||v.config.static||v.config.inline||de()}function le(e){return function(n){var t=v.config["_"+e+"Date"]=v.parseDate(n,v.config.dateFormat),a=v.config["_"+("min"===e?"max":"min")+"Date"];void 0!==t&&(v["min"===e?"minDateHasTime":"maxDateHasTime"]=t.getHours()>0||t.getMinutes()>0||t.getSeconds()>0),v.selectedDates&&(v.selectedDates=v.selectedDates.filter(function(e){return ne(e)}),v.selectedDates.length||"min"!==e||F(t),ye()),v.daysContainer&&(ue(),void 0!==t?v.currentYearElement[e]=t.getFullYear().toString():v.currentYearElement.removeAttribute(e),v.currentYearElement.disabled=!!a&&void 0!==t&&a.getFullYear()===t.getFullYear())}}function ce(){return v.config.wrap?m.querySelector("[data-input]"):m}function se(){"object"!=typeof v.config.locale&&void 0===I.l10ns[v.config.locale]&&v.config.errorHandler(new Error("flatpickr: invalid locale "+v.config.locale)),v.l10n=x(x({},I.l10ns.default),"object"==typeof v.config.locale?v.config.locale:"default"!==v.config.locale?I.l10ns[v.config.locale]:void 0),h.D="("+v.l10n.weekdays.shorthand.join("|")+")",h.l="("+v.l10n.weekdays.longhand.join("|")+")",h.M="("+v.l10n.months.shorthand.join("|")+")",h.F="("+v.l10n.months.longhand.join("|")+")",h.K="("+v.l10n.amPM[0]+"|"+v.l10n.amPM[1]+"|"+v.l10n.amPM[0].toLowerCase()+"|"+v.l10n.amPM[1].toLowerCase()+")",void 0===x(x({},p),JSON.parse(JSON.stringify(m.dataset||{}))).time_24hr&&void 0===I.defaultConfig.time_24hr&&(v.config.time_24hr=v.l10n.time_24hr),v.formatDate=D(v),v.parseDate=w({config:v.config,l10n:v.l10n})}function de(e){if("function"!=typeof v.config.position){if(void 0!==v.calendarContainer){De("onPreCalendarPosition");var n=e||v._positionElement,t=Array.prototype.reduce.call(v.calendarContainer.children,function(e,n){return e+n.offsetHeight},0),a=v.calendarContainer.offsetWidth,i=v.config.position.split(" "),o=i[0],r=i.length>1?i[1]:null,c=n.getBoundingClientRect(),s=window.innerHeight-c.bottom,d="above"===o||"below"!==o&&s<t&&c.top>t,u=window.pageYOffset+c.top+(d?-t-2:n.offsetHeight+2);if(l(v.calendarContainer,"arrowTop",!d),l(v.calendarContainer,"arrowBottom",d),!v.config.inline){var f=window.pageXOffset+c.left,m=!1,g=!1;"center"===r?(f-=(a-c.width)/2,m=!0):"right"===r&&(f-=a-c.width,g=!0),l(v.calendarContainer,"arrowLeft",!m&&!g),l(v.calendarContainer,"arrowCenter",m),l(v.calendarContainer,"arrowRight",g);var p=window.document.body.offsetWidth-(window.pageXOffset+c.right),h=f+a>window.document.body.offsetWidth,D=p+a>window.document.body.offsetWidth;if(l(v.calendarContainer,"rightMost",h),!v.config.static)if(v.calendarContainer.style.top=u+"px",h)if(D){var w=function(){for(var e=null,n=0;n<document.styleSheets.length;n++){var t=document.styleSheets[n];if(t.cssRules){try{t.cssRules}catch(e){continue}e=t;break}}return null!=e?e:(a=document.createElement("style"),document.head.appendChild(a),a.sheet);var a}();if(void 0===w)return;var b=window.document.body.offsetWidth,C=Math.max(0,b/2-a/2),M=w.cssRules.length,y="{left:"+c.left+"px;right:auto;}";l(v.calendarContainer,"rightMost",!1),l(v.calendarContainer,"centerMost",!0),w.insertRule(".flatpickr-calendar.centerMost:before,.flatpickr-calendar.centerMost:after"+y,M),v.calendarContainer.style.left=C+"px",v.calendarContainer.style.right="auto"}else v.calendarContainer.style.left="auto",v.calendarContainer.style.right=p+"px";else v.calendarContainer.style.left=f+"px",v.calendarContainer.style.right="auto"}}}else v.config.position(v,e)}function ue(){v.config.noCalendar||v.isMobile||(q(),Ce(),U())}function fe(){v._input.focus(),-1!==window.navigator.userAgent.indexOf("MSIE")||void 0!==navigator.msMaxTouchPoints?setTimeout(v.close,0):v.close()}function me(e){e.preventDefault(),e.stopPropagation();var n=d(f(e),function(e){return e.classList&&e.classList.contains("flatpickr-day")&&!e.classList.contains("flatpickr-disabled")&&!e.classList.contains("notAllowed")});if(void 0!==n){var t=n,a=v.latestSelectedDateObj=new Date(t.dateObj.getTime()),i=(a.getMonth()<v.currentMonth||a.getMonth()>v.currentMonth+v.config.showMonths-1)&&"range"!==v.config.mode;if(v.selectedDateElem=t,"single"===v.config.mode)v.selectedDates=[a];else if("multiple"===v.config.mode){var o=be(a);o?v.selectedDates.splice(parseInt(o),1):v.selectedDates.push(a)}else"range"===v.config.mode&&(2===v.selectedDates.length&&v.clear(!1,!1),v.latestSelectedDateObj=a,v.selectedDates.push(a),0!==b(a,v.selectedDates[0],!0)&&v.selectedDates.sort(function(e,n){return e.getTime()-n.getTime()}));if(O(),i){var r=v.currentYear!==a.getFullYear();v.currentYear=a.getFullYear(),v.currentMonth=a.getMonth(),r&&(De("onYearChange"),q()),De("onMonthChange")}if(Ce(),U(),ye(),i||"range"===v.config.mode||1!==v.config.showMonths?void 0!==v.selectedDateElem&&void 0===v.hourElement&&v.selectedDateElem&&v.selectedDateElem.focus():W(t),void 0!==v.hourElement&&void 0!==v.hourElement&&v.hourElement.focus(),v.config.closeOnSelect){var l="single"===v.config.mode&&!v.config.enableTime,c="range"===v.config.mode&&2===v.selectedDates.length&&!v.config.enableTime;(l||c)&&fe()}Y()}}v.parseDate=w({config:v.config,l10n:v.l10n}),v._handlers=[],v.pluginElements=[],v.loadedPlugins=[],v._bind=P,v._setHoursFromDate=F,v._positionCalendar=de,v.changeMonth=Z,v.changeYear=ee,v.clear=function(e,n){void 0===e&&(e=!0);void 0===n&&(n=!0);v.input.value="",void 0!==v.altInput&&(v.altInput.value="");void 0!==v.mobileInput&&(v.mobileInput.value="");v.selectedDates=[],v.latestSelectedDateObj=void 0,!0===n&&(v.currentYear=v._initialDate.getFullYear(),v.currentMonth=v._initialDate.getMonth());if(!0===v.config.enableTime){var t=y(v.config);A(t.hours,t.minutes,t.seconds)}v.redraw(),e&&De("onChange")},v.close=function(){v.isOpen=!1,v.isMobile||(void 0!==v.calendarContainer&&v.calendarContainer.classList.remove("open"),void 0!==v._input&&v._input.classList.remove("active"));De("onClose")},v.onMouseOver=oe,v._createElement=c,v.createDay=R,v.destroy=function(){void 0!==v.config&&De("onDestroy");for(var e=v._handlers.length;e--;)v._handlers[e].remove();if(v._handlers=[],v.mobileInput)v.mobileInput.parentNode&&v.mobileInput.parentNode.removeChild(v.mobileInput),v.mobileInput=void 0;else if(v.calendarContainer&&v.calendarContainer.parentNode)if(v.config.static&&v.calendarContainer.parentNode){var n=v.calendarContainer.parentNode;if(n.lastChild&&n.removeChild(n.lastChild),n.parentNode){for(;n.firstChild;)n.parentNode.insertBefore(n.firstChild,n);n.parentNode.removeChild(n)}}else v.calendarContainer.parentNode.removeChild(v.calendarContainer);v.altInput&&(v.input.type="text",v.altInput.parentNode&&v.altInput.parentNode.removeChild(v.altInput),delete v.altInput);v.input&&(v.input.type=v.input._type,v.input.classList.remove("flatpickr-input"),v.input.removeAttribute("readonly"));["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(e){try{delete v[e]}catch(e){}})},v.isEnabled=ne,v.jumpToDate=j,v.updateValue=ye,v.open=function(e,n){void 0===n&&(n=v._positionElement);if(!0===v.isMobile){if(e){e.preventDefault();var t=f(e);t&&t.blur()}return void 0!==v.mobileInput&&(v.mobileInput.focus(),v.mobileInput.click()),void De("onOpen")}if(v._input.disabled||v.config.inline)return;var a=v.isOpen;v.isOpen=!0,a||(v.calendarContainer.classList.add("open"),v._input.classList.add("active"),De("onOpen"),de(n));!0===v.config.enableTime&&!0===v.config.noCalendar&&(!1!==v.config.allowInput||void 0!==e&&v.timeContainer.contains(e.relatedTarget)||setTimeout(function(){return v.hourElement.select()},50))},v.redraw=ue,v.set=function(n,t){if(null!==n&&"object"==typeof n)for(var a in Object.assign(v.config,n),n)void 0!==ge[a]&&ge[a].forEach(function(e){return e()});else v.config[n]=t,void 0!==ge[n]?ge[n].forEach(function(e){return e()}):e.indexOf(n)>-1&&(v.config[n]=r(t));v.redraw(),ye(!0)},v.setDate=function(e,n,t){void 0===n&&(n=!1);void 0===t&&(t=v.config.dateFormat);if(0!==e&&!e||e instanceof Array&&0===e.length)return v.clear(n);pe(e,t),v.latestSelectedDateObj=v.selectedDates[v.selectedDates.length-1],v.redraw(),j(void 0,n),F(),0===v.selectedDates.length&&v.clear(!1);ye(n),n&&De("onChange")},v.toggle=function(e){if(!0===v.isOpen)return v.close();v.open(e)};var ge={locale:[se,G],showMonths:[V,S,z],minDate:[j],maxDate:[j],positionElement:[ve],clickOpens:[function(){!0===v.config.clickOpens?(P(v._input,"focus",v.open),P(v._input,"click",v.open)):(v._input.removeEventListener("focus",v.open),v._input.removeEventListener("click",v.open))}]};function pe(e,n){var t=[];if(e instanceof Array)t=e.map(function(e){return v.parseDate(e,n)});else if(e instanceof Date||"number"==typeof e)t=[v.parseDate(e,n)];else if("string"==typeof e)switch(v.config.mode){case"single":case"time":t=[v.parseDate(e,n)];break;case"multiple":t=e.split(v.config.conjunction).map(function(e){return v.parseDate(e,n)});break;case"range":t=e.split(v.l10n.rangeSeparator).map(function(e){return v.parseDate(e,n)})}else v.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(e)));v.selectedDates=v.config.allowInvalidPreload?t:t.filter(function(e){return e instanceof Date&&ne(e,!1)}),"range"===v.config.mode&&v.selectedDates.sort(function(e,n){return e.getTime()-n.getTime()})}function he(e){return e.slice().map(function(e){return"string"==typeof e||"number"==typeof e||e instanceof Date?v.parseDate(e,void 0,!0):e&&"object"==typeof e&&e.from&&e.to?{from:v.parseDate(e.from,void 0),to:v.parseDate(e.to,void 0)}:e}).filter(function(e){return e})}function ve(){v._positionElement=v.config.positionElement||v._input}function De(e,n){if(void 0!==v.config){var t=v.config[e];if(void 0!==t&&t.length>0)for(var a=0;t[a]&&a<t.length;a++)t[a](v.selectedDates,v.input.value,v,n);"onChange"===e&&(v.input.dispatchEvent(we("change")),v.input.dispatchEvent(we("input")))}}function we(e){var n=document.createEvent("Event");return n.initEvent(e,!0,!0),n}function be(e){for(var n=0;n<v.selectedDates.length;n++){var t=v.selectedDates[n];if(t instanceof Date&&0===b(t,e))return""+n}return!1}function Ce(){v.config.noCalendar||v.isMobile||!v.monthNav||(v.yearElements.forEach(function(e,n){var t=new Date(v.currentYear,v.currentMonth,1);t.setMonth(v.currentMonth+n),v.config.showMonths>1||"static"===v.config.monthSelectorType?v.monthElements[n].textContent=g(t.getMonth(),v.config.shorthandCurrentMonth,v.l10n)+" ":v.monthsDropdownContainer.value=t.getMonth().toString(),e.value=t.getFullYear().toString()}),v._hidePrevMonthArrow=void 0!==v.config.minDate&&(v.currentYear===v.config.minDate.getFullYear()?v.currentMonth<=v.config.minDate.getMonth():v.currentYear<v.config.minDate.getFullYear()),v._hideNextMonthArrow=void 0!==v.config.maxDate&&(v.currentYear===v.config.maxDate.getFullYear()?v.currentMonth+1>v.config.maxDate.getMonth():v.currentYear>v.config.maxDate.getFullYear()))}function Me(e){var n=e||(v.config.altInput?v.config.altFormat:v.config.dateFormat);return v.selectedDates.map(function(e){return v.formatDate(e,n)}).filter(function(e,n,t){return"range"!==v.config.mode||v.config.enableTime||t.indexOf(e)===n}).join("range"!==v.config.mode?v.config.conjunction:v.l10n.rangeSeparator)}function ye(e){void 0===e&&(e=!0),void 0!==v.mobileInput&&v.mobileFormatStr&&(v.mobileInput.value=void 0!==v.latestSelectedDateObj?v.formatDate(v.latestSelectedDateObj,v.mobileFormatStr):""),v.input.value=Me(v.config.dateFormat),void 0!==v.altInput&&(v.altInput.value=Me(v.config.altFormat)),!1!==e&&De("onValueUpdate")}function xe(e){var n=f(e),t=v.prevMonthNav.contains(n),a=v.nextMonthNav.contains(n);t||a?Z(t?-1:1):v.yearElements.indexOf(n)>=0?n.select():n.classList.contains("arrowUp")?v.changeYear(v.currentYear+1):n.classList.contains("arrowDown")&&v.changeYear(v.currentYear-1)}return function(){v.element=v.input=m,v.isOpen=!1,function(){var t=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],a=x(x({},JSON.parse(JSON.stringify(m.dataset||{}))),p),i={};v.config.parseDate=a.parseDate,v.config.formatDate=a.formatDate,Object.defineProperty(v.config,"enable",{get:function(){return v.config._enable},set:function(e){v.config._enable=he(e)}}),Object.defineProperty(v.config,"disable",{get:function(){return v.config._disable},set:function(e){v.config._disable=he(e)}});var o="time"===a.mode;if(!a.dateFormat&&(a.enableTime||o)){var l=I.defaultConfig.dateFormat||n.dateFormat;i.dateFormat=a.noCalendar||o?"H:i"+(a.enableSeconds?":S":""):l+" H:i"+(a.enableSeconds?":S":"")}if(a.altInput&&(a.enableTime||o)&&!a.altFormat){var c=I.defaultConfig.altFormat||n.altFormat;i.altFormat=a.noCalendar||o?"h:i"+(a.enableSeconds?":S K":" K"):c+" h:i"+(a.enableSeconds?":S":"")+" K"}Object.defineProperty(v.config,"minDate",{get:function(){return v.config._minDate},set:le("min")}),Object.defineProperty(v.config,"maxDate",{get:function(){return v.config._maxDate},set:le("max")});var s=function(e){return function(n){v.config["min"===e?"_minTime":"_maxTime"]=v.parseDate(n,"H:i:S")}};Object.defineProperty(v.config,"minTime",{get:function(){return v.config._minTime},set:s("min")}),Object.defineProperty(v.config,"maxTime",{get:function(){return v.config._maxTime},set:s("max")}),"time"===a.mode&&(v.config.noCalendar=!0,v.config.enableTime=!0);Object.assign(v.config,i,a);for(var d=0;d<t.length;d++)v.config[t[d]]=!0===v.config[t[d]]||"true"===v.config[t[d]];e.filter(function(e){return void 0!==v.config[e]}).forEach(function(e){v.config[e]=r(v.config[e]||[]).map(T)}),v.isMobile=!v.config.disableMobile&&!v.config.inline&&"single"===v.config.mode&&!v.config.disable.length&&!v.config.enable&&!v.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(d=0;d<v.config.plugins.length;d++){var u=v.config.plugins[d](v)||{};for(var f in u)e.indexOf(f)>-1?v.config[f]=r(u[f]).map(T).concat(v.config[f]):void 0===a[f]&&(v.config[f]=u[f])}a.altInputClass||(v.config.altInputClass=ce().className+" "+v.config.altInputClass);De("onParseConfig")}(),se(),function(){if(v.input=ce(),!v.input)return void v.config.errorHandler(new Error("Invalid input element specified"));v.input._type=v.input.type,v.input.type="text",v.input.classList.add("flatpickr-input"),v._input=v.input,v.config.altInput&&(v.altInput=c(v.input.nodeName,v.config.altInputClass),v._input=v.altInput,v.altInput.placeholder=v.input.placeholder,v.altInput.disabled=v.input.disabled,v.altInput.required=v.input.required,v.altInput.tabIndex=v.input.tabIndex,v.altInput.type="text",v.input.setAttribute("type","hidden"),!v.config.static&&v.input.parentNode&&v.input.parentNode.insertBefore(v.altInput,v.input.nextSibling));v.config.allowInput||v._input.setAttribute("readonly","readonly");ve()}(),function(){v.selectedDates=[],v.now=v.parseDate(v.config.now)||new Date;var e=v.config.defaultDate||("INPUT"!==v.input.nodeName&&"TEXTAREA"!==v.input.nodeName||!v.input.placeholder||v.input.value!==v.input.placeholder?v.input.value:null);e&&pe(e,v.config.dateFormat);v._initialDate=v.selectedDates.length>0?v.selectedDates[0]:v.config.minDate&&v.config.minDate.getTime()>v.now.getTime()?v.config.minDate:v.config.maxDate&&v.config.maxDate.getTime()<v.now.getTime()?v.config.maxDate:v.now,v.currentYear=v._initialDate.getFullYear(),v.currentMonth=v._initialDate.getMonth(),v.selectedDates.length>0&&(v.latestSelectedDateObj=v.selectedDates[0]);void 0!==v.config.minTime&&(v.config.minTime=v.parseDate(v.config.minTime,"H:i"));void 0!==v.config.maxTime&&(v.config.maxTime=v.parseDate(v.config.maxTime,"H:i"));v.minDateHasTime=!!v.config.minDate&&(v.config.minDate.getHours()>0||v.config.minDate.getMinutes()>0||v.config.minDate.getSeconds()>0),v.maxDateHasTime=!!v.config.maxDate&&(v.config.maxDate.getHours()>0||v.config.maxDate.getMinutes()>0||v.config.maxDate.getSeconds()>0)}(),v.utils={getDaysInMonth:function(e,n){return void 0===e&&(e=v.currentMonth),void 0===n&&(n=v.currentYear),1===e&&(n%4==0&&n%100!=0||n%400==0)?29:v.l10n.daysInMonth[e]}},v.isMobile||function(){var e=window.document.createDocumentFragment();if(v.calendarContainer=c("div","flatpickr-calendar"),v.calendarContainer.tabIndex=-1,!v.config.noCalendar){if(e.appendChild((v.monthNav=c("div","flatpickr-months"),v.yearElements=[],v.monthElements=[],v.prevMonthNav=c("span","flatpickr-prev-month"),v.prevMonthNav.innerHTML=v.config.prevArrow,v.nextMonthNav=c("span","flatpickr-next-month"),v.nextMonthNav.innerHTML=v.config.nextArrow,V(),Object.defineProperty(v,"_hidePrevMonthArrow",{get:function(){return v.__hidePrevMonthArrow},set:function(e){v.__hidePrevMonthArrow!==e&&(l(v.prevMonthNav,"flatpickr-disabled",e),v.__hidePrevMonthArrow=e)}}),Object.defineProperty(v,"_hideNextMonthArrow",{get:function(){return v.__hideNextMonthArrow},set:function(e){v.__hideNextMonthArrow!==e&&(l(v.nextMonthNav,"flatpickr-disabled",e),v.__hideNextMonthArrow=e)}}),v.currentYearElement=v.yearElements[0],Ce(),v.monthNav)),v.innerContainer=c("div","flatpickr-innerContainer"),v.config.weekNumbers){var n=function(){v.calendarContainer.classList.add("hasWeeks");var e=c("div","flatpickr-weekwrapper");e.appendChild(c("span","flatpickr-weekday",v.l10n.weekAbbreviation));var n=c("div","flatpickr-weeks");return e.appendChild(n),{weekWrapper:e,weekNumbers:n}}(),t=n.weekWrapper,o=n.weekNumbers;v.innerContainer.appendChild(t),v.weekNumbers=o,v.weekWrapper=t}v.rContainer=c("div","flatpickr-rContainer"),v.rContainer.appendChild(z()),v.daysContainer||(v.daysContainer=c("div","flatpickr-days"),v.daysContainer.tabIndex=-1),U(),v.rContainer.appendChild(v.daysContainer),v.innerContainer.appendChild(v.rContainer),e.appendChild(v.innerContainer)}v.config.enableTime&&e.appendChild(function(){v.calendarContainer.classList.add("hasTime"),v.config.noCalendar&&v.calendarContainer.classList.add("noCalendar");var e=y(v.config);v.timeContainer=c("div","flatpickr-time"),v.timeContainer.tabIndex=-1;var n=c("span","flatpickr-time-separator",":"),t=u("flatpickr-hour",{"aria-label":v.l10n.hourAriaLabel});v.hourElement=t.getElementsByTagName("input")[0];var o=u("flatpickr-minute",{"aria-label":v.l10n.minuteAriaLabel});v.minuteElement=o.getElementsByTagName("input")[0],v.hourElement.tabIndex=v.minuteElement.tabIndex=-1,v.hourElement.value=a(v.latestSelectedDateObj?v.latestSelectedDateObj.getHours():v.config.time_24hr?e.hours:function(e){switch(e%24){case 0:case 12:return 12;default:return e%12}}(e.hours)),v.minuteElement.value=a(v.latestSelectedDateObj?v.latestSelectedDateObj.getMinutes():e.minutes),v.hourElement.setAttribute("step",v.config.hourIncrement.toString()),v.minuteElement.setAttribute("step",v.config.minuteIncrement.toString()),v.hourElement.setAttribute("min",v.config.time_24hr?"0":"1"),v.hourElement.setAttribute("max",v.config.time_24hr?"23":"12"),v.hourElement.setAttribute("maxlength","2"),v.minuteElement.setAttribute("min","0"),v.minuteElement.setAttribute("max","59"),v.minuteElement.setAttribute("maxlength","2"),v.timeContainer.appendChild(t),v.timeContainer.appendChild(n),v.timeContainer.appendChild(o),v.config.time_24hr&&v.timeContainer.classList.add("time24hr");if(v.config.enableSeconds){v.timeContainer.classList.add("hasSeconds");var r=u("flatpickr-second");v.secondElement=r.getElementsByTagName("input")[0],v.secondElement.value=a(v.latestSelectedDateObj?v.latestSelectedDateObj.getSeconds():e.seconds),v.secondElement.setAttribute("step",v.minuteElement.getAttribute("step")),v.secondElement.setAttribute("min","0"),v.secondElement.setAttribute("max","59"),v.secondElement.setAttribute("maxlength","2"),v.timeContainer.appendChild(c("span","flatpickr-time-separator",":")),v.timeContainer.appendChild(r)}v.config.time_24hr||(v.amPM=c("span","flatpickr-am-pm",v.l10n.amPM[i((v.latestSelectedDateObj?v.hourElement.value:v.config.defaultHour)>11)]),v.amPM.title=v.l10n.toggleTitle,v.amPM.tabIndex=-1,v.timeContainer.appendChild(v.amPM));return v.timeContainer}());l(v.calendarContainer,"rangeMode","range"===v.config.mode),l(v.calendarContainer,"animate",!0===v.config.animate),l(v.calendarContainer,"multiMonth",v.config.showMonths>1),v.calendarContainer.appendChild(e);var r=void 0!==v.config.appendTo&&void 0!==v.config.appendTo.nodeType;if((v.config.inline||v.config.static)&&(v.calendarContainer.classList.add(v.config.inline?"inline":"static"),v.config.inline&&(!r&&v.element.parentNode?v.element.parentNode.insertBefore(v.calendarContainer,v._input.nextSibling):void 0!==v.config.appendTo&&v.config.appendTo.appendChild(v.calendarContainer)),v.config.static)){var s=c("div","flatpickr-wrapper");v.element.parentNode&&v.element.parentNode.insertBefore(s,v.element),s.appendChild(v.element),v.altInput&&s.appendChild(v.altInput),s.appendChild(v.calendarContainer)}v.config.static||v.config.inline||(void 0!==v.config.appendTo?v.config.appendTo:window.document.body).appendChild(v.calendarContainer)}(),function(){v.config.wrap&&["open","close","toggle","clear"].forEach(function(e){Array.prototype.forEach.call(v.element.querySelectorAll("[data-"+e+"]"),function(n){return P(n,"click",v[e])})});if(v.isMobile)return void function(){var e=v.config.enableTime?v.config.noCalendar?"time":"datetime-local":"date";v.mobileInput=c("input",v.input.className+" flatpickr-mobile"),v.mobileInput.tabIndex=1,v.mobileInput.type=e,v.mobileInput.disabled=v.input.disabled,v.mobileInput.required=v.input.required,v.mobileInput.placeholder=v.input.placeholder,v.mobileFormatStr="datetime-local"===e?"Y-m-d\\TH:i:S":"date"===e?"Y-m-d":"H:i:S",v.selectedDates.length>0&&(v.mobileInput.defaultValue=v.mobileInput.value=v.formatDate(v.selectedDates[0],v.mobileFormatStr));v.config.minDate&&(v.mobileInput.min=v.formatDate(v.config.minDate,"Y-m-d"));v.config.maxDate&&(v.mobileInput.max=v.formatDate(v.config.maxDate,"Y-m-d"));v.input.getAttribute("step")&&(v.mobileInput.step=String(v.input.getAttribute("step")));v.input.type="hidden",void 0!==v.altInput&&(v.altInput.type="hidden");try{v.input.parentNode&&v.input.parentNode.insertBefore(v.mobileInput,v.input.nextSibling)}catch(e){}P(v.mobileInput,"change",function(e){v.setDate(f(e).value,!1,v.mobileFormatStr),De("onChange"),De("onClose")})}();var e=o(re,50);v._debouncedChange=o(Y,300),v.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&P(v.daysContainer,"mouseover",function(e){"range"===v.config.mode&&oe(f(e))});P(v._input,"keydown",ie),void 0!==v.calendarContainer&&P(v.calendarContainer,"keydown",ie);v.config.inline||v.config.static||P(window,"resize",e);void 0!==window.ontouchstart?P(window.document,"touchstart",X):P(window.document,"mousedown",X);P(window.document,"focus",X,{capture:!0}),!0===v.config.clickOpens&&(P(v._input,"focus",v.open),P(v._input,"click",v.open));void 0!==v.daysContainer&&(P(v.monthNav,"click",xe),P(v.monthNav,["keyup","increment"],N),P(v.daysContainer,"click",me));if(void 0!==v.timeContainer&&void 0!==v.minuteElement&&void 0!==v.hourElement){var n=function(e){return f(e).select()};P(v.timeContainer,["increment"],_),P(v.timeContainer,"blur",_,{capture:!0}),P(v.timeContainer,"click",H),P([v.hourElement,v.minuteElement],["focus","click"],n),void 0!==v.secondElement&&P(v.secondElement,"focus",function(){return v.secondElement&&v.secondElement.select()}),void 0!==v.amPM&&P(v.amPM,"click",function(e){_(e)})}v.config.allowInput&&P(v._input,"blur",ae)}(),(v.selectedDates.length||v.config.noCalendar)&&(v.config.enableTime&&F(v.config.noCalendar?v.latestSelectedDateObj:void 0),ye(!1)),S();var t=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!v.isMobile&&t&&de(),De("onReady")}(),v}function T(e,n){for(var t=Array.prototype.slice.call(e).filter(function(e){return e instanceof HTMLElement}),a=[],i=0;i<t.length;i++){var o=t[i];try{if(null!==o.getAttribute("data-fp-omit"))continue;void 0!==o._flatpickr&&(o._flatpickr.destroy(),o._flatpickr=void 0),o._flatpickr=k(o,n||{}),a.push(o._flatpickr)}catch(e){console.error(e)}}return 1===a.length?a[0]:a}"undefined"!=typeof HTMLElement&&"undefined"!=typeof HTMLCollection&&"undefined"!=typeof NodeList&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(e){return T(this,e)},HTMLElement.prototype.flatpickr=function(e){return T([this],e)});var I=function(e,n){return"string"==typeof e?T(window.document.querySelectorAll(e),n):e instanceof Node?T([e],n):T(e,n)};I.defaultConfig={},I.l10ns={en:x({},t),default:x({},t)},I.localize=function(e){I.l10ns.default=x(x({},I.l10ns.default),e)},I.setDefaults=function(e){I.defaultConfig=x(x({},I.defaultConfig),e)},I.parseDate=w({}),I.formatDate=D({}),I.compareDates=b,"undefined"!=typeof jQuery&&void 0!==jQuery.fn&&(jQuery.fn.flatpickr=function(e){return T(this,e)}),Date.prototype.fp_incr=function(e){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+("string"==typeof e?parseInt(e,10):e))},"undefined"!=typeof window&&(window.flatpickr=I);export{I as default};
@@ -0,0 +1 @@
1
+ const t=["top","right","bottom","left"],e=["start","end"],n=t.reduce((t,n)=>t.concat(n,n+"-"+e[0],n+"-"+e[1]),[]),o=Math.min,i=Math.max,r=Math.round,l=Math.floor,c=t=>({x:t,y:t}),s={left:"right",right:"left",bottom:"top",top:"bottom"};function a(t,e,n){return i(t,o(e,n))}function f(t,e){return"function"==typeof t?t(e):t}function u(t){return t.split("-")[0]}function d(t){return t.split("-")[1]}function h(t){return"x"===t?"y":"x"}function m(t){return"y"===t?"height":"width"}function g(t){const e=t[0];return"t"===e||"b"===e?"y":"x"}function p(t){return h(g(t))}function y(t,e,n){void 0===n&&(n=!1);const o=d(t),i=p(t),r=m(i);let l="x"===i?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return e.reference[r]>e.floating[r]&&(l=L(l)),[l,L(l)]}function w(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const x=["left","right"],v=["right","left"],b=["top","bottom"],R=["bottom","top"];function A(t,e,n,o){const i=d(t);let r=function(t,e,n){switch(t){case"top":case"bottom":return n?e?v:x:e?x:v;case"left":case"right":return e?b:R;default:return[]}}(u(t),"start"===n,o);return i&&(r=r.map(t=>t+"-"+i),e&&(r=r.concat(r.map(w)))),r}function L(t){const e=u(t);return s[e]+t.slice(e.length)}function T(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function O(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function E(t,e,n){let{reference:o,floating:i}=t;const r=g(e),l=p(e),c=m(l),s=u(e),a="y"===r,f=o.x+o.width/2-i.width/2,h=o.y+o.height/2-i.height/2,y=o[c]/2-i[c]/2;let w;switch(s){case"top":w={x:f,y:o.y-i.height};break;case"bottom":w={x:f,y:o.y+o.height};break;case"right":w={x:o.x+o.width,y:h};break;case"left":w={x:o.x-i.width,y:h};break;default:w={x:o.x,y:o.y}}switch(d(e)){case"start":w[l]-=y*(n&&a?-1:1);break;case"end":w[l]+=y*(n&&a?-1:1)}return w}async function D(t,e){var n;void 0===e&&(e={});const{x:o,y:i,platform:r,rects:l,elements:c,strategy:s}=t,{boundary:a="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:m=0}=f(e,t),g=T(m),p=c[h?"floating"===d?"reference":"floating":d],y=O(await r.getClippingRect({element:null==(n=await(null==r.isElement?void 0:r.isElement(p)))||n?p:p.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(c.floating)),boundary:a,rootBoundary:u,strategy:s})),w="floating"===d?{x:o,y:i,width:l.floating.width,height:l.floating.height}:l.reference,x=await(null==r.getOffsetParent?void 0:r.getOffsetParent(c.floating)),v=await(null==r.isElement?void 0:r.isElement(x))&&await(null==r.getScale?void 0:r.getScale(x))||{x:1,y:1},b=O(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:w,offsetParent:x,strategy:s}):w);return{top:(y.top-b.top+g.top)/v.y,bottom:(b.bottom-y.bottom+g.bottom)/v.y,left:(y.left-b.left+g.left)/v.x,right:(b.right-y.right+g.right)/v.x}}function C(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function S(e){return t.some(t=>e[t]>=0)}function P(t){const e=o(...t.map(t=>t.left)),n=o(...t.map(t=>t.top));return{x:e,y:n,width:i(...t.map(t=>t.right))-e,height:i(...t.map(t=>t.bottom))-n}}const F=new Set(["left","top"]);function H(){return"undefined"!=typeof window}function W(t){return M(t)?(t.nodeName||"").toLowerCase():"#document"}function k(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function B(t){var e;return null==(e=(M(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function M(t){return!!H()&&(t instanceof Node||t instanceof k(t).Node)}function V(t){return!!H()&&(t instanceof Element||t instanceof k(t).Element)}function z(t){return!!H()&&(t instanceof HTMLElement||t instanceof k(t).HTMLElement)}function N(t){return!(!H()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof k(t).ShadowRoot)}function $(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=Q(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&"inline"!==i&&"contents"!==i}function I(t){return/^(table|td|th)$/.test(W(t))}function j(t){try{if(t.matches(":popover-open"))return!0}catch(t){}try{return t.matches(":modal")}catch(t){return!1}}const q=/transform|translate|scale|rotate|perspective|filter/,X=/paint|layout|strict|content/,Y=t=>!!t&&"none"!==t;let _;function G(t){const e=V(t)?Q(t):t;return Y(e.transform)||Y(e.translate)||Y(e.scale)||Y(e.rotate)||Y(e.perspective)||!J()&&(Y(e.backdropFilter)||Y(e.filter))||q.test(e.willChange||"")||X.test(e.contain||"")}function J(){return null==_&&(_="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),_}function K(t){return/^(html|body|#document)$/.test(W(t))}function Q(t){return k(t).getComputedStyle(t)}function U(t){return V(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Z(t){if("html"===W(t))return t;const e=t.assignedSlot||t.parentNode||N(t)&&t.host||B(t);return N(e)?e.host:e}function tt(t){const e=Z(t);return K(e)?t.ownerDocument?t.ownerDocument.body:t.body:z(e)&&$(e)?e:tt(e)}function et(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const i=tt(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),l=k(i);if(r){const t=nt(l);return e.concat(l,l.visualViewport||[],$(i)?i:[],t&&n?et(t):[])}return e.concat(i,et(i,[],n))}function nt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function ot(t){const e=Q(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=z(t),l=i?t.offsetWidth:n,c=i?t.offsetHeight:o,s=r(n)!==l||r(o)!==c;return s&&(n=l,o=c),{width:n,height:o,$:s}}function it(t){return V(t)?t:t.contextElement}function rt(t){const e=it(t);if(!z(e))return c(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:l}=ot(e);let s=(l?r(n.width):n.width)/o,a=(l?r(n.height):n.height)/i;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const lt=c(0);function ct(t){const e=k(t);return J()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:lt}function st(t,e,n,o){void 0===e&&(e=!1),void 0===n&&(n=!1);const i=t.getBoundingClientRect(),r=it(t);let l=c(1);e&&(o?V(o)&&(l=rt(o)):l=rt(t));const s=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==k(t))&&e}(r,n,o)?ct(r):c(0);let a=(i.left+s.x)/l.x,f=(i.top+s.y)/l.y,u=i.width/l.x,d=i.height/l.y;if(r){const t=k(r),e=o&&V(o)?k(o):o;let n=t,i=nt(n);for(;i&&o&&e!==n;){const t=rt(i),e=i.getBoundingClientRect(),o=Q(i),r=e.left+(i.clientLeft+parseFloat(o.paddingLeft))*t.x,l=e.top+(i.clientTop+parseFloat(o.paddingTop))*t.y;a*=t.x,f*=t.y,u*=t.x,d*=t.y,a+=r,f+=l,n=k(i),i=nt(n)}}return O({width:u,height:d,x:a,y:f})}function at(t,e){const n=U(t).scrollLeft;return e?e.left+n:st(B(t)).left+n}function ft(t,e){const n=t.getBoundingClientRect();return{x:n.left+e.scrollLeft-at(t,n),y:n.top+e.scrollTop}}function ut(t,e,n){let o;if("viewport"===e)o=function(t,e){const n=k(t),o=B(t),i=n.visualViewport;let r=o.clientWidth,l=o.clientHeight,c=0,s=0;if(i){r=i.width,l=i.height;const t=J();(!t||t&&"fixed"===e)&&(c=i.offsetLeft,s=i.offsetTop)}const a=at(o);if(a<=0){const t=o.ownerDocument,e=t.body,n=getComputedStyle(e),i="CSS1Compat"===t.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,l=Math.abs(o.clientWidth-e.clientWidth-i);l<=25&&(r-=l)}else a<=25&&(r+=a);return{width:r,height:l,x:c,y:s}}(t,n);else if("document"===e)o=function(t){const e=B(t),n=U(t),o=t.ownerDocument.body,r=i(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),l=i(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let c=-n.scrollLeft+at(t);const s=-n.scrollTop;return"rtl"===Q(o).direction&&(c+=i(e.clientWidth,o.clientWidth)-r),{width:r,height:l,x:c,y:s}}(B(t));else if(V(e))o=function(t,e){const n=st(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=z(t)?rt(t):c(1);return{width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:i*r.x,y:o*r.y}}(e,n);else{const n=ct(t);o={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return O(o)}function dt(t,e){const n=Z(t);return!(n===e||!V(n)||K(n))&&("fixed"===Q(n).position||dt(n,e))}function ht(t,e,n){const o=z(e),i=B(e),r="fixed"===n,l=st(t,!0,r,e);let s={scrollLeft:0,scrollTop:0};const a=c(0);function f(){a.x=at(i)}if(o||!o&&!r)if(("body"!==W(e)||$(i))&&(s=U(e)),o){const t=st(e,!0,r,e);a.x=t.x+e.clientLeft,a.y=t.y+e.clientTop}else i&&f();r&&!o&&i&&f();const u=!i||o||r?c(0):ft(i,s);return{x:l.left+s.scrollLeft-a.x-u.x,y:l.top+s.scrollTop-a.y-u.y,width:l.width,height:l.height}}function mt(t){return"static"===Q(t).position}function gt(t,e){if(!z(t)||"fixed"===Q(t).position)return null;if(e)return e(t);let n=t.offsetParent;return B(t)===n&&(n=n.ownerDocument.body),n}function pt(t,e){const n=k(t);if(j(t))return n;if(!z(t)){let e=Z(t);for(;e&&!K(e);){if(V(e)&&!mt(e))return e;e=Z(e)}return n}let o=gt(t,e);for(;o&&I(o)&&mt(o);)o=gt(o,e);return o&&K(o)&&mt(o)&&!G(o)?n:o||function(t){let e=Z(t);for(;z(e)&&!K(e);){if(G(e))return e;if(j(e))return null;e=Z(e)}return null}(t)||n}const yt={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const r="fixed"===i,l=B(o),s=!!e&&j(e.floating);if(o===l||s&&r)return n;let a={scrollLeft:0,scrollTop:0},f=c(1);const u=c(0),d=z(o);if((d||!d&&!r)&&(("body"!==W(o)||$(l))&&(a=U(o)),d)){const t=st(o);f=rt(o),u.x=t.x+o.clientLeft,u.y=t.y+o.clientTop}const h=!l||d||r?c(0):ft(l,a);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-a.scrollLeft*f.x+u.x+h.x,y:n.y*f.y-a.scrollTop*f.y+u.y+h.y}},getDocumentElement:B,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:r,strategy:l}=t;const c=[..."clippingAncestors"===n?j(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let o=et(t,[],!1).filter(t=>V(t)&&"body"!==W(t)),i=null;const r="fixed"===Q(t).position;let l=r?Z(t):t;for(;V(l)&&!K(l);){const e=Q(l),n=G(l);n||"fixed"!==e.position||(i=null),(r?!n&&!i:!n&&"static"===e.position&&i&&("absolute"===i.position||"fixed"===i.position)||$(l)&&!n&&dt(t,l))?o=o.filter(t=>t!==l):i=e,l=Z(l)}return e.set(t,o),o}(e,this._c):[].concat(n),r],s=ut(e,c[0],l);let a=s.top,f=s.right,u=s.bottom,d=s.left;for(let t=1;t<c.length;t++){const n=ut(e,c[t],l);a=i(n.top,a),f=o(n.right,f),u=o(n.bottom,u),d=i(n.left,d)}return{width:f-d,height:u-a,x:d,y:a}},getOffsetParent:pt,getElementRects:async function(t){const e=this.getOffsetParent||pt,n=this.getDimensions,o=await n(t.floating);return{reference:ht(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:n}=ot(t);return{width:e,height:n}},getScale:rt,isElement:V,isRTL:function(t){return"rtl"===Q(t).direction}};function wt(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function xt(t,e,n,r){void 0===r&&(r={});const{ancestorScroll:c=!0,ancestorResize:s=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:f="function"==typeof IntersectionObserver,animationFrame:u=!1}=r,d=it(t),h=c||s?[...d?et(d):[],...e?et(e):[]]:[];h.forEach(t=>{c&&t.addEventListener("scroll",n,{passive:!0}),s&&t.addEventListener("resize",n)});const m=d&&f?function(t,e){let n,r=null;const c=B(t);function s(){var t;clearTimeout(n),null==(t=r)||t.disconnect(),r=null}return function a(f,u){void 0===f&&(f=!1),void 0===u&&(u=1),s();const d=t.getBoundingClientRect(),{left:h,top:m,width:g,height:p}=d;if(f||e(),!g||!p)return;const y={rootMargin:-l(m)+"px "+-l(c.clientWidth-(h+g))+"px "+-l(c.clientHeight-(m+p))+"px "+-l(h)+"px",threshold:i(0,o(1,u))||1};let w=!0;function x(e){const o=e[0].intersectionRatio;if(o!==u){if(!w)return a();o?a(!1,o):n=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==o||wt(d,t.getBoundingClientRect())||a(),w=!1}try{r=new IntersectionObserver(x,{...y,root:c.ownerDocument})}catch(t){r=new IntersectionObserver(x,y)}r.observe(t)}(!0),s}(d,n):null;let g,p=-1,y=null;a&&(y=new ResizeObserver(t=>{let[o]=t;o&&o.target===d&&y&&e&&(y.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var t;null==(t=y)||t.observe(e)})),n()}),d&&!u&&y.observe(d),e&&y.observe(e));let w=u?st(t):null;return u&&function e(){const o=st(t);w&&!wt(w,o)&&n();w=o,g=requestAnimationFrame(e)}(),n(),()=>{var t;h.forEach(t=>{c&&t.removeEventListener("scroll",n),s&&t.removeEventListener("resize",n)}),null==m||m(),null==(t=y)||t.disconnect(),y=null,u&&cancelAnimationFrame(g)}}const vt=D,bt=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:r,placement:l,middlewareData:c}=e,s=await async function(t,e){const{placement:n,platform:o,elements:i}=t,r=await(null==o.isRTL?void 0:o.isRTL(i.floating)),l=u(n),c=d(n),s="y"===g(n),a=F.has(l)?-1:1,h=r&&s?-1:1,m=f(e,t);let{mainAxis:p,crossAxis:y,alignmentAxis:w}="number"==typeof m?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return c&&"number"==typeof w&&(y="end"===c?-1*w:w),s?{x:y*h,y:p*a}:{x:p*a,y:y*h}}(e,t);return l===(null==(n=c.offset)?void 0:n.placement)&&null!=(o=c.arrow)&&o.alignmentOffset?{}:{x:i+s.x,y:r+s.y,data:{...s,placement:l}}}}},Rt=function(t){return void 0===t&&(t={}),{name:"autoPlacement",options:t,async fn(e){var o,i,r;const{rects:l,middlewareData:c,placement:s,platform:a,elements:h}=e,{crossAxis:m=!1,alignment:g,allowedPlacements:p=n,autoAlignment:x=!0,...v}=f(t,e),b=void 0!==g||p===n?function(t,e,n){return(t?[...n.filter(e=>d(e)===t),...n.filter(e=>d(e)!==t)]:n.filter(t=>u(t)===t)).filter(n=>!t||d(n)===t||!!e&&w(n)!==n)}(g||null,x,p):p,R=await a.detectOverflow(e,v),A=(null==(o=c.autoPlacement)?void 0:o.index)||0,L=b[A];if(null==L)return{};const T=y(L,l,await(null==a.isRTL?void 0:a.isRTL(h.floating)));if(s!==L)return{reset:{placement:b[0]}};const O=[R[u(L)],R[T[0]],R[T[1]]],E=[...(null==(i=c.autoPlacement)?void 0:i.overflows)||[],{placement:L,overflows:O}],D=b[A+1];if(D)return{data:{index:A+1,overflows:E},reset:{placement:D}};const C=E.map(t=>{const e=d(t.placement);return[t.placement,e&&m?t.overflows.slice(0,2).reduce((t,e)=>t+e,0):t.overflows[0],t.overflows]}).sort((t,e)=>t[1]-e[1]),S=(null==(r=C.filter(t=>t[2].slice(0,d(t[0])?2:3).every(t=>t<=0))[0])?void 0:r[0])||C[0][0];return S!==s?{data:{index:A+1,overflows:E},reset:{placement:S}}:{}}}},At=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i,platform:r}=e,{mainAxis:l=!0,crossAxis:c=!1,limiter:s={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...d}=f(t,e),m={x:n,y:o},p=await r.detectOverflow(e,d),y=g(u(i)),w=h(y);let x=m[w],v=m[y];if(l){const t="y"===w?"bottom":"right";x=a(x+p["y"===w?"top":"left"],x,x-p[t])}if(c){const t="y"===y?"bottom":"right";v=a(v+p["y"===y?"top":"left"],v,v-p[t])}const b=s.fn({...e,[w]:x,[y]:v});return{...b,data:{x:b.x-n,y:b.y-o,enabled:{[w]:l,[y]:c}}}}}},Lt=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:r,rects:l,initialPlacement:c,platform:s,elements:a}=e,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:v=!0,...b}=f(t,e);if(null!=(n=r.arrow)&&n.alignmentOffset)return{};const R=u(i),T=g(c),O=u(c)===c,E=await(null==s.isRTL?void 0:s.isRTL(a.floating)),D=m||(O||!v?[L(c)]:function(t){const e=L(t);return[w(t),e,w(e)]}(c)),C="none"!==x;!m&&C&&D.push(...A(c,v,x,E));const S=[c,...D],P=await s.detectOverflow(e,b),F=[];let H=(null==(o=r.flip)?void 0:o.overflows)||[];if(d&&F.push(P[R]),h){const t=y(i,l,E);F.push(P[t[0]],P[t[1]])}if(H=[...H,{placement:i,overflows:F}],!F.every(t=>t<=0)){var W,k;const t=((null==(W=r.flip)?void 0:W.index)||0)+1,e=S[t];if(e){if(!("alignment"===h&&T!==g(e))||H.every(t=>g(t.placement)!==T||t.overflows[0]>0))return{data:{index:t,overflows:H},reset:{placement:e}}}let n=null==(k=H.filter(t=>t.overflows[0]<=0).sort((t,e)=>t.overflows[1]-e.overflows[1])[0])?void 0:k.placement;if(!n)switch(p){case"bestFit":{var B;const t=null==(B=H.filter(t=>{if(C){const e=g(t.placement);return e===T||"y"===e}return!0}).map(t=>[t.placement,t.overflows.filter(t=>t>0).reduce((t,e)=>t+e,0)]).sort((t,e)=>t[1]-e[1])[0])?void 0:B[0];t&&(n=t);break}case"initialPlacement":n=c}if(i!==n)return{reset:{placement:n}}}return{}}}},Tt=function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:l,rects:c,platform:s,elements:a}=e,{apply:h=()=>{},...m}=f(t,e),p=await s.detectOverflow(e,m),y=u(l),w=d(l),x="y"===g(l),{width:v,height:b}=c.floating;let R,A;"top"===y||"bottom"===y?(R=y,A=w===(await(null==s.isRTL?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(A=y,R="end"===w?"top":"bottom");const L=b-p.top-p.bottom,T=v-p.left-p.right,O=o(b-p[R],L),E=o(v-p[A],T),D=!e.middlewareData.shift;let C=O,S=E;if(null!=(n=e.middlewareData.shift)&&n.enabled.x&&(S=T),null!=(r=e.middlewareData.shift)&&r.enabled.y&&(C=L),D&&!w){const t=i(p.left,0),e=i(p.right,0),n=i(p.top,0),o=i(p.bottom,0);x?S=v-2*(0!==t||0!==e?t+e:i(p.left,p.right)):C=b-2*(0!==n||0!==o?n+o:i(p.top,p.bottom))}await h({...e,availableWidth:S,availableHeight:C});const P=await s.getDimensions(a.floating);return v!==P.width||b!==P.height?{reset:{rects:!0}}:{}}}},Ot=function(t){return void 0===t&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n,platform:o}=e,{strategy:i="referenceHidden",...r}=f(t,e);switch(i){case"referenceHidden":{const t=C(await o.detectOverflow(e,{...r,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:t,referenceHidden:S(t)}}}case"escaped":{const t=C(await o.detectOverflow(e,{...r,altBoundary:!0}),n.floating);return{data:{escapedOffsets:t,escaped:S(t)}}}default:return{}}}}},Et=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:i,placement:r,rects:l,platform:c,elements:s,middlewareData:u}=e,{element:h,padding:g=0}=f(t,e)||{};if(null==h)return{};const y=T(g),w={x:n,y:i},x=p(r),v=m(x),b=await c.getDimensions(h),R="y"===x,A=R?"top":"left",L=R?"bottom":"right",O=R?"clientHeight":"clientWidth",E=l.reference[v]+l.reference[x]-w[x]-l.floating[v],D=w[x]-l.reference[x],C=await(null==c.getOffsetParent?void 0:c.getOffsetParent(h));let S=C?C[O]:0;S&&await(null==c.isElement?void 0:c.isElement(C))||(S=s.floating[O]||l.floating[v]);const P=E/2-D/2,F=S/2-b[v]/2-1,H=o(y[A],F),W=o(y[L],F),k=H,B=S-b[v]-W,M=S/2-b[v]/2+P,V=a(k,M,B),z=!u.arrow&&null!=d(r)&&M!==V&&l.reference[v]/2-(M<k?H:W)-b[v]/2<0,N=z?M<k?M-k:M-B:0;return{[x]:w[x]+N,data:{[x]:V,centerOffset:M-V-N,...z&&{alignmentOffset:N}},reset:z}}}),Dt=function(t){return void 0===t&&(t={}),{name:"inline",options:t,async fn(e){const{placement:n,elements:r,rects:l,platform:c,strategy:s}=e,{padding:a=2,x:d,y:h}=f(t,e),m=Array.from(await(null==c.getClientRects?void 0:c.getClientRects(r.reference))||[]),p=function(t){const e=t.slice().sort((t,e)=>t.y-e.y),n=[];let o=null;for(let t=0;t<e.length;t++){const i=e[t];!o||i.y-o.y>o.height/2?n.push([i]):n[n.length-1].push(i),o=i}return n.map(t=>O(P(t)))}(m),y=O(P(m)),w=T(a);const x=await c.getElementRects({reference:{getBoundingClientRect:function(){if(2===p.length&&p[0].left>p[1].right&&null!=d&&null!=h)return p.find(t=>d>t.left-w.left&&d<t.right+w.right&&h>t.top-w.top&&h<t.bottom+w.bottom)||y;if(p.length>=2){if("y"===g(n)){const t=p[0],e=p[p.length-1],o="top"===u(n),i=t.top,r=e.bottom,l=o?t.left:e.left,c=o?t.right:e.right;return{top:i,bottom:r,left:l,right:c,width:c-l,height:r-i,x:l,y:i}}const t="left"===u(n),e=i(...p.map(t=>t.right)),r=o(...p.map(t=>t.left)),l=p.filter(n=>t?n.left===r:n.right===e),c=l[0].top,s=l[l.length-1].bottom;return{top:c,bottom:s,left:r,right:e,width:e-r,height:s-c,x:r,y:c}}return y}},floating:r.floating,strategy:s});return l.reference.x!==x.reference.x||l.reference.y!==x.reference.y||l.reference.width!==x.reference.width||l.reference.height!==x.reference.height?{reset:{rects:x}}:{}}}},Ct=function(t){return void 0===t&&(t={}),{options:t,fn(e){const{x:n,y:o,placement:i,rects:r,middlewareData:l}=e,{offset:c=0,mainAxis:s=!0,crossAxis:a=!0}=f(t,e),d={x:n,y:o},m=g(i),p=h(m);let y=d[p],w=d[m];const x=f(c,e),v="number"==typeof x?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(s){const t="y"===p?"height":"width",e=r.reference[p]-r.floating[t]+v.mainAxis,n=r.reference[p]+r.reference[t]-v.mainAxis;y<e?y=e:y>n&&(y=n)}if(a){var b,R;const t="y"===p?"width":"height",e=F.has(u(i)),n=r.reference[m]-r.floating[t]+(e&&(null==(b=l.offset)?void 0:b[m])||0)+(e?0:v.crossAxis),o=r.reference[m]+r.reference[t]+(e?0:(null==(R=l.offset)?void 0:R[m])||0)-(e?v.crossAxis:0);w<n?w=n:w>o&&(w=o)}return{[p]:y,[m]:w}}}},St=(t,e,n)=>{const o=new Map,i={platform:yt,...n},r={...i.platform,_c:o};return(async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:l}=n,c=l.detectOverflow?l:{...l,detectOverflow:D},s=await(null==l.isRTL?void 0:l.isRTL(e));let a=await l.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:u}=E(a,o,s),d=o,h=0;const m={};for(let n=0;n<r.length;n++){const g=r[n];if(!g)continue;const{name:p,fn:y}=g,{x:w,y:x,data:v,reset:b}=await y({x:f,y:u,initialPlacement:o,placement:d,strategy:i,middlewareData:m,rects:a,platform:c,elements:{reference:t,floating:e}});f=null!=w?w:f,u=null!=x?x:u,m[p]={...m[p],...v},b&&h<50&&(h++,"object"==typeof b&&(b.placement&&(d=b.placement),b.rects&&(a=!0===b.rects?await l.getElementRects({reference:t,floating:e,strategy:i}):b.rects),({x:f,y:u}=E(a,d,s))),n=-1)}return{x:f,y:u,placement:d,strategy:i,middlewareData:m}})(t,e,{...i,platform:r})};export{Et as arrow,Rt as autoPlacement,xt as autoUpdate,St as computePosition,vt as detectOverflow,Lt as flip,et as getOverflowAncestors,Ot as hide,Dt as inline,Ct as limitShift,bt as offset,yt as platform,At as shift,Tt as size};
@@ -1 +1 @@
1
- !function(e){var n,t={},o={16:!1,18:!1,17:!1,91:!1},r="all",i={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,command:91},l={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,home:36,end:35,pageup:33,pagedown:34,",":188,".":190,"/":191,"`":192,"-":189,"=":187,";":186,"'":222,"[":219,"]":221,"\\":220},f=function(e){return l[e]||e.toUpperCase().charCodeAt(0)},c=[];for(n=1;n<20;n++)l["f"+n]=111+n;function u(e,n){for(var t=e.length;t--;)if(e[t]===n)return t;return-1}function a(e,n){if(e.length!=n.length)return!1;for(var t=0;t<e.length;t++)if(e[t]!==n[t])return!1;return!0}var s={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey"};function d(e){for(n in o)o[n]=e[s[n]]}function p(e,n,o){var r,i;r=g(e),void 0===o&&(o=n,n="all");for(var l=0;l<r.length;l++)i=[],(e=r[l].split("+")).length>1&&(i=v(e),e=[e[e.length-1]]),e=e[0],(e=f(e))in t||(t[e]=[]),t[e].push({shortcut:r[l],scope:n,method:o,key:r[l],mods:i})}for(n in i)p[n]=!1;function h(){return r||"all"}function g(e){var n;return""==(n=(e=e.replace(/\s/g,"")).split(","))[n.length-1]&&(n[n.length-2]+=","),n}function v(e){for(var n=e.slice(0,e.length-1),t=0;t<n.length;t++)n[t]=i[n[t]];return n}function y(e,n,t){e.addEventListener?e.addEventListener(n,t,!1):e.attachEvent&&e.attachEvent("on"+n,(function(){t(window.event)}))}y(document,"keydown",(function(e){!function(e){var n,r,l,f,a,s;if(n=e.keyCode,-1==u(c,n)&&c.push(n),93!=n&&224!=n||(n=91),n in o)for(l in o[n]=!0,i)i[l]==n&&(p[l]=!0);else if(d(e),p.filter.call(this,e)&&n in t)for(s=h(),f=0;f<t[n].length;f++)if((r=t[n][f]).scope==s||"all"==r.scope){for(l in a=r.mods.length>0,o)(!o[l]&&u(r.mods,+l)>-1||o[l]&&-1==u(r.mods,+l))&&(a=!1);(0!=r.mods.length||o[16]||o[18]||o[17]||o[91])&&!a||!1===r.method(e,r)&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}(e)})),y(document,"keyup",(function(e){var n,t=e.keyCode,r=u(c,t);if(r>=0&&c.splice(r,1),93!=t&&224!=t||(t=91),t in o)for(n in o[t]=!1,i)i[n]==t&&(p[n]=!1)})),y(window,"focus",(function(){for(n in o)o[n]=!1;for(n in i)p[n]=!1}));var k=e.key;e.key=p,e.key.setScope=function(e){r=e||"all"},e.key.getScope=h,e.key.deleteScope=function(e){var n,o,r;for(n in t)for(o=t[n],r=0;r<o.length;)o[r].scope===e?o.splice(r,1):r++},e.key.filter=function(e){var n=(e.target||e.srcElement).tagName;return!("INPUT"==n||"SELECT"==n||"TEXTAREA"==n)},e.key.isPressed=function(e){return"string"==typeof e&&(e=f(e)),-1!=u(c,e)},e.key.getPressedKeyCodes=function(){return c.slice(0)},e.key.noConflict=function(){var n=e.key;return e.key=k,n},e.key.unbind=function(e,n){var o,r,i,l,c,u=[];for(o=g(e),l=0;l<o.length;l++){if((r=o[l].split("+")).length>1&&(u=v(r),e=r[r.length-1]),e=f(e),void 0===n&&(n=h()),!t[e])return;for(i=0;i<t[e].length;i++)(c=t[e][i]).scope===n&&a(c.mods,u)&&(t[e][i]={})}},"undefined"!=typeof module&&(module.exports=p)}(window);
1
+ !function(e){var n,t={},o={16:!1,18:!1,17:!1,91:!1},r="all",i={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,command:91},l={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,home:36,end:35,pageup:33,pagedown:34,",":188,".":190,"/":191,"`":192,"-":189,"=":187,";":186,"'":222,"[":219,"]":221,"\\":220},f=function(e){return l[e]||e.toUpperCase().charCodeAt(0)},c=[];for(n=1;n<20;n++)l["f"+n]=111+n;function u(e,n){for(var t=e.length;t--;)if(e[t]===n)return t;return-1}function a(e,n){if(e.length!=n.length)return!1;for(var t=0;t<e.length;t++)if(e[t]!==n[t])return!1;return!0}var s={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey"};function d(e){for(n in o)o[n]=e[s[n]]}function p(e,n,o){var r,i;r=g(e),void 0===o&&(o=n,n="all");for(var l=0;l<r.length;l++)i=[],(e=r[l].split("+")).length>1&&(i=v(e),e=[e[e.length-1]]),e=e[0],(e=f(e))in t||(t[e]=[]),t[e].push({shortcut:r[l],scope:n,method:o,key:r[l],mods:i})}for(n in i)p[n]=!1;function h(){return r||"all"}function g(e){var n;return""==(n=(e=e.replace(/\s/g,"")).split(","))[n.length-1]&&(n[n.length-2]+=","),n}function v(e){for(var n=e.slice(0,e.length-1),t=0;t<n.length;t++)n[t]=i[n[t]];return n}function y(e,n,t){e.addEventListener?e.addEventListener(n,t,!1):e.attachEvent&&e.attachEvent("on"+n,function(){t(window.event)})}y(document,"keydown",function(e){!function(e){var n,r,l,f,a,s;if(n=e.keyCode,-1==u(c,n)&&c.push(n),93!=n&&224!=n||(n=91),n in o)for(l in o[n]=!0,i)i[l]==n&&(p[l]=!0);else if(d(e),p.filter.call(this,e)&&n in t)for(s=h(),f=0;f<t[n].length;f++)if((r=t[n][f]).scope==s||"all"==r.scope){for(l in a=r.mods.length>0,o)(!o[l]&&u(r.mods,+l)>-1||o[l]&&-1==u(r.mods,+l))&&(a=!1);(0!=r.mods.length||o[16]||o[18]||o[17]||o[91])&&!a||!1===r.method(e,r)&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}(e)}),y(document,"keyup",function(e){var n,t=e.keyCode,r=u(c,t);if(r>=0&&c.splice(r,1),93!=t&&224!=t||(t=91),t in o)for(n in o[t]=!1,i)i[n]==t&&(p[n]=!1)}),y(window,"focus",function(){for(n in o)o[n]=!1;for(n in i)p[n]=!1});var k=e.key;e.key=p,e.key.setScope=function(e){r=e||"all"},e.key.getScope=h,e.key.deleteScope=function(e){var n,o,r;for(n in t)for(o=t[n],r=0;r<o.length;)o[r].scope===e?o.splice(r,1):r++},e.key.filter=function(e){var n=(e.target||e.srcElement).tagName;return!("INPUT"==n||"SELECT"==n||"TEXTAREA"==n)},e.key.isPressed=function(e){return"string"==typeof e&&(e=f(e)),-1!=u(c,e)},e.key.getPressedKeyCodes=function(){return c.slice(0)},e.key.noConflict=function(){var n=e.key;return e.key=k,n},e.key.unbind=function(e,n){var o,r,i,l,c,u=[];for(o=g(e),l=0;l<o.length;l++){if((r=o[l].split("+")).length>1&&(u=v(r),e=r[r.length-1]),e=f(e),void 0===n&&(n=h()),!t[e])return;for(i=0;i<t[e].length;i++)(c=t[e][i]).scope===n&&a(c.mods,u)&&(t[e][i]={})}},"undefined"!=typeof module&&(module.exports=p)}(window);
@@ -1 +1 @@
1
- const t="a[data-confirm], a[data-method], a[data-remote]:not([disabled]), a[data-disable-with], a[data-disable]",e={selector:"button[data-remote]:not([form]), button[data-confirm]:not([form])",exclude:"form button"},n="select[data-remote], input[data-remote], textarea[data-remote]",a="form:not([data-turbo=true])",o="form:not([data-turbo=true]) input[type=submit], form:not([data-turbo=true]) input[type=image], form:not([data-turbo=true]) button[type=submit], form:not([data-turbo=true]) button:not([type]), input[type=submit][form], input[type=image][form], button[type=submit][form], button[form]:not([type])",r="input[data-disable-with]:enabled, button[data-disable-with]:enabled, textarea[data-disable-with]:enabled, input[data-disable]:enabled, button[data-disable]:enabled, textarea[data-disable]:enabled",i="input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled, input[data-disable]:disabled, button[data-disable]:disabled, textarea[data-disable]:disabled",u="a[data-disable-with], a[data-disable]",c="button[data-remote][data-disable-with], button[data-remote][data-disable]";let s=null;const l=()=>{const t=document.querySelector("meta[name=csp-nonce]");return s=t&&t.content},d=()=>s||l(),m=Element.prototype.matches||Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector,p=function(t,e){return e.exclude?m.call(t,e.selector)&&!m.call(t,e.exclude):m.call(t,e)},f="_ujsData",b=(t,e)=>t[f]?t[f][e]:void 0,h=function(t,e,n){return t[f]||(t[f]={}),t[f][e]=n},y=t=>Array.prototype.slice.call(document.querySelectorAll(t)),j=function(t){var e=!1;do{if(t.isContentEditable){e=!0;break}t=t.parentElement}while(t);return e},v=()=>{const t=document.querySelector("meta[name=csrf-token]");return t&&t.content},E=()=>{const t=document.querySelector("meta[name=csrf-param]");return t&&t.content},g=t=>{const e=v();if(e)return t.setRequestHeader("X-CSRF-Token",e)},w=()=>{const t=v(),e=E();if(t&&e)return y('form input[name="'+e+'"]').forEach((e=>e.value=t))},x={"*":"*/*",text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript",script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},S=t=>{t=k(t);var e=C(t,(function(){const n=T(null!=e.response?e.response:e.responseText,e.getResponseHeader("Content-Type"));return 2===Math.floor(e.status/100)?"function"==typeof t.success&&t.success(n,e.statusText,e):"function"==typeof t.error&&t.error(n,e.statusText,e),"function"==typeof t.complete?t.complete(e,e.statusText):void 0}));return!(t.beforeSend&&!t.beforeSend(e,t))&&(e.readyState===XMLHttpRequest.OPENED?e.send(t.data):void 0)};var k=function(t){return t.url=t.url||location.href,t.type=t.type.toUpperCase(),"GET"===t.type&&t.data&&(t.url.indexOf("?")<0?t.url+="?"+t.data:t.url+="&"+t.data),t.dataType in x||(t.dataType="*"),t.accept=x[t.dataType],"*"!==t.dataType&&(t.accept+=", */*; q=0.01"),t},C=function(t,e){const n=new XMLHttpRequest;return n.open(t.type,t.url,!0),n.setRequestHeader("Accept",t.accept),"string"==typeof t.data&&n.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),t.crossDomain||(n.setRequestHeader("X-Requested-With","XMLHttpRequest"),g(n)),n.withCredentials=!!t.withCredentials,n.onreadystatechange=function(){if(n.readyState===XMLHttpRequest.DONE)return e(n)},n},T=function(t,e){if("string"==typeof t&&"string"==typeof e)if(e.match(/\bjson\b/))try{t=JSON.parse(t)}catch(t){}else if(e.match(/\b(?:java|ecma)script\b/)){const e=document.createElement("script");e.setAttribute("nonce",d()),e.text=t,document.head.appendChild(e).parentNode.removeChild(e)}else if(e.match(/\b(xml|html|svg)\b/)){const n=new DOMParser;e=e.replace(/;.+/,"");try{t=n.parseFromString(t,e)}catch(t){}}return t};const A=function(t){const e=document.createElement("a");e.href=location.href;const n=document.createElement("a");try{return n.href=t,!((!n.protocol||":"===n.protocol)&&!n.host||e.protocol+"//"+e.host==n.protocol+"//"+n.host)}catch(t){return!0}};let D,{CustomEvent:M}=window;"function"!=typeof M&&(M=function(t,e){const n=document.createEvent("CustomEvent");return n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),n},M.prototype=window.Event.prototype,({preventDefault:D}=M.prototype),M.prototype.preventDefault=function(){const t=D.call(this);return this.cancelable&&!this.defaultPrevented&&Object.defineProperty(this,"defaultPrevented",{get:()=>!0}),t});const L=(t,e,n)=>{const a=new M(e,{bubbles:!0,cancelable:!0,detail:n});return t.dispatchEvent(a),!a.defaultPrevented},R=t=>{L(t.target,"ujs:everythingStopped"),t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation()},q=(t,e,n,a)=>t.addEventListener(n,(function(t){let{target:n}=t;for(;n instanceof Element&&!p(n,e);)n=n.parentNode;n instanceof Element&&!1===a.call(n,t)&&(t.preventDefault(),t.stopPropagation())})),H=t=>Array.prototype.slice.call(t),P=(t,e)=>{let n=[t];p(t,"form")&&(n=H(t.elements));const a=[];return n.forEach((function(t){t.name&&!t.disabled&&(p(t,"fieldset[disabled] *")||(p(t,"select")?H(t.options).forEach((function(e){e.selected&&a.push({name:t.name,value:e.value})})):(t.checked||-1===["radio","checkbox","submit"].indexOf(t.type))&&a.push({name:t.name,value:t.value})))})),e&&a.push(e),a.map((function(t){return t.name?`${encodeURIComponent(t.name)}=${encodeURIComponent(t.value)}`:t})).join("&")},O=(t,e)=>p(t,"form")?H(t.elements).filter((t=>p(t,e))):H(t.querySelectorAll(e));var I=function(t,e){let n;const a=t.getAttribute("data-confirm");if(!a)return!0;let o=!1;if(L(t,"confirm")){try{o=e.confirm(a,t)}catch(t){}n=L(t,"confirm:complete",[o])}return o&&n};const N=function(t){this.disabled&&R(t)},X=t=>{let e;if(t instanceof Event){if(K(t))return;e=t.target}else e=t;if(!j(e))return p(e,u)?F(e):p(e,c)||p(e,i)?z(e):p(e,a)?G(e):void 0},$=t=>{const e=t instanceof Event?t.target:t;if(!j(e))return p(e,u)?_(e):p(e,c)||p(e,r)?U(e):p(e,a)?Q(e):void 0};var _=function(t){if(b(t,"ujs:disabled"))return;const e=t.getAttribute("data-disable-with");return null!=e&&(h(t,"ujs:enable-with",t.innerHTML),t.innerHTML=e),t.addEventListener("click",R),h(t,"ujs:disabled",!0)},F=function(t){const e=b(t,"ujs:enable-with");return null!=e&&(t.innerHTML=e,h(t,"ujs:enable-with",null)),t.removeEventListener("click",R),h(t,"ujs:disabled",null)},Q=t=>O(t,r).forEach(U),U=function(t){if(b(t,"ujs:disabled"))return;const e=t.getAttribute("data-disable-with");return null!=e&&(p(t,"button")?(h(t,"ujs:enable-with",t.innerHTML),t.innerHTML=e):(h(t,"ujs:enable-with",t.value),t.value=e)),t.disabled=!0,h(t,"ujs:disabled",!0)},G=t=>O(t,i).forEach((t=>z(t))),z=function(t){const e=b(t,"ujs:enable-with");return null!=e&&(p(t,"button")?t.innerHTML=e:t.value=e,h(t,"ujs:enable-with",null)),t.disabled=!1,h(t,"ujs:disabled",null)},K=function(t){const e=t.detail?t.detail[0]:void 0;return e&&e.getResponseHeader("X-Xhr-Redirect")};const B=function(t){const e=this,{form:n}=e;if(n)return e.name&&h(n,"ujs:submit-button",{name:e.name,value:e.value}),h(n,"ujs:formnovalidate-button",e.formNoValidate),h(n,"ujs:submit-button-formaction",e.getAttribute("formaction")),h(n,"ujs:submit-button-formmethod",e.getAttribute("formmethod"))},J=function(t){const e=(this.getAttribute("data-method")||"GET").toUpperCase(),n=this.getAttribute("data-params"),a=(t.metaKey||t.ctrlKey)&&"GET"===e&&!n;(null!=t.button&&0!==t.button||a)&&t.stopImmediatePropagation()},V={$:y,ajax:S,buttonClickSelector:e,buttonDisableSelector:c,confirm:(t,e)=>window.confirm(t),cspNonce:d,csrfToken:v,csrfParam:E,CSRFProtection:g,delegate:q,disableElement:$,enableElement:X,fileInputSelector:"input[name][type=file]:not([disabled])",fire:L,formElements:O,formEnableSelector:i,formDisableSelector:r,formInputClickSelector:o,formSubmitButtonClick:B,formSubmitSelector:a,getData:b,handleDisabledElement:N,href:t=>t.href,inputChangeSelector:n,isCrossDomain:A,linkClickSelector:t,linkDisableSelector:u,loadCSPNonce:l,matches:p,preventInsignificantClick:J,refreshCSRFTokens:w,serializeElement:P,setData:h,stopEverything:R},W=(Y=V,function(t){I(this,Y)||R(t)});var Y;V.handleConfirm=W;const Z=(t=>function(e){const n=this,a=n.getAttribute("data-method");if(!a)return;if(j(this))return;const o=t.href(n),r=v(),i=E(),u=document.createElement("form");let c=`<input name='_method' value='${a}' type='hidden' />`;i&&r&&!A(o)&&(c+=`<input name='${i}' value='${r}' type='hidden' />`),c+='<input type="submit" />',u.method="post",u.action=o,u.target=n.target,u.innerHTML=c,u.style.display="none",document.body.appendChild(u),u.querySelector('[type="submit"]').click(),R(e)})(V);V.handleMethod=Z;const tt=(t=>function(o){let r,i,u;const c=this;if(!function(t){const e=t.getAttribute("data-remote");return null!=e&&"false"!==e}(c))return!0;if(!L(c,"ajax:before"))return L(c,"ajax:stopped"),!1;if(j(c))return L(c,"ajax:stopped"),!1;const s=c.getAttribute("data-with-credentials"),l=c.getAttribute("data-type")||"script";if(p(c,a)){const t=b(c,"ujs:submit-button");i=b(c,"ujs:submit-button-formmethod")||c.getAttribute("method")||"get",u=b(c,"ujs:submit-button-formaction")||c.getAttribute("action")||location.href,"GET"===i.toUpperCase()&&(u=u.replace(/\?.*$/,"")),"multipart/form-data"===c.enctype?(r=new FormData(c),null!=t&&r.append(t.name,t.value)):r=P(c,t),h(c,"ujs:submit-button",null),h(c,"ujs:submit-button-formmethod",null),h(c,"ujs:submit-button-formaction",null)}else p(c,e)||p(c,n)?(i=c.getAttribute("data-method"),u=c.getAttribute("data-url"),r=P(c,c.getAttribute("data-params"))):(i=c.getAttribute("data-method"),u=t.href(c),r=c.getAttribute("data-params"));S({type:i||"GET",url:u,data:r,dataType:l,beforeSend:(t,e)=>L(c,"ajax:beforeSend",[t,e])?L(c,"ajax:send",[t]):(L(c,"ajax:stopped"),!1),success:(...t)=>L(c,"ajax:success",t),error:(...t)=>L(c,"ajax:error",t),complete:(...t)=>L(c,"ajax:complete",t),crossDomain:A(u),withCredentials:null!=s&&"false"!==s}),R(o)})(V);V.handleRemote=tt;if(V.start=function(){if(window._rails_loaded)throw new Error("rails-ujs has already been loaded!");return window.addEventListener("pageshow",(function(){y(i).forEach((function(t){b(t,"ujs:disabled")&&X(t)})),y(u).forEach((function(t){b(t,"ujs:disabled")&&X(t)}))})),q(document,u,"ajax:complete",X),q(document,u,"ajax:stopped",X),q(document,c,"ajax:complete",X),q(document,c,"ajax:stopped",X),q(document,t,"click",J),q(document,t,"click",N),q(document,t,"click",W),q(document,t,"click",$),q(document,t,"click",tt),q(document,t,"click",Z),q(document,e,"click",J),q(document,e,"click",N),q(document,e,"click",W),q(document,e,"click",$),q(document,e,"click",tt),q(document,n,"change",N),q(document,n,"change",W),q(document,n,"change",tt),q(document,a,"submit",N),q(document,a,"submit",W),q(document,a,"submit",tt),q(document,a,"submit",(t=>setTimeout((()=>$(t)),13))),q(document,a,"ajax:send",$),q(document,a,"ajax:complete",X),q(document,o,"click",J),q(document,o,"click",N),q(document,o,"click",W),q(document,o,"click",B),document.addEventListener("DOMContentLoaded",w),document.addEventListener("DOMContentLoaded",l),window._rails_loaded=!0},"undefined"!=typeof jQuery&&jQuery&&jQuery.ajax){if(jQuery.rails)throw new Error("If you load both jquery_ujs and rails-ujs, use rails-ujs only.");jQuery.rails=V,jQuery.ajaxPrefilter((function(t,e,n){if(!t.crossDomain)return g(n)}))}export{V as default};
1
+ const t="a[data-confirm], a[data-method], a[data-remote]:not([disabled]), a[data-disable-with], a[data-disable]",e={selector:"button[data-remote]:not([form]), button[data-confirm]:not([form])",exclude:"form button"},n="select[data-remote], input[data-remote], textarea[data-remote]",a="form:not([data-turbo=true])",o="form:not([data-turbo=true]) input[type=submit], form:not([data-turbo=true]) input[type=image], form:not([data-turbo=true]) button[type=submit], form:not([data-turbo=true]) button:not([type]), input[type=submit][form], input[type=image][form], button[type=submit][form], button[form]:not([type])",r="input[data-disable-with]:enabled, button[data-disable-with]:enabled, textarea[data-disable-with]:enabled, input[data-disable]:enabled, button[data-disable]:enabled, textarea[data-disable]:enabled",i="input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled, input[data-disable]:disabled, button[data-disable]:disabled, textarea[data-disable]:disabled",u="a[data-disable-with], a[data-disable]",c="button[data-remote][data-disable-with], button[data-remote][data-disable]";let s=null;const l=()=>{const t=document.querySelector("meta[name=csp-nonce]");return s=t&&t.content},d=()=>s||l(),m=Element.prototype.matches||Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector,p=function(t,e){return e.exclude?m.call(t,e.selector)&&!m.call(t,e.exclude):m.call(t,e)},f="_ujsData",b=(t,e)=>t[f]?t[f][e]:void 0,h=function(t,e,n){return t[f]||(t[f]={}),t[f][e]=n},y=t=>Array.prototype.slice.call(document.querySelectorAll(t)),j=function(t){var e=!1;do{if(t.isContentEditable){e=!0;break}t=t.parentElement}while(t);return e},v=()=>{const t=document.querySelector("meta[name=csrf-token]");return t&&t.content},E=()=>{const t=document.querySelector("meta[name=csrf-param]");return t&&t.content},g=t=>{const e=v();if(e)return t.setRequestHeader("X-CSRF-Token",e)},w=()=>{const t=v(),e=E();if(t&&e)return y('form input[name="'+e+'"]').forEach(e=>e.value=t)},x={"*":"*/*",text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript",script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},S=t=>{t=k(t);var e=C(t,function(){const n=T(null!=e.response?e.response:e.responseText,e.getResponseHeader("Content-Type"));return 2===Math.floor(e.status/100)?"function"==typeof t.success&&t.success(n,e.statusText,e):"function"==typeof t.error&&t.error(n,e.statusText,e),"function"==typeof t.complete?t.complete(e,e.statusText):void 0});return!(t.beforeSend&&!t.beforeSend(e,t))&&(e.readyState===XMLHttpRequest.OPENED?e.send(t.data):void 0)};var k=function(t){return t.url=t.url||location.href,t.type=t.type.toUpperCase(),"GET"===t.type&&t.data&&(t.url.indexOf("?")<0?t.url+="?"+t.data:t.url+="&"+t.data),t.dataType in x||(t.dataType="*"),t.accept=x[t.dataType],"*"!==t.dataType&&(t.accept+=", */*; q=0.01"),t},C=function(t,e){const n=new XMLHttpRequest;return n.open(t.type,t.url,!0),n.setRequestHeader("Accept",t.accept),"string"==typeof t.data&&n.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),t.crossDomain||(n.setRequestHeader("X-Requested-With","XMLHttpRequest"),g(n)),n.withCredentials=!!t.withCredentials,n.onreadystatechange=function(){if(n.readyState===XMLHttpRequest.DONE)return e(n)},n},T=function(t,e){if("string"==typeof t&&"string"==typeof e)if(e.match(/\bjson\b/))try{t=JSON.parse(t)}catch(t){}else if(e.match(/\b(?:java|ecma)script\b/)){const e=document.createElement("script");e.setAttribute("nonce",d()),e.text=t,document.head.appendChild(e).parentNode.removeChild(e)}else if(e.match(/\b(xml|html|svg)\b/)){const n=new DOMParser;e=e.replace(/;.+/,"");try{t=n.parseFromString(t,e)}catch(t){}}return t};const A=function(t){const e=document.createElement("a");e.href=location.href;const n=document.createElement("a");try{return n.href=t,!((!n.protocol||":"===n.protocol)&&!n.host||e.protocol+"//"+e.host==n.protocol+"//"+n.host)}catch(t){return!0}};let D,{CustomEvent:M}=window;"function"!=typeof M&&(M=function(t,e){const n=document.createEvent("CustomEvent");return n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),n},M.prototype=window.Event.prototype,({preventDefault:D}=M.prototype),M.prototype.preventDefault=function(){const t=D.call(this);return this.cancelable&&!this.defaultPrevented&&Object.defineProperty(this,"defaultPrevented",{get:()=>!0}),t});const L=(t,e,n)=>{const a=new M(e,{bubbles:!0,cancelable:!0,detail:n});return t.dispatchEvent(a),!a.defaultPrevented},R=t=>{L(t.target,"ujs:everythingStopped"),t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation()},q=(t,e,n,a)=>t.addEventListener(n,function(t){let{target:n}=t;for(;n instanceof Element&&!p(n,e);)n=n.parentNode;n instanceof Element&&!1===a.call(n,t)&&(t.preventDefault(),t.stopPropagation())}),H=t=>Array.prototype.slice.call(t),P=(t,e)=>{let n=[t];p(t,"form")&&(n=H(t.elements));const a=[];return n.forEach(function(t){t.name&&!t.disabled&&(p(t,"fieldset[disabled] *")||(p(t,"select")?H(t.options).forEach(function(e){e.selected&&a.push({name:t.name,value:e.value})}):(t.checked||-1===["radio","checkbox","submit"].indexOf(t.type))&&a.push({name:t.name,value:t.value})))}),e&&a.push(e),a.map(function(t){return t.name?`${encodeURIComponent(t.name)}=${encodeURIComponent(t.value)}`:t}).join("&")},O=(t,e)=>p(t,"form")?H(t.elements).filter(t=>p(t,e)):H(t.querySelectorAll(e));var I=function(t,e){let n;const a=t.getAttribute("data-confirm");if(!a)return!0;let o=!1;if(L(t,"confirm")){try{o=e.confirm(a,t)}catch(t){}n=L(t,"confirm:complete",[o])}return o&&n};const N=function(t){this.disabled&&R(t)},X=t=>{let e;if(t instanceof Event){if(K(t))return;e=t.target}else e=t;if(!j(e))return p(e,u)?F(e):p(e,c)||p(e,i)?z(e):p(e,a)?G(e):void 0},$=t=>{const e=t instanceof Event?t.target:t;if(!j(e))return p(e,u)?_(e):p(e,c)||p(e,r)?U(e):p(e,a)?Q(e):void 0};var _=function(t){if(b(t,"ujs:disabled"))return;const e=t.getAttribute("data-disable-with");return null!=e&&(h(t,"ujs:enable-with",t.innerHTML),t.innerHTML=e),t.addEventListener("click",R),h(t,"ujs:disabled",!0)},F=function(t){const e=b(t,"ujs:enable-with");return null!=e&&(t.innerHTML=e,h(t,"ujs:enable-with",null)),t.removeEventListener("click",R),h(t,"ujs:disabled",null)},Q=t=>O(t,r).forEach(U),U=function(t){if(b(t,"ujs:disabled"))return;const e=t.getAttribute("data-disable-with");return null!=e&&(p(t,"button")?(h(t,"ujs:enable-with",t.innerHTML),t.innerHTML=e):(h(t,"ujs:enable-with",t.value),t.value=e)),t.disabled=!0,h(t,"ujs:disabled",!0)},G=t=>O(t,i).forEach(t=>z(t)),z=function(t){const e=b(t,"ujs:enable-with");return null!=e&&(p(t,"button")?t.innerHTML=e:t.value=e,h(t,"ujs:enable-with",null)),t.disabled=!1,h(t,"ujs:disabled",null)},K=function(t){const e=t.detail?t.detail[0]:void 0;return e&&e.getResponseHeader("X-Xhr-Redirect")};const B=function(t){const e=this,{form:n}=e;if(n)return e.name&&h(n,"ujs:submit-button",{name:e.name,value:e.value}),h(n,"ujs:formnovalidate-button",e.formNoValidate),h(n,"ujs:submit-button-formaction",e.getAttribute("formaction")),h(n,"ujs:submit-button-formmethod",e.getAttribute("formmethod"))},J=function(t){const e=(this.getAttribute("data-method")||"GET").toUpperCase(),n=this.getAttribute("data-params"),a=(t.metaKey||t.ctrlKey)&&"GET"===e&&!n;(null!=t.button&&0!==t.button||a)&&t.stopImmediatePropagation()},V={$:y,ajax:S,buttonClickSelector:e,buttonDisableSelector:c,confirm:(t,e)=>window.confirm(t),cspNonce:d,csrfToken:v,csrfParam:E,CSRFProtection:g,delegate:q,disableElement:$,enableElement:X,fileInputSelector:"input[name][type=file]:not([disabled])",fire:L,formElements:O,formEnableSelector:i,formDisableSelector:r,formInputClickSelector:o,formSubmitButtonClick:B,formSubmitSelector:a,getData:b,handleDisabledElement:N,href:t=>t.href,inputChangeSelector:n,isCrossDomain:A,linkClickSelector:t,linkDisableSelector:u,loadCSPNonce:l,matches:p,preventInsignificantClick:J,refreshCSRFTokens:w,serializeElement:P,setData:h,stopEverything:R},W=(Y=V,function(t){I(this,Y)||R(t)});var Y;V.handleConfirm=W;const Z=(t=>function(e){const n=this,a=n.getAttribute("data-method");if(!a)return;if(j(this))return;const o=t.href(n),r=v(),i=E(),u=document.createElement("form");let c=`<input name='_method' value='${a}' type='hidden' />`;i&&r&&!A(o)&&(c+=`<input name='${i}' value='${r}' type='hidden' />`),c+='<input type="submit" />',u.method="post",u.action=o,u.target=n.target,u.innerHTML=c,u.style.display="none",document.body.appendChild(u),u.querySelector('[type="submit"]').click(),R(e)})(V);V.handleMethod=Z;const tt=(t=>function(o){let r,i,u;const c=this;if(!function(t){const e=t.getAttribute("data-remote");return null!=e&&"false"!==e}(c))return!0;if(!L(c,"ajax:before"))return L(c,"ajax:stopped"),!1;if(j(c))return L(c,"ajax:stopped"),!1;const s=c.getAttribute("data-with-credentials"),l=c.getAttribute("data-type")||"script";if(p(c,a)){const t=b(c,"ujs:submit-button");i=b(c,"ujs:submit-button-formmethod")||c.getAttribute("method")||"get",u=b(c,"ujs:submit-button-formaction")||c.getAttribute("action")||location.href,"GET"===i.toUpperCase()&&(u=u.replace(/\?.*$/,"")),"multipart/form-data"===c.enctype?(r=new FormData(c),null!=t&&r.append(t.name,t.value)):r=P(c,t),h(c,"ujs:submit-button",null),h(c,"ujs:submit-button-formmethod",null),h(c,"ujs:submit-button-formaction",null)}else p(c,e)||p(c,n)?(i=c.getAttribute("data-method"),u=c.getAttribute("data-url"),r=P(c,c.getAttribute("data-params"))):(i=c.getAttribute("data-method"),u=t.href(c),r=c.getAttribute("data-params"));S({type:i||"GET",url:u,data:r,dataType:l,beforeSend:(t,e)=>L(c,"ajax:beforeSend",[t,e])?L(c,"ajax:send",[t]):(L(c,"ajax:stopped"),!1),success:(...t)=>L(c,"ajax:success",t),error:(...t)=>L(c,"ajax:error",t),complete:(...t)=>L(c,"ajax:complete",t),crossDomain:A(u),withCredentials:null!=s&&"false"!==s}),R(o)})(V);V.handleRemote=tt;if(V.start=function(){if(window._rails_loaded)throw new Error("rails-ujs has already been loaded!");return window.addEventListener("pageshow",function(){y(i).forEach(function(t){b(t,"ujs:disabled")&&X(t)}),y(u).forEach(function(t){b(t,"ujs:disabled")&&X(t)})}),q(document,u,"ajax:complete",X),q(document,u,"ajax:stopped",X),q(document,c,"ajax:complete",X),q(document,c,"ajax:stopped",X),q(document,t,"click",J),q(document,t,"click",N),q(document,t,"click",W),q(document,t,"click",$),q(document,t,"click",tt),q(document,t,"click",Z),q(document,e,"click",J),q(document,e,"click",N),q(document,e,"click",W),q(document,e,"click",$),q(document,e,"click",tt),q(document,n,"change",N),q(document,n,"change",W),q(document,n,"change",tt),q(document,a,"submit",N),q(document,a,"submit",W),q(document,a,"submit",tt),q(document,a,"submit",t=>setTimeout(()=>$(t),13)),q(document,a,"ajax:send",$),q(document,a,"ajax:complete",X),q(document,o,"click",J),q(document,o,"click",N),q(document,o,"click",W),q(document,o,"click",B),document.addEventListener("DOMContentLoaded",w),document.addEventListener("DOMContentLoaded",l),window._rails_loaded=!0},"undefined"!=typeof jQuery&&jQuery&&jQuery.ajax){if(jQuery.rails)throw new Error("If you load both jquery_ujs and rails-ujs, use rails-ujs only.");jQuery.rails=V,jQuery.ajaxPrefilter(function(t,e,n){if(!t.crossDomain)return g(n)})}export{V as default};