plutonium 0.10.2 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (228) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -0
  3. data/Rakefile +1 -2
  4. data/app/assets/application.js.bk +31419 -0
  5. data/app/assets/plutonium-logo-original.png +0 -0
  6. data/app/assets/plutonium-logo-white.png +0 -0
  7. data/app/assets/plutonium-logo.png +0 -0
  8. data/app/assets/plutonium.css +1 -0
  9. data/app/assets/plutonium.ico +0 -0
  10. data/app/assets/plutonium.js +12416 -0
  11. data/app/assets/plutonium.js.map +7 -0
  12. data/app/assets/plutonium.min.js +39 -0
  13. data/app/assets/plutonium.min.js.map +7 -0
  14. data/app/views/application/_flash_alerts.html.erb +5 -2
  15. data/app/views/application/_flash_toasts.html.erb +2 -0
  16. data/app/views/application/_resource_header.html.erb +263 -697
  17. data/app/views/application/_resource_sidebar.html.erb +14 -12
  18. data/app/views/components/action_button/action_button_component.rb +3 -3
  19. data/app/views/components/attributes.rb +184 -0
  20. data/app/views/components/base.rb +19 -40
  21. data/app/views/components/block/block_component.html.erb +1 -1
  22. data/app/views/components/block/block_component.rb +11 -7
  23. data/app/views/components/breadcrumbs/breadcrumbs_component.rb +3 -3
  24. data/app/views/components/button/button_component.html.erb +2 -2
  25. data/app/views/components/button/button_component.rb +10 -5
  26. data/app/views/components/dyna_frame_content/dyna_frame_content_component.html.erb +1 -0
  27. data/app/views/components/dyna_frame_content/dyna_frame_content_component.rb +3 -3
  28. data/app/views/components/dyna_frame_host/dyna_frame_host_component.html.erb +1 -2
  29. data/app/views/components/dyna_frame_host/dyna_frame_host_component.rb +12 -5
  30. data/app/views/components/empty_card/empty_card_component.rb +3 -3
  31. data/app/views/components/form/form_builder.rb +1 -1
  32. data/app/views/components/form/form_component.rb +3 -3
  33. data/app/views/components/has_many_panel/has_many_panel_component.html.erb +25 -0
  34. data/app/views/components/has_many_panel/has_many_panel_component.rb +16 -0
  35. data/app/views/components/header/header_component.rb +3 -3
  36. data/app/views/components/interactive_action_form/interactive_action_form_component.rb +3 -3
  37. data/app/views/components/nav_grid_menu/nav_grid_menu_component.html.erb +24 -0
  38. data/app/views/components/nav_grid_menu/nav_grid_menu_component.rb +23 -0
  39. data/app/views/components/nav_grid_menu_item/nav_grid_menu_item_component.html.erb +4 -0
  40. data/app/views/components/nav_grid_menu_item/nav_grid_menu_item_component.rb +20 -0
  41. data/app/views/components/nav_user/nav_user_component.html.erb +50 -0
  42. data/app/views/components/nav_user/nav_user_component.rb +32 -0
  43. data/app/views/components/nav_user_link/nav_user_link_component.html.erb +7 -0
  44. data/app/views/components/nav_user_link/nav_user_link_component.rb +23 -0
  45. data/app/views/components/nav_user_section/nav_user_section_component.html.erb +7 -0
  46. data/app/views/components/nav_user_section/nav_user_section_component.rb +18 -0
  47. data/app/views/components/nested_resource_form_fields/nested_resource_form_fields_component.html.erb +1 -3
  48. data/app/views/components/nested_resource_form_fields/nested_resource_form_fields_component.rb +11 -5
  49. data/app/views/components/pagination/pagination_component.html.erb +1 -1
  50. data/app/views/components/pagination/pagination_component.rb +10 -7
  51. data/app/views/components/panel/panel_component.html.erb +13 -6
  52. data/app/views/components/panel/panel_component.rb +11 -5
  53. data/app/views/components/resource_header/resource_header_component.html.erb +81 -0
  54. data/app/views/components/resource_header/resource_header_component.rb +20 -0
  55. data/app/views/components/resource_layout/resource_layout_component.html.erb +32 -0
  56. data/app/views/components/resource_layout/resource_layout_component.rb +39 -0
  57. data/app/views/components/sidebar/sidebar_component.html.erb +3 -33
  58. data/app/views/components/sidebar/sidebar_component.rb +3 -3
  59. data/app/views/components/sidebar_menu/sidebar_menu_component.html.erb +4 -2
  60. data/app/views/components/sidebar_menu/sidebar_menu_component.rb +10 -6
  61. data/app/views/components/sidebar_menu_item/sidebar_menu_item_component.html.erb +63 -71
  62. data/app/views/components/sidebar_menu_item/sidebar_menu_item_component.rb +27 -8
  63. data/app/views/components/skeleton/table/table_component.html.erb +1 -1
  64. data/app/views/components/skeleton/table/table_component.rb +3 -3
  65. data/app/views/components/table/table_component.html.erb +40 -89
  66. data/app/views/components/table/table_component.rb +124 -28
  67. data/app/views/components/table_search_input/table_search_input_component.html.erb +1 -1
  68. data/app/views/components/table_search_input/table_search_input_component.rb +11 -6
  69. data/app/views/components/table_toolbar/table_toolbar_component.html.erb +1 -1
  70. data/app/views/components/table_toolbar/table_toolbar_component.rb +11 -3
  71. data/app/views/components/toolbar/toolbar_component.html.erb +2 -2
  72. data/app/views/components/toolbar/toolbar_component.rb +16 -8
  73. data/app/views/layouts/resource.html copy.erb +2 -2
  74. data/app/views/layouts/resource.html.erb +21 -37
  75. data/app/views/layouts/rodauth.html.erb +32 -25
  76. data/app/views/resource/_interactive_resource_action_form.html.erb +1 -1
  77. data/app/views/resource/_resource_details.html.erb +8 -5
  78. data/app/views/resource/_resource_table.html.erb +70 -1
  79. data/app/views/resource/interactive_resource_collection_action.html.erb +1 -0
  80. data/app/views/resource/interactive_resource_record_action.html.erb +1 -0
  81. data/app/views/resource/interactive_resource_recordless_action.html.erb +1 -0
  82. data/app/views/resource/new.html.erb +1 -0
  83. data/app/views/rodauth/add_recovery_codes.html.erb +8 -7
  84. data/app/views/rodauth/otp_auth.html.erb +1 -1
  85. data/app/views/rodauth/otp_setup.html.erb +10 -8
  86. data/config/initializers/simple_form.rb +22 -2
  87. data/esbuild.config.js +35 -31
  88. data/lib/generators/pu/core/assets/assets_generator.rb +41 -0
  89. data/lib/generators/pu/core/assets/templates/tailwind.config.js +18 -0
  90. data/lib/generators/pu/core/install/templates/config/initializers/plutonium.rb +3 -0
  91. data/lib/generators/pu/core/ruby/ruby_generator.rb +30 -0
  92. data/lib/generators/pu/core/ruby/templates/.keep +0 -0
  93. data/lib/generators/pu/docker/install/install_generator.rb +35 -0
  94. data/lib/generators/pu/docker/install/templates/.keep +0 -0
  95. data/lib/generators/pu/docker/install/templates/Dockerfile.dev.tt +30 -0
  96. data/lib/generators/pu/docker/install/templates/Dockerfile.tt +75 -0
  97. data/lib/generators/pu/docker/install/templates/bin/console +3 -0
  98. data/lib/generators/pu/docker/install/templates/bin/restart +3 -0
  99. data/lib/generators/pu/docker/install/templates/bin/shell +3 -0
  100. data/lib/generators/pu/docker/install/templates/docker-compose.yml +29 -0
  101. data/lib/generators/pu/gem/dotenv/dotenv_generator.rb +32 -0
  102. data/lib/generators/pu/gem/dotenv/templates/.env +6 -0
  103. data/lib/generators/pu/gem/dotenv/templates/.env.local +5 -0
  104. data/lib/generators/pu/gem/dotenv/templates/.env.local.template +5 -0
  105. data/lib/generators/pu/gem/dotenv/templates/.env.template +6 -0
  106. data/lib/generators/pu/gem/dotenv/templates/.keep +0 -0
  107. data/lib/generators/pu/gem/dotenv/templates/config/initializers/001_ensure_required_env.rb +21 -0
  108. data/lib/generators/pu/gem/redis/redis_generator.rb +22 -0
  109. data/lib/generators/pu/gem/redis/templates/.keep +0 -0
  110. data/lib/generators/pu/gen/component/component_generator.rb +13 -10
  111. data/lib/generators/pu/gen/component/templates/component.html.erb.tt +1 -1
  112. data/lib/generators/pu/gen/component/templates/component.rb.tt +10 -4
  113. data/lib/generators/pu/lib/plutonium_generators/concerns/actions.rb +154 -32
  114. data/lib/generators/pu/lib/plutonium_generators/generator.rb +6 -6
  115. data/lib/generators/pu/lib/plutonium_generators/installer.rb +1 -1
  116. data/lib/generators/pu/pkg/app/app_generator.rb +4 -4
  117. data/lib/generators/pu/pkg/app/templates/app/controllers/concerns/controller.rb.tt +28 -0
  118. data/lib/generators/pu/pkg/app/templates/app/controllers/controller.rb.tt +5 -0
  119. data/lib/generators/pu/pkg/app/templates/app/controllers/dashboard_controller.rb.tt +1 -1
  120. data/lib/generators/pu/res/conn/conn_generator.rb +4 -4
  121. data/lib/generators/pu/res/conn/templates/app/controllers/resource_controller.rb.tt +1 -1
  122. data/lib/generators/pu/res/model/model_generator.rb +3 -3
  123. data/lib/generators/pu/res/scaffold/templates/policy.rb.tt +6 -0
  124. data/lib/generators/pu/rodauth/account_generator.rb +10 -10
  125. data/lib/generators/pu/rodauth/install_generator.rb +9 -2
  126. data/lib/generators/pu/rodauth/migration/sequel/audit_logging.erb +2 -2
  127. data/lib/generators/pu/rodauth/migration_generator.rb +1 -1
  128. data/lib/generators/pu/rodauth/templates/app/{misc → rodauth}/account_rodauth_plugin.rb.tt +2 -2
  129. data/lib/generators/pu/rodauth/templates/app/{misc → rodauth}/rodauth_plugin.rb.tt +0 -3
  130. data/lib/generators/pu/rodauth/templates/db/migrate/install_rodauth.rb.tt +5 -0
  131. data/lib/generators/pu/service/postgres/postgres_generator.rb +61 -0
  132. data/lib/generators/pu/service/postgres/templates/.keep +0 -0
  133. data/lib/generators/pu/service/postgres/templates/bin/initdb.d/create-multiple-postgresql-databases.sh +22 -0
  134. data/lib/generators/pu/service/postgres/templates/database.yml.tt +93 -0
  135. data/lib/generators/pu/service/sidekiq/sidekiq_generator.rb +57 -0
  136. data/lib/generators/pu/service/sidekiq/templates/.keep +0 -0
  137. data/lib/generators/pu/service/sidekiq/templates/app/sidekiq/sidekiq_job.rb +3 -0
  138. data/lib/generators/pu/service/sidekiq/templates/config/initializers/sidekiq.rb +53 -0
  139. data/lib/generators/pu/service/sidekiq/templates/config/sidekiq.yml +6 -0
  140. data/lib/plutonium/config.rb +2 -9
  141. data/lib/plutonium/core/associations/renderers/basic_renderer.rb +28 -0
  142. data/lib/plutonium/core/associations/renderers/factory.rb +36 -0
  143. data/lib/plutonium/core/associations/renderers/has_many_renderer.rb +16 -0
  144. data/lib/plutonium/core/autodiscovery/association_renderer_discoverer.rb +31 -0
  145. data/lib/plutonium/core/controllers/authorizable.rb +13 -17
  146. data/lib/plutonium/core/controllers/base.rb +3 -7
  147. data/lib/plutonium/core/controllers/entity_scoping.rb +3 -3
  148. data/lib/plutonium/core/controllers/presentable.rb +6 -1
  149. data/lib/plutonium/core/definers/association_renderer_definer.rb +33 -0
  150. data/lib/plutonium/core/fields/inputs/checkbox_input.rb +13 -0
  151. data/lib/plutonium/core/fields/inputs/factory.rb +1 -0
  152. data/lib/plutonium/core/fields/inputs/polymorphic_belongs_to_association_input.rb +1 -1
  153. data/lib/plutonium/core/ui/detail.rb +1 -0
  154. data/lib/plutonium/helpers/application_helper.rb +8 -9
  155. data/lib/plutonium/helpers/assets_helper.rb +33 -0
  156. data/lib/plutonium/helpers/display_helper.rb +13 -0
  157. data/lib/plutonium/helpers/form_helper.rb +1 -1
  158. data/lib/plutonium/helpers.rb +1 -0
  159. data/lib/plutonium/icons.rb +12 -5
  160. data/lib/plutonium/pkg/app.rb +10 -0
  161. data/lib/plutonium/pundit/context.rb +18 -0
  162. data/lib/plutonium/pundit/policy_finder.rb +25 -0
  163. data/lib/plutonium/railtie.rb +24 -8
  164. data/lib/plutonium/reloader.rb +18 -7
  165. data/lib/plutonium/resource/controller.rb +5 -0
  166. data/lib/plutonium/resource/policy.rb +69 -47
  167. data/lib/plutonium/resource/presenter.rb +1 -0
  168. data/lib/plutonium/resource/query_object.rb +139 -130
  169. data/lib/plutonium/rodauth/controller_methods.rb +7 -3
  170. data/lib/plutonium/version.rb +1 -1
  171. data/lib/plutonium.rb +10 -54
  172. data/lib/tasks/create_rodauth_admin.rake +16 -0
  173. data/package-lock.json +782 -17
  174. data/package.json +31 -8
  175. data/postcss.config.js +17 -7
  176. data/src/.npmignore +2 -0
  177. data/src/js/controllers/color_mode_controller.js +41 -0
  178. data/src/js/controllers/frame_navigator_controller.js +99 -0
  179. data/src/js/controllers/has_many_panel_controller.js +8 -0
  180. data/src/js/controllers/nav_grid_menu_controller.js +8 -0
  181. data/src/js/controllers/nav_grid_menu_item_controller.js +8 -0
  182. data/{app/views/components/tab_bar/tab_bar_controller.js → src/js/controllers/nav_user_controller.js} +2 -2
  183. data/src/js/controllers/nav_user_link_controller.js +8 -0
  184. data/src/js/controllers/nav_user_section_controller.js +8 -0
  185. data/src/js/controllers/register_controllers.js +45 -0
  186. data/{app/assets/javascripts → src/js}/controllers/resource_dismiss_controller.js +2 -0
  187. data/{app/assets/javascripts → src/js}/controllers/resource_drop_down_controller.js +2 -0
  188. data/src/js/controllers/resource_header_controller.js +8 -0
  189. data/src/js/controllers/resource_layout_controller.js +8 -0
  190. data/src/js/controllers/sidebar_menu_controller.js +8 -0
  191. data/src/js/controllers/sidebar_menu_item_controller.js +8 -0
  192. data/src/js/core.js +4 -0
  193. data/{app/assets/javascripts/plutonium-app.js → src/js/plutonium.js} +1 -1
  194. data/{app/assets/javascripts → src/js}/turbo/turbo_debug.js +2 -4
  195. data/tailwind.config.js +85 -84
  196. metadata +106 -41
  197. data/app/assets/build/plutonium.js +0 -5122
  198. data/app/assets/javascripts/controllers/index.js +0 -34
  199. data/app/assets/javascripts/plutonium.js +0 -1
  200. data/app/views/application/_color_modes.html.erb +0 -57
  201. data/app/views/components/tab_bar/tab_bar_component.html.erb +0 -11
  202. data/app/views/components/tab_bar/tab_bar_component.rb +0 -9
  203. data/app/views/resource/_nav_user.html.erb +0 -4
  204. data/app/views/resource/_tab_menu.html.erb +0 -13
  205. data/css.manifest +0 -3
  206. data/js.manifest +0 -4
  207. data/lib/generators/pu/pkg/app/templates/app/controllers/app_controller.rb.tt +0 -5
  208. data/lib/generators/pu/pkg/app/templates/app/controllers/package_controller.rb.tt +0 -26
  209. data/public/plutonium-assets/application.css +0 -25086
  210. data/public/plutonium-assets/plutonium-app-36KN5FVJ.js +0 -6
  211. data/public/plutonium-assets/plutonium-app-36KN5FVJ.js.map +0 -7
  212. data/public/plutonium-assets/plutonium-app-6WILQCTT.js +0 -39
  213. data/public/plutonium-assets/plutonium-app-6WILQCTT.js.map +0 -7
  214. data/public/plutonium-assets/plutonium.2d4f0c333cd000051d3b.css +0 -3424
  215. data/public/plutonium-assets/plutonium.50232e35b5495f5ad90d.css +0 -3415
  216. /data/{app/assets/build → lib/generators/pu/core/assets/templates}/.keep +0 -0
  217. /data/lib/generators/pu/rodauth/templates/app/{misc → rodauth}/rodauth_app.rb.tt +0 -0
  218. /data/{app/assets/stylesheets → src/css}/plutonium.css +0 -0
  219. /data/{app/views/components/form → src/js/controllers}/form_controller.js +0 -0
  220. /data/{app/views/components/interactive_action_form → src/js/controllers}/interactive_action_form_controller.js +0 -0
  221. /data/{app/views/components/nested_resource_form_fields → src/js/controllers}/nested_resource_form_fields_controller.js +0 -0
  222. /data/{app/views/components/table → src/js/controllers}/table_controller.js +0 -0
  223. /data/{app/views/components/table_search_input → src/js/controllers}/table_search_input_controller.js +0 -0
  224. /data/{app/views/components/table_toolbar → src/js/controllers}/table_toolbar_controller.js +0 -0
  225. /data/{app/views/components/toolbar → src/js/controllers}/toolbar_controller.js +0 -0
  226. /data/{app/assets/javascripts → src/js}/turbo/index.js +0 -0
  227. /data/{app/assets/javascripts → src/js}/turbo/turbo_actions.js +0 -0
  228. /data/{app/assets/javascripts → src/js}/turbo/turbo_frame_monkey_patch.js +0 -0
