alchemy_cms 7.1.12 → 7.2.0.b
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +132 -29
- data/Gemfile +2 -4
- data/LICENSE +1 -1
- data/README.md +5 -6
- data/SECURITY.md +1 -1
- data/alchemy_cms.gemspec +3 -4
- data/app/assets/javascripts/alchemy/admin.js +0 -9
- data/app/assets/javascripts/alchemy/alchemy.dialog.js.coffee +5 -15
- data/app/assets/javascripts/alchemy/alchemy.image_overlay.coffee +5 -4
- data/app/assets/javascripts/alchemy/templates/index.js +0 -1
- data/app/assets/javascripts/alchemy/templates/node_folder.hbs +1 -1
- data/app/assets/javascripts/alchemy/templates/page_folder.hbs +1 -1
- data/app/assets/javascripts/tinymce/plugins/alchemy_link/plugin.min.js +20 -7
- data/app/assets/stylesheets/alchemy/_custom-properties.scss +12 -0
- data/app/assets/stylesheets/alchemy/_mixins.scss +10 -6
- data/app/assets/stylesheets/alchemy/_variables.scss +3 -0
- data/app/assets/stylesheets/alchemy/admin.scss +2 -2
- data/app/assets/stylesheets/alchemy/archive.scss +4 -3
- data/app/assets/stylesheets/alchemy/attachment-select.scss +19 -0
- data/app/assets/stylesheets/alchemy/base.scss +31 -18
- data/app/assets/stylesheets/alchemy/buttons.scss +3 -4
- data/app/assets/stylesheets/alchemy/dashboard.scss +1 -1
- data/app/assets/stylesheets/alchemy/dialogs.scss +2 -5
- data/app/assets/stylesheets/alchemy/elements.scss +73 -41
- data/app/assets/stylesheets/alchemy/flash.scss +20 -70
- data/app/assets/stylesheets/alchemy/forms.scss +41 -36
- data/app/assets/stylesheets/alchemy/frame.scss +12 -3
- data/app/assets/stylesheets/alchemy/icons.scss +34 -2
- data/app/assets/stylesheets/alchemy/image_library.scss +18 -9
- data/app/assets/stylesheets/alchemy/{filter_field.scss → list_filter.scss} +8 -7
- data/app/assets/stylesheets/alchemy/lists.scss +1 -1
- data/app/assets/stylesheets/alchemy/navigation.scss +9 -12
- data/app/assets/stylesheets/alchemy/node-select.scss +1 -1
- data/app/assets/stylesheets/alchemy/nodes.scss +15 -13
- data/app/assets/stylesheets/alchemy/notices.scss +56 -39
- data/app/assets/stylesheets/alchemy/page-select.scss +1 -4
- data/app/assets/stylesheets/alchemy/pagination.scss +11 -1
- data/app/assets/stylesheets/alchemy/preview_window.scss +3 -3
- data/app/assets/stylesheets/alchemy/search.scss +4 -4
- data/app/assets/stylesheets/alchemy/selects.scss +13 -7
- data/app/assets/stylesheets/alchemy/shoelace.scss +33 -2
- data/app/assets/stylesheets/alchemy/sitemap.scss +155 -159
- data/app/assets/stylesheets/alchemy/tables.scss +49 -12
- data/app/assets/stylesheets/alchemy/tags.scss +17 -11
- data/app/assets/stylesheets/alchemy/toolbar.scss +2 -2
- data/app/assets/stylesheets/alchemy/typography.scss +41 -22
- data/app/assets/stylesheets/alchemy/upload.scss +5 -4
- data/app/components/alchemy/admin/attachment_select.rb +39 -0
- data/app/components/alchemy/admin/icon.rb +72 -0
- data/app/components/alchemy/admin/link_dialog/anchor_tab.rb +41 -0
- data/app/components/alchemy/admin/link_dialog/base_tab.rb +75 -0
- data/app/components/alchemy/admin/link_dialog/external_tab.rb +42 -0
- data/app/components/alchemy/admin/link_dialog/file_tab.rb +45 -0
- data/app/components/alchemy/admin/link_dialog/internal_tab.rb +66 -0
- data/app/components/alchemy/admin/link_dialog/tabs.rb +33 -0
- data/app/components/alchemy/admin/list_filter.rb +42 -0
- data/app/components/alchemy/admin/message.rb +19 -0
- data/app/components/alchemy/admin/tags_autocomplete.rb +25 -0
- data/app/components/alchemy/admin/toolbar_button.rb +111 -0
- data/app/components/alchemy/ingredients/datetime_view.rb +2 -3
- data/app/components/alchemy/ingredients/link_view.rb +1 -7
- data/app/components/alchemy/ingredients/picture_view.rb +2 -2
- data/app/components/alchemy/ingredients/text_view.rb +1 -2
- data/app/controllers/alchemy/admin/base_controller.rb +1 -1
- data/app/controllers/alchemy/admin/elements_controller.rb +4 -2
- data/app/controllers/alchemy/admin/ingredients_controller.rb +2 -0
- data/app/controllers/alchemy/admin/languages_controller.rb +1 -1
- data/app/controllers/alchemy/admin/layoutpages_controller.rb +0 -19
- data/app/controllers/alchemy/admin/legacy_page_urls_controller.rb +12 -4
- data/app/controllers/alchemy/admin/nodes_controller.rb +26 -0
- data/app/controllers/alchemy/admin/pages_controller.rb +11 -78
- data/app/controllers/alchemy/admin/picture_descriptions_controller.rb +15 -0
- data/app/controllers/alchemy/admin/pictures_controller.rb +18 -1
- data/app/controllers/alchemy/admin/resources_controller.rb +15 -10
- data/app/controllers/alchemy/api/attachments_controller.rb +44 -0
- data/app/controllers/alchemy/api/pages_controller.rb +10 -6
- data/app/controllers/alchemy/base_controller.rb +2 -2
- data/app/controllers/alchemy/messages_controller.rb +3 -3
- data/app/controllers/alchemy/pages_controller.rb +8 -6
- data/app/controllers/concerns/alchemy/admin/current_language.rb +1 -11
- data/app/controllers/concerns/alchemy/legacy_page_redirects.rb +1 -1
- data/app/decorators/alchemy/element_editor.rb +2 -2
- data/app/helpers/alchemy/admin/base_helper.rb +8 -60
- data/app/helpers/alchemy/admin/elements_helper.rb +1 -1
- data/app/helpers/alchemy/admin/ingredients_helper.rb +1 -1
- data/app/helpers/alchemy/base_helper.rb +9 -91
- data/app/helpers/alchemy/elements_helper.rb +3 -3
- data/app/helpers/alchemy/pages_helper.rb +16 -9
- data/app/javascript/alchemy_admin/components/attachment_select.js +24 -0
- data/app/javascript/alchemy_admin/components/button.js +3 -0
- data/app/javascript/alchemy_admin/components/clipboard_button.js +3 -2
- data/app/javascript/alchemy_admin/components/dialog_link.js +10 -7
- data/app/javascript/alchemy_admin/components/dom_id_select.js +69 -0
- data/app/javascript/alchemy_admin/components/element_editor/delete_element_button.js +42 -0
- data/app/javascript/alchemy_admin/components/element_editor/publish_element_button.js +4 -2
- data/app/javascript/alchemy_admin/components/element_editor.js +21 -13
- data/app/javascript/alchemy_admin/components/elements_window.js +87 -0
- data/app/javascript/alchemy_admin/components/growl.js +13 -0
- data/app/javascript/alchemy_admin/components/icon.js +51 -0
- data/app/javascript/alchemy_admin/components/index.js +24 -0
- data/app/javascript/alchemy_admin/components/ingredient_group.js +6 -0
- data/app/javascript/alchemy_admin/components/link_buttons/link_button.js +21 -11
- data/app/javascript/alchemy_admin/components/link_buttons/unlink_button.js +2 -1
- data/app/javascript/alchemy_admin/components/link_buttons.js +1 -0
- data/app/javascript/alchemy_admin/components/list_filter.js +68 -0
- data/app/javascript/alchemy_admin/components/message.js +69 -0
- data/app/javascript/alchemy_admin/components/node_select.js +1 -1
- data/app/javascript/alchemy_admin/components/overlay.js +6 -6
- data/app/javascript/alchemy_admin/components/page_select.js +3 -7
- data/app/javascript/alchemy_admin/components/preview_window.js +121 -0
- data/app/javascript/alchemy_admin/components/remote_select.js +4 -1
- data/app/javascript/alchemy_admin/components/select.js +37 -1
- data/app/javascript/alchemy_admin/components/tags_autocomplete.js +57 -0
- data/app/javascript/alchemy_admin/components/uploader/file_upload.js +4 -3
- data/app/javascript/alchemy_admin/components/uploader/progress.js +1 -1
- data/app/javascript/alchemy_admin/confirm_dialog.js +133 -0
- data/app/javascript/alchemy_admin/dirty.js +19 -14
- data/app/javascript/alchemy_admin/fixed_elements.js +24 -0
- data/app/javascript/alchemy_admin/growler.js +15 -0
- data/app/javascript/alchemy_admin/gui.js +2 -4
- data/app/javascript/alchemy_admin/hotkeys.js +60 -0
- data/app/javascript/alchemy_admin/image_loader.js +2 -2
- data/app/javascript/alchemy_admin/ingredient_anchor_link.js +2 -3
- data/app/javascript/alchemy_admin/initializer.js +1 -8
- data/app/javascript/alchemy_admin/link_dialog.js +131 -0
- data/app/javascript/alchemy_admin/locales/en.js +3 -0
- data/app/javascript/alchemy_admin/node_tree.js +4 -3
- data/app/javascript/alchemy_admin/page_sorter.js +23 -14
- data/app/javascript/alchemy_admin/picture_editors.js +6 -5
- data/app/javascript/alchemy_admin/shoelace_theme.js +60 -0
- data/app/javascript/alchemy_admin/sitemap.js +9 -3
- data/app/javascript/alchemy_admin/sortable_elements.js +4 -6
- data/app/javascript/alchemy_admin.js +18 -42
- data/app/models/alchemy/current.rb +26 -0
- data/app/models/alchemy/element.rb +1 -1
- data/app/models/alchemy/ingredients/audio.rb +0 -11
- data/app/models/alchemy/ingredients/datetime.rb +1 -1
- data/app/models/alchemy/ingredients/headline.rb +8 -1
- data/app/models/alchemy/ingredients/picture.rb +6 -0
- data/app/models/alchemy/ingredients/video.rb +0 -12
- data/app/models/alchemy/language.rb +8 -6
- data/app/models/alchemy/node.rb +2 -2
- data/app/models/alchemy/page/page_elements.rb +8 -8
- data/app/models/alchemy/page/page_layouts.rb +3 -3
- data/app/models/alchemy/page/page_natures.rb +13 -9
- data/app/models/alchemy/page/page_scopes.rb +2 -2
- data/app/models/alchemy/page/publisher.rb +1 -0
- data/app/models/alchemy/page.rb +13 -28
- data/app/models/alchemy/picture.rb +8 -0
- data/app/models/alchemy/picture_description.rb +8 -0
- data/app/models/alchemy/picture_variant.rb +1 -1
- data/app/models/alchemy/site.rb +10 -7
- data/app/serializers/alchemy/attachment_serializer.rb +8 -0
- data/app/serializers/alchemy/page_node_serializer.rb +9 -0
- data/app/views/alchemy/_menubar.html.erb +1 -1
- data/app/views/alchemy/_preview_mode_code.html.erb +1 -1
- data/app/views/alchemy/admin/attachments/_tag_list.html.erb +2 -2
- data/app/views/alchemy/admin/attachments/archive_overlay.js.erb +0 -1
- data/app/views/alchemy/admin/attachments/edit.html.erb +3 -4
- data/app/views/alchemy/admin/clipboard/clear.js.erb +1 -1
- data/app/views/alchemy/admin/clipboard/index.html.erb +1 -1
- data/app/views/alchemy/admin/clipboard/insert.js.erb +1 -1
- data/app/views/alchemy/admin/clipboard/remove.js.erb +1 -1
- data/app/views/alchemy/admin/dashboard/_locked_pages.html.erb +1 -1
- data/app/views/alchemy/admin/dashboard/_sites.html.erb +1 -1
- data/app/views/alchemy/admin/dashboard/help.html.erb +48 -12
- data/app/views/alchemy/admin/dashboard/index.html.erb +1 -1
- data/app/views/alchemy/admin/dashboard/info.html.erb +5 -8
- data/app/views/alchemy/admin/elements/_add_nested_element_form.html.erb +1 -1
- data/app/views/alchemy/admin/elements/_element.html.erb +5 -5
- data/app/views/alchemy/admin/elements/_footer.html.erb +1 -1
- data/app/views/alchemy/admin/elements/_header.html.erb +6 -2
- data/app/views/alchemy/admin/elements/_toolbar.html.erb +8 -6
- data/app/views/alchemy/admin/elements/create.js.erb +0 -5
- data/app/views/alchemy/admin/elements/index.html.erb +70 -34
- data/app/views/alchemy/admin/ingredients/_file_fields.html.erb +1 -2
- data/app/views/alchemy/admin/ingredients/_picture_fields.html.erb +3 -5
- data/app/views/alchemy/admin/languages/_language.html.erb +1 -1
- data/app/views/alchemy/admin/languages/index.html.erb +2 -2
- data/app/views/alchemy/admin/layoutpages/_layoutpage.html.erb +18 -18
- data/app/views/alchemy/admin/layoutpages/edit.html.erb +4 -5
- data/app/views/alchemy/admin/layoutpages/index.html.erb +2 -2
- data/app/views/alchemy/admin/legacy_page_urls/_legacy_page_url.html.erb +10 -11
- data/app/views/alchemy/admin/legacy_page_urls/_new.html.erb +15 -17
- data/app/views/alchemy/admin/legacy_page_urls/_table.html.erb +16 -0
- data/app/views/alchemy/admin/legacy_page_urls/_update.turbo_stream.erb +12 -0
- data/app/views/alchemy/admin/legacy_page_urls/create.turbo_stream.erb +8 -0
- data/app/views/alchemy/admin/legacy_page_urls/destroy.turbo_stream.erb +1 -0
- data/app/views/alchemy/admin/legacy_page_urls/edit.html.erb +27 -0
- data/app/views/alchemy/admin/legacy_page_urls/show.html.erb +1 -0
- data/app/views/alchemy/admin/legacy_page_urls/update.turbo_stream.erb +1 -0
- data/app/views/alchemy/admin/nodes/_form.html.erb +12 -11
- data/app/views/alchemy/admin/nodes/_label.html.erb +1 -0
- data/app/views/alchemy/admin/nodes/_node.html.erb +19 -19
- data/app/views/alchemy/admin/nodes/_page_nodes.html.erb +48 -0
- data/app/views/alchemy/admin/nodes/_update.turbo_stream.erb +9 -0
- data/app/views/alchemy/admin/nodes/create.turbo_stream.erb +1 -0
- data/app/views/alchemy/admin/nodes/destroy.turbo_stream.erb +1 -0
- data/app/views/alchemy/admin/nodes/index.html.erb +3 -3
- data/app/views/alchemy/admin/pages/_form.html.erb +3 -4
- data/app/views/alchemy/admin/pages/_legacy_urls.html.erb +4 -15
- data/app/views/alchemy/admin/pages/_page.html.erb +39 -39
- data/app/views/alchemy/admin/pages/_table_row.html.erb +3 -3
- data/app/views/alchemy/admin/pages/_toolbar.html.erb +2 -2
- data/app/views/alchemy/admin/pages/configure.html.erb +6 -0
- data/app/views/alchemy/admin/pages/edit.html.erb +15 -62
- data/app/views/alchemy/admin/pages/unlock.js.erb +3 -3
- data/app/views/alchemy/admin/partials/_autocomplete_tag_list.html.erb +3 -1
- data/app/views/alchemy/admin/partials/_flash_notices.html.erb +4 -2
- data/app/views/alchemy/admin/partials/_language_tree_select.html.erb +1 -1
- data/app/views/alchemy/admin/partials/_main_navigation_entry.html.erb +5 -2
- data/app/views/alchemy/admin/partials/_remote_search_form.html.erb +2 -2
- data/app/views/alchemy/admin/partials/_search_form.html.erb +2 -2
- data/app/views/alchemy/admin/partials/_site_select.html.erb +1 -1
- data/app/views/alchemy/admin/picture_descriptions/_form.html.erb +11 -0
- data/app/views/alchemy/admin/picture_descriptions/edit.html.erb +6 -0
- data/app/views/alchemy/admin/pictures/_form.html.erb +4 -3
- data/app/views/alchemy/admin/pictures/_infos.html.erb +1 -1
- data/app/views/alchemy/admin/pictures/_picture_description_field.html.erb +29 -0
- data/app/views/alchemy/admin/pictures/_tag_list.html.erb +2 -2
- data/app/views/alchemy/admin/pictures/archive_overlay.js.erb +0 -2
- data/app/views/alchemy/admin/pictures/edit_multiple.html.erb +3 -3
- data/app/views/alchemy/admin/pictures/show.html.erb +3 -3
- data/app/views/alchemy/admin/resources/_form.html.erb +3 -4
- data/app/views/alchemy/admin/resources/_per_page_select.html.erb +1 -1
- data/app/views/alchemy/admin/resources/_tag_list.html.erb +2 -2
- data/app/views/alchemy/admin/resources/index.html.erb +2 -2
- data/app/views/alchemy/admin/sites/index.html.erb +1 -1
- data/app/views/alchemy/admin/styleguide/index.html.erb +29 -24
- data/app/views/alchemy/admin/tags/_tag.html.erb +1 -1
- data/app/views/alchemy/admin/tags/edit.html.erb +1 -1
- data/app/views/alchemy/admin/tags/index.html.erb +1 -1
- data/app/views/alchemy/base/500.html.erb +7 -18
- data/app/views/alchemy/base/error_notice.html.erb +3 -1
- data/app/views/alchemy/ingredients/_boolean_editor.html.erb +1 -1
- data/app/views/alchemy/ingredients/_datetime_editor.html.erb +2 -3
- data/app/views/alchemy/ingredients/_headline_editor.html.erb +13 -8
- data/app/views/alchemy/ingredients/_picture_editor.html.erb +1 -1
- data/app/views/alchemy/ingredients/shared/_picture_tools.html.erb +1 -1
- data/app/views/alchemy/language_links/_language.html.erb +1 -1
- data/app/views/kaminari/alchemy/_first_page.html.erb +2 -2
- data/app/views/kaminari/alchemy/_gap.html.erb +1 -1
- data/app/views/kaminari/alchemy/_last_page.html.erb +2 -2
- data/app/views/kaminari/alchemy/_next_page.html.erb +2 -2
- data/app/views/kaminari/alchemy/_prev_page.html.erb +2 -2
- data/app/views/layouts/alchemy/admin.html.erb +2 -1
- data/bundles/shoelace.js +3 -1
- data/config/locales/alchemy.en.yml +16 -3
- data/config/routes.rb +4 -2
- data/db/migrate/20240314105244_create_alchemy_picture_descriptions.rb +11 -0
- data/lib/alchemy/configuration_methods.rb +1 -1
- data/lib/alchemy/controller_actions.rb +3 -3
- data/lib/alchemy/element_definition.rb +10 -6
- data/lib/alchemy/engine.rb +19 -2
- data/lib/alchemy/page_layout.rb +10 -6
- data/lib/alchemy/permissions.rb +4 -3
- data/lib/alchemy/routing_constraints.rb +1 -1
- data/lib/alchemy/seeder.rb +2 -2
- data/lib/alchemy/test_support/capybara_helpers.rb +4 -0
- data/lib/alchemy/test_support/factories/language_factory.rb +1 -1
- data/lib/alchemy/test_support/shared_contexts.rb +8 -0
- data/lib/alchemy/tinymce.rb +2 -1
- data/lib/alchemy/version.rb +1 -1
- data/lib/alchemy.rb +36 -0
- data/lib/alchemy_cms.rb +0 -1
- data/lib/generators/alchemy/menus/templates/node.html.erb +2 -2
- data/lib/generators/alchemy/menus/templates/node.html.haml +2 -2
- data/lib/generators/alchemy/menus/templates/node.html.slim +2 -2
- data/lib/generators/alchemy/menus/templates/wrapper.html.erb +1 -1
- data/lib/generators/alchemy/menus/templates/wrapper.html.haml +1 -1
- data/lib/generators/alchemy/menus/templates/wrapper.html.slim +1 -1
- data/lib/tasks/alchemy/sitemap.rake +97 -0
- data/lib/tasks/alchemy/tidy.rake +1 -0
- data/package.json +8 -8
- data/vendor/assets/fonts/remixicon.symbol.svg +11 -0
- data/vendor/javascript/shoelace.min.js +333 -118
- data/vendor/javascript/sortable.min.js +1 -1
- data/vendor/javascript/tinymce.min.js +1 -1
- data/vendor/javascript/ungap-custom-elements.min.js +1 -1
- metadata +61 -55
- data/app/assets/javascripts/alchemy/alchemy.confirm_dialog.js.coffee +0 -85
- data/app/assets/javascripts/alchemy/alchemy.elements_window.js.coffee +0 -107
- data/app/assets/javascripts/alchemy/alchemy.file_progress.js.coffee +0 -66
- data/app/assets/javascripts/alchemy/alchemy.fixed_elements.js +0 -45
- data/app/assets/javascripts/alchemy/alchemy.growler.js.coffee +0 -24
- data/app/assets/javascripts/alchemy/alchemy.hotkeys.js.coffee +0 -49
- data/app/assets/javascripts/alchemy/alchemy.initializer.js.coffee +0 -0
- data/app/assets/javascripts/alchemy/alchemy.link_dialog.js.coffee +0 -230
- data/app/assets/javascripts/alchemy/alchemy.list_filter.js.coffee +0 -49
- data/app/assets/javascripts/alchemy/alchemy.preview_window.js.coffee +0 -82
- data/app/assets/javascripts/alchemy/alchemy.string_extension.js.coffee +0 -11
- data/app/assets/javascripts/alchemy/templates/page.hbs +0 -19
- data/app/javascript/alchemy_admin/tags_autocomplete.js +0 -46
- data/app/models/alchemy/tree_node.rb +0 -7
- data/app/views/alchemy/admin/elements/destroy.js.erb +0 -8
- data/app/views/alchemy/admin/legacy_page_urls/_form.html.erb +0 -5
- data/app/views/alchemy/admin/legacy_page_urls/create.js.erb +0 -9
- data/app/views/alchemy/admin/legacy_page_urls/destroy.js.erb +0 -6
- data/app/views/alchemy/admin/legacy_page_urls/update.js.erb +0 -2
- data/app/views/alchemy/admin/pages/_anchor_link.html.erb +0 -22
- data/app/views/alchemy/admin/pages/_external_link.html.erb +0 -31
- data/app/views/alchemy/admin/pages/_file_link.html.erb +0 -31
- data/app/views/alchemy/admin/pages/_internal_link.html.erb +0 -35
- data/app/views/alchemy/admin/pages/link.html.erb +0 -26
- data/app/views/alchemy/admin/partials/_flash.html.erb +0 -4
- data/app/views/alchemy/admin/partials/_toolbar_button.html.erb +0 -29
- data/lib/alchemy/test_support/current_language_shared_examples.rb +0 -33
- data/vendor/assets/fonts/remixicon.eot +0 -0
- data/vendor/assets/fonts/remixicon.svg +0 -7816
- data/vendor/assets/fonts/remixicon.ttf +0 -0
- data/vendor/assets/fonts/remixicon.woff +0 -0
- data/vendor/assets/fonts/remixicon.woff2 +0 -0
- data/vendor/assets/stylesheets/remixicon.scss +0 -10480
@@ -4,4 +4,4 @@
|
|
4
4
|
* @author owenm <owen23355@gmail.com>
|
5
5
|
* @license MIT
|
6
6
|
*/
|
7
|
-
function t(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function e(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?t(Object(i),!0).forEach((function(t){o(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(){return i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},i.apply(this,arguments)}function r(t,e){if(null==t)return{};var n,o,i=function(t,e){if(null==t)return{};var n,o,i={},r=Object.keys(t);for(o=0;o<r.length;o++)n=r[o],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(o=0;o<r.length;o++)n=r[o],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function a(t){return function(t){if(Array.isArray(t))return l(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return l(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}function s(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var c=s(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),u=s(/Edge/i),d=s(/firefox/i),h=s(/safari/i)&&!s(/chrome/i)&&!s(/android/i),f=s(/iP(ad|od|hone)/i),p=s(/chrome/i)&&s(/android/i),g={capture:!1,passive:!1};function v(t,e,n){t.addEventListener(e,n,!c&&g)}function m(t,e,n){t.removeEventListener(e,n,!c&&g)}function b(t,e){if(e){if(">"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){return!1}return!1}}function y(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function w(t,e,n,o){if(t){n=n||document;do{if(null!=e&&(">"===e[0]?t.parentNode===n&&b(t,e):b(t,e))||o&&t===n)return t;if(t===n)break}while(t=y(t))}return null}var E,D=/\s+/g;function S(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var o=(" "+t.className+" ").replace(D," ").replace(" "+e+" "," ");t.className=(o+(n?" "+e:"")).replace(D," ")}}function _(t,e,n){var o=t&&t.style;if(o){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];e in o||-1!==e.indexOf("webkit")||(e="-webkit-"+e),o[e]=n+("string"==typeof n?"":"px")}}function C(t,e){var n="";if("string"==typeof t)n=t;else do{var o=_(t,"transform");o&&"none"!==o&&(n=o+" "+n)}while(!e&&(t=t.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function T(t,e,n){if(t){var o=t.getElementsByTagName(e),i=0,r=o.length;if(n)for(;i<r;i++)n(o[i],i);return o}return[]}function x(){var t=document.scrollingElement;return t||document.documentElement}function O(t,e,n,o,i){if(t.getBoundingClientRect||t===window){var r,a,l,s,u,d,h;if(t!==window&&t.parentNode&&t!==x()?(a=(r=t.getBoundingClientRect()).top,l=r.left,s=r.bottom,u=r.right,d=r.height,h=r.width):(a=0,l=0,s=window.innerHeight,u=window.innerWidth,d=window.innerHeight,h=window.innerWidth),(e||n)&&t!==window&&(i=i||t.parentNode,!c))do{if(i&&i.getBoundingClientRect&&("none"!==_(i,"transform")||n&&"static"!==_(i,"position"))){var f=i.getBoundingClientRect();a-=f.top+parseInt(_(i,"border-top-width")),l-=f.left+parseInt(_(i,"border-left-width")),s=a+r.height,u=l+r.width;break}}while(i=i.parentNode);if(o&&t!==window){var p=C(i||t),g=p&&p.a,v=p&&p.d;p&&(s=(a/=v)+(d/=v),u=(l/=g)+(h/=g))}return{top:a,left:l,bottom:s,right:u,width:h,height:d}}}function M(t,e,n){for(var o=k(t,!0),i=O(t)[e];o;){var r=O(o)[n];if(!("top"===n||"left"===n?i>=r:i<=r))return o;if(o===x())break;o=k(o,!1)}return!1}function A(t,e,n,o){for(var i=0,r=0,a=t.children;r<a.length;){if("none"!==a[r].style.display&&a[r]!==Ht.ghost&&(o||a[r]!==Ht.dragged)&&w(a[r],n.draggable,t,!1)){if(i===e)return a[r];i++}r++}return null}function N(t,e){for(var n=t.lastElementChild;n&&(n===Ht.ghost||"none"===_(n,"display")||e&&!b(n,e));)n=n.previousElementSibling;return n||null}function I(t,e){var n=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)"TEMPLATE"===t.nodeName.toUpperCase()||t===Ht.clone||e&&!b(t,e)||n++;return n}function P(t){var e=0,n=0,o=x();if(t)do{var i=C(t),r=i.a,a=i.d;e+=t.scrollLeft*r,n+=t.scrollTop*a}while(t!==o&&(t=t.parentNode));return[e,n]}function k(t,e){if(!t||!t.getBoundingClientRect)return x();var n=t,o=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=_(n);if(n.clientWidth<n.scrollWidth&&("auto"==i.overflowX||"scroll"==i.overflowX)||n.clientHeight<n.scrollHeight&&("auto"==i.overflowY||"scroll"==i.overflowY)){if(!n.getBoundingClientRect||n===document.body)return x();if(o||e)return n;o=!0}}}while(n=n.parentNode);return x()}function R(t,e){return Math.round(t.top)===Math.round(e.top)&&Math.round(t.left)===Math.round(e.left)&&Math.round(t.height)===Math.round(e.height)&&Math.round(t.width)===Math.round(e.width)}function X(t,e){return function(){if(!E){var n=arguments;1===n.length?t.call(this,n[0]):t.apply(this,n),E=setTimeout((function(){E=void 0}),e)}}}function Y(t,e,n){t.scrollLeft+=e,t.scrollTop+=n}function B(t){var e=window.Polymer,n=window.jQuery||window.Zepto;return e&&e.dom?e.dom(t).cloneNode(!0):n?n(t).clone(!0)[0]:t.cloneNode(!0)}function F(t,e){_(t,"position","absolute"),_(t,"top",e.top),_(t,"left",e.left),_(t,"width",e.width),_(t,"height",e.height)}function j(t){_(t,"position",""),_(t,"top",""),_(t,"left",""),_(t,"width",""),_(t,"height","")}function H(t,e,n){var o={};return Array.from(t.children).forEach((function(i){var r,a,l,s;if(w(i,e.draggable,t,!1)&&!i.animated&&i!==n){var c=O(i);o.left=Math.min(null!==(r=o.left)&&void 0!==r?r:1/0,c.left),o.top=Math.min(null!==(a=o.top)&&void 0!==a?a:1/0,c.top),o.right=Math.max(null!==(l=o.right)&&void 0!==l?l:-1/0,c.right),o.bottom=Math.max(null!==(s=o.bottom)&&void 0!==s?s:-1/0,c.bottom)}})),o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}var L="Sortable"+(new Date).getTime();function K(){var t,n=[];return{captureAnimationState:function(){(n=[],this.options.animation)&&[].slice.call(this.el.children).forEach((function(t){if("none"!==_(t,"display")&&t!==Ht.ghost){n.push({target:t,rect:O(t)});var o=e({},n[n.length-1].rect);if(t.thisAnimationDuration){var i=C(t,!0);i&&(o.top-=i.f,o.left-=i.e)}t.fromRect=o}}))},addAnimationState:function(t){n.push(t)},removeAnimationState:function(t){n.splice(function(t,e){for(var n in t)if(t.hasOwnProperty(n))for(var o in e)if(e.hasOwnProperty(o)&&e[o]===t[n][o])return Number(n);return-1}(n,{target:t}),1)},animateAll:function(e){var o=this;if(!this.options.animation)return clearTimeout(t),void("function"==typeof e&&e());var i=!1,r=0;n.forEach((function(t){var e=0,n=t.target,a=n.fromRect,l=O(n),s=n.prevFromRect,c=n.prevToRect,u=t.rect,d=C(n,!0);d&&(l.top-=d.f,l.left-=d.e),n.toRect=l,n.thisAnimationDuration&&R(s,l)&&!R(a,l)&&(u.top-l.top)/(u.left-l.left)==(a.top-l.top)/(a.left-l.left)&&(e=function(t,e,n,o){return Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))/Math.sqrt(Math.pow(e.top-n.top,2)+Math.pow(e.left-n.left,2))*o.animation}(u,s,c,o.options)),R(l,a)||(n.prevFromRect=a,n.prevToRect=l,e||(e=o.options.animation),o.animate(n,u,l,e)),e&&(i=!0,r=Math.max(r,e),clearTimeout(n.animationResetTimer),n.animationResetTimer=setTimeout((function(){n.animationTime=0,n.prevFromRect=null,n.fromRect=null,n.prevToRect=null,n.thisAnimationDuration=null}),e),n.thisAnimationDuration=e)})),clearTimeout(t),i?t=setTimeout((function(){"function"==typeof e&&e()}),r):"function"==typeof e&&e(),n=[]},animate:function(t,e,n,o){if(o){_(t,"transition",""),_(t,"transform","");var i=C(this.el),r=i&&i.a,a=i&&i.d,l=(e.left-n.left)/(r||1),s=(e.top-n.top)/(a||1);t.animatingX=!!l,t.animatingY=!!s,_(t,"transform","translate3d("+l+"px,"+s+"px,0)"),this.forRepaintDummy=function(t){return t.offsetWidth}(t),_(t,"transition","transform "+o+"ms"+(this.options.easing?" "+this.options.easing:"")),_(t,"transform","translate3d(0,0,0)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout((function(){_(t,"transition",""),_(t,"transform",""),t.animated=!1,t.animatingX=!1,t.animatingY=!1}),o)}}}}var W=[],z={initializeByDefault:!0},G={mount:function(t){for(var e in z)z.hasOwnProperty(e)&&!(e in t)&&(t[e]=z[e]);W.forEach((function(e){if(e.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")})),W.push(t)},pluginEvent:function(t,n,o){var i=this;this.eventCanceled=!1,o.cancel=function(){i.eventCanceled=!0};var r=t+"Global";W.forEach((function(i){n[i.pluginName]&&(n[i.pluginName][r]&&n[i.pluginName][r](e({sortable:n},o)),n.options[i.pluginName]&&n[i.pluginName][t]&&n[i.pluginName][t](e({sortable:n},o)))}))},initializePlugins:function(t,e,n,o){for(var r in W.forEach((function(o){var r=o.pluginName;if(t.options[r]||o.initializeByDefault){var a=new o(t,e,t.options);a.sortable=t,a.options=t.options,t[r]=a,i(n,a.defaults)}})),t.options)if(t.options.hasOwnProperty(r)){var a=this.modifyOption(t,r,t.options[r]);void 0!==a&&(t.options[r]=a)}},getEventProperties:function(t,e){var n={};return W.forEach((function(o){"function"==typeof o.eventProperties&&i(n,o.eventProperties.call(e[o.pluginName],t))})),n},modifyOption:function(t,e,n){var o;return W.forEach((function(i){t[i.pluginName]&&i.optionListeners&&"function"==typeof i.optionListeners[e]&&(o=i.optionListeners[e].call(t[i.pluginName],n))})),o}};function U(t){var n=t.sortable,o=t.rootEl,i=t.name,r=t.targetEl,a=t.cloneEl,l=t.toEl,s=t.fromEl,d=t.oldIndex,h=t.newIndex,f=t.oldDraggableIndex,p=t.newDraggableIndex,g=t.originalEvent,v=t.putSortable,m=t.extraEventProperties;if(n=n||o&&o[L]){var b,y=n.options,w="on"+i.charAt(0).toUpperCase()+i.substr(1);!window.CustomEvent||c||u?(b=document.createEvent("Event")).initEvent(i,!0,!0):b=new CustomEvent(i,{bubbles:!0,cancelable:!0}),b.to=l||o,b.from=s||o,b.item=r||o,b.clone=a,b.oldIndex=d,b.newIndex=h,b.oldDraggableIndex=f,b.newDraggableIndex=p,b.originalEvent=g,b.pullMode=v?v.lastPutMode:void 0;var E=e(e({},m),G.getEventProperties(i,n));for(var D in E)b[D]=E[D];o&&o.dispatchEvent(b),y[w]&&y[w].call(n,b)}}var q=["evt"],V=function(t,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=o.evt,a=r(o,q);G.pluginEvent.bind(Ht)(t,n,e({dragEl:$,parentEl:Q,ghostEl:J,rootEl:tt,nextEl:et,lastDownEl:nt,cloneEl:ot,cloneHidden:it,dragStarted:mt,putSortable:ut,activeSortable:Ht.active,originalEvent:i,oldIndex:rt,oldDraggableIndex:lt,newIndex:at,newDraggableIndex:st,hideGhostForTarget:Yt,unhideGhostForTarget:Bt,cloneNowHidden:function(){it=!0},cloneNowShown:function(){it=!1},dispatchSortableEvent:function(t){Z({sortable:n,name:t,originalEvent:i})}},a))};function Z(t){U(e({putSortable:ut,cloneEl:ot,targetEl:$,rootEl:tt,oldIndex:rt,oldDraggableIndex:lt,newIndex:at,newDraggableIndex:st},t))}var $,Q,J,tt,et,nt,ot,it,rt,at,lt,st,ct,ut,dt,ht,ft,pt,gt,vt,mt,bt,yt,wt,Et,Dt=!1,St=!1,_t=[],Ct=!1,Tt=!1,xt=[],Ot=!1,Mt=[],At="undefined"!=typeof document,Nt=f,It=u||c?"cssFloat":"float",Pt=At&&!p&&!f&&"draggable"in document.createElement("div"),kt=function(){if(At){if(c)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),Rt=function(t,e){var n=_(t),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=A(t,0,e),r=A(t,1,e),a=i&&_(i),l=r&&_(r),s=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+O(i).width,c=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+O(r).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&a.float&&"none"!==a.float){var u="left"===a.float?"left":"right";return!r||"both"!==l.clear&&l.clear!==u?"horizontal":"vertical"}return i&&("block"===a.display||"flex"===a.display||"table"===a.display||"grid"===a.display||s>=o&&"none"===n[It]||r&&"none"===n[It]&&s+c>o)?"vertical":"horizontal"},Xt=function(t){function e(t,n){return function(o,i,r,a){var l=o.options.group.name&&i.options.group.name&&o.options.group.name===i.options.group.name;if(null==t&&(n||l))return!0;if(null==t||!1===t)return!1;if(n&&"clone"===t)return t;if("function"==typeof t)return e(t(o,i,r,a),n)(o,i,r,a);var s=(n?o:i).options.group.name;return!0===t||"string"==typeof t&&t===s||t.join&&t.indexOf(s)>-1}}var o={},i=t.group;i&&"object"==n(i)||(i={name:i}),o.name=i.name,o.checkPull=e(i.pull,!0),o.checkPut=e(i.put),o.revertClone=i.revertClone,t.group=o},Yt=function(){!kt&&J&&_(J,"display","none")},Bt=function(){!kt&&J&&_(J,"display","")};At&&!p&&document.addEventListener("click",(function(t){if(St)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),St=!1,!1}),!0);var Ft=function(t){if($){t=t.touches?t.touches[0]:t;var e=(i=t.clientX,r=t.clientY,_t.some((function(t){var e=t[L].options.emptyInsertThreshold;if(e&&!N(t)){var n=O(t),o=i>=n.left-e&&i<=n.right+e,l=r>=n.top-e&&r<=n.bottom+e;return o&&l?a=t:void 0}})),a);if(e){var n={};for(var o in t)t.hasOwnProperty(o)&&(n[o]=t[o]);n.target=n.rootEl=e,n.preventDefault=void 0,n.stopPropagation=void 0,e[L]._onDragOver(n)}}var i,r,a},jt=function(t){$&&$.parentNode[L]._isOutsideThisEl(t.target)};function Ht(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=i({},e),t[L]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Rt(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==Ht.supportPointer&&"PointerEvent"in window&&!h,emptyInsertThreshold:5};for(var o in G.initializePlugins(this,t,n),n)!(o in e)&&(e[o]=n[o]);for(var r in Xt(e),this)"_"===r.charAt(0)&&"function"==typeof this[r]&&(this[r]=this[r].bind(this));this.nativeDraggable=!e.forceFallback&&Pt,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?v(t,"pointerdown",this._onTapStart):(v(t,"mousedown",this._onTapStart),v(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(v(t,"dragover",this),v(t,"dragenter",this)),_t.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),i(this,K())}function Lt(t,e,n,o,i,r,a,l){var s,d,h=t[L],f=h.options.onMove;return!window.CustomEvent||c||u?(s=document.createEvent("Event")).initEvent("move",!0,!0):s=new CustomEvent("move",{bubbles:!0,cancelable:!0}),s.to=e,s.from=t,s.dragged=n,s.draggedRect=o,s.related=i||e,s.relatedRect=r||O(e),s.willInsertAfter=l,s.originalEvent=a,t.dispatchEvent(s),f&&(d=f.call(h,s,a)),d}function Kt(t){t.draggable=!1}function Wt(){Ot=!1}function zt(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,o=0;n--;)o+=e.charCodeAt(n);return o.toString(36)}function Gt(t){return setTimeout(t,0)}function Ut(t){return clearTimeout(t)}Ht.prototype={constructor:Ht,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(bt=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,$):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,n=this.el,o=this.options,i=o.preventOnFilter,r=t.type,a=t.touches&&t.touches[0]||t.pointerType&&"touch"===t.pointerType&&t,l=(a||t).target,s=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||l,c=o.filter;if(function(t){Mt.length=0;var e=t.getElementsByTagName("input"),n=e.length;for(;n--;){var o=e[n];o.checked&&Mt.push(o)}}(n),!$&&!(/mousedown|pointerdown/.test(r)&&0!==t.button||o.disabled)&&!s.isContentEditable&&(this.nativeDraggable||!h||!l||"SELECT"!==l.tagName.toUpperCase())&&!((l=w(l,o.draggable,n,!1))&&l.animated||nt===l)){if(rt=I(l),lt=I(l,o.draggable),"function"==typeof c){if(c.call(this,t,l,this))return Z({sortable:e,rootEl:s,name:"filter",targetEl:l,toEl:n,fromEl:n}),V("filter",e,{evt:t}),void(i&&t.cancelable&&t.preventDefault())}else if(c&&(c=c.split(",").some((function(o){if(o=w(s,o.trim(),n,!1))return Z({sortable:e,rootEl:o,name:"filter",targetEl:l,fromEl:n,toEl:n}),V("filter",e,{evt:t}),!0}))))return void(i&&t.cancelable&&t.preventDefault());o.handle&&!w(s,o.handle,n,!1)||this._prepareDragStart(t,a,l)}}},_prepareDragStart:function(t,e,n){var o,i=this,r=i.el,a=i.options,l=r.ownerDocument;if(n&&!$&&n.parentNode===r){var s=O(n);if(tt=r,Q=($=n).parentNode,et=$.nextSibling,nt=n,ct=a.group,Ht.dragged=$,dt={target:$,clientX:(e||t).clientX,clientY:(e||t).clientY},gt=dt.clientX-s.left,vt=dt.clientY-s.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,$.style["will-change"]="all",o=function(){V("delayEnded",i,{evt:t}),Ht.eventCanceled?i._onDrop():(i._disableDelayedDragEvents(),!d&&i.nativeDraggable&&($.draggable=!0),i._triggerDragStart(t,e),Z({sortable:i,name:"choose",originalEvent:t}),S($,a.chosenClass,!0))},a.ignore.split(",").forEach((function(t){T($,t.trim(),Kt)})),v(l,"dragover",Ft),v(l,"mousemove",Ft),v(l,"touchmove",Ft),v(l,"mouseup",i._onDrop),v(l,"touchend",i._onDrop),v(l,"touchcancel",i._onDrop),d&&this.nativeDraggable&&(this.options.touchStartThreshold=4,$.draggable=!0),V("delayStart",this,{evt:t}),!a.delay||a.delayOnTouchOnly&&!e||this.nativeDraggable&&(u||c))o();else{if(Ht.eventCanceled)return void this._onDrop();v(l,"mouseup",i._disableDelayedDrag),v(l,"touchend",i._disableDelayedDrag),v(l,"touchcancel",i._disableDelayedDrag),v(l,"mousemove",i._delayedDragTouchMoveHandler),v(l,"touchmove",i._delayedDragTouchMoveHandler),a.supportPointer&&v(l,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(o,a.delay)}}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){$&&Kt($),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;m(t,"mouseup",this._disableDelayedDrag),m(t,"touchend",this._disableDelayedDrag),m(t,"touchcancel",this._disableDelayedDrag),m(t,"mousemove",this._delayedDragTouchMoveHandler),m(t,"touchmove",this._delayedDragTouchMoveHandler),m(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?v(document,"pointermove",this._onTouchMove):v(document,e?"touchmove":"mousemove",this._onTouchMove):(v($,"dragend",this),v(tt,"dragstart",this._onDragStart));try{document.selection?Gt((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(t,e){if(Dt=!1,tt&&$){V("dragStarted",this,{evt:e}),this.nativeDraggable&&v(document,"dragover",jt);var n=this.options;!t&&S($,n.dragClass,!1),S($,n.ghostClass,!0),Ht.active=this,t&&this._appendGhost(),Z({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(ht){this._lastX=ht.clientX,this._lastY=ht.clientY,Yt();for(var t=document.elementFromPoint(ht.clientX,ht.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(ht.clientX,ht.clientY))!==e;)e=t;if($.parentNode[L]._isOutsideThisEl(t),e)do{if(e[L]){if(e[L]._onDragOver({clientX:ht.clientX,clientY:ht.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break}t=e}while(e=e.parentNode);Bt()}},_onTouchMove:function(t){if(dt){var e=this.options,n=e.fallbackTolerance,o=e.fallbackOffset,i=t.touches?t.touches[0]:t,r=J&&C(J,!0),a=J&&r&&r.a,l=J&&r&&r.d,s=Nt&&Et&&P(Et),c=(i.clientX-dt.clientX+o.x)/(a||1)+(s?s[0]-xt[0]:0)/(a||1),u=(i.clientY-dt.clientY+o.y)/(l||1)+(s?s[1]-xt[1]:0)/(l||1);if(!Ht.active&&!Dt){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<n)return;this._onDragStart(t,!0)}if(J){r?(r.e+=c-(ft||0),r.f+=u-(pt||0)):r={a:1,b:0,c:0,d:1,e:c,f:u};var d="matrix(".concat(r.a,",").concat(r.b,",").concat(r.c,",").concat(r.d,",").concat(r.e,",").concat(r.f,")");_(J,"webkitTransform",d),_(J,"mozTransform",d),_(J,"msTransform",d),_(J,"transform",d),ft=c,pt=u,ht=i}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!J){var t=this.options.fallbackOnBody?document.body:tt,e=O($,!0,Nt,!0,t),n=this.options;if(Nt){for(Et=t;"static"===_(Et,"position")&&"none"===_(Et,"transform")&&Et!==document;)Et=Et.parentNode;Et!==document.body&&Et!==document.documentElement?(Et===document&&(Et=x()),e.top+=Et.scrollTop,e.left+=Et.scrollLeft):Et=x(),xt=P(Et)}S(J=$.cloneNode(!0),n.ghostClass,!1),S(J,n.fallbackClass,!0),S(J,n.dragClass,!0),_(J,"transition",""),_(J,"transform",""),_(J,"box-sizing","border-box"),_(J,"margin",0),_(J,"top",e.top),_(J,"left",e.left),_(J,"width",e.width),_(J,"height",e.height),_(J,"opacity","0.8"),_(J,"position",Nt?"absolute":"fixed"),_(J,"zIndex","100000"),_(J,"pointerEvents","none"),Ht.ghost=J,t.appendChild(J),_(J,"transform-origin",gt/parseInt(J.style.width)*100+"% "+vt/parseInt(J.style.height)*100+"%")}},_onDragStart:function(t,e){var n=this,o=t.dataTransfer,i=n.options;V("dragStart",this,{evt:t}),Ht.eventCanceled?this._onDrop():(V("setupClone",this),Ht.eventCanceled||((ot=B($)).removeAttribute("id"),ot.draggable=!1,ot.style["will-change"]="",this._hideClone(),S(ot,this.options.chosenClass,!1),Ht.clone=ot),n.cloneId=Gt((function(){V("clone",n),Ht.eventCanceled||(n.options.removeCloneOnHide||tt.insertBefore(ot,$),n._hideClone(),Z({sortable:n,name:"clone"}))})),!e&&S($,i.dragClass,!0),e?(St=!0,n._loopId=setInterval(n._emulateDragOver,50)):(m(document,"mouseup",n._onDrop),m(document,"touchend",n._onDrop),m(document,"touchcancel",n._onDrop),o&&(o.effectAllowed="move",i.setData&&i.setData.call(n,o,$)),v(document,"drop",n),_($,"transform","translateZ(0)")),Dt=!0,n._dragStartId=Gt(n._dragStarted.bind(n,e,t)),v(document,"selectstart",n),mt=!0,h&&_(document.body,"user-select","none"))},_onDragOver:function(t){var n,o,i,r,a=this.el,l=t.target,s=this.options,c=s.group,u=Ht.active,d=ct===c,h=s.sort,f=ut||u,p=this,g=!1;if(!Ot){if(void 0!==t.preventDefault&&t.cancelable&&t.preventDefault(),l=w(l,s.draggable,a,!0),F("dragOver"),Ht.eventCanceled)return g;if($.contains(t.target)||l.animated&&l.animatingX&&l.animatingY||p._ignoreWhileAnimating===l)return K(!1);if(St=!1,u&&!s.disabled&&(d?h||(i=Q!==tt):ut===this||(this.lastPutMode=ct.checkPull(this,u,$,t))&&c.checkPut(this,u,$,t))){if(r="vertical"===this._getDirection(t,l),n=O($),F("dragOverValid"),Ht.eventCanceled)return g;if(i)return Q=tt,j(),this._hideClone(),F("revert"),Ht.eventCanceled||(et?tt.insertBefore($,et):tt.appendChild($)),K(!0);var v=N(a,s.draggable);if(!v||function(t,e,n){var o=O(N(n.el,n.options.draggable)),i=H(n.el,n.options,J),r=10;return e?t.clientX>i.right+r||t.clientY>o.bottom&&t.clientX>o.left:t.clientY>i.bottom+r||t.clientX>o.right&&t.clientY>o.top}(t,r,this)&&!v.animated){if(v===$)return K(!1);if(v&&a===t.target&&(l=v),l&&(o=O(l)),!1!==Lt(tt,a,$,n,l,o,t,!!l))return j(),v&&v.nextSibling?a.insertBefore($,v.nextSibling):a.appendChild($),Q=a,W(),K(!0)}else if(v&&function(t,e,n){var o=O(A(n.el,0,n.options,!0)),i=H(n.el,n.options,J),r=10;return e?t.clientX<i.left-r||t.clientY<o.top&&t.clientX<o.right:t.clientY<i.top-r||t.clientY<o.bottom&&t.clientX<o.left}(t,r,this)){var m=A(a,0,s,!0);if(m===$)return K(!1);if(o=O(l=m),!1!==Lt(tt,a,$,n,l,o,t,!1))return j(),a.insertBefore($,m),Q=a,W(),K(!0)}else if(l.parentNode===a){o=O(l);var b,y,E,D=$.parentNode!==a,C=!function(t,e,n){var o=n?t.left:t.top,i=n?t.right:t.bottom,r=n?t.width:t.height,a=n?e.left:e.top,l=n?e.right:e.bottom,s=n?e.width:e.height;return o===a||i===l||o+r/2===a+s/2}($.animated&&$.toRect||n,l.animated&&l.toRect||o,r),T=r?"top":"left",x=M(l,"top","top")||M($,"top","top"),P=x?x.scrollTop:void 0;if(bt!==l&&(y=o[T],Ct=!1,Tt=!C&&s.invertSwap||D),b=function(t,e,n,o,i,r,a,l){var s=o?t.clientY:t.clientX,c=o?n.height:n.width,u=o?n.top:n.left,d=o?n.bottom:n.right,h=!1;if(!a)if(l&&wt<c*i){if(!Ct&&(1===yt?s>u+c*r/2:s<d-c*r/2)&&(Ct=!0),Ct)h=!0;else if(1===yt?s<u+wt:s>d-wt)return-yt}else if(s>u+c*(1-i)/2&&s<d-c*(1-i)/2)return function(t){return I($)<I(t)?1:-1}(e);if((h=h||a)&&(s<u+c*r/2||s>d-c*r/2))return s>u+c/2?1:-1;return 0}(t,l,o,r,C?1:s.swapThreshold,null==s.invertedSwapThreshold?s.swapThreshold:s.invertedSwapThreshold,Tt,bt===l),0!==b){var k=I($);do{k-=b,E=Q.children[k]}while(E&&("none"===_(E,"display")||E===J))}if(0===b||E===l)return K(!1);bt=l,yt=b;var R=l.nextElementSibling,X=!1,B=Lt(tt,a,$,n,l,o,t,X=1===b);if(!1!==B)return 1!==B&&-1!==B||(X=1===B),Ot=!0,setTimeout(Wt,30),j(),X&&!R?a.appendChild($):l.parentNode.insertBefore($,X?R:l),x&&Y(x,0,P-x.scrollTop),Q=$.parentNode,void 0===y||Tt||(wt=Math.abs(y-O(l)[T])),W(),K(!0)}if(a.contains($))return K(!1)}return!1}function F(s,c){V(s,p,e({evt:t,isOwner:d,axis:r?"vertical":"horizontal",revert:i,dragRect:n,targetRect:o,canSort:h,fromSortable:f,target:l,completed:K,onMove:function(e,o){return Lt(tt,a,$,n,e,O(e),t,o)},changed:W},c))}function j(){F("dragOverAnimationCapture"),p.captureAnimationState(),p!==f&&f.captureAnimationState()}function K(e){return F("dragOverCompleted",{insertion:e}),e&&(d?u._hideClone():u._showClone(p),p!==f&&(S($,ut?ut.options.ghostClass:u.options.ghostClass,!1),S($,s.ghostClass,!0)),ut!==p&&p!==Ht.active?ut=p:p===Ht.active&&ut&&(ut=null),f===p&&(p._ignoreWhileAnimating=l),p.animateAll((function(){F("dragOverAnimationComplete"),p._ignoreWhileAnimating=null})),p!==f&&(f.animateAll(),f._ignoreWhileAnimating=null)),(l===$&&!$.animated||l===a&&!l.animated)&&(bt=null),s.dragoverBubble||t.rootEl||l===document||($.parentNode[L]._isOutsideThisEl(t.target),!e&&Ft(t)),!s.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),g=!0}function W(){at=I($),st=I($,s.draggable),Z({sortable:p,name:"change",toEl:a,newIndex:at,newDraggableIndex:st,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){m(document,"mousemove",this._onTouchMove),m(document,"touchmove",this._onTouchMove),m(document,"pointermove",this._onTouchMove),m(document,"dragover",Ft),m(document,"mousemove",Ft),m(document,"touchmove",Ft)},_offUpEvents:function(){var t=this.el.ownerDocument;m(t,"mouseup",this._onDrop),m(t,"touchend",this._onDrop),m(t,"pointerup",this._onDrop),m(t,"touchcancel",this._onDrop),m(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;at=I($),st=I($,n.draggable),V("drop",this,{evt:t}),Q=$&&$.parentNode,at=I($),st=I($,n.draggable),Ht.eventCanceled||(Dt=!1,Tt=!1,Ct=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Ut(this.cloneId),Ut(this._dragStartId),this.nativeDraggable&&(m(document,"drop",this),m(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),h&&_(document.body,"user-select",""),_($,"transform",""),t&&(mt&&(t.cancelable&&t.preventDefault(),!n.dropBubble&&t.stopPropagation()),J&&J.parentNode&&J.parentNode.removeChild(J),(tt===Q||ut&&"clone"!==ut.lastPutMode)&&ot&&ot.parentNode&&ot.parentNode.removeChild(ot),$&&(this.nativeDraggable&&m($,"dragend",this),Kt($),$.style["will-change"]="",mt&&!Dt&&S($,ut?ut.options.ghostClass:this.options.ghostClass,!1),S($,this.options.chosenClass,!1),Z({sortable:this,name:"unchoose",toEl:Q,newIndex:null,newDraggableIndex:null,originalEvent:t}),tt!==Q?(at>=0&&(Z({rootEl:Q,name:"add",toEl:Q,fromEl:tt,originalEvent:t}),Z({sortable:this,name:"remove",toEl:Q,originalEvent:t}),Z({rootEl:Q,name:"sort",toEl:Q,fromEl:tt,originalEvent:t}),Z({sortable:this,name:"sort",toEl:Q,originalEvent:t})),ut&&ut.save()):at!==rt&&at>=0&&(Z({sortable:this,name:"update",toEl:Q,originalEvent:t}),Z({sortable:this,name:"sort",toEl:Q,originalEvent:t})),Ht.active&&(null!=at&&-1!==at||(at=rt,st=lt),Z({sortable:this,name:"end",toEl:Q,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){V("nulling",this),tt=$=Q=J=et=ot=nt=it=dt=ht=mt=at=st=rt=lt=bt=yt=ut=ct=Ht.dragged=Ht.ghost=Ht.clone=Ht.active=null,Mt.forEach((function(t){t.checked=!0})),Mt.length=ft=pt=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":$&&(this._onDragOver(t),function(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move");t.cancelable&&t.preventDefault()}(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t,e=[],n=this.el.children,o=0,i=n.length,r=this.options;o<i;o++)w(t=n[o],r.draggable,this.el,!1)&&e.push(t.getAttribute(r.dataIdAttr)||zt(t));return e},sort:function(t,e){var n={},o=this.el;this.toArray().forEach((function(t,e){var i=o.children[e];w(i,this.options.draggable,o,!1)&&(n[t]=i)}),this),e&&this.captureAnimationState(),t.forEach((function(t){n[t]&&(o.removeChild(n[t]),o.appendChild(n[t]))})),e&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,e){return w(t,e||this.options.draggable,this.el,!1)},option:function(t,e){var n=this.options;if(void 0===e)return n[t];var o=G.modifyOption(this,t,e);n[t]=void 0!==o?o:e,"group"===t&&Xt(n)},destroy:function(){V("destroy",this);var t=this.el;t[L]=null,m(t,"mousedown",this._onTapStart),m(t,"touchstart",this._onTapStart),m(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(m(t,"dragover",this),m(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),(function(t){t.removeAttribute("draggable")})),this._onDrop(),this._disableDelayedDragEvents(),_t.splice(_t.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!it){if(V("hideClone",this),Ht.eventCanceled)return;_(ot,"display","none"),this.options.removeCloneOnHide&&ot.parentNode&&ot.parentNode.removeChild(ot),it=!0}},_showClone:function(t){if("clone"===t.lastPutMode){if(it){if(V("showClone",this),Ht.eventCanceled)return;$.parentNode!=tt||this.options.group.revertClone?et?tt.insertBefore(ot,et):tt.appendChild(ot):tt.insertBefore(ot,$),this.options.group.revertClone&&this.animate($,ot),_(ot,"display",""),it=!1}}else this._hideClone()}},At&&v(document,"touchmove",(function(t){(Ht.active||Dt)&&t.cancelable&&t.preventDefault()})),Ht.utils={on:v,off:m,css:_,find:T,is:function(t,e){return!!w(t,e,t,!1)},extend:function(t,e){if(t&&e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t},throttle:X,closest:w,toggleClass:S,clone:B,index:I,nextTick:Gt,cancelNextTick:Ut,detectDirection:Rt,getChild:A},Ht.get=function(t){return t[L]},Ht.mount=function(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];n[0].constructor===Array&&(n=n[0]),n.forEach((function(t){if(!t.prototype||!t.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(t));t.utils&&(Ht.utils=e(e({},Ht.utils),t.utils)),G.mount(t)}))},Ht.create=function(t,e){return new Ht(t,e)},Ht.version="1.15.2";var qt,Vt,Zt,$t,Qt,Jt,te=[],ee=!1;function ne(){te.forEach((function(t){clearInterval(t.pid)})),te=[]}function oe(){clearInterval(Jt)}var ie,re=X((function(t,e,n,o){if(e.scroll){var i,r=(t.touches?t.touches[0]:t).clientX,a=(t.touches?t.touches[0]:t).clientY,l=e.scrollSensitivity,s=e.scrollSpeed,c=x(),u=!1;Vt!==n&&(Vt=n,ne(),qt=e.scroll,i=e.scrollFn,!0===qt&&(qt=k(n,!0)));var d=0,h=qt;do{var f=h,p=O(f),g=p.top,v=p.bottom,m=p.left,b=p.right,y=p.width,w=p.height,E=void 0,D=void 0,S=f.scrollWidth,C=f.scrollHeight,T=_(f),M=f.scrollLeft,A=f.scrollTop;f===c?(E=y<S&&("auto"===T.overflowX||"scroll"===T.overflowX||"visible"===T.overflowX),D=w<C&&("auto"===T.overflowY||"scroll"===T.overflowY||"visible"===T.overflowY)):(E=y<S&&("auto"===T.overflowX||"scroll"===T.overflowX),D=w<C&&("auto"===T.overflowY||"scroll"===T.overflowY));var N=E&&(Math.abs(b-r)<=l&&M+y<S)-(Math.abs(m-r)<=l&&!!M),I=D&&(Math.abs(v-a)<=l&&A+w<C)-(Math.abs(g-a)<=l&&!!A);if(!te[d])for(var P=0;P<=d;P++)te[P]||(te[P]={});te[d].vx==N&&te[d].vy==I&&te[d].el===f||(te[d].el=f,te[d].vx=N,te[d].vy=I,clearInterval(te[d].pid),0==N&&0==I||(u=!0,te[d].pid=setInterval(function(){o&&0===this.layer&&Ht.active._onTouchMove(Qt);var e=te[this.layer].vy?te[this.layer].vy*s:0,n=te[this.layer].vx?te[this.layer].vx*s:0;"function"==typeof i&&"continue"!==i.call(Ht.dragged.parentNode[L],n,e,t,Qt,te[this.layer].el)||Y(te[this.layer].el,n,e)}.bind({layer:d}),24))),d++}while(e.bubbleScroll&&h!==c&&(h=k(h,!1)));ee=u}}),30),ae=function(t){var e=t.originalEvent,n=t.putSortable,o=t.dragEl,i=t.activeSortable,r=t.dispatchSortableEvent,a=t.hideGhostForTarget,l=t.unhideGhostForTarget;if(e){var s=n||i;a();var c=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e,u=document.elementFromPoint(c.clientX,c.clientY);l(),s&&!s.el.contains(u)&&(r("spill"),this.onSpill({dragEl:o,putSortable:n}))}};function le(){}function se(){}function ce(){function t(){this.defaults={swapClass:"sortable-swap-highlight"}}return t.prototype={dragStart:function(t){var e=t.dragEl;ie=e},dragOverValid:function(t){var e=t.completed,n=t.target,o=t.onMove,i=t.activeSortable,r=t.changed,a=t.cancel;if(i.options.swap){var l=this.sortable.el,s=this.options;if(n&&n!==l){var c=ie;!1!==o(n)?(S(n,s.swapClass,!0),ie=n):ie=null,c&&c!==ie&&S(c,s.swapClass,!1)}r(),e(!0),a()}},drop:function(t){var e=t.activeSortable,n=t.putSortable,o=t.dragEl,i=n||this.sortable,r=this.options;ie&&S(ie,r.swapClass,!1),ie&&(r.swap||n&&n.options.swap)&&o!==ie&&(i.captureAnimationState(),i!==e&&e.captureAnimationState(),function(t,e){var n,o,i=t.parentNode,r=e.parentNode;if(!i||!r||i.isEqualNode(e)||r.isEqualNode(t))return;n=I(t),o=I(e),i.isEqualNode(r)&&n<o&&o++;i.insertBefore(e,i.children[n]),r.insertBefore(t,r.children[o])}(o,ie),i.animateAll(),i!==e&&e.animateAll())},nulling:function(){ie=null}},i(t,{pluginName:"swap",eventProperties:function(){return{swapItem:ie}}})}le.prototype={startIndex:null,dragStart:function(t){var e=t.oldDraggableIndex;this.startIndex=e},onSpill:function(t){var e=t.dragEl,n=t.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var o=A(this.sortable.el,this.startIndex,this.options);o?this.sortable.el.insertBefore(e,o):this.sortable.el.appendChild(e),this.sortable.animateAll(),n&&n.animateAll()},drop:ae},i(le,{pluginName:"revertOnSpill"}),se.prototype={onSpill:function(t){var e=t.dragEl,n=t.putSortable||this.sortable;n.captureAnimationState(),e.parentNode&&e.parentNode.removeChild(e),n.animateAll()},drop:ae},i(se,{pluginName:"removeOnSpill"});var ue,de,he,fe,pe,ge=[],ve=[],me=!1,be=!1,ye=!1;function we(){function t(t){for(var e in this)"_"===e.charAt(0)&&"function"==typeof this[e]&&(this[e]=this[e].bind(this));t.options.avoidImplicitDeselect||(t.options.supportPointer?v(document,"pointerup",this._deselectMultiDrag):(v(document,"mouseup",this._deselectMultiDrag),v(document,"touchend",this._deselectMultiDrag))),v(document,"keydown",this._checkKeyDown),v(document,"keyup",this._checkKeyUp),this.defaults={selectedClass:"sortable-selected",multiDragKey:null,avoidImplicitDeselect:!1,setData:function(e,n){var o="";ge.length&&de===t?ge.forEach((function(t,e){o+=(e?", ":"")+t.textContent})):o=n.textContent,e.setData("Text",o)}}}return t.prototype={multiDragKeyDown:!1,isMultiDrag:!1,delayStartGlobal:function(t){var e=t.dragEl;he=e},delayEnded:function(){this.isMultiDrag=~ge.indexOf(he)},setupClone:function(t){var e=t.sortable,n=t.cancel;if(this.isMultiDrag){for(var o=0;o<ge.length;o++)ve.push(B(ge[o])),ve[o].sortableIndex=ge[o].sortableIndex,ve[o].draggable=!1,ve[o].style["will-change"]="",S(ve[o],this.options.selectedClass,!1),ge[o]===he&&S(ve[o],this.options.chosenClass,!1);e._hideClone(),n()}},clone:function(t){var e=t.sortable,n=t.rootEl,o=t.dispatchSortableEvent,i=t.cancel;this.isMultiDrag&&(this.options.removeCloneOnHide||ge.length&&de===e&&(Ee(!0,n),o("clone"),i()))},showClone:function(t){var e=t.cloneNowShown,n=t.rootEl,o=t.cancel;this.isMultiDrag&&(Ee(!1,n),ve.forEach((function(t){_(t,"display","")})),e(),pe=!1,o())},hideClone:function(t){var e=this;t.sortable;var n=t.cloneNowHidden,o=t.cancel;this.isMultiDrag&&(ve.forEach((function(t){_(t,"display","none"),e.options.removeCloneOnHide&&t.parentNode&&t.parentNode.removeChild(t)})),n(),pe=!0,o())},dragStartGlobal:function(t){t.sortable,!this.isMultiDrag&&de&&de.multiDrag._deselectMultiDrag(),ge.forEach((function(t){t.sortableIndex=I(t)})),ge=ge.sort((function(t,e){return t.sortableIndex-e.sortableIndex})),ye=!0},dragStarted:function(t){var e=this,n=t.sortable;if(this.isMultiDrag){if(this.options.sort&&(n.captureAnimationState(),this.options.animation)){ge.forEach((function(t){t!==he&&_(t,"position","absolute")}));var o=O(he,!1,!0,!0);ge.forEach((function(t){t!==he&&F(t,o)})),be=!0,me=!0}n.animateAll((function(){be=!1,me=!1,e.options.animation&&ge.forEach((function(t){j(t)})),e.options.sort&&De()}))}},dragOver:function(t){var e=t.target,n=t.completed,o=t.cancel;be&&~ge.indexOf(e)&&(n(!1),o())},revert:function(t){var e=t.fromSortable,n=t.rootEl,o=t.sortable,i=t.dragRect;ge.length>1&&(ge.forEach((function(t){o.addAnimationState({target:t,rect:be?O(t):i}),j(t),t.fromRect=i,e.removeAnimationState(t)})),be=!1,function(t,e){ge.forEach((function(n,o){var i=e.children[n.sortableIndex+(t?Number(o):0)];i?e.insertBefore(n,i):e.appendChild(n)}))}(!this.options.removeCloneOnHide,n))},dragOverCompleted:function(t){var e=t.sortable,n=t.isOwner,o=t.insertion,i=t.activeSortable,r=t.parentEl,a=t.putSortable,l=this.options;if(o){if(n&&i._hideClone(),me=!1,l.animation&&ge.length>1&&(be||!n&&!i.options.sort&&!a)){var s=O(he,!1,!0,!0);ge.forEach((function(t){t!==he&&(F(t,s),r.appendChild(t))})),be=!0}if(!n)if(be||De(),ge.length>1){var c=pe;i._showClone(e),i.options.animation&&!pe&&c&&ve.forEach((function(t){i.addAnimationState({target:t,rect:fe}),t.fromRect=fe,t.thisAnimationDuration=null}))}else i._showClone(e)}},dragOverAnimationCapture:function(t){var e=t.dragRect,n=t.isOwner,o=t.activeSortable;if(ge.forEach((function(t){t.thisAnimationDuration=null})),o.options.animation&&!n&&o.multiDrag.isMultiDrag){fe=i({},e);var r=C(he,!0);fe.top-=r.f,fe.left-=r.e}},dragOverAnimationComplete:function(){be&&(be=!1,De())},drop:function(t){var e=t.originalEvent,n=t.rootEl,o=t.parentEl,i=t.sortable,r=t.dispatchSortableEvent,a=t.oldIndex,l=t.putSortable,s=l||this.sortable;if(e){var c=this.options,u=o.children;if(!ye)if(c.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),S(he,c.selectedClass,!~ge.indexOf(he)),~ge.indexOf(he))ge.splice(ge.indexOf(he),1),ue=null,U({sortable:i,rootEl:n,name:"deselect",targetEl:he,originalEvent:e});else{if(ge.push(he),U({sortable:i,rootEl:n,name:"select",targetEl:he,originalEvent:e}),e.shiftKey&&ue&&i.el.contains(ue)){var d,h,f=I(ue),p=I(he);if(~f&&~p&&f!==p)for(p>f?(h=f,d=p):(h=p,d=f+1);h<d;h++)~ge.indexOf(u[h])||(S(u[h],c.selectedClass,!0),ge.push(u[h]),U({sortable:i,rootEl:n,name:"select",targetEl:u[h],originalEvent:e}))}else ue=he;de=s}if(ye&&this.isMultiDrag){if(be=!1,(o[L].options.sort||o!==n)&&ge.length>1){var g=O(he),v=I(he,":not(."+this.options.selectedClass+")");if(!me&&c.animation&&(he.thisAnimationDuration=null),s.captureAnimationState(),!me&&(c.animation&&(he.fromRect=g,ge.forEach((function(t){if(t.thisAnimationDuration=null,t!==he){var e=be?O(t):g;t.fromRect=e,s.addAnimationState({target:t,rect:e})}}))),De(),ge.forEach((function(t){u[v]?o.insertBefore(t,u[v]):o.appendChild(t),v++})),a===I(he))){var m=!1;ge.forEach((function(t){t.sortableIndex===I(t)||(m=!0)})),m&&(r("update"),r("sort"))}ge.forEach((function(t){j(t)})),s.animateAll()}de=s}(n===o||l&&"clone"!==l.lastPutMode)&&ve.forEach((function(t){t.parentNode&&t.parentNode.removeChild(t)}))}},nullingGlobal:function(){this.isMultiDrag=ye=!1,ve.length=0},destroyGlobal:function(){this._deselectMultiDrag(),m(document,"pointerup",this._deselectMultiDrag),m(document,"mouseup",this._deselectMultiDrag),m(document,"touchend",this._deselectMultiDrag),m(document,"keydown",this._checkKeyDown),m(document,"keyup",this._checkKeyUp)},_deselectMultiDrag:function(t){if(!(void 0!==ye&&ye||de!==this.sortable||t&&w(t.target,this.options.draggable,this.sortable.el,!1)||t&&0!==t.button))for(;ge.length;){var e=ge[0];S(e,this.options.selectedClass,!1),ge.shift(),U({sortable:this.sortable,rootEl:this.sortable.el,name:"deselect",targetEl:e,originalEvent:t})}},_checkKeyDown:function(t){t.key===this.options.multiDragKey&&(this.multiDragKeyDown=!0)},_checkKeyUp:function(t){t.key===this.options.multiDragKey&&(this.multiDragKeyDown=!1)}},i(t,{pluginName:"multiDrag",utils:{select:function(t){var e=t.parentNode[L];e&&e.options.multiDrag&&!~ge.indexOf(t)&&(de&&de!==e&&(de.multiDrag._deselectMultiDrag(),de=e),S(t,e.options.selectedClass,!0),ge.push(t))},deselect:function(t){var e=t.parentNode[L],n=ge.indexOf(t);e&&e.options.multiDrag&&~n&&(S(t,e.options.selectedClass,!1),ge.splice(n,1))}},eventProperties:function(){var t=this,e=[],n=[];return ge.forEach((function(o){var i;e.push({multiDragElement:o,index:o.sortableIndex}),i=be&&o!==he?-1:be?I(o,":not(."+t.options.selectedClass+")"):I(o),n.push({multiDragElement:o,index:i})})),{items:a(ge),clones:[].concat(ve),oldIndicies:e,newIndicies:n}},optionListeners:{multiDragKey:function(t){return"ctrl"===(t=t.toLowerCase())?t="Control":t.length>1&&(t=t.charAt(0).toUpperCase()+t.substr(1)),t}}})}function Ee(t,e){ve.forEach((function(n,o){var i=e.children[n.sortableIndex+(t?Number(o):0)];i?e.insertBefore(n,i):e.appendChild(n)}))}function De(){ge.forEach((function(t){t!==he&&t.parentNode&&t.parentNode.removeChild(t)}))}Ht.mount(new function(){function t(){for(var t in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)"_"===t.charAt(0)&&"function"==typeof this[t]&&(this[t]=this[t].bind(this))}return t.prototype={dragStarted:function(t){var e=t.originalEvent;this.sortable.nativeDraggable?v(document,"dragover",this._handleAutoScroll):this.options.supportPointer?v(document,"pointermove",this._handleFallbackAutoScroll):e.touches?v(document,"touchmove",this._handleFallbackAutoScroll):v(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){var e=t.originalEvent;this.options.dragOverBubble||e.rootEl||this._handleAutoScroll(e)},drop:function(){this.sortable.nativeDraggable?m(document,"dragover",this._handleAutoScroll):(m(document,"pointermove",this._handleFallbackAutoScroll),m(document,"touchmove",this._handleFallbackAutoScroll),m(document,"mousemove",this._handleFallbackAutoScroll)),oe(),ne(),clearTimeout(E),E=void 0},nulling:function(){Qt=Vt=qt=ee=Jt=Zt=$t=null,te.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(t,e){var n=this,o=(t.touches?t.touches[0]:t).clientX,i=(t.touches?t.touches[0]:t).clientY,r=document.elementFromPoint(o,i);if(Qt=t,e||this.options.forceAutoScrollFallback||u||c||h){re(t,this.options,r,e);var a=k(r,!0);!ee||Jt&&o===Zt&&i===$t||(Jt&&oe(),Jt=setInterval((function(){var r=k(document.elementFromPoint(o,i),!0);r!==a&&(a=r,ne()),re(t,n.options,r,e)}),10),Zt=o,$t=i)}else{if(!this.options.bubbleScroll||k(r,!0)===x())return void ne();re(t,this.options,k(r,!1),!1)}}},i(t,{pluginName:"scroll",initializeByDefault:!0})}),Ht.mount(se,le);export{we as MultiDrag,Ht as Sortable,ce as Swap,Ht as default};
|
7
|
+
function t(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function e(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?t(Object(i),!0).forEach((function(t){o(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(){return i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},i.apply(this,arguments)}function r(t,e){if(null==t)return{};var n,o,i=function(t,e){if(null==t)return{};var n,o,i={},r=Object.keys(t);for(o=0;o<r.length;o++)n=r[o],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(o=0;o<r.length;o++)n=r[o],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function a(t){return function(t){if(Array.isArray(t))return l(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return l(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}function s(t){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(t)}var c=s(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),u=s(/Edge/i),d=s(/firefox/i),h=s(/safari/i)&&!s(/chrome/i)&&!s(/android/i),f=s(/iP(ad|od|hone)/i),p=s(/chrome/i)&&s(/android/i),g={capture:!1,passive:!1};function v(t,e,n){t.addEventListener(e,n,!c&&g)}function m(t,e,n){t.removeEventListener(e,n,!c&&g)}function b(t,e){if(e){if(">"===e[0]&&(e=e.substring(1)),t)try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){return!1}return!1}}function y(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function w(t,e,n,o){if(t){n=n||document;do{if(null!=e&&(">"===e[0]?t.parentNode===n&&b(t,e):b(t,e))||o&&t===n)return t;if(t===n)break}while(t=y(t))}return null}var E,D=/\s+/g;function S(t,e,n){if(t&&e)if(t.classList)t.classList[n?"add":"remove"](e);else{var o=(" "+t.className+" ").replace(D," ").replace(" "+e+" "," ");t.className=(o+(n?" "+e:"")).replace(D," ")}}function _(t,e,n){var o=t&&t.style;if(o){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];e in o||-1!==e.indexOf("webkit")||(e="-webkit-"+e),o[e]=n+("string"==typeof n?"":"px")}}function C(t,e){var n="";if("string"==typeof t)n=t;else do{var o=_(t,"transform");o&&"none"!==o&&(n=o+" "+n)}while(!e&&(t=t.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function T(t,e,n){if(t){var o=t.getElementsByTagName(e),i=0,r=o.length;if(n)for(;i<r;i++)n(o[i],i);return o}return[]}function x(){var t=document.scrollingElement;return t||document.documentElement}function O(t,e,n,o,i){if(t.getBoundingClientRect||t===window){var r,a,l,s,u,d,h;if(t!==window&&t.parentNode&&t!==x()?(a=(r=t.getBoundingClientRect()).top,l=r.left,s=r.bottom,u=r.right,d=r.height,h=r.width):(a=0,l=0,s=window.innerHeight,u=window.innerWidth,d=window.innerHeight,h=window.innerWidth),(e||n)&&t!==window&&(i=i||t.parentNode,!c))do{if(i&&i.getBoundingClientRect&&("none"!==_(i,"transform")||n&&"static"!==_(i,"position"))){var f=i.getBoundingClientRect();a-=f.top+parseInt(_(i,"border-top-width")),l-=f.left+parseInt(_(i,"border-left-width")),s=a+r.height,u=l+r.width;break}}while(i=i.parentNode);if(o&&t!==window){var p=C(i||t),g=p&&p.a,v=p&&p.d;p&&(s=(a/=v)+(d/=v),u=(l/=g)+(h/=g))}return{top:a,left:l,bottom:s,right:u,width:h,height:d}}}function M(t,e,n){for(var o=k(t,!0),i=O(t)[e];o;){if(!(i>=O(o)[n]))return o;if(o===x())break;o=k(o,!1)}return!1}function A(t,e,n,o){for(var i=0,r=0,a=t.children;r<a.length;){if("none"!==a[r].style.display&&a[r]!==Ht.ghost&&(o||a[r]!==Ht.dragged)&&w(a[r],n.draggable,t,!1)){if(i===e)return a[r];i++}r++}return null}function N(t,e){for(var n=t.lastElementChild;n&&(n===Ht.ghost||"none"===_(n,"display")||e&&!b(n,e));)n=n.previousElementSibling;return n||null}function I(t,e){var n=0;if(!t||!t.parentNode)return-1;for(;t=t.previousElementSibling;)"TEMPLATE"===t.nodeName.toUpperCase()||t===Ht.clone||e&&!b(t,e)||n++;return n}function P(t){var e=0,n=0,o=x();if(t)do{var i=C(t),r=i.a,a=i.d;e+=t.scrollLeft*r,n+=t.scrollTop*a}while(t!==o&&(t=t.parentNode));return[e,n]}function k(t,e){if(!t||!t.getBoundingClientRect)return x();var n=t,o=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=_(n);if(n.clientWidth<n.scrollWidth&&("auto"==i.overflowX||"scroll"==i.overflowX)||n.clientHeight<n.scrollHeight&&("auto"==i.overflowY||"scroll"==i.overflowY)){if(!n.getBoundingClientRect||n===document.body)return x();if(o||e)return n;o=!0}}}while(n=n.parentNode);return x()}function R(t,e){return Math.round(t.top)===Math.round(e.top)&&Math.round(t.left)===Math.round(e.left)&&Math.round(t.height)===Math.round(e.height)&&Math.round(t.width)===Math.round(e.width)}function X(t,e){return function(){if(!E){var n=arguments;1===n.length?t.call(this,n[0]):t.apply(this,n),E=setTimeout((function(){E=void 0}),e)}}}function Y(t,e,n){t.scrollLeft+=e,t.scrollTop+=n}function B(t){var e=window.Polymer,n=window.jQuery||window.Zepto;return e&&e.dom?e.dom(t).cloneNode(!0):n?n(t).clone(!0)[0]:t.cloneNode(!0)}function F(t,e){_(t,"position","absolute"),_(t,"top",e.top),_(t,"left",e.left),_(t,"width",e.width),_(t,"height",e.height)}function j(t){_(t,"position",""),_(t,"top",""),_(t,"left",""),_(t,"width",""),_(t,"height","")}function H(t,e,n){var o={};return Array.from(t.children).forEach((function(i){var r,a,l,s;if(w(i,e.draggable,t,!1)&&!i.animated&&i!==n){var c=O(i);o.left=Math.min(null!==(r=o.left)&&void 0!==r?r:1/0,c.left),o.top=Math.min(null!==(a=o.top)&&void 0!==a?a:1/0,c.top),o.right=Math.max(null!==(l=o.right)&&void 0!==l?l:-1/0,c.right),o.bottom=Math.max(null!==(s=o.bottom)&&void 0!==s?s:-1/0,c.bottom)}})),o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}var L="Sortable"+(new Date).getTime();function K(){var t,n=[];return{captureAnimationState:function(){(n=[],this.options.animation)&&[].slice.call(this.el.children).forEach((function(t){if("none"!==_(t,"display")&&t!==Ht.ghost){n.push({target:t,rect:O(t)});var o=e({},n[n.length-1].rect);if(t.thisAnimationDuration){var i=C(t,!0);i&&(o.top-=i.f,o.left-=i.e)}t.fromRect=o}}))},addAnimationState:function(t){n.push(t)},removeAnimationState:function(t){n.splice(function(t,e){for(var n in t)if(t.hasOwnProperty(n))for(var o in e)if(e.hasOwnProperty(o)&&e[o]===t[n][o])return Number(n);return-1}(n,{target:t}),1)},animateAll:function(e){var o=this;if(!this.options.animation)return clearTimeout(t),void("function"==typeof e&&e());var i=!1,r=0;n.forEach((function(t){var e=0,n=t.target,a=n.fromRect,l=O(n),s=n.prevFromRect,c=n.prevToRect,u=t.rect,d=C(n,!0);d&&(l.top-=d.f,l.left-=d.e),n.toRect=l,n.thisAnimationDuration&&R(s,l)&&!R(a,l)&&(u.top-l.top)/(u.left-l.left)==(a.top-l.top)/(a.left-l.left)&&(e=function(t,e,n,o){return Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))/Math.sqrt(Math.pow(e.top-n.top,2)+Math.pow(e.left-n.left,2))*o.animation}(u,s,c,o.options)),R(l,a)||(n.prevFromRect=a,n.prevToRect=l,e||(e=o.options.animation),o.animate(n,u,l,e)),e&&(i=!0,r=Math.max(r,e),clearTimeout(n.animationResetTimer),n.animationResetTimer=setTimeout((function(){n.animationTime=0,n.prevFromRect=null,n.fromRect=null,n.prevToRect=null,n.thisAnimationDuration=null}),e),n.thisAnimationDuration=e)})),clearTimeout(t),i?t=setTimeout((function(){"function"==typeof e&&e()}),r):"function"==typeof e&&e(),n=[]},animate:function(t,e,n,o){if(o){_(t,"transition",""),_(t,"transform","");var i=C(this.el),r=i&&i.a,a=i&&i.d,l=(e.left-n.left)/(r||1),s=(e.top-n.top)/(a||1);t.animatingX=!!l,t.animatingY=!!s,_(t,"transform","translate3d("+l+"px,"+s+"px,0)"),this.forRepaintDummy=function(t){return t.offsetWidth}(t),_(t,"transition","transform "+o+"ms"+(this.options.easing?" "+this.options.easing:"")),_(t,"transform","translate3d(0,0,0)"),"number"==typeof t.animated&&clearTimeout(t.animated),t.animated=setTimeout((function(){_(t,"transition",""),_(t,"transform",""),t.animated=!1,t.animatingX=!1,t.animatingY=!1}),o)}}}}var W=[],z={initializeByDefault:!0},G={mount:function(t){for(var e in z)z.hasOwnProperty(e)&&!(e in t)&&(t[e]=z[e]);W.forEach((function(e){if(e.pluginName===t.pluginName)throw"Sortable: Cannot mount plugin ".concat(t.pluginName," more than once")})),W.push(t)},pluginEvent:function(t,n,o){var i=this;this.eventCanceled=!1,o.cancel=function(){i.eventCanceled=!0};var r=t+"Global";W.forEach((function(i){n[i.pluginName]&&(n[i.pluginName][r]&&n[i.pluginName][r](e({sortable:n},o)),n.options[i.pluginName]&&n[i.pluginName][t]&&n[i.pluginName][t](e({sortable:n},o)))}))},initializePlugins:function(t,e,n,o){for(var r in W.forEach((function(o){var r=o.pluginName;if(t.options[r]||o.initializeByDefault){var a=new o(t,e,t.options);a.sortable=t,a.options=t.options,t[r]=a,i(n,a.defaults)}})),t.options)if(t.options.hasOwnProperty(r)){var a=this.modifyOption(t,r,t.options[r]);void 0!==a&&(t.options[r]=a)}},getEventProperties:function(t,e){var n={};return W.forEach((function(o){"function"==typeof o.eventProperties&&i(n,o.eventProperties.call(e[o.pluginName],t))})),n},modifyOption:function(t,e,n){var o;return W.forEach((function(i){t[i.pluginName]&&i.optionListeners&&"function"==typeof i.optionListeners[e]&&(o=i.optionListeners[e].call(t[i.pluginName],n))})),o}};function U(t){var n=t.sortable,o=t.rootEl,i=t.name,r=t.targetEl,a=t.cloneEl,l=t.toEl,s=t.fromEl,d=t.oldIndex,h=t.newIndex,f=t.oldDraggableIndex,p=t.newDraggableIndex,g=t.originalEvent,v=t.putSortable,m=t.extraEventProperties;if(n=n||o&&o[L]){var b,y=n.options,w="on"+i.charAt(0).toUpperCase()+i.substr(1);!window.CustomEvent||c||u?(b=document.createEvent("Event")).initEvent(i,!0,!0):b=new CustomEvent(i,{bubbles:!0,cancelable:!0}),b.to=l||o,b.from=s||o,b.item=r||o,b.clone=a,b.oldIndex=d,b.newIndex=h,b.oldDraggableIndex=f,b.newDraggableIndex=p,b.originalEvent=g,b.pullMode=v?v.lastPutMode:void 0;var E=e(e({},m),G.getEventProperties(i,n));for(var D in E)b[D]=E[D];o&&o.dispatchEvent(b),y[w]&&y[w].call(n,b)}}var q=["evt"],V=function(t,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=o.evt,a=r(o,q);G.pluginEvent.bind(Ht)(t,n,e({dragEl:$,parentEl:Q,ghostEl:J,rootEl:tt,nextEl:et,lastDownEl:nt,cloneEl:ot,cloneHidden:it,dragStarted:mt,putSortable:ut,activeSortable:Ht.active,originalEvent:i,oldIndex:rt,oldDraggableIndex:lt,newIndex:at,newDraggableIndex:st,hideGhostForTarget:Yt,unhideGhostForTarget:Bt,cloneNowHidden:function(){it=!0},cloneNowShown:function(){it=!1},dispatchSortableEvent:function(t){Z({sortable:n,name:t,originalEvent:i})}},a))};function Z(t){U(e({putSortable:ut,cloneEl:ot,targetEl:$,rootEl:tt,oldIndex:rt,oldDraggableIndex:lt,newIndex:at,newDraggableIndex:st},t))}var $,Q,J,tt,et,nt,ot,it,rt,at,lt,st,ct,ut,dt,ht,ft,pt,gt,vt,mt,bt,yt,wt,Et,Dt=!1,St=!1,_t=[],Ct=!1,Tt=!1,xt=[],Ot=!1,Mt=[],At="undefined"!=typeof document,Nt=f,It=u||c?"cssFloat":"float",Pt=At&&!p&&!f&&"draggable"in document.createElement("div"),kt=function(){if(At){if(c)return!1;var t=document.createElement("x");return t.style.cssText="pointer-events:auto","auto"===t.style.pointerEvents}}(),Rt=function(t,e){var n=_(t),o=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=A(t,0,e),r=A(t,1,e),a=i&&_(i),l=r&&_(r),s=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+O(i).width,c=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+O(r).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&a.float&&"none"!==a.float){var u="left"===a.float?"left":"right";return!r||"both"!==l.clear&&l.clear!==u?"horizontal":"vertical"}return i&&("block"===a.display||"flex"===a.display||"table"===a.display||"grid"===a.display||s>=o&&"none"===n[It]||r&&"none"===n[It]&&s+c>o)?"vertical":"horizontal"},Xt=function(t){function e(t,n){return function(o,i,r,a){var l=o.options.group.name&&i.options.group.name&&o.options.group.name===i.options.group.name;if(null==t&&(n||l))return!0;if(null==t||!1===t)return!1;if(n&&"clone"===t)return t;if("function"==typeof t)return e(t(o,i,r,a),n)(o,i,r,a);var s=(n?o:i).options.group.name;return!0===t||"string"==typeof t&&t===s||t.join&&t.indexOf(s)>-1}}var o={},i=t.group;i&&"object"==n(i)||(i={name:i}),o.name=i.name,o.checkPull=e(i.pull,!0),o.checkPut=e(i.put),o.revertClone=i.revertClone,t.group=o},Yt=function(){!kt&&J&&_(J,"display","none")},Bt=function(){!kt&&J&&_(J,"display","")};At&&!p&&document.addEventListener("click",(function(t){if(St)return t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.stopImmediatePropagation&&t.stopImmediatePropagation(),St=!1,!1}),!0);var Ft=function(t){if($){t=t.touches?t.touches[0]:t;var e=(i=t.clientX,r=t.clientY,_t.some((function(t){var e=t[L].options.emptyInsertThreshold;if(e&&!N(t)){var n=O(t),o=i>=n.left-e&&i<=n.right+e,l=r>=n.top-e&&r<=n.bottom+e;return o&&l?a=t:void 0}})),a);if(e){var n={};for(var o in t)t.hasOwnProperty(o)&&(n[o]=t[o]);n.target=n.rootEl=e,n.preventDefault=void 0,n.stopPropagation=void 0,e[L]._onDragOver(n)}}var i,r,a},jt=function(t){$&&$.parentNode[L]._isOutsideThisEl(t.target)};function Ht(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=i({},e),t[L]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Rt(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==Ht.supportPointer&&"PointerEvent"in window&&!h,emptyInsertThreshold:5};for(var o in G.initializePlugins(this,t,n),n)!(o in e)&&(e[o]=n[o]);for(var r in Xt(e),this)"_"===r.charAt(0)&&"function"==typeof this[r]&&(this[r]=this[r].bind(this));this.nativeDraggable=!e.forceFallback&&Pt,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?v(t,"pointerdown",this._onTapStart):(v(t,"mousedown",this._onTapStart),v(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(v(t,"dragover",this),v(t,"dragenter",this)),_t.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),i(this,K())}function Lt(t,e,n,o,i,r,a,l){var s,d,h=t[L],f=h.options.onMove;return!window.CustomEvent||c||u?(s=document.createEvent("Event")).initEvent("move",!0,!0):s=new CustomEvent("move",{bubbles:!0,cancelable:!0}),s.to=e,s.from=t,s.dragged=n,s.draggedRect=o,s.related=i||e,s.relatedRect=r||O(e),s.willInsertAfter=l,s.originalEvent=a,t.dispatchEvent(s),f&&(d=f.call(h,s,a)),d}function Kt(t){t.draggable=!1}function Wt(){Ot=!1}function zt(t){for(var e=t.tagName+t.className+t.src+t.href+t.textContent,n=e.length,o=0;n--;)o+=e.charCodeAt(n);return o.toString(36)}function Gt(t){return setTimeout(t,0)}function Ut(t){return clearTimeout(t)}Ht.prototype={constructor:Ht,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(bt=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,$):this.options.direction},_onTapStart:function(t){if(t.cancelable){var e=this,n=this.el,o=this.options,i=o.preventOnFilter,r=t.type,a=t.touches&&t.touches[0]||t.pointerType&&"touch"===t.pointerType&&t,l=(a||t).target,s=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||l,c=o.filter;if(function(t){Mt.length=0;var e=t.getElementsByTagName("input"),n=e.length;for(;n--;){var o=e[n];o.checked&&Mt.push(o)}}(n),!$&&!(/mousedown|pointerdown/.test(r)&&0!==t.button||o.disabled)&&!s.isContentEditable&&(this.nativeDraggable||!h||!l||"SELECT"!==l.tagName.toUpperCase())&&!((l=w(l,o.draggable,n,!1))&&l.animated||nt===l)){if(rt=I(l),lt=I(l,o.draggable),"function"==typeof c){if(c.call(this,t,l,this))return Z({sortable:e,rootEl:s,name:"filter",targetEl:l,toEl:n,fromEl:n}),V("filter",e,{evt:t}),void(i&&t.cancelable&&t.preventDefault())}else if(c&&(c=c.split(",").some((function(o){if(o=w(s,o.trim(),n,!1))return Z({sortable:e,rootEl:o,name:"filter",targetEl:l,fromEl:n,toEl:n}),V("filter",e,{evt:t}),!0}))))return void(i&&t.cancelable&&t.preventDefault());o.handle&&!w(s,o.handle,n,!1)||this._prepareDragStart(t,a,l)}}},_prepareDragStart:function(t,e,n){var o,i=this,r=i.el,a=i.options,l=r.ownerDocument;if(n&&!$&&n.parentNode===r){var s=O(n);if(tt=r,Q=($=n).parentNode,et=$.nextSibling,nt=n,ct=a.group,Ht.dragged=$,dt={target:$,clientX:(e||t).clientX,clientY:(e||t).clientY},gt=dt.clientX-s.left,vt=dt.clientY-s.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,$.style["will-change"]="all",o=function(){V("delayEnded",i,{evt:t}),Ht.eventCanceled?i._onDrop():(i._disableDelayedDragEvents(),!d&&i.nativeDraggable&&($.draggable=!0),i._triggerDragStart(t,e),Z({sortable:i,name:"choose",originalEvent:t}),S($,a.chosenClass,!0))},a.ignore.split(",").forEach((function(t){T($,t.trim(),Kt)})),v(l,"dragover",Ft),v(l,"mousemove",Ft),v(l,"touchmove",Ft),v(l,"mouseup",i._onDrop),v(l,"touchend",i._onDrop),v(l,"touchcancel",i._onDrop),d&&this.nativeDraggable&&(this.options.touchStartThreshold=4,$.draggable=!0),V("delayStart",this,{evt:t}),!a.delay||a.delayOnTouchOnly&&!e||this.nativeDraggable&&(u||c))o();else{if(Ht.eventCanceled)return void this._onDrop();v(l,"mouseup",i._disableDelayedDrag),v(l,"touchend",i._disableDelayedDrag),v(l,"touchcancel",i._disableDelayedDrag),v(l,"mousemove",i._delayedDragTouchMoveHandler),v(l,"touchmove",i._delayedDragTouchMoveHandler),a.supportPointer&&v(l,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(o,a.delay)}}},_delayedDragTouchMoveHandler:function(t){var e=t.touches?t.touches[0]:t;Math.max(Math.abs(e.clientX-this._lastX),Math.abs(e.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){$&&Kt($),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;m(t,"mouseup",this._disableDelayedDrag),m(t,"touchend",this._disableDelayedDrag),m(t,"touchcancel",this._disableDelayedDrag),m(t,"mousemove",this._delayedDragTouchMoveHandler),m(t,"touchmove",this._delayedDragTouchMoveHandler),m(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?v(document,"pointermove",this._onTouchMove):v(document,e?"touchmove":"mousemove",this._onTouchMove):(v($,"dragend",this),v(tt,"dragstart",this._onDragStart));try{document.selection?Gt((function(){document.selection.empty()})):window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(t,e){if(Dt=!1,tt&&$){V("dragStarted",this,{evt:e}),this.nativeDraggable&&v(document,"dragover",jt);var n=this.options;!t&&S($,n.dragClass,!1),S($,n.ghostClass,!0),Ht.active=this,t&&this._appendGhost(),Z({sortable:this,name:"start",originalEvent:e})}else this._nulling()},_emulateDragOver:function(){if(ht){this._lastX=ht.clientX,this._lastY=ht.clientY,Yt();for(var t=document.elementFromPoint(ht.clientX,ht.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(ht.clientX,ht.clientY))!==e;)e=t;if($.parentNode[L]._isOutsideThisEl(t),e)do{if(e[L]){if(e[L]._onDragOver({clientX:ht.clientX,clientY:ht.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break}t=e}while(e=e.parentNode);Bt()}},_onTouchMove:function(t){if(dt){var e=this.options,n=e.fallbackTolerance,o=e.fallbackOffset,i=t.touches?t.touches[0]:t,r=J&&C(J,!0),a=J&&r&&r.a,l=J&&r&&r.d,s=Nt&&Et&&P(Et),c=(i.clientX-dt.clientX+o.x)/(a||1)+(s?s[0]-xt[0]:0)/(a||1),u=(i.clientY-dt.clientY+o.y)/(l||1)+(s?s[1]-xt[1]:0)/(l||1);if(!Ht.active&&!Dt){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<n)return;this._onDragStart(t,!0)}if(J){r?(r.e+=c-(ft||0),r.f+=u-(pt||0)):r={a:1,b:0,c:0,d:1,e:c,f:u};var d="matrix(".concat(r.a,",").concat(r.b,",").concat(r.c,",").concat(r.d,",").concat(r.e,",").concat(r.f,")");_(J,"webkitTransform",d),_(J,"mozTransform",d),_(J,"msTransform",d),_(J,"transform",d),ft=c,pt=u,ht=i}t.cancelable&&t.preventDefault()}},_appendGhost:function(){if(!J){var t=this.options.fallbackOnBody?document.body:tt,e=O($,!0,Nt,!0,t),n=this.options;if(Nt){for(Et=t;"static"===_(Et,"position")&&"none"===_(Et,"transform")&&Et!==document;)Et=Et.parentNode;Et!==document.body&&Et!==document.documentElement?(Et===document&&(Et=x()),e.top+=Et.scrollTop,e.left+=Et.scrollLeft):Et=x(),xt=P(Et)}S(J=$.cloneNode(!0),n.ghostClass,!1),S(J,n.fallbackClass,!0),S(J,n.dragClass,!0),_(J,"transition",""),_(J,"transform",""),_(J,"box-sizing","border-box"),_(J,"margin",0),_(J,"top",e.top),_(J,"left",e.left),_(J,"width",e.width),_(J,"height",e.height),_(J,"opacity","0.8"),_(J,"position",Nt?"absolute":"fixed"),_(J,"zIndex","100000"),_(J,"pointerEvents","none"),Ht.ghost=J,t.appendChild(J),_(J,"transform-origin",gt/parseInt(J.style.width)*100+"% "+vt/parseInt(J.style.height)*100+"%")}},_onDragStart:function(t,e){var n=this,o=t.dataTransfer,i=n.options;V("dragStart",this,{evt:t}),Ht.eventCanceled?this._onDrop():(V("setupClone",this),Ht.eventCanceled||((ot=B($)).removeAttribute("id"),ot.draggable=!1,ot.style["will-change"]="",this._hideClone(),S(ot,this.options.chosenClass,!1),Ht.clone=ot),n.cloneId=Gt((function(){V("clone",n),Ht.eventCanceled||(n.options.removeCloneOnHide||tt.insertBefore(ot,$),n._hideClone(),Z({sortable:n,name:"clone"}))})),!e&&S($,i.dragClass,!0),e?(St=!0,n._loopId=setInterval(n._emulateDragOver,50)):(m(document,"mouseup",n._onDrop),m(document,"touchend",n._onDrop),m(document,"touchcancel",n._onDrop),o&&(o.effectAllowed="move",i.setData&&i.setData.call(n,o,$)),v(document,"drop",n),_($,"transform","translateZ(0)")),Dt=!0,n._dragStartId=Gt(n._dragStarted.bind(n,e,t)),v(document,"selectstart",n),mt=!0,h&&_(document.body,"user-select","none"))},_onDragOver:function(t){var n,o,i,r,a=this.el,l=t.target,s=this.options,c=s.group,u=Ht.active,d=ct===c,h=s.sort,f=ut||u,p=this,g=!1;if(!Ot){if(void 0!==t.preventDefault&&t.cancelable&&t.preventDefault(),l=w(l,s.draggable,a,!0),F("dragOver"),Ht.eventCanceled)return g;if($.contains(t.target)||l.animated&&l.animatingX&&l.animatingY||p._ignoreWhileAnimating===l)return K(!1);if(St=!1,u&&!s.disabled&&(d?h||(i=Q!==tt):ut===this||(this.lastPutMode=ct.checkPull(this,u,$,t))&&c.checkPut(this,u,$,t))){if(r="vertical"===this._getDirection(t,l),n=O($),F("dragOverValid"),Ht.eventCanceled)return g;if(i)return Q=tt,j(),this._hideClone(),F("revert"),Ht.eventCanceled||(et?tt.insertBefore($,et):tt.appendChild($)),K(!0);var v=N(a,s.draggable);if(!v||function(t,e,n){var o=O(N(n.el,n.options.draggable)),i=H(n.el,n.options,J),r=10;return e?t.clientX>i.right+r||t.clientY>o.bottom&&t.clientX>o.left:t.clientY>i.bottom+r||t.clientX>o.right&&t.clientY>o.top}(t,r,this)&&!v.animated){if(v===$)return K(!1);if(v&&a===t.target&&(l=v),l&&(o=O(l)),!1!==Lt(tt,a,$,n,l,o,t,!!l))return j(),v&&v.nextSibling?a.insertBefore($,v.nextSibling):a.appendChild($),Q=a,W(),K(!0)}else if(v&&function(t,e,n){var o=O(A(n.el,0,n.options,!0)),i=H(n.el,n.options,J),r=10;return e?t.clientX<i.left-r||t.clientY<o.top&&t.clientX<o.right:t.clientY<i.top-r||t.clientY<o.bottom&&t.clientX<o.left}(t,r,this)){var m=A(a,0,s,!0);if(m===$)return K(!1);if(o=O(l=m),!1!==Lt(tt,a,$,n,l,o,t,!1))return j(),a.insertBefore($,m),Q=a,W(),K(!0)}else if(l.parentNode===a){o=O(l);var b,y,E,D=$.parentNode!==a,C=!function(t,e,n){var o=n?t.left:t.top,i=n?t.right:t.bottom,r=n?t.width:t.height,a=n?e.left:e.top,l=n?e.right:e.bottom,s=n?e.width:e.height;return o===a||i===l||o+r/2===a+s/2}($.animated&&$.toRect||n,l.animated&&l.toRect||o,r),T=r?"top":"left",x=M(l,"top","top")||M($,"top","top"),P=x?x.scrollTop:void 0;if(bt!==l&&(y=o[T],Ct=!1,Tt=!C&&s.invertSwap||D),b=function(t,e,n,o,i,r,a,l){var s=o?t.clientY:t.clientX,c=o?n.height:n.width,u=o?n.top:n.left,d=o?n.bottom:n.right,h=!1;if(!a)if(l&&wt<c*i){if(!Ct&&(1===yt?s>u+c*r/2:s<d-c*r/2)&&(Ct=!0),Ct)h=!0;else if(1===yt?s<u+wt:s>d-wt)return-yt}else if(s>u+c*(1-i)/2&&s<d-c*(1-i)/2)return function(t){return I($)<I(t)?1:-1}(e);if((h=h||a)&&(s<u+c*r/2||s>d-c*r/2))return s>u+c/2?1:-1;return 0}(t,l,o,r,C?1:s.swapThreshold,null==s.invertedSwapThreshold?s.swapThreshold:s.invertedSwapThreshold,Tt,bt===l),0!==b){var k=I($);do{k-=b,E=Q.children[k]}while(E&&("none"===_(E,"display")||E===J))}if(0===b||E===l)return K(!1);bt=l,yt=b;var R=l.nextElementSibling,X=!1,B=Lt(tt,a,$,n,l,o,t,X=1===b);if(!1!==B)return 1!==B&&-1!==B||(X=1===B),Ot=!0,setTimeout(Wt,30),j(),X&&!R?a.appendChild($):l.parentNode.insertBefore($,X?R:l),x&&Y(x,0,P-x.scrollTop),Q=$.parentNode,void 0===y||Tt||(wt=Math.abs(y-O(l)[T])),W(),K(!0)}if(a.contains($))return K(!1)}return!1}function F(s,c){V(s,p,e({evt:t,isOwner:d,axis:r?"vertical":"horizontal",revert:i,dragRect:n,targetRect:o,canSort:h,fromSortable:f,target:l,completed:K,onMove:function(e,o){return Lt(tt,a,$,n,e,O(e),t,o)},changed:W},c))}function j(){F("dragOverAnimationCapture"),p.captureAnimationState(),p!==f&&f.captureAnimationState()}function K(e){return F("dragOverCompleted",{insertion:e}),e&&(d?u._hideClone():u._showClone(p),p!==f&&(S($,ut?ut.options.ghostClass:u.options.ghostClass,!1),S($,s.ghostClass,!0)),ut!==p&&p!==Ht.active?ut=p:p===Ht.active&&ut&&(ut=null),f===p&&(p._ignoreWhileAnimating=l),p.animateAll((function(){F("dragOverAnimationComplete"),p._ignoreWhileAnimating=null})),p!==f&&(f.animateAll(),f._ignoreWhileAnimating=null)),(l===$&&!$.animated||l===a&&!l.animated)&&(bt=null),s.dragoverBubble||t.rootEl||l===document||($.parentNode[L]._isOutsideThisEl(t.target),!e&&Ft(t)),!s.dragoverBubble&&t.stopPropagation&&t.stopPropagation(),g=!0}function W(){at=I($),st=I($,s.draggable),Z({sortable:p,name:"change",toEl:a,newIndex:at,newDraggableIndex:st,originalEvent:t})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){m(document,"mousemove",this._onTouchMove),m(document,"touchmove",this._onTouchMove),m(document,"pointermove",this._onTouchMove),m(document,"dragover",Ft),m(document,"mousemove",Ft),m(document,"touchmove",Ft)},_offUpEvents:function(){var t=this.el.ownerDocument;m(t,"mouseup",this._onDrop),m(t,"touchend",this._onDrop),m(t,"pointerup",this._onDrop),m(t,"touchcancel",this._onDrop),m(document,"selectstart",this)},_onDrop:function(t){var e=this.el,n=this.options;at=I($),st=I($,n.draggable),V("drop",this,{evt:t}),Q=$&&$.parentNode,at=I($),st=I($,n.draggable),Ht.eventCanceled||(Dt=!1,Tt=!1,Ct=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Ut(this.cloneId),Ut(this._dragStartId),this.nativeDraggable&&(m(document,"drop",this),m(e,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),h&&_(document.body,"user-select",""),_($,"transform",""),t&&(mt&&(t.cancelable&&t.preventDefault(),!n.dropBubble&&t.stopPropagation()),J&&J.parentNode&&J.parentNode.removeChild(J),(tt===Q||ut&&"clone"!==ut.lastPutMode)&&ot&&ot.parentNode&&ot.parentNode.removeChild(ot),$&&(this.nativeDraggable&&m($,"dragend",this),Kt($),$.style["will-change"]="",mt&&!Dt&&S($,ut?ut.options.ghostClass:this.options.ghostClass,!1),S($,this.options.chosenClass,!1),Z({sortable:this,name:"unchoose",toEl:Q,newIndex:null,newDraggableIndex:null,originalEvent:t}),tt!==Q?(at>=0&&(Z({rootEl:Q,name:"add",toEl:Q,fromEl:tt,originalEvent:t}),Z({sortable:this,name:"remove",toEl:Q,originalEvent:t}),Z({rootEl:Q,name:"sort",toEl:Q,fromEl:tt,originalEvent:t}),Z({sortable:this,name:"sort",toEl:Q,originalEvent:t})),ut&&ut.save()):at!==rt&&at>=0&&(Z({sortable:this,name:"update",toEl:Q,originalEvent:t}),Z({sortable:this,name:"sort",toEl:Q,originalEvent:t})),Ht.active&&(null!=at&&-1!==at||(at=rt,st=lt),Z({sortable:this,name:"end",toEl:Q,originalEvent:t}),this.save())))),this._nulling()},_nulling:function(){V("nulling",this),tt=$=Q=J=et=ot=nt=it=dt=ht=mt=at=st=rt=lt=bt=yt=ut=ct=Ht.dragged=Ht.ghost=Ht.clone=Ht.active=null,Mt.forEach((function(t){t.checked=!0})),Mt.length=ft=pt=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":$&&(this._onDragOver(t),function(t){t.dataTransfer&&(t.dataTransfer.dropEffect="move");t.cancelable&&t.preventDefault()}(t));break;case"selectstart":t.preventDefault()}},toArray:function(){for(var t,e=[],n=this.el.children,o=0,i=n.length,r=this.options;o<i;o++)w(t=n[o],r.draggable,this.el,!1)&&e.push(t.getAttribute(r.dataIdAttr)||zt(t));return e},sort:function(t,e){var n={},o=this.el;this.toArray().forEach((function(t,e){var i=o.children[e];w(i,this.options.draggable,o,!1)&&(n[t]=i)}),this),e&&this.captureAnimationState(),t.forEach((function(t){n[t]&&(o.removeChild(n[t]),o.appendChild(n[t]))})),e&&this.animateAll()},save:function(){var t=this.options.store;t&&t.set&&t.set(this)},closest:function(t,e){return w(t,e||this.options.draggable,this.el,!1)},option:function(t,e){var n=this.options;if(void 0===e)return n[t];var o=G.modifyOption(this,t,e);n[t]=void 0!==o?o:e,"group"===t&&Xt(n)},destroy:function(){V("destroy",this);var t=this.el;t[L]=null,m(t,"mousedown",this._onTapStart),m(t,"touchstart",this._onTapStart),m(t,"pointerdown",this._onTapStart),this.nativeDraggable&&(m(t,"dragover",this),m(t,"dragenter",this)),Array.prototype.forEach.call(t.querySelectorAll("[draggable]"),(function(t){t.removeAttribute("draggable")})),this._onDrop(),this._disableDelayedDragEvents(),_t.splice(_t.indexOf(this.el),1),this.el=t=null},_hideClone:function(){if(!it){if(V("hideClone",this),Ht.eventCanceled)return;_(ot,"display","none"),this.options.removeCloneOnHide&&ot.parentNode&&ot.parentNode.removeChild(ot),it=!0}},_showClone:function(t){if("clone"===t.lastPutMode){if(it){if(V("showClone",this),Ht.eventCanceled)return;$.parentNode!=tt||this.options.group.revertClone?et?tt.insertBefore(ot,et):tt.appendChild(ot):tt.insertBefore(ot,$),this.options.group.revertClone&&this.animate($,ot),_(ot,"display",""),it=!1}}else this._hideClone()}},At&&v(document,"touchmove",(function(t){(Ht.active||Dt)&&t.cancelable&&t.preventDefault()})),Ht.utils={on:v,off:m,css:_,find:T,is:function(t,e){return!!w(t,e,t,!1)},extend:function(t,e){if(t&&e)for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t},throttle:X,closest:w,toggleClass:S,clone:B,index:I,nextTick:Gt,cancelNextTick:Ut,detectDirection:Rt,getChild:A},Ht.get=function(t){return t[L]},Ht.mount=function(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];n[0].constructor===Array&&(n=n[0]),n.forEach((function(t){if(!t.prototype||!t.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(t));t.utils&&(Ht.utils=e(e({},Ht.utils),t.utils)),G.mount(t)}))},Ht.create=function(t,e){return new Ht(t,e)},Ht.version="1.15.2";var qt,Vt,Zt,$t,Qt,Jt,te=[],ee=!1;function ne(){te.forEach((function(t){clearInterval(t.pid)})),te=[]}function oe(){clearInterval(Jt)}var ie,re=X((function(t,e,n,o){if(e.scroll){var i,r=(t.touches?t.touches[0]:t).clientX,a=(t.touches?t.touches[0]:t).clientY,l=e.scrollSensitivity,s=e.scrollSpeed,c=x(),u=!1;Vt!==n&&(Vt=n,ne(),qt=e.scroll,i=e.scrollFn,!0===qt&&(qt=k(n,!0)));var d=0,h=qt;do{var f=h,p=O(f),g=p.top,v=p.bottom,m=p.left,b=p.right,y=p.width,w=p.height,E=void 0,D=void 0,S=f.scrollWidth,C=f.scrollHeight,T=_(f),M=f.scrollLeft,A=f.scrollTop;f===c?(E=y<S&&("auto"===T.overflowX||"scroll"===T.overflowX||"visible"===T.overflowX),D=w<C&&("auto"===T.overflowY||"scroll"===T.overflowY||"visible"===T.overflowY)):(E=y<S&&("auto"===T.overflowX||"scroll"===T.overflowX),D=w<C&&("auto"===T.overflowY||"scroll"===T.overflowY));var N=E&&(Math.abs(b-r)<=l&&M+y<S)-(Math.abs(m-r)<=l&&!!M),I=D&&(Math.abs(v-a)<=l&&A+w<C)-(Math.abs(g-a)<=l&&!!A);if(!te[d])for(var P=0;P<=d;P++)te[P]||(te[P]={});te[d].vx==N&&te[d].vy==I&&te[d].el===f||(te[d].el=f,te[d].vx=N,te[d].vy=I,clearInterval(te[d].pid),0==N&&0==I||(u=!0,te[d].pid=setInterval(function(){o&&0===this.layer&&Ht.active._onTouchMove(Qt);var e=te[this.layer].vy?te[this.layer].vy*s:0,n=te[this.layer].vx?te[this.layer].vx*s:0;"function"==typeof i&&"continue"!==i.call(Ht.dragged.parentNode[L],n,e,t,Qt,te[this.layer].el)||Y(te[this.layer].el,n,e)}.bind({layer:d}),24))),d++}while(e.bubbleScroll&&h!==c&&(h=k(h,!1)));ee=u}}),30),ae=function(t){var e=t.originalEvent,n=t.putSortable,o=t.dragEl,i=t.activeSortable,r=t.dispatchSortableEvent,a=t.hideGhostForTarget,l=t.unhideGhostForTarget;if(e){var s=n||i;a();var c=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:e,u=document.elementFromPoint(c.clientX,c.clientY);l(),s&&!s.el.contains(u)&&(r("spill"),this.onSpill({dragEl:o,putSortable:n}))}};function le(){}function se(){}function ce(){function t(){this.defaults={swapClass:"sortable-swap-highlight"}}return t.prototype={dragStart:function(t){var e=t.dragEl;ie=e},dragOverValid:function(t){var e=t.completed,n=t.target,o=t.onMove,i=t.activeSortable,r=t.changed,a=t.cancel;if(i.options.swap){var l=this.sortable.el,s=this.options;if(n&&n!==l){var c=ie;!1!==o(n)?(S(n,s.swapClass,!0),ie=n):ie=null,c&&c!==ie&&S(c,s.swapClass,!1)}r(),e(!0),a()}},drop:function(t){var e=t.activeSortable,n=t.putSortable,o=t.dragEl,i=n||this.sortable,r=this.options;ie&&S(ie,r.swapClass,!1),ie&&(r.swap||n&&n.options.swap)&&o!==ie&&(i.captureAnimationState(),i!==e&&e.captureAnimationState(),function(t,e){var n,o,i=t.parentNode,r=e.parentNode;if(!i||!r||i.isEqualNode(e)||r.isEqualNode(t))return;n=I(t),o=I(e),i.isEqualNode(r)&&n<o&&o++;i.insertBefore(e,i.children[n]),r.insertBefore(t,r.children[o])}(o,ie),i.animateAll(),i!==e&&e.animateAll())},nulling:function(){ie=null}},i(t,{pluginName:"swap",eventProperties:function(){return{swapItem:ie}}})}le.prototype={startIndex:null,dragStart:function(t){var e=t.oldDraggableIndex;this.startIndex=e},onSpill:function(t){var e=t.dragEl,n=t.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var o=A(this.sortable.el,this.startIndex,this.options);o?this.sortable.el.insertBefore(e,o):this.sortable.el.appendChild(e),this.sortable.animateAll(),n&&n.animateAll()},drop:ae},i(le,{pluginName:"revertOnSpill"}),se.prototype={onSpill:function(t){var e=t.dragEl,n=t.putSortable||this.sortable;n.captureAnimationState(),e.parentNode&&e.parentNode.removeChild(e),n.animateAll()},drop:ae},i(se,{pluginName:"removeOnSpill"});var ue,de,he,fe,pe,ge=[],ve=[],me=!1,be=!1,ye=!1;function we(){function t(t){for(var e in this)"_"===e.charAt(0)&&"function"==typeof this[e]&&(this[e]=this[e].bind(this));t.options.avoidImplicitDeselect||(t.options.supportPointer?v(document,"pointerup",this._deselectMultiDrag):(v(document,"mouseup",this._deselectMultiDrag),v(document,"touchend",this._deselectMultiDrag))),v(document,"keydown",this._checkKeyDown),v(document,"keyup",this._checkKeyUp),this.defaults={selectedClass:"sortable-selected",multiDragKey:null,avoidImplicitDeselect:!1,setData:function(e,n){var o="";ge.length&&de===t?ge.forEach((function(t,e){o+=(e?", ":"")+t.textContent})):o=n.textContent,e.setData("Text",o)}}}return t.prototype={multiDragKeyDown:!1,isMultiDrag:!1,delayStartGlobal:function(t){var e=t.dragEl;he=e},delayEnded:function(){this.isMultiDrag=~ge.indexOf(he)},setupClone:function(t){var e=t.sortable,n=t.cancel;if(this.isMultiDrag){for(var o=0;o<ge.length;o++)ve.push(B(ge[o])),ve[o].sortableIndex=ge[o].sortableIndex,ve[o].draggable=!1,ve[o].style["will-change"]="",S(ve[o],this.options.selectedClass,!1),ge[o]===he&&S(ve[o],this.options.chosenClass,!1);e._hideClone(),n()}},clone:function(t){var e=t.sortable,n=t.rootEl,o=t.dispatchSortableEvent,i=t.cancel;this.isMultiDrag&&(this.options.removeCloneOnHide||ge.length&&de===e&&(Ee(!0,n),o("clone"),i()))},showClone:function(t){var e=t.cloneNowShown,n=t.rootEl,o=t.cancel;this.isMultiDrag&&(Ee(!1,n),ve.forEach((function(t){_(t,"display","")})),e(),pe=!1,o())},hideClone:function(t){var e=this;t.sortable;var n=t.cloneNowHidden,o=t.cancel;this.isMultiDrag&&(ve.forEach((function(t){_(t,"display","none"),e.options.removeCloneOnHide&&t.parentNode&&t.parentNode.removeChild(t)})),n(),pe=!0,o())},dragStartGlobal:function(t){t.sortable,!this.isMultiDrag&&de&&de.multiDrag._deselectMultiDrag(),ge.forEach((function(t){t.sortableIndex=I(t)})),ge=ge.sort((function(t,e){return t.sortableIndex-e.sortableIndex})),ye=!0},dragStarted:function(t){var e=this,n=t.sortable;if(this.isMultiDrag){if(this.options.sort&&(n.captureAnimationState(),this.options.animation)){ge.forEach((function(t){t!==he&&_(t,"position","absolute")}));var o=O(he,!1,!0,!0);ge.forEach((function(t){t!==he&&F(t,o)})),be=!0,me=!0}n.animateAll((function(){be=!1,me=!1,e.options.animation&&ge.forEach((function(t){j(t)})),e.options.sort&&De()}))}},dragOver:function(t){var e=t.target,n=t.completed,o=t.cancel;be&&~ge.indexOf(e)&&(n(!1),o())},revert:function(t){var e=t.fromSortable,n=t.rootEl,o=t.sortable,i=t.dragRect;ge.length>1&&(ge.forEach((function(t){o.addAnimationState({target:t,rect:be?O(t):i}),j(t),t.fromRect=i,e.removeAnimationState(t)})),be=!1,function(t,e){ge.forEach((function(n,o){var i=e.children[n.sortableIndex+(t?Number(o):0)];i?e.insertBefore(n,i):e.appendChild(n)}))}(!this.options.removeCloneOnHide,n))},dragOverCompleted:function(t){var e=t.sortable,n=t.isOwner,o=t.insertion,i=t.activeSortable,r=t.parentEl,a=t.putSortable,l=this.options;if(o){if(n&&i._hideClone(),me=!1,l.animation&&ge.length>1&&(be||!n&&!i.options.sort&&!a)){var s=O(he,!1,!0,!0);ge.forEach((function(t){t!==he&&(F(t,s),r.appendChild(t))})),be=!0}if(!n)if(be||De(),ge.length>1){var c=pe;i._showClone(e),i.options.animation&&!pe&&c&&ve.forEach((function(t){i.addAnimationState({target:t,rect:fe}),t.fromRect=fe,t.thisAnimationDuration=null}))}else i._showClone(e)}},dragOverAnimationCapture:function(t){var e=t.dragRect,n=t.isOwner,o=t.activeSortable;if(ge.forEach((function(t){t.thisAnimationDuration=null})),o.options.animation&&!n&&o.multiDrag.isMultiDrag){fe=i({},e);var r=C(he,!0);fe.top-=r.f,fe.left-=r.e}},dragOverAnimationComplete:function(){be&&(be=!1,De())},drop:function(t){var e=t.originalEvent,n=t.rootEl,o=t.parentEl,i=t.sortable,r=t.dispatchSortableEvent,a=t.oldIndex,l=t.putSortable,s=l||this.sortable;if(e){var c=this.options,u=o.children;if(!ye)if(c.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),S(he,c.selectedClass,!~ge.indexOf(he)),~ge.indexOf(he))ge.splice(ge.indexOf(he),1),ue=null,U({sortable:i,rootEl:n,name:"deselect",targetEl:he,originalEvent:e});else{if(ge.push(he),U({sortable:i,rootEl:n,name:"select",targetEl:he,originalEvent:e}),e.shiftKey&&ue&&i.el.contains(ue)){var d,h,f=I(ue),p=I(he);if(~f&&~p&&f!==p)for(p>f?(h=f,d=p):(h=p,d=f+1);h<d;h++)~ge.indexOf(u[h])||(S(u[h],c.selectedClass,!0),ge.push(u[h]),U({sortable:i,rootEl:n,name:"select",targetEl:u[h],originalEvent:e}))}else ue=he;de=s}if(ye&&this.isMultiDrag){if(be=!1,(o[L].options.sort||o!==n)&&ge.length>1){var g=O(he),v=I(he,":not(."+this.options.selectedClass+")");if(!me&&c.animation&&(he.thisAnimationDuration=null),s.captureAnimationState(),!me&&(c.animation&&(he.fromRect=g,ge.forEach((function(t){if(t.thisAnimationDuration=null,t!==he){var e=be?O(t):g;t.fromRect=e,s.addAnimationState({target:t,rect:e})}}))),De(),ge.forEach((function(t){u[v]?o.insertBefore(t,u[v]):o.appendChild(t),v++})),a===I(he))){var m=!1;ge.forEach((function(t){t.sortableIndex===I(t)||(m=!0)})),m&&(r("update"),r("sort"))}ge.forEach((function(t){j(t)})),s.animateAll()}de=s}(n===o||l&&"clone"!==l.lastPutMode)&&ve.forEach((function(t){t.parentNode&&t.parentNode.removeChild(t)}))}},nullingGlobal:function(){this.isMultiDrag=ye=!1,ve.length=0},destroyGlobal:function(){this._deselectMultiDrag(),m(document,"pointerup",this._deselectMultiDrag),m(document,"mouseup",this._deselectMultiDrag),m(document,"touchend",this._deselectMultiDrag),m(document,"keydown",this._checkKeyDown),m(document,"keyup",this._checkKeyUp)},_deselectMultiDrag:function(t){if(!(void 0!==ye&&ye||de!==this.sortable||t&&w(t.target,this.options.draggable,this.sortable.el,!1)||t&&0!==t.button))for(;ge.length;){var e=ge[0];S(e,this.options.selectedClass,!1),ge.shift(),U({sortable:this.sortable,rootEl:this.sortable.el,name:"deselect",targetEl:e,originalEvent:t})}},_checkKeyDown:function(t){t.key===this.options.multiDragKey&&(this.multiDragKeyDown=!0)},_checkKeyUp:function(t){t.key===this.options.multiDragKey&&(this.multiDragKeyDown=!1)}},i(t,{pluginName:"multiDrag",utils:{select:function(t){var e=t.parentNode[L];e&&e.options.multiDrag&&!~ge.indexOf(t)&&(de&&de!==e&&(de.multiDrag._deselectMultiDrag(),de=e),S(t,e.options.selectedClass,!0),ge.push(t))},deselect:function(t){var e=t.parentNode[L],n=ge.indexOf(t);e&&e.options.multiDrag&&~n&&(S(t,e.options.selectedClass,!1),ge.splice(n,1))}},eventProperties:function(){var t=this,e=[],n=[];return ge.forEach((function(o){var i;e.push({multiDragElement:o,index:o.sortableIndex}),i=be&&o!==he?-1:be?I(o,":not(."+t.options.selectedClass+")"):I(o),n.push({multiDragElement:o,index:i})})),{items:a(ge),clones:[].concat(ve),oldIndicies:e,newIndicies:n}},optionListeners:{multiDragKey:function(t){return"ctrl"===(t=t.toLowerCase())?t="Control":t.length>1&&(t=t.charAt(0).toUpperCase()+t.substr(1)),t}}})}function Ee(t,e){ve.forEach((function(n,o){var i=e.children[n.sortableIndex+(t?Number(o):0)];i?e.insertBefore(n,i):e.appendChild(n)}))}function De(){ge.forEach((function(t){t!==he&&t.parentNode&&t.parentNode.removeChild(t)}))}Ht.mount(new function(){function t(){for(var t in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)"_"===t.charAt(0)&&"function"==typeof this[t]&&(this[t]=this[t].bind(this))}return t.prototype={dragStarted:function(t){var e=t.originalEvent;this.sortable.nativeDraggable?v(document,"dragover",this._handleAutoScroll):this.options.supportPointer?v(document,"pointermove",this._handleFallbackAutoScroll):e.touches?v(document,"touchmove",this._handleFallbackAutoScroll):v(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){var e=t.originalEvent;this.options.dragOverBubble||e.rootEl||this._handleAutoScroll(e)},drop:function(){this.sortable.nativeDraggable?m(document,"dragover",this._handleAutoScroll):(m(document,"pointermove",this._handleFallbackAutoScroll),m(document,"touchmove",this._handleFallbackAutoScroll),m(document,"mousemove",this._handleFallbackAutoScroll)),oe(),ne(),clearTimeout(E),E=void 0},nulling:function(){Qt=Vt=qt=ee=Jt=Zt=$t=null,te.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(t,e){var n=this,o=(t.touches?t.touches[0]:t).clientX,i=(t.touches?t.touches[0]:t).clientY,r=document.elementFromPoint(o,i);if(Qt=t,e||this.options.forceAutoScrollFallback||u||c||h){re(t,this.options,r,e);var a=k(r,!0);!ee||Jt&&o===Zt&&i===$t||(Jt&&oe(),Jt=setInterval((function(){var r=k(document.elementFromPoint(o,i),!0);r!==a&&(a=r,ne()),re(t,n.options,r,e)}),10),Zt=o,$t=i)}else{if(!this.options.bubbleScroll||k(r,!0)===x())return void ne();re(t,this.options,k(r,!1),!1)}}},i(t,{pluginName:"scroll",initializeByDefault:!0})}),Ht.mount(se,le);export{we as MultiDrag,Ht as Sortable,ce as Swap,Ht as default};
|