@@ -1,6 +0,0 @@
1
- (()=>{var nn=Object.create;var Yi=Object.defineProperty;var sn=Object.getOwnPropertyDescriptor;var on=Object.getOwnPropertyNames;var an=Object.getPrototypeOf,ln=Object.prototype.hasOwnProperty;var cn=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports);var dn=(i,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of on(t))!ln.call(i,n)&&n!==e&&Yi(i,n,{get:()=>t[n],enumerable:!(r=sn(t,n))||r.enumerable});return i};var un=(i,t,e)=>(e=i!=null?nn(an(i)):{},dn(t||!i||!i.__esModule?Yi(e,"default",{value:i,enumerable:!0}):e,i));var hr=cn((Fo,ur)=>{var es="Expected a function",cr=NaN,is="[object Symbol]",rs=/^\s+|\s+$/g,ns=/^[-+]0x[0-9a-f]+$/i,ss=/^0b[01]+$/i,os=/^0o[0-7]+$/i,as=parseInt,ls=typeof global=="object"&&global&&global.Object===Object&&global,cs=typeof self=="object"&&self&&self.Object===Object&&self,ds=ls||cs||Function("return this")(),us=Object.prototype,hs=us.toString,ps=Math.max,fs=Math.min,bi=function(){return ds.Date.now()};function ms(i,t,e){var r,n,s,o,a,l,d=0,c=!1,m=!1,_=!0;if(typeof i!="function")throw new TypeError(es);t=dr(t)||0,_i(e)&&(c=!!e.leading,m="maxWait"in e,s=m?ps(dr(e.maxWait)||0,t):s,_="trailing"in e?!!e.trailing:_);function p(h){var b=r,k=n;return r=n=void 0,d=h,o=i.apply(k,b),o}function E(h){return d=h,a=setTimeout(w,t),c?p(h):o}function g(h){var b=h-l,k=h-d,L=t-b;return m?fs(L,s-k):L}function v(h){var b=h-l,k=h-d;return l===void 0||b>=t||b<0||m&&k>=s}function w(){var h=bi();if(v(h))return x(h);a=setTimeout(w,g(h))}function x(h){return a=void 0,_&&r?p(h):(r=n=void 0,o)}function C(){a!==void 0&&clearTimeout(a),d=0,r=l=n=a=void 0}function f(){return a===void 0?o:x(bi())}function y(){var h=bi(),b=v(h);if(r=arguments,n=this,l=h,b){if(a===void 0)return E(l);if(m)return a=setTimeout(w,t),p(l)}return a===void 0&&(a=setTimeout(w,t)),o}return y.cancel=C,y.flush=f,y}function _i(i){var t=typeof i;return!!i&&(t=="object"||t=="function")}function vs(i){return!!i&&typeof i=="object"}function gs(i){return typeof i=="symbol"||vs(i)&&hs.call(i)==is}function dr(i){if(typeof i=="number")return i;if(gs(i))return cr;if(_i(i)){var t=typeof i.valueOf=="function"?i.valueOf():i;i=_i(t)?t+"":t}if(typeof i!="string")return i===0?i:+i;i=i.replace(rs,"");var e=ss.test(i);return e||os.test(i)?as(i.slice(2),e?2:8):ns.test(i)?cr:+i}ur.exports=ms});var Ye=class{constructor(t,e,r){this.eventTarget=t,this.eventName=e,this.eventOptions=r,this.unorderedBindings=new Set}connect(){this.eventTarget.addEventListener(this.eventName,this,this.eventOptions)}disconnect(){this.eventTarget.removeEventListener(this.eventName,this,this.eventOptions)}bindingConnected(t){this.unorderedBindings.add(t)}bindingDisconnected(t){this.unorderedBindings.delete(t)}handleEvent(t){let e=hn(t);for(let r of this.bindings){if(e.immediatePropagationStopped)break;r.handleEvent(e)}}hasBindings(){return this.unorderedBindings.size>0}get bindings(){return Array.from(this.unorderedBindings).sort((t,e)=>{let r=t.index,n=e.index;return r<n?-1:r>n?1:0})}};function hn(i){if("immediatePropagationStopped"in i)return i;{let{stopImmediatePropagation:t}=i;return Object.assign(i,{immediatePropagationStopped:!1,stopImmediatePropagation(){this.immediatePropagationStopped=!0,t.call(this)}})}}var Je=class{constructor(t){this.application=t,this.eventListenerMaps=new Map,this.started=!1}start(){this.started||(this.started=!0,this.eventListeners.forEach(t=>t.connect()))}stop(){this.started&&(this.started=!1,this.eventListeners.forEach(t=>t.disconnect()))}get eventListeners(){return Array.from(this.eventListenerMaps.values()).reduce((t,e)=>t.concat(Array.from(e.values())),[])}bindingConnected(t){this.fetchEventListenerForBinding(t).bindingConnected(t)}bindingDisconnected(t,e=!1){this.fetchEventListenerForBinding(t).bindingDisconnected(t),e&&this.clearEventListenersForBinding(t)}handleError(t,e,r={}){this.application.handleError(t,`Error ${e}`,r)}clearEventListenersForBinding(t){let e=this.fetchEventListenerForBinding(t);e.hasBindings()||(e.disconnect(),this.removeMappedEventListenerFor(t))}removeMappedEventListenerFor(t){let{eventTarget:e,eventName:r,eventOptions:n}=t,s=this.fetchEventListenerMapForEventTarget(e),o=this.cacheKey(r,n);s.delete(o),s.size==0&&this.eventListenerMaps.delete(e)}fetchEventListenerForBinding(t){let{eventTarget:e,eventName:r,eventOptions:n}=t;return this.fetchEventListener(e,r,n)}fetchEventListener(t,e,r){let n=this.fetchEventListenerMapForEventTarget(t),s=this.cacheKey(e,r),o=n.get(s);return o||(o=this.createEventListener(t,e,r),n.set(s,o)),o}createEventListener(t,e,r){let n=new Ye(t,e,r);return this.started&&n.connect(),n}fetchEventListenerMapForEventTarget(t){let e=this.eventListenerMaps.get(t);return e||(e=new Map,this.eventListenerMaps.set(t,e)),e}cacheKey(t,e){let r=[t];return Object.keys(e).sort().forEach(n=>{r.push(`${e[n]?"":"!"}${n}`)}),r.join(":")}},pn={stop({event:i,value:t}){return t&&i.stopPropagation(),!0},prevent({event:i,value:t}){return t&&i.preventDefault(),!0},self({event:i,value:t,element:e}){return t?e===i.target:!0}},fn=/^(?:(?:([^.]+?)\+)?(.+?)(?:\.(.+?))?(?:@(window|document))?->)?(.+?)(?:#([^:]+?))(?::(.+))?$/;function mn(i){let e=i.trim().match(fn)||[],r=e[2],n=e[3];return n&&!["keydown","keyup","keypress"].includes(r)&&(r+=`.${n}`,n=""),{eventTarget:vn(e[4]),eventName:r,eventOptions:e[7]?gn(e[7]):{},identifier:e[5],methodName:e[6],keyFilter:e[1]||n}}function vn(i){if(i=="window")return window;if(i=="document")return document}function gn(i){return i.split(":").reduce((t,e)=>Object.assign(t,{[e.replace(/^!/,"")]:!/^!/.test(e)}),{})}function yn(i){if(i==window)return"window";if(i==document)return"document"}function yi(i){return i.replace(/(?:[_-])([a-z0-9])/g,(t,e)=>e.toUpperCase())}function Ge(i){return yi(i.replace(/--/g,"-").replace(/__/g,"_"))}function qt(i){return i.charAt(0).toUpperCase()+i.slice(1)}function sr(i){return i.replace(/([A-Z])/g,(t,e)=>`-${e.toLowerCase()}`)}function bn(i){return i.match(/[^\s]+/g)||[]}function Ji(i){return i!=null}function Ze(i,t){return Object.prototype.hasOwnProperty.call(i,t)}var Gi=["meta","ctrl","alt","shift"],Qe=class{constructor(t,e,r,n){this.element=t,this.index=e,this.eventTarget=r.eventTarget||t,this.eventName=r.eventName||_n(t)||se("missing event name"),this.eventOptions=r.eventOptions||{},this.identifier=r.identifier||se("missing identifier"),this.methodName=r.methodName||se("missing method name"),this.keyFilter=r.keyFilter||"",this.schema=n}static forToken(t,e){return new this(t.element,t.index,mn(t.content),e)}toString(){let t=this.keyFilter?`.${this.keyFilter}`:"",e=this.eventTargetName?`@${this.eventTargetName}`:"";return`${this.eventName}${t}${e}->${this.identifier}#${this.methodName}`}shouldIgnoreKeyboardEvent(t){if(!this.keyFilter)return!1;let e=this.keyFilter.split("+");if(this.keyFilterDissatisfied(t,e))return!0;let r=e.filter(n=>!Gi.includes(n))[0];return r?(Ze(this.keyMappings,r)||se(`contains unknown key filter: ${this.keyFilter}`),this.keyMappings[r].toLowerCase()!==t.key.toLowerCase()):!1}shouldIgnoreMouseEvent(t){if(!this.keyFilter)return!1;let e=[this.keyFilter];return!!this.keyFilterDissatisfied(t,e)}get params(){let t={},e=new RegExp(`^data-${this.identifier}-(.+)-param$`,"i");for(let{name:r,value:n}of Array.from(this.element.attributes)){let s=r.match(e),o=s&&s[1];o&&(t[yi(o)]=wn(n))}return t}get eventTargetName(){return yn(this.eventTarget)}get keyMappings(){return this.schema.keyMappings}keyFilterDissatisfied(t,e){let[r,n,s,o]=Gi.map(a=>e.includes(a));return t.metaKey!==r||t.ctrlKey!==n||t.altKey!==s||t.shiftKey!==o}},Zi={a:()=>"click",button:()=>"click",form:()=>"submit",details:()=>"toggle",input:i=>i.getAttribute("type")=="submit"?"click":"input",select:()=>"change",textarea:()=>"input"};function _n(i){let t=i.tagName.toLowerCase();if(t in Zi)return Zi[t](i)}function se(i){throw new Error(i)}function wn(i){try{return JSON.parse(i)}catch{return i}}var ti=class{constructor(t,e){this.context=t,this.action=e}get index(){return this.action.index}get eventTarget(){return this.action.eventTarget}get eventOptions(){return this.action.eventOptions}get identifier(){return this.context.identifier}handleEvent(t){let e=this.prepareActionEvent(t);this.willBeInvokedByEvent(t)&&this.applyEventModifiers(e)&&this.invokeWithEvent(e)}get eventName(){return this.action.eventName}get method(){let t=this.controller[this.methodName];if(typeof t=="function")return t;throw new Error(`Action "${this.action}" references undefined method "${this.methodName}"`)}applyEventModifiers(t){let{element:e}=this.action,{actionDescriptorFilters:r}=this.context.application,{controller:n}=this.context,s=!0;for(let[o,a]of Object.entries(this.eventOptions))if(o in r){let l=r[o];s=s&&l({name:o,value:a,event:t,element:e,controller:n})}else continue;return s}prepareActionEvent(t){return Object.assign(t,{params:this.action.params})}invokeWithEvent(t){let{target:e,currentTarget:r}=t;try{this.method.call(this.controller,t),this.context.logDebugActivity(this.methodName,{event:t,target:e,currentTarget:r,action:this.methodName})}catch(n){let{identifier:s,controller:o,element:a,index:l}=this,d={identifier:s,controller:o,element:a,index:l,event:t};this.context.handleError(n,`invoking action "${this.action}"`,d)}}willBeInvokedByEvent(t){let e=t.target;return t instanceof KeyboardEvent&&this.action.shouldIgnoreKeyboardEvent(t)||t instanceof MouseEvent&&this.action.shouldIgnoreMouseEvent(t)?!1:this.element===e?!0:e instanceof Element&&this.element.contains(e)?this.scope.containsElement(e):this.scope.containsElement(this.action.element)}get controller(){return this.context.controller}get methodName(){return this.action.methodName}get element(){return this.scope.element}get scope(){return this.context.scope}},oe=class{constructor(t,e){this.mutationObserverInit={attributes:!0,childList:!0,subtree:!0},this.element=t,this.started=!1,this.delegate=e,this.elements=new Set,this.mutationObserver=new MutationObserver(r=>this.processMutations(r))}start(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,this.mutationObserverInit),this.refresh())}pause(t){this.started&&(this.mutationObserver.disconnect(),this.started=!1),t(),this.started||(this.mutationObserver.observe(this.element,this.mutationObserverInit),this.started=!0)}stop(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)}refresh(){if(this.started){let t=new Set(this.matchElementsInTree());for(let e of Array.from(this.elements))t.has(e)||this.removeElement(e);for(let e of Array.from(t))this.addElement(e)}}processMutations(t){if(this.started)for(let e of t)this.processMutation(e)}processMutation(t){t.type=="attributes"?this.processAttributeChange(t.target,t.attributeName):t.type=="childList"&&(this.processRemovedNodes(t.removedNodes),this.processAddedNodes(t.addedNodes))}processAttributeChange(t,e){this.elements.has(t)?this.delegate.elementAttributeChanged&&this.matchElement(t)?this.delegate.elementAttributeChanged(t,e):this.removeElement(t):this.matchElement(t)&&this.addElement(t)}processRemovedNodes(t){for(let e of Array.from(t)){let r=this.elementFromNode(e);r&&this.processTree(r,this.removeElement)}}processAddedNodes(t){for(let e of Array.from(t)){let r=this.elementFromNode(e);r&&this.elementIsActive(r)&&this.processTree(r,this.addElement)}}matchElement(t){return this.delegate.matchElement(t)}matchElementsInTree(t=this.element){return this.delegate.matchElementsInTree(t)}processTree(t,e){for(let r of this.matchElementsInTree(t))e.call(this,r)}elementFromNode(t){if(t.nodeType==Node.ELEMENT_NODE)return t}elementIsActive(t){return t.isConnected!=this.element.isConnected?!1:this.element.contains(t)}addElement(t){this.elements.has(t)||this.elementIsActive(t)&&(this.elements.add(t),this.delegate.elementMatched&&this.delegate.elementMatched(t))}removeElement(t){this.elements.has(t)&&(this.elements.delete(t),this.delegate.elementUnmatched&&this.delegate.elementUnmatched(t))}},ae=class{constructor(t,e,r){this.attributeName=e,this.delegate=r,this.elementObserver=new oe(t,this)}get element(){return this.elementObserver.element}get selector(){return`[${this.attributeName}]`}start(){this.elementObserver.start()}pause(t){this.elementObserver.pause(t)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get started(){return this.elementObserver.started}matchElement(t){return t.hasAttribute(this.attributeName)}matchElementsInTree(t){let e=this.matchElement(t)?[t]:[],r=Array.from(t.querySelectorAll(this.selector));return e.concat(r)}elementMatched(t){this.delegate.elementMatchedAttribute&&this.delegate.elementMatchedAttribute(t,this.attributeName)}elementUnmatched(t){this.delegate.elementUnmatchedAttribute&&this.delegate.elementUnmatchedAttribute(t,this.attributeName)}elementAttributeChanged(t,e){this.delegate.elementAttributeValueChanged&&this.attributeName==e&&this.delegate.elementAttributeValueChanged(t,e)}};function En(i,t,e){or(i,t).add(e)}function xn(i,t,e){or(i,t).delete(e),An(i,t)}function or(i,t){let e=i.get(t);return e||(e=new Set,i.set(t,e)),e}function An(i,t){let e=i.get(t);e!=null&&e.size==0&&i.delete(t)}var J=class{constructor(){this.valuesByKey=new Map}get keys(){return Array.from(this.valuesByKey.keys())}get values(){return Array.from(this.valuesByKey.values()).reduce((e,r)=>e.concat(Array.from(r)),[])}get size(){return Array.from(this.valuesByKey.values()).reduce((e,r)=>e+r.size,0)}add(t,e){En(this.valuesByKey,t,e)}delete(t,e){xn(this.valuesByKey,t,e)}has(t,e){let r=this.valuesByKey.get(t);return r!=null&&r.has(e)}hasKey(t){return this.valuesByKey.has(t)}hasValue(t){return Array.from(this.valuesByKey.values()).some(r=>r.has(t))}getValuesForKey(t){let e=this.valuesByKey.get(t);return e?Array.from(e):[]}getKeysForValue(t){return Array.from(this.valuesByKey).filter(([e,r])=>r.has(t)).map(([e,r])=>e)}};var ei=class{constructor(t,e,r,n){this._selector=e,this.details=n,this.elementObserver=new oe(t,this),this.delegate=r,this.matchesByElement=new J}get started(){return this.elementObserver.started}get selector(){return this._selector}set selector(t){this._selector=t,this.refresh()}start(){this.elementObserver.start()}pause(t){this.elementObserver.pause(t)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get element(){return this.elementObserver.element}matchElement(t){let{selector:e}=this;if(e){let r=t.matches(e);return this.delegate.selectorMatchElement?r&&this.delegate.selectorMatchElement(t,this.details):r}else return!1}matchElementsInTree(t){let{selector:e}=this;if(e){let r=this.matchElement(t)?[t]:[],n=Array.from(t.querySelectorAll(e)).filter(s=>this.matchElement(s));return r.concat(n)}else return[]}elementMatched(t){let{selector:e}=this;e&&this.selectorMatched(t,e)}elementUnmatched(t){let e=this.matchesByElement.getKeysForValue(t);for(let r of e)this.selectorUnmatched(t,r)}elementAttributeChanged(t,e){let{selector:r}=this;if(r){let n=this.matchElement(t),s=this.matchesByElement.has(r,t);n&&!s?this.selectorMatched(t,r):!n&&s&&this.selectorUnmatched(t,r)}}selectorMatched(t,e){this.delegate.selectorMatched(t,e,this.details),this.matchesByElement.add(e,t)}selectorUnmatched(t,e){this.delegate.selectorUnmatched(t,e,this.details),this.matchesByElement.delete(e,t)}},ii=class{constructor(t,e){this.element=t,this.delegate=e,this.started=!1,this.stringMap=new Map,this.mutationObserver=new MutationObserver(r=>this.processMutations(r))}start(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,{attributes:!0,attributeOldValue:!0}),this.refresh())}stop(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)}refresh(){if(this.started)for(let t of this.knownAttributeNames)this.refreshAttribute(t,null)}processMutations(t){if(this.started)for(let e of t)this.processMutation(e)}processMutation(t){let e=t.attributeName;e&&this.refreshAttribute(e,t.oldValue)}refreshAttribute(t,e){let r=this.delegate.getStringMapKeyForAttribute(t);if(r!=null){this.stringMap.has(t)||this.stringMapKeyAdded(r,t);let n=this.element.getAttribute(t);if(this.stringMap.get(t)!=n&&this.stringMapValueChanged(n,r,e),n==null){let s=this.stringMap.get(t);this.stringMap.delete(t),s&&this.stringMapKeyRemoved(r,t,s)}else this.stringMap.set(t,n)}}stringMapKeyAdded(t,e){this.delegate.stringMapKeyAdded&&this.delegate.stringMapKeyAdded(t,e)}stringMapValueChanged(t,e,r){this.delegate.stringMapValueChanged&&this.delegate.stringMapValueChanged(t,e,r)}stringMapKeyRemoved(t,e,r){this.delegate.stringMapKeyRemoved&&this.delegate.stringMapKeyRemoved(t,e,r)}get knownAttributeNames(){return Array.from(new Set(this.currentAttributeNames.concat(this.recordedAttributeNames)))}get currentAttributeNames(){return Array.from(this.element.attributes).map(t=>t.name)}get recordedAttributeNames(){return Array.from(this.stringMap.keys())}},le=class{constructor(t,e,r){this.attributeObserver=new ae(t,e,this),this.delegate=r,this.tokensByElement=new J}get started(){return this.attributeObserver.started}start(){this.attributeObserver.start()}pause(t){this.attributeObserver.pause(t)}stop(){this.attributeObserver.stop()}refresh(){this.attributeObserver.refresh()}get element(){return this.attributeObserver.element}get attributeName(){return this.attributeObserver.attributeName}elementMatchedAttribute(t){this.tokensMatched(this.readTokensForElement(t))}elementAttributeValueChanged(t){let[e,r]=this.refreshTokensForElement(t);this.tokensUnmatched(e),this.tokensMatched(r)}elementUnmatchedAttribute(t){this.tokensUnmatched(this.tokensByElement.getValuesForKey(t))}tokensMatched(t){t.forEach(e=>this.tokenMatched(e))}tokensUnmatched(t){t.forEach(e=>this.tokenUnmatched(e))}tokenMatched(t){this.delegate.tokenMatched(t),this.tokensByElement.add(t.element,t)}tokenUnmatched(t){this.delegate.tokenUnmatched(t),this.tokensByElement.delete(t.element,t)}refreshTokensForElement(t){let e=this.tokensByElement.getValuesForKey(t),r=this.readTokensForElement(t),n=Cn(e,r).findIndex(([s,o])=>!kn(s,o));return n==-1?[[],[]]:[e.slice(n),r.slice(n)]}readTokensForElement(t){let e=this.attributeName,r=t.getAttribute(e)||"";return On(r,t,e)}};function On(i,t,e){return i.trim().split(/\s+/).filter(r=>r.length).map((r,n)=>({element:t,attributeName:e,content:r,index:n}))}function Cn(i,t){let e=Math.max(i.length,t.length);return Array.from({length:e},(r,n)=>[i[n],t[n]])}function kn(i,t){return i&&t&&i.index==t.index&&i.content==t.content}var ce=class{constructor(t,e,r){this.tokenListObserver=new le(t,e,this),this.delegate=r,this.parseResultsByToken=new WeakMap,this.valuesByTokenByElement=new WeakMap}get started(){return this.tokenListObserver.started}start(){this.tokenListObserver.start()}stop(){this.tokenListObserver.stop()}refresh(){this.tokenListObserver.refresh()}get element(){return this.tokenListObserver.element}get attributeName(){return this.tokenListObserver.attributeName}tokenMatched(t){let{element:e}=t,{value:r}=this.fetchParseResultForToken(t);r&&(this.fetchValuesByTokenForElement(e).set(t,r),this.delegate.elementMatchedValue(e,r))}tokenUnmatched(t){let{element:e}=t,{value:r}=this.fetchParseResultForToken(t);r&&(this.fetchValuesByTokenForElement(e).delete(t),this.delegate.elementUnmatchedValue(e,r))}fetchParseResultForToken(t){let e=this.parseResultsByToken.get(t);return e||(e=this.parseToken(t),this.parseResultsByToken.set(t,e)),e}fetchValuesByTokenForElement(t){let e=this.valuesByTokenByElement.get(t);return e||(e=new Map,this.valuesByTokenByElement.set(t,e)),e}parseToken(t){try{return{value:this.delegate.parseValueForToken(t)}}catch(e){return{error:e}}}},ri=class{constructor(t,e){this.context=t,this.delegate=e,this.bindingsByAction=new Map}start(){this.valueListObserver||(this.valueListObserver=new ce(this.element,this.actionAttribute,this),this.valueListObserver.start())}stop(){this.valueListObserver&&(this.valueListObserver.stop(),delete this.valueListObserver,this.disconnectAllActions())}get element(){return this.context.element}get identifier(){return this.context.identifier}get actionAttribute(){return this.schema.actionAttribute}get schema(){return this.context.schema}get bindings(){return Array.from(this.bindingsByAction.values())}connectAction(t){let e=new ti(this.context,t);this.bindingsByAction.set(t,e),this.delegate.bindingConnected(e)}disconnectAction(t){let e=this.bindingsByAction.get(t);e&&(this.bindingsByAction.delete(t),this.delegate.bindingDisconnected(e))}disconnectAllActions(){this.bindings.forEach(t=>this.delegate.bindingDisconnected(t,!0)),this.bindingsByAction.clear()}parseValueForToken(t){let e=Qe.forToken(t,this.schema);if(e.identifier==this.identifier)return e}elementMatchedValue(t,e){this.connectAction(e)}elementUnmatchedValue(t,e){this.disconnectAction(e)}},ni=class{constructor(t,e){this.context=t,this.receiver=e,this.stringMapObserver=new ii(this.element,this),this.valueDescriptorMap=this.controller.valueDescriptorMap}start(){this.stringMapObserver.start(),this.invokeChangedCallbacksForDefaultValues()}stop(){this.stringMapObserver.stop()}get element(){return this.context.element}get controller(){return this.context.controller}getStringMapKeyForAttribute(t){if(t in this.valueDescriptorMap)return this.valueDescriptorMap[t].name}stringMapKeyAdded(t,e){let r=this.valueDescriptorMap[e];this.hasValue(t)||this.invokeChangedCallback(t,r.writer(this.receiver[t]),r.writer(r.defaultValue))}stringMapValueChanged(t,e,r){let n=this.valueDescriptorNameMap[e];t!==null&&(r===null&&(r=n.writer(n.defaultValue)),this.invokeChangedCallback(e,t,r))}stringMapKeyRemoved(t,e,r){let n=this.valueDescriptorNameMap[t];this.hasValue(t)?this.invokeChangedCallback(t,n.writer(this.receiver[t]),r):this.invokeChangedCallback(t,n.writer(n.defaultValue),r)}invokeChangedCallbacksForDefaultValues(){for(let{key:t,name:e,defaultValue:r,writer:n}of this.valueDescriptors)r!=null&&!this.controller.data.has(t)&&this.invokeChangedCallback(e,n(r),void 0)}invokeChangedCallback(t,e,r){let n=`${t}Changed`,s=this.receiver[n];if(typeof s=="function"){let o=this.valueDescriptorNameMap[t];try{let a=o.reader(e),l=r;r&&(l=o.reader(r)),s.call(this.receiver,a,l)}catch(a){throw a instanceof TypeError&&(a.message=`Stimulus Value "${this.context.identifier}.${o.name}" - ${a.message}`),a}}}get valueDescriptors(){let{valueDescriptorMap:t}=this;return Object.keys(t).map(e=>t[e])}get valueDescriptorNameMap(){let t={};return Object.keys(this.valueDescriptorMap).forEach(e=>{let r=this.valueDescriptorMap[e];t[r.name]=r}),t}hasValue(t){let e=this.valueDescriptorNameMap[t],r=`has${qt(e.name)}`;return this.receiver[r]}},si=class{constructor(t,e){this.context=t,this.delegate=e,this.targetsByName=new J}start(){this.tokenListObserver||(this.tokenListObserver=new le(this.element,this.attributeName,this),this.tokenListObserver.start())}stop(){this.tokenListObserver&&(this.disconnectAllTargets(),this.tokenListObserver.stop(),delete this.tokenListObserver)}tokenMatched({element:t,content:e}){this.scope.containsElement(t)&&this.connectTarget(t,e)}tokenUnmatched({element:t,content:e}){this.disconnectTarget(t,e)}connectTarget(t,e){var r;this.targetsByName.has(e,t)||(this.targetsByName.add(e,t),(r=this.tokenListObserver)===null||r===void 0||r.pause(()=>this.delegate.targetConnected(t,e)))}disconnectTarget(t,e){var r;this.targetsByName.has(e,t)&&(this.targetsByName.delete(e,t),(r=this.tokenListObserver)===null||r===void 0||r.pause(()=>this.delegate.targetDisconnected(t,e)))}disconnectAllTargets(){for(let t of this.targetsByName.keys)for(let e of this.targetsByName.getValuesForKey(t))this.disconnectTarget(e,t)}get attributeName(){return`data-${this.context.identifier}-target`}get element(){return this.context.element}get scope(){return this.context.scope}};function Wt(i,t){let e=ar(i);return Array.from(e.reduce((r,n)=>(Ln(n,t).forEach(s=>r.add(s)),r),new Set))}function In(i,t){return ar(i).reduce((r,n)=>(r.push(...Tn(n,t)),r),[])}function ar(i){let t=[];for(;i;)t.push(i),i=Object.getPrototypeOf(i);return t.reverse()}function Ln(i,t){let e=i[t];return Array.isArray(e)?e:[]}function Tn(i,t){let e=i[t];return e?Object.keys(e).map(r=>[r,e[r]]):[]}var oi=class{constructor(t,e){this.started=!1,this.context=t,this.delegate=e,this.outletsByName=new J,this.outletElementsByName=new J,this.selectorObserverMap=new Map,this.attributeObserverMap=new Map}start(){this.started||(this.outletDefinitions.forEach(t=>{this.setupSelectorObserverForOutlet(t),this.setupAttributeObserverForOutlet(t)}),this.started=!0,this.dependentContexts.forEach(t=>t.refresh()))}refresh(){this.selectorObserverMap.forEach(t=>t.refresh()),this.attributeObserverMap.forEach(t=>t.refresh())}stop(){this.started&&(this.started=!1,this.disconnectAllOutlets(),this.stopSelectorObservers(),this.stopAttributeObservers())}stopSelectorObservers(){this.selectorObserverMap.size>0&&(this.selectorObserverMap.forEach(t=>t.stop()),this.selectorObserverMap.clear())}stopAttributeObservers(){this.attributeObserverMap.size>0&&(this.attributeObserverMap.forEach(t=>t.stop()),this.attributeObserverMap.clear())}selectorMatched(t,e,{outletName:r}){let n=this.getOutlet(t,r);n&&this.connectOutlet(n,t,r)}selectorUnmatched(t,e,{outletName:r}){let n=this.getOutletFromMap(t,r);n&&this.disconnectOutlet(n,t,r)}selectorMatchElement(t,{outletName:e}){let r=this.selector(e),n=this.hasOutlet(t,e),s=t.matches(`[${this.schema.controllerAttribute}~=${e}]`);return r?n&&s&&t.matches(r):!1}elementMatchedAttribute(t,e){let r=this.getOutletNameFromOutletAttributeName(e);r&&this.updateSelectorObserverForOutlet(r)}elementAttributeValueChanged(t,e){let r=this.getOutletNameFromOutletAttributeName(e);r&&this.updateSelectorObserverForOutlet(r)}elementUnmatchedAttribute(t,e){let r=this.getOutletNameFromOutletAttributeName(e);r&&this.updateSelectorObserverForOutlet(r)}connectOutlet(t,e,r){var n;this.outletElementsByName.has(r,e)||(this.outletsByName.add(r,t),this.outletElementsByName.add(r,e),(n=this.selectorObserverMap.get(r))===null||n===void 0||n.pause(()=>this.delegate.outletConnected(t,e,r)))}disconnectOutlet(t,e,r){var n;this.outletElementsByName.has(r,e)&&(this.outletsByName.delete(r,t),this.outletElementsByName.delete(r,e),(n=this.selectorObserverMap.get(r))===null||n===void 0||n.pause(()=>this.delegate.outletDisconnected(t,e,r)))}disconnectAllOutlets(){for(let t of this.outletElementsByName.keys)for(let e of this.outletElementsByName.getValuesForKey(t))for(let r of this.outletsByName.getValuesForKey(t))this.disconnectOutlet(r,e,t)}updateSelectorObserverForOutlet(t){let e=this.selectorObserverMap.get(t);e&&(e.selector=this.selector(t))}setupSelectorObserverForOutlet(t){let e=this.selector(t),r=new ei(document.body,e,this,{outletName:t});this.selectorObserverMap.set(t,r),r.start()}setupAttributeObserverForOutlet(t){let e=this.attributeNameForOutletName(t),r=new ae(this.scope.element,e,this);this.attributeObserverMap.set(t,r),r.start()}selector(t){return this.scope.outlets.getSelectorForOutletName(t)}attributeNameForOutletName(t){return this.scope.schema.outletAttributeForScope(this.identifier,t)}getOutletNameFromOutletAttributeName(t){return this.outletDefinitions.find(e=>this.attributeNameForOutletName(e)===t)}get outletDependencies(){let t=new J;return this.router.modules.forEach(e=>{let r=e.definition.controllerConstructor;Wt(r,"outlets").forEach(s=>t.add(s,e.identifier))}),t}get outletDefinitions(){return this.outletDependencies.getKeysForValue(this.identifier)}get dependentControllerIdentifiers(){return this.outletDependencies.getValuesForKey(this.identifier)}get dependentContexts(){let t=this.dependentControllerIdentifiers;return this.router.contexts.filter(e=>t.includes(e.identifier))}hasOutlet(t,e){return!!this.getOutlet(t,e)||!!this.getOutletFromMap(t,e)}getOutlet(t,e){return this.application.getControllerForElementAndIdentifier(t,e)}getOutletFromMap(t,e){return this.outletsByName.getValuesForKey(e).find(r=>r.element===t)}get scope(){return this.context.scope}get schema(){return this.context.schema}get identifier(){return this.context.identifier}get application(){return this.context.application}get router(){return this.application.router}},ai=class{constructor(t,e){this.logDebugActivity=(r,n={})=>{let{identifier:s,controller:o,element:a}=this;n=Object.assign({identifier:s,controller:o,element:a},n),this.application.logDebugActivity(this.identifier,r,n)},this.module=t,this.scope=e,this.controller=new t.controllerConstructor(this),this.bindingObserver=new ri(this,this.dispatcher),this.valueObserver=new ni(this,this.controller),this.targetObserver=new si(this,this),this.outletObserver=new oi(this,this);try{this.controller.initialize(),this.logDebugActivity("initialize")}catch(r){this.handleError(r,"initializing controller")}}connect(){this.bindingObserver.start(),this.valueObserver.start(),this.targetObserver.start(),this.outletObserver.start();try{this.controller.connect(),this.logDebugActivity("connect")}catch(t){this.handleError(t,"connecting controller")}}refresh(){this.outletObserver.refresh()}disconnect(){try{this.controller.disconnect(),this.logDebugActivity("disconnect")}catch(t){this.handleError(t,"disconnecting controller")}this.outletObserver.stop(),this.targetObserver.stop(),this.valueObserver.stop(),this.bindingObserver.stop()}get application(){return this.module.application}get identifier(){return this.module.identifier}get schema(){return this.application.schema}get dispatcher(){return this.application.dispatcher}get element(){return this.scope.element}get parentElement(){return this.element.parentElement}handleError(t,e,r={}){let{identifier:n,controller:s,element:o}=this;r=Object.assign({identifier:n,controller:s,element:o},r),this.application.handleError(t,`Error ${e}`,r)}targetConnected(t,e){this.invokeControllerMethod(`${e}TargetConnected`,t)}targetDisconnected(t,e){this.invokeControllerMethod(`${e}TargetDisconnected`,t)}outletConnected(t,e,r){this.invokeControllerMethod(`${Ge(r)}OutletConnected`,t,e)}outletDisconnected(t,e,r){this.invokeControllerMethod(`${Ge(r)}OutletDisconnected`,t,e)}invokeControllerMethod(t,...e){let r=this.controller;typeof r[t]=="function"&&r[t](...e)}};function Dn(i){return Sn(i,Mn(i))}function Sn(i,t){let e=jn(i),r=Bn(i.prototype,t);return Object.defineProperties(e.prototype,r),e}function Mn(i){return Wt(i,"blessings").reduce((e,r)=>{let n=r(i);for(let s in n){let o=e[s]||{};e[s]=Object.assign(o,n[s])}return e},{})}function Bn(i,t){return Fn(t).reduce((e,r)=>{let n=Pn(i,t,r);return n&&Object.assign(e,{[r]:n}),e},{})}function Pn(i,t,e){let r=Object.getOwnPropertyDescriptor(i,e);if(!(r&&"value"in r)){let s=Object.getOwnPropertyDescriptor(t,e).value;return r&&(s.get=r.get||s.get,s.set=r.set||s.set),s}}var Fn=typeof Object.getOwnPropertySymbols=="function"?i=>[...Object.getOwnPropertyNames(i),...Object.getOwnPropertySymbols(i)]:Object.getOwnPropertyNames,jn=(()=>{function i(e){function r(){return Reflect.construct(e,arguments,new.target)}return r.prototype=Object.create(e.prototype,{constructor:{value:r}}),Reflect.setPrototypeOf(r,e),r}function t(){let r=i(function(){this.a.call(this)});return r.prototype.a=function(){},new r}try{return t(),i}catch{return r=>class extends r{}}})();function Nn(i){return{identifier:i.identifier,controllerConstructor:Dn(i.controllerConstructor)}}var li=class{constructor(t,e){this.application=t,this.definition=Nn(e),this.contextsByScope=new WeakMap,this.connectedContexts=new Set}get identifier(){return this.definition.identifier}get controllerConstructor(){return this.definition.controllerConstructor}get contexts(){return Array.from(this.connectedContexts)}connectContextForScope(t){let e=this.fetchContextForScope(t);this.connectedContexts.add(e),e.connect()}disconnectContextForScope(t){let e=this.contextsByScope.get(t);e&&(this.connectedContexts.delete(e),e.disconnect())}fetchContextForScope(t){let e=this.contextsByScope.get(t);return e||(e=new ai(this,t),this.contextsByScope.set(t,e)),e}},ci=class{constructor(t){this.scope=t}has(t){return this.data.has(this.getDataKey(t))}get(t){return this.getAll(t)[0]}getAll(t){let e=this.data.get(this.getDataKey(t))||"";return bn(e)}getAttributeName(t){return this.data.getAttributeNameForKey(this.getDataKey(t))}getDataKey(t){return`${t}-class`}get data(){return this.scope.data}},di=class{constructor(t){this.scope=t}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get(t){let e=this.getAttributeNameForKey(t);return this.element.getAttribute(e)}set(t,e){let r=this.getAttributeNameForKey(t);return this.element.setAttribute(r,e),this.get(t)}has(t){let e=this.getAttributeNameForKey(t);return this.element.hasAttribute(e)}delete(t){if(this.has(t)){let e=this.getAttributeNameForKey(t);return this.element.removeAttribute(e),!0}else return!1}getAttributeNameForKey(t){return`data-${this.identifier}-${sr(t)}`}},ui=class{constructor(t){this.warnedKeysByObject=new WeakMap,this.logger=t}warn(t,e,r){let n=this.warnedKeysByObject.get(t);n||(n=new Set,this.warnedKeysByObject.set(t,n)),n.has(e)||(n.add(e),this.logger.warn(r,t))}};function hi(i,t){return`[${i}~="${t}"]`}var pi=class{constructor(t){this.scope=t}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(t){return this.find(t)!=null}find(...t){return t.reduce((e,r)=>e||this.findTarget(r)||this.findLegacyTarget(r),void 0)}findAll(...t){return t.reduce((e,r)=>[...e,...this.findAllTargets(r),...this.findAllLegacyTargets(r)],[])}findTarget(t){let e=this.getSelectorForTargetName(t);return this.scope.findElement(e)}findAllTargets(t){let e=this.getSelectorForTargetName(t);return this.scope.findAllElements(e)}getSelectorForTargetName(t){let e=this.schema.targetAttributeForScope(this.identifier);return hi(e,t)}findLegacyTarget(t){let e=this.getLegacySelectorForTargetName(t);return this.deprecate(this.scope.findElement(e),t)}findAllLegacyTargets(t){let e=this.getLegacySelectorForTargetName(t);return this.scope.findAllElements(e).map(r=>this.deprecate(r,t))}getLegacySelectorForTargetName(t){let e=`${this.identifier}.${t}`;return hi(this.schema.targetAttribute,e)}deprecate(t,e){if(t){let{identifier:r}=this,n=this.schema.targetAttribute,s=this.schema.targetAttributeForScope(r);this.guide.warn(t,`target:${e}`,`Please replace ${n}="${r}.${e}" with ${s}="${e}". The ${n} attribute is deprecated and will be removed in a future version of Stimulus.`)}return t}get guide(){return this.scope.guide}},fi=class{constructor(t,e){this.scope=t,this.controllerElement=e}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(t){return this.find(t)!=null}find(...t){return t.reduce((e,r)=>e||this.findOutlet(r),void 0)}findAll(...t){return t.reduce((e,r)=>[...e,...this.findAllOutlets(r)],[])}getSelectorForOutletName(t){let e=this.schema.outletAttributeForScope(this.identifier,t);return this.controllerElement.getAttribute(e)}findOutlet(t){let e=this.getSelectorForOutletName(t);if(e)return this.findElement(e,t)}findAllOutlets(t){let e=this.getSelectorForOutletName(t);return e?this.findAllElements(e,t):[]}findElement(t,e){return this.scope.queryElements(t).filter(n=>this.matchesElement(n,t,e))[0]}findAllElements(t,e){return this.scope.queryElements(t).filter(n=>this.matchesElement(n,t,e))}matchesElement(t,e,r){let n=t.getAttribute(this.scope.schema.controllerAttribute)||"";return t.matches(e)&&n.split(" ").includes(r)}},mi=class i{constructor(t,e,r,n){this.targets=new pi(this),this.classes=new ci(this),this.data=new di(this),this.containsElement=s=>s.closest(this.controllerSelector)===this.element,this.schema=t,this.element=e,this.identifier=r,this.guide=new ui(n),this.outlets=new fi(this.documentScope,e)}findElement(t){return this.element.matches(t)?this.element:this.queryElements(t).find(this.containsElement)}findAllElements(t){return[...this.element.matches(t)?[this.element]:[],...this.queryElements(t).filter(this.containsElement)]}queryElements(t){return Array.from(this.element.querySelectorAll(t))}get controllerSelector(){return hi(this.schema.controllerAttribute,this.identifier)}get isDocumentScope(){return this.element===document.documentElement}get documentScope(){return this.isDocumentScope?this:new i(this.schema,document.documentElement,this.identifier,this.guide.logger)}},vi=class{constructor(t,e,r){this.element=t,this.schema=e,this.delegate=r,this.valueListObserver=new ce(this.element,this.controllerAttribute,this),this.scopesByIdentifierByElement=new WeakMap,this.scopeReferenceCounts=new WeakMap}start(){this.valueListObserver.start()}stop(){this.valueListObserver.stop()}get controllerAttribute(){return this.schema.controllerAttribute}parseValueForToken(t){let{element:e,content:r}=t;return this.parseValueForElementAndIdentifier(e,r)}parseValueForElementAndIdentifier(t,e){let r=this.fetchScopesByIdentifierForElement(t),n=r.get(e);return n||(n=this.delegate.createScopeForElementAndIdentifier(t,e),r.set(e,n)),n}elementMatchedValue(t,e){let r=(this.scopeReferenceCounts.get(e)||0)+1;this.scopeReferenceCounts.set(e,r),r==1&&this.delegate.scopeConnected(e)}elementUnmatchedValue(t,e){let r=this.scopeReferenceCounts.get(e);r&&(this.scopeReferenceCounts.set(e,r-1),r==1&&this.delegate.scopeDisconnected(e))}fetchScopesByIdentifierForElement(t){let e=this.scopesByIdentifierByElement.get(t);return e||(e=new Map,this.scopesByIdentifierByElement.set(t,e)),e}},gi=class{constructor(t){this.application=t,this.scopeObserver=new vi(this.element,this.schema,this),this.scopesByIdentifier=new J,this.modulesByIdentifier=new Map}get element(){return this.application.element}get schema(){return this.application.schema}get logger(){return this.application.logger}get controllerAttribute(){return this.schema.controllerAttribute}get modules(){return Array.from(this.modulesByIdentifier.values())}get contexts(){return this.modules.reduce((t,e)=>t.concat(e.contexts),[])}start(){this.scopeObserver.start()}stop(){this.scopeObserver.stop()}loadDefinition(t){this.unloadIdentifier(t.identifier);let e=new li(this.application,t);this.connectModule(e);let r=t.controllerConstructor.afterLoad;r&&r.call(t.controllerConstructor,t.identifier,this.application)}unloadIdentifier(t){let e=this.modulesByIdentifier.get(t);e&&this.disconnectModule(e)}getContextForElementAndIdentifier(t,e){let r=this.modulesByIdentifier.get(e);if(r)return r.contexts.find(n=>n.element==t)}proposeToConnectScopeForElementAndIdentifier(t,e){let r=this.scopeObserver.parseValueForElementAndIdentifier(t,e);r?this.scopeObserver.elementMatchedValue(r.element,r):console.error(`Couldn't find or create scope for identifier: "${e}" and element:`,t)}handleError(t,e,r){this.application.handleError(t,e,r)}createScopeForElementAndIdentifier(t,e){return new mi(this.schema,t,e,this.logger)}scopeConnected(t){this.scopesByIdentifier.add(t.identifier,t);let e=this.modulesByIdentifier.get(t.identifier);e&&e.connectContextForScope(t)}scopeDisconnected(t){this.scopesByIdentifier.delete(t.identifier,t);let e=this.modulesByIdentifier.get(t.identifier);e&&e.disconnectContextForScope(t)}connectModule(t){this.modulesByIdentifier.set(t.identifier,t),this.scopesByIdentifier.getValuesForKey(t.identifier).forEach(r=>t.connectContextForScope(r))}disconnectModule(t){this.modulesByIdentifier.delete(t.identifier),this.scopesByIdentifier.getValuesForKey(t.identifier).forEach(r=>t.disconnectContextForScope(r))}},Vn={controllerAttribute:"data-controller",actionAttribute:"data-action",targetAttribute:"data-target",targetAttributeForScope:i=>`data-${i}-target`,outletAttributeForScope:(i,t)=>`data-${i}-${t}-outlet`,keyMappings:Object.assign(Object.assign({enter:"Enter",tab:"Tab",esc:"Escape",space:" ",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",home:"Home",end:"End",page_up:"PageUp",page_down:"PageDown"},Qi("abcdefghijklmnopqrstuvwxyz".split("").map(i=>[i,i]))),Qi("0123456789".split("").map(i=>[i,i])))};function Qi(i){return i.reduce((t,[e,r])=>Object.assign(Object.assign({},t),{[e]:r}),{})}var de=class{constructor(t=document.documentElement,e=Vn){this.logger=console,this.debug=!1,this.logDebugActivity=(r,n,s={})=>{this.debug&&this.logFormattedMessage(r,n,s)},this.element=t,this.schema=e,this.dispatcher=new Je(this),this.router=new gi(this),this.actionDescriptorFilters=Object.assign({},pn)}static start(t,e){let r=new this(t,e);return r.start(),r}async start(){await Hn(),this.logDebugActivity("application","starting"),this.dispatcher.start(),this.router.start(),this.logDebugActivity("application","start")}stop(){this.logDebugActivity("application","stopping"),this.dispatcher.stop(),this.router.stop(),this.logDebugActivity("application","stop")}register(t,e){this.load({identifier:t,controllerConstructor:e})}registerActionOption(t,e){this.actionDescriptorFilters[t]=e}load(t,...e){(Array.isArray(t)?t:[t,...e]).forEach(n=>{n.controllerConstructor.shouldLoad&&this.router.loadDefinition(n)})}unload(t,...e){(Array.isArray(t)?t:[t,...e]).forEach(n=>this.router.unloadIdentifier(n))}get controllers(){return this.router.contexts.map(t=>t.controller)}getControllerForElementAndIdentifier(t,e){let r=this.router.getContextForElementAndIdentifier(t,e);return r?r.controller:null}handleError(t,e,r){var n;this.logger.error(`%s
2
-
3
- %o
4
-
5
- %o`,e,t,r),(n=window.onerror)===null||n===void 0||n.call(window,e,"",0,0,t)}logFormattedMessage(t,e,r={}){r=Object.assign({application:this},r),this.logger.groupCollapsed(`${t} #${e}`),this.logger.log("details:",Object.assign({},r)),this.logger.groupEnd()}};function Hn(){return new Promise(i=>{document.readyState=="loading"?document.addEventListener("DOMContentLoaded",()=>i()):i()})}function zn(i){return Wt(i,"classes").reduce((e,r)=>Object.assign(e,Rn(r)),{})}function Rn(i){return{[`${i}Class`]:{get(){let{classes:t}=this;if(t.has(i))return t.get(i);{let e=t.getAttributeName(i);throw new Error(`Missing attribute "${e}"`)}}},[`${i}Classes`]:{get(){return this.classes.getAll(i)}},[`has${qt(i)}Class`]:{get(){return this.classes.has(i)}}}}function Kn(i){return Wt(i,"outlets").reduce((e,r)=>Object.assign(e,$n(r)),{})}function tr(i,t,e){return i.application.getControllerForElementAndIdentifier(t,e)}function er(i,t,e){let r=tr(i,t,e);if(r||(i.application.router.proposeToConnectScopeForElementAndIdentifier(t,e),r=tr(i,t,e),r))return r}function $n(i){let t=Ge(i);return{[`${t}Outlet`]:{get(){let e=this.outlets.find(i),r=this.outlets.getSelectorForOutletName(i);if(e){let n=er(this,e,i);if(n)return n;throw new Error(`The provided outlet element is missing an outlet controller "${i}" instance for host controller "${this.identifier}"`)}throw new Error(`Missing outlet element "${i}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${r}".`)}},[`${t}Outlets`]:{get(){let e=this.outlets.findAll(i);return e.length>0?e.map(r=>{let n=er(this,r,i);if(n)return n;console.warn(`The provided outlet element is missing an outlet controller "${i}" instance for host controller "${this.identifier}"`,r)}).filter(r=>r):[]}},[`${t}OutletElement`]:{get(){let e=this.outlets.find(i),r=this.outlets.getSelectorForOutletName(i);if(e)return e;throw new Error(`Missing outlet element "${i}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${r}".`)}},[`${t}OutletElements`]:{get(){return this.outlets.findAll(i)}},[`has${qt(t)}Outlet`]:{get(){return this.outlets.has(i)}}}}function qn(i){return Wt(i,"targets").reduce((e,r)=>Object.assign(e,Wn(r)),{})}function Wn(i){return{[`${i}Target`]:{get(){let t=this.targets.find(i);if(t)return t;throw new Error(`Missing target element "${i}" for "${this.identifier}" controller`)}},[`${i}Targets`]:{get(){return this.targets.findAll(i)}},[`has${qt(i)}Target`]:{get(){return this.targets.has(i)}}}}function Un(i){let t=In(i,"values"),e={valueDescriptorMap:{get(){return t.reduce((r,n)=>{let s=lr(n,this.identifier),o=this.data.getAttributeNameForKey(s.key);return Object.assign(r,{[o]:s})},{})}}};return t.reduce((r,n)=>Object.assign(r,Xn(n)),e)}function Xn(i,t){let e=lr(i,t),{key:r,name:n,reader:s,writer:o}=e;return{[n]:{get(){let a=this.data.get(r);return a!==null?s(a):e.defaultValue},set(a){a===void 0?this.data.delete(r):this.data.set(r,o(a))}},[`has${qt(n)}`]:{get(){return this.data.has(r)||e.hasCustomDefaultValue}}}}function lr([i,t],e){return Zn({controller:e,token:i,typeDefinition:t})}function ue(i){switch(i){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function $t(i){switch(typeof i){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}if(Array.isArray(i))return"array";if(Object.prototype.toString.call(i)==="[object Object]")return"object"}function Yn(i){let{controller:t,token:e,typeObject:r}=i,n=Ji(r.type),s=Ji(r.default),o=n&&s,a=n&&!s,l=!n&&s,d=ue(r.type),c=$t(i.typeObject.default);if(a)return d;if(l)return c;if(d!==c){let m=t?`${t}.${e}`:e;throw new Error(`The specified default value for the Stimulus Value "${m}" must match the defined type "${d}". The provided default value of "${r.default}" is of type "${c}".`)}if(o)return d}function Jn(i){let{controller:t,token:e,typeDefinition:r}=i,s=Yn({controller:t,token:e,typeObject:r}),o=$t(r),a=ue(r),l=s||o||a;if(l)return l;let d=t?`${t}.${r}`:e;throw new Error(`Unknown value type "${d}" for "${e}" value`)}function Gn(i){let t=ue(i);if(t)return ir[t];let e=Ze(i,"default"),r=Ze(i,"type"),n=i;if(e)return n.default;if(r){let{type:s}=n,o=ue(s);if(o)return ir[o]}return i}function Zn(i){let{token:t,typeDefinition:e}=i,r=`${sr(t)}-value`,n=Jn(i);return{type:n,key:r,name:yi(r),get defaultValue(){return Gn(e)},get hasCustomDefaultValue(){return $t(e)!==void 0},reader:Qn[n],writer:rr[n]||rr.default}}var ir={get array(){return[]},boolean:!1,number:0,get object(){return{}},string:""},Qn={array(i){let t=JSON.parse(i);if(!Array.isArray(t))throw new TypeError(`expected value of type "array" but instead got value "${i}" of type "${$t(t)}"`);return t},boolean(i){return!(i=="0"||String(i).toLowerCase()=="false")},number(i){return Number(i.replace(/_/g,""))},object(i){let t=JSON.parse(i);if(t===null||typeof t!="object"||Array.isArray(t))throw new TypeError(`expected value of type "object" but instead got value "${i}" of type "${$t(t)}"`);return t},string(i){return i}},rr={default:ts,array:nr,object:nr};function nr(i){return JSON.stringify(i)}function ts(i){return`${i}`}var A=class{constructor(t){this.context=t}static get shouldLoad(){return!0}static afterLoad(t,e){}get application(){return this.context.application}get scope(){return this.context.scope}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get targets(){return this.scope.targets}get outlets(){return this.scope.outlets}get classes(){return this.scope.classes}get data(){return this.scope.data}initialize(){}connect(){}disconnect(){}dispatch(t,{target:e=this.element,detail:r={},prefix:n=this.identifier,bubbles:s=!0,cancelable:o=!0}={}){let a=n?`${n}:${t}`:t,l=new CustomEvent(a,{detail:r,bubbles:s,cancelable:o});return e.dispatchEvent(l),l}};A.blessings=[zn,qn,Un,Kn];A.targets=[];A.outlets=[];A.values={};var he=class extends A{static targets=["target","template","addButton"];static values={wrapperSelector:{type:String,default:".nested-resource-form-fields"},limit:Number};connect(){this.updateState()}add(i){i.preventDefault();let t=this.templateTarget.innerHTML.replace(/NEW_RECORD/g,new Date().getTime().toString());this.targetTarget.insertAdjacentHTML("beforebegin",t);let e=new CustomEvent("nested-resource-form-fields:add",{bubbles:!0});this.element.dispatchEvent(e),this.updateState()}remove(i){i.preventDefault();let t=i.target.closest(this.wrapperSelectorValue);if(t.dataset.newRecord==="true")t.remove();else{t.style.display="none";let r=t.querySelector("input[name*='_destroy']");r.value="1"}let e=new CustomEvent("nested-resource-form-fields:remove",{bubbles:!0});this.element.dispatchEvent(e),this.updateState()}updateState(){!this.hasAddButtonTarget||this.limitValue==0||(this.childCount>=this.limitValue?this.addButtonTarget.style.display="none":this.addButtonTarget.style.display="initial")}get childCount(){return this.element.querySelectorAll(this.wrapperSelectorValue).length}};var pe=class extends A{connect(){console.log(`tab-bar connected: ${this.element}`)}};var fe=class extends A{connect(){console.log(`toolbar connected: ${this.element}`)}};var me=class extends A{connect(){console.log(`table-search-input connected: ${this.element}`)}};var ve=class extends A{connect(){console.log(`table-toolbar connected: ${this.element}`)}};var ge=class extends A{connect(){console.log(`table connected: ${this.element}`)}};var No=un(hr()),ye=class extends A{connect(){console.log(`form connected: ${this.element}`)}submit(){this.element.requestSubmit()}};var ys=function(){function i(t,e){e===void 0&&(e=[]),this._eventType=t,this._eventFunctions=e}return i.prototype.init=function(){var t=this;this._eventFunctions.forEach(function(e){typeof window<"u"&&window.addEventListener(t._eventType,e)})},i}(),pr=ys;var bs=function(){function i(){this._instances={Accordion:{},Carousel:{},Collapse:{},Dial:{},Dismiss:{},Drawer:{},Dropdown:{},Modal:{},Popover:{},Tabs:{},Tooltip:{},InputCounter:{},CopyClipboard:{}}}return i.prototype.addInstance=function(t,e,r,n){if(n===void 0&&(n=!1),!this._instances[t])return console.warn("Flowbite: Component ".concat(t," does not exist.")),!1;if(this._instances[t][r]&&!n){console.warn("Flowbite: Instance with ID ".concat(r," already exists."));return}n&&this._instances[t][r]&&this._instances[t][r].destroyAndRemoveInstance(),this._instances[t][r||this._generateRandomId()]=e},i.prototype.getAllInstances=function(){return this._instances},i.prototype.getInstances=function(t){return this._instances[t]?this._instances[t]:(console.warn("Flowbite: Component ".concat(t," does not exist.")),!1)},i.prototype.getInstance=function(t,e){if(this._componentAndInstanceCheck(t,e)){if(!this._instances[t][e]){console.warn("Flowbite: Instance with ID ".concat(e," does not exist."));return}return this._instances[t][e]}},i.prototype.destroyAndRemoveInstance=function(t,e){this._componentAndInstanceCheck(t,e)&&(this.destroyInstanceObject(t,e),this.removeInstance(t,e))},i.prototype.removeInstance=function(t,e){this._componentAndInstanceCheck(t,e)&&delete this._instances[t][e]},i.prototype.destroyInstanceObject=function(t,e){this._componentAndInstanceCheck(t,e)&&this._instances[t][e].destroy()},i.prototype.instanceExists=function(t,e){return!(!this._instances[t]||!this._instances[t][e])},i.prototype._generateRandomId=function(){return Math.random().toString(36).substr(2,9)},i.prototype._componentAndInstanceCheck=function(t,e){return this._instances[t]?this._instances[t][e]?!0:(console.warn("Flowbite: Instance with ID ".concat(e," does not exist.")),!1):(console.warn("Flowbite: Component ".concat(t," does not exist.")),!1)},i}(),fr=new bs,u=fr;typeof window<"u"&&(window.FlowbiteInstances=fr);var be=function(){return be=Object.assign||function(i){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(i[n]=t[n])}return i},be.apply(this,arguments)},_e={alwaysOpen:!1,activeClasses:"bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-white",inactiveClasses:"text-gray-500 dark:text-gray-400",onOpen:function(){},onClose:function(){},onToggle:function(){}},_s={id:null,override:!0},mr=function(){function i(t,e,r,n){t===void 0&&(t=null),e===void 0&&(e=[]),r===void 0&&(r=_e),n===void 0&&(n=_s),this._instanceId=n.id?n.id:t.id,this._accordionEl=t,this._items=e,this._options=be(be({},_e),r),this._initialized=!1,this.init(),u.addInstance("Accordion",this,this._instanceId,n.override)}return i.prototype.init=function(){var t=this;this._items.length&&!this._initialized&&(this._items.forEach(function(e){e.active&&t.open(e.id);var r=function(){t.toggle(e.id)};e.triggerEl.addEventListener("click",r),e.clickHandler=r}),this._initialized=!0)},i.prototype.destroy=function(){this._items.length&&this._initialized&&(this._items.forEach(function(t){t.triggerEl.removeEventListener("click",t.clickHandler),delete t.clickHandler}),this._initialized=!1)},i.prototype.removeInstance=function(){u.removeInstance("Accordion",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.getItem=function(t){return this._items.filter(function(e){return e.id===t})[0]},i.prototype.open=function(t){var e,r,n=this,s=this.getItem(t);this._options.alwaysOpen||this._items.map(function(o){var a,l;o!==s&&((a=o.triggerEl.classList).remove.apply(a,n._options.activeClasses.split(" ")),(l=o.triggerEl.classList).add.apply(l,n._options.inactiveClasses.split(" ")),o.targetEl.classList.add("hidden"),o.triggerEl.setAttribute("aria-expanded","false"),o.active=!1,o.iconEl&&o.iconEl.classList.add("rotate-180"))}),(e=s.triggerEl.classList).add.apply(e,this._options.activeClasses.split(" ")),(r=s.triggerEl.classList).remove.apply(r,this._options.inactiveClasses.split(" ")),s.triggerEl.setAttribute("aria-expanded","true"),s.targetEl.classList.remove("hidden"),s.active=!0,s.iconEl&&s.iconEl.classList.remove("rotate-180"),this._options.onOpen(this,s)},i.prototype.toggle=function(t){var e=this.getItem(t);e.active?this.close(t):this.open(t),this._options.onToggle(this,e)},i.prototype.close=function(t){var e,r,n=this.getItem(t);(e=n.triggerEl.classList).remove.apply(e,this._options.activeClasses.split(" ")),(r=n.triggerEl.classList).add.apply(r,this._options.inactiveClasses.split(" ")),n.targetEl.classList.add("hidden"),n.triggerEl.setAttribute("aria-expanded","false"),n.active=!1,n.iconEl&&n.iconEl.classList.add("rotate-180"),this._options.onClose(this,n)},i.prototype.updateOnOpen=function(t){this._options.onOpen=t},i.prototype.updateOnClose=function(t){this._options.onClose=t},i.prototype.updateOnToggle=function(t){this._options.onToggle=t},i}();function At(){document.querySelectorAll("[data-accordion]").forEach(function(i){var t=i.getAttribute("data-accordion"),e=i.getAttribute("data-active-classes"),r=i.getAttribute("data-inactive-classes"),n=[];i.querySelectorAll("[data-accordion-target]").forEach(function(s){if(s.closest("[data-accordion]")===i){var o={id:s.getAttribute("data-accordion-target"),triggerEl:s,targetEl:document.querySelector(s.getAttribute("data-accordion-target")),iconEl:s.querySelector("[data-accordion-icon]"),active:s.getAttribute("aria-expanded")==="true"};n.push(o)}}),new mr(i,n,{alwaysOpen:t==="open",activeClasses:e||_e.activeClasses,inactiveClasses:r||_e.inactiveClasses})})}typeof window<"u"&&(window.Accordion=mr,window.initAccordions=At);var we=function(){return we=Object.assign||function(i){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(i[n]=t[n])}return i},we.apply(this,arguments)},vr={onCollapse:function(){},onExpand:function(){},onToggle:function(){}},ws={id:null,override:!0},wi=function(){function i(t,e,r,n){t===void 0&&(t=null),e===void 0&&(e=null),r===void 0&&(r=vr),n===void 0&&(n=ws),this._instanceId=n.id?n.id:t.id,this._targetEl=t,this._triggerEl=e,this._options=we(we({},vr),r),this._visible=!1,this._initialized=!1,this.init(),u.addInstance("Collapse",this,this._instanceId,n.override)}return i.prototype.init=function(){var t=this;this._triggerEl&&this._targetEl&&!this._initialized&&(this._triggerEl.hasAttribute("aria-expanded")?this._visible=this._triggerEl.getAttribute("aria-expanded")==="true":this._visible=!this._targetEl.classList.contains("hidden"),this._clickHandler=function(){t.toggle()},this._triggerEl.addEventListener("click",this._clickHandler),this._initialized=!0)},i.prototype.destroy=function(){this._triggerEl&&this._initialized&&(this._triggerEl.removeEventListener("click",this._clickHandler),this._initialized=!1)},i.prototype.removeInstance=function(){u.removeInstance("Collapse",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.collapse=function(){this._targetEl.classList.add("hidden"),this._triggerEl&&this._triggerEl.setAttribute("aria-expanded","false"),this._visible=!1,this._options.onCollapse(this)},i.prototype.expand=function(){this._targetEl.classList.remove("hidden"),this._triggerEl&&this._triggerEl.setAttribute("aria-expanded","true"),this._visible=!0,this._options.onExpand(this)},i.prototype.toggle=function(){this._visible?this.collapse():this.expand(),this._options.onToggle(this)},i.prototype.updateOnCollapse=function(t){this._options.onCollapse=t},i.prototype.updateOnExpand=function(t){this._options.onExpand=t},i.prototype.updateOnToggle=function(t){this._options.onToggle=t},i}();function Ot(){document.querySelectorAll("[data-collapse-toggle]").forEach(function(i){var t=i.getAttribute("data-collapse-toggle"),e=document.getElementById(t);e?u.instanceExists("Collapse",e.getAttribute("id"))?new wi(e,i,{},{id:e.getAttribute("id")+"_"+u._generateRandomId()}):new wi(e,i):console.error('The target element with id "'.concat(t,'" does not exist. Please check the data-collapse-toggle attribute.'))})}typeof window<"u"&&(window.Collapse=wi,window.initCollapses=Ot);var ht=function(){return ht=Object.assign||function(i){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(i[n]=t[n])}return i},ht.apply(this,arguments)},Ee={defaultPosition:0,indicators:{items:[],activeClasses:"bg-white dark:bg-gray-800",inactiveClasses:"bg-white/50 dark:bg-gray-800/50 hover:bg-white dark:hover:bg-gray-800"},interval:3e3,onNext:function(){},onPrev:function(){},onChange:function(){}},Es={id:null,override:!0},gr=function(){function i(t,e,r,n){t===void 0&&(t=null),e===void 0&&(e=[]),r===void 0&&(r=Ee),n===void 0&&(n=Es),this._instanceId=n.id?n.id:t.id,this._carouselEl=t,this._items=e,this._options=ht(ht(ht({},Ee),r),{indicators:ht(ht({},Ee.indicators),r.indicators)}),this._activeItem=this.getItem(this._options.defaultPosition),this._indicators=this._options.indicators.items,this._intervalDuration=this._options.interval,this._intervalInstance=null,this._initialized=!1,this.init(),u.addInstance("Carousel",this,this._instanceId,n.override)}return i.prototype.init=function(){var t=this;this._items.length&&!this._initialized&&(this._items.map(function(e){e.el.classList.add("absolute","inset-0","transition-transform","transform")}),this.getActiveItem()?this.slideTo(this.getActiveItem().position):this.slideTo(0),this._indicators.map(function(e,r){e.el.addEventListener("click",function(){t.slideTo(r)})}),this._initialized=!0)},i.prototype.destroy=function(){this._initialized&&(this._initialized=!1)},i.prototype.removeInstance=function(){u.removeInstance("Carousel",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.getItem=function(t){return this._items[t]},i.prototype.slideTo=function(t){var e=this._items[t],r={left:e.position===0?this._items[this._items.length-1]:this._items[e.position-1],middle:e,right:e.position===this._items.length-1?this._items[0]:this._items[e.position+1]};this._rotate(r),this._setActiveItem(e),this._intervalInstance&&(this.pause(),this.cycle()),this._options.onChange(this)},i.prototype.next=function(){var t=this.getActiveItem(),e=null;t.position===this._items.length-1?e=this._items[0]:e=this._items[t.position+1],this.slideTo(e.position),this._options.onNext(this)},i.prototype.prev=function(){var t=this.getActiveItem(),e=null;t.position===0?e=this._items[this._items.length-1]:e=this._items[t.position-1],this.slideTo(e.position),this._options.onPrev(this)},i.prototype._rotate=function(t){if(this._items.map(function(e){e.el.classList.add("hidden")}),this._items.length===1){t.middle.el.classList.remove("-translate-x-full","translate-x-full","translate-x-0","hidden","z-10"),t.middle.el.classList.add("translate-x-0","z-20");return}t.left.el.classList.remove("-translate-x-full","translate-x-full","translate-x-0","hidden","z-20"),t.left.el.classList.add("-translate-x-full","z-10"),t.middle.el.classList.remove("-translate-x-full","translate-x-full","translate-x-0","hidden","z-10"),t.middle.el.classList.add("translate-x-0","z-30"),t.right.el.classList.remove("-translate-x-full","translate-x-full","translate-x-0","hidden","z-30"),t.right.el.classList.add("translate-x-full","z-20")},i.prototype.cycle=function(){var t=this;typeof window<"u"&&(this._intervalInstance=window.setInterval(function(){t.next()},this._intervalDuration))},i.prototype.pause=function(){clearInterval(this._intervalInstance)},i.prototype.getActiveItem=function(){return this._activeItem},i.prototype._setActiveItem=function(t){var e,r,n=this;this._activeItem=t;var s=t.position;this._indicators.length&&(this._indicators.map(function(o){var a,l;o.el.setAttribute("aria-current","false"),(a=o.el.classList).remove.apply(a,n._options.indicators.activeClasses.split(" ")),(l=o.el.classList).add.apply(l,n._options.indicators.inactiveClasses.split(" "))}),(e=this._indicators[s].el.classList).add.apply(e,this._options.indicators.activeClasses.split(" ")),(r=this._indicators[s].el.classList).remove.apply(r,this._options.indicators.inactiveClasses.split(" ")),this._indicators[s].el.setAttribute("aria-current","true"))},i.prototype.updateOnNext=function(t){this._options.onNext=t},i.prototype.updateOnPrev=function(t){this._options.onPrev=t},i.prototype.updateOnChange=function(t){this._options.onChange=t},i}();function Ct(){document.querySelectorAll("[data-carousel]").forEach(function(i){var t=i.getAttribute("data-carousel-interval"),e=i.getAttribute("data-carousel")==="slide",r=[],n=0;i.querySelectorAll("[data-carousel-item]").length&&Array.from(i.querySelectorAll("[data-carousel-item]")).map(function(d,c){r.push({position:c,el:d}),d.getAttribute("data-carousel-item")==="active"&&(n=c)});var s=[];i.querySelectorAll("[data-carousel-slide-to]").length&&Array.from(i.querySelectorAll("[data-carousel-slide-to]")).map(function(d){s.push({position:parseInt(d.getAttribute("data-carousel-slide-to")),el:d})});var o=new gr(i,r,{defaultPosition:n,indicators:{items:s},interval:t||Ee.interval});e&&o.cycle();var a=i.querySelector("[data-carousel-next]"),l=i.querySelector("[data-carousel-prev]");a&&a.addEventListener("click",function(){o.next()}),l&&l.addEventListener("click",function(){o.prev()})})}typeof window<"u"&&(window.Carousel=gr,window.initCarousels=Ct);var xe=function(){return xe=Object.assign||function(i){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(i[n]=t[n])}return i},xe.apply(this,arguments)},yr={transition:"transition-opacity",duration:300,timing:"ease-out",onHide:function(){}},xs={id:null,override:!0},Ei=function(){function i(t,e,r,n){t===void 0&&(t=null),e===void 0&&(e=null),r===void 0&&(r=yr),n===void 0&&(n=xs),this._instanceId=n.id?n.id:t.id,this._targetEl=t,this._triggerEl=e,this._options=xe(xe({},yr),r),this._initialized=!1,this.init(),u.addInstance("Dismiss",this,this._instanceId,n.override)}return i.prototype.init=function(){var t=this;this._triggerEl&&this._targetEl&&!this._initialized&&(this._clickHandler=function(){t.hide()},this._triggerEl.addEventListener("click",this._clickHandler),this._initialized=!0)},i.prototype.destroy=function(){this._triggerEl&&this._initialized&&(this._triggerEl.removeEventListener("click",this._clickHandler),this._initialized=!1)},i.prototype.removeInstance=function(){u.removeInstance("Dismiss",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.hide=function(){var t=this;this._targetEl.classList.add(this._options.transition,"duration-".concat(this._options.duration),this._options.timing,"opacity-0"),setTimeout(function(){t._targetEl.classList.add("hidden")},this._options.duration),this._options.onHide(this,this._targetEl)},i.prototype.updateOnHide=function(t){this._options.onHide=t},i}();function kt(){document.querySelectorAll("[data-dismiss-target]").forEach(function(i){var t=i.getAttribute("data-dismiss-target"),e=document.querySelector(t);e?new Ei(e,i):console.error('The dismiss element with id "'.concat(t,'" does not exist. Please check the data-dismiss-target attribute.'))})}typeof window<"u"&&(window.Dismiss=Ei,window.initDismisses=kt);var xi=Ei;var I="top",M="bottom",D="right",T="left",Ae="auto",et=[I,M,D,T],G="start",pt="end",br="clippingParents",Oe="viewport",It="popper",_r="reference",Ai=et.reduce(function(i,t){return i.concat([t+"-"+G,t+"-"+pt])},[]),Ce=[].concat(et,[Ae]).reduce(function(i,t){return i.concat([t,t+"-"+G,t+"-"+pt])},[]),As="beforeRead",Os="read",Cs="afterRead",ks="beforeMain",Is="main",Ls="afterMain",Ts="beforeWrite",Ds="write",Ss="afterWrite",wr=[As,Os,Cs,ks,Is,Ls,Ts,Ds,Ss];function P(i){return i?(i.nodeName||"").toLowerCase():null}function O(i){if(i==null)return window;if(i.toString()!=="[object Window]"){var t=i.ownerDocument;return t&&t.defaultView||window}return i}function R(i){var t=O(i).Element;return i instanceof t||i instanceof Element}function B(i){var t=O(i).HTMLElement;return i instanceof t||i instanceof HTMLElement}function Lt(i){if(typeof ShadowRoot>"u")return!1;var t=O(i).ShadowRoot;return i instanceof t||i instanceof ShadowRoot}function Ms(i){var t=i.state;Object.keys(t.elements).forEach(function(e){var r=t.styles[e]||{},n=t.attributes[e]||{},s=t.elements[e];!B(s)||!P(s)||(Object.assign(s.style,r),Object.keys(n).forEach(function(o){var a=n[o];a===!1?s.removeAttribute(o):s.setAttribute(o,a===!0?"":a)}))})}function Bs(i){var t=i.state,e={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,e.popper),t.styles=e,t.elements.arrow&&Object.assign(t.elements.arrow.style,e.arrow),function(){Object.keys(t.elements).forEach(function(r){var n=t.elements[r],s=t.attributes[r]||{},o=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:e[r]),a=o.reduce(function(l,d){return l[d]="",l},{});!B(n)||!P(n)||(Object.assign(n.style,a),Object.keys(s).forEach(function(l){n.removeAttribute(l)}))})}}var Er={name:"applyStyles",enabled:!0,phase:"write",fn:Ms,effect:Bs,requires:["computeStyles"]};function F(i){return i.split("-")[0]}var U=Math.max,ft=Math.min,Z=Math.round;function Tt(){var i=navigator.userAgentData;return i!=null&&i.brands&&Array.isArray(i.brands)?i.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function Ut(){return!/^((?!chrome|android).)*safari/i.test(Tt())}function K(i,t,e){t===void 0&&(t=!1),e===void 0&&(e=!1);var r=i.getBoundingClientRect(),n=1,s=1;t&&B(i)&&(n=i.offsetWidth>0&&Z(r.width)/i.offsetWidth||1,s=i.offsetHeight>0&&Z(r.height)/i.offsetHeight||1);var o=R(i)?O(i):window,a=o.visualViewport,l=!Ut()&&e,d=(r.left+(l&&a?a.offsetLeft:0))/n,c=(r.top+(l&&a?a.offsetTop:0))/s,m=r.width/n,_=r.height/s;return{width:m,height:_,top:c,right:d+m,bottom:c+_,left:d,x:d,y:c}}function mt(i){var t=K(i),e=i.offsetWidth,r=i.offsetHeight;return Math.abs(t.width-e)<=1&&(e=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:i.offsetLeft,y:i.offsetTop,width:e,height:r}}function Xt(i,t){var e=t.getRootNode&&t.getRootNode();if(i.contains(t))return!0;if(e&&Lt(e)){var r=t;do{if(r&&i.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function H(i){return O(i).getComputedStyle(i)}function Oi(i){return["table","td","th"].indexOf(P(i))>=0}function j(i){return((R(i)?i.ownerDocument:i.document)||window.document).documentElement}function Q(i){return P(i)==="html"?i:i.assignedSlot||i.parentNode||(Lt(i)?i.host:null)||j(i)}function xr(i){return!B(i)||H(i).position==="fixed"?null:i.offsetParent}function Ps(i){var t=/firefox/i.test(Tt()),e=/Trident/i.test(Tt());if(e&&B(i)){var r=H(i);if(r.position==="fixed")return null}var n=Q(i);for(Lt(n)&&(n=n.host);B(n)&&["html","body"].indexOf(P(n))<0;){var s=H(n);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||t&&s.willChange==="filter"||t&&s.filter&&s.filter!=="none")return n;n=n.parentNode}return null}function X(i){for(var t=O(i),e=xr(i);e&&Oi(e)&&H(e).position==="static";)e=xr(e);return e&&(P(e)==="html"||P(e)==="body"&&H(e).position==="static")?t:e||Ps(i)||t}function vt(i){return["top","bottom"].indexOf(i)>=0?"x":"y"}function gt(i,t,e){return U(i,ft(t,e))}function Ar(i,t,e){var r=gt(i,t,e);return r>e?e:r}function Yt(){return{top:0,right:0,bottom:0,left:0}}function Jt(i){return Object.assign({},Yt(),i)}function Gt(i,t){return t.reduce(function(e,r){return e[r]=i,e},{})}var Fs=function(t,e){return t=typeof t=="function"?t(Object.assign({},e.rects,{placement:e.placement})):t,Jt(typeof t!="number"?t:Gt(t,et))};function js(i){var t,e=i.state,r=i.name,n=i.options,s=e.elements.arrow,o=e.modifiersData.popperOffsets,a=F(e.placement),l=vt(a),d=[T,D].indexOf(a)>=0,c=d?"height":"width";if(!(!s||!o)){var m=Fs(n.padding,e),_=mt(s),p=l==="y"?I:T,E=l==="y"?M:D,g=e.rects.reference[c]+e.rects.reference[l]-o[l]-e.rects.popper[c],v=o[l]-e.rects.reference[l],w=X(s),x=w?l==="y"?w.clientHeight||0:w.clientWidth||0:0,C=g/2-v/2,f=m[p],y=x-_[c]-m[E],h=x/2-_[c]/2+C,b=gt(f,h,y),k=l;e.modifiersData[r]=(t={},t[k]=b,t.centerOffset=b-h,t)}}function Ns(i){var t=i.state,e=i.options,r=e.element,n=r===void 0?"[data-popper-arrow]":r;n!=null&&(typeof n=="string"&&(n=t.elements.popper.querySelector(n),!n)||Xt(t.elements.popper,n)&&(t.elements.arrow=n))}var Or={name:"arrow",enabled:!0,phase:"main",fn:js,effect:Ns,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function $(i){return i.split("-")[1]}var Vs={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Hs(i,t){var e=i.x,r=i.y,n=t.devicePixelRatio||1;return{x:Z(e*n)/n||0,y:Z(r*n)/n||0}}function Cr(i){var t,e=i.popper,r=i.popperRect,n=i.placement,s=i.variation,o=i.offsets,a=i.position,l=i.gpuAcceleration,d=i.adaptive,c=i.roundOffsets,m=i.isFixed,_=o.x,p=_===void 0?0:_,E=o.y,g=E===void 0?0:E,v=typeof c=="function"?c({x:p,y:g}):{x:p,y:g};p=v.x,g=v.y;var w=o.hasOwnProperty("x"),x=o.hasOwnProperty("y"),C=T,f=I,y=window;if(d){var h=X(e),b="clientHeight",k="clientWidth";if(h===O(e)&&(h=j(e),H(h).position!=="static"&&a==="absolute"&&(b="scrollHeight",k="scrollWidth")),h=h,n===I||(n===T||n===D)&&s===pt){f=M;var L=m&&h===y&&y.visualViewport?y.visualViewport.height:h[b];g-=L-r.height,g*=l?1:-1}if(n===T||(n===I||n===M)&&s===pt){C=D;var S=m&&h===y&&y.visualViewport?y.visualViewport.width:h[k];p-=S-r.width,p*=l?1:-1}}var N=Object.assign({position:a},d&&Vs),q=c===!0?Hs({x:p,y:g},O(e)):{x:p,y:g};if(p=q.x,g=q.y,l){var V;return Object.assign({},N,(V={},V[f]=x?"0":"",V[C]=w?"0":"",V.transform=(y.devicePixelRatio||1)<=1?"translate("+p+"px, "+g+"px)":"translate3d("+p+"px, "+g+"px, 0)",V))}return Object.assign({},N,(t={},t[f]=x?g+"px":"",t[C]=w?p+"px":"",t.transform="",t))}function zs(i){var t=i.state,e=i.options,r=e.gpuAcceleration,n=r===void 0?!0:r,s=e.adaptive,o=s===void 0?!0:s,a=e.roundOffsets,l=a===void 0?!0:a,d={placement:F(t.placement),variation:$(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:n,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Cr(Object.assign({},d,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Cr(Object.assign({},d,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}var kr={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:zs,data:{}};var ke={passive:!0};function Rs(i){var t=i.state,e=i.instance,r=i.options,n=r.scroll,s=n===void 0?!0:n,o=r.resize,a=o===void 0?!0:o,l=O(t.elements.popper),d=[].concat(t.scrollParents.reference,t.scrollParents.popper);return s&&d.forEach(function(c){c.addEventListener("scroll",e.update,ke)}),a&&l.addEventListener("resize",e.update,ke),function(){s&&d.forEach(function(c){c.removeEventListener("scroll",e.update,ke)}),a&&l.removeEventListener("resize",e.update,ke)}}var Ir={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Rs,data:{}};var Ks={left:"right",right:"left",bottom:"top",top:"bottom"};function Dt(i){return i.replace(/left|right|bottom|top/g,function(t){return Ks[t]})}var $s={start:"end",end:"start"};function Ie(i){return i.replace(/start|end/g,function(t){return $s[t]})}function yt(i){var t=O(i),e=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:e,scrollTop:r}}function bt(i){return K(j(i)).left+yt(i).scrollLeft}function Ci(i,t){var e=O(i),r=j(i),n=e.visualViewport,s=r.clientWidth,o=r.clientHeight,a=0,l=0;if(n){s=n.width,o=n.height;var d=Ut();(d||!d&&t==="fixed")&&(a=n.offsetLeft,l=n.offsetTop)}return{width:s,height:o,x:a+bt(i),y:l}}function ki(i){var t,e=j(i),r=yt(i),n=(t=i.ownerDocument)==null?void 0:t.body,s=U(e.scrollWidth,e.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),o=U(e.scrollHeight,e.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),a=-r.scrollLeft+bt(i),l=-r.scrollTop;return H(n||e).direction==="rtl"&&(a+=U(e.clientWidth,n?n.clientWidth:0)-s),{width:s,height:o,x:a,y:l}}function _t(i){var t=H(i),e=t.overflow,r=t.overflowX,n=t.overflowY;return/auto|scroll|overlay|hidden/.test(e+n+r)}function Le(i){return["html","body","#document"].indexOf(P(i))>=0?i.ownerDocument.body:B(i)&&_t(i)?i:Le(Q(i))}function it(i,t){var e;t===void 0&&(t=[]);var r=Le(i),n=r===((e=i.ownerDocument)==null?void 0:e.body),s=O(r),o=n?[s].concat(s.visualViewport||[],_t(r)?r:[]):r,a=t.concat(o);return n?a:a.concat(it(Q(o)))}function St(i){return Object.assign({},i,{left:i.x,top:i.y,right:i.x+i.width,bottom:i.y+i.height})}function qs(i,t){var e=K(i,!1,t==="fixed");return e.top=e.top+i.clientTop,e.left=e.left+i.clientLeft,e.bottom=e.top+i.clientHeight,e.right=e.left+i.clientWidth,e.width=i.clientWidth,e.height=i.clientHeight,e.x=e.left,e.y=e.top,e}function Lr(i,t,e){return t===Oe?St(Ci(i,e)):R(t)?qs(t,e):St(ki(j(i)))}function Ws(i){var t=it(Q(i)),e=["absolute","fixed"].indexOf(H(i).position)>=0,r=e&&B(i)?X(i):i;return R(r)?t.filter(function(n){return R(n)&&Xt(n,r)&&P(n)!=="body"}):[]}function Ii(i,t,e,r){var n=t==="clippingParents"?Ws(i):[].concat(t),s=[].concat(n,[e]),o=s[0],a=s.reduce(function(l,d){var c=Lr(i,d,r);return l.top=U(c.top,l.top),l.right=ft(c.right,l.right),l.bottom=ft(c.bottom,l.bottom),l.left=U(c.left,l.left),l},Lr(i,o,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function Zt(i){var t=i.reference,e=i.element,r=i.placement,n=r?F(r):null,s=r?$(r):null,o=t.x+t.width/2-e.width/2,a=t.y+t.height/2-e.height/2,l;switch(n){case I:l={x:o,y:t.y-e.height};break;case M:l={x:o,y:t.y+t.height};break;case D:l={x:t.x+t.width,y:a};break;case T:l={x:t.x-e.width,y:a};break;default:l={x:t.x,y:t.y}}var d=n?vt(n):null;if(d!=null){var c=d==="y"?"height":"width";switch(s){case G:l[d]=l[d]-(t[c]/2-e[c]/2);break;case pt:l[d]=l[d]+(t[c]/2-e[c]/2);break;default:}}return l}function Y(i,t){t===void 0&&(t={});var e=t,r=e.placement,n=r===void 0?i.placement:r,s=e.strategy,o=s===void 0?i.strategy:s,a=e.boundary,l=a===void 0?br:a,d=e.rootBoundary,c=d===void 0?Oe:d,m=e.elementContext,_=m===void 0?It:m,p=e.altBoundary,E=p===void 0?!1:p,g=e.padding,v=g===void 0?0:g,w=Jt(typeof v!="number"?v:Gt(v,et)),x=_===It?_r:It,C=i.rects.popper,f=i.elements[E?x:_],y=Ii(R(f)?f:f.contextElement||j(i.elements.popper),l,c,o),h=K(i.elements.reference),b=Zt({reference:h,element:C,strategy:"absolute",placement:n}),k=St(Object.assign({},C,b)),L=_===It?k:h,S={top:y.top-L.top+w.top,bottom:L.bottom-y.bottom+w.bottom,left:y.left-L.left+w.left,right:L.right-y.right+w.right},N=i.modifiersData.offset;if(_===It&&N){var q=N[n];Object.keys(S).forEach(function(V){var at=[D,M].indexOf(V)>=0?1:-1,lt=[I,M].indexOf(V)>=0?"y":"x";S[V]+=q[lt]*at})}return S}function Li(i,t){t===void 0&&(t={});var e=t,r=e.placement,n=e.boundary,s=e.rootBoundary,o=e.padding,a=e.flipVariations,l=e.allowedAutoPlacements,d=l===void 0?Ce:l,c=$(r),m=c?a?Ai:Ai.filter(function(E){return $(E)===c}):et,_=m.filter(function(E){return d.indexOf(E)>=0});_.length===0&&(_=m);var p=_.reduce(function(E,g){return E[g]=Y(i,{placement:g,boundary:n,rootBoundary:s,padding:o})[F(g)],E},{});return Object.keys(p).sort(function(E,g){return p[E]-p[g]})}function Us(i){if(F(i)===Ae)return[];var t=Dt(i);return[Ie(i),t,Ie(t)]}function Xs(i){var t=i.state,e=i.options,r=i.name;if(!t.modifiersData[r]._skip){for(var n=e.mainAxis,s=n===void 0?!0:n,o=e.altAxis,a=o===void 0?!0:o,l=e.fallbackPlacements,d=e.padding,c=e.boundary,m=e.rootBoundary,_=e.altBoundary,p=e.flipVariations,E=p===void 0?!0:p,g=e.allowedAutoPlacements,v=t.options.placement,w=F(v),x=w===v,C=l||(x||!E?[Dt(v)]:Us(v)),f=[v].concat(C).reduce(function(xt,tt){return xt.concat(F(tt)===Ae?Li(t,{placement:tt,boundary:c,rootBoundary:m,padding:d,flipVariations:E,allowedAutoPlacements:g}):tt)},[]),y=t.rects.reference,h=t.rects.popper,b=new Map,k=!0,L=f[0],S=0;S<f.length;S++){var N=f[S],q=F(N),V=$(N)===G,at=[I,M].indexOf(q)>=0,lt=at?"width":"height",z=Y(t,{placement:N,boundary:c,rootBoundary:m,altBoundary:_,padding:d}),W=at?V?D:T:V?M:I;y[lt]>h[lt]&&(W=Dt(W));var te=Dt(W),ct=[];if(s&&ct.push(z[q]<=0),a&&ct.push(z[W]<=0,z[te]<=0),ct.every(function(xt){return xt})){L=N,k=!1;break}b.set(N,ct)}if(k)for(var ee=E?3:1,qe=function(tt){var Kt=f.find(function(re){var dt=b.get(re);if(dt)return dt.slice(0,tt).every(function(We){return We})});if(Kt)return L=Kt,"break"},Rt=ee;Rt>0;Rt--){var ie=qe(Rt);if(ie==="break")break}t.placement!==L&&(t.modifiersData[r]._skip=!0,t.placement=L,t.reset=!0)}}var Tr={name:"flip",enabled:!0,phase:"main",fn:Xs,requiresIfExists:["offset"],data:{_skip:!1}};function Dr(i,t,e){return e===void 0&&(e={x:0,y:0}),{top:i.top-t.height-e.y,right:i.right-t.width+e.x,bottom:i.bottom-t.height+e.y,left:i.left-t.width-e.x}}function Sr(i){return[I,D,M,T].some(function(t){return i[t]>=0})}function Ys(i){var t=i.state,e=i.name,r=t.rects.reference,n=t.rects.popper,s=t.modifiersData.preventOverflow,o=Y(t,{elementContext:"reference"}),a=Y(t,{altBoundary:!0}),l=Dr(o,r),d=Dr(a,n,s),c=Sr(l),m=Sr(d);t.modifiersData[e]={referenceClippingOffsets:l,popperEscapeOffsets:d,isReferenceHidden:c,hasPopperEscaped:m},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":m})}var Mr={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Ys};function Js(i,t,e){var r=F(i),n=[T,I].indexOf(r)>=0?-1:1,s=typeof e=="function"?e(Object.assign({},t,{placement:i})):e,o=s[0],a=s[1];return o=o||0,a=(a||0)*n,[T,D].indexOf(r)>=0?{x:a,y:o}:{x:o,y:a}}function Gs(i){var t=i.state,e=i.options,r=i.name,n=e.offset,s=n===void 0?[0,0]:n,o=Ce.reduce(function(c,m){return c[m]=Js(m,t.rects,s),c},{}),a=o[t.placement],l=a.x,d=a.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=d),t.modifiersData[r]=o}var Br={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Gs};function Zs(i){var t=i.state,e=i.name;t.modifiersData[e]=Zt({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}var Pr={name:"popperOffsets",enabled:!0,phase:"read",fn:Zs,data:{}};function Ti(i){return i==="x"?"y":"x"}function Qs(i){var t=i.state,e=i.options,r=i.name,n=e.mainAxis,s=n===void 0?!0:n,o=e.altAxis,a=o===void 0?!1:o,l=e.boundary,d=e.rootBoundary,c=e.altBoundary,m=e.padding,_=e.tether,p=_===void 0?!0:_,E=e.tetherOffset,g=E===void 0?0:E,v=Y(t,{boundary:l,rootBoundary:d,padding:m,altBoundary:c}),w=F(t.placement),x=$(t.placement),C=!x,f=vt(w),y=Ti(f),h=t.modifiersData.popperOffsets,b=t.rects.reference,k=t.rects.popper,L=typeof g=="function"?g(Object.assign({},t.rects,{placement:t.placement})):g,S=typeof L=="number"?{mainAxis:L,altAxis:L}:Object.assign({mainAxis:0,altAxis:0},L),N=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,q={x:0,y:0};if(h){if(s){var V,at=f==="y"?I:T,lt=f==="y"?M:D,z=f==="y"?"height":"width",W=h[f],te=W+v[at],ct=W-v[lt],ee=p?-k[z]/2:0,qe=x===G?b[z]:k[z],Rt=x===G?-k[z]:-b[z],ie=t.elements.arrow,xt=p&&ie?mt(ie):{width:0,height:0},tt=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Yt(),Kt=tt[at],re=tt[lt],dt=gt(0,b[z],xt[z]),We=C?b[z]/2-ee-dt-Kt-S.mainAxis:qe-dt-Kt-S.mainAxis,Gr=C?-b[z]/2+ee+dt+re+S.mainAxis:Rt+dt+re+S.mainAxis,Ue=t.elements.arrow&&X(t.elements.arrow),Zr=Ue?f==="y"?Ue.clientTop||0:Ue.clientLeft||0:0,Hi=(V=N?.[f])!=null?V:0,Qr=W+We-Hi-Zr,tn=W+Gr-Hi,zi=gt(p?ft(te,Qr):te,W,p?U(ct,tn):ct);h[f]=zi,q[f]=zi-W}if(a){var Ri,en=f==="x"?I:T,rn=f==="x"?M:D,ut=h[y],ne=y==="y"?"height":"width",Ki=ut+v[en],$i=ut-v[rn],Xe=[I,T].indexOf(w)!==-1,qi=(Ri=N?.[y])!=null?Ri:0,Wi=Xe?Ki:ut-b[ne]-k[ne]-qi+S.altAxis,Ui=Xe?ut+b[ne]+k[ne]-qi-S.altAxis:$i,Xi=p&&Xe?Ar(Wi,ut,Ui):gt(p?Wi:Ki,ut,p?Ui:$i);h[y]=Xi,q[y]=Xi-ut}t.modifiersData[r]=q}}var Fr={name:"preventOverflow",enabled:!0,phase:"main",fn:Qs,requiresIfExists:["offset"]};function Di(i){return{scrollLeft:i.scrollLeft,scrollTop:i.scrollTop}}function Si(i){return i===O(i)||!B(i)?yt(i):Di(i)}function to(i){var t=i.getBoundingClientRect(),e=Z(t.width)/i.offsetWidth||1,r=Z(t.height)/i.offsetHeight||1;return e!==1||r!==1}function Mi(i,t,e){e===void 0&&(e=!1);var r=B(t),n=B(t)&&to(t),s=j(t),o=K(i,n,e),a={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!e)&&((P(t)!=="body"||_t(s))&&(a=Si(t)),B(t)?(l=K(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):s&&(l.x=bt(s))),{x:o.left+a.scrollLeft-l.x,y:o.top+a.scrollTop-l.y,width:o.width,height:o.height}}function eo(i){var t=new Map,e=new Set,r=[];i.forEach(function(s){t.set(s.name,s)});function n(s){e.add(s.name);var o=[].concat(s.requires||[],s.requiresIfExists||[]);o.forEach(function(a){if(!e.has(a)){var l=t.get(a);l&&n(l)}}),r.push(s)}return i.forEach(function(s){e.has(s.name)||n(s)}),r}function Bi(i){var t=eo(i);return wr.reduce(function(e,r){return e.concat(t.filter(function(n){return n.phase===r}))},[])}function Pi(i){var t;return function(){return t||(t=new Promise(function(e){Promise.resolve().then(function(){t=void 0,e(i())})})),t}}function Fi(i){var t=i.reduce(function(e,r){var n=e[r.name];return e[r.name]=n?Object.assign({},n,r,{options:Object.assign({},n.options,r.options),data:Object.assign({},n.data,r.data)}):r,e},{});return Object.keys(t).map(function(e){return t[e]})}var jr={placement:"bottom",modifiers:[],strategy:"absolute"};function Nr(){for(var i=arguments.length,t=new Array(i),e=0;e<i;e++)t[e]=arguments[e];return!t.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function Vr(i){i===void 0&&(i={});var t=i,e=t.defaultModifiers,r=e===void 0?[]:e,n=t.defaultOptions,s=n===void 0?jr:n;return function(a,l,d){d===void 0&&(d=s);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},jr,s),modifiersData:{},elements:{reference:a,popper:l},attributes:{},styles:{}},m=[],_=!1,p={state:c,setOptions:function(w){var x=typeof w=="function"?w(c.options):w;g(),c.options=Object.assign({},s,c.options,x),c.scrollParents={reference:R(a)?it(a):a.contextElement?it(a.contextElement):[],popper:it(l)};var C=Bi(Fi([].concat(r,c.options.modifiers)));return c.orderedModifiers=C.filter(function(f){return f.enabled}),E(),p.update()},forceUpdate:function(){if(!_){var w=c.elements,x=w.reference,C=w.popper;if(Nr(x,C)){c.rects={reference:Mi(x,X(C),c.options.strategy==="fixed"),popper:mt(C)},c.reset=!1,c.placement=c.options.placement,c.orderedModifiers.forEach(function(S){return c.modifiersData[S.name]=Object.assign({},S.data)});for(var f=0;f<c.orderedModifiers.length;f++){if(c.reset===!0){c.reset=!1,f=-1;continue}var y=c.orderedModifiers[f],h=y.fn,b=y.options,k=b===void 0?{}:b,L=y.name;typeof h=="function"&&(c=h({state:c,options:k,name:L,instance:p})||c)}}}},update:Pi(function(){return new Promise(function(v){p.forceUpdate(),v(c)})}),destroy:function(){g(),_=!0}};if(!Nr(a,l))return p;p.setOptions(d).then(function(v){!_&&d.onFirstUpdate&&d.onFirstUpdate(v)});function E(){c.orderedModifiers.forEach(function(v){var w=v.name,x=v.options,C=x===void 0?{}:x,f=v.effect;if(typeof f=="function"){var y=f({state:c,name:w,instance:p,options:C}),h=function(){};m.push(y||h)}})}function g(){m.forEach(function(v){return v()}),m=[]}return p}}var io=[Ir,Pr,kr,Er,Br,Tr,Fr,Or,Mr],wt=Vr({defaultModifiers:io});var rt=function(){return rt=Object.assign||function(i){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(i[n]=t[n])}return i},rt.apply(this,arguments)},Te=function(i,t,e){if(e||arguments.length===2)for(var r=0,n=t.length,s;r<n;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return i.concat(s||Array.prototype.slice.call(t))},nt={placement:"bottom",triggerType:"click",offsetSkidding:0,offsetDistance:10,delay:300,ignoreClickOutsideClass:!1,onShow:function(){},onHide:function(){},onToggle:function(){}},ro={id:null,override:!0},ji=function(){function i(t,e,r,n){t===void 0&&(t=null),e===void 0&&(e=null),r===void 0&&(r=nt),n===void 0&&(n=ro),this._instanceId=n.id?n.id:t.id,this._targetEl=t,this._triggerEl=e,this._options=rt(rt({},nt),r),this._popperInstance=null,this._visible=!1,this._initialized=!1,this.init(),u.addInstance("Dropdown",this,this._instanceId,n.override)}return i.prototype.init=function(){this._triggerEl&&this._targetEl&&!this._initialized&&(this._popperInstance=this._createPopperInstance(),this._setupEventListeners(),this._initialized=!0)},i.prototype.destroy=function(){var t=this,e=this._getTriggerEvents();this._options.triggerType==="click"&&e.showEvents.forEach(function(r){t._triggerEl.removeEventListener(r,t._clickHandler)}),this._options.triggerType==="hover"&&(e.showEvents.forEach(function(r){t._triggerEl.removeEventListener(r,t._hoverShowTriggerElHandler),t._targetEl.removeEventListener(r,t._hoverShowTargetElHandler)}),e.hideEvents.forEach(function(r){t._triggerEl.removeEventListener(r,t._hoverHideHandler),t._targetEl.removeEventListener(r,t._hoverHideHandler)})),this._popperInstance.destroy(),this._initialized=!1},i.prototype.removeInstance=function(){u.removeInstance("Dropdown",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype._setupEventListeners=function(){var t=this,e=this._getTriggerEvents();this._clickHandler=function(){t.toggle()},this._options.triggerType==="click"&&e.showEvents.forEach(function(r){t._triggerEl.addEventListener(r,t._clickHandler)}),this._hoverShowTriggerElHandler=function(r){r.type==="click"?t.toggle():setTimeout(function(){t.show()},t._options.delay)},this._hoverShowTargetElHandler=function(){t.show()},this._hoverHideHandler=function(){setTimeout(function(){t._targetEl.matches(":hover")||t.hide()},t._options.delay)},this._options.triggerType==="hover"&&(e.showEvents.forEach(function(r){t._triggerEl.addEventListener(r,t._hoverShowTriggerElHandler),t._targetEl.addEventListener(r,t._hoverShowTargetElHandler)}),e.hideEvents.forEach(function(r){t._triggerEl.addEventListener(r,t._hoverHideHandler),t._targetEl.addEventListener(r,t._hoverHideHandler)}))},i.prototype._createPopperInstance=function(){return wt(this._triggerEl,this._targetEl,{placement:this._options.placement,modifiers:[{name:"offset",options:{offset:[this._options.offsetSkidding,this._options.offsetDistance]}}]})},i.prototype._setupClickOutsideListener=function(){var t=this;this._clickOutsideEventListener=function(e){t._handleClickOutside(e,t._targetEl)},document.body.addEventListener("click",this._clickOutsideEventListener,!0)},i.prototype._removeClickOutsideListener=function(){document.body.removeEventListener("click",this._clickOutsideEventListener,!0)},i.prototype._handleClickOutside=function(t,e){var r=t.target,n=this._options.ignoreClickOutsideClass,s=!1;if(n){var o=document.querySelectorAll(".".concat(n));o.forEach(function(a){if(a.contains(r)){s=!0;return}})}r!==e&&!e.contains(r)&&!this._triggerEl.contains(r)&&!s&&this.isVisible()&&this.hide()},i.prototype._getTriggerEvents=function(){switch(this._options.triggerType){case"hover":return{showEvents:["mouseenter","click"],hideEvents:["mouseleave"]};case"click":return{showEvents:["click"],hideEvents:[]};case"none":return{showEvents:[],hideEvents:[]};default:return{showEvents:["click"],hideEvents:[]}}},i.prototype.toggle=function(){this.isVisible()?this.hide():this.show(),this._options.onToggle(this)},i.prototype.isVisible=function(){return this._visible},i.prototype.show=function(){this._targetEl.classList.remove("hidden"),this._targetEl.classList.add("block"),this._popperInstance.setOptions(function(t){return rt(rt({},t),{modifiers:Te(Te([],t.modifiers,!0),[{name:"eventListeners",enabled:!0}],!1)})}),this._setupClickOutsideListener(),this._popperInstance.update(),this._visible=!0,this._options.onShow(this)},i.prototype.hide=function(){this._targetEl.classList.remove("block"),this._targetEl.classList.add("hidden"),this._popperInstance.setOptions(function(t){return rt(rt({},t),{modifiers:Te(Te([],t.modifiers,!0),[{name:"eventListeners",enabled:!1}],!1)})}),this._visible=!1,this._removeClickOutsideListener(),this._options.onHide(this)},i.prototype.updateOnShow=function(t){this._options.onShow=t},i.prototype.updateOnHide=function(t){this._options.onHide=t},i.prototype.updateOnToggle=function(t){this._options.onToggle=t},i}();function Mt(){document.querySelectorAll("[data-dropdown-toggle]").forEach(function(i){var t=i.getAttribute("data-dropdown-toggle"),e=document.getElementById(t);if(e){var r=i.getAttribute("data-dropdown-placement"),n=i.getAttribute("data-dropdown-offset-skidding"),s=i.getAttribute("data-dropdown-offset-distance"),o=i.getAttribute("data-dropdown-trigger"),a=i.getAttribute("data-dropdown-delay"),l=i.getAttribute("data-dropdown-ignore-click-outside-class");new ji(e,i,{placement:r||nt.placement,triggerType:o||nt.triggerType,offsetSkidding:n?parseInt(n):nt.offsetSkidding,offsetDistance:s?parseInt(s):nt.offsetDistance,delay:a?parseInt(a):nt.delay,ignoreClickOutsideClass:l||nt.ignoreClickOutsideClass})}else console.error('The dropdown element with id "'.concat(t,'" does not exist. Please check the data-dropdown-toggle attribute.'))})}typeof window<"u"&&(window.Dropdown=ji,window.initDropdowns=Mt);var Ni=ji;var De=function(){return De=Object.assign||function(i){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(i[n]=t[n])}return i},De.apply(this,arguments)},Se={placement:"center",backdropClasses:"bg-gray-900/50 dark:bg-gray-900/80 fixed inset-0 z-40",backdrop:"dynamic",closable:!0,onHide:function(){},onShow:function(){},onToggle:function(){}},no={id:null,override:!0},Hr=function(){function i(t,e,r){t===void 0&&(t=null),e===void 0&&(e=Se),r===void 0&&(r=no),this._eventListenerInstances=[],this._instanceId=r.id?r.id:t.id,this._targetEl=t,this._options=De(De({},Se),e),this._isHidden=!0,this._backdropEl=null,this._initialized=!1,this.init(),u.addInstance("Modal",this,this._instanceId,r.override)}return i.prototype.init=function(){var t=this;this._targetEl&&!this._initialized&&(this._getPlacementClasses().map(function(e){t._targetEl.classList.add(e)}),this._initialized=!0)},i.prototype.destroy=function(){this._initialized&&(this.removeAllEventListenerInstances(),this._destroyBackdropEl(),this._initialized=!1)},i.prototype.removeInstance=function(){u.removeInstance("Modal",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype._createBackdrop=function(){var t;if(this._isHidden){var e=document.createElement("div");e.setAttribute("modal-backdrop",""),(t=e.classList).add.apply(t,this._options.backdropClasses.split(" ")),document.querySelector("body").append(e),this._backdropEl=e}},i.prototype._destroyBackdropEl=function(){this._isHidden||document.querySelector("[modal-backdrop]").remove()},i.prototype._setupModalCloseEventListeners=function(){var t=this;this._options.backdrop==="dynamic"&&(this._clickOutsideEventListener=function(e){t._handleOutsideClick(e.target)},this._targetEl.addEventListener("click",this._clickOutsideEventListener,!0)),this._keydownEventListener=function(e){e.key==="Escape"&&t.hide()},document.body.addEventListener("keydown",this._keydownEventListener,!0)},i.prototype._removeModalCloseEventListeners=function(){this._options.backdrop==="dynamic"&&this._targetEl.removeEventListener("click",this._clickOutsideEventListener,!0),document.body.removeEventListener("keydown",this._keydownEventListener,!0)},i.prototype._handleOutsideClick=function(t){(t===this._targetEl||t===this._backdropEl&&this.isVisible())&&this.hide()},i.prototype._getPlacementClasses=function(){switch(this._options.placement){case"top-left":return["justify-start","items-start"];case"top-center":return["justify-center","items-start"];case"top-right":return["justify-end","items-start"];case"center-left":return["justify-start","items-center"];case"center":return["justify-center","items-center"];case"center-right":return["justify-end","items-center"];case"bottom-left":return["justify-start","items-end"];case"bottom-center":return["justify-center","items-end"];case"bottom-right":return["justify-end","items-end"];default:return["justify-center","items-center"]}},i.prototype.toggle=function(){this._isHidden?this.show():this.hide(),this._options.onToggle(this)},i.prototype.show=function(){this.isHidden&&(this._targetEl.classList.add("flex"),this._targetEl.classList.remove("hidden"),this._targetEl.setAttribute("aria-modal","true"),this._targetEl.setAttribute("role","dialog"),this._targetEl.removeAttribute("aria-hidden"),this._createBackdrop(),this._isHidden=!1,this._options.closable&&this._setupModalCloseEventListeners(),document.body.classList.add("overflow-hidden"),this._options.onShow(this))},i.prototype.hide=function(){this.isVisible&&(this._targetEl.classList.add("hidden"),this._targetEl.classList.remove("flex"),this._targetEl.setAttribute("aria-hidden","true"),this._targetEl.removeAttribute("aria-modal"),this._targetEl.removeAttribute("role"),this._destroyBackdropEl(),this._isHidden=!0,document.body.classList.remove("overflow-hidden"),this._options.closable&&this._removeModalCloseEventListeners(),this._options.onHide(this))},i.prototype.isVisible=function(){return!this._isHidden},i.prototype.isHidden=function(){return this._isHidden},i.prototype.addEventListenerInstance=function(t,e,r){this._eventListenerInstances.push({element:t,type:e,handler:r})},i.prototype.removeAllEventListenerInstances=function(){this._eventListenerInstances.map(function(t){t.element.removeEventListener(t.type,t.handler)}),this._eventListenerInstances=[]},i.prototype.getAllEventListenerInstances=function(){return this._eventListenerInstances},i.prototype.updateOnShow=function(t){this._options.onShow=t},i.prototype.updateOnHide=function(t){this._options.onHide=t},i.prototype.updateOnToggle=function(t){this._options.onToggle=t},i}();function Bt(){document.querySelectorAll("[data-modal-target]").forEach(function(i){var t=i.getAttribute("data-modal-target"),e=document.getElementById(t);if(e){var r=e.getAttribute("data-modal-placement"),n=e.getAttribute("data-modal-backdrop");new Hr(e,{placement:r||Se.placement,backdrop:n||Se.backdrop})}else console.error("Modal with id ".concat(t," does not exist. Are you sure that the data-modal-target attribute points to the correct modal id?."))}),document.querySelectorAll("[data-modal-toggle]").forEach(function(i){var t=i.getAttribute("data-modal-toggle"),e=document.getElementById(t);if(e){var r=u.getInstance("Modal",t);if(r){var n=function(){r.toggle()};i.addEventListener("click",n),r.addEventListenerInstance(i,"click",n)}else console.error("Modal with id ".concat(t," has not been initialized. Please initialize it using the data-modal-target attribute."))}else console.error("Modal with id ".concat(t," does not exist. Are you sure that the data-modal-toggle attribute points to the correct modal id?"))}),document.querySelectorAll("[data-modal-show]").forEach(function(i){var t=i.getAttribute("data-modal-show"),e=document.getElementById(t);if(e){var r=u.getInstance("Modal",t);if(r){var n=function(){r.show()};i.addEventListener("click",n),r.addEventListenerInstance(i,"click",n)}else console.error("Modal with id ".concat(t," has not been initialized. Please initialize it using the data-modal-target attribute."))}else console.error("Modal with id ".concat(t," does not exist. Are you sure that the data-modal-show attribute points to the correct modal id?"))}),document.querySelectorAll("[data-modal-hide]").forEach(function(i){var t=i.getAttribute("data-modal-hide"),e=document.getElementById(t);if(e){var r=u.getInstance("Modal",t);if(r){var n=function(){r.hide()};i.addEventListener("click",n),r.addEventListenerInstance(i,"click",n)}else console.error("Modal with id ".concat(t," has not been initialized. Please initialize it using the data-modal-target attribute."))}else console.error("Modal with id ".concat(t," does not exist. Are you sure that the data-modal-hide attribute points to the correct modal id?"))})}typeof window<"u"&&(window.Modal=Hr,window.initModals=Bt);var Me=function(){return Me=Object.assign||function(i){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(i[n]=t[n])}return i},Me.apply(this,arguments)},Et={placement:"left",bodyScrolling:!1,backdrop:!0,edge:!1,edgeOffset:"bottom-[60px]",backdropClasses:"bg-gray-900/50 dark:bg-gray-900/80 fixed inset-0 z-30",onShow:function(){},onHide:function(){},onToggle:function(){}},so={id:null,override:!0},zr=function(){function i(t,e,r){t===void 0&&(t=null),e===void 0&&(e=Et),r===void 0&&(r=so),this._eventListenerInstances=[],this._instanceId=r.id?r.id:t.id,this._targetEl=t,this._options=Me(Me({},Et),e),this._visible=!1,this._initialized=!1,this.init(),u.addInstance("Drawer",this,this._instanceId,r.override)}return i.prototype.init=function(){var t=this;this._targetEl&&!this._initialized&&(this._targetEl.setAttribute("aria-hidden","true"),this._targetEl.classList.add("transition-transform"),this._getPlacementClasses(this._options.placement).base.map(function(e){t._targetEl.classList.add(e)}),this._handleEscapeKey=function(e){e.key==="Escape"&&t.isVisible()&&t.hide()},document.addEventListener("keydown",this._handleEscapeKey),this._initialized=!0)},i.prototype.destroy=function(){this._initialized&&(this.removeAllEventListenerInstances(),this._destroyBackdropEl(),document.removeEventListener("keydown",this._handleEscapeKey),this._initialized=!1)},i.prototype.removeInstance=function(){u.removeInstance("Drawer",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.hide=function(){var t=this;this._options.edge?(this._getPlacementClasses(this._options.placement+"-edge").active.map(function(e){t._targetEl.classList.remove(e)}),this._getPlacementClasses(this._options.placement+"-edge").inactive.map(function(e){t._targetEl.classList.add(e)})):(this._getPlacementClasses(this._options.placement).active.map(function(e){t._targetEl.classList.remove(e)}),this._getPlacementClasses(this._options.placement).inactive.map(function(e){t._targetEl.classList.add(e)})),this._targetEl.setAttribute("aria-hidden","true"),this._targetEl.removeAttribute("aria-modal"),this._targetEl.removeAttribute("role"),this._options.bodyScrolling||document.body.classList.remove("overflow-hidden"),this._options.backdrop&&this._destroyBackdropEl(),this._visible=!1,this._options.onHide(this)},i.prototype.show=function(){var t=this;this._options.edge?(this._getPlacementClasses(this._options.placement+"-edge").active.map(function(e){t._targetEl.classList.add(e)}),this._getPlacementClasses(this._options.placement+"-edge").inactive.map(function(e){t._targetEl.classList.remove(e)})):(this._getPlacementClasses(this._options.placement).active.map(function(e){t._targetEl.classList.add(e)}),this._getPlacementClasses(this._options.placement).inactive.map(function(e){t._targetEl.classList.remove(e)})),this._targetEl.setAttribute("aria-modal","true"),this._targetEl.setAttribute("role","dialog"),this._targetEl.removeAttribute("aria-hidden"),this._options.bodyScrolling||document.body.classList.add("overflow-hidden"),this._options.backdrop&&this._createBackdrop(),this._visible=!0,this._options.onShow(this)},i.prototype.toggle=function(){this.isVisible()?this.hide():this.show()},i.prototype._createBackdrop=function(){var t,e=this;if(!this._visible){var r=document.createElement("div");r.setAttribute("drawer-backdrop",""),(t=r.classList).add.apply(t,this._options.backdropClasses.split(" ")),document.querySelector("body").append(r),r.addEventListener("click",function(){e.hide()})}},i.prototype._destroyBackdropEl=function(){this._visible&&document.querySelector("[drawer-backdrop]")!==null&&document.querySelector("[drawer-backdrop]").remove()},i.prototype._getPlacementClasses=function(t){switch(t){case"top":return{base:["top-0","left-0","right-0"],active:["transform-none"],inactive:["-translate-y-full"]};case"right":return{base:["right-0","top-0"],active:["transform-none"],inactive:["translate-x-full"]};case"bottom":return{base:["bottom-0","left-0","right-0"],active:["transform-none"],inactive:["translate-y-full"]};case"left":return{base:["left-0","top-0"],active:["transform-none"],inactive:["-translate-x-full"]};case"bottom-edge":return{base:["left-0","top-0"],active:["transform-none"],inactive:["translate-y-full",this._options.edgeOffset]};default:return{base:["left-0","top-0"],active:["transform-none"],inactive:["-translate-x-full"]}}},i.prototype.isHidden=function(){return!this._visible},i.prototype.isVisible=function(){return this._visible},i.prototype.addEventListenerInstance=function(t,e,r){this._eventListenerInstances.push({element:t,type:e,handler:r})},i.prototype.removeAllEventListenerInstances=function(){this._eventListenerInstances.map(function(t){t.element.removeEventListener(t.type,t.handler)}),this._eventListenerInstances=[]},i.prototype.getAllEventListenerInstances=function(){return this._eventListenerInstances},i.prototype.updateOnShow=function(t){this._options.onShow=t},i.prototype.updateOnHide=function(t){this._options.onHide=t},i.prototype.updateOnToggle=function(t){this._options.onToggle=t},i}();function Pt(){document.querySelectorAll("[data-drawer-target]").forEach(function(i){var t=i.getAttribute("data-drawer-target"),e=document.getElementById(t);if(e){var r=i.getAttribute("data-drawer-placement"),n=i.getAttribute("data-drawer-body-scrolling"),s=i.getAttribute("data-drawer-backdrop"),o=i.getAttribute("data-drawer-edge"),a=i.getAttribute("data-drawer-edge-offset");new zr(e,{placement:r||Et.placement,bodyScrolling:n?n==="true":Et.bodyScrolling,backdrop:s?s==="true":Et.backdrop,edge:o?o==="true":Et.edge,edgeOffset:a||Et.edgeOffset})}else console.error("Drawer with id ".concat(t," not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?"))}),document.querySelectorAll("[data-drawer-toggle]").forEach(function(i){var t=i.getAttribute("data-drawer-toggle"),e=document.getElementById(t);if(e){var r=u.getInstance("Drawer",t);if(r){var n=function(){r.toggle()};i.addEventListener("click",n),r.addEventListenerInstance(i,"click",n)}else console.error("Drawer with id ".concat(t," has not been initialized. Please initialize it using the data-drawer-target attribute."))}else console.error("Drawer with id ".concat(t," not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?"))}),document.querySelectorAll("[data-drawer-dismiss], [data-drawer-hide]").forEach(function(i){var t=i.getAttribute("data-drawer-dismiss")?i.getAttribute("data-drawer-dismiss"):i.getAttribute("data-drawer-hide"),e=document.getElementById(t);if(e){var r=u.getInstance("Drawer",t);if(r){var n=function(){r.hide()};i.addEventListener("click",n),r.addEventListenerInstance(i,"click",n)}else console.error("Drawer with id ".concat(t," has not been initialized. Please initialize it using the data-drawer-target attribute."))}else console.error("Drawer with id ".concat(t," not found. Are you sure that the data-drawer-target attribute points to the correct drawer id"))}),document.querySelectorAll("[data-drawer-show]").forEach(function(i){var t=i.getAttribute("data-drawer-show"),e=document.getElementById(t);if(e){var r=u.getInstance("Drawer",t);if(r){var n=function(){r.show()};i.addEventListener("click",n),r.addEventListenerInstance(i,"click",n)}else console.error("Drawer with id ".concat(t," has not been initialized. Please initialize it using the data-drawer-target attribute."))}else console.error("Drawer with id ".concat(t," not found. Are you sure that the data-drawer-target attribute points to the correct drawer id?"))})}typeof window<"u"&&(window.Drawer=zr,window.initDrawers=Pt);var Be=function(){return Be=Object.assign||function(i){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(i[n]=t[n])}return i},Be.apply(this,arguments)},Pe={defaultTabId:null,activeClasses:"text-blue-600 hover:text-blue-600 dark:text-blue-500 dark:hover:text-blue-500 border-blue-600 dark:border-blue-500",inactiveClasses:"dark:border-transparent text-gray-500 hover:text-gray-600 dark:text-gray-400 border-gray-100 hover:border-gray-300 dark:border-gray-700 dark:hover:text-gray-300",onShow:function(){}},oo={id:null,override:!0},Rr=function(){function i(t,e,r,n){t===void 0&&(t=null),e===void 0&&(e=[]),r===void 0&&(r=Pe),n===void 0&&(n=oo),this._instanceId=n.id?n.id:t.id,this._tabsEl=t,this._items=e,this._activeTab=r?this.getTab(r.defaultTabId):null,this._options=Be(Be({},Pe),r),this._initialized=!1,this.init(),u.addInstance("Tabs",this,this._tabsEl.id,!0),u.addInstance("Tabs",this,this._instanceId,n.override)}return i.prototype.init=function(){var t=this;this._items.length&&!this._initialized&&(this._activeTab||this.setActiveTab(this._items[0]),this.show(this._activeTab.id,!0),this._items.map(function(e){e.triggerEl.addEventListener("click",function(r){r.preventDefault(),t.show(e.id)})}))},i.prototype.destroy=function(){this._initialized&&(this._initialized=!1)},i.prototype.removeInstance=function(){this.destroy(),u.removeInstance("Tabs",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.getActiveTab=function(){return this._activeTab},i.prototype.setActiveTab=function(t){this._activeTab=t},i.prototype.getTab=function(t){return this._items.filter(function(e){return e.id===t})[0]},i.prototype.show=function(t,e){var r,n,s=this;e===void 0&&(e=!1);var o=this.getTab(t);o===this._activeTab&&!e||(this._items.map(function(a){var l,d;a!==o&&((l=a.triggerEl.classList).remove.apply(l,s._options.activeClasses.split(" ")),(d=a.triggerEl.classList).add.apply(d,s._options.inactiveClasses.split(" ")),a.targetEl.classList.add("hidden"),a.triggerEl.setAttribute("aria-selected","false"))}),(r=o.triggerEl.classList).add.apply(r,this._options.activeClasses.split(" ")),(n=o.triggerEl.classList).remove.apply(n,this._options.inactiveClasses.split(" ")),o.triggerEl.setAttribute("aria-selected","true"),o.targetEl.classList.remove("hidden"),this.setActiveTab(o),this._options.onShow(this,o))},i.prototype.updateOnShow=function(t){this._options.onShow=t},i}();function Ft(){document.querySelectorAll("[data-tabs-toggle]").forEach(function(i){var t=[],e=i.getAttribute("data-tabs-active-classes"),r=i.getAttribute("data-tabs-inactive-classes"),n=null;i.querySelectorAll('[role="tab"]').forEach(function(s){var o=s.getAttribute("aria-selected")==="true",a={id:s.getAttribute("data-tabs-target"),triggerEl:s,targetEl:document.querySelector(s.getAttribute("data-tabs-target"))};t.push(a),o&&(n=a.id)}),new Rr(i,t,{defaultTabId:n,activeClasses:e||Pe.activeClasses,inactiveClasses:r||Pe.inactiveClasses})})}typeof window<"u"&&(window.Tabs=Rr,window.initTabs=Ft);var st=function(){return st=Object.assign||function(i){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(i[n]=t[n])}return i},st.apply(this,arguments)},Fe=function(i,t,e){if(e||arguments.length===2)for(var r=0,n=t.length,s;r<n;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return i.concat(s||Array.prototype.slice.call(t))},je={placement:"top",triggerType:"hover",onShow:function(){},onHide:function(){},onToggle:function(){}},ao={id:null,override:!0},Kr=function(){function i(t,e,r,n){t===void 0&&(t=null),e===void 0&&(e=null),r===void 0&&(r=je),n===void 0&&(n=ao),this._instanceId=n.id?n.id:t.id,this._targetEl=t,this._triggerEl=e,this._options=st(st({},je),r),this._popperInstance=null,this._visible=!1,this._initialized=!1,this.init(),u.addInstance("Tooltip",this,this._instanceId,n.override)}return i.prototype.init=function(){this._triggerEl&&this._targetEl&&!this._initialized&&(this._setupEventListeners(),this._popperInstance=this._createPopperInstance(),this._initialized=!0)},i.prototype.destroy=function(){var t=this;if(this._initialized){var e=this._getTriggerEvents();e.showEvents.forEach(function(r){t._triggerEl.removeEventListener(r,t._showHandler)}),e.hideEvents.forEach(function(r){t._triggerEl.removeEventListener(r,t._hideHandler)}),this._removeKeydownListener(),this._removeClickOutsideListener(),this._popperInstance&&this._popperInstance.destroy(),this._initialized=!1}},i.prototype.removeInstance=function(){u.removeInstance("Tooltip",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype._setupEventListeners=function(){var t=this,e=this._getTriggerEvents();this._showHandler=function(){t.show()},this._hideHandler=function(){t.hide()},e.showEvents.forEach(function(r){t._triggerEl.addEventListener(r,t._showHandler)}),e.hideEvents.forEach(function(r){t._triggerEl.addEventListener(r,t._hideHandler)})},i.prototype._createPopperInstance=function(){return wt(this._triggerEl,this._targetEl,{placement:this._options.placement,modifiers:[{name:"offset",options:{offset:[0,8]}}]})},i.prototype._getTriggerEvents=function(){switch(this._options.triggerType){case"hover":return{showEvents:["mouseenter","focus"],hideEvents:["mouseleave","blur"]};case"click":return{showEvents:["click","focus"],hideEvents:["focusout","blur"]};case"none":return{showEvents:[],hideEvents:[]};default:return{showEvents:["mouseenter","focus"],hideEvents:["mouseleave","blur"]}}},i.prototype._setupKeydownListener=function(){var t=this;this._keydownEventListener=function(e){e.key==="Escape"&&t.hide()},document.body.addEventListener("keydown",this._keydownEventListener,!0)},i.prototype._removeKeydownListener=function(){document.body.removeEventListener("keydown",this._keydownEventListener,!0)},i.prototype._setupClickOutsideListener=function(){var t=this;this._clickOutsideEventListener=function(e){t._handleClickOutside(e,t._targetEl)},document.body.addEventListener("click",this._clickOutsideEventListener,!0)},i.prototype._removeClickOutsideListener=function(){document.body.removeEventListener("click",this._clickOutsideEventListener,!0)},i.prototype._handleClickOutside=function(t,e){var r=t.target;r!==e&&!e.contains(r)&&!this._triggerEl.contains(r)&&this.isVisible()&&this.hide()},i.prototype.isVisible=function(){return this._visible},i.prototype.toggle=function(){this.isVisible()?this.hide():this.show()},i.prototype.show=function(){this._targetEl.classList.remove("opacity-0","invisible"),this._targetEl.classList.add("opacity-100","visible"),this._popperInstance.setOptions(function(t){return st(st({},t),{modifiers:Fe(Fe([],t.modifiers,!0),[{name:"eventListeners",enabled:!0}],!1)})}),this._setupClickOutsideListener(),this._setupKeydownListener(),this._popperInstance.update(),this._visible=!0,this._options.onShow(this)},i.prototype.hide=function(){this._targetEl.classList.remove("opacity-100","visible"),this._targetEl.classList.add("opacity-0","invisible"),this._popperInstance.setOptions(function(t){return st(st({},t),{modifiers:Fe(Fe([],t.modifiers,!0),[{name:"eventListeners",enabled:!1}],!1)})}),this._removeClickOutsideListener(),this._removeKeydownListener(),this._visible=!1,this._options.onHide(this)},i.prototype.updateOnShow=function(t){this._options.onShow=t},i.prototype.updateOnHide=function(t){this._options.onHide=t},i.prototype.updateOnToggle=function(t){this._options.onToggle=t},i}();function jt(){document.querySelectorAll("[data-tooltip-target]").forEach(function(i){var t=i.getAttribute("data-tooltip-target"),e=document.getElementById(t);if(e){var r=i.getAttribute("data-tooltip-trigger"),n=i.getAttribute("data-tooltip-placement");new Kr(e,i,{placement:n||je.placement,triggerType:r||je.triggerType})}else console.error('The tooltip element with id "'.concat(t,'" does not exist. Please check the data-tooltip-target attribute.'))})}typeof window<"u"&&(window.Tooltip=Kr,window.initTooltips=jt);var ot=function(){return ot=Object.assign||function(i){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(i[n]=t[n])}return i},ot.apply(this,arguments)},Ne=function(i,t,e){if(e||arguments.length===2)for(var r=0,n=t.length,s;r<n;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return i.concat(s||Array.prototype.slice.call(t))},Qt={placement:"top",offset:10,triggerType:"hover",onShow:function(){},onHide:function(){},onToggle:function(){}},lo={id:null,override:!0},$r=function(){function i(t,e,r,n){t===void 0&&(t=null),e===void 0&&(e=null),r===void 0&&(r=Qt),n===void 0&&(n=lo),this._instanceId=n.id?n.id:t.id,this._targetEl=t,this._triggerEl=e,this._options=ot(ot({},Qt),r),this._popperInstance=null,this._visible=!1,this._initialized=!1,this.init(),u.addInstance("Popover",this,n.id?n.id:this._targetEl.id,n.override)}return i.prototype.init=function(){this._triggerEl&&this._targetEl&&!this._initialized&&(this._setupEventListeners(),this._popperInstance=this._createPopperInstance(),this._initialized=!0)},i.prototype.destroy=function(){var t=this;if(this._initialized){var e=this._getTriggerEvents();e.showEvents.forEach(function(r){t._triggerEl.removeEventListener(r,t._showHandler),t._targetEl.removeEventListener(r,t._showHandler)}),e.hideEvents.forEach(function(r){t._triggerEl.removeEventListener(r,t._hideHandler),t._targetEl.removeEventListener(r,t._hideHandler)}),this._removeKeydownListener(),this._removeClickOutsideListener(),this._popperInstance&&this._popperInstance.destroy(),this._initialized=!1}},i.prototype.removeInstance=function(){u.removeInstance("Popover",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype._setupEventListeners=function(){var t=this,e=this._getTriggerEvents();this._showHandler=function(){t.show()},this._hideHandler=function(){setTimeout(function(){t._targetEl.matches(":hover")||t.hide()},100)},e.showEvents.forEach(function(r){t._triggerEl.addEventListener(r,t._showHandler),t._targetEl.addEventListener(r,t._showHandler)}),e.hideEvents.forEach(function(r){t._triggerEl.addEventListener(r,t._hideHandler),t._targetEl.addEventListener(r,t._hideHandler)})},i.prototype._createPopperInstance=function(){return wt(this._triggerEl,this._targetEl,{placement:this._options.placement,modifiers:[{name:"offset",options:{offset:[0,this._options.offset]}}]})},i.prototype._getTriggerEvents=function(){switch(this._options.triggerType){case"hover":return{showEvents:["mouseenter","focus"],hideEvents:["mouseleave","blur"]};case"click":return{showEvents:["click","focus"],hideEvents:["focusout","blur"]};case"none":return{showEvents:[],hideEvents:[]};default:return{showEvents:["mouseenter","focus"],hideEvents:["mouseleave","blur"]}}},i.prototype._setupKeydownListener=function(){var t=this;this._keydownEventListener=function(e){e.key==="Escape"&&t.hide()},document.body.addEventListener("keydown",this._keydownEventListener,!0)},i.prototype._removeKeydownListener=function(){document.body.removeEventListener("keydown",this._keydownEventListener,!0)},i.prototype._setupClickOutsideListener=function(){var t=this;this._clickOutsideEventListener=function(e){t._handleClickOutside(e,t._targetEl)},document.body.addEventListener("click",this._clickOutsideEventListener,!0)},i.prototype._removeClickOutsideListener=function(){document.body.removeEventListener("click",this._clickOutsideEventListener,!0)},i.prototype._handleClickOutside=function(t,e){var r=t.target;r!==e&&!e.contains(r)&&!this._triggerEl.contains(r)&&this.isVisible()&&this.hide()},i.prototype.isVisible=function(){return this._visible},i.prototype.toggle=function(){this.isVisible()?this.hide():this.show(),this._options.onToggle(this)},i.prototype.show=function(){this._targetEl.classList.remove("opacity-0","invisible"),this._targetEl.classList.add("opacity-100","visible"),this._popperInstance.setOptions(function(t){return ot(ot({},t),{modifiers:Ne(Ne([],t.modifiers,!0),[{name:"eventListeners",enabled:!0}],!1)})}),this._setupClickOutsideListener(),this._setupKeydownListener(),this._popperInstance.update(),this._visible=!0,this._options.onShow(this)},i.prototype.hide=function(){this._targetEl.classList.remove("opacity-100","visible"),this._targetEl.classList.add("opacity-0","invisible"),this._popperInstance.setOptions(function(t){return ot(ot({},t),{modifiers:Ne(Ne([],t.modifiers,!0),[{name:"eventListeners",enabled:!1}],!1)})}),this._removeClickOutsideListener(),this._removeKeydownListener(),this._visible=!1,this._options.onHide(this)},i.prototype.updateOnShow=function(t){this._options.onShow=t},i.prototype.updateOnHide=function(t){this._options.onHide=t},i.prototype.updateOnToggle=function(t){this._options.onToggle=t},i}();function Nt(){document.querySelectorAll("[data-popover-target]").forEach(function(i){var t=i.getAttribute("data-popover-target"),e=document.getElementById(t);if(e){var r=i.getAttribute("data-popover-trigger"),n=i.getAttribute("data-popover-placement"),s=i.getAttribute("data-popover-offset");new $r(e,i,{placement:n||Qt.placement,offset:s?parseInt(s):Qt.offset,triggerType:r||Qt.triggerType})}else console.error('The popover element with id "'.concat(t,'" does not exist. Please check the data-popover-target attribute.'))})}typeof window<"u"&&(window.Popover=$r,window.initPopovers=Nt);var Ve=function(){return Ve=Object.assign||function(i){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(i[n]=t[n])}return i},Ve.apply(this,arguments)},Vi={triggerType:"hover",onShow:function(){},onHide:function(){},onToggle:function(){}},co={id:null,override:!0},qr=function(){function i(t,e,r,n,s){t===void 0&&(t=null),e===void 0&&(e=null),r===void 0&&(r=null),n===void 0&&(n=Vi),s===void 0&&(s=co),this._instanceId=s.id?s.id:r.id,this._parentEl=t,this._triggerEl=e,this._targetEl=r,this._options=Ve(Ve({},Vi),n),this._visible=!1,this._initialized=!1,this.init(),u.addInstance("Dial",this,this._instanceId,s.override)}return i.prototype.init=function(){var t=this;if(this._triggerEl&&this._targetEl&&!this._initialized){var e=this._getTriggerEventTypes(this._options.triggerType);this._showEventHandler=function(){t.show()},e.showEvents.forEach(function(r){t._triggerEl.addEventListener(r,t._showEventHandler),t._targetEl.addEventListener(r,t._showEventHandler)}),this._hideEventHandler=function(){t._parentEl.matches(":hover")||t.hide()},e.hideEvents.forEach(function(r){t._parentEl.addEventListener(r,t._hideEventHandler)}),this._initialized=!0}},i.prototype.destroy=function(){var t=this;if(this._initialized){var e=this._getTriggerEventTypes(this._options.triggerType);e.showEvents.forEach(function(r){t._triggerEl.removeEventListener(r,t._showEventHandler),t._targetEl.removeEventListener(r,t._showEventHandler)}),e.hideEvents.forEach(function(r){t._parentEl.removeEventListener(r,t._hideEventHandler)}),this._initialized=!1}},i.prototype.removeInstance=function(){u.removeInstance("Dial",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.hide=function(){this._targetEl.classList.add("hidden"),this._triggerEl&&this._triggerEl.setAttribute("aria-expanded","false"),this._visible=!1,this._options.onHide(this)},i.prototype.show=function(){this._targetEl.classList.remove("hidden"),this._triggerEl&&this._triggerEl.setAttribute("aria-expanded","true"),this._visible=!0,this._options.onShow(this)},i.prototype.toggle=function(){this._visible?this.hide():this.show()},i.prototype.isHidden=function(){return!this._visible},i.prototype.isVisible=function(){return this._visible},i.prototype._getTriggerEventTypes=function(t){switch(t){case"hover":return{showEvents:["mouseenter","focus"],hideEvents:["mouseleave","blur"]};case"click":return{showEvents:["click","focus"],hideEvents:["focusout","blur"]};case"none":return{showEvents:[],hideEvents:[]};default:return{showEvents:["mouseenter","focus"],hideEvents:["mouseleave","blur"]}}},i.prototype.updateOnShow=function(t){this._options.onShow=t},i.prototype.updateOnHide=function(t){this._options.onHide=t},i.prototype.updateOnToggle=function(t){this._options.onToggle=t},i}();function Vt(){document.querySelectorAll("[data-dial-init]").forEach(function(i){var t=i.querySelector("[data-dial-toggle]");if(t){var e=t.getAttribute("data-dial-toggle"),r=document.getElementById(e);if(r){var n=t.getAttribute("data-dial-trigger");new qr(i,t,r,{triggerType:n||Vi.triggerType})}else console.error("Dial with id ".concat(e," does not exist. Are you sure that the data-dial-toggle attribute points to the correct modal id?"))}else console.error("Dial with id ".concat(i.id," does not have a trigger element. Are you sure that the data-dial-toggle attribute exists?"))})}typeof window<"u"&&(window.Dial=qr,window.initDials=Vt);var He=function(){return He=Object.assign||function(i){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(i[n]=t[n])}return i},He.apply(this,arguments)},Wr={minValue:null,maxValue:null,onIncrement:function(){},onDecrement:function(){}},uo={id:null,override:!0},Ur=function(){function i(t,e,r,n,s){t===void 0&&(t=null),e===void 0&&(e=null),r===void 0&&(r=null),n===void 0&&(n=Wr),s===void 0&&(s=uo),this._instanceId=s.id?s.id:t.id,this._targetEl=t,this._incrementEl=e,this._decrementEl=r,this._options=He(He({},Wr),n),this._initialized=!1,this.init(),u.addInstance("InputCounter",this,this._instanceId,s.override)}return i.prototype.init=function(){var t=this;this._targetEl&&!this._initialized&&(this._inputHandler=function(e){{var r=e.target;/^\d*$/.test(r.value)||(r.value=r.value.replace(/[^\d]/g,"")),t._options.maxValue!==null&&parseInt(r.value)>t._options.maxValue&&(r.value=t._options.maxValue.toString()),t._options.minValue!==null&&parseInt(r.value)<t._options.minValue&&(r.value=t._options.minValue.toString())}},this._incrementClickHandler=function(){t.increment()},this._decrementClickHandler=function(){t.decrement()},this._targetEl.addEventListener("input",this._inputHandler),this._incrementEl&&this._incrementEl.addEventListener("click",this._incrementClickHandler),this._decrementEl&&this._decrementEl.addEventListener("click",this._decrementClickHandler),this._initialized=!0)},i.prototype.destroy=function(){this._targetEl&&this._initialized&&(this._targetEl.removeEventListener("input",this._inputHandler),this._incrementEl&&this._incrementEl.removeEventListener("click",this._incrementClickHandler),this._decrementEl&&this._decrementEl.removeEventListener("click",this._decrementClickHandler),this._initialized=!1)},i.prototype.removeInstance=function(){u.removeInstance("InputCounter",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.getCurrentValue=function(){return parseInt(this._targetEl.value)||0},i.prototype.increment=function(){this._options.maxValue!==null&&this.getCurrentValue()>=this._options.maxValue||(this._targetEl.value=(this.getCurrentValue()+1).toString(),this._options.onIncrement(this))},i.prototype.decrement=function(){this._options.minValue!==null&&this.getCurrentValue()<=this._options.minValue||(this._targetEl.value=(this.getCurrentValue()-1).toString(),this._options.onDecrement(this))},i.prototype.updateOnIncrement=function(t){this._options.onIncrement=t},i.prototype.updateOnDecrement=function(t){this._options.onDecrement=t},i}();function Ht(){document.querySelectorAll("[data-input-counter]").forEach(function(i){var t=i.id,e=document.querySelector('[data-input-counter-increment="'+t+'"]'),r=document.querySelector('[data-input-counter-decrement="'+t+'"]'),n=i.getAttribute("data-input-counter-min"),s=i.getAttribute("data-input-counter-max");i?u.instanceExists("InputCounter",i.getAttribute("id"))||new Ur(i,e||null,r||null,{minValue:n?parseInt(n):null,maxValue:s?parseInt(s):null}):console.error('The target element with id "'.concat(t,'" does not exist. Please check the data-input-counter attribute.'))})}typeof window<"u"&&(window.InputCounter=Ur,window.initInputCounters=Ht);var ze=function(){return ze=Object.assign||function(i){for(var t,e=1,r=arguments.length;e<r;e++){t=arguments[e];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(i[n]=t[n])}return i},ze.apply(this,arguments)},Re={htmlEntities:!1,contentType:"input",onCopy:function(){}},ho={id:null,override:!0},Xr=function(){function i(t,e,r,n){t===void 0&&(t=null),e===void 0&&(e=null),r===void 0&&(r=Re),n===void 0&&(n=ho),this._instanceId=n.id?n.id:e.id,this._triggerEl=t,this._targetEl=e,this._options=ze(ze({},Re),r),this._initialized=!1,this.init(),u.addInstance("CopyClipboard",this,this._instanceId,n.override)}return i.prototype.init=function(){var t=this;this._targetEl&&this._triggerEl&&!this._initialized&&(this._triggerElClickHandler=function(){t.copy()},this._triggerEl&&this._triggerEl.addEventListener("click",this._triggerElClickHandler),this._initialized=!0)},i.prototype.destroy=function(){this._triggerEl&&this._targetEl&&this._initialized&&(this._triggerEl&&this._triggerEl.removeEventListener("click",this._triggerElClickHandler),this._initialized=!1)},i.prototype.removeInstance=function(){u.removeInstance("CopyClipboard",this._instanceId)},i.prototype.destroyAndRemoveInstance=function(){this.destroy(),this.removeInstance()},i.prototype.getTargetValue=function(){if(this._options.contentType==="input")return this._targetEl.value;if(this._options.contentType==="innerHTML")return this._targetEl.innerHTML;if(this._options.contentType==="textContent")return this._targetEl.textContent.replace(/\s+/g," ").trim()},i.prototype.copy=function(){var t=this.getTargetValue();this._options.htmlEntities&&(t=this.decodeHTML(t));var e=document.createElement("textarea");return e.value=t,document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e),this._options.onCopy(this),t},i.prototype.decodeHTML=function(t){var e=document.createElement("textarea");return e.innerHTML=t,e.textContent},i.prototype.updateOnCopyCallback=function(t){this._options.onCopy=t},i}();function zt(){document.querySelectorAll("[data-copy-to-clipboard-target]").forEach(function(i){var t=i.getAttribute("data-copy-to-clipboard-target"),e=document.getElementById(t),r=i.getAttribute("data-copy-to-clipboard-content-type"),n=i.getAttribute("data-copy-to-clipboard-html-entities");e?u.instanceExists("CopyClipboard",e.getAttribute("id"))||new Xr(i,e,{htmlEntities:n&&n==="true"?!0:Re.htmlEntities,contentType:r||Re.contentType}):console.error('The target element with id "'.concat(t,'" does not exist. Please check the data-copy-to-clipboard-target attribute.'))})}typeof window<"u"&&(window.CopyClipboard=Xr,window.initClipboards=zt);function Yr(){At(),Ot(),Ct(),kt(),Mt(),Bt(),Pt(),Ft(),jt(),Nt(),Vt(),Ht(),zt()}typeof window<"u"&&(window.initFlowbite=Yr);var po=new pr("load",[At,Ot,Ct,kt,Mt,Bt,Pt,Ft,jt,Nt,Vt,Ht,zt]);po.init();var Ke=class extends A{static targets=["trigger","menu"];connect(){this.dropdown=new Ni(this.menuTarget,this.triggerTarget)}disconnect(){this.dropdown=null}toggle(){this.dropdown.toggle()}show(){this.dropdown.show()}hide(){this.dropdown.show()}};var $e=class extends A{static targets=["trigger","target"];static values={after:Number};connect(){this.dismiss=new xi(this.targetTarget,this.triggerTarget),console.log(this.hasAfterValue),console.log(this.afterValue),this.hasAfterValue&&this.afterValue>0&&(this.autoDismissTimeout=setTimeout(()=>{this.hide(),this.autoDismissTimeout=null},this.afterValue))}disconnect(){this.autoDismissTimeout&&clearTimeout(this.autoDismissTimeout),this.dismiss=null,this.autoDismissTimeout=null}hide(){this.dismiss.hide()}};function Jr(i){i.register("nested-resource-form-fields",he),i.register("tab-bar",pe),i.register("toolbar",fe),i.register("table-search-input",me),i.register("table-toolbar",ve),i.register("table",ge),i.register("form",ye),i.register("resource-drop-down",Ke),i.register("resource-dismiss",$e)}eventNames=["turbo:click","turbo:before-visit","turbo:visit","turbo:submit-start","turbo:before-fetch-request","turbo:before-fetch-response","turbo:submit-end","turbo:before-cache","turbo:before-render","turbo:before-stream-render","turbo:render","turbo:load","turbo:before-frame-render","turbo:frame-render","turbo:frame-load","turbo:frame-missing","turbo:fetch-request-error","turbo:reload","turbo:morph","turbo:before-morph-element","turbo:morph-attribute","turbo:morph"];eventNames.forEach(i=>{document.addEventListener(i,t=>{console.log(t.type,t)})});var fo=de.start();Jr(fo);})();
6
- //# sourceMappingURL=plutonium-app-36KN5FVJ.js.